@antv/g-lite 2.0.11-alpha.1 → 2.0.11-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/dist/AbstractRenderer.d.ts +1 -0
  2. package/dist/AbstractRenderer.d.ts.map +1 -0
  3. package/dist/Canvas.d.ts +1 -0
  4. package/dist/Canvas.d.ts.map +1 -0
  5. package/dist/camera/Camera.d.ts +1 -0
  6. package/dist/camera/Camera.d.ts.map +1 -0
  7. package/dist/camera/Landmark.d.ts +1 -0
  8. package/dist/camera/Landmark.d.ts.map +1 -0
  9. package/dist/camera/index.d.ts +1 -0
  10. package/dist/camera/index.d.ts.map +1 -0
  11. package/dist/camera/interfaces.d.ts +1 -0
  12. package/dist/camera/interfaces.d.ts.map +1 -0
  13. package/dist/components/Cullable.d.ts +1 -0
  14. package/dist/components/Cullable.d.ts.map +1 -0
  15. package/dist/components/Geometry.d.ts +1 -0
  16. package/dist/components/Geometry.d.ts.map +1 -0
  17. package/dist/components/RBushNode.d.ts +1 -0
  18. package/dist/components/RBushNode.d.ts.map +1 -0
  19. package/dist/components/Renderable.d.ts +5 -0
  20. package/dist/components/Renderable.d.ts.map +1 -0
  21. package/dist/components/Sortable.d.ts +1 -0
  22. package/dist/components/Sortable.d.ts.map +1 -0
  23. package/dist/components/Transform.d.ts +5 -0
  24. package/dist/components/Transform.d.ts.map +1 -0
  25. package/dist/components/index.d.ts +1 -0
  26. package/dist/components/index.d.ts.map +1 -0
  27. package/dist/css/CSS.d.ts +1 -0
  28. package/dist/css/CSS.d.ts.map +1 -0
  29. package/dist/css/CSSProperty.d.ts +1 -0
  30. package/dist/css/CSSProperty.d.ts.map +1 -0
  31. package/dist/css/CSSStyleValuePool.d.ts +1 -0
  32. package/dist/css/CSSStyleValuePool.d.ts.map +1 -0
  33. package/dist/css/StyleValueRegistry.d.ts +1 -0
  34. package/dist/css/StyleValueRegistry.d.ts.map +1 -0
  35. package/dist/css/cssom/CSSColorValue.d.ts +1 -0
  36. package/dist/css/cssom/CSSColorValue.d.ts.map +1 -0
  37. package/dist/css/cssom/CSSGradientValue.d.ts +1 -0
  38. package/dist/css/cssom/CSSGradientValue.d.ts.map +1 -0
  39. package/dist/css/cssom/CSSKeywordValue.d.ts +1 -0
  40. package/dist/css/cssom/CSSKeywordValue.d.ts.map +1 -0
  41. package/dist/css/cssom/CSSMathOperator.d.ts +1 -0
  42. package/dist/css/cssom/CSSMathOperator.d.ts.map +1 -0
  43. package/dist/css/cssom/CSSNumericSumValue.d.ts +1 -0
  44. package/dist/css/cssom/CSSNumericSumValue.d.ts.map +1 -0
  45. package/dist/css/cssom/CSSNumericValue.d.ts +1 -0
  46. package/dist/css/cssom/CSSNumericValue.d.ts.map +1 -0
  47. package/dist/css/cssom/CSSRGB.d.ts +1 -0
  48. package/dist/css/cssom/CSSRGB.d.ts.map +1 -0
  49. package/dist/css/cssom/CSSStyleValue.d.ts +1 -0
  50. package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -0
  51. package/dist/css/cssom/index.d.ts +1 -0
  52. package/dist/css/cssom/index.d.ts.map +1 -0
  53. package/dist/css/cssom/types.d.ts +1 -0
  54. package/dist/css/cssom/types.d.ts.map +1 -0
  55. package/dist/css/index.d.ts +1 -0
  56. package/dist/css/index.d.ts.map +1 -0
  57. package/dist/css/interfaces.d.ts +1 -0
  58. package/dist/css/interfaces.d.ts.map +1 -0
  59. package/dist/css/parser/color.d.ts +1 -0
  60. package/dist/css/parser/color.d.ts.map +1 -0
  61. package/dist/css/parser/dimension.d.ts +1 -0
  62. package/dist/css/parser/dimension.d.ts.map +1 -0
  63. package/dist/css/parser/filter.d.ts +1 -0
  64. package/dist/css/parser/filter.d.ts.map +1 -0
  65. package/dist/css/parser/gradient.d.ts +1 -0
  66. package/dist/css/parser/gradient.d.ts.map +1 -0
  67. package/dist/css/parser/index.d.ts +1 -0
  68. package/dist/css/parser/index.d.ts.map +1 -0
  69. package/dist/css/parser/numeric.d.ts +1 -0
  70. package/dist/css/parser/numeric.d.ts.map +1 -0
  71. package/dist/css/parser/path.d.ts +1 -0
  72. package/dist/css/parser/path.d.ts.map +1 -0
  73. package/dist/css/parser/points.d.ts +1 -0
  74. package/dist/css/parser/points.d.ts.map +1 -0
  75. package/dist/css/parser/transform-origin.d.ts +1 -0
  76. package/dist/css/parser/transform-origin.d.ts.map +1 -0
  77. package/dist/css/parser/transform.d.ts +1 -0
  78. package/dist/css/parser/transform.d.ts.map +1 -0
  79. package/dist/css/parser/types.d.ts +1 -0
  80. package/dist/css/parser/types.d.ts.map +1 -0
  81. package/dist/css/properties/CSSPropertyAngle.d.ts +1 -0
  82. package/dist/css/properties/CSSPropertyAngle.d.ts.map +1 -0
  83. package/dist/css/properties/CSSPropertyClipPath.d.ts +1 -0
  84. package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -0
  85. package/dist/css/properties/CSSPropertyColor.d.ts +1 -0
  86. package/dist/css/properties/CSSPropertyColor.d.ts.map +1 -0
  87. package/dist/css/properties/CSSPropertyFilter.d.ts +1 -0
  88. package/dist/css/properties/CSSPropertyFilter.d.ts.map +1 -0
  89. package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts +1 -0
  90. package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -0
  91. package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts +1 -0
  92. package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts.map +1 -0
  93. package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts +1 -0
  94. package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts.map +1 -0
  95. package/dist/css/properties/CSSPropertyMarker.d.ts +1 -0
  96. package/dist/css/properties/CSSPropertyMarker.d.ts.map +1 -0
  97. package/dist/css/properties/CSSPropertyNumber.d.ts +1 -0
  98. package/dist/css/properties/CSSPropertyNumber.d.ts.map +1 -0
  99. package/dist/css/properties/CSSPropertyOffsetDistance.d.ts +1 -0
  100. package/dist/css/properties/CSSPropertyOffsetDistance.d.ts.map +1 -0
  101. package/dist/css/properties/CSSPropertyOpacity.d.ts +1 -0
  102. package/dist/css/properties/CSSPropertyOpacity.d.ts.map +1 -0
  103. package/dist/css/properties/CSSPropertyPath.d.ts +1 -0
  104. package/dist/css/properties/CSSPropertyPath.d.ts.map +1 -0
  105. package/dist/css/properties/CSSPropertyPoints.d.ts +1 -0
  106. package/dist/css/properties/CSSPropertyPoints.d.ts.map +1 -0
  107. package/dist/css/properties/CSSPropertyShadowBlur.d.ts +1 -0
  108. package/dist/css/properties/CSSPropertyShadowBlur.d.ts.map +1 -0
  109. package/dist/css/properties/CSSPropertyText.d.ts +1 -0
  110. package/dist/css/properties/CSSPropertyText.d.ts.map +1 -0
  111. package/dist/css/properties/CSSPropertyTextTransform.d.ts +1 -0
  112. package/dist/css/properties/CSSPropertyTextTransform.d.ts.map +1 -0
  113. package/dist/css/properties/CSSPropertyTransform.d.ts +1 -0
  114. package/dist/css/properties/CSSPropertyTransform.d.ts.map +1 -0
  115. package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +1 -0
  116. package/dist/css/properties/CSSPropertyTransformOrigin.d.ts.map +1 -0
  117. package/dist/css/properties/CSSPropertyZIndex.d.ts +1 -0
  118. package/dist/css/properties/CSSPropertyZIndex.d.ts.map +1 -0
  119. package/dist/css/properties/index.d.ts +1 -0
  120. package/dist/css/properties/index.d.ts.map +1 -0
  121. package/dist/display-objects/Circle.d.ts +1 -0
  122. package/dist/display-objects/Circle.d.ts.map +1 -0
  123. package/dist/display-objects/CustomElement.d.ts +1 -0
  124. package/dist/display-objects/CustomElement.d.ts.map +1 -0
  125. package/dist/display-objects/DisplayObject.d.ts +1 -0
  126. package/dist/display-objects/DisplayObject.d.ts.map +1 -0
  127. package/dist/display-objects/Ellipse.d.ts +1 -0
  128. package/dist/display-objects/Ellipse.d.ts.map +1 -0
  129. package/dist/display-objects/Group.d.ts +1 -0
  130. package/dist/display-objects/Group.d.ts.map +1 -0
  131. package/dist/display-objects/HTML.d.ts +1 -0
  132. package/dist/display-objects/HTML.d.ts.map +1 -0
  133. package/dist/display-objects/Image.d.ts +1 -0
  134. package/dist/display-objects/Image.d.ts.map +1 -0
  135. package/dist/display-objects/Line.d.ts +1 -0
  136. package/dist/display-objects/Line.d.ts.map +1 -0
  137. package/dist/display-objects/Path.d.ts +1 -0
  138. package/dist/display-objects/Path.d.ts.map +1 -0
  139. package/dist/display-objects/Polygon.d.ts +1 -0
  140. package/dist/display-objects/Polygon.d.ts.map +1 -0
  141. package/dist/display-objects/Polyline.d.ts +1 -0
  142. package/dist/display-objects/Polyline.d.ts.map +1 -0
  143. package/dist/display-objects/Rect.d.ts +1 -0
  144. package/dist/display-objects/Rect.d.ts.map +1 -0
  145. package/dist/display-objects/Text.d.ts +1 -0
  146. package/dist/display-objects/Text.d.ts.map +1 -0
  147. package/dist/display-objects/constants.d.ts +1 -0
  148. package/dist/display-objects/constants.d.ts.map +1 -0
  149. package/dist/display-objects/index.d.ts +1 -0
  150. package/dist/display-objects/index.d.ts.map +1 -0
  151. package/dist/dom/CustomElementRegistry.d.ts +1 -0
  152. package/dist/dom/CustomElementRegistry.d.ts.map +1 -0
  153. package/dist/dom/CustomEvent.d.ts +1 -0
  154. package/dist/dom/CustomEvent.d.ts.map +1 -0
  155. package/dist/dom/Document.d.ts +1 -0
  156. package/dist/dom/Document.d.ts.map +1 -0
  157. package/dist/dom/Element.d.ts +1 -0
  158. package/dist/dom/Element.d.ts.map +1 -0
  159. package/dist/dom/EventTarget.d.ts +1 -0
  160. package/dist/dom/EventTarget.d.ts.map +1 -0
  161. package/dist/dom/FederatedEvent.d.ts +1 -0
  162. package/dist/dom/FederatedEvent.d.ts.map +1 -0
  163. package/dist/dom/FederatedMouseEvent.d.ts +1 -0
  164. package/dist/dom/FederatedMouseEvent.d.ts.map +1 -0
  165. package/dist/dom/FederatedPointerEvent.d.ts +1 -0
  166. package/dist/dom/FederatedPointerEvent.d.ts.map +1 -0
  167. package/dist/dom/FederatedWheelEvent.d.ts +1 -0
  168. package/dist/dom/FederatedWheelEvent.d.ts.map +1 -0
  169. package/dist/dom/MutationEvent.d.ts +1 -0
  170. package/dist/dom/MutationEvent.d.ts.map +1 -0
  171. package/dist/dom/Node.d.ts +1 -0
  172. package/dist/dom/Node.d.ts.map +1 -0
  173. package/dist/dom/index.d.ts +1 -0
  174. package/dist/dom/index.d.ts.map +1 -0
  175. package/dist/dom/interfaces.d.ts +1 -0
  176. package/dist/dom/interfaces.d.ts.map +1 -0
  177. package/dist/global-runtime.d.ts +1 -0
  178. package/dist/global-runtime.d.ts.map +1 -0
  179. package/dist/index.d.ts +1 -0
  180. package/dist/index.d.ts.map +1 -0
  181. package/dist/index.esm.js +2279 -2268
  182. package/dist/index.esm.js.map +1 -1
  183. package/dist/index.js +2278 -2267
  184. package/dist/index.js.map +1 -1
  185. package/dist/index.umd.min.js +1 -1
  186. package/dist/index.umd.min.js.map +1 -1
  187. package/dist/plugins/CullingPlugin.d.ts +1 -0
  188. package/dist/plugins/CullingPlugin.d.ts.map +1 -0
  189. package/dist/plugins/DirtyCheckPlugin.d.ts +1 -0
  190. package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -0
  191. package/dist/plugins/EventPlugin.d.ts +1 -0
  192. package/dist/plugins/EventPlugin.d.ts.map +1 -0
  193. package/dist/plugins/FrustumCullingStrategy.d.ts +1 -0
  194. package/dist/plugins/FrustumCullingStrategy.d.ts.map +1 -0
  195. package/dist/plugins/PrepareRendererPlugin.d.ts +1 -0
  196. package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -0
  197. package/dist/preset.d.ts +1 -0
  198. package/dist/preset.d.ts.map +1 -0
  199. package/dist/services/ContextService.d.ts +1 -0
  200. package/dist/services/ContextService.d.ts.map +1 -0
  201. package/dist/services/EventService.d.ts +1 -0
  202. package/dist/services/EventService.d.ts.map +1 -0
  203. package/dist/services/OffscreenCanvasCreator.d.ts +1 -0
  204. package/dist/services/OffscreenCanvasCreator.d.ts.map +1 -0
  205. package/dist/services/RenderingContext.d.ts +1 -0
  206. package/dist/services/RenderingContext.d.ts.map +1 -0
  207. package/dist/services/RenderingService.d.ts +4 -3
  208. package/dist/services/RenderingService.d.ts.map +1 -0
  209. package/dist/services/SceneGraphSelector.d.ts +1 -0
  210. package/dist/services/SceneGraphSelector.d.ts.map +1 -0
  211. package/dist/services/SceneGraphService.d.ts +17 -9
  212. package/dist/services/SceneGraphService.d.ts.map +1 -0
  213. package/dist/services/TextService.d.ts +1 -0
  214. package/dist/services/TextService.d.ts.map +1 -0
  215. package/dist/services/aabb/CircleUpdater.d.ts +1 -0
  216. package/dist/services/aabb/CircleUpdater.d.ts.map +1 -0
  217. package/dist/services/aabb/EllipseUpdater.d.ts +1 -0
  218. package/dist/services/aabb/EllipseUpdater.d.ts.map +1 -0
  219. package/dist/services/aabb/GroupUpdater.d.ts +1 -0
  220. package/dist/services/aabb/GroupUpdater.d.ts.map +1 -0
  221. package/dist/services/aabb/HTMLUpdater.d.ts +1 -0
  222. package/dist/services/aabb/HTMLUpdater.d.ts.map +1 -0
  223. package/dist/services/aabb/LineUpdater.d.ts +1 -0
  224. package/dist/services/aabb/LineUpdater.d.ts.map +1 -0
  225. package/dist/services/aabb/PathUpdater.d.ts +1 -0
  226. package/dist/services/aabb/PathUpdater.d.ts.map +1 -0
  227. package/dist/services/aabb/PolylineUpdater.d.ts +1 -0
  228. package/dist/services/aabb/PolylineUpdater.d.ts.map +1 -0
  229. package/dist/services/aabb/RectUpdater.d.ts +1 -0
  230. package/dist/services/aabb/RectUpdater.d.ts.map +1 -0
  231. package/dist/services/aabb/TextUpdater.d.ts +1 -0
  232. package/dist/services/aabb/TextUpdater.d.ts.map +1 -0
  233. package/dist/services/aabb/index.d.ts +1 -0
  234. package/dist/services/aabb/index.d.ts.map +1 -0
  235. package/dist/services/aabb/interfaces.d.ts +1 -0
  236. package/dist/services/aabb/interfaces.d.ts.map +1 -0
  237. package/dist/services/index.d.ts +1 -0
  238. package/dist/services/index.d.ts.map +1 -0
  239. package/dist/services/interfaces.d.ts +1 -0
  240. package/dist/services/interfaces.d.ts.map +1 -0
  241. package/dist/shapes/AABB.d.ts +1 -0
  242. package/dist/shapes/AABB.d.ts.map +1 -0
  243. package/dist/shapes/Frustum.d.ts +1 -0
  244. package/dist/shapes/Frustum.d.ts.map +1 -0
  245. package/dist/shapes/Plane.d.ts +1 -0
  246. package/dist/shapes/Plane.d.ts.map +1 -0
  247. package/dist/shapes/Point.d.ts +1 -0
  248. package/dist/shapes/Point.d.ts.map +1 -0
  249. package/dist/shapes/Rectangle.d.ts +1 -0
  250. package/dist/shapes/Rectangle.d.ts.map +1 -0
  251. package/dist/shapes/index.d.ts +1 -0
  252. package/dist/shapes/index.d.ts.map +1 -0
  253. package/dist/types.d.ts +6 -0
  254. package/dist/types.d.ts.map +1 -0
  255. package/dist/utils/assert.d.ts +1 -0
  256. package/dist/utils/assert.d.ts.map +1 -0
  257. package/dist/utils/canvas.d.ts +2 -1
  258. package/dist/utils/canvas.d.ts.map +1 -0
  259. package/dist/utils/dom.d.ts +1 -0
  260. package/dist/utils/dom.d.ts.map +1 -0
  261. package/dist/utils/error.d.ts +1 -0
  262. package/dist/utils/error.d.ts.map +1 -0
  263. package/dist/utils/event.d.ts +1 -0
  264. package/dist/utils/event.d.ts.map +1 -0
  265. package/dist/utils/gradient.d.ts +1 -0
  266. package/dist/utils/gradient.d.ts.map +1 -0
  267. package/dist/utils/index.d.ts +1 -1
  268. package/dist/utils/index.d.ts.map +1 -0
  269. package/dist/utils/math.d.ts +1 -0
  270. package/dist/utils/math.d.ts.map +1 -0
  271. package/dist/utils/memoize.d.ts +1 -0
  272. package/dist/utils/memoize.d.ts.map +1 -0
  273. package/dist/utils/path.d.ts +1 -0
  274. package/dist/utils/path.d.ts.map +1 -0
  275. package/dist/utils/pointer-events.d.ts +1 -0
  276. package/dist/utils/pointer-events.d.ts.map +1 -0
  277. package/dist/utils/raf.d.ts +1 -0
  278. package/dist/utils/raf.d.ts.map +1 -0
  279. package/dist/utils/string.d.ts +1 -0
  280. package/dist/utils/string.d.ts.map +1 -0
  281. package/dist/utils/tapable/AsyncParallelHook.d.ts +1 -0
  282. package/dist/utils/tapable/AsyncParallelHook.d.ts.map +1 -0
  283. package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts +1 -0
  284. package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts.map +1 -0
  285. package/dist/utils/tapable/Hook.d.ts +1 -0
  286. package/dist/utils/tapable/Hook.d.ts.map +1 -0
  287. package/dist/utils/tapable/SyncHook.d.ts +1 -0
  288. package/dist/utils/tapable/SyncHook.d.ts.map +1 -0
  289. package/dist/utils/tapable/SyncWaterfallHook.d.ts +1 -0
  290. package/dist/utils/tapable/SyncWaterfallHook.d.ts.map +1 -0
  291. package/dist/utils/tapable/index.d.ts +1 -0
  292. package/dist/utils/tapable/index.d.ts.map +1 -0
  293. package/dist/utils/text.d.ts +1 -0
  294. package/dist/utils/text.d.ts.map +1 -0
  295. package/dist/utils/transform-mat4.d.ts +1 -0
  296. package/dist/utils/transform-mat4.d.ts.map +1 -0
  297. package/package.json +2 -2
  298. package/dist/utils/assign.d.ts +0 -6
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";var e=1e-6,n="undefined"!=typeof Float32Array?Float32Array:Array;function r(){var t=new n(9);return n!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function i(){var t=new n(16);return n!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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}function a(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,y,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=p,t[12]=f,t[13]=d,t[14]=y,t[15]=v,t}function s(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 u(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function c(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=n*s-r*a,x=n*u-i*a,E=n*c-o*a,b=r*u-i*s,M=r*c-o*s,S=i*c-o*u,T=l*y-h*d,P=l*v-p*d,w=l*g-f*d,N=h*v-p*y,C=h*g-f*y,k=p*g-f*v,A=m*k-x*C+E*N+b*w-M*P+S*T;return A?(t[0]=(s*k-u*C+c*N)*(A=1/A),t[1]=(i*C-r*k-o*N)*A,t[2]=(y*S-v*M+g*b)*A,t[3]=(p*M-h*S-f*b)*A,t[4]=(u*w-a*k-c*P)*A,t[5]=(n*k-i*w+o*P)*A,t[6]=(v*E-d*S-g*x)*A,t[7]=(l*S-p*E+f*x)*A,t[8]=(a*C-s*w+c*T)*A,t[9]=(r*w-n*C-o*T)*A,t[10]=(d*M-y*E+g*m)*A,t[11]=(h*E-l*M-f*m)*A,t[12]=(s*P-a*N-u*T)*A,t[13]=(n*N-r*P+i*T)*A,t[14]=(y*x-d*b-v*m)*A,t[15]=(l*b-h*x+p*m)*A,t):null}function l(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];return(e*a-n*o)*(h*v-p*y)-(e*s-r*o)*(l*v-p*d)+(e*u-i*o)*(l*y-h*d)+(n*s-r*a)*(c*v-p*f)-(n*u-i*a)*(c*y-h*f)+(r*u-i*s)*(c*d-l*f)}function h(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=n[0],E=n[1],b=n[2],M=n[3];return t[0]=x*r+E*s+b*h+M*y,t[1]=x*i+E*u+b*p+M*v,t[2]=x*o+E*c+b*f+M*g,t[3]=x*a+E*l+b*d+M*m,t[4]=(x=n[4])*r+(E=n[5])*s+(b=n[6])*h+(M=n[7])*y,t[5]=x*i+E*u+b*p+M*v,t[6]=x*o+E*c+b*f+M*g,t[7]=x*a+E*l+b*d+M*m,t[8]=(x=n[8])*r+(E=n[9])*s+(b=n[10])*h+(M=n[11])*y,t[9]=x*i+E*u+b*p+M*v,t[10]=x*o+E*c+b*f+M*g,t[11]=x*a+E*l+b*d+M*m,t[12]=(x=n[12])*r+(E=n[13])*s+(b=n[14])*h+(M=n[15])*y,t[13]=x*i+E*u+b*p+M*v,t[14]=x*o+E*c+b*f+M*g,t[15]=x*a+E*l+b*d+M*m,t}function p(t,e,n){var r,i,o,a,s,u,c,l,h,p,f,d,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*g+e[12],t[13]=i*y+u*v+p*g+e[13],t[14]=o*y+c*v+f*g+e[14],t[15]=a*y+l*v+d*g+e[15]),t}function f(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];return 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]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t}function d(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],p=e[11];return 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]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-p*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+p*i,t}function y(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(t,n,r){var i,o,a,s=r[0],u=r[1],c=r[2],l=Math.hypot(s,u,c);return e>l?null:(s*=l=1/l,u*=l,c*=l,i=Math.sin(n),t[0]=s*s*(a=1-(o=Math.cos(n)))+o,t[1]=u*s*a+c*i,t[2]=c*s*a-u*i,t[3]=0,t[4]=s*u*a-c*i,t[5]=u*u*a+o,t[6]=c*u*a+s*i,t[7]=0,t[8]=s*c*a+u*i,t[9]=u*c*a-s*i,t[10]=c*c*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function m(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function x(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function E(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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 b(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,p=r*c,f=i*u,d=i*c,y=o*c,v=a*s,g=a*u,m=a*c;return t[0]=1-(f+y),t[1]=h+m,t[2]=p-g,t[3]=0,t[4]=h-m,t[5]=1-(l+y),t[6]=d+v,t[7]=0,t[8]=p+g,t[9]=d-v,t[10]=1-(l+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function M(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function S(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function T(t,e){var r=new n(3);S(r,e);var i=1/r[0],o=1/r[1],a=1/r[2],s=e[0]*i,u=e[1]*o,c=e[2]*a,l=e[4]*i,h=e[5]*o,p=e[6]*a,f=e[8]*i,d=e[9]*o,y=e[10]*a,v=s+h+y,g=0;return v>0?(t[3]=.25*(g=2*Math.sqrt(v+1)),t[0]=(p-d)/g,t[1]=(f-c)/g,t[2]=(u-l)/g):s>h&&s>y?(t[3]=(p-d)/(g=2*Math.sqrt(1+s-h-y)),t[0]=.25*g,t[1]=(u+l)/g,t[2]=(f+c)/g):h>y?(t[3]=(f-c)/(g=2*Math.sqrt(1+h-s-y)),t[0]=(u+l)/g,t[1]=.25*g,t[2]=(p+d)/g):(t[3]=(u-l)/(g=2*Math.sqrt(1+y-s-h)),t[0]=(f+c)/g,t[1]=(p+d)/g,t[2]=.25*g),t}function P(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,y=a*l,v=a*h,g=s*h,m=u*c,x=u*l,E=u*h,b=r[0],M=r[1],S=r[2],T=i[0],P=i[1],w=i[2],N=(1-(y+g))*b,C=(f+E)*b,k=(d-x)*b,A=(f-E)*M,R=(1-(p+g))*M,O=(v+m)*M,L=(d+x)*S,I=(v-m)*S,D=(1-(p+y))*S;return t[0]=N,t[1]=C,t[2]=k,t[3]=0,t[4]=A,t[5]=R,t[6]=O,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+T-(N*T+A*P+L*w),t[13]=n[1]+P-(C*T+R*P+I*w),t[14]=n[2]+w-(k*T+O*P+D*w),t[15]=1,t}function w(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=p-v,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function N(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function C(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var k=C;function A(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t}function R(t,n,r,i){var o,a,u,c,l,h,p,f,d,y,v=n[0],g=n[1],m=n[2],x=i[0],E=i[1],b=i[2],M=r[0],S=r[1],T=r[2];return e>Math.abs(v-M)&&e>Math.abs(g-S)&&e>Math.abs(m-T)?s(t):(y=1/Math.hypot(p=v-M,f=g-S,d=m-T),(y=Math.hypot(o=E*(d*=y)-b*(f*=y),a=b*(p*=y)-x*d,u=x*f-E*p))?(o*=y=1/y,a*=y,u*=y):(o=0,a=0,u=0),(y=Math.hypot(c=f*u-d*a,l=d*o-p*u,h=p*a-f*o))?(c*=y=1/y,l*=y,h*=y):(c=0,l=0,h=0),t[0]=o,t[1]=c,t[2]=p,t[3]=0,t[4]=a,t[5]=l,t[6]=f,t[7]=0,t[8]=u,t[9]=h,t[10]=d,t[11]=0,t[12]=-(o*v+a*g+u*m),t[13]=-(c*v+l*g+h*m),t[14]=-(p*v+f*g+d*m),t[15]=1,t)}function O(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var L=h,I=Object.freeze({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15];return t[0]=s*(p*g-f*v)-h*(u*g-c*v)+y*(u*f-c*p),t[1]=-(r*(p*g-f*v)-h*(i*g-o*v)+y*(i*f-o*p)),t[2]=r*(u*g-c*v)-s*(i*g-o*v)+y*(i*c-o*u),t[3]=-(r*(u*f-c*p)-s*(i*f-o*p)+h*(i*c-o*u)),t[4]=-(a*(p*g-f*v)-l*(u*g-c*v)+d*(u*f-c*p)),t[5]=n*(p*g-f*v)-l*(i*g-o*v)+d*(i*f-o*p),t[6]=-(n*(u*g-c*v)-a*(i*g-o*v)+d*(i*c-o*u)),t[7]=n*(u*f-c*p)-a*(i*f-o*p)+l*(i*c-o*u),t[8]=a*(h*g-f*y)-l*(s*g-c*y)+d*(s*f-c*h),t[9]=-(n*(h*g-f*y)-l*(r*g-o*y)+d*(r*f-o*h)),t[10]=n*(s*g-c*y)-a*(r*g-o*y)+d*(r*c-o*s),t[11]=-(n*(s*f-c*h)-a*(r*f-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*v-p*y)-l*(s*v-u*y)+d*(s*p-u*h)),t[13]=n*(h*v-p*y)-l*(r*v-i*y)+d*(r*p-i*h),t[14]=-(n*(s*v-u*y)-a*(r*v-i*y)+d*(r*u-i*s)),t[15]=n*(s*p-u*h)-a*(r*p-i*h)+l*(r*u-i*s),t},clone:function(t){var e=new n(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:o,create:i,determinant:l,equals:function(t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],p=t[9],f=t[10],d=t[11],y=t[12],v=t[13],g=t[14],m=t[15],x=n[0],E=n[1],b=n[2],M=n[3],S=n[4],T=n[5],P=n[6],w=n[7],N=n[8],C=n[9],k=n[10],A=n[11],R=n[12],O=n[13],L=n[14],I=n[15];return!(Math.abs(r-x)>e*Math.max(1,Math.abs(r),Math.abs(x))||Math.abs(i-E)>e*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(o-b)>e*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(a-M)>e*Math.max(1,Math.abs(a),Math.abs(M))||Math.abs(s-S)>e*Math.max(1,Math.abs(s),Math.abs(S))||Math.abs(u-T)>e*Math.max(1,Math.abs(u),Math.abs(T))||Math.abs(c-P)>e*Math.max(1,Math.abs(c),Math.abs(P))||Math.abs(l-w)>e*Math.max(1,Math.abs(l),Math.abs(w))||Math.abs(h-N)>e*Math.max(1,Math.abs(h),Math.abs(N))||Math.abs(p-C)>e*Math.max(1,Math.abs(p),Math.abs(C))||Math.abs(f-k)>e*Math.max(1,Math.abs(f),Math.abs(k))||Math.abs(d-A)>e*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(y-R)>e*Math.max(1,Math.abs(y),Math.abs(R))||Math.abs(v-O)>e*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(g-L)>e*Math.max(1,Math.abs(g),Math.abs(L))||Math.abs(m-I)>e*Math.max(1,Math.abs(m),Math.abs(I)))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&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]},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},fromQuat:w,fromQuat2:function(t,e){var r=new n(3),i=-e[0],o=-e[1],a=-e[2],s=e[3],u=e[4],c=e[5],l=e[6],h=e[7],p=i*i+o*o+a*a+s*s;return p>0?(r[0]=2*(u*s+h*i+c*a-l*o)/p,r[1]=2*(c*s+h*o+l*i-u*a)/p,r[2]=2*(l*s+h*a+u*o-c*i)/p):(r[0]=2*(u*s+h*i+c*a-l*o),r[1]=2*(c*s+h*o+l*i-u*a),r[2]=2*(l*s+h*a+u*o-c*i)),b(t,e,r),t},fromRotation:g,fromRotationTranslation:b,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,p=i*c,f=i*l,d=o*c,y=o*l,v=a*l,g=s*u,m=s*c,x=s*l,E=r[0],b=r[1],M=r[2];return t[0]=(1-(d+v))*E,t[1]=(p+x)*E,t[2]=(f-m)*E,t[3]=0,t[4]=(p-x)*b,t[5]=(1-(h+v))*b,t[6]=(y+g)*b,t[7]=0,t[8]=(f+m)*M,t[9]=(y-g)*M,t[10]=(1-(h+d))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:P,fromScaling:v,fromTranslation:y,fromValues:function(t,e,r,i,o,a,s,u,c,l,h,p,f,d,y,v){var g=new n(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=i,g[4]=o,g[5]=a,g[6]=s,g[7]=u,g[8]=c,g[9]=l,g[10]=h,g[11]=p,g[12]=f,g[13]=d,g[14]=y,g[15]=v,g},fromXRotation:m,fromYRotation:x,fromZRotation:E,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},getRotation:T,getScaling:S,getTranslation:M,identity:s,invert:c,lookAt:R,mul:L,multiply:h,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},ortho:k,orthoNO:C,orthoZO:A,perspective:N,perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},perspectiveNO:N,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},rotate:function(t,n,r,i){var o,a,s,u,c,l,h,p,f,d,y,v,g,m,x,E,b,M,S,T,P,w,N,C,k=i[0],A=i[1],R=i[2],O=Math.hypot(k,A,R);return e>O?null:(k*=O=1/O,A*=O,R*=O,o=Math.sin(r),c=n[1],l=n[2],h=n[3],f=n[5],d=n[6],y=n[7],g=n[9],m=n[10],x=n[11],S=k*A*(s=1-(a=Math.cos(r)))-R*o,T=A*A*s+a,P=R*A*s+k*o,w=k*R*s+A*o,N=A*R*s-k*o,C=R*R*s+a,t[0]=(u=n[0])*(E=k*k*s+a)+(p=n[4])*(b=A*k*s+R*o)+(v=n[8])*(M=R*k*s-A*o),t[1]=c*E+f*b+g*M,t[2]=l*E+d*b+m*M,t[3]=h*E+y*b+x*M,t[4]=u*S+p*T+v*P,t[5]=c*S+f*T+g*P,t[6]=l*S+d*T+m*P,t[7]=h*S+y*T+x*P,t[8]=u*w+p*N+v*C,t[9]=c*w+f*N+g*C,t[10]=l*w+d*N+m*C,t[11]=h*w+y*N+x*C,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)},rotateX:f,rotateY:d,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],p=e[7];return 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]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t},scale:function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},set:a,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:O,subtract:O,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],p=a-n[2],f=l*l+h*h+p*p;f>0&&(l*=f=1/Math.sqrt(f),h*=f,p*=f);var d=u*p-c*h,y=c*l-s*p,v=s*h-u*l;return(f=d*d+y*y+v*v)>0&&(d*=f=1/Math.sqrt(f),y*=f,v*=f),t[0]=d,t[1]=y,t[2]=v,t[3]=0,t[4]=h*v-p*y,t[5]=p*d-l*v,t[6]=l*y-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},translate:p,transpose:u});function D(){var t=new n(3);return n!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _(t){return Math.hypot(t[0],t[1],t[2])}function G(t,e,r){var i=new n(3);return i[0]=t,i[1]=e,i[2]=r,i}function U(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function B(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function F(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function V(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function j(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Y(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function H(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function X(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function W(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}var z=V,q=_;function Z(){var t=new n(4);return n!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $(t,e,r,i){var o=new n(4);return o[0]=t,o[1]=e,o[2]=r,o[3]=i,o}function K(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function Q(){var t=new n(4);return n!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function J(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function tt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function et(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function nt(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(e*=i),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}D(),function(){var t=Z()}();var rt=$,it=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ot=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},at=tt,st=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};function ut(){var t=new n(2);return n!=Float32Array&&(t[0]=0,t[1]=0),t}D(),G(1,0,0),G(0,1,0),Q(),Q(),r(),function(){var t=ut()}(),n=Array;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var ct={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(o,Math.floor(r+(s-u)*l/s+h)),a)}var p=t[r],f=i,d=o;for(n(t,i,r),a(t[o],p)>0&&n(t,i,o);d>f;){for(n(t,f,d),f++,d--;0>a(t[f],p);)f++;for(;a(t[d],p)>0;)d--}0===a(t[i],p)?n(t,i,d):n(t,++d,o),d>r||(i=d+1),r>d||(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;n>o;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function v(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,n,r,i,o){for(var a=[n,r];a.length;)if((r=a.pop())-(n=a.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;e.children.length>o;o++){var a=e.children[o],s=e.leaf?r(a):a;v(t,s)&&(e.leaf?n.push(a):y(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(v(t,o)){if(e.leaf||y(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=g([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=c.pop(),i=!0),a.leaf){var l=o(t,a.children,e);if(-1!==l)return a.children.splice(l,1),u.push(a),this._condense(u),this}i||a.leaf||!y(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(s>=o)return a(i=g(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(o/Math.pow(s,(r=Math.ceil(Math.log(o)/Math.log(s)))-1))),(i=g([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),c=u*Math.ceil(Math.sqrt(s));m(t,e,n,c,this.compareMinX);for(var l=e;n>=l;l+=c){var h=Math.min(l+c-1,n);m(t,l,h,u,this.compareMinY);for(var p=l;h>=p;p+=u)i.children.push(this._build(t,p,Math.min(p+u-1,h),r-1))}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;e.children.length>s;s++){var u=e.children[s],c=h(u),l=f(t,u)-c;o>l?(o=l,i=i>c?c:i,a=u):l===o&&i>c&&(i=c,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=g(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;n-e>=a;a++){var u=s(t,0,a,this.toBBox),c=s(t,a,n,this.toBBox),l=d(u,c),p=h(u)+h(c);i>l?(i=l,r=a,o=o>p?p:o):l===i&&o>p&&(o=p,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),c=p(o)+p(a),l=e;n-e>l;l++){var h=t.children[l];u(o,t.leaf?i(h):h),c+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];u(a,t.leaf?i(d):d),c+=p(a)}return c},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()}(ct);var lt=ct.exports,ht=function(t,e){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ht(t,e)};function pt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function n(){this.constructor=t}ht(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ft,dt,yt=function(){return yt=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},yt.apply(this,arguments)};function vt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);r.length>i;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function gt(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function mt(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&i[3]>s[1])){a.label=s[1];break}if(6===s[0]&&i[1]>a.label){a.label=i[1],i=s;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function xt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Et(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function bt(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;o>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError,t.Shape=void 0,(ft=t.Shape||(t.Shape={})).GROUP="g",ft.CIRCLE="circle",ft.ELLIPSE="ellipse",ft.IMAGE="image",ft.RECT="rect",ft.LINE="line",ft.POLYLINE="polyline",ft.POLYGON="polygon",ft.TEXT="text",ft.PATH="path",ft.HTML="html",ft.MESH="mesh",t.ClipSpaceNearZ=void 0,(dt=t.ClipSpaceNearZ||(t.ClipSpaceNearZ={}))[dt.ZERO=0]="ZERO",dt[dt.NEGATIVE_ONE=1]="NEGATIVE_ONE";var Mt=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),St=function(){function e(e){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.plugins=[],this.config=yt({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableSizeAttenuation:!0,imageSmoothingEnabled:!0,imageSmoothingQuality:"high"},e)}return e.prototype.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.prototype.getPlugins=function(){return this.plugins},e.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(t){Object.assign(this.config,t)},e}(),Tt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(p=1,u=Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(Tt);var Pt,wt=Tt.exports,Nt=F,Ct=U,kt=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},At=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Rt=j,Ot=z,Lt=function(){function t(){this.center=D(),this.halfExtents=D(),this.min=D(),this.max=D()}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){Ct(this.center,t),Ct(this.halfExtents,e),Ot(this.min,this.center,this.halfExtents),Nt(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Nt(this.center,e,t),Rt(this.center,this.center,.5),Ot(this.halfExtents,e,t),Rt(this.halfExtents,this.halfExtents,.5),Ct(this.min,t),Ct(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,p=i-u,f=i+u,d=o-c,y=o+c,v=e.center,g=v[0],m=v[1],x=v[2],E=e.halfExtents,b=E[0],M=E[1],S=E[2],T=g-b,P=g+b,w=m-M,N=m+M,C=x-S,k=x+S;l>T&&(l=T),P>h&&(h=P),p>w&&(p=w),N>f&&(f=N),d>C&&(d=C),k>y&&(y=k),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(c),x=Math.abs(l),E=Math.abs(h),b=Math.abs(p),M=Math.abs(f),S=Math.abs(d);n[0]=e[12]+a*i[0]+s*i[1]+u*i[2],n[1]=e[13]+c*i[0]+l*i[1]+h*i[2],n[2]=e[14]+p*i[0]+f*i[1]+d*i[2],r[0]=y*o[0]+v*o[1]+g*o[2],r[1]=m*o[0]+x*o[1]+E*o[2],r[2]=b*o[0]+M*o[1]+S*o[2],Ot(this.min,n,r),Nt(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=kt([0,0,0],this.getMin(),e.getMin()),i=At([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Ct([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Ct([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),It=function(){function t(t,e){this.distance=t||0,this.normal=e||G(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return H(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/q(this.normal);j(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&function(t,e,n,r){var i=e[0],o=e[1],a=e[2];t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a)}(n,t,e,i),o},t}();t.Mask=void 0,(Pt=t.Mask||(t.Mask={}))[Pt.OUTSIDE=4294967295]="OUTSIDE",Pt[Pt.INSIDE=0]="INSIDE",Pt[Pt.INDETERMINATE=2147483647]="INDETERMINATE";var Dt=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new It)}return t.prototype.extractFromVPMatrix=function(t){var e=Et(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15];B(this.planes[0].normal,o-n,c-a,f-l),this.planes[0].distance=g-d,B(this.planes[1].normal,o+n,c+a,f+l),this.planes[1].distance=g+d,B(this.planes[2].normal,o+r,c+s,f+h),this.planes[2].distance=g+y,B(this.planes[3].normal,o-r,c-s,f-h),this.planes[3].distance=g-y,B(this.planes[4].normal,o-i,c-u,f-p),this.planes[4].distance=g-v,B(this.planes[5].normal,o+i,c+u,f+p),this.planes[5].distance=g+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),_t=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Gt=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.applyTransform=function(e,n){var r=$(e.x,e.y,0,1),i=$(e.x+e.width,e.y,0,1),o=$(e.x,e.y+e.height,0,1),a=$(e.x+e.width,e.y+e.height,0,1),s=Z(),u=Z(),c=Z(),l=Z();K(s,r,n),K(u,i,n),K(c,o,n),K(l,a,n);var h=Math.min(s[0],u[0],c[0],l[0]),p=Math.min(s[1],u[1],c[1],l[1]);return t.fromRect({x:h,y:p,width:Math.max(s[0],u[0],c[0],l[0])-h,height:Math.max(s[1],u[1],c[1],l[1])-p})},t.prototype.toJSON=function(){},t}(),Ut="Method not implemented.",Bt="Use document.documentElement instead.",Ft=function(t){return"function"==typeof t},Vt=function(t){return null==t},jt={}.toString,Yt=function(t,e){return jt.call(t)==="[object "+e+"]"},Ht=function(t){return Array.isArray?Array.isArray(t):Yt(t,"Array")},Xt=function(t){if(Ht(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},Wt=function(t){if(Ht(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},zt=function(t){return Yt(t,"String")},qt=function(t,e,n){return e>t?e:t>n?n:t},Zt=function(t){return Yt(t,"Number")},$t=1e-5;function Kt(t,e,n){return void 0===n&&(n=$t),n>Math.abs(t-e)}var Qt=function(t,e){return(t%e+e)%e},Jt=function(t){return Yt(t,"Boolean")},te=function(t){return void 0===t},ee={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function ne(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var re={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ie(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return re[e]===t.length-1&&"achlmqstvz".includes(e)}))}function oe(t){return ie(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ae(t){return oe(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function se(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=re[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,re[n]))),re[n]););}function ue(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function ce(t){return t>=48&&57>=t||43===t||45===t||46===t}function le(t){return t>=48&&57>=t}function he(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),le(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&le(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&le(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;le(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!le(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&le(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function pe(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function fe(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=re[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,pe(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?he(t):ue(t),t.err.length)return;t.data.push(t.param),pe(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,pe(t))}if(t.index>=t.max)break;if(!ce(n.charCodeAt(t.index)))break}se(t)}else se(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var de=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function ye(t){if(oe(t))return[].concat(t);var e=function(t){if(ie(t))return[].concat(t);var e=new de(t);for(pe(e);e.max>e.index&&!e.err.length;)fe(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function ve(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].concat(s)}else if("T"===n){var h=2*r-e.qx,p=2*i-e.qy;e.qx=h,e.qy=p,u=["Q",h,p].concat(s)}else if("Q"===n){var f=s[1];e.qx=s[0],e.qy=f}return u}function ge(t){if(ae(t))return[].concat(t);for(var e=ye(t),n=yt({},ee),r=0;e.length>r;r+=1){e[r]=ve(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function me(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function xe(t,e,n,r,i,o,a,s,u,c){var l,h,p,f,d,y=t,v=e,g=n,m=r,x=s,E=u,b=120*Math.PI/180,M=Math.PI/180*(+i||0),S=[];if(c)h=c[0],p=c[1],f=c[2],d=c[3];else{v=(l=me(y,v,-M)).y;var T=((y=l.x)-(x=(l=me(x,E,-M)).x))/2,P=(v-(E=l.y))/2,w=T*T/(g*g)+P*P/(m*m);w>1&&(g*=w=Math.sqrt(w),m*=w);var N=g*g,C=m*m,k=(o===a?-1:1)*Math.sqrt(Math.abs((N*C-N*P*P-C*T*T)/(N*P*P+C*T*T)));f=k*g*P/m+(y+x)/2,h=Math.asin(((v-(d=k*-m*T/g+(v+E)/2))/m*1e9>>0)/1e9),p=Math.asin(((E-d)/m*1e9>>0)/1e9),0>(h=f>y?Math.PI-h:h)&&(h=2*Math.PI+h),0>(p=f>x?Math.PI-p:p)&&(p=2*Math.PI+p),a&&h>p&&(h-=2*Math.PI),!a&&p>h&&(p-=2*Math.PI)}var A=p-h;if(Math.abs(A)>b){var R=p,O=x,L=E;S=xe(x=f+g*Math.cos(p=h+b*(a&&p>h?1:-1)),E=d+m*Math.sin(p),g,m,i,0,a,O,L,[p,R,f,d])}A=p-h;var I=Math.cos(h),D=Math.sin(h),_=Math.cos(p),G=Math.sin(p),U=Math.tan(A/4),B=4/3*g*U,F=4/3*m*U,V=[y,v],j=[y+B*D,v-F*I],Y=[x+B*G,E-F*_],H=[x,E];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],c)return j.concat(Y,H,S);for(var X=[],W=0,z=(S=j.concat(Y,H,S)).length;z>W;W+=1)X[W]=W%2?me(S[W-1],S[W],M).y:me(S[W],S[W+1],M).x;return X}function Ee(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var be=function(t,e,n,r){return bt(bt([],Ee([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Me(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],p=l[1],f=e.x1,d=e.y1,y=e.x,v=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=p,t;case"A":return n=[f,d].concat(l),["C"].concat(xe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=p,n=[f,d].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(be(f,d,h,p));case"Z":return f===y&&d===v?["C",f,d,y,v,y,v]:["C"].concat(be(f,d,y,v))}return t}function Se(t,e){if(void 0===e&&(e=!1),function(t){return ae(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=ge(t),a=yt({},ee),s=[],u="",c=o.length,l=[],h=0;c>h;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var p=Me(o[h],a);o[h]=p,ne(o,s,h),c=o.length,"Z"===u&&l.push(h),a.x1=+(r=o[h])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,l]:o}function Te(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Pe(t,e,n,r,i){var o=Te([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=Ee([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function we(t,e){var n=t.x,r=t.y,i=e.x,o=e.y;return(0>n*o-r*i?-1:1)*Math.acos((n*i+r*o)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))))}function Ne(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,p=Math.cos,f=Math.sqrt,d=Math.PI,y=l(n),v=l(r),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return Pe(t,e,s,u,c).point;var m=(t-s)/2,x=(e-u)/2,E={x:p(g)*m+h(g)*x,y:-h(g)*m+p(g)*x},b=Math.pow(E.x,2)/Math.pow(y,2)+Math.pow(E.y,2)/Math.pow(v,2);b>1&&(y*=f(b),v*=f(b));var M=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(E.y,2)-Math.pow(v,2)*Math.pow(E.x,2))/(Math.pow(y,2)*Math.pow(E.y,2)+Math.pow(v,2)*Math.pow(E.x,2)),S=(o!==a?1:-1)*f(M=0>M?0:M),T=S*(y*E.y/v),P=S*(-v*E.x/y),w=p(g)*T-h(g)*P+(t+s)/2,N=h(g)*T+p(g)*P+(e+u)/2,C={x:(E.x-T)/y,y:(E.y-P)/v},k=we({x:1,y:0},C),A=we(C,{x:(-E.x-T)/y,y:(-E.y-P)/v});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var R=k+(A%=2*d)*c,O=y*p(R),L=v*h(R);return{x:p(g)*O-h(g)*L+w,y:h(g)*O+p(g)*L+N}}function Ce(t,e,n,r,i,o,a,s,u,c,l){var h,p=l.bbox,f=void 0===p||p,d=l.length,y=void 0===d||d,v=l.sampleSize,g=void 0===v?30:v,m="number"==typeof c,x=t,E=e,b=0,M=[x,E,b],S=[x,E],T={x:0,y:0},P=[{x:x,y:E}];m&&0>=c&&(T={x:x,y:E});for(var w=0;g>=w;w+=1){if(x=(h=Ne(t,e,n,r,i,o,a,s,u,w/g)).x,E=h.y,f&&P.push({x:x,y:E}),y&&(b+=Te(S,[x,E])),S=[x,E],m&&b>=c&&c>M[2]){var N=(b-c)/(b-M[2]);T={x:S[0]*(1-N)+M[0]*N,y:S[1]*(1-N)+M[1]*N}}M=[x,E,b]}return m&&c>=b&&(T={x:s,y:u}),{length:b,point:T,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function ke(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function Ae(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,p=void 0===h||h,f=c.length,d=void 0===f||f,y=c.sampleSize,v=void 0===y?10:y,g="number"==typeof u,m=t,x=e,E=0,b=[m,x,E],M=[m,x],S={x:0,y:0},T=[{x:m,y:x}];g&&0>=u&&(S={x:m,y:x});for(var P=0;v>=P;P+=1){if(m=(l=ke(t,e,n,r,i,o,a,s,P/v)).x,x=l.y,p&&T.push({x:m,y:x}),d&&(E+=Te(M,[m,x])),M=[m,x],g&&E>=u&&u>b[2]){var w=(E-u)/(E-b[2]);S={x:M[0]*(1-w)+b[0]*w,y:M[1]*(1-w)+b[1]*w}}b=[m,x,E]}return g&&u>=E&&(S={x:a,y:s}),{length:E,point:S,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,T.map((function(t){return t.x}))),y:Math.max.apply(null,T.map((function(t){return t.y})))}}}function Re(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Oe(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,p=void 0===h||h,f=s.sampleSize,d=void 0===f?10:f,y="number"==typeof a,v=t,g=e,m=0,x=[v,g,m],E=[v,g],b={x:0,y:0},M=[{x:v,y:g}];y&&0>=a&&(b={x:v,y:g});for(var S=0;d>=S;S+=1){if(v=(u=Re(t,e,n,r,i,o,S/d)).x,g=u.y,l&&M.push({x:v,y:g}),p&&(m+=Te(E,[v,g])),E=[v,g],y&&m>=a&&a>x[2]){var T=(m-a)/(m-x[2]);b={x:E[0]*(1-T)+x[0]*T,y:E[1]*(1-T)+x[1]*T}}x=[v,g,m]}return y&&a>=m&&(b={x:i,y:o}),{length:m,point:b,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function Le(t,e,n){for(var r,i,o,a,s,u,c,l,h,p=ge(t),f="number"==typeof e,d=[],y=0,v=0,g=0,m=0,x=[],E=[],b=0,M={x:0,y:0},S=M,T=M,P=M,w=0,N=0,C=p.length;C>N;N+=1)d=(c="M"===(l=(h=p[N])[0]))?d:[y,v].concat(h.slice(1)),c?(S=M={x:g=h[1],y:m=h[2]},b=0,f&&.001>e&&(P=M)):"L"===l?(b=(r=Pe(d[0],d[1],d[2],d[3],(e||0)-w)).length,M=r.min,S=r.max,T=r.point):"A"===l?(b=(i=Ce(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-w,n||{})).length,M=i.min,S=i.max,T=i.point):"C"===l?(b=(o=Ae(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-w,n||{})).length,M=o.min,S=o.max,T=o.point):"Q"===l?(b=(a=Oe(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-w,n||{})).length,M=a.min,S=a.max,T=a.point):"Z"===l&&(b=(s=Pe((d=[y,v,g,m])[0],d[1],d[2],d[3],(e||0)-w)).length,M=s.min,S=s.max,T=s.point),f&&e>w&&w+b>=e&&(P=T),E.push(S),x.push(M),w+=b,y=(u="Z"!==l?h.slice(-2):[g,m])[0],v=u[1];return f&&e>=w&&(P={x:y,y:v}),{length:w,point:P,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function Ie(t){return function(t){var e=0,n=0,r=0;return Se(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,p,f=t.slice(1);return r=3*(((p=f[5])-(a=n))*((s=f[0])+(c=f[2]))-((h=f[4])-(o=e))*((u=f[1])+(l=f[3]))+u*(o-c)-s*(a-l)+p*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function De(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Ae(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Ee(n,r,e),s=Ee(r,i,e),u=Ee(i,o,e),c=Ee(a,s,e),l=Ee(s,u,e),h=Ee(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function _e(t,e,n){var r=De(t),i=De(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:_e(y[0],y[1],h)}function Ge(t){return void 0===t?0:t>360||-360>t?t%360:t}var Ue=D();function Be(t,e,r,i){return void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=!0),Array.isArray(t)&&3===t.length?i?(o=t,(a=new n(3))[0]=o[0],a[1]=o[1],a[2]=o[2],a):U(Ue,t):Zt(t)?i?G(t,e,r):B(Ue,t,e,r):i?G(t[0],t[1]||e,t[2]||r):B(Ue,t[0],t[1]||e,t[2]||r);var o,a}var Fe=Math.PI/180;function Ve(t){return t*Fe}var je=180/Math.PI;function Ye(t){return t*je}function He(t){return 360*t}var Xe=Math.PI/2;function We(t,e){return 16===e.length?function(t,e){var n,r,i=Et(S(D(),e),3),o=i[0],a=i[1],s=i[2],u=Math.asin(-e[2]/o);return Xe>u?u>-Xe?(n=Math.atan2(e[6]/a,e[10]/s),r=Math.atan2(e[1]/o,e[0]/o)):(r=0,n=-Math.atan2(e[4]/a,e[5]/a)):(r=0,n=Math.atan2(e[4]/a,e[5]/a)),t[0]=n,t[1]=u,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Xe,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Xe,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function ze(t,e,r,i,o){var a,s,u,c,l,h,p,f,d,y,v=Math.cos(t),g=Math.sin(t);return a=i*v,s=o*g,u=0,c=-i*g,l=o*v,h=0,p=e,f=r,d=1,(y=new n(9))[0]=a,y[1]=s,y[2]=u,y[3]=c,y[4]=l,y[5]=h,y[6]=p,y[7]=f,y[8]=d,y}function qe(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?o=-o:a=-a),o){var s=1/o;e*=s,n*=s}if(a){var u=1/a;r*=u,i*=u}var c=Ye(Math.atan2(n,e));return[t[6],t[7],o,a,c]}var Ze,$e,Ke,Qe=i(),Je=i(),tn=Z(),en=[D(),D(),D()],nn=D();function rn(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}t.CameraType=void 0,(Ze=t.CameraType||(t.CameraType={}))[Ze.ORBITING=0]="ORBITING",Ze[Ze.EXPLORING=1]="EXPLORING",Ze[Ze.TRACKING=2]="TRACKING",t.CameraTrackingMode=void 0,($e=t.CameraTrackingMode||(t.CameraTrackingMode={}))[$e.DEFAULT=0]="DEFAULT",$e[$e.ROTATIONAL=1]="ROTATIONAL",$e[$e.TRANSLATIONAL=2]="TRANSLATIONAL",$e[$e.CINEMATIC=3]="CINEMATIC",t.CameraProjectionMode=void 0,(Ke=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Ke.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Ke[Ke.PERSPECTIVE=1]="PERSPECTIVE";var on,an,sn,un,cn,ln={UPDATED:"updated"},hn=2e-4,pn=function(){function e(){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.eventEmitter=new wt,this.matrix=i(),this.right=G(1,0,0),this.up=G(0,1,0),this.forward=G(0,0,1),this.position=G(0,0,1),this.focalPoint=G(0,0,0),this.distanceVector=G(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=i(),this.projectionMatrixInverse=i(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new Dt,this.orthoMatrix=i()}return e.prototype.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getDollyingStep=function(){return this.dollyingStep},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.getView=function(){return this.view},e.prototype.setEnableUpdate=function(t){this.enableUpdate=t},e.prototype.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},e.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.prototype.getViewTransform=function(){return c(i(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,e){var n=y(i(),[t,e,0]);this.jitteredProjectionMatrix=h(i(),n,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setProjectionMatrix=function(t){this.projectionMatrix=t},e.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},e.prototype.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},e.prototype.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=G(a.x-r,a.y-i,0),u=H(s,this.right)/_(this.right),c=H(s,this.up)/_(this.up),l=Et(this.getPosition(),2),h=l[0],p=l[1],f=Et(this.getFocalPoint(),2),d=f[0],y=f[1];return this.setPosition(h-u,p-c),this.setFocalPoint(d-u,y-c),this},e.prototype.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(Ve(.5*this.fov))/this.zoom,s=2*a,u=this.aspect*s,l=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var h=this.view.fullWidth,p=this.view.fullHeight;l+=this.view.offsetX*u/h,a-=this.view.offsetY*s/p,u*=this.view.width/h,s*=this.view.height/p}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var u,c,l=2*o,h=n-e,p=r-i,f=l/p,d=(n+e)/h,y=(r+i)/p,v=a-o,g=a*o;s?(u=-a/v,c=-g/v):(u=-(a+o)/v,c=-2*g/v),t[0]=l/h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=y,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,l,l+u,a-s,a,e,this.far,this.clipSpaceNearZ===t.ClipSpaceNearZ.ZERO),c(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.prototype.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),h=(this.rright+this.left)/2,p=(this.top+this.bottom)/2,f=h-u,d=h+u,y=p+l,v=p-l;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=g*this.view.offsetX)+g*this.view.width,v=(y-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===t.ClipSpaceNearZ.NEGATIVE_ONE?k(this.projectionMatrix,f,d,y,v,o,a):A(this.projectionMatrix,f,d,y,v,o,a),c(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=Be(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.prototype.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var o=G(0,1,0);if(this.focalPoint=Be(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var a=V(D(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var s=_(a),u=Ye(Math.asin(n/s)),l=90+Ye(Math.atan2(r,e)),h=i();d(h,h,Ve(l)),f(h,h,Ve(u)),o=W(D(),[0,1,0],h)}return c(this.matrix,R(i(),this.position,this.focalPoint,o)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.prototype.getDistance=function(){return this.distance},e.prototype.getDistanceVector=function(){return this.distanceVector},e.prototype.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,hn>this.distance&&(this.distance=hn),this.dollyingStep=this.distance/100;var e=D(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},e.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},e.prototype.setMinDistance=function(t){return this.minDistance=t,this},e.prototype.setAzimuth=function(e){return this.azimuth=Ge(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getAzimuth=function(){return this.azimuth},e.prototype.setElevation=function(e){return this.elevation=Ge(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getElevation=function(){return this.elevation},e.prototype.setRoll=function(e){return this.roll=Ge(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getRoll=function(){return this.roll},e.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.prototype.computeMatrix=function(){var e=J(Q(),[0,0,1],Ve(this.roll));s(this.matrix);var n=J(Q(),[1,0,0],Ve((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=J(Q(),[0,1,0],Ve((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),o=tt(Q(),r,n);o=tt(Q(),o,e);var a=w(i(),o);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(p(this.matrix,this.matrix,this.focalPoint),h(this.matrix,this.matrix,a),p(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(p(this.matrix,this.matrix,this.position),h(this.matrix,this.matrix,a))},e.prototype._setPosition=function(t,e,n){this.position=Be(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},e.prototype._getAxes=function(){U(this.right,Be(K(Z(),[1,0,0,0],this.matrix))),U(this.up,Be(K(Z(),[0,1,0,0],this.matrix))),U(this.forward,Be(K(Z(),[0,0,1,0],this.matrix))),Y(this.right,this.right),Y(this.up,this.up),Y(this.forward,this.forward)},e.prototype._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=_(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Ye(Math.asin(n/i)),this.azimuth=Ye(Math.atan2(-e,-r))):(this.elevation=-Ye(Math.asin(n/i)),this.azimuth=-Ye(Math.atan2(-e,-r)))},e.prototype._getPosition=function(){U(this.position,Be(K(Z(),[0,0,0,1],this.matrix))),this._getDistance()},e.prototype._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=r(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),F(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=V(D(),this.focalPoint,this.position),this.distance=_(this.distanceVector),this.dollyingStep=this.distance/100},e.prototype._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=J(Q(),[0,0,1],-this.roll*Math.PI/180);P(this.orthoMatrix,n,G((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),G(this.zoom,this.zoom,1),e)}},e.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=h(i(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(ln.UPDATED)}},e.prototype.rotate=function(t,e,n){throw Error(Ut)},e.prototype.pan=function(t,e){throw Error(Ut)},e.prototype.dolly=function(t){throw Error(Ut)},e.prototype.createLandmark=function(t,e){throw Error(Ut)},e.prototype.gotoLandmark=function(t,e){throw Error(Ut)},e.prototype.cancelLandmarkAnimation=function(){throw Error(Ut)},e}();function fn(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(fn.Cache||Map),n}fn.Cache=Map,t.UnitType=void 0,(on=t.UnitType||(t.UnitType={}))[on.kUnknown=0]="kUnknown",on[on.kNumber=1]="kNumber",on[on.kPercentage=2]="kPercentage",on[on.kEms=3]="kEms",on[on.kPixels=4]="kPixels",on[on.kRems=5]="kRems",on[on.kDegrees=6]="kDegrees",on[on.kRadians=7]="kRadians",on[on.kGradians=8]="kGradians",on[on.kTurns=9]="kTurns",on[on.kMilliseconds=10]="kMilliseconds",on[on.kSeconds=11]="kSeconds",on[on.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(an||(an={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(sn||(sn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(un||(un={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(cn||(cn={}));var dn,yn=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(dn||(dn={}));var vn,gn=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return yn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},mn=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},xn=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},En=function(){function e(){}return e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds},e.prototype.toString=function(){return this.buildCSSText(un.kNo,cn.kNo,"")},e.prototype.isNumericValue=function(){return this.getType()>=dn.kUnitType&&this.getType()<=dn.kClampType},e}(),bn=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return pt(e,t),e.prototype.getType=function(){return dn.kColorType},e.prototype.to=function(t){return this},e}(En);t.GradientType=void 0,(vn=t.GradientType||(t.GradientType={}))[vn.Constant=0]="Constant",vn[vn.LinearGradient=1]="LinearGradient",vn[vn.RadialGradient=2]="RadialGradient";var Mn=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return pt(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return dn.kColorType},e}(En),Sn=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return pt(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return dn.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(En),Tn=/-([a-z])/g,Pn=fn((function(t){return void 0===t&&(t=""),t.replace(Tn,(function(t){return t[1].toUpperCase()}))})),wn=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};var Nn={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Cn=fn((function(t){var e=Pn(t),n=Nn[e];return e=(null==n?void 0:n.alias)||e}));var kn,An,Rn=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},On=function(e){return function(e){switch(e){case an.kUNumber:return t.UnitType.kNumber;case an.kULength:return t.UnitType.kPixels;case an.kUPercent:return t.UnitType.kPercentage;case an.kUTime:return t.UnitType.kSeconds;case an.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return an.kUNumber;case t.UnitType.kPercentage:return an.kUPercent;case t.UnitType.kPixels:return an.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return an.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return an.kUAngle;default:return an.kUOther}}(e))},Ln=function(e){function n(n,r){void 0===r&&(r=t.UnitType.kNumber);var i,o=e.call(this)||this;return i="string"==typeof r?gn(r):r,o.unit=i,o.value=n,o}return pt(n,e),n.prototype.clone=function(){return new n(this.value,this.unit)},n.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},n.prototype.getType=function(){return dn.kUnitType},n.prototype.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=On(this.unit);if(r!==On(e)||r===t.UnitType.kUnknown)return null;var i=mn(this.unit)/mn(e);return new n(this.value*i,e)},n.prototype.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=xn(this.unit);if(-999999>o||o>999999){var s=xn(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?Rn(o,s):o+(s||"")}else i="".concat(o).concat(a)}return r+=i},n}(En),In=new Ln(0,"px"),Dn=new Ln(0,"deg"),_n=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return pt(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(bn),Gn=new Sn("unset"),Un=new Sn("initial"),Bn=new Sn("inherit"),Fn={"":Gn,unset:Gn,initial:Un,inherit:Bn},Vn=function(t){return Fn[t]||(Fn[t]=new Sn(t)),Fn[t]},jn=new _n(0,0,0,0,!0),Yn=new _n(0,0,0,0),Hn=fn((function(t,e,n,r){return new _n(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Xn=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Ln(e,n)};new Ln(50,"%"),t.Strategy=void 0,(kn=t.Strategy||(t.Strategy={}))[kn.Standard=0]="Standard",t.SortReason=void 0,(An=t.SortReason||(t.SortReason={}))[An.ADDED=0]="ADDED",An[An.REMOVED=1]="REMOVED",An[An.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED";var Wn={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Gt(0,0,0,0)};function zn(t,e){for(var n in e)t[n]=e[n]}var qn={},Zn=0;var $n="undefined"!=typeof window&&void 0!==window.document;function Kn(t){return!!t.getAttribute}function Qn(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Jn(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function tr(t,e){if($n)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var er={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},nr="object"==typeof performance&&performance.now?performance:Date;function rr(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var ir=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw Error(e+": "+t)}function r(){var t=f(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,u)||o("repeating-radial-gradient",t.repeatingRadialGradient,u)||o("conic-gradient",t.conicGradient,u)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:f(d)}}))}function a(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var o=r(i);return x(t.endCall)||n("Missing )"),o}}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function u(){var n,r,i=c();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=c())?n.push(i):e=r)),n}function c(){var t=function(){var t=m("shape",/^(circle)/i,0);t&&(t.style=g()||l());return t}()||function(){var t=m("shape",/^(ellipse)/i,0);t&&(t.style=v()||l());return t}();if(t)t.at=h();else{var e=l();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=p();r&&(t={type:"default-radial",at:r})}}return t}function l(){return m("extent-keyword",t.extentKeywords,1)}function h(){if(m("position",/^at/,0)){var t=p();return t||n("Missing positioning value"),t}}function p(){var t={x:v(),y:v()};if(t.x||t.y)return{type:"position",value:t}}function f(e){var r=e(),i=[];if(r)for(i.push(r);x(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function d(){var e=m("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:f(y)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:f(y)}}))||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=v(),e}function y(){return x(t.number)[1]}function v(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||g()}function g(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){var r=x(e);if(r)return{type:t,value:r[n]}}function x(t){var n=/^[\n\r\t\s]+/.exec(e);n&&E(n[0].length);var r=t.exec(e);return r&&E(r[0].length),r}function E(t){e=e.substring(t)}return function(t){return e=t,r()}}();function or(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ar(t,e){var n=Math.min.apply(Math,bt([],Et(t),!1)),r=Math.min.apply(Math,bt([],Et(e),!1));return{x:n,y:r,width:Math.max.apply(Math,bt([],Et(t),!1))-n,height:Math.max.apply(Math,bt([],Et(e),!1))-r}}function sr(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function ur(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function cr(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var p=s+h;a>o?p>o&&a>p&&l.push(p):p>a&&o>p&&l.push(p)}for(h=0;l.length>h;h++){var f=sr(t,0,n,r,i,l[h]);u>f&&(u=f),f>c&&(c=f)}var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,v=-1/0,g=[o,a];for(h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var m=d+h;a>o?m>o&&a>m&&g.push(m):m>a&&o>m&&g.push(m)}for(h=0;g.length>h;h++){var x=ur(0,e,n,r,i,g[h]);y>x&&(y=x),x>v&&(v=x)}return{x:u,y:y,width:c-u,height:v-y}}function lr(t,e,n,r){return or(t,e,n,r)}function hr(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function pr(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function fr(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(Kt(s,0))Kt(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;Kt(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function dr(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=fr(t,n,i,a),h=fr(e,r,o,s),p=0;l.length>p;p++)u.push(pr(t,n,i,a,l[p]));for(p=0;h.length>p;p++)c.push(pr(e,r,o,s,h[p]));return ar(u,c)}function yr(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=or(r[0],r[1],i[0],i[1])}return e}(t)}function vr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function gr(t,e,n){var r=t+n-2*e;if(Kt(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function mr(t,e,n,r,i,o){var a=gr(t,n,i)[0],s=gr(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(vr(t,n,i,a)),void 0!==s&&c.push(vr(e,r,o,s)),ar(u,c)}function xr(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Le(t.parsedStyle.d.absolutePath,void 0,yt(yt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Er(t,e){return t[0]===e[0]&&t[1]===e[1]}function br(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((o+a-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(o)*Math.sqrt(a)));if(!s||0===Math.sin(s)||Kt(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),c=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(c-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function Mr(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var Sr=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},Tr=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=Ve(r=Qt(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,l=(t.y-a.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},p=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);p>1&&(e*=Math.sqrt(p),n*=Math.sqrt(p));var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),d=(i!==o?1:-1)*Math.sqrt(f=0>f?0:f),y=d*(e*h.y/n),v=d*(-n*h.x/e),g={x:Math.cos(u)*y-Math.sin(u)*v+(t.x+a.x)/2,y:Math.sin(u)*y+Math.cos(u)*v+(t.y+a.y)/2},m={x:(h.x-y)/e,y:(h.y-v)/n},x=Sr({x:1,y:0},m),E=Sr(m,{x:(-h.x-y)/e,y:(-h.y-v)/n});!o&&E>0?E-=2*Math.PI:o&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*s,M=e*Math.cos(b),S=n*Math.sin(b);return{x:Math.cos(u)*M-Math.sin(u)*S+g.x,y:Math.sin(u)*M+Math.cos(u)*S+g.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function Pr(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,c=r.arcFlag,l=r.sweepFlag,h=Tr({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=Tr({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=p.x-h.x,d=p.y-h.y,y=Math.sqrt(f*f+d*d);return{x:-f/y,y:-d/y}}function wr(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Nr(t,e){return wr(t)*wr(e)?(t[0]*e[0]+t[1]*e[1])/(wr(t)*wr(e)):1}function Cr(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Nr(t,e))}function kr(t,e){var n=e[1],r=e[2],i=Qt(Ve(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,p=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,f=h*h/(n*n)+p*p/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var d=n*n*(p*p)+r*r*(h*h),y=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=r?y*n*p/r:0,g=n?y*-r*h/n:0,m=(s+c)/2+Math.cos(i)*v-Math.sin(i)*g,x=(u+l)/2+Math.sin(i)*v+Math.cos(i)*g,E=[(h-v)/n,(p-g)/r],b=[(-1*h-v)/n,(-1*p-g)/r],M=Cr([1,0],E),S=Cr(E,b);return Nr(E,b)>-1||(S=Math.PI),1>Nr(E,b)||(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&0>S&&(S+=2*Math.PI),{cx:m,cy:x,rx:Er(t,[c,l])?0:n,ry:Er(t,[c,l])?0:r,startAngle:M,endAngle:M+S,xRotation:i,arcFlag:o,sweepFlag:a}}function Ar(t,e,n,r){var i=.5522847498307936,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var Rr=1,Or="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Lr=Date.now(),Ir={},Dr=Date.now(),_r=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Dr,r=n>16?0:16-n,i=Rr++;return Ir[i]=t,Object.keys(Ir).length>1||setTimeout((function(){Dr=e;var t=Ir;Ir={},Object.keys(t).forEach((function(e){return t[e](Or.performance&&"function"==typeof Or.performance.now?Or.performance.now():Date.now()-Lr)}))}),r),i},Gr=function(t){delete Ir[t]},Ur=function(t){return"string"!=typeof t?_r:""===t?Or.requestAnimationFrame:Or[t+"RequestAnimationFrame"]},Br=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Ur(t)})),Fr=Ur(Br),Vr=function(t){return"string"!=typeof t?Gr:""===t?Or.cancelAnimationFrame:Or[t+"CancelAnimationFrame"]||Or[t+"CancelRequestAnimationFrame"]}(Br);Or.requestAnimationFrame=Fr,Or.cancelAnimationFrame=Vr;var jr=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,bt([],Et(t),!1))})))},t}(),Yr=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return gt(this,void 0,void 0,(function(){var e,n,r;return mt(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,bt([],Et(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return this.callbacks.length-1>n?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),Hr=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),Xr=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;this.callbacks.length-1>e;e++){t=(0,this.callbacks[e])(t)}return t}return null},t}(),Wr=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],zr=/([\"\'])[^\'\"]+\1/;function qr(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Zr(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function $r(){}var Kr=.7,Qr=1/Kr,Jr="\\s*([+-]?\\d+)\\s*",ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ei="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ni=/^#([0-9a-f]{3,8})$/,ri=RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),ii=RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),oi=RegExp(`^rgba\\(${Jr},${Jr},${Jr},${ti}\\)$`),ai=RegExp(`^rgba\\(${ei},${ei},${ei},${ti}\\)$`),si=RegExp(`^hsl\\(${ti},${ei},${ei}\\)$`),ui=RegExp(`^hsla\\(${ti},${ei},${ei},${ti}\\)$`),ci={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 li(){return this.rgb().formatHex()}function hi(){return this.rgb().formatRgb()}function pi(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ni.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fi(e):3===n?new yi(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?di(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?di(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ri.exec(t))?new yi(e[1],e[2],e[3],1):(e=ii.exec(t))?new yi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=oi.exec(t))?di(e[1],e[2],e[3],e[4]):(e=ai.exec(t))?di(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=si.exec(t))?bi(e[1],e[2]/100,e[3]/100,1):(e=ui.exec(t))?bi(e[1],e[2]/100,e[3]/100,e[4]):ci.hasOwnProperty(t)?fi(ci[t]):"transparent"===t?new yi(NaN,NaN,NaN,0):null}function fi(t){return new yi(t>>16&255,t>>8&255,255&t,1)}function di(t,e,n,r){return r>0||(t=e=n=NaN),new yi(t,e,n,r)}function yi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function vi(){return`#${Ei(this.r)}${Ei(this.g)}${Ei(this.b)}`}function gi(){const t=mi(this.opacity);return`${1===t?"rgb(":"rgba("}${xi(this.r)}, ${xi(this.g)}, ${xi(this.b)}${1===t?")":`, ${t})`}`}function mi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ei(t){return(16>(t=xi(t))?"0":"")+t.toString(16)}function bi(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Si(t,e,n,r)}function Mi(t){if(t instanceof Si)return new Si(t.h,t.s,t.l,t.opacity);if(t instanceof $r||(t=pi(t)),!t)return new Si;if(t instanceof Si)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Si(a,s,u,t.opacity)}function Si(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ti(t){return 0>(t=(t||0)%360)?t+360:t}function Pi(t){return Math.max(0,Math.min(1,t||0))}function wi(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}qr($r,pi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:li,formatHex:li,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Mi(this).formatHsl()},formatRgb:hi,toString:hi}),qr(yi,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof $r||(i=pi(i)),i?new yi((i=i.rgb()).r,i.g,i.b,i.opacity):new yi):new yi(t,e,n,null==r?1:r);var i}),Zr($r,{brighter(t){return new yi(this.r*(t=null==t?Qr:Math.pow(Qr,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new yi(this.r*(t=null==t?Kr:Math.pow(Kr,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new yi(xi(this.r),xi(this.g),xi(this.b),mi(this.opacity))},displayable(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:vi,formatHex:vi,formatHex8:function(){return`#${Ei(this.r)}${Ei(this.g)}${Ei(this.b)}${Ei(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gi,toString:gi})),qr(Si,(function(t,e,n,r){return 1===arguments.length?Mi(t):new Si(t,e,n,null==r?1:r)}),Zr($r,{brighter(t){return new Si(this.h,this.s,this.l*(t=null==t?Qr:Math.pow(Qr,t)),this.opacity)},darker(t){return new Si(this.h,this.s,this.l*(t=null==t?Kr:Math.pow(Kr,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new yi(wi(240>t?t+120:t-240,r,n),wi(t,r,n),wi(120>t?t+240:t-120,r,n),this.opacity)},clamp(){return new Si(Ti(this.h),Pi(this.s),Pi(this.l),mi(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=mi(this.opacity);return`${1===t?"hsl(":"hsla("}${Ti(this.h)}, ${100*Pi(this.s)}%, ${100*Pi(this.l)}%${1===t?")":`, ${t})`}`}}));var Ni=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ci=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ki=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ai=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Ri={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},Oi=fn((function(t){return Xn("angular"===t.type?Number(t.value):Ri[t.value]||0,"deg")})),Li=fn((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Xn(e,r),cy:Xn(n,i)}})),Ii=fn((function(e){var n;if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return ir(e).map((function(e){var n=e.type,r=e.orientation,i=e.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;i>s;s++){var u=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!Vt(u)&&!Vt(a)){for(var c=1;s-o>c;c++)t[o+c].length={type:"%",value:"".concat(a+(Number(u)-a)*c/(s-o))};o=s,a=Number(u)}}}(i);var o=i.map((function(t){return{offset:Xn(Number(t.length.value),"%"),color:rr(t)}}));if("linear-gradient"===n)return new Mn(t.GradientType.LinearGradient,{angle:r?Oi(r):Dn,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a=Li(r[0].at),s=a.cx,u=a.cy,c=void 0;if(r[0].style){var l=r[0].style,h=l.type,p=l.value;c="extent-keyword"===h?Vn(p):Xn(p,h)}return new Mn(t.GradientType.RadialGradient,{cx:s,cy:u,size:c,steps:o})}}));var r=e[0];if("("===e[1]||"("===e[2])if("l"===r){var i=Ni.exec(e);if(i){var o=(null===(n=i[2].match(Ai))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return[new Mn(t.GradientType.LinearGradient,{angle:Xn(parseFloat(i[1]),"deg"),steps:o.map((function(t){var e=Et(t,2),n=e[1];return{offset:Xn(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===r){var a=function(t){var e,n=Ci.exec(t);if(n){var r=(null===(e=n[4].match(Ai))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Xn(50,"%"),cy:Xn(50,"%"),steps:r.map((function(t){var e=Et(t,2),n=e[1];return{offset:Xn(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(a){if(!zt(a))return[new Mn(t.GradientType.RadialGradient,a)];e=a}}else if("p"===r)return function(t){var e=ki.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(e)}));function Di(t){return t&&!!t.image}function _i(t){return t&&!Vt(t.r)&&!Vt(t.g)&&!Vt(t.b)}var Gi=fn((function(t){if(Di(t))return yt({repetition:"repeat"},t);if(Vt(t)&&(t=""),"transparent"===t)return Yn;if("currentColor"===t)t="black";else if("none"===t)return jn;var e=Ii(t);if(e)return e;var n=pi(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Hn.apply(void 0,bt([],Et(r),!1))}));function Ui(t,e){if(_i(t)&&_i(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(qt(e[n],0,255));return e[3]=qt(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Bi(t,e){if(Vt(e))return Xn(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Xn(Number(e),"px");if("deg".search(t)>=0)return Xn(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return Xn(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Fi=function(t){return Bi(/px/g,t)},Vi=fn(Fi);fn((function(t){return Bi(RegExp("%","g"),t)}));var ji=function(t){return Zt(t)||isFinite(Number(t))?Xn(Number(t)||0,"px"):Bi(RegExp("px|%|em|rem","g"),t)},Yi=fn(ji),Hi=function(t){return Bi(/deg|rad|grad|turn/g,t)},Xi=fn(Hi);function Wi(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=On(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=xn(t.unit)):(Ln.isLength(t.unit)||Ln.isLength(e.unit))&&(a=$i(t,i,n),s=$i(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function zi(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Ye(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=He(Number(e.value))),n}function qi(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):zt(t)?n=t.split(" ").map((function(t){return Number(t)})):Zt(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Zi(t){return zt(t)?t.split(" ").map((function(t){return Yi(t)})):t.map((function(t){return Yi(""+t)}))}function $i(e,n,r,i){if(void 0===i&&(i=!1),e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var o=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds();return(i?o.min[n]:0)+e.value/100*o.halfExtents[n]*2}return 0}var Ki=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Qi(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Ki.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Bi(/deg|rad|grad|turn|px|%/g,t)||Gi(t)}))}),n.lastIndex===t.length)return r}return[]}function Ji(t){return""+t}var to=function(t){return Xn("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},eo=fn(to);function no(t,e){return[t,e,Ji]}function ro(t,e){return function(n,r){return[n,r,function(n){return Ji(qt(n,t,e))}]}}function io(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}fn((function(t){return zt(t)?t.split(" ").map(eo):t.map(eo)}));var oo=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=ge(t)}catch(n){e=ge(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&Er([r[1],r[2]],o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=kr(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&Er(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c)l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]];else if("T"===c){var d=Mr((v=e[s-1]).currentPoint,f);"Q"===v.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-y[0],g[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===c){var v,g=Mr((v=e[s-1]).currentPoint,f);y=[u[1],u[2]],"C"===v.command?(l.command="C",l.startTangent=[f[0]-g[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[f[0]-y[0],f[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var m=Pr(l,0),x=m.x,E=m.y,b=Pr(l,1,!1),M=b.x,S=b.y;l.startTangent=[x,E],l.endTangent=[M,S]}e.push(l)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=(y=t[o]).currentPoint,s=y.params,u=y.prePoint,c=void 0;switch(y.command){case"Q":c=mr(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=dr(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var l=y.arcParams;c=cr(l.cx,l.cy,l.rx,l.ry,l.xRotation,l.startAngle,l.endAngle);break;default:n.push(a[0]),r.push(a[1])}c&&(y.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===y.command||"M"===y.command)&&y.prePoint&&y.nextPoint&&i.push(y)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var h=Wt(n),p=Wt(r),f=Xt(n),d=Xt(r);if(0===i.length)return{x:h,y:p,width:f-h,height:d-p};for(o=0;i.length>o;o++){var y;(a=(y=i[o]).currentPoint)[0]===h?h-=br(y,e).xExtra:a[0]===f&&(f+=br(y,e).xExtra),a[1]===p?p-=br(y,e).yExtra:a[1]===d&&(d+=br(y,e).yExtra)}return{x:h,y:p,width:f-h,height:d-p}}(a,0),u=s.x,c=s.y,l=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},ao=fn(oo);function so(t){return zt(t)?ao(t):oo(t)}function uo(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Se(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Se(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=_e(r,i));var a,s,u,c,l,h,p,f,d=Ie(o[0])!==Ie(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):o[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[d,(u=o[1],c=d,l=u.length-1,h=[],p=0,f=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),f.forEach((function(t,e){u.slice(1).forEach((function(t,n){p+=Te(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=p,p=0})),f[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function co(t,e){return{points:zt(t)?t.split(" ").map((function(t){var e=Et(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t,totalLength:0,segments:[]}}function lo(t,e){return[t.points,e.points,function(t){return t}]}var ho=null,po=/\s*(\w+)\(([^)]*)\)/g;function fo(t){return function(e){var n=0;return t.map((function(t){return t===ho?e[n++]:t}))}}function yo(t){return t}var vo={matrix:["NNNNNN",[ho,ho,0,0,ho,ho,0,0,0,0,1,0,ho,ho,0,1],yo],matrix3d:["NNNNNNNNNNNNNNNN",yo],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",fo([ho,ho,new Ln(1)]),yo],scaleX:["N",fo([ho,new Ln(1),new Ln(1)]),fo([ho,new Ln(1)])],scaleY:["N",fo([new Ln(1),ho,new Ln(1)]),fo([new Ln(1),ho])],scaleZ:["N",fo([new Ln(1),new Ln(1),ho])],scale3d:["NNN",yo],skew:["Aa",null,yo],skewX:["A",null,fo([ho,Dn])],skewY:["A",null,fo([Dn,ho])],translate:["Tt",fo([ho,ho,In]),yo],translateX:["T",fo([ho,In,In]),fo([ho,In])],translateY:["T",fo([In,ho,In]),fo([In,ho])],translateZ:["L",fo([In,In,ho])],translate3d:["TTL",yo]};function go(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],o=i[0],a=i.slice(1);if("translate"===o||"skew"===o?1===a.length&&a.push(0):"scale"===o&&1===a.length&&a.push(a[0]),!vo[o])return[];var s=a.map((function(t){return Xn(t)}));e.push({t:o,d:s})}return e}function mo(t){if(Array.isArray(t))return go(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(po.lastIndex=0;e=po.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=vo[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(a.length>s.length)return[];for(var u=[],c=0;s.length>c;c++){var l=a[c],h=s[c],p=void 0;if(void 0===(p=l?{A:function(t){return"0"===t.trim()?Dn:Xi(t)},N:eo,T:Yi,L:Vi}[h.toUpperCase()](l):{a:Dn,n:u[0],t:In}[h]))return[];u.push(p)}if(n.push({t:i,d:u}),po.lastIndex===t.length)return n}return[]}function xo(t){if(Array.isArray(t))return go(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(po.lastIndex=0;e=po.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=vo[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(a.length>s.length)return[];for(var u=[],c=0;s.length>c;c++){var l=a[c],h=s[c],p=void 0;if(void 0===(p=l?{A:function(t){return"0"===t.trim()?Dn:Hi(t)},N:to,T:ji,L:Fi}[h.toUpperCase()](l):{a:Dn,n:u[0],t:In}[h]))return[];u.push(p)}if(n.push({t:i,d:u}),po.lastIndex===t.length)return n}return[]}function Eo(t){var e,n,r,i;switch(t.t){case"rotateX":return i=Ve(zi(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=Ve(zi(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=Ve(zi(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=Ve(zi(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var l=Ve(zi(t.d[0])),h=Ve(zi(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Ve(zi(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=Ve(zi(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=$i(t.d[0],0,null)||0,n=$i(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=$i(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=$i(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=$i(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=$i(t.d[0],0,null)||0,n=$i(t.d[1],0,null)||0,r=$i(t.d[2],0,null)||0,1];case"perspective":var p=$i(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,p?-1/p:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function bo(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function Mo(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Qe,t))return!1;if(o(Je,Qe),Je[3]=0,Je[7]=0,Je[11]=0,Je[15]=1,1e-8>Math.abs(l(Je)))return!1;var s,h,p=Qe[3],f=Qe[7],d=Qe[11],y=Qe[12],v=Qe[13],g=Qe[14],m=Qe[15];if(0!==p||0!==f||0!==d){if(tn[0]=p,tn[1]=f,tn[2]=d,tn[3]=m,!c(Je,Je))return!1;u(Je,Je),K(i,tn,Je)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=y,e[1]=v,e[2]=g,(s=en)[0][0]=(h=Qe)[0],s[0][1]=h[1],s[0][2]=h[2],s[1][0]=h[4],s[1][1]=h[5],s[1][2]=h[6],s[2][0]=h[8],s[2][1]=h[9],s[2][2]=h[10],n[0]=_(en[0]),Y(en[0],en[0]),r[0]=H(en[0],en[1]),rn(en[1],en[1],en[0],1,-r[0]),n[1]=_(en[1]),Y(en[1],en[1]),r[0]/=n[1],r[1]=H(en[0],en[2]),rn(en[2],en[2],en[0],1,-r[1]),r[2]=H(en[1],en[2]),rn(en[2],en[2],en[1],1,-r[2]),n[2]=_(en[2]),Y(en[2],en[2]),r[1]/=n[2],r[2]/=n[2],X(nn,en[1],en[2]),0>H(en[0],nn))for(var x=0;3>x;x++)n[x]*=-1,en[x][0]*=-1,en[x][1]*=-1,en[x][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+en[0][0]-en[1][1]-en[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-en[0][0]+en[1][1]-en[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-en[0][0]-en[1][1]+en[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+en[0][0]+en[1][1]+en[2][2],0)),en[2][1]>en[1][2]&&(a[0]=-a[0]),en[0][2]>en[2][0]&&(a[1]=-a[1]),en[1][0]>en[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Eo).reduce(bo)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var So=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(s=0;3>s;s++)for(var u=0;3>u;u++)a[3][s]+=e[u]*a[u][s];var c=i[0],l=i[1],h=i[2],p=i[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(l*l+h*h),f[0][1]=2*(c*l-h*p),f[0][2]=2*(c*h+l*p),f[1][0]=2*(c*l+h*p),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(l*h-c*p),f[2][0]=2*(c*h-l*p),f[2][1]=2*(l*h+c*p),f[2][2]=1-2*(c*c+l*l),a=t(a,f);var d,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y)),s=0;3>s;s++)for(u=0;3>u;u++)a[s][u]*=n[s];return 0==(d=a)[0][2]&&0==d[0][3]&&0==d[1][2]&&0==d[1][3]&&0==d[2][0]&&0==d[2][1]&&1==d[2][2]&&0==d[2][3]&&0==d[3][2]&&1==d[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function To(t){return t.toFixed(6).replace(".000000","")}function Po(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Mo(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Mo(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=qt(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return So(t[0],t[1],t[2],e,t[4]).map(To).join(",")}])}function wo(t){return t.replace(/[XY]/,"")}function No(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function Co(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?Xn(a):Xn(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length)u=[(m=Po(t,e))[0]],c=[m[1]],l=[["matrix",[m[2]]]];else for(o=0;t.length>o;o++){var h=t[o].t,p=e[o].t,f=t[o].d,d=e[o].d,y=vo[h],v=vo[p],g=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var m=Po([t[o]],[e[o]]);u.push(m[0]),c.push(m[1]),l.push(["matrix",[m[2]]])}else{if(h===p)g=h;else if(y[2]&&v[2]&&wo(h)===wo(p))g=wo(h),f=y[2](f),d=v[2](d);else{if(!y[1]||!v[1]||No(h)!==No(p)){u=[(m=Po(t,e))[0]],c=[m[1]],l=[["matrix",[m[2]]]];break}g=No(h),f=y[1](f),d=v[1](d)}for(var x=[],E=[],b=[],M=0;f.length>M;M++){m=Wi(f[M],d[M],n,!1,M);x[M]=m[0],E[M]=m[1],b.push(m[2])}u.push(x),c.push(E),l.push([g,b])}}if(r){var S=u;u=c,c=S}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var ko=fn((function(t){if(zt(t)){if("text-anchor"===t)return[Xn(0,"px"),Xn(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Yi(Ro(e[0])),Yi(Ro(e[1]))]}return[Xn(t[0]||0,"px"),Xn(t[1]||0,"px")]})),Ao=function(t){if(zt(t)){if("text-anchor"===t)return[Xn(0,"px"),Xn(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[ji(Ro(e[0])),ji(Ro(e[1]))]}return[Xn(t[0]||0,"px"),Xn(t[1]||0,"px")]};function Ro(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}function Oo(t,e,n){return s(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Lo,Io=i(),Do=i(),_o={scale:function(t){v(Io,[t[0].value,t[1].value,1])},scaleX:function(t){v(Io,[t[0].value,1,1])},scaleY:function(t){v(Io,[1,t[0].value,1])},scaleZ:function(t){v(Io,[1,1,t[0].value])},scale3d:function(t){v(Io,[t[0].value,t[1].value,t[2].value])},translate:function(t){y(Io,[t[0].value,t[1].value,0])},translateX:function(t){y(Io,[t[0].value,0,0])},translateY:function(t){y(Io,[0,t[0].value,0])},translateZ:function(t){y(Io,[0,0,t[0].value])},translate3d:function(t){y(Io,[t[0].value,t[1].value,t[2].value])},rotate:function(t){E(Io,Ve(zi(t[0])))},rotateX:function(t){m(Io,Ve(zi(t[0])))},rotateY:function(t){x(Io,Ve(zi(t[0])))},rotateZ:function(t){E(Io,Ve(zi(t[0])))},rotate3d:function(t){g(Io,Ve(zi(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){Oo(Io,Ve(t[0].value),Ve(t[1].value))},skewX:function(t){Oo(Io,Ve(t[0].value),0)},skewY:function(t){Oo(Io,0,Ve(t[0].value))},matrix:function(t){a(Io,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){a.apply(I,bt([Io],Et(t.map((function(t){return t.value}))),!1))}},Go={translate:function(t,e){t.setLocalPosition([e[0].value,e[1].value])},translate3d:function(t,e){t.setLocalPosition([e[0].value,e[1].value,e[2].value])}};function Uo(t,e){if(t.length){if(1===t.length&&Go[t[0].t])return void Go[t[0].t](e,t[0].d);for(var n=s(Do),r=0;t.length>r;r++){var i=t[r],o=_o[i.t];o&&(o(i.d),L(n,n,Io))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}t.PropertySyntax=void 0,(Lo=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",Lo.COLOR="<color>",Lo.PAINT="<paint>",Lo.NUMBER="<number>",Lo.ANGLE="<angle>",Lo.OPACITY_VALUE="<opacity-value>",Lo.SHADOW_BLUR="<shadow-blur>",Lo.LENGTH="<length>",Lo.PERCENTAGE="<percentage>",Lo.LENGTH_PERCENTAGE="<length> | <percentage>",Lo.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",Lo.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",Lo.LIST_OF_POINTS="<list-of-points>",Lo.PATH="<path>",Lo.FILTER="<filter>",Lo.Z_INDEX="<z-index>",Lo.OFFSET_DISTANCE="<offset-distance>",Lo.DEFINED_PATH="<defined-path>",Lo.MARKER="<marker>",Lo.TRANSFORM="<transform>",Lo.TRANSFORM_ORIGIN="<transform-origin>",Lo.TEXT="<text>",Lo.TEXT_TRANSFORM="<text-transform>";var Bo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],Fo=Bo.filter((function(t){return!!t.l})).map((function(t){return t.n})),Vo={},jo=new WeakMap,Yo=function(){function e(t){var e=this;this.runtime=t,Bo.forEach((function(t){e.registerMetadata(t)}))}return e.prototype.registerMetadata=function(t){bt([t.n],Et(t.a||[]),!1).forEach((function(e){Vo[e]=t}))},e.prototype.unregisterMetadata=function(t){delete Vo[t]},e.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},e.prototype.processProperties=function(e,n,r,i,o,a,s){var u=this;void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===a&&(a=void 0),void 0===s&&(s=!0);var c=e.nodeName!==t.Shape.GROUP;if(this.runtime.enableCSSParsing){var l=o,h=Object.keys(n);h.forEach((function(t){var i;r||(e.attributes[t]=n[t]),!l&&(null===(i=Vo[t])||void 0===i?void 0:i.l)&&(l=!0)})),i||h.forEach((function(t){e.computedStyle[t]=u.parseProperty(t,e.attributes[t],e,s)})),(null==a?void 0:a.length)&&(h=Array.from(new Set(h.concat(a)))),h.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=u.computeProperty(t,e.computedStyle[t],e,s))})),l&&(e.geometry.dirty=!0,e.renderable.boundsDirty=!0,e.renderable.renderBoundsDirty=!0,o||this.runtime.sceneGraphService.dirtifyToRoot(e)),h.forEach((function(t){t in e.parsedStyle&&u.postProcessProperty(t,e,h)})),this.runtime.enableCSSParsing&&e.children.length&&h.forEach((function(t){t in e.parsedStyle&&u.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,!0,!0,void 0,void 0,void 0)}))}))}else{zn(e.attributes,n);var p=e.parsedStyle.clipPath,f=e.parsedStyle.offsetPath;zn(e.parsedStyle,n);var d=!!o;d||Fo.some((function(t){return t in n}))&&(d=!0),c&&(n.fill&&(e.parsedStyle.fill=Gi(n.fill)),n.stroke&&(e.parsedStyle.stroke=Gi(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Gi(n.shadowColor)),n.filter&&(e.parsedStyle.filter=Qi(n.filter)),Vt(n.radius)||(e.parsedStyle.radius=qi(n.radius,4)),Vt(n.lineDash)||(e.parsedStyle.lineDash=qi(n.lineDash,2)),n.points&&(e.parsedStyle.points=co(n.points)),""===n.d&&(e.parsedStyle.d=yt({},Wn)),n.d&&(e.parsedStyle.d=so(n.d)),n.textTransform&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},e,null)),te(n.clipPath)||this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.DEFINED_PATH].calculator("clipPath",p,n.clipPath,e,this.runtime),c&&n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.DEFINED_PATH].calculator("offsetPath",f,n.offsetPath,e,this.runtime),n.transform&&(e.parsedStyle.transform=mo(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=ko(n.transformOrigin)),Zt(n.zIndex)&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.Z_INDEX].postProcessor(e),c&&(n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),Zt(n.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.OFFSET_DISTANCE].postProcessor(e)),n.transform&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TRANSFORM].postProcessor(e),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TRANSFORM_ORIGIN].postProcessor(e),d&&(e.geometry.dirty=!0,e.renderable.boundsDirty=!0,e.renderable.renderBoundsDirty=!0,o||this.runtime.sceneGraphService.dirtifyToRoot(e))}},e.prototype.parseProperty=function(t,e,n,r){var i=Vo[t],o=e;if((""===e||Vt(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)o=Vn(e);else if(i){var a=i.k,s=i.syntax,u=s&&this.getPropertySyntax(s);a&&a.indexOf(e)>-1?o=Vn(e):u&&(!r&&u.parserUnmemoize?o=u.parserUnmemoize(e,n):u.parser&&(o=u.parser(e,n)))}return o},e.prototype.computeProperty=function(t,e,n,r){var i=Vo[t],o=e;if(i){var a=i.syntax,s=i.d;if(e instanceof Sn){var u=e.value;if("unset"===u&&(u=i.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===u)Vt(s)||(e=this.parseProperty(t,Ft(s)?s(n.nodeName):s,n,r));else if("inherit"===u){var c=this.tryToResolveProperty(n,t,{inherited:!0});return Vt(c)?void this.addUnresolveProperty(n,t):c}}var l=a&&this.getPropertySyntax(a);if(l&&l.calculator)o=l.calculator(t,n.parsedStyle[t],e,n,this.runtime);else o=e instanceof Sn?e.value:e}return o},e.prototype.postProcessProperty=function(t,e,n){var r=Vo[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},e.prototype.addUnresolveProperty=function(t,e){var n=jo.get(t);n||(jo.set(t,[]),n=jo.get(t)),-1===n.indexOf(e)&&n.push(e)},e.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=jo.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},e.prototype.recalc=function(t){var e=jo.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),jo.delete(t)}},e.prototype.updateGeometry=function(e){var n=e.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Lt),i.renderBounds||(i.renderBounds=new Lt);var o=e.parsedStyle,a=r.update(o,e),s=a.cx,u=void 0===s?0:s,c=a.cy,l=void 0===c?0:c,h=a.cz,p=void 0===h?0:h,f=a.hwidth,d=void 0===f?0:f,y=a.hheight,v=void 0===y?0:y,g=a.hdepth,m=void 0===g?0:g,x=[Math.abs(d),Math.abs(v),m],E=o.stroke,b=o.lineWidth,M=void 0===b?1:b,S=o.increasedLineWidthForHitTesting,T=void 0===S?0:S,P=o.shadowType,w=void 0===P?"outer":P,N=o.shadowColor,C=o.filter,k=void 0===C?[]:C,A=o.transformOrigin,R=[u,l,p];if(i.contentBounds.update(R,x),E&&!E.isNone){var O=((M||0)+(T||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);x[0]+=O,x[1]+=O}if(i.renderBounds.update(R,x),N&&w&&"inner"!==w){var L=i.renderBounds,I=L.min,D=L.max,_=o.shadowBlur||0,G=o.shadowOffsetX||0,U=o.shadowOffsetY||0,B=D[0]+_+G,V=I[1]-_+U,j=D[1]+_+U;I[0]=Math.min(I[0],I[0]-_+G),D[0]=Math.max(D[0],B),I[1]=Math.min(I[1],V),D[1]=Math.max(D[1],j),i.renderBounds.setMinMax(I,D)}k.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,F(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),i.renderBounds.setMinMax(c,l)}})),e.geometry.dirty=!1;var Y=0>v,H=(0>d?-1:1)*(A?$i(A[0],0,e,!0):0),X=(Y?-1:1)*(A?$i(A[1],1,e,!0):0);(H||X)&&e.setOrigin(H,X)}},e.prototype.updateSizeAttenuation=function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=(e.style.rawLineWidth||1)/n,e.nodeName===t.Shape.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=(e.style.rawR||1)/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===t.Shape.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))},e.prototype.isPropertyInheritable=function(t){var e=Vo[t];return!!e&&e.inh},e}(),Ho=function(){function t(){this.parser=Xi,this.parserUnmemoize=Hi,this.parserWithCSSDisabled=null,this.mixer=no}return t.prototype.calculator=function(t,e,n,r){return zi(n)},t}(),Xo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Sn&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Wo=function(){function t(){this.parser=Gi,this.parserWithCSSDisabled=Gi,this.mixer=Ui}return t.prototype.calculator=function(t,e,n,r){return n instanceof Sn?"none"===n.value?jn:Yn:n},t}(),zo=function(){function t(){this.parser=Qi}return t.prototype.calculator=function(t,e,n){return n instanceof Sn?[]:n},t}();function qo(t){var e=t.parsedStyle.fontSize;return Vt(e)?null:e}var Zo,$o=function(){function e(){this.parser=Yi,this.parserUnmemoize=ji,this.parserWithCSSDisabled=null,this.mixer=no}return e.prototype.calculator=function(e,n,r,i,o){var a;if(Zt(r))return r;if(!Ln.isRelativeUnit(r.unit))return r.value;var s=o.styleValueRegistry;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){if(u=qo(i.parentNode))return u*=r.value;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){if(null===(a=null==i?void 0:i.ownerDocument)||void 0===a?void 0:a.documentElement){var u;if(u=qo(i.ownerDocument.documentElement))return u*=r.value;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}},e}(),Ko=function(){function t(){this.mixer=io}return t.prototype.parser=function(t){var e=Zi(Zt(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Qo=function(){function t(){this.mixer=io}return t.prototype.parser=function(t){var e=Zi(Zt(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Jo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Sn&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),ta=function(){function t(){this.mixer=no,this.parser=eo,this.parserUnmemoize=to,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ea=function(){function e(){this.parser=eo,this.parserUnmemoize=to,this.parserWithCSSDisabled=null,this.mixer=ro(0,1)}return e.prototype.calculator=function(t,e,n){return n.value},e.prototype.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var o=r.getPoint(n.offsetDistance);o&&e.setLocalPosition(o.x,o.y)}}},e}(),na=function(){function t(){this.parser=eo,this.parserUnmemoize=to,this.parserWithCSSDisabled=null,this.mixer=ro(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ra=function(){function t(){this.parser=so,this.parserWithCSSDisabled=so,this.mixer=uo}return t.prototype.calculator=function(t,e,n){return n instanceof Sn&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Gt(0,0,0,0)}:n},t}(),ia=function(){this.parser=co,this.mixer=lo},oa=function(t){function e(){var e=t.apply(this,bt([],Et(arguments),!1))||this;return e.mixer=ro(0,1/0),e}return pt(e,t),e}($o),aa=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Sn?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),sa=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),ua=function(){function t(){this.parser=mo,this.parserUnmemoize=xo,this.parserWithCSSDisabled=xo,this.mixer=Co}return t.prototype.calculator=function(t,e,n,r){return n instanceof Sn?[]:n},t.prototype.postProcessor=function(t){Uo(t.parsedStyle.transform,t)},t}(),ca=function(){function e(){this.parser=ko,this.parserUnmemoize=Ao}return e.prototype.postProcessor=function(e){var n=e.parsedStyle.transformOrigin;n[0].unit===t.UnitType.kPixels&&n[1].unit===t.UnitType.kPixels?e.setOrigin(n[0].value,n[1].value):e.getGeometryBounds()},e}(),la=function(){function e(){this.parser=eo,this.parserUnmemoize=to}return e.prototype.calculator=function(t,e,n,r){return n.value},e.prototype.postProcessor=function(e){if(e.parentNode){var n=e.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=t.SortReason.Z_INDEX_CHANGED)}},e}(),ha=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=t.cy,i=t.r,o=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:o,hheight:o}},t}(),pa=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=t.cy,i=t.rx,o=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===o?0:o}},t}(),fa=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i),u=(a-o)/2,c=(Math.max(n,i)-s)/2;return{cx:o+u,cy:s+c,hwidth:u,hheight:c}},t}(),da=function(){function t(){}return t.prototype.update=function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}},t}(),ya=function(){function t(){}return t.prototype.update=function(t){if(t.points&&Ht(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,bt([],Et(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,bt([],Et(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,bt([],Et(e.map((function(t){return t[1]}))),!1)),o=(r-n)/2,a=(Math.max.apply(Math,bt([],Et(e.map((function(t){return t[1]}))),!1))-i)/2;return{cx:n+o,cy:i+a,hwidth:o,hheight:a}}return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),va=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.src,s=t.width,u=t.height,c=void 0===s?0:s,l=void 0===u?0:u;return a&&!zt(a)&&(c||(t.width=c=a.width),l||(t.height=l=a.height)),{cx:r+c/2,cy:o+l/2,hwidth:c/2,hheight:l/2}},t}(),ga=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text;return ps.enableCSSParsing?n&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!Vt(t.lineWidth):n},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=void 0===o?"start":o,s=t.lineWidth,u=void 0===s?1:s,c=t.textBaseline,l=void 0===c?"alphabetic":c,h=t.dx,p=void 0===h?0:h,f=t.dy,d=void 0===f?0:f,y=t.x,v=void 0===y?0:y,g=t.y,m=void 0===g?0:g;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var x=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,E=this.globalRuntime.textService.measureText(i,t,x);t.metrics=E;var b=E.width/2,M=E.height/2,S=v+b;"center"===a||"middle"===a?S+=u/2-b:"right"!==a&&"end"!==a||(S+=u-2*b);var T=m-M;return"middle"===l?T+=M:"top"===l||"hanging"===l?T+=2*M:"alphabetic"===l?T+=this.globalRuntime.enableCSSParsing?E.lineHeight-E.fontProperties.ascent:0:"bottom"!==l&&"ideographic"!==l||(T+=0),p&&(S+=p),d&&(T+=d),{cx:S,cy:T,hwidth:b,hheight:M}},t}(),ma=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),xa=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=t.y,i=t.width,o=void 0===i?0:i,a=t.height,s=void 0===a?0:a;return{cx:(void 0===n?0:n)+o/2,cy:(void 0===r?0:r)+s/2,hwidth:o/2,hheight:s/2}},t}(),Ea=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new _t,this.page=new _t,this.canvas=new _t,this.viewport=new _t,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw Error(Ut)},t}(),ba=function(t){function e(){var e=t.apply(this,bt([],Et(arguments),!1))||this;return e.client=new _t,e.movement=new _t,e.offset=new _t,e.global=new _t,e.screen=new _t,e}return pt(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw Error(Ut)},e}(Ea),Ma=function(t){function e(){var e=t.apply(this,bt([],Et(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return pt(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(ba),Sa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pt(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(ba),Ta=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return pt(e,t),e}(Ea),Pa=new WeakMap,wa=function(){function t(){}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r,i;this.emitter||(this.emitter=new wt);var o=!1,a=!1;Jt(n)?o=n:n&&(o=void 0!==(r=n.capture)&&r,a=void 0!==(i=n.once)&&i),o&&(t+="capture"),e=Ft(e)?e:e.handleEvent;var s=Ft(e)?void 0:e;return a?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){if(!this.emitter)return this;(Jt(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=Ft(e)?e:null==e?void 0:e.handleEvent;var r=Ft(e)?void 0:e;return this.emitter.off(t,e,r),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Ta(t,e))},t.prototype.dispatchEvent=function(t,e){var n;void 0===e&&(e=!1);var r=Pa.get(this);if(r||(r=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&Pa.set(this,r),r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],e||(t.target=this),t.manager.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),Na=function(e){function n(){var t=e.apply(this,bt([],Et(arguments),!1))||this;return t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return pt(n,e),n.isNode=function(t){return!!t.childNodes},Object.defineProperty(n.prototype,"textContent",{get:function(){var e,n,r="";this.nodeName===t.Shape.TEXT&&(r+=this.style.text);try{for(var i=xt(this.childNodes),o=i.next();!o.done;o=i.next()){var a=o.value;r+=a.nodeName===t.Shape.TEXT?a.nodeValue:a.textContent}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text="".concat(e))},enumerable:!1,configurable:!0}),n.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},n.prototype.hasChildNodes=function(){return this.childNodes.length>0},n.prototype.isDefaultNamespace=function(t){throw Error(Ut)},n.prototype.lookupNamespaceURI=function(t){throw Error(Ut)},n.prototype.lookupPrefix=function(t){throw Error(Ut)},n.prototype.normalize=function(){throw Error(Ut)},n.prototype.isEqualNode=function(t){return this===t},n.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(n.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),n.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(e=r.parentNode)&&void 0!==e?e:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,u=s===o?a:o;if(s[s.length-u.length]===u[0])return s===o?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===o?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===o?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},n.prototype.contain=function(t){return this.contains(t)},n.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},n.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},n.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},n.DOCUMENT_POSITION_DISCONNECTED=1,n.DOCUMENT_POSITION_PRECEDING=2,n.DOCUMENT_POSITION_FOLLOWING=4,n.DOCUMENT_POSITION_CONTAINS=8,n.DOCUMENT_POSITION_CONTAINED_BY=16,n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,n}(wa),Ca=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new wt,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=i(),this.tmpVec3=D(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=nr.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.dispatchEvent(i,2===i.button?"rightup":"mouseup")}var o=n.trackingData(t.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!i.composedPath().includes(a)){for(var u=a;u&&!i.composedPath().includes(u);){if(i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside")}Na.isNode(u)&&(u=u.parentNode)}delete o.pressTargetsByButton[t.button],s=u}if(s){var c=n.clonePointerEvent(i,"click");c.target=s,c.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:r});var l=o.clicksByButton[t.button];l.target===c.target&&n.context.renderingContext.root.ownerDocument.defaultView.dblClickSpeed>r-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=r,c.detail=l.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==c.pointerType&&"touch"!==c.pointerType||n.dispatchEvent(c,"click"),n.dispatchEvent(c,"pointertap")),n.freeEvent(c)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",o||void 0);if(n.dispatchEvent(a,"pointerout"),r&&n.dispatchEvent(a,"mouseout"),!e.composedPath().includes(o)){var s=n.createPointerEvent(t,"pointerleave",o||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),Na.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(a)}if(o!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var c=o&&Na.isNode(o)&&o.parentNode;c&&c!==(Na.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&c!==e.target;)c=c.parentNode;if(!c||c===(Na.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var l=n.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==o&&l.target!==(Na.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),r&&n.notifyTarget(l,"mouseenter"),Na.isNode(l.target)&&(l.target=l.target.parentNode);n.freeEvent(l)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Na.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),Na.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Na.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),Na.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Na.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.getScale=function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,o=r.offsetHeight;i&&o&&(e=t.width/i,n=t.height/o)}return{scaleX:e,scaleY:n,bbox:t}},t.prototype.client2Viewport=function(t){var e=this.getScale(),n=e.bbox;return new _t((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)},t.prototype.viewport2Client=function(t){var e=this.getScale(),n=e.bbox;return new _t((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=h(this.tmpMatrix,u,s),l=B(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return W(l,l,c),new _t(l[0],l[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=h(this.tmpMatrix,n,r),o=B(this.tmpVec3,t.x,t.y,0);W(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new _t((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;n.length>r;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Na.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t,e){var n=null==e?void 0:e.target;if((null==n?void 0:n.shadowRoot)&&(n=e.composedPath()[0]),n){if(n===t)return!0;if(t&&t.contains)return t.contains(n)}return!!(null==e?void 0:e.composedPath)&&e.composedPath().indexOf(t)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=xt(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=this.nativeHTMLMap.get(i.value);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(Ma);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i),a=this.context.contextService.getDomElement();return i.target=null!=n?n:o||this.isNativeEventFromCanvas(a,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(Sa);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(Sa);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(Ma);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},t.prototype.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},t.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=nr.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter;if(n){var r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Na.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Kn(e)&&e.getAttribute("cursor");if(n)return n;e=Na.isNode(e)&&e.parentNode}},t}(),ka=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||ps.offscreenCanvas)this.canvas=t||ps.offscreenCanvas,this.context=this.canvas.getContext("2d",yt({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",yt({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",yt({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();t.RenderReason=void 0,(Zo=t.RenderReason||(t.RenderReason={}))[Zo.CAMERA_CHANGED=0]="CAMERA_CHANGED",Zo[Zo.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Zo[Zo.NONE=2]="NONE";var Aa,Ra=function(){function e(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.frame=0,this.zIndexCounter=0,this.hooks={init:new Hr,initAsync:new jr,dirtycheck:new Xr,cull:new Xr,beginFrame:new Hr,beforeRender:new Hr,render:new Hr,afterRender:new Hr,endFrame:new Hr,destroy:new Hr,pick:new Yr,pickSync:new Xr,pointerDown:new Hr,pointerUp:new Hr,pointerMove:new Hr,pointerOut:new Hr,pointerOver:new Hr,pointerWheel:new Hr,pointerCancel:new Hr,click:new Hr}}return e.prototype.init=function(t){var e=this,n=yt(yt({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},e.prototype.getStats=function(){return this.stats},e.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},e.prototype.render=function(e,n,r){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.frame++;var o=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(o.root),this.frame>2&&this.globalRuntime.sceneGraphService.triggerPendingEvents(3===this.frame?o.root:void 0),o.renderReasons.size&&this.inited){o.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===o.renderReasons.size&&o.renderReasons.has(t.RenderReason.CAMERA_CHANGED),s=!e.disableRenderHooks||!(e.disableRenderHooks&&a);s&&this.renderDisplayObject(o.root,e,o),this.hooks.beginFrame.call(n),s&&o.renderListCurrentFrame.forEach((function(t){i.hooks.beforeRender.call(t),i.hooks.render.call(t),i.hooks.afterRender.call(t)})),this.hooks.endFrame.call(n),o.renderListCurrentFrame=[],o.renderReasons.clear(),r()}},e.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=t.sortable;c.dirty&&(this.sort(t,c),c.dirty=!1,c.dirtyChildren=[],c.dirtyReason=void 0),(c.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},e.prototype.sort=function(e,n){n.sorted&&n.dirtyReason!==t.SortReason.Z_INDEX_CHANGED?n.dirtyChildren.forEach((function(t){if(-1===e.childNodes.indexOf(t)){var r=n.sorted.indexOf(t);0>r||n.sorted.splice(r,1)}else if(0===n.sorted.length)n.sorted.push(t);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>Qn(t[i],e)?n=i+1:r=i}return n}(n.sorted,t);n.sorted.splice(i,0,t)}})):n.sorted=e.childNodes.slice().sort(Qn)},e.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Oa=/\[\s*(.*)=(.*)\s*\]/,La=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(Oa),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Vt(n)?"":n.toString?""+n:""},t}(),Ia=function(t){function e(e,n,r,i,o,a,s,u){var c=t.call(this,null)||this;return c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return pt(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(Ea);function Da(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}t.ElementEvent=void 0,(Aa=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",Aa.DESTROY="destroy",Aa.ATTR_MODIFIED="DOMAttrModified",Aa.INSERTED="DOMNodeInserted",Aa.REMOVED="removed",Aa.MOUNTED="DOMNodeInsertedIntoDocument",Aa.UNMOUNTED="DOMNodeRemovedFromDocument",Aa.BOUNDS_CHANGED="bounds-changed",Aa.CULLED="culled";var _a=new Ia(t.ElementEvent.REPARENT,null,"","","",0,"",""),Ga=1e-6;function Ua(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return n===o&&r===a&&i===s||Ga*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&Ga*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&Ga*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var Ba,Fa,Va,ja=ut(),Ya=D(),Ha=G(1,1,1),Xa=i(),Wa=ut(),za=D(),qa=i(),Za=Q(),$a=D(),Ka=Q(),Qa=D(),Ja=D(),ts=D(),es=i(),ns=Q(),rs=Q(),is=Q(),os={affectChildren:!0},as=function(){function e(e){this.runtime=e,this.pendingEvents=new Map,this.boundsChangedEvent=new Ta(t.ElementEvent.BOUNDS_CHANGED),this.eventEntitySet=new Set,this.displayObjectDependencyMap=new WeakMap}return e.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},e.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},e.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},e.prototype.attach=function(e,n,r){var i,o=!1;e.parentNode&&(o=e.parentNode!==n,this.detach(e)),e.parentNode=n,Zt(r)?n.childNodes.splice(r,0,e):n.childNodes.push(e);var a=n.sortable;((null===(i=null==a?void 0:a.sorted)||void 0===i?void 0:i.length)||e.parsedStyle.zIndex)&&(-1===a.dirtyChildren.indexOf(e)&&a.dirtyChildren.push(e),a.dirty=!0,a.dirtyReason=t.SortReason.ADDED);var s=e.transformable;s&&this.dirtifyWorld(e,s),s.frozen&&this.unfreezeParentToRoot(e),o&&e.dispatchEvent(_a)},e.prototype.detach=function(e){var n,r;if(e.parentNode){var i=e.transformable,o=e.parentNode.sortable;((null===(n=null==o?void 0:o.sorted)||void 0===n?void 0:n.length)||(null===(r=e.style)||void 0===r?void 0:r.zIndex))&&(-1===o.dirtyChildren.indexOf(e)&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=t.SortReason.REMOVED);var a=e.parentNode.childNodes.indexOf(e);a>-1&&e.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(e,i),e.parentNode=null}},e.prototype.getOrigin=function(t){return t.getGeometryBounds(),t.transformable.origin},e.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},e.prototype.rotate=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=G(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=Za;nt(a,e[0],e[1],e[2]);var s=this.getRotation(t),u=this.getRotation(t.parentNode);it(is,u),et(is,is),tt(a,is,a),tt(o.localRotation,a,s),st(o.localRotation,o.localRotation),i&&this.dirtifyLocal(t,o)}else this.rotateLocal(t,e)},e.prototype.rotateLocal=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=G(e,n,r));var o=t.transformable;nt(rs,e[0],e[1],e[2]),at(o.localRotation,o.localRotation,rs),i&&this.dirtifyLocal(t,o)},e.prototype.setEulerAngles=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=G(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){nt(o.localRotation,e[0],e[1],e[2]);var a=this.getRotation(t.parentNode);it(ns,et(Za,a)),at(o.localRotation,o.localRotation,ns),i&&this.dirtifyLocal(t,o)}else this.setLocalEulerAngles(t,e)},e.prototype.setLocalEulerAngles=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=G(e,n,r));var o=t.transformable;nt(o.localRotation,e[0],e[1],e[2]),i&&this.dirtifyLocal(t,o)},e.prototype.translateLocal=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=G(e,n,r));var o=t.transformable;Ua(e,Ya)||(!function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,p=i*h-o*l,f=o*c-r*h,d=r*l-i*c,y=2*n[3];l*=y,h*=y,f*=2,d*=2,t[0]=a+(c*=y)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,o.localRotation),F(o.localPosition,o.localPosition,e),i&&this.dirtifyLocal(t,o))},e.prototype.setPosition=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;if(ts[0]=e[0],ts[1]=e[1],ts[2]=null!==(r=e[2])&&void 0!==r?r:0,!Ua(this.getPosition(t),ts)){if(U(i.position,ts),null!==t.parentNode&&t.parentNode.transformable)o(es,t.parentNode.transformable.worldTransform),c(es,es),W(i.localPosition,ts,es);else U(i.localPosition,ts);n&&this.dirtifyLocal(t,i)}},e.prototype.setLocalPosition=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;Ja[0]=e[0],Ja[1]=e[1],Ja[2]=null!==(r=e[2])&&void 0!==r?r:0,Ua(i.localPosition,Ja)||(U(i.localPosition,Ja),n&&this.dirtifyLocal(t,i))},e.prototype.scaleLocal=function(t,e,n){var r;void 0===n&&(n=!0);var i,o,a,s=t.transformable;i=s.localScale,o=s.localScale,a=B(za,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:1),i[0]=o[0]*a[0],i[1]=o[1]*a[1],i[2]=o[2]*a[2],n&&this.dirtifyLocal(t,s)},e.prototype.setLocalScale=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;B(za,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:i.localScale[2]),Ua(za,i.localScale)||(U(i.localScale,za),n&&this.dirtifyLocal(t,i))},e.prototype.translate=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=B(za,e,n,r)),Ua(e,Ya)||(F(za,this.getPosition(t),e),this.setPosition(t,za,i))},e.prototype.setRotation=function(t,e,n,r,i,o){void 0===o&&(o=!0);var a=t.transformable;if("number"==typeof e&&(e=rt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var s=this.getRotation(t.parentNode);it(Za,s),et(Za,Za),tt(a.localRotation,Za,e),st(a.localRotation,a.localRotation),o&&this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)},e.prototype.setLocalRotation=function(t,e,n,r,i,o){void 0===o&&(o=!0),"number"==typeof e&&(e=ot(Za,e,n,r,i));var a=t.transformable;it(a.localRotation,e),o&&this.dirtifyLocal(t,a)},e.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(Wa,e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,o)},e.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},e.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},e.prototype.triggerEvent=function(t,e){t.isConnected&&!this.eventEntitySet.has(t.entity)&&(this.boundsChangedEvent.detail=e,this.boundsChangedEvent.target=t,t.isMutationObserved?t.dispatchEvent(this.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(this.boundsChangedEvent,!0),this.eventEntitySet.add(t.entity))},e.prototype.triggerPendingEvents=function(t){var e=this;t?(os.affectChildren=!0,t.forEach((function(t){e.triggerEvent(t,os)}))):this.pendingEvents.forEach((function(t,n){os.affectChildren=t,t?n.forEach((function(t){e.triggerEvent(t,os)})):e.triggerEvent(n,os)})),this.eventEntitySet.clear(),this.clearPendingEvents()},e.prototype.clearPendingEvents=function(){this.pendingEvents.clear()},e.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Da(n),n=n.parentNode;e&&t.forEach((function(t){Da(t)})),this.informDependentDisplayObjects(t),!e&&this.pendingEvents.has(t)||this.pendingEvents.set(t,e)},e.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},e.prototype.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r,!0),r.dispatchEvent(new Ia(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,Ia.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},e.prototype.getPosition=function(t){var e=t.transformable;return M(e.position,this.getWorldTransform(t,e))},e.prototype.getRotation=function(t){var e=t.transformable;return T(e.rotation,this.getWorldTransform(t,e))},e.prototype.getScale=function(t){var e=t.transformable;return S(e.scaling,this.getWorldTransform(t,e))},e.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},e.prototype.getLocalPosition=function(t){return t.transformable.localPosition},e.prototype.getLocalRotation=function(t){return t.transformable.localRotation},e.prototype.getLocalScale=function(t){return t.transformable.localScale},e.prototype.getLocalSkew=function(t){return t.transformable.localSkew},e.prototype.calcLocalTransform=function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){P(t.localTransform,t.localRotation,t.localPosition,G(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(s(qa),qa[4]=Math.tan(t.localSkew[0]),qa[1]=Math.tan(t.localSkew[1]),h(t.localTransform,t.localTransform,qa));var e=P(qa,ot(Za,0,0,0,1),B(za,1,1,1),t.localScale,t.origin);h(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,o=t.localScale,a=t.origin,u=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==o[0]||1!==o[1]||1!==o[2])||(0!==a[0]||0!==a[1]||0!==a[2])?P(n,i,r,o,a):u?y(n,r):s(n)}},e.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},e.prototype.setLocalTransform=function(t,e){var n=M($a,e),r=T(Ka,e),i=S(Qa,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,Ha),this.setLocalPosition(t,Ya),this.setLocalEulerAngles(t,Ya),this.setLocalSkew(t,ja)},e.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Lt.isEmpty(r))return null;var i=n||new Lt;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},e.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return n.dirty&&ps.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Lt},e.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new Lt).update(r.center,r.halfExtents))})),o||(o=new Lt),e){var a=Jn(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return e?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o},e.prototype.getLocalBounds=function(t){if(t.parentNode){var e=Xa;t.parentNode.transformable&&(e=c(qa,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Lt.isEmpty(n)){var r=new Lt;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},e.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Lt.isEmpty(i)||(r=new Lt).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=Et(r.getMin(),2),s=a[0],u=a[1],c=Et(r.getMax(),2);return new Gt(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new Gt((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},e.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},e.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},e.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?h(e.worldTransform,r.worldTransform,e.localTransform):o(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},e.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),ss={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},us=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,cs=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),ls=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),hs=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!ls.exec(n)&&!cs.exec(t))},this.trimByKinsokuShorui=function(t){var e=bt([],Et(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=ss.MetricsString+ss.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(ss.BaselineSymbol).width),u=ss.HeightMultiplier*s;s=s*ss.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,o=e.wordWrap,a=void 0!==o&&o,s=e.lineHeight,u=e.lineWidth,c=void 0===u?1:u,l=e.textBaseline,h=void 0===l?"alphabetic":l,p=e.textAlign,f=void 0===p?"start":p,d=e.letterSpacing,y=void 0===d?0:d,v=e.textPath,g=e.leading,m=void 0===g?0:g,x=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,u=void 0===s?"normal":s,c=t.fontWeight,l=void 0===c?"normal":c,h=Zt(n)&&"".concat(n,"px")||"16px",p=i.split(","),f=p.length-1;f>=0;f--){var d=p[f].trim();!zr.test(d)&&0>Wr.indexOf(d)&&(d='"'.concat(d,'"')),p[f]=d}return"".concat(a," ").concat(u," ").concat(l," ").concat(h," ").concat(p.join(","))}(e),E=this.measureFont(x,n);0===E.fontSize&&(E.fontSize=i,E.ascent=i);var b=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);b.font=x,e.isOverflowing=!1;var M=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),S=Array(M.length),T=0;if(!v){for(k=0;M.length>k;k++){var P=b.measureText(M[k]).width+(M[k].length-1)*y;S[k]=P,T=Math.max(T,P)}A=T+c;var w=s||E.fontSize+c,N=Math.max(w,E.fontSize+c)+(M.length-1)*(w+m),C=0;return"middle"===h?C=-N/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?C=-N:"top"!==h&&"hanging"!==h||(C=0),{font:x,width:A,height:N,lines:M,lineWidths:S,lineHeight:w+=m,maxLineWidth:T,fontProperties:E,lineMetrics:S.map((function(t,e){var n=0;return"center"===f||"middle"===f?n-=t/2:"right"!==f&&"end"!==f||(n-=t),new Gt(n-c/2,C+e*w,t+c,w)}))}}v.getTotalLength();for(var k=0;M.length>k;k++)var A=b.measureText(M[k]).width+(M[k].length-1)*y},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,u=e.maxLines,c=void 0===u?1/0:u,l=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),p=o+s,f="";"ellipsis"===l?f="...":l&&"clip"!==l&&(f=l);for(var d=[],y=0,v=0,g={},m=function(t){return r.getFromCache(t,s,g,h)},x=Array.from(f).reduce((function(t,e){return t+m(e)}),0),E=Array.from(t),b=0;E.length>b;b++){var M=E[b],S=t[b-1],T=t[b+1],P=m(M);if(this.isNewline(M)){if(++y>=c){e.isOverflowing=!0;break}v=0,d[y]=""}else{if(v>0&&v+P>p){if(y+1>=c){if(e.isOverflowing=!0,x>0&&p>=x){for(var w=d[y].length,N=0,C=w,k=0;w>k;k++){var A=m(d[y][k]);if(N+A+x>p){C=k;break}N+=A}d[y]=(d[y]||"").slice(0,C)+f}break}if(v=0,d[++y]="",this.isBreakingSpace(M))continue;this.canBreakInLastChar(M)||(d=this.trimToBreakable(d),v=this.sumTextWidthByCache(d[y]||"",g)),this.shouldBreakByKinsokuShorui(M,T)&&(d=this.trimByKinsokuShorui(d),v+=m(S||""))}v+=P,d[y]=(d[y]||"")+M}}return d.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&ss.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&ss.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=bt([],Et(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},t.prototype.canBreakInLastChar=function(t){return!t||!us.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!us.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),ps={},fs=(Fa=new va,Va=new ya,(Ba={})[t.Shape.CIRCLE]=new ha,Ba[t.Shape.ELLIPSE]=new pa,Ba[t.Shape.RECT]=Fa,Ba[t.Shape.IMAGE]=Fa,Ba[t.Shape.GROUP]=new ma,Ba[t.Shape.LINE]=new fa,Ba[t.Shape.TEXT]=new ga(ps),Ba[t.Shape.POLYLINE]=Va,Ba[t.Shape.POLYGON]=Va,Ba[t.Shape.PATH]=new da,Ba[t.Shape.HTML]=new xa,Ba[t.Shape.MESH]=null,Ba),ds=function(){var e,n=new Wo,r=new $o;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new ta,e[t.PropertySyntax.ANGLE]=new Ho,e[t.PropertySyntax.DEFINED_PATH]=new Xo,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new zo,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new Ko,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new Qo,e[t.PropertySyntax.COORDINATE]=new $o,e[t.PropertySyntax.OFFSET_DISTANCE]=new ea,e[t.PropertySyntax.OPACITY_VALUE]=new na,e[t.PropertySyntax.PATH]=new ra,e[t.PropertySyntax.LIST_OF_POINTS]=new ia,e[t.PropertySyntax.SHADOW_BLUR]=new oa,e[t.PropertySyntax.TEXT]=new aa,e[t.PropertySyntax.TEXT_TRANSFORM]=new sa,e[t.PropertySyntax.TRANSFORM]=new ua,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new ca,e[t.PropertySyntax.Z_INDEX]=new la,e[t.PropertySyntax.MARKER]=new Jo,e}();ps.CameraContribution=pn,ps.AnimationTimeline=null,ps.EasingFunction=null,ps.offscreenCanvasCreator=new ka,ps.sceneGraphSelector=new La,ps.sceneGraphService=new as(ps),ps.textService=new hs(ps),ps.geometryUpdaterFactory=fs,ps.CSSPropertySyntaxFactory=ds,ps.styleValueRegistry=new Yo(ps),ps.layoutRegistry=null,ps.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ps.enableCSSParsing=!1,ps.enableDataset=!1,ps.enableStyleSyntax=!0,ps.enableAttributeDashCased=!1,ps.enableSizeAttenuation=!1;var ys=0;var vs=new Ia(t.ElementEvent.INSERTED,null,"","","",0,"",""),gs=new Ia(t.ElementEvent.REMOVED,null,"","","",0,"",""),ms=new Ta(t.ElementEvent.DESTROY),xs=function(e){function n(){var n=e.apply(this,bt([],Et(arguments),!1))||this;return n.entity=ys++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=ps.enableCSSParsing?{opacity:Gn,fillOpacity:Gn,strokeOpacity:Gn,fill:Gn,stroke:Gn,transform:Gn,transformOrigin:Gn,visibility:Gn,pointerEvents:Gn,lineWidth:Gn,lineCap:Gn,lineJoin:Gn,increasedLineWidthForHitTesting:Gn,fontSize:Gn,fontFamily:Gn,fontStyle:Gn,fontWeight:Gn,fontVariant:Gn,textAlign:Gn,textBaseline:Gn,textTransform:Gn,zIndex:Gn,filter:Gn,shadowType:Gn}:{},n.parsedStyle={},n.attributes={},n}return pt(n,e),Object.defineProperty(n.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),n.prototype.cloneNode=function(t){throw Error(Ut)},n.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return ps.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),this.isMutationObserved&&(vs.relatedNode=this,t.dispatchEvent(vs)),t},n.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},n.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},n.prototype.removeChild=function(t){var e;return gs.relatedNode=this,t.dispatchEvent(gs),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),ps.sceneGraphService.detach(t),t},n.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},n.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},n.prototype.matches=function(t){return ps.sceneGraphService.matches(t,this)},n.prototype.getElementById=function(t){return ps.sceneGraphService.querySelector("#".concat(t),this)},n.prototype.getElementsByName=function(t){return ps.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},n.prototype.getElementsByClassName=function(t){return ps.sceneGraphService.querySelectorAll(".".concat(t),this)},n.prototype.getElementsByTagName=function(t){return ps.sceneGraphService.querySelectorAll(t,this)},n.prototype.querySelector=function(t){return ps.sceneGraphService.querySelector(t,this)},n.prototype.querySelectorAll=function(t){return ps.sceneGraphService.querySelectorAll(t,this)},n.prototype.closest=function(t){var e=this;do{if(ps.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},n.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},n.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},n.prototype.after=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},n.prototype.before=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=Et(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,bt([],Et(a),!1))}},n.prototype.replaceWith=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this.after.apply(this,bt([],Et(t),!1)),this.remove()},n.prototype.append=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},n.prototype.prepend=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},n.prototype.replaceChildren=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,bt([],Et(t),!1))},n.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},n.prototype.destroy=function(){var t;this.dispatchEvent(ms),this.remove(),null===(t=this.emitter)||void 0===t||t.removeAllListeners(),this.destroyed=!0},n.prototype.getGeometryBounds=function(){return ps.sceneGraphService.getGeometryBounds(this)},n.prototype.getRenderBounds=function(){return ps.sceneGraphService.getBounds(this,!0)},n.prototype.getBounds=function(){return ps.sceneGraphService.getBounds(this)},n.prototype.getLocalBounds=function(){return ps.sceneGraphService.getLocalBounds(this)},n.prototype.getBoundingClientRect=function(){return ps.sceneGraphService.getBoundingClientRect(this)},n.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},n.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},n.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},n.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return ps.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){if(ps.enableAttributeDashCased){var n=Cn(t);e=this.attributes[n]}return ps.enableCSSParsing&&Vt(e)?null:e}return e},n.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},n.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},n.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},n.prototype.setAttribute=function(t,e,n,r){this.attributes[t]=e},n.prototype.getAttributeNS=function(t,e){throw Error(Ut)},n.prototype.getAttributeNode=function(t){throw Error(Ut)},n.prototype.getAttributeNodeNS=function(t,e){throw Error(Ut)},n.prototype.hasAttributeNS=function(t,e){throw Error(Ut)},n.prototype.removeAttributeNS=function(t,e){throw Error(Ut)},n.prototype.removeAttributeNode=function(t){throw Error(Ut)},n.prototype.setAttributeNS=function(t,e,n){throw Error(Ut)},n.prototype.setAttributeNode=function(t){throw Error(Ut)},n.prototype.setAttributeNodeNS=function(t){throw Error(Ut)},n.prototype.toggleAttribute=function(t,e){throw Error(Ut)},n}(Na);function Es(t){return!!(null==t?void 0:t.nodeName)}var bs,Ms=ps.globalThis.Proxy?ps.globalThis.Proxy:function(){},Ss=new Ia(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Ia.MODIFICATION,null,null),Ts={opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Ps={fill:jn,stroke:jn,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},ws=bt(bt([],Et(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Ns="data-",Cs=D(),ks=Q(),As=function(e){function n(n){var r=e.call(this)||this;return r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.config=n,r.id=n.id||"",r.name=n.name||"",(n.className||n.class)&&(r.className=n.className||n.class),r.nodeName=n.type||t.Shape.GROUP,ps.enableCSSParsing?(Object.assign(r.attributes,Ts),Object.assign(r.parsedStyle,Ps,r.config.initialParsedStyle)):n.initialParsedStyle&&Object.assign(r.parsedStyle,n.initialParsedStyle),r.initAttributes(n.style),ps.enableDataset&&(r.dataset=new Ms({},{get:function(t,e){var n="".concat(Ns).concat(wn(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(Ns).concat(wn(e)),n),!0}})),ps.enableStyleSyntax&&(r.style=new Ms({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return pt(n,e),n.prototype.destroy=function(){e.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},n.prototype.cloneNode=function(t,e){var n=yt({},this.attributes);for(var r in n){var i=n[r];Es(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},n.prototype.initAttributes=function(t){void 0===t&&(t={}),ps.styleValueRegistry.processProperties(this,ps.enableAttributeDashCased?function(t){var e,n,r={};try{for(var i=xt(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=Et(o.value,2),s=a[1];r[Cn(a[0])]=s}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}(t):t,void 0,void 0,!0,ps.enableCSSParsing?ws:void 0,void 0),this.renderable.dirty=!0},n.prototype.setAttribute=function(t,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=!0),ps.enableAttributeDashCased&&(t=Cn(t)),te(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,void 0,void 0,void 0,void 0,i),e.prototype.setAttribute.call(this,t,n))},n.prototype.internalSetAttribute=function(t,e,n,r,i,o,a){var s,u=this.renderable,c=this.attributes[t],l=this.parsedStyle[t];ps.styleValueRegistry.processProperties(this,((s={})[t]=e,s),n,r,i,o,a),u.dirty=!0;var h=this.parsedStyle[t];this.isConnected&&(Ss.relatedNode=this,Ss.prevValue=c,Ss.newValue=e,Ss.attrName=t,Ss.prevParsedValue=l,Ss.newParsedValue=h,this.isMutationObserved?this.dispatchEvent(Ss):(Ss.target=this,this.ownerDocument.defaultView.dispatchEvent(Ss,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,c,e,l,h)},n.prototype.getBBox=function(){var t=this.getBounds(),e=Et(t.getMin(),2),n=e[0],r=e[1],i=Et(t.getMax(),2);return new Gt(n,r,i[0]-n,i[1]-r)},n.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ps.sceneGraphService.setOrigin(this,Be(t,e,n,!1)),this},n.prototype.getOrigin=function(){return ps.sceneGraphService.getOrigin(this)},n.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ps.sceneGraphService.setPosition(this,Be(t,e,n,!1)),this},n.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ps.sceneGraphService.setLocalPosition(this,Be(t,e,n,!1)),this},n.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ps.sceneGraphService.translate(this,Be(t,e,n,!1)),this},n.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ps.sceneGraphService.translateLocal(this,Be(t,e,n,!1)),this},n.prototype.getPosition=function(){return ps.sceneGraphService.getPosition(this)},n.prototype.getLocalPosition=function(){return ps.sceneGraphService.getLocalPosition(this)},n.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},n.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Be(t,e=e||t,n=n||t,!1)),ps.sceneGraphService.scaleLocal(this,t),this},n.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Be(t,e=e||t,n=n||t,!1)),ps.sceneGraphService.setLocalScale(this,t),this},n.prototype.getLocalScale=function(){return ps.sceneGraphService.getLocalScale(this)},n.prototype.getScale=function(){return ps.sceneGraphService.getScale(this)},n.prototype.getEulerAngles=function(){return Ye(Et(We(Cs,ps.sceneGraphService.getWorldTransform(this)),3)[2])},n.prototype.getLocalEulerAngles=function(){return Ye(Et(We(Cs,ps.sceneGraphService.getLocalRotation(this)),3)[2])},n.prototype.setEulerAngles=function(t){return ps.sceneGraphService.setEulerAngles(this,0,0,t),this},n.prototype.setLocalEulerAngles=function(t){return ps.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},n.prototype.rotateLocal=function(t,e,n){return Vt(e)&&Vt(n)?ps.sceneGraphService.rotateLocal(this,0,0,t):ps.sceneGraphService.rotateLocal(this,t,e,n),this},n.prototype.rotate=function(t,e,n){return Vt(e)&&Vt(n)?ps.sceneGraphService.rotate(this,0,0,t):ps.sceneGraphService.rotate(this,t,e,n),this},n.prototype.setRotation=function(t,e,n,r){return ps.sceneGraphService.setRotation(this,t,e,n,r),this},n.prototype.setLocalRotation=function(t,e,n,r){return ps.sceneGraphService.setLocalRotation(this,t,e,n,r),this},n.prototype.setLocalSkew=function(t,e){return ps.sceneGraphService.setLocalSkew(this,t,e),this},n.prototype.getRotation=function(){return ps.sceneGraphService.getRotation(this)},n.prototype.getLocalRotation=function(){return ps.sceneGraphService.getLocalRotation(this)},n.prototype.getLocalSkew=function(){return ps.sceneGraphService.getLocalSkew(this)},n.prototype.getLocalTransform=function(){return ps.sceneGraphService.getLocalTransform(this)},n.prototype.getWorldTransform=function(){return ps.sceneGraphService.getWorldTransform(this)},n.prototype.setLocalTransform=function(t){return ps.sceneGraphService.setLocalTransform(this,t),this},n.prototype.resetLocalTransform=function(){ps.sceneGraphService.resetLocalTransform(this)},n.prototype.getAnimations=function(){return this.activeAnimations},n.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},n.prototype.isVisible=function(){var t,e;return ps.enableCSSParsing?"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility):"hidden"!==(null===(e=this.parsedStyle)||void 0===e?void 0:e.visibility)},Object.defineProperty(n.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),n.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},n.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},n.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,bt([],Et(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},n.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,bt([],Et(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},n.prototype.getConfig=function(){return this.config},n.prototype.attr=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=Et(e,2),i=r[0],o=r[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},n.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=Et(M(Cs,e),2),r=n[0],i=n[1],o=Et(S(Cs,e),2),a=o[0],s=o[1],u=T(ks,e),c=Et(We(Cs,u),3);return ze(c[0]||c[2],r,i,a,s)},n.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},n.prototype.setMatrix=function(t){var e=Et(qe(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},n.prototype.setLocalMatrix=function(t){var e=Et(qe(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},n.prototype.show=function(){ps.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},n.prototype.hide=function(){ps.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},n.prototype.getCount=function(){return this.childElementCount},n.prototype.getParent=function(){return this.parentElement},n.prototype.getChildren=function(){return this.children},n.prototype.getFirst=function(){return this.firstElementChild},n.prototype.getLast=function(){return this.lastElementChild},n.prototype.getChildByIndex=function(t){return this.children[t]||null},n.prototype.add=function(t,e){return this.appendChild(t,e)},n.prototype.set=function(t,e){this.config[t]=e},n.prototype.get=function(t){return this.config[t]},n.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},n.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},n.prototype.setZIndex=function(t){return this.style.zIndex=t,this},n}(xs),Rs=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.CIRCLE},n))||this}return pt(n,e),n}(As),Os=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=vt(e,["style"]);return(n=t.call(this,yt({style:yt({},r)},i))||this).isCustomElement=!0,n}return pt(e,t),e}(As),Ls=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.ELLIPSE},n))||this}return pt(n,e),n}(As),Is=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.GROUP},n))||this}return pt(n,e),n}(As),Ds=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=vt(n,["style"]);return(r=e.call(this,yt({type:t.Shape.HTML,style:yt(ps.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},i)},o))||this).cullable.enable=!1,r}return pt(n,e),n.prototype.getDomElement=function(){return this.parsedStyle.$el},n.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},n.prototype.getLocalBounds=function(){if(this.parentNode){var t=c(i(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Lt.isEmpty(e)){var n=new Lt;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(As),_s=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.IMAGE},n))||this}return pt(n,e),n}(As),Gs=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=vt(n,["style"]);(r=e.call(this,yt({type:t.Shape.LINE,style:yt({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},o))||this).markerStartAngle=0,r.markerEndAngle=0;var a=r.parsedStyle,s=a.markerStart,u=a.markerEnd;return s&&Es(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),u&&Es(u)&&(r.markerEndAngle=u.getLocalEulerAngles(),r.appendChild(u)),r.transformMarker(!0),r.transformMarker(!1),r}return pt(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Es(r)&&(this.markerStartAngle=0,r.remove()),i&&Es(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Es(r)&&(this.markerEndAngle=0,r.remove()),i&&Es(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,o=e.x2,a=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&Es(u)){var c,l,h,p,f,d,y;t?(p=i,f=a,l=o-i,h=s-a,d=n||0,y=this.markerStartAngle):(p=o,f=s,l=i-o,h=a-s,d=r||0,y=this.markerEndAngle),u.setLocalEulerAngles(180*(c=Math.atan2(h,l))/Math.PI+y),u.setLocalPosition(p+Math.cos(c)*d,f+Math.sin(c)*d)}},n.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=hr(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=W(D(),G(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new _t(a[0],a[1])},n.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},n.prototype.getTotalLength=function(){var t=this.parsedStyle;return lr(t.x1,t.y1,t.x2,t.y2)},n}(As),Us=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=vt(n,["style"]);(r=e.call(this,yt({type:t.Shape.PATH,style:yt(ps.enableCSSParsing?{d:"",miterLimit:""}:{},i),initialParsedStyle:ps.enableCSSParsing?null:{miterLimit:4,d:yt({},Wn)}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,s=a.markerStart,u=a.markerEnd,c=a.markerMid;return s&&Es(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),c&&Es(c)&&r.placeMarkerMid(c),u&&Es(u)&&(r.markerEndAngle=u.getLocalEulerAngles(),r.appendChild(u)),r.transformMarker(!0),r.transformMarker(!1),r}return pt(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Es(r)&&(this.markerStartAngle=0,r.remove()),i&&Es(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Es(r)&&(this.markerEndAngle=0,r.remove()),i&&Es(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&Es(i)){var o,a,s,u,c,l,h;if(t){var p=Et(this.getStartTangent(),2);u=(d=p[1])[0],c=d[1],a=(f=p[0])[0]-d[0],s=f[1]-d[1],l=n||0,h=this.markerStartAngle}else{var f,d,y=Et(this.getEndTangent(),2);u=(d=y[1])[0],c=d[1],a=(f=y[0])[0]-d[0],s=f[1]-d[1],l=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(o=Math.atan2(s,a))/Math.PI+h),i.setLocalPosition(u+Math.cos(o)*l,c+Math.sin(o)*l)}},n.prototype.placeMarkerMid=function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Es(t))for(var n=1;e.length-1>n;n++){var r=Et(e[n].currentPoint,2),i=r[0],o=r[1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,o)}},n.prototype.getTotalLength=function(){return xr(this)},n.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return Le(t,e,yt(yt({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=W(D(),G(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new _t(o[0],o[1])},n.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*xr(this),e)},n.prototype.getStartTangent=function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},n.prototype.getEndTangent=function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(As),Bs=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=vt(n,["style"]);(r=e.call(this,yt({type:t.Shape.POLYGON,style:yt(ps.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},i),initialParsedStyle:ps.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,s=a.markerStart,u=a.markerEnd,c=a.markerMid;return s&&Es(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),c&&Es(c)&&r.placeMarkerMid(c),u&&Es(u)&&(r.markerEndAngle=u.getLocalEulerAngles(),r.appendChild(u)),r.transformMarker(!0),r.transformMarker(!1),r}return pt(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Es(r)&&(this.markerStartAngle=0,r.remove()),i&&Es(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Es(r)&&(this.markerEndAngle=0,r.remove()),i&&Es(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,o=t?e.markerStart:e.markerEnd;if(o&&Es(o)&&i){var a,s,u,c,l,h,p;if(c=i[0][0],l=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,p=this.markerStartAngle;else{var f=i.length;this.parsedStyle.isClosed?(s=i[f-1][0]-i[0][0],u=i[f-1][1]-i[0][1]):(c=i[f-1][0],l=i[f-1][1],s=i[f-2][0]-i[f-1][0],u=i[f-2][1]-i[f-1][1]),h=r||0,p=this.markerEndAngle}o.setLocalEulerAngles(180*(a=Math.atan2(u,s))/Math.PI+p),o.setLocalPosition(c+Math.cos(a)*h,l+Math.sin(a)*h)}},n.prototype.placeMarkerMid=function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Es(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,i)}},n}(As),Fs=function(e){function n(n){void 0===n&&(n={});var r=n.style,i=vt(n,["style"]);return e.call(this,yt({type:t.Shape.POLYLINE,style:yt(ps.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},r),initialParsedStyle:ps.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return pt(n,e),n.prototype.getTotalLength=function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=yr(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t},n.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},n.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,o=[],a=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=lr(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))})),this.parsedStyle.points.segments=o}var u=0,c=0;this.parsedStyle.points.segments.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),c=n)}));var l=hr(n[c][0],n[c][1],n[c+1][0],n[c+1][1],u),h=l.x,p=l.y,f=W(D(),G(h,p,0),e?this.getWorldTransform():this.getLocalTransform());return new _t(f[0],f[1])},n.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},n.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(Bs),Vs=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.RECT},n))||this}return pt(n,e),n}(As),js=function(e){function n(n){void 0===n&&(n={});var r=n.style,i=vt(n,["style"]);return e.call(this,yt({type:t.Shape.TEXT,style:yt(ps.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""}:{fill:"black"},r)},i))||this}return pt(n,e),n.prototype.getComputedTextLength=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},n.prototype.getLineBoundingRects=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},n.prototype.isOverflowing=function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing},n}(As),Ys=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,Rs),this.define(t.Shape.ELLIPSE,Ls),this.define(t.Shape.RECT,Vs),this.define(t.Shape.IMAGE,_s),this.define(t.Shape.LINE,Gs),this.define(t.Shape.GROUP,Is),this.define(t.Shape.PATH,Us),this.define(t.Shape.POLYGON,Bs),this.define(t.Shape.POLYLINE,Fs),this.define(t.Shape.TEXT,js),this.define(t.Shape.HTML,Ds)}return e.prototype.define=function(t,e){this.registry[t]=e},e.prototype.get=function(t){return this.registry[t]},e}(),Hs={number:function(t){return new Ln(t)},percent:function(t){return new Ln(t,"%")},px:function(t){return new Ln(t,"px")},em:function(t){return new Ln(t,"em")},rem:function(t){return new Ln(t,"rem")},deg:function(t){return new Ln(t,"deg")},grad:function(t){return new Ln(t,"grad")},rad:function(t){return new Ln(t,"rad")},turn:function(t){return new Ln(t,"turn")},s:function(t){return new Ln(t,"s")},ms:function(t){return new Ln(t,"ms")},registerProperty:function(t){ps.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){ps.layoutRegistry.registerLayout(t,e)}},Xs=function(e){function n(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new ps.AnimationTimeline(n)}catch(t){}var r={};return Bo.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=Ft(n)?n(t.Shape.GROUP):n)})),n.documentElement=new Is({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return pt(n,e),Object.defineProperty(n.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),n.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?js:Is);var r=new n(e);return r.ownerDocument=this,r},n.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},n.prototype.cloneNode=function(t){throw Error(Ut)},n.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},n.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},n.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},n.prototype.elementFromPoint=function(t,e){return gt(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,l,h;return mt(this,(function(p){switch(p.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,0>r||0>i||r>a||i>s?[2,null]:(u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,l=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:l},picked:[]})]);case 1:return[2,(h=p.sent().picked)&&h[0]||this.documentElement]}}))}))},n.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},n.prototype.elementsFromPoint=function(t,e){return gt(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,l,h;return mt(this,(function(p){switch(p.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,0>r||0>i||r>a||i>s?[2,[]]:(u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,l=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:l},picked:[]})]);case 1:return(h=p.sent().picked)[h.length-1]!==this.documentElement&&h.push(this.documentElement),[2,h]}}))}))},n.prototype.appendChild=function(t,e){throw Error(Bt)},n.prototype.insertBefore=function(t,e){throw Error(Bt)},n.prototype.removeChild=function(t,e){throw Error(Bt)},n.prototype.replaceChild=function(t,e,n){throw Error(Bt)},n.prototype.append=function(){throw Error(Bt)},n.prototype.prepend=function(){throw Error(Bt)},n.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},n.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},n.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.prototype.find=function(t){return this.documentElement.find(t)},n.prototype.findAll=function(t){return this.documentElement.findAll(t)},n}(Na),Ws=function(){function e(t){this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,o=n.renderingContext,a=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===a.length?o.unculledEntities.indexOf(e.entity)>-1:a.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new Ta(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e.tag="Culling",e}(),zs=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Ma(null),this.rootWheelEvent=new Sa(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var s=t.normalizeToPointerEvent(e,a);try{for(var u=xt(s),c=u.next();!c.done;c=u.next()){var l=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(l)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,s=t.normalizeToPointerEvent(e,a);try{for(var u=xt(s),c=u.next();!c.done;c=u.next()){var l=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(l)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=xt(o),s=a.next();!s.done;s=a.next()){var u=n.bootstrapEvent(n.rootPointerEvent,s.value,i,t);n.context.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(o,t)?"":"outside",s=n.normalizeToPointerEvent(t,i);try{for(var u=xt(s),c=u.next();!c.done;c=u.next()){var l=n.bootstrapEvent(n.rootPointerEvent,c.value,i,t);l.type+=a,n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=xt(o),s=a.next();!s.done;s=a.next()){var u=n.bootstrapEvent(n.rootPointerEvent,s.value,i,t);n.context.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.y;t.viewport.x=i.x,t.viewport.y=o;var a=this.context.eventService.viewport2Canvas(t.viewport),s=a.y;return t.canvas.x=a.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=er[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=nr.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];te(i.button)&&(i.button=0),te(i.buttons)&&(i.buttons=1),te(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),te(i.width)&&(i.width=i.radiusX||1),te(i.height)&&(i.height=i.radiusY||1),te(i.tiltX)&&(i.tiltX=0),te(i.tiltY)&&(i.tiltY=0),te(i.pointerType)&&(i.pointerType="touch"),te(i.pointerId)&&(i.pointerId=i.identifier||0),te(i.pressure)&&(i.pressure=i.force||.5),te(i.twist)&&(i.twist=0),te(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;te(o.isPrimary)&&(o.isPrimary=!0),te(o.width)&&(o.width=1),te(o.height)&&(o.height=1),te(o.tiltX)&&(o.tiltX=0),te(o.tiltY)&&(o.tiltY=0),te(o.pointerType)&&(o.pointerType="mouse"),te(o.pointerId)&&(o.pointerId=1),te(o.pressure)&&(o.pressure=.5),te(o.twist)&&(o.twist=0),te(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),qs=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],Zs=function(){function e(){}return e.prototype.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(Lt.isEmpty(a))return!1;var s=e.getFrustum(),u=null===(i=null===(r=n.parentNode)||void 0===r?void 0:r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,u||t.Mask.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==t.Mask.OUTSIDE,o.visible},e.prototype.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=qs.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,p=l.distance;if(0>H(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>H(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}(),$s=function(){function e(){this.toSync=new Set,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return e.prototype.apply=function(n){var r,i=this,o=n.renderingService,a=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var s=function(t){t.target.renderable.dirty=!0,o.dirtify()},u=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){i.toSync.add(t)}));for(var n=e;n;)n.renderable&&i.toSync.add(n),n=n.parentElement;o.dirtify()},c=function(t){var e=t.target;ps.enableSizeAttenuation&&ps.styleValueRegistry.updateSizeAttenuation(e,a.getCamera().getZoom()),ps.enableCSSParsing&&ps.styleValueRegistry.recalc(e),ps.sceneGraphService.dirtifyToRoot(e),o.dirtify()},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&i.rBush.remove(n.aabb),i.toSync.delete(e),ps.sceneGraphService.dirtifyToRoot(e),o.dirtify()};o.hooks.init.tap(e.tag,(function(){a.addEventListener(t.ElementEvent.MOUNTED,c),a.addEventListener(t.ElementEvent.UNMOUNTED,l),a.addEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.addEventListener(t.ElementEvent.BOUNDS_CHANGED,u)})),o.hooks.destroy.tap(e.tag,(function(){a.removeEventListener(t.ElementEvent.MOUNTED,c),a.removeEventListener(t.ElementEvent.UNMOUNTED,l),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,u),i.toSync.clear()}));var h=null!==(r=ps.globalThis.requestIdleCallback)&&void 0!==r?r:Fr.bind(ps.globalThis);o.hooks.endFrame.tap(e.tag,(function(){var t=n.renderingService.frame;1===t||(2===t?(i.syncing=!0,h((function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0}))):i.syncRTree())}))},e.prototype.syncRTree=function(t){var e=this;if(void 0===t&&(t=!1),t||!this.syncing&&0!==this.toSync.size){this.syncing=!0;var n=[];this.toSync.forEach((function(r){if(r.isConnected){var i=r.rBushNode;(null==i?void 0:i.aabb)&&e.rBush.remove(i.aabb);var o=r.getRenderBounds();if(o){var a=r.renderable;t&&(a.dirtyRenderBounds||(a.dirtyRenderBounds=new Lt),a.dirtyRenderBounds.update(o.center,o.halfExtents));var s=Et(o.getMin(),2),u=s[0],c=s[1],l=Et(o.getMax(),2),h=l[0],p=l[1];i.aabb||(i.aabb={}),i.aabb.displayObject=r,i.aabb.minX=u,i.aabb.minY=c,i.aabb.maxX=h,i.aabb.maxY=p}i.aabb&&(isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||n.push(i.aabb))}})),this.rBush.load(n),n.length=0,this.toSync.clear(),this.syncing=!1}},e.tag="Prepare",e}();t.CanvasEvent=void 0,(bs=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",bs.BEFORE_RENDER="beforerender",bs.RERENDER="rerender",bs.AFTER_RENDER="afterrender",bs.BEFORE_DESTROY="beforedestroy",bs.AFTER_DESTROY="afterdestroy",bs.RESIZE="resize",bs.DIRTY_RECTANGLE="dirtyrectangle",bs.RENDERER_CHANGED="rendererchanged";var Ks=new Ta(t.ElementEvent.MOUNTED),Qs=new Ta(t.ElementEvent.UNMOUNTED),Js=new Ta(t.CanvasEvent.BEFORE_RENDER),tu=new Ta(t.CanvasEvent.RERENDER),eu=new Ta(t.CanvasEvent.AFTER_RENDER),nu=function(e){function n(t){var n=e.call(this)||this;n.Element=As,n.inited=!1,n.context={},n.document=new Xs,n.document.defaultView=n,n.customElements=new Ys;var r=t.container,i=t.canvas,o=t.offscreenCanvas,a=t.width,s=t.height,u=t.devicePixelRatio,c=t.renderer,l=t.background,h=t.cursor,p=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,y=t.createImage,v=t.supportsPointerEvents,g=t.supportsTouchEvents,m=t.supportsCSSTransform,x=t.useNativeClickEvent,E=t.alwaysTriggerPointerEventOnCanvas,b=t.isTouchEvent,M=t.isMouseEvent,S=t.dblClickSpeed;t.supportsMutipleCanvasesInOneContainer||function(t,e){if(t){var n="string"==typeof t?t:t.id||Zn++;qn[n]&&qn[n].destroy(),qn[n]=e}}(r,n);var T=a,P=s,w=u;return i&&(w=1>(w=u||$n&&window.devicePixelRatio||1)?1:Math.ceil(w),T=a||function(t){var e=tr(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/w,P=s||function(t){var e=tr(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/w),o&&(ps.offscreenCanvas=o),n.devicePixelRatio=w,n.requestAnimationFrame=null!=f?f:Fr.bind(ps.globalThis),n.cancelAnimationFrame=null!=d?d:Vr.bind(ps.globalThis),n.supportsTouchEvents=null!=g?g:"ontouchstart"in ps.globalThis,n.supportsPointerEvents=null!=v?v:!!ps.globalThis.PointerEvent,n.isTouchEvent=null!=b?b:function(t){return n.supportsTouchEvents&&t instanceof ps.globalThis.TouchEvent},n.isMouseEvent=null!=M?M:function(t){return!ps.globalThis.MouseEvent||t instanceof ps.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof ps.globalThis.PointerEvent))},n.dblClickSpeed=null!=S?S:200,n.initRenderingContext({container:r,canvas:i,width:T,height:P,renderer:c,offscreenCanvas:o,devicePixelRatio:w,cursor:h||"default",background:l||"transparent",createImage:y,document:p,supportsCSSTransform:m,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:E}),n.initDefaultCamera(T,P,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return pt(n,e),n.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},n.prototype.initDefaultCamera=function(e,n,r){var i=this,o=new ps.CameraContribution;o.clipSpaceNearZ=r,o.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),o.canvas=this,o.eventEmitter.on(ln.UPDATED,(function(){i.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED),ps.enableSizeAttenuation&&i.getConfig().renderer.getConfig().enableSizeAttenuation&&i.updateSizeAttenuation()})),this.context.camera=o},n.prototype.updateSizeAttenuation=function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){ps.styleValueRegistry.updateSizeAttenuation(e,t)}))},n.prototype.getConfig=function(){return this.context.config},n.prototype.getRoot=function(){return this.document.documentElement},n.prototype.getCamera=function(){return this.context.camera},n.prototype.getContextService=function(){return this.context.contextService},n.prototype.getEventService=function(){return this.context.eventService},n.prototype.getRenderingService=function(){return this.context.renderingService},n.prototype.getRenderingContext=function(){return this.context.renderingContext},n.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(n.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),n.prototype.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new Ta(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new Ta(t.CanvasEvent.AFTER_DESTROY))},n.prototype.changeSize=function(t,e){this.resize(t,e)},n.prototype.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new Ta(t.CanvasEvent.RESIZE,{width:e,height:n}))},n.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},n.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},n.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},n.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},n.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},n.prototype.render=function(t){var e=this;t&&(Js.detail=t,eu.detail=t),this.dispatchEvent(Js),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(tu)})),this.dispatchEvent(eu)},n.prototype.run=function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()},n.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new lt,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new zs,new $s,new Ws([new Zs])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(yt(yt({},ps),this.context)),this.context.renderingService=new Ra(ps,this.context),this.context.eventService=new Ca(ps,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},n.prototype.initRenderingService=function(e,n,r){var i=this;void 0===n&&(n=!1),void 0===r&&(r=!1),this.context.renderingService.init((function(){i.inited=!0,n?r?i.requestAnimationFrame((function(){i.dispatchEvent(new Ta(t.CanvasEvent.READY))})):i.dispatchEvent(new Ta(t.CanvasEvent.READY)):i.dispatchEvent(new Ta(t.CanvasEvent.RENDERER_CHANGED)),i.readyPromise&&i.resolveReadyPromise(),n||i.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),i.mountChildren(i.getRoot()),e.getConfig().enableAutoRendering&&i.run()}))},n.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(ps)}))},n.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),bt([],Et(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(ps)})),this.initRenderer(t)}},n.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},n.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Qs):(Qs.target=t,this.dispatchEvent(Qs,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},n.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(Ks):(Ks.target=t,this.dispatchEvent(Ks,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},n.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},n.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},n.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},n.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},n.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},n.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},n}(wa);t.AABB=Lt,t.AbstractRenderer=St,t.AbstractRendererPlugin=Mt,t.BUILT_IN_PROPERTIES=Bo,t.CSS=Hs,t.CSSGradientValue=Mn,t.CSSKeywordValue=Sn,t.CSSRGB=_n,t.CSSStyleValue=En,t.CSSUnitValue=Ln,t.Camera=pn,t.CameraEvent=ln,t.Canvas=nu,t.Circle=Rs,t.CircleUpdater=ha,t.CustomElement=Os,t.CustomElementRegistry=Ys,t.CustomEvent=Ta,t.DefaultSceneGraphSelector=La,t.DefaultSceneGraphService=as,t.DisplayObject=As,t.Document=Xs,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=Ut,t.Element=xs,t.Ellipse=Ls,t.EllipseUpdater=pa,t.EventService=Ca,t.EventTarget=wa,t.FederatedEvent=Ea,t.FederatedMouseEvent=ba,t.FederatedPointerEvent=Ma,t.FederatedWheelEvent=Sa,t.Frustum=Dt,t.Group=Is,t.GroupUpdater=ma,t.HTML=Ds,t.HTMLUpdater=xa,t.Image=_s,t.Line=Gs,t.LineUpdater=fa,t.MutationEvent=Ia,t.Node=Na,t.OffscreenCanvasCreator=ka,t.Path=Us,t.PathUpdater=da,t.Plane=It,t.Point=_t,t.Polygon=Bs,t.Polyline=Fs,t.PolylineUpdater=ya,t.RBush=lt,t.Rect=Vs,t.RectUpdater=va,t.Rectangle=Gt,t.RenderingService=Ra,t.Text=js,t.TextService=hs,t.TextUpdater=ga,t.computeLinearGradient=function(t,e,n,r){var i=Ve(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}},t.computeRadialGradient=function(e,n,r,i,o,a){var s=i.value,u=o.value;i.unit===t.UnitType.kPercentage&&(s=i.value/100*n),o.unit===t.UnitType.kPercentage&&(u=o.value/100*r);var c=Math.max(Te([0,0],[s,u]),Te([0,r],[s,u]),Te([n,r],[s,u]),Te([n,0],[s,u]));return a&&(a instanceof Ln?c=a.value:a instanceof Sn&&("closest-side"===a.value?c=Math.min(s,n-s,u,r-u):"farthest-side"===a.value?c=Math.max(s,n-s,u,r-u):"closest-corner"===a.value&&(c=Math.min(Te([0,0],[s,u]),Te([0,r],[s,u]),Te([n,r],[s,u]),Te([n,0],[s,u]))))),{x:s+e[0],y:u+e[1],r:c}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle,o=i.x1,a=i.y1,s=i.x2,u=i.y2;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===o?0:o,void 0===a?0:a,void 0===s?0:s,void 0===u?0:u);break;case t.Shape.CIRCLE:var c=e.parsedStyle,l=c.r,h=void 0===l?0:l,p=c.cx,f=c.cy;r=Ar(h,h,void 0===p?0:p,void 0===f?0:f);break;case t.Shape.ELLIPSE:var d=e.parsedStyle,y=d.rx,v=d.ry,g=d.cx,m=d.cy;r=Ar(void 0===y?0:y,void 0===v?0:v,void 0===g?0:g,void 0===m?0:m);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var x=e.parsedStyle,E=x.width,b=void 0===E?0:E,M=x.height,S=void 0===M?0:M,T=x.x,P=void 0===T?0:T,w=x.y,N=void 0===w?0:w,C=x.radius,k=C&&C.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=Et(i,4),a=o[0],s=o[1],u=o[2],c=o[3],l=t>0?1:-1,h=e>0?1:-1,p=l+h!==0?1:0;return[["M",l*a+n,r],["L",t-l*s+n,r],s?["A",s,s,0,0,p,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,p,t+n-l*u,e+r]:null,["L",n+l*c,e+r],c?["A",c,c,0,0,p,n,e+r-h*c]:null,["L",n,h*a+r],a?["A",a,a,0,0,p,l*a+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(b,S,P,N,k&&C.map((function(t){return qt(t,0,Math.min(Math.abs(b)/2,Math.abs(S)/2))})));break;case t.Shape.PATH:r=bt([],Et(e.parsedStyle.d.absolutePath),!1)}if(r.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=G(e[1],e[2],0);n&&W(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=G(e[1],e[2],0),a=G(e[3],e[4],0),s=G(e[5],e[6],0);n&&(W(o,o,n),W(a,a,n),W(s,s,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=G(e[6],e[7],0);n&&W(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else"Q"===e[0]&&(o=G(e[1],e[2],0),a=G(e[3],e[4],0),n&&(W(o,o,n),W(a,a,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(r,0,n)},t.createVec3=Be,t.decompose=qe,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==Et(t,2)[1]})))},t.deg2rad=Ve,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=Jn,t.fromRotationTranslationScale=ze,t.getAngle=Ge,t.getEuler=We,t.getOrCalculatePathTotalLength=xr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.isBrowser=$n,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=_i,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Es,t.isFillOrStrokeAffected=function(t,e,n){void 0===t&&(t="auto");var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Di,t.mergeColors=Ui,t.parseColor=Gi,t.parseLength=Vi,t.parsePath=so,t.parseTransform=mo,t.parsedTransformToMat4=Uo,t.propertyMetadataCache=Vo,t.rad2deg=Ye,t.resetEntityCounter=function(){ys=0},t.runtime=ps,t.setDOMSize=function(t,e,n){$n&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i){void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0);var o=t.map((function(o,a){var s=t[a+1],u=0===a&&(0!==e||0!==n),c=(a===t.length-1||s&&("M"===s[0]||"Z"===s[0]))&&0!==r&&0!==i;switch(o[0]){case"M":return u?"M ".concat(o[1]+e,",").concat(o[2]+n," L ").concat(o[1],",").concat(o[2]):"M ".concat(o[1],",").concat(o[2]);case"L":return"L ".concat(o[1]+(c?r:0),",").concat(o[2]+(c?i:0));case"Q":return"Q ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4])+(c?" L ".concat(o[3]+r,",").concat(o[4]+i):"");case"C":return"C ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4],",").concat(o[5]," ").concat(o[6])+(c?" L ".concat(o[5]+r,",").concat(o[6]+i):"");case"A":return"A ".concat(o[1]," ").concat(o[2]," ").concat(o[3]," ").concat(o[4]," ").concat(o[5]," ").concat(o[6]," ").concat(o[7])+(c?" L ".concat(o[6]+r,",").concat(o[7]+i):"");case"Z":return"Z"}})).join(" ");return~o.indexOf("NaN")?"":o},t.turn2deg=He}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";var e=1e-6,n="undefined"!=typeof Float32Array?Float32Array:Array;function r(){var t=new n(9);return n!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function i(){var t=new n(16);return n!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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}function a(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,y,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=p,t[12]=f,t[13]=d,t[14]=y,t[15]=v,t}function s(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 u(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function c(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=n*s-r*a,x=n*u-i*a,E=n*c-o*a,b=r*u-i*s,M=r*c-o*s,S=i*c-o*u,T=l*y-h*d,P=l*v-p*d,w=l*g-f*d,N=h*v-p*y,C=h*g-f*y,k=p*g-f*v,A=m*k-x*C+E*N+b*w-M*P+S*T;return A?(t[0]=(s*k-u*C+c*N)*(A=1/A),t[1]=(i*C-r*k-o*N)*A,t[2]=(y*S-v*M+g*b)*A,t[3]=(p*M-h*S-f*b)*A,t[4]=(u*w-a*k-c*P)*A,t[5]=(n*k-i*w+o*P)*A,t[6]=(v*E-d*S-g*x)*A,t[7]=(l*S-p*E+f*x)*A,t[8]=(a*C-s*w+c*T)*A,t[9]=(r*w-n*C-o*T)*A,t[10]=(d*M-y*E+g*m)*A,t[11]=(h*E-l*M-f*m)*A,t[12]=(s*P-a*N-u*T)*A,t[13]=(n*N-r*P+i*T)*A,t[14]=(y*x-d*b-v*m)*A,t[15]=(l*b-h*x+p*m)*A,t):null}function l(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];return(e*a-n*o)*(h*v-p*y)-(e*s-r*o)*(l*v-p*d)+(e*u-i*o)*(l*y-h*d)+(n*s-r*a)*(c*v-p*f)-(n*u-i*a)*(c*y-h*f)+(r*u-i*s)*(c*d-l*f)}function h(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=n[0],E=n[1],b=n[2],M=n[3];return t[0]=x*r+E*s+b*h+M*y,t[1]=x*i+E*u+b*p+M*v,t[2]=x*o+E*c+b*f+M*g,t[3]=x*a+E*l+b*d+M*m,t[4]=(x=n[4])*r+(E=n[5])*s+(b=n[6])*h+(M=n[7])*y,t[5]=x*i+E*u+b*p+M*v,t[6]=x*o+E*c+b*f+M*g,t[7]=x*a+E*l+b*d+M*m,t[8]=(x=n[8])*r+(E=n[9])*s+(b=n[10])*h+(M=n[11])*y,t[9]=x*i+E*u+b*p+M*v,t[10]=x*o+E*c+b*f+M*g,t[11]=x*a+E*l+b*d+M*m,t[12]=(x=n[12])*r+(E=n[13])*s+(b=n[14])*h+(M=n[15])*y,t[13]=x*i+E*u+b*p+M*v,t[14]=x*o+E*c+b*f+M*g,t[15]=x*a+E*l+b*d+M*m,t}function p(t,e,n){var r,i,o,a,s,u,c,l,h,p,f,d,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*g+e[12],t[13]=i*y+u*v+p*g+e[13],t[14]=o*y+c*v+f*g+e[14],t[15]=a*y+l*v+d*g+e[15]),t}function f(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];return 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]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t}function d(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],p=e[11];return 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]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-p*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+p*i,t}function y(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(t,n,r){var i,o,a,s=r[0],u=r[1],c=r[2],l=Math.hypot(s,u,c);return e>l?null:(s*=l=1/l,u*=l,c*=l,i=Math.sin(n),t[0]=s*s*(a=1-(o=Math.cos(n)))+o,t[1]=u*s*a+c*i,t[2]=c*s*a-u*i,t[3]=0,t[4]=s*u*a-c*i,t[5]=u*u*a+o,t[6]=c*u*a+s*i,t[7]=0,t[8]=s*c*a+u*i,t[9]=u*c*a-s*i,t[10]=c*c*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function m(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function x(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function E(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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 b(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,p=r*c,f=i*u,d=i*c,y=o*c,v=a*s,g=a*u,m=a*c;return t[0]=1-(f+y),t[1]=h+m,t[2]=p-g,t[3]=0,t[4]=h-m,t[5]=1-(l+y),t[6]=d+v,t[7]=0,t[8]=p+g,t[9]=d-v,t[10]=1-(l+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function M(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function S(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function T(t,e){var r=new n(3);S(r,e);var i=1/r[0],o=1/r[1],a=1/r[2],s=e[0]*i,u=e[1]*o,c=e[2]*a,l=e[4]*i,h=e[5]*o,p=e[6]*a,f=e[8]*i,d=e[9]*o,y=e[10]*a,v=s+h+y,g=0;return v>0?(t[3]=.25*(g=2*Math.sqrt(v+1)),t[0]=(p-d)/g,t[1]=(f-c)/g,t[2]=(u-l)/g):s>h&&s>y?(t[3]=(p-d)/(g=2*Math.sqrt(1+s-h-y)),t[0]=.25*g,t[1]=(u+l)/g,t[2]=(f+c)/g):h>y?(t[3]=(f-c)/(g=2*Math.sqrt(1+h-s-y)),t[0]=(u+l)/g,t[1]=.25*g,t[2]=(p+d)/g):(t[3]=(u-l)/(g=2*Math.sqrt(1+y-s-h)),t[0]=(f+c)/g,t[1]=(p+d)/g,t[2]=.25*g),t}function P(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,y=a*l,v=a*h,g=s*h,m=u*c,x=u*l,E=u*h,b=r[0],M=r[1],S=r[2],T=i[0],P=i[1],w=i[2],N=(1-(y+g))*b,C=(f+E)*b,k=(d-x)*b,A=(f-E)*M,O=(1-(p+g))*M,R=(v+m)*M,L=(d+x)*S,I=(v-m)*S,D=(1-(p+y))*S;return t[0]=N,t[1]=C,t[2]=k,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+T-(N*T+A*P+L*w),t[13]=n[1]+P-(C*T+O*P+I*w),t[14]=n[2]+w-(k*T+R*P+D*w),t[15]=1,t}function w(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=p-v,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function N(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function C(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var k=C;function A(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t}function O(t,n,r,i){var o,a,u,c,l,h,p,f,d,y,v=n[0],g=n[1],m=n[2],x=i[0],E=i[1],b=i[2],M=r[0],S=r[1],T=r[2];return e>Math.abs(v-M)&&e>Math.abs(g-S)&&e>Math.abs(m-T)?s(t):(y=1/Math.hypot(p=v-M,f=g-S,d=m-T),(y=Math.hypot(o=E*(d*=y)-b*(f*=y),a=b*(p*=y)-x*d,u=x*f-E*p))?(o*=y=1/y,a*=y,u*=y):(o=0,a=0,u=0),(y=Math.hypot(c=f*u-d*a,l=d*o-p*u,h=p*a-f*o))?(c*=y=1/y,l*=y,h*=y):(c=0,l=0,h=0),t[0]=o,t[1]=c,t[2]=p,t[3]=0,t[4]=a,t[5]=l,t[6]=f,t[7]=0,t[8]=u,t[9]=h,t[10]=d,t[11]=0,t[12]=-(o*v+a*g+u*m),t[13]=-(c*v+l*g+h*m),t[14]=-(p*v+f*g+d*m),t[15]=1,t)}function R(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var L=h,I=Object.freeze({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15];return t[0]=s*(p*g-f*v)-h*(u*g-c*v)+y*(u*f-c*p),t[1]=-(r*(p*g-f*v)-h*(i*g-o*v)+y*(i*f-o*p)),t[2]=r*(u*g-c*v)-s*(i*g-o*v)+y*(i*c-o*u),t[3]=-(r*(u*f-c*p)-s*(i*f-o*p)+h*(i*c-o*u)),t[4]=-(a*(p*g-f*v)-l*(u*g-c*v)+d*(u*f-c*p)),t[5]=n*(p*g-f*v)-l*(i*g-o*v)+d*(i*f-o*p),t[6]=-(n*(u*g-c*v)-a*(i*g-o*v)+d*(i*c-o*u)),t[7]=n*(u*f-c*p)-a*(i*f-o*p)+l*(i*c-o*u),t[8]=a*(h*g-f*y)-l*(s*g-c*y)+d*(s*f-c*h),t[9]=-(n*(h*g-f*y)-l*(r*g-o*y)+d*(r*f-o*h)),t[10]=n*(s*g-c*y)-a*(r*g-o*y)+d*(r*c-o*s),t[11]=-(n*(s*f-c*h)-a*(r*f-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*v-p*y)-l*(s*v-u*y)+d*(s*p-u*h)),t[13]=n*(h*v-p*y)-l*(r*v-i*y)+d*(r*p-i*h),t[14]=-(n*(s*v-u*y)-a*(r*v-i*y)+d*(r*u-i*s)),t[15]=n*(s*p-u*h)-a*(r*p-i*h)+l*(r*u-i*s),t},clone:function(t){var e=new n(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:o,create:i,determinant:l,equals:function(t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],p=t[9],f=t[10],d=t[11],y=t[12],v=t[13],g=t[14],m=t[15],x=n[0],E=n[1],b=n[2],M=n[3],S=n[4],T=n[5],P=n[6],w=n[7],N=n[8],C=n[9],k=n[10],A=n[11],O=n[12],R=n[13],L=n[14],I=n[15];return!(Math.abs(r-x)>e*Math.max(1,Math.abs(r),Math.abs(x))||Math.abs(i-E)>e*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(o-b)>e*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(a-M)>e*Math.max(1,Math.abs(a),Math.abs(M))||Math.abs(s-S)>e*Math.max(1,Math.abs(s),Math.abs(S))||Math.abs(u-T)>e*Math.max(1,Math.abs(u),Math.abs(T))||Math.abs(c-P)>e*Math.max(1,Math.abs(c),Math.abs(P))||Math.abs(l-w)>e*Math.max(1,Math.abs(l),Math.abs(w))||Math.abs(h-N)>e*Math.max(1,Math.abs(h),Math.abs(N))||Math.abs(p-C)>e*Math.max(1,Math.abs(p),Math.abs(C))||Math.abs(f-k)>e*Math.max(1,Math.abs(f),Math.abs(k))||Math.abs(d-A)>e*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(y-O)>e*Math.max(1,Math.abs(y),Math.abs(O))||Math.abs(v-R)>e*Math.max(1,Math.abs(v),Math.abs(R))||Math.abs(g-L)>e*Math.max(1,Math.abs(g),Math.abs(L))||Math.abs(m-I)>e*Math.max(1,Math.abs(m),Math.abs(I)))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&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]},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},fromQuat:w,fromQuat2:function(t,e){var r=new n(3),i=-e[0],o=-e[1],a=-e[2],s=e[3],u=e[4],c=e[5],l=e[6],h=e[7],p=i*i+o*o+a*a+s*s;return p>0?(r[0]=2*(u*s+h*i+c*a-l*o)/p,r[1]=2*(c*s+h*o+l*i-u*a)/p,r[2]=2*(l*s+h*a+u*o-c*i)/p):(r[0]=2*(u*s+h*i+c*a-l*o),r[1]=2*(c*s+h*o+l*i-u*a),r[2]=2*(l*s+h*a+u*o-c*i)),b(t,e,r),t},fromRotation:g,fromRotationTranslation:b,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,p=i*c,f=i*l,d=o*c,y=o*l,v=a*l,g=s*u,m=s*c,x=s*l,E=r[0],b=r[1],M=r[2];return t[0]=(1-(d+v))*E,t[1]=(p+x)*E,t[2]=(f-m)*E,t[3]=0,t[4]=(p-x)*b,t[5]=(1-(h+v))*b,t[6]=(y+g)*b,t[7]=0,t[8]=(f+m)*M,t[9]=(y-g)*M,t[10]=(1-(h+d))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:P,fromScaling:v,fromTranslation:y,fromValues:function(t,e,r,i,o,a,s,u,c,l,h,p,f,d,y,v){var g=new n(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=i,g[4]=o,g[5]=a,g[6]=s,g[7]=u,g[8]=c,g[9]=l,g[10]=h,g[11]=p,g[12]=f,g[13]=d,g[14]=y,g[15]=v,g},fromXRotation:m,fromYRotation:x,fromZRotation:E,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},getRotation:T,getScaling:S,getTranslation:M,identity:s,invert:c,lookAt:O,mul:L,multiply:h,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},ortho:k,orthoNO:C,orthoZO:A,perspective:N,perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},perspectiveNO:N,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},rotate:function(t,n,r,i){var o,a,s,u,c,l,h,p,f,d,y,v,g,m,x,E,b,M,S,T,P,w,N,C,k=i[0],A=i[1],O=i[2],R=Math.hypot(k,A,O);return e>R?null:(k*=R=1/R,A*=R,O*=R,o=Math.sin(r),c=n[1],l=n[2],h=n[3],f=n[5],d=n[6],y=n[7],g=n[9],m=n[10],x=n[11],S=k*A*(s=1-(a=Math.cos(r)))-O*o,T=A*A*s+a,P=O*A*s+k*o,w=k*O*s+A*o,N=A*O*s-k*o,C=O*O*s+a,t[0]=(u=n[0])*(E=k*k*s+a)+(p=n[4])*(b=A*k*s+O*o)+(v=n[8])*(M=O*k*s-A*o),t[1]=c*E+f*b+g*M,t[2]=l*E+d*b+m*M,t[3]=h*E+y*b+x*M,t[4]=u*S+p*T+v*P,t[5]=c*S+f*T+g*P,t[6]=l*S+d*T+m*P,t[7]=h*S+y*T+x*P,t[8]=u*w+p*N+v*C,t[9]=c*w+f*N+g*C,t[10]=l*w+d*N+m*C,t[11]=h*w+y*N+x*C,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)},rotateX:f,rotateY:d,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],p=e[7];return 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]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t},scale:function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},set:a,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:R,subtract:R,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],p=a-n[2],f=l*l+h*h+p*p;f>0&&(l*=f=1/Math.sqrt(f),h*=f,p*=f);var d=u*p-c*h,y=c*l-s*p,v=s*h-u*l;return(f=d*d+y*y+v*v)>0&&(d*=f=1/Math.sqrt(f),y*=f,v*=f),t[0]=d,t[1]=y,t[2]=v,t[3]=0,t[4]=h*v-p*y,t[5]=p*d-l*v,t[6]=l*y-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},translate:p,transpose:u});function D(){var t=new n(3);return n!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function G(t){return Math.hypot(t[0],t[1],t[2])}function _(t,e,r){var i=new n(3);return i[0]=t,i[1]=e,i[2]=r,i}function U(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function F(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function B(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function V(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function j(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Y(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function H(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function X(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function W(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}var z=V,q=G;function Z(){var t=new n(4);return n!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $(t,e,r,i){var o=new n(4);return o[0]=t,o[1]=e,o[2]=r,o[3]=i,o}function K(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function Q(){var t=new n(4);return n!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function J(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function tt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function et(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function nt(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(e*=i),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}D(),function(){var t=Z()}();var rt=$,it=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ot=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},at=tt,st=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};function ut(){var t=new n(2);return n!=Float32Array&&(t[0]=0,t[1]=0),t}D(),_(1,0,0),_(0,1,0),Q(),Q(),r(),function(){var t=ut()}(),n=Array;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var ct={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(o,Math.floor(r+(s-u)*l/s+h)),a)}var p=t[r],f=i,d=o;for(n(t,i,r),a(t[o],p)>0&&n(t,i,o);d>f;){for(n(t,f,d),f++,d--;0>a(t[f],p);)f++;for(;a(t[d],p)>0;)d--}0===a(t[i],p)?n(t,i,d):n(t,++d,o),d>r||(i=d+1),r>d||(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;n>o;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function v(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,n,r,i,o){for(var a=[n,r];a.length;)if((r=a.pop())-(n=a.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;e.children.length>o;o++){var a=e.children[o],s=e.leaf?r(a):a;v(t,s)&&(e.leaf?n.push(a):y(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(v(t,o)){if(e.leaf||y(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=g([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=c.pop(),i=!0),a.leaf){var l=o(t,a.children,e);if(-1!==l)return a.children.splice(l,1),u.push(a),this._condense(u),this}i||a.leaf||!y(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(s>=o)return a(i=g(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(o/Math.pow(s,(r=Math.ceil(Math.log(o)/Math.log(s)))-1))),(i=g([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),c=u*Math.ceil(Math.sqrt(s));m(t,e,n,c,this.compareMinX);for(var l=e;n>=l;l+=c){var h=Math.min(l+c-1,n);m(t,l,h,u,this.compareMinY);for(var p=l;h>=p;p+=u)i.children.push(this._build(t,p,Math.min(p+u-1,h),r-1))}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;e.children.length>s;s++){var u=e.children[s],c=h(u),l=f(t,u)-c;o>l?(o=l,i=i>c?c:i,a=u):l===o&&i>c&&(i=c,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=g(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;n-e>=a;a++){var u=s(t,0,a,this.toBBox),c=s(t,a,n,this.toBBox),l=d(u,c),p=h(u)+h(c);i>l?(i=l,r=a,o=o>p?p:o):l===i&&o>p&&(o=p,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),c=p(o)+p(a),l=e;n-e>l;l++){var h=t.children[l];u(o,t.leaf?i(h):h),c+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];u(a,t.leaf?i(d):d),c+=p(a)}return c},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()}(ct);var lt=ct.exports,ht=function(t,e){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ht(t,e)};function pt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function n(){this.constructor=t}ht(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ft,dt,yt=function(){return yt=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},yt.apply(this,arguments)};function vt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);r.length>i;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function gt(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function mt(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&i[3]>s[1])){a.label=s[1];break}if(6===s[0]&&i[1]>a.label){a.label=i[1],i=s;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function xt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Et(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function bt(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;o>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError,t.Shape=void 0,(ft=t.Shape||(t.Shape={})).GROUP="g",ft.CIRCLE="circle",ft.ELLIPSE="ellipse",ft.IMAGE="image",ft.RECT="rect",ft.LINE="line",ft.POLYLINE="polyline",ft.POLYGON="polygon",ft.TEXT="text",ft.PATH="path",ft.HTML="html",ft.MESH="mesh",t.ClipSpaceNearZ=void 0,(dt=t.ClipSpaceNearZ||(t.ClipSpaceNearZ={}))[dt.ZERO=0]="ZERO",dt[dt.NEGATIVE_ONE=1]="NEGATIVE_ONE";var Mt=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),St=function(){function e(e){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.plugins=[],this.config=yt({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableSizeAttenuation:!0,imageSmoothingEnabled:!0,imageSmoothingQuality:"high"},e)}return e.prototype.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.prototype.getPlugins=function(){return this.plugins},e.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(t){Object.assign(this.config,t)},e}(),Tt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(p=1,u=Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(Tt);var Pt,wt=Tt.exports,Nt=B,Ct=U,kt=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},At=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Ot=j,Rt=z,Lt=function(){function t(){this.center=D(),this.halfExtents=D(),this.min=D(),this.max=D()}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){Ct(this.center,t),Ct(this.halfExtents,e),Rt(this.min,this.center,this.halfExtents),Nt(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Nt(this.center,e,t),Ot(this.center,this.center,.5),Rt(this.halfExtents,e,t),Ot(this.halfExtents,this.halfExtents,.5),Ct(this.min,t),Ct(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,p=i-u,f=i+u,d=o-c,y=o+c,v=e.center,g=v[0],m=v[1],x=v[2],E=e.halfExtents,b=E[0],M=E[1],S=E[2],T=g-b,P=g+b,w=m-M,N=m+M,C=x-S,k=x+S;l>T&&(l=T),P>h&&(h=P),p>w&&(p=w),N>f&&(f=N),d>C&&(d=C),k>y&&(y=k),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(c),x=Math.abs(l),E=Math.abs(h),b=Math.abs(p),M=Math.abs(f),S=Math.abs(d);n[0]=e[12]+a*i[0]+s*i[1]+u*i[2],n[1]=e[13]+c*i[0]+l*i[1]+h*i[2],n[2]=e[14]+p*i[0]+f*i[1]+d*i[2],r[0]=y*o[0]+v*o[1]+g*o[2],r[1]=m*o[0]+x*o[1]+E*o[2],r[2]=b*o[0]+M*o[1]+S*o[2],Rt(this.min,n,r),Nt(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=kt([0,0,0],this.getMin(),e.getMin()),i=At([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Ct([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Ct([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),It=function(){function t(t,e){this.distance=t||0,this.normal=e||_(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return H(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/q(this.normal);j(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&function(t,e,n,r){var i=e[0],o=e[1],a=e[2];t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a)}(n,t,e,i),o},t}();t.Mask=void 0,(Pt=t.Mask||(t.Mask={}))[Pt.OUTSIDE=4294967295]="OUTSIDE",Pt[Pt.INSIDE=0]="INSIDE",Pt[Pt.INDETERMINATE=2147483647]="INDETERMINATE";var Dt=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new It)}return t.prototype.extractFromVPMatrix=function(t){var e=Et(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15];F(this.planes[0].normal,o-n,c-a,f-l),this.planes[0].distance=g-d,F(this.planes[1].normal,o+n,c+a,f+l),this.planes[1].distance=g+d,F(this.planes[2].normal,o+r,c+s,f+h),this.planes[2].distance=g+y,F(this.planes[3].normal,o-r,c-s,f-h),this.planes[3].distance=g-y,F(this.planes[4].normal,o-i,c-u,f-p),this.planes[4].distance=g-v,F(this.planes[5].normal,o+i,c+u,f+p),this.planes[5].distance=g+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Gt=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),_t=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.applyTransform=function(e,n){var r=$(e.x,e.y,0,1),i=$(e.x+e.width,e.y,0,1),o=$(e.x,e.y+e.height,0,1),a=$(e.x+e.width,e.y+e.height,0,1),s=Z(),u=Z(),c=Z(),l=Z();K(s,r,n),K(u,i,n),K(c,o,n),K(l,a,n);var h=Math.min(s[0],u[0],c[0],l[0]),p=Math.min(s[1],u[1],c[1],l[1]);return t.fromRect({x:h,y:p,width:Math.max(s[0],u[0],c[0],l[0])-h,height:Math.max(s[1],u[1],c[1],l[1])-p})},t.prototype.toJSON=function(){},t}(),Ut="Method not implemented.",Ft="Use document.documentElement instead.";function Bt(t){return"function"==typeof t}function Vt(t){return null==t}function jt(t){return Array.isArray(t)}var Yt={}.toString,Ht=function(t,e){return Yt.call(t)==="[object "+e+"]"};function Xt(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;e>r;r++)n=Math.max(n,t[r]);return n}var Wt=function(t){if(jt(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])};function zt(t){return"string"==typeof t}var qt=function(t,e,n){return e>t?e:t>n?n:t};function Zt(t){return"number"==typeof t}var $t=1e-5;function Kt(t,e,n){return void 0===n&&(n=$t),t===e||n>Math.abs(t-e)}var Qt=function(t,e){return(t%e+e)%e},Jt=function(t){return Ht(t,"Boolean")},te=function(t){return void 0===t},ee={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function ne(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var re={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ie(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return re[e]===t.length-1&&"achlmqstvz".includes(e)}))}function oe(t){return ie(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ae(t){return oe(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function se(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=re[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,re[n]))),re[n]););}function ue(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function ce(t){return t>=48&&57>=t||43===t||45===t||46===t}function le(t){return t>=48&&57>=t}function he(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),le(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&le(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;n>o&&le(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;le(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid float exponent'));if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!le(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid integer exponent'));for(;n>o&&le(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" is not a number');else t.err="[path-util]: Invalid path value at index ".concat(o,', "pathValue" is missing param')}function pe(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function fe(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=re[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,pe(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?he(t):ue(t),t.err.length)return;t.data.push(t.param),pe(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,pe(t))}if(t.index>=t.max)break;if(!ce(n.charCodeAt(t.index)))break}se(t)}else se(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var de=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function ye(t){if(oe(t))return[].concat(t);var e=function(t){if(ie(t))return[].concat(t);var e=new de(t);for(pe(e);e.max>e.index&&!e.err.length;)fe(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function ve(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].concat(s)}else if("T"===n){var h=2*r-e.qx,p=2*i-e.qy;e.qx=h,e.qy=p,u=["Q",h,p].concat(s)}else if("Q"===n){var f=s[1];e.qx=s[0],e.qy=f}return u}function ge(t){if(ae(t))return[].concat(t);for(var e=ye(t),n=yt({},ee),r=0;e.length>r;r+=1){e[r]=ve(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function me(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function xe(t,e,n,r,i,o,a,s,u,c){var l,h,p,f,d,y=t,v=e,g=n,m=r,x=s,E=u,b=120*Math.PI/180,M=Math.PI/180*(+i||0),S=[];if(c)h=c[0],p=c[1],f=c[2],d=c[3];else{v=(l=me(y,v,-M)).y;var T=((y=l.x)-(x=(l=me(x,E,-M)).x))/2,P=(v-(E=l.y))/2,w=T*T/(g*g)+P*P/(m*m);w>1&&(g*=w=Math.sqrt(w),m*=w);var N=g*g,C=m*m,k=(o===a?-1:1)*Math.sqrt(Math.abs((N*C-N*P*P-C*T*T)/(N*P*P+C*T*T)));f=k*g*P/m+(y+x)/2,h=Math.asin(((v-(d=k*-m*T/g+(v+E)/2))/m*1e9>>0)/1e9),p=Math.asin(((E-d)/m*1e9>>0)/1e9),0>(h=f>y?Math.PI-h:h)&&(h=2*Math.PI+h),0>(p=f>x?Math.PI-p:p)&&(p=2*Math.PI+p),a&&h>p&&(h-=2*Math.PI),!a&&p>h&&(p-=2*Math.PI)}var A=p-h;if(Math.abs(A)>b){var O=p,R=x,L=E;S=xe(x=f+g*Math.cos(p=h+b*(a&&p>h?1:-1)),E=d+m*Math.sin(p),g,m,i,0,a,R,L,[p,O,f,d])}A=p-h;var I=Math.cos(h),D=Math.sin(h),G=Math.cos(p),_=Math.sin(p),U=Math.tan(A/4),F=4/3*g*U,B=4/3*m*U,V=[y,v],j=[y+F*D,v-B*I],Y=[x+F*_,E-B*G],H=[x,E];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],c)return j.concat(Y,H,S);for(var X=[],W=0,z=(S=j.concat(Y,H,S)).length;z>W;W+=1)X[W]=W%2?me(S[W-1],S[W],M).y:me(S[W],S[W+1],M).x;return X}function Ee(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var be=function(t,e,n,r){return bt(bt([],Ee([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Me(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],p=l[1],f=e.x1,d=e.y1,y=e.x,v=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=p,t;case"A":return n=[f,d].concat(l),["C"].concat(xe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=p,n=[f,d].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(be(f,d,h,p));case"Z":return f===y&&d===v?["C",f,d,y,v,y,v]:["C"].concat(be(f,d,y,v))}return t}function Se(t,e){if(void 0===e&&(e=!1),function(t){return ae(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=ge(t),a=yt({},ee),s=[],u="",c=o.length,l=[],h=0;c>h;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var p=Me(o[h],a);o[h]=p,ne(o,s,h),c=o.length,"Z"===u&&l.push(h),a.x1=+(r=o[h])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,l]:o}function Te(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Pe(t,e,n,r,i){var o=Te([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=Ee([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function we(t,e){var n=t.x,r=t.y,i=e.x,o=e.y;return(0>n*o-r*i?-1:1)*Math.acos((n*i+r*o)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))))}function Ne(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,p=Math.cos,f=Math.sqrt,d=Math.PI,y=l(n),v=l(r),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return Pe(t,e,s,u,c).point;var m=(t-s)/2,x=(e-u)/2,E={x:p(g)*m+h(g)*x,y:-h(g)*m+p(g)*x},b=Math.pow(E.x,2)/Math.pow(y,2)+Math.pow(E.y,2)/Math.pow(v,2);b>1&&(y*=f(b),v*=f(b));var M=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(E.y,2)-Math.pow(v,2)*Math.pow(E.x,2))/(Math.pow(y,2)*Math.pow(E.y,2)+Math.pow(v,2)*Math.pow(E.x,2)),S=(o!==a?1:-1)*f(M=0>M?0:M),T=S*(y*E.y/v),P=S*(-v*E.x/y),w=p(g)*T-h(g)*P+(t+s)/2,N=h(g)*T+p(g)*P+(e+u)/2,C={x:(E.x-T)/y,y:(E.y-P)/v},k=we({x:1,y:0},C),A=we(C,{x:(-E.x-T)/y,y:(-E.y-P)/v});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var O=k+(A%=2*d)*c,R=y*p(O),L=v*h(O);return{x:p(g)*R-h(g)*L+w,y:h(g)*R+p(g)*L+N}}function Ce(t,e,n,r,i,o,a,s,u,c,l){var h,p=l.bbox,f=void 0===p||p,d=l.length,y=void 0===d||d,v=l.sampleSize,g=void 0===v?30:v,m="number"==typeof c,x=t,E=e,b=0,M=[x,E,b],S=[x,E],T={x:0,y:0},P=[{x:x,y:E}];m&&0>=c&&(T={x:x,y:E});for(var w=0;g>=w;w+=1){if(x=(h=Ne(t,e,n,r,i,o,a,s,u,w/g)).x,E=h.y,f&&P.push({x:x,y:E}),y&&(b+=Te(S,[x,E])),S=[x,E],m&&b>=c&&c>M[2]){var N=(b-c)/(b-M[2]);T={x:S[0]*(1-N)+M[0]*N,y:S[1]*(1-N)+M[1]*N}}M=[x,E,b]}return m&&c>=b&&(T={x:s,y:u}),{length:b,point:T,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function ke(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function Ae(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,p=void 0===h||h,f=c.length,d=void 0===f||f,y=c.sampleSize,v=void 0===y?10:y,g="number"==typeof u,m=t,x=e,E=0,b=[m,x,E],M=[m,x],S={x:0,y:0},T=[{x:m,y:x}];g&&0>=u&&(S={x:m,y:x});for(var P=0;v>=P;P+=1){if(m=(l=ke(t,e,n,r,i,o,a,s,P/v)).x,x=l.y,p&&T.push({x:m,y:x}),d&&(E+=Te(M,[m,x])),M=[m,x],g&&E>=u&&u>b[2]){var w=(E-u)/(E-b[2]);S={x:M[0]*(1-w)+b[0]*w,y:M[1]*(1-w)+b[1]*w}}b=[m,x,E]}return g&&u>=E&&(S={x:a,y:s}),{length:E,point:S,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,T.map((function(t){return t.x}))),y:Math.max.apply(null,T.map((function(t){return t.y})))}}}function Oe(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Re(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,p=void 0===h||h,f=s.sampleSize,d=void 0===f?10:f,y="number"==typeof a,v=t,g=e,m=0,x=[v,g,m],E=[v,g],b={x:0,y:0},M=[{x:v,y:g}];y&&0>=a&&(b={x:v,y:g});for(var S=0;d>=S;S+=1){if(v=(u=Oe(t,e,n,r,i,o,S/d)).x,g=u.y,l&&M.push({x:v,y:g}),p&&(m+=Te(E,[v,g])),E=[v,g],y&&m>=a&&a>x[2]){var T=(m-a)/(m-x[2]);b={x:E[0]*(1-T)+x[0]*T,y:E[1]*(1-T)+x[1]*T}}x=[v,g,m]}return y&&a>=m&&(b={x:i,y:o}),{length:m,point:b,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function Le(t,e,n){for(var r,i,o,a,s,u,c,l,h,p=ge(t),f="number"==typeof e,d=[],y=0,v=0,g=0,m=0,x=[],E=[],b=0,M={x:0,y:0},S=M,T=M,P=M,w=0,N=0,C=p.length;C>N;N+=1)d=(c="M"===(l=(h=p[N])[0]))?d:[y,v].concat(h.slice(1)),c?(S=M={x:g=h[1],y:m=h[2]},b=0,f&&.001>e&&(P=M)):"L"===l?(b=(r=Pe(d[0],d[1],d[2],d[3],(e||0)-w)).length,M=r.min,S=r.max,T=r.point):"A"===l?(b=(i=Ce(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-w,n||{})).length,M=i.min,S=i.max,T=i.point):"C"===l?(b=(o=Ae(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-w,n||{})).length,M=o.min,S=o.max,T=o.point):"Q"===l?(b=(a=Re(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-w,n||{})).length,M=a.min,S=a.max,T=a.point):"Z"===l&&(b=(s=Pe((d=[y,v,g,m])[0],d[1],d[2],d[3],(e||0)-w)).length,M=s.min,S=s.max,T=s.point),f&&e>w&&w+b>=e&&(P=T),E.push(S),x.push(M),w+=b,y=(u="Z"!==l?h.slice(-2):[g,m])[0],v=u[1];return f&&e>=w&&(P={x:y,y:v}),{length:w,point:P,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function Ie(t){return function(t){var e=0,n=0,r=0;return Se(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,p,f=t.slice(1);return r=3*(((p=f[5])-(a=n))*((s=f[0])+(c=f[2]))-((h=f[4])-(o=e))*((u=f[1])+(l=f[3]))+u*(o-c)-s*(a-l)+p*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function De(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Ae(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Ee(n,r,e),s=Ee(r,i,e),u=Ee(i,o,e),c=Ee(a,s,e),l=Ee(s,u,e),h=Ee(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Ge(t,e,n){var r=De(t),i=De(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:Ge(y[0],y[1],h)}function _e(t){return void 0===t?0:t>360||-360>t?t%360:t}var Ue=D();function Fe(t,e,r,i){return void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=!0),Array.isArray(t)&&3===t.length?i?(o=t,(a=new n(3))[0]=o[0],a[1]=o[1],a[2]=o[2],a):U(Ue,t):Zt(t)?i?_(t,e,r):F(Ue,t,e,r):i?_(t[0],t[1]||e,t[2]||r):F(Ue,t[0],t[1]||e,t[2]||r);var o,a}var Be=Math.PI/180;function Ve(t){return t*Be}var je=180/Math.PI;function Ye(t){return t*je}function He(t){return 360*t}var Xe=Math.PI/2;function We(t,e){return 16===e.length?function(t,e){var n,r,i=Et(S(D(),e),3),o=i[0],a=i[1],s=i[2],u=Math.asin(-e[2]/o);return Xe>u?u>-Xe?(n=Math.atan2(e[6]/a,e[10]/s),r=Math.atan2(e[1]/o,e[0]/o)):(r=0,n=-Math.atan2(e[4]/a,e[5]/a)):(r=0,n=Math.atan2(e[4]/a,e[5]/a)),t[0]=n,t[1]=u,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Xe,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Xe,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function ze(t,e,r,i,o){var a,s,u,c,l,h,p,f,d,y,v=Math.cos(t),g=Math.sin(t);return a=i*v,s=o*g,u=0,c=-i*g,l=o*v,h=0,p=e,f=r,d=1,(y=new n(9))[0]=a,y[1]=s,y[2]=u,y[3]=c,y[4]=l,y[5]=h,y[6]=p,y[7]=f,y[8]=d,y}function qe(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?o=-o:a=-a),o){var s=1/o;e*=s,n*=s}if(a){var u=1/a;r*=u,i*=u}var c=Ye(Math.atan2(n,e));return[t[6],t[7],o,a,c]}var Ze,$e,Ke,Qe=i(),Je=i(),tn=Z(),en=[D(),D(),D()],nn=D();function rn(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}t.CameraType=void 0,(Ze=t.CameraType||(t.CameraType={}))[Ze.ORBITING=0]="ORBITING",Ze[Ze.EXPLORING=1]="EXPLORING",Ze[Ze.TRACKING=2]="TRACKING",t.CameraTrackingMode=void 0,($e=t.CameraTrackingMode||(t.CameraTrackingMode={}))[$e.DEFAULT=0]="DEFAULT",$e[$e.ROTATIONAL=1]="ROTATIONAL",$e[$e.TRANSLATIONAL=2]="TRANSLATIONAL",$e[$e.CINEMATIC=3]="CINEMATIC",t.CameraProjectionMode=void 0,(Ke=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Ke.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Ke[Ke.PERSPECTIVE=1]="PERSPECTIVE";var on,an,sn,un,cn,ln={UPDATED:"updated"},hn=2e-4,pn=function(){function e(){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.eventEmitter=new wt,this.matrix=i(),this.right=_(1,0,0),this.up=_(0,1,0),this.forward=_(0,0,1),this.position=_(0,0,1),this.focalPoint=_(0,0,0),this.distanceVector=_(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=i(),this.projectionMatrixInverse=i(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new Dt,this.orthoMatrix=i()}return e.prototype.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getDollyingStep=function(){return this.dollyingStep},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.getView=function(){return this.view},e.prototype.setEnableUpdate=function(t){this.enableUpdate=t},e.prototype.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},e.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.prototype.getViewTransform=function(){return c(i(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,e){var n=y(i(),[t,e,0]);this.jitteredProjectionMatrix=h(i(),n,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setProjectionMatrix=function(t){this.projectionMatrix=t},e.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},e.prototype.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},e.prototype.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=_(a.x-r,a.y-i,0),u=H(s,this.right)/G(this.right),c=H(s,this.up)/G(this.up),l=Et(this.getPosition(),2),h=l[0],p=l[1],f=Et(this.getFocalPoint(),2),d=f[0],y=f[1];return this.setPosition(h-u,p-c),this.setFocalPoint(d-u,y-c),this},e.prototype.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(Ve(.5*this.fov))/this.zoom,s=2*a,u=this.aspect*s,l=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var h=this.view.fullWidth,p=this.view.fullHeight;l+=this.view.offsetX*u/h,a-=this.view.offsetY*s/p,u*=this.view.width/h,s*=this.view.height/p}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var u,c,l=2*o,h=n-e,p=r-i,f=l/p,d=(n+e)/h,y=(r+i)/p,v=a-o,g=a*o;s?(u=-a/v,c=-g/v):(u=-(a+o)/v,c=-2*g/v),t[0]=l/h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=y,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,l,l+u,a-s,a,e,this.far,this.clipSpaceNearZ===t.ClipSpaceNearZ.ZERO),c(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.prototype.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),h=(this.rright+this.left)/2,p=(this.top+this.bottom)/2,f=h-u,d=h+u,y=p+l,v=p-l;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=g*this.view.offsetX)+g*this.view.width,v=(y-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===t.ClipSpaceNearZ.NEGATIVE_ONE?k(this.projectionMatrix,f,d,y,v,o,a):A(this.projectionMatrix,f,d,y,v,o,a),c(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=Fe(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.prototype.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var o=_(0,1,0);if(this.focalPoint=Fe(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var a=V(D(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var s=G(a),u=Ye(Math.asin(n/s)),l=90+Ye(Math.atan2(r,e)),h=i();d(h,h,Ve(l)),f(h,h,Ve(u)),o=W(D(),[0,1,0],h)}return c(this.matrix,O(i(),this.position,this.focalPoint,o)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.prototype.getDistance=function(){return this.distance},e.prototype.getDistanceVector=function(){return this.distanceVector},e.prototype.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,hn>this.distance&&(this.distance=hn),this.dollyingStep=this.distance/100;var e=D(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},e.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},e.prototype.setMinDistance=function(t){return this.minDistance=t,this},e.prototype.setAzimuth=function(e){return this.azimuth=_e(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getAzimuth=function(){return this.azimuth},e.prototype.setElevation=function(e){return this.elevation=_e(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getElevation=function(){return this.elevation},e.prototype.setRoll=function(e){return this.roll=_e(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getRoll=function(){return this.roll},e.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.prototype.computeMatrix=function(){var e=J(Q(),[0,0,1],Ve(this.roll));s(this.matrix);var n=J(Q(),[1,0,0],Ve((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=J(Q(),[0,1,0],Ve((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),o=tt(Q(),r,n);o=tt(Q(),o,e);var a=w(i(),o);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(p(this.matrix,this.matrix,this.focalPoint),h(this.matrix,this.matrix,a),p(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(p(this.matrix,this.matrix,this.position),h(this.matrix,this.matrix,a))},e.prototype._setPosition=function(t,e,n){this.position=Fe(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},e.prototype._getAxes=function(){U(this.right,Fe(K(Z(),[1,0,0,0],this.matrix))),U(this.up,Fe(K(Z(),[0,1,0,0],this.matrix))),U(this.forward,Fe(K(Z(),[0,0,1,0],this.matrix))),Y(this.right,this.right),Y(this.up,this.up),Y(this.forward,this.forward)},e.prototype._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=G(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Ye(Math.asin(n/i)),this.azimuth=Ye(Math.atan2(-e,-r))):(this.elevation=-Ye(Math.asin(n/i)),this.azimuth=-Ye(Math.atan2(-e,-r)))},e.prototype._getPosition=function(){U(this.position,Fe(K(Z(),[0,0,0,1],this.matrix))),this._getDistance()},e.prototype._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=r(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),B(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=V(D(),this.focalPoint,this.position),this.distance=G(this.distanceVector),this.dollyingStep=this.distance/100},e.prototype._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=J(Q(),[0,0,1],-this.roll*Math.PI/180);P(this.orthoMatrix,n,_((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),_(this.zoom,this.zoom,1),e)}},e.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=h(i(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(ln.UPDATED)}},e.prototype.rotate=function(t,e,n){throw Error(Ut)},e.prototype.pan=function(t,e){throw Error(Ut)},e.prototype.dolly=function(t){throw Error(Ut)},e.prototype.createLandmark=function(t,e){throw Error(Ut)},e.prototype.gotoLandmark=function(t,e){throw Error(Ut)},e.prototype.cancelLandmarkAnimation=function(){throw Error(Ut)},e}();function fn(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(fn.Cache||Map),n}fn.Cache=Map,t.UnitType=void 0,(on=t.UnitType||(t.UnitType={}))[on.kUnknown=0]="kUnknown",on[on.kNumber=1]="kNumber",on[on.kPercentage=2]="kPercentage",on[on.kEms=3]="kEms",on[on.kPixels=4]="kPixels",on[on.kRems=5]="kRems",on[on.kDegrees=6]="kDegrees",on[on.kRadians=7]="kRadians",on[on.kGradians=8]="kGradians",on[on.kTurns=9]="kTurns",on[on.kMilliseconds=10]="kMilliseconds",on[on.kSeconds=11]="kSeconds",on[on.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(an||(an={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(sn||(sn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(un||(un={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(cn||(cn={}));var dn,yn=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(dn||(dn={}));var vn,gn=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return yn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},mn=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},xn=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},En=function(){function e(){}return e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds},e.prototype.toString=function(){return this.buildCSSText(un.kNo,cn.kNo,"")},e.prototype.isNumericValue=function(){return this.getType()>=dn.kUnitType&&this.getType()<=dn.kClampType},e}(),bn=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return pt(e,t),e.prototype.getType=function(){return dn.kColorType},e.prototype.to=function(t){return this},e}(En);t.GradientType=void 0,(vn=t.GradientType||(t.GradientType={}))[vn.Constant=0]="Constant",vn[vn.LinearGradient=1]="LinearGradient",vn[vn.RadialGradient=2]="RadialGradient";var Mn=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return pt(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return dn.kColorType},e}(En),Sn=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return pt(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return dn.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(En),Tn=/-([a-z])/g,Pn=fn((function(t){return void 0===t&&(t=""),t.replace(Tn,(function(t){return t[1].toUpperCase()}))})),wn=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};var Nn={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Cn=fn((function(t){var e=Pn(t),n=Nn[e];return e=(null==n?void 0:n.alias)||e}));var kn,An,On=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Rn=function(e){return function(e){switch(e){case an.kUNumber:return t.UnitType.kNumber;case an.kULength:return t.UnitType.kPixels;case an.kUPercent:return t.UnitType.kPercentage;case an.kUTime:return t.UnitType.kSeconds;case an.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return an.kUNumber;case t.UnitType.kPercentage:return an.kUPercent;case t.UnitType.kPixels:return an.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return an.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return an.kUAngle;default:return an.kUOther}}(e))},Ln=function(e){function n(n,r){void 0===r&&(r=t.UnitType.kNumber);var i,o=e.call(this)||this;return i="string"==typeof r?gn(r):r,o.unit=i,o.value=n,o}return pt(n,e),n.prototype.clone=function(){return new n(this.value,this.unit)},n.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},n.prototype.getType=function(){return dn.kUnitType},n.prototype.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=Rn(this.unit);if(r!==Rn(e)||r===t.UnitType.kUnknown)return null;var i=mn(this.unit)/mn(e);return new n(this.value*i,e)},n.prototype.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=xn(this.unit);if(-999999>o||o>999999){var s=xn(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?On(o,s):o+(s||"")}else i="".concat(o).concat(a)}return r+=i},n}(En),In=new Ln(0,"px"),Dn=new Ln(0,"deg"),Gn=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return pt(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(bn),_n=new Sn("unset"),Un=new Sn("initial"),Fn=new Sn("inherit"),Bn={"":_n,unset:_n,initial:Un,inherit:Fn},Vn=function(t){return Bn[t]||(Bn[t]=new Sn(t)),Bn[t]},jn=new Gn(0,0,0,0,!0),Yn=new Gn(0,0,0,0),Hn=fn((function(t,e,n,r){return new Gn(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Xn=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Ln(e,n)};new Ln(50,"%"),t.Strategy=void 0,(kn=t.Strategy||(t.Strategy={}))[kn.Standard=0]="Standard",t.SortReason=void 0,(An=t.SortReason||(t.SortReason={}))[An.ADDED=0]="ADDED",An[An.REMOVED=1]="REMOVED",An[An.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED";var Wn,zn={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new _t(0,0,0,0)};function qn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Zn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function $n(){}t.PropertySyntax=void 0,(Wn=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",Wn.COLOR="<color>",Wn.PAINT="<paint>",Wn.NUMBER="<number>",Wn.ANGLE="<angle>",Wn.OPACITY_VALUE="<opacity-value>",Wn.SHADOW_BLUR="<shadow-blur>",Wn.LENGTH="<length>",Wn.PERCENTAGE="<percentage>",Wn.LENGTH_PERCENTAGE="<length> | <percentage>",Wn.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",Wn.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",Wn.LIST_OF_POINTS="<list-of-points>",Wn.PATH="<path>",Wn.FILTER="<filter>",Wn.Z_INDEX="<z-index>",Wn.OFFSET_DISTANCE="<offset-distance>",Wn.DEFINED_PATH="<defined-path>",Wn.MARKER="<marker>",Wn.TRANSFORM="<transform>",Wn.TRANSFORM_ORIGIN="<transform-origin>",Wn.TEXT="<text>",Wn.TEXT_TRANSFORM="<text-transform>";var Kn=.7,Qn=1/Kn,Jn="\\s*([+-]?\\d+)\\s*",tr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nr=/^#([0-9a-f]{3,8})$/,rr=RegExp(`^rgb\\(${Jn},${Jn},${Jn}\\)$`),ir=RegExp(`^rgb\\(${er},${er},${er}\\)$`),or=RegExp(`^rgba\\(${Jn},${Jn},${Jn},${tr}\\)$`),ar=RegExp(`^rgba\\(${er},${er},${er},${tr}\\)$`),sr=RegExp(`^hsl\\(${tr},${er},${er}\\)$`),ur=RegExp(`^hsla\\(${tr},${er},${er},${tr}\\)$`),cr={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 lr(){return this.rgb().formatHex()}function hr(){return this.rgb().formatRgb()}function pr(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=nr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fr(e):3===n?new yr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?dr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?dr(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=rr.exec(t))?new yr(e[1],e[2],e[3],1):(e=ir.exec(t))?new yr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=or.exec(t))?dr(e[1],e[2],e[3],e[4]):(e=ar.exec(t))?dr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=sr.exec(t))?br(e[1],e[2]/100,e[3]/100,1):(e=ur.exec(t))?br(e[1],e[2]/100,e[3]/100,e[4]):cr.hasOwnProperty(t)?fr(cr[t]):"transparent"===t?new yr(NaN,NaN,NaN,0):null}function fr(t){return new yr(t>>16&255,t>>8&255,255&t,1)}function dr(t,e,n,r){return r>0||(t=e=n=NaN),new yr(t,e,n,r)}function yr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function vr(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}`}function gr(){const t=mr(this.opacity);return`${1===t?"rgb(":"rgba("}${xr(this.r)}, ${xr(this.g)}, ${xr(this.b)}${1===t?")":`, ${t})`}`}function mr(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Er(t){return(16>(t=xr(t))?"0":"")+t.toString(16)}function br(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Sr(t,e,n,r)}function Mr(t){if(t instanceof Sr)return new Sr(t.h,t.s,t.l,t.opacity);if(t instanceof $n||(t=pr(t)),!t)return new Sr;if(t instanceof Sr)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Sr(a,s,u,t.opacity)}function Sr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Tr(t){return 0>(t=(t||0)%360)?t+360:t}function Pr(t){return Math.max(0,Math.min(1,t||0))}function wr(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function Nr(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}qn($n,pr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:lr,formatHex:lr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Mr(this).formatHsl()},formatRgb:hr,toString:hr}),qn(yr,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof $n||(i=pr(i)),i?new yr((i=i.rgb()).r,i.g,i.b,i.opacity):new yr):new yr(t,e,n,null==r?1:r);var i}),Zn($n,{brighter(t){return new yr(this.r*(t=null==t?Qn:Math.pow(Qn,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new yr(this.r*(t=null==t?Kn:Math.pow(Kn,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new yr(xr(this.r),xr(this.g),xr(this.b),mr(this.opacity))},displayable(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:vr,formatHex:vr,formatHex8:function(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}${Er(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gr,toString:gr})),qn(Sr,(function(t,e,n,r){return 1===arguments.length?Mr(t):new Sr(t,e,n,null==r?1:r)}),Zn($n,{brighter(t){return new Sr(this.h,this.s,this.l*(t=null==t?Qn:Math.pow(Qn,t)),this.opacity)},darker(t){return new Sr(this.h,this.s,this.l*(t=null==t?Kn:Math.pow(Kn,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new yr(wr(240>t?t+120:t-240,r,n),wr(t,r,n),wr(120>t?t+240:t-120,r,n),this.opacity)},clamp(){return new Sr(Tr(this.h),Pr(this.s),Pr(this.l),mr(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=mr(this.opacity);return`${1===t?"hsl(":"hsla("}${Tr(this.h)}, ${100*Pr(this.s)}%, ${100*Pr(this.l)}%${1===t?")":`, ${t})`}`}}));var Cr=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw Error(e+": "+t)}function r(){var t=f(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,u)||o("repeating-radial-gradient",t.repeatingRadialGradient,u)||o("conic-gradient",t.conicGradient,u)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:f(d)}}))}function a(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var o=r(i);return x(t.endCall)||n("Missing )"),o}}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function u(){var n,r,i=c();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=c())?n.push(i):e=r)),n}function c(){var t=function(){var t=m("shape",/^(circle)/i,0);t&&(t.style=g()||l());return t}()||function(){var t=m("shape",/^(ellipse)/i,0);t&&(t.style=v()||l());return t}();if(t)t.at=h();else{var e=l();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=p();r&&(t={type:"default-radial",at:r})}}return t}function l(){return m("extent-keyword",t.extentKeywords,1)}function h(){if(m("position",/^at/,0)){var t=p();return t||n("Missing positioning value"),t}}function p(){var t={x:v(),y:v()};if(t.x||t.y)return{type:"position",value:t}}function f(e){var r=e(),i=[];if(r)for(i.push(r);x(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function d(){var e=m("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:f(y)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:f(y)}}))||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=v(),e}function y(){return x(t.number)[1]}function v(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||g()}function g(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){var r=x(e);if(r)return{type:t,value:r[n]}}function x(t){var n=/^[\n\r\t\s]+/.exec(e);n&&E(n[0].length);var r=t.exec(e);return r&&E(r[0].length),r}function E(t){e=e.substring(t)}return function(t){return e=t,r()}}();var kr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ar=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Or=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Rr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Lr={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},Ir=fn((function(t){return Xn("angular"===t.type?Number(t.value):Lr[t.value]||0,"deg")})),Dr=fn((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Xn(e,r),cy:Xn(n,i)}})),Gr=fn((function(e){var n;if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Cr(e).map((function(e){var n=e.type,r=e.orientation,i=e.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;i>s;s++){var u=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!Vt(u)&&!Vt(a)){for(var c=1;s-o>c;c++)t[o+c].length={type:"%",value:"".concat(a+(Number(u)-a)*c/(s-o))};o=s,a=Number(u)}}}(i);var o=i.map((function(t){return{offset:Xn(Number(t.length.value),"%"),color:Nr(t)}}));if("linear-gradient"===n)return new Mn(t.GradientType.LinearGradient,{angle:r?Ir(r):Dn,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a=Dr(r[0].at),s=a.cx,u=a.cy,c=void 0;if(r[0].style){var l=r[0].style,h=l.type,p=l.value;c="extent-keyword"===h?Vn(p):Xn(p,h)}return new Mn(t.GradientType.RadialGradient,{cx:s,cy:u,size:c,steps:o})}}));var r=e[0];if("("===e[1]||"("===e[2])if("l"===r){var i=kr.exec(e);if(i){var o=(null===(n=i[2].match(Rr))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return[new Mn(t.GradientType.LinearGradient,{angle:Xn(parseFloat(i[1]),"deg"),steps:o.map((function(t){var e=Et(t,2),n=e[1];return{offset:Xn(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===r){var a=function(t){var e,n=Ar.exec(t);if(n){var r=(null===(e=n[4].match(Rr))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Xn(50,"%"),cy:Xn(50,"%"),steps:r.map((function(t){var e=Et(t,2),n=e[1];return{offset:Xn(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(a){if(!zt(a))return[new Mn(t.GradientType.RadialGradient,a)];e=a}}else if("p"===r)return function(t){var e=Or.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(e)}));function _r(t){return t&&!!t.image}function Ur(t){return t&&!Vt(t.r)&&!Vt(t.g)&&!Vt(t.b)}var Fr=fn((function(t){if(_r(t))return yt({repetition:"repeat"},t);if(Vt(t)&&(t=""),"transparent"===t)return Yn;if("currentColor"===t)t="black";else if("none"===t)return jn;var e=Gr(t);if(e)return e;var n=pr(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Hn.apply(void 0,bt([],Et(r),!1))}));function Br(t,e){if(Ur(t)&&Ur(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(qt(e[n],0,255));return e[3]=qt(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Vr(t,e){if(Vt(e))return Xn(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Xn(Number(e),"px");if("deg".search(t)>=0)return Xn(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return Xn(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var jr=function(t){return Vr(/px/g,t)},Yr=fn(jr);fn((function(t){return Vr(RegExp("%","g"),t)}));var Hr=function(t){return Zt(t)||isFinite(Number(t))?Xn(Number(t)||0,"px"):Vr(RegExp("px|%|em|rem","g"),t)},Xr=fn(Hr),Wr=function(t){return Vr(/deg|rad|grad|turn/g,t)},zr=fn(Wr);function qr(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=Rn(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=xn(t.unit)):(Ln.isLength(t.unit)||Ln.isLength(e.unit))&&(a=Qr(t,i,n),s=Qr(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Zr(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Ye(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=He(Number(e.value))),n}function $r(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):zt(t)?n=t.split(" ").map((function(t){return Number(t)})):Zt(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Kr(t){return zt(t)?t.split(" ").map((function(t){return Xr(t)})):t.map((function(t){return Xr(""+t)}))}function Qr(e,n,r,i){if(void 0===i&&(i=!1),e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var o=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds();return(i?o.min[n]:0)+e.value/100*o.halfExtents[n]*2}return 0}var Jr=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ti(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Jr.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Vr(/deg|rad|grad|turn|px|%/g,t)||Fr(t)}))}),n.lastIndex===t.length)return r}return[]}function ei(t){return""+t}var ni=function(t){return Xn("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},ri=fn(ni);function ii(t,e){return[t,e,ei]}function oi(t,e){return function(n,r){return[n,r,function(n){return ei(qt(n,t,e))}]}}function ai(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function si(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ui(t,e){var n=Math.min.apply(Math,bt([],Et(t),!1)),r=Math.min.apply(Math,bt([],Et(e),!1));return{x:n,y:r,width:Math.max.apply(Math,bt([],Et(t),!1))-n,height:Math.max.apply(Math,bt([],Et(e),!1))-r}}function ci(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function li(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function hi(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var p=s+h;a>o?p>o&&a>p&&l.push(p):p>a&&o>p&&l.push(p)}for(h=0;l.length>h;h++){var f=ci(t,0,n,r,i,l[h]);u>f&&(u=f),f>c&&(c=f)}var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,v=-1/0,g=[o,a];for(h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var m=d+h;a>o?m>o&&a>m&&g.push(m):m>a&&o>m&&g.push(m)}for(h=0;g.length>h;h++){var x=li(0,e,n,r,i,g[h]);y>x&&(y=x),x>v&&(v=x)}return{x:u,y:y,width:c-u,height:v-y}}function pi(t,e,n,r){return si(t,e,n,r)}function fi(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function di(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function yi(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(Kt(s,0))Kt(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;Kt(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function vi(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=yi(t,n,i,a),h=yi(e,r,o,s),p=0;l.length>p;p++)u.push(di(t,n,i,a,l[p]));for(p=0;h.length>p;p++)c.push(di(e,r,o,s,h[p]));return ui(u,c)}function gi(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=si(r[0],r[1],i[0],i[1])}return e}(t)}function mi(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function xi(t,e,n){var r=t+n-2*e;if(Kt(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Ei(t,e,n,r,i,o){var a=xi(t,n,i)[0],s=xi(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(mi(t,n,i,a)),void 0!==s&&c.push(mi(e,r,o,s)),ui(u,c)}function bi(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Le(t.parsedStyle.d.absolutePath,void 0,yt(yt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Mi(t,e){return t[0]===e[0]&&t[1]===e[1]}function Si(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((o+a-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(o)*Math.sqrt(a)));if(!s||0===Math.sin(s)||Kt(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),c=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(c-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function Ti(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}fn((function(t){return zt(t)?t.split(" ").map(ri):t.map(ri)}));var Pi=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},wi=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=Ve(r=Qt(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,l=(t.y-a.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},p=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);p>1&&(e*=Math.sqrt(p),n*=Math.sqrt(p));var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),d=(i!==o?1:-1)*Math.sqrt(f=0>f?0:f),y=d*(e*h.y/n),v=d*(-n*h.x/e),g={x:Math.cos(u)*y-Math.sin(u)*v+(t.x+a.x)/2,y:Math.sin(u)*y+Math.cos(u)*v+(t.y+a.y)/2},m={x:(h.x-y)/e,y:(h.y-v)/n},x=Pi({x:1,y:0},m),E=Pi(m,{x:(-h.x-y)/e,y:(-h.y-v)/n});!o&&E>0?E-=2*Math.PI:o&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*s,M=e*Math.cos(b),S=n*Math.sin(b);return{x:Math.cos(u)*M-Math.sin(u)*S+g.x,y:Math.sin(u)*M+Math.cos(u)*S+g.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function Ni(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,c=r.arcFlag,l=r.sweepFlag,h=wi({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=wi({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=p.x-h.x,d=p.y-h.y,y=Math.sqrt(f*f+d*d);return{x:-f/y,y:-d/y}}function Ci(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ki(t,e){return Ci(t)*Ci(e)?(t[0]*e[0]+t[1]*e[1])/(Ci(t)*Ci(e)):1}function Ai(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(ki(t,e))}function Oi(t,e){var n=e[1],r=e[2],i=Qt(Ve(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,p=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,f=h*h/(n*n)+p*p/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var d=n*n*(p*p)+r*r*(h*h),y=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=r?y*n*p/r:0,g=n?y*-r*h/n:0,m=(s+c)/2+Math.cos(i)*v-Math.sin(i)*g,x=(u+l)/2+Math.sin(i)*v+Math.cos(i)*g,E=[(h-v)/n,(p-g)/r],b=[(-1*h-v)/n,(-1*p-g)/r],M=Ai([1,0],E),S=Ai(E,b);return ki(E,b)>-1||(S=Math.PI),1>ki(E,b)||(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&0>S&&(S+=2*Math.PI),{cx:m,cy:x,rx:Mi(t,[c,l])?0:n,ry:Mi(t,[c,l])?0:r,startAngle:M,endAngle:M+S,xRotation:i,arcFlag:o,sweepFlag:a}}function Ri(t,e,n,r){var i=.5522847498307936,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var Li=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=ge(t)}catch(n){e=ge(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&Mi([r[1],r[2]],o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=Oi(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&Mi(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c)l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]];else if("T"===c){var d=Ti((v=e[s-1]).currentPoint,f);"Q"===v.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-y[0],g[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===c){var v,g=Ti((v=e[s-1]).currentPoint,f);y=[u[1],u[2]],"C"===v.command?(l.command="C",l.startTangent=[f[0]-g[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[f[0]-y[0],f[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var m=Ni(l,0),x=m.x,E=m.y,b=Ni(l,1,!1),M=b.x,S=b.y;l.startTangent=[x,E],l.endTangent=[M,S]}e.push(l)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=(y=t[o]).currentPoint,s=y.params,u=y.prePoint,c=void 0;switch(y.command){case"Q":c=Ei(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=vi(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var l=y.arcParams;c=hi(l.cx,l.cy,l.rx,l.ry,l.xRotation,l.startAngle,l.endAngle);break;default:n.push(a[0]),r.push(a[1])}c&&(y.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===y.command||"M"===y.command)&&y.prePoint&&y.nextPoint&&i.push(y)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var h=Wt(n),p=Wt(r),f=Xt(n),d=Xt(r);if(0===i.length)return{x:h,y:p,width:f-h,height:d-p};for(o=0;i.length>o;o++){var y;(a=(y=i[o]).currentPoint)[0]===h?h-=Si(y,e).xExtra:a[0]===f&&(f+=Si(y,e).xExtra),a[1]===p?p-=Si(y,e).yExtra:a[1]===d&&(d+=Si(y,e).yExtra)}return{x:h,y:p,width:f-h,height:d-p}}(a,0),u=s.x,c=s.y,l=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},Ii=fn(Li);function Di(t){return zt(t)?Ii(t):Li(t)}function Gi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Se(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Se(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=Ge(r,i));var a,s,u,c,l,h,p,f,d=Ie(o[0])!==Ie(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):o[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[d,(u=o[1],c=d,l=u.length-1,h=[],p=0,f=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),f.forEach((function(t,e){u.slice(1).forEach((function(t,n){p+=Te(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=p,p=0})),f[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function _i(t,e){return{points:zt(t)?t.split(" ").map((function(t){var e=Et(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t,totalLength:0,segments:[]}}function Ui(t,e){return[t.points,e.points,function(t){return t}]}var Fi=null,Bi=/\s*(\w+)\(([^)]*)\)/g;function Vi(t){return function(e){var n=0;return t.map((function(t){return t===Fi?e[n++]:t}))}}function ji(t){return t}var Yi={matrix:["NNNNNN",[Fi,Fi,0,0,Fi,Fi,0,0,0,0,1,0,Fi,Fi,0,1],ji],matrix3d:["NNNNNNNNNNNNNNNN",ji],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Vi([Fi,Fi,new Ln(1)]),ji],scaleX:["N",Vi([Fi,new Ln(1),new Ln(1)]),Vi([Fi,new Ln(1)])],scaleY:["N",Vi([new Ln(1),Fi,new Ln(1)]),Vi([new Ln(1),Fi])],scaleZ:["N",Vi([new Ln(1),new Ln(1),Fi])],scale3d:["NNN",ji],skew:["Aa",null,ji],skewX:["A",null,Vi([Fi,Dn])],skewY:["A",null,Vi([Dn,Fi])],translate:["Tt",Vi([Fi,Fi,In]),ji],translateX:["T",Vi([Fi,In,In]),Vi([Fi,In])],translateY:["T",Vi([In,Fi,In]),Vi([In,Fi])],translateZ:["L",Vi([In,In,Fi])],translate3d:["TTL",ji]};function Hi(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],o=i[0],a=i.slice(1);if("translate"===o||"skew"===o?1===a.length&&a.push(0):"scale"===o&&1===a.length&&a.push(a[0]),!Yi[o])return[];var s=a.map((function(t){return Xn(t)}));e.push({t:o,d:s})}return e}function Xi(t){if(Array.isArray(t))return Hi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Bi.lastIndex=0;e=Bi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Yi[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(a.length>s.length)return[];for(var u=[],c=0;s.length>c;c++){var l=a[c],h=s[c],p=void 0;if(void 0===(p=l?{A:function(t){return"0"===t.trim()?Dn:zr(t)},N:ri,T:Xr,L:Yr}[h.toUpperCase()](l):{a:Dn,n:u[0],t:In}[h]))return[];u.push(p)}if(n.push({t:i,d:u}),Bi.lastIndex===t.length)return n}return[]}function Wi(t){if(Array.isArray(t))return Hi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Bi.lastIndex=0;e=Bi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Yi[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(a.length>s.length)return[];for(var u=[],c=0;s.length>c;c++){var l=a[c],h=s[c],p=void 0;if(void 0===(p=l?{A:function(t){return"0"===t.trim()?Dn:Wr(t)},N:ni,T:Hr,L:jr}[h.toUpperCase()](l):{a:Dn,n:u[0],t:In}[h]))return[];u.push(p)}if(n.push({t:i,d:u}),Bi.lastIndex===t.length)return n}return[]}function zi(t){var e,n,r,i;switch(t.t){case"rotateX":return i=Ve(Zr(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=Ve(Zr(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=Ve(Zr(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=Ve(Zr(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var l=Ve(Zr(t.d[0])),h=Ve(Zr(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Ve(Zr(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=Ve(Zr(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Qr(t.d[0],0,null)||0,n=Qr(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Qr(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Qr(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Qr(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Qr(t.d[0],0,null)||0,n=Qr(t.d[1],0,null)||0,r=Qr(t.d[2],0,null)||0,1];case"perspective":var p=Qr(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,p?-1/p:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function qi(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function Zi(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Qe,t))return!1;if(o(Je,Qe),Je[3]=0,Je[7]=0,Je[11]=0,Je[15]=1,1e-8>Math.abs(l(Je)))return!1;var s,h,p=Qe[3],f=Qe[7],d=Qe[11],y=Qe[12],v=Qe[13],g=Qe[14],m=Qe[15];if(0!==p||0!==f||0!==d){if(tn[0]=p,tn[1]=f,tn[2]=d,tn[3]=m,!c(Je,Je))return!1;u(Je,Je),K(i,tn,Je)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=y,e[1]=v,e[2]=g,(s=en)[0][0]=(h=Qe)[0],s[0][1]=h[1],s[0][2]=h[2],s[1][0]=h[4],s[1][1]=h[5],s[1][2]=h[6],s[2][0]=h[8],s[2][1]=h[9],s[2][2]=h[10],n[0]=G(en[0]),Y(en[0],en[0]),r[0]=H(en[0],en[1]),rn(en[1],en[1],en[0],1,-r[0]),n[1]=G(en[1]),Y(en[1],en[1]),r[0]/=n[1],r[1]=H(en[0],en[2]),rn(en[2],en[2],en[0],1,-r[1]),r[2]=H(en[1],en[2]),rn(en[2],en[2],en[1],1,-r[2]),n[2]=G(en[2]),Y(en[2],en[2]),r[1]/=n[2],r[2]/=n[2],X(nn,en[1],en[2]),0>H(en[0],nn))for(var x=0;3>x;x++)n[x]*=-1,en[x][0]*=-1,en[x][1]*=-1,en[x][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+en[0][0]-en[1][1]-en[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-en[0][0]+en[1][1]-en[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-en[0][0]-en[1][1]+en[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+en[0][0]+en[1][1]+en[2][2],0)),en[2][1]>en[1][2]&&(a[0]=-a[0]),en[0][2]>en[2][0]&&(a[1]=-a[1]),en[1][0]>en[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(zi).reduce(qi)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var $i=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(s=0;3>s;s++)for(var u=0;3>u;u++)a[3][s]+=e[u]*a[u][s];var c=i[0],l=i[1],h=i[2],p=i[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(l*l+h*h),f[0][1]=2*(c*l-h*p),f[0][2]=2*(c*h+l*p),f[1][0]=2*(c*l+h*p),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(l*h-c*p),f[2][0]=2*(c*h-l*p),f[2][1]=2*(l*h+c*p),f[2][2]=1-2*(c*c+l*l),a=t(a,f);var d,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y)),s=0;3>s;s++)for(u=0;3>u;u++)a[s][u]*=n[s];return 0==(d=a)[0][2]&&0==d[0][3]&&0==d[1][2]&&0==d[1][3]&&0==d[2][0]&&0==d[2][1]&&1==d[2][2]&&0==d[2][3]&&0==d[3][2]&&1==d[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function Ki(t){return t.toFixed(6).replace(".000000","")}function Qi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Zi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Zi(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=qt(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return $i(t[0],t[1],t[2],e,t[4]).map(Ki).join(",")}])}function Ji(t){return t.replace(/[XY]/,"")}function to(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function eo(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?Xn(a):Xn(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length)u=[(m=Qi(t,e))[0]],c=[m[1]],l=[["matrix",[m[2]]]];else for(o=0;t.length>o;o++){var h=t[o].t,p=e[o].t,f=t[o].d,d=e[o].d,y=Yi[h],v=Yi[p],g=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var m=Qi([t[o]],[e[o]]);u.push(m[0]),c.push(m[1]),l.push(["matrix",[m[2]]])}else{if(h===p)g=h;else if(y[2]&&v[2]&&Ji(h)===Ji(p))g=Ji(h),f=y[2](f),d=v[2](d);else{if(!y[1]||!v[1]||to(h)!==to(p)){u=[(m=Qi(t,e))[0]],c=[m[1]],l=[["matrix",[m[2]]]];break}g=to(h),f=y[1](f),d=v[1](d)}for(var x=[],E=[],b=[],M=0;f.length>M;M++){m=qr(f[M],d[M],n,!1,M);x[M]=m[0],E[M]=m[1],b.push(m[2])}u.push(x),c.push(E),l.push([g,b])}}if(r){var S=u;u=c,c=S}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var no=fn((function(t){if(zt(t)){if("text-anchor"===t)return[Xn(0,"px"),Xn(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Xr(io(e[0])),Xr(io(e[1]))]}return[Xn(t[0]||0,"px"),Xn(t[1]||0,"px")]})),ro=function(t){if(zt(t)){if("text-anchor"===t)return[Xn(0,"px"),Xn(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Hr(io(e[0])),Hr(io(e[1]))]}return[Xn(t[0]||0,"px"),Xn(t[1]||0,"px")]};function io(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var oo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],ao=oo.filter((function(t){return!!t.l})).map((function(t){return t.n})),so={},uo=new WeakMap,co=function(){function e(t){var e=this;this.runtime=t,oo.forEach((function(t){e.registerMetadata(t)}))}return e.prototype.registerMetadata=function(t){bt([t.n],Et(t.a||[]),!1).forEach((function(e){so[e]=t}))},e.prototype.unregisterMetadata=function(t){delete so[t]},e.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},e.prototype.processProperties=function(e,n,r,i,o,a,s){var u=this;void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===a&&(a=void 0),void 0===s&&(s=!0);var c=e.nodeName!==t.Shape.GROUP;if(this.runtime.enableCSSParsing){var l=o,h=Object.keys(n);h.forEach((function(t){var i;r||(e.attributes[t]=n[t]),!l&&(null===(i=so[t])||void 0===i?void 0:i.l)&&(l=!0)})),i||h.forEach((function(t){e.computedStyle[t]=u.parseProperty(t,e.attributes[t],e,s)})),(null==a?void 0:a.length)&&(h=Array.from(new Set(h.concat(a)))),h.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=u.computeProperty(t,e.computedStyle[t],e,s))})),l&&(e.geometry.dirty=!0,e.renderable.boundsDirty=!0,e.renderable.renderBoundsDirty=!0,o||this.runtime.sceneGraphService.dirtifyToRoot(e)),h.forEach((function(t){t in e.parsedStyle&&u.postProcessProperty(t,e,h)})),this.runtime.enableCSSParsing&&e.children.length&&h.forEach((function(t){t in e.parsedStyle&&u.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,!0,!0,void 0,void 0,void 0)}))}))}else{Object.assign(e.attributes,n);var p=e.parsedStyle.clipPath,f=e.parsedStyle.offsetPath;Object.assign(e.parsedStyle,n);var d=!!o;d||ao.some((function(t){return t in n}))&&(d=!0),c&&(n.fill&&(e.parsedStyle.fill=Fr(n.fill)),n.stroke&&(e.parsedStyle.stroke=Fr(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Fr(n.shadowColor)),n.filter&&(e.parsedStyle.filter=ti(n.filter)),Vt(n.radius)||(e.parsedStyle.radius=$r(n.radius,4)),Vt(n.lineDash)||(e.parsedStyle.lineDash=$r(n.lineDash,2)),n.points&&(e.parsedStyle.points=_i(n.points)),""===n.d&&(e.parsedStyle.d=yt({},zn)),n.d&&(e.parsedStyle.d=Di(n.d)),n.textTransform&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},e,null)),te(n.clipPath)||this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.DEFINED_PATH].calculator("clipPath",p,n.clipPath,e,this.runtime),c&&n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.DEFINED_PATH].calculator("offsetPath",f,n.offsetPath,e,this.runtime),n.transform&&(e.parsedStyle.transform=Xi(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=no(n.transformOrigin)),Zt(n.zIndex)&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.Z_INDEX].postProcessor(e),c&&(n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),Zt(n.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.OFFSET_DISTANCE].postProcessor(e)),n.transform&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TRANSFORM].postProcessor(e),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TRANSFORM_ORIGIN].postProcessor(e),d&&(e.geometry.dirty=!0,e.renderable.boundsDirty=!0,e.renderable.renderBoundsDirty=!0,o||this.runtime.sceneGraphService.dirtifyToRoot(e))}},e.prototype.parseProperty=function(t,e,n,r){var i=so[t],o=e;if((""===e||Vt(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)o=Vn(e);else if(i){var a=i.k,s=i.syntax,u=s&&this.getPropertySyntax(s);a&&a.indexOf(e)>-1?o=Vn(e):u&&(!r&&u.parserUnmemoize?o=u.parserUnmemoize(e,n):u.parser&&(o=u.parser(e,n)))}return o},e.prototype.computeProperty=function(t,e,n,r){var i=so[t],o=e;if(i){var a=i.syntax,s=i.d;if(e instanceof Sn){var u=e.value;if("unset"===u&&(u=i.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===u)Vt(s)||(e=this.parseProperty(t,Bt(s)?s(n.nodeName):s,n,r));else if("inherit"===u){var c=this.tryToResolveProperty(n,t,{inherited:!0});return Vt(c)?void this.addUnresolveProperty(n,t):c}}var l=a&&this.getPropertySyntax(a);if(l&&l.calculator)o=l.calculator(t,n.parsedStyle[t],e,n,this.runtime);else o=e instanceof Sn?e.value:e}return o},e.prototype.postProcessProperty=function(t,e,n){var r=so[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},e.prototype.addUnresolveProperty=function(t,e){var n=uo.get(t);n||(uo.set(t,[]),n=uo.get(t)),-1===n.indexOf(e)&&n.push(e)},e.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=uo.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},e.prototype.recalc=function(t){var e=uo.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),uo.delete(t)}},e.prototype.updateGeometry=function(e){var n=e.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Lt),i.renderBounds||(i.renderBounds=new Lt);var o=e.parsedStyle,a=r.update(o,e),s=a.cx,u=void 0===s?0:s,c=a.cy,l=void 0===c?0:c,h=a.cz,p=void 0===h?0:h,f=a.hwidth,d=void 0===f?0:f,y=a.hheight,v=void 0===y?0:y,g=a.hdepth,m=void 0===g?0:g,x=[Math.abs(d),Math.abs(v),m],E=o.stroke,b=o.lineWidth,M=void 0===b?1:b,S=o.increasedLineWidthForHitTesting,T=void 0===S?0:S,P=o.shadowType,w=void 0===P?"outer":P,N=o.shadowColor,C=o.filter,k=void 0===C?[]:C,A=o.transformOrigin,O=[u,l,p];if(i.contentBounds.update(O,x),E&&!E.isNone){var R=((M||0)+(T||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);x[0]+=R,x[1]+=R}if(i.renderBounds.update(O,x),N&&w&&"inner"!==w){var L=i.renderBounds,I=L.min,D=L.max,G=o.shadowBlur||0,_=o.shadowOffsetX||0,U=o.shadowOffsetY||0,F=D[0]+G+_,V=I[1]-G+U,j=D[1]+G+U;I[0]=Math.min(I[0],I[0]-G+_),D[0]=Math.max(D[0],F),I[1]=Math.min(I[1],V),D[1]=Math.max(D[1],j),i.renderBounds.setMinMax(I,D)}k.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,B(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),i.renderBounds.setMinMax(c,l)}})),e.geometry.dirty=!1;var Y=0>v,H=(0>d?-1:1)*(A?Qr(A[0],0,e,!0):0),X=(Y?-1:1)*(A?Qr(A[1],1,e,!0):0);(H||X)&&e.setOrigin(H,X)}},e.prototype.updateSizeAttenuation=function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=(e.style.rawLineWidth||1)/n,e.nodeName===t.Shape.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=(e.style.rawR||1)/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===t.Shape.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))},e.prototype.isPropertyInheritable=function(t){var e=so[t];return!!e&&e.inh},e}(),lo=function(){function t(){this.parser=zr,this.parserUnmemoize=Wr,this.parserWithCSSDisabled=null,this.mixer=ii}return t.prototype.calculator=function(t,e,n,r){return Zr(n)},t}(),ho=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Sn&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),po=function(){function t(){this.parser=Fr,this.parserWithCSSDisabled=Fr,this.mixer=Br}return t.prototype.calculator=function(t,e,n,r){return n instanceof Sn?"none"===n.value?jn:Yn:n},t}(),fo=function(){function t(){this.parser=ti}return t.prototype.calculator=function(t,e,n){return n instanceof Sn?[]:n},t}();function yo(t){var e=t.parsedStyle.fontSize;return Vt(e)?null:e}var vo=function(){function e(){this.parser=Xr,this.parserUnmemoize=Hr,this.parserWithCSSDisabled=null,this.mixer=ii}return e.prototype.calculator=function(e,n,r,i,o){var a;if(Zt(r))return r;if(!Ln.isRelativeUnit(r.unit))return r.value;var s=o.styleValueRegistry;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){if(u=yo(i.parentNode))return u*=r.value;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){if(null===(a=null==i?void 0:i.ownerDocument)||void 0===a?void 0:a.documentElement){var u;if(u=yo(i.ownerDocument.documentElement))return u*=r.value;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}},e}(),go=function(){function t(){this.mixer=ai}return t.prototype.parser=function(t){var e=Kr(Zt(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),mo=function(){function t(){this.mixer=ai}return t.prototype.parser=function(t){var e=Kr(Zt(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),xo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Sn&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),Eo=function(){function t(){this.mixer=ii,this.parser=ri,this.parserUnmemoize=ni,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),bo=function(){function e(){this.parser=ri,this.parserUnmemoize=ni,this.parserWithCSSDisabled=null,this.mixer=oi(0,1)}return e.prototype.calculator=function(t,e,n){return n.value},e.prototype.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var o=r.getPoint(n.offsetDistance);o&&e.setLocalPosition(o.x,o.y)}}},e}(),Mo=function(){function t(){this.parser=ri,this.parserUnmemoize=ni,this.parserWithCSSDisabled=null,this.mixer=oi(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),So=function(){function t(){this.parser=Di,this.parserWithCSSDisabled=Di,this.mixer=Gi}return t.prototype.calculator=function(t,e,n){return n instanceof Sn&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new _t(0,0,0,0)}:n},t}(),To=function(){this.parser=_i,this.mixer=Ui},Po=function(t){function e(){var e=t.apply(this,bt([],Et(arguments),!1))||this;return e.mixer=oi(0,1/0),e}return pt(e,t),e}(vo),wo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Sn?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),No=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),Co={},ko=0;var Ao="undefined"!=typeof window&&void 0!==window.document;function Oo(t){return!!t.getAttribute}function Ro(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Lo(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function Io(t,e){if(Ao)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Do={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Go="object"==typeof performance&&performance.now?performance:Date;var _o=1,Uo="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Fo=Date.now(),Bo={},Vo=Date.now(),jo=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Vo,r=n>16?0:16-n,i=_o++;return Bo[i]=t,Object.keys(Bo).length>1||setTimeout((function(){Vo=e;var t=Bo;Bo={},Object.keys(t).forEach((function(e){return t[e](Uo.performance&&"function"==typeof Uo.performance.now?Uo.performance.now():Date.now()-Fo)}))}),r),i},Yo=function(t){delete Bo[t]},Ho=function(t){return"string"!=typeof t?jo:""===t?Uo.requestAnimationFrame:Uo[t+"RequestAnimationFrame"]},Xo=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Ho(t)})),Wo=Ho(Xo),zo=function(t){return"string"!=typeof t?Yo:""===t?Uo.cancelAnimationFrame:Uo[t+"CancelAnimationFrame"]||Uo[t+"CancelRequestAnimationFrame"]}(Xo);Uo.requestAnimationFrame=Wo,Uo.cancelAnimationFrame=zo;var qo=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,bt([],Et(t),!1))})))},t}(),Zo=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return gt(this,void 0,void 0,(function(){var e,n,r;return mt(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,bt([],Et(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return this.callbacks.length-1>n?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),$o=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),Ko=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;this.callbacks.length-1>e;e++){t=(0,this.callbacks[e])(t)}return t}return null},t}(),Qo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Jo=/([\"\'])[^\'\"]+\1/;function ta(t,e,n){return s(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var ea=i(),na=i(),ra={scale:function(t){v(ea,[t[0].value,t[1].value,1])},scaleX:function(t){v(ea,[t[0].value,1,1])},scaleY:function(t){v(ea,[1,t[0].value,1])},scaleZ:function(t){v(ea,[1,1,t[0].value])},scale3d:function(t){v(ea,[t[0].value,t[1].value,t[2].value])},translate:function(t){y(ea,[t[0].value,t[1].value,0])},translateX:function(t){y(ea,[t[0].value,0,0])},translateY:function(t){y(ea,[0,t[0].value,0])},translateZ:function(t){y(ea,[0,0,t[0].value])},translate3d:function(t){y(ea,[t[0].value,t[1].value,t[2].value])},rotate:function(t){E(ea,Ve(Zr(t[0])))},rotateX:function(t){m(ea,Ve(Zr(t[0])))},rotateY:function(t){x(ea,Ve(Zr(t[0])))},rotateZ:function(t){E(ea,Ve(Zr(t[0])))},rotate3d:function(t){g(ea,Ve(Zr(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){ta(ea,Ve(t[0].value),Ve(t[1].value))},skewX:function(t){ta(ea,Ve(t[0].value),0)},skewY:function(t){ta(ea,0,Ve(t[0].value))},matrix:function(t){a(ea,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){a.apply(I,bt([ea],Et(t.map((function(t){return t.value}))),!1))}},ia={translate:function(t,e){t.setLocalPosition([e[0].value,e[1].value])},translate3d:function(t,e){t.setLocalPosition([e[0].value,e[1].value,e[2].value])}};function oa(t,e){if(t.length){if(1===t.length&&ia[t[0].t])return void ia[t[0].t](e,t[0].d);for(var n=s(na),r=0;t.length>r;r++){var i=t[r],o=ra[i.t];o&&(o(i.d),L(n,n,ea))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var aa,sa=function(){function t(){this.parser=Xi,this.parserUnmemoize=Wi,this.parserWithCSSDisabled=Wi,this.mixer=eo}return t.prototype.calculator=function(t,e,n,r){return n instanceof Sn?[]:n},t.prototype.postProcessor=function(t){oa(t.parsedStyle.transform,t)},t}(),ua=function(){function e(){this.parser=no,this.parserUnmemoize=ro}return e.prototype.postProcessor=function(e){var n=e.parsedStyle.transformOrigin;n[0].unit===t.UnitType.kPixels&&n[1].unit===t.UnitType.kPixels?e.setOrigin(n[0].value,n[1].value):e.getGeometryBounds()},e}(),ca=function(){function e(){this.parser=ri,this.parserUnmemoize=ni}return e.prototype.calculator=function(t,e,n,r){return n.value},e.prototype.postProcessor=function(e){if(e.parentNode){var n=e.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=t.SortReason.Z_INDEX_CHANGED)}},e}(),la=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=t.cy,i=t.r,o=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:o,hheight:o}},t}(),ha=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=t.cy,i=t.rx,o=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===o?0:o}},t}(),pa=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i),u=(a-o)/2,c=(Math.max(n,i)-s)/2;return{cx:o+u,cy:s+c,hwidth:u,hheight:c}},t}(),fa=function(){function t(){}return t.prototype.update=function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}},t}(),da=function(){function t(){}return t.prototype.update=function(t){if(t.points&&jt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,bt([],Et(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,bt([],Et(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,bt([],Et(e.map((function(t){return t[1]}))),!1)),o=(r-n)/2,a=(Math.max.apply(Math,bt([],Et(e.map((function(t){return t[1]}))),!1))-i)/2;return{cx:n+o,cy:i+a,hwidth:o,hheight:a}}return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),ya=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.src,s=t.width,u=t.height,c=void 0===s?0:s,l=void 0===u?0:u;return a&&!zt(a)&&(c||(t.width=c=a.width),l||(t.height=l=a.height)),{cx:r+c/2,cy:o+l/2,hwidth:c/2,hheight:l/2}},t}(),va=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text;return hs.enableCSSParsing?n&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!Vt(t.lineWidth):n},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=void 0===o?"start":o,s=t.lineWidth,u=void 0===s?1:s,c=t.textBaseline,l=void 0===c?"alphabetic":c,h=t.dx,p=void 0===h?0:h,f=t.dy,d=void 0===f?0:f,y=t.x,v=void 0===y?0:y,g=t.y,m=void 0===g?0:g;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var x=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,E=this.globalRuntime.textService.measureText(i,t,x);t.metrics=E;var b=E.width/2,M=E.height/2,S=v+b;"center"===a||"middle"===a?S+=u/2-b:"right"!==a&&"end"!==a||(S+=u-2*b);var T=m-M;return"middle"===l?T+=M:"top"===l||"hanging"===l?T+=2*M:"alphabetic"===l?T+=this.globalRuntime.enableCSSParsing?E.lineHeight-E.fontProperties.ascent:0:"bottom"!==l&&"ideographic"!==l||(T+=0),p&&(S+=p),d&&(T+=d),{cx:S,cy:T,hwidth:b,hheight:M}},t}(),ga=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),ma=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=t.y,i=t.width,o=void 0===i?0:i,a=t.height,s=void 0===a?0:a;return{cx:(void 0===n?0:n)+o/2,cy:(void 0===r?0:r)+s/2,hwidth:o/2,hheight:s/2}},t}(),xa=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Gt,this.page=new Gt,this.canvas=new Gt,this.viewport=new Gt,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw Error(Ut)},t}(),Ea=function(t){function e(){var e=t.apply(this,bt([],Et(arguments),!1))||this;return e.client=new Gt,e.movement=new Gt,e.offset=new Gt,e.global=new Gt,e.screen=new Gt,e}return pt(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw Error(Ut)},e}(xa),ba=function(t){function e(){var e=t.apply(this,bt([],Et(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return pt(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(Ea),Ma=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pt(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Ea),Sa=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return pt(e,t),e}(xa),Ta=new WeakMap,Pa=function(){function t(){}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r,i;this.emitter||(this.emitter=new wt);var o=!1,a=!1;Jt(n)?o=n:n&&(o=void 0!==(r=n.capture)&&r,a=void 0!==(i=n.once)&&i),o&&(t+="capture"),e=Bt(e)?e:e.handleEvent;var s=Bt(e)?void 0:e;return a?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){if(!this.emitter)return this;(Jt(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=Bt(e)?e:null==e?void 0:e.handleEvent;var r=Bt(e)?void 0:e;return this.emitter.off(t,e,r),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Sa(t,e))},t.prototype.dispatchEvent=function(t,e){var n;void 0===e&&(e=!1);var r=Ta.get(this);if(r||(r=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&Ta.set(this,r),r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],e||(t.target=this),t.manager.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),wa=function(e){function n(){var t=e.apply(this,bt([],Et(arguments),!1))||this;return t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return pt(n,e),n.isNode=function(t){return!!t.childNodes},Object.defineProperty(n.prototype,"textContent",{get:function(){var e,n,r="";this.nodeName===t.Shape.TEXT&&(r+=this.style.text);try{for(var i=xt(this.childNodes),o=i.next();!o.done;o=i.next()){var a=o.value;r+=a.nodeName===t.Shape.TEXT?a.nodeValue:a.textContent}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text="".concat(e))},enumerable:!1,configurable:!0}),n.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},n.prototype.hasChildNodes=function(){return this.childNodes.length>0},n.prototype.isDefaultNamespace=function(t){throw Error(Ut)},n.prototype.lookupNamespaceURI=function(t){throw Error(Ut)},n.prototype.lookupPrefix=function(t){throw Error(Ut)},n.prototype.normalize=function(){throw Error(Ut)},n.prototype.isEqualNode=function(t){return this===t},n.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(n.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),n.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(e=r.parentNode)&&void 0!==e?e:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,u=s===o?a:o;if(s[s.length-u.length]===u[0])return s===o?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===o?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===o?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},n.prototype.contain=function(t){return this.contains(t)},n.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},n.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},n.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},n.DOCUMENT_POSITION_DISCONNECTED=1,n.DOCUMENT_POSITION_PRECEDING=2,n.DOCUMENT_POSITION_FOLLOWING=4,n.DOCUMENT_POSITION_CONTAINS=8,n.DOCUMENT_POSITION_CONTAINED_BY=16,n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,n}(Pa),Na=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new wt,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=i(),this.tmpVec3=D(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=Go.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.dispatchEvent(i,2===i.button?"rightup":"mouseup")}var o=n.trackingData(t.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!i.composedPath().includes(a)){for(var u=a;u&&!i.composedPath().includes(u);){if(i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside")}wa.isNode(u)&&(u=u.parentNode)}delete o.pressTargetsByButton[t.button],s=u}if(s){var c=n.clonePointerEvent(i,"click");c.target=s,c.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:r});var l=o.clicksByButton[t.button];l.target===c.target&&n.context.renderingContext.root.ownerDocument.defaultView.dblClickSpeed>r-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=r,c.detail=l.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==c.pointerType&&"touch"!==c.pointerType||n.dispatchEvent(c,"click"),n.dispatchEvent(c,"pointertap")),n.freeEvent(c)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",o||void 0);if(n.dispatchEvent(a,"pointerout"),r&&n.dispatchEvent(a,"mouseout"),!e.composedPath().includes(o)){var s=n.createPointerEvent(t,"pointerleave",o||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),wa.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(a)}if(o!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var c=o&&wa.isNode(o)&&o.parentNode;c&&c!==(wa.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&c!==e.target;)c=c.parentNode;if(!c||c===(wa.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var l=n.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==o&&l.target!==(wa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),r&&n.notifyTarget(l,"mouseenter"),wa.isNode(l.target)&&(l.target=l.target.parentNode);n.freeEvent(l)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(wa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),wa.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(wa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),wa.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),wa.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.getScale=function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,o=r.offsetHeight;i&&o&&(e=t.width/i,n=t.height/o)}return{scaleX:e,scaleY:n,bbox:t}},t.prototype.client2Viewport=function(t){var e=this.getScale(),n=e.bbox;return new Gt((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)},t.prototype.viewport2Client=function(t){var e=this.getScale(),n=e.bbox;return new Gt((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=h(this.tmpMatrix,u,s),l=F(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return W(l,l,c),new Gt(l[0],l[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=h(this.tmpMatrix,n,r),o=F(this.tmpVec3,t.x,t.y,0);W(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new Gt((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;n.length>r;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)wa.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t,e){var n=null==e?void 0:e.target;if((null==n?void 0:n.shadowRoot)&&(n=e.composedPath()[0]),n){if(n===t)return!0;if(t&&t.contains)return t.contains(n)}return!!(null==e?void 0:e.composedPath)&&e.composedPath().indexOf(t)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=xt(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=this.nativeHTMLMap.get(i.value);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(ba);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i),a=this.context.contextService.getDomElement();return i.target=null!=n?n:o||this.isNativeEventFromCanvas(a,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(Ma);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(Ma);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(ba);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},t.prototype.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},t.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Go.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter;if(n){var r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||wa.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Oo(e)&&e.getAttribute("cursor");if(n)return n;e=wa.isNode(e)&&e.parentNode}},t}(),Ca=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||hs.offscreenCanvas)this.canvas=t||hs.offscreenCanvas,this.context=this.canvas.getContext("2d",yt({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",yt({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",yt({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();t.RenderReason=void 0,(aa=t.RenderReason||(t.RenderReason={}))[aa.CAMERA_CHANGED=0]="CAMERA_CHANGED",aa[aa.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",aa[aa.NONE=2]="NONE";var ka,Aa=function(){function e(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.frame=0,this.zIndexCounter=0,this.hooks={init:new $o,initAsync:new qo,dirtycheck:new Ko,cull:new Ko,beginFrame:new $o,beforeRender:new $o,render:new $o,afterRender:new $o,endFrame:new $o,destroy:new $o,pick:new Zo,pickSync:new Ko,pointerDown:new $o,pointerUp:new $o,pointerMove:new $o,pointerOut:new $o,pointerOver:new $o,pointerWheel:new $o,pointerCancel:new $o,click:new $o}}return e.prototype.init=function(t){var e=this,n=yt(yt({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},e.prototype.getStats=function(){return this.stats},e.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},e.prototype.render=function(e,n,r){this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.frame++;var i=this.context.renderingContext;if(2===this.frame&&this.globalRuntime.sceneGraphService.dirtifyEntireSceneGraph(i.root),this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.frame>2&&this.globalRuntime.sceneGraphService.triggerPendingEvents(3===this.frame?i.root:void 0),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=1===i.renderReasons.size&&i.renderReasons.has(t.RenderReason.CAMERA_CHANGED),a=!e.disableRenderHooks||!(e.disableRenderHooks&&o);if(a&&this.renderDisplayObject(i.root,e,i),this.hooks.beginFrame.call(n),a){var s=i.renderListCurrentFrame;this.hooks.beforeRender.call(s),this.hooks.render.call(s),this.hooks.afterRender.call(s)}this.hooks.endFrame.call(n),i.renderListCurrentFrame.length=0,i.renderReasons.clear(),r()}},e.prototype.renderDisplayObject=function(t,e,n){var r=e.renderer.getConfig(),i=r.enableDirtyCheck,o=r.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var a=i?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(a){var s=o?this.hooks.cull.call(a,this.context.camera):a;s&&(this.stats.rendered++,n.renderListCurrentFrame.push(s))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var u=t.sortable;u.dirty&&(this.sort(t,u),u.dirty=!1,u.dirtyChildren=[],u.dirtyReason=void 0);for(var c=u.sorted||t.childNodes,l=c.length,h=0;l>h;h++)this.renderDisplayObject(c[h],e,n)},e.prototype.sort=function(e,n){n.sorted&&n.dirtyReason!==t.SortReason.Z_INDEX_CHANGED?n.dirtyChildren.forEach((function(t){if(-1===e.childNodes.indexOf(t)){var r=n.sorted.indexOf(t);0>r||n.sorted.splice(r,1)}else if(0===n.sorted.length)n.sorted.push(t);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>Ro(t[i],e)?n=i+1:r=i}return n}(n.sorted,t);n.sorted.splice(i,0,t)}})):n.sorted=e.childNodes.slice().sort(Ro)},e.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Oa=/\[\s*(.*)=(.*)\s*\]/,Ra=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(Oa),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Vt(n)?"":n.toString?""+n:""},t}(),La=function(t){function e(e,n,r,i,o,a,s,u){var c=t.call(this,null)||this;return c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return pt(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(xa);function Ia(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}t.ElementEvent=void 0,(ka=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",ka.DESTROY="destroy",ka.ATTR_MODIFIED="DOMAttrModified",ka.INSERTED="DOMNodeInserted",ka.REMOVED="removed",ka.MOUNTED="DOMNodeInsertedIntoDocument",ka.UNMOUNTED="DOMNodeRemovedFromDocument",ka.BOUNDS_CHANGED="bounds-changed",ka.CULLED="culled";var Da=new La(t.ElementEvent.REPARENT,null,"","","",0,"",""),Ga=1e-6;function _a(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return n===o&&r===a&&i===s||Ga*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&Ga*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&Ga*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var Ua,Fa,Ba,Va=ut(),ja=D(),Ya=_(1,1,1),Ha=i(),Xa=ut(),Wa=D(),za=i(),qa=Q(),Za=D(),$a=Q(),Ka=D(),Qa=D(),Ja=D(),ts=i(),es=Q(),ns=Q(),rs=Q(),is={affectChildren:!0},os=function(){function e(e){this.runtime=e,this.pendingEvents=new Map,this.boundsChangedEvent=new Sa(t.ElementEvent.BOUNDS_CHANGED),this.eventEntitySet=new Set,this.displayObjectDependencyMap=new WeakMap}return e.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},e.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},e.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},e.prototype.attach=function(e,n,r){var i,o=!1;e.parentNode&&(o=e.parentNode!==n,this.detach(e)),e.parentNode=n,Zt(r)?n.childNodes.splice(r,0,e):n.childNodes.push(e);var a=n.sortable;((null===(i=null==a?void 0:a.sorted)||void 0===i?void 0:i.length)||e.parsedStyle.zIndex)&&(-1===a.dirtyChildren.indexOf(e)&&a.dirtyChildren.push(e),a.dirty=!0,a.dirtyReason=t.SortReason.ADDED);var s=e.transformable;(null==e?void 0:e.renderable.rendered)&&s&&this.dirtifyWorld(e,s),s.frozen&&this.unfreezeParentToRoot(e),o&&e.dispatchEvent(Da)},e.prototype.detach=function(e){var n,r;if(e.parentNode){var i=e.transformable,o=e.parentNode.sortable;((null===(n=null==o?void 0:o.sorted)||void 0===n?void 0:n.length)||(null===(r=e.style)||void 0===r?void 0:r.zIndex))&&(-1===o.dirtyChildren.indexOf(e)&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=t.SortReason.REMOVED);var a=e.parentNode.childNodes.indexOf(e);a>-1&&e.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(e,i),e.parentNode=null}},e.prototype.getOrigin=function(t){return t.getGeometryBounds(),t.transformable.origin},e.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},e.prototype.rotate=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=_(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=qa;nt(o,e[0],e[1],e[2]);var a=this.getRotation(t),s=this.getRotation(t.parentNode);it(rs,s),et(rs,rs),tt(o,rs,o),tt(i.localRotation,o,a),st(i.localRotation,i.localRotation),this.dirtifyLocal(t,i)}else this.rotateLocal(t,e)},e.prototype.rotateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=_(e,n,r));var i=t.transformable;nt(ns,e[0],e[1],e[2]),at(i.localRotation,i.localRotation,ns),this.dirtifyLocal(t,i)},e.prototype.setEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=_(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){nt(i.localRotation,e[0],e[1],e[2]);var o=this.getRotation(t.parentNode);it(es,et(qa,o)),at(i.localRotation,i.localRotation,es),this.dirtifyLocal(t,i)}else this.setLocalEulerAngles(t,e)},e.prototype.setLocalEulerAngles=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=_(e,n,r));var o=t.transformable;nt(o.localRotation,e[0],e[1],e[2]),i&&this.dirtifyLocal(t,o)},e.prototype.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=_(e,n,r));var i=t.transformable;_a(e,ja)||(!function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,p=i*h-o*l,f=o*c-r*h,d=r*l-i*c,y=2*n[3];l*=y,h*=y,f*=2,d*=2,t[0]=a+(c*=y)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,i.localRotation),B(i.localPosition,i.localPosition,e),this.dirtifyLocal(t,i))},e.prototype.setPosition=function(t,e){var n,r=t.transformable;if(Ja[0]=e[0],Ja[1]=e[1],Ja[2]=null!==(n=e[2])&&void 0!==n?n:0,!_a(this.getPosition(t),Ja)){if(U(r.position,Ja),null!==t.parentNode&&t.parentNode.transformable)o(ts,t.parentNode.transformable.worldTransform),c(ts,ts),W(r.localPosition,Ja,ts);else U(r.localPosition,Ja);this.dirtifyLocal(t,r)}},e.prototype.setLocalPosition=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;Qa[0]=e[0],Qa[1]=e[1],Qa[2]=null!==(r=e[2])&&void 0!==r?r:0,_a(i.localPosition,Qa)||(U(i.localPosition,Qa),n&&this.dirtifyLocal(t,i))},e.prototype.scaleLocal=function(t,e){var n,r,i,o,a=t.transformable;r=a.localScale,i=a.localScale,o=F(Wa,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*o[0],r[1]=i[1]*o[1],r[2]=i[2]*o[2],this.dirtifyLocal(t,a)},e.prototype.setLocalScale=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;F(Wa,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:i.localScale[2]),_a(Wa,i.localScale)||(U(i.localScale,Wa),n&&this.dirtifyLocal(t,i))},e.prototype.translate=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=F(Wa,e,n,r)),_a(e,ja)||(B(Wa,this.getPosition(t),e),this.setPosition(t,Wa))},e.prototype.setRotation=function(t,e,n,r,i){var o=t.transformable;if("number"==typeof e&&(e=rt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var a=this.getRotation(t.parentNode);it(qa,a),et(qa,qa),tt(o.localRotation,qa,e),st(o.localRotation,o.localRotation),this.dirtifyLocal(t,o)}else this.setLocalRotation(t,e)},e.prototype.setLocalRotation=function(t,e,n,r,i,o){void 0===o&&(o=!0),"number"==typeof e&&(e=ot(qa,e,n,r,i));var a=t.transformable;it(a.localRotation,e),o&&this.dirtifyLocal(t,a)},e.prototype.setLocalSkew=function(t,e,n,r){void 0===r&&(r=!0),"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(Xa,e,n));var i,o,a=t.transformable;(i=a.localSkew)[0]=(o=e)[0],i[1]=o[1],r&&this.dirtifyLocal(t,a)},e.prototype.dirtifyLocal=function(t,e){t.renderable.rendered||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},e.prototype.dirtifyEntireSceneGraph=function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0),this.pendingEvents.has(t)||this.pendingEvents.set(t,!0);for(var r=t.childNodes.length,i=0;r>i;i++)this.dirtifyEntireSceneGraph(t.childNodes[i])},e.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},e.prototype.triggerEvent=function(t,e){t.isConnected&&!this.eventEntitySet.has(t.entity)&&(this.boundsChangedEvent.detail=e,this.boundsChangedEvent.target=t,t.isMutationObserved?t.dispatchEvent(this.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(this.boundsChangedEvent,!0),this.eventEntitySet.add(t.entity))},e.prototype.triggerPendingEvents=function(t){var e=this;t?(is.affectChildren=!0,t.forEach((function(t){e.triggerEvent(t,is)}))):this.pendingEvents.forEach((function(t,n){is.affectChildren=t,t?n.forEach((function(t){e.triggerEvent(t,is)})):e.triggerEvent(n,is)})),this.eventEntitySet.clear(),this.clearPendingEvents()},e.prototype.clearPendingEvents=function(){this.pendingEvents.clear()},e.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Ia(n),n=n.parentNode;e&&t.forEach((function(t){Ia(t)})),this.informDependentDisplayObjects(t),!e&&this.pendingEvents.has(t)||this.pendingEvents.set(t,e)},e.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},e.prototype.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r,!0),r.dispatchEvent(new La(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,La.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},e.prototype.getPosition=function(t){var e=t.transformable;return M(e.position,this.getWorldTransform(t,e))},e.prototype.getRotation=function(t){var e=t.transformable;return T(e.rotation,this.getWorldTransform(t,e))},e.prototype.getScale=function(t){var e=t.transformable;return S(e.scaling,this.getWorldTransform(t,e))},e.prototype.getWorldTransform=function(t,e){void 0===e&&(e=t.transformable);var n=e.worldTransform;if(!e.localDirtyFlag&&!e.dirtyFlag&&(t.renderable.rendered||e.computed))return n;if(t.parentNode&&t.parentNode.transformable){var r=t.parentNode.transformable;(r.dirtyFlag||r.localDirtyFlag)&&this.getWorldTransform(t.parentNode)}return this.sync(t,e),n},e.prototype.getLocalPosition=function(t){return t.transformable.localPosition},e.prototype.getLocalRotation=function(t){return t.transformable.localRotation},e.prototype.getLocalScale=function(t){return t.transformable.localScale},e.prototype.getLocalSkew=function(t){return t.transformable.localSkew},e.prototype.calcLocalTransform=function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){P(t.localTransform,t.localRotation,t.localPosition,_(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(s(za),za[4]=Math.tan(t.localSkew[0]),za[1]=Math.tan(t.localSkew[1]),h(t.localTransform,t.localTransform,za));var e=P(za,ot(qa,0,0,0,1),F(Wa,1,1,1),t.localScale,t.origin);h(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,o=t.localScale,a=t.origin,u=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==o[0]||1!==o[1]||1!==o[2])||(0!==a[0]||0!==a[1]||0!==a[2])?P(n,i,r,o,a):u?y(n,r):s(n)}},e.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},e.prototype.setLocalTransform=function(t,e){var n=M(Za,e),r=T($a,e),i=S(Ka,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,Ya,!1),this.setLocalPosition(t,ja,!1),this.setLocalEulerAngles(t,ja,void 0,void 0,!1),this.setLocalSkew(t,Va,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Lt.isEmpty(r))return null;var i=n||new Lt;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},e.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return n.dirty&&hs.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Lt},e.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable,i=r||{},o=i.bounds,a=i.renderBounds,s=i.rendered;if(s&&!i.boundsDirty&&!e&&o)return o;if(s&&!i.renderBoundsDirty&&e&&a)return a;var u=e?r.renderBounds:r.bounds,c=this.getTransformedGeometryBounds(t,e,u);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(c?c.add(r):(c=u||new Lt).update(r.center,r.halfExtents))})),c||(c=new Lt),e){var l=Lo(t);if(l){var h=l.parsedStyle.clipPath.getBounds(e);c?h&&(c=h.intersection(c)):c.update(h.center,h.halfExtents)}}return e?(r.renderBounds=c,r.renderBoundsDirty=!1):(r.bounds=c,r.boundsDirty=!1),c},e.prototype.getLocalBounds=function(t){if(t.parentNode){var e=Ha;t.parentNode.transformable&&(e=c(za,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Lt.isEmpty(n)){var r=new Lt;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},e.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Lt.isEmpty(i)||(r=new Lt).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=Et(r.getMin(),2),s=a[0],u=a[1],c=Et(r.getMax(),2);return new _t(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new _t((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},e.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},e.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},e.prototype.sync=function(t,e){var n=!t.renderable.rendered;if((n||e.localDirtyFlag)&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),n||e.dirtyFlag){var r=t.parentNode,i=r&&r.transformable;null!==r&&i?h(e.worldTransform,i.worldTransform,e.localTransform):o(e.worldTransform,e.localTransform),e.dirtyFlag=!1}e.computed=!0},e.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),as={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},ss=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,us=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),cs=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ls=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!cs.exec(n)&&!us.exec(t))},this.trimByKinsokuShorui=function(t){var e=bt([],Et(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=as.MetricsString+as.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(as.BaselineSymbol).width),u=as.HeightMultiplier*s;s=s*as.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,o=e.wordWrap,a=void 0!==o&&o,s=e.lineHeight,u=e.lineWidth,c=void 0===u?1:u,l=e.textBaseline,h=void 0===l?"alphabetic":l,p=e.textAlign,f=void 0===p?"start":p,d=e.letterSpacing,y=void 0===d?0:d,v=e.textPath,g=e.leading,m=void 0===g?0:g,x=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,u=void 0===s?"normal":s,c=t.fontWeight,l=void 0===c?"normal":c,h=Zt(n)&&"".concat(n,"px")||"16px",p=i.split(","),f=p.length-1;f>=0;f--){var d=p[f].trim();!Jo.test(d)&&0>Qo.indexOf(d)&&(d='"'.concat(d,'"')),p[f]=d}return"".concat(a," ").concat(u," ").concat(l," ").concat(h," ").concat(p.join(","))}(e),E=this.measureFont(x,n);0===E.fontSize&&(E.fontSize=i,E.ascent=i);var b=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);b.font=x,e.isOverflowing=!1;var M=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),S=Array(M.length),T=0;if(!v){for(k=0;M.length>k;k++){var P=b.measureText(M[k]).width+(M[k].length-1)*y;S[k]=P,T=Math.max(T,P)}A=T+c;var w=s||E.fontSize+c,N=Math.max(w,E.fontSize+c)+(M.length-1)*(w+m),C=0;return"middle"===h?C=-N/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?C=-N:"top"!==h&&"hanging"!==h||(C=0),{font:x,width:A,height:N,lines:M,lineWidths:S,lineHeight:w+=m,maxLineWidth:T,fontProperties:E,lineMetrics:S.map((function(t,e){var n=0;return"center"===f||"middle"===f?n-=t/2:"right"!==f&&"end"!==f||(n-=t),new _t(n-c/2,C+e*w,t+c,w)}))}}v.getTotalLength();for(var k=0;M.length>k;k++)var A=b.measureText(M[k]).width+(M[k].length-1)*y},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,u=e.maxLines,c=void 0===u?1/0:u,l=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),p=o+s,f="";"ellipsis"===l?f="...":l&&"clip"!==l&&(f=l);for(var d=[],y=0,v=0,g={},m=function(t){return r.getFromCache(t,s,g,h)},x=Array.from(f).reduce((function(t,e){return t+m(e)}),0),E=Array.from(t),b=0;E.length>b;b++){var M=E[b],S=t[b-1],T=t[b+1],P=m(M);if(this.isNewline(M)){if(++y>=c){e.isOverflowing=!0;break}v=0,d[y]=""}else{if(v>0&&v+P>p){if(y+1>=c){if(e.isOverflowing=!0,x>0&&p>=x){for(var w=d[y].length,N=0,C=w,k=0;w>k;k++){var A=m(d[y][k]);if(N+A+x>p){C=k;break}N+=A}d[y]=(d[y]||"").slice(0,C)+f}break}if(v=0,d[++y]="",this.isBreakingSpace(M))continue;this.canBreakInLastChar(M)||(d=this.trimToBreakable(d),v=this.sumTextWidthByCache(d[y]||"",g)),this.shouldBreakByKinsokuShorui(M,T)&&(d=this.trimByKinsokuShorui(d),v+=m(S||""))}v+=P,d[y]=(d[y]||"")+M}}return d.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&as.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&as.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=bt([],Et(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},t.prototype.canBreakInLastChar=function(t){return!t||!ss.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!ss.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),hs={},ps=(Fa=new ya,Ba=new da,(Ua={})[t.Shape.CIRCLE]=new la,Ua[t.Shape.ELLIPSE]=new ha,Ua[t.Shape.RECT]=Fa,Ua[t.Shape.IMAGE]=Fa,Ua[t.Shape.GROUP]=new ga,Ua[t.Shape.LINE]=new pa,Ua[t.Shape.TEXT]=new va(hs),Ua[t.Shape.POLYLINE]=Ba,Ua[t.Shape.POLYGON]=Ba,Ua[t.Shape.PATH]=new fa,Ua[t.Shape.HTML]=new ma,Ua[t.Shape.MESH]=null,Ua),fs=function(){var e,n=new po,r=new vo;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new Eo,e[t.PropertySyntax.ANGLE]=new lo,e[t.PropertySyntax.DEFINED_PATH]=new ho,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new fo,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new go,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new mo,e[t.PropertySyntax.COORDINATE]=new vo,e[t.PropertySyntax.OFFSET_DISTANCE]=new bo,e[t.PropertySyntax.OPACITY_VALUE]=new Mo,e[t.PropertySyntax.PATH]=new So,e[t.PropertySyntax.LIST_OF_POINTS]=new To,e[t.PropertySyntax.SHADOW_BLUR]=new Po,e[t.PropertySyntax.TEXT]=new wo,e[t.PropertySyntax.TEXT_TRANSFORM]=new No,e[t.PropertySyntax.TRANSFORM]=new sa,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new ua,e[t.PropertySyntax.Z_INDEX]=new ca,e[t.PropertySyntax.MARKER]=new xo,e}();hs.CameraContribution=pn,hs.AnimationTimeline=null,hs.EasingFunction=null,hs.offscreenCanvasCreator=new Ca,hs.sceneGraphSelector=new Ra,hs.sceneGraphService=new os(hs),hs.textService=new ls(hs),hs.geometryUpdaterFactory=ps,hs.CSSPropertySyntaxFactory=fs,hs.styleValueRegistry=new co(hs),hs.layoutRegistry=null,hs.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},hs.enableCSSParsing=!1,hs.enableDataset=!1,hs.enableStyleSyntax=!0,hs.enableAttributeDashCased=!1,hs.enableSizeAttenuation=!1;var ds=0;var ys=new La(t.ElementEvent.INSERTED,null,"","","",0,"",""),vs=new La(t.ElementEvent.REMOVED,null,"","","",0,"",""),gs=new Sa(t.ElementEvent.DESTROY),ms=function(e){function n(){var n=e.apply(this,bt([],Et(arguments),!1))||this;return n.entity=ds++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,rendered:!1},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,computed:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=hs.enableCSSParsing?{opacity:_n,fillOpacity:_n,strokeOpacity:_n,fill:_n,stroke:_n,transform:_n,transformOrigin:_n,visibility:_n,pointerEvents:_n,lineWidth:_n,lineCap:_n,lineJoin:_n,increasedLineWidthForHitTesting:_n,fontSize:_n,fontFamily:_n,fontStyle:_n,fontWeight:_n,fontVariant:_n,textAlign:_n,textBaseline:_n,textTransform:_n,zIndex:_n,filter:_n,shadowType:_n}:{},n.parsedStyle={},n.attributes={},n}return pt(n,e),Object.defineProperty(n.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),n.prototype.cloneNode=function(t){throw Error(Ut)},n.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return hs.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),this.isMutationObserved&&(ys.relatedNode=this,t.dispatchEvent(ys)),t},n.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},n.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},n.prototype.removeChild=function(t){var e;return vs.relatedNode=this,t.dispatchEvent(vs),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),hs.sceneGraphService.detach(t),t},n.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},n.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},n.prototype.matches=function(t){return hs.sceneGraphService.matches(t,this)},n.prototype.getElementById=function(t){return hs.sceneGraphService.querySelector("#".concat(t),this)},n.prototype.getElementsByName=function(t){return hs.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},n.prototype.getElementsByClassName=function(t){return hs.sceneGraphService.querySelectorAll(".".concat(t),this)},n.prototype.getElementsByTagName=function(t){return hs.sceneGraphService.querySelectorAll(t,this)},n.prototype.querySelector=function(t){return hs.sceneGraphService.querySelector(t,this)},n.prototype.querySelectorAll=function(t){return hs.sceneGraphService.querySelectorAll(t,this)},n.prototype.closest=function(t){var e=this;do{if(hs.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},n.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},n.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},n.prototype.after=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},n.prototype.before=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=Et(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,bt([],Et(a),!1))}},n.prototype.replaceWith=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this.after.apply(this,bt([],Et(t),!1)),this.remove()},n.prototype.append=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},n.prototype.prepend=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},n.prototype.replaceChildren=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,bt([],Et(t),!1))},n.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},n.prototype.destroy=function(){var t;this.dispatchEvent(gs),this.remove(),null===(t=this.emitter)||void 0===t||t.removeAllListeners(),this.destroyed=!0},n.prototype.getGeometryBounds=function(){return hs.sceneGraphService.getGeometryBounds(this)},n.prototype.getRenderBounds=function(){return hs.sceneGraphService.getBounds(this,!0)},n.prototype.getBounds=function(){return hs.sceneGraphService.getBounds(this)},n.prototype.getLocalBounds=function(){return hs.sceneGraphService.getLocalBounds(this)},n.prototype.getBoundingClientRect=function(){return hs.sceneGraphService.getBoundingClientRect(this)},n.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},n.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},n.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},n.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return hs.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){if(hs.enableAttributeDashCased){var n=Cn(t);e=this.attributes[n]}return hs.enableCSSParsing&&Vt(e)?null:e}return e},n.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},n.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},n.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},n.prototype.setAttribute=function(t,e,n,r){this.attributes[t]=e},n.prototype.getAttributeNS=function(t,e){throw Error(Ut)},n.prototype.getAttributeNode=function(t){throw Error(Ut)},n.prototype.getAttributeNodeNS=function(t,e){throw Error(Ut)},n.prototype.hasAttributeNS=function(t,e){throw Error(Ut)},n.prototype.removeAttributeNS=function(t,e){throw Error(Ut)},n.prototype.removeAttributeNode=function(t){throw Error(Ut)},n.prototype.setAttributeNS=function(t,e,n){throw Error(Ut)},n.prototype.setAttributeNode=function(t){throw Error(Ut)},n.prototype.setAttributeNodeNS=function(t){throw Error(Ut)},n.prototype.toggleAttribute=function(t,e){throw Error(Ut)},n}(wa);function xs(t){return!!(null==t?void 0:t.nodeName)}var Es,bs=hs.globalThis.Proxy?hs.globalThis.Proxy:function(){},Ms=new La(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,La.MODIFICATION,null,null),Ss={opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Ts={fill:jn,stroke:jn,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Ps=bt(bt([],Et(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),ws="data-",Ns=D(),Cs=Q(),ks=function(e){function n(n){var r=e.call(this)||this;return r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.config=n,r.id=n.id||"",r.name=n.name||"",(n.className||n.class)&&(r.className=n.className||n.class),r.nodeName=n.type||t.Shape.GROUP,hs.enableCSSParsing?(Object.assign(r.attributes,Ss),Object.assign(r.parsedStyle,Ts,r.config.initialParsedStyle)):n.initialParsedStyle&&Object.assign(r.parsedStyle,n.initialParsedStyle),r.initAttributes(n.style),hs.enableDataset&&(r.dataset=new bs({},{get:function(t,e){var n="".concat(ws).concat(wn(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(ws).concat(wn(e)),n),!0}})),hs.enableStyleSyntax&&(r.style=new bs({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return pt(n,e),n.prototype.destroy=function(){e.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},n.prototype.cloneNode=function(t,e){var n=yt({},this.attributes);for(var r in n){var i=n[r];xs(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},n.prototype.initAttributes=function(t){void 0===t&&(t={}),hs.styleValueRegistry.processProperties(this,hs.enableAttributeDashCased?function(t){var e,n,r={};try{for(var i=xt(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=Et(o.value,2),s=a[1];r[Cn(a[0])]=s}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}(t):t,void 0,void 0,!0,hs.enableCSSParsing?Ps:void 0,void 0),this.renderable.dirty=!0},n.prototype.setAttribute=function(t,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=!0),hs.enableAttributeDashCased&&(t=Cn(t)),te(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,void 0,void 0,void 0,void 0,i),e.prototype.setAttribute.call(this,t,n))},n.prototype.internalSetAttribute=function(t,e,n,r,i,o,a){var s,u=this.renderable,c=this.attributes[t],l=this.parsedStyle[t];hs.styleValueRegistry.processProperties(this,((s={})[t]=e,s),n,r,i,o,a),u.dirty=!0;var h=this.parsedStyle[t];this.isConnected&&(Ms.relatedNode=this,Ms.prevValue=c,Ms.newValue=e,Ms.attrName=t,Ms.prevParsedValue=l,Ms.newParsedValue=h,this.isMutationObserved?this.dispatchEvent(Ms):(Ms.target=this,this.ownerDocument.defaultView.dispatchEvent(Ms,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,c,e,l,h)},n.prototype.getBBox=function(){var t=this.getBounds(),e=Et(t.getMin(),2),n=e[0],r=e[1],i=Et(t.getMax(),2);return new _t(n,r,i[0]-n,i[1]-r)},n.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),hs.sceneGraphService.setOrigin(this,Fe(t,e,n,!1)),this},n.prototype.getOrigin=function(){return hs.sceneGraphService.getOrigin(this)},n.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),hs.sceneGraphService.setPosition(this,Fe(t,e,n,!1)),this},n.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),hs.sceneGraphService.setLocalPosition(this,Fe(t,e,n,!1)),this},n.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),hs.sceneGraphService.translate(this,Fe(t,e,n,!1)),this},n.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),hs.sceneGraphService.translateLocal(this,Fe(t,e,n,!1)),this},n.prototype.getPosition=function(){return hs.sceneGraphService.getPosition(this)},n.prototype.getLocalPosition=function(){return hs.sceneGraphService.getLocalPosition(this)},n.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},n.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Fe(t,e=e||t,n=n||t,!1)),hs.sceneGraphService.scaleLocal(this,t),this},n.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Fe(t,e=e||t,n=n||t,!1)),hs.sceneGraphService.setLocalScale(this,t),this},n.prototype.getLocalScale=function(){return hs.sceneGraphService.getLocalScale(this)},n.prototype.getScale=function(){return hs.sceneGraphService.getScale(this)},n.prototype.getEulerAngles=function(){return Ye(Et(We(Ns,hs.sceneGraphService.getWorldTransform(this)),3)[2])},n.prototype.getLocalEulerAngles=function(){return Ye(Et(We(Ns,hs.sceneGraphService.getLocalRotation(this)),3)[2])},n.prototype.setEulerAngles=function(t){return hs.sceneGraphService.setEulerAngles(this,0,0,t),this},n.prototype.setLocalEulerAngles=function(t){return hs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},n.prototype.rotateLocal=function(t,e,n){return Vt(e)&&Vt(n)?hs.sceneGraphService.rotateLocal(this,0,0,t):hs.sceneGraphService.rotateLocal(this,t,e,n),this},n.prototype.rotate=function(t,e,n){return Vt(e)&&Vt(n)?hs.sceneGraphService.rotate(this,0,0,t):hs.sceneGraphService.rotate(this,t,e,n),this},n.prototype.setRotation=function(t,e,n,r){return hs.sceneGraphService.setRotation(this,t,e,n,r),this},n.prototype.setLocalRotation=function(t,e,n,r){return hs.sceneGraphService.setLocalRotation(this,t,e,n,r),this},n.prototype.setLocalSkew=function(t,e){return hs.sceneGraphService.setLocalSkew(this,t,e),this},n.prototype.getRotation=function(){return hs.sceneGraphService.getRotation(this)},n.prototype.getLocalRotation=function(){return hs.sceneGraphService.getLocalRotation(this)},n.prototype.getLocalSkew=function(){return hs.sceneGraphService.getLocalSkew(this)},n.prototype.getLocalTransform=function(){return hs.sceneGraphService.getLocalTransform(this)},n.prototype.getWorldTransform=function(){return hs.sceneGraphService.getWorldTransform(this)},n.prototype.setLocalTransform=function(t){return hs.sceneGraphService.setLocalTransform(this,t),this},n.prototype.resetLocalTransform=function(){hs.sceneGraphService.resetLocalTransform(this)},n.prototype.getAnimations=function(){return this.activeAnimations},n.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},n.prototype.isVisible=function(){var t,e;return hs.enableCSSParsing?"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility):"hidden"!==(null===(e=this.parsedStyle)||void 0===e?void 0:e.visibility)},Object.defineProperty(n.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),n.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},n.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},n.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,bt([],Et(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},n.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,bt([],Et(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},n.prototype.getConfig=function(){return this.config},n.prototype.attr=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=Et(e,2),i=r[0],o=r[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},n.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=Et(M(Ns,e),2),r=n[0],i=n[1],o=Et(S(Ns,e),2),a=o[0],s=o[1],u=T(Cs,e),c=Et(We(Ns,u),3);return ze(c[0]||c[2],r,i,a,s)},n.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},n.prototype.setMatrix=function(t){var e=Et(qe(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},n.prototype.setLocalMatrix=function(t){var e=Et(qe(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},n.prototype.show=function(){hs.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},n.prototype.hide=function(){hs.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},n.prototype.getCount=function(){return this.childElementCount},n.prototype.getParent=function(){return this.parentElement},n.prototype.getChildren=function(){return this.children},n.prototype.getFirst=function(){return this.firstElementChild},n.prototype.getLast=function(){return this.lastElementChild},n.prototype.getChildByIndex=function(t){return this.children[t]||null},n.prototype.add=function(t,e){return this.appendChild(t,e)},n.prototype.set=function(t,e){this.config[t]=e},n.prototype.get=function(t){return this.config[t]},n.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},n.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},n.prototype.setZIndex=function(t){return this.style.zIndex=t,this},n}(ms),As=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.CIRCLE},n))||this}return pt(n,e),n}(ks),Os=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=vt(e,["style"]);return(n=t.call(this,yt({style:yt({},r)},i))||this).isCustomElement=!0,n}return pt(e,t),e}(ks),Rs=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.ELLIPSE},n))||this}return pt(n,e),n}(ks),Ls=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.GROUP},n))||this}return pt(n,e),n}(ks),Is=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=vt(n,["style"]);return(r=e.call(this,yt({type:t.Shape.HTML,style:yt(hs.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},i)},o))||this).cullable.enable=!1,r}return pt(n,e),n.prototype.getDomElement=function(){return this.parsedStyle.$el},n.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},n.prototype.getLocalBounds=function(){if(this.parentNode){var t=c(i(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Lt.isEmpty(e)){var n=new Lt;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(ks),Ds=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.IMAGE},n))||this}return pt(n,e),n}(ks),Gs=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=vt(n,["style"]);(r=e.call(this,yt({type:t.Shape.LINE,style:yt({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},o))||this).markerStartAngle=0,r.markerEndAngle=0;var a=r.parsedStyle,s=a.markerStart,u=a.markerEnd;return s&&xs(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),u&&xs(u)&&(r.markerEndAngle=u.getLocalEulerAngles(),r.appendChild(u)),r.transformMarker(!0),r.transformMarker(!1),r}return pt(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&xs(r)&&(this.markerStartAngle=0,r.remove()),i&&xs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&xs(r)&&(this.markerEndAngle=0,r.remove()),i&&xs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,o=e.x2,a=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&xs(u)){var c,l,h,p,f,d,y;t?(p=i,f=a,l=o-i,h=s-a,d=n||0,y=this.markerStartAngle):(p=o,f=s,l=i-o,h=a-s,d=r||0,y=this.markerEndAngle),u.setLocalEulerAngles(180*(c=Math.atan2(h,l))/Math.PI+y),u.setLocalPosition(p+Math.cos(c)*d,f+Math.sin(c)*d)}},n.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=fi(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=W(D(),_(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new Gt(a[0],a[1])},n.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},n.prototype.getTotalLength=function(){var t=this.parsedStyle;return pi(t.x1,t.y1,t.x2,t.y2)},n}(ks),_s=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=vt(n,["style"]);(r=e.call(this,yt({type:t.Shape.PATH,style:yt(hs.enableCSSParsing?{d:"",miterLimit:""}:{},i),initialParsedStyle:hs.enableCSSParsing?null:{miterLimit:4,d:yt({},zn)}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,s=a.markerStart,u=a.markerEnd,c=a.markerMid;return s&&xs(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),c&&xs(c)&&r.placeMarkerMid(c),u&&xs(u)&&(r.markerEndAngle=u.getLocalEulerAngles(),r.appendChild(u)),r.transformMarker(!0),r.transformMarker(!1),r}return pt(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&xs(r)&&(this.markerStartAngle=0,r.remove()),i&&xs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&xs(r)&&(this.markerEndAngle=0,r.remove()),i&&xs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&xs(i)){var o,a,s,u,c,l,h;if(t){var p=Et(this.getStartTangent(),2);u=(d=p[1])[0],c=d[1],a=(f=p[0])[0]-d[0],s=f[1]-d[1],l=n||0,h=this.markerStartAngle}else{var f,d,y=Et(this.getEndTangent(),2);u=(d=y[1])[0],c=d[1],a=(f=y[0])[0]-d[0],s=f[1]-d[1],l=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(o=Math.atan2(s,a))/Math.PI+h),i.setLocalPosition(u+Math.cos(o)*l,c+Math.sin(o)*l)}},n.prototype.placeMarkerMid=function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&xs(t))for(var n=1;e.length-1>n;n++){var r=Et(e[n].currentPoint,2),i=r[0],o=r[1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,o)}},n.prototype.getTotalLength=function(){return bi(this)},n.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return Le(t,e,yt(yt({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=W(D(),_(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Gt(o[0],o[1])},n.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*bi(this),e)},n.prototype.getStartTangent=function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},n.prototype.getEndTangent=function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(ks),Us=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=vt(n,["style"]);(r=e.call(this,yt({type:t.Shape.POLYGON,style:yt(hs.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},i),initialParsedStyle:hs.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,s=a.markerStart,u=a.markerEnd,c=a.markerMid;return s&&xs(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),c&&xs(c)&&r.placeMarkerMid(c),u&&xs(u)&&(r.markerEndAngle=u.getLocalEulerAngles(),r.appendChild(u)),r.transformMarker(!0),r.transformMarker(!1),r}return pt(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&xs(r)&&(this.markerStartAngle=0,r.remove()),i&&xs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&xs(r)&&(this.markerEndAngle=0,r.remove()),i&&xs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,o=t?e.markerStart:e.markerEnd;if(o&&xs(o)&&i){var a,s,u,c,l,h,p;if(c=i[0][0],l=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,p=this.markerStartAngle;else{var f=i.length;this.parsedStyle.isClosed?(s=i[f-1][0]-i[0][0],u=i[f-1][1]-i[0][1]):(c=i[f-1][0],l=i[f-1][1],s=i[f-2][0]-i[f-1][0],u=i[f-2][1]-i[f-1][1]),h=r||0,p=this.markerEndAngle}o.setLocalEulerAngles(180*(a=Math.atan2(u,s))/Math.PI+p),o.setLocalPosition(c+Math.cos(a)*h,l+Math.sin(a)*h)}},n.prototype.placeMarkerMid=function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&xs(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,i)}},n}(ks),Fs=function(e){function n(n){void 0===n&&(n={});var r=n.style,i=vt(n,["style"]);return e.call(this,yt({type:t.Shape.POLYLINE,style:yt(hs.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},r),initialParsedStyle:hs.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return pt(n,e),n.prototype.getTotalLength=function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=gi(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t},n.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},n.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,o=[],a=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=pi(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))})),this.parsedStyle.points.segments=o}var u=0,c=0;this.parsedStyle.points.segments.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),c=n)}));var l=fi(n[c][0],n[c][1],n[c+1][0],n[c+1][1],u),h=l.x,p=l.y,f=W(D(),_(h,p,0),e?this.getWorldTransform():this.getLocalTransform());return new Gt(f[0],f[1])},n.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},n.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(Us),Bs=function(e){function n(n){return void 0===n&&(n={}),e.call(this,yt({type:t.Shape.RECT},n))||this}return pt(n,e),n}(ks),Vs=function(e){function n(n){void 0===n&&(n={});var r=n.style,i=vt(n,["style"]);return e.call(this,yt({type:t.Shape.TEXT,style:yt(hs.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""}:{fill:"black"},r)},i))||this}return pt(n,e),n.prototype.getComputedTextLength=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},n.prototype.getLineBoundingRects=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},n.prototype.isOverflowing=function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing},n}(ks),js=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,As),this.define(t.Shape.ELLIPSE,Rs),this.define(t.Shape.RECT,Bs),this.define(t.Shape.IMAGE,Ds),this.define(t.Shape.LINE,Gs),this.define(t.Shape.GROUP,Ls),this.define(t.Shape.PATH,_s),this.define(t.Shape.POLYGON,Us),this.define(t.Shape.POLYLINE,Fs),this.define(t.Shape.TEXT,Vs),this.define(t.Shape.HTML,Is)}return e.prototype.define=function(t,e){this.registry[t]=e},e.prototype.get=function(t){return this.registry[t]},e}(),Ys={number:function(t){return new Ln(t)},percent:function(t){return new Ln(t,"%")},px:function(t){return new Ln(t,"px")},em:function(t){return new Ln(t,"em")},rem:function(t){return new Ln(t,"rem")},deg:function(t){return new Ln(t,"deg")},grad:function(t){return new Ln(t,"grad")},rad:function(t){return new Ln(t,"rad")},turn:function(t){return new Ln(t,"turn")},s:function(t){return new Ln(t,"s")},ms:function(t){return new Ln(t,"ms")},registerProperty:function(t){hs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){hs.layoutRegistry.registerLayout(t,e)}},Hs=function(e){function n(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new hs.AnimationTimeline(n)}catch(t){}var r={};return oo.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=Bt(n)?n(t.Shape.GROUP):n)})),n.documentElement=new Ls({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return pt(n,e),Object.defineProperty(n.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),n.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Vs:Ls);var r=new n(e);return r.ownerDocument=this,r},n.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},n.prototype.cloneNode=function(t){throw Error(Ut)},n.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},n.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},n.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},n.prototype.elementFromPoint=function(t,e){return gt(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,l,h;return mt(this,(function(p){switch(p.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,0>r||0>i||r>a||i>s?[2,null]:(u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,l=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:l},picked:[]})]);case 1:return[2,(h=p.sent().picked)&&h[0]||this.documentElement]}}))}))},n.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},n.prototype.elementsFromPoint=function(t,e){return gt(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,l,h;return mt(this,(function(p){switch(p.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,0>r||0>i||r>a||i>s?[2,[]]:(u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,l=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:l},picked:[]})]);case 1:return(h=p.sent().picked)[h.length-1]!==this.documentElement&&h.push(this.documentElement),[2,h]}}))}))},n.prototype.appendChild=function(t,e){throw Error(Ft)},n.prototype.insertBefore=function(t,e){throw Error(Ft)},n.prototype.removeChild=function(t,e){throw Error(Ft)},n.prototype.replaceChild=function(t,e,n){throw Error(Ft)},n.prototype.append=function(){throw Error(Ft)},n.prototype.prepend=function(){throw Error(Ft)},n.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},n.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},n.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.prototype.find=function(t){return this.documentElement.find(t)},n.prototype.findAll=function(t){return this.documentElement.findAll(t)},n}(wa),Xs=function(){function e(t){this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,o=n.renderingContext,a=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===a.length?o.unculledEntities.indexOf(e.entity)>-1:a.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new Sa(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.forEach((function(t){t.cullable.visibilityPlaneMask=-1}))}))},e.tag="Culling",e}(),Ws=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new ba(null),this.rootWheelEvent=new Ma(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var s=t.normalizeToPointerEvent(e,a);try{for(var u=xt(s),c=u.next();!c.done;c=u.next()){var l=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(l)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,s=t.normalizeToPointerEvent(e,a);try{for(var u=xt(s),c=u.next();!c.done;c=u.next()){var l=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(l)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=xt(o),s=a.next();!s.done;s=a.next()){var u=n.bootstrapEvent(n.rootPointerEvent,s.value,i,t);n.context.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(o,t)?"":"outside",s=n.normalizeToPointerEvent(t,i);try{for(var u=xt(s),c=u.next();!c.done;c=u.next()){var l=n.bootstrapEvent(n.rootPointerEvent,c.value,i,t);l.type+=a,n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=xt(o),s=a.next();!s.done;s=a.next()){var u=n.bootstrapEvent(n.rootPointerEvent,s.value,i,t);n.context.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.y;t.viewport.x=i.x,t.viewport.y=o;var a=this.context.eventService.viewport2Canvas(t.viewport),s=a.y;return t.canvas.x=a.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Do[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Go.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];te(i.button)&&(i.button=0),te(i.buttons)&&(i.buttons=1),te(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),te(i.width)&&(i.width=i.radiusX||1),te(i.height)&&(i.height=i.radiusY||1),te(i.tiltX)&&(i.tiltX=0),te(i.tiltY)&&(i.tiltY=0),te(i.pointerType)&&(i.pointerType="touch"),te(i.pointerId)&&(i.pointerId=i.identifier||0),te(i.pressure)&&(i.pressure=i.force||.5),te(i.twist)&&(i.twist=0),te(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;te(o.isPrimary)&&(o.isPrimary=!0),te(o.width)&&(o.width=1),te(o.height)&&(o.height=1),te(o.tiltX)&&(o.tiltX=0),te(o.tiltY)&&(o.tiltY=0),te(o.pointerType)&&(o.pointerType="mouse"),te(o.pointerId)&&(o.pointerId=1),te(o.pressure)&&(o.pressure=.5),te(o.twist)&&(o.twist=0),te(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),zs=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],qs=function(){function e(){}return e.prototype.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(Lt.isEmpty(a))return!1;var s=e.getFrustum(),u=null===(i=null===(r=n.parentNode)||void 0===r?void 0:r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,u||t.Mask.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==t.Mask.OUTSIDE,o.visible},e.prototype.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=zs.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,p=l.distance;if(0>H(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>H(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}(),Zs=function(){function e(){this.toSync=new Set,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return e.prototype.apply=function(n){var r,i=this,o=n.renderingService,a=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var s=function(t){t.target.renderable.dirty=!0,o.dirtify()},u=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){i.toSync.add(t)}));for(var n=e;n;)n.renderable&&i.toSync.add(n),n=n.parentElement;o.dirtify()},c=function(t){var e=t.target;hs.enableSizeAttenuation&&hs.styleValueRegistry.updateSizeAttenuation(e,a.getCamera().getZoom()),hs.enableCSSParsing&&hs.styleValueRegistry.recalc(e),e.renderable.rendered&&hs.sceneGraphService.dirtifyToRoot(e),o.dirtify()},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&i.rBush.remove(n.aabb),i.toSync.delete(e),hs.sceneGraphService.dirtifyToRoot(e),o.dirtify()};o.hooks.init.tap(e.tag,(function(){a.addEventListener(t.ElementEvent.MOUNTED,c),a.addEventListener(t.ElementEvent.UNMOUNTED,l),a.addEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.addEventListener(t.ElementEvent.BOUNDS_CHANGED,u)})),o.hooks.destroy.tap(e.tag,(function(){a.removeEventListener(t.ElementEvent.MOUNTED,c),a.removeEventListener(t.ElementEvent.UNMOUNTED,l),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,u),i.toSync.clear()}));var h=null!==(r=hs.globalThis.requestIdleCallback)&&void 0!==r?r:Wo.bind(hs.globalThis);o.hooks.endFrame.tap(e.tag,(function(){var t=n.renderingService.frame;2===t?(i.syncing=!0,h((function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0}))):t>2&&i.syncRTree(),i.toSync.forEach((function(t){return t.renderable.rendered=!0}))}))},e.prototype.syncRTree=function(t){var e=this;if(void 0===t&&(t=!1),t||!this.syncing&&0!==this.toSync.size){this.syncing=!0;var n=[];this.toSync.forEach((function(r){if(r.isConnected){var i=r.rBushNode;i.aabb&&e.rBush.remove(i.aabb);var o=r.getRenderBounds();if(o){var a=r.renderable;t&&(a.dirtyRenderBounds||(a.dirtyRenderBounds=new Lt),a.dirtyRenderBounds.update(o.center,o.halfExtents));var s=Et(o.getMin(),2),u=s[0],c=s[1],l=Et(o.getMax(),2),h=l[0],p=l[1];i.aabb||(i.aabb={}),i.aabb.displayObject=r,i.aabb.minX=u,i.aabb.minY=c,i.aabb.maxX=h,i.aabb.maxY=p}i.aabb&&(isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||n.push(i.aabb))}})),this.rBush.load(n),n.length=0,this.toSync.clear(),this.syncing=!1}},e.tag="Prepare",e}();t.CanvasEvent=void 0,(Es=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Es.BEFORE_RENDER="beforerender",Es.RERENDER="rerender",Es.AFTER_RENDER="afterrender",Es.BEFORE_DESTROY="beforedestroy",Es.AFTER_DESTROY="afterdestroy",Es.RESIZE="resize",Es.DIRTY_RECTANGLE="dirtyrectangle",Es.RENDERER_CHANGED="rendererchanged";var $s=new Sa(t.ElementEvent.MOUNTED),Ks=new Sa(t.ElementEvent.UNMOUNTED),Qs=new Sa(t.CanvasEvent.BEFORE_RENDER),Js=new Sa(t.CanvasEvent.RERENDER),tu=new Sa(t.CanvasEvent.AFTER_RENDER),eu=function(e){function n(t){var n=e.call(this)||this;n.Element=ks,n.inited=!1,n.context={},n.document=new Hs,n.document.defaultView=n,n.customElements=new js;var r=t.container,i=t.canvas,o=t.offscreenCanvas,a=t.width,s=t.height,u=t.devicePixelRatio,c=t.renderer,l=t.background,h=t.cursor,p=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,y=t.createImage,v=t.supportsPointerEvents,g=t.supportsTouchEvents,m=t.supportsCSSTransform,x=t.fastCleanExistingCanvas,E=t.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,M=t.isTouchEvent,S=t.isMouseEvent,T=t.dblClickSpeed;t.supportsMutipleCanvasesInOneContainer||function(t,e,n){if(t){var r="string"==typeof t?t:t.id||ko++;Co[r]&&Co[r].destroy(!0,!!n),Co[r]=e}}(r,n,x);var P=a,w=s,N=u;return i&&(N=1>(N=u||Ao&&window.devicePixelRatio||1)?1:Math.ceil(N),P=a||function(t){var e=Io(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/N,w=s||function(t){var e=Io(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/N),o&&(hs.offscreenCanvas=o),n.devicePixelRatio=N,n.requestAnimationFrame=null!=f?f:Wo.bind(hs.globalThis),n.cancelAnimationFrame=null!=d?d:zo.bind(hs.globalThis),n.supportsTouchEvents=null!=g?g:"ontouchstart"in hs.globalThis,n.supportsPointerEvents=null!=v?v:!!hs.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof hs.globalThis.TouchEvent},n.isMouseEvent=null!=S?S:function(t){return!hs.globalThis.MouseEvent||t instanceof hs.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof hs.globalThis.PointerEvent))},n.dblClickSpeed=null!=T?T:200,n.initRenderingContext({container:r,canvas:i,width:P,height:w,renderer:c,offscreenCanvas:o,devicePixelRatio:N,cursor:h||"default",background:l||"transparent",createImage:y,document:p,supportsCSSTransform:m,useNativeClickEvent:E,alwaysTriggerPointerEventOnCanvas:b,fastCleanExistingCanvas:x}),n.initDefaultCamera(P,w,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return pt(n,e),n.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},n.prototype.initDefaultCamera=function(e,n,r){var i=this,o=new hs.CameraContribution;o.clipSpaceNearZ=r,o.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),o.canvas=this,o.eventEmitter.on(ln.UPDATED,(function(){i.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED),hs.enableSizeAttenuation&&i.getConfig().renderer.getConfig().enableSizeAttenuation&&i.updateSizeAttenuation()})),this.context.camera=o},n.prototype.updateSizeAttenuation=function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){hs.styleValueRegistry.updateSizeAttenuation(e,t)}))},n.prototype.getConfig=function(){return this.context.config},n.prototype.getRoot=function(){return this.document.documentElement},n.prototype.getCamera=function(){return this.context.camera},n.prototype.getContextService=function(){return this.context.contextService},n.prototype.getEventService=function(){return this.context.eventService},n.prototype.getRenderingService=function(){return this.context.renderingService},n.prototype.getRenderingContext=function(){return this.context.renderingContext},n.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(n.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),n.prototype.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=this.getConfig().fastCleanExistingCanvas),n||this.dispatchEvent(new Sa(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new Sa(t.CanvasEvent.AFTER_DESTROY))},n.prototype.changeSize=function(t,e){this.resize(t,e)},n.prototype.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new Sa(t.CanvasEvent.RESIZE,{width:e,height:n}))},n.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},n.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},n.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},n.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},n.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},n.prototype.render=function(t){var e=this;t&&(Qs.detail=t,tu.detail=t),this.dispatchEvent(Qs),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(Js)})),this.dispatchEvent(tu)},n.prototype.run=function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()},n.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new lt,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Ws,new Zs,new Xs([new qs])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(yt(yt({},hs),this.context)),this.context.renderingService=new Aa(hs,this.context),this.context.eventService=new Na(hs,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},n.prototype.initRenderingService=function(e,n,r){var i=this;void 0===n&&(n=!1),void 0===r&&(r=!1),this.context.renderingService.init((function(){i.inited=!0,n?r?i.requestAnimationFrame((function(){i.dispatchEvent(new Sa(t.CanvasEvent.READY))})):i.dispatchEvent(new Sa(t.CanvasEvent.READY)):i.dispatchEvent(new Sa(t.CanvasEvent.RENDERER_CHANGED)),i.readyPromise&&i.resolveReadyPromise(),n||i.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),i.mountChildren(i.getRoot()),e.getConfig().enableAutoRendering&&i.run()}))},n.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(hs)}))},n.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),bt([],Et(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(hs)})),this.initRenderer(t)}},n.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},n.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(this.getConfig().fastCleanExistingCanvas||(t.isMutationObserved?t.dispatchEvent(Ks):(Ks.target=t,this.dispatchEvent(Ks,!0))),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},n.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent($s):($s.target=t,this.dispatchEvent($s,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},n.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},n.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},n.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},n.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},n.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},n.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},n}(Pa);t.AABB=Lt,t.AbstractRenderer=St,t.AbstractRendererPlugin=Mt,t.BUILT_IN_PROPERTIES=oo,t.CSS=Ys,t.CSSGradientValue=Mn,t.CSSKeywordValue=Sn,t.CSSRGB=Gn,t.CSSStyleValue=En,t.CSSUnitValue=Ln,t.Camera=pn,t.CameraEvent=ln,t.Canvas=eu,t.Circle=As,t.CircleUpdater=la,t.CustomElement=Os,t.CustomElementRegistry=js,t.CustomEvent=Sa,t.DefaultSceneGraphSelector=Ra,t.DefaultSceneGraphService=os,t.DisplayObject=ks,t.Document=Hs,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=Ut,t.Element=ms,t.Ellipse=Rs,t.EllipseUpdater=ha,t.EventService=Na,t.EventTarget=Pa,t.FederatedEvent=xa,t.FederatedMouseEvent=Ea,t.FederatedPointerEvent=ba,t.FederatedWheelEvent=Ma,t.Frustum=Dt,t.Group=Ls,t.GroupUpdater=ga,t.HTML=Is,t.HTMLUpdater=ma,t.Image=Ds,t.Line=Gs,t.LineUpdater=pa,t.MutationEvent=La,t.Node=wa,t.OffscreenCanvasCreator=Ca,t.Path=_s,t.PathUpdater=fa,t.Plane=It,t.Point=Gt,t.Polygon=Us,t.Polyline=Fs,t.PolylineUpdater=da,t.RBush=lt,t.Rect=Bs,t.RectUpdater=ya,t.Rectangle=_t,t.RenderingService=Aa,t.Text=Vs,t.TextService=ls,t.TextUpdater=va,t.computeLinearGradient=function(t,e,n,r){var i=Ve(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}},t.computeRadialGradient=function(e,n,r,i,o,a){var s=i.value,u=o.value;i.unit===t.UnitType.kPercentage&&(s=i.value/100*n),o.unit===t.UnitType.kPercentage&&(u=o.value/100*r);var c=Math.max(Te([0,0],[s,u]),Te([0,r],[s,u]),Te([n,r],[s,u]),Te([n,0],[s,u]));return a&&(a instanceof Ln?c=a.value:a instanceof Sn&&("closest-side"===a.value?c=Math.min(s,n-s,u,r-u):"farthest-side"===a.value?c=Math.max(s,n-s,u,r-u):"closest-corner"===a.value&&(c=Math.min(Te([0,0],[s,u]),Te([0,r],[s,u]),Te([n,r],[s,u]),Te([n,0],[s,u]))))),{x:s+e[0],y:u+e[1],r:c}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle,o=i.x1,a=i.y1,s=i.x2,u=i.y2;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===o?0:o,void 0===a?0:a,void 0===s?0:s,void 0===u?0:u);break;case t.Shape.CIRCLE:var c=e.parsedStyle,l=c.r,h=void 0===l?0:l,p=c.cx,f=c.cy;r=Ri(h,h,void 0===p?0:p,void 0===f?0:f);break;case t.Shape.ELLIPSE:var d=e.parsedStyle,y=d.rx,v=d.ry,g=d.cx,m=d.cy;r=Ri(void 0===y?0:y,void 0===v?0:v,void 0===g?0:g,void 0===m?0:m);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var x=e.parsedStyle,E=x.width,b=void 0===E?0:E,M=x.height,S=void 0===M?0:M,T=x.x,P=void 0===T?0:T,w=x.y,N=void 0===w?0:w,C=x.radius,k=C&&C.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=Et(i,4),a=o[0],s=o[1],u=o[2],c=o[3],l=t>0?1:-1,h=e>0?1:-1,p=l+h!==0?1:0;return[["M",l*a+n,r],["L",t-l*s+n,r],s?["A",s,s,0,0,p,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,p,t+n-l*u,e+r]:null,["L",n+l*c,e+r],c?["A",c,c,0,0,p,n,e+r-h*c]:null,["L",n,h*a+r],a?["A",a,a,0,0,p,l*a+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(b,S,P,N,k&&C.map((function(t){return qt(t,0,Math.min(Math.abs(b)/2,Math.abs(S)/2))})));break;case t.Shape.PATH:r=bt([],Et(e.parsedStyle.d.absolutePath),!1)}if(r.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=_(e[1],e[2],0);n&&W(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=_(e[1],e[2],0),a=_(e[3],e[4],0),s=_(e[5],e[6],0);n&&(W(o,o,n),W(a,a,n),W(s,s,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=_(e[6],e[7],0);n&&W(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else"Q"===e[0]&&(o=_(e[1],e[2],0),a=_(e[3],e[4],0),n&&(W(o,o,n),W(a,a,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(r,0,n)},t.createVec3=Fe,t.decompose=qe,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==Et(t,2)[1]})))},t.deg2rad=Ve,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=Lo,t.fromRotationTranslationScale=ze,t.getAngle=_e,t.getEuler=We,t.getOrCalculatePathTotalLength=bi,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.isBrowser=Ao,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Ur,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=xs,t.isFillOrStrokeAffected=function(t,e,n){void 0===t&&(t="auto");var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=_r,t.mergeColors=Br,t.parseColor=Fr,t.parseLength=Yr,t.parsePath=Di,t.parseTransform=Xi,t.parsedTransformToMat4=oa,t.propertyMetadataCache=so,t.rad2deg=Ye,t.resetEntityCounter=function(){ds=0},t.runtime=hs,t.setDOMSize=function(t,e,n){Ao&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i){void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0);var o=t.map((function(o,a){var s=t[a+1],u=0===a&&(0!==e||0!==n),c=(a===t.length-1||s&&("M"===s[0]||"Z"===s[0]))&&0!==r&&0!==i;switch(o[0]){case"M":return u?"M ".concat(o[1]+e,",").concat(o[2]+n," L ").concat(o[1],",").concat(o[2]):"M ".concat(o[1],",").concat(o[2]);case"L":return"L ".concat(o[1]+(c?r:0),",").concat(o[2]+(c?i:0));case"Q":return"Q ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4])+(c?" L ".concat(o[3]+r,",").concat(o[4]+i):"");case"C":return"C ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4],",").concat(o[5]," ").concat(o[6])+(c?" L ".concat(o[5]+r,",").concat(o[6]+i):"");case"A":return"A ".concat(o[1]," ").concat(o[2]," ").concat(o[3]," ").concat(o[4]," ").concat(o[5]," ").concat(o[6]," ").concat(o[7])+(c?" L ".concat(o[6]+r,",").concat(o[7]+i):"");case"Z":return"Z"}})).join(" ");return~o.indexOf("NaN")?"":o},t.turn2deg=He}));
2
2
  //# sourceMappingURL=index.umd.min.js.map