@xyo-network/os-react-runtime 7.4.0 → 7.4.2

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 (443) hide show
  1. package/dist/browser/candy-dark@3x-N2S7K4QB.webp +0 -0
  2. package/dist/browser/candy-light@3x-WKECMFRP.webp +0 -0
  3. package/dist/browser/candyApple-dark@3x-HGSPETPR.webp +0 -0
  4. package/dist/browser/candyApple-light@3x-OWA5XNTF.webp +0 -0
  5. package/dist/browser/helpers/BridgeActivityHelper.d.ts +16 -0
  6. package/dist/browser/helpers/BridgeActivityHelper.d.ts.map +1 -0
  7. package/dist/browser/helpers/BrowserLocator.d.ts +6 -0
  8. package/dist/browser/helpers/BrowserLocator.d.ts.map +1 -0
  9. package/dist/browser/helpers/NodePalettes.d.ts +4 -0
  10. package/dist/browser/helpers/NodePalettes.d.ts.map +1 -0
  11. package/dist/browser/helpers/index.d.ts +6 -0
  12. package/dist/browser/helpers/index.d.ts.map +1 -0
  13. package/dist/browser/helpers/monitor/XyOsBrowserMonitor.d.ts +6 -0
  14. package/dist/browser/helpers/monitor/XyOsBrowserMonitor.d.ts.map +1 -0
  15. package/dist/browser/helpers/monitor/index.d.ts +2 -0
  16. package/dist/browser/helpers/monitor/index.d.ts.map +1 -0
  17. package/dist/browser/helpers/widget/Caller.d.ts +19 -0
  18. package/dist/browser/helpers/widget/Caller.d.ts.map +1 -0
  19. package/dist/browser/helpers/widget/index.d.ts +2 -0
  20. package/dist/browser/helpers/widget/index.d.ts.map +1 -0
  21. package/dist/browser/img/backgrounds/index.d.ts +19 -0
  22. package/dist/browser/img/backgrounds/index.d.ts.map +1 -0
  23. package/dist/browser/img/index.d.ts +2 -0
  24. package/dist/browser/img/index.d.ts.map +1 -0
  25. package/dist/browser/index.d.ts +6 -0
  26. package/dist/browser/index.d.ts.map +1 -0
  27. package/dist/browser/index.mjs +4701 -0
  28. package/dist/browser/index.mjs.map +7 -0
  29. package/dist/browser/interfaces/StackReady.d.ts +6 -0
  30. package/dist/browser/interfaces/StackReady.d.ts.map +1 -0
  31. package/dist/browser/interfaces/index.d.ts +2 -0
  32. package/dist/browser/interfaces/index.d.ts.map +1 -0
  33. package/dist/browser/modules/Dapp/Alert/RenderErrorWithSupportLink.d.ts +11 -0
  34. package/dist/browser/modules/Dapp/Alert/RenderErrorWithSupportLink.d.ts.map +1 -0
  35. package/dist/browser/modules/Dapp/Alert/index.d.ts +2 -0
  36. package/dist/browser/modules/Dapp/Alert/index.d.ts.map +1 -0
  37. package/dist/browser/modules/Dapp/Button/IconEx.d.ts +12 -0
  38. package/dist/browser/modules/Dapp/Button/IconEx.d.ts.map +1 -0
  39. package/dist/browser/modules/Dapp/Button/LaunchFrame.d.ts +12 -0
  40. package/dist/browser/modules/Dapp/Button/LaunchFrame.d.ts.map +1 -0
  41. package/dist/browser/modules/Dapp/Button/StyledComponents.d.ts +6 -0
  42. package/dist/browser/modules/Dapp/Button/StyledComponents.d.ts.map +1 -0
  43. package/dist/browser/modules/Dapp/Button/StyledDappIconBuilder.d.ts +6 -0
  44. package/dist/browser/modules/Dapp/Button/StyledDappIconBuilder.d.ts.map +1 -0
  45. package/dist/browser/modules/Dapp/Button/hooks/index.d.ts +2 -0
  46. package/dist/browser/modules/Dapp/Button/hooks/index.d.ts.map +1 -0
  47. package/dist/browser/modules/Dapp/Button/hooks/useLaunchPoint.d.ts +10 -0
  48. package/dist/browser/modules/Dapp/Button/hooks/useLaunchPoint.d.ts.map +1 -0
  49. package/dist/browser/modules/Dapp/Button/index.d.ts +5 -0
  50. package/dist/browser/modules/Dapp/Button/index.d.ts.map +1 -0
  51. package/dist/browser/modules/Dapp/Button/lib/decomposeProps.d.ts +13 -0
  52. package/dist/browser/modules/Dapp/Button/lib/decomposeProps.d.ts.map +1 -0
  53. package/dist/browser/modules/Dapp/Button/lib/index.d.ts +2 -0
  54. package/dist/browser/modules/Dapp/Button/lib/index.d.ts.map +1 -0
  55. package/dist/browser/modules/Dapp/Container.d.ts +12 -0
  56. package/dist/browser/modules/Dapp/Container.d.ts.map +1 -0
  57. package/dist/browser/modules/Dapp/ContainerFlexbox.d.ts +10 -0
  58. package/dist/browser/modules/Dapp/ContainerFlexbox.d.ts.map +1 -0
  59. package/dist/browser/modules/Dapp/Debug/Dialog.d.ts +14 -0
  60. package/dist/browser/modules/Dapp/Debug/Dialog.d.ts.map +1 -0
  61. package/dist/browser/modules/Dapp/Debug/index.d.ts +2 -0
  62. package/dist/browser/modules/Dapp/Debug/index.d.ts.map +1 -0
  63. package/dist/browser/modules/Dapp/EnterAnimation.d.ts +7 -0
  64. package/dist/browser/modules/Dapp/EnterAnimation.d.ts.map +1 -0
  65. package/dist/browser/modules/Dapp/Page/DappPage.d.ts +17 -0
  66. package/dist/browser/modules/Dapp/Page/DappPage.d.ts.map +1 -0
  67. package/dist/browser/modules/Dapp/Page/DappPathSwitcher.d.ts +12 -0
  68. package/dist/browser/modules/Dapp/Page/DappPathSwitcher.d.ts.map +1 -0
  69. package/dist/browser/modules/Dapp/Page/DividerChip.d.ts +8 -0
  70. package/dist/browser/modules/Dapp/Page/DividerChip.d.ts.map +1 -0
  71. package/dist/browser/modules/Dapp/Page/Row.d.ts +14 -0
  72. package/dist/browser/modules/Dapp/Page/Row.d.ts.map +1 -0
  73. package/dist/browser/modules/Dapp/Page/index.d.ts +4 -0
  74. package/dist/browser/modules/Dapp/Page/index.d.ts.map +1 -0
  75. package/dist/browser/modules/Dapp/RenderHtml.d.ts +4 -0
  76. package/dist/browser/modules/Dapp/RenderHtml.d.ts.map +1 -0
  77. package/dist/browser/modules/Dapp/index.d.ts +9 -0
  78. package/dist/browser/modules/Dapp/index.d.ts.map +1 -0
  79. package/dist/browser/modules/Dapp/lib/DappState.d.ts +6 -0
  80. package/dist/browser/modules/Dapp/lib/DappState.d.ts.map +1 -0
  81. package/dist/browser/modules/Dapp/lib/DefaultIconSize.d.ts +2 -0
  82. package/dist/browser/modules/Dapp/lib/DefaultIconSize.d.ts.map +1 -0
  83. package/dist/browser/modules/Dapp/lib/deriveDappState.d.ts +4 -0
  84. package/dist/browser/modules/Dapp/lib/deriveDappState.d.ts.map +1 -0
  85. package/dist/browser/modules/Dapp/lib/index.d.ts +4 -0
  86. package/dist/browser/modules/Dapp/lib/index.d.ts.map +1 -0
  87. package/dist/browser/modules/Dapp/modules/Window/AppBar.d.ts +12 -0
  88. package/dist/browser/modules/Dapp/modules/Window/AppBar.d.ts.map +1 -0
  89. package/dist/browser/modules/Dapp/modules/Window/Chrome.d.ts +16 -0
  90. package/dist/browser/modules/Dapp/modules/Window/Chrome.d.ts.map +1 -0
  91. package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts +6 -0
  92. package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts.map +1 -0
  93. package/dist/browser/modules/Dapp/modules/Window/LoadingFlexbox.d.ts +10 -0
  94. package/dist/browser/modules/Dapp/modules/Window/LoadingFlexbox.d.ts.map +1 -0
  95. package/dist/browser/modules/Dapp/modules/Window/MetaTags.d.ts +8 -0
  96. package/dist/browser/modules/Dapp/modules/Window/MetaTags.d.ts.map +1 -0
  97. package/dist/browser/modules/Dapp/modules/Window/NodeManifest.d.ts +2 -0
  98. package/dist/browser/modules/Dapp/modules/Window/NodeManifest.d.ts.map +1 -0
  99. package/dist/browser/modules/Dapp/modules/Window/Rendered.d.ts +5 -0
  100. package/dist/browser/modules/Dapp/modules/Window/Rendered.d.ts.map +1 -0
  101. package/dist/browser/modules/Dapp/modules/Window/Trail.d.ts +8 -0
  102. package/dist/browser/modules/Dapp/modules/Window/Trail.d.ts.map +1 -0
  103. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts +13 -0
  104. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts.map +1 -0
  105. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DeveloperLinkSection.d.ts +7 -0
  106. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DeveloperLinkSection.d.ts.map +1 -0
  107. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/InstallButtonSection.d.ts +8 -0
  108. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/InstallButtonSection.d.ts.map +1 -0
  109. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/SummarySection.d.ts +10 -0
  110. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/SummarySection.d.ts.map +1 -0
  111. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/index.d.ts +2 -0
  112. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/index.d.ts.map +1 -0
  113. package/dist/browser/modules/Dapp/modules/Window/components/index.d.ts +3 -0
  114. package/dist/browser/modules/Dapp/modules/Window/components/index.d.ts.map +1 -0
  115. package/dist/browser/modules/Dapp/modules/Window/components/menu/BottomMenuArea.d.ts +7 -0
  116. package/dist/browser/modules/Dapp/modules/Window/components/menu/BottomMenuArea.d.ts.map +1 -0
  117. package/dist/browser/modules/Dapp/modules/Window/components/menu/BottomNavigation.d.ts +11 -0
  118. package/dist/browser/modules/Dapp/modules/Window/components/menu/BottomNavigation.d.ts.map +1 -0
  119. package/dist/browser/modules/Dapp/modules/Window/components/menu/Drawer.d.ts +15 -0
  120. package/dist/browser/modules/Dapp/modules/Window/components/menu/Drawer.d.ts.map +1 -0
  121. package/dist/browser/modules/Dapp/modules/Window/components/menu/SocialData.d.ts +8 -0
  122. package/dist/browser/modules/Dapp/modules/Window/components/menu/SocialData.d.ts.map +1 -0
  123. package/dist/browser/modules/Dapp/modules/Window/components/menu/StyledListItems.d.ts +5 -0
  124. package/dist/browser/modules/Dapp/modules/Window/components/menu/StyledListItems.d.ts.map +1 -0
  125. package/dist/browser/modules/Dapp/modules/Window/components/menu/img/index.d.ts +3 -0
  126. package/dist/browser/modules/Dapp/modules/Window/components/menu/img/index.d.ts.map +1 -0
  127. package/dist/browser/modules/Dapp/modules/Window/components/menu/index.d.ts +4 -0
  128. package/dist/browser/modules/Dapp/modules/Window/components/menu/index.d.ts.map +1 -0
  129. package/dist/browser/modules/Dapp/modules/Window/hooks/index.d.ts +9 -0
  130. package/dist/browser/modules/Dapp/modules/Window/hooks/index.d.ts.map +1 -0
  131. package/dist/browser/modules/Dapp/modules/Window/hooks/lib/DappPathHelpers.d.ts +6 -0
  132. package/dist/browser/modules/Dapp/modules/Window/hooks/lib/DappPathHelpers.d.ts.map +1 -0
  133. package/dist/browser/modules/Dapp/modules/Window/hooks/lib/detectCustomer.d.ts +19 -0
  134. package/dist/browser/modules/Dapp/modules/Window/hooks/lib/detectCustomer.d.ts.map +1 -0
  135. package/dist/browser/modules/Dapp/modules/Window/hooks/lib/index.d.ts +3 -0
  136. package/dist/browser/modules/Dapp/modules/Window/hooks/lib/index.d.ts.map +1 -0
  137. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/index.d.ts +6 -0
  138. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/index.d.ts.map +1 -0
  139. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useAddDappMenuItems.d.ts +8 -0
  140. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useAddDappMenuItems.d.ts.map +1 -0
  141. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useBuildDappMenuResource.d.ts +14 -0
  142. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useBuildDappMenuResource.d.ts.map +1 -0
  143. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenu.d.ts +7 -0
  144. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenu.d.ts.map +1 -0
  145. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.d.ts +8 -0
  146. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.d.ts.map +1 -0
  147. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuDependencies.d.ts +9 -0
  148. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuDependencies.d.ts.map +1 -0
  149. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/index.d.ts +5 -0
  150. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/index.d.ts.map +1 -0
  151. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.d.ts +4 -0
  152. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.d.ts.map +1 -0
  153. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappIntentRequest.d.ts +3 -0
  154. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappIntentRequest.d.ts.map +1 -0
  155. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.d.ts +15 -0
  156. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.d.ts.map +1 -0
  157. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.d.ts +4 -0
  158. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.d.ts.map +1 -0
  159. package/dist/browser/modules/Dapp/modules/Window/hooks/route/index.d.ts +2 -0
  160. package/dist/browser/modules/Dapp/modules/Window/hooks/route/index.d.ts.map +1 -0
  161. package/dist/browser/modules/Dapp/modules/Window/hooks/useDebugClick.d.ts +6 -0
  162. package/dist/browser/modules/Dapp/modules/Window/hooks/useDebugClick.d.ts.map +1 -0
  163. package/dist/browser/modules/Dapp/modules/Window/hooks/useDecomposeDapp.d.ts +11 -0
  164. package/dist/browser/modules/Dapp/modules/Window/hooks/useDecomposeDapp.d.ts.map +1 -0
  165. package/dist/browser/modules/Dapp/modules/Window/hooks/useExposedNode.d.ts +2 -0
  166. package/dist/browser/modules/Dapp/modules/Window/hooks/useExposedNode.d.ts.map +1 -0
  167. package/dist/browser/modules/Dapp/modules/Window/hooks/useSkipLoadingScreen.d.ts +2 -0
  168. package/dist/browser/modules/Dapp/modules/Window/hooks/useSkipLoadingScreen.d.ts.map +1 -0
  169. package/dist/browser/modules/Dapp/modules/Window/hooks/useSyncOsRegisteredAccessInterfaces.d.ts +7 -0
  170. package/dist/browser/modules/Dapp/modules/Window/hooks/useSyncOsRegisteredAccessInterfaces.d.ts.map +1 -0
  171. package/dist/browser/modules/Dapp/modules/Window/index.d.ts +8 -0
  172. package/dist/browser/modules/Dapp/modules/Window/index.d.ts.map +1 -0
  173. package/dist/browser/modules/Dapp/modules/Window/types/DappMenuProperties.d.ts +9 -0
  174. package/dist/browser/modules/Dapp/modules/Window/types/DappMenuProperties.d.ts.map +1 -0
  175. package/dist/browser/modules/Dapp/modules/Window/types/DappWindowProps.d.ts +13 -0
  176. package/dist/browser/modules/Dapp/modules/Window/types/DappWindowProps.d.ts.map +1 -0
  177. package/dist/browser/modules/Dapp/modules/Window/types/index.d.ts +3 -0
  178. package/dist/browser/modules/Dapp/modules/Window/types/index.d.ts.map +1 -0
  179. package/dist/browser/modules/Dapp/modules/access-interface/components/Dialog.d.ts +10 -0
  180. package/dist/browser/modules/Dapp/modules/access-interface/components/Dialog.d.ts.map +1 -0
  181. package/dist/browser/modules/Dapp/modules/access-interface/components/Flexbox.d.ts +7 -0
  182. package/dist/browser/modules/Dapp/modules/access-interface/components/Flexbox.d.ts.map +1 -0
  183. package/dist/browser/modules/Dapp/modules/access-interface/components/index.d.ts +3 -0
  184. package/dist/browser/modules/Dapp/modules/access-interface/components/index.d.ts.map +1 -0
  185. package/dist/browser/modules/Dapp/modules/access-interface/hooks/index.d.ts +2 -0
  186. package/dist/browser/modules/Dapp/modules/access-interface/hooks/index.d.ts.map +1 -0
  187. package/dist/browser/modules/Dapp/modules/access-interface/hooks/useDialogState.d.ts +9 -0
  188. package/dist/browser/modules/Dapp/modules/access-interface/hooks/useDialogState.d.ts.map +1 -0
  189. package/dist/browser/modules/Dapp/modules/access-interface/index.d.ts +3 -0
  190. package/dist/browser/modules/Dapp/modules/access-interface/index.d.ts.map +1 -0
  191. package/dist/browser/modules/Dapp/modules/index.d.ts +3 -0
  192. package/dist/browser/modules/Dapp/modules/index.d.ts.map +1 -0
  193. package/dist/browser/modules/Dapp/useDappCaller.d.ts +4 -0
  194. package/dist/browser/modules/Dapp/useDappCaller.d.ts.map +1 -0
  195. package/dist/browser/modules/LoadingOsLogo/LoadingOsLogo.d.ts +9 -0
  196. package/dist/browser/modules/LoadingOsLogo/LoadingOsLogo.d.ts.map +1 -0
  197. package/dist/browser/modules/LoadingOsLogo/img/index.d.ts +2 -0
  198. package/dist/browser/modules/LoadingOsLogo/img/index.d.ts.map +1 -0
  199. package/dist/browser/modules/LoadingOsLogo/index.d.ts +2 -0
  200. package/dist/browser/modules/LoadingOsLogo/index.d.ts.map +1 -0
  201. package/dist/browser/modules/XyOsUi/contexts/XyOsUiContext.d.ts +5 -0
  202. package/dist/browser/modules/XyOsUi/contexts/XyOsUiContext.d.ts.map +1 -0
  203. package/dist/browser/modules/XyOsUi/contexts/index.d.ts +2 -0
  204. package/dist/browser/modules/XyOsUi/contexts/index.d.ts.map +1 -0
  205. package/dist/browser/modules/XyOsUi/index.d.ts +3 -0
  206. package/dist/browser/modules/XyOsUi/index.d.ts.map +1 -0
  207. package/dist/browser/modules/XyOsUi/lib/XyOsUi.d.ts +17 -0
  208. package/dist/browser/modules/XyOsUi/lib/XyOsUi.d.ts.map +1 -0
  209. package/dist/browser/modules/XyOsUi/lib/index.d.ts +2 -0
  210. package/dist/browser/modules/XyOsUi/lib/index.d.ts.map +1 -0
  211. package/dist/browser/modules/access-requests/NameServiceRegistrationHooks.d.ts +10 -0
  212. package/dist/browser/modules/access-requests/NameServiceRegistrationHooks.d.ts.map +1 -0
  213. package/dist/browser/modules/access-requests/index.d.ts +3 -0
  214. package/dist/browser/modules/access-requests/index.d.ts.map +1 -0
  215. package/dist/browser/modules/access-requests/useBuildDappAccessRequestResource.d.ts +12 -0
  216. package/dist/browser/modules/access-requests/useBuildDappAccessRequestResource.d.ts.map +1 -0
  217. package/dist/browser/modules/bios/hooks/index.d.ts +3 -0
  218. package/dist/browser/modules/bios/hooks/index.d.ts.map +1 -0
  219. package/dist/browser/modules/bios/hooks/useBios.d.ts +3 -0
  220. package/dist/browser/modules/bios/hooks/useBios.d.ts.map +1 -0
  221. package/dist/browser/modules/bios/hooks/useKernel.d.ts +4 -0
  222. package/dist/browser/modules/bios/hooks/useKernel.d.ts.map +1 -0
  223. package/dist/browser/modules/bios/index.d.ts +2 -0
  224. package/dist/browser/modules/bios/index.d.ts.map +1 -0
  225. package/dist/browser/modules/dapps/accounts/components/AccountCard.d.ts +14 -0
  226. package/dist/browser/modules/dapps/accounts/components/AccountCard.d.ts.map +1 -0
  227. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/ShiftAnimation.d.ts +10 -0
  228. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/ShiftAnimation.d.ts.map +1 -0
  229. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/index.d.ts +2 -0
  230. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/index.d.ts.map +1 -0
  231. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPoint.d.ts +4 -0
  232. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPoint.d.ts.map +1 -0
  233. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPointList.d.ts +7 -0
  234. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPointList.d.ts.map +1 -0
  235. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/index.d.ts +3 -0
  236. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/index.d.ts.map +1 -0
  237. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/index.d.ts +3 -0
  238. package/dist/browser/modules/dapps/accounts/components/AnimatedComponents/index.d.ts.map +1 -0
  239. package/dist/browser/modules/dapps/accounts/components/InputFields/CoinbaseEmail.d.ts +7 -0
  240. package/dist/browser/modules/dapps/accounts/components/InputFields/CoinbaseEmail.d.ts.map +1 -0
  241. package/dist/browser/modules/dapps/accounts/components/InputFields/PrimaryCryptowallet.d.ts +7 -0
  242. package/dist/browser/modules/dapps/accounts/components/InputFields/PrimaryCryptowallet.d.ts.map +1 -0
  243. package/dist/browser/modules/dapps/accounts/components/InputFields/SecondaryCryptowallet.d.ts +7 -0
  244. package/dist/browser/modules/dapps/accounts/components/InputFields/SecondaryCryptowallet.d.ts.map +1 -0
  245. package/dist/browser/modules/dapps/accounts/components/InputFields/index.d.ts +4 -0
  246. package/dist/browser/modules/dapps/accounts/components/InputFields/index.d.ts.map +1 -0
  247. package/dist/browser/modules/dapps/accounts/components/PaymentMethods.d.ts +4 -0
  248. package/dist/browser/modules/dapps/accounts/components/PaymentMethods.d.ts.map +1 -0
  249. package/dist/browser/modules/dapps/accounts/components/index.d.ts +4 -0
  250. package/dist/browser/modules/dapps/accounts/components/index.d.ts.map +1 -0
  251. package/dist/browser/modules/dapps/accounts/hooks/index.d.ts +2 -0
  252. package/dist/browser/modules/dapps/accounts/hooks/index.d.ts.map +1 -0
  253. package/dist/browser/modules/dapps/accounts/hooks/useAccountArchivist.d.ts +2 -0
  254. package/dist/browser/modules/dapps/accounts/hooks/useAccountArchivist.d.ts.map +1 -0
  255. package/dist/browser/modules/dapps/accounts/icon/Icon.d.ts +4 -0
  256. package/dist/browser/modules/dapps/accounts/icon/Icon.d.ts.map +1 -0
  257. package/dist/browser/modules/dapps/accounts/icon/index.d.ts +2 -0
  258. package/dist/browser/modules/dapps/accounts/icon/index.d.ts.map +1 -0
  259. package/dist/browser/modules/dapps/accounts/index.d.ts +4 -0
  260. package/dist/browser/modules/dapps/accounts/index.d.ts.map +1 -0
  261. package/dist/browser/modules/dapps/accounts/models/CreditCardInput.d.ts +18 -0
  262. package/dist/browser/modules/dapps/accounts/models/CreditCardInput.d.ts.map +1 -0
  263. package/dist/browser/modules/dapps/accounts/models/index.d.ts +2 -0
  264. package/dist/browser/modules/dapps/accounts/models/index.d.ts.map +1 -0
  265. package/dist/browser/modules/dapps/index.d.ts +4 -0
  266. package/dist/browser/modules/dapps/index.d.ts.map +1 -0
  267. package/dist/browser/modules/dapps/name-service/DomainIcon.d.ts +4 -0
  268. package/dist/browser/modules/dapps/name-service/DomainIcon.d.ts.map +1 -0
  269. package/dist/browser/modules/dapps/name-service/index.d.ts +2 -0
  270. package/dist/browser/modules/dapps/name-service/index.d.ts.map +1 -0
  271. package/dist/browser/modules/dapps/table/NextIteratorFlexbox.d.ts +9 -0
  272. package/dist/browser/modules/dapps/table/NextIteratorFlexbox.d.ts.map +1 -0
  273. package/dist/browser/modules/dapps/table/head/Payload.d.ts +8 -0
  274. package/dist/browser/modules/dapps/table/head/Payload.d.ts.map +1 -0
  275. package/dist/browser/modules/dapps/table/head/Schema.d.ts +5 -0
  276. package/dist/browser/modules/dapps/table/head/Schema.d.ts.map +1 -0
  277. package/dist/browser/modules/dapps/table/head/components/Head.d.ts +9 -0
  278. package/dist/browser/modules/dapps/table/head/components/Head.d.ts.map +1 -0
  279. package/dist/browser/modules/dapps/table/head/components/StyledTableRowHeader.d.ts +2 -0
  280. package/dist/browser/modules/dapps/table/head/components/StyledTableRowHeader.d.ts.map +1 -0
  281. package/dist/browser/modules/dapps/table/head/components/index.d.ts +2 -0
  282. package/dist/browser/modules/dapps/table/head/components/index.d.ts.map +1 -0
  283. package/dist/browser/modules/dapps/table/head/hooks/index.d.ts +2 -0
  284. package/dist/browser/modules/dapps/table/head/hooks/index.d.ts.map +1 -0
  285. package/dist/browser/modules/dapps/table/head/hooks/useVisibleColumns.d.ts +3 -0
  286. package/dist/browser/modules/dapps/table/head/hooks/useVisibleColumns.d.ts.map +1 -0
  287. package/dist/browser/modules/dapps/table/head/index.d.ts +5 -0
  288. package/dist/browser/modules/dapps/table/head/index.d.ts.map +1 -0
  289. package/dist/browser/modules/dapps/table/index.d.ts +3 -0
  290. package/dist/browser/modules/dapps/table/index.d.ts.map +1 -0
  291. package/dist/browser/modules/index.d.ts +13 -0
  292. package/dist/browser/modules/index.d.ts.map +1 -0
  293. package/dist/browser/modules/intent/DappIntentResourceHooks.d.ts +12 -0
  294. package/dist/browser/modules/intent/DappIntentResourceHooks.d.ts.map +1 -0
  295. package/dist/browser/modules/intent/index.d.ts +8 -0
  296. package/dist/browser/modules/intent/index.d.ts.map +1 -0
  297. package/dist/browser/modules/intent/useClearIntents.d.ts +2 -0
  298. package/dist/browser/modules/intent/useClearIntents.d.ts.map +1 -0
  299. package/dist/browser/modules/intent/useDappIntentCaller.d.ts +4 -0
  300. package/dist/browser/modules/intent/useDappIntentCaller.d.ts.map +1 -0
  301. package/dist/browser/modules/intent/useDappIntentListener.d.ts +8 -0
  302. package/dist/browser/modules/intent/useDappIntentListener.d.ts.map +1 -0
  303. package/dist/browser/modules/intent/useDappIntentListener2.d.ts +11 -0
  304. package/dist/browser/modules/intent/useDappIntentListener2.d.ts.map +1 -0
  305. package/dist/browser/modules/intent/useNavigateIntent.d.ts +7 -0
  306. package/dist/browser/modules/intent/useNavigateIntent.d.ts.map +1 -0
  307. package/dist/browser/modules/intent/useSendDappIntent.d.ts +5 -0
  308. package/dist/browser/modules/intent/useSendDappIntent.d.ts.map +1 -0
  309. package/dist/browser/modules/network/components/LoadingIndicator.d.ts +6 -0
  310. package/dist/browser/modules/network/components/LoadingIndicator.d.ts.map +1 -0
  311. package/dist/browser/modules/network/components/NetworkButton.d.ts +4 -0
  312. package/dist/browser/modules/network/components/NetworkButton.d.ts.map +1 -0
  313. package/dist/browser/modules/network/components/NetworkReady.d.ts +8 -0
  314. package/dist/browser/modules/network/components/NetworkReady.d.ts.map +1 -0
  315. package/dist/browser/modules/network/components/StyledLoadingIndicator.d.ts +2 -0
  316. package/dist/browser/modules/network/components/StyledLoadingIndicator.d.ts.map +1 -0
  317. package/dist/browser/modules/network/components/index.d.ts +4 -0
  318. package/dist/browser/modules/network/components/index.d.ts.map +1 -0
  319. package/dist/browser/modules/network/hooks/index.d.ts +3 -0
  320. package/dist/browser/modules/network/hooks/index.d.ts.map +1 -0
  321. package/dist/browser/modules/network/hooks/lib/NetworkState.d.ts +8 -0
  322. package/dist/browser/modules/network/hooks/lib/NetworkState.d.ts.map +1 -0
  323. package/dist/browser/modules/network/hooks/lib/createNetworkState.d.ts +4 -0
  324. package/dist/browser/modules/network/hooks/lib/createNetworkState.d.ts.map +1 -0
  325. package/dist/browser/modules/network/hooks/lib/index.d.ts +3 -0
  326. package/dist/browser/modules/network/hooks/lib/index.d.ts.map +1 -0
  327. package/dist/browser/modules/network/hooks/useOsNetwork.d.ts +3 -0
  328. package/dist/browser/modules/network/hooks/useOsNetwork.d.ts.map +1 -0
  329. package/dist/browser/modules/network/hooks/useXyoPublicNetwork.d.ts +3 -0
  330. package/dist/browser/modules/network/hooks/useXyoPublicNetwork.d.ts.map +1 -0
  331. package/dist/browser/modules/network/index.d.ts +3 -0
  332. package/dist/browser/modules/network/index.d.ts.map +1 -0
  333. package/dist/browser/modules/os/hooks/index.d.ts +9 -0
  334. package/dist/browser/modules/os/hooks/index.d.ts.map +1 -0
  335. package/dist/browser/modules/os/hooks/useDappContextCreator.d.ts +9 -0
  336. package/dist/browser/modules/os/hooks/useDappContextCreator.d.ts.map +1 -0
  337. package/dist/browser/modules/os/hooks/useDappRegistrationResults.d.ts +3 -0
  338. package/dist/browser/modules/os/hooks/useDappRegistrationResults.d.ts.map +1 -0
  339. package/dist/browser/modules/os/hooks/useDappRegistry.d.ts +3 -0
  340. package/dist/browser/modules/os/hooks/useDappRegistry.d.ts.map +1 -0
  341. package/dist/browser/modules/os/hooks/useDappSeedPhraseRepository.d.ts +3 -0
  342. package/dist/browser/modules/os/hooks/useDappSeedPhraseRepository.d.ts.map +1 -0
  343. package/dist/browser/modules/os/hooks/useOsSettingsCaller.d.ts +4 -0
  344. package/dist/browser/modules/os/hooks/useOsSettingsCaller.d.ts.map +1 -0
  345. package/dist/browser/modules/os/hooks/usePhraseFile.d.ts +7 -0
  346. package/dist/browser/modules/os/hooks/usePhraseFile.d.ts.map +1 -0
  347. package/dist/browser/modules/os/hooks/useTabs.d.ts +3 -0
  348. package/dist/browser/modules/os/hooks/useTabs.d.ts.map +1 -0
  349. package/dist/browser/modules/os/hooks/useWidgetDapps.d.ts +8 -0
  350. package/dist/browser/modules/os/hooks/useWidgetDapps.d.ts.map +1 -0
  351. package/dist/browser/modules/os/index.d.ts +2 -0
  352. package/dist/browser/modules/os/index.d.ts.map +1 -0
  353. package/dist/browser/modules/resource/ResourceHooks.d.ts +20 -0
  354. package/dist/browser/modules/resource/ResourceHooks.d.ts.map +1 -0
  355. package/dist/browser/modules/resource/index.d.ts +4 -0
  356. package/dist/browser/modules/resource/index.d.ts.map +1 -0
  357. package/dist/browser/modules/resource/useCleanup.d.ts +3 -0
  358. package/dist/browser/modules/resource/useCleanup.d.ts.map +1 -0
  359. package/dist/browser/modules/resource/useSyncExternalPayloadStore.d.ts +6 -0
  360. package/dist/browser/modules/resource/useSyncExternalPayloadStore.d.ts.map +1 -0
  361. package/dist/browser/modules/stack/index.d.ts +2 -0
  362. package/dist/browser/modules/stack/index.d.ts.map +1 -0
  363. package/dist/browser/modules/stack/useStackReady.d.ts +4 -0
  364. package/dist/browser/modules/stack/useStackReady.d.ts.map +1 -0
  365. package/dist/browser/modules/widgets/StackOfWidgets.d.ts +3 -0
  366. package/dist/browser/modules/widgets/StackOfWidgets.d.ts.map +1 -0
  367. package/dist/browser/modules/widgets/Types/BarGraph/HorizontalBarGraph.d.ts +11 -0
  368. package/dist/browser/modules/widgets/Types/BarGraph/HorizontalBarGraph.d.ts.map +1 -0
  369. package/dist/browser/modules/widgets/Types/BarGraph/StyledLinearProgress.d.ts +2 -0
  370. package/dist/browser/modules/widgets/Types/BarGraph/StyledLinearProgress.d.ts.map +1 -0
  371. package/dist/browser/modules/widgets/Types/BarGraph/index.d.ts +3 -0
  372. package/dist/browser/modules/widgets/Types/BarGraph/index.d.ts.map +1 -0
  373. package/dist/browser/modules/widgets/Types/DataColumns/TwoColFourStat.d.ts +10 -0
  374. package/dist/browser/modules/widgets/Types/DataColumns/TwoColFourStat.d.ts.map +1 -0
  375. package/dist/browser/modules/widgets/Types/DataColumns/TwoColTwoStat.d.ts +8 -0
  376. package/dist/browser/modules/widgets/Types/DataColumns/TwoColTwoStat.d.ts.map +1 -0
  377. package/dist/browser/modules/widgets/Types/DataColumns/index.d.ts +2 -0
  378. package/dist/browser/modules/widgets/Types/DataColumns/index.d.ts.map +1 -0
  379. package/dist/browser/modules/widgets/Types/Examples/BarGraph.d.ts +3 -0
  380. package/dist/browser/modules/widgets/Types/Examples/BarGraph.d.ts.map +1 -0
  381. package/dist/browser/modules/widgets/Types/Examples/BooleanTable.d.ts +3 -0
  382. package/dist/browser/modules/widgets/Types/Examples/BooleanTable.d.ts.map +1 -0
  383. package/dist/browser/modules/widgets/Types/Examples/TwoColTwoStat.d.ts +3 -0
  384. package/dist/browser/modules/widgets/Types/Examples/TwoColTwoStat.d.ts.map +1 -0
  385. package/dist/browser/modules/widgets/Types/Examples/index.d.ts +4 -0
  386. package/dist/browser/modules/widgets/Types/Examples/index.d.ts.map +1 -0
  387. package/dist/browser/modules/widgets/Types/Stat/Insight.d.ts +8 -0
  388. package/dist/browser/modules/widgets/Types/Stat/Insight.d.ts.map +1 -0
  389. package/dist/browser/modules/widgets/Types/Stat/InsightStatProps.d.ts +7 -0
  390. package/dist/browser/modules/widgets/Types/Stat/InsightStatProps.d.ts.map +1 -0
  391. package/dist/browser/modules/widgets/Types/Stat/Stat.d.ts +7 -0
  392. package/dist/browser/modules/widgets/Types/Stat/Stat.d.ts.map +1 -0
  393. package/dist/browser/modules/widgets/Types/Stat/Subtitle.d.ts +2 -0
  394. package/dist/browser/modules/widgets/Types/Stat/Subtitle.d.ts.map +1 -0
  395. package/dist/browser/modules/widgets/Types/Stat/Unit.d.ts +2 -0
  396. package/dist/browser/modules/widgets/Types/Stat/Unit.d.ts.map +1 -0
  397. package/dist/browser/modules/widgets/Types/Stat/Value.d.ts +2 -0
  398. package/dist/browser/modules/widgets/Types/Stat/Value.d.ts.map +1 -0
  399. package/dist/browser/modules/widgets/Types/Stat/index.d.ts +4 -0
  400. package/dist/browser/modules/widgets/Types/Stat/index.d.ts.map +1 -0
  401. package/dist/browser/modules/widgets/Types/Tables/BooleanTable.d.ts +19 -0
  402. package/dist/browser/modules/widgets/Types/Tables/BooleanTable.d.ts.map +1 -0
  403. package/dist/browser/modules/widgets/Types/Tables/index.d.ts +2 -0
  404. package/dist/browser/modules/widgets/Types/Tables/index.d.ts.map +1 -0
  405. package/dist/browser/modules/widgets/Types/index.d.ts +5 -0
  406. package/dist/browser/modules/widgets/Types/index.d.ts.map +1 -0
  407. package/dist/browser/modules/widgets/WidgetCard.d.ts +11 -0
  408. package/dist/browser/modules/widgets/WidgetCard.d.ts.map +1 -0
  409. package/dist/browser/modules/widgets/WidgetCardExamples.d.ts +4 -0
  410. package/dist/browser/modules/widgets/WidgetCardExamples.d.ts.map +1 -0
  411. package/dist/browser/modules/widgets/index.d.ts +3 -0
  412. package/dist/browser/modules/widgets/index.d.ts.map +1 -0
  413. package/dist/browser/moss-dark@3x-HV35CF34.webp +0 -0
  414. package/dist/browser/moss-light@3x-UH4AJQR5.webp +0 -0
  415. package/dist/browser/ocean-dark@3x-LDW7E4ZL.webp +0 -0
  416. package/dist/browser/ocean-light@3x-FP7M2MO7.webp +0 -0
  417. package/dist/browser/peachYogurt-dark@3x-UWHJTY5O.webp +0 -0
  418. package/dist/browser/peachYogurt-light@3x-X7Y7NU2Y.webp +0 -0
  419. package/dist/browser/settings/Theme/ThemeCssVars.d.ts +19 -0
  420. package/dist/browser/settings/Theme/ThemeCssVars.d.ts.map +1 -0
  421. package/dist/browser/settings/Theme/ThemeProvider.d.ts +5 -0
  422. package/dist/browser/settings/Theme/ThemeProvider.d.ts.map +1 -0
  423. package/dist/browser/settings/Theme/index.d.ts +2 -0
  424. package/dist/browser/settings/Theme/index.d.ts.map +1 -0
  425. package/dist/browser/settings/index.d.ts +2 -0
  426. package/dist/browser/settings/index.d.ts.map +1 -0
  427. package/dist/browser/sherbet-dark@3x-UAIXX4RP.webp +0 -0
  428. package/dist/browser/sherbet-light@3x-2Q2EFFWE.webp +0 -0
  429. package/dist/browser/spring-dark@3x-XU3GBWBF.webp +0 -0
  430. package/dist/browser/spring-light@3x-EFV3QMVY.webp +0 -0
  431. package/dist/browser/sunset-dark@3x-F25FUK74.webp +0 -0
  432. package/dist/browser/sunset-light@3x-B5T3EVGS.webp +0 -0
  433. package/dist/browser/utils/DappInstallTypeFilters.d.ts +3 -0
  434. package/dist/browser/utils/DappInstallTypeFilters.d.ts.map +1 -0
  435. package/dist/browser/utils/getApiDomain.d.ts +3 -0
  436. package/dist/browser/utils/getApiDomain.d.ts.map +1 -0
  437. package/dist/browser/utils/index.d.ts +4 -0
  438. package/dist/browser/utils/index.d.ts.map +1 -0
  439. package/dist/browser/utils/useOnWindowResize.d.ts +2 -0
  440. package/dist/browser/utils/useOnWindowResize.d.ts.map +1 -0
  441. package/dist/browser/xyo-dark@3x-N62LIF7V.webp +0 -0
  442. package/dist/browser/xyo-light@3x-5S6CF5P4.webp +0 -0
  443. package/package.json +9 -9
