zigbee2mqtt-windfront 1.7.0 → 1.8.1

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 (222) hide show
  1. package/dist/assets/{About-DUcioXxf.js → About-BWrcA8qQ.js} +2 -2
  2. package/dist/assets/About-BWrcA8qQ.js.br +0 -0
  3. package/dist/assets/{Availability-Dv4Ph0Ye.js → Availability-D1dLU87I.js} +1 -1
  4. package/dist/assets/Availability-D1dLU87I.js.br +0 -0
  5. package/dist/assets/Bind-D1v_YvyA.js +1 -0
  6. package/dist/assets/Bind-D1v_YvyA.js.br +0 -0
  7. package/dist/assets/Bridge-BrYjUYbo.js +1 -0
  8. package/dist/assets/Bridge-BrYjUYbo.js.br +0 -0
  9. package/dist/assets/{CheckboxField-Dx2QxjzC.js → CheckboxField-DGeXHkdI.js} +1 -1
  10. package/dist/assets/CheckboxField-DGeXHkdI.js.br +0 -0
  11. package/dist/assets/{ClusterSinglePicker-DNRhvOBp.js → ClusterSinglePicker-XKCAlJUJ.js} +1 -1
  12. package/dist/assets/ClusterSinglePicker-XKCAlJUJ.js.br +0 -0
  13. package/dist/assets/{Clusters-BE_4RC5f.js → Clusters-Bs7V9b_E.js} +1 -1
  14. package/dist/assets/Clusters-Bs7V9b_E.js.br +0 -0
  15. package/dist/assets/{Dashboard-D7evBMoe.js → Dashboard-pa4xB_EA.js} +1 -1
  16. package/dist/assets/Dashboard-pa4xB_EA.js.br +0 -0
  17. package/dist/assets/{DashboardFeatureWrapper-BCosdUvy.js → DashboardFeatureWrapper-BYrtY7HX.js} +1 -1
  18. package/dist/assets/DashboardFeatureWrapper-BYrtY7HX.js.br +0 -0
  19. package/dist/assets/{DebouncedInput-Z7O3YrBh.js → DebouncedInput-BSs73uaO.js} +1 -1
  20. package/dist/assets/DebouncedInput-BSs73uaO.js.br +0 -0
  21. package/dist/assets/DevConsole-B1CEDFS6.js +1 -0
  22. package/dist/assets/DevConsole-B1CEDFS6.js.br +0 -0
  23. package/dist/assets/DevConsole-DzhRu7kl.js +20 -0
  24. package/dist/assets/DevConsole-DzhRu7kl.js.br +0 -0
  25. package/dist/assets/{DeviceCard-DCId-Vs8.js → DeviceCard-B-MslgxW.js} +1 -1
  26. package/dist/assets/DeviceCard-B-MslgxW.js.br +0 -0
  27. package/dist/assets/DeviceControlEditName-m82lnyr9.js +1 -0
  28. package/dist/assets/DeviceControlEditName-m82lnyr9.js.br +0 -0
  29. package/dist/assets/DeviceImage-DL3nWYo3.js +1 -0
  30. package/dist/assets/DeviceImage-DL3nWYo3.js.br +0 -0
  31. package/dist/assets/{DeviceInfo-CZRw9zfL.js → DeviceInfo-BBRyyGYy.js} +2 -2
  32. package/dist/assets/DeviceInfo-BBRyyGYy.js.br +0 -0
  33. package/dist/assets/DevicePage-jGsdfE2a.js +2 -0
  34. package/dist/assets/DevicePage-jGsdfE2a.js.br +0 -0
  35. package/dist/assets/{DevicePicker-xS0T9qul.js → DevicePicker-CxYjky2Z.js} +1 -1
  36. package/dist/assets/DevicePicker-CxYjky2Z.js.br +0 -0
  37. package/dist/assets/{DeviceSettings-IoZbTphm.js → DeviceSettings-CxqEPckE.js} +1 -1
  38. package/dist/assets/DeviceSettings-CxqEPckE.js.br +0 -0
  39. package/dist/assets/DeviceSpecificSettings-yq2AvjNF.js +1 -0
  40. package/dist/assets/DeviceSpecificSettings-yq2AvjNF.js.br +0 -0
  41. package/dist/assets/Devices-8slkLcEd.js +1 -0
  42. package/dist/assets/Devices-8slkLcEd.js.br +0 -0
  43. package/dist/assets/{DevicesPage-CVqifZXT.js → DevicesPage-Dgj0SUNO.js} +1 -1
  44. package/dist/assets/DevicesPage-Dgj0SUNO.js.br +0 -0
  45. package/dist/assets/{DisplayValue-C55voi8G.js → DisplayValue-E8sajbsC.js} +1 -1
  46. package/dist/assets/DisplayValue-E8sajbsC.js.br +0 -0
  47. package/dist/assets/{Donate-9qZhLZau.js → Donate-BO7Z7hUr.js} +1 -1
  48. package/dist/assets/Donate-BO7Z7hUr.js.br +0 -0
  49. package/dist/assets/{EndpointPicker-DuGNCPo-.js → EndpointPicker-DaqpKjl3.js} +1 -1
  50. package/dist/assets/EndpointPicker-DaqpKjl3.js.br +0 -0
  51. package/dist/assets/Exposes-CKueBwT9.js +1 -0
  52. package/dist/assets/Exposes-CKueBwT9.js.br +0 -0
  53. package/dist/assets/Feature-BzaXaUES.js +1 -0
  54. package/dist/assets/Feature-BzaXaUES.js.br +0 -0
  55. package/dist/assets/{Frontend-BnyqZoL6.js → Frontend-B2I3Z2yo.js} +1 -1
  56. package/dist/assets/Frontend-B2I3Z2yo.js.br +0 -0
  57. package/dist/assets/{GroupPage-DA95yJf-.js → GroupPage-BywX_Lbd.js} +2 -2
  58. package/dist/assets/GroupPage-BywX_Lbd.js.br +0 -0
  59. package/dist/assets/GroupSettings-DUPxP4Lf.js +1 -0
  60. package/dist/assets/GroupSettings-DUPxP4Lf.js.br +0 -0
  61. package/dist/assets/{Groups-Dnuylsi8.js → Groups-C7jeWZeH.js} +1 -1
  62. package/dist/assets/Groups-C7jeWZeH.js.br +0 -0
  63. package/dist/assets/{GroupsPage-DphLoexz.js → GroupsPage-Du8LTLJf.js} +1 -1
  64. package/dist/assets/GroupsPage-Du8LTLJf.js.br +0 -0
  65. package/dist/assets/{Health-k9TFUygX.js → Health-BMcXjGsM.js} +1 -1
  66. package/dist/assets/Health-BMcXjGsM.js.br +0 -0
  67. package/dist/assets/{HomePage-CK6NM-T-.js → HomePage-Cm9MXKhj.js} +1 -1
  68. package/dist/assets/HomePage-Cm9MXKhj.js.br +0 -0
  69. package/dist/assets/{InputField-CUhAi55r.js → InputField-D7F4rh-6.js} +1 -1
  70. package/dist/assets/InputField-D7F4rh-6.js.br +0 -0
  71. package/dist/assets/{Json-CSdW868a.js → Json-CIlquCLk.js} +1 -1
  72. package/dist/assets/Json-CIlquCLk.js.br +0 -0
  73. package/dist/assets/{LastSeen-BWjXmUSJ.js → LastSeen-hXPhBVem.js} +1 -1
  74. package/dist/assets/LastSeen-hXPhBVem.js.br +0 -0
  75. package/dist/assets/LogsPage-BWPvuwAK.js +1 -0
  76. package/dist/assets/LogsPage-BWPvuwAK.js.br +0 -0
  77. package/dist/assets/Lqi-OIJirhdX.js +1 -0
  78. package/dist/assets/Lqi-OIJirhdX.js.br +0 -0
  79. package/dist/assets/NetworkPage-CeYM0kNC.js +2 -0
  80. package/dist/assets/NetworkPage-CeYM0kNC.js.br +0 -0
  81. package/dist/assets/{NumberField-Bu5IU0l2.js → NumberField-DBq58GHS.js} +1 -1
  82. package/dist/assets/NumberField-DBq58GHS.js.br +0 -0
  83. package/dist/assets/OtaPage-2i6uXP6o.js +1 -0
  84. package/dist/assets/OtaPage-2i6uXP6o.js.br +0 -0
  85. package/dist/assets/{PowerSource-BV6oqaaB.js → PowerSource-pdM840jV.js} +1 -1
  86. package/dist/assets/PowerSource-pdM840jV.js.br +0 -0
  87. package/dist/assets/{RawNetworkData-DAbMk6t_.js → RawNetworkData-DmEzjMKR.js} +1 -1
  88. package/dist/assets/RawNetworkData-DmEzjMKR.js.br +0 -0
  89. package/dist/assets/{RawNetworkMap-DcUDlHgQ.js → RawNetworkMap-m-jI3ov-.js} +30 -30
  90. package/dist/assets/RawNetworkMap-m-jI3ov-.js.br +0 -0
  91. package/dist/assets/{RecallRemove-CrxvayYk.js → RecallRemove-WoSCq7mT.js} +1 -1
  92. package/dist/assets/RecallRemove-WoSCq7mT.js.br +0 -0
  93. package/dist/assets/Reporting-DMIJKWCI.js +1 -0
  94. package/dist/assets/Reporting-DMIJKWCI.js.br +0 -0
  95. package/dist/assets/Scene-BZa630sw.js +1 -0
  96. package/dist/assets/Scene-BZa630sw.js.br +2 -0
  97. package/dist/assets/{SelectField-Ca16rphE.js → SelectField-Do2InTFr.js} +1 -1
  98. package/dist/assets/SelectField-Do2InTFr.js.br +0 -0
  99. package/dist/assets/Settings-DPny-0Rt.js +1 -0
  100. package/dist/assets/Settings-DPny-0Rt.js.br +0 -0
  101. package/dist/assets/SettingsList-DsVgWKy3.js +1 -0
  102. package/dist/assets/SettingsList-DsVgWKy3.js.br +0 -0
  103. package/dist/assets/{SettingsPage-CyWJ3spU.js → SettingsPage-Cx4nWHRr.js} +2 -2
  104. package/dist/assets/SettingsPage-Cx4nWHRr.js.br +0 -0
  105. package/dist/assets/State-De2K3QBu.js +1 -0
  106. package/dist/assets/State-De2K3QBu.js.br +2 -0
  107. package/dist/assets/{Table-7bVWMaUR.js → Table-BpnEzjLb.js} +1 -1
  108. package/dist/assets/Table-BpnEzjLb.js.br +0 -0
  109. package/dist/assets/{TextareaField-DP_hdh3q.js → TextareaField-xwbu8YKo.js} +1 -1
  110. package/dist/assets/TextareaField-xwbu8YKo.js.br +0 -0
  111. package/dist/assets/Tools-McB1jYZ-.js +1 -0
  112. package/dist/assets/Tools-McB1jYZ-.js.br +0 -0
  113. package/dist/assets/TouchlinkPage-BKfeLLii.js +1 -0
  114. package/dist/assets/TouchlinkPage-BKfeLLii.js.br +0 -0
  115. package/dist/assets/{VendorLink-CH3XJ5NJ.js → VendorLink-DE4QCH9H.js} +1 -1
  116. package/dist/assets/VendorLink-DE4QCH9H.js.br +0 -0
  117. package/dist/assets/{_createCompounder-DOVBRgWx.js → _createCompounder-CfkIxP4I.js} +1 -1
  118. package/dist/assets/_createCompounder-CfkIxP4I.js.br +0 -0
  119. package/dist/assets/{format-B4QuVfKv.js → format-Bbg3coak.js} +1 -1
  120. package/dist/assets/format-Bbg3coak.js.br +0 -0
  121. package/dist/assets/{index-DTwwc0px.js → index-DDBxKamc.js} +1 -1
  122. package/dist/assets/index-DDBxKamc.js.br +0 -0
  123. package/dist/assets/index-pzWGL0cK.js +637 -0
  124. package/dist/assets/index-pzWGL0cK.js.br +0 -0
  125. package/dist/assets/{jszip.min-DLJrQ4fd.js → jszip.min-CB2ooJ__.js} +1 -1
  126. package/dist/assets/jszip.min-CB2ooJ__.js.br +0 -0
  127. package/dist/assets/shallow-BvOtxUf5.js +1 -0
  128. package/dist/assets/shallow-BvOtxUf5.js.br +0 -0
  129. package/dist/assets/snakeCase-CUh04m27.js +1 -0
  130. package/dist/assets/snakeCase-CUh04m27.js.br +0 -0
  131. package/dist/index.html +1 -1
  132. package/dist/index.html.br +0 -0
  133. package/package.json +4 -5
  134. package/dist/assets/About-DUcioXxf.js.br +0 -0
  135. package/dist/assets/Availability-Dv4Ph0Ye.js.br +0 -0
  136. package/dist/assets/Bind-CZsitKJf.js +0 -1
  137. package/dist/assets/Bind-CZsitKJf.js.br +0 -0
  138. package/dist/assets/Bridge-BBUz-kJW.js +0 -1
  139. package/dist/assets/Bridge-BBUz-kJW.js.br +0 -0
  140. package/dist/assets/CheckboxField-Dx2QxjzC.js.br +0 -0
  141. package/dist/assets/ClusterSinglePicker-DNRhvOBp.js.br +0 -0
  142. package/dist/assets/Clusters-BE_4RC5f.js.br +0 -0
  143. package/dist/assets/Dashboard-D7evBMoe.js.br +0 -0
  144. package/dist/assets/DashboardFeatureWrapper-BCosdUvy.js.br +0 -0
  145. package/dist/assets/DebouncedInput-Z7O3YrBh.js.br +0 -0
  146. package/dist/assets/DevConsole-C81rFSZS.js +0 -20
  147. package/dist/assets/DevConsole-C81rFSZS.js.br +0 -0
  148. package/dist/assets/DevConsole-CZhPDzNO.js +0 -1
  149. package/dist/assets/DevConsole-CZhPDzNO.js.br +0 -0
  150. package/dist/assets/DeviceCard-DCId-Vs8.js.br +0 -5
  151. package/dist/assets/DeviceControlEditName-BxC1B1Qj.js +0 -1
  152. package/dist/assets/DeviceControlEditName-BxC1B1Qj.js.br +0 -0
  153. package/dist/assets/DeviceImage-BGLcF_MT.js +0 -1
  154. package/dist/assets/DeviceImage-BGLcF_MT.js.br +0 -0
  155. package/dist/assets/DeviceInfo-CZRw9zfL.js.br +0 -0
  156. package/dist/assets/DevicePage-Bm-xmwWe.js +0 -2
  157. package/dist/assets/DevicePage-Bm-xmwWe.js.br +0 -0
  158. package/dist/assets/DevicePicker-xS0T9qul.js.br +0 -0
  159. package/dist/assets/DeviceSettings-IoZbTphm.js.br +0 -0
  160. package/dist/assets/DeviceSpecificSettings-CHDH7O4h.js +0 -1
  161. package/dist/assets/DeviceSpecificSettings-CHDH7O4h.js.br +0 -0
  162. package/dist/assets/Devices-CG9ex5aM.js +0 -1
  163. package/dist/assets/Devices-CG9ex5aM.js.br +0 -0
  164. package/dist/assets/DevicesPage-CVqifZXT.js.br +0 -0
  165. package/dist/assets/DisplayValue-C55voi8G.js.br +0 -0
  166. package/dist/assets/Donate-9qZhLZau.js.br +0 -0
  167. package/dist/assets/EndpointPicker-DuGNCPo-.js.br +0 -1
  168. package/dist/assets/Exposes-Bbzl-29y.js +0 -1
  169. package/dist/assets/Exposes-Bbzl-29y.js.br +0 -2
  170. package/dist/assets/Feature-BZc2FS2v.js +0 -1
  171. package/dist/assets/Feature-BZc2FS2v.js.br +0 -0
  172. package/dist/assets/Frontend-BnyqZoL6.js.br +0 -0
  173. package/dist/assets/GroupPage-DA95yJf-.js.br +0 -0
  174. package/dist/assets/GroupSettings-Bmjsrlz9.js +0 -1
  175. package/dist/assets/GroupSettings-Bmjsrlz9.js.br +0 -0
  176. package/dist/assets/Groups-Dnuylsi8.js.br +0 -0
  177. package/dist/assets/GroupsPage-DphLoexz.js.br +0 -0
  178. package/dist/assets/Health-k9TFUygX.js.br +0 -0
  179. package/dist/assets/HomePage-CK6NM-T-.js.br +0 -0
  180. package/dist/assets/InputField-CUhAi55r.js.br +0 -3
  181. package/dist/assets/Json-CSdW868a.js.br +0 -0
  182. package/dist/assets/LastSeen-BWjXmUSJ.js.br +0 -0
  183. package/dist/assets/LogsPage-3OuRzpPD.js +0 -1
  184. package/dist/assets/LogsPage-3OuRzpPD.js.br +0 -0
  185. package/dist/assets/Lqi-CkhLMJ19.js +0 -1
  186. package/dist/assets/Lqi-CkhLMJ19.js.br +0 -0
  187. package/dist/assets/NetworkPage-D5gqpXsU.js +0 -2
  188. package/dist/assets/NetworkPage-D5gqpXsU.js.br +0 -0
  189. package/dist/assets/NumberField-Bu5IU0l2.js.br +0 -0
  190. package/dist/assets/OtaPage-r9Gto8-D.js +0 -1
  191. package/dist/assets/OtaPage-r9Gto8-D.js.br +0 -0
  192. package/dist/assets/PowerSource-BV6oqaaB.js.br +0 -0
  193. package/dist/assets/RawNetworkData-DAbMk6t_.js.br +0 -0
  194. package/dist/assets/RawNetworkMap-DcUDlHgQ.js.br +0 -0
  195. package/dist/assets/RecallRemove-CrxvayYk.js.br +0 -0
  196. package/dist/assets/Reporting-VXUgdiP4.js +0 -1
  197. package/dist/assets/Reporting-VXUgdiP4.js.br +0 -0
  198. package/dist/assets/Scene-BwaNCcX2.js +0 -1
  199. package/dist/assets/Scene-BwaNCcX2.js.br +0 -0
  200. package/dist/assets/SelectField-Ca16rphE.js.br +0 -0
  201. package/dist/assets/Settings-VzG6rJhJ.js +0 -1
  202. package/dist/assets/Settings-VzG6rJhJ.js.br +0 -0
  203. package/dist/assets/SettingsList-FVZvadEn.js +0 -1
  204. package/dist/assets/SettingsList-FVZvadEn.js.br +0 -0
  205. package/dist/assets/SettingsPage-CyWJ3spU.js.br +0 -0
  206. package/dist/assets/State-khkziclY.js +0 -1
  207. package/dist/assets/State-khkziclY.js.br +0 -0
  208. package/dist/assets/Table-7bVWMaUR.js.br +0 -0
  209. package/dist/assets/TextareaField-DP_hdh3q.js.br +0 -0
  210. package/dist/assets/Tools-CvTVTFeR.js +0 -1
  211. package/dist/assets/Tools-CvTVTFeR.js.br +0 -0
  212. package/dist/assets/TouchlinkPage-CFVn2b5R.js +0 -1
  213. package/dist/assets/TouchlinkPage-CFVn2b5R.js.br +0 -0
  214. package/dist/assets/VendorLink-CH3XJ5NJ.js.br +0 -0
  215. package/dist/assets/_createCompounder-DOVBRgWx.js.br +0 -0
  216. package/dist/assets/format-B4QuVfKv.js.br +0 -1
  217. package/dist/assets/index-BccmZcnH.js +0 -645
  218. package/dist/assets/index-BccmZcnH.js.br +0 -0
  219. package/dist/assets/index-DTwwc0px.js.br +0 -0
  220. package/dist/assets/jszip.min-DLJrQ4fd.js.br +0 -0
  221. package/dist/assets/snakeCase-DyM1sm95.js +0 -1
  222. package/dist/assets/snakeCase-DyM1sm95.js.br +0 -0
@@ -1,4 +1,4 @@
1
- import{aB as Nx,ah as vo,aC as uo,r as Z,j as ue,aD as HU,b as bg,t as VU,F as Yn,a3 as WU,B as Lr,aE as XU,aF as jU,aG as qU,aH as YU,aI as ZU,aJ as KU,aK as JU,aL as QU,aM as $U,aN as tu,aO as eO,aP as tO,aQ as nO,aR as iO,aS as Iv,a as rO,s as vs,aT as WS,aU as XS,aV as jS,aW as qS,aX as YS,ay as sO}from"./index-BccmZcnH.js";import{g as aO,a as oO}from"./index-DTwwc0px.js";import{E as bl,Z as ni,N as nm,c as uh}from"./index-Bs7zcW7e.js";import"./envs-CRUy-_iG.js";/**
1
+ import{at as Nx,a9 as vo,au as GU,aq as uo,r as Z,j as ue,av as HU,b as bg,t as VU,F as Yn,Y as WU,B as Lr,aw as XU,ax as jU,ay as qU,az as YU,aA as ZU,aB as KU,aC as JU,aD as QU,aE as $U,aF as tu,aG as eO,aH as tO,aI as nO,aJ as iO,aK as Iv,a as rO,s as vs,aL as WS,aM as XS,aN as jS,aO as qS,aP as YS,ap as sO}from"./index-pzWGL0cK.js";import{g as aO,a as oO}from"./index-DDBxKamc.js";import{E as bl,Z as ni,N as nm,c as uh}from"./index-Bs7zcW7e.js";import"./envs-CRUy-_iG.js";/**
2
2
  * @license
3
3
  * Copyright 2010-2025 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
@@ -3848,7 +3848,7 @@ void main() {
3848
3848
  *
3849
3849
  * This source code is licensed under the MIT license found in the
3850
3850
  * LICENSE file in the root directory of this source tree.
3851
- */var DM;function w4(){if(DM)return Ay;DM=1;var i=Nx(),e=M4();function t(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=i.useRef,a=i.useEffect,o=i.useMemo,l=i.useDebugValue;return Ay.useSyncExternalStoreWithSelector=function(c,f,d,p,m){var v=s(null);if(v.current===null){var x={hasValue:!1,value:null};v.current=x}else x=v.current;v=o(function(){function g(T){if(!b){if(b=!0,S=T,T=p(T),m!==void 0&&x.hasValue){var C=x.value;if(m(C,T))return E=C}return E=T}if(C=E,n(S,T))return C;var U=p(T);return m!==void 0&&m(C,U)?(S=T,C):(S=T,E=U)}var b=!1,S,E,w=d===void 0?null:d;return[function(){return g(f())},w===null?void 0:function(){return g(w())}]},[f,d,p,m]);var _=r(c,v[0],v[1]);return a(function(){x.hasValue=!0,x.value=_},[_]),l(_),_},Ay}var UM;function T4(){return UM||(UM=1,Ty.exports=w4()),Ty.exports}var A4=T4();const C4=vo(A4),OM=i=>{let e;const t=new Set,n=(c,f)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const p=e;e=f??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,o={setState:n,getState:r,getInitialState:()=>l,subscribe:c=>(t.add(c),()=>t.delete(c))},l=e=i(n,r,o);return o},SC=i=>i?OM(i):OM,{useSyncExternalStoreWithSelector:R4}=C4,D4=i=>i;function U4(i,e=D4,t){const n=R4(i.subscribe,i.getState,i.getInitialState,e,t);return uo.useDebugValue(n),n}const LM=(i,e)=>{const t=SC(i),n=(r,s=e)=>U4(t,r,s);return Object.assign(n,t),n},O4=(i,e)=>i?LM(i,e):LM;var Dy={exports:{}},Uy={exports:{}},Oy={exports:{}},Ly={};/**
3851
+ */var DM;function w4(){if(DM)return Ay;DM=1;var i=Nx(),e=M4();function t(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=i.useRef,a=i.useEffect,o=i.useMemo,l=i.useDebugValue;return Ay.useSyncExternalStoreWithSelector=function(c,f,d,p,m){var v=s(null);if(v.current===null){var x={hasValue:!1,value:null};v.current=x}else x=v.current;v=o(function(){function g(T){if(!b){if(b=!0,S=T,T=p(T),m!==void 0&&x.hasValue){var C=x.value;if(m(C,T))return E=C}return E=T}if(C=E,n(S,T))return C;var U=p(T);return m!==void 0&&m(C,U)?(S=T,C):(S=T,E=U)}var b=!1,S,E,w=d===void 0?null:d;return[function(){return g(f())},w===null?void 0:function(){return g(w())}]},[f,d,p,m]);var _=r(c,v[0],v[1]);return a(function(){x.hasValue=!0,x.value=_},[_]),l(_),_},Ay}var UM;function T4(){return UM||(UM=1,Ty.exports=w4()),Ty.exports}var A4=T4();const C4=vo(A4),{useSyncExternalStoreWithSelector:R4}=C4,D4=i=>i;function U4(i,e=D4,t){const n=R4(i.subscribe,i.getState,i.getInitialState,e,t);return uo.useDebugValue(n),n}const OM=(i,e)=>{const t=GU(i),n=(r,s=e)=>U4(t,r,s);return Object.assign(n,t),n},O4=(i,e)=>i?OM(i,e):OM;var Dy={exports:{}},Uy={exports:{}},Oy={exports:{}},Ly={};/**
3852
3852
  * @license React
3853
3853
  * scheduler.production.js
3854
3854
  *
@@ -3856,7 +3856,7 @@ void main() {
3856
3856
  *
3857
3857
  * This source code is licensed under the MIT license found in the
3858
3858
  * LICENSE file in the root directory of this source tree.
3859
- */var NM;function L4(){return NM||(NM=1,function(i){function e(P,L){var k=P.length;P.push(L);e:for(;0<k;){var H=k-1>>>1,W=P[H];if(0<r(W,L))P[H]=L,P[k]=W,k=H;else break e}}function t(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var L=P[0],k=P.pop();if(k!==L){P[0]=k;e:for(var H=0,W=P.length,F=W>>>1;H<F;){var Y=2*(H+1)-1,K=P[Y],j=Y+1,J=P[j];if(0>r(K,k))j<W&&0>r(J,K)?(P[H]=J,P[j]=k,H=j):(P[H]=K,P[Y]=k,H=Y);else if(j<W&&0>r(J,k))P[H]=J,P[j]=k,H=j;else break e}}return L}function r(P,L){var k=P.sortIndex-L.sortIndex;return k!==0?k:P.id-L.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();i.unstable_now=function(){return a.now()-o}}var l=[],c=[],f=1,d=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function S(P){for(var L=t(c);L!==null;){if(L.callback===null)n(c);else if(L.startTime<=P)n(c),L.sortIndex=L.expirationTime,e(l,L);else break;L=t(c)}}function E(P){if(x=!1,S(P),!v)if(t(l)!==null)v=!0,V();else{var L=t(c);L!==null&&ee(E,L.startTime-P)}}var w=!1,T=-1,C=5,U=-1;function D(){return!(i.unstable_now()-U<C)}function R(){if(w){var P=i.unstable_now();U=P;var L=!0;try{e:{v=!1,x&&(x=!1,g(T),T=-1),m=!0;var k=p;try{t:{for(S(P),d=t(l);d!==null&&!(d.expirationTime>P&&D());){var H=d.callback;if(typeof H=="function"){d.callback=null,p=d.priorityLevel;var W=H(d.expirationTime<=P);if(P=i.unstable_now(),typeof W=="function"){d.callback=W,S(P),L=!0;break t}d===t(l)&&n(l),S(P)}else n(l);d=t(l)}if(d!==null)L=!0;else{var F=t(c);F!==null&&ee(E,F.startTime-P),L=!1}}break e}finally{d=null,p=k,m=!1}L=void 0}}finally{L?I():w=!1}}}var I;if(typeof b=="function")I=function(){b(R)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,O=z.port2;z.port1.onmessage=R,I=function(){O.postMessage(null)}}else I=function(){_(R,0)};function V(){w||(w=!0,I())}function ee(P,L){T=_(function(){P(i.unstable_now())},L)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(P){P.callback=null},i.unstable_continueExecution=function(){v||m||(v=!0,V())},i.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<P?Math.floor(1e3/P):5},i.unstable_getCurrentPriorityLevel=function(){return p},i.unstable_getFirstCallbackNode=function(){return t(l)},i.unstable_next=function(P){switch(p){case 1:case 2:case 3:var L=3;break;default:L=p}var k=p;p=L;try{return P()}finally{p=k}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(P,L){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var k=p;p=P;try{return L()}finally{p=k}},i.unstable_scheduleCallback=function(P,L,k){var H=i.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?H+k:H):k=H,P){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=k+W,P={id:f++,callback:L,priorityLevel:P,startTime:k,expirationTime:W,sortIndex:-1},k>H?(P.sortIndex=k,e(c,P),t(l)===null&&P===t(c)&&(x?(g(T),T=-1):x=!0,ee(E,k-H))):(P.sortIndex=W,e(l,P),v||m||(v=!0,V())),P},i.unstable_shouldYield=D,i.unstable_wrapCallback=function(P){var L=p;return function(){var k=p;p=L;try{return P.apply(this,arguments)}finally{p=k}}}}(Ly)),Ly}var IM;function N4(){return IM||(IM=1,Oy.exports=L4()),Oy.exports}/**
3859
+ */var LM;function L4(){return LM||(LM=1,function(i){function e(P,L){var k=P.length;P.push(L);e:for(;0<k;){var H=k-1>>>1,W=P[H];if(0<r(W,L))P[H]=L,P[k]=W,k=H;else break e}}function t(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var L=P[0],k=P.pop();if(k!==L){P[0]=k;e:for(var H=0,W=P.length,F=W>>>1;H<F;){var Y=2*(H+1)-1,K=P[Y],j=Y+1,J=P[j];if(0>r(K,k))j<W&&0>r(J,K)?(P[H]=J,P[j]=k,H=j):(P[H]=K,P[Y]=k,H=Y);else if(j<W&&0>r(J,k))P[H]=J,P[j]=k,H=j;else break e}}return L}function r(P,L){var k=P.sortIndex-L.sortIndex;return k!==0?k:P.id-L.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();i.unstable_now=function(){return a.now()-o}}var l=[],c=[],f=1,d=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function S(P){for(var L=t(c);L!==null;){if(L.callback===null)n(c);else if(L.startTime<=P)n(c),L.sortIndex=L.expirationTime,e(l,L);else break;L=t(c)}}function E(P){if(x=!1,S(P),!v)if(t(l)!==null)v=!0,V();else{var L=t(c);L!==null&&ee(E,L.startTime-P)}}var w=!1,T=-1,C=5,U=-1;function D(){return!(i.unstable_now()-U<C)}function R(){if(w){var P=i.unstable_now();U=P;var L=!0;try{e:{v=!1,x&&(x=!1,g(T),T=-1),m=!0;var k=p;try{t:{for(S(P),d=t(l);d!==null&&!(d.expirationTime>P&&D());){var H=d.callback;if(typeof H=="function"){d.callback=null,p=d.priorityLevel;var W=H(d.expirationTime<=P);if(P=i.unstable_now(),typeof W=="function"){d.callback=W,S(P),L=!0;break t}d===t(l)&&n(l),S(P)}else n(l);d=t(l)}if(d!==null)L=!0;else{var F=t(c);F!==null&&ee(E,F.startTime-P),L=!1}}break e}finally{d=null,p=k,m=!1}L=void 0}}finally{L?I():w=!1}}}var I;if(typeof b=="function")I=function(){b(R)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,O=z.port2;z.port1.onmessage=R,I=function(){O.postMessage(null)}}else I=function(){_(R,0)};function V(){w||(w=!0,I())}function ee(P,L){T=_(function(){P(i.unstable_now())},L)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(P){P.callback=null},i.unstable_continueExecution=function(){v||m||(v=!0,V())},i.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<P?Math.floor(1e3/P):5},i.unstable_getCurrentPriorityLevel=function(){return p},i.unstable_getFirstCallbackNode=function(){return t(l)},i.unstable_next=function(P){switch(p){case 1:case 2:case 3:var L=3;break;default:L=p}var k=p;p=L;try{return P()}finally{p=k}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(P,L){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var k=p;p=P;try{return L()}finally{p=k}},i.unstable_scheduleCallback=function(P,L,k){var H=i.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?H+k:H):k=H,P){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=k+W,P={id:f++,callback:L,priorityLevel:P,startTime:k,expirationTime:W,sortIndex:-1},k>H?(P.sortIndex=k,e(c,P),t(l)===null&&P===t(c)&&(x?(g(T),T=-1):x=!0,ee(E,k-H))):(P.sortIndex=W,e(l,P),v||m||(v=!0,V())),P},i.unstable_shouldYield=D,i.unstable_wrapCallback=function(P){var L=p;return function(){var k=p;p=L;try{return P.apply(this,arguments)}finally{p=k}}}}(Ly)),Ly}var NM;function N4(){return NM||(NM=1,Oy.exports=L4()),Oy.exports}/**
3860
3860
  * @license React
3861
3861
  * react-reconciler.production.js
3862
3862
  *
@@ -3864,18 +3864,18 @@ void main() {
3864
3864
  *
3865
3865
  * This source code is licensed under the MIT license found in the
3866
3866
  * LICENSE file in the root directory of this source tree.
3867
- */var PM;function I4(){return PM||(PM=1,function(i){i.exports=function(e){function t(u,h,y,M){return new sD(u,h,y,M)}function n(){}function r(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(u){return u===null||typeof u!="object"?null:(u=uS&&u[uS]||u["@@iterator"],typeof u=="function"?u:null)}function a(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===hD?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case Ql:return"Fragment";case Jl:return"Portal";case nv:return"Profiler";case oS:return"StrictMode";case rv:return"Suspense";case sv:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case Ba:return(u.displayName||"Context")+".Provider";case lS:return(u._context.displayName||"Context")+".Consumer";case iv:var h=u.render;return u=u.displayName,u||(u=h.displayName||h.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case av:return h=u.displayName||null,h!==null?h:a(u.type)||"Memo";case ka:h=u._payload,u=u._init;try{return a(u(h))}catch{}}return null}function o(u){if(ov===void 0)try{throw Error()}catch(y){var h=y.stack.trim().match(/\n( *(at )?)/);ov=h&&h[1]||"",hS=-1<y.stack.indexOf(`
3867
+ */var IM;function I4(){return IM||(IM=1,function(i){i.exports=function(e){function t(u,h,y,M){return new rD(u,h,y,M)}function n(){}function r(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(u){return u===null||typeof u!="object"?null:(u=uS&&u[uS]||u["@@iterator"],typeof u=="function"?u:null)}function a(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===uD?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case Ql:return"Fragment";case Jl:return"Portal";case nv:return"Profiler";case oS:return"StrictMode";case rv:return"Suspense";case sv:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case Ba:return(u.displayName||"Context")+".Provider";case lS:return(u._context.displayName||"Context")+".Consumer";case iv:var h=u.render;return u=u.displayName,u||(u=h.displayName||h.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case av:return h=u.displayName||null,h!==null?h:a(u.type)||"Memo";case ka:h=u._payload,u=u._init;try{return a(u(h))}catch{}}return null}function o(u){if(ov===void 0)try{throw Error()}catch(y){var h=y.stack.trim().match(/\n( *(at )?)/);ov=h&&h[1]||"",hS=-1<y.stack.indexOf(`
3868
3868
  at`)?" (<anonymous>)":-1<y.stack.indexOf("@")?"@unknown:0:0":""}return`
3869
3869
  `+ov+u+hS}function l(u,h){if(!u||lv)return"";lv=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var M={DetermineComponentFrameRoot:function(){try{if(h){var ot=function(){throw Error()};if(Object.defineProperty(ot.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ot,[])}catch(Rt){var ht=Rt}Reflect.construct(u,[],ot)}else{try{ot.call()}catch(Rt){ht=Rt}u.call(ot.prototype)}}else{try{throw Error()}catch(Rt){ht=Rt}(ot=u())&&typeof ot.catch=="function"&&ot.catch(function(){})}}catch(Rt){if(Rt&&ht&&typeof Rt.stack=="string")return[Rt.stack,ht.stack]}return[null,null]}};M.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var A=Object.getOwnPropertyDescriptor(M.DetermineComponentFrameRoot,"name");A&&A.configurable&&Object.defineProperty(M.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=M.DetermineComponentFrameRoot(),$=N[0],ae=N[1];if($&&ae){var Ee=$.split(`
3870
3870
  `),ke=ae.split(`
3871
3871
  `);for(A=M=0;M<Ee.length&&!Ee[M].includes("DetermineComponentFrameRoot");)M++;for(;A<ke.length&&!ke[A].includes("DetermineComponentFrameRoot");)A++;if(M===Ee.length||A===ke.length)for(M=Ee.length-1,A=ke.length-1;1<=M&&0<=A&&Ee[M]!==ke[A];)A--;for(;1<=M&&0<=A;M--,A--)if(Ee[M]!==ke[A]){if(M!==1||A!==1)do if(M--,A--,0>A||Ee[M]!==ke[A]){var Ye=`
3872
3872
  `+Ee[M].replace(" at new "," at ");return u.displayName&&Ye.includes("<anonymous>")&&(Ye=Ye.replace("<anonymous>",u.displayName)),Ye}while(1<=M&&0<=A);break}}}finally{lv=!1,Error.prepareStackTrace=y}return(y=u?u.displayName||u.name:"")?o(y):""}function c(u){switch(u.tag){case 26:case 27:case 5:return o(u.type);case 16:return o("Lazy");case 13:return o("Suspense");case 19:return o("SuspenseList");case 0:case 15:return u=l(u.type,!1),u;case 11:return u=l(u.type.render,!1),u;case 1:return u=l(u.type,!0),u;default:return""}}function f(u){try{var h="";do h+=c(u),u=u.return;while(u);return h}catch(y){return`
3873
3873
  Error generating stack: `+y.message+`
3874
- `+y.stack}}function d(u){var h=u,y=u;if(u.alternate)for(;h.return;)h=h.return;else{u=h;do h=u,(h.flags&4098)!==0&&(y=h.return),u=h.return;while(u)}return h.tag===3?y:null}function p(u){if(d(u)!==u)throw Error(r(188))}function m(u){var h=u.alternate;if(!h){if(h=d(u),h===null)throw Error(r(188));return h!==u?null:u}for(var y=u,M=h;;){var A=y.return;if(A===null)break;var N=A.alternate;if(N===null){if(M=A.return,M!==null){y=M;continue}break}if(A.child===N.child){for(N=A.child;N;){if(N===y)return p(A),u;if(N===M)return p(A),h;N=N.sibling}throw Error(r(188))}if(y.return!==M.return)y=A,M=N;else{for(var $=!1,ae=A.child;ae;){if(ae===y){$=!0,y=A,M=N;break}if(ae===M){$=!0,M=A,y=N;break}ae=ae.sibling}if(!$){for(ae=N.child;ae;){if(ae===y){$=!0,y=N,M=A;break}if(ae===M){$=!0,M=N,y=A;break}ae=ae.sibling}if(!$)throw Error(r(189))}}if(y.alternate!==M)throw Error(r(190))}if(y.tag!==3)throw Error(r(188));return y.stateNode.current===y?u:h}function v(u){var h=u.tag;if(h===5||h===26||h===27||h===6)return u;for(u=u.child;u!==null;){if(h=v(u),h!==null)return h;u=u.sibling}return null}function x(u){var h=u.tag;if(h===5||h===26||h===27||h===6)return u;for(u=u.child;u!==null;){if(u.tag!==4&&(h=x(u),h!==null))return h;u=u.sibling}return null}function _(u){return{current:u}}function g(u){0>ec||(u.current=pv[ec],pv[ec]=null,ec--)}function b(u,h){ec++,pv[ec]=u.current,u.current=h}function S(u){return u>>>=0,u===0?32:31-(TU(u)/AU|0)|0}function E(u){var h=u&42;if(h!==0)return h;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function w(u,h){var y=u.pendingLanes;if(y===0)return 0;var M=0,A=u.suspendedLanes,N=u.pingedLanes,$=u.warmLanes;u=u.finishedLanes!==0;var ae=y&134217727;return ae!==0?(y=ae&~A,y!==0?M=E(y):(N&=ae,N!==0?M=E(N):u||($=ae&~$,$!==0&&(M=E($))))):(ae=y&~A,ae!==0?M=E(ae):N!==0?M=E(N):u||($=y&~$,$!==0&&(M=E($)))),M===0?0:h!==0&&h!==M&&(h&A)===0&&(A=M&-M,$=h&-h,A>=$||A===32&&($&4194176)!==0)?h:M}function T(u,h){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&h)===0}function C(u,h){switch(u){case 1:case 2:case 4:case 8:return h+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U(){var u=Ed;return Ed<<=1,(Ed&4194176)===0&&(Ed=128),u}function D(){var u=Md;return Md<<=1,(Md&62914560)===0&&(Md=4194304),u}function R(u){for(var h=[],y=0;31>y;y++)h.push(u);return h}function I(u,h){u.pendingLanes|=h,h!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function z(u,h,y,M,A,N){var $=u.pendingLanes;u.pendingLanes=y,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=y,u.entangledLanes&=y,u.errorRecoveryDisabledLanes&=y,u.shellSuspendCounter=0;var ae=u.entanglements,Ee=u.expirationTimes,ke=u.hiddenUpdates;for(y=$&~y;0<y;){var Ye=31-ur(y),ot=1<<Ye;ae[Ye]=0,Ee[Ye]=-1;var ht=ke[Ye];if(ht!==null)for(ke[Ye]=null,Ye=0;Ye<ht.length;Ye++){var Rt=ht[Ye];Rt!==null&&(Rt.lane&=-536870913)}y&=~ot}M!==0&&O(u,M,0),N!==0&&A===0&&u.tag!==0&&(u.suspendedLanes|=N&~($&~h))}function O(u,h,y){u.pendingLanes|=h,u.suspendedLanes&=~h;var M=31-ur(h);u.entangledLanes|=h,u.entanglements[M]=u.entanglements[M]|1073741824|y&4194218}function V(u,h){var y=u.entangledLanes|=h;for(u=u.entanglements;y;){var M=31-ur(y),A=1<<M;A&h|u[M]&h&&(u[M]|=h),y&=~A}}function ee(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function P(u){if(hr&&typeof hr.onCommitFiberRoot=="function")try{hr.onCommitFiberRoot(Qu,u,void 0,(u.current.flags&128)===128)}catch{}}function L(u){if(typeof OU=="function"&&LU(u),hr&&typeof hr.setStrictMode=="function")try{hr.setStrictMode(Qu,u)}catch{}}function k(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}function H(u,h){if(typeof u=="object"&&u!==null){var y=zS.get(u);return y!==void 0?y:(h={value:u,source:h,stack:f(h)},zS.set(u,h),h)}return{value:u,source:h,stack:f(h)}}function W(u,h){nc[ic++]=Ad,nc[ic++]=Td,Td=u,Ad=h}function F(u,h,y){wr[Tr++]=js,wr[Tr++]=qs,wr[Tr++]=Fo,Fo=u;var M=js;u=qs;var A=32-ur(M)-1;M&=~(1<<A),y+=1;var N=32-ur(h)+A;if(30<N){var $=A-A%5;N=(M&(1<<$)-1).toString(32),M>>=$,A-=$,js=1<<32-ur(h)+A|y<<A|M,qs=N+u}else js=1<<N|y<<A|M,qs=u}function Y(u){u.return!==null&&(W(u,1),F(u,1,0))}function K(u){for(;u===Td;)Td=nc[--ic],nc[ic]=null,Ad=nc[--ic],nc[ic]=null;for(;u===Fo;)Fo=wr[--Tr],wr[Tr]=null,qs=wr[--Tr],wr[Tr]=null,js=wr[--Tr],wr[Tr]=null}function j(u,h){b(Ha,h),b($u,u),b(mi,null),u=pD(h),g(mi),b(mi,u)}function J(){g(mi),g($u),g(Ha)}function he(u){u.memoizedState!==null&&b(Cd,u);var h=mi.current,y=mD(h,u.type);h!==y&&(b($u,u),b(mi,y))}function re(u){$u.current===u&&(g(mi),g($u)),Cd.current===u&&(g(Cd),Xs?zo._currentValue=$l:zo._currentValue2=$l)}function pe(u){var h=Error(r(418,""));throw Ne(H(h,u)),vv}function Oe(u,h){if(!Er)throw Error(r(175));lU(u.stateNode,u.type,u.memoizedProps,h,u)||pe(u)}function be(u){for(Ii=u.return;Ii;)switch(Ii.tag){case 3:case 27:ds=!0;return;case 5:case 13:ds=!1;return;default:Ii=Ii.return}}function ve(u){if(!Er||u!==Ii)return!1;if(!jt)return be(u),jt=!0,!1;var h=!1;if(Mi?u.tag!==3&&u.tag!==27&&(u.tag!==5||TS(u.type)&&!Sd(u.type,u.memoizedProps))&&(h=!0):u.tag!==3&&(u.tag!==5||TS(u.type)&&!Sd(u.type,u.memoizedProps))&&(h=!0),h&&wi&&pe(u),be(u),u.tag===13){if(!Er)throw Error(r(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));wi=hU(u)}else wi=Ii?MS(u.stateNode):null;return!0}function ce(){Er&&(wi=Ii=null,jt=!1)}function Ne(u){Yr===null?Yr=[u]:Yr.push(u)}function G(){for(var u=rc,h=yv=rc=0;h<u;){var y=Ar[h];Ar[h++]=null;var M=Ar[h];Ar[h++]=null;var A=Ar[h];Ar[h++]=null;var N=Ar[h];if(Ar[h++]=null,M!==null&&A!==null){var $=M.pending;$===null?A.next=A:(A.next=$.next,$.next=A),M.pending=A}N!==0&&oe(y,A,N)}}function le(u,h,y,M){Ar[rc++]=u,Ar[rc++]=h,Ar[rc++]=y,Ar[rc++]=M,yv|=M,u.lanes|=M,u=u.alternate,u!==null&&(u.lanes|=M)}function te(u,h,y,M){return le(u,h,y,M),De(u)}function Me(u,h){return le(u,null,null,h),De(u)}function oe(u,h,y){u.lanes|=y;var M=u.alternate;M!==null&&(M.lanes|=y);for(var A=!1,N=u.return;N!==null;)N.childLanes|=y,M=N.alternate,M!==null&&(M.childLanes|=y),N.tag===22&&(u=N.stateNode,u===null||u._visibility&1||(A=!0)),u=N,N=N.return;A&&h!==null&&u.tag===3&&(N=u.stateNode,A=31-ur(y),N=N.hiddenUpdates,u=N[A],u===null?N[A]=[h]:u.push(h),h.lane=y|536870912)}function De(u){if(50<lh)throw lh=0,Nv=null,Error(r(185));for(var h=u.return;h!==null;)u=h,h=u.return;return u.tag===3?u.stateNode:null}function _e(u){u!==sc&&u.next===null&&(sc===null?Rd=sc=u:sc=sc.next=u),Dd=!0,_v||(_v=!0,Se(Be))}function ne(u,h){if(!xv&&Dd){xv=!0;do for(var y=!1,M=Rd;M!==null;){if(u!==0){var A=M.pendingLanes;if(A===0)var N=0;else{var $=M.suspendedLanes,ae=M.pingedLanes;N=(1<<31-ur(42|u)+1)-1,N&=A&~($&~ae),N=N&201326677?N&201326677|1:N?N|2:0}N!==0&&(y=!0,ie(M,N))}else N=Vt,N=w(M,M===hn?N:0),(N&3)===0||T(M,N)||(y=!0,ie(M,N));M=M.next}while(y);xv=!1}}function Be(){Dd=_v=!1;var u=0;ac!==0&&(ED()&&(u=ac),ac=0);for(var h=qr(),y=null,M=Rd;M!==null;){var A=M.next,N=X(M,h);N===0?(M.next=null,y===null?Rd=A:y.next=A,A===null&&(sc=y)):(y=M,(u!==0||(N&3)!==0)&&(Dd=!0)),M=A}ne(u)}function X(u,h){for(var y=u.suspendedLanes,M=u.pingedLanes,A=u.expirationTimes,N=u.pendingLanes&-62914561;0<N;){var $=31-ur(N),ae=1<<$,Ee=A[$];Ee===-1?((ae&y)===0||(ae&M)!==0)&&(A[$]=C(ae,h)):Ee<=h&&(u.expiredLanes|=ae),N&=~ae}if(h=hn,y=Vt,y=w(u,u===h?y:0),M=u.callbackNode,y===0||u===h&&fn===2||u.cancelPendingCommit!==null)return M!==null&&M!==null&&mv(M),u.callbackNode=null,u.callbackPriority=0;if((y&3)===0||T(u,y)){if(h=y&-y,h===u.callbackPriority)return h;switch(M!==null&&mv(M),ee(y)){case 2:case 8:y=DU;break;case 32:y=gv;break;case 268435456:y=UU;break;default:y=gv}return M=B.bind(null,u),y=wd(y,M),u.callbackPriority=h,u.callbackNode=y,h}return M!==null&&M!==null&&mv(M),u.callbackPriority=2,u.callbackNode=null,2}function B(u,h){var y=u.callbackNode;if(No()&&u.callbackNode!==y)return null;var M=Vt;return M=w(u,u===hn?M:0),M===0?null:(kb(u,M,h),X(u,qr()),u.callbackNode!=null&&u.callbackNode===y?B.bind(null,u):null)}function ie(u,h){if(No())return null;kb(u,h,!0)}function Se(u){RD?DD(function(){(ln&6)!==0?wd(PS,u):u()}):wd(PS,u)}function ge(){return ac===0&&(ac=U()),ac}function me(u,h){if(eh===null){var y=eh=[];bv=0,oc=ge(),lc={status:"pending",value:void 0,then:function(M){y.push(M)}}}return bv++,h.then(Fe,Fe),h}function Fe(){if(--bv===0&&eh!==null){lc!==null&&(lc.status="fulfilled");var u=eh;eh=null,oc=0,lc=null;for(var h=0;h<u.length;h++)(0,u[h])()}}function Ie(u,h){var y=[],M={status:"pending",value:null,reason:null,then:function(A){y.push(A)}};return u.then(function(){M.status="fulfilled",M.value=h;for(var A=0;A<y.length;A++)(0,y[A])(h)},function(A){for(M.status="rejected",M.reason=A,A=0;A<y.length;A++)(0,y[A])(void 0)}),M}function je(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ze(u,h){u=u.updateQueue,h.updateQueue===u&&(h.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function Ce(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function He(u,h,y){var M=u.updateQueue;if(M===null)return null;if(M=M.shared,(ln&2)!==0){var A=M.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),M.pending=h,h=De(u),oe(u,null,y),h}return le(u,M,h,y),De(u)}function Ve(u,h,y){if(h=h.updateQueue,h!==null&&(h=h.shared,(y&4194176)!==0)){var M=h.lanes;M&=u.pendingLanes,y|=M,h.lanes=y,V(u,y)}}function nt(u,h){var y=u.updateQueue,M=u.alternate;if(M!==null&&(M=M.updateQueue,y===M)){var A=null,N=null;if(y=y.firstBaseUpdate,y!==null){do{var $={lane:y.lane,tag:y.tag,payload:y.payload,callback:null,next:null};N===null?A=N=$:N=N.next=$,y=y.next}while(y!==null);N===null?A=N=h:N=N.next=h}else A=N=h;y={baseState:M.baseState,firstBaseUpdate:A,lastBaseUpdate:N,shared:M.shared,callbacks:M.callbacks},u.updateQueue=y;return}u=y.lastBaseUpdate,u===null?y.firstBaseUpdate=h:u.next=h,y.lastBaseUpdate=h}function We(){if(Sv){var u=lc;if(u!==null)throw u}}function ft(u,h,y,M){Sv=!1;var A=u.updateQueue;Va=!1;var N=A.firstBaseUpdate,$=A.lastBaseUpdate,ae=A.shared.pending;if(ae!==null){A.shared.pending=null;var Ee=ae,ke=Ee.next;Ee.next=null,$===null?N=ke:$.next=ke,$=Ee;var Ye=u.alternate;Ye!==null&&(Ye=Ye.updateQueue,ae=Ye.lastBaseUpdate,ae!==$&&(ae===null?Ye.firstBaseUpdate=ke:ae.next=ke,Ye.lastBaseUpdate=Ee))}if(N!==null){var ot=A.baseState;$=0,Ye=ke=Ee=null,ae=N;do{var ht=ae.lane&-536870913,Rt=ht!==ae.lane;if(Rt?(Vt&ht)===ht:(M&ht)===ht){ht!==0&&ht===oc&&(Sv=!0),Ye!==null&&(Ye=Ye.next={lane:0,tag:ae.tag,payload:ae.payload,callback:null,next:null});e:{var Dr=u,ch=ae;ht=h;var qo=y;switch(ch.tag){case 1:if(Dr=ch.payload,typeof Dr=="function"){ot=Dr.call(qo,ot,ht);break e}ot=Dr;break e;case 3:Dr.flags=Dr.flags&-65537|128;case 0:if(Dr=ch.payload,ht=typeof Dr=="function"?Dr.call(qo,ot,ht):Dr,ht==null)break e;ot=tv({},ot,ht);break e;case 2:Va=!0}}ht=ae.callback,ht!==null&&(u.flags|=64,Rt&&(u.flags|=8192),Rt=A.callbacks,Rt===null?A.callbacks=[ht]:Rt.push(ht))}else Rt={lane:ht,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},Ye===null?(ke=Ye=Rt,Ee=ot):Ye=Ye.next=Rt,$|=ht;if(ae=ae.next,ae===null){if(ae=A.shared.pending,ae===null)break;Rt=ae,ae=Rt.next,Rt.next=null,A.lastBaseUpdate=Rt,A.shared.pending=null}}while(!0);Ye===null&&(Ee=ot),A.baseState=Ee,A.firstBaseUpdate=ke,A.lastBaseUpdate=Ye,N===null&&(A.shared.lanes=0),ja|=$,u.lanes=$,u.memoizedState=ot}}function se(u,h){if(typeof u!="function")throw Error(r(191,u));u.call(h)}function ze(u,h){var y=u.callbacks;if(y!==null)for(u.callbacks=null,u=0;u<y.length;u++)se(y[u],h)}function Le(u,h){if(fr(u,h))return!0;if(typeof u!="object"||u===null||typeof h!="object"||h===null)return!1;var y=Object.keys(u),M=Object.keys(h);if(y.length!==M.length)return!1;for(M=0;M<y.length;M++){var A=y[M];if(!NU.call(h,A)||!fr(u[A],h[A]))return!1}return!0}function rt(u){return u=u.status,u==="fulfilled"||u==="rejected"}function Pe(){}function Re(u,h,y){switch(y=u[y],y===void 0?u.push(h):y!==h&&(h.then(Pe,Pe),h=y),h.status){case"fulfilled":return h.value;case"rejected":throw u=h.reason,u===th?Error(r(483)):u;default:if(typeof h.status=="string")h.then(Pe,Pe);else{if(u=hn,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=h,u.status="pending",u.then(function(M){if(h.status==="pending"){var A=h;A.status="fulfilled",A.value=M}},function(M){if(h.status==="pending"){var A=h;A.status="rejected",A.reason=M}})}switch(h.status){case"fulfilled":return h.value;case"rejected":throw u=h.reason,u===th?Error(r(483)):u}throw cc=h,th}}function Ke(){if(cc===null)throw Error(r(459));var u=cc;return cc=null,u}function st(u){var h=nh;return nh+=1,uc===null&&(uc=[]),Re(uc,u,h)}function at(u,h){h=h.props.ref,u.ref=h!==void 0?h:null}function mt(u,h){throw h.$$typeof===lD?Error(r(525)):(u=Object.prototype.toString.call(h),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":u)))}function Jt(u){var h=u._init;return h(u._payload)}function tn(u){function h(Te,xe){if(u){var Ue=Te.deletions;Ue===null?(Te.deletions=[xe],Te.flags|=16):Ue.push(xe)}}function y(Te,xe){if(!u)return null;for(;xe!==null;)h(Te,xe),xe=xe.sibling;return null}function M(Te){for(var xe=new Map;Te!==null;)Te.key!==null?xe.set(Te.key,Te):xe.set(Te.index,Te),Te=Te.sibling;return xe}function A(Te,xe){return Te=Fa(Te,xe),Te.index=0,Te.sibling=null,Te}function N(Te,xe,Ue){return Te.index=Ue,u?(Ue=Te.alternate,Ue!==null?(Ue=Ue.index,Ue<xe?(Te.flags|=33554434,xe):Ue):(Te.flags|=33554434,xe)):(Te.flags|=1048576,xe)}function $(Te){return u&&Te.alternate===null&&(Te.flags|=33554434),Te}function ae(Te,xe,Ue,qe){return xe===null||xe.tag!==6?(xe=Q0(Ue,Te.mode,qe),xe.return=Te,xe):(xe=A(xe,Ue),xe.return=Te,xe)}function Ee(Te,xe,Ue,qe){var vt=Ue.type;return vt===Ql?Ye(Te,xe,Ue.props.children,qe,Ue.key):xe!==null&&(xe.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===ka&&Jt(vt)===xe.type)?(xe=A(xe,Ue.props),at(xe,Ue),xe.return=Te,xe):(xe=_d(Ue.type,Ue.key,Ue.props,null,Te.mode,qe),at(xe,Ue),xe.return=Te,xe)}function ke(Te,xe,Ue,qe){return xe===null||xe.tag!==4||xe.stateNode.containerInfo!==Ue.containerInfo||xe.stateNode.implementation!==Ue.implementation?(xe=$0(Ue,Te.mode,qe),xe.return=Te,xe):(xe=A(xe,Ue.children||[]),xe.return=Te,xe)}function Ye(Te,xe,Ue,qe,vt){return xe===null||xe.tag!==7?(xe=Io(Ue,Te.mode,qe,vt),xe.return=Te,xe):(xe=A(xe,Ue),xe.return=Te,xe)}function ot(Te,xe,Ue){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return xe=Q0(""+xe,Te.mode,Ue),xe.return=Te,xe;if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case xd:return Ue=_d(xe.type,xe.key,xe.props,null,Te.mode,Ue),at(Ue,xe),Ue.return=Te,Ue;case Jl:return xe=$0(xe,Te.mode,Ue),xe.return=Te,xe;case ka:var qe=xe._init;return xe=qe(xe._payload),ot(Te,xe,Ue)}if(bd(xe)||s(xe))return xe=Io(xe,Te.mode,Ue,null),xe.return=Te,xe;if(typeof xe.then=="function")return ot(Te,st(xe),Ue);if(xe.$$typeof===Ba)return ot(Te,dd(Te,xe),Ue);mt(Te,xe)}return null}function ht(Te,xe,Ue,qe){var vt=xe!==null?xe.key:null;if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint")return vt!==null?null:ae(Te,xe,""+Ue,qe);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case xd:return Ue.key===vt?Ee(Te,xe,Ue,qe):null;case Jl:return Ue.key===vt?ke(Te,xe,Ue,qe):null;case ka:return vt=Ue._init,Ue=vt(Ue._payload),ht(Te,xe,Ue,qe)}if(bd(Ue)||s(Ue))return vt!==null?null:Ye(Te,xe,Ue,qe,null);if(typeof Ue.then=="function")return ht(Te,xe,st(Ue),qe);if(Ue.$$typeof===Ba)return ht(Te,xe,dd(Te,Ue),qe);mt(Te,Ue)}return null}function Rt(Te,xe,Ue,qe,vt){if(typeof qe=="string"&&qe!==""||typeof qe=="number"||typeof qe=="bigint")return Te=Te.get(Ue)||null,ae(xe,Te,""+qe,vt);if(typeof qe=="object"&&qe!==null){switch(qe.$$typeof){case xd:return Te=Te.get(qe.key===null?Ue:qe.key)||null,Ee(xe,Te,qe,vt);case Jl:return Te=Te.get(qe.key===null?Ue:qe.key)||null,ke(xe,Te,qe,vt);case ka:var gn=qe._init;return qe=gn(qe._payload),Rt(Te,xe,Ue,qe,vt)}if(bd(qe)||s(qe))return Te=Te.get(Ue)||null,Ye(xe,Te,qe,vt,null);if(typeof qe.then=="function")return Rt(Te,xe,Ue,st(qe),vt);if(qe.$$typeof===Ba)return Rt(Te,xe,Ue,dd(xe,qe),vt);mt(xe,qe)}return null}function Dr(Te,xe,Ue,qe){for(var vt=null,gn=null,St=xe,qt=xe=0,hi=null;St!==null&&qt<Ue.length;qt++){St.index>qt?(hi=St,St=null):hi=St.sibling;var Yt=ht(Te,St,Ue[qt],qe);if(Yt===null){St===null&&(St=hi);break}u&&St&&Yt.alternate===null&&h(Te,St),xe=N(Yt,xe,qt),gn===null?vt=Yt:gn.sibling=Yt,gn=Yt,St=hi}if(qt===Ue.length)return y(Te,St),jt&&W(Te,qt),vt;if(St===null){for(;qt<Ue.length;qt++)St=ot(Te,Ue[qt],qe),St!==null&&(xe=N(St,xe,qt),gn===null?vt=St:gn.sibling=St,gn=St);return jt&&W(Te,qt),vt}for(St=M(St);qt<Ue.length;qt++)hi=Rt(St,Te,qt,Ue[qt],qe),hi!==null&&(u&&hi.alternate!==null&&St.delete(hi.key===null?qt:hi.key),xe=N(hi,xe,qt),gn===null?vt=hi:gn.sibling=hi,gn=hi);return u&&St.forEach(function(Ya){return h(Te,Ya)}),jt&&W(Te,qt),vt}function ch(Te,xe,Ue,qe){if(Ue==null)throw Error(r(151));for(var vt=null,gn=null,St=xe,qt=xe=0,hi=null,Yt=Ue.next();St!==null&&!Yt.done;qt++,Yt=Ue.next()){St.index>qt?(hi=St,St=null):hi=St.sibling;var Ya=ht(Te,St,Yt.value,qe);if(Ya===null){St===null&&(St=hi);break}u&&St&&Ya.alternate===null&&h(Te,St),xe=N(Ya,xe,qt),gn===null?vt=Ya:gn.sibling=Ya,gn=Ya,St=hi}if(Yt.done)return y(Te,St),jt&&W(Te,qt),vt;if(St===null){for(;!Yt.done;qt++,Yt=Ue.next())Yt=ot(Te,Yt.value,qe),Yt!==null&&(xe=N(Yt,xe,qt),gn===null?vt=Yt:gn.sibling=Yt,gn=Yt);return jt&&W(Te,qt),vt}for(St=M(St);!Yt.done;qt++,Yt=Ue.next())Yt=Rt(St,Te,qt,Yt.value,qe),Yt!==null&&(u&&Yt.alternate!==null&&St.delete(Yt.key===null?qt:Yt.key),xe=N(Yt,xe,qt),gn===null?vt=Yt:gn.sibling=Yt,gn=Yt);return u&&St.forEach(function(GU){return h(Te,GU)}),jt&&W(Te,qt),vt}function qo(Te,xe,Ue,qe){if(typeof Ue=="object"&&Ue!==null&&Ue.type===Ql&&Ue.key===null&&(Ue=Ue.props.children),typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case xd:e:{for(var vt=Ue.key;xe!==null;){if(xe.key===vt){if(vt=Ue.type,vt===Ql){if(xe.tag===7){y(Te,xe.sibling),qe=A(xe,Ue.props.children),qe.return=Te,Te=qe;break e}}else if(xe.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===ka&&Jt(vt)===xe.type){y(Te,xe.sibling),qe=A(xe,Ue.props),at(qe,Ue),qe.return=Te,Te=qe;break e}y(Te,xe);break}else h(Te,xe);xe=xe.sibling}Ue.type===Ql?(qe=Io(Ue.props.children,Te.mode,qe,Ue.key),qe.return=Te,Te=qe):(qe=_d(Ue.type,Ue.key,Ue.props,null,Te.mode,qe),at(qe,Ue),qe.return=Te,Te=qe)}return $(Te);case Jl:e:{for(vt=Ue.key;xe!==null;){if(xe.key===vt)if(xe.tag===4&&xe.stateNode.containerInfo===Ue.containerInfo&&xe.stateNode.implementation===Ue.implementation){y(Te,xe.sibling),qe=A(xe,Ue.children||[]),qe.return=Te,Te=qe;break e}else{y(Te,xe);break}else h(Te,xe);xe=xe.sibling}qe=$0(Ue,Te.mode,qe),qe.return=Te,Te=qe}return $(Te);case ka:return vt=Ue._init,Ue=vt(Ue._payload),qo(Te,xe,Ue,qe)}if(bd(Ue))return Dr(Te,xe,Ue,qe);if(s(Ue)){if(vt=s(Ue),typeof vt!="function")throw Error(r(150));return Ue=vt.call(Ue),ch(Te,xe,Ue,qe)}if(typeof Ue.then=="function")return qo(Te,xe,st(Ue),qe);if(Ue.$$typeof===Ba)return qo(Te,xe,dd(Te,Ue),qe);mt(Te,Ue)}return typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint"?(Ue=""+Ue,xe!==null&&xe.tag===6?(y(Te,xe.sibling),qe=A(xe,Ue),qe.return=Te,Te=qe):(y(Te,xe),qe=Q0(Ue,Te.mode,qe),qe.return=Te,Te=qe),$(Te)):y(Te,xe)}return function(Te,xe,Ue,qe){try{nh=0;var vt=qo(Te,xe,Ue,qe);return uc=null,vt}catch(St){if(St===th)throw St;var gn=t(29,St,null,Te.mode);return gn.lanes=qe,gn.return=Te,gn}finally{}}}function mn(u,h){u=Js,b(Od,u),b(hc,h),Js=u|h.baseLanes}function oi(){b(Od,Js),b(hc,hc.current)}function kn(){Js=Od.current,g(hc),g(Od)}function Cn(u){var h=u.alternate;b(ti,ti.current&1),b(Cr,u),ps===null&&(h===null||hc.current!==null||h.memoizedState!==null)&&(ps=u)}function Vi(u){if(u.tag===22){if(b(ti,ti.current),b(Cr,u),ps===null){var h=u.alternate;h!==null&&h.memoizedState!==null&&(ps=u)}}else $n()}function $n(){b(ti,ti.current),b(Cr,Cr.current)}function yn(u){g(Cr),ps===u&&(ps=null),g(ti)}function xn(u){for(var h=u;h!==null;){if(h.tag===13){var y=h.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||hv(y)||fv(y)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}function Ht(){throw Error(r(321))}function Ls(u,h){if(h===null)return!1;for(var y=0;y<h.length&&y<u.length;y++)if(!fr(u[y],h[y]))return!1;return!0}function hs(u,h,y,M,A,N){return Wa=N,It=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,Mt.H=u===null||u.memoizedState===null?Go:Xa,ko=!1,N=y(M,A),ko=!1,fc&&(N=bo(h,y,M,A)),Gl(u),N}function Gl(u){Mt.H=ms;var h=on!==null&&on.next!==null;if(Wa=0,Xn=on=It=null,Ld=!1,ih=0,dc=null,h)throw Error(r(300));u===null||ci||(u=u.dependencies,u!==null&&fd(u)&&(ci=!0))}function bo(u,h,y,M){It=u;var A=0;do{if(fc&&(dc=null),ih=0,fc=!1,25<=A)throw Error(r(301));if(A+=1,Xn=on=null,u.updateQueue!=null){var N=u.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}Mt.H=Ho,N=h(y,M)}while(fc);return N}function Ra(){var u=Mt.H,h=u.useState()[0];return h=typeof h.then=="function"?we(h):h,u=u.useState()[0],(on!==null?on.memoizedState:null)!==u&&(It.flags|=1024),h}function Ns(){var u=Nd!==0;return Nd=0,u}function So(u,h,y){h.updateQueue=u.updateQueue,h.flags&=-2053,u.lanes&=~y}function Da(u){if(Ld){for(u=u.memoizedState;u!==null;){var h=u.queue;h!==null&&(h.pending=null),u=u.next}Ld=!1}Wa=0,Xn=on=It=null,fc=!1,ih=Nd=0,dc=null}function q(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?It.memoizedState=Xn=u:Xn=Xn.next=u,Xn}function de(){if(on===null){var u=It.alternate;u=u!==null?u.memoizedState:null}else u=on.next;var h=Xn===null?It.memoizedState:Xn.next;if(h!==null)Xn=h,on=u;else{if(u===null)throw It.alternate===null?Error(r(467)):Error(r(310));on=u,u={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},Xn===null?It.memoizedState=Xn=u:Xn=Xn.next=u}return Xn}function we(u){var h=ih;return ih+=1,dc===null&&(dc=[]),u=Re(dc,u,h),h=It,(Xn===null?h.memoizedState:Xn.next)===null&&(h=h.alternate,Mt.H=h===null||h.memoizedState===null?Go:Xa),u}function fe(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return we(u);if(u.$$typeof===Ba)return Si(u)}throw Error(r(438,String(u)))}function ye(u){var h=null,y=It.updateQueue;if(y!==null&&(h=y.memoCache),h==null){var M=It.alternate;M!==null&&(M=M.updateQueue,M!==null&&(M=M.memoCache,M!=null&&(h={data:M.data.map(function(A){return A.slice()}),index:0})))}if(h==null&&(h={data:[],index:0}),y===null&&(y=Mv(),It.updateQueue=y),y.memoCache=h,y=h.data[h.index],y===void 0)for(y=h.data[h.index]=Array(u),M=0;M<u;M++)y[M]=uD;return h.index++,y}function Xe(u,h){return typeof h=="function"?h(u):h}function Je(u){var h=de();return ut(h,on,u)}function ut(u,h,y){var M=u.queue;if(M===null)throw Error(r(311));M.lastRenderedReducer=y;var A=u.baseQueue,N=M.pending;if(N!==null){if(A!==null){var $=A.next;A.next=N.next,N.next=$}h.baseQueue=A=N,M.pending=null}if(N=u.baseState,A===null)u.memoizedState=N;else{h=A.next;var ae=$=null,Ee=null,ke=h,Ye=!1;do{var ot=ke.lane&-536870913;if(ot!==ke.lane?(Vt&ot)===ot:(Wa&ot)===ot){var ht=ke.revertLane;if(ht===0)Ee!==null&&(Ee=Ee.next={lane:0,revertLane:0,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null}),ot===oc&&(Ye=!0);else if((Wa&ht)===ht){ke=ke.next,ht===oc&&(Ye=!0);continue}else ot={lane:0,revertLane:ke.revertLane,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null},Ee===null?(ae=Ee=ot,$=N):Ee=Ee.next=ot,It.lanes|=ht,ja|=ht;ot=ke.action,ko&&y(N,ot),N=ke.hasEagerState?ke.eagerState:y(N,ot)}else ht={lane:ot,revertLane:ke.revertLane,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null},Ee===null?(ae=Ee=ht,$=N):Ee=Ee.next=ht,It.lanes|=ot,ja|=ot;ke=ke.next}while(ke!==null&&ke!==h);if(Ee===null?$=N:Ee.next=ae,!fr(N,u.memoizedState)&&(ci=!0,Ye&&(y=lc,y!==null)))throw y;u.memoizedState=N,u.baseState=$,u.baseQueue=Ee,M.lastRenderedState=N}return A===null&&(M.lanes=0),[u.memoizedState,M.dispatch]}function lt(u){var h=de(),y=h.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=u;var M=y.dispatch,A=y.pending,N=h.memoizedState;if(A!==null){y.pending=null;var $=A=A.next;do N=u(N,$.action),$=$.next;while($!==A);fr(N,h.memoizedState)||(ci=!0),h.memoizedState=N,h.baseQueue===null&&(h.baseState=N),y.lastRenderedState=N}return[N,M]}function yt(u,h,y){var M=It,A=de(),N=jt;if(N){if(y===void 0)throw Error(r(407));y=y()}else y=h();var $=!fr((on||A).memoizedState,y);if($&&(A.memoizedState=y,ci=!0),A=A.queue,Is(Ot.bind(null,M,A,u),[u]),A.getSnapshot!==h||$||Xn!==null&&Xn.memoizedState.tag&1){if(M.flags|=2048,Li(9,pt.bind(null,M,A,y,h),{destroy:void 0},null),hn===null)throw Error(r(349));N||(Wa&60)!==0||_t(M,h,y)}return y}function _t(u,h,y){u.flags|=16384,u={getSnapshot:h,value:y},h=It.updateQueue,h===null?(h=Mv(),It.updateQueue=h,h.stores=[u]):(y=h.stores,y===null?h.stores=[u]:y.push(u))}function pt(u,h,y,M){h.value=y,h.getSnapshot=M,zt(h)&&nn(u)}function Ot(u,h,y){return y(function(){zt(h)&&nn(u)})}function zt(u){var h=u.getSnapshot;u=u.value;try{var y=h();return!fr(u,y)}catch{return!0}}function nn(u){var h=Me(u,2);h!==null&&Ni(h,u,2)}function Qt(u){var h=q();if(typeof u=="function"){var y=u;if(u=y(),ko){L(!0);try{y()}finally{L(!1)}}}return h.memoizedState=h.baseState=u,h.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xe,lastRenderedState:u},h}function Pt(u,h,y,M){return u.baseState=y,ut(u,on,typeof M=="function"?M:Xe)}function gt(u,h,y,M,A){if(Ro(u))throw Error(r(485));if(u=h.action,u!==null){var N={payload:A,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function($){N.listeners.push($)}};Mt.T!==null?y(!0):N.isTransition=!1,M(N),y=h.pending,y===null?(N.next=h.pending=N,_n(h,N)):(N.next=y.next,h.pending=y.next=N)}}function _n(u,h){var y=h.action,M=h.payload,A=u.state;if(h.isTransition){var N=Mt.T,$={};Mt.T=$;try{var ae=y(A,M),Ee=Mt.S;Ee!==null&&Ee($,ae),Nt(u,h,ae)}catch(ke){Wi(u,h,ke)}finally{Mt.T=N}}else try{N=y(A,M),Nt(u,h,N)}catch(ke){Wi(u,h,ke)}}function Nt(u,h,y){y!==null&&typeof y=="object"&&typeof y.then=="function"?y.then(function(M){li(u,h,M)},function(M){return Wi(u,h,M)}):li(u,h,y)}function li(u,h,y){h.status="fulfilled",h.value=y,Gn(h),u.state=y,h=u.pending,h!==null&&(y=h.next,y===h?u.pending=null:(y=y.next,h.next=y,_n(u,y)))}function Wi(u,h,y){var M=u.pending;if(u.pending=null,M!==null){M=M.next;do h.status="rejected",h.reason=y,Gn(h),h=h.next;while(h!==M)}u.action=null}function Gn(u){u=u.listeners;for(var h=0;h<u.length;h++)(0,u[h])()}function ei(u,h){return h}function rn(u,h){if(jt){var y=hn.formState;if(y!==null){e:{var M=It;if(jt){if(wi){var A=tU(wi,ds);if(A){wi=MS(A),M=nU(A);break e}}pe(M)}M=!1}M&&(h=y[0])}}y=q(),y.memoizedState=y.baseState=h,M={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ei,lastRenderedState:h},y.queue=M,y=Fu.bind(null,It,M),M.dispatch=y,M=Qt(!1);var N=Wl.bind(null,It,!1,M.queue);return M=q(),A={state:h,dispatch:null,action:u,pending:null},M.queue=A,y=gt.bind(null,It,A,N,y),A.dispatch=y,M.memoizedState=u,[h,y,!1]}function Hn(u){var h=de();return zn(h,on,u)}function zn(u,h,y){h=ut(u,h,ei)[0],u=Je(Xe)[0],h=typeof h=="object"&&h!==null&&typeof h.then=="function"?we(h):h;var M=de(),A=M.queue,N=A.dispatch;return y!==M.memoizedState&&(It.flags|=2048,Li(9,Vn.bind(null,A,y),{destroy:void 0},null)),[h,N,u]}function Vn(u,h){u.action=h}function Rn(u){var h=de(),y=on;if(y!==null)return zn(h,y,u);de(),h=h.memoizedState,y=de();var M=y.queue.dispatch;return y.memoizedState=u,[h,M,!1]}function Li(u,h,y,M){return u={tag:u,create:h,inst:y,deps:M,next:null},h=It.updateQueue,h===null&&(h=Mv(),It.updateQueue=h),y=h.lastEffect,y===null?h.lastEffect=u.next=u:(M=y.next,y.next=u,u.next=M,h.lastEffect=u),u}function Xi(){return de().memoizedState}function Eo(u,h,y,M){var A=q();It.flags|=u,A.memoizedState=Li(1|h,y,{destroy:void 0},M===void 0?null:M)}function Mo(u,h,y,M){var A=de();M=M===void 0?null:M;var N=A.memoizedState.inst;on!==null&&M!==null&&Ls(M,on.memoizedState.deps)?A.memoizedState=Li(h,y,N,M):(It.flags|=u,A.memoizedState=Li(1|h,y,N,M))}function Hl(u,h){Eo(8390656,8,u,h)}function Is(u,h){Mo(2048,8,u,h)}function Lu(u,h){return Mo(4,2,u,h)}function wo(u,h){return Mo(4,4,u,h)}function Ps(u,h){if(typeof h=="function"){u=u();var y=h(u);return function(){typeof y=="function"?y():h(null)}}if(h!=null)return u=u(),h.current=u,function(){h.current=null}}function zs(u,h,y){y=y!=null?y.concat([u]):null,Mo(4,4,Ps.bind(null,h,u),y)}function Fs(){}function Nu(u,h){var y=de();h=h===void 0?null:h;var M=y.memoizedState;return h!==null&&Ls(h,M[1])?M[0]:(y.memoizedState=[u,h],u)}function Ua(u,h){var y=de();h=h===void 0?null:h;var M=y.memoizedState;if(h!==null&&Ls(h,M[1]))return M[0];if(M=u(),ko){L(!0);try{u()}finally{L(!1)}}return y.memoizedState=[M,h],M}function To(u,h,y){return y===void 0||(Wa&1073741824)!==0?u.memoizedState=h:(u.memoizedState=y,u=Bb(),It.lanes|=u,ja|=u,y)}function Vl(u,h,y,M){return fr(y,h)?y:hc.current!==null?(u=To(u,y,M),fr(u,h)||(ci=!0),u):(Wa&42)===0?(ci=!0,u.memoizedState=y):(u=Bb(),It.lanes|=u,ja|=u,h)}function Iu(u,h,y,M,A){var N=Po();Zi(N!==0&&8>N?N:8);var $=Mt.T,ae={};Mt.T=ae,Wl(u,!1,h,y);try{var Ee=A(),ke=Mt.S;if(ke!==null&&ke(ae,Ee),Ee!==null&&typeof Ee=="object"&&typeof Ee.then=="function"){var Ye=Ie(Ee,M);Bs(u,h,Ye,lr(u))}else Bs(u,h,M,lr(u))}catch(ot){Bs(u,h,{then:function(){},status:"rejected",reason:ot},lr())}finally{Zi(N),Mt.T=$}}function Ao(u){var h=u.memoizedState;if(h!==null)return h;h={memoizedState:$l,baseState:$l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xe,lastRenderedState:$l},next:null};var y={};return h.next={memoizedState:y,baseState:y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xe,lastRenderedState:y},next:null},u.memoizedState=h,u=u.alternate,u!==null&&(u.memoizedState=h),h}function Co(){return Si(zo)}function Pu(){return de().memoizedState}function ji(){return de().memoizedState}function zu(u){for(var h=u.return;h!==null;){switch(h.tag){case 24:case 3:var y=lr();u=Ce(y);var M=He(h,u,y);M!==null&&(Ni(M,h,y),Ve(M,h,y)),h={cache:U0()},u.payload=h;return}h=h.return}}function ud(u,h,y){var M=lr();y={lane:M,revertLane:0,action:y,hasEagerState:!1,eagerState:null,next:null},Ro(u)?Oa(h,y):(y=te(u,h,y,M),y!==null&&(Ni(y,u,M),La(y,h,M)))}function Fu(u,h,y){var M=lr();Bs(u,h,y,M)}function Bs(u,h,y,M){var A={lane:M,revertLane:0,action:y,hasEagerState:!1,eagerState:null,next:null};if(Ro(u))Oa(h,A);else{var N=u.alternate;if(u.lanes===0&&(N===null||N.lanes===0)&&(N=h.lastRenderedReducer,N!==null))try{var $=h.lastRenderedState,ae=N($,y);if(A.hasEagerState=!0,A.eagerState=ae,fr(ae,$))return le(u,h,A,0),hn===null&&G(),!1}catch{}finally{}if(y=te(u,h,A,M),y!==null)return Ni(y,u,M),La(y,h,M),!0}return!1}function Wl(u,h,y,M){if(M={lane:2,revertLane:ge(),action:M,hasEagerState:!1,eagerState:null,next:null},Ro(u)){if(h)throw Error(r(479))}else h=te(u,y,M,2),h!==null&&Ni(h,u,2)}function Ro(u){var h=u.alternate;return u===It||h!==null&&h===It}function Oa(u,h){fc=Ld=!0;var y=u.pending;y===null?h.next=h:(h.next=y.next,y.next=h),u.pending=h}function La(u,h,y){if((y&4194176)!==0){var M=h.lanes;M&=u.pendingLanes,y|=M,h.lanes=y,V(u,y)}}function br(u,h,y,M){h=u.memoizedState,y=y(M,h),y=y==null?h:tv({},h,y),u.memoizedState=y,u.lanes===0&&(u.updateQueue.baseState=y)}function Bu(u,h,y,M,A,N,$){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(M,N,$):h.prototype&&h.prototype.isPureReactComponent?!Le(y,M)||!Le(A,N):!0}function Xl(u,h,y,M){u=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(y,M),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(y,M),h.state!==u&&wv.enqueueReplaceState(h,h.state,null)}function Xr(u,h){var y=h;if("ref"in h){y={};for(var M in h)M!=="ref"&&(y[M]=h[M])}if(u=u.defaultProps){y===h&&(y=tv({},y));for(var A in u)y[A]===void 0&&(y[A]=u[A])}return y}function fs(u,h){try{var y=u.onUncaughtError;y(h.value,{componentStack:h.stack})}catch(M){setTimeout(function(){throw M})}}function ku(u,h,y){try{var M=u.onCaughtError;M(y.value,{componentStack:y.stack,errorBoundary:h.tag===1?h.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function ks(u,h,y){return y=Ce(y),y.tag=3,y.payload={element:null},y.callback=function(){fs(u,h)},y}function jl(u){return u=Ce(u),u.tag=3,u}function bi(u,h,y,M){var A=y.type.getDerivedStateFromError;if(typeof A=="function"){var N=M.value;u.payload=function(){return A(N)},u.callback=function(){ku(h,y,M)}}var $=y.stateNode;$!==null&&typeof $.componentDidCatch=="function"&&(u.callback=function(){ku(h,y,M),typeof A!="function"&&(qa===null?qa=new Set([this]):qa.add(this));var ae=M.stack;this.componentDidCatch(M.value,{componentStack:ae!==null?ae:""})})}function b0(u,h,y,M,A){if(y.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){if(h=y.alternate,h!==null&&Vu(h,y,A,!0),y=Cr.current,y!==null){switch(y.tag){case 13:return ps===null?Y0():y.alternate===null&&Ln===0&&(Ln=3),y.flags&=-257,y.flags|=65536,y.lanes=A,M===Ud?y.flags|=16384:(h=y.updateQueue,h===null?y.updateQueue=new Set([M]):h.add(M),K0(u,M,A)),!1;case 22:return y.flags|=65536,M===Ud?y.flags|=16384:(h=y.updateQueue,h===null?(h={transitions:null,markerInstances:null,retryQueue:new Set([M])},y.updateQueue=h):(y=h.retryQueue,y===null?h.retryQueue=new Set([M]):y.add(M)),K0(u,M,A)),!1}throw Error(r(435,y.tag))}return K0(u,M,A),Y0(),!1}if(jt)return h=Cr.current,h!==null?((h.flags&65536)===0&&(h.flags|=256),h.flags|=65536,h.lanes=A,M!==vv&&(u=Error(r(422),{cause:M}),Ne(H(u,y)))):(M!==vv&&(h=Error(r(423),{cause:M}),Ne(H(h,y))),u=u.current.alternate,u.flags|=65536,A&=-A,u.lanes|=A,M=H(M,y),A=ks(u.stateNode,M,A),nt(u,A),Ln!==4&&(Ln=2)),!1;var N=Error(r(520),{cause:M});if(N=H(N,y),sh===null?sh=[N]:sh.push(N),Ln!==4&&(Ln=2),h===null)return!0;M=H(M,y),y=h;do{switch(y.tag){case 3:return y.flags|=65536,u=A&-A,y.lanes|=u,u=ks(y.stateNode,M,u),nt(y,u),!1;case 1:if(h=y.type,N=y.stateNode,(y.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(qa===null||!qa.has(N))))return y.flags|=65536,A&=-A,y.lanes|=A,A=jl(A),bi(A,u,y,M),nt(y,A),!1}y=y.return}while(y!==null);return!1}function Dn(u,h,y,M){h.child=u===null?FS(h,null,y,M):Bo(h,u.child,y,M)}function Do(u,h,y,M,A){y=y.render;var N=h.ref;if("ref"in M){var $={};for(var ae in M)ae!=="ref"&&($[ae]=M[ae])}else $=M;return Uo(h),M=hs(u,h,y,$,N,A),ae=Ns(),u!==null&&!ci?(So(u,h,A),Gs(u,h,A)):(jt&&ae&&Y(h),h.flags|=1,Dn(u,h,M,A),h.child)}function Gu(u,h,y,M,A){if(u===null){var N=y.type;return typeof N=="function"&&!J0(N)&&N.defaultProps===void 0&&y.compare===null?(h.tag=15,h.type=N,hd(u,h,N,M,A)):(u=_d(y.type,null,M,h,h.mode,A),u.ref=h.ref,u.return=h,h.child=u)}if(N=u.child,!C0(u,A)){var $=N.memoizedProps;if(y=y.compare,y=y!==null?y:Le,y($,M)&&u.ref===h.ref)return Gs(u,h,A)}return h.flags|=1,u=Fa(N,M),u.ref=h.ref,u.return=h,h.child=u}function hd(u,h,y,M,A){if(u!==null){var N=u.memoizedProps;if(Le(N,M)&&u.ref===h.ref)if(ci=!1,h.pendingProps=M=N,C0(u,A))(u.flags&131072)!==0&&(ci=!0);else return h.lanes=u.lanes,Gs(u,h,A)}return Sr(u,h,y,M,A)}function pi(u,h,y){var M=h.pendingProps,A=M.children,N=(h.stateNode._pendingVisibility&2)!==0,$=u!==null?u.memoizedState:null;if(Wn(u,h),M.mode==="hidden"||N){if((h.flags&128)!==0){if(M=$!==null?$.baseLanes|y:y,u!==null){for(A=h.child=u.child,N=0;A!==null;)N=N|A.lanes|A.childLanes,A=A.sibling;h.childLanes=N&~M}else h.childLanes=0,h.child=null;return qi(u,h,M,y)}if((y&536870912)!==0)h.memoizedState={baseLanes:0,cachePool:null},u!==null&&pd(h,$!==null?$.cachePool:null),$!==null?mn(h,$):oi(),Vi(h);else return h.lanes=h.childLanes=536870912,qi(u,h,$!==null?$.baseLanes|y:y,y)}else $!==null?(pd(h,$.cachePool),mn(h,$),$n(),h.memoizedState=null):(u!==null&&pd(h,null),oi(),$n());return Dn(u,h,A,y),h.child}function qi(u,h,y,M){var A=O0();return A=A===null?null:{parent:Xs?Un._currentValue:Un._currentValue2,pool:A},h.memoizedState={baseLanes:y,cachePool:A},u!==null&&pd(h,null),oi(),Vi(h),u!==null&&Vu(u,h,M,!0),null}function Wn(u,h){var y=h.ref;if(y===null)u!==null&&u.ref!==null&&(h.flags|=2097664);else{if(typeof y!="function"&&typeof y!="object")throw Error(r(284));(u===null||u.ref!==y)&&(h.flags|=2097664)}}function Sr(u,h,y,M,A){return Uo(h),y=hs(u,h,y,M,void 0,A),M=Ns(),u!==null&&!ci?(So(u,h,A),Gs(u,h,A)):(jt&&M&&Y(h),h.flags|=1,Dn(u,h,y,A),h.child)}function Hu(u,h,y,M,A,N){return Uo(h),h.updateQueue=null,y=bo(h,M,y,A),Gl(u),M=Ns(),u!==null&&!ci?(So(u,h,N),Gs(u,h,N)):(jt&&M&&Y(h),h.flags|=1,Dn(u,h,y,N),h.child)}function cb(u,h,y,M,A){if(Uo(h),h.stateNode===null){var N=tc,$=y.contextType;typeof $=="object"&&$!==null&&(N=Si($)),N=new y(M,N),h.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=wv,h.stateNode=N,N._reactInternals=h,N=h.stateNode,N.props=M,N.state=h.memoizedState,N.refs={},je(h),$=y.contextType,N.context=typeof $=="object"&&$!==null?Si($):tc,N.state=h.memoizedState,$=y.getDerivedStateFromProps,typeof $=="function"&&(br(h,y,$,M),N.state=h.memoizedState),typeof y.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||($=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),$!==N.state&&wv.enqueueReplaceState(N,N.state,null),ft(h,M,N,A),We(),N.state=h.memoizedState),typeof N.componentDidMount=="function"&&(h.flags|=4194308),M=!0}else if(u===null){N=h.stateNode;var ae=h.memoizedProps,Ee=Xr(y,ae);N.props=Ee;var ke=N.context,Ye=y.contextType;$=tc,typeof Ye=="object"&&Ye!==null&&($=Si(Ye));var ot=y.getDerivedStateFromProps;Ye=typeof ot=="function"||typeof N.getSnapshotBeforeUpdate=="function",ae=h.pendingProps!==ae,Ye||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(ae||ke!==$)&&Xl(h,N,M,$),Va=!1;var ht=h.memoizedState;N.state=ht,ft(h,M,N,A),We(),ke=h.memoizedState,ae||ht!==ke||Va?(typeof ot=="function"&&(br(h,y,ot,M),ke=h.memoizedState),(Ee=Va||Bu(h,y,Ee,M,ht,ke,$))?(Ye||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(h.flags|=4194308)):(typeof N.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=M,h.memoizedState=ke),N.props=M,N.state=ke,N.context=$,M=Ee):(typeof N.componentDidMount=="function"&&(h.flags|=4194308),M=!1)}else{N=h.stateNode,Ze(u,h),$=h.memoizedProps,Ye=Xr(y,$),N.props=Ye,ot=h.pendingProps,ht=N.context,ke=y.contextType,Ee=tc,typeof ke=="object"&&ke!==null&&(Ee=Si(ke)),ae=y.getDerivedStateFromProps,(ke=typeof ae=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||($!==ot||ht!==Ee)&&Xl(h,N,M,Ee),Va=!1,ht=h.memoizedState,N.state=ht,ft(h,M,N,A),We();var Rt=h.memoizedState;$!==ot||ht!==Rt||Va||u!==null&&u.dependencies!==null&&fd(u.dependencies)?(typeof ae=="function"&&(br(h,y,ae,M),Rt=h.memoizedState),(Ye=Va||Bu(h,y,Ye,M,ht,Rt,Ee)||u!==null&&u.dependencies!==null&&fd(u.dependencies))?(ke||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(M,Rt,Ee),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(M,Rt,Ee)),typeof N.componentDidUpdate=="function"&&(h.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof N.componentDidUpdate!="function"||$===u.memoizedProps&&ht===u.memoizedState||(h.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||$===u.memoizedProps&&ht===u.memoizedState||(h.flags|=1024),h.memoizedProps=M,h.memoizedState=Rt),N.props=M,N.state=Rt,N.context=Ee,M=Ye):(typeof N.componentDidUpdate!="function"||$===u.memoizedProps&&ht===u.memoizedState||(h.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||$===u.memoizedProps&&ht===u.memoizedState||(h.flags|=1024),M=!1)}return N=M,Wn(u,h),M=(h.flags&128)!==0,N||M?(N=h.stateNode,y=M&&typeof y.getDerivedStateFromError!="function"?null:N.render(),h.flags|=1,u!==null&&M?(h.child=Bo(h,u.child,null,A),h.child=Bo(h,null,y,A)):Dn(u,h,y,A),h.memoizedState=N.state,u=h.child):u=Gs(u,h,A),u}function ub(u,h,y,M){return ce(),h.flags|=256,Dn(u,h,y,M),h.child}function S0(u){return{baseLanes:u,cachePool:gb()}}function E0(u,h,y){return u=u!==null?u.childLanes&~y:0,h&&(u|=Rr),u}function hb(u,h,y){var M=h.pendingProps,A=!1,N=(h.flags&128)!==0,$;if(($=N)||($=u!==null&&u.memoizedState===null?!1:(ti.current&2)!==0),$&&(A=!0,h.flags&=-129),$=(h.flags&32)!==0,h.flags&=-33,u===null){if(jt){if(A?Cn(h):$n(),jt){var ae=wi,Ee;(Ee=ae)&&(ae=oU(ae,ds),ae!==null?(h.memoizedState={dehydrated:ae,treeContext:Fo!==null?{id:js,overflow:qs}:null,retryLane:536870912},Ee=t(18,null,null,0),Ee.stateNode=ae,Ee.return=h,h.child=Ee,Ii=h,wi=null,Ee=!0):Ee=!1),Ee||pe(h)}if(ae=h.memoizedState,ae!==null&&(ae=ae.dehydrated,ae!==null))return fv(ae)?h.lanes=16:h.lanes=536870912,null;yn(h)}return ae=M.children,M=M.fallback,A?($n(),A=h.mode,ae=w0({mode:"hidden",children:ae},A),M=Io(M,A,y,null),ae.return=h,M.return=h,ae.sibling=M,h.child=ae,A=h.child,A.memoizedState=S0(y),A.childLanes=E0(u,$,y),h.memoizedState=Tv,M):(Cn(h),M0(h,ae))}if(Ee=u.memoizedState,Ee!==null&&(ae=Ee.dehydrated,ae!==null)){if(N)h.flags&256?(Cn(h),h.flags&=-257,h=T0(u,h,y)):h.memoizedState!==null?($n(),h.child=u.child,h.flags|=128,h=null):($n(),A=M.fallback,ae=h.mode,M=w0({mode:"visible",children:M.children},ae),A=Io(A,ae,y,null),A.flags|=2,M.return=h,A.return=h,M.sibling=A,h.child=M,Bo(h,u.child,null,y),M=h.child,M.memoizedState=S0(y),M.childLanes=E0(u,$,y),h.memoizedState=Tv,h=A);else if(Cn(h),fv(ae))$=$D(ae).digest,M=Error(r(419)),M.stack="",M.digest=$,Ne({value:M,source:null,stack:null}),h=T0(u,h,y);else if(ci||Vu(u,h,y,!1),$=(y&u.childLanes)!==0,ci||$){if($=hn,$!==null){if(M=y&-y,(M&42)!==0)M=1;else switch(M){case 2:M=1;break;case 8:M=4;break;case 32:M=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:M=64;break;case 268435456:M=134217728;break;default:M=0}if(M=(M&($.suspendedLanes|y))!==0?0:M,M!==0&&M!==Ee.retryLane)throw Ee.retryLane=M,Me(u,M),Ni($,u,M),kS}hv(ae)||Y0(),h=T0(u,h,y)}else hv(ae)?(h.flags|=128,h.child=u.child,h=nD.bind(null,u),eU(ae,h),h=null):(u=Ee.treeContext,Er&&(wi=rU(ae),Ii=h,jt=!0,Yr=null,ds=!1,u!==null&&(wr[Tr++]=js,wr[Tr++]=qs,wr[Tr++]=Fo,js=u.id,qs=u.overflow,Fo=h)),h=M0(h,M.children),h.flags|=4096);return h}return A?($n(),A=M.fallback,ae=h.mode,Ee=u.child,N=Ee.sibling,M=Fa(Ee,{mode:"hidden",children:M.children}),M.subtreeFlags=Ee.subtreeFlags&31457280,N!==null?A=Fa(N,A):(A=Io(A,ae,y,null),A.flags|=2),A.return=h,M.return=h,M.sibling=A,h.child=M,M=A,A=h.child,ae=u.child.memoizedState,ae===null?ae=S0(y):(Ee=ae.cachePool,Ee!==null?(N=Xs?Un._currentValue:Un._currentValue2,Ee=Ee.parent!==N?{parent:N,pool:N}:Ee):Ee=gb(),ae={baseLanes:ae.baseLanes|y,cachePool:Ee}),A.memoizedState=ae,A.childLanes=E0(u,$,y),h.memoizedState=Tv,M):(Cn(h),y=u.child,u=y.sibling,y=Fa(y,{mode:"visible",children:M.children}),y.return=h,y.sibling=null,u!==null&&($=h.deletions,$===null?(h.deletions=[u],h.flags|=16):$.push(u)),h.child=y,h.memoizedState=null,y)}function M0(u,h){return h=w0({mode:"visible",children:h},u.mode),h.return=u,u.child=h}function w0(u,h){return tS(u,h,0,null)}function T0(u,h,y){return Bo(h,u.child,null,y),u=M0(h,h.pendingProps.children),u.flags|=2,h.memoizedState=null,u}function fb(u,h,y){u.lanes|=h;var M=u.alternate;M!==null&&(M.lanes|=h),R0(u.return,h,y)}function A0(u,h,y,M,A){var N=u.memoizedState;N===null?u.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:M,tail:y,tailMode:A}:(N.isBackwards=h,N.rendering=null,N.renderingStartTime=0,N.last=M,N.tail=y,N.tailMode=A)}function db(u,h,y){var M=h.pendingProps,A=M.revealOrder,N=M.tail;if(Dn(u,h,M.children,y),M=ti.current,(M&2)!==0)M=M&1|2,h.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=h.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&fb(u,y,h);else if(u.tag===19)fb(u,y,h);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===h)break e;for(;u.sibling===null;){if(u.return===null||u.return===h)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}M&=1}switch(b(ti,M),A){case"forwards":for(y=h.child,A=null;y!==null;)u=y.alternate,u!==null&&xn(u)===null&&(A=y),y=y.sibling;y=A,y===null?(A=h.child,h.child=null):(A=y.sibling,y.sibling=null),A0(h,!1,A,y,N);break;case"backwards":for(y=null,A=h.child,h.child=null;A!==null;){if(u=A.alternate,u!==null&&xn(u)===null){h.child=A;break}u=A.sibling,A.sibling=y,y=A,A=u}A0(h,!0,y,null,N);break;case"together":A0(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Gs(u,h,y){if(u!==null&&(h.dependencies=u.dependencies),ja|=h.lanes,(y&h.childLanes)===0)if(u!==null){if(Vu(u,h,y,!1),(y&h.childLanes)===0)return null}else return null;if(u!==null&&h.child!==u.child)throw Error(r(153));if(h.child!==null){for(u=h.child,y=Fa(u,u.pendingProps),h.child=y,y.return=h;u.sibling!==null;)u=u.sibling,y=y.sibling=Fa(u,u.pendingProps),y.return=h;y.sibling=null}return h.child}function C0(u,h){return(u.lanes&h)!==0?!0:(u=u.dependencies,!!(u!==null&&fd(u)))}function X3(u,h,y){switch(h.tag){case 3:j(h,h.stateNode.containerInfo),Na(h,Un,u.memoizedState.cache),ce();break;case 27:case 5:he(h);break;case 4:j(h,h.stateNode.containerInfo);break;case 10:Na(h,h.type,h.memoizedProps.value);break;case 13:var M=h.memoizedState;if(M!==null)return M.dehydrated!==null?(Cn(h),h.flags|=128,null):(y&h.child.childLanes)!==0?hb(u,h,y):(Cn(h),u=Gs(u,h,y),u!==null?u.sibling:null);Cn(h);break;case 19:var A=(u.flags&128)!==0;if(M=(y&h.childLanes)!==0,M||(Vu(u,h,y,!1),M=(y&h.childLanes)!==0),A){if(M)return db(u,h,y);h.flags|=128}if(A=h.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),b(ti,ti.current),M)break;return null;case 22:case 23:return h.lanes=0,pi(u,h,y);case 24:Na(h,Un,u.memoizedState.cache)}return Gs(u,h,y)}function pb(u,h,y){if(u!==null)if(u.memoizedProps!==h.pendingProps)ci=!0;else{if(!C0(u,y)&&(h.flags&128)===0)return ci=!1,X3(u,h,y);ci=(u.flags&131072)!==0}else ci=!1,jt&&(h.flags&1048576)!==0&&F(h,Ad,h.index);switch(h.lanes=0,h.tag){case 16:e:{u=h.pendingProps;var M=h.elementType,A=M._init;if(M=A(M._payload),h.type=M,typeof M=="function")J0(M)?(u=Xr(M,u),h.tag=1,h=cb(null,h,M,u,y)):(h.tag=0,h=Sr(null,h,M,u,y));else{if(M!=null){if(A=M.$$typeof,A===iv){h.tag=11,h=Do(null,h,M,u,y);break e}else if(A===av){h.tag=14,h=Gu(null,h,M,u,y);break e}}throw h=a(M)||M,Error(r(306,h,""))}}return h;case 0:return Sr(u,h,h.type,h.pendingProps,y);case 1:return M=h.type,A=Xr(M,h.pendingProps),cb(u,h,M,A,y);case 3:e:{if(j(h,h.stateNode.containerInfo),u===null)throw Error(r(387));var N=h.pendingProps;A=h.memoizedState,M=A.element,Ze(u,h),ft(h,N,null,y);var $=h.memoizedState;if(N=$.cache,Na(h,Un,N),N!==A.cache&&D0(h,[Un],y,!0),We(),N=$.element,Er&&A.isDehydrated)if(A={element:N,isDehydrated:!1,cache:$.cache},h.updateQueue.baseState=A,h.memoizedState=A,h.flags&256){h=ub(u,h,N,y);break e}else if(N!==M){M=H(Error(r(424)),h),Ne(M),h=ub(u,h,N,y);break e}else for(Er&&(wi=iU(h.stateNode.containerInfo),Ii=h,jt=!0,Yr=null,ds=!0),y=FS(h,null,N,y),h.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ce(),N===M){h=Gs(u,h,y);break e}Dn(u,h,N,y)}h=h.child}return h;case 26:if(Mr)return Wn(u,h),u===null?(y=CS(h.type,null,h.pendingProps,null))?h.memoizedState=y:jt||(h.stateNode=_U(h.type,h.pendingProps,Ha.current,h)):h.memoizedState=CS(h.type,u.memoizedProps,h.pendingProps,u.memoizedState),null;case 27:if(Mi)return he(h),u===null&&Mi&&jt&&(M=h.stateNode=NS(h.type,h.pendingProps,Ha.current,mi.current,!1),Ii=h,ds=!0,wi=wS(M)),M=h.pendingProps.children,u!==null||jt?Dn(u,h,M,y):h.child=Bo(h,null,M,y),Wn(u,h),h.child;case 5:return u===null&&jt&&(gU(h.type,h.pendingProps,mi.current),(A=M=wi)&&(M=sU(M,h.type,h.pendingProps,ds),M!==null?(h.stateNode=M,Ii=h,wi=wS(M),ds=!1,A=!0):A=!1),A||pe(h)),he(h),A=h.type,N=h.pendingProps,$=u!==null?u.memoizedProps:null,M=N.children,Sd(A,N)?M=null:$!==null&&Sd(A,$)&&(h.flags|=32),h.memoizedState!==null&&(A=hs(u,h,Ra,null,null,y),Xs?zo._currentValue=A:zo._currentValue2=A),Wn(u,h),Dn(u,h,M,y),h.child;case 6:return u===null&&jt&&(vU(h.pendingProps,mi.current),(u=y=wi)&&(y=aU(y,h.pendingProps,ds),y!==null?(h.stateNode=y,Ii=h,wi=null,u=!0):u=!1),u||pe(h)),null;case 13:return hb(u,h,y);case 4:return j(h,h.stateNode.containerInfo),M=h.pendingProps,u===null?h.child=Bo(h,null,M,y):Dn(u,h,M,y),h.child;case 11:return Do(u,h,h.type,h.pendingProps,y);case 7:return Dn(u,h,h.pendingProps,y),h.child;case 8:return Dn(u,h,h.pendingProps.children,y),h.child;case 12:return Dn(u,h,h.pendingProps.children,y),h.child;case 10:return M=h.pendingProps,Na(h,h.type,M.value),Dn(u,h,M.children,y),h.child;case 9:return A=h.type._context,M=h.pendingProps.children,Uo(h),A=Si(A),M=M(A),h.flags|=1,Dn(u,h,M,y),h.child;case 14:return Gu(u,h,h.type,h.pendingProps,y);case 15:return hd(u,h,h.type,h.pendingProps,y);case 19:return db(u,h,y);case 22:return pi(u,h,y);case 24:return Uo(h),M=Si(Un),u===null?(A=O0(),A===null&&(A=hn,N=U0(),A.pooledCache=N,N.refCount++,N!==null&&(A.pooledCacheLanes|=y),A=N),h.memoizedState={parent:M,cache:A},je(h),Na(h,Un,A)):((u.lanes&y)!==0&&(Ze(u,h),ft(h,null,null,y),We()),A=u.memoizedState,N=h.memoizedState,A.parent!==M?(A={parent:M,cache:M},h.memoizedState=A,h.lanes===0&&(h.memoizedState=h.updateQueue.baseState=A),Na(h,Un,M)):(M=N.cache,Na(h,Un,M),M!==A.cache&&D0(h,[Un],y,!0))),Dn(u,h,h.pendingProps.children,y),h.child;case 29:throw h.pendingProps}throw Error(r(156,h.tag))}function Na(u,h,y){Xs?(b(Id,h._currentValue),h._currentValue=y):(b(Id,h._currentValue2),h._currentValue2=y)}function Hs(u){var h=Id.current;Xs?u._currentValue=h:u._currentValue2=h,g(Id)}function R0(u,h,y){for(;u!==null;){var M=u.alternate;if((u.childLanes&h)!==h?(u.childLanes|=h,M!==null&&(M.childLanes|=h)):M!==null&&(M.childLanes&h)!==h&&(M.childLanes|=h),u===y)break;u=u.return}}function D0(u,h,y,M){var A=u.child;for(A!==null&&(A.return=u);A!==null;){var N=A.dependencies;if(N!==null){var $=A.child;N=N.firstContext;e:for(;N!==null;){var ae=N;N=A;for(var Ee=0;Ee<h.length;Ee++)if(ae.context===h[Ee]){N.lanes|=y,ae=N.alternate,ae!==null&&(ae.lanes|=y),R0(N.return,y,u),M||($=null);break e}N=ae.next}}else if(A.tag===18){if($=A.return,$===null)throw Error(r(341));$.lanes|=y,N=$.alternate,N!==null&&(N.lanes|=y),R0($,y,u),$=null}else $=A.child;if($!==null)$.return=A;else for($=A;$!==null;){if($===u){$=null;break}if(A=$.sibling,A!==null){A.return=$.return,$=A;break}$=$.return}A=$}}function Vu(u,h,y,M){u=null;for(var A=h,N=!1;A!==null;){if(!N){if((A.flags&524288)!==0)N=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var $=A.alternate;if($===null)throw Error(r(387));if($=$.memoizedProps,$!==null){var ae=A.type;fr(A.pendingProps.value,$.value)||(u!==null?u.push(ae):u=[ae])}}else if(A===Cd.current){if($=A.alternate,$===null)throw Error(r(387));$.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(u!==null?u.push(zo):u=[zo])}A=A.return}u!==null&&D0(h,u,y,M),h.flags|=262144}function fd(u){for(u=u.firstContext;u!==null;){var h=u.context;if(!fr(Xs?h._currentValue:h._currentValue2,u.memoizedValue))return!0;u=u.next}return!1}function Uo(u){Vo=u,Ys=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Si(u){return mb(Vo,u)}function dd(u,h){return Vo===null&&Uo(u),mb(u,h)}function mb(u,h){var y=Xs?h._currentValue:h._currentValue2;if(h={context:h,memoizedValue:y,next:null},Ys===null){if(u===null)throw Error(r(308));Ys=h,u.dependencies={lanes:0,firstContext:h},u.flags|=524288}else Ys=Ys.next=h;return y}function U0(){return{controller:new PU,data:new Map,refCount:0}}function Wu(u){u.refCount--,u.refCount===0&&zU(FU,function(){u.controller.abort()})}function O0(){var u=Wo.current;return u!==null?u:hn.pooledCache}function pd(u,h){h===null?b(Wo,Wo.current):b(Wo,h.pool)}function gb(){var u=O0();return u===null?null:{parent:Xs?Un._currentValue:Un._currentValue2,pool:u}}function sr(u){u.flags|=4}function vb(u,h){if(u!==null&&u.child===h.child)return!1;if((h.flags&16)!==0)return!0;for(u=h.child;u!==null;){if((u.flags&13878)!==0||(u.subtreeFlags&13878)!==0)return!0;u=u.sibling}return!1}function L0(u,h,y,M){if(Ei)for(y=h.child;y!==null;){if(y.tag===5||y.tag===6)cv(u,y.stateNode);else if(!(y.tag===4||Mi&&y.tag===27)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===h)break;for(;y.sibling===null;){if(y.return===null||y.return===h)return;y=y.return}y.sibling.return=y.return,y=y.sibling}else if(Ga)for(var A=h.child;A!==null;){if(A.tag===5){var N=A.stateNode;y&&M&&(N=SS(N,A.type,A.memoizedProps)),cv(u,N)}else if(A.tag===6)N=A.stateNode,y&&M&&(N=ES(N,A.memoizedProps)),cv(u,N);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)N=A.child,N!==null&&(N.return=A),L0(u,A,!0,!0);else if(A.child!==null){A.child.return=A,A=A.child;continue}}if(A===h)break;for(;A.sibling===null;){if(A.return===null||A.return===h)return;A=A.return}A.sibling.return=A.return,A=A.sibling}}function yb(u,h,y,M){if(Ga)for(var A=h.child;A!==null;){if(A.tag===5){var N=A.stateNode;y&&M&&(N=SS(N,A.type,A.memoizedProps)),xS(u,N)}else if(A.tag===6)N=A.stateNode,y&&M&&(N=ES(N,A.memoizedProps)),xS(u,N);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)N=A.child,N!==null&&(N.return=A),yb(u,A,!(A.memoizedProps!==null&&A.memoizedProps.mode==="manual"),!0);else if(A.child!==null){A.child.return=A,A=A.child;continue}}if(A===h)break;for(;A.sibling===null;){if(A.return===null||A.return===h)return;A=A.return}A.sibling.return=A.return,A=A.sibling}}function _b(u,h){if(Ga&&vb(u,h)){u=h.stateNode;var y=u.containerInfo,M=_S();yb(M,h,!1,!1),u.pendingChildren=M,sr(h),QD(y,M)}}function N0(u,h,y,M){if(Ei)u.memoizedProps!==M&&sr(h);else if(Ga){var A=u.stateNode,N=u.memoizedProps;if((u=vb(u,h))||N!==M){var $=mi.current;N=JD(A,y,N,M,!u,null),N===A?h.stateNode=A:(dS(N,y,M,$)&&sr(h),h.stateNode=N,u?L0(N,h,!1,!1):sr(h))}else h.stateNode=A}}function I0(u,h,y){if(wD(h,y)){if(u.flags|=16777216,!gS(h,y))if(Wb())u.flags|=8192;else throw cc=Ud,Ev}else u.flags&=-16777217}function xb(u,h){if(bU(h)){if(u.flags|=16777216,!LS(h))if(Wb())u.flags|=8192;else throw cc=Ud,Ev}else u.flags&=-16777217}function md(u,h){h!==null&&(u.flags|=4),u.flags&16384&&(h=u.tag!==22?D():536870912,u.lanes|=h,gc|=h)}function Xu(u,h){if(!jt)switch(u.tailMode){case"hidden":h=u.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?u.tail=null:y.sibling=null;break;case"collapsed":y=u.tail;for(var M=null;y!==null;)y.alternate!==null&&(M=y),y=y.sibling;M===null?h||u.tail===null?u.tail=null:u.tail.sibling=null:M.sibling=null}}function bn(u){var h=u.alternate!==null&&u.alternate.child===u.child,y=0,M=0;if(h)for(var A=u.child;A!==null;)y|=A.lanes|A.childLanes,M|=A.subtreeFlags&31457280,M|=A.flags&31457280,A.return=u,A=A.sibling;else for(A=u.child;A!==null;)y|=A.lanes|A.childLanes,M|=A.subtreeFlags,M|=A.flags,A.return=u,A=A.sibling;return u.subtreeFlags|=M,u.childLanes=y,h}function j3(u,h,y){var M=h.pendingProps;switch(K(h),h.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bn(h),null;case 1:return bn(h),null;case 3:return y=h.stateNode,M=null,u!==null&&(M=u.memoizedState.cache),h.memoizedState.cache!==M&&(h.flags|=2048),Hs(Un),J(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(u===null||u.child===null)&&(ve(h)?sr(h):u===null||u.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,Yr!==null&&(j0(Yr),Yr=null))),_b(u,h),bn(h),null;case 26:if(Mr){y=h.type;var A=h.memoizedState;return u===null?(sr(h),A!==null?(bn(h),xb(h,A)):(bn(h),I0(h,y,M))):A?A!==u.memoizedState?(sr(h),bn(h),xb(h,A)):(bn(h),h.flags&=-16777217):(Ei?u.memoizedProps!==M&&sr(h):N0(u,h,y,M),bn(h),I0(h,y,M)),null}case 27:if(Mi){if(re(h),y=Ha.current,A=h.type,u!==null&&h.stateNode!=null)Ei?u.memoizedProps!==M&&sr(h):N0(u,h,A,M);else{if(!M){if(h.stateNode===null)throw Error(r(166));return bn(h),null}u=mi.current,ve(h)?Oe(h,u):(u=NS(A,M,y,u,!0),h.stateNode=u,sr(h))}return bn(h),null}case 5:if(re(h),y=h.type,u!==null&&h.stateNode!=null)N0(u,h,y,M);else{if(!M){if(h.stateNode===null)throw Error(r(166));return bn(h),null}u=mi.current,ve(h)?Oe(h,u):(A=yD(y,M,Ha.current,u,h),L0(A,h,!1,!1),h.stateNode=A,dS(A,y,M,u)&&sr(h))}return bn(h),I0(h,h.type,h.pendingProps),null;case 6:if(u&&h.stateNode!=null)y=u.memoizedProps,Ei?y!==M&&sr(h):Ga&&(y!==M?(h.stateNode=pS(M,Ha.current,mi.current,h),sr(h)):h.stateNode=u.stateNode);else{if(typeof M!="string"&&h.stateNode===null)throw Error(r(166));if(u=Ha.current,y=mi.current,ve(h)){if(!Er)throw Error(r(176));if(u=h.stateNode,y=h.memoizedProps,M=null,A=Ii,A!==null)switch(A.tag){case 27:case 5:M=A.memoizedProps}cU(u,y,h,M)||pe(h)}else h.stateNode=pS(M,u,y,h)}return bn(h),null;case 13:if(M=h.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(A=ve(h),M!==null&&M.dehydrated!==null){if(u===null){if(!A)throw Error(r(318));if(!Er)throw Error(r(344));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));uU(A,h)}else ce(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;bn(h),A=!1}else Yr!==null&&(j0(Yr),Yr=null),A=!0;if(!A)return h.flags&256?(yn(h),h):(yn(h),null)}if(yn(h),(h.flags&128)!==0)return h.lanes=y,h;if(y=M!==null,u=u!==null&&u.memoizedState!==null,y){M=h.child,A=null,M.alternate!==null&&M.alternate.memoizedState!==null&&M.alternate.memoizedState.cachePool!==null&&(A=M.alternate.memoizedState.cachePool.pool);var N=null;M.memoizedState!==null&&M.memoizedState.cachePool!==null&&(N=M.memoizedState.cachePool.pool),N!==A&&(M.flags|=2048)}return y!==u&&y&&(h.child.flags|=8192),md(h,h.updateQueue),bn(h),null;case 4:return J(),_b(u,h),u===null&&bD(h.stateNode.containerInfo),bn(h),null;case 10:return Hs(h.type),bn(h),null;case 19:if(g(ti),A=h.memoizedState,A===null)return bn(h),null;if(M=(h.flags&128)!==0,N=A.rendering,N===null)if(M)Xu(A,!1);else{if(Ln!==0||u!==null&&(u.flags&128)!==0)for(u=h.child;u!==null;){if(N=xn(u),N!==null){for(h.flags|=128,Xu(A,!1),u=N.updateQueue,h.updateQueue=u,md(h,u),h.subtreeFlags=0,u=y,y=h.child;y!==null;)eS(y,u),y=y.sibling;return b(ti,ti.current&1|2),h.child}u=u.sibling}A.tail!==null&&qr()>ah&&(h.flags|=128,M=!0,Xu(A,!1),h.lanes=4194304)}else{if(!M)if(u=xn(N),u!==null){if(h.flags|=128,M=!0,u=u.updateQueue,h.updateQueue=u,md(h,u),Xu(A,!0),A.tail===null&&A.tailMode==="hidden"&&!N.alternate&&!jt)return bn(h),null}else 2*qr()-A.renderingStartTime>ah&&y!==536870912&&(h.flags|=128,M=!0,Xu(A,!1),h.lanes=4194304);A.isBackwards?(N.sibling=h.child,h.child=N):(u=A.last,u!==null?u.sibling=N:h.child=N,A.last=N)}return A.tail!==null?(h=A.tail,A.rendering=h,A.tail=h.sibling,A.renderingStartTime=qr(),h.sibling=null,u=ti.current,b(ti,M?u&1|2:u&1),h):(bn(h),null);case 22:case 23:return yn(h),kn(),M=h.memoizedState!==null,u!==null?u.memoizedState!==null!==M&&(h.flags|=8192):M&&(h.flags|=8192),M?(y&536870912)!==0&&(h.flags&128)===0&&(bn(h),h.subtreeFlags&6&&(h.flags|=8192)):bn(h),y=h.updateQueue,y!==null&&md(h,y.retryQueue),y=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),M=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(M=h.memoizedState.cachePool.pool),M!==y&&(h.flags|=2048),u!==null&&g(Wo),null;case 24:return y=null,u!==null&&(y=u.memoizedState.cache),h.memoizedState.cache!==y&&(h.flags|=2048),Hs(Un),bn(h),null;case 25:return null}throw Error(r(156,h.tag))}function q3(u,h){switch(K(h),h.tag){case 1:return u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 3:return Hs(Un),J(),u=h.flags,(u&65536)!==0&&(u&128)===0?(h.flags=u&-65537|128,h):null;case 26:case 27:case 5:return re(h),null;case 13:if(yn(h),u=h.memoizedState,u!==null&&u.dehydrated!==null){if(h.alternate===null)throw Error(r(340));ce()}return u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 19:return g(ti),null;case 4:return J(),null;case 10:return Hs(h.type),null;case 22:case 23:return yn(h),kn(),u!==null&&g(Wo),u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 24:return Hs(Un),null;case 25:return null;default:return null}}function bb(u,h){switch(K(h),h.tag){case 3:Hs(Un),J();break;case 26:case 27:case 5:re(h);break;case 4:J();break;case 13:yn(h);break;case 19:g(ti);break;case 10:Hs(h.type);break;case 22:case 23:yn(h),kn(),u!==null&&g(Wo);break;case 24:Hs(Un)}}function ju(u,h){try{var y=h.updateQueue,M=y!==null?y.lastEffect:null;if(M!==null){var A=M.next;y=A;do{if((y.tag&u)===u){M=void 0;var N=y.create,$=y.inst;M=N(),$.destroy=M}y=y.next}while(y!==A)}}catch(ae){sn(h,h.return,ae)}}function Ia(u,h,y){try{var M=h.updateQueue,A=M!==null?M.lastEffect:null;if(A!==null){var N=A.next;M=N;do{if((M.tag&u)===u){var $=M.inst,ae=$.destroy;if(ae!==void 0){$.destroy=void 0,A=h;var Ee=y;try{ae()}catch(ke){sn(A,Ee,ke)}}}M=M.next}while(M!==N)}}catch(ke){sn(h,h.return,ke)}}function Sb(u){var h=u.updateQueue;if(h!==null){var y=u.stateNode;try{ze(h,y)}catch(M){sn(u,u.return,M)}}}function Eb(u,h,y){y.props=Xr(u.type,u.memoizedProps),y.state=u.memoizedState;try{y.componentWillUnmount()}catch(M){sn(u,h,M)}}function Oo(u,h){try{var y=u.ref;if(y!==null){var M=u.stateNode;switch(u.tag){case 26:case 27:case 5:var A=Zu(M);break;default:A=M}typeof y=="function"?u.refCleanup=y(A):y.current=A}}catch(N){sn(u,h,N)}}function ar(u,h){var y=u.ref,M=u.refCleanup;if(y!==null)if(typeof M=="function")try{M()}catch(A){sn(u,h,A)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof y=="function")try{y(null)}catch(A){sn(u,h,A)}else y.current=null}function Mb(u){var h=u.type,y=u.memoizedProps,M=u.stateNode;try{kD(M,h,y,u)}catch(A){sn(u,u.return,A)}}function wb(u,h,y){try{GD(u.stateNode,u.type,y,h,u)}catch(M){sn(u,u.return,M)}}function Tb(u){return u.tag===5||u.tag===3||(Mr?u.tag===26:!1)||(Mi?u.tag===27:!1)||u.tag===4}function P0(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Tb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&(!Mi||u.tag!==27)&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function z0(u,h,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,h?VD(y,u,h):FD(y,u);else if(!(M===4||Mi&&M===27)&&(u=u.child,u!==null))for(z0(u,h,y),u=u.sibling;u!==null;)z0(u,h,y),u=u.sibling}function gd(u,h,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,h?HD(y,u,h):zD(y,u);else if(!(M===4||Mi&&M===27)&&(u=u.child,u!==null))for(gd(u,h,y),u=u.sibling;u!==null;)gd(u,h,y),u=u.sibling}function Ab(u,h,y){u=u.containerInfo;try{bS(u,y)}catch(M){sn(h,h.return,M)}}function Y3(u,h){for(gD(u.containerInfo),ui=h;ui!==null;)if(u=ui,h=u.child,(u.subtreeFlags&1028)!==0&&h!==null)h.return=u,ui=h;else for(;ui!==null;){u=ui;var y=u.alternate;switch(h=u.flags,u.tag){case 0:break;case 11:case 15:break;case 1:if((h&1024)!==0&&y!==null){h=void 0;var M=u,A=y.memoizedProps;y=y.memoizedState;var N=M.stateNode;try{var $=Xr(M.type,A,M.elementType===M.type);h=N.getSnapshotBeforeUpdate($,y),N.__reactInternalSnapshotBeforeUpdate=h}catch(ae){sn(M,M.return,ae)}}break;case 3:(h&1024)!==0&&Ei&&KD(u.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((h&1024)!==0)throw Error(r(163))}if(h=u.sibling,h!==null){h.return=u.return,ui=h;break}ui=u.return}return $=VS,VS=!1,$}function Cb(u,h,y){var M=y.flags;switch(y.tag){case 0:case 11:case 15:Vs(u,y),M&4&&ju(5,y);break;case 1:if(Vs(u,y),M&4)if(u=y.stateNode,h===null)try{u.componentDidMount()}catch(ae){sn(y,y.return,ae)}else{var A=Xr(y.type,h.memoizedProps);h=h.memoizedState;try{u.componentDidUpdate(A,h,u.__reactInternalSnapshotBeforeUpdate)}catch(ae){sn(y,y.return,ae)}}M&64&&Sb(y),M&512&&Oo(y,y.return);break;case 3:if(Vs(u,y),M&64&&(M=y.updateQueue,M!==null)){if(u=null,y.child!==null)switch(y.child.tag){case 27:case 5:u=Zu(y.child.stateNode);break;case 1:u=y.child.stateNode}try{ze(M,u)}catch(ae){sn(y,y.return,ae)}}break;case 26:if(Mr){Vs(u,y),M&512&&Oo(y,y.return);break}case 27:case 5:Vs(u,y),h===null&&M&4&&Mb(y),M&512&&Oo(y,y.return);break;case 12:Vs(u,y);break;case 13:Vs(u,y),M&4&&Db(u,y);break;case 22:if(A=y.memoizedState!==null||Zs,!A){h=h!==null&&h.memoizedState!==null||On;var N=Zs,$=On;Zs=A,(On=h)&&!$?Pa(u,y,(y.subtreeFlags&8772)!==0):Vs(u,y),Zs=N,On=$}M&512&&(y.memoizedProps.mode==="manual"?Oo(y,y.return):ar(y,y.return));break;default:Vs(u,y)}}function Rb(u){var h=u.alternate;h!==null&&(u.alternate=null,Rb(h)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(h=u.stateNode,h!==null&&MD(h)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function jr(u,h,y){for(y=y.child;y!==null;)F0(u,h,y),y=y.sibling}function F0(u,h,y){if(hr&&typeof hr.onCommitFiberUnmount=="function")try{hr.onCommitFiberUnmount(Qu,y)}catch{}switch(y.tag){case 26:if(Mr){On||ar(y,h),jr(u,h,y),y.memoizedState?DS(y.memoizedState):y.stateNode&&OS(y.stateNode);break}case 27:if(Mi){On||ar(y,h);var M=jn,A=dr;jn=y.stateNode,jr(u,h,y),wU(y.stateNode),jn=M,dr=A;break}case 5:On||ar(y,h);case 6:if(Ei){if(M=jn,A=dr,jn=null,jr(u,h,y),jn=M,dr=A,jn!==null)if(dr)try{XD(jn,y.stateNode)}catch(N){sn(y,h,N)}else try{WD(jn,y.stateNode)}catch(N){sn(y,h,N)}}else jr(u,h,y);break;case 18:Ei&&jn!==null&&(dr?mU(jn,y.stateNode):pU(jn,y.stateNode));break;case 4:Ei?(M=jn,A=dr,jn=y.stateNode.containerInfo,dr=!0,jr(u,h,y),jn=M,dr=A):(Ga&&Ab(y.stateNode,y,_S()),jr(u,h,y));break;case 0:case 11:case 14:case 15:On||Ia(2,y,h),On||Ia(4,y,h),jr(u,h,y);break;case 1:On||(ar(y,h),M=y.stateNode,typeof M.componentWillUnmount=="function"&&Eb(y,h,M)),jr(u,h,y);break;case 21:jr(u,h,y);break;case 22:On||ar(y,h),On=(M=On)||y.memoizedState!==null,jr(u,h,y),On=M;break;default:jr(u,h,y)}}function Db(u,h){if(Er&&h.memoizedState===null&&(u=h.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{dU(u)}catch(y){sn(h,h.return,y)}}function Z3(u){switch(u.tag){case 13:case 19:var h=u.stateNode;return h===null&&(h=u.stateNode=new HS),h;case 22:return u=u.stateNode,h=u._retryCache,h===null&&(h=u._retryCache=new HS),h;default:throw Error(r(435,u.tag))}}function B0(u,h){var y=Z3(u);h.forEach(function(M){var A=iD.bind(null,u,M);y.has(M)||(y.add(M),M.then(A,A))})}function Yi(u,h){var y=h.deletions;if(y!==null)for(var M=0;M<y.length;M++){var A=y[M],N=u,$=h;if(Ei){var ae=$;e:for(;ae!==null;){switch(ae.tag){case 27:case 5:jn=ae.stateNode,dr=!1;break e;case 3:jn=ae.stateNode.containerInfo,dr=!0;break e;case 4:jn=ae.stateNode.containerInfo,dr=!0;break e}ae=ae.return}if(jn===null)throw Error(r(160));F0(N,$,A),jn=null,dr=!1}else F0(N,$,A);N=A.alternate,N!==null&&(N.return=null),A.return=null}if(h.subtreeFlags&13878)for(h=h.child;h!==null;)Ub(h,u),h=h.sibling}function Ub(u,h){var y=u.alternate,M=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:Yi(h,u),or(u),M&4&&(Ia(3,u,u.return),ju(3,u),Ia(5,u,u.return));break;case 1:Yi(h,u),or(u),M&512&&(On||y===null||ar(y,y.return)),M&64&&Zs&&(u=u.updateQueue,u!==null&&(M=u.callbacks,M!==null&&(y=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=y===null?M:y.concat(M))));break;case 26:if(Mr){var A=Zr;Yi(h,u),or(u),M&512&&(On||y===null||ar(y,y.return)),M&4&&(M=y!==null?y.memoizedState:null,h=u.memoizedState,y===null?h===null?u.stateNode===null?u.stateNode=yU(A,u.type,u.memoizedProps,u):US(A,u.type,u.stateNode):u.stateNode=RS(A,h,u.memoizedProps):M!==h?(M===null?y.stateNode!==null&&OS(y.stateNode):DS(M),h===null?US(A,u.type,u.stateNode):RS(A,h,u.memoizedProps)):h===null&&u.stateNode!==null&&wb(u,u.memoizedProps,y.memoizedProps));break}case 27:if(Mi&&M&4&&u.alternate===null){A=u.stateNode;var N=u.memoizedProps;try{EU(A),MU(u.type,N,A,u)}catch(Ye){sn(u,u.return,Ye)}}case 5:if(Yi(h,u),or(u),M&512&&(On||y===null||ar(y,y.return)),Ei){if(u.flags&32){h=u.stateNode;try{yS(h)}catch(Ye){sn(u,u.return,Ye)}}M&4&&u.stateNode!=null&&(h=u.memoizedProps,wb(u,h,y!==null?y.memoizedProps:h)),M&1024&&(Av=!0)}break;case 6:if(Yi(h,u),or(u),M&4&&Ei){if(u.stateNode===null)throw Error(r(162));M=u.memoizedProps,y=y!==null?y.memoizedProps:M,h=u.stateNode;try{BD(h,y,M)}catch(Ye){sn(u,u.return,Ye)}}break;case 3:if(Mr?(xU(),A=Zr,Zr=dv(h.containerInfo),Yi(h,u),Zr=A):Yi(h,u),or(u),M&4){if(Ei&&Er&&y!==null&&y.memoizedState.isDehydrated)try{fU(h.containerInfo)}catch(Ye){sn(u,u.return,Ye)}if(Ga){M=h.containerInfo,y=h.pendingChildren;try{bS(M,y)}catch(Ye){sn(u,u.return,Ye)}}}Av&&(Av=!1,Ob(u));break;case 4:Mr?(y=Zr,Zr=dv(u.stateNode.containerInfo),Yi(h,u),or(u),Zr=y):(Yi(h,u),or(u)),M&4&&Ga&&Ab(u.stateNode,u,u.stateNode.pendingChildren);break;case 12:Yi(h,u),or(u);break;case 13:Yi(h,u),or(u),u.child.flags&8192&&u.memoizedState!==null!=(y!==null&&y.memoizedState!==null)&&(Uv=qr()),M&4&&(M=u.updateQueue,M!==null&&(u.updateQueue=null,B0(u,M)));break;case 22:M&512&&(On||y===null||ar(y,y.return)),A=u.memoizedState!==null;var $=y!==null&&y.memoizedState!==null,ae=Zs,Ee=On;if(Zs=ae||A,On=Ee||$,Yi(h,u),On=Ee,Zs=ae,or(u),h=u.stateNode,h._current=u,h._visibility&=-3,h._visibility|=h._pendingVisibility&2,M&8192&&(h._visibility=A?h._visibility&-2:h._visibility|1,A&&(h=Zs||On,y===null||$||h||ql(u)),Ei&&(u.memoizedProps===null||u.memoizedProps.mode!=="manual"))){e:if(y=null,Ei)for(h=u;;){if(h.tag===5||Mr&&h.tag===26||Mi&&h.tag===27){if(y===null){$=y=h;try{N=$.stateNode,A?jD(N):YD($.stateNode,$.memoizedProps)}catch(Ye){sn($,$.return,Ye)}}}else if(h.tag===6){if(y===null){$=h;try{var ke=$.stateNode;A?qD(ke):ZD(ke,$.memoizedProps)}catch(Ye){sn($,$.return,Ye)}}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===u)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break e;for(;h.sibling===null;){if(h.return===null||h.return===u)break e;y===h&&(y=null),h=h.return}y===h&&(y=null),h.sibling.return=h.return,h=h.sibling}}M&4&&(M=u.updateQueue,M!==null&&(y=M.retryQueue,y!==null&&(M.retryQueue=null,B0(u,y))));break;case 19:Yi(h,u),or(u),M&4&&(M=u.updateQueue,M!==null&&(u.updateQueue=null,B0(u,M)));break;case 21:break;default:Yi(h,u),or(u)}}function or(u){var h=u.flags;if(h&2){try{if(Ei&&(!Mi||u.tag!==27)){e:{for(var y=u.return;y!==null;){if(Tb(y)){var M=y;break e}y=y.return}throw Error(r(160))}switch(M.tag){case 27:if(Mi){var A=M.stateNode,N=P0(u);gd(u,N,A);break}case 5:var $=M.stateNode;M.flags&32&&(yS($),M.flags&=-33);var ae=P0(u);gd(u,ae,$);break;case 3:case 4:var Ee=M.stateNode.containerInfo,ke=P0(u);z0(u,ke,Ee);break;default:throw Error(r(161))}}}catch(Ye){sn(u,u.return,Ye)}u.flags&=-3}h&4096&&(u.flags&=-4097)}function Ob(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var h=u;Ob(h),h.tag===5&&h.flags&1024&&CD(h.stateNode),u=u.sibling}}function Vs(u,h){if(h.subtreeFlags&8772)for(h=h.child;h!==null;)Cb(u,h.alternate,h),h=h.sibling}function ql(u){for(u=u.child;u!==null;){var h=u;switch(h.tag){case 0:case 11:case 14:case 15:Ia(4,h,h.return),ql(h);break;case 1:ar(h,h.return);var y=h.stateNode;typeof y.componentWillUnmount=="function"&&Eb(h,h.return,y),ql(h);break;case 26:case 27:case 5:ar(h,h.return),ql(h);break;case 22:ar(h,h.return),h.memoizedState===null&&ql(h);break;default:ql(h)}u=u.sibling}}function Pa(u,h,y){for(y=y&&(h.subtreeFlags&8772)!==0,h=h.child;h!==null;){var M=h.alternate,A=u,N=h,$=N.flags;switch(N.tag){case 0:case 11:case 15:Pa(A,N,y),ju(4,N);break;case 1:if(Pa(A,N,y),M=N,A=M.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(ke){sn(M,M.return,ke)}if(M=N,A=M.updateQueue,A!==null){var ae=M.stateNode;try{var Ee=A.shared.hiddenCallbacks;if(Ee!==null)for(A.shared.hiddenCallbacks=null,A=0;A<Ee.length;A++)se(Ee[A],ae)}catch(ke){sn(M,M.return,ke)}}y&&$&64&&Sb(N),Oo(N,N.return);break;case 26:case 27:case 5:Pa(A,N,y),y&&M===null&&$&4&&Mb(N),Oo(N,N.return);break;case 12:Pa(A,N,y);break;case 13:Pa(A,N,y),y&&$&4&&Db(A,N);break;case 22:N.memoizedState===null&&Pa(A,N,y),Oo(N,N.return);break;default:Pa(A,N,y)}h=h.sibling}}function k0(u,h){var y=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),u=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(u=h.memoizedState.cachePool.pool),u!==y&&(u!=null&&u.refCount++,y!=null&&Wu(y))}function G0(u,h){u=null,h.alternate!==null&&(u=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==u&&(h.refCount++,u!=null&&Wu(u))}function za(u,h,y,M){if(h.subtreeFlags&10256)for(h=h.child;h!==null;)Lb(u,h,y,M),h=h.sibling}function Lb(u,h,y,M){var A=h.flags;switch(h.tag){case 0:case 11:case 15:za(u,h,y,M),A&2048&&ju(9,h);break;case 3:za(u,h,y,M),A&2048&&(u=null,h.alternate!==null&&(u=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==u&&(h.refCount++,u!=null&&Wu(u)));break;case 12:if(A&2048){za(u,h,y,M),u=h.stateNode;try{var N=h.memoizedProps,$=N.id,ae=N.onPostCommit;typeof ae=="function"&&ae($,h.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(Ee){sn(h,h.return,Ee)}}else za(u,h,y,M);break;case 23:break;case 22:N=h.stateNode,h.memoizedState!==null?N._visibility&4?za(u,h,y,M):qu(u,h):N._visibility&4?za(u,h,y,M):(N._visibility|=4,Yl(u,h,y,M,(h.subtreeFlags&10256)!==0)),A&2048&&k0(h.alternate,h);break;case 24:za(u,h,y,M),A&2048&&G0(h.alternate,h);break;default:za(u,h,y,M)}}function Yl(u,h,y,M,A){for(A=A&&(h.subtreeFlags&10256)!==0,h=h.child;h!==null;){var N=u,$=h,ae=y,Ee=M,ke=$.flags;switch($.tag){case 0:case 11:case 15:Yl(N,$,ae,Ee,A),ju(8,$);break;case 23:break;case 22:var Ye=$.stateNode;$.memoizedState!==null?Ye._visibility&4?Yl(N,$,ae,Ee,A):qu(N,$):(Ye._visibility|=4,Yl(N,$,ae,Ee,A)),A&&ke&2048&&k0($.alternate,$);break;case 24:Yl(N,$,ae,Ee,A),A&&ke&2048&&G0($.alternate,$);break;default:Yl(N,$,ae,Ee,A)}h=h.sibling}}function qu(u,h){if(h.subtreeFlags&10256)for(h=h.child;h!==null;){var y=u,M=h,A=M.flags;switch(M.tag){case 22:qu(y,M),A&2048&&k0(M.alternate,M);break;case 24:qu(y,M),A&2048&&G0(M.alternate,M);break;default:qu(y,M)}h=h.sibling}}function Lo(u){if(u.subtreeFlags&pc)for(u=u.child;u!==null;)Nb(u),u=u.sibling}function Nb(u){switch(u.tag){case 26:Lo(u),u.flags&pc&&(u.memoizedState!==null?SU(Zr,u.memoizedState,u.memoizedProps):vS(u.type,u.memoizedProps));break;case 5:Lo(u),u.flags&pc&&vS(u.type,u.memoizedProps);break;case 3:case 4:if(Mr){var h=Zr;Zr=dv(u.stateNode.containerInfo),Lo(u),Zr=h}else Lo(u);break;case 22:u.memoizedState===null&&(h=u.alternate,h!==null&&h.memoizedState!==null?(h=pc,pc=16777216,Lo(u),pc=h):Lo(u));break;default:Lo(u)}}function Ib(u){var h=u.alternate;if(h!==null&&(u=h.child,u!==null)){h.child=null;do h=u.sibling,u.sibling=null,u=h;while(u!==null)}}function Yu(u){var h=u.deletions;if((u.flags&16)!==0){if(h!==null)for(var y=0;y<h.length;y++){var M=h[y];ui=M,zb(M,u)}Ib(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)Pb(u),u=u.sibling}function Pb(u){switch(u.tag){case 0:case 11:case 15:Yu(u),u.flags&2048&&Ia(9,u,u.return);break;case 3:Yu(u);break;case 12:Yu(u);break;case 22:var h=u.stateNode;u.memoizedState!==null&&h._visibility&4&&(u.return===null||u.return.tag!==13)?(h._visibility&=-5,vd(u)):Yu(u);break;default:Yu(u)}}function vd(u){var h=u.deletions;if((u.flags&16)!==0){if(h!==null)for(var y=0;y<h.length;y++){var M=h[y];ui=M,zb(M,u)}Ib(u)}for(u=u.child;u!==null;){switch(h=u,h.tag){case 0:case 11:case 15:Ia(8,h,h.return),vd(h);break;case 22:y=h.stateNode,y._visibility&4&&(y._visibility&=-5,vd(h));break;default:vd(h)}u=u.sibling}}function zb(u,h){for(;ui!==null;){var y=ui;switch(y.tag){case 0:case 11:case 15:Ia(8,y,h);break;case 23:case 22:if(y.memoizedState!==null&&y.memoizedState.cachePool!==null){var M=y.memoizedState.cachePool.pool;M!=null&&M.refCount++}break;case 24:Wu(y.memoizedState.cache)}if(M=y.child,M!==null)M.return=y,ui=M;else e:for(y=u;ui!==null;){M=ui;var A=M.sibling,N=M.return;if(Rb(M),M===y){ui=null;break e}if(A!==null){A.return=N,ui=A;break e}ui=N}}}function H0(u){var h=mS(u);if(h!=null){if(typeof h.memoizedProps["data-testname"]!="string")throw Error(r(364));return h}if(u=UD(u),u===null)throw Error(r(362));return u.stateNode.current}function V0(u,h){var y=u.tag;switch(h.$$typeof){case Pd:if(u.type===h.value)return!0;break;case zd:e:{for(h=h.value,u=[u,0],y=0;y<u.length;){var M=u[y++],A=M.tag,N=u[y++],$=h[N];if(A!==5&&A!==26&&A!==27||!Ju(M)){for(;$!=null&&V0(M,$);)N++,$=h[N];if(N===h.length){h=!0;break e}else for(M=M.child;M!==null;)u.push(M,N),M=M.sibling}}h=!1}return h;case Fd:if((y===5||y===26||y===27)&&ND(u.stateNode,h.value))return!0;break;case kd:if((y===5||y===6||y===26||y===27)&&(u=LD(u),u!==null&&0<=u.indexOf(h.value)))return!0;break;case Bd:if((y===5||y===26||y===27)&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===h.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function W0(u){switch(u.$$typeof){case Pd:return"<"+(a(u.value)||"Unknown")+">";case zd:return":has("+(W0(u)||"")+")";case Fd:return'[role="'+u.value+'"]';case kd:return'"'+u.value+'"';case Bd:return'[data-testname="'+u.value+'"]';default:throw Error(r(365))}}function Fb(u,h){var y=[];u=[u,0];for(var M=0;M<u.length;){var A=u[M++],N=A.tag,$=u[M++],ae=h[$];if(N!==5&&N!==26&&N!==27||!Ju(A)){for(;ae!=null&&V0(A,ae);)$++,ae=h[$];if($===h.length)y.push(A);else for(A=A.child;A!==null;)u.push(A,$),A=A.sibling}}return y}function X0(u,h){if(!Ku)throw Error(r(363));u=H0(u),u=Fb(u,h),h=[],u=Array.from(u);for(var y=0;y<u.length;){var M=u[y++],A=M.tag;if(A===5||A===26||A===27)Ju(M)||h.push(M.stateNode);else for(M=M.child;M!==null;)u.push(M),M=M.sibling}return h}function lr(){if((ln&2)!==0&&Vt!==0)return Vt&-Vt;if(Mt.T!==null){var u=oc;return u!==0?u:ge()}return SD()}function Bb(){Rr===0&&(Rr=(Vt&536870912)===0||jt?U():536870912);var u=Cr.current;return u!==null&&(u.flags|=32),Rr}function Ni(u,h,y){(u===hn&&fn===2||u.cancelPendingCommit!==null)&&(Zl(u,0),Ws(u,Vt,Rr,!1)),I(u,y),((ln&2)===0||u!==hn)&&(u===hn&&((ln&2)===0&&(Xo|=y),Ln===4&&Ws(u,Vt,Rr,!1)),_e(u))}function kb(u,h,y){if((ln&6)!==0)throw Error(r(327));var M=!y&&(h&60)===0&&(h&u.expiredLanes)===0||T(u,h),A=M?Q3(u,h):Z0(u,h,!0),N=M;do{if(A===0){mc&&!M&&Ws(u,h,0,!1);break}else if(A===6)Ws(u,h,0,!Ks);else{if(y=u.current.alternate,N&&!K3(y)){A=Z0(u,h,!1),N=!1;continue}if(A===2){if(N=h,u.errorRecoveryDisabledLanes&N)var $=0;else $=u.pendingLanes&-536870913,$=$!==0?$:$&536870912?536870912:0;if($!==0){h=$;e:{var ae=u;A=sh;var Ee=Er&&ae.current.memoizedState.isDehydrated;if(Ee&&(Zl(ae,$).flags|=256),$=Z0(ae,$,!1),$!==2){if(Cv&&!Ee){ae.errorRecoveryDisabledLanes|=N,Xo|=N,A=4;break e}N=gs,gs=A,N!==null&&j0(N)}A=$}if(N=!1,A!==2)continue}}if(A===1){Zl(u,0),Ws(u,h,0,!0);break}e:{switch(M=u,A){case 0:case 1:throw Error(r(345));case 4:if((h&4194176)===h){Ws(M,h,Rr,!Ks);break e}break;case 2:gs=null;break;case 3:case 5:break;default:throw Error(r(329))}if(M.finishedWork=y,M.finishedLanes=h,(h&62914560)===h&&(N=Uv+300-qr(),10<N)){if(Ws(M,h,Rr,!Ks),w(M,0)!==0)break e;M.timeoutHandle=_D(Gb.bind(null,M,y,gs,Gd,Dv,h,Rr,Xo,gc,Ks,2,-0,0),N);break e}Gb(M,y,gs,Gd,Dv,h,Rr,Xo,gc,Ks,0,-0,0)}}break}while(!0);_e(u)}function j0(u){gs===null?gs=u:gs.push.apply(gs,u)}function Gb(u,h,y,M,A,N,$,ae,Ee,ke,Ye,ot,ht){var Rt=h.subtreeFlags;if((Rt&8192||(Rt&16785408)===16785408)&&(TD(),Nb(h),h=AD(),h!==null)){u.cancelPendingCommit=h(Kb.bind(null,u,y,M,A,$,ae,Ee,1,ot,ht)),Ws(u,N,$,!ke);return}Kb(u,y,M,A,$,ae,Ee,Ye,ot,ht)}function K3(u){for(var h=u;;){var y=h.tag;if((y===0||y===11||y===15)&&h.flags&16384&&(y=h.updateQueue,y!==null&&(y=y.stores,y!==null)))for(var M=0;M<y.length;M++){var A=y[M],N=A.getSnapshot;A=A.value;try{if(!fr(N(),A))return!1}catch{return!1}}if(y=h.child,h.subtreeFlags&16384&&y!==null)y.return=h,h=y;else{if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function Ws(u,h,y,M){h&=~Rv,h&=~Xo,u.suspendedLanes|=h,u.pingedLanes&=~h,M&&(u.warmLanes|=h),M=u.expirationTimes;for(var A=h;0<A;){var N=31-ur(A),$=1<<N;M[N]=-1,A&=~$}y!==0&&O(u,y,h)}function Hb(){return(ln&6)===0?(ne(0),!1):!0}function q0(){if(Bt!==null){if(fn===0)var u=Bt.return;else u=Bt,Ys=Vo=null,Da(u),uc=null,nh=0,u=Bt;for(;u!==null;)bb(u.alternate,u),u=u.return;Bt=null}}function Zl(u,h){u.finishedWork=null,u.finishedLanes=0;var y=u.timeoutHandle;y!==uv&&(u.timeoutHandle=uv,xD(y)),y=u.cancelPendingCommit,y!==null&&(u.cancelPendingCommit=null,y()),q0(),hn=u,Bt=y=Fa(u.current,null),Vt=h,fn=0,pr=null,Ks=!1,mc=T(u,h),Cv=!1,gc=Rr=Rv=Xo=ja=Ln=0,gs=sh=null,Dv=!1,(h&8)!==0&&(h|=h&32);var M=u.entangledLanes;if(M!==0)for(u=u.entanglements,M&=h;0<M;){var A=31-ur(M),N=1<<A;h|=u[A],M&=~N}return Js=h,G(),y}function Vb(u,h){It=null,Mt.H=ms,h===th?(h=Ke(),fn=3):h===Ev?(h=Ke(),fn=4):fn=h===kS?8:h!==null&&typeof h=="object"&&typeof h.then=="function"?6:1,pr=h,Bt===null&&(Ln=1,fs(u,H(h,u.current)))}function Wb(){var u=Cr.current;return u===null?!0:(Vt&4194176)===Vt?ps===null:(Vt&62914560)===Vt||(Vt&536870912)!==0?u===ps:!1}function Xb(){var u=Mt.H;return Mt.H=ms,u===null?ms:u}function jb(){var u=Mt.A;return Mt.A=BU,u}function Y0(){Ln=4,Ks||(Vt&4194176)!==Vt&&Cr.current!==null||(mc=!0),(ja&134217727)===0&&(Xo&134217727)===0||hn===null||Ws(hn,Vt,Rr,!1)}function Z0(u,h,y){var M=ln;ln|=2;var A=Xb(),N=jb();(hn!==u||Vt!==h)&&(Gd=null,Zl(u,h)),h=!1;var $=Ln;e:do try{if(fn!==0&&Bt!==null){var ae=Bt,Ee=pr;switch(fn){case 8:q0(),$=6;break e;case 3:case 2:case 6:Cr.current===null&&(h=!0);var ke=fn;if(fn=0,pr=null,Kl(u,ae,Ee,ke),y&&mc){$=0;break e}break;default:ke=fn,fn=0,pr=null,Kl(u,ae,Ee,ke)}}J3(),$=Ln;break}catch(Ye){Vb(u,Ye)}while(!0);return h&&u.shellSuspendCounter++,Ys=Vo=null,ln=M,Mt.H=A,Mt.A=N,Bt===null&&(hn=null,Vt=0,G()),$}function J3(){for(;Bt!==null;)qb(Bt)}function Q3(u,h){var y=ln;ln|=2;var M=Xb(),A=jb();hn!==u||Vt!==h?(Gd=null,ah=qr()+500,Zl(u,h)):mc=T(u,h);e:do try{if(fn!==0&&Bt!==null){h=Bt;var N=pr;t:switch(fn){case 1:fn=0,pr=null,Kl(u,h,N,1);break;case 2:if(rt(N)){fn=0,pr=null,Yb(h);break}h=function(){fn===2&&hn===u&&(fn=7),_e(u)},N.then(h,h);break e;case 3:fn=7;break e;case 4:fn=5;break e;case 7:rt(N)?(fn=0,pr=null,Yb(h)):(fn=0,pr=null,Kl(u,h,N,7));break;case 5:var $=null;switch(Bt.tag){case 26:$=Bt.memoizedState;case 5:case 27:var ae=Bt,Ee=ae.type,ke=ae.pendingProps;if($?LS($):gS(Ee,ke)){fn=0,pr=null;var Ye=ae.sibling;if(Ye!==null)Bt=Ye;else{var ot=ae.return;ot!==null?(Bt=ot,yd(ot)):Bt=null}break t}}fn=0,pr=null,Kl(u,h,N,5);break;case 6:fn=0,pr=null,Kl(u,h,N,6);break;case 8:q0(),Ln=6;break e;default:throw Error(r(462))}}$3();break}catch(ht){Vb(u,ht)}while(!0);return Ys=Vo=null,Mt.H=M,Mt.A=A,ln=y,Bt!==null?0:(hn=null,Vt=0,G(),Ln)}function $3(){for(;Bt!==null&&!CU();)qb(Bt)}function qb(u){var h=pb(u.alternate,u,Js);u.memoizedProps=u.pendingProps,h===null?yd(u):Bt=h}function Yb(u){var h=u,y=h.alternate;switch(h.tag){case 15:case 0:h=Hu(y,h,h.pendingProps,h.type,void 0,Vt);break;case 11:h=Hu(y,h,h.pendingProps,h.type.render,h.ref,Vt);break;case 5:Da(h);default:bb(y,h),h=Bt=eS(h,Js),h=pb(y,h,Js)}u.memoizedProps=u.pendingProps,h===null?yd(u):Bt=h}function Kl(u,h,y,M){Ys=Vo=null,Da(h),uc=null,nh=0;var A=h.return;try{if(b0(u,A,h,y,Vt)){Ln=1,fs(u,H(y,u.current)),Bt=null;return}}catch(N){if(A!==null)throw Bt=A,N;Ln=1,fs(u,H(y,u.current)),Bt=null;return}h.flags&32768?(jt||M===1?u=!0:mc||(Vt&536870912)!==0?u=!1:(Ks=u=!0,(M===2||M===3||M===6)&&(M=Cr.current,M!==null&&M.tag===13&&(M.flags|=16384))),Zb(h,u)):yd(h)}function yd(u){var h=u;do{if((h.flags&32768)!==0){Zb(h,Ks);return}u=h.return;var y=j3(h.alternate,h,Js);if(y!==null){Bt=y;return}if(h=h.sibling,h!==null){Bt=h;return}Bt=h=u}while(h!==null);Ln===0&&(Ln=5)}function Zb(u,h){do{var y=q3(u.alternate,u);if(y!==null){y.flags&=32767,Bt=y;return}if(y=u.return,y!==null&&(y.flags|=32768,y.subtreeFlags=0,y.deletions=null),!h&&(u=u.sibling,u!==null)){Bt=u;return}Bt=u=y}while(u!==null);Ln=6,Bt=null}function Kb(u,h,y,M,A,N,$,ae,Ee,ke){var Ye=Mt.T,ot=Po();try{Zi(2),Mt.T=null,eD(u,h,y,M,ot,A,N,$,ae,Ee,ke)}finally{Mt.T=Ye,Zi(ot)}}function eD(u,h,y,M,A,N,$,ae){do No();while(jo!==null);if((ln&6)!==0)throw Error(r(327));var Ee=u.finishedWork;if(M=u.finishedLanes,Ee===null)return null;if(u.finishedWork=null,u.finishedLanes=0,Ee===u.current)throw Error(r(177));u.callbackNode=null,u.callbackPriority=0,u.cancelPendingCommit=null;var ke=Ee.lanes|Ee.childLanes;if(ke|=yv,z(u,M,ke,N,$,ae),u===hn&&(Bt=hn=null,Vt=0),(Ee.subtreeFlags&10256)===0&&(Ee.flags&10256)===0||Hd||(Hd=!0,Ov=ke,Lv=y,rD(gv,function(){return No(),null})),y=(Ee.flags&15990)!==0,(Ee.subtreeFlags&15990)!==0||y?(y=Mt.T,Mt.T=null,N=Po(),Zi(2),$=ln,ln|=4,Y3(u,Ee),Ub(Ee,u),vD(u.containerInfo),u.current=Ee,Cb(u,Ee.alternate,Ee),RU(),ln=$,Zi(N),Mt.T=y):u.current=Ee,Hd?(Hd=!1,jo=u,oh=M):Jb(u,ke),ke=u.pendingLanes,ke===0&&(qa=null),P(Ee.stateNode),_e(u),h!==null)for(A=u.onRecoverableError,Ee=0;Ee<h.length;Ee++)ke=h[Ee],A(ke.value,{componentStack:ke.stack});return(oh&3)!==0&&No(),ke=u.pendingLanes,(M&4194218)!==0&&(ke&42)!==0?u===Nv?lh++:(lh=0,Nv=u):lh=0,ne(0),null}function Jb(u,h){(u.pooledCacheLanes&=h)===0&&(h=u.pooledCache,h!=null&&(u.pooledCache=null,Wu(h)))}function No(){if(jo!==null){var u=jo,h=Ov;Ov=0;var y=ee(oh),M=32>y?32:y;y=Mt.T;var A=Po();try{if(Zi(M),Mt.T=null,jo===null)var N=!1;else{M=Lv,Lv=null;var $=jo,ae=oh;if(jo=null,oh=0,(ln&6)!==0)throw Error(r(331));var Ee=ln;if(ln|=4,Pb($.current),Lb($,$.current,ae,M),ln=Ee,ne(0,!1),hr&&typeof hr.onPostCommitFiberRoot=="function")try{hr.onPostCommitFiberRoot(Qu,$)}catch{}N=!0}return N}finally{Zi(A),Mt.T=y,Jb(u,h)}}return!1}function Qb(u,h,y){h=H(y,h),h=ks(u.stateNode,h,2),u=He(u,h,2),u!==null&&(I(u,2),_e(u))}function sn(u,h,y){if(u.tag===3)Qb(u,u,y);else for(;h!==null;){if(h.tag===3){Qb(h,u,y);break}else if(h.tag===1){var M=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof M.componentDidCatch=="function"&&(qa===null||!qa.has(M))){u=H(y,u),y=jl(2),M=He(h,y,2),M!==null&&(bi(y,M,h,u),I(M,2),_e(M));break}}h=h.return}}function K0(u,h,y){var M=u.pingCache;if(M===null){M=u.pingCache=new kU;var A=new Set;M.set(h,A)}else A=M.get(h),A===void 0&&(A=new Set,M.set(h,A));A.has(y)||(Cv=!0,A.add(y),u=tD.bind(null,u,h,y),h.then(u,u))}function tD(u,h,y){var M=u.pingCache;M!==null&&M.delete(h),u.pingedLanes|=u.suspendedLanes&y,u.warmLanes&=~y,hn===u&&(Vt&y)===y&&(Ln===4||Ln===3&&(Vt&62914560)===Vt&&300>qr()-Uv?(ln&2)===0&&Zl(u,0):Rv|=y,gc===Vt&&(gc=0)),_e(u)}function $b(u,h){h===0&&(h=D()),u=Me(u,h),u!==null&&(I(u,h),_e(u))}function nD(u){var h=u.memoizedState,y=0;h!==null&&(y=h.retryLane),$b(u,y)}function iD(u,h){var y=0;switch(u.tag){case 13:var M=u.stateNode,A=u.memoizedState;A!==null&&(y=A.retryLane);break;case 19:M=u.stateNode;break;case 22:M=u.stateNode._retryCache;break;default:throw Error(r(314))}M!==null&&M.delete(h),$b(u,y)}function rD(u,h){return wd(u,h)}function sD(u,h,y,M){this.tag=u,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function J0(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Fa(u,h){var y=u.alternate;return y===null?(y=t(u.tag,h,u.key,u.mode),y.elementType=u.elementType,y.type=u.type,y.stateNode=u.stateNode,y.alternate=u,u.alternate=y):(y.pendingProps=h,y.type=u.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=u.flags&31457280,y.childLanes=u.childLanes,y.lanes=u.lanes,y.child=u.child,y.memoizedProps=u.memoizedProps,y.memoizedState=u.memoizedState,y.updateQueue=u.updateQueue,h=u.dependencies,y.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},y.sibling=u.sibling,y.index=u.index,y.ref=u.ref,y.refCleanup=u.refCleanup,y}function eS(u,h){u.flags&=31457282;var y=u.alternate;return y===null?(u.childLanes=0,u.lanes=h,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=y.childLanes,u.lanes=y.lanes,u.child=y.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=y.memoizedProps,u.memoizedState=y.memoizedState,u.updateQueue=y.updateQueue,u.type=y.type,h=y.dependencies,u.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext}),u}function _d(u,h,y,M,A,N){var $=0;if(M=u,typeof u=="function")J0(u)&&($=1);else if(typeof u=="string")$=Mr&&Mi?AS(u,y,mi.current)?26:IS(u)?27:5:Mr?AS(u,y,mi.current)?26:5:Mi&&IS(u)?27:5;else e:switch(u){case Ql:return Io(y.children,A,N,h);case oS:$=8,A|=24;break;case nv:return u=t(12,y,h,A|2),u.elementType=nv,u.lanes=N,u;case rv:return u=t(13,y,h,A),u.elementType=rv,u.lanes=N,u;case sv:return u=t(19,y,h,A),u.elementType=sv,u.lanes=N,u;case cS:return tS(y,A,N,h);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case cD:case Ba:$=10;break e;case lS:$=9;break e;case iv:$=11;break e;case av:$=14;break e;case ka:$=16,M=null;break e}$=29,y=Error(r(130,u===null?"null":typeof u,"")),M=null}return h=t($,y,h,A),h.elementType=u,h.type=M,h.lanes=N,h}function Io(u,h,y,M){return u=t(7,u,M,h),u.lanes=y,u}function tS(u,h,y,M){u=t(22,u,M,h),u.elementType=cS,u.lanes=y;var A={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var N=A._current;if(N===null)throw Error(r(456));if((A._pendingVisibility&2)===0){var $=Me(N,2);$!==null&&(A._pendingVisibility|=2,Ni($,N,2))}},attach:function(){var N=A._current;if(N===null)throw Error(r(456));if((A._pendingVisibility&2)!==0){var $=Me(N,2);$!==null&&(A._pendingVisibility&=-3,Ni($,N,2))}}};return u.stateNode=A,u}function Q0(u,h,y){return u=t(6,u,null,h),u.lanes=y,u}function $0(u,h,y){return h=t(4,u.children!==null?u.children:[],u.key,h),h.lanes=y,h.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},h}function aD(u,h,y,M,A,N,$,ae){this.tag=1,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=uv,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=R(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R(0),this.hiddenUpdates=R(null),this.identifierPrefix=M,this.onUncaughtError=A,this.onCaughtError=N,this.onRecoverableError=$,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ae,this.incompleteTransitions=new Map}function nS(u,h,y,M,A,N,$,ae,Ee,ke,Ye,ot){return u=new aD(u,h,y,$,ae,Ee,ke,ot),h=1,N===!0&&(h|=24),N=t(3,null,null,h),u.current=N,N.stateNode=u,h=U0(),h.refCount++,u.pooledCache=h,h.refCount++,N.memoizedState={element:M,isDehydrated:y,cache:h},je(N),u}function iS(u){return u?(u=tc,u):tc}function rS(u){var h=u._reactInternals;if(h===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=m(h),u=u!==null?v(u):null,u===null?null:Zu(u.stateNode)}function sS(u,h,y,M,A,N){A=iS(A),M.context===null?M.context=A:M.pendingContext=A,M=Ce(h),M.payload={element:y},N=N===void 0?null:N,N!==null&&(M.callback=N),y=He(u,M,h),y!==null&&(Ni(y,u,h),Ve(y,u,h))}function aS(u,h){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var y=u.retryLane;u.retryLane=y!==0&&y<h?y:h}}function ev(u,h){aS(u,h),(u=u.alternate)&&aS(u,h)}var Ft={},oD=Nx(),cr=N4(),tv=Object.assign,lD=Symbol.for("react.element"),xd=Symbol.for("react.transitional.element"),Jl=Symbol.for("react.portal"),Ql=Symbol.for("react.fragment"),oS=Symbol.for("react.strict_mode"),nv=Symbol.for("react.profiler"),cD=Symbol.for("react.provider"),lS=Symbol.for("react.consumer"),Ba=Symbol.for("react.context"),iv=Symbol.for("react.forward_ref"),rv=Symbol.for("react.suspense"),sv=Symbol.for("react.suspense_list"),av=Symbol.for("react.memo"),ka=Symbol.for("react.lazy"),cS=Symbol.for("react.offscreen"),uD=Symbol.for("react.memo_cache_sentinel"),uS=Symbol.iterator,hD=Symbol.for("react.client.reference"),Mt=oD.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ov,hS,lv=!1,bd=Array.isArray,fD=e.rendererVersion,dD=e.rendererPackageName,fS=e.extraDevToolsConfig,Zu=e.getPublicInstance,pD=e.getRootHostContext,mD=e.getChildHostContext,gD=e.prepareForCommit,vD=e.resetAfterCommit,yD=e.createInstance,cv=e.appendInitialChild,dS=e.finalizeInitialChildren,Sd=e.shouldSetTextContent,pS=e.createTextInstance,_D=e.scheduleTimeout,xD=e.cancelTimeout,uv=e.noTimeout,Xs=e.isPrimaryRenderer;e.warnsIfNotActing;var Ei=e.supportsMutation,Ga=e.supportsPersistence,Er=e.supportsHydration,mS=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var bD=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Zi=e.setCurrentUpdatePriority,Po=e.getCurrentUpdatePriority,SD=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var ED=e.shouldAttemptEagerTransition,MD=e.detachDeletedInstance;e.requestPostPaintCallback;var wD=e.maySuspendCommit,gS=e.preloadInstance,TD=e.startSuspendingCommit,vS=e.suspendInstance,AD=e.waitForCommitToBeReady,$l=e.NotPendingTransition,zo=e.HostTransitionContext,CD=e.resetFormInstance;e.bindToConsole;var RD=e.supportsMicrotasks,DD=e.scheduleMicrotask,Ku=e.supportsTestSelectors,UD=e.findFiberRoot,OD=e.getBoundingRect,LD=e.getTextContent,Ju=e.isHiddenSubtree,ND=e.matchAccessibilityRole,ID=e.setFocusIfFocusable,PD=e.setupIntersectionObserver,zD=e.appendChild,FD=e.appendChildToContainer,BD=e.commitTextUpdate,kD=e.commitMount,GD=e.commitUpdate,HD=e.insertBefore,VD=e.insertInContainerBefore,WD=e.removeChild,XD=e.removeChildFromContainer,yS=e.resetTextContent,jD=e.hideInstance,qD=e.hideTextInstance,YD=e.unhideInstance,ZD=e.unhideTextInstance,KD=e.clearContainer,JD=e.cloneInstance,_S=e.createContainerChildSet,xS=e.appendChildToContainerChildSet,QD=e.finalizeContainerChildren,bS=e.replaceContainerChildren,SS=e.cloneHiddenInstance,ES=e.cloneHiddenTextInstance,hv=e.isSuspenseInstancePending,fv=e.isSuspenseInstanceFallback,$D=e.getSuspenseInstanceFallbackErrorDetails,eU=e.registerSuspenseInstanceRetry,tU=e.canHydrateFormStateMarker,nU=e.isFormStateMarkerMatching,MS=e.getNextHydratableSibling,wS=e.getFirstHydratableChild,iU=e.getFirstHydratableChildWithinContainer,rU=e.getFirstHydratableChildWithinSuspenseInstance,sU=e.canHydrateInstance,aU=e.canHydrateTextInstance,oU=e.canHydrateSuspenseInstance,lU=e.hydrateInstance,cU=e.hydrateTextInstance,uU=e.hydrateSuspenseInstance,hU=e.getNextHydratableInstanceAfterSuspenseInstance,fU=e.commitHydratedContainer,dU=e.commitHydratedSuspenseInstance,pU=e.clearSuspenseBoundary,mU=e.clearSuspenseBoundaryFromContainer,TS=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var gU=e.validateHydratableInstance,vU=e.validateHydratableTextInstance,Mr=e.supportsResources,AS=e.isHostHoistableType,dv=e.getHoistableRoot,CS=e.getResource,RS=e.acquireResource,DS=e.releaseResource,yU=e.hydrateHoistable,US=e.mountHoistable,OS=e.unmountHoistable,_U=e.createHoistableInstance,xU=e.prepareToCommitHoistables,bU=e.mayResourceSuspendCommit,LS=e.preloadResource,SU=e.suspendResource,Mi=e.supportsSingletons,NS=e.resolveSingletonInstance,EU=e.clearSingleton,MU=e.acquireSingletonInstance,wU=e.releaseSingletonInstance,IS=e.isHostSingletonType,pv=[],ec=-1,tc={},ur=Math.clz32?Math.clz32:S,TU=Math.log,AU=Math.LN2,Ed=128,Md=4194304,wd=cr.unstable_scheduleCallback,mv=cr.unstable_cancelCallback,CU=cr.unstable_shouldYield,RU=cr.unstable_requestPaint,qr=cr.unstable_now,PS=cr.unstable_ImmediatePriority,DU=cr.unstable_UserBlockingPriority,gv=cr.unstable_NormalPriority,UU=cr.unstable_IdlePriority,OU=cr.log,LU=cr.unstable_setDisableYieldValue,Qu=null,hr=null,fr=typeof Object.is=="function"?Object.is:k,zS=new WeakMap,nc=[],ic=0,Td=null,Ad=0,wr=[],Tr=0,Fo=null,js=1,qs="",mi=_(null),$u=_(null),Ha=_(null),Cd=_(null),Ii=null,wi=null,jt=!1,Yr=null,ds=!1,vv=Error(r(519)),Ar=[],rc=0,yv=0,Rd=null,sc=null,_v=!1,Dd=!1,xv=!1,ac=0,eh=null,bv=0,oc=0,lc=null,Va=!1,Sv=!1,NU=Object.prototype.hasOwnProperty,th=Error(r(460)),Ev=Error(r(474)),Ud={then:function(){}},cc=null,uc=null,nh=0,Bo=tn(!0),FS=tn(!1),hc=_(null),Od=_(0),Cr=_(null),ps=null,ti=_(0),Wa=0,It=null,on=null,Xn=null,Ld=!1,fc=!1,ko=!1,Nd=0,ih=0,dc=null,IU=0,Mv=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},ms={readContext:Si,use:fe,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht};ms.useCacheRefresh=Ht,ms.useMemoCache=Ht,ms.useHostTransitionStatus=Ht,ms.useFormState=Ht,ms.useActionState=Ht,ms.useOptimistic=Ht;var Go={readContext:Si,use:fe,useCallback:function(u,h){return q().memoizedState=[u,h===void 0?null:h],u},useContext:Si,useEffect:Hl,useImperativeHandle:function(u,h,y){y=y!=null?y.concat([u]):null,Eo(4194308,4,Ps.bind(null,h,u),y)},useLayoutEffect:function(u,h){return Eo(4194308,4,u,h)},useInsertionEffect:function(u,h){Eo(4,2,u,h)},useMemo:function(u,h){var y=q();h=h===void 0?null:h;var M=u();if(ko){L(!0);try{u()}finally{L(!1)}}return y.memoizedState=[M,h],M},useReducer:function(u,h,y){var M=q();if(y!==void 0){var A=y(h);if(ko){L(!0);try{y(h)}finally{L(!1)}}}else A=h;return M.memoizedState=M.baseState=A,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:A},M.queue=u,u=u.dispatch=ud.bind(null,It,u),[M.memoizedState,u]},useRef:function(u){var h=q();return u={current:u},h.memoizedState=u},useState:function(u){u=Qt(u);var h=u.queue,y=Fu.bind(null,It,h);return h.dispatch=y,[u.memoizedState,y]},useDebugValue:Fs,useDeferredValue:function(u,h){var y=q();return To(y,u,h)},useTransition:function(){var u=Qt(!1);return u=Iu.bind(null,It,u.queue,!0,!1),q().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,h,y){var M=It,A=q();if(jt){if(y===void 0)throw Error(r(407));y=y()}else{if(y=h(),hn===null)throw Error(r(349));(Vt&60)!==0||_t(M,h,y)}A.memoizedState=y;var N={value:y,getSnapshot:h};return A.queue=N,Hl(Ot.bind(null,M,N,u),[u]),M.flags|=2048,Li(9,pt.bind(null,M,N,y,h),{destroy:void 0},null),y},useId:function(){var u=q(),h=hn.identifierPrefix;if(jt){var y=qs,M=js;y=(M&~(1<<32-ur(M)-1)).toString(32)+y,h=":"+h+"R"+y,y=Nd++,0<y&&(h+="H"+y.toString(32)),h+=":"}else y=IU++,h=":"+h+"r"+y.toString(32)+":";return u.memoizedState=h},useCacheRefresh:function(){return q().memoizedState=zu.bind(null,It)}};Go.useMemoCache=ye,Go.useHostTransitionStatus=Co,Go.useFormState=rn,Go.useActionState=rn,Go.useOptimistic=function(u){var h=q();h.memoizedState=h.baseState=u;var y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return h.queue=y,h=Wl.bind(null,It,!0,y),y.dispatch=h,[u,h]};var Xa={readContext:Si,use:fe,useCallback:Nu,useContext:Si,useEffect:Is,useImperativeHandle:zs,useInsertionEffect:Lu,useLayoutEffect:wo,useMemo:Ua,useReducer:Je,useRef:Xi,useState:function(){return Je(Xe)},useDebugValue:Fs,useDeferredValue:function(u,h){var y=de();return Vl(y,on.memoizedState,u,h)},useTransition:function(){var u=Je(Xe)[0],h=de().memoizedState;return[typeof u=="boolean"?u:we(u),h]},useSyncExternalStore:yt,useId:Pu};Xa.useCacheRefresh=ji,Xa.useMemoCache=ye,Xa.useHostTransitionStatus=Co,Xa.useFormState=Hn,Xa.useActionState=Hn,Xa.useOptimistic=function(u,h){var y=de();return Pt(y,on,u,h)};var Ho={readContext:Si,use:fe,useCallback:Nu,useContext:Si,useEffect:Is,useImperativeHandle:zs,useInsertionEffect:Lu,useLayoutEffect:wo,useMemo:Ua,useReducer:lt,useRef:Xi,useState:function(){return lt(Xe)},useDebugValue:Fs,useDeferredValue:function(u,h){var y=de();return on===null?To(y,u,h):Vl(y,on.memoizedState,u,h)},useTransition:function(){var u=lt(Xe)[0],h=de().memoizedState;return[typeof u=="boolean"?u:we(u),h]},useSyncExternalStore:yt,useId:Pu};Ho.useCacheRefresh=ji,Ho.useMemoCache=ye,Ho.useHostTransitionStatus=Co,Ho.useFormState=Rn,Ho.useActionState=Rn,Ho.useOptimistic=function(u,h){var y=de();return on!==null?Pt(y,on,u,h):(y.baseState=u,[u,y.queue.dispatch])};var wv={isMounted:function(u){return(u=u._reactInternals)?d(u)===u:!1},enqueueSetState:function(u,h,y){u=u._reactInternals;var M=lr(),A=Ce(M);A.payload=h,y!=null&&(A.callback=y),h=He(u,A,M),h!==null&&(Ni(h,u,M),Ve(h,u,M))},enqueueReplaceState:function(u,h,y){u=u._reactInternals;var M=lr(),A=Ce(M);A.tag=1,A.payload=h,y!=null&&(A.callback=y),h=He(u,A,M),h!==null&&(Ni(h,u,M),Ve(h,u,M))},enqueueForceUpdate:function(u,h){u=u._reactInternals;var y=lr(),M=Ce(y);M.tag=2,h!=null&&(M.callback=h),h=He(u,M,y),h!==null&&(Ni(h,u,y),Ve(h,u,y))}},BS=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var h=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(h))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},kS=Error(r(461)),ci=!1,Tv={dehydrated:null,treeContext:null,retryLane:0},Id=_(null),Vo=null,Ys=null,PU=typeof AbortController<"u"?AbortController:function(){var u=[],h=this.signal={aborted:!1,addEventListener:function(y,M){u.push(M)}};this.abort=function(){h.aborted=!0,u.forEach(function(y){return y()})}},zU=cr.unstable_scheduleCallback,FU=cr.unstable_NormalPriority,Un={$$typeof:Ba,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},GS=Mt.S;Mt.S=function(u,h){typeof h=="object"&&h!==null&&typeof h.then=="function"&&me(u,h),GS!==null&&GS(u,h)};var Wo=_(null),Zs=!1,On=!1,Av=!1,HS=typeof WeakSet=="function"?WeakSet:Set,ui=null,VS=!1,jn=null,dr=!1,Zr=null,pc=8192,BU={getCacheForType:function(u){var h=Si(Un),y=h.data.get(u);return y===void 0&&(y=u(),h.data.set(u,y)),y}},Pd=0,zd=1,Fd=2,Bd=3,kd=4;if(typeof Symbol=="function"&&Symbol.for){var rh=Symbol.for;Pd=rh("selector.component"),zd=rh("selector.has_pseudo_class"),Fd=rh("selector.role"),Bd=rh("selector.test_id"),kd=rh("selector.text")}var kU=typeof WeakMap=="function"?WeakMap:Map,ln=0,hn=null,Bt=null,Vt=0,fn=0,pr=null,Ks=!1,mc=!1,Cv=!1,Js=0,Ln=0,ja=0,Xo=0,Rv=0,Rr=0,gc=0,sh=null,gs=null,Dv=!1,Uv=0,ah=1/0,Gd=null,qa=null,Hd=!1,jo=null,oh=0,Ov=0,Lv=null,lh=0,Nv=null;return Ft.attemptContinuousHydration=function(u){if(u.tag===13){var h=Me(u,67108864);h!==null&&Ni(h,u,67108864),ev(u,67108864)}},Ft.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var h=lr(),y=Me(u,h);y!==null&&Ni(y,u,h),ev(u,h)}},Ft.attemptSynchronousHydration=function(u){switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var h=E(u.pendingLanes);if(h!==0){for(u.pendingLanes|=2,u.entangledLanes|=2;h;){var y=1<<31-ur(h);u.entanglements[1]|=y,h&=~y}_e(u),(ln&6)===0&&(ah=qr()+500,ne(0))}}break;case 13:h=Me(u,2),h!==null&&Ni(h,u,2),Hb(),ev(u,2)}},Ft.batchedUpdates=function(u,h){return u(h)},Ft.createComponentSelector=function(u){return{$$typeof:Pd,value:u}},Ft.createContainer=function(u,h,y,M,A,N,$,ae,Ee,ke){return nS(u,h,!1,null,y,M,N,$,ae,Ee,ke,null)},Ft.createHasPseudoClassSelector=function(u){return{$$typeof:zd,value:u}},Ft.createHydrationContainer=function(u,h,y,M,A,N,$,ae,Ee,ke,Ye,ot,ht){return u=nS(y,M,!0,u,A,N,ae,Ee,ke,Ye,ot,ht),u.context=iS(null),y=u.current,M=lr(),A=Ce(M),A.callback=h??null,He(y,A,M),u.current.lanes=M,I(u,M),_e(u),u},Ft.createPortal=function(u,h,y){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jl,key:M==null?null:""+M,children:u,containerInfo:h,implementation:y}},Ft.createRoleSelector=function(u){return{$$typeof:Fd,value:u}},Ft.createTestNameSelector=function(u){return{$$typeof:Bd,value:u}},Ft.createTextSelector=function(u){return{$$typeof:kd,value:u}},Ft.defaultOnCaughtError=function(u){console.error(u)},Ft.defaultOnRecoverableError=function(u){BS(u)},Ft.defaultOnUncaughtError=function(u){BS(u)},Ft.deferredUpdates=function(u){var h=Mt.T,y=Po();try{return Zi(32),Mt.T=null,u()}finally{Zi(y),Mt.T=h}},Ft.discreteUpdates=function(u,h,y,M,A){var N=Mt.T,$=Po();try{return Zi(2),Mt.T=null,u(h,y,M,A)}finally{Zi($),Mt.T=N,ln===0&&(ah=qr()+500)}},Ft.findAllNodes=X0,Ft.findBoundingRects=function(u,h){if(!Ku)throw Error(r(363));h=X0(u,h),u=[];for(var y=0;y<h.length;y++)u.push(OD(h[y]));for(h=u.length-1;0<h;h--){y=u[h];for(var M=y.x,A=M+y.width,N=y.y,$=N+y.height,ae=h-1;0<=ae;ae--)if(h!==ae){var Ee=u[ae],ke=Ee.x,Ye=ke+Ee.width,ot=Ee.y,ht=ot+Ee.height;if(M>=ke&&N>=ot&&A<=Ye&&$<=ht){u.splice(h,1);break}else if(M!==ke||y.width!==Ee.width||ht<N||ot>$){if(!(N!==ot||y.height!==Ee.height||Ye<M||ke>A)){ke>M&&(Ee.width+=ke-M,Ee.x=M),Ye<A&&(Ee.width=A-ke),u.splice(h,1);break}}else{ot>N&&(Ee.height+=ot-N,Ee.y=N),ht<$&&(Ee.height=$-ot),u.splice(h,1);break}}}return u},Ft.findHostInstance=rS,Ft.findHostInstanceWithNoPortals=function(u){return u=m(u),u=u!==null?x(u):null,u===null?null:Zu(u.stateNode)},Ft.findHostInstanceWithWarning=function(u){return rS(u)},Ft.flushPassiveEffects=No,Ft.flushSyncFromReconciler=function(u){var h=ln;ln|=1;var y=Mt.T,M=Po();try{if(Zi(2),Mt.T=null,u)return u()}finally{Zi(M),Mt.T=y,ln=h,(ln&6)===0&&ne(0)}},Ft.flushSyncWork=Hb,Ft.focusWithin=function(u,h){if(!Ku)throw Error(r(363));for(u=H0(u),h=Fb(u,h),h=Array.from(h),u=0;u<h.length;){var y=h[u++],M=y.tag;if(!Ju(y)){if((M===5||M===26||M===27)&&ID(y.stateNode))return!0;for(y=y.child;y!==null;)h.push(y),y=y.sibling}}return!1},Ft.getFindAllNodesFailureDescription=function(u,h){if(!Ku)throw Error(r(363));var y=0,M=[];u=[H0(u),0];for(var A=0;A<u.length;){var N=u[A++],$=N.tag,ae=u[A++],Ee=h[ae];if(($!==5&&$!==26&&$!==27||!Ju(N))&&(V0(N,Ee)&&(M.push(W0(Ee)),ae++,ae>y&&(y=ae)),ae<h.length))for(N=N.child;N!==null;)u.push(N,ae),N=N.sibling}if(y<h.length){for(u=[];y<h.length;y++)u.push(W0(h[y]));return`findAllNodes was able to match part of the selector:
3874
+ `+y.stack}}function d(u){var h=u,y=u;if(u.alternate)for(;h.return;)h=h.return;else{u=h;do h=u,(h.flags&4098)!==0&&(y=h.return),u=h.return;while(u)}return h.tag===3?y:null}function p(u){if(d(u)!==u)throw Error(r(188))}function m(u){var h=u.alternate;if(!h){if(h=d(u),h===null)throw Error(r(188));return h!==u?null:u}for(var y=u,M=h;;){var A=y.return;if(A===null)break;var N=A.alternate;if(N===null){if(M=A.return,M!==null){y=M;continue}break}if(A.child===N.child){for(N=A.child;N;){if(N===y)return p(A),u;if(N===M)return p(A),h;N=N.sibling}throw Error(r(188))}if(y.return!==M.return)y=A,M=N;else{for(var $=!1,ae=A.child;ae;){if(ae===y){$=!0,y=A,M=N;break}if(ae===M){$=!0,M=A,y=N;break}ae=ae.sibling}if(!$){for(ae=N.child;ae;){if(ae===y){$=!0,y=N,M=A;break}if(ae===M){$=!0,M=N,y=A;break}ae=ae.sibling}if(!$)throw Error(r(189))}}if(y.alternate!==M)throw Error(r(190))}if(y.tag!==3)throw Error(r(188));return y.stateNode.current===y?u:h}function v(u){var h=u.tag;if(h===5||h===26||h===27||h===6)return u;for(u=u.child;u!==null;){if(h=v(u),h!==null)return h;u=u.sibling}return null}function x(u){var h=u.tag;if(h===5||h===26||h===27||h===6)return u;for(u=u.child;u!==null;){if(u.tag!==4&&(h=x(u),h!==null))return h;u=u.sibling}return null}function _(u){return{current:u}}function g(u){0>ec||(u.current=pv[ec],pv[ec]=null,ec--)}function b(u,h){ec++,pv[ec]=u.current,u.current=h}function S(u){return u>>>=0,u===0?32:31-(wU(u)/TU|0)|0}function E(u){var h=u&42;if(h!==0)return h;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function w(u,h){var y=u.pendingLanes;if(y===0)return 0;var M=0,A=u.suspendedLanes,N=u.pingedLanes,$=u.warmLanes;u=u.finishedLanes!==0;var ae=y&134217727;return ae!==0?(y=ae&~A,y!==0?M=E(y):(N&=ae,N!==0?M=E(N):u||($=ae&~$,$!==0&&(M=E($))))):(ae=y&~A,ae!==0?M=E(ae):N!==0?M=E(N):u||($=y&~$,$!==0&&(M=E($)))),M===0?0:h!==0&&h!==M&&(h&A)===0&&(A=M&-M,$=h&-h,A>=$||A===32&&($&4194176)!==0)?h:M}function T(u,h){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&h)===0}function C(u,h){switch(u){case 1:case 2:case 4:case 8:return h+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U(){var u=Ed;return Ed<<=1,(Ed&4194176)===0&&(Ed=128),u}function D(){var u=Md;return Md<<=1,(Md&62914560)===0&&(Md=4194304),u}function R(u){for(var h=[],y=0;31>y;y++)h.push(u);return h}function I(u,h){u.pendingLanes|=h,h!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function z(u,h,y,M,A,N){var $=u.pendingLanes;u.pendingLanes=y,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=y,u.entangledLanes&=y,u.errorRecoveryDisabledLanes&=y,u.shellSuspendCounter=0;var ae=u.entanglements,Ee=u.expirationTimes,ke=u.hiddenUpdates;for(y=$&~y;0<y;){var Ye=31-ur(y),ot=1<<Ye;ae[Ye]=0,Ee[Ye]=-1;var ht=ke[Ye];if(ht!==null)for(ke[Ye]=null,Ye=0;Ye<ht.length;Ye++){var Rt=ht[Ye];Rt!==null&&(Rt.lane&=-536870913)}y&=~ot}M!==0&&O(u,M,0),N!==0&&A===0&&u.tag!==0&&(u.suspendedLanes|=N&~($&~h))}function O(u,h,y){u.pendingLanes|=h,u.suspendedLanes&=~h;var M=31-ur(h);u.entangledLanes|=h,u.entanglements[M]=u.entanglements[M]|1073741824|y&4194218}function V(u,h){var y=u.entangledLanes|=h;for(u=u.entanglements;y;){var M=31-ur(y),A=1<<M;A&h|u[M]&h&&(u[M]|=h),y&=~A}}function ee(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function P(u){if(hr&&typeof hr.onCommitFiberRoot=="function")try{hr.onCommitFiberRoot(Qu,u,void 0,(u.current.flags&128)===128)}catch{}}function L(u){if(typeof UU=="function"&&OU(u),hr&&typeof hr.setStrictMode=="function")try{hr.setStrictMode(Qu,u)}catch{}}function k(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}function H(u,h){if(typeof u=="object"&&u!==null){var y=zS.get(u);return y!==void 0?y:(h={value:u,source:h,stack:f(h)},zS.set(u,h),h)}return{value:u,source:h,stack:f(h)}}function W(u,h){nc[ic++]=Ad,nc[ic++]=Td,Td=u,Ad=h}function F(u,h,y){wr[Tr++]=js,wr[Tr++]=qs,wr[Tr++]=Fo,Fo=u;var M=js;u=qs;var A=32-ur(M)-1;M&=~(1<<A),y+=1;var N=32-ur(h)+A;if(30<N){var $=A-A%5;N=(M&(1<<$)-1).toString(32),M>>=$,A-=$,js=1<<32-ur(h)+A|y<<A|M,qs=N+u}else js=1<<N|y<<A|M,qs=u}function Y(u){u.return!==null&&(W(u,1),F(u,1,0))}function K(u){for(;u===Td;)Td=nc[--ic],nc[ic]=null,Ad=nc[--ic],nc[ic]=null;for(;u===Fo;)Fo=wr[--Tr],wr[Tr]=null,qs=wr[--Tr],wr[Tr]=null,js=wr[--Tr],wr[Tr]=null}function j(u,h){b(Ha,h),b($u,u),b(mi,null),u=dD(h),g(mi),b(mi,u)}function J(){g(mi),g($u),g(Ha)}function he(u){u.memoizedState!==null&&b(Cd,u);var h=mi.current,y=pD(h,u.type);h!==y&&(b($u,u),b(mi,y))}function re(u){$u.current===u&&(g(mi),g($u)),Cd.current===u&&(g(Cd),Xs?zo._currentValue=$l:zo._currentValue2=$l)}function pe(u){var h=Error(r(418,""));throw Ne(H(h,u)),vv}function Oe(u,h){if(!Er)throw Error(r(175));oU(u.stateNode,u.type,u.memoizedProps,h,u)||pe(u)}function be(u){for(Ii=u.return;Ii;)switch(Ii.tag){case 3:case 27:ds=!0;return;case 5:case 13:ds=!1;return;default:Ii=Ii.return}}function ve(u){if(!Er||u!==Ii)return!1;if(!jt)return be(u),jt=!0,!1;var h=!1;if(Mi?u.tag!==3&&u.tag!==27&&(u.tag!==5||TS(u.type)&&!Sd(u.type,u.memoizedProps))&&(h=!0):u.tag!==3&&(u.tag!==5||TS(u.type)&&!Sd(u.type,u.memoizedProps))&&(h=!0),h&&wi&&pe(u),be(u),u.tag===13){if(!Er)throw Error(r(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));wi=uU(u)}else wi=Ii?MS(u.stateNode):null;return!0}function ce(){Er&&(wi=Ii=null,jt=!1)}function Ne(u){Yr===null?Yr=[u]:Yr.push(u)}function G(){for(var u=rc,h=yv=rc=0;h<u;){var y=Ar[h];Ar[h++]=null;var M=Ar[h];Ar[h++]=null;var A=Ar[h];Ar[h++]=null;var N=Ar[h];if(Ar[h++]=null,M!==null&&A!==null){var $=M.pending;$===null?A.next=A:(A.next=$.next,$.next=A),M.pending=A}N!==0&&oe(y,A,N)}}function le(u,h,y,M){Ar[rc++]=u,Ar[rc++]=h,Ar[rc++]=y,Ar[rc++]=M,yv|=M,u.lanes|=M,u=u.alternate,u!==null&&(u.lanes|=M)}function te(u,h,y,M){return le(u,h,y,M),De(u)}function Me(u,h){return le(u,null,null,h),De(u)}function oe(u,h,y){u.lanes|=y;var M=u.alternate;M!==null&&(M.lanes|=y);for(var A=!1,N=u.return;N!==null;)N.childLanes|=y,M=N.alternate,M!==null&&(M.childLanes|=y),N.tag===22&&(u=N.stateNode,u===null||u._visibility&1||(A=!0)),u=N,N=N.return;A&&h!==null&&u.tag===3&&(N=u.stateNode,A=31-ur(y),N=N.hiddenUpdates,u=N[A],u===null?N[A]=[h]:u.push(h),h.lane=y|536870912)}function De(u){if(50<lh)throw lh=0,Nv=null,Error(r(185));for(var h=u.return;h!==null;)u=h,h=u.return;return u.tag===3?u.stateNode:null}function _e(u){u!==sc&&u.next===null&&(sc===null?Rd=sc=u:sc=sc.next=u),Dd=!0,_v||(_v=!0,Se(Be))}function ne(u,h){if(!xv&&Dd){xv=!0;do for(var y=!1,M=Rd;M!==null;){if(u!==0){var A=M.pendingLanes;if(A===0)var N=0;else{var $=M.suspendedLanes,ae=M.pingedLanes;N=(1<<31-ur(42|u)+1)-1,N&=A&~($&~ae),N=N&201326677?N&201326677|1:N?N|2:0}N!==0&&(y=!0,ie(M,N))}else N=Vt,N=w(M,M===hn?N:0),(N&3)===0||T(M,N)||(y=!0,ie(M,N));M=M.next}while(y);xv=!1}}function Be(){Dd=_v=!1;var u=0;ac!==0&&(SD()&&(u=ac),ac=0);for(var h=qr(),y=null,M=Rd;M!==null;){var A=M.next,N=X(M,h);N===0?(M.next=null,y===null?Rd=A:y.next=A,A===null&&(sc=y)):(y=M,(u!==0||(N&3)!==0)&&(Dd=!0)),M=A}ne(u)}function X(u,h){for(var y=u.suspendedLanes,M=u.pingedLanes,A=u.expirationTimes,N=u.pendingLanes&-62914561;0<N;){var $=31-ur(N),ae=1<<$,Ee=A[$];Ee===-1?((ae&y)===0||(ae&M)!==0)&&(A[$]=C(ae,h)):Ee<=h&&(u.expiredLanes|=ae),N&=~ae}if(h=hn,y=Vt,y=w(u,u===h?y:0),M=u.callbackNode,y===0||u===h&&fn===2||u.cancelPendingCommit!==null)return M!==null&&M!==null&&mv(M),u.callbackNode=null,u.callbackPriority=0;if((y&3)===0||T(u,y)){if(h=y&-y,h===u.callbackPriority)return h;switch(M!==null&&mv(M),ee(y)){case 2:case 8:y=RU;break;case 32:y=gv;break;case 268435456:y=DU;break;default:y=gv}return M=B.bind(null,u),y=wd(y,M),u.callbackPriority=h,u.callbackNode=y,h}return M!==null&&M!==null&&mv(M),u.callbackPriority=2,u.callbackNode=null,2}function B(u,h){var y=u.callbackNode;if(No()&&u.callbackNode!==y)return null;var M=Vt;return M=w(u,u===hn?M:0),M===0?null:(kb(u,M,h),X(u,qr()),u.callbackNode!=null&&u.callbackNode===y?B.bind(null,u):null)}function ie(u,h){if(No())return null;kb(u,h,!0)}function Se(u){CD?RD(function(){(ln&6)!==0?wd(PS,u):u()}):wd(PS,u)}function ge(){return ac===0&&(ac=U()),ac}function me(u,h){if(eh===null){var y=eh=[];bv=0,oc=ge(),lc={status:"pending",value:void 0,then:function(M){y.push(M)}}}return bv++,h.then(Fe,Fe),h}function Fe(){if(--bv===0&&eh!==null){lc!==null&&(lc.status="fulfilled");var u=eh;eh=null,oc=0,lc=null;for(var h=0;h<u.length;h++)(0,u[h])()}}function Ie(u,h){var y=[],M={status:"pending",value:null,reason:null,then:function(A){y.push(A)}};return u.then(function(){M.status="fulfilled",M.value=h;for(var A=0;A<y.length;A++)(0,y[A])(h)},function(A){for(M.status="rejected",M.reason=A,A=0;A<y.length;A++)(0,y[A])(void 0)}),M}function je(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ze(u,h){u=u.updateQueue,h.updateQueue===u&&(h.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function Ce(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function He(u,h,y){var M=u.updateQueue;if(M===null)return null;if(M=M.shared,(ln&2)!==0){var A=M.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),M.pending=h,h=De(u),oe(u,null,y),h}return le(u,M,h,y),De(u)}function Ve(u,h,y){if(h=h.updateQueue,h!==null&&(h=h.shared,(y&4194176)!==0)){var M=h.lanes;M&=u.pendingLanes,y|=M,h.lanes=y,V(u,y)}}function nt(u,h){var y=u.updateQueue,M=u.alternate;if(M!==null&&(M=M.updateQueue,y===M)){var A=null,N=null;if(y=y.firstBaseUpdate,y!==null){do{var $={lane:y.lane,tag:y.tag,payload:y.payload,callback:null,next:null};N===null?A=N=$:N=N.next=$,y=y.next}while(y!==null);N===null?A=N=h:N=N.next=h}else A=N=h;y={baseState:M.baseState,firstBaseUpdate:A,lastBaseUpdate:N,shared:M.shared,callbacks:M.callbacks},u.updateQueue=y;return}u=y.lastBaseUpdate,u===null?y.firstBaseUpdate=h:u.next=h,y.lastBaseUpdate=h}function We(){if(Sv){var u=lc;if(u!==null)throw u}}function ft(u,h,y,M){Sv=!1;var A=u.updateQueue;Va=!1;var N=A.firstBaseUpdate,$=A.lastBaseUpdate,ae=A.shared.pending;if(ae!==null){A.shared.pending=null;var Ee=ae,ke=Ee.next;Ee.next=null,$===null?N=ke:$.next=ke,$=Ee;var Ye=u.alternate;Ye!==null&&(Ye=Ye.updateQueue,ae=Ye.lastBaseUpdate,ae!==$&&(ae===null?Ye.firstBaseUpdate=ke:ae.next=ke,Ye.lastBaseUpdate=Ee))}if(N!==null){var ot=A.baseState;$=0,Ye=ke=Ee=null,ae=N;do{var ht=ae.lane&-536870913,Rt=ht!==ae.lane;if(Rt?(Vt&ht)===ht:(M&ht)===ht){ht!==0&&ht===oc&&(Sv=!0),Ye!==null&&(Ye=Ye.next={lane:0,tag:ae.tag,payload:ae.payload,callback:null,next:null});e:{var Dr=u,ch=ae;ht=h;var qo=y;switch(ch.tag){case 1:if(Dr=ch.payload,typeof Dr=="function"){ot=Dr.call(qo,ot,ht);break e}ot=Dr;break e;case 3:Dr.flags=Dr.flags&-65537|128;case 0:if(Dr=ch.payload,ht=typeof Dr=="function"?Dr.call(qo,ot,ht):Dr,ht==null)break e;ot=tv({},ot,ht);break e;case 2:Va=!0}}ht=ae.callback,ht!==null&&(u.flags|=64,Rt&&(u.flags|=8192),Rt=A.callbacks,Rt===null?A.callbacks=[ht]:Rt.push(ht))}else Rt={lane:ht,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},Ye===null?(ke=Ye=Rt,Ee=ot):Ye=Ye.next=Rt,$|=ht;if(ae=ae.next,ae===null){if(ae=A.shared.pending,ae===null)break;Rt=ae,ae=Rt.next,Rt.next=null,A.lastBaseUpdate=Rt,A.shared.pending=null}}while(!0);Ye===null&&(Ee=ot),A.baseState=Ee,A.firstBaseUpdate=ke,A.lastBaseUpdate=Ye,N===null&&(A.shared.lanes=0),ja|=$,u.lanes=$,u.memoizedState=ot}}function se(u,h){if(typeof u!="function")throw Error(r(191,u));u.call(h)}function ze(u,h){var y=u.callbacks;if(y!==null)for(u.callbacks=null,u=0;u<y.length;u++)se(y[u],h)}function Le(u,h){if(fr(u,h))return!0;if(typeof u!="object"||u===null||typeof h!="object"||h===null)return!1;var y=Object.keys(u),M=Object.keys(h);if(y.length!==M.length)return!1;for(M=0;M<y.length;M++){var A=y[M];if(!LU.call(h,A)||!fr(u[A],h[A]))return!1}return!0}function rt(u){return u=u.status,u==="fulfilled"||u==="rejected"}function Pe(){}function Re(u,h,y){switch(y=u[y],y===void 0?u.push(h):y!==h&&(h.then(Pe,Pe),h=y),h.status){case"fulfilled":return h.value;case"rejected":throw u=h.reason,u===th?Error(r(483)):u;default:if(typeof h.status=="string")h.then(Pe,Pe);else{if(u=hn,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=h,u.status="pending",u.then(function(M){if(h.status==="pending"){var A=h;A.status="fulfilled",A.value=M}},function(M){if(h.status==="pending"){var A=h;A.status="rejected",A.reason=M}})}switch(h.status){case"fulfilled":return h.value;case"rejected":throw u=h.reason,u===th?Error(r(483)):u}throw cc=h,th}}function Ke(){if(cc===null)throw Error(r(459));var u=cc;return cc=null,u}function st(u){var h=nh;return nh+=1,uc===null&&(uc=[]),Re(uc,u,h)}function at(u,h){h=h.props.ref,u.ref=h!==void 0?h:null}function mt(u,h){throw h.$$typeof===oD?Error(r(525)):(u=Object.prototype.toString.call(h),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":u)))}function Jt(u){var h=u._init;return h(u._payload)}function tn(u){function h(Te,xe){if(u){var Ue=Te.deletions;Ue===null?(Te.deletions=[xe],Te.flags|=16):Ue.push(xe)}}function y(Te,xe){if(!u)return null;for(;xe!==null;)h(Te,xe),xe=xe.sibling;return null}function M(Te){for(var xe=new Map;Te!==null;)Te.key!==null?xe.set(Te.key,Te):xe.set(Te.index,Te),Te=Te.sibling;return xe}function A(Te,xe){return Te=Fa(Te,xe),Te.index=0,Te.sibling=null,Te}function N(Te,xe,Ue){return Te.index=Ue,u?(Ue=Te.alternate,Ue!==null?(Ue=Ue.index,Ue<xe?(Te.flags|=33554434,xe):Ue):(Te.flags|=33554434,xe)):(Te.flags|=1048576,xe)}function $(Te){return u&&Te.alternate===null&&(Te.flags|=33554434),Te}function ae(Te,xe,Ue,qe){return xe===null||xe.tag!==6?(xe=Q0(Ue,Te.mode,qe),xe.return=Te,xe):(xe=A(xe,Ue),xe.return=Te,xe)}function Ee(Te,xe,Ue,qe){var vt=Ue.type;return vt===Ql?Ye(Te,xe,Ue.props.children,qe,Ue.key):xe!==null&&(xe.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===ka&&Jt(vt)===xe.type)?(xe=A(xe,Ue.props),at(xe,Ue),xe.return=Te,xe):(xe=_d(Ue.type,Ue.key,Ue.props,null,Te.mode,qe),at(xe,Ue),xe.return=Te,xe)}function ke(Te,xe,Ue,qe){return xe===null||xe.tag!==4||xe.stateNode.containerInfo!==Ue.containerInfo||xe.stateNode.implementation!==Ue.implementation?(xe=$0(Ue,Te.mode,qe),xe.return=Te,xe):(xe=A(xe,Ue.children||[]),xe.return=Te,xe)}function Ye(Te,xe,Ue,qe,vt){return xe===null||xe.tag!==7?(xe=Io(Ue,Te.mode,qe,vt),xe.return=Te,xe):(xe=A(xe,Ue),xe.return=Te,xe)}function ot(Te,xe,Ue){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return xe=Q0(""+xe,Te.mode,Ue),xe.return=Te,xe;if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case xd:return Ue=_d(xe.type,xe.key,xe.props,null,Te.mode,Ue),at(Ue,xe),Ue.return=Te,Ue;case Jl:return xe=$0(xe,Te.mode,Ue),xe.return=Te,xe;case ka:var qe=xe._init;return xe=qe(xe._payload),ot(Te,xe,Ue)}if(bd(xe)||s(xe))return xe=Io(xe,Te.mode,Ue,null),xe.return=Te,xe;if(typeof xe.then=="function")return ot(Te,st(xe),Ue);if(xe.$$typeof===Ba)return ot(Te,dd(Te,xe),Ue);mt(Te,xe)}return null}function ht(Te,xe,Ue,qe){var vt=xe!==null?xe.key:null;if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint")return vt!==null?null:ae(Te,xe,""+Ue,qe);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case xd:return Ue.key===vt?Ee(Te,xe,Ue,qe):null;case Jl:return Ue.key===vt?ke(Te,xe,Ue,qe):null;case ka:return vt=Ue._init,Ue=vt(Ue._payload),ht(Te,xe,Ue,qe)}if(bd(Ue)||s(Ue))return vt!==null?null:Ye(Te,xe,Ue,qe,null);if(typeof Ue.then=="function")return ht(Te,xe,st(Ue),qe);if(Ue.$$typeof===Ba)return ht(Te,xe,dd(Te,Ue),qe);mt(Te,Ue)}return null}function Rt(Te,xe,Ue,qe,vt){if(typeof qe=="string"&&qe!==""||typeof qe=="number"||typeof qe=="bigint")return Te=Te.get(Ue)||null,ae(xe,Te,""+qe,vt);if(typeof qe=="object"&&qe!==null){switch(qe.$$typeof){case xd:return Te=Te.get(qe.key===null?Ue:qe.key)||null,Ee(xe,Te,qe,vt);case Jl:return Te=Te.get(qe.key===null?Ue:qe.key)||null,ke(xe,Te,qe,vt);case ka:var gn=qe._init;return qe=gn(qe._payload),Rt(Te,xe,Ue,qe,vt)}if(bd(qe)||s(qe))return Te=Te.get(Ue)||null,Ye(xe,Te,qe,vt,null);if(typeof qe.then=="function")return Rt(Te,xe,Ue,st(qe),vt);if(qe.$$typeof===Ba)return Rt(Te,xe,Ue,dd(xe,qe),vt);mt(xe,qe)}return null}function Dr(Te,xe,Ue,qe){for(var vt=null,gn=null,St=xe,qt=xe=0,hi=null;St!==null&&qt<Ue.length;qt++){St.index>qt?(hi=St,St=null):hi=St.sibling;var Yt=ht(Te,St,Ue[qt],qe);if(Yt===null){St===null&&(St=hi);break}u&&St&&Yt.alternate===null&&h(Te,St),xe=N(Yt,xe,qt),gn===null?vt=Yt:gn.sibling=Yt,gn=Yt,St=hi}if(qt===Ue.length)return y(Te,St),jt&&W(Te,qt),vt;if(St===null){for(;qt<Ue.length;qt++)St=ot(Te,Ue[qt],qe),St!==null&&(xe=N(St,xe,qt),gn===null?vt=St:gn.sibling=St,gn=St);return jt&&W(Te,qt),vt}for(St=M(St);qt<Ue.length;qt++)hi=Rt(St,Te,qt,Ue[qt],qe),hi!==null&&(u&&hi.alternate!==null&&St.delete(hi.key===null?qt:hi.key),xe=N(hi,xe,qt),gn===null?vt=hi:gn.sibling=hi,gn=hi);return u&&St.forEach(function(Ya){return h(Te,Ya)}),jt&&W(Te,qt),vt}function ch(Te,xe,Ue,qe){if(Ue==null)throw Error(r(151));for(var vt=null,gn=null,St=xe,qt=xe=0,hi=null,Yt=Ue.next();St!==null&&!Yt.done;qt++,Yt=Ue.next()){St.index>qt?(hi=St,St=null):hi=St.sibling;var Ya=ht(Te,St,Yt.value,qe);if(Ya===null){St===null&&(St=hi);break}u&&St&&Ya.alternate===null&&h(Te,St),xe=N(Ya,xe,qt),gn===null?vt=Ya:gn.sibling=Ya,gn=Ya,St=hi}if(Yt.done)return y(Te,St),jt&&W(Te,qt),vt;if(St===null){for(;!Yt.done;qt++,Yt=Ue.next())Yt=ot(Te,Yt.value,qe),Yt!==null&&(xe=N(Yt,xe,qt),gn===null?vt=Yt:gn.sibling=Yt,gn=Yt);return jt&&W(Te,qt),vt}for(St=M(St);!Yt.done;qt++,Yt=Ue.next())Yt=Rt(St,Te,qt,Yt.value,qe),Yt!==null&&(u&&Yt.alternate!==null&&St.delete(Yt.key===null?qt:Yt.key),xe=N(Yt,xe,qt),gn===null?vt=Yt:gn.sibling=Yt,gn=Yt);return u&&St.forEach(function(kU){return h(Te,kU)}),jt&&W(Te,qt),vt}function qo(Te,xe,Ue,qe){if(typeof Ue=="object"&&Ue!==null&&Ue.type===Ql&&Ue.key===null&&(Ue=Ue.props.children),typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case xd:e:{for(var vt=Ue.key;xe!==null;){if(xe.key===vt){if(vt=Ue.type,vt===Ql){if(xe.tag===7){y(Te,xe.sibling),qe=A(xe,Ue.props.children),qe.return=Te,Te=qe;break e}}else if(xe.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===ka&&Jt(vt)===xe.type){y(Te,xe.sibling),qe=A(xe,Ue.props),at(qe,Ue),qe.return=Te,Te=qe;break e}y(Te,xe);break}else h(Te,xe);xe=xe.sibling}Ue.type===Ql?(qe=Io(Ue.props.children,Te.mode,qe,Ue.key),qe.return=Te,Te=qe):(qe=_d(Ue.type,Ue.key,Ue.props,null,Te.mode,qe),at(qe,Ue),qe.return=Te,Te=qe)}return $(Te);case Jl:e:{for(vt=Ue.key;xe!==null;){if(xe.key===vt)if(xe.tag===4&&xe.stateNode.containerInfo===Ue.containerInfo&&xe.stateNode.implementation===Ue.implementation){y(Te,xe.sibling),qe=A(xe,Ue.children||[]),qe.return=Te,Te=qe;break e}else{y(Te,xe);break}else h(Te,xe);xe=xe.sibling}qe=$0(Ue,Te.mode,qe),qe.return=Te,Te=qe}return $(Te);case ka:return vt=Ue._init,Ue=vt(Ue._payload),qo(Te,xe,Ue,qe)}if(bd(Ue))return Dr(Te,xe,Ue,qe);if(s(Ue)){if(vt=s(Ue),typeof vt!="function")throw Error(r(150));return Ue=vt.call(Ue),ch(Te,xe,Ue,qe)}if(typeof Ue.then=="function")return qo(Te,xe,st(Ue),qe);if(Ue.$$typeof===Ba)return qo(Te,xe,dd(Te,Ue),qe);mt(Te,Ue)}return typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint"?(Ue=""+Ue,xe!==null&&xe.tag===6?(y(Te,xe.sibling),qe=A(xe,Ue),qe.return=Te,Te=qe):(y(Te,xe),qe=Q0(Ue,Te.mode,qe),qe.return=Te,Te=qe),$(Te)):y(Te,xe)}return function(Te,xe,Ue,qe){try{nh=0;var vt=qo(Te,xe,Ue,qe);return uc=null,vt}catch(St){if(St===th)throw St;var gn=t(29,St,null,Te.mode);return gn.lanes=qe,gn.return=Te,gn}finally{}}}function mn(u,h){u=Js,b(Od,u),b(hc,h),Js=u|h.baseLanes}function oi(){b(Od,Js),b(hc,hc.current)}function kn(){Js=Od.current,g(hc),g(Od)}function Cn(u){var h=u.alternate;b(ti,ti.current&1),b(Cr,u),ps===null&&(h===null||hc.current!==null||h.memoizedState!==null)&&(ps=u)}function Vi(u){if(u.tag===22){if(b(ti,ti.current),b(Cr,u),ps===null){var h=u.alternate;h!==null&&h.memoizedState!==null&&(ps=u)}}else $n()}function $n(){b(ti,ti.current),b(Cr,Cr.current)}function yn(u){g(Cr),ps===u&&(ps=null),g(ti)}function xn(u){for(var h=u;h!==null;){if(h.tag===13){var y=h.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||hv(y)||fv(y)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}function Ht(){throw Error(r(321))}function Ls(u,h){if(h===null)return!1;for(var y=0;y<h.length&&y<u.length;y++)if(!fr(u[y],h[y]))return!1;return!0}function hs(u,h,y,M,A,N){return Wa=N,It=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,Mt.H=u===null||u.memoizedState===null?Go:Xa,ko=!1,N=y(M,A),ko=!1,fc&&(N=bo(h,y,M,A)),Gl(u),N}function Gl(u){Mt.H=ms;var h=on!==null&&on.next!==null;if(Wa=0,Xn=on=It=null,Ld=!1,ih=0,dc=null,h)throw Error(r(300));u===null||ci||(u=u.dependencies,u!==null&&fd(u)&&(ci=!0))}function bo(u,h,y,M){It=u;var A=0;do{if(fc&&(dc=null),ih=0,fc=!1,25<=A)throw Error(r(301));if(A+=1,Xn=on=null,u.updateQueue!=null){var N=u.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}Mt.H=Ho,N=h(y,M)}while(fc);return N}function Ra(){var u=Mt.H,h=u.useState()[0];return h=typeof h.then=="function"?we(h):h,u=u.useState()[0],(on!==null?on.memoizedState:null)!==u&&(It.flags|=1024),h}function Ns(){var u=Nd!==0;return Nd=0,u}function So(u,h,y){h.updateQueue=u.updateQueue,h.flags&=-2053,u.lanes&=~y}function Da(u){if(Ld){for(u=u.memoizedState;u!==null;){var h=u.queue;h!==null&&(h.pending=null),u=u.next}Ld=!1}Wa=0,Xn=on=It=null,fc=!1,ih=Nd=0,dc=null}function q(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?It.memoizedState=Xn=u:Xn=Xn.next=u,Xn}function de(){if(on===null){var u=It.alternate;u=u!==null?u.memoizedState:null}else u=on.next;var h=Xn===null?It.memoizedState:Xn.next;if(h!==null)Xn=h,on=u;else{if(u===null)throw It.alternate===null?Error(r(467)):Error(r(310));on=u,u={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},Xn===null?It.memoizedState=Xn=u:Xn=Xn.next=u}return Xn}function we(u){var h=ih;return ih+=1,dc===null&&(dc=[]),u=Re(dc,u,h),h=It,(Xn===null?h.memoizedState:Xn.next)===null&&(h=h.alternate,Mt.H=h===null||h.memoizedState===null?Go:Xa),u}function fe(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return we(u);if(u.$$typeof===Ba)return Si(u)}throw Error(r(438,String(u)))}function ye(u){var h=null,y=It.updateQueue;if(y!==null&&(h=y.memoCache),h==null){var M=It.alternate;M!==null&&(M=M.updateQueue,M!==null&&(M=M.memoCache,M!=null&&(h={data:M.data.map(function(A){return A.slice()}),index:0})))}if(h==null&&(h={data:[],index:0}),y===null&&(y=Mv(),It.updateQueue=y),y.memoCache=h,y=h.data[h.index],y===void 0)for(y=h.data[h.index]=Array(u),M=0;M<u;M++)y[M]=cD;return h.index++,y}function Xe(u,h){return typeof h=="function"?h(u):h}function Je(u){var h=de();return ut(h,on,u)}function ut(u,h,y){var M=u.queue;if(M===null)throw Error(r(311));M.lastRenderedReducer=y;var A=u.baseQueue,N=M.pending;if(N!==null){if(A!==null){var $=A.next;A.next=N.next,N.next=$}h.baseQueue=A=N,M.pending=null}if(N=u.baseState,A===null)u.memoizedState=N;else{h=A.next;var ae=$=null,Ee=null,ke=h,Ye=!1;do{var ot=ke.lane&-536870913;if(ot!==ke.lane?(Vt&ot)===ot:(Wa&ot)===ot){var ht=ke.revertLane;if(ht===0)Ee!==null&&(Ee=Ee.next={lane:0,revertLane:0,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null}),ot===oc&&(Ye=!0);else if((Wa&ht)===ht){ke=ke.next,ht===oc&&(Ye=!0);continue}else ot={lane:0,revertLane:ke.revertLane,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null},Ee===null?(ae=Ee=ot,$=N):Ee=Ee.next=ot,It.lanes|=ht,ja|=ht;ot=ke.action,ko&&y(N,ot),N=ke.hasEagerState?ke.eagerState:y(N,ot)}else ht={lane:ot,revertLane:ke.revertLane,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null},Ee===null?(ae=Ee=ht,$=N):Ee=Ee.next=ht,It.lanes|=ot,ja|=ot;ke=ke.next}while(ke!==null&&ke!==h);if(Ee===null?$=N:Ee.next=ae,!fr(N,u.memoizedState)&&(ci=!0,Ye&&(y=lc,y!==null)))throw y;u.memoizedState=N,u.baseState=$,u.baseQueue=Ee,M.lastRenderedState=N}return A===null&&(M.lanes=0),[u.memoizedState,M.dispatch]}function lt(u){var h=de(),y=h.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=u;var M=y.dispatch,A=y.pending,N=h.memoizedState;if(A!==null){y.pending=null;var $=A=A.next;do N=u(N,$.action),$=$.next;while($!==A);fr(N,h.memoizedState)||(ci=!0),h.memoizedState=N,h.baseQueue===null&&(h.baseState=N),y.lastRenderedState=N}return[N,M]}function yt(u,h,y){var M=It,A=de(),N=jt;if(N){if(y===void 0)throw Error(r(407));y=y()}else y=h();var $=!fr((on||A).memoizedState,y);if($&&(A.memoizedState=y,ci=!0),A=A.queue,Is(Ot.bind(null,M,A,u),[u]),A.getSnapshot!==h||$||Xn!==null&&Xn.memoizedState.tag&1){if(M.flags|=2048,Li(9,pt.bind(null,M,A,y,h),{destroy:void 0},null),hn===null)throw Error(r(349));N||(Wa&60)!==0||_t(M,h,y)}return y}function _t(u,h,y){u.flags|=16384,u={getSnapshot:h,value:y},h=It.updateQueue,h===null?(h=Mv(),It.updateQueue=h,h.stores=[u]):(y=h.stores,y===null?h.stores=[u]:y.push(u))}function pt(u,h,y,M){h.value=y,h.getSnapshot=M,zt(h)&&nn(u)}function Ot(u,h,y){return y(function(){zt(h)&&nn(u)})}function zt(u){var h=u.getSnapshot;u=u.value;try{var y=h();return!fr(u,y)}catch{return!0}}function nn(u){var h=Me(u,2);h!==null&&Ni(h,u,2)}function Qt(u){var h=q();if(typeof u=="function"){var y=u;if(u=y(),ko){L(!0);try{y()}finally{L(!1)}}}return h.memoizedState=h.baseState=u,h.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xe,lastRenderedState:u},h}function Pt(u,h,y,M){return u.baseState=y,ut(u,on,typeof M=="function"?M:Xe)}function gt(u,h,y,M,A){if(Ro(u))throw Error(r(485));if(u=h.action,u!==null){var N={payload:A,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function($){N.listeners.push($)}};Mt.T!==null?y(!0):N.isTransition=!1,M(N),y=h.pending,y===null?(N.next=h.pending=N,_n(h,N)):(N.next=y.next,h.pending=y.next=N)}}function _n(u,h){var y=h.action,M=h.payload,A=u.state;if(h.isTransition){var N=Mt.T,$={};Mt.T=$;try{var ae=y(A,M),Ee=Mt.S;Ee!==null&&Ee($,ae),Nt(u,h,ae)}catch(ke){Wi(u,h,ke)}finally{Mt.T=N}}else try{N=y(A,M),Nt(u,h,N)}catch(ke){Wi(u,h,ke)}}function Nt(u,h,y){y!==null&&typeof y=="object"&&typeof y.then=="function"?y.then(function(M){li(u,h,M)},function(M){return Wi(u,h,M)}):li(u,h,y)}function li(u,h,y){h.status="fulfilled",h.value=y,Gn(h),u.state=y,h=u.pending,h!==null&&(y=h.next,y===h?u.pending=null:(y=y.next,h.next=y,_n(u,y)))}function Wi(u,h,y){var M=u.pending;if(u.pending=null,M!==null){M=M.next;do h.status="rejected",h.reason=y,Gn(h),h=h.next;while(h!==M)}u.action=null}function Gn(u){u=u.listeners;for(var h=0;h<u.length;h++)(0,u[h])()}function ei(u,h){return h}function rn(u,h){if(jt){var y=hn.formState;if(y!==null){e:{var M=It;if(jt){if(wi){var A=eU(wi,ds);if(A){wi=MS(A),M=tU(A);break e}}pe(M)}M=!1}M&&(h=y[0])}}y=q(),y.memoizedState=y.baseState=h,M={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ei,lastRenderedState:h},y.queue=M,y=Fu.bind(null,It,M),M.dispatch=y,M=Qt(!1);var N=Wl.bind(null,It,!1,M.queue);return M=q(),A={state:h,dispatch:null,action:u,pending:null},M.queue=A,y=gt.bind(null,It,A,N,y),A.dispatch=y,M.memoizedState=u,[h,y,!1]}function Hn(u){var h=de();return zn(h,on,u)}function zn(u,h,y){h=ut(u,h,ei)[0],u=Je(Xe)[0],h=typeof h=="object"&&h!==null&&typeof h.then=="function"?we(h):h;var M=de(),A=M.queue,N=A.dispatch;return y!==M.memoizedState&&(It.flags|=2048,Li(9,Vn.bind(null,A,y),{destroy:void 0},null)),[h,N,u]}function Vn(u,h){u.action=h}function Rn(u){var h=de(),y=on;if(y!==null)return zn(h,y,u);de(),h=h.memoizedState,y=de();var M=y.queue.dispatch;return y.memoizedState=u,[h,M,!1]}function Li(u,h,y,M){return u={tag:u,create:h,inst:y,deps:M,next:null},h=It.updateQueue,h===null&&(h=Mv(),It.updateQueue=h),y=h.lastEffect,y===null?h.lastEffect=u.next=u:(M=y.next,y.next=u,u.next=M,h.lastEffect=u),u}function Xi(){return de().memoizedState}function Eo(u,h,y,M){var A=q();It.flags|=u,A.memoizedState=Li(1|h,y,{destroy:void 0},M===void 0?null:M)}function Mo(u,h,y,M){var A=de();M=M===void 0?null:M;var N=A.memoizedState.inst;on!==null&&M!==null&&Ls(M,on.memoizedState.deps)?A.memoizedState=Li(h,y,N,M):(It.flags|=u,A.memoizedState=Li(1|h,y,N,M))}function Hl(u,h){Eo(8390656,8,u,h)}function Is(u,h){Mo(2048,8,u,h)}function Lu(u,h){return Mo(4,2,u,h)}function wo(u,h){return Mo(4,4,u,h)}function Ps(u,h){if(typeof h=="function"){u=u();var y=h(u);return function(){typeof y=="function"?y():h(null)}}if(h!=null)return u=u(),h.current=u,function(){h.current=null}}function zs(u,h,y){y=y!=null?y.concat([u]):null,Mo(4,4,Ps.bind(null,h,u),y)}function Fs(){}function Nu(u,h){var y=de();h=h===void 0?null:h;var M=y.memoizedState;return h!==null&&Ls(h,M[1])?M[0]:(y.memoizedState=[u,h],u)}function Ua(u,h){var y=de();h=h===void 0?null:h;var M=y.memoizedState;if(h!==null&&Ls(h,M[1]))return M[0];if(M=u(),ko){L(!0);try{u()}finally{L(!1)}}return y.memoizedState=[M,h],M}function To(u,h,y){return y===void 0||(Wa&1073741824)!==0?u.memoizedState=h:(u.memoizedState=y,u=Bb(),It.lanes|=u,ja|=u,y)}function Vl(u,h,y,M){return fr(y,h)?y:hc.current!==null?(u=To(u,y,M),fr(u,h)||(ci=!0),u):(Wa&42)===0?(ci=!0,u.memoizedState=y):(u=Bb(),It.lanes|=u,ja|=u,h)}function Iu(u,h,y,M,A){var N=Po();Zi(N!==0&&8>N?N:8);var $=Mt.T,ae={};Mt.T=ae,Wl(u,!1,h,y);try{var Ee=A(),ke=Mt.S;if(ke!==null&&ke(ae,Ee),Ee!==null&&typeof Ee=="object"&&typeof Ee.then=="function"){var Ye=Ie(Ee,M);Bs(u,h,Ye,lr(u))}else Bs(u,h,M,lr(u))}catch(ot){Bs(u,h,{then:function(){},status:"rejected",reason:ot},lr())}finally{Zi(N),Mt.T=$}}function Ao(u){var h=u.memoizedState;if(h!==null)return h;h={memoizedState:$l,baseState:$l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xe,lastRenderedState:$l},next:null};var y={};return h.next={memoizedState:y,baseState:y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xe,lastRenderedState:y},next:null},u.memoizedState=h,u=u.alternate,u!==null&&(u.memoizedState=h),h}function Co(){return Si(zo)}function Pu(){return de().memoizedState}function ji(){return de().memoizedState}function zu(u){for(var h=u.return;h!==null;){switch(h.tag){case 24:case 3:var y=lr();u=Ce(y);var M=He(h,u,y);M!==null&&(Ni(M,h,y),Ve(M,h,y)),h={cache:U0()},u.payload=h;return}h=h.return}}function ud(u,h,y){var M=lr();y={lane:M,revertLane:0,action:y,hasEagerState:!1,eagerState:null,next:null},Ro(u)?Oa(h,y):(y=te(u,h,y,M),y!==null&&(Ni(y,u,M),La(y,h,M)))}function Fu(u,h,y){var M=lr();Bs(u,h,y,M)}function Bs(u,h,y,M){var A={lane:M,revertLane:0,action:y,hasEagerState:!1,eagerState:null,next:null};if(Ro(u))Oa(h,A);else{var N=u.alternate;if(u.lanes===0&&(N===null||N.lanes===0)&&(N=h.lastRenderedReducer,N!==null))try{var $=h.lastRenderedState,ae=N($,y);if(A.hasEagerState=!0,A.eagerState=ae,fr(ae,$))return le(u,h,A,0),hn===null&&G(),!1}catch{}finally{}if(y=te(u,h,A,M),y!==null)return Ni(y,u,M),La(y,h,M),!0}return!1}function Wl(u,h,y,M){if(M={lane:2,revertLane:ge(),action:M,hasEagerState:!1,eagerState:null,next:null},Ro(u)){if(h)throw Error(r(479))}else h=te(u,y,M,2),h!==null&&Ni(h,u,2)}function Ro(u){var h=u.alternate;return u===It||h!==null&&h===It}function Oa(u,h){fc=Ld=!0;var y=u.pending;y===null?h.next=h:(h.next=y.next,y.next=h),u.pending=h}function La(u,h,y){if((y&4194176)!==0){var M=h.lanes;M&=u.pendingLanes,y|=M,h.lanes=y,V(u,y)}}function br(u,h,y,M){h=u.memoizedState,y=y(M,h),y=y==null?h:tv({},h,y),u.memoizedState=y,u.lanes===0&&(u.updateQueue.baseState=y)}function Bu(u,h,y,M,A,N,$){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(M,N,$):h.prototype&&h.prototype.isPureReactComponent?!Le(y,M)||!Le(A,N):!0}function Xl(u,h,y,M){u=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(y,M),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(y,M),h.state!==u&&wv.enqueueReplaceState(h,h.state,null)}function Xr(u,h){var y=h;if("ref"in h){y={};for(var M in h)M!=="ref"&&(y[M]=h[M])}if(u=u.defaultProps){y===h&&(y=tv({},y));for(var A in u)y[A]===void 0&&(y[A]=u[A])}return y}function fs(u,h){try{var y=u.onUncaughtError;y(h.value,{componentStack:h.stack})}catch(M){setTimeout(function(){throw M})}}function ku(u,h,y){try{var M=u.onCaughtError;M(y.value,{componentStack:y.stack,errorBoundary:h.tag===1?h.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function ks(u,h,y){return y=Ce(y),y.tag=3,y.payload={element:null},y.callback=function(){fs(u,h)},y}function jl(u){return u=Ce(u),u.tag=3,u}function bi(u,h,y,M){var A=y.type.getDerivedStateFromError;if(typeof A=="function"){var N=M.value;u.payload=function(){return A(N)},u.callback=function(){ku(h,y,M)}}var $=y.stateNode;$!==null&&typeof $.componentDidCatch=="function"&&(u.callback=function(){ku(h,y,M),typeof A!="function"&&(qa===null?qa=new Set([this]):qa.add(this));var ae=M.stack;this.componentDidCatch(M.value,{componentStack:ae!==null?ae:""})})}function b0(u,h,y,M,A){if(y.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){if(h=y.alternate,h!==null&&Vu(h,y,A,!0),y=Cr.current,y!==null){switch(y.tag){case 13:return ps===null?Y0():y.alternate===null&&Ln===0&&(Ln=3),y.flags&=-257,y.flags|=65536,y.lanes=A,M===Ud?y.flags|=16384:(h=y.updateQueue,h===null?y.updateQueue=new Set([M]):h.add(M),K0(u,M,A)),!1;case 22:return y.flags|=65536,M===Ud?y.flags|=16384:(h=y.updateQueue,h===null?(h={transitions:null,markerInstances:null,retryQueue:new Set([M])},y.updateQueue=h):(y=h.retryQueue,y===null?h.retryQueue=new Set([M]):y.add(M)),K0(u,M,A)),!1}throw Error(r(435,y.tag))}return K0(u,M,A),Y0(),!1}if(jt)return h=Cr.current,h!==null?((h.flags&65536)===0&&(h.flags|=256),h.flags|=65536,h.lanes=A,M!==vv&&(u=Error(r(422),{cause:M}),Ne(H(u,y)))):(M!==vv&&(h=Error(r(423),{cause:M}),Ne(H(h,y))),u=u.current.alternate,u.flags|=65536,A&=-A,u.lanes|=A,M=H(M,y),A=ks(u.stateNode,M,A),nt(u,A),Ln!==4&&(Ln=2)),!1;var N=Error(r(520),{cause:M});if(N=H(N,y),sh===null?sh=[N]:sh.push(N),Ln!==4&&(Ln=2),h===null)return!0;M=H(M,y),y=h;do{switch(y.tag){case 3:return y.flags|=65536,u=A&-A,y.lanes|=u,u=ks(y.stateNode,M,u),nt(y,u),!1;case 1:if(h=y.type,N=y.stateNode,(y.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(qa===null||!qa.has(N))))return y.flags|=65536,A&=-A,y.lanes|=A,A=jl(A),bi(A,u,y,M),nt(y,A),!1}y=y.return}while(y!==null);return!1}function Dn(u,h,y,M){h.child=u===null?FS(h,null,y,M):Bo(h,u.child,y,M)}function Do(u,h,y,M,A){y=y.render;var N=h.ref;if("ref"in M){var $={};for(var ae in M)ae!=="ref"&&($[ae]=M[ae])}else $=M;return Uo(h),M=hs(u,h,y,$,N,A),ae=Ns(),u!==null&&!ci?(So(u,h,A),Gs(u,h,A)):(jt&&ae&&Y(h),h.flags|=1,Dn(u,h,M,A),h.child)}function Gu(u,h,y,M,A){if(u===null){var N=y.type;return typeof N=="function"&&!J0(N)&&N.defaultProps===void 0&&y.compare===null?(h.tag=15,h.type=N,hd(u,h,N,M,A)):(u=_d(y.type,null,M,h,h.mode,A),u.ref=h.ref,u.return=h,h.child=u)}if(N=u.child,!C0(u,A)){var $=N.memoizedProps;if(y=y.compare,y=y!==null?y:Le,y($,M)&&u.ref===h.ref)return Gs(u,h,A)}return h.flags|=1,u=Fa(N,M),u.ref=h.ref,u.return=h,h.child=u}function hd(u,h,y,M,A){if(u!==null){var N=u.memoizedProps;if(Le(N,M)&&u.ref===h.ref)if(ci=!1,h.pendingProps=M=N,C0(u,A))(u.flags&131072)!==0&&(ci=!0);else return h.lanes=u.lanes,Gs(u,h,A)}return Sr(u,h,y,M,A)}function pi(u,h,y){var M=h.pendingProps,A=M.children,N=(h.stateNode._pendingVisibility&2)!==0,$=u!==null?u.memoizedState:null;if(Wn(u,h),M.mode==="hidden"||N){if((h.flags&128)!==0){if(M=$!==null?$.baseLanes|y:y,u!==null){for(A=h.child=u.child,N=0;A!==null;)N=N|A.lanes|A.childLanes,A=A.sibling;h.childLanes=N&~M}else h.childLanes=0,h.child=null;return qi(u,h,M,y)}if((y&536870912)!==0)h.memoizedState={baseLanes:0,cachePool:null},u!==null&&pd(h,$!==null?$.cachePool:null),$!==null?mn(h,$):oi(),Vi(h);else return h.lanes=h.childLanes=536870912,qi(u,h,$!==null?$.baseLanes|y:y,y)}else $!==null?(pd(h,$.cachePool),mn(h,$),$n(),h.memoizedState=null):(u!==null&&pd(h,null),oi(),$n());return Dn(u,h,A,y),h.child}function qi(u,h,y,M){var A=O0();return A=A===null?null:{parent:Xs?Un._currentValue:Un._currentValue2,pool:A},h.memoizedState={baseLanes:y,cachePool:A},u!==null&&pd(h,null),oi(),Vi(h),u!==null&&Vu(u,h,M,!0),null}function Wn(u,h){var y=h.ref;if(y===null)u!==null&&u.ref!==null&&(h.flags|=2097664);else{if(typeof y!="function"&&typeof y!="object")throw Error(r(284));(u===null||u.ref!==y)&&(h.flags|=2097664)}}function Sr(u,h,y,M,A){return Uo(h),y=hs(u,h,y,M,void 0,A),M=Ns(),u!==null&&!ci?(So(u,h,A),Gs(u,h,A)):(jt&&M&&Y(h),h.flags|=1,Dn(u,h,y,A),h.child)}function Hu(u,h,y,M,A,N){return Uo(h),h.updateQueue=null,y=bo(h,M,y,A),Gl(u),M=Ns(),u!==null&&!ci?(So(u,h,N),Gs(u,h,N)):(jt&&M&&Y(h),h.flags|=1,Dn(u,h,y,N),h.child)}function cb(u,h,y,M,A){if(Uo(h),h.stateNode===null){var N=tc,$=y.contextType;typeof $=="object"&&$!==null&&(N=Si($)),N=new y(M,N),h.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=wv,h.stateNode=N,N._reactInternals=h,N=h.stateNode,N.props=M,N.state=h.memoizedState,N.refs={},je(h),$=y.contextType,N.context=typeof $=="object"&&$!==null?Si($):tc,N.state=h.memoizedState,$=y.getDerivedStateFromProps,typeof $=="function"&&(br(h,y,$,M),N.state=h.memoizedState),typeof y.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||($=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),$!==N.state&&wv.enqueueReplaceState(N,N.state,null),ft(h,M,N,A),We(),N.state=h.memoizedState),typeof N.componentDidMount=="function"&&(h.flags|=4194308),M=!0}else if(u===null){N=h.stateNode;var ae=h.memoizedProps,Ee=Xr(y,ae);N.props=Ee;var ke=N.context,Ye=y.contextType;$=tc,typeof Ye=="object"&&Ye!==null&&($=Si(Ye));var ot=y.getDerivedStateFromProps;Ye=typeof ot=="function"||typeof N.getSnapshotBeforeUpdate=="function",ae=h.pendingProps!==ae,Ye||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(ae||ke!==$)&&Xl(h,N,M,$),Va=!1;var ht=h.memoizedState;N.state=ht,ft(h,M,N,A),We(),ke=h.memoizedState,ae||ht!==ke||Va?(typeof ot=="function"&&(br(h,y,ot,M),ke=h.memoizedState),(Ee=Va||Bu(h,y,Ee,M,ht,ke,$))?(Ye||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(h.flags|=4194308)):(typeof N.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=M,h.memoizedState=ke),N.props=M,N.state=ke,N.context=$,M=Ee):(typeof N.componentDidMount=="function"&&(h.flags|=4194308),M=!1)}else{N=h.stateNode,Ze(u,h),$=h.memoizedProps,Ye=Xr(y,$),N.props=Ye,ot=h.pendingProps,ht=N.context,ke=y.contextType,Ee=tc,typeof ke=="object"&&ke!==null&&(Ee=Si(ke)),ae=y.getDerivedStateFromProps,(ke=typeof ae=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||($!==ot||ht!==Ee)&&Xl(h,N,M,Ee),Va=!1,ht=h.memoizedState,N.state=ht,ft(h,M,N,A),We();var Rt=h.memoizedState;$!==ot||ht!==Rt||Va||u!==null&&u.dependencies!==null&&fd(u.dependencies)?(typeof ae=="function"&&(br(h,y,ae,M),Rt=h.memoizedState),(Ye=Va||Bu(h,y,Ye,M,ht,Rt,Ee)||u!==null&&u.dependencies!==null&&fd(u.dependencies))?(ke||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(M,Rt,Ee),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(M,Rt,Ee)),typeof N.componentDidUpdate=="function"&&(h.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof N.componentDidUpdate!="function"||$===u.memoizedProps&&ht===u.memoizedState||(h.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||$===u.memoizedProps&&ht===u.memoizedState||(h.flags|=1024),h.memoizedProps=M,h.memoizedState=Rt),N.props=M,N.state=Rt,N.context=Ee,M=Ye):(typeof N.componentDidUpdate!="function"||$===u.memoizedProps&&ht===u.memoizedState||(h.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||$===u.memoizedProps&&ht===u.memoizedState||(h.flags|=1024),M=!1)}return N=M,Wn(u,h),M=(h.flags&128)!==0,N||M?(N=h.stateNode,y=M&&typeof y.getDerivedStateFromError!="function"?null:N.render(),h.flags|=1,u!==null&&M?(h.child=Bo(h,u.child,null,A),h.child=Bo(h,null,y,A)):Dn(u,h,y,A),h.memoizedState=N.state,u=h.child):u=Gs(u,h,A),u}function ub(u,h,y,M){return ce(),h.flags|=256,Dn(u,h,y,M),h.child}function S0(u){return{baseLanes:u,cachePool:gb()}}function E0(u,h,y){return u=u!==null?u.childLanes&~y:0,h&&(u|=Rr),u}function hb(u,h,y){var M=h.pendingProps,A=!1,N=(h.flags&128)!==0,$;if(($=N)||($=u!==null&&u.memoizedState===null?!1:(ti.current&2)!==0),$&&(A=!0,h.flags&=-129),$=(h.flags&32)!==0,h.flags&=-33,u===null){if(jt){if(A?Cn(h):$n(),jt){var ae=wi,Ee;(Ee=ae)&&(ae=aU(ae,ds),ae!==null?(h.memoizedState={dehydrated:ae,treeContext:Fo!==null?{id:js,overflow:qs}:null,retryLane:536870912},Ee=t(18,null,null,0),Ee.stateNode=ae,Ee.return=h,h.child=Ee,Ii=h,wi=null,Ee=!0):Ee=!1),Ee||pe(h)}if(ae=h.memoizedState,ae!==null&&(ae=ae.dehydrated,ae!==null))return fv(ae)?h.lanes=16:h.lanes=536870912,null;yn(h)}return ae=M.children,M=M.fallback,A?($n(),A=h.mode,ae=w0({mode:"hidden",children:ae},A),M=Io(M,A,y,null),ae.return=h,M.return=h,ae.sibling=M,h.child=ae,A=h.child,A.memoizedState=S0(y),A.childLanes=E0(u,$,y),h.memoizedState=Tv,M):(Cn(h),M0(h,ae))}if(Ee=u.memoizedState,Ee!==null&&(ae=Ee.dehydrated,ae!==null)){if(N)h.flags&256?(Cn(h),h.flags&=-257,h=T0(u,h,y)):h.memoizedState!==null?($n(),h.child=u.child,h.flags|=128,h=null):($n(),A=M.fallback,ae=h.mode,M=w0({mode:"visible",children:M.children},ae),A=Io(A,ae,y,null),A.flags|=2,M.return=h,A.return=h,M.sibling=A,h.child=M,Bo(h,u.child,null,y),M=h.child,M.memoizedState=S0(y),M.childLanes=E0(u,$,y),h.memoizedState=Tv,h=A);else if(Cn(h),fv(ae))$=QD(ae).digest,M=Error(r(419)),M.stack="",M.digest=$,Ne({value:M,source:null,stack:null}),h=T0(u,h,y);else if(ci||Vu(u,h,y,!1),$=(y&u.childLanes)!==0,ci||$){if($=hn,$!==null){if(M=y&-y,(M&42)!==0)M=1;else switch(M){case 2:M=1;break;case 8:M=4;break;case 32:M=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:M=64;break;case 268435456:M=134217728;break;default:M=0}if(M=(M&($.suspendedLanes|y))!==0?0:M,M!==0&&M!==Ee.retryLane)throw Ee.retryLane=M,Me(u,M),Ni($,u,M),kS}hv(ae)||Y0(),h=T0(u,h,y)}else hv(ae)?(h.flags|=128,h.child=u.child,h=tD.bind(null,u),$D(ae,h),h=null):(u=Ee.treeContext,Er&&(wi=iU(ae),Ii=h,jt=!0,Yr=null,ds=!1,u!==null&&(wr[Tr++]=js,wr[Tr++]=qs,wr[Tr++]=Fo,js=u.id,qs=u.overflow,Fo=h)),h=M0(h,M.children),h.flags|=4096);return h}return A?($n(),A=M.fallback,ae=h.mode,Ee=u.child,N=Ee.sibling,M=Fa(Ee,{mode:"hidden",children:M.children}),M.subtreeFlags=Ee.subtreeFlags&31457280,N!==null?A=Fa(N,A):(A=Io(A,ae,y,null),A.flags|=2),A.return=h,M.return=h,M.sibling=A,h.child=M,M=A,A=h.child,ae=u.child.memoizedState,ae===null?ae=S0(y):(Ee=ae.cachePool,Ee!==null?(N=Xs?Un._currentValue:Un._currentValue2,Ee=Ee.parent!==N?{parent:N,pool:N}:Ee):Ee=gb(),ae={baseLanes:ae.baseLanes|y,cachePool:Ee}),A.memoizedState=ae,A.childLanes=E0(u,$,y),h.memoizedState=Tv,M):(Cn(h),y=u.child,u=y.sibling,y=Fa(y,{mode:"visible",children:M.children}),y.return=h,y.sibling=null,u!==null&&($=h.deletions,$===null?(h.deletions=[u],h.flags|=16):$.push(u)),h.child=y,h.memoizedState=null,y)}function M0(u,h){return h=w0({mode:"visible",children:h},u.mode),h.return=u,u.child=h}function w0(u,h){return tS(u,h,0,null)}function T0(u,h,y){return Bo(h,u.child,null,y),u=M0(h,h.pendingProps.children),u.flags|=2,h.memoizedState=null,u}function fb(u,h,y){u.lanes|=h;var M=u.alternate;M!==null&&(M.lanes|=h),R0(u.return,h,y)}function A0(u,h,y,M,A){var N=u.memoizedState;N===null?u.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:M,tail:y,tailMode:A}:(N.isBackwards=h,N.rendering=null,N.renderingStartTime=0,N.last=M,N.tail=y,N.tailMode=A)}function db(u,h,y){var M=h.pendingProps,A=M.revealOrder,N=M.tail;if(Dn(u,h,M.children,y),M=ti.current,(M&2)!==0)M=M&1|2,h.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=h.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&fb(u,y,h);else if(u.tag===19)fb(u,y,h);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===h)break e;for(;u.sibling===null;){if(u.return===null||u.return===h)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}M&=1}switch(b(ti,M),A){case"forwards":for(y=h.child,A=null;y!==null;)u=y.alternate,u!==null&&xn(u)===null&&(A=y),y=y.sibling;y=A,y===null?(A=h.child,h.child=null):(A=y.sibling,y.sibling=null),A0(h,!1,A,y,N);break;case"backwards":for(y=null,A=h.child,h.child=null;A!==null;){if(u=A.alternate,u!==null&&xn(u)===null){h.child=A;break}u=A.sibling,A.sibling=y,y=A,A=u}A0(h,!0,y,null,N);break;case"together":A0(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Gs(u,h,y){if(u!==null&&(h.dependencies=u.dependencies),ja|=h.lanes,(y&h.childLanes)===0)if(u!==null){if(Vu(u,h,y,!1),(y&h.childLanes)===0)return null}else return null;if(u!==null&&h.child!==u.child)throw Error(r(153));if(h.child!==null){for(u=h.child,y=Fa(u,u.pendingProps),h.child=y,y.return=h;u.sibling!==null;)u=u.sibling,y=y.sibling=Fa(u,u.pendingProps),y.return=h;y.sibling=null}return h.child}function C0(u,h){return(u.lanes&h)!==0?!0:(u=u.dependencies,!!(u!==null&&fd(u)))}function W3(u,h,y){switch(h.tag){case 3:j(h,h.stateNode.containerInfo),Na(h,Un,u.memoizedState.cache),ce();break;case 27:case 5:he(h);break;case 4:j(h,h.stateNode.containerInfo);break;case 10:Na(h,h.type,h.memoizedProps.value);break;case 13:var M=h.memoizedState;if(M!==null)return M.dehydrated!==null?(Cn(h),h.flags|=128,null):(y&h.child.childLanes)!==0?hb(u,h,y):(Cn(h),u=Gs(u,h,y),u!==null?u.sibling:null);Cn(h);break;case 19:var A=(u.flags&128)!==0;if(M=(y&h.childLanes)!==0,M||(Vu(u,h,y,!1),M=(y&h.childLanes)!==0),A){if(M)return db(u,h,y);h.flags|=128}if(A=h.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),b(ti,ti.current),M)break;return null;case 22:case 23:return h.lanes=0,pi(u,h,y);case 24:Na(h,Un,u.memoizedState.cache)}return Gs(u,h,y)}function pb(u,h,y){if(u!==null)if(u.memoizedProps!==h.pendingProps)ci=!0;else{if(!C0(u,y)&&(h.flags&128)===0)return ci=!1,W3(u,h,y);ci=(u.flags&131072)!==0}else ci=!1,jt&&(h.flags&1048576)!==0&&F(h,Ad,h.index);switch(h.lanes=0,h.tag){case 16:e:{u=h.pendingProps;var M=h.elementType,A=M._init;if(M=A(M._payload),h.type=M,typeof M=="function")J0(M)?(u=Xr(M,u),h.tag=1,h=cb(null,h,M,u,y)):(h.tag=0,h=Sr(null,h,M,u,y));else{if(M!=null){if(A=M.$$typeof,A===iv){h.tag=11,h=Do(null,h,M,u,y);break e}else if(A===av){h.tag=14,h=Gu(null,h,M,u,y);break e}}throw h=a(M)||M,Error(r(306,h,""))}}return h;case 0:return Sr(u,h,h.type,h.pendingProps,y);case 1:return M=h.type,A=Xr(M,h.pendingProps),cb(u,h,M,A,y);case 3:e:{if(j(h,h.stateNode.containerInfo),u===null)throw Error(r(387));var N=h.pendingProps;A=h.memoizedState,M=A.element,Ze(u,h),ft(h,N,null,y);var $=h.memoizedState;if(N=$.cache,Na(h,Un,N),N!==A.cache&&D0(h,[Un],y,!0),We(),N=$.element,Er&&A.isDehydrated)if(A={element:N,isDehydrated:!1,cache:$.cache},h.updateQueue.baseState=A,h.memoizedState=A,h.flags&256){h=ub(u,h,N,y);break e}else if(N!==M){M=H(Error(r(424)),h),Ne(M),h=ub(u,h,N,y);break e}else for(Er&&(wi=nU(h.stateNode.containerInfo),Ii=h,jt=!0,Yr=null,ds=!0),y=FS(h,null,N,y),h.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ce(),N===M){h=Gs(u,h,y);break e}Dn(u,h,N,y)}h=h.child}return h;case 26:if(Mr)return Wn(u,h),u===null?(y=CS(h.type,null,h.pendingProps,null))?h.memoizedState=y:jt||(h.stateNode=yU(h.type,h.pendingProps,Ha.current,h)):h.memoizedState=CS(h.type,u.memoizedProps,h.pendingProps,u.memoizedState),null;case 27:if(Mi)return he(h),u===null&&Mi&&jt&&(M=h.stateNode=NS(h.type,h.pendingProps,Ha.current,mi.current,!1),Ii=h,ds=!0,wi=wS(M)),M=h.pendingProps.children,u!==null||jt?Dn(u,h,M,y):h.child=Bo(h,null,M,y),Wn(u,h),h.child;case 5:return u===null&&jt&&(mU(h.type,h.pendingProps,mi.current),(A=M=wi)&&(M=rU(M,h.type,h.pendingProps,ds),M!==null?(h.stateNode=M,Ii=h,wi=wS(M),ds=!1,A=!0):A=!1),A||pe(h)),he(h),A=h.type,N=h.pendingProps,$=u!==null?u.memoizedProps:null,M=N.children,Sd(A,N)?M=null:$!==null&&Sd(A,$)&&(h.flags|=32),h.memoizedState!==null&&(A=hs(u,h,Ra,null,null,y),Xs?zo._currentValue=A:zo._currentValue2=A),Wn(u,h),Dn(u,h,M,y),h.child;case 6:return u===null&&jt&&(gU(h.pendingProps,mi.current),(u=y=wi)&&(y=sU(y,h.pendingProps,ds),y!==null?(h.stateNode=y,Ii=h,wi=null,u=!0):u=!1),u||pe(h)),null;case 13:return hb(u,h,y);case 4:return j(h,h.stateNode.containerInfo),M=h.pendingProps,u===null?h.child=Bo(h,null,M,y):Dn(u,h,M,y),h.child;case 11:return Do(u,h,h.type,h.pendingProps,y);case 7:return Dn(u,h,h.pendingProps,y),h.child;case 8:return Dn(u,h,h.pendingProps.children,y),h.child;case 12:return Dn(u,h,h.pendingProps.children,y),h.child;case 10:return M=h.pendingProps,Na(h,h.type,M.value),Dn(u,h,M.children,y),h.child;case 9:return A=h.type._context,M=h.pendingProps.children,Uo(h),A=Si(A),M=M(A),h.flags|=1,Dn(u,h,M,y),h.child;case 14:return Gu(u,h,h.type,h.pendingProps,y);case 15:return hd(u,h,h.type,h.pendingProps,y);case 19:return db(u,h,y);case 22:return pi(u,h,y);case 24:return Uo(h),M=Si(Un),u===null?(A=O0(),A===null&&(A=hn,N=U0(),A.pooledCache=N,N.refCount++,N!==null&&(A.pooledCacheLanes|=y),A=N),h.memoizedState={parent:M,cache:A},je(h),Na(h,Un,A)):((u.lanes&y)!==0&&(Ze(u,h),ft(h,null,null,y),We()),A=u.memoizedState,N=h.memoizedState,A.parent!==M?(A={parent:M,cache:M},h.memoizedState=A,h.lanes===0&&(h.memoizedState=h.updateQueue.baseState=A),Na(h,Un,M)):(M=N.cache,Na(h,Un,M),M!==A.cache&&D0(h,[Un],y,!0))),Dn(u,h,h.pendingProps.children,y),h.child;case 29:throw h.pendingProps}throw Error(r(156,h.tag))}function Na(u,h,y){Xs?(b(Id,h._currentValue),h._currentValue=y):(b(Id,h._currentValue2),h._currentValue2=y)}function Hs(u){var h=Id.current;Xs?u._currentValue=h:u._currentValue2=h,g(Id)}function R0(u,h,y){for(;u!==null;){var M=u.alternate;if((u.childLanes&h)!==h?(u.childLanes|=h,M!==null&&(M.childLanes|=h)):M!==null&&(M.childLanes&h)!==h&&(M.childLanes|=h),u===y)break;u=u.return}}function D0(u,h,y,M){var A=u.child;for(A!==null&&(A.return=u);A!==null;){var N=A.dependencies;if(N!==null){var $=A.child;N=N.firstContext;e:for(;N!==null;){var ae=N;N=A;for(var Ee=0;Ee<h.length;Ee++)if(ae.context===h[Ee]){N.lanes|=y,ae=N.alternate,ae!==null&&(ae.lanes|=y),R0(N.return,y,u),M||($=null);break e}N=ae.next}}else if(A.tag===18){if($=A.return,$===null)throw Error(r(341));$.lanes|=y,N=$.alternate,N!==null&&(N.lanes|=y),R0($,y,u),$=null}else $=A.child;if($!==null)$.return=A;else for($=A;$!==null;){if($===u){$=null;break}if(A=$.sibling,A!==null){A.return=$.return,$=A;break}$=$.return}A=$}}function Vu(u,h,y,M){u=null;for(var A=h,N=!1;A!==null;){if(!N){if((A.flags&524288)!==0)N=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var $=A.alternate;if($===null)throw Error(r(387));if($=$.memoizedProps,$!==null){var ae=A.type;fr(A.pendingProps.value,$.value)||(u!==null?u.push(ae):u=[ae])}}else if(A===Cd.current){if($=A.alternate,$===null)throw Error(r(387));$.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(u!==null?u.push(zo):u=[zo])}A=A.return}u!==null&&D0(h,u,y,M),h.flags|=262144}function fd(u){for(u=u.firstContext;u!==null;){var h=u.context;if(!fr(Xs?h._currentValue:h._currentValue2,u.memoizedValue))return!0;u=u.next}return!1}function Uo(u){Vo=u,Ys=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Si(u){return mb(Vo,u)}function dd(u,h){return Vo===null&&Uo(u),mb(u,h)}function mb(u,h){var y=Xs?h._currentValue:h._currentValue2;if(h={context:h,memoizedValue:y,next:null},Ys===null){if(u===null)throw Error(r(308));Ys=h,u.dependencies={lanes:0,firstContext:h},u.flags|=524288}else Ys=Ys.next=h;return y}function U0(){return{controller:new IU,data:new Map,refCount:0}}function Wu(u){u.refCount--,u.refCount===0&&PU(zU,function(){u.controller.abort()})}function O0(){var u=Wo.current;return u!==null?u:hn.pooledCache}function pd(u,h){h===null?b(Wo,Wo.current):b(Wo,h.pool)}function gb(){var u=O0();return u===null?null:{parent:Xs?Un._currentValue:Un._currentValue2,pool:u}}function sr(u){u.flags|=4}function vb(u,h){if(u!==null&&u.child===h.child)return!1;if((h.flags&16)!==0)return!0;for(u=h.child;u!==null;){if((u.flags&13878)!==0||(u.subtreeFlags&13878)!==0)return!0;u=u.sibling}return!1}function L0(u,h,y,M){if(Ei)for(y=h.child;y!==null;){if(y.tag===5||y.tag===6)cv(u,y.stateNode);else if(!(y.tag===4||Mi&&y.tag===27)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===h)break;for(;y.sibling===null;){if(y.return===null||y.return===h)return;y=y.return}y.sibling.return=y.return,y=y.sibling}else if(Ga)for(var A=h.child;A!==null;){if(A.tag===5){var N=A.stateNode;y&&M&&(N=SS(N,A.type,A.memoizedProps)),cv(u,N)}else if(A.tag===6)N=A.stateNode,y&&M&&(N=ES(N,A.memoizedProps)),cv(u,N);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)N=A.child,N!==null&&(N.return=A),L0(u,A,!0,!0);else if(A.child!==null){A.child.return=A,A=A.child;continue}}if(A===h)break;for(;A.sibling===null;){if(A.return===null||A.return===h)return;A=A.return}A.sibling.return=A.return,A=A.sibling}}function yb(u,h,y,M){if(Ga)for(var A=h.child;A!==null;){if(A.tag===5){var N=A.stateNode;y&&M&&(N=SS(N,A.type,A.memoizedProps)),xS(u,N)}else if(A.tag===6)N=A.stateNode,y&&M&&(N=ES(N,A.memoizedProps)),xS(u,N);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)N=A.child,N!==null&&(N.return=A),yb(u,A,!(A.memoizedProps!==null&&A.memoizedProps.mode==="manual"),!0);else if(A.child!==null){A.child.return=A,A=A.child;continue}}if(A===h)break;for(;A.sibling===null;){if(A.return===null||A.return===h)return;A=A.return}A.sibling.return=A.return,A=A.sibling}}function _b(u,h){if(Ga&&vb(u,h)){u=h.stateNode;var y=u.containerInfo,M=_S();yb(M,h,!1,!1),u.pendingChildren=M,sr(h),JD(y,M)}}function N0(u,h,y,M){if(Ei)u.memoizedProps!==M&&sr(h);else if(Ga){var A=u.stateNode,N=u.memoizedProps;if((u=vb(u,h))||N!==M){var $=mi.current;N=KD(A,y,N,M,!u,null),N===A?h.stateNode=A:(dS(N,y,M,$)&&sr(h),h.stateNode=N,u?L0(N,h,!1,!1):sr(h))}else h.stateNode=A}}function I0(u,h,y){if(MD(h,y)){if(u.flags|=16777216,!gS(h,y))if(Wb())u.flags|=8192;else throw cc=Ud,Ev}else u.flags&=-16777217}function xb(u,h){if(xU(h)){if(u.flags|=16777216,!LS(h))if(Wb())u.flags|=8192;else throw cc=Ud,Ev}else u.flags&=-16777217}function md(u,h){h!==null&&(u.flags|=4),u.flags&16384&&(h=u.tag!==22?D():536870912,u.lanes|=h,gc|=h)}function Xu(u,h){if(!jt)switch(u.tailMode){case"hidden":h=u.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?u.tail=null:y.sibling=null;break;case"collapsed":y=u.tail;for(var M=null;y!==null;)y.alternate!==null&&(M=y),y=y.sibling;M===null?h||u.tail===null?u.tail=null:u.tail.sibling=null:M.sibling=null}}function bn(u){var h=u.alternate!==null&&u.alternate.child===u.child,y=0,M=0;if(h)for(var A=u.child;A!==null;)y|=A.lanes|A.childLanes,M|=A.subtreeFlags&31457280,M|=A.flags&31457280,A.return=u,A=A.sibling;else for(A=u.child;A!==null;)y|=A.lanes|A.childLanes,M|=A.subtreeFlags,M|=A.flags,A.return=u,A=A.sibling;return u.subtreeFlags|=M,u.childLanes=y,h}function X3(u,h,y){var M=h.pendingProps;switch(K(h),h.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bn(h),null;case 1:return bn(h),null;case 3:return y=h.stateNode,M=null,u!==null&&(M=u.memoizedState.cache),h.memoizedState.cache!==M&&(h.flags|=2048),Hs(Un),J(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(u===null||u.child===null)&&(ve(h)?sr(h):u===null||u.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,Yr!==null&&(j0(Yr),Yr=null))),_b(u,h),bn(h),null;case 26:if(Mr){y=h.type;var A=h.memoizedState;return u===null?(sr(h),A!==null?(bn(h),xb(h,A)):(bn(h),I0(h,y,M))):A?A!==u.memoizedState?(sr(h),bn(h),xb(h,A)):(bn(h),h.flags&=-16777217):(Ei?u.memoizedProps!==M&&sr(h):N0(u,h,y,M),bn(h),I0(h,y,M)),null}case 27:if(Mi){if(re(h),y=Ha.current,A=h.type,u!==null&&h.stateNode!=null)Ei?u.memoizedProps!==M&&sr(h):N0(u,h,A,M);else{if(!M){if(h.stateNode===null)throw Error(r(166));return bn(h),null}u=mi.current,ve(h)?Oe(h,u):(u=NS(A,M,y,u,!0),h.stateNode=u,sr(h))}return bn(h),null}case 5:if(re(h),y=h.type,u!==null&&h.stateNode!=null)N0(u,h,y,M);else{if(!M){if(h.stateNode===null)throw Error(r(166));return bn(h),null}u=mi.current,ve(h)?Oe(h,u):(A=vD(y,M,Ha.current,u,h),L0(A,h,!1,!1),h.stateNode=A,dS(A,y,M,u)&&sr(h))}return bn(h),I0(h,h.type,h.pendingProps),null;case 6:if(u&&h.stateNode!=null)y=u.memoizedProps,Ei?y!==M&&sr(h):Ga&&(y!==M?(h.stateNode=pS(M,Ha.current,mi.current,h),sr(h)):h.stateNode=u.stateNode);else{if(typeof M!="string"&&h.stateNode===null)throw Error(r(166));if(u=Ha.current,y=mi.current,ve(h)){if(!Er)throw Error(r(176));if(u=h.stateNode,y=h.memoizedProps,M=null,A=Ii,A!==null)switch(A.tag){case 27:case 5:M=A.memoizedProps}lU(u,y,h,M)||pe(h)}else h.stateNode=pS(M,u,y,h)}return bn(h),null;case 13:if(M=h.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(A=ve(h),M!==null&&M.dehydrated!==null){if(u===null){if(!A)throw Error(r(318));if(!Er)throw Error(r(344));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));cU(A,h)}else ce(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;bn(h),A=!1}else Yr!==null&&(j0(Yr),Yr=null),A=!0;if(!A)return h.flags&256?(yn(h),h):(yn(h),null)}if(yn(h),(h.flags&128)!==0)return h.lanes=y,h;if(y=M!==null,u=u!==null&&u.memoizedState!==null,y){M=h.child,A=null,M.alternate!==null&&M.alternate.memoizedState!==null&&M.alternate.memoizedState.cachePool!==null&&(A=M.alternate.memoizedState.cachePool.pool);var N=null;M.memoizedState!==null&&M.memoizedState.cachePool!==null&&(N=M.memoizedState.cachePool.pool),N!==A&&(M.flags|=2048)}return y!==u&&y&&(h.child.flags|=8192),md(h,h.updateQueue),bn(h),null;case 4:return J(),_b(u,h),u===null&&xD(h.stateNode.containerInfo),bn(h),null;case 10:return Hs(h.type),bn(h),null;case 19:if(g(ti),A=h.memoizedState,A===null)return bn(h),null;if(M=(h.flags&128)!==0,N=A.rendering,N===null)if(M)Xu(A,!1);else{if(Ln!==0||u!==null&&(u.flags&128)!==0)for(u=h.child;u!==null;){if(N=xn(u),N!==null){for(h.flags|=128,Xu(A,!1),u=N.updateQueue,h.updateQueue=u,md(h,u),h.subtreeFlags=0,u=y,y=h.child;y!==null;)eS(y,u),y=y.sibling;return b(ti,ti.current&1|2),h.child}u=u.sibling}A.tail!==null&&qr()>ah&&(h.flags|=128,M=!0,Xu(A,!1),h.lanes=4194304)}else{if(!M)if(u=xn(N),u!==null){if(h.flags|=128,M=!0,u=u.updateQueue,h.updateQueue=u,md(h,u),Xu(A,!0),A.tail===null&&A.tailMode==="hidden"&&!N.alternate&&!jt)return bn(h),null}else 2*qr()-A.renderingStartTime>ah&&y!==536870912&&(h.flags|=128,M=!0,Xu(A,!1),h.lanes=4194304);A.isBackwards?(N.sibling=h.child,h.child=N):(u=A.last,u!==null?u.sibling=N:h.child=N,A.last=N)}return A.tail!==null?(h=A.tail,A.rendering=h,A.tail=h.sibling,A.renderingStartTime=qr(),h.sibling=null,u=ti.current,b(ti,M?u&1|2:u&1),h):(bn(h),null);case 22:case 23:return yn(h),kn(),M=h.memoizedState!==null,u!==null?u.memoizedState!==null!==M&&(h.flags|=8192):M&&(h.flags|=8192),M?(y&536870912)!==0&&(h.flags&128)===0&&(bn(h),h.subtreeFlags&6&&(h.flags|=8192)):bn(h),y=h.updateQueue,y!==null&&md(h,y.retryQueue),y=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),M=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(M=h.memoizedState.cachePool.pool),M!==y&&(h.flags|=2048),u!==null&&g(Wo),null;case 24:return y=null,u!==null&&(y=u.memoizedState.cache),h.memoizedState.cache!==y&&(h.flags|=2048),Hs(Un),bn(h),null;case 25:return null}throw Error(r(156,h.tag))}function j3(u,h){switch(K(h),h.tag){case 1:return u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 3:return Hs(Un),J(),u=h.flags,(u&65536)!==0&&(u&128)===0?(h.flags=u&-65537|128,h):null;case 26:case 27:case 5:return re(h),null;case 13:if(yn(h),u=h.memoizedState,u!==null&&u.dehydrated!==null){if(h.alternate===null)throw Error(r(340));ce()}return u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 19:return g(ti),null;case 4:return J(),null;case 10:return Hs(h.type),null;case 22:case 23:return yn(h),kn(),u!==null&&g(Wo),u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 24:return Hs(Un),null;case 25:return null;default:return null}}function bb(u,h){switch(K(h),h.tag){case 3:Hs(Un),J();break;case 26:case 27:case 5:re(h);break;case 4:J();break;case 13:yn(h);break;case 19:g(ti);break;case 10:Hs(h.type);break;case 22:case 23:yn(h),kn(),u!==null&&g(Wo);break;case 24:Hs(Un)}}function ju(u,h){try{var y=h.updateQueue,M=y!==null?y.lastEffect:null;if(M!==null){var A=M.next;y=A;do{if((y.tag&u)===u){M=void 0;var N=y.create,$=y.inst;M=N(),$.destroy=M}y=y.next}while(y!==A)}}catch(ae){sn(h,h.return,ae)}}function Ia(u,h,y){try{var M=h.updateQueue,A=M!==null?M.lastEffect:null;if(A!==null){var N=A.next;M=N;do{if((M.tag&u)===u){var $=M.inst,ae=$.destroy;if(ae!==void 0){$.destroy=void 0,A=h;var Ee=y;try{ae()}catch(ke){sn(A,Ee,ke)}}}M=M.next}while(M!==N)}}catch(ke){sn(h,h.return,ke)}}function Sb(u){var h=u.updateQueue;if(h!==null){var y=u.stateNode;try{ze(h,y)}catch(M){sn(u,u.return,M)}}}function Eb(u,h,y){y.props=Xr(u.type,u.memoizedProps),y.state=u.memoizedState;try{y.componentWillUnmount()}catch(M){sn(u,h,M)}}function Oo(u,h){try{var y=u.ref;if(y!==null){var M=u.stateNode;switch(u.tag){case 26:case 27:case 5:var A=Zu(M);break;default:A=M}typeof y=="function"?u.refCleanup=y(A):y.current=A}}catch(N){sn(u,h,N)}}function ar(u,h){var y=u.ref,M=u.refCleanup;if(y!==null)if(typeof M=="function")try{M()}catch(A){sn(u,h,A)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof y=="function")try{y(null)}catch(A){sn(u,h,A)}else y.current=null}function Mb(u){var h=u.type,y=u.memoizedProps,M=u.stateNode;try{BD(M,h,y,u)}catch(A){sn(u,u.return,A)}}function wb(u,h,y){try{kD(u.stateNode,u.type,y,h,u)}catch(M){sn(u,u.return,M)}}function Tb(u){return u.tag===5||u.tag===3||(Mr?u.tag===26:!1)||(Mi?u.tag===27:!1)||u.tag===4}function P0(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Tb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&(!Mi||u.tag!==27)&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function z0(u,h,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,h?HD(y,u,h):zD(y,u);else if(!(M===4||Mi&&M===27)&&(u=u.child,u!==null))for(z0(u,h,y),u=u.sibling;u!==null;)z0(u,h,y),u=u.sibling}function gd(u,h,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,h?GD(y,u,h):PD(y,u);else if(!(M===4||Mi&&M===27)&&(u=u.child,u!==null))for(gd(u,h,y),u=u.sibling;u!==null;)gd(u,h,y),u=u.sibling}function Ab(u,h,y){u=u.containerInfo;try{bS(u,y)}catch(M){sn(h,h.return,M)}}function q3(u,h){for(mD(u.containerInfo),ui=h;ui!==null;)if(u=ui,h=u.child,(u.subtreeFlags&1028)!==0&&h!==null)h.return=u,ui=h;else for(;ui!==null;){u=ui;var y=u.alternate;switch(h=u.flags,u.tag){case 0:break;case 11:case 15:break;case 1:if((h&1024)!==0&&y!==null){h=void 0;var M=u,A=y.memoizedProps;y=y.memoizedState;var N=M.stateNode;try{var $=Xr(M.type,A,M.elementType===M.type);h=N.getSnapshotBeforeUpdate($,y),N.__reactInternalSnapshotBeforeUpdate=h}catch(ae){sn(M,M.return,ae)}}break;case 3:(h&1024)!==0&&Ei&&ZD(u.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((h&1024)!==0)throw Error(r(163))}if(h=u.sibling,h!==null){h.return=u.return,ui=h;break}ui=u.return}return $=VS,VS=!1,$}function Cb(u,h,y){var M=y.flags;switch(y.tag){case 0:case 11:case 15:Vs(u,y),M&4&&ju(5,y);break;case 1:if(Vs(u,y),M&4)if(u=y.stateNode,h===null)try{u.componentDidMount()}catch(ae){sn(y,y.return,ae)}else{var A=Xr(y.type,h.memoizedProps);h=h.memoizedState;try{u.componentDidUpdate(A,h,u.__reactInternalSnapshotBeforeUpdate)}catch(ae){sn(y,y.return,ae)}}M&64&&Sb(y),M&512&&Oo(y,y.return);break;case 3:if(Vs(u,y),M&64&&(M=y.updateQueue,M!==null)){if(u=null,y.child!==null)switch(y.child.tag){case 27:case 5:u=Zu(y.child.stateNode);break;case 1:u=y.child.stateNode}try{ze(M,u)}catch(ae){sn(y,y.return,ae)}}break;case 26:if(Mr){Vs(u,y),M&512&&Oo(y,y.return);break}case 27:case 5:Vs(u,y),h===null&&M&4&&Mb(y),M&512&&Oo(y,y.return);break;case 12:Vs(u,y);break;case 13:Vs(u,y),M&4&&Db(u,y);break;case 22:if(A=y.memoizedState!==null||Zs,!A){h=h!==null&&h.memoizedState!==null||On;var N=Zs,$=On;Zs=A,(On=h)&&!$?Pa(u,y,(y.subtreeFlags&8772)!==0):Vs(u,y),Zs=N,On=$}M&512&&(y.memoizedProps.mode==="manual"?Oo(y,y.return):ar(y,y.return));break;default:Vs(u,y)}}function Rb(u){var h=u.alternate;h!==null&&(u.alternate=null,Rb(h)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(h=u.stateNode,h!==null&&ED(h)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function jr(u,h,y){for(y=y.child;y!==null;)F0(u,h,y),y=y.sibling}function F0(u,h,y){if(hr&&typeof hr.onCommitFiberUnmount=="function")try{hr.onCommitFiberUnmount(Qu,y)}catch{}switch(y.tag){case 26:if(Mr){On||ar(y,h),jr(u,h,y),y.memoizedState?DS(y.memoizedState):y.stateNode&&OS(y.stateNode);break}case 27:if(Mi){On||ar(y,h);var M=jn,A=dr;jn=y.stateNode,jr(u,h,y),MU(y.stateNode),jn=M,dr=A;break}case 5:On||ar(y,h);case 6:if(Ei){if(M=jn,A=dr,jn=null,jr(u,h,y),jn=M,dr=A,jn!==null)if(dr)try{WD(jn,y.stateNode)}catch(N){sn(y,h,N)}else try{VD(jn,y.stateNode)}catch(N){sn(y,h,N)}}else jr(u,h,y);break;case 18:Ei&&jn!==null&&(dr?pU(jn,y.stateNode):dU(jn,y.stateNode));break;case 4:Ei?(M=jn,A=dr,jn=y.stateNode.containerInfo,dr=!0,jr(u,h,y),jn=M,dr=A):(Ga&&Ab(y.stateNode,y,_S()),jr(u,h,y));break;case 0:case 11:case 14:case 15:On||Ia(2,y,h),On||Ia(4,y,h),jr(u,h,y);break;case 1:On||(ar(y,h),M=y.stateNode,typeof M.componentWillUnmount=="function"&&Eb(y,h,M)),jr(u,h,y);break;case 21:jr(u,h,y);break;case 22:On||ar(y,h),On=(M=On)||y.memoizedState!==null,jr(u,h,y),On=M;break;default:jr(u,h,y)}}function Db(u,h){if(Er&&h.memoizedState===null&&(u=h.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{fU(u)}catch(y){sn(h,h.return,y)}}function Y3(u){switch(u.tag){case 13:case 19:var h=u.stateNode;return h===null&&(h=u.stateNode=new HS),h;case 22:return u=u.stateNode,h=u._retryCache,h===null&&(h=u._retryCache=new HS),h;default:throw Error(r(435,u.tag))}}function B0(u,h){var y=Y3(u);h.forEach(function(M){var A=nD.bind(null,u,M);y.has(M)||(y.add(M),M.then(A,A))})}function Yi(u,h){var y=h.deletions;if(y!==null)for(var M=0;M<y.length;M++){var A=y[M],N=u,$=h;if(Ei){var ae=$;e:for(;ae!==null;){switch(ae.tag){case 27:case 5:jn=ae.stateNode,dr=!1;break e;case 3:jn=ae.stateNode.containerInfo,dr=!0;break e;case 4:jn=ae.stateNode.containerInfo,dr=!0;break e}ae=ae.return}if(jn===null)throw Error(r(160));F0(N,$,A),jn=null,dr=!1}else F0(N,$,A);N=A.alternate,N!==null&&(N.return=null),A.return=null}if(h.subtreeFlags&13878)for(h=h.child;h!==null;)Ub(h,u),h=h.sibling}function Ub(u,h){var y=u.alternate,M=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:Yi(h,u),or(u),M&4&&(Ia(3,u,u.return),ju(3,u),Ia(5,u,u.return));break;case 1:Yi(h,u),or(u),M&512&&(On||y===null||ar(y,y.return)),M&64&&Zs&&(u=u.updateQueue,u!==null&&(M=u.callbacks,M!==null&&(y=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=y===null?M:y.concat(M))));break;case 26:if(Mr){var A=Zr;Yi(h,u),or(u),M&512&&(On||y===null||ar(y,y.return)),M&4&&(M=y!==null?y.memoizedState:null,h=u.memoizedState,y===null?h===null?u.stateNode===null?u.stateNode=vU(A,u.type,u.memoizedProps,u):US(A,u.type,u.stateNode):u.stateNode=RS(A,h,u.memoizedProps):M!==h?(M===null?y.stateNode!==null&&OS(y.stateNode):DS(M),h===null?US(A,u.type,u.stateNode):RS(A,h,u.memoizedProps)):h===null&&u.stateNode!==null&&wb(u,u.memoizedProps,y.memoizedProps));break}case 27:if(Mi&&M&4&&u.alternate===null){A=u.stateNode;var N=u.memoizedProps;try{SU(A),EU(u.type,N,A,u)}catch(Ye){sn(u,u.return,Ye)}}case 5:if(Yi(h,u),or(u),M&512&&(On||y===null||ar(y,y.return)),Ei){if(u.flags&32){h=u.stateNode;try{yS(h)}catch(Ye){sn(u,u.return,Ye)}}M&4&&u.stateNode!=null&&(h=u.memoizedProps,wb(u,h,y!==null?y.memoizedProps:h)),M&1024&&(Av=!0)}break;case 6:if(Yi(h,u),or(u),M&4&&Ei){if(u.stateNode===null)throw Error(r(162));M=u.memoizedProps,y=y!==null?y.memoizedProps:M,h=u.stateNode;try{FD(h,y,M)}catch(Ye){sn(u,u.return,Ye)}}break;case 3:if(Mr?(_U(),A=Zr,Zr=dv(h.containerInfo),Yi(h,u),Zr=A):Yi(h,u),or(u),M&4){if(Ei&&Er&&y!==null&&y.memoizedState.isDehydrated)try{hU(h.containerInfo)}catch(Ye){sn(u,u.return,Ye)}if(Ga){M=h.containerInfo,y=h.pendingChildren;try{bS(M,y)}catch(Ye){sn(u,u.return,Ye)}}}Av&&(Av=!1,Ob(u));break;case 4:Mr?(y=Zr,Zr=dv(u.stateNode.containerInfo),Yi(h,u),or(u),Zr=y):(Yi(h,u),or(u)),M&4&&Ga&&Ab(u.stateNode,u,u.stateNode.pendingChildren);break;case 12:Yi(h,u),or(u);break;case 13:Yi(h,u),or(u),u.child.flags&8192&&u.memoizedState!==null!=(y!==null&&y.memoizedState!==null)&&(Uv=qr()),M&4&&(M=u.updateQueue,M!==null&&(u.updateQueue=null,B0(u,M)));break;case 22:M&512&&(On||y===null||ar(y,y.return)),A=u.memoizedState!==null;var $=y!==null&&y.memoizedState!==null,ae=Zs,Ee=On;if(Zs=ae||A,On=Ee||$,Yi(h,u),On=Ee,Zs=ae,or(u),h=u.stateNode,h._current=u,h._visibility&=-3,h._visibility|=h._pendingVisibility&2,M&8192&&(h._visibility=A?h._visibility&-2:h._visibility|1,A&&(h=Zs||On,y===null||$||h||ql(u)),Ei&&(u.memoizedProps===null||u.memoizedProps.mode!=="manual"))){e:if(y=null,Ei)for(h=u;;){if(h.tag===5||Mr&&h.tag===26||Mi&&h.tag===27){if(y===null){$=y=h;try{N=$.stateNode,A?XD(N):qD($.stateNode,$.memoizedProps)}catch(Ye){sn($,$.return,Ye)}}}else if(h.tag===6){if(y===null){$=h;try{var ke=$.stateNode;A?jD(ke):YD(ke,$.memoizedProps)}catch(Ye){sn($,$.return,Ye)}}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===u)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break e;for(;h.sibling===null;){if(h.return===null||h.return===u)break e;y===h&&(y=null),h=h.return}y===h&&(y=null),h.sibling.return=h.return,h=h.sibling}}M&4&&(M=u.updateQueue,M!==null&&(y=M.retryQueue,y!==null&&(M.retryQueue=null,B0(u,y))));break;case 19:Yi(h,u),or(u),M&4&&(M=u.updateQueue,M!==null&&(u.updateQueue=null,B0(u,M)));break;case 21:break;default:Yi(h,u),or(u)}}function or(u){var h=u.flags;if(h&2){try{if(Ei&&(!Mi||u.tag!==27)){e:{for(var y=u.return;y!==null;){if(Tb(y)){var M=y;break e}y=y.return}throw Error(r(160))}switch(M.tag){case 27:if(Mi){var A=M.stateNode,N=P0(u);gd(u,N,A);break}case 5:var $=M.stateNode;M.flags&32&&(yS($),M.flags&=-33);var ae=P0(u);gd(u,ae,$);break;case 3:case 4:var Ee=M.stateNode.containerInfo,ke=P0(u);z0(u,ke,Ee);break;default:throw Error(r(161))}}}catch(Ye){sn(u,u.return,Ye)}u.flags&=-3}h&4096&&(u.flags&=-4097)}function Ob(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var h=u;Ob(h),h.tag===5&&h.flags&1024&&AD(h.stateNode),u=u.sibling}}function Vs(u,h){if(h.subtreeFlags&8772)for(h=h.child;h!==null;)Cb(u,h.alternate,h),h=h.sibling}function ql(u){for(u=u.child;u!==null;){var h=u;switch(h.tag){case 0:case 11:case 14:case 15:Ia(4,h,h.return),ql(h);break;case 1:ar(h,h.return);var y=h.stateNode;typeof y.componentWillUnmount=="function"&&Eb(h,h.return,y),ql(h);break;case 26:case 27:case 5:ar(h,h.return),ql(h);break;case 22:ar(h,h.return),h.memoizedState===null&&ql(h);break;default:ql(h)}u=u.sibling}}function Pa(u,h,y){for(y=y&&(h.subtreeFlags&8772)!==0,h=h.child;h!==null;){var M=h.alternate,A=u,N=h,$=N.flags;switch(N.tag){case 0:case 11:case 15:Pa(A,N,y),ju(4,N);break;case 1:if(Pa(A,N,y),M=N,A=M.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(ke){sn(M,M.return,ke)}if(M=N,A=M.updateQueue,A!==null){var ae=M.stateNode;try{var Ee=A.shared.hiddenCallbacks;if(Ee!==null)for(A.shared.hiddenCallbacks=null,A=0;A<Ee.length;A++)se(Ee[A],ae)}catch(ke){sn(M,M.return,ke)}}y&&$&64&&Sb(N),Oo(N,N.return);break;case 26:case 27:case 5:Pa(A,N,y),y&&M===null&&$&4&&Mb(N),Oo(N,N.return);break;case 12:Pa(A,N,y);break;case 13:Pa(A,N,y),y&&$&4&&Db(A,N);break;case 22:N.memoizedState===null&&Pa(A,N,y),Oo(N,N.return);break;default:Pa(A,N,y)}h=h.sibling}}function k0(u,h){var y=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),u=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(u=h.memoizedState.cachePool.pool),u!==y&&(u!=null&&u.refCount++,y!=null&&Wu(y))}function G0(u,h){u=null,h.alternate!==null&&(u=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==u&&(h.refCount++,u!=null&&Wu(u))}function za(u,h,y,M){if(h.subtreeFlags&10256)for(h=h.child;h!==null;)Lb(u,h,y,M),h=h.sibling}function Lb(u,h,y,M){var A=h.flags;switch(h.tag){case 0:case 11:case 15:za(u,h,y,M),A&2048&&ju(9,h);break;case 3:za(u,h,y,M),A&2048&&(u=null,h.alternate!==null&&(u=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==u&&(h.refCount++,u!=null&&Wu(u)));break;case 12:if(A&2048){za(u,h,y,M),u=h.stateNode;try{var N=h.memoizedProps,$=N.id,ae=N.onPostCommit;typeof ae=="function"&&ae($,h.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(Ee){sn(h,h.return,Ee)}}else za(u,h,y,M);break;case 23:break;case 22:N=h.stateNode,h.memoizedState!==null?N._visibility&4?za(u,h,y,M):qu(u,h):N._visibility&4?za(u,h,y,M):(N._visibility|=4,Yl(u,h,y,M,(h.subtreeFlags&10256)!==0)),A&2048&&k0(h.alternate,h);break;case 24:za(u,h,y,M),A&2048&&G0(h.alternate,h);break;default:za(u,h,y,M)}}function Yl(u,h,y,M,A){for(A=A&&(h.subtreeFlags&10256)!==0,h=h.child;h!==null;){var N=u,$=h,ae=y,Ee=M,ke=$.flags;switch($.tag){case 0:case 11:case 15:Yl(N,$,ae,Ee,A),ju(8,$);break;case 23:break;case 22:var Ye=$.stateNode;$.memoizedState!==null?Ye._visibility&4?Yl(N,$,ae,Ee,A):qu(N,$):(Ye._visibility|=4,Yl(N,$,ae,Ee,A)),A&&ke&2048&&k0($.alternate,$);break;case 24:Yl(N,$,ae,Ee,A),A&&ke&2048&&G0($.alternate,$);break;default:Yl(N,$,ae,Ee,A)}h=h.sibling}}function qu(u,h){if(h.subtreeFlags&10256)for(h=h.child;h!==null;){var y=u,M=h,A=M.flags;switch(M.tag){case 22:qu(y,M),A&2048&&k0(M.alternate,M);break;case 24:qu(y,M),A&2048&&G0(M.alternate,M);break;default:qu(y,M)}h=h.sibling}}function Lo(u){if(u.subtreeFlags&pc)for(u=u.child;u!==null;)Nb(u),u=u.sibling}function Nb(u){switch(u.tag){case 26:Lo(u),u.flags&pc&&(u.memoizedState!==null?bU(Zr,u.memoizedState,u.memoizedProps):vS(u.type,u.memoizedProps));break;case 5:Lo(u),u.flags&pc&&vS(u.type,u.memoizedProps);break;case 3:case 4:if(Mr){var h=Zr;Zr=dv(u.stateNode.containerInfo),Lo(u),Zr=h}else Lo(u);break;case 22:u.memoizedState===null&&(h=u.alternate,h!==null&&h.memoizedState!==null?(h=pc,pc=16777216,Lo(u),pc=h):Lo(u));break;default:Lo(u)}}function Ib(u){var h=u.alternate;if(h!==null&&(u=h.child,u!==null)){h.child=null;do h=u.sibling,u.sibling=null,u=h;while(u!==null)}}function Yu(u){var h=u.deletions;if((u.flags&16)!==0){if(h!==null)for(var y=0;y<h.length;y++){var M=h[y];ui=M,zb(M,u)}Ib(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)Pb(u),u=u.sibling}function Pb(u){switch(u.tag){case 0:case 11:case 15:Yu(u),u.flags&2048&&Ia(9,u,u.return);break;case 3:Yu(u);break;case 12:Yu(u);break;case 22:var h=u.stateNode;u.memoizedState!==null&&h._visibility&4&&(u.return===null||u.return.tag!==13)?(h._visibility&=-5,vd(u)):Yu(u);break;default:Yu(u)}}function vd(u){var h=u.deletions;if((u.flags&16)!==0){if(h!==null)for(var y=0;y<h.length;y++){var M=h[y];ui=M,zb(M,u)}Ib(u)}for(u=u.child;u!==null;){switch(h=u,h.tag){case 0:case 11:case 15:Ia(8,h,h.return),vd(h);break;case 22:y=h.stateNode,y._visibility&4&&(y._visibility&=-5,vd(h));break;default:vd(h)}u=u.sibling}}function zb(u,h){for(;ui!==null;){var y=ui;switch(y.tag){case 0:case 11:case 15:Ia(8,y,h);break;case 23:case 22:if(y.memoizedState!==null&&y.memoizedState.cachePool!==null){var M=y.memoizedState.cachePool.pool;M!=null&&M.refCount++}break;case 24:Wu(y.memoizedState.cache)}if(M=y.child,M!==null)M.return=y,ui=M;else e:for(y=u;ui!==null;){M=ui;var A=M.sibling,N=M.return;if(Rb(M),M===y){ui=null;break e}if(A!==null){A.return=N,ui=A;break e}ui=N}}}function H0(u){var h=mS(u);if(h!=null){if(typeof h.memoizedProps["data-testname"]!="string")throw Error(r(364));return h}if(u=DD(u),u===null)throw Error(r(362));return u.stateNode.current}function V0(u,h){var y=u.tag;switch(h.$$typeof){case Pd:if(u.type===h.value)return!0;break;case zd:e:{for(h=h.value,u=[u,0],y=0;y<u.length;){var M=u[y++],A=M.tag,N=u[y++],$=h[N];if(A!==5&&A!==26&&A!==27||!Ju(M)){for(;$!=null&&V0(M,$);)N++,$=h[N];if(N===h.length){h=!0;break e}else for(M=M.child;M!==null;)u.push(M,N),M=M.sibling}}h=!1}return h;case Fd:if((y===5||y===26||y===27)&&LD(u.stateNode,h.value))return!0;break;case kd:if((y===5||y===6||y===26||y===27)&&(u=OD(u),u!==null&&0<=u.indexOf(h.value)))return!0;break;case Bd:if((y===5||y===26||y===27)&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===h.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function W0(u){switch(u.$$typeof){case Pd:return"<"+(a(u.value)||"Unknown")+">";case zd:return":has("+(W0(u)||"")+")";case Fd:return'[role="'+u.value+'"]';case kd:return'"'+u.value+'"';case Bd:return'[data-testname="'+u.value+'"]';default:throw Error(r(365))}}function Fb(u,h){var y=[];u=[u,0];for(var M=0;M<u.length;){var A=u[M++],N=A.tag,$=u[M++],ae=h[$];if(N!==5&&N!==26&&N!==27||!Ju(A)){for(;ae!=null&&V0(A,ae);)$++,ae=h[$];if($===h.length)y.push(A);else for(A=A.child;A!==null;)u.push(A,$),A=A.sibling}}return y}function X0(u,h){if(!Ku)throw Error(r(363));u=H0(u),u=Fb(u,h),h=[],u=Array.from(u);for(var y=0;y<u.length;){var M=u[y++],A=M.tag;if(A===5||A===26||A===27)Ju(M)||h.push(M.stateNode);else for(M=M.child;M!==null;)u.push(M),M=M.sibling}return h}function lr(){if((ln&2)!==0&&Vt!==0)return Vt&-Vt;if(Mt.T!==null){var u=oc;return u!==0?u:ge()}return bD()}function Bb(){Rr===0&&(Rr=(Vt&536870912)===0||jt?U():536870912);var u=Cr.current;return u!==null&&(u.flags|=32),Rr}function Ni(u,h,y){(u===hn&&fn===2||u.cancelPendingCommit!==null)&&(Zl(u,0),Ws(u,Vt,Rr,!1)),I(u,y),((ln&2)===0||u!==hn)&&(u===hn&&((ln&2)===0&&(Xo|=y),Ln===4&&Ws(u,Vt,Rr,!1)),_e(u))}function kb(u,h,y){if((ln&6)!==0)throw Error(r(327));var M=!y&&(h&60)===0&&(h&u.expiredLanes)===0||T(u,h),A=M?J3(u,h):Z0(u,h,!0),N=M;do{if(A===0){mc&&!M&&Ws(u,h,0,!1);break}else if(A===6)Ws(u,h,0,!Ks);else{if(y=u.current.alternate,N&&!Z3(y)){A=Z0(u,h,!1),N=!1;continue}if(A===2){if(N=h,u.errorRecoveryDisabledLanes&N)var $=0;else $=u.pendingLanes&-536870913,$=$!==0?$:$&536870912?536870912:0;if($!==0){h=$;e:{var ae=u;A=sh;var Ee=Er&&ae.current.memoizedState.isDehydrated;if(Ee&&(Zl(ae,$).flags|=256),$=Z0(ae,$,!1),$!==2){if(Cv&&!Ee){ae.errorRecoveryDisabledLanes|=N,Xo|=N,A=4;break e}N=gs,gs=A,N!==null&&j0(N)}A=$}if(N=!1,A!==2)continue}}if(A===1){Zl(u,0),Ws(u,h,0,!0);break}e:{switch(M=u,A){case 0:case 1:throw Error(r(345));case 4:if((h&4194176)===h){Ws(M,h,Rr,!Ks);break e}break;case 2:gs=null;break;case 3:case 5:break;default:throw Error(r(329))}if(M.finishedWork=y,M.finishedLanes=h,(h&62914560)===h&&(N=Uv+300-qr(),10<N)){if(Ws(M,h,Rr,!Ks),w(M,0)!==0)break e;M.timeoutHandle=yD(Gb.bind(null,M,y,gs,Gd,Dv,h,Rr,Xo,gc,Ks,2,-0,0),N);break e}Gb(M,y,gs,Gd,Dv,h,Rr,Xo,gc,Ks,0,-0,0)}}break}while(!0);_e(u)}function j0(u){gs===null?gs=u:gs.push.apply(gs,u)}function Gb(u,h,y,M,A,N,$,ae,Ee,ke,Ye,ot,ht){var Rt=h.subtreeFlags;if((Rt&8192||(Rt&16785408)===16785408)&&(wD(),Nb(h),h=TD(),h!==null)){u.cancelPendingCommit=h(Kb.bind(null,u,y,M,A,$,ae,Ee,1,ot,ht)),Ws(u,N,$,!ke);return}Kb(u,y,M,A,$,ae,Ee,Ye,ot,ht)}function Z3(u){for(var h=u;;){var y=h.tag;if((y===0||y===11||y===15)&&h.flags&16384&&(y=h.updateQueue,y!==null&&(y=y.stores,y!==null)))for(var M=0;M<y.length;M++){var A=y[M],N=A.getSnapshot;A=A.value;try{if(!fr(N(),A))return!1}catch{return!1}}if(y=h.child,h.subtreeFlags&16384&&y!==null)y.return=h,h=y;else{if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function Ws(u,h,y,M){h&=~Rv,h&=~Xo,u.suspendedLanes|=h,u.pingedLanes&=~h,M&&(u.warmLanes|=h),M=u.expirationTimes;for(var A=h;0<A;){var N=31-ur(A),$=1<<N;M[N]=-1,A&=~$}y!==0&&O(u,y,h)}function Hb(){return(ln&6)===0?(ne(0),!1):!0}function q0(){if(Bt!==null){if(fn===0)var u=Bt.return;else u=Bt,Ys=Vo=null,Da(u),uc=null,nh=0,u=Bt;for(;u!==null;)bb(u.alternate,u),u=u.return;Bt=null}}function Zl(u,h){u.finishedWork=null,u.finishedLanes=0;var y=u.timeoutHandle;y!==uv&&(u.timeoutHandle=uv,_D(y)),y=u.cancelPendingCommit,y!==null&&(u.cancelPendingCommit=null,y()),q0(),hn=u,Bt=y=Fa(u.current,null),Vt=h,fn=0,pr=null,Ks=!1,mc=T(u,h),Cv=!1,gc=Rr=Rv=Xo=ja=Ln=0,gs=sh=null,Dv=!1,(h&8)!==0&&(h|=h&32);var M=u.entangledLanes;if(M!==0)for(u=u.entanglements,M&=h;0<M;){var A=31-ur(M),N=1<<A;h|=u[A],M&=~N}return Js=h,G(),y}function Vb(u,h){It=null,Mt.H=ms,h===th?(h=Ke(),fn=3):h===Ev?(h=Ke(),fn=4):fn=h===kS?8:h!==null&&typeof h=="object"&&typeof h.then=="function"?6:1,pr=h,Bt===null&&(Ln=1,fs(u,H(h,u.current)))}function Wb(){var u=Cr.current;return u===null?!0:(Vt&4194176)===Vt?ps===null:(Vt&62914560)===Vt||(Vt&536870912)!==0?u===ps:!1}function Xb(){var u=Mt.H;return Mt.H=ms,u===null?ms:u}function jb(){var u=Mt.A;return Mt.A=FU,u}function Y0(){Ln=4,Ks||(Vt&4194176)!==Vt&&Cr.current!==null||(mc=!0),(ja&134217727)===0&&(Xo&134217727)===0||hn===null||Ws(hn,Vt,Rr,!1)}function Z0(u,h,y){var M=ln;ln|=2;var A=Xb(),N=jb();(hn!==u||Vt!==h)&&(Gd=null,Zl(u,h)),h=!1;var $=Ln;e:do try{if(fn!==0&&Bt!==null){var ae=Bt,Ee=pr;switch(fn){case 8:q0(),$=6;break e;case 3:case 2:case 6:Cr.current===null&&(h=!0);var ke=fn;if(fn=0,pr=null,Kl(u,ae,Ee,ke),y&&mc){$=0;break e}break;default:ke=fn,fn=0,pr=null,Kl(u,ae,Ee,ke)}}K3(),$=Ln;break}catch(Ye){Vb(u,Ye)}while(!0);return h&&u.shellSuspendCounter++,Ys=Vo=null,ln=M,Mt.H=A,Mt.A=N,Bt===null&&(hn=null,Vt=0,G()),$}function K3(){for(;Bt!==null;)qb(Bt)}function J3(u,h){var y=ln;ln|=2;var M=Xb(),A=jb();hn!==u||Vt!==h?(Gd=null,ah=qr()+500,Zl(u,h)):mc=T(u,h);e:do try{if(fn!==0&&Bt!==null){h=Bt;var N=pr;t:switch(fn){case 1:fn=0,pr=null,Kl(u,h,N,1);break;case 2:if(rt(N)){fn=0,pr=null,Yb(h);break}h=function(){fn===2&&hn===u&&(fn=7),_e(u)},N.then(h,h);break e;case 3:fn=7;break e;case 4:fn=5;break e;case 7:rt(N)?(fn=0,pr=null,Yb(h)):(fn=0,pr=null,Kl(u,h,N,7));break;case 5:var $=null;switch(Bt.tag){case 26:$=Bt.memoizedState;case 5:case 27:var ae=Bt,Ee=ae.type,ke=ae.pendingProps;if($?LS($):gS(Ee,ke)){fn=0,pr=null;var Ye=ae.sibling;if(Ye!==null)Bt=Ye;else{var ot=ae.return;ot!==null?(Bt=ot,yd(ot)):Bt=null}break t}}fn=0,pr=null,Kl(u,h,N,5);break;case 6:fn=0,pr=null,Kl(u,h,N,6);break;case 8:q0(),Ln=6;break e;default:throw Error(r(462))}}Q3();break}catch(ht){Vb(u,ht)}while(!0);return Ys=Vo=null,Mt.H=M,Mt.A=A,ln=y,Bt!==null?0:(hn=null,Vt=0,G(),Ln)}function Q3(){for(;Bt!==null&&!AU();)qb(Bt)}function qb(u){var h=pb(u.alternate,u,Js);u.memoizedProps=u.pendingProps,h===null?yd(u):Bt=h}function Yb(u){var h=u,y=h.alternate;switch(h.tag){case 15:case 0:h=Hu(y,h,h.pendingProps,h.type,void 0,Vt);break;case 11:h=Hu(y,h,h.pendingProps,h.type.render,h.ref,Vt);break;case 5:Da(h);default:bb(y,h),h=Bt=eS(h,Js),h=pb(y,h,Js)}u.memoizedProps=u.pendingProps,h===null?yd(u):Bt=h}function Kl(u,h,y,M){Ys=Vo=null,Da(h),uc=null,nh=0;var A=h.return;try{if(b0(u,A,h,y,Vt)){Ln=1,fs(u,H(y,u.current)),Bt=null;return}}catch(N){if(A!==null)throw Bt=A,N;Ln=1,fs(u,H(y,u.current)),Bt=null;return}h.flags&32768?(jt||M===1?u=!0:mc||(Vt&536870912)!==0?u=!1:(Ks=u=!0,(M===2||M===3||M===6)&&(M=Cr.current,M!==null&&M.tag===13&&(M.flags|=16384))),Zb(h,u)):yd(h)}function yd(u){var h=u;do{if((h.flags&32768)!==0){Zb(h,Ks);return}u=h.return;var y=X3(h.alternate,h,Js);if(y!==null){Bt=y;return}if(h=h.sibling,h!==null){Bt=h;return}Bt=h=u}while(h!==null);Ln===0&&(Ln=5)}function Zb(u,h){do{var y=j3(u.alternate,u);if(y!==null){y.flags&=32767,Bt=y;return}if(y=u.return,y!==null&&(y.flags|=32768,y.subtreeFlags=0,y.deletions=null),!h&&(u=u.sibling,u!==null)){Bt=u;return}Bt=u=y}while(u!==null);Ln=6,Bt=null}function Kb(u,h,y,M,A,N,$,ae,Ee,ke){var Ye=Mt.T,ot=Po();try{Zi(2),Mt.T=null,$3(u,h,y,M,ot,A,N,$,ae,Ee,ke)}finally{Mt.T=Ye,Zi(ot)}}function $3(u,h,y,M,A,N,$,ae){do No();while(jo!==null);if((ln&6)!==0)throw Error(r(327));var Ee=u.finishedWork;if(M=u.finishedLanes,Ee===null)return null;if(u.finishedWork=null,u.finishedLanes=0,Ee===u.current)throw Error(r(177));u.callbackNode=null,u.callbackPriority=0,u.cancelPendingCommit=null;var ke=Ee.lanes|Ee.childLanes;if(ke|=yv,z(u,M,ke,N,$,ae),u===hn&&(Bt=hn=null,Vt=0),(Ee.subtreeFlags&10256)===0&&(Ee.flags&10256)===0||Hd||(Hd=!0,Ov=ke,Lv=y,iD(gv,function(){return No(),null})),y=(Ee.flags&15990)!==0,(Ee.subtreeFlags&15990)!==0||y?(y=Mt.T,Mt.T=null,N=Po(),Zi(2),$=ln,ln|=4,q3(u,Ee),Ub(Ee,u),gD(u.containerInfo),u.current=Ee,Cb(u,Ee.alternate,Ee),CU(),ln=$,Zi(N),Mt.T=y):u.current=Ee,Hd?(Hd=!1,jo=u,oh=M):Jb(u,ke),ke=u.pendingLanes,ke===0&&(qa=null),P(Ee.stateNode),_e(u),h!==null)for(A=u.onRecoverableError,Ee=0;Ee<h.length;Ee++)ke=h[Ee],A(ke.value,{componentStack:ke.stack});return(oh&3)!==0&&No(),ke=u.pendingLanes,(M&4194218)!==0&&(ke&42)!==0?u===Nv?lh++:(lh=0,Nv=u):lh=0,ne(0),null}function Jb(u,h){(u.pooledCacheLanes&=h)===0&&(h=u.pooledCache,h!=null&&(u.pooledCache=null,Wu(h)))}function No(){if(jo!==null){var u=jo,h=Ov;Ov=0;var y=ee(oh),M=32>y?32:y;y=Mt.T;var A=Po();try{if(Zi(M),Mt.T=null,jo===null)var N=!1;else{M=Lv,Lv=null;var $=jo,ae=oh;if(jo=null,oh=0,(ln&6)!==0)throw Error(r(331));var Ee=ln;if(ln|=4,Pb($.current),Lb($,$.current,ae,M),ln=Ee,ne(0,!1),hr&&typeof hr.onPostCommitFiberRoot=="function")try{hr.onPostCommitFiberRoot(Qu,$)}catch{}N=!0}return N}finally{Zi(A),Mt.T=y,Jb(u,h)}}return!1}function Qb(u,h,y){h=H(y,h),h=ks(u.stateNode,h,2),u=He(u,h,2),u!==null&&(I(u,2),_e(u))}function sn(u,h,y){if(u.tag===3)Qb(u,u,y);else for(;h!==null;){if(h.tag===3){Qb(h,u,y);break}else if(h.tag===1){var M=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof M.componentDidCatch=="function"&&(qa===null||!qa.has(M))){u=H(y,u),y=jl(2),M=He(h,y,2),M!==null&&(bi(y,M,h,u),I(M,2),_e(M));break}}h=h.return}}function K0(u,h,y){var M=u.pingCache;if(M===null){M=u.pingCache=new BU;var A=new Set;M.set(h,A)}else A=M.get(h),A===void 0&&(A=new Set,M.set(h,A));A.has(y)||(Cv=!0,A.add(y),u=eD.bind(null,u,h,y),h.then(u,u))}function eD(u,h,y){var M=u.pingCache;M!==null&&M.delete(h),u.pingedLanes|=u.suspendedLanes&y,u.warmLanes&=~y,hn===u&&(Vt&y)===y&&(Ln===4||Ln===3&&(Vt&62914560)===Vt&&300>qr()-Uv?(ln&2)===0&&Zl(u,0):Rv|=y,gc===Vt&&(gc=0)),_e(u)}function $b(u,h){h===0&&(h=D()),u=Me(u,h),u!==null&&(I(u,h),_e(u))}function tD(u){var h=u.memoizedState,y=0;h!==null&&(y=h.retryLane),$b(u,y)}function nD(u,h){var y=0;switch(u.tag){case 13:var M=u.stateNode,A=u.memoizedState;A!==null&&(y=A.retryLane);break;case 19:M=u.stateNode;break;case 22:M=u.stateNode._retryCache;break;default:throw Error(r(314))}M!==null&&M.delete(h),$b(u,y)}function iD(u,h){return wd(u,h)}function rD(u,h,y,M){this.tag=u,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function J0(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Fa(u,h){var y=u.alternate;return y===null?(y=t(u.tag,h,u.key,u.mode),y.elementType=u.elementType,y.type=u.type,y.stateNode=u.stateNode,y.alternate=u,u.alternate=y):(y.pendingProps=h,y.type=u.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=u.flags&31457280,y.childLanes=u.childLanes,y.lanes=u.lanes,y.child=u.child,y.memoizedProps=u.memoizedProps,y.memoizedState=u.memoizedState,y.updateQueue=u.updateQueue,h=u.dependencies,y.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},y.sibling=u.sibling,y.index=u.index,y.ref=u.ref,y.refCleanup=u.refCleanup,y}function eS(u,h){u.flags&=31457282;var y=u.alternate;return y===null?(u.childLanes=0,u.lanes=h,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=y.childLanes,u.lanes=y.lanes,u.child=y.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=y.memoizedProps,u.memoizedState=y.memoizedState,u.updateQueue=y.updateQueue,u.type=y.type,h=y.dependencies,u.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext}),u}function _d(u,h,y,M,A,N){var $=0;if(M=u,typeof u=="function")J0(u)&&($=1);else if(typeof u=="string")$=Mr&&Mi?AS(u,y,mi.current)?26:IS(u)?27:5:Mr?AS(u,y,mi.current)?26:5:Mi&&IS(u)?27:5;else e:switch(u){case Ql:return Io(y.children,A,N,h);case oS:$=8,A|=24;break;case nv:return u=t(12,y,h,A|2),u.elementType=nv,u.lanes=N,u;case rv:return u=t(13,y,h,A),u.elementType=rv,u.lanes=N,u;case sv:return u=t(19,y,h,A),u.elementType=sv,u.lanes=N,u;case cS:return tS(y,A,N,h);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case lD:case Ba:$=10;break e;case lS:$=9;break e;case iv:$=11;break e;case av:$=14;break e;case ka:$=16,M=null;break e}$=29,y=Error(r(130,u===null?"null":typeof u,"")),M=null}return h=t($,y,h,A),h.elementType=u,h.type=M,h.lanes=N,h}function Io(u,h,y,M){return u=t(7,u,M,h),u.lanes=y,u}function tS(u,h,y,M){u=t(22,u,M,h),u.elementType=cS,u.lanes=y;var A={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var N=A._current;if(N===null)throw Error(r(456));if((A._pendingVisibility&2)===0){var $=Me(N,2);$!==null&&(A._pendingVisibility|=2,Ni($,N,2))}},attach:function(){var N=A._current;if(N===null)throw Error(r(456));if((A._pendingVisibility&2)!==0){var $=Me(N,2);$!==null&&(A._pendingVisibility&=-3,Ni($,N,2))}}};return u.stateNode=A,u}function Q0(u,h,y){return u=t(6,u,null,h),u.lanes=y,u}function $0(u,h,y){return h=t(4,u.children!==null?u.children:[],u.key,h),h.lanes=y,h.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},h}function sD(u,h,y,M,A,N,$,ae){this.tag=1,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=uv,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=R(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R(0),this.hiddenUpdates=R(null),this.identifierPrefix=M,this.onUncaughtError=A,this.onCaughtError=N,this.onRecoverableError=$,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ae,this.incompleteTransitions=new Map}function nS(u,h,y,M,A,N,$,ae,Ee,ke,Ye,ot){return u=new sD(u,h,y,$,ae,Ee,ke,ot),h=1,N===!0&&(h|=24),N=t(3,null,null,h),u.current=N,N.stateNode=u,h=U0(),h.refCount++,u.pooledCache=h,h.refCount++,N.memoizedState={element:M,isDehydrated:y,cache:h},je(N),u}function iS(u){return u?(u=tc,u):tc}function rS(u){var h=u._reactInternals;if(h===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=m(h),u=u!==null?v(u):null,u===null?null:Zu(u.stateNode)}function sS(u,h,y,M,A,N){A=iS(A),M.context===null?M.context=A:M.pendingContext=A,M=Ce(h),M.payload={element:y},N=N===void 0?null:N,N!==null&&(M.callback=N),y=He(u,M,h),y!==null&&(Ni(y,u,h),Ve(y,u,h))}function aS(u,h){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var y=u.retryLane;u.retryLane=y!==0&&y<h?y:h}}function ev(u,h){aS(u,h),(u=u.alternate)&&aS(u,h)}var Ft={},aD=Nx(),cr=N4(),tv=Object.assign,oD=Symbol.for("react.element"),xd=Symbol.for("react.transitional.element"),Jl=Symbol.for("react.portal"),Ql=Symbol.for("react.fragment"),oS=Symbol.for("react.strict_mode"),nv=Symbol.for("react.profiler"),lD=Symbol.for("react.provider"),lS=Symbol.for("react.consumer"),Ba=Symbol.for("react.context"),iv=Symbol.for("react.forward_ref"),rv=Symbol.for("react.suspense"),sv=Symbol.for("react.suspense_list"),av=Symbol.for("react.memo"),ka=Symbol.for("react.lazy"),cS=Symbol.for("react.offscreen"),cD=Symbol.for("react.memo_cache_sentinel"),uS=Symbol.iterator,uD=Symbol.for("react.client.reference"),Mt=aD.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ov,hS,lv=!1,bd=Array.isArray,hD=e.rendererVersion,fD=e.rendererPackageName,fS=e.extraDevToolsConfig,Zu=e.getPublicInstance,dD=e.getRootHostContext,pD=e.getChildHostContext,mD=e.prepareForCommit,gD=e.resetAfterCommit,vD=e.createInstance,cv=e.appendInitialChild,dS=e.finalizeInitialChildren,Sd=e.shouldSetTextContent,pS=e.createTextInstance,yD=e.scheduleTimeout,_D=e.cancelTimeout,uv=e.noTimeout,Xs=e.isPrimaryRenderer;e.warnsIfNotActing;var Ei=e.supportsMutation,Ga=e.supportsPersistence,Er=e.supportsHydration,mS=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var xD=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Zi=e.setCurrentUpdatePriority,Po=e.getCurrentUpdatePriority,bD=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var SD=e.shouldAttemptEagerTransition,ED=e.detachDeletedInstance;e.requestPostPaintCallback;var MD=e.maySuspendCommit,gS=e.preloadInstance,wD=e.startSuspendingCommit,vS=e.suspendInstance,TD=e.waitForCommitToBeReady,$l=e.NotPendingTransition,zo=e.HostTransitionContext,AD=e.resetFormInstance;e.bindToConsole;var CD=e.supportsMicrotasks,RD=e.scheduleMicrotask,Ku=e.supportsTestSelectors,DD=e.findFiberRoot,UD=e.getBoundingRect,OD=e.getTextContent,Ju=e.isHiddenSubtree,LD=e.matchAccessibilityRole,ND=e.setFocusIfFocusable,ID=e.setupIntersectionObserver,PD=e.appendChild,zD=e.appendChildToContainer,FD=e.commitTextUpdate,BD=e.commitMount,kD=e.commitUpdate,GD=e.insertBefore,HD=e.insertInContainerBefore,VD=e.removeChild,WD=e.removeChildFromContainer,yS=e.resetTextContent,XD=e.hideInstance,jD=e.hideTextInstance,qD=e.unhideInstance,YD=e.unhideTextInstance,ZD=e.clearContainer,KD=e.cloneInstance,_S=e.createContainerChildSet,xS=e.appendChildToContainerChildSet,JD=e.finalizeContainerChildren,bS=e.replaceContainerChildren,SS=e.cloneHiddenInstance,ES=e.cloneHiddenTextInstance,hv=e.isSuspenseInstancePending,fv=e.isSuspenseInstanceFallback,QD=e.getSuspenseInstanceFallbackErrorDetails,$D=e.registerSuspenseInstanceRetry,eU=e.canHydrateFormStateMarker,tU=e.isFormStateMarkerMatching,MS=e.getNextHydratableSibling,wS=e.getFirstHydratableChild,nU=e.getFirstHydratableChildWithinContainer,iU=e.getFirstHydratableChildWithinSuspenseInstance,rU=e.canHydrateInstance,sU=e.canHydrateTextInstance,aU=e.canHydrateSuspenseInstance,oU=e.hydrateInstance,lU=e.hydrateTextInstance,cU=e.hydrateSuspenseInstance,uU=e.getNextHydratableInstanceAfterSuspenseInstance,hU=e.commitHydratedContainer,fU=e.commitHydratedSuspenseInstance,dU=e.clearSuspenseBoundary,pU=e.clearSuspenseBoundaryFromContainer,TS=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var mU=e.validateHydratableInstance,gU=e.validateHydratableTextInstance,Mr=e.supportsResources,AS=e.isHostHoistableType,dv=e.getHoistableRoot,CS=e.getResource,RS=e.acquireResource,DS=e.releaseResource,vU=e.hydrateHoistable,US=e.mountHoistable,OS=e.unmountHoistable,yU=e.createHoistableInstance,_U=e.prepareToCommitHoistables,xU=e.mayResourceSuspendCommit,LS=e.preloadResource,bU=e.suspendResource,Mi=e.supportsSingletons,NS=e.resolveSingletonInstance,SU=e.clearSingleton,EU=e.acquireSingletonInstance,MU=e.releaseSingletonInstance,IS=e.isHostSingletonType,pv=[],ec=-1,tc={},ur=Math.clz32?Math.clz32:S,wU=Math.log,TU=Math.LN2,Ed=128,Md=4194304,wd=cr.unstable_scheduleCallback,mv=cr.unstable_cancelCallback,AU=cr.unstable_shouldYield,CU=cr.unstable_requestPaint,qr=cr.unstable_now,PS=cr.unstable_ImmediatePriority,RU=cr.unstable_UserBlockingPriority,gv=cr.unstable_NormalPriority,DU=cr.unstable_IdlePriority,UU=cr.log,OU=cr.unstable_setDisableYieldValue,Qu=null,hr=null,fr=typeof Object.is=="function"?Object.is:k,zS=new WeakMap,nc=[],ic=0,Td=null,Ad=0,wr=[],Tr=0,Fo=null,js=1,qs="",mi=_(null),$u=_(null),Ha=_(null),Cd=_(null),Ii=null,wi=null,jt=!1,Yr=null,ds=!1,vv=Error(r(519)),Ar=[],rc=0,yv=0,Rd=null,sc=null,_v=!1,Dd=!1,xv=!1,ac=0,eh=null,bv=0,oc=0,lc=null,Va=!1,Sv=!1,LU=Object.prototype.hasOwnProperty,th=Error(r(460)),Ev=Error(r(474)),Ud={then:function(){}},cc=null,uc=null,nh=0,Bo=tn(!0),FS=tn(!1),hc=_(null),Od=_(0),Cr=_(null),ps=null,ti=_(0),Wa=0,It=null,on=null,Xn=null,Ld=!1,fc=!1,ko=!1,Nd=0,ih=0,dc=null,NU=0,Mv=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},ms={readContext:Si,use:fe,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht};ms.useCacheRefresh=Ht,ms.useMemoCache=Ht,ms.useHostTransitionStatus=Ht,ms.useFormState=Ht,ms.useActionState=Ht,ms.useOptimistic=Ht;var Go={readContext:Si,use:fe,useCallback:function(u,h){return q().memoizedState=[u,h===void 0?null:h],u},useContext:Si,useEffect:Hl,useImperativeHandle:function(u,h,y){y=y!=null?y.concat([u]):null,Eo(4194308,4,Ps.bind(null,h,u),y)},useLayoutEffect:function(u,h){return Eo(4194308,4,u,h)},useInsertionEffect:function(u,h){Eo(4,2,u,h)},useMemo:function(u,h){var y=q();h=h===void 0?null:h;var M=u();if(ko){L(!0);try{u()}finally{L(!1)}}return y.memoizedState=[M,h],M},useReducer:function(u,h,y){var M=q();if(y!==void 0){var A=y(h);if(ko){L(!0);try{y(h)}finally{L(!1)}}}else A=h;return M.memoizedState=M.baseState=A,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:A},M.queue=u,u=u.dispatch=ud.bind(null,It,u),[M.memoizedState,u]},useRef:function(u){var h=q();return u={current:u},h.memoizedState=u},useState:function(u){u=Qt(u);var h=u.queue,y=Fu.bind(null,It,h);return h.dispatch=y,[u.memoizedState,y]},useDebugValue:Fs,useDeferredValue:function(u,h){var y=q();return To(y,u,h)},useTransition:function(){var u=Qt(!1);return u=Iu.bind(null,It,u.queue,!0,!1),q().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,h,y){var M=It,A=q();if(jt){if(y===void 0)throw Error(r(407));y=y()}else{if(y=h(),hn===null)throw Error(r(349));(Vt&60)!==0||_t(M,h,y)}A.memoizedState=y;var N={value:y,getSnapshot:h};return A.queue=N,Hl(Ot.bind(null,M,N,u),[u]),M.flags|=2048,Li(9,pt.bind(null,M,N,y,h),{destroy:void 0},null),y},useId:function(){var u=q(),h=hn.identifierPrefix;if(jt){var y=qs,M=js;y=(M&~(1<<32-ur(M)-1)).toString(32)+y,h=":"+h+"R"+y,y=Nd++,0<y&&(h+="H"+y.toString(32)),h+=":"}else y=NU++,h=":"+h+"r"+y.toString(32)+":";return u.memoizedState=h},useCacheRefresh:function(){return q().memoizedState=zu.bind(null,It)}};Go.useMemoCache=ye,Go.useHostTransitionStatus=Co,Go.useFormState=rn,Go.useActionState=rn,Go.useOptimistic=function(u){var h=q();h.memoizedState=h.baseState=u;var y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return h.queue=y,h=Wl.bind(null,It,!0,y),y.dispatch=h,[u,h]};var Xa={readContext:Si,use:fe,useCallback:Nu,useContext:Si,useEffect:Is,useImperativeHandle:zs,useInsertionEffect:Lu,useLayoutEffect:wo,useMemo:Ua,useReducer:Je,useRef:Xi,useState:function(){return Je(Xe)},useDebugValue:Fs,useDeferredValue:function(u,h){var y=de();return Vl(y,on.memoizedState,u,h)},useTransition:function(){var u=Je(Xe)[0],h=de().memoizedState;return[typeof u=="boolean"?u:we(u),h]},useSyncExternalStore:yt,useId:Pu};Xa.useCacheRefresh=ji,Xa.useMemoCache=ye,Xa.useHostTransitionStatus=Co,Xa.useFormState=Hn,Xa.useActionState=Hn,Xa.useOptimistic=function(u,h){var y=de();return Pt(y,on,u,h)};var Ho={readContext:Si,use:fe,useCallback:Nu,useContext:Si,useEffect:Is,useImperativeHandle:zs,useInsertionEffect:Lu,useLayoutEffect:wo,useMemo:Ua,useReducer:lt,useRef:Xi,useState:function(){return lt(Xe)},useDebugValue:Fs,useDeferredValue:function(u,h){var y=de();return on===null?To(y,u,h):Vl(y,on.memoizedState,u,h)},useTransition:function(){var u=lt(Xe)[0],h=de().memoizedState;return[typeof u=="boolean"?u:we(u),h]},useSyncExternalStore:yt,useId:Pu};Ho.useCacheRefresh=ji,Ho.useMemoCache=ye,Ho.useHostTransitionStatus=Co,Ho.useFormState=Rn,Ho.useActionState=Rn,Ho.useOptimistic=function(u,h){var y=de();return on!==null?Pt(y,on,u,h):(y.baseState=u,[u,y.queue.dispatch])};var wv={isMounted:function(u){return(u=u._reactInternals)?d(u)===u:!1},enqueueSetState:function(u,h,y){u=u._reactInternals;var M=lr(),A=Ce(M);A.payload=h,y!=null&&(A.callback=y),h=He(u,A,M),h!==null&&(Ni(h,u,M),Ve(h,u,M))},enqueueReplaceState:function(u,h,y){u=u._reactInternals;var M=lr(),A=Ce(M);A.tag=1,A.payload=h,y!=null&&(A.callback=y),h=He(u,A,M),h!==null&&(Ni(h,u,M),Ve(h,u,M))},enqueueForceUpdate:function(u,h){u=u._reactInternals;var y=lr(),M=Ce(y);M.tag=2,h!=null&&(M.callback=h),h=He(u,M,y),h!==null&&(Ni(h,u,y),Ve(h,u,y))}},BS=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var h=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(h))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},kS=Error(r(461)),ci=!1,Tv={dehydrated:null,treeContext:null,retryLane:0},Id=_(null),Vo=null,Ys=null,IU=typeof AbortController<"u"?AbortController:function(){var u=[],h=this.signal={aborted:!1,addEventListener:function(y,M){u.push(M)}};this.abort=function(){h.aborted=!0,u.forEach(function(y){return y()})}},PU=cr.unstable_scheduleCallback,zU=cr.unstable_NormalPriority,Un={$$typeof:Ba,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},GS=Mt.S;Mt.S=function(u,h){typeof h=="object"&&h!==null&&typeof h.then=="function"&&me(u,h),GS!==null&&GS(u,h)};var Wo=_(null),Zs=!1,On=!1,Av=!1,HS=typeof WeakSet=="function"?WeakSet:Set,ui=null,VS=!1,jn=null,dr=!1,Zr=null,pc=8192,FU={getCacheForType:function(u){var h=Si(Un),y=h.data.get(u);return y===void 0&&(y=u(),h.data.set(u,y)),y}},Pd=0,zd=1,Fd=2,Bd=3,kd=4;if(typeof Symbol=="function"&&Symbol.for){var rh=Symbol.for;Pd=rh("selector.component"),zd=rh("selector.has_pseudo_class"),Fd=rh("selector.role"),Bd=rh("selector.test_id"),kd=rh("selector.text")}var BU=typeof WeakMap=="function"?WeakMap:Map,ln=0,hn=null,Bt=null,Vt=0,fn=0,pr=null,Ks=!1,mc=!1,Cv=!1,Js=0,Ln=0,ja=0,Xo=0,Rv=0,Rr=0,gc=0,sh=null,gs=null,Dv=!1,Uv=0,ah=1/0,Gd=null,qa=null,Hd=!1,jo=null,oh=0,Ov=0,Lv=null,lh=0,Nv=null;return Ft.attemptContinuousHydration=function(u){if(u.tag===13){var h=Me(u,67108864);h!==null&&Ni(h,u,67108864),ev(u,67108864)}},Ft.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var h=lr(),y=Me(u,h);y!==null&&Ni(y,u,h),ev(u,h)}},Ft.attemptSynchronousHydration=function(u){switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var h=E(u.pendingLanes);if(h!==0){for(u.pendingLanes|=2,u.entangledLanes|=2;h;){var y=1<<31-ur(h);u.entanglements[1]|=y,h&=~y}_e(u),(ln&6)===0&&(ah=qr()+500,ne(0))}}break;case 13:h=Me(u,2),h!==null&&Ni(h,u,2),Hb(),ev(u,2)}},Ft.batchedUpdates=function(u,h){return u(h)},Ft.createComponentSelector=function(u){return{$$typeof:Pd,value:u}},Ft.createContainer=function(u,h,y,M,A,N,$,ae,Ee,ke){return nS(u,h,!1,null,y,M,N,$,ae,Ee,ke,null)},Ft.createHasPseudoClassSelector=function(u){return{$$typeof:zd,value:u}},Ft.createHydrationContainer=function(u,h,y,M,A,N,$,ae,Ee,ke,Ye,ot,ht){return u=nS(y,M,!0,u,A,N,ae,Ee,ke,Ye,ot,ht),u.context=iS(null),y=u.current,M=lr(),A=Ce(M),A.callback=h??null,He(y,A,M),u.current.lanes=M,I(u,M),_e(u),u},Ft.createPortal=function(u,h,y){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jl,key:M==null?null:""+M,children:u,containerInfo:h,implementation:y}},Ft.createRoleSelector=function(u){return{$$typeof:Fd,value:u}},Ft.createTestNameSelector=function(u){return{$$typeof:Bd,value:u}},Ft.createTextSelector=function(u){return{$$typeof:kd,value:u}},Ft.defaultOnCaughtError=function(u){console.error(u)},Ft.defaultOnRecoverableError=function(u){BS(u)},Ft.defaultOnUncaughtError=function(u){BS(u)},Ft.deferredUpdates=function(u){var h=Mt.T,y=Po();try{return Zi(32),Mt.T=null,u()}finally{Zi(y),Mt.T=h}},Ft.discreteUpdates=function(u,h,y,M,A){var N=Mt.T,$=Po();try{return Zi(2),Mt.T=null,u(h,y,M,A)}finally{Zi($),Mt.T=N,ln===0&&(ah=qr()+500)}},Ft.findAllNodes=X0,Ft.findBoundingRects=function(u,h){if(!Ku)throw Error(r(363));h=X0(u,h),u=[];for(var y=0;y<h.length;y++)u.push(UD(h[y]));for(h=u.length-1;0<h;h--){y=u[h];for(var M=y.x,A=M+y.width,N=y.y,$=N+y.height,ae=h-1;0<=ae;ae--)if(h!==ae){var Ee=u[ae],ke=Ee.x,Ye=ke+Ee.width,ot=Ee.y,ht=ot+Ee.height;if(M>=ke&&N>=ot&&A<=Ye&&$<=ht){u.splice(h,1);break}else if(M!==ke||y.width!==Ee.width||ht<N||ot>$){if(!(N!==ot||y.height!==Ee.height||Ye<M||ke>A)){ke>M&&(Ee.width+=ke-M,Ee.x=M),Ye<A&&(Ee.width=A-ke),u.splice(h,1);break}}else{ot>N&&(Ee.height+=ot-N,Ee.y=N),ht<$&&(Ee.height=$-ot),u.splice(h,1);break}}}return u},Ft.findHostInstance=rS,Ft.findHostInstanceWithNoPortals=function(u){return u=m(u),u=u!==null?x(u):null,u===null?null:Zu(u.stateNode)},Ft.findHostInstanceWithWarning=function(u){return rS(u)},Ft.flushPassiveEffects=No,Ft.flushSyncFromReconciler=function(u){var h=ln;ln|=1;var y=Mt.T,M=Po();try{if(Zi(2),Mt.T=null,u)return u()}finally{Zi(M),Mt.T=y,ln=h,(ln&6)===0&&ne(0)}},Ft.flushSyncWork=Hb,Ft.focusWithin=function(u,h){if(!Ku)throw Error(r(363));for(u=H0(u),h=Fb(u,h),h=Array.from(h),u=0;u<h.length;){var y=h[u++],M=y.tag;if(!Ju(y)){if((M===5||M===26||M===27)&&ND(y.stateNode))return!0;for(y=y.child;y!==null;)h.push(y),y=y.sibling}}return!1},Ft.getFindAllNodesFailureDescription=function(u,h){if(!Ku)throw Error(r(363));var y=0,M=[];u=[H0(u),0];for(var A=0;A<u.length;){var N=u[A++],$=N.tag,ae=u[A++],Ee=h[ae];if(($!==5&&$!==26&&$!==27||!Ju(N))&&(V0(N,Ee)&&(M.push(W0(Ee)),ae++,ae>y&&(y=ae)),ae<h.length))for(N=N.child;N!==null;)u.push(N,ae),N=N.sibling}if(y<h.length){for(u=[];y<h.length;y++)u.push(W0(h[y]));return`findAllNodes was able to match part of the selector:
3875
3875
  `+(M.join(" > ")+`
3876
3876
 
3877
3877
  No matching component was found for:
3878
- `)+u.join(" > ")}return null},Ft.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 27:case 5:return Zu(u.child.stateNode);default:return u.child.stateNode}},Ft.injectIntoDevTools=function(){var u={bundleType:0,version:fD,rendererPackageName:dD,currentDispatcherRef:Mt,findFiberByHostInstance:mS,reconcilerVersion:"19.0.0"};if(fS!==null&&(u.rendererConfig=fS),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)u=!0;else{try{Qu=h.inject(u),hr=h}catch{}u=!!h.checkDCE}}return u},Ft.isAlreadyRendering=function(){return!1},Ft.observeVisibleRects=function(u,h,y,M){if(!Ku)throw Error(r(363));u=X0(u,h);var A=PD(u,y,M).disconnect;return{disconnect:function(){A()}}},Ft.shouldError=function(){return null},Ft.shouldSuspend=function(){return!1},Ft.startHostTransition=function(u,h,y,M){if(u.tag!==5)throw Error(r(476));var A=Ao(u).queue;Iu(u,A,h,$l,y===null?n:function(){var N=Ao(u).next.queue;return Bs(u,N,{},lr()),y(M)})},Ft.updateContainer=function(u,h,y,M){var A=h.current,N=lr();return sS(A,N,u,h,y,M),N},Ft.updateContainerSync=function(u,h,y,M){return h.tag===0&&No(),sS(h.current,2,u,h,y,M),2},Ft},i.exports.default=i.exports,Object.defineProperty(i.exports,"__esModule",{value:!0})}(Uy)),Uy.exports}var zM;function P4(){return zM||(zM=1,Dy.exports=I4()),Dy.exports}var z4=P4();const F4=vo(z4);var Ny={exports:{}},Iy={};/**
3878
+ `)+u.join(" > ")}return null},Ft.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 27:case 5:return Zu(u.child.stateNode);default:return u.child.stateNode}},Ft.injectIntoDevTools=function(){var u={bundleType:0,version:hD,rendererPackageName:fD,currentDispatcherRef:Mt,findFiberByHostInstance:mS,reconcilerVersion:"19.0.0"};if(fS!==null&&(u.rendererConfig=fS),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)u=!0;else{try{Qu=h.inject(u),hr=h}catch{}u=!!h.checkDCE}}return u},Ft.isAlreadyRendering=function(){return!1},Ft.observeVisibleRects=function(u,h,y,M){if(!Ku)throw Error(r(363));u=X0(u,h);var A=ID(u,y,M).disconnect;return{disconnect:function(){A()}}},Ft.shouldError=function(){return null},Ft.shouldSuspend=function(){return!1},Ft.startHostTransition=function(u,h,y,M){if(u.tag!==5)throw Error(r(476));var A=Ao(u).queue;Iu(u,A,h,$l,y===null?n:function(){var N=Ao(u).next.queue;return Bs(u,N,{},lr()),y(M)})},Ft.updateContainer=function(u,h,y,M){var A=h.current,N=lr();return sS(A,N,u,h,y,M),N},Ft.updateContainerSync=function(u,h,y,M){return h.tag===0&&No(),sS(h.current,2,u,h,y,M),2},Ft},i.exports.default=i.exports,Object.defineProperty(i.exports,"__esModule",{value:!0})}(Uy)),Uy.exports}var PM;function P4(){return PM||(PM=1,Dy.exports=I4()),Dy.exports}var z4=P4();const F4=vo(z4);var Ny={exports:{}},Iy={};/**
3879
3879
  * @license React
3880
3880
  * scheduler.production.js
3881
3881
  *
@@ -3883,7 +3883,7 @@ No matching component was found for:
3883
3883
  *
3884
3884
  * This source code is licensed under the MIT license found in the
3885
3885
  * LICENSE file in the root directory of this source tree.
3886
- */var FM;function B4(){return FM||(FM=1,function(i){function e(P,L){var k=P.length;P.push(L);e:for(;0<k;){var H=k-1>>>1,W=P[H];if(0<r(W,L))P[H]=L,P[k]=W,k=H;else break e}}function t(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var L=P[0],k=P.pop();if(k!==L){P[0]=k;e:for(var H=0,W=P.length,F=W>>>1;H<F;){var Y=2*(H+1)-1,K=P[Y],j=Y+1,J=P[j];if(0>r(K,k))j<W&&0>r(J,K)?(P[H]=J,P[j]=k,H=j):(P[H]=K,P[Y]=k,H=Y);else if(j<W&&0>r(J,k))P[H]=J,P[j]=k,H=j;else break e}}return L}function r(P,L){var k=P.sortIndex-L.sortIndex;return k!==0?k:P.id-L.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();i.unstable_now=function(){return a.now()-o}}var l=[],c=[],f=1,d=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function S(P){for(var L=t(c);L!==null;){if(L.callback===null)n(c);else if(L.startTime<=P)n(c),L.sortIndex=L.expirationTime,e(l,L);else break;L=t(c)}}function E(P){if(x=!1,S(P),!v)if(t(l)!==null)v=!0,V();else{var L=t(c);L!==null&&ee(E,L.startTime-P)}}var w=!1,T=-1,C=5,U=-1;function D(){return!(i.unstable_now()-U<C)}function R(){if(w){var P=i.unstable_now();U=P;var L=!0;try{e:{v=!1,x&&(x=!1,g(T),T=-1),m=!0;var k=p;try{t:{for(S(P),d=t(l);d!==null&&!(d.expirationTime>P&&D());){var H=d.callback;if(typeof H=="function"){d.callback=null,p=d.priorityLevel;var W=H(d.expirationTime<=P);if(P=i.unstable_now(),typeof W=="function"){d.callback=W,S(P),L=!0;break t}d===t(l)&&n(l),S(P)}else n(l);d=t(l)}if(d!==null)L=!0;else{var F=t(c);F!==null&&ee(E,F.startTime-P),L=!1}}break e}finally{d=null,p=k,m=!1}L=void 0}}finally{L?I():w=!1}}}var I;if(typeof b=="function")I=function(){b(R)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,O=z.port2;z.port1.onmessage=R,I=function(){O.postMessage(null)}}else I=function(){_(R,0)};function V(){w||(w=!0,I())}function ee(P,L){T=_(function(){P(i.unstable_now())},L)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(P){P.callback=null},i.unstable_continueExecution=function(){v||m||(v=!0,V())},i.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<P?Math.floor(1e3/P):5},i.unstable_getCurrentPriorityLevel=function(){return p},i.unstable_getFirstCallbackNode=function(){return t(l)},i.unstable_next=function(P){switch(p){case 1:case 2:case 3:var L=3;break;default:L=p}var k=p;p=L;try{return P()}finally{p=k}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(P,L){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var k=p;p=P;try{return L()}finally{p=k}},i.unstable_scheduleCallback=function(P,L,k){var H=i.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?H+k:H):k=H,P){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=k+W,P={id:f++,callback:L,priorityLevel:P,startTime:k,expirationTime:W,sortIndex:-1},k>H?(P.sortIndex=k,e(c,P),t(l)===null&&P===t(c)&&(x?(g(T),T=-1):x=!0,ee(E,k-H))):(P.sortIndex=W,e(l,P),v||m||(v=!0,V())),P},i.unstable_shouldYield=D,i.unstable_wrapCallback=function(P){var L=p;return function(){var k=p;p=L;try{return P.apply(this,arguments)}finally{p=k}}}}(Iy)),Iy}var BM;function k4(){return BM||(BM=1,Ny.exports=B4()),Ny.exports}var kM=k4();const G4=i=>typeof i=="object"&&typeof i.then=="function",Np=[];function H4(i,e,t=(n,r)=>n===r){if(i===e)return!0;if(!i||!e)return!1;const n=i.length;if(e.length!==n)return!1;for(let r=0;r<n;r++)if(!t(i[r],e[r]))return!1;return!0}function V4(i,e=null,t=!1,n={}){e===null&&(e=[i]);for(const s of Np)if(H4(e,s.keys,s.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(s,"error"))throw s.error;if(Object.prototype.hasOwnProperty.call(s,"response"))return n.lifespan&&n.lifespan>0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,n.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:n.equal,remove:()=>{const s=Np.indexOf(r);s!==-1&&Np.splice(s,1)},promise:(G4(i)?i:i(...e)).then(s=>{r.response=s,n.lifespan&&n.lifespan>0&&(r.timeout=setTimeout(r.remove,n.lifespan))}).catch(s=>r.error=s)};if(Np.push(r),!t)throw r.promise}const W4=(i,e,t)=>V4(i,e,!1,t);function E1(i,e,t){if(!i)return;if(t(i)===!0)return i;let n=e?i.return:i.child;for(;n;){const r=E1(n,e,t);if(r)return r;n=e?null:n.sibling}}function EC(i){try{return Object.defineProperties(i,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return i}}const M1=EC(Z.createContext(null));let MC=class extends Z.Component{render(){return Z.createElement(M1.Provider,{value:this._reactInternals},this.props.children)}};function wC(){const i=Z.useContext(M1);if(i===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=Z.useId();return Z.useMemo(()=>{for(const t of[i,i?.alternate]){if(!t)continue;const n=E1(t,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(n)return n}},[i,e])}const X4=Symbol.for("react.context"),j4=i=>i!==null&&typeof i=="object"&&"$$typeof"in i&&i.$$typeof===X4;function q4(){const i=wC(),[e]=Z.useState(()=>new Map);e.clear();let t=i;for(;t;){const n=t.type;j4(n)&&n!==M1&&!e.has(n)&&e.set(n,Z.use(EC(n))),t=t.return}return e}function Y4(){const i=q4();return Z.useMemo(()=>Array.from(i.keys()).reduce((e,t)=>n=>Z.createElement(e,null,Z.createElement(t.Provider,{...n,value:i.get(t)})),e=>Z.createElement(MC,{...e})),[i])}function TC(i){let e=i.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const AC=i=>i&&i.isOrthographicCamera,Z4=i=>i&&i.hasOwnProperty("current"),K4=i=>i!=null&&(typeof i=="string"||typeof i=="number"||i.isColor),nd=((i,e)=>typeof window<"u"&&(((i=window.document)==null?void 0:i.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?Z.useLayoutEffect:Z.useEffect;function CC(i){const e=Z.useRef(i);return nd(()=>void(e.current=i),[i]),e}function J4(){const i=wC(),e=Y4();return Z.useMemo(()=>({children:t})=>{const r=!!E1(i,!0,s=>s.type===Z.StrictMode)?Z.StrictMode:Z.Fragment;return ue.jsx(r,{children:ue.jsx(e,{children:t})})},[i,e])}function Q4({set:i}){return nd(()=>(i(new Promise(()=>null)),()=>i(!1)),[i]),null}const $4=(i=>(i=class extends Z.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},i.getDerivedStateFromError=()=>({error:!0}),i))();function RC(i){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(i)?Math.min(Math.max(i[0],t),i[1]):i}function Ic(i){var e;return(e=i.__r3f)==null?void 0:e.root.getState()}const En={obj:i=>i===Object(i)&&!En.arr(i)&&typeof i!="function",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",boo:i=>typeof i=="boolean",und:i=>i===void 0,nul:i=>i===null,arr:i=>Array.isArray(i),equ(i,e,{arrays:t="shallow",objects:n="reference",strict:r=!0}={}){if(typeof i!=typeof e||!!i!=!!e)return!1;if(En.str(i)||En.num(i)||En.boo(i))return i===e;const s=En.obj(i);if(s&&n==="reference")return i===e;const a=En.arr(i);if(a&&t==="reference")return i===e;if((a||s)&&i===e)return!0;let o;for(o in i)if(!(o in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(o in r?e:i)if(!En.equ(i[o],e[o],{strict:r,objects:"reference"}))return!1}else for(o in r?e:i)if(i[o]!==e[o])return!1;if(En.und(o)){if(a&&i.length===0&&e.length===0||s&&Object.keys(i).length===0&&Object.keys(e).length===0)return!0;if(i!==e)return!1}return!0}};function e5(i){i.type!=="Scene"&&(i.dispose==null||i.dispose());for(const e in i){const t=i[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const DC=["children","key","ref"];function t5(i){const e={};for(const t in i)DC.includes(t)||(e[t]=i[t]);return e}function ng(i,e,t,n){const r=i;let s=r?.__r3f;return s||(s={root:e,type:t,parent:null,children:[],props:t5(n),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=s)),s}function Nf(i,e){let t=i[e];if(!e.includes("-"))return{root:i,key:e,target:t};t=i;for(const r of e.split("-")){var n;e=r,i=t,t=(n=t)==null?void 0:n[e]}return{root:i,key:e,target:t}}const GM=/-\d+$/;function ig(i,e){if(En.str(e.props.attach)){if(GM.test(e.props.attach)){const r=e.props.attach.replace(GM,""),{root:s,key:a}=Nf(i.object,r);Array.isArray(s[a])||(s[a]=[])}const{root:t,key:n}=Nf(i.object,e.props.attach);e.previousAttach=t[n],t[n]=e.object}else En.fun(e.props.attach)&&(e.previousAttach=e.props.attach(i.object,e.object))}function rg(i,e){if(En.str(e.props.attach)){const{root:t,key:n}=Nf(i.object,e.props.attach),r=e.previousAttach;r===void 0?delete t[n]:t[n]=r}else e.previousAttach==null||e.previousAttach(i.object,e.object);delete e.previousAttach}const tx=[...DC,"args","dispose","attach","object","onUpdate","dispose"],HM=new Map;function n5(i){let e=HM.get(i.constructor);try{e||(e=new i.constructor,HM.set(i.constructor,e))}catch{}return e}function i5(i,e){const t={};for(const n in e)if(!tx.includes(n)&&!En.equ(e[n],i.props[n])){t[n]=e[n];for(const r in e)r.startsWith(`${n}-`)&&(t[r]=e[r])}for(const n in i.props){if(tx.includes(n)||e.hasOwnProperty(n))continue;const{root:r,key:s}=Nf(i.object,n);if(r.constructor&&r.constructor.length===0){const a=n5(r);En.und(a)||(t[s]=a[s])}else t[s]=0}return t}const r5=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],s5=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function da(i,e){var t;const n=i.__r3f,r=n&&TC(n).getState(),s=n?.eventCount;for(const o in e){let l=e[o];if(tx.includes(o))continue;if(n&&s5.test(o)){typeof l=="function"?n.handlers[o]=l:delete n.handlers[o],n.eventCount=Object.keys(n.handlers).length;continue}if(l===void 0)continue;let{root:c,key:f,target:d}=Nf(i,o);if(d instanceof fu&&l instanceof fu)d.mask=l.mask;else if(d instanceof $e&&K4(l))d.set(l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof d.copy=="function"&&l!=null&&l.constructor&&d.constructor===l.constructor)d.copy(l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&Array.isArray(l))typeof d.fromArray=="function"?d.fromArray(l):d.set(...l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof l=="number")typeof d.setScalar=="function"?d.setScalar(l):d.set(l);else{var a;c[f]=l,r&&!r.linear&&r5.includes(f)&&(a=c[f])!=null&&a.isTexture&&c[f].format===Di&&c[f].type===Hr&&(c[f].colorSpace=Ri)}}if(n!=null&&n.parent&&r!=null&&r.internal&&(t=n.object)!=null&&t.isObject3D&&s!==n.eventCount){const o=n.object,l=r.internal.interaction.indexOf(o);l>-1&&r.internal.interaction.splice(l,1),n.eventCount&&o.raycast!==null&&r.internal.interaction.push(o)}return n&&n.props.attach===void 0&&(n.object.isBufferGeometry?n.props.attach="geometry":n.object.isMaterial&&(n.props.attach="material")),n&&Au(n),i}function Au(i){var e;if(!i.parent)return;i.props.onUpdate==null||i.props.onUpdate(i.object);const t=(e=i.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function a5(i,e){i.manual||(AC(i)?(i.left=e.width/-2,i.right=e.width/2,i.top=e.height/2,i.bottom=e.height/-2):i.aspect=e.width/e.height,i.updateProjectionMatrix())}const $i=i=>i?.isObject3D;function Ip(i){return(i.eventObject||i.object).uuid+"/"+i.index+i.instanceId}function UC(i,e,t,n){const r=t.get(e);r&&(t.delete(e),t.size===0&&(i.delete(n),r.target.releasePointerCapture(n)))}function o5(i,e){const{internal:t}=i.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,r)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((n,r)=>{UC(t.capturedMap,e,n,r)})}function l5(i){function e(l){const{internal:c}=i.getState(),f=l.offsetX-c.initialClick[0],d=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(f*f+d*d))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(f=>{var d;return(d=c.__r3f)==null?void 0:d.handlers["onPointer"+f]}))}function n(l,c){const f=i.getState(),d=new Set,p=[],m=c?c(f.internal.interaction):f.internal.interaction;for(let g=0;g<m.length;g++){const b=Ic(m[g]);b&&(b.raycaster.camera=void 0)}f.previousRoot||f.events.compute==null||f.events.compute(l,f);function v(g){const b=Ic(g);if(!b||!b.events.enabled||b.raycaster.camera===null)return[];if(b.raycaster.camera===void 0){var S;b.events.compute==null||b.events.compute(l,b,(S=b.previousRoot)==null?void 0:S.getState()),b.raycaster.camera===void 0&&(b.raycaster.camera=null)}return b.raycaster.camera?b.raycaster.intersectObject(g,!0):[]}let x=m.flatMap(v).sort((g,b)=>{const S=Ic(g.object),E=Ic(b.object);return!S||!E?g.distance-b.distance:E.events.priority-S.events.priority||g.distance-b.distance}).filter(g=>{const b=Ip(g);return d.has(b)?!1:(d.add(b),!0)});f.events.filter&&(x=f.events.filter(x,f));for(const g of x){let b=g.object;for(;b;){var _;(_=b.__r3f)!=null&&_.eventCount&&p.push({...g,eventObject:b}),b=b.parent}}if("pointerId"in l&&f.internal.capturedMap.has(l.pointerId))for(let g of f.internal.capturedMap.get(l.pointerId).values())d.has(Ip(g.intersection))||p.push(g.intersection);return p}function r(l,c,f,d){if(l.length){const p={stopped:!1};for(const m of l){let v=Ic(m.object);if(v||m.object.traverseAncestors(x=>{const _=Ic(x);if(_)return v=_,!1}),v){const{raycaster:x,pointer:_,camera:g,internal:b}=v,S=new Q(_.x,_.y,0).unproject(g),E=D=>{var R,I;return(R=(I=b.capturedMap.get(D))==null?void 0:I.has(m.eventObject))!=null?R:!1},w=D=>{const R={intersection:m,target:c.target};b.capturedMap.has(D)?b.capturedMap.get(D).set(m.eventObject,R):b.capturedMap.set(D,new Map([[m.eventObject,R]])),c.target.setPointerCapture(D)},T=D=>{const R=b.capturedMap.get(D);R&&UC(b.capturedMap,m.eventObject,R,D)};let C={};for(let D in c){let R=c[D];typeof R!="function"&&(C[D]=R)}let U={...m,...C,pointer:_,intersections:l,stopped:p.stopped,delta:f,unprojectedPoint:S,ray:x.ray,camera:g,stopPropagation(){const D="pointerId"in c&&b.capturedMap.get(c.pointerId);if((!D||D.has(m.eventObject))&&(U.stopped=p.stopped=!0,b.hovered.size&&Array.from(b.hovered.values()).find(R=>R.eventObject===m.eventObject))){const R=l.slice(0,l.indexOf(m));s([...R,m])}},target:{hasPointerCapture:E,setPointerCapture:w,releasePointerCapture:T},currentTarget:{hasPointerCapture:E,setPointerCapture:w,releasePointerCapture:T},nativeEvent:c};if(d(U),p.stopped===!0)break}}}return l}function s(l){const{internal:c}=i.getState();for(const f of c.hovered.values())if(!l.length||!l.find(d=>d.object===f.object&&d.index===f.index&&d.instanceId===f.instanceId)){const p=f.eventObject.__r3f;if(c.hovered.delete(Ip(f)),p!=null&&p.eventCount){const m=p.handlers,v={...f,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function a(l,c){for(let f=0;f<c.length;f++){const d=c[f].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(l)}}function o(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return c=>{const{internal:f}=i.getState();"pointerId"in c&&f.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(c.pointerId)&&(f.capturedMap.delete(c.pointerId),s([]))})}}return function(f){const{onPointerMissed:d,internal:p}=i.getState();p.lastEvent.current=f;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=n(f,m?t:void 0),g=v?e(f):0;l==="onPointerDown"&&(p.initialClick=[f.offsetX,f.offsetY],p.initialHits=_.map(S=>S.eventObject)),v&&!_.length&&g<=2&&(a(f,p.interaction),d&&d(f)),m&&s(_);function b(S){const E=S.eventObject,w=E.__r3f;if(!(w!=null&&w.eventCount))return;const T=w.handlers;if(m){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const C=Ip(S),U=p.hovered.get(C);U?U.stopped&&S.stopPropagation():(p.hovered.set(C,S),T.onPointerOver==null||T.onPointerOver(S),T.onPointerEnter==null||T.onPointerEnter(S))}T.onPointerMove==null||T.onPointerMove(S)}else{const C=T[l];C?(!v||p.initialHits.includes(E))&&(a(f,p.interaction.filter(U=>!p.initialHits.includes(U))),C(S)):v&&p.initialHits.includes(E)&&a(f,p.interaction.filter(U=>!p.initialHits.includes(U)))}}r(_,f,g,b)}}return{handlePointer:o}}const VM=i=>!!(i!=null&&i.render),OC=Z.createContext(null),c5=(i,e)=>{const t=O4((o,l)=>{const c=new Q,f=new Q,d=new Q;function p(g=l().camera,b=f,S=l().size){const{width:E,height:w,top:T,left:C}=S,U=E/w;b.isVector3?d.copy(b):d.set(...b);const D=g.getWorldPosition(c).distanceTo(d);if(AC(g))return{width:E/g.zoom,height:w/g.zoom,top:T,left:C,factor:1,distance:D,aspect:U};{const R=g.fov*Math.PI/180,I=2*Math.tan(R/2)*D,z=I*(E/w);return{width:z,height:I,top:T,left:C,factor:E/z,distance:D,aspect:U}}}let m;const v=g=>o(b=>({performance:{...b.performance,current:g}})),x=new Ge;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(g=1)=>i(l(),g),advance:(g,b)=>e(g,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new g1,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>o(b=>({...b,events:{...b.events,...g}})),setSize:(g,b,S=0,E=0)=>{const w=l().camera,T={width:g,height:b,top:S,left:E};o(C=>({size:T,viewport:{...C.viewport,...p(w,f,T)}}))},setDpr:g=>o(b=>{const S=RC(g);return{viewport:{...b.viewport,dpr:S,initialDpr:b.viewport.initialDpr||S}}}),setFrameloop:(g="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,g!=="never"&&(b.start(),b.elapsedTime=0),o(()=>({frameloop:g}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:Z.createRef(),active:!1,frames:0,priority:0,subscribe:(g,b,S)=>{const E=l().internal;return E.priority=E.priority+(b>0?1:0),E.subscribers.push({ref:g,priority:b,store:S}),E.subscribers=E.subscribers.sort((w,T)=>w.priority-T.priority),()=>{const w=l().internal;w!=null&&w.subscribers&&(w.priority=w.priority-(b>0?1:0),w.subscribers=w.subscribers.filter(T=>T.ref!==g))}}}}}),n=t.getState();let r=n.size,s=n.viewport.dpr,a=n.camera;return t.subscribe(()=>{const{camera:o,size:l,viewport:c,gl:f,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){r=l,s=c.dpr,a5(o,l),c.dpr>0&&f.setPixelRatio(c.dpr);const p=typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(l.width,l.height,p)}o!==a&&(a=o,d(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(o)}})))}),t.subscribe(o=>i(o)),t};function LC(){const i=Z.useContext(OC);if(!i)throw new Error("R3F: Hooks can only be used within the Canvas component!");return i}function Jn(i=t=>t,e){return LC()(i,e)}function s0(i,e=0){const t=LC(),n=t.getState().internal.subscribe,r=CC(i);return nd(()=>n(r,e,t),[e,n,t]),null}function u5(i){const e=F4(i);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Z.version}),e}const NC=0,mu={},h5=/^three(?=[A-Z])/,a0=i=>`${i[0].toUpperCase()}${i.slice(1)}`;let f5=0;const d5=i=>typeof i=="function";function IC(i){if(d5(i)){const e=`${f5++}`;return mu[e]=i,e}else Object.assign(mu,i)}function PC(i,e){const t=a0(i),n=mu[t];if(i!=="primitive"&&!n)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(i==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function p5(i,e,t){var n;return i=a0(i)in mu?i:i.replace(h5,""),PC(i,e),i==="primitive"&&(n=e.object)!=null&&n.__r3f&&delete e.object.__r3f,ng(e.object,t,i,e)}function m5(i){if(!i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?rg(i.parent,i):$i(i.object)&&(i.object.visible=!1),i.isHidden=!0,Au(i)}}function zC(i){if(i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?ig(i.parent,i):$i(i.object)&&i.props.visible!==!1&&(i.object.visible=!0),i.isHidden=!1,Au(i)}}function w1(i,e,t){const n=e.root.getState();if(!(!i.parent&&i.object!==n.scene)){if(!e.object){var r,s;const a=mu[a0(e.type)];e.object=(r=e.props.object)!=null?r:new a(...(s=e.props.args)!=null?s:[]),e.object.__r3f=e}if(da(e.object,e.props),e.props.attach)ig(i,e);else if($i(e.object)&&$i(i.object)){const a=i.object.children.indexOf(t?.object);if(t&&a!==-1){const o=i.object.children.indexOf(e.object);if(o!==-1){i.object.children.splice(o,1);const l=o<a?a-1:a;i.object.children.splice(l,0,e.object)}else e.object.parent=i.object,i.object.children.splice(a,0,e.object),e.object.dispatchEvent({type:"added"}),i.object.dispatchEvent({type:"childadded",child:e.object})}else i.object.add(e.object)}for(const a of e.children)w1(e,a);Au(e)}}function Py(i,e){e&&(e.parent=i,i.children.push(e),w1(i,e))}function WM(i,e,t){if(!e||!t)return;e.parent=i;const n=i.children.indexOf(t);n!==-1?i.children.splice(n,0,e):i.children.push(e),w1(i,e,t)}function FC(i){if(typeof i.dispose=="function"){const e=()=>{try{i.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():kM.unstable_scheduleCallback(kM.unstable_IdlePriority,e)}}function nx(i,e,t){if(!e)return;e.parent=null;const n=i.children.indexOf(e);n!==-1&&i.children.splice(n,1),e.props.attach?rg(i,e):$i(e.object)&&$i(i.object)&&(i.object.remove(e.object),o5(TC(e),e.object));const r=e.props.dispose!==null&&t!==!1;for(let s=e.children.length-1;s>=0;s--){const a=e.children[s];nx(e,a,r)}e.children.length=0,delete e.object.__r3f,r&&e.type!=="primitive"&&e.object.type!=="Scene"&&FC(e.object),t===void 0&&Au(e)}function g5(i,e){for(const t of[i,i.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const n=t.ref(e);typeof n=="function"&&(t.refCleanup=n)}else t.ref&&(t.ref.current=e)}const om=[];function v5(){for(const[t]of om){const n=t.parent;if(n){t.props.attach?rg(n,t):$i(t.object)&&$i(n.object)&&n.object.remove(t.object);for(const r of t.children)r.props.attach?rg(t,r):$i(r.object)&&$i(t.object)&&t.object.remove(r.object)}t.isHidden&&zC(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&FC(t.object)}for(const[t,n,r]of om){t.props=n;const s=t.parent;if(s){var i,e;const a=mu[a0(t.type)];t.object=(i=t.props.object)!=null?i:new a(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,g5(r,t.object),da(t.object,t.props),t.props.attach?ig(s,t):$i(t.object)&&$i(s.object)&&s.object.add(t.object);for(const o of t.children)o.props.attach?ig(t,o):$i(o.object)&&$i(t.object)&&t.object.add(o.object);Au(t)}}om.length=0}const zy=()=>{},XM={};let Pp=NC;const y5=0,_5=4,ix=u5({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:p5,removeChild:nx,appendChild:Py,appendInitialChild:Py,insertBefore:WM,appendChildToContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||Py(t,e)},removeChildFromContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||nx(t,e)},insertInContainerBefore(i,e,t){const n=i.getState().scene.__r3f;!e||!t||!n||WM(n,e,t)},getRootHostContext:()=>XM,getChildHostContext:()=>XM,commitUpdate(i,e,t,n,r){var s,a,o;PC(e,n);let l=!1;if((i.type==="primitive"&&t.object!==n.object||((s=n.args)==null?void 0:s.length)!==((a=t.args)==null?void 0:a.length)||(o=n.args)!=null&&o.some((f,d)=>{var p;return f!==((p=t.args)==null?void 0:p[d])}))&&(l=!0),l)om.push([i,{...n},r]);else{const f=i5(i,n);Object.keys(f).length&&(Object.assign(i.props,f),da(i.object,f))}(r.sibling===null||(r.flags&_5)===y5)&&v5()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:i=>i?.object,prepareForCommit:()=>null,preparePortalMount:i=>ng(i.getState().scene,i,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:m5,unhideInstance:zC,createTextInstance:zy,hideTextInstance:zy,unhideTextInstance:zy,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:Z.createContext(null),setCurrentUpdatePriority(i){Pp=i},getCurrentUpdatePriority(){return Pp},resolveUpdatePriority(){var i;if(Pp!==NC)return Pp;switch(typeof window<"u"&&((i=window.event)==null?void 0:i.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return am.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return am.ContinuousEventPriority;default:return am.DefaultEventPriority}},resetFormInstance(){}}),Ol=new Map,Pc={objects:"shallow",strict:!1};function x5(i,e){if(!e&&typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&i.parentElement){const{width:t,height:n,top:r,left:s}=i.parentElement.getBoundingClientRect();return{width:t,height:n,top:r,left:s}}else if(!e&&typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function b5(i){const e=Ol.get(i),t=e?.fiber,n=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=n||c5(ax,qM),a=t||ix.createContainer(s,am.ConcurrentRoot,null,!1,null,"",r,r,r,null);e||Ol.set(i,{fiber:a,store:s});let o,l,c=!1,f=null;return{async configure(d={}){let p;f=new Promise(F=>p=F);let{gl:m,size:v,scene:x,events:_,onCreated:g,shadows:b=!1,linear:S=!1,flat:E=!1,legacy:w=!1,orthographic:T=!1,frameloop:C="always",dpr:U=[1,2],performance:D,raycaster:R,camera:I,onPointerMissed:z}=d,O=s.getState(),V=O.gl;if(!O.gl){const F={canvas:i,powerPreference:"high-performance",antialias:!0,alpha:!0},Y=typeof m=="function"?await m(F):m;VM(Y)?V=Y:V=new xC({...F,...m}),O.set({gl:V})}let ee=O.raycaster;ee||O.set({raycaster:ee=new x1});const{params:P,...L}=R||{};if(En.equ(L,ee,Pc)||da(ee,{...L}),En.equ(P,ee.params,Pc)||da(ee,{params:{...ee.params,...P}}),!O.camera||O.camera===l&&!En.equ(l,I,Pc)){l=I;const F=I?.isCamera,Y=F?I:T?new Bl(0,0,0,0,.1,1e3):new Kn(75,0,.1,1e3);F||(Y.position.z=5,I&&(da(Y,I),Y.manual||("aspect"in I||"left"in I||"right"in I||"bottom"in I||"top"in I)&&(Y.manual=!0,Y.updateProjectionMatrix())),!O.camera&&!(I!=null&&I.rotation)&&Y.lookAt(0,0,0)),O.set({camera:Y}),ee.camera=Y}if(!O.scene){let F;x!=null&&x.isScene?(F=x,ng(F,s,"",{})):(F=new zg,ng(F,s,"",{}),x&&da(F,x)),O.set({scene:F})}_&&!O.events.handlers&&O.set({events:_(s)});const k=x5(i,v);if(En.equ(k,O.size,Pc)||O.setSize(k.width,k.height,k.top,k.left),U&&O.viewport.dpr!==RC(U)&&O.setDpr(U),O.frameloop!==C&&O.setFrameloop(C),O.onPointerMissed||O.set({onPointerMissed:z}),D&&!En.equ(D,O.performance,Pc)&&O.set(F=>({performance:{...F.performance,...D}})),!O.xr){var H;const F=(j,J)=>{const he=s.getState();he.frameloop!=="never"&&qM(j,!0,he,J)},Y=()=>{const j=s.getState();j.gl.xr.enabled=j.gl.xr.isPresenting,j.gl.xr.setAnimationLoop(j.gl.xr.isPresenting?F:null),j.gl.xr.isPresenting||ax(j)},K={connect(){const j=s.getState().gl;j.xr.addEventListener("sessionstart",Y),j.xr.addEventListener("sessionend",Y)},disconnect(){const j=s.getState().gl;j.xr.removeEventListener("sessionstart",Y),j.xr.removeEventListener("sessionend",Y)}};typeof((H=V.xr)==null?void 0:H.addEventListener)=="function"&&K.connect(),O.set({xr:K})}if(V.shadowMap){const F=V.shadowMap.enabled,Y=V.shadowMap.type;if(V.shadowMap.enabled=!!b,En.boo(b))V.shadowMap.type=$h;else if(En.str(b)){var W;const K={basic:wA,percentage:Eg,soft:$h,variance:is};V.shadowMap.type=(W=K[b])!=null?W:$h}else En.obj(b)&&Object.assign(V.shadowMap,b);(F!==V.shadowMap.enabled||Y!==V.shadowMap.type)&&(V.shadowMap.needsUpdate=!0)}return Gt.enabled=!w,c||(V.outputColorSpace=S?mo:Ri,V.toneMapping=E?As:Ix),O.legacy!==w&&O.set(()=>({legacy:w})),O.linear!==S&&O.set(()=>({linear:S})),O.flat!==E&&O.set(()=>({flat:E})),m&&!En.fun(m)&&!VM(m)&&!En.equ(m,V,Pc)&&da(V,m),o=g,c=!0,p(),this},render(d){return!c&&!f&&this.configure(),f.then(()=>{ix.updateContainer(ue.jsx(S5,{store:s,children:d,onCreated:o,rootElement:i}),a,null,()=>{})}),s},unmount(){BC(i)}}}function S5({store:i,children:e,onCreated:t,rootElement:n}){return nd(()=>{const r=i.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),i.getState().events.connected||r.events.connect==null||r.events.connect(n)},[]),ue.jsx(OC.Provider,{value:i,children:e})}function BC(i,e){const t=Ol.get(i),n=t?.fiber;if(n){const r=t?.store.getState();r&&(r.internal.active=!1),ix.updateContainer(null,n,null,()=>{r&&setTimeout(()=>{try{var s,a,o,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(a=s.renderLists)==null||a.dispose==null||a.dispose(),(o=r.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),e5(r.scene),Ol.delete(i)}catch{}},500)})}}function E5(i,e){const t={callback:i};return e.add(t),()=>void e.delete(t)}const kC=new Set,M5=new Set,w5=new Set,T5=i=>E5(i,kC);function Fy(i,e){if(i.size)for(const{callback:t}of i.values())t(e)}function uf(i,e){switch(i){case"before":return Fy(kC,e);case"after":return Fy(M5,e);case"tail":return Fy(w5,e)}}let By,ky;function rx(i,e,t){let n=e.clock.getDelta();e.frameloop==="never"&&typeof i=="number"&&(n=i-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=i),By=e.internal.subscribers;for(let r=0;r<By.length;r++)ky=By[r],ky.ref.current(ky.store.getState(),n,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let sg=!1,sx=!1,Gy,jM,zc;function GC(i){jM=requestAnimationFrame(GC),sg=!0,Gy=0,uf("before",i),sx=!0;for(const t of Ol.values()){var e;zc=t.store.getState(),zc.internal.active&&(zc.frameloop==="always"||zc.internal.frames>0)&&!((e=zc.gl.xr)!=null&&e.isPresenting)&&(Gy+=rx(i,zc))}if(sx=!1,uf("after",i),Gy===0)return uf("tail",i),sg=!1,cancelAnimationFrame(jM)}function ax(i,e=1){var t;if(!i)return Ol.forEach(n=>ax(n.store.getState(),e));(t=i.gl.xr)!=null&&t.isPresenting||!i.internal.active||i.frameloop==="never"||(e>1?i.internal.frames=Math.min(60,i.internal.frames+e):sx?i.internal.frames=2:i.internal.frames=1,sg||(sg=!0,requestAnimationFrame(GC)))}function qM(i,e=!0,t,n){if(e&&uf("before",i),t)rx(i,t,n);else for(const r of Ol.values())rx(i,r.store.getState());e&&uf("after",i)}const Hy={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function A5(i){const{handlePointer:e}=l5(i);return{priority:1,enabled:!0,compute(t,n,r){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(Hy).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:r}=i.getState();(t=r.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{const{set:n,events:r}=i.getState();if(r.disconnect==null||r.disconnect(),n(s=>({events:{...s.events,connected:t}})),r.handlers)for(const s in r.handlers){const a=r.handlers[s],[o,l]=Hy[s];t.addEventListener(o,a,{passive:l})}},disconnect:()=>{const{set:t,events:n}=i.getState();if(n.connected){if(n.handlers)for(const r in n.handlers){const s=n.handlers[r],[a]=Hy[r];n.connected.removeEventListener(a,s)}t(r=>({events:{...r.events,connected:void 0}}))}}}}function YM(i,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}function C5({debounce:i,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=Z.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=Z.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=i?typeof i=="number"?i:i.scroll:null,c=i?typeof i=="number"?i:i.resize:null,f=Z.useRef(!1);Z.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[d,p,m]=Z.useMemo(()=>{const g=()=>{if(!o.current.element)return;const{left:b,top:S,width:E,height:w,bottom:T,right:C,x:U,y:D}=o.current.element.getBoundingClientRect(),R={left:b,top:S,width:E,height:w,bottom:T,right:C,x:U,y:D};o.current.element instanceof HTMLElement&&n&&(R.height=o.current.element.offsetHeight,R.width=o.current.element.offsetWidth),Object.freeze(R),f.current&&!O5(o.current.lastBounds,R)&&a(o.current.lastBounds=R)};return[g,c?YM(g,c):g,l?YM(g,l):g]},[a,n,l,c]);function v(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function x(){o.current.element&&(o.current.resizeObserver=new r(m),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(g=>g.addEventListener("scroll",m,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const _=g=>{!g||g===o.current.element||(v(),o.current.element=g,o.current.scrollContainers=HC(g),x())};return D5(m,!!e),R5(p),Z.useEffect(()=>{v(),x()},[e,m,p]),Z.useEffect(()=>v,[]),[_,s,d]}function R5(i){Z.useEffect(()=>{const e=i;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[i])}function D5(i,e){Z.useEffect(()=>{if(e){const t=i;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[i,e])}function HC(i){const e=[];if(!i||i===document.body)return e;const{overflow:t,overflowX:n,overflowY:r}=window.getComputedStyle(i);return[t,n,r].some(s=>s==="auto"||s==="scroll")&&e.push(i),[...e,...HC(i.parentElement)]}const U5=["x","y","top","bottom","left","right","width","height"],O5=(i,e)=>U5.every(t=>i[t]===e[t]);function L5({ref:i,children:e,fallback:t,resize:n,style:r,gl:s,events:a=A5,eventSource:o,eventPrefix:l,shadows:c,linear:f,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:b,scene:S,onPointerMissed:E,onCreated:w,...T}){Z.useMemo(()=>IC(bC),[]);const C=J4(),[U,D]=C5({scroll:!0,debounce:{scroll:50,resize:0},...n}),R=Z.useRef(null),I=Z.useRef(null);Z.useImperativeHandle(i,()=>R.current);const z=CC(E),[O,V]=Z.useState(!1),[ee,P]=Z.useState(!1);if(O)throw O;if(ee)throw ee;const L=Z.useRef(null);nd(()=>{const H=R.current;if(D.width>0&&D.height>0&&H){L.current||(L.current=b5(H));async function W(){await L.current.configure({gl:s,scene:S,events:a,shadows:c,linear:f,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:b,size:D,onPointerMissed:(...F)=>z.current==null?void 0:z.current(...F),onCreated:F=>{F.events.connect==null||F.events.connect(o?Z4(o)?o.current:o:I.current),l&&F.setEvents({compute:(Y,K)=>{const j=Y[l+"X"],J=Y[l+"Y"];K.pointer.set(j/K.size.width*2-1,-(J/K.size.height)*2+1),K.raycaster.setFromCamera(K.pointer,K.camera)}}),w?.(F)}}),L.current.render(ue.jsx(C,{children:ue.jsx($4,{set:P,children:ue.jsx(Z.Suspense,{fallback:ue.jsx(Q4,{set:V}),children:e??null})})}))}W()}}),Z.useEffect(()=>{const H=R.current;if(H)return()=>BC(H)},[]);const k=o?"none":"auto";return ue.jsx("div",{ref:I,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:k,...r},...T,children:ue.jsx("div",{ref:U,style:{width:"100%",height:"100%"},children:ue.jsx("canvas",{ref:R,style:{display:"block"},children:t})})})}function N5(i){return ue.jsx(MC,{children:ue.jsx(L5,{...i})})}function I5(i,e,t){var n,r=1;i==null&&(i=0),e==null&&(e=0),t==null&&(t=0);function s(){var a,o=n.length,l,c=0,f=0,d=0;for(a=0;a<o;++a)l=n[a],c+=l.x||0,f+=l.y||0,d+=l.z||0;for(c=(c/o-i)*r,f=(f/o-e)*r,d=(d/o-t)*r,a=0;a<o;++a)l=n[a],c&&(l.x-=c),f&&(l.y-=f),d&&(l.z-=d)}return s.initialize=function(a){n=a},s.x=function(a){return arguments.length?(i=+a,s):i},s.y=function(a){return arguments.length?(e=+a,s):e},s.z=function(a){return arguments.length?(t=+a,s):t},s.strength=function(a){return arguments.length?(r=+a,s):r},s}function P5(i){const e=+this._x.call(null,i);return VC(this.cover(e),e,i)}function VC(i,e,t){if(isNaN(e))return i;var n,r=i._root,s={data:t},a=i._x0,o=i._x1,l,c,f,d,p;if(!r)return i._root=s,i;for(;r.length;)if((f=e>=(l=(a+o)/2))?a=l:o=l,n=r,!(r=r[d=+f]))return n[d]=s,i;if(c=+i._x.call(null,r.data),e===c)return s.next=r,n?n[d]=s:i._root=s,i;do n=n?n[d]=new Array(2):i._root=new Array(2),(f=e>=(l=(a+o)/2))?a=l:o=l;while((d=+f)==(p=+(c>=l)));return n[p]=r,n[d]=s,i}function z5(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e);let n=1/0,r=-1/0;for(let s=0,a;s<e;++s)isNaN(a=+this._x.call(null,i[s]))||(t[s]=a,a<n&&(n=a),a>r&&(r=a));if(n>r)return this;this.cover(n).cover(r);for(let s=0;s<e;++s)VC(this,t[s],i[s]);return this}function F5(i){if(isNaN(i=+i))return this;var e=this._x0,t=this._x1;if(isNaN(e))t=(e=Math.floor(i))+1;else{for(var n=t-e||1,r=this._root,s,a;e>i||i>=t;)switch(a=+(i<e),s=new Array(2),s[a]=r,r=s,n*=2,a){case 0:t=e+n;break;case 1:e=t-n;break}this._root&&this._root.length&&(this._root=r)}return this._x0=e,this._x1=t,this}function B5(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function k5(i){return arguments.length?this.cover(+i[0][0]).cover(+i[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function va(i,e,t){this.node=i,this.x0=e,this.x1=t}function G5(i,e){var t,n=this._x0,r,s,a=this._x1,o=[],l=this._root,c,f;for(l&&o.push(new va(l,n,a)),e==null?e=1/0:(n=i-e,a=i+e);c=o.pop();)if(!(!(l=c.node)||(r=c.x0)>a||(s=c.x1)<n))if(l.length){var d=(r+s)/2;o.push(new va(l[1],d,s),new va(l[0],r,d)),(f=+(i>=d))&&(c=o[o.length-1],o[o.length-1]=o[o.length-1-f],o[o.length-1-f]=c)}else{var p=Math.abs(i-+this._x.call(null,l.data));p<e&&(e=p,n=i-p,a=i+p,t=l.data)}return t}function H5(i){if(isNaN(l=+this._x.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._x1,l,c,f,d,p;if(!t)return this;if(t.length)for(;;){if((f=l>=(c=(a+o)/2))?a=c:o=c,e=t,!(t=t[d=+f]))return this;if(!t.length)break;e[d+1&1]&&(n=e,p=d)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[d]=s:delete e[d],(t=e[0]||e[1])&&t===(e[1]||e[0])&&!t.length&&(n?n[p]=t:this._root=t),this):(this._root=s,this)}function V5(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function W5(){return this._root}function X5(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function j5(i){var e=[],t,n=this._root,r,s,a;for(n&&e.push(new va(n,this._x0,this._x1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.x1)&&n.length){var o=(s+a)/2;(r=n[1])&&e.push(new va(r,o,a)),(r=n[0])&&e.push(new va(r,s,o))}return this}function q5(i){var e=[],t=[],n;for(this._root&&e.push(new va(this._root,this._x0,this._x1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.x1,l=(a+o)/2;(s=r[0])&&e.push(new va(s,a,l)),(s=r[1])&&e.push(new va(s,l,o))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.x1);return this}function Y5(i){return i[0]}function Z5(i){return arguments.length?(this._x=i,this):this._x}function T1(i,e){var t=new A1(e??Y5,NaN,NaN);return i==null?t:t.addAll(i)}function A1(i,e,t){this._x=i,this._x0=e,this._x1=t,this._root=void 0}function ZM(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var rr=T1.prototype=A1.prototype;rr.copy=function(){var i=new A1(this._x,this._x0,this._x1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=ZM(e),i;for(t=[{source:e,target:i._root=new Array(2)}];e=t.pop();)for(var r=0;r<2;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(2)}):e.target[r]=ZM(n));return i};rr.add=P5;rr.addAll=z5;rr.cover=F5;rr.data=B5;rr.extent=k5;rr.find=G5;rr.remove=H5;rr.removeAll=V5;rr.root=W5;rr.size=X5;rr.visit=j5;rr.visitAfter=q5;rr.x=Z5;function K5(i){const e=+this._x.call(null,i),t=+this._y.call(null,i);return WC(this.cover(e,t),e,t,i)}function WC(i,e,t,n){if(isNaN(e)||isNaN(t))return i;var r,s=i._root,a={data:n},o=i._x0,l=i._y0,c=i._x1,f=i._y1,d,p,m,v,x,_,g,b;if(!s)return i._root=a,i;for(;s.length;)if((x=e>=(d=(o+c)/2))?o=d:c=d,(_=t>=(p=(l+f)/2))?l=p:f=p,r=s,!(s=s[g=_<<1|x]))return r[g]=a,i;if(m=+i._x.call(null,s.data),v=+i._y.call(null,s.data),e===m&&t===v)return a.next=s,r?r[g]=a:i._root=a,i;do r=r?r[g]=new Array(4):i._root=new Array(4),(x=e>=(d=(o+c)/2))?o=d:c=d,(_=t>=(p=(l+f)/2))?l=p:f=p;while((g=_<<1|x)===(b=(v>=p)<<1|m>=d));return r[b]=s,r[g]=a,i}function J5(i){var e,t,n=i.length,r,s,a=new Array(n),o=new Array(n),l=1/0,c=1/0,f=-1/0,d=-1/0;for(t=0;t<n;++t)isNaN(r=+this._x.call(null,e=i[t]))||isNaN(s=+this._y.call(null,e))||(a[t]=r,o[t]=s,r<l&&(l=r),r>f&&(f=r),s<c&&(c=s),s>d&&(d=s));if(l>f||c>d)return this;for(this.cover(l,c).cover(f,d),t=0;t<n;++t)WC(this,a[t],o[t],i[t]);return this}function Q5(i,e){if(isNaN(i=+i)||isNaN(e=+e))return this;var t=this._x0,n=this._y0,r=this._x1,s=this._y1;if(isNaN(t))r=(t=Math.floor(i))+1,s=(n=Math.floor(e))+1;else{for(var a=r-t||1,o=this._root,l,c;t>i||i>=r||n>e||e>=s;)switch(c=(e<n)<<1|i<t,l=new Array(4),l[c]=o,o=l,a*=2,c){case 0:r=t+a,s=n+a;break;case 1:t=r-a,s=n+a;break;case 2:r=t+a,n=s-a;break;case 3:t=r-a,n=s-a;break}this._root&&this._root.length&&(this._root=o)}return this._x0=t,this._y0=n,this._x1=r,this._y1=s,this}function $5(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function ek(i){return arguments.length?this.cover(+i[0][0],+i[0][1]).cover(+i[1][0],+i[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Bi(i,e,t,n,r){this.node=i,this.x0=e,this.y0=t,this.x1=n,this.y1=r}function tk(i,e,t){var n,r=this._x0,s=this._y0,a,o,l,c,f=this._x1,d=this._y1,p=[],m=this._root,v,x;for(m&&p.push(new Bi(m,r,s,f,d)),t==null?t=1/0:(r=i-t,s=e-t,f=i+t,d=e+t,t*=t);v=p.pop();)if(!(!(m=v.node)||(a=v.x0)>f||(o=v.y0)>d||(l=v.x1)<r||(c=v.y1)<s))if(m.length){var _=(a+l)/2,g=(o+c)/2;p.push(new Bi(m[3],_,g,l,c),new Bi(m[2],a,g,_,c),new Bi(m[1],_,o,l,g),new Bi(m[0],a,o,_,g)),(x=(e>=g)<<1|i>=_)&&(v=p[p.length-1],p[p.length-1]=p[p.length-1-x],p[p.length-1-x]=v)}else{var b=i-+this._x.call(null,m.data),S=e-+this._y.call(null,m.data),E=b*b+S*S;if(E<t){var w=Math.sqrt(t=E);r=i-w,s=e-w,f=i+w,d=e+w,n=m.data}}return n}function nk(i){if(isNaN(f=+this._x.call(null,i))||isNaN(d=+this._y.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._y0,l=this._x1,c=this._y1,f,d,p,m,v,x,_,g;if(!t)return this;if(t.length)for(;;){if((v=f>=(p=(a+l)/2))?a=p:l=p,(x=d>=(m=(o+c)/2))?o=m:c=m,e=t,!(t=t[_=x<<1|v]))return this;if(!t.length)break;(e[_+1&3]||e[_+2&3]||e[_+3&3])&&(n=e,g=_)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[_]=s:delete e[_],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[g]=t:this._root=t),this):(this._root=s,this)}function ik(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function rk(){return this._root}function sk(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function ak(i){var e=[],t,n=this._root,r,s,a,o,l;for(n&&e.push(new Bi(n,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.y0,o=t.x1,l=t.y1)&&n.length){var c=(s+o)/2,f=(a+l)/2;(r=n[3])&&e.push(new Bi(r,c,f,o,l)),(r=n[2])&&e.push(new Bi(r,s,f,c,l)),(r=n[1])&&e.push(new Bi(r,c,a,o,f)),(r=n[0])&&e.push(new Bi(r,s,a,c,f))}return this}function ok(i){var e=[],t=[],n;for(this._root&&e.push(new Bi(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.y0,l=n.x1,c=n.y1,f=(a+l)/2,d=(o+c)/2;(s=r[0])&&e.push(new Bi(s,a,o,f,d)),(s=r[1])&&e.push(new Bi(s,f,o,l,d)),(s=r[2])&&e.push(new Bi(s,a,d,f,c)),(s=r[3])&&e.push(new Bi(s,f,d,l,c))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.x1,n.y1);return this}function lk(i){return i[0]}function ck(i){return arguments.length?(this._x=i,this):this._x}function uk(i){return i[1]}function hk(i){return arguments.length?(this._y=i,this):this._y}function C1(i,e,t){var n=new R1(e??lk,t??uk,NaN,NaN,NaN,NaN);return i==null?n:n.addAll(i)}function R1(i,e,t,n,r,s){this._x=i,this._y=e,this._x0=t,this._y0=n,this._x1=r,this._y1=s,this._root=void 0}function KM(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var Hi=C1.prototype=R1.prototype;Hi.copy=function(){var i=new R1(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=KM(e),i;for(t=[{source:e,target:i._root=new Array(4)}];e=t.pop();)for(var r=0;r<4;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(4)}):e.target[r]=KM(n));return i};Hi.add=K5;Hi.addAll=J5;Hi.cover=Q5;Hi.data=$5;Hi.extent=ek;Hi.find=tk;Hi.remove=nk;Hi.removeAll=ik;Hi.root=rk;Hi.size=sk;Hi.visit=ak;Hi.visitAfter=ok;Hi.x=ck;Hi.y=hk;function fk(i){const e=+this._x.call(null,i),t=+this._y.call(null,i),n=+this._z.call(null,i);return XC(this.cover(e,t,n),e,t,n,i)}function XC(i,e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n))return i;var s,a=i._root,o={data:r},l=i._x0,c=i._y0,f=i._z0,d=i._x1,p=i._y1,m=i._z1,v,x,_,g,b,S,E,w,T,C,U;if(!a)return i._root=o,i;for(;a.length;)if((E=e>=(v=(l+d)/2))?l=v:d=v,(w=t>=(x=(c+p)/2))?c=x:p=x,(T=n>=(_=(f+m)/2))?f=_:m=_,s=a,!(a=a[C=T<<2|w<<1|E]))return s[C]=o,i;if(g=+i._x.call(null,a.data),b=+i._y.call(null,a.data),S=+i._z.call(null,a.data),e===g&&t===b&&n===S)return o.next=a,s?s[C]=o:i._root=o,i;do s=s?s[C]=new Array(8):i._root=new Array(8),(E=e>=(v=(l+d)/2))?l=v:d=v,(w=t>=(x=(c+p)/2))?c=x:p=x,(T=n>=(_=(f+m)/2))?f=_:m=_;while((C=T<<2|w<<1|E)===(U=(S>=_)<<2|(b>=x)<<1|g>=v));return s[U]=a,s[C]=o,i}function dk(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e),n=new Float64Array(e),r=new Float64Array(e);let s=1/0,a=1/0,o=1/0,l=-1/0,c=-1/0,f=-1/0;for(let d=0,p,m,v,x;d<e;++d)isNaN(m=+this._x.call(null,p=i[d]))||isNaN(v=+this._y.call(null,p))||isNaN(x=+this._z.call(null,p))||(t[d]=m,n[d]=v,r[d]=x,m<s&&(s=m),m>l&&(l=m),v<a&&(a=v),v>c&&(c=v),x<o&&(o=x),x>f&&(f=x));if(s>l||a>c||o>f)return this;this.cover(s,a,o).cover(l,c,f);for(let d=0;d<e;++d)XC(this,t[d],n[d],r[d],i[d]);return this}function pk(i,e,t){if(isNaN(i=+i)||isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,s=this._z0,a=this._x1,o=this._y1,l=this._z1;if(isNaN(n))a=(n=Math.floor(i))+1,o=(r=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var c=a-n||1,f=this._root,d,p;n>i||i>=a||r>e||e>=o||s>t||t>=l;)switch(p=(t<s)<<2|(e<r)<<1|i<n,d=new Array(8),d[p]=f,f=d,c*=2,p){case 0:a=n+c,o=r+c,l=s+c;break;case 1:n=a-c,o=r+c,l=s+c;break;case 2:a=n+c,r=o-c,l=s+c;break;case 3:n=a-c,r=o-c,l=s+c;break;case 4:a=n+c,o=r+c,s=l-c;break;case 5:n=a-c,o=r+c,s=l-c;break;case 6:a=n+c,r=o-c,s=l-c;break;case 7:n=a-c,r=o-c,s=l-c;break}this._root&&this._root.length&&(this._root=f)}return this._x0=n,this._y0=r,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this}function mk(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function gk(i){return arguments.length?this.cover(+i[0][0],+i[0][1],+i[0][2]).cover(+i[1][0],+i[1][1],+i[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function un(i,e,t,n,r,s,a){this.node=i,this.x0=e,this.y0=t,this.z0=n,this.x1=r,this.y1=s,this.z1=a}function vk(i,e,t,n){var r,s=this._x0,a=this._y0,o=this._z0,l,c,f,d,p,m,v=this._x1,x=this._y1,_=this._z1,g=[],b=this._root,S,E;for(b&&g.push(new un(b,s,a,o,v,x,_)),n==null?n=1/0:(s=i-n,a=e-n,o=t-n,v=i+n,x=e+n,_=t+n,n*=n);S=g.pop();)if(!(!(b=S.node)||(l=S.x0)>v||(c=S.y0)>x||(f=S.z0)>_||(d=S.x1)<s||(p=S.y1)<a||(m=S.z1)<o))if(b.length){var w=(l+d)/2,T=(c+p)/2,C=(f+m)/2;g.push(new un(b[7],w,T,C,d,p,m),new un(b[6],l,T,C,w,p,m),new un(b[5],w,c,C,d,T,m),new un(b[4],l,c,C,w,T,m),new un(b[3],w,T,f,d,p,C),new un(b[2],l,T,f,w,p,C),new un(b[1],w,c,f,d,T,C),new un(b[0],l,c,f,w,T,C)),(E=(t>=C)<<2|(e>=T)<<1|i>=w)&&(S=g[g.length-1],g[g.length-1]=g[g.length-1-E],g[g.length-1-E]=S)}else{var U=i-+this._x.call(null,b.data),D=e-+this._y.call(null,b.data),R=t-+this._z.call(null,b.data),I=U*U+D*D+R*R;if(I<n){var z=Math.sqrt(n=I);s=i-z,a=e-z,o=t-z,v=i+z,x=e+z,_=t+z,r=b.data}}return r}const yk=(i,e,t,n,r,s)=>Math.sqrt((i-n)**2+(e-r)**2+(t-s)**2);function _k(i,e,t,n){const r=[],s=i-n,a=e-n,o=t-n,l=i+n,c=e+n,f=t+n;return this.visit((d,p,m,v,x,_,g)=>{if(!d.length)do{const b=d.data;yk(i,e,t,this._x(b),this._y(b),this._z(b))<=n&&r.push(b)}while(d=d.next);return p>l||m>c||v>f||x<s||_<a||g<o}),r}function xk(i){if(isNaN(p=+this._x.call(null,i))||isNaN(m=+this._y.call(null,i))||isNaN(v=+this._z.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._y0,l=this._z0,c=this._x1,f=this._y1,d=this._z1,p,m,v,x,_,g,b,S,E,w,T;if(!t)return this;if(t.length)for(;;){if((b=p>=(x=(a+c)/2))?a=x:c=x,(S=m>=(_=(o+f)/2))?o=_:f=_,(E=v>=(g=(l+d)/2))?l=g:d=g,e=t,!(t=t[w=E<<2|S<<1|b]))return this;if(!t.length)break;(e[w+1&7]||e[w+2&7]||e[w+3&7]||e[w+4&7]||e[w+5&7]||e[w+6&7]||e[w+7&7])&&(n=e,T=w)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[w]=s:delete e[w],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[T]=t:this._root=t),this):(this._root=s,this)}function bk(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function Sk(){return this._root}function Ek(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function Mk(i){var e=[],t,n=this._root,r,s,a,o,l,c,f;for(n&&e.push(new un(n,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.y0,o=t.z0,l=t.x1,c=t.y1,f=t.z1)&&n.length){var d=(s+l)/2,p=(a+c)/2,m=(o+f)/2;(r=n[7])&&e.push(new un(r,d,p,m,l,c,f)),(r=n[6])&&e.push(new un(r,s,p,m,d,c,f)),(r=n[5])&&e.push(new un(r,d,a,m,l,p,f)),(r=n[4])&&e.push(new un(r,s,a,m,d,p,f)),(r=n[3])&&e.push(new un(r,d,p,o,l,c,m)),(r=n[2])&&e.push(new un(r,s,p,o,d,c,m)),(r=n[1])&&e.push(new un(r,d,a,o,l,p,m)),(r=n[0])&&e.push(new un(r,s,a,o,d,p,m))}return this}function wk(i){var e=[],t=[],n;for(this._root&&e.push(new un(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.y0,l=n.z0,c=n.x1,f=n.y1,d=n.z1,p=(a+c)/2,m=(o+f)/2,v=(l+d)/2;(s=r[0])&&e.push(new un(s,a,o,l,p,m,v)),(s=r[1])&&e.push(new un(s,p,o,l,c,m,v)),(s=r[2])&&e.push(new un(s,a,m,l,p,f,v)),(s=r[3])&&e.push(new un(s,p,m,l,c,f,v)),(s=r[4])&&e.push(new un(s,a,o,v,p,m,d)),(s=r[5])&&e.push(new un(s,p,o,v,c,m,d)),(s=r[6])&&e.push(new un(s,a,m,v,p,f,d)),(s=r[7])&&e.push(new un(s,p,m,v,c,f,d))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.z0,n.x1,n.y1,n.z1);return this}function Tk(i){return i[0]}function Ak(i){return arguments.length?(this._x=i,this):this._x}function Ck(i){return i[1]}function Rk(i){return arguments.length?(this._y=i,this):this._y}function Dk(i){return i[2]}function Uk(i){return arguments.length?(this._z=i,this):this._z}function D1(i,e,t,n){var r=new U1(e??Tk,t??Ck,n??Dk,NaN,NaN,NaN,NaN,NaN,NaN);return i==null?r:r.addAll(i)}function U1(i,e,t,n,r,s,a,o,l){this._x=i,this._y=e,this._z=t,this._x0=n,this._y0=r,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this._root=void 0}function JM(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var xi=D1.prototype=U1.prototype;xi.copy=function(){var i=new U1(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=JM(e),i;for(t=[{source:e,target:i._root=new Array(8)}];e=t.pop();)for(var r=0;r<8;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(8)}):e.target[r]=JM(n));return i};xi.add=fk;xi.addAll=dk;xi.cover=pk;xi.data=mk;xi.extent=gk;xi.find=vk;xi.findAllWithinRadius=_k;xi.remove=xk;xi.removeAll=bk;xi.root=Sk;xi.size=Ek;xi.visit=Mk;xi.visitAfter=wk;xi.x=Ak;xi.y=Rk;xi.z=Uk;function wn(i){return function(){return i}}function Ir(i){return(i()-.5)*1e-6}function Vy(i){return i.x+i.vx}function QM(i){return i.y+i.vy}function Ok(i){return i.z+i.vz}function jC(i){var e,t,n,r,s=1,a=1;typeof i!="function"&&(i=wn(i==null?1:+i));function o(){for(var f,d=e.length,p,m,v,x,_,g,b,S=0;S<a;++S)for(p=(t===1?T1(e,Vy):t===2?C1(e,Vy,QM):t===3?D1(e,Vy,QM,Ok):null).visitAfter(l),f=0;f<d;++f)m=e[f],g=n[m.index],b=g*g,v=m.x+m.vx,t>1&&(x=m.y+m.vy),t>2&&(_=m.z+m.vz),p.visit(E);function E(w,T,C,U,D,R,I){var z=[T,C,U,D,R,I],O=z[0],V=z[1],ee=z[2],P=z[t],L=z[t+1],k=z[t+2],H=w.data,W=w.r,F=g+W;if(H){if(H.index>m.index){var Y=v-H.x-H.vx,K=t>1?x-H.y-H.vy:0,j=t>2?_-H.z-H.vz:0,J=Y*Y+K*K+j*j;J<F*F&&(Y===0&&(Y=Ir(r),J+=Y*Y),t>1&&K===0&&(K=Ir(r),J+=K*K),t>2&&j===0&&(j=Ir(r),J+=j*j),J=(F-(J=Math.sqrt(J)))/J*s,m.vx+=(Y*=J)*(F=(W*=W)/(b+W)),t>1&&(m.vy+=(K*=J)*F),t>2&&(m.vz+=(j*=J)*F),H.vx-=Y*(F=1-F),t>1&&(H.vy-=K*F),t>2&&(H.vz-=j*F))}return}return O>v+F||P<v-F||t>1&&(V>x+F||L<x-F)||t>2&&(ee>_+F||k<_-F)}}function l(f){if(f.data)return f.r=n[f.data.index];for(var d=f.r=0;d<Math.pow(2,t);++d)f[d]&&f[d].r>f.r&&(f.r=f[d].r)}function c(){if(e){var f,d=e.length,p;for(n=new Array(d),f=0;f<d;++f)p=e[f],n[p.index]=+i(p,f,e)}}return o.initialize=function(f,...d){e=f,r=d.find(p=>typeof p=="function")||Math.random,t=d.find(p=>[1,2,3].includes(p))||2,c()},o.iterations=function(f){return arguments.length?(a=+f,o):a},o.strength=function(f){return arguments.length?(s=+f,o):s},o.radius=function(f){return arguments.length?(i=typeof f=="function"?f:wn(+f),c(),o):i},o}function Lk(i){return i.index}function $M(i,e){var t=i.get(e);if(!t)throw new Error("node not found: "+e);return t}function qC(i){var e=Lk,t=p,n,r=wn(30),s,a,o,l,c,f,d=1;i==null&&(i=[]);function p(g){return 1/Math.min(l[g.source.index],l[g.target.index])}function m(g){for(var b=0,S=i.length;b<d;++b)for(var E=0,w,T,C,U=0,D=0,R=0,I,z;E<S;++E)w=i[E],T=w.source,C=w.target,U=C.x+C.vx-T.x-T.vx||Ir(f),o>1&&(D=C.y+C.vy-T.y-T.vy||Ir(f)),o>2&&(R=C.z+C.vz-T.z-T.vz||Ir(f)),I=Math.sqrt(U*U+D*D+R*R),I=(I-s[E])/I*g*n[E],U*=I,D*=I,R*=I,C.vx-=U*(z=c[E]),o>1&&(C.vy-=D*z),o>2&&(C.vz-=R*z),T.vx+=U*(z=1-z),o>1&&(T.vy+=D*z),o>2&&(T.vz+=R*z)}function v(){if(a){var g,b=a.length,S=i.length,E=new Map(a.map((T,C)=>[e(T,C,a),T])),w;for(g=0,l=new Array(b);g<S;++g)w=i[g],w.index=g,typeof w.source!="object"&&(w.source=$M(E,w.source)),typeof w.target!="object"&&(w.target=$M(E,w.target)),l[w.source.index]=(l[w.source.index]||0)+1,l[w.target.index]=(l[w.target.index]||0)+1;for(g=0,c=new Array(S);g<S;++g)w=i[g],c[g]=l[w.source.index]/(l[w.source.index]+l[w.target.index]);n=new Array(S),x(),s=new Array(S),_()}}function x(){if(a)for(var g=0,b=i.length;g<b;++g)n[g]=+t(i[g],g,i)}function _(){if(a)for(var g=0,b=i.length;g<b;++g)s[g]=+r(i[g],g,i)}return m.initialize=function(g,...b){a=g,f=b.find(S=>typeof S=="function")||Math.random,o=b.find(S=>[1,2,3].includes(S))||2,v()},m.links=function(g){return arguments.length?(i=g,v(),m):i},m.id=function(g){return arguments.length?(e=g,m):e},m.iterations=function(g){return arguments.length?(d=+g,m):d},m.strength=function(g){return arguments.length?(t=typeof g=="function"?g:wn(+g),x(),m):t},m.distance=function(g){return arguments.length?(r=typeof g=="function"?g:wn(+g),_(),m):r},m}var Nk={value:()=>{}};function YC(){for(var i=0,e=arguments.length,t={},n;i<e;++i){if(!(n=arguments[i]+"")||n in t||/[\s.]/.test(n))throw new Error("illegal type: "+n);t[n]=[]}return new lm(t)}function lm(i){this._=i}function Ik(i,e){return i.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}lm.prototype=YC.prototype={constructor:lm,on:function(i,e){var t=this._,n=Ik(i+"",t),r,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((r=(i=n[s]).type)&&(r=Pk(t[r],i.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(i=n[s]).type)t[r]=ew(t[r],i.name,e);else if(e==null)for(r in t)t[r]=ew(t[r],i.name,null);return this},copy:function(){var i={},e=this._;for(var t in e)i[t]=e[t].slice();return new lm(i)},call:function(i,e){if((r=arguments.length-2)>0)for(var t=new Array(r),n=0,r,s;n<r;++n)t[n]=arguments[n+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(s=this._[i],n=0,r=s.length;n<r;++n)s[n].value.apply(e,t)},apply:function(i,e,t){if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(var n=this._[i],r=0,s=n.length;r<s;++r)n[r].value.apply(e,t)}};function Pk(i,e){for(var t=0,n=i.length,r;t<n;++t)if((r=i[t]).name===e)return r.value}function ew(i,e,t){for(var n=0,r=i.length;n<r;++n)if(i[n].name===e){i[n]=Nk,i=i.slice(0,n).concat(i.slice(n+1));break}return t!=null&&i.push({name:e,value:t}),i}var gu=0,Zh=0,Eh=0,ZC=1e3,ag,Kh,og=0,Ll=0,o0=0,If=typeof performance=="object"&&performance.now?performance:Date,KC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(i){setTimeout(i,17)};function JC(){return Ll||(KC(zk),Ll=If.now()+o0)}function zk(){Ll=0}function ox(){this._call=this._time=this._next=null}ox.prototype=QC.prototype={constructor:ox,restart:function(i,e,t){if(typeof i!="function")throw new TypeError("callback is not a function");t=(t==null?JC():+t)+(e==null?0:+e),!this._next&&Kh!==this&&(Kh?Kh._next=this:ag=this,Kh=this),this._call=i,this._time=t,lx()},stop:function(){this._call&&(this._call=null,this._time=1/0,lx())}};function QC(i,e,t){var n=new ox;return n.restart(i,e,t),n}function Fk(){JC(),++gu;for(var i=ag,e;i;)(e=Ll-i._time)>=0&&i._call.call(void 0,e),i=i._next;--gu}function tw(){Ll=(og=If.now())+o0,gu=Zh=0;try{Fk()}finally{gu=0,kk(),Ll=0}}function Bk(){var i=If.now(),e=i-og;e>ZC&&(o0-=e,og=i)}function kk(){for(var i,e=ag,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),i=e,e=e._next):(t=e._next,e._next=null,e=i?i._next=t:ag=t);Kh=i,lx(n)}function lx(i){if(!gu){Zh&&(Zh=clearTimeout(Zh));var e=i-Ll;e>24?(i<1/0&&(Zh=setTimeout(tw,i-If.now()-o0)),Eh&&(Eh=clearInterval(Eh))):(Eh||(og=If.now(),Eh=setInterval(Bk,ZC)),gu=1,KC(tw))}}const Gk=1664525,Hk=1013904223,nw=4294967296;function Vk(){let i=1;return()=>(i=(Gk*i+Hk)%nw)/nw}var iw=3;function Wy(i){return i.x}function rw(i){return i.y}function Wk(i){return i.z}var Xk=10,jk=Math.PI*(3-Math.sqrt(5)),qk=Math.PI*20/(9+Math.sqrt(221));function $C(i,e){e=e||2;var t=Math.min(iw,Math.max(1,Math.round(e))),n,r=1,s=.001,a=1-Math.pow(s,1/300),o=0,l=.6,c=new Map,f=QC(m),d=YC("tick","end"),p=Vk();i==null&&(i=[]);function m(){v(),d.call("tick",n),r<s&&(f.stop(),d.call("end",n))}function v(g){var b,S=i.length,E;g===void 0&&(g=1);for(var w=0;w<g;++w)for(r+=(o-r)*a,c.forEach(function(T){T(r)}),b=0;b<S;++b)E=i[b],E.fx==null?E.x+=E.vx*=l:(E.x=E.fx,E.vx=0),t>1&&(E.fy==null?E.y+=E.vy*=l:(E.y=E.fy,E.vy=0)),t>2&&(E.fz==null?E.z+=E.vz*=l:(E.z=E.fz,E.vz=0));return n}function x(){for(var g=0,b=i.length,S;g<b;++g){if(S=i[g],S.index=g,S.fx!=null&&(S.x=S.fx),S.fy!=null&&(S.y=S.fy),S.fz!=null&&(S.z=S.fz),isNaN(S.x)||t>1&&isNaN(S.y)||t>2&&isNaN(S.z)){var E=Xk*(t>2?Math.cbrt(.5+g):t>1?Math.sqrt(.5+g):g),w=g*jk,T=g*qk;t===1?S.x=E:t===2?(S.x=E*Math.cos(w),S.y=E*Math.sin(w)):(S.x=E*Math.sin(w)*Math.cos(T),S.y=E*Math.cos(w),S.z=E*Math.sin(w)*Math.sin(T))}(isNaN(S.vx)||t>1&&isNaN(S.vy)||t>2&&isNaN(S.vz))&&(S.vx=0,t>1&&(S.vy=0),t>2&&(S.vz=0))}}function _(g){return g.initialize&&g.initialize(i,p,t),g}return x(),n={tick:v,restart:function(){return f.restart(m),n},stop:function(){return f.stop(),n},numDimensions:function(g){return arguments.length?(t=Math.min(iw,Math.max(1,Math.round(g))),c.forEach(_),n):t},nodes:function(g){return arguments.length?(i=g,x(),c.forEach(_),n):i},alpha:function(g){return arguments.length?(r=+g,n):r},alphaMin:function(g){return arguments.length?(s=+g,n):s},alphaDecay:function(g){return arguments.length?(a=+g,n):+a},alphaTarget:function(g){return arguments.length?(o=+g,n):o},velocityDecay:function(g){return arguments.length?(l=1-g,n):1-l},randomSource:function(g){return arguments.length?(p=g,c.forEach(_),n):p},force:function(g,b){return arguments.length>1?(b==null?c.delete(g):c.set(g,_(b)),n):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),b=g.shift()||0,S=(t>1?g.shift():null)||0,E=(t>2?g.shift():null)||0,w=g.shift()||1/0,T=0,C=i.length,U,D,R,I,z,O;for(w*=w,T=0;T<C;++T)z=i[T],U=b-z.x,D=S-(z.y||0),R=E-(z.z||0),I=U*U+D*D+R*R,I<w&&(O=z,w=I);return O},on:function(g,b){return arguments.length>1?(d.on(g,b),n):d.on(g)}}}function eR(){var i,e,t,n,r,s=wn(-30),a,o=1,l=1/0,c=.81;function f(v){var x,_=i.length,g=(e===1?T1(i,Wy):e===2?C1(i,Wy,rw):e===3?D1(i,Wy,rw,Wk):null).visitAfter(p);for(r=v,x=0;x<_;++x)t=i[x],g.visit(m)}function d(){if(i){var v,x=i.length,_;for(a=new Array(x),v=0;v<x;++v)_=i[v],a[_.index]=+s(_,v,i)}}function p(v){var x=0,_,g,b=0,S,E,w,T,C=v.length;if(C){for(S=E=w=T=0;T<C;++T)(_=v[T])&&(g=Math.abs(_.value))&&(x+=_.value,b+=g,S+=g*(_.x||0),E+=g*(_.y||0),w+=g*(_.z||0));x*=Math.sqrt(4/C),v.x=S/b,e>1&&(v.y=E/b),e>2&&(v.z=w/b)}else{_=v,_.x=_.data.x,e>1&&(_.y=_.data.y),e>2&&(_.z=_.data.z);do x+=a[_.data.index];while(_=_.next)}v.value=x}function m(v,x,_,g,b){if(!v.value)return!0;var S=[_,g,b][e-1],E=v.x-t.x,w=e>1?v.y-t.y:0,T=e>2?v.z-t.z:0,C=S-x,U=E*E+w*w+T*T;if(C*C/c<U)return U<l&&(E===0&&(E=Ir(n),U+=E*E),e>1&&w===0&&(w=Ir(n),U+=w*w),e>2&&T===0&&(T=Ir(n),U+=T*T),U<o&&(U=Math.sqrt(o*U)),t.vx+=E*v.value*r/U,e>1&&(t.vy+=w*v.value*r/U),e>2&&(t.vz+=T*v.value*r/U)),!0;if(v.length||U>=l)return;(v.data!==t||v.next)&&(E===0&&(E=Ir(n),U+=E*E),e>1&&w===0&&(w=Ir(n),U+=w*w),e>2&&T===0&&(T=Ir(n),U+=T*T),U<o&&(U=Math.sqrt(o*U)));do v.data!==t&&(C=a[v.data.index]*r/U,t.vx+=E*C,e>1&&(t.vy+=w*C),e>2&&(t.vz+=T*C));while(v=v.next)}return f.initialize=function(v,...x){i=v,n=x.find(_=>typeof _=="function")||Math.random,e=x.find(_=>[1,2,3].includes(_))||2,d()},f.strength=function(v){return arguments.length?(s=typeof v=="function"?v:wn(+v),d(),f):s},f.distanceMin=function(v){return arguments.length?(o=v*v,f):Math.sqrt(o)},f.distanceMax=function(v){return arguments.length?(l=v*v,f):Math.sqrt(l)},f.theta=function(v){return arguments.length?(c=v*v,f):Math.sqrt(c)},f}function Yk(i,e,t,n){var r,s,a=wn(.1),o,l;typeof i!="function"&&(i=wn(+i)),e==null&&(e=0),t==null&&(t=0),n==null&&(n=0);function c(d){for(var p=0,m=r.length;p<m;++p){var v=r[p],x=v.x-e||1e-6,_=(v.y||0)-t||1e-6,g=(v.z||0)-n||1e-6,b=Math.sqrt(x*x+_*_+g*g),S=(l[p]-b)*o[p]*d/b;v.vx+=x*S,s>1&&(v.vy+=_*S),s>2&&(v.vz+=g*S)}}function f(){if(r){var d,p=r.length;for(o=new Array(p),l=new Array(p),d=0;d<p;++d)l[d]=+i(r[d],d,r),o[d]=isNaN(l[d])?0:+a(r[d],d,r)}}return c.initialize=function(d,...p){r=d,s=p.find(m=>[1,2,3].includes(m))||2,f()},c.strength=function(d){return arguments.length?(a=typeof d=="function"?d:wn(+d),f(),c):a},c.radius=function(d){return arguments.length?(i=typeof d=="function"?d:wn(+d),f(),c):i},c.x=function(d){return arguments.length?(e=+d,c):e},c.y=function(d){return arguments.length?(t=+d,c):t},c.z=function(d){return arguments.length?(n=+d,c):n},c}function cx(i){var e=wn(.1),t,n,r;typeof i!="function"&&(i=wn(i==null?0:+i));function s(o){for(var l=0,c=t.length,f;l<c;++l)f=t[l],f.vx+=(r[l]-f.x)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:wn(+o),a(),s):e},s.x=function(o){return arguments.length?(i=typeof o=="function"?o:wn(+o),a(),s):i},s}function ux(i){var e=wn(.1),t,n,r;typeof i!="function"&&(i=wn(i==null?0:+i));function s(o){for(var l=0,c=t.length,f;l<c;++l)f=t[l],f.vy+=(r[l]-f.y)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:wn(+o),a(),s):e},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:wn(+o),a(),s):i},s}function Zk(i){var e=wn(.1),t,n,r;typeof i!="function"&&(i=wn(i==null?0:+i));function s(o){for(var l=0,c=t.length,f;l<c;++l)f=t[l],f.vz+=(r[l]-f.z)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:wn(+o),a(),s):e},s.z=function(o){return arguments.length?(i=typeof o=="function"?o:wn(+o),a(),s):i},s}function Kk(i){var e=0,t=i.children,n=t&&t.length;if(!n)e=1;else for(;--n>=0;)e+=t[n].value;i.value=e}function Jk(){return this.eachAfter(Kk)}function Qk(i,e){let t=-1;for(const n of this)i.call(e,n,++t,this);return this}function $k(i,e){for(var t=this,n=[t],r,s,a=-1;t=n.pop();)if(i.call(e,t,++a,this),r=t.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function eG(i,e){for(var t=this,n=[t],r=[],s,a,o,l=-1;t=n.pop();)if(r.push(t),s=t.children)for(a=0,o=s.length;a<o;++a)n.push(s[a]);for(;t=r.pop();)i.call(e,t,++l,this);return this}function tG(i,e){let t=-1;for(const n of this)if(i.call(e,n,++t,this))return n}function nG(i){return this.eachAfter(function(e){for(var t=+i(e.data)||0,n=e.children,r=n&&n.length;--r>=0;)t+=n[r].value;e.value=t})}function iG(i){return this.eachBefore(function(e){e.children&&e.children.sort(i)})}function rG(i){for(var e=this,t=sG(e,i),n=[e];e!==t;)e=e.parent,n.push(e);for(var r=n.length;i!==t;)n.splice(r,0,i),i=i.parent;return n}function sG(i,e){if(i===e)return i;var t=i.ancestors(),n=e.ancestors(),r=null;for(i=t.pop(),e=n.pop();i===e;)r=i,i=t.pop(),e=n.pop();return r}function aG(){for(var i=this,e=[i];i=i.parent;)e.push(i);return e}function oG(){return Array.from(this)}function lG(){var i=[];return this.eachBefore(function(e){e.children||i.push(e)}),i}function cG(){var i=this,e=[];return i.each(function(t){t!==i&&e.push({source:t.parent,target:t})}),e}function*uG(){var i=this,e,t=[i],n,r,s;do for(e=t.reverse(),t=[];i=e.pop();)if(yield i,n=i.children)for(r=0,s=n.length;r<s;++r)t.push(n[r]);while(t.length)}function l0(i,e){i instanceof Map?(i=[void 0,i],e===void 0&&(e=dG)):e===void 0&&(e=fG);for(var t=new vu(i),n,r=[t],s,a,o,l;n=r.pop();)if((a=e(n.data))&&(l=(a=Array.from(a)).length))for(n.children=a,o=l-1;o>=0;--o)r.push(s=a[o]=new vu(a[o])),s.parent=n,s.depth=n.depth+1;return t.eachBefore(tR)}function hG(){return l0(this).eachBefore(pG)}function fG(i){return i.children}function dG(i){return Array.isArray(i)?i[1]:null}function pG(i){i.data.value!==void 0&&(i.value=i.data.value),i.data=i.data.data}function tR(i){var e=0;do i.height=e;while((i=i.parent)&&i.height<++e)}function vu(i){this.data=i,this.depth=this.height=0,this.parent=null}vu.prototype=l0.prototype={constructor:vu,count:Jk,each:Qk,eachAfter:eG,eachBefore:$k,find:tG,sum:nG,sort:iG,path:rG,ancestors:aG,descendants:oG,leaves:lG,links:cG,copy:hG,[Symbol.iterator]:uG};function Xy(i){return i==null?null:nR(i)}function nR(i){if(typeof i!="function")throw new Error;return i}function Mh(){return 0}function wh(i){return function(){return i}}function mG(i){i.x0=Math.round(i.x0),i.y0=Math.round(i.y0),i.x1=Math.round(i.x1),i.y1=Math.round(i.y1)}function gG(i,e,t,n,r){for(var s=i.children,a,o=-1,l=s.length,c=i.value&&(n-e)/i.value;++o<l;)a=s[o],a.y0=t,a.y1=r,a.x0=e,a.x1=e+=a.value*c}var vG={depth:-1},sw={},jy={};function yG(i){return i.id}function _G(i){return i.parentId}function xG(){var i=yG,e=_G,t;function n(r){var s=Array.from(r),a=i,o=e,l,c,f,d,p,m,v,x,_=new Map;if(t!=null){const g=s.map((E,w)=>bG(t(E,w,r))),b=g.map(aw),S=new Set(g).add("");for(const E of b)S.has(E)||(S.add(E),g.push(E),b.push(aw(E)),s.push(jy));a=(E,w)=>g[w],o=(E,w)=>b[w]}for(f=0,l=s.length;f<l;++f)c=s[f],m=s[f]=new vu(c),(v=a(c,f,r))!=null&&(v+="")&&(x=m.id=v,_.set(x,_.has(x)?sw:m)),(v=o(c,f,r))!=null&&(v+="")&&(m.parent=v);for(f=0;f<l;++f)if(m=s[f],v=m.parent){if(p=_.get(v),!p)throw new Error("missing: "+v);if(p===sw)throw new Error("ambiguous: "+v);p.children?p.children.push(m):p.children=[m],m.parent=p}else{if(d)throw new Error("multiple roots");d=m}if(!d)throw new Error("no root");if(t!=null){for(;d.data===jy&&d.children.length===1;)d=d.children[0],--l;for(let g=s.length-1;g>=0&&(m=s[g],m.data===jy);--g)m.data=null}if(d.parent=vG,d.eachBefore(function(g){g.depth=g.parent.depth+1,--l}).eachBefore(tR),d.parent=null,l>0)throw new Error("cycle");return d}return n.id=function(r){return arguments.length?(i=Xy(r),n):i},n.parentId=function(r){return arguments.length?(e=Xy(r),n):e},n.path=function(r){return arguments.length?(t=Xy(r),n):t},n}function bG(i){i=`${i}`;let e=i.length;return hx(i,e-1)&&!hx(i,e-2)&&(i=i.slice(0,-1)),i[0]==="/"?i:`/${i}`}function aw(i){let e=i.length;if(e<2)return"";for(;--e>1&&!hx(i,e););return i.slice(0,e)}function hx(i,e){if(i[e]==="/"){let t=0;for(;e>0&&i[--e]==="\\";)++t;if((t&1)===0)return!0}return!1}function SG(i,e){return i.parent===e.parent?1:2}function qy(i){var e=i.children;return e?e[0]:i.t}function Yy(i){var e=i.children;return e?e[e.length-1]:i.t}function EG(i,e,t){var n=t/(e.i-i.i);e.c-=n,e.s+=t,i.c+=n,e.z+=t,e.m+=t}function MG(i){for(var e=0,t=0,n=i.children,r=n.length,s;--r>=0;)s=n[r],s.z+=e,s.m+=e,e+=s.s+(t+=s.c)}function wG(i,e,t){return i.a.parent===e.parent?i.a:t}function cm(i,e){this._=i,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}cm.prototype=Object.create(vu.prototype);function TG(i){for(var e=new cm(i,0),t,n=[e],r,s,a,o;t=n.pop();)if(s=t._.children)for(t.children=new Array(o=s.length),a=o-1;a>=0;--a)n.push(r=t.children[a]=new cm(s[a],a)),r.parent=t;return(e.parent=new cm(null,0)).children=[e],e}function AG(){var i=SG,e=1,t=1,n=null;function r(c){var f=TG(c);if(f.eachAfter(s),f.parent.m=-f.z,f.eachBefore(a),n)c.eachBefore(l);else{var d=c,p=c,m=c;c.eachBefore(function(b){b.x<d.x&&(d=b),b.x>p.x&&(p=b),b.depth>m.depth&&(m=b)});var v=d===p?1:i(d,p)/2,x=v-d.x,_=e/(p.x+v+x),g=t/(m.depth||1);c.eachBefore(function(b){b.x=(b.x+x)*_,b.y=b.depth*g})}return c}function s(c){var f=c.children,d=c.parent.children,p=c.i?d[c.i-1]:null;if(f){MG(c);var m=(f[0].z+f[f.length-1].z)/2;p?(c.z=p.z+i(c._,p._),c.m=c.z-m):c.z=m}else p&&(c.z=p.z+i(c._,p._));c.parent.A=o(c,p,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,f,d){if(f){for(var p=c,m=c,v=f,x=p.parent.children[0],_=p.m,g=m.m,b=v.m,S=x.m,E;v=Yy(v),p=qy(p),v&&p;)x=qy(x),m=Yy(m),m.a=c,E=v.z+b-p.z-_+i(v._,p._),E>0&&(EG(wG(v,c,d),c,E),_+=E,g+=E),b+=v.m,_+=p.m,S+=x.m,g+=m.m;v&&!Yy(m)&&(m.t=v,m.m+=b-g),p&&!qy(x)&&(x.t=p,x.m+=_-S,d=c)}return d}function l(c){c.x*=e,c.y=c.depth*t}return r.separation=function(c){return arguments.length?(i=c,r):i},r.size=function(c){return arguments.length?(n=!1,e=+c[0],t=+c[1],r):n?null:[e,t]},r.nodeSize=function(c){return arguments.length?(n=!0,e=+c[0],t=+c[1],r):n?[e,t]:null},r}function CG(i,e,t,n,r){for(var s=i.children,a,o=-1,l=s.length,c=i.value&&(r-t)/i.value;++o<l;)a=s[o],a.x0=e,a.x1=n,a.y0=t,a.y1=t+=a.value*c}var RG=(1+Math.sqrt(5))/2;function DG(i,e,t,n,r,s){for(var a=[],o=e.children,l,c,f=0,d=0,p=o.length,m,v,x=e.value,_,g,b,S,E,w,T;f<p;){m=r-t,v=s-n;do _=o[d++].value;while(!_&&d<p);for(g=b=_,w=Math.max(v/m,m/v)/(x*i),T=_*_*w,E=Math.max(b/T,T/g);d<p;++d){if(_+=c=o[d].value,c<g&&(g=c),c>b&&(b=c),T=_*_*w,S=Math.max(b/T,T/g),S>E){_-=c;break}E=S}a.push(l={value:_,dice:m<v,children:o.slice(f,d)}),l.dice?gG(l,t,n,r,x?n+=v*_/x:s):CG(l,t,n,x?t+=m*_/x:r,s),x-=_,f=d}return a}const UG=function i(e){function t(n,r,s,a,o){DG(e,n,r,s,a,o)}return t.ratio=function(n){return i((n=+n)>1?n:1)},t}(RG);function OG(){var i=UG,e=!1,t=1,n=1,r=[0],s=Mh,a=Mh,o=Mh,l=Mh,c=Mh;function f(p){return p.x0=p.y0=0,p.x1=t,p.y1=n,p.eachBefore(d),r=[0],e&&p.eachBefore(mG),p}function d(p){var m=r[p.depth],v=p.x0+m,x=p.y0+m,_=p.x1-m,g=p.y1-m;_<v&&(v=_=(v+_)/2),g<x&&(x=g=(x+g)/2),p.x0=v,p.y0=x,p.x1=_,p.y1=g,p.children&&(m=r[p.depth+1]=s(p)/2,v+=c(p)-m,x+=a(p)-m,_-=o(p)-m,g-=l(p)-m,_<v&&(v=_=(v+_)/2),g<x&&(x=g=(x+g)/2),i(p,v,x,_,g))}return f.round=function(p){return arguments.length?(e=!!p,f):e},f.size=function(p){return arguments.length?(t=+p[0],n=+p[1],f):[t,n]},f.tile=function(p){return arguments.length?(i=nR(p),f):i},f.padding=function(p){return arguments.length?f.paddingInner(p).paddingOuter(p):f.paddingInner()},f.paddingInner=function(p){return arguments.length?(s=typeof p=="function"?p:wh(+p),f):s},f.paddingOuter=function(p){return arguments.length?f.paddingTop(p).paddingRight(p).paddingBottom(p).paddingLeft(p):f.paddingTop()},f.paddingTop=function(p){return arguments.length?(a=typeof p=="function"?p:wh(+p),f):a},f.paddingRight=function(p){return arguments.length?(o=typeof p=="function"?p:wh(+p),f):o},f.paddingBottom=function(p){return arguments.length?(l=typeof p=="function"?p:wh(+p),f):l},f.paddingLeft=function(p){return arguments.length?(c=typeof p=="function"?p:wh(+p),f):c},f}var Zy,ow;function O1(){if(ow)return Zy;ow=1;function i(t){return!t||typeof t!="object"||typeof t=="function"||Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof RegExp||t instanceof Date}function e(t,n){t=t||{};var r={};for(var s in n){var a=t[s],o=n[s];if(!i(o)){r[s]=e(a,o);continue}a===void 0?r[s]=o:r[s]=a}return r}return Zy=e,Zy}var Ky,lw;function Aa(){return lw||(lw=1,Ky=function(e){return e!==null&&typeof e=="object"&&typeof e.addUndirectedEdgeWithKey=="function"&&typeof e.dropNode=="function"&&typeof e.multi=="boolean"}),Ky}var Jy,cw;function LG(){if(cw)return Jy;cw=1;var i=O1(),e=Aa(),t={dimensions:["x","y"],center:.5,scale:1};function n(s,a,o){if(!e(a))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");o=i(o,t);var l=o.dimensions;if(!Array.isArray(l)||l.length!==2)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=o.center,f=o.scale,d=Math.PI*2,p=(c-.5)*f,m=a.order,v=l[0],x=l[1];function _(S,E){return E[v]=f*Math.cos(S*d/m)+p,E[x]=f*Math.sin(S*d/m)+p,E}var g=0;if(!s){var b={};return a.forEachNode(function(S){b[S]=_(g++,{})}),b}a.updateEachNodeAttributes(function(S,E){return _(g++,E),E},{attributes:l})}var r=n.bind(null,!1);return r.assign=n.bind(null,!0),Jy=r,Jy}var NG=LG();const IG=vo(NG);var Qy,uw;function PG(){if(uw)return Qy;uw=1;var i=0,e=1,t=2,n=3;function r(a,o){return a+"§"+o}function s(){return .01*(.5-Math.random())}return Qy=function(o,l){var c=o.margin,f=o.ratio,d=o.expansion,p=o.gridSize,m=o.speed,v,x,_,g,b,S,E=!0,w=l.length,T=w/n|0,C=new Float32Array(T),U=new Float32Array(T),D=1/0,R=1/0,I=-1/0,z=-1/0;for(v=0;v<w;v+=n)_=l[v+i],g=l[v+e],S=l[v+t]*f+c,D=Math.min(D,_-S),I=Math.max(I,_+S),R=Math.min(R,g-S),z=Math.max(z,g+S);var O=I-D,V=z-R,ee=(D+I)/2,P=(R+z)/2;D=ee-d*O/2,I=ee+d*O/2,R=P-d*V/2,z=P+d*V/2;var L=new Array(p*p),k=L.length,H;for(H=0;H<k;H++)L[H]=[];var W,F,Y,K,j,J,he,re,pe,Oe;for(v=0;v<w;v+=n)for(_=l[v+i],g=l[v+e],S=l[v+t]*f+c,W=_-S,F=_+S,Y=g-S,K=g+S,j=Math.floor(p*(W-D)/(I-D)),J=Math.floor(p*(F-D)/(I-D)),he=Math.floor(p*(Y-R)/(z-R)),re=Math.floor(p*(K-R)/(z-R)),pe=j;pe<=J;pe++)for(Oe=he;Oe<=re;Oe++)L[pe*p+Oe].push(v);var be,ve=new Set,ce,Ne,G,le,te,Me,oe,De,_e,ne,Be,X,B;for(H=0;H<k;H++)for(be=L[H],v=0,b=be.length;v<b;v++)for(ce=be[v],G=l[ce+i],te=l[ce+e],oe=l[ce+t],x=v+1;x<b;x++)Ne=be[x],_e=r(ce,Ne),!(k>1&&ve.has(_e))&&(k>1&&ve.add(_e),le=l[Ne+i],Me=l[Ne+e],De=l[Ne+t],ne=le-G,Be=Me-te,X=Math.sqrt(ne*ne+Be*Be),B=X<oe*f+c+(De*f+c),B&&(E=!1,Ne=Ne/n|0,X>0?(C[Ne]+=ne/X*(1+oe),U[Ne]+=Be/X*(1+oe)):(C[Ne]+=O*s(),U[Ne]+=V*s())));for(v=0,x=0;v<w;v+=n,x++)l[v+i]+=C[x]*.1*m,l[v+e]+=U[x]*.1*m;return{converged:E}},Qy}var ll={},hw;function zG(){if(hw)return ll;hw=1;var i=3;return ll.validateSettings=function(e){return"gridSize"in e&&typeof e.gridSize!="number"||e.gridSize<=0?{message:"the `gridSize` setting should be a positive number."}:"margin"in e&&typeof e.margin!="number"||e.margin<0?{message:"the `margin` setting should be 0 or a positive number."}:"expansion"in e&&typeof e.expansion!="number"||e.expansion<=0?{message:"the `expansion` setting should be a positive number."}:"ratio"in e&&typeof e.ratio!="number"||e.ratio<=0?{message:"the `ratio` setting should be a positive number."}:"speed"in e&&typeof e.speed!="number"||e.speed<=0?{message:"the `speed` setting should be a positive number."}:null},ll.graphToByteArray=function(e,t){var n=e.order,r=new Float32Array(n*i),s=0;return e.forEachNode(function(a,o){typeof t=="function"&&(o=t(a,o)),r[s]=o.x,r[s+1]=o.y,r[s+2]=o.size||1,s+=i}),r},ll.assignLayoutChanges=function(e,t,n){var r=0;e.forEachNode(function(s){var a={x:t[r],y:t[r+1]};typeof n=="function"&&(a=n(s,a)),e.mergeNodeAttributes(s,a),r+=i})},ll.collectLayoutChanges=function(e,t,n){var r={},s=0;return e.forEachNode(function(a){var o={x:t[s],y:t[s+1]};typeof n=="function"&&(o=n(a,o)),r[a]=o,s+=i}),r},ll.createWorker=function(t){var n=window.URL||window.webkitURL,r=t.toString(),s=n.createObjectURL(new Blob(["("+r+").call(this);"],{type:"text/javascript"})),a=new Worker(s);return n.revokeObjectURL(s),a},ll}var $y,fw;function FG(){return fw||(fw=1,$y={gridSize:20,margin:5,expansion:1.1,ratio:1,speed:3}),$y}var e_,dw;function BG(){if(dw)return e_;dw=1;var i=Aa(),e=PG(),t=zG(),n=FG(),r=500;function s(o,l,c){if(!i(l))throw new Error("graphology-layout-noverlap: the given graph is not a valid graphology instance.");typeof c=="number"?c={maxIterations:c}:c=c||{};var f=c.maxIterations||r;if(typeof f!="number"||f<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");var d=Object.assign({},n,c.settings),p=t.validateSettings(d);if(p)throw new Error("graphology-layout-noverlap: "+p.message);var m=t.graphToByteArray(l,c.inputReducer),v=!1,x;for(x=0;x<f&&!v;x++)v=e(d,m).converged;if(o){t.assignLayoutChanges(l,m,c.outputReducer);return}return t.collectLayoutChanges(l,m,c.outputReducer)}var a=s.bind(null,!1);return a.assign=s.bind(null,!0),e_=a,e_}var kG=BG();const GG=vo(kG);var Th={},pw;function c0(){if(pw)return Th;pw=1;function i(n){return typeof n!="number"||isNaN(n)?1:n}function e(n,r){var s={},a=function(c){return typeof c>"u"?r:c};typeof r=="function"&&(a=r);var o=function(c){return a(c[n])},l=function(){return a(void 0)};return typeof n=="string"?(s.fromAttributes=o,s.fromGraph=function(c,f){return o(c.getNodeAttributes(f))},s.fromEntry=function(c,f){return o(f)}):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(c,f){return a(n(f,c.getNodeAttributes(f)))},s.fromEntry=function(c,f){return a(n(c,f))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l),s}function t(n,r){var s={},a=function(c){return typeof c>"u"?r:c};typeof r=="function"&&(a=r);var o=function(c){return a(c[n])},l=function(){return a(void 0)};return typeof n=="string"?(s.fromAttributes=o,s.fromGraph=function(c,f){return o(c.getEdgeAttributes(f))},s.fromEntry=function(c,f){return o(f)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(c,f){var d=c.extremities(f);return a(n(f,c.getEdgeAttributes(f),d[0],d[1],c.getNodeAttributes(d[0]),c.getNodeAttributes(d[1]),c.isUndirected(f)))},s.fromEntry=function(c,f,d,p,m,v,x){return a(n(c,f,d,p,m,v,x))},s.fromPartialEntry=function(c,f,d,p){return a(n(c,f,d,p))},s.fromMinimalEntry=function(c,f){return a(n(c,f))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l,s.fromMinimalEntry=l),s}return Th.createNodeValueGetter=e,Th.createEdgeValueGetter=t,Th.createEdgeWeightGetter=function(n){return t(n,i)},Th}var t_,mw;function HG(){if(mw)return t_;mw=1;var i=0,e=1,t=2,n=3,r=4,s=5,a=6,o=7,l=8,c=9,f=0,d=1,p=2,m=0,v=1,x=2,_=3,g=4,b=5,S=6,E=7,w=8,T=3,C=10,U=3,D=9,R=10;return t_=function(z,O,V){var ee,P,L,k,H,W,F,Y,K,j,J=O.length,he=V.length,re=z.adjustSizes,pe=z.barnesHutTheta*z.barnesHutTheta,Oe,be,ve,ce,Ne,G,le,te=[];for(L=0;L<J;L+=C)O[L+r]=O[L+t],O[L+s]=O[L+n],O[L+t]=0,O[L+n]=0;if(z.outboundAttractionDistribution){for(Oe=0,L=0;L<J;L+=C)Oe+=O[L+a];Oe/=J/C}if(z.barnesHutOptimize){var Me=1/0,oe=-1/0,De=1/0,_e=-1/0,ne,Be,X;for(L=0;L<J;L+=C)Me=Math.min(Me,O[L+i]),oe=Math.max(oe,O[L+i]),De=Math.min(De,O[L+e]),_e=Math.max(_e,O[L+e]);var B=oe-Me,ie=_e-De;for(B>ie?(De-=(B-ie)/2,_e=De+B):(Me-=(ie-B)/2,oe=Me+ie),te[0+m]=-1,te[0+v]=(Me+oe)/2,te[0+x]=(De+_e)/2,te[0+_]=Math.max(oe-Me,_e-De),te[0+g]=-1,te[0+b]=-1,te[0+S]=0,te[0+E]=0,te[0+w]=0,ee=1,L=0;L<J;L+=C)for(P=0,X=T;;)if(te[P+b]>=0){O[L+i]<te[P+v]?O[L+e]<te[P+x]?ne=te[P+b]:ne=te[P+b]+D:O[L+e]<te[P+x]?ne=te[P+b]+D*2:ne=te[P+b]+D*3,te[P+E]=(te[P+E]*te[P+S]+O[L+i]*O[L+a])/(te[P+S]+O[L+a]),te[P+w]=(te[P+w]*te[P+S]+O[L+e]*O[L+a])/(te[P+S]+O[L+a]),te[P+S]+=O[L+a],P=ne;continue}else if(te[P+m]<0){te[P+m]=L;break}else{if(te[P+b]=ee*D,Y=te[P+_]/2,K=te[P+b],te[K+m]=-1,te[K+v]=te[P+v]-Y,te[K+x]=te[P+x]-Y,te[K+_]=Y,te[K+g]=K+D,te[K+b]=-1,te[K+S]=0,te[K+E]=0,te[K+w]=0,K+=D,te[K+m]=-1,te[K+v]=te[P+v]-Y,te[K+x]=te[P+x]+Y,te[K+_]=Y,te[K+g]=K+D,te[K+b]=-1,te[K+S]=0,te[K+E]=0,te[K+w]=0,K+=D,te[K+m]=-1,te[K+v]=te[P+v]+Y,te[K+x]=te[P+x]-Y,te[K+_]=Y,te[K+g]=K+D,te[K+b]=-1,te[K+S]=0,te[K+E]=0,te[K+w]=0,K+=D,te[K+m]=-1,te[K+v]=te[P+v]+Y,te[K+x]=te[P+x]+Y,te[K+_]=Y,te[K+g]=te[P+g],te[K+b]=-1,te[K+S]=0,te[K+E]=0,te[K+w]=0,ee+=4,O[te[P+m]+i]<te[P+v]?O[te[P+m]+e]<te[P+x]?ne=te[P+b]:ne=te[P+b]+D:O[te[P+m]+e]<te[P+x]?ne=te[P+b]+D*2:ne=te[P+b]+D*3,te[P+S]=O[te[P+m]+a],te[P+E]=O[te[P+m]+i],te[P+w]=O[te[P+m]+e],te[ne+m]=te[P+m],te[P+m]=-1,O[L+i]<te[P+v]?O[L+e]<te[P+x]?Be=te[P+b]:Be=te[P+b]+D:O[L+e]<te[P+x]?Be=te[P+b]+D*2:Be=te[P+b]+D*3,ne===Be)if(X--){P=ne;continue}else{X=T;break}te[Be+m]=L;break}}if(z.barnesHutOptimize)for(be=z.scalingRatio,L=0;L<J;L+=C)for(P=0;;)if(te[P+b]>=0)if(G=Math.pow(O[L+i]-te[P+E],2)+Math.pow(O[L+e]-te[P+w],2),j=te[P+_],4*j*j/G<pe){if(ve=O[L+i]-te[P+E],ce=O[L+e]-te[P+w],re===!0?G>0?(le=be*O[L+a]*te[P+S]/G,O[L+t]+=ve*le,O[L+n]+=ce*le):G<0&&(le=-be*O[L+a]*te[P+S]/Math.sqrt(G),O[L+t]+=ve*le,O[L+n]+=ce*le):G>0&&(le=be*O[L+a]*te[P+S]/G,O[L+t]+=ve*le,O[L+n]+=ce*le),P=te[P+g],P<0)break;continue}else{P=te[P+b];continue}else{if(W=te[P+m],W>=0&&W!==L&&(ve=O[L+i]-O[W+i],ce=O[L+e]-O[W+e],G=ve*ve+ce*ce,re===!0?G>0?(le=be*O[L+a]*O[W+a]/G,O[L+t]+=ve*le,O[L+n]+=ce*le):G<0&&(le=-be*O[L+a]*O[W+a]/Math.sqrt(G),O[L+t]+=ve*le,O[L+n]+=ce*le):G>0&&(le=be*O[L+a]*O[W+a]/G,O[L+t]+=ve*le,O[L+n]+=ce*le)),P=te[P+g],P<0)break;continue}else for(be=z.scalingRatio,k=0;k<J;k+=C)for(H=0;H<k;H+=C)ve=O[k+i]-O[H+i],ce=O[k+e]-O[H+e],re===!0?(G=Math.sqrt(ve*ve+ce*ce)-O[k+l]-O[H+l],G>0?(le=be*O[k+a]*O[H+a]/G/G,O[k+t]+=ve*le,O[k+n]+=ce*le,O[H+t]-=ve*le,O[H+n]-=ce*le):G<0&&(le=100*be*O[k+a]*O[H+a],O[k+t]+=ve*le,O[k+n]+=ce*le,O[H+t]-=ve*le,O[H+n]-=ce*le)):(G=Math.sqrt(ve*ve+ce*ce),G>0&&(le=be*O[k+a]*O[H+a]/G/G,O[k+t]+=ve*le,O[k+n]+=ce*le,O[H+t]-=ve*le,O[H+n]-=ce*le));for(K=z.gravity/z.scalingRatio,be=z.scalingRatio,L=0;L<J;L+=C)le=0,ve=O[L+i],ce=O[L+e],G=Math.sqrt(Math.pow(ve,2)+Math.pow(ce,2)),z.strongGravityMode?G>0&&(le=be*O[L+a]*K):G>0&&(le=be*O[L+a]*K/G),O[L+t]-=ve*le,O[L+n]-=ce*le;for(be=1*(z.outboundAttractionDistribution?Oe:1),F=0;F<he;F+=U)k=V[F+f],H=V[F+d],Y=V[F+p],Ne=Math.pow(Y,z.edgeWeightInfluence),ve=O[k+i]-O[H+i],ce=O[k+e]-O[H+e],re===!0?(G=Math.sqrt(ve*ve+ce*ce)-O[k+l]-O[H+l],z.linLogMode?z.outboundAttractionDistribution?G>0&&(le=-be*Ne*Math.log(1+G)/G/O[k+a]):G>0&&(le=-be*Ne*Math.log(1+G)/G):z.outboundAttractionDistribution?G>0&&(le=-be*Ne/O[k+a]):G>0&&(le=-be*Ne)):(G=Math.sqrt(Math.pow(ve,2)+Math.pow(ce,2)),z.linLogMode?z.outboundAttractionDistribution?G>0&&(le=-be*Ne*Math.log(1+G)/G/O[k+a]):G>0&&(le=-be*Ne*Math.log(1+G)/G):z.outboundAttractionDistribution?(G=1,le=-be*Ne/O[k+a]):(G=1,le=-be*Ne)),G>0&&(O[k+t]+=ve*le,O[k+n]+=ce*le,O[H+t]-=ve*le,O[H+n]-=ce*le);var Se,ge,me,Fe,Ie,je;if(re===!0)for(L=0;L<J;L+=C)O[L+c]!==1&&(Se=Math.sqrt(Math.pow(O[L+t],2)+Math.pow(O[L+n],2)),Se>R&&(O[L+t]=O[L+t]*R/Se,O[L+n]=O[L+n]*R/Se),ge=O[L+a]*Math.sqrt((O[L+r]-O[L+t])*(O[L+r]-O[L+t])+(O[L+s]-O[L+n])*(O[L+s]-O[L+n])),me=Math.sqrt((O[L+r]+O[L+t])*(O[L+r]+O[L+t])+(O[L+s]+O[L+n])*(O[L+s]+O[L+n]))/2,Fe=.1*Math.log(1+me)/(1+Math.sqrt(ge)),Ie=O[L+i]+O[L+t]*(Fe/z.slowDown),O[L+i]=Ie,je=O[L+e]+O[L+n]*(Fe/z.slowDown),O[L+e]=je);else for(L=0;L<J;L+=C)O[L+c]!==1&&(ge=O[L+a]*Math.sqrt((O[L+r]-O[L+t])*(O[L+r]-O[L+t])+(O[L+s]-O[L+n])*(O[L+s]-O[L+n])),me=Math.sqrt((O[L+r]+O[L+t])*(O[L+r]+O[L+t])+(O[L+s]+O[L+n])*(O[L+s]+O[L+n]))/2,Fe=O[L+o]*Math.log(1+me)/(1+Math.sqrt(ge)),O[L+o]=Math.min(1,Math.sqrt(Fe*(Math.pow(O[L+t],2)+Math.pow(O[L+n],2))/(1+Math.sqrt(ge)))),Ie=O[L+i]+O[L+t]*(Fe/z.slowDown),O[L+i]=Ie,je=O[L+e]+O[L+n]*(Fe/z.slowDown),O[L+e]=je);return{}},t_}var sa={},gw;function VG(){if(gw)return sa;gw=1;var i=10,e=3;return sa.assign=function(t){t=t||{};var n=Array.prototype.slice.call(arguments).slice(1),r,s,a;for(r=0,a=n.length;r<a;r++)if(n[r])for(s in n[r])t[s]=n[r][s];return t},sa.validateSettings=function(t){return"linLogMode"in t&&typeof t.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in t&&typeof t.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in t&&typeof t.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in t&&typeof t.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in t&&!(typeof t.scalingRatio=="number"&&t.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},sa.graphToByteArrays=function(t,n){var r=t.order,s=t.size,a={},o,l=new Float32Array(r*i),c=new Float32Array(s*e);return o=0,t.forEachNode(function(f,d){a[f]=o,l[o]=d.x,l[o+1]=d.y,l[o+2]=0,l[o+3]=0,l[o+4]=0,l[o+5]=0,l[o+6]=1,l[o+7]=1,l[o+8]=d.size||1,l[o+9]=d.fixed?1:0,o+=i}),o=0,t.forEachEdge(function(f,d,p,m,v,x,_){var g=a[p],b=a[m],S=n(f,d,p,m,v,x,_);l[g+6]+=S,l[b+6]+=S,c[o]=g,c[o+1]=b,c[o+2]=S,o+=e}),{nodes:l,edges:c}},sa.assignLayoutChanges=function(t,n,r){var s=0;t.updateEachNodeAttributes(function(a,o){return o.x=n[s],o.y=n[s+1],s+=i,r?r(a,o):o})},sa.readGraphPositions=function(t,n){var r=0;t.forEachNode(function(s,a){n[r]=a.x,n[r+1]=a.y,r+=i})},sa.collectLayoutChanges=function(t,n,r){for(var s=t.nodes(),a={},o=0,l=0,c=n.length;o<c;o+=i){if(r){var f=Object.assign({},t.getNodeAttributes(s[l]));f.x=n[o],f.y=n[o+1],f=r(s[l],f),a[s[l]]={x:f.x,y:f.y}}else a[s[l]]={x:n[o],y:n[o+1]};l++}return a},sa.createWorker=function(n){var r=window.URL||window.webkitURL,s=n.toString(),a=r.createObjectURL(new Blob(["("+s+").call(this);"],{type:"text/javascript"})),o=new Worker(a);return r.revokeObjectURL(a),o},sa}var n_,vw;function WG(){return vw||(vw=1,n_={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),n_}var i_,yw;function XG(){if(yw)return i_;yw=1;var i=Aa(),e=c0().createEdgeWeightGetter,t=HG(),n=VG(),r=WG();function s(l,c,f){if(!i(c))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof f=="number"&&(f={iterations:f});var d=f.iterations;if(typeof d!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(d<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var p=e("getEdgeWeight"in f?f.getEdgeWeight:"weight").fromEntry,m=typeof f.outputReducer=="function"?f.outputReducer:null,v=n.assign({},r,f.settings),x=n.validateSettings(v);if(x)throw new Error("graphology-layout-forceatlas2: "+x.message);var _=n.graphToByteArrays(c,p),g;for(g=0;g<d;g++)t(v,_.nodes,_.edges);if(l){n.assignLayoutChanges(c,_.nodes,m);return}return n.collectLayoutChanges(c,_.nodes)}function a(l){var c=typeof l=="number"?l:l.order;return{barnesHutOptimize:c>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(c)}}var o=s.bind(null,!1);return o.assign=s.bind(null,!0),o.inferSettings=a,i_=o,i_}var jG=XG();const qG=vo(jG);var r_,_w;function YG(){if(_w)return r_;_w=1;var i=O1(),e=Aa(),t={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function n(s,a,o){if(!e(a))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");o=i(o,t);var l=o.dimensions;if(!Array.isArray(l)||l.length<1)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=l.length,f=o.center,d=o.rng,p=o.scale,m=(f-.5)*p;function v(_){for(var g=0;g<c;g++)_[l[g]]=d()*p+m;return _}if(!s){var x={};return a.forEachNode(function(_){x[_]=v({})}),x}a.updateEachNodeAttributes(function(_,g){return v(g),g},{attributes:l})}var r=n.bind(null,!1);return r.assign=n.bind(null,!0),r_=r,r_}var ZG=YG();const KG=vo(ZG);var zp={},s_={},xw;function iR(){return xw||(xw=1,function(i){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,n=Math.pow(2,32)-1,r=Math.pow(2,7)-1,s=Math.pow(2,15)-1,a=Math.pow(2,31)-1;i.getPointerArray=function(l){var c=l-1;if(c<=e)return Uint8Array;if(c<=t)return Uint16Array;if(c<=n)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},i.getSignedPointerArray=function(l){var c=l-1;return c<=r?Int8Array:c<=s?Int16Array:c<=a?Int32Array:Float64Array},i.getNumberType=function(l){return l===(l|0)?Math.sign(l)===-1?l<=127&&l>=-128?Int8Array:l<=32767&&l>=-32768?Int16Array:Int32Array:l<=255?Uint8Array:l<=65535?Uint16Array:Uint32Array:Float64Array};var o={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};i.getMinimalRepresentation=function(l,c){var f=null,d=0,p,m,v,x,_;for(x=0,_=l.length;x<_;x++)v=c?c(l[x]):l[x],m=i.getNumberType(v),p=o[m.name],p>d&&(d=p,f=m);return f},i.isTypedArray=function(l){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(l)},i.concat=function(){var l=0,c,f,d;for(c=0,d=arguments.length;c<d;c++)l+=arguments[c].length;var p=new arguments[0].constructor(l);for(c=0,f=0;c<d;c++)p.set(arguments[c],f),f+=arguments[c].length;return p},i.indices=function(l){for(var c=i.getPointerArray(l),f=new c(l),d=0;d<l;d++)f[d]=d;return f}}(s_)),s_}var bw;function JG(){if(bw)return zp;bw=1;var i=iR(),e=c0().createEdgeWeightGetter;function t(s,a){return s==="outbound"||s==="inbound"?a.directedSize+a.undirectedSize*2:s==="in"||s==="out"||s==="directed"?a.directedSize:a.undirectedSize*2}function n(s,a){a=a||"outbound";var o=s[a+"Neighbors"].bind(s),l=t(a,s),c=i.getPointerArray(l),f=i.getPointerArray(s.order);this.graph=s,this.neighborhood=new f(l),this.starts=new c(s.order+1),this.nodes=s.nodes();var d={},p,m,v,x,_,g,b=0;for(p=0,m=s.order;p<m;p++)d[this.nodes[p]]=p;for(p=0,m=s.order;p<m;p++)for(_=this.nodes[p],g=o(_),this.starts[p]=b,v=0,x=g.length;v<x;v++)this.neighborhood[b++]=d[g[v]];this.starts[p]=l}n.prototype.bounds=function(s){return[this.starts[s],this.starts[s+1]]},n.prototype.project=function(){var s=this,a={};return s.nodes.forEach(function(o,l){a[o]=Array.from(s.neighborhood.slice(s.starts[l],s.starts[l+1])).map(function(c){return s.nodes[c]})}),a},n.prototype.collect=function(s){var a,o,l={};for(a=0,o=s.length;a<o;a++)l[this.nodes[a]]=s[a];return l},n.prototype.assign=function(s,a){var o=0;this.graph.updateEachNodeAttributes(function(l,c){return c[s]=a[o++],c},{attributes:[s]})},zp.NeighborhoodIndex=n;function r(s,a,o){o=o||"outbound";var l=s[o+"Edges"].bind(s),c=t(o,s),f=i.getPointerArray(c),d=i.getPointerArray(s.order),p=e(a).fromMinimalEntry;this.graph=s,this.neighborhood=new d(c),this.weights=new Float64Array(c),this.outDegrees=new Float64Array(s.order),this.starts=new f(s.order+1),this.nodes=s.nodes();var m={},v,x,_,g,b,S,E,w,T,C=0;for(v=0,x=s.order;v<x;v++)m[this.nodes[v]]=v;for(v=0,x=s.order;v<x;v++)for(b=this.nodes[v],E=l(b),this.starts[v]=C,_=0,g=E.length;_<g;_++)w=E[_],S=s.opposite(b,w),T=p(w,s.getEdgeAttributes(w)),this.neighborhood[C]=m[S],this.weights[C++]=T,this.outDegrees[v]+=T;this.starts[v]=c}return r.prototype.bounds=n.prototype.bounds,r.prototype.project=n.prototype.project,r.prototype.collect=n.prototype.collect,r.prototype.assign=n.prototype.assign,zp.WeightedNeighborhoodIndex=r,zp}var a_,Sw;function QG(){if(Sw)return a_;Sw=1;var i=Aa(),e=O1(),t=JG().WeightedNeighborhoodIndex,n={nodePagerankAttribute:"pagerank",getEdgeWeight:"weight",alpha:.85,maxIterations:100,tolerance:1e-6};function r(a,o,l){if(!i(o))throw new Error("graphology-metrics/centrality/pagerank: the given graph is not a valid graphology instance.");l=e(l,n);var c=l.alpha,f=l.maxIterations,d=l.tolerance,p=l.nodePagerankAttribute,m=o.order,v=1/m,x=new t(o,l.getEdgeWeight),_,g,b,S,E=new Float64Array(o.order),w=new Float64Array(x.weights.length),T=[];for(_=0;_<m;_++)for(E[_]=v,b=x.starts[_+1],S=x.outDegrees[_],S===0&&T.push(_),g=x.starts[_];g<b;g++)w[g]=x.weights[g]/S;for(var C=0,U=0,D,R,I,z=!1;C<f;){for(I=E,E=new Float64Array(o.order),D=0,_=0,b=T.length;_<b;_++)D+=I[T[_]];for(D*=c,_=0;_<m;_++){for(b=x.starts[_+1],g=x.starts[_];g<b;g++)R=x.neighborhood[g],E[R]+=c*I[_]*w[g];E[_]+=D*v+(1-c)*v}for(U=0,_=0;_<m;_++)U+=Math.abs(E[_]-I[_]);if(U<m*d){z=!0;break}C++}if(!z)throw Error("graphology-metrics/centrality/pagerank: failed to converge.");if(a){x.assign(p,E);return}return x.collect(E)}var s=r.bind(null,!1);return s.assign=r.bind(null,!0),a_=s,a_}var $G=QG();const eH=vo($G);var Ah={},Ew;function tH(){if(Ew)return Ah;Ew=1;var i=Aa();function e(s,a,o,l){var c=a+"Centrality";if(!i(o))throw new Error("graphology-centrality/"+c+": the given graph is not a valid graphology instance.");if(a!=="degree"&&o.type==="undirected")throw new Error("graphology-centrality/"+c+": cannot compute "+a+" centrality on an undirected graph.");l=l||{};var f=l.nodeCentralityAttribute||c,d=o.order-1,p=o[a].bind(o);if(s){o.updateEachNodeAttributes(function(v,x){return x[f]=p(v)/d,x},{attributes:[f]});return}var m={};return o.forEachNode(function(v){m[v]=p(v)/d}),m}var t=e.bind(null,!1,"degree"),n=e.bind(null,!1,"inDegree"),r=e.bind(null,!1,"outDegree");return t.assign=e.bind(null,!0,"degree"),n.assign=e.bind(null,!0,"inDegree"),r.assign=e.bind(null,!0,"outDegree"),Ah.degreeCentrality=t,Ah.inDegreeCentrality=n,Ah.outDegreeCentrality=r,Ah}var nH=tH();function um(i,e){return i==null||e==null?NaN:i<e?-1:i>e?1:i>=e?0:NaN}function iH(i,e){return i==null||e==null?NaN:e<i?-1:e>i?1:e>=i?0:NaN}function rR(i){let e,t,n;i.length!==2?(e=um,t=(o,l)=>um(i(o),l),n=(o,l)=>i(o)-l):(e=i===um||i===iH?i:rH,t=i,n=i);function r(o,l,c=0,f=o.length){if(c<f){if(e(l,l)!==0)return f;do{const d=c+f>>>1;t(o[d],l)<0?c=d+1:f=d}while(c<f)}return c}function s(o,l,c=0,f=o.length){if(c<f){if(e(l,l)!==0)return f;do{const d=c+f>>>1;t(o[d],l)<=0?c=d+1:f=d}while(c<f)}return c}function a(o,l,c=0,f=o.length){const d=r(o,l,c,f-1);return d>c&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:r,center:a,right:s}}function rH(){return 0}function sH(i){return i===null?NaN:+i}const aH=rR(um),oH=aH.right;rR(sH).center;const lH=Math.sqrt(50),cH=Math.sqrt(10),uH=Math.sqrt(2);function lg(i,e,t){const n=(e-i)/Math.max(0,t),r=Math.floor(Math.log10(n)),s=n/Math.pow(10,r),a=s>=lH?10:s>=cH?5:s>=uH?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/a,o=Math.round(i*c),l=Math.round(e*c),o/c<i&&++o,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*a,o=Math.round(i/c),l=Math.round(e/c),o*c<i&&++o,l*c>e&&--l),l<o&&.5<=t&&t<2?lg(i,e,t*2):[o,l,c]}function hH(i,e,t){if(e=+e,i=+i,t=+t,!(t>0))return[];if(i===e)return[i];const n=e<i,[r,s,a]=n?lg(e,i,t):lg(i,e,t);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(n)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(r+c)/-a;else for(let c=0;c<o;++c)l[c]=(r+c)*a;return l}function fx(i,e,t){return e=+e,i=+i,t=+t,lg(i,e,t)[2]}function fH(i,e,t){e=+e,i=+i,t=+t;const n=e<i,r=n?fx(e,i,t):fx(i,e,t);return(n?-1:1)*(r<0?1/-r:r)}function dH(i,e){switch(arguments.length){case 0:break;case 1:this.range(i);break;default:this.range(e).domain(i);break}return this}function L1(i,e,t){i.prototype=e.prototype=t,t.constructor=i}function sR(i,e){var t=Object.create(i.prototype);for(var n in e)t[n]=e[n];return t}function id(){}var Pf=.7,cg=1/Pf,ru="\\s*([+-]?\\d+)\\s*",zf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pH=/^#([0-9a-f]{3,8})$/,mH=new RegExp(`^rgb\\(${ru},${ru},${ru}\\)$`),gH=new RegExp(`^rgb\\(${Rs},${Rs},${Rs}\\)$`),vH=new RegExp(`^rgba\\(${ru},${ru},${ru},${zf}\\)$`),yH=new RegExp(`^rgba\\(${Rs},${Rs},${Rs},${zf}\\)$`),_H=new RegExp(`^hsl\\(${zf},${Rs},${Rs}\\)$`),xH=new RegExp(`^hsla\\(${zf},${Rs},${Rs},${zf}\\)$`),Mw={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};L1(id,Ff,{copy(i){return Object.assign(new this.constructor,this,i)},displayable(){return this.rgb().displayable()},hex:ww,formatHex:ww,formatHex8:bH,formatHsl:SH,formatRgb:Tw,toString:Tw});function ww(){return this.rgb().formatHex()}function bH(){return this.rgb().formatHex8()}function SH(){return aR(this).formatHsl()}function Tw(){return this.rgb().formatRgb()}function Ff(i){var e,t;return i=(i+"").trim().toLowerCase(),(e=pH.exec(i))?(t=e[1].length,e=parseInt(e[1],16),t===6?Aw(e):t===3?new nr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Fp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Fp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=mH.exec(i))?new nr(e[1],e[2],e[3],1):(e=gH.exec(i))?new nr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=vH.exec(i))?Fp(e[1],e[2],e[3],e[4]):(e=yH.exec(i))?Fp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_H.exec(i))?Dw(e[1],e[2]/100,e[3]/100,1):(e=xH.exec(i))?Dw(e[1],e[2]/100,e[3]/100,e[4]):Mw.hasOwnProperty(i)?Aw(Mw[i]):i==="transparent"?new nr(NaN,NaN,NaN,0):null}function Aw(i){return new nr(i>>16&255,i>>8&255,i&255,1)}function Fp(i,e,t,n){return n<=0&&(i=e=t=NaN),new nr(i,e,t,n)}function EH(i){return i instanceof id||(i=Ff(i)),i?(i=i.rgb(),new nr(i.r,i.g,i.b,i.opacity)):new nr}function dx(i,e,t,n){return arguments.length===1?EH(i):new nr(i,e,t,n??1)}function nr(i,e,t,n){this.r=+i,this.g=+e,this.b=+t,this.opacity=+n}L1(nr,dx,sR(id,{brighter(i){return i=i==null?cg:Math.pow(cg,i),new nr(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?Pf:Math.pow(Pf,i),new nr(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new nr(Ml(this.r),Ml(this.g),Ml(this.b),ug(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Cw,formatHex:Cw,formatHex8:MH,formatRgb:Rw,toString:Rw}));function Cw(){return`#${xl(this.r)}${xl(this.g)}${xl(this.b)}`}function MH(){return`#${xl(this.r)}${xl(this.g)}${xl(this.b)}${xl((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rw(){const i=ug(this.opacity);return`${i===1?"rgb(":"rgba("}${Ml(this.r)}, ${Ml(this.g)}, ${Ml(this.b)}${i===1?")":`, ${i})`}`}function ug(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function Ml(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function xl(i){return i=Ml(i),(i<16?"0":"")+i.toString(16)}function Dw(i,e,t,n){return n<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new as(i,e,t,n)}function aR(i){if(i instanceof as)return new as(i.h,i.s,i.l,i.opacity);if(i instanceof id||(i=Ff(i)),!i)return new as;if(i instanceof as)return i;i=i.rgb();var e=i.r/255,t=i.g/255,n=i.b/255,r=Math.min(e,t,n),s=Math.max(e,t,n),a=NaN,o=s-r,l=(s+r)/2;return o?(e===s?a=(t-n)/o+(t<n)*6:t===s?a=(n-e)/o+2:a=(e-t)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new as(a,o,l,i.opacity)}function wH(i,e,t,n){return arguments.length===1?aR(i):new as(i,e,t,n??1)}function as(i,e,t,n){this.h=+i,this.s=+e,this.l=+t,this.opacity=+n}L1(as,wH,sR(id,{brighter(i){return i=i==null?cg:Math.pow(cg,i),new as(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?Pf:Math.pow(Pf,i),new as(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,r=2*t-n;return new nr(o_(i>=240?i-240:i+120,r,n),o_(i,r,n),o_(i<120?i+240:i-120,r,n),this.opacity)},clamp(){return new as(Uw(this.h),Bp(this.s),Bp(this.l),ug(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=ug(this.opacity);return`${i===1?"hsl(":"hsla("}${Uw(this.h)}, ${Bp(this.s)*100}%, ${Bp(this.l)*100}%${i===1?")":`, ${i})`}`}}));function Uw(i){return i=(i||0)%360,i<0?i+360:i}function Bp(i){return Math.max(0,Math.min(1,i||0))}function o_(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}const N1=i=>()=>i;function TH(i,e){return function(t){return i+t*e}}function AH(i,e,t){return i=Math.pow(i,t),e=Math.pow(e,t)-i,t=1/t,function(n){return Math.pow(i+n*e,t)}}function CH(i){return(i=+i)==1?oR:function(e,t){return t-e?AH(e,t,i):N1(isNaN(e)?t:e)}}function oR(i,e){var t=e-i;return t?TH(i,t):N1(isNaN(i)?e:i)}const Ow=function i(e){var t=CH(e);function n(r,s){var a=t((r=dx(r)).r,(s=dx(s)).r),o=t(r.g,s.g),l=t(r.b,s.b),c=oR(r.opacity,s.opacity);return function(f){return r.r=a(f),r.g=o(f),r.b=l(f),r.opacity=c(f),r+""}}return n.gamma=i,n}(1);function RH(i,e){e||(e=[]);var t=i?Math.min(e.length,i.length):0,n=e.slice(),r;return function(s){for(r=0;r<t;++r)n[r]=i[r]*(1-s)+e[r]*s;return n}}function DH(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function UH(i,e){var t=e?e.length:0,n=i?Math.min(t,i.length):0,r=new Array(n),s=new Array(t),a;for(a=0;a<n;++a)r[a]=I1(i[a],e[a]);for(;a<t;++a)s[a]=e[a];return function(o){for(a=0;a<n;++a)s[a]=r[a](o);return s}}function OH(i,e){var t=new Date;return i=+i,e=+e,function(n){return t.setTime(i*(1-n)+e*n),t}}function hg(i,e){return i=+i,e=+e,function(t){return i*(1-t)+e*t}}function LH(i,e){var t={},n={},r;(i===null||typeof i!="object")&&(i={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in i?t[r]=I1(i[r],e[r]):n[r]=e[r];return function(s){for(r in t)n[r]=t[r](s);return n}}var px=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,l_=new RegExp(px.source,"g");function NH(i){return function(){return i}}function IH(i){return function(e){return i(e)+""}}function PH(i,e){var t=px.lastIndex=l_.lastIndex=0,n,r,s,a=-1,o=[],l=[];for(i=i+"",e=e+"";(n=px.exec(i))&&(r=l_.exec(e));)(s=r.index)>t&&(s=e.slice(t,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:hg(n,r)})),t=l_.lastIndex;return t<e.length&&(s=e.slice(t),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?IH(l[0].x):NH(e):(e=l.length,function(c){for(var f=0,d;f<e;++f)o[(d=l[f]).i]=d.x(c);return o.join("")})}function I1(i,e){var t=typeof e,n;return e==null||t==="boolean"?N1(e):(t==="number"?hg:t==="string"?(n=Ff(e))?(e=n,Ow):PH:e instanceof Ff?Ow:e instanceof Date?OH:DH(e)?RH:Array.isArray(e)?UH:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?LH:hg)(i,e)}function zH(i,e){return i=+i,e=+e,function(t){return Math.round(i*(1-t)+e*t)}}function FH(i){return function(){return i}}function BH(i){return+i}var Lw=[0,1];function eu(i){return i}function mx(i,e){return(e-=i=+i)?function(t){return(t-i)/e}:FH(isNaN(e)?NaN:.5)}function kH(i,e){var t;return i>e&&(t=i,i=e,e=t),function(n){return Math.max(i,Math.min(e,n))}}function GH(i,e,t){var n=i[0],r=i[1],s=e[0],a=e[1];return r<n?(n=mx(r,n),s=t(a,s)):(n=mx(n,r),s=t(s,a)),function(o){return s(n(o))}}function HH(i,e,t){var n=Math.min(i.length,e.length)-1,r=new Array(n),s=new Array(n),a=-1;for(i[n]<i[0]&&(i=i.slice().reverse(),e=e.slice().reverse());++a<n;)r[a]=mx(i[a],i[a+1]),s[a]=t(e[a],e[a+1]);return function(o){var l=oH(i,o,1,n)-1;return s[l](r[l](o))}}function VH(i,e){return e.domain(i.domain()).range(i.range()).interpolate(i.interpolate()).clamp(i.clamp()).unknown(i.unknown())}function WH(){var i=Lw,e=Lw,t=I1,n,r,s,a=eu,o,l,c;function f(){var p=Math.min(i.length,e.length);return a!==eu&&(a=kH(i[0],i[p-1])),o=p>2?HH:GH,l=c=null,d}function d(p){return p==null||isNaN(p=+p)?s:(l||(l=o(i.map(n),e,t)))(n(a(p)))}return d.invert=function(p){return a(r((c||(c=o(e,i.map(n),hg)))(p)))},d.domain=function(p){return arguments.length?(i=Array.from(p,BH),f()):i.slice()},d.range=function(p){return arguments.length?(e=Array.from(p),f()):e.slice()},d.rangeRound=function(p){return e=Array.from(p),t=zH,f()},d.clamp=function(p){return arguments.length?(a=p?!0:eu,f()):a!==eu},d.interpolate=function(p){return arguments.length?(t=p,f()):t},d.unknown=function(p){return arguments.length?(s=p,d):s},function(p,m){return n=p,r=m,f()}}function XH(){return WH()(eu,eu)}function jH(i){return Math.abs(i=Math.round(i))>=1e21?i.toLocaleString("en").replace(/,/g,""):i.toString(10)}function fg(i,e){if((t=(i=e?i.toExponential(e-1):i.toExponential()).indexOf("e"))<0)return null;var t,n=i.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+i.slice(t+1)]}function yu(i){return i=fg(Math.abs(i)),i?i[1]:NaN}function qH(i,e){return function(t,n){for(var r=t.length,s=[],a=0,o=i[0],l=0;r>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),s.push(t.substring(r-=o,r+o)),!((l+=o+1)>n));)o=i[a=(a+1)%i.length];return s.reverse().join(e)}}function YH(i){return function(e){return e.replace(/[0-9]/g,function(t){return i[+t]})}}var ZH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dg(i){if(!(e=ZH.exec(i)))throw new Error("invalid format: "+i);var e;return new P1({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}dg.prototype=P1.prototype;function P1(i){this.fill=i.fill===void 0?" ":i.fill+"",this.align=i.align===void 0?">":i.align+"",this.sign=i.sign===void 0?"-":i.sign+"",this.symbol=i.symbol===void 0?"":i.symbol+"",this.zero=!!i.zero,this.width=i.width===void 0?void 0:+i.width,this.comma=!!i.comma,this.precision=i.precision===void 0?void 0:+i.precision,this.trim=!!i.trim,this.type=i.type===void 0?"":i.type+""}P1.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function KH(i){e:for(var e=i.length,t=1,n=-1,r;t<e;++t)switch(i[t]){case".":n=r=t;break;case"0":n===0&&(n=t),r=t;break;default:if(!+i[t])break e;n>0&&(n=0);break}return n>0?i.slice(0,n)+i.slice(r+1):i}var lR;function JH(i,e){var t=fg(i,e);if(!t)return i+"";var n=t[0],r=t[1],s=r-(lR=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+fg(i,Math.max(0,e+s-1))[0]}function Nw(i,e){var t=fg(i,e);if(!t)return i+"";var n=t[0],r=t[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}const Iw={"%":(i,e)=>(i*100).toFixed(e),b:i=>Math.round(i).toString(2),c:i=>i+"",d:jH,e:(i,e)=>i.toExponential(e),f:(i,e)=>i.toFixed(e),g:(i,e)=>i.toPrecision(e),o:i=>Math.round(i).toString(8),p:(i,e)=>Nw(i*100,e),r:Nw,s:JH,X:i=>Math.round(i).toString(16).toUpperCase(),x:i=>Math.round(i).toString(16)};function Pw(i){return i}var zw=Array.prototype.map,Fw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function QH(i){var e=i.grouping===void 0||i.thousands===void 0?Pw:qH(zw.call(i.grouping,Number),i.thousands+""),t=i.currency===void 0?"":i.currency[0]+"",n=i.currency===void 0?"":i.currency[1]+"",r=i.decimal===void 0?".":i.decimal+"",s=i.numerals===void 0?Pw:YH(zw.call(i.numerals,String)),a=i.percent===void 0?"%":i.percent+"",o=i.minus===void 0?"−":i.minus+"",l=i.nan===void 0?"NaN":i.nan+"";function c(d){d=dg(d);var p=d.fill,m=d.align,v=d.sign,x=d.symbol,_=d.zero,g=d.width,b=d.comma,S=d.precision,E=d.trim,w=d.type;w==="n"?(b=!0,w="g"):Iw[w]||(S===void 0&&(S=12),E=!0,w="g"),(_||p==="0"&&m==="=")&&(_=!0,p="0",m="=");var T=x==="$"?t:x==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",C=x==="$"?n:/[%p]/.test(w)?a:"",U=Iw[w],D=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function R(I){var z=T,O=C,V,ee,P;if(w==="c")O=U(I)+O,I="";else{I=+I;var L=I<0||1/I<0;if(I=isNaN(I)?l:U(Math.abs(I),S),E&&(I=KH(I)),L&&+I==0&&v!=="+"&&(L=!1),z=(L?v==="("?v:o:v==="-"||v==="("?"":v)+z,O=(w==="s"?Fw[8+lR/3]:"")+O+(L&&v==="("?")":""),D){for(V=-1,ee=I.length;++V<ee;)if(P=I.charCodeAt(V),48>P||P>57){O=(P===46?r+I.slice(V+1):I.slice(V))+O,I=I.slice(0,V);break}}}b&&!_&&(I=e(I,1/0));var k=z.length+I.length+O.length,H=k<g?new Array(g-k+1).join(p):"";switch(b&&_&&(I=e(H+I,H.length?g-O.length:1/0),H=""),m){case"<":I=z+I+O+H;break;case"=":I=z+H+I+O;break;case"^":I=H.slice(0,k=H.length>>1)+z+I+O+H.slice(k);break;default:I=H+z+I+O;break}return s(I)}return R.toString=function(){return d+""},R}function f(d,p){var m=c((d=dg(d),d.type="f",d)),v=Math.max(-8,Math.min(8,Math.floor(yu(p)/3)))*3,x=Math.pow(10,-v),_=Fw[8+v/3];return function(g){return m(x*g)+_}}return{format:c,formatPrefix:f}}var kp,cR,uR;$H({thousands:",",grouping:[3],currency:["$",""]});function $H(i){return kp=QH(i),cR=kp.format,uR=kp.formatPrefix,kp}function eV(i){return Math.max(0,-yu(Math.abs(i)))}function tV(i,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yu(e)/3)))*3-yu(Math.abs(i)))}function nV(i,e){return i=Math.abs(i),e=Math.abs(e)-i,Math.max(0,yu(e)-yu(i))+1}function iV(i,e,t,n){var r=fH(i,e,t),s;switch(n=dg(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(i),Math.abs(e));return n.precision==null&&!isNaN(s=tV(r,a))&&(n.precision=s),uR(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=nV(r,Math.max(Math.abs(i),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=eV(r))&&(n.precision=s-(n.type==="%")*2);break}}return cR(n)}function rV(i){var e=i.domain;return i.ticks=function(t){var n=e();return hH(n[0],n[n.length-1],t??10)},i.tickFormat=function(t,n){var r=e();return iV(r[0],r[r.length-1],t??10,n)},i.nice=function(t){t==null&&(t=10);var n=e(),r=0,s=n.length-1,a=n[r],o=n[s],l,c,f=10;for(o<a&&(c=a,a=o,o=c,c=r,r=s,s=c);f-- >0;){if(c=fx(a,o,t),c===l)return n[r]=a,n[s]=o,e(n);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return i},i}function hR(){var i=XH();return i.copy=function(){return VH(i,hR())},dH.apply(i,arguments),rV(i)}const sV=i=>i;function fR(i,e=sV){const t=uo.useSyncExternalStore(i.subscribe,()=>e(i.getState()),()=>e(i.getInitialState()));return uo.useDebugValue(t),t}const Bw=i=>{const e=SC(i),t=n=>fR(e,n);return Object.assign(t,e),t},aV=i=>i?Bw(i):Bw,kw=i=>Symbol.iterator in i,Gw=i=>"entries"in i,Hw=(i,e)=>{const t=i instanceof Map?i:new Map(i.entries()),n=e instanceof Map?e:new Map(e.entries());if(t.size!==n.size)return!1;for(const[r,s]of t)if(!Object.is(s,n.get(r)))return!1;return!0},oV=(i,e)=>{const t=i[Symbol.iterator](),n=e[Symbol.iterator]();let r=t.next(),s=n.next();for(;!r.done&&!s.done;){if(!Object.is(r.value,s.value))return!1;r=t.next(),s=n.next()}return!!r.done&&!!s.done};function lV(i,e){return Object.is(i,e)?!0:typeof i!="object"||i===null||typeof e!="object"||e===null||Object.getPrototypeOf(i)!==Object.getPrototypeOf(e)?!1:kw(i)&&kw(e)?Gw(i)&&Gw(e)?Hw(i,e):oV(i,e):Hw({entries:()=>Object.entries(i)},{entries:()=>Object.entries(e)})}function cV(i){const e=uo.useRef(void 0);return t=>{const n=i(t);return lV(e.current,n)?e.current:e.current=n}}var $r={},cl={},c_,Vw;function uV(){if(Vw)return c_;Vw=1;function i(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=function(){return this}),i.of=function(){var e=arguments,t=e.length,n=0;return new i(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},i.empty=function(){var e=new i(function(){return{done:!0}});return e},i.fromSequence=function(e){var t=0,n=e.length;return new i(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},i.is=function(e){return e instanceof i?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},c_=i,c_}var Gp={},Ww;function hV(){return Ww||(Ww=1,Gp.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",Gp.SYMBOL_SUPPORT=typeof Symbol<"u"),Gp}var u_,Xw;function z1(){if(Xw)return u_;Xw=1;var i=hV(),e=i.ARRAY_BUFFER_SUPPORT,t=i.SYMBOL_SUPPORT;return u_=function(r,s){var a,o,l,c,f;if(!r)throw new Error("obliterator/forEach: invalid iterable.");if(typeof s!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(r)||e&&ArrayBuffer.isView(r)||typeof r=="string"||r.toString()==="[object Arguments]"){for(l=0,c=r.length;l<c;l++)s(r[l],l);return}if(typeof r.forEach=="function"){r.forEach(s);return}if(t&&Symbol.iterator in r&&typeof r.next!="function"&&(r=r[Symbol.iterator]()),typeof r.next=="function"){for(a=r,l=0;f=a.next(),f.done!==!0;)s(f.value,l),l++;return}for(o in r)r.hasOwnProperty(o)&&s(r[o],o)},u_}var h_,jw;function fV(){if(jw)return h_;jw=1;var i=uV(),e=z1();function t(){this.clear()}return t.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},t.prototype.enqueue=function(n){return this.items.push(n),++this.size},t.prototype.dequeue=function(){if(this.size){var n=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,n}},t.prototype.peek=function(){if(this.size)return this.items[this.offset]},t.prototype.forEach=function(n,r){r=arguments.length>1?r:this;for(var s=this.offset,a=0,o=this.items.length;s<o;s++,a++)n.call(r,this.items[s],a,this)},t.prototype.toArray=function(){return this.items.slice(this.offset)},t.prototype.values=function(){var n=this.items,r=this.offset;return new i(function(){if(r>=n.length)return{done:!0};var s=n[r];return r++,{value:s,done:!1}})},t.prototype.entries=function(){var n=this.items,r=this.offset,s=0;return new i(function(){if(r>=n.length)return{done:!0};var a=n[r];return r++,{value:[s++,a],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.toString=function(){return this.toArray().join(",")},t.prototype.toJSON=function(){return this.toArray()},t.prototype.inspect=function(){var n=this.toArray();return Object.defineProperty(n,"constructor",{value:t,enumerable:!1}),n},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(n){var r=new t;return e(n,function(s){r.enqueue(s)}),r},t.of=function(){return t.from(arguments)},h_=t,h_}var f_,qw;function dV(){return qw||(qw=1,f_=function(e,t){var n=t.length;if(n!==0){var r=e.length;e.length+=n;for(var s=0;s<n;s++)e[r+s]=t[s]}}),f_}var Yw;function pV(){if(Yw)return cl;Yw=1;var i=Aa(),e=fV(),t=dV();function n(c,f,d){if(!i(c))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!c.hasNode(f))throw new Error('graphology-shortest-path: the "'+f+'" source node does not exist in the given graph.');if(!c.hasNode(d))throw new Error('graphology-shortest-path: the "'+d+'" target node does not exist in the given graph.');if(f=""+f,d=""+d,f===d)return[f];var p=c.inboundNeighbors.bind(c),m=c.outboundNeighbors.bind(c),v={},x={};v[f]=null,x[d]=null;var _=[f],g=[d],b,S,E,w,T,C,U,D,R=!1;e:for(;_.length&&g.length;)if(_.length<=g.length){for(b=_,_=[],T=0,U=b.length;T<U;T++)for(S=b[T],E=m(S),C=0,D=E.length;C<D;C++)if(w=E[C],w in v||(_.push(w),v[w]=S),w in x){R=!0;break e}}else for(b=g,g=[],T=0,U=b.length;T<U;T++)for(S=b[T],E=p(S),C=0,D=E.length;C<D;C++)if(w=E[C],w in x||(g.push(w),x[w]=S),w in v){R=!0;break e}if(!R)return null;for(var I=[];w;)I.unshift(w),w=v[w];for(w=x[I[I.length-1]];w;)I.push(w),w=x[w];return I.length?I:null}function r(c,f){if(!i(c))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<2)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 2.");if(!c.hasNode(f))throw new Error('graphology-shortest-path: the "'+f+'" source node does not exist in the given graph.');f=""+f;var d={},p={},m,v,x,_,g,b;for(d[f]=!0,p[f]=[f];Object.keys(d).length;){m=d,d={};for(x in m)for(v=c.outboundNeighbors(x),g=0,b=v.length;g<b;g++)_=v[g],p[_]||(p[_]=p[x].concat(_),d[_]=!0)}return p}function s(c,f,d){if(!i(f))throw new Error("graphology-shortest-path: invalid graphology instance.");if(!f.hasNode(d))throw new Error('graphology-shortest-path: the "'+d+'" source node does not exist in the given graph.');d=""+d;var p=new Set,m={},v=0;m[d]=0;for(var x=[d],_,g,b;x.length!==0;){var S=[];for(_=0,g=x.length;_<g;_++)b=x[_],!p.has(b)&&(p.add(b),t(S,f[c](b)),m[b]=v);v++,x=S}return m}var a=s.bind(null,"outboundNeighbors"),o=s.bind(null,"neighbors");function l(c,f){f=""+f;var d=[],p={},m={},v=c.nodes(),x,_,g,b,S,E,w,T,C;for(E=0,T=v.length;E<T;E++)b=v[E],p[b]=[],m[b]=0;var U={};m[f]=1,U[f]=0;for(var D=e.of(f);D.size;)for(b=D.dequeue(),d.push(b),x=U[b],_=m[b],g=c.outboundNeighbors(b),w=0,C=g.length;w<C;w++)S=g[w],S in U||(D.enqueue(S),U[S]=x+1),U[S]===x+1&&(m[S]+=_,p[S].push(b));return[d,p,m]}return cl.bidirectional=n,cl.singleSource=r,cl.singleSourceLength=a,cl.undirectedSingleSourceLength=o,cl.brandes=l,cl}var d_={},Zw;function mV(){if(Zw)return d_;Zw=1;var i=function(){return!0};return d_.edgePathFromNodePath=function(e,t){var n=t.length,r,s,a,o;if(n<2)return s=t[0],o=e.multi?e.findEdge(s,s,i):e.edge(s,s),o?[o]:[];n--;var l=new Array(n);for(r=0;r<n;r++){if(s=t[r],a=t[r+1],o=e.multi?e.findOutboundEdge(s,a,i):e.edge(s,a),o===void 0)throw new Error("graphology-shortest-path: given path is impossible in given graph.");l[r]=o}return l},d_}var Ch={},Fc={},Kw;function gV(){if(Kw)return Fc;Kw=1;var i=function(r,s){return r<s?-1:r>s?1:0},e=function(r,s){return r<s?1:r>s?-1:0};function t(r){return function(s,a){return r(a,s)}}function n(r){return r===2?function(s,a){return s[0]<a[0]?-1:s[0]>a[0]?1:s[1]<a[1]?-1:s[1]>a[1]?1:0}:function(s,a){for(var o=0;o<r;){if(s[o]<a[o])return-1;if(s[o]>a[o])return 1;o++}return 0}}return Fc.DEFAULT_COMPARATOR=i,Fc.DEFAULT_REVERSE_COMPARATOR=e,Fc.reverseComparator=t,Fc.createTupleComparator=n,Fc}var Bc={},Jw;function vV(){if(Jw)return Bc;Jw=1;var i=z1(),e=iR();function t(a){return Array.isArray(a)||e.isTypedArray(a)}function n(a){if(typeof a.length=="number")return a.length;if(typeof a.size=="number")return a.size}function r(a){var o=n(a),l=typeof o=="number"?new Array(o):[],c=0;return i(a,function(f){l[c++]=f}),l}function s(a){var o=n(a),l=typeof o=="number"?e.getPointerArray(o):Array,c=typeof o=="number"?new Array(o):[],f=typeof o=="number"?new l(o):[],d=0;return i(a,function(p){c[d]=p,f[d]=d++}),[c,f]}return Bc.isArrayLike=t,Bc.guessLength=n,Bc.toArray=r,Bc.toArrayWithIndices=s,Bc}var p_,Qw;function dR(){if(Qw)return p_;Qw=1;var i=z1(),e=gV(),t=vV(),n=e.DEFAULT_COMPARATOR,r=e.reverseComparator;function s(g,b,S,E){for(var w=b[E],T,C;E>S;){if(T=E-1>>1,C=b[T],g(w,C)<0){b[E]=C,E=T;continue}break}b[E]=w}function a(g,b,S){for(var E=b.length,w=S,T=b[S],C=2*S+1,U;C<E;)U=C+1,U<E&&g(b[C],b[U])>=0&&(C=U),b[S]=b[C],S=C,C=2*S+1;b[S]=T,s(g,b,w,S)}function o(g,b,S){b.push(S),s(g,b,0,b.length-1)}function l(g,b){var S=b.pop();if(b.length!==0){var E=b[0];return b[0]=S,a(g,b,0),E}return S}function c(g,b,S){if(b.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var E=b[0];return b[0]=S,a(g,b,0),E}function f(g,b,S){var E;return b.length!==0&&g(b[0],S)<0&&(E=b[0],b[0]=S,S=E,a(g,b,0)),S}function d(g,b){for(var S=b.length,E=S>>1,w=E;--w>=0;)a(g,b,w)}function p(g,b){for(var S=b.length,E=0,w=new Array(S);E<S;)w[E++]=l(g,b);return w}function m(g,b,S){arguments.length===2&&(S=b,b=g,g=n);var E=r(g),w,T,C,U=1/0,D;if(b===1){if(t.isArrayLike(S)){for(w=0,T=S.length;w<T;w++)C=S[w],(U===1/0||g(C,U)<0)&&(U=C);return D=new S.constructor(1),D[0]=U,D}return i(S,function(I){(U===1/0||g(I,U)<0)&&(U=I)}),[U]}if(t.isArrayLike(S)){if(b>=S.length)return S.slice().sort(g);for(D=S.slice(0,b),d(E,D),w=b,T=S.length;w<T;w++)E(S[w],D[0])>0&&c(E,D,S[w]);return D.sort(g)}var R=t.guessLength(S);return R!==null&&R<b&&(b=R),D=new Array(b),w=0,i(S,function(I){w<b?D[w]=I:(w===b&&d(E,D),E(I,D[0])>0&&c(E,D,I)),w++}),D.length>w&&(D.length=w),D.sort(g)}function v(g,b,S){arguments.length===2&&(S=b,b=g,g=n);var E=r(g),w,T,C,U=-1/0,D;if(b===1){if(t.isArrayLike(S)){for(w=0,T=S.length;w<T;w++)C=S[w],(U===-1/0||g(C,U)>0)&&(U=C);return D=new S.constructor(1),D[0]=U,D}return i(S,function(I){(U===-1/0||g(I,U)>0)&&(U=I)}),[U]}if(t.isArrayLike(S)){if(b>=S.length)return S.slice().sort(E);for(D=S.slice(0,b),d(g,D),w=b,T=S.length;w<T;w++)g(S[w],D[0])>0&&c(g,D,S[w]);return D.sort(E)}var R=t.guessLength(S);return R!==null&&R<b&&(b=R),D=new Array(b),w=0,i(S,function(I){w<b?D[w]=I:(w===b&&d(g,D),g(I,D[0])>0&&c(g,D,I)),w++}),D.length>w&&(D.length=w),D.sort(E)}function x(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}x.prototype.clear=function(){this.items=[],this.size=0},x.prototype.push=function(g){return o(this.comparator,this.items,g),++this.size},x.prototype.peek=function(){return this.items[0]},x.prototype.pop=function(){return this.size!==0&&this.size--,l(this.comparator,this.items)},x.prototype.replace=function(g){return c(this.comparator,this.items,g)},x.prototype.pushpop=function(g){return f(this.comparator,this.items,g)},x.prototype.consume=function(){return this.size=0,p(this.comparator,this.items)},x.prototype.toArray=function(){return p(this.comparator,this.items.slice())},x.prototype.inspect=function(){var g=this.toArray();return Object.defineProperty(g,"constructor",{value:x,enumerable:!1}),g},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect);function _(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=r(this.comparator)}return _.prototype=x.prototype,x.from=function(g,b){var S=new x(b),E;return t.isArrayLike(g)?E=g.slice():E=t.toArray(g),d(S.comparator,E),S.items=E,S.size=E.length,S},_.from=function(g,b){var S=new _(b),E;return t.isArrayLike(g)?E=g.slice():E=t.toArray(g),d(S.comparator,E),S.items=E,S.size=E.length,S},x.siftUp=a,x.siftDown=s,x.push=o,x.pop=l,x.replace=c,x.pushpop=f,x.heapify=d,x.consume=p,x.nsmallest=m,x.nlargest=v,x.MinHeap=x,x.MaxHeap=_,p_=x,p_}var $w;function yV(){if($w)return Ch;$w=1;var i=Aa(),e=c0().createEdgeWeightGetter,t=dR(),n="weight";function r(d,p){return d[0]>p[0]?1:d[0]<p[0]?-1:d[1]>p[1]?1:d[1]<p[1]?-1:d[2]>p[2]?1:d[2]<p[2]?-1:0}function s(d,p){return d[0]>p[0]?1:d[0]<p[0]?-1:d[1]>p[1]?1:d[1]<p[1]?-1:d[2]>p[2]?1:d[2]<p[2]?-1:d[3]>p[3]?1:d[3]<p[3]?-1:0}function a(d,p,m,v){if(p=""+p,m=""+m,!i(d))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");if(p&&!d.hasNode(p))throw new Error('graphology-shortest-path/dijkstra: the "'+p+'" source node does not exist in the given graph.');if(m&&!d.hasNode(m))throw new Error('graphology-shortest-path/dijkstra: the "'+m+'" target node does not exist in the given graph.');if(v=e(v||n).fromMinimalEntry,p===m)return[0,[p]];var x=[{},{}],_=[{},{}],g=[new t(r),new t(r)],b=[{},{}];_[0][p]=[p],_[1][m]=[m],b[0][p]=0,b[1][m]=0;var S=[],E=1/0,w=0,T=1,C,U,D,R,I,z,O,V,ee;for(g[0].push([0,w++,p]),g[1].push([0,w++,m]);g[0].size&&g[1].size;)if(T=1-T,C=g[T].pop(),R=C[0],I=C[2],!(I in x[T])){if(x[T][I]=R,I in x[1-T])return[E,S];for(U=T===1?d.inboundEdges(I):d.outboundEdges(I),V=0,ee=U.length;V<ee;V++){if(O=U[V],z=d.opposite(I,O),D=x[T][I]+v(O,d.getEdgeAttributes(O)),z in x[T]&&D<x[T][z])throw Error("graphology-shortest-path/dijkstra: contradictory paths found. Do some of your edges have a negative weight?");(!(z in b[T])||D<b[T][z])&&(b[T][z]=D,g[T].push([D,w++,z]),_[T][z]=_[T][I].concat(z),z in b[0]&&z in b[1]&&(R=b[0][z]+b[1][z],(S.length===0||E>R)&&(E=R,S=_[0][z].concat(_[1][z].slice(0,-1).reverse()))))}}return[1/0,null]}function o(d,p,m,v,x,_){if(!i(d))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");m=e(m||n).fromMinimalEntry;var g={},b={},S=new t(r),E=0,w,T,C,U,D,R,I,z,O,V,ee;for(z=0,V=p.length;z<V;z++)U=p[z],b[U]=0,S.push([0,E++,U]),_&&(_[U]=[U]);for(;S.size;)if(T=S.pop(),I=T[0],U=T[2],!(U in g)){if(g[U]=I,U===x)break;for(w=d.outboundEdges(U),O=0,ee=w.length;O<ee;O++){if(R=w[O],D=d.opposite(U,R),C=m(R,d.getEdgeAttributes(R))+g[U],D in g&&C<g[D])throw Error("graphology-shortest-path/dijkstra: contradictory paths found. Do some of your edges have a negative weight?");(!(D in b)||C<b[D])&&(b[D]=C,S.push([C,E++,D]),_&&(_[D]=_[U].concat(D)))}}return g}function l(d,p,m){var v={};return o(d,[p],m,0,null,v),v}function c(d,p,m,v){return a(d,p,m,v)[1]}function f(d,p,m){p=""+p,m=e(m||n).fromMinimalEntry;var v=[],x={},_={},g=d.nodes(),b,S,E,w,T,C,U,D,R,I;for(R=0,I=g.length;R<I;R++)C=g[R],x[C]=[],_[C]=0;var z={};_[p]=1;var O={};O[p]=0;var V=0,ee=new t(s);for(ee.push([0,V++,p,p]);ee.size;)if(S=ee.pop(),w=S[0],E=S[2],C=S[3],!(C in z))for(_[C]+=_[E],v.push(C),z[C]=w,b=d.outboundEdges(C),R=0,I=b.length;R<I;R++)D=b[R],U=d.opposite(C,D),T=w+m(D,d.getEdgeAttributes(D)),!(U in z)&&(!(U in O)||T<O[U])?(O[U]=T,ee.push([T,V++,C,U]),_[U]=0,x[U]=[C]):T===O[U]&&(_[U]+=_[C],x[U].push(C));return[v,x,_]}return Ch.bidirectional=c,Ch.singleSource=l,Ch.brandes=f,Ch}var m_={},eT;function _V(){if(eT)return m_;eT=1;var i=Aa(),e=c0().createEdgeWeightGetter,t=dR(),n="weight";function r(a,o){return a[0]>o[0]?1:a[0]<o[0]?-1:a[1]>o[1]?1:a[1]<o[1]?-1:0}function s(a,o,l,c,f,d){if(!i(a))throw new Error("graphology-shortest-path/astar: invalid graphology instance.");if(o&&!a.hasNode(o))throw new Error('graphology-shortest-path/astar: the "'+o+'" source node does not exist in the given graph.');if(l&&!a.hasNode(l))throw new Error('graphology-shortest-path/astar: the "'+l+'" target node does not exist in the given graph.');if(c=e(c||n).fromMinimalEntry,o===l)return[o];f=f||function(){return 0},d=d||{};var p=0,m=new t(r);m.push([0,p++,o,0,null]);var v={},x={},_,g,b,S,E,w,T,C,U,D,R,I;function z(O,V,ee,P){if(I=g===ee?P:ee,D=c(O,V),D!==null){if(R=S+D,v.hasOwnProperty(I)){if(b=v[I],C=b[0],U=b[1],C<=R)return}else U=f(I,l);d.cutoff&&R+U>d.cutoff||(v[I]=[R,U],m.push([R+U,p++,I,R,g]))}}for(;m.size!==0;){if(_=m.pop(),g=_[2],S=_[3],E=_[4],g===l){for(w=[g],T=E;T!==null;)w.push(T),T=x[T];return w.reverse(),w}x.hasOwnProperty(g)&&(x[g]===null||(C=v[g][0],C<S))||(x[g]=E,a.forEachOutboundEdge(g,z))}return null}return m_.bidirectional=s,m_}var tT;function xV(){if(tT)return $r;tT=1;var i=pV(),e=mV();return $r.unweighted=i,$r.dijkstra=yV(),$r.astar=_V(),$r.bidirectional=i.bidirectional,$r.singleSource=i.singleSource,$r.singleSourceLength=i.singleSourceLength,$r.undirectedSingleSourceLength=i.undirectedSingleSourceLength,$r.brandes=i.brandes,$r.edgePathFromNodePath=e.edgePathFromNodePath,$r}var bV=xV(),Hp={exports:{}},nT;function SV(){if(nT)return Hp.exports;nT=1;var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(w,T,C){return Function.prototype.apply.call(w,T,C)},t;i&&typeof i.ownKeys=="function"?t=i.ownKeys:Object.getOwnPropertySymbols?t=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:t=function(w){return Object.getOwnPropertyNames(w)};function n(E){console&&console.warn&&console.warn(E)}var r=Number.isNaN||function(w){return w!==w};function s(){s.init.call(this)}Hp.exports=s,Hp.exports.once=g,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(E){if(typeof E!="number"||E<0||r(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");a=E}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||r(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function l(E){return E._maxListeners===void 0?s.defaultMaxListeners:E._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(w){for(var T=[],C=1;C<arguments.length;C++)T.push(arguments[C]);var U=w==="error",D=this._events;if(D!==void 0)U=U&&D.error===void 0;else if(!U)return!1;if(U){var R;if(T.length>0&&(R=T[0]),R instanceof Error)throw R;var I=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw I.context=R,I}var z=D[w];if(z===void 0)return!1;if(typeof z=="function")e(z,this,T);else for(var O=z.length,V=v(z,O),C=0;C<O;++C)e(V[C],this,T);return!0};function c(E,w,T,C){var U,D,R;if(o(T),D=E._events,D===void 0?(D=E._events=Object.create(null),E._eventsCount=0):(D.newListener!==void 0&&(E.emit("newListener",w,T.listener?T.listener:T),D=E._events),R=D[w]),R===void 0)R=D[w]=T,++E._eventsCount;else if(typeof R=="function"?R=D[w]=C?[T,R]:[R,T]:C?R.unshift(T):R.push(T),U=l(E),U>0&&R.length>U&&!R.warned){R.warned=!0;var I=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");I.name="MaxListenersExceededWarning",I.emitter=E,I.type=w,I.count=R.length,n(I)}return E}s.prototype.addListener=function(w,T){return c(this,w,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(w,T){return c(this,w,T,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(E,w,T){var C={fired:!1,wrapFn:void 0,target:E,type:w,listener:T},U=f.bind(C);return U.listener=T,C.wrapFn=U,U}s.prototype.once=function(w,T){return o(T),this.on(w,d(this,w,T)),this},s.prototype.prependOnceListener=function(w,T){return o(T),this.prependListener(w,d(this,w,T)),this},s.prototype.removeListener=function(w,T){var C,U,D,R,I;if(o(T),U=this._events,U===void 0)return this;if(C=U[w],C===void 0)return this;if(C===T||C.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete U[w],U.removeListener&&this.emit("removeListener",w,C.listener||T));else if(typeof C!="function"){for(D=-1,R=C.length-1;R>=0;R--)if(C[R]===T||C[R].listener===T){I=C[R].listener,D=R;break}if(D<0)return this;D===0?C.shift():x(C,D),C.length===1&&(U[w]=C[0]),U.removeListener!==void 0&&this.emit("removeListener",w,I||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(w){var T,C,U;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[w]),this;if(arguments.length===0){var D=Object.keys(C),R;for(U=0;U<D.length;++U)R=D[U],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=C[w],typeof T=="function")this.removeListener(w,T);else if(T!==void 0)for(U=T.length-1;U>=0;U--)this.removeListener(w,T[U]);return this};function p(E,w,T){var C=E._events;if(C===void 0)return[];var U=C[w];return U===void 0?[]:typeof U=="function"?T?[U.listener||U]:[U]:T?_(U):v(U,U.length)}s.prototype.listeners=function(w){return p(this,w,!0)},s.prototype.rawListeners=function(w){return p(this,w,!1)},s.listenerCount=function(E,w){return typeof E.listenerCount=="function"?E.listenerCount(w):m.call(E,w)},s.prototype.listenerCount=m;function m(E){var w=this._events;if(w!==void 0){var T=w[E];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function v(E,w){for(var T=new Array(w),C=0;C<w;++C)T[C]=E[C];return T}function x(E,w){for(;w+1<E.length;w++)E[w]=E[w+1];E.pop()}function _(E){for(var w=new Array(E.length),T=0;T<w.length;++T)w[T]=E[T].listener||E[T];return w}function g(E,w){return new Promise(function(T,C){function U(R){E.removeListener(w,D),C(R)}function D(){typeof E.removeListener=="function"&&E.removeListener("error",U),T([].slice.call(arguments))}S(E,w,D,{once:!0}),w!=="error"&&b(E,U,{once:!0})})}function b(E,w,T){typeof E.on=="function"&&S(E,"error",w,T)}function S(E,w,T,C){if(typeof E.on=="function")C.once?E.once(w,T):E.on(w,T);else if(typeof E.addEventListener=="function")E.addEventListener(w,function U(D){C.once&&E.removeEventListener(w,U),T(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E)}return Hp.exports}var EV=SV();function MV(){const i=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const n in arguments[e])i[n]=arguments[e][n];return i}let ii=MV;typeof Object.assign=="function"&&(ii=Object.assign);function Gr(i,e,t,n){const r=i._nodes.get(e);let s=null;return r&&(n==="mixed"?s=r.out&&r.out[t]||r.undirected&&r.undirected[t]:n==="directed"?s=r.out&&r.out[t]:s=r.undirected&&r.undirected[t]),s}function vi(i){return typeof i=="object"&&i!==null}function pR(i){let e;for(e in i)return!1;return!0}function Or(i,e,t){Object.defineProperty(i,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}function es(i,e,t){const n={enumerable:!0,configurable:!0};typeof t=="function"?n.get=t:(n.value=t,n.writable=!1),Object.defineProperty(i,e,n)}function iT(i){return!(!vi(i)||i.attributes&&!Array.isArray(i.attributes))}function wV(){let i=Math.floor(Math.random()*256)&255;return()=>i++}function ya(){const i=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let n=null;do{if(e===null){if(t++,t>=i.length)return{done:!0};e=i[t][Symbol.iterator]()}if(n=e.next(),n.done){e=null;continue}break}while(!0);return n}}}function Cu(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class F1 extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class ct extends F1{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ct.prototype.constructor)}}class Qe extends F1{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Qe.prototype.constructor)}}class xt extends F1{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,xt.prototype.constructor)}}function mR(i,e){this.key=i,this.attributes=e,this.clear()}mR.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function gR(i,e){this.key=i,this.attributes=e,this.clear()}gR.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function vR(i,e){this.key=i,this.attributes=e,this.clear()}vR.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ru(i,e,t,n,r){this.key=e,this.attributes=r,this.undirected=i,this.source=t,this.target=n}Ru.prototype.attach=function(){let i="out",e="in";this.undirected&&(i=e="undirected");const t=this.source.key,n=this.target.key;this.source[i][n]=this,!(this.undirected&&t===n)&&(this.target[e][t]=this)};Ru.prototype.attachMulti=function(){let i="out",e="in";const t=this.source.key,n=this.target.key;this.undirected&&(i=e="undirected");const r=this.source[i],s=r[n];if(typeof s>"u"){r[n]=this,this.undirected&&t===n||(this.target[e][t]=this);return}s.previous=this,this.next=s,r[n]=this,this.target[e][t]=this};Ru.prototype.detach=function(){const i=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),delete this.source[t][e],delete this.target[n][i]};Ru.prototype.detachMulti=function(){const i=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[n][i]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[n][i]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const yR=0,_R=1,TV=2,xR=3;function Ca(i,e,t,n,r,s,a){let o,l,c,f;if(n=""+n,t===yR){if(o=i._nodes.get(n),!o)throw new Qe(`Graph.${e}: could not find the "${n}" node in the graph.`);c=r,f=s}else if(t===xR){if(r=""+r,l=i._edges.get(r),!l)throw new Qe(`Graph.${e}: could not find the "${r}" edge in the graph.`);const d=l.source.key,p=l.target.key;if(n===d)o=l.target;else if(n===p)o=l.source;else throw new Qe(`Graph.${e}: the "${n}" node is not attached to the "${r}" edge (${d}, ${p}).`);c=s,f=a}else{if(l=i._edges.get(n),!l)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`);t===_R?o=l.source:o=l.target,c=r,f=s}return[o,c,f]}function AV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);return a.attributes[o]}}function CV(i,e,t){i.prototype[e]=function(n,r){const[s]=Ca(this,e,t,n,r);return s.attributes}}function RV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);return a.attributes.hasOwnProperty(o)}}function DV(i,e,t){i.prototype[e]=function(n,r,s,a){const[o,l,c]=Ca(this,e,t,n,r,s,a);return o.attributes[l]=c,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:l}),this}}function UV(i,e,t){i.prototype[e]=function(n,r,s,a){const[o,l,c]=Ca(this,e,t,n,r,s,a);if(typeof c!="function")throw new ct(`Graph.${e}: updater should be a function.`);const f=o.attributes,d=c(f[l]);return f[l]=d,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:l}),this}}function OV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);return delete a.attributes[o],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:o}),this}}function LV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);if(!vi(o))throw new ct(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=o,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function NV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);if(!vi(o))throw new ct(`Graph.${e}: provided attributes are not a plain object.`);return ii(a.attributes,o),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:o}),this}}function IV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);if(typeof o!="function")throw new ct(`Graph.${e}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const PV=[{name:i=>`get${i}Attribute`,attacher:AV},{name:i=>`get${i}Attributes`,attacher:CV},{name:i=>`has${i}Attribute`,attacher:RV},{name:i=>`set${i}Attribute`,attacher:DV},{name:i=>`update${i}Attribute`,attacher:UV},{name:i=>`remove${i}Attribute`,attacher:OV},{name:i=>`replace${i}Attributes`,attacher:LV},{name:i=>`merge${i}Attributes`,attacher:NV},{name:i=>`update${i}Attributes`,attacher:IV}];function zV(i){PV.forEach(function({name:e,attacher:t}){t(i,e("Node"),yR),t(i,e("Source"),_R),t(i,e("Target"),TV),t(i,e("Opposite"),xR)})}function FV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes[r]}}function BV(i,e,t){i.prototype[e]=function(n){let r;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+n,a=""+arguments[1];if(r=Gr(this,s,a,t),!r)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,r=this._edges.get(n),!r)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return r.attributes}}function kV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes.hasOwnProperty(r)}}function GV(i,e,t){i.prototype[e]=function(n,r,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,l=""+r;if(r=arguments[2],s=arguments[3],a=Gr(this,o,l,t),!a)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,a=this._edges.get(n),!a)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return a.attributes[r]=s,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}function HV(i,e,t){i.prototype[e]=function(n,r,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,l=""+r;if(r=arguments[2],s=arguments[3],a=Gr(this,o,l,t),!a)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,a=this._edges.get(n),!a)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof s!="function")throw new ct(`Graph.${e}: updater should be a function.`);return a.attributes[r]=s(a.attributes[r]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}function VV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return delete s.attributes[r],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:r}),this}}function WV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!vi(r))throw new ct(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function XV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!vi(r))throw new ct(`Graph.${e}: provided attributes are not a plain object.`);return ii(s.attributes,r),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:r}),this}}function jV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof r!="function")throw new ct(`Graph.${e}: provided updater is not a function.`);return s.attributes=r(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const qV=[{name:i=>`get${i}Attribute`,attacher:FV},{name:i=>`get${i}Attributes`,attacher:BV},{name:i=>`has${i}Attribute`,attacher:kV},{name:i=>`set${i}Attribute`,attacher:GV},{name:i=>`update${i}Attribute`,attacher:HV},{name:i=>`remove${i}Attribute`,attacher:VV},{name:i=>`replace${i}Attributes`,attacher:WV},{name:i=>`merge${i}Attributes`,attacher:XV},{name:i=>`update${i}Attributes`,attacher:jV}];function YV(i){qV.forEach(function({name:e,attacher:t}){t(i,e("Edge"),"mixed"),t(i,e("DirectedEdge"),"directed"),t(i,e("UndirectedEdge"),"undirected")})}const ZV=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function KV(i,e,t,n){let r=!1;for(const s in e){if(s===n)continue;const a=e[s];if(r=t(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),i&&r)return a.key}}function JV(i,e,t,n){let r,s,a,o=!1;for(const l in e)if(l!==n){r=e[l];do{if(s=r.source,a=r.target,o=t(r.key,r.attributes,s.key,a.key,s.attributes,a.attributes,r.undirected),i&&o)return r.key;r=r.next}while(r!==void 0)}}function g_(i,e){const t=Object.keys(i),n=t.length;let r,s=0;return{[Symbol.iterator](){return this},next(){do if(r)r=r.next;else{if(s>=n)return{done:!0};const a=t[s++];if(a===e){r=void 0;continue}r=i[a]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}}}}function QV(i,e,t,n){const r=e[t];if(!r)return;const s=r.source,a=r.target;if(n(r.key,r.attributes,s.key,a.key,s.attributes,a.attributes,r.undirected)&&i)return r.key}function $V(i,e,t,n){let r=e[t];if(!r)return;let s=!1;do{if(s=n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),i&&s)return r.key;r=r.next}while(r!==void 0)}function v_(i,e){let t=i[e];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const r={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:r}}};let n=!1;return{[Symbol.iterator](){return this},next(){return n===!0?{done:!0}:(n=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function e6(i,e){if(i.size===0)return[];if(e==="mixed"||e===i.type)return Array.from(i._edges.keys());const t=e==="undirected"?i.undirectedSize:i.directedSize,n=new Array(t),r=e==="undirected",s=i._edges.values();let a=0,o,l;for(;o=s.next(),o.done!==!0;)l=o.value,l.undirected===r&&(n[a++]=l.key);return n}function bR(i,e,t,n){if(e.size===0)return;const r=t!=="mixed"&&t!==e.type,s=t==="undirected";let a,o,l=!1;const c=e._edges.values();for(;a=c.next(),a.done!==!0;){if(o=a.value,r&&o.undirected!==s)continue;const{key:f,attributes:d,source:p,target:m}=o;if(l=n(f,d,p.key,m.key,p.attributes,m.attributes,o.undirected),i&&l)return f}}function t6(i,e){if(i.size===0)return Cu();const t=e!=="mixed"&&e!==i.type,n=e==="undirected",r=i._edges.values();return{[Symbol.iterator](){return this},next(){let s,a;for(;;){if(s=r.next(),s.done)return s;if(a=s.value,!(t&&a.undirected!==n))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}}}}function B1(i,e,t,n,r,s){const a=e?JV:KV;let o;if(t!=="undirected"&&(n!=="out"&&(o=a(i,r.in,s),i&&o)||n!=="in"&&(o=a(i,r.out,s,n?void 0:r.key),i&&o))||t!=="directed"&&(o=a(i,r.undirected,s),i&&o))return o}function n6(i,e,t,n){const r=[];return B1(!1,i,e,t,n,function(s){r.push(s)}),r}function i6(i,e,t){let n=Cu();return i!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(n=ya(n,g_(t.in))),e!=="in"&&typeof t.out<"u"&&(n=ya(n,g_(t.out,e?void 0:t.key)))),i!=="directed"&&typeof t.undirected<"u"&&(n=ya(n,g_(t.undirected))),n}function k1(i,e,t,n,r,s,a){const o=t?$V:QV;let l;if(e!=="undirected"&&(typeof r.in<"u"&&n!=="out"&&(l=o(i,r.in,s,a),i&&l)||typeof r.out<"u"&&n!=="in"&&(n||r.key!==s)&&(l=o(i,r.out,s,a),i&&l))||e!=="directed"&&typeof r.undirected<"u"&&(l=o(i,r.undirected,s,a),i&&l))return l}function r6(i,e,t,n,r){const s=[];return k1(!1,i,e,t,n,r,function(a){s.push(a)}),s}function s6(i,e,t,n){let r=Cu();return i!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&n in t.in&&(r=ya(r,v_(t.in,n))),typeof t.out<"u"&&e!=="in"&&n in t.out&&(e||t.key!==n)&&(r=ya(r,v_(t.out,n)))),i!=="directed"&&typeof t.undirected<"u"&&n in t.undirected&&(r=ya(r,v_(t.undirected,n))),r}function a6(i,e){const{name:t,type:n,direction:r}=e;i.prototype[t]=function(s,a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];if(!arguments.length)return e6(this,n);if(arguments.length===1){s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new Qe(`Graph.${t}: could not find the "${s}" node in the graph.`);return n6(this.multi,n==="mixed"?this.type:n,r,o)}if(arguments.length===2){s=""+s,a=""+a;const o=this._nodes.get(s);if(!o)throw new Qe(`Graph.${t}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(a))throw new Qe(`Graph.${t}: could not find the "${a}" target node in the graph.`);return r6(n,this.multi,r,o,a)}throw new ct(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function o6(i,e){const{name:t,type:n,direction:r}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(c,f,d){if(!(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)){if(arguments.length===1)return d=c,bR(!1,this,n,d);if(arguments.length===2){c=""+c,d=f;const p=this._nodes.get(c);if(typeof p>"u")throw new Qe(`Graph.${s}: could not find the "${c}" node in the graph.`);return B1(!1,this.multi,n==="mixed"?this.type:n,r,p,d)}if(arguments.length===3){c=""+c,f=""+f;const p=this._nodes.get(c);if(!p)throw new Qe(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new Qe(`Graph.${s}: could not find the "${f}" target node in the graph.`);return k1(!1,n,this.multi,r,p,f,d)}throw new ct(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+t[0].toUpperCase()+t.slice(1);i.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();let d;if(c.length===0){let p=0;n!=="directed"&&(p+=this.undirectedSize),n!=="undirected"&&(p+=this.directedSize),d=new Array(p);let m=0;c.push((v,x,_,g,b,S,E)=>{d[m++]=f(v,x,_,g,b,S,E)})}else d=[],c.push((p,m,v,x,_,g,b)=>{d.push(f(p,m,v,x,_,g,b))});return this[s].apply(this,c),d};const o="filter"+t[0].toUpperCase()+t.slice(1);i.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop(),d=[];return c.push((p,m,v,x,_,g,b)=>{f(p,m,v,x,_,g,b)&&d.push(p)}),this[s].apply(this,c),d};const l="reduce"+t[0].toUpperCase()+t.slice(1);i.prototype[l]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new ct(`Graph.${l}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new ct(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f,d;c.length===2?(f=c[0],d=c[1],c=[]):c.length===3?(f=c[1],d=c[2],c=[c[0]]):c.length===4&&(f=c[2],d=c[3],c=[c[0],c[1]]);let p=d;return c.push((m,v,x,_,g,b,S)=>{p=f(p,m,v,x,_,g,b,S)}),this[s].apply(this,c),p}}function l6(i,e){const{name:t,type:n,direction:r}=e,s="find"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(l,c,f){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return!1;if(arguments.length===1)return f=l,bR(!0,this,n,f);if(arguments.length===2){l=""+l,f=c;const d=this._nodes.get(l);if(typeof d>"u")throw new Qe(`Graph.${s}: could not find the "${l}" node in the graph.`);return B1(!0,this.multi,n==="mixed"?this.type:n,r,d,f)}if(arguments.length===3){l=""+l,c=""+c;const d=this._nodes.get(l);if(!d)throw new Qe(`Graph.${s}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(c))throw new Qe(`Graph.${s}: could not find the "${c}" target node in the graph.`);return k1(!0,n,this.multi,r,d,c,f)}throw new ct(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[a]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((d,p,m,v,x,_,g)=>c(d,p,m,v,x,_,g)),!!this[s].apply(this,l)};const o="every"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[o]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((d,p,m,v,x,_,g)=>!c(d,p,m,v,x,_,g)),!this[s].apply(this,l)}}function c6(i,e){const{name:t,type:n,direction:r}=e,s=t.slice(0,-1)+"Entries";i.prototype[s]=function(a,o){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Cu();if(!arguments.length)return t6(this,n);if(arguments.length===1){a=""+a;const l=this._nodes.get(a);if(!l)throw new Qe(`Graph.${s}: could not find the "${a}" node in the graph.`);return i6(n,r,l)}if(arguments.length===2){a=""+a,o=""+o;const l=this._nodes.get(a);if(!l)throw new Qe(`Graph.${s}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new Qe(`Graph.${s}: could not find the "${o}" target node in the graph.`);return s6(n,r,l,o)}throw new ct(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function u6(i){ZV.forEach(e=>{a6(i,e),o6(i,e),l6(i,e),c6(i,e)})}const h6=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function u0(){this.A=null,this.B=null}u0.prototype.wrap=function(i){this.A===null?this.A=i:this.B===null&&(this.B=i)};u0.prototype.has=function(i){return this.A!==null&&i in this.A||this.B!==null&&i in this.B};function Rh(i,e,t,n,r){for(const s in n){const a=n[s],o=a.source,l=a.target,c=o===t?l:o;if(e&&e.has(c.key))continue;const f=r(c.key,c.attributes);if(i&&f)return c.key}}function G1(i,e,t,n,r){if(e!=="mixed"){if(e==="undirected")return Rh(i,null,n,n.undirected,r);if(typeof t=="string")return Rh(i,null,n,n[t],r)}const s=new u0;let a;if(e!=="undirected"){if(t!=="out"){if(a=Rh(i,null,n,n.in,r),i&&a)return a;s.wrap(n.in)}if(t!=="in"){if(a=Rh(i,s,n,n.out,r),i&&a)return a;s.wrap(n.out)}}if(e!=="directed"&&(a=Rh(i,s,n,n.undirected,r),i&&a))return a}function f6(i,e,t){if(i!=="mixed"){if(i==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const n=[];return G1(!1,i,e,t,function(r){n.push(r)}),n}function Dh(i,e,t){const n=Object.keys(t),r=n.length;let s=0;return{[Symbol.iterator](){return this},next(){let a=null;do{if(s>=r)return i&&i.wrap(t),{done:!0};const o=t[n[s++]],l=o.source,c=o.target;if(a=l===e?c:l,i&&i.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}}}function d6(i,e,t){if(i!=="mixed"){if(i==="undirected")return Dh(null,t,t.undirected);if(typeof e=="string")return Dh(null,t,t[e])}let n=Cu();const r=new u0;return i!=="undirected"&&(e!=="out"&&(n=ya(n,Dh(r,t,t.in))),e!=="in"&&(n=ya(n,Dh(r,t,t.out)))),i!=="directed"&&(n=ya(n,Dh(r,t,t.undirected))),n}function p6(i,e){const{name:t,type:n,direction:r}=e;i.prototype[t]=function(s){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new Qe(`Graph.${t}: could not find the "${s}" node in the graph.`);return f6(n==="mixed"?this.type:n,r,a)}}function m6(i,e){const{name:t,type:n,direction:r}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(c,f){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new Qe(`Graph.${s}: could not find the "${c}" node in the graph.`);G1(!1,n==="mixed"?this.type:n,r,d,f)};const a="map"+t[0].toUpperCase()+t.slice(1);i.prototype[a]=function(c,f){const d=[];return this[s](c,(p,m)=>{d.push(f(p,m))}),d};const o="filter"+t[0].toUpperCase()+t.slice(1);i.prototype[o]=function(c,f){const d=[];return this[s](c,(p,m)=>{f(p,m)&&d.push(p)}),d};const l="reduce"+t[0].toUpperCase()+t.slice(1);i.prototype[l]=function(c,f,d){if(arguments.length<3)throw new ct(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p=d;return this[s](c,(m,v)=>{p=f(p,m,v)}),p}}function g6(i,e){const{name:t,type:n,direction:r}=e,s=t[0].toUpperCase()+t.slice(1,-1),a="find"+s;i.prototype[a]=function(c,f){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new Qe(`Graph.${a}: could not find the "${c}" node in the graph.`);return G1(!0,n==="mixed"?this.type:n,r,d,f)};const o="some"+s;i.prototype[o]=function(c,f){return!!this[a](c,f)};const l="every"+s;i.prototype[l]=function(c,f){return!this[a](c,(p,m)=>!f(p,m))}}function v6(i,e){const{name:t,type:n,direction:r}=e,s=t.slice(0,-1)+"Entries";i.prototype[s]=function(a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Cu();a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new Qe(`Graph.${s}: could not find the "${a}" node in the graph.`);return d6(n==="mixed"?this.type:n,r,o)}}function y6(i){h6.forEach(e=>{p6(i,e),m6(i,e),g6(i,e),v6(i,e)})}function Vp(i,e,t,n,r){const s=n._nodes.values(),a=n.type;let o,l,c,f,d,p;for(;o=s.next(),o.done!==!0;){let m=!1;if(l=o.value,a!=="undirected"){f=l.out;for(c in f){d=f[c];do p=d.target,m=!0,r(l.key,p.key,l.attributes,p.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}if(a!=="directed"){f=l.undirected;for(c in f)if(!(e&&l.key>c)){d=f[c];do p=d.target,p.key!==c&&(p=d.source),m=!0,r(l.key,p.key,l.attributes,p.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}t&&!m&&r(l.key,null,l.attributes,null,null,null,null)}}function _6(i,e){const t={key:i};return pR(e.attributes)||(t.attributes=ii({},e.attributes)),t}function x6(i,e,t){const n={key:e,source:t.source.key,target:t.target.key};return pR(t.attributes)||(n.attributes=ii({},t.attributes)),i==="mixed"&&t.undirected&&(n.undirected=!0),n}function b6(i){if(!vi(i))throw new ct('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in i))throw new ct("Graph.import: serialized node is missing its key.");if("attributes"in i&&(!vi(i.attributes)||i.attributes===null))throw new ct("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function S6(i){if(!vi(i))throw new ct('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in i))throw new ct("Graph.import: serialized edge is missing its source.");if(!("target"in i))throw new ct("Graph.import: serialized edge is missing its target.");if("attributes"in i&&(!vi(i.attributes)||i.attributes===null))throw new ct("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in i&&typeof i.undirected!="boolean")throw new ct("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const E6=wV(),M6=new Set(["directed","undirected","mixed"]),rT=new Set(["domain","_events","_eventsCount","_maxListeners"]),w6=[{name:i=>`${i}Edge`,generateKey:!0},{name:i=>`${i}DirectedEdge`,generateKey:!0,type:"directed"},{name:i=>`${i}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:i=>`${i}EdgeWithKey`},{name:i=>`${i}DirectedEdgeWithKey`,type:"directed"},{name:i=>`${i}UndirectedEdgeWithKey`,type:"undirected"}],T6={allowSelfLoops:!0,multi:!1,type:"mixed"};function A6(i,e,t){if(t&&!vi(t))throw new ct(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},i._nodes.has(e))throw new xt(`Graph.addNode: the "${e}" node already exist in the graph.`);const n=new i.NodeDataClass(e,t);return i._nodes.set(e,n),i.emit("nodeAdded",{key:e,attributes:t}),n}function sT(i,e,t){const n=new i.NodeDataClass(e,t);return i._nodes.set(e,n),i.emit("nodeAdded",{key:e,attributes:t}),n}function SR(i,e,t,n,r,s,a,o){if(!n&&i.type==="undirected")throw new xt(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(n&&i.type==="directed")throw new xt(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(o&&!vi(o))throw new ct(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`);if(s=""+s,a=""+a,o=o||{},!i.allowSelfLoops&&s===a)throw new xt(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const l=i._nodes.get(s),c=i._nodes.get(a);if(!l)throw new Qe(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new Qe(`Graph.${e}: target node "${a}" not found.`);const f={key:null,undirected:n,source:s,target:a,attributes:o};if(t)r=i._edgeKeyGenerator();else if(r=""+r,i._edges.has(r))throw new xt(`Graph.${e}: the "${r}" edge already exists in the graph.`);if(!i.multi&&(n?typeof l.undirected[a]<"u":typeof l.out[a]<"u"))throw new xt(`Graph.${e}: an edge linking "${s}" to "${a}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const d=new Ru(n,r,l,c,o);i._edges.set(r,d);const p=s===a;return n?(l.undirectedDegree++,c.undirectedDegree++,p&&(l.undirectedLoops++,i._undirectedSelfLoopCount++)):(l.outDegree++,c.inDegree++,p&&(l.directedLoops++,i._directedSelfLoopCount++)),i.multi?d.attachMulti():d.attach(),n?i._undirectedSize++:i._directedSize++,f.key=r,i.emit("edgeAdded",f),r}function C6(i,e,t,n,r,s,a,o,l){if(!n&&i.type==="undirected")throw new xt(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(n&&i.type==="directed")throw new xt(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(o){if(l){if(typeof o!="function")throw new ct(`Graph.${e}: invalid updater function. Expecting a function but got "${o}"`)}else if(!vi(o))throw new ct(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`)}s=""+s,a=""+a;let c;if(l&&(c=o,o=void 0),!i.allowSelfLoops&&s===a)throw new xt(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let f=i._nodes.get(s),d=i._nodes.get(a),p,m;if(!t&&(p=i._edges.get(r),p)){if((p.source.key!==s||p.target.key!==a)&&(!n||p.source.key!==a||p.target.key!==s))throw new xt(`Graph.${e}: inconsistency detected when attempting to merge the "${r}" edge with "${s}" source & "${a}" target vs. ("${p.source.key}", "${p.target.key}").`);m=p}if(!m&&!i.multi&&f&&(m=n?f.undirected[a]:f.out[a]),m){const b=[m.key,!1,!1,!1];if(l?!c:!o)return b;if(l){const S=m.attributes;m.attributes=c(S),i.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else ii(m.attributes,o),i.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:o});return b}o=o||{},l&&c&&(o=c(o));const v={key:null,undirected:n,source:s,target:a,attributes:o};if(t)r=i._edgeKeyGenerator();else if(r=""+r,i._edges.has(r))throw new xt(`Graph.${e}: the "${r}" edge already exists in the graph.`);let x=!1,_=!1;f||(f=sT(i,s,{}),x=!0,s===a&&(d=f,_=!0)),d||(d=sT(i,a,{}),_=!0),p=new Ru(n,r,f,d,o),i._edges.set(r,p);const g=s===a;return n?(f.undirectedDegree++,d.undirectedDegree++,g&&(f.undirectedLoops++,i._undirectedSelfLoopCount++)):(f.outDegree++,d.inDegree++,g&&(f.directedLoops++,i._directedSelfLoopCount++)),i.multi?p.attachMulti():p.attach(),n?i._undirectedSize++:i._directedSize++,v.key=r,i.emit("edgeAdded",v),[r,!0,x,_]}function kc(i,e){i._edges.delete(e.key);const{source:t,target:n,attributes:r}=e,s=e.undirected,a=t===n;s?(t.undirectedDegree--,n.undirectedDegree--,a&&(t.undirectedLoops--,i._undirectedSelfLoopCount--)):(t.outDegree--,n.inDegree--,a&&(t.directedLoops--,i._directedSelfLoopCount--)),i.multi?e.detachMulti():e.detach(),s?i._undirectedSize--:i._directedSize--,i.emit("edgeDropped",{key:e.key,attributes:r,source:t.key,target:n.key,undirected:s})}class cn extends EV.EventEmitter{constructor(e){if(super(),e=ii({},T6,e),typeof e.multi!="boolean")throw new ct(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!M6.has(e.type))throw new ct(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new ct(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?mR:e.type==="directed"?gR:vR;Or(this,"NodeDataClass",t);const n="geid_"+E6()+"_";let r=0;const s=()=>{let a;do a=n+r++;while(this._edges.has(a));return a};Or(this,"_attributes",{}),Or(this,"_nodes",new Map),Or(this,"_edges",new Map),Or(this,"_directedSize",0),Or(this,"_undirectedSize",0),Or(this,"_directedSelfLoopCount",0),Or(this,"_undirectedSelfLoopCount",0),Or(this,"_edgeKeyGenerator",s),Or(this,"_options",e),rT.forEach(a=>Or(this,a,this[a])),es(this,"order",()=>this._nodes.size),es(this,"size",()=>this._edges.size),es(this,"directedSize",()=>this._directedSize),es(this,"undirectedSize",()=>this._undirectedSize),es(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),es(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),es(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),es(this,"multi",this._options.multi),es(this,"type",this._options.type),es(this,"allowSelfLoops",this._options.allowSelfLoops),es(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const n=""+e,r=this._edges.get(n);return!!r&&!r.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new ct(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const n=""+e,r=this._edges.get(n);return!!r&&r.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new ct(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const n=""+e;return this._edges.has(n)}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?typeof n.out<"u"&&n.out.hasOwnProperty(t)||typeof n.undirected<"u"&&n.undirected.hasOwnProperty(t):!1}throw new ct(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new xt("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new Qe(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new xt("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new Qe(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new xt("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new Qe(`Graph.edge: could not find the "${t}" target node in the graph.`);const r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.out}areInNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in n.undirected}areNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in n.in||t in n.out)||this.type!=="directed"&&t in n.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.in||this.type!=="directed"&&t in n.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.out||this.type!=="directed"&&t in n.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree),n}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.outDegree),n}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const n=this._edges.get(t);if(!n)throw new Qe(`Graph.opposite: could not find the "${t}" edge in the graph.`);const r=n.source.key,s=n.target.key;if(e===r)return s;if(e===s)return r;throw new Qe(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${s}).`)}hasExtremity(e,t){e=""+e,t=""+t;const n=this._edges.get(e);if(!n)throw new Qe(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return A6(this,e,t).key}mergeNode(e,t){if(t&&!vi(t))throw new ct(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let n=this._nodes.get(e);return n?(t&&(ii(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new ct(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let n=this._nodes.get(e);if(n){if(t){const s=n.attributes;n.attributes=t(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}const r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!=="undirected"){for(const r in t.out){n=t.out[r];do kc(this,n),n=n.next;while(n)}for(const r in t.in){n=t.in[r];do kc(this,n),n=n.next;while(n)}}if(this.type!=="directed")for(const r in t.undirected){n=t.undirected[r];do kc(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const n=""+arguments[0],r=""+arguments[1];if(t=Gr(this,n,r,this.type),!t)throw new Qe(`Graph.dropEdge: could not find the "${n}" -> "${r}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new Qe(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return kc(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new xt("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new xt("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const n=Gr(this,e,t,"directed");if(!n)throw new Qe(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return kc(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new xt("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new xt("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const n=Gr(this,e,t,"undirected");if(!n)throw new Qe(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return kc(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new ct("Graph.updateAttribute: updater should be a function.");const n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!vi(e))throw new ct("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!vi(e))throw new ct("Graph.mergeAttributes: provided attributes are not a plain object.");return ii(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new ct("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new ct("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!iT(t))throw new ct("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._nodes.values();let r,s;for(;r=n.next(),r.done!==!0;)s=r.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new ct("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!iT(t))throw new ct("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._edges.values();let r,s,a,o;for(;r=n.next(),r.done!==!0;)s=r.value,a=s.source,o=s.target,s.attributes=e(s.key,s.attributes,a.key,o.key,a.attributes,o.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new ct("Graph.forEachAdjacencyEntry: expecting a callback.");Vp(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ct("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Vp(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new ct("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Vp(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ct("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Vp(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new ct("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!="function")throw new ct("Graph.findNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!="function")throw new ct("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let n,r;const s=new Array(this.order);let a=0;for(;n=t.next(),n.done!==!0;)r=n.value,s[a++]=e(r.key,r.attributes);return s}someNode(e){if(typeof e!="function")throw new ct("Graph.someNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new ct("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new ct("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let n,r;const s=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&s.push(r.key);return s}reduceNodes(e,t){if(typeof e!="function")throw new ct("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new ct("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let n=t;const r=this._nodes.values();let s,a;for(;s=r.next(),s.done!==!0;)a=s.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((r,s)=>{e[t++]=_6(s,r)});const n=new Array(this._edges.size);return t=0,this._edges.forEach((r,s)=>{n[t++]=x6(this.type,s,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(e,t=!1){if(e instanceof cn)return e.forEachNode((l,c)=>{t?this.mergeNode(l,c):this.addNode(l,c)}),e.forEachEdge((l,c,f,d,p,m,v)=>{t?v?this.mergeUndirectedEdgeWithKey(l,f,d,c):this.mergeDirectedEdgeWithKey(l,f,d,c):v?this.addUndirectedEdgeWithKey(l,f,d,c):this.addDirectedEdgeWithKey(l,f,d,c)}),this;if(!vi(e))throw new ct("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!vi(e.attributes))throw new ct("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let n,r,s,a,o;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new ct("Graph.import: invalid nodes. Expecting an array.");for(n=0,r=s.length;n<r;n++){a=s[n],b6(a);const{key:l,attributes:c}=a;t?this.mergeNode(l,c):this.addNode(l,c)}}if(e.edges){let l=!1;if(this.type==="undirected"&&(l=!0),s=e.edges,!Array.isArray(s))throw new ct("Graph.import: invalid edges. Expecting an array.");for(n=0,r=s.length;n<r;n++){o=s[n],S6(o);const{source:c,target:f,attributes:d,undirected:p=l}=o;let m;"key"in o?(m=t?p?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:p?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,m.call(this,o.key,c,f,d)):(m=t?p?this.mergeUndirectedEdge:this.mergeDirectedEdge:p?this.addUndirectedEdge:this.addDirectedEdge,m.call(this,c,f,d))}}return this}nullCopy(e){const t=new cn(ii({},this._options,e));return t.replaceAttributes(ii({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((n,r)=>{const s=ii({},n.attributes);n=new t.NodeDataClass(r,s),t._nodes.set(r,n)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new xt(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new xt("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new xt("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),n=this._edges.values();let r,s;for(;r=n.next(),r.done!==!0;)s=r.value,SR(t,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,ii({},s.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,a)=>{e[a]=s.attributes});const t={},n={};this._edges.forEach((s,a)=>{const o=s.undirected?"--":"->";let l="",c=s.source.key,f=s.target.key,d;s.undirected&&c>f&&(d=c,c=f,f=d);const p=`(${c})${o}(${f})`;a.startsWith("geid_")?this.multi&&(typeof n[p]>"u"?n[p]=0:n[p]++,l+=`${n[p]}. `):l+=`[${a}]: `,l+=p,t[l]=s.attributes});const r={};for(const s in this)this.hasOwnProperty(s)&&!rT.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,Or(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(cn.prototype[Symbol.for("nodejs.util.inspect.custom")]=cn.prototype.inspect);w6.forEach(i=>{["add","merge","update"].forEach(e=>{const t=i.name(e),n=e==="add"?SR:C6;i.generateKey?cn.prototype[t]=function(r,s,a){return n(this,t,!0,(i.type||this.type)==="undirected",null,r,s,a,e==="update")}:cn.prototype[t]=function(r,s,a,o){return n(this,t,!1,(i.type||this.type)==="undirected",r,s,a,o,e==="update")}})});zV(cn);YV(cn);u6(cn);y6(cn);class ER extends cn{constructor(e){const t=ii({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new ct("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new ct('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class MR extends cn{constructor(e){const t=ii({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new ct("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new ct('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class wR extends cn{constructor(e){const t=ii({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ct("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class TR extends cn{constructor(e){const t=ii({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ct("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new ct('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class AR extends cn{constructor(e){const t=ii({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ct("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new ct('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Du(i){i.from=function(e,t){const n=ii({},e.options,t),r=new i(n);return r.import(e),r}}Du(cn);Du(ER);Du(MR);Du(wR);Du(TR);Du(AR);cn.Graph=cn;cn.DirectedGraph=ER;cn.UndirectedGraph=MR;cn.MultiGraph=wR;cn.MultiDirectedGraph=TR;cn.MultiUndirectedGraph=AR;cn.InvalidArgumentsGraphError=ct;cn.NotFoundGraphError=Qe;cn.UsageGraphError=xt;var H1=sd(),At=i=>rd(i,H1),V1=sd();At.write=i=>rd(i,V1);var h0=sd();At.onStart=i=>rd(i,h0);var W1=sd();At.onFrame=i=>rd(i,W1);var X1=sd();At.onFinish=i=>rd(i,X1);var su=[];At.setTimeout=(i,e)=>{const t=At.now()+e,n=()=>{const s=su.findIndex(a=>a.cancel==n);~s&&su.splice(s,1),co-=~s?1:0},r={time:t,handler:i,cancel:n};return su.splice(CR(t),0,r),co+=1,RR(),r};var CR=i=>~(~su.findIndex(e=>e.time>i)||~su.length);At.cancel=i=>{h0.delete(i),W1.delete(i),X1.delete(i),H1.delete(i),V1.delete(i)};At.sync=i=>{gx=!0,At.batchedUpdates(i),gx=!1};At.throttle=i=>{let e;function t(){try{i(...e)}finally{e=null}}function n(...r){e=r,At.onStart(t)}return n.handler=i,n.cancel=()=>{h0.delete(t),e=null},n};var j1=typeof window<"u"?window.requestAnimationFrame:()=>{};At.use=i=>j1=i;At.now=typeof performance<"u"?()=>performance.now():Date.now;At.batchedUpdates=i=>i();At.catch=console.error;At.frameLoop="always";At.advance=()=>{At.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):UR()};var lo=-1,co=0,gx=!1;function rd(i,e){gx?(e.delete(i),i(0)):(e.add(i),RR())}function RR(){lo<0&&(lo=0,At.frameLoop!=="demand"&&j1(DR))}function R6(){lo=-1}function DR(){~lo&&(j1(DR),At.batchedUpdates(UR))}function UR(){const i=lo;lo=At.now();const e=CR(lo);if(e&&(OR(su.splice(0,e),t=>t.handler()),co-=e),!co){R6();return}h0.flush(),H1.flush(i?Math.min(64,lo-i):16.667),W1.flush(),V1.flush(),X1.flush()}function sd(){let i=new Set,e=i;return{add(t){co+=e==i&&!i.has(t)?1:0,i.add(t)},delete(t){return co-=e==i&&i.has(t)?1:0,i.delete(t)},flush(t){e.size&&(i=new Set,co-=e.size,OR(e,n=>n(t)&&i.add(n)),co+=i.size,e=i)}}}function OR(i,e){i.forEach(t=>{try{e(t)}catch(n){At.catch(n)}})}var D6=Object.defineProperty,U6=(i,e)=>{for(var t in e)D6(i,t,{get:e[t],enumerable:!0})},cs={};U6(cs,{assign:()=>L6,colors:()=>fo,createStringInterpolator:()=>Y1,skipAnimation:()=>NR,to:()=>LR,willAdvance:()=>Z1});function vx(){}var O6=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),tt={arr:Array.isArray,obj:i=>!!i&&i.constructor.name==="Object",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",und:i=>i===void 0};function ca(i,e){if(tt.arr(i)){if(!tt.arr(e)||i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}return i===e}var en=(i,e)=>i.forEach(e);function Ea(i,e,t){if(tt.arr(i)){for(let n=0;n<i.length;n++)e.call(t,i[n],`${n}`);return}for(const n in i)i.hasOwnProperty(n)&&e.call(t,i[n],n)}var kr=i=>tt.und(i)?[]:tt.arr(i)?i:[i];function hf(i,e){if(i.size){const t=Array.from(i);i.clear(),en(t,e)}}var Jh=(i,...e)=>hf(i,t=>t(...e)),q1=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Y1,LR,fo=null,NR=!1,Z1=vx,L6=i=>{i.to&&(LR=i.to),i.now&&(At.now=i.now),i.colors!==void 0&&(fo=i.colors),i.skipAnimation!=null&&(NR=i.skipAnimation),i.createStringInterpolator&&(Y1=i.createStringInterpolator),i.requestAnimationFrame&&At.use(i.requestAnimationFrame),i.batchedUpdates&&(At.batchedUpdates=i.batchedUpdates),i.willAdvance&&(Z1=i.willAdvance),i.frameLoop&&(At.frameLoop=i.frameLoop)},ff=new Set,zr=[],y_=[],pg=0,f0={get idle(){return!ff.size&&!zr.length},start(i){pg>i.priority?(ff.add(i),At.onStart(N6)):(IR(i),At(yx))},advance:yx,sort(i){if(pg)At.onFrame(()=>f0.sort(i));else{const e=zr.indexOf(i);~e&&(zr.splice(e,1),PR(i))}},clear(){zr=[],ff.clear()}};function N6(){ff.forEach(IR),ff.clear(),At(yx)}function IR(i){zr.includes(i)||PR(i)}function PR(i){zr.splice(I6(zr,e=>e.priority>i.priority),0,i)}function yx(i){const e=y_;for(let t=0;t<zr.length;t++){const n=zr[t];pg=n.priority,n.idle||(Z1(n),n.advance(i),n.idle||e.push(n))}return pg=0,y_=zr,y_.length=0,zr=e,zr.length>0}function I6(i,e){const t=i.findIndex(e);return t<0?i.length:t}var P6={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},ls="[-+]?\\d*\\.?\\d+",mg=ls+"%";function d0(...i){return"\\(\\s*("+i.join(")\\s*,\\s*(")+")\\s*\\)"}var z6=new RegExp("rgb"+d0(ls,ls,ls)),F6=new RegExp("rgba"+d0(ls,ls,ls,ls)),B6=new RegExp("hsl"+d0(ls,mg,mg)),k6=new RegExp("hsla"+d0(ls,mg,mg,ls)),G6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,H6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,V6=/^#([0-9a-fA-F]{6})$/,W6=/^#([0-9a-fA-F]{8})$/;function X6(i){let e;return typeof i=="number"?i>>>0===i&&i>=0&&i<=4294967295?i:null:(e=V6.exec(i))?parseInt(e[1]+"ff",16)>>>0:fo&&fo[i]!==void 0?fo[i]:(e=z6.exec(i))?(Gc(e[1])<<24|Gc(e[2])<<16|Gc(e[3])<<8|255)>>>0:(e=F6.exec(i))?(Gc(e[1])<<24|Gc(e[2])<<16|Gc(e[3])<<8|lT(e[4]))>>>0:(e=G6.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=W6.exec(i))?parseInt(e[1],16)>>>0:(e=H6.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=B6.exec(i))?(aT(oT(e[1]),Wp(e[2]),Wp(e[3]))|255)>>>0:(e=k6.exec(i))?(aT(oT(e[1]),Wp(e[2]),Wp(e[3]))|lT(e[4]))>>>0:null}function __(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function aT(i,e,t){const n=t<.5?t*(1+e):t+e-t*e,r=2*t-n,s=__(r,n,i+1/3),a=__(r,n,i),o=__(r,n,i-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function Gc(i){const e=parseInt(i,10);return e<0?0:e>255?255:e}function oT(i){return(parseFloat(i)%360+360)%360/360}function lT(i){const e=parseFloat(i);return e<0?0:e>1?255:Math.round(e*255)}function Wp(i){const e=parseFloat(i);return e<0?0:e>100?1:e/100}function cT(i){let e=X6(i);if(e===null)return i;e=e||0;const t=(e&4278190080)>>>24,n=(e&16711680)>>>16,r=(e&65280)>>>8,s=(e&255)/255;return`rgba(${t}, ${n}, ${r}, ${s})`}var Bf=(i,e,t)=>{if(tt.fun(i))return i;if(tt.arr(i))return Bf({range:i,output:e,extrapolate:t});if(tt.str(i.output[0]))return Y1(i);const n=i,r=n.output,s=n.range||[0,1],a=n.extrapolateLeft||n.extrapolate||"extend",o=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(c=>c);return c=>{const f=q6(c,s);return j6(c,s[f],s[f+1],r[f],r[f+1],l,a,o,n.map)}};function j6(i,e,t,n,r,s,a,o,l){let c=l?l(i):i;if(c<e){if(a==="identity")return c;a==="clamp"&&(c=e)}if(c>t){if(o==="identity")return c;o==="clamp"&&(c=t)}return n===r?n:e===t?i<=e?n:r:(e===-1/0?c=-c:t===1/0?c=c-e:c=(c-e)/(t-e),c=s(c),n===-1/0?c=-c:r===1/0?c=c+n:c=c*(r-n)+n,c)}function q6(i,e){for(var t=1;t<e.length-1&&!(e[t]>=i);++t);return t-1}var Y6={linear:i=>i},kf=Symbol.for("FluidValue.get"),_u=Symbol.for("FluidValue.observers"),ws=i=>!!(i&&i[kf]),Nr=i=>i&&i[kf]?i[kf]():i,uT=i=>i[_u]||null;function Z6(i,e){i.eventObserved?i.eventObserved(e):i(e)}function gg(i,e){const t=i[_u];t&&t.forEach(n=>{Z6(n,e)})}var K6=class{constructor(i){if(!i&&!(i=this.get))throw Error("Unknown getter");J6(this,i)}},J6=(i,e)=>zR(i,kf,e);function ad(i,e){if(i[kf]){let t=i[_u];t||zR(i,_u,t=new Set),t.has(e)||(t.add(e),i.observerAdded&&i.observerAdded(t.size,e))}return e}function vg(i,e){const t=i[_u];if(t&&t.has(e)){const n=t.size-1;n?t.delete(e):i[_u]=null,i.observerRemoved&&i.observerRemoved(n,e)}}var zR=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),hm=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Q6=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,hT=new RegExp(`(${hm.source})(%|[a-z]+)`,"i"),$6=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,p0=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,FR=i=>{const[e,t]=e8(i);if(!e||q1())return i;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(n)return n.trim();if(t&&t.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r||i}else{if(t&&p0.test(t))return FR(t);if(t)return t}return i},e8=i=>{const e=p0.exec(i);if(!e)return[,];const[,t,n]=e;return[t,n]},x_,t8=(i,e,t,n,r)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${r})`,BR=i=>{x_||(x_=fo?new RegExp(`(${Object.keys(fo).join("|")})(?!\\w)`,"g"):/^\b$/);const e=i.output.map(s=>Nr(s).replace(p0,FR).replace(Q6,cT).replace(x_,cT)),t=e.map(s=>s.match(hm).map(Number)),r=t[0].map((s,a)=>t.map(o=>{if(!(a in o))throw Error('The arity of each "output" value must be equal');return o[a]})).map(s=>Bf({...i,output:s}));return s=>{const a=!hT.test(e[0])&&e.find(l=>hT.test(l))?.replace(hm,"");let o=0;return e[0].replace(hm,()=>`${r[o++](s)}${a||""}`).replace($6,t8)}},K1="react-spring: ",kR=i=>{const e=i;let t=!1;if(typeof e!="function")throw new TypeError(`${K1}once requires a function parameter`);return(...n)=>{t||(e(...n),t=!0)}},n8=kR(console.warn);function i8(){n8(`${K1}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var r8=kR(console.warn);function s8(){r8(`${K1}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function m0(i){return tt.str(i)&&(i[0]=="#"||/\d/.test(i)||!q1()&&p0.test(i)||i in(fo||{}))}var J1=q1()?Z.useEffect:Z.useLayoutEffect,a8=()=>{const i=Z.useRef(!1);return J1(()=>(i.current=!0,()=>{i.current=!1}),[]),i};function GR(){const i=Z.useState()[1],e=a8();return()=>{e.current&&i(Math.random())}}var HR=i=>Z.useEffect(i,o8),o8=[];function fT(i){const e=Z.useRef(void 0);return Z.useEffect(()=>{e.current=i}),e.current}var Gf=Symbol.for("Animated:node"),l8=i=>!!i&&i[Gf]===i,Ms=i=>i&&i[Gf],Q1=(i,e)=>O6(i,Gf,e),g0=i=>i&&i[Gf]&&i[Gf].getPayload(),VR=class{constructor(){Q1(this,this)}getPayload(){return this.payload||[]}},v0=class WR extends VR{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,tt.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new WR(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return tt.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,tt.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},yg=class XR extends v0{constructor(e){super(0),this._string=null,this._toString=Bf({output:[e,e]})}static create(e){return new XR(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(tt.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Bf({output:[this.getValue(),e]})),this._value=0,super.reset()}},_g={dependencies:null},$1=class extends VR{constructor(i){super(),this.source=i,this.setValue(i)}getValue(i){const e={};return Ea(this.source,(t,n)=>{l8(t)?e[n]=t.getValue(i):ws(t)?e[n]=Nr(t):i||(e[n]=t)}),e}setValue(i){this.source=i,this.payload=this._makePayload(i)}reset(){this.payload&&en(this.payload,i=>i.reset())}_makePayload(i){if(i){const e=new Set;return Ea(i,this._addToPayload,e),Array.from(e)}}_addToPayload(i){_g.dependencies&&ws(i)&&_g.dependencies.add(i);const e=g0(i);e&&en(e,t=>this.add(t))}},c8=class jR extends $1{constructor(e){super(e)}static create(e){return new jR(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(u8)),!0)}};function u8(i){return(m0(i)?yg:v0).create(i)}function _x(i){const e=Ms(i);return e?e.constructor:tt.arr(i)?c8:m0(i)?yg:v0}var dT=(i,e)=>{const t=!tt.fun(i)||i.prototype&&i.prototype.isReactComponent;return Z.forwardRef((n,r)=>{const s=Z.useRef(null),a=t&&Z.useCallback(v=>{s.current=d8(r,v)},[r]),[o,l]=f8(n,e),c=GR(),f=()=>{const v=s.current;if(t&&!v)return;(v?e.applyAnimatedValues(v,o.getValue(!0)):!1)===!1&&c()},d=new h8(f,l),p=Z.useRef(void 0);J1(()=>(p.current=d,en(l,v=>ad(v,d)),()=>{p.current&&(en(p.current.deps,v=>vg(v,p.current)),At.cancel(p.current.update))})),Z.useEffect(f,[]),HR(()=>()=>{const v=p.current;en(v.deps,x=>vg(x,v))});const m=e.getComponentProps(o.getValue());return Z.createElement(i,{...m,ref:a})})},h8=class{constructor(i,e){this.update=i,this.deps=e}eventObserved(i){i.type=="change"&&At.write(this.update)}};function f8(i,e){const t=new Set;return _g.dependencies=t,i.style&&(i={...i,style:e.createAnimatedStyle(i.style)}),i=new $1(i),_g.dependencies=null,[i,t]}function d8(i,e){return i&&(tt.fun(i)?i(e):i.current=e),e}var pT=Symbol.for("AnimatedComponent"),p8=(i,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=r=>new $1(r),getComponentProps:n=r=>r}={})=>{const r={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:n},s=a=>{const o=mT(a)||"Anonymous";return tt.str(a)?a=s[a]||(s[a]=dT(a,r)):a=a[pT]||(a[pT]=dT(a,r)),a.displayName=`Animated(${o})`,a};return Ea(i,(a,o)=>{tt.arr(i)&&(o=mT(a)),s[o]=s(a)}),{animated:s}},mT=i=>tt.str(i)?i:i&&tt.str(i.displayName)?i.displayName:tt.fun(i)&&i.name||null;function gl(i,...e){return tt.fun(i)?i(...e):i}var df=(i,e)=>i===!0||!!(e&&i&&(tt.fun(i)?i(e):kr(i).includes(e))),qR=(i,e)=>tt.obj(i)?e&&i[e]:i,YR=(i,e)=>i.default===!0?i[e]:i.default?i.default[e]:void 0,m8=i=>i,eb=(i,e=m8)=>{let t=g8;i.default&&i.default!==!0&&(i=i.default,t=Object.keys(i));const n={};for(const r of t){const s=e(i[r],r);tt.und(s)||(n[r]=s)}return n},g8=["config","onProps","onStart","onChange","onPause","onResume","onRest"],v8={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function y8(i){const e={};let t=0;if(Ea(i,(n,r)=>{v8[r]||(e[r]=n,t++)}),t)return e}function ZR(i){const e=y8(i);if(e){const t={to:e};return Ea(i,(n,r)=>r in e||(t[r]=n)),t}return{...i}}function Hf(i){return i=Nr(i),tt.arr(i)?i.map(Hf):m0(i)?cs.createStringInterpolator({range:[0,1],output:[i,i]})(1):i}function _8(i){for(const e in i)return!0;return!1}function xx(i){return tt.fun(i)||tt.arr(i)&&tt.obj(i[0])}function x8(i,e){i.ref?.delete(i),e?.delete(i)}function b8(i,e){e&&i.ref!==e&&(i.ref?.delete(i),e.add(i),i.ref=e)}var S8={default:{tension:170,friction:26}},bx={...S8.default,mass:1,damping:1,easing:Y6.linear,clamp:!1},E8=class{constructor(){this.velocity=0,Object.assign(this,bx)}};function M8(i,e,t){t&&(t={...t},gT(t,e),e={...t,...e}),gT(i,e),Object.assign(i,e);for(const a in bx)i[a]==null&&(i[a]=bx[a]);let{frequency:n,damping:r}=i;const{mass:s}=i;return tt.und(n)||(n<.01&&(n=.01),r<0&&(r=0),i.tension=Math.pow(2*Math.PI/n,2)*s,i.friction=4*Math.PI*r*s/n),i}function gT(i,e){if(!tt.und(e.decay))i.duration=void 0;else{const t=!tt.und(e.tension)||!tt.und(e.friction);(t||!tt.und(e.frequency)||!tt.und(e.damping)||!tt.und(e.mass))&&(i.duration=void 0,i.decay=void 0),t&&(i.frequency=void 0)}}var vT=[],w8=class{constructor(){this.changed=!1,this.values=vT,this.toValues=null,this.fromValues=vT,this.config=new E8,this.immediate=!1}};function KR(i,{key:e,props:t,defaultProps:n,state:r,actions:s}){return new Promise((a,o)=>{let l,c,f=df(t.cancel??n?.cancel,e);if(f)m();else{tt.und(t.pause)||(r.paused=df(t.pause,e));let v=n?.pause;v!==!0&&(v=r.paused||df(v,e)),l=gl(t.delay||0,e),v?(r.resumeQueue.add(p),s.pause()):(s.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),l=c.time-At.now()}function p(){l>0&&!cs.skipAnimation?(r.delayed=!0,c=At.setTimeout(m,l),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),i<=(r.cancelId||0)&&(f=!0);try{s.start({...t,callId:i,cancel:f},a)}catch(v){o(v)}}})}var tb=(i,e)=>e.length==1?e[0]:e.some(t=>t.cancelled)?au(i.get()):e.every(t=>t.noop)?JR(i.get()):ss(i.get(),e.every(t=>t.finished)),JR=i=>({value:i,noop:!0,finished:!0,cancelled:!1}),ss=(i,e,t=!1)=>({value:i,finished:e,cancelled:t}),au=i=>({value:i,cancelled:!0,finished:!1});function QR(i,e,t,n){const{callId:r,parentId:s,onRest:a}=e,{asyncTo:o,promise:l}=t;return!s&&i===o&&!e.reset?l:t.promise=(async()=>{t.asyncId=r,t.asyncTo=i;const c=eb(e,(_,g)=>g==="onRest"?void 0:_);let f,d;const p=new Promise((_,g)=>(f=_,d=g)),m=_=>{const g=r<=(t.cancelId||0)&&au(n)||r!==t.asyncId&&ss(n,!1);if(g)throw _.result=g,d(_),_},v=(_,g)=>{const b=new yT,S=new _T;return(async()=>{if(cs.skipAnimation)throw Vf(t),S.result=ss(n,!1),d(S),S;m(b);const E=tt.obj(_)?{..._}:{...g,to:_};E.parentId=r,Ea(c,(T,C)=>{tt.und(E[C])&&(E[C]=T)});const w=await n.start(E);return m(b),t.paused&&await new Promise(T=>{t.resumeQueue.add(T)}),w})()};let x;if(cs.skipAnimation)return Vf(t),ss(n,!1);try{let _;tt.arr(i)?_=(async g=>{for(const b of g)await v(b)})(i):_=Promise.resolve(i(v,n.stop.bind(n))),await Promise.all([_.then(f),p]),x=ss(n.get(),!0,!1)}catch(_){if(_ instanceof yT)x=_.result;else if(_ instanceof _T)x=_.result;else throw _}finally{r==t.asyncId&&(t.asyncId=s,t.asyncTo=s?o:void 0,t.promise=s?l:void 0)}return tt.fun(a)&&At.batchedUpdates(()=>{a(x,n,n.item)}),x})()}function Vf(i,e){hf(i.timeouts,t=>t.cancel()),i.pauseQueue.clear(),i.resumeQueue.clear(),i.asyncId=i.asyncTo=i.promise=void 0,e&&(i.cancelId=e)}var yT=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},_T=class extends Error{constructor(){super("SkipAnimationSignal")}},Sx=i=>i instanceof nb,T8=1,nb=class extends K6{constructor(){super(...arguments),this.id=T8++,this._priority=0}get priority(){return this._priority}set priority(i){this._priority!=i&&(this._priority=i,this._onPriorityChange(i))}get(){const i=Ms(this);return i&&i.getValue()}to(...i){return cs.to(this,i)}interpolate(...i){return i8(),cs.to(this,i)}toJSON(){return this.get()}observerAdded(i){i==1&&this._attach()}observerRemoved(i){i==0&&this._detach()}_attach(){}_detach(){}_onChange(i,e=!1){gg(this,{type:"change",parent:this,value:i,idle:e})}_onPriorityChange(i){this.idle||f0.sort(this),gg(this,{type:"priority",parent:this,priority:i})}},Nl=Symbol.for("SpringPhase"),$R=1,Ex=2,Mx=4,b_=i=>(i[Nl]&$R)>0,no=i=>(i[Nl]&Ex)>0,Uh=i=>(i[Nl]&Mx)>0,xT=(i,e)=>e?i[Nl]|=Ex|$R:i[Nl]&=~Ex,bT=(i,e)=>e?i[Nl]|=Mx:i[Nl]&=~Mx,A8=class extends nb{constructor(i,e){if(super(),this.animation=new w8,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!tt.und(i)||!tt.und(e)){const t=tt.obj(i)?{...i}:{...e,from:i};tt.und(t.default)&&(t.default=!0),this.start(t)}}get idle(){return!(no(this)||this._state.asyncTo)||Uh(this)}get goal(){return Nr(this.animation.to)}get velocity(){const i=Ms(this);return i instanceof v0?i.lastVelocity||0:i.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return b_(this)}get isAnimating(){return no(this)}get isPaused(){return Uh(this)}get isDelayed(){return this._state.delayed}advance(i){let e=!0,t=!1;const n=this.animation;let{toValues:r}=n;const{config:s}=n,a=g0(n.to);!a&&ws(n.to)&&(r=kr(Nr(n.to))),n.values.forEach((c,f)=>{if(c.done)return;const d=c.constructor==yg?1:a?a[f].lastPosition:r[f];let p=n.immediate,m=d;if(!p){if(m=c.lastPosition,s.tension<=0){c.done=!0;return}let v=c.elapsedTime+=i;const x=n.fromValues[f],_=c.v0!=null?c.v0:c.v0=tt.arr(s.velocity)?s.velocity[f]:s.velocity;let g;const b=s.precision||(x==d?.005:Math.min(1,Math.abs(d-x)*.001));if(tt.und(s.duration))if(s.decay){const S=s.decay===!0?.998:s.decay,E=Math.exp(-(1-S)*v);m=x+_/(1-S)*(1-E),p=Math.abs(c.lastPosition-m)<=b,g=_*E}else{g=c.lastVelocity==null?_:c.lastVelocity;const S=s.restVelocity||b/10,E=s.clamp?0:s.bounce,w=!tt.und(E),T=x==d?c.v0>0:x<d;let C,U=!1;const D=1,R=Math.ceil(i/D);for(let I=0;I<R&&(C=Math.abs(g)>S,!(!C&&(p=Math.abs(d-m)<=b,p)));++I){w&&(U=m==d||m>d==T,U&&(g=-g*E,m=d));const z=-s.tension*1e-6*(m-d),O=-s.friction*.001*g,V=(z+O)/s.mass;g=g+V*D,m=m+g*D}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,v=c.elapsedTime+=i)),S=(s.progress||0)+v/this._memoizedDuration,S=S>1?1:S<0?0:S,c.durationProgress=S),m=x+s.easing(S)*(d-x),g=(m-c.lastPosition)/i,p=S==1}c.lastVelocity=g,Number.isNaN(m)&&(console.warn("Got NaN while animating:",this),p=!0)}a&&!a[f].done&&(p=!1),p?c.done=!0:e=!1,c.setValue(m,s.round)&&(t=!0)});const o=Ms(this),l=o.getValue();if(e){const c=Nr(n.to);(l!==c||t)&&!s.decay?(o.setValue(c),this._onChange(c)):t&&s.decay&&this._onChange(l),this._stop()}else t&&this._onChange(l)}set(i){return At.batchedUpdates(()=>{this._stop(),this._focus(i),this._set(i)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(no(this)){const{to:i,config:e}=this.animation;At.batchedUpdates(()=>{this._onStart(),e.decay||this._set(i,!1),this._stop()})}return this}update(i){return(this.queue||(this.queue=[])).push(i),this}start(i,e){let t;return tt.und(i)?(t=this.queue||[],this.queue=[]):t=[tt.obj(i)?i:{...e,to:i}],Promise.all(t.map(n=>this._update(n))).then(n=>tb(this,n))}stop(i){const{to:e}=this.animation;return this._focus(this.get()),Vf(this._state,i&&this._lastCallId),At.batchedUpdates(()=>this._stop(e,i)),this}reset(){this._update({reset:!0})}eventObserved(i){i.type=="change"?this._start():i.type=="priority"&&(this.priority=i.priority+1)}_prepareNode(i){const e=this.key||"";let{to:t,from:n}=i;t=tt.obj(t)?t[e]:t,(t==null||xx(t))&&(t=void 0),n=tt.obj(n)?n[e]:n,n==null&&(n=void 0);const r={to:t,from:n};return b_(this)||(i.reverse&&([t,n]=[n,t]),n=Nr(n),tt.und(n)?Ms(this)||this._set(t):this._set(n)),r}_update({...i},e){const{key:t,defaultProps:n}=this;i.default&&Object.assign(n,eb(i,(a,o)=>/^on/.test(o)?qR(a,t):a)),ET(this,i,"onProps"),Lh(this,"onProps",i,this);const r=this._prepareNode(i);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return KR(++this._lastCallId,{key:t,props:i,defaultProps:n,state:s,actions:{pause:()=>{Uh(this)||(bT(this,!0),Jh(s.pauseQueue),Lh(this,"onPause",ss(this,Oh(this,this.animation.to)),this))},resume:()=>{Uh(this)&&(bT(this,!1),no(this)&&this._resume(),Jh(s.resumeQueue),Lh(this,"onResume",ss(this,Oh(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(a=>{if(i.loop&&a.finished&&!(e&&a.noop)){const o=e3(i);if(o)return this._update(o,!0)}return a})}_merge(i,e,t){if(e.cancel)return this.stop(!0),t(au(this));const n=!tt.und(i.to),r=!tt.und(i.from);if(n||r)if(e.callId>this._lastToId)this._lastToId=e.callId;else return t(au(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:f=l,from:d=c}=i;r&&!n&&(!e.default||tt.und(f))&&(f=d),e.reverse&&([f,d]=[d,f]);const p=!ca(d,c);p&&(o.from=d),d=Nr(d);const m=!ca(f,l);m&&this._focus(f);const v=xx(e.to),{config:x}=o,{decay:_,velocity:g}=x;(n||r)&&(x.velocity=0),e.config&&!v&&M8(x,gl(e.config,s),e.config!==a.config?gl(a.config,s):void 0);let b=Ms(this);if(!b||tt.und(f))return t(ss(this,!0));const S=tt.und(e.reset)?r&&!e.default:!tt.und(d)&&df(e.reset,s),E=S?d:this.get(),w=Hf(f),T=tt.num(w)||tt.arr(w)||m0(w),C=!v&&(!T||df(a.immediate||e.immediate,s));if(m){const I=_x(f);if(I!==b.constructor)if(C)b=this._set(w);else throw Error(`Cannot animate between ${b.constructor.name} and ${I.name}, as the "to" prop suggests`)}const U=b.constructor;let D=ws(f),R=!1;if(!D){const I=S||!b_(this)&&p;(m||I)&&(R=ca(Hf(E),w),D=!R),(!ca(o.immediate,C)&&!C||!ca(x.decay,_)||!ca(x.velocity,g))&&(D=!0)}if(R&&no(this)&&(o.changed&&!S?D=!0:D||this._stop(l)),!v&&((D||ws(l))&&(o.values=b.getPayload(),o.toValues=ws(f)?null:U==yg?[1]:kr(w)),o.immediate!=C&&(o.immediate=C,!C&&!S&&this._set(l)),D)){const{onRest:I}=o;en(R8,O=>ET(this,e,O));const z=ss(this,Oh(this,l));Jh(this._pendingCalls,z),this._pendingCalls.add(t),o.changed&&At.batchedUpdates(()=>{o.changed=!S,I?.(z,this),S?gl(a.onRest,z):o.onStart?.(z,this)})}S&&this._set(E),v?t(QR(e.to,e,this._state,this)):D?this._start():no(this)&&!m?this._pendingCalls.add(t):t(JR(E))}_focus(i){const e=this.animation;i!==e.to&&(uT(this)&&this._detach(),e.to=i,uT(this)&&this._attach())}_attach(){let i=0;const{to:e}=this.animation;ws(e)&&(ad(e,this),Sx(e)&&(i=e.priority+1)),this.priority=i}_detach(){const{to:i}=this.animation;ws(i)&&vg(i,this)}_set(i,e=!0){const t=Nr(i);if(!tt.und(t)){const n=Ms(this);if(!n||!ca(t,n.getValue())){const r=_x(t);!n||n.constructor!=r?Q1(this,r.create(t)):n.setValue(t),n&&At.batchedUpdates(()=>{this._onChange(t,e)})}}return Ms(this)}_onStart(){const i=this.animation;i.changed||(i.changed=!0,Lh(this,"onStart",ss(this,Oh(this,i.to)),this))}_onChange(i,e){e||(this._onStart(),gl(this.animation.onChange,i,this)),gl(this.defaultProps.onChange,i,this),super._onChange(i,e)}_start(){const i=this.animation;Ms(this).reset(Nr(i.to)),i.immediate||(i.fromValues=i.values.map(e=>e.lastPosition)),no(this)||(xT(this,!0),Uh(this)||this._resume())}_resume(){cs.skipAnimation?this.finish():f0.start(this)}_stop(i,e){if(no(this)){xT(this,!1);const t=this.animation;en(t.values,r=>{r.done=!0}),t.toValues&&(t.onChange=t.onPause=t.onResume=void 0),gg(this,{type:"idle",parent:this});const n=e?au(this.get()):ss(this.get(),Oh(this,i??t.to));Jh(this._pendingCalls,n),t.changed&&(t.changed=!1,Lh(this,"onRest",n,this))}}};function Oh(i,e){const t=Hf(e),n=Hf(i.get());return ca(n,t)}function e3(i,e=i.loop,t=i.to){const n=gl(e);if(n){const r=n!==!0&&ZR(n),s=(r||i).reverse,a=!r||r.reset;return Wf({...i,loop:e,default:!1,pause:void 0,to:!s||xx(t)?t:void 0,from:a?i.from:void 0,reset:a,...r})}}function Wf(i){const{to:e,from:t}=i=ZR(i),n=new Set;return tt.obj(e)&&ST(e,n),tt.obj(t)&&ST(t,n),i.keys=n.size?Array.from(n):null,i}function C8(i){const e=Wf(i);return tt.und(e.default)&&(e.default=eb(e)),e}function ST(i,e){Ea(i,(t,n)=>t!=null&&e.add(n))}var R8=["onStart","onRest","onChange","onPause","onResume"];function ET(i,e,t){i.animation[t]=e[t]!==YR(e,t)?qR(e[t],i.key):void 0}function Lh(i,e,...t){i.animation[e]?.(...t),i.defaultProps[e]?.(...t)}var D8=["onStart","onChange","onRest"],U8=1,O8=class{constructor(e,t){this.id=U8++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];tt.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Wf(e)),this}start(e){let{queue:t}=this;return e?t=kr(e).map(Wf):this.queue=[],this._flush?this._flush(this,t):(s3(this,t),wx(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;en(kr(t),r=>n[r].stop(!!e))}else Vf(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(tt.und(e))this.start({pause:!0});else{const t=this.springs;en(kr(e),n=>t[n].pause())}return this}resume(e){if(tt.und(e))this.start({pause:!1});else{const t=this.springs;en(kr(e),n=>t[n].resume())}return this}each(e){Ea(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,s=this._changed.size>0;(r&&!this._started||s&&!this._started)&&(this._started=!0,hf(e,([l,c])=>{c.value=this.get(),l(c,this,this._item)}));const a=!r&&this._started,o=s||a&&n.size?this.get():null;s&&t.size&&hf(t,([l,c])=>{c.value=o,l(c,this,this._item)}),a&&(this._started=!1,hf(n,([l,c])=>{c.value=o,l(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;At.onFrame(this._onFrame)}};function wx(i,e){return Promise.all(e.map(t=>t3(i,t))).then(t=>tb(i,t))}async function t3(i,e,t){const{keys:n,to:r,from:s,loop:a,onRest:o,onResolve:l}=e,c=tt.obj(e.default)&&e.default;a&&(e.loop=!1),r===!1&&(e.to=null),s===!1&&(e.from=null);const f=tt.arr(r)||tt.fun(r)?r:void 0;f?(e.to=void 0,e.onRest=void 0,c&&(c.onRest=void 0)):en(D8,x=>{const _=e[x];if(tt.fun(_)){const g=i._events[x];e[x]=({finished:b,cancelled:S})=>{const E=g.get(_);E?(b||(E.finished=!1),S&&(E.cancelled=!0)):g.set(_,{value:null,finished:b||!1,cancelled:S||!1})},c&&(c[x]=e[x])}});const d=i._state;e.pause===!d.paused?(d.paused=e.pause,Jh(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);const p=(n||Object.keys(i.springs)).map(x=>i.springs[x].start(e)),m=e.cancel===!0||YR(e,"cancel")===!0;(f||m&&d.asyncId)&&p.push(KR(++i._lastAsyncId,{props:e,state:d,actions:{pause:vx,resume:vx,start(x,_){m?(Vf(d,i._lastAsyncId),_(au(i))):(x.onRest=o,_(QR(f,x,d,i)))}}})),d.paused&&await new Promise(x=>{d.resumeQueue.add(x)});const v=tb(i,await Promise.all(p));if(a&&v.finished&&!(t&&v.noop)){const x=e3(e,a,r);if(x)return s3(i,[x]),t3(i,x,!0)}return l&&At.batchedUpdates(()=>l(v,i,i.item)),v}function MT(i,e){const t={...i.springs};return e&&en(kr(e),n=>{tt.und(n.keys)&&(n=Wf(n)),tt.obj(n.to)||(n={...n,to:void 0}),r3(t,n,r=>i3(r))}),n3(i,t),t}function n3(i,e){Ea(e,(t,n)=>{i.springs[n]||(i.springs[n]=t,ad(t,i))})}function i3(i,e){const t=new A8;return t.key=i,e&&ad(t,e),t}function r3(i,e,t){e.keys&&en(e.keys,n=>{(i[n]||(i[n]=t(n)))._prepareNode(e)})}function s3(i,e){en(e,t=>{r3(i.springs,t,n=>i3(n,i))})}var L8=Z.createContext({pause:!1,immediate:!1}),N8=()=>{const i=[],e=function(n){s8();const r=[];return en(i,(s,a)=>{if(tt.und(n))r.push(s.start());else{const o=t(n,s,a);o&&r.push(s.start(o))}}),r};e.current=i,e.add=function(n){i.includes(n)||i.push(n)},e.delete=function(n){const r=i.indexOf(n);~r&&i.splice(r,1)},e.pause=function(){return en(i,n=>n.pause(...arguments)),this},e.resume=function(){return en(i,n=>n.resume(...arguments)),this},e.set=function(n){en(i,(r,s)=>{const a=tt.fun(n)?n(s,r):n;a&&r.set(a)})},e.start=function(n){const r=[];return en(i,(s,a)=>{if(tt.und(n))r.push(s.start());else{const o=this._getProps(n,s,a);o&&r.push(s.start(o))}}),r},e.stop=function(){return en(i,n=>n.stop(...arguments)),this},e.update=function(n){return en(i,(r,s)=>r.update(this._getProps(n,r,s))),this};const t=function(n,r,s){return tt.fun(n)?n(s,r):n};return e._getProps=t,e};function I8(i,e,t){const n=tt.fun(e)&&e;n&&!t&&(t=[]);const r=Z.useMemo(()=>n||arguments.length==3?N8():void 0,[]),s=Z.useRef(0),a=GR(),o=Z.useMemo(()=>({ctrls:[],queue:[],flush(g,b){const S=MT(g,b);return s.current>0&&!o.queue.length&&!Object.keys(S).some(w=>!g.springs[w])?wx(g,b):new Promise(w=>{n3(g,S),o.queue.push(()=>{w(wx(g,b))}),a()})}}),[]),l=Z.useRef([...o.ctrls]),c=Z.useRef([]),f=fT(i)||0;Z.useMemo(()=>{en(l.current.slice(i,f),g=>{x8(g,r),g.stop(!0)}),l.current.length=i,d(f,i)},[i]),Z.useMemo(()=>{d(0,Math.min(f,i))},t);function d(g,b){for(let S=g;S<b;S++){const E=l.current[S]||(l.current[S]=new O8(null,o.flush)),w=n?n(S,E):e[S];w&&(c.current[S]=C8(w))}}const p=l.current.map((g,b)=>MT(g,c.current[b])),m=Z.useContext(L8),v=fT(m),x=m!==v&&_8(m);J1(()=>{s.current++,o.ctrls=l.current;const{queue:g}=o;g.length&&(o.queue=[],en(g,b=>b())),en(l.current,(b,S)=>{r?.add(b),x&&b.start({default:m});const E=c.current[S];E&&(b8(b,E.ref),b.ref?b.queue.push(E):b.start(E))})}),HR(()=>()=>{en(o.ctrls,g=>g.stop(!0))});const _=p.map(g=>({...g}));return r?[_,r]:_}function _r(i,e){const t=tt.fun(i),[[n],r]=I8(1,t?i:[i],t?e||[]:e);return t||arguments.length==2?[n,r]:n}var P8=class extends nb{constructor(i,e){super(),this.source=i,this.idle=!0,this._active=new Set,this.calc=Bf(...e);const t=this._get(),n=_x(t);Q1(this,n.create(t))}advance(i){const e=this._get(),t=this.get();ca(e,t)||(Ms(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&wT(this._active)&&S_(this)}_get(){const i=tt.arr(this.source)?this.source.map(Nr):kr(Nr(this.source));return this.calc(...i)}_start(){this.idle&&!wT(this._active)&&(this.idle=!1,en(g0(this),i=>{i.done=!1}),cs.skipAnimation?(At.batchedUpdates(()=>this.advance()),S_(this)):f0.start(this))}_attach(){let i=1;en(kr(this.source),e=>{ws(e)&&ad(e,this),Sx(e)&&(e.idle||this._active.add(e),i=Math.max(i,e.priority+1))}),this.priority=i,this._start()}_detach(){en(kr(this.source),i=>{ws(i)&&vg(i,this)}),this._active.clear(),S_(this)}eventObserved(i){i.type=="change"?i.idle?this.advance():(this._active.add(i.parent),this._start()):i.type=="idle"?this._active.delete(i.parent):i.type=="priority"&&(this.priority=kr(this.source).reduce((e,t)=>Math.max(e,(Sx(t)?t.priority:0)+1),0))}};function z8(i){return i.idle!==!1}function wT(i){return!i.size||Array.from(i).every(z8)}function S_(i){i.idle||(i.idle=!0,en(g0(i),e=>{e.done=!0}),gg(i,{type:"idle",parent:i}))}cs.assign({createStringInterpolator:BR,to:(i,e)=>new P8(i,e)});var F8=["primitive"].concat(Object.keys(bC).filter(i=>/^[A-Z]/.test(i)).map(i=>i[0].toLowerCase()+i.slice(1)));cs.assign({createStringInterpolator:BR,colors:P6,frameLoop:"demand"});T5(()=>{At.advance()});var B8=p8(F8,{applyAnimatedValues:da}),Bn=B8.animated;function Il(){return Il=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Il.apply(null,arguments)}const od=new Q,ib=new Q,k8=new Q,TT=new Ge;function G8(i,e,t){const n=od.setFromMatrixPosition(i.matrixWorld);n.project(e);const r=t.width/2,s=t.height/2;return[n.x*r+r,-(n.y*s)+s]}function H8(i,e){const t=od.setFromMatrixPosition(i.matrixWorld),n=ib.setFromMatrixPosition(e.matrixWorld),r=t.sub(n),s=e.getWorldDirection(k8);return r.angleTo(s)>Math.PI/2}function V8(i,e,t,n){const r=od.setFromMatrixPosition(i.matrixWorld),s=r.clone();s.project(e),TT.set(s.x,s.y),t.setFromCamera(TT,e);const a=t.intersectObjects(n,!0);if(a.length){const o=a[0].distance;return r.distanceTo(t.ray.origin)<o}return!0}function W8(i,e){if(e instanceof Bl)return e.zoom;if(e instanceof Kn){const t=od.setFromMatrixPosition(i.matrixWorld),n=ib.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(n);return 1/(2*Math.tan(r/2)*s)}else return 1}function X8(i,e,t){if(e instanceof Kn||e instanceof Bl){const n=od.setFromMatrixPosition(i.matrixWorld),r=ib.setFromMatrixPosition(e.matrixWorld),s=n.distanceTo(r),a=(t[1]-t[0])/(e.far-e.near),o=t[1]-a*e.far;return Math.round(a*s+o)}}const Tx=i=>Math.abs(i)<1e-10?0:i;function a3(i,e,t=""){let n="matrix3d(";for(let r=0;r!==16;r++)n+=Tx(e[r]*i.elements[r])+(r!==15?",":")");return t+n}const j8=(i=>e=>a3(e,i))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),q8=(i=>(e,t)=>a3(e,i(t),"translate(-50%,-50%)"))(i=>[1/i,1/i,1/i,1,-1/i,-1/i,-1/i,-1,1/i,1/i,1/i,1,1,1,1,1]);function Y8(i){return i&&typeof i=="object"&&"current"in i}const rb=Z.forwardRef(({children:i,eps:e=.001,style:t,className:n,prepend:r,center:s,fullscreen:a,portal:o,distanceFactor:l,sprite:c=!1,transform:f=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:v,material:x,geometry:_,zIndexRange:g=[16777271,0],calculatePosition:b=G8,as:S="div",wrapperClass:E,pointerEvents:w="auto",...T},C)=>{const{gl:U,camera:D,scene:R,size:I,raycaster:z,events:O,viewport:V}=Jn(),[ee]=Z.useState(()=>document.createElement(S)),P=Z.useRef(null),L=Z.useRef(null),k=Z.useRef(0),H=Z.useRef([0,0]),W=Z.useRef(null),F=Z.useRef(null),Y=o?.current||O.connected||U.domElement.parentNode,K=Z.useRef(null),j=Z.useRef(!1),J=Z.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&Y8(d[0]),[d]);Z.useLayoutEffect(()=>{const be=U.domElement;d&&d==="blending"?(be.style.zIndex=`${Math.floor(g[0]/2)}`,be.style.position="absolute",be.style.pointerEvents="none"):(be.style.zIndex=null,be.style.position=null,be.style.pointerEvents=null)},[d]),Z.useLayoutEffect(()=>{if(L.current){const be=P.current=HU.createRoot(ee);if(R.updateMatrixWorld(),f)ee.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ve=b(L.current,D,I);ee.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ve[0]}px,${ve[1]}px,0);transform-origin:0 0;`}return Y&&(r?Y.prepend(ee):Y.appendChild(ee)),()=>{Y&&Y.removeChild(ee),be.unmount()}}},[Y,f]),Z.useLayoutEffect(()=>{E&&(ee.className=E)},[E]);const he=Z.useMemo(()=>f?{position:"absolute",top:0,left:0,width:I.width,height:I.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...a&&{top:-I.height/2,left:-I.width/2,width:I.width,height:I.height},...t},[t,s,a,I,f]),re=Z.useMemo(()=>({position:"absolute",pointerEvents:w}),[w]);Z.useLayoutEffect(()=>{if(j.current=!1,f){var be;(be=P.current)==null||be.render(Z.createElement("div",{ref:W,style:he},Z.createElement("div",{ref:F,style:re},Z.createElement("div",{ref:C,className:n,style:t,children:i}))))}else{var ve;(ve=P.current)==null||ve.render(Z.createElement("div",{ref:C,style:he,className:n,children:i}))}});const pe=Z.useRef(!0);s0(be=>{if(L.current){D.updateMatrixWorld(),L.current.updateWorldMatrix(!0,!1);const ve=f?H.current:b(L.current,D,I);if(f||Math.abs(k.current-D.zoom)>e||Math.abs(H.current[0]-ve[0])>e||Math.abs(H.current[1]-ve[1])>e){const ce=H8(L.current,D);let Ne=!1;J&&(Array.isArray(d)?Ne=d.map(Me=>Me.current):d!=="blending"&&(Ne=[R]));const G=pe.current;if(Ne){const Me=V8(L.current,D,z,Ne);pe.current=Me&&!ce}else pe.current=!ce;G!==pe.current&&(p?p(!pe.current):ee.style.display=pe.current?"block":"none");const le=Math.floor(g[0]/2),te=d?J?[g[0],le]:[le-1,0]:g;if(ee.style.zIndex=`${X8(L.current,D,te)}`,f){const[Me,oe]=[I.width/2,I.height/2],De=D.projectionMatrix.elements[5]*oe,{isOrthographicCamera:_e,top:ne,left:Be,bottom:X,right:B}=D,ie=j8(D.matrixWorldInverse),Se=_e?`scale(${De})translate(${Tx(-(B+Be)/2)}px,${Tx((ne+X)/2)}px)`:`translateZ(${De}px)`;let ge=L.current.matrixWorld;c&&(ge=D.matrixWorldInverse.clone().transpose().copyPosition(ge).scale(L.current.scale),ge.elements[3]=ge.elements[7]=ge.elements[11]=0,ge.elements[15]=1),ee.style.width=I.width+"px",ee.style.height=I.height+"px",ee.style.perspective=_e?"":`${De}px`,W.current&&F.current&&(W.current.style.transform=`${Se}${ie}translate(${Me}px,${oe}px)`,F.current.style.transform=q8(ge,1/((l||10)/400)))}else{const Me=l===void 0?1:W8(L.current,D)*l;ee.style.transform=`translate3d(${ve[0]}px,${ve[1]}px,0) scale(${Me})`}H.current=ve,k.current=D.zoom}}if(!J&&K.current&&!j.current)if(f){if(W.current){const ve=W.current.children[0];if(ve!=null&&ve.clientWidth&&ve!=null&&ve.clientHeight){const{isOrthographicCamera:ce}=D;if(ce||_)T.scale&&(Array.isArray(T.scale)?T.scale instanceof Q?K.current.scale.copy(T.scale.clone().divideScalar(1)):K.current.scale.set(1/T.scale[0],1/T.scale[1],1/T.scale[2]):K.current.scale.setScalar(1/T.scale));else{const Ne=(l||10)/400,G=ve.clientWidth*Ne,le=ve.clientHeight*Ne;K.current.scale.set(G,le,1)}j.current=!0}}}else{const ve=ee.children[0];if(ve!=null&&ve.clientWidth&&ve!=null&&ve.clientHeight){const ce=1/V.factor,Ne=ve.clientWidth*ce,G=ve.clientHeight*ce;K.current.scale.set(Ne,G,1),j.current=!0}K.current.lookAt(be.camera.position)}});const Oe=Z.useMemo(()=>({vertexShader:f?void 0:`
3886
+ */var zM;function B4(){return zM||(zM=1,function(i){function e(P,L){var k=P.length;P.push(L);e:for(;0<k;){var H=k-1>>>1,W=P[H];if(0<r(W,L))P[H]=L,P[k]=W,k=H;else break e}}function t(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var L=P[0],k=P.pop();if(k!==L){P[0]=k;e:for(var H=0,W=P.length,F=W>>>1;H<F;){var Y=2*(H+1)-1,K=P[Y],j=Y+1,J=P[j];if(0>r(K,k))j<W&&0>r(J,K)?(P[H]=J,P[j]=k,H=j):(P[H]=K,P[Y]=k,H=Y);else if(j<W&&0>r(J,k))P[H]=J,P[j]=k,H=j;else break e}}return L}function r(P,L){var k=P.sortIndex-L.sortIndex;return k!==0?k:P.id-L.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();i.unstable_now=function(){return a.now()-o}}var l=[],c=[],f=1,d=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function S(P){for(var L=t(c);L!==null;){if(L.callback===null)n(c);else if(L.startTime<=P)n(c),L.sortIndex=L.expirationTime,e(l,L);else break;L=t(c)}}function E(P){if(x=!1,S(P),!v)if(t(l)!==null)v=!0,V();else{var L=t(c);L!==null&&ee(E,L.startTime-P)}}var w=!1,T=-1,C=5,U=-1;function D(){return!(i.unstable_now()-U<C)}function R(){if(w){var P=i.unstable_now();U=P;var L=!0;try{e:{v=!1,x&&(x=!1,g(T),T=-1),m=!0;var k=p;try{t:{for(S(P),d=t(l);d!==null&&!(d.expirationTime>P&&D());){var H=d.callback;if(typeof H=="function"){d.callback=null,p=d.priorityLevel;var W=H(d.expirationTime<=P);if(P=i.unstable_now(),typeof W=="function"){d.callback=W,S(P),L=!0;break t}d===t(l)&&n(l),S(P)}else n(l);d=t(l)}if(d!==null)L=!0;else{var F=t(c);F!==null&&ee(E,F.startTime-P),L=!1}}break e}finally{d=null,p=k,m=!1}L=void 0}}finally{L?I():w=!1}}}var I;if(typeof b=="function")I=function(){b(R)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,O=z.port2;z.port1.onmessage=R,I=function(){O.postMessage(null)}}else I=function(){_(R,0)};function V(){w||(w=!0,I())}function ee(P,L){T=_(function(){P(i.unstable_now())},L)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(P){P.callback=null},i.unstable_continueExecution=function(){v||m||(v=!0,V())},i.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<P?Math.floor(1e3/P):5},i.unstable_getCurrentPriorityLevel=function(){return p},i.unstable_getFirstCallbackNode=function(){return t(l)},i.unstable_next=function(P){switch(p){case 1:case 2:case 3:var L=3;break;default:L=p}var k=p;p=L;try{return P()}finally{p=k}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(P,L){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var k=p;p=P;try{return L()}finally{p=k}},i.unstable_scheduleCallback=function(P,L,k){var H=i.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?H+k:H):k=H,P){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=k+W,P={id:f++,callback:L,priorityLevel:P,startTime:k,expirationTime:W,sortIndex:-1},k>H?(P.sortIndex=k,e(c,P),t(l)===null&&P===t(c)&&(x?(g(T),T=-1):x=!0,ee(E,k-H))):(P.sortIndex=W,e(l,P),v||m||(v=!0,V())),P},i.unstable_shouldYield=D,i.unstable_wrapCallback=function(P){var L=p;return function(){var k=p;p=L;try{return P.apply(this,arguments)}finally{p=k}}}}(Iy)),Iy}var FM;function k4(){return FM||(FM=1,Ny.exports=B4()),Ny.exports}var BM=k4();const G4=i=>typeof i=="object"&&typeof i.then=="function",Np=[];function H4(i,e,t=(n,r)=>n===r){if(i===e)return!0;if(!i||!e)return!1;const n=i.length;if(e.length!==n)return!1;for(let r=0;r<n;r++)if(!t(i[r],e[r]))return!1;return!0}function V4(i,e=null,t=!1,n={}){e===null&&(e=[i]);for(const s of Np)if(H4(e,s.keys,s.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(s,"error"))throw s.error;if(Object.prototype.hasOwnProperty.call(s,"response"))return n.lifespan&&n.lifespan>0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,n.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:n.equal,remove:()=>{const s=Np.indexOf(r);s!==-1&&Np.splice(s,1)},promise:(G4(i)?i:i(...e)).then(s=>{r.response=s,n.lifespan&&n.lifespan>0&&(r.timeout=setTimeout(r.remove,n.lifespan))}).catch(s=>r.error=s)};if(Np.push(r),!t)throw r.promise}const W4=(i,e,t)=>V4(i,e,!1,t);function E1(i,e,t){if(!i)return;if(t(i)===!0)return i;let n=e?i.return:i.child;for(;n;){const r=E1(n,e,t);if(r)return r;n=e?null:n.sibling}}function SC(i){try{return Object.defineProperties(i,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return i}}const M1=SC(Z.createContext(null));let EC=class extends Z.Component{render(){return Z.createElement(M1.Provider,{value:this._reactInternals},this.props.children)}};function MC(){const i=Z.useContext(M1);if(i===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=Z.useId();return Z.useMemo(()=>{for(const t of[i,i?.alternate]){if(!t)continue;const n=E1(t,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(n)return n}},[i,e])}const X4=Symbol.for("react.context"),j4=i=>i!==null&&typeof i=="object"&&"$$typeof"in i&&i.$$typeof===X4;function q4(){const i=MC(),[e]=Z.useState(()=>new Map);e.clear();let t=i;for(;t;){const n=t.type;j4(n)&&n!==M1&&!e.has(n)&&e.set(n,Z.use(SC(n))),t=t.return}return e}function Y4(){const i=q4();return Z.useMemo(()=>Array.from(i.keys()).reduce((e,t)=>n=>Z.createElement(e,null,Z.createElement(t.Provider,{...n,value:i.get(t)})),e=>Z.createElement(EC,{...e})),[i])}function wC(i){let e=i.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const TC=i=>i&&i.isOrthographicCamera,Z4=i=>i&&i.hasOwnProperty("current"),K4=i=>i!=null&&(typeof i=="string"||typeof i=="number"||i.isColor),nd=((i,e)=>typeof window<"u"&&(((i=window.document)==null?void 0:i.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?Z.useLayoutEffect:Z.useEffect;function AC(i){const e=Z.useRef(i);return nd(()=>void(e.current=i),[i]),e}function J4(){const i=MC(),e=Y4();return Z.useMemo(()=>({children:t})=>{const r=!!E1(i,!0,s=>s.type===Z.StrictMode)?Z.StrictMode:Z.Fragment;return ue.jsx(r,{children:ue.jsx(e,{children:t})})},[i,e])}function Q4({set:i}){return nd(()=>(i(new Promise(()=>null)),()=>i(!1)),[i]),null}const $4=(i=>(i=class extends Z.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},i.getDerivedStateFromError=()=>({error:!0}),i))();function CC(i){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(i)?Math.min(Math.max(i[0],t),i[1]):i}function Ic(i){var e;return(e=i.__r3f)==null?void 0:e.root.getState()}const En={obj:i=>i===Object(i)&&!En.arr(i)&&typeof i!="function",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",boo:i=>typeof i=="boolean",und:i=>i===void 0,nul:i=>i===null,arr:i=>Array.isArray(i),equ(i,e,{arrays:t="shallow",objects:n="reference",strict:r=!0}={}){if(typeof i!=typeof e||!!i!=!!e)return!1;if(En.str(i)||En.num(i)||En.boo(i))return i===e;const s=En.obj(i);if(s&&n==="reference")return i===e;const a=En.arr(i);if(a&&t==="reference")return i===e;if((a||s)&&i===e)return!0;let o;for(o in i)if(!(o in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(o in r?e:i)if(!En.equ(i[o],e[o],{strict:r,objects:"reference"}))return!1}else for(o in r?e:i)if(i[o]!==e[o])return!1;if(En.und(o)){if(a&&i.length===0&&e.length===0||s&&Object.keys(i).length===0&&Object.keys(e).length===0)return!0;if(i!==e)return!1}return!0}};function e5(i){i.type!=="Scene"&&(i.dispose==null||i.dispose());for(const e in i){const t=i[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const RC=["children","key","ref"];function t5(i){const e={};for(const t in i)RC.includes(t)||(e[t]=i[t]);return e}function ng(i,e,t,n){const r=i;let s=r?.__r3f;return s||(s={root:e,type:t,parent:null,children:[],props:t5(n),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=s)),s}function Nf(i,e){let t=i[e];if(!e.includes("-"))return{root:i,key:e,target:t};t=i;for(const r of e.split("-")){var n;e=r,i=t,t=(n=t)==null?void 0:n[e]}return{root:i,key:e,target:t}}const kM=/-\d+$/;function ig(i,e){if(En.str(e.props.attach)){if(kM.test(e.props.attach)){const r=e.props.attach.replace(kM,""),{root:s,key:a}=Nf(i.object,r);Array.isArray(s[a])||(s[a]=[])}const{root:t,key:n}=Nf(i.object,e.props.attach);e.previousAttach=t[n],t[n]=e.object}else En.fun(e.props.attach)&&(e.previousAttach=e.props.attach(i.object,e.object))}function rg(i,e){if(En.str(e.props.attach)){const{root:t,key:n}=Nf(i.object,e.props.attach),r=e.previousAttach;r===void 0?delete t[n]:t[n]=r}else e.previousAttach==null||e.previousAttach(i.object,e.object);delete e.previousAttach}const tx=[...RC,"args","dispose","attach","object","onUpdate","dispose"],GM=new Map;function n5(i){let e=GM.get(i.constructor);try{e||(e=new i.constructor,GM.set(i.constructor,e))}catch{}return e}function i5(i,e){const t={};for(const n in e)if(!tx.includes(n)&&!En.equ(e[n],i.props[n])){t[n]=e[n];for(const r in e)r.startsWith(`${n}-`)&&(t[r]=e[r])}for(const n in i.props){if(tx.includes(n)||e.hasOwnProperty(n))continue;const{root:r,key:s}=Nf(i.object,n);if(r.constructor&&r.constructor.length===0){const a=n5(r);En.und(a)||(t[s]=a[s])}else t[s]=0}return t}const r5=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],s5=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function da(i,e){var t;const n=i.__r3f,r=n&&wC(n).getState(),s=n?.eventCount;for(const o in e){let l=e[o];if(tx.includes(o))continue;if(n&&s5.test(o)){typeof l=="function"?n.handlers[o]=l:delete n.handlers[o],n.eventCount=Object.keys(n.handlers).length;continue}if(l===void 0)continue;let{root:c,key:f,target:d}=Nf(i,o);if(d instanceof fu&&l instanceof fu)d.mask=l.mask;else if(d instanceof $e&&K4(l))d.set(l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof d.copy=="function"&&l!=null&&l.constructor&&d.constructor===l.constructor)d.copy(l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&Array.isArray(l))typeof d.fromArray=="function"?d.fromArray(l):d.set(...l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof l=="number")typeof d.setScalar=="function"?d.setScalar(l):d.set(l);else{var a;c[f]=l,r&&!r.linear&&r5.includes(f)&&(a=c[f])!=null&&a.isTexture&&c[f].format===Di&&c[f].type===Hr&&(c[f].colorSpace=Ri)}}if(n!=null&&n.parent&&r!=null&&r.internal&&(t=n.object)!=null&&t.isObject3D&&s!==n.eventCount){const o=n.object,l=r.internal.interaction.indexOf(o);l>-1&&r.internal.interaction.splice(l,1),n.eventCount&&o.raycast!==null&&r.internal.interaction.push(o)}return n&&n.props.attach===void 0&&(n.object.isBufferGeometry?n.props.attach="geometry":n.object.isMaterial&&(n.props.attach="material")),n&&Au(n),i}function Au(i){var e;if(!i.parent)return;i.props.onUpdate==null||i.props.onUpdate(i.object);const t=(e=i.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function a5(i,e){i.manual||(TC(i)?(i.left=e.width/-2,i.right=e.width/2,i.top=e.height/2,i.bottom=e.height/-2):i.aspect=e.width/e.height,i.updateProjectionMatrix())}const $i=i=>i?.isObject3D;function Ip(i){return(i.eventObject||i.object).uuid+"/"+i.index+i.instanceId}function DC(i,e,t,n){const r=t.get(e);r&&(t.delete(e),t.size===0&&(i.delete(n),r.target.releasePointerCapture(n)))}function o5(i,e){const{internal:t}=i.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,r)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((n,r)=>{DC(t.capturedMap,e,n,r)})}function l5(i){function e(l){const{internal:c}=i.getState(),f=l.offsetX-c.initialClick[0],d=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(f*f+d*d))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(f=>{var d;return(d=c.__r3f)==null?void 0:d.handlers["onPointer"+f]}))}function n(l,c){const f=i.getState(),d=new Set,p=[],m=c?c(f.internal.interaction):f.internal.interaction;for(let g=0;g<m.length;g++){const b=Ic(m[g]);b&&(b.raycaster.camera=void 0)}f.previousRoot||f.events.compute==null||f.events.compute(l,f);function v(g){const b=Ic(g);if(!b||!b.events.enabled||b.raycaster.camera===null)return[];if(b.raycaster.camera===void 0){var S;b.events.compute==null||b.events.compute(l,b,(S=b.previousRoot)==null?void 0:S.getState()),b.raycaster.camera===void 0&&(b.raycaster.camera=null)}return b.raycaster.camera?b.raycaster.intersectObject(g,!0):[]}let x=m.flatMap(v).sort((g,b)=>{const S=Ic(g.object),E=Ic(b.object);return!S||!E?g.distance-b.distance:E.events.priority-S.events.priority||g.distance-b.distance}).filter(g=>{const b=Ip(g);return d.has(b)?!1:(d.add(b),!0)});f.events.filter&&(x=f.events.filter(x,f));for(const g of x){let b=g.object;for(;b;){var _;(_=b.__r3f)!=null&&_.eventCount&&p.push({...g,eventObject:b}),b=b.parent}}if("pointerId"in l&&f.internal.capturedMap.has(l.pointerId))for(let g of f.internal.capturedMap.get(l.pointerId).values())d.has(Ip(g.intersection))||p.push(g.intersection);return p}function r(l,c,f,d){if(l.length){const p={stopped:!1};for(const m of l){let v=Ic(m.object);if(v||m.object.traverseAncestors(x=>{const _=Ic(x);if(_)return v=_,!1}),v){const{raycaster:x,pointer:_,camera:g,internal:b}=v,S=new Q(_.x,_.y,0).unproject(g),E=D=>{var R,I;return(R=(I=b.capturedMap.get(D))==null?void 0:I.has(m.eventObject))!=null?R:!1},w=D=>{const R={intersection:m,target:c.target};b.capturedMap.has(D)?b.capturedMap.get(D).set(m.eventObject,R):b.capturedMap.set(D,new Map([[m.eventObject,R]])),c.target.setPointerCapture(D)},T=D=>{const R=b.capturedMap.get(D);R&&DC(b.capturedMap,m.eventObject,R,D)};let C={};for(let D in c){let R=c[D];typeof R!="function"&&(C[D]=R)}let U={...m,...C,pointer:_,intersections:l,stopped:p.stopped,delta:f,unprojectedPoint:S,ray:x.ray,camera:g,stopPropagation(){const D="pointerId"in c&&b.capturedMap.get(c.pointerId);if((!D||D.has(m.eventObject))&&(U.stopped=p.stopped=!0,b.hovered.size&&Array.from(b.hovered.values()).find(R=>R.eventObject===m.eventObject))){const R=l.slice(0,l.indexOf(m));s([...R,m])}},target:{hasPointerCapture:E,setPointerCapture:w,releasePointerCapture:T},currentTarget:{hasPointerCapture:E,setPointerCapture:w,releasePointerCapture:T},nativeEvent:c};if(d(U),p.stopped===!0)break}}}return l}function s(l){const{internal:c}=i.getState();for(const f of c.hovered.values())if(!l.length||!l.find(d=>d.object===f.object&&d.index===f.index&&d.instanceId===f.instanceId)){const p=f.eventObject.__r3f;if(c.hovered.delete(Ip(f)),p!=null&&p.eventCount){const m=p.handlers,v={...f,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function a(l,c){for(let f=0;f<c.length;f++){const d=c[f].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(l)}}function o(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return c=>{const{internal:f}=i.getState();"pointerId"in c&&f.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(c.pointerId)&&(f.capturedMap.delete(c.pointerId),s([]))})}}return function(f){const{onPointerMissed:d,internal:p}=i.getState();p.lastEvent.current=f;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=n(f,m?t:void 0),g=v?e(f):0;l==="onPointerDown"&&(p.initialClick=[f.offsetX,f.offsetY],p.initialHits=_.map(S=>S.eventObject)),v&&!_.length&&g<=2&&(a(f,p.interaction),d&&d(f)),m&&s(_);function b(S){const E=S.eventObject,w=E.__r3f;if(!(w!=null&&w.eventCount))return;const T=w.handlers;if(m){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const C=Ip(S),U=p.hovered.get(C);U?U.stopped&&S.stopPropagation():(p.hovered.set(C,S),T.onPointerOver==null||T.onPointerOver(S),T.onPointerEnter==null||T.onPointerEnter(S))}T.onPointerMove==null||T.onPointerMove(S)}else{const C=T[l];C?(!v||p.initialHits.includes(E))&&(a(f,p.interaction.filter(U=>!p.initialHits.includes(U))),C(S)):v&&p.initialHits.includes(E)&&a(f,p.interaction.filter(U=>!p.initialHits.includes(U)))}}r(_,f,g,b)}}return{handlePointer:o}}const HM=i=>!!(i!=null&&i.render),UC=Z.createContext(null),c5=(i,e)=>{const t=O4((o,l)=>{const c=new Q,f=new Q,d=new Q;function p(g=l().camera,b=f,S=l().size){const{width:E,height:w,top:T,left:C}=S,U=E/w;b.isVector3?d.copy(b):d.set(...b);const D=g.getWorldPosition(c).distanceTo(d);if(TC(g))return{width:E/g.zoom,height:w/g.zoom,top:T,left:C,factor:1,distance:D,aspect:U};{const R=g.fov*Math.PI/180,I=2*Math.tan(R/2)*D,z=I*(E/w);return{width:z,height:I,top:T,left:C,factor:E/z,distance:D,aspect:U}}}let m;const v=g=>o(b=>({performance:{...b.performance,current:g}})),x=new Ge;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(g=1)=>i(l(),g),advance:(g,b)=>e(g,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new g1,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>o(b=>({...b,events:{...b.events,...g}})),setSize:(g,b,S=0,E=0)=>{const w=l().camera,T={width:g,height:b,top:S,left:E};o(C=>({size:T,viewport:{...C.viewport,...p(w,f,T)}}))},setDpr:g=>o(b=>{const S=CC(g);return{viewport:{...b.viewport,dpr:S,initialDpr:b.viewport.initialDpr||S}}}),setFrameloop:(g="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,g!=="never"&&(b.start(),b.elapsedTime=0),o(()=>({frameloop:g}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:Z.createRef(),active:!1,frames:0,priority:0,subscribe:(g,b,S)=>{const E=l().internal;return E.priority=E.priority+(b>0?1:0),E.subscribers.push({ref:g,priority:b,store:S}),E.subscribers=E.subscribers.sort((w,T)=>w.priority-T.priority),()=>{const w=l().internal;w!=null&&w.subscribers&&(w.priority=w.priority-(b>0?1:0),w.subscribers=w.subscribers.filter(T=>T.ref!==g))}}}}}),n=t.getState();let r=n.size,s=n.viewport.dpr,a=n.camera;return t.subscribe(()=>{const{camera:o,size:l,viewport:c,gl:f,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){r=l,s=c.dpr,a5(o,l),c.dpr>0&&f.setPixelRatio(c.dpr);const p=typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(l.width,l.height,p)}o!==a&&(a=o,d(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(o)}})))}),t.subscribe(o=>i(o)),t};function OC(){const i=Z.useContext(UC);if(!i)throw new Error("R3F: Hooks can only be used within the Canvas component!");return i}function Jn(i=t=>t,e){return OC()(i,e)}function s0(i,e=0){const t=OC(),n=t.getState().internal.subscribe,r=AC(i);return nd(()=>n(r,e,t),[e,n,t]),null}function u5(i){const e=F4(i);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Z.version}),e}const LC=0,mu={},h5=/^three(?=[A-Z])/,a0=i=>`${i[0].toUpperCase()}${i.slice(1)}`;let f5=0;const d5=i=>typeof i=="function";function NC(i){if(d5(i)){const e=`${f5++}`;return mu[e]=i,e}else Object.assign(mu,i)}function IC(i,e){const t=a0(i),n=mu[t];if(i!=="primitive"&&!n)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(i==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function p5(i,e,t){var n;return i=a0(i)in mu?i:i.replace(h5,""),IC(i,e),i==="primitive"&&(n=e.object)!=null&&n.__r3f&&delete e.object.__r3f,ng(e.object,t,i,e)}function m5(i){if(!i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?rg(i.parent,i):$i(i.object)&&(i.object.visible=!1),i.isHidden=!0,Au(i)}}function PC(i){if(i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?ig(i.parent,i):$i(i.object)&&i.props.visible!==!1&&(i.object.visible=!0),i.isHidden=!1,Au(i)}}function w1(i,e,t){const n=e.root.getState();if(!(!i.parent&&i.object!==n.scene)){if(!e.object){var r,s;const a=mu[a0(e.type)];e.object=(r=e.props.object)!=null?r:new a(...(s=e.props.args)!=null?s:[]),e.object.__r3f=e}if(da(e.object,e.props),e.props.attach)ig(i,e);else if($i(e.object)&&$i(i.object)){const a=i.object.children.indexOf(t?.object);if(t&&a!==-1){const o=i.object.children.indexOf(e.object);if(o!==-1){i.object.children.splice(o,1);const l=o<a?a-1:a;i.object.children.splice(l,0,e.object)}else e.object.parent=i.object,i.object.children.splice(a,0,e.object),e.object.dispatchEvent({type:"added"}),i.object.dispatchEvent({type:"childadded",child:e.object})}else i.object.add(e.object)}for(const a of e.children)w1(e,a);Au(e)}}function Py(i,e){e&&(e.parent=i,i.children.push(e),w1(i,e))}function VM(i,e,t){if(!e||!t)return;e.parent=i;const n=i.children.indexOf(t);n!==-1?i.children.splice(n,0,e):i.children.push(e),w1(i,e,t)}function zC(i){if(typeof i.dispose=="function"){const e=()=>{try{i.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():BM.unstable_scheduleCallback(BM.unstable_IdlePriority,e)}}function nx(i,e,t){if(!e)return;e.parent=null;const n=i.children.indexOf(e);n!==-1&&i.children.splice(n,1),e.props.attach?rg(i,e):$i(e.object)&&$i(i.object)&&(i.object.remove(e.object),o5(wC(e),e.object));const r=e.props.dispose!==null&&t!==!1;for(let s=e.children.length-1;s>=0;s--){const a=e.children[s];nx(e,a,r)}e.children.length=0,delete e.object.__r3f,r&&e.type!=="primitive"&&e.object.type!=="Scene"&&zC(e.object),t===void 0&&Au(e)}function g5(i,e){for(const t of[i,i.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const n=t.ref(e);typeof n=="function"&&(t.refCleanup=n)}else t.ref&&(t.ref.current=e)}const om=[];function v5(){for(const[t]of om){const n=t.parent;if(n){t.props.attach?rg(n,t):$i(t.object)&&$i(n.object)&&n.object.remove(t.object);for(const r of t.children)r.props.attach?rg(t,r):$i(r.object)&&$i(t.object)&&t.object.remove(r.object)}t.isHidden&&PC(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&zC(t.object)}for(const[t,n,r]of om){t.props=n;const s=t.parent;if(s){var i,e;const a=mu[a0(t.type)];t.object=(i=t.props.object)!=null?i:new a(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,g5(r,t.object),da(t.object,t.props),t.props.attach?ig(s,t):$i(t.object)&&$i(s.object)&&s.object.add(t.object);for(const o of t.children)o.props.attach?ig(t,o):$i(o.object)&&$i(t.object)&&t.object.add(o.object);Au(t)}}om.length=0}const zy=()=>{},WM={};let Pp=LC;const y5=0,_5=4,ix=u5({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:p5,removeChild:nx,appendChild:Py,appendInitialChild:Py,insertBefore:VM,appendChildToContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||Py(t,e)},removeChildFromContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||nx(t,e)},insertInContainerBefore(i,e,t){const n=i.getState().scene.__r3f;!e||!t||!n||VM(n,e,t)},getRootHostContext:()=>WM,getChildHostContext:()=>WM,commitUpdate(i,e,t,n,r){var s,a,o;IC(e,n);let l=!1;if((i.type==="primitive"&&t.object!==n.object||((s=n.args)==null?void 0:s.length)!==((a=t.args)==null?void 0:a.length)||(o=n.args)!=null&&o.some((f,d)=>{var p;return f!==((p=t.args)==null?void 0:p[d])}))&&(l=!0),l)om.push([i,{...n},r]);else{const f=i5(i,n);Object.keys(f).length&&(Object.assign(i.props,f),da(i.object,f))}(r.sibling===null||(r.flags&_5)===y5)&&v5()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:i=>i?.object,prepareForCommit:()=>null,preparePortalMount:i=>ng(i.getState().scene,i,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:m5,unhideInstance:PC,createTextInstance:zy,hideTextInstance:zy,unhideTextInstance:zy,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:Z.createContext(null),setCurrentUpdatePriority(i){Pp=i},getCurrentUpdatePriority(){return Pp},resolveUpdatePriority(){var i;if(Pp!==LC)return Pp;switch(typeof window<"u"&&((i=window.event)==null?void 0:i.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return am.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return am.ContinuousEventPriority;default:return am.DefaultEventPriority}},resetFormInstance(){}}),Ol=new Map,Pc={objects:"shallow",strict:!1};function x5(i,e){if(!e&&typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&i.parentElement){const{width:t,height:n,top:r,left:s}=i.parentElement.getBoundingClientRect();return{width:t,height:n,top:r,left:s}}else if(!e&&typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function b5(i){const e=Ol.get(i),t=e?.fiber,n=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=n||c5(ax,jM),a=t||ix.createContainer(s,am.ConcurrentRoot,null,!1,null,"",r,r,r,null);e||Ol.set(i,{fiber:a,store:s});let o,l,c=!1,f=null;return{async configure(d={}){let p;f=new Promise(F=>p=F);let{gl:m,size:v,scene:x,events:_,onCreated:g,shadows:b=!1,linear:S=!1,flat:E=!1,legacy:w=!1,orthographic:T=!1,frameloop:C="always",dpr:U=[1,2],performance:D,raycaster:R,camera:I,onPointerMissed:z}=d,O=s.getState(),V=O.gl;if(!O.gl){const F={canvas:i,powerPreference:"high-performance",antialias:!0,alpha:!0},Y=typeof m=="function"?await m(F):m;HM(Y)?V=Y:V=new xC({...F,...m}),O.set({gl:V})}let ee=O.raycaster;ee||O.set({raycaster:ee=new x1});const{params:P,...L}=R||{};if(En.equ(L,ee,Pc)||da(ee,{...L}),En.equ(P,ee.params,Pc)||da(ee,{params:{...ee.params,...P}}),!O.camera||O.camera===l&&!En.equ(l,I,Pc)){l=I;const F=I?.isCamera,Y=F?I:T?new Bl(0,0,0,0,.1,1e3):new Kn(75,0,.1,1e3);F||(Y.position.z=5,I&&(da(Y,I),Y.manual||("aspect"in I||"left"in I||"right"in I||"bottom"in I||"top"in I)&&(Y.manual=!0,Y.updateProjectionMatrix())),!O.camera&&!(I!=null&&I.rotation)&&Y.lookAt(0,0,0)),O.set({camera:Y}),ee.camera=Y}if(!O.scene){let F;x!=null&&x.isScene?(F=x,ng(F,s,"",{})):(F=new zg,ng(F,s,"",{}),x&&da(F,x)),O.set({scene:F})}_&&!O.events.handlers&&O.set({events:_(s)});const k=x5(i,v);if(En.equ(k,O.size,Pc)||O.setSize(k.width,k.height,k.top,k.left),U&&O.viewport.dpr!==CC(U)&&O.setDpr(U),O.frameloop!==C&&O.setFrameloop(C),O.onPointerMissed||O.set({onPointerMissed:z}),D&&!En.equ(D,O.performance,Pc)&&O.set(F=>({performance:{...F.performance,...D}})),!O.xr){var H;const F=(j,J)=>{const he=s.getState();he.frameloop!=="never"&&jM(j,!0,he,J)},Y=()=>{const j=s.getState();j.gl.xr.enabled=j.gl.xr.isPresenting,j.gl.xr.setAnimationLoop(j.gl.xr.isPresenting?F:null),j.gl.xr.isPresenting||ax(j)},K={connect(){const j=s.getState().gl;j.xr.addEventListener("sessionstart",Y),j.xr.addEventListener("sessionend",Y)},disconnect(){const j=s.getState().gl;j.xr.removeEventListener("sessionstart",Y),j.xr.removeEventListener("sessionend",Y)}};typeof((H=V.xr)==null?void 0:H.addEventListener)=="function"&&K.connect(),O.set({xr:K})}if(V.shadowMap){const F=V.shadowMap.enabled,Y=V.shadowMap.type;if(V.shadowMap.enabled=!!b,En.boo(b))V.shadowMap.type=$h;else if(En.str(b)){var W;const K={basic:wA,percentage:Eg,soft:$h,variance:is};V.shadowMap.type=(W=K[b])!=null?W:$h}else En.obj(b)&&Object.assign(V.shadowMap,b);(F!==V.shadowMap.enabled||Y!==V.shadowMap.type)&&(V.shadowMap.needsUpdate=!0)}return Gt.enabled=!w,c||(V.outputColorSpace=S?mo:Ri,V.toneMapping=E?As:Ix),O.legacy!==w&&O.set(()=>({legacy:w})),O.linear!==S&&O.set(()=>({linear:S})),O.flat!==E&&O.set(()=>({flat:E})),m&&!En.fun(m)&&!HM(m)&&!En.equ(m,V,Pc)&&da(V,m),o=g,c=!0,p(),this},render(d){return!c&&!f&&this.configure(),f.then(()=>{ix.updateContainer(ue.jsx(S5,{store:s,children:d,onCreated:o,rootElement:i}),a,null,()=>{})}),s},unmount(){FC(i)}}}function S5({store:i,children:e,onCreated:t,rootElement:n}){return nd(()=>{const r=i.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),i.getState().events.connected||r.events.connect==null||r.events.connect(n)},[]),ue.jsx(UC.Provider,{value:i,children:e})}function FC(i,e){const t=Ol.get(i),n=t?.fiber;if(n){const r=t?.store.getState();r&&(r.internal.active=!1),ix.updateContainer(null,n,null,()=>{r&&setTimeout(()=>{try{var s,a,o,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(a=s.renderLists)==null||a.dispose==null||a.dispose(),(o=r.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),e5(r.scene),Ol.delete(i)}catch{}},500)})}}function E5(i,e){const t={callback:i};return e.add(t),()=>void e.delete(t)}const BC=new Set,M5=new Set,w5=new Set,T5=i=>E5(i,BC);function Fy(i,e){if(i.size)for(const{callback:t}of i.values())t(e)}function uf(i,e){switch(i){case"before":return Fy(BC,e);case"after":return Fy(M5,e);case"tail":return Fy(w5,e)}}let By,ky;function rx(i,e,t){let n=e.clock.getDelta();e.frameloop==="never"&&typeof i=="number"&&(n=i-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=i),By=e.internal.subscribers;for(let r=0;r<By.length;r++)ky=By[r],ky.ref.current(ky.store.getState(),n,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let sg=!1,sx=!1,Gy,XM,zc;function kC(i){XM=requestAnimationFrame(kC),sg=!0,Gy=0,uf("before",i),sx=!0;for(const t of Ol.values()){var e;zc=t.store.getState(),zc.internal.active&&(zc.frameloop==="always"||zc.internal.frames>0)&&!((e=zc.gl.xr)!=null&&e.isPresenting)&&(Gy+=rx(i,zc))}if(sx=!1,uf("after",i),Gy===0)return uf("tail",i),sg=!1,cancelAnimationFrame(XM)}function ax(i,e=1){var t;if(!i)return Ol.forEach(n=>ax(n.store.getState(),e));(t=i.gl.xr)!=null&&t.isPresenting||!i.internal.active||i.frameloop==="never"||(e>1?i.internal.frames=Math.min(60,i.internal.frames+e):sx?i.internal.frames=2:i.internal.frames=1,sg||(sg=!0,requestAnimationFrame(kC)))}function jM(i,e=!0,t,n){if(e&&uf("before",i),t)rx(i,t,n);else for(const r of Ol.values())rx(i,r.store.getState());e&&uf("after",i)}const Hy={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function A5(i){const{handlePointer:e}=l5(i);return{priority:1,enabled:!0,compute(t,n,r){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(Hy).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:r}=i.getState();(t=r.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{const{set:n,events:r}=i.getState();if(r.disconnect==null||r.disconnect(),n(s=>({events:{...s.events,connected:t}})),r.handlers)for(const s in r.handlers){const a=r.handlers[s],[o,l]=Hy[s];t.addEventListener(o,a,{passive:l})}},disconnect:()=>{const{set:t,events:n}=i.getState();if(n.connected){if(n.handlers)for(const r in n.handlers){const s=n.handlers[r],[a]=Hy[r];n.connected.removeEventListener(a,s)}t(r=>({events:{...r.events,connected:void 0}}))}}}}function qM(i,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}function C5({debounce:i,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=Z.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=Z.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=i?typeof i=="number"?i:i.scroll:null,c=i?typeof i=="number"?i:i.resize:null,f=Z.useRef(!1);Z.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[d,p,m]=Z.useMemo(()=>{const g=()=>{if(!o.current.element)return;const{left:b,top:S,width:E,height:w,bottom:T,right:C,x:U,y:D}=o.current.element.getBoundingClientRect(),R={left:b,top:S,width:E,height:w,bottom:T,right:C,x:U,y:D};o.current.element instanceof HTMLElement&&n&&(R.height=o.current.element.offsetHeight,R.width=o.current.element.offsetWidth),Object.freeze(R),f.current&&!O5(o.current.lastBounds,R)&&a(o.current.lastBounds=R)};return[g,c?qM(g,c):g,l?qM(g,l):g]},[a,n,l,c]);function v(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function x(){o.current.element&&(o.current.resizeObserver=new r(m),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(g=>g.addEventListener("scroll",m,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const _=g=>{!g||g===o.current.element||(v(),o.current.element=g,o.current.scrollContainers=GC(g),x())};return D5(m,!!e),R5(p),Z.useEffect(()=>{v(),x()},[e,m,p]),Z.useEffect(()=>v,[]),[_,s,d]}function R5(i){Z.useEffect(()=>{const e=i;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[i])}function D5(i,e){Z.useEffect(()=>{if(e){const t=i;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[i,e])}function GC(i){const e=[];if(!i||i===document.body)return e;const{overflow:t,overflowX:n,overflowY:r}=window.getComputedStyle(i);return[t,n,r].some(s=>s==="auto"||s==="scroll")&&e.push(i),[...e,...GC(i.parentElement)]}const U5=["x","y","top","bottom","left","right","width","height"],O5=(i,e)=>U5.every(t=>i[t]===e[t]);function L5({ref:i,children:e,fallback:t,resize:n,style:r,gl:s,events:a=A5,eventSource:o,eventPrefix:l,shadows:c,linear:f,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:b,scene:S,onPointerMissed:E,onCreated:w,...T}){Z.useMemo(()=>NC(bC),[]);const C=J4(),[U,D]=C5({scroll:!0,debounce:{scroll:50,resize:0},...n}),R=Z.useRef(null),I=Z.useRef(null);Z.useImperativeHandle(i,()=>R.current);const z=AC(E),[O,V]=Z.useState(!1),[ee,P]=Z.useState(!1);if(O)throw O;if(ee)throw ee;const L=Z.useRef(null);nd(()=>{const H=R.current;if(D.width>0&&D.height>0&&H){L.current||(L.current=b5(H));async function W(){await L.current.configure({gl:s,scene:S,events:a,shadows:c,linear:f,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:b,size:D,onPointerMissed:(...F)=>z.current==null?void 0:z.current(...F),onCreated:F=>{F.events.connect==null||F.events.connect(o?Z4(o)?o.current:o:I.current),l&&F.setEvents({compute:(Y,K)=>{const j=Y[l+"X"],J=Y[l+"Y"];K.pointer.set(j/K.size.width*2-1,-(J/K.size.height)*2+1),K.raycaster.setFromCamera(K.pointer,K.camera)}}),w?.(F)}}),L.current.render(ue.jsx(C,{children:ue.jsx($4,{set:P,children:ue.jsx(Z.Suspense,{fallback:ue.jsx(Q4,{set:V}),children:e??null})})}))}W()}}),Z.useEffect(()=>{const H=R.current;if(H)return()=>FC(H)},[]);const k=o?"none":"auto";return ue.jsx("div",{ref:I,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:k,...r},...T,children:ue.jsx("div",{ref:U,style:{width:"100%",height:"100%"},children:ue.jsx("canvas",{ref:R,style:{display:"block"},children:t})})})}function N5(i){return ue.jsx(EC,{children:ue.jsx(L5,{...i})})}function I5(i,e,t){var n,r=1;i==null&&(i=0),e==null&&(e=0),t==null&&(t=0);function s(){var a,o=n.length,l,c=0,f=0,d=0;for(a=0;a<o;++a)l=n[a],c+=l.x||0,f+=l.y||0,d+=l.z||0;for(c=(c/o-i)*r,f=(f/o-e)*r,d=(d/o-t)*r,a=0;a<o;++a)l=n[a],c&&(l.x-=c),f&&(l.y-=f),d&&(l.z-=d)}return s.initialize=function(a){n=a},s.x=function(a){return arguments.length?(i=+a,s):i},s.y=function(a){return arguments.length?(e=+a,s):e},s.z=function(a){return arguments.length?(t=+a,s):t},s.strength=function(a){return arguments.length?(r=+a,s):r},s}function P5(i){const e=+this._x.call(null,i);return HC(this.cover(e),e,i)}function HC(i,e,t){if(isNaN(e))return i;var n,r=i._root,s={data:t},a=i._x0,o=i._x1,l,c,f,d,p;if(!r)return i._root=s,i;for(;r.length;)if((f=e>=(l=(a+o)/2))?a=l:o=l,n=r,!(r=r[d=+f]))return n[d]=s,i;if(c=+i._x.call(null,r.data),e===c)return s.next=r,n?n[d]=s:i._root=s,i;do n=n?n[d]=new Array(2):i._root=new Array(2),(f=e>=(l=(a+o)/2))?a=l:o=l;while((d=+f)==(p=+(c>=l)));return n[p]=r,n[d]=s,i}function z5(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e);let n=1/0,r=-1/0;for(let s=0,a;s<e;++s)isNaN(a=+this._x.call(null,i[s]))||(t[s]=a,a<n&&(n=a),a>r&&(r=a));if(n>r)return this;this.cover(n).cover(r);for(let s=0;s<e;++s)HC(this,t[s],i[s]);return this}function F5(i){if(isNaN(i=+i))return this;var e=this._x0,t=this._x1;if(isNaN(e))t=(e=Math.floor(i))+1;else{for(var n=t-e||1,r=this._root,s,a;e>i||i>=t;)switch(a=+(i<e),s=new Array(2),s[a]=r,r=s,n*=2,a){case 0:t=e+n;break;case 1:e=t-n;break}this._root&&this._root.length&&(this._root=r)}return this._x0=e,this._x1=t,this}function B5(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function k5(i){return arguments.length?this.cover(+i[0][0]).cover(+i[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function va(i,e,t){this.node=i,this.x0=e,this.x1=t}function G5(i,e){var t,n=this._x0,r,s,a=this._x1,o=[],l=this._root,c,f;for(l&&o.push(new va(l,n,a)),e==null?e=1/0:(n=i-e,a=i+e);c=o.pop();)if(!(!(l=c.node)||(r=c.x0)>a||(s=c.x1)<n))if(l.length){var d=(r+s)/2;o.push(new va(l[1],d,s),new va(l[0],r,d)),(f=+(i>=d))&&(c=o[o.length-1],o[o.length-1]=o[o.length-1-f],o[o.length-1-f]=c)}else{var p=Math.abs(i-+this._x.call(null,l.data));p<e&&(e=p,n=i-p,a=i+p,t=l.data)}return t}function H5(i){if(isNaN(l=+this._x.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._x1,l,c,f,d,p;if(!t)return this;if(t.length)for(;;){if((f=l>=(c=(a+o)/2))?a=c:o=c,e=t,!(t=t[d=+f]))return this;if(!t.length)break;e[d+1&1]&&(n=e,p=d)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[d]=s:delete e[d],(t=e[0]||e[1])&&t===(e[1]||e[0])&&!t.length&&(n?n[p]=t:this._root=t),this):(this._root=s,this)}function V5(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function W5(){return this._root}function X5(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function j5(i){var e=[],t,n=this._root,r,s,a;for(n&&e.push(new va(n,this._x0,this._x1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.x1)&&n.length){var o=(s+a)/2;(r=n[1])&&e.push(new va(r,o,a)),(r=n[0])&&e.push(new va(r,s,o))}return this}function q5(i){var e=[],t=[],n;for(this._root&&e.push(new va(this._root,this._x0,this._x1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.x1,l=(a+o)/2;(s=r[0])&&e.push(new va(s,a,l)),(s=r[1])&&e.push(new va(s,l,o))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.x1);return this}function Y5(i){return i[0]}function Z5(i){return arguments.length?(this._x=i,this):this._x}function T1(i,e){var t=new A1(e??Y5,NaN,NaN);return i==null?t:t.addAll(i)}function A1(i,e,t){this._x=i,this._x0=e,this._x1=t,this._root=void 0}function YM(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var rr=T1.prototype=A1.prototype;rr.copy=function(){var i=new A1(this._x,this._x0,this._x1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=YM(e),i;for(t=[{source:e,target:i._root=new Array(2)}];e=t.pop();)for(var r=0;r<2;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(2)}):e.target[r]=YM(n));return i};rr.add=P5;rr.addAll=z5;rr.cover=F5;rr.data=B5;rr.extent=k5;rr.find=G5;rr.remove=H5;rr.removeAll=V5;rr.root=W5;rr.size=X5;rr.visit=j5;rr.visitAfter=q5;rr.x=Z5;function K5(i){const e=+this._x.call(null,i),t=+this._y.call(null,i);return VC(this.cover(e,t),e,t,i)}function VC(i,e,t,n){if(isNaN(e)||isNaN(t))return i;var r,s=i._root,a={data:n},o=i._x0,l=i._y0,c=i._x1,f=i._y1,d,p,m,v,x,_,g,b;if(!s)return i._root=a,i;for(;s.length;)if((x=e>=(d=(o+c)/2))?o=d:c=d,(_=t>=(p=(l+f)/2))?l=p:f=p,r=s,!(s=s[g=_<<1|x]))return r[g]=a,i;if(m=+i._x.call(null,s.data),v=+i._y.call(null,s.data),e===m&&t===v)return a.next=s,r?r[g]=a:i._root=a,i;do r=r?r[g]=new Array(4):i._root=new Array(4),(x=e>=(d=(o+c)/2))?o=d:c=d,(_=t>=(p=(l+f)/2))?l=p:f=p;while((g=_<<1|x)===(b=(v>=p)<<1|m>=d));return r[b]=s,r[g]=a,i}function J5(i){var e,t,n=i.length,r,s,a=new Array(n),o=new Array(n),l=1/0,c=1/0,f=-1/0,d=-1/0;for(t=0;t<n;++t)isNaN(r=+this._x.call(null,e=i[t]))||isNaN(s=+this._y.call(null,e))||(a[t]=r,o[t]=s,r<l&&(l=r),r>f&&(f=r),s<c&&(c=s),s>d&&(d=s));if(l>f||c>d)return this;for(this.cover(l,c).cover(f,d),t=0;t<n;++t)VC(this,a[t],o[t],i[t]);return this}function Q5(i,e){if(isNaN(i=+i)||isNaN(e=+e))return this;var t=this._x0,n=this._y0,r=this._x1,s=this._y1;if(isNaN(t))r=(t=Math.floor(i))+1,s=(n=Math.floor(e))+1;else{for(var a=r-t||1,o=this._root,l,c;t>i||i>=r||n>e||e>=s;)switch(c=(e<n)<<1|i<t,l=new Array(4),l[c]=o,o=l,a*=2,c){case 0:r=t+a,s=n+a;break;case 1:t=r-a,s=n+a;break;case 2:r=t+a,n=s-a;break;case 3:t=r-a,n=s-a;break}this._root&&this._root.length&&(this._root=o)}return this._x0=t,this._y0=n,this._x1=r,this._y1=s,this}function $5(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function ek(i){return arguments.length?this.cover(+i[0][0],+i[0][1]).cover(+i[1][0],+i[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Bi(i,e,t,n,r){this.node=i,this.x0=e,this.y0=t,this.x1=n,this.y1=r}function tk(i,e,t){var n,r=this._x0,s=this._y0,a,o,l,c,f=this._x1,d=this._y1,p=[],m=this._root,v,x;for(m&&p.push(new Bi(m,r,s,f,d)),t==null?t=1/0:(r=i-t,s=e-t,f=i+t,d=e+t,t*=t);v=p.pop();)if(!(!(m=v.node)||(a=v.x0)>f||(o=v.y0)>d||(l=v.x1)<r||(c=v.y1)<s))if(m.length){var _=(a+l)/2,g=(o+c)/2;p.push(new Bi(m[3],_,g,l,c),new Bi(m[2],a,g,_,c),new Bi(m[1],_,o,l,g),new Bi(m[0],a,o,_,g)),(x=(e>=g)<<1|i>=_)&&(v=p[p.length-1],p[p.length-1]=p[p.length-1-x],p[p.length-1-x]=v)}else{var b=i-+this._x.call(null,m.data),S=e-+this._y.call(null,m.data),E=b*b+S*S;if(E<t){var w=Math.sqrt(t=E);r=i-w,s=e-w,f=i+w,d=e+w,n=m.data}}return n}function nk(i){if(isNaN(f=+this._x.call(null,i))||isNaN(d=+this._y.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._y0,l=this._x1,c=this._y1,f,d,p,m,v,x,_,g;if(!t)return this;if(t.length)for(;;){if((v=f>=(p=(a+l)/2))?a=p:l=p,(x=d>=(m=(o+c)/2))?o=m:c=m,e=t,!(t=t[_=x<<1|v]))return this;if(!t.length)break;(e[_+1&3]||e[_+2&3]||e[_+3&3])&&(n=e,g=_)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[_]=s:delete e[_],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[g]=t:this._root=t),this):(this._root=s,this)}function ik(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function rk(){return this._root}function sk(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function ak(i){var e=[],t,n=this._root,r,s,a,o,l;for(n&&e.push(new Bi(n,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.y0,o=t.x1,l=t.y1)&&n.length){var c=(s+o)/2,f=(a+l)/2;(r=n[3])&&e.push(new Bi(r,c,f,o,l)),(r=n[2])&&e.push(new Bi(r,s,f,c,l)),(r=n[1])&&e.push(new Bi(r,c,a,o,f)),(r=n[0])&&e.push(new Bi(r,s,a,c,f))}return this}function ok(i){var e=[],t=[],n;for(this._root&&e.push(new Bi(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.y0,l=n.x1,c=n.y1,f=(a+l)/2,d=(o+c)/2;(s=r[0])&&e.push(new Bi(s,a,o,f,d)),(s=r[1])&&e.push(new Bi(s,f,o,l,d)),(s=r[2])&&e.push(new Bi(s,a,d,f,c)),(s=r[3])&&e.push(new Bi(s,f,d,l,c))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.x1,n.y1);return this}function lk(i){return i[0]}function ck(i){return arguments.length?(this._x=i,this):this._x}function uk(i){return i[1]}function hk(i){return arguments.length?(this._y=i,this):this._y}function C1(i,e,t){var n=new R1(e??lk,t??uk,NaN,NaN,NaN,NaN);return i==null?n:n.addAll(i)}function R1(i,e,t,n,r,s){this._x=i,this._y=e,this._x0=t,this._y0=n,this._x1=r,this._y1=s,this._root=void 0}function ZM(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var Hi=C1.prototype=R1.prototype;Hi.copy=function(){var i=new R1(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=ZM(e),i;for(t=[{source:e,target:i._root=new Array(4)}];e=t.pop();)for(var r=0;r<4;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(4)}):e.target[r]=ZM(n));return i};Hi.add=K5;Hi.addAll=J5;Hi.cover=Q5;Hi.data=$5;Hi.extent=ek;Hi.find=tk;Hi.remove=nk;Hi.removeAll=ik;Hi.root=rk;Hi.size=sk;Hi.visit=ak;Hi.visitAfter=ok;Hi.x=ck;Hi.y=hk;function fk(i){const e=+this._x.call(null,i),t=+this._y.call(null,i),n=+this._z.call(null,i);return WC(this.cover(e,t,n),e,t,n,i)}function WC(i,e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n))return i;var s,a=i._root,o={data:r},l=i._x0,c=i._y0,f=i._z0,d=i._x1,p=i._y1,m=i._z1,v,x,_,g,b,S,E,w,T,C,U;if(!a)return i._root=o,i;for(;a.length;)if((E=e>=(v=(l+d)/2))?l=v:d=v,(w=t>=(x=(c+p)/2))?c=x:p=x,(T=n>=(_=(f+m)/2))?f=_:m=_,s=a,!(a=a[C=T<<2|w<<1|E]))return s[C]=o,i;if(g=+i._x.call(null,a.data),b=+i._y.call(null,a.data),S=+i._z.call(null,a.data),e===g&&t===b&&n===S)return o.next=a,s?s[C]=o:i._root=o,i;do s=s?s[C]=new Array(8):i._root=new Array(8),(E=e>=(v=(l+d)/2))?l=v:d=v,(w=t>=(x=(c+p)/2))?c=x:p=x,(T=n>=(_=(f+m)/2))?f=_:m=_;while((C=T<<2|w<<1|E)===(U=(S>=_)<<2|(b>=x)<<1|g>=v));return s[U]=a,s[C]=o,i}function dk(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e),n=new Float64Array(e),r=new Float64Array(e);let s=1/0,a=1/0,o=1/0,l=-1/0,c=-1/0,f=-1/0;for(let d=0,p,m,v,x;d<e;++d)isNaN(m=+this._x.call(null,p=i[d]))||isNaN(v=+this._y.call(null,p))||isNaN(x=+this._z.call(null,p))||(t[d]=m,n[d]=v,r[d]=x,m<s&&(s=m),m>l&&(l=m),v<a&&(a=v),v>c&&(c=v),x<o&&(o=x),x>f&&(f=x));if(s>l||a>c||o>f)return this;this.cover(s,a,o).cover(l,c,f);for(let d=0;d<e;++d)WC(this,t[d],n[d],r[d],i[d]);return this}function pk(i,e,t){if(isNaN(i=+i)||isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,s=this._z0,a=this._x1,o=this._y1,l=this._z1;if(isNaN(n))a=(n=Math.floor(i))+1,o=(r=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var c=a-n||1,f=this._root,d,p;n>i||i>=a||r>e||e>=o||s>t||t>=l;)switch(p=(t<s)<<2|(e<r)<<1|i<n,d=new Array(8),d[p]=f,f=d,c*=2,p){case 0:a=n+c,o=r+c,l=s+c;break;case 1:n=a-c,o=r+c,l=s+c;break;case 2:a=n+c,r=o-c,l=s+c;break;case 3:n=a-c,r=o-c,l=s+c;break;case 4:a=n+c,o=r+c,s=l-c;break;case 5:n=a-c,o=r+c,s=l-c;break;case 6:a=n+c,r=o-c,s=l-c;break;case 7:n=a-c,r=o-c,s=l-c;break}this._root&&this._root.length&&(this._root=f)}return this._x0=n,this._y0=r,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this}function mk(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function gk(i){return arguments.length?this.cover(+i[0][0],+i[0][1],+i[0][2]).cover(+i[1][0],+i[1][1],+i[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function un(i,e,t,n,r,s,a){this.node=i,this.x0=e,this.y0=t,this.z0=n,this.x1=r,this.y1=s,this.z1=a}function vk(i,e,t,n){var r,s=this._x0,a=this._y0,o=this._z0,l,c,f,d,p,m,v=this._x1,x=this._y1,_=this._z1,g=[],b=this._root,S,E;for(b&&g.push(new un(b,s,a,o,v,x,_)),n==null?n=1/0:(s=i-n,a=e-n,o=t-n,v=i+n,x=e+n,_=t+n,n*=n);S=g.pop();)if(!(!(b=S.node)||(l=S.x0)>v||(c=S.y0)>x||(f=S.z0)>_||(d=S.x1)<s||(p=S.y1)<a||(m=S.z1)<o))if(b.length){var w=(l+d)/2,T=(c+p)/2,C=(f+m)/2;g.push(new un(b[7],w,T,C,d,p,m),new un(b[6],l,T,C,w,p,m),new un(b[5],w,c,C,d,T,m),new un(b[4],l,c,C,w,T,m),new un(b[3],w,T,f,d,p,C),new un(b[2],l,T,f,w,p,C),new un(b[1],w,c,f,d,T,C),new un(b[0],l,c,f,w,T,C)),(E=(t>=C)<<2|(e>=T)<<1|i>=w)&&(S=g[g.length-1],g[g.length-1]=g[g.length-1-E],g[g.length-1-E]=S)}else{var U=i-+this._x.call(null,b.data),D=e-+this._y.call(null,b.data),R=t-+this._z.call(null,b.data),I=U*U+D*D+R*R;if(I<n){var z=Math.sqrt(n=I);s=i-z,a=e-z,o=t-z,v=i+z,x=e+z,_=t+z,r=b.data}}return r}const yk=(i,e,t,n,r,s)=>Math.sqrt((i-n)**2+(e-r)**2+(t-s)**2);function _k(i,e,t,n){const r=[],s=i-n,a=e-n,o=t-n,l=i+n,c=e+n,f=t+n;return this.visit((d,p,m,v,x,_,g)=>{if(!d.length)do{const b=d.data;yk(i,e,t,this._x(b),this._y(b),this._z(b))<=n&&r.push(b)}while(d=d.next);return p>l||m>c||v>f||x<s||_<a||g<o}),r}function xk(i){if(isNaN(p=+this._x.call(null,i))||isNaN(m=+this._y.call(null,i))||isNaN(v=+this._z.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._y0,l=this._z0,c=this._x1,f=this._y1,d=this._z1,p,m,v,x,_,g,b,S,E,w,T;if(!t)return this;if(t.length)for(;;){if((b=p>=(x=(a+c)/2))?a=x:c=x,(S=m>=(_=(o+f)/2))?o=_:f=_,(E=v>=(g=(l+d)/2))?l=g:d=g,e=t,!(t=t[w=E<<2|S<<1|b]))return this;if(!t.length)break;(e[w+1&7]||e[w+2&7]||e[w+3&7]||e[w+4&7]||e[w+5&7]||e[w+6&7]||e[w+7&7])&&(n=e,T=w)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[w]=s:delete e[w],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[T]=t:this._root=t),this):(this._root=s,this)}function bk(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function Sk(){return this._root}function Ek(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function Mk(i){var e=[],t,n=this._root,r,s,a,o,l,c,f;for(n&&e.push(new un(n,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.y0,o=t.z0,l=t.x1,c=t.y1,f=t.z1)&&n.length){var d=(s+l)/2,p=(a+c)/2,m=(o+f)/2;(r=n[7])&&e.push(new un(r,d,p,m,l,c,f)),(r=n[6])&&e.push(new un(r,s,p,m,d,c,f)),(r=n[5])&&e.push(new un(r,d,a,m,l,p,f)),(r=n[4])&&e.push(new un(r,s,a,m,d,p,f)),(r=n[3])&&e.push(new un(r,d,p,o,l,c,m)),(r=n[2])&&e.push(new un(r,s,p,o,d,c,m)),(r=n[1])&&e.push(new un(r,d,a,o,l,p,m)),(r=n[0])&&e.push(new un(r,s,a,o,d,p,m))}return this}function wk(i){var e=[],t=[],n;for(this._root&&e.push(new un(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.y0,l=n.z0,c=n.x1,f=n.y1,d=n.z1,p=(a+c)/2,m=(o+f)/2,v=(l+d)/2;(s=r[0])&&e.push(new un(s,a,o,l,p,m,v)),(s=r[1])&&e.push(new un(s,p,o,l,c,m,v)),(s=r[2])&&e.push(new un(s,a,m,l,p,f,v)),(s=r[3])&&e.push(new un(s,p,m,l,c,f,v)),(s=r[4])&&e.push(new un(s,a,o,v,p,m,d)),(s=r[5])&&e.push(new un(s,p,o,v,c,m,d)),(s=r[6])&&e.push(new un(s,a,m,v,p,f,d)),(s=r[7])&&e.push(new un(s,p,m,v,c,f,d))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.z0,n.x1,n.y1,n.z1);return this}function Tk(i){return i[0]}function Ak(i){return arguments.length?(this._x=i,this):this._x}function Ck(i){return i[1]}function Rk(i){return arguments.length?(this._y=i,this):this._y}function Dk(i){return i[2]}function Uk(i){return arguments.length?(this._z=i,this):this._z}function D1(i,e,t,n){var r=new U1(e??Tk,t??Ck,n??Dk,NaN,NaN,NaN,NaN,NaN,NaN);return i==null?r:r.addAll(i)}function U1(i,e,t,n,r,s,a,o,l){this._x=i,this._y=e,this._z=t,this._x0=n,this._y0=r,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this._root=void 0}function KM(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var xi=D1.prototype=U1.prototype;xi.copy=function(){var i=new U1(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=KM(e),i;for(t=[{source:e,target:i._root=new Array(8)}];e=t.pop();)for(var r=0;r<8;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(8)}):e.target[r]=KM(n));return i};xi.add=fk;xi.addAll=dk;xi.cover=pk;xi.data=mk;xi.extent=gk;xi.find=vk;xi.findAllWithinRadius=_k;xi.remove=xk;xi.removeAll=bk;xi.root=Sk;xi.size=Ek;xi.visit=Mk;xi.visitAfter=wk;xi.x=Ak;xi.y=Rk;xi.z=Uk;function wn(i){return function(){return i}}function Ir(i){return(i()-.5)*1e-6}function Vy(i){return i.x+i.vx}function JM(i){return i.y+i.vy}function Ok(i){return i.z+i.vz}function XC(i){var e,t,n,r,s=1,a=1;typeof i!="function"&&(i=wn(i==null?1:+i));function o(){for(var f,d=e.length,p,m,v,x,_,g,b,S=0;S<a;++S)for(p=(t===1?T1(e,Vy):t===2?C1(e,Vy,JM):t===3?D1(e,Vy,JM,Ok):null).visitAfter(l),f=0;f<d;++f)m=e[f],g=n[m.index],b=g*g,v=m.x+m.vx,t>1&&(x=m.y+m.vy),t>2&&(_=m.z+m.vz),p.visit(E);function E(w,T,C,U,D,R,I){var z=[T,C,U,D,R,I],O=z[0],V=z[1],ee=z[2],P=z[t],L=z[t+1],k=z[t+2],H=w.data,W=w.r,F=g+W;if(H){if(H.index>m.index){var Y=v-H.x-H.vx,K=t>1?x-H.y-H.vy:0,j=t>2?_-H.z-H.vz:0,J=Y*Y+K*K+j*j;J<F*F&&(Y===0&&(Y=Ir(r),J+=Y*Y),t>1&&K===0&&(K=Ir(r),J+=K*K),t>2&&j===0&&(j=Ir(r),J+=j*j),J=(F-(J=Math.sqrt(J)))/J*s,m.vx+=(Y*=J)*(F=(W*=W)/(b+W)),t>1&&(m.vy+=(K*=J)*F),t>2&&(m.vz+=(j*=J)*F),H.vx-=Y*(F=1-F),t>1&&(H.vy-=K*F),t>2&&(H.vz-=j*F))}return}return O>v+F||P<v-F||t>1&&(V>x+F||L<x-F)||t>2&&(ee>_+F||k<_-F)}}function l(f){if(f.data)return f.r=n[f.data.index];for(var d=f.r=0;d<Math.pow(2,t);++d)f[d]&&f[d].r>f.r&&(f.r=f[d].r)}function c(){if(e){var f,d=e.length,p;for(n=new Array(d),f=0;f<d;++f)p=e[f],n[p.index]=+i(p,f,e)}}return o.initialize=function(f,...d){e=f,r=d.find(p=>typeof p=="function")||Math.random,t=d.find(p=>[1,2,3].includes(p))||2,c()},o.iterations=function(f){return arguments.length?(a=+f,o):a},o.strength=function(f){return arguments.length?(s=+f,o):s},o.radius=function(f){return arguments.length?(i=typeof f=="function"?f:wn(+f),c(),o):i},o}function Lk(i){return i.index}function QM(i,e){var t=i.get(e);if(!t)throw new Error("node not found: "+e);return t}function jC(i){var e=Lk,t=p,n,r=wn(30),s,a,o,l,c,f,d=1;i==null&&(i=[]);function p(g){return 1/Math.min(l[g.source.index],l[g.target.index])}function m(g){for(var b=0,S=i.length;b<d;++b)for(var E=0,w,T,C,U=0,D=0,R=0,I,z;E<S;++E)w=i[E],T=w.source,C=w.target,U=C.x+C.vx-T.x-T.vx||Ir(f),o>1&&(D=C.y+C.vy-T.y-T.vy||Ir(f)),o>2&&(R=C.z+C.vz-T.z-T.vz||Ir(f)),I=Math.sqrt(U*U+D*D+R*R),I=(I-s[E])/I*g*n[E],U*=I,D*=I,R*=I,C.vx-=U*(z=c[E]),o>1&&(C.vy-=D*z),o>2&&(C.vz-=R*z),T.vx+=U*(z=1-z),o>1&&(T.vy+=D*z),o>2&&(T.vz+=R*z)}function v(){if(a){var g,b=a.length,S=i.length,E=new Map(a.map((T,C)=>[e(T,C,a),T])),w;for(g=0,l=new Array(b);g<S;++g)w=i[g],w.index=g,typeof w.source!="object"&&(w.source=QM(E,w.source)),typeof w.target!="object"&&(w.target=QM(E,w.target)),l[w.source.index]=(l[w.source.index]||0)+1,l[w.target.index]=(l[w.target.index]||0)+1;for(g=0,c=new Array(S);g<S;++g)w=i[g],c[g]=l[w.source.index]/(l[w.source.index]+l[w.target.index]);n=new Array(S),x(),s=new Array(S),_()}}function x(){if(a)for(var g=0,b=i.length;g<b;++g)n[g]=+t(i[g],g,i)}function _(){if(a)for(var g=0,b=i.length;g<b;++g)s[g]=+r(i[g],g,i)}return m.initialize=function(g,...b){a=g,f=b.find(S=>typeof S=="function")||Math.random,o=b.find(S=>[1,2,3].includes(S))||2,v()},m.links=function(g){return arguments.length?(i=g,v(),m):i},m.id=function(g){return arguments.length?(e=g,m):e},m.iterations=function(g){return arguments.length?(d=+g,m):d},m.strength=function(g){return arguments.length?(t=typeof g=="function"?g:wn(+g),x(),m):t},m.distance=function(g){return arguments.length?(r=typeof g=="function"?g:wn(+g),_(),m):r},m}var Nk={value:()=>{}};function qC(){for(var i=0,e=arguments.length,t={},n;i<e;++i){if(!(n=arguments[i]+"")||n in t||/[\s.]/.test(n))throw new Error("illegal type: "+n);t[n]=[]}return new lm(t)}function lm(i){this._=i}function Ik(i,e){return i.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}lm.prototype=qC.prototype={constructor:lm,on:function(i,e){var t=this._,n=Ik(i+"",t),r,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((r=(i=n[s]).type)&&(r=Pk(t[r],i.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(i=n[s]).type)t[r]=$M(t[r],i.name,e);else if(e==null)for(r in t)t[r]=$M(t[r],i.name,null);return this},copy:function(){var i={},e=this._;for(var t in e)i[t]=e[t].slice();return new lm(i)},call:function(i,e){if((r=arguments.length-2)>0)for(var t=new Array(r),n=0,r,s;n<r;++n)t[n]=arguments[n+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(s=this._[i],n=0,r=s.length;n<r;++n)s[n].value.apply(e,t)},apply:function(i,e,t){if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(var n=this._[i],r=0,s=n.length;r<s;++r)n[r].value.apply(e,t)}};function Pk(i,e){for(var t=0,n=i.length,r;t<n;++t)if((r=i[t]).name===e)return r.value}function $M(i,e,t){for(var n=0,r=i.length;n<r;++n)if(i[n].name===e){i[n]=Nk,i=i.slice(0,n).concat(i.slice(n+1));break}return t!=null&&i.push({name:e,value:t}),i}var gu=0,Zh=0,Eh=0,YC=1e3,ag,Kh,og=0,Ll=0,o0=0,If=typeof performance=="object"&&performance.now?performance:Date,ZC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(i){setTimeout(i,17)};function KC(){return Ll||(ZC(zk),Ll=If.now()+o0)}function zk(){Ll=0}function ox(){this._call=this._time=this._next=null}ox.prototype=JC.prototype={constructor:ox,restart:function(i,e,t){if(typeof i!="function")throw new TypeError("callback is not a function");t=(t==null?KC():+t)+(e==null?0:+e),!this._next&&Kh!==this&&(Kh?Kh._next=this:ag=this,Kh=this),this._call=i,this._time=t,lx()},stop:function(){this._call&&(this._call=null,this._time=1/0,lx())}};function JC(i,e,t){var n=new ox;return n.restart(i,e,t),n}function Fk(){KC(),++gu;for(var i=ag,e;i;)(e=Ll-i._time)>=0&&i._call.call(void 0,e),i=i._next;--gu}function ew(){Ll=(og=If.now())+o0,gu=Zh=0;try{Fk()}finally{gu=0,kk(),Ll=0}}function Bk(){var i=If.now(),e=i-og;e>YC&&(o0-=e,og=i)}function kk(){for(var i,e=ag,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),i=e,e=e._next):(t=e._next,e._next=null,e=i?i._next=t:ag=t);Kh=i,lx(n)}function lx(i){if(!gu){Zh&&(Zh=clearTimeout(Zh));var e=i-Ll;e>24?(i<1/0&&(Zh=setTimeout(ew,i-If.now()-o0)),Eh&&(Eh=clearInterval(Eh))):(Eh||(og=If.now(),Eh=setInterval(Bk,YC)),gu=1,ZC(ew))}}const Gk=1664525,Hk=1013904223,tw=4294967296;function Vk(){let i=1;return()=>(i=(Gk*i+Hk)%tw)/tw}var nw=3;function Wy(i){return i.x}function iw(i){return i.y}function Wk(i){return i.z}var Xk=10,jk=Math.PI*(3-Math.sqrt(5)),qk=Math.PI*20/(9+Math.sqrt(221));function QC(i,e){e=e||2;var t=Math.min(nw,Math.max(1,Math.round(e))),n,r=1,s=.001,a=1-Math.pow(s,1/300),o=0,l=.6,c=new Map,f=JC(m),d=qC("tick","end"),p=Vk();i==null&&(i=[]);function m(){v(),d.call("tick",n),r<s&&(f.stop(),d.call("end",n))}function v(g){var b,S=i.length,E;g===void 0&&(g=1);for(var w=0;w<g;++w)for(r+=(o-r)*a,c.forEach(function(T){T(r)}),b=0;b<S;++b)E=i[b],E.fx==null?E.x+=E.vx*=l:(E.x=E.fx,E.vx=0),t>1&&(E.fy==null?E.y+=E.vy*=l:(E.y=E.fy,E.vy=0)),t>2&&(E.fz==null?E.z+=E.vz*=l:(E.z=E.fz,E.vz=0));return n}function x(){for(var g=0,b=i.length,S;g<b;++g){if(S=i[g],S.index=g,S.fx!=null&&(S.x=S.fx),S.fy!=null&&(S.y=S.fy),S.fz!=null&&(S.z=S.fz),isNaN(S.x)||t>1&&isNaN(S.y)||t>2&&isNaN(S.z)){var E=Xk*(t>2?Math.cbrt(.5+g):t>1?Math.sqrt(.5+g):g),w=g*jk,T=g*qk;t===1?S.x=E:t===2?(S.x=E*Math.cos(w),S.y=E*Math.sin(w)):(S.x=E*Math.sin(w)*Math.cos(T),S.y=E*Math.cos(w),S.z=E*Math.sin(w)*Math.sin(T))}(isNaN(S.vx)||t>1&&isNaN(S.vy)||t>2&&isNaN(S.vz))&&(S.vx=0,t>1&&(S.vy=0),t>2&&(S.vz=0))}}function _(g){return g.initialize&&g.initialize(i,p,t),g}return x(),n={tick:v,restart:function(){return f.restart(m),n},stop:function(){return f.stop(),n},numDimensions:function(g){return arguments.length?(t=Math.min(nw,Math.max(1,Math.round(g))),c.forEach(_),n):t},nodes:function(g){return arguments.length?(i=g,x(),c.forEach(_),n):i},alpha:function(g){return arguments.length?(r=+g,n):r},alphaMin:function(g){return arguments.length?(s=+g,n):s},alphaDecay:function(g){return arguments.length?(a=+g,n):+a},alphaTarget:function(g){return arguments.length?(o=+g,n):o},velocityDecay:function(g){return arguments.length?(l=1-g,n):1-l},randomSource:function(g){return arguments.length?(p=g,c.forEach(_),n):p},force:function(g,b){return arguments.length>1?(b==null?c.delete(g):c.set(g,_(b)),n):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),b=g.shift()||0,S=(t>1?g.shift():null)||0,E=(t>2?g.shift():null)||0,w=g.shift()||1/0,T=0,C=i.length,U,D,R,I,z,O;for(w*=w,T=0;T<C;++T)z=i[T],U=b-z.x,D=S-(z.y||0),R=E-(z.z||0),I=U*U+D*D+R*R,I<w&&(O=z,w=I);return O},on:function(g,b){return arguments.length>1?(d.on(g,b),n):d.on(g)}}}function $C(){var i,e,t,n,r,s=wn(-30),a,o=1,l=1/0,c=.81;function f(v){var x,_=i.length,g=(e===1?T1(i,Wy):e===2?C1(i,Wy,iw):e===3?D1(i,Wy,iw,Wk):null).visitAfter(p);for(r=v,x=0;x<_;++x)t=i[x],g.visit(m)}function d(){if(i){var v,x=i.length,_;for(a=new Array(x),v=0;v<x;++v)_=i[v],a[_.index]=+s(_,v,i)}}function p(v){var x=0,_,g,b=0,S,E,w,T,C=v.length;if(C){for(S=E=w=T=0;T<C;++T)(_=v[T])&&(g=Math.abs(_.value))&&(x+=_.value,b+=g,S+=g*(_.x||0),E+=g*(_.y||0),w+=g*(_.z||0));x*=Math.sqrt(4/C),v.x=S/b,e>1&&(v.y=E/b),e>2&&(v.z=w/b)}else{_=v,_.x=_.data.x,e>1&&(_.y=_.data.y),e>2&&(_.z=_.data.z);do x+=a[_.data.index];while(_=_.next)}v.value=x}function m(v,x,_,g,b){if(!v.value)return!0;var S=[_,g,b][e-1],E=v.x-t.x,w=e>1?v.y-t.y:0,T=e>2?v.z-t.z:0,C=S-x,U=E*E+w*w+T*T;if(C*C/c<U)return U<l&&(E===0&&(E=Ir(n),U+=E*E),e>1&&w===0&&(w=Ir(n),U+=w*w),e>2&&T===0&&(T=Ir(n),U+=T*T),U<o&&(U=Math.sqrt(o*U)),t.vx+=E*v.value*r/U,e>1&&(t.vy+=w*v.value*r/U),e>2&&(t.vz+=T*v.value*r/U)),!0;if(v.length||U>=l)return;(v.data!==t||v.next)&&(E===0&&(E=Ir(n),U+=E*E),e>1&&w===0&&(w=Ir(n),U+=w*w),e>2&&T===0&&(T=Ir(n),U+=T*T),U<o&&(U=Math.sqrt(o*U)));do v.data!==t&&(C=a[v.data.index]*r/U,t.vx+=E*C,e>1&&(t.vy+=w*C),e>2&&(t.vz+=T*C));while(v=v.next)}return f.initialize=function(v,...x){i=v,n=x.find(_=>typeof _=="function")||Math.random,e=x.find(_=>[1,2,3].includes(_))||2,d()},f.strength=function(v){return arguments.length?(s=typeof v=="function"?v:wn(+v),d(),f):s},f.distanceMin=function(v){return arguments.length?(o=v*v,f):Math.sqrt(o)},f.distanceMax=function(v){return arguments.length?(l=v*v,f):Math.sqrt(l)},f.theta=function(v){return arguments.length?(c=v*v,f):Math.sqrt(c)},f}function Yk(i,e,t,n){var r,s,a=wn(.1),o,l;typeof i!="function"&&(i=wn(+i)),e==null&&(e=0),t==null&&(t=0),n==null&&(n=0);function c(d){for(var p=0,m=r.length;p<m;++p){var v=r[p],x=v.x-e||1e-6,_=(v.y||0)-t||1e-6,g=(v.z||0)-n||1e-6,b=Math.sqrt(x*x+_*_+g*g),S=(l[p]-b)*o[p]*d/b;v.vx+=x*S,s>1&&(v.vy+=_*S),s>2&&(v.vz+=g*S)}}function f(){if(r){var d,p=r.length;for(o=new Array(p),l=new Array(p),d=0;d<p;++d)l[d]=+i(r[d],d,r),o[d]=isNaN(l[d])?0:+a(r[d],d,r)}}return c.initialize=function(d,...p){r=d,s=p.find(m=>[1,2,3].includes(m))||2,f()},c.strength=function(d){return arguments.length?(a=typeof d=="function"?d:wn(+d),f(),c):a},c.radius=function(d){return arguments.length?(i=typeof d=="function"?d:wn(+d),f(),c):i},c.x=function(d){return arguments.length?(e=+d,c):e},c.y=function(d){return arguments.length?(t=+d,c):t},c.z=function(d){return arguments.length?(n=+d,c):n},c}function cx(i){var e=wn(.1),t,n,r;typeof i!="function"&&(i=wn(i==null?0:+i));function s(o){for(var l=0,c=t.length,f;l<c;++l)f=t[l],f.vx+=(r[l]-f.x)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:wn(+o),a(),s):e},s.x=function(o){return arguments.length?(i=typeof o=="function"?o:wn(+o),a(),s):i},s}function ux(i){var e=wn(.1),t,n,r;typeof i!="function"&&(i=wn(i==null?0:+i));function s(o){for(var l=0,c=t.length,f;l<c;++l)f=t[l],f.vy+=(r[l]-f.y)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:wn(+o),a(),s):e},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:wn(+o),a(),s):i},s}function Zk(i){var e=wn(.1),t,n,r;typeof i!="function"&&(i=wn(i==null?0:+i));function s(o){for(var l=0,c=t.length,f;l<c;++l)f=t[l],f.vz+=(r[l]-f.z)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:wn(+o),a(),s):e},s.z=function(o){return arguments.length?(i=typeof o=="function"?o:wn(+o),a(),s):i},s}function Kk(i){var e=0,t=i.children,n=t&&t.length;if(!n)e=1;else for(;--n>=0;)e+=t[n].value;i.value=e}function Jk(){return this.eachAfter(Kk)}function Qk(i,e){let t=-1;for(const n of this)i.call(e,n,++t,this);return this}function $k(i,e){for(var t=this,n=[t],r,s,a=-1;t=n.pop();)if(i.call(e,t,++a,this),r=t.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function eG(i,e){for(var t=this,n=[t],r=[],s,a,o,l=-1;t=n.pop();)if(r.push(t),s=t.children)for(a=0,o=s.length;a<o;++a)n.push(s[a]);for(;t=r.pop();)i.call(e,t,++l,this);return this}function tG(i,e){let t=-1;for(const n of this)if(i.call(e,n,++t,this))return n}function nG(i){return this.eachAfter(function(e){for(var t=+i(e.data)||0,n=e.children,r=n&&n.length;--r>=0;)t+=n[r].value;e.value=t})}function iG(i){return this.eachBefore(function(e){e.children&&e.children.sort(i)})}function rG(i){for(var e=this,t=sG(e,i),n=[e];e!==t;)e=e.parent,n.push(e);for(var r=n.length;i!==t;)n.splice(r,0,i),i=i.parent;return n}function sG(i,e){if(i===e)return i;var t=i.ancestors(),n=e.ancestors(),r=null;for(i=t.pop(),e=n.pop();i===e;)r=i,i=t.pop(),e=n.pop();return r}function aG(){for(var i=this,e=[i];i=i.parent;)e.push(i);return e}function oG(){return Array.from(this)}function lG(){var i=[];return this.eachBefore(function(e){e.children||i.push(e)}),i}function cG(){var i=this,e=[];return i.each(function(t){t!==i&&e.push({source:t.parent,target:t})}),e}function*uG(){var i=this,e,t=[i],n,r,s;do for(e=t.reverse(),t=[];i=e.pop();)if(yield i,n=i.children)for(r=0,s=n.length;r<s;++r)t.push(n[r]);while(t.length)}function l0(i,e){i instanceof Map?(i=[void 0,i],e===void 0&&(e=dG)):e===void 0&&(e=fG);for(var t=new vu(i),n,r=[t],s,a,o,l;n=r.pop();)if((a=e(n.data))&&(l=(a=Array.from(a)).length))for(n.children=a,o=l-1;o>=0;--o)r.push(s=a[o]=new vu(a[o])),s.parent=n,s.depth=n.depth+1;return t.eachBefore(eR)}function hG(){return l0(this).eachBefore(pG)}function fG(i){return i.children}function dG(i){return Array.isArray(i)?i[1]:null}function pG(i){i.data.value!==void 0&&(i.value=i.data.value),i.data=i.data.data}function eR(i){var e=0;do i.height=e;while((i=i.parent)&&i.height<++e)}function vu(i){this.data=i,this.depth=this.height=0,this.parent=null}vu.prototype=l0.prototype={constructor:vu,count:Jk,each:Qk,eachAfter:eG,eachBefore:$k,find:tG,sum:nG,sort:iG,path:rG,ancestors:aG,descendants:oG,leaves:lG,links:cG,copy:hG,[Symbol.iterator]:uG};function Xy(i){return i==null?null:tR(i)}function tR(i){if(typeof i!="function")throw new Error;return i}function Mh(){return 0}function wh(i){return function(){return i}}function mG(i){i.x0=Math.round(i.x0),i.y0=Math.round(i.y0),i.x1=Math.round(i.x1),i.y1=Math.round(i.y1)}function gG(i,e,t,n,r){for(var s=i.children,a,o=-1,l=s.length,c=i.value&&(n-e)/i.value;++o<l;)a=s[o],a.y0=t,a.y1=r,a.x0=e,a.x1=e+=a.value*c}var vG={depth:-1},rw={},jy={};function yG(i){return i.id}function _G(i){return i.parentId}function xG(){var i=yG,e=_G,t;function n(r){var s=Array.from(r),a=i,o=e,l,c,f,d,p,m,v,x,_=new Map;if(t!=null){const g=s.map((E,w)=>bG(t(E,w,r))),b=g.map(sw),S=new Set(g).add("");for(const E of b)S.has(E)||(S.add(E),g.push(E),b.push(sw(E)),s.push(jy));a=(E,w)=>g[w],o=(E,w)=>b[w]}for(f=0,l=s.length;f<l;++f)c=s[f],m=s[f]=new vu(c),(v=a(c,f,r))!=null&&(v+="")&&(x=m.id=v,_.set(x,_.has(x)?rw:m)),(v=o(c,f,r))!=null&&(v+="")&&(m.parent=v);for(f=0;f<l;++f)if(m=s[f],v=m.parent){if(p=_.get(v),!p)throw new Error("missing: "+v);if(p===rw)throw new Error("ambiguous: "+v);p.children?p.children.push(m):p.children=[m],m.parent=p}else{if(d)throw new Error("multiple roots");d=m}if(!d)throw new Error("no root");if(t!=null){for(;d.data===jy&&d.children.length===1;)d=d.children[0],--l;for(let g=s.length-1;g>=0&&(m=s[g],m.data===jy);--g)m.data=null}if(d.parent=vG,d.eachBefore(function(g){g.depth=g.parent.depth+1,--l}).eachBefore(eR),d.parent=null,l>0)throw new Error("cycle");return d}return n.id=function(r){return arguments.length?(i=Xy(r),n):i},n.parentId=function(r){return arguments.length?(e=Xy(r),n):e},n.path=function(r){return arguments.length?(t=Xy(r),n):t},n}function bG(i){i=`${i}`;let e=i.length;return hx(i,e-1)&&!hx(i,e-2)&&(i=i.slice(0,-1)),i[0]==="/"?i:`/${i}`}function sw(i){let e=i.length;if(e<2)return"";for(;--e>1&&!hx(i,e););return i.slice(0,e)}function hx(i,e){if(i[e]==="/"){let t=0;for(;e>0&&i[--e]==="\\";)++t;if((t&1)===0)return!0}return!1}function SG(i,e){return i.parent===e.parent?1:2}function qy(i){var e=i.children;return e?e[0]:i.t}function Yy(i){var e=i.children;return e?e[e.length-1]:i.t}function EG(i,e,t){var n=t/(e.i-i.i);e.c-=n,e.s+=t,i.c+=n,e.z+=t,e.m+=t}function MG(i){for(var e=0,t=0,n=i.children,r=n.length,s;--r>=0;)s=n[r],s.z+=e,s.m+=e,e+=s.s+(t+=s.c)}function wG(i,e,t){return i.a.parent===e.parent?i.a:t}function cm(i,e){this._=i,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}cm.prototype=Object.create(vu.prototype);function TG(i){for(var e=new cm(i,0),t,n=[e],r,s,a,o;t=n.pop();)if(s=t._.children)for(t.children=new Array(o=s.length),a=o-1;a>=0;--a)n.push(r=t.children[a]=new cm(s[a],a)),r.parent=t;return(e.parent=new cm(null,0)).children=[e],e}function AG(){var i=SG,e=1,t=1,n=null;function r(c){var f=TG(c);if(f.eachAfter(s),f.parent.m=-f.z,f.eachBefore(a),n)c.eachBefore(l);else{var d=c,p=c,m=c;c.eachBefore(function(b){b.x<d.x&&(d=b),b.x>p.x&&(p=b),b.depth>m.depth&&(m=b)});var v=d===p?1:i(d,p)/2,x=v-d.x,_=e/(p.x+v+x),g=t/(m.depth||1);c.eachBefore(function(b){b.x=(b.x+x)*_,b.y=b.depth*g})}return c}function s(c){var f=c.children,d=c.parent.children,p=c.i?d[c.i-1]:null;if(f){MG(c);var m=(f[0].z+f[f.length-1].z)/2;p?(c.z=p.z+i(c._,p._),c.m=c.z-m):c.z=m}else p&&(c.z=p.z+i(c._,p._));c.parent.A=o(c,p,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,f,d){if(f){for(var p=c,m=c,v=f,x=p.parent.children[0],_=p.m,g=m.m,b=v.m,S=x.m,E;v=Yy(v),p=qy(p),v&&p;)x=qy(x),m=Yy(m),m.a=c,E=v.z+b-p.z-_+i(v._,p._),E>0&&(EG(wG(v,c,d),c,E),_+=E,g+=E),b+=v.m,_+=p.m,S+=x.m,g+=m.m;v&&!Yy(m)&&(m.t=v,m.m+=b-g),p&&!qy(x)&&(x.t=p,x.m+=_-S,d=c)}return d}function l(c){c.x*=e,c.y=c.depth*t}return r.separation=function(c){return arguments.length?(i=c,r):i},r.size=function(c){return arguments.length?(n=!1,e=+c[0],t=+c[1],r):n?null:[e,t]},r.nodeSize=function(c){return arguments.length?(n=!0,e=+c[0],t=+c[1],r):n?[e,t]:null},r}function CG(i,e,t,n,r){for(var s=i.children,a,o=-1,l=s.length,c=i.value&&(r-t)/i.value;++o<l;)a=s[o],a.x0=e,a.x1=n,a.y0=t,a.y1=t+=a.value*c}var RG=(1+Math.sqrt(5))/2;function DG(i,e,t,n,r,s){for(var a=[],o=e.children,l,c,f=0,d=0,p=o.length,m,v,x=e.value,_,g,b,S,E,w,T;f<p;){m=r-t,v=s-n;do _=o[d++].value;while(!_&&d<p);for(g=b=_,w=Math.max(v/m,m/v)/(x*i),T=_*_*w,E=Math.max(b/T,T/g);d<p;++d){if(_+=c=o[d].value,c<g&&(g=c),c>b&&(b=c),T=_*_*w,S=Math.max(b/T,T/g),S>E){_-=c;break}E=S}a.push(l={value:_,dice:m<v,children:o.slice(f,d)}),l.dice?gG(l,t,n,r,x?n+=v*_/x:s):CG(l,t,n,x?t+=m*_/x:r,s),x-=_,f=d}return a}const UG=function i(e){function t(n,r,s,a,o){DG(e,n,r,s,a,o)}return t.ratio=function(n){return i((n=+n)>1?n:1)},t}(RG);function OG(){var i=UG,e=!1,t=1,n=1,r=[0],s=Mh,a=Mh,o=Mh,l=Mh,c=Mh;function f(p){return p.x0=p.y0=0,p.x1=t,p.y1=n,p.eachBefore(d),r=[0],e&&p.eachBefore(mG),p}function d(p){var m=r[p.depth],v=p.x0+m,x=p.y0+m,_=p.x1-m,g=p.y1-m;_<v&&(v=_=(v+_)/2),g<x&&(x=g=(x+g)/2),p.x0=v,p.y0=x,p.x1=_,p.y1=g,p.children&&(m=r[p.depth+1]=s(p)/2,v+=c(p)-m,x+=a(p)-m,_-=o(p)-m,g-=l(p)-m,_<v&&(v=_=(v+_)/2),g<x&&(x=g=(x+g)/2),i(p,v,x,_,g))}return f.round=function(p){return arguments.length?(e=!!p,f):e},f.size=function(p){return arguments.length?(t=+p[0],n=+p[1],f):[t,n]},f.tile=function(p){return arguments.length?(i=tR(p),f):i},f.padding=function(p){return arguments.length?f.paddingInner(p).paddingOuter(p):f.paddingInner()},f.paddingInner=function(p){return arguments.length?(s=typeof p=="function"?p:wh(+p),f):s},f.paddingOuter=function(p){return arguments.length?f.paddingTop(p).paddingRight(p).paddingBottom(p).paddingLeft(p):f.paddingTop()},f.paddingTop=function(p){return arguments.length?(a=typeof p=="function"?p:wh(+p),f):a},f.paddingRight=function(p){return arguments.length?(o=typeof p=="function"?p:wh(+p),f):o},f.paddingBottom=function(p){return arguments.length?(l=typeof p=="function"?p:wh(+p),f):l},f.paddingLeft=function(p){return arguments.length?(c=typeof p=="function"?p:wh(+p),f):c},f}var Zy,aw;function O1(){if(aw)return Zy;aw=1;function i(t){return!t||typeof t!="object"||typeof t=="function"||Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof RegExp||t instanceof Date}function e(t,n){t=t||{};var r={};for(var s in n){var a=t[s],o=n[s];if(!i(o)){r[s]=e(a,o);continue}a===void 0?r[s]=o:r[s]=a}return r}return Zy=e,Zy}var Ky,ow;function Aa(){return ow||(ow=1,Ky=function(e){return e!==null&&typeof e=="object"&&typeof e.addUndirectedEdgeWithKey=="function"&&typeof e.dropNode=="function"&&typeof e.multi=="boolean"}),Ky}var Jy,lw;function LG(){if(lw)return Jy;lw=1;var i=O1(),e=Aa(),t={dimensions:["x","y"],center:.5,scale:1};function n(s,a,o){if(!e(a))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");o=i(o,t);var l=o.dimensions;if(!Array.isArray(l)||l.length!==2)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=o.center,f=o.scale,d=Math.PI*2,p=(c-.5)*f,m=a.order,v=l[0],x=l[1];function _(S,E){return E[v]=f*Math.cos(S*d/m)+p,E[x]=f*Math.sin(S*d/m)+p,E}var g=0;if(!s){var b={};return a.forEachNode(function(S){b[S]=_(g++,{})}),b}a.updateEachNodeAttributes(function(S,E){return _(g++,E),E},{attributes:l})}var r=n.bind(null,!1);return r.assign=n.bind(null,!0),Jy=r,Jy}var NG=LG();const IG=vo(NG);var Qy,cw;function PG(){if(cw)return Qy;cw=1;var i=0,e=1,t=2,n=3;function r(a,o){return a+"§"+o}function s(){return .01*(.5-Math.random())}return Qy=function(o,l){var c=o.margin,f=o.ratio,d=o.expansion,p=o.gridSize,m=o.speed,v,x,_,g,b,S,E=!0,w=l.length,T=w/n|0,C=new Float32Array(T),U=new Float32Array(T),D=1/0,R=1/0,I=-1/0,z=-1/0;for(v=0;v<w;v+=n)_=l[v+i],g=l[v+e],S=l[v+t]*f+c,D=Math.min(D,_-S),I=Math.max(I,_+S),R=Math.min(R,g-S),z=Math.max(z,g+S);var O=I-D,V=z-R,ee=(D+I)/2,P=(R+z)/2;D=ee-d*O/2,I=ee+d*O/2,R=P-d*V/2,z=P+d*V/2;var L=new Array(p*p),k=L.length,H;for(H=0;H<k;H++)L[H]=[];var W,F,Y,K,j,J,he,re,pe,Oe;for(v=0;v<w;v+=n)for(_=l[v+i],g=l[v+e],S=l[v+t]*f+c,W=_-S,F=_+S,Y=g-S,K=g+S,j=Math.floor(p*(W-D)/(I-D)),J=Math.floor(p*(F-D)/(I-D)),he=Math.floor(p*(Y-R)/(z-R)),re=Math.floor(p*(K-R)/(z-R)),pe=j;pe<=J;pe++)for(Oe=he;Oe<=re;Oe++)L[pe*p+Oe].push(v);var be,ve=new Set,ce,Ne,G,le,te,Me,oe,De,_e,ne,Be,X,B;for(H=0;H<k;H++)for(be=L[H],v=0,b=be.length;v<b;v++)for(ce=be[v],G=l[ce+i],te=l[ce+e],oe=l[ce+t],x=v+1;x<b;x++)Ne=be[x],_e=r(ce,Ne),!(k>1&&ve.has(_e))&&(k>1&&ve.add(_e),le=l[Ne+i],Me=l[Ne+e],De=l[Ne+t],ne=le-G,Be=Me-te,X=Math.sqrt(ne*ne+Be*Be),B=X<oe*f+c+(De*f+c),B&&(E=!1,Ne=Ne/n|0,X>0?(C[Ne]+=ne/X*(1+oe),U[Ne]+=Be/X*(1+oe)):(C[Ne]+=O*s(),U[Ne]+=V*s())));for(v=0,x=0;v<w;v+=n,x++)l[v+i]+=C[x]*.1*m,l[v+e]+=U[x]*.1*m;return{converged:E}},Qy}var ll={},uw;function zG(){if(uw)return ll;uw=1;var i=3;return ll.validateSettings=function(e){return"gridSize"in e&&typeof e.gridSize!="number"||e.gridSize<=0?{message:"the `gridSize` setting should be a positive number."}:"margin"in e&&typeof e.margin!="number"||e.margin<0?{message:"the `margin` setting should be 0 or a positive number."}:"expansion"in e&&typeof e.expansion!="number"||e.expansion<=0?{message:"the `expansion` setting should be a positive number."}:"ratio"in e&&typeof e.ratio!="number"||e.ratio<=0?{message:"the `ratio` setting should be a positive number."}:"speed"in e&&typeof e.speed!="number"||e.speed<=0?{message:"the `speed` setting should be a positive number."}:null},ll.graphToByteArray=function(e,t){var n=e.order,r=new Float32Array(n*i),s=0;return e.forEachNode(function(a,o){typeof t=="function"&&(o=t(a,o)),r[s]=o.x,r[s+1]=o.y,r[s+2]=o.size||1,s+=i}),r},ll.assignLayoutChanges=function(e,t,n){var r=0;e.forEachNode(function(s){var a={x:t[r],y:t[r+1]};typeof n=="function"&&(a=n(s,a)),e.mergeNodeAttributes(s,a),r+=i})},ll.collectLayoutChanges=function(e,t,n){var r={},s=0;return e.forEachNode(function(a){var o={x:t[s],y:t[s+1]};typeof n=="function"&&(o=n(a,o)),r[a]=o,s+=i}),r},ll.createWorker=function(t){var n=window.URL||window.webkitURL,r=t.toString(),s=n.createObjectURL(new Blob(["("+r+").call(this);"],{type:"text/javascript"})),a=new Worker(s);return n.revokeObjectURL(s),a},ll}var $y,hw;function FG(){return hw||(hw=1,$y={gridSize:20,margin:5,expansion:1.1,ratio:1,speed:3}),$y}var e_,fw;function BG(){if(fw)return e_;fw=1;var i=Aa(),e=PG(),t=zG(),n=FG(),r=500;function s(o,l,c){if(!i(l))throw new Error("graphology-layout-noverlap: the given graph is not a valid graphology instance.");typeof c=="number"?c={maxIterations:c}:c=c||{};var f=c.maxIterations||r;if(typeof f!="number"||f<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");var d=Object.assign({},n,c.settings),p=t.validateSettings(d);if(p)throw new Error("graphology-layout-noverlap: "+p.message);var m=t.graphToByteArray(l,c.inputReducer),v=!1,x;for(x=0;x<f&&!v;x++)v=e(d,m).converged;if(o){t.assignLayoutChanges(l,m,c.outputReducer);return}return t.collectLayoutChanges(l,m,c.outputReducer)}var a=s.bind(null,!1);return a.assign=s.bind(null,!0),e_=a,e_}var kG=BG();const GG=vo(kG);var Th={},dw;function c0(){if(dw)return Th;dw=1;function i(n){return typeof n!="number"||isNaN(n)?1:n}function e(n,r){var s={},a=function(c){return typeof c>"u"?r:c};typeof r=="function"&&(a=r);var o=function(c){return a(c[n])},l=function(){return a(void 0)};return typeof n=="string"?(s.fromAttributes=o,s.fromGraph=function(c,f){return o(c.getNodeAttributes(f))},s.fromEntry=function(c,f){return o(f)}):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(c,f){return a(n(f,c.getNodeAttributes(f)))},s.fromEntry=function(c,f){return a(n(c,f))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l),s}function t(n,r){var s={},a=function(c){return typeof c>"u"?r:c};typeof r=="function"&&(a=r);var o=function(c){return a(c[n])},l=function(){return a(void 0)};return typeof n=="string"?(s.fromAttributes=o,s.fromGraph=function(c,f){return o(c.getEdgeAttributes(f))},s.fromEntry=function(c,f){return o(f)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(c,f){var d=c.extremities(f);return a(n(f,c.getEdgeAttributes(f),d[0],d[1],c.getNodeAttributes(d[0]),c.getNodeAttributes(d[1]),c.isUndirected(f)))},s.fromEntry=function(c,f,d,p,m,v,x){return a(n(c,f,d,p,m,v,x))},s.fromPartialEntry=function(c,f,d,p){return a(n(c,f,d,p))},s.fromMinimalEntry=function(c,f){return a(n(c,f))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l,s.fromMinimalEntry=l),s}return Th.createNodeValueGetter=e,Th.createEdgeValueGetter=t,Th.createEdgeWeightGetter=function(n){return t(n,i)},Th}var t_,pw;function HG(){if(pw)return t_;pw=1;var i=0,e=1,t=2,n=3,r=4,s=5,a=6,o=7,l=8,c=9,f=0,d=1,p=2,m=0,v=1,x=2,_=3,g=4,b=5,S=6,E=7,w=8,T=3,C=10,U=3,D=9,R=10;return t_=function(z,O,V){var ee,P,L,k,H,W,F,Y,K,j,J=O.length,he=V.length,re=z.adjustSizes,pe=z.barnesHutTheta*z.barnesHutTheta,Oe,be,ve,ce,Ne,G,le,te=[];for(L=0;L<J;L+=C)O[L+r]=O[L+t],O[L+s]=O[L+n],O[L+t]=0,O[L+n]=0;if(z.outboundAttractionDistribution){for(Oe=0,L=0;L<J;L+=C)Oe+=O[L+a];Oe/=J/C}if(z.barnesHutOptimize){var Me=1/0,oe=-1/0,De=1/0,_e=-1/0,ne,Be,X;for(L=0;L<J;L+=C)Me=Math.min(Me,O[L+i]),oe=Math.max(oe,O[L+i]),De=Math.min(De,O[L+e]),_e=Math.max(_e,O[L+e]);var B=oe-Me,ie=_e-De;for(B>ie?(De-=(B-ie)/2,_e=De+B):(Me-=(ie-B)/2,oe=Me+ie),te[0+m]=-1,te[0+v]=(Me+oe)/2,te[0+x]=(De+_e)/2,te[0+_]=Math.max(oe-Me,_e-De),te[0+g]=-1,te[0+b]=-1,te[0+S]=0,te[0+E]=0,te[0+w]=0,ee=1,L=0;L<J;L+=C)for(P=0,X=T;;)if(te[P+b]>=0){O[L+i]<te[P+v]?O[L+e]<te[P+x]?ne=te[P+b]:ne=te[P+b]+D:O[L+e]<te[P+x]?ne=te[P+b]+D*2:ne=te[P+b]+D*3,te[P+E]=(te[P+E]*te[P+S]+O[L+i]*O[L+a])/(te[P+S]+O[L+a]),te[P+w]=(te[P+w]*te[P+S]+O[L+e]*O[L+a])/(te[P+S]+O[L+a]),te[P+S]+=O[L+a],P=ne;continue}else if(te[P+m]<0){te[P+m]=L;break}else{if(te[P+b]=ee*D,Y=te[P+_]/2,K=te[P+b],te[K+m]=-1,te[K+v]=te[P+v]-Y,te[K+x]=te[P+x]-Y,te[K+_]=Y,te[K+g]=K+D,te[K+b]=-1,te[K+S]=0,te[K+E]=0,te[K+w]=0,K+=D,te[K+m]=-1,te[K+v]=te[P+v]-Y,te[K+x]=te[P+x]+Y,te[K+_]=Y,te[K+g]=K+D,te[K+b]=-1,te[K+S]=0,te[K+E]=0,te[K+w]=0,K+=D,te[K+m]=-1,te[K+v]=te[P+v]+Y,te[K+x]=te[P+x]-Y,te[K+_]=Y,te[K+g]=K+D,te[K+b]=-1,te[K+S]=0,te[K+E]=0,te[K+w]=0,K+=D,te[K+m]=-1,te[K+v]=te[P+v]+Y,te[K+x]=te[P+x]+Y,te[K+_]=Y,te[K+g]=te[P+g],te[K+b]=-1,te[K+S]=0,te[K+E]=0,te[K+w]=0,ee+=4,O[te[P+m]+i]<te[P+v]?O[te[P+m]+e]<te[P+x]?ne=te[P+b]:ne=te[P+b]+D:O[te[P+m]+e]<te[P+x]?ne=te[P+b]+D*2:ne=te[P+b]+D*3,te[P+S]=O[te[P+m]+a],te[P+E]=O[te[P+m]+i],te[P+w]=O[te[P+m]+e],te[ne+m]=te[P+m],te[P+m]=-1,O[L+i]<te[P+v]?O[L+e]<te[P+x]?Be=te[P+b]:Be=te[P+b]+D:O[L+e]<te[P+x]?Be=te[P+b]+D*2:Be=te[P+b]+D*3,ne===Be)if(X--){P=ne;continue}else{X=T;break}te[Be+m]=L;break}}if(z.barnesHutOptimize)for(be=z.scalingRatio,L=0;L<J;L+=C)for(P=0;;)if(te[P+b]>=0)if(G=Math.pow(O[L+i]-te[P+E],2)+Math.pow(O[L+e]-te[P+w],2),j=te[P+_],4*j*j/G<pe){if(ve=O[L+i]-te[P+E],ce=O[L+e]-te[P+w],re===!0?G>0?(le=be*O[L+a]*te[P+S]/G,O[L+t]+=ve*le,O[L+n]+=ce*le):G<0&&(le=-be*O[L+a]*te[P+S]/Math.sqrt(G),O[L+t]+=ve*le,O[L+n]+=ce*le):G>0&&(le=be*O[L+a]*te[P+S]/G,O[L+t]+=ve*le,O[L+n]+=ce*le),P=te[P+g],P<0)break;continue}else{P=te[P+b];continue}else{if(W=te[P+m],W>=0&&W!==L&&(ve=O[L+i]-O[W+i],ce=O[L+e]-O[W+e],G=ve*ve+ce*ce,re===!0?G>0?(le=be*O[L+a]*O[W+a]/G,O[L+t]+=ve*le,O[L+n]+=ce*le):G<0&&(le=-be*O[L+a]*O[W+a]/Math.sqrt(G),O[L+t]+=ve*le,O[L+n]+=ce*le):G>0&&(le=be*O[L+a]*O[W+a]/G,O[L+t]+=ve*le,O[L+n]+=ce*le)),P=te[P+g],P<0)break;continue}else for(be=z.scalingRatio,k=0;k<J;k+=C)for(H=0;H<k;H+=C)ve=O[k+i]-O[H+i],ce=O[k+e]-O[H+e],re===!0?(G=Math.sqrt(ve*ve+ce*ce)-O[k+l]-O[H+l],G>0?(le=be*O[k+a]*O[H+a]/G/G,O[k+t]+=ve*le,O[k+n]+=ce*le,O[H+t]-=ve*le,O[H+n]-=ce*le):G<0&&(le=100*be*O[k+a]*O[H+a],O[k+t]+=ve*le,O[k+n]+=ce*le,O[H+t]-=ve*le,O[H+n]-=ce*le)):(G=Math.sqrt(ve*ve+ce*ce),G>0&&(le=be*O[k+a]*O[H+a]/G/G,O[k+t]+=ve*le,O[k+n]+=ce*le,O[H+t]-=ve*le,O[H+n]-=ce*le));for(K=z.gravity/z.scalingRatio,be=z.scalingRatio,L=0;L<J;L+=C)le=0,ve=O[L+i],ce=O[L+e],G=Math.sqrt(Math.pow(ve,2)+Math.pow(ce,2)),z.strongGravityMode?G>0&&(le=be*O[L+a]*K):G>0&&(le=be*O[L+a]*K/G),O[L+t]-=ve*le,O[L+n]-=ce*le;for(be=1*(z.outboundAttractionDistribution?Oe:1),F=0;F<he;F+=U)k=V[F+f],H=V[F+d],Y=V[F+p],Ne=Math.pow(Y,z.edgeWeightInfluence),ve=O[k+i]-O[H+i],ce=O[k+e]-O[H+e],re===!0?(G=Math.sqrt(ve*ve+ce*ce)-O[k+l]-O[H+l],z.linLogMode?z.outboundAttractionDistribution?G>0&&(le=-be*Ne*Math.log(1+G)/G/O[k+a]):G>0&&(le=-be*Ne*Math.log(1+G)/G):z.outboundAttractionDistribution?G>0&&(le=-be*Ne/O[k+a]):G>0&&(le=-be*Ne)):(G=Math.sqrt(Math.pow(ve,2)+Math.pow(ce,2)),z.linLogMode?z.outboundAttractionDistribution?G>0&&(le=-be*Ne*Math.log(1+G)/G/O[k+a]):G>0&&(le=-be*Ne*Math.log(1+G)/G):z.outboundAttractionDistribution?(G=1,le=-be*Ne/O[k+a]):(G=1,le=-be*Ne)),G>0&&(O[k+t]+=ve*le,O[k+n]+=ce*le,O[H+t]-=ve*le,O[H+n]-=ce*le);var Se,ge,me,Fe,Ie,je;if(re===!0)for(L=0;L<J;L+=C)O[L+c]!==1&&(Se=Math.sqrt(Math.pow(O[L+t],2)+Math.pow(O[L+n],2)),Se>R&&(O[L+t]=O[L+t]*R/Se,O[L+n]=O[L+n]*R/Se),ge=O[L+a]*Math.sqrt((O[L+r]-O[L+t])*(O[L+r]-O[L+t])+(O[L+s]-O[L+n])*(O[L+s]-O[L+n])),me=Math.sqrt((O[L+r]+O[L+t])*(O[L+r]+O[L+t])+(O[L+s]+O[L+n])*(O[L+s]+O[L+n]))/2,Fe=.1*Math.log(1+me)/(1+Math.sqrt(ge)),Ie=O[L+i]+O[L+t]*(Fe/z.slowDown),O[L+i]=Ie,je=O[L+e]+O[L+n]*(Fe/z.slowDown),O[L+e]=je);else for(L=0;L<J;L+=C)O[L+c]!==1&&(ge=O[L+a]*Math.sqrt((O[L+r]-O[L+t])*(O[L+r]-O[L+t])+(O[L+s]-O[L+n])*(O[L+s]-O[L+n])),me=Math.sqrt((O[L+r]+O[L+t])*(O[L+r]+O[L+t])+(O[L+s]+O[L+n])*(O[L+s]+O[L+n]))/2,Fe=O[L+o]*Math.log(1+me)/(1+Math.sqrt(ge)),O[L+o]=Math.min(1,Math.sqrt(Fe*(Math.pow(O[L+t],2)+Math.pow(O[L+n],2))/(1+Math.sqrt(ge)))),Ie=O[L+i]+O[L+t]*(Fe/z.slowDown),O[L+i]=Ie,je=O[L+e]+O[L+n]*(Fe/z.slowDown),O[L+e]=je);return{}},t_}var sa={},mw;function VG(){if(mw)return sa;mw=1;var i=10,e=3;return sa.assign=function(t){t=t||{};var n=Array.prototype.slice.call(arguments).slice(1),r,s,a;for(r=0,a=n.length;r<a;r++)if(n[r])for(s in n[r])t[s]=n[r][s];return t},sa.validateSettings=function(t){return"linLogMode"in t&&typeof t.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in t&&typeof t.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in t&&typeof t.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in t&&typeof t.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in t&&!(typeof t.scalingRatio=="number"&&t.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},sa.graphToByteArrays=function(t,n){var r=t.order,s=t.size,a={},o,l=new Float32Array(r*i),c=new Float32Array(s*e);return o=0,t.forEachNode(function(f,d){a[f]=o,l[o]=d.x,l[o+1]=d.y,l[o+2]=0,l[o+3]=0,l[o+4]=0,l[o+5]=0,l[o+6]=1,l[o+7]=1,l[o+8]=d.size||1,l[o+9]=d.fixed?1:0,o+=i}),o=0,t.forEachEdge(function(f,d,p,m,v,x,_){var g=a[p],b=a[m],S=n(f,d,p,m,v,x,_);l[g+6]+=S,l[b+6]+=S,c[o]=g,c[o+1]=b,c[o+2]=S,o+=e}),{nodes:l,edges:c}},sa.assignLayoutChanges=function(t,n,r){var s=0;t.updateEachNodeAttributes(function(a,o){return o.x=n[s],o.y=n[s+1],s+=i,r?r(a,o):o})},sa.readGraphPositions=function(t,n){var r=0;t.forEachNode(function(s,a){n[r]=a.x,n[r+1]=a.y,r+=i})},sa.collectLayoutChanges=function(t,n,r){for(var s=t.nodes(),a={},o=0,l=0,c=n.length;o<c;o+=i){if(r){var f=Object.assign({},t.getNodeAttributes(s[l]));f.x=n[o],f.y=n[o+1],f=r(s[l],f),a[s[l]]={x:f.x,y:f.y}}else a[s[l]]={x:n[o],y:n[o+1]};l++}return a},sa.createWorker=function(n){var r=window.URL||window.webkitURL,s=n.toString(),a=r.createObjectURL(new Blob(["("+s+").call(this);"],{type:"text/javascript"})),o=new Worker(a);return r.revokeObjectURL(a),o},sa}var n_,gw;function WG(){return gw||(gw=1,n_={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),n_}var i_,vw;function XG(){if(vw)return i_;vw=1;var i=Aa(),e=c0().createEdgeWeightGetter,t=HG(),n=VG(),r=WG();function s(l,c,f){if(!i(c))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof f=="number"&&(f={iterations:f});var d=f.iterations;if(typeof d!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(d<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var p=e("getEdgeWeight"in f?f.getEdgeWeight:"weight").fromEntry,m=typeof f.outputReducer=="function"?f.outputReducer:null,v=n.assign({},r,f.settings),x=n.validateSettings(v);if(x)throw new Error("graphology-layout-forceatlas2: "+x.message);var _=n.graphToByteArrays(c,p),g;for(g=0;g<d;g++)t(v,_.nodes,_.edges);if(l){n.assignLayoutChanges(c,_.nodes,m);return}return n.collectLayoutChanges(c,_.nodes)}function a(l){var c=typeof l=="number"?l:l.order;return{barnesHutOptimize:c>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(c)}}var o=s.bind(null,!1);return o.assign=s.bind(null,!0),o.inferSettings=a,i_=o,i_}var jG=XG();const qG=vo(jG);var r_,yw;function YG(){if(yw)return r_;yw=1;var i=O1(),e=Aa(),t={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function n(s,a,o){if(!e(a))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");o=i(o,t);var l=o.dimensions;if(!Array.isArray(l)||l.length<1)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=l.length,f=o.center,d=o.rng,p=o.scale,m=(f-.5)*p;function v(_){for(var g=0;g<c;g++)_[l[g]]=d()*p+m;return _}if(!s){var x={};return a.forEachNode(function(_){x[_]=v({})}),x}a.updateEachNodeAttributes(function(_,g){return v(g),g},{attributes:l})}var r=n.bind(null,!1);return r.assign=n.bind(null,!0),r_=r,r_}var ZG=YG();const KG=vo(ZG);var zp={},s_={},_w;function nR(){return _w||(_w=1,function(i){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,n=Math.pow(2,32)-1,r=Math.pow(2,7)-1,s=Math.pow(2,15)-1,a=Math.pow(2,31)-1;i.getPointerArray=function(l){var c=l-1;if(c<=e)return Uint8Array;if(c<=t)return Uint16Array;if(c<=n)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},i.getSignedPointerArray=function(l){var c=l-1;return c<=r?Int8Array:c<=s?Int16Array:c<=a?Int32Array:Float64Array},i.getNumberType=function(l){return l===(l|0)?Math.sign(l)===-1?l<=127&&l>=-128?Int8Array:l<=32767&&l>=-32768?Int16Array:Int32Array:l<=255?Uint8Array:l<=65535?Uint16Array:Uint32Array:Float64Array};var o={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};i.getMinimalRepresentation=function(l,c){var f=null,d=0,p,m,v,x,_;for(x=0,_=l.length;x<_;x++)v=c?c(l[x]):l[x],m=i.getNumberType(v),p=o[m.name],p>d&&(d=p,f=m);return f},i.isTypedArray=function(l){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(l)},i.concat=function(){var l=0,c,f,d;for(c=0,d=arguments.length;c<d;c++)l+=arguments[c].length;var p=new arguments[0].constructor(l);for(c=0,f=0;c<d;c++)p.set(arguments[c],f),f+=arguments[c].length;return p},i.indices=function(l){for(var c=i.getPointerArray(l),f=new c(l),d=0;d<l;d++)f[d]=d;return f}}(s_)),s_}var xw;function JG(){if(xw)return zp;xw=1;var i=nR(),e=c0().createEdgeWeightGetter;function t(s,a){return s==="outbound"||s==="inbound"?a.directedSize+a.undirectedSize*2:s==="in"||s==="out"||s==="directed"?a.directedSize:a.undirectedSize*2}function n(s,a){a=a||"outbound";var o=s[a+"Neighbors"].bind(s),l=t(a,s),c=i.getPointerArray(l),f=i.getPointerArray(s.order);this.graph=s,this.neighborhood=new f(l),this.starts=new c(s.order+1),this.nodes=s.nodes();var d={},p,m,v,x,_,g,b=0;for(p=0,m=s.order;p<m;p++)d[this.nodes[p]]=p;for(p=0,m=s.order;p<m;p++)for(_=this.nodes[p],g=o(_),this.starts[p]=b,v=0,x=g.length;v<x;v++)this.neighborhood[b++]=d[g[v]];this.starts[p]=l}n.prototype.bounds=function(s){return[this.starts[s],this.starts[s+1]]},n.prototype.project=function(){var s=this,a={};return s.nodes.forEach(function(o,l){a[o]=Array.from(s.neighborhood.slice(s.starts[l],s.starts[l+1])).map(function(c){return s.nodes[c]})}),a},n.prototype.collect=function(s){var a,o,l={};for(a=0,o=s.length;a<o;a++)l[this.nodes[a]]=s[a];return l},n.prototype.assign=function(s,a){var o=0;this.graph.updateEachNodeAttributes(function(l,c){return c[s]=a[o++],c},{attributes:[s]})},zp.NeighborhoodIndex=n;function r(s,a,o){o=o||"outbound";var l=s[o+"Edges"].bind(s),c=t(o,s),f=i.getPointerArray(c),d=i.getPointerArray(s.order),p=e(a).fromMinimalEntry;this.graph=s,this.neighborhood=new d(c),this.weights=new Float64Array(c),this.outDegrees=new Float64Array(s.order),this.starts=new f(s.order+1),this.nodes=s.nodes();var m={},v,x,_,g,b,S,E,w,T,C=0;for(v=0,x=s.order;v<x;v++)m[this.nodes[v]]=v;for(v=0,x=s.order;v<x;v++)for(b=this.nodes[v],E=l(b),this.starts[v]=C,_=0,g=E.length;_<g;_++)w=E[_],S=s.opposite(b,w),T=p(w,s.getEdgeAttributes(w)),this.neighborhood[C]=m[S],this.weights[C++]=T,this.outDegrees[v]+=T;this.starts[v]=c}return r.prototype.bounds=n.prototype.bounds,r.prototype.project=n.prototype.project,r.prototype.collect=n.prototype.collect,r.prototype.assign=n.prototype.assign,zp.WeightedNeighborhoodIndex=r,zp}var a_,bw;function QG(){if(bw)return a_;bw=1;var i=Aa(),e=O1(),t=JG().WeightedNeighborhoodIndex,n={nodePagerankAttribute:"pagerank",getEdgeWeight:"weight",alpha:.85,maxIterations:100,tolerance:1e-6};function r(a,o,l){if(!i(o))throw new Error("graphology-metrics/centrality/pagerank: the given graph is not a valid graphology instance.");l=e(l,n);var c=l.alpha,f=l.maxIterations,d=l.tolerance,p=l.nodePagerankAttribute,m=o.order,v=1/m,x=new t(o,l.getEdgeWeight),_,g,b,S,E=new Float64Array(o.order),w=new Float64Array(x.weights.length),T=[];for(_=0;_<m;_++)for(E[_]=v,b=x.starts[_+1],S=x.outDegrees[_],S===0&&T.push(_),g=x.starts[_];g<b;g++)w[g]=x.weights[g]/S;for(var C=0,U=0,D,R,I,z=!1;C<f;){for(I=E,E=new Float64Array(o.order),D=0,_=0,b=T.length;_<b;_++)D+=I[T[_]];for(D*=c,_=0;_<m;_++){for(b=x.starts[_+1],g=x.starts[_];g<b;g++)R=x.neighborhood[g],E[R]+=c*I[_]*w[g];E[_]+=D*v+(1-c)*v}for(U=0,_=0;_<m;_++)U+=Math.abs(E[_]-I[_]);if(U<m*d){z=!0;break}C++}if(!z)throw Error("graphology-metrics/centrality/pagerank: failed to converge.");if(a){x.assign(p,E);return}return x.collect(E)}var s=r.bind(null,!1);return s.assign=r.bind(null,!0),a_=s,a_}var $G=QG();const eH=vo($G);var Ah={},Sw;function tH(){if(Sw)return Ah;Sw=1;var i=Aa();function e(s,a,o,l){var c=a+"Centrality";if(!i(o))throw new Error("graphology-centrality/"+c+": the given graph is not a valid graphology instance.");if(a!=="degree"&&o.type==="undirected")throw new Error("graphology-centrality/"+c+": cannot compute "+a+" centrality on an undirected graph.");l=l||{};var f=l.nodeCentralityAttribute||c,d=o.order-1,p=o[a].bind(o);if(s){o.updateEachNodeAttributes(function(v,x){return x[f]=p(v)/d,x},{attributes:[f]});return}var m={};return o.forEachNode(function(v){m[v]=p(v)/d}),m}var t=e.bind(null,!1,"degree"),n=e.bind(null,!1,"inDegree"),r=e.bind(null,!1,"outDegree");return t.assign=e.bind(null,!0,"degree"),n.assign=e.bind(null,!0,"inDegree"),r.assign=e.bind(null,!0,"outDegree"),Ah.degreeCentrality=t,Ah.inDegreeCentrality=n,Ah.outDegreeCentrality=r,Ah}var nH=tH();function um(i,e){return i==null||e==null?NaN:i<e?-1:i>e?1:i>=e?0:NaN}function iH(i,e){return i==null||e==null?NaN:e<i?-1:e>i?1:e>=i?0:NaN}function iR(i){let e,t,n;i.length!==2?(e=um,t=(o,l)=>um(i(o),l),n=(o,l)=>i(o)-l):(e=i===um||i===iH?i:rH,t=i,n=i);function r(o,l,c=0,f=o.length){if(c<f){if(e(l,l)!==0)return f;do{const d=c+f>>>1;t(o[d],l)<0?c=d+1:f=d}while(c<f)}return c}function s(o,l,c=0,f=o.length){if(c<f){if(e(l,l)!==0)return f;do{const d=c+f>>>1;t(o[d],l)<=0?c=d+1:f=d}while(c<f)}return c}function a(o,l,c=0,f=o.length){const d=r(o,l,c,f-1);return d>c&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:r,center:a,right:s}}function rH(){return 0}function sH(i){return i===null?NaN:+i}const aH=iR(um),oH=aH.right;iR(sH).center;const lH=Math.sqrt(50),cH=Math.sqrt(10),uH=Math.sqrt(2);function lg(i,e,t){const n=(e-i)/Math.max(0,t),r=Math.floor(Math.log10(n)),s=n/Math.pow(10,r),a=s>=lH?10:s>=cH?5:s>=uH?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/a,o=Math.round(i*c),l=Math.round(e*c),o/c<i&&++o,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*a,o=Math.round(i/c),l=Math.round(e/c),o*c<i&&++o,l*c>e&&--l),l<o&&.5<=t&&t<2?lg(i,e,t*2):[o,l,c]}function hH(i,e,t){if(e=+e,i=+i,t=+t,!(t>0))return[];if(i===e)return[i];const n=e<i,[r,s,a]=n?lg(e,i,t):lg(i,e,t);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(n)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(r+c)/-a;else for(let c=0;c<o;++c)l[c]=(r+c)*a;return l}function fx(i,e,t){return e=+e,i=+i,t=+t,lg(i,e,t)[2]}function fH(i,e,t){e=+e,i=+i,t=+t;const n=e<i,r=n?fx(e,i,t):fx(i,e,t);return(n?-1:1)*(r<0?1/-r:r)}function dH(i,e){switch(arguments.length){case 0:break;case 1:this.range(i);break;default:this.range(e).domain(i);break}return this}function L1(i,e,t){i.prototype=e.prototype=t,t.constructor=i}function rR(i,e){var t=Object.create(i.prototype);for(var n in e)t[n]=e[n];return t}function id(){}var Pf=.7,cg=1/Pf,ru="\\s*([+-]?\\d+)\\s*",zf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pH=/^#([0-9a-f]{3,8})$/,mH=new RegExp(`^rgb\\(${ru},${ru},${ru}\\)$`),gH=new RegExp(`^rgb\\(${Rs},${Rs},${Rs}\\)$`),vH=new RegExp(`^rgba\\(${ru},${ru},${ru},${zf}\\)$`),yH=new RegExp(`^rgba\\(${Rs},${Rs},${Rs},${zf}\\)$`),_H=new RegExp(`^hsl\\(${zf},${Rs},${Rs}\\)$`),xH=new RegExp(`^hsla\\(${zf},${Rs},${Rs},${zf}\\)$`),Ew={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};L1(id,Ff,{copy(i){return Object.assign(new this.constructor,this,i)},displayable(){return this.rgb().displayable()},hex:Mw,formatHex:Mw,formatHex8:bH,formatHsl:SH,formatRgb:ww,toString:ww});function Mw(){return this.rgb().formatHex()}function bH(){return this.rgb().formatHex8()}function SH(){return sR(this).formatHsl()}function ww(){return this.rgb().formatRgb()}function Ff(i){var e,t;return i=(i+"").trim().toLowerCase(),(e=pH.exec(i))?(t=e[1].length,e=parseInt(e[1],16),t===6?Tw(e):t===3?new nr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Fp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Fp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=mH.exec(i))?new nr(e[1],e[2],e[3],1):(e=gH.exec(i))?new nr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=vH.exec(i))?Fp(e[1],e[2],e[3],e[4]):(e=yH.exec(i))?Fp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_H.exec(i))?Rw(e[1],e[2]/100,e[3]/100,1):(e=xH.exec(i))?Rw(e[1],e[2]/100,e[3]/100,e[4]):Ew.hasOwnProperty(i)?Tw(Ew[i]):i==="transparent"?new nr(NaN,NaN,NaN,0):null}function Tw(i){return new nr(i>>16&255,i>>8&255,i&255,1)}function Fp(i,e,t,n){return n<=0&&(i=e=t=NaN),new nr(i,e,t,n)}function EH(i){return i instanceof id||(i=Ff(i)),i?(i=i.rgb(),new nr(i.r,i.g,i.b,i.opacity)):new nr}function dx(i,e,t,n){return arguments.length===1?EH(i):new nr(i,e,t,n??1)}function nr(i,e,t,n){this.r=+i,this.g=+e,this.b=+t,this.opacity=+n}L1(nr,dx,rR(id,{brighter(i){return i=i==null?cg:Math.pow(cg,i),new nr(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?Pf:Math.pow(Pf,i),new nr(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new nr(Ml(this.r),Ml(this.g),Ml(this.b),ug(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Aw,formatHex:Aw,formatHex8:MH,formatRgb:Cw,toString:Cw}));function Aw(){return`#${xl(this.r)}${xl(this.g)}${xl(this.b)}`}function MH(){return`#${xl(this.r)}${xl(this.g)}${xl(this.b)}${xl((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cw(){const i=ug(this.opacity);return`${i===1?"rgb(":"rgba("}${Ml(this.r)}, ${Ml(this.g)}, ${Ml(this.b)}${i===1?")":`, ${i})`}`}function ug(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function Ml(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function xl(i){return i=Ml(i),(i<16?"0":"")+i.toString(16)}function Rw(i,e,t,n){return n<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new as(i,e,t,n)}function sR(i){if(i instanceof as)return new as(i.h,i.s,i.l,i.opacity);if(i instanceof id||(i=Ff(i)),!i)return new as;if(i instanceof as)return i;i=i.rgb();var e=i.r/255,t=i.g/255,n=i.b/255,r=Math.min(e,t,n),s=Math.max(e,t,n),a=NaN,o=s-r,l=(s+r)/2;return o?(e===s?a=(t-n)/o+(t<n)*6:t===s?a=(n-e)/o+2:a=(e-t)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new as(a,o,l,i.opacity)}function wH(i,e,t,n){return arguments.length===1?sR(i):new as(i,e,t,n??1)}function as(i,e,t,n){this.h=+i,this.s=+e,this.l=+t,this.opacity=+n}L1(as,wH,rR(id,{brighter(i){return i=i==null?cg:Math.pow(cg,i),new as(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?Pf:Math.pow(Pf,i),new as(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,r=2*t-n;return new nr(o_(i>=240?i-240:i+120,r,n),o_(i,r,n),o_(i<120?i+240:i-120,r,n),this.opacity)},clamp(){return new as(Dw(this.h),Bp(this.s),Bp(this.l),ug(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=ug(this.opacity);return`${i===1?"hsl(":"hsla("}${Dw(this.h)}, ${Bp(this.s)*100}%, ${Bp(this.l)*100}%${i===1?")":`, ${i})`}`}}));function Dw(i){return i=(i||0)%360,i<0?i+360:i}function Bp(i){return Math.max(0,Math.min(1,i||0))}function o_(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}const N1=i=>()=>i;function TH(i,e){return function(t){return i+t*e}}function AH(i,e,t){return i=Math.pow(i,t),e=Math.pow(e,t)-i,t=1/t,function(n){return Math.pow(i+n*e,t)}}function CH(i){return(i=+i)==1?aR:function(e,t){return t-e?AH(e,t,i):N1(isNaN(e)?t:e)}}function aR(i,e){var t=e-i;return t?TH(i,t):N1(isNaN(i)?e:i)}const Uw=function i(e){var t=CH(e);function n(r,s){var a=t((r=dx(r)).r,(s=dx(s)).r),o=t(r.g,s.g),l=t(r.b,s.b),c=aR(r.opacity,s.opacity);return function(f){return r.r=a(f),r.g=o(f),r.b=l(f),r.opacity=c(f),r+""}}return n.gamma=i,n}(1);function RH(i,e){e||(e=[]);var t=i?Math.min(e.length,i.length):0,n=e.slice(),r;return function(s){for(r=0;r<t;++r)n[r]=i[r]*(1-s)+e[r]*s;return n}}function DH(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function UH(i,e){var t=e?e.length:0,n=i?Math.min(t,i.length):0,r=new Array(n),s=new Array(t),a;for(a=0;a<n;++a)r[a]=I1(i[a],e[a]);for(;a<t;++a)s[a]=e[a];return function(o){for(a=0;a<n;++a)s[a]=r[a](o);return s}}function OH(i,e){var t=new Date;return i=+i,e=+e,function(n){return t.setTime(i*(1-n)+e*n),t}}function hg(i,e){return i=+i,e=+e,function(t){return i*(1-t)+e*t}}function LH(i,e){var t={},n={},r;(i===null||typeof i!="object")&&(i={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in i?t[r]=I1(i[r],e[r]):n[r]=e[r];return function(s){for(r in t)n[r]=t[r](s);return n}}var px=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,l_=new RegExp(px.source,"g");function NH(i){return function(){return i}}function IH(i){return function(e){return i(e)+""}}function PH(i,e){var t=px.lastIndex=l_.lastIndex=0,n,r,s,a=-1,o=[],l=[];for(i=i+"",e=e+"";(n=px.exec(i))&&(r=l_.exec(e));)(s=r.index)>t&&(s=e.slice(t,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:hg(n,r)})),t=l_.lastIndex;return t<e.length&&(s=e.slice(t),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?IH(l[0].x):NH(e):(e=l.length,function(c){for(var f=0,d;f<e;++f)o[(d=l[f]).i]=d.x(c);return o.join("")})}function I1(i,e){var t=typeof e,n;return e==null||t==="boolean"?N1(e):(t==="number"?hg:t==="string"?(n=Ff(e))?(e=n,Uw):PH:e instanceof Ff?Uw:e instanceof Date?OH:DH(e)?RH:Array.isArray(e)?UH:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?LH:hg)(i,e)}function zH(i,e){return i=+i,e=+e,function(t){return Math.round(i*(1-t)+e*t)}}function FH(i){return function(){return i}}function BH(i){return+i}var Ow=[0,1];function eu(i){return i}function mx(i,e){return(e-=i=+i)?function(t){return(t-i)/e}:FH(isNaN(e)?NaN:.5)}function kH(i,e){var t;return i>e&&(t=i,i=e,e=t),function(n){return Math.max(i,Math.min(e,n))}}function GH(i,e,t){var n=i[0],r=i[1],s=e[0],a=e[1];return r<n?(n=mx(r,n),s=t(a,s)):(n=mx(n,r),s=t(s,a)),function(o){return s(n(o))}}function HH(i,e,t){var n=Math.min(i.length,e.length)-1,r=new Array(n),s=new Array(n),a=-1;for(i[n]<i[0]&&(i=i.slice().reverse(),e=e.slice().reverse());++a<n;)r[a]=mx(i[a],i[a+1]),s[a]=t(e[a],e[a+1]);return function(o){var l=oH(i,o,1,n)-1;return s[l](r[l](o))}}function VH(i,e){return e.domain(i.domain()).range(i.range()).interpolate(i.interpolate()).clamp(i.clamp()).unknown(i.unknown())}function WH(){var i=Ow,e=Ow,t=I1,n,r,s,a=eu,o,l,c;function f(){var p=Math.min(i.length,e.length);return a!==eu&&(a=kH(i[0],i[p-1])),o=p>2?HH:GH,l=c=null,d}function d(p){return p==null||isNaN(p=+p)?s:(l||(l=o(i.map(n),e,t)))(n(a(p)))}return d.invert=function(p){return a(r((c||(c=o(e,i.map(n),hg)))(p)))},d.domain=function(p){return arguments.length?(i=Array.from(p,BH),f()):i.slice()},d.range=function(p){return arguments.length?(e=Array.from(p),f()):e.slice()},d.rangeRound=function(p){return e=Array.from(p),t=zH,f()},d.clamp=function(p){return arguments.length?(a=p?!0:eu,f()):a!==eu},d.interpolate=function(p){return arguments.length?(t=p,f()):t},d.unknown=function(p){return arguments.length?(s=p,d):s},function(p,m){return n=p,r=m,f()}}function XH(){return WH()(eu,eu)}function jH(i){return Math.abs(i=Math.round(i))>=1e21?i.toLocaleString("en").replace(/,/g,""):i.toString(10)}function fg(i,e){if((t=(i=e?i.toExponential(e-1):i.toExponential()).indexOf("e"))<0)return null;var t,n=i.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+i.slice(t+1)]}function yu(i){return i=fg(Math.abs(i)),i?i[1]:NaN}function qH(i,e){return function(t,n){for(var r=t.length,s=[],a=0,o=i[0],l=0;r>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),s.push(t.substring(r-=o,r+o)),!((l+=o+1)>n));)o=i[a=(a+1)%i.length];return s.reverse().join(e)}}function YH(i){return function(e){return e.replace(/[0-9]/g,function(t){return i[+t]})}}var ZH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dg(i){if(!(e=ZH.exec(i)))throw new Error("invalid format: "+i);var e;return new P1({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}dg.prototype=P1.prototype;function P1(i){this.fill=i.fill===void 0?" ":i.fill+"",this.align=i.align===void 0?">":i.align+"",this.sign=i.sign===void 0?"-":i.sign+"",this.symbol=i.symbol===void 0?"":i.symbol+"",this.zero=!!i.zero,this.width=i.width===void 0?void 0:+i.width,this.comma=!!i.comma,this.precision=i.precision===void 0?void 0:+i.precision,this.trim=!!i.trim,this.type=i.type===void 0?"":i.type+""}P1.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function KH(i){e:for(var e=i.length,t=1,n=-1,r;t<e;++t)switch(i[t]){case".":n=r=t;break;case"0":n===0&&(n=t),r=t;break;default:if(!+i[t])break e;n>0&&(n=0);break}return n>0?i.slice(0,n)+i.slice(r+1):i}var oR;function JH(i,e){var t=fg(i,e);if(!t)return i+"";var n=t[0],r=t[1],s=r-(oR=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+fg(i,Math.max(0,e+s-1))[0]}function Lw(i,e){var t=fg(i,e);if(!t)return i+"";var n=t[0],r=t[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}const Nw={"%":(i,e)=>(i*100).toFixed(e),b:i=>Math.round(i).toString(2),c:i=>i+"",d:jH,e:(i,e)=>i.toExponential(e),f:(i,e)=>i.toFixed(e),g:(i,e)=>i.toPrecision(e),o:i=>Math.round(i).toString(8),p:(i,e)=>Lw(i*100,e),r:Lw,s:JH,X:i=>Math.round(i).toString(16).toUpperCase(),x:i=>Math.round(i).toString(16)};function Iw(i){return i}var Pw=Array.prototype.map,zw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function QH(i){var e=i.grouping===void 0||i.thousands===void 0?Iw:qH(Pw.call(i.grouping,Number),i.thousands+""),t=i.currency===void 0?"":i.currency[0]+"",n=i.currency===void 0?"":i.currency[1]+"",r=i.decimal===void 0?".":i.decimal+"",s=i.numerals===void 0?Iw:YH(Pw.call(i.numerals,String)),a=i.percent===void 0?"%":i.percent+"",o=i.minus===void 0?"−":i.minus+"",l=i.nan===void 0?"NaN":i.nan+"";function c(d){d=dg(d);var p=d.fill,m=d.align,v=d.sign,x=d.symbol,_=d.zero,g=d.width,b=d.comma,S=d.precision,E=d.trim,w=d.type;w==="n"?(b=!0,w="g"):Nw[w]||(S===void 0&&(S=12),E=!0,w="g"),(_||p==="0"&&m==="=")&&(_=!0,p="0",m="=");var T=x==="$"?t:x==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",C=x==="$"?n:/[%p]/.test(w)?a:"",U=Nw[w],D=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function R(I){var z=T,O=C,V,ee,P;if(w==="c")O=U(I)+O,I="";else{I=+I;var L=I<0||1/I<0;if(I=isNaN(I)?l:U(Math.abs(I),S),E&&(I=KH(I)),L&&+I==0&&v!=="+"&&(L=!1),z=(L?v==="("?v:o:v==="-"||v==="("?"":v)+z,O=(w==="s"?zw[8+oR/3]:"")+O+(L&&v==="("?")":""),D){for(V=-1,ee=I.length;++V<ee;)if(P=I.charCodeAt(V),48>P||P>57){O=(P===46?r+I.slice(V+1):I.slice(V))+O,I=I.slice(0,V);break}}}b&&!_&&(I=e(I,1/0));var k=z.length+I.length+O.length,H=k<g?new Array(g-k+1).join(p):"";switch(b&&_&&(I=e(H+I,H.length?g-O.length:1/0),H=""),m){case"<":I=z+I+O+H;break;case"=":I=z+H+I+O;break;case"^":I=H.slice(0,k=H.length>>1)+z+I+O+H.slice(k);break;default:I=H+z+I+O;break}return s(I)}return R.toString=function(){return d+""},R}function f(d,p){var m=c((d=dg(d),d.type="f",d)),v=Math.max(-8,Math.min(8,Math.floor(yu(p)/3)))*3,x=Math.pow(10,-v),_=zw[8+v/3];return function(g){return m(x*g)+_}}return{format:c,formatPrefix:f}}var kp,lR,cR;$H({thousands:",",grouping:[3],currency:["$",""]});function $H(i){return kp=QH(i),lR=kp.format,cR=kp.formatPrefix,kp}function eV(i){return Math.max(0,-yu(Math.abs(i)))}function tV(i,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yu(e)/3)))*3-yu(Math.abs(i)))}function nV(i,e){return i=Math.abs(i),e=Math.abs(e)-i,Math.max(0,yu(e)-yu(i))+1}function iV(i,e,t,n){var r=fH(i,e,t),s;switch(n=dg(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(i),Math.abs(e));return n.precision==null&&!isNaN(s=tV(r,a))&&(n.precision=s),cR(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=nV(r,Math.max(Math.abs(i),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=eV(r))&&(n.precision=s-(n.type==="%")*2);break}}return lR(n)}function rV(i){var e=i.domain;return i.ticks=function(t){var n=e();return hH(n[0],n[n.length-1],t??10)},i.tickFormat=function(t,n){var r=e();return iV(r[0],r[r.length-1],t??10,n)},i.nice=function(t){t==null&&(t=10);var n=e(),r=0,s=n.length-1,a=n[r],o=n[s],l,c,f=10;for(o<a&&(c=a,a=o,o=c,c=r,r=s,s=c);f-- >0;){if(c=fx(a,o,t),c===l)return n[r]=a,n[s]=o,e(n);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return i},i}function uR(){var i=XH();return i.copy=function(){return VH(i,uR())},dH.apply(i,arguments),rV(i)}const Fw=i=>{let e;const t=new Set,n=(c,f)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const p=e;e=f??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,o={setState:n,getState:r,getInitialState:()=>l,subscribe:c=>(t.add(c),()=>t.delete(c))},l=e=i(n,r,o);return o},sV=i=>i?Fw(i):Fw,aV=i=>i;function hR(i,e=aV){const t=uo.useSyncExternalStore(i.subscribe,()=>e(i.getState()),()=>e(i.getInitialState()));return uo.useDebugValue(t),t}const Bw=i=>{const e=sV(i),t=n=>hR(e,n);return Object.assign(t,e),t},oV=i=>i?Bw(i):Bw,kw=i=>Symbol.iterator in i,Gw=i=>"entries"in i,Hw=(i,e)=>{const t=i instanceof Map?i:new Map(i.entries()),n=e instanceof Map?e:new Map(e.entries());if(t.size!==n.size)return!1;for(const[r,s]of t)if(!Object.is(s,n.get(r)))return!1;return!0},lV=(i,e)=>{const t=i[Symbol.iterator](),n=e[Symbol.iterator]();let r=t.next(),s=n.next();for(;!r.done&&!s.done;){if(!Object.is(r.value,s.value))return!1;r=t.next(),s=n.next()}return!!r.done&&!!s.done};function cV(i,e){return Object.is(i,e)?!0:typeof i!="object"||i===null||typeof e!="object"||e===null||Object.getPrototypeOf(i)!==Object.getPrototypeOf(e)?!1:kw(i)&&kw(e)?Gw(i)&&Gw(e)?Hw(i,e):lV(i,e):Hw({entries:()=>Object.entries(i)},{entries:()=>Object.entries(e)})}function uV(i){const e=uo.useRef(void 0);return t=>{const n=i(t);return cV(e.current,n)?e.current:e.current=n}}var $r={},cl={},c_,Vw;function hV(){if(Vw)return c_;Vw=1;function i(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=function(){return this}),i.of=function(){var e=arguments,t=e.length,n=0;return new i(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},i.empty=function(){var e=new i(function(){return{done:!0}});return e},i.fromSequence=function(e){var t=0,n=e.length;return new i(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},i.is=function(e){return e instanceof i?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},c_=i,c_}var Gp={},Ww;function fV(){return Ww||(Ww=1,Gp.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",Gp.SYMBOL_SUPPORT=typeof Symbol<"u"),Gp}var u_,Xw;function z1(){if(Xw)return u_;Xw=1;var i=fV(),e=i.ARRAY_BUFFER_SUPPORT,t=i.SYMBOL_SUPPORT;return u_=function(r,s){var a,o,l,c,f;if(!r)throw new Error("obliterator/forEach: invalid iterable.");if(typeof s!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(r)||e&&ArrayBuffer.isView(r)||typeof r=="string"||r.toString()==="[object Arguments]"){for(l=0,c=r.length;l<c;l++)s(r[l],l);return}if(typeof r.forEach=="function"){r.forEach(s);return}if(t&&Symbol.iterator in r&&typeof r.next!="function"&&(r=r[Symbol.iterator]()),typeof r.next=="function"){for(a=r,l=0;f=a.next(),f.done!==!0;)s(f.value,l),l++;return}for(o in r)r.hasOwnProperty(o)&&s(r[o],o)},u_}var h_,jw;function dV(){if(jw)return h_;jw=1;var i=hV(),e=z1();function t(){this.clear()}return t.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},t.prototype.enqueue=function(n){return this.items.push(n),++this.size},t.prototype.dequeue=function(){if(this.size){var n=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,n}},t.prototype.peek=function(){if(this.size)return this.items[this.offset]},t.prototype.forEach=function(n,r){r=arguments.length>1?r:this;for(var s=this.offset,a=0,o=this.items.length;s<o;s++,a++)n.call(r,this.items[s],a,this)},t.prototype.toArray=function(){return this.items.slice(this.offset)},t.prototype.values=function(){var n=this.items,r=this.offset;return new i(function(){if(r>=n.length)return{done:!0};var s=n[r];return r++,{value:s,done:!1}})},t.prototype.entries=function(){var n=this.items,r=this.offset,s=0;return new i(function(){if(r>=n.length)return{done:!0};var a=n[r];return r++,{value:[s++,a],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.toString=function(){return this.toArray().join(",")},t.prototype.toJSON=function(){return this.toArray()},t.prototype.inspect=function(){var n=this.toArray();return Object.defineProperty(n,"constructor",{value:t,enumerable:!1}),n},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(n){var r=new t;return e(n,function(s){r.enqueue(s)}),r},t.of=function(){return t.from(arguments)},h_=t,h_}var f_,qw;function pV(){return qw||(qw=1,f_=function(e,t){var n=t.length;if(n!==0){var r=e.length;e.length+=n;for(var s=0;s<n;s++)e[r+s]=t[s]}}),f_}var Yw;function mV(){if(Yw)return cl;Yw=1;var i=Aa(),e=dV(),t=pV();function n(c,f,d){if(!i(c))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!c.hasNode(f))throw new Error('graphology-shortest-path: the "'+f+'" source node does not exist in the given graph.');if(!c.hasNode(d))throw new Error('graphology-shortest-path: the "'+d+'" target node does not exist in the given graph.');if(f=""+f,d=""+d,f===d)return[f];var p=c.inboundNeighbors.bind(c),m=c.outboundNeighbors.bind(c),v={},x={};v[f]=null,x[d]=null;var _=[f],g=[d],b,S,E,w,T,C,U,D,R=!1;e:for(;_.length&&g.length;)if(_.length<=g.length){for(b=_,_=[],T=0,U=b.length;T<U;T++)for(S=b[T],E=m(S),C=0,D=E.length;C<D;C++)if(w=E[C],w in v||(_.push(w),v[w]=S),w in x){R=!0;break e}}else for(b=g,g=[],T=0,U=b.length;T<U;T++)for(S=b[T],E=p(S),C=0,D=E.length;C<D;C++)if(w=E[C],w in x||(g.push(w),x[w]=S),w in v){R=!0;break e}if(!R)return null;for(var I=[];w;)I.unshift(w),w=v[w];for(w=x[I[I.length-1]];w;)I.push(w),w=x[w];return I.length?I:null}function r(c,f){if(!i(c))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<2)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 2.");if(!c.hasNode(f))throw new Error('graphology-shortest-path: the "'+f+'" source node does not exist in the given graph.');f=""+f;var d={},p={},m,v,x,_,g,b;for(d[f]=!0,p[f]=[f];Object.keys(d).length;){m=d,d={};for(x in m)for(v=c.outboundNeighbors(x),g=0,b=v.length;g<b;g++)_=v[g],p[_]||(p[_]=p[x].concat(_),d[_]=!0)}return p}function s(c,f,d){if(!i(f))throw new Error("graphology-shortest-path: invalid graphology instance.");if(!f.hasNode(d))throw new Error('graphology-shortest-path: the "'+d+'" source node does not exist in the given graph.');d=""+d;var p=new Set,m={},v=0;m[d]=0;for(var x=[d],_,g,b;x.length!==0;){var S=[];for(_=0,g=x.length;_<g;_++)b=x[_],!p.has(b)&&(p.add(b),t(S,f[c](b)),m[b]=v);v++,x=S}return m}var a=s.bind(null,"outboundNeighbors"),o=s.bind(null,"neighbors");function l(c,f){f=""+f;var d=[],p={},m={},v=c.nodes(),x,_,g,b,S,E,w,T,C;for(E=0,T=v.length;E<T;E++)b=v[E],p[b]=[],m[b]=0;var U={};m[f]=1,U[f]=0;for(var D=e.of(f);D.size;)for(b=D.dequeue(),d.push(b),x=U[b],_=m[b],g=c.outboundNeighbors(b),w=0,C=g.length;w<C;w++)S=g[w],S in U||(D.enqueue(S),U[S]=x+1),U[S]===x+1&&(m[S]+=_,p[S].push(b));return[d,p,m]}return cl.bidirectional=n,cl.singleSource=r,cl.singleSourceLength=a,cl.undirectedSingleSourceLength=o,cl.brandes=l,cl}var d_={},Zw;function gV(){if(Zw)return d_;Zw=1;var i=function(){return!0};return d_.edgePathFromNodePath=function(e,t){var n=t.length,r,s,a,o;if(n<2)return s=t[0],o=e.multi?e.findEdge(s,s,i):e.edge(s,s),o?[o]:[];n--;var l=new Array(n);for(r=0;r<n;r++){if(s=t[r],a=t[r+1],o=e.multi?e.findOutboundEdge(s,a,i):e.edge(s,a),o===void 0)throw new Error("graphology-shortest-path: given path is impossible in given graph.");l[r]=o}return l},d_}var Ch={},Fc={},Kw;function vV(){if(Kw)return Fc;Kw=1;var i=function(r,s){return r<s?-1:r>s?1:0},e=function(r,s){return r<s?1:r>s?-1:0};function t(r){return function(s,a){return r(a,s)}}function n(r){return r===2?function(s,a){return s[0]<a[0]?-1:s[0]>a[0]?1:s[1]<a[1]?-1:s[1]>a[1]?1:0}:function(s,a){for(var o=0;o<r;){if(s[o]<a[o])return-1;if(s[o]>a[o])return 1;o++}return 0}}return Fc.DEFAULT_COMPARATOR=i,Fc.DEFAULT_REVERSE_COMPARATOR=e,Fc.reverseComparator=t,Fc.createTupleComparator=n,Fc}var Bc={},Jw;function yV(){if(Jw)return Bc;Jw=1;var i=z1(),e=nR();function t(a){return Array.isArray(a)||e.isTypedArray(a)}function n(a){if(typeof a.length=="number")return a.length;if(typeof a.size=="number")return a.size}function r(a){var o=n(a),l=typeof o=="number"?new Array(o):[],c=0;return i(a,function(f){l[c++]=f}),l}function s(a){var o=n(a),l=typeof o=="number"?e.getPointerArray(o):Array,c=typeof o=="number"?new Array(o):[],f=typeof o=="number"?new l(o):[],d=0;return i(a,function(p){c[d]=p,f[d]=d++}),[c,f]}return Bc.isArrayLike=t,Bc.guessLength=n,Bc.toArray=r,Bc.toArrayWithIndices=s,Bc}var p_,Qw;function fR(){if(Qw)return p_;Qw=1;var i=z1(),e=vV(),t=yV(),n=e.DEFAULT_COMPARATOR,r=e.reverseComparator;function s(g,b,S,E){for(var w=b[E],T,C;E>S;){if(T=E-1>>1,C=b[T],g(w,C)<0){b[E]=C,E=T;continue}break}b[E]=w}function a(g,b,S){for(var E=b.length,w=S,T=b[S],C=2*S+1,U;C<E;)U=C+1,U<E&&g(b[C],b[U])>=0&&(C=U),b[S]=b[C],S=C,C=2*S+1;b[S]=T,s(g,b,w,S)}function o(g,b,S){b.push(S),s(g,b,0,b.length-1)}function l(g,b){var S=b.pop();if(b.length!==0){var E=b[0];return b[0]=S,a(g,b,0),E}return S}function c(g,b,S){if(b.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var E=b[0];return b[0]=S,a(g,b,0),E}function f(g,b,S){var E;return b.length!==0&&g(b[0],S)<0&&(E=b[0],b[0]=S,S=E,a(g,b,0)),S}function d(g,b){for(var S=b.length,E=S>>1,w=E;--w>=0;)a(g,b,w)}function p(g,b){for(var S=b.length,E=0,w=new Array(S);E<S;)w[E++]=l(g,b);return w}function m(g,b,S){arguments.length===2&&(S=b,b=g,g=n);var E=r(g),w,T,C,U=1/0,D;if(b===1){if(t.isArrayLike(S)){for(w=0,T=S.length;w<T;w++)C=S[w],(U===1/0||g(C,U)<0)&&(U=C);return D=new S.constructor(1),D[0]=U,D}return i(S,function(I){(U===1/0||g(I,U)<0)&&(U=I)}),[U]}if(t.isArrayLike(S)){if(b>=S.length)return S.slice().sort(g);for(D=S.slice(0,b),d(E,D),w=b,T=S.length;w<T;w++)E(S[w],D[0])>0&&c(E,D,S[w]);return D.sort(g)}var R=t.guessLength(S);return R!==null&&R<b&&(b=R),D=new Array(b),w=0,i(S,function(I){w<b?D[w]=I:(w===b&&d(E,D),E(I,D[0])>0&&c(E,D,I)),w++}),D.length>w&&(D.length=w),D.sort(g)}function v(g,b,S){arguments.length===2&&(S=b,b=g,g=n);var E=r(g),w,T,C,U=-1/0,D;if(b===1){if(t.isArrayLike(S)){for(w=0,T=S.length;w<T;w++)C=S[w],(U===-1/0||g(C,U)>0)&&(U=C);return D=new S.constructor(1),D[0]=U,D}return i(S,function(I){(U===-1/0||g(I,U)>0)&&(U=I)}),[U]}if(t.isArrayLike(S)){if(b>=S.length)return S.slice().sort(E);for(D=S.slice(0,b),d(g,D),w=b,T=S.length;w<T;w++)g(S[w],D[0])>0&&c(g,D,S[w]);return D.sort(E)}var R=t.guessLength(S);return R!==null&&R<b&&(b=R),D=new Array(b),w=0,i(S,function(I){w<b?D[w]=I:(w===b&&d(g,D),g(I,D[0])>0&&c(g,D,I)),w++}),D.length>w&&(D.length=w),D.sort(E)}function x(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}x.prototype.clear=function(){this.items=[],this.size=0},x.prototype.push=function(g){return o(this.comparator,this.items,g),++this.size},x.prototype.peek=function(){return this.items[0]},x.prototype.pop=function(){return this.size!==0&&this.size--,l(this.comparator,this.items)},x.prototype.replace=function(g){return c(this.comparator,this.items,g)},x.prototype.pushpop=function(g){return f(this.comparator,this.items,g)},x.prototype.consume=function(){return this.size=0,p(this.comparator,this.items)},x.prototype.toArray=function(){return p(this.comparator,this.items.slice())},x.prototype.inspect=function(){var g=this.toArray();return Object.defineProperty(g,"constructor",{value:x,enumerable:!1}),g},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect);function _(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=r(this.comparator)}return _.prototype=x.prototype,x.from=function(g,b){var S=new x(b),E;return t.isArrayLike(g)?E=g.slice():E=t.toArray(g),d(S.comparator,E),S.items=E,S.size=E.length,S},_.from=function(g,b){var S=new _(b),E;return t.isArrayLike(g)?E=g.slice():E=t.toArray(g),d(S.comparator,E),S.items=E,S.size=E.length,S},x.siftUp=a,x.siftDown=s,x.push=o,x.pop=l,x.replace=c,x.pushpop=f,x.heapify=d,x.consume=p,x.nsmallest=m,x.nlargest=v,x.MinHeap=x,x.MaxHeap=_,p_=x,p_}var $w;function _V(){if($w)return Ch;$w=1;var i=Aa(),e=c0().createEdgeWeightGetter,t=fR(),n="weight";function r(d,p){return d[0]>p[0]?1:d[0]<p[0]?-1:d[1]>p[1]?1:d[1]<p[1]?-1:d[2]>p[2]?1:d[2]<p[2]?-1:0}function s(d,p){return d[0]>p[0]?1:d[0]<p[0]?-1:d[1]>p[1]?1:d[1]<p[1]?-1:d[2]>p[2]?1:d[2]<p[2]?-1:d[3]>p[3]?1:d[3]<p[3]?-1:0}function a(d,p,m,v){if(p=""+p,m=""+m,!i(d))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");if(p&&!d.hasNode(p))throw new Error('graphology-shortest-path/dijkstra: the "'+p+'" source node does not exist in the given graph.');if(m&&!d.hasNode(m))throw new Error('graphology-shortest-path/dijkstra: the "'+m+'" target node does not exist in the given graph.');if(v=e(v||n).fromMinimalEntry,p===m)return[0,[p]];var x=[{},{}],_=[{},{}],g=[new t(r),new t(r)],b=[{},{}];_[0][p]=[p],_[1][m]=[m],b[0][p]=0,b[1][m]=0;var S=[],E=1/0,w=0,T=1,C,U,D,R,I,z,O,V,ee;for(g[0].push([0,w++,p]),g[1].push([0,w++,m]);g[0].size&&g[1].size;)if(T=1-T,C=g[T].pop(),R=C[0],I=C[2],!(I in x[T])){if(x[T][I]=R,I in x[1-T])return[E,S];for(U=T===1?d.inboundEdges(I):d.outboundEdges(I),V=0,ee=U.length;V<ee;V++){if(O=U[V],z=d.opposite(I,O),D=x[T][I]+v(O,d.getEdgeAttributes(O)),z in x[T]&&D<x[T][z])throw Error("graphology-shortest-path/dijkstra: contradictory paths found. Do some of your edges have a negative weight?");(!(z in b[T])||D<b[T][z])&&(b[T][z]=D,g[T].push([D,w++,z]),_[T][z]=_[T][I].concat(z),z in b[0]&&z in b[1]&&(R=b[0][z]+b[1][z],(S.length===0||E>R)&&(E=R,S=_[0][z].concat(_[1][z].slice(0,-1).reverse()))))}}return[1/0,null]}function o(d,p,m,v,x,_){if(!i(d))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");m=e(m||n).fromMinimalEntry;var g={},b={},S=new t(r),E=0,w,T,C,U,D,R,I,z,O,V,ee;for(z=0,V=p.length;z<V;z++)U=p[z],b[U]=0,S.push([0,E++,U]),_&&(_[U]=[U]);for(;S.size;)if(T=S.pop(),I=T[0],U=T[2],!(U in g)){if(g[U]=I,U===x)break;for(w=d.outboundEdges(U),O=0,ee=w.length;O<ee;O++){if(R=w[O],D=d.opposite(U,R),C=m(R,d.getEdgeAttributes(R))+g[U],D in g&&C<g[D])throw Error("graphology-shortest-path/dijkstra: contradictory paths found. Do some of your edges have a negative weight?");(!(D in b)||C<b[D])&&(b[D]=C,S.push([C,E++,D]),_&&(_[D]=_[U].concat(D)))}}return g}function l(d,p,m){var v={};return o(d,[p],m,0,null,v),v}function c(d,p,m,v){return a(d,p,m,v)[1]}function f(d,p,m){p=""+p,m=e(m||n).fromMinimalEntry;var v=[],x={},_={},g=d.nodes(),b,S,E,w,T,C,U,D,R,I;for(R=0,I=g.length;R<I;R++)C=g[R],x[C]=[],_[C]=0;var z={};_[p]=1;var O={};O[p]=0;var V=0,ee=new t(s);for(ee.push([0,V++,p,p]);ee.size;)if(S=ee.pop(),w=S[0],E=S[2],C=S[3],!(C in z))for(_[C]+=_[E],v.push(C),z[C]=w,b=d.outboundEdges(C),R=0,I=b.length;R<I;R++)D=b[R],U=d.opposite(C,D),T=w+m(D,d.getEdgeAttributes(D)),!(U in z)&&(!(U in O)||T<O[U])?(O[U]=T,ee.push([T,V++,C,U]),_[U]=0,x[U]=[C]):T===O[U]&&(_[U]+=_[C],x[U].push(C));return[v,x,_]}return Ch.bidirectional=c,Ch.singleSource=l,Ch.brandes=f,Ch}var m_={},eT;function xV(){if(eT)return m_;eT=1;var i=Aa(),e=c0().createEdgeWeightGetter,t=fR(),n="weight";function r(a,o){return a[0]>o[0]?1:a[0]<o[0]?-1:a[1]>o[1]?1:a[1]<o[1]?-1:0}function s(a,o,l,c,f,d){if(!i(a))throw new Error("graphology-shortest-path/astar: invalid graphology instance.");if(o&&!a.hasNode(o))throw new Error('graphology-shortest-path/astar: the "'+o+'" source node does not exist in the given graph.');if(l&&!a.hasNode(l))throw new Error('graphology-shortest-path/astar: the "'+l+'" target node does not exist in the given graph.');if(c=e(c||n).fromMinimalEntry,o===l)return[o];f=f||function(){return 0},d=d||{};var p=0,m=new t(r);m.push([0,p++,o,0,null]);var v={},x={},_,g,b,S,E,w,T,C,U,D,R,I;function z(O,V,ee,P){if(I=g===ee?P:ee,D=c(O,V),D!==null){if(R=S+D,v.hasOwnProperty(I)){if(b=v[I],C=b[0],U=b[1],C<=R)return}else U=f(I,l);d.cutoff&&R+U>d.cutoff||(v[I]=[R,U],m.push([R+U,p++,I,R,g]))}}for(;m.size!==0;){if(_=m.pop(),g=_[2],S=_[3],E=_[4],g===l){for(w=[g],T=E;T!==null;)w.push(T),T=x[T];return w.reverse(),w}x.hasOwnProperty(g)&&(x[g]===null||(C=v[g][0],C<S))||(x[g]=E,a.forEachOutboundEdge(g,z))}return null}return m_.bidirectional=s,m_}var tT;function bV(){if(tT)return $r;tT=1;var i=mV(),e=gV();return $r.unweighted=i,$r.dijkstra=_V(),$r.astar=xV(),$r.bidirectional=i.bidirectional,$r.singleSource=i.singleSource,$r.singleSourceLength=i.singleSourceLength,$r.undirectedSingleSourceLength=i.undirectedSingleSourceLength,$r.brandes=i.brandes,$r.edgePathFromNodePath=e.edgePathFromNodePath,$r}var SV=bV(),Hp={exports:{}},nT;function EV(){if(nT)return Hp.exports;nT=1;var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(w,T,C){return Function.prototype.apply.call(w,T,C)},t;i&&typeof i.ownKeys=="function"?t=i.ownKeys:Object.getOwnPropertySymbols?t=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:t=function(w){return Object.getOwnPropertyNames(w)};function n(E){console&&console.warn&&console.warn(E)}var r=Number.isNaN||function(w){return w!==w};function s(){s.init.call(this)}Hp.exports=s,Hp.exports.once=g,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(E){if(typeof E!="number"||E<0||r(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");a=E}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||r(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function l(E){return E._maxListeners===void 0?s.defaultMaxListeners:E._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(w){for(var T=[],C=1;C<arguments.length;C++)T.push(arguments[C]);var U=w==="error",D=this._events;if(D!==void 0)U=U&&D.error===void 0;else if(!U)return!1;if(U){var R;if(T.length>0&&(R=T[0]),R instanceof Error)throw R;var I=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw I.context=R,I}var z=D[w];if(z===void 0)return!1;if(typeof z=="function")e(z,this,T);else for(var O=z.length,V=v(z,O),C=0;C<O;++C)e(V[C],this,T);return!0};function c(E,w,T,C){var U,D,R;if(o(T),D=E._events,D===void 0?(D=E._events=Object.create(null),E._eventsCount=0):(D.newListener!==void 0&&(E.emit("newListener",w,T.listener?T.listener:T),D=E._events),R=D[w]),R===void 0)R=D[w]=T,++E._eventsCount;else if(typeof R=="function"?R=D[w]=C?[T,R]:[R,T]:C?R.unshift(T):R.push(T),U=l(E),U>0&&R.length>U&&!R.warned){R.warned=!0;var I=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");I.name="MaxListenersExceededWarning",I.emitter=E,I.type=w,I.count=R.length,n(I)}return E}s.prototype.addListener=function(w,T){return c(this,w,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(w,T){return c(this,w,T,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(E,w,T){var C={fired:!1,wrapFn:void 0,target:E,type:w,listener:T},U=f.bind(C);return U.listener=T,C.wrapFn=U,U}s.prototype.once=function(w,T){return o(T),this.on(w,d(this,w,T)),this},s.prototype.prependOnceListener=function(w,T){return o(T),this.prependListener(w,d(this,w,T)),this},s.prototype.removeListener=function(w,T){var C,U,D,R,I;if(o(T),U=this._events,U===void 0)return this;if(C=U[w],C===void 0)return this;if(C===T||C.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete U[w],U.removeListener&&this.emit("removeListener",w,C.listener||T));else if(typeof C!="function"){for(D=-1,R=C.length-1;R>=0;R--)if(C[R]===T||C[R].listener===T){I=C[R].listener,D=R;break}if(D<0)return this;D===0?C.shift():x(C,D),C.length===1&&(U[w]=C[0]),U.removeListener!==void 0&&this.emit("removeListener",w,I||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(w){var T,C,U;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[w]),this;if(arguments.length===0){var D=Object.keys(C),R;for(U=0;U<D.length;++U)R=D[U],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=C[w],typeof T=="function")this.removeListener(w,T);else if(T!==void 0)for(U=T.length-1;U>=0;U--)this.removeListener(w,T[U]);return this};function p(E,w,T){var C=E._events;if(C===void 0)return[];var U=C[w];return U===void 0?[]:typeof U=="function"?T?[U.listener||U]:[U]:T?_(U):v(U,U.length)}s.prototype.listeners=function(w){return p(this,w,!0)},s.prototype.rawListeners=function(w){return p(this,w,!1)},s.listenerCount=function(E,w){return typeof E.listenerCount=="function"?E.listenerCount(w):m.call(E,w)},s.prototype.listenerCount=m;function m(E){var w=this._events;if(w!==void 0){var T=w[E];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function v(E,w){for(var T=new Array(w),C=0;C<w;++C)T[C]=E[C];return T}function x(E,w){for(;w+1<E.length;w++)E[w]=E[w+1];E.pop()}function _(E){for(var w=new Array(E.length),T=0;T<w.length;++T)w[T]=E[T].listener||E[T];return w}function g(E,w){return new Promise(function(T,C){function U(R){E.removeListener(w,D),C(R)}function D(){typeof E.removeListener=="function"&&E.removeListener("error",U),T([].slice.call(arguments))}S(E,w,D,{once:!0}),w!=="error"&&b(E,U,{once:!0})})}function b(E,w,T){typeof E.on=="function"&&S(E,"error",w,T)}function S(E,w,T,C){if(typeof E.on=="function")C.once?E.once(w,T):E.on(w,T);else if(typeof E.addEventListener=="function")E.addEventListener(w,function U(D){C.once&&E.removeEventListener(w,U),T(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E)}return Hp.exports}var MV=EV();function wV(){const i=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const n in arguments[e])i[n]=arguments[e][n];return i}let ii=wV;typeof Object.assign=="function"&&(ii=Object.assign);function Gr(i,e,t,n){const r=i._nodes.get(e);let s=null;return r&&(n==="mixed"?s=r.out&&r.out[t]||r.undirected&&r.undirected[t]:n==="directed"?s=r.out&&r.out[t]:s=r.undirected&&r.undirected[t]),s}function vi(i){return typeof i=="object"&&i!==null}function dR(i){let e;for(e in i)return!1;return!0}function Or(i,e,t){Object.defineProperty(i,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}function es(i,e,t){const n={enumerable:!0,configurable:!0};typeof t=="function"?n.get=t:(n.value=t,n.writable=!1),Object.defineProperty(i,e,n)}function iT(i){return!(!vi(i)||i.attributes&&!Array.isArray(i.attributes))}function TV(){let i=Math.floor(Math.random()*256)&255;return()=>i++}function ya(){const i=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let n=null;do{if(e===null){if(t++,t>=i.length)return{done:!0};e=i[t][Symbol.iterator]()}if(n=e.next(),n.done){e=null;continue}break}while(!0);return n}}}function Cu(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class F1 extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class ct extends F1{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ct.prototype.constructor)}}class Qe extends F1{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Qe.prototype.constructor)}}class xt extends F1{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,xt.prototype.constructor)}}function pR(i,e){this.key=i,this.attributes=e,this.clear()}pR.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function mR(i,e){this.key=i,this.attributes=e,this.clear()}mR.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function gR(i,e){this.key=i,this.attributes=e,this.clear()}gR.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ru(i,e,t,n,r){this.key=e,this.attributes=r,this.undirected=i,this.source=t,this.target=n}Ru.prototype.attach=function(){let i="out",e="in";this.undirected&&(i=e="undirected");const t=this.source.key,n=this.target.key;this.source[i][n]=this,!(this.undirected&&t===n)&&(this.target[e][t]=this)};Ru.prototype.attachMulti=function(){let i="out",e="in";const t=this.source.key,n=this.target.key;this.undirected&&(i=e="undirected");const r=this.source[i],s=r[n];if(typeof s>"u"){r[n]=this,this.undirected&&t===n||(this.target[e][t]=this);return}s.previous=this,this.next=s,r[n]=this,this.target[e][t]=this};Ru.prototype.detach=function(){const i=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),delete this.source[t][e],delete this.target[n][i]};Ru.prototype.detachMulti=function(){const i=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[n][i]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[n][i]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const vR=0,yR=1,AV=2,_R=3;function Ca(i,e,t,n,r,s,a){let o,l,c,f;if(n=""+n,t===vR){if(o=i._nodes.get(n),!o)throw new Qe(`Graph.${e}: could not find the "${n}" node in the graph.`);c=r,f=s}else if(t===_R){if(r=""+r,l=i._edges.get(r),!l)throw new Qe(`Graph.${e}: could not find the "${r}" edge in the graph.`);const d=l.source.key,p=l.target.key;if(n===d)o=l.target;else if(n===p)o=l.source;else throw new Qe(`Graph.${e}: the "${n}" node is not attached to the "${r}" edge (${d}, ${p}).`);c=s,f=a}else{if(l=i._edges.get(n),!l)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`);t===yR?o=l.source:o=l.target,c=r,f=s}return[o,c,f]}function CV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);return a.attributes[o]}}function RV(i,e,t){i.prototype[e]=function(n,r){const[s]=Ca(this,e,t,n,r);return s.attributes}}function DV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);return a.attributes.hasOwnProperty(o)}}function UV(i,e,t){i.prototype[e]=function(n,r,s,a){const[o,l,c]=Ca(this,e,t,n,r,s,a);return o.attributes[l]=c,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:l}),this}}function OV(i,e,t){i.prototype[e]=function(n,r,s,a){const[o,l,c]=Ca(this,e,t,n,r,s,a);if(typeof c!="function")throw new ct(`Graph.${e}: updater should be a function.`);const f=o.attributes,d=c(f[l]);return f[l]=d,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:l}),this}}function LV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);return delete a.attributes[o],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:o}),this}}function NV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);if(!vi(o))throw new ct(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=o,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function IV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);if(!vi(o))throw new ct(`Graph.${e}: provided attributes are not a plain object.`);return ii(a.attributes,o),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:o}),this}}function PV(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ca(this,e,t,n,r,s);if(typeof o!="function")throw new ct(`Graph.${e}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const zV=[{name:i=>`get${i}Attribute`,attacher:CV},{name:i=>`get${i}Attributes`,attacher:RV},{name:i=>`has${i}Attribute`,attacher:DV},{name:i=>`set${i}Attribute`,attacher:UV},{name:i=>`update${i}Attribute`,attacher:OV},{name:i=>`remove${i}Attribute`,attacher:LV},{name:i=>`replace${i}Attributes`,attacher:NV},{name:i=>`merge${i}Attributes`,attacher:IV},{name:i=>`update${i}Attributes`,attacher:PV}];function FV(i){zV.forEach(function({name:e,attacher:t}){t(i,e("Node"),vR),t(i,e("Source"),yR),t(i,e("Target"),AV),t(i,e("Opposite"),_R)})}function BV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes[r]}}function kV(i,e,t){i.prototype[e]=function(n){let r;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+n,a=""+arguments[1];if(r=Gr(this,s,a,t),!r)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,r=this._edges.get(n),!r)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return r.attributes}}function GV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes.hasOwnProperty(r)}}function HV(i,e,t){i.prototype[e]=function(n,r,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,l=""+r;if(r=arguments[2],s=arguments[3],a=Gr(this,o,l,t),!a)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,a=this._edges.get(n),!a)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return a.attributes[r]=s,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}function VV(i,e,t){i.prototype[e]=function(n,r,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,l=""+r;if(r=arguments[2],s=arguments[3],a=Gr(this,o,l,t),!a)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,a=this._edges.get(n),!a)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof s!="function")throw new ct(`Graph.${e}: updater should be a function.`);return a.attributes[r]=s(a.attributes[r]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}function WV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return delete s.attributes[r],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:r}),this}}function XV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!vi(r))throw new ct(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function jV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!vi(r))throw new ct(`Graph.${e}: provided attributes are not a plain object.`);return ii(s.attributes,r),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:r}),this}}function qV(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=Gr(this,a,o,t),!s)throw new Qe(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new Qe(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof r!="function")throw new ct(`Graph.${e}: provided updater is not a function.`);return s.attributes=r(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const YV=[{name:i=>`get${i}Attribute`,attacher:BV},{name:i=>`get${i}Attributes`,attacher:kV},{name:i=>`has${i}Attribute`,attacher:GV},{name:i=>`set${i}Attribute`,attacher:HV},{name:i=>`update${i}Attribute`,attacher:VV},{name:i=>`remove${i}Attribute`,attacher:WV},{name:i=>`replace${i}Attributes`,attacher:XV},{name:i=>`merge${i}Attributes`,attacher:jV},{name:i=>`update${i}Attributes`,attacher:qV}];function ZV(i){YV.forEach(function({name:e,attacher:t}){t(i,e("Edge"),"mixed"),t(i,e("DirectedEdge"),"directed"),t(i,e("UndirectedEdge"),"undirected")})}const KV=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function JV(i,e,t,n){let r=!1;for(const s in e){if(s===n)continue;const a=e[s];if(r=t(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),i&&r)return a.key}}function QV(i,e,t,n){let r,s,a,o=!1;for(const l in e)if(l!==n){r=e[l];do{if(s=r.source,a=r.target,o=t(r.key,r.attributes,s.key,a.key,s.attributes,a.attributes,r.undirected),i&&o)return r.key;r=r.next}while(r!==void 0)}}function g_(i,e){const t=Object.keys(i),n=t.length;let r,s=0;return{[Symbol.iterator](){return this},next(){do if(r)r=r.next;else{if(s>=n)return{done:!0};const a=t[s++];if(a===e){r=void 0;continue}r=i[a]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}}}}function $V(i,e,t,n){const r=e[t];if(!r)return;const s=r.source,a=r.target;if(n(r.key,r.attributes,s.key,a.key,s.attributes,a.attributes,r.undirected)&&i)return r.key}function e6(i,e,t,n){let r=e[t];if(!r)return;let s=!1;do{if(s=n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),i&&s)return r.key;r=r.next}while(r!==void 0)}function v_(i,e){let t=i[e];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const r={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:r}}};let n=!1;return{[Symbol.iterator](){return this},next(){return n===!0?{done:!0}:(n=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function t6(i,e){if(i.size===0)return[];if(e==="mixed"||e===i.type)return Array.from(i._edges.keys());const t=e==="undirected"?i.undirectedSize:i.directedSize,n=new Array(t),r=e==="undirected",s=i._edges.values();let a=0,o,l;for(;o=s.next(),o.done!==!0;)l=o.value,l.undirected===r&&(n[a++]=l.key);return n}function xR(i,e,t,n){if(e.size===0)return;const r=t!=="mixed"&&t!==e.type,s=t==="undirected";let a,o,l=!1;const c=e._edges.values();for(;a=c.next(),a.done!==!0;){if(o=a.value,r&&o.undirected!==s)continue;const{key:f,attributes:d,source:p,target:m}=o;if(l=n(f,d,p.key,m.key,p.attributes,m.attributes,o.undirected),i&&l)return f}}function n6(i,e){if(i.size===0)return Cu();const t=e!=="mixed"&&e!==i.type,n=e==="undirected",r=i._edges.values();return{[Symbol.iterator](){return this},next(){let s,a;for(;;){if(s=r.next(),s.done)return s;if(a=s.value,!(t&&a.undirected!==n))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}}}}function B1(i,e,t,n,r,s){const a=e?QV:JV;let o;if(t!=="undirected"&&(n!=="out"&&(o=a(i,r.in,s),i&&o)||n!=="in"&&(o=a(i,r.out,s,n?void 0:r.key),i&&o))||t!=="directed"&&(o=a(i,r.undirected,s),i&&o))return o}function i6(i,e,t,n){const r=[];return B1(!1,i,e,t,n,function(s){r.push(s)}),r}function r6(i,e,t){let n=Cu();return i!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(n=ya(n,g_(t.in))),e!=="in"&&typeof t.out<"u"&&(n=ya(n,g_(t.out,e?void 0:t.key)))),i!=="directed"&&typeof t.undirected<"u"&&(n=ya(n,g_(t.undirected))),n}function k1(i,e,t,n,r,s,a){const o=t?e6:$V;let l;if(e!=="undirected"&&(typeof r.in<"u"&&n!=="out"&&(l=o(i,r.in,s,a),i&&l)||typeof r.out<"u"&&n!=="in"&&(n||r.key!==s)&&(l=o(i,r.out,s,a),i&&l))||e!=="directed"&&typeof r.undirected<"u"&&(l=o(i,r.undirected,s,a),i&&l))return l}function s6(i,e,t,n,r){const s=[];return k1(!1,i,e,t,n,r,function(a){s.push(a)}),s}function a6(i,e,t,n){let r=Cu();return i!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&n in t.in&&(r=ya(r,v_(t.in,n))),typeof t.out<"u"&&e!=="in"&&n in t.out&&(e||t.key!==n)&&(r=ya(r,v_(t.out,n)))),i!=="directed"&&typeof t.undirected<"u"&&n in t.undirected&&(r=ya(r,v_(t.undirected,n))),r}function o6(i,e){const{name:t,type:n,direction:r}=e;i.prototype[t]=function(s,a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];if(!arguments.length)return t6(this,n);if(arguments.length===1){s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new Qe(`Graph.${t}: could not find the "${s}" node in the graph.`);return i6(this.multi,n==="mixed"?this.type:n,r,o)}if(arguments.length===2){s=""+s,a=""+a;const o=this._nodes.get(s);if(!o)throw new Qe(`Graph.${t}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(a))throw new Qe(`Graph.${t}: could not find the "${a}" target node in the graph.`);return s6(n,this.multi,r,o,a)}throw new ct(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function l6(i,e){const{name:t,type:n,direction:r}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(c,f,d){if(!(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)){if(arguments.length===1)return d=c,xR(!1,this,n,d);if(arguments.length===2){c=""+c,d=f;const p=this._nodes.get(c);if(typeof p>"u")throw new Qe(`Graph.${s}: could not find the "${c}" node in the graph.`);return B1(!1,this.multi,n==="mixed"?this.type:n,r,p,d)}if(arguments.length===3){c=""+c,f=""+f;const p=this._nodes.get(c);if(!p)throw new Qe(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new Qe(`Graph.${s}: could not find the "${f}" target node in the graph.`);return k1(!1,n,this.multi,r,p,f,d)}throw new ct(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+t[0].toUpperCase()+t.slice(1);i.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();let d;if(c.length===0){let p=0;n!=="directed"&&(p+=this.undirectedSize),n!=="undirected"&&(p+=this.directedSize),d=new Array(p);let m=0;c.push((v,x,_,g,b,S,E)=>{d[m++]=f(v,x,_,g,b,S,E)})}else d=[],c.push((p,m,v,x,_,g,b)=>{d.push(f(p,m,v,x,_,g,b))});return this[s].apply(this,c),d};const o="filter"+t[0].toUpperCase()+t.slice(1);i.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop(),d=[];return c.push((p,m,v,x,_,g,b)=>{f(p,m,v,x,_,g,b)&&d.push(p)}),this[s].apply(this,c),d};const l="reduce"+t[0].toUpperCase()+t.slice(1);i.prototype[l]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new ct(`Graph.${l}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new ct(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f,d;c.length===2?(f=c[0],d=c[1],c=[]):c.length===3?(f=c[1],d=c[2],c=[c[0]]):c.length===4&&(f=c[2],d=c[3],c=[c[0],c[1]]);let p=d;return c.push((m,v,x,_,g,b,S)=>{p=f(p,m,v,x,_,g,b,S)}),this[s].apply(this,c),p}}function c6(i,e){const{name:t,type:n,direction:r}=e,s="find"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(l,c,f){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return!1;if(arguments.length===1)return f=l,xR(!0,this,n,f);if(arguments.length===2){l=""+l,f=c;const d=this._nodes.get(l);if(typeof d>"u")throw new Qe(`Graph.${s}: could not find the "${l}" node in the graph.`);return B1(!0,this.multi,n==="mixed"?this.type:n,r,d,f)}if(arguments.length===3){l=""+l,c=""+c;const d=this._nodes.get(l);if(!d)throw new Qe(`Graph.${s}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(c))throw new Qe(`Graph.${s}: could not find the "${c}" target node in the graph.`);return k1(!0,n,this.multi,r,d,c,f)}throw new ct(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[a]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((d,p,m,v,x,_,g)=>c(d,p,m,v,x,_,g)),!!this[s].apply(this,l)};const o="every"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[o]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((d,p,m,v,x,_,g)=>!c(d,p,m,v,x,_,g)),!this[s].apply(this,l)}}function u6(i,e){const{name:t,type:n,direction:r}=e,s=t.slice(0,-1)+"Entries";i.prototype[s]=function(a,o){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Cu();if(!arguments.length)return n6(this,n);if(arguments.length===1){a=""+a;const l=this._nodes.get(a);if(!l)throw new Qe(`Graph.${s}: could not find the "${a}" node in the graph.`);return r6(n,r,l)}if(arguments.length===2){a=""+a,o=""+o;const l=this._nodes.get(a);if(!l)throw new Qe(`Graph.${s}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new Qe(`Graph.${s}: could not find the "${o}" target node in the graph.`);return a6(n,r,l,o)}throw new ct(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function h6(i){KV.forEach(e=>{o6(i,e),l6(i,e),c6(i,e),u6(i,e)})}const f6=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function u0(){this.A=null,this.B=null}u0.prototype.wrap=function(i){this.A===null?this.A=i:this.B===null&&(this.B=i)};u0.prototype.has=function(i){return this.A!==null&&i in this.A||this.B!==null&&i in this.B};function Rh(i,e,t,n,r){for(const s in n){const a=n[s],o=a.source,l=a.target,c=o===t?l:o;if(e&&e.has(c.key))continue;const f=r(c.key,c.attributes);if(i&&f)return c.key}}function G1(i,e,t,n,r){if(e!=="mixed"){if(e==="undirected")return Rh(i,null,n,n.undirected,r);if(typeof t=="string")return Rh(i,null,n,n[t],r)}const s=new u0;let a;if(e!=="undirected"){if(t!=="out"){if(a=Rh(i,null,n,n.in,r),i&&a)return a;s.wrap(n.in)}if(t!=="in"){if(a=Rh(i,s,n,n.out,r),i&&a)return a;s.wrap(n.out)}}if(e!=="directed"&&(a=Rh(i,s,n,n.undirected,r),i&&a))return a}function d6(i,e,t){if(i!=="mixed"){if(i==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const n=[];return G1(!1,i,e,t,function(r){n.push(r)}),n}function Dh(i,e,t){const n=Object.keys(t),r=n.length;let s=0;return{[Symbol.iterator](){return this},next(){let a=null;do{if(s>=r)return i&&i.wrap(t),{done:!0};const o=t[n[s++]],l=o.source,c=o.target;if(a=l===e?c:l,i&&i.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}}}function p6(i,e,t){if(i!=="mixed"){if(i==="undirected")return Dh(null,t,t.undirected);if(typeof e=="string")return Dh(null,t,t[e])}let n=Cu();const r=new u0;return i!=="undirected"&&(e!=="out"&&(n=ya(n,Dh(r,t,t.in))),e!=="in"&&(n=ya(n,Dh(r,t,t.out)))),i!=="directed"&&(n=ya(n,Dh(r,t,t.undirected))),n}function m6(i,e){const{name:t,type:n,direction:r}=e;i.prototype[t]=function(s){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new Qe(`Graph.${t}: could not find the "${s}" node in the graph.`);return d6(n==="mixed"?this.type:n,r,a)}}function g6(i,e){const{name:t,type:n,direction:r}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(c,f){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new Qe(`Graph.${s}: could not find the "${c}" node in the graph.`);G1(!1,n==="mixed"?this.type:n,r,d,f)};const a="map"+t[0].toUpperCase()+t.slice(1);i.prototype[a]=function(c,f){const d=[];return this[s](c,(p,m)=>{d.push(f(p,m))}),d};const o="filter"+t[0].toUpperCase()+t.slice(1);i.prototype[o]=function(c,f){const d=[];return this[s](c,(p,m)=>{f(p,m)&&d.push(p)}),d};const l="reduce"+t[0].toUpperCase()+t.slice(1);i.prototype[l]=function(c,f,d){if(arguments.length<3)throw new ct(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p=d;return this[s](c,(m,v)=>{p=f(p,m,v)}),p}}function v6(i,e){const{name:t,type:n,direction:r}=e,s=t[0].toUpperCase()+t.slice(1,-1),a="find"+s;i.prototype[a]=function(c,f){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new Qe(`Graph.${a}: could not find the "${c}" node in the graph.`);return G1(!0,n==="mixed"?this.type:n,r,d,f)};const o="some"+s;i.prototype[o]=function(c,f){return!!this[a](c,f)};const l="every"+s;i.prototype[l]=function(c,f){return!this[a](c,(p,m)=>!f(p,m))}}function y6(i,e){const{name:t,type:n,direction:r}=e,s=t.slice(0,-1)+"Entries";i.prototype[s]=function(a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Cu();a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new Qe(`Graph.${s}: could not find the "${a}" node in the graph.`);return p6(n==="mixed"?this.type:n,r,o)}}function _6(i){f6.forEach(e=>{m6(i,e),g6(i,e),v6(i,e),y6(i,e)})}function Vp(i,e,t,n,r){const s=n._nodes.values(),a=n.type;let o,l,c,f,d,p;for(;o=s.next(),o.done!==!0;){let m=!1;if(l=o.value,a!=="undirected"){f=l.out;for(c in f){d=f[c];do p=d.target,m=!0,r(l.key,p.key,l.attributes,p.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}if(a!=="directed"){f=l.undirected;for(c in f)if(!(e&&l.key>c)){d=f[c];do p=d.target,p.key!==c&&(p=d.source),m=!0,r(l.key,p.key,l.attributes,p.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}t&&!m&&r(l.key,null,l.attributes,null,null,null,null)}}function x6(i,e){const t={key:i};return dR(e.attributes)||(t.attributes=ii({},e.attributes)),t}function b6(i,e,t){const n={key:e,source:t.source.key,target:t.target.key};return dR(t.attributes)||(n.attributes=ii({},t.attributes)),i==="mixed"&&t.undirected&&(n.undirected=!0),n}function S6(i){if(!vi(i))throw new ct('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in i))throw new ct("Graph.import: serialized node is missing its key.");if("attributes"in i&&(!vi(i.attributes)||i.attributes===null))throw new ct("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function E6(i){if(!vi(i))throw new ct('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in i))throw new ct("Graph.import: serialized edge is missing its source.");if(!("target"in i))throw new ct("Graph.import: serialized edge is missing its target.");if("attributes"in i&&(!vi(i.attributes)||i.attributes===null))throw new ct("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in i&&typeof i.undirected!="boolean")throw new ct("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const M6=TV(),w6=new Set(["directed","undirected","mixed"]),rT=new Set(["domain","_events","_eventsCount","_maxListeners"]),T6=[{name:i=>`${i}Edge`,generateKey:!0},{name:i=>`${i}DirectedEdge`,generateKey:!0,type:"directed"},{name:i=>`${i}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:i=>`${i}EdgeWithKey`},{name:i=>`${i}DirectedEdgeWithKey`,type:"directed"},{name:i=>`${i}UndirectedEdgeWithKey`,type:"undirected"}],A6={allowSelfLoops:!0,multi:!1,type:"mixed"};function C6(i,e,t){if(t&&!vi(t))throw new ct(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},i._nodes.has(e))throw new xt(`Graph.addNode: the "${e}" node already exist in the graph.`);const n=new i.NodeDataClass(e,t);return i._nodes.set(e,n),i.emit("nodeAdded",{key:e,attributes:t}),n}function sT(i,e,t){const n=new i.NodeDataClass(e,t);return i._nodes.set(e,n),i.emit("nodeAdded",{key:e,attributes:t}),n}function bR(i,e,t,n,r,s,a,o){if(!n&&i.type==="undirected")throw new xt(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(n&&i.type==="directed")throw new xt(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(o&&!vi(o))throw new ct(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`);if(s=""+s,a=""+a,o=o||{},!i.allowSelfLoops&&s===a)throw new xt(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const l=i._nodes.get(s),c=i._nodes.get(a);if(!l)throw new Qe(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new Qe(`Graph.${e}: target node "${a}" not found.`);const f={key:null,undirected:n,source:s,target:a,attributes:o};if(t)r=i._edgeKeyGenerator();else if(r=""+r,i._edges.has(r))throw new xt(`Graph.${e}: the "${r}" edge already exists in the graph.`);if(!i.multi&&(n?typeof l.undirected[a]<"u":typeof l.out[a]<"u"))throw new xt(`Graph.${e}: an edge linking "${s}" to "${a}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const d=new Ru(n,r,l,c,o);i._edges.set(r,d);const p=s===a;return n?(l.undirectedDegree++,c.undirectedDegree++,p&&(l.undirectedLoops++,i._undirectedSelfLoopCount++)):(l.outDegree++,c.inDegree++,p&&(l.directedLoops++,i._directedSelfLoopCount++)),i.multi?d.attachMulti():d.attach(),n?i._undirectedSize++:i._directedSize++,f.key=r,i.emit("edgeAdded",f),r}function R6(i,e,t,n,r,s,a,o,l){if(!n&&i.type==="undirected")throw new xt(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(n&&i.type==="directed")throw new xt(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(o){if(l){if(typeof o!="function")throw new ct(`Graph.${e}: invalid updater function. Expecting a function but got "${o}"`)}else if(!vi(o))throw new ct(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`)}s=""+s,a=""+a;let c;if(l&&(c=o,o=void 0),!i.allowSelfLoops&&s===a)throw new xt(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let f=i._nodes.get(s),d=i._nodes.get(a),p,m;if(!t&&(p=i._edges.get(r),p)){if((p.source.key!==s||p.target.key!==a)&&(!n||p.source.key!==a||p.target.key!==s))throw new xt(`Graph.${e}: inconsistency detected when attempting to merge the "${r}" edge with "${s}" source & "${a}" target vs. ("${p.source.key}", "${p.target.key}").`);m=p}if(!m&&!i.multi&&f&&(m=n?f.undirected[a]:f.out[a]),m){const b=[m.key,!1,!1,!1];if(l?!c:!o)return b;if(l){const S=m.attributes;m.attributes=c(S),i.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else ii(m.attributes,o),i.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:o});return b}o=o||{},l&&c&&(o=c(o));const v={key:null,undirected:n,source:s,target:a,attributes:o};if(t)r=i._edgeKeyGenerator();else if(r=""+r,i._edges.has(r))throw new xt(`Graph.${e}: the "${r}" edge already exists in the graph.`);let x=!1,_=!1;f||(f=sT(i,s,{}),x=!0,s===a&&(d=f,_=!0)),d||(d=sT(i,a,{}),_=!0),p=new Ru(n,r,f,d,o),i._edges.set(r,p);const g=s===a;return n?(f.undirectedDegree++,d.undirectedDegree++,g&&(f.undirectedLoops++,i._undirectedSelfLoopCount++)):(f.outDegree++,d.inDegree++,g&&(f.directedLoops++,i._directedSelfLoopCount++)),i.multi?p.attachMulti():p.attach(),n?i._undirectedSize++:i._directedSize++,v.key=r,i.emit("edgeAdded",v),[r,!0,x,_]}function kc(i,e){i._edges.delete(e.key);const{source:t,target:n,attributes:r}=e,s=e.undirected,a=t===n;s?(t.undirectedDegree--,n.undirectedDegree--,a&&(t.undirectedLoops--,i._undirectedSelfLoopCount--)):(t.outDegree--,n.inDegree--,a&&(t.directedLoops--,i._directedSelfLoopCount--)),i.multi?e.detachMulti():e.detach(),s?i._undirectedSize--:i._directedSize--,i.emit("edgeDropped",{key:e.key,attributes:r,source:t.key,target:n.key,undirected:s})}class cn extends MV.EventEmitter{constructor(e){if(super(),e=ii({},A6,e),typeof e.multi!="boolean")throw new ct(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!w6.has(e.type))throw new ct(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new ct(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?pR:e.type==="directed"?mR:gR;Or(this,"NodeDataClass",t);const n="geid_"+M6()+"_";let r=0;const s=()=>{let a;do a=n+r++;while(this._edges.has(a));return a};Or(this,"_attributes",{}),Or(this,"_nodes",new Map),Or(this,"_edges",new Map),Or(this,"_directedSize",0),Or(this,"_undirectedSize",0),Or(this,"_directedSelfLoopCount",0),Or(this,"_undirectedSelfLoopCount",0),Or(this,"_edgeKeyGenerator",s),Or(this,"_options",e),rT.forEach(a=>Or(this,a,this[a])),es(this,"order",()=>this._nodes.size),es(this,"size",()=>this._edges.size),es(this,"directedSize",()=>this._directedSize),es(this,"undirectedSize",()=>this._undirectedSize),es(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),es(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),es(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),es(this,"multi",this._options.multi),es(this,"type",this._options.type),es(this,"allowSelfLoops",this._options.allowSelfLoops),es(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const n=""+e,r=this._edges.get(n);return!!r&&!r.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new ct(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const n=""+e,r=this._edges.get(n);return!!r&&r.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new ct(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const n=""+e;return this._edges.has(n)}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?typeof n.out<"u"&&n.out.hasOwnProperty(t)||typeof n.undirected<"u"&&n.undirected.hasOwnProperty(t):!1}throw new ct(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new xt("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new Qe(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new xt("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new Qe(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new xt("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new Qe(`Graph.edge: could not find the "${t}" target node in the graph.`);const r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.out}areInNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in n.undirected}areNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in n.in||t in n.out)||this.type!=="directed"&&t in n.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.in||this.type!=="directed"&&t in n.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new Qe(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.out||this.type!=="directed"&&t in n.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree),n}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.outDegree),n}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const n=this._edges.get(t);if(!n)throw new Qe(`Graph.opposite: could not find the "${t}" edge in the graph.`);const r=n.source.key,s=n.target.key;if(e===r)return s;if(e===s)return r;throw new Qe(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${s}).`)}hasExtremity(e,t){e=""+e,t=""+t;const n=this._edges.get(e);if(!n)throw new Qe(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new Qe(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return C6(this,e,t).key}mergeNode(e,t){if(t&&!vi(t))throw new ct(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let n=this._nodes.get(e);return n?(t&&(ii(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new ct(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let n=this._nodes.get(e);if(n){if(t){const s=n.attributes;n.attributes=t(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}const r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new Qe(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!=="undirected"){for(const r in t.out){n=t.out[r];do kc(this,n),n=n.next;while(n)}for(const r in t.in){n=t.in[r];do kc(this,n),n=n.next;while(n)}}if(this.type!=="directed")for(const r in t.undirected){n=t.undirected[r];do kc(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const n=""+arguments[0],r=""+arguments[1];if(t=Gr(this,n,r,this.type),!t)throw new Qe(`Graph.dropEdge: could not find the "${n}" -> "${r}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new Qe(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return kc(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new xt("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new xt("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const n=Gr(this,e,t,"directed");if(!n)throw new Qe(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return kc(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new xt("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new xt("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const n=Gr(this,e,t,"undirected");if(!n)throw new Qe(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return kc(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new ct("Graph.updateAttribute: updater should be a function.");const n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!vi(e))throw new ct("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!vi(e))throw new ct("Graph.mergeAttributes: provided attributes are not a plain object.");return ii(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new ct("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new ct("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!iT(t))throw new ct("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._nodes.values();let r,s;for(;r=n.next(),r.done!==!0;)s=r.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new ct("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!iT(t))throw new ct("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._edges.values();let r,s,a,o;for(;r=n.next(),r.done!==!0;)s=r.value,a=s.source,o=s.target,s.attributes=e(s.key,s.attributes,a.key,o.key,a.attributes,o.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new ct("Graph.forEachAdjacencyEntry: expecting a callback.");Vp(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ct("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Vp(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new ct("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Vp(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ct("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Vp(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new ct("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!="function")throw new ct("Graph.findNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!="function")throw new ct("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let n,r;const s=new Array(this.order);let a=0;for(;n=t.next(),n.done!==!0;)r=n.value,s[a++]=e(r.key,r.attributes);return s}someNode(e){if(typeof e!="function")throw new ct("Graph.someNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new ct("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new ct("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let n,r;const s=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&s.push(r.key);return s}reduceNodes(e,t){if(typeof e!="function")throw new ct("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new ct("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let n=t;const r=this._nodes.values();let s,a;for(;s=r.next(),s.done!==!0;)a=s.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((r,s)=>{e[t++]=x6(s,r)});const n=new Array(this._edges.size);return t=0,this._edges.forEach((r,s)=>{n[t++]=b6(this.type,s,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(e,t=!1){if(e instanceof cn)return e.forEachNode((l,c)=>{t?this.mergeNode(l,c):this.addNode(l,c)}),e.forEachEdge((l,c,f,d,p,m,v)=>{t?v?this.mergeUndirectedEdgeWithKey(l,f,d,c):this.mergeDirectedEdgeWithKey(l,f,d,c):v?this.addUndirectedEdgeWithKey(l,f,d,c):this.addDirectedEdgeWithKey(l,f,d,c)}),this;if(!vi(e))throw new ct("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!vi(e.attributes))throw new ct("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let n,r,s,a,o;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new ct("Graph.import: invalid nodes. Expecting an array.");for(n=0,r=s.length;n<r;n++){a=s[n],S6(a);const{key:l,attributes:c}=a;t?this.mergeNode(l,c):this.addNode(l,c)}}if(e.edges){let l=!1;if(this.type==="undirected"&&(l=!0),s=e.edges,!Array.isArray(s))throw new ct("Graph.import: invalid edges. Expecting an array.");for(n=0,r=s.length;n<r;n++){o=s[n],E6(o);const{source:c,target:f,attributes:d,undirected:p=l}=o;let m;"key"in o?(m=t?p?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:p?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,m.call(this,o.key,c,f,d)):(m=t?p?this.mergeUndirectedEdge:this.mergeDirectedEdge:p?this.addUndirectedEdge:this.addDirectedEdge,m.call(this,c,f,d))}}return this}nullCopy(e){const t=new cn(ii({},this._options,e));return t.replaceAttributes(ii({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((n,r)=>{const s=ii({},n.attributes);n=new t.NodeDataClass(r,s),t._nodes.set(r,n)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new xt(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new xt("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new xt("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),n=this._edges.values();let r,s;for(;r=n.next(),r.done!==!0;)s=r.value,bR(t,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,ii({},s.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,a)=>{e[a]=s.attributes});const t={},n={};this._edges.forEach((s,a)=>{const o=s.undirected?"--":"->";let l="",c=s.source.key,f=s.target.key,d;s.undirected&&c>f&&(d=c,c=f,f=d);const p=`(${c})${o}(${f})`;a.startsWith("geid_")?this.multi&&(typeof n[p]>"u"?n[p]=0:n[p]++,l+=`${n[p]}. `):l+=`[${a}]: `,l+=p,t[l]=s.attributes});const r={};for(const s in this)this.hasOwnProperty(s)&&!rT.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,Or(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(cn.prototype[Symbol.for("nodejs.util.inspect.custom")]=cn.prototype.inspect);T6.forEach(i=>{["add","merge","update"].forEach(e=>{const t=i.name(e),n=e==="add"?bR:R6;i.generateKey?cn.prototype[t]=function(r,s,a){return n(this,t,!0,(i.type||this.type)==="undirected",null,r,s,a,e==="update")}:cn.prototype[t]=function(r,s,a,o){return n(this,t,!1,(i.type||this.type)==="undirected",r,s,a,o,e==="update")}})});FV(cn);ZV(cn);h6(cn);_6(cn);class SR extends cn{constructor(e){const t=ii({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new ct("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new ct('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class ER extends cn{constructor(e){const t=ii({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new ct("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new ct('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class MR extends cn{constructor(e){const t=ii({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ct("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class wR extends cn{constructor(e){const t=ii({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ct("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new ct('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class TR extends cn{constructor(e){const t=ii({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ct("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new ct('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Du(i){i.from=function(e,t){const n=ii({},e.options,t),r=new i(n);return r.import(e),r}}Du(cn);Du(SR);Du(ER);Du(MR);Du(wR);Du(TR);cn.Graph=cn;cn.DirectedGraph=SR;cn.UndirectedGraph=ER;cn.MultiGraph=MR;cn.MultiDirectedGraph=wR;cn.MultiUndirectedGraph=TR;cn.InvalidArgumentsGraphError=ct;cn.NotFoundGraphError=Qe;cn.UsageGraphError=xt;var H1=sd(),At=i=>rd(i,H1),V1=sd();At.write=i=>rd(i,V1);var h0=sd();At.onStart=i=>rd(i,h0);var W1=sd();At.onFrame=i=>rd(i,W1);var X1=sd();At.onFinish=i=>rd(i,X1);var su=[];At.setTimeout=(i,e)=>{const t=At.now()+e,n=()=>{const s=su.findIndex(a=>a.cancel==n);~s&&su.splice(s,1),co-=~s?1:0},r={time:t,handler:i,cancel:n};return su.splice(AR(t),0,r),co+=1,CR(),r};var AR=i=>~(~su.findIndex(e=>e.time>i)||~su.length);At.cancel=i=>{h0.delete(i),W1.delete(i),X1.delete(i),H1.delete(i),V1.delete(i)};At.sync=i=>{gx=!0,At.batchedUpdates(i),gx=!1};At.throttle=i=>{let e;function t(){try{i(...e)}finally{e=null}}function n(...r){e=r,At.onStart(t)}return n.handler=i,n.cancel=()=>{h0.delete(t),e=null},n};var j1=typeof window<"u"?window.requestAnimationFrame:()=>{};At.use=i=>j1=i;At.now=typeof performance<"u"?()=>performance.now():Date.now;At.batchedUpdates=i=>i();At.catch=console.error;At.frameLoop="always";At.advance=()=>{At.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):DR()};var lo=-1,co=0,gx=!1;function rd(i,e){gx?(e.delete(i),i(0)):(e.add(i),CR())}function CR(){lo<0&&(lo=0,At.frameLoop!=="demand"&&j1(RR))}function D6(){lo=-1}function RR(){~lo&&(j1(RR),At.batchedUpdates(DR))}function DR(){const i=lo;lo=At.now();const e=AR(lo);if(e&&(UR(su.splice(0,e),t=>t.handler()),co-=e),!co){D6();return}h0.flush(),H1.flush(i?Math.min(64,lo-i):16.667),W1.flush(),V1.flush(),X1.flush()}function sd(){let i=new Set,e=i;return{add(t){co+=e==i&&!i.has(t)?1:0,i.add(t)},delete(t){return co-=e==i&&i.has(t)?1:0,i.delete(t)},flush(t){e.size&&(i=new Set,co-=e.size,UR(e,n=>n(t)&&i.add(n)),co+=i.size,e=i)}}}function UR(i,e){i.forEach(t=>{try{e(t)}catch(n){At.catch(n)}})}var U6=Object.defineProperty,O6=(i,e)=>{for(var t in e)U6(i,t,{get:e[t],enumerable:!0})},cs={};O6(cs,{assign:()=>N6,colors:()=>fo,createStringInterpolator:()=>Y1,skipAnimation:()=>LR,to:()=>OR,willAdvance:()=>Z1});function vx(){}var L6=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),tt={arr:Array.isArray,obj:i=>!!i&&i.constructor.name==="Object",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",und:i=>i===void 0};function ca(i,e){if(tt.arr(i)){if(!tt.arr(e)||i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}return i===e}var en=(i,e)=>i.forEach(e);function Ea(i,e,t){if(tt.arr(i)){for(let n=0;n<i.length;n++)e.call(t,i[n],`${n}`);return}for(const n in i)i.hasOwnProperty(n)&&e.call(t,i[n],n)}var kr=i=>tt.und(i)?[]:tt.arr(i)?i:[i];function hf(i,e){if(i.size){const t=Array.from(i);i.clear(),en(t,e)}}var Jh=(i,...e)=>hf(i,t=>t(...e)),q1=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Y1,OR,fo=null,LR=!1,Z1=vx,N6=i=>{i.to&&(OR=i.to),i.now&&(At.now=i.now),i.colors!==void 0&&(fo=i.colors),i.skipAnimation!=null&&(LR=i.skipAnimation),i.createStringInterpolator&&(Y1=i.createStringInterpolator),i.requestAnimationFrame&&At.use(i.requestAnimationFrame),i.batchedUpdates&&(At.batchedUpdates=i.batchedUpdates),i.willAdvance&&(Z1=i.willAdvance),i.frameLoop&&(At.frameLoop=i.frameLoop)},ff=new Set,zr=[],y_=[],pg=0,f0={get idle(){return!ff.size&&!zr.length},start(i){pg>i.priority?(ff.add(i),At.onStart(I6)):(NR(i),At(yx))},advance:yx,sort(i){if(pg)At.onFrame(()=>f0.sort(i));else{const e=zr.indexOf(i);~e&&(zr.splice(e,1),IR(i))}},clear(){zr=[],ff.clear()}};function I6(){ff.forEach(NR),ff.clear(),At(yx)}function NR(i){zr.includes(i)||IR(i)}function IR(i){zr.splice(P6(zr,e=>e.priority>i.priority),0,i)}function yx(i){const e=y_;for(let t=0;t<zr.length;t++){const n=zr[t];pg=n.priority,n.idle||(Z1(n),n.advance(i),n.idle||e.push(n))}return pg=0,y_=zr,y_.length=0,zr=e,zr.length>0}function P6(i,e){const t=i.findIndex(e);return t<0?i.length:t}var z6={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},ls="[-+]?\\d*\\.?\\d+",mg=ls+"%";function d0(...i){return"\\(\\s*("+i.join(")\\s*,\\s*(")+")\\s*\\)"}var F6=new RegExp("rgb"+d0(ls,ls,ls)),B6=new RegExp("rgba"+d0(ls,ls,ls,ls)),k6=new RegExp("hsl"+d0(ls,mg,mg)),G6=new RegExp("hsla"+d0(ls,mg,mg,ls)),H6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,V6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,W6=/^#([0-9a-fA-F]{6})$/,X6=/^#([0-9a-fA-F]{8})$/;function j6(i){let e;return typeof i=="number"?i>>>0===i&&i>=0&&i<=4294967295?i:null:(e=W6.exec(i))?parseInt(e[1]+"ff",16)>>>0:fo&&fo[i]!==void 0?fo[i]:(e=F6.exec(i))?(Gc(e[1])<<24|Gc(e[2])<<16|Gc(e[3])<<8|255)>>>0:(e=B6.exec(i))?(Gc(e[1])<<24|Gc(e[2])<<16|Gc(e[3])<<8|lT(e[4]))>>>0:(e=H6.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=X6.exec(i))?parseInt(e[1],16)>>>0:(e=V6.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=k6.exec(i))?(aT(oT(e[1]),Wp(e[2]),Wp(e[3]))|255)>>>0:(e=G6.exec(i))?(aT(oT(e[1]),Wp(e[2]),Wp(e[3]))|lT(e[4]))>>>0:null}function __(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function aT(i,e,t){const n=t<.5?t*(1+e):t+e-t*e,r=2*t-n,s=__(r,n,i+1/3),a=__(r,n,i),o=__(r,n,i-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function Gc(i){const e=parseInt(i,10);return e<0?0:e>255?255:e}function oT(i){return(parseFloat(i)%360+360)%360/360}function lT(i){const e=parseFloat(i);return e<0?0:e>1?255:Math.round(e*255)}function Wp(i){const e=parseFloat(i);return e<0?0:e>100?1:e/100}function cT(i){let e=j6(i);if(e===null)return i;e=e||0;const t=(e&4278190080)>>>24,n=(e&16711680)>>>16,r=(e&65280)>>>8,s=(e&255)/255;return`rgba(${t}, ${n}, ${r}, ${s})`}var Bf=(i,e,t)=>{if(tt.fun(i))return i;if(tt.arr(i))return Bf({range:i,output:e,extrapolate:t});if(tt.str(i.output[0]))return Y1(i);const n=i,r=n.output,s=n.range||[0,1],a=n.extrapolateLeft||n.extrapolate||"extend",o=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(c=>c);return c=>{const f=Y6(c,s);return q6(c,s[f],s[f+1],r[f],r[f+1],l,a,o,n.map)}};function q6(i,e,t,n,r,s,a,o,l){let c=l?l(i):i;if(c<e){if(a==="identity")return c;a==="clamp"&&(c=e)}if(c>t){if(o==="identity")return c;o==="clamp"&&(c=t)}return n===r?n:e===t?i<=e?n:r:(e===-1/0?c=-c:t===1/0?c=c-e:c=(c-e)/(t-e),c=s(c),n===-1/0?c=-c:r===1/0?c=c+n:c=c*(r-n)+n,c)}function Y6(i,e){for(var t=1;t<e.length-1&&!(e[t]>=i);++t);return t-1}var Z6={linear:i=>i},kf=Symbol.for("FluidValue.get"),_u=Symbol.for("FluidValue.observers"),ws=i=>!!(i&&i[kf]),Nr=i=>i&&i[kf]?i[kf]():i,uT=i=>i[_u]||null;function K6(i,e){i.eventObserved?i.eventObserved(e):i(e)}function gg(i,e){const t=i[_u];t&&t.forEach(n=>{K6(n,e)})}var J6=class{constructor(i){if(!i&&!(i=this.get))throw Error("Unknown getter");Q6(this,i)}},Q6=(i,e)=>PR(i,kf,e);function ad(i,e){if(i[kf]){let t=i[_u];t||PR(i,_u,t=new Set),t.has(e)||(t.add(e),i.observerAdded&&i.observerAdded(t.size,e))}return e}function vg(i,e){const t=i[_u];if(t&&t.has(e)){const n=t.size-1;n?t.delete(e):i[_u]=null,i.observerRemoved&&i.observerRemoved(n,e)}}var PR=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),hm=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,$6=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,hT=new RegExp(`(${hm.source})(%|[a-z]+)`,"i"),e8=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,p0=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,zR=i=>{const[e,t]=t8(i);if(!e||q1())return i;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(n)return n.trim();if(t&&t.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r||i}else{if(t&&p0.test(t))return zR(t);if(t)return t}return i},t8=i=>{const e=p0.exec(i);if(!e)return[,];const[,t,n]=e;return[t,n]},x_,n8=(i,e,t,n,r)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${r})`,FR=i=>{x_||(x_=fo?new RegExp(`(${Object.keys(fo).join("|")})(?!\\w)`,"g"):/^\b$/);const e=i.output.map(s=>Nr(s).replace(p0,zR).replace($6,cT).replace(x_,cT)),t=e.map(s=>s.match(hm).map(Number)),r=t[0].map((s,a)=>t.map(o=>{if(!(a in o))throw Error('The arity of each "output" value must be equal');return o[a]})).map(s=>Bf({...i,output:s}));return s=>{const a=!hT.test(e[0])&&e.find(l=>hT.test(l))?.replace(hm,"");let o=0;return e[0].replace(hm,()=>`${r[o++](s)}${a||""}`).replace(e8,n8)}},K1="react-spring: ",BR=i=>{const e=i;let t=!1;if(typeof e!="function")throw new TypeError(`${K1}once requires a function parameter`);return(...n)=>{t||(e(...n),t=!0)}},i8=BR(console.warn);function r8(){i8(`${K1}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var s8=BR(console.warn);function a8(){s8(`${K1}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function m0(i){return tt.str(i)&&(i[0]=="#"||/\d/.test(i)||!q1()&&p0.test(i)||i in(fo||{}))}var J1=q1()?Z.useEffect:Z.useLayoutEffect,o8=()=>{const i=Z.useRef(!1);return J1(()=>(i.current=!0,()=>{i.current=!1}),[]),i};function kR(){const i=Z.useState()[1],e=o8();return()=>{e.current&&i(Math.random())}}var GR=i=>Z.useEffect(i,l8),l8=[];function fT(i){const e=Z.useRef(void 0);return Z.useEffect(()=>{e.current=i}),e.current}var Gf=Symbol.for("Animated:node"),c8=i=>!!i&&i[Gf]===i,Ms=i=>i&&i[Gf],Q1=(i,e)=>L6(i,Gf,e),g0=i=>i&&i[Gf]&&i[Gf].getPayload(),HR=class{constructor(){Q1(this,this)}getPayload(){return this.payload||[]}},v0=class VR extends HR{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,tt.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new VR(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return tt.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,tt.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},yg=class WR extends v0{constructor(e){super(0),this._string=null,this._toString=Bf({output:[e,e]})}static create(e){return new WR(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(tt.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Bf({output:[this.getValue(),e]})),this._value=0,super.reset()}},_g={dependencies:null},$1=class extends HR{constructor(i){super(),this.source=i,this.setValue(i)}getValue(i){const e={};return Ea(this.source,(t,n)=>{c8(t)?e[n]=t.getValue(i):ws(t)?e[n]=Nr(t):i||(e[n]=t)}),e}setValue(i){this.source=i,this.payload=this._makePayload(i)}reset(){this.payload&&en(this.payload,i=>i.reset())}_makePayload(i){if(i){const e=new Set;return Ea(i,this._addToPayload,e),Array.from(e)}}_addToPayload(i){_g.dependencies&&ws(i)&&_g.dependencies.add(i);const e=g0(i);e&&en(e,t=>this.add(t))}},u8=class XR extends $1{constructor(e){super(e)}static create(e){return new XR(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(h8)),!0)}};function h8(i){return(m0(i)?yg:v0).create(i)}function _x(i){const e=Ms(i);return e?e.constructor:tt.arr(i)?u8:m0(i)?yg:v0}var dT=(i,e)=>{const t=!tt.fun(i)||i.prototype&&i.prototype.isReactComponent;return Z.forwardRef((n,r)=>{const s=Z.useRef(null),a=t&&Z.useCallback(v=>{s.current=p8(r,v)},[r]),[o,l]=d8(n,e),c=kR(),f=()=>{const v=s.current;if(t&&!v)return;(v?e.applyAnimatedValues(v,o.getValue(!0)):!1)===!1&&c()},d=new f8(f,l),p=Z.useRef(void 0);J1(()=>(p.current=d,en(l,v=>ad(v,d)),()=>{p.current&&(en(p.current.deps,v=>vg(v,p.current)),At.cancel(p.current.update))})),Z.useEffect(f,[]),GR(()=>()=>{const v=p.current;en(v.deps,x=>vg(x,v))});const m=e.getComponentProps(o.getValue());return Z.createElement(i,{...m,ref:a})})},f8=class{constructor(i,e){this.update=i,this.deps=e}eventObserved(i){i.type=="change"&&At.write(this.update)}};function d8(i,e){const t=new Set;return _g.dependencies=t,i.style&&(i={...i,style:e.createAnimatedStyle(i.style)}),i=new $1(i),_g.dependencies=null,[i,t]}function p8(i,e){return i&&(tt.fun(i)?i(e):i.current=e),e}var pT=Symbol.for("AnimatedComponent"),m8=(i,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=r=>new $1(r),getComponentProps:n=r=>r}={})=>{const r={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:n},s=a=>{const o=mT(a)||"Anonymous";return tt.str(a)?a=s[a]||(s[a]=dT(a,r)):a=a[pT]||(a[pT]=dT(a,r)),a.displayName=`Animated(${o})`,a};return Ea(i,(a,o)=>{tt.arr(i)&&(o=mT(a)),s[o]=s(a)}),{animated:s}},mT=i=>tt.str(i)?i:i&&tt.str(i.displayName)?i.displayName:tt.fun(i)&&i.name||null;function gl(i,...e){return tt.fun(i)?i(...e):i}var df=(i,e)=>i===!0||!!(e&&i&&(tt.fun(i)?i(e):kr(i).includes(e))),jR=(i,e)=>tt.obj(i)?e&&i[e]:i,qR=(i,e)=>i.default===!0?i[e]:i.default?i.default[e]:void 0,g8=i=>i,eb=(i,e=g8)=>{let t=v8;i.default&&i.default!==!0&&(i=i.default,t=Object.keys(i));const n={};for(const r of t){const s=e(i[r],r);tt.und(s)||(n[r]=s)}return n},v8=["config","onProps","onStart","onChange","onPause","onResume","onRest"],y8={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function _8(i){const e={};let t=0;if(Ea(i,(n,r)=>{y8[r]||(e[r]=n,t++)}),t)return e}function YR(i){const e=_8(i);if(e){const t={to:e};return Ea(i,(n,r)=>r in e||(t[r]=n)),t}return{...i}}function Hf(i){return i=Nr(i),tt.arr(i)?i.map(Hf):m0(i)?cs.createStringInterpolator({range:[0,1],output:[i,i]})(1):i}function x8(i){for(const e in i)return!0;return!1}function xx(i){return tt.fun(i)||tt.arr(i)&&tt.obj(i[0])}function b8(i,e){i.ref?.delete(i),e?.delete(i)}function S8(i,e){e&&i.ref!==e&&(i.ref?.delete(i),e.add(i),i.ref=e)}var E8={default:{tension:170,friction:26}},bx={...E8.default,mass:1,damping:1,easing:Z6.linear,clamp:!1},M8=class{constructor(){this.velocity=0,Object.assign(this,bx)}};function w8(i,e,t){t&&(t={...t},gT(t,e),e={...t,...e}),gT(i,e),Object.assign(i,e);for(const a in bx)i[a]==null&&(i[a]=bx[a]);let{frequency:n,damping:r}=i;const{mass:s}=i;return tt.und(n)||(n<.01&&(n=.01),r<0&&(r=0),i.tension=Math.pow(2*Math.PI/n,2)*s,i.friction=4*Math.PI*r*s/n),i}function gT(i,e){if(!tt.und(e.decay))i.duration=void 0;else{const t=!tt.und(e.tension)||!tt.und(e.friction);(t||!tt.und(e.frequency)||!tt.und(e.damping)||!tt.und(e.mass))&&(i.duration=void 0,i.decay=void 0),t&&(i.frequency=void 0)}}var vT=[],T8=class{constructor(){this.changed=!1,this.values=vT,this.toValues=null,this.fromValues=vT,this.config=new M8,this.immediate=!1}};function ZR(i,{key:e,props:t,defaultProps:n,state:r,actions:s}){return new Promise((a,o)=>{let l,c,f=df(t.cancel??n?.cancel,e);if(f)m();else{tt.und(t.pause)||(r.paused=df(t.pause,e));let v=n?.pause;v!==!0&&(v=r.paused||df(v,e)),l=gl(t.delay||0,e),v?(r.resumeQueue.add(p),s.pause()):(s.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),l=c.time-At.now()}function p(){l>0&&!cs.skipAnimation?(r.delayed=!0,c=At.setTimeout(m,l),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),i<=(r.cancelId||0)&&(f=!0);try{s.start({...t,callId:i,cancel:f},a)}catch(v){o(v)}}})}var tb=(i,e)=>e.length==1?e[0]:e.some(t=>t.cancelled)?au(i.get()):e.every(t=>t.noop)?KR(i.get()):ss(i.get(),e.every(t=>t.finished)),KR=i=>({value:i,noop:!0,finished:!0,cancelled:!1}),ss=(i,e,t=!1)=>({value:i,finished:e,cancelled:t}),au=i=>({value:i,cancelled:!0,finished:!1});function JR(i,e,t,n){const{callId:r,parentId:s,onRest:a}=e,{asyncTo:o,promise:l}=t;return!s&&i===o&&!e.reset?l:t.promise=(async()=>{t.asyncId=r,t.asyncTo=i;const c=eb(e,(_,g)=>g==="onRest"?void 0:_);let f,d;const p=new Promise((_,g)=>(f=_,d=g)),m=_=>{const g=r<=(t.cancelId||0)&&au(n)||r!==t.asyncId&&ss(n,!1);if(g)throw _.result=g,d(_),_},v=(_,g)=>{const b=new yT,S=new _T;return(async()=>{if(cs.skipAnimation)throw Vf(t),S.result=ss(n,!1),d(S),S;m(b);const E=tt.obj(_)?{..._}:{...g,to:_};E.parentId=r,Ea(c,(T,C)=>{tt.und(E[C])&&(E[C]=T)});const w=await n.start(E);return m(b),t.paused&&await new Promise(T=>{t.resumeQueue.add(T)}),w})()};let x;if(cs.skipAnimation)return Vf(t),ss(n,!1);try{let _;tt.arr(i)?_=(async g=>{for(const b of g)await v(b)})(i):_=Promise.resolve(i(v,n.stop.bind(n))),await Promise.all([_.then(f),p]),x=ss(n.get(),!0,!1)}catch(_){if(_ instanceof yT)x=_.result;else if(_ instanceof _T)x=_.result;else throw _}finally{r==t.asyncId&&(t.asyncId=s,t.asyncTo=s?o:void 0,t.promise=s?l:void 0)}return tt.fun(a)&&At.batchedUpdates(()=>{a(x,n,n.item)}),x})()}function Vf(i,e){hf(i.timeouts,t=>t.cancel()),i.pauseQueue.clear(),i.resumeQueue.clear(),i.asyncId=i.asyncTo=i.promise=void 0,e&&(i.cancelId=e)}var yT=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},_T=class extends Error{constructor(){super("SkipAnimationSignal")}},Sx=i=>i instanceof nb,A8=1,nb=class extends J6{constructor(){super(...arguments),this.id=A8++,this._priority=0}get priority(){return this._priority}set priority(i){this._priority!=i&&(this._priority=i,this._onPriorityChange(i))}get(){const i=Ms(this);return i&&i.getValue()}to(...i){return cs.to(this,i)}interpolate(...i){return r8(),cs.to(this,i)}toJSON(){return this.get()}observerAdded(i){i==1&&this._attach()}observerRemoved(i){i==0&&this._detach()}_attach(){}_detach(){}_onChange(i,e=!1){gg(this,{type:"change",parent:this,value:i,idle:e})}_onPriorityChange(i){this.idle||f0.sort(this),gg(this,{type:"priority",parent:this,priority:i})}},Nl=Symbol.for("SpringPhase"),QR=1,Ex=2,Mx=4,b_=i=>(i[Nl]&QR)>0,no=i=>(i[Nl]&Ex)>0,Uh=i=>(i[Nl]&Mx)>0,xT=(i,e)=>e?i[Nl]|=Ex|QR:i[Nl]&=~Ex,bT=(i,e)=>e?i[Nl]|=Mx:i[Nl]&=~Mx,C8=class extends nb{constructor(i,e){if(super(),this.animation=new T8,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!tt.und(i)||!tt.und(e)){const t=tt.obj(i)?{...i}:{...e,from:i};tt.und(t.default)&&(t.default=!0),this.start(t)}}get idle(){return!(no(this)||this._state.asyncTo)||Uh(this)}get goal(){return Nr(this.animation.to)}get velocity(){const i=Ms(this);return i instanceof v0?i.lastVelocity||0:i.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return b_(this)}get isAnimating(){return no(this)}get isPaused(){return Uh(this)}get isDelayed(){return this._state.delayed}advance(i){let e=!0,t=!1;const n=this.animation;let{toValues:r}=n;const{config:s}=n,a=g0(n.to);!a&&ws(n.to)&&(r=kr(Nr(n.to))),n.values.forEach((c,f)=>{if(c.done)return;const d=c.constructor==yg?1:a?a[f].lastPosition:r[f];let p=n.immediate,m=d;if(!p){if(m=c.lastPosition,s.tension<=0){c.done=!0;return}let v=c.elapsedTime+=i;const x=n.fromValues[f],_=c.v0!=null?c.v0:c.v0=tt.arr(s.velocity)?s.velocity[f]:s.velocity;let g;const b=s.precision||(x==d?.005:Math.min(1,Math.abs(d-x)*.001));if(tt.und(s.duration))if(s.decay){const S=s.decay===!0?.998:s.decay,E=Math.exp(-(1-S)*v);m=x+_/(1-S)*(1-E),p=Math.abs(c.lastPosition-m)<=b,g=_*E}else{g=c.lastVelocity==null?_:c.lastVelocity;const S=s.restVelocity||b/10,E=s.clamp?0:s.bounce,w=!tt.und(E),T=x==d?c.v0>0:x<d;let C,U=!1;const D=1,R=Math.ceil(i/D);for(let I=0;I<R&&(C=Math.abs(g)>S,!(!C&&(p=Math.abs(d-m)<=b,p)));++I){w&&(U=m==d||m>d==T,U&&(g=-g*E,m=d));const z=-s.tension*1e-6*(m-d),O=-s.friction*.001*g,V=(z+O)/s.mass;g=g+V*D,m=m+g*D}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,v=c.elapsedTime+=i)),S=(s.progress||0)+v/this._memoizedDuration,S=S>1?1:S<0?0:S,c.durationProgress=S),m=x+s.easing(S)*(d-x),g=(m-c.lastPosition)/i,p=S==1}c.lastVelocity=g,Number.isNaN(m)&&(console.warn("Got NaN while animating:",this),p=!0)}a&&!a[f].done&&(p=!1),p?c.done=!0:e=!1,c.setValue(m,s.round)&&(t=!0)});const o=Ms(this),l=o.getValue();if(e){const c=Nr(n.to);(l!==c||t)&&!s.decay?(o.setValue(c),this._onChange(c)):t&&s.decay&&this._onChange(l),this._stop()}else t&&this._onChange(l)}set(i){return At.batchedUpdates(()=>{this._stop(),this._focus(i),this._set(i)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(no(this)){const{to:i,config:e}=this.animation;At.batchedUpdates(()=>{this._onStart(),e.decay||this._set(i,!1),this._stop()})}return this}update(i){return(this.queue||(this.queue=[])).push(i),this}start(i,e){let t;return tt.und(i)?(t=this.queue||[],this.queue=[]):t=[tt.obj(i)?i:{...e,to:i}],Promise.all(t.map(n=>this._update(n))).then(n=>tb(this,n))}stop(i){const{to:e}=this.animation;return this._focus(this.get()),Vf(this._state,i&&this._lastCallId),At.batchedUpdates(()=>this._stop(e,i)),this}reset(){this._update({reset:!0})}eventObserved(i){i.type=="change"?this._start():i.type=="priority"&&(this.priority=i.priority+1)}_prepareNode(i){const e=this.key||"";let{to:t,from:n}=i;t=tt.obj(t)?t[e]:t,(t==null||xx(t))&&(t=void 0),n=tt.obj(n)?n[e]:n,n==null&&(n=void 0);const r={to:t,from:n};return b_(this)||(i.reverse&&([t,n]=[n,t]),n=Nr(n),tt.und(n)?Ms(this)||this._set(t):this._set(n)),r}_update({...i},e){const{key:t,defaultProps:n}=this;i.default&&Object.assign(n,eb(i,(a,o)=>/^on/.test(o)?jR(a,t):a)),ET(this,i,"onProps"),Lh(this,"onProps",i,this);const r=this._prepareNode(i);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return ZR(++this._lastCallId,{key:t,props:i,defaultProps:n,state:s,actions:{pause:()=>{Uh(this)||(bT(this,!0),Jh(s.pauseQueue),Lh(this,"onPause",ss(this,Oh(this,this.animation.to)),this))},resume:()=>{Uh(this)&&(bT(this,!1),no(this)&&this._resume(),Jh(s.resumeQueue),Lh(this,"onResume",ss(this,Oh(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(a=>{if(i.loop&&a.finished&&!(e&&a.noop)){const o=$R(i);if(o)return this._update(o,!0)}return a})}_merge(i,e,t){if(e.cancel)return this.stop(!0),t(au(this));const n=!tt.und(i.to),r=!tt.und(i.from);if(n||r)if(e.callId>this._lastToId)this._lastToId=e.callId;else return t(au(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:f=l,from:d=c}=i;r&&!n&&(!e.default||tt.und(f))&&(f=d),e.reverse&&([f,d]=[d,f]);const p=!ca(d,c);p&&(o.from=d),d=Nr(d);const m=!ca(f,l);m&&this._focus(f);const v=xx(e.to),{config:x}=o,{decay:_,velocity:g}=x;(n||r)&&(x.velocity=0),e.config&&!v&&w8(x,gl(e.config,s),e.config!==a.config?gl(a.config,s):void 0);let b=Ms(this);if(!b||tt.und(f))return t(ss(this,!0));const S=tt.und(e.reset)?r&&!e.default:!tt.und(d)&&df(e.reset,s),E=S?d:this.get(),w=Hf(f),T=tt.num(w)||tt.arr(w)||m0(w),C=!v&&(!T||df(a.immediate||e.immediate,s));if(m){const I=_x(f);if(I!==b.constructor)if(C)b=this._set(w);else throw Error(`Cannot animate between ${b.constructor.name} and ${I.name}, as the "to" prop suggests`)}const U=b.constructor;let D=ws(f),R=!1;if(!D){const I=S||!b_(this)&&p;(m||I)&&(R=ca(Hf(E),w),D=!R),(!ca(o.immediate,C)&&!C||!ca(x.decay,_)||!ca(x.velocity,g))&&(D=!0)}if(R&&no(this)&&(o.changed&&!S?D=!0:D||this._stop(l)),!v&&((D||ws(l))&&(o.values=b.getPayload(),o.toValues=ws(f)?null:U==yg?[1]:kr(w)),o.immediate!=C&&(o.immediate=C,!C&&!S&&this._set(l)),D)){const{onRest:I}=o;en(D8,O=>ET(this,e,O));const z=ss(this,Oh(this,l));Jh(this._pendingCalls,z),this._pendingCalls.add(t),o.changed&&At.batchedUpdates(()=>{o.changed=!S,I?.(z,this),S?gl(a.onRest,z):o.onStart?.(z,this)})}S&&this._set(E),v?t(JR(e.to,e,this._state,this)):D?this._start():no(this)&&!m?this._pendingCalls.add(t):t(KR(E))}_focus(i){const e=this.animation;i!==e.to&&(uT(this)&&this._detach(),e.to=i,uT(this)&&this._attach())}_attach(){let i=0;const{to:e}=this.animation;ws(e)&&(ad(e,this),Sx(e)&&(i=e.priority+1)),this.priority=i}_detach(){const{to:i}=this.animation;ws(i)&&vg(i,this)}_set(i,e=!0){const t=Nr(i);if(!tt.und(t)){const n=Ms(this);if(!n||!ca(t,n.getValue())){const r=_x(t);!n||n.constructor!=r?Q1(this,r.create(t)):n.setValue(t),n&&At.batchedUpdates(()=>{this._onChange(t,e)})}}return Ms(this)}_onStart(){const i=this.animation;i.changed||(i.changed=!0,Lh(this,"onStart",ss(this,Oh(this,i.to)),this))}_onChange(i,e){e||(this._onStart(),gl(this.animation.onChange,i,this)),gl(this.defaultProps.onChange,i,this),super._onChange(i,e)}_start(){const i=this.animation;Ms(this).reset(Nr(i.to)),i.immediate||(i.fromValues=i.values.map(e=>e.lastPosition)),no(this)||(xT(this,!0),Uh(this)||this._resume())}_resume(){cs.skipAnimation?this.finish():f0.start(this)}_stop(i,e){if(no(this)){xT(this,!1);const t=this.animation;en(t.values,r=>{r.done=!0}),t.toValues&&(t.onChange=t.onPause=t.onResume=void 0),gg(this,{type:"idle",parent:this});const n=e?au(this.get()):ss(this.get(),Oh(this,i??t.to));Jh(this._pendingCalls,n),t.changed&&(t.changed=!1,Lh(this,"onRest",n,this))}}};function Oh(i,e){const t=Hf(e),n=Hf(i.get());return ca(n,t)}function $R(i,e=i.loop,t=i.to){const n=gl(e);if(n){const r=n!==!0&&YR(n),s=(r||i).reverse,a=!r||r.reset;return Wf({...i,loop:e,default:!1,pause:void 0,to:!s||xx(t)?t:void 0,from:a?i.from:void 0,reset:a,...r})}}function Wf(i){const{to:e,from:t}=i=YR(i),n=new Set;return tt.obj(e)&&ST(e,n),tt.obj(t)&&ST(t,n),i.keys=n.size?Array.from(n):null,i}function R8(i){const e=Wf(i);return tt.und(e.default)&&(e.default=eb(e)),e}function ST(i,e){Ea(i,(t,n)=>t!=null&&e.add(n))}var D8=["onStart","onRest","onChange","onPause","onResume"];function ET(i,e,t){i.animation[t]=e[t]!==qR(e,t)?jR(e[t],i.key):void 0}function Lh(i,e,...t){i.animation[e]?.(...t),i.defaultProps[e]?.(...t)}var U8=["onStart","onChange","onRest"],O8=1,L8=class{constructor(e,t){this.id=O8++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];tt.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Wf(e)),this}start(e){let{queue:t}=this;return e?t=kr(e).map(Wf):this.queue=[],this._flush?this._flush(this,t):(r3(this,t),wx(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;en(kr(t),r=>n[r].stop(!!e))}else Vf(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(tt.und(e))this.start({pause:!0});else{const t=this.springs;en(kr(e),n=>t[n].pause())}return this}resume(e){if(tt.und(e))this.start({pause:!1});else{const t=this.springs;en(kr(e),n=>t[n].resume())}return this}each(e){Ea(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,s=this._changed.size>0;(r&&!this._started||s&&!this._started)&&(this._started=!0,hf(e,([l,c])=>{c.value=this.get(),l(c,this,this._item)}));const a=!r&&this._started,o=s||a&&n.size?this.get():null;s&&t.size&&hf(t,([l,c])=>{c.value=o,l(c,this,this._item)}),a&&(this._started=!1,hf(n,([l,c])=>{c.value=o,l(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;At.onFrame(this._onFrame)}};function wx(i,e){return Promise.all(e.map(t=>e3(i,t))).then(t=>tb(i,t))}async function e3(i,e,t){const{keys:n,to:r,from:s,loop:a,onRest:o,onResolve:l}=e,c=tt.obj(e.default)&&e.default;a&&(e.loop=!1),r===!1&&(e.to=null),s===!1&&(e.from=null);const f=tt.arr(r)||tt.fun(r)?r:void 0;f?(e.to=void 0,e.onRest=void 0,c&&(c.onRest=void 0)):en(U8,x=>{const _=e[x];if(tt.fun(_)){const g=i._events[x];e[x]=({finished:b,cancelled:S})=>{const E=g.get(_);E?(b||(E.finished=!1),S&&(E.cancelled=!0)):g.set(_,{value:null,finished:b||!1,cancelled:S||!1})},c&&(c[x]=e[x])}});const d=i._state;e.pause===!d.paused?(d.paused=e.pause,Jh(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);const p=(n||Object.keys(i.springs)).map(x=>i.springs[x].start(e)),m=e.cancel===!0||qR(e,"cancel")===!0;(f||m&&d.asyncId)&&p.push(ZR(++i._lastAsyncId,{props:e,state:d,actions:{pause:vx,resume:vx,start(x,_){m?(Vf(d,i._lastAsyncId),_(au(i))):(x.onRest=o,_(JR(f,x,d,i)))}}})),d.paused&&await new Promise(x=>{d.resumeQueue.add(x)});const v=tb(i,await Promise.all(p));if(a&&v.finished&&!(t&&v.noop)){const x=$R(e,a,r);if(x)return r3(i,[x]),e3(i,x,!0)}return l&&At.batchedUpdates(()=>l(v,i,i.item)),v}function MT(i,e){const t={...i.springs};return e&&en(kr(e),n=>{tt.und(n.keys)&&(n=Wf(n)),tt.obj(n.to)||(n={...n,to:void 0}),i3(t,n,r=>n3(r))}),t3(i,t),t}function t3(i,e){Ea(e,(t,n)=>{i.springs[n]||(i.springs[n]=t,ad(t,i))})}function n3(i,e){const t=new C8;return t.key=i,e&&ad(t,e),t}function i3(i,e,t){e.keys&&en(e.keys,n=>{(i[n]||(i[n]=t(n)))._prepareNode(e)})}function r3(i,e){en(e,t=>{i3(i.springs,t,n=>n3(n,i))})}var N8=Z.createContext({pause:!1,immediate:!1}),I8=()=>{const i=[],e=function(n){a8();const r=[];return en(i,(s,a)=>{if(tt.und(n))r.push(s.start());else{const o=t(n,s,a);o&&r.push(s.start(o))}}),r};e.current=i,e.add=function(n){i.includes(n)||i.push(n)},e.delete=function(n){const r=i.indexOf(n);~r&&i.splice(r,1)},e.pause=function(){return en(i,n=>n.pause(...arguments)),this},e.resume=function(){return en(i,n=>n.resume(...arguments)),this},e.set=function(n){en(i,(r,s)=>{const a=tt.fun(n)?n(s,r):n;a&&r.set(a)})},e.start=function(n){const r=[];return en(i,(s,a)=>{if(tt.und(n))r.push(s.start());else{const o=this._getProps(n,s,a);o&&r.push(s.start(o))}}),r},e.stop=function(){return en(i,n=>n.stop(...arguments)),this},e.update=function(n){return en(i,(r,s)=>r.update(this._getProps(n,r,s))),this};const t=function(n,r,s){return tt.fun(n)?n(s,r):n};return e._getProps=t,e};function P8(i,e,t){const n=tt.fun(e)&&e;n&&!t&&(t=[]);const r=Z.useMemo(()=>n||arguments.length==3?I8():void 0,[]),s=Z.useRef(0),a=kR(),o=Z.useMemo(()=>({ctrls:[],queue:[],flush(g,b){const S=MT(g,b);return s.current>0&&!o.queue.length&&!Object.keys(S).some(w=>!g.springs[w])?wx(g,b):new Promise(w=>{t3(g,S),o.queue.push(()=>{w(wx(g,b))}),a()})}}),[]),l=Z.useRef([...o.ctrls]),c=Z.useRef([]),f=fT(i)||0;Z.useMemo(()=>{en(l.current.slice(i,f),g=>{b8(g,r),g.stop(!0)}),l.current.length=i,d(f,i)},[i]),Z.useMemo(()=>{d(0,Math.min(f,i))},t);function d(g,b){for(let S=g;S<b;S++){const E=l.current[S]||(l.current[S]=new L8(null,o.flush)),w=n?n(S,E):e[S];w&&(c.current[S]=R8(w))}}const p=l.current.map((g,b)=>MT(g,c.current[b])),m=Z.useContext(N8),v=fT(m),x=m!==v&&x8(m);J1(()=>{s.current++,o.ctrls=l.current;const{queue:g}=o;g.length&&(o.queue=[],en(g,b=>b())),en(l.current,(b,S)=>{r?.add(b),x&&b.start({default:m});const E=c.current[S];E&&(S8(b,E.ref),b.ref?b.queue.push(E):b.start(E))})}),GR(()=>()=>{en(o.ctrls,g=>g.stop(!0))});const _=p.map(g=>({...g}));return r?[_,r]:_}function _r(i,e){const t=tt.fun(i),[[n],r]=P8(1,t?i:[i],t?e||[]:e);return t||arguments.length==2?[n,r]:n}var z8=class extends nb{constructor(i,e){super(),this.source=i,this.idle=!0,this._active=new Set,this.calc=Bf(...e);const t=this._get(),n=_x(t);Q1(this,n.create(t))}advance(i){const e=this._get(),t=this.get();ca(e,t)||(Ms(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&wT(this._active)&&S_(this)}_get(){const i=tt.arr(this.source)?this.source.map(Nr):kr(Nr(this.source));return this.calc(...i)}_start(){this.idle&&!wT(this._active)&&(this.idle=!1,en(g0(this),i=>{i.done=!1}),cs.skipAnimation?(At.batchedUpdates(()=>this.advance()),S_(this)):f0.start(this))}_attach(){let i=1;en(kr(this.source),e=>{ws(e)&&ad(e,this),Sx(e)&&(e.idle||this._active.add(e),i=Math.max(i,e.priority+1))}),this.priority=i,this._start()}_detach(){en(kr(this.source),i=>{ws(i)&&vg(i,this)}),this._active.clear(),S_(this)}eventObserved(i){i.type=="change"?i.idle?this.advance():(this._active.add(i.parent),this._start()):i.type=="idle"?this._active.delete(i.parent):i.type=="priority"&&(this.priority=kr(this.source).reduce((e,t)=>Math.max(e,(Sx(t)?t.priority:0)+1),0))}};function F8(i){return i.idle!==!1}function wT(i){return!i.size||Array.from(i).every(F8)}function S_(i){i.idle||(i.idle=!0,en(g0(i),e=>{e.done=!0}),gg(i,{type:"idle",parent:i}))}cs.assign({createStringInterpolator:FR,to:(i,e)=>new z8(i,e)});var B8=["primitive"].concat(Object.keys(bC).filter(i=>/^[A-Z]/.test(i)).map(i=>i[0].toLowerCase()+i.slice(1)));cs.assign({createStringInterpolator:FR,colors:z6,frameLoop:"demand"});T5(()=>{At.advance()});var k8=m8(B8,{applyAnimatedValues:da}),Bn=k8.animated;function Il(){return Il=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Il.apply(null,arguments)}const od=new Q,ib=new Q,G8=new Q,TT=new Ge;function H8(i,e,t){const n=od.setFromMatrixPosition(i.matrixWorld);n.project(e);const r=t.width/2,s=t.height/2;return[n.x*r+r,-(n.y*s)+s]}function V8(i,e){const t=od.setFromMatrixPosition(i.matrixWorld),n=ib.setFromMatrixPosition(e.matrixWorld),r=t.sub(n),s=e.getWorldDirection(G8);return r.angleTo(s)>Math.PI/2}function W8(i,e,t,n){const r=od.setFromMatrixPosition(i.matrixWorld),s=r.clone();s.project(e),TT.set(s.x,s.y),t.setFromCamera(TT,e);const a=t.intersectObjects(n,!0);if(a.length){const o=a[0].distance;return r.distanceTo(t.ray.origin)<o}return!0}function X8(i,e){if(e instanceof Bl)return e.zoom;if(e instanceof Kn){const t=od.setFromMatrixPosition(i.matrixWorld),n=ib.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(n);return 1/(2*Math.tan(r/2)*s)}else return 1}function j8(i,e,t){if(e instanceof Kn||e instanceof Bl){const n=od.setFromMatrixPosition(i.matrixWorld),r=ib.setFromMatrixPosition(e.matrixWorld),s=n.distanceTo(r),a=(t[1]-t[0])/(e.far-e.near),o=t[1]-a*e.far;return Math.round(a*s+o)}}const Tx=i=>Math.abs(i)<1e-10?0:i;function s3(i,e,t=""){let n="matrix3d(";for(let r=0;r!==16;r++)n+=Tx(e[r]*i.elements[r])+(r!==15?",":")");return t+n}const q8=(i=>e=>s3(e,i))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Y8=(i=>(e,t)=>s3(e,i(t),"translate(-50%,-50%)"))(i=>[1/i,1/i,1/i,1,-1/i,-1/i,-1/i,-1,1/i,1/i,1/i,1,1,1,1,1]);function Z8(i){return i&&typeof i=="object"&&"current"in i}const rb=Z.forwardRef(({children:i,eps:e=.001,style:t,className:n,prepend:r,center:s,fullscreen:a,portal:o,distanceFactor:l,sprite:c=!1,transform:f=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:v,material:x,geometry:_,zIndexRange:g=[16777271,0],calculatePosition:b=H8,as:S="div",wrapperClass:E,pointerEvents:w="auto",...T},C)=>{const{gl:U,camera:D,scene:R,size:I,raycaster:z,events:O,viewport:V}=Jn(),[ee]=Z.useState(()=>document.createElement(S)),P=Z.useRef(null),L=Z.useRef(null),k=Z.useRef(0),H=Z.useRef([0,0]),W=Z.useRef(null),F=Z.useRef(null),Y=o?.current||O.connected||U.domElement.parentNode,K=Z.useRef(null),j=Z.useRef(!1),J=Z.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&Z8(d[0]),[d]);Z.useLayoutEffect(()=>{const be=U.domElement;d&&d==="blending"?(be.style.zIndex=`${Math.floor(g[0]/2)}`,be.style.position="absolute",be.style.pointerEvents="none"):(be.style.zIndex=null,be.style.position=null,be.style.pointerEvents=null)},[d]),Z.useLayoutEffect(()=>{if(L.current){const be=P.current=HU.createRoot(ee);if(R.updateMatrixWorld(),f)ee.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ve=b(L.current,D,I);ee.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ve[0]}px,${ve[1]}px,0);transform-origin:0 0;`}return Y&&(r?Y.prepend(ee):Y.appendChild(ee)),()=>{Y&&Y.removeChild(ee),be.unmount()}}},[Y,f]),Z.useLayoutEffect(()=>{E&&(ee.className=E)},[E]);const he=Z.useMemo(()=>f?{position:"absolute",top:0,left:0,width:I.width,height:I.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...a&&{top:-I.height/2,left:-I.width/2,width:I.width,height:I.height},...t},[t,s,a,I,f]),re=Z.useMemo(()=>({position:"absolute",pointerEvents:w}),[w]);Z.useLayoutEffect(()=>{if(j.current=!1,f){var be;(be=P.current)==null||be.render(Z.createElement("div",{ref:W,style:he},Z.createElement("div",{ref:F,style:re},Z.createElement("div",{ref:C,className:n,style:t,children:i}))))}else{var ve;(ve=P.current)==null||ve.render(Z.createElement("div",{ref:C,style:he,className:n,children:i}))}});const pe=Z.useRef(!0);s0(be=>{if(L.current){D.updateMatrixWorld(),L.current.updateWorldMatrix(!0,!1);const ve=f?H.current:b(L.current,D,I);if(f||Math.abs(k.current-D.zoom)>e||Math.abs(H.current[0]-ve[0])>e||Math.abs(H.current[1]-ve[1])>e){const ce=V8(L.current,D);let Ne=!1;J&&(Array.isArray(d)?Ne=d.map(Me=>Me.current):d!=="blending"&&(Ne=[R]));const G=pe.current;if(Ne){const Me=W8(L.current,D,z,Ne);pe.current=Me&&!ce}else pe.current=!ce;G!==pe.current&&(p?p(!pe.current):ee.style.display=pe.current?"block":"none");const le=Math.floor(g[0]/2),te=d?J?[g[0],le]:[le-1,0]:g;if(ee.style.zIndex=`${j8(L.current,D,te)}`,f){const[Me,oe]=[I.width/2,I.height/2],De=D.projectionMatrix.elements[5]*oe,{isOrthographicCamera:_e,top:ne,left:Be,bottom:X,right:B}=D,ie=q8(D.matrixWorldInverse),Se=_e?`scale(${De})translate(${Tx(-(B+Be)/2)}px,${Tx((ne+X)/2)}px)`:`translateZ(${De}px)`;let ge=L.current.matrixWorld;c&&(ge=D.matrixWorldInverse.clone().transpose().copyPosition(ge).scale(L.current.scale),ge.elements[3]=ge.elements[7]=ge.elements[11]=0,ge.elements[15]=1),ee.style.width=I.width+"px",ee.style.height=I.height+"px",ee.style.perspective=_e?"":`${De}px`,W.current&&F.current&&(W.current.style.transform=`${Se}${ie}translate(${Me}px,${oe}px)`,F.current.style.transform=Y8(ge,1/((l||10)/400)))}else{const Me=l===void 0?1:X8(L.current,D)*l;ee.style.transform=`translate3d(${ve[0]}px,${ve[1]}px,0) scale(${Me})`}H.current=ve,k.current=D.zoom}}if(!J&&K.current&&!j.current)if(f){if(W.current){const ve=W.current.children[0];if(ve!=null&&ve.clientWidth&&ve!=null&&ve.clientHeight){const{isOrthographicCamera:ce}=D;if(ce||_)T.scale&&(Array.isArray(T.scale)?T.scale instanceof Q?K.current.scale.copy(T.scale.clone().divideScalar(1)):K.current.scale.set(1/T.scale[0],1/T.scale[1],1/T.scale[2]):K.current.scale.setScalar(1/T.scale));else{const Ne=(l||10)/400,G=ve.clientWidth*Ne,le=ve.clientHeight*Ne;K.current.scale.set(G,le,1)}j.current=!0}}}else{const ve=ee.children[0];if(ve!=null&&ve.clientWidth&&ve!=null&&ve.clientHeight){const ce=1/V.factor,Ne=ve.clientWidth*ce,G=ve.clientHeight*ce;K.current.scale.set(Ne,G,1),j.current=!0}K.current.lookAt(be.camera.position)}});const Oe=Z.useMemo(()=>({vertexShader:f?void 0:`
3887
3887
  /*
3888
3888
  This shader is from the THREE's SpriteMaterial.
3889
3889
  We need to turn the backing plane into a Sprite
@@ -3920,15 +3920,15 @@ No matching component was found for:
3920
3920
  void main() {
3921
3921
  gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
3922
3922
  }
3923
- `}),[f]);return Z.createElement("group",Il({},T,{ref:L}),d&&!J&&Z.createElement("mesh",{castShadow:m,receiveShadow:v,ref:K},_||Z.createElement("planeGeometry",null),x||Z.createElement("shaderMaterial",{side:In,vertexShader:Oe.vertexShader,fragmentShader:Oe.fragmentShader})))});function wl(i,e="pointer",t="auto",n=document.body){Z.useEffect(()=>{if(i)return n.style.cursor=e,()=>void(n.style.cursor=t)},[i])}function Z8(i,e,t){return Math.max(e,Math.min(i,t))}const vn={toVector(i,e){return i===void 0&&(i=e),Array.isArray(i)?i:[i,i]},add(i,e){return[i[0]+e[0],i[1]+e[1]]},sub(i,e){return[i[0]-e[0],i[1]-e[1]]},addTo(i,e){i[0]+=e[0],i[1]+=e[1]},subTo(i,e){i[0]-=e[0],i[1]-=e[1]}};function AT(i,e,t){return e===0||Math.abs(e)===1/0?Math.pow(i,t*5):i*e*t/(e+t*i)}function CT(i,e,t,n=.15){return n===0?Z8(i,e,t):i<e?-AT(e-i,t-e,n)+e:i>t?+AT(i-t,t-e,n)+t:i}function K8(i,[e,t],[n,r]){const[[s,a],[o,l]]=i;return[CT(e,s,a,n),CT(t,o,l,r)]}function J8(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Q8(i){var e=J8(i,"string");return typeof e=="symbol"?e:String(e)}function Zn(i,e,t){return e=Q8(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function RT(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Tn(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?RT(Object(t),!0).forEach(function(n){Zn(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):RT(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}const o3={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function DT(i){return i?i[0].toUpperCase()+i.slice(1):""}const $8=["enter","leave"];function e7(i=!1,e){return i&&!$8.includes(e)}function t7(i,e="",t=!1){const n=o3[i],r=n&&n[e]||e;return"on"+DT(i)+DT(r)+(e7(t,r)?"Capture":"")}const n7=["gotpointercapture","lostpointercapture"];function i7(i){let e=i.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const n=n7.includes(e)?"capturecapture":"capture",r=!!~e.indexOf(n);return r&&(e=e.replace("capture","")),{device:e,capture:r,passive:t}}function r7(i,e=""){const t=o3[i],n=t&&t[e]||e;return i+n}function y0(i){return"touches"in i}function l3(i){return y0(i)?"touch":"pointerType"in i?i.pointerType:"mouse"}function s7(i){return Array.from(i.touches).filter(e=>{var t,n;return e.target===i.currentTarget||((t=i.currentTarget)===null||t===void 0||(n=t.contains)===null||n===void 0?void 0:n.call(t,e.target))})}function a7(i){return i.type==="touchend"||i.type==="touchcancel"?i.changedTouches:i.targetTouches}function c3(i){return y0(i)?a7(i)[0]:i}function Ax(i,e){try{const t=e.clientX-i.clientX,n=e.clientY-i.clientY,r=(e.clientX+i.clientX)/2,s=(e.clientY+i.clientY)/2,a=Math.hypot(t,n);return{angle:-(Math.atan2(t,n)*180)/Math.PI,distance:a,origin:[r,s]}}catch{}return null}function o7(i){return s7(i).map(e=>e.identifier)}function UT(i,e){const[t,n]=Array.from(i.touches).filter(r=>e.includes(r.identifier));return Ax(t,n)}function E_(i){const e=c3(i);return y0(i)?e.identifier:e.pointerId}function xu(i){const e=c3(i);return[e.clientX,e.clientY]}const OT=40,LT=800;function u3(i){let{deltaX:e,deltaY:t,deltaMode:n}=i;return n===1?(e*=OT,t*=OT):n===2&&(e*=LT,t*=LT),[e,t]}function l7(i){var e,t;const{scrollX:n,scrollY:r,scrollLeft:s,scrollTop:a}=i.currentTarget;return[(e=n??s)!==null&&e!==void 0?e:0,(t=r??a)!==null&&t!==void 0?t:0]}function c7(i){const e={};if("buttons"in i&&(e.buttons=i.buttons),"shiftKey"in i){const{shiftKey:t,altKey:n,metaKey:r,ctrlKey:s}=i;Object.assign(e,{shiftKey:t,altKey:n,metaKey:r,ctrlKey:s})}return e}function xg(i,...e){return typeof i=="function"?i(...e):i}function u7(){}function h7(...i){return i.length===0?u7:i.length===1?i[0]:function(){let e;for(const t of i)e=t.apply(this,arguments)||e;return e}}function NT(i,e){return Object.assign({},e,i||{})}const f7=32;class h3{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?xg(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let s=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,c7(e)),r.down=r.pressed=r.buttons%2===1||r.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const T=t._delta.map(Math.abs);vn.addTo(t._distance,T)}this.axisIntent&&this.axisIntent(e);const[a,o]=t._movement,[l,c]=n.threshold,{_step:f,values:d}=t;if(n.hasCustomTransform?(f[0]===!1&&(f[0]=Math.abs(a)>=l&&d[0]),f[1]===!1&&(f[1]=Math.abs(o)>=c&&d[1])):(f[0]===!1&&(f[0]=Math.abs(a)>=l&&Math.sign(a)*l),f[1]===!1&&(f[1]=Math.abs(o)>=c&&Math.sign(o)*c)),t.intentional=f[0]!==!1||f[1]!==!1,!t.intentional)return;const p=[0,0];if(n.hasCustomTransform){const[T,C]=d;p[0]=f[0]!==!1?T-f[0]:0,p[1]=f[1]!==!1?C-f[1]:0}else p[0]=f[0]!==!1?a-f[0]:0,p[1]=f[1]!==!1?o-f[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(p);const m=t.offset,v=t._active&&!t._blocked||t.active;v&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=xg(n.bounds,t)),this.setup&&this.setup()),t.movement=p,this.computeOffset()));const[x,_]=t.offset,[[g,b],[S,E]]=t._bounds;t.overflow=[x<g?-1:x>b?1:0,_<S?-1:_>E?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const w=t._active?n.rubberband||[0,0]:[0,0];if(t.offset=K8(t._bounds,t.offset,w),t.delta=vn.sub(t.offset,m),this.computeMovement(),v&&(!t.last||s>f7)){t.delta=vn.sub(t.offset,m);const T=t.delta.map(Math.abs);vn.addTo(t.distance,T),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[T[0]/s,T[1]/s],t.timeDelta=s)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(Tn(Tn(Tn({},t),e),{},{[this.aliasKey]:e.values}));r!==void 0&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function d7([i,e],t){const n=Math.abs(i),r=Math.abs(e);if(n>r&&n>t)return"x";if(r>n&&r>t)return"y"}class ld extends h3{constructor(...e){super(...e),Zn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=vn.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=vn.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r=typeof n.axisThreshold=="object"?n.axisThreshold[l3(e)]:n.axisThreshold;t.axis=d7(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const p7=i=>i,IT=.15,f3={enabled(i=!0){return i},eventOptions(i,e,t){return Tn(Tn({},t.shared.eventOptions),i)},preventDefault(i=!1){return i},triggerAllEvents(i=!1){return i},rubberband(i=0){switch(i){case!0:return[IT,IT];case!1:return[0,0];default:return vn.toVector(i)}},from(i){if(typeof i=="function")return i;if(i!=null)return vn.toVector(i)},transform(i,e,t){const n=i||t.shared.transform;return this.hasCustomTransform=!!n,n||p7},threshold(i){return vn.toVector(i,0)}},m7=0,kl=Tn(Tn({},f3),{},{axis(i,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(i=m7){return i},bounds(i={}){if(typeof i=="function")return s=>kl.bounds(i(s));if("current"in i)return()=>i.current;if(typeof HTMLElement=="function"&&i instanceof HTMLElement)return i;const{left:e=-1/0,right:t=1/0,top:n=-1/0,bottom:r=1/0}=i;return[[e,t],[n,r]]}}),PT={ArrowRight:(i,e=1)=>[i*e,0],ArrowLeft:(i,e=1)=>[-1*i*e,0],ArrowUp:(i,e=1)=>[0,-1*i*e],ArrowDown:(i,e=1)=>[0,i*e]};class g7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=kl.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(r&&r.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=E_(e),n._pointerActive=!0,this.computeValues(xu(e)),this.computeInitial(),t.preventScrollAxis&&l3(e)!=="mouse"?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=E_(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;const s=xu(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=vn.sub(s,t._values),this.computeValues(s)),vn.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=E_(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[s,a]=t._distance;if(t.tap=s<=n.tapsThreshold&&a<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[o,l]=t._delta,[c,f]=t._movement,[d,p]=n.swipe.velocity,[m,v]=n.swipe.distance,x=n.swipe.duration;if(t.elapsedTime<x){const _=Math.abs(o/t.timeDelta),g=Math.abs(l/t.timeDelta);_>d&&Math.abs(c)>m&&(t.swipe[0]=Math.sign(o)),g>p&&Math.abs(f)>v&&(t.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,v7(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=PT[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,vn.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in PT&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function v7(i){"persist"in i&&typeof i.persist=="function"&&i.persist()}const cd=typeof window<"u"&&window.document&&window.document.createElement;function d3(){return cd&&"ontouchstart"in window}function y7(){return d3()||cd&&window.navigator.maxTouchPoints>1}function _7(){return cd&&"onpointerdown"in window}function x7(){return cd&&"exitPointerLock"in window.document}function b7(){try{return"constructor"in GestureEvent}catch{return!1}}const Pr={isBrowser:cd,gesture:b7(),touch:d3(),touchscreen:y7(),pointer:_7(),pointerLock:x7()},S7=250,E7=180,M7=.5,w7=50,T7=250,A7=10,zT={mouse:0,touch:0,pen:8},C7=Tn(Tn({},kl),{},{device(i,e,{pointer:{touch:t=!1,lock:n=!1,mouse:r=!1}={}}){return this.pointerLock=n&&Pr.pointerLock,Pr.touch&&t?"touch":this.pointerLock?"mouse":Pr.pointer&&!r?"pointer":Pr.touch?"touch":"mouse"},preventScrollAxis(i,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&i?S7:void 0,!(!Pr.touchscreen||t===!1))return i||(t!==void 0?"y":void 0)},pointerCapture(i,e,{pointer:{capture:t=!0,buttons:n=1,keys:r=!0}={}}){return this.pointerButtons=n,this.keys=r,!this.pointerLock&&this.device==="pointer"&&t},threshold(i,e,{filterTaps:t=!1,tapsThreshold:n=3,axis:r=void 0}){const s=vn.toVector(i,t?n:r?1:0);return this.filterTaps=t,this.tapsThreshold=n,s},swipe({velocity:i=M7,distance:e=w7,duration:t=T7}={}){return{velocity:this.transform(vn.toVector(i)),distance:this.transform(vn.toVector(e)),duration:t}},delay(i=0){switch(i){case!0:return E7;case!1:return 0;default:return i}},axisThreshold(i){return i?Tn(Tn({},zT),i):zT},keyboardDisplacement(i=A7){return i}});function p3(i){const[e,t]=i.overflow,[n,r]=i._delta,[s,a]=i._direction;(e<0&&n>0&&s<0||e>0&&n<0&&s>0)&&(i._movement[0]=i._movementBound[0]),(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(i._movement[1]=i._movementBound[1])}const R7=30,D7=100;class U7 extends h3{constructor(...e){super(...e),Zn(this,"ingKey","pinching"),Zn(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;e==="wheel"?this.state.offset=vn.add(t,n):this.state.offset=[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const r=Math.abs(t)*R7-Math.abs(n);r<0?e.axis="angle":r>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every(s=>n.has(s))||n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const r=UT(e,t._touchIds);r&&this.pinchStart(e,r)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,r=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every(a=>r.has(a))||(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const s=Ax(...Array.from(n.values()));s&&this.pinchStart(e,s)}pinchStart(e,t){const n=this.state;n.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=UT(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=Ax(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,r=n._values[1],s=t.angle-r;let a=0;Math.abs(s)>270&&(a+=Math.sign(s)),this.computeValues([t.distance,t.angle-360*a]),n.origin=t.origin,n.turns=a,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(t=>!this.ctrl.touchIds.has(t))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=vn.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(n=>e[n]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const n=this.state;n._delta=[-u3(e)[1]/D7*n.offset[0],0],vn.addTo(n._movement,n._delta),p3(n),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}}const O7=Tn(Tn({},f3),{},{device(i,e,{shared:t,pointer:{touch:n=!1}={}}){if(t.target&&!Pr.touch&&Pr.gesture)return"gesture";if(Pr.touch&&n)return"touch";if(Pr.touchscreen){if(Pr.pointer)return"pointer";if(Pr.touch)return"touch"}},bounds(i,e,{scaleBounds:t={},angleBounds:n={}}){const r=a=>{const o=NT(xg(t,a),{min:-1/0,max:1/0});return[o.min,o.max]},s=a=>{const o=NT(xg(n,a),{min:-1/0,max:1/0});return[o.min,o.max]};return typeof t!="function"&&typeof n!="function"?[r(),s()]:a=>[r(a),s(a)]},threshold(i,e,t){return this.lockDirection=t.axis==="lock",vn.toVector(i,this.lockDirection?[.1,3]:0)},modifierKey(i){return i===void 0?"ctrlKey":i},pinchOnWheel(i=!0){return i}});class L7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","moving")}move(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(xu(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=xu(e),n=this.state;n._delta=vn.sub(t,n._values),vn.addTo(n._movement,n._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}}const N7=Tn(Tn({},kl),{},{mouseOnly:(i=!0)=>i});class I7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,n=l7(e);t._delta=vn.sub(n,t._values),vn.addTo(t._movement,t._delta),this.computeValues(n),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}}const P7=kl;class z7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=u3(e),vn.addTo(t._movement,t._delta),p3(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}}const F7=kl;class B7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.start(e),this.computeValues(xu(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&e.pointerType!=="mouse")return;const t=this.state;if(!t._active)return;t._active=!1;const n=xu(e);t._movement=t._delta=vn.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}}const k7=Tn(Tn({},kl),{},{mouseOnly:(i=!0)=>i}),sb=new Map,Cx=new Map;function G7(i){sb.set(i.key,i.engine),Cx.set(i.key,i.resolver)}const H7={key:"drag",engine:g7,resolver:C7},V7={key:"hover",engine:B7,resolver:k7},W7={key:"move",engine:L7,resolver:N7},X7={key:"pinch",engine:U7,resolver:O7},j7={key:"scroll",engine:I7,resolver:P7},q7={key:"wheel",engine:z7,resolver:F7};function Y7(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}function Z7(i,e){if(i==null)return{};var t=Y7(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}const K7={target(i){if(i)return()=>"current"in i?i.current:i},enabled(i=!0){return i},window(i=Pr.isBrowser?window:void 0){return i},eventOptions({passive:i=!0,capture:e=!1}={}){return{passive:i,capture:e}},transform(i){return i}},J7=["target","eventOptions","window","enabled","transform"];function fm(i={},e){const t={};for(const[n,r]of Object.entries(e))switch(typeof r){case"function":t[n]=r.call(t,i[n],n,i);break;case"object":t[n]=fm(i[n],r);break;case"boolean":r&&(t[n]=i[n]);break}return t}function Q7(i,e,t={}){const n=i,{target:r,eventOptions:s,window:a,enabled:o,transform:l}=n,c=Z7(n,J7);if(t.shared=fm({target:r,eventOptions:s,window:a,enabled:o,transform:l},K7),e){const f=Cx.get(e);t[e]=fm(Tn({shared:t.shared},c),f)}else for(const f in c){const d=Cx.get(f);d&&(t[f]=fm(Tn({shared:t.shared},c[f]),d))}return t}class m3{constructor(e,t){Zn(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,s){const a=this._listeners,o=r7(t,n),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=Tn(Tn({},l),s);e.addEventListener(o,r,c);const f=()=>{e.removeEventListener(o,r,c),a.delete(f)};return a.add(f),f}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class $7{constructor(){Zn(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class e9{constructor(e){Zn(this,"gestures",new Set),Zn(this,"_targetEventStore",new m3(this)),Zn(this,"gestureEventStores",{}),Zn(this,"gestureTimeoutStores",{}),Zn(this,"handlers",{}),Zn(this,"config",{}),Zn(this,"pointerIds",new Set),Zn(this,"touchIds",new Set),Zn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),t9(this,e)}setEventIds(e){if(y0(e))return this.touchIds=new Set(o7(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=Q7(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!(t.target&&(r=t.target(),!r))){if(t.enabled){for(const a of this.gestures){const o=this.config[a],l=FT(n,o.eventOptions,!!r);if(o.enabled){const c=sb.get(a);new c(this,e,a).bind(l)}}const s=FT(n,t.eventOptions,!!r);for(const a in this.nativeHandlers)s(a,"",o=>this.nativeHandlers[a](Tn(Tn({},this.state.shared),{},{event:o,args:e})),void 0,!0)}for(const s in n)n[s]=h7(...n[s]);if(!r)return n;for(const s in n){const{device:a,capture:o,passive:l}=i7(s);this._targetEventStore.add(r,a,"",n[s],{capture:o,passive:l})}}}}function Hc(i,e){i.gestures.add(e),i.gestureEventStores[e]=new m3(i,e),i.gestureTimeoutStores[e]=new $7}function t9(i,e){e.drag&&Hc(i,"drag"),e.wheel&&Hc(i,"wheel"),e.scroll&&Hc(i,"scroll"),e.move&&Hc(i,"move"),e.pinch&&Hc(i,"pinch"),e.hover&&Hc(i,"hover")}const FT=(i,e,t)=>(n,r,s,a={},o=!1)=>{var l,c;const f=(l=a.capture)!==null&&l!==void 0?l:e.capture,d=(c=a.passive)!==null&&c!==void 0?c:e.passive;let p=o?n:t7(n,r,f);t&&d&&(p+="Passive"),i[p]=i[p]||[],i[p].push(s)},n9=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function i9(i){const e={},t={},n=new Set;for(let r in i)n9.test(r)?(n.add(RegExp.lastMatch),t[r]=i[r]):e[r]=i[r];return[t,e,n]}function Vc(i,e,t,n,r,s){if(!i.has(t)||!sb.has(n))return;const a=t+"Start",o=t+"End",l=c=>{let f;return c.first&&a in e&&e[a](c),t in e&&(f=e[t](c)),c.last&&o in e&&e[o](c),f};r[n]=l,s[n]=s[n]||{}}function r9(i,e){const[t,n,r]=i9(i),s={};return Vc(r,t,"onDrag","drag",s,e),Vc(r,t,"onWheel","wheel",s,e),Vc(r,t,"onScroll","scroll",s,e),Vc(r,t,"onPinch","pinch",s,e),Vc(r,t,"onMove","move",s,e),Vc(r,t,"onHover","hover",s,e),{handlers:s,config:e,nativeHandlers:n}}function s9(i,e={},t,n){const r=uo.useMemo(()=>new e9(i),[]);if(r.applyHandlers(i,n),r.applyConfig(e,t),uo.useEffect(r.effect.bind(r)),uo.useEffect(()=>r.clean.bind(r),[]),e.target===void 0)return r.bind.bind(r)}function a9(i){return i.forEach(G7),function(t,n){const{handlers:r,nativeHandlers:s,config:a}=r9(t,n||{});return s9(r,a,void 0,s)}}function o9(i,e){return a9([H7,X7,j7,q7,W7,V7])(i,e||{})}const Xp=(i,e)=>{const t=i[0].index!==null,n=new Set(Object.keys(i[0].attributes)),r=new Set(Object.keys(i[0].morphAttributes)),s={},a={},o=i[0].morphTargetsRelative,l=new Ct;let c=0;if(i.forEach((f,d)=>{let p=0;if(t!==(f.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let m in f.attributes){if(!n.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;s[m]===void 0&&(s[m]=[]),s[m].push(f.attributes[m]),p++}if(p!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". Make sure all geometries have the same number of attributes."),null;if(o!==f.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let m in f.morphAttributes){if(!r.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". .morphAttributes must be consistent throughout all geometries."),null;a[m]===void 0&&(a[m]=[]),a[m].push(f.morphAttributes[m])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(f.userData),e){let m;if(f.index)m=f.index.count;else if(f.attributes.position!==void 0)m=f.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,m,d),c+=m}}),t){let f=0;const d=[];i.forEach(p=>{const m=p.index;for(let v=0;v<m.count;++v)d.push(m.getX(v)+f);f+=p.attributes.position.count}),l.setIndex(d)}for(let f in s){const d=BT(s[f]);if(!d)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+f+" attribute."),null;l.setAttribute(f,d)}for(let f in a){const d=a[f][0].length;if(d===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[f]=[];for(let p=0;p<d;++p){const m=[];for(let x=0;x<a[f].length;++x)m.push(a[f][x][p]);const v=BT(m);if(!v)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+f+" morphAttribute."),null;l.morphAttributes[f].push(v)}}return l},BT=i=>{let e,t,n,r=0;if(i.forEach(s=>{if(e===void 0&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=s.itemSize),t!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=s.normalized),n!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;r+=s.array.length}),e&&t){const s=new e(r);let a=0;return i.forEach(o=>{s.set(o.array,a),a+=o.array.length}),new Kt(s,t,n)}};function l9(i,e=Math.PI/3){const t=Math.cos(e),n=(1+1e-10)*100,r=[new Q,new Q,new Q],s=new Q,a=new Q,o=new Q,l=new Q;function c(x){const _=~~(x.x*n),g=~~(x.y*n),b=~~(x.z*n);return`${_},${g},${b}`}const f=i.index?i.toNonIndexed():i,d=f.attributes.position,p={};for(let x=0,_=d.count/3;x<_;x++){const g=3*x,b=r[0].fromBufferAttribute(d,g+0),S=r[1].fromBufferAttribute(d,g+1),E=r[2].fromBufferAttribute(d,g+2);s.subVectors(E,S),a.subVectors(b,S);const w=new Q().crossVectors(s,a).normalize();for(let T=0;T<3;T++){const C=r[T],U=c(C);U in p||(p[U]=[]),p[U].push(w)}}const m=new Float32Array(d.count*3),v=new Kt(m,3,!1);for(let x=0,_=d.count/3;x<_;x++){const g=3*x,b=r[0].fromBufferAttribute(d,g+0),S=r[1].fromBufferAttribute(d,g+1),E=r[2].fromBufferAttribute(d,g+2);s.subVectors(E,S),a.subVectors(b,S),o.crossVectors(s,a).normalize();for(let w=0;w<3;w++){const T=r[w],C=c(T),U=p[C];l.set(0,0,0);for(let D=0,R=U.length;D<R;D++){const I=U[D];o.dot(I)>t&&l.add(I)}l.normalize(),v.setXYZ(g+w,l.x,l.y,l.z)}}return f.setAttribute("normal",v),f}const M_=new Pl,w_=new Q,Wc=new Q,ts=new Q,aa=new Q,xs=new Q,oa=new Q,la=new Q,Nh=new Q,Ih=new Q,Ph=new Q,jp=new Q,zh=new Q,Fh=new Q,Bh=new Q;class kT{constructor(e,t,n){this.camera=e,this.scene=t,this.startPoint=new Q,this.endPoint=new Q,this.collection=[],this.deep=n||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(M_,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){Wc.copy(e),Wc.x=Math.min(e.x,t.x),Wc.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),ts.setFromMatrixPosition(this.camera.matrixWorld),aa.copy(Wc),xs.set(t.x,Wc.y,0),oa.copy(t),la.set(Wc.x,t.y,0),aa.unproject(this.camera),xs.unproject(this.camera),oa.unproject(this.camera),la.unproject(this.camera),zh.copy(aa).sub(ts),Fh.copy(xs).sub(ts),Bh.copy(oa).sub(ts),zh.normalize(),Fh.normalize(),Bh.normalize(),zh.multiplyScalar(this.deep),Fh.multiplyScalar(this.deep),Bh.multiplyScalar(this.deep),zh.add(ts),Fh.add(ts),Bh.add(ts);var n=M_.planes;n[0].setFromCoplanarPoints(ts,aa,xs),n[1].setFromCoplanarPoints(ts,xs,oa),n[2].setFromCoplanarPoints(oa,la,ts),n[3].setFromCoplanarPoints(la,aa,ts),n[4].setFromCoplanarPoints(xs,oa,la),n[5].setFromCoplanarPoints(Bh,Fh,zh),n[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const r=Math.min(e.x,t.x),s=Math.max(e.y,t.y),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y);aa.set(r,s,-1),xs.set(a,s,-1),oa.set(a,o,-1),la.set(r,o,-1),Nh.set(r,s,1),Ih.set(a,s,1),Ph.set(a,o,1),jp.set(r,o,1),aa.unproject(this.camera),xs.unproject(this.camera),oa.unproject(this.camera),la.unproject(this.camera),Nh.unproject(this.camera),Ih.unproject(this.camera),Ph.unproject(this.camera),jp.unproject(this.camera);var n=M_.planes;n[0].setFromCoplanarPoints(aa,Nh,Ih),n[1].setFromCoplanarPoints(xs,Ih,Ph),n[2].setFromCoplanarPoints(Ph,jp,la),n[3].setFromCoplanarPoints(jp,Nh,aa),n[4].setFromCoplanarPoints(xs,oa,la),n[5].setFromCoplanarPoints(Ph,Ih,Nh),n[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&t.material!==void 0&&(t.geometry.boundingSphere===null&&t.geometry.computeBoundingSphere(),w_.copy(t.geometry.boundingSphere.center),w_.applyMatrix4(t.matrixWorld),e.containsPoint(w_)&&this.collection.push(t)),t.children.length>0)for(let n=0;n<t.children.length;n++)this.searchChildInFrustum(e,t.children[n])}}const g3=Z.forwardRef(function({children:e,follow:t=!0,lockX:n=!1,lockY:r=!1,lockZ:s=!1,...a},o){const l=Z.useRef(null),c=Z.useRef(null),f=new _i;return s0(({camera:d})=>{if(!t||!c.current)return;const p=l.current.rotation.clone();c.current.updateMatrix(),c.current.updateWorldMatrix(!1,!1),c.current.getWorldQuaternion(f),d.getWorldQuaternion(l.current.quaternion).premultiply(f.invert()),n&&(l.current.rotation.x=p.x),r&&(l.current.rotation.y=p.y),s&&(l.current.rotation.z=p.z)}),Z.useImperativeHandle(o,()=>c.current,[]),Z.createElement("group",Il({ref:c},a),Z.createElement("group",{ref:l},e))});function c9(){var i=Object.create(null);function e(r,s){var a=r.id,o=r.name,l=r.dependencies;l===void 0&&(l=[]);var c=r.init;c===void 0&&(c=function(){});var f=r.getTransferables;if(f===void 0&&(f=null),!i[a])try{l=l.map(function(p){return p&&p.isWorkerModule&&(e(p,function(m){if(m instanceof Error)throw m}),p=i[p.id].value),p}),c=n("<"+o+">.init",c),f&&(f=n("<"+o+">.getTransferables",f));var d=null;typeof c=="function"?d=c.apply(void 0,l):console.error("worker module init function failed to rehydrate"),i[a]={id:a,value:d,getTransferables:f},s(d)}catch(p){p&&p.noLog||console.error(p),s(p)}}function t(r,s){var a,o=r.id,l=r.args;(!i[o]||typeof i[o].value!="function")&&s(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var c=(a=i[o]).value.apply(a,l);c&&typeof c.then=="function"?c.then(f,function(d){return s(d instanceof Error?d:new Error(""+d))}):f(c)}catch(d){s(d)}function f(d){try{var p=i[o].getTransferables&&i[o].getTransferables(d);(!p||!Array.isArray(p)||!p.length)&&(p=void 0),s(d,p)}catch(m){console.error(m),s(m)}}}function n(r,s){var a=void 0;self.troikaDefine=function(l){return a=l};var o=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/
3923
+ `}),[f]);return Z.createElement("group",Il({},T,{ref:L}),d&&!J&&Z.createElement("mesh",{castShadow:m,receiveShadow:v,ref:K},_||Z.createElement("planeGeometry",null),x||Z.createElement("shaderMaterial",{side:In,vertexShader:Oe.vertexShader,fragmentShader:Oe.fragmentShader})))});function wl(i,e="pointer",t="auto",n=document.body){Z.useEffect(()=>{if(i)return n.style.cursor=e,()=>void(n.style.cursor=t)},[i])}function K8(i,e,t){return Math.max(e,Math.min(i,t))}const vn={toVector(i,e){return i===void 0&&(i=e),Array.isArray(i)?i:[i,i]},add(i,e){return[i[0]+e[0],i[1]+e[1]]},sub(i,e){return[i[0]-e[0],i[1]-e[1]]},addTo(i,e){i[0]+=e[0],i[1]+=e[1]},subTo(i,e){i[0]-=e[0],i[1]-=e[1]}};function AT(i,e,t){return e===0||Math.abs(e)===1/0?Math.pow(i,t*5):i*e*t/(e+t*i)}function CT(i,e,t,n=.15){return n===0?K8(i,e,t):i<e?-AT(e-i,t-e,n)+e:i>t?+AT(i-t,t-e,n)+t:i}function J8(i,[e,t],[n,r]){const[[s,a],[o,l]]=i;return[CT(e,s,a,n),CT(t,o,l,r)]}function Q8(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function $8(i){var e=Q8(i,"string");return typeof e=="symbol"?e:String(e)}function Zn(i,e,t){return e=$8(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function RT(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Tn(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?RT(Object(t),!0).forEach(function(n){Zn(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):RT(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}const a3={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function DT(i){return i?i[0].toUpperCase()+i.slice(1):""}const e7=["enter","leave"];function t7(i=!1,e){return i&&!e7.includes(e)}function n7(i,e="",t=!1){const n=a3[i],r=n&&n[e]||e;return"on"+DT(i)+DT(r)+(t7(t,r)?"Capture":"")}const i7=["gotpointercapture","lostpointercapture"];function r7(i){let e=i.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const n=i7.includes(e)?"capturecapture":"capture",r=!!~e.indexOf(n);return r&&(e=e.replace("capture","")),{device:e,capture:r,passive:t}}function s7(i,e=""){const t=a3[i],n=t&&t[e]||e;return i+n}function y0(i){return"touches"in i}function o3(i){return y0(i)?"touch":"pointerType"in i?i.pointerType:"mouse"}function a7(i){return Array.from(i.touches).filter(e=>{var t,n;return e.target===i.currentTarget||((t=i.currentTarget)===null||t===void 0||(n=t.contains)===null||n===void 0?void 0:n.call(t,e.target))})}function o7(i){return i.type==="touchend"||i.type==="touchcancel"?i.changedTouches:i.targetTouches}function l3(i){return y0(i)?o7(i)[0]:i}function Ax(i,e){try{const t=e.clientX-i.clientX,n=e.clientY-i.clientY,r=(e.clientX+i.clientX)/2,s=(e.clientY+i.clientY)/2,a=Math.hypot(t,n);return{angle:-(Math.atan2(t,n)*180)/Math.PI,distance:a,origin:[r,s]}}catch{}return null}function l7(i){return a7(i).map(e=>e.identifier)}function UT(i,e){const[t,n]=Array.from(i.touches).filter(r=>e.includes(r.identifier));return Ax(t,n)}function E_(i){const e=l3(i);return y0(i)?e.identifier:e.pointerId}function xu(i){const e=l3(i);return[e.clientX,e.clientY]}const OT=40,LT=800;function c3(i){let{deltaX:e,deltaY:t,deltaMode:n}=i;return n===1?(e*=OT,t*=OT):n===2&&(e*=LT,t*=LT),[e,t]}function c7(i){var e,t;const{scrollX:n,scrollY:r,scrollLeft:s,scrollTop:a}=i.currentTarget;return[(e=n??s)!==null&&e!==void 0?e:0,(t=r??a)!==null&&t!==void 0?t:0]}function u7(i){const e={};if("buttons"in i&&(e.buttons=i.buttons),"shiftKey"in i){const{shiftKey:t,altKey:n,metaKey:r,ctrlKey:s}=i;Object.assign(e,{shiftKey:t,altKey:n,metaKey:r,ctrlKey:s})}return e}function xg(i,...e){return typeof i=="function"?i(...e):i}function h7(){}function f7(...i){return i.length===0?h7:i.length===1?i[0]:function(){let e;for(const t of i)e=t.apply(this,arguments)||e;return e}}function NT(i,e){return Object.assign({},e,i||{})}const d7=32;class u3{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?xg(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let s=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,u7(e)),r.down=r.pressed=r.buttons%2===1||r.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const T=t._delta.map(Math.abs);vn.addTo(t._distance,T)}this.axisIntent&&this.axisIntent(e);const[a,o]=t._movement,[l,c]=n.threshold,{_step:f,values:d}=t;if(n.hasCustomTransform?(f[0]===!1&&(f[0]=Math.abs(a)>=l&&d[0]),f[1]===!1&&(f[1]=Math.abs(o)>=c&&d[1])):(f[0]===!1&&(f[0]=Math.abs(a)>=l&&Math.sign(a)*l),f[1]===!1&&(f[1]=Math.abs(o)>=c&&Math.sign(o)*c)),t.intentional=f[0]!==!1||f[1]!==!1,!t.intentional)return;const p=[0,0];if(n.hasCustomTransform){const[T,C]=d;p[0]=f[0]!==!1?T-f[0]:0,p[1]=f[1]!==!1?C-f[1]:0}else p[0]=f[0]!==!1?a-f[0]:0,p[1]=f[1]!==!1?o-f[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(p);const m=t.offset,v=t._active&&!t._blocked||t.active;v&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=xg(n.bounds,t)),this.setup&&this.setup()),t.movement=p,this.computeOffset()));const[x,_]=t.offset,[[g,b],[S,E]]=t._bounds;t.overflow=[x<g?-1:x>b?1:0,_<S?-1:_>E?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const w=t._active?n.rubberband||[0,0]:[0,0];if(t.offset=J8(t._bounds,t.offset,w),t.delta=vn.sub(t.offset,m),this.computeMovement(),v&&(!t.last||s>d7)){t.delta=vn.sub(t.offset,m);const T=t.delta.map(Math.abs);vn.addTo(t.distance,T),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[T[0]/s,T[1]/s],t.timeDelta=s)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(Tn(Tn(Tn({},t),e),{},{[this.aliasKey]:e.values}));r!==void 0&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function p7([i,e],t){const n=Math.abs(i),r=Math.abs(e);if(n>r&&n>t)return"x";if(r>n&&r>t)return"y"}class ld extends u3{constructor(...e){super(...e),Zn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=vn.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=vn.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r=typeof n.axisThreshold=="object"?n.axisThreshold[o3(e)]:n.axisThreshold;t.axis=p7(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const m7=i=>i,IT=.15,h3={enabled(i=!0){return i},eventOptions(i,e,t){return Tn(Tn({},t.shared.eventOptions),i)},preventDefault(i=!1){return i},triggerAllEvents(i=!1){return i},rubberband(i=0){switch(i){case!0:return[IT,IT];case!1:return[0,0];default:return vn.toVector(i)}},from(i){if(typeof i=="function")return i;if(i!=null)return vn.toVector(i)},transform(i,e,t){const n=i||t.shared.transform;return this.hasCustomTransform=!!n,n||m7},threshold(i){return vn.toVector(i,0)}},g7=0,kl=Tn(Tn({},h3),{},{axis(i,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(i=g7){return i},bounds(i={}){if(typeof i=="function")return s=>kl.bounds(i(s));if("current"in i)return()=>i.current;if(typeof HTMLElement=="function"&&i instanceof HTMLElement)return i;const{left:e=-1/0,right:t=1/0,top:n=-1/0,bottom:r=1/0}=i;return[[e,t],[n,r]]}}),PT={ArrowRight:(i,e=1)=>[i*e,0],ArrowLeft:(i,e=1)=>[-1*i*e,0],ArrowUp:(i,e=1)=>[0,-1*i*e],ArrowDown:(i,e=1)=>[0,i*e]};class v7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=kl.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(r&&r.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=E_(e),n._pointerActive=!0,this.computeValues(xu(e)),this.computeInitial(),t.preventScrollAxis&&o3(e)!=="mouse"?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=E_(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;const s=xu(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=vn.sub(s,t._values),this.computeValues(s)),vn.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=E_(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[s,a]=t._distance;if(t.tap=s<=n.tapsThreshold&&a<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[o,l]=t._delta,[c,f]=t._movement,[d,p]=n.swipe.velocity,[m,v]=n.swipe.distance,x=n.swipe.duration;if(t.elapsedTime<x){const _=Math.abs(o/t.timeDelta),g=Math.abs(l/t.timeDelta);_>d&&Math.abs(c)>m&&(t.swipe[0]=Math.sign(o)),g>p&&Math.abs(f)>v&&(t.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,y7(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=PT[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,vn.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in PT&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function y7(i){"persist"in i&&typeof i.persist=="function"&&i.persist()}const cd=typeof window<"u"&&window.document&&window.document.createElement;function f3(){return cd&&"ontouchstart"in window}function _7(){return f3()||cd&&window.navigator.maxTouchPoints>1}function x7(){return cd&&"onpointerdown"in window}function b7(){return cd&&"exitPointerLock"in window.document}function S7(){try{return"constructor"in GestureEvent}catch{return!1}}const Pr={isBrowser:cd,gesture:S7(),touch:f3(),touchscreen:_7(),pointer:x7(),pointerLock:b7()},E7=250,M7=180,w7=.5,T7=50,A7=250,C7=10,zT={mouse:0,touch:0,pen:8},R7=Tn(Tn({},kl),{},{device(i,e,{pointer:{touch:t=!1,lock:n=!1,mouse:r=!1}={}}){return this.pointerLock=n&&Pr.pointerLock,Pr.touch&&t?"touch":this.pointerLock?"mouse":Pr.pointer&&!r?"pointer":Pr.touch?"touch":"mouse"},preventScrollAxis(i,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&i?E7:void 0,!(!Pr.touchscreen||t===!1))return i||(t!==void 0?"y":void 0)},pointerCapture(i,e,{pointer:{capture:t=!0,buttons:n=1,keys:r=!0}={}}){return this.pointerButtons=n,this.keys=r,!this.pointerLock&&this.device==="pointer"&&t},threshold(i,e,{filterTaps:t=!1,tapsThreshold:n=3,axis:r=void 0}){const s=vn.toVector(i,t?n:r?1:0);return this.filterTaps=t,this.tapsThreshold=n,s},swipe({velocity:i=w7,distance:e=T7,duration:t=A7}={}){return{velocity:this.transform(vn.toVector(i)),distance:this.transform(vn.toVector(e)),duration:t}},delay(i=0){switch(i){case!0:return M7;case!1:return 0;default:return i}},axisThreshold(i){return i?Tn(Tn({},zT),i):zT},keyboardDisplacement(i=C7){return i}});function d3(i){const[e,t]=i.overflow,[n,r]=i._delta,[s,a]=i._direction;(e<0&&n>0&&s<0||e>0&&n<0&&s>0)&&(i._movement[0]=i._movementBound[0]),(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(i._movement[1]=i._movementBound[1])}const D7=30,U7=100;class O7 extends u3{constructor(...e){super(...e),Zn(this,"ingKey","pinching"),Zn(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;e==="wheel"?this.state.offset=vn.add(t,n):this.state.offset=[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const r=Math.abs(t)*D7-Math.abs(n);r<0?e.axis="angle":r>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every(s=>n.has(s))||n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const r=UT(e,t._touchIds);r&&this.pinchStart(e,r)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,r=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every(a=>r.has(a))||(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const s=Ax(...Array.from(n.values()));s&&this.pinchStart(e,s)}pinchStart(e,t){const n=this.state;n.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=UT(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=Ax(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,r=n._values[1],s=t.angle-r;let a=0;Math.abs(s)>270&&(a+=Math.sign(s)),this.computeValues([t.distance,t.angle-360*a]),n.origin=t.origin,n.turns=a,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(t=>!this.ctrl.touchIds.has(t))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=vn.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(n=>e[n]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const n=this.state;n._delta=[-c3(e)[1]/U7*n.offset[0],0],vn.addTo(n._movement,n._delta),d3(n),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}}const L7=Tn(Tn({},h3),{},{device(i,e,{shared:t,pointer:{touch:n=!1}={}}){if(t.target&&!Pr.touch&&Pr.gesture)return"gesture";if(Pr.touch&&n)return"touch";if(Pr.touchscreen){if(Pr.pointer)return"pointer";if(Pr.touch)return"touch"}},bounds(i,e,{scaleBounds:t={},angleBounds:n={}}){const r=a=>{const o=NT(xg(t,a),{min:-1/0,max:1/0});return[o.min,o.max]},s=a=>{const o=NT(xg(n,a),{min:-1/0,max:1/0});return[o.min,o.max]};return typeof t!="function"&&typeof n!="function"?[r(),s()]:a=>[r(a),s(a)]},threshold(i,e,t){return this.lockDirection=t.axis==="lock",vn.toVector(i,this.lockDirection?[.1,3]:0)},modifierKey(i){return i===void 0?"ctrlKey":i},pinchOnWheel(i=!0){return i}});class N7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","moving")}move(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(xu(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=xu(e),n=this.state;n._delta=vn.sub(t,n._values),vn.addTo(n._movement,n._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}}const I7=Tn(Tn({},kl),{},{mouseOnly:(i=!0)=>i});class P7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,n=c7(e);t._delta=vn.sub(n,t._values),vn.addTo(t._movement,t._delta),this.computeValues(n),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}}const z7=kl;class F7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=c3(e),vn.addTo(t._movement,t._delta),d3(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}}const B7=kl;class k7 extends ld{constructor(...e){super(...e),Zn(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.start(e),this.computeValues(xu(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&e.pointerType!=="mouse")return;const t=this.state;if(!t._active)return;t._active=!1;const n=xu(e);t._movement=t._delta=vn.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}}const G7=Tn(Tn({},kl),{},{mouseOnly:(i=!0)=>i}),sb=new Map,Cx=new Map;function H7(i){sb.set(i.key,i.engine),Cx.set(i.key,i.resolver)}const V7={key:"drag",engine:v7,resolver:R7},W7={key:"hover",engine:k7,resolver:G7},X7={key:"move",engine:N7,resolver:I7},j7={key:"pinch",engine:O7,resolver:L7},q7={key:"scroll",engine:P7,resolver:z7},Y7={key:"wheel",engine:F7,resolver:B7};function Z7(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}function K7(i,e){if(i==null)return{};var t=Z7(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}const J7={target(i){if(i)return()=>"current"in i?i.current:i},enabled(i=!0){return i},window(i=Pr.isBrowser?window:void 0){return i},eventOptions({passive:i=!0,capture:e=!1}={}){return{passive:i,capture:e}},transform(i){return i}},Q7=["target","eventOptions","window","enabled","transform"];function fm(i={},e){const t={};for(const[n,r]of Object.entries(e))switch(typeof r){case"function":t[n]=r.call(t,i[n],n,i);break;case"object":t[n]=fm(i[n],r);break;case"boolean":r&&(t[n]=i[n]);break}return t}function $7(i,e,t={}){const n=i,{target:r,eventOptions:s,window:a,enabled:o,transform:l}=n,c=K7(n,Q7);if(t.shared=fm({target:r,eventOptions:s,window:a,enabled:o,transform:l},J7),e){const f=Cx.get(e);t[e]=fm(Tn({shared:t.shared},c),f)}else for(const f in c){const d=Cx.get(f);d&&(t[f]=fm(Tn({shared:t.shared},c[f]),d))}return t}class p3{constructor(e,t){Zn(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,s){const a=this._listeners,o=s7(t,n),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=Tn(Tn({},l),s);e.addEventListener(o,r,c);const f=()=>{e.removeEventListener(o,r,c),a.delete(f)};return a.add(f),f}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class e9{constructor(){Zn(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class t9{constructor(e){Zn(this,"gestures",new Set),Zn(this,"_targetEventStore",new p3(this)),Zn(this,"gestureEventStores",{}),Zn(this,"gestureTimeoutStores",{}),Zn(this,"handlers",{}),Zn(this,"config",{}),Zn(this,"pointerIds",new Set),Zn(this,"touchIds",new Set),Zn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),n9(this,e)}setEventIds(e){if(y0(e))return this.touchIds=new Set(l7(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=$7(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!(t.target&&(r=t.target(),!r))){if(t.enabled){for(const a of this.gestures){const o=this.config[a],l=FT(n,o.eventOptions,!!r);if(o.enabled){const c=sb.get(a);new c(this,e,a).bind(l)}}const s=FT(n,t.eventOptions,!!r);for(const a in this.nativeHandlers)s(a,"",o=>this.nativeHandlers[a](Tn(Tn({},this.state.shared),{},{event:o,args:e})),void 0,!0)}for(const s in n)n[s]=f7(...n[s]);if(!r)return n;for(const s in n){const{device:a,capture:o,passive:l}=r7(s);this._targetEventStore.add(r,a,"",n[s],{capture:o,passive:l})}}}}function Hc(i,e){i.gestures.add(e),i.gestureEventStores[e]=new p3(i,e),i.gestureTimeoutStores[e]=new e9}function n9(i,e){e.drag&&Hc(i,"drag"),e.wheel&&Hc(i,"wheel"),e.scroll&&Hc(i,"scroll"),e.move&&Hc(i,"move"),e.pinch&&Hc(i,"pinch"),e.hover&&Hc(i,"hover")}const FT=(i,e,t)=>(n,r,s,a={},o=!1)=>{var l,c;const f=(l=a.capture)!==null&&l!==void 0?l:e.capture,d=(c=a.passive)!==null&&c!==void 0?c:e.passive;let p=o?n:n7(n,r,f);t&&d&&(p+="Passive"),i[p]=i[p]||[],i[p].push(s)},i9=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function r9(i){const e={},t={},n=new Set;for(let r in i)i9.test(r)?(n.add(RegExp.lastMatch),t[r]=i[r]):e[r]=i[r];return[t,e,n]}function Vc(i,e,t,n,r,s){if(!i.has(t)||!sb.has(n))return;const a=t+"Start",o=t+"End",l=c=>{let f;return c.first&&a in e&&e[a](c),t in e&&(f=e[t](c)),c.last&&o in e&&e[o](c),f};r[n]=l,s[n]=s[n]||{}}function s9(i,e){const[t,n,r]=r9(i),s={};return Vc(r,t,"onDrag","drag",s,e),Vc(r,t,"onWheel","wheel",s,e),Vc(r,t,"onScroll","scroll",s,e),Vc(r,t,"onPinch","pinch",s,e),Vc(r,t,"onMove","move",s,e),Vc(r,t,"onHover","hover",s,e),{handlers:s,config:e,nativeHandlers:n}}function a9(i,e={},t,n){const r=uo.useMemo(()=>new t9(i),[]);if(r.applyHandlers(i,n),r.applyConfig(e,t),uo.useEffect(r.effect.bind(r)),uo.useEffect(()=>r.clean.bind(r),[]),e.target===void 0)return r.bind.bind(r)}function o9(i){return i.forEach(H7),function(t,n){const{handlers:r,nativeHandlers:s,config:a}=s9(t,n||{});return a9(r,a,void 0,s)}}function l9(i,e){return o9([V7,j7,q7,Y7,X7,W7])(i,e||{})}const Xp=(i,e)=>{const t=i[0].index!==null,n=new Set(Object.keys(i[0].attributes)),r=new Set(Object.keys(i[0].morphAttributes)),s={},a={},o=i[0].morphTargetsRelative,l=new Ct;let c=0;if(i.forEach((f,d)=>{let p=0;if(t!==(f.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let m in f.attributes){if(!n.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;s[m]===void 0&&(s[m]=[]),s[m].push(f.attributes[m]),p++}if(p!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". Make sure all geometries have the same number of attributes."),null;if(o!==f.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let m in f.morphAttributes){if(!r.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". .morphAttributes must be consistent throughout all geometries."),null;a[m]===void 0&&(a[m]=[]),a[m].push(f.morphAttributes[m])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(f.userData),e){let m;if(f.index)m=f.index.count;else if(f.attributes.position!==void 0)m=f.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,m,d),c+=m}}),t){let f=0;const d=[];i.forEach(p=>{const m=p.index;for(let v=0;v<m.count;++v)d.push(m.getX(v)+f);f+=p.attributes.position.count}),l.setIndex(d)}for(let f in s){const d=BT(s[f]);if(!d)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+f+" attribute."),null;l.setAttribute(f,d)}for(let f in a){const d=a[f][0].length;if(d===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[f]=[];for(let p=0;p<d;++p){const m=[];for(let x=0;x<a[f].length;++x)m.push(a[f][x][p]);const v=BT(m);if(!v)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+f+" morphAttribute."),null;l.morphAttributes[f].push(v)}}return l},BT=i=>{let e,t,n,r=0;if(i.forEach(s=>{if(e===void 0&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=s.itemSize),t!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=s.normalized),n!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;r+=s.array.length}),e&&t){const s=new e(r);let a=0;return i.forEach(o=>{s.set(o.array,a),a+=o.array.length}),new Kt(s,t,n)}};function c9(i,e=Math.PI/3){const t=Math.cos(e),n=(1+1e-10)*100,r=[new Q,new Q,new Q],s=new Q,a=new Q,o=new Q,l=new Q;function c(x){const _=~~(x.x*n),g=~~(x.y*n),b=~~(x.z*n);return`${_},${g},${b}`}const f=i.index?i.toNonIndexed():i,d=f.attributes.position,p={};for(let x=0,_=d.count/3;x<_;x++){const g=3*x,b=r[0].fromBufferAttribute(d,g+0),S=r[1].fromBufferAttribute(d,g+1),E=r[2].fromBufferAttribute(d,g+2);s.subVectors(E,S),a.subVectors(b,S);const w=new Q().crossVectors(s,a).normalize();for(let T=0;T<3;T++){const C=r[T],U=c(C);U in p||(p[U]=[]),p[U].push(w)}}const m=new Float32Array(d.count*3),v=new Kt(m,3,!1);for(let x=0,_=d.count/3;x<_;x++){const g=3*x,b=r[0].fromBufferAttribute(d,g+0),S=r[1].fromBufferAttribute(d,g+1),E=r[2].fromBufferAttribute(d,g+2);s.subVectors(E,S),a.subVectors(b,S),o.crossVectors(s,a).normalize();for(let w=0;w<3;w++){const T=r[w],C=c(T),U=p[C];l.set(0,0,0);for(let D=0,R=U.length;D<R;D++){const I=U[D];o.dot(I)>t&&l.add(I)}l.normalize(),v.setXYZ(g+w,l.x,l.y,l.z)}}return f.setAttribute("normal",v),f}const M_=new Pl,w_=new Q,Wc=new Q,ts=new Q,aa=new Q,xs=new Q,oa=new Q,la=new Q,Nh=new Q,Ih=new Q,Ph=new Q,jp=new Q,zh=new Q,Fh=new Q,Bh=new Q;class kT{constructor(e,t,n){this.camera=e,this.scene=t,this.startPoint=new Q,this.endPoint=new Q,this.collection=[],this.deep=n||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(M_,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){Wc.copy(e),Wc.x=Math.min(e.x,t.x),Wc.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),ts.setFromMatrixPosition(this.camera.matrixWorld),aa.copy(Wc),xs.set(t.x,Wc.y,0),oa.copy(t),la.set(Wc.x,t.y,0),aa.unproject(this.camera),xs.unproject(this.camera),oa.unproject(this.camera),la.unproject(this.camera),zh.copy(aa).sub(ts),Fh.copy(xs).sub(ts),Bh.copy(oa).sub(ts),zh.normalize(),Fh.normalize(),Bh.normalize(),zh.multiplyScalar(this.deep),Fh.multiplyScalar(this.deep),Bh.multiplyScalar(this.deep),zh.add(ts),Fh.add(ts),Bh.add(ts);var n=M_.planes;n[0].setFromCoplanarPoints(ts,aa,xs),n[1].setFromCoplanarPoints(ts,xs,oa),n[2].setFromCoplanarPoints(oa,la,ts),n[3].setFromCoplanarPoints(la,aa,ts),n[4].setFromCoplanarPoints(xs,oa,la),n[5].setFromCoplanarPoints(Bh,Fh,zh),n[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const r=Math.min(e.x,t.x),s=Math.max(e.y,t.y),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y);aa.set(r,s,-1),xs.set(a,s,-1),oa.set(a,o,-1),la.set(r,o,-1),Nh.set(r,s,1),Ih.set(a,s,1),Ph.set(a,o,1),jp.set(r,o,1),aa.unproject(this.camera),xs.unproject(this.camera),oa.unproject(this.camera),la.unproject(this.camera),Nh.unproject(this.camera),Ih.unproject(this.camera),Ph.unproject(this.camera),jp.unproject(this.camera);var n=M_.planes;n[0].setFromCoplanarPoints(aa,Nh,Ih),n[1].setFromCoplanarPoints(xs,Ih,Ph),n[2].setFromCoplanarPoints(Ph,jp,la),n[3].setFromCoplanarPoints(jp,Nh,aa),n[4].setFromCoplanarPoints(xs,oa,la),n[5].setFromCoplanarPoints(Ph,Ih,Nh),n[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&t.material!==void 0&&(t.geometry.boundingSphere===null&&t.geometry.computeBoundingSphere(),w_.copy(t.geometry.boundingSphere.center),w_.applyMatrix4(t.matrixWorld),e.containsPoint(w_)&&this.collection.push(t)),t.children.length>0)for(let n=0;n<t.children.length;n++)this.searchChildInFrustum(e,t.children[n])}}const m3=Z.forwardRef(function({children:e,follow:t=!0,lockX:n=!1,lockY:r=!1,lockZ:s=!1,...a},o){const l=Z.useRef(null),c=Z.useRef(null),f=new _i;return s0(({camera:d})=>{if(!t||!c.current)return;const p=l.current.rotation.clone();c.current.updateMatrix(),c.current.updateWorldMatrix(!1,!1),c.current.getWorldQuaternion(f),d.getWorldQuaternion(l.current.quaternion).premultiply(f.invert()),n&&(l.current.rotation.x=p.x),r&&(l.current.rotation.y=p.y),s&&(l.current.rotation.z=p.z)}),Z.useImperativeHandle(o,()=>c.current,[]),Z.createElement("group",Il({ref:c},a),Z.createElement("group",{ref:l},e))});function u9(){var i=Object.create(null);function e(r,s){var a=r.id,o=r.name,l=r.dependencies;l===void 0&&(l=[]);var c=r.init;c===void 0&&(c=function(){});var f=r.getTransferables;if(f===void 0&&(f=null),!i[a])try{l=l.map(function(p){return p&&p.isWorkerModule&&(e(p,function(m){if(m instanceof Error)throw m}),p=i[p.id].value),p}),c=n("<"+o+">.init",c),f&&(f=n("<"+o+">.getTransferables",f));var d=null;typeof c=="function"?d=c.apply(void 0,l):console.error("worker module init function failed to rehydrate"),i[a]={id:a,value:d,getTransferables:f},s(d)}catch(p){p&&p.noLog||console.error(p),s(p)}}function t(r,s){var a,o=r.id,l=r.args;(!i[o]||typeof i[o].value!="function")&&s(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var c=(a=i[o]).value.apply(a,l);c&&typeof c.then=="function"?c.then(f,function(d){return s(d instanceof Error?d:new Error(""+d))}):f(c)}catch(d){s(d)}function f(d){try{var p=i[o].getTransferables&&i[o].getTransferables(d);(!p||!Array.isArray(p)||!p.length)&&(p=void 0),s(d,p)}catch(m){console.error(m),s(m)}}}function n(r,s){var a=void 0;self.troikaDefine=function(l){return a=l};var o=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/
3924
3924
 
3925
3925
  troikaDefine(
3926
3926
  `+s+`
3927
- )`],{type:"application/javascript"}));try{importScripts(o)}catch(l){console.error(l)}return URL.revokeObjectURL(o),delete self.troikaDefine,a}self.addEventListener("message",function(r){var s=r.data,a=s.messageId,o=s.action,l=s.data;try{o==="registerModule"&&e(l,function(c){c instanceof Error?postMessage({messageId:a,success:!1,error:c.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof c=="function"}})}),o==="callModule"&&t(l,function(c,f){c instanceof Error?postMessage({messageId:a,success:!1,error:c.message}):postMessage({messageId:a,success:!0,result:c},f||void 0)})}catch(c){postMessage({messageId:a,success:!1,error:c.stack})}})}function u9(i){var e=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return e._getInitResult().then(function(r){if(typeof r=="function")return r.apply(void 0,t);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var t=i.dependencies,n=i.init;t=Array.isArray(t)?t.map(function(s){return s&&(s=s.onMainThread||s,s._getInitResult&&(s=s._getInitResult())),s}):[];var r=Promise.all(t).then(function(s){return n.apply(null,s)});return e._getInitResult=function(){return r},r},e}var v3=function(){var i=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),i=!0}catch(t){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return v3=function(){return i},i},h9=0,f9=0,T_=!1,pf=Object.create(null),mf=Object.create(null),Rx=Object.create(null);function Uu(i){if((!i||typeof i.init!="function")&&!T_)throw new Error("requires `options.init` function");var e=i.dependencies,t=i.init,n=i.getTransferables,r=i.workerId,s=u9(i);r==null&&(r="#default");var a="workerModule"+ ++h9,o=i.name||a,l=null;e=e&&e.map(function(f){return typeof f=="function"&&!f.workerModuleData&&(T_=!0,f=Uu({workerId:r,name:"<"+o+"> function dependency: "+f.name,init:`function(){return (
3927
+ )`],{type:"application/javascript"}));try{importScripts(o)}catch(l){console.error(l)}return URL.revokeObjectURL(o),delete self.troikaDefine,a}self.addEventListener("message",function(r){var s=r.data,a=s.messageId,o=s.action,l=s.data;try{o==="registerModule"&&e(l,function(c){c instanceof Error?postMessage({messageId:a,success:!1,error:c.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof c=="function"}})}),o==="callModule"&&t(l,function(c,f){c instanceof Error?postMessage({messageId:a,success:!1,error:c.message}):postMessage({messageId:a,success:!0,result:c},f||void 0)})}catch(c){postMessage({messageId:a,success:!1,error:c.stack})}})}function h9(i){var e=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return e._getInitResult().then(function(r){if(typeof r=="function")return r.apply(void 0,t);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var t=i.dependencies,n=i.init;t=Array.isArray(t)?t.map(function(s){return s&&(s=s.onMainThread||s,s._getInitResult&&(s=s._getInitResult())),s}):[];var r=Promise.all(t).then(function(s){return n.apply(null,s)});return e._getInitResult=function(){return r},r},e}var g3=function(){var i=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),i=!0}catch(t){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return g3=function(){return i},i},f9=0,d9=0,T_=!1,pf=Object.create(null),mf=Object.create(null),Rx=Object.create(null);function Uu(i){if((!i||typeof i.init!="function")&&!T_)throw new Error("requires `options.init` function");var e=i.dependencies,t=i.init,n=i.getTransferables,r=i.workerId,s=h9(i);r==null&&(r="#default");var a="workerModule"+ ++f9,o=i.name||a,l=null;e=e&&e.map(function(f){return typeof f=="function"&&!f.workerModuleData&&(T_=!0,f=Uu({workerId:r,name:"<"+o+"> function dependency: "+f.name,init:`function(){return (
3928
3928
  `+dm(f)+`
3929
- )}`}),T_=!1),f&&f.workerModuleData&&(f=f.workerModuleData),f});function c(){for(var f=[],d=arguments.length;d--;)f[d]=arguments[d];if(!v3())return s.apply(void 0,f);if(!l){l=GT(r,"registerModule",c.workerModuleData);var p=function(){l=null,mf[r].delete(p)};(mf[r]||(mf[r]=new Set)).add(p)}return l.then(function(m){var v=m.isCallable;if(v)return GT(r,"callModule",{id:a,args:f});throw new Error("Worker module function was called but `init` did not return a callable function")})}return c.workerModuleData={isWorkerModule:!0,id:a,name:o,dependencies:e,init:dm(t),getTransferables:n&&dm(n)},c.onMainThread=s,c}function d9(i){mf[i]&&mf[i].forEach(function(e){e()}),pf[i]&&(pf[i].terminate(),delete pf[i])}function dm(i){var e=i.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function p9(i){var e=pf[i];if(!e){var t=dm(c9);e=pf[i]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+i.replace(/\*/g,"")+` **/
3929
+ )}`}),T_=!1),f&&f.workerModuleData&&(f=f.workerModuleData),f});function c(){for(var f=[],d=arguments.length;d--;)f[d]=arguments[d];if(!g3())return s.apply(void 0,f);if(!l){l=GT(r,"registerModule",c.workerModuleData);var p=function(){l=null,mf[r].delete(p)};(mf[r]||(mf[r]=new Set)).add(p)}return l.then(function(m){var v=m.isCallable;if(v)return GT(r,"callModule",{id:a,args:f});throw new Error("Worker module function was called but `init` did not return a callable function")})}return c.workerModuleData={isWorkerModule:!0,id:a,name:o,dependencies:e,init:dm(t),getTransferables:n&&dm(n)},c.onMainThread=s,c}function p9(i){mf[i]&&mf[i].forEach(function(e){e()}),pf[i]&&(pf[i].terminate(),delete pf[i])}function dm(i){var e=i.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function m9(i){var e=pf[i];if(!e){var t=dm(u9);e=pf[i]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+i.replace(/\*/g,"")+` **/
3930
3930
 
3931
- ;(`+t+")()"],{type:"application/javascript"}))),e.onmessage=function(n){var r=n.data,s=r.messageId,a=Rx[s];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete Rx[s],a(r)}}return e}function GT(i,e,t){return new Promise(function(n,r){var s=++f9;Rx[s]=function(a){a.success?n(a.result):r(new Error("Error in worker "+e+" call: "+a.error))},p9(i).postMessage({messageId:s,action:e,data:t})})}function y3(){var i=function(e){function t(H,W,F,Y,K,j,J,he){var re=1-J;he.x=re*re*H+2*re*J*F+J*J*K,he.y=re*re*W+2*re*J*Y+J*J*j}function n(H,W,F,Y,K,j,J,he,re,pe){var Oe=1-re;pe.x=Oe*Oe*Oe*H+3*Oe*Oe*re*F+3*Oe*re*re*K+re*re*re*J,pe.y=Oe*Oe*Oe*W+3*Oe*Oe*re*Y+3*Oe*re*re*j+re*re*re*he}function r(H,W){for(var F=/([MLQCZ])([^MLQCZ]*)/g,Y,K,j,J,he;Y=F.exec(H);){var re=Y[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(pe){return parseFloat(pe)});switch(Y[1]){case"M":J=K=re[0],he=j=re[1];break;case"L":(re[0]!==J||re[1]!==he)&&W("L",J,he,J=re[0],he=re[1]);break;case"Q":{W("Q",J,he,J=re[2],he=re[3],re[0],re[1]);break}case"C":{W("C",J,he,J=re[4],he=re[5],re[0],re[1],re[2],re[3]);break}case"Z":(J!==K||he!==j)&&W("L",J,he,K,j);break}}}function s(H,W,F){F===void 0&&(F=16);var Y={x:0,y:0};r(H,function(K,j,J,he,re,pe,Oe,be,ve){switch(K){case"L":W(j,J,he,re);break;case"Q":{for(var ce=j,Ne=J,G=1;G<F;G++)t(j,J,pe,Oe,he,re,G/(F-1),Y),W(ce,Ne,Y.x,Y.y),ce=Y.x,Ne=Y.y;break}case"C":{for(var le=j,te=J,Me=1;Me<F;Me++)n(j,J,pe,Oe,be,ve,he,re,Me/(F-1),Y),W(le,te,Y.x,Y.y),le=Y.x,te=Y.y;break}}})}var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",o="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",l=new WeakMap,c={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function f(H,W){var F=H.getContext?H.getContext("webgl",c):H,Y=l.get(F);if(!Y){let Oe=function(le){var te=j[le];if(!te&&(te=j[le]=F.getExtension(le),!te))throw new Error(le+" not supported");return te},be=function(le,te){var Me=F.createShader(te);return F.shaderSource(Me,le),F.compileShader(Me),Me},ve=function(le,te,Me,oe){if(!J[le]){var De={},_e={},ne=F.createProgram();F.attachShader(ne,be(te,F.VERTEX_SHADER)),F.attachShader(ne,be(Me,F.FRAGMENT_SHADER)),F.linkProgram(ne),J[le]={program:ne,transaction:function(X){F.useProgram(ne),X({setUniform:function(ie,Se){for(var ge=[],me=arguments.length-2;me-- >0;)ge[me]=arguments[me+2];var Fe=_e[Se]||(_e[Se]=F.getUniformLocation(ne,Se));F["uniform"+ie].apply(F,[Fe].concat(ge))},setAttribute:function(ie,Se,ge,me,Fe){var Ie=De[ie];Ie||(Ie=De[ie]={buf:F.createBuffer(),loc:F.getAttribLocation(ne,ie),data:null}),F.bindBuffer(F.ARRAY_BUFFER,Ie.buf),F.vertexAttribPointer(Ie.loc,Se,F.FLOAT,!1,0,0),F.enableVertexAttribArray(Ie.loc),K?F.vertexAttribDivisor(Ie.loc,me):Oe("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Ie.loc,me),Fe!==Ie.data&&(F.bufferData(F.ARRAY_BUFFER,Fe,ge),Ie.data=Fe)}})}}}J[le].transaction(oe)},ce=function(le,te){re++;try{F.activeTexture(F.TEXTURE0+re);var Me=he[le];Me||(Me=he[le]=F.createTexture(),F.bindTexture(F.TEXTURE_2D,Me),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MIN_FILTER,F.NEAREST),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MAG_FILTER,F.NEAREST)),F.bindTexture(F.TEXTURE_2D,Me),te(Me,re)}finally{re--}},Ne=function(le,te,Me){var oe=F.createFramebuffer();pe.push(oe),F.bindFramebuffer(F.FRAMEBUFFER,oe),F.activeTexture(F.TEXTURE0+te),F.bindTexture(F.TEXTURE_2D,le),F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,le,0);try{Me(oe)}finally{F.deleteFramebuffer(oe),F.bindFramebuffer(F.FRAMEBUFFER,pe[--pe.length-1]||null)}},G=function(){j={},J={},he={},re=-1,pe.length=0};var K=typeof WebGL2RenderingContext<"u"&&F instanceof WebGL2RenderingContext,j={},J={},he={},re=-1,pe=[];F.canvas.addEventListener("webglcontextlost",function(le){G(),le.preventDefault()},!1),l.set(F,Y={gl:F,isWebGL2:K,getExtension:Oe,withProgram:ve,withTexture:ce,withTextureFramebuffer:Ne,handleContextLoss:G})}W(Y)}function d(H,W,F,Y,K,j,J,he){J===void 0&&(J=15),he===void 0&&(he=null),f(H,function(re){var pe=re.gl,Oe=re.withProgram,be=re.withTexture;be("copy",function(ve,ce){pe.texImage2D(pe.TEXTURE_2D,0,pe.RGBA,K,j,0,pe.RGBA,pe.UNSIGNED_BYTE,W),Oe("copy",a,o,function(Ne){var G=Ne.setUniform,le=Ne.setAttribute;le("aUV",2,pe.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),G("1i","image",ce),pe.bindFramebuffer(pe.FRAMEBUFFER,he||null),pe.disable(pe.BLEND),pe.colorMask(J&8,J&4,J&2,J&1),pe.viewport(F,Y,K,j),pe.scissor(F,Y,K,j),pe.drawArrays(pe.TRIANGLES,0,3)})})})}function p(H,W,F){var Y=H.width,K=H.height;f(H,function(j){var J=j.gl,he=new Uint8Array(Y*K*4);J.readPixels(0,0,Y,K,J.RGBA,J.UNSIGNED_BYTE,he),H.width=W,H.height=F,d(J,he,0,0,Y,K)})}var m=Object.freeze({__proto__:null,withWebGLContext:f,renderImageData:d,resizeWebGLCanvasWithoutClearing:p});function v(H,W,F,Y,K,j){j===void 0&&(j=1);var J=new Uint8Array(H*W),he=Y[2]-Y[0],re=Y[3]-Y[1],pe=[];s(F,function(le,te,Me,oe){pe.push({x1:le,y1:te,x2:Me,y2:oe,minX:Math.min(le,Me),minY:Math.min(te,oe),maxX:Math.max(le,Me),maxY:Math.max(te,oe)})}),pe.sort(function(le,te){return le.maxX-te.maxX});for(var Oe=0;Oe<H;Oe++)for(var be=0;be<W;be++){var ve=Ne(Y[0]+he*(Oe+.5)/H,Y[1]+re*(be+.5)/W),ce=Math.pow(1-Math.abs(ve)/K,j)/2;ve<0&&(ce=1-ce),ce=Math.max(0,Math.min(255,Math.round(ce*255))),J[be*H+Oe]=ce}return J;function Ne(le,te){for(var Me=1/0,oe=1/0,De=pe.length;De--;){var _e=pe[De];if(_e.maxX+oe<=le)break;if(le+oe>_e.minX&&te-oe<_e.maxY&&te+oe>_e.minY){var ne=g(le,te,_e.x1,_e.y1,_e.x2,_e.y2);ne<Me&&(Me=ne,oe=Math.sqrt(Me))}}return G(le,te)&&(oe=-oe),oe}function G(le,te){for(var Me=0,oe=pe.length;oe--;){var De=pe[oe];if(De.maxX<=le)break;var _e=De.y1>te!=De.y2>te&&le<(De.x2-De.x1)*(te-De.y1)/(De.y2-De.y1)+De.x1;_e&&(Me+=De.y1<De.y2?1:-1)}return Me!==0}}function x(H,W,F,Y,K,j,J,he,re,pe){j===void 0&&(j=1),he===void 0&&(he=0),re===void 0&&(re=0),pe===void 0&&(pe=0),_(H,W,F,Y,K,j,J,null,he,re,pe)}function _(H,W,F,Y,K,j,J,he,re,pe,Oe){j===void 0&&(j=1),re===void 0&&(re=0),pe===void 0&&(pe=0),Oe===void 0&&(Oe=0);for(var be=v(H,W,F,Y,K,j),ve=new Uint8Array(be.length*4),ce=0;ce<be.length;ce++)ve[ce*4+Oe]=be[ce];d(J,ve,re,pe,H,W,1<<3-Oe,he)}function g(H,W,F,Y,K,j){var J=K-F,he=j-Y,re=J*J+he*he,pe=re?Math.max(0,Math.min(1,((H-F)*J+(W-Y)*he)/re)):0,Oe=H-(F+pe*J),be=W-(Y+pe*he);return Oe*Oe+be*be}var b=Object.freeze({__proto__:null,generate:v,generateIntoCanvas:x,generateIntoFramebuffer:_}),S="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",E="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",w="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",T=new Float32Array([0,0,2,0,0,2]),C=null,U=!1,D={},R=new WeakMap;function I(H){if(!U&&!ee(H))throw new Error("WebGL generation not supported")}function z(H,W,F,Y,K,j,J){if(j===void 0&&(j=1),J===void 0&&(J=null),!J&&(J=C,!J)){var he=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!he)throw new Error("OffscreenCanvas or DOM canvas not supported");J=C=he.getContext("webgl",{depth:!1})}I(J);var re=new Uint8Array(H*W*4);f(J,function(ve){var ce=ve.gl,Ne=ve.withTexture,G=ve.withTextureFramebuffer;Ne("readable",function(le,te){ce.texImage2D(ce.TEXTURE_2D,0,ce.RGBA,H,W,0,ce.RGBA,ce.UNSIGNED_BYTE,null),G(le,te,function(Me){V(H,W,F,Y,K,j,ce,Me,0,0,0),ce.readPixels(0,0,H,W,ce.RGBA,ce.UNSIGNED_BYTE,re)})})});for(var pe=new Uint8Array(H*W),Oe=0,be=0;Oe<re.length;Oe+=4)pe[be++]=re[Oe];return pe}function O(H,W,F,Y,K,j,J,he,re,pe){j===void 0&&(j=1),he===void 0&&(he=0),re===void 0&&(re=0),pe===void 0&&(pe=0),V(H,W,F,Y,K,j,J,null,he,re,pe)}function V(H,W,F,Y,K,j,J,he,re,pe,Oe){j===void 0&&(j=1),re===void 0&&(re=0),pe===void 0&&(pe=0),Oe===void 0&&(Oe=0),I(J);var be=[];s(F,function(ve,ce,Ne,G){be.push(ve,ce,Ne,G)}),be=new Float32Array(be),f(J,function(ve){var ce=ve.gl,Ne=ve.isWebGL2,G=ve.getExtension,le=ve.withProgram,te=ve.withTexture,Me=ve.withTextureFramebuffer,oe=ve.handleContextLoss;if(te("rawDistances",function(De,_e){(H!==De._lastWidth||W!==De._lastHeight)&&ce.texImage2D(ce.TEXTURE_2D,0,ce.RGBA,De._lastWidth=H,De._lastHeight=W,0,ce.RGBA,ce.UNSIGNED_BYTE,null),le("main",S,E,function(ne){var Be=ne.setAttribute,X=ne.setUniform,B=!Ne&&G("ANGLE_instanced_arrays"),ie=!Ne&&G("EXT_blend_minmax");Be("aUV",2,ce.STATIC_DRAW,0,T),Be("aLineSegment",4,ce.DYNAMIC_DRAW,1,be),X.apply(void 0,["4f","uGlyphBounds"].concat(Y)),X("1f","uMaxDistance",K),X("1f","uExponent",j),Me(De,_e,function(Se){ce.enable(ce.BLEND),ce.colorMask(!0,!0,!0,!0),ce.viewport(0,0,H,W),ce.scissor(0,0,H,W),ce.blendFunc(ce.ONE,ce.ONE),ce.blendEquationSeparate(ce.FUNC_ADD,Ne?ce.MAX:ie.MAX_EXT),ce.clear(ce.COLOR_BUFFER_BIT),Ne?ce.drawArraysInstanced(ce.TRIANGLES,0,3,be.length/4):B.drawArraysInstancedANGLE(ce.TRIANGLES,0,3,be.length/4)})}),le("post",a,w,function(ne){ne.setAttribute("aUV",2,ce.STATIC_DRAW,0,T),ne.setUniform("1i","tex",_e),ce.bindFramebuffer(ce.FRAMEBUFFER,he),ce.disable(ce.BLEND),ce.colorMask(Oe===0,Oe===1,Oe===2,Oe===3),ce.viewport(re,pe,H,W),ce.scissor(re,pe,H,W),ce.drawArrays(ce.TRIANGLES,0,3)})}),ce.isContextLost())throw oe(),new Error("webgl context lost")})}function ee(H){var W=!H||H===C?D:H.canvas||H,F=R.get(W);if(F===void 0){U=!0;var Y=null;try{var K=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],j=z(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,H);F=j&&K.length===j.length&&j.every(function(J,he){return J===K[he]}),F||(Y="bad trial run results",console.info(K,j))}catch(J){F=!1,Y=J.message}Y&&console.warn("WebGL SDF generation not supported:",Y),U=!1,R.set(W,F)}return F}var P=Object.freeze({__proto__:null,generate:z,generateIntoCanvas:O,generateIntoFramebuffer:V,isSupported:ee});function L(H,W,F,Y,K,j){K===void 0&&(K=Math.max(Y[2]-Y[0],Y[3]-Y[1])/2),j===void 0&&(j=1);try{return z.apply(P,arguments)}catch(J){return console.info("WebGL SDF generation failed, falling back to JS",J),v.apply(b,arguments)}}function k(H,W,F,Y,K,j,J,he,re,pe){K===void 0&&(K=Math.max(Y[2]-Y[0],Y[3]-Y[1])/2),j===void 0&&(j=1),he===void 0&&(he=0),re===void 0&&(re=0),pe===void 0&&(pe=0);try{return O.apply(P,arguments)}catch(Oe){return console.info("WebGL SDF generation failed, falling back to JS",Oe),x.apply(b,arguments)}}return e.forEachPathCommand=r,e.generate=L,e.generateIntoCanvas=k,e.javascript=b,e.pathToLineSegments=s,e.webgl=P,e.webglUtils=m,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return i}function m9(){var i=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},n={},r={};n.L=1,r[1]="L",Object.keys(t).forEach(function(oe,De){n[oe]=1<<De+1,r[n[oe]]=oe}),Object.freeze(n);var s=n.LRI|n.RLI|n.FSI,a=n.L|n.R|n.AL,o=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,l=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,c=n.S|n.WS|n.B|s|n.PDI|l,f=null;function d(){if(!f){f=new Map;var oe=function(_e){if(t.hasOwnProperty(_e)){var ne=0;t[_e].split(",").forEach(function(Be){var X=Be.split("+"),B=X[0],ie=X[1];B=parseInt(B,36),ie=ie?parseInt(ie,36):0,f.set(ne+=B,n[_e]);for(var Se=0;Se<ie;Se++)f.set(++ne,n[_e])})}};for(var De in t)oe(De)}}function p(oe){return d(),f.get(oe.codePointAt(0))||n.L}function m(oe){return r[p(oe)]}var v={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function x(oe,De){var _e=36,ne=0,Be=new Map,X=De&&new Map,B;return oe.split(",").forEach(function ie(Se){if(Se.indexOf("+")!==-1)for(var ge=+Se;ge--;)ie(B);else{B=Se;var me=Se.split(">"),Fe=me[0],Ie=me[1];Fe=String.fromCodePoint(ne+=parseInt(Fe,_e)),Ie=String.fromCodePoint(ne+=parseInt(Ie,_e)),Be.set(Fe,Ie),De&&X.set(Ie,Fe)}}),{map:Be,reverseMap:X}}var _,g,b;function S(){if(!_){var oe=x(v.pairs,!0),De=oe.map,_e=oe.reverseMap;_=De,g=_e,b=x(v.canonical,!1).map}}function E(oe){return S(),_.get(oe)||null}function w(oe){return S(),g.get(oe)||null}function T(oe){return S(),b.get(oe)||null}var C=n.L,U=n.R,D=n.EN,R=n.ES,I=n.ET,z=n.AN,O=n.CS,V=n.B,ee=n.S,P=n.ON,L=n.BN,k=n.NSM,H=n.AL,W=n.LRO,F=n.RLO,Y=n.LRE,K=n.RLE,j=n.PDF,J=n.LRI,he=n.RLI,re=n.FSI,pe=n.PDI;function Oe(oe,De){for(var _e=125,ne=new Uint32Array(oe.length),Be=0;Be<oe.length;Be++)ne[Be]=p(oe[Be]);var X=new Map;function B(pi,qi){var Wn=ne[pi];ne[pi]=qi,X.set(Wn,X.get(Wn)-1),Wn&o&&X.set(o,X.get(o)-1),X.set(qi,(X.get(qi)||0)+1),qi&o&&X.set(o,(X.get(o)||0)+1)}for(var ie=new Uint8Array(oe.length),Se=new Map,ge=[],me=null,Fe=0;Fe<oe.length;Fe++)me||ge.push(me={start:Fe,end:oe.length-1,level:De==="rtl"?1:De==="ltr"?0:Gu(Fe,!1)}),ne[Fe]&V&&(me.end=Fe,me=null);for(var Ie=K|Y|F|W|s|pe|j|V,je=function(pi){return pi+(pi&1?1:2)},Ze=function(pi){return pi+(pi&1?2:1)},Ce=0;Ce<ge.length;Ce++){me=ge[Ce];var He=[{_level:me.level,_override:0,_isolate:0}],Ve=void 0,nt=0,We=0,ft=0;X.clear();for(var se=me.start;se<=me.end;se++){var ze=ne[se];if(Ve=He[He.length-1],X.set(ze,(X.get(ze)||0)+1),ze&o&&X.set(o,(X.get(o)||0)+1),ze&Ie)if(ze&(K|Y)){ie[se]=Ve._level;var Le=(ze===K?Ze:je)(Ve._level);Le<=_e&&!nt&&!We?He.push({_level:Le,_override:0,_isolate:0}):nt||We++}else if(ze&(F|W)){ie[se]=Ve._level;var rt=(ze===F?Ze:je)(Ve._level);rt<=_e&&!nt&&!We?He.push({_level:rt,_override:ze&F?U:C,_isolate:0}):nt||We++}else if(ze&s){ze&re&&(ze=Gu(se+1,!0)===1?he:J),ie[se]=Ve._level,Ve._override&&B(se,Ve._override);var Pe=(ze===he?Ze:je)(Ve._level);Pe<=_e&&nt===0&&We===0?(ft++,He.push({_level:Pe,_override:0,_isolate:1,_isolInitIndex:se})):nt++}else if(ze&pe){if(nt>0)nt--;else if(ft>0){for(We=0;!He[He.length-1]._isolate;)He.pop();var Re=He[He.length-1]._isolInitIndex;Re!=null&&(Se.set(Re,se),Se.set(se,Re)),He.pop(),ft--}Ve=He[He.length-1],ie[se]=Ve._level,Ve._override&&B(se,Ve._override)}else ze&j?(nt===0&&(We>0?We--:!Ve._isolate&&He.length>1&&(He.pop(),Ve=He[He.length-1])),ie[se]=Ve._level):ze&V&&(ie[se]=me.level);else ie[se]=Ve._level,Ve._override&&ze!==L&&B(se,Ve._override)}for(var Ke=[],st=null,at=me.start;at<=me.end;at++){var mt=ne[at];if(!(mt&l)){var Jt=ie[at],tn=mt&s,mn=mt===pe;st&&Jt===st._level?(st._end=at,st._endsWithIsolInit=tn):Ke.push(st={_start:at,_end:at,_level:Jt,_startsWithPDI:mn,_endsWithIsolInit:tn})}}for(var oi=[],kn=0;kn<Ke.length;kn++){var Cn=Ke[kn];if(!Cn._startsWithPDI||Cn._startsWithPDI&&!Se.has(Cn._start)){for(var Vi=[st=Cn],$n=void 0;st&&st._endsWithIsolInit&&($n=Se.get(st._end))!=null;)for(var yn=kn+1;yn<Ke.length;yn++)if(Ke[yn]._start===$n){Vi.push(st=Ke[yn]);break}for(var xn=[],Ht=0;Ht<Vi.length;Ht++)for(var Ls=Vi[Ht],hs=Ls._start;hs<=Ls._end;hs++)xn.push(hs);for(var Gl=ie[xn[0]],bo=me.level,Ra=xn[0]-1;Ra>=0;Ra--)if(!(ne[Ra]&l)){bo=ie[Ra];break}var Ns=xn[xn.length-1],So=ie[Ns],Da=me.level;if(!(ne[Ns]&s)){for(var q=Ns+1;q<=me.end;q++)if(!(ne[q]&l)){Da=ie[q];break}}oi.push({_seqIndices:xn,_sosType:Math.max(bo,Gl)%2?U:C,_eosType:Math.max(Da,So)%2?U:C})}}for(var de=0;de<oi.length;de++){var we=oi[de],fe=we._seqIndices,ye=we._sosType,Xe=we._eosType,Je=ie[fe[0]]&1?U:C;if(X.get(k))for(var ut=0;ut<fe.length;ut++){var lt=fe[ut];if(ne[lt]&k){for(var yt=ye,_t=ut-1;_t>=0;_t--)if(!(ne[fe[_t]]&l)){yt=ne[fe[_t]];break}B(lt,yt&(s|pe)?P:yt)}}if(X.get(D))for(var pt=0;pt<fe.length;pt++){var Ot=fe[pt];if(ne[Ot]&D)for(var zt=pt-1;zt>=-1;zt--){var nn=zt===-1?ye:ne[fe[zt]];if(nn&a){nn===H&&B(Ot,z);break}}}if(X.get(H))for(var Qt=0;Qt<fe.length;Qt++){var Pt=fe[Qt];ne[Pt]&H&&B(Pt,U)}if(X.get(R)||X.get(O))for(var gt=1;gt<fe.length-1;gt++){var _n=fe[gt];if(ne[_n]&(R|O)){for(var Nt=0,li=0,Wi=gt-1;Wi>=0&&(Nt=ne[fe[Wi]],!!(Nt&l));Wi--);for(var Gn=gt+1;Gn<fe.length&&(li=ne[fe[Gn]],!!(li&l));Gn++);Nt===li&&(ne[_n]===R?Nt===D:Nt&(D|z))&&B(_n,Nt)}}if(X.get(D))for(var ei=0;ei<fe.length;ei++){var rn=fe[ei];if(ne[rn]&D){for(var Hn=ei-1;Hn>=0&&ne[fe[Hn]]&(I|l);Hn--)B(fe[Hn],D);for(ei++;ei<fe.length&&ne[fe[ei]]&(I|l|D);ei++)ne[fe[ei]]!==D&&B(fe[ei],D)}}if(X.get(I)||X.get(R)||X.get(O))for(var zn=0;zn<fe.length;zn++){var Vn=fe[zn];if(ne[Vn]&(I|R|O)){B(Vn,P);for(var Rn=zn-1;Rn>=0&&ne[fe[Rn]]&l;Rn--)B(fe[Rn],P);for(var Li=zn+1;Li<fe.length&&ne[fe[Li]]&l;Li++)B(fe[Li],P)}}if(X.get(D))for(var Xi=0,Eo=ye;Xi<fe.length;Xi++){var Mo=fe[Xi],Hl=ne[Mo];Hl&D?Eo===C&&B(Mo,C):Hl&a&&(Eo=Hl)}if(X.get(o)){var Is=U|D|z,Lu=Is|C,wo=[];{for(var Ps=[],zs=0;zs<fe.length;zs++)if(ne[fe[zs]]&o){var Fs=oe[fe[zs]],Nu=void 0;if(E(Fs)!==null)if(Ps.length<63)Ps.push({char:Fs,seqIndex:zs});else break;else if((Nu=w(Fs))!==null)for(var Ua=Ps.length-1;Ua>=0;Ua--){var To=Ps[Ua].char;if(To===Nu||To===w(T(Fs))||E(T(To))===Fs){wo.push([Ps[Ua].seqIndex,zs]),Ps.length=Ua;break}}}wo.sort(function(pi,qi){return pi[0]-qi[0]})}for(var Vl=0;Vl<wo.length;Vl++){for(var Iu=wo[Vl],Ao=Iu[0],Co=Iu[1],Pu=!1,ji=0,zu=Ao+1;zu<Co;zu++){var ud=fe[zu];if(ne[ud]&Lu){Pu=!0;var Fu=ne[ud]&Is?U:C;if(Fu===Je){ji=Fu;break}}}if(Pu&&!ji){ji=ye;for(var Bs=Ao-1;Bs>=0;Bs--){var Wl=fe[Bs];if(ne[Wl]&Lu){var Ro=ne[Wl]&Is?U:C;Ro!==Je?ji=Ro:ji=Je;break}}}if(ji){if(ne[fe[Ao]]=ne[fe[Co]]=ji,ji!==Je){for(var Oa=Ao+1;Oa<fe.length;Oa++)if(!(ne[fe[Oa]]&l)){p(oe[fe[Oa]])&k&&(ne[fe[Oa]]=ji);break}}if(ji!==Je){for(var La=Co+1;La<fe.length;La++)if(!(ne[fe[La]]&l)){p(oe[fe[La]])&k&&(ne[fe[La]]=ji);break}}}}for(var br=0;br<fe.length;br++)if(ne[fe[br]]&o){for(var Bu=br,Xl=br,Xr=ye,fs=br-1;fs>=0;fs--)if(ne[fe[fs]]&l)Bu=fs;else{Xr=ne[fe[fs]]&Is?U:C;break}for(var ku=Xe,ks=br+1;ks<fe.length;ks++)if(ne[fe[ks]]&(o|l))Xl=ks;else{ku=ne[fe[ks]]&Is?U:C;break}for(var jl=Bu;jl<=Xl;jl++)ne[fe[jl]]=Xr===ku?Xr:Je;br=Xl}}}for(var bi=me.start;bi<=me.end;bi++){var b0=ie[bi],Dn=ne[bi];if(b0&1?Dn&(C|D|z)&&ie[bi]++:Dn&U?ie[bi]++:Dn&(z|D)&&(ie[bi]+=2),Dn&l&&(ie[bi]=bi===0?me.level:ie[bi-1]),bi===me.end||p(oe[bi])&(ee|V))for(var Do=bi;Do>=0&&p(oe[Do])&c;Do--)ie[Do]=me.level}}return{levels:ie,paragraphs:ge};function Gu(pi,qi){for(var Wn=pi;Wn<oe.length;Wn++){var Sr=ne[Wn];if(Sr&(U|H))return 1;if(Sr&(V|C)||qi&&Sr===pe)return 0;if(Sr&s){var Hu=hd(Wn);Wn=Hu===-1?oe.length:Hu}}return 0}function hd(pi){for(var qi=1,Wn=pi+1;Wn<oe.length;Wn++){var Sr=ne[Wn];if(Sr&V)break;if(Sr&pe){if(--qi===0)return Wn}else Sr&s&&qi++}return-1}}var be="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",ve;function ce(){if(!ve){var oe=x(be,!0),De=oe.map,_e=oe.reverseMap;_e.forEach(function(ne,Be){De.set(Be,ne)}),ve=De}}function Ne(oe){return ce(),ve.get(oe)||null}function G(oe,De,_e,ne){var Be=oe.length;_e=Math.max(0,_e==null?0:+_e),ne=Math.min(Be-1,ne==null?Be-1:+ne);for(var X=new Map,B=_e;B<=ne;B++)if(De[B]&1){var ie=Ne(oe[B]);ie!==null&&X.set(B,ie)}return X}function le(oe,De,_e,ne){var Be=oe.length;_e=Math.max(0,_e==null?0:+_e),ne=Math.min(Be-1,ne==null?Be-1:+ne);var X=[];return De.paragraphs.forEach(function(B){var ie=Math.max(_e,B.start),Se=Math.min(ne,B.end);if(ie<Se){for(var ge=De.levels.slice(ie,Se+1),me=Se;me>=ie&&p(oe[me])&c;me--)ge[me]=B.level;for(var Fe=B.level,Ie=1/0,je=0;je<ge.length;je++){var Ze=ge[je];Ze>Fe&&(Fe=Ze),Ze<Ie&&(Ie=Ze|1)}for(var Ce=Fe;Ce>=Ie;Ce--)for(var He=0;He<ge.length;He++)if(ge[He]>=Ce){for(var Ve=He;He+1<ge.length&&ge[He+1]>=Ce;)He++;He>Ve&&X.push([Ve+ie,He+ie])}}}),X}function te(oe,De,_e,ne){var Be=Me(oe,De,_e,ne),X=[].concat(oe);return Be.forEach(function(B,ie){X[ie]=(De.levels[B]&1?Ne(oe[B]):null)||oe[B]}),X.join("")}function Me(oe,De,_e,ne){for(var Be=le(oe,De,_e,ne),X=[],B=0;B<oe.length;B++)X[B]=B;return Be.forEach(function(ie){for(var Se=ie[0],ge=ie[1],me=X.slice(Se,ge+1),Fe=me.length;Fe--;)X[ge-Fe]=me[Fe]}),X}return e.closingToOpeningBracket=w,e.getBidiCharType=p,e.getBidiCharTypeName=m,e.getCanonicalBracket=T,e.getEmbeddingLevels=Oe,e.getMirroredCharacter=Ne,e.getMirroredCharactersMap=G,e.getReorderSegments=le,e.getReorderedIndices=Me,e.getReorderedString=te,e.openingToClosingBracket=E,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return i}const _3=/\bvoid\s+main\s*\(\s*\)\s*{/g;function Dx(i){const e=/^[ \t]*#include +<([\w\d./]+)>/gm;function t(n,r){let s=Dt[r];return s?Dx(s):n}return i.replace(e,t)}const gi=[];for(let i=0;i<256;i++)gi[i]=(i<16?"0":"")+i.toString(16);function g9(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(gi[i&255]+gi[i>>8&255]+gi[i>>16&255]+gi[i>>24&255]+"-"+gi[e&255]+gi[e>>8&255]+"-"+gi[e>>16&15|64]+gi[e>>24&255]+"-"+gi[t&63|128]+gi[t>>8&255]+"-"+gi[t>>16&255]+gi[t>>24&255]+gi[n&255]+gi[n>>8&255]+gi[n>>16&255]+gi[n>>24&255]).toUpperCase()}const ul=Object.assign||function(){let i=arguments[0];for(let e=1,t=arguments.length;e<t;e++){let n=arguments[e];if(n)for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},v9=Date.now(),HT=new WeakMap,VT=new Map;let y9=1e10;function Ux(i,e){const t=S9(e);let n=HT.get(i);if(n||HT.set(i,n=Object.create(null)),n[t])return new n[t];const r=`_onBeforeCompile${t}`,s=function(c,f){i.onBeforeCompile.call(this,c,f);const d=this.customProgramCacheKey()+"|"+c.vertexShader+"|"+c.fragmentShader;let p=VT[d];if(!p){const m=_9(this,c,e,t);p=VT[d]=m}c.vertexShader=p.vertexShader,c.fragmentShader=p.fragmentShader,ul(c.uniforms,this.uniforms),e.timeUniform&&(c.uniforms[e.timeUniform]={get value(){return Date.now()-v9}}),this[r]&&this[r](c)},a=function(){return o(e.chained?i:i.clone())},o=function(c){const f=Object.create(c,l);return Object.defineProperty(f,"baseMaterial",{value:i}),Object.defineProperty(f,"id",{value:y9++}),f.uuid=g9(),f.uniforms=ul({},c.uniforms,e.uniforms),f.defines=ul({},c.defines,e.defines),f.defines[`TROIKA_DERIVED_MATERIAL_${t}`]="",f.extensions=ul({},c.extensions,e.extensions),f._listeners=void 0,f},l={constructor:{value:a},isDerivedMaterial:{value:!0},type:{get:()=>i.type,set:c=>{i.type=c}},isDerivedFrom:{writable:!0,configurable:!0,value:function(c){const f=this.baseMaterial;return c===f||f.isDerivedMaterial&&f.isDerivedFrom(c)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return i.customProgramCacheKey()+"|"+t}},onBeforeCompile:{get(){return s},set(c){this[r]=c}},copy:{writable:!0,configurable:!0,value:function(c){return i.copy.call(this,c),!i.isShaderMaterial&&!i.isDerivedMaterial&&(ul(this.extensions,c.extensions),ul(this.defines,c.defines),ul(this.uniforms,Jx.clone(c.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const c=new i.constructor;return o(c).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let c=this._depthMaterial;return c||(c=this._depthMaterial=Ux(i.isDerivedMaterial?i.getDepthMaterial():new t0({depthPacking:Xx}),e),c.defines.IS_DEPTH_MATERIAL="",c.uniforms=this.uniforms),c}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let c=this._distanceMaterial;return c||(c=this._distanceMaterial=Ux(i.isDerivedMaterial?i.getDistanceMaterial():new n0,e),c.defines.IS_DISTANCE_MATERIAL="",c.uniforms=this.uniforms),c}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:c,_distanceMaterial:f}=this;c&&c.dispose(),f&&f.dispose(),i.dispose.call(this)}}};return n[t]=a,new a}function _9(i,{vertexShader:e,fragmentShader:t},n,r){let{vertexDefs:s,vertexMainIntro:a,vertexMainOutro:o,vertexTransform:l,fragmentDefs:c,fragmentMainIntro:f,fragmentMainOutro:d,fragmentColorTransform:p,customRewriter:m,timeUniform:v}=n;if(s=s||"",a=a||"",o=o||"",c=c||"",f=f||"",d=d||"",(l||m)&&(e=Dx(e)),(p||m)&&(t=t.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,`
3931
+ ;(`+t+")()"],{type:"application/javascript"}))),e.onmessage=function(n){var r=n.data,s=r.messageId,a=Rx[s];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete Rx[s],a(r)}}return e}function GT(i,e,t){return new Promise(function(n,r){var s=++d9;Rx[s]=function(a){a.success?n(a.result):r(new Error("Error in worker "+e+" call: "+a.error))},m9(i).postMessage({messageId:s,action:e,data:t})})}function v3(){var i=function(e){function t(H,W,F,Y,K,j,J,he){var re=1-J;he.x=re*re*H+2*re*J*F+J*J*K,he.y=re*re*W+2*re*J*Y+J*J*j}function n(H,W,F,Y,K,j,J,he,re,pe){var Oe=1-re;pe.x=Oe*Oe*Oe*H+3*Oe*Oe*re*F+3*Oe*re*re*K+re*re*re*J,pe.y=Oe*Oe*Oe*W+3*Oe*Oe*re*Y+3*Oe*re*re*j+re*re*re*he}function r(H,W){for(var F=/([MLQCZ])([^MLQCZ]*)/g,Y,K,j,J,he;Y=F.exec(H);){var re=Y[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(pe){return parseFloat(pe)});switch(Y[1]){case"M":J=K=re[0],he=j=re[1];break;case"L":(re[0]!==J||re[1]!==he)&&W("L",J,he,J=re[0],he=re[1]);break;case"Q":{W("Q",J,he,J=re[2],he=re[3],re[0],re[1]);break}case"C":{W("C",J,he,J=re[4],he=re[5],re[0],re[1],re[2],re[3]);break}case"Z":(J!==K||he!==j)&&W("L",J,he,K,j);break}}}function s(H,W,F){F===void 0&&(F=16);var Y={x:0,y:0};r(H,function(K,j,J,he,re,pe,Oe,be,ve){switch(K){case"L":W(j,J,he,re);break;case"Q":{for(var ce=j,Ne=J,G=1;G<F;G++)t(j,J,pe,Oe,he,re,G/(F-1),Y),W(ce,Ne,Y.x,Y.y),ce=Y.x,Ne=Y.y;break}case"C":{for(var le=j,te=J,Me=1;Me<F;Me++)n(j,J,pe,Oe,be,ve,he,re,Me/(F-1),Y),W(le,te,Y.x,Y.y),le=Y.x,te=Y.y;break}}})}var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",o="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",l=new WeakMap,c={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function f(H,W){var F=H.getContext?H.getContext("webgl",c):H,Y=l.get(F);if(!Y){let Oe=function(le){var te=j[le];if(!te&&(te=j[le]=F.getExtension(le),!te))throw new Error(le+" not supported");return te},be=function(le,te){var Me=F.createShader(te);return F.shaderSource(Me,le),F.compileShader(Me),Me},ve=function(le,te,Me,oe){if(!J[le]){var De={},_e={},ne=F.createProgram();F.attachShader(ne,be(te,F.VERTEX_SHADER)),F.attachShader(ne,be(Me,F.FRAGMENT_SHADER)),F.linkProgram(ne),J[le]={program:ne,transaction:function(X){F.useProgram(ne),X({setUniform:function(ie,Se){for(var ge=[],me=arguments.length-2;me-- >0;)ge[me]=arguments[me+2];var Fe=_e[Se]||(_e[Se]=F.getUniformLocation(ne,Se));F["uniform"+ie].apply(F,[Fe].concat(ge))},setAttribute:function(ie,Se,ge,me,Fe){var Ie=De[ie];Ie||(Ie=De[ie]={buf:F.createBuffer(),loc:F.getAttribLocation(ne,ie),data:null}),F.bindBuffer(F.ARRAY_BUFFER,Ie.buf),F.vertexAttribPointer(Ie.loc,Se,F.FLOAT,!1,0,0),F.enableVertexAttribArray(Ie.loc),K?F.vertexAttribDivisor(Ie.loc,me):Oe("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Ie.loc,me),Fe!==Ie.data&&(F.bufferData(F.ARRAY_BUFFER,Fe,ge),Ie.data=Fe)}})}}}J[le].transaction(oe)},ce=function(le,te){re++;try{F.activeTexture(F.TEXTURE0+re);var Me=he[le];Me||(Me=he[le]=F.createTexture(),F.bindTexture(F.TEXTURE_2D,Me),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MIN_FILTER,F.NEAREST),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MAG_FILTER,F.NEAREST)),F.bindTexture(F.TEXTURE_2D,Me),te(Me,re)}finally{re--}},Ne=function(le,te,Me){var oe=F.createFramebuffer();pe.push(oe),F.bindFramebuffer(F.FRAMEBUFFER,oe),F.activeTexture(F.TEXTURE0+te),F.bindTexture(F.TEXTURE_2D,le),F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,le,0);try{Me(oe)}finally{F.deleteFramebuffer(oe),F.bindFramebuffer(F.FRAMEBUFFER,pe[--pe.length-1]||null)}},G=function(){j={},J={},he={},re=-1,pe.length=0};var K=typeof WebGL2RenderingContext<"u"&&F instanceof WebGL2RenderingContext,j={},J={},he={},re=-1,pe=[];F.canvas.addEventListener("webglcontextlost",function(le){G(),le.preventDefault()},!1),l.set(F,Y={gl:F,isWebGL2:K,getExtension:Oe,withProgram:ve,withTexture:ce,withTextureFramebuffer:Ne,handleContextLoss:G})}W(Y)}function d(H,W,F,Y,K,j,J,he){J===void 0&&(J=15),he===void 0&&(he=null),f(H,function(re){var pe=re.gl,Oe=re.withProgram,be=re.withTexture;be("copy",function(ve,ce){pe.texImage2D(pe.TEXTURE_2D,0,pe.RGBA,K,j,0,pe.RGBA,pe.UNSIGNED_BYTE,W),Oe("copy",a,o,function(Ne){var G=Ne.setUniform,le=Ne.setAttribute;le("aUV",2,pe.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),G("1i","image",ce),pe.bindFramebuffer(pe.FRAMEBUFFER,he||null),pe.disable(pe.BLEND),pe.colorMask(J&8,J&4,J&2,J&1),pe.viewport(F,Y,K,j),pe.scissor(F,Y,K,j),pe.drawArrays(pe.TRIANGLES,0,3)})})})}function p(H,W,F){var Y=H.width,K=H.height;f(H,function(j){var J=j.gl,he=new Uint8Array(Y*K*4);J.readPixels(0,0,Y,K,J.RGBA,J.UNSIGNED_BYTE,he),H.width=W,H.height=F,d(J,he,0,0,Y,K)})}var m=Object.freeze({__proto__:null,withWebGLContext:f,renderImageData:d,resizeWebGLCanvasWithoutClearing:p});function v(H,W,F,Y,K,j){j===void 0&&(j=1);var J=new Uint8Array(H*W),he=Y[2]-Y[0],re=Y[3]-Y[1],pe=[];s(F,function(le,te,Me,oe){pe.push({x1:le,y1:te,x2:Me,y2:oe,minX:Math.min(le,Me),minY:Math.min(te,oe),maxX:Math.max(le,Me),maxY:Math.max(te,oe)})}),pe.sort(function(le,te){return le.maxX-te.maxX});for(var Oe=0;Oe<H;Oe++)for(var be=0;be<W;be++){var ve=Ne(Y[0]+he*(Oe+.5)/H,Y[1]+re*(be+.5)/W),ce=Math.pow(1-Math.abs(ve)/K,j)/2;ve<0&&(ce=1-ce),ce=Math.max(0,Math.min(255,Math.round(ce*255))),J[be*H+Oe]=ce}return J;function Ne(le,te){for(var Me=1/0,oe=1/0,De=pe.length;De--;){var _e=pe[De];if(_e.maxX+oe<=le)break;if(le+oe>_e.minX&&te-oe<_e.maxY&&te+oe>_e.minY){var ne=g(le,te,_e.x1,_e.y1,_e.x2,_e.y2);ne<Me&&(Me=ne,oe=Math.sqrt(Me))}}return G(le,te)&&(oe=-oe),oe}function G(le,te){for(var Me=0,oe=pe.length;oe--;){var De=pe[oe];if(De.maxX<=le)break;var _e=De.y1>te!=De.y2>te&&le<(De.x2-De.x1)*(te-De.y1)/(De.y2-De.y1)+De.x1;_e&&(Me+=De.y1<De.y2?1:-1)}return Me!==0}}function x(H,W,F,Y,K,j,J,he,re,pe){j===void 0&&(j=1),he===void 0&&(he=0),re===void 0&&(re=0),pe===void 0&&(pe=0),_(H,W,F,Y,K,j,J,null,he,re,pe)}function _(H,W,F,Y,K,j,J,he,re,pe,Oe){j===void 0&&(j=1),re===void 0&&(re=0),pe===void 0&&(pe=0),Oe===void 0&&(Oe=0);for(var be=v(H,W,F,Y,K,j),ve=new Uint8Array(be.length*4),ce=0;ce<be.length;ce++)ve[ce*4+Oe]=be[ce];d(J,ve,re,pe,H,W,1<<3-Oe,he)}function g(H,W,F,Y,K,j){var J=K-F,he=j-Y,re=J*J+he*he,pe=re?Math.max(0,Math.min(1,((H-F)*J+(W-Y)*he)/re)):0,Oe=H-(F+pe*J),be=W-(Y+pe*he);return Oe*Oe+be*be}var b=Object.freeze({__proto__:null,generate:v,generateIntoCanvas:x,generateIntoFramebuffer:_}),S="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",E="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",w="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",T=new Float32Array([0,0,2,0,0,2]),C=null,U=!1,D={},R=new WeakMap;function I(H){if(!U&&!ee(H))throw new Error("WebGL generation not supported")}function z(H,W,F,Y,K,j,J){if(j===void 0&&(j=1),J===void 0&&(J=null),!J&&(J=C,!J)){var he=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!he)throw new Error("OffscreenCanvas or DOM canvas not supported");J=C=he.getContext("webgl",{depth:!1})}I(J);var re=new Uint8Array(H*W*4);f(J,function(ve){var ce=ve.gl,Ne=ve.withTexture,G=ve.withTextureFramebuffer;Ne("readable",function(le,te){ce.texImage2D(ce.TEXTURE_2D,0,ce.RGBA,H,W,0,ce.RGBA,ce.UNSIGNED_BYTE,null),G(le,te,function(Me){V(H,W,F,Y,K,j,ce,Me,0,0,0),ce.readPixels(0,0,H,W,ce.RGBA,ce.UNSIGNED_BYTE,re)})})});for(var pe=new Uint8Array(H*W),Oe=0,be=0;Oe<re.length;Oe+=4)pe[be++]=re[Oe];return pe}function O(H,W,F,Y,K,j,J,he,re,pe){j===void 0&&(j=1),he===void 0&&(he=0),re===void 0&&(re=0),pe===void 0&&(pe=0),V(H,W,F,Y,K,j,J,null,he,re,pe)}function V(H,W,F,Y,K,j,J,he,re,pe,Oe){j===void 0&&(j=1),re===void 0&&(re=0),pe===void 0&&(pe=0),Oe===void 0&&(Oe=0),I(J);var be=[];s(F,function(ve,ce,Ne,G){be.push(ve,ce,Ne,G)}),be=new Float32Array(be),f(J,function(ve){var ce=ve.gl,Ne=ve.isWebGL2,G=ve.getExtension,le=ve.withProgram,te=ve.withTexture,Me=ve.withTextureFramebuffer,oe=ve.handleContextLoss;if(te("rawDistances",function(De,_e){(H!==De._lastWidth||W!==De._lastHeight)&&ce.texImage2D(ce.TEXTURE_2D,0,ce.RGBA,De._lastWidth=H,De._lastHeight=W,0,ce.RGBA,ce.UNSIGNED_BYTE,null),le("main",S,E,function(ne){var Be=ne.setAttribute,X=ne.setUniform,B=!Ne&&G("ANGLE_instanced_arrays"),ie=!Ne&&G("EXT_blend_minmax");Be("aUV",2,ce.STATIC_DRAW,0,T),Be("aLineSegment",4,ce.DYNAMIC_DRAW,1,be),X.apply(void 0,["4f","uGlyphBounds"].concat(Y)),X("1f","uMaxDistance",K),X("1f","uExponent",j),Me(De,_e,function(Se){ce.enable(ce.BLEND),ce.colorMask(!0,!0,!0,!0),ce.viewport(0,0,H,W),ce.scissor(0,0,H,W),ce.blendFunc(ce.ONE,ce.ONE),ce.blendEquationSeparate(ce.FUNC_ADD,Ne?ce.MAX:ie.MAX_EXT),ce.clear(ce.COLOR_BUFFER_BIT),Ne?ce.drawArraysInstanced(ce.TRIANGLES,0,3,be.length/4):B.drawArraysInstancedANGLE(ce.TRIANGLES,0,3,be.length/4)})}),le("post",a,w,function(ne){ne.setAttribute("aUV",2,ce.STATIC_DRAW,0,T),ne.setUniform("1i","tex",_e),ce.bindFramebuffer(ce.FRAMEBUFFER,he),ce.disable(ce.BLEND),ce.colorMask(Oe===0,Oe===1,Oe===2,Oe===3),ce.viewport(re,pe,H,W),ce.scissor(re,pe,H,W),ce.drawArrays(ce.TRIANGLES,0,3)})}),ce.isContextLost())throw oe(),new Error("webgl context lost")})}function ee(H){var W=!H||H===C?D:H.canvas||H,F=R.get(W);if(F===void 0){U=!0;var Y=null;try{var K=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],j=z(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,H);F=j&&K.length===j.length&&j.every(function(J,he){return J===K[he]}),F||(Y="bad trial run results",console.info(K,j))}catch(J){F=!1,Y=J.message}Y&&console.warn("WebGL SDF generation not supported:",Y),U=!1,R.set(W,F)}return F}var P=Object.freeze({__proto__:null,generate:z,generateIntoCanvas:O,generateIntoFramebuffer:V,isSupported:ee});function L(H,W,F,Y,K,j){K===void 0&&(K=Math.max(Y[2]-Y[0],Y[3]-Y[1])/2),j===void 0&&(j=1);try{return z.apply(P,arguments)}catch(J){return console.info("WebGL SDF generation failed, falling back to JS",J),v.apply(b,arguments)}}function k(H,W,F,Y,K,j,J,he,re,pe){K===void 0&&(K=Math.max(Y[2]-Y[0],Y[3]-Y[1])/2),j===void 0&&(j=1),he===void 0&&(he=0),re===void 0&&(re=0),pe===void 0&&(pe=0);try{return O.apply(P,arguments)}catch(Oe){return console.info("WebGL SDF generation failed, falling back to JS",Oe),x.apply(b,arguments)}}return e.forEachPathCommand=r,e.generate=L,e.generateIntoCanvas=k,e.javascript=b,e.pathToLineSegments=s,e.webgl=P,e.webglUtils=m,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return i}function g9(){var i=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},n={},r={};n.L=1,r[1]="L",Object.keys(t).forEach(function(oe,De){n[oe]=1<<De+1,r[n[oe]]=oe}),Object.freeze(n);var s=n.LRI|n.RLI|n.FSI,a=n.L|n.R|n.AL,o=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,l=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,c=n.S|n.WS|n.B|s|n.PDI|l,f=null;function d(){if(!f){f=new Map;var oe=function(_e){if(t.hasOwnProperty(_e)){var ne=0;t[_e].split(",").forEach(function(Be){var X=Be.split("+"),B=X[0],ie=X[1];B=parseInt(B,36),ie=ie?parseInt(ie,36):0,f.set(ne+=B,n[_e]);for(var Se=0;Se<ie;Se++)f.set(++ne,n[_e])})}};for(var De in t)oe(De)}}function p(oe){return d(),f.get(oe.codePointAt(0))||n.L}function m(oe){return r[p(oe)]}var v={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function x(oe,De){var _e=36,ne=0,Be=new Map,X=De&&new Map,B;return oe.split(",").forEach(function ie(Se){if(Se.indexOf("+")!==-1)for(var ge=+Se;ge--;)ie(B);else{B=Se;var me=Se.split(">"),Fe=me[0],Ie=me[1];Fe=String.fromCodePoint(ne+=parseInt(Fe,_e)),Ie=String.fromCodePoint(ne+=parseInt(Ie,_e)),Be.set(Fe,Ie),De&&X.set(Ie,Fe)}}),{map:Be,reverseMap:X}}var _,g,b;function S(){if(!_){var oe=x(v.pairs,!0),De=oe.map,_e=oe.reverseMap;_=De,g=_e,b=x(v.canonical,!1).map}}function E(oe){return S(),_.get(oe)||null}function w(oe){return S(),g.get(oe)||null}function T(oe){return S(),b.get(oe)||null}var C=n.L,U=n.R,D=n.EN,R=n.ES,I=n.ET,z=n.AN,O=n.CS,V=n.B,ee=n.S,P=n.ON,L=n.BN,k=n.NSM,H=n.AL,W=n.LRO,F=n.RLO,Y=n.LRE,K=n.RLE,j=n.PDF,J=n.LRI,he=n.RLI,re=n.FSI,pe=n.PDI;function Oe(oe,De){for(var _e=125,ne=new Uint32Array(oe.length),Be=0;Be<oe.length;Be++)ne[Be]=p(oe[Be]);var X=new Map;function B(pi,qi){var Wn=ne[pi];ne[pi]=qi,X.set(Wn,X.get(Wn)-1),Wn&o&&X.set(o,X.get(o)-1),X.set(qi,(X.get(qi)||0)+1),qi&o&&X.set(o,(X.get(o)||0)+1)}for(var ie=new Uint8Array(oe.length),Se=new Map,ge=[],me=null,Fe=0;Fe<oe.length;Fe++)me||ge.push(me={start:Fe,end:oe.length-1,level:De==="rtl"?1:De==="ltr"?0:Gu(Fe,!1)}),ne[Fe]&V&&(me.end=Fe,me=null);for(var Ie=K|Y|F|W|s|pe|j|V,je=function(pi){return pi+(pi&1?1:2)},Ze=function(pi){return pi+(pi&1?2:1)},Ce=0;Ce<ge.length;Ce++){me=ge[Ce];var He=[{_level:me.level,_override:0,_isolate:0}],Ve=void 0,nt=0,We=0,ft=0;X.clear();for(var se=me.start;se<=me.end;se++){var ze=ne[se];if(Ve=He[He.length-1],X.set(ze,(X.get(ze)||0)+1),ze&o&&X.set(o,(X.get(o)||0)+1),ze&Ie)if(ze&(K|Y)){ie[se]=Ve._level;var Le=(ze===K?Ze:je)(Ve._level);Le<=_e&&!nt&&!We?He.push({_level:Le,_override:0,_isolate:0}):nt||We++}else if(ze&(F|W)){ie[se]=Ve._level;var rt=(ze===F?Ze:je)(Ve._level);rt<=_e&&!nt&&!We?He.push({_level:rt,_override:ze&F?U:C,_isolate:0}):nt||We++}else if(ze&s){ze&re&&(ze=Gu(se+1,!0)===1?he:J),ie[se]=Ve._level,Ve._override&&B(se,Ve._override);var Pe=(ze===he?Ze:je)(Ve._level);Pe<=_e&&nt===0&&We===0?(ft++,He.push({_level:Pe,_override:0,_isolate:1,_isolInitIndex:se})):nt++}else if(ze&pe){if(nt>0)nt--;else if(ft>0){for(We=0;!He[He.length-1]._isolate;)He.pop();var Re=He[He.length-1]._isolInitIndex;Re!=null&&(Se.set(Re,se),Se.set(se,Re)),He.pop(),ft--}Ve=He[He.length-1],ie[se]=Ve._level,Ve._override&&B(se,Ve._override)}else ze&j?(nt===0&&(We>0?We--:!Ve._isolate&&He.length>1&&(He.pop(),Ve=He[He.length-1])),ie[se]=Ve._level):ze&V&&(ie[se]=me.level);else ie[se]=Ve._level,Ve._override&&ze!==L&&B(se,Ve._override)}for(var Ke=[],st=null,at=me.start;at<=me.end;at++){var mt=ne[at];if(!(mt&l)){var Jt=ie[at],tn=mt&s,mn=mt===pe;st&&Jt===st._level?(st._end=at,st._endsWithIsolInit=tn):Ke.push(st={_start:at,_end:at,_level:Jt,_startsWithPDI:mn,_endsWithIsolInit:tn})}}for(var oi=[],kn=0;kn<Ke.length;kn++){var Cn=Ke[kn];if(!Cn._startsWithPDI||Cn._startsWithPDI&&!Se.has(Cn._start)){for(var Vi=[st=Cn],$n=void 0;st&&st._endsWithIsolInit&&($n=Se.get(st._end))!=null;)for(var yn=kn+1;yn<Ke.length;yn++)if(Ke[yn]._start===$n){Vi.push(st=Ke[yn]);break}for(var xn=[],Ht=0;Ht<Vi.length;Ht++)for(var Ls=Vi[Ht],hs=Ls._start;hs<=Ls._end;hs++)xn.push(hs);for(var Gl=ie[xn[0]],bo=me.level,Ra=xn[0]-1;Ra>=0;Ra--)if(!(ne[Ra]&l)){bo=ie[Ra];break}var Ns=xn[xn.length-1],So=ie[Ns],Da=me.level;if(!(ne[Ns]&s)){for(var q=Ns+1;q<=me.end;q++)if(!(ne[q]&l)){Da=ie[q];break}}oi.push({_seqIndices:xn,_sosType:Math.max(bo,Gl)%2?U:C,_eosType:Math.max(Da,So)%2?U:C})}}for(var de=0;de<oi.length;de++){var we=oi[de],fe=we._seqIndices,ye=we._sosType,Xe=we._eosType,Je=ie[fe[0]]&1?U:C;if(X.get(k))for(var ut=0;ut<fe.length;ut++){var lt=fe[ut];if(ne[lt]&k){for(var yt=ye,_t=ut-1;_t>=0;_t--)if(!(ne[fe[_t]]&l)){yt=ne[fe[_t]];break}B(lt,yt&(s|pe)?P:yt)}}if(X.get(D))for(var pt=0;pt<fe.length;pt++){var Ot=fe[pt];if(ne[Ot]&D)for(var zt=pt-1;zt>=-1;zt--){var nn=zt===-1?ye:ne[fe[zt]];if(nn&a){nn===H&&B(Ot,z);break}}}if(X.get(H))for(var Qt=0;Qt<fe.length;Qt++){var Pt=fe[Qt];ne[Pt]&H&&B(Pt,U)}if(X.get(R)||X.get(O))for(var gt=1;gt<fe.length-1;gt++){var _n=fe[gt];if(ne[_n]&(R|O)){for(var Nt=0,li=0,Wi=gt-1;Wi>=0&&(Nt=ne[fe[Wi]],!!(Nt&l));Wi--);for(var Gn=gt+1;Gn<fe.length&&(li=ne[fe[Gn]],!!(li&l));Gn++);Nt===li&&(ne[_n]===R?Nt===D:Nt&(D|z))&&B(_n,Nt)}}if(X.get(D))for(var ei=0;ei<fe.length;ei++){var rn=fe[ei];if(ne[rn]&D){for(var Hn=ei-1;Hn>=0&&ne[fe[Hn]]&(I|l);Hn--)B(fe[Hn],D);for(ei++;ei<fe.length&&ne[fe[ei]]&(I|l|D);ei++)ne[fe[ei]]!==D&&B(fe[ei],D)}}if(X.get(I)||X.get(R)||X.get(O))for(var zn=0;zn<fe.length;zn++){var Vn=fe[zn];if(ne[Vn]&(I|R|O)){B(Vn,P);for(var Rn=zn-1;Rn>=0&&ne[fe[Rn]]&l;Rn--)B(fe[Rn],P);for(var Li=zn+1;Li<fe.length&&ne[fe[Li]]&l;Li++)B(fe[Li],P)}}if(X.get(D))for(var Xi=0,Eo=ye;Xi<fe.length;Xi++){var Mo=fe[Xi],Hl=ne[Mo];Hl&D?Eo===C&&B(Mo,C):Hl&a&&(Eo=Hl)}if(X.get(o)){var Is=U|D|z,Lu=Is|C,wo=[];{for(var Ps=[],zs=0;zs<fe.length;zs++)if(ne[fe[zs]]&o){var Fs=oe[fe[zs]],Nu=void 0;if(E(Fs)!==null)if(Ps.length<63)Ps.push({char:Fs,seqIndex:zs});else break;else if((Nu=w(Fs))!==null)for(var Ua=Ps.length-1;Ua>=0;Ua--){var To=Ps[Ua].char;if(To===Nu||To===w(T(Fs))||E(T(To))===Fs){wo.push([Ps[Ua].seqIndex,zs]),Ps.length=Ua;break}}}wo.sort(function(pi,qi){return pi[0]-qi[0]})}for(var Vl=0;Vl<wo.length;Vl++){for(var Iu=wo[Vl],Ao=Iu[0],Co=Iu[1],Pu=!1,ji=0,zu=Ao+1;zu<Co;zu++){var ud=fe[zu];if(ne[ud]&Lu){Pu=!0;var Fu=ne[ud]&Is?U:C;if(Fu===Je){ji=Fu;break}}}if(Pu&&!ji){ji=ye;for(var Bs=Ao-1;Bs>=0;Bs--){var Wl=fe[Bs];if(ne[Wl]&Lu){var Ro=ne[Wl]&Is?U:C;Ro!==Je?ji=Ro:ji=Je;break}}}if(ji){if(ne[fe[Ao]]=ne[fe[Co]]=ji,ji!==Je){for(var Oa=Ao+1;Oa<fe.length;Oa++)if(!(ne[fe[Oa]]&l)){p(oe[fe[Oa]])&k&&(ne[fe[Oa]]=ji);break}}if(ji!==Je){for(var La=Co+1;La<fe.length;La++)if(!(ne[fe[La]]&l)){p(oe[fe[La]])&k&&(ne[fe[La]]=ji);break}}}}for(var br=0;br<fe.length;br++)if(ne[fe[br]]&o){for(var Bu=br,Xl=br,Xr=ye,fs=br-1;fs>=0;fs--)if(ne[fe[fs]]&l)Bu=fs;else{Xr=ne[fe[fs]]&Is?U:C;break}for(var ku=Xe,ks=br+1;ks<fe.length;ks++)if(ne[fe[ks]]&(o|l))Xl=ks;else{ku=ne[fe[ks]]&Is?U:C;break}for(var jl=Bu;jl<=Xl;jl++)ne[fe[jl]]=Xr===ku?Xr:Je;br=Xl}}}for(var bi=me.start;bi<=me.end;bi++){var b0=ie[bi],Dn=ne[bi];if(b0&1?Dn&(C|D|z)&&ie[bi]++:Dn&U?ie[bi]++:Dn&(z|D)&&(ie[bi]+=2),Dn&l&&(ie[bi]=bi===0?me.level:ie[bi-1]),bi===me.end||p(oe[bi])&(ee|V))for(var Do=bi;Do>=0&&p(oe[Do])&c;Do--)ie[Do]=me.level}}return{levels:ie,paragraphs:ge};function Gu(pi,qi){for(var Wn=pi;Wn<oe.length;Wn++){var Sr=ne[Wn];if(Sr&(U|H))return 1;if(Sr&(V|C)||qi&&Sr===pe)return 0;if(Sr&s){var Hu=hd(Wn);Wn=Hu===-1?oe.length:Hu}}return 0}function hd(pi){for(var qi=1,Wn=pi+1;Wn<oe.length;Wn++){var Sr=ne[Wn];if(Sr&V)break;if(Sr&pe){if(--qi===0)return Wn}else Sr&s&&qi++}return-1}}var be="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",ve;function ce(){if(!ve){var oe=x(be,!0),De=oe.map,_e=oe.reverseMap;_e.forEach(function(ne,Be){De.set(Be,ne)}),ve=De}}function Ne(oe){return ce(),ve.get(oe)||null}function G(oe,De,_e,ne){var Be=oe.length;_e=Math.max(0,_e==null?0:+_e),ne=Math.min(Be-1,ne==null?Be-1:+ne);for(var X=new Map,B=_e;B<=ne;B++)if(De[B]&1){var ie=Ne(oe[B]);ie!==null&&X.set(B,ie)}return X}function le(oe,De,_e,ne){var Be=oe.length;_e=Math.max(0,_e==null?0:+_e),ne=Math.min(Be-1,ne==null?Be-1:+ne);var X=[];return De.paragraphs.forEach(function(B){var ie=Math.max(_e,B.start),Se=Math.min(ne,B.end);if(ie<Se){for(var ge=De.levels.slice(ie,Se+1),me=Se;me>=ie&&p(oe[me])&c;me--)ge[me]=B.level;for(var Fe=B.level,Ie=1/0,je=0;je<ge.length;je++){var Ze=ge[je];Ze>Fe&&(Fe=Ze),Ze<Ie&&(Ie=Ze|1)}for(var Ce=Fe;Ce>=Ie;Ce--)for(var He=0;He<ge.length;He++)if(ge[He]>=Ce){for(var Ve=He;He+1<ge.length&&ge[He+1]>=Ce;)He++;He>Ve&&X.push([Ve+ie,He+ie])}}}),X}function te(oe,De,_e,ne){var Be=Me(oe,De,_e,ne),X=[].concat(oe);return Be.forEach(function(B,ie){X[ie]=(De.levels[B]&1?Ne(oe[B]):null)||oe[B]}),X.join("")}function Me(oe,De,_e,ne){for(var Be=le(oe,De,_e,ne),X=[],B=0;B<oe.length;B++)X[B]=B;return Be.forEach(function(ie){for(var Se=ie[0],ge=ie[1],me=X.slice(Se,ge+1),Fe=me.length;Fe--;)X[ge-Fe]=me[Fe]}),X}return e.closingToOpeningBracket=w,e.getBidiCharType=p,e.getBidiCharTypeName=m,e.getCanonicalBracket=T,e.getEmbeddingLevels=Oe,e.getMirroredCharacter=Ne,e.getMirroredCharactersMap=G,e.getReorderSegments=le,e.getReorderedIndices=Me,e.getReorderedString=te,e.openingToClosingBracket=E,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return i}const y3=/\bvoid\s+main\s*\(\s*\)\s*{/g;function Dx(i){const e=/^[ \t]*#include +<([\w\d./]+)>/gm;function t(n,r){let s=Dt[r];return s?Dx(s):n}return i.replace(e,t)}const gi=[];for(let i=0;i<256;i++)gi[i]=(i<16?"0":"")+i.toString(16);function v9(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(gi[i&255]+gi[i>>8&255]+gi[i>>16&255]+gi[i>>24&255]+"-"+gi[e&255]+gi[e>>8&255]+"-"+gi[e>>16&15|64]+gi[e>>24&255]+"-"+gi[t&63|128]+gi[t>>8&255]+"-"+gi[t>>16&255]+gi[t>>24&255]+gi[n&255]+gi[n>>8&255]+gi[n>>16&255]+gi[n>>24&255]).toUpperCase()}const ul=Object.assign||function(){let i=arguments[0];for(let e=1,t=arguments.length;e<t;e++){let n=arguments[e];if(n)for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},y9=Date.now(),HT=new WeakMap,VT=new Map;let _9=1e10;function Ux(i,e){const t=E9(e);let n=HT.get(i);if(n||HT.set(i,n=Object.create(null)),n[t])return new n[t];const r=`_onBeforeCompile${t}`,s=function(c,f){i.onBeforeCompile.call(this,c,f);const d=this.customProgramCacheKey()+"|"+c.vertexShader+"|"+c.fragmentShader;let p=VT[d];if(!p){const m=x9(this,c,e,t);p=VT[d]=m}c.vertexShader=p.vertexShader,c.fragmentShader=p.fragmentShader,ul(c.uniforms,this.uniforms),e.timeUniform&&(c.uniforms[e.timeUniform]={get value(){return Date.now()-y9}}),this[r]&&this[r](c)},a=function(){return o(e.chained?i:i.clone())},o=function(c){const f=Object.create(c,l);return Object.defineProperty(f,"baseMaterial",{value:i}),Object.defineProperty(f,"id",{value:_9++}),f.uuid=v9(),f.uniforms=ul({},c.uniforms,e.uniforms),f.defines=ul({},c.defines,e.defines),f.defines[`TROIKA_DERIVED_MATERIAL_${t}`]="",f.extensions=ul({},c.extensions,e.extensions),f._listeners=void 0,f},l={constructor:{value:a},isDerivedMaterial:{value:!0},type:{get:()=>i.type,set:c=>{i.type=c}},isDerivedFrom:{writable:!0,configurable:!0,value:function(c){const f=this.baseMaterial;return c===f||f.isDerivedMaterial&&f.isDerivedFrom(c)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return i.customProgramCacheKey()+"|"+t}},onBeforeCompile:{get(){return s},set(c){this[r]=c}},copy:{writable:!0,configurable:!0,value:function(c){return i.copy.call(this,c),!i.isShaderMaterial&&!i.isDerivedMaterial&&(ul(this.extensions,c.extensions),ul(this.defines,c.defines),ul(this.uniforms,Jx.clone(c.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const c=new i.constructor;return o(c).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let c=this._depthMaterial;return c||(c=this._depthMaterial=Ux(i.isDerivedMaterial?i.getDepthMaterial():new t0({depthPacking:Xx}),e),c.defines.IS_DEPTH_MATERIAL="",c.uniforms=this.uniforms),c}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let c=this._distanceMaterial;return c||(c=this._distanceMaterial=Ux(i.isDerivedMaterial?i.getDistanceMaterial():new n0,e),c.defines.IS_DISTANCE_MATERIAL="",c.uniforms=this.uniforms),c}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:c,_distanceMaterial:f}=this;c&&c.dispose(),f&&f.dispose(),i.dispose.call(this)}}};return n[t]=a,new a}function x9(i,{vertexShader:e,fragmentShader:t},n,r){let{vertexDefs:s,vertexMainIntro:a,vertexMainOutro:o,vertexTransform:l,fragmentDefs:c,fragmentMainIntro:f,fragmentMainOutro:d,fragmentColorTransform:p,customRewriter:m,timeUniform:v}=n;if(s=s||"",a=a||"",o=o||"",c=c||"",f=f||"",d=d||"",(l||m)&&(e=Dx(e)),(p||m)&&(t=t.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,`
3932
3932
  //!BEGIN_POST_CHUNK $1
3933
3933
  $&
3934
3934
  //!END_POST_CHUNK
@@ -3951,32 +3951,32 @@ troika_normal_${r} = vec3(normal);
3951
3951
  troika_uv_${r} = vec2(uv);
3952
3952
  troikaVertexTransform${r}(troika_position_${r}, troika_normal_${r}, troika_uv_${r});
3953
3953
  ${a}
3954
- `,e=e.replace(/\b(position|normal|uv)\b/g,(x,_,g,b)=>/\battribute\s+vec[23]\s+$/.test(b.substr(0,g))?_:`troika_${_}_${r}`),i.map&&i.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${r}`))),e=WT(e,r,s,a,o),t=WT(t,r,c,f,d),{vertexShader:e,fragmentShader:t}}function WT(i,e,t,n,r){return(n||r||t)&&(i=i.replace(_3,`
3954
+ `,e=e.replace(/\b(position|normal|uv)\b/g,(x,_,g,b)=>/\battribute\s+vec[23]\s+$/.test(b.substr(0,g))?_:`troika_${_}_${r}`),i.map&&i.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${r}`))),e=WT(e,r,s,a,o),t=WT(t,r,c,f,d),{vertexShader:e,fragmentShader:t}}function WT(i,e,t,n,r){return(n||r||t)&&(i=i.replace(y3,`
3955
3955
  ${t}
3956
3956
  void troikaOrigMain${e}() {`),i+=`
3957
3957
  void main() {
3958
3958
  ${n}
3959
3959
  troikaOrigMain${e}();
3960
3960
  ${r}
3961
- }`),i}function x9(i,e){return i==="uniforms"?void 0:typeof e=="function"?e.toString():e}let b9=0;const XT=new Map;function S9(i){const e=JSON.stringify(i,x9);let t=XT.get(e);return t==null&&XT.set(e,t=++b9),t}/*!
3961
+ }`),i}function b9(i,e){return i==="uniforms"?void 0:typeof e=="function"?e.toString():e}let S9=0;const XT=new Map;function E9(i){const e=JSON.stringify(i,b9);let t=XT.get(e);return t==null&&XT.set(e,t=++S9),t}/*!
3962
3962
  Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering.
3963
3963
  Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE
3964
- */function E9(){return typeof window>"u"&&(self.window=self),function(i){var e={parse:function(r){var s=e._bin,a=new Uint8Array(r);if(s.readASCII(a,0,4)=="ttcf"){var o=4;s.readUshort(a,o),o+=2,s.readUshort(a,o),o+=2;var l=s.readUint(a,o);o+=4;for(var c=[],f=0;f<l;f++){var d=s.readUint(a,o);o+=4,c.push(e._readFont(a,d))}return c}return[e._readFont(a,0)]},_readFont:function(r,s){var a=e._bin,o=s;a.readFixed(r,s),s+=4;var l=a.readUshort(r,s);s+=2,a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2;for(var c=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],f={_data:r,_offset:o},d={},p=0;p<l;p++){var m=a.readASCII(r,s,4);s+=4,a.readUint(r,s),s+=4;var v=a.readUint(r,s);s+=4;var x=a.readUint(r,s);s+=4,d[m]={offset:v,length:x}}for(p=0;p<c.length;p++){var _=c[p];d[_]&&(f[_.trim()]=e[_.trim()].parse(r,d[_].offset,d[_].length,f))}return f},_tabOffset:function(r,s,a){for(var o=e._bin,l=o.readUshort(r,a+4),c=a+12,f=0;f<l;f++){var d=o.readASCII(r,c,4);c+=4,o.readUint(r,c),c+=4;var p=o.readUint(r,c);if(c+=4,o.readUint(r,c),c+=4,d==s)return p}return 0}};e._bin={readFixed:function(r,s){return(r[s]<<8|r[s+1])+(r[s+2]<<8|r[s+3])/65540},readF2dot14:function(r,s){return e._bin.readShort(r,s)/16384},readInt:function(r,s){return e._bin._view(r).getInt32(s)},readInt8:function(r,s){return e._bin._view(r).getInt8(s)},readShort:function(r,s){return e._bin._view(r).getInt16(s)},readUshort:function(r,s){return e._bin._view(r).getUint16(s)},readUshorts:function(r,s,a){for(var o=[],l=0;l<a;l++)o.push(e._bin.readUshort(r,s+2*l));return o},readUint:function(r,s){return e._bin._view(r).getUint32(s)},readUint64:function(r,s){return 4294967296*e._bin.readUint(r,s)+e._bin.readUint(r,s+4)},readASCII:function(r,s,a){for(var o="",l=0;l<a;l++)o+=String.fromCharCode(r[s+l]);return o},readUnicode:function(r,s,a){for(var o="",l=0;l<a;l++){var c=r[s++]<<8|r[s++];o+=String.fromCharCode(c)}return o},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(r,s,a){var o=e._bin._tdec;return o&&s==0&&a==r.length?o.decode(r):e._bin.readASCII(r,s,a)},readBytes:function(r,s,a){for(var o=[],l=0;l<a;l++)o.push(r[s+l]);return o},readASCIIArray:function(r,s,a){for(var o=[],l=0;l<a;l++)o.push(String.fromCharCode(r[s+l]));return o},_view:function(r){return r._dataView||(r._dataView=r.buffer?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(new Uint8Array(r).buffer))}},e._lctf={},e._lctf.parse=function(r,s,a,o,l){var c=e._bin,f={},d=s;c.readFixed(r,s),s+=4;var p=c.readUshort(r,s);s+=2;var m=c.readUshort(r,s);s+=2;var v=c.readUshort(r,s);return s+=2,f.scriptList=e._lctf.readScriptList(r,d+p),f.featureList=e._lctf.readFeatureList(r,d+m),f.lookupList=e._lctf.readLookupList(r,d+v,l),f},e._lctf.readLookupList=function(r,s,a){var o=e._bin,l=s,c=[],f=o.readUshort(r,s);s+=2;for(var d=0;d<f;d++){var p=o.readUshort(r,s);s+=2;var m=e._lctf.readLookupTable(r,l+p,a);c.push(m)}return c},e._lctf.readLookupTable=function(r,s,a){var o=e._bin,l=s,c={tabs:[]};c.ltype=o.readUshort(r,s),s+=2,c.flag=o.readUshort(r,s),s+=2;var f=o.readUshort(r,s);s+=2;for(var d=c.ltype,p=0;p<f;p++){var m=o.readUshort(r,s);s+=2;var v=a(r,d,l+m,c);c.tabs.push(v)}return c},e._lctf.numOfOnes=function(r){for(var s=0,a=0;a<32;a++)(r>>>a&1)!=0&&s++;return s},e._lctf.readClassDef=function(r,s){var a=e._bin,o=[],l=a.readUshort(r,s);if(s+=2,l==1){var c=a.readUshort(r,s);s+=2;var f=a.readUshort(r,s);s+=2;for(var d=0;d<f;d++)o.push(c+d),o.push(c+d),o.push(a.readUshort(r,s)),s+=2}if(l==2){var p=a.readUshort(r,s);for(s+=2,d=0;d<p;d++)o.push(a.readUshort(r,s)),s+=2,o.push(a.readUshort(r,s)),s+=2,o.push(a.readUshort(r,s)),s+=2}return o},e._lctf.getInterval=function(r,s){for(var a=0;a<r.length;a+=3){var o=r[a],l=r[a+1];if(r[a+2],o<=s&&s<=l)return a}return-1},e._lctf.readCoverage=function(r,s){var a=e._bin,o={};o.fmt=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);return s+=2,o.fmt==1&&(o.tab=a.readUshorts(r,s,l)),o.fmt==2&&(o.tab=a.readUshorts(r,s,3*l)),o},e._lctf.coverageIndex=function(r,s){var a=r.tab;if(r.fmt==1)return a.indexOf(s);if(r.fmt==2){var o=e._lctf.getInterval(a,s);if(o!=-1)return a[o+2]+(s-a[o])}return-1},e._lctf.readFeatureList=function(r,s){var a=e._bin,o=s,l=[],c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=a.readASCII(r,s,4);s+=4;var p=a.readUshort(r,s);s+=2;var m=e._lctf.readFeatureTable(r,o+p);m.tag=d.trim(),l.push(m)}return l},e._lctf.readFeatureTable=function(r,s){var a=e._bin,o=s,l={},c=a.readUshort(r,s);s+=2,c>0&&(l.featureParams=o+c);var f=a.readUshort(r,s);s+=2,l.tab=[];for(var d=0;d<f;d++)l.tab.push(a.readUshort(r,s+2*d));return l},e._lctf.readScriptList=function(r,s){var a=e._bin,o=s,l={},c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=a.readASCII(r,s,4);s+=4;var p=a.readUshort(r,s);s+=2,l[d.trim()]=e._lctf.readScriptTable(r,o+p)}return l},e._lctf.readScriptTable=function(r,s){var a=e._bin,o=s,l={},c=a.readUshort(r,s);s+=2,c>0&&(l.default=e._lctf.readLangSysTable(r,o+c));var f=a.readUshort(r,s);s+=2;for(var d=0;d<f;d++){var p=a.readASCII(r,s,4);s+=4;var m=a.readUshort(r,s);s+=2,l[p.trim()]=e._lctf.readLangSysTable(r,o+m)}return l},e._lctf.readLangSysTable=function(r,s){var a=e._bin,o={};a.readUshort(r,s),s+=2,o.reqFeature=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);return s+=2,o.features=a.readUshorts(r,s,l),o},e.CFF={},e.CFF.parse=function(r,s,a){var o=e._bin;(r=new Uint8Array(r.buffer,s,a))[s=0],r[++s],r[++s],r[++s],s++;var l=[];s=e.CFF.readIndex(r,s,l);for(var c=[],f=0;f<l.length-1;f++)c.push(o.readASCII(r,s+l[f],l[f+1]-l[f]));s+=l[l.length-1];var d=[];s=e.CFF.readIndex(r,s,d);var p=[];for(f=0;f<d.length-1;f++)p.push(e.CFF.readDict(r,s+d[f],s+d[f+1]));s+=d[d.length-1];var m=p[0],v=[];s=e.CFF.readIndex(r,s,v);var x=[];for(f=0;f<v.length-1;f++)x.push(o.readASCII(r,s+v[f],v[f+1]-v[f]));if(s+=v[v.length-1],e.CFF.readSubrs(r,s,m),m.CharStrings){s=m.CharStrings,v=[],s=e.CFF.readIndex(r,s,v);var _=[];for(f=0;f<v.length-1;f++)_.push(o.readBytes(r,s+v[f],v[f+1]-v[f]));m.CharStrings=_}if(m.ROS){s=m.FDArray;var g=[];for(s=e.CFF.readIndex(r,s,g),m.FDArray=[],f=0;f<g.length-1;f++){var b=e.CFF.readDict(r,s+g[f],s+g[f+1]);e.CFF._readFDict(r,b,x),m.FDArray.push(b)}s+=g[g.length-1],s=m.FDSelect,m.FDSelect=[];var S=r[s];if(s++,S!=3)throw S;var E=o.readUshort(r,s);for(s+=2,f=0;f<E+1;f++)m.FDSelect.push(o.readUshort(r,s),r[s+2]),s+=3}return m.Encoding&&(m.Encoding=e.CFF.readEncoding(r,m.Encoding,m.CharStrings.length)),m.charset&&(m.charset=e.CFF.readCharset(r,m.charset,m.CharStrings.length)),e.CFF._readFDict(r,m,x),m},e.CFF._readFDict=function(r,s,a){var o;for(var l in s.Private&&(o=s.Private[1],s.Private=e.CFF.readDict(r,o,o+s.Private[0]),s.Private.Subrs&&e.CFF.readSubrs(r,o+s.Private.Subrs,s.Private)),s)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(l)!=-1&&(s[l]=a[s[l]-426+35])},e.CFF.readSubrs=function(r,s,a){var o=e._bin,l=[];s=e.CFF.readIndex(r,s,l);var c,f=l.length;c=f<1240?107:f<33900?1131:32768,a.Bias=c,a.Subrs=[];for(var d=0;d<l.length-1;d++)a.Subrs.push(o.readBytes(r,s+l[d],l[d+1]-l[d]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(r,s){for(var a=0;a<r.charset.length;a++)if(r.charset[a]==s)return a;return-1},e.CFF.glyphBySE=function(r,s){return s<0||s>255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[s])},e.CFF.readEncoding=function(r,s,a){e._bin;var o=[".notdef"],l=r[s];if(s++,l!=0)throw"error: unknown encoding format: "+l;var c=r[s];s++;for(var f=0;f<c;f++)o.push(r[s+f]);return o},e.CFF.readCharset=function(r,s,a){var o=e._bin,l=[".notdef"],c=r[s];if(s++,c==0)for(var f=0;f<a;f++){var d=o.readUshort(r,s);s+=2,l.push(d)}else{if(c!=1&&c!=2)throw"error: format: "+c;for(;l.length<a;){d=o.readUshort(r,s),s+=2;var p=0;for(c==1?(p=r[s],s++):(p=o.readUshort(r,s),s+=2),f=0;f<=p;f++)l.push(d),d++}}return l},e.CFF.readIndex=function(r,s,a){var o=e._bin,l=o.readUshort(r,s)+1,c=r[s+=2];if(s++,c==1)for(var f=0;f<l;f++)a.push(r[s+f]);else if(c==2)for(f=0;f<l;f++)a.push(o.readUshort(r,s+2*f));else if(c==3)for(f=0;f<l;f++)a.push(16777215&o.readUint(r,s+3*f-1));else if(l!=1)throw"unsupported offset size: "+c+", count: "+l;return(s+=l*c)-1},e.CFF.getCharString=function(r,s,a){var o=e._bin,l=r[s],c=r[s+1];r[s+2],r[s+3],r[s+4];var f=1,d=null,p=null;l<=20&&(d=l,f=1),l==12&&(d=100*l+c,f=2),21<=l&&l<=27&&(d=l,f=1),l==28&&(p=o.readShort(r,s+1),f=3),29<=l&&l<=31&&(d=l,f=1),32<=l&&l<=246&&(p=l-139,f=1),247<=l&&l<=250&&(p=256*(l-247)+c+108,f=2),251<=l&&l<=254&&(p=256*-(l-251)-c-108,f=2),l==255&&(p=o.readInt(r,s+1)/65535,f=5),a.val=p??"o"+d,a.size=f},e.CFF.readCharString=function(r,s,a){for(var o=s+a,l=e._bin,c=[];s<o;){var f=r[s],d=r[s+1];r[s+2],r[s+3],r[s+4];var p=1,m=null,v=null;f<=20&&(m=f,p=1),f==12&&(m=100*f+d,p=2),f!=19&&f!=20||(m=f,p=2),21<=f&&f<=27&&(m=f,p=1),f==28&&(v=l.readShort(r,s+1),p=3),29<=f&&f<=31&&(m=f,p=1),32<=f&&f<=246&&(v=f-139,p=1),247<=f&&f<=250&&(v=256*(f-247)+d+108,p=2),251<=f&&f<=254&&(v=256*-(f-251)-d-108,p=2),f==255&&(v=l.readInt(r,s+1)/65535,p=5),c.push(v??"o"+m),s+=p}return c},e.CFF.readDict=function(r,s,a){for(var o=e._bin,l={},c=[];s<a;){var f=r[s],d=r[s+1];r[s+2],r[s+3],r[s+4];var p=1,m=null,v=null;if(f==28&&(v=o.readShort(r,s+1),p=3),f==29&&(v=o.readInt(r,s+1),p=5),32<=f&&f<=246&&(v=f-139,p=1),247<=f&&f<=250&&(v=256*(f-247)+d+108,p=2),251<=f&&f<=254&&(v=256*-(f-251)-d-108,p=2),f==255)throw v=o.readInt(r,s+1)/65535,p=5,"unknown number";if(f==30){var x=[];for(p=1;;){var _=r[s+p];p++;var g=_>>4,b=15&_;if(g!=15&&x.push(g),b!=15&&x.push(b),b==15)break}for(var S="",E=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],w=0;w<x.length;w++)S+=E[x[w]];v=parseFloat(S)}f<=21&&(m=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][f],p=1,f==12&&(m=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][d],p=2)),m!=null?(l[m]=c.length==1?c[0]:c,c=[]):c.push(v),s+=p}return l},e.cmap={},e.cmap.parse=function(r,s,a){r=new Uint8Array(r.buffer,s,a),s=0;var o=e._bin,l={};o.readUshort(r,s),s+=2;var c=o.readUshort(r,s);s+=2;var f=[];l.tables=[];for(var d=0;d<c;d++){var p=o.readUshort(r,s);s+=2;var m=o.readUshort(r,s);s+=2;var v=o.readUint(r,s);s+=4;var x="p"+p+"e"+m,_=f.indexOf(v);if(_==-1){var g;_=l.tables.length,f.push(v);var b=o.readUshort(r,v);b==0?g=e.cmap.parse0(r,v):b==4?g=e.cmap.parse4(r,v):b==6?g=e.cmap.parse6(r,v):b==12?g=e.cmap.parse12(r,v):console.debug("unknown format: "+b,p,m,v),l.tables.push(g)}if(l[x]!=null)throw"multiple tables for one platform+encoding";l[x]=_}return l},e.cmap.parse0=function(r,s){var a=e._bin,o={};o.format=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);s+=2,a.readUshort(r,s),s+=2,o.map=[];for(var c=0;c<l-6;c++)o.map.push(r[s+c]);return o},e.cmap.parse4=function(r,s){var a=e._bin,o=s,l={};l.format=a.readUshort(r,s),s+=2;var c=a.readUshort(r,s);s+=2,a.readUshort(r,s),s+=2;var f=a.readUshort(r,s);s+=2;var d=f/2;l.searchRange=a.readUshort(r,s),s+=2,l.entrySelector=a.readUshort(r,s),s+=2,l.rangeShift=a.readUshort(r,s),s+=2,l.endCount=a.readUshorts(r,s,d),s+=2*d,s+=2,l.startCount=a.readUshorts(r,s,d),s+=2*d,l.idDelta=[];for(var p=0;p<d;p++)l.idDelta.push(a.readShort(r,s)),s+=2;for(l.idRangeOffset=a.readUshorts(r,s,d),s+=2*d,l.glyphIdArray=[];s<o+c;)l.glyphIdArray.push(a.readUshort(r,s)),s+=2;return l},e.cmap.parse6=function(r,s){var a=e._bin,o={};o.format=a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2,o.firstCode=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);s+=2,o.glyphIdArray=[];for(var c=0;c<l;c++)o.glyphIdArray.push(a.readUshort(r,s)),s+=2;return o},e.cmap.parse12=function(r,s){var a=e._bin,o={};o.format=a.readUshort(r,s),s+=2,s+=2,a.readUint(r,s),s+=4,a.readUint(r,s),s+=4;var l=a.readUint(r,s);s+=4,o.groups=[];for(var c=0;c<l;c++){var f=s+12*c,d=a.readUint(r,f+0),p=a.readUint(r,f+4),m=a.readUint(r,f+8);o.groups.push([d,p,m])}return o},e.glyf={},e.glyf.parse=function(r,s,a,o){for(var l=[],c=0;c<o.maxp.numGlyphs;c++)l.push(null);return l},e.glyf._parseGlyf=function(r,s){var a=e._bin,o=r._data,l=e._tabOffset(o,"glyf",r._offset)+r.loca[s];if(r.loca[s]==r.loca[s+1])return null;var c={};if(c.noc=a.readShort(o,l),l+=2,c.xMin=a.readShort(o,l),l+=2,c.yMin=a.readShort(o,l),l+=2,c.xMax=a.readShort(o,l),l+=2,c.yMax=a.readShort(o,l),l+=2,c.xMin>=c.xMax||c.yMin>=c.yMax)return null;if(c.noc>0){c.endPts=[];for(var f=0;f<c.noc;f++)c.endPts.push(a.readUshort(o,l)),l+=2;var d=a.readUshort(o,l);if(l+=2,o.length-l<d)return null;c.instructions=a.readBytes(o,l,d),l+=d;var p=c.endPts[c.noc-1]+1;for(c.flags=[],f=0;f<p;f++){var m=o[l];if(l++,c.flags.push(m),(8&m)!=0){var v=o[l];l++;for(var x=0;x<v;x++)c.flags.push(m),f++}}for(c.xs=[],f=0;f<p;f++){var _=(2&c.flags[f])!=0,g=(16&c.flags[f])!=0;_?(c.xs.push(g?o[l]:-o[l]),l++):g?c.xs.push(0):(c.xs.push(a.readShort(o,l)),l+=2)}for(c.ys=[],f=0;f<p;f++)_=(4&c.flags[f])!=0,g=(32&c.flags[f])!=0,_?(c.ys.push(g?o[l]:-o[l]),l++):g?c.ys.push(0):(c.ys.push(a.readShort(o,l)),l+=2);var b=0,S=0;for(f=0;f<p;f++)b+=c.xs[f],S+=c.ys[f],c.xs[f]=b,c.ys[f]=S}else{var E;c.parts=[];do{E=a.readUshort(o,l),l+=2;var w={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(c.parts.push(w),w.glyphIndex=a.readUshort(o,l),l+=2,1&E){var T=a.readShort(o,l);l+=2;var C=a.readShort(o,l);l+=2}else T=a.readInt8(o,l),l++,C=a.readInt8(o,l),l++;2&E?(w.m.tx=T,w.m.ty=C):(w.p1=T,w.p2=C),8&E?(w.m.a=w.m.d=a.readF2dot14(o,l),l+=2):64&E?(w.m.a=a.readF2dot14(o,l),l+=2,w.m.d=a.readF2dot14(o,l),l+=2):128&E&&(w.m.a=a.readF2dot14(o,l),l+=2,w.m.b=a.readF2dot14(o,l),l+=2,w.m.c=a.readF2dot14(o,l),l+=2,w.m.d=a.readF2dot14(o,l),l+=2)}while(32&E);if(256&E){var U=a.readUshort(o,l);for(l+=2,c.instr=[],f=0;f<U;f++)c.instr.push(o[l]),l++}}return c},e.GDEF={},e.GDEF.parse=function(r,s,a,o){var l=s;s+=4;var c=e._bin.readUshort(r,s);return{glyphClassDef:c===0?null:e._lctf.readClassDef(r,l+c)}},e.GPOS={},e.GPOS.parse=function(r,s,a,o){return e._lctf.parse(r,s,a,o,e.GPOS.subt)},e.GPOS.subt=function(r,s,a,o){var l=e._bin,c=a,f={};if(f.fmt=l.readUshort(r,a),a+=2,s==1||s==2||s==3||s==7||s==8&&f.fmt<=2){var d=l.readUshort(r,a);a+=2,f.coverage=e._lctf.readCoverage(r,d+c)}if(s==1&&f.fmt==1){var p=l.readUshort(r,a);a+=2,p!=0&&(f.pos=e.GPOS.readValueRecord(r,a,p))}else if(s==2&&f.fmt>=1&&f.fmt<=2){p=l.readUshort(r,a),a+=2;var m=l.readUshort(r,a);a+=2;var v=e._lctf.numOfOnes(p),x=e._lctf.numOfOnes(m);if(f.fmt==1){f.pairsets=[];var _=l.readUshort(r,a);a+=2;for(var g=0;g<_;g++){var b=c+l.readUshort(r,a);a+=2;var S=l.readUshort(r,b);b+=2;for(var E=[],w=0;w<S;w++){var T=l.readUshort(r,b);b+=2,p!=0&&(z=e.GPOS.readValueRecord(r,b,p),b+=2*v),m!=0&&(O=e.GPOS.readValueRecord(r,b,m),b+=2*x),E.push({gid2:T,val1:z,val2:O})}f.pairsets.push(E)}}if(f.fmt==2){var C=l.readUshort(r,a);a+=2;var U=l.readUshort(r,a);a+=2;var D=l.readUshort(r,a);a+=2;var R=l.readUshort(r,a);for(a+=2,f.classDef1=e._lctf.readClassDef(r,c+C),f.classDef2=e._lctf.readClassDef(r,c+U),f.matrix=[],g=0;g<D;g++){var I=[];for(w=0;w<R;w++){var z=null,O=null;p!=0&&(z=e.GPOS.readValueRecord(r,a,p),a+=2*v),m!=0&&(O=e.GPOS.readValueRecord(r,a,m),a+=2*x),I.push({val1:z,val2:O})}f.matrix.push(I)}}}else if(s==4&&f.fmt==1)f.markCoverage=e._lctf.readCoverage(r,l.readUshort(r,a)+c),f.baseCoverage=e._lctf.readCoverage(r,l.readUshort(r,a+2)+c),f.markClassCount=l.readUshort(r,a+4),f.markArray=e.GPOS.readMarkArray(r,l.readUshort(r,a+6)+c),f.baseArray=e.GPOS.readBaseArray(r,l.readUshort(r,a+8)+c,f.markClassCount);else if(s==6&&f.fmt==1)f.mark1Coverage=e._lctf.readCoverage(r,l.readUshort(r,a)+c),f.mark2Coverage=e._lctf.readCoverage(r,l.readUshort(r,a+2)+c),f.markClassCount=l.readUshort(r,a+4),f.mark1Array=e.GPOS.readMarkArray(r,l.readUshort(r,a+6)+c),f.mark2Array=e.GPOS.readBaseArray(r,l.readUshort(r,a+8)+c,f.markClassCount);else{if(s==9&&f.fmt==1){var V=l.readUshort(r,a);a+=2;var ee=l.readUint(r,a);if(a+=4,o.ltype==9)o.ltype=V;else if(o.ltype!=V)throw"invalid extension substitution";return e.GPOS.subt(r,o.ltype,c+ee)}console.debug("unsupported GPOS table LookupType",s,"format",f.fmt)}return f},e.GPOS.readValueRecord=function(r,s,a){var o=e._bin,l=[];return l.push(1&a?o.readShort(r,s):0),s+=1&a?2:0,l.push(2&a?o.readShort(r,s):0),s+=2&a?2:0,l.push(4&a?o.readShort(r,s):0),s+=4&a?2:0,l.push(8&a?o.readShort(r,s):0),s+=8&a?2:0,l},e.GPOS.readBaseArray=function(r,s,a){var o=e._bin,l=[],c=s,f=o.readUshort(r,s);s+=2;for(var d=0;d<f;d++){for(var p=[],m=0;m<a;m++)p.push(e.GPOS.readAnchorRecord(r,c+o.readUshort(r,s))),s+=2;l.push(p)}return l},e.GPOS.readMarkArray=function(r,s){var a=e._bin,o=[],l=s,c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=e.GPOS.readAnchorRecord(r,a.readUshort(r,s+2)+l);d.markClass=a.readUshort(r,s),o.push(d),s+=4}return o},e.GPOS.readAnchorRecord=function(r,s){var a=e._bin,o={};return o.fmt=a.readUshort(r,s),o.x=a.readShort(r,s+2),o.y=a.readShort(r,s+4),o},e.GSUB={},e.GSUB.parse=function(r,s,a,o){return e._lctf.parse(r,s,a,o,e.GSUB.subt)},e.GSUB.subt=function(r,s,a,o){var l=e._bin,c=a,f={};if(f.fmt=l.readUshort(r,a),a+=2,s!=1&&s!=2&&s!=4&&s!=5&&s!=6)return null;if(s==1||s==2||s==4||s==5&&f.fmt<=2||s==6&&f.fmt<=2){var d=l.readUshort(r,a);a+=2,f.coverage=e._lctf.readCoverage(r,c+d)}if(s==1&&f.fmt>=1&&f.fmt<=2){if(f.fmt==1)f.delta=l.readShort(r,a),a+=2;else if(f.fmt==2){var p=l.readUshort(r,a);a+=2,f.newg=l.readUshorts(r,a,p),a+=2*f.newg.length}}else if(s==2&&f.fmt==1){p=l.readUshort(r,a),a+=2,f.seqs=[];for(var m=0;m<p;m++){var v=l.readUshort(r,a)+c;a+=2;var x=l.readUshort(r,v);f.seqs.push(l.readUshorts(r,v+2,x))}}else if(s==4)for(f.vals=[],p=l.readUshort(r,a),a+=2,m=0;m<p;m++){var _=l.readUshort(r,a);a+=2,f.vals.push(e.GSUB.readLigatureSet(r,c+_))}else if(s==5&&f.fmt==2){if(f.fmt==2){var g=l.readUshort(r,a);a+=2,f.cDef=e._lctf.readClassDef(r,c+g),f.scset=[];var b=l.readUshort(r,a);for(a+=2,m=0;m<b;m++){var S=l.readUshort(r,a);a+=2,f.scset.push(S==0?null:e.GSUB.readSubClassSet(r,c+S))}}}else if(s==6&&f.fmt==3){if(f.fmt==3){for(m=0;m<3;m++){p=l.readUshort(r,a),a+=2;for(var E=[],w=0;w<p;w++)E.push(e._lctf.readCoverage(r,c+l.readUshort(r,a+2*w)));a+=2*p,m==0&&(f.backCvg=E),m==1&&(f.inptCvg=E),m==2&&(f.ahedCvg=E)}p=l.readUshort(r,a),a+=2,f.lookupRec=e.GSUB.readSubstLookupRecords(r,a,p)}}else{if(s==7&&f.fmt==1){var T=l.readUshort(r,a);a+=2;var C=l.readUint(r,a);if(a+=4,o.ltype==9)o.ltype=T;else if(o.ltype!=T)throw"invalid extension substitution";return e.GSUB.subt(r,o.ltype,c+C)}console.debug("unsupported GSUB table LookupType",s,"format",f.fmt)}return f},e.GSUB.readSubClassSet=function(r,s){var a=e._bin.readUshort,o=s,l=[],c=a(r,s);s+=2;for(var f=0;f<c;f++){var d=a(r,s);s+=2,l.push(e.GSUB.readSubClassRule(r,o+d))}return l},e.GSUB.readSubClassRule=function(r,s){var a=e._bin.readUshort,o={},l=a(r,s),c=a(r,s+=2);s+=2,o.input=[];for(var f=0;f<l-1;f++)o.input.push(a(r,s)),s+=2;return o.substLookupRecords=e.GSUB.readSubstLookupRecords(r,s,c),o},e.GSUB.readSubstLookupRecords=function(r,s,a){for(var o=e._bin.readUshort,l=[],c=0;c<a;c++)l.push(o(r,s),o(r,s+2)),s+=4;return l},e.GSUB.readChainSubClassSet=function(r,s){var a=e._bin,o=s,l=[],c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=a.readUshort(r,s);s+=2,l.push(e.GSUB.readChainSubClassRule(r,o+d))}return l},e.GSUB.readChainSubClassRule=function(r,s){for(var a=e._bin,o={},l=["backtrack","input","lookahead"],c=0;c<l.length;c++){var f=a.readUshort(r,s);s+=2,c==1&&f--,o[l[c]]=a.readUshorts(r,s,f),s+=2*o[l[c]].length}return f=a.readUshort(r,s),s+=2,o.subst=a.readUshorts(r,s,2*f),s+=2*o.subst.length,o},e.GSUB.readLigatureSet=function(r,s){var a=e._bin,o=s,l=[],c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=a.readUshort(r,s);s+=2,l.push(e.GSUB.readLigature(r,o+d))}return l},e.GSUB.readLigature=function(r,s){var a=e._bin,o={chain:[]};o.nglyph=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);s+=2;for(var c=0;c<l-1;c++)o.chain.push(a.readUshort(r,s)),s+=2;return o},e.head={},e.head.parse=function(r,s,a){var o=e._bin,l={};return o.readFixed(r,s),s+=4,l.fontRevision=o.readFixed(r,s),s+=4,o.readUint(r,s),s+=4,o.readUint(r,s),s+=4,l.flags=o.readUshort(r,s),s+=2,l.unitsPerEm=o.readUshort(r,s),s+=2,l.created=o.readUint64(r,s),s+=8,l.modified=o.readUint64(r,s),s+=8,l.xMin=o.readShort(r,s),s+=2,l.yMin=o.readShort(r,s),s+=2,l.xMax=o.readShort(r,s),s+=2,l.yMax=o.readShort(r,s),s+=2,l.macStyle=o.readUshort(r,s),s+=2,l.lowestRecPPEM=o.readUshort(r,s),s+=2,l.fontDirectionHint=o.readShort(r,s),s+=2,l.indexToLocFormat=o.readShort(r,s),s+=2,l.glyphDataFormat=o.readShort(r,s),s+=2,l},e.hhea={},e.hhea.parse=function(r,s,a){var o=e._bin,l={};return o.readFixed(r,s),s+=4,l.ascender=o.readShort(r,s),s+=2,l.descender=o.readShort(r,s),s+=2,l.lineGap=o.readShort(r,s),s+=2,l.advanceWidthMax=o.readUshort(r,s),s+=2,l.minLeftSideBearing=o.readShort(r,s),s+=2,l.minRightSideBearing=o.readShort(r,s),s+=2,l.xMaxExtent=o.readShort(r,s),s+=2,l.caretSlopeRise=o.readShort(r,s),s+=2,l.caretSlopeRun=o.readShort(r,s),s+=2,l.caretOffset=o.readShort(r,s),s+=2,s+=8,l.metricDataFormat=o.readShort(r,s),s+=2,l.numberOfHMetrics=o.readUshort(r,s),s+=2,l},e.hmtx={},e.hmtx.parse=function(r,s,a,o){for(var l=e._bin,c={aWidth:[],lsBearing:[]},f=0,d=0,p=0;p<o.maxp.numGlyphs;p++)p<o.hhea.numberOfHMetrics&&(f=l.readUshort(r,s),s+=2,d=l.readShort(r,s),s+=2),c.aWidth.push(f),c.lsBearing.push(d);return c},e.kern={},e.kern.parse=function(r,s,a,o){var l=e._bin,c=l.readUshort(r,s);if(s+=2,c==1)return e.kern.parseV1(r,s-2,a,o);var f=l.readUshort(r,s);s+=2;for(var d={glyph1:[],rval:[]},p=0;p<f;p++){s+=2,a=l.readUshort(r,s),s+=2;var m=l.readUshort(r,s);s+=2;var v=m>>>8;if((v&=15)!=0)throw"unknown kern table format: "+v;s=e.kern.readFormat0(r,s,d)}return d},e.kern.parseV1=function(r,s,a,o){var l=e._bin;l.readFixed(r,s),s+=4;var c=l.readUint(r,s);s+=4;for(var f={glyph1:[],rval:[]},d=0;d<c;d++){l.readUint(r,s),s+=4;var p=l.readUshort(r,s);s+=2,l.readUshort(r,s),s+=2;var m=p>>>8;if((m&=15)!=0)throw"unknown kern table format: "+m;s=e.kern.readFormat0(r,s,f)}return f},e.kern.readFormat0=function(r,s,a){var o=e._bin,l=-1,c=o.readUshort(r,s);s+=2,o.readUshort(r,s),s+=2,o.readUshort(r,s),s+=2,o.readUshort(r,s),s+=2;for(var f=0;f<c;f++){var d=o.readUshort(r,s);s+=2;var p=o.readUshort(r,s);s+=2;var m=o.readShort(r,s);s+=2,d!=l&&(a.glyph1.push(d),a.rval.push({glyph2:[],vals:[]}));var v=a.rval[a.rval.length-1];v.glyph2.push(p),v.vals.push(m),l=d}return s},e.loca={},e.loca.parse=function(r,s,a,o){var l=e._bin,c=[],f=o.head.indexToLocFormat,d=o.maxp.numGlyphs+1;if(f==0)for(var p=0;p<d;p++)c.push(l.readUshort(r,s+(p<<1))<<1);if(f==1)for(p=0;p<d;p++)c.push(l.readUint(r,s+(p<<2)));return c},e.maxp={},e.maxp.parse=function(r,s,a){var o=e._bin,l={},c=o.readUint(r,s);return s+=4,l.numGlyphs=o.readUshort(r,s),s+=2,c==65536&&(l.maxPoints=o.readUshort(r,s),s+=2,l.maxContours=o.readUshort(r,s),s+=2,l.maxCompositePoints=o.readUshort(r,s),s+=2,l.maxCompositeContours=o.readUshort(r,s),s+=2,l.maxZones=o.readUshort(r,s),s+=2,l.maxTwilightPoints=o.readUshort(r,s),s+=2,l.maxStorage=o.readUshort(r,s),s+=2,l.maxFunctionDefs=o.readUshort(r,s),s+=2,l.maxInstructionDefs=o.readUshort(r,s),s+=2,l.maxStackElements=o.readUshort(r,s),s+=2,l.maxSizeOfInstructions=o.readUshort(r,s),s+=2,l.maxComponentElements=o.readUshort(r,s),s+=2,l.maxComponentDepth=o.readUshort(r,s),s+=2),l},e.name={},e.name.parse=function(r,s,a){var o=e._bin,l={};o.readUshort(r,s),s+=2;var c=o.readUshort(r,s);s+=2,o.readUshort(r,s);for(var f,d=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],p=s+=2,m=0;m<c;m++){var v=o.readUshort(r,s);s+=2;var x=o.readUshort(r,s);s+=2;var _=o.readUshort(r,s);s+=2;var g=o.readUshort(r,s);s+=2;var b=o.readUshort(r,s);s+=2;var S=o.readUshort(r,s);s+=2;var E,w=d[g],T=p+12*c+S;if(v==0)E=o.readUnicode(r,T,b/2);else if(v==3&&x==0)E=o.readUnicode(r,T,b/2);else if(x==0)E=o.readASCII(r,T,b);else if(x==1)E=o.readUnicode(r,T,b/2);else if(x==3)E=o.readUnicode(r,T,b/2);else{if(v!=1)throw"unknown encoding "+x+", platformID: "+v;E=o.readASCII(r,T,b),console.debug("reading unknown MAC encoding "+x+" as ASCII")}var C="p"+v+","+_.toString(16);l[C]==null&&(l[C]={}),l[C][w!==void 0?w:g]=E,l[C]._lang=_}for(var U in l)if(l[U].postScriptName!=null&&l[U]._lang==1033)return l[U];for(var U in l)if(l[U].postScriptName!=null&&l[U]._lang==0)return l[U];for(var U in l)if(l[U].postScriptName!=null&&l[U]._lang==3084)return l[U];for(var U in l)if(l[U].postScriptName!=null)return l[U];for(var U in l){f=U;break}return console.debug("returning name table with languageID "+l[f]._lang),l[f]},e["OS/2"]={},e["OS/2"].parse=function(r,s,a){var o=e._bin.readUshort(r,s);s+=2;var l={};if(o==0)e["OS/2"].version0(r,s,l);else if(o==1)e["OS/2"].version1(r,s,l);else if(o==2||o==3||o==4)e["OS/2"].version2(r,s,l);else{if(o!=5)throw"unknown OS/2 table version: "+o;e["OS/2"].version5(r,s,l)}return l},e["OS/2"].version0=function(r,s,a){var o=e._bin;return a.xAvgCharWidth=o.readShort(r,s),s+=2,a.usWeightClass=o.readUshort(r,s),s+=2,a.usWidthClass=o.readUshort(r,s),s+=2,a.fsType=o.readUshort(r,s),s+=2,a.ySubscriptXSize=o.readShort(r,s),s+=2,a.ySubscriptYSize=o.readShort(r,s),s+=2,a.ySubscriptXOffset=o.readShort(r,s),s+=2,a.ySubscriptYOffset=o.readShort(r,s),s+=2,a.ySuperscriptXSize=o.readShort(r,s),s+=2,a.ySuperscriptYSize=o.readShort(r,s),s+=2,a.ySuperscriptXOffset=o.readShort(r,s),s+=2,a.ySuperscriptYOffset=o.readShort(r,s),s+=2,a.yStrikeoutSize=o.readShort(r,s),s+=2,a.yStrikeoutPosition=o.readShort(r,s),s+=2,a.sFamilyClass=o.readShort(r,s),s+=2,a.panose=o.readBytes(r,s,10),s+=10,a.ulUnicodeRange1=o.readUint(r,s),s+=4,a.ulUnicodeRange2=o.readUint(r,s),s+=4,a.ulUnicodeRange3=o.readUint(r,s),s+=4,a.ulUnicodeRange4=o.readUint(r,s),s+=4,a.achVendID=[o.readInt8(r,s),o.readInt8(r,s+1),o.readInt8(r,s+2),o.readInt8(r,s+3)],s+=4,a.fsSelection=o.readUshort(r,s),s+=2,a.usFirstCharIndex=o.readUshort(r,s),s+=2,a.usLastCharIndex=o.readUshort(r,s),s+=2,a.sTypoAscender=o.readShort(r,s),s+=2,a.sTypoDescender=o.readShort(r,s),s+=2,a.sTypoLineGap=o.readShort(r,s),s+=2,a.usWinAscent=o.readUshort(r,s),s+=2,a.usWinDescent=o.readUshort(r,s),s+=2},e["OS/2"].version1=function(r,s,a){var o=e._bin;return s=e["OS/2"].version0(r,s,a),a.ulCodePageRange1=o.readUint(r,s),s+=4,a.ulCodePageRange2=o.readUint(r,s),s+=4},e["OS/2"].version2=function(r,s,a){var o=e._bin;return s=e["OS/2"].version1(r,s,a),a.sxHeight=o.readShort(r,s),s+=2,a.sCapHeight=o.readShort(r,s),s+=2,a.usDefault=o.readUshort(r,s),s+=2,a.usBreak=o.readUshort(r,s),s+=2,a.usMaxContext=o.readUshort(r,s),s+=2},e["OS/2"].version5=function(r,s,a){var o=e._bin;return s=e["OS/2"].version2(r,s,a),a.usLowerOpticalPointSize=o.readUshort(r,s),s+=2,a.usUpperOpticalPointSize=o.readUshort(r,s),s+=2},e.post={},e.post.parse=function(r,s,a){var o=e._bin,l={};return l.version=o.readFixed(r,s),s+=4,l.italicAngle=o.readFixed(r,s),s+=4,l.underlinePosition=o.readShort(r,s),s+=2,l.underlineThickness=o.readShort(r,s),s+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(r,s){var a=r.cmap,o=-1;if(a.p0e4!=null?o=a.p0e4:a.p3e1!=null?o=a.p3e1:a.p1e0!=null?o=a.p1e0:a.p0e3!=null&&(o=a.p0e3),o==-1)throw"no familiar platform and encoding!";var l=a.tables[o];if(l.format==0)return s>=l.map.length?0:l.map[s];if(l.format==4){for(var c=-1,f=0;f<l.endCount.length;f++)if(s<=l.endCount[f]){c=f;break}return c==-1||l.startCount[c]>s?0:65535&(l.idRangeOffset[c]!=0?l.glyphIdArray[s-l.startCount[c]+(l.idRangeOffset[c]>>1)-(l.idRangeOffset.length-c)]:s+l.idDelta[c])}if(l.format==12){if(s>l.groups[l.groups.length-1][1])return 0;for(f=0;f<l.groups.length;f++){var d=l.groups[f];if(d[0]<=s&&s<=d[1])return d[2]+(s-d[0])}return 0}throw"unknown cmap table format "+l.format},e.U.glyphToPath=function(r,s){var a={cmds:[],crds:[]};if(r.SVG&&r.SVG.entries[s]){var o=r.SVG.entries[s];return o==null?a:(typeof o=="string"&&(o=e.SVG.toPath(o),r.SVG.entries[s]=o),o)}if(r.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:r.CFF.Private?r.CFF.Private.defaultWidthX:0,open:!1},c=r.CFF,f=r.CFF.Private;if(c.ROS){for(var d=0;c.FDSelect[d+2]<=s;)d+=2;f=c.FDArray[c.FDSelect[d+1]].Private}e.U._drawCFF(r.CFF.CharStrings[s],l,c,f,a)}else r.glyf&&e.U._drawGlyf(s,r,a);return a},e.U._drawGlyf=function(r,s,a){var o=s.glyf[r];o==null&&(o=s.glyf[r]=e.glyf._parseGlyf(s,r)),o!=null&&(o.noc>-1?e.U._simpleGlyph(o,a):e.U._compoGlyph(o,s,a))},e.U._simpleGlyph=function(r,s){for(var a=0;a<r.noc;a++){for(var o=a==0?0:r.endPts[a-1]+1,l=r.endPts[a],c=o;c<=l;c++){var f=c==o?l:c-1,d=c==l?o:c+1,p=1&r.flags[c],m=1&r.flags[f],v=1&r.flags[d],x=r.xs[c],_=r.ys[c];if(c==o)if(p){if(!m){e.U.P.moveTo(s,x,_);continue}e.U.P.moveTo(s,r.xs[f],r.ys[f])}else m?e.U.P.moveTo(s,r.xs[f],r.ys[f]):e.U.P.moveTo(s,(r.xs[f]+x)/2,(r.ys[f]+_)/2);p?m&&e.U.P.lineTo(s,x,_):v?e.U.P.qcurveTo(s,x,_,r.xs[d],r.ys[d]):e.U.P.qcurveTo(s,x,_,(x+r.xs[d])/2,(_+r.ys[d])/2)}e.U.P.closePath(s)}},e.U._compoGlyph=function(r,s,a){for(var o=0;o<r.parts.length;o++){var l={cmds:[],crds:[]},c=r.parts[o];e.U._drawGlyf(c.glyphIndex,s,l);for(var f=c.m,d=0;d<l.crds.length;d+=2){var p=l.crds[d],m=l.crds[d+1];a.crds.push(p*f.a+m*f.b+f.tx),a.crds.push(p*f.c+m*f.d+f.ty)}for(d=0;d<l.cmds.length;d++)a.cmds.push(l.cmds[d])}},e.U._getGlyphClass=function(r,s){var a=e._lctf.getInterval(s,r);return a==-1?0:s[a+2]},e.U._applySubs=function(r,s,a,o){for(var l=r.length-s-1,c=0;c<a.tabs.length;c++)if(a.tabs[c]!=null){var f,d=a.tabs[c];if(!d.coverage||(f=e._lctf.coverageIndex(d.coverage,r[s]))!=-1){if(a.ltype==1)r[s],d.fmt==1?r[s]=r[s]+d.delta:r[s]=d.newg[f];else if(a.ltype==4)for(var p=d.vals[f],m=0;m<p.length;m++){var v=p[m],x=v.chain.length;if(!(x>l)){for(var _=!0,g=0,b=0;b<x;b++){for(;r[s+g+(1+b)]==-1;)g++;v.chain[b]!=r[s+g+(1+b)]&&(_=!1)}if(_){for(r[s]=v.nglyph,b=0;b<x+g;b++)r[s+b+1]=-1;break}}}else if(a.ltype==5&&d.fmt==2)for(var S=e._lctf.getInterval(d.cDef,r[s]),E=d.cDef[S+2],w=d.scset[E],T=0;T<w.length;T++){var C=w[T],U=C.input;if(!(U.length>l)){for(_=!0,b=0;b<U.length;b++){var D=e._lctf.getInterval(d.cDef,r[s+1+b]);if(S==-1&&d.cDef[D+2]!=U[b]){_=!1;break}}if(_){var R=C.substLookupRecords;for(m=0;m<R.length;m+=2)R[m],R[m+1]}}}else if(a.ltype==6&&d.fmt==3){if(!e.U._glsCovered(r,d.backCvg,s-d.backCvg.length)||!e.U._glsCovered(r,d.inptCvg,s)||!e.U._glsCovered(r,d.ahedCvg,s+d.inptCvg.length))continue;var I=d.lookupRec;for(T=0;T<I.length;T+=2){S=I[T];var z=o[I[T+1]];e.U._applySubs(r,s+S,z,o)}}}}},e.U._glsCovered=function(r,s,a){for(var o=0;o<s.length;o++)if(e._lctf.coverageIndex(s[o],r[a+o])==-1)return!1;return!0},e.U.glyphsToPath=function(r,s,a){for(var o={cmds:[],crds:[]},l=0,c=0;c<s.length;c++){var f=s[c];if(f!=-1){for(var d=c<s.length-1&&s[c+1]!=-1?s[c+1]:0,p=e.U.glyphToPath(r,f),m=0;m<p.crds.length;m+=2)o.crds.push(p.crds[m]+l),o.crds.push(p.crds[m+1]);for(a&&o.cmds.push(a),m=0;m<p.cmds.length;m++)o.cmds.push(p.cmds[m]);a&&o.cmds.push("X"),l+=r.hmtx.aWidth[f],c<s.length-1&&(l+=e.U.getPairAdjustment(r,f,d))}}return o},e.U.P={},e.U.P.moveTo=function(r,s,a){r.cmds.push("M"),r.crds.push(s,a)},e.U.P.lineTo=function(r,s,a){r.cmds.push("L"),r.crds.push(s,a)},e.U.P.curveTo=function(r,s,a,o,l,c,f){r.cmds.push("C"),r.crds.push(s,a,o,l,c,f)},e.U.P.qcurveTo=function(r,s,a,o,l){r.cmds.push("Q"),r.crds.push(s,a,o,l)},e.U.P.closePath=function(r){r.cmds.push("Z")},e.U._drawCFF=function(r,s,a,o,l){for(var c=s.stack,f=s.nStems,d=s.haveWidth,p=s.width,m=s.open,v=0,x=s.x,_=s.y,g=0,b=0,S=0,E=0,w=0,T=0,C=0,U=0,D=0,R=0,I={val:0,size:0};v<r.length;){e.CFF.getCharString(r,v,I);var z=I.val;if(v+=I.size,z=="o1"||z=="o18")c.length%2!=0&&!d&&(p=c.shift()+o.nominalWidthX),f+=c.length>>1,c.length=0,d=!0;else if(z=="o3"||z=="o23")c.length%2!=0&&!d&&(p=c.shift()+o.nominalWidthX),f+=c.length>>1,c.length=0,d=!0;else if(z=="o4")c.length>1&&!d&&(p=c.shift()+o.nominalWidthX,d=!0),m&&e.U.P.closePath(l),_+=c.pop(),e.U.P.moveTo(l,x,_),m=!0;else if(z=="o5")for(;c.length>0;)x+=c.shift(),_+=c.shift(),e.U.P.lineTo(l,x,_);else if(z=="o6"||z=="o7")for(var O=c.length,V=z=="o6",ee=0;ee<O;ee++){var P=c.shift();V?x+=P:_+=P,V=!V,e.U.P.lineTo(l,x,_)}else if(z=="o8"||z=="o24"){O=c.length;for(var L=0;L+6<=O;)g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),x=S+c.shift(),_=E+c.shift(),e.U.P.curveTo(l,g,b,S,E,x,_),L+=6;z=="o24"&&(x+=c.shift(),_+=c.shift(),e.U.P.lineTo(l,x,_))}else{if(z=="o11")break;if(z=="o1234"||z=="o1235"||z=="o1236"||z=="o1237")z=="o1234"&&(b=_,S=(g=x+c.shift())+c.shift(),R=E=b+c.shift(),T=E,U=_,x=(C=(w=(D=S+c.shift())+c.shift())+c.shift())+c.shift(),e.U.P.curveTo(l,g,b,S,E,D,R),e.U.P.curveTo(l,w,T,C,U,x,_)),z=="o1235"&&(g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),D=S+c.shift(),R=E+c.shift(),w=D+c.shift(),T=R+c.shift(),C=w+c.shift(),U=T+c.shift(),x=C+c.shift(),_=U+c.shift(),c.shift(),e.U.P.curveTo(l,g,b,S,E,D,R),e.U.P.curveTo(l,w,T,C,U,x,_)),z=="o1236"&&(g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),R=E=b+c.shift(),T=E,C=(w=(D=S+c.shift())+c.shift())+c.shift(),U=T+c.shift(),x=C+c.shift(),e.U.P.curveTo(l,g,b,S,E,D,R),e.U.P.curveTo(l,w,T,C,U,x,_)),z=="o1237"&&(g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),D=S+c.shift(),R=E+c.shift(),w=D+c.shift(),T=R+c.shift(),C=w+c.shift(),U=T+c.shift(),Math.abs(C-x)>Math.abs(U-_)?x=C+c.shift():_=U+c.shift(),e.U.P.curveTo(l,g,b,S,E,D,R),e.U.P.curveTo(l,w,T,C,U,x,_));else if(z=="o14"){if(c.length>0&&!d&&(p=c.shift()+a.nominalWidthX,d=!0),c.length==4){var k=c.shift(),H=c.shift(),W=c.shift(),F=c.shift(),Y=e.CFF.glyphBySE(a,W),K=e.CFF.glyphBySE(a,F);e.U._drawCFF(a.CharStrings[Y],s,a,o,l),s.x=k,s.y=H,e.U._drawCFF(a.CharStrings[K],s,a,o,l)}m&&(e.U.P.closePath(l),m=!1)}else if(z=="o19"||z=="o20")c.length%2!=0&&!d&&(p=c.shift()+o.nominalWidthX),f+=c.length>>1,c.length=0,d=!0,v+=f+7>>3;else if(z=="o21")c.length>2&&!d&&(p=c.shift()+o.nominalWidthX,d=!0),_+=c.pop(),x+=c.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,x,_),m=!0;else if(z=="o22")c.length>1&&!d&&(p=c.shift()+o.nominalWidthX,d=!0),x+=c.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,x,_),m=!0;else if(z=="o25"){for(;c.length>6;)x+=c.shift(),_+=c.shift(),e.U.P.lineTo(l,x,_);g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),x=S+c.shift(),_=E+c.shift(),e.U.P.curveTo(l,g,b,S,E,x,_)}else if(z=="o26")for(c.length%2&&(x+=c.shift());c.length>0;)g=x,b=_+c.shift(),x=S=g+c.shift(),_=(E=b+c.shift())+c.shift(),e.U.P.curveTo(l,g,b,S,E,x,_);else if(z=="o27")for(c.length%2&&(_+=c.shift());c.length>0;)b=_,S=(g=x+c.shift())+c.shift(),E=b+c.shift(),x=S+c.shift(),_=E,e.U.P.curveTo(l,g,b,S,E,x,_);else if(z=="o10"||z=="o29"){var j=z=="o10"?o:a;if(c.length==0)console.debug("error: empty stack");else{var J=c.pop(),he=j.Subrs[J+j.Bias];s.x=x,s.y=_,s.nStems=f,s.haveWidth=d,s.width=p,s.open=m,e.U._drawCFF(he,s,a,o,l),x=s.x,_=s.y,f=s.nStems,d=s.haveWidth,p=s.width,m=s.open}}else if(z=="o30"||z=="o31"){var re=c.length,pe=(L=0,z=="o31");for(L+=re-(O=-3&re);L<O;)pe?(b=_,S=(g=x+c.shift())+c.shift(),_=(E=b+c.shift())+c.shift(),O-L==5?(x=S+c.shift(),L++):x=S,pe=!1):(g=x,b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),x=S+c.shift(),O-L==5?(_=E+c.shift(),L++):_=E,pe=!0),e.U.P.curveTo(l,g,b,S,E,x,_),L+=4}else{if((z+"").charAt(0)=="o")throw console.debug("Unknown operation: "+z,r),z;c.push(z)}}}s.x=x,s.y=_,s.nStems=f,s.haveWidth=d,s.width=p,s.open=m};var t=e,n={Typr:t};return i.Typr=t,i.default=n,Object.defineProperty(i,"__esModule",{value:!0}),i}({}).Typr}/*!
3964
+ */function M9(){return typeof window>"u"&&(self.window=self),function(i){var e={parse:function(r){var s=e._bin,a=new Uint8Array(r);if(s.readASCII(a,0,4)=="ttcf"){var o=4;s.readUshort(a,o),o+=2,s.readUshort(a,o),o+=2;var l=s.readUint(a,o);o+=4;for(var c=[],f=0;f<l;f++){var d=s.readUint(a,o);o+=4,c.push(e._readFont(a,d))}return c}return[e._readFont(a,0)]},_readFont:function(r,s){var a=e._bin,o=s;a.readFixed(r,s),s+=4;var l=a.readUshort(r,s);s+=2,a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2;for(var c=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],f={_data:r,_offset:o},d={},p=0;p<l;p++){var m=a.readASCII(r,s,4);s+=4,a.readUint(r,s),s+=4;var v=a.readUint(r,s);s+=4;var x=a.readUint(r,s);s+=4,d[m]={offset:v,length:x}}for(p=0;p<c.length;p++){var _=c[p];d[_]&&(f[_.trim()]=e[_.trim()].parse(r,d[_].offset,d[_].length,f))}return f},_tabOffset:function(r,s,a){for(var o=e._bin,l=o.readUshort(r,a+4),c=a+12,f=0;f<l;f++){var d=o.readASCII(r,c,4);c+=4,o.readUint(r,c),c+=4;var p=o.readUint(r,c);if(c+=4,o.readUint(r,c),c+=4,d==s)return p}return 0}};e._bin={readFixed:function(r,s){return(r[s]<<8|r[s+1])+(r[s+2]<<8|r[s+3])/65540},readF2dot14:function(r,s){return e._bin.readShort(r,s)/16384},readInt:function(r,s){return e._bin._view(r).getInt32(s)},readInt8:function(r,s){return e._bin._view(r).getInt8(s)},readShort:function(r,s){return e._bin._view(r).getInt16(s)},readUshort:function(r,s){return e._bin._view(r).getUint16(s)},readUshorts:function(r,s,a){for(var o=[],l=0;l<a;l++)o.push(e._bin.readUshort(r,s+2*l));return o},readUint:function(r,s){return e._bin._view(r).getUint32(s)},readUint64:function(r,s){return 4294967296*e._bin.readUint(r,s)+e._bin.readUint(r,s+4)},readASCII:function(r,s,a){for(var o="",l=0;l<a;l++)o+=String.fromCharCode(r[s+l]);return o},readUnicode:function(r,s,a){for(var o="",l=0;l<a;l++){var c=r[s++]<<8|r[s++];o+=String.fromCharCode(c)}return o},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(r,s,a){var o=e._bin._tdec;return o&&s==0&&a==r.length?o.decode(r):e._bin.readASCII(r,s,a)},readBytes:function(r,s,a){for(var o=[],l=0;l<a;l++)o.push(r[s+l]);return o},readASCIIArray:function(r,s,a){for(var o=[],l=0;l<a;l++)o.push(String.fromCharCode(r[s+l]));return o},_view:function(r){return r._dataView||(r._dataView=r.buffer?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(new Uint8Array(r).buffer))}},e._lctf={},e._lctf.parse=function(r,s,a,o,l){var c=e._bin,f={},d=s;c.readFixed(r,s),s+=4;var p=c.readUshort(r,s);s+=2;var m=c.readUshort(r,s);s+=2;var v=c.readUshort(r,s);return s+=2,f.scriptList=e._lctf.readScriptList(r,d+p),f.featureList=e._lctf.readFeatureList(r,d+m),f.lookupList=e._lctf.readLookupList(r,d+v,l),f},e._lctf.readLookupList=function(r,s,a){var o=e._bin,l=s,c=[],f=o.readUshort(r,s);s+=2;for(var d=0;d<f;d++){var p=o.readUshort(r,s);s+=2;var m=e._lctf.readLookupTable(r,l+p,a);c.push(m)}return c},e._lctf.readLookupTable=function(r,s,a){var o=e._bin,l=s,c={tabs:[]};c.ltype=o.readUshort(r,s),s+=2,c.flag=o.readUshort(r,s),s+=2;var f=o.readUshort(r,s);s+=2;for(var d=c.ltype,p=0;p<f;p++){var m=o.readUshort(r,s);s+=2;var v=a(r,d,l+m,c);c.tabs.push(v)}return c},e._lctf.numOfOnes=function(r){for(var s=0,a=0;a<32;a++)(r>>>a&1)!=0&&s++;return s},e._lctf.readClassDef=function(r,s){var a=e._bin,o=[],l=a.readUshort(r,s);if(s+=2,l==1){var c=a.readUshort(r,s);s+=2;var f=a.readUshort(r,s);s+=2;for(var d=0;d<f;d++)o.push(c+d),o.push(c+d),o.push(a.readUshort(r,s)),s+=2}if(l==2){var p=a.readUshort(r,s);for(s+=2,d=0;d<p;d++)o.push(a.readUshort(r,s)),s+=2,o.push(a.readUshort(r,s)),s+=2,o.push(a.readUshort(r,s)),s+=2}return o},e._lctf.getInterval=function(r,s){for(var a=0;a<r.length;a+=3){var o=r[a],l=r[a+1];if(r[a+2],o<=s&&s<=l)return a}return-1},e._lctf.readCoverage=function(r,s){var a=e._bin,o={};o.fmt=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);return s+=2,o.fmt==1&&(o.tab=a.readUshorts(r,s,l)),o.fmt==2&&(o.tab=a.readUshorts(r,s,3*l)),o},e._lctf.coverageIndex=function(r,s){var a=r.tab;if(r.fmt==1)return a.indexOf(s);if(r.fmt==2){var o=e._lctf.getInterval(a,s);if(o!=-1)return a[o+2]+(s-a[o])}return-1},e._lctf.readFeatureList=function(r,s){var a=e._bin,o=s,l=[],c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=a.readASCII(r,s,4);s+=4;var p=a.readUshort(r,s);s+=2;var m=e._lctf.readFeatureTable(r,o+p);m.tag=d.trim(),l.push(m)}return l},e._lctf.readFeatureTable=function(r,s){var a=e._bin,o=s,l={},c=a.readUshort(r,s);s+=2,c>0&&(l.featureParams=o+c);var f=a.readUshort(r,s);s+=2,l.tab=[];for(var d=0;d<f;d++)l.tab.push(a.readUshort(r,s+2*d));return l},e._lctf.readScriptList=function(r,s){var a=e._bin,o=s,l={},c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=a.readASCII(r,s,4);s+=4;var p=a.readUshort(r,s);s+=2,l[d.trim()]=e._lctf.readScriptTable(r,o+p)}return l},e._lctf.readScriptTable=function(r,s){var a=e._bin,o=s,l={},c=a.readUshort(r,s);s+=2,c>0&&(l.default=e._lctf.readLangSysTable(r,o+c));var f=a.readUshort(r,s);s+=2;for(var d=0;d<f;d++){var p=a.readASCII(r,s,4);s+=4;var m=a.readUshort(r,s);s+=2,l[p.trim()]=e._lctf.readLangSysTable(r,o+m)}return l},e._lctf.readLangSysTable=function(r,s){var a=e._bin,o={};a.readUshort(r,s),s+=2,o.reqFeature=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);return s+=2,o.features=a.readUshorts(r,s,l),o},e.CFF={},e.CFF.parse=function(r,s,a){var o=e._bin;(r=new Uint8Array(r.buffer,s,a))[s=0],r[++s],r[++s],r[++s],s++;var l=[];s=e.CFF.readIndex(r,s,l);for(var c=[],f=0;f<l.length-1;f++)c.push(o.readASCII(r,s+l[f],l[f+1]-l[f]));s+=l[l.length-1];var d=[];s=e.CFF.readIndex(r,s,d);var p=[];for(f=0;f<d.length-1;f++)p.push(e.CFF.readDict(r,s+d[f],s+d[f+1]));s+=d[d.length-1];var m=p[0],v=[];s=e.CFF.readIndex(r,s,v);var x=[];for(f=0;f<v.length-1;f++)x.push(o.readASCII(r,s+v[f],v[f+1]-v[f]));if(s+=v[v.length-1],e.CFF.readSubrs(r,s,m),m.CharStrings){s=m.CharStrings,v=[],s=e.CFF.readIndex(r,s,v);var _=[];for(f=0;f<v.length-1;f++)_.push(o.readBytes(r,s+v[f],v[f+1]-v[f]));m.CharStrings=_}if(m.ROS){s=m.FDArray;var g=[];for(s=e.CFF.readIndex(r,s,g),m.FDArray=[],f=0;f<g.length-1;f++){var b=e.CFF.readDict(r,s+g[f],s+g[f+1]);e.CFF._readFDict(r,b,x),m.FDArray.push(b)}s+=g[g.length-1],s=m.FDSelect,m.FDSelect=[];var S=r[s];if(s++,S!=3)throw S;var E=o.readUshort(r,s);for(s+=2,f=0;f<E+1;f++)m.FDSelect.push(o.readUshort(r,s),r[s+2]),s+=3}return m.Encoding&&(m.Encoding=e.CFF.readEncoding(r,m.Encoding,m.CharStrings.length)),m.charset&&(m.charset=e.CFF.readCharset(r,m.charset,m.CharStrings.length)),e.CFF._readFDict(r,m,x),m},e.CFF._readFDict=function(r,s,a){var o;for(var l in s.Private&&(o=s.Private[1],s.Private=e.CFF.readDict(r,o,o+s.Private[0]),s.Private.Subrs&&e.CFF.readSubrs(r,o+s.Private.Subrs,s.Private)),s)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(l)!=-1&&(s[l]=a[s[l]-426+35])},e.CFF.readSubrs=function(r,s,a){var o=e._bin,l=[];s=e.CFF.readIndex(r,s,l);var c,f=l.length;c=f<1240?107:f<33900?1131:32768,a.Bias=c,a.Subrs=[];for(var d=0;d<l.length-1;d++)a.Subrs.push(o.readBytes(r,s+l[d],l[d+1]-l[d]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(r,s){for(var a=0;a<r.charset.length;a++)if(r.charset[a]==s)return a;return-1},e.CFF.glyphBySE=function(r,s){return s<0||s>255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[s])},e.CFF.readEncoding=function(r,s,a){e._bin;var o=[".notdef"],l=r[s];if(s++,l!=0)throw"error: unknown encoding format: "+l;var c=r[s];s++;for(var f=0;f<c;f++)o.push(r[s+f]);return o},e.CFF.readCharset=function(r,s,a){var o=e._bin,l=[".notdef"],c=r[s];if(s++,c==0)for(var f=0;f<a;f++){var d=o.readUshort(r,s);s+=2,l.push(d)}else{if(c!=1&&c!=2)throw"error: format: "+c;for(;l.length<a;){d=o.readUshort(r,s),s+=2;var p=0;for(c==1?(p=r[s],s++):(p=o.readUshort(r,s),s+=2),f=0;f<=p;f++)l.push(d),d++}}return l},e.CFF.readIndex=function(r,s,a){var o=e._bin,l=o.readUshort(r,s)+1,c=r[s+=2];if(s++,c==1)for(var f=0;f<l;f++)a.push(r[s+f]);else if(c==2)for(f=0;f<l;f++)a.push(o.readUshort(r,s+2*f));else if(c==3)for(f=0;f<l;f++)a.push(16777215&o.readUint(r,s+3*f-1));else if(l!=1)throw"unsupported offset size: "+c+", count: "+l;return(s+=l*c)-1},e.CFF.getCharString=function(r,s,a){var o=e._bin,l=r[s],c=r[s+1];r[s+2],r[s+3],r[s+4];var f=1,d=null,p=null;l<=20&&(d=l,f=1),l==12&&(d=100*l+c,f=2),21<=l&&l<=27&&(d=l,f=1),l==28&&(p=o.readShort(r,s+1),f=3),29<=l&&l<=31&&(d=l,f=1),32<=l&&l<=246&&(p=l-139,f=1),247<=l&&l<=250&&(p=256*(l-247)+c+108,f=2),251<=l&&l<=254&&(p=256*-(l-251)-c-108,f=2),l==255&&(p=o.readInt(r,s+1)/65535,f=5),a.val=p??"o"+d,a.size=f},e.CFF.readCharString=function(r,s,a){for(var o=s+a,l=e._bin,c=[];s<o;){var f=r[s],d=r[s+1];r[s+2],r[s+3],r[s+4];var p=1,m=null,v=null;f<=20&&(m=f,p=1),f==12&&(m=100*f+d,p=2),f!=19&&f!=20||(m=f,p=2),21<=f&&f<=27&&(m=f,p=1),f==28&&(v=l.readShort(r,s+1),p=3),29<=f&&f<=31&&(m=f,p=1),32<=f&&f<=246&&(v=f-139,p=1),247<=f&&f<=250&&(v=256*(f-247)+d+108,p=2),251<=f&&f<=254&&(v=256*-(f-251)-d-108,p=2),f==255&&(v=l.readInt(r,s+1)/65535,p=5),c.push(v??"o"+m),s+=p}return c},e.CFF.readDict=function(r,s,a){for(var o=e._bin,l={},c=[];s<a;){var f=r[s],d=r[s+1];r[s+2],r[s+3],r[s+4];var p=1,m=null,v=null;if(f==28&&(v=o.readShort(r,s+1),p=3),f==29&&(v=o.readInt(r,s+1),p=5),32<=f&&f<=246&&(v=f-139,p=1),247<=f&&f<=250&&(v=256*(f-247)+d+108,p=2),251<=f&&f<=254&&(v=256*-(f-251)-d-108,p=2),f==255)throw v=o.readInt(r,s+1)/65535,p=5,"unknown number";if(f==30){var x=[];for(p=1;;){var _=r[s+p];p++;var g=_>>4,b=15&_;if(g!=15&&x.push(g),b!=15&&x.push(b),b==15)break}for(var S="",E=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],w=0;w<x.length;w++)S+=E[x[w]];v=parseFloat(S)}f<=21&&(m=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][f],p=1,f==12&&(m=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][d],p=2)),m!=null?(l[m]=c.length==1?c[0]:c,c=[]):c.push(v),s+=p}return l},e.cmap={},e.cmap.parse=function(r,s,a){r=new Uint8Array(r.buffer,s,a),s=0;var o=e._bin,l={};o.readUshort(r,s),s+=2;var c=o.readUshort(r,s);s+=2;var f=[];l.tables=[];for(var d=0;d<c;d++){var p=o.readUshort(r,s);s+=2;var m=o.readUshort(r,s);s+=2;var v=o.readUint(r,s);s+=4;var x="p"+p+"e"+m,_=f.indexOf(v);if(_==-1){var g;_=l.tables.length,f.push(v);var b=o.readUshort(r,v);b==0?g=e.cmap.parse0(r,v):b==4?g=e.cmap.parse4(r,v):b==6?g=e.cmap.parse6(r,v):b==12?g=e.cmap.parse12(r,v):console.debug("unknown format: "+b,p,m,v),l.tables.push(g)}if(l[x]!=null)throw"multiple tables for one platform+encoding";l[x]=_}return l},e.cmap.parse0=function(r,s){var a=e._bin,o={};o.format=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);s+=2,a.readUshort(r,s),s+=2,o.map=[];for(var c=0;c<l-6;c++)o.map.push(r[s+c]);return o},e.cmap.parse4=function(r,s){var a=e._bin,o=s,l={};l.format=a.readUshort(r,s),s+=2;var c=a.readUshort(r,s);s+=2,a.readUshort(r,s),s+=2;var f=a.readUshort(r,s);s+=2;var d=f/2;l.searchRange=a.readUshort(r,s),s+=2,l.entrySelector=a.readUshort(r,s),s+=2,l.rangeShift=a.readUshort(r,s),s+=2,l.endCount=a.readUshorts(r,s,d),s+=2*d,s+=2,l.startCount=a.readUshorts(r,s,d),s+=2*d,l.idDelta=[];for(var p=0;p<d;p++)l.idDelta.push(a.readShort(r,s)),s+=2;for(l.idRangeOffset=a.readUshorts(r,s,d),s+=2*d,l.glyphIdArray=[];s<o+c;)l.glyphIdArray.push(a.readUshort(r,s)),s+=2;return l},e.cmap.parse6=function(r,s){var a=e._bin,o={};o.format=a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2,o.firstCode=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);s+=2,o.glyphIdArray=[];for(var c=0;c<l;c++)o.glyphIdArray.push(a.readUshort(r,s)),s+=2;return o},e.cmap.parse12=function(r,s){var a=e._bin,o={};o.format=a.readUshort(r,s),s+=2,s+=2,a.readUint(r,s),s+=4,a.readUint(r,s),s+=4;var l=a.readUint(r,s);s+=4,o.groups=[];for(var c=0;c<l;c++){var f=s+12*c,d=a.readUint(r,f+0),p=a.readUint(r,f+4),m=a.readUint(r,f+8);o.groups.push([d,p,m])}return o},e.glyf={},e.glyf.parse=function(r,s,a,o){for(var l=[],c=0;c<o.maxp.numGlyphs;c++)l.push(null);return l},e.glyf._parseGlyf=function(r,s){var a=e._bin,o=r._data,l=e._tabOffset(o,"glyf",r._offset)+r.loca[s];if(r.loca[s]==r.loca[s+1])return null;var c={};if(c.noc=a.readShort(o,l),l+=2,c.xMin=a.readShort(o,l),l+=2,c.yMin=a.readShort(o,l),l+=2,c.xMax=a.readShort(o,l),l+=2,c.yMax=a.readShort(o,l),l+=2,c.xMin>=c.xMax||c.yMin>=c.yMax)return null;if(c.noc>0){c.endPts=[];for(var f=0;f<c.noc;f++)c.endPts.push(a.readUshort(o,l)),l+=2;var d=a.readUshort(o,l);if(l+=2,o.length-l<d)return null;c.instructions=a.readBytes(o,l,d),l+=d;var p=c.endPts[c.noc-1]+1;for(c.flags=[],f=0;f<p;f++){var m=o[l];if(l++,c.flags.push(m),(8&m)!=0){var v=o[l];l++;for(var x=0;x<v;x++)c.flags.push(m),f++}}for(c.xs=[],f=0;f<p;f++){var _=(2&c.flags[f])!=0,g=(16&c.flags[f])!=0;_?(c.xs.push(g?o[l]:-o[l]),l++):g?c.xs.push(0):(c.xs.push(a.readShort(o,l)),l+=2)}for(c.ys=[],f=0;f<p;f++)_=(4&c.flags[f])!=0,g=(32&c.flags[f])!=0,_?(c.ys.push(g?o[l]:-o[l]),l++):g?c.ys.push(0):(c.ys.push(a.readShort(o,l)),l+=2);var b=0,S=0;for(f=0;f<p;f++)b+=c.xs[f],S+=c.ys[f],c.xs[f]=b,c.ys[f]=S}else{var E;c.parts=[];do{E=a.readUshort(o,l),l+=2;var w={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(c.parts.push(w),w.glyphIndex=a.readUshort(o,l),l+=2,1&E){var T=a.readShort(o,l);l+=2;var C=a.readShort(o,l);l+=2}else T=a.readInt8(o,l),l++,C=a.readInt8(o,l),l++;2&E?(w.m.tx=T,w.m.ty=C):(w.p1=T,w.p2=C),8&E?(w.m.a=w.m.d=a.readF2dot14(o,l),l+=2):64&E?(w.m.a=a.readF2dot14(o,l),l+=2,w.m.d=a.readF2dot14(o,l),l+=2):128&E&&(w.m.a=a.readF2dot14(o,l),l+=2,w.m.b=a.readF2dot14(o,l),l+=2,w.m.c=a.readF2dot14(o,l),l+=2,w.m.d=a.readF2dot14(o,l),l+=2)}while(32&E);if(256&E){var U=a.readUshort(o,l);for(l+=2,c.instr=[],f=0;f<U;f++)c.instr.push(o[l]),l++}}return c},e.GDEF={},e.GDEF.parse=function(r,s,a,o){var l=s;s+=4;var c=e._bin.readUshort(r,s);return{glyphClassDef:c===0?null:e._lctf.readClassDef(r,l+c)}},e.GPOS={},e.GPOS.parse=function(r,s,a,o){return e._lctf.parse(r,s,a,o,e.GPOS.subt)},e.GPOS.subt=function(r,s,a,o){var l=e._bin,c=a,f={};if(f.fmt=l.readUshort(r,a),a+=2,s==1||s==2||s==3||s==7||s==8&&f.fmt<=2){var d=l.readUshort(r,a);a+=2,f.coverage=e._lctf.readCoverage(r,d+c)}if(s==1&&f.fmt==1){var p=l.readUshort(r,a);a+=2,p!=0&&(f.pos=e.GPOS.readValueRecord(r,a,p))}else if(s==2&&f.fmt>=1&&f.fmt<=2){p=l.readUshort(r,a),a+=2;var m=l.readUshort(r,a);a+=2;var v=e._lctf.numOfOnes(p),x=e._lctf.numOfOnes(m);if(f.fmt==1){f.pairsets=[];var _=l.readUshort(r,a);a+=2;for(var g=0;g<_;g++){var b=c+l.readUshort(r,a);a+=2;var S=l.readUshort(r,b);b+=2;for(var E=[],w=0;w<S;w++){var T=l.readUshort(r,b);b+=2,p!=0&&(z=e.GPOS.readValueRecord(r,b,p),b+=2*v),m!=0&&(O=e.GPOS.readValueRecord(r,b,m),b+=2*x),E.push({gid2:T,val1:z,val2:O})}f.pairsets.push(E)}}if(f.fmt==2){var C=l.readUshort(r,a);a+=2;var U=l.readUshort(r,a);a+=2;var D=l.readUshort(r,a);a+=2;var R=l.readUshort(r,a);for(a+=2,f.classDef1=e._lctf.readClassDef(r,c+C),f.classDef2=e._lctf.readClassDef(r,c+U),f.matrix=[],g=0;g<D;g++){var I=[];for(w=0;w<R;w++){var z=null,O=null;p!=0&&(z=e.GPOS.readValueRecord(r,a,p),a+=2*v),m!=0&&(O=e.GPOS.readValueRecord(r,a,m),a+=2*x),I.push({val1:z,val2:O})}f.matrix.push(I)}}}else if(s==4&&f.fmt==1)f.markCoverage=e._lctf.readCoverage(r,l.readUshort(r,a)+c),f.baseCoverage=e._lctf.readCoverage(r,l.readUshort(r,a+2)+c),f.markClassCount=l.readUshort(r,a+4),f.markArray=e.GPOS.readMarkArray(r,l.readUshort(r,a+6)+c),f.baseArray=e.GPOS.readBaseArray(r,l.readUshort(r,a+8)+c,f.markClassCount);else if(s==6&&f.fmt==1)f.mark1Coverage=e._lctf.readCoverage(r,l.readUshort(r,a)+c),f.mark2Coverage=e._lctf.readCoverage(r,l.readUshort(r,a+2)+c),f.markClassCount=l.readUshort(r,a+4),f.mark1Array=e.GPOS.readMarkArray(r,l.readUshort(r,a+6)+c),f.mark2Array=e.GPOS.readBaseArray(r,l.readUshort(r,a+8)+c,f.markClassCount);else{if(s==9&&f.fmt==1){var V=l.readUshort(r,a);a+=2;var ee=l.readUint(r,a);if(a+=4,o.ltype==9)o.ltype=V;else if(o.ltype!=V)throw"invalid extension substitution";return e.GPOS.subt(r,o.ltype,c+ee)}console.debug("unsupported GPOS table LookupType",s,"format",f.fmt)}return f},e.GPOS.readValueRecord=function(r,s,a){var o=e._bin,l=[];return l.push(1&a?o.readShort(r,s):0),s+=1&a?2:0,l.push(2&a?o.readShort(r,s):0),s+=2&a?2:0,l.push(4&a?o.readShort(r,s):0),s+=4&a?2:0,l.push(8&a?o.readShort(r,s):0),s+=8&a?2:0,l},e.GPOS.readBaseArray=function(r,s,a){var o=e._bin,l=[],c=s,f=o.readUshort(r,s);s+=2;for(var d=0;d<f;d++){for(var p=[],m=0;m<a;m++)p.push(e.GPOS.readAnchorRecord(r,c+o.readUshort(r,s))),s+=2;l.push(p)}return l},e.GPOS.readMarkArray=function(r,s){var a=e._bin,o=[],l=s,c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=e.GPOS.readAnchorRecord(r,a.readUshort(r,s+2)+l);d.markClass=a.readUshort(r,s),o.push(d),s+=4}return o},e.GPOS.readAnchorRecord=function(r,s){var a=e._bin,o={};return o.fmt=a.readUshort(r,s),o.x=a.readShort(r,s+2),o.y=a.readShort(r,s+4),o},e.GSUB={},e.GSUB.parse=function(r,s,a,o){return e._lctf.parse(r,s,a,o,e.GSUB.subt)},e.GSUB.subt=function(r,s,a,o){var l=e._bin,c=a,f={};if(f.fmt=l.readUshort(r,a),a+=2,s!=1&&s!=2&&s!=4&&s!=5&&s!=6)return null;if(s==1||s==2||s==4||s==5&&f.fmt<=2||s==6&&f.fmt<=2){var d=l.readUshort(r,a);a+=2,f.coverage=e._lctf.readCoverage(r,c+d)}if(s==1&&f.fmt>=1&&f.fmt<=2){if(f.fmt==1)f.delta=l.readShort(r,a),a+=2;else if(f.fmt==2){var p=l.readUshort(r,a);a+=2,f.newg=l.readUshorts(r,a,p),a+=2*f.newg.length}}else if(s==2&&f.fmt==1){p=l.readUshort(r,a),a+=2,f.seqs=[];for(var m=0;m<p;m++){var v=l.readUshort(r,a)+c;a+=2;var x=l.readUshort(r,v);f.seqs.push(l.readUshorts(r,v+2,x))}}else if(s==4)for(f.vals=[],p=l.readUshort(r,a),a+=2,m=0;m<p;m++){var _=l.readUshort(r,a);a+=2,f.vals.push(e.GSUB.readLigatureSet(r,c+_))}else if(s==5&&f.fmt==2){if(f.fmt==2){var g=l.readUshort(r,a);a+=2,f.cDef=e._lctf.readClassDef(r,c+g),f.scset=[];var b=l.readUshort(r,a);for(a+=2,m=0;m<b;m++){var S=l.readUshort(r,a);a+=2,f.scset.push(S==0?null:e.GSUB.readSubClassSet(r,c+S))}}}else if(s==6&&f.fmt==3){if(f.fmt==3){for(m=0;m<3;m++){p=l.readUshort(r,a),a+=2;for(var E=[],w=0;w<p;w++)E.push(e._lctf.readCoverage(r,c+l.readUshort(r,a+2*w)));a+=2*p,m==0&&(f.backCvg=E),m==1&&(f.inptCvg=E),m==2&&(f.ahedCvg=E)}p=l.readUshort(r,a),a+=2,f.lookupRec=e.GSUB.readSubstLookupRecords(r,a,p)}}else{if(s==7&&f.fmt==1){var T=l.readUshort(r,a);a+=2;var C=l.readUint(r,a);if(a+=4,o.ltype==9)o.ltype=T;else if(o.ltype!=T)throw"invalid extension substitution";return e.GSUB.subt(r,o.ltype,c+C)}console.debug("unsupported GSUB table LookupType",s,"format",f.fmt)}return f},e.GSUB.readSubClassSet=function(r,s){var a=e._bin.readUshort,o=s,l=[],c=a(r,s);s+=2;for(var f=0;f<c;f++){var d=a(r,s);s+=2,l.push(e.GSUB.readSubClassRule(r,o+d))}return l},e.GSUB.readSubClassRule=function(r,s){var a=e._bin.readUshort,o={},l=a(r,s),c=a(r,s+=2);s+=2,o.input=[];for(var f=0;f<l-1;f++)o.input.push(a(r,s)),s+=2;return o.substLookupRecords=e.GSUB.readSubstLookupRecords(r,s,c),o},e.GSUB.readSubstLookupRecords=function(r,s,a){for(var o=e._bin.readUshort,l=[],c=0;c<a;c++)l.push(o(r,s),o(r,s+2)),s+=4;return l},e.GSUB.readChainSubClassSet=function(r,s){var a=e._bin,o=s,l=[],c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=a.readUshort(r,s);s+=2,l.push(e.GSUB.readChainSubClassRule(r,o+d))}return l},e.GSUB.readChainSubClassRule=function(r,s){for(var a=e._bin,o={},l=["backtrack","input","lookahead"],c=0;c<l.length;c++){var f=a.readUshort(r,s);s+=2,c==1&&f--,o[l[c]]=a.readUshorts(r,s,f),s+=2*o[l[c]].length}return f=a.readUshort(r,s),s+=2,o.subst=a.readUshorts(r,s,2*f),s+=2*o.subst.length,o},e.GSUB.readLigatureSet=function(r,s){var a=e._bin,o=s,l=[],c=a.readUshort(r,s);s+=2;for(var f=0;f<c;f++){var d=a.readUshort(r,s);s+=2,l.push(e.GSUB.readLigature(r,o+d))}return l},e.GSUB.readLigature=function(r,s){var a=e._bin,o={chain:[]};o.nglyph=a.readUshort(r,s),s+=2;var l=a.readUshort(r,s);s+=2;for(var c=0;c<l-1;c++)o.chain.push(a.readUshort(r,s)),s+=2;return o},e.head={},e.head.parse=function(r,s,a){var o=e._bin,l={};return o.readFixed(r,s),s+=4,l.fontRevision=o.readFixed(r,s),s+=4,o.readUint(r,s),s+=4,o.readUint(r,s),s+=4,l.flags=o.readUshort(r,s),s+=2,l.unitsPerEm=o.readUshort(r,s),s+=2,l.created=o.readUint64(r,s),s+=8,l.modified=o.readUint64(r,s),s+=8,l.xMin=o.readShort(r,s),s+=2,l.yMin=o.readShort(r,s),s+=2,l.xMax=o.readShort(r,s),s+=2,l.yMax=o.readShort(r,s),s+=2,l.macStyle=o.readUshort(r,s),s+=2,l.lowestRecPPEM=o.readUshort(r,s),s+=2,l.fontDirectionHint=o.readShort(r,s),s+=2,l.indexToLocFormat=o.readShort(r,s),s+=2,l.glyphDataFormat=o.readShort(r,s),s+=2,l},e.hhea={},e.hhea.parse=function(r,s,a){var o=e._bin,l={};return o.readFixed(r,s),s+=4,l.ascender=o.readShort(r,s),s+=2,l.descender=o.readShort(r,s),s+=2,l.lineGap=o.readShort(r,s),s+=2,l.advanceWidthMax=o.readUshort(r,s),s+=2,l.minLeftSideBearing=o.readShort(r,s),s+=2,l.minRightSideBearing=o.readShort(r,s),s+=2,l.xMaxExtent=o.readShort(r,s),s+=2,l.caretSlopeRise=o.readShort(r,s),s+=2,l.caretSlopeRun=o.readShort(r,s),s+=2,l.caretOffset=o.readShort(r,s),s+=2,s+=8,l.metricDataFormat=o.readShort(r,s),s+=2,l.numberOfHMetrics=o.readUshort(r,s),s+=2,l},e.hmtx={},e.hmtx.parse=function(r,s,a,o){for(var l=e._bin,c={aWidth:[],lsBearing:[]},f=0,d=0,p=0;p<o.maxp.numGlyphs;p++)p<o.hhea.numberOfHMetrics&&(f=l.readUshort(r,s),s+=2,d=l.readShort(r,s),s+=2),c.aWidth.push(f),c.lsBearing.push(d);return c},e.kern={},e.kern.parse=function(r,s,a,o){var l=e._bin,c=l.readUshort(r,s);if(s+=2,c==1)return e.kern.parseV1(r,s-2,a,o);var f=l.readUshort(r,s);s+=2;for(var d={glyph1:[],rval:[]},p=0;p<f;p++){s+=2,a=l.readUshort(r,s),s+=2;var m=l.readUshort(r,s);s+=2;var v=m>>>8;if((v&=15)!=0)throw"unknown kern table format: "+v;s=e.kern.readFormat0(r,s,d)}return d},e.kern.parseV1=function(r,s,a,o){var l=e._bin;l.readFixed(r,s),s+=4;var c=l.readUint(r,s);s+=4;for(var f={glyph1:[],rval:[]},d=0;d<c;d++){l.readUint(r,s),s+=4;var p=l.readUshort(r,s);s+=2,l.readUshort(r,s),s+=2;var m=p>>>8;if((m&=15)!=0)throw"unknown kern table format: "+m;s=e.kern.readFormat0(r,s,f)}return f},e.kern.readFormat0=function(r,s,a){var o=e._bin,l=-1,c=o.readUshort(r,s);s+=2,o.readUshort(r,s),s+=2,o.readUshort(r,s),s+=2,o.readUshort(r,s),s+=2;for(var f=0;f<c;f++){var d=o.readUshort(r,s);s+=2;var p=o.readUshort(r,s);s+=2;var m=o.readShort(r,s);s+=2,d!=l&&(a.glyph1.push(d),a.rval.push({glyph2:[],vals:[]}));var v=a.rval[a.rval.length-1];v.glyph2.push(p),v.vals.push(m),l=d}return s},e.loca={},e.loca.parse=function(r,s,a,o){var l=e._bin,c=[],f=o.head.indexToLocFormat,d=o.maxp.numGlyphs+1;if(f==0)for(var p=0;p<d;p++)c.push(l.readUshort(r,s+(p<<1))<<1);if(f==1)for(p=0;p<d;p++)c.push(l.readUint(r,s+(p<<2)));return c},e.maxp={},e.maxp.parse=function(r,s,a){var o=e._bin,l={},c=o.readUint(r,s);return s+=4,l.numGlyphs=o.readUshort(r,s),s+=2,c==65536&&(l.maxPoints=o.readUshort(r,s),s+=2,l.maxContours=o.readUshort(r,s),s+=2,l.maxCompositePoints=o.readUshort(r,s),s+=2,l.maxCompositeContours=o.readUshort(r,s),s+=2,l.maxZones=o.readUshort(r,s),s+=2,l.maxTwilightPoints=o.readUshort(r,s),s+=2,l.maxStorage=o.readUshort(r,s),s+=2,l.maxFunctionDefs=o.readUshort(r,s),s+=2,l.maxInstructionDefs=o.readUshort(r,s),s+=2,l.maxStackElements=o.readUshort(r,s),s+=2,l.maxSizeOfInstructions=o.readUshort(r,s),s+=2,l.maxComponentElements=o.readUshort(r,s),s+=2,l.maxComponentDepth=o.readUshort(r,s),s+=2),l},e.name={},e.name.parse=function(r,s,a){var o=e._bin,l={};o.readUshort(r,s),s+=2;var c=o.readUshort(r,s);s+=2,o.readUshort(r,s);for(var f,d=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],p=s+=2,m=0;m<c;m++){var v=o.readUshort(r,s);s+=2;var x=o.readUshort(r,s);s+=2;var _=o.readUshort(r,s);s+=2;var g=o.readUshort(r,s);s+=2;var b=o.readUshort(r,s);s+=2;var S=o.readUshort(r,s);s+=2;var E,w=d[g],T=p+12*c+S;if(v==0)E=o.readUnicode(r,T,b/2);else if(v==3&&x==0)E=o.readUnicode(r,T,b/2);else if(x==0)E=o.readASCII(r,T,b);else if(x==1)E=o.readUnicode(r,T,b/2);else if(x==3)E=o.readUnicode(r,T,b/2);else{if(v!=1)throw"unknown encoding "+x+", platformID: "+v;E=o.readASCII(r,T,b),console.debug("reading unknown MAC encoding "+x+" as ASCII")}var C="p"+v+","+_.toString(16);l[C]==null&&(l[C]={}),l[C][w!==void 0?w:g]=E,l[C]._lang=_}for(var U in l)if(l[U].postScriptName!=null&&l[U]._lang==1033)return l[U];for(var U in l)if(l[U].postScriptName!=null&&l[U]._lang==0)return l[U];for(var U in l)if(l[U].postScriptName!=null&&l[U]._lang==3084)return l[U];for(var U in l)if(l[U].postScriptName!=null)return l[U];for(var U in l){f=U;break}return console.debug("returning name table with languageID "+l[f]._lang),l[f]},e["OS/2"]={},e["OS/2"].parse=function(r,s,a){var o=e._bin.readUshort(r,s);s+=2;var l={};if(o==0)e["OS/2"].version0(r,s,l);else if(o==1)e["OS/2"].version1(r,s,l);else if(o==2||o==3||o==4)e["OS/2"].version2(r,s,l);else{if(o!=5)throw"unknown OS/2 table version: "+o;e["OS/2"].version5(r,s,l)}return l},e["OS/2"].version0=function(r,s,a){var o=e._bin;return a.xAvgCharWidth=o.readShort(r,s),s+=2,a.usWeightClass=o.readUshort(r,s),s+=2,a.usWidthClass=o.readUshort(r,s),s+=2,a.fsType=o.readUshort(r,s),s+=2,a.ySubscriptXSize=o.readShort(r,s),s+=2,a.ySubscriptYSize=o.readShort(r,s),s+=2,a.ySubscriptXOffset=o.readShort(r,s),s+=2,a.ySubscriptYOffset=o.readShort(r,s),s+=2,a.ySuperscriptXSize=o.readShort(r,s),s+=2,a.ySuperscriptYSize=o.readShort(r,s),s+=2,a.ySuperscriptXOffset=o.readShort(r,s),s+=2,a.ySuperscriptYOffset=o.readShort(r,s),s+=2,a.yStrikeoutSize=o.readShort(r,s),s+=2,a.yStrikeoutPosition=o.readShort(r,s),s+=2,a.sFamilyClass=o.readShort(r,s),s+=2,a.panose=o.readBytes(r,s,10),s+=10,a.ulUnicodeRange1=o.readUint(r,s),s+=4,a.ulUnicodeRange2=o.readUint(r,s),s+=4,a.ulUnicodeRange3=o.readUint(r,s),s+=4,a.ulUnicodeRange4=o.readUint(r,s),s+=4,a.achVendID=[o.readInt8(r,s),o.readInt8(r,s+1),o.readInt8(r,s+2),o.readInt8(r,s+3)],s+=4,a.fsSelection=o.readUshort(r,s),s+=2,a.usFirstCharIndex=o.readUshort(r,s),s+=2,a.usLastCharIndex=o.readUshort(r,s),s+=2,a.sTypoAscender=o.readShort(r,s),s+=2,a.sTypoDescender=o.readShort(r,s),s+=2,a.sTypoLineGap=o.readShort(r,s),s+=2,a.usWinAscent=o.readUshort(r,s),s+=2,a.usWinDescent=o.readUshort(r,s),s+=2},e["OS/2"].version1=function(r,s,a){var o=e._bin;return s=e["OS/2"].version0(r,s,a),a.ulCodePageRange1=o.readUint(r,s),s+=4,a.ulCodePageRange2=o.readUint(r,s),s+=4},e["OS/2"].version2=function(r,s,a){var o=e._bin;return s=e["OS/2"].version1(r,s,a),a.sxHeight=o.readShort(r,s),s+=2,a.sCapHeight=o.readShort(r,s),s+=2,a.usDefault=o.readUshort(r,s),s+=2,a.usBreak=o.readUshort(r,s),s+=2,a.usMaxContext=o.readUshort(r,s),s+=2},e["OS/2"].version5=function(r,s,a){var o=e._bin;return s=e["OS/2"].version2(r,s,a),a.usLowerOpticalPointSize=o.readUshort(r,s),s+=2,a.usUpperOpticalPointSize=o.readUshort(r,s),s+=2},e.post={},e.post.parse=function(r,s,a){var o=e._bin,l={};return l.version=o.readFixed(r,s),s+=4,l.italicAngle=o.readFixed(r,s),s+=4,l.underlinePosition=o.readShort(r,s),s+=2,l.underlineThickness=o.readShort(r,s),s+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(r,s){var a=r.cmap,o=-1;if(a.p0e4!=null?o=a.p0e4:a.p3e1!=null?o=a.p3e1:a.p1e0!=null?o=a.p1e0:a.p0e3!=null&&(o=a.p0e3),o==-1)throw"no familiar platform and encoding!";var l=a.tables[o];if(l.format==0)return s>=l.map.length?0:l.map[s];if(l.format==4){for(var c=-1,f=0;f<l.endCount.length;f++)if(s<=l.endCount[f]){c=f;break}return c==-1||l.startCount[c]>s?0:65535&(l.idRangeOffset[c]!=0?l.glyphIdArray[s-l.startCount[c]+(l.idRangeOffset[c]>>1)-(l.idRangeOffset.length-c)]:s+l.idDelta[c])}if(l.format==12){if(s>l.groups[l.groups.length-1][1])return 0;for(f=0;f<l.groups.length;f++){var d=l.groups[f];if(d[0]<=s&&s<=d[1])return d[2]+(s-d[0])}return 0}throw"unknown cmap table format "+l.format},e.U.glyphToPath=function(r,s){var a={cmds:[],crds:[]};if(r.SVG&&r.SVG.entries[s]){var o=r.SVG.entries[s];return o==null?a:(typeof o=="string"&&(o=e.SVG.toPath(o),r.SVG.entries[s]=o),o)}if(r.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:r.CFF.Private?r.CFF.Private.defaultWidthX:0,open:!1},c=r.CFF,f=r.CFF.Private;if(c.ROS){for(var d=0;c.FDSelect[d+2]<=s;)d+=2;f=c.FDArray[c.FDSelect[d+1]].Private}e.U._drawCFF(r.CFF.CharStrings[s],l,c,f,a)}else r.glyf&&e.U._drawGlyf(s,r,a);return a},e.U._drawGlyf=function(r,s,a){var o=s.glyf[r];o==null&&(o=s.glyf[r]=e.glyf._parseGlyf(s,r)),o!=null&&(o.noc>-1?e.U._simpleGlyph(o,a):e.U._compoGlyph(o,s,a))},e.U._simpleGlyph=function(r,s){for(var a=0;a<r.noc;a++){for(var o=a==0?0:r.endPts[a-1]+1,l=r.endPts[a],c=o;c<=l;c++){var f=c==o?l:c-1,d=c==l?o:c+1,p=1&r.flags[c],m=1&r.flags[f],v=1&r.flags[d],x=r.xs[c],_=r.ys[c];if(c==o)if(p){if(!m){e.U.P.moveTo(s,x,_);continue}e.U.P.moveTo(s,r.xs[f],r.ys[f])}else m?e.U.P.moveTo(s,r.xs[f],r.ys[f]):e.U.P.moveTo(s,(r.xs[f]+x)/2,(r.ys[f]+_)/2);p?m&&e.U.P.lineTo(s,x,_):v?e.U.P.qcurveTo(s,x,_,r.xs[d],r.ys[d]):e.U.P.qcurveTo(s,x,_,(x+r.xs[d])/2,(_+r.ys[d])/2)}e.U.P.closePath(s)}},e.U._compoGlyph=function(r,s,a){for(var o=0;o<r.parts.length;o++){var l={cmds:[],crds:[]},c=r.parts[o];e.U._drawGlyf(c.glyphIndex,s,l);for(var f=c.m,d=0;d<l.crds.length;d+=2){var p=l.crds[d],m=l.crds[d+1];a.crds.push(p*f.a+m*f.b+f.tx),a.crds.push(p*f.c+m*f.d+f.ty)}for(d=0;d<l.cmds.length;d++)a.cmds.push(l.cmds[d])}},e.U._getGlyphClass=function(r,s){var a=e._lctf.getInterval(s,r);return a==-1?0:s[a+2]},e.U._applySubs=function(r,s,a,o){for(var l=r.length-s-1,c=0;c<a.tabs.length;c++)if(a.tabs[c]!=null){var f,d=a.tabs[c];if(!d.coverage||(f=e._lctf.coverageIndex(d.coverage,r[s]))!=-1){if(a.ltype==1)r[s],d.fmt==1?r[s]=r[s]+d.delta:r[s]=d.newg[f];else if(a.ltype==4)for(var p=d.vals[f],m=0;m<p.length;m++){var v=p[m],x=v.chain.length;if(!(x>l)){for(var _=!0,g=0,b=0;b<x;b++){for(;r[s+g+(1+b)]==-1;)g++;v.chain[b]!=r[s+g+(1+b)]&&(_=!1)}if(_){for(r[s]=v.nglyph,b=0;b<x+g;b++)r[s+b+1]=-1;break}}}else if(a.ltype==5&&d.fmt==2)for(var S=e._lctf.getInterval(d.cDef,r[s]),E=d.cDef[S+2],w=d.scset[E],T=0;T<w.length;T++){var C=w[T],U=C.input;if(!(U.length>l)){for(_=!0,b=0;b<U.length;b++){var D=e._lctf.getInterval(d.cDef,r[s+1+b]);if(S==-1&&d.cDef[D+2]!=U[b]){_=!1;break}}if(_){var R=C.substLookupRecords;for(m=0;m<R.length;m+=2)R[m],R[m+1]}}}else if(a.ltype==6&&d.fmt==3){if(!e.U._glsCovered(r,d.backCvg,s-d.backCvg.length)||!e.U._glsCovered(r,d.inptCvg,s)||!e.U._glsCovered(r,d.ahedCvg,s+d.inptCvg.length))continue;var I=d.lookupRec;for(T=0;T<I.length;T+=2){S=I[T];var z=o[I[T+1]];e.U._applySubs(r,s+S,z,o)}}}}},e.U._glsCovered=function(r,s,a){for(var o=0;o<s.length;o++)if(e._lctf.coverageIndex(s[o],r[a+o])==-1)return!1;return!0},e.U.glyphsToPath=function(r,s,a){for(var o={cmds:[],crds:[]},l=0,c=0;c<s.length;c++){var f=s[c];if(f!=-1){for(var d=c<s.length-1&&s[c+1]!=-1?s[c+1]:0,p=e.U.glyphToPath(r,f),m=0;m<p.crds.length;m+=2)o.crds.push(p.crds[m]+l),o.crds.push(p.crds[m+1]);for(a&&o.cmds.push(a),m=0;m<p.cmds.length;m++)o.cmds.push(p.cmds[m]);a&&o.cmds.push("X"),l+=r.hmtx.aWidth[f],c<s.length-1&&(l+=e.U.getPairAdjustment(r,f,d))}}return o},e.U.P={},e.U.P.moveTo=function(r,s,a){r.cmds.push("M"),r.crds.push(s,a)},e.U.P.lineTo=function(r,s,a){r.cmds.push("L"),r.crds.push(s,a)},e.U.P.curveTo=function(r,s,a,o,l,c,f){r.cmds.push("C"),r.crds.push(s,a,o,l,c,f)},e.U.P.qcurveTo=function(r,s,a,o,l){r.cmds.push("Q"),r.crds.push(s,a,o,l)},e.U.P.closePath=function(r){r.cmds.push("Z")},e.U._drawCFF=function(r,s,a,o,l){for(var c=s.stack,f=s.nStems,d=s.haveWidth,p=s.width,m=s.open,v=0,x=s.x,_=s.y,g=0,b=0,S=0,E=0,w=0,T=0,C=0,U=0,D=0,R=0,I={val:0,size:0};v<r.length;){e.CFF.getCharString(r,v,I);var z=I.val;if(v+=I.size,z=="o1"||z=="o18")c.length%2!=0&&!d&&(p=c.shift()+o.nominalWidthX),f+=c.length>>1,c.length=0,d=!0;else if(z=="o3"||z=="o23")c.length%2!=0&&!d&&(p=c.shift()+o.nominalWidthX),f+=c.length>>1,c.length=0,d=!0;else if(z=="o4")c.length>1&&!d&&(p=c.shift()+o.nominalWidthX,d=!0),m&&e.U.P.closePath(l),_+=c.pop(),e.U.P.moveTo(l,x,_),m=!0;else if(z=="o5")for(;c.length>0;)x+=c.shift(),_+=c.shift(),e.U.P.lineTo(l,x,_);else if(z=="o6"||z=="o7")for(var O=c.length,V=z=="o6",ee=0;ee<O;ee++){var P=c.shift();V?x+=P:_+=P,V=!V,e.U.P.lineTo(l,x,_)}else if(z=="o8"||z=="o24"){O=c.length;for(var L=0;L+6<=O;)g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),x=S+c.shift(),_=E+c.shift(),e.U.P.curveTo(l,g,b,S,E,x,_),L+=6;z=="o24"&&(x+=c.shift(),_+=c.shift(),e.U.P.lineTo(l,x,_))}else{if(z=="o11")break;if(z=="o1234"||z=="o1235"||z=="o1236"||z=="o1237")z=="o1234"&&(b=_,S=(g=x+c.shift())+c.shift(),R=E=b+c.shift(),T=E,U=_,x=(C=(w=(D=S+c.shift())+c.shift())+c.shift())+c.shift(),e.U.P.curveTo(l,g,b,S,E,D,R),e.U.P.curveTo(l,w,T,C,U,x,_)),z=="o1235"&&(g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),D=S+c.shift(),R=E+c.shift(),w=D+c.shift(),T=R+c.shift(),C=w+c.shift(),U=T+c.shift(),x=C+c.shift(),_=U+c.shift(),c.shift(),e.U.P.curveTo(l,g,b,S,E,D,R),e.U.P.curveTo(l,w,T,C,U,x,_)),z=="o1236"&&(g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),R=E=b+c.shift(),T=E,C=(w=(D=S+c.shift())+c.shift())+c.shift(),U=T+c.shift(),x=C+c.shift(),e.U.P.curveTo(l,g,b,S,E,D,R),e.U.P.curveTo(l,w,T,C,U,x,_)),z=="o1237"&&(g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),D=S+c.shift(),R=E+c.shift(),w=D+c.shift(),T=R+c.shift(),C=w+c.shift(),U=T+c.shift(),Math.abs(C-x)>Math.abs(U-_)?x=C+c.shift():_=U+c.shift(),e.U.P.curveTo(l,g,b,S,E,D,R),e.U.P.curveTo(l,w,T,C,U,x,_));else if(z=="o14"){if(c.length>0&&!d&&(p=c.shift()+a.nominalWidthX,d=!0),c.length==4){var k=c.shift(),H=c.shift(),W=c.shift(),F=c.shift(),Y=e.CFF.glyphBySE(a,W),K=e.CFF.glyphBySE(a,F);e.U._drawCFF(a.CharStrings[Y],s,a,o,l),s.x=k,s.y=H,e.U._drawCFF(a.CharStrings[K],s,a,o,l)}m&&(e.U.P.closePath(l),m=!1)}else if(z=="o19"||z=="o20")c.length%2!=0&&!d&&(p=c.shift()+o.nominalWidthX),f+=c.length>>1,c.length=0,d=!0,v+=f+7>>3;else if(z=="o21")c.length>2&&!d&&(p=c.shift()+o.nominalWidthX,d=!0),_+=c.pop(),x+=c.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,x,_),m=!0;else if(z=="o22")c.length>1&&!d&&(p=c.shift()+o.nominalWidthX,d=!0),x+=c.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,x,_),m=!0;else if(z=="o25"){for(;c.length>6;)x+=c.shift(),_+=c.shift(),e.U.P.lineTo(l,x,_);g=x+c.shift(),b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),x=S+c.shift(),_=E+c.shift(),e.U.P.curveTo(l,g,b,S,E,x,_)}else if(z=="o26")for(c.length%2&&(x+=c.shift());c.length>0;)g=x,b=_+c.shift(),x=S=g+c.shift(),_=(E=b+c.shift())+c.shift(),e.U.P.curveTo(l,g,b,S,E,x,_);else if(z=="o27")for(c.length%2&&(_+=c.shift());c.length>0;)b=_,S=(g=x+c.shift())+c.shift(),E=b+c.shift(),x=S+c.shift(),_=E,e.U.P.curveTo(l,g,b,S,E,x,_);else if(z=="o10"||z=="o29"){var j=z=="o10"?o:a;if(c.length==0)console.debug("error: empty stack");else{var J=c.pop(),he=j.Subrs[J+j.Bias];s.x=x,s.y=_,s.nStems=f,s.haveWidth=d,s.width=p,s.open=m,e.U._drawCFF(he,s,a,o,l),x=s.x,_=s.y,f=s.nStems,d=s.haveWidth,p=s.width,m=s.open}}else if(z=="o30"||z=="o31"){var re=c.length,pe=(L=0,z=="o31");for(L+=re-(O=-3&re);L<O;)pe?(b=_,S=(g=x+c.shift())+c.shift(),_=(E=b+c.shift())+c.shift(),O-L==5?(x=S+c.shift(),L++):x=S,pe=!1):(g=x,b=_+c.shift(),S=g+c.shift(),E=b+c.shift(),x=S+c.shift(),O-L==5?(_=E+c.shift(),L++):_=E,pe=!0),e.U.P.curveTo(l,g,b,S,E,x,_),L+=4}else{if((z+"").charAt(0)=="o")throw console.debug("Unknown operation: "+z,r),z;c.push(z)}}}s.x=x,s.y=_,s.nStems=f,s.haveWidth=d,s.width=p,s.open=m};var t=e,n={Typr:t};return i.Typr=t,i.default=n,Object.defineProperty(i,"__esModule",{value:!0}),i}({}).Typr}/*!
3965
3965
  Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate
3966
3966
  (https://github.com/101arrowz/fflate) for use in Troika text rendering.
3967
3967
  Original licenses apply:
3968
3968
  - fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT)
3969
3969
  - woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2)
3970
- */function M9(){return function(i){var e=Uint8Array,t=Uint16Array,n=Uint32Array,r=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(z,O){for(var V=new t(31),ee=0;ee<31;++ee)V[ee]=O+=1<<z[ee-1];var P=new n(V[30]);for(ee=1;ee<30;++ee)for(var L=V[ee];L<V[ee+1];++L)P[L]=L-V[ee]<<5|ee;return[V,P]},l=o(r,2),c=l[0],f=l[1];c[28]=258,f[258]=28;for(var d=o(s,0)[0],p=new t(32768),m=0;m<32768;++m){var v=(43690&m)>>>1|(21845&m)<<1;v=(61680&(v=(52428&v)>>>2|(13107&v)<<2))>>>4|(3855&v)<<4,p[m]=((65280&v)>>>8|(255&v)<<8)>>>1}var x=function(z,O,V){for(var ee=z.length,P=0,L=new t(O);P<ee;++P)++L[z[P]-1];var k,H=new t(O);for(P=0;P<O;++P)H[P]=H[P-1]+L[P-1]<<1;{k=new t(1<<O);var W=15-O;for(P=0;P<ee;++P)if(z[P])for(var F=P<<4|z[P],Y=O-z[P],K=H[z[P]-1]++<<Y,j=K|(1<<Y)-1;K<=j;++K)k[p[K]>>>W]=F}return k},_=new e(288);for(m=0;m<144;++m)_[m]=8;for(m=144;m<256;++m)_[m]=9;for(m=256;m<280;++m)_[m]=7;for(m=280;m<288;++m)_[m]=8;var g=new e(32);for(m=0;m<32;++m)g[m]=5;var b=x(_,9),S=x(g,5),E=function(z){for(var O=z[0],V=1;V<z.length;++V)z[V]>O&&(O=z[V]);return O},w=function(z,O,V){var ee=O/8|0;return(z[ee]|z[ee+1]<<8)>>(7&O)&V},T=function(z,O){var V=O/8|0;return(z[V]|z[V+1]<<8|z[V+2]<<16)>>(7&O)},C=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],U=function(z,O,V){var ee=new Error(O||C[z]);if(ee.code=z,Error.captureStackTrace&&Error.captureStackTrace(ee,U),!V)throw ee;return ee},D=function(z,O,V){var ee=z.length;if(!ee||V&&!V.l&&ee<5)return O||new e(0);var P=!O||V,L=!V||V.i;V||(V={}),O||(O=new e(3*ee));var k,H=function(Ve){var nt=O.length;if(Ve>nt){var We=new e(Math.max(2*nt,Ve));We.set(O),O=We}},W=V.f||0,F=V.p||0,Y=V.b||0,K=V.l,j=V.d,J=V.m,he=V.n,re=8*ee;do{if(!K){V.f=W=w(z,F,1);var pe=w(z,F+1,3);if(F+=3,!pe){var Oe=z[(_e=((k=F)/8|0)+(7&k&&1)+4)-4]|z[_e-3]<<8,be=_e+Oe;if(be>ee){L&&U(0);break}P&&H(Y+Oe),O.set(z.subarray(_e,be),Y),V.b=Y+=Oe,V.p=F=8*be;continue}if(pe==1)K=b,j=S,J=9,he=5;else if(pe==2){var ve=w(z,F,31)+257,ce=w(z,F+10,15)+4,Ne=ve+w(z,F+5,31)+1;F+=14;for(var G=new e(Ne),le=new e(19),te=0;te<ce;++te)le[a[te]]=w(z,F+3*te,7);F+=3*ce;var Me=E(le),oe=(1<<Me)-1,De=x(le,Me);for(te=0;te<Ne;){var _e,ne=De[w(z,F,oe)];if(F+=15&ne,(_e=ne>>>4)<16)G[te++]=_e;else{var Be=0,X=0;for(_e==16?(X=3+w(z,F,3),F+=2,Be=G[te-1]):_e==17?(X=3+w(z,F,7),F+=3):_e==18&&(X=11+w(z,F,127),F+=7);X--;)G[te++]=Be}}var B=G.subarray(0,ve),ie=G.subarray(ve);J=E(B),he=E(ie),K=x(B,J),j=x(ie,he)}else U(1);if(F>re){L&&U(0);break}}P&&H(Y+131072);for(var Se=(1<<J)-1,ge=(1<<he)-1,me=F;;me=F){var Fe=(Be=K[T(z,F)&Se])>>>4;if((F+=15&Be)>re){L&&U(0);break}if(Be||U(2),Fe<256)O[Y++]=Fe;else{if(Fe==256){me=F,K=null;break}var Ie=Fe-254;if(Fe>264){var je=r[te=Fe-257];Ie=w(z,F,(1<<je)-1)+c[te],F+=je}var Ze=j[T(z,F)&ge],Ce=Ze>>>4;if(Ze||U(3),F+=15&Ze,ie=d[Ce],Ce>3&&(je=s[Ce],ie+=T(z,F)&(1<<je)-1,F+=je),F>re){L&&U(0);break}P&&H(Y+131072);for(var He=Y+Ie;Y<He;Y+=4)O[Y]=O[Y-ie],O[Y+1]=O[Y+1-ie],O[Y+2]=O[Y+2-ie],O[Y+3]=O[Y+3-ie];Y=He}}V.l=K,V.p=me,V.b=Y,K&&(W=1,V.m=J,V.d=j,V.n=he)}while(!W);return Y==O.length?O:function(Ve,nt,We){(We==null||We>Ve.length)&&(We=Ve.length);var ft=new(Ve instanceof t?t:Ve instanceof n?n:e)(We-nt);return ft.set(Ve.subarray(nt,We)),ft}(O,0,Y)},R=new e(0),I=typeof TextDecoder<"u"&&new TextDecoder;try{I.decode(R,{stream:!0})}catch{}return i.convert_streams=function(z){var O=new DataView(z),V=0;function ee(){var ve=O.getUint16(V);return V+=2,ve}function P(){var ve=O.getUint32(V);return V+=4,ve}function L(ve){Oe.setUint16(be,ve),be+=2}function k(ve){Oe.setUint32(be,ve),be+=4}for(var H={signature:P(),flavor:P(),length:P(),numTables:ee(),reserved:ee(),totalSfntSize:P(),majorVersion:ee(),minorVersion:ee(),metaOffset:P(),metaLength:P(),metaOrigLength:P(),privOffset:P(),privLength:P()},W=0;Math.pow(2,W)<=H.numTables;)W++;W--;for(var F=16*Math.pow(2,W),Y=16*H.numTables-F,K=12,j=[],J=0;J<H.numTables;J++)j.push({tag:P(),offset:P(),compLength:P(),origLength:P(),origChecksum:P()}),K+=16;var he,re=new Uint8Array(12+16*j.length+j.reduce(function(ve,ce){return ve+ce.origLength+4},0)),pe=re.buffer,Oe=new DataView(pe),be=0;return k(H.flavor),L(H.numTables),L(F),L(W),L(Y),j.forEach(function(ve){k(ve.tag),k(ve.origChecksum),k(K),k(ve.origLength),ve.outOffset=K,(K+=ve.origLength)%4!=0&&(K+=4-K%4)}),j.forEach(function(ve){var ce,Ne=z.slice(ve.offset,ve.offset+ve.compLength);if(ve.compLength!=ve.origLength){var G=new Uint8Array(ve.origLength);ce=new Uint8Array(Ne,2),D(ce,G)}else G=new Uint8Array(Ne);re.set(G,ve.outOffset);var le=0;(K=ve.outOffset+ve.origLength)%4!=0&&(le=4-K%4),re.set(new Uint8Array(le).buffer,ve.outOffset+ve.origLength),he=K+le}),pe.slice(0,he)},Object.defineProperty(i,"__esModule",{value:!0}),i}({}).convert_streams}function w9(i,e){const t={M:2,L:2,Q:4,C:6,Z:0},n={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},r=1,s=2,a=4,o=8,l=16,c=32;let f;function d(C){if(!f){const U={R:s,L:r,D:a,C:l,U:c,T:o};f=new Map;for(let D in n){let R=0;n[D].split(",").forEach(I=>{let[z,O]=I.split("+");z=parseInt(z,36),O=O?parseInt(O,36):0,f.set(R+=z,U[D]);for(let V=O;V--;)f.set(++R,U[D])})}}return f.get(C)||c}const p=1,m=2,v=3,x=4,_=[null,"isol","init","fina","medi"];function g(C){const U=new Uint8Array(C.length);let D=c,R=p,I=-1;for(let z=0;z<C.length;z++){const O=C.codePointAt(z);let V=d(O)|0,ee=p;V&o||(D&(r|a|l)?V&(s|a|l)?(ee=v,(R===p||R===v)&&U[I]++):V&(r|c)&&(R===m||R===x)&&U[I]--:D&(s|c)&&(R===m||R===x)&&U[I]--,R=U[z]=ee,D=V,I=z,O>65535&&z++)}return U}function b(C,U){const D=[];for(let I=0;I<U.length;I++){const z=U.codePointAt(I);z>65535&&I++,D.push(i.U.codeToGlyph(C,z))}const R=C.GSUB;if(R){const{lookupList:I,featureList:z}=R;let O;const V=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,ee=[];z.forEach(P=>{if(V.test(P.tag))for(let L=0;L<P.tab.length;L++){if(ee[P.tab[L]])continue;ee[P.tab[L]]=!0;const k=I[P.tab[L]],H=/^(isol|init|fina|medi)$/.test(P.tag);H&&!O&&(O=g(U));for(let W=0;W<D.length;W++)(!O||!H||_[O[W]]===P.tag)&&i.U._applySubs(D,W,k,I)}})}return D}function S(C,U){const D=new Int16Array(U.length*3);let R=0;for(;R<U.length;R++){const V=U[R];if(V===-1)continue;D[R*3+2]=C.hmtx.aWidth[V];const ee=C.GPOS;if(ee){const P=ee.lookupList;for(let L=0;L<P.length;L++){const k=P[L];for(let H=0;H<k.tabs.length;H++){const W=k.tabs[H];if(k.ltype===1){if(i._lctf.coverageIndex(W.coverage,V)!==-1&&W.pos){O(W.pos,R);break}}else if(k.ltype===2){let F=null,Y=I();if(Y!==-1){const K=i._lctf.coverageIndex(W.coverage,U[Y]);if(K!==-1){if(W.fmt===1){const j=W.pairsets[K];for(let J=0;J<j.length;J++)j[J].gid2===V&&(F=j[J])}else if(W.fmt===2){const j=i.U._getGlyphClass(U[Y],W.classDef1),J=i.U._getGlyphClass(V,W.classDef2);F=W.matrix[j][J]}if(F){F.val1&&O(F.val1,Y),F.val2&&O(F.val2,R);break}}}}else if(k.ltype===4){const F=i._lctf.coverageIndex(W.markCoverage,V);if(F!==-1){const Y=I(z),K=Y===-1?-1:i._lctf.coverageIndex(W.baseCoverage,U[Y]);if(K!==-1){const j=W.markArray[F],J=W.baseArray[K][j.markClass];D[R*3]=J.x-j.x+D[Y*3]-D[Y*3+2],D[R*3+1]=J.y-j.y+D[Y*3+1];break}}}else if(k.ltype===6){const F=i._lctf.coverageIndex(W.mark1Coverage,V);if(F!==-1){const Y=I();if(Y!==-1){const K=U[Y];if(E(C,K)===3){const j=i._lctf.coverageIndex(W.mark2Coverage,K);if(j!==-1){const J=W.mark1Array[F],he=W.mark2Array[j][J.markClass];D[R*3]=he.x-J.x+D[Y*3]-D[Y*3+2],D[R*3+1]=he.y-J.y+D[Y*3+1];break}}}}}}}}else if(C.kern&&!C.cff){const P=I();if(P!==-1){const L=C.kern.glyph1.indexOf(U[P]);if(L!==-1){const k=C.kern.rval[L].glyph2.indexOf(V);k!==-1&&(D[P*3+2]+=C.kern.rval[L].vals[k])}}}}return D;function I(V){for(let ee=R-1;ee>=0;ee--)if(U[ee]!==-1&&(!V||V(U[ee])))return ee;return-1}function z(V){return E(C,V)===1}function O(V,ee){for(let P=0;P<3;P++)D[ee*3+P]+=V[P]||0}}function E(C,U){const D=C.GDEF&&C.GDEF.glyphClassDef;return D?i.U._getGlyphClass(U,D):0}function w(...C){for(let U=0;U<C.length;U++)if(typeof C[U]=="number")return C[U]}function T(C){const U=Object.create(null),D=C["OS/2"],R=C.hhea,I=C.head.unitsPerEm,z=w(D&&D.sTypoAscender,R&&R.ascender,I),O={unitsPerEm:I,ascender:z,descender:w(D&&D.sTypoDescender,R&&R.descender,0),capHeight:w(D&&D.sCapHeight,z),xHeight:w(D&&D.sxHeight,z),lineGap:w(D&&D.sTypoLineGap,R&&R.lineGap),supportsCodePoint(V){return i.U.codeToGlyph(C,V)>0},forEachGlyph(V,ee,P,L){let k=0;const H=1/O.unitsPerEm*ee,W=b(C,V);let F=0;const Y=S(C,W);return W.forEach((K,j)=>{if(K!==-1){let J=U[K];if(!J){const{cmds:he,crds:re}=i.U.glyphToPath(C,K);let pe="",Oe=0;for(let G=0,le=he.length;G<le;G++){const te=t[he[G]];pe+=he[G];for(let Me=1;Me<=te;Me++)pe+=(Me>1?",":"")+re[Oe++]}let be,ve,ce,Ne;if(re.length){be=ve=1/0,ce=Ne=-1/0;for(let G=0,le=re.length;G<le;G+=2){let te=re[G],Me=re[G+1];te<be&&(be=te),Me<ve&&(ve=Me),te>ce&&(ce=te),Me>Ne&&(Ne=Me)}}else be=ce=ve=Ne=0;J=U[K]={index:K,advanceWidth:C.hmtx.aWidth[K],xMin:be,yMin:ve,xMax:ce,yMax:Ne,path:pe}}L.call(null,J,k+Y[j*3]*H,Y[j*3+1]*H,F),k+=Y[j*3+2]*H,P&&(k+=P*ee)}F+=V.codePointAt(F)>65535?2:1}),k}};return O}return function(U){const D=new Uint8Array(U,0,4),R=i._bin.readASCII(D,0,4);if(R==="wOFF")U=e(U);else if(R==="wOF2")throw new Error("woff2 fonts not supported");return T(i.parse(U)[0])}}const T9=Uu({name:"Typr Font Parser",dependencies:[E9,M9,w9],init(i,e,t){const n=i(),r=e();return t(n,r)}});/*!
3970
+ */function w9(){return function(i){var e=Uint8Array,t=Uint16Array,n=Uint32Array,r=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(z,O){for(var V=new t(31),ee=0;ee<31;++ee)V[ee]=O+=1<<z[ee-1];var P=new n(V[30]);for(ee=1;ee<30;++ee)for(var L=V[ee];L<V[ee+1];++L)P[L]=L-V[ee]<<5|ee;return[V,P]},l=o(r,2),c=l[0],f=l[1];c[28]=258,f[258]=28;for(var d=o(s,0)[0],p=new t(32768),m=0;m<32768;++m){var v=(43690&m)>>>1|(21845&m)<<1;v=(61680&(v=(52428&v)>>>2|(13107&v)<<2))>>>4|(3855&v)<<4,p[m]=((65280&v)>>>8|(255&v)<<8)>>>1}var x=function(z,O,V){for(var ee=z.length,P=0,L=new t(O);P<ee;++P)++L[z[P]-1];var k,H=new t(O);for(P=0;P<O;++P)H[P]=H[P-1]+L[P-1]<<1;{k=new t(1<<O);var W=15-O;for(P=0;P<ee;++P)if(z[P])for(var F=P<<4|z[P],Y=O-z[P],K=H[z[P]-1]++<<Y,j=K|(1<<Y)-1;K<=j;++K)k[p[K]>>>W]=F}return k},_=new e(288);for(m=0;m<144;++m)_[m]=8;for(m=144;m<256;++m)_[m]=9;for(m=256;m<280;++m)_[m]=7;for(m=280;m<288;++m)_[m]=8;var g=new e(32);for(m=0;m<32;++m)g[m]=5;var b=x(_,9),S=x(g,5),E=function(z){for(var O=z[0],V=1;V<z.length;++V)z[V]>O&&(O=z[V]);return O},w=function(z,O,V){var ee=O/8|0;return(z[ee]|z[ee+1]<<8)>>(7&O)&V},T=function(z,O){var V=O/8|0;return(z[V]|z[V+1]<<8|z[V+2]<<16)>>(7&O)},C=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],U=function(z,O,V){var ee=new Error(O||C[z]);if(ee.code=z,Error.captureStackTrace&&Error.captureStackTrace(ee,U),!V)throw ee;return ee},D=function(z,O,V){var ee=z.length;if(!ee||V&&!V.l&&ee<5)return O||new e(0);var P=!O||V,L=!V||V.i;V||(V={}),O||(O=new e(3*ee));var k,H=function(Ve){var nt=O.length;if(Ve>nt){var We=new e(Math.max(2*nt,Ve));We.set(O),O=We}},W=V.f||0,F=V.p||0,Y=V.b||0,K=V.l,j=V.d,J=V.m,he=V.n,re=8*ee;do{if(!K){V.f=W=w(z,F,1);var pe=w(z,F+1,3);if(F+=3,!pe){var Oe=z[(_e=((k=F)/8|0)+(7&k&&1)+4)-4]|z[_e-3]<<8,be=_e+Oe;if(be>ee){L&&U(0);break}P&&H(Y+Oe),O.set(z.subarray(_e,be),Y),V.b=Y+=Oe,V.p=F=8*be;continue}if(pe==1)K=b,j=S,J=9,he=5;else if(pe==2){var ve=w(z,F,31)+257,ce=w(z,F+10,15)+4,Ne=ve+w(z,F+5,31)+1;F+=14;for(var G=new e(Ne),le=new e(19),te=0;te<ce;++te)le[a[te]]=w(z,F+3*te,7);F+=3*ce;var Me=E(le),oe=(1<<Me)-1,De=x(le,Me);for(te=0;te<Ne;){var _e,ne=De[w(z,F,oe)];if(F+=15&ne,(_e=ne>>>4)<16)G[te++]=_e;else{var Be=0,X=0;for(_e==16?(X=3+w(z,F,3),F+=2,Be=G[te-1]):_e==17?(X=3+w(z,F,7),F+=3):_e==18&&(X=11+w(z,F,127),F+=7);X--;)G[te++]=Be}}var B=G.subarray(0,ve),ie=G.subarray(ve);J=E(B),he=E(ie),K=x(B,J),j=x(ie,he)}else U(1);if(F>re){L&&U(0);break}}P&&H(Y+131072);for(var Se=(1<<J)-1,ge=(1<<he)-1,me=F;;me=F){var Fe=(Be=K[T(z,F)&Se])>>>4;if((F+=15&Be)>re){L&&U(0);break}if(Be||U(2),Fe<256)O[Y++]=Fe;else{if(Fe==256){me=F,K=null;break}var Ie=Fe-254;if(Fe>264){var je=r[te=Fe-257];Ie=w(z,F,(1<<je)-1)+c[te],F+=je}var Ze=j[T(z,F)&ge],Ce=Ze>>>4;if(Ze||U(3),F+=15&Ze,ie=d[Ce],Ce>3&&(je=s[Ce],ie+=T(z,F)&(1<<je)-1,F+=je),F>re){L&&U(0);break}P&&H(Y+131072);for(var He=Y+Ie;Y<He;Y+=4)O[Y]=O[Y-ie],O[Y+1]=O[Y+1-ie],O[Y+2]=O[Y+2-ie],O[Y+3]=O[Y+3-ie];Y=He}}V.l=K,V.p=me,V.b=Y,K&&(W=1,V.m=J,V.d=j,V.n=he)}while(!W);return Y==O.length?O:function(Ve,nt,We){(We==null||We>Ve.length)&&(We=Ve.length);var ft=new(Ve instanceof t?t:Ve instanceof n?n:e)(We-nt);return ft.set(Ve.subarray(nt,We)),ft}(O,0,Y)},R=new e(0),I=typeof TextDecoder<"u"&&new TextDecoder;try{I.decode(R,{stream:!0})}catch{}return i.convert_streams=function(z){var O=new DataView(z),V=0;function ee(){var ve=O.getUint16(V);return V+=2,ve}function P(){var ve=O.getUint32(V);return V+=4,ve}function L(ve){Oe.setUint16(be,ve),be+=2}function k(ve){Oe.setUint32(be,ve),be+=4}for(var H={signature:P(),flavor:P(),length:P(),numTables:ee(),reserved:ee(),totalSfntSize:P(),majorVersion:ee(),minorVersion:ee(),metaOffset:P(),metaLength:P(),metaOrigLength:P(),privOffset:P(),privLength:P()},W=0;Math.pow(2,W)<=H.numTables;)W++;W--;for(var F=16*Math.pow(2,W),Y=16*H.numTables-F,K=12,j=[],J=0;J<H.numTables;J++)j.push({tag:P(),offset:P(),compLength:P(),origLength:P(),origChecksum:P()}),K+=16;var he,re=new Uint8Array(12+16*j.length+j.reduce(function(ve,ce){return ve+ce.origLength+4},0)),pe=re.buffer,Oe=new DataView(pe),be=0;return k(H.flavor),L(H.numTables),L(F),L(W),L(Y),j.forEach(function(ve){k(ve.tag),k(ve.origChecksum),k(K),k(ve.origLength),ve.outOffset=K,(K+=ve.origLength)%4!=0&&(K+=4-K%4)}),j.forEach(function(ve){var ce,Ne=z.slice(ve.offset,ve.offset+ve.compLength);if(ve.compLength!=ve.origLength){var G=new Uint8Array(ve.origLength);ce=new Uint8Array(Ne,2),D(ce,G)}else G=new Uint8Array(Ne);re.set(G,ve.outOffset);var le=0;(K=ve.outOffset+ve.origLength)%4!=0&&(le=4-K%4),re.set(new Uint8Array(le).buffer,ve.outOffset+ve.origLength),he=K+le}),pe.slice(0,he)},Object.defineProperty(i,"__esModule",{value:!0}),i}({}).convert_streams}function T9(i,e){const t={M:2,L:2,Q:4,C:6,Z:0},n={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},r=1,s=2,a=4,o=8,l=16,c=32;let f;function d(C){if(!f){const U={R:s,L:r,D:a,C:l,U:c,T:o};f=new Map;for(let D in n){let R=0;n[D].split(",").forEach(I=>{let[z,O]=I.split("+");z=parseInt(z,36),O=O?parseInt(O,36):0,f.set(R+=z,U[D]);for(let V=O;V--;)f.set(++R,U[D])})}}return f.get(C)||c}const p=1,m=2,v=3,x=4,_=[null,"isol","init","fina","medi"];function g(C){const U=new Uint8Array(C.length);let D=c,R=p,I=-1;for(let z=0;z<C.length;z++){const O=C.codePointAt(z);let V=d(O)|0,ee=p;V&o||(D&(r|a|l)?V&(s|a|l)?(ee=v,(R===p||R===v)&&U[I]++):V&(r|c)&&(R===m||R===x)&&U[I]--:D&(s|c)&&(R===m||R===x)&&U[I]--,R=U[z]=ee,D=V,I=z,O>65535&&z++)}return U}function b(C,U){const D=[];for(let I=0;I<U.length;I++){const z=U.codePointAt(I);z>65535&&I++,D.push(i.U.codeToGlyph(C,z))}const R=C.GSUB;if(R){const{lookupList:I,featureList:z}=R;let O;const V=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,ee=[];z.forEach(P=>{if(V.test(P.tag))for(let L=0;L<P.tab.length;L++){if(ee[P.tab[L]])continue;ee[P.tab[L]]=!0;const k=I[P.tab[L]],H=/^(isol|init|fina|medi)$/.test(P.tag);H&&!O&&(O=g(U));for(let W=0;W<D.length;W++)(!O||!H||_[O[W]]===P.tag)&&i.U._applySubs(D,W,k,I)}})}return D}function S(C,U){const D=new Int16Array(U.length*3);let R=0;for(;R<U.length;R++){const V=U[R];if(V===-1)continue;D[R*3+2]=C.hmtx.aWidth[V];const ee=C.GPOS;if(ee){const P=ee.lookupList;for(let L=0;L<P.length;L++){const k=P[L];for(let H=0;H<k.tabs.length;H++){const W=k.tabs[H];if(k.ltype===1){if(i._lctf.coverageIndex(W.coverage,V)!==-1&&W.pos){O(W.pos,R);break}}else if(k.ltype===2){let F=null,Y=I();if(Y!==-1){const K=i._lctf.coverageIndex(W.coverage,U[Y]);if(K!==-1){if(W.fmt===1){const j=W.pairsets[K];for(let J=0;J<j.length;J++)j[J].gid2===V&&(F=j[J])}else if(W.fmt===2){const j=i.U._getGlyphClass(U[Y],W.classDef1),J=i.U._getGlyphClass(V,W.classDef2);F=W.matrix[j][J]}if(F){F.val1&&O(F.val1,Y),F.val2&&O(F.val2,R);break}}}}else if(k.ltype===4){const F=i._lctf.coverageIndex(W.markCoverage,V);if(F!==-1){const Y=I(z),K=Y===-1?-1:i._lctf.coverageIndex(W.baseCoverage,U[Y]);if(K!==-1){const j=W.markArray[F],J=W.baseArray[K][j.markClass];D[R*3]=J.x-j.x+D[Y*3]-D[Y*3+2],D[R*3+1]=J.y-j.y+D[Y*3+1];break}}}else if(k.ltype===6){const F=i._lctf.coverageIndex(W.mark1Coverage,V);if(F!==-1){const Y=I();if(Y!==-1){const K=U[Y];if(E(C,K)===3){const j=i._lctf.coverageIndex(W.mark2Coverage,K);if(j!==-1){const J=W.mark1Array[F],he=W.mark2Array[j][J.markClass];D[R*3]=he.x-J.x+D[Y*3]-D[Y*3+2],D[R*3+1]=he.y-J.y+D[Y*3+1];break}}}}}}}}else if(C.kern&&!C.cff){const P=I();if(P!==-1){const L=C.kern.glyph1.indexOf(U[P]);if(L!==-1){const k=C.kern.rval[L].glyph2.indexOf(V);k!==-1&&(D[P*3+2]+=C.kern.rval[L].vals[k])}}}}return D;function I(V){for(let ee=R-1;ee>=0;ee--)if(U[ee]!==-1&&(!V||V(U[ee])))return ee;return-1}function z(V){return E(C,V)===1}function O(V,ee){for(let P=0;P<3;P++)D[ee*3+P]+=V[P]||0}}function E(C,U){const D=C.GDEF&&C.GDEF.glyphClassDef;return D?i.U._getGlyphClass(U,D):0}function w(...C){for(let U=0;U<C.length;U++)if(typeof C[U]=="number")return C[U]}function T(C){const U=Object.create(null),D=C["OS/2"],R=C.hhea,I=C.head.unitsPerEm,z=w(D&&D.sTypoAscender,R&&R.ascender,I),O={unitsPerEm:I,ascender:z,descender:w(D&&D.sTypoDescender,R&&R.descender,0),capHeight:w(D&&D.sCapHeight,z),xHeight:w(D&&D.sxHeight,z),lineGap:w(D&&D.sTypoLineGap,R&&R.lineGap),supportsCodePoint(V){return i.U.codeToGlyph(C,V)>0},forEachGlyph(V,ee,P,L){let k=0;const H=1/O.unitsPerEm*ee,W=b(C,V);let F=0;const Y=S(C,W);return W.forEach((K,j)=>{if(K!==-1){let J=U[K];if(!J){const{cmds:he,crds:re}=i.U.glyphToPath(C,K);let pe="",Oe=0;for(let G=0,le=he.length;G<le;G++){const te=t[he[G]];pe+=he[G];for(let Me=1;Me<=te;Me++)pe+=(Me>1?",":"")+re[Oe++]}let be,ve,ce,Ne;if(re.length){be=ve=1/0,ce=Ne=-1/0;for(let G=0,le=re.length;G<le;G+=2){let te=re[G],Me=re[G+1];te<be&&(be=te),Me<ve&&(ve=Me),te>ce&&(ce=te),Me>Ne&&(Ne=Me)}}else be=ce=ve=Ne=0;J=U[K]={index:K,advanceWidth:C.hmtx.aWidth[K],xMin:be,yMin:ve,xMax:ce,yMax:Ne,path:pe}}L.call(null,J,k+Y[j*3]*H,Y[j*3+1]*H,F),k+=Y[j*3+2]*H,P&&(k+=P*ee)}F+=V.codePointAt(F)>65535?2:1}),k}};return O}return function(U){const D=new Uint8Array(U,0,4),R=i._bin.readASCII(D,0,4);if(R==="wOFF")U=e(U);else if(R==="wOF2")throw new Error("woff2 fonts not supported");return T(i.parse(U)[0])}}const A9=Uu({name:"Typr Font Parser",dependencies:[M9,w9,T9],init(i,e,t){const n=i(),r=e();return t(n,r)}});/*!
3971
3971
  Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver)
3972
3972
  for use in Troika text rendering.
3973
3973
  Original MIT license applies
3974
- */function A9(){return function(i){var e=function(){this.buckets=new Map};e.prototype.add=function(S){var E=S>>5;this.buckets.set(E,(this.buckets.get(E)||0)|1<<(31&S))},e.prototype.has=function(S){var E=this.buckets.get(S>>5);return E!==void 0&&(E&1<<(31&S))!=0},e.prototype.serialize=function(){var S=[];return this.buckets.forEach(function(E,w){S.push((+w).toString(36)+":"+E.toString(36))}),S.join(",")},e.prototype.deserialize=function(S){var E=this;this.buckets.clear(),S.split(",").forEach(function(w){var T=w.split(":");E.buckets.set(parseInt(T[0],36),parseInt(T[1],36))})};var t=Math.pow(2,8),n=t-1,r=~n;function s(S){var E=function(T){return T&r}(S).toString(16),w=function(T){return(T&r)+t-1}(S).toString(16);return"codepoint-index/plane"+(S>>16)+"/"+E+"-"+w+".json"}function a(S,E){var w=S&n,T=E.codePointAt(w/6|0);return((T=(T||48)-48)&1<<w%6)!=0}function o(S,E){var w;(w=S,w.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(T){return T.split("-").map(function(C){return parseInt(C.trim(),16)})})).forEach(function(T){var C=T[0],U=T[1];U===void 0&&(U=C),E(C,U)})}function l(S,E){o(S,function(w,T){for(var C=w;C<=T;C++)E(C)})}var c={},f={},d=new WeakMap,p="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function m(S){var E=d.get(S);return E||(E=new e,l(S.ranges,function(w){return E.add(w)}),d.set(S,E)),E}var v,x=new Map;function _(S,E,w){return S[E]?E:S[w]?w:function(T){for(var C in T)return C}(S)}function g(S,E){var w=E;if(!S.includes(w)){w=1/0;for(var T=0;T<S.length;T++)Math.abs(S[T]-E)<Math.abs(w-E)&&(w=S[T])}return w}function b(S){return v||(v=new Set,l("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(E){v.add(E)})),v.has(S)}return i.CodePointSet=e,i.clearCache=function(){c={},f={}},i.getFontsForString=function(S,E){E===void 0&&(E={});var w,T=E.lang;T===void 0&&(T=new RegExp("\\p{Script=Hangul}","u").test(w=S)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(w)?"ja":"en");var C=E.category;C===void 0&&(C="sans-serif");var U=E.style;U===void 0&&(U="normal");var D=E.weight;D===void 0&&(D=400);var R=(E.dataUrl||p).replace(/\/$/g,""),I=new Map,z=new Uint8Array(S.length),O={},V={},ee=new Array(S.length),P=new Map,L=!1;function k(F){var Y=x.get(F);return Y||(Y=fetch(R+"/"+F).then(function(K){if(!K.ok)throw new Error(K.statusText);return K.json().then(function(j){if(!Array.isArray(j)||j[0]!==1)throw new Error("Incorrect schema version; need 1, got "+j[0]);return j[1]})}).catch(function(K){if(R!==p)return L||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+R+'", trying default CDN. '+K.message),L=!0),R=p,x.delete(F),k(F);throw K}),x.set(F,Y)),Y}for(var H=function(F){var Y=S.codePointAt(F),K=s(Y);ee[F]=K,c[K]||P.has(K)||P.set(K,k(K).then(function(j){c[K]=j})),Y>65535&&(F++,W=F)},W=0;W<S.length;W++)H(W);return Promise.all(P.values()).then(function(){P.clear();for(var F=function(K){var j=S.codePointAt(K),J=null,he=c[ee[K]],re=void 0;for(var pe in he){var Oe=V[pe];if(Oe===void 0&&(Oe=V[pe]=new RegExp(pe).test(T||"en")),Oe){for(var be in re=pe,he[pe])if(a(j,he[pe][be])){J=be;break}break}}if(!J){e:for(var ve in he)if(ve!==re){for(var ce in he[ve])if(a(j,he[ve][ce])){J=ce;break e}}}J||(console.debug("No font coverage for U+"+j.toString(16)),J="latin"),ee[K]=J,f[J]||P.has(J)||P.set(J,k("font-meta/"+J+".json").then(function(Ne){f[J]=Ne})),j>65535&&(K++,Y=K)},Y=0;Y<S.length;Y++)F(Y);return Promise.all(P.values())}).then(function(){for(var F,Y=null,K=0;K<S.length;K++){var j=S.codePointAt(K);if(Y&&(b(j)||m(Y).has(j)))z[K]=z[K-1];else{Y=f[ee[K]];var J=O[Y.id];if(!J){var he=Y.typeforms,re=_(he,C,"sans-serif"),pe=_(he[re],U,"normal"),Oe=g((F=he[re])===null||F===void 0?void 0:F[pe],D);J=O[Y.id]=R+"/font-files/"+Y.id+"/"+re+"."+pe+"."+Oe+".woff"}var be=I.get(J);be==null&&(be=I.size,I.set(J,be)),z[K]=be}j>65535&&(K++,z[K]=z[K-1])}return{fontUrls:Array.from(I.keys()),chars:z}})},Object.defineProperty(i,"__esModule",{value:!0}),i}({})}function C9(i,e){const t=Object.create(null),n=Object.create(null);function r(a,o){const l=c=>{console.error(`Failure loading font ${a}`,c)};try{const c=new XMLHttpRequest;c.open("get",a,!0),c.responseType="arraybuffer",c.onload=function(){if(c.status>=400)l(new Error(c.statusText));else if(c.status>0)try{const f=i(c.response);f.src=a,o(f)}catch(f){l(f)}},c.onerror=l,c.send()}catch(c){l(c)}}function s(a,o){let l=t[a];l?o(l):n[a]?n[a].push(o):(n[a]=[o],r(a,c=>{c.src=a,t[a]=c,n[a].forEach(f=>f(c)),delete n[a]}))}return function(a,o,{lang:l,fonts:c=[],style:f="normal",weight:d="normal",unicodeFontsURL:p}={}){const m=new Uint8Array(a.length),v=[];a.length||b();const x=new Map,_=[];if(f!=="italic"&&(f="normal"),typeof d!="number"&&(d=d==="bold"?700:400),c&&!Array.isArray(c)&&(c=[c]),c=c.slice().filter(E=>!E.lang||E.lang.test(l)).reverse(),c.length){let C=0;(function U(D=0){for(let R=D,I=a.length;R<I;R++){const z=a.codePointAt(R);if(C===1&&v[m[R-1]].supportsCodePoint(z)||R>0&&/\s/.test(a[R]))m[R]=m[R-1],C===2&&(_[_.length-1][1]=R);else for(let O=m[R],V=c.length;O<=V;O++)if(O===V){const ee=C===2?_[_.length-1]:_[_.length]=[R,R];ee[1]=R,C=2}else{m[R]=O;const{src:ee,unicodeRange:P}=c[O];if(!P||S(z,P)){const L=t[ee];if(!L){s(ee,()=>{U(R)});return}if(L.supportsCodePoint(z)){let k=x.get(L);typeof k!="number"&&(k=v.length,v.push(L),x.set(L,k)),m[R]=k,C=1;break}}}z>65535&&R+1<I&&(m[R+1]=m[R],R++,C===2&&(_[_.length-1][1]=R))}g()})()}else _.push([0,a.length-1]),g();function g(){if(_.length){const E=_.map(w=>a.substring(w[0],w[1]+1)).join(`
3975
- `);e.getFontsForString(E,{lang:l||void 0,style:f,weight:d,dataUrl:p}).then(({fontUrls:w,chars:T})=>{const C=v.length;let U=0;_.forEach(R=>{for(let I=0,z=R[1]-R[0];I<=z;I++)m[R[0]+I]=T[U++]+C;U++});let D=0;w.forEach((R,I)=>{s(R,z=>{v[I+C]=z,++D===w.length&&b()})})})}else b()}function b(){o({chars:m,fonts:v})}function S(E,w){for(let T=0;T<w.length;T++){const[C,U=C]=w[T];if(C<=E&&E<=U)return!0}return!1}}}const R9=Uu({name:"FontResolver",dependencies:[C9,T9,A9],init(i,e,t){return i(e,t())}});function D9(i,e){const n=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,r="[^\\S\\u00A0]",s=new RegExp(`${r}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function a({text:v,lang:x,fonts:_,style:g,weight:b,preResolvedFonts:S,unicodeFontsURL:E},w){const T=({chars:C,fonts:U})=>{let D,R;const I=[];for(let z=0;z<C.length;z++)C[z]!==R?(R=C[z],I.push(D={start:z,end:z,fontObj:U[C[z]]})):D.end=z;w(I)};S?T(S):i(v,T,{lang:x,fonts:_,style:g,weight:b,unicodeFontsURL:E})}function o({text:v="",font:x,lang:_,sdfGlyphSize:g=64,fontSize:b=400,fontWeight:S=1,fontStyle:E="normal",letterSpacing:w=0,lineHeight:T="normal",maxWidth:C=1/0,direction:U,textAlign:D="left",textIndent:R=0,whiteSpace:I="normal",overflowWrap:z="normal",anchorX:O=0,anchorY:V=0,metricsOnly:ee=!1,unicodeFontsURL:P,preResolvedFonts:L=null,includeCaretPositions:k=!1,chunkedBoundsSize:H=8192,colorRanges:W=null},F){const Y=d(),K={fontLoad:0,typesetting:0};v.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),v=v.replace(/\r\n/g,`
3974
+ */function C9(){return function(i){var e=function(){this.buckets=new Map};e.prototype.add=function(S){var E=S>>5;this.buckets.set(E,(this.buckets.get(E)||0)|1<<(31&S))},e.prototype.has=function(S){var E=this.buckets.get(S>>5);return E!==void 0&&(E&1<<(31&S))!=0},e.prototype.serialize=function(){var S=[];return this.buckets.forEach(function(E,w){S.push((+w).toString(36)+":"+E.toString(36))}),S.join(",")},e.prototype.deserialize=function(S){var E=this;this.buckets.clear(),S.split(",").forEach(function(w){var T=w.split(":");E.buckets.set(parseInt(T[0],36),parseInt(T[1],36))})};var t=Math.pow(2,8),n=t-1,r=~n;function s(S){var E=function(T){return T&r}(S).toString(16),w=function(T){return(T&r)+t-1}(S).toString(16);return"codepoint-index/plane"+(S>>16)+"/"+E+"-"+w+".json"}function a(S,E){var w=S&n,T=E.codePointAt(w/6|0);return((T=(T||48)-48)&1<<w%6)!=0}function o(S,E){var w;(w=S,w.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(T){return T.split("-").map(function(C){return parseInt(C.trim(),16)})})).forEach(function(T){var C=T[0],U=T[1];U===void 0&&(U=C),E(C,U)})}function l(S,E){o(S,function(w,T){for(var C=w;C<=T;C++)E(C)})}var c={},f={},d=new WeakMap,p="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function m(S){var E=d.get(S);return E||(E=new e,l(S.ranges,function(w){return E.add(w)}),d.set(S,E)),E}var v,x=new Map;function _(S,E,w){return S[E]?E:S[w]?w:function(T){for(var C in T)return C}(S)}function g(S,E){var w=E;if(!S.includes(w)){w=1/0;for(var T=0;T<S.length;T++)Math.abs(S[T]-E)<Math.abs(w-E)&&(w=S[T])}return w}function b(S){return v||(v=new Set,l("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(E){v.add(E)})),v.has(S)}return i.CodePointSet=e,i.clearCache=function(){c={},f={}},i.getFontsForString=function(S,E){E===void 0&&(E={});var w,T=E.lang;T===void 0&&(T=new RegExp("\\p{Script=Hangul}","u").test(w=S)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(w)?"ja":"en");var C=E.category;C===void 0&&(C="sans-serif");var U=E.style;U===void 0&&(U="normal");var D=E.weight;D===void 0&&(D=400);var R=(E.dataUrl||p).replace(/\/$/g,""),I=new Map,z=new Uint8Array(S.length),O={},V={},ee=new Array(S.length),P=new Map,L=!1;function k(F){var Y=x.get(F);return Y||(Y=fetch(R+"/"+F).then(function(K){if(!K.ok)throw new Error(K.statusText);return K.json().then(function(j){if(!Array.isArray(j)||j[0]!==1)throw new Error("Incorrect schema version; need 1, got "+j[0]);return j[1]})}).catch(function(K){if(R!==p)return L||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+R+'", trying default CDN. '+K.message),L=!0),R=p,x.delete(F),k(F);throw K}),x.set(F,Y)),Y}for(var H=function(F){var Y=S.codePointAt(F),K=s(Y);ee[F]=K,c[K]||P.has(K)||P.set(K,k(K).then(function(j){c[K]=j})),Y>65535&&(F++,W=F)},W=0;W<S.length;W++)H(W);return Promise.all(P.values()).then(function(){P.clear();for(var F=function(K){var j=S.codePointAt(K),J=null,he=c[ee[K]],re=void 0;for(var pe in he){var Oe=V[pe];if(Oe===void 0&&(Oe=V[pe]=new RegExp(pe).test(T||"en")),Oe){for(var be in re=pe,he[pe])if(a(j,he[pe][be])){J=be;break}break}}if(!J){e:for(var ve in he)if(ve!==re){for(var ce in he[ve])if(a(j,he[ve][ce])){J=ce;break e}}}J||(console.debug("No font coverage for U+"+j.toString(16)),J="latin"),ee[K]=J,f[J]||P.has(J)||P.set(J,k("font-meta/"+J+".json").then(function(Ne){f[J]=Ne})),j>65535&&(K++,Y=K)},Y=0;Y<S.length;Y++)F(Y);return Promise.all(P.values())}).then(function(){for(var F,Y=null,K=0;K<S.length;K++){var j=S.codePointAt(K);if(Y&&(b(j)||m(Y).has(j)))z[K]=z[K-1];else{Y=f[ee[K]];var J=O[Y.id];if(!J){var he=Y.typeforms,re=_(he,C,"sans-serif"),pe=_(he[re],U,"normal"),Oe=g((F=he[re])===null||F===void 0?void 0:F[pe],D);J=O[Y.id]=R+"/font-files/"+Y.id+"/"+re+"."+pe+"."+Oe+".woff"}var be=I.get(J);be==null&&(be=I.size,I.set(J,be)),z[K]=be}j>65535&&(K++,z[K]=z[K-1])}return{fontUrls:Array.from(I.keys()),chars:z}})},Object.defineProperty(i,"__esModule",{value:!0}),i}({})}function R9(i,e){const t=Object.create(null),n=Object.create(null);function r(a,o){const l=c=>{console.error(`Failure loading font ${a}`,c)};try{const c=new XMLHttpRequest;c.open("get",a,!0),c.responseType="arraybuffer",c.onload=function(){if(c.status>=400)l(new Error(c.statusText));else if(c.status>0)try{const f=i(c.response);f.src=a,o(f)}catch(f){l(f)}},c.onerror=l,c.send()}catch(c){l(c)}}function s(a,o){let l=t[a];l?o(l):n[a]?n[a].push(o):(n[a]=[o],r(a,c=>{c.src=a,t[a]=c,n[a].forEach(f=>f(c)),delete n[a]}))}return function(a,o,{lang:l,fonts:c=[],style:f="normal",weight:d="normal",unicodeFontsURL:p}={}){const m=new Uint8Array(a.length),v=[];a.length||b();const x=new Map,_=[];if(f!=="italic"&&(f="normal"),typeof d!="number"&&(d=d==="bold"?700:400),c&&!Array.isArray(c)&&(c=[c]),c=c.slice().filter(E=>!E.lang||E.lang.test(l)).reverse(),c.length){let C=0;(function U(D=0){for(let R=D,I=a.length;R<I;R++){const z=a.codePointAt(R);if(C===1&&v[m[R-1]].supportsCodePoint(z)||R>0&&/\s/.test(a[R]))m[R]=m[R-1],C===2&&(_[_.length-1][1]=R);else for(let O=m[R],V=c.length;O<=V;O++)if(O===V){const ee=C===2?_[_.length-1]:_[_.length]=[R,R];ee[1]=R,C=2}else{m[R]=O;const{src:ee,unicodeRange:P}=c[O];if(!P||S(z,P)){const L=t[ee];if(!L){s(ee,()=>{U(R)});return}if(L.supportsCodePoint(z)){let k=x.get(L);typeof k!="number"&&(k=v.length,v.push(L),x.set(L,k)),m[R]=k,C=1;break}}}z>65535&&R+1<I&&(m[R+1]=m[R],R++,C===2&&(_[_.length-1][1]=R))}g()})()}else _.push([0,a.length-1]),g();function g(){if(_.length){const E=_.map(w=>a.substring(w[0],w[1]+1)).join(`
3975
+ `);e.getFontsForString(E,{lang:l||void 0,style:f,weight:d,dataUrl:p}).then(({fontUrls:w,chars:T})=>{const C=v.length;let U=0;_.forEach(R=>{for(let I=0,z=R[1]-R[0];I<=z;I++)m[R[0]+I]=T[U++]+C;U++});let D=0;w.forEach((R,I)=>{s(R,z=>{v[I+C]=z,++D===w.length&&b()})})})}else b()}function b(){o({chars:m,fonts:v})}function S(E,w){for(let T=0;T<w.length;T++){const[C,U=C]=w[T];if(C<=E&&E<=U)return!0}return!1}}}const D9=Uu({name:"FontResolver",dependencies:[R9,A9,C9],init(i,e,t){return i(e,t())}});function U9(i,e){const n=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,r="[^\\S\\u00A0]",s=new RegExp(`${r}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function a({text:v,lang:x,fonts:_,style:g,weight:b,preResolvedFonts:S,unicodeFontsURL:E},w){const T=({chars:C,fonts:U})=>{let D,R;const I=[];for(let z=0;z<C.length;z++)C[z]!==R?(R=C[z],I.push(D={start:z,end:z,fontObj:U[C[z]]})):D.end=z;w(I)};S?T(S):i(v,T,{lang:x,fonts:_,style:g,weight:b,unicodeFontsURL:E})}function o({text:v="",font:x,lang:_,sdfGlyphSize:g=64,fontSize:b=400,fontWeight:S=1,fontStyle:E="normal",letterSpacing:w=0,lineHeight:T="normal",maxWidth:C=1/0,direction:U,textAlign:D="left",textIndent:R=0,whiteSpace:I="normal",overflowWrap:z="normal",anchorX:O=0,anchorY:V=0,metricsOnly:ee=!1,unicodeFontsURL:P,preResolvedFonts:L=null,includeCaretPositions:k=!1,chunkedBoundsSize:H=8192,colorRanges:W=null},F){const Y=d(),K={fontLoad:0,typesetting:0};v.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),v=v.replace(/\r\n/g,`
3976
3976
  `).replace(/\r/g,`
3977
3977
  `)),b=+b,w=+w,C=+C,T=T||"normal",R=+R,a({text:v,lang:_,style:E,weight:S,fonts:typeof x=="string"?[{src:x}]:x,unicodeFontsURL:P,preResolvedFonts:L},j=>{K.fontLoad=d()-Y;const J=isFinite(C);let he=null,re=null,pe=null,Oe=null,be=null,ve=null,ce=null,Ne=null,G=0,le=0,te=I!=="nowrap";const Me=new Map,oe=d();let De=R,_e=0,ne=new p;const Be=[ne];j.forEach(ge=>{const{fontObj:me}=ge,{ascender:Fe,descender:Ie,unitsPerEm:je,lineGap:Ze,capHeight:Ce,xHeight:He}=me;let Ve=Me.get(me);if(!Ve){const ze=b/je,Le=T==="normal"?(Fe-Ie+Ze)*ze:T*b,rt=(Le-(Fe-Ie)*ze)/2,Pe=Math.min(Le,(Fe-Ie)*ze),Re=(Fe+Ie)/2*ze+Pe/2;Ve={index:Me.size,src:me.src,fontObj:me,fontSizeMult:ze,unitsPerEm:je,ascender:Fe*ze,descender:Ie*ze,capHeight:Ce*ze,xHeight:He*ze,lineHeight:Le,baseline:-rt-Fe*ze,caretTop:Re,caretBottom:Re-Pe},Me.set(me,Ve)}const{fontSizeMult:nt}=Ve,We=v.slice(ge.start,ge.end+1);let ft,se;me.forEachGlyph(We,b,w,(ze,Le,rt,Pe)=>{Le+=_e,Pe+=ge.start,ft=Le,se=ze;const Re=v.charAt(Pe),Ke=ze.advanceWidth*nt,st=ne.count;let at;if("isEmpty"in ze||(ze.isWhitespace=!!Re&&new RegExp(r).test(Re),ze.canBreakAfter=!!Re&&s.test(Re),ze.isEmpty=ze.xMin===ze.xMax||ze.yMin===ze.yMax||n.test(Re)),!ze.isWhitespace&&!ze.isEmpty&&le++,te&&J&&!ze.isWhitespace&&Le+Ke+De>C&&st){if(ne.glyphAt(st-1).glyphObj.canBreakAfter)at=new p,De=-Le;else for(let Jt=st;Jt--;)if(Jt===0&&z==="break-word"){at=new p,De=-Le;break}else if(ne.glyphAt(Jt).glyphObj.canBreakAfter){at=ne.splitAt(Jt+1);const tn=at.glyphAt(0).x;De-=tn;for(let mn=at.count;mn--;)at.glyphAt(mn).x-=tn;break}at&&(ne.isSoftWrapped=!0,ne=at,Be.push(ne),G=C)}let mt=ne.glyphAt(ne.count);mt.glyphObj=ze,mt.x=Le+De,mt.y=rt,mt.width=Ke,mt.charIndex=Pe,mt.fontData=Ve,Re===`
3978
- `&&(ne=new p,Be.push(ne),De=-(Le+Ke+w*b)+R)}),_e=ft+se.advanceWidth*nt+w*b});let X=0;Be.forEach(ge=>{let me=!0;for(let Fe=ge.count;Fe--;){const Ie=ge.glyphAt(Fe);me&&!Ie.glyphObj.isWhitespace&&(ge.width=Ie.x+Ie.width,ge.width>G&&(G=ge.width),me=!1);let{lineHeight:je,capHeight:Ze,xHeight:Ce,baseline:He}=Ie.fontData;je>ge.lineHeight&&(ge.lineHeight=je);const Ve=He-ge.baseline;Ve<0&&(ge.baseline+=Ve,ge.cap+=Ve,ge.ex+=Ve),ge.cap=Math.max(ge.cap,ge.baseline+Ze),ge.ex=Math.max(ge.ex,ge.baseline+Ce)}ge.baseline-=X,ge.cap-=X,ge.ex-=X,X+=ge.lineHeight});let B=0,ie=0;if(O&&(typeof O=="number"?B=-O:typeof O=="string"&&(B=-G*(O==="left"?0:O==="center"?.5:O==="right"?1:c(O)))),V&&(typeof V=="number"?ie=-V:typeof V=="string"&&(ie=V==="top"?0:V==="top-baseline"?-Be[0].baseline:V==="top-cap"?-Be[0].cap:V==="top-ex"?-Be[0].ex:V==="middle"?X/2:V==="bottom"?X:V==="bottom-baseline"?-Be[Be.length-1].baseline:c(V)*X)),!ee){const ge=e.getEmbeddingLevels(v,U);he=new Uint16Array(le),re=new Uint8Array(le),pe=new Float32Array(le*2),Oe={},ce=[1/0,1/0,-1/0,-1/0],Ne=[],k&&(ve=new Float32Array(v.length*4)),W&&(be=new Uint8Array(le*3));let me=0,Fe=-1,Ie=-1,je,Ze;if(Be.forEach((Ce,He)=>{let{count:Ve,width:nt}=Ce;if(Ve>0){let We=0;for(let Pe=Ve;Pe--&&Ce.glyphAt(Pe).glyphObj.isWhitespace;)We++;let ft=0,se=0;if(D==="center")ft=(G-nt)/2;else if(D==="right")ft=G-nt;else if(D==="justify"&&Ce.isSoftWrapped){let Pe=0;for(let Re=Ve-We;Re--;)Ce.glyphAt(Re).glyphObj.isWhitespace&&Pe++;se=(G-nt)/Pe}if(se||ft){let Pe=0;for(let Re=0;Re<Ve;Re++){let Ke=Ce.glyphAt(Re);const st=Ke.glyphObj;Ke.x+=ft+Pe,se!==0&&st.isWhitespace&&Re<Ve-We&&(Pe+=se,Ke.width+=se)}}const ze=e.getReorderSegments(v,ge,Ce.glyphAt(0).charIndex,Ce.glyphAt(Ce.count-1).charIndex);for(let Pe=0;Pe<ze.length;Pe++){const[Re,Ke]=ze[Pe];let st=1/0,at=-1/0;for(let mt=0;mt<Ve;mt++)if(Ce.glyphAt(mt).charIndex>=Re){let Jt=mt,tn=mt;for(;tn<Ve;tn++){let mn=Ce.glyphAt(tn);if(mn.charIndex>Ke)break;tn<Ve-We&&(st=Math.min(st,mn.x),at=Math.max(at,mn.x+mn.width))}for(let mn=Jt;mn<tn;mn++){const oi=Ce.glyphAt(mn);oi.x=at-(oi.x+oi.width-st)}break}}let Le;const rt=Pe=>Le=Pe;for(let Pe=0;Pe<Ve;Pe++){const Re=Ce.glyphAt(Pe);Le=Re.glyphObj;const Ke=Le.index,st=ge.levels[Re.charIndex]&1;if(st){const at=e.getMirroredCharacter(v[Re.charIndex]);at&&Re.fontData.fontObj.forEachGlyph(at,0,0,rt)}if(k){const{charIndex:at,fontData:mt}=Re,Jt=Re.x+B,tn=Re.x+Re.width+B;ve[at*4]=st?tn:Jt,ve[at*4+1]=st?Jt:tn,ve[at*4+2]=Ce.baseline+mt.caretBottom+ie,ve[at*4+3]=Ce.baseline+mt.caretTop+ie;const mn=at-Fe;mn>1&&f(ve,Fe,mn),Fe=at}if(W){const{charIndex:at}=Re;for(;at>Ie;)Ie++,W.hasOwnProperty(Ie)&&(Ze=W[Ie])}if(!Le.isWhitespace&&!Le.isEmpty){const at=me++,{fontSizeMult:mt,src:Jt,index:tn}=Re.fontData,mn=Oe[Jt]||(Oe[Jt]={});mn[Ke]||(mn[Ke]={path:Le.path,pathBounds:[Le.xMin,Le.yMin,Le.xMax,Le.yMax]});const oi=Re.x+B,kn=Re.y+Ce.baseline+ie;pe[at*2]=oi,pe[at*2+1]=kn;const Cn=oi+Le.xMin*mt,Vi=kn+Le.yMin*mt,$n=oi+Le.xMax*mt,yn=kn+Le.yMax*mt;Cn<ce[0]&&(ce[0]=Cn),Vi<ce[1]&&(ce[1]=Vi),$n>ce[2]&&(ce[2]=$n),yn>ce[3]&&(ce[3]=yn),at%H===0&&(je={start:at,end:at,rect:[1/0,1/0,-1/0,-1/0]},Ne.push(je)),je.end++;const xn=je.rect;if(Cn<xn[0]&&(xn[0]=Cn),Vi<xn[1]&&(xn[1]=Vi),$n>xn[2]&&(xn[2]=$n),yn>xn[3]&&(xn[3]=yn),he[at]=Ke,re[at]=tn,W){const Ht=at*3;be[Ht]=Ze>>16&255,be[Ht+1]=Ze>>8&255,be[Ht+2]=Ze&255}}}}}),ve){const Ce=v.length-Fe;Ce>1&&f(ve,Fe,Ce)}}const Se=[];Me.forEach(({index:ge,src:me,unitsPerEm:Fe,ascender:Ie,descender:je,lineHeight:Ze,capHeight:Ce,xHeight:He})=>{Se[ge]={src:me,unitsPerEm:Fe,ascender:Ie,descender:je,lineHeight:Ze,capHeight:Ce,xHeight:He}}),K.typesetting=d()-oe,F({glyphIds:he,glyphFontIndices:re,glyphPositions:pe,glyphData:Oe,fontData:Se,caretPositions:ve,glyphColors:be,chunkedBounds:Ne,fontSize:b,topBaseline:ie+Be[0].baseline,blockBounds:[B,ie-X,B+G,ie],visibleBounds:ce,timings:K})})}function l(v,x){o({...v,metricsOnly:!0},_=>{const[g,b,S,E]=_.blockBounds;x({width:S-g,height:E-b})})}function c(v){let x=v.match(/^([\d.]+)%$/),_=x?parseFloat(x[1]):NaN;return isNaN(_)?0:_/100}function f(v,x,_){const g=v[x*4],b=v[x*4+1],S=v[x*4+2],E=v[x*4+3],w=(b-g)/_;for(let T=0;T<_;T++){const C=(x+T)*4;v[C]=g+w*T,v[C+1]=g+w*(T+1),v[C+2]=S,v[C+3]=E}}function d(){return(self.performance||Date).now()}function p(){this.data=[]}const m=["glyphObj","x","y","width","charIndex","fontData"];return p.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/m.length)},glyphAt(v){let x=p.flyweight;return x.data=this.data,x.index=v,x},splitAt(v){let x=new p;return x.data=this.data.splice(v*m.length),x}},p.flyweight=m.reduce((v,x,_,g)=>(Object.defineProperty(v,x,{get(){return this.data[this.index*m.length+_]},set(b){this.data[this.index*m.length+_]=b}}),v),{data:null,index:0}),{typeset:o,measure:l}}const Tl=()=>(self.performance||Date).now(),_0=y3();let jT;function U9(i,e,t,n,r,s,a,o,l,c,f=!0){return f?L9(i,e,t,n,r,s,a,o,l,c).then(null,d=>(jT||(console.warn("WebGL SDF generation failed, falling back to JS",d),jT=!0),YT(i,e,t,n,r,s,a,o,l,c))):YT(i,e,t,n,r,s,a,o,l,c)}const pm=[],O9=5;let Ox=0;function x3(){const i=Tl();for(;pm.length&&Tl()-i<O9;)pm.shift()();Ox=pm.length?setTimeout(x3,0):0}const L9=(...i)=>new Promise((e,t)=>{pm.push(()=>{const n=Tl();try{_0.webgl.generateIntoCanvas(...i),e({timing:Tl()-n})}catch(r){t(r)}}),Ox||(Ox=setTimeout(x3,0))}),N9=4,I9=2e3,qT={};let P9=0;function YT(i,e,t,n,r,s,a,o,l,c){const f="TroikaTextSDFGenerator_JS_"+P9++%N9;let d=qT[f];return d||(d=qT[f]={workerModule:Uu({name:f,workerId:f,dependencies:[y3,Tl],init(p,m){const v=p().javascript.generate;return function(...x){const _=m();return{textureData:v(...x),timing:m()-_}}},getTransferables(p){return[p.textureData.buffer]}}),requests:0,idleTimer:null}),d.requests++,clearTimeout(d.idleTimer),d.workerModule(i,e,t,n,r,s).then(({textureData:p,timing:m})=>{const v=Tl(),x=new Uint8Array(p.length*4);for(let _=0;_<p.length;_++)x[_*4+c]=p[_];return _0.webglUtils.renderImageData(a,x,o,l,i,e,1<<3-c),m+=Tl()-v,--d.requests===0&&(d.idleTimer=setTimeout(()=>{d9(f)},I9)),{timing:m}})}function z9(i){i._warm||(_0.webgl.isSupported(i),i._warm=!0)}const F9=_0.webglUtils.resizeWebGLCanvasWithoutClearing,Qh={unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},B9=new $e;function Xc(){return(self.performance||Date).now()}const ZT=Object.create(null);function b3(i,e){i=H9({},i);const t=Xc(),n=[];if(i.font&&n.push({label:"user",src:V9(i.font)}),i.font=n,i.text=""+i.text,i.sdfGlyphSize=i.sdfGlyphSize||Qh.sdfGlyphSize,i.unicodeFontsURL=i.unicodeFontsURL||Qh.unicodeFontsURL,i.colorRanges!=null){let p={};for(let m in i.colorRanges)if(i.colorRanges.hasOwnProperty(m)){let v=i.colorRanges[m];typeof v!="number"&&(v=B9.set(v).getHex()),p[m]=v}i.colorRanges=p}Object.freeze(i);const{textureWidth:r,sdfExponent:s}=Qh,{sdfGlyphSize:a}=i,o=r/a*4;let l=ZT[a];if(!l){const p=document.createElement("canvas");p.width=r,p.height=a*256/o,l=ZT[a]={glyphCount:0,sdfGlyphSize:a,sdfCanvas:p,sdfTexture:new An(p,void 0,void 0,void 0,Pn,Pn),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,k9(l)}const{sdfTexture:c,sdfCanvas:f}=l;M3(i).then(p=>{const{glyphIds:m,glyphFontIndices:v,fontData:x,glyphPositions:_,fontSize:g,timings:b}=p,S=[],E=new Float32Array(m.length*4);let w=0,T=0;const C=Xc(),U=x.map(O=>{let V=l.glyphsByFont.get(O.src);return V||l.glyphsByFont.set(O.src,V=new Map),V});m.forEach((O,V)=>{const ee=v[V],{src:P,unitsPerEm:L}=x[ee];let k=U[ee].get(O);if(!k){const{path:K,pathBounds:j}=p.glyphData[P][O],J=Math.max(j[2]-j[0],j[3]-j[1])/a*(Qh.sdfMargin*a+.5),he=l.glyphCount++,re=[j[0]-J,j[1]-J,j[2]+J,j[3]+J];U[ee].set(O,k={path:K,atlasIndex:he,sdfViewBox:re}),S.push(k)}const{sdfViewBox:H}=k,W=_[T++],F=_[T++],Y=g/L;E[w++]=W+H[0]*Y,E[w++]=F+H[1]*Y,E[w++]=W+H[2]*Y,E[w++]=F+H[3]*Y,m[V]=k.atlasIndex}),b.quads=(b.quads||0)+(Xc()-C);const D=Xc();b.sdf={};const R=f.height,I=Math.ceil(l.glyphCount/o),z=Math.pow(2,Math.ceil(Math.log2(I*a)));z>R&&(console.info(`Increasing SDF texture size ${R}->${z}`),F9(f,r,z),c.dispose()),Promise.all(S.map(O=>S3(O,l,i.gpuAccelerateSDF).then(({timing:V})=>{b.sdf[O.atlasIndex]=V}))).then(()=>{S.length&&!l.contextLost&&(E3(l),c.needsUpdate=!0),b.sdfTotal=Xc()-D,b.total=Xc()-t,e(Object.freeze({parameters:i,sdfTexture:c,sdfGlyphSize:a,sdfExponent:s,glyphBounds:E,glyphAtlasIndices:m,glyphColors:p.glyphColors,caretPositions:p.caretPositions,chunkedBounds:p.chunkedBounds,ascender:p.ascender,descender:p.descender,lineHeight:p.lineHeight,capHeight:p.capHeight,xHeight:p.xHeight,topBaseline:p.topBaseline,blockBounds:p.blockBounds,visibleBounds:p.visibleBounds,timings:p.timings}))})}),Promise.resolve().then(()=>{l.contextLost||z9(f)})}function S3({path:i,atlasIndex:e,sdfViewBox:t},{sdfGlyphSize:n,sdfCanvas:r,contextLost:s},a){if(s)return Promise.resolve({timing:-1});const{textureWidth:o,sdfExponent:l}=Qh,c=Math.max(t[2]-t[0],t[3]-t[1]),f=Math.floor(e/4),d=f%(o/n)*n,p=Math.floor(f/(o/n))*n,m=e%4;return U9(n,n,i,t,c,l,r,d,p,m,a)}function k9(i){const e=i.sdfCanvas;e.addEventListener("webglcontextlost",t=>{console.log("Context Lost",t),t.preventDefault(),i.contextLost=!0}),e.addEventListener("webglcontextrestored",t=>{console.log("Context Restored",t),i.contextLost=!1;const n=[];i.glyphsByFont.forEach(r=>{r.forEach(s=>{n.push(S3(s,i,!0))})}),Promise.all(n).then(()=>{E3(i),i.sdfTexture.needsUpdate=!0})})}function G9({font:i,characters:e,sdfGlyphSize:t},n){let r=Array.isArray(e)?e.join(`
3979
- `):""+e;b3({font:i,sdfGlyphSize:t,text:r},n)}function H9(i,e){for(let t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}let qp;function V9(i){return qp||(qp=typeof document>"u"?{}:document.createElement("a")),qp.href=i,qp.href}function E3(i){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:t}=i,{width:n,height:r}=e,s=i.sdfCanvas.getContext("webgl");let a=t.image.data;(!a||a.length!==n*r*4)&&(a=new Uint8Array(n*r*4),t.image={width:n,height:r,data:a},t.flipY=!1,t.isDataTexture=!0),s.readPixels(0,0,n,r,s.RGBA,s.UNSIGNED_BYTE,a)}}const W9=Uu({name:"Typesetter",dependencies:[D9,R9,m9],init(i,e,t){return i(e,t())}}),M3=Uu({name:"Typesetter",dependencies:[W9],init(i){return function(e){return new Promise(t=>{i.typeset(e,t)})}},getTransferables(i){const e=[];for(let t in i)i[t]&&i[t].buffer&&e.push(i[t].buffer);return e}});M3.onMainThread;const KT={};function X9(i){let e=KT[i];return e||(e=KT[i]=new Ta(1,1,i,i).translate(.5,.5,0)),e}const j9="aTroikaGlyphBounds",JT="aTroikaGlyphIndex",q9="aTroikaGlyphColor";class Y9 extends p1{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new ri,this.boundingBox=new Qn}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let t=X9(e);["position","normal","uv"].forEach(n=>{this.attributes[n]=t.attributes[n].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,n,r,s){this.updateAttributeData(j9,e,4),this.updateAttributeData(JT,t,1),this.updateAttributeData(q9,s,3),this._blockBounds=n,this._chunkedBounds=r,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:n}=this;if(t){const{PI:r,floor:s,min:a,max:o,sin:l,cos:c}=Math,f=r/2,d=r*2,p=Math.abs(t),m=e[0]/p,v=e[2]/p,x=s((m+f)/d)!==s((v+f)/d)?-p:a(l(m)*p,l(v)*p),_=s((m-f)/d)!==s((v-f)/d)?p:o(l(m)*p,l(v)*p),g=s((m+r)/d)!==s((v+r)/d)?p*2:o(p-c(m)*p,p-c(v)*p);n.min.set(x,e[1],t<0?-g:0),n.max.set(_,e[3],t<0?0:g)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(JT).count,n=this._chunkedBounds;if(n)for(let r=n.length;r--;){t=n[r].end;let s=n[r].rect;if(s[1]<e.w&&s[3]>e.y&&s[0]<e.z&&s[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,n){const r=this.getAttribute(e);t?r&&r.array.length===t.length?(r.array.set(t),r.needsUpdate=!0):(this.setAttribute(e,new Rl(t,n)),delete this._maxInstanceCount,this.dispose()):r&&this.deleteAttribute(e)}}const Z9=`
3978
+ `&&(ne=new p,Be.push(ne),De=-(Le+Ke+w*b)+R)}),_e=ft+se.advanceWidth*nt+w*b});let X=0;Be.forEach(ge=>{let me=!0;for(let Fe=ge.count;Fe--;){const Ie=ge.glyphAt(Fe);me&&!Ie.glyphObj.isWhitespace&&(ge.width=Ie.x+Ie.width,ge.width>G&&(G=ge.width),me=!1);let{lineHeight:je,capHeight:Ze,xHeight:Ce,baseline:He}=Ie.fontData;je>ge.lineHeight&&(ge.lineHeight=je);const Ve=He-ge.baseline;Ve<0&&(ge.baseline+=Ve,ge.cap+=Ve,ge.ex+=Ve),ge.cap=Math.max(ge.cap,ge.baseline+Ze),ge.ex=Math.max(ge.ex,ge.baseline+Ce)}ge.baseline-=X,ge.cap-=X,ge.ex-=X,X+=ge.lineHeight});let B=0,ie=0;if(O&&(typeof O=="number"?B=-O:typeof O=="string"&&(B=-G*(O==="left"?0:O==="center"?.5:O==="right"?1:c(O)))),V&&(typeof V=="number"?ie=-V:typeof V=="string"&&(ie=V==="top"?0:V==="top-baseline"?-Be[0].baseline:V==="top-cap"?-Be[0].cap:V==="top-ex"?-Be[0].ex:V==="middle"?X/2:V==="bottom"?X:V==="bottom-baseline"?-Be[Be.length-1].baseline:c(V)*X)),!ee){const ge=e.getEmbeddingLevels(v,U);he=new Uint16Array(le),re=new Uint8Array(le),pe=new Float32Array(le*2),Oe={},ce=[1/0,1/0,-1/0,-1/0],Ne=[],k&&(ve=new Float32Array(v.length*4)),W&&(be=new Uint8Array(le*3));let me=0,Fe=-1,Ie=-1,je,Ze;if(Be.forEach((Ce,He)=>{let{count:Ve,width:nt}=Ce;if(Ve>0){let We=0;for(let Pe=Ve;Pe--&&Ce.glyphAt(Pe).glyphObj.isWhitespace;)We++;let ft=0,se=0;if(D==="center")ft=(G-nt)/2;else if(D==="right")ft=G-nt;else if(D==="justify"&&Ce.isSoftWrapped){let Pe=0;for(let Re=Ve-We;Re--;)Ce.glyphAt(Re).glyphObj.isWhitespace&&Pe++;se=(G-nt)/Pe}if(se||ft){let Pe=0;for(let Re=0;Re<Ve;Re++){let Ke=Ce.glyphAt(Re);const st=Ke.glyphObj;Ke.x+=ft+Pe,se!==0&&st.isWhitespace&&Re<Ve-We&&(Pe+=se,Ke.width+=se)}}const ze=e.getReorderSegments(v,ge,Ce.glyphAt(0).charIndex,Ce.glyphAt(Ce.count-1).charIndex);for(let Pe=0;Pe<ze.length;Pe++){const[Re,Ke]=ze[Pe];let st=1/0,at=-1/0;for(let mt=0;mt<Ve;mt++)if(Ce.glyphAt(mt).charIndex>=Re){let Jt=mt,tn=mt;for(;tn<Ve;tn++){let mn=Ce.glyphAt(tn);if(mn.charIndex>Ke)break;tn<Ve-We&&(st=Math.min(st,mn.x),at=Math.max(at,mn.x+mn.width))}for(let mn=Jt;mn<tn;mn++){const oi=Ce.glyphAt(mn);oi.x=at-(oi.x+oi.width-st)}break}}let Le;const rt=Pe=>Le=Pe;for(let Pe=0;Pe<Ve;Pe++){const Re=Ce.glyphAt(Pe);Le=Re.glyphObj;const Ke=Le.index,st=ge.levels[Re.charIndex]&1;if(st){const at=e.getMirroredCharacter(v[Re.charIndex]);at&&Re.fontData.fontObj.forEachGlyph(at,0,0,rt)}if(k){const{charIndex:at,fontData:mt}=Re,Jt=Re.x+B,tn=Re.x+Re.width+B;ve[at*4]=st?tn:Jt,ve[at*4+1]=st?Jt:tn,ve[at*4+2]=Ce.baseline+mt.caretBottom+ie,ve[at*4+3]=Ce.baseline+mt.caretTop+ie;const mn=at-Fe;mn>1&&f(ve,Fe,mn),Fe=at}if(W){const{charIndex:at}=Re;for(;at>Ie;)Ie++,W.hasOwnProperty(Ie)&&(Ze=W[Ie])}if(!Le.isWhitespace&&!Le.isEmpty){const at=me++,{fontSizeMult:mt,src:Jt,index:tn}=Re.fontData,mn=Oe[Jt]||(Oe[Jt]={});mn[Ke]||(mn[Ke]={path:Le.path,pathBounds:[Le.xMin,Le.yMin,Le.xMax,Le.yMax]});const oi=Re.x+B,kn=Re.y+Ce.baseline+ie;pe[at*2]=oi,pe[at*2+1]=kn;const Cn=oi+Le.xMin*mt,Vi=kn+Le.yMin*mt,$n=oi+Le.xMax*mt,yn=kn+Le.yMax*mt;Cn<ce[0]&&(ce[0]=Cn),Vi<ce[1]&&(ce[1]=Vi),$n>ce[2]&&(ce[2]=$n),yn>ce[3]&&(ce[3]=yn),at%H===0&&(je={start:at,end:at,rect:[1/0,1/0,-1/0,-1/0]},Ne.push(je)),je.end++;const xn=je.rect;if(Cn<xn[0]&&(xn[0]=Cn),Vi<xn[1]&&(xn[1]=Vi),$n>xn[2]&&(xn[2]=$n),yn>xn[3]&&(xn[3]=yn),he[at]=Ke,re[at]=tn,W){const Ht=at*3;be[Ht]=Ze>>16&255,be[Ht+1]=Ze>>8&255,be[Ht+2]=Ze&255}}}}}),ve){const Ce=v.length-Fe;Ce>1&&f(ve,Fe,Ce)}}const Se=[];Me.forEach(({index:ge,src:me,unitsPerEm:Fe,ascender:Ie,descender:je,lineHeight:Ze,capHeight:Ce,xHeight:He})=>{Se[ge]={src:me,unitsPerEm:Fe,ascender:Ie,descender:je,lineHeight:Ze,capHeight:Ce,xHeight:He}}),K.typesetting=d()-oe,F({glyphIds:he,glyphFontIndices:re,glyphPositions:pe,glyphData:Oe,fontData:Se,caretPositions:ve,glyphColors:be,chunkedBounds:Ne,fontSize:b,topBaseline:ie+Be[0].baseline,blockBounds:[B,ie-X,B+G,ie],visibleBounds:ce,timings:K})})}function l(v,x){o({...v,metricsOnly:!0},_=>{const[g,b,S,E]=_.blockBounds;x({width:S-g,height:E-b})})}function c(v){let x=v.match(/^([\d.]+)%$/),_=x?parseFloat(x[1]):NaN;return isNaN(_)?0:_/100}function f(v,x,_){const g=v[x*4],b=v[x*4+1],S=v[x*4+2],E=v[x*4+3],w=(b-g)/_;for(let T=0;T<_;T++){const C=(x+T)*4;v[C]=g+w*T,v[C+1]=g+w*(T+1),v[C+2]=S,v[C+3]=E}}function d(){return(self.performance||Date).now()}function p(){this.data=[]}const m=["glyphObj","x","y","width","charIndex","fontData"];return p.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/m.length)},glyphAt(v){let x=p.flyweight;return x.data=this.data,x.index=v,x},splitAt(v){let x=new p;return x.data=this.data.splice(v*m.length),x}},p.flyweight=m.reduce((v,x,_,g)=>(Object.defineProperty(v,x,{get(){return this.data[this.index*m.length+_]},set(b){this.data[this.index*m.length+_]=b}}),v),{data:null,index:0}),{typeset:o,measure:l}}const Tl=()=>(self.performance||Date).now(),_0=v3();let jT;function O9(i,e,t,n,r,s,a,o,l,c,f=!0){return f?N9(i,e,t,n,r,s,a,o,l,c).then(null,d=>(jT||(console.warn("WebGL SDF generation failed, falling back to JS",d),jT=!0),YT(i,e,t,n,r,s,a,o,l,c))):YT(i,e,t,n,r,s,a,o,l,c)}const pm=[],L9=5;let Ox=0;function _3(){const i=Tl();for(;pm.length&&Tl()-i<L9;)pm.shift()();Ox=pm.length?setTimeout(_3,0):0}const N9=(...i)=>new Promise((e,t)=>{pm.push(()=>{const n=Tl();try{_0.webgl.generateIntoCanvas(...i),e({timing:Tl()-n})}catch(r){t(r)}}),Ox||(Ox=setTimeout(_3,0))}),I9=4,P9=2e3,qT={};let z9=0;function YT(i,e,t,n,r,s,a,o,l,c){const f="TroikaTextSDFGenerator_JS_"+z9++%I9;let d=qT[f];return d||(d=qT[f]={workerModule:Uu({name:f,workerId:f,dependencies:[v3,Tl],init(p,m){const v=p().javascript.generate;return function(...x){const _=m();return{textureData:v(...x),timing:m()-_}}},getTransferables(p){return[p.textureData.buffer]}}),requests:0,idleTimer:null}),d.requests++,clearTimeout(d.idleTimer),d.workerModule(i,e,t,n,r,s).then(({textureData:p,timing:m})=>{const v=Tl(),x=new Uint8Array(p.length*4);for(let _=0;_<p.length;_++)x[_*4+c]=p[_];return _0.webglUtils.renderImageData(a,x,o,l,i,e,1<<3-c),m+=Tl()-v,--d.requests===0&&(d.idleTimer=setTimeout(()=>{p9(f)},P9)),{timing:m}})}function F9(i){i._warm||(_0.webgl.isSupported(i),i._warm=!0)}const B9=_0.webglUtils.resizeWebGLCanvasWithoutClearing,Qh={unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},k9=new $e;function Xc(){return(self.performance||Date).now()}const ZT=Object.create(null);function x3(i,e){i=V9({},i);const t=Xc(),n=[];if(i.font&&n.push({label:"user",src:W9(i.font)}),i.font=n,i.text=""+i.text,i.sdfGlyphSize=i.sdfGlyphSize||Qh.sdfGlyphSize,i.unicodeFontsURL=i.unicodeFontsURL||Qh.unicodeFontsURL,i.colorRanges!=null){let p={};for(let m in i.colorRanges)if(i.colorRanges.hasOwnProperty(m)){let v=i.colorRanges[m];typeof v!="number"&&(v=k9.set(v).getHex()),p[m]=v}i.colorRanges=p}Object.freeze(i);const{textureWidth:r,sdfExponent:s}=Qh,{sdfGlyphSize:a}=i,o=r/a*4;let l=ZT[a];if(!l){const p=document.createElement("canvas");p.width=r,p.height=a*256/o,l=ZT[a]={glyphCount:0,sdfGlyphSize:a,sdfCanvas:p,sdfTexture:new An(p,void 0,void 0,void 0,Pn,Pn),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,G9(l)}const{sdfTexture:c,sdfCanvas:f}=l;E3(i).then(p=>{const{glyphIds:m,glyphFontIndices:v,fontData:x,glyphPositions:_,fontSize:g,timings:b}=p,S=[],E=new Float32Array(m.length*4);let w=0,T=0;const C=Xc(),U=x.map(O=>{let V=l.glyphsByFont.get(O.src);return V||l.glyphsByFont.set(O.src,V=new Map),V});m.forEach((O,V)=>{const ee=v[V],{src:P,unitsPerEm:L}=x[ee];let k=U[ee].get(O);if(!k){const{path:K,pathBounds:j}=p.glyphData[P][O],J=Math.max(j[2]-j[0],j[3]-j[1])/a*(Qh.sdfMargin*a+.5),he=l.glyphCount++,re=[j[0]-J,j[1]-J,j[2]+J,j[3]+J];U[ee].set(O,k={path:K,atlasIndex:he,sdfViewBox:re}),S.push(k)}const{sdfViewBox:H}=k,W=_[T++],F=_[T++],Y=g/L;E[w++]=W+H[0]*Y,E[w++]=F+H[1]*Y,E[w++]=W+H[2]*Y,E[w++]=F+H[3]*Y,m[V]=k.atlasIndex}),b.quads=(b.quads||0)+(Xc()-C);const D=Xc();b.sdf={};const R=f.height,I=Math.ceil(l.glyphCount/o),z=Math.pow(2,Math.ceil(Math.log2(I*a)));z>R&&(console.info(`Increasing SDF texture size ${R}->${z}`),B9(f,r,z),c.dispose()),Promise.all(S.map(O=>b3(O,l,i.gpuAccelerateSDF).then(({timing:V})=>{b.sdf[O.atlasIndex]=V}))).then(()=>{S.length&&!l.contextLost&&(S3(l),c.needsUpdate=!0),b.sdfTotal=Xc()-D,b.total=Xc()-t,e(Object.freeze({parameters:i,sdfTexture:c,sdfGlyphSize:a,sdfExponent:s,glyphBounds:E,glyphAtlasIndices:m,glyphColors:p.glyphColors,caretPositions:p.caretPositions,chunkedBounds:p.chunkedBounds,ascender:p.ascender,descender:p.descender,lineHeight:p.lineHeight,capHeight:p.capHeight,xHeight:p.xHeight,topBaseline:p.topBaseline,blockBounds:p.blockBounds,visibleBounds:p.visibleBounds,timings:p.timings}))})}),Promise.resolve().then(()=>{l.contextLost||F9(f)})}function b3({path:i,atlasIndex:e,sdfViewBox:t},{sdfGlyphSize:n,sdfCanvas:r,contextLost:s},a){if(s)return Promise.resolve({timing:-1});const{textureWidth:o,sdfExponent:l}=Qh,c=Math.max(t[2]-t[0],t[3]-t[1]),f=Math.floor(e/4),d=f%(o/n)*n,p=Math.floor(f/(o/n))*n,m=e%4;return O9(n,n,i,t,c,l,r,d,p,m,a)}function G9(i){const e=i.sdfCanvas;e.addEventListener("webglcontextlost",t=>{console.log("Context Lost",t),t.preventDefault(),i.contextLost=!0}),e.addEventListener("webglcontextrestored",t=>{console.log("Context Restored",t),i.contextLost=!1;const n=[];i.glyphsByFont.forEach(r=>{r.forEach(s=>{n.push(b3(s,i,!0))})}),Promise.all(n).then(()=>{S3(i),i.sdfTexture.needsUpdate=!0})})}function H9({font:i,characters:e,sdfGlyphSize:t},n){let r=Array.isArray(e)?e.join(`
3979
+ `):""+e;x3({font:i,sdfGlyphSize:t,text:r},n)}function V9(i,e){for(let t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}let qp;function W9(i){return qp||(qp=typeof document>"u"?{}:document.createElement("a")),qp.href=i,qp.href}function S3(i){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:t}=i,{width:n,height:r}=e,s=i.sdfCanvas.getContext("webgl");let a=t.image.data;(!a||a.length!==n*r*4)&&(a=new Uint8Array(n*r*4),t.image={width:n,height:r,data:a},t.flipY=!1,t.isDataTexture=!0),s.readPixels(0,0,n,r,s.RGBA,s.UNSIGNED_BYTE,a)}}const X9=Uu({name:"Typesetter",dependencies:[U9,D9,g9],init(i,e,t){return i(e,t())}}),E3=Uu({name:"Typesetter",dependencies:[X9],init(i){return function(e){return new Promise(t=>{i.typeset(e,t)})}},getTransferables(i){const e=[];for(let t in i)i[t]&&i[t].buffer&&e.push(i[t].buffer);return e}});E3.onMainThread;const KT={};function j9(i){let e=KT[i];return e||(e=KT[i]=new Ta(1,1,i,i).translate(.5,.5,0)),e}const q9="aTroikaGlyphBounds",JT="aTroikaGlyphIndex",Y9="aTroikaGlyphColor";class Z9 extends p1{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new ri,this.boundingBox=new Qn}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let t=j9(e);["position","normal","uv"].forEach(n=>{this.attributes[n]=t.attributes[n].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,n,r,s){this.updateAttributeData(q9,e,4),this.updateAttributeData(JT,t,1),this.updateAttributeData(Y9,s,3),this._blockBounds=n,this._chunkedBounds=r,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:n}=this;if(t){const{PI:r,floor:s,min:a,max:o,sin:l,cos:c}=Math,f=r/2,d=r*2,p=Math.abs(t),m=e[0]/p,v=e[2]/p,x=s((m+f)/d)!==s((v+f)/d)?-p:a(l(m)*p,l(v)*p),_=s((m-f)/d)!==s((v-f)/d)?p:o(l(m)*p,l(v)*p),g=s((m+r)/d)!==s((v+r)/d)?p*2:o(p-c(m)*p,p-c(v)*p);n.min.set(x,e[1],t<0?-g:0),n.max.set(_,e[3],t<0?0:g)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(JT).count,n=this._chunkedBounds;if(n)for(let r=n.length;r--;){t=n[r].end;let s=n[r].rect;if(s[1]<e.w&&s[3]>e.y&&s[0]<e.z&&s[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,n){const r=this.getAttribute(e);t?r&&r.array.length===t.length?(r.array.set(t),r.needsUpdate=!0):(this.setAttribute(e,new Rl(t,n)),delete this._maxInstanceCount,this.dispose()):r&&this.deleteAttribute(e)}}const K9=`
3980
3980
  uniform vec2 uTroikaSDFTextureSize;
3981
3981
  uniform float uTroikaSDFGlyphSize;
3982
3982
  uniform vec4 uTroikaTotalBounds;
@@ -3995,7 +3995,7 @@ varying vec4 vTroikaTextureUVBounds;
3995
3995
  varying float vTroikaTextureChannel;
3996
3996
  varying vec3 vTroikaGlyphColor;
3997
3997
  varying vec2 vTroikaGlyphDimensions;
3998
- `,K9=`
3998
+ `,J9=`
3999
3999
  vec4 bounds = aTroikaGlyphBounds;
4000
4000
  bounds.xz += uTroikaPositionOffset.x;
4001
4001
  bounds.yw -= uTroikaPositionOffset.y;
@@ -4037,7 +4037,7 @@ vec2 txStartUV = txUvPerSquare * vec2(
4037
4037
  );
4038
4038
  vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);
4039
4039
  vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);
4040
- `,J9=`
4040
+ `,Q9=`
4041
4041
  uniform sampler2D uTroikaSDFTexture;
4042
4042
  uniform vec2 uTroikaSDFTextureSize;
4043
4043
  uniform float uTroikaSDFGlyphSize;
@@ -4110,7 +4110,7 @@ float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {
4110
4110
 
4111
4111
  return alpha;
4112
4112
  }
4113
- `,Q9=`
4113
+ `,$9=`
4114
4114
  float aaDist = troikaGetAADist();
4115
4115
  float fragDistance = troikaGetFragDistValue();
4116
4116
  float edgeAlpha = uTroikaSDFDebug ?
@@ -4133,24 +4133,24 @@ gl_FragColor.a *= edgeAlpha;
4133
4133
  if (edgeAlpha == 0.0) {
4134
4134
  discard;
4135
4135
  }
4136
- `;function $9(i){const e=Ux(i,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Ge},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new kt(0,0,0,0)},uTroikaClipRect:{value:new kt(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Ge},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new $e},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new wt},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:Z9,vertexTransform:K9,fragmentDefs:J9,fragmentColorTransform:Q9,customRewriter({vertexShader:t,fragmentShader:n}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(n)&&(n=n.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(t)||(t=t.replace(_3,`uniform vec3 diffuse;
4136
+ `;function eW(i){const e=Ux(i,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Ge},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new kt(0,0,0,0)},uTroikaClipRect:{value:new kt(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Ge},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new $e},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new wt},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:K9,vertexTransform:J9,fragmentDefs:Q9,fragmentColorTransform:$9,customRewriter({vertexShader:t,fragmentShader:n}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(n)&&(n=n.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(t)||(t=t.replace(y3,`uniform vec3 diffuse;
4137
4137
  $&
4138
4138
  vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
4139
- `))),{vertexShader:t,fragmentShader:n}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const ab=new Ma({color:16777215,side:In,transparent:!0}),QT=8421504,$T=new bt,Yp=new Q,A_=new Q,kh=[],eW=new Q,C_="+x+y";function eA(i){return Array.isArray(i)?i[0]:i}let w3=()=>{const i=new pn(new Ta(1,1),ab);return w3=()=>i,i},T3=()=>{const i=new pn(new Ta(1,1,32,1),ab);return T3=()=>i,i};const tW={type:"syncstart"},nW={type:"synccomplete"},A3=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],iW=A3.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let C3=class extends pn{constructor(){const e=new Y9;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=QT,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=C_,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(tW),b3({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach(r=>r&&r())})),this.dispatchEvent(nW),e&&e()})))}onBeforeRender(e,t,n,r,s,a){this.sync(),s.isTroikaTextMaterial&&this._prepareForRender(s)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return $9(e)}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=ab.clone());if((!e||!e.isDerivedFrom(t))&&(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function n(){t.removeEventListener("dispose",n),e.dispose()})),this.hasOutline()){let n=e._outlineMtl;return n||(n=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),n.isTextOutlineMaterial=!0,n.depthWrite=!1,n.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),n.dispose()})),[n,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return eA(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return eA(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){const t=e.isTextOutlineMaterial,n=e.uniforms,r=this.textRenderInfo;if(r){const{sdfTexture:o,blockBounds:l}=r;n.uTroikaSDFTexture.value=o,n.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),n.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,n.uTroikaSDFExponent.value=r.sdfExponent,n.uTroikaTotalBounds.value.fromArray(l),n.uTroikaUseGlyphColors.value=!t&&!!r.glyphColors;let c=0,f=0,d=0,p,m,v,x=0,_=0;if(t){let{outlineWidth:b,outlineOffsetX:S,outlineOffsetY:E,outlineBlur:w,outlineOpacity:T}=this;c=this._parsePercent(b)||0,f=Math.max(0,this._parsePercent(w)||0),p=T,x=this._parsePercent(S)||0,_=this._parsePercent(E)||0}else d=Math.max(0,this._parsePercent(this.strokeWidth)||0),d&&(v=this.strokeColor,n.uTroikaStrokeColor.value.set(v??QT),m=this.strokeOpacity,m==null&&(m=1)),p=this.fillOpacity;n.uTroikaEdgeOffset.value=c,n.uTroikaPositionOffset.value.set(x,_),n.uTroikaBlurRadius.value=f,n.uTroikaStrokeWidth.value=d,n.uTroikaStrokeOpacity.value=m,n.uTroikaFillOpacity.value=p??1,n.uTroikaCurveRadius.value=this.curveRadius||0;let g=this.clipRect;if(g&&Array.isArray(g)&&g.length===4)n.uTroikaClipRect.value.fromArray(g);else{const b=(this.fontSize||.1)*100;n.uTroikaClipRect.value.set(l[0]-b,l[1]-b,l[2]+b,l[3]+b)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const s=t?this.outlineColor||0:this.color;if(s==null)delete e.color;else{const o=e.hasOwnProperty("color")?e.color:e.color=new $e;(s!==o._input||typeof s=="object")&&o.set(o._input=s)}let a=this.orientation||C_;if(a!==e._orientation){let o=n.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let l=a!==C_&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,c,f,d,p]=l;Yp.set(0,0,0)[f]=c==="-"?1:-1,A_.set(0,0,0)[p]=d==="-"?-1:1,$T.lookAt(eW,Yp.cross(A_),A_),o.setFromMatrix4($T)}else o.identity();e._orientation=a}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new Ge){t.copy(e);const n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new Ge){return Yp.copy(e),this.localPositionToTextCoords(this.worldToLocal(Yp),t)}raycast(e,t){const{textRenderInfo:n,curveRadius:r}=this;if(n){const s=n.blockBounds,a=r?T3():w3(),o=a.geometry,{position:l,uv:c}=o.attributes;for(let f=0;f<c.count;f++){let d=s[0]+c.getX(f)*(s[2]-s[0]);const p=s[1]+c.getY(f)*(s[3]-s[1]);let m=0;r&&(m=r-Math.cos(d/r)*r,d=Math.sin(d/r)*r),l.setXYZ(f,d,p,m)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,kh.length=0,a.raycast(e,kh);for(let f=0;f<kh.length;f++)kh[f].object=this,t.push(kh[f])}}copy(e){const t=this.geometry;return super.copy(e),this.geometry=t,iW.forEach(n=>{this[n]=e[n]}),this}clone(){return new this.constructor().copy(this)}};A3.forEach(i=>{const e="_private_"+i;Object.defineProperty(C3.prototype,i,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});new Qn;new $e;const rW=Z.forwardRef(({sdfGlyphSize:i=64,anchorX:e="center",anchorY:t="middle",font:n,fontSize:r=1,children:s,characters:a,onSync:o,...l},c)=>{const f=Jn(({invalidate:v})=>v),[d]=Z.useState(()=>new C3),[p,m]=Z.useMemo(()=>{const v=[];let x="";return Z.Children.forEach(s,_=>{typeof _=="string"||typeof _=="number"?x+=_:v.push(_)}),[v,x]},[s]);return W4(()=>new Promise(v=>G9({font:n,characters:a},v)),["troika-text",n,a]),Z.useLayoutEffect(()=>void d.sync(()=>{f(),o&&o(d)})),Z.useEffect(()=>()=>d.dispose(),[d]),Z.createElement("primitive",Il({object:d,ref:c,font:n,text:m,anchorX:e,anchorY:t,fontSize:r,sdfGlyphSize:i},l),p)});/*!
4139
+ `))),{vertexShader:t,fragmentShader:n}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const ab=new Ma({color:16777215,side:In,transparent:!0}),QT=8421504,$T=new bt,Yp=new Q,A_=new Q,kh=[],tW=new Q,C_="+x+y";function eA(i){return Array.isArray(i)?i[0]:i}let M3=()=>{const i=new pn(new Ta(1,1),ab);return M3=()=>i,i},w3=()=>{const i=new pn(new Ta(1,1,32,1),ab);return w3=()=>i,i};const nW={type:"syncstart"},iW={type:"synccomplete"},T3=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],rW=T3.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let A3=class extends pn{constructor(){const e=new Z9;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=QT,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=C_,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(nW),x3({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach(r=>r&&r())})),this.dispatchEvent(iW),e&&e()})))}onBeforeRender(e,t,n,r,s,a){this.sync(),s.isTroikaTextMaterial&&this._prepareForRender(s)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return eW(e)}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=ab.clone());if((!e||!e.isDerivedFrom(t))&&(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function n(){t.removeEventListener("dispose",n),e.dispose()})),this.hasOutline()){let n=e._outlineMtl;return n||(n=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),n.isTextOutlineMaterial=!0,n.depthWrite=!1,n.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),n.dispose()})),[n,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return eA(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return eA(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){const t=e.isTextOutlineMaterial,n=e.uniforms,r=this.textRenderInfo;if(r){const{sdfTexture:o,blockBounds:l}=r;n.uTroikaSDFTexture.value=o,n.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),n.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,n.uTroikaSDFExponent.value=r.sdfExponent,n.uTroikaTotalBounds.value.fromArray(l),n.uTroikaUseGlyphColors.value=!t&&!!r.glyphColors;let c=0,f=0,d=0,p,m,v,x=0,_=0;if(t){let{outlineWidth:b,outlineOffsetX:S,outlineOffsetY:E,outlineBlur:w,outlineOpacity:T}=this;c=this._parsePercent(b)||0,f=Math.max(0,this._parsePercent(w)||0),p=T,x=this._parsePercent(S)||0,_=this._parsePercent(E)||0}else d=Math.max(0,this._parsePercent(this.strokeWidth)||0),d&&(v=this.strokeColor,n.uTroikaStrokeColor.value.set(v??QT),m=this.strokeOpacity,m==null&&(m=1)),p=this.fillOpacity;n.uTroikaEdgeOffset.value=c,n.uTroikaPositionOffset.value.set(x,_),n.uTroikaBlurRadius.value=f,n.uTroikaStrokeWidth.value=d,n.uTroikaStrokeOpacity.value=m,n.uTroikaFillOpacity.value=p??1,n.uTroikaCurveRadius.value=this.curveRadius||0;let g=this.clipRect;if(g&&Array.isArray(g)&&g.length===4)n.uTroikaClipRect.value.fromArray(g);else{const b=(this.fontSize||.1)*100;n.uTroikaClipRect.value.set(l[0]-b,l[1]-b,l[2]+b,l[3]+b)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const s=t?this.outlineColor||0:this.color;if(s==null)delete e.color;else{const o=e.hasOwnProperty("color")?e.color:e.color=new $e;(s!==o._input||typeof s=="object")&&o.set(o._input=s)}let a=this.orientation||C_;if(a!==e._orientation){let o=n.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let l=a!==C_&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,c,f,d,p]=l;Yp.set(0,0,0)[f]=c==="-"?1:-1,A_.set(0,0,0)[p]=d==="-"?-1:1,$T.lookAt(tW,Yp.cross(A_),A_),o.setFromMatrix4($T)}else o.identity();e._orientation=a}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new Ge){t.copy(e);const n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new Ge){return Yp.copy(e),this.localPositionToTextCoords(this.worldToLocal(Yp),t)}raycast(e,t){const{textRenderInfo:n,curveRadius:r}=this;if(n){const s=n.blockBounds,a=r?w3():M3(),o=a.geometry,{position:l,uv:c}=o.attributes;for(let f=0;f<c.count;f++){let d=s[0]+c.getX(f)*(s[2]-s[0]);const p=s[1]+c.getY(f)*(s[3]-s[1]);let m=0;r&&(m=r-Math.cos(d/r)*r,d=Math.sin(d/r)*r),l.setXYZ(f,d,p,m)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,kh.length=0,a.raycast(e,kh);for(let f=0;f<kh.length;f++)kh[f].object=this,t.push(kh[f])}}copy(e){const t=this.geometry;return super.copy(e),this.geometry=t,rW.forEach(n=>{this[n]=e[n]}),this}clone(){return new this.constructor().copy(this)}};T3.forEach(i=>{const e="_private_"+i;Object.defineProperty(A3.prototype,i,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});new Qn;new $e;const sW=Z.forwardRef(({sdfGlyphSize:i=64,anchorX:e="center",anchorY:t="middle",font:n,fontSize:r=1,children:s,characters:a,onSync:o,...l},c)=>{const f=Jn(({invalidate:v})=>v),[d]=Z.useState(()=>new A3),[p,m]=Z.useMemo(()=>{const v=[];let x="";return Z.Children.forEach(s,_=>{typeof _=="string"||typeof _=="number"?x+=_:v.push(_)}),[v,x]},[s]);return W4(()=>new Promise(v=>H9({font:n,characters:a},v)),["troika-text",n,a]),Z.useLayoutEffect(()=>void d.sync(()=>{f(),o&&o(d)})),Z.useEffect(()=>()=>d.dispose(),[d]),Z.createElement("primitive",Il({object:d,ref:c,font:n,text:m,anchorX:e,anchorY:t,fontSize:r,sdfGlyphSize:i},l),p)});/*!
4140
4140
  * camera-controls
4141
4141
  * https://github.com/yomotsu/camera-controls
4142
4142
  * (c) 2017 @yomotsu
4143
4143
  * Released under the MIT License.
4144
- */const Sn={LEFT:1,RIGHT:2,MIDDLE:4},Ae=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),jc={NONE:0,IN:1,OUT:-1};function hl(i){return i.isPerspectiveCamera}function so(i){return i.isOrthographicCamera}const io=Math.PI*2,tA=Math.PI/2,R3=1e-5,Gh=Math.PI/180;function ns(i,e,t){return Math.max(e,Math.min(t,i))}function dn(i,e=R3){return Math.abs(i)<e}function $t(i,e,t=R3){return dn(i-e,t)}function nA(i,e){return Math.round(i/e)*e}function Hh(i){return isFinite(i)?i:i<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Vh(i){return Math.abs(i)<Number.MAX_VALUE?i:i*(1/0)}function Zp(i,e,t,n,r=1/0,s){n=Math.max(1e-4,n);const a=2/n,o=a*s,l=1/(1+o+.48*o*o+.235*o*o*o);let c=i-e;const f=e,d=r*n;c=ns(c,-d,d),e=i-c;const p=(t.value+a*c)*s;t.value=(t.value-a*p)*l;let m=e+(c+p)*l;return f-i>0==m>f&&(m=f,t.value=(m-f)/s),m}function iA(i,e,t,n,r=1/0,s,a){n=Math.max(1e-4,n);const o=2/n,l=o*s,c=1/(1+l+.48*l*l+.235*l*l*l);let f=e.x,d=e.y,p=e.z,m=i.x-f,v=i.y-d,x=i.z-p;const _=f,g=d,b=p,S=r*n,E=S*S,w=m*m+v*v+x*x;if(w>E){const ee=Math.sqrt(w);m=m/ee*S,v=v/ee*S,x=x/ee*S}f=i.x-m,d=i.y-v,p=i.z-x;const T=(t.x+o*m)*s,C=(t.y+o*v)*s,U=(t.z+o*x)*s;t.x=(t.x-o*T)*c,t.y=(t.y-o*C)*c,t.z=(t.z-o*U)*c,a.x=f+(m+T)*c,a.y=d+(v+C)*c,a.z=p+(x+U)*c;const D=_-i.x,R=g-i.y,I=b-i.z,z=a.x-_,O=a.y-g,V=a.z-b;return D*z+R*O+I*V>0&&(a.x=_,a.y=g,a.z=b,t.x=(a.x-_)/s,t.y=(a.y-g)/s,t.z=(a.z-b)/s),a}function R_(i,e){e.set(0,0),i.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=i.length,e.y/=i.length}function D_(i,e){return so(i)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}let sW=class{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e)}}};var U_;const aW="3.1.0",Kp=1/8,oW=/Mac/.test((U_=globalThis?.navigator)===null||U_===void 0?void 0:U_.platform);let Et,rA,Jp,O_,Ji,Lt,Zt,qc,Wh,bs,Ss,fl,sA,aA,vr,Yc,Zc,oA,L_,lA,N_,I_,Qp,di=class Lx extends sW{static install(e){Et=e.THREE,rA=Object.freeze(new Et.Vector3(0,0,0)),Jp=Object.freeze(new Et.Vector3(0,1,0)),O_=Object.freeze(new Et.Vector3(0,0,1)),Ji=new Et.Vector2,Lt=new Et.Vector3,Zt=new Et.Vector3,qc=new Et.Vector3,Wh=new Et.Vector3,bs=new Et.Vector3,Ss=new Et.Vector3,fl=new Et.Vector3,sA=new Et.Vector3,aA=new Et.Vector3,vr=new Et.Spherical,Yc=new Et.Spherical,Zc=new Et.Box3,oA=new Et.Box3,L_=new Et.Sphere,lA=new Et.Quaternion,N_=new Et.Quaternion,I_=new Et.Matrix4,Qp=new Et.Raycaster}static get ACTION(){return Ae}set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=Ae.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=jc.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new Et.Vector3,this._focalOffsetVelocity=new Et.Vector3,this._zoomVelocity={value:0},this._truckInternal=(g,b,S,E)=>{let w,T;if(hl(this._camera)){const C=Lt.copy(this._camera.position).sub(this._target),U=this._camera.getEffectiveFOV()*Gh,D=C.length()*Math.tan(U*.5);w=this.truckSpeed*g*D/this._elementRect.height,T=this.truckSpeed*b*D/this._elementRect.height}else if(so(this._camera)){const C=this._camera;w=this.truckSpeed*g*(C.right-C.left)/C.zoom/this._elementRect.width,T=this.truckSpeed*b*(C.top-C.bottom)/C.zoom/this._elementRect.height}else return;E?(S?this.setFocalOffset(this._focalOffsetEnd.x+w,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(w,0,!0),this.forward(-T,!0)):S?this.setFocalOffset(this._focalOffsetEnd.x+w,this._focalOffsetEnd.y+T,this._focalOffsetEnd.z,!0):this.truck(w,T,!0)},this._rotateInternal=(g,b)=>{const S=io*this.azimuthRotateSpeed*g/this._elementRect.height,E=io*this.polarRotateSpeed*b/this._elementRect.height;this.rotate(S,E,!0)},this._dollyInternal=(g,b,S)=>{const E=Math.pow(.95,-g*this.dollySpeed),w=this._sphericalEnd.radius,T=this._sphericalEnd.radius*E,C=ns(T,this.minDistance,this.maxDistance),U=C-T;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(T,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(U,!0),this._dollyToNoClamp(C,!0)):this._dollyToNoClamp(C,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?T:C)-w,this._dollyControlCoord.set(b,S)),this._lastDollyDirection=Math.sign(-g)},this._zoomInternal=(g,b,S)=>{const E=Math.pow(.95,g*this.dollySpeed),w=this._zoom,T=this._zoom*E;this.zoomTo(T,!0),this.dollyToCursor&&(this._changedZoom+=T-w,this._dollyControlCoord.set(b,S))},typeof Et>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new Et.Quaternion().setFromUnitVectors(this._camera.up,Jp),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=Ae.NONE,this._target=new Et.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new Et.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new Et.Spherical().setFromVector3(Lt.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new Et.Vector3,new Et.Vector3,new Et.Vector3,new Et.Vector3],this._updateNearPlaneCorners(),this._boundary=new Et.Box3(new Et.Vector3(-1/0,-1/0,-1/0),new Et.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new Et.Vector2,this.mouseButtons={left:Ae.ROTATE,middle:Ae.DOLLY,right:Ae.TRUCK,wheel:hl(this._camera)?Ae.DOLLY:so(this._camera)?Ae.ZOOM:Ae.NONE},this.touches={one:Ae.TOUCH_ROTATE,two:hl(this._camera)?Ae.TOUCH_DOLLY_TRUCK:so(this._camera)?Ae.TOUCH_ZOOM_TRUCK:Ae.NONE,three:Ae.TOUCH_TRUCK};const n=new Et.Vector2,r=new Et.Vector2,s=new Et.Vector2,a=g=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const E=this._domElement.getBoundingClientRect(),w=g.clientX/E.width,T=g.clientY/E.height;if(w<this._interactiveArea.left||w>this._interactiveArea.right||T<this._interactiveArea.top||T>this._interactiveArea.bottom)return}const b=g.pointerType!=="mouse"?null:(g.buttons&Sn.LEFT)===Sn.LEFT?Sn.LEFT:(g.buttons&Sn.MIDDLE)===Sn.MIDDLE?Sn.MIDDLE:(g.buttons&Sn.RIGHT)===Sn.RIGHT?Sn.RIGHT:null;if(b!==null){const E=this._findPointerByMouseButton(b);E&&this._disposePointer(E)}if((g.buttons&Sn.LEFT)===Sn.LEFT&&this._lockedPointer)return;const S={pointerId:g.pointerId,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:b};this._activePointers.push(S),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),this._isDragging=!0,p(g)},o=g=>{g.cancelable&&g.preventDefault();const b=g.pointerId,S=this._lockedPointer||this._findPointerById(b);if(S){if(S.clientX=g.clientX,S.clientY=g.clientY,S.deltaX=g.movementX,S.deltaY=g.movementY,this._state=0,g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(g.buttons&Sn.LEFT)===Sn.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(g.buttons&Sn.MIDDLE)===Sn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(g.buttons&Sn.RIGHT)===Sn.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=g=>{const b=this._findPointerById(g.pointerId);if(!(b&&b===this._lockedPointer)){if(b&&this._disposePointer(b),g.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=Ae.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=Ae.NONE;v()}};let c=-1;const f=g=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===Ae.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const T=this._domElement.getBoundingClientRect(),C=g.clientX/T.width,U=g.clientY/T.height;if(C<this._interactiveArea.left||C>this._interactiveArea.right||U<this._interactiveArea.top||U>this._interactiveArea.bottom)return}if(g.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===Ae.ROTATE||this.mouseButtons.wheel===Ae.TRUCK){const T=performance.now();c-T<1e3&&this._getClientRect(this._elementRect),c=T}const b=oW?-1:-3,S=g.deltaMode===1||g.ctrlKey?g.deltaY/b:g.deltaY/(b*10),E=this.dollyToCursor?(g.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(g.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case Ae.ROTATE:{this._rotateInternal(g.deltaX,g.deltaY),this._isUserControllingRotate=!0;break}case Ae.TRUCK:{this._truckInternal(g.deltaX,g.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case Ae.SCREEN_PAN:{this._truckInternal(g.deltaX,g.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case Ae.OFFSET:{this._truckInternal(g.deltaX,g.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case Ae.DOLLY:{this._dollyInternal(-S,E,w),this._isUserControllingDolly=!0;break}case Ae.ZOOM:{this._zoomInternal(-S,E,w),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},d=g=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===Lx.ACTION.NONE){const b=g instanceof PointerEvent?g.pointerId:0,S=this._findPointerById(b);S&&this._disposePointer(S),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}g.preventDefault()}},p=g=>{if(!this._enabled)return;if(R_(this._activePointers,Ji),this._getClientRect(this._elementRect),n.copy(Ji),r.copy(Ji),this._activePointers.length>=2){const S=Ji.x-this._activePointers[1].clientX,E=Ji.y-this._activePointers[1].clientY,w=Math.sqrt(S*S+E*E);s.set(0,w);const T=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,C=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;r.set(T,C)}if(this._state=0,!g)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in g&&g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(g.buttons&Sn.LEFT)===Sn.LEFT&&(this._state=this._state|this.mouseButtons.left),(g.buttons&Sn.MIDDLE)===Sn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&Sn.RIGHT)===Sn.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&Ae.ROTATE)===Ae.ROTATE||(this._state&Ae.TOUCH_ROTATE)===Ae.TOUCH_ROTATE||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE||(this._state&Ae.TOUCH_ZOOM_ROTATE)===Ae.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&Ae.TRUCK)===Ae.TRUCK||(this._state&Ae.SCREEN_PAN)===Ae.SCREEN_PAN||(this._state&Ae.TOUCH_TRUCK)===Ae.TOUCH_TRUCK||(this._state&Ae.TOUCH_SCREEN_PAN)===Ae.TOUCH_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_ZOOM_TRUCK)===Ae.TOUCH_ZOOM_TRUCK||(this._state&Ae.TOUCH_ZOOM_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&Ae.DOLLY)===Ae.DOLLY||(this._state&Ae.TOUCH_DOLLY)===Ae.TOUCH_DOLLY||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&Ae.ZOOM)===Ae.ZOOM||(this._state&Ae.TOUCH_ZOOM)===Ae.TOUCH_ZOOM||(this._state&Ae.TOUCH_ZOOM_TRUCK)===Ae.TOUCH_ZOOM_TRUCK||(this._state&Ae.TOUCH_ZOOM_SCREEN_PAN)===Ae.TOUCH_ZOOM_SCREEN_PAN||(this._state&Ae.TOUCH_ZOOM_OFFSET)===Ae.TOUCH_ZOOM_OFFSET||(this._state&Ae.TOUCH_ZOOM_ROTATE)===Ae.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&Ae.OFFSET)===Ae.OFFSET||(this._state&Ae.TOUCH_OFFSET)===Ae.TOUCH_OFFSET||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET||(this._state&Ae.TOUCH_ZOOM_OFFSET)===Ae.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,R_(this._activePointers,Ji);const b=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,S=b?-b.deltaX:r.x-Ji.x,E=b?-b.deltaY:r.y-Ji.y;if(r.copy(Ji),((this._state&Ae.ROTATE)===Ae.ROTATE||(this._state&Ae.TOUCH_ROTATE)===Ae.TOUCH_ROTATE||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE||(this._state&Ae.TOUCH_ZOOM_ROTATE)===Ae.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(S,E),this._isUserControllingRotate=!0),(this._state&Ae.DOLLY)===Ae.DOLLY||(this._state&Ae.ZOOM)===Ae.ZOOM){const w=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,T=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,C=this.dollyDragInverted?-1:1;(this._state&Ae.DOLLY)===Ae.DOLLY?(this._dollyInternal(C*E*Kp,w,T),this._isUserControllingDolly=!0):(this._zoomInternal(C*E*Kp,w,T),this._isUserControllingZoom=!0)}if((this._state&Ae.TOUCH_DOLLY)===Ae.TOUCH_DOLLY||(this._state&Ae.TOUCH_ZOOM)===Ae.TOUCH_ZOOM||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_ZOOM_TRUCK)===Ae.TOUCH_ZOOM_TRUCK||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_ZOOM_SCREEN_PAN)===Ae.TOUCH_ZOOM_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET||(this._state&Ae.TOUCH_ZOOM_OFFSET)===Ae.TOUCH_ZOOM_OFFSET||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE||(this._state&Ae.TOUCH_ZOOM_ROTATE)===Ae.TOUCH_ZOOM_ROTATE){const w=Ji.x-this._activePointers[1].clientX,T=Ji.y-this._activePointers[1].clientY,C=Math.sqrt(w*w+T*T),U=s.y-C;s.set(0,C);const D=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,R=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&Ae.TOUCH_DOLLY)===Ae.TOUCH_DOLLY||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET?(this._dollyInternal(U*Kp,D,R),this._isUserControllingDolly=!0):(this._zoomInternal(U*Kp,D,R),this._isUserControllingZoom=!0)}((this._state&Ae.TRUCK)===Ae.TRUCK||(this._state&Ae.TOUCH_TRUCK)===Ae.TOUCH_TRUCK||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_ZOOM_TRUCK)===Ae.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(S,E,!1,!1),this._isUserControllingTruck=!0),((this._state&Ae.SCREEN_PAN)===Ae.SCREEN_PAN||(this._state&Ae.TOUCH_SCREEN_PAN)===Ae.TOUCH_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_ZOOM_SCREEN_PAN)===Ae.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(S,E,!1,!0),this._isUserControllingTruck=!0),((this._state&Ae.OFFSET)===Ae.OFFSET||(this._state&Ae.TOUCH_OFFSET)===Ae.TOUCH_OFFSET||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET||(this._state&Ae.TOUCH_ZOOM_OFFSET)===Ae.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(S,E,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},v=()=>{R_(this._activePointers,Ji),r.copy(Ji),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",x),this._domElement.ownerDocument.addEventListener("pointerlockerror",_),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),p())},this.unlockPointer=()=>{var g,b,S;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(g=this._domElement)===null||g===void 0||g.ownerDocument.exitPointerLock(),(b=this._domElement)===null||b===void 0||b.ownerDocument.removeEventListener("pointerlockchange",x),(S=this._domElement)===null||S===void 0||S.ownerDocument.removeEventListener("pointerlockerror",_),this.cancel()};const x=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},_=()=>{this.unlockPointer()};this._addAllEventListeners=g=>{this._domElement=g,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",a),this._domElement.addEventListener("pointercancel",l),this._domElement.addEventListener("wheel",f,{passive:!1}),this._domElement.addEventListener("contextmenu",d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",a),this._domElement.removeEventListener("pointercancel",l),this._domElement.removeEventListener("wheel",f,{passive:!1}),this._domElement.removeEventListener("contextmenu",d),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.removeEventListener("pointerlockchange",x),this._domElement.ownerDocument.removeEventListener("pointerlockerror",_))},this.cancel=()=>{this._state!==Ae.NONE&&(this._state=Ae.NONE,this._activePointers.length=0,v())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=ns(e.width,0,1),this._interactiveArea.height=ns(e.height,0,1),this._interactiveArea.x=ns(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=ns(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;const r=ns(e,this.minAzimuthAngle,this.maxAzimuthAngle),s=ns(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=s,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const a=!n||$t(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&$t(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(a)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=jc.NONE,this._changedDolly=0,this._dollyToNoClamp(ns(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const a=this._collisionTest(),o=$t(a,this._spherical.radius);if(!(n>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,a)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const s=!t||$t(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(s)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Wh).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const n=!t||$t(this._target.x,this._targetEnd.x,this.restThreshold)&&$t(this._target.y,this._targetEnd.y,this.restThreshold)&&$t(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=ns(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const n=!t||$t(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),bs.setFromMatrixColumn(this._camera.matrix,0),Ss.setFromMatrixColumn(this._camera.matrix,1),bs.multiplyScalar(e),Ss.multiplyScalar(-t);const r=Lt.copy(bs).add(Ss),s=Zt.copy(this._targetEnd).add(r);return this.moveTo(s.x,s.y,s.z,n)}forward(e,t=!1){Lt.setFromMatrixColumn(this._camera.matrix,0),Lt.crossVectors(this._camera.up,Lt),Lt.multiplyScalar(e);const n=Zt.copy(this._targetEnd).add(Lt);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return Lt.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+Lt.x,this._targetEnd.y+Lt.y,this._targetEnd.z+Lt.z,t)}moveTo(e,t,n,r=!1){this._isUserControllingTruck=!1;const s=Lt.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,s,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const a=!r||$t(this._target.x,this._targetEnd.x,this.restThreshold)&&$t(this._target.y,this._targetEnd.y,this.restThreshold)&&$t(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}lookInDirectionOf(e,t,n,r=!1){const o=Lt.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(o.x,o.y,o.z,r)}fitToBox(e,t,{cover:n=!1,paddingLeft:r=0,paddingRight:s=0,paddingBottom:a=0,paddingTop:o=0}={}){const l=[],c=e.isBox3?Zc.copy(e):Zc.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const f=nA(this._sphericalEnd.theta,tA),d=nA(this._sphericalEnd.phi,tA);l.push(this.rotateTo(f,d,t));const p=Lt.setFromSpherical(this._sphericalEnd).normalize(),m=lA.setFromUnitVectors(p,O_),v=$t(Math.abs(p.y),1);v&&m.multiply(N_.setFromAxisAngle(Jp,f)),m.multiply(this._yAxisUpSpaceInverse);const x=oA.makeEmpty();Zt.copy(c.min).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.min).setX(c.max.x).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.min).setY(c.max.y).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.max).setZ(c.min.z).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.min).setZ(c.max.z).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.max).setY(c.min.y).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.max).setX(c.min.x).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.max).applyQuaternion(m),x.expandByPoint(Zt),x.min.x-=r,x.min.y-=a,x.max.x+=s,x.max.y+=o,m.setFromUnitVectors(O_,p),v&&m.premultiply(N_.invert()),m.premultiply(this._yAxisUpSpace);const _=x.getSize(Lt),g=x.getCenter(Zt).applyQuaternion(m);if(hl(this._camera)){const b=this.getDistanceToFitBox(_.x,_.y,_.z,n);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.dollyTo(b,t)),l.push(this.setFocalOffset(0,0,0,t))}else if(so(this._camera)){const b=this._camera,S=b.right-b.left,E=b.top-b.bottom,w=n?Math.max(S/_.x,E/_.y):Math.min(S/_.x,E/_.y);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.zoomTo(w,t)),l.push(this.setFocalOffset(0,0,0,t))}return Promise.all(l)}fitToSphere(e,t){const n=[],s="isObject3D"in e?Lx.createBoundingSphere(e,L_):L_.copy(e);if(n.push(this.moveTo(s.center.x,s.center.y,s.center.z,t)),hl(this._camera)){const a=this.getDistanceToFitSphere(s.radius);n.push(this.dollyTo(a,t))}else if(so(this._camera)){const a=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,l=2*s.radius,c=Math.min(a/l,o/l);n.push(this.zoomTo(c,t))}return n.push(this.setFocalOffset(0,0,0,t)),Promise.all(n)}setLookAt(e,t,n,r,s,a,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=jc.NONE,this._changedDolly=0;const l=Zt.set(r,s,a),c=Lt.set(e,t,n);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const f=!o||$t(this._target.x,this._targetEnd.x,this.restThreshold)&&$t(this._target.y,this._targetEnd.y,this.restThreshold)&&$t(this._target.z,this._targetEnd.z,this.restThreshold)&&$t(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&$t(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&$t(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(f)}lerp(e,t,n,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=jc.NONE,this._changedDolly=0;const s=Lt.set(...e.target);if("spherical"in e)vr.set(...e.spherical);else{const d=Zt.set(...e.position);vr.setFromVector3(d.sub(s).applyQuaternion(this._yAxisUpSpace))}const a=qc.set(...t.target);if("spherical"in t)Yc.set(...t.spherical);else{const d=Zt.set(...t.position);Yc.setFromVector3(d.sub(a).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(s.lerp(a,n));const o=Yc.theta-vr.theta,l=Yc.phi-vr.phi,c=Yc.radius-vr.radius;this._sphericalEnd.set(vr.radius+c*n,vr.phi+l*n,vr.theta+o*n),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const f=!r||$t(this._target.x,this._targetEnd.x,this.restThreshold)&&$t(this._target.y,this._targetEnd.y,this.restThreshold)&&$t(this._target.z,this._targetEnd.z,this.restThreshold)&&$t(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&$t(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&$t(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(f)}lerpLookAt(e,t,n,r,s,a,o,l,c,f,d,p,m,v=!1){return this.lerp({position:[e,t,n],target:[r,s,a]},{position:[o,l,c],target:[f,d,p]},m,v)}setPosition(e,t,n,r=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n,r=!1){const s=this.getPosition(Lt),a=this.setLookAt(s.x,s.y,s.z,e,t,n,r);return this._sphericalEnd.phi=ns(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),a}setFocalOffset(e,t,n,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const s=!r||$t(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&$t(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&$t(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),bs.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Ss.setFromMatrixColumn(this._camera.matrixWorldInverse,1),fl.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=Lt.set(e,t,n),s=r.distanceTo(this._camera.position),a=r.sub(this._camera.position);bs.multiplyScalar(a.x),Ss.multiplyScalar(a.y),fl.multiplyScalar(a.z),Lt.copy(bs).add(Ss).add(fl),Lt.z=Lt.z+s,this.dollyTo(s,!1),this.setFocalOffset(-Lt.x,Lt.y,-Lt.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new Et.Vector4,typeof e=="number"?this._viewport.set(e,t,n,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,r=!1){if(D_(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const s=e/t,a=this._camera.getEffectiveFOV()*Gh,o=this._camera.aspect;return((r?s>o:s<o)?t:e/o)*.5/Math.tan(a*.5)+n*.5}getDistanceToFitSphere(e){if(D_(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*Gh,n=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,r=1<this._camera.aspect?t:n;return e/Math.sin(r*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new Et.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new Et.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new Et.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new Et.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%io+io)%io,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=io),this._spherical.theta+=io*Math.round((this._sphericalEnd.theta-this._spherical.theta)/io),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!$t(this._camera.up.x,this._cameraUp0.x)||!$t(this._camera.up.y,this._cameraUp0.y)||!$t(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const n=this.getPosition(Lt);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,Jp),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=Lt.subVectors(this._target,this._camera.position).normalize(),t=Zt.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const n=this.getPosition(Lt);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,s=sA.subVectors(this._targetEnd,this._target),a=aA.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(dn(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=Zp(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,d,1/0,e),this._needsUpdate=!0}if(dn(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=Zp(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,d,1/0,e),this._needsUpdate=!0}if(dn(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const d=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=Zp(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,d,this.maxSpeed,e),this._needsUpdate=!0}if(dn(s.x)&&dn(s.y)&&dn(s.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const d=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;iA(this._target,this._targetEnd,this._targetVelocity,d,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(dn(a.x)&&dn(a.y)&&dn(a.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const d=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;iA(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,d,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(dn(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const d=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=Zp(this._zoom,this._zoomEnd,this._zoomVelocity,d,1/0,e)}if(this.dollyToCursor){if(hl(this._camera)&&this._changedDolly!==0){const d=this._spherical.radius-this._lastDistance,p=this._camera,m=this._getCameraDirection(Wh),v=Lt.copy(m).cross(p.up).normalize();v.lengthSq()===0&&(v.x=1);const x=Zt.crossVectors(v,m),_=this._sphericalEnd.radius*Math.tan(p.getEffectiveFOV()*Gh*.5),b=(this._sphericalEnd.radius-d-this._sphericalEnd.radius)/this._sphericalEnd.radius,S=qc.copy(this._targetEnd).add(v.multiplyScalar(this._dollyControlCoord.x*_*p.aspect)).add(x.multiplyScalar(this._dollyControlCoord.y*_)),E=Lt.copy(this._targetEnd).lerp(S,b),w=this._lastDollyDirection===jc.IN&&this._spherical.radius<=this.minDistance,T=this._lastDollyDirection===jc.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(w||T)){this._sphericalEnd.radius-=d,this._spherical.radius-=d;const U=Zt.copy(m).multiplyScalar(-d);E.add(U)}this._boundary.clampPoint(E,E);const C=Zt.subVectors(E,this._targetEnd);this._targetEnd.copy(E),this._target.add(C),this._changedDolly-=d,dn(this._changedDolly)&&(this._changedDolly=0)}else if(so(this._camera)&&this._changedZoom!==0){const d=this._zoom-this._lastZoom,p=this._camera,m=Lt.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(p.near+p.far)/(p.near-p.far)).unproject(p),v=Zt.set(0,0,-1).applyQuaternion(p.quaternion),x=qc.copy(m).add(v.multiplyScalar(-m.dot(p.up))),g=-(this._zoom-d-this._zoom)/this._zoom,b=this._getCameraDirection(Wh),S=this._targetEnd.dot(b),E=Lt.copy(this._targetEnd).lerp(x,g),w=E.dot(b),T=b.multiplyScalar(w-S);E.sub(T),this._boundary.clampPoint(E,E);const C=Zt.subVectors(E,this._targetEnd);this._targetEnd.copy(E),this._target.add(C),this._changedZoom-=d,dn(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const l=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,l),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!dn(this._focalOffset.x)||!dn(this._focalOffset.y)||!dn(this._focalOffset.z))&&(bs.setFromMatrixColumn(this._camera.matrix,0),Ss.setFromMatrixColumn(this._camera.matrix,1),fl.setFromMatrixColumn(this._camera.matrix,2),bs.multiplyScalar(this._focalOffset.x),Ss.multiplyScalar(-this._focalOffset.y),fl.multiplyScalar(this._focalOffset.z),Lt.copy(bs).add(Ss).add(fl),this._camera.position.add(Lt),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),Lt.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const f=this._needsUpdate;return f&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):f?(this.dispatchEvent({type:"update"}),dn(t,this.restThreshold)&&dn(n,this.restThreshold)&&dn(r,this.restThreshold)&&dn(s.x,this.restThreshold)&&dn(s.y,this.restThreshold)&&dn(s.z,this.restThreshold)&&dn(a.x,this.restThreshold)&&dn(a.y,this.restThreshold)&&dn(a.z,this.restThreshold)&&dn(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!f&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=f,this._needsUpdate=!1,f}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:Hh(this.maxDistance),minZoom:this.minZoom,maxZoom:Hh(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Hh(this.maxPolarAngle),minAzimuthAngle:Hh(this.minAzimuthAngle),maxAzimuthAngle:Hh(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:Lt.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const n=JSON.parse(e);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=Vh(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=Vh(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=Vh(n.maxPolarAngle),this.minAzimuthAngle=Vh(n.minAzimuthAngle),this.maxAzimuthAngle=Vh(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],t),vr.setFromVector3(Lt.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(vr.theta,vr.phi,t),this.dollyTo(vr.radius,t),this.zoomTo(n.zoom,t),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",aW),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){const r=t.lengthSq();if(r===0)return e;const s=Zt.copy(t).add(e),o=this._boundary.clampPoint(s,qc).sub(s),l=o.lengthSq();if(l===0)return e.add(t);if(l===r)return e;if(n===0)return e.add(t).add(o);{const c=1+n*l/t.dot(o);return e.add(Zt.copy(t).multiplyScalar(c)).add(o.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(hl(this._camera)){const e=this._camera,t=e.near,n=e.getEffectiveFOV()*Gh,r=Math.tan(n*.5)*t,s=r*e.aspect;this._nearPlaneCorners[0].set(-s,-r,0),this._nearPlaneCorners[1].set(s,-r,0),this._nearPlaneCorners[2].set(s,r,0),this._nearPlaneCorners[3].set(-s,r,0)}else if(so(this._camera)){const e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,s=e.top*t,a=e.bottom*t;this._nearPlaneCorners[0].set(n,s,0),this._nearPlaneCorners[1].set(r,s,0),this._nearPlaneCorners[2].set(r,a,0),this._nearPlaneCorners[3].set(n,a,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||D_(this._camera,"_collisionTest"))return e;const n=this._getTargetDirection(Wh);I_.lookAt(rA,n,this._camera.up);for(let r=0;r<4;r++){const s=Zt.copy(this._nearPlaneCorners[r]);s.applyMatrix4(I_);const a=qc.addVectors(this._target,s);Qp.set(a,n),Qp.far=this._spherical.radius+1;const o=Qp.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const n=()=>{this.removeEventListener("rest",n),t()};this.addEventListener("rest",n)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new Et.Sphere){const n=t,r=n.center;Zc.makeEmpty(),e.traverseVisible(a=>{a.isMesh&&Zc.expandByObject(a)}),Zc.getCenter(r);let s=0;return e.traverseVisible(a=>{if(!a.isMesh)return;const o=a;if(!o.geometry)return;const l=o.geometry.clone();l.applyMatrix4(o.matrixWorld);const f=l.attributes.position;for(let d=0,p=f.count;d<p;d++)Lt.fromBufferAttribute(f,d),s=Math.max(s,r.distanceToSquared(Lt))}),n.radius=Math.sqrt(s),n}};const Es=1e-5;function lW(i,e,t){const n=new ho,r=t-Es;return n.absarc(Es,Es,Es,-Math.PI/2,-Math.PI,!0),n.absarc(Es,e-r*2,Es,Math.PI,Math.PI/2,!0),n.absarc(i-r*2,e-r*2,Es,Math.PI/2,0,!0),n.absarc(i-r*2,Es,Es,0,-Math.PI/2,!0),n}const cA=Z.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:s=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:l=.4,children:c,...f},d){return Z.createElement("mesh",Il({ref:d},f),Z.createElement(cW,{args:[e,t,n],radius:r,steps:s,smoothness:a,bevelSegments:o,creaseAngle:l}),c)}),cW=Z.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:s=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:l=.4,...c},f){const d=Z.useMemo(()=>lW(e,t,r),[e,t,r]),p=Z.useMemo(()=>({depth:n-r*2,bevelEnabled:!0,bevelSegments:o*2,steps:s,bevelSize:r-Es,bevelThickness:r,curveSegments:a}),[n,r,a,o,s]),m=Z.useRef(null);return Z.useLayoutEffect(()=>{m.current&&(m.current.center(),l9(m.current,l))},[d,p,l]),Z.useImperativeHandle(f,()=>m.current),Z.createElement("extrudeGeometry",Il({ref:m,args:[d,p]},c))});var Xh={exports:{}},uA;function uW(){if(uA)return Xh.exports;uA=1;var i={ellipse:"…",chars:[" ","-"],max:140,truncate:!0};function e(n,r,s,a){if(n<=r)return n;if(r<2)return n.slice(0,r-s.length)+s;for(var o=r-s.length,l=Math.floor(o/2),c=l,f=n.length-l,d=0;d<l;d++){var p=n.charAt(d),m=n.length-d,v=n.charAt(m);a.indexOf(p)!==-1&&(c=d),a.indexOf(v)!==-1&&(f=m)}return n.slice(0,c)+s+n.slice(f)}function t(n,r,s,a,o){if(n.length<=r)return n;for(var l=r-s.length,c=l,f=!1,d=0;d<=l;d++){var p=n.charAt(d);a.indexOf(p)!==-1&&(c=d,f=!0)}return!o&&!f?"":n.slice(0,c)+s}return Xh.exports=function(n,r,s){if(typeof n!="string"||n.length===0||r===0)return"";s=s||{};for(var a in i)(s[a]===null||typeof s[a]>"u")&&(s[a]=i[a]);return s.max=r||s.max,s.truncate=="middle"?e(n,s.max,s.ellipse,s.chars):t(n,s.max,s.ellipse,s.chars,s.truncate)},Xh.exports.ellipsizeMiddle=e,Xh.exports.ellipsize=t,Xh.exports}var hW=uW();const fW=vo(hW);/*!
4144
+ */const Sn={LEFT:1,RIGHT:2,MIDDLE:4},Ae=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),jc={NONE:0,IN:1,OUT:-1};function hl(i){return i.isPerspectiveCamera}function so(i){return i.isOrthographicCamera}const io=Math.PI*2,tA=Math.PI/2,C3=1e-5,Gh=Math.PI/180;function ns(i,e,t){return Math.max(e,Math.min(t,i))}function dn(i,e=C3){return Math.abs(i)<e}function $t(i,e,t=C3){return dn(i-e,t)}function nA(i,e){return Math.round(i/e)*e}function Hh(i){return isFinite(i)?i:i<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Vh(i){return Math.abs(i)<Number.MAX_VALUE?i:i*(1/0)}function Zp(i,e,t,n,r=1/0,s){n=Math.max(1e-4,n);const a=2/n,o=a*s,l=1/(1+o+.48*o*o+.235*o*o*o);let c=i-e;const f=e,d=r*n;c=ns(c,-d,d),e=i-c;const p=(t.value+a*c)*s;t.value=(t.value-a*p)*l;let m=e+(c+p)*l;return f-i>0==m>f&&(m=f,t.value=(m-f)/s),m}function iA(i,e,t,n,r=1/0,s,a){n=Math.max(1e-4,n);const o=2/n,l=o*s,c=1/(1+l+.48*l*l+.235*l*l*l);let f=e.x,d=e.y,p=e.z,m=i.x-f,v=i.y-d,x=i.z-p;const _=f,g=d,b=p,S=r*n,E=S*S,w=m*m+v*v+x*x;if(w>E){const ee=Math.sqrt(w);m=m/ee*S,v=v/ee*S,x=x/ee*S}f=i.x-m,d=i.y-v,p=i.z-x;const T=(t.x+o*m)*s,C=(t.y+o*v)*s,U=(t.z+o*x)*s;t.x=(t.x-o*T)*c,t.y=(t.y-o*C)*c,t.z=(t.z-o*U)*c,a.x=f+(m+T)*c,a.y=d+(v+C)*c,a.z=p+(x+U)*c;const D=_-i.x,R=g-i.y,I=b-i.z,z=a.x-_,O=a.y-g,V=a.z-b;return D*z+R*O+I*V>0&&(a.x=_,a.y=g,a.z=b,t.x=(a.x-_)/s,t.y=(a.y-g)/s,t.z=(a.z-b)/s),a}function R_(i,e){e.set(0,0),i.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=i.length,e.y/=i.length}function D_(i,e){return so(i)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}let aW=class{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e)}}};var U_;const oW="3.1.0",Kp=1/8,lW=/Mac/.test((U_=globalThis?.navigator)===null||U_===void 0?void 0:U_.platform);let Et,rA,Jp,O_,Ji,Lt,Zt,qc,Wh,bs,Ss,fl,sA,aA,vr,Yc,Zc,oA,L_,lA,N_,I_,Qp,di=class Lx extends aW{static install(e){Et=e.THREE,rA=Object.freeze(new Et.Vector3(0,0,0)),Jp=Object.freeze(new Et.Vector3(0,1,0)),O_=Object.freeze(new Et.Vector3(0,0,1)),Ji=new Et.Vector2,Lt=new Et.Vector3,Zt=new Et.Vector3,qc=new Et.Vector3,Wh=new Et.Vector3,bs=new Et.Vector3,Ss=new Et.Vector3,fl=new Et.Vector3,sA=new Et.Vector3,aA=new Et.Vector3,vr=new Et.Spherical,Yc=new Et.Spherical,Zc=new Et.Box3,oA=new Et.Box3,L_=new Et.Sphere,lA=new Et.Quaternion,N_=new Et.Quaternion,I_=new Et.Matrix4,Qp=new Et.Raycaster}static get ACTION(){return Ae}set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=Ae.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=jc.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new Et.Vector3,this._focalOffsetVelocity=new Et.Vector3,this._zoomVelocity={value:0},this._truckInternal=(g,b,S,E)=>{let w,T;if(hl(this._camera)){const C=Lt.copy(this._camera.position).sub(this._target),U=this._camera.getEffectiveFOV()*Gh,D=C.length()*Math.tan(U*.5);w=this.truckSpeed*g*D/this._elementRect.height,T=this.truckSpeed*b*D/this._elementRect.height}else if(so(this._camera)){const C=this._camera;w=this.truckSpeed*g*(C.right-C.left)/C.zoom/this._elementRect.width,T=this.truckSpeed*b*(C.top-C.bottom)/C.zoom/this._elementRect.height}else return;E?(S?this.setFocalOffset(this._focalOffsetEnd.x+w,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(w,0,!0),this.forward(-T,!0)):S?this.setFocalOffset(this._focalOffsetEnd.x+w,this._focalOffsetEnd.y+T,this._focalOffsetEnd.z,!0):this.truck(w,T,!0)},this._rotateInternal=(g,b)=>{const S=io*this.azimuthRotateSpeed*g/this._elementRect.height,E=io*this.polarRotateSpeed*b/this._elementRect.height;this.rotate(S,E,!0)},this._dollyInternal=(g,b,S)=>{const E=Math.pow(.95,-g*this.dollySpeed),w=this._sphericalEnd.radius,T=this._sphericalEnd.radius*E,C=ns(T,this.minDistance,this.maxDistance),U=C-T;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(T,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(U,!0),this._dollyToNoClamp(C,!0)):this._dollyToNoClamp(C,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?T:C)-w,this._dollyControlCoord.set(b,S)),this._lastDollyDirection=Math.sign(-g)},this._zoomInternal=(g,b,S)=>{const E=Math.pow(.95,g*this.dollySpeed),w=this._zoom,T=this._zoom*E;this.zoomTo(T,!0),this.dollyToCursor&&(this._changedZoom+=T-w,this._dollyControlCoord.set(b,S))},typeof Et>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new Et.Quaternion().setFromUnitVectors(this._camera.up,Jp),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=Ae.NONE,this._target=new Et.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new Et.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new Et.Spherical().setFromVector3(Lt.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new Et.Vector3,new Et.Vector3,new Et.Vector3,new Et.Vector3],this._updateNearPlaneCorners(),this._boundary=new Et.Box3(new Et.Vector3(-1/0,-1/0,-1/0),new Et.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new Et.Vector2,this.mouseButtons={left:Ae.ROTATE,middle:Ae.DOLLY,right:Ae.TRUCK,wheel:hl(this._camera)?Ae.DOLLY:so(this._camera)?Ae.ZOOM:Ae.NONE},this.touches={one:Ae.TOUCH_ROTATE,two:hl(this._camera)?Ae.TOUCH_DOLLY_TRUCK:so(this._camera)?Ae.TOUCH_ZOOM_TRUCK:Ae.NONE,three:Ae.TOUCH_TRUCK};const n=new Et.Vector2,r=new Et.Vector2,s=new Et.Vector2,a=g=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const E=this._domElement.getBoundingClientRect(),w=g.clientX/E.width,T=g.clientY/E.height;if(w<this._interactiveArea.left||w>this._interactiveArea.right||T<this._interactiveArea.top||T>this._interactiveArea.bottom)return}const b=g.pointerType!=="mouse"?null:(g.buttons&Sn.LEFT)===Sn.LEFT?Sn.LEFT:(g.buttons&Sn.MIDDLE)===Sn.MIDDLE?Sn.MIDDLE:(g.buttons&Sn.RIGHT)===Sn.RIGHT?Sn.RIGHT:null;if(b!==null){const E=this._findPointerByMouseButton(b);E&&this._disposePointer(E)}if((g.buttons&Sn.LEFT)===Sn.LEFT&&this._lockedPointer)return;const S={pointerId:g.pointerId,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:b};this._activePointers.push(S),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),this._isDragging=!0,p(g)},o=g=>{g.cancelable&&g.preventDefault();const b=g.pointerId,S=this._lockedPointer||this._findPointerById(b);if(S){if(S.clientX=g.clientX,S.clientY=g.clientY,S.deltaX=g.movementX,S.deltaY=g.movementY,this._state=0,g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(g.buttons&Sn.LEFT)===Sn.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(g.buttons&Sn.MIDDLE)===Sn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(g.buttons&Sn.RIGHT)===Sn.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=g=>{const b=this._findPointerById(g.pointerId);if(!(b&&b===this._lockedPointer)){if(b&&this._disposePointer(b),g.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=Ae.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=Ae.NONE;v()}};let c=-1;const f=g=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===Ae.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const T=this._domElement.getBoundingClientRect(),C=g.clientX/T.width,U=g.clientY/T.height;if(C<this._interactiveArea.left||C>this._interactiveArea.right||U<this._interactiveArea.top||U>this._interactiveArea.bottom)return}if(g.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===Ae.ROTATE||this.mouseButtons.wheel===Ae.TRUCK){const T=performance.now();c-T<1e3&&this._getClientRect(this._elementRect),c=T}const b=lW?-1:-3,S=g.deltaMode===1||g.ctrlKey?g.deltaY/b:g.deltaY/(b*10),E=this.dollyToCursor?(g.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(g.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case Ae.ROTATE:{this._rotateInternal(g.deltaX,g.deltaY),this._isUserControllingRotate=!0;break}case Ae.TRUCK:{this._truckInternal(g.deltaX,g.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case Ae.SCREEN_PAN:{this._truckInternal(g.deltaX,g.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case Ae.OFFSET:{this._truckInternal(g.deltaX,g.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case Ae.DOLLY:{this._dollyInternal(-S,E,w),this._isUserControllingDolly=!0;break}case Ae.ZOOM:{this._zoomInternal(-S,E,w),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},d=g=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===Lx.ACTION.NONE){const b=g instanceof PointerEvent?g.pointerId:0,S=this._findPointerById(b);S&&this._disposePointer(S),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}g.preventDefault()}},p=g=>{if(!this._enabled)return;if(R_(this._activePointers,Ji),this._getClientRect(this._elementRect),n.copy(Ji),r.copy(Ji),this._activePointers.length>=2){const S=Ji.x-this._activePointers[1].clientX,E=Ji.y-this._activePointers[1].clientY,w=Math.sqrt(S*S+E*E);s.set(0,w);const T=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,C=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;r.set(T,C)}if(this._state=0,!g)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in g&&g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(g.buttons&Sn.LEFT)===Sn.LEFT&&(this._state=this._state|this.mouseButtons.left),(g.buttons&Sn.MIDDLE)===Sn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&Sn.RIGHT)===Sn.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&Ae.ROTATE)===Ae.ROTATE||(this._state&Ae.TOUCH_ROTATE)===Ae.TOUCH_ROTATE||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE||(this._state&Ae.TOUCH_ZOOM_ROTATE)===Ae.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&Ae.TRUCK)===Ae.TRUCK||(this._state&Ae.SCREEN_PAN)===Ae.SCREEN_PAN||(this._state&Ae.TOUCH_TRUCK)===Ae.TOUCH_TRUCK||(this._state&Ae.TOUCH_SCREEN_PAN)===Ae.TOUCH_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_ZOOM_TRUCK)===Ae.TOUCH_ZOOM_TRUCK||(this._state&Ae.TOUCH_ZOOM_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&Ae.DOLLY)===Ae.DOLLY||(this._state&Ae.TOUCH_DOLLY)===Ae.TOUCH_DOLLY||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&Ae.ZOOM)===Ae.ZOOM||(this._state&Ae.TOUCH_ZOOM)===Ae.TOUCH_ZOOM||(this._state&Ae.TOUCH_ZOOM_TRUCK)===Ae.TOUCH_ZOOM_TRUCK||(this._state&Ae.TOUCH_ZOOM_SCREEN_PAN)===Ae.TOUCH_ZOOM_SCREEN_PAN||(this._state&Ae.TOUCH_ZOOM_OFFSET)===Ae.TOUCH_ZOOM_OFFSET||(this._state&Ae.TOUCH_ZOOM_ROTATE)===Ae.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&Ae.OFFSET)===Ae.OFFSET||(this._state&Ae.TOUCH_OFFSET)===Ae.TOUCH_OFFSET||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET||(this._state&Ae.TOUCH_ZOOM_OFFSET)===Ae.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,R_(this._activePointers,Ji);const b=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,S=b?-b.deltaX:r.x-Ji.x,E=b?-b.deltaY:r.y-Ji.y;if(r.copy(Ji),((this._state&Ae.ROTATE)===Ae.ROTATE||(this._state&Ae.TOUCH_ROTATE)===Ae.TOUCH_ROTATE||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE||(this._state&Ae.TOUCH_ZOOM_ROTATE)===Ae.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(S,E),this._isUserControllingRotate=!0),(this._state&Ae.DOLLY)===Ae.DOLLY||(this._state&Ae.ZOOM)===Ae.ZOOM){const w=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,T=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,C=this.dollyDragInverted?-1:1;(this._state&Ae.DOLLY)===Ae.DOLLY?(this._dollyInternal(C*E*Kp,w,T),this._isUserControllingDolly=!0):(this._zoomInternal(C*E*Kp,w,T),this._isUserControllingZoom=!0)}if((this._state&Ae.TOUCH_DOLLY)===Ae.TOUCH_DOLLY||(this._state&Ae.TOUCH_ZOOM)===Ae.TOUCH_ZOOM||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_ZOOM_TRUCK)===Ae.TOUCH_ZOOM_TRUCK||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_ZOOM_SCREEN_PAN)===Ae.TOUCH_ZOOM_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET||(this._state&Ae.TOUCH_ZOOM_OFFSET)===Ae.TOUCH_ZOOM_OFFSET||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE||(this._state&Ae.TOUCH_ZOOM_ROTATE)===Ae.TOUCH_ZOOM_ROTATE){const w=Ji.x-this._activePointers[1].clientX,T=Ji.y-this._activePointers[1].clientY,C=Math.sqrt(w*w+T*T),U=s.y-C;s.set(0,C);const D=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,R=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&Ae.TOUCH_DOLLY)===Ae.TOUCH_DOLLY||(this._state&Ae.TOUCH_DOLLY_ROTATE)===Ae.TOUCH_DOLLY_ROTATE||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET?(this._dollyInternal(U*Kp,D,R),this._isUserControllingDolly=!0):(this._zoomInternal(U*Kp,D,R),this._isUserControllingZoom=!0)}((this._state&Ae.TRUCK)===Ae.TRUCK||(this._state&Ae.TOUCH_TRUCK)===Ae.TOUCH_TRUCK||(this._state&Ae.TOUCH_DOLLY_TRUCK)===Ae.TOUCH_DOLLY_TRUCK||(this._state&Ae.TOUCH_ZOOM_TRUCK)===Ae.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(S,E,!1,!1),this._isUserControllingTruck=!0),((this._state&Ae.SCREEN_PAN)===Ae.SCREEN_PAN||(this._state&Ae.TOUCH_SCREEN_PAN)===Ae.TOUCH_SCREEN_PAN||(this._state&Ae.TOUCH_DOLLY_SCREEN_PAN)===Ae.TOUCH_DOLLY_SCREEN_PAN||(this._state&Ae.TOUCH_ZOOM_SCREEN_PAN)===Ae.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(S,E,!1,!0),this._isUserControllingTruck=!0),((this._state&Ae.OFFSET)===Ae.OFFSET||(this._state&Ae.TOUCH_OFFSET)===Ae.TOUCH_OFFSET||(this._state&Ae.TOUCH_DOLLY_OFFSET)===Ae.TOUCH_DOLLY_OFFSET||(this._state&Ae.TOUCH_ZOOM_OFFSET)===Ae.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(S,E,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},v=()=>{R_(this._activePointers,Ji),r.copy(Ji),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",x),this._domElement.ownerDocument.addEventListener("pointerlockerror",_),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),p())},this.unlockPointer=()=>{var g,b,S;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(g=this._domElement)===null||g===void 0||g.ownerDocument.exitPointerLock(),(b=this._domElement)===null||b===void 0||b.ownerDocument.removeEventListener("pointerlockchange",x),(S=this._domElement)===null||S===void 0||S.ownerDocument.removeEventListener("pointerlockerror",_),this.cancel()};const x=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},_=()=>{this.unlockPointer()};this._addAllEventListeners=g=>{this._domElement=g,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",a),this._domElement.addEventListener("pointercancel",l),this._domElement.addEventListener("wheel",f,{passive:!1}),this._domElement.addEventListener("contextmenu",d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",a),this._domElement.removeEventListener("pointercancel",l),this._domElement.removeEventListener("wheel",f,{passive:!1}),this._domElement.removeEventListener("contextmenu",d),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.removeEventListener("pointerlockchange",x),this._domElement.ownerDocument.removeEventListener("pointerlockerror",_))},this.cancel=()=>{this._state!==Ae.NONE&&(this._state=Ae.NONE,this._activePointers.length=0,v())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=ns(e.width,0,1),this._interactiveArea.height=ns(e.height,0,1),this._interactiveArea.x=ns(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=ns(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;const r=ns(e,this.minAzimuthAngle,this.maxAzimuthAngle),s=ns(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=s,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const a=!n||$t(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&$t(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(a)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=jc.NONE,this._changedDolly=0,this._dollyToNoClamp(ns(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const a=this._collisionTest(),o=$t(a,this._spherical.radius);if(!(n>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,a)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const s=!t||$t(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(s)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Wh).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const n=!t||$t(this._target.x,this._targetEnd.x,this.restThreshold)&&$t(this._target.y,this._targetEnd.y,this.restThreshold)&&$t(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=ns(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const n=!t||$t(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),bs.setFromMatrixColumn(this._camera.matrix,0),Ss.setFromMatrixColumn(this._camera.matrix,1),bs.multiplyScalar(e),Ss.multiplyScalar(-t);const r=Lt.copy(bs).add(Ss),s=Zt.copy(this._targetEnd).add(r);return this.moveTo(s.x,s.y,s.z,n)}forward(e,t=!1){Lt.setFromMatrixColumn(this._camera.matrix,0),Lt.crossVectors(this._camera.up,Lt),Lt.multiplyScalar(e);const n=Zt.copy(this._targetEnd).add(Lt);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return Lt.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+Lt.x,this._targetEnd.y+Lt.y,this._targetEnd.z+Lt.z,t)}moveTo(e,t,n,r=!1){this._isUserControllingTruck=!1;const s=Lt.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,s,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const a=!r||$t(this._target.x,this._targetEnd.x,this.restThreshold)&&$t(this._target.y,this._targetEnd.y,this.restThreshold)&&$t(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}lookInDirectionOf(e,t,n,r=!1){const o=Lt.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(o.x,o.y,o.z,r)}fitToBox(e,t,{cover:n=!1,paddingLeft:r=0,paddingRight:s=0,paddingBottom:a=0,paddingTop:o=0}={}){const l=[],c=e.isBox3?Zc.copy(e):Zc.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const f=nA(this._sphericalEnd.theta,tA),d=nA(this._sphericalEnd.phi,tA);l.push(this.rotateTo(f,d,t));const p=Lt.setFromSpherical(this._sphericalEnd).normalize(),m=lA.setFromUnitVectors(p,O_),v=$t(Math.abs(p.y),1);v&&m.multiply(N_.setFromAxisAngle(Jp,f)),m.multiply(this._yAxisUpSpaceInverse);const x=oA.makeEmpty();Zt.copy(c.min).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.min).setX(c.max.x).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.min).setY(c.max.y).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.max).setZ(c.min.z).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.min).setZ(c.max.z).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.max).setY(c.min.y).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.max).setX(c.min.x).applyQuaternion(m),x.expandByPoint(Zt),Zt.copy(c.max).applyQuaternion(m),x.expandByPoint(Zt),x.min.x-=r,x.min.y-=a,x.max.x+=s,x.max.y+=o,m.setFromUnitVectors(O_,p),v&&m.premultiply(N_.invert()),m.premultiply(this._yAxisUpSpace);const _=x.getSize(Lt),g=x.getCenter(Zt).applyQuaternion(m);if(hl(this._camera)){const b=this.getDistanceToFitBox(_.x,_.y,_.z,n);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.dollyTo(b,t)),l.push(this.setFocalOffset(0,0,0,t))}else if(so(this._camera)){const b=this._camera,S=b.right-b.left,E=b.top-b.bottom,w=n?Math.max(S/_.x,E/_.y):Math.min(S/_.x,E/_.y);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.zoomTo(w,t)),l.push(this.setFocalOffset(0,0,0,t))}return Promise.all(l)}fitToSphere(e,t){const n=[],s="isObject3D"in e?Lx.createBoundingSphere(e,L_):L_.copy(e);if(n.push(this.moveTo(s.center.x,s.center.y,s.center.z,t)),hl(this._camera)){const a=this.getDistanceToFitSphere(s.radius);n.push(this.dollyTo(a,t))}else if(so(this._camera)){const a=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,l=2*s.radius,c=Math.min(a/l,o/l);n.push(this.zoomTo(c,t))}return n.push(this.setFocalOffset(0,0,0,t)),Promise.all(n)}setLookAt(e,t,n,r,s,a,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=jc.NONE,this._changedDolly=0;const l=Zt.set(r,s,a),c=Lt.set(e,t,n);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const f=!o||$t(this._target.x,this._targetEnd.x,this.restThreshold)&&$t(this._target.y,this._targetEnd.y,this.restThreshold)&&$t(this._target.z,this._targetEnd.z,this.restThreshold)&&$t(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&$t(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&$t(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(f)}lerp(e,t,n,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=jc.NONE,this._changedDolly=0;const s=Lt.set(...e.target);if("spherical"in e)vr.set(...e.spherical);else{const d=Zt.set(...e.position);vr.setFromVector3(d.sub(s).applyQuaternion(this._yAxisUpSpace))}const a=qc.set(...t.target);if("spherical"in t)Yc.set(...t.spherical);else{const d=Zt.set(...t.position);Yc.setFromVector3(d.sub(a).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(s.lerp(a,n));const o=Yc.theta-vr.theta,l=Yc.phi-vr.phi,c=Yc.radius-vr.radius;this._sphericalEnd.set(vr.radius+c*n,vr.phi+l*n,vr.theta+o*n),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const f=!r||$t(this._target.x,this._targetEnd.x,this.restThreshold)&&$t(this._target.y,this._targetEnd.y,this.restThreshold)&&$t(this._target.z,this._targetEnd.z,this.restThreshold)&&$t(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&$t(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&$t(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(f)}lerpLookAt(e,t,n,r,s,a,o,l,c,f,d,p,m,v=!1){return this.lerp({position:[e,t,n],target:[r,s,a]},{position:[o,l,c],target:[f,d,p]},m,v)}setPosition(e,t,n,r=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n,r=!1){const s=this.getPosition(Lt),a=this.setLookAt(s.x,s.y,s.z,e,t,n,r);return this._sphericalEnd.phi=ns(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),a}setFocalOffset(e,t,n,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const s=!r||$t(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&$t(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&$t(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),bs.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Ss.setFromMatrixColumn(this._camera.matrixWorldInverse,1),fl.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=Lt.set(e,t,n),s=r.distanceTo(this._camera.position),a=r.sub(this._camera.position);bs.multiplyScalar(a.x),Ss.multiplyScalar(a.y),fl.multiplyScalar(a.z),Lt.copy(bs).add(Ss).add(fl),Lt.z=Lt.z+s,this.dollyTo(s,!1),this.setFocalOffset(-Lt.x,Lt.y,-Lt.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new Et.Vector4,typeof e=="number"?this._viewport.set(e,t,n,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,r=!1){if(D_(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const s=e/t,a=this._camera.getEffectiveFOV()*Gh,o=this._camera.aspect;return((r?s>o:s<o)?t:e/o)*.5/Math.tan(a*.5)+n*.5}getDistanceToFitSphere(e){if(D_(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*Gh,n=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,r=1<this._camera.aspect?t:n;return e/Math.sin(r*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new Et.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new Et.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new Et.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new Et.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%io+io)%io,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=io),this._spherical.theta+=io*Math.round((this._sphericalEnd.theta-this._spherical.theta)/io),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!$t(this._camera.up.x,this._cameraUp0.x)||!$t(this._camera.up.y,this._cameraUp0.y)||!$t(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const n=this.getPosition(Lt);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,Jp),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=Lt.subVectors(this._target,this._camera.position).normalize(),t=Zt.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const n=this.getPosition(Lt);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,s=sA.subVectors(this._targetEnd,this._target),a=aA.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(dn(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=Zp(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,d,1/0,e),this._needsUpdate=!0}if(dn(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=Zp(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,d,1/0,e),this._needsUpdate=!0}if(dn(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const d=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=Zp(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,d,this.maxSpeed,e),this._needsUpdate=!0}if(dn(s.x)&&dn(s.y)&&dn(s.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const d=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;iA(this._target,this._targetEnd,this._targetVelocity,d,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(dn(a.x)&&dn(a.y)&&dn(a.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const d=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;iA(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,d,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(dn(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const d=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=Zp(this._zoom,this._zoomEnd,this._zoomVelocity,d,1/0,e)}if(this.dollyToCursor){if(hl(this._camera)&&this._changedDolly!==0){const d=this._spherical.radius-this._lastDistance,p=this._camera,m=this._getCameraDirection(Wh),v=Lt.copy(m).cross(p.up).normalize();v.lengthSq()===0&&(v.x=1);const x=Zt.crossVectors(v,m),_=this._sphericalEnd.radius*Math.tan(p.getEffectiveFOV()*Gh*.5),b=(this._sphericalEnd.radius-d-this._sphericalEnd.radius)/this._sphericalEnd.radius,S=qc.copy(this._targetEnd).add(v.multiplyScalar(this._dollyControlCoord.x*_*p.aspect)).add(x.multiplyScalar(this._dollyControlCoord.y*_)),E=Lt.copy(this._targetEnd).lerp(S,b),w=this._lastDollyDirection===jc.IN&&this._spherical.radius<=this.minDistance,T=this._lastDollyDirection===jc.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(w||T)){this._sphericalEnd.radius-=d,this._spherical.radius-=d;const U=Zt.copy(m).multiplyScalar(-d);E.add(U)}this._boundary.clampPoint(E,E);const C=Zt.subVectors(E,this._targetEnd);this._targetEnd.copy(E),this._target.add(C),this._changedDolly-=d,dn(this._changedDolly)&&(this._changedDolly=0)}else if(so(this._camera)&&this._changedZoom!==0){const d=this._zoom-this._lastZoom,p=this._camera,m=Lt.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(p.near+p.far)/(p.near-p.far)).unproject(p),v=Zt.set(0,0,-1).applyQuaternion(p.quaternion),x=qc.copy(m).add(v.multiplyScalar(-m.dot(p.up))),g=-(this._zoom-d-this._zoom)/this._zoom,b=this._getCameraDirection(Wh),S=this._targetEnd.dot(b),E=Lt.copy(this._targetEnd).lerp(x,g),w=E.dot(b),T=b.multiplyScalar(w-S);E.sub(T),this._boundary.clampPoint(E,E);const C=Zt.subVectors(E,this._targetEnd);this._targetEnd.copy(E),this._target.add(C),this._changedZoom-=d,dn(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const l=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,l),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!dn(this._focalOffset.x)||!dn(this._focalOffset.y)||!dn(this._focalOffset.z))&&(bs.setFromMatrixColumn(this._camera.matrix,0),Ss.setFromMatrixColumn(this._camera.matrix,1),fl.setFromMatrixColumn(this._camera.matrix,2),bs.multiplyScalar(this._focalOffset.x),Ss.multiplyScalar(-this._focalOffset.y),fl.multiplyScalar(this._focalOffset.z),Lt.copy(bs).add(Ss).add(fl),this._camera.position.add(Lt),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),Lt.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const f=this._needsUpdate;return f&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):f?(this.dispatchEvent({type:"update"}),dn(t,this.restThreshold)&&dn(n,this.restThreshold)&&dn(r,this.restThreshold)&&dn(s.x,this.restThreshold)&&dn(s.y,this.restThreshold)&&dn(s.z,this.restThreshold)&&dn(a.x,this.restThreshold)&&dn(a.y,this.restThreshold)&&dn(a.z,this.restThreshold)&&dn(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!f&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=f,this._needsUpdate=!1,f}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:Hh(this.maxDistance),minZoom:this.minZoom,maxZoom:Hh(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Hh(this.maxPolarAngle),minAzimuthAngle:Hh(this.minAzimuthAngle),maxAzimuthAngle:Hh(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:Lt.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const n=JSON.parse(e);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=Vh(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=Vh(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=Vh(n.maxPolarAngle),this.minAzimuthAngle=Vh(n.minAzimuthAngle),this.maxAzimuthAngle=Vh(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],t),vr.setFromVector3(Lt.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(vr.theta,vr.phi,t),this.dollyTo(vr.radius,t),this.zoomTo(n.zoom,t),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",oW),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){const r=t.lengthSq();if(r===0)return e;const s=Zt.copy(t).add(e),o=this._boundary.clampPoint(s,qc).sub(s),l=o.lengthSq();if(l===0)return e.add(t);if(l===r)return e;if(n===0)return e.add(t).add(o);{const c=1+n*l/t.dot(o);return e.add(Zt.copy(t).multiplyScalar(c)).add(o.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(hl(this._camera)){const e=this._camera,t=e.near,n=e.getEffectiveFOV()*Gh,r=Math.tan(n*.5)*t,s=r*e.aspect;this._nearPlaneCorners[0].set(-s,-r,0),this._nearPlaneCorners[1].set(s,-r,0),this._nearPlaneCorners[2].set(s,r,0),this._nearPlaneCorners[3].set(-s,r,0)}else if(so(this._camera)){const e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,s=e.top*t,a=e.bottom*t;this._nearPlaneCorners[0].set(n,s,0),this._nearPlaneCorners[1].set(r,s,0),this._nearPlaneCorners[2].set(r,a,0),this._nearPlaneCorners[3].set(n,a,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||D_(this._camera,"_collisionTest"))return e;const n=this._getTargetDirection(Wh);I_.lookAt(rA,n,this._camera.up);for(let r=0;r<4;r++){const s=Zt.copy(this._nearPlaneCorners[r]);s.applyMatrix4(I_);const a=qc.addVectors(this._target,s);Qp.set(a,n),Qp.far=this._spherical.radius+1;const o=Qp.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const n=()=>{this.removeEventListener("rest",n),t()};this.addEventListener("rest",n)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new Et.Sphere){const n=t,r=n.center;Zc.makeEmpty(),e.traverseVisible(a=>{a.isMesh&&Zc.expandByObject(a)}),Zc.getCenter(r);let s=0;return e.traverseVisible(a=>{if(!a.isMesh)return;const o=a;if(!o.geometry)return;const l=o.geometry.clone();l.applyMatrix4(o.matrixWorld);const f=l.attributes.position;for(let d=0,p=f.count;d<p;d++)Lt.fromBufferAttribute(f,d),s=Math.max(s,r.distanceToSquared(Lt))}),n.radius=Math.sqrt(s),n}};const Es=1e-5;function cW(i,e,t){const n=new ho,r=t-Es;return n.absarc(Es,Es,Es,-Math.PI/2,-Math.PI,!0),n.absarc(Es,e-r*2,Es,Math.PI,Math.PI/2,!0),n.absarc(i-r*2,e-r*2,Es,Math.PI/2,0,!0),n.absarc(i-r*2,Es,Es,0,-Math.PI/2,!0),n}const cA=Z.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:s=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:l=.4,children:c,...f},d){return Z.createElement("mesh",Il({ref:d},f),Z.createElement(uW,{args:[e,t,n],radius:r,steps:s,smoothness:a,bevelSegments:o,creaseAngle:l}),c)}),uW=Z.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:s=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:l=.4,...c},f){const d=Z.useMemo(()=>cW(e,t,r),[e,t,r]),p=Z.useMemo(()=>({depth:n-r*2,bevelEnabled:!0,bevelSegments:o*2,steps:s,bevelSize:r-Es,bevelThickness:r,curveSegments:a}),[n,r,a,o,s]),m=Z.useRef(null);return Z.useLayoutEffect(()=>{m.current&&(m.current.center(),c9(m.current,l))},[d,p,l]),Z.useImperativeHandle(f,()=>m.current),Z.createElement("extrudeGeometry",Il({ref:m,args:[d,p]},c))});var Xh={exports:{}},uA;function hW(){if(uA)return Xh.exports;uA=1;var i={ellipse:"…",chars:[" ","-"],max:140,truncate:!0};function e(n,r,s,a){if(n<=r)return n;if(r<2)return n.slice(0,r-s.length)+s;for(var o=r-s.length,l=Math.floor(o/2),c=l,f=n.length-l,d=0;d<l;d++){var p=n.charAt(d),m=n.length-d,v=n.charAt(m);a.indexOf(p)!==-1&&(c=d),a.indexOf(v)!==-1&&(f=m)}return n.slice(0,c)+s+n.slice(f)}function t(n,r,s,a,o){if(n.length<=r)return n;for(var l=r-s.length,c=l,f=!1,d=0;d<=l;d++){var p=n.charAt(d);a.indexOf(p)!==-1&&(c=d,f=!0)}return!o&&!f?"":n.slice(0,c)+s}return Xh.exports=function(n,r,s){if(typeof n!="string"||n.length===0||r===0)return"";s=s||{};for(var a in i)(s[a]===null||typeof s[a]>"u")&&(s[a]=i[a]);return s.max=r||s.max,s.truncate=="middle"?e(n,s.max,s.ellipse,s.chars):t(n,s.max,s.ellipse,s.chars,s.truncate)},Xh.exports.ellipsizeMiddle=e,Xh.exports.ellipsize=t,Xh.exports}var fW=hW();const dW=vo(fW);/*!
4145
4145
  * hold-event
4146
4146
  * https://github.com/yomotsu/hold-event
4147
4147
  * (c) 2020 @yomotsu
4148
4148
  * Released under the MIT License.
4149
- */var gf;(function(i){i.HOLD_START="holdStart",i.HOLD_END="holdEnd",i.HOLDING="holding"})(gf||(gf={}));class dW{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e)}}}class pW extends dW{constructor(e){super(),this._enabled=!0,this._holding=!1,this._intervalId=-1,this._deltaTime=0,this._elapsedTime=0,this._lastTime=0,this._holdStart=t=>{if(!this._enabled||this._holding)return;this._deltaTime=0,this._elapsedTime=0,this._lastTime=performance.now(),this.dispatchEvent({type:gf.HOLD_START,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),this._holding=!0;const n=()=>{this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n);const r=performance.now();this._deltaTime=r-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:gf.HOLDING,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t})};this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n)},this._holdEnd=t=>{if(!this._enabled||!this._holding)return;const n=performance.now();this._deltaTime=n-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:gf.HOLD_END,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),window.clearTimeout(this._intervalId),window.cancelAnimationFrame(this._intervalId),this._holding=!1},this.holdIntervalDelay=e}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._enabled||this._holdEnd())}get holding(){return this._holding}}class $p extends pW{constructor(e,t){if(typeof e!="string"){console.error("KeyboardKeyHold: the first argument has to be a KeyboardEvent.code string.");return}super(t),this._holdStart=this._holdStart.bind(this),this._holdEnd=this._holdEnd.bind(this);const n=s=>{mW(s)||s.code===e&&this._holdStart(s)},r=s=>{s.code===e&&this._holdEnd(s)};document.addEventListener("keydown",n),document.addEventListener("keyup",r),window.addEventListener("blur",this._holdEnd)}}function mW(i){const e=i.target;return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.isContentEditable}var P_={exports:{}};/*!
4149
+ */var gf;(function(i){i.HOLD_START="holdStart",i.HOLD_END="holdEnd",i.HOLDING="holding"})(gf||(gf={}));class pW{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e)}}}class mW extends pW{constructor(e){super(),this._enabled=!0,this._holding=!1,this._intervalId=-1,this._deltaTime=0,this._elapsedTime=0,this._lastTime=0,this._holdStart=t=>{if(!this._enabled||this._holding)return;this._deltaTime=0,this._elapsedTime=0,this._lastTime=performance.now(),this.dispatchEvent({type:gf.HOLD_START,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),this._holding=!0;const n=()=>{this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n);const r=performance.now();this._deltaTime=r-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:gf.HOLDING,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t})};this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n)},this._holdEnd=t=>{if(!this._enabled||!this._holding)return;const n=performance.now();this._deltaTime=n-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:gf.HOLD_END,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),window.clearTimeout(this._intervalId),window.cancelAnimationFrame(this._intervalId),this._holding=!1},this.holdIntervalDelay=e}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._enabled||this._holdEnd())}get holding(){return this._holding}}class $p extends mW{constructor(e,t){if(typeof e!="string"){console.error("KeyboardKeyHold: the first argument has to be a KeyboardEvent.code string.");return}super(t),this._holdStart=this._holdStart.bind(this),this._holdEnd=this._holdEnd.bind(this);const n=s=>{gW(s)||s.code===e&&this._holdStart(s)},r=s=>{s.code===e&&this._holdEnd(s)};document.addEventListener("keydown",n),document.addEventListener("keyup",r),window.addEventListener("blur",this._holdEnd)}}function gW(i){const e=i.target;return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.isContentEditable}var P_={exports:{}};/*!
4150
4150
  Copyright (c) 2018 Jed Watson.
4151
4151
  Licensed under the MIT License (MIT), see
4152
4152
  http://jedwatson.github.io/classnames
4153
- */var hA;function gW(){return hA||(hA=1,function(i){(function(){var e={}.hasOwnProperty;function t(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=r(s,n(o)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)e.call(s,o)&&s[o]&&(a=r(a,o));return a}function r(s,a){return a?s?s+" "+a:s+a:s}i.exports?(t.default=t,i.exports=t):window.classNames=t})()}(P_)),P_.exports}gW();(function(){try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(`._canvas_670zp_1 {
4153
+ */var hA;function vW(){return hA||(hA=1,function(i){(function(){var e={}.hasOwnProperty;function t(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=r(s,n(o)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)e.call(s,o)&&s[o]&&(a=r(a,o));return a}function r(s,a){return a?s?s+" "+a:s+a:s}i.exports?(t.default=t,i.exports=t):window.classNames=t})()}(P_)),P_.exports}vW();(function(){try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(`._canvas_670zp_1 {
4154
4154
  position: absolute;
4155
4155
  top: 0;
4156
4156
  left: 0;
@@ -4230,13 +4230,13 @@ vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
4230
4230
  top: 50%;
4231
4231
  left: 50%;
4232
4232
  transform: translate(-50%, -50%);
4233
- }`)),document.head.appendChild(i)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();function vW(i){return new Promise((e,t)=>{let n;function r(){n?e(n):(n=i.step(),r())}r()})}function Ou(i){const e=[],t=[];return i.forEachNode((n,r)=>{e.push({...r,id:n,radius:r.size||1})}),i.forEachEdge((n,r)=>{t.push({...r,id:n})}),{nodes:e,edges:t}}function yW({graph:i,radius:e=40,drags:t,getNodePosition:n,concentricSpacing:r=100}){const{nodes:s,edges:a}=Ou(i),o={},l=v=>{const x=2*Math.PI*(e+v*r);return Math.floor(x/40)},c=new Map,f=[];for(const v of s){const _=i.getNodeAttribute(v.id,"data")?.level;typeof _=="number"&&_>=0?(c.has(_)||c.set(_,[]),c.get(_).push(v.id)):f.push({id:v.id,metric:i.degree(v.id)})}f.sort((v,x)=>x.metric-v.metric);for(const[v,x]of c.entries()){const _=x.length,g=e+v*r;for(let b=0;b<_;b++){const S=2*Math.PI*b/_;o[x[b]]={x:g*Math.cos(S),y:g*Math.sin(S)}}}const d=new Set(c.keys());let p=0,m=0;for(;m<f.length;){for(;d.has(p);)p++;const v=l(p),x=e+p*r;for(let _=0;_<v&&m<f.length;_++){const g=2*Math.PI*_/v;o[f[m].id]={x:x*Math.cos(g),y:x*Math.sin(g)},m++}p++}return{step(){return!0},getNodePosition(v){if(n){const x=n(v,{graph:i,drags:t,nodes:s,edges:a});if(x)return x}return t?.[v]?.position?t[v].position:o[v]}}}function D3(i,e=[]){const t=e.length;for(const n of i){const r=e.indexOf(n);if(r>-1){const s=[...e.slice(r),n].map(a=>a.data.id);throw new Error(`Invalid Graph: Circular node path detected: ${s.join(" -> ")}.`)}t>n.depth&&(n.depth=t,D3(n.out,[...e,n]))}}function U3(i,e){let t=!1;const n=i.reduce((a,o)=>({...a,[o.id]:{data:o,out:[],depth:-1,ins:[]}}),{});try{for(const a of e){const o=a.source,l=a.target;if(!n.hasOwnProperty(o))throw new Error(`Missing source Node ${o}`);if(!n.hasOwnProperty(l))throw new Error(`Missing target Node ${l}`);const c=n[o],f=n[l];f.ins.push(c),c.out.push(f)}D3(Object.values(n))}catch{t=!0}const r=Object.keys(n).map(a=>n[a].depth),s=Math.max(...r);return{invalid:t,depths:n,maxDepth:s||1}}const fA=["radialin","radialout"];function _W({nodes:i,edges:e,mode:t="lr",nodeLevelRatio:n=2}){const{depths:r,maxDepth:s,invalid:a}=U3(i,e);if(a)return null;const o=fA.includes(t)?1:5,l=i.length/s*n*o;if(t){const c=(m,v)=>x=>m?(r[x.id].depth-s/2)*l*(v?-1:1):void 0,f=c(["lr","rl"].includes(t),t==="rl"),d=c(["td","bu"].includes(t),t==="td"),p=c(["zin","zout"].includes(t),t==="zout");i.forEach(m=>{m.fx=f(m),m.fy=d(m),m.fz=p(m)})}return fA.includes(t)?Yk(c=>{const f=r[c.id];return(t==="radialin"?s-f.depth:f.depth)*l}).strength(1):null}function xW(){const i=L=>()=>L;let t=L=>L.index,n=[],r=[],s,a,o=[100,100],l=i(1),c=i(-1),f=i(100),d=i(.1),p={},m=.1,v=.001,x=[],_=[0,0],g,b=L=>L.cluster,S="treemap",E=!0,w=.1;function T(L){if(!E)return T;S==="force"&&(g.tick(),O());for(let k=0,H=n.length,W,F=L*w;k<H;++k)W=n[k],W.vx+=(p[b(W)].x-W.x)*F,W.vy+=(p[b(W)].y-W.y)*F}function C(){n&&(S==="treemap"?V():P())}T.initialize=function(L){n=L,C()};function U(L){let k=b(L.source),H=b(L.target);return k<=H?k+"~"+H:H+"~"+k}function D(L){let k=new Map,H={};return L.forEach(function(W){k.has(b(W))||k.set(b(W),{count:0,sumforceNodeSize:0})}),L.forEach(function(W){H=k.get(b(W)),H.count=H.count+1,H.sumforceNodeSize=H.sumforceNodeSize+Math.PI*(l(W)*l(W))*1.3,k.set(b(W),H)}),k}function R(L){let k=new Map,H=[];return L.forEach(function(W){let F=U(W),Y;k.has(F)?Y=k.get(F):Y=0,Y+=1,k.set(F,Y)}),k.forEach(function(W,F){let Y,K;Y=F.split("~")[0],K=F.split("~")[1],Y!==void 0&&K!==void 0&&H.push({source:Y,target:K,count:W})}),H}function I(){let L=[],k=[],H=new Map,W,F,Y,K,j;K=D(n),j=R(r);for(W of K.keys())Y=K.get(W),L.push({id:W,size:Y.count,r:Math.sqrt(Y.sumforceNodeSize/Math.PI)}),H.set(W,F);return j.forEach(function(J){let he=H.get(J.source),re=H.get(J.target);he!==void 0&&re!==void 0&&k.push({source:he,target:re,count:J.count})}),{nodes:L,links:k}}function z(){let L=[],k,H,W;W=D(T.nodes());for(k of W.keys())H=W.get(k),L.push({id:k,size:H.count});return{id:"clustersTree",children:L}}function O(){return p.none={x:0,y:0},x.forEach(function(L){S==="treemap"?p[L.data.id]={x:L.x0+(L.x1-L.x0)/2-_[0],y:L.y0+(L.y1-L.y0)/2-_[1]}:p[L.id]={x:L.x-_[0],y:L.y-_[1]}}),p}function V(){let L=OG().size(T.size());a=l0(z()).sum(k=>k.radius).sort(function(k,H){return H.height-k.height||H.value-k.value}),x=L(a).leaves(),O()}function ee(){let L=0;n.length!==0&&r.forEach(function(k){let H,W;if(n){if(H=k.source,W=k.target,typeof k.source!="object"&&(H=n.find(F=>F.id===k.source)),typeof k.target!="object"&&(W=n.find(F=>F.id===k.target)),H===void 0||W===void 0)throw Error("Error setting links, couldnt find nodes for a link (see it on the console)");k.source=H,k.target=W,k.index=L++}})}function P(){let L;!n||!n.length||(ee(),L=I(),s.size>0&&L.nodes.forEach(k=>{k.fx=s.get(k.id)?.position?.x,k.fy=s.get(k.id)?.position?.y}),g=$C(L.nodes).force("x",cx(o[0]/2).strength(.1)).force("y",ux(o[1]/2).strength(.1)).force("collide",jC(k=>k.r).iterations(4)).force("charge",eR().strength(c)).force("links",qC(L.nodes.length?L.links:[]).distance(f).strength(d)),x=g.nodes(),O())}return T.template=function(L){return arguments.length?(S=L,C(),T):S},T.groupBy=function(L){return arguments.length?typeof L=="string"?(b=function(k){return k[L]},T):(b=L,T):b},T.enableGrouping=function(L){return arguments.length?(E=L,T):E},T.strength=function(L){return arguments.length?(w=L,T):w},T.getLinkStrength=function(L){return E?b(L.source)===b(L.target)?typeof m=="function"?m(L):m:typeof v=="function"?v(L):v:typeof m=="function"?m(L):m},T.id=function(L){return arguments.length?(t=L,T):t},T.size=function(L){return arguments.length?(o=L,T):o},T.linkStrengthInterCluster=function(L){return arguments.length?(v=L,T):v},T.linkStrengthIntraCluster=function(L){return arguments.length?(m=L,T):m},T.nodes=function(L){return arguments.length?(n=L,T):n},T.links=function(L){return arguments.length?(L===null?r=[]:r=L,C(),T):r},T.template=function(L){return arguments.length?(S=L,C(),T):S},T.forceNodeSize=function(L){return arguments.length?(l=typeof L=="function"?L:i(+L),C(),T):l},T.nodeSize=T.forceNodeSize,T.forceCharge=function(L){return arguments.length?(c=typeof L=="function"?L:i(+L),C(),T):c},T.forceLinkDistance=function(L){return arguments.length?(f=typeof L=="function"?L:i(+L),C(),T):f},T.forceLinkStrength=function(L){return arguments.length?(d=typeof L=="function"?L:i(+L),C(),T):d},T.offset=function(L){return arguments.length?(_=typeof L=="function"?L:i(+L),T):_},T.getFocis=O,T.setClusters=function(L){return s=L,T},T}function ro({graph:i,nodeLevelRatio:e=2,mode:t=null,dimensions:n=2,nodeStrength:r=-250,linkDistance:s=50,clusterStrength:a=.5,linkStrengthInterCluster:o=.01,linkStrengthIntraCluster:l=.5,forceLinkDistance:c=100,forceLinkStrength:f=.1,clusterType:d="force",forceCharge:p=-700,getNodePosition:m,drags:v,clusters:x,clusterAttribute:_,forceLayout:g}){const{nodes:b,edges:S}=Ou(i),w=n===2&&S.length>25?r*2:r;let T,C;g==="forceDirected2d"?(T=cx(),C=ux()):(T=cx(600).strength(.05),C=ux(600).strength(.05));const U=$C().force("center",I5(0,0)).force("link",qC()).force("charge",eR().strength(w)).force("x",T).force("y",C).force("z",Zk()).force("collide",jC(z=>z.radius+10)).force("dagRadial",_W({nodes:b,edges:S,mode:t,nodeLevelRatio:e})).stop();let D;if(_){let z=p;if(b?.length){const O=Math.ceil(b.length/200);z=p*O}D=xW().setClusters(x).strength(a).template(d).groupBy(O=>O.data[_]).links(S).size([100,100]).linkStrengthInterCluster(o).linkStrengthIntraCluster(l).forceLinkDistance(c).forceLinkStrength(f).forceCharge(z).forceNodeSize(O=>O.radius)}let R=U.numDimensions(n).nodes(b);if(D&&(R=R.force("group",D)),s){let z=R.force("link");z&&(z.id(O=>O.id).links(S).distance(s),D&&(z=z.strength(D?.getLinkStrength??.1)))}const I=new Map(b.map(z=>[z.id,z]));return{step(){for(;U.alpha()>.01;)U.tick();return!0},getNodePosition(z){if(m){const O=m(z,{graph:i,drags:v,nodes:b,edges:S});if(O)return O}return v?.[z]?.position?v?.[z]?.position:I.get(z)}}}function bW({graph:i,radius:e,drags:t,getNodePosition:n}){const r=IG(i,{scale:e}),{nodes:s,edges:a}=Ou(i);return{step(){return!0},getNodePosition(o){if(n){const l=n(o,{graph:i,drags:t,nodes:s,edges:a});if(l)return l}return t?.[o]?.position?t?.[o]?.position:r?.[o]}}}const SW={td:{x:"x",y:"y",factor:-1},lr:{x:"y",y:"x",factor:1}};function dA({graph:i,drags:e,mode:t="td",nodeSeparation:n=1,nodeSize:r=[50,50],getNodePosition:s}){const{nodes:a,edges:o}=Ou(i),{depths:l}=U3(a,o),c=Object.keys(l).map(x=>l[x]),f=xG().id(x=>x.data.id).parentId(x=>x.ins?.[0]?.data?.id)(c),p=AG().separation(()=>n).nodeSize(r)(l0(f)).descendants(),m=SW[t],v=new Map(a.map(x=>{const{x:_,y:g}=p.find(b=>b.data.id===x.id);return[x.id,{...x,[m.x]:_*m.factor,[m.y]:g*m.factor,z:0}]}));return{step(){return!0},getNodePosition(x){if(s){const _=s(x,{graph:i,drags:e,nodes:a,edges:o});if(_)return _}return e?.[x]?.position?e?.[x]?.position:v.get(x)}}}function EW({graph:i,margin:e,drags:t,getNodePosition:n,ratio:r,gridSize:s,maxIterations:a}){const{nodes:o,edges:l}=Ou(i),c=GG(i,{maxIterations:a,inputReducer:(f,d)=>({...d,x:d.x||0,y:d.y||0}),settings:{ratio:r,margin:e,gridSize:s}});return{step(){return!0},getNodePosition(f){if(n){const d=n(f,{graph:i,drags:t,nodes:o,edges:l});if(d)return d}return t?.[f]?.position?t?.[f]?.position:c?.[f]}}}function MW({graph:i,drags:e,iterations:t,...n}){KG.assign(i);const r=qG(i,{iterations:t,settings:n});return{step(){return!0},getNodePosition(s){return e?.[s]?.position||r?.[s]}}}function wW({graph:i,drags:e,getNodePosition:t}){const{nodes:n,edges:r}=Ou(i);return{step(){return!0},getNodePosition(s){return t(s,{graph:i,drags:e,nodes:n,edges:r})}}}const TW=["forceDirected2d","treeTd2d","treeLr2d","radialOut2d","treeTd3d","treeLr3d","radialOut3d","forceDirected3d"];function AW({type:i,...e}){if(TW.includes(i)){const{nodeStrength:t,linkDistance:n,nodeLevelRatio:r}=e;if(i==="forceDirected2d")return ro({...e,dimensions:2,nodeLevelRatio:r||2,nodeStrength:t||-250,linkDistance:n,forceLayout:i});if(i==="treeTd2d")return ro({...e,mode:"td",dimensions:2,nodeLevelRatio:r||5,nodeStrength:t||-250,linkDistance:n||50,forceLayout:i});if(i==="treeLr2d")return ro({...e,mode:"lr",dimensions:2,nodeLevelRatio:r||5,nodeStrength:t||-250,linkDistance:n||50,forceLayout:i});if(i==="radialOut2d")return ro({...e,mode:"radialout",dimensions:2,nodeLevelRatio:r||5,nodeStrength:t||-500,linkDistance:n||100,forceLayout:i});if(i==="treeTd3d")return ro({...e,mode:"td",dimensions:3,nodeLevelRatio:r||2,nodeStrength:t||-500,linkDistance:n||50});if(i==="treeLr3d")return ro({...e,mode:"lr",dimensions:3,nodeLevelRatio:r||2,nodeStrength:t||-500,linkDistance:n||50,forceLayout:i});if(i==="radialOut3d")return ro({...e,mode:"radialout",dimensions:3,nodeLevelRatio:r||2,nodeStrength:t||-500,linkDistance:n||100,forceLayout:i});if(i==="forceDirected3d")return ro({...e,dimensions:3,nodeLevelRatio:r||2,nodeStrength:t||-250,linkDistance:n,forceLayout:i})}else if(i==="circular2d"){const{radius:t}=e;return bW({...e,radius:t||300})}else{if(i==="concentric2d")return yW(e);if(i==="hierarchicalTd")return dA({...e,mode:"td"});if(i==="hierarchicalLr")return dA({...e,mode:"lr"});if(i==="nooverlap"){const{graph:t,maxIterations:n,ratio:r,margin:s,gridSize:a,...o}=e;return EW({graph:t,margin:s||10,maxIterations:n||50,ratio:r||10,gridSize:a||20,...o})}else if(i==="forceatlas2"){const{graph:t,iterations:n,gravity:r,scalingRatio:s,...a}=e;return MW({type:"forceatlas2",graph:t,...a,scalingRatio:s||100,gravity:r||10,iterations:n||50})}else if(i==="custom")return wW({...e})}throw new Error(`Layout ${i} not found.`)}function O3({nodePosition:i,labelType:e,camera:t}){return(n,r)=>{const s=e==="all"||e==="nodes"&&n==="node"||e==="edges"&&n==="edge";if(!s&&t&&i&&t?.position?.z/t?.zoom-i?.z>6e3)return!1;if(s)return!0;if(e==="auto"&&n==="node"){if(r>7)return!0;if(t&&i&&t.position.z/t.zoom-i.z<3e3)return!0}return!1}}function L3(i,e){switch(e){case"above":return i;case"below":return-i;case"inline":case"natural":default:return 0}}const ob=typeof window>"u";function CW({graph:i}){const e=eH(i);return{ranks:e,getSizeForNode:t=>e[t]*80}}function RW({graph:i}){const e=nH.degreeCentrality(i);return{ranks:e,getSizeForNode:t=>e[t]*20}}function DW({graph:i,attribute:e,defaultSize:t}){const n=new Map;return e?i.forEachNode((r,s)=>{const a=s.data?.[e];isNaN(a)&&console.warn(`Attribute ${a} is not a number for node ${s.id}`),n.set(r,a||0)}):console.warn("Attribute sizing configured but no attribute provided"),{getSizeForNode:r=>!e||!n?t:n.get(r)}}const UW={pagerank:CW,centrality:RW,attribute:DW,none:({defaultSize:i})=>({getSizeForNode:e=>i})};function OW({type:i,...e}){const t=UW[i]?.(e);if(!t&&i!=="default")throw new Error(`Unknown sizing strategy: ${i}`);const{graph:n,minSize:r,maxSize:s}=e,a=new Map;let o,l;if(n.forEachNode((c,f)=>{let d;i==="default"?d=f.size||e.defaultSize:d=t.getSizeForNode(c),(o===void 0||d<o)&&(o=d),(l===void 0||d>l)&&(l=d),a.set(c,d)}),i!=="none"){const c=hR().domain([o,l]).rangeRound([r,s]);for(const[f,d]of a)a.set(f,c(d))}return a}function LW(i,e,t){i.clear();const n=new Set;for(const r of e)try{n.has(r.id)||(i.addNode(r.id,r),n.add(r.id))}catch(s){console.error(`[Graph] Error adding node '${r.id}`,s)}for(const r of t)if(!(!n.has(r.source)||!n.has(r.target)))try{i.addEdge(r.source,r.target,r)}catch(s){console.error(`[Graph] Error adding edge '${r.source} -> ${r.target}`,s)}return i}function NW({graph:i,layout:e,sizingType:t,labelType:n,sizingAttribute:r,defaultNodeSize:s,minNodeSize:a,maxNodeSize:o,clusterAttribute:l}){const c=[],f=[],d=new Map,p=OW({graph:i,type:t,attribute:r,minSize:a,maxSize:o,defaultSize:s});i.nodes().length;const m=O3({labelType:n});return i.forEachNode((v,x)=>{const _=e.getNodePosition(v),{data:g,fill:b,icon:S,label:E,size:w,...T}=x,C=p.get(x.id),U=m("node",C),R=(i.inboundNeighbors(x.id)||[]).map(z=>i.getNodeAttributes(z)),I={...x,size:C,labelVisible:U,label:E,icon:S,fill:b,cluster:l?g[l]:void 0,parents:R,data:{...T,...g??{}},position:{..._,x:_.x||0,y:_.y||0,z:_.z||1}};d.set(x.id,I),c.push(I)}),i.forEachEdge((v,x)=>{const _=d.get(x.source),g=d.get(x.target);if(_&&g){const{data:b,id:S,label:E,size:w,...T}=x,C=m("edge",w);f.push({...x,id:S,label:E,labelVisible:C,size:w,data:{...T,id:S,...b||{}}})}}),{nodes:c,edges:f}}const xr={mass:10,tension:1e3,friction:300,precision:.1};function N3(i,e,t){const n=e.getLength(),r=i==="end"?n:n/2,s=i==="end"?t/2:0,a=(r-s)/n,o=e.getPointAt(a),l=e.getTangentAt(a);return[o,l]}function I3(i){return[i+6,2+i/1.5]}const z_=.7;function P3(i,e,t=0){const n=new Q(i.x,i.y||0,i.z||0),r=new Q(e.x,e.y||0,e.z||0),s=new Q().addVectors(n,r).divideScalar(2);return s.setLength(s.length()+t)}function IW(i,e,t=-1){const n=i.clone(),r=e.clone(),s=new Q().subVectors(r,n),a=s.length(),o=s.clone().normalize(),l=new Q().subVectors(r,n).divideScalar(2),c=Math.abs(o.x)%1,f=new Q(-o.y,o.x-c*o.z,c*o.y).normalize(),d=new Q().add(n).add(l).add(f.multiplyScalar(a/4).multiplyScalar(t));return[i,d,e]}function Xf(i,e,t,n,r,s){const a=pA(i,t,e),o=pA(t,i,n);return r?new jg(...IW(a,o,s)):new s1(a,o)}function jf(i){return new Q(i.position.x,i.position.y,i.position.z||0)}function pA(i,e,t){const n=i.distanceTo(e);return i.clone().add(e.clone().sub(i).multiplyScalar(t/n))}function mA(i,e){return{...i,position:{...i.position,x:i.position.x+e.x,y:i.position.y+e.y,z:i.position.z+e.z}}}function PW({edge:i,edges:e,curved:t}){let n=t,r;const s=e.filter(a=>a.target===i.target&&a.source===i.source).map(a=>a.id);if(s.length>1){n=!0;const a=s.indexOf(i.id),o=a===0?1:1+a*.8,l=a%2===0?1:-1,c=z_*o;r=l*c}return i.data?.isAggregated&&e.length>1?{curved:!0,curveOffset:s.indexOf(i.id)===0?z_:-z_}:{curved:n,curveOffset:r}}function zW(i,e,t){const n=e.x-i.x,r=e.y-i.y,s=Math.atan2(r,n),a=t==="above"?n>=0?s+Math.PI/2:s-Math.PI/2:n>=0?s-Math.PI/2:s+Math.PI/2,o=7,l=Math.cos(a)*o,c=Math.sin(a)*o;return{x:l,y:c,z:0}}function qf(i){let e=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let o of i)e=Math.min(e,o.position.x),t=Math.max(t,o.position.x),n=Math.min(n,o.position.y),r=Math.max(r,o.position.y),s=Math.min(s,o.position.z),a=Math.max(a,o.position.z);return{height:r-n,width:t-e,minX:e,maxX:t,minY:n,maxY:r,minZ:s,maxZ:a,x:(t+e)/2,y:(r+n)/2,z:(a+s)/2}}function FW(i,e){return e?i.reduce((t,n)=>{const r=n.data[e];return r&&t.set(r,[...t.get(r)||[],n]),t},new Map):new Map}function BW({nodes:i,clusterAttribute:e}){const t=new Map;if(e){const n=FW(i,e);for(const[r,s]of n){const a=qf(s);t.set(r,{label:r,nodes:s,position:a})}}return t}function kW(i,e,t){return bV.bidirectional(i,e,t)}const gA=i=>i.tagName!=="INPUT"&&i.tagName!=="SELECT"&&i.tagName!=="TEXTAREA"&&!i.isContentEditable,z3=({actives:i=[],selections:e=[],collapsedNodeIds:t=[],theme:n})=>aV(r=>({theme:{...n,edge:{...n?.edge,label:{...n?.edge?.label,fontSize:n?.edge?.label?.fontSize??6}}},edges:[],nodes:[],collapsedNodeIds:t,clusters:new Map,panning:!1,draggingIds:[],actives:i,edgeContextMenus:new Set,edgeMeshes:[],selections:e,hoveredNodeId:null,drags:{},graph:new cn({multi:!0}),setTheme:s=>r(a=>({...a,theme:s})),setClusters:s=>r(a=>({...a,clusters:s})),setEdgeContextMenus:s=>r(a=>({...a,edgeContextMenus:s})),setEdgeMeshes:s=>r(a=>({...a,edgeMeshes:s})),setPanning:s=>r(a=>({...a,panning:s})),setDrags:s=>r(a=>({...a,drags:s})),addDraggingId:s=>r(a=>({...a,draggingIds:[...a.draggingIds,s]})),removeDraggingId:s=>r(a=>({...a,draggingIds:a.draggingIds.filter(o=>o!==s)})),setActives:s=>r(a=>({...a,actives:s})),setSelections:s=>r(a=>({...a,selections:s})),setHoveredNodeId:s=>r(a=>({...a,hoveredNodeId:s})),setNodes:s=>r(a=>({...a,nodes:s,centerPosition:qf(s)})),setEdges:s=>r(a=>({...a,edges:s})),setNodePosition:(s,a)=>r(o=>{const l=o.nodes.find(m=>m.id===s),c=jf(l),d=new Q(a.x,a.y,a.z).sub(c),p=[...o.nodes];if(o.selections?.includes(s))o.selections?.forEach(m=>{const v=o.nodes.find(x=>x.id===m);if(v){const x=o.nodes.indexOf(v);p[x]=mA(v,d)}});else{const m=o.nodes.indexOf(l);p[m]=mA(l,d)}return{...o,drags:{...o.drags,[s]:l},nodes:p}}),setCollapsedNodeIds:(s=[])=>r(a=>({...a,collapsedNodeIds:s})),setClusterPosition:(s,a)=>r(o=>{const l=new Map(o.clusters),c=l.get(s);if(c){const f=c.position,d=new Q(a.x-f.x,a.y-f.y,a.z-(f.z??0)),p=[...o.nodes],m={...o.drags};p.forEach((_,g)=>{_.cluster===s&&(p[g]={..._,position:{..._.position,x:_.position.x+d.x,y:_.position.y+d.y,z:_.position.z+(d.z??0)}},m[_.id]=_)});const v=p.filter(_=>_.cluster===s),x=qf(v);return l.set(s,{...c,position:x}),{...o,drags:{...m,[s]:c},clusters:l,nodes:p}}return o})})),F3=z3({}),B3=ob?null:Z.createContext(F3),GW=({children:i,store:e=F3})=>ob?i:uo.createElement(B3.Provider,{value:e},i),et=i=>{const e=Z.useContext(B3);return fR(e,cV(i))};function k3({nodeId:i,nodes:e,edges:t,currentHiddenNodes:n,currentHiddenEdges:r}){const s=[],a=[],o=n.map(m=>m.id),l=r.map(m=>m.id),c=t.filter(m=>m.source===i),f=c.map(m=>m.target);a.push(...c);for(const m of f){const v=t.filter(_=>_.target===m&&_.source!==i);let x=!1;if((v.length===0||v.length>0&&!o.includes(m)&&v.map(g=>g.id).every(g=>l.includes(g)))&&(x=!0),x){const _=e.find(b=>b.id===m);_&&s.push(_);const g=k3({nodeId:m,nodes:e,edges:t,currentHiddenEdges:a,currentHiddenNodes:s});a.push(...g.hiddenEdges),s.push(...g.hiddenNodes)}}const d=Object.values(a.reduce((m,v)=>({...m,[v.id]:v}),{})),p=Object.values(s.reduce((m,v)=>({...m,[v.id]:v}),{}));return{hiddenEdges:d,hiddenNodes:p}}const HW=({collapsedIds:i,nodes:e,edges:t})=>{const n=[],r=[];for(const c of i){const{hiddenEdges:f,hiddenNodes:d}=k3({nodeId:c,nodes:e,edges:t,currentHiddenEdges:r,currentHiddenNodes:n});n.push(...d),r.push(...f)}const s=n.map(c=>c.id),a=r.map(c=>c.id),o=e.filter(c=>!s.includes(c.id)),l=t.filter(c=>!a.includes(c.id));return{visibleNodes:o,visibleEdges:l}},VW=({layoutType:i,sizingType:e,labelType:t,sizingAttribute:n,clusterAttribute:r,selections:s,nodes:a,edges:o,actives:l,collapsedNodeIds:c,defaultNodeSize:f,maxNodeSize:d,minNodeSize:p,layoutOverrides:m,constrainDragging:v})=>{const x=et(F=>F.graph),_=et(F=>F.clusters),g=et(F=>F.nodes),b=et(F=>F.setClusters),S=et(F=>F.collapsedNodeIds),E=et(F=>F.setEdges),w=et(F=>F.nodes),T=et(F=>F.setNodes),C=et(F=>F.setSelections),U=et(F=>F.setActives),D=et(F=>F.drags),R=et(F=>F.setDrags),I=et(F=>F.setCollapsedNodeIds),z=Z.useRef(!1),O=Z.useRef(null),V=Jn(F=>F.camera),ee=Z.useRef(D),P=Z.useRef([]);Z.useEffect(()=>{if(!r)return;const F=g.map(K=>K.id),Y=a.find(K=>!F.includes(K.id));if(Y){const K=Y.data[r],j=_.get(K),J={...ee.current};j?.nodes?.forEach(he=>J[he.id]=void 0),ee.current=J,R(J)}},[g,a,r,_,R]);const{visibleEdges:L,visibleNodes:k}=Z.useMemo(()=>HW({collapsedIds:S,nodes:a,edges:o}),[S,a,o]),H=Z.useCallback(F=>{const Y={...ee.current};F.forEach(K=>Y[K.id]=K),ee.current=Y,R(Y)},[R]),W=Z.useCallback(async F=>{O.current=F||AW({...m,type:i,graph:x,drags:ee.current,clusters:P?.current,clusterAttribute:r}),await vW(O.current);const Y=NW({graph:x,layout:O.current,sizingType:e,labelType:t,sizingAttribute:n,maxNodeSize:d,minNodeSize:p,defaultNodeSize:f,clusterAttribute:r}),K=BW({nodes:Y.nodes,clusterAttribute:r});v&&K.forEach(j=>{P.current.get(j.label)?.nodes.length===j.nodes.length&&(j.position=P.current?.get(j.label)?.position??j.position)}),E(Y.edges),T(Y.nodes),b(K),r&&H(Y.nodes)},[m,i,r,e,t,n,d,p,f,E,T,b]);return Z.useEffect(()=>{ee.current=D},[D,r,W]),Z.useEffect(()=>{P.current=_},[_]),Z.useEffect(()=>{const F=w.map(K=>({...K,labelVisible:O3({nodeCount:w?.length,labelType:t,camera:V,nodePosition:K?.position})("node",K?.size)}));F.some((K,j)=>K.labelVisible!==w[j].labelVisible)&&T(F)},[V,V.zoom,V.position.z,T,w,t]),Z.useEffect(()=>{z.current&&C(s)},[s,C]),Z.useEffect(()=>{z.current&&U(l)},[l,U]),Z.useEffect(()=>{async function F(){z.current=!1,LW(x,k,L),await W(),requestAnimationFrame(()=>z.current=!0)}F()},[k,L]),Z.useEffect(()=>{z.current&&I(c)},[c,I]),Z.useEffect(()=>{z.current&&(ee.current={},R({}),W())},[i,W,R]),Z.useEffect(()=>{z.current&&W(O.current)},[e,n,t,W]),{updateLayout:W}},bu=({text:i,fontSize:e=7,fontUrl:t,color:n="#2A6475",opacity:r=1,stroke:s,backgroundColor:a,backgroundOpacity:o=1,padding:l=1,strokeColor:c,strokeWidth:f=0,radius:d=.1,active:p,ellipsis:m=75,rotation:v})=>{const x=m&&!p?fW(i,m):i,_=Z.useMemo(()=>new $e(n),[n]),g=Z.useMemo(()=>s?new $e(s):void 0,[s]),b=Z.useMemo(()=>a?new $e(a):null,[a]),S=Z.useMemo(()=>c?new $e(c):null,[c]),E=Math.min(d*e,3),T=x.length*e*.6+l*2,C=e*1.2+l*2,U={width:T,height:C};return ue.jsxs(g3,{position:[0,0,11],renderOrder:1,children:[f>0&&S&&b&&ue.jsx("mesh",{position:[0,0,10],children:ue.jsx(cA,{args:[U.width+f,U.height+f,.1],radius:E,smoothness:8,"material-color":S,"material-transparent":!0,"material-opacity":o})}),b&&ue.jsx("mesh",{position:[0,0,10],children:ue.jsx(cA,{args:[U.width,U.height,.1],radius:E,smoothness:8,"material-color":b,"material-transparent":!0,"material-opacity":o})}),ue.jsx(rW,{position:[0,0,11],font:t,fontSize:e,color:_,fillOpacity:r,textAlign:"center",outlineWidth:s?1:0,outlineColor:g,depthOffset:0,maxWidth:100,overflowWrap:"break-word",rotation:v,children:x})]})},G3=({draggable:i,set:e,position:t,bounds:n,onDragStart:r,onDragEnd:s})=>{const a=Jn(_=>_.camera),o=Jn(_=>_.raycaster),l=Jn(_=>_.size),c=Jn(_=>_.gl),{mouse2D:f,mouse3D:d,offset:p,normal:m,plane:v}=Z.useMemo(()=>({mouse2D:new Ge,mouse3D:new Q,offset:new Q,normal:new Q,plane:new ua}),[]),x=Z.useMemo(()=>c.domElement.getBoundingClientRect(),[c.domElement]);return o9({onDragStart:({event:_})=>{const{eventObject:g,point:b}=_;g.getWorldPosition(p).sub(b),d.copy(b),r()},onDrag:({xy:_,buttons:g,cancel:b})=>{if(g!==1){b();return}const S=(_[0]-(x?.left??0))/l.width*2-1,E=-((_[1]-(x?.top??0))/l.height)*2+1;f.set(S,E),o.setFromCamera(f,a),a.getWorldDirection(m).negate(),v.setFromNormalAndCoplanarPoint(m,d),o.ray.intersectPlane(v,d);const w=new Q(t.x,t.y,t.z).copy(d).add(p);if(n){const T=new Q((n.minX+n.maxX)/2,(n.minY+n.maxY)/2,(n.minZ+n.maxZ)/2),C=(n.maxX-n.minX)/2,U=w.clone().sub(T);U.length()>C&&(U.normalize().multiplyScalar(C),w.copy(T).add(U))}return e(w)},onDragEnd:s},{drag:{enabled:i,threshold:10}})},lb=({sensitivity:i=7,interval:e=50,timeout:t=0,disabled:n,onPointerOver:r,onPointerOut:s})=>{const a=Z.useRef(!1),o=Z.useRef(null),l=Z.useRef(0),c=Z.useRef({x:null,y:null,px:null,py:null}),f=Z.useCallback(_=>{c.current.x=_.clientX,c.current.y=_.clientY},[]),d=Z.useCallback(_=>{o.current=clearTimeout(o.current);const{px:g,x:b,py:S,y:E}=c.current;Math.abs(g-b)+Math.abs(S-E)<i?(l.current=1,r(_)):(c.current.px=b,c.current.py=E,o.current=setTimeout(()=>d(_),e))},[e,r,i]),p=Z.useCallback(()=>{clearTimeout(o.current),typeof window<"u"&&document.removeEventListener("mousemove",f,!1)},[f]),m=Z.useCallback(_=>{n||(a.current=!0,p(),l.current!==1&&(c.current.px=_.pointer.x,c.current.py=_.pointer.y,typeof window<"u"&&document.addEventListener("mousemove",f,!1),o.current=setTimeout(()=>d(_),t)))},[p,d,n,f,t]),v=Z.useCallback(_=>{o.current=clearTimeout(o.current),l.current=0,s(_)},[s]),x=Z.useCallback(_=>{a.current=!1,p(),l.current===1&&(o.current=setTimeout(()=>v(_),t))},[p,v,t]);return{pointerOver:m,pointerOut:x}},H3=Z.createContext({controls:null,resetControls:()=>{},zoomIn:()=>{},zoomOut:()=>{},dollyIn:()=>{},dollyOut:()=>{},panLeft:()=>{},panRight:()=>{},panUp:()=>{},panDown:()=>{},freeze:()=>{},unFreeze:()=>{}}),x0=()=>{const i=Z.useContext(H3);if(i===void 0)throw new Error("`useCameraControls` hook must be used within a `ControlsProvider` component");return i},WW=({outerRadius:i,innerRadius:e,padding:t,normalizedFill:n,normalizedStroke:r,opacity:s,animated:a,theme:o})=>{const{opacity:l}=_r({from:{opacity:0},to:{opacity:s},config:{...xr,duration:a?void 0:0}});return ue.jsxs(ue.Fragment,{children:[ue.jsxs("mesh",{children:[ue.jsx("ringGeometry",{attach:"geometry",args:[i,0,128]}),ue.jsx(Bn.meshBasicMaterial,{attach:"material",color:n,transparent:!0,depthTest:!1,opacity:o.cluster?.fill?l:0,side:In,fog:!0})]}),ue.jsxs("mesh",{children:[ue.jsx("ringGeometry",{attach:"geometry",args:[i,e+t,128]}),ue.jsx(Bn.meshBasicMaterial,{attach:"material",color:r,transparent:!0,depthTest:!1,opacity:l,side:In,fog:!0})]})]})},XW=({animated:i,position:e,padding:t=40,labelFontUrl:n,disabled:r,radius:s=2,nodes:a,label:o,onClick:l,onPointerOver:c,onPointerOut:f,draggable:d=!1,onDragged:p,onRender:m})=>{const v=et(J=>J.theme),x=Math.max(e.width,e.height)/2,_=x-s+t,[g,b]=Z.useState(!1),S=et(J=>J.centerPosition),E=et(J=>J.nodes),w=x0(),T=et(J=>J.draggingIds),C=T.includes(o),U=T.length>0,D=et(J=>J.actives?.some(he=>a.some(re=>re.id===he))),R=et(J=>J.hoveredNodeId),I=et(J=>J.selections?.some(he=>a.some(re=>re.id===he))),O=et(J=>J.selections?.length>0)?I||g||D?v.cluster?.selectedOpacity:v.cluster?.inactiveOpacity:v.cluster?.opacity,V=Z.useMemo(()=>{const J=[0,-_,2],he=v.cluster?.label?.offset;return he?[J[0]-he[0],J[1]-he[1],J[2]-he[2]]:J},[_,v.cluster?.label?.offset]),{circlePosition:ee}=_r({from:{circlePosition:[S.x,S.y,-1]},to:{circlePosition:e?[e.x,e.y,-1]:[0,0,-1]},config:{...xr,duration:i&&!U?void 0:0}}),P=Z.useMemo(()=>new $e(v.cluster?.stroke),[v.cluster?.stroke]),L=Z.useMemo(()=>new $e(v.cluster?.fill),[v.cluster?.fill]),k=et(J=>J.addDraggingId),H=et(J=>J.removeDraggingId),W=et(J=>J.setClusterPosition),F=G3({draggable:d&&!R,position:{x:e.x,y:e.y,z:-1},set:J=>W(o,J),onDragStart:()=>{k(o),b(!0)},onDragEnd:()=>{H(o),b(!1);const J=E.filter(he=>he.cluster===o);p?.({nodes:J,label:o})}});wl(g&&!U&&l!==void 0,"pointer"),wl(g&&d&&!C&&l===void 0,"grab"),wl(C,"grabbing");const{pointerOver:Y,pointerOut:K}=lb({disabled:r,onPointerOver:J=>{b(!0),w.freeze(),c?.({nodes:a,label:o},J)},onPointerOut:J=>{b(!1),w.unFreeze(),f?.({nodes:a,label:o},J)}});return Z.useMemo(()=>v.cluster&&ue.jsx(Bn.group,{userData:{id:o,type:"cluster"},position:ee,onPointerOver:Y,onPointerOut:K,onClick:J=>{!r&&!C&&l?.({nodes:a,label:o},J)},...F(),children:m?m({label:{position:V,text:o,opacity:O,fontUrl:n},opacity:O,outerRadius:_,innerRadius:x,padding:t,theme:v}):ue.jsxs(ue.Fragment,{children:[ue.jsx(WW,{outerRadius:_,innerRadius:x,padding:t,normalizedFill:L,normalizedStroke:P,opacity:O,animated:i,theme:v}),v.cluster?.label&&ue.jsx(Bn.group,{position:V,children:ue.jsx(bu,{text:o,opacity:O,fontUrl:n,stroke:v.cluster.label.stroke,active:!1,color:v.cluster?.label.color,fontSize:v.cluster?.label.fontSize??12})})]})}),[v,ee,Y,K,_,L,x,t,P,V,o,O,n,r,l,a,F,C,m,i])},jW=({animated:i,color:e="#D8E6EA",length:t,opacity:n=.5,position:r,rotation:s,size:a=1,onActive:o,onContextMenu:l})=>{const c=Z.useMemo(()=>new $e(e),[e]),f=Z.useRef(null),d=et(_=>_.draggingIds.length>0),p=et(_=>_.centerPosition),[{pos:m,arrowOpacity:v}]=_r(()=>({from:{pos:p?[p.x,p.y,p.z]:[0,0,0],arrowOpacity:0},to:{pos:[r.x,r.y,r.z],arrowOpacity:n},config:{...xr,duration:i&&!d?void 0:0}}),[i,d,n,r]),x=Z.useCallback(()=>{const _=new Q(0,1,0);f.current?.quaternion.setFromUnitVectors(_,s)},[s,f]);return Z.useEffect(()=>x(),[x]),ue.jsxs(Bn.mesh,{position:m,ref:f,scale:[1,1,1],onPointerOver:()=>o(!0),onPointerOut:()=>o(!1),onPointerDown:_=>{_.nativeEvent.buttons===2&&(_.nativeEvent.preventDefault(),_.stopPropagation(),l())},children:[ue.jsx("cylinderGeometry",{args:[0,a,t,20,1,!0],attach:"geometry"}),ue.jsx(Bn.meshBasicMaterial,{attach:"material",color:c,depthTest:!1,opacity:v,transparent:!0,side:In,fog:!0})]})},qW=`
4233
+ }`)),document.head.appendChild(i)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();function yW(i){return new Promise((e,t)=>{let n;function r(){n?e(n):(n=i.step(),r())}r()})}function Ou(i){const e=[],t=[];return i.forEachNode((n,r)=>{e.push({...r,id:n,radius:r.size||1})}),i.forEachEdge((n,r)=>{t.push({...r,id:n})}),{nodes:e,edges:t}}function _W({graph:i,radius:e=40,drags:t,getNodePosition:n,concentricSpacing:r=100}){const{nodes:s,edges:a}=Ou(i),o={},l=v=>{const x=2*Math.PI*(e+v*r);return Math.floor(x/40)},c=new Map,f=[];for(const v of s){const _=i.getNodeAttribute(v.id,"data")?.level;typeof _=="number"&&_>=0?(c.has(_)||c.set(_,[]),c.get(_).push(v.id)):f.push({id:v.id,metric:i.degree(v.id)})}f.sort((v,x)=>x.metric-v.metric);for(const[v,x]of c.entries()){const _=x.length,g=e+v*r;for(let b=0;b<_;b++){const S=2*Math.PI*b/_;o[x[b]]={x:g*Math.cos(S),y:g*Math.sin(S)}}}const d=new Set(c.keys());let p=0,m=0;for(;m<f.length;){for(;d.has(p);)p++;const v=l(p),x=e+p*r;for(let _=0;_<v&&m<f.length;_++){const g=2*Math.PI*_/v;o[f[m].id]={x:x*Math.cos(g),y:x*Math.sin(g)},m++}p++}return{step(){return!0},getNodePosition(v){if(n){const x=n(v,{graph:i,drags:t,nodes:s,edges:a});if(x)return x}return t?.[v]?.position?t[v].position:o[v]}}}function R3(i,e=[]){const t=e.length;for(const n of i){const r=e.indexOf(n);if(r>-1){const s=[...e.slice(r),n].map(a=>a.data.id);throw new Error(`Invalid Graph: Circular node path detected: ${s.join(" -> ")}.`)}t>n.depth&&(n.depth=t,R3(n.out,[...e,n]))}}function D3(i,e){let t=!1;const n=i.reduce((a,o)=>({...a,[o.id]:{data:o,out:[],depth:-1,ins:[]}}),{});try{for(const a of e){const o=a.source,l=a.target;if(!n.hasOwnProperty(o))throw new Error(`Missing source Node ${o}`);if(!n.hasOwnProperty(l))throw new Error(`Missing target Node ${l}`);const c=n[o],f=n[l];f.ins.push(c),c.out.push(f)}R3(Object.values(n))}catch{t=!0}const r=Object.keys(n).map(a=>n[a].depth),s=Math.max(...r);return{invalid:t,depths:n,maxDepth:s||1}}const fA=["radialin","radialout"];function xW({nodes:i,edges:e,mode:t="lr",nodeLevelRatio:n=2}){const{depths:r,maxDepth:s,invalid:a}=D3(i,e);if(a)return null;const o=fA.includes(t)?1:5,l=i.length/s*n*o;if(t){const c=(m,v)=>x=>m?(r[x.id].depth-s/2)*l*(v?-1:1):void 0,f=c(["lr","rl"].includes(t),t==="rl"),d=c(["td","bu"].includes(t),t==="td"),p=c(["zin","zout"].includes(t),t==="zout");i.forEach(m=>{m.fx=f(m),m.fy=d(m),m.fz=p(m)})}return fA.includes(t)?Yk(c=>{const f=r[c.id];return(t==="radialin"?s-f.depth:f.depth)*l}).strength(1):null}function bW(){const i=L=>()=>L;let t=L=>L.index,n=[],r=[],s,a,o=[100,100],l=i(1),c=i(-1),f=i(100),d=i(.1),p={},m=.1,v=.001,x=[],_=[0,0],g,b=L=>L.cluster,S="treemap",E=!0,w=.1;function T(L){if(!E)return T;S==="force"&&(g.tick(),O());for(let k=0,H=n.length,W,F=L*w;k<H;++k)W=n[k],W.vx+=(p[b(W)].x-W.x)*F,W.vy+=(p[b(W)].y-W.y)*F}function C(){n&&(S==="treemap"?V():P())}T.initialize=function(L){n=L,C()};function U(L){let k=b(L.source),H=b(L.target);return k<=H?k+"~"+H:H+"~"+k}function D(L){let k=new Map,H={};return L.forEach(function(W){k.has(b(W))||k.set(b(W),{count:0,sumforceNodeSize:0})}),L.forEach(function(W){H=k.get(b(W)),H.count=H.count+1,H.sumforceNodeSize=H.sumforceNodeSize+Math.PI*(l(W)*l(W))*1.3,k.set(b(W),H)}),k}function R(L){let k=new Map,H=[];return L.forEach(function(W){let F=U(W),Y;k.has(F)?Y=k.get(F):Y=0,Y+=1,k.set(F,Y)}),k.forEach(function(W,F){let Y,K;Y=F.split("~")[0],K=F.split("~")[1],Y!==void 0&&K!==void 0&&H.push({source:Y,target:K,count:W})}),H}function I(){let L=[],k=[],H=new Map,W,F,Y,K,j;K=D(n),j=R(r);for(W of K.keys())Y=K.get(W),L.push({id:W,size:Y.count,r:Math.sqrt(Y.sumforceNodeSize/Math.PI)}),H.set(W,F);return j.forEach(function(J){let he=H.get(J.source),re=H.get(J.target);he!==void 0&&re!==void 0&&k.push({source:he,target:re,count:J.count})}),{nodes:L,links:k}}function z(){let L=[],k,H,W;W=D(T.nodes());for(k of W.keys())H=W.get(k),L.push({id:k,size:H.count});return{id:"clustersTree",children:L}}function O(){return p.none={x:0,y:0},x.forEach(function(L){S==="treemap"?p[L.data.id]={x:L.x0+(L.x1-L.x0)/2-_[0],y:L.y0+(L.y1-L.y0)/2-_[1]}:p[L.id]={x:L.x-_[0],y:L.y-_[1]}}),p}function V(){let L=OG().size(T.size());a=l0(z()).sum(k=>k.radius).sort(function(k,H){return H.height-k.height||H.value-k.value}),x=L(a).leaves(),O()}function ee(){let L=0;n.length!==0&&r.forEach(function(k){let H,W;if(n){if(H=k.source,W=k.target,typeof k.source!="object"&&(H=n.find(F=>F.id===k.source)),typeof k.target!="object"&&(W=n.find(F=>F.id===k.target)),H===void 0||W===void 0)throw Error("Error setting links, couldnt find nodes for a link (see it on the console)");k.source=H,k.target=W,k.index=L++}})}function P(){let L;!n||!n.length||(ee(),L=I(),s.size>0&&L.nodes.forEach(k=>{k.fx=s.get(k.id)?.position?.x,k.fy=s.get(k.id)?.position?.y}),g=QC(L.nodes).force("x",cx(o[0]/2).strength(.1)).force("y",ux(o[1]/2).strength(.1)).force("collide",XC(k=>k.r).iterations(4)).force("charge",$C().strength(c)).force("links",jC(L.nodes.length?L.links:[]).distance(f).strength(d)),x=g.nodes(),O())}return T.template=function(L){return arguments.length?(S=L,C(),T):S},T.groupBy=function(L){return arguments.length?typeof L=="string"?(b=function(k){return k[L]},T):(b=L,T):b},T.enableGrouping=function(L){return arguments.length?(E=L,T):E},T.strength=function(L){return arguments.length?(w=L,T):w},T.getLinkStrength=function(L){return E?b(L.source)===b(L.target)?typeof m=="function"?m(L):m:typeof v=="function"?v(L):v:typeof m=="function"?m(L):m},T.id=function(L){return arguments.length?(t=L,T):t},T.size=function(L){return arguments.length?(o=L,T):o},T.linkStrengthInterCluster=function(L){return arguments.length?(v=L,T):v},T.linkStrengthIntraCluster=function(L){return arguments.length?(m=L,T):m},T.nodes=function(L){return arguments.length?(n=L,T):n},T.links=function(L){return arguments.length?(L===null?r=[]:r=L,C(),T):r},T.template=function(L){return arguments.length?(S=L,C(),T):S},T.forceNodeSize=function(L){return arguments.length?(l=typeof L=="function"?L:i(+L),C(),T):l},T.nodeSize=T.forceNodeSize,T.forceCharge=function(L){return arguments.length?(c=typeof L=="function"?L:i(+L),C(),T):c},T.forceLinkDistance=function(L){return arguments.length?(f=typeof L=="function"?L:i(+L),C(),T):f},T.forceLinkStrength=function(L){return arguments.length?(d=typeof L=="function"?L:i(+L),C(),T):d},T.offset=function(L){return arguments.length?(_=typeof L=="function"?L:i(+L),T):_},T.getFocis=O,T.setClusters=function(L){return s=L,T},T}function ro({graph:i,nodeLevelRatio:e=2,mode:t=null,dimensions:n=2,nodeStrength:r=-250,linkDistance:s=50,clusterStrength:a=.5,linkStrengthInterCluster:o=.01,linkStrengthIntraCluster:l=.5,forceLinkDistance:c=100,forceLinkStrength:f=.1,clusterType:d="force",forceCharge:p=-700,getNodePosition:m,drags:v,clusters:x,clusterAttribute:_,forceLayout:g}){const{nodes:b,edges:S}=Ou(i),w=n===2&&S.length>25?r*2:r;let T,C;g==="forceDirected2d"?(T=cx(),C=ux()):(T=cx(600).strength(.05),C=ux(600).strength(.05));const U=QC().force("center",I5(0,0)).force("link",jC()).force("charge",$C().strength(w)).force("x",T).force("y",C).force("z",Zk()).force("collide",XC(z=>z.radius+10)).force("dagRadial",xW({nodes:b,edges:S,mode:t,nodeLevelRatio:e})).stop();let D;if(_){let z=p;if(b?.length){const O=Math.ceil(b.length/200);z=p*O}D=bW().setClusters(x).strength(a).template(d).groupBy(O=>O.data[_]).links(S).size([100,100]).linkStrengthInterCluster(o).linkStrengthIntraCluster(l).forceLinkDistance(c).forceLinkStrength(f).forceCharge(z).forceNodeSize(O=>O.radius)}let R=U.numDimensions(n).nodes(b);if(D&&(R=R.force("group",D)),s){let z=R.force("link");z&&(z.id(O=>O.id).links(S).distance(s),D&&(z=z.strength(D?.getLinkStrength??.1)))}const I=new Map(b.map(z=>[z.id,z]));return{step(){for(;U.alpha()>.01;)U.tick();return!0},getNodePosition(z){if(m){const O=m(z,{graph:i,drags:v,nodes:b,edges:S});if(O)return O}return v?.[z]?.position?v?.[z]?.position:I.get(z)}}}function SW({graph:i,radius:e,drags:t,getNodePosition:n}){const r=IG(i,{scale:e}),{nodes:s,edges:a}=Ou(i);return{step(){return!0},getNodePosition(o){if(n){const l=n(o,{graph:i,drags:t,nodes:s,edges:a});if(l)return l}return t?.[o]?.position?t?.[o]?.position:r?.[o]}}}const EW={td:{x:"x",y:"y",factor:-1},lr:{x:"y",y:"x",factor:1}};function dA({graph:i,drags:e,mode:t="td",nodeSeparation:n=1,nodeSize:r=[50,50],getNodePosition:s}){const{nodes:a,edges:o}=Ou(i),{depths:l}=D3(a,o),c=Object.keys(l).map(x=>l[x]),f=xG().id(x=>x.data.id).parentId(x=>x.ins?.[0]?.data?.id)(c),p=AG().separation(()=>n).nodeSize(r)(l0(f)).descendants(),m=EW[t],v=new Map(a.map(x=>{const{x:_,y:g}=p.find(b=>b.data.id===x.id);return[x.id,{...x,[m.x]:_*m.factor,[m.y]:g*m.factor,z:0}]}));return{step(){return!0},getNodePosition(x){if(s){const _=s(x,{graph:i,drags:e,nodes:a,edges:o});if(_)return _}return e?.[x]?.position?e?.[x]?.position:v.get(x)}}}function MW({graph:i,margin:e,drags:t,getNodePosition:n,ratio:r,gridSize:s,maxIterations:a}){const{nodes:o,edges:l}=Ou(i),c=GG(i,{maxIterations:a,inputReducer:(f,d)=>({...d,x:d.x||0,y:d.y||0}),settings:{ratio:r,margin:e,gridSize:s}});return{step(){return!0},getNodePosition(f){if(n){const d=n(f,{graph:i,drags:t,nodes:o,edges:l});if(d)return d}return t?.[f]?.position?t?.[f]?.position:c?.[f]}}}function wW({graph:i,drags:e,iterations:t,...n}){KG.assign(i);const r=qG(i,{iterations:t,settings:n});return{step(){return!0},getNodePosition(s){return e?.[s]?.position||r?.[s]}}}function TW({graph:i,drags:e,getNodePosition:t}){const{nodes:n,edges:r}=Ou(i);return{step(){return!0},getNodePosition(s){return t(s,{graph:i,drags:e,nodes:n,edges:r})}}}const AW=["forceDirected2d","treeTd2d","treeLr2d","radialOut2d","treeTd3d","treeLr3d","radialOut3d","forceDirected3d"];function CW({type:i,...e}){if(AW.includes(i)){const{nodeStrength:t,linkDistance:n,nodeLevelRatio:r}=e;if(i==="forceDirected2d")return ro({...e,dimensions:2,nodeLevelRatio:r||2,nodeStrength:t||-250,linkDistance:n,forceLayout:i});if(i==="treeTd2d")return ro({...e,mode:"td",dimensions:2,nodeLevelRatio:r||5,nodeStrength:t||-250,linkDistance:n||50,forceLayout:i});if(i==="treeLr2d")return ro({...e,mode:"lr",dimensions:2,nodeLevelRatio:r||5,nodeStrength:t||-250,linkDistance:n||50,forceLayout:i});if(i==="radialOut2d")return ro({...e,mode:"radialout",dimensions:2,nodeLevelRatio:r||5,nodeStrength:t||-500,linkDistance:n||100,forceLayout:i});if(i==="treeTd3d")return ro({...e,mode:"td",dimensions:3,nodeLevelRatio:r||2,nodeStrength:t||-500,linkDistance:n||50});if(i==="treeLr3d")return ro({...e,mode:"lr",dimensions:3,nodeLevelRatio:r||2,nodeStrength:t||-500,linkDistance:n||50,forceLayout:i});if(i==="radialOut3d")return ro({...e,mode:"radialout",dimensions:3,nodeLevelRatio:r||2,nodeStrength:t||-500,linkDistance:n||100,forceLayout:i});if(i==="forceDirected3d")return ro({...e,dimensions:3,nodeLevelRatio:r||2,nodeStrength:t||-250,linkDistance:n,forceLayout:i})}else if(i==="circular2d"){const{radius:t}=e;return SW({...e,radius:t||300})}else{if(i==="concentric2d")return _W(e);if(i==="hierarchicalTd")return dA({...e,mode:"td"});if(i==="hierarchicalLr")return dA({...e,mode:"lr"});if(i==="nooverlap"){const{graph:t,maxIterations:n,ratio:r,margin:s,gridSize:a,...o}=e;return MW({graph:t,margin:s||10,maxIterations:n||50,ratio:r||10,gridSize:a||20,...o})}else if(i==="forceatlas2"){const{graph:t,iterations:n,gravity:r,scalingRatio:s,...a}=e;return wW({type:"forceatlas2",graph:t,...a,scalingRatio:s||100,gravity:r||10,iterations:n||50})}else if(i==="custom")return TW({...e})}throw new Error(`Layout ${i} not found.`)}function U3({nodePosition:i,labelType:e,camera:t}){return(n,r)=>{const s=e==="all"||e==="nodes"&&n==="node"||e==="edges"&&n==="edge";if(!s&&t&&i&&t?.position?.z/t?.zoom-i?.z>6e3)return!1;if(s)return!0;if(e==="auto"&&n==="node"){if(r>7)return!0;if(t&&i&&t.position.z/t.zoom-i.z<3e3)return!0}return!1}}function O3(i,e){switch(e){case"above":return i;case"below":return-i;case"inline":case"natural":default:return 0}}const ob=typeof window>"u";function RW({graph:i}){const e=eH(i);return{ranks:e,getSizeForNode:t=>e[t]*80}}function DW({graph:i}){const e=nH.degreeCentrality(i);return{ranks:e,getSizeForNode:t=>e[t]*20}}function UW({graph:i,attribute:e,defaultSize:t}){const n=new Map;return e?i.forEachNode((r,s)=>{const a=s.data?.[e];isNaN(a)&&console.warn(`Attribute ${a} is not a number for node ${s.id}`),n.set(r,a||0)}):console.warn("Attribute sizing configured but no attribute provided"),{getSizeForNode:r=>!e||!n?t:n.get(r)}}const OW={pagerank:RW,centrality:DW,attribute:UW,none:({defaultSize:i})=>({getSizeForNode:e=>i})};function LW({type:i,...e}){const t=OW[i]?.(e);if(!t&&i!=="default")throw new Error(`Unknown sizing strategy: ${i}`);const{graph:n,minSize:r,maxSize:s}=e,a=new Map;let o,l;if(n.forEachNode((c,f)=>{let d;i==="default"?d=f.size||e.defaultSize:d=t.getSizeForNode(c),(o===void 0||d<o)&&(o=d),(l===void 0||d>l)&&(l=d),a.set(c,d)}),i!=="none"){const c=uR().domain([o,l]).rangeRound([r,s]);for(const[f,d]of a)a.set(f,c(d))}return a}function NW(i,e,t){i.clear();const n=new Set;for(const r of e)try{n.has(r.id)||(i.addNode(r.id,r),n.add(r.id))}catch(s){console.error(`[Graph] Error adding node '${r.id}`,s)}for(const r of t)if(!(!n.has(r.source)||!n.has(r.target)))try{i.addEdge(r.source,r.target,r)}catch(s){console.error(`[Graph] Error adding edge '${r.source} -> ${r.target}`,s)}return i}function IW({graph:i,layout:e,sizingType:t,labelType:n,sizingAttribute:r,defaultNodeSize:s,minNodeSize:a,maxNodeSize:o,clusterAttribute:l}){const c=[],f=[],d=new Map,p=LW({graph:i,type:t,attribute:r,minSize:a,maxSize:o,defaultSize:s});i.nodes().length;const m=U3({labelType:n});return i.forEachNode((v,x)=>{const _=e.getNodePosition(v),{data:g,fill:b,icon:S,label:E,size:w,...T}=x,C=p.get(x.id),U=m("node",C),R=(i.inboundNeighbors(x.id)||[]).map(z=>i.getNodeAttributes(z)),I={...x,size:C,labelVisible:U,label:E,icon:S,fill:b,cluster:l?g[l]:void 0,parents:R,data:{...T,...g??{}},position:{..._,x:_.x||0,y:_.y||0,z:_.z||1}};d.set(x.id,I),c.push(I)}),i.forEachEdge((v,x)=>{const _=d.get(x.source),g=d.get(x.target);if(_&&g){const{data:b,id:S,label:E,size:w,...T}=x,C=m("edge",w);f.push({...x,id:S,label:E,labelVisible:C,size:w,data:{...T,id:S,...b||{}}})}}),{nodes:c,edges:f}}const xr={mass:10,tension:1e3,friction:300,precision:.1};function L3(i,e,t){const n=e.getLength(),r=i==="end"?n:n/2,s=i==="end"?t/2:0,a=(r-s)/n,o=e.getPointAt(a),l=e.getTangentAt(a);return[o,l]}function N3(i){return[i+6,2+i/1.5]}const z_=.7;function I3(i,e,t=0){const n=new Q(i.x,i.y||0,i.z||0),r=new Q(e.x,e.y||0,e.z||0),s=new Q().addVectors(n,r).divideScalar(2);return s.setLength(s.length()+t)}function PW(i,e,t=-1){const n=i.clone(),r=e.clone(),s=new Q().subVectors(r,n),a=s.length(),o=s.clone().normalize(),l=new Q().subVectors(r,n).divideScalar(2),c=Math.abs(o.x)%1,f=new Q(-o.y,o.x-c*o.z,c*o.y).normalize(),d=new Q().add(n).add(l).add(f.multiplyScalar(a/4).multiplyScalar(t));return[i,d,e]}function Xf(i,e,t,n,r,s){const a=pA(i,t,e),o=pA(t,i,n);return r?new jg(...PW(a,o,s)):new s1(a,o)}function jf(i){return new Q(i.position.x,i.position.y,i.position.z||0)}function pA(i,e,t){const n=i.distanceTo(e);return i.clone().add(e.clone().sub(i).multiplyScalar(t/n))}function mA(i,e){return{...i,position:{...i.position,x:i.position.x+e.x,y:i.position.y+e.y,z:i.position.z+e.z}}}function zW({edge:i,edges:e,curved:t}){let n=t,r;const s=e.filter(a=>a.target===i.target&&a.source===i.source).map(a=>a.id);if(s.length>1){n=!0;const a=s.indexOf(i.id),o=a===0?1:1+a*.8,l=a%2===0?1:-1,c=z_*o;r=l*c}return i.data?.isAggregated&&e.length>1?{curved:!0,curveOffset:s.indexOf(i.id)===0?z_:-z_}:{curved:n,curveOffset:r}}function FW(i,e,t){const n=e.x-i.x,r=e.y-i.y,s=Math.atan2(r,n),a=t==="above"?n>=0?s+Math.PI/2:s-Math.PI/2:n>=0?s-Math.PI/2:s+Math.PI/2,o=7,l=Math.cos(a)*o,c=Math.sin(a)*o;return{x:l,y:c,z:0}}function qf(i){let e=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let o of i)e=Math.min(e,o.position.x),t=Math.max(t,o.position.x),n=Math.min(n,o.position.y),r=Math.max(r,o.position.y),s=Math.min(s,o.position.z),a=Math.max(a,o.position.z);return{height:r-n,width:t-e,minX:e,maxX:t,minY:n,maxY:r,minZ:s,maxZ:a,x:(t+e)/2,y:(r+n)/2,z:(a+s)/2}}function BW(i,e){return e?i.reduce((t,n)=>{const r=n.data[e];return r&&t.set(r,[...t.get(r)||[],n]),t},new Map):new Map}function kW({nodes:i,clusterAttribute:e}){const t=new Map;if(e){const n=BW(i,e);for(const[r,s]of n){const a=qf(s);t.set(r,{label:r,nodes:s,position:a})}}return t}function GW(i,e,t){return SV.bidirectional(i,e,t)}const gA=i=>i.tagName!=="INPUT"&&i.tagName!=="SELECT"&&i.tagName!=="TEXTAREA"&&!i.isContentEditable,P3=({actives:i=[],selections:e=[],collapsedNodeIds:t=[],theme:n})=>oV(r=>({theme:{...n,edge:{...n?.edge,label:{...n?.edge?.label,fontSize:n?.edge?.label?.fontSize??6}}},edges:[],nodes:[],collapsedNodeIds:t,clusters:new Map,panning:!1,draggingIds:[],actives:i,edgeContextMenus:new Set,edgeMeshes:[],selections:e,hoveredNodeId:null,drags:{},graph:new cn({multi:!0}),setTheme:s=>r(a=>({...a,theme:s})),setClusters:s=>r(a=>({...a,clusters:s})),setEdgeContextMenus:s=>r(a=>({...a,edgeContextMenus:s})),setEdgeMeshes:s=>r(a=>({...a,edgeMeshes:s})),setPanning:s=>r(a=>({...a,panning:s})),setDrags:s=>r(a=>({...a,drags:s})),addDraggingId:s=>r(a=>({...a,draggingIds:[...a.draggingIds,s]})),removeDraggingId:s=>r(a=>({...a,draggingIds:a.draggingIds.filter(o=>o!==s)})),setActives:s=>r(a=>({...a,actives:s})),setSelections:s=>r(a=>({...a,selections:s})),setHoveredNodeId:s=>r(a=>({...a,hoveredNodeId:s})),setNodes:s=>r(a=>({...a,nodes:s,centerPosition:qf(s)})),setEdges:s=>r(a=>({...a,edges:s})),setNodePosition:(s,a)=>r(o=>{const l=o.nodes.find(m=>m.id===s),c=jf(l),d=new Q(a.x,a.y,a.z).sub(c),p=[...o.nodes];if(o.selections?.includes(s))o.selections?.forEach(m=>{const v=o.nodes.find(x=>x.id===m);if(v){const x=o.nodes.indexOf(v);p[x]=mA(v,d)}});else{const m=o.nodes.indexOf(l);p[m]=mA(l,d)}return{...o,drags:{...o.drags,[s]:l},nodes:p}}),setCollapsedNodeIds:(s=[])=>r(a=>({...a,collapsedNodeIds:s})),setClusterPosition:(s,a)=>r(o=>{const l=new Map(o.clusters),c=l.get(s);if(c){const f=c.position,d=new Q(a.x-f.x,a.y-f.y,a.z-(f.z??0)),p=[...o.nodes],m={...o.drags};p.forEach((_,g)=>{_.cluster===s&&(p[g]={..._,position:{..._.position,x:_.position.x+d.x,y:_.position.y+d.y,z:_.position.z+(d.z??0)}},m[_.id]=_)});const v=p.filter(_=>_.cluster===s),x=qf(v);return l.set(s,{...c,position:x}),{...o,drags:{...m,[s]:c},clusters:l,nodes:p}}return o})})),z3=P3({}),F3=ob?null:Z.createContext(z3),HW=({children:i,store:e=z3})=>ob?i:uo.createElement(F3.Provider,{value:e},i),et=i=>{const e=Z.useContext(F3);return hR(e,uV(i))};function B3({nodeId:i,nodes:e,edges:t,currentHiddenNodes:n,currentHiddenEdges:r}){const s=[],a=[],o=n.map(m=>m.id),l=r.map(m=>m.id),c=t.filter(m=>m.source===i),f=c.map(m=>m.target);a.push(...c);for(const m of f){const v=t.filter(_=>_.target===m&&_.source!==i);let x=!1;if((v.length===0||v.length>0&&!o.includes(m)&&v.map(g=>g.id).every(g=>l.includes(g)))&&(x=!0),x){const _=e.find(b=>b.id===m);_&&s.push(_);const g=B3({nodeId:m,nodes:e,edges:t,currentHiddenEdges:a,currentHiddenNodes:s});a.push(...g.hiddenEdges),s.push(...g.hiddenNodes)}}const d=Object.values(a.reduce((m,v)=>({...m,[v.id]:v}),{})),p=Object.values(s.reduce((m,v)=>({...m,[v.id]:v}),{}));return{hiddenEdges:d,hiddenNodes:p}}const VW=({collapsedIds:i,nodes:e,edges:t})=>{const n=[],r=[];for(const c of i){const{hiddenEdges:f,hiddenNodes:d}=B3({nodeId:c,nodes:e,edges:t,currentHiddenEdges:r,currentHiddenNodes:n});n.push(...d),r.push(...f)}const s=n.map(c=>c.id),a=r.map(c=>c.id),o=e.filter(c=>!s.includes(c.id)),l=t.filter(c=>!a.includes(c.id));return{visibleNodes:o,visibleEdges:l}},WW=({layoutType:i,sizingType:e,labelType:t,sizingAttribute:n,clusterAttribute:r,selections:s,nodes:a,edges:o,actives:l,collapsedNodeIds:c,defaultNodeSize:f,maxNodeSize:d,minNodeSize:p,layoutOverrides:m,constrainDragging:v})=>{const x=et(F=>F.graph),_=et(F=>F.clusters),g=et(F=>F.nodes),b=et(F=>F.setClusters),S=et(F=>F.collapsedNodeIds),E=et(F=>F.setEdges),w=et(F=>F.nodes),T=et(F=>F.setNodes),C=et(F=>F.setSelections),U=et(F=>F.setActives),D=et(F=>F.drags),R=et(F=>F.setDrags),I=et(F=>F.setCollapsedNodeIds),z=Z.useRef(!1),O=Z.useRef(null),V=Jn(F=>F.camera),ee=Z.useRef(D),P=Z.useRef([]);Z.useEffect(()=>{if(!r)return;const F=g.map(K=>K.id),Y=a.find(K=>!F.includes(K.id));if(Y){const K=Y.data[r],j=_.get(K),J={...ee.current};j?.nodes?.forEach(he=>J[he.id]=void 0),ee.current=J,R(J)}},[g,a,r,_,R]);const{visibleEdges:L,visibleNodes:k}=Z.useMemo(()=>VW({collapsedIds:S,nodes:a,edges:o}),[S,a,o]),H=Z.useCallback(F=>{const Y={...ee.current};F.forEach(K=>Y[K.id]=K),ee.current=Y,R(Y)},[R]),W=Z.useCallback(async F=>{O.current=F||CW({...m,type:i,graph:x,drags:ee.current,clusters:P?.current,clusterAttribute:r}),await yW(O.current);const Y=IW({graph:x,layout:O.current,sizingType:e,labelType:t,sizingAttribute:n,maxNodeSize:d,minNodeSize:p,defaultNodeSize:f,clusterAttribute:r}),K=kW({nodes:Y.nodes,clusterAttribute:r});v&&K.forEach(j=>{P.current.get(j.label)?.nodes.length===j.nodes.length&&(j.position=P.current?.get(j.label)?.position??j.position)}),E(Y.edges),T(Y.nodes),b(K),r&&H(Y.nodes)},[m,i,r,e,t,n,d,p,f,E,T,b]);return Z.useEffect(()=>{ee.current=D},[D,r,W]),Z.useEffect(()=>{P.current=_},[_]),Z.useEffect(()=>{const F=w.map(K=>({...K,labelVisible:U3({nodeCount:w?.length,labelType:t,camera:V,nodePosition:K?.position})("node",K?.size)}));F.some((K,j)=>K.labelVisible!==w[j].labelVisible)&&T(F)},[V,V.zoom,V.position.z,T,w,t]),Z.useEffect(()=>{z.current&&C(s)},[s,C]),Z.useEffect(()=>{z.current&&U(l)},[l,U]),Z.useEffect(()=>{async function F(){z.current=!1,NW(x,k,L),await W(),requestAnimationFrame(()=>z.current=!0)}F()},[k,L]),Z.useEffect(()=>{z.current&&I(c)},[c,I]),Z.useEffect(()=>{z.current&&(ee.current={},R({}),W())},[i,W,R]),Z.useEffect(()=>{z.current&&W(O.current)},[e,n,t,W]),{updateLayout:W}},bu=({text:i,fontSize:e=7,fontUrl:t,color:n="#2A6475",opacity:r=1,stroke:s,backgroundColor:a,backgroundOpacity:o=1,padding:l=1,strokeColor:c,strokeWidth:f=0,radius:d=.1,active:p,ellipsis:m=75,rotation:v})=>{const x=m&&!p?dW(i,m):i,_=Z.useMemo(()=>new $e(n),[n]),g=Z.useMemo(()=>s?new $e(s):void 0,[s]),b=Z.useMemo(()=>a?new $e(a):null,[a]),S=Z.useMemo(()=>c?new $e(c):null,[c]),E=Math.min(d*e,3),T=x.length*e*.6+l*2,C=e*1.2+l*2,U={width:T,height:C};return ue.jsxs(m3,{position:[0,0,11],renderOrder:1,children:[f>0&&S&&b&&ue.jsx("mesh",{position:[0,0,10],children:ue.jsx(cA,{args:[U.width+f,U.height+f,.1],radius:E,smoothness:8,"material-color":S,"material-transparent":!0,"material-opacity":o})}),b&&ue.jsx("mesh",{position:[0,0,10],children:ue.jsx(cA,{args:[U.width,U.height,.1],radius:E,smoothness:8,"material-color":b,"material-transparent":!0,"material-opacity":o})}),ue.jsx(sW,{position:[0,0,11],font:t,fontSize:e,color:_,fillOpacity:r,textAlign:"center",outlineWidth:s?1:0,outlineColor:g,depthOffset:0,maxWidth:100,overflowWrap:"break-word",rotation:v,children:x})]})},k3=({draggable:i,set:e,position:t,bounds:n,onDragStart:r,onDragEnd:s})=>{const a=Jn(_=>_.camera),o=Jn(_=>_.raycaster),l=Jn(_=>_.size),c=Jn(_=>_.gl),{mouse2D:f,mouse3D:d,offset:p,normal:m,plane:v}=Z.useMemo(()=>({mouse2D:new Ge,mouse3D:new Q,offset:new Q,normal:new Q,plane:new ua}),[]),x=Z.useMemo(()=>c.domElement.getBoundingClientRect(),[c.domElement]);return l9({onDragStart:({event:_})=>{const{eventObject:g,point:b}=_;g.getWorldPosition(p).sub(b),d.copy(b),r()},onDrag:({xy:_,buttons:g,cancel:b})=>{if(g!==1){b();return}const S=(_[0]-(x?.left??0))/l.width*2-1,E=-((_[1]-(x?.top??0))/l.height)*2+1;f.set(S,E),o.setFromCamera(f,a),a.getWorldDirection(m).negate(),v.setFromNormalAndCoplanarPoint(m,d),o.ray.intersectPlane(v,d);const w=new Q(t.x,t.y,t.z).copy(d).add(p);if(n){const T=new Q((n.minX+n.maxX)/2,(n.minY+n.maxY)/2,(n.minZ+n.maxZ)/2),C=(n.maxX-n.minX)/2,U=w.clone().sub(T);U.length()>C&&(U.normalize().multiplyScalar(C),w.copy(T).add(U))}return e(w)},onDragEnd:s},{drag:{enabled:i,threshold:10}})},lb=({sensitivity:i=7,interval:e=50,timeout:t=0,disabled:n,onPointerOver:r,onPointerOut:s})=>{const a=Z.useRef(!1),o=Z.useRef(null),l=Z.useRef(0),c=Z.useRef({x:null,y:null,px:null,py:null}),f=Z.useCallback(_=>{c.current.x=_.clientX,c.current.y=_.clientY},[]),d=Z.useCallback(_=>{o.current=clearTimeout(o.current);const{px:g,x:b,py:S,y:E}=c.current;Math.abs(g-b)+Math.abs(S-E)<i?(l.current=1,r(_)):(c.current.px=b,c.current.py=E,o.current=setTimeout(()=>d(_),e))},[e,r,i]),p=Z.useCallback(()=>{clearTimeout(o.current),typeof window<"u"&&document.removeEventListener("mousemove",f,!1)},[f]),m=Z.useCallback(_=>{n||(a.current=!0,p(),l.current!==1&&(c.current.px=_.pointer.x,c.current.py=_.pointer.y,typeof window<"u"&&document.addEventListener("mousemove",f,!1),o.current=setTimeout(()=>d(_),t)))},[p,d,n,f,t]),v=Z.useCallback(_=>{o.current=clearTimeout(o.current),l.current=0,s(_)},[s]),x=Z.useCallback(_=>{a.current=!1,p(),l.current===1&&(o.current=setTimeout(()=>v(_),t))},[p,v,t]);return{pointerOver:m,pointerOut:x}},G3=Z.createContext({controls:null,resetControls:()=>{},zoomIn:()=>{},zoomOut:()=>{},dollyIn:()=>{},dollyOut:()=>{},panLeft:()=>{},panRight:()=>{},panUp:()=>{},panDown:()=>{},freeze:()=>{},unFreeze:()=>{}}),x0=()=>{const i=Z.useContext(G3);if(i===void 0)throw new Error("`useCameraControls` hook must be used within a `ControlsProvider` component");return i},XW=({outerRadius:i,innerRadius:e,padding:t,normalizedFill:n,normalizedStroke:r,opacity:s,animated:a,theme:o})=>{const{opacity:l}=_r({from:{opacity:0},to:{opacity:s},config:{...xr,duration:a?void 0:0}});return ue.jsxs(ue.Fragment,{children:[ue.jsxs("mesh",{children:[ue.jsx("ringGeometry",{attach:"geometry",args:[i,0,128]}),ue.jsx(Bn.meshBasicMaterial,{attach:"material",color:n,transparent:!0,depthTest:!1,opacity:o.cluster?.fill?l:0,side:In,fog:!0})]}),ue.jsxs("mesh",{children:[ue.jsx("ringGeometry",{attach:"geometry",args:[i,e+t,128]}),ue.jsx(Bn.meshBasicMaterial,{attach:"material",color:r,transparent:!0,depthTest:!1,opacity:l,side:In,fog:!0})]})]})},jW=({animated:i,position:e,padding:t=40,labelFontUrl:n,disabled:r,radius:s=2,nodes:a,label:o,onClick:l,onPointerOver:c,onPointerOut:f,draggable:d=!1,onDragged:p,onRender:m})=>{const v=et(J=>J.theme),x=Math.max(e.width,e.height)/2,_=x-s+t,[g,b]=Z.useState(!1),S=et(J=>J.centerPosition),E=et(J=>J.nodes),w=x0(),T=et(J=>J.draggingIds),C=T.includes(o),U=T.length>0,D=et(J=>J.actives?.some(he=>a.some(re=>re.id===he))),R=et(J=>J.hoveredNodeId),I=et(J=>J.selections?.some(he=>a.some(re=>re.id===he))),O=et(J=>J.selections?.length>0)?I||g||D?v.cluster?.selectedOpacity:v.cluster?.inactiveOpacity:v.cluster?.opacity,V=Z.useMemo(()=>{const J=[0,-_,2],he=v.cluster?.label?.offset;return he?[J[0]-he[0],J[1]-he[1],J[2]-he[2]]:J},[_,v.cluster?.label?.offset]),{circlePosition:ee}=_r({from:{circlePosition:[S.x,S.y,-1]},to:{circlePosition:e?[e.x,e.y,-1]:[0,0,-1]},config:{...xr,duration:i&&!U?void 0:0}}),P=Z.useMemo(()=>new $e(v.cluster?.stroke),[v.cluster?.stroke]),L=Z.useMemo(()=>new $e(v.cluster?.fill),[v.cluster?.fill]),k=et(J=>J.addDraggingId),H=et(J=>J.removeDraggingId),W=et(J=>J.setClusterPosition),F=k3({draggable:d&&!R,position:{x:e.x,y:e.y,z:-1},set:J=>W(o,J),onDragStart:()=>{k(o),b(!0)},onDragEnd:()=>{H(o),b(!1);const J=E.filter(he=>he.cluster===o);p?.({nodes:J,label:o})}});wl(g&&!U&&l!==void 0,"pointer"),wl(g&&d&&!C&&l===void 0,"grab"),wl(C,"grabbing");const{pointerOver:Y,pointerOut:K}=lb({disabled:r,onPointerOver:J=>{b(!0),w.freeze(),c?.({nodes:a,label:o},J)},onPointerOut:J=>{b(!1),w.unFreeze(),f?.({nodes:a,label:o},J)}});return Z.useMemo(()=>v.cluster&&ue.jsx(Bn.group,{userData:{id:o,type:"cluster"},position:ee,onPointerOver:Y,onPointerOut:K,onClick:J=>{!r&&!C&&l?.({nodes:a,label:o},J)},...F(),children:m?m({label:{position:V,text:o,opacity:O,fontUrl:n},opacity:O,outerRadius:_,innerRadius:x,padding:t,theme:v}):ue.jsxs(ue.Fragment,{children:[ue.jsx(XW,{outerRadius:_,innerRadius:x,padding:t,normalizedFill:L,normalizedStroke:P,opacity:O,animated:i,theme:v}),v.cluster?.label&&ue.jsx(Bn.group,{position:V,children:ue.jsx(bu,{text:o,opacity:O,fontUrl:n,stroke:v.cluster.label.stroke,active:!1,color:v.cluster?.label.color,fontSize:v.cluster?.label.fontSize??12})})]})}),[v,ee,Y,K,_,L,x,t,P,V,o,O,n,r,l,a,F,C,m,i])},qW=({animated:i,color:e="#D8E6EA",length:t,opacity:n=.5,position:r,rotation:s,size:a=1,onActive:o,onContextMenu:l})=>{const c=Z.useMemo(()=>new $e(e),[e]),f=Z.useRef(null),d=et(_=>_.draggingIds.length>0),p=et(_=>_.centerPosition),[{pos:m,arrowOpacity:v}]=_r(()=>({from:{pos:p?[p.x,p.y,p.z]:[0,0,0],arrowOpacity:0},to:{pos:[r.x,r.y,r.z],arrowOpacity:n},config:{...xr,duration:i&&!d?void 0:0}}),[i,d,n,r]),x=Z.useCallback(()=>{const _=new Q(0,1,0);f.current?.quaternion.setFromUnitVectors(_,s)},[s,f]);return Z.useEffect(()=>x(),[x]),ue.jsxs(Bn.mesh,{position:m,ref:f,scale:[1,1,1],onPointerOver:()=>o(!0),onPointerOut:()=>o(!1),onPointerDown:_=>{_.nativeEvent.buttons===2&&(_.nativeEvent.preventDefault(),_.stopPropagation(),l())},children:[ue.jsx("cylinderGeometry",{args:[0,a,t,20,1,!0],attach:"geometry"}),ue.jsx(Bn.meshBasicMaterial,{attach:"material",color:c,depthTest:!1,opacity:v,transparent:!0,side:In,fog:!0})]})},YW=`
4234
4234
  varying vec2 vUv;
4235
4235
  void main() {
4236
4236
  vUv = uv;
4237
4237
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4238
4238
  }
4239
- `,YW=`
4239
+ `,ZW=`
4240
4240
  uniform vec3 color;
4241
4241
  uniform float opacity;
4242
4242
  uniform float dashSize;
@@ -4254,4 +4254,4 @@ vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
4254
4254
 
4255
4255
  gl_FragColor = vec4(color, opacity);
4256
4256
  }
4257
- `,ZW=({curveOffset:i,animated:e,color:t="#000",curve:n,curved:r=!1,dashed:s=!1,dashArray:a=[3,1],id:o,opacity:l=1,size:c=1,onContextMenu:f,onClick:d,onPointerOver:p,onPointerOut:m})=>{const v=Z.useRef(null),x=et(w=>w.draggingIds.length>0),_=Z.useMemo(()=>new $e(t),[t]),g=et(w=>w.centerPosition),b=Z.useRef(!1),S=Z.useMemo(()=>{if(!s)return null;const[w,T]=a;return new Vr({uniforms:{color:{value:_},opacity:{value:l},dashSize:{value:w},gapSize:{value:T},lineLength:{value:n.getLength()}},vertexShader:qW,fragmentShader:YW,transparent:!0,depthTest:!1})},[s,_,l,n,a]),{lineOpacity:E}=_r({from:{lineOpacity:0},to:{lineOpacity:l},config:{...xr,duration:e?void 0:0}});return _r(()=>{const w=n.getPoint(0),T=n.getPoint(1);return{from:{fromVertices:b.current?[T?.x,T?.y,T?.z||0]:[g?.x,g?.y,g?.z||0],toVertices:[w?.x,w?.y,w?.z||0]},to:{fromVertices:[w?.x,w?.y,w?.z||0],toVertices:[T?.x,T?.y,T?.z||0]},onChange:C=>{const{fromVertices:U,toVertices:D}=C.value,R=new Q(...U),I=new Q(...D),z=Xf(R,0,I,0,r,i);if(v.current){const O=s?c*.4:c/2;v.current.copy(new Ul(z,20,O,5,!1))}},config:{...xr,duration:e&&!x?void 0:0}}},[e,x,n,c,s,r,i]),Z.useEffect(()=>{b.current=!0},[]),ue.jsxs("mesh",{userData:{id:o,type:"edge"},renderOrder:-1,onPointerOver:p,onPointerOut:m,onClick:d,onPointerDown:w=>{w.nativeEvent.buttons===2&&(w.nativeEvent.preventDefault(),w.stopPropagation(),f())},children:[ue.jsx("tubeGeometry",{attach:"geometry",ref:v}),s?ue.jsx("primitive",{attach:"material",object:S}):ue.jsx(Bn.meshBasicMaterial,{attach:"material",opacity:E,fog:!0,transparent:!0,depthTest:!1,color:_})]})},vA=3,KW=({animated:i,arrowPlacement:e="end",contextMenu:t,disabled:n,labelPlacement:r="inline",id:s,interpolation:a,labelFontUrl:o,onContextMenu:l,onClick:c,onPointerOver:f,onPointerOut:d,subLabelPlacement:p="below"})=>{const m=et(ne=>ne.theme),v=et(ne=>ne.draggingIds.length>0),[x,_]=Z.useState(!1),[g,b]=Z.useState(!1),S=et(ne=>ne.edges),E=S.find(ne=>ne.id===s),{target:w,source:T,label:C,subLabel:U,labelVisible:D=!1,size:R=1,fill:I,dashed:z=!1,dashArray:O=[3,1]}=E,V=E.subLabelPlacement||p,ee=et(ne=>ne.nodes.find(Be=>Be.id===T)),P=et(ne=>ne.nodes.find(Be=>Be.id===w)),L=(R+m.edge.label.fontSize)/2,[k,H]=Z.useMemo(()=>I3(R),[R]),W=E.interpolation||a,F=E.arrowPlacement||e,{curveOffset:Y,curved:K}=Z.useMemo(()=>PW({edge:E,edges:S,curved:W==="curved"}),[E,S,W]),[j,J,he]=Z.useMemo(()=>{const ne=jf(ee),Be=ee.size,X=jf(P),B=P.size;let ie=Xf(ne,Be,X,B,K,Y);const[Se,ge]=N3(F,ie,k);return F==="end"&&(ie=Xf(ne,Be,Se,0,K,Y)),[ie,Se,ge]},[ee,P,K,Y,F,k]),re=Z.useMemo(()=>{let ne=P3(ee.position,P.position,L3(L,r));if(K){const Be=new Q().subVectors(ne,j.getPoint(.5));switch(r){case"above":Be.y=Be.y-vA;break;case"below":Be.y=Be.y+vA;break}ne=ne.sub(Be)}return ne},[ee.position,P.position,L,r,K,j]),pe=et(ne=>ne.selections?.includes(s)),Oe=et(ne=>ne.selections?.length),be=et(ne=>ne.actives?.includes(s)),ve=et(ne=>ne.centerPosition),ce=Oe?pe||be?m.edge.selectedOpacity:m.edge.inactiveOpacity:m.edge.opacity,Ne=Z.useMemo(()=>zW(ee.position,P.position,V),[ee.position,P.position,V]),[{labelPosition:G}]=_r(()=>({from:{labelPosition:ve?[ve.x,ve.y,ve.z]:[0,0,0]},to:{labelPosition:[re.x,re.y,re.z]},config:{...xr,duration:i&&!v?void 0:0}}),[re,i,v]),le=Z.useMemo(()=>new Ui(0,0,r==="natural"?0:Math.atan((P.position.y-ee.position.y)/(P.position.x-ee.position.x))),[P.position.x,P.position.y,ee.position.x,ee.position.y,r]);wl(x&&!v&&c!==void 0,"pointer");const{pointerOver:te,pointerOut:Me}=lb({disabled:n,onPointerOver:ne=>{_(!0),f?.(E,ne)},onPointerOut:ne=>{_(!1),d?.(E,ne)}}),oe=Z.useMemo(()=>F!=="none"&&ue.jsx(jW,{animated:i,color:pe||x||be?m.arrow.activeFill:I||m.arrow.fill,length:k,opacity:ce,position:J,rotation:he,size:H,onActive:_,onContextMenu:()=>{n||(b(!0),l?.(E))}}),[I,x,i,k,F,J,he,H,n,E,be,pe,l,ce,m.arrow.activeFill,m.arrow.fill]),De=Z.useMemo(()=>D&&C&&ue.jsxs(Bn.group,{position:G,onContextMenu:()=>{n||(b(!0),l?.(E))},onPointerOver:te,onPointerOut:Me,children:[ue.jsx(bu,{text:C,ellipsis:15,fontUrl:o,stroke:m.edge.label.stroke,color:pe||x||be?m.edge.label.activeColor:m.edge.label.color,opacity:ce,fontSize:m.edge.label.fontSize,rotation:le}),U&&ue.jsx("group",{position:[Ne.x,Ne.y,0],children:ue.jsx(bu,{text:U,ellipsis:15,fontUrl:o,stroke:m.edge.subLabel?.stroke||m.edge.label.stroke,color:pe||x||be?m.edge.subLabel?.activeColor||m.edge.label.activeColor:m.edge.subLabel?.color||m.edge.label.color,opacity:ce,fontSize:m.edge.subLabel?.fontSize||m.edge.label.fontSize*.8,rotation:le})})]}),[x,n,E,be,pe,C,U,o,G,Ne,le,D,l,Me,te,ce,m.edge.label.activeColor,m.edge.label.color,m.edge.label.fontSize,m.edge.label.stroke,m.edge.subLabel?.stroke,m.edge.subLabel?.activeColor,m.edge.subLabel?.color,m.edge.subLabel?.fontSize]),_e=Z.useMemo(()=>g&&t&&ue.jsx(rb,{prepend:!0,center:!0,position:re,children:t({data:E,onClose:()=>b(!1)})}),[g,t,re,E]);return ue.jsxs("group",{children:[ue.jsx(ZW,{curveOffset:Y,animated:i,color:pe||x||be?m.edge.activeFill:I||m.edge.fill,curve:j,curved:K,dashed:z,dashArray:O,id:s,opacity:ce,size:R,onClick:ne=>{n||c?.(E,ne)},onPointerOver:te,onPointerOut:Me,onContextMenu:()=>{n||(b(!0),l?.(E))}}),oe,De,_e]})},yA=new wa(0,0,0);function JW(i,e){const t=Z.useRef(null),n=et(l=>l.theme);et(l=>{t.current=l});const r=Z.useRef(new Map);Z.useRef(new wa(0,0,0));const s=Z.useRef(null),a=Z.useCallback(l=>{const c=[],f=r.current,{nodes:d}=t.current,p=new Map(d.map(m=>[m.id,m]));return n.edge.label.fontSize,i!=="none"&&!s.current&&(s.current=new wu(0,1,1,20,1,!0)),l.forEach(m=>{const{target:v,source:x,size:_=1}=m,g=p.get(x),b=p.get(v);if(!g||!b)return;const S=`${g.position.x},${g.position.y},${b.position.x},${b.position.y},${_}`,w=(m.interpolation||e)==="curved",T=m.arrowPlacement||i;if(f.has(S)){c.push(f.get(S));return}const C=jf(g),U=g.size,D=jf(b),R=b.size;let I=Xf(C,U,D,R,w),z=new Ul(I,20,_/2,5,!1);if(T==="none"){c.push(z),f.set(S,z);return}const[O,V]=I3(_),ee=s.current.clone();ee.scale(V,O,V);const[P,L]=N3(T,I,O),k=new _i;if(k.setFromUnitVectors(new Q(0,1,0),L),ee.applyQuaternion(k),ee.translate(P.x,P.y,P.z),T&&T==="end"){const W=Xf(C,U,P,0,w);z=new Ul(W,20,_/2,5,!1)}const H=Xp([z,ee]);c.push(H),f.set(S,H)}),c},[i,e,n.edge.label.fontSize]),o=Z.useCallback((l,c)=>{const f=a(l),d=a(c);return Xp([d.length?Xp(d):yA,f.length?Xp(f):yA],!0)},[a]);return{getGeometries:a,getGeometry:o}}function QW(i,e,t){const n=Z.useRef(i);Z.useEffect(()=>{n.current=i},[i]);const r=et(d=>d.edgeContextMenus),s=et(Z.useCallback(d=>d.setEdgeContextMenus,[])),a=Z.useRef(!1),o=Z.useCallback(()=>{a.current=!0},[]),l=Z.useRef(!1),c=Z.useCallback(()=>{l.current=!0},[]),f=Z.useCallback((d,p)=>{const{onClick:m,onContextMenu:v,onPointerOver:x,onPointerOut:_}=n.current;if(m&&a.current&&!t){a.current=!1;for(const g of p)m(g)}if((e||v)&&l.current&&!t){l.current=!1;const g=new Set(r);let b=!1;for(const S of p)r.has(S.id)||(g.add(S.id),b=!0,v?.(S));b&&s(g)}x&&p.filter(b=>!d.includes(b)).forEach(b=>{x(b)}),_&&d.filter(b=>!p.includes(b)).forEach(b=>{_(b)})},[e,t,r,s]);return{handleClick:o,handleContextMenu:c,handleIntersections:f}}function $W(i,e){const t=Z.useRef(i),n=Z.useRef(null);Z.useEffect(()=>{t.current=i;const a=i.getAttribute("position");n.current=new Float32Array(a.array.length)},[i]);const r=Z.useCallback(()=>{const a=t.current.getAttribute("position");return{from:new Float32Array(a.array.length),to:a.array}},[]),s=Z.useCallback(a=>{const o=n.current;o.set(a);const l=new Kt(o,3,!1);t.current.setAttribute("position",l),l.needsUpdate=!0},[]);_r(()=>{if(!e)return null;const a=r();return{from:{positions:a.from},to:{positions:a.to},onChange:o=>{s(o.value.positions)},config:{...xr,duration:e?void 0:0}}},[e,r,s])}function eX(i,e,t){const[{activeOpacity:n,inactiveOpacity:r}]=_r(()=>({from:{activeOpacity:0,inactiveOpacity:0},to:{activeOpacity:e?t.edge.selectedOpacity:t.edge.opacity,inactiveOpacity:e?t.edge.inactiveOpacity:t.edge.opacity},config:{...xr,duration:i?void 0:0}}),[i,e,t]);return{activeOpacity:n,inactiveOpacity:r}}const tX=({animated:i,color:e,contextMenu:t,edge:n,labelFontUrl:r,labelPlacement:s="inline",opacity:a})=>{const o=et(R=>R.theme),{target:l,source:c,label:f,labelVisible:d=!1,size:p=1}=n,m=et(R=>R.nodes),[v,x]=Z.useMemo(()=>[m.find(R=>R.id===c),m.find(R=>R.id===l)],[m,c,l]),_=et(R=>R.draggingIds.length>0),g=Z.useMemo(()=>(p+o.edge.label.fontSize)/2,[p,o.edge.label.fontSize]),b=Z.useMemo(()=>P3(v.position,x.position,L3(g,s)),[v.position,x.position,g,s]),S=et(R=>R.edgeContextMenus),E=et(R=>R.setEdgeContextMenus),[{labelPosition:w}]=_r(()=>({from:{labelPosition:[0,0,0]},to:{labelPosition:[b.x,b.y,b.z]},config:{...xr,duration:i&&!_?void 0:0}}),[b,i,_]),T=Z.useCallback(R=>{const I=new Set(S);I.delete(R),E(I)},[S,E]),C=Z.useMemo(()=>s==="natural"?new Ui(0,0,0):new Ui(0,0,Math.atan2(x.position.y-v.position.y,x.position.x-v.position.x)),[s,x.position.y,x.position.x,v.position.y,v.position.x]),U=Z.useMemo(()=>({prepend:!0,center:!0,position:b}),[b]),D=Z.useMemo(()=>({text:f,ellipsis:15,fontUrl:r,stroke:o.edge.label.stroke,color:e,opacity:a,fontSize:o.edge.label.fontSize,rotation:C}),[f,r,o.edge.label.stroke,e,a,o.edge.label.fontSize,C]);return ue.jsxs("group",{children:[d&&f&&ue.jsx(Bn.group,{position:w,children:ue.jsx(bu,{...D})}),t&&S.has(n.id)&&ue.jsx(rb,{...U,children:t({data:n,onClose:()=>T(n.id)})})]})},nX=({interpolation:i="linear",arrowPlacement:e="end",labelPlacement:t="inline",animated:n,contextMenu:r,disabled:s,edges:a,labelFontUrl:o,onClick:l,onContextMenu:c,onPointerOut:f,onPointerOver:d})=>{const p=et(W=>W.theme),{getGeometries:m,getGeometry:v}=JW(e,i),x=et(W=>W.draggingIds),_=et(W=>W.edgeMeshes),g=et(W=>W.setEdgeMeshes),b=et(W=>W.actives||[]),S=et(W=>W.selections||[]),[E,w,T,C]=Z.useMemo(()=>{const W=[],F=[],Y=[],K=[];return a.forEach(j=>{if(x.includes(j.source)||x.includes(j.target)){S.includes(j.id)||b.includes(j.id)?Y.push(j):K.push(j);return}S.includes(j.id)||b.includes(j.id)?W.push(j):F.push(j)}),[W,F,Y,K]},[a,b,S,x]),U=!!S.length,D=Z.useMemo(()=>v(E,w),[v,E,w]),{activeOpacity:R,inactiveOpacity:I}=eX(n,U,p);$W(D,n),Z.useEffect(()=>{if(x.length===0){const F=m(a).map(Y=>new pn(Y));g(F)}},[m,g,a,x.length]);const z=Z.useRef(new pn),O=Z.useRef(new pn),V=Z.useCallback(W=>{if(!W.camera)return[];const F=W.intersectObjects(_);return F.length?F.map(Y=>a[_.indexOf(Y.object)]):[]},[_,a]),{handleClick:ee,handleContextMenu:P,handleIntersections:L}=QW({onClick:l,onContextMenu:c,onPointerOut:f,onPointerOver:d},r,s),k=Z.useRef([]),H=Z.useRef([]);return s0(W=>{if(z.current.geometry=D,s)return;const F=k.current;if((x.length||x.length===0&&F!==null)&&(O.current.geometry=v(T,C)),k.current=x,x.length)return;const Y=H.current,K=V(W.raycaster);L(Y,K),K.join()!==Y.join()&&(O.current.geometry=v(K,[])),H.current=K}),ue.jsxs("group",{onClick:ee,onContextMenu:P,children:[ue.jsxs("mesh",{ref:z,children:[ue.jsx(Bn.meshBasicMaterial,{attach:"material-0",color:p.edge.fill,depthTest:!1,fog:!0,opacity:I,side:In,transparent:!0}),ue.jsx(Bn.meshBasicMaterial,{attach:"material-1",color:p.edge.activeFill,depthTest:!1,fog:!0,opacity:R,side:In,transparent:!0})]}),ue.jsxs("mesh",{ref:O,children:[ue.jsx(Bn.meshBasicMaterial,{attach:"material-0",color:p.edge.fill,depthTest:!1,fog:!0,opacity:I,side:In,transparent:!0}),ue.jsx(Bn.meshBasicMaterial,{attach:"material-1",color:p.edge.activeFill,depthTest:!1,fog:!0,opacity:R,side:In,transparent:!0})]}),a.map(W=>ue.jsx(tX,{animated:n,contextMenu:r,color:p.edge.label.color,disabled:s,edge:W,labelFontUrl:o,labelPlacement:t},W.id))]})},iX=({color:i="#D8E6EA",size:e=1,opacity:t=.5,animated:n,strokeWidth:r=5,innerRadius:s=4,segments:a=25})=>{const o=Z.useMemo(()=>new $e(i),[i]),{ringSize:l,ringOpacity:c}=_r({from:{ringOpacity:0,ringSize:[1e-5,1e-5,1e-5]},to:{ringOpacity:t,ringSize:[e/2,e/2,1]},config:{...xr,duration:n?void 0:0}}),f=r/10,d=s+f;return ue.jsx(g3,{position:[0,0,1],children:ue.jsxs(Bn.mesh,{scale:l,children:[ue.jsx("ringGeometry",{attach:"geometry",args:[s,d,a]}),ue.jsx(Bn.meshBasicMaterial,{attach:"material",color:o,transparent:!0,depthTest:!1,opacity:c,side:In,fog:!0})]})})},rX=({color:i,id:e,size:t,selected:n,opacity:r=1,animated:s})=>{const{scale:a,nodeOpacity:o}=_r({from:{scale:[1e-5,1e-5,1e-5],nodeOpacity:0},to:{scale:[t,t,t],nodeOpacity:r},config:{...xr,duration:s?void 0:0}}),l=Z.useMemo(()=>new $e(i),[i]),c=et(f=>f.theme);return ue.jsxs(ue.Fragment,{children:[ue.jsxs(Bn.mesh,{userData:{id:e,type:"node"},scale:a,children:[ue.jsx("sphereGeometry",{attach:"geometry",args:[1,25,25]}),ue.jsx(Bn.meshPhongMaterial,{attach:"material",side:In,transparent:!0,fog:!0,opacity:o,color:l,emissive:l,emissiveIntensity:.7})]}),ue.jsx(iX,{opacity:n?.5:0,size:t,animated:s,color:n?c.ring.activeFill:c.ring.fill})]})},sX=({image:i,id:e,size:t,opacity:n=1,animated:r})=>{const s=Z.useMemo(()=>new Q2().load(i),[i]),{scale:a,spriteOpacity:o}=_r({from:{scale:[1e-5,1e-5,1e-5],spriteOpacity:0},to:{scale:[t,t,t],spriteOpacity:n},config:{...xr,duration:r?void 0:0}});return ue.jsx(Bn.sprite,{userData:{id:e,type:"node"},scale:a,children:ue.jsx(Bn.spriteMaterial,{attach:"material",opacity:o,fog:!0,depthTest:!1,transparent:!0,side:In,children:ue.jsx("primitive",{attach:"map",object:s,minFilter:Pn})})})},aX=({animated:i,disabled:e,id:t,draggable:n=!1,labelFontUrl:r,contextMenu:s,onClick:a,onDoubleClick:o,onPointerOver:l,onDragged:c,onPointerOut:f,onContextMenu:d,renderNode:p,constrainDragging:m})=>{const v=x0(),x=et(ne=>ne.theme),_=et(ne=>ne.nodes.find(Be=>Be.id===t)),g=et(ne=>ne.edges),b=et(ne=>ne.draggingIds),S=et(ne=>ne.collapsedNodeIds),E=et(ne=>ne.addDraggingId),w=et(ne=>ne.removeDraggingId),T=et(ne=>ne.setHoveredNodeId),C=et(ne=>ne.setNodePosition),U=et(ne=>ne.setCollapsedNodeIds),D=et(ne=>ne.collapsedNodeIds.includes(t)),R=et(ne=>ne.actives?.includes(t)),I=et(ne=>ne.selections?.includes(t)),z=et(ne=>ne.selections?.length>0),O=et(ne=>ne.centerPosition),V=et(ne=>ne.clusters.get(_.cluster)),ee=b.includes(t),P=b.length>0,{position:L,label:k,subLabel:H,size:W=7,labelVisible:F=!0}=_,Y=Z.useRef(null),[K,j]=Z.useState(!1),[J,he]=Z.useState(!1),re=K||I||R,pe=z?re?x.node.selectedOpacity:x.node.inactiveOpacity:x.node.opacity,Oe=Z.useMemo(()=>g.filter(Be=>Be.source===t).length>0||D,[g,t,D]),be=Z.useCallback(()=>{Oe&&U(D?S.filter(ne=>ne!==t):[...S,t])},[Oe,S,t,D,U]),[{nodePosition:ve,labelPosition:ce}]=_r(()=>({from:{nodePosition:O?[O.x,O.y,0]:[0,0,0],labelPosition:[0,-(W+7),2]},to:{nodePosition:L?[L.x,L.y,re?L.z+1:L.z]:[0,0,0],labelPosition:[0,-(W+7),2]},config:{...xr,duration:i&&!P?void 0:0}}),[ee,L,i,W,re]),Ne=G3({draggable:n,position:L,bounds:m?V?.position:void 0,set:ne=>C(t,ne),onDragStart:()=>{E(t),j(!0)},onDragEnd:()=>{w(t),c?.(_)}});wl(K&&!P&&a!==void 0,"pointer"),wl(K&&n&&!ee&&a===void 0,"grab"),wl(ee,"grabbing");const G=re||ee,le=G?x.node.activeFill:_.fill||x.node.fill,{pointerOver:te,pointerOut:Me}=lb({disabled:e||ee,onPointerOver:ne=>{v.freeze(),j(!0),l?.(_,ne),T(t)},onPointerOut:ne=>{v.unFreeze(),j(!1),f?.(_,ne),T(null)}}),oe=Z.useMemo(()=>p?p({id:t,color:le,size:W,active:G,opacity:pe,animated:i,selected:I,node:_}):ue.jsx(ue.Fragment,{children:_.icon?ue.jsx(sX,{id:t,image:_.icon||"",size:W+8,opacity:pe,animated:i,color:le,node:_,active:G,selected:I}):ue.jsx(rX,{id:t,size:W,opacity:pe,animated:i,color:le,node:_,active:G,selected:I})}),[p,t,le,W,G,pe,i,I,_]),De=Z.useMemo(()=>F&&(F||I||K)&&k&&ue.jsxs(Bn.group,{position:ce,children:[ue.jsx(bu,{text:k,fontUrl:r,opacity:pe,stroke:x.node.label.stroke,backgroundColor:x.node.label.backgroundColor,backgroundOpacity:x.node.label.backgroundOpacity,padding:x.node.label.padding,strokeColor:x.node.label.strokeColor,strokeWidth:x.node.label.strokeWidth,radius:x.node.label.radius,active:I||K||ee||R,color:I||K||ee||R?x.node.label.activeColor:x.node.label.color}),H&&ue.jsx("group",{position:[0,-(W-3),0],children:ue.jsx(bu,{text:H,fontUrl:r,fontSize:5,opacity:pe,stroke:x.node.subLabel?.stroke,active:I||K||ee||R,color:I||K||ee||R?x.node.subLabel?.activeColor:x.node.subLabel?.color})})]}),[K,R,ee,I,k,r,ce,F,W,pe,H,x.node.label.activeColor,x.node.label.color,x.node.label.stroke,x.node.label.backgroundColor,x.node.label.backgroundOpacity,x.node.label.padding,x.node.label.strokeColor,x.node.label.strokeWidth,x.node.label.radius,x.node.subLabel?.activeColor,x.node.subLabel?.color,x.node.subLabel?.stroke]),_e=Z.useMemo(()=>J&&s&&ue.jsx(rb,{prepend:!0,center:!0,children:s({data:_,canCollapse:Oe,isCollapsed:D,onCollapse:be,onClose:()=>he(!1)})}),[J,s,_,Oe,D,be]);return ue.jsxs(Bn.group,{renderOrder:1,userData:{id:t,type:"node"},ref:Y,position:ve,onPointerOver:te,onPointerOut:Me,onClick:ne=>{!e&&!ee&&a?.(_,{canCollapse:Oe,isCollapsed:D},ne)},onDoubleClick:ne=>{!e&&!ee&&o?.(_,ne)},onContextMenu:()=>{e||(he(!0),d?.(_,{canCollapse:Oe,isCollapsed:D,onCollapse:be}))},...Ne(),children:[oe,_e,De]})};function V3(i,e){const t=e.position.z;i<t?i-=t:i+=t;const n=e.fov/e.zoom*Math.PI/180;return 2*Math.tan(n/2)*Math.abs(i)}function oX(i,e){return V3(i,e)*e.aspect}function _A(i,e){const t=oX(1,i),n=V3(1,i),r={x0:i?.position?.x-t/2,x1:i?.position?.x+t/2,y0:i?.position?.y-n/2,y1:i?.position?.y+n/2};return e?.x>r.x0&&e?.x<r.x1&&e?.y>r.y0&&e?.y<r.y1}function xA(i,e){return e.reduce((t,n)=>Math.abs(n-i%Math.PI)<Math.abs(t-i%Math.PI)?n:t)}function lX(i,e){const t=xA(i,[0,Math.PI]),n=xA(e,[Math.PI/2,3*Math.PI/2]);return{horizontalRotation:t-i%Math.PI,verticalRotation:n-e%Math.PI}}const em=50,cX=({animated:i,disabled:e,layoutType:t})=>{const n=et(x=>x.nodes),[r,s]=Z.useState(!1),a=Jn(x=>x.invalidate),{controls:o}=x0(),l=Jn(x=>x.camera),c=Z.useRef(!1),f=Z.useCallback(async(x,_)=>{const g=_?.animated!==void 0?_?.animated:!0,b=_?.centerOnlyIfNodesNotInView!==void 0?_?.centerOnlyIfNodesNotInView:!1;if(!c.current||!b||b&&x?.some(S=>!_A(l,S.position))){const{x:S,y:E,z:w}=qf(x);await o.normalizeRotations().setTarget(S,E,w,g),r||s(!0),a()}},[a,o,n]),d=Z.useCallback(async(x,_={animated:!0,fitOnlyIfNodesNotInView:!1})=>{const{fitOnlyIfNodesNotInView:g}=_;if(!g||g&&x?.some(b=>!_A(l,b.position))){const{minX:b,maxX:S,minY:E,maxY:w,minZ:T,maxZ:C}=qf(x);if(!t.includes("3d")){const{horizontalRotation:U,verticalRotation:D}=lX(o?.azimuthAngle,o?.polarAngle);o?.rotate(U,D,!0)}await o?.zoomTo(1,_?.animated),await o?.fitToBox(new Qn(new Q(b,E,T),new Q(S,w,C)),_?.animated,{cover:!1,paddingLeft:em,paddingRight:em,paddingBottom:em,paddingTop:em})}},[l,o,t]),p=Z.useCallback(x=>{let _=null;return x?.length&&(_=x.reduce((g,b)=>{const S=n.find(E=>E.id===b);if(S)g.push(S);else throw new Error(`Attempted to center ${b} but it was not found in the nodes`);return g},[])),_},[n]),m=Z.useCallback((x,_)=>{const g=p(x);f(g||n,{animated:i,centerOnlyIfNodesNotInView:_?.centerOnlyIfNodesNotInView})},[i,f,p,n]),v=Z.useCallback(async(x,_)=>{const g=p(x);await d(g||n,{animated:i,..._})},[i,d,p,n]);return Z.useLayoutEffect(()=>{async function x(){o&&n?.length&&(c.current||(await f(n,{animated:!1}),await d(n,{animated:!1}),c.current=!0))}x()},[o,f,n,i,l,d]),{centerNodes:f,centerNodesById:m,fitNodesInViewById:v,isCentered:r}},uX=i=>i.reduceEdges((e,t,n,r,s)=>{const a=`${r}-${s}`,o={id:t,source:r,target:s,...n},l=e.get(a);return l?l.push(o):e.set(a,[o]),e},new Map),hX=(i,e)=>{if(!i||i.size===0)return[];const t=uX(i),n=[],r=e==="all"||e==="edges";for(const[s,a]of t){const[o,l]=s.split("-"),c=a[0];if(!o||!l||!c)continue;const f=c.size||1,d=f+a.length*f*.5,p=a.length>1,m=p?`${a.length} edges`:c.label,v={...c,source:o,target:l,label:m,labelVisible:r,size:d,data:{...c.data||{},originalEdges:a,count:a.length,isAggregated:p,originalSize:f}};n.push(v)}return n},fX=Z.forwardRef(({onNodeClick:i,onNodeDoubleClick:e,onNodeContextMenu:t,onEdgeContextMenu:n,onEdgeClick:r,onEdgePointerOver:s,onEdgePointerOut:a,onNodePointerOver:o,onNodePointerOut:l,onClusterClick:c,onNodeDragged:f,onClusterDragged:d,onClusterPointerOver:p,onClusterPointerOut:m,contextMenu:v,animated:x,disabled:_,draggable:g,constrainDragging:b=!1,edgeLabelPosition:S,edgeArrowPosition:E,edgeInterpolation:w="linear",labelFontUrl:T,renderNode:C,onRenderCluster:U,aggregateEdges:D,...R},I)=>{const{layoutType:z,clusterAttribute:O,labelType:V}=R,ee=Jn(ce=>ce.gl),P=Jn(ce=>ce.scene),L=Jn(ce=>ce.camera),{updateLayout:k}=VW({...R,constrainDragging:b});if(O&&!(z==="forceDirected2d"||z==="forceDirected3d"))throw new Error("Clustering is only supported for the force directed layouts.");const H=et(ce=>ce.graph),W=et(ce=>ce.nodes),F=et(ce=>ce.edges),Y=et(ce=>ce.setEdges),K=et(ce=>[...ce.clusters.values()]),j=Z.useMemo(()=>D?hX(H,V):F,[F,D,H,V]);Z.useEffect(()=>{D&&F.length!==j.length&&Y(j)},[j,F.length,Y,D]);const{centerNodesById:J,fitNodesInViewById:he,isCentered:re}=cX({animated:x,disabled:_,layoutType:z});Z.useImperativeHandle(I,()=>({centerGraph:J,fitNodesInView:he,graph:H,renderScene:()=>ee.render(P,L)}),[J,he,H,ee,P,L]);const pe=Z.useCallback(ce=>{f?.(ce),O&&k()},[O,f,k]),Oe=Z.useMemo(()=>W.map(ce=>ue.jsx(aX,{id:ce?.id,labelFontUrl:T,draggable:g,constrainDragging:b,disabled:_,animated:x,contextMenu:v,renderNode:C,onClick:i,onDoubleClick:e,onContextMenu:t,onPointerOver:o,onPointerOut:l,onDragged:pe},ce?.id)),[b,x,v,_,g,T,W,i,t,e,pe,l,o,C]),be=Z.useMemo(()=>x?j.map(ce=>ue.jsx(KW,{id:ce.id,disabled:_,animated:x,labelFontUrl:T,labelPlacement:S,arrowPlacement:E,interpolation:w,contextMenu:v,onClick:r,onContextMenu:n,onPointerOver:s,onPointerOut:a},ce.id)):ue.jsx(nX,{edges:j,disabled:_,animated:x,labelFontUrl:T,labelPlacement:S,arrowPlacement:E,interpolation:w,contextMenu:v,onClick:r,onContextMenu:n,onPointerOver:s,onPointerOut:a}),[x,v,_,E,w,S,j,T,r,n,a,s]),ve=Z.useMemo(()=>K.map(ce=>ue.jsx(XW,{animated:x,disabled:_,draggable:g,labelFontUrl:T,onClick:c,onPointerOver:p,onPointerOut:m,onDragged:d,onRender:U,...ce},ce.label)),[x,K,_,g,T,c,m,p,d,U]);return re&&ue.jsxs(Z.Fragment,{children:[be,Oe,ve]})});di.install({THREE:{MOUSE:SA,Vector2:Ge,Vector3:Q,Vector4:kt,Quaternion:_i,Matrix4:bt,Spherical:fC,Box3:Qn,Sphere:ri,Raycaster:x1,MathUtils:{DEG2RAD:Jm?.DEG2RAD,clamp:Jm?.clamp}}});IC({ThreeCameraControls:di});const dX=Z.forwardRef(({mode:i="rotate",children:e,animated:t,disabled:n,minDistance:r=1e3,maxDistance:s=5e4},a)=>{const o=Z.useRef(null),l=Jn(O=>O.camera),c=Jn(O=>O.gl),f=i==="orbit",d=et(O=>O.setPanning),p=et(O=>O.draggingIds.length>0),m=Z.useRef(0),[v,x]=Z.useState(!1);s0((O,V)=>{o.current?.enabled&&o.current?.update(V),f&&(o.current.azimuthAngle+=20*V*Jm.DEG2RAD)},-1),Z.useEffect(()=>()=>o.current?.dispose(),[]);const _=Z.useCallback(()=>{o.current?.zoom(l.zoom/2,t)},[t,l.zoom]),g=Z.useCallback(()=>{o.current?.zoom(-l.zoom/2,t)},[t,l.zoom]),b=Z.useCallback(O=>{o.current?.dolly(O,t)},[t]),S=Z.useCallback(O=>{o.current?.dolly(O,t)},[t]),E=Z.useCallback(O=>{f||o.current?.truck(-.03*O.deltaTime,0,t)},[t,f]),w=Z.useCallback(O=>{f||o.current?.truck(.03*O.deltaTime,0,t)},[t,f]),T=Z.useCallback(O=>{f||o.current?.truck(0,.03*O.deltaTime,t)},[t,f]),C=Z.useCallback(O=>{f||o.current?.truck(0,-.03*O.deltaTime,t)},[t,f]),U=Z.useCallback(O=>{O.code==="Space"&&(i==="rotate"?o.current.mouseButtons.left=di.ACTION.TRUCK:o.current.mouseButtons.left=di.ACTION.ROTATE)},[i]),D=Z.useCallback(O=>{O.code==="Space"&&(i==="rotate"?o.current.mouseButtons.left=di.ACTION.ROTATE:o.current.mouseButtons.left=di.ACTION.TRUCK)},[i]),[R,I]=Z.useState(null);Z.useEffect(()=>{ob||I({leftKey:new $p("ArrowLeft",100),rightKey:new $p("ArrowRight",100),upKey:new $p("ArrowUp",100),downKey:new $p("ArrowDown",100)})},[]),Z.useEffect(()=>(!n&&R&&(R.leftKey.addEventListener("holding",w),R.rightKey.addEventListener("holding",E),R.upKey.addEventListener("holding",T),R.downKey.addEventListener("holding",C),window.addEventListener("keydown",U),window.addEventListener("keyup",D)),()=>{R&&(R.leftKey.removeEventListener("holding",w),R.rightKey.removeEventListener("holding",E),R.upKey.removeEventListener("holding",T),R.downKey.removeEventListener("holding",C),window.removeEventListener("keydown",U),window.removeEventListener("keyup",D))}),[n,U,D,C,w,E,T,R]),Z.useEffect(()=>{n?(o.current.mouseButtons.left=di.ACTION.NONE,o.current.mouseButtons.middle=di.ACTION.NONE,o.current.mouseButtons.wheel=di.ACTION.NONE):(o.current.mouseButtons.left=di.ACTION.TRUCK,o.current.mouseButtons.middle=di.ACTION.TRUCK,o.current.mouseButtons.wheel=di.ACTION.DOLLY)},[n]),Z.useEffect(()=>{const O=()=>d(!0),V=()=>d(!1),ee=o.current;return ee&&(ee.addEventListener("control",O),ee.addEventListener("controlend",V)),()=>{ee&&(ee.removeEventListener("control",O),ee.removeEventListener("controlend",V))}},[o,d]),Z.useEffect(()=>{p?(o.current.mouseButtons.left=di.ACTION.NONE,o.current.touches.one=di.ACTION.NONE):i==="rotate"?(o.current.mouseButtons.left=di.ACTION.ROTATE,o.current.touches.one=di.ACTION.TOUCH_ROTATE):(o.current.touches.one=di.ACTION.TOUCH_TRUCK,o.current.mouseButtons.left=di.ACTION.TRUCK)},[p,i]);const z=Z.useMemo(()=>({controls:o.current,zoomIn:()=>_(),zoomOut:()=>g(),dollyIn:(O=1e3)=>b(O),dollyOut:(O=-1e3)=>S(O),panLeft:(O=100)=>w({deltaTime:O}),panRight:(O=100)=>E({deltaTime:O}),panDown:(O=100)=>C({deltaTime:O}),panUp:(O=100)=>T({deltaTime:O}),resetControls:O=>o.current?.normalizeRotations().reset(O),freeze:()=>{o.current.truckSpeed&&(m.current=o.current.truckSpeed),o.current.truckSpeed=0},unFreeze:()=>o.current.truckSpeed=m.current}),[_,g,w,E,C,T,o.current]);return Z.useImperativeHandle(a,()=>z),ue.jsxs(H3.Provider,{value:z,children:[ue.jsx("threeCameraControls",{ref:O=>{o.current=O,v||x(!0)},args:[l,c.domElement],smoothTime:.1,minDistance:r,dollyToCursor:!0,maxDistance:s}),e]})}),W3={canvas:{background:"#fff"},node:{fill:"#7CA0AB",activeFill:"#1DE9AC",opacity:1,selectedOpacity:1,inactiveOpacity:.2,label:{color:"#2A6475",stroke:"#fff",activeColor:"#1DE9AC"},subLabel:{color:"#ddd",stroke:"transparent",activeColor:"#1DE9AC"}},lasso:{border:"1px solid #55aaff",background:"rgba(75, 160, 255, 0.1)"},ring:{fill:"#D8E6EA",activeFill:"#1DE9AC"},edge:{fill:"#D8E6EA",activeFill:"#1DE9AC",opacity:1,selectedOpacity:1,inactiveOpacity:.1,label:{stroke:"#fff",color:"#2A6475",activeColor:"#1DE9AC",fontSize:6},subLabel:{color:"#ddd",stroke:"transparent",activeColor:"#1DE9AC"}},arrow:{fill:"#D8E6EA",activeFill:"#1DE9AC"},cluster:{stroke:"#D8E6EA",opacity:1,selectedOpacity:1,inactiveOpacity:.1,label:{stroke:"#fff",color:"#2A6475"}}};function F_(i,e,t){e=Array.isArray(e)?e:[e];const n=[],r=[];for(const s of e){const a=[...i.inEdgeEntries(s)??[],...i.outEdgeEntries(s)??[]];if(a)for(const o of a){const l=o.attributes.id;if(t==="in"?o.target===s&&!r.includes(l)&&r.push(l):t==="out"?o.source===s&&!r.includes(l)&&r.push(l):r.includes(l)||r.push(l),t==="out"||t==="all"){const c=o.target;n.includes(c)||n.push(c)}(t==="in"||t==="all")&&(n.includes(o.source)||n.push(o.source))}}return{nodes:n,edges:r}}function tm(i,e,t){const{offsetX:n,offsetY:r}=i,{width:s,height:a}=t;e.set(n/s*2-1,-(r/a)*2+1)}function pX(i){const e=document.createElement("div");return e.style.pointerEvents="none",e.style.border=i.lasso.border,e.style.backgroundColor=i.lasso.background,e.style.position="fixed",e}const mX=({children:i,type:e="none",onLasso:t,onLassoEnd:n,disabled:r})=>{const s=et(I=>I.theme),a=Jn(I=>I.camera),o=Jn(I=>I.gl),l=Jn(I=>I.setEvents),c=Jn(I=>I.size),f=Jn(I=>I.get),d=Jn(I=>I.scene),p=x0(),m=et(I=>I.actives),v=et(I=>I.setActives),x=et(I=>I.edges),_=et(I=>I.edgeMeshes),g=Z.useRef(null),b=Z.useRef(null),S=Z.useRef(pX(s)),E=Z.useRef(null),w=Z.useRef(!1),T=Z.useRef(f().events.enabled),C=Z.useRef(p.controls?.enabled),U=Z.useCallback(I=>{if(w.current){const[z,O,V]=E.current;V.x=Math.max(z.x,I.clientX),V.y=Math.max(z.y,I.clientY),O.x=Math.min(z.x,I.clientX),O.y=Math.min(z.y,I.clientY),S.current.style.left=`${O.x}px`,S.current.style.top=`${O.y}px`,S.current.style.width=`${V.x-O.x}px`,S.current.style.height=`${V.y-O.y}px`,tm(I,g.current.endPoint,c),tm(I,b.current.endPoint,c);const ee=[],P=b.current.select().sort(k=>k.uuid).map(k=>x[_.indexOf(k)].id);ee.push(...P);const L=g.current.select().sort(k=>k.uuid).filter(k=>k.isMesh&&k.userData?.id&&(k.userData?.type===e||e==="all")).map(k=>k.userData.id);ee.push(...L),requestAnimationFrame(()=>{v(ee),t?.(ee)}),document.addEventListener("pointermove",U,{passive:!0,capture:!0,once:!0})}},[c,x,_,e,v,t]),D=Z.useCallback(()=>{w.current&&(l({enabled:T.current}),w.current=!1,S.current.parentElement?.removeChild(S.current),p.controls.enabled=C.current,n?.(m),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",D))},[l,p.controls,n,m,U]),R=Z.useCallback(I=>{if(I.shiftKey){T.current=f().events.enabled,C.current=p.controls?.enabled,g.current=new kT(a,d);const z=new zg;_.length&&z.add(..._),b.current=new kT(a,z),E.current=[new Ge,new Ge,new Ge];const[O]=E.current;p.controls.enabled=!1,l({enabled:!1}),w.current=!0,o.domElement.parentElement?.appendChild(S.current),S.current.style.left=`${I.clientX}px`,S.current.style.top=`${I.clientY}px`,S.current.style.width="0px",S.current.style.height="0px",O.x=I.clientX,O.y=I.clientY,tm(I,g.current.startPoint,c),tm(I,b.current.startPoint,c),document.addEventListener("pointermove",U,{passive:!0,capture:!0,once:!0}),document.addEventListener("pointerup",D,{passive:!0})}},[a,p.controls,_,f,o.domElement.parentElement,U,D,d,l,c]);return Z.useEffect(()=>{if(!(r||e==="none"))return typeof window<"u"&&(document.addEventListener("pointerdown",R,{passive:!0}),document.addEventListener("pointermove",U,{passive:!0}),document.addEventListener("pointerup",D,{passive:!0})),()=>{typeof window<"u"&&(document.removeEventListener("pointerdown",R),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",D))}},[e,r,R,U,D]),ue.jsx("group",{children:i})},gX="_canvas_670zp_1",vX={canvas:gX},yX={alpha:!0,antialias:!0},_X={position:[0,0,1e3],near:5,far:5e4,fov:10},xX=Z.forwardRef(({cameraMode:i="pan",layoutType:e="forceDirected2d",sizingType:t="default",labelType:n="auto",theme:r=W3,animated:s=!0,defaultNodeSize:a=7,minNodeSize:o=5,maxNodeSize:l=15,lassoType:c="none",glOptions:f={},edges:d,children:p,nodes:m,minDistance:v,maxDistance:x,onCanvasClick:_,disabled:g,onLasso:b,onLassoEnd:S,aggregateEdges:E,...w},T)=>{const C=Z.useRef(null),U=Z.useRef(null),D=Z.useRef(null);Z.useImperativeHandle(T,()=>({centerGraph:(P,L)=>C.current?.centerGraph(P,L),fitNodesInView:(P,L)=>C.current?.fitNodesInView(P,L),zoomIn:()=>U.current?.zoomIn(),zoomOut:()=>U.current?.zoomOut(),dollyIn:P=>U.current?.dollyIn(P),dollyOut:P=>U.current?.dollyOut(P),panLeft:()=>U.current?.panLeft(),panRight:()=>U.current?.panRight(),panDown:()=>U.current?.panDown(),panUp:()=>U.current?.panUp(),resetControls:P=>U.current?.resetControls(P),getControls:()=>U.current?.controls,getGraph:()=>C.current?.graph,exportCanvas:()=>(C.current.renderScene(),D.current.toDataURL()),freeze:()=>U.current?.freeze(),unFreeze:()=>U.current?.unFreeze()}));const{selections:R,actives:I,collapsedNodeIds:z}=w,O=d.length+m.length>400?!1:s,V=Z.useMemo(()=>({...f,...yX}),[f]),ee=Z.useRef(z3({selections:R,actives:I,theme:r,collapsedNodeIds:z})).current;return ue.jsx("div",{className:vX.canvas,children:ue.jsx(N5,{legacy:!0,linear:!0,ref:D,flat:!0,gl:V,camera:_X,onPointerMissed:_,children:ue.jsxs(GW,{store:ee,children:[r.canvas?.background&&ue.jsx("color",{attach:"background",args:[r.canvas.background]}),ue.jsx("ambientLight",{intensity:1}),p,r.canvas?.fog&&ue.jsx("fog",{attach:"fog",args:[r.canvas.fog,4e3,9e3]}),ue.jsx(dX,{mode:i,ref:U,disabled:g,minDistance:v,maxDistance:x,animated:s,children:ue.jsx(mX,{disabled:g,type:c,onLasso:b,onLassoEnd:S,children:ue.jsx(Z.Suspense,{children:ue.jsx(fX,{ref:C,disabled:g,animated:O,edges:d,nodes:m,layoutType:e,sizingType:t,labelType:n,defaultNodeSize:a,minNodeSize:o,maxNodeSize:l,aggregateEdges:E,...w})})})})]})})})}),bX=({selections:i=[],nodes:e=[],actives:t=[],focusOnSelect:n=!0,type:r="single",pathHoverType:s="out",pathSelectionType:a="direct",ref:o,disabled:l,onSelection:c})=>{const[f,d]=Z.useState([]),[p,m]=Z.useState(t),[v,x]=Z.useState(i),[_,g]=Z.useState(!1),b=r==="multi"||r==="multiModifier",S=Z.useCallback(L=>{if(!l&&L){L=Array.isArray(L)?L:[L];const k=L.filter(H=>!v.includes(H));if(k.length){const H=[...v,...k];c?.(H),x(H)}}},[l,v,c]),E=Z.useCallback(L=>{if(!l&&L){L=Array.isArray(L)?L:[L];const k=v.filter(H=>!L.includes(H));c?.(k),x(k)}},[l,v,c]),w=Z.useCallback((L=[])=>{l||(L=Array.isArray(L)?L:[L],m([]),x(L),c?.(L))},[l,c]),T=Z.useCallback(L=>{v.includes(L)?E(L):b?S(L):w(L)},[S,w,v,b,E]),C=Z.useCallback(L=>{if(b?r==="multiModifier"?_?S(L.id):w(L.id):S(L.id):w(L.id),n===!0||n==="singleOnly"&&!_){if(!o.current)throw new Error("No ref found for the graph canvas.");const k=o.current.getGraph(),{nodes:H}=F_(k,[L.id],a);o.current.fitNodesInView([L.id,...H],{fitOnlyIfNodesNotInView:!0})}},[S,w,n,b,_,a,o,r]),U=Z.useCallback((L,k)=>{const H=o.current.getGraph();if(!H)throw new Error("Graph is not initialized");const W=kW(H,L,k);w([L,k]);const F=[];for(let Y=0;Y<W.length-1;Y++){const K=W[Y],j=W[Y+1],J=H.getEdgeAttributes(K,j);J&&F.push(J.id)}m([...W.map(Y=>Y),...F])},[w,o]),D=Z.useCallback(L=>{const k=L.target,H=gA(k),W=L.metaKey||L.ctrlKey;H&&W&&g(!0)},[]),R=Z.useCallback(L=>{const k=L.target,H=gA(k),W=["Meta","Control"].includes(L.key);H&&W&&g(!1)},[]);Z.useEffect(()=>(typeof window<"u"&&(window.addEventListener("keydown",D),window.addEventListener("keyup",R)),()=>{typeof window<"u"&&(window.removeEventListener("keydown",D),window.removeEventListener("keyup",R))}),[D,R]);const I=Z.useCallback(L=>{if(L.button!==2&&(v.length||p.length)&&(w(),g(!1),n&&v.length===1)){if(!o.current)throw new Error("No ref found for the graph canvas.");o.current.fitNodesInView([],{fitOnlyIfNodesNotInView:!0})}},[w,n,p.length,v.length,o]),z=Z.useCallback(L=>{m(L)},[]),O=Z.useCallback(L=>{w(L)},[w]),V=Z.useCallback(L=>{if(s){const k=o.current.getGraph();if(!k)throw new Error("No ref found for the graph canvas.");const{nodes:H,edges:W}=F_(k,[L.id],s);d([...H,...W])}},[s,o]),ee=Z.useCallback(()=>{s&&d([])},[s]);return Z.useEffect(()=>{if(a!=="direct"&&v.length>0){const L=o.current?.getGraph();if(L){const{nodes:k,edges:H}=F_(L,v,a);m([...k,...H])}}},[v,a,o]),{actives:Z.useMemo(()=>[...p,...f],[p,f]),onNodeClick:C,onNodePointerOver:V,onNodePointerOut:ee,onLasso:z,onLassoEnd:O,selectNodePaths:U,onCanvasClick:I,selections:v,clearSelections:w,addSelection:S,removeSelection:E,toggleSelection:T,setSelections:x}},SX=""+new URL("NotoSans-Regular-D96CXwz4.ttf",import.meta.url).href,EX=Z.memo(({data:i,onCollapse:e,isCollapsed:t,canCollapse:n,onClose:r})=>{const{t:s}=bg(["network","zigbee","common"]);let a;if(i.parent){const o=i.parent.lastIndexOf(` - ${s("children")}`);a=o>-1?i.parent.slice(0,o):i.parent}return ue.jsx("div",{className:"card bg-base-100 shadow-sm",children:ue.jsxs("div",{className:"card-body",children:[ue.jsx("h2",{className:"card-title",children:i.friendlyName}),ue.jsx("span",{children:i.type}),ue.jsx("span",{title:s("zigbee:ieee_address"),children:i.ieeeAddr}),ue.jsxs("span",{title:s("zigbee:network_address_hex"),className:"justify-self-end",children:[VU(i.networkAddress,4)," | ",ue.jsx("span",{title:s("zigbee:network_address_dec"),children:i.networkAddress})]}),a&&ue.jsxs("span",{children:[s("parent"),": ",a]}),i.failed&&i.failed.length>0&&ue.jsxs("div",{className:"badge badge-ghost",children:[ue.jsx(Yn,{icon:WU,className:"text-error",beatFade:!0}),s("common:failed"),": ",i.failed]}),ue.jsxs("div",{className:"card-actions justify-end mt-2",children:[n&&ue.jsx(Lr,{className:"btn btn-square btn-primary",onClick:e,children:ue.jsx(Yn,{icon:t?XU:jU})}),ue.jsx(Lr,{className:"btn btn-square btn-neutral",onClick:r,children:ue.jsx(Yn,{icon:qU})})]})]})})}),bA=Z.memo(i=>{const{label:e,icon:t,onChange:n,onSubmit:r,defaultValue:s,...a}=i,[o,l]=Z.useState(s);Z.useEffect(()=>{l(s)},[s]);const c=Z.useCallback(d=>{l(d.target.value?d.target.valueAsNumber:""),n?.(d)},[n]),f=Z.useCallback(d=>{r?.(o,!d.target.validationMessage)},[r,o]);return ue.jsxs("div",{className:"flex flex-row flex-wrap items-center gap-2 bg-base-100 rounded-box px-2 pb-1",title:e,children:[ue.jsx(Yn,{icon:t}),ue.jsxs("div",{className:"",children:[ue.jsx("input",{className:"range range-xs",onChange:c,onTouchEnd:f,onMouseUp:f,...a,type:"range",value:o}),ue.jsxs("div",{className:"flex justify-between px-1 mt-1 text-xs",children:[ue.jsx("span",{children:i.min}),ue.jsx("span",{children:o}),ue.jsx("span",{children:i.max})]})]})]})}),MX=Z.memo(({graphRef:i,layoutType:e,onLayoutTypeChange:t,labelType:n,onLabelTypeChange:r,nodeStrength:s,onNodeStrengthChange:a,linkDistance:o,onLinkDistanceChange:l,nodes:c,showParents:f,setShowParents:d,showChildren:p,setShowChildren:m,showSiblings:v,setShowSiblings:x,showIcons:_,setShowIcons:g})=>{const{t:b}=bg("network"),S=Z.useMemo(()=>{const T=c.map(C=>[C.id,C.data.type!=="Coordinator"?`${C.data.type[0]} - ${C.label}`:C.label]);return T.sort(([,C],[,U])=>C.localeCompare(U)),T.map(([C,U])=>ue.jsx("option",{value:C,children:U},C))},[c]),E=Z.useCallback(()=>{i.current&&YU(i.current.exportCanvas(),`network-map-${Date.now()}.png`)},[i]),w=Z.useCallback(T=>{if(T.target.value){const C=[T.target.value];i.current?.centerGraph(C),i.current?.fitNodesInView(C)}},[i]);return ue.jsxs(ue.Fragment,{children:[ue.jsxs("div",{className:"absolute z-9 top-0 left-0 p-1 flex flex-row flex-wrap gap-1 items-start max-w-[calc(100vw-19rem)] md:max-w-none",children:[ue.jsx(Lr,{title:b("download_image"),className:"btn btn-square btn-neutral btn-sm",onClick:E,children:ue.jsx(Yn,{icon:ZU})}),ue.jsx(Lr,{title:b("reset_controls"),className:"btn btn-square btn-neutral btn-sm",onClick:()=>{i.current?.resetControls()},children:ue.jsx(Yn,{icon:KU})}),ue.jsx(Lr,{title:b("fit_view"),className:"btn btn-square btn-neutral btn-sm",onClick:()=>{i.current?.centerGraph(),i.current?.fitNodesInView()},children:ue.jsx(Yn,{icon:JU})}),ue.jsx(Lr,{title:b("zoom_in"),className:"btn btn-square btn-neutral btn-sm",onClick:()=>{i.current?.zoomIn()},children:ue.jsx(Yn,{icon:QU})}),ue.jsx(Lr,{title:b("zoom_out"),className:"btn btn-square btn-neutral btn-sm",onClick:()=>{i.current?.zoomOut()},children:ue.jsx(Yn,{icon:$U})}),ue.jsx(Lr,{className:`btn btn-square btn-neutral btn-sm ${f?"":"btn-outline"}`,item:!f,onClick:d,title:b("parent"),children:ue.jsx(Yn,{icon:tu,style:{color:bl[ni.NeighborIsParent]}})}),ue.jsx(Lr,{className:`btn btn-square btn-neutral btn-sm ${p?"":"btn-outline"}`,item:!p,onClick:m,title:b("child"),children:ue.jsx(Yn,{icon:tu,style:{color:bl[ni.NeighborIsAChild]}})}),ue.jsx(Lr,{className:`btn btn-square btn-neutral btn-sm ${v?"":"btn-outline"}`,item:!v,onClick:x,title:b("sibling"),children:ue.jsx(Yn,{icon:tu,style:{color:bl[ni.NeighborIsASibling]}})}),ue.jsx(Lr,{className:`btn btn-square btn-neutral btn-sm ${_?"":"btn-outline"}`,item:!_,onClick:g,title:b("icons"),children:ue.jsx(Yn,{icon:eO})}),ue.jsxs("select",{className:"select select-sm w-36",title:b("find_node"),defaultValue:"",onChange:w,children:[ue.jsx("option",{value:"",children:b("find_node")}),S]})]}),ue.jsxs("div",{className:"absolute z-9 top-0 right-0 p-1 flex flex-row flex-wrap gap-1 items-start justify-end",children:[ue.jsxs("select",{className:"select select-sm w-36",title:b("layout_type"),value:e,onChange:t,children:[ue.jsx("option",{value:"",disabled:!0,children:b("layout_type")}),ue.jsx("option",{value:"forceDirected2d",children:"forceDirected2d"}),ue.jsx("option",{value:"forceDirected3d",children:"forceDirected3d"}),ue.jsx("option",{value:"radialOut2d",children:"radialOut2d"}),ue.jsx("option",{value:"radialOut3d",children:"radialOut3d"}),ue.jsx("option",{value:"concentric2d",children:"concentric2d"})]}),ue.jsxs("select",{className:"select select-sm w-36",title:b("label_type"),value:n,onChange:r,children:[ue.jsx("option",{value:"",disabled:!0,children:b("label_type")}),ue.jsx("option",{value:"all",children:"all"}),ue.jsx("option",{value:"auto",children:"auto"}),ue.jsx("option",{value:"none",children:"none"}),ue.jsx("option",{value:"nodes",children:"nodes"}),ue.jsx("option",{value:"edges",children:"edges"})]})]}),ue.jsxs("div",{className:"absolute z-9 bottom-0 left-0 p-1 flex flex-row flex-wrap gap-1 items-end",children:[ue.jsx(bA,{name:"node_strength",label:b("node_strength"),icon:tO,onSubmit:(T,C)=>C&&typeof T=="number"&&a(T),min:-1e3,max:-100,step:10,defaultValue:s}),ue.jsx(bA,{name:"link_distance",label:b("link_distance"),icon:nO,onSubmit:(T,C)=>C&&typeof T=="number"&&l(T),min:10,max:200,step:5,defaultValue:o})]}),ue.jsx("div",{className:"absolute z-9 bottom-0 right-0 p-1 flex flex-row flex-wrap gap-1 items-end justify-end",children:ue.jsx(Lr,{title:b("scroll_to_top"),className:"btn btn-primary btn-square ml-auto",onClick:()=>{window.scrollTo(0,0)},children:ue.jsx(Yn,{icon:iO})})})]})}),wX=Z.memo(()=>{const{t:i}=bg("network");return ue.jsxs("details",{className:"collapse collapse-arrow rounded-b-none",children:[ue.jsx("summary",{className:"collapse-title font-semibold",children:i("legend")}),ue.jsxs("div",{className:"collapse-content text-sm",children:[ue.jsxs("div",{className:"flex flex-row flex-wrap gap-3 mb-2",children:[ue.jsxs("div",{children:[ue.jsxs("p",{children:[i("nodes"),":"]}),ue.jsxs("ul",{className:"list-none list-inside",children:[ue.jsxs("li",{style:{color:nm.Coordinator},children:[ue.jsx(Yn,{icon:Iv})," Coordinator"]}),ue.jsxs("li",{style:{color:nm.Router},children:[ue.jsx(Yn,{icon:Iv})," Router"]}),ue.jsxs("li",{style:{color:nm.EndDevice},children:[ue.jsx(Yn,{icon:Iv})," EndDevice"]})]})]}),ue.jsxs("div",{children:[ue.jsxs("p",{children:[i("edges"),":"]}),ue.jsxs("ul",{className:"list-none list-inside",children:[ue.jsxs("li",{style:{color:bl[ni.NeighborIsParent]},children:[ue.jsx(Yn,{icon:tu})," ",i("parent")]}),ue.jsxs("li",{style:{color:bl[ni.NeighborIsAChild]},children:[ue.jsx(Yn,{icon:tu})," ",i("child")]}),ue.jsxs("li",{style:{color:bl[ni.NeighborIsASibling]},children:[ue.jsx(Yn,{icon:tu})," ",i("sibling")]})]})]})]}),ue.jsx("p",{children:i("legend_node_siblings")}),ue.jsx("p",{children:i("legend_node_size")}),ue.jsx("p",{children:i("legend_node_select")}),ue.jsx("p",{children:i("legend_node_fold")}),ue.jsx("p",{children:i("legend_edge_toggle")}),ue.jsx("p",{className:"text-xs mt-2",children:"Known issues:"}),ue.jsxs("ul",{className:"list-disc list-inside text-xs",children:[ue.jsx("li",{children:"Edge colors are currently not working"}),ue.jsx("li",{children:"An undesired vertical offset is applied when starting to drag a node"})]})]})]})}),kX=Z.memo(({map:i})=>{const{t:e}=bg("network"),t=rO(P=>P.devices),[n,r]=Z.useState(vs.get(WS,"forceDirected2d")),[s,a]=Z.useState(vs.get(XS,"all")),[o,l]=Z.useState(vs.get(jS,-750)),[c,f]=Z.useState(vs.get(qS,50)),[d,p]=Z.useState(!0),[m,v]=Z.useState(!0),[x,_]=Z.useState(!0),[g,b]=Z.useState(vs.get(YS,!1)),S=Z.useRef(null),E=Z.useMemo(()=>{const P=new OffscreenCanvas(1,1).getContext("2d"),L=getComputedStyle(document.documentElement),k=uh(P,L.getPropertyValue("--color-base-100")),H=uh(P,L.getPropertyValue("--color-base-200")),W=uh(P,L.getPropertyValue("--color-base-content")),F=uh(P,L.getPropertyValue("--color-primary")),Y=uh(P,L.getPropertyValue("--color-accent"));return sO({},W3,{canvas:{background:k},node:{activeFill:Y,label:{color:W,stroke:H,activeColor:Y},subLabel:{color:W,stroke:"transparent",activeColor:Y}},lasso:{border:`1px solid ${F}`,background:"rgba(75, 160, 255, 0.1)"},ring:{fill:W,activeFill:Y},edge:{fill:W,activeFill:Y,label:{stroke:H,color:W,activeColor:Y},subLabel:{color:W,stroke:"transparent",activeColor:Y}},arrow:{fill:W,activeFill:Y},cluster:{stroke:W,label:{stroke:H,color:W}}})},[]),[w,T]=Z.useMemo(()=>{const P=[],L=[],k=[];for(const F of i.nodes){const Y=t.find(he=>he.ieee_address===F.ieeeAddr),K=i.links.find(he=>he.relationship===ni.NeighborIsParent&&he.target.ieeeAddr===F.ieeeAddr);let j=K?i.nodes.find(he=>he.ieeeAddr===K.source.ieeeAddr)?.friendlyName:void 0;if(!K){const he=i.links.find(re=>re.relationship===ni.NeighborIsAChild&&re.source.ieeeAddr===F.ieeeAddr);j=he?i.nodes.find(re=>re.ieeeAddr===he.target.ieeeAddr)?.friendlyName:void 0,j&&(j+=` - ${e("children")}`)}let J;g&&Y&&(J=Y.definition?.icon??aO(Y),J===oO&&(J=void 0)),P.push({id:F.ieeeAddr,data:{...F,parent:j},label:F.friendlyName,labelVisible:!0,fill:nm[F.type],icon:J})}const H=new Map;for(const F of i.links){if(!d&&F.relationship===ni.NeighborIsParent||!m&&F.relationship===ni.NeighborIsAChild||!x&&F.relationship===ni.NeighborIsASibling)continue;if(F.relationship===ni.NeighborIsASibling){const K=H.get(F.source.ieeeAddr);(!K||F.depth<K.depth||F.linkquality>K.linkquality||K.linkquality===F.linkquality&&F.depth<K.depth)&&H.set(F.source.ieeeAddr,F);continue}const Y=i.links.find(K=>K.source.ieeeAddr===F.target.ieeeAddr&&K.target.ieeeAddr===F.source.ieeeAddr);F.relationship===ni.NeighborIsAChild&&Y?.relationship===ni.NeighborIsParent||k.push([F,Y])}for(const[,F]of H){const Y=i.links.find(K=>K.source.ieeeAddr===F.target.ieeeAddr&&K.target.ieeeAddr===F.source.ieeeAddr);k.push([F,Y])}const W=[];for(const[F,Y]of k)W.includes(F)||F.relationship===ni.NeighborIsASibling&&(Y?.relationship===ni.NeighborIsParent||Y?.relationship===ni.NeighborIsAChild)||L.push({id:`${F.source.ieeeAddr}-${F.target.ieeeAddr}-${F.relationship}`,data:F,label:Y?`${F.linkquality} / ${Y.linkquality??"?"}`:`${F.linkquality}`,size:F.relationship===ni.NeighborIsParent||F.relationship===ni.NeighborIsAChild?1.5:.75,labelVisible:!0,source:F.source.ieeeAddr,target:F.target.ieeeAddr,fill:bl[F.relationship]});return[P,L]},[i,d,m,x,e,t,g]),{selections:C,actives:U,onNodeClick:D,onCanvasClick:R}=bX({ref:S,nodes:w,type:"single",pathSelectionType:"out",focusOnSelect:!1}),I=Z.useCallback(P=>{P.target.value&&(vs.set(WS,P.target.value),r(P.target.value),S.current?.resetControls(),S.current?.centerGraph(),S.current?.fitNodesInView())},[]),z=Z.useCallback(P=>{P.target.value&&(vs.set(XS,P.target.value),a(P.target.value))},[]),O=Z.useCallback(P=>{vs.set(jS,P),l(P)},[]),V=Z.useCallback(P=>{vs.set(qS,P),f(P)},[]),ee=Z.useCallback(P=>{vs.set(YS,P),b(P)},[]);return ue.jsxs(ue.Fragment,{children:[ue.jsx(wX,{}),ue.jsxs("div",{className:"relative h-screen",children:[ue.jsx(MX,{graphRef:S,layoutType:n,onLayoutTypeChange:I,labelType:s,onLabelTypeChange:z,nodeStrength:o,onNodeStrengthChange:O,linkDistance:c,onLinkDistanceChange:V,nodes:w,showParents:d,setShowParents:p,showChildren:m,setShowChildren:v,showSiblings:x,setShowSiblings:_,showIcons:g,setShowIcons:ee}),ue.jsx(xX,{ref:S,theme:E,nodes:w,edges:T,clusterAttribute:n.startsWith("forceDirected")?"parent":void 0,selections:C,actives:U,onCanvasClick:R,onNodeClick:D,layoutType:n,layoutOverrides:{nodeStrength:o,linkDistance:c},sizingType:"centrality",labelType:s,labelFontUrl:SX,edgeLabelPosition:"natural",lassoType:"node",cameraMode:n.endsWith("3d")?"rotate":"pan",draggable:!0,animated:!1,contextMenu:({data:{data:P},onCollapse:L,isCollapsed:k,canCollapse:H,onClose:W})=>P.friendlyName?ue.jsx(EX,{data:P,onCollapse:L,isCollapsed:k,canCollapse:H,onClose:W}):null})]})]})});export{kX as default};
4257
+ `,KW=({curveOffset:i,animated:e,color:t="#000",curve:n,curved:r=!1,dashed:s=!1,dashArray:a=[3,1],id:o,opacity:l=1,size:c=1,onContextMenu:f,onClick:d,onPointerOver:p,onPointerOut:m})=>{const v=Z.useRef(null),x=et(w=>w.draggingIds.length>0),_=Z.useMemo(()=>new $e(t),[t]),g=et(w=>w.centerPosition),b=Z.useRef(!1),S=Z.useMemo(()=>{if(!s)return null;const[w,T]=a;return new Vr({uniforms:{color:{value:_},opacity:{value:l},dashSize:{value:w},gapSize:{value:T},lineLength:{value:n.getLength()}},vertexShader:YW,fragmentShader:ZW,transparent:!0,depthTest:!1})},[s,_,l,n,a]),{lineOpacity:E}=_r({from:{lineOpacity:0},to:{lineOpacity:l},config:{...xr,duration:e?void 0:0}});return _r(()=>{const w=n.getPoint(0),T=n.getPoint(1);return{from:{fromVertices:b.current?[T?.x,T?.y,T?.z||0]:[g?.x,g?.y,g?.z||0],toVertices:[w?.x,w?.y,w?.z||0]},to:{fromVertices:[w?.x,w?.y,w?.z||0],toVertices:[T?.x,T?.y,T?.z||0]},onChange:C=>{const{fromVertices:U,toVertices:D}=C.value,R=new Q(...U),I=new Q(...D),z=Xf(R,0,I,0,r,i);if(v.current){const O=s?c*.4:c/2;v.current.copy(new Ul(z,20,O,5,!1))}},config:{...xr,duration:e&&!x?void 0:0}}},[e,x,n,c,s,r,i]),Z.useEffect(()=>{b.current=!0},[]),ue.jsxs("mesh",{userData:{id:o,type:"edge"},renderOrder:-1,onPointerOver:p,onPointerOut:m,onClick:d,onPointerDown:w=>{w.nativeEvent.buttons===2&&(w.nativeEvent.preventDefault(),w.stopPropagation(),f())},children:[ue.jsx("tubeGeometry",{attach:"geometry",ref:v}),s?ue.jsx("primitive",{attach:"material",object:S}):ue.jsx(Bn.meshBasicMaterial,{attach:"material",opacity:E,fog:!0,transparent:!0,depthTest:!1,color:_})]})},vA=3,JW=({animated:i,arrowPlacement:e="end",contextMenu:t,disabled:n,labelPlacement:r="inline",id:s,interpolation:a,labelFontUrl:o,onContextMenu:l,onClick:c,onPointerOver:f,onPointerOut:d,subLabelPlacement:p="below"})=>{const m=et(ne=>ne.theme),v=et(ne=>ne.draggingIds.length>0),[x,_]=Z.useState(!1),[g,b]=Z.useState(!1),S=et(ne=>ne.edges),E=S.find(ne=>ne.id===s),{target:w,source:T,label:C,subLabel:U,labelVisible:D=!1,size:R=1,fill:I,dashed:z=!1,dashArray:O=[3,1]}=E,V=E.subLabelPlacement||p,ee=et(ne=>ne.nodes.find(Be=>Be.id===T)),P=et(ne=>ne.nodes.find(Be=>Be.id===w)),L=(R+m.edge.label.fontSize)/2,[k,H]=Z.useMemo(()=>N3(R),[R]),W=E.interpolation||a,F=E.arrowPlacement||e,{curveOffset:Y,curved:K}=Z.useMemo(()=>zW({edge:E,edges:S,curved:W==="curved"}),[E,S,W]),[j,J,he]=Z.useMemo(()=>{const ne=jf(ee),Be=ee.size,X=jf(P),B=P.size;let ie=Xf(ne,Be,X,B,K,Y);const[Se,ge]=L3(F,ie,k);return F==="end"&&(ie=Xf(ne,Be,Se,0,K,Y)),[ie,Se,ge]},[ee,P,K,Y,F,k]),re=Z.useMemo(()=>{let ne=I3(ee.position,P.position,O3(L,r));if(K){const Be=new Q().subVectors(ne,j.getPoint(.5));switch(r){case"above":Be.y=Be.y-vA;break;case"below":Be.y=Be.y+vA;break}ne=ne.sub(Be)}return ne},[ee.position,P.position,L,r,K,j]),pe=et(ne=>ne.selections?.includes(s)),Oe=et(ne=>ne.selections?.length),be=et(ne=>ne.actives?.includes(s)),ve=et(ne=>ne.centerPosition),ce=Oe?pe||be?m.edge.selectedOpacity:m.edge.inactiveOpacity:m.edge.opacity,Ne=Z.useMemo(()=>FW(ee.position,P.position,V),[ee.position,P.position,V]),[{labelPosition:G}]=_r(()=>({from:{labelPosition:ve?[ve.x,ve.y,ve.z]:[0,0,0]},to:{labelPosition:[re.x,re.y,re.z]},config:{...xr,duration:i&&!v?void 0:0}}),[re,i,v]),le=Z.useMemo(()=>new Ui(0,0,r==="natural"?0:Math.atan((P.position.y-ee.position.y)/(P.position.x-ee.position.x))),[P.position.x,P.position.y,ee.position.x,ee.position.y,r]);wl(x&&!v&&c!==void 0,"pointer");const{pointerOver:te,pointerOut:Me}=lb({disabled:n,onPointerOver:ne=>{_(!0),f?.(E,ne)},onPointerOut:ne=>{_(!1),d?.(E,ne)}}),oe=Z.useMemo(()=>F!=="none"&&ue.jsx(qW,{animated:i,color:pe||x||be?m.arrow.activeFill:I||m.arrow.fill,length:k,opacity:ce,position:J,rotation:he,size:H,onActive:_,onContextMenu:()=>{n||(b(!0),l?.(E))}}),[I,x,i,k,F,J,he,H,n,E,be,pe,l,ce,m.arrow.activeFill,m.arrow.fill]),De=Z.useMemo(()=>D&&C&&ue.jsxs(Bn.group,{position:G,onContextMenu:()=>{n||(b(!0),l?.(E))},onPointerOver:te,onPointerOut:Me,children:[ue.jsx(bu,{text:C,ellipsis:15,fontUrl:o,stroke:m.edge.label.stroke,color:pe||x||be?m.edge.label.activeColor:m.edge.label.color,opacity:ce,fontSize:m.edge.label.fontSize,rotation:le}),U&&ue.jsx("group",{position:[Ne.x,Ne.y,0],children:ue.jsx(bu,{text:U,ellipsis:15,fontUrl:o,stroke:m.edge.subLabel?.stroke||m.edge.label.stroke,color:pe||x||be?m.edge.subLabel?.activeColor||m.edge.label.activeColor:m.edge.subLabel?.color||m.edge.label.color,opacity:ce,fontSize:m.edge.subLabel?.fontSize||m.edge.label.fontSize*.8,rotation:le})})]}),[x,n,E,be,pe,C,U,o,G,Ne,le,D,l,Me,te,ce,m.edge.label.activeColor,m.edge.label.color,m.edge.label.fontSize,m.edge.label.stroke,m.edge.subLabel?.stroke,m.edge.subLabel?.activeColor,m.edge.subLabel?.color,m.edge.subLabel?.fontSize]),_e=Z.useMemo(()=>g&&t&&ue.jsx(rb,{prepend:!0,center:!0,position:re,children:t({data:E,onClose:()=>b(!1)})}),[g,t,re,E]);return ue.jsxs("group",{children:[ue.jsx(KW,{curveOffset:Y,animated:i,color:pe||x||be?m.edge.activeFill:I||m.edge.fill,curve:j,curved:K,dashed:z,dashArray:O,id:s,opacity:ce,size:R,onClick:ne=>{n||c?.(E,ne)},onPointerOver:te,onPointerOut:Me,onContextMenu:()=>{n||(b(!0),l?.(E))}}),oe,De,_e]})},yA=new wa(0,0,0);function QW(i,e){const t=Z.useRef(null),n=et(l=>l.theme);et(l=>{t.current=l});const r=Z.useRef(new Map);Z.useRef(new wa(0,0,0));const s=Z.useRef(null),a=Z.useCallback(l=>{const c=[],f=r.current,{nodes:d}=t.current,p=new Map(d.map(m=>[m.id,m]));return n.edge.label.fontSize,i!=="none"&&!s.current&&(s.current=new wu(0,1,1,20,1,!0)),l.forEach(m=>{const{target:v,source:x,size:_=1}=m,g=p.get(x),b=p.get(v);if(!g||!b)return;const S=`${g.position.x},${g.position.y},${b.position.x},${b.position.y},${_}`,w=(m.interpolation||e)==="curved",T=m.arrowPlacement||i;if(f.has(S)){c.push(f.get(S));return}const C=jf(g),U=g.size,D=jf(b),R=b.size;let I=Xf(C,U,D,R,w),z=new Ul(I,20,_/2,5,!1);if(T==="none"){c.push(z),f.set(S,z);return}const[O,V]=N3(_),ee=s.current.clone();ee.scale(V,O,V);const[P,L]=L3(T,I,O),k=new _i;if(k.setFromUnitVectors(new Q(0,1,0),L),ee.applyQuaternion(k),ee.translate(P.x,P.y,P.z),T&&T==="end"){const W=Xf(C,U,P,0,w);z=new Ul(W,20,_/2,5,!1)}const H=Xp([z,ee]);c.push(H),f.set(S,H)}),c},[i,e,n.edge.label.fontSize]),o=Z.useCallback((l,c)=>{const f=a(l),d=a(c);return Xp([d.length?Xp(d):yA,f.length?Xp(f):yA],!0)},[a]);return{getGeometries:a,getGeometry:o}}function $W(i,e,t){const n=Z.useRef(i);Z.useEffect(()=>{n.current=i},[i]);const r=et(d=>d.edgeContextMenus),s=et(Z.useCallback(d=>d.setEdgeContextMenus,[])),a=Z.useRef(!1),o=Z.useCallback(()=>{a.current=!0},[]),l=Z.useRef(!1),c=Z.useCallback(()=>{l.current=!0},[]),f=Z.useCallback((d,p)=>{const{onClick:m,onContextMenu:v,onPointerOver:x,onPointerOut:_}=n.current;if(m&&a.current&&!t){a.current=!1;for(const g of p)m(g)}if((e||v)&&l.current&&!t){l.current=!1;const g=new Set(r);let b=!1;for(const S of p)r.has(S.id)||(g.add(S.id),b=!0,v?.(S));b&&s(g)}x&&p.filter(b=>!d.includes(b)).forEach(b=>{x(b)}),_&&d.filter(b=>!p.includes(b)).forEach(b=>{_(b)})},[e,t,r,s]);return{handleClick:o,handleContextMenu:c,handleIntersections:f}}function eX(i,e){const t=Z.useRef(i),n=Z.useRef(null);Z.useEffect(()=>{t.current=i;const a=i.getAttribute("position");n.current=new Float32Array(a.array.length)},[i]);const r=Z.useCallback(()=>{const a=t.current.getAttribute("position");return{from:new Float32Array(a.array.length),to:a.array}},[]),s=Z.useCallback(a=>{const o=n.current;o.set(a);const l=new Kt(o,3,!1);t.current.setAttribute("position",l),l.needsUpdate=!0},[]);_r(()=>{if(!e)return null;const a=r();return{from:{positions:a.from},to:{positions:a.to},onChange:o=>{s(o.value.positions)},config:{...xr,duration:e?void 0:0}}},[e,r,s])}function tX(i,e,t){const[{activeOpacity:n,inactiveOpacity:r}]=_r(()=>({from:{activeOpacity:0,inactiveOpacity:0},to:{activeOpacity:e?t.edge.selectedOpacity:t.edge.opacity,inactiveOpacity:e?t.edge.inactiveOpacity:t.edge.opacity},config:{...xr,duration:i?void 0:0}}),[i,e,t]);return{activeOpacity:n,inactiveOpacity:r}}const nX=({animated:i,color:e,contextMenu:t,edge:n,labelFontUrl:r,labelPlacement:s="inline",opacity:a})=>{const o=et(R=>R.theme),{target:l,source:c,label:f,labelVisible:d=!1,size:p=1}=n,m=et(R=>R.nodes),[v,x]=Z.useMemo(()=>[m.find(R=>R.id===c),m.find(R=>R.id===l)],[m,c,l]),_=et(R=>R.draggingIds.length>0),g=Z.useMemo(()=>(p+o.edge.label.fontSize)/2,[p,o.edge.label.fontSize]),b=Z.useMemo(()=>I3(v.position,x.position,O3(g,s)),[v.position,x.position,g,s]),S=et(R=>R.edgeContextMenus),E=et(R=>R.setEdgeContextMenus),[{labelPosition:w}]=_r(()=>({from:{labelPosition:[0,0,0]},to:{labelPosition:[b.x,b.y,b.z]},config:{...xr,duration:i&&!_?void 0:0}}),[b,i,_]),T=Z.useCallback(R=>{const I=new Set(S);I.delete(R),E(I)},[S,E]),C=Z.useMemo(()=>s==="natural"?new Ui(0,0,0):new Ui(0,0,Math.atan2(x.position.y-v.position.y,x.position.x-v.position.x)),[s,x.position.y,x.position.x,v.position.y,v.position.x]),U=Z.useMemo(()=>({prepend:!0,center:!0,position:b}),[b]),D=Z.useMemo(()=>({text:f,ellipsis:15,fontUrl:r,stroke:o.edge.label.stroke,color:e,opacity:a,fontSize:o.edge.label.fontSize,rotation:C}),[f,r,o.edge.label.stroke,e,a,o.edge.label.fontSize,C]);return ue.jsxs("group",{children:[d&&f&&ue.jsx(Bn.group,{position:w,children:ue.jsx(bu,{...D})}),t&&S.has(n.id)&&ue.jsx(rb,{...U,children:t({data:n,onClose:()=>T(n.id)})})]})},iX=({interpolation:i="linear",arrowPlacement:e="end",labelPlacement:t="inline",animated:n,contextMenu:r,disabled:s,edges:a,labelFontUrl:o,onClick:l,onContextMenu:c,onPointerOut:f,onPointerOver:d})=>{const p=et(W=>W.theme),{getGeometries:m,getGeometry:v}=QW(e,i),x=et(W=>W.draggingIds),_=et(W=>W.edgeMeshes),g=et(W=>W.setEdgeMeshes),b=et(W=>W.actives||[]),S=et(W=>W.selections||[]),[E,w,T,C]=Z.useMemo(()=>{const W=[],F=[],Y=[],K=[];return a.forEach(j=>{if(x.includes(j.source)||x.includes(j.target)){S.includes(j.id)||b.includes(j.id)?Y.push(j):K.push(j);return}S.includes(j.id)||b.includes(j.id)?W.push(j):F.push(j)}),[W,F,Y,K]},[a,b,S,x]),U=!!S.length,D=Z.useMemo(()=>v(E,w),[v,E,w]),{activeOpacity:R,inactiveOpacity:I}=tX(n,U,p);eX(D,n),Z.useEffect(()=>{if(x.length===0){const F=m(a).map(Y=>new pn(Y));g(F)}},[m,g,a,x.length]);const z=Z.useRef(new pn),O=Z.useRef(new pn),V=Z.useCallback(W=>{if(!W.camera)return[];const F=W.intersectObjects(_);return F.length?F.map(Y=>a[_.indexOf(Y.object)]):[]},[_,a]),{handleClick:ee,handleContextMenu:P,handleIntersections:L}=$W({onClick:l,onContextMenu:c,onPointerOut:f,onPointerOver:d},r,s),k=Z.useRef([]),H=Z.useRef([]);return s0(W=>{if(z.current.geometry=D,s)return;const F=k.current;if((x.length||x.length===0&&F!==null)&&(O.current.geometry=v(T,C)),k.current=x,x.length)return;const Y=H.current,K=V(W.raycaster);L(Y,K),K.join()!==Y.join()&&(O.current.geometry=v(K,[])),H.current=K}),ue.jsxs("group",{onClick:ee,onContextMenu:P,children:[ue.jsxs("mesh",{ref:z,children:[ue.jsx(Bn.meshBasicMaterial,{attach:"material-0",color:p.edge.fill,depthTest:!1,fog:!0,opacity:I,side:In,transparent:!0}),ue.jsx(Bn.meshBasicMaterial,{attach:"material-1",color:p.edge.activeFill,depthTest:!1,fog:!0,opacity:R,side:In,transparent:!0})]}),ue.jsxs("mesh",{ref:O,children:[ue.jsx(Bn.meshBasicMaterial,{attach:"material-0",color:p.edge.fill,depthTest:!1,fog:!0,opacity:I,side:In,transparent:!0}),ue.jsx(Bn.meshBasicMaterial,{attach:"material-1",color:p.edge.activeFill,depthTest:!1,fog:!0,opacity:R,side:In,transparent:!0})]}),a.map(W=>ue.jsx(nX,{animated:n,contextMenu:r,color:p.edge.label.color,disabled:s,edge:W,labelFontUrl:o,labelPlacement:t},W.id))]})},rX=({color:i="#D8E6EA",size:e=1,opacity:t=.5,animated:n,strokeWidth:r=5,innerRadius:s=4,segments:a=25})=>{const o=Z.useMemo(()=>new $e(i),[i]),{ringSize:l,ringOpacity:c}=_r({from:{ringOpacity:0,ringSize:[1e-5,1e-5,1e-5]},to:{ringOpacity:t,ringSize:[e/2,e/2,1]},config:{...xr,duration:n?void 0:0}}),f=r/10,d=s+f;return ue.jsx(m3,{position:[0,0,1],children:ue.jsxs(Bn.mesh,{scale:l,children:[ue.jsx("ringGeometry",{attach:"geometry",args:[s,d,a]}),ue.jsx(Bn.meshBasicMaterial,{attach:"material",color:o,transparent:!0,depthTest:!1,opacity:c,side:In,fog:!0})]})})},sX=({color:i,id:e,size:t,selected:n,opacity:r=1,animated:s})=>{const{scale:a,nodeOpacity:o}=_r({from:{scale:[1e-5,1e-5,1e-5],nodeOpacity:0},to:{scale:[t,t,t],nodeOpacity:r},config:{...xr,duration:s?void 0:0}}),l=Z.useMemo(()=>new $e(i),[i]),c=et(f=>f.theme);return ue.jsxs(ue.Fragment,{children:[ue.jsxs(Bn.mesh,{userData:{id:e,type:"node"},scale:a,children:[ue.jsx("sphereGeometry",{attach:"geometry",args:[1,25,25]}),ue.jsx(Bn.meshPhongMaterial,{attach:"material",side:In,transparent:!0,fog:!0,opacity:o,color:l,emissive:l,emissiveIntensity:.7})]}),ue.jsx(rX,{opacity:n?.5:0,size:t,animated:s,color:n?c.ring.activeFill:c.ring.fill})]})},aX=({image:i,id:e,size:t,opacity:n=1,animated:r})=>{const s=Z.useMemo(()=>new Q2().load(i),[i]),{scale:a,spriteOpacity:o}=_r({from:{scale:[1e-5,1e-5,1e-5],spriteOpacity:0},to:{scale:[t,t,t],spriteOpacity:n},config:{...xr,duration:r?void 0:0}});return ue.jsx(Bn.sprite,{userData:{id:e,type:"node"},scale:a,children:ue.jsx(Bn.spriteMaterial,{attach:"material",opacity:o,fog:!0,depthTest:!1,transparent:!0,side:In,children:ue.jsx("primitive",{attach:"map",object:s,minFilter:Pn})})})},oX=({animated:i,disabled:e,id:t,draggable:n=!1,labelFontUrl:r,contextMenu:s,onClick:a,onDoubleClick:o,onPointerOver:l,onDragged:c,onPointerOut:f,onContextMenu:d,renderNode:p,constrainDragging:m})=>{const v=x0(),x=et(ne=>ne.theme),_=et(ne=>ne.nodes.find(Be=>Be.id===t)),g=et(ne=>ne.edges),b=et(ne=>ne.draggingIds),S=et(ne=>ne.collapsedNodeIds),E=et(ne=>ne.addDraggingId),w=et(ne=>ne.removeDraggingId),T=et(ne=>ne.setHoveredNodeId),C=et(ne=>ne.setNodePosition),U=et(ne=>ne.setCollapsedNodeIds),D=et(ne=>ne.collapsedNodeIds.includes(t)),R=et(ne=>ne.actives?.includes(t)),I=et(ne=>ne.selections?.includes(t)),z=et(ne=>ne.selections?.length>0),O=et(ne=>ne.centerPosition),V=et(ne=>ne.clusters.get(_.cluster)),ee=b.includes(t),P=b.length>0,{position:L,label:k,subLabel:H,size:W=7,labelVisible:F=!0}=_,Y=Z.useRef(null),[K,j]=Z.useState(!1),[J,he]=Z.useState(!1),re=K||I||R,pe=z?re?x.node.selectedOpacity:x.node.inactiveOpacity:x.node.opacity,Oe=Z.useMemo(()=>g.filter(Be=>Be.source===t).length>0||D,[g,t,D]),be=Z.useCallback(()=>{Oe&&U(D?S.filter(ne=>ne!==t):[...S,t])},[Oe,S,t,D,U]),[{nodePosition:ve,labelPosition:ce}]=_r(()=>({from:{nodePosition:O?[O.x,O.y,0]:[0,0,0],labelPosition:[0,-(W+7),2]},to:{nodePosition:L?[L.x,L.y,re?L.z+1:L.z]:[0,0,0],labelPosition:[0,-(W+7),2]},config:{...xr,duration:i&&!P?void 0:0}}),[ee,L,i,W,re]),Ne=k3({draggable:n,position:L,bounds:m?V?.position:void 0,set:ne=>C(t,ne),onDragStart:()=>{E(t),j(!0)},onDragEnd:()=>{w(t),c?.(_)}});wl(K&&!P&&a!==void 0,"pointer"),wl(K&&n&&!ee&&a===void 0,"grab"),wl(ee,"grabbing");const G=re||ee,le=G?x.node.activeFill:_.fill||x.node.fill,{pointerOver:te,pointerOut:Me}=lb({disabled:e||ee,onPointerOver:ne=>{v.freeze(),j(!0),l?.(_,ne),T(t)},onPointerOut:ne=>{v.unFreeze(),j(!1),f?.(_,ne),T(null)}}),oe=Z.useMemo(()=>p?p({id:t,color:le,size:W,active:G,opacity:pe,animated:i,selected:I,node:_}):ue.jsx(ue.Fragment,{children:_.icon?ue.jsx(aX,{id:t,image:_.icon||"",size:W+8,opacity:pe,animated:i,color:le,node:_,active:G,selected:I}):ue.jsx(sX,{id:t,size:W,opacity:pe,animated:i,color:le,node:_,active:G,selected:I})}),[p,t,le,W,G,pe,i,I,_]),De=Z.useMemo(()=>F&&(F||I||K)&&k&&ue.jsxs(Bn.group,{position:ce,children:[ue.jsx(bu,{text:k,fontUrl:r,opacity:pe,stroke:x.node.label.stroke,backgroundColor:x.node.label.backgroundColor,backgroundOpacity:x.node.label.backgroundOpacity,padding:x.node.label.padding,strokeColor:x.node.label.strokeColor,strokeWidth:x.node.label.strokeWidth,radius:x.node.label.radius,active:I||K||ee||R,color:I||K||ee||R?x.node.label.activeColor:x.node.label.color}),H&&ue.jsx("group",{position:[0,-(W-3),0],children:ue.jsx(bu,{text:H,fontUrl:r,fontSize:5,opacity:pe,stroke:x.node.subLabel?.stroke,active:I||K||ee||R,color:I||K||ee||R?x.node.subLabel?.activeColor:x.node.subLabel?.color})})]}),[K,R,ee,I,k,r,ce,F,W,pe,H,x.node.label.activeColor,x.node.label.color,x.node.label.stroke,x.node.label.backgroundColor,x.node.label.backgroundOpacity,x.node.label.padding,x.node.label.strokeColor,x.node.label.strokeWidth,x.node.label.radius,x.node.subLabel?.activeColor,x.node.subLabel?.color,x.node.subLabel?.stroke]),_e=Z.useMemo(()=>J&&s&&ue.jsx(rb,{prepend:!0,center:!0,children:s({data:_,canCollapse:Oe,isCollapsed:D,onCollapse:be,onClose:()=>he(!1)})}),[J,s,_,Oe,D,be]);return ue.jsxs(Bn.group,{renderOrder:1,userData:{id:t,type:"node"},ref:Y,position:ve,onPointerOver:te,onPointerOut:Me,onClick:ne=>{!e&&!ee&&a?.(_,{canCollapse:Oe,isCollapsed:D},ne)},onDoubleClick:ne=>{!e&&!ee&&o?.(_,ne)},onContextMenu:()=>{e||(he(!0),d?.(_,{canCollapse:Oe,isCollapsed:D,onCollapse:be}))},...Ne(),children:[oe,_e,De]})};function H3(i,e){const t=e.position.z;i<t?i-=t:i+=t;const n=e.fov/e.zoom*Math.PI/180;return 2*Math.tan(n/2)*Math.abs(i)}function lX(i,e){return H3(i,e)*e.aspect}function _A(i,e){const t=lX(1,i),n=H3(1,i),r={x0:i?.position?.x-t/2,x1:i?.position?.x+t/2,y0:i?.position?.y-n/2,y1:i?.position?.y+n/2};return e?.x>r.x0&&e?.x<r.x1&&e?.y>r.y0&&e?.y<r.y1}function xA(i,e){return e.reduce((t,n)=>Math.abs(n-i%Math.PI)<Math.abs(t-i%Math.PI)?n:t)}function cX(i,e){const t=xA(i,[0,Math.PI]),n=xA(e,[Math.PI/2,3*Math.PI/2]);return{horizontalRotation:t-i%Math.PI,verticalRotation:n-e%Math.PI}}const em=50,uX=({animated:i,disabled:e,layoutType:t})=>{const n=et(x=>x.nodes),[r,s]=Z.useState(!1),a=Jn(x=>x.invalidate),{controls:o}=x0(),l=Jn(x=>x.camera),c=Z.useRef(!1),f=Z.useCallback(async(x,_)=>{const g=_?.animated!==void 0?_?.animated:!0,b=_?.centerOnlyIfNodesNotInView!==void 0?_?.centerOnlyIfNodesNotInView:!1;if(!c.current||!b||b&&x?.some(S=>!_A(l,S.position))){const{x:S,y:E,z:w}=qf(x);await o.normalizeRotations().setTarget(S,E,w,g),r||s(!0),a()}},[a,o,n]),d=Z.useCallback(async(x,_={animated:!0,fitOnlyIfNodesNotInView:!1})=>{const{fitOnlyIfNodesNotInView:g}=_;if(!g||g&&x?.some(b=>!_A(l,b.position))){const{minX:b,maxX:S,minY:E,maxY:w,minZ:T,maxZ:C}=qf(x);if(!t.includes("3d")){const{horizontalRotation:U,verticalRotation:D}=cX(o?.azimuthAngle,o?.polarAngle);o?.rotate(U,D,!0)}await o?.zoomTo(1,_?.animated),await o?.fitToBox(new Qn(new Q(b,E,T),new Q(S,w,C)),_?.animated,{cover:!1,paddingLeft:em,paddingRight:em,paddingBottom:em,paddingTop:em})}},[l,o,t]),p=Z.useCallback(x=>{let _=null;return x?.length&&(_=x.reduce((g,b)=>{const S=n.find(E=>E.id===b);if(S)g.push(S);else throw new Error(`Attempted to center ${b} but it was not found in the nodes`);return g},[])),_},[n]),m=Z.useCallback((x,_)=>{const g=p(x);f(g||n,{animated:i,centerOnlyIfNodesNotInView:_?.centerOnlyIfNodesNotInView})},[i,f,p,n]),v=Z.useCallback(async(x,_)=>{const g=p(x);await d(g||n,{animated:i,..._})},[i,d,p,n]);return Z.useLayoutEffect(()=>{async function x(){o&&n?.length&&(c.current||(await f(n,{animated:!1}),await d(n,{animated:!1}),c.current=!0))}x()},[o,f,n,i,l,d]),{centerNodes:f,centerNodesById:m,fitNodesInViewById:v,isCentered:r}},hX=i=>i.reduceEdges((e,t,n,r,s)=>{const a=`${r}-${s}`,o={id:t,source:r,target:s,...n},l=e.get(a);return l?l.push(o):e.set(a,[o]),e},new Map),fX=(i,e)=>{if(!i||i.size===0)return[];const t=hX(i),n=[],r=e==="all"||e==="edges";for(const[s,a]of t){const[o,l]=s.split("-"),c=a[0];if(!o||!l||!c)continue;const f=c.size||1,d=f+a.length*f*.5,p=a.length>1,m=p?`${a.length} edges`:c.label,v={...c,source:o,target:l,label:m,labelVisible:r,size:d,data:{...c.data||{},originalEdges:a,count:a.length,isAggregated:p,originalSize:f}};n.push(v)}return n},dX=Z.forwardRef(({onNodeClick:i,onNodeDoubleClick:e,onNodeContextMenu:t,onEdgeContextMenu:n,onEdgeClick:r,onEdgePointerOver:s,onEdgePointerOut:a,onNodePointerOver:o,onNodePointerOut:l,onClusterClick:c,onNodeDragged:f,onClusterDragged:d,onClusterPointerOver:p,onClusterPointerOut:m,contextMenu:v,animated:x,disabled:_,draggable:g,constrainDragging:b=!1,edgeLabelPosition:S,edgeArrowPosition:E,edgeInterpolation:w="linear",labelFontUrl:T,renderNode:C,onRenderCluster:U,aggregateEdges:D,...R},I)=>{const{layoutType:z,clusterAttribute:O,labelType:V}=R,ee=Jn(ce=>ce.gl),P=Jn(ce=>ce.scene),L=Jn(ce=>ce.camera),{updateLayout:k}=WW({...R,constrainDragging:b});if(O&&!(z==="forceDirected2d"||z==="forceDirected3d"))throw new Error("Clustering is only supported for the force directed layouts.");const H=et(ce=>ce.graph),W=et(ce=>ce.nodes),F=et(ce=>ce.edges),Y=et(ce=>ce.setEdges),K=et(ce=>[...ce.clusters.values()]),j=Z.useMemo(()=>D?fX(H,V):F,[F,D,H,V]);Z.useEffect(()=>{D&&F.length!==j.length&&Y(j)},[j,F.length,Y,D]);const{centerNodesById:J,fitNodesInViewById:he,isCentered:re}=uX({animated:x,disabled:_,layoutType:z});Z.useImperativeHandle(I,()=>({centerGraph:J,fitNodesInView:he,graph:H,renderScene:()=>ee.render(P,L)}),[J,he,H,ee,P,L]);const pe=Z.useCallback(ce=>{f?.(ce),O&&k()},[O,f,k]),Oe=Z.useMemo(()=>W.map(ce=>ue.jsx(oX,{id:ce?.id,labelFontUrl:T,draggable:g,constrainDragging:b,disabled:_,animated:x,contextMenu:v,renderNode:C,onClick:i,onDoubleClick:e,onContextMenu:t,onPointerOver:o,onPointerOut:l,onDragged:pe},ce?.id)),[b,x,v,_,g,T,W,i,t,e,pe,l,o,C]),be=Z.useMemo(()=>x?j.map(ce=>ue.jsx(JW,{id:ce.id,disabled:_,animated:x,labelFontUrl:T,labelPlacement:S,arrowPlacement:E,interpolation:w,contextMenu:v,onClick:r,onContextMenu:n,onPointerOver:s,onPointerOut:a},ce.id)):ue.jsx(iX,{edges:j,disabled:_,animated:x,labelFontUrl:T,labelPlacement:S,arrowPlacement:E,interpolation:w,contextMenu:v,onClick:r,onContextMenu:n,onPointerOver:s,onPointerOut:a}),[x,v,_,E,w,S,j,T,r,n,a,s]),ve=Z.useMemo(()=>K.map(ce=>ue.jsx(jW,{animated:x,disabled:_,draggable:g,labelFontUrl:T,onClick:c,onPointerOver:p,onPointerOut:m,onDragged:d,onRender:U,...ce},ce.label)),[x,K,_,g,T,c,m,p,d,U]);return re&&ue.jsxs(Z.Fragment,{children:[be,Oe,ve]})});di.install({THREE:{MOUSE:SA,Vector2:Ge,Vector3:Q,Vector4:kt,Quaternion:_i,Matrix4:bt,Spherical:fC,Box3:Qn,Sphere:ri,Raycaster:x1,MathUtils:{DEG2RAD:Jm?.DEG2RAD,clamp:Jm?.clamp}}});NC({ThreeCameraControls:di});const pX=Z.forwardRef(({mode:i="rotate",children:e,animated:t,disabled:n,minDistance:r=1e3,maxDistance:s=5e4},a)=>{const o=Z.useRef(null),l=Jn(O=>O.camera),c=Jn(O=>O.gl),f=i==="orbit",d=et(O=>O.setPanning),p=et(O=>O.draggingIds.length>0),m=Z.useRef(0),[v,x]=Z.useState(!1);s0((O,V)=>{o.current?.enabled&&o.current?.update(V),f&&(o.current.azimuthAngle+=20*V*Jm.DEG2RAD)},-1),Z.useEffect(()=>()=>o.current?.dispose(),[]);const _=Z.useCallback(()=>{o.current?.zoom(l.zoom/2,t)},[t,l.zoom]),g=Z.useCallback(()=>{o.current?.zoom(-l.zoom/2,t)},[t,l.zoom]),b=Z.useCallback(O=>{o.current?.dolly(O,t)},[t]),S=Z.useCallback(O=>{o.current?.dolly(O,t)},[t]),E=Z.useCallback(O=>{f||o.current?.truck(-.03*O.deltaTime,0,t)},[t,f]),w=Z.useCallback(O=>{f||o.current?.truck(.03*O.deltaTime,0,t)},[t,f]),T=Z.useCallback(O=>{f||o.current?.truck(0,.03*O.deltaTime,t)},[t,f]),C=Z.useCallback(O=>{f||o.current?.truck(0,-.03*O.deltaTime,t)},[t,f]),U=Z.useCallback(O=>{O.code==="Space"&&(i==="rotate"?o.current.mouseButtons.left=di.ACTION.TRUCK:o.current.mouseButtons.left=di.ACTION.ROTATE)},[i]),D=Z.useCallback(O=>{O.code==="Space"&&(i==="rotate"?o.current.mouseButtons.left=di.ACTION.ROTATE:o.current.mouseButtons.left=di.ACTION.TRUCK)},[i]),[R,I]=Z.useState(null);Z.useEffect(()=>{ob||I({leftKey:new $p("ArrowLeft",100),rightKey:new $p("ArrowRight",100),upKey:new $p("ArrowUp",100),downKey:new $p("ArrowDown",100)})},[]),Z.useEffect(()=>(!n&&R&&(R.leftKey.addEventListener("holding",w),R.rightKey.addEventListener("holding",E),R.upKey.addEventListener("holding",T),R.downKey.addEventListener("holding",C),window.addEventListener("keydown",U),window.addEventListener("keyup",D)),()=>{R&&(R.leftKey.removeEventListener("holding",w),R.rightKey.removeEventListener("holding",E),R.upKey.removeEventListener("holding",T),R.downKey.removeEventListener("holding",C),window.removeEventListener("keydown",U),window.removeEventListener("keyup",D))}),[n,U,D,C,w,E,T,R]),Z.useEffect(()=>{n?(o.current.mouseButtons.left=di.ACTION.NONE,o.current.mouseButtons.middle=di.ACTION.NONE,o.current.mouseButtons.wheel=di.ACTION.NONE):(o.current.mouseButtons.left=di.ACTION.TRUCK,o.current.mouseButtons.middle=di.ACTION.TRUCK,o.current.mouseButtons.wheel=di.ACTION.DOLLY)},[n]),Z.useEffect(()=>{const O=()=>d(!0),V=()=>d(!1),ee=o.current;return ee&&(ee.addEventListener("control",O),ee.addEventListener("controlend",V)),()=>{ee&&(ee.removeEventListener("control",O),ee.removeEventListener("controlend",V))}},[o,d]),Z.useEffect(()=>{p?(o.current.mouseButtons.left=di.ACTION.NONE,o.current.touches.one=di.ACTION.NONE):i==="rotate"?(o.current.mouseButtons.left=di.ACTION.ROTATE,o.current.touches.one=di.ACTION.TOUCH_ROTATE):(o.current.touches.one=di.ACTION.TOUCH_TRUCK,o.current.mouseButtons.left=di.ACTION.TRUCK)},[p,i]);const z=Z.useMemo(()=>({controls:o.current,zoomIn:()=>_(),zoomOut:()=>g(),dollyIn:(O=1e3)=>b(O),dollyOut:(O=-1e3)=>S(O),panLeft:(O=100)=>w({deltaTime:O}),panRight:(O=100)=>E({deltaTime:O}),panDown:(O=100)=>C({deltaTime:O}),panUp:(O=100)=>T({deltaTime:O}),resetControls:O=>o.current?.normalizeRotations().reset(O),freeze:()=>{o.current.truckSpeed&&(m.current=o.current.truckSpeed),o.current.truckSpeed=0},unFreeze:()=>o.current.truckSpeed=m.current}),[_,g,w,E,C,T,o.current]);return Z.useImperativeHandle(a,()=>z),ue.jsxs(G3.Provider,{value:z,children:[ue.jsx("threeCameraControls",{ref:O=>{o.current=O,v||x(!0)},args:[l,c.domElement],smoothTime:.1,minDistance:r,dollyToCursor:!0,maxDistance:s}),e]})}),V3={canvas:{background:"#fff"},node:{fill:"#7CA0AB",activeFill:"#1DE9AC",opacity:1,selectedOpacity:1,inactiveOpacity:.2,label:{color:"#2A6475",stroke:"#fff",activeColor:"#1DE9AC"},subLabel:{color:"#ddd",stroke:"transparent",activeColor:"#1DE9AC"}},lasso:{border:"1px solid #55aaff",background:"rgba(75, 160, 255, 0.1)"},ring:{fill:"#D8E6EA",activeFill:"#1DE9AC"},edge:{fill:"#D8E6EA",activeFill:"#1DE9AC",opacity:1,selectedOpacity:1,inactiveOpacity:.1,label:{stroke:"#fff",color:"#2A6475",activeColor:"#1DE9AC",fontSize:6},subLabel:{color:"#ddd",stroke:"transparent",activeColor:"#1DE9AC"}},arrow:{fill:"#D8E6EA",activeFill:"#1DE9AC"},cluster:{stroke:"#D8E6EA",opacity:1,selectedOpacity:1,inactiveOpacity:.1,label:{stroke:"#fff",color:"#2A6475"}}};function F_(i,e,t){e=Array.isArray(e)?e:[e];const n=[],r=[];for(const s of e){const a=[...i.inEdgeEntries(s)??[],...i.outEdgeEntries(s)??[]];if(a)for(const o of a){const l=o.attributes.id;if(t==="in"?o.target===s&&!r.includes(l)&&r.push(l):t==="out"?o.source===s&&!r.includes(l)&&r.push(l):r.includes(l)||r.push(l),t==="out"||t==="all"){const c=o.target;n.includes(c)||n.push(c)}(t==="in"||t==="all")&&(n.includes(o.source)||n.push(o.source))}}return{nodes:n,edges:r}}function tm(i,e,t){const{offsetX:n,offsetY:r}=i,{width:s,height:a}=t;e.set(n/s*2-1,-(r/a)*2+1)}function mX(i){const e=document.createElement("div");return e.style.pointerEvents="none",e.style.border=i.lasso.border,e.style.backgroundColor=i.lasso.background,e.style.position="fixed",e}const gX=({children:i,type:e="none",onLasso:t,onLassoEnd:n,disabled:r})=>{const s=et(I=>I.theme),a=Jn(I=>I.camera),o=Jn(I=>I.gl),l=Jn(I=>I.setEvents),c=Jn(I=>I.size),f=Jn(I=>I.get),d=Jn(I=>I.scene),p=x0(),m=et(I=>I.actives),v=et(I=>I.setActives),x=et(I=>I.edges),_=et(I=>I.edgeMeshes),g=Z.useRef(null),b=Z.useRef(null),S=Z.useRef(mX(s)),E=Z.useRef(null),w=Z.useRef(!1),T=Z.useRef(f().events.enabled),C=Z.useRef(p.controls?.enabled),U=Z.useCallback(I=>{if(w.current){const[z,O,V]=E.current;V.x=Math.max(z.x,I.clientX),V.y=Math.max(z.y,I.clientY),O.x=Math.min(z.x,I.clientX),O.y=Math.min(z.y,I.clientY),S.current.style.left=`${O.x}px`,S.current.style.top=`${O.y}px`,S.current.style.width=`${V.x-O.x}px`,S.current.style.height=`${V.y-O.y}px`,tm(I,g.current.endPoint,c),tm(I,b.current.endPoint,c);const ee=[],P=b.current.select().sort(k=>k.uuid).map(k=>x[_.indexOf(k)].id);ee.push(...P);const L=g.current.select().sort(k=>k.uuid).filter(k=>k.isMesh&&k.userData?.id&&(k.userData?.type===e||e==="all")).map(k=>k.userData.id);ee.push(...L),requestAnimationFrame(()=>{v(ee),t?.(ee)}),document.addEventListener("pointermove",U,{passive:!0,capture:!0,once:!0})}},[c,x,_,e,v,t]),D=Z.useCallback(()=>{w.current&&(l({enabled:T.current}),w.current=!1,S.current.parentElement?.removeChild(S.current),p.controls.enabled=C.current,n?.(m),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",D))},[l,p.controls,n,m,U]),R=Z.useCallback(I=>{if(I.shiftKey){T.current=f().events.enabled,C.current=p.controls?.enabled,g.current=new kT(a,d);const z=new zg;_.length&&z.add(..._),b.current=new kT(a,z),E.current=[new Ge,new Ge,new Ge];const[O]=E.current;p.controls.enabled=!1,l({enabled:!1}),w.current=!0,o.domElement.parentElement?.appendChild(S.current),S.current.style.left=`${I.clientX}px`,S.current.style.top=`${I.clientY}px`,S.current.style.width="0px",S.current.style.height="0px",O.x=I.clientX,O.y=I.clientY,tm(I,g.current.startPoint,c),tm(I,b.current.startPoint,c),document.addEventListener("pointermove",U,{passive:!0,capture:!0,once:!0}),document.addEventListener("pointerup",D,{passive:!0})}},[a,p.controls,_,f,o.domElement.parentElement,U,D,d,l,c]);return Z.useEffect(()=>{if(!(r||e==="none"))return typeof window<"u"&&(document.addEventListener("pointerdown",R,{passive:!0}),document.addEventListener("pointermove",U,{passive:!0}),document.addEventListener("pointerup",D,{passive:!0})),()=>{typeof window<"u"&&(document.removeEventListener("pointerdown",R),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",D))}},[e,r,R,U,D]),ue.jsx("group",{children:i})},vX="_canvas_670zp_1",yX={canvas:vX},_X={alpha:!0,antialias:!0},xX={position:[0,0,1e3],near:5,far:5e4,fov:10},bX=Z.forwardRef(({cameraMode:i="pan",layoutType:e="forceDirected2d",sizingType:t="default",labelType:n="auto",theme:r=V3,animated:s=!0,defaultNodeSize:a=7,minNodeSize:o=5,maxNodeSize:l=15,lassoType:c="none",glOptions:f={},edges:d,children:p,nodes:m,minDistance:v,maxDistance:x,onCanvasClick:_,disabled:g,onLasso:b,onLassoEnd:S,aggregateEdges:E,...w},T)=>{const C=Z.useRef(null),U=Z.useRef(null),D=Z.useRef(null);Z.useImperativeHandle(T,()=>({centerGraph:(P,L)=>C.current?.centerGraph(P,L),fitNodesInView:(P,L)=>C.current?.fitNodesInView(P,L),zoomIn:()=>U.current?.zoomIn(),zoomOut:()=>U.current?.zoomOut(),dollyIn:P=>U.current?.dollyIn(P),dollyOut:P=>U.current?.dollyOut(P),panLeft:()=>U.current?.panLeft(),panRight:()=>U.current?.panRight(),panDown:()=>U.current?.panDown(),panUp:()=>U.current?.panUp(),resetControls:P=>U.current?.resetControls(P),getControls:()=>U.current?.controls,getGraph:()=>C.current?.graph,exportCanvas:()=>(C.current.renderScene(),D.current.toDataURL()),freeze:()=>U.current?.freeze(),unFreeze:()=>U.current?.unFreeze()}));const{selections:R,actives:I,collapsedNodeIds:z}=w,O=d.length+m.length>400?!1:s,V=Z.useMemo(()=>({...f,..._X}),[f]),ee=Z.useRef(P3({selections:R,actives:I,theme:r,collapsedNodeIds:z})).current;return ue.jsx("div",{className:yX.canvas,children:ue.jsx(N5,{legacy:!0,linear:!0,ref:D,flat:!0,gl:V,camera:xX,onPointerMissed:_,children:ue.jsxs(HW,{store:ee,children:[r.canvas?.background&&ue.jsx("color",{attach:"background",args:[r.canvas.background]}),ue.jsx("ambientLight",{intensity:1}),p,r.canvas?.fog&&ue.jsx("fog",{attach:"fog",args:[r.canvas.fog,4e3,9e3]}),ue.jsx(pX,{mode:i,ref:U,disabled:g,minDistance:v,maxDistance:x,animated:s,children:ue.jsx(gX,{disabled:g,type:c,onLasso:b,onLassoEnd:S,children:ue.jsx(Z.Suspense,{children:ue.jsx(dX,{ref:C,disabled:g,animated:O,edges:d,nodes:m,layoutType:e,sizingType:t,labelType:n,defaultNodeSize:a,minNodeSize:o,maxNodeSize:l,aggregateEdges:E,...w})})})})]})})})}),SX=({selections:i=[],nodes:e=[],actives:t=[],focusOnSelect:n=!0,type:r="single",pathHoverType:s="out",pathSelectionType:a="direct",ref:o,disabled:l,onSelection:c})=>{const[f,d]=Z.useState([]),[p,m]=Z.useState(t),[v,x]=Z.useState(i),[_,g]=Z.useState(!1),b=r==="multi"||r==="multiModifier",S=Z.useCallback(L=>{if(!l&&L){L=Array.isArray(L)?L:[L];const k=L.filter(H=>!v.includes(H));if(k.length){const H=[...v,...k];c?.(H),x(H)}}},[l,v,c]),E=Z.useCallback(L=>{if(!l&&L){L=Array.isArray(L)?L:[L];const k=v.filter(H=>!L.includes(H));c?.(k),x(k)}},[l,v,c]),w=Z.useCallback((L=[])=>{l||(L=Array.isArray(L)?L:[L],m([]),x(L),c?.(L))},[l,c]),T=Z.useCallback(L=>{v.includes(L)?E(L):b?S(L):w(L)},[S,w,v,b,E]),C=Z.useCallback(L=>{if(b?r==="multiModifier"?_?S(L.id):w(L.id):S(L.id):w(L.id),n===!0||n==="singleOnly"&&!_){if(!o.current)throw new Error("No ref found for the graph canvas.");const k=o.current.getGraph(),{nodes:H}=F_(k,[L.id],a);o.current.fitNodesInView([L.id,...H],{fitOnlyIfNodesNotInView:!0})}},[S,w,n,b,_,a,o,r]),U=Z.useCallback((L,k)=>{const H=o.current.getGraph();if(!H)throw new Error("Graph is not initialized");const W=GW(H,L,k);w([L,k]);const F=[];for(let Y=0;Y<W.length-1;Y++){const K=W[Y],j=W[Y+1],J=H.getEdgeAttributes(K,j);J&&F.push(J.id)}m([...W.map(Y=>Y),...F])},[w,o]),D=Z.useCallback(L=>{const k=L.target,H=gA(k),W=L.metaKey||L.ctrlKey;H&&W&&g(!0)},[]),R=Z.useCallback(L=>{const k=L.target,H=gA(k),W=["Meta","Control"].includes(L.key);H&&W&&g(!1)},[]);Z.useEffect(()=>(typeof window<"u"&&(window.addEventListener("keydown",D),window.addEventListener("keyup",R)),()=>{typeof window<"u"&&(window.removeEventListener("keydown",D),window.removeEventListener("keyup",R))}),[D,R]);const I=Z.useCallback(L=>{if(L.button!==2&&(v.length||p.length)&&(w(),g(!1),n&&v.length===1)){if(!o.current)throw new Error("No ref found for the graph canvas.");o.current.fitNodesInView([],{fitOnlyIfNodesNotInView:!0})}},[w,n,p.length,v.length,o]),z=Z.useCallback(L=>{m(L)},[]),O=Z.useCallback(L=>{w(L)},[w]),V=Z.useCallback(L=>{if(s){const k=o.current.getGraph();if(!k)throw new Error("No ref found for the graph canvas.");const{nodes:H,edges:W}=F_(k,[L.id],s);d([...H,...W])}},[s,o]),ee=Z.useCallback(()=>{s&&d([])},[s]);return Z.useEffect(()=>{if(a!=="direct"&&v.length>0){const L=o.current?.getGraph();if(L){const{nodes:k,edges:H}=F_(L,v,a);m([...k,...H])}}},[v,a,o]),{actives:Z.useMemo(()=>[...p,...f],[p,f]),onNodeClick:C,onNodePointerOver:V,onNodePointerOut:ee,onLasso:z,onLassoEnd:O,selectNodePaths:U,onCanvasClick:I,selections:v,clearSelections:w,addSelection:S,removeSelection:E,toggleSelection:T,setSelections:x}},EX=""+new URL("NotoSans-Regular-D96CXwz4.ttf",import.meta.url).href,MX=Z.memo(({data:i,onCollapse:e,isCollapsed:t,canCollapse:n,onClose:r})=>{const{t:s}=bg(["network","zigbee","common"]);let a;if(i.parent){const o=i.parent.lastIndexOf(` - ${s("children")}`);a=o>-1?i.parent.slice(0,o):i.parent}return ue.jsx("div",{className:"card bg-base-100 shadow-sm",children:ue.jsxs("div",{className:"card-body",children:[ue.jsx("h2",{className:"card-title",children:i.friendlyName}),ue.jsx("span",{children:i.type}),ue.jsx("span",{title:s("zigbee:ieee_address"),children:i.ieeeAddr}),ue.jsxs("span",{title:s("zigbee:network_address_hex"),className:"justify-self-end",children:[VU(i.networkAddress,4)," | ",ue.jsx("span",{title:s("zigbee:network_address_dec"),children:i.networkAddress})]}),a&&ue.jsxs("span",{children:[s("parent"),": ",a]}),i.failed&&i.failed.length>0&&ue.jsxs("div",{className:"badge badge-ghost",children:[ue.jsx(Yn,{icon:WU,className:"text-error",beatFade:!0}),s("common:failed"),": ",i.failed]}),ue.jsxs("div",{className:"card-actions justify-end mt-2",children:[n&&ue.jsx(Lr,{className:"btn btn-square btn-primary",onClick:e,children:ue.jsx(Yn,{icon:t?XU:jU})}),ue.jsx(Lr,{className:"btn btn-square btn-neutral",onClick:r,children:ue.jsx(Yn,{icon:qU})})]})]})})}),bA=Z.memo(i=>{const{label:e,icon:t,onChange:n,onSubmit:r,defaultValue:s,...a}=i,[o,l]=Z.useState(s);Z.useEffect(()=>{l(s)},[s]);const c=Z.useCallback(d=>{l(d.target.value?d.target.valueAsNumber:""),n?.(d)},[n]),f=Z.useCallback(d=>{r?.(o,!d.target.validationMessage)},[r,o]);return ue.jsxs("div",{className:"flex flex-row flex-wrap items-center gap-2 bg-base-100 rounded-box px-2 pb-1",title:e,children:[ue.jsx(Yn,{icon:t}),ue.jsxs("div",{className:"",children:[ue.jsx("input",{className:"range range-xs",onChange:c,onTouchEnd:f,onMouseUp:f,...a,type:"range",value:o}),ue.jsxs("div",{className:"flex justify-between px-1 mt-1 text-xs",children:[ue.jsx("span",{children:i.min}),ue.jsx("span",{children:o}),ue.jsx("span",{children:i.max})]})]})]})}),wX=Z.memo(({graphRef:i,layoutType:e,onLayoutTypeChange:t,labelType:n,onLabelTypeChange:r,nodeStrength:s,onNodeStrengthChange:a,linkDistance:o,onLinkDistanceChange:l,nodes:c,showParents:f,setShowParents:d,showChildren:p,setShowChildren:m,showSiblings:v,setShowSiblings:x,showIcons:_,setShowIcons:g})=>{const{t:b}=bg("network"),S=Z.useMemo(()=>{const T=c.map(C=>[C.id,C.data.type!=="Coordinator"?`${C.data.type[0]} - ${C.label}`:C.label]);return T.sort(([,C],[,U])=>C.localeCompare(U)),T.map(([C,U])=>ue.jsx("option",{value:C,children:U},C))},[c]),E=Z.useCallback(()=>{i.current&&YU(i.current.exportCanvas(),`network-map-${Date.now()}.png`)},[i]),w=Z.useCallback(T=>{if(T.target.value){const C=[T.target.value];i.current?.centerGraph(C),i.current?.fitNodesInView(C)}},[i]);return ue.jsxs(ue.Fragment,{children:[ue.jsxs("div",{className:"absolute z-9 top-0 left-0 p-1 flex flex-row flex-wrap gap-1 items-start max-w-[calc(100vw-19rem)] md:max-w-none",children:[ue.jsx(Lr,{title:b("download_image"),className:"btn btn-square btn-neutral btn-sm",onClick:E,children:ue.jsx(Yn,{icon:ZU})}),ue.jsx(Lr,{title:b("reset_controls"),className:"btn btn-square btn-neutral btn-sm",onClick:()=>{i.current?.resetControls()},children:ue.jsx(Yn,{icon:KU})}),ue.jsx(Lr,{title:b("fit_view"),className:"btn btn-square btn-neutral btn-sm",onClick:()=>{i.current?.centerGraph(),i.current?.fitNodesInView()},children:ue.jsx(Yn,{icon:JU})}),ue.jsx(Lr,{title:b("zoom_in"),className:"btn btn-square btn-neutral btn-sm",onClick:()=>{i.current?.zoomIn()},children:ue.jsx(Yn,{icon:QU})}),ue.jsx(Lr,{title:b("zoom_out"),className:"btn btn-square btn-neutral btn-sm",onClick:()=>{i.current?.zoomOut()},children:ue.jsx(Yn,{icon:$U})}),ue.jsx(Lr,{className:`btn btn-square btn-neutral btn-sm ${f?"":"btn-outline"}`,item:!f,onClick:d,title:b("parent"),children:ue.jsx(Yn,{icon:tu,style:{color:bl[ni.NeighborIsParent]}})}),ue.jsx(Lr,{className:`btn btn-square btn-neutral btn-sm ${p?"":"btn-outline"}`,item:!p,onClick:m,title:b("child"),children:ue.jsx(Yn,{icon:tu,style:{color:bl[ni.NeighborIsAChild]}})}),ue.jsx(Lr,{className:`btn btn-square btn-neutral btn-sm ${v?"":"btn-outline"}`,item:!v,onClick:x,title:b("sibling"),children:ue.jsx(Yn,{icon:tu,style:{color:bl[ni.NeighborIsASibling]}})}),ue.jsx(Lr,{className:`btn btn-square btn-neutral btn-sm ${_?"":"btn-outline"}`,item:!_,onClick:g,title:b("icons"),children:ue.jsx(Yn,{icon:eO})}),ue.jsxs("select",{className:"select select-sm w-36",title:b("find_node"),defaultValue:"",onChange:w,children:[ue.jsx("option",{value:"",children:b("find_node")}),S]})]}),ue.jsxs("div",{className:"absolute z-9 top-0 right-0 p-1 flex flex-row flex-wrap gap-1 items-start justify-end",children:[ue.jsxs("select",{className:"select select-sm w-36",title:b("layout_type"),value:e,onChange:t,children:[ue.jsx("option",{value:"",disabled:!0,children:b("layout_type")}),ue.jsx("option",{value:"forceDirected2d",children:"forceDirected2d"}),ue.jsx("option",{value:"forceDirected3d",children:"forceDirected3d"}),ue.jsx("option",{value:"radialOut2d",children:"radialOut2d"}),ue.jsx("option",{value:"radialOut3d",children:"radialOut3d"}),ue.jsx("option",{value:"concentric2d",children:"concentric2d"})]}),ue.jsxs("select",{className:"select select-sm w-36",title:b("label_type"),value:n,onChange:r,children:[ue.jsx("option",{value:"",disabled:!0,children:b("label_type")}),ue.jsx("option",{value:"all",children:"all"}),ue.jsx("option",{value:"auto",children:"auto"}),ue.jsx("option",{value:"none",children:"none"}),ue.jsx("option",{value:"nodes",children:"nodes"}),ue.jsx("option",{value:"edges",children:"edges"})]})]}),ue.jsxs("div",{className:"absolute z-9 bottom-0 left-0 p-1 flex flex-row flex-wrap gap-1 items-end",children:[ue.jsx(bA,{name:"node_strength",label:b("node_strength"),icon:tO,onSubmit:(T,C)=>C&&typeof T=="number"&&a(T),min:-1e3,max:-100,step:10,defaultValue:s}),ue.jsx(bA,{name:"link_distance",label:b("link_distance"),icon:nO,onSubmit:(T,C)=>C&&typeof T=="number"&&l(T),min:10,max:200,step:5,defaultValue:o})]}),ue.jsx("div",{className:"absolute z-9 bottom-0 right-0 p-1 flex flex-row flex-wrap gap-1 items-end justify-end",children:ue.jsx(Lr,{title:b("scroll_to_top"),className:"btn btn-primary btn-square ml-auto",onClick:()=>{window.scrollTo(0,0)},children:ue.jsx(Yn,{icon:iO})})})]})}),TX=Z.memo(()=>{const{t:i}=bg("network");return ue.jsxs("details",{className:"collapse collapse-arrow rounded-b-none",children:[ue.jsx("summary",{className:"collapse-title font-semibold",children:i("legend")}),ue.jsxs("div",{className:"collapse-content text-sm",children:[ue.jsxs("div",{className:"flex flex-row flex-wrap gap-3 mb-2",children:[ue.jsxs("div",{children:[ue.jsxs("p",{children:[i("nodes"),":"]}),ue.jsxs("ul",{className:"list-none list-inside",children:[ue.jsxs("li",{style:{color:nm.Coordinator},children:[ue.jsx(Yn,{icon:Iv})," Coordinator"]}),ue.jsxs("li",{style:{color:nm.Router},children:[ue.jsx(Yn,{icon:Iv})," Router"]}),ue.jsxs("li",{style:{color:nm.EndDevice},children:[ue.jsx(Yn,{icon:Iv})," EndDevice"]})]})]}),ue.jsxs("div",{children:[ue.jsxs("p",{children:[i("edges"),":"]}),ue.jsxs("ul",{className:"list-none list-inside",children:[ue.jsxs("li",{style:{color:bl[ni.NeighborIsParent]},children:[ue.jsx(Yn,{icon:tu})," ",i("parent")]}),ue.jsxs("li",{style:{color:bl[ni.NeighborIsAChild]},children:[ue.jsx(Yn,{icon:tu})," ",i("child")]}),ue.jsxs("li",{style:{color:bl[ni.NeighborIsASibling]},children:[ue.jsx(Yn,{icon:tu})," ",i("sibling")]})]})]})]}),ue.jsx("p",{children:i("legend_node_siblings")}),ue.jsx("p",{children:i("legend_node_size")}),ue.jsx("p",{children:i("legend_node_select")}),ue.jsx("p",{children:i("legend_node_fold")}),ue.jsx("p",{children:i("legend_edge_toggle")}),ue.jsx("p",{className:"text-xs mt-2",children:"Known issues:"}),ue.jsxs("ul",{className:"list-disc list-inside text-xs",children:[ue.jsx("li",{children:"Edge colors are currently not working"}),ue.jsx("li",{children:"An undesired vertical offset is applied when starting to drag a node"})]})]})]})}),GX=Z.memo(({map:i})=>{const{t:e}=bg("network"),t=rO(P=>P.devices),[n,r]=Z.useState(vs.get(WS,"forceDirected2d")),[s,a]=Z.useState(vs.get(XS,"all")),[o,l]=Z.useState(vs.get(jS,-750)),[c,f]=Z.useState(vs.get(qS,50)),[d,p]=Z.useState(!0),[m,v]=Z.useState(!0),[x,_]=Z.useState(!0),[g,b]=Z.useState(vs.get(YS,!1)),S=Z.useRef(null),E=Z.useMemo(()=>{const P=new OffscreenCanvas(1,1).getContext("2d"),L=getComputedStyle(document.documentElement),k=uh(P,L.getPropertyValue("--color-base-100")),H=uh(P,L.getPropertyValue("--color-base-200")),W=uh(P,L.getPropertyValue("--color-base-content")),F=uh(P,L.getPropertyValue("--color-primary")),Y=uh(P,L.getPropertyValue("--color-accent"));return sO({},V3,{canvas:{background:k},node:{activeFill:Y,label:{color:W,stroke:H,activeColor:Y},subLabel:{color:W,stroke:"transparent",activeColor:Y}},lasso:{border:`1px solid ${F}`,background:"rgba(75, 160, 255, 0.1)"},ring:{fill:W,activeFill:Y},edge:{fill:W,activeFill:Y,label:{stroke:H,color:W,activeColor:Y},subLabel:{color:W,stroke:"transparent",activeColor:Y}},arrow:{fill:W,activeFill:Y},cluster:{stroke:W,label:{stroke:H,color:W}}})},[]),[w,T]=Z.useMemo(()=>{const P=[],L=[],k=[];for(const F of i.nodes){const Y=t.find(he=>he.ieee_address===F.ieeeAddr),K=i.links.find(he=>he.relationship===ni.NeighborIsParent&&he.target.ieeeAddr===F.ieeeAddr);let j=K?i.nodes.find(he=>he.ieeeAddr===K.source.ieeeAddr)?.friendlyName:void 0;if(!K){const he=i.links.find(re=>re.relationship===ni.NeighborIsAChild&&re.source.ieeeAddr===F.ieeeAddr);j=he?i.nodes.find(re=>re.ieeeAddr===he.target.ieeeAddr)?.friendlyName:void 0,j&&(j+=` - ${e("children")}`)}let J;g&&Y&&(J=Y.definition?.icon??aO(Y),J===oO&&(J=void 0)),P.push({id:F.ieeeAddr,data:{...F,parent:j},label:F.friendlyName,labelVisible:!0,fill:nm[F.type],icon:J})}const H=new Map;for(const F of i.links){if(!d&&F.relationship===ni.NeighborIsParent||!m&&F.relationship===ni.NeighborIsAChild||!x&&F.relationship===ni.NeighborIsASibling)continue;if(F.relationship===ni.NeighborIsASibling){const K=H.get(F.source.ieeeAddr);(!K||F.depth<K.depth||F.linkquality>K.linkquality||K.linkquality===F.linkquality&&F.depth<K.depth)&&H.set(F.source.ieeeAddr,F);continue}const Y=i.links.find(K=>K.source.ieeeAddr===F.target.ieeeAddr&&K.target.ieeeAddr===F.source.ieeeAddr);F.relationship===ni.NeighborIsAChild&&Y?.relationship===ni.NeighborIsParent||k.push([F,Y])}for(const[,F]of H){const Y=i.links.find(K=>K.source.ieeeAddr===F.target.ieeeAddr&&K.target.ieeeAddr===F.source.ieeeAddr);k.push([F,Y])}const W=[];for(const[F,Y]of k)W.includes(F)||F.relationship===ni.NeighborIsASibling&&(Y?.relationship===ni.NeighborIsParent||Y?.relationship===ni.NeighborIsAChild)||L.push({id:`${F.source.ieeeAddr}-${F.target.ieeeAddr}-${F.relationship}`,data:F,label:Y?`${F.linkquality} / ${Y.linkquality??"?"}`:`${F.linkquality}`,size:F.relationship===ni.NeighborIsParent||F.relationship===ni.NeighborIsAChild?1.5:.75,labelVisible:!0,source:F.source.ieeeAddr,target:F.target.ieeeAddr,fill:bl[F.relationship]});return[P,L]},[i,d,m,x,e,t,g]),{selections:C,actives:U,onNodeClick:D,onCanvasClick:R}=SX({ref:S,nodes:w,type:"single",pathSelectionType:"out",focusOnSelect:!1}),I=Z.useCallback(P=>{P.target.value&&(vs.set(WS,P.target.value),r(P.target.value),S.current?.resetControls(),S.current?.centerGraph(),S.current?.fitNodesInView())},[]),z=Z.useCallback(P=>{P.target.value&&(vs.set(XS,P.target.value),a(P.target.value))},[]),O=Z.useCallback(P=>{vs.set(jS,P),l(P)},[]),V=Z.useCallback(P=>{vs.set(qS,P),f(P)},[]),ee=Z.useCallback(P=>{vs.set(YS,P),b(P)},[]);return ue.jsxs(ue.Fragment,{children:[ue.jsx(TX,{}),ue.jsxs("div",{className:"relative h-screen",children:[ue.jsx(wX,{graphRef:S,layoutType:n,onLayoutTypeChange:I,labelType:s,onLabelTypeChange:z,nodeStrength:o,onNodeStrengthChange:O,linkDistance:c,onLinkDistanceChange:V,nodes:w,showParents:d,setShowParents:p,showChildren:m,setShowChildren:v,showSiblings:x,setShowSiblings:_,showIcons:g,setShowIcons:ee}),ue.jsx(bX,{ref:S,theme:E,nodes:w,edges:T,clusterAttribute:n.startsWith("forceDirected")?"parent":void 0,selections:C,actives:U,onCanvasClick:R,onNodeClick:D,layoutType:n,layoutOverrides:{nodeStrength:o,linkDistance:c},sizingType:"centrality",labelType:s,labelFontUrl:EX,edgeLabelPosition:"natural",lassoType:"node",cameraMode:n.endsWith("3d")?"rotate":"pan",draggable:!0,animated:!1,contextMenu:({data:{data:P},onCollapse:L,isCollapsed:k,canCollapse:H,onClose:W})=>P.friendlyName?ue.jsx(MX,{data:P,onCollapse:L,isCollapsed:k,canCollapse:H,onClose:W}):null})]})]})});export{GX as default};