@@ -0,0 +1,4701 @@
1
+ // src/helpers/BridgeActivityHelper.ts
2
+ import { assertEx, BaseEmitter } from "@xylabs/sdk-js";
3
+ import { GenericPayloadDivinerConfigSchema } from "@xyo-network/diviner-payload-generic";
4
+ import { PayloadDivinerQuerySchema } from "@xyo-network/diviner-payload-model";
5
+ var BridgeActivityHelper = class extends BaseEmitter {
6
+ get archivist() {
7
+ return assertEx(this.params.archivist.deref(), () => "Archivist is missing");
8
+ }
9
+ get diviner() {
10
+ const result = assertEx(this.params.diviner.deref(), () => "Diviner is missing");
11
+ assertEx(result.config.schema === GenericPayloadDivinerConfigSchema, () => "Diviner is not a generic payload diviner");
12
+ return result;
13
+ }
14
+ next(options) {
15
+ return this.archivist.next(options);
16
+ }
17
+ nextByAddress(address, options) {
18
+ const query = {
19
+ address,
20
+ ...options,
21
+ schema: PayloadDivinerQuerySchema
22
+ };
23
+ return this.diviner.divine([query]);
24
+ }
25
+ };
26
+
27
+ // src/helpers/BrowserLocator.ts
28
+ import { IndexedDbArchivist } from "@xyo-network/archivist-indexeddb";
29
+ import { IndexedDbBoundWitnessDiviner } from "@xyo-network/diviner-boundwitness-indexeddb";
30
+ import { GenericPayloadDiviner } from "@xyo-network/diviner-payload-generic";
31
+ import { IndexedDbPayloadDiviner } from "@xyo-network/diviner-payload-indexeddb";
32
+ import { asSchema } from "@xyo-network/payload-model";
33
+ import { ModuleFactoryLocator } from "@xyo-network/sdk-js";
34
+ var GenericPayloadDivinerTags = { "network.xyo.generic.payload.diviner": "GenericPayloadDiviner" };
35
+ var BrowserLocator = new ModuleFactoryLocator();
36
+ BrowserLocator.register(GenericPayloadDiviner.factory(), GenericPayloadDivinerTags);
37
+ BrowserLocator.register(IndexedDbArchivist.factory(), { "network.xyo.archivist.persistence.scope": "device" }, asSchema("network.xyo.archivist.config", true));
38
+ BrowserLocator.register(IndexedDbPayloadDiviner.factory(), { "network.xyo.archivist.persistence.scope": "device" }, asSchema("network.xyo.diviner.payload.config", true));
39
+ BrowserLocator.register(
40
+ IndexedDbBoundWitnessDiviner.factory(),
41
+ { "network.xyo.archivist.persistence.scope": "device" },
42
+ asSchema("network.xyo.diviner.boundwitness.config", true)
43
+ );
44
+ BrowserLocator.freeze();
45
+
46
+ // src/helpers/monitor/XyOsBrowserMonitor.ts
47
+ import { XyOsMonitor } from "@xyo-network/os-runtime";
48
+ var XyOsBrowserMonitor = class extends XyOsMonitor {
49
+ connection() {
50
+ try {
51
+ if (globalThis !== void 0) {
52
+ return "connection" in globalThis.navigator ? globalThis.navigator.connection : void 0;
53
+ }
54
+ } catch {
55
+ return;
56
+ }
57
+ }
58
+ };
59
+
60
+ // src/img/backgrounds/index.ts
61
+ import candyDarkImport from "./candy-dark@3x-N2S7K4QB.webp";
62
+ import candyLightImport from "./candy-light@3x-WKECMFRP.webp";
63
+ import candyAppleDarkImport from "./candyApple-dark@3x-HGSPETPR.webp";
64
+ import candyAppleLightImport from "./candyApple-light@3x-OWA5XNTF.webp";
65
+ import mossDarkImport from "./moss-dark@3x-HV35CF34.webp";
66
+ import mossLightImport from "./moss-light@3x-UH4AJQR5.webp";
67
+ import oceanDarkImport from "./ocean-dark@3x-LDW7E4ZL.webp";
68
+ import oceanLightImport from "./ocean-light@3x-FP7M2MO7.webp";
69
+ import peachYogurtDarkImport from "./peachYogurt-dark@3x-UWHJTY5O.webp";
70
+ import peachYogurtLightImport from "./peachYogurt-light@3x-X7Y7NU2Y.webp";
71
+ import sherbetDarkImport from "./sherbet-dark@3x-UAIXX4RP.webp";
72
+ import sherbetLightImport from "./sherbet-light@3x-2Q2EFFWE.webp";
73
+ import springDarkImport from "./spring-dark@3x-XU3GBWBF.webp";
74
+ import springLightImport from "./spring-light@3x-EFV3QMVY.webp";
75
+ import sunsetDarkImport from "./sunset-dark@3x-F25FUK74.webp";
76
+ import sunsetLightImport from "./sunset-light@3x-B5T3EVGS.webp";
77
+ import xyoDarkImport from "./xyo-dark@3x-N62LIF7V.webp";
78
+ import xyoLightImport from "./xyo-light@3x-5S6CF5P4.webp";
79
+ var candyDark = candyDarkImport;
80
+ var candyLight = candyLightImport;
81
+ var candyAppleDark = candyAppleDarkImport;
82
+ var candyAppleLight = candyAppleLightImport;
83
+ var mossDark = mossDarkImport;
84
+ var mossLight = mossLightImport;
85
+ var oceanDark = oceanDarkImport;
86
+ var oceanLight = oceanLightImport;
87
+ var peachYogurtDark = peachYogurtDarkImport;
88
+ var peachYogurtLight = peachYogurtLightImport;
89
+ var sherbetDark = sherbetDarkImport;
90
+ var sherbetLight = sherbetLightImport;
91
+ var springDark = springDarkImport;
92
+ var springLight = springLightImport;
93
+ var sunsetDark = sunsetDarkImport;
94
+ var sunsetLight = sunsetLightImport;
95
+ var xyoDark = xyoDarkImport;
96
+ var xyoLight = xyoLightImport;
97
+
98
+ // src/helpers/NodePalettes.ts
99
+ var OsPalettes = {
100
+ candy: {
101
+ darkModeWallpaper: candyDark,
102
+ lightModeWallpaper: candyLight,
103
+ nameCode: "candy",
104
+ readableName: "Candy"
105
+ },
106
+ candyApple: {
107
+ darkModeWallpaper: candyAppleDark,
108
+ lightModeWallpaper: candyAppleLight,
109
+ nameCode: "candyApple",
110
+ readableName: "Candy Apple"
111
+ },
112
+ moss: {
113
+ darkModeWallpaper: mossDark,
114
+ lightModeWallpaper: mossLight,
115
+ nameCode: "moss",
116
+ readableName: "Moss"
117
+ },
118
+ ocean: {
119
+ darkModeWallpaper: oceanDark,
120
+ lightModeWallpaper: oceanLight,
121
+ nameCode: "ocean",
122
+ readableName: "Ocean"
123
+ },
124
+ peachYogurt: {
125
+ darkModeWallpaper: peachYogurtDark,
126
+ lightModeWallpaper: peachYogurtLight,
127
+ nameCode: "peachYogurt",
128
+ readableName: "Peach Yogurt"
129
+ },
130
+ sherbet: {
131
+ darkModeWallpaper: sherbetDark,
132
+ lightModeWallpaper: sherbetLight,
133
+ nameCode: "sherbet",
134
+ readableName: "Sherbet"
135
+ },
136
+ spring: {
137
+ darkModeWallpaper: springDark,
138
+ lightModeWallpaper: springLight,
139
+ nameCode: "spring",
140
+ readableName: "Spring"
141
+ },
142
+ sunset: {
143
+ darkModeWallpaper: sunsetDark,
144
+ lightModeWallpaper: sunsetLight,
145
+ nameCode: "sunset",
146
+ readableName: "Sunset"
147
+ },
148
+ xyo: {
149
+ darkModeWallpaper: xyoDark,
150
+ lightModeWallpaper: xyoLight,
151
+ nameCode: "xyo",
152
+ readableName: "XYO"
153
+ }
154
+ };
155
+ var getNodePaletteByNameCode = (nameCode) => {
156
+ const castNameCode = nameCode;
157
+ return OsPalettes[castNameCode];
158
+ };
159
+
160
+ // src/helpers/widget/Caller.tsx
161
+ import {
162
+ assertEx as assertEx2,
163
+ fulfilled,
164
+ rejected
165
+ } from "@xylabs/sdk-js";
166
+ import { WidgetTraySchema } from "@xyo-network/os-model";
167
+ import { OsCallerBase } from "@xyo-network/os-runtime";
168
+ import { jsx } from "react/jsx-runtime";
169
+ var WidgetCaller = class extends OsCallerBase {
170
+ _registeredDappSets;
171
+ _widgetTrayLayout;
172
+ constructor(context, _registeredDappSets, _widgetTrayLayout) {
173
+ super(context);
174
+ this._registeredDappSets = _registeredDappSets;
175
+ this._widgetTrayLayout = _widgetTrayLayout;
176
+ }
177
+ get dappsAsObject() {
178
+ const acc = {};
179
+ for (const dapp of this.registeredDappSets) {
180
+ acc[dapp.dapp.config.name] = dapp;
181
+ }
182
+ return acc;
183
+ }
184
+ get registeredDappSets() {
185
+ return assertEx2(this._registeredDappSets, () => "Registered Dapp Sets not available");
186
+ }
187
+ get widgetTrayLayout() {
188
+ return assertEx2(this._widgetTrayLayout, () => "Widget Tray Layout not available");
189
+ }
190
+ async buildWidgetComponents() {
191
+ const widgetTray = this.widgetTrayFromLayout(this.widgetTrayLayout);
192
+ const results = await Promise.allSettled(
193
+ widgetTray.widgetConfigs.map(async (config2) => {
194
+ const Param = this.dappsAsObject[config2.dappId].dapp.params.modes[config2.mode ?? config2.dappId]?.component;
195
+ let payload;
196
+ if (config2.configHash) {
197
+ const archivist = await this.getDappsArchivist();
198
+ const foundConfig = assertEx2((await archivist.get([config2.configHash]))?.[0], () => `Config - ${config2.configHash} not found`);
199
+ payload = foundConfig;
200
+ }
201
+ return Param ? /* @__PURE__ */ jsx(Param, { payload }, config2.configHash ?? config2.dappId) : void 0;
202
+ })
203
+ );
204
+ const successfulResults = results.filter(fulfilled).map((result) => result.value);
205
+ const failedResults = results.filter(rejected).map((result) => {
206
+ return result.reason instanceof Error ? result.reason : new Error(String(result.reason));
207
+ });
208
+ return [successfulResults, failedResults];
209
+ }
210
+ // build a new widget config from the base provided by the dapp
211
+ // and pass the config hash from the widgetLayout to the new widgetConfig
212
+ buildWidgetConfig(widgetConfigToBuild, configHash) {
213
+ const clonedWidgetConfig = this.cloneWidgetConfig(widgetConfigToBuild);
214
+ return {
215
+ ...clonedWidgetConfig,
216
+ configHash
217
+ };
218
+ }
219
+ cloneWidgetConfig(widgetConfig) {
220
+ return structuredClone(widgetConfig);
221
+ }
222
+ widgetTrayFromLayout(widgetLayout) {
223
+ const targetWidgetConfigs = [];
224
+ const { layout, label: trayLabel } = widgetLayout;
225
+ for (const dappWidgetLayout of layout) {
226
+ const {
227
+ dappId,
228
+ mode,
229
+ configHash
230
+ } = dappWidgetLayout;
231
+ const dappSet = this.registeredDappSets.find((dappSet2) => dappSet2.dapp.config.name === dappId);
232
+ if (!dappSet) {
233
+ console.error("unable to find registered dapp set for", dappId);
234
+ continue;
235
+ }
236
+ const widgetConfigToBuild = dappSet.dapp.widgetConfigs.find((config3) => config3.mode ? config3.mode === mode : mode === config3.dappId);
237
+ if (!widgetConfigToBuild) {
238
+ console.error("unable to find widget config for", mode);
239
+ continue;
240
+ }
241
+ const config2 = this.buildWidgetConfig(widgetConfigToBuild, configHash);
242
+ targetWidgetConfigs.push(config2);
243
+ }
244
+ return {
245
+ label: trayLabel ?? "Widget Tray",
246
+ position: "bottom",
247
+ schema: WidgetTraySchema,
248
+ widgetConfigs: targetWidgetConfigs
249
+ };
250
+ }
251
+ };
252
+
253
+ // src/modules/access-requests/NameServiceRegistrationHooks.ts
254
+ import { usePromise } from "@xylabs/react-promise";
255
+ import { XnsRegistrationsResource } from "@xyo-network/os-runtime";
256
+
257
+ // src/modules/XyOsUi/contexts/XyOsUiContext.ts
258
+ import { createContext, use } from "react";
259
+ var XyOsUiContext = createContext(void 0);
260
+ var useXyOsUiContext = () => {
261
+ return use(XyOsUiContext);
262
+ };
263
+ var XyOsUiContextProvider = XyOsUiContext.Provider;
264
+
265
+ // src/modules/XyOsUi/lib/XyOsUi.ts
266
+ import { forget } from "@xylabs/sdk-js";
267
+ import { dappsReadyConnection, XyOs } from "@xyo-network/os-runtime";
268
+ import { ModuleFactoryLocator as ModuleFactoryLocator2 } from "@xyo-network/sdk-js";
269
+ var XyOsUi = class extends XyOs {
270
+ dappRegistrationResults = { failed: [], succeeded: [] };
271
+ dappsReadyConnection = dappsReadyConnection();
272
+ constructor(params) {
273
+ super(params);
274
+ this.eventBus.addConnection(this.dappsReadyConnection);
275
+ }
276
+ static get monitoring() {
277
+ return new XyOsBrowserMonitor();
278
+ }
279
+ static get xyOsUiGlobal() {
280
+ return XyOs.xyOsGlobal;
281
+ }
282
+ static hideSplash() {
283
+ this.xyOsUiGlobal.splashScreen.hideSplash();
284
+ this.xyOsUiGlobal.splashScreen.onComplete();
285
+ this.setSplashStatus("complete");
286
+ }
287
+ static setSplashStatus(status) {
288
+ const statusText = this.xyOsUiGlobal.splashScreen._LOADING_MESSAGES[status];
289
+ this.xyOsUiGlobal.splashScreen.setStatusText(statusText);
290
+ }
291
+ async boot(wallet, locator = new ModuleFactoryLocator2()) {
292
+ await super.boot(wallet, locator);
293
+ const registerLazy = async () => {
294
+ this.dappRegistrationResults = await this.dappRegistrationService.start();
295
+ await this.dappsReadyConnection.emit("dappsReady", {});
296
+ };
297
+ forget(registerLazy());
298
+ return this;
299
+ }
300
+ };
301
+
302
+ // src/modules/resource/ResourceHooks.ts
303
+ var ResourceHooks = class {
304
+ buildResource;
305
+ buildViews;
306
+ constructor(buildResource, buildViews) {
307
+ this.buildResource = buildResource;
308
+ this.buildViews = buildViews;
309
+ }
310
+ resourceViewsFromContext = (context, pathPrefix) => {
311
+ const [resource, resourceError] = this.buildResource(context, pathPrefix);
312
+ const views = this.buildViews(resource);
313
+ return {
314
+ ...views,
315
+ resource,
316
+ resourceError
317
+ };
318
+ };
319
+ useBuildResourceFromProvidedNode = (pathPrefix) => {
320
+ const xyOs = useXyOsUiContext();
321
+ return this.buildResource(xyOs, pathPrefix);
322
+ };
323
+ useResourceViewsFromProvidedNode = (pathPrefix) => {
324
+ const [resource, resourceError] = this.useBuildResourceFromProvidedNode(pathPrefix);
325
+ const views = this.buildViews(resource);
326
+ return {
327
+ ...views,
328
+ resource,
329
+ resourceError
330
+ };
331
+ };
332
+ };
333
+
334
+ // src/modules/resource/useCleanup.ts
335
+ import { useEffect } from "react";
336
+ var useCleanUpResource = (resource) => {
337
+ useEffect(() => {
338
+ return () => {
339
+ resource?.cleanupListeners();
340
+ };
341
+ }, [resource]);
342
+ };
343
+
344
+ // src/modules/resource/useSyncExternalPayloadStore.ts
345
+ import { useMemo, useSyncExternalStore } from "react";
346
+ var useSyncExternalPayloadStore = (viewName, repository) => {
347
+ const { getSnapShot, subscribe } = useMemo(() => {
348
+ const subscriber = repository?.subscriptions[viewName];
349
+ const snapshot = repository?.views[viewName];
350
+ if (snapshot && subscriber) {
351
+ return {
352
+ // since useExternalStore calls its methods in it's own lambda function, we lose the `this` context of the calling class.
353
+ // bind each method to its appropriate object so the `this` calls work as expected.
354
+ getSnapShot: snapshot,
355
+ subscribe: subscriber.bind(repository)
356
+ };
357
+ }
358
+ return {
359
+ // eslint-disable-next-line unicorn/no-useless-undefined
360
+ getSnapShot: () => void 0,
361
+ subscribe: () => () => {
362
+ }
363
+ };
364
+ }, [repository, viewName]);
365
+ return useSyncExternalStore(subscribe, getSnapShot);
366
+ };
367
+
368
+ // src/modules/access-requests/NameServiceRegistrationHooks.ts
369
+ var useBuildNameServiceRegistrationsResource = (context, pathPrefix) => {
370
+ const result = usePromise(async () => {
371
+ if (context) {
372
+ const xnsRegistrationsResource = new XnsRegistrationsResource(context, pathPrefix);
373
+ await xnsRegistrationsResource.start();
374
+ return xnsRegistrationsResource;
375
+ }
376
+ }, [context, pathPrefix]);
377
+ useCleanUpResource(result[0]);
378
+ return result;
379
+ };
380
+ var useBuildNameServiceRegistrationsResourceViews = (resource) => {
381
+ const allRegistrations = useSyncExternalPayloadStore("allRegistrations", resource);
382
+ return {
383
+ allRegistrations,
384
+ resource
385
+ };
386
+ };
387
+ var NameServiceRegistrationHooks = new ResourceHooks(
388
+ useBuildNameServiceRegistrationsResource,
389
+ useBuildNameServiceRegistrationsResourceViews
390
+ );
391
+
392
+ // src/modules/access-requests/useBuildDappAccessRequestResource.ts
393
+ import { usePromise as usePromise2 } from "@xylabs/react-promise";
394
+ import { DappAccessRequestResource } from "@xyo-network/os-runtime";
395
+ var useBuildDappAccessRequestResource = (context) => {
396
+ const resource = usePromise2(async () => {
397
+ if (context) {
398
+ const resource2 = new DappAccessRequestResource(context);
399
+ await resource2.start();
400
+ return resource2;
401
+ }
402
+ }, [context]);
403
+ useCleanUpResource(resource[0]);
404
+ return resource;
405
+ };
406
+ var useDappAccessRequestResourceViews = (resource) => {
407
+ const accessRequests = useSyncExternalPayloadStore("accessRequests", resource);
408
+ const registeredInterfaces = useSyncExternalPayloadStore("registeredInterfaces", resource);
409
+ return {
410
+ accessRequests,
411
+ registeredInterfaces,
412
+ resource
413
+ };
414
+ };
415
+ var DappAccessRequestResourceHooks = new ResourceHooks(
416
+ useBuildDappAccessRequestResource,
417
+ useDappAccessRequestResourceViews
418
+ );
419
+
420
+ // src/modules/bios/hooks/useBios.ts
421
+ import { usePromise as usePromise3 } from "@xylabs/react-promise";
422
+ import { boot } from "@xyo-network/bios-browser";
423
+ import { useEffect as useEffect2 } from "react";
424
+ var biosBoot;
425
+ var useBios = () => {
426
+ const [biosExternalInterface, biosError] = usePromise3(async () => {
427
+ if (biosBoot !== void 0) return await biosBoot;
428
+ biosBoot = boot();
429
+ return await biosBoot;
430
+ }, []);
431
+ useEffect2(() => {
432
+ if (biosError) throw biosError;
433
+ }, [biosError]);
434
+ return biosExternalInterface;
435
+ };
436
+
437
+ // src/modules/bios/hooks/useKernel.ts
438
+ import { usePromise as usePromise4 } from "@xylabs/react-promise";
439
+ import { Kernel } from "@xyo-network/kernel";
440
+ import { useEffect as useEffect3 } from "react";
441
+ var kernelBoot;
442
+ var useKernel = (locator, params) => {
443
+ const bios = useBios();
444
+ const [kernelExternalInterface, kernelError] = usePromise4(async () => {
445
+ if (kernelBoot !== void 0) return await kernelBoot;
446
+ if (bios) {
447
+ kernelBoot = (async function() {
448
+ const kernel = new Kernel();
449
+ await kernel.boot(bios, { locator, ...params });
450
+ return kernel;
451
+ })();
452
+ return await kernelBoot;
453
+ }
454
+ }, [bios]);
455
+ useEffect3(() => {
456
+ if (kernelError) throw kernelError;
457
+ }, [kernelError]);
458
+ return kernelExternalInterface;
459
+ };
460
+
461
+ // src/modules/Dapp/Alert/RenderErrorWithSupportLink.tsx
462
+ import { ButtonEx } from "@xylabs/react-button";
463
+ import { ErrorAlert } from "@xylabs/react-error";
464
+ import { jsx as jsx2 } from "react/jsx-runtime";
465
+ var ErrorRenderWithSupport = ({
466
+ supportHref = "",
467
+ supportTo,
468
+ supportLinkText = "Support",
469
+ error,
470
+ onCancel,
471
+ ...props
472
+ }) => {
473
+ return /* @__PURE__ */ jsx2(
474
+ ErrorAlert,
475
+ {
476
+ action: supportTo ? /* @__PURE__ */ jsx2(ButtonEx, { target: "_blank", to: supportTo, color: "inherit", size: "small", children: supportLinkText }) : /* @__PURE__ */ jsx2(ButtonEx, { target: "_blank", href: supportHref, color: "inherit", size: "small", children: supportLinkText }),
477
+ error,
478
+ onCancel,
479
+ ...props
480
+ }
481
+ );
482
+ };
483
+ var ErrorRenderWithSupportDefault = (props) => {
484
+ return /* @__PURE__ */ jsx2(ErrorRenderWithSupport, { supportHref: "https://discord.com/channels/935586624392298547/1228436997375393885", ...props });
485
+ };
486
+
487
+ // src/modules/Dapp/Container.tsx
488
+ import { memo, useMemo as useMemo14 } from "react";
489
+
490
+ // src/modules/os/hooks/useDappContextCreator.ts
491
+ import { useAsyncEffect } from "@xylabs/react-async-effect";
492
+ import { DappIntentTypes } from "@xyo-network/os-model";
493
+ import { DappContextCreator, RunningDappCache } from "@xyo-network/os-runtime";
494
+ import {
495
+ useCallback,
496
+ useEffect as useEffect4,
497
+ useRef,
498
+ useState
499
+ } from "react";
500
+ var useDappContextCreator = (xnsNodeUrl, xnsNetwork, dapp, currentIntent, allowedNames, createOnMount = false) => {
501
+ const context = useXyOsUiContext();
502
+ const [windowDappNodeSet, setWindowDappNodeSet] = useState({ context: void 0, dappWallet: void 0 });
503
+ const [dappWindowNodeError, setDappWindowNodeError] = useState();
504
+ const targetedDapp = !!(dapp && context && currentIntent?.targetDappId === dapp?.config.name);
505
+ const windowDappNodeSetRef = useRef(windowDappNodeSet);
506
+ useEffect4(() => {
507
+ windowDappNodeSetRef.current = windowDappNodeSet;
508
+ }, [windowDappNodeSet]);
509
+ const createNode = useCallback(async () => {
510
+ if (targetedDapp) {
511
+ try {
512
+ const windowDappNodeSet2 = await RunningDappCache.findOrCreate(dapp, context, allowedNames ?? [], xnsNodeUrl, xnsNetwork);
513
+ setWindowDappNodeSet(windowDappNodeSet2);
514
+ } catch (e) {
515
+ setDappWindowNodeError(e);
516
+ }
517
+ }
518
+ }, [dapp, currentIntent, context, allowedNames]);
519
+ useEffect4(() => {
520
+ if (createOnMount) {
521
+ void (async () => {
522
+ await createNode();
523
+ })();
524
+ }
525
+ }, [createOnMount, createNode]);
526
+ useAsyncEffect(
527
+ async () => {
528
+ if (targetedDapp) {
529
+ switch (currentIntent?.intent) {
530
+ case DappIntentTypes.Launch: {
531
+ await createNode();
532
+ break;
533
+ }
534
+ case DappIntentTypes.Close: {
535
+ if (windowDappNodeSetRef.current.context) {
536
+ await DappContextCreator.resetDappArchivist(windowDappNodeSetRef.current.context);
537
+ setWindowDappNodeSet({ context: null, dappWallet: void 0 });
538
+ }
539
+ break;
540
+ }
541
+ case DappIntentTypes.Minimize:
542
+ }
543
+ }
544
+ },
545
+ [createNode, currentIntent]
546
+ );
547
+ return {
548
+ ...windowDappNodeSet,
549
+ nodeCreateError: dappWindowNodeError
550
+ };
551
+ };
552
+
553
+ // src/modules/os/hooks/useDappRegistrationResults.ts
554
+ import { EventBusPubSubConnection } from "@xyo-network/os-runtime";
555
+ import { useEffect as useEffect5, useState as useState2 } from "react";
556
+ var useDappRegistrationResults = () => {
557
+ const context = useXyOsUiContext();
558
+ const [registeredDappSetResults, setRegisteredDappSetResults] = useState2();
559
+ useEffect5(() => {
560
+ const listener = () => {
561
+ setRegisteredDappSetResults(context?.dappRegistrationResults);
562
+ };
563
+ const dappsReadyConnectionRequest = {
564
+ subscribableEvents: /* @__PURE__ */ new Map([["dappsReady", listener]]),
565
+ type: "PubSub"
566
+ };
567
+ const dappsReadyConnection2 = new EventBusPubSubConnection(dappsReadyConnectionRequest);
568
+ let initialResultsTimeoutId;
569
+ if (context) {
570
+ context.eventBus.addConnection(dappsReadyConnection2);
571
+ initialResultsTimeoutId = setTimeout(() => setRegisteredDappSetResults(context.dappRegistrationResults), 0);
572
+ }
573
+ return () => {
574
+ if (initialResultsTimeoutId !== void 0) clearTimeout(initialResultsTimeoutId);
575
+ if (context && dappsReadyConnection2.id) context.eventBus.removeConnection(dappsReadyConnection2.id);
576
+ };
577
+ }, [context]);
578
+ return registeredDappSetResults;
579
+ };
580
+
581
+ // src/modules/os/hooks/useDappRegistry.ts
582
+ import { DappRegistry } from "@xyo-network/os-runtime";
583
+ import { useMemo as useMemo3 } from "react";
584
+
585
+ // src/modules/os/hooks/useDappSeedPhraseRepository.ts
586
+ import { DappSeedPhraseRepository } from "@xyo-network/os-runtime";
587
+ import { useMemo as useMemo2 } from "react";
588
+ var _dappWalletRepository;
589
+ var getOrCreateDappSeedPhraseRepository = (context, allowedNames) => {
590
+ _dappWalletRepository ??= new DappSeedPhraseRepository(context, allowedNames);
591
+ return _dappWalletRepository;
592
+ };
593
+ var useDappSeedPhraseRepository = (allowedNames) => {
594
+ const context = useXyOsUiContext();
595
+ return useMemo2(() => {
596
+ return context ? getOrCreateDappSeedPhraseRepository(context, allowedNames) : void 0;
597
+ }, [context, allowedNames]);
598
+ };
599
+
600
+ // src/modules/os/hooks/useDappRegistry.ts
601
+ var _dappRegistry;
602
+ var getOrCreateDappRegistry = (repository) => {
603
+ _dappRegistry ??= new DappRegistry(repository);
604
+ return _dappRegistry;
605
+ };
606
+ var useDappRegistry = (allowedNames) => {
607
+ const dappSeedPhraseRepository = useDappSeedPhraseRepository(allowedNames);
608
+ return useMemo3(() => {
609
+ return dappSeedPhraseRepository ? getOrCreateDappRegistry(dappSeedPhraseRepository) : void 0;
610
+ }, [dappSeedPhraseRepository]);
611
+ };
612
+
613
+ // src/modules/os/hooks/useOsSettingsCaller.ts
614
+ import { assertEx as assertEx4 } from "@xylabs/sdk-js";
615
+ import { OsSettingsCaller, OsSettingsReadyEvent } from "@xyo-network/os-runtime";
616
+ import { useMemo as useMemo4 } from "react";
617
+
618
+ // src/modules/stack/useStackReady.ts
619
+ import { assertEx as assertEx3 } from "@xylabs/sdk-js";
620
+ import { EventBusPubSubConnection as EventBusPubSubConnection2 } from "@xyo-network/os-runtime";
621
+ import { useEffect as useEffect6, useState as useState3 } from "react";
622
+ var useStackReady = (stackReadyEvent, stackName, context) => {
623
+ const providedContext = useXyOsUiContext();
624
+ const [stackReady, setStackReady] = useState3({ ready: false });
625
+ useEffect6(() => {
626
+ const derivedContext = context ?? providedContext;
627
+ const listener = () => {
628
+ if (!derivedContext) throw new Error("no context found");
629
+ const stack = assertEx3(derivedContext.getStack(stackName).stack, () => `${stackName} missing stack`);
630
+ setStackReady({ ready: true, stack });
631
+ };
632
+ const stackReadyReadyConnectionRequest = {
633
+ subscribableEvents: /* @__PURE__ */ new Map([[stackReadyEvent, listener]]),
634
+ type: "PubSub"
635
+ };
636
+ const stackReadyReadyConnection = new EventBusPubSubConnection2(stackReadyReadyConnectionRequest);
637
+ let initialReadyTimeoutId;
638
+ if (derivedContext) {
639
+ derivedContext.eventBus.addConnection(stackReadyReadyConnection);
640
+ const stack = derivedContext.getStack(stackName);
641
+ if (stack.initialized) {
642
+ initialReadyTimeoutId = setTimeout(() => setStackReady({ ready: true, stack: stack.stack }), 0);
643
+ }
644
+ }
645
+ return () => {
646
+ if (initialReadyTimeoutId !== void 0) clearTimeout(initialReadyTimeoutId);
647
+ const derivedContext2 = context ?? providedContext;
648
+ if (derivedContext2 && stackReadyReadyConnection._id) {
649
+ derivedContext2.eventBus.removeConnection(stackReadyReadyConnection.id);
650
+ }
651
+ };
652
+ }, [context, providedContext, stackName, stackReadyEvent]);
653
+ return stackReady;
654
+ };
655
+
656
+ // src/modules/os/hooks/useOsSettingsCaller.ts
657
+ var useOsSettingsCaller = (context) => {
658
+ const providedContext = useXyOsUiContext();
659
+ const { ready } = useStackReady(OsSettingsReadyEvent, "osSettingsStack", providedContext);
660
+ return useMemo4(() => {
661
+ if (providedContext || context || ready) {
662
+ const derivedNode = assertEx4(context ?? providedContext, () => "no node was found in context or passed as argument");
663
+ return new OsSettingsCaller(derivedNode);
664
+ }
665
+ }, [context, providedContext]);
666
+ };
667
+
668
+ // src/modules/os/hooks/usePhraseFile.ts
669
+ import { usePromise as usePromise5 } from "@xylabs/react-promise";
670
+ import { buildUserWalletSeedPhrasePayload } from "@xyo-network/os-runtime";
671
+ import { useMemo as useMemo5 } from "react";
672
+ var usePhraseFile = (phrase) => {
673
+ const [payloadAndRootHash] = usePromise5(async () => phrase ? await buildUserWalletSeedPhrasePayload(phrase) : void 0, [phrase]);
674
+ const filename = useMemo5(() => `xyo-phrase-${payloadAndRootHash?.rootHash}.json`, [payloadAndRootHash?.rootHash]);
675
+ const { phraseFile, phraseFileError } = useMemo5(() => {
676
+ const payload = payloadAndRootHash?.payload;
677
+ if (payload) {
678
+ try {
679
+ const data = new Blob([JSON.stringify(payload, null, 2)], { type: "text/plain" });
680
+ return { phraseFile: globalThis.URL.createObjectURL(data) };
681
+ } catch (e) {
682
+ return { phraseFileError: e };
683
+ }
684
+ } else {
685
+ return {};
686
+ }
687
+ }, [payloadAndRootHash]);
688
+ return {
689
+ filename,
690
+ payload: payloadAndRootHash?.payload,
691
+ phraseFile,
692
+ phraseFileError
693
+ };
694
+ };
695
+
696
+ // src/modules/os/hooks/useTabs.ts
697
+ import { useLocation, useNavigate } from "react-router-dom";
698
+ var useTabs = () => {
699
+ const location2 = useLocation();
700
+ const navigate = useNavigate();
701
+ const rootFolder = location2.pathname.split("/")[1];
702
+ const tab = rootFolder?.length > 0 ? rootFolder : "node";
703
+ const setTab = (tab2) => {
704
+ void navigate(`/${tab2}`);
705
+ };
706
+ return [tab, setTab];
707
+ };
708
+
709
+ // src/modules/os/hooks/useWidgetDapps.ts
710
+ import { usePromise as usePromise6 } from "@xylabs/react-promise";
711
+ var useWidgetDapps = (registeredDapps, widgetTrayLayout) => {
712
+ const context = useXyOsUiContext();
713
+ return usePromise6(async () => {
714
+ if (registeredDapps && registeredDapps.length > 0 && context && widgetTrayLayout) {
715
+ const caller = new WidgetCaller(context, registeredDapps, widgetTrayLayout);
716
+ return await caller.buildWidgetComponents();
717
+ }
718
+ }, [context, registeredDapps, widgetTrayLayout]);
719
+ };
720
+
721
+ // src/modules/Dapp/Button/hooks/useLaunchPoint.tsx
722
+ import { useLayoutEffect, useState as useState5 } from "react";
723
+
724
+ // src/utils/DappInstallTypeFilters.ts
725
+ import {
726
+ isInstalledDappSet,
727
+ isPreInstalledDappSet,
728
+ isUnInstalledDappSet
729
+ } from "@xyo-network/os-model";
730
+ var DappInstallTypeFilters = {
731
+ installed(registeredDappSets) {
732
+ return registeredDappSets && registeredDappSets?.length > 0 ? registeredDappSets?.filter(isInstalledDappSet).toSorted((a2, b) => a2.dapp.config.name.toUpperCase() < b.dapp.config.name.toUpperCase() ? -1 : 1) : void 0;
733
+ },
734
+ preInstalled(registeredDappSets) {
735
+ return registeredDappSets && registeredDappSets?.length > 0 ? registeredDappSets?.filter(isPreInstalledDappSet).toSorted((a2, b) => a2.dapp.config.name.toUpperCase() < b.dapp.config.name.toUpperCase() ? -1 : 1) : void 0;
736
+ },
737
+ uninstalled(registeredDappSets) {
738
+ return registeredDappSets && registeredDappSets?.length > 0 ? registeredDappSets.filter(isUnInstalledDappSet).toSorted((a2, b) => a2.dapp.config.name.toUpperCase() < b.dapp.config.name.toUpperCase() ? -1 : 1) : void 0;
739
+ }
740
+ };
741
+
742
+ // src/utils/getApiDomain.ts
743
+ var getApiDomain = (localHost, apiDomain) => {
744
+ if (apiDomain !== void 0) {
745
+ return apiDomain;
746
+ }
747
+ if (localHost) {
748
+ return "http://localhost:8080";
749
+ }
750
+ if (location.hostname.startsWith("beta")) {
751
+ return "https://beta.archivist.xyo.network";
752
+ }
753
+ return "https://archivist.xyo.network";
754
+ };
755
+
756
+ // src/utils/useOnWindowResize.tsx
757
+ import { useEffect as useEffect7, useState as useState4 } from "react";
758
+ var useOnWindowResize = () => {
759
+ const [resized, setResized] = useState4();
760
+ useEffect7(() => {
761
+ const onResize = (event) => {
762
+ setResized(event);
763
+ };
764
+ globalThis.addEventListener("resize", onResize, false);
765
+ return () => {
766
+ globalThis.removeEventListener("resize", onResize);
767
+ };
768
+ }, []);
769
+ return resized;
770
+ };
771
+
772
+ // src/modules/Dapp/Button/hooks/useLaunchPoint.tsx
773
+ var useLaunchPoint = (spanRef) => {
774
+ const [coordinates, setCoordinates] = useState5({ left: 0, top: 0 });
775
+ const resized = useOnWindowResize();
776
+ useLayoutEffect(() => {
777
+ const rect = spanRef.current?.getBoundingClientRect() ?? null;
778
+ if (rect) {
779
+ const {
780
+ width,
781
+ height,
782
+ left,
783
+ top
784
+ } = rect;
785
+ setCoordinates({
786
+ left: left + width / 2,
787
+ top: top + height / 2
788
+ });
789
+ }
790
+ }, [spanRef, resized]);
791
+ return coordinates;
792
+ };
793
+
794
+ // src/modules/Dapp/Button/IconEx.tsx
795
+ import { Circle } from "@mui/icons-material";
796
+ import { FlexCol } from "@xylabs/react-flexbox";
797
+ import { DappIntentTypes as DappIntentTypes6 } from "@xyo-network/os-model";
798
+ import { DappIntentCaller as DappIntentCaller2, XyOsMonitor as XyOsMonitor2 } from "@xyo-network/os-runtime";
799
+ import { useRef as useRef2 } from "react";
800
+
801
+ // src/modules/intent/DappIntentResourceHooks.ts
802
+ import { usePromise as usePromise7 } from "@xylabs/react-promise";
803
+ import { DappIntentResource } from "@xyo-network/os-runtime";
804
+ var useBuildIntentResource = (context) => {
805
+ const resource = usePromise7(async () => {
806
+ if (context) {
807
+ const resource2 = new DappIntentResource(context);
808
+ await resource2.start();
809
+ return resource2;
810
+ }
811
+ }, [context]);
812
+ useCleanUpResource(resource[0]);
813
+ return resource;
814
+ };
815
+ var useIntentResourceViews = (resource) => {
816
+ const allDappIntents = useSyncExternalPayloadStore("allDappIntents", resource);
817
+ const latestDappIntent = useSyncExternalPayloadStore("latestDappIntent", resource);
818
+ return {
819
+ allDappIntents,
820
+ latestDappIntent,
821
+ resource
822
+ };
823
+ };
824
+ var DappIntentResourceHooks = new ResourceHooks(useBuildIntentResource, useIntentResourceViews);
825
+
826
+ // src/modules/intent/useClearIntents.ts
827
+ import { useAsyncEffect as useAsyncEffect2 } from "@xylabs/react-async-effect";
828
+ import { useWeakArchivistFromNode } from "@xyo-network/react-archivist";
829
+ var useClearIntents = () => {
830
+ const [intentArchivist] = useWeakArchivistFromNode("IntentArchivist");
831
+ useAsyncEffect2(
832
+ async () => {
833
+ const intentArchivistInstance = intentArchivist?.deref();
834
+ if (intentArchivistInstance) await intentArchivistInstance.clear?.();
835
+ },
836
+ [intentArchivist]
837
+ );
838
+ };
839
+
840
+ // src/modules/intent/useDappIntentCaller.ts
841
+ import { assertEx as assertEx5 } from "@xylabs/sdk-js";
842
+ import { DappIntentCaller } from "@xyo-network/os-runtime";
843
+ import { useMemo as useMemo6 } from "react";
844
+ var useDappIntentCaller = (xyOsContext) => {
845
+ const xyOs = useXyOsUiContext();
846
+ return useMemo6(() => {
847
+ if (xyOsContext || xyOs) {
848
+ const context = assertEx5(xyOsContext ?? xyOs, () => "no node was found in context or passed as argument");
849
+ return new DappIntentCaller(context);
850
+ }
851
+ }, [xyOsContext, xyOs]);
852
+ };
853
+
854
+ // src/modules/intent/useDappIntentListener.ts
855
+ import { filterAs } from "@xylabs/sdk-js";
856
+ import {
857
+ asOptionalDappIntent,
858
+ DappIntentTypes as DappIntentTypes2,
859
+ DappMode
860
+ } from "@xyo-network/os-model";
861
+ import { useWeakArchivistFromNode as useWeakArchivistFromNode2 } from "@xyo-network/react-archivist";
862
+ import { useEffect as useEffect8, useState as useState6 } from "react";
863
+ var useDappIntentListener = (dappName, targetMode = DappMode.Window) => {
864
+ const [dappIntentType, setDappIntentType] = useState6(DappIntentTypes2.Close);
865
+ const [intentPayload, setIntentPayload] = useState6();
866
+ const [intentArchivist] = useWeakArchivistFromNode2("IntentArchivist");
867
+ useEffect8(() => {
868
+ const listener = ({ payloads }) => {
869
+ const filteredPayloads = filterAs(payloads, asOptionalDappIntent);
870
+ for (const payload of filteredPayloads) {
871
+ const allDapps = dappName === null && payload.targetMode === targetMode;
872
+ const targetDapps = dappName === payload.targetDappId && payload.targetMode === targetMode;
873
+ if (allDapps || targetDapps) {
874
+ setIntentPayload(payload);
875
+ switch (payload.intent) {
876
+ case DappIntentTypes2.Close: {
877
+ setDappIntentType(DappIntentTypes2.Close);
878
+ break;
879
+ }
880
+ case DappIntentTypes2.Launch: {
881
+ setDappIntentType(DappIntentTypes2.Launch);
882
+ break;
883
+ }
884
+ case DappIntentTypes2.Minimize: {
885
+ setDappIntentType(DappIntentTypes2.Minimize);
886
+ break;
887
+ }
888
+ default: {
889
+ console.warn("Unrecognized DappIntentType:", payload);
890
+ }
891
+ }
892
+ }
893
+ }
894
+ };
895
+ intentArchivist?.deref()?.on("inserted", listener);
896
+ return () => {
897
+ intentArchivist?.deref()?.off("inserted", listener);
898
+ };
899
+ }, [dappName, intentArchivist, targetMode]);
900
+ return { dappIntentType, intentPayload };
901
+ };
902
+
903
+ // src/modules/intent/useDappIntentListener2.ts
904
+ import { DappIntentTypes as DappIntentTypes3, DappMode as DappMode2 } from "@xyo-network/os-model";
905
+ import { useEffect as useEffect9, useState as useState7 } from "react";
906
+ var useDappIntentListener2 = (dappName, sourceMode = DappMode2.Window) => {
907
+ const { latestDappIntent } = DappIntentResourceHooks.useResourceViewsFromProvidedNode();
908
+ const [dappIntentType, setDappIntentType] = useState7(DappIntentTypes3.Close);
909
+ useEffect9(() => {
910
+ if (sourceMode !== DappMode2.Window) {
911
+ console.warn("Intent sent from unrecognized mode", sourceMode);
912
+ return;
913
+ }
914
+ let nextIntent;
915
+ for (const payload of latestDappIntent ?? []) {
916
+ if (payload.targetDappId === dappName) {
917
+ switch (payload.intent) {
918
+ case DappIntentTypes3.Close: {
919
+ nextIntent = DappIntentTypes3.Close;
920
+ break;
921
+ }
922
+ case DappIntentTypes3.Launch: {
923
+ nextIntent = DappIntentTypes3.Launch;
924
+ break;
925
+ }
926
+ case DappIntentTypes3.Minimize: {
927
+ nextIntent = DappIntentTypes3.Minimize;
928
+ break;
929
+ }
930
+ default: {
931
+ console.warn("Unrecognized DappIntentType:", payload);
932
+ }
933
+ }
934
+ }
935
+ }
936
+ if (nextIntent !== void 0) {
937
+ const timeoutId = setTimeout(() => setDappIntentType(nextIntent), 0);
938
+ return () => clearTimeout(timeoutId);
939
+ }
940
+ }, [dappName, latestDappIntent, sourceMode]);
941
+ return dappIntentType;
942
+ };
943
+
944
+ // src/modules/intent/useNavigateIntent.ts
945
+ import { DappIntentTypes as DappIntentTypes4 } from "@xyo-network/os-model";
946
+ import { NameTransforms } from "@xyo-network/os-runtime";
947
+ import { useCallback as useCallback2 } from "react";
948
+ import { useNavigate as useNavigate2, useParams } from "react-router-dom";
949
+ var rootRoute = "/";
950
+ var useNavigateIntent = () => {
951
+ const navigate = useNavigate2();
952
+ const { dappName: dappNameParam } = useParams();
953
+ const updateRouteParam = useCallback2(
954
+ (dappIntent, { skipNavigate } = {}) => {
955
+ if (dappIntent?.targetDappId) {
956
+ const {
957
+ targetDappId: dappName,
958
+ intent: intentType,
959
+ params: intentParams
960
+ } = dappIntent;
961
+ const slug = new NameTransforms(dappName).slug();
962
+ switch (intentType) {
963
+ case DappIntentTypes4.Launch: {
964
+ const dappNameDeSlugged = dappNameParam ? new NameTransforms(dappNameParam).deSlug() : null;
965
+ if (dappNameDeSlugged !== dappName) {
966
+ const slugFromRoot = `${rootRoute}${slug}${intentParams ? `/${intentParams}` : ""}`;
967
+ if (!skipNavigate) void navigate(slugFromRoot);
968
+ }
969
+ break;
970
+ }
971
+ case DappIntentTypes4.Minimize: {
972
+ if (!skipNavigate) void navigate(rootRoute);
973
+ break;
974
+ }
975
+ case DappIntentTypes4.Close: {
976
+ if (!skipNavigate) void navigate(rootRoute);
977
+ break;
978
+ }
979
+ }
980
+ }
981
+ },
982
+ [dappNameParam, navigate]
983
+ );
984
+ return updateRouteParam;
985
+ };
986
+
987
+ // src/modules/intent/useSendDappIntent.ts
988
+ import { useWeakArchivistFromNode as useWeakArchivistFromNode3 } from "@xyo-network/react-archivist";
989
+ import { useCallback as useCallback3 } from "react";
990
+ var useSendDappIntent = () => {
991
+ const [intentArchivist] = useWeakArchivistFromNode3("IntentArchivist");
992
+ const navigate = useNavigateIntent();
993
+ const sendIntent = useCallback3(
994
+ async (dappIntent, options = {}) => {
995
+ const intentArchivistInstance = intentArchivist?.deref();
996
+ if (!intentArchivistInstance) {
997
+ console.error("unable to find IntentArchivist");
998
+ return;
999
+ }
1000
+ if (dappIntent) {
1001
+ try {
1002
+ await intentArchivistInstance.insert([dappIntent]);
1003
+ } catch (e) {
1004
+ console.error("error sending intent to archivist", e);
1005
+ }
1006
+ navigate(dappIntent, options);
1007
+ } else {
1008
+ console.warn("tried to send intent but intent payload");
1009
+ }
1010
+ },
1011
+ // Disabling because navigate changes references and causes additional renders
1012
+ [intentArchivist]
1013
+ );
1014
+ return intentArchivist ? sendIntent : null;
1015
+ };
1016
+
1017
+ // src/modules/Dapp/lib/DefaultIconSize.ts
1018
+ var DEFAULT_ICON_SIZE = 84;
1019
+
1020
+ // src/modules/Dapp/lib/deriveDappState.ts
1021
+ import { DappIntentTypes as DappIntentTypes5 } from "@xyo-network/os-model";
1022
+ var deriveDappState = (intent) => {
1023
+ const minimized = intent?.intent === DappIntentTypes5.Minimize;
1024
+ const active = intent?.intent === DappIntentTypes5.Launch;
1025
+ const closed = intent?.intent === DappIntentTypes5.Close;
1026
+ return {
1027
+ active,
1028
+ closed,
1029
+ minimized
1030
+ };
1031
+ };
1032
+
1033
+ // src/modules/Dapp/RenderHtml.tsx
1034
+ import { jsx as jsx3 } from "react/jsx-runtime";
1035
+ var RenderHtml = ({ htmlString }) => {
1036
+ return /* @__PURE__ */ jsx3(
1037
+ "div",
1038
+ {
1039
+ style: { height: 64, width: 64 },
1040
+ dangerouslySetInnerHTML: { __html: htmlString }
1041
+ }
1042
+ );
1043
+ };
1044
+
1045
+ // src/modules/Dapp/Button/LaunchFrame.tsx
1046
+ import { useTheme } from "@mui/material";
1047
+ import {
1048
+ animated,
1049
+ config,
1050
+ useSpring
1051
+ } from "@react-spring/web";
1052
+ import { useMemo as useMemo7 } from "react";
1053
+ import { jsx as jsx4 } from "react/jsx-runtime";
1054
+ var DappLaunchFrame = ({
1055
+ bgColor,
1056
+ children,
1057
+ id,
1058
+ launchLeft,
1059
+ open,
1060
+ launchTop,
1061
+ ref
1062
+ }) => {
1063
+ const theme = useTheme();
1064
+ const frameOpenSpringConfig = useMemo7(
1065
+ () => ({
1066
+ config: config.stiff,
1067
+ from: { height: "0%", width: "0%" },
1068
+ to: {
1069
+ height: open ? "100dvh" : "0%",
1070
+ left: open ? 0 : launchLeft,
1071
+ top: open ? 0 : launchTop,
1072
+ width: open ? "100vw" : "0%"
1073
+ }
1074
+ }),
1075
+ [launchLeft, launchTop, open]
1076
+ );
1077
+ const {
1078
+ height,
1079
+ width,
1080
+ ...frameProps
1081
+ } = useSpring(frameOpenSpringConfig);
1082
+ const { transform, ...scaleProps } = useSpring({
1083
+ config: config.stiff,
1084
+ from: { transform: "scale(0)" },
1085
+ to: { transform: open ? "scale(1)" : "scale(0)" }
1086
+ });
1087
+ return /* @__PURE__ */ jsx4("div", { id, ref, children: /* @__PURE__ */ jsx4(
1088
+ animated.div,
1089
+ {
1090
+ id: "dapp-launch-frame-transition-width-height",
1091
+ style: {
1092
+ ...frameProps,
1093
+ height,
1094
+ overflow: "hidden",
1095
+ position: "fixed",
1096
+ width,
1097
+ // Set to one above the mui app bar
1098
+ zIndex: 1101
1099
+ },
1100
+ children: /* @__PURE__ */ jsx4(
1101
+ animated.div,
1102
+ {
1103
+ id: "dapp-launch-frame-transition-scale",
1104
+ style: {
1105
+ ...scaleProps,
1106
+ alignItems: "start",
1107
+ background: bgColor ?? theme.vars?.palette.background.default,
1108
+ display: "flex",
1109
+ height: "100%",
1110
+ justifyContent: "start",
1111
+ transform,
1112
+ width: "100%"
1113
+ },
1114
+ children
1115
+ }
1116
+ )
1117
+ }
1118
+ ) });
1119
+ };
1120
+
1121
+ // src/modules/Dapp/Button/lib/decomposeProps.tsx
1122
+ var decomposeProps = (dappIcon, props) => {
1123
+ const { color, windowId: id } = dappIcon ?? {};
1124
+ const DappIconSize = DEFAULT_ICON_SIZE * 0.8;
1125
+ const { sx, ...nonSxProps } = props ?? {};
1126
+ return {
1127
+ DappIconSize,
1128
+ color,
1129
+ id,
1130
+ nonSxProps,
1131
+ sx
1132
+ };
1133
+ };
1134
+
1135
+ // src/modules/Dapp/Button/StyledComponents.tsx
1136
+ import { styled } from "@mui/material";
1137
+ import { ButtonEx as ButtonEx2 } from "@xylabs/react-button";
1138
+ import { alphaCss } from "@xylabs/react-theme";
1139
+ import { TypographyEx } from "@xyo-network/react-shared";
1140
+ var borderRadiusFactor = 1.5;
1141
+ var StyledDappIconButtonEx = styled(ButtonEx2, {
1142
+ name: "DappIconButton",
1143
+ shouldForwardProp: (prop) => !["iconBgBaseColor"].includes(prop)
1144
+ })(({ theme }) => {
1145
+ return {
1146
+ // :before hack in place since css transitions not supported in css
1147
+ "&:before": {
1148
+ WebkitBackdropFilter: "blur(20px)",
1149
+ backdropFilter: "blur(20px)",
1150
+ backgroundColor: alphaCss(theme.vars?.palette.background.paper ?? "#fff", 0.5),
1151
+ borderRadius: theme.spacing(borderRadiusFactor),
1152
+ content: "''",
1153
+ inset: 0,
1154
+ opacity: 0,
1155
+ position: "absolute",
1156
+ transition: "transform 0.15s linear, opacity 0.15s linear",
1157
+ zIndex: "-1"
1158
+ },
1159
+ "&:hover": { transform: "translateY(-2px)" },
1160
+ "&:hover:before": { opacity: 1 },
1161
+ "WebkitBackdropFilter": "blur(20px)",
1162
+ "backdropFilter": "blur(20px)",
1163
+ "backgroundColor": alphaCss(theme.vars?.palette.background.paper ?? "#fff", 0.5),
1164
+ "borderRadius": theme.spacing(borderRadiusFactor),
1165
+ "color": theme.vars?.palette.text.primary,
1166
+ "position": "relative",
1167
+ "transition": "transform 0.15s linear"
1168
+ };
1169
+ });
1170
+ var StyledDappName = styled(TypographyEx, { name: "StyledDappName" })(({ theme }) => ({
1171
+ // WebkitBoxOrient: 'vertical',
1172
+ WebkitLineClamp: 2,
1173
+ color: theme.vars?.palette.text.primary,
1174
+ flexWrap: "wrap",
1175
+ fontWeight: 700,
1176
+ letterSpacing: "-0.5px",
1177
+ lineClamp: 2,
1178
+ textAlign: "center",
1179
+ textOverflow: "ellipsis",
1180
+ textShadow: `1px 1px 3px ${alphaCss(theme.vars?.palette.common.black ?? "#000", 0.3)}`,
1181
+ whiteSpace: "initial",
1182
+ wordWrap: "break-word"
1183
+ }));
1184
+ var StyledDefaultDappIcon = styled(TypographyEx, { name: "StyledDappName" })(() => ({ lineHeight: 1 }));
1185
+
1186
+ // src/modules/Dapp/Button/IconEx.tsx
1187
+ import { jsx as jsx5, jsxs } from "react/jsx-runtime";
1188
+ var DappIconButton = ({
1189
+ children,
1190
+ dappIcon,
1191
+ dappIconSvg,
1192
+ dappName,
1193
+ dappState,
1194
+ ...props
1195
+ }) => {
1196
+ const {
1197
+ DappIconSize,
1198
+ color,
1199
+ nonSxProps,
1200
+ sx
1201
+ } = decomposeProps(dappIcon, props);
1202
+ const iconSize = DEFAULT_ICON_SIZE;
1203
+ const { active, minimized } = dappState ?? {};
1204
+ const sendIntent = useSendDappIntent();
1205
+ const iconButtonRef = useRef2(null);
1206
+ const { left: launchLeft, top: launchTop } = useLaunchPoint(iconButtonRef);
1207
+ const MiddleEllipsisFunction = (str) => {
1208
+ if (str && str.length > 25) {
1209
+ return str.slice(0, 15) + "..." + str.slice(-7, str.length - 7 + str.length);
1210
+ }
1211
+ return str;
1212
+ };
1213
+ const onClickIcon = async () => {
1214
+ XyOsMonitor2.trackEvent("Launch dApp", { "Dapp Name": `${dappName}` });
1215
+ await sendIntent?.(DappIntentCaller2.buildIntent(DappIntentCaller2.OsDappName, DappIntentTypes6.Launch, dappName));
1216
+ };
1217
+ return /* @__PURE__ */ jsxs(FlexCol, { sx: { alignItems: "stretch", justifyContent: "stretch" }, children: [
1218
+ /* @__PURE__ */ jsx5(DappLaunchFrame, { id: "dapp-launch-frame", open: !!active, launchLeft, launchTop, children }),
1219
+ /* @__PURE__ */ jsxs(
1220
+ "span",
1221
+ {
1222
+ style: { cursor: "pointer" },
1223
+ onClick: onClickIcon,
1224
+ children: [
1225
+ /* @__PURE__ */ jsx5(
1226
+ StyledDappIconButtonEx,
1227
+ {
1228
+ iconBgBaseColor: color,
1229
+ ref: iconButtonRef,
1230
+ sx: {
1231
+ height: iconSize,
1232
+ mb: 0.75,
1233
+ width: iconSize,
1234
+ ...sx
1235
+ },
1236
+ ...nonSxProps,
1237
+ children: dappIconSvg ? /* @__PURE__ */ jsx5(RenderHtml, { htmlString: dappIconSvg }) : /* @__PURE__ */ jsx5(StyledDefaultDappIcon, { sx: { fontSize: DappIconSize }, children: dappIcon?.name.at(0) })
1238
+ }
1239
+ ),
1240
+ /* @__PURE__ */ jsxs(FlexCol, { sx: { gap: 0.25 }, children: [
1241
+ /* @__PURE__ */ jsx5(StyledDappName, { variant: "body2", sx: { maxWidth: iconSize }, children: MiddleEllipsisFunction(dappIcon?.name) }),
1242
+ /* @__PURE__ */ jsx5(
1243
+ Circle,
1244
+ {
1245
+ sx: {
1246
+ height: 8,
1247
+ opacity: minimized ? 1 : 0,
1248
+ transition: "opacity .5s"
1249
+ }
1250
+ }
1251
+ )
1252
+ ] })
1253
+ ]
1254
+ }
1255
+ )
1256
+ ] });
1257
+ };
1258
+
1259
+ // src/modules/Dapp/modules/access-interface/components/Dialog.tsx
1260
+ import { ArrowForward } from "@mui/icons-material";
1261
+ import {
1262
+ Alert,
1263
+ Button,
1264
+ Dialog,
1265
+ DialogActions,
1266
+ DialogContent,
1267
+ DialogTitle,
1268
+ Typography
1269
+ } from "@mui/material";
1270
+ import { ErrorRender } from "@xylabs/react-error";
1271
+ import { FlexCol as FlexCol2, FlexRow } from "@xylabs/react-flexbox";
1272
+ import { RegisteredNames } from "@xyo-network/os-model";
1273
+ import { AccessNodeQueries } from "@xyo-network/os-runtime";
1274
+ import { useState as useState8 } from "react";
1275
+ import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
1276
+ var DappAccessDialog = ({
1277
+ accessRequest,
1278
+ children,
1279
+ dappNode,
1280
+ registeredDappAccess,
1281
+ ...props
1282
+ }) => {
1283
+ const [error, setError] = useState8();
1284
+ const [noPayloadsInserted, setNoPayloadsInserted] = useState8(false);
1285
+ const onClose = () => {
1286
+ setNoPayloadsInserted(false);
1287
+ props.onClose?.({}, "escapeKeyDown");
1288
+ };
1289
+ const handleAllow = () => {
1290
+ if (accessRequest && registeredDappAccess && dappNode) {
1291
+ try {
1292
+ switch (registeredDappAccess.name) {
1293
+ case RegisteredNames: {
1294
+ const accessNodeQueries = new AccessNodeQueries(dappNode, accessRequest, registeredDappAccess);
1295
+ accessNodeQueries.run().then((payloads) => {
1296
+ if (payloads.length === 0) {
1297
+ setNoPayloadsInserted(true);
1298
+ } else {
1299
+ onClose();
1300
+ }
1301
+ return;
1302
+ }).catch((e) => {
1303
+ setError(e);
1304
+ });
1305
+ break;
1306
+ }
1307
+ default: {
1308
+ const message = `no helper for interface ${registeredDappAccess.name} found`;
1309
+ console.error(message);
1310
+ setError(new Error(message));
1311
+ }
1312
+ }
1313
+ } catch (e) {
1314
+ console.error(e);
1315
+ setError(e);
1316
+ }
1317
+ } else {
1318
+ setError(new Error("No registered dapp access or dappNode found"));
1319
+ }
1320
+ };
1321
+ return /* @__PURE__ */ jsxs2(Dialog, { ...props, children: [
1322
+ /* @__PURE__ */ jsx6(DialogTitle, { children: "Message from XYO OS" }),
1323
+ /* @__PURE__ */ jsxs2(
1324
+ DialogContent,
1325
+ {
1326
+ dividers: true,
1327
+ sx: {
1328
+ display: "flex",
1329
+ flexDirection: "column",
1330
+ gap: 3
1331
+ },
1332
+ children: [
1333
+ /* @__PURE__ */ jsx6(ErrorRender, { error, scope: "DappAccessDialog" }),
1334
+ /* @__PURE__ */ jsxs2(FlexCol2, { sx: { gap: 1 }, children: [
1335
+ /* @__PURE__ */ jsx6(Typography, { variant: "subtitle2", children: "dApp to dApp Access Request" }),
1336
+ /* @__PURE__ */ jsxs2(FlexRow, { sx: { gap: 1 }, children: [
1337
+ /* @__PURE__ */ jsxs2(Typography, { sx: { fontSize: 16 }, children: [
1338
+ /* @__PURE__ */ jsx6("strong", { children: accessRequest?.requestingDappId }),
1339
+ "\xA0"
1340
+ ] }),
1341
+ /* @__PURE__ */ jsx6(ArrowForward, {}),
1342
+ /* @__PURE__ */ jsx6(Typography, { sx: { fontSize: 16 }, children: /* @__PURE__ */ jsx6("strong", { children: registeredDappAccess?.registeringDappId }) })
1343
+ ] })
1344
+ ] })
1345
+ ]
1346
+ }
1347
+ ),
1348
+ /* @__PURE__ */ jsxs2(
1349
+ DialogContent,
1350
+ {
1351
+ dividers: true,
1352
+ sx: {
1353
+ display: "flex",
1354
+ flexDirection: "column",
1355
+ gap: 3
1356
+ },
1357
+ children: [
1358
+ /* @__PURE__ */ jsx6(FlexCol2, { sx: { gap: 1 }, children: /* @__PURE__ */ jsxs2(Typography, { children: [
1359
+ /* @__PURE__ */ jsx6("strong", { children: accessRequest?.requestingDappId }),
1360
+ " ",
1361
+ "dApp would like to access your",
1362
+ /* @__PURE__ */ jsx6("strong", { children: registeredDappAccess?.name }),
1363
+ " ",
1364
+ "from",
1365
+ " ",
1366
+ /* @__PURE__ */ jsx6("strong", { children: registeredDappAccess?.registeringDappId }),
1367
+ " ",
1368
+ "dApp"
1369
+ ] }) }),
1370
+ noPayloadsInserted ? /* @__PURE__ */ jsxs2(Alert, { severity: "warning", children: [
1371
+ registeredDappAccess?.name,
1372
+ " ",
1373
+ "Access Request did not find payloads to insert"
1374
+ ] }) : null
1375
+ ]
1376
+ }
1377
+ ),
1378
+ children ? /* @__PURE__ */ jsx6(DialogContent, { dividers: true, children }) : null,
1379
+ /* @__PURE__ */ jsxs2(DialogActions, { children: [
1380
+ /* @__PURE__ */ jsx6(Button, { variant: "outlined", onClick: onClose, children: "Cancel" }),
1381
+ /* @__PURE__ */ jsx6(Button, { variant: "contained", onClick: handleAllow, children: "Allow" })
1382
+ ] })
1383
+ ] });
1384
+ };
1385
+
1386
+ // src/modules/Dapp/modules/access-interface/components/Flexbox.tsx
1387
+ import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
1388
+
1389
+ // src/modules/Dapp/modules/access-interface/hooks/useDialogState.tsx
1390
+ import { usePromise as usePromise8 } from "@xylabs/react-promise";
1391
+ import { isRegisteredDappAccess, RegisteredNames as RegisteredNames2 } from "@xyo-network/os-model";
1392
+ import { useState as useState9 } from "react";
1393
+
1394
+ // src/modules/Dapp/useDappCaller.ts
1395
+ import { DappCaller } from "@xyo-network/os-runtime";
1396
+ import { useMemo as useMemo8 } from "react";
1397
+ var useDappCaller = (context) => {
1398
+ const xyOs = useXyOsUiContext();
1399
+ return useMemo8(() => {
1400
+ const resolvedContext = context ?? xyOs;
1401
+ if (resolvedContext) {
1402
+ return new DappCaller(resolvedContext);
1403
+ }
1404
+ }, [context, xyOs]);
1405
+ };
1406
+
1407
+ // src/modules/Dapp/modules/access-interface/hooks/useDialogState.tsx
1408
+ var useDialogState = (context) => {
1409
+ const dappCaller = useDappCaller();
1410
+ const { accessRequests } = DappAccessRequestResourceHooks.resourceViewsFromContext(context);
1411
+ const [openAccessDialog, setOpenAccessDialog] = useState9(false);
1412
+ const [registeredInterface, setRegisteredInterface] = useState9();
1413
+ const [, allowAccessDialogError] = usePromise8(async () => {
1414
+ const accessRequest = accessRequests?.[0];
1415
+ if (accessRequest && context && dappCaller) {
1416
+ setOpenAccessDialog(true);
1417
+ const payload = await dappCaller.getRegisteredDappAccessByName(RegisteredNames2);
1418
+ setRegisteredInterface(isRegisteredDappAccess(payload) ? payload : void 0);
1419
+ }
1420
+ }, [accessRequests, dappCaller, context]);
1421
+ return {
1422
+ accessRequests,
1423
+ allowAccessDialogError,
1424
+ openAccessDialog,
1425
+ registeredInterface,
1426
+ setOpenAccessDialog
1427
+ };
1428
+ };
1429
+
1430
+ // src/modules/Dapp/modules/access-interface/components/Flexbox.tsx
1431
+ import { jsx as jsx7 } from "react/jsx-runtime";
1432
+ var DappAccessFlexbox = ({ context }) => {
1433
+ const {
1434
+ accessRequests,
1435
+ allowAccessDialogError,
1436
+ openAccessDialog,
1437
+ registeredInterface,
1438
+ setOpenAccessDialog
1439
+ } = useDialogState(context);
1440
+ return /* @__PURE__ */ jsx7(
1441
+ DappAccessDialog,
1442
+ {
1443
+ accessRequest: accessRequests?.[0],
1444
+ dappNode: context,
1445
+ open: openAccessDialog,
1446
+ onClose: () => setOpenAccessDialog(false),
1447
+ registeredDappAccess: registeredInterface,
1448
+ children: allowAccessDialogError ? /* @__PURE__ */ jsx7(ErrorRender2, { error: allowAccessDialogError, scope: "DappAccessFlexbox" }) : null
1449
+ }
1450
+ );
1451
+ };
1452
+
1453
+ // src/modules/Dapp/modules/Window/AppBar.tsx
1454
+ import {
1455
+ BugReport,
1456
+ CloseRounded,
1457
+ RemoveRounded
1458
+ } from "@mui/icons-material";
1459
+ import {
1460
+ AppBar,
1461
+ Box,
1462
+ Divider,
1463
+ IconButton,
1464
+ Toolbar,
1465
+ Tooltip,
1466
+ Typography as Typography2
1467
+ } from "@mui/material";
1468
+ import { FlexGrowRow } from "@xylabs/react-flexbox";
1469
+ import { ColorSchemeButton } from "@xylabs/react-theme";
1470
+ import { DappIntentTypes as DappIntentTypes9 } from "@xyo-network/os-model";
1471
+ import { DappIntentCaller as DappIntentCaller5 } from "@xyo-network/os-runtime";
1472
+
1473
+ // src/modules/Dapp/Debug/Dialog.tsx
1474
+ import {
1475
+ Dialog as Dialog2,
1476
+ DialogActions as DialogActions2,
1477
+ DialogContent as DialogContent2
1478
+ } from "@mui/material";
1479
+ import { ButtonEx as ButtonEx3 } from "@xylabs/react-button";
1480
+ import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
1481
+ import { NodeProvider } from "@xyo-network/react-node";
1482
+ import { lazy, Suspense } from "react";
1483
+ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
1484
+ var Debug = lazy(() => import(
1485
+ /* webpackChunkName: "Debug" */
1486
+ "@xyo-network/os-react-debug"
1487
+ ));
1488
+ var LazyDebug = () => /* @__PURE__ */ jsxs3(Suspense, { fallback: /* @__PURE__ */ jsx8(FlexCol3, {}), children: [
1489
+ /* @__PURE__ */ jsx8(FlexCol3, {}),
1490
+ /* @__PURE__ */ jsx8(Debug, { sx: { height: "100%" } })
1491
+ ] });
1492
+ var DebugDialog = ({
1493
+ closeDebug,
1494
+ debugOpen,
1495
+ ...props
1496
+ }) => {
1497
+ return /* @__PURE__ */ jsxs3(Dialog2, { open: debugOpen, onClose: closeDebug, fullScreen: true, ...props, children: [
1498
+ /* @__PURE__ */ jsx8(DialogContent2, { children: /* @__PURE__ */ jsx8(LazyDebug, {}) }),
1499
+ /* @__PURE__ */ jsx8(DialogActions2, { children: /* @__PURE__ */ jsx8(ButtonEx3, { variant: "outlined", onClick: closeDebug, children: "Close" }) })
1500
+ ] });
1501
+ };
1502
+ var DebugDialogWithNode = ({
1503
+ closeDebug,
1504
+ debugOpen,
1505
+ context,
1506
+ ...props
1507
+ }) => {
1508
+ return /* @__PURE__ */ jsx8(NodeProvider, { node: context?.root, children: /* @__PURE__ */ jsx8(DebugDialog, { closeDebug, debugOpen, ...props }) });
1509
+ };
1510
+
1511
+ // src/modules/Dapp/modules/Window/hooks/lib/DappPathHelpers.ts
1512
+ import { NameTransforms as NameTransforms2 } from "@xyo-network/os-runtime";
1513
+ var DappPathHelpers = {
1514
+ // update the url based off the path
1515
+ deriveDestinationPath(path, defaultPath, dappName) {
1516
+ const rootPath = `/${new NameTransforms2(dappName ?? "").slug()}`;
1517
+ const nestedPath = `${rootPath}/${path}`;
1518
+ return path === defaultPath ? rootPath : nestedPath;
1519
+ },
1520
+ // derive the path for the nav selection
1521
+ derivePathForNavSelection(newPath, currentPath, defaultPath) {
1522
+ let derivedPath;
1523
+ if (newPath === void 0 && defaultPath) {
1524
+ derivedPath = defaultPath;
1525
+ }
1526
+ if (newPath && currentPath !== newPath) {
1527
+ derivedPath = newPath;
1528
+ }
1529
+ return derivedPath;
1530
+ },
1531
+ // detect duplicate nav selections
1532
+ detectDuplicateSelections(lastSavedPath, path, defaultPath) {
1533
+ const selectedDefaultPathAgain = path === defaultPath && lastSavedPath === "";
1534
+ const pathIsUnchanged = lastSavedPath === path;
1535
+ return selectedDefaultPathAgain || pathIsUnchanged;
1536
+ }
1537
+ };
1538
+
1539
+ // src/modules/Dapp/modules/Window/hooks/lib/detectCustomer.ts
1540
+ var CustomerParams = [
1541
+ { key: "utm_source", value: "coin" },
1542
+ {
1543
+ key: "receipt",
1544
+ matches: "*",
1545
+ value: "receiptHash"
1546
+ }
1547
+ ];
1548
+ var detectCustomer = () => {
1549
+ return CustomerParams.find((customerParamSet) => {
1550
+ const searchParams = new URLSearchParams(globalThis.location.search);
1551
+ const searchParamValue = searchParams.get(customerParamSet.key);
1552
+ if (searchParams.has(customerParamSet.key) && customerParamSet.matches === "*") {
1553
+ return true;
1554
+ }
1555
+ return searchParamValue && searchParamValue === customerParamSet.value;
1556
+ });
1557
+ };
1558
+
1559
+ // src/modules/Dapp/modules/Window/hooks/menu/useAddDappMenuItems.ts
1560
+ import { usePromise as usePromise10 } from "@xylabs/react-promise";
1561
+
1562
+ // src/modules/Dapp/modules/Window/hooks/menu/useBuildDappMenuResource.ts
1563
+ import { usePromise as usePromise9 } from "@xylabs/react-promise";
1564
+ import { DappMenuResource } from "@xyo-network/os-runtime";
1565
+ var useBuildDappMenuResource = (xyOsContext) => {
1566
+ const resource = usePromise9(async () => {
1567
+ if (xyOsContext) {
1568
+ const resource2 = new DappMenuResource(xyOsContext);
1569
+ await resource2.start();
1570
+ return resource2;
1571
+ }
1572
+ }, [xyOsContext]);
1573
+ useCleanUpResource(resource[0]);
1574
+ return resource;
1575
+ };
1576
+ var useMenuResourceViews = (resource) => {
1577
+ const menuItemSelections = useSyncExternalPayloadStore("menuItemSelections", resource);
1578
+ const menuConfigs = useSyncExternalPayloadStore("menuConfigs", resource);
1579
+ const menuItems = useSyncExternalPayloadStore("menuItems", resource);
1580
+ const menuItemsVisible = useSyncExternalPayloadStore("menuItemsVisible", resource);
1581
+ return {
1582
+ menuConfigs,
1583
+ menuItemSelections,
1584
+ menuItems,
1585
+ menuItemsVisible,
1586
+ resource
1587
+ };
1588
+ };
1589
+ var DappMenuResourceHooks = new ResourceHooks(useBuildDappMenuResource, useMenuResourceViews);
1590
+
1591
+ // src/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.ts
1592
+ import { assertEx as assertEx6 } from "@xylabs/sdk-js";
1593
+ import { DappMenuCaller } from "@xyo-network/os-runtime";
1594
+ import { useMemo as useMemo9 } from "react";
1595
+ var useDappMenuCaller = (context, { ignoreProvidedNode } = {}) => {
1596
+ const xyOs = useXyOsUiContext();
1597
+ return useMemo9(() => {
1598
+ const resolvedProvidedNode = ignoreProvidedNode ? null : xyOs;
1599
+ if (context || resolvedProvidedNode) {
1600
+ const finalContext = assertEx6(context ?? xyOs, () => "no node was found in context or passed as argument");
1601
+ return new DappMenuCaller(finalContext);
1602
+ }
1603
+ }, [ignoreProvidedNode, context, xyOs]);
1604
+ };
1605
+
1606
+ // src/modules/Dapp/modules/Window/hooks/menu/useAddDappMenuItems.ts
1607
+ var useAddDappMenuItems = (payloads) => {
1608
+ const xyOs = useXyOsUiContext();
1609
+ const {
1610
+ menuItemSelections,
1611
+ menuConfigs,
1612
+ resourceError
1613
+ } = DappMenuResourceHooks.resourceViewsFromContext(xyOs);
1614
+ const dappMenuCaller = useDappMenuCaller();
1615
+ const [, addMenuItemsError] = usePromise10(async () => {
1616
+ await dappMenuCaller?.add(payloads);
1617
+ }, [payloads, dappMenuCaller]);
1618
+ return {
1619
+ addMenuItemsError,
1620
+ menuConfig: menuConfigs?.[0],
1621
+ path: menuItemSelections?.[0],
1622
+ error: resourceError
1623
+ };
1624
+ };
1625
+
1626
+ // src/modules/Dapp/modules/Window/hooks/menu/useDappMenu.ts
1627
+ import {
1628
+ useEffect as useEffect10,
1629
+ useRef as useRef3,
1630
+ useState as useState10
1631
+ } from "react";
1632
+ import { useNavigate as useNavigate3, useParams as useParams2 } from "react-router-dom";
1633
+
1634
+ // src/modules/Dapp/modules/Window/hooks/menu/useDappMenuDependencies.ts
1635
+ import { useMemo as useMemo10 } from "react";
1636
+ var useDappMenuDependencies = (context) => {
1637
+ const {
1638
+ menuConfigs,
1639
+ menuItemSelections,
1640
+ menuItemsVisible,
1641
+ resourceError
1642
+ } = DappMenuResourceHooks.resourceViewsFromContext(context);
1643
+ const defaultPath = useMemo10(() => menuConfigs?.[0]?.defaultPath, [menuConfigs]);
1644
+ const menuSelection = menuItemSelections?.[0]?.path;
1645
+ return {
1646
+ defaultPath,
1647
+ menuConfigs,
1648
+ menuItemsVisible,
1649
+ menuSelection,
1650
+ resourceError
1651
+ };
1652
+ };
1653
+
1654
+ // src/modules/Dapp/modules/Window/hooks/menu/useDappMenu.ts
1655
+ var useDappMenu = (context, dappName) => {
1656
+ const [error, setError] = useState10();
1657
+ const params = useParams2();
1658
+ const navigate = useNavigate3();
1659
+ const {
1660
+ defaultPath,
1661
+ menuConfigs,
1662
+ menuItemsVisible,
1663
+ menuSelection,
1664
+ resourceError
1665
+ } = useDappMenuDependencies(context);
1666
+ const activePath = menuSelection ?? defaultPath;
1667
+ const currentPathRef = useRef3(void 0);
1668
+ useEffect10(() => {
1669
+ if (params && currentPathRef.current === void 0) {
1670
+ currentPathRef.current = params.path ?? "";
1671
+ }
1672
+ }, []);
1673
+ useEffect10(() => {
1674
+ if (context === null) {
1675
+ currentPathRef.current = void 0;
1676
+ }
1677
+ }, [context]);
1678
+ useEffect10(() => {
1679
+ if (menuSelection) {
1680
+ currentPathRef.current = menuSelection;
1681
+ }
1682
+ }, [menuSelection]);
1683
+ useEffect10(() => {
1684
+ if (resourceError) {
1685
+ const timeoutId = setTimeout(() => setError(resourceError), 0);
1686
+ return () => clearTimeout(timeoutId);
1687
+ }
1688
+ }, [resourceError]);
1689
+ const onPathChange = (path) => {
1690
+ const pathIsInUnchanged = DappPathHelpers.detectDuplicateSelections(currentPathRef.current, path, defaultPath);
1691
+ if (pathIsInUnchanged) return;
1692
+ const destinationPath = DappPathHelpers.deriveDestinationPath(path, defaultPath, dappName);
1693
+ void navigate(destinationPath);
1694
+ currentPathRef.current = path;
1695
+ };
1696
+ return {
1697
+ activePath,
1698
+ error,
1699
+ menuConfig: menuConfigs?.[0],
1700
+ menuItems: menuItemsVisible,
1701
+ onPathChange
1702
+ };
1703
+ };
1704
+
1705
+ // src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.tsx
1706
+ import { usePromise as usePromise11 } from "@xylabs/react-promise";
1707
+ import { assertEx as assertEx7, findAs } from "@xylabs/sdk-js";
1708
+ import { asArchivistInstance } from "@xyo-network/archivist-model";
1709
+ import { asOptionalDappInjectableParams } from "@xyo-network/os-model";
1710
+ import { DappCaller as DappCaller2 } from "@xyo-network/os-runtime";
1711
+ import { useNavigate as useNavigate4, useSearchParams } from "react-router-dom";
1712
+ var useManageDappInjectableParamsFromRoute = (context) => {
1713
+ const [queryParams] = useSearchParams();
1714
+ const navigate = useNavigate4();
1715
+ const [, callerError] = usePromise11(async () => {
1716
+ if (context && queryParams) {
1717
+ const dappCaller = new DappCaller2(context);
1718
+ const pathname = globalThis.location.pathname;
1719
+ await dappCaller.setDappInjectableRouteParams(queryParams, pathname);
1720
+ }
1721
+ }, [context, queryParams]);
1722
+ const [, listenerError] = usePromise11(async () => {
1723
+ let archivist;
1724
+ const listener = ({ payloads }) => {
1725
+ const injectableParams = findAs(payloads, asOptionalDappInjectableParams);
1726
+ if (injectableParams && context) {
1727
+ const pathname = globalThis.location.pathname;
1728
+ if (pathname !== injectableParams.path) {
1729
+ void navigate(injectableParams.path);
1730
+ }
1731
+ }
1732
+ };
1733
+ try {
1734
+ if (context) {
1735
+ const mod = assertEx7(await context?.root.resolve("DappArchivist"), () => "DappArchivist not found");
1736
+ archivist = asArchivistInstance(mod, () => "DappArchivist not is not an Archivist", { required: true });
1737
+ archivist.on("inserted", listener);
1738
+ }
1739
+ } catch (e) {
1740
+ console.error(e);
1741
+ throw e;
1742
+ }
1743
+ return () => {
1744
+ archivist?.off("inserted", listener);
1745
+ };
1746
+ }, [context]);
1747
+ return [callerError, listenerError];
1748
+ };
1749
+
1750
+ // src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappIntentRequest.tsx
1751
+ import { useAtomicPromise, usePromise as usePromise12 } from "@xylabs/react-promise";
1752
+ import { findAs as findAs2 } from "@xylabs/sdk-js";
1753
+ import { asOptionalDappIntent as asOptionalDappIntent2, DappIntentTypes as DappIntentTypes7 } from "@xyo-network/os-model";
1754
+ import { DappIntentCaller as DappIntentCaller3 } from "@xyo-network/os-runtime";
1755
+ import { useEffect as useEffect11, useState as useState11 } from "react";
1756
+ var useManageDappIntentRequest = (context, dappId) => {
1757
+ const dappCaller = useDappCaller(context);
1758
+ const sendIntent = useSendDappIntent();
1759
+ const [intentPayload, setIntentPayload] = useState11();
1760
+ const [handleIntentError, setHandleIntentError] = useState11();
1761
+ const [dappArchivist, setDappArchivist] = useState11();
1762
+ usePromise12(async () => {
1763
+ if (context && dappCaller) {
1764
+ const archivist = await dappCaller.getDappArchivist();
1765
+ if (archivist) setDappArchivist(archivist);
1766
+ }
1767
+ }, [context, dappCaller]);
1768
+ useAtomicPromise(
1769
+ "manageDappIntent",
1770
+ async () => {
1771
+ if (context && intentPayload?.targetDappId && dappId && sendIntent) {
1772
+ try {
1773
+ const minimizeIntent = DappIntentCaller3.buildIntent(DappIntentCaller3.OsDappName, DappIntentTypes7.Minimize, dappId);
1774
+ await sendIntent(minimizeIntent);
1775
+ await sendIntent(intentPayload);
1776
+ } catch (e) {
1777
+ console.error(e);
1778
+ setHandleIntentError(e);
1779
+ }
1780
+ setIntentPayload(void 0);
1781
+ }
1782
+ },
1783
+ [context, dappId, intentPayload, sendIntent]
1784
+ );
1785
+ useEffect11(() => {
1786
+ const listener = ({ payloads }) => {
1787
+ if (context) {
1788
+ const intentPayload2 = findAs2(payloads, asOptionalDappIntent2);
1789
+ if (intentPayload2) {
1790
+ setIntentPayload(intentPayload2);
1791
+ }
1792
+ }
1793
+ };
1794
+ dappArchivist?.off("inserted", listener);
1795
+ if (dappArchivist && context) {
1796
+ dappArchivist.on("inserted", listener);
1797
+ }
1798
+ return () => {
1799
+ dappArchivist?.off("inserted", listener);
1800
+ };
1801
+ }, [context, dappArchivist]);
1802
+ return handleIntentError;
1803
+ };
1804
+
1805
+ // src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.tsx
1806
+ import { usePromise as usePromise13 } from "@xylabs/react-promise";
1807
+ import {
1808
+ useCallback as useCallback4,
1809
+ useEffect as useEffect12,
1810
+ useRef as useRef4
1811
+ } from "react";
1812
+ import { useNavigate as useNavigate5, useParams as useParams3 } from "react-router-dom";
1813
+ var useManageDappPathFromRoute = (context, dappName) => {
1814
+ const params = useParams3();
1815
+ const { path: pathParam } = params;
1816
+ const dappMenuCaller = useDappMenuCaller(context, { ignoreProvidedNode: true });
1817
+ const { menuSelection, defaultPath } = useDappMenuDependencies(context);
1818
+ const navigate = useNavigate5();
1819
+ const currentPathRef = useRef4(void 0);
1820
+ const updateMenuArchivist = useCallback4(
1821
+ async (pathParam2) => {
1822
+ currentPathRef.current = pathParam2;
1823
+ if (context && dappMenuCaller) {
1824
+ const currentPath = await dappMenuCaller?.currentNavSelection();
1825
+ const updatedPath = DappPathHelpers.derivePathForNavSelection(pathParam2, currentPath?.[0]?.path, defaultPath);
1826
+ if (updatedPath) {
1827
+ await dappMenuCaller.makeNavItemSelection(updatedPath);
1828
+ }
1829
+ }
1830
+ },
1831
+ [dappMenuCaller, context, defaultPath]
1832
+ );
1833
+ useEffect12(() => {
1834
+ if (context && menuSelection) {
1835
+ const pathIsInUnchanged = DappPathHelpers.detectDuplicateSelections(currentPathRef.current ?? "", menuSelection, defaultPath);
1836
+ if (pathIsInUnchanged) return;
1837
+ const destinationPath = DappPathHelpers.deriveDestinationPath(menuSelection, defaultPath, dappName);
1838
+ void navigate(destinationPath);
1839
+ currentPathRef.current = menuSelection === defaultPath ? void 0 : menuSelection;
1840
+ }
1841
+ }, [dappName, context, defaultPath, menuSelection]);
1842
+ const [, updateErrors] = usePromise13(async () => {
1843
+ if (context && pathParam !== currentPathRef.current) {
1844
+ await updateMenuArchivist(pathParam);
1845
+ currentPathRef.current = pathParam;
1846
+ }
1847
+ }, [context, pathParam, updateMenuArchivist]);
1848
+ return updateErrors;
1849
+ };
1850
+
1851
+ // src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.tsx
1852
+ import { usePromise as usePromise14 } from "@xylabs/react-promise";
1853
+ import { DappIntentTypes as DappIntentTypes8 } from "@xyo-network/os-model";
1854
+ import { DappIntentCaller as DappIntentCaller4, NameTransforms as NameTransforms3 } from "@xyo-network/os-runtime";
1855
+ import { useRef as useRef5 } from "react";
1856
+ import { useParams as useParams4 } from "react-router-dom";
1857
+ var useManageDappStateFromRoute = (intentPayload) => {
1858
+ const params = useParams4();
1859
+ const { dappName: dappNameParam } = params;
1860
+ const sendIntent = useSendDappIntent();
1861
+ const intentCaller = useDappIntentCaller();
1862
+ const dappNameParamRef = useRef5(void 0);
1863
+ const intentRef = useRef5(void 0);
1864
+ usePromise14(async () => {
1865
+ const launched = intentPayload?.intent === DappIntentTypes8.Launch;
1866
+ const dappNameParamRemoved = !!dappNameParamRef.current && dappNameParam === void 0;
1867
+ if (launched && dappNameParamRemoved && sendIntent) {
1868
+ const closeIntent = DappIntentCaller4.buildIntent(DappIntentCaller4.OsDappName, DappIntentTypes8.Close);
1869
+ await sendIntent(closeIntent);
1870
+ }
1871
+ dappNameParamRef.current = dappNameParam;
1872
+ }, [dappNameParam, intentPayload, sendIntent]);
1873
+ usePromise14(async () => {
1874
+ if (dappNameParam && sendIntent && intentCaller) {
1875
+ const dappNameParamDeSlugged = new NameTransforms3(dappNameParam).deSlug();
1876
+ const autoLaunchNeeded = intentRef.current === void 0 && dappNameParam;
1877
+ if (autoLaunchNeeded) {
1878
+ const launchIntent = DappIntentCaller4.buildIntent(DappIntentCaller4.OsDappName, DappIntentTypes8.Launch, dappNameParamDeSlugged);
1879
+ await sendIntent(launchIntent);
1880
+ intentRef.current = launchIntent;
1881
+ return;
1882
+ }
1883
+ }
1884
+ }, [dappNameParam, sendIntent, intentCaller, intentPayload?.intent]);
1885
+ };
1886
+
1887
+ // src/modules/Dapp/modules/Window/hooks/useDebugClick.ts
1888
+ import {
1889
+ useCallback as useCallback5,
1890
+ useEffect as useEffect13,
1891
+ useRef as useRef6,
1892
+ useState as useState12
1893
+ } from "react";
1894
+ import { useNavigate as useNavigate6, useSearchParams as useSearchParams2 } from "react-router-dom";
1895
+ var useDebugClick = () => {
1896
+ const [params, setParams] = useSearchParams2();
1897
+ const [debugOpen, setDebugOpen] = useState12(false);
1898
+ const openFromClick = useRef6(false);
1899
+ const closeFromClick = useRef6(false);
1900
+ const initialized = useRef6(false);
1901
+ const navigate = useNavigate6();
1902
+ const openDebug = useCallback5(() => {
1903
+ openFromClick.current = true;
1904
+ closeFromClick.current = false;
1905
+ setParams((params2) => {
1906
+ params2.set("debug", "true");
1907
+ return new URLSearchParams(params2);
1908
+ });
1909
+ setDebugOpen(true);
1910
+ }, [setParams]);
1911
+ const closeDebug = useCallback5(() => {
1912
+ openFromClick.current = false;
1913
+ closeFromClick.current = true;
1914
+ initialized.current = false;
1915
+ void navigate(-1);
1916
+ setDebugOpen(false);
1917
+ }, [navigate]);
1918
+ useEffect13(() => {
1919
+ const initialOpen = openFromClick.current && !closeFromClick.current && params.has("debug");
1920
+ const backButtonClicked = openFromClick.current && !closeFromClick.current && !params.has("debug");
1921
+ if (initialOpen) {
1922
+ if (initialized.current === false) {
1923
+ initialized.current = true;
1924
+ }
1925
+ } else if (backButtonClicked) {
1926
+ initialized.current = false;
1927
+ closeDebug();
1928
+ }
1929
+ }, [params, closeDebug]);
1930
+ return {
1931
+ closeDebug,
1932
+ debugOpen,
1933
+ openDebug
1934
+ };
1935
+ };
1936
+
1937
+ // src/modules/Dapp/modules/Window/hooks/useDecomposeDapp.tsx
1938
+ import { useMemo as useMemo11 } from "react";
1939
+
1940
+ // src/modules/Dapp/modules/Window/NodeManifest.tsx
1941
+ import { usePromise as usePromise15 } from "@xylabs/react-promise";
1942
+ import { useProvidedNode } from "@xyo-network/react-node";
1943
+ import { Fragment, jsx as jsx9 } from "react/jsx-runtime";
1944
+ var NodeManifest = () => {
1945
+ const [node] = useProvidedNode();
1946
+ const [nodeManifest] = usePromise15(async () => await node?.manifest(3), [node]);
1947
+ return /* @__PURE__ */ jsx9(Fragment, { children: node ? /* @__PURE__ */ jsx9("pre", { children: JSON.stringify(nodeManifest, null, 2) }) : null });
1948
+ };
1949
+
1950
+ // src/modules/Dapp/modules/Window/hooks/useDecomposeDapp.tsx
1951
+ var useDecomposeDapp = (dapp) => {
1952
+ const DappComponent = useMemo11(() => dapp?.params.modes?.window?.component ?? NodeManifest, []);
1953
+ const name = dapp?.config.name;
1954
+ const version = dapp?.config.version;
1955
+ const scrollable = dapp?.params.modes?.window?.scrollable ?? true;
1956
+ return {
1957
+ DappComponent,
1958
+ dapp,
1959
+ name,
1960
+ scrollable,
1961
+ version
1962
+ };
1963
+ };
1964
+
1965
+ // src/modules/Dapp/modules/Window/hooks/useExposedNode.ts
1966
+ var useExposedNode = () => {
1967
+ const xyOS = useXyOsUiContext();
1968
+ return xyOS?.exposedNode;
1969
+ };
1970
+
1971
+ // src/modules/Dapp/modules/Window/hooks/useSkipLoadingScreen.tsx
1972
+ import { useMemo as useMemo12 } from "react";
1973
+ import { useSearchParams as useSearchParams3 } from "react-router-dom";
1974
+ var PARAMS_TO_TARGET = ["username", "utm_source"];
1975
+ var useSkipLoadingScreen = () => {
1976
+ const [params] = useSearchParams3();
1977
+ const customer = detectCustomer();
1978
+ return useMemo12(() => {
1979
+ const hasTargetParams = PARAMS_TO_TARGET.some((param) => params.has(param));
1980
+ const isCustomer = !!customer;
1981
+ return hasTargetParams || isCustomer;
1982
+ }, [customer, params]);
1983
+ };
1984
+
1985
+ // src/modules/Dapp/modules/Window/hooks/useSyncOsRegisteredAccessInterfaces.tsx
1986
+ import { usePromise as usePromise16 } from "@xylabs/react-promise";
1987
+ import { useWeakArchivistFromNode as useWeakArchivistFromNode4 } from "@xyo-network/react-archivist";
1988
+ var useSyncOsRegisteredAccessInterfaces = (context) => {
1989
+ const [registeredInterfacesArchivist] = useWeakArchivistFromNode4("RegisteredDappInterfacesArchivist");
1990
+ const dappCaller = useDappCaller(context);
1991
+ usePromise16(async () => {
1992
+ const listener = async ({ payloads }) => {
1993
+ if (context && dappCaller) {
1994
+ await dappCaller.addPayloadsToDappArchivist(payloads);
1995
+ }
1996
+ };
1997
+ if (context && dappCaller) {
1998
+ const registeredInterfaces = await registeredInterfacesArchivist?.deref()?.all();
1999
+ if (registeredInterfaces) {
2000
+ await dappCaller.addPayloadsToDappArchivist(registeredInterfaces);
2001
+ }
2002
+ registeredInterfacesArchivist?.deref()?.on("inserted", listener);
2003
+ }
2004
+ return () => {
2005
+ registeredInterfacesArchivist?.deref()?.off("inserted", listener);
2006
+ };
2007
+ }, [dappCaller, context, registeredInterfacesArchivist]);
2008
+ };
2009
+
2010
+ // src/modules/Dapp/modules/Window/AppBar.tsx
2011
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
2012
+ var EmptyDappBarForPadding = (props) => {
2013
+ return /* @__PURE__ */ jsx10(
2014
+ AppBar,
2015
+ {
2016
+ color: "primary",
2017
+ sx: { flexDirection: "row" },
2018
+ component: "div",
2019
+ position: "fixed",
2020
+ ...props
2021
+ }
2022
+ );
2023
+ };
2024
+ var DappBar = ({
2025
+ title,
2026
+ context,
2027
+ name,
2028
+ ...props
2029
+ }) => {
2030
+ const sendIntent = useSendDappIntent();
2031
+ const {
2032
+ closeDebug,
2033
+ debugOpen,
2034
+ openDebug
2035
+ } = useDebugClick();
2036
+ return /* @__PURE__ */ jsxs4(
2037
+ AppBar,
2038
+ {
2039
+ elevation: 0,
2040
+ color: "transparent",
2041
+ sx: { backgroundColor: "transparent", flexDirection: "row" },
2042
+ component: "div",
2043
+ position: "sticky",
2044
+ ...props,
2045
+ children: [
2046
+ /* @__PURE__ */ jsx10(
2047
+ Toolbar,
2048
+ {
2049
+ disableGutters: true,
2050
+ sx: { paddingX: 2 },
2051
+ children: /* @__PURE__ */ jsx10(Typography2, { noWrap: true, variant: "h6", sx: { letterSpacing: "-1px" }, children: title })
2052
+ }
2053
+ ),
2054
+ /* @__PURE__ */ jsx10(FlexGrowRow, {}),
2055
+ /* @__PURE__ */ jsxs4(
2056
+ Toolbar,
2057
+ {
2058
+ disableGutters: true,
2059
+ sx: { paddingX: 2 },
2060
+ children: [
2061
+ /* @__PURE__ */ jsx10(
2062
+ IconButton,
2063
+ {
2064
+ onClick: openDebug,
2065
+ sx: { display: { md: "none", xs: "flex" } },
2066
+ children: /* @__PURE__ */ jsx10(BugReport, {})
2067
+ }
2068
+ ),
2069
+ /* @__PURE__ */ jsx10(
2070
+ Tooltip,
2071
+ {
2072
+ title: "Toggle Light/Dark Mode",
2073
+ sx: { display: { md: "none", xs: "flex" } },
2074
+ children: /* @__PURE__ */ jsx10(Box, { children: /* @__PURE__ */ jsx10(ColorSchemeButton, {}) })
2075
+ }
2076
+ ),
2077
+ /* @__PURE__ */ jsx10(
2078
+ Divider,
2079
+ {
2080
+ orientation: "vertical",
2081
+ flexItem: true,
2082
+ sx: {
2083
+ display: { md: "none", xs: "flex" },
2084
+ m: 1
2085
+ }
2086
+ }
2087
+ ),
2088
+ /* @__PURE__ */ jsx10(Tooltip, { title: "Minimize", children: /* @__PURE__ */ jsx10(
2089
+ IconButton,
2090
+ {
2091
+ onClick: async () => await sendIntent?.(DappIntentCaller5.buildIntent(DappIntentCaller5.OsDappName, DappIntentTypes9.Minimize, name)),
2092
+ children: /* @__PURE__ */ jsx10(RemoveRounded, { htmlColor: "inherit" })
2093
+ }
2094
+ ) }),
2095
+ /* @__PURE__ */ jsx10(Tooltip, { title: "Close", children: /* @__PURE__ */ jsx10(
2096
+ IconButton,
2097
+ {
2098
+ onClick: async () => await sendIntent?.(DappIntentCaller5.buildIntent(DappIntentCaller5.OsDappName, DappIntentTypes9.Close, name)),
2099
+ children: /* @__PURE__ */ jsx10(CloseRounded, { htmlColor: "inherit" })
2100
+ }
2101
+ ) })
2102
+ ]
2103
+ }
2104
+ ),
2105
+ /* @__PURE__ */ jsx10(DebugDialogWithNode, { closeDebug, debugOpen, context })
2106
+ ]
2107
+ }
2108
+ );
2109
+ };
2110
+
2111
+ // src/modules/Dapp/modules/Window/Chrome.tsx
2112
+ import { useMediaQuery } from "@mui/material";
2113
+ import {
2114
+ FlexCol as FlexCol4,
2115
+ FlexGrowCol,
2116
+ FlexRow as FlexRow2
2117
+ } from "@xylabs/react-flexbox";
2118
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
2119
+ var mergeSx = (base, override) => {
2120
+ if (override === void 0) return base;
2121
+ const overrideArr = Array.isArray(override) ? override : [override];
2122
+ return [base, ...overrideArr];
2123
+ };
2124
+ var DappChromeSmall = ({
2125
+ appBar,
2126
+ children,
2127
+ screenMenu,
2128
+ splashScreen,
2129
+ sx,
2130
+ ...props
2131
+ }) => {
2132
+ return /* @__PURE__ */ jsxs5(FlexCol4, { id: "dapp-chrome-container-small", ...props, sx: mergeSx({ alignItems: "stretch" }, sx), children: [
2133
+ splashScreen,
2134
+ /* @__PURE__ */ jsxs5(
2135
+ FlexGrowCol,
2136
+ {
2137
+ id: "dapp-chrome-small",
2138
+ sx: {
2139
+ alignItems: "stretch",
2140
+ justifyContent: "start",
2141
+ background: (theme) => theme.vars?.palette.background.default
2142
+ },
2143
+ children: [
2144
+ appBar,
2145
+ /* @__PURE__ */ jsx11(
2146
+ FlexGrowCol,
2147
+ {
2148
+ sx: { overflowY: "auto", alignItems: "stretch" },
2149
+ children
2150
+ }
2151
+ ),
2152
+ screenMenu
2153
+ ]
2154
+ }
2155
+ )
2156
+ ] });
2157
+ };
2158
+ var DappChromeLarge = ({
2159
+ appBar,
2160
+ children,
2161
+ screenMenu,
2162
+ splashScreen,
2163
+ sx,
2164
+ ...props
2165
+ }) => {
2166
+ return /* @__PURE__ */ jsxs5(FlexRow2, { id: "dapp-chrome-container-large", ...props, sx: mergeSx({ alignItems: "stretch" }, sx), children: [
2167
+ splashScreen,
2168
+ screenMenu,
2169
+ /* @__PURE__ */ jsxs5(
2170
+ FlexGrowCol,
2171
+ {
2172
+ id: "dapp-chrome-large",
2173
+ sx: {
2174
+ alignItems: "stretch",
2175
+ justifyContent: "start",
2176
+ background: (theme) => theme.vars?.palette.background.default
2177
+ },
2178
+ children: [
2179
+ appBar,
2180
+ /* @__PURE__ */ jsx11(
2181
+ FlexGrowCol,
2182
+ {
2183
+ sx: {
2184
+ overflowY: "auto",
2185
+ alignItems: "stretch",
2186
+ justifyContent: "flex-start"
2187
+ },
2188
+ children
2189
+ }
2190
+ )
2191
+ ]
2192
+ }
2193
+ )
2194
+ ] });
2195
+ };
2196
+ var DappChrome = ({
2197
+ largeScreenMenu,
2198
+ smallScreenMenu,
2199
+ ...props
2200
+ }) => {
2201
+ const isMedium = useMediaQuery((theme) => theme.breakpoints.up("md"));
2202
+ return isMedium ? /* @__PURE__ */ jsx11(DappChromeLarge, { screenMenu: largeScreenMenu, ...props }) : /* @__PURE__ */ jsx11(DappChromeSmall, { screenMenu: smallScreenMenu, ...props });
2203
+ };
2204
+
2205
+ // src/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.tsx
2206
+ import {
2207
+ Card as Card2,
2208
+ CardContent as CardContent2,
2209
+ Chip,
2210
+ Container,
2211
+ Divider as Divider2,
2212
+ Typography as Typography4,
2213
+ useTheme as useTheme4
2214
+ } from "@mui/material";
2215
+ import { FlexGrowCol as FlexGrowCol3, FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
2216
+ import { alphaCss as alphaCss2 } from "@xylabs/react-theme";
2217
+
2218
+ // src/modules/Dapp/modules/Window/components/DefaultComingSoon/InstallButtonSection.tsx
2219
+ import { ButtonEx as ButtonEx4 } from "@xylabs/react-button";
2220
+ import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
2221
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
2222
+ var InstallButtonSection = ({
2223
+ installLink = "",
2224
+ notificationLink = "https://xyo.network/newsletter",
2225
+ ...props
2226
+ }) => {
2227
+ return /* @__PURE__ */ jsxs6(
2228
+ FlexRow3,
2229
+ {
2230
+ sx: {
2231
+ width: "100%",
2232
+ gap: 1,
2233
+ alignItems: "flex-start",
2234
+ flexDirection: { md: "row", xs: "column" }
2235
+ },
2236
+ ...props,
2237
+ children: [
2238
+ /* @__PURE__ */ jsx12(ButtonEx4, { fullWidth: true, variant: "contained", disabled: true, href: installLink, children: "Install" }),
2239
+ /* @__PURE__ */ jsx12(ButtonEx4, { fullWidth: true, variant: "outlined", href: notificationLink, target: "_blank", children: "Get Notified When Available" })
2240
+ ]
2241
+ }
2242
+ );
2243
+ };
2244
+
2245
+ // src/modules/Dapp/modules/Window/components/DefaultComingSoon/SummarySection.tsx
2246
+ import { VerifiedRounded } from "@mui/icons-material";
2247
+ import {
2248
+ Card,
2249
+ CardContent,
2250
+ Typography as Typography3,
2251
+ useTheme as useTheme3
2252
+ } from "@mui/material";
2253
+ import {
2254
+ FlexGrowCol as FlexGrowCol2,
2255
+ FlexGrowRow as FlexGrowRow3,
2256
+ FlexRow as FlexRow4
2257
+ } from "@xylabs/react-flexbox";
2258
+
2259
+ // src/modules/Dapp/modules/Window/components/DefaultComingSoon/DeveloperLinkSection.tsx
2260
+ import { useTheme as useTheme2 } from "@mui/material";
2261
+ import { FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
2262
+ import { LinkEx } from "@xylabs/react-link";
2263
+ import { jsx as jsx13 } from "react/jsx-runtime";
2264
+ var DeveloperLinkSection = ({ developerLink = "https://xylabs.com", ...props }) => {
2265
+ const theme = useTheme2();
2266
+ return /* @__PURE__ */ jsx13(
2267
+ FlexGrowRow2,
2268
+ {
2269
+ sx: {
2270
+ gap: 1,
2271
+ alignItems: "flex-start",
2272
+ flexDirection: { md: "row", xs: "column" }
2273
+ },
2274
+ ...props,
2275
+ children: /* @__PURE__ */ jsx13(LinkEx, { color: theme.vars?.palette.info.main, href: developerLink, target: "_blank", children: developerLink })
2276
+ }
2277
+ );
2278
+ };
2279
+
2280
+ // src/modules/Dapp/modules/Window/components/DefaultComingSoon/SummarySection.tsx
2281
+ import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
2282
+ var SummarySection = ({
2283
+ name,
2284
+ dappIconSvg,
2285
+ version = "1.0",
2286
+ developerLink = "https://xylabs.com"
2287
+ }) => {
2288
+ const theme = useTheme3();
2289
+ return /* @__PURE__ */ jsx14(Card, { sx: { width: "100%" }, children: /* @__PURE__ */ jsx14(CardContent, { children: /* @__PURE__ */ jsx14(
2290
+ FlexRow4,
2291
+ {
2292
+ sx: {
2293
+ gap: 3,
2294
+ alignItems: "flex-start",
2295
+ flexDirection: "column",
2296
+ width: "100%"
2297
+ },
2298
+ children: /* @__PURE__ */ jsxs7(
2299
+ FlexGrowRow3,
2300
+ {
2301
+ sx: { gap: { md: 2, xs: 1 }, alignItems: "flex-start" },
2302
+ children: [
2303
+ /* @__PURE__ */ jsx14(Card, { elevation: 0, variant: "outlined", children: /* @__PURE__ */ jsx14(CardContent, { children: dappIconSvg ? /* @__PURE__ */ jsx14(RenderHtml, { htmlString: dappIconSvg }) : null }) }),
2304
+ /* @__PURE__ */ jsxs7(FlexGrowCol2, { sx: { alignItems: "flex-start" }, children: [
2305
+ /* @__PURE__ */ jsxs7(FlexGrowCol2, { sx: { alignItems: "flex-start" }, children: [
2306
+ /* @__PURE__ */ jsx14(
2307
+ Typography3,
2308
+ {
2309
+ sx: {
2310
+ fontSize: { md: theme.typography.h1.fontSize, xs: theme.typography.h5.fontSize },
2311
+ fontWeight: theme.typography.fontWeightBold
2312
+ },
2313
+ children: name
2314
+ }
2315
+ ),
2316
+ /* @__PURE__ */ jsxs7(Typography3, { gutterBottom: true, variant: "subtitle2", children: [
2317
+ "Version:",
2318
+ " ",
2319
+ version
2320
+ ] })
2321
+ ] }),
2322
+ /* @__PURE__ */ jsxs7(
2323
+ FlexGrowRow3,
2324
+ {
2325
+ sx: {
2326
+ gap: 0.5,
2327
+ alignItems: "center",
2328
+ justifyContent: "center"
2329
+ },
2330
+ children: [
2331
+ /* @__PURE__ */ jsx14(VerifiedRounded, { color: "success", fontSize: "small" }),
2332
+ /* @__PURE__ */ jsx14(Typography3, { variant: "body1", color: theme.vars?.palette.success.main, children: "XY Labs" })
2333
+ ]
2334
+ }
2335
+ ),
2336
+ developerLink ? /* @__PURE__ */ jsx14(DeveloperLinkSection, { developerLink }) : null
2337
+ ] })
2338
+ ]
2339
+ }
2340
+ )
2341
+ }
2342
+ ) }) });
2343
+ };
2344
+
2345
+ // src/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.tsx
2346
+ import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
2347
+ var defaultDescription = ["Description coming soon!"];
2348
+ var DefaultComingSoon = ({
2349
+ children,
2350
+ desc = defaultDescription,
2351
+ developerLink = "https://xylabs.com",
2352
+ name,
2353
+ dappIconSvg,
2354
+ version
2355
+ }) => {
2356
+ const theme = useTheme4();
2357
+ return /* @__PURE__ */ jsxs8(
2358
+ Container,
2359
+ {
2360
+ maxWidth: "md",
2361
+ sx: {
2362
+ minHeight: "100%",
2363
+ overflow: "auto",
2364
+ paddingTop: 2,
2365
+ width: "100%"
2366
+ },
2367
+ children: [
2368
+ version ? null : /* @__PURE__ */ jsx15(FlexRow5, { sx: { width: "100%", paddingBottom: 2 }, children: /* @__PURE__ */ jsx15(
2369
+ Chip,
2370
+ {
2371
+ label: "This app is not yet publicly available on xyOS",
2372
+ sx: {
2373
+ backgroundColor: alphaCss2(theme.vars?.palette.info.main ?? "#000", 0.2),
2374
+ color: theme.vars?.palette.info.main,
2375
+ width: "100%"
2376
+ }
2377
+ }
2378
+ ) }),
2379
+ /* @__PURE__ */ jsx15(
2380
+ FlexGrowCol3,
2381
+ {
2382
+ sx: {
2383
+ width: "100%",
2384
+ alignItems: "flex-start",
2385
+ minHeight: "100%"
2386
+ },
2387
+ children: /* @__PURE__ */ jsxs8(
2388
+ FlexGrowCol3,
2389
+ {
2390
+ sx: {
2391
+ width: "100%",
2392
+ alignItems: "stretch",
2393
+ justifyContent: "flex-start",
2394
+ gap: 2
2395
+ },
2396
+ children: [
2397
+ /* @__PURE__ */ jsx15(SummarySection, { dappIconSvg, name, version, developerLink }),
2398
+ /* @__PURE__ */ jsx15(InstallButtonSection, {}),
2399
+ /* @__PURE__ */ jsx15(Divider2, { flexItem: true }),
2400
+ /* @__PURE__ */ jsx15(Card2, { children: /* @__PURE__ */ jsx15(CardContent2, { children: /* @__PURE__ */ jsxs8(FlexGrowCol3, { sx: { justifyContent: "flex-start", alignItems: "flex-start" }, children: [
2401
+ /* @__PURE__ */ jsxs8(Typography4, { variant: "h6", gutterBottom: true, children: [
2402
+ "Learn more about",
2403
+ " ",
2404
+ name
2405
+ ] }),
2406
+ desc?.map((paragraph, index) => {
2407
+ return /* @__PURE__ */ jsx15(Typography4, { gutterBottom: true, sx: { paddingBottom: 1 }, variant: "body1", children: paragraph }, index);
2408
+ })
2409
+ ] }) }) }),
2410
+ children
2411
+ ]
2412
+ }
2413
+ )
2414
+ }
2415
+ )
2416
+ ]
2417
+ }
2418
+ );
2419
+ };
2420
+
2421
+ // src/modules/Dapp/modules/Window/components/menu/BottomNavigation.tsx
2422
+ import {
2423
+ BottomNavigation,
2424
+ BottomNavigationAction,
2425
+ Paper,
2426
+ styled as styled2
2427
+ } from "@mui/material";
2428
+ import { useIsDark } from "@xylabs/react-theme";
2429
+ import { useEffect as useEffect14, useState as useState13 } from "react";
2430
+ import { jsx as jsx16 } from "react/jsx-runtime";
2431
+ var DappBottomNavigation = ({
2432
+ activePath,
2433
+ menuConfig,
2434
+ menuItems,
2435
+ onPathChange,
2436
+ ...props
2437
+ }) => {
2438
+ const [activeIndex, setActiveIndex] = useState13(0);
2439
+ useEffect14(() => {
2440
+ if (menuConfig?.defaultPath && menuItems && activePath) {
2441
+ const nextIndex = menuItems.findIndex((item) => activePath === item.path);
2442
+ const timeoutId = setTimeout(() => setActiveIndex(nextIndex), 0);
2443
+ return () => clearTimeout(timeoutId);
2444
+ }
2445
+ }, [activePath, menuConfig, menuItems]);
2446
+ return /* @__PURE__ */ jsx16(Paper, { elevation: 3, children: /* @__PURE__ */ jsx16(
2447
+ BottomNavigation,
2448
+ {
2449
+ value: activeIndex,
2450
+ onChange: (_, value) => {
2451
+ setActiveIndex(value);
2452
+ const to2 = menuItems?.[value].path;
2453
+ if (to2) onPathChange?.(to2);
2454
+ },
2455
+ showLabels: true,
2456
+ ...props,
2457
+ children: menuItems?.map(({ svgIcon: icon, primaryText }, index) => {
2458
+ return /* @__PURE__ */ jsx16(
2459
+ StyledBottomNavigationAction,
2460
+ {
2461
+ className: "bottom-nav-action",
2462
+ label: primaryText,
2463
+ icon: /* @__PURE__ */ jsx16(
2464
+ "span",
2465
+ {
2466
+ ref: (ref) => {
2467
+ if (ref) {
2468
+ ref.innerHTML = icon ?? "";
2469
+ }
2470
+ }
2471
+ }
2472
+ )
2473
+ },
2474
+ index
2475
+ );
2476
+ })
2477
+ }
2478
+ ) });
2479
+ };
2480
+ var StyledBottomNavigationAction = styled2(BottomNavigationAction, { name: "StyledBottomNavigationAction" })(({ theme }) => {
2481
+ const darkMode = useIsDark();
2482
+ return { "&.Mui-selected": { color: darkMode ? theme.vars?.palette.primary.main : theme.vars?.palette.secondary.main } };
2483
+ });
2484
+
2485
+ // src/modules/Dapp/modules/Window/components/menu/Drawer.tsx
2486
+ import {
2487
+ alpha,
2488
+ Drawer,
2489
+ List,
2490
+ ListItem,
2491
+ ListItemIcon,
2492
+ ListItemText,
2493
+ Tooltip as Tooltip3,
2494
+ Typography as Typography6,
2495
+ useTheme as useTheme6
2496
+ } from "@mui/material";
2497
+ import {
2498
+ FlexCol as FlexCol6,
2499
+ FlexGrowRow as FlexGrowRow4,
2500
+ FlexRow as FlexRow7
2501
+ } from "@xylabs/react-flexbox";
2502
+ import {
2503
+ alphaCss as alphaCss3,
2504
+ darkenCss,
2505
+ useIsDark as useIsDark2
2506
+ } from "@xylabs/react-theme";
2507
+ import { XyOsMonitor as XyOsMonitor3 } from "@xyo-network/os-runtime";
2508
+ import { useEffect as useEffect15, useState as useState15 } from "react";
2509
+
2510
+ // src/modules/Dapp/modules/Window/components/menu/BottomMenuArea.tsx
2511
+ import {
2512
+ BugReport as BugReport2,
2513
+ KeyboardArrowDownRounded,
2514
+ KeyboardArrowUpRounded
2515
+ } from "@mui/icons-material";
2516
+ import {
2517
+ Card as Card3,
2518
+ Collapse,
2519
+ Divider as Divider3,
2520
+ IconButton as IconButton2,
2521
+ Stack,
2522
+ Toolbar as Toolbar2,
2523
+ Tooltip as Tooltip2,
2524
+ Typography as Typography5,
2525
+ useTheme as useTheme5
2526
+ } from "@mui/material";
2527
+ import { RotationAnimation } from "@xylabs/react-animation";
2528
+ import { FlexCol as FlexCol5, FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
2529
+ import { LinkEx as LinkEx2 } from "@xylabs/react-link";
2530
+ import { ColorSchemeButton as ColorSchemeButton2 } from "@xylabs/react-theme";
2531
+ import { useState as useState14 } from "react";
2532
+
2533
+ // src/modules/Dapp/modules/Window/components/menu/img/xyoOS-Icon-White.svg
2534
+ var xyoOS_Icon_White_default = '<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 900"><defs><style>.cls-1{fill:#a8a8a8;opacity:.21;}.cls-1,.cls-2{stroke-width:0px;}.cls-2{fill:#fff;}</style></defs><path class="cls-1" d="M864.29,297.43c-2.44-6.58-9.76-9.94-16.34-7.5l-143.74,53.26L533.2,21.88c-1.85-3.48-5.21-5.9-9.09-6.56-3.89-.66-7.85.51-10.75,3.18l-267.76,246.55-118-97.86c-5.4-4.48-13.42-3.73-17.9,1.67-4.48,5.4-3.73,13.42,1.67,17.9l118,97.86L36.62,593.37c-2.09,3.34-2.5,7.46-1.14,11.15s4.37,6.54,8.13,7.72l347.4,108.61-25.75,151.12c-1.18,6.92,3.48,13.49,10.4,14.67.24.04.47.07.7.1,6.66.76,12.82-3.81,13.96-10.5l25.75-151.12,363.77,12.56c3.94.14,7.71-1.56,10.22-4.59,2.51-3.03,3.48-7.06,2.62-10.9l-79.64-355.16,143.75-53.26c6.58-2.44,9.94-9.75,7.5-16.34ZM518.49,48.34l156.33,293.75-401.12-68.35,244.79-225.4ZM674.37,367.8l-264.69,319.16-144.06-388.81,408.75,69.65ZM66.9,592.88l176.22-282.26,141.37,381.56-317.59-99.29ZM431.72,700.22l259.75-313.21,72.81,324.69-332.56-11.48Z"/><path class="cls-2" d="M865.04,302.64c.01-.2.02-.4.03-.6,0-.33,0-.66-.03-.99-.01-.2-.02-.39-.04-.58-.04-.35-.1-.71-.17-1.06-.03-.16-.05-.32-.09-.48-.12-.5-.26-1.01-.45-1.5-.18-.49-.4-.97-.64-1.43-.08-.15-.17-.29-.25-.43-.17-.31-.35-.61-.55-.9-.12-.17-.24-.33-.37-.49-.19-.25-.39-.5-.6-.74-.14-.16-.29-.32-.45-.47-.22-.22-.45-.44-.68-.65-.1-.08-.18-.18-.27-.26L530.1,18.07c-.34-.28-.7-.53-1.07-.77-.09-.06-.17-.13-.26-.19-.62-.39-1.26-.7-1.92-.98-.18-.07-.36-.14-.54-.21-.71-.26-1.43-.47-2.16-.6,0,0-.01,0-.02,0,0,0,0,0-.01,0-.67-.11-1.35-.15-2.03-.16-.37,0-.73,0-1.09.03-.23.02-.46.06-.7.09-.86.11-1.69.31-2.5.59-.07.03-.15.04-.23.07l-.32.12c-.2.08-.4.13-.59.22L115.08,165.06c-.11.04-.22.1-.33.15-.3.12-.59.25-.88.39-.19.1-.38.19-.57.3-.27.15-.54.32-.81.5-.17.12-.35.22-.52.35-.27.2-.53.42-.79.64-.14.12-.28.23-.41.35-.35.33-.68.68-1,1.05-.04.05-.08.1-.12.14-.32.38-.6.78-.87,1.2-.09.14-.16.29-.25.43-.18.31-.36.62-.51.94-.08.17-.15.35-.23.53-.13.31-.25.62-.36.93-.06.19-.12.38-.17.57-.09.33-.17.65-.23.98-.02.11-.06.22-.08.33l-72.09,423.12c-.07.43-.11.87-.13,1.3,0,.11-.03.22-.03.33-.03.73.02,1.44.12,2.16.02.19.06.38.09.57.13.74.31,1.48.57,2.19,0,0,0,0,0,0,0,.02.01.03.02.04.2.53.43,1.04.7,1.53.12.22.26.42.38.63.17.28.33.56.52.82.17.23.35.44.54.66.18.22.36.44.56.65.2.21.42.4.63.6.16.14.29.3.46.43l330.39,274c.08.07.17.12.25.18.32.25.65.49.99.71.15.09.29.19.44.28.44.26.9.5,1.37.7.04.02.08.04.12.06.51.21,1.03.39,1.56.53.17.05.35.08.53.12.24.06.47.12.71.16.23.04.46.07.69.1.47.05.95.08,1.42.08.15,0,.3-.02.45-.02.32-.01.65-.02.97-.06.18-.02.36-.06.54-.08.29-.04.58-.09.86-.15.19-.04.38-.1.56-.15.28-.08.55-.16.82-.25.08-.03.15-.04.23-.07l402.48-149.13s.06-.03.09-.04c.39-.15.76-.32,1.13-.51.12-.06.24-.1.35-.16.44-.24.88-.51,1.29-.8.03-.02.06-.04.09-.06.55-.39,1.07-.85,1.56-1.34.83-.82,1.54-1.76,2.11-2.78.09-.17.19-.33.27-.5.32-.64.61-1.3.82-2,.03-.11.05-.22.08-.33.12-.42.23-.84.3-1.27l72.09-423.12c.02-.11.02-.22.03-.33.05-.34.08-.67.1-1.01ZM771.44,701.13l-101.05-83.8,158.61-254.06-57.56,337.86ZM121.2,242.67l65.53,292.26-123.1,45.61,57.57-337.87ZM656.65,591.33l-141.37-381.56,317.59,99.3-176.22,282.26ZM508.76,181.1l22.05-129.41,263.81,218.79-285.86-89.37ZM483.7,176.83l-299.33-10.33L505.75,47.42l-22.05,129.41ZM208.31,514.94l-72.81-324.69,332.56,11.48-259.75,313.21ZM490.1,214.98l144.06,388.81-382.98-65.25-25.77-4.39L490.1,214.98ZM246.9,563.6l379.17,64.6-244.79,225.4-156.33-293.74,21.95,3.74ZM654.16,636.9l101.05,83.8-321.38,119.08,220.33-202.88ZM72.47,604.37l123.1-45.61,140.72,264.4-84.17-69.81-179.65-148.98Z"/></svg>';
2535
+
2536
+ // src/modules/Dapp/modules/Window/components/menu/img/index.ts
2537
+ var XyoOSLogoWhite = xyoOS_Icon_White_default;
2538
+
2539
+ // src/modules/Dapp/modules/Window/components/menu/SocialData.tsx
2540
+ import {
2541
+ Facebook,
2542
+ Instagram,
2543
+ LinkedIn,
2544
+ Reddit,
2545
+ StorefrontRounded,
2546
+ Telegram,
2547
+ X,
2548
+ YouTube
2549
+ } from "@mui/icons-material";
2550
+ import { FaDiscord } from "react-icons/fa";
2551
+ import { jsx as jsx17 } from "react/jsx-runtime";
2552
+ var socialLinksData = [
2553
+ {
2554
+ icon: /* @__PURE__ */ jsx17(Facebook, { style: { fontSize: "24px" } }),
2555
+ link: "https://www.facebook.com/OfficialXYO"
2556
+ },
2557
+ {
2558
+ icon: /* @__PURE__ */ jsx17(X, { style: { fontSize: "24px" } }),
2559
+ link: "https://twitter.com/OfficialXYO"
2560
+ },
2561
+ {
2562
+ icon: /* @__PURE__ */ jsx17(Instagram, { style: { fontSize: "24px" } }),
2563
+ link: "https://www.instagram.com/officialxyo/"
2564
+ },
2565
+ {
2566
+ icon: /* @__PURE__ */ jsx17(Telegram, { style: { fontSize: "24px" } }),
2567
+ link: "https://t.me/xyonetwork"
2568
+ },
2569
+ {
2570
+ icon: /* @__PURE__ */ jsx17(Reddit, { style: { fontSize: "24px" } }),
2571
+ link: "https://www.reddit.com/r/XYONetwork/"
2572
+ },
2573
+ {
2574
+ icon: /* @__PURE__ */ jsx17(YouTube, { style: { fontSize: "24px" } }),
2575
+ link: "https://www.youtube.com/channel/UCyZDqb9pgntVHJVt1pxXtsw"
2576
+ },
2577
+ {
2578
+ icon: /* @__PURE__ */ jsx17(LinkedIn, { style: { fontSize: "24px" } }),
2579
+ link: "https://www.linkedin.com/company/officialxyo/"
2580
+ },
2581
+ {
2582
+ icon: /* @__PURE__ */ jsx17(FaDiscord, { style: { fontSize: "24px" } }),
2583
+ link: "https://discord.gg/officialxyo"
2584
+ },
2585
+ {
2586
+ icon: /* @__PURE__ */ jsx17(StorefrontRounded, { style: { fontSize: "24px" } }),
2587
+ link: "https://shop.xyo.network"
2588
+ }
2589
+ ];
2590
+
2591
+ // src/modules/Dapp/modules/Window/components/menu/BottomMenuArea.tsx
2592
+ import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
2593
+ var BottomMenuArea = ({ openDebug, backgroundColor }) => {
2594
+ const theme = useTheme5();
2595
+ const [expanded, setExpanded] = useState14(false);
2596
+ const handleExpandClick = () => {
2597
+ setExpanded(!expanded);
2598
+ };
2599
+ return /* @__PURE__ */ jsxs9(
2600
+ Card3,
2601
+ {
2602
+ sx: {
2603
+ position: "relative",
2604
+ borderTopLeftRadius: "10px",
2605
+ borderTopRightRadius: "10px",
2606
+ borderBottomLeftRadius: "0px",
2607
+ borderBottomRightRadius: "0px",
2608
+ backgroundColor,
2609
+ overflow: "hidden"
2610
+ },
2611
+ elevation: 4,
2612
+ children: [
2613
+ /* @__PURE__ */ jsx18(FlexCol5, { sx: { paddingY: 1, alignItems: "stretch" }, children: /* @__PURE__ */ jsxs9(
2614
+ Stack,
2615
+ {
2616
+ onClick: handleExpandClick,
2617
+ sx: {
2618
+ paddingX: 2,
2619
+ justifyContent: "space-between",
2620
+ flexDirection: "row",
2621
+ gap: 0.5,
2622
+ textTransform: "none",
2623
+ cursor: "pointer"
2624
+ },
2625
+ children: [
2626
+ /* @__PURE__ */ jsx18(Typography5, { gutterBottom: false, children: "More" }),
2627
+ expanded ? /* @__PURE__ */ jsx18(KeyboardArrowUpRounded, { sx: { color: "#fff" } }) : /* @__PURE__ */ jsx18(KeyboardArrowDownRounded, { sx: { color: "#fff" } })
2628
+ ]
2629
+ }
2630
+ ) }),
2631
+ /* @__PURE__ */ jsxs9(Collapse, { in: expanded, timeout: "auto", unmountOnExit: true, sx: { paddingBottom: 3, color: "#fff" }, children: [
2632
+ /* @__PURE__ */ jsx18(Divider3, { flexItem: true }),
2633
+ /* @__PURE__ */ jsxs9(FlexCol5, { sx: { alignItems: "center" }, children: [
2634
+ /* @__PURE__ */ jsxs9(Toolbar2, { sx: { paddingX: 1.5 }, children: [
2635
+ /* @__PURE__ */ jsx18(Tooltip2, { title: "Debug Node View", children: /* @__PURE__ */ jsx18(IconButton2, { onClick: openDebug, sx: { color: "#fff" }, children: /* @__PURE__ */ jsx18(BugReport2, {}) }) }),
2636
+ /* @__PURE__ */ jsx18(Tooltip2, { title: "Toggle Light/Dark Mode", children: /* @__PURE__ */ jsx18("span", { children: /* @__PURE__ */ jsx18(ColorSchemeButton2, {}) }) })
2637
+ ] }),
2638
+ /* @__PURE__ */ jsx18(FlexRow6, { sx: { flexWrap: "wrap" }, children: socialLinksData.map((social) => /* @__PURE__ */ jsx18(RotationAnimation, { rotation: 20, children: /* @__PURE__ */ jsx18(
2639
+ IconButton2,
2640
+ {
2641
+ sx: { color: "#fff" },
2642
+ href: social.link,
2643
+ target: "_blank",
2644
+ children: social.icon
2645
+ }
2646
+ ) }, social.link)) }),
2647
+ /* @__PURE__ */ jsxs9(
2648
+ FlexRow6,
2649
+ {
2650
+ sx: {
2651
+ padding: 1,
2652
+ justifyContent: "center",
2653
+ gap: 0.5
2654
+ },
2655
+ children: [
2656
+ /* @__PURE__ */ jsx18(Typography5, { variant: "body2", color: theme.vars?.palette.text.primary, children: "Powered By" }),
2657
+ /* @__PURE__ */ jsx18(
2658
+ "img",
2659
+ {
2660
+ style: { color: theme.vars?.palette.text.primary, fill: theme.vars?.palette.text.primary },
2661
+ src: XyoOSLogoWhite,
2662
+ width: "auto",
2663
+ height: "20px"
2664
+ }
2665
+ )
2666
+ ]
2667
+ }
2668
+ ),
2669
+ /* @__PURE__ */ jsx18(Typography5, { variant: "caption", color: theme.vars?.palette.text.primary, children: "Copyright \xA9 2024 XY Labs, Inc." }),
2670
+ /* @__PURE__ */ jsxs9(Stack, { sx: { gap: 0.5, flexDirection: "row" }, children: [
2671
+ /* @__PURE__ */ jsx18(LinkEx2, { color: "inherit", target: "_blank", href: "https://xylabs.com/privacy/", children: /* @__PURE__ */ jsx18(Typography5, { variant: "caption", children: "Privacy" }) }),
2672
+ " ",
2673
+ "\u2022",
2674
+ " ",
2675
+ /* @__PURE__ */ jsx18(LinkEx2, { color: "inherit", target: "_blank", href: "https://xylabs.com/terms/", children: /* @__PURE__ */ jsx18(Typography5, { variant: "caption", children: "Terms" }) }),
2676
+ " ",
2677
+ "\u2022",
2678
+ " ",
2679
+ /* @__PURE__ */ jsx18(LinkEx2, { color: "inherit", target: "_blank", href: "https://xyo.network/", children: /* @__PURE__ */ jsx18(Typography5, { variant: "caption", children: "XYO Website" }) })
2680
+ ] })
2681
+ ] })
2682
+ ] })
2683
+ ]
2684
+ }
2685
+ );
2686
+ };
2687
+
2688
+ // src/modules/Dapp/modules/Window/components/menu/StyledListItems.tsx
2689
+ import { ListItemButton, styled as styled3 } from "@mui/material";
2690
+ var StyledMenuIconWrapSpan = styled3("span", { name: "StyledMenuIconWrapSpan" })(() => ({
2691
+ alignItems: "center",
2692
+ display: "inline-flex",
2693
+ flexDirection: "column"
2694
+ }));
2695
+ var StyledListItemButton = styled3(ListItemButton, { name: "StyledListItemButton", shouldForwardProp: (prop) => prop !== "active" })(({ theme, active }) => {
2696
+ const activeOrHoverColor = theme.vars?.palette.primary.main;
2697
+ return {
2698
+ "position": "relative",
2699
+ "padding": "8px 16px",
2700
+ "borderRadius": "12px",
2701
+ "transition": "background-color 0.3s ease",
2702
+ "&:hover": {
2703
+ backgroundColor: "transparent",
2704
+ borderRadius: "12px"
2705
+ },
2706
+ "&::before": {
2707
+ content: '""',
2708
+ position: "absolute",
2709
+ left: 0,
2710
+ top: 0,
2711
+ bottom: 0,
2712
+ width: "6px",
2713
+ backgroundColor: active ? activeOrHoverColor : "transparent",
2714
+ borderRadius: "0 4px 4px 0",
2715
+ transition: "background-color 0.3s ease"
2716
+ }
2717
+ };
2718
+ });
2719
+
2720
+ // src/modules/Dapp/modules/Window/components/menu/Drawer.tsx
2721
+ import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
2722
+ var DappMenuDrawer = ({
2723
+ activePath,
2724
+ context,
2725
+ iconSvg,
2726
+ name,
2727
+ menuConfig,
2728
+ menuItems,
2729
+ onPathChange,
2730
+ version,
2731
+ ...props
2732
+ }) => {
2733
+ const [path, setPath] = useState15("");
2734
+ const darkMode = useIsDark2();
2735
+ const theme = useTheme6();
2736
+ const drawerColor = darkMode ? theme.vars?.palette.background.paper : darkenCss(theme.vars?.palette.primary.main ?? "#fff", 0.5);
2737
+ const activeColor = theme.vars?.palette.primary.light;
2738
+ useEffect15(() => {
2739
+ if (menuConfig?.defaultPath && menuItems && activePath) {
2740
+ const newPath = menuItems.find((item) => activePath === item.path)?.path ?? "";
2741
+ const timeoutId = setTimeout(() => setPath(newPath), 0);
2742
+ return () => clearTimeout(timeoutId);
2743
+ }
2744
+ }, [activePath, menuConfig, menuItems]);
2745
+ const handleChange = (to2) => {
2746
+ XyOsMonitor3.trackEvent("Visit dApp Page", { Page: to2 });
2747
+ setPath(to2);
2748
+ onPathChange?.(to2);
2749
+ };
2750
+ const {
2751
+ closeDebug,
2752
+ debugOpen,
2753
+ openDebug
2754
+ } = useDebugClick();
2755
+ return /* @__PURE__ */ jsx19(
2756
+ Drawer,
2757
+ {
2758
+ variant: "permanent",
2759
+ anchor: "left",
2760
+ slotProps: {
2761
+ paper: {
2762
+ sx: {
2763
+ position: "static",
2764
+ backgroundColor: drawerColor,
2765
+ borderRight: "none"
2766
+ }
2767
+ }
2768
+ },
2769
+ sx: { width: "280px" },
2770
+ ...props,
2771
+ children: /* @__PURE__ */ jsxs10(
2772
+ FlexCol6,
2773
+ {
2774
+ sx: {
2775
+ alignItems: "stretch",
2776
+ justifyContent: "space-between",
2777
+ height: "100dvh"
2778
+ },
2779
+ children: [
2780
+ /* @__PURE__ */ jsxs10(
2781
+ FlexCol6,
2782
+ {
2783
+ sx: {
2784
+ alignItems: "stretch",
2785
+ justifyContent: "flex-start",
2786
+ flexGrow: 1,
2787
+ overflow: "auto"
2788
+ },
2789
+ children: [
2790
+ /* @__PURE__ */ jsx19(Tooltip3, { title: version, children: /* @__PURE__ */ jsxs10(
2791
+ FlexGrowRow4,
2792
+ {
2793
+ id: "dapp-name-and-icon",
2794
+ sx: {
2795
+ padding: 2,
2796
+ justifyContent: "flex-start",
2797
+ gap: 1,
2798
+ cursor: "pointer",
2799
+ flexGrow: 0
2800
+ },
2801
+ children: [
2802
+ iconSvg ? RenderHtml({ htmlString: iconSvg }) : null,
2803
+ /* @__PURE__ */ jsx19(Typography6, { noWrap: true, variant: "h6", sx: { letterSpacing: "-1px" }, children: name })
2804
+ ]
2805
+ }
2806
+ ) }),
2807
+ /* @__PURE__ */ jsx19(DebugDialogWithNode, { closeDebug, debugOpen, context }),
2808
+ /* @__PURE__ */ jsx19(List, { sx: { p: 0, overflow: "auto" }, children: menuItems?.map(({
2809
+ svgIcon: icon,
2810
+ primaryText,
2811
+ path: pathFromPayload
2812
+ }) => /* @__PURE__ */ jsx19(
2813
+ ListItem,
2814
+ {
2815
+ disablePadding: true,
2816
+ sx: { paddingBottom: 1 },
2817
+ children: /* @__PURE__ */ jsx19(
2818
+ StyledListItemButton,
2819
+ {
2820
+ onClick: () => handleChange(pathFromPayload),
2821
+ active: pathFromPayload === path,
2822
+ disableRipple: true,
2823
+ disableTouchRipple: true,
2824
+ children: /* @__PURE__ */ jsxs10(
2825
+ FlexRow7,
2826
+ {
2827
+ sx: {
2828
+ "flexGrow": 1,
2829
+ "paddingX": 2,
2830
+ "paddingY": 0.5,
2831
+ "&:hover": { backgroundColor: alpha("#ffffff", 0.05) },
2832
+ "borderRadius": "10px"
2833
+ },
2834
+ children: [
2835
+ /* @__PURE__ */ jsx19(
2836
+ ListItemIcon,
2837
+ {
2838
+ sx: { color: pathFromPayload === path ? activeColor : alpha("#fff", 0.3), justifyContent: "center" },
2839
+ children: /* @__PURE__ */ jsx19(
2840
+ StyledMenuIconWrapSpan,
2841
+ {
2842
+ ref: (ref) => {
2843
+ if (ref !== null) {
2844
+ ref.innerHTML = icon ?? "";
2845
+ }
2846
+ }
2847
+ }
2848
+ )
2849
+ }
2850
+ ),
2851
+ /* @__PURE__ */ jsx19(
2852
+ ListItemText,
2853
+ {
2854
+ slotProps: {
2855
+ primary: {
2856
+ sx: {
2857
+ fontWeight: path === pathFromPayload ? "bold" : "inherit",
2858
+ color: pathFromPayload === path ? "inherit" : alphaCss3(theme.vars?.palette.text.primary ?? "#000", 0.5)
2859
+ }
2860
+ }
2861
+ },
2862
+ primary: primaryText,
2863
+ style: { opacity: pathFromPayload === path ? 1 : 0.5 }
2864
+ }
2865
+ )
2866
+ ]
2867
+ }
2868
+ )
2869
+ }
2870
+ )
2871
+ },
2872
+ primaryText
2873
+ )) })
2874
+ ]
2875
+ }
2876
+ ),
2877
+ /* @__PURE__ */ jsx19(BottomMenuArea, { openDebug, backgroundColor: theme.vars?.palette.primary.dark ?? "#000" })
2878
+ ]
2879
+ }
2880
+ )
2881
+ }
2882
+ );
2883
+ };
2884
+
2885
+ // src/modules/Dapp/modules/Window/DappWindow.tsx
2886
+ import { Snackbar } from "@mui/material";
2887
+ import { ErrorBoundary, ErrorRender as ErrorRender3 } from "@xylabs/react-error";
2888
+ import { useMemo as useMemo13 } from "react";
2889
+
2890
+ // src/modules/Dapp/modules/Window/MetaTags.tsx
2891
+ import { NameTransforms as NameTransforms4 } from "@xyo-network/os-runtime";
2892
+ import { jsxs as jsxs11 } from "react/jsx-runtime";
2893
+ var DappMetaTags = ({
2894
+ active,
2895
+ activePath,
2896
+ dappName
2897
+ }) => {
2898
+ return active ? /* @__PURE__ */ jsxs11("title", { children: [
2899
+ activePath ? `${new NameTransforms4(activePath).deSlug()} | ` : "",
2900
+ " ",
2901
+ dappName,
2902
+ " ",
2903
+ "dApp"
2904
+ ] }) : null;
2905
+ };
2906
+
2907
+ // src/modules/Dapp/modules/Window/DappWindow.tsx
2908
+ import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
2909
+ var DappWindow = ({
2910
+ children,
2911
+ context,
2912
+ dapp,
2913
+ dappMenuProperties,
2914
+ dappState
2915
+ }) => {
2916
+ const { name } = dapp?.config ?? {};
2917
+ const { active } = dappState ?? {};
2918
+ useSyncOsRegisteredAccessInterfaces(context);
2919
+ const routingError = useManageDappPathFromRoute(context, name);
2920
+ const injectableErrors = useManageDappInjectableParamsFromRoute(context);
2921
+ const resolvedErrors = useMemo13(() => [...injectableErrors, routingError].filter(Boolean), [injectableErrors, routingError]);
2922
+ return /* @__PURE__ */ jsxs12(ErrorBoundary, { children: [
2923
+ /* @__PURE__ */ jsx20(DappMetaTags, { active, activePath: dappMenuProperties?.activePath, dappName: name }),
2924
+ resolvedErrors.map((error) => /* @__PURE__ */ jsx20(
2925
+ Snackbar,
2926
+ {
2927
+ open: !!error,
2928
+ message: /* @__PURE__ */ jsx20(ErrorRender3, { error, scope: "DappWindow" })
2929
+ },
2930
+ error?.message
2931
+ )),
2932
+ children
2933
+ ] });
2934
+ };
2935
+
2936
+ // src/modules/Dapp/modules/Window/Rendered.tsx
2937
+ import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
2938
+ import { FlexCol as FlexCol9 } from "@xylabs/react-flexbox";
2939
+ import { NameTransforms as NameTransforms5 } from "@xyo-network/os-runtime";
2940
+ import { NodeProvider as NodeProvider2 } from "@xyo-network/react-node";
2941
+ import { WalletProvider } from "@xyo-network/react-wallet";
2942
+ import React12 from "react";
2943
+
2944
+ // src/modules/Dapp/modules/Window/LoadingFlexbox.tsx
2945
+ import {
2946
+ Fade,
2947
+ styled as styled4,
2948
+ Typography as Typography7
2949
+ } from "@mui/material";
2950
+ import { FlexCol as FlexCol8 } from "@xylabs/react-flexbox";
2951
+ import { useEffect as useEffect16, useState as useState17 } from "react";
2952
+
2953
+ // src/modules/LoadingOsLogo/LoadingOsLogo.tsx
2954
+ import { FlexCol as FlexCol7 } from "@xylabs/react-flexbox";
2955
+ import { useState as useState16 } from "react";
2956
+
2957
+ // src/modules/LoadingOsLogo/img/xyoOS-Icon.svg
2958
+ var xyoOS_Icon_default = '<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 900 900"><defs><style>.cls-1{fill:url(#linear-gradient);}.cls-1,.cls-2{stroke-width:0px;}.cls-2{fill:#a8a8a8;opacity:.21;}</style><linearGradient id="linear-gradient" x1="34.7" y1="450.98" x2="865.07" y2="450.98" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#579fd6"/><stop offset=".52" stop-color="#eb407a"/><stop offset="1" stop-color="#f27046"/></linearGradient></defs><path class="cls-2" d="M864.29,297.43c-2.44-6.58-9.76-9.94-16.34-7.5l-143.74,53.26L533.2,21.88c-1.85-3.48-5.21-5.9-9.09-6.56-3.89-.66-7.85.51-10.75,3.18l-267.76,246.55-118-97.86c-5.4-4.48-13.42-3.73-17.9,1.67-4.48,5.4-3.73,13.42,1.67,17.9l118,97.86L36.62,593.37c-2.09,3.34-2.5,7.46-1.14,11.15s4.37,6.54,8.13,7.72l347.4,108.61-25.75,151.12c-1.18,6.92,3.48,13.49,10.4,14.67.24.04.47.07.7.1,6.66.76,12.82-3.81,13.96-10.5l25.75-151.12,363.77,12.56c3.94.14,7.71-1.56,10.22-4.59,2.51-3.03,3.48-7.06,2.62-10.9l-79.64-355.16,143.75-53.26c6.58-2.44,9.94-9.75,7.5-16.34ZM518.49,48.34l156.33,293.75-401.12-68.35,244.79-225.4ZM674.37,367.8l-264.69,319.16-144.06-388.81,408.75,69.65ZM66.9,592.88l176.22-282.26,141.37,381.56-317.59-99.29ZM431.72,700.22l259.75-313.21,72.81,324.69-332.56-11.48Z"/><path class="cls-1" d="M865.04,302.64c.01-.2.02-.4.03-.6,0-.33,0-.66-.03-.99-.01-.2-.02-.39-.04-.58-.04-.35-.1-.71-.17-1.06-.03-.16-.05-.32-.09-.48-.12-.5-.26-1.01-.45-1.5-.18-.49-.4-.97-.64-1.43-.08-.15-.17-.29-.25-.43-.17-.31-.35-.61-.55-.9-.12-.17-.24-.33-.37-.49-.19-.25-.39-.5-.6-.74-.14-.16-.29-.32-.45-.47-.22-.22-.45-.44-.68-.65-.1-.08-.18-.18-.27-.26L530.1,18.07c-.34-.28-.7-.53-1.07-.77-.09-.06-.17-.13-.26-.19-.62-.39-1.26-.7-1.92-.98-.18-.07-.36-.14-.54-.21-.71-.26-1.43-.47-2.16-.6,0,0-.01,0-.02,0,0,0,0,0-.01,0-.67-.11-1.35-.15-2.03-.16-.37,0-.73,0-1.09.03-.23.02-.46.06-.7.09-.86.11-1.69.31-2.5.59-.07.03-.15.04-.23.07l-.32.12c-.2.08-.4.13-.59.22L115.08,165.06c-.11.04-.22.1-.33.15-.3.12-.59.25-.88.39-.19.1-.38.19-.57.3-.27.15-.54.32-.81.5-.17.12-.35.22-.52.35-.27.2-.53.42-.79.64-.14.12-.28.23-.41.35-.35.33-.68.68-1,1.05-.04.05-.08.1-.12.14-.32.38-.6.78-.87,1.2-.09.14-.16.29-.25.43-.18.31-.36.62-.51.94-.08.17-.15.35-.23.53-.13.31-.25.62-.36.93-.06.19-.12.38-.17.57-.09.33-.17.65-.23.98-.02.11-.06.22-.08.33l-72.09,423.12c-.07.43-.11.87-.13,1.3,0,.11-.03.22-.03.33-.03.73.02,1.44.12,2.16.02.19.06.38.09.57.13.74.31,1.48.57,2.19,0,0,0,0,0,0,0,.02.01.03.02.04.2.53.43,1.04.7,1.53.12.22.26.42.38.63.17.28.33.56.52.82.17.23.35.44.54.66.18.22.36.44.56.65.2.21.42.4.63.6.16.14.29.3.46.43l330.39,274c.08.07.17.12.25.18.32.25.65.49.99.71.15.09.29.19.44.28.44.26.9.5,1.37.7.04.02.08.04.12.06.51.21,1.03.39,1.56.53.17.05.35.08.53.12.24.06.47.12.71.16.23.04.46.07.69.1.47.05.95.08,1.42.08.15,0,.3-.02.45-.02.32-.01.65-.02.97-.06.18-.02.36-.06.54-.08.29-.04.58-.09.86-.15.19-.04.38-.1.56-.15.28-.08.55-.16.82-.25.08-.03.15-.04.23-.07l402.48-149.13s.06-.03.09-.04c.39-.15.76-.32,1.13-.51.12-.06.24-.1.35-.16.44-.24.88-.51,1.29-.8.03-.02.06-.04.09-.06.55-.39,1.07-.85,1.56-1.34.83-.82,1.54-1.76,2.11-2.78.09-.17.19-.33.27-.5.32-.64.61-1.3.82-2,.03-.11.05-.22.08-.33.12-.42.23-.84.3-1.27l72.09-423.12c.02-.11.02-.22.03-.33.05-.34.08-.67.1-1.01ZM771.44,701.13l-101.05-83.8,158.61-254.06-57.56,337.86ZM121.2,242.67l65.53,292.26-123.1,45.61,57.57-337.87ZM656.65,591.33l-141.37-381.56,317.59,99.3-176.22,282.26ZM508.76,181.1l22.05-129.41,263.81,218.79-285.86-89.37ZM483.7,176.83l-299.33-10.33L505.75,47.42l-22.05,129.41ZM208.31,514.94l-72.81-324.69,332.56,11.48-259.75,313.21ZM490.1,214.98l144.06,388.81-382.98-65.25-25.77-4.39L490.1,214.98ZM246.9,563.6l379.17,64.6-244.79,225.4-156.33-293.74,21.95,3.74ZM654.16,636.9l101.05,83.8-321.38,119.08,220.33-202.88ZM72.47,604.37l123.1-45.61,140.72,264.4-84.17-69.81-179.65-148.98Z"/></svg>';
2959
+
2960
+ // src/modules/LoadingOsLogo/img/index.ts
2961
+ var XyoOSIcon = xyoOS_Icon_default;
2962
+
2963
+ // src/modules/LoadingOsLogo/LoadingOsLogo.tsx
2964
+ import { jsx as jsx21 } from "react/jsx-runtime";
2965
+ var LoadingOsLogo = ({
2966
+ widthInPixels,
2967
+ busy,
2968
+ spinsPerSecond = 0.5,
2969
+ ...props
2970
+ }) => {
2971
+ const [imageLoaded, setImageLoaded] = useState16(false);
2972
+ if (!imageLoaded) {
2973
+ const img = new Image();
2974
+ img.addEventListener("load", () => setImageLoaded(true));
2975
+ img.src = XyoOSIcon;
2976
+ }
2977
+ return imageLoaded ? /* @__PURE__ */ jsx21(
2978
+ FlexCol7,
2979
+ {
2980
+ sx: {
2981
+ "@keyframes fadeOut": {
2982
+ "0%": { opacity: 1 },
2983
+ "100%": { opacity: 0.1 },
2984
+ "35%": { opacity: 1 }
2985
+ },
2986
+ "animation": busy ? "fadeOut linear" : void 0,
2987
+ "animationDuration": "1500ms",
2988
+ "animationFillMode": "both"
2989
+ },
2990
+ ...props,
2991
+ children: /* @__PURE__ */ jsx21(
2992
+ FlexCol7,
2993
+ {
2994
+ sx: {
2995
+ "@keyframes spin": {
2996
+ "0%": { transform: "rotate(360deg)" },
2997
+ "100%": { transform: "rotate(0deg)" }
2998
+ },
2999
+ "animation": busy ? `spin ${1 / spinsPerSecond}s linear infinite` : void 0,
3000
+ "animationDirection": "reverse"
3001
+ },
3002
+ ...props,
3003
+ children: /* @__PURE__ */ jsx21("img", { src: XyoOSIcon, height: widthInPixels ?? 22 })
3004
+ }
3005
+ )
3006
+ }
3007
+ ) : null;
3008
+ };
3009
+
3010
+ // src/modules/Dapp/modules/Window/Trail.tsx
3011
+ import { a, useTrail } from "@react-spring/web";
3012
+ import React10 from "react";
3013
+ import { jsx as jsx22 } from "react/jsx-runtime";
3014
+ var TextTrail = ({ open, children }) => {
3015
+ const items = React10.Children.toArray(children);
3016
+ const trail = useTrail(items.length, {
3017
+ config: {
3018
+ friction: 200,
3019
+ mass: 5,
3020
+ tension: 2e3
3021
+ },
3022
+ from: {
3023
+ height: "auto",
3024
+ opacity: 0,
3025
+ y: 20
3026
+ },
3027
+ height: "auto",
3028
+ opacity: open ? 1 : 0,
3029
+ y: open ? 0 : 60
3030
+ });
3031
+ return /* @__PURE__ */ jsx22("div", { children: trail.map(({ height, ...style }, index) => /* @__PURE__ */ jsx22(a.div, { style, children: /* @__PURE__ */ jsx22(a.div, { style: { height }, children: items[index] }) }, index)) });
3032
+ };
3033
+
3034
+ // src/modules/Dapp/modules/Window/LoadingFlexbox.tsx
3035
+ import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
3036
+ var DappLoadingFlexbox = ({
3037
+ minimize,
3038
+ open,
3039
+ name,
3040
+ ...props
3041
+ }) => {
3042
+ const [fadeIn, setFadeIn] = useState17(!open);
3043
+ const [trail, setTrail] = useState17(false);
3044
+ const skipLoadingScreen = useSkipLoadingScreen();
3045
+ useEffect16(() => {
3046
+ if (open) {
3047
+ if (skipLoadingScreen) {
3048
+ const immediateTimeout = setTimeout(() => setFadeIn(false), 0);
3049
+ return () => clearTimeout(immediateTimeout);
3050
+ }
3051
+ const fadeInTimeout = setTimeout(() => {
3052
+ setFadeIn(false);
3053
+ }, 2e3);
3054
+ let trailTimeout = setTimeout(() => {
3055
+ setTrail(true);
3056
+ trailTimeout = setTimeout(() => {
3057
+ setTrail(false);
3058
+ }, 4e3);
3059
+ }, 300);
3060
+ return () => {
3061
+ clearTimeout(fadeInTimeout);
3062
+ clearTimeout(trailTimeout);
3063
+ };
3064
+ }
3065
+ if (!minimize) {
3066
+ const resetTimeout = setTimeout(() => setFadeIn(true), 0);
3067
+ return () => clearTimeout(resetTimeout);
3068
+ }
3069
+ }, [minimize, open, skipLoadingScreen]);
3070
+ return /* @__PURE__ */ jsx23(Fade, { in: fadeIn, unmountOnExit: true, children: /* @__PURE__ */ jsxs13(StyledSplashContainer, { ...props, children: [
3071
+ /* @__PURE__ */ jsx23(LoadingOsLogo, { widthInPixels: 100, busy: true, sx: { position: "absolute" } }),
3072
+ /* @__PURE__ */ jsxs13(TextTrail, { open: trail, sx: { flexDirection: "row" }, children: [
3073
+ /* @__PURE__ */ jsx23(
3074
+ Typography7,
3075
+ {
3076
+ sx: { textAlign: "center", fontSize: { md: "3em", xs: "2em" } },
3077
+ children: "Loading"
3078
+ }
3079
+ ),
3080
+ /* @__PURE__ */ jsx23(
3081
+ Typography7,
3082
+ {
3083
+ sx: { textAlign: "center", fontSize: { md: "3em", xs: "2em" } },
3084
+ children: name
3085
+ }
3086
+ ),
3087
+ /* @__PURE__ */ jsx23(
3088
+ Typography7,
3089
+ {
3090
+ sx: { textAlign: "center", fontSize: { md: "3em", xs: "2em" } },
3091
+ children: "dApp"
3092
+ }
3093
+ )
3094
+ ] })
3095
+ ] }) });
3096
+ };
3097
+ var StyledSplashContainer = styled4(FlexCol8, { name: "StyledSplashContainer" })(({ theme }) => {
3098
+ return {
3099
+ background: theme.vars?.palette.background.default,
3100
+ color: theme.vars?.palette.text.primary,
3101
+ gap: theme.spacing(1),
3102
+ height: "100%",
3103
+ left: 0,
3104
+ position: "absolute",
3105
+ top: 0,
3106
+ width: "100%",
3107
+ zIndex: 999
3108
+ };
3109
+ });
3110
+
3111
+ // src/modules/Dapp/modules/Window/Rendered.tsx
3112
+ import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
3113
+ var DappRendered = ({
3114
+ context,
3115
+ dapp,
3116
+ dappMenuProperties,
3117
+ dappState,
3118
+ dappWallet,
3119
+ errors
3120
+ }) => {
3121
+ const {
3122
+ DappComponent: dappComponent,
3123
+ name,
3124
+ scrollable = true,
3125
+ version
3126
+ } = useDecomposeDapp(dapp);
3127
+ const { active, minimized } = dappState ?? {};
3128
+ const hasErrors = errors && errors.length > 0;
3129
+ return /* @__PURE__ */ jsxs14(
3130
+ DappChrome,
3131
+ {
3132
+ appBar: /* @__PURE__ */ jsx24(
3133
+ DappBar,
3134
+ {
3135
+ context,
3136
+ name,
3137
+ version,
3138
+ title: dappMenuProperties?.activePath ? new NameTransforms5(dappMenuProperties.activePath).deSlug() : ""
3139
+ }
3140
+ ),
3141
+ sx: { height: "100dvh", width: "100dvw" },
3142
+ largeScreenMenu: active && /* @__PURE__ */ jsx24(
3143
+ DappMenuDrawer,
3144
+ {
3145
+ context,
3146
+ name,
3147
+ version,
3148
+ ...dappMenuProperties
3149
+ }
3150
+ ),
3151
+ smallScreenMenu: active && /* @__PURE__ */ jsx24(
3152
+ DappBottomNavigation,
3153
+ {
3154
+ ...dappMenuProperties,
3155
+ sx: { display: dappMenuProperties?.menuConfig ? "flex" : "none" }
3156
+ }
3157
+ ),
3158
+ splashScreen: hasErrors ? null : /* @__PURE__ */ jsx24(DappLoadingFlexbox, { minimize: !!minimized, name, open: !!active }),
3159
+ children: [
3160
+ hasErrors ? /* @__PURE__ */ jsx24(FlexCol9, { sx: { padding: 2 }, children: errors?.map((error) => /* @__PURE__ */ jsx24(ErrorRender4, { error, scope: "DappWindow" }, error?.message)) }) : null,
3161
+ /* @__PURE__ */ jsx24(WalletProvider, { rootWallet: dappWallet, children: context === null ? null : /* @__PURE__ */ jsx24(XyOsUiContextProvider, { value: context, children: /* @__PURE__ */ jsx24(NodeProvider2, { node: context?.root, children: active ? /* @__PURE__ */ jsxs14(Fragment2, { children: [
3162
+ /* @__PURE__ */ jsx24(
3163
+ FlexCol9,
3164
+ {
3165
+ sx: {
3166
+ position: "absolute",
3167
+ top: 0,
3168
+ left: 0,
3169
+ right: 0,
3170
+ bottom: 0,
3171
+ alignItems: "stretch",
3172
+ justifyContent: "stretch",
3173
+ overflowY: scrollable ? "auto" : "hidden"
3174
+ },
3175
+ children: React12.createElement(dappComponent, { name: dapp?.config.name })
3176
+ }
3177
+ ),
3178
+ /* @__PURE__ */ jsx24(DappAccessFlexbox, { context })
3179
+ ] }) : null }) }) })
3180
+ ]
3181
+ }
3182
+ );
3183
+ };
3184
+
3185
+ // src/modules/Dapp/Container.tsx
3186
+ import { jsx as jsx25 } from "react/jsx-runtime";
3187
+ var DappContainer = ({
3188
+ currentIntent,
3189
+ dappSet,
3190
+ xnsNodeUrl,
3191
+ xnsNetwork
3192
+ }) => {
3193
+ const { dapp, dappIcon } = dappSet;
3194
+ const {
3195
+ dappWallet,
3196
+ context,
3197
+ nodeCreateError
3198
+ } = useDappContextCreator(xnsNodeUrl, xnsNetwork, dapp, currentIntent);
3199
+ const dappState = useMemo14(() => {
3200
+ if (currentIntent?.targetDappId === dapp.config.name) {
3201
+ return deriveDappState(currentIntent);
3202
+ }
3203
+ }, [currentIntent, dapp]);
3204
+ const { error: menuError, ...dappMenuProperties } = useDappMenu(context, dapp?.config.name);
3205
+ const errors = useMemo14(() => [nodeCreateError, menuError].filter(Boolean), [nodeCreateError]);
3206
+ const dappWindowProps = useMemo14(() => ({
3207
+ context,
3208
+ dapp,
3209
+ dappMenuProperties,
3210
+ dappState,
3211
+ dappWallet,
3212
+ errors
3213
+ }), [context, dapp, dappMenuProperties, dappState, dappWallet, errors]);
3214
+ return /* @__PURE__ */ jsx25(
3215
+ DappIconButton,
3216
+ {
3217
+ dappIcon,
3218
+ dappIconSvg: dapp.params.iconSvg,
3219
+ dappName: dapp?.config.name,
3220
+ dappState,
3221
+ children: /* @__PURE__ */ jsx25(DappWindow, { ...dappWindowProps, children: /* @__PURE__ */ jsx25(
3222
+ DappRendered,
3223
+ {
3224
+ ...dappWindowProps
3225
+ }
3226
+ ) })
3227
+ }
3228
+ );
3229
+ };
3230
+ var DappContainerMemo = memo(DappContainer);
3231
+
3232
+ // src/modules/Dapp/ContainerFlexbox.tsx
3233
+ import { Container as Container2 } from "@mui/material";
3234
+ import { FlexCol as FlexCol10 } from "@xylabs/react-flexbox";
3235
+ import { jsx as jsx26 } from "react/jsx-runtime";
3236
+ var ContainerFlexbox = ({
3237
+ children,
3238
+ containerProps,
3239
+ scrollable = true,
3240
+ ...props
3241
+ }) => {
3242
+ return /* @__PURE__ */ jsx26(
3243
+ FlexCol10,
3244
+ {
3245
+ id: "container-flexbox",
3246
+ sx: {
3247
+ alignItems: "center",
3248
+ justifyContent: "start",
3249
+ width: "100%",
3250
+ pt: 2,
3251
+ gap: 2,
3252
+ overflow: scrollable ? "auto" : "unset"
3253
+ },
3254
+ ...props,
3255
+ children: /* @__PURE__ */ jsx26(Container2, { ...containerProps, children })
3256
+ }
3257
+ );
3258
+ };
3259
+
3260
+ // src/modules/Dapp/Page/DappPage.tsx
3261
+ import { Container as Container3, Typography as Typography9 } from "@mui/material";
3262
+ import { ThrownErrorBoundary } from "@xylabs/react-error";
3263
+ import { FlexCol as FlexCol12 } from "@xylabs/react-flexbox";
3264
+
3265
+ // src/modules/network/components/LoadingIndicator.tsx
3266
+ import { SignalCellularAltOutlined } from "@mui/icons-material";
3267
+ import { Tooltip as Tooltip4, useTheme as useTheme7 } from "@mui/material";
3268
+ import { useIsDark as useIsDark3 } from "@xylabs/react-theme";
3269
+
3270
+ // src/modules/network/hooks/useOsNetwork.tsx
3271
+ import { OsPubSubNetworkReadyEvent } from "@xyo-network/os-runtime";
3272
+ import { useMemo as useMemo15 } from "react";
3273
+
3274
+ // src/modules/network/hooks/lib/createNetworkState.ts
3275
+ import { assertEx as assertEx8 } from "@xylabs/sdk-js";
3276
+ var defaultNetworkState = {
3277
+ connected: false,
3278
+ error: void 0,
3279
+ networkReady: false
3280
+ };
3281
+ var createNetworkState = (stackReady) => {
3282
+ const { ready, stack } = stackReady ?? {};
3283
+ if (ready) {
3284
+ const foundStack = assertEx8(stack, () => "stack said it was ready but no stack found");
3285
+ return {
3286
+ connected: true,
3287
+ error: void 0,
3288
+ networkReady: true,
3289
+ stack: foundStack
3290
+ };
3291
+ } else {
3292
+ return defaultNetworkState;
3293
+ }
3294
+ };
3295
+
3296
+ // src/modules/network/hooks/useOsNetwork.tsx
3297
+ var useOsNetwork = () => {
3298
+ const context = useXyOsUiContext();
3299
+ const stackReady = useStackReady(OsPubSubNetworkReadyEvent, "osPubSubNetworkStack", context);
3300
+ const networkState = useMemo15(() => {
3301
+ return createNetworkState(stackReady);
3302
+ }, [context, stackReady]);
3303
+ return networkState;
3304
+ };
3305
+
3306
+ // src/modules/network/hooks/useXyoPublicNetwork.tsx
3307
+ import { OsXyoPublicNetworkReadyEvent } from "@xyo-network/os-runtime";
3308
+ import { useMemo as useMemo16 } from "react";
3309
+ var useXyoPublicNetwork = () => {
3310
+ const context = useXyOsUiContext();
3311
+ const stackReady = useStackReady(OsXyoPublicNetworkReadyEvent, "xyoPublicNetworkStack", context);
3312
+ const networkState = useMemo16(() => {
3313
+ return createNetworkState(stackReady);
3314
+ }, [context, stackReady]);
3315
+ return networkState;
3316
+ };
3317
+
3318
+ // src/modules/network/components/StyledLoadingIndicator.tsx
3319
+ import { styled as styled5 } from "@mui/material";
3320
+ var StyledNetworkLoadingIndicator = styled5("div", { name: "StyledNetworkLoadingIndicator" })(({ theme }) => ({
3321
+ "&": {
3322
+ "--Loader-color": "#fff",
3323
+ "--Loader-offset": theme.spacing(0.1667),
3324
+ "--Loader-size": theme.spacing(1.5),
3325
+ "--Loader-timing": "ease-in-out",
3326
+ "alignItems": "center",
3327
+ "display": "flex",
3328
+ "justifyContent": "center",
3329
+ "marginBottom": "calc(var(--Loader-size) / 2)",
3330
+ "marginTop": "calc(var(--Loader-size) / 2)",
3331
+ "minHeight": "var(--Loader-size)",
3332
+ "minWidth": "var(--Loader-size)",
3333
+ "position": "relative",
3334
+ "width": "100%"
3335
+ },
3336
+ "&:after": {
3337
+ animationName: "pulsB",
3338
+ boxShadow: "0 0 0 0 var(--Loader-color)",
3339
+ paddingBottom: "calc(100% - var(--Loader-offset) * 2)",
3340
+ width: "calc(100% - var(--Loader-offset) * 2)"
3341
+ },
3342
+ "&:before": {
3343
+ animationName: "pulsA",
3344
+ boxShadow: "inset 0 0 0 var(--Loader-offset) var(--Loader-color)",
3345
+ paddingBottom: "100%",
3346
+ width: "100%"
3347
+ },
3348
+ "&:before, &:after": {
3349
+ animationDuration: "1.8s",
3350
+ animationIterationCount: "infinite",
3351
+ animationTimingFunction: "var(--Loader-timing)",
3352
+ borderRadius: "50%",
3353
+ content: '""',
3354
+ filter: "drop-shadow(0 0 var(--Loader-offset)/2.25 rgba(var(--Loader-color), 0.75))",
3355
+ position: "absolute"
3356
+ },
3357
+ "@keyframes pulsA": {
3358
+ "0%": { boxShadow: "inset 0 0 0 var(--Loader-offset) var(--Loader-color)" },
3359
+ "50%, 100%": { boxShadow: "inset 0 0 0 0 var(--Loader-color)" }
3360
+ },
3361
+ "@keyframes pulsB": {
3362
+ "0%, 50%": { boxShadow: "0 0 0 0 var(--Loader-color)" },
3363
+ "100%": { boxShadow: "0 0 0 var(--Loader-offset) var(--Loader-color)" }
3364
+ }
3365
+ }));
3366
+
3367
+ // src/modules/network/components/LoadingIndicator.tsx
3368
+ import { jsx as jsx27 } from "react/jsx-runtime";
3369
+ var WaitingForNetwork = () => /* @__PURE__ */ jsx27(Tooltip4, { title: "Waiting for Network initialization", children: /* @__PURE__ */ jsx27(StyledNetworkLoadingIndicator, {}) });
3370
+ var NetworkLoadingIndicator = ({ highContrast }) => {
3371
+ const darkMode = useIsDark3();
3372
+ const theme = useTheme7();
3373
+ const { networkReady } = useOsNetwork();
3374
+ const highContrastSuccessColor = darkMode ? theme.vars?.palette.success.dark : theme.vars?.palette.success.main;
3375
+ const successColor = highContrast ? highContrastSuccessColor : theme.vars?.palette.success.main;
3376
+ const highContrastErrorColor = darkMode ? theme.vars?.palette.success.dark : theme.vars?.palette.error.main;
3377
+ const errorColor = highContrast ? highContrastErrorColor : theme.vars?.palette.error.main;
3378
+ if (!networkReady) {
3379
+ return /* @__PURE__ */ jsx27(WaitingForNetwork, {});
3380
+ }
3381
+ const connectionReady = true;
3382
+ return connectionReady ? /* @__PURE__ */ jsx27(Tooltip4, { title: "Connected to Network", children: /* @__PURE__ */ jsx27(SignalCellularAltOutlined, { sx: { color: successColor } }) }) : /* @__PURE__ */ jsx27(Tooltip4, { title: "Error Connecting to Network", children: /* @__PURE__ */ jsx27(SignalCellularAltOutlined, { sx: { color: errorColor } }) });
3383
+ };
3384
+
3385
+ // src/modules/network/components/NetworkButton.tsx
3386
+ import { NotInterested } from "@mui/icons-material";
3387
+ import { Button as Button2 } from "@mui/material";
3388
+ import { Fragment as Fragment3, jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
3389
+ var NetworkButton = ({
3390
+ disabled,
3391
+ startIcon,
3392
+ ...props
3393
+ }) => {
3394
+ const { networkReady } = useOsNetwork();
3395
+ return /* @__PURE__ */ jsx28(
3396
+ Button2,
3397
+ {
3398
+ disabled: disabled === true || !networkReady,
3399
+ startIcon: /* @__PURE__ */ jsxs15(Fragment3, { children: [
3400
+ startIcon,
3401
+ networkReady === false ? /* @__PURE__ */ jsx28(NotInterested, {}) : null
3402
+ ] }),
3403
+ ...props
3404
+ }
3405
+ );
3406
+ };
3407
+
3408
+ // src/modules/network/components/NetworkReady.tsx
3409
+ import { Typography as Typography8 } from "@mui/material";
3410
+ import { FlexCol as FlexCol11 } from "@xylabs/react-flexbox";
3411
+ import { Fragment as Fragment4, jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
3412
+ var NetworkReadyFlexBox = ({
3413
+ children,
3414
+ skipCheck,
3415
+ ...props
3416
+ }) => {
3417
+ const { networkReady } = useOsNetwork();
3418
+ return /* @__PURE__ */ jsx29(Fragment4, { children: networkReady || skipCheck ? children : /* @__PURE__ */ jsxs16(FlexCol11, { sx: { height: "100%" }, ...props, children: [
3419
+ /* @__PURE__ */ jsx29(LoadingOsLogo, { widthInPixels: 100, busy: true }),
3420
+ /* @__PURE__ */ jsx29(Typography8, { sx: { fontFamily: "monospace" }, children: "Loading XYO Name Service..." })
3421
+ ] }) });
3422
+ };
3423
+
3424
+ // src/modules/Dapp/Page/DappPage.tsx
3425
+ import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
3426
+ var DappTitle = ({
3427
+ subtitle,
3428
+ title,
3429
+ ...props
3430
+ }) => {
3431
+ return title ? /* @__PURE__ */ jsxs17(FlexCol12, { sx: { alignItems: "flex-start", gap: 1 }, ...props, children: [
3432
+ /* @__PURE__ */ jsx30(Typography9, { variant: "h3", children: /* @__PURE__ */ jsx30("b", { children: title }) }),
3433
+ /* @__PURE__ */ jsx30(Typography9, { gutterBottom: true, variant: "subtitle2", children: subtitle })
3434
+ ] }) : null;
3435
+ };
3436
+ var InnerDappPage = ({
3437
+ noScroll,
3438
+ children,
3439
+ subtitle,
3440
+ title,
3441
+ sx,
3442
+ titleProps,
3443
+ ...props
3444
+ }) => {
3445
+ return /* @__PURE__ */ jsxs17(
3446
+ FlexCol12,
3447
+ {
3448
+ id: "innerPage",
3449
+ sx: {
3450
+ margin: 2,
3451
+ gap: noScroll ? 0 : 2,
3452
+ alignItems: "stretch",
3453
+ justifyContent: "flex-start",
3454
+ ...sx
3455
+ },
3456
+ ...props,
3457
+ children: [
3458
+ title ? /* @__PURE__ */ jsx30(DappTitle, { subtitle, title, ...titleProps }) : null,
3459
+ children
3460
+ ]
3461
+ }
3462
+ );
3463
+ };
3464
+ var DappPage = ({
3465
+ checkNetwork,
3466
+ noScroll,
3467
+ subtitle,
3468
+ title,
3469
+ container,
3470
+ rollbar,
3471
+ ...props
3472
+ }) => {
3473
+ return /* @__PURE__ */ jsx30(
3474
+ ThrownErrorBoundary,
3475
+ {
3476
+ errorComponent: (error, boundaryName) => /* @__PURE__ */ jsx30(ErrorRenderWithSupportDefault, { scope: boundaryName, error }),
3477
+ rollbar,
3478
+ scope: "DappPage",
3479
+ children: /* @__PURE__ */ jsx30(NetworkReadyFlexBox, { skipCheck: !checkNetwork, children: container ? /* @__PURE__ */ jsx30(Container3, { disableGutters: true, maxWidth: container === true ? "md" : container, children: noScroll ? /* @__PURE__ */ jsx30(
3480
+ FlexCol12,
3481
+ {
3482
+ sx: {
3483
+ position: "absolute",
3484
+ top: 0,
3485
+ left: 0,
3486
+ right: 0,
3487
+ bottom: 0
3488
+ },
3489
+ children: /* @__PURE__ */ jsx30(InnerDappPage, { noScroll, title, subtitle, ...props, sx: { flexGrow: 1 } })
3490
+ }
3491
+ ) : /* @__PURE__ */ jsx30(
3492
+ FlexCol12,
3493
+ {
3494
+ sx: {
3495
+ width: "100%",
3496
+ height: "100%",
3497
+ alignItems: "stretch"
3498
+ },
3499
+ children: /* @__PURE__ */ jsx30(InnerDappPage, { noScroll, title, subtitle, ...props, sx: { flexGrow: 1 } })
3500
+ }
3501
+ ) }) : noScroll ? /* @__PURE__ */ jsx30(
3502
+ InnerDappPage,
3503
+ {
3504
+ sx: {
3505
+ position: "absolute",
3506
+ top: 0,
3507
+ left: 0,
3508
+ right: 0,
3509
+ bottom: 0,
3510
+ flexGrow: 1
3511
+ },
3512
+ noScroll,
3513
+ title,
3514
+ subtitle,
3515
+ ...props
3516
+ }
3517
+ ) : /* @__PURE__ */ jsx30(InnerDappPage, { noScroll, title, subtitle, ...props, sx: { flexGrow: 1 } }) })
3518
+ }
3519
+ );
3520
+ };
3521
+
3522
+ // src/modules/Dapp/Page/DappPathSwitcher.tsx
3523
+ import { animated as animated2, useTransition } from "@react-spring/web";
3524
+ import { ErrorRender as ErrorRender5 } from "@xylabs/react-error";
3525
+ import { Fragment as Fragment5, jsx as jsx31 } from "react/jsx-runtime";
3526
+ var resolveActiveComponent = (activePathRef, pathToComponent) => {
3527
+ const activeIndex = pathToComponent?.findIndex(({ path: componentPath }) => activePathRef === componentPath);
3528
+ const activeItem = pathToComponent && activeIndex !== -1 && activeIndex !== void 0 ? pathToComponent[activeIndex] : void 0;
3529
+ return activeItem ? activeItem.component : /* @__PURE__ */ jsx31(ErrorRender5, { error: new Error(`No component found for path: ${activePathRef}`), scope: "DappPathSwitcher" });
3530
+ };
3531
+ var DappPathSwitcher = ({ activePath, pathToComponent }) => {
3532
+ const transitions = useTransition(activePath, {
3533
+ enter: { opacity: 1, transform: "translate3d(0, 0, 0)" },
3534
+ from: { opacity: 0, transform: "translate3d(100vw, 0, 0)" },
3535
+ leave: { opacity: 0, transform: "translate3d(0, 0, 0)" }
3536
+ });
3537
+ const possibleZIndex = pathToComponent?.findIndex((item) => item.path === activePath);
3538
+ const zIndex = possibleZIndex !== -1 && possibleZIndex !== void 0 ? possibleZIndex : 1;
3539
+ return /* @__PURE__ */ jsx31(Fragment5, { children: transitions((transitionProps, activePathRef) => /* @__PURE__ */ jsx31(
3540
+ animated2.div,
3541
+ {
3542
+ style: {
3543
+ ...transitionProps,
3544
+ alignItems: "stretch",
3545
+ bottom: 0,
3546
+ display: "flex",
3547
+ flexDirection: "column",
3548
+ justifyContent: "stretch",
3549
+ left: 0,
3550
+ overflowX: "hidden",
3551
+ overflowY: "auto",
3552
+ position: "absolute",
3553
+ right: 0,
3554
+ top: 0,
3555
+ zIndex
3556
+ },
3557
+ children: resolveActiveComponent(activePathRef, pathToComponent)
3558
+ }
3559
+ )) });
3560
+ };
3561
+
3562
+ // src/modules/Dapp/Page/Row.tsx
3563
+ import {
3564
+ Divider as Divider4,
3565
+ Fade as Fade2,
3566
+ styled as styled6
3567
+ } from "@mui/material";
3568
+ import { useMemo as useMemo17 } from "react";
3569
+
3570
+ // src/modules/Dapp/Page/DividerChip.tsx
3571
+ import { Chip as Chip2, CircularProgress } from "@mui/material";
3572
+ import { jsx as jsx32 } from "react/jsx-runtime";
3573
+ var DividerChip = ({ registeredDapps, ...props }) => {
3574
+ return /* @__PURE__ */ jsx32(
3575
+ Chip2,
3576
+ {
3577
+ avatar: registeredDapps === void 0 ? /* @__PURE__ */ jsx32("span", { children: /* @__PURE__ */ jsx32(
3578
+ CircularProgress,
3579
+ {
3580
+ size: "small",
3581
+ sx: { display: "inline" }
3582
+ }
3583
+ ) }) : void 0,
3584
+ label: `${registeredDapps?.length ? "" : "Loading "}Beta dApps`,
3585
+ size: "small",
3586
+ sx: { gap: 0.5 },
3587
+ ...props
3588
+ }
3589
+ );
3590
+ };
3591
+
3592
+ // src/modules/Dapp/Page/Row.tsx
3593
+ import { Fragment as Fragment6, jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
3594
+ var DappsRow = ({
3595
+ chipLabel,
3596
+ currentIntent,
3597
+ installType,
3598
+ registeredDappsSet,
3599
+ xnsNetwork,
3600
+ xnsNodeUrl
3601
+ }) => {
3602
+ const filteredRegisteredDappSets = useMemo17(() => DappInstallTypeFilters[installType](registeredDappsSet), [installType, registeredDappsSet]);
3603
+ return /* @__PURE__ */ jsxs18(Fragment6, { children: [
3604
+ /* @__PURE__ */ jsx33(
3605
+ Divider4,
3606
+ {
3607
+ variant: "middle",
3608
+ sx: { marginY: 3 },
3609
+ flexItem: true,
3610
+ children: /* @__PURE__ */ jsx33(
3611
+ DividerChip,
3612
+ {
3613
+ label: `${filteredRegisteredDappSets === void 0 ? "Loading " : ""}${chipLabel}`,
3614
+ registeredDapps: filteredRegisteredDappSets
3615
+ }
3616
+ )
3617
+ }
3618
+ ),
3619
+ filteredRegisteredDappSets?.length ? /* @__PURE__ */ jsx33(Fade2, { in: !!filteredRegisteredDappSets?.length, timeout: 1e3, children: /* @__PURE__ */ jsx33(StyledGridContainer, { children: filteredRegisteredDappSets?.map(
3620
+ (dappSet) => /* @__PURE__ */ jsx33(
3621
+ DappContainerMemo,
3622
+ {
3623
+ currentIntent,
3624
+ dappSet,
3625
+ xnsNodeUrl,
3626
+ xnsNetwork
3627
+ },
3628
+ dappSet.dapp.config.name
3629
+ )
3630
+ ) }) }) : null
3631
+ ] });
3632
+ };
3633
+ var StyledGridContainer = styled6("div", { name: "StyledGridContainer" })(({ theme }) => ({
3634
+ display: "grid",
3635
+ gridGap: theme.spacing(2),
3636
+ gridTemplateColumns: `repeat(auto-fit, ${theme.spacing(8)})`,
3637
+ justifyContent: "center",
3638
+ justifyItems: "center",
3639
+ paddingTop: theme.spacing(1),
3640
+ width: "100%"
3641
+ }));
3642
+
3643
+ // src/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/ShiftAnimation.tsx
3644
+ import { animated as animated3, useSpring as useSpring2 } from "@react-spring/web";
3645
+ import { useEffect as useEffect17, useState as useState18 } from "react";
3646
+ import { jsx as jsx34 } from "react/jsx-runtime";
3647
+ var MovementData = {
3648
+ down: [
3649
+ {
3650
+ FromYMovement: 0,
3651
+ ToYMovement: -3
3652
+ },
3653
+ {
3654
+ FromYMovement: -3,
3655
+ ToYMovement: 0
3656
+ }
3657
+ ],
3658
+ jump: [
3659
+ {
3660
+ FromYMovement: 0,
3661
+ ToYMovement: -3
3662
+ },
3663
+ {
3664
+ FromYMovement: -3,
3665
+ ToYMovement: 0
3666
+ }
3667
+ ],
3668
+ left: [
3669
+ {
3670
+ FromXMovement: 0,
3671
+ ToXMovement: -3
3672
+ },
3673
+ {
3674
+ FromXMovement: -3,
3675
+ ToXMovement: 0
3676
+ }
3677
+ ],
3678
+ right: [
3679
+ {
3680
+ FromXMovement: 0,
3681
+ ToXMovement: -3
3682
+ },
3683
+ {
3684
+ FromXMovement: -3,
3685
+ ToXMovement: 0
3686
+ }
3687
+ ],
3688
+ up: [
3689
+ {
3690
+ FromYMovement: 0,
3691
+ ToYMovement: -3
3692
+ },
3693
+ {
3694
+ FromYMovement: -3,
3695
+ ToYMovement: 0
3696
+ }
3697
+ ],
3698
+ wiggle: [
3699
+ {
3700
+ FromXMovement: 0,
3701
+ ToXMovement: -3
3702
+ },
3703
+ {
3704
+ FromXMovement: -3,
3705
+ ToXMovement: 0
3706
+ }
3707
+ ]
3708
+ };
3709
+ var ShiftAnimation = ({
3710
+ startAnimation = false,
3711
+ animationDirection,
3712
+ children
3713
+ }) => {
3714
+ const [isShifted, setIsShifted] = useState18(startAnimation);
3715
+ const anim = useSpring2({
3716
+ backfaceVisibility: "hidden",
3717
+ config: {
3718
+ friction: 10,
3719
+ tension: 300
3720
+ },
3721
+ from: {
3722
+ x: startAnimation ? MovementData[animationDirection][1].FromXMovement : 0,
3723
+ y: startAnimation ? MovementData[animationDirection][1].FromYMovement : 0
3724
+ },
3725
+ reset: true,
3726
+ to: {
3727
+ x: startAnimation ? MovementData[animationDirection][0].FromXMovement : 0,
3728
+ y: startAnimation ? MovementData[animationDirection][0].FromYMovement : 0
3729
+ }
3730
+ });
3731
+ useEffect17(() => {
3732
+ if (!isShifted) {
3733
+ return;
3734
+ }
3735
+ const timeoutId = globalThis.setTimeout(() => {
3736
+ setIsShifted(false);
3737
+ }, 5);
3738
+ return () => {
3739
+ globalThis.clearTimeout(timeoutId);
3740
+ };
3741
+ }, [isShifted]);
3742
+ return /* @__PURE__ */ jsx34(animated3.div, { style: anim, children });
3743
+ };
3744
+
3745
+ // src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPoint.tsx
3746
+ import { FiberManualRecordRounded } from "@mui/icons-material";
3747
+ import { Box as Box2, useTheme as useTheme8 } from "@mui/material";
3748
+ import { alphaCss as alphaCss4 } from "@xylabs/react-theme";
3749
+ import { jsx as jsx35 } from "react/jsx-runtime";
3750
+ var TwoToneBulletPoint = (props) => {
3751
+ const theme = useTheme8();
3752
+ return /* @__PURE__ */ jsx35(Box2, { ...props, children: /* @__PURE__ */ jsx35(
3753
+ FiberManualRecordRounded,
3754
+ {
3755
+ fontSize: "small",
3756
+ sx: {
3757
+ "&:hover": { padding: 0.2 },
3758
+ "backgroundColor": alphaCss4(theme.vars?.palette.secondary.main ?? "#000", 0.2),
3759
+ "borderRadius": 2,
3760
+ "padding": 0.4
3761
+ },
3762
+ color: "primary"
3763
+ }
3764
+ ) });
3765
+ };
3766
+
3767
+ // src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPointList.tsx
3768
+ import { FlexCol as FlexCol13, FlexGrowRow as FlexGrowRow5 } from "@xylabs/react-flexbox";
3769
+ import { jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
3770
+ var TwoToneBulletPointList = ({ list }) => {
3771
+ return /* @__PURE__ */ jsx36(FlexCol13, { sx: { alignItems: "flex-start", gap: 1 }, children: list.map((item, index) => {
3772
+ return /* @__PURE__ */ jsxs19(
3773
+ FlexGrowRow5,
3774
+ {
3775
+ sx: {
3776
+ alignItems: "flex-start",
3777
+ justifyContent: "flex-start",
3778
+ gap: 1
3779
+ },
3780
+ children: [
3781
+ /* @__PURE__ */ jsx36(TwoToneBulletPoint, { sx: { marginTop: "4px" } }),
3782
+ item
3783
+ ]
3784
+ },
3785
+ index + "bulletPointList"
3786
+ );
3787
+ }) });
3788
+ };
3789
+
3790
+ // src/modules/dapps/accounts/components/InputFields/CoinbaseEmail.tsx
3791
+ import { FormControl, TextField } from "@mui/material";
3792
+ import { LabeledTextFieldWrapper } from "@xyo-network/react-shared";
3793
+ import { useState as useState19 } from "react";
3794
+ import { jsx as jsx37 } from "react/jsx-runtime";
3795
+ var CoinbaseEmailInput = ({ existingEmail, ...props }) => {
3796
+ const [email, setEmail] = useState19(existingEmail);
3797
+ const [valid, setValid] = useState19();
3798
+ const handleBlur = (event) => {
3799
+ setValid(!!event.target.value);
3800
+ };
3801
+ const handleChange = (event) => {
3802
+ const emailFromEvent = event.target.value;
3803
+ setValid(!!emailFromEvent);
3804
+ setEmail(emailFromEvent);
3805
+ };
3806
+ return /* @__PURE__ */ jsx37(FormControl, { fullWidth: true, children: /* @__PURE__ */ jsx37(LabeledTextFieldWrapper, { label: "Primary Cryptowallet", children: /* @__PURE__ */ jsx37(
3807
+ TextField,
3808
+ {
3809
+ fullWidth: true,
3810
+ variant: "filled",
3811
+ error: valid === false,
3812
+ hiddenLabel: true,
3813
+ onBlur: handleBlur,
3814
+ value: email,
3815
+ onChange: handleChange,
3816
+ size: "small",
3817
+ ...props
3818
+ }
3819
+ ) }) });
3820
+ };
3821
+
3822
+ // src/modules/dapps/accounts/components/InputFields/PrimaryCryptowallet.tsx
3823
+ import { FormControl as FormControl2, TextField as TextField2 } from "@mui/material";
3824
+ import { LabeledTextFieldWrapper as LabeledTextFieldWrapper2 } from "@xyo-network/react-shared";
3825
+ import { useState as useState20 } from "react";
3826
+ import { jsx as jsx38 } from "react/jsx-runtime";
3827
+ var PrimaryCryptoWalletInput = ({ existingPrimaryCryptoWallet, ...props }) => {
3828
+ const [primaryWallet, setPrimaryWallet] = useState20(existingPrimaryCryptoWallet);
3829
+ const [valid, setValid] = useState20();
3830
+ const handleBlur = (event) => {
3831
+ setValid(!!event.target.value);
3832
+ };
3833
+ const handleChange = (event) => {
3834
+ const nameFromEvent = event.target.value;
3835
+ setValid(!!nameFromEvent);
3836
+ setPrimaryWallet(nameFromEvent);
3837
+ };
3838
+ return /* @__PURE__ */ jsx38(FormControl2, { fullWidth: true, children: /* @__PURE__ */ jsx38(LabeledTextFieldWrapper2, { label: "Primary Cryptowallet", children: /* @__PURE__ */ jsx38(
3839
+ TextField2,
3840
+ {
3841
+ fullWidth: true,
3842
+ variant: "filled",
3843
+ error: valid === false,
3844
+ hiddenLabel: true,
3845
+ onBlur: handleBlur,
3846
+ value: primaryWallet,
3847
+ onChange: handleChange,
3848
+ size: "small",
3849
+ required: true,
3850
+ ...props
3851
+ }
3852
+ ) }) });
3853
+ };
3854
+
3855
+ // src/modules/dapps/accounts/components/InputFields/SecondaryCryptowallet.tsx
3856
+ import { FormControl as FormControl3, TextField as TextField3 } from "@mui/material";
3857
+ import { LabeledTextFieldWrapper as LabeledTextFieldWrapper3 } from "@xyo-network/react-shared";
3858
+ import { useState as useState21 } from "react";
3859
+ import { jsx as jsx39 } from "react/jsx-runtime";
3860
+ var SecondaryCryptoWalletInput = ({ existingSecondaryCryptoWallet, ...props }) => {
3861
+ const [secondaryWallet, setSecondaryWallet] = useState21(existingSecondaryCryptoWallet);
3862
+ const [valid, setValid] = useState21();
3863
+ const handleBlur = (event) => {
3864
+ setValid(!!event.target.value);
3865
+ };
3866
+ const handleChange = (event) => {
3867
+ const walletFromEvent = event.target.value;
3868
+ setValid(!!walletFromEvent);
3869
+ setSecondaryWallet(walletFromEvent);
3870
+ };
3871
+ return /* @__PURE__ */ jsx39(FormControl3, { fullWidth: true, children: /* @__PURE__ */ jsx39(LabeledTextFieldWrapper3, { label: "Secondary Cryptowallet", children: /* @__PURE__ */ jsx39(
3872
+ TextField3,
3873
+ {
3874
+ variant: "filled",
3875
+ fullWidth: true,
3876
+ error: valid === false,
3877
+ hiddenLabel: true,
3878
+ onBlur: handleBlur,
3879
+ value: secondaryWallet,
3880
+ onChange: handleChange,
3881
+ size: "small",
3882
+ required: true,
3883
+ ...props
3884
+ }
3885
+ ) }) });
3886
+ };
3887
+
3888
+ // src/modules/dapps/accounts/components/PaymentMethods.tsx
3889
+ import { Grid } from "@mui/material";
3890
+ import { FormGroupCreditCardProvider } from "@xyo-network/react-form-credit-card";
3891
+
3892
+ // src/modules/dapps/accounts/components/AccountCard.tsx
3893
+ import {
3894
+ Card as Card4,
3895
+ CardContent as CardContent3,
3896
+ Divider as Divider5,
3897
+ Typography as Typography10
3898
+ } from "@mui/material";
3899
+ import { FlexGrowCol as FlexGrowCol4, FlexGrowRow as FlexGrowRow6 } from "@xylabs/react-flexbox";
3900
+ import { jsx as jsx40, jsxs as jsxs20 } from "react/jsx-runtime";
3901
+ var AccountCard = ({ items, ...props }) => {
3902
+ return /* @__PURE__ */ jsx40(Card4, { ...props, children: /* @__PURE__ */ jsx40(CardContent3, { children: /* @__PURE__ */ jsx40(FlexGrowCol4, { sx: { width: "100%", gap: 2 }, children: items.map((item, index) => {
3903
+ return /* @__PURE__ */ jsxs20(
3904
+ FlexGrowCol4,
3905
+ {
3906
+ sx: {
3907
+ gap: 2,
3908
+ width: "100%",
3909
+ alignItems: "stretch"
3910
+ },
3911
+ children: [
3912
+ /* @__PURE__ */ jsxs20(
3913
+ FlexGrowRow6,
3914
+ {
3915
+ sx: {
3916
+ alignItems: "stretch",
3917
+ flexDirection: { md: "row", xs: "column" },
3918
+ justifyContent: "space-between",
3919
+ gap: 2
3920
+ },
3921
+ children: [
3922
+ /* @__PURE__ */ jsxs20(
3923
+ FlexGrowCol4,
3924
+ {
3925
+ sx: {
3926
+ alignItems: "flex-start",
3927
+ width: "100%",
3928
+ maxWidth: { md: "40%", xs: "100%" }
3929
+ },
3930
+ children: [
3931
+ /* @__PURE__ */ jsx40(Typography10, { variant: "h5", gutterBottom: true, children: item.title }),
3932
+ /* @__PURE__ */ jsx40(Typography10, { variant: "body1", gutterBottom: true, children: item.desc })
3933
+ ]
3934
+ }
3935
+ ),
3936
+ item?.component
3937
+ ]
3938
+ }
3939
+ ),
3940
+ items.length === 1 || index === items.length - 1 ? null : /* @__PURE__ */ jsx40(Divider5, { flexItem: true })
3941
+ ]
3942
+ },
3943
+ index
3944
+ );
3945
+ }) }) }) });
3946
+ };
3947
+
3948
+ // src/modules/dapps/accounts/components/PaymentMethods.tsx
3949
+ import { jsx as jsx41 } from "react/jsx-runtime";
3950
+ var PaymentMethods = () => {
3951
+ return /* @__PURE__ */ jsx41(DappPage, { title: "Payment Methods", children: /* @__PURE__ */ jsx41(Grid, { container: true, spacing: 3, children: /* @__PURE__ */ jsx41(Grid, { size: { xs: 12 }, children: /* @__PURE__ */ jsx41(
3952
+ AccountCard,
3953
+ {
3954
+ sx: { height: "100%" },
3955
+ items: [
3956
+ {
3957
+ // TODO - needs a default implementation
3958
+ component: /* @__PURE__ */ jsx41(FormGroupCreditCardProvider, { children: "null" }),
3959
+ desc: "Save a credit card to your node to complete credit payments seamlessly.",
3960
+ title: "Credit Card"
3961
+ },
3962
+ {
3963
+ component: /* @__PURE__ */ jsx41(CoinbaseEmailInput, {}),
3964
+ desc: "Use your Coinbase Account receive payments easily.",
3965
+ title: "Coinbase Email"
3966
+ },
3967
+ {
3968
+ component: /* @__PURE__ */ jsx41(PrimaryCryptoWalletInput, {}),
3969
+ desc: "This is the primary crypto wallet on your node.",
3970
+ title: "Primary Crypto Wallet"
3971
+ },
3972
+ {
3973
+ component: /* @__PURE__ */ jsx41(SecondaryCryptoWalletInput, {}),
3974
+ desc: "This is the secondary crypto wallet on your node.",
3975
+ title: "Secondary Crypto Wallet"
3976
+ }
3977
+ ]
3978
+ }
3979
+ ) }) }) });
3980
+ };
3981
+
3982
+ // src/modules/dapps/accounts/hooks/useAccountArchivist.ts
3983
+ import { useWeakArchivistFromNode as useWeakArchivistFromNode5 } from "@xyo-network/react-archivist";
3984
+ var useAccountArchivist = () => {
3985
+ return useWeakArchivistFromNode5("AccountArchivist");
3986
+ };
3987
+
3988
+ // src/modules/dapps/accounts/models/CreditCardInput.ts
3989
+ import { asSchema as asSchema2, isPayloadOfSchemaType } from "@xyo-network/payload-model";
3990
+ var CreditCardInputSchema = asSchema2("network.xyo.credit.card.input", true);
3991
+ var isCreditCardInput = isPayloadOfSchemaType(CreditCardInputSchema);
3992
+
3993
+ // src/modules/dapps/name-service/DomainIcon.tsx
3994
+ import { createSvgIcon } from "@mui/material";
3995
+ import { jsx as jsx42, jsxs as jsxs21 } from "react/jsx-runtime";
3996
+ var XnsDomainIcon = createSvgIcon(
3997
+ /* @__PURE__ */ jsxs21("svg", { id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 400 400", children: [
3998
+ /* @__PURE__ */ jsx42("path", { fill: "currentColor", d: "M0,314.34V85.34h43.89l99.55,152.67V85.34h43.89v229h-43.89L43.89,161.68v152.67H0Z" }),
3999
+ /* @__PURE__ */ jsx42("path", { fill: "currentColor", d: "M298.99,319.12c-16.96,0-32.26-3-45.88-8.99-13.62-5.99-24.81-14.58-33.56-25.76-8.75-11.18-14.29-24.52-16.62-40l45.17-6.68c3.18,13.15,9.75,23.27,19.72,30.37,9.96,7.1,21.31,10.65,34.03,10.65,7.1,0,14-1.11,20.67-3.34,6.68-2.23,12.17-5.51,16.46-9.86,4.29-4.35,6.44-9.7,6.44-16.06,0-2.33-.35-4.59-1.03-6.76-.69-2.17-1.83-4.21-3.42-6.12-1.59-1.91-3.84-3.71-6.76-5.41-2.92-1.69-6.6-3.23-11.05-4.61l-59.48-17.49c-4.45-1.27-9.62-3.07-15.5-5.41-5.88-2.33-11.58-5.67-17.1-10.02-5.51-4.35-10.1-10.1-13.76-17.26-3.66-7.16-5.49-16.19-5.49-27.11,0-15.37,3.87-28.15,11.61-38.33,7.74-10.18,18.08-17.76,31.01-22.74,12.93-4.98,27.25-7.42,42.94-7.32,15.8.21,29.9,2.92,42.3,8.11,12.4,5.2,22.79,12.75,31.17,22.66,8.37,9.92,14.42,22.03,18.13,36.34l-46.76,7.95c-1.7-7.42-4.83-13.68-9.38-18.77-4.56-5.09-9.99-8.96-16.3-11.61-6.31-2.65-12.91-4.08-19.8-4.29-6.79-.21-13.17.72-19.16,2.78-5.99,2.07-10.87,5.06-14.63,8.99-3.76,3.92-5.65,8.59-5.65,14,0,4.98,1.54,9.04,4.61,12.17,3.07,3.13,6.94,5.65,11.61,7.55,4.66,1.91,9.44,3.5,14.31,4.77l39.76,10.81c5.94,1.59,12.51,3.68,19.72,6.28,7.21,2.6,14.13,6.2,20.75,10.81,6.62,4.61,12.09,10.68,16.38,18.21,4.29,7.53,6.44,17.07,6.44,28.63,0,12.3-2.57,23.03-7.71,32.2-5.14,9.17-12.06,16.75-20.75,22.74-8.69,5.99-18.53,10.47-29.5,13.44-10.97,2.97-22.29,4.45-33.95,4.45Z" }),
4000
+ /* @__PURE__ */ jsx42("circle", { fill: "#3898e7", cx: "372.52", cy: "291.63", r: "27.48" })
4001
+ ] }),
4002
+ "XNSDomain"
4003
+ );
4004
+
4005
+ // src/modules/dapps/table/head/components/Head.tsx
4006
+ import { InfoOutlined } from "@mui/icons-material";
4007
+ import {
4008
+ TableCell,
4009
+ TableHead,
4010
+ Tooltip as Tooltip5
4011
+ } from "@mui/material";
4012
+
4013
+ // src/modules/dapps/table/head/hooks/useVisibleColumns.tsx
4014
+ import { useMediaQuery as useMediaQuery2 } from "@mui/material";
4015
+ import { useMemo as useMemo18 } from "react";
4016
+ var useVisibleColumns = (tableHeadCells) => {
4017
+ const isMedium = useMediaQuery2((theme) => theme.breakpoints.down("lg"));
4018
+ const VisibleTableCells = useMemo18(() => {
4019
+ return isMedium ? tableHeadCells.filter((cell) => cell.showOnMobile) : tableHeadCells;
4020
+ }, [isMedium, tableHeadCells]);
4021
+ return [VisibleTableCells, isMedium];
4022
+ };
4023
+
4024
+ // src/modules/dapps/table/head/components/StyledTableRowHeader.tsx
4025
+ import { styled as styled7, TableRow } from "@mui/material";
4026
+ var StyledTableRowHeader = styled7(
4027
+ TableRow,
4028
+ { name: "StyledTableRowHeader" }
4029
+ )(({ theme }) => ({ "& .MuiTableCell-root": { backgroundColor: theme.vars?.palette.background.paper } }));
4030
+
4031
+ // src/modules/dapps/table/head/components/Head.tsx
4032
+ import { jsx as jsx43, jsxs as jsxs22 } from "react/jsx-runtime";
4033
+ var TableHeadEx = ({ payloads, ...props }) => {
4034
+ const [VisibleTableCells] = useVisibleColumns(payloads);
4035
+ return /* @__PURE__ */ jsx43(TableHead, { ...props, children: /* @__PURE__ */ jsx43(StyledTableRowHeader, { children: VisibleTableCells.map((headCell) => /* @__PURE__ */ jsx43(
4036
+ TableCell,
4037
+ {
4038
+ align: headCell.align ?? "left",
4039
+ padding: headCell.disablePadding ? "none" : "normal",
4040
+ width: headCell.width ?? "auto",
4041
+ children: headCell.tooltip ? /* @__PURE__ */ jsxs22(
4042
+ "span",
4043
+ {
4044
+ style: {
4045
+ alignItems: "center",
4046
+ display: "inline-flex",
4047
+ gap: "4px"
4048
+ },
4049
+ children: [
4050
+ headCell.label,
4051
+ /* @__PURE__ */ jsx43(Tooltip5, { title: headCell.tooltip, children: /* @__PURE__ */ jsx43(InfoOutlined, { sx: { fontSize: "16px" } }) })
4052
+ ]
4053
+ }
4054
+ ) : headCell.label
4055
+ },
4056
+ headCell.id
4057
+ )) }) });
4058
+ };
4059
+
4060
+ // src/modules/dapps/table/head/Payload.ts
4061
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
4062
+
4063
+ // src/modules/dapps/table/head/Schema.ts
4064
+ import { asSchema as asSchema3 } from "@xyo-network/payload-model";
4065
+ var TableHeadCellSchema = asSchema3("network.xyo.table.cell.head", true);
4066
+
4067
+ // src/modules/dapps/table/head/Payload.ts
4068
+ var isTableHeadCell = isPayloadOfSchemaType2(TableHeadCellSchema);
4069
+
4070
+ // src/modules/dapps/table/NextIteratorFlexbox.tsx
4071
+ import { ArrowCircleLeftOutlined, ArrowCircleRightOutlined } from "@mui/icons-material";
4072
+ import { IconButton as IconButton3, LinearProgress } from "@mui/material";
4073
+ import { FlexRow as FlexRow8 } from "@xylabs/react-flexbox";
4074
+ import { jsx as jsx44, jsxs as jsxs23 } from "react/jsx-runtime";
4075
+ var NextIteratorFlexbox = ({
4076
+ next: changePage,
4077
+ loading,
4078
+ ...props
4079
+ }) => {
4080
+ return /* @__PURE__ */ jsxs23(FlexRow8, { sx: { justifyContent: "space-between", gap: 2 }, ...props, children: [
4081
+ /* @__PURE__ */ jsx44(
4082
+ LinearProgress,
4083
+ {
4084
+ sx: {
4085
+ display: "flex",
4086
+ flexGrow: 1,
4087
+ visibility: loading ? "visible" : "hidden"
4088
+ }
4089
+ }
4090
+ ),
4091
+ /* @__PURE__ */ jsxs23(FlexRow8, { children: [
4092
+ /* @__PURE__ */ jsx44(IconButton3, { onClick: () => changePage("asc"), children: /* @__PURE__ */ jsx44(ArrowCircleLeftOutlined, {}) }),
4093
+ /* @__PURE__ */ jsx44(IconButton3, { onClick: () => changePage("desc"), children: /* @__PURE__ */ jsx44(ArrowCircleRightOutlined, {}) })
4094
+ ] })
4095
+ ] });
4096
+ };
4097
+
4098
+ // src/modules/widgets/WidgetCard.tsx
4099
+ import {
4100
+ ArrowForwardRounded,
4101
+ HistoryRounded,
4102
+ RefreshRounded
4103
+ } from "@mui/icons-material";
4104
+ import {
4105
+ Box as Box3,
4106
+ CardContent as CardContent4,
4107
+ IconButton as IconButton4,
4108
+ Tooltip as Tooltip6,
4109
+ Typography as Typography11,
4110
+ useTheme as useTheme9
4111
+ } from "@mui/material";
4112
+ import { ButtonEx as ButtonEx5 } from "@xylabs/react-button";
4113
+ import {
4114
+ FlexCol as FlexCol14,
4115
+ FlexGrowRow as FlexGrowRow7,
4116
+ FlexRow as FlexRow9
4117
+ } from "@xylabs/react-flexbox";
4118
+ import { alphaCss as alphaCss5 } from "@xylabs/react-theme";
4119
+ import { CardEx } from "@xyo-network/react-card";
4120
+ import { DateTime } from "luxon";
4121
+ import { jsx as jsx45, jsxs as jsxs24 } from "react/jsx-runtime";
4122
+ var WidgetCard = ({
4123
+ widgetName,
4124
+ widgetContent,
4125
+ widgetPath,
4126
+ timeOfData = 1715875087,
4127
+ ...props
4128
+ }) => {
4129
+ const theme = useTheme9();
4130
+ const formatTimeOfData = () => {
4131
+ const timeNow = DateTime.now().toSeconds();
4132
+ const secondsSinceDataRefreshed = timeNow - timeOfData;
4133
+ const getYearsAndMonths = () => {
4134
+ const years = Math.floor(secondsSinceDataRefreshed / 31536e3);
4135
+ const months = Math.ceil((secondsSinceDataRefreshed - years * 31536e3) / 2628288);
4136
+ if (months === 12) {
4137
+ return `${years + 1} Years Ago`;
4138
+ } else if (years > 1 && months > 1) {
4139
+ return `${years} Years, ${months} Months Ago`;
4140
+ } else if (years === 1 && months > 1) {
4141
+ return `${years} Year, ${months} Months Ago`;
4142
+ } else if (years > 1 && months === 1) {
4143
+ return `${years} Years, ${months} Month Ago`;
4144
+ } else if (years === 1 && months === 1) {
4145
+ return `${years} Year, ${months} Month Ago`;
4146
+ } else {
4147
+ return `About ${years} Years Ago`;
4148
+ }
4149
+ };
4150
+ if (secondsSinceDataRefreshed < 60) {
4151
+ return "Less than 1 Minute Ago";
4152
+ } else if (secondsSinceDataRefreshed < 3600) {
4153
+ return `${DateTime.fromSeconds(secondsSinceDataRefreshed).toFormat("m")} Minutes Ago`;
4154
+ } else if (secondsSinceDataRefreshed < 86400) {
4155
+ return `${Math.ceil(secondsSinceDataRefreshed / 3600)} Hours Ago`;
4156
+ } else if (secondsSinceDataRefreshed < 2628288) {
4157
+ return `${Math.ceil(secondsSinceDataRefreshed / 86400)} Days Ago`;
4158
+ } else if (secondsSinceDataRefreshed < 31536e3) {
4159
+ return `${Math.ceil(secondsSinceDataRefreshed / 2628288)} Months Ago`;
4160
+ } else {
4161
+ return getYearsAndMonths();
4162
+ }
4163
+ };
4164
+ return /* @__PURE__ */ jsx45(
4165
+ CardEx,
4166
+ {
4167
+ ...props,
4168
+ sx: {
4169
+ backgroundColor: alphaCss5(theme.vars?.palette.background.paper ?? "#000", 0.4),
4170
+ display: "flex",
4171
+ height: "300px",
4172
+ width: "300px"
4173
+ },
4174
+ children: /* @__PURE__ */ jsx45(CardContent4, { sx: { height: "100%", padding: 1 }, children: /* @__PURE__ */ jsxs24(
4175
+ FlexCol14,
4176
+ {
4177
+ sx: {
4178
+ alignItems: "stretch",
4179
+ height: "100%",
4180
+ justifyContent: "space-between"
4181
+ },
4182
+ children: [
4183
+ /* @__PURE__ */ jsxs24(FlexCol14, { sx: { alignItems: "stretch" }, children: [
4184
+ /* @__PURE__ */ jsxs24(FlexGrowRow7, { sx: { justifyContent: "space-between", alignItems: "center" }, children: [
4185
+ /* @__PURE__ */ jsx45(Typography11, { variant: "h6", sx: { color: theme.vars?.palette.text.primary, fontWeight: theme.typography.fontWeightMedium }, children: widgetName }),
4186
+ /* @__PURE__ */ jsx45(IconButton4, { children: /* @__PURE__ */ jsx45(RefreshRounded, {}) })
4187
+ ] }),
4188
+ /* @__PURE__ */ jsx45(Box3, { sx: { paddingY: 2 }, children: widgetContent })
4189
+ ] }),
4190
+ /* @__PURE__ */ jsxs24(FlexRow9, { sx: { justifyContent: "space-between", alignItems: "center" }, children: [
4191
+ /* @__PURE__ */ jsx45(Tooltip6, { title: DateTime.fromSeconds(timeOfData).toFormat("DD ttt"), children: /* @__PURE__ */ jsxs24(
4192
+ FlexRow9,
4193
+ {
4194
+ sx: { gap: 0.5, opacity: 0.5 },
4195
+ children: [
4196
+ /* @__PURE__ */ jsx45(HistoryRounded, { fontSize: "small", color: "inherit" }),
4197
+ /* @__PURE__ */ jsx45(Typography11, { variant: "body2", children: formatTimeOfData() })
4198
+ ]
4199
+ }
4200
+ ) }),
4201
+ /* @__PURE__ */ jsx45(ButtonEx5, { size: "small", to: widgetPath, children: /* @__PURE__ */ jsx45(ArrowForwardRounded, { fontSize: "small" }) })
4202
+ ] })
4203
+ ]
4204
+ }
4205
+ ) })
4206
+ }
4207
+ );
4208
+ };
4209
+
4210
+ // src/modules/widgets/WidgetCardExamples.tsx
4211
+ import { Stack as Stack2 } from "@mui/material";
4212
+ import { useIsDark as useIsDark4 } from "@xylabs/react-theme";
4213
+
4214
+ // src/modules/widgets/StackOfWidgets.tsx
4215
+ import { Box as Box4, useTheme as useTheme11 } from "@mui/material";
4216
+ import {
4217
+ animated as animated4,
4218
+ to as interpolate,
4219
+ useSprings
4220
+ } from "@react-spring/web";
4221
+ import { alphaCss as alphaCss8 } from "@xylabs/react-theme";
4222
+ import { useState as useState22 } from "react";
4223
+ import { useDrag } from "react-use-gesture";
4224
+
4225
+ // src/modules/widgets/Types/BarGraph/HorizontalBarGraph.tsx
4226
+ import { Typography as Typography12 } from "@mui/material";
4227
+ import { FlexCol as FlexCol15, FlexGrowRow as FlexGrowRow8 } from "@xylabs/react-flexbox";
4228
+
4229
+ // src/modules/widgets/Types/BarGraph/StyledLinearProgress.tsx
4230
+ import { LinearProgress as LinearProgress2, styled as styled8 } from "@mui/material";
4231
+ import { alphaCss as alphaCss6 } from "@xylabs/react-theme";
4232
+ var StyledLinearProgress = styled8(LinearProgress2, { name: "StyledLinearProgress" })(({ theme }) => ({
4233
+ "& .MuiLinearProgress-bar": { borderRadius: theme.shape.borderRadius },
4234
+ "MozBoxSizing": "border-box",
4235
+ "WebkitBoxSizing": "border-box",
4236
+ "background": "transparent",
4237
+ "borderBottom": `1px solid ${alphaCss6(theme.vars?.palette.text.secondary ?? "#000", 0.3)}`,
4238
+ "boxSizing": "border-box",
4239
+ "height": theme.spacing(0.25)
4240
+ }));
4241
+
4242
+ // src/modules/widgets/Types/BarGraph/HorizontalBarGraph.tsx
4243
+ import { jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
4244
+ var sampleData = [
4245
+ { name: "United States", value: 134 },
4246
+ { name: "South Africa", value: 400 },
4247
+ { name: "Canada", value: 382 },
4248
+ { name: "Philippines", value: 423 },
4249
+ { name: "Denmark", value: 123 },
4250
+ { name: "Greece", value: 321 },
4251
+ { name: "Japan", value: 421 }
4252
+ ];
4253
+ var HorizontalBarGraph = ({ items = sampleData, ...props }) => {
4254
+ const itemsSortedByValue = items.toSorted(function(a2, b) {
4255
+ const keyA = a2.value, keyB = b.value;
4256
+ if (keyA > keyB) return -1;
4257
+ if (keyA < keyB) return 1;
4258
+ return 0;
4259
+ });
4260
+ console.log(itemsSortedByValue);
4261
+ const topValue = itemsSortedByValue[0].value;
4262
+ return /* @__PURE__ */ jsx46(FlexCol15, { sx: { alignItems: "stretch", gap: 0.5 }, ...props, children: items.slice(0, 5).map((item, index) => /* @__PURE__ */ jsxs25(FlexCol15, { sx: { alignItems: "stretch" }, children: [
4263
+ /* @__PURE__ */ jsxs25(FlexGrowRow8, { sx: { justifyContent: "space-between" }, children: [
4264
+ /* @__PURE__ */ jsx46(Typography12, { variant: "caption", noWrap: true, sx: { maxWidth: "50%" }, children: item.name }),
4265
+ /* @__PURE__ */ jsx46(Typography12, { variant: "caption", sx: { maxWidth: "50%" }, children: item.value })
4266
+ ] }),
4267
+ /* @__PURE__ */ jsx46(StyledLinearProgress, { color: "primary", value: item.value / (topValue * 1.25) * 100, variant: "determinate" })
4268
+ ] }, index)) });
4269
+ };
4270
+
4271
+ // src/modules/widgets/Types/DataColumns/TwoColTwoStat.tsx
4272
+ import { Typography as Typography13, useTheme as useTheme10 } from "@mui/material";
4273
+ import { FlexCol as FlexCol16, FlexGrowRow as FlexGrowRow9 } from "@xylabs/react-flexbox";
4274
+ import { useEffect as useEffect18 } from "react";
4275
+ import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
4276
+ var MAX_LENGTH = 2;
4277
+ var validateProps = (props) => {
4278
+ if (props.length > MAX_LENGTH) {
4279
+ throw new Error(`The length of items for the Two Column Two Stat widget should not exceed ${MAX_LENGTH}`);
4280
+ }
4281
+ };
4282
+ var TwoColTwoStat = ({ items, ...props }) => {
4283
+ const theme = useTheme10();
4284
+ useEffect18(() => {
4285
+ validateProps(items);
4286
+ }, [items]);
4287
+ return /* @__PURE__ */ jsx47(FlexGrowRow9, { sx: { gap: 2 }, ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs26(FlexCol16, { sx: { flexGrow: 1, alignItems: "start" }, children: [
4288
+ /* @__PURE__ */ jsx47(Typography13, { variant: "h2", sx: { fontWeight: theme.typography.fontWeightMedium }, children: item.rawInsightValue }),
4289
+ /* @__PURE__ */ jsx47(Typography13, { variant: "body2", children: item.subtitle })
4290
+ ] }, `stat-${index}-${item.unit}`)) });
4291
+ };
4292
+
4293
+ // src/modules/widgets/Types/Examples/BarGraph.tsx
4294
+ import { jsx as jsx48 } from "react/jsx-runtime";
4295
+ var ExampleBarGraphWidget = () => {
4296
+ return /* @__PURE__ */ jsx48(WidgetCard, { widgetContent: /* @__PURE__ */ jsx48(HorizontalBarGraph, {}), widgetName: "Friend Locations", timeOfData: 1715713478, widgetPath: "/profile" });
4297
+ };
4298
+
4299
+ // src/modules/widgets/Types/Tables/BooleanTable.tsx
4300
+ import { CircleRounded } from "@mui/icons-material";
4301
+ import {
4302
+ Paper as Paper2,
4303
+ styled as styled9,
4304
+ TableRow as TableRow2,
4305
+ Typography as Typography14
4306
+ } from "@mui/material";
4307
+ import {
4308
+ FlexCol as FlexCol17,
4309
+ FlexGrowRow as FlexGrowRow10,
4310
+ FlexRow as FlexRow10
4311
+ } from "@xylabs/react-flexbox";
4312
+ import { alphaCss as alphaCss7 } from "@xylabs/react-theme";
4313
+ import { jsx as jsx49, jsxs as jsxs27 } from "react/jsx-runtime";
4314
+ var sampleData2 = [
4315
+ { name: "@arietrouw", value: true },
4316
+ { name: "@officialxyo", value: false },
4317
+ { name: "0x187623121928634124", value: true },
4318
+ { name: "@coinwithus", value: true },
4319
+ { name: "0x871218376123894321", value: true }
4320
+ ];
4321
+ var StyledLightTableRow = styled9(Paper2, { name: "StyledLightTableRow" })(({ theme }) => ({
4322
+ backgroundColor: "transparent",
4323
+ padding: theme.spacing(0.75)
4324
+ }));
4325
+ var StyledTableColumnTitle = styled9(Typography14, { name: "StyledTableColumnTitle" })(({ theme }) => ({
4326
+ color: theme.vars?.palette.text.secondary,
4327
+ fontWeight: theme.typography.fontWeightBold,
4328
+ textTransform: "uppercase"
4329
+ }));
4330
+ var DefaultTrueOutput = styled9(CircleRounded, { name: "DefaultTrueOutput" })(({ theme }) => ({
4331
+ fill: theme.vars?.palette.success.main,
4332
+ fontSize: "10px"
4333
+ }));
4334
+ var DefaultFalseOutput = styled9(CircleRounded, { name: "DefaultFalseOutput" })(({ theme }) => ({
4335
+ fill: alphaCss7(theme.vars?.palette.text.disabled ?? "#111", 0.5),
4336
+ fontSize: "10px"
4337
+ }));
4338
+ var defaultTrueOutput = /* @__PURE__ */ jsx49(DefaultTrueOutput, {});
4339
+ var defaultFalseOutput = /* @__PURE__ */ jsx49(DefaultFalseOutput, {});
4340
+ var BooleanTable = ({
4341
+ items = sampleData2,
4342
+ tableHeaders,
4343
+ trueOutput = defaultTrueOutput,
4344
+ falseOutput = defaultFalseOutput,
4345
+ ...props
4346
+ }) => {
4347
+ return /* @__PURE__ */ jsxs27(FlexCol17, { sx: { alignItems: "stretch" }, ...props, children: [
4348
+ /* @__PURE__ */ jsx49(FlexRow10, { sx: { paddingBottom: 0.5, justifyContent: "space-between" }, children: tableHeaders.map((name) => /* @__PURE__ */ jsx49(StyledTableColumnTitle, { variant: "caption", children: name }, name)) }),
4349
+ /* @__PURE__ */ jsx49(FlexCol17, { sx: { alignItems: "stretch", gap: 0.25 }, children: items.slice(0, 4).map((item, index) => /* @__PURE__ */ jsx49(TableRow2, { children: /* @__PURE__ */ jsxs27(FlexGrowRow10, { sx: { flexGrow: 1, justifyContent: "space-between" }, children: [
4350
+ /* @__PURE__ */ jsx49(Typography14, { variant: "caption", noWrap: true, sx: { maxWidth: "70%" }, children: item.name }),
4351
+ item.value ? trueOutput : falseOutput
4352
+ ] }) }, index)) })
4353
+ ] });
4354
+ };
4355
+
4356
+ // src/modules/widgets/Types/Examples/BooleanTable.tsx
4357
+ import { jsx as jsx50 } from "react/jsx-runtime";
4358
+ var ExampleBooleanTableWidget = () => {
4359
+ return /* @__PURE__ */ jsx50(
4360
+ WidgetCard,
4361
+ {
4362
+ widgetContent: /* @__PURE__ */ jsx50(
4363
+ BooleanTable,
4364
+ {
4365
+ items: [
4366
+ { name: "@arietrouw", value: true },
4367
+ { name: "@officialxyo", value: false },
4368
+ { name: "0x187623121928634124", value: true },
4369
+ { name: "@coinwithus", value: true },
4370
+ { name: "0x871218376123894321", value: true }
4371
+ ],
4372
+ tableHeaders: ["Id", "Online"]
4373
+ }
4374
+ ),
4375
+ widgetName: "Friends",
4376
+ timeOfData: 1715875797,
4377
+ widgetPath: "/profile"
4378
+ }
4379
+ );
4380
+ };
4381
+
4382
+ // src/modules/widgets/Types/Examples/TwoColTwoStat.tsx
4383
+ import { jsx as jsx51 } from "react/jsx-runtime";
4384
+ var ExampleTwoColTwoStatWidget = () => {
4385
+ return /* @__PURE__ */ jsx51(
4386
+ WidgetCard,
4387
+ {
4388
+ widgetContent: /* @__PURE__ */ jsx51(
4389
+ TwoColTwoStat,
4390
+ {
4391
+ items: [
4392
+ {
4393
+ rawInsightValue: 218,
4394
+ subtitle: "Inbound Access Requests",
4395
+ uiInsightValue: 218,
4396
+ unit: "requests"
4397
+ },
4398
+ {
4399
+ rawInsightValue: 18,
4400
+ subtitle: "Outbound Access Requests",
4401
+ uiInsightValue: 18,
4402
+ unit: "requests"
4403
+ }
4404
+ ]
4405
+ }
4406
+ ),
4407
+ widgetName: "Network Activity",
4408
+ timeOfData: 1642637397,
4409
+ widgetPath: "/network"
4410
+ }
4411
+ );
4412
+ };
4413
+
4414
+ // src/modules/widgets/StackOfWidgets.tsx
4415
+ import { Fragment as Fragment7, jsx as jsx52 } from "react/jsx-runtime";
4416
+ var cards = [
4417
+ /* @__PURE__ */ jsx52(ExampleBarGraphWidget, {}, "bar-graph"),
4418
+ /* @__PURE__ */ jsx52(ExampleBooleanTableWidget, {}, "boolean-table"),
4419
+ /* @__PURE__ */ jsx52(ExampleTwoColTwoStatWidget, {}, "two-column")
4420
+ ];
4421
+ var to = (i) => ({
4422
+ delay: i * 100,
4423
+ rot: -10 + Math.random() * 15,
4424
+ scale: 1,
4425
+ x: 0,
4426
+ y: i * -4
4427
+ });
4428
+ var from = (_i) => ({
4429
+ rot: 0,
4430
+ scale: 1.5,
4431
+ x: 0,
4432
+ y: -1e3
4433
+ });
4434
+ var trans = (r, s) => `perspective(1500px) rotateY(${r / 10}deg) scale(${s})`;
4435
+ function Deck() {
4436
+ const [gone] = useState22(() => /* @__PURE__ */ new Set());
4437
+ const theme = useTheme11();
4438
+ const [props, api] = useSprings(cards.length, (i) => ({
4439
+ ...to(i),
4440
+ from: from(i)
4441
+ }));
4442
+ const bind = useDrag(({
4443
+ args: [index],
4444
+ down,
4445
+ movement: [mx],
4446
+ direction: [xDir],
4447
+ velocity
4448
+ }) => {
4449
+ const trigger = velocity > 0.2;
4450
+ const dir = xDir < 0 ? -1 : 1;
4451
+ if (!down && trigger) gone.add(index);
4452
+ api.start((i) => {
4453
+ if (index !== i) return;
4454
+ const isGone = gone.has(index);
4455
+ const x = isGone ? (200 + globalThis.innerWidth) * dir : down ? mx : 0;
4456
+ const rot = mx / 100 + (isGone ? dir * 10 * velocity : 0);
4457
+ const scale = down ? 1.1 : 1;
4458
+ return {
4459
+ config: {
4460
+ friction: 50,
4461
+ tension: down ? 800 : isGone ? 200 : 500
4462
+ },
4463
+ delay: void 0,
4464
+ rot,
4465
+ scale,
4466
+ x
4467
+ };
4468
+ });
4469
+ if (!down && gone.size === cards.length)
4470
+ setTimeout(() => {
4471
+ gone.clear();
4472
+ api.start((i) => to(i));
4473
+ }, 600);
4474
+ });
4475
+ return /* @__PURE__ */ jsx52(Fragment7, { children: props.map(({
4476
+ x,
4477
+ y,
4478
+ rot,
4479
+ scale
4480
+ }, i) => /* @__PURE__ */ jsx52(
4481
+ animated4.div,
4482
+ {
4483
+ style: {
4484
+ alignItems: "center",
4485
+ display: "flex",
4486
+ height: "300px",
4487
+ justifyContent: "center",
4488
+ position: "absolute",
4489
+ touchAction: "none",
4490
+ width: "300px",
4491
+ willChange: "transform",
4492
+ x,
4493
+ y
4494
+ },
4495
+ children: /* @__PURE__ */ jsx52(
4496
+ animated4.div,
4497
+ {
4498
+ ...bind(i),
4499
+ style: {
4500
+ // WebkitBackdropFilter: 'blur(10px)',
4501
+ // backdropFilter: 'blur(10px)',
4502
+ backgroundColor: alphaCss8(theme.vars?.palette.background.paper ?? "#000", 0.2),
4503
+ backgroundPosition: "center center",
4504
+ backgroundRepeat: "no-repeat",
4505
+ backgroundSize: "auto 85%",
4506
+ borderRadius: " 10px",
4507
+ boxShadow: theme.shadows[7],
4508
+ height: "85vh",
4509
+ maxHeight: "300px",
4510
+ maxWidth: "300px",
4511
+ transform: interpolate([rot, scale], trans),
4512
+ width: "45vh",
4513
+ willChange: "transform"
4514
+ },
4515
+ children: cards[i]
4516
+ }
4517
+ )
4518
+ },
4519
+ i
4520
+ )) });
4521
+ }
4522
+ var StackOfWidgets = () => {
4523
+ return /* @__PURE__ */ jsx52(
4524
+ Box4,
4525
+ {
4526
+ sx: {
4527
+ alignItems: "center",
4528
+ cursor: "pointer",
4529
+ display: "flex",
4530
+ height: "300px",
4531
+ justifyContent: "center",
4532
+ width: "300px"
4533
+ },
4534
+ children: /* @__PURE__ */ jsx52(Deck, {})
4535
+ }
4536
+ );
4537
+ };
4538
+
4539
+ // src/modules/widgets/WidgetCardExamples.tsx
4540
+ import { jsx as jsx53, jsxs as jsxs28 } from "react/jsx-runtime";
4541
+ var WidgetCardExamples = () => {
4542
+ const darkMode = useIsDark4();
4543
+ return /* @__PURE__ */ jsx53(
4544
+ DappPage,
4545
+ {
4546
+ sx: { backgroundImage: darkMode ? `url(${xyoDark})` : `url(${xyoLight})`, backgroundSize: "cover" },
4547
+ container: "xl",
4548
+ title: "Example Widget Cards",
4549
+ children: /* @__PURE__ */ jsxs28(
4550
+ Stack2,
4551
+ {
4552
+ sx: {
4553
+ gap: 2,
4554
+ flexDirection: "row",
4555
+ flexWrap: "wrap"
4556
+ },
4557
+ children: [
4558
+ /* @__PURE__ */ jsx53(ExampleTwoColTwoStatWidget, {}),
4559
+ /* @__PURE__ */ jsx53(ExampleBarGraphWidget, {}),
4560
+ /* @__PURE__ */ jsx53(ExampleBooleanTableWidget, {}),
4561
+ /* @__PURE__ */ jsx53(StackOfWidgets, {})
4562
+ ]
4563
+ }
4564
+ )
4565
+ }
4566
+ );
4567
+ };
4568
+
4569
+ // src/settings/Theme/ThemeProvider.tsx
4570
+ import { ThemeProvider } from "@mui/material";
4571
+ import { XyosTheme } from "@xylabs/react-theme";
4572
+ import { useMemo as useMemo19 } from "react";
4573
+ import { jsx as jsx54 } from "react/jsx-runtime";
4574
+ var AppOsThemeProvider = ({ children }) => {
4575
+ const initialValue = useMemo19(() => {
4576
+ const validValues = ["light", "dark"];
4577
+ const savedValue = localStorage.getItem("mui-mode");
4578
+ if (savedValue && validValues.includes(savedValue)) return savedValue;
4579
+ return "system";
4580
+ }, []);
4581
+ return /* @__PURE__ */ jsx54(ThemeProvider, { theme: XyosTheme, defaultMode: initialValue, children });
4582
+ };
4583
+ export {
4584
+ AppOsThemeProvider,
4585
+ BridgeActivityHelper,
4586
+ BrowserLocator,
4587
+ CoinbaseEmailInput,
4588
+ ContainerFlexbox,
4589
+ CreditCardInputSchema,
4590
+ CustomerParams,
4591
+ DappAccessDialog,
4592
+ DappAccessFlexbox,
4593
+ DappAccessRequestResourceHooks,
4594
+ DappBar,
4595
+ DappBottomNavigation,
4596
+ DappChrome,
4597
+ DappChromeLarge,
4598
+ DappContainer,
4599
+ DappContainerMemo,
4600
+ DappInstallTypeFilters,
4601
+ DappIntentResourceHooks,
4602
+ DappMenuDrawer,
4603
+ DappMenuResourceHooks,
4604
+ DappPage,
4605
+ DappPathHelpers,
4606
+ DappPathSwitcher,
4607
+ DappRendered,
4608
+ DappTitle,
4609
+ DappWindow,
4610
+ DappsRow,
4611
+ DebugDialog,
4612
+ DebugDialogWithNode,
4613
+ DefaultComingSoon,
4614
+ EmptyDappBarForPadding,
4615
+ ErrorRenderWithSupport,
4616
+ ErrorRenderWithSupportDefault,
4617
+ GenericPayloadDivinerTags,
4618
+ LazyDebug,
4619
+ LoadingOsLogo,
4620
+ NameServiceRegistrationHooks,
4621
+ NetworkButton,
4622
+ NetworkLoadingIndicator,
4623
+ NetworkReadyFlexBox,
4624
+ NextIteratorFlexbox,
4625
+ OsPalettes,
4626
+ PaymentMethods,
4627
+ PrimaryCryptoWalletInput,
4628
+ RenderHtml,
4629
+ ResourceHooks,
4630
+ SecondaryCryptoWalletInput,
4631
+ ShiftAnimation,
4632
+ StyledGridContainer,
4633
+ StyledListItemButton,
4634
+ StyledMenuIconWrapSpan,
4635
+ TableHeadCellSchema,
4636
+ TableHeadEx,
4637
+ TwoToneBulletPoint,
4638
+ TwoToneBulletPointList,
4639
+ WidgetCaller,
4640
+ WidgetCard,
4641
+ WidgetCardExamples,
4642
+ XnsDomainIcon,
4643
+ XyOsBrowserMonitor,
4644
+ XyOsUi,
4645
+ XyOsUiContext,
4646
+ XyOsUiContextProvider,
4647
+ detectCustomer,
4648
+ getApiDomain,
4649
+ getNodePaletteByNameCode,
4650
+ isCreditCardInput,
4651
+ isTableHeadCell,
4652
+ useAccountArchivist,
4653
+ useAddDappMenuItems,
4654
+ useBios,
4655
+ useBuildDappAccessRequestResource,
4656
+ useBuildDappMenuResource,
4657
+ useBuildIntentResource,
4658
+ useBuildNameServiceRegistrationsResource,
4659
+ useBuildNameServiceRegistrationsResourceViews,
4660
+ useCleanUpResource,
4661
+ useClearIntents,
4662
+ useDappAccessRequestResourceViews,
4663
+ useDappCaller,
4664
+ useDappContextCreator,
4665
+ useDappIntentCaller,
4666
+ useDappIntentListener,
4667
+ useDappIntentListener2,
4668
+ useDappMenu,
4669
+ useDappMenuCaller,
4670
+ useDappMenuDependencies,
4671
+ useDappRegistrationResults,
4672
+ useDappRegistry,
4673
+ useDappSeedPhraseRepository,
4674
+ useDebugClick,
4675
+ useDecomposeDapp,
4676
+ useDialogState,
4677
+ useExposedNode,
4678
+ useIntentResourceViews,
4679
+ useKernel,
4680
+ useManageDappInjectableParamsFromRoute,
4681
+ useManageDappIntentRequest,
4682
+ useManageDappPathFromRoute,
4683
+ useManageDappStateFromRoute,
4684
+ useMenuResourceViews,
4685
+ useNavigateIntent,
4686
+ useOnWindowResize,
4687
+ useOsNetwork,
4688
+ useOsSettingsCaller,
4689
+ usePhraseFile,
4690
+ useSendDappIntent,
4691
+ useSkipLoadingScreen,
4692
+ useStackReady,
4693
+ useSyncExternalPayloadStore,
4694
+ useSyncOsRegisteredAccessInterfaces,
4695
+ useTabs,
4696
+ useVisibleColumns,
4697
+ useWidgetDapps,
4698
+ useXyOsUiContext,
4699
+ useXyoPublicNetwork
4700
+ };
4701
+ //# sourceMappingURL=index.mjs.map