@vertesia/ui 1.0.0-dev.20260227.112605Z → 1.0.0-dev.20260331.091034Z

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 (796) hide show
  1. package/lib/esm/core/components/SelectList.js +3 -1
  2. package/lib/esm/core/components/SelectList.js.map +1 -1
  3. package/lib/esm/core/components/SidePanel.js +2 -2
  4. package/lib/esm/core/components/SidePanel.js.map +1 -1
  5. package/lib/esm/core/components/index.js +0 -5
  6. package/lib/esm/core/components/index.js.map +1 -1
  7. package/lib/esm/core/components/shadcn/breadcrumb.js +11 -7
  8. package/lib/esm/core/components/shadcn/breadcrumb.js.map +1 -1
  9. package/lib/esm/core/components/shadcn/button.js +5 -3
  10. package/lib/esm/core/components/shadcn/button.js.map +1 -1
  11. package/lib/esm/core/components/shadcn/collaspible.js +14 -0
  12. package/lib/esm/core/components/shadcn/collaspible.js.map +1 -0
  13. package/lib/esm/core/components/shadcn/dropdown.js +64 -0
  14. package/lib/esm/core/components/shadcn/dropdown.js.map +1 -0
  15. package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js +3 -1
  16. package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -1
  17. package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js +3 -1
  18. package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js.map +1 -1
  19. package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js +1 -1
  20. package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js.map +1 -1
  21. package/lib/esm/core/components/shadcn/filters/filter/StringListFilter.js +1 -1
  22. package/lib/esm/core/components/shadcn/filters/filter/StringListFilter.js.map +1 -1
  23. package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js +4 -2
  24. package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js.map +1 -1
  25. package/lib/esm/core/components/shadcn/filters/filterBar.js +7 -4
  26. package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
  27. package/lib/esm/core/components/shadcn/index.js +4 -0
  28. package/lib/esm/core/components/shadcn/index.js.map +1 -1
  29. package/lib/esm/core/components/shadcn/modal/ConfirmModal.js +4 -2
  30. package/lib/esm/core/components/shadcn/modal/ConfirmModal.js.map +1 -1
  31. package/lib/esm/core/components/shadcn/modal/DeleteModal.js +5 -3
  32. package/lib/esm/core/components/shadcn/modal/DeleteModal.js.map +1 -1
  33. package/lib/esm/core/components/shadcn/popover.js +11 -7
  34. package/lib/esm/core/components/shadcn/popover.js.map +1 -1
  35. package/lib/esm/core/components/shadcn/radioGroup.js +29 -0
  36. package/lib/esm/core/components/shadcn/radioGroup.js.map +1 -0
  37. package/lib/esm/core/components/shadcn/selectBox.js +1 -1
  38. package/lib/esm/core/components/shadcn/switch.js +19 -0
  39. package/lib/esm/core/components/shadcn/switch.js.map +1 -0
  40. package/lib/esm/core/components/shadcn/tabs.js +6 -6
  41. package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
  42. package/lib/esm/core/components/shadcn/theme/ThemeSwitcher.js +8 -6
  43. package/lib/esm/core/components/shadcn/theme/ThemeSwitcher.js.map +1 -1
  44. package/lib/esm/core/components/shadcn/tooltip.js +1 -1
  45. package/lib/esm/core/components/shadcn/tooltip.js.map +1 -1
  46. package/lib/esm/core/components/toast/NotificationPanel.js +3 -3
  47. package/lib/esm/core/components/toast/NotificationPanel.js.map +1 -1
  48. package/lib/esm/core/hooks/PortalContainerProvider.js +9 -3
  49. package/lib/esm/core/hooks/PortalContainerProvider.js.map +1 -1
  50. package/lib/esm/env/index.js +16 -9
  51. package/lib/esm/env/index.js.map +1 -1
  52. package/lib/esm/features/agent/PayloadBuilder.js +87 -15
  53. package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
  54. package/lib/esm/features/agent/chat/AgentRightPanel.js +159 -0
  55. package/lib/esm/features/agent/chat/AgentRightPanel.js.map +1 -0
  56. package/lib/esm/features/agent/chat/ArtifactsTab.js +69 -0
  57. package/lib/esm/features/agent/chat/ArtifactsTab.js.map +1 -0
  58. package/lib/esm/features/agent/chat/AskUserWidget.js +12 -6
  59. package/lib/esm/features/agent/chat/AskUserWidget.js.map +1 -1
  60. package/lib/esm/features/agent/chat/DocumentPanel.js +6 -3
  61. package/lib/esm/features/agent/chat/DocumentPanel.js.map +1 -1
  62. package/lib/esm/features/agent/chat/ImageLightbox.js +3 -1
  63. package/lib/esm/features/agent/chat/ImageLightbox.js.map +1 -1
  64. package/lib/esm/features/agent/chat/ModernAgentConversation.js +241 -113
  65. package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
  66. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +122 -52
  67. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  68. package/lib/esm/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js +5 -3
  69. package/lib/esm/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js.map +1 -1
  70. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +76 -33
  71. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  72. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +82 -83
  73. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -1
  74. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +16 -14
  75. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  76. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +20 -5
  77. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  78. package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js +8 -6
  79. package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -1
  80. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +12 -10
  81. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -1
  82. package/lib/esm/features/agent/chat/ModernAgentOutput/StreamingMessage.js +5 -3
  83. package/lib/esm/features/agent/chat/ModernAgentOutput/StreamingMessage.js.map +1 -1
  84. package/lib/esm/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +104 -13
  85. package/lib/esm/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
  86. package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +9 -5
  87. package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
  88. package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +160 -76
  89. package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  90. package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js +3 -1
  91. package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js.map +1 -1
  92. package/lib/esm/features/agent/chat/VegaLiteChart.js +14 -2
  93. package/lib/esm/features/agent/chat/VegaLiteChart.js.map +1 -1
  94. package/lib/esm/features/agent/chat/hooks/useAgentPlans.js +3 -8
  95. package/lib/esm/features/agent/chat/hooks/useAgentPlans.js.map +1 -1
  96. package/lib/esm/features/agent/chat/hooks/useAgentStream.js +79 -16
  97. package/lib/esm/features/agent/chat/hooks/useAgentStream.js.map +1 -1
  98. package/lib/esm/features/agent/chat/hooks/useArtifacts.js +108 -0
  99. package/lib/esm/features/agent/chat/hooks/useArtifacts.js.map +1 -0
  100. package/lib/esm/features/agent/chat/hooks/useDocumentPanel.js +56 -5
  101. package/lib/esm/features/agent/chat/hooks/useDocumentPanel.js.map +1 -1
  102. package/lib/esm/features/agent/chat/hooks/useFileProcessing.js +12 -10
  103. package/lib/esm/features/agent/chat/hooks/useFileProcessing.js.map +1 -1
  104. package/lib/esm/features/errors/PanelErrorBoundary.js +3 -1
  105. package/lib/esm/features/errors/PanelErrorBoundary.js.map +1 -1
  106. package/lib/esm/features/facets/AgentRunnerFacetsNav.js +45 -33
  107. package/lib/esm/features/facets/AgentRunnerFacetsNav.js.map +1 -1
  108. package/lib/esm/features/facets/RunsFacetsNav.js +9 -2
  109. package/lib/esm/features/facets/RunsFacetsNav.js.map +1 -1
  110. package/lib/esm/features/facets/index.js +1 -1
  111. package/lib/esm/features/facets/index.js.map +1 -1
  112. package/lib/esm/features/layout/GenericPageNavHeader.js +40 -28
  113. package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -1
  114. package/lib/esm/features/layout/NotFoundView.js +3 -1
  115. package/lib/esm/features/layout/NotFoundView.js.map +1 -1
  116. package/lib/esm/features/magic-pdf/AnnotatedImageSlider.js +9 -5
  117. package/lib/esm/features/magic-pdf/AnnotatedImageSlider.js.map +1 -1
  118. package/lib/esm/features/magic-pdf/DownloadPopover.js +5 -4
  119. package/lib/esm/features/magic-pdf/DownloadPopover.js.map +1 -1
  120. package/lib/esm/features/magic-pdf/MagicPdfView.js +8 -5
  121. package/lib/esm/features/magic-pdf/MagicPdfView.js.map +1 -1
  122. package/lib/esm/features/pdf-viewer/PdfPageSlider.js +9 -5
  123. package/lib/esm/features/pdf-viewer/PdfPageSlider.js.map +1 -1
  124. package/lib/esm/features/pdf-viewer/SimplePdfViewer.js +5 -3
  125. package/lib/esm/features/pdf-viewer/SimplePdfViewer.js.map +1 -1
  126. package/lib/esm/features/permissions/UserPermissionsProvider.js +3 -1
  127. package/lib/esm/features/permissions/UserPermissionsProvider.js.map +1 -1
  128. package/lib/esm/features/store/collections/BrowseCollectionView.js +9 -1
  129. package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -1
  130. package/lib/esm/features/store/collections/CollectionsTable.js +14 -7
  131. package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
  132. package/lib/esm/features/store/collections/CreateCollection.js +21 -18
  133. package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
  134. package/lib/esm/features/store/collections/EditCollectionView.js +23 -19
  135. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
  136. package/lib/esm/features/store/collections/SelectCollection.js +25 -10
  137. package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
  138. package/lib/esm/features/store/collections/SharedPropsEditor.js +5 -3
  139. package/lib/esm/features/store/collections/SharedPropsEditor.js.map +1 -1
  140. package/lib/esm/features/store/collections/SyncMemberHeadsToggle.js +5 -3
  141. package/lib/esm/features/store/collections/SyncMemberHeadsToggle.js.map +1 -1
  142. package/lib/esm/features/store/objects/DocumentPreviewPanel.js +14 -12
  143. package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -1
  144. package/lib/esm/features/store/objects/DocumentSearchResults.js +15 -5
  145. package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
  146. package/lib/esm/features/store/objects/DocumentTable.js +10 -7
  147. package/lib/esm/features/store/objects/DocumentTable.js.map +1 -1
  148. package/lib/esm/features/store/objects/ExportPropertiesModal.js +5 -2
  149. package/lib/esm/features/store/objects/ExportPropertiesModal.js.map +1 -1
  150. package/lib/esm/features/store/objects/components/ContentDispositionButton.js +3 -1
  151. package/lib/esm/features/store/objects/components/ContentDispositionButton.js.map +1 -1
  152. package/lib/esm/features/store/objects/components/ContentOverview.js +55 -40
  153. package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
  154. package/lib/esm/features/store/objects/components/DocumentIcon.js +4 -3
  155. package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -1
  156. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +13 -11
  157. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
  158. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +15 -18
  159. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
  160. package/lib/esm/features/store/objects/components/SelectDocument.js +9 -6
  161. package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
  162. package/lib/esm/features/store/objects/components/TextEditorPanel.js +97 -0
  163. package/lib/esm/features/store/objects/components/TextEditorPanel.js.map +1 -0
  164. package/lib/esm/features/store/objects/components/VectorSearchWidget.js +3 -1
  165. package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -1
  166. package/lib/esm/features/store/objects/components/useContentPanelHooks.js +4 -2
  167. package/lib/esm/features/store/objects/components/useContentPanelHooks.js.map +1 -1
  168. package/lib/esm/features/store/objects/components/useDownloadFile.js +12 -10
  169. package/lib/esm/features/store/objects/components/useDownloadFile.js.map +1 -1
  170. package/lib/esm/features/store/objects/layout/documentLayout.js +10 -6
  171. package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -1
  172. package/lib/esm/features/store/objects/layout/renderers.js +10 -1
  173. package/lib/esm/features/store/objects/layout/renderers.js.map +1 -1
  174. package/lib/esm/features/store/objects/search/DocumentSearchContext.js +3 -2
  175. package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  176. package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +3 -0
  177. package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -1
  178. package/lib/esm/features/store/objects/selection/ObjectsActionContext.js +22 -109
  179. package/lib/esm/features/store/objects/selection/ObjectsActionContext.js.map +1 -1
  180. package/lib/esm/features/store/objects/selection/ObjectsActionContextClass.js +50 -0
  181. package/lib/esm/features/store/objects/selection/ObjectsActionContextClass.js.map +1 -0
  182. package/lib/esm/features/store/objects/selection/ObjectsActionHooks.js +27 -0
  183. package/lib/esm/features/store/objects/selection/ObjectsActionHooks.js.map +1 -0
  184. package/lib/esm/features/store/objects/selection/SelectionActions.js +10 -6
  185. package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
  186. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +17 -12
  187. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
  188. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +9 -5
  189. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -1
  190. package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js +4 -2
  191. package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js.map +1 -1
  192. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +24 -23
  193. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
  194. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +10 -5
  195. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -1
  196. package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +13 -9
  197. package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -1
  198. package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js +14 -8
  199. package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js.map +1 -1
  200. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +42 -39
  201. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
  202. package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js +4 -2
  203. package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -1
  204. package/lib/esm/features/store/objects/upload/useUploadHandler.js +9 -7
  205. package/lib/esm/features/store/objects/upload/useUploadHandler.js.map +1 -1
  206. package/lib/esm/features/store/types/ContentObjectTypesSearch.js +6 -4
  207. package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -1
  208. package/lib/esm/features/store/types/ContentObjectTypesTable.js +3 -1
  209. package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -1
  210. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +6 -7
  211. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -1
  212. package/lib/esm/features/store/types/ObjectSchemaEditor.js +9 -7
  213. package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
  214. package/lib/esm/features/store/types/SelectContentType.js +9 -7
  215. package/lib/esm/features/store/types/SelectContentType.js.map +1 -1
  216. package/lib/esm/features/store/types/SelectContentTypeModal.js +5 -2
  217. package/lib/esm/features/store/types/SelectContentTypeModal.js.map +1 -1
  218. package/lib/esm/features/store/types/TableLayoutEditor.js +6 -4
  219. package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
  220. package/lib/esm/features/user/UserInfo.js +40 -50
  221. package/lib/esm/features/user/UserInfo.js.map +1 -1
  222. package/lib/esm/i18n/index.js +31 -0
  223. package/lib/esm/i18n/index.js.map +1 -0
  224. package/lib/esm/i18n/instance.js +46 -0
  225. package/lib/esm/i18n/instance.js.map +1 -0
  226. package/lib/esm/i18n/locales/ar.json +696 -0
  227. package/lib/esm/i18n/locales/de.json +664 -0
  228. package/lib/esm/i18n/locales/en.json +665 -0
  229. package/lib/esm/i18n/locales/es.json +670 -0
  230. package/lib/esm/i18n/locales/fr.json +672 -0
  231. package/lib/esm/i18n/locales/it.json +670 -0
  232. package/lib/esm/i18n/locales/ja.json +664 -0
  233. package/lib/esm/i18n/locales/ko.json +664 -0
  234. package/lib/esm/i18n/locales/pt.json +670 -0
  235. package/lib/esm/i18n/locales/ru.json +680 -0
  236. package/lib/esm/i18n/locales/tr.json +664 -0
  237. package/lib/esm/i18n/locales/zh-TW.json +664 -0
  238. package/lib/esm/i18n/locales/zh.json +664 -0
  239. package/lib/esm/layout/FullHeightLayout.js +3 -0
  240. package/lib/esm/layout/FullHeightLayout.js.map +1 -1
  241. package/lib/esm/layout/Navbar.js +3 -1
  242. package/lib/esm/layout/Navbar.js.map +1 -1
  243. package/lib/esm/layout/RegionTag.js +15 -0
  244. package/lib/esm/layout/RegionTag.js.map +1 -0
  245. package/lib/esm/layout/Sidebar.js +2 -2
  246. package/lib/esm/layout/Sidebar.js.map +1 -1
  247. package/lib/esm/layout/index.js +1 -0
  248. package/lib/esm/layout/index.js.map +1 -1
  249. package/lib/esm/router/HistoryNavigator.js +1 -1
  250. package/lib/esm/router/HistoryNavigator.js.map +1 -1
  251. package/lib/esm/router/Nav.js +5 -3
  252. package/lib/esm/router/Nav.js.map +1 -1
  253. package/lib/esm/router/NestedNavigationContext.js +4 -0
  254. package/lib/esm/router/NestedNavigationContext.js.map +1 -1
  255. package/lib/esm/router/NestedRouterProvider.js +3 -1
  256. package/lib/esm/router/NestedRouterProvider.js.map +1 -1
  257. package/lib/esm/router/Router.js +21 -6
  258. package/lib/esm/router/Router.js.map +1 -1
  259. package/lib/esm/session/UserSession.js +33 -4
  260. package/lib/esm/session/UserSession.js.map +1 -1
  261. package/lib/esm/session/UserSessionProvider.js +6 -13
  262. package/lib/esm/session/UserSessionProvider.js.map +1 -1
  263. package/lib/esm/session/auth/composable.js +1 -1
  264. package/lib/esm/session/auth/composable.js.map +1 -1
  265. package/lib/esm/session/auth/domainRouting.js +17 -0
  266. package/lib/esm/session/auth/domainRouting.js.map +1 -0
  267. package/lib/esm/session/auth/firebase.js +1 -1
  268. package/lib/esm/session/auth/firebase.js.map +1 -1
  269. package/lib/esm/session/auth/useCurrentTenant.js +3 -1
  270. package/lib/esm/session/auth/useCurrentTenant.js.map +1 -1
  271. package/lib/esm/shell/SplashScreen.js +3 -7
  272. package/lib/esm/shell/SplashScreen.js.map +1 -1
  273. package/lib/esm/shell/apps/StandaloneApp.js +5 -2
  274. package/lib/esm/shell/apps/StandaloneApp.js.map +1 -1
  275. package/lib/esm/shell/login/EnterpriseSigninButton.js +5 -3
  276. package/lib/esm/shell/login/EnterpriseSigninButton.js.map +1 -1
  277. package/lib/esm/shell/login/GitHubSignInButton.js +3 -7
  278. package/lib/esm/shell/login/GitHubSignInButton.js.map +1 -1
  279. package/lib/esm/shell/login/GoogleSignInButton.js +3 -1
  280. package/lib/esm/shell/login/GoogleSignInButton.js.map +1 -1
  281. package/lib/esm/shell/login/InviteAcceptModal.js +5 -2
  282. package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -1
  283. package/lib/esm/shell/login/MicrosoftSigninButton.js +4 -6
  284. package/lib/esm/shell/login/MicrosoftSigninButton.js.map +1 -1
  285. package/lib/esm/shell/login/SigninScreen.js +6 -2
  286. package/lib/esm/shell/login/SigninScreen.js.map +1 -1
  287. package/lib/esm/shell/login/SignupForm.js +36 -34
  288. package/lib/esm/shell/login/SignupForm.js.map +1 -1
  289. package/lib/esm/shell/login/TerminalLogin.js +29 -22
  290. package/lib/esm/shell/login/TerminalLogin.js.map +1 -1
  291. package/lib/esm/shell/login/UserInfo.js +6 -4
  292. package/lib/esm/shell/login/UserInfo.js.map +1 -1
  293. package/lib/esm/shell/login/UserSessionMenu.js +3 -4
  294. package/lib/esm/shell/login/UserSessionMenu.js.map +1 -1
  295. package/lib/esm/widgets/index.js +0 -1
  296. package/lib/esm/widgets/index.js.map +1 -1
  297. package/lib/esm/widgets/json-view/JSONCode.js +1 -1
  298. package/lib/esm/widgets/json-view/JSONCode.js.map +1 -1
  299. package/lib/esm/widgets/json-view/JSONDisplay.js +6 -2
  300. package/lib/esm/widgets/json-view/JSONDisplay.js.map +1 -1
  301. package/lib/esm/widgets/json-view/JSONSwitcher.js +6 -0
  302. package/lib/esm/widgets/json-view/JSONSwitcher.js.map +1 -0
  303. package/lib/esm/widgets/json-view/JSONView.js +1 -1
  304. package/lib/esm/widgets/json-view/JSONView.js.map +1 -1
  305. package/lib/esm/widgets/json-view/index.js +1 -0
  306. package/lib/esm/widgets/json-view/index.js.map +1 -1
  307. package/lib/esm/widgets/markdown/ArtifactContentRenderer.js +6 -5
  308. package/lib/esm/widgets/markdown/ArtifactContentRenderer.js.map +1 -1
  309. package/lib/esm/widgets/markdown/CodeBlockContext.js +11 -0
  310. package/lib/esm/widgets/markdown/CodeBlockContext.js.map +1 -0
  311. package/lib/esm/widgets/markdown/MarkdownRenderer.js +11 -10
  312. package/lib/esm/widgets/markdown/MarkdownRenderer.js.map +1 -1
  313. package/lib/esm/widgets/markdown/codeBlockHandlers.js +11 -12
  314. package/lib/esm/widgets/markdown/codeBlockHandlers.js.map +1 -1
  315. package/lib/esm/widgets/markdown/index.js +10 -9
  316. package/lib/esm/widgets/markdown/index.js.map +1 -1
  317. package/lib/esm/widgets/markdown/remarkDirectiveHandler.js +0 -1
  318. package/lib/esm/widgets/markdown/remarkDirectiveHandler.js.map +1 -1
  319. package/lib/esm/widgets/schema-editor/ManagedSchema.js +6 -5
  320. package/lib/esm/widgets/schema-editor/ManagedSchema.js.map +1 -1
  321. package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js +7 -3
  322. package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js.map +1 -1
  323. package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +3 -1
  324. package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
  325. package/lib/esm/widgets/upload/DropZone.js +9 -11
  326. package/lib/esm/widgets/upload/DropZone.js.map +1 -1
  327. package/lib/esm/widgets/upload/UploadResultCategory.js +3 -1
  328. package/lib/esm/widgets/upload/UploadResultCategory.js.map +1 -1
  329. package/lib/esm/widgets/upload/UploadSummary.js +3 -1
  330. package/lib/esm/widgets/upload/UploadSummary.js.map +1 -1
  331. package/lib/tsconfig.tsbuildinfo +1 -1
  332. package/lib/types/core/components/SelectList.d.ts.map +1 -1
  333. package/lib/types/core/components/SidePanel.d.ts +4 -2
  334. package/lib/types/core/components/SidePanel.d.ts.map +1 -1
  335. package/lib/types/core/components/index.d.ts +0 -5
  336. package/lib/types/core/components/index.d.ts.map +1 -1
  337. package/lib/types/core/components/shadcn/badge.d.ts +2 -2
  338. package/lib/types/core/components/shadcn/breadcrumb.d.ts +1 -1
  339. package/lib/types/core/components/shadcn/breadcrumb.d.ts.map +1 -1
  340. package/lib/types/core/components/shadcn/button.d.ts.map +1 -1
  341. package/lib/types/core/components/shadcn/collaspible.d.ts +6 -0
  342. package/lib/types/core/components/shadcn/collaspible.d.ts.map +1 -0
  343. package/lib/types/core/components/shadcn/dropdown.d.ts +51 -0
  344. package/lib/types/core/components/shadcn/dropdown.d.ts.map +1 -0
  345. package/lib/types/core/components/shadcn/filters/comboBox/DateCombobox.d.ts.map +1 -1
  346. package/lib/types/core/components/shadcn/filters/comboBox/SelectCombobox.d.ts.map +1 -1
  347. package/lib/types/core/components/shadcn/filters/filter/dateFilter.d.ts.map +1 -1
  348. package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
  349. package/lib/types/core/components/shadcn/index.d.ts +4 -0
  350. package/lib/types/core/components/shadcn/index.d.ts.map +1 -1
  351. package/lib/types/core/components/shadcn/input.d.ts +1 -1
  352. package/lib/types/core/components/shadcn/modal/ConfirmModal.d.ts +2 -1
  353. package/lib/types/core/components/shadcn/modal/ConfirmModal.d.ts.map +1 -1
  354. package/lib/types/core/components/shadcn/modal/DeleteModal.d.ts.map +1 -1
  355. package/lib/types/core/components/shadcn/popover.d.ts +11 -3
  356. package/lib/types/core/components/shadcn/popover.d.ts.map +1 -1
  357. package/lib/types/core/components/shadcn/radioGroup.d.ts +26 -0
  358. package/lib/types/core/components/shadcn/radioGroup.d.ts.map +1 -0
  359. package/lib/types/core/components/shadcn/switch.d.ts +12 -0
  360. package/lib/types/core/components/shadcn/switch.d.ts.map +1 -0
  361. package/lib/types/core/components/shadcn/tabs.d.ts +4 -2
  362. package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
  363. package/lib/types/core/components/shadcn/theme/ThemeSwitcher.d.ts +8 -2
  364. package/lib/types/core/components/shadcn/theme/ThemeSwitcher.d.ts.map +1 -1
  365. package/lib/types/core/components/toast/NotificationPanel.d.ts.map +1 -1
  366. package/lib/types/core/hooks/PortalContainerProvider.d.ts +1 -0
  367. package/lib/types/core/hooks/PortalContainerProvider.d.ts.map +1 -1
  368. package/lib/types/env/index.d.ts +12 -3
  369. package/lib/types/env/index.d.ts.map +1 -1
  370. package/lib/types/features/agent/PayloadBuilder.d.ts +31 -3
  371. package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -1
  372. package/lib/types/features/agent/chat/AgentRightPanel.d.ts +50 -0
  373. package/lib/types/features/agent/chat/AgentRightPanel.d.ts.map +1 -0
  374. package/lib/types/features/agent/chat/ArtifactsTab.d.ts +9 -0
  375. package/lib/types/features/agent/chat/ArtifactsTab.d.ts.map +1 -0
  376. package/lib/types/features/agent/chat/AskUserWidget.d.ts.map +1 -1
  377. package/lib/types/features/agent/chat/DocumentPanel.d.ts.map +1 -1
  378. package/lib/types/features/agent/chat/ImageLightbox.d.ts.map +1 -1
  379. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts +22 -9
  380. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  381. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -1
  382. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  383. package/lib/types/features/agent/chat/ModernAgentOutput/BatchProgressPanel.d.ts.map +1 -1
  384. package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +13 -4
  385. package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  386. package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts +1 -1
  387. package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts.map +1 -1
  388. package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
  389. package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  390. package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts.map +1 -1
  391. package/lib/types/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.d.ts.map +1 -1
  392. package/lib/types/features/agent/chat/ModernAgentOutput/StreamingMessage.d.ts +3 -1
  393. package/lib/types/features/agent/chat/ModernAgentOutput/StreamingMessage.d.ts.map +1 -1
  394. package/lib/types/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts +5 -1
  395. package/lib/types/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts.map +1 -1
  396. package/lib/types/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts.map +1 -1
  397. package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +16 -1
  398. package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
  399. package/lib/types/features/agent/chat/SlidingThinkingIndicator.d.ts.map +1 -1
  400. package/lib/types/features/agent/chat/VegaLiteChart.d.ts.map +1 -1
  401. package/lib/types/features/agent/chat/hooks/useAgentPlans.d.ts.map +1 -1
  402. package/lib/types/features/agent/chat/hooks/useAgentStream.d.ts +5 -3
  403. package/lib/types/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
  404. package/lib/types/features/agent/chat/hooks/useArtifacts.d.ts +18 -0
  405. package/lib/types/features/agent/chat/hooks/useArtifacts.d.ts.map +1 -0
  406. package/lib/types/features/agent/chat/hooks/useDocumentPanel.d.ts.map +1 -1
  407. package/lib/types/features/agent/chat/hooks/useFileProcessing.d.ts +4 -4
  408. package/lib/types/features/agent/chat/hooks/useFileProcessing.d.ts.map +1 -1
  409. package/lib/types/features/agent/chat/types/document.d.ts +2 -0
  410. package/lib/types/features/agent/chat/types/document.d.ts.map +1 -1
  411. package/lib/types/features/errors/PanelErrorBoundary.d.ts.map +1 -1
  412. package/lib/types/features/facets/AgentRunnerFacetsNav.d.ts +2 -1
  413. package/lib/types/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -1
  414. package/lib/types/features/facets/RunsFacetsNav.d.ts.map +1 -1
  415. package/lib/types/features/facets/index.d.ts +1 -1
  416. package/lib/types/features/facets/index.d.ts.map +1 -1
  417. package/lib/types/features/layout/GenericPageNavHeader.d.ts +2 -2
  418. package/lib/types/features/layout/GenericPageNavHeader.d.ts.map +1 -1
  419. package/lib/types/features/layout/NotFoundView.d.ts.map +1 -1
  420. package/lib/types/features/magic-pdf/AnnotatedImageSlider.d.ts.map +1 -1
  421. package/lib/types/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
  422. package/lib/types/features/magic-pdf/MagicPdfView.d.ts.map +1 -1
  423. package/lib/types/features/pdf-viewer/PdfPageSlider.d.ts.map +1 -1
  424. package/lib/types/features/pdf-viewer/SimplePdfViewer.d.ts.map +1 -1
  425. package/lib/types/features/permissions/UserPermissionsProvider.d.ts.map +1 -1
  426. package/lib/types/features/store/collections/BrowseCollectionView.d.ts.map +1 -1
  427. package/lib/types/features/store/collections/CollectionsTable.d.ts +4 -0
  428. package/lib/types/features/store/collections/CollectionsTable.d.ts.map +1 -1
  429. package/lib/types/features/store/collections/CreateCollection.d.ts.map +1 -1
  430. package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -1
  431. package/lib/types/features/store/collections/SelectCollection.d.ts.map +1 -1
  432. package/lib/types/features/store/collections/SharedPropsEditor.d.ts.map +1 -1
  433. package/lib/types/features/store/collections/SyncMemberHeadsToggle.d.ts.map +1 -1
  434. package/lib/types/features/store/objects/DocumentPreviewPanel.d.ts.map +1 -1
  435. package/lib/types/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
  436. package/lib/types/features/store/objects/DocumentTable.d.ts.map +1 -1
  437. package/lib/types/features/store/objects/ExportPropertiesModal.d.ts.map +1 -1
  438. package/lib/types/features/store/objects/components/ContentDispositionButton.d.ts.map +1 -1
  439. package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  440. package/lib/types/features/store/objects/components/DocumentIcon.d.ts +2 -1
  441. package/lib/types/features/store/objects/components/DocumentIcon.d.ts.map +1 -1
  442. package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts.map +1 -1
  443. package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts.map +1 -1
  444. package/lib/types/features/store/objects/components/SelectDocument.d.ts +3 -1
  445. package/lib/types/features/store/objects/components/SelectDocument.d.ts.map +1 -1
  446. package/lib/types/features/store/objects/components/TextEditorPanel.d.ts +10 -0
  447. package/lib/types/features/store/objects/components/TextEditorPanel.d.ts.map +1 -0
  448. package/lib/types/features/store/objects/components/VectorSearchWidget.d.ts.map +1 -1
  449. package/lib/types/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
  450. package/lib/types/features/store/objects/components/useDownloadFile.d.ts.map +1 -1
  451. package/lib/types/features/store/objects/layout/documentLayout.d.ts +3 -2
  452. package/lib/types/features/store/objects/layout/documentLayout.d.ts.map +1 -1
  453. package/lib/types/features/store/objects/layout/renderers.d.ts.map +1 -1
  454. package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  455. package/lib/types/features/store/objects/search/DocumentSearchProvider.d.ts.map +1 -1
  456. package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts +3 -20
  457. package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -1
  458. package/lib/types/features/store/objects/selection/ObjectsActionContextClass.d.ts +16 -0
  459. package/lib/types/features/store/objects/selection/ObjectsActionContextClass.d.ts.map +1 -0
  460. package/lib/types/features/store/objects/selection/ObjectsActionHooks.d.ts +7 -0
  461. package/lib/types/features/store/objects/selection/ObjectsActionHooks.d.ts.map +1 -0
  462. package/lib/types/features/store/objects/selection/ObjectsActionSpec.d.ts +4 -1
  463. package/lib/types/features/store/objects/selection/ObjectsActionSpec.d.ts.map +1 -1
  464. package/lib/types/features/store/objects/selection/SelectionActions.d.ts +6 -1
  465. package/lib/types/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
  466. package/lib/types/features/store/objects/selection/actions/AddToCollectionAction.d.ts.map +1 -1
  467. package/lib/types/features/store/objects/selection/actions/ChangeTypeAction.d.ts.map +1 -1
  468. package/lib/types/features/store/objects/selection/actions/ConfirmAction.d.ts +1 -1
  469. package/lib/types/features/store/objects/selection/actions/ConfirmAction.d.ts.map +1 -1
  470. package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -1
  471. package/lib/types/features/store/objects/selection/actions/ExportPropertiesAction.d.ts.map +1 -1
  472. package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts.map +1 -1
  473. package/lib/types/features/store/objects/selection/actions/StartWorkflowComponent.d.ts.map +1 -1
  474. package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -1
  475. package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts.map +1 -1
  476. package/lib/types/features/store/objects/upload/useUploadHandler.d.ts.map +1 -1
  477. package/lib/types/features/store/types/ContentObjectTypesSearch.d.ts.map +1 -1
  478. package/lib/types/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
  479. package/lib/types/features/store/types/CreateOrUpdateTypeModal.d.ts +2 -1
  480. package/lib/types/features/store/types/CreateOrUpdateTypeModal.d.ts.map +1 -1
  481. package/lib/types/features/store/types/ObjectSchemaEditor.d.ts.map +1 -1
  482. package/lib/types/features/store/types/SelectContentType.d.ts.map +1 -1
  483. package/lib/types/features/store/types/SelectContentTypeModal.d.ts.map +1 -1
  484. package/lib/types/features/store/types/TableLayoutEditor.d.ts.map +1 -1
  485. package/lib/types/features/user/UserInfo.d.ts +2 -2
  486. package/lib/types/features/user/UserInfo.d.ts.map +1 -1
  487. package/lib/types/i18n/index.d.ts +14 -0
  488. package/lib/types/i18n/index.d.ts.map +1 -0
  489. package/lib/types/i18n/instance.d.ts +5 -0
  490. package/lib/types/i18n/instance.d.ts.map +1 -0
  491. package/lib/types/layout/FullHeightLayout.d.ts +3 -0
  492. package/lib/types/layout/FullHeightLayout.d.ts.map +1 -1
  493. package/lib/types/layout/Navbar.d.ts.map +1 -1
  494. package/lib/types/layout/RegionTag.d.ts +4 -0
  495. package/lib/types/layout/RegionTag.d.ts.map +1 -0
  496. package/lib/types/layout/Sidebar.d.ts +2 -1
  497. package/lib/types/layout/Sidebar.d.ts.map +1 -1
  498. package/lib/types/layout/index.d.ts +1 -0
  499. package/lib/types/layout/index.d.ts.map +1 -1
  500. package/lib/types/router/Nav.d.ts +5 -1
  501. package/lib/types/router/Nav.d.ts.map +1 -1
  502. package/lib/types/router/NestedNavigationContext.d.ts.map +1 -1
  503. package/lib/types/router/NestedRouterProvider.d.ts.map +1 -1
  504. package/lib/types/router/Router.d.ts +2 -0
  505. package/lib/types/router/Router.d.ts.map +1 -1
  506. package/lib/types/session/UserSession.d.ts +1 -0
  507. package/lib/types/session/UserSession.d.ts.map +1 -1
  508. package/lib/types/session/UserSessionProvider.d.ts +0 -1
  509. package/lib/types/session/UserSessionProvider.d.ts.map +1 -1
  510. package/lib/types/session/auth/domainRouting.d.ts +3 -0
  511. package/lib/types/session/auth/domainRouting.d.ts.map +1 -0
  512. package/lib/types/session/auth/useCurrentTenant.d.ts.map +1 -1
  513. package/lib/types/shell/SplashScreen.d.ts.map +1 -1
  514. package/lib/types/shell/apps/StandaloneApp.d.ts.map +1 -1
  515. package/lib/types/shell/login/EnterpriseSigninButton.d.ts.map +1 -1
  516. package/lib/types/shell/login/GitHubSignInButton.d.ts.map +1 -1
  517. package/lib/types/shell/login/GoogleSignInButton.d.ts.map +1 -1
  518. package/lib/types/shell/login/InviteAcceptModal.d.ts.map +1 -1
  519. package/lib/types/shell/login/MicrosoftSigninButton.d.ts +1 -1
  520. package/lib/types/shell/login/MicrosoftSigninButton.d.ts.map +1 -1
  521. package/lib/types/shell/login/SigninScreen.d.ts.map +1 -1
  522. package/lib/types/shell/login/SignupForm.d.ts.map +1 -1
  523. package/lib/types/shell/login/TerminalLogin.d.ts.map +1 -1
  524. package/lib/types/shell/login/UserInfo.d.ts.map +1 -1
  525. package/lib/types/shell/login/UserSessionMenu.d.ts.map +1 -1
  526. package/lib/types/widgets/index.d.ts +0 -1
  527. package/lib/types/widgets/index.d.ts.map +1 -1
  528. package/lib/types/widgets/json-view/JSONDisplay.d.ts.map +1 -1
  529. package/lib/types/widgets/json-view/JSONSwitcher.d.ts +6 -0
  530. package/lib/types/widgets/json-view/JSONSwitcher.d.ts.map +1 -0
  531. package/lib/types/widgets/json-view/index.d.ts +1 -0
  532. package/lib/types/widgets/json-view/index.d.ts.map +1 -1
  533. package/lib/types/widgets/markdown/ArtifactContentRenderer.d.ts.map +1 -1
  534. package/lib/types/widgets/markdown/CodeBlockContext.d.ts +21 -0
  535. package/lib/types/widgets/markdown/CodeBlockContext.d.ts.map +1 -0
  536. package/lib/types/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
  537. package/lib/types/widgets/markdown/codeBlockHandlers.d.ts +0 -12
  538. package/lib/types/widgets/markdown/codeBlockHandlers.d.ts.map +1 -1
  539. package/lib/types/widgets/markdown/index.d.ts +10 -9
  540. package/lib/types/widgets/markdown/index.d.ts.map +1 -1
  541. package/lib/types/widgets/schema-editor/ManagedSchema.d.ts +1 -1
  542. package/lib/types/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
  543. package/lib/types/widgets/schema-editor/editor/PropertyEditor.d.ts.map +1 -1
  544. package/lib/types/widgets/schema-editor/editor/SchemaEditor.d.ts.map +1 -1
  545. package/lib/types/widgets/upload/DropZone.d.ts.map +1 -1
  546. package/lib/types/widgets/upload/UploadResultCategory.d.ts.map +1 -1
  547. package/lib/types/widgets/upload/UploadSummary.d.ts.map +1 -1
  548. package/lib/vertesia-ui-core.js +1 -1
  549. package/lib/vertesia-ui-core.js.map +1 -1
  550. package/lib/vertesia-ui-env.js +1 -1
  551. package/lib/vertesia-ui-env.js.map +1 -1
  552. package/lib/vertesia-ui-features.js +1 -1
  553. package/lib/vertesia-ui-features.js.map +1 -1
  554. package/lib/vertesia-ui-i18n.js +2 -0
  555. package/lib/vertesia-ui-i18n.js.map +1 -0
  556. package/lib/vertesia-ui-layout.js +1 -1
  557. package/lib/vertesia-ui-layout.js.map +1 -1
  558. package/lib/vertesia-ui-router.js +1 -1
  559. package/lib/vertesia-ui-router.js.map +1 -1
  560. package/lib/vertesia-ui-session.js +1 -1
  561. package/lib/vertesia-ui-session.js.map +1 -1
  562. package/lib/vertesia-ui-shell.js +1 -1
  563. package/lib/vertesia-ui-shell.js.map +1 -1
  564. package/lib/vertesia-ui-widgets.js +1 -1
  565. package/lib/vertesia-ui-widgets.js.map +1 -1
  566. package/llms.txt +124 -4
  567. package/package.json +50 -22
  568. package/src/core/components/SelectList.tsx +3 -1
  569. package/src/core/components/SidePanel.tsx +5 -4
  570. package/src/core/components/index.ts +0 -5
  571. package/src/core/components/shadcn/breadcrumb.tsx +16 -9
  572. package/src/core/components/shadcn/button.tsx +5 -3
  573. package/src/core/components/shadcn/collaspible.tsx +33 -0
  574. package/src/core/components/shadcn/dropdown.tsx +325 -0
  575. package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +3 -1
  576. package/src/core/components/shadcn/filters/comboBox/SelectCombobox.tsx +3 -1
  577. package/src/core/components/shadcn/filters/comboBox/StringListCombobox.tsx +1 -1
  578. package/src/core/components/shadcn/filters/filter/StringListFilter.tsx +1 -1
  579. package/src/core/components/shadcn/filters/filter/dateFilter.tsx +5 -3
  580. package/src/core/components/shadcn/filters/filterBar.tsx +8 -5
  581. package/src/core/components/shadcn/index.ts +5 -1
  582. package/src/core/components/shadcn/modal/ConfirmModal.tsx +7 -3
  583. package/src/core/components/shadcn/modal/DeleteModal.tsx +5 -3
  584. package/src/core/components/shadcn/popover.tsx +12 -7
  585. package/src/core/components/shadcn/radioGroup.tsx +100 -0
  586. package/src/core/components/shadcn/selectBox.tsx +1 -1
  587. package/src/core/components/shadcn/switch.tsx +60 -0
  588. package/src/core/components/shadcn/tabs.tsx +29 -27
  589. package/src/core/components/shadcn/theme/ThemeSwitcher.tsx +19 -10
  590. package/src/core/components/shadcn/tooltip.tsx +1 -1
  591. package/src/core/components/toast/NotificationPanel.tsx +38 -44
  592. package/src/core/hooks/PortalContainerProvider.tsx +11 -3
  593. package/src/css/base.css +31 -0
  594. package/src/css/color.css +136 -0
  595. package/src/css/custom-tooltips.css +64 -0
  596. package/src/css/index.css +27 -0
  597. package/src/css/theme.css +86 -0
  598. package/src/css/typography.css +88 -0
  599. package/src/css/utilities.css +72 -0
  600. package/src/env/index.ts +24 -13
  601. package/src/features/agent/PayloadBuilder.tsx +100 -13
  602. package/src/features/agent/chat/AgentRightPanel.tsx +424 -0
  603. package/src/features/agent/chat/ArtifactsTab.tsx +197 -0
  604. package/src/features/agent/chat/AskUserWidget.tsx +14 -8
  605. package/src/features/agent/chat/DocumentPanel.tsx +24 -9
  606. package/src/features/agent/chat/ImageLightbox.tsx +6 -3
  607. package/src/features/agent/chat/ModernAgentConversation.tsx +538 -364
  608. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +151 -55
  609. package/src/features/agent/chat/ModernAgentOutput/BatchProgressPanel.tsx +6 -4
  610. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +183 -105
  611. package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +21 -31
  612. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +119 -114
  613. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +26 -9
  614. package/src/features/agent/chat/ModernAgentOutput/PlanPanel.tsx +9 -7
  615. package/src/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.tsx +15 -13
  616. package/src/features/agent/chat/ModernAgentOutput/StreamingMessage.tsx +8 -3
  617. package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +149 -49
  618. package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +9 -5
  619. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +229 -0
  620. package/src/features/agent/chat/ModernAgentOutput/utils.ts +202 -97
  621. package/src/features/agent/chat/SlidingThinkingIndicator.tsx +5 -3
  622. package/src/features/agent/chat/VegaLiteChart.tsx +20 -8
  623. package/src/features/agent/chat/hooks/useAgentPlans.ts +3 -9
  624. package/src/features/agent/chat/hooks/useAgentStream.ts +86 -19
  625. package/src/features/agent/chat/hooks/useArtifacts.ts +151 -0
  626. package/src/features/agent/chat/hooks/useDocumentPanel.ts +65 -5
  627. package/src/features/agent/chat/hooks/useFileProcessing.ts +14 -13
  628. package/src/features/agent/chat/types/document.ts +2 -0
  629. package/src/features/errors/PanelErrorBoundary.tsx +5 -3
  630. package/src/features/facets/AgentRunnerFacetsNav.tsx +54 -35
  631. package/src/features/facets/RunsFacetsNav.tsx +15 -7
  632. package/src/features/facets/index.ts +1 -1
  633. package/src/features/layout/GenericPageNavHeader.tsx +64 -41
  634. package/src/features/layout/NotFoundView.tsx +4 -1
  635. package/src/features/magic-pdf/AnnotatedImageSlider.tsx +12 -8
  636. package/src/features/magic-pdf/DownloadPopover.tsx +11 -10
  637. package/src/features/magic-pdf/MagicPdfView.tsx +10 -7
  638. package/src/features/pdf-viewer/PdfPageSlider.tsx +10 -6
  639. package/src/features/pdf-viewer/SimplePdfViewer.tsx +5 -3
  640. package/src/features/permissions/UserPermissionsProvider.tsx +3 -1
  641. package/src/features/store/collections/BrowseCollectionView.tsx +11 -1
  642. package/src/features/store/collections/CollectionsTable.tsx +20 -12
  643. package/src/features/store/collections/CreateCollection.tsx +45 -40
  644. package/src/features/store/collections/EditCollectionView.tsx +31 -28
  645. package/src/features/store/collections/SelectCollection.tsx +50 -14
  646. package/src/features/store/collections/SharedPropsEditor.tsx +7 -5
  647. package/src/features/store/collections/SyncMemberHeadsToggle.tsx +6 -4
  648. package/src/features/store/objects/DocumentPreviewPanel.tsx +30 -28
  649. package/src/features/store/objects/DocumentSearchResults.tsx +31 -21
  650. package/src/features/store/objects/DocumentTable.tsx +11 -5
  651. package/src/features/store/objects/ExportPropertiesModal.tsx +8 -5
  652. package/src/features/store/objects/components/ContentDispositionButton.tsx +3 -1
  653. package/src/features/store/objects/components/ContentOverview.tsx +96 -50
  654. package/src/features/store/objects/components/DocumentIcon.tsx +11 -3
  655. package/src/features/store/objects/components/PropertiesEditorModal.tsx +14 -12
  656. package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +24 -37
  657. package/src/features/store/objects/components/SelectDocument.tsx +15 -6
  658. package/src/features/store/objects/components/TextEditorPanel.tsx +143 -0
  659. package/src/features/store/objects/components/VectorSearchWidget.tsx +11 -8
  660. package/src/features/store/objects/components/useContentPanelHooks.ts +4 -2
  661. package/src/features/store/objects/components/useDownloadFile.ts +12 -10
  662. package/src/features/store/objects/layout/documentLayout.tsx +16 -6
  663. package/src/features/store/objects/layout/renderers.tsx +27 -1
  664. package/src/features/store/objects/search/DocumentSearchContext.ts +3 -2
  665. package/src/features/store/objects/search/DocumentSearchProvider.tsx +3 -0
  666. package/src/features/store/objects/selection/ObjectsActionContext.tsx +26 -128
  667. package/src/features/store/objects/selection/ObjectsActionContextClass.ts +59 -0
  668. package/src/features/store/objects/selection/ObjectsActionHooks.ts +33 -0
  669. package/src/features/store/objects/selection/ObjectsActionSpec.ts +4 -1
  670. package/src/features/store/objects/selection/SelectionActions.tsx +14 -6
  671. package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +19 -14
  672. package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +9 -5
  673. package/src/features/store/objects/selection/actions/ConfirmAction.tsx +4 -3
  674. package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +24 -23
  675. package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +10 -5
  676. package/src/features/store/objects/selection/actions/RemoveFromCollectionAction.tsx +13 -9
  677. package/src/features/store/objects/selection/actions/StartWorkflowComponent.tsx +14 -8
  678. package/src/features/store/objects/upload/DocumentUploadModal.tsx +56 -55
  679. package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +4 -2
  680. package/src/features/store/objects/upload/useUploadHandler.ts +9 -7
  681. package/src/features/store/types/ContentObjectTypesSearch.tsx +10 -8
  682. package/src/features/store/types/ContentObjectTypesTable.tsx +6 -4
  683. package/src/features/store/types/CreateOrUpdateTypeModal.tsx +11 -12
  684. package/src/features/store/types/ObjectSchemaEditor.tsx +11 -9
  685. package/src/features/store/types/SelectContentType.tsx +15 -13
  686. package/src/features/store/types/SelectContentTypeModal.tsx +16 -13
  687. package/src/features/store/types/TableLayoutEditor.tsx +16 -12
  688. package/src/features/user/UserInfo.tsx +47 -56
  689. package/src/i18n/index.tsx +45 -0
  690. package/src/i18n/instance.ts +49 -0
  691. package/src/i18n/locales/ar.json +696 -0
  692. package/src/i18n/locales/de.json +664 -0
  693. package/src/i18n/locales/en.json +665 -0
  694. package/src/i18n/locales/es.json +670 -0
  695. package/src/i18n/locales/fr.json +672 -0
  696. package/src/i18n/locales/it.json +670 -0
  697. package/src/i18n/locales/ja.json +664 -0
  698. package/src/i18n/locales/ko.json +664 -0
  699. package/src/i18n/locales/pt.json +670 -0
  700. package/src/i18n/locales/ru.json +680 -0
  701. package/src/i18n/locales/tr.json +664 -0
  702. package/src/i18n/locales/zh-TW.json +664 -0
  703. package/src/i18n/locales/zh.json +664 -0
  704. package/src/layout/FullHeightLayout.tsx +8 -0
  705. package/src/layout/Navbar.tsx +4 -2
  706. package/src/layout/RegionTag.tsx +25 -0
  707. package/src/layout/Sidebar.tsx +4 -3
  708. package/src/layout/index.ts +2 -1
  709. package/src/router/HistoryNavigator.ts +10 -10
  710. package/src/router/Nav.tsx +9 -3
  711. package/src/router/NestedNavigationContext.tsx +4 -0
  712. package/src/router/NestedRouterProvider.tsx +3 -1
  713. package/src/router/Router.tsx +23 -7
  714. package/src/session/UserSession.ts +34 -5
  715. package/src/session/UserSessionProvider.tsx +6 -14
  716. package/src/session/auth/composable.ts +1 -1
  717. package/src/session/auth/domainRouting.test.ts +110 -0
  718. package/src/session/auth/domainRouting.ts +22 -0
  719. package/src/session/auth/firebase.ts +1 -1
  720. package/src/session/auth/useCurrentTenant.ts +3 -1
  721. package/src/shell/SplashScreen.tsx +22 -26
  722. package/src/shell/apps/StandaloneApp.tsx +9 -6
  723. package/src/shell/login/EnterpriseSigninButton.tsx +6 -4
  724. package/src/shell/login/GitHubSignInButton.tsx +3 -7
  725. package/src/shell/login/GoogleSignInButton.tsx +3 -1
  726. package/src/shell/login/InviteAcceptModal.tsx +5 -2
  727. package/src/shell/login/MicrosoftSigninButton.tsx +4 -6
  728. package/src/shell/login/SigninScreen.tsx +18 -13
  729. package/src/shell/login/SignupForm.tsx +46 -46
  730. package/src/shell/login/TerminalLogin.tsx +36 -33
  731. package/src/shell/login/UserInfo.tsx +15 -13
  732. package/src/shell/login/UserSessionMenu.tsx +28 -31
  733. package/src/widgets/index.ts +0 -1
  734. package/src/widgets/json-view/JSONCode.tsx +1 -1
  735. package/src/widgets/json-view/JSONDisplay.tsx +8 -3
  736. package/src/widgets/json-view/JSONSwitcher.tsx +24 -0
  737. package/src/widgets/json-view/JSONView.tsx +1 -1
  738. package/src/widgets/json-view/index.ts +1 -0
  739. package/src/widgets/markdown/ArtifactContentRenderer.tsx +15 -7
  740. package/src/widgets/markdown/CodeBlockContext.tsx +34 -0
  741. package/src/widgets/markdown/MarkdownRenderer.tsx +14 -13
  742. package/src/widgets/markdown/codeBlockHandlers.tsx +17 -36
  743. package/src/widgets/markdown/index.ts +27 -34
  744. package/src/widgets/markdown/remarkDirectiveHandler.ts +1 -1
  745. package/src/widgets/schema-editor/ManagedSchema.ts +6 -5
  746. package/src/widgets/schema-editor/editor/PropertyEditor.tsx +7 -3
  747. package/src/widgets/schema-editor/editor/SchemaEditor.tsx +3 -1
  748. package/src/widgets/upload/DropZone.tsx +10 -13
  749. package/src/widgets/upload/UploadResultCategory.tsx +3 -1
  750. package/src/widgets/upload/UploadSummary.tsx +13 -11
  751. package/tsconfig.dist.json +1 -1
  752. package/lib/esm/core/components/Dropdown.js +0 -16
  753. package/lib/esm/core/components/Dropdown.js.map +0 -1
  754. package/lib/esm/core/components/DropdownList.js +0 -9
  755. package/lib/esm/core/components/DropdownList.js.map +0 -1
  756. package/lib/esm/core/components/RadioGroup.js +0 -34
  757. package/lib/esm/core/components/RadioGroup.js.map +0 -1
  758. package/lib/esm/core/components/SelectStack.js +0 -8
  759. package/lib/esm/core/components/SelectStack.js.map +0 -1
  760. package/lib/esm/core/components/Switch.js +0 -12
  761. package/lib/esm/core/components/Switch.js.map +0 -1
  762. package/lib/esm/widgets/popover/Popover.js +0 -73
  763. package/lib/esm/widgets/popover/Popover.js.map +0 -1
  764. package/lib/esm/widgets/popover/context.js +0 -7
  765. package/lib/esm/widgets/popover/context.js.map +0 -1
  766. package/lib/esm/widgets/popover/index.js +0 -3
  767. package/lib/esm/widgets/popover/index.js.map +0 -1
  768. package/lib/esm/widgets/popover/slots.js +0 -22
  769. package/lib/esm/widgets/popover/slots.js.map +0 -1
  770. package/lib/types/core/components/Dropdown.d.ts +0 -15
  771. package/lib/types/core/components/Dropdown.d.ts.map +0 -1
  772. package/lib/types/core/components/DropdownList.d.ts +0 -13
  773. package/lib/types/core/components/DropdownList.d.ts.map +0 -1
  774. package/lib/types/core/components/RadioGroup.d.ts +0 -26
  775. package/lib/types/core/components/RadioGroup.d.ts.map +0 -1
  776. package/lib/types/core/components/SelectStack.d.ts +0 -13
  777. package/lib/types/core/components/SelectStack.d.ts.map +0 -1
  778. package/lib/types/core/components/Switch.d.ts +0 -11
  779. package/lib/types/core/components/Switch.d.ts.map +0 -1
  780. package/lib/types/widgets/popover/Popover.d.ts +0 -38
  781. package/lib/types/widgets/popover/Popover.d.ts.map +0 -1
  782. package/lib/types/widgets/popover/context.d.ts +0 -8
  783. package/lib/types/widgets/popover/context.d.ts.map +0 -1
  784. package/lib/types/widgets/popover/index.d.ts +0 -3
  785. package/lib/types/widgets/popover/index.d.ts.map +0 -1
  786. package/lib/types/widgets/popover/slots.d.ts +0 -5
  787. package/lib/types/widgets/popover/slots.d.ts.map +0 -1
  788. package/src/core/components/Dropdown.tsx +0 -63
  789. package/src/core/components/DropdownList.tsx +0 -72
  790. package/src/core/components/RadioGroup.tsx +0 -100
  791. package/src/core/components/SelectStack.tsx +0 -63
  792. package/src/core/components/Switch.tsx +0 -30
  793. package/src/widgets/popover/Popover.tsx +0 -171
  794. package/src/widgets/popover/context.ts +0 -15
  795. package/src/widgets/popover/index.ts +0 -2
  796. package/src/widgets/popover/slots.ts +0 -24
@@ -1 +1 @@
1
- {"version":3,"file":"vertesia-ui-layout.js","sources":["esm/layout/FullHeightLayout.js","esm/layout/SidebarContext.js","esm/layout/TitleBar.js","esm/layout/Navbar.js","esm/layout/Sidebar.js","esm/layout/AppLayout.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nexport function FullHeightLayout({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"flex flex-col\", \"h-full\", \"overflow-y-auto\", \"px-2\", className), children: children }));\n}\nFullHeightLayout.Fixed = function Fixed({ heightClass, className, children }) {\n return (_jsx(\"div\", { className: clsx(\"w-full\", heightClass, className), children: children }));\n};\nFullHeightLayout.Body = function Body({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"grow overflow-auto\", \"min-h-0\", \"p-2\", className), children: children }));\n};\nFullHeightLayout.VR = function VDivider({}) {\n return (_jsx(\"div\", { className: \"w-[1px] border border-red-200\" }));\n};\nFullHeightLayout.HR = function HDivider({}) {\n return (_jsx(\"div\", { className: \"w-full h-1 border-b border-red-200\" }));\n};\n//# sourceMappingURL=FullHeightLayout.js.map","import { createContext, useContext } from \"react\";\nexport const SidebarContext = createContext({\n isOpen: false,\n toggleMobile: () => void 0,\n toggleDesktop: () => void 0,\n});\nexport function useSidebarToggle() {\n return useContext(SidebarContext);\n}\n//# sourceMappingURL=SidebarContext.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nexport function TitleBar({ title }) {\n return _jsx(\"div\", { className: 'self-center text-lg font-semibold', children: title });\n}\n//# sourceMappingURL=TitleBar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Menu, Search } from 'lucide-react';\nimport { Button } from '@vertesia/ui/core';\nimport { useSidebarToggle } from './SidebarContext.js';\nimport { TitleBar } from './TitleBar.js';\nexport function Navbar({ children, logo, onSearch, title }) {\n return (_jsxs(\"div\", { className: \"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b px-4 shadow-2xs sm:gap-x-6 sm:px-6 lg:px-8\", children: [_jsx(HamburgerButton, {}), _jsx(\"div\", { className: \"lg:hidden\", children: logo }), onSearch && _jsx(NavbarSeparator, { visible: 'mobile' }), _jsxs(\"div\", { className: \"flex flex-1 gap-x-4 self-stretch lg:gap-x-6\", children: [_jsx(TitleBar, { title: title }), onSearch && _jsx(SearchBox, { onSearch: onSearch }), _jsx(\"div\", { className: \"flex items-center gap-x-4 lg:gap-x-6 ml-auto\", children: children })] })] }));\n}\nfunction SearchBox({}) {\n return (_jsxs(\"form\", { className: \"relative flex flex-1\", action: \"#\", method: \"GET\", children: [_jsx(\"label\", { htmlFor: \"search-field\", className: \"sr-only\", children: \"Search\" }), _jsx(Search, { className: \"pointer-events-none absolute inset-y-0 left-0 h-full w-5 text-gray-400\", \"aria-hidden\": \"true\" }), _jsx(\"input\", { id: \"search-field\", className: \"block h-full w-full border-0 py-0 pl-8 pr-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm\", placeholder: \"Search...\", type: \"search\", name: \"search\" })] }));\n}\nexport function HamburgerButton() {\n const { toggleDesktop, toggleMobile } = useSidebarToggle();\n const toggle = () => {\n if (window.innerWidth < 1024) {\n toggleMobile();\n }\n else {\n toggleDesktop();\n }\n };\n return (_jsx(_Fragment, { children: _jsx(Button, { variant: 'ghost', size: 'icon', onClick: () => toggle(), className: \"p-2 rounded-full transition-colors w-full text-center \", children: _jsx(Menu, { \"aria-hidden\": \"true\", size: 24 }) }) }));\n}\nexport function NavbarSeparator({ visible }) {\n let visibility = \"\";\n if (visible) {\n visibility = visible === \"mobile\" ? \"lg:hidden\" : \"hidden lg:block\";\n }\n return (_jsx(\"div\", { className: `h-6 w-px bg-gray-900/10 dark:bg-slate-900/0.1 ${visibility}`, \"aria-hidden\": \"true\" }));\n}\nexport function NavbarIconButton({ title, icon: Icon, onClick }) {\n return (_jsxs(\"button\", { type: \"button\", className: \"-m-2.5 p-2.5 text-gray-400 dark:text-slate-50 hover:text-gray-500\", onClick: onClick, children: [_jsx(\"span\", { className: \"sr-only\", children: title }), _jsx(Icon, { className: \"size-6\", \"aria-hidden\": \"true\", title: title })] }));\n}\nexport function NavbarButton({ children, onClick }) {\n return (_jsx(Button, { onClick: onClick, children: children }));\n}\nexport function NavbarLink({ href, onClick, children }) {\n return (_jsx(\"a\", { className: \"dark:text-slate-50\", href: href, onClick: onClick, children: children }));\n}\n//# sourceMappingURL=Navbar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nimport { useSidebarToggle } from './SidebarContext';\nimport { Dot } from 'lucide-react';\nimport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@vertesia/ui/core';\nimport { Nav } from \"@vertesia/ui/router\";\nexport function Sidebar({ children, logo, className }) {\n return (_jsxs(\"div\", { className: clsx(className || \"bg-indigo-600 dark:bg-indigo-950\", \"flex flex-col h-full\"), children: [logo &&\n _jsx(\"div\", { className: \"-mx-2 flex h-auto my-4 shrink-0 self-start\", children: logo }), _jsx(\"div\", { className: \"flex-1 min-h-0 overflow-hidden px-0 lg:px-2\", children: _jsx(\"nav\", { className: \"h-full flex flex-col\", children: _jsx(\"ul\", { role: \"list\", className: \"flex flex-col gap-y-2 overflow-y-auto h-full\", children: children }) }) })] }));\n}\nexport function SidebarSection({ children, title, action, isFooter = false, className }) {\n const { isOpen } = useSidebarToggle();\n let header = isOpen ? _jsxs(_Fragment, { children: [title || \"\", action] }) : _jsx(Dot, { className: 'size-6' });\n return (_jsxs(\"li\", { className: isFooter ? 'mt-auto' : '', children: [title && _jsx(\"div\", { className: \"text-xs font-medium h-8 flex items-center gap-x-2 px-2 text-sidebar-foreground/70\", children: header }), _jsx(\"ul\", { \"data-sidebar\": \"menu\", className: clsx(\"flex w-full min-w-0 flex-col gap-1\", className), children: children })] }));\n}\nexport function SidebarTooltip({ children, text }) {\n const { isOpen } = useSidebarToggle();\n return (isOpen ? _jsx(_Fragment, { children: children }) :\n _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: children }), _jsx(TooltipContent, { side: 'right', children: text })] }) }));\n}\nexport function SidebarItem({ external, className, tools, children, icon: Icon, href, current, onClick, replace }) {\n const { toggleMobile } = useSidebarToggle();\n const _closeSideBar = () => {\n setTimeout(() => {\n toggleMobile(false);\n }, 100);\n };\n const onClickWrapper = (event) => {\n if (external) {\n window.open(href, '_blank');\n event.preventDefault(); // Prevent default link behavior\n event.stopPropagation(); // Stop the event from propagating\n }\n else if (onClick) {\n onClick(event);\n }\n };\n return (_jsx(\"li\", { children: _jsx(Nav, { onClick: _closeSideBar, replace: replace, children: _jsx(SidebarTooltip, { text: children, children: _jsxs(\"a\", { href: href, onClick: onClickWrapper, className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'group flex gap-x-3 rounded-md px-2 py-1.5 text-sm items-center h-8', className), children: [Icon &&\n _jsx(Icon, { className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'size-4 shrink-0'), \"aria-hidden\": \"true\" }), children, tools && _jsx(\"div\", { className: 'flex items-center ml-auto', children: tools })] }) }) }) }));\n}\n//# sourceMappingURL=Sidebar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nimport { useEffect, useState } from 'react';\nimport { SidePanel } from '@vertesia/ui/core';\n// import { FullHeightLayout } from './FullHeightLayout.js'\nimport { Navbar } from './Navbar.js';\nimport { Sidebar } from './Sidebar.js';\nimport { SidebarContext } from './SidebarContext.js';\nexport function AppLayout({ sidebarClassName, className, title, children, logo, navbar, sidebar, mainNav }) {\n if (localStorage.getItem('desktopSidebarOpen') === null) {\n localStorage.setItem('desktopSidebarOpen', 'true');\n }\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const [desktopSidebarOpen, setDesktopSidebarOpen] = useState(localStorage.getItem('desktopSidebarOpen') === 'true');\n const [isLargeScreen, setIsLargeScreen] = useState(window.innerWidth >= 1024);\n useEffect(() => {\n const handleResize = () => {\n setIsLargeScreen(window.innerWidth >= 1024);\n };\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n const sidebarContextValue = {\n isOpen: isLargeScreen ? desktopSidebarOpen : sidebarOpen,\n toggleDesktop: (value) => {\n if (value === undefined) {\n setDesktopSidebarOpen(!desktopSidebarOpen);\n }\n else {\n setDesktopSidebarOpen(value);\n }\n localStorage.setItem('desktopSidebarOpen', JSON.stringify(!desktopSidebarOpen));\n },\n toggleMobile: (value) => {\n if (value === undefined) {\n setSidebarOpen(!sidebarOpen);\n }\n else {\n setSidebarOpen(value);\n }\n },\n };\n return (_jsx(_Fragment, { children: _jsx(\"div\", { className: 'flex flex-col h-screen overflow-y-hidden', children: _jsxs(SidebarContext.Provider, { value: sidebarContextValue, children: [_jsx(\"div\", { className: 'w-full', children: mainNav }), _jsxs(\"div\", { className: 'flex h-full overflow-y-auto w-full', children: [_jsx(\"div\", { className: \"lg:hidden\", children: _jsx(SidePanel, { className: 'bg-sidebar', isOpen: sidebarOpen, onClose: () => setSidebarOpen(false), side: \"left\", panelWidth: 288, resizable: false, backdrop: true, children: _jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }) }) }), _jsx(\"div\", { className: `hidden lg:block relative transition-all duration-300 ${desktopSidebarOpen ? 'w-72' : 'w-12'}`, children: _jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }) }), _jsxs(\"div\", { className: \"w-full h-full overflow-y-hidden\", children: [navbar ? (_jsx(Navbar, { title: title, logo: logo, children: navbar })) : null, _jsx(\"main\", { className: clsx(\"flex-1 h-full w-full relative flex flex-col\", className), children: children })] })] })] }) }) }));\n}\n//# sourceMappingURL=AppLayout.js.map"],"names":["FullHeightLayout","className","children","_jsx","clsx","Fixed","heightClass","Body","VR","HR","SidebarContext","createContext","isOpen","toggleMobile","toggleDesktop","useSidebarToggle","useContext","TitleBar","title","Navbar","logo","onSearch","_jsxs","HamburgerButton","NavbarSeparator","visible","SearchBox","action","method","htmlFor","Search","id","placeholder","type","name","_Fragment","Button","variant","size","onClick","window","innerWidth","Menu","visibility","NavbarIconButton","icon","Icon","NavbarButton","NavbarLink","href","Sidebar","role","SidebarSection","isFooter","header","Dot","SidebarTooltip","text","TooltipProvider","Tooltip","TooltipTrigger","asChild","TooltipContent","side","SidebarItem","external","tools","current","replace","Nav","setTimeout","event","open","preventDefault","stopPropagation","AppLayout","sidebarClassName","navbar","sidebar","mainNav","localStorage","getItem","setItem","sidebarOpen","setSidebarOpen","useState","desktopSidebarOpen","setDesktopSidebarOpen","isLargeScreen","setIsLargeScreen","useEffect","handleResize","addEventListener","removeEventListener","sidebarContextValue","value","undefined","JSON","stringify","Provider","SidePanel","onClose","panelWidth","resizable","backdrop"],"mappings":"8YAEO,SAASA,GAAiBC,UAAEA,EAASC,SAAEA,IAC1C,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,gBAAiB,SAAU,kBAAmB,OAAQH,GAAYC,SAAUA,GACtH,CACAF,EAAiBK,MAAQ,UAAeC,YAAEA,EAAWL,UAAEA,EAASC,SAAEA,IAC9D,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,SAAUE,EAAaL,GAAYC,SAAUA,GACvF,EACAF,EAAiBO,KAAO,UAAcN,UAAEA,EAASC,SAAEA,IAC/C,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,qBAAsB,UAAW,MAAOH,GAAYC,SAAUA,GACxG,EACAF,EAAiBQ,GAAK,aAClB,OAAQL,EAAK,MAAO,CAAEF,UAAW,iCACrC,EACAD,EAAiBS,GAAK,aAClB,OAAQN,EAAK,MAAO,CAAEF,UAAW,sCACrC,ECfY,MAACS,EAAiBC,EAAc,CACxCC,QAAQ,EACRC,aAAc,OACdC,cAAe,SAEZ,SAASC,IACZ,OAAOC,EAAWN,EACtB,CCPO,SAASO,GAASC,MAAEA,IACvB,OAAOf,EAAK,MAAO,CAAEF,UAAW,oCAAqCC,SAAUgB,GACnF,CCEO,SAASC,GAAO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AMlB,SAAU2E,IAAa,KAAM1E,EAAK,OAAQ,CAAEF,UAAWG,EAAK,8CAA+CH,GAAYC,SAAUA,gBAC1kC"}
1
+ {"version":3,"file":"vertesia-ui-layout.js","sources":["esm/layout/FullHeightLayout.js","esm/layout/SidebarContext.js","esm/layout/TitleBar.js","esm/i18n/instance.js","esm/layout/Navbar.js","esm/i18n/index.js","esm/layout/Sidebar.js","esm/layout/AppLayout.js","esm/layout/RegionTag.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nexport function FullHeightLayout({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"flex flex-col\", \"h-full\", \"overflow-y-auto\", \"px-2\", className), children: children }));\n}\nFullHeightLayout.Fixed = function Fixed({ heightClass, className, children }) {\n return (_jsx(\"div\", { className: clsx(\"w-full\", heightClass, className), children: children }));\n};\nFullHeightLayout.Body = function Body({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"grow overflow-auto\", \"min-h-0\", \"p-2\", className), children: children }));\n};\nFullHeightLayout.VR = function VDivider({}) {\n return (_jsx(\"div\", { className: \"w-[1px] border border-red-200\" }));\n};\nFullHeightLayout.HR = function HDivider({}) {\n return (_jsx(\"div\", { className: \"w-full h-1 border-b border-red-200\" }));\n};\nFullHeightLayout.Tab = function Tab({ children }) {\n return (_jsx(\"div\", { className: \"flex flex-col h-full\", children: children }));\n};\n//# sourceMappingURL=FullHeightLayout.js.map","import { createContext, useContext } from \"react\";\nexport const SidebarContext = createContext({\n isOpen: false,\n toggleMobile: () => void 0,\n toggleDesktop: () => void 0,\n});\nexport function useSidebarToggle() {\n return useContext(SidebarContext);\n}\n//# sourceMappingURL=SidebarContext.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nexport function TitleBar({ title }) {\n return _jsx(\"div\", { className: 'self-center text-lg font-semibold', children: title });\n}\n//# sourceMappingURL=TitleBar.js.map","import i18next from 'i18next';\nimport { initReactI18next } from 'react-i18next';\nimport ar from './locales/ar.json';\nimport de from './locales/de.json';\nimport en from './locales/en.json';\nimport es from './locales/es.json';\nimport fr from './locales/fr.json';\nimport it from './locales/it.json';\nimport ja from './locales/ja.json';\nimport ko from './locales/ko.json';\nimport pt from './locales/pt.json';\nimport ru from './locales/ru.json';\nimport tr from './locales/tr.json';\nimport zh from './locales/zh.json';\nimport zhTW from './locales/zh-TW.json';\nexport const NAMESPACE = 'vertesia.ui';\n// Scoped instance — does NOT touch the global i18next singleton\nconst i18nInstance = i18next.createInstance();\nvoid i18nInstance.use(initReactI18next).init({\n resources: {\n ar: { [NAMESPACE]: ar },\n de: { [NAMESPACE]: de },\n en: { [NAMESPACE]: en },\n es: { [NAMESPACE]: es },\n fr: { [NAMESPACE]: fr },\n it: { [NAMESPACE]: it },\n ja: { [NAMESPACE]: ja },\n ko: { [NAMESPACE]: ko },\n pt: { [NAMESPACE]: pt },\n ru: { [NAMESPACE]: ru },\n tr: { [NAMESPACE]: tr },\n zh: { [NAMESPACE]: zh },\n 'zh-TW': { [NAMESPACE]: zhTW },\n },\n fallbackLng: 'en',\n ns: [NAMESPACE],\n defaultNS: NAMESPACE,\n interpolation: {\n escapeValue: false, // React already escapes\n },\n react: {\n useSuspense: false, // Translations are bundled, no async loading\n },\n});\nexport { i18nInstance };\n//# sourceMappingURL=instance.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Menu, Search } from 'lucide-react';\nimport { Button } from '@vertesia/ui/core';\nimport { useSidebarToggle } from './SidebarContext.js';\nimport { TitleBar } from './TitleBar.js';\nimport { useUITranslation } from '../i18n/index.js';\nexport function Navbar({ children, logo, onSearch, title }) {\n return (_jsxs(\"div\", { className: \"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b px-4 shadow-2xs sm:gap-x-6 sm:px-6 lg:px-8\", children: [_jsx(HamburgerButton, {}), _jsx(\"div\", { className: \"lg:hidden\", children: logo }), onSearch && _jsx(NavbarSeparator, { visible: 'mobile' }), _jsxs(\"div\", { className: \"flex flex-1 gap-x-4 self-stretch lg:gap-x-6\", children: [_jsx(TitleBar, { title: title }), onSearch && _jsx(SearchBox, { onSearch: onSearch }), _jsx(\"div\", { className: \"flex items-center gap-x-4 lg:gap-x-6 ml-auto\", children: children })] })] }));\n}\nfunction SearchBox({}) {\n const { t } = useUITranslation();\n return (_jsxs(\"form\", { className: \"relative flex flex-1\", action: \"#\", method: \"GET\", children: [_jsx(\"label\", { htmlFor: \"search-field\", className: \"sr-only\", children: t('layout.search') }), _jsx(Search, { className: \"pointer-events-none absolute inset-y-0 left-0 h-full w-5 text-gray-400\", \"aria-hidden\": \"true\" }), _jsx(\"input\", { id: \"search-field\", className: \"block h-full w-full border-0 py-0 pl-8 pr-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm\", placeholder: t('layout.searchPlaceholder'), type: \"search\", name: \"search\" })] }));\n}\nexport function HamburgerButton() {\n const { toggleDesktop, toggleMobile } = useSidebarToggle();\n const toggle = () => {\n if (window.innerWidth < 1024) {\n toggleMobile();\n }\n else {\n toggleDesktop();\n }\n };\n return (_jsx(_Fragment, { children: _jsx(Button, { variant: 'ghost', size: 'icon', onClick: () => toggle(), className: \"p-2 rounded-full transition-colors w-full text-center \", children: _jsx(Menu, { \"aria-hidden\": \"true\", size: 24 }) }) }));\n}\nexport function NavbarSeparator({ visible }) {\n let visibility = \"\";\n if (visible) {\n visibility = visible === \"mobile\" ? \"lg:hidden\" : \"hidden lg:block\";\n }\n return (_jsx(\"div\", { className: `h-6 w-px bg-gray-900/10 dark:bg-slate-900/0.1 ${visibility}`, \"aria-hidden\": \"true\" }));\n}\nexport function NavbarIconButton({ title, icon: Icon, onClick }) {\n return (_jsxs(\"button\", { type: \"button\", className: \"-m-2.5 p-2.5 text-gray-400 dark:text-slate-50 hover:text-gray-500\", onClick: onClick, children: [_jsx(\"span\", { className: \"sr-only\", children: title }), _jsx(Icon, { className: \"size-6\", \"aria-hidden\": \"true\", title: title })] }));\n}\nexport function NavbarButton({ children, onClick }) {\n return (_jsx(Button, { onClick: onClick, children: children }));\n}\nexport function NavbarLink({ href, onClick, children }) {\n return (_jsx(\"a\", { className: \"dark:text-slate-50\", href: href, onClick: onClick, children: children }));\n}\n//# sourceMappingURL=Navbar.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect } from 'react';\nimport { I18nextProvider, useTranslation } from 'react-i18next';\nimport { i18nInstance, NAMESPACE } from './instance.js';\nfunction detectLanguage(lng) {\n return lng ?? navigator.language?.split('-')[0] ?? 'en';\n}\nexport function I18nProvider({ lng, children }) {\n // Set language synchronously on first render to avoid flash of wrong language\n const language = detectLanguage(lng);\n if (i18nInstance.language !== language) {\n void i18nInstance.changeLanguage(language);\n }\n // Also react to prop changes\n useEffect(() => {\n const lang = detectLanguage(lng);\n if (i18nInstance.language !== lang) {\n void i18nInstance.changeLanguage(lang);\n }\n }, [lng]);\n return (_jsx(I18nextProvider, { i18n: i18nInstance, children: children }));\n}\n/**\n * Hook for components inside @vertesia/ui to get translation functions.\n * Always binds to the 'vertesia.ui' namespace on the scoped instance.\n */\nexport function useUITranslation() {\n return useTranslation(NAMESPACE, { i18n: i18nInstance });\n}\nexport { i18nInstance, NAMESPACE } from './instance.js';\n//# sourceMappingURL=index.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nimport { useSidebarToggle } from './SidebarContext';\nimport { Dot } from 'lucide-react';\nimport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@vertesia/ui/core';\nimport { Nav } from \"@vertesia/ui/router\";\nexport function Sidebar({ children, logo, className }) {\n return (_jsxs(\"div\", { className: clsx(className || \"bg-indigo-600 dark:bg-indigo-950\", \"flex flex-col h-full\"), children: [logo &&\n _jsx(\"div\", { className: \"-mx-2 flex h-auto my-4 shrink-0 self-start\", children: logo }), _jsx(\"div\", { className: \"flex-1 min-h-0 overflow-hidden px-0 lg:px-2\", children: _jsx(\"nav\", { className: \"h-full flex flex-col\", children: _jsx(\"ul\", { role: \"list\", className: \"flex flex-col gap-y-2 overflow-y-auto h-full\", children: children }) }) })] }));\n}\nexport function SidebarSection({ children, title, action, isFooter = false, className }) {\n const { isOpen } = useSidebarToggle();\n let header = isOpen ? _jsxs(_Fragment, { children: [title || \"\", action] }) : _jsx(Dot, { className: 'size-6' });\n return (_jsxs(\"li\", { className: isFooter ? 'mt-auto' : '', children: [title && _jsx(\"div\", { className: \"text-xs font-medium h-8 flex items-center gap-x-2 px-2 text-sidebar-foreground/70\", children: header }), _jsx(\"ul\", { \"data-sidebar\": \"menu\", className: clsx(\"flex w-full min-w-0 flex-col gap-1\", className), children: children })] }));\n}\nexport function SidebarTooltip({ children, text }) {\n const { isOpen } = useSidebarToggle();\n return (isOpen ? _jsx(_Fragment, { children: children }) :\n _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: children }), _jsx(TooltipContent, { side: 'right', children: text })] }) }));\n}\nexport function SidebarItem({ external, className, tools, children, icon: Icon, href, to, current, onClick, replace }) {\n const { toggleMobile } = useSidebarToggle();\n const _closeSideBar = () => {\n setTimeout(() => {\n toggleMobile(false);\n }, 100);\n };\n const onClickWrapper = (event) => {\n if (external) {\n window.open(href, '_blank');\n event.preventDefault(); // Prevent default link behavior\n event.stopPropagation(); // Stop the event from propagating\n }\n else if (onClick) {\n onClick(event);\n }\n };\n return (_jsx(\"li\", { children: _jsx(Nav, { to: to, onClick: _closeSideBar, replace: replace, children: _jsx(SidebarTooltip, { text: children, children: _jsxs(\"a\", { href: href, onClick: onClickWrapper, className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'group flex gap-x-3 rounded-md px-2 py-1.5 text-sm items-center h-8', className), children: [Icon &&\n _jsx(Icon, { className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'size-4 shrink-0'), \"aria-hidden\": \"true\" }), children, tools && _jsx(\"div\", { className: 'flex items-center ml-auto', children: tools })] }) }) }) }));\n}\n//# sourceMappingURL=Sidebar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nimport { useEffect, useState } from 'react';\nimport { SidePanel } from '@vertesia/ui/core';\n// import { FullHeightLayout } from './FullHeightLayout.js'\nimport { Navbar } from './Navbar.js';\nimport { Sidebar } from './Sidebar.js';\nimport { SidebarContext } from './SidebarContext.js';\nexport function AppLayout({ sidebarClassName, className, title, children, logo, navbar, sidebar, mainNav }) {\n if (localStorage.getItem('desktopSidebarOpen') === null) {\n localStorage.setItem('desktopSidebarOpen', 'true');\n }\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const [desktopSidebarOpen, setDesktopSidebarOpen] = useState(localStorage.getItem('desktopSidebarOpen') === 'true');\n const [isLargeScreen, setIsLargeScreen] = useState(window.innerWidth >= 1024);\n useEffect(() => {\n const handleResize = () => {\n setIsLargeScreen(window.innerWidth >= 1024);\n };\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n const sidebarContextValue = {\n isOpen: isLargeScreen ? desktopSidebarOpen : sidebarOpen,\n toggleDesktop: (value) => {\n if (value === undefined) {\n setDesktopSidebarOpen(!desktopSidebarOpen);\n }\n else {\n setDesktopSidebarOpen(value);\n }\n localStorage.setItem('desktopSidebarOpen', JSON.stringify(!desktopSidebarOpen));\n },\n toggleMobile: (value) => {\n if (value === undefined) {\n setSidebarOpen(!sidebarOpen);\n }\n else {\n setSidebarOpen(value);\n }\n },\n };\n return (_jsx(_Fragment, { children: _jsx(\"div\", { className: 'flex flex-col h-screen overflow-y-hidden', children: _jsxs(SidebarContext.Provider, { value: sidebarContextValue, children: [_jsx(\"div\", { className: 'w-full', children: mainNav }), _jsxs(\"div\", { className: 'flex h-full overflow-y-auto w-full', children: [_jsx(\"div\", { className: \"lg:hidden\", children: _jsx(SidePanel, { className: 'bg-sidebar', isOpen: sidebarOpen, onClose: () => setSidebarOpen(false), side: \"left\", panelWidth: 288, resizable: false, backdrop: true, children: _jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }) }) }), _jsx(\"div\", { className: `hidden lg:block relative transition-all duration-300 ${desktopSidebarOpen ? 'w-72' : 'w-12'}`, children: _jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }) }), _jsxs(\"div\", { className: \"w-full h-full overflow-y-hidden\", children: [navbar ? (_jsx(Navbar, { title: title, logo: logo, children: navbar })) : null, _jsx(\"main\", { className: clsx(\"flex-1 h-full w-full relative flex flex-col\", className), children: children })] })] })] }) }) }));\n}\n//# sourceMappingURL=AppLayout.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { cn } from '@vertesia/ui/core';\nimport { Env } from '@vertesia/ui/env';\nconst regionLabels = {\n eu: 'EU',\n jp: 'JP',\n};\nexport function RegionTag({ className }) {\n const region = Env.region;\n // Only show for non-US regions (US is default, no need to display)\n if (!region || region === 'us')\n return null;\n return (_jsx(\"div\", { className: cn('text-[0.6rem] font-semibold px-1.5 rounded-3xl leading-4', 'bg-info text-white', className), children: regionLabels[region] ?? region.toUpperCase() }));\n}\n//# sourceMappingURL=RegionTag.js.map"],"names":["FullHeightLayout","className","children","_jsx","clsx","Fixed","heightClass","Body","VR","HR","Tab","SidebarContext","createContext","isOpen","toggleMobile","toggleDesktop","useSidebarToggle","useContext","TitleBar","title","NAMESPACE","i18nInstance","i18next","createInstance","Navbar","logo","onSearch","_jsxs","HamburgerButton","NavbarSeparator","visible","SearchBox","t","useTranslation","i18n","action","method","htmlFor","Search","id","placeholder","type","name","_Fragment","Button","variant","size","onClick","window","innerWidth","Menu","visibility","NavbarIconButton","icon","Icon","NavbarButton","NavbarLink","href","Sidebar","role","SidebarSection","isFooter","header","Dot","SidebarTooltip","text","TooltipProvider","Tooltip","TooltipTrigger","asChild","TooltipContent","side","SidebarItem","external","tools","to","current","replace","Nav","setTimeout","event","open","preventDefault","stopPropagation","AppLayout","sidebarClassName","navbar","sidebar","mainNav","localStorage","getItem","setItem","sidebarOpen","setSidebarOpen","useState","desktopSidebarOpen","setDesktopSidebarOpen","isLargeScreen","setIsLargeScreen","useEffect","handleResize","addEventListener","removeEventListener","sidebarContextValue","value","undefined","JSON","stringify","Provider","SidePanel","onClose","panelWidth","resizable","backdrop","use","initReactI18next","init","resources","ar","de","en","es","fr","it","ja","ko","pt","ru","tr","zh","fallbackLng","ns","defaultNS","interpolation","escapeValue","react","useSuspense","regionLabels","eu","jp","RegionTag","region","Env","cn","toUpperCase"],"mappings":"yhBAEO,SAASA,GAAiBC,UAAEA,EAASC,SAAEA,IAC1C,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,gBAAiB,SAAU,kBAAmB,OAAQH,GAAYC,SAAUA,GACtH,CACAF,EAAiBK,MAAQ,UAAeC,YAAEA,EAAWL,UAAEA,EAASC,SAAEA,IAC9D,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,SAAUE,EAAaL,GAAYC,SAAUA,GACvF,EACAF,EAAiBO,KAAO,UAAcN,UAAEA,EAASC,SAAEA,IAC/C,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,qBAAsB,UAAW,MAAOH,GAAYC,SAAUA,GACxG,EACAF,EAAiBQ,GAAK,aAClB,OAAQL,EAAK,MAAO,CAAEF,UAAW,iCACrC,EACAD,EAAiBS,GAAK,aAClB,OAAQN,EAAK,MAAO,CAAEF,UAAW,sCACrC,EACAD,EAAiBU,IAAM,UAAaR,SAAEA,IAClC,OAAQC,EAAK,MAAO,CAAEF,UAAW,uBAAwBC,SAAUA,GACvE,EClBY,MAACS,EAAiBC,EAAc,CACxCC,QAAQ,EACRC,aAAc,OACdC,cAAe,SAEZ,SAASC,IACZ,OAAOC,EAAWN,EACtB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{useRef as n,useEffect as a,createContext as r,useContext as i,useState as s,useMemo as o}from"react";import{useSafeLayoutEffect as h}from"@vertesia/ui/core";function c(t){return"/"===t||""===t}function l(t,e){return e=t.endsWith("/")&&e.startsWith("/")?t+e.substring(1):t.endsWith("/")||e.startsWith("/")?t+e:t+"/"+e}function d(t){if(""===t)return[];if("/"===t)return[""];let e=0,n=t.length;return t.startsWith("./")?e=2:t.startsWith("/")&&(e=1),t.endsWith("/")&&(n=t.length-1),(e>0||n<t.length?t.substring(e,n):t).split("/")}function u(t){if("string"==typeof t)return d(t);if(Array.isArray(t))return t;throw new Error(`Unsupported path object: ${t}`)}var p=Object.freeze({__proto__:null,getPathSegments:d,isRootPath:c,joinPath:l,toSegments:u});class m{path;params;hash;constructor(t){let e=t.lastIndexOf("#");e>-1?(this.hash=t.substring(e),t=t.substring(0,e)):this.hash="",e=t.indexOf("?"),e>-1?(this.path=t.substring(0,e),this.params=new URLSearchParams(t.substring(e+1))):(this.path=t,this.params=new URLSearchParams)}add(t){for(const[e,n]of Object.entries(t))this.params.set(e,n);return this}toString(){return this.path+"?"+this.params.toString()+this.hash}}const f=Symbol("BASE_PATH");class w{name;type;location;state;_canceled=!1;constructor(t,e,n,a){this.name=t,this.type=e,this.location=n,this.state=a}get isPageLoad(){return"initial"===this.type}get isBackForward(){return"popState"===this.type}get isLinkClick(){return"linkClick"===this.type}get isNavigation(){return"navigate"===this.type}get isCancelable(){return"beforeChange"===this.name}cancel(){if("afterChange"===this.name)throw new Error("Cannot cancel afterChange event");this._canceled=!0}}class g extends w{constructor(t,e,n){super("beforeChange",t,e,n)}}class v extends w{constructor(t,e,n){super("afterChange",t,e,n)}}class P{stickyParams;_popStateListener;_linkNavListener;_listeners=[];constructor(){}addListener(t){this._listeners.push(t)}fireLocationChange(t){for(const e of this._listeners)e(t)}firePageLoad(){this.fireLocationChange(new v("initial",new URL(window.location.href)))}addStickyParams(t){return this.stickyParams?new m(t).add(this.stickyParams).toString():t}navigate(t,e={}){if(e.stepsBack&&e.stepsBack>0)this.stepBack(e.stepsBack,e);else{if(e.basePath){let n=e.basePath;n.startsWith("/")||(n="/"+n),t=l(n,t)}t=this.addStickyParams(t),this._navigate(new URL(t,window.location.href),"navigate",e)}}stepBack(t,e={}){const n=window.history.state.historyChain||[],a=n.length>=t?new URL(n[n.length-t].href,window.location.href):new URL(window.location.origin,window.location.href);this._navigate(a,"popState",e);const r={from:window.location.href,historyChain:n.slice(0,-t),data:e.state||void 0,title:e.title||document.title};window.history.replaceState(r,"",a.href),this.fireLocationChange(new v("popState",a,e.state))}_navigate(t,e,n){const a=new g(e,t,n.state);if(this.fireLocationChange(a),a._canceled)return;const r=window.history.state,i={title:n.title||document.title,href:window.location.pathname+window.location.search+window.location.hash};let s=[];!n.replace&&r?.historyChain&&(s=[...r.historyChain]),n.replace||(s.push(i),s.length>10&&(s=s.slice(-10)));const o={from:window.location.href,historyChain:s,data:n.state||void 0,title:n.title||document.title};window.history[n.replace?"replaceState":"pushState"](o,"",t.href),this.fireLocationChange(new v(e,t,n.state))}start(){if("undefined"==typeof window)return;const t=t=>{let e=t.state?"popState":"linkClick";const n=new URL(window.location.href);let a;t.state?(e="popState",a=t.state.data):e="linkClick",this.fireLocationChange(new v(e,n,a))};this._popStateListener=t,this._linkNavListener=t=>{const e=t.target;if("a"===e.tagName.toLowerCase()&&(e.hasAttribute("download")||e.href?.startsWith("blob:")))return;const n=function(t){if(t&&"a"===t.tagName.toLowerCase()){const e=t?.href.trim();if("string"==typeof e&&e.length>0)return new URL(e)}return null}(e);if(n&&n.origin===window.location.origin){t.preventDefault();const e=new URL(this.addStickyParams(n.href)),a=t[f]||t.target[f];a&&(e.pathname=l(a,e.pathname)),this._navigate(e,"linkClick",{})}},window.addEventListener("popstate",t),document.body.addEventListener("click",this._linkNavListener)}stop(){this._popStateListener&&window.removeEventListener("popstate",this._popStateListener),this._linkNavListener&&document.body.removeEventListener("click",this._linkNavListener)}}function b({basePath:e,children:r}){const i=n(null);return a(()=>{if(i.current){const t=i.current,n=t=>{"a"===t.target.tagName.toLowerCase()&&(t[f]=e)};return t.addEventListener("click",n),()=>{t.removeEventListener("click",n)}}},[i.current]),t("div",{ref:i,className:"h-full w-full",children:r})}class L{tree=new k;loadMapping(t){for(const[e,n]of Object.entries(t))this.addSegments(d(e),n)}addPath(t,e){this.addSegments(d(t),e)}addSegments(t,e){let n=this.tree;for(let a=0,r=t.length;a<r;a++){const i=t[a];if(":"===i[0]){let e=n.wildcard;if(e){if(!(e instanceof S))throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard ":" segment will overwrite an existing wildcard segment at path: ${"/"+t.slice(0,a).join("/")}`)}else e=new S(i),n.wildcard=e;n=e}else{if("*"===i){if(n.wildcard)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard "*" segment already exists at path: ${"/"+t.slice(0,a).join("/")}`);if(n.wildcard=new _(i,e),a<r-1)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard segment must be the last segment`);return}{let t=n.children[i];t||(t=new C(i),n.children[i]=t),n=t}}}if(void 0!==n.value)throw new Error(`Failed to index path segments: ${t.join("/")}. A value already exists at path: ${"/"+t.join("/")}`);n.value=e}match(t){const e=u(t);if(0===e.length)return null;const n={};let a,r,i=this.tree;for(const t of e){const e=i.match(t,n);if(!e)return null;i=e}if(!i.value){if(i instanceof y&&i.wildcard instanceof _&&(i=i.wildcard.match("",n),!i.value))throw new Error("Wildcard segment node `*` must have a value");if(!i.value)return null}return n._&&n._.length>0?(a=e.slice(0,-n._.length),r=n._):a=e,{params:n,matchedSegments:a,remainingSegments:r,value:i.value}}}class y{name;value;children={};wildcard;constructor(t,e){this.name=t,this.value=e}match(t,e){let n=this.children[t];if(n)return n;if(this.wildcard){if(this.wildcard instanceof _)return this.wildcard.match(t,e);if(this.wildcard instanceof S)return e[this.wildcard.paramName]=t,this.wildcard;throw new Error("Unknown wildcard segment node type: "+this.wildcard.constructor.name)}return null}}class k extends y{constructor(){super("#root")}}class C extends y{constructor(t,e){super(t,e)}}class S extends y{paramName;constructor(t,e){super(t,e),this.paramName=t.substring(1)}}class _{name;value;constructor(t,e){this.name=t,this.value=e}match(t,e){return e._?t&&e._.push(t):e._=t?[t]:[],this}}class x{index;matcher=new L;constructor(t,e){this.index=e;for(const e of t)this.matcher.addPath(e.path,e)}match(t){const e=c(t)&&this.index;return this.matcher.match(e?this.index:t)}}class R extends x{prompt;observer;navigator=new P;constructor(t,e){super(t),this.navigator.addListener(t=>{if((!(t.isCancelable&&this.prompt&&this.prompt.when)||window.confirm(this.prompt.message))&&(this.observer&&this.observer(t),"afterChange"===t.name)){const n=this.match(t.location.pathname);n&&n.value?e({...n,state:t.state}):e(null)}})}getTopRouter(){return this}setStickyParams(t){this.navigator.stickyParams=null!=t?t:void 0}withObserver(t){return this.observer=t,this}start(){this.navigator.start(),this.navigator.firePageLoad()}stop(){this.navigator.stop()}navigate(t,e){this.navigator.navigate(t,e)}}class E extends x{parent;basePath;constructor(t,e,n){super(n),this.parent=t,this.basePath=e}getTopRouter(){return this.parent instanceof R?this.parent:this.parent.getTopRouter()}navigate(t,e){let n;if(e?.isBasePathNested??!0){const t=e?.basePath;n=t?l(this.basePath,t):this.basePath}else n=e?.basePath??this.basePath;this.parent.navigate(t,{...e,basePath:n})}}const j=r(void 0);function N(){const t=i(j);if(!t)throw new Error("useRouter must be used within a RouterProvider");return t}function U(){const{navigate:t}=N();return t}function W(t){const{params:e}=N();return t?e[t]:e}function $(){const{location:t}=N();return t}function A(t){const{router:e}=N();a(()=>(e.getTopRouter().prompt=t,()=>{e.getTopRouter().prompt=void 0}),[]),a(()=>{if(t.when){const e=t.when,n=function(t){e&&(t.preventDefault(),t.returnValue="")};return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}}},[t.when])}function B({children:e,onClick:n,replace:a=!0}){const r=U();return t("span",{onClick:t=>{const e=t.target.closest("a");e&&e.href&&(t.stopPropagation(),t.preventDefault(),r(e.href,{replace:a}),n?.(t))},children:e})}function O({children:e,href:n,className:a,topLevelNav:r,clearBreadcrumbs:i=!1}){const{router:s}=N();return t("a",{href:n,className:a,onClick:t=>{t.stopPropagation(),t.preventDefault();(r?s.getTopRouter():s).navigate(n,{replace:i})},children:e})}function T({spinner:e}){const n=N(),a=n.route;if(a.Component){const e=a.Component;return t(e,{...n.params})}if(a.LazyComponent)return t(z,{route:a,spinner:e});throw new Error(`Invalid route for ${a.path}. Either Component or LazyCOmponent must be specified.`)}function z({route:e,spinner:n}){const[r,i]=s(null);return a(()=>{e.LazyComponent().then(t=>{if(!t.default)throw new Error(`Lazy module for ${e.path} does not have a default export`);i(()=>t.default)})},[e]),r?t(r,{}):n||null}function F({basePath:e,fixLinks:n=!1,children:a}){const r=N(),i=n?e=>t(b,{basePath:r.matchedRoutePath,children:e}):t=>t;return t(j.Provider,{value:{...r,navigate:(t,n)=>{const a=n?.basePath?l(e,n.basePath):e;return r.navigate(t,{...n,basePath:a})}},children:i(a||t(T,{}))})}function D(){const t=N();return e("div",{children:["Route not found for path ",t.matchedRoutePath]})}function I(){return{params:{},matchedSegments:[],state:null,value:{path:"virtual:404",Component:()=>t(D,{})}}}function H({routes:e,index:n,children:r,fixLinks:i=!1}){const h=N(),[c,l]=s(void 0),d=o(()=>{if("undefined"==typeof window)return null;const t=h.matchedRoutePath,a=new E(h.router,t,e);return a.index=n,a},[]);a(()=>{if(d){if(h.matchedRoutePath!==d.basePath)return;const t=d.match(h.remainingPath||"/")||I();l(t)}},[d,h.remainingPath]);const u=i?e=>t(b,{basePath:h.matchedRoutePath,children:e}):t=>t;return c&&t(j.Provider,{value:{...h,router:d,route:c.value,params:c.params,matchedRoutePath:"/"+c.matchedSegments.join("/"),remainingPath:c.remainingSegments?"/"+c.remainingSegments.join("/"):void 0,navigate:(t,e)=>d.navigate(t,e)},children:u(r||t(T,{}))})}function M({routes:e,index:n,onChange:a,children:r}){const[i,c]=s(void 0),l=o(()=>{if("undefined"==typeof window)return null;const t=new R(e,e=>{null===e&&(e=I()),c({location:window.location,route:e.value,params:e.params,state:e.state,router:t,matchedRoutePath:"/"+e.matchedSegments.join("/"),remainingPath:e.remainingSegments?"/"+e.remainingSegments.join("/"):void 0,navigate:(e,n)=>t.navigate(e,n)})}).withObserver(a);return t.index=n,t},[]);return h(()=>(l&&l.start(),()=>{l&&l.stop()}),[]),i&&t(j.Provider,{value:i,children:r||t(T,{})})}export{v as AfterLocationChangeEvent,f as BASE_PATH,x as BaseRouter,g as BeforeLocationChangeEvent,b as FixLinks,P as HistoryNavigator,w as LocationChangeEvent,B as Nav,O as NavLink,F as NestedNavigationContext,E as NestedRouter,H as NestedRouterProvider,p as Path,L as PathMatcher,j as ReactRouterContext,T as RouteComponent,R as Router,M as RouterProvider,$ as useLocation,U as useNavigate,A as useNavigationPrompt,W as useParams,N as useRouterContext};
1
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useRef as n,useEffect as a,createContext as r,useContext as i,useState as s,useMemo as o}from"react";import{useSafeLayoutEffect as h}from"@vertesia/ui/core";function c(t){return"/"===t||""===t}function l(t,e){return e=t.endsWith("/")&&e.startsWith("/")?t+e.substring(1):t.endsWith("/")||e.startsWith("/")?t+e:t+"/"+e}function u(t){if(""===t)return[];if("/"===t)return[""];let e=0,n=t.length;return t.startsWith("./")?e=2:t.startsWith("/")&&(e=1),t.endsWith("/")&&(n=t.length-1),(e>0||n<t.length?t.substring(e,n):t).split("/")}function d(t){if("string"==typeof t)return u(t);if(Array.isArray(t))return t;throw new Error(`Unsupported path object: ${t}`)}var p=Object.freeze({__proto__:null,getPathSegments:u,isRootPath:c,joinPath:l,toSegments:d});class m{path;params;hash;constructor(t){let e=t.lastIndexOf("#");e>-1?(this.hash=t.substring(e),t=t.substring(0,e)):this.hash="",e=t.indexOf("?"),e>-1?(this.path=t.substring(0,e),this.params=new URLSearchParams(t.substring(e+1))):(this.path=t,this.params=new URLSearchParams)}add(t){for(const[e,n]of Object.entries(t))this.params.set(e,n);return this}toString(){return this.path+"?"+this.params.toString()+this.hash}}const f=Symbol("BASE_PATH");class g{name;type;location;state;_canceled=!1;constructor(t,e,n,a){this.name=t,this.type=e,this.location=n,this.state=a}get isPageLoad(){return"initial"===this.type}get isBackForward(){return"popState"===this.type}get isLinkClick(){return"linkClick"===this.type}get isNavigation(){return"navigate"===this.type}get isCancelable(){return"beforeChange"===this.name}cancel(){if("afterChange"===this.name)throw new Error("Cannot cancel afterChange event");this._canceled=!0}}class w extends g{constructor(t,e,n){super("beforeChange",t,e,n)}}class v extends g{constructor(t,e,n){super("afterChange",t,e,n)}}class P{stickyParams;_popStateListener;_linkNavListener;_listeners=[];constructor(){}addListener(t){this._listeners.push(t)}fireLocationChange(t){for(const e of this._listeners)e(t)}firePageLoad(){this.fireLocationChange(new v("initial",new URL(window.location.href)))}addStickyParams(t){return this.stickyParams?new m(t).add(this.stickyParams).toString():t}navigate(t,e={}){if(e.stepsBack&&e.stepsBack>0)this.stepBack(e.stepsBack,e);else{if(e.basePath){let n=e.basePath;n.startsWith("/")||(n="/"+n),t=l(n,t)}t=this.addStickyParams(t),this._navigate(new URL(t,window.location.href),"navigate",e)}}stepBack(t,e={}){const n=window.history.state.historyChain||[],a=n.length>=t?new URL(n[n.length-t].href,window.location.href):new URL(window.location.origin,window.location.href);this._navigate(a,"popState",e);const r={from:window.location.href,historyChain:n.slice(0,-t),data:e.state||void 0,title:e.title||document.title};window.history.replaceState(r,"",a.href),this.fireLocationChange(new v("popState",a,e.state))}_navigate(t,e,n){const a=new w(e,t,n.state);if(this.fireLocationChange(a),a._canceled)return;const r=window.history.state,i={title:n.title||document.title,href:window.location.pathname+window.location.search+window.location.hash};let s=[];!n.replace&&r?.historyChain&&(s=[...r.historyChain]),n.replace||(s.push(i),s.length>10&&(s=s.slice(-10)));const o={from:window.location.href,historyChain:s,data:n.state||void 0,title:n.title||document.title};window.history[n.replace?"replaceState":"pushState"](o,"",t.href),this.fireLocationChange(new v(e,t,n.state))}start(){if("undefined"==typeof window)return;const t=t=>{let e;const n=new URL(window.location.href);let a;t.state?(e="popState",a=t.state.data):e="linkClick",this.fireLocationChange(new v(e,n,a))};this._popStateListener=t,this._linkNavListener=t=>{const e=t.target;if("a"===e.tagName.toLowerCase()&&(e.hasAttribute("download")||e.href?.startsWith("blob:")))return;const n=function(t){if(t&&"a"===t.tagName.toLowerCase()){const e=t?.href.trim();if("string"==typeof e&&e.length>0)return new URL(e)}return null}(e);if(n&&n.origin===window.location.origin){t.preventDefault();const e=new URL(this.addStickyParams(n.href)),a=t[f]||t.target[f];a&&(e.pathname=l(a,e.pathname)),this._navigate(e,"linkClick",{})}},window.addEventListener("popstate",t),document.body.addEventListener("click",this._linkNavListener)}stop(){this._popStateListener&&window.removeEventListener("popstate",this._popStateListener),this._linkNavListener&&document.body.removeEventListener("click",this._linkNavListener)}}function b({basePath:e,children:r}){const i=n(null);return a(()=>{if(i.current){const t=i.current,n=t=>{"a"===t.target.tagName.toLowerCase()&&(t[f]=e)};return t.addEventListener("click",n),()=>{t.removeEventListener("click",n)}}},[i.current]),t("div",{ref:i,className:"h-full w-full",children:r})}class L{tree=new C;loadMapping(t){for(const[e,n]of Object.entries(t))this.addSegments(u(e),n)}addPath(t,e){this.addSegments(u(t),e)}addSegments(t,e){let n=this.tree;for(let a=0,r=t.length;a<r;a++){const i=t[a];if(":"===i[0]){let e=n.wildcard;if(e){if(!(e instanceof S))throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard ":" segment will overwrite an existing wildcard segment at path: ${"/"+t.slice(0,a).join("/")}`)}else e=new S(i),n.wildcard=e;n=e}else{if("*"===i){if(n.wildcard)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard "*" segment already exists at path: ${"/"+t.slice(0,a).join("/")}`);if(n.wildcard=new _(i,e),a<r-1)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard segment must be the last segment`);return}{let t=n.children[i];t||(t=new k(i),n.children[i]=t),n=t}}}if(void 0!==n.value)throw new Error(`Failed to index path segments: ${t.join("/")}. A value already exists at path: ${"/"+t.join("/")}`);n.value=e}match(t){const e=d(t);if(0===e.length)return null;const n={};let a,r,i=this.tree;for(const t of e){const e=i.match(t,n);if(!e)return null;i=e}if(!i.value){if(i instanceof y&&i.wildcard instanceof _&&(i=i.wildcard.match("",n),!i.value))throw new Error("Wildcard segment node `*` must have a value");if(!i.value)return null}return n._&&n._.length>0?(a=e.slice(0,-n._.length),r=n._):a=e,{params:n,matchedSegments:a,remainingSegments:r,value:i.value}}}class y{name;value;children={};wildcard;constructor(t,e){this.name=t,this.value=e}match(t,e){let n=this.children[t];if(n)return n;if(this.wildcard){if(this.wildcard instanceof _)return this.wildcard.match(t,e);if(this.wildcard instanceof S)return e[this.wildcard.paramName]=t,this.wildcard;throw new Error("Unknown wildcard segment node type: "+this.wildcard.constructor.name)}return null}}class C extends y{constructor(){super("#root")}}class k extends y{constructor(t,e){super(t,e)}}class S extends y{paramName;constructor(t,e){super(t,e),this.paramName=t.substring(1)}}class _{name;value;constructor(t,e){this.name=t,this.value=e}match(t,e){return e._?t&&e._.push(t):e._=t?[t]:[],this}}class x{index;matcher=new L;constructor(t,e){this.index=e;for(const e of t)this.matcher.addPath(e.path,e)}match(t){const e=c(t)&&this.index;return this.matcher.match(e?this.index:t)}}class R extends x{prompt;observer;navigator=new P;constructor(t,e){super(t),this.navigator.addListener(t=>{if((!(t.isCancelable&&this.prompt&&this.prompt.when)||window.confirm(this.prompt.message))&&(this.observer&&this.observer(t),"afterChange"===t.name)){const n=this.match(t.location.pathname);n&&n.value?e({...n,state:t.state}):e(null)}})}getTopRouter(){return this}setStickyParams(t){this.navigator.stickyParams=null!=t?t:void 0}withObserver(t){return this.observer=t,this}start(){this.navigator.start(),this.navigator.firePageLoad()}stop(){this.navigator.stop()}navigate(t,e){this.navigator.navigate(t,e)}}class E extends x{parent;basePath;constructor(t,e,n){super(n),this.parent=t,this.basePath=e}getTopRouter(){return this.parent instanceof R?this.parent:this.parent.getTopRouter()}navigate(t,e){let n;if(e?.isBasePathNested??!0){const a=e?.basePath;n=a?l(this.basePath,a):this.basePath,this.parent.navigate(t,{...e,basePath:n})}else this.parent.navigate(t,{...e,basePath:e?.basePath})}}const N=r(void 0);function j(){const t=i(N);if(!t)throw new Error("useRouter must be used within a RouterProvider");return t}function U(){const{navigate:t}=j();return t}function A(){const{matchedRoutePath:t,router:e}=j();return e instanceof E?e.basePath:t}function B(t){const{params:e}=j();return t?e[t]:e}function W(){const{location:t}=j();return t}function $(t){a(()=>{const e=document.title;return document.title=t,()=>{document.title=e}},[t])}function O(t){const{router:e}=j();a(()=>(e.getTopRouter().prompt=t,()=>{e.getTopRouter().prompt=void 0}),[]),a(()=>{if(t.when){const e=t.when,n=function(t){e&&(t.preventDefault(),t.returnValue="")};return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}}},[t.when])}function T({children:e,to:n,onClick:a,replace:r=!0}){const i=U();return t("span",{onClick:t=>{const e=t.target.closest("a"),s=e?.getAttribute("href"),o=n??s;e&&o&&(t.stopPropagation(),t.preventDefault(),i(o,{replace:r}),a?.(t))},children:e})}function z({children:e,href:n,className:a,topLevelNav:r,clearBreadcrumbs:i=!1}){const{router:s}=j();return t("a",{href:n,className:a,onClick:t=>{t.stopPropagation(),t.preventDefault();(r?s.getTopRouter():s).navigate(n,{replace:i})},children:e})}function F({spinner:e}){const n=j(),a=n.route;if(a.Component){const e=a.Component;return t(e,{...n.params})}if(a.LazyComponent)return t(D,{route:a,spinner:e});throw new Error(`Invalid route for ${a.path}. Either Component or LazyCOmponent must be specified.`)}function D({route:e,spinner:n}){const[r,i]=s(null);return a(()=>{e.LazyComponent().then(t=>{if(!t.default)throw new Error(`Lazy module for ${e.path} does not have a default export`);i(()=>t.default)})},[e]),r?t(r,{}):n||null}function I({basePath:e,fixLinks:n=!1,children:a}){const r=j(),i=n?e=>t(b,{basePath:r.matchedRoutePath,children:e}):t=>t;return t(N.Provider,{value:{...r,navigate:(t,n)=>{if(!1===n?.isBasePathNested)return r.navigate(t,n);const a=n?.basePath?l(e,n.basePath):e;return r.navigate(t,{...n,basePath:a})}},children:i(a||t(F,{}))})}function H(){const t=j();return e("div",{children:["Route not found for path ",t.matchedRoutePath]})}function M(){return{params:{},matchedSegments:[],state:null,value:{path:"virtual:404",Component:()=>t(H,{})}}}function V({routes:e,index:n,children:r,fixLinks:i=!1}){const h=j(),[c,l]=s(void 0),u=o(()=>{if("undefined"==typeof window)return null;const t=h.matchedRoutePath,a=new E(h.router,t,e);return a.index=n,a},[]);a(()=>{if(u){if(h.matchedRoutePath!==u.basePath)return;const t=u.match(h.remainingPath||"/")||M();l(t)}},[u,h.remainingPath]);const d=i?e=>t(b,{basePath:h.matchedRoutePath,children:e}):t=>t;return c&&t(N.Provider,{value:{...h,router:u,route:c.value,params:c.params,matchedRoutePath:"/"+c.matchedSegments.join("/"),remainingPath:c.remainingSegments?"/"+c.remainingSegments.join("/"):void 0,navigate:(t,e)=>{if(u)return u.navigate(t,e)}},children:d(r||t(F,{}))})}function q({routes:e,index:n,onChange:a,children:r}){const[i,c]=s(void 0),l=o(()=>{if("undefined"==typeof window)return null;const t=new R(e,e=>{null===e&&(e=M()),c({location:window.location,route:e.value,params:e.params,state:e.state,router:t,matchedRoutePath:"/"+e.matchedSegments.join("/"),remainingPath:e.remainingSegments?"/"+e.remainingSegments.join("/"):void 0,navigate:(e,n)=>t.navigate(e,n)})}).withObserver(a);return t.index=n,t},[]);return h(()=>(l&&l.start(),()=>{l&&l.stop()}),[]),i&&t(N.Provider,{value:i,children:r||t(F,{})})}export{v as AfterLocationChangeEvent,f as BASE_PATH,x as BaseRouter,w as BeforeLocationChangeEvent,b as FixLinks,P as HistoryNavigator,g as LocationChangeEvent,T as Nav,z as NavLink,I as NestedNavigationContext,E as NestedRouter,V as NestedRouterProvider,p as Path,L as PathMatcher,N as ReactRouterContext,F as RouteComponent,R as Router,q as RouterProvider,W as useLocation,U as useNavigate,O as useNavigationPrompt,$ as usePageTitle,B as useParams,A as useRouterBasePath,j as useRouterContext};
2
2
  //# sourceMappingURL=vertesia-ui-router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vertesia-ui-router.js","sources":["esm/router/path.js","esm/router/PathWithParams.js","esm/router/HistoryNavigator.js","esm/router/FixLinks.js","esm/router/PathMatcher.js","esm/router/Router.js","esm/router/Nav.js","esm/router/RouteComponent.js","esm/router/NestedNavigationContext.js","esm/router/Route404.js","esm/router/NestedRouterProvider.js","esm/router/RouterProvider.js"],"sourcesContent":["export function isRootPath(path) {\n return path === '/' || path === '';\n}\nexport function joinPath(path1, path2) {\n if (path1.endsWith('/') && path2.startsWith('/')) {\n path2 = path1 + path2.substring(1);\n }\n else if (path1.endsWith('/')) {\n path2 = path1 + path2;\n }\n else if (path2.startsWith('/')) {\n path2 = path1 + path2;\n }\n else {\n path2 = path1 + '/' + path2;\n }\n return path2;\n}\nexport function getPathSegments(path) {\n if (path === '') {\n return [];\n }\n if (path === '/') {\n return [''];\n }\n let s = 0, e = path.length;\n if (path.startsWith('./')) {\n s = 2;\n }\n else if (path.startsWith('/')) {\n s = 1;\n }\n if (path.endsWith('/')) {\n e = path.length - 1;\n }\n return (s > 0 || e < path.length ? path.substring(s, e) : path).split('/');\n}\nexport function toSegments(path) {\n if (typeof path === 'string') {\n return getPathSegments(path);\n }\n else if (Array.isArray(path)) {\n return path;\n }\n else {\n throw new Error(`Unsupported path object: ${path}`);\n }\n}\n// export class Path {\n// static parse(path: string, abs = false) {\n// if (abs !== undefined) {\n// abs = path.startsWith('/');\n// }\n// return new Path(getPathSegments(path), abs);\n// }\n// constructor(public segments: string[], public isAbsolute = false) {\n// }\n// getParameters() {\n// const out = [];\n// for (const segment of this.segments) {\n// if (segment[0] === ':') {\n// out.push(segment.substring(1));\n// }\n// }\n// if (this.segments[this.segments.length - 1] === '*') {\n// out.push('_');\n// }\n// return out;\n// }\n// resolveParameters(path: string) {\n// const params: PathMatchParams = {};\n// const resolvedSegments = getPathSegments(path);\n// if (resolvedSegments.length < this.segments.length) {\n// return null;\n// }\n// const segments = this.segments;\n// for (let i = 0, l = segments.length; i < l; i++) {\n// const seg = segments[i];\n// if (seg[0] === ':') {\n// params[seg.substring(1)] = resolvedSegments[i];\n// }\n// }\n// if (resolvedSegments.length - this.segments.length) {\n// params._ = resolvedSegments.slice(this.segments.length);\n// }\n// return params;\n// }\n// match(path: string | string[] | Path) {\n// const segments = toSegments(path);\n// if (segments.length < this.segments.length) {\n// return false;\n// }\n// let params: PathMatchParams | undefined;\n// const mySegments = this.segments;\n// for (let i = 0, l = mySegments.length; i < l; i++) {\n// const segment = mySegments[i];\n// if (segment === ':') {\n// if (!params) params = {};\n// params[segment.substring(1)] = segment;\n// } else if (segment !== segments[i]) {\n// if (i === l - 1 && segment === '*') {\n// if (!params) params = {};\n// params._ = segments.slice(i);\n// return params;\n// }\n// return false;\n// }\n// }\n// return params ? params : false;\n// }\n// join(path: Path | string | string[]) {\n// const segments = toSegments(path);\n// return new Path(this.segments.concat(segments), this.isAbsolute);\n// }\n// getRelativePath(path: Path | string | string[], asAbsolute: boolean = false) {\n// const segments = toSegments(path);\n// const extraSegmentsCount = segments.length - this.segments.length;\n// if (extraSegmentsCount <= 0) {\n// return null;\n// }\n// return new Path(segments.slice(this.segments.length), asAbsolute);\n// }\n// prependSegments(segments: string[]) {\n// this.segments = segments.concat(this.segments);\n// }\n// appendSegments(segments: string[]) {\n// this.segments = this.segments.concat(segments);\n// }\n// toAbsolutePath() {\n// return '/' + this.segments.join('/');\n// }\n// toRelativePath() {\n// return this.segments.join('/');\n// }\n// toString() {\n// const path = this.segments.join('/');\n// return this.isAbsolute ? '/' + path : path;\n// }\n// }\n//# sourceMappingURL=path.js.map","export class PathWithParams {\n path;\n params;\n hash;\n constructor(path) {\n let i = path.lastIndexOf('#');\n if (i > -1) {\n this.hash = path.substring(i);\n path = path.substring(0, i);\n }\n else {\n this.hash = '';\n }\n i = path.indexOf('?');\n if (i > -1) {\n this.path = path.substring(0, i);\n this.params = new URLSearchParams(path.substring(i + 1));\n }\n else {\n this.path = path;\n this.params = new URLSearchParams();\n }\n }\n add(params) {\n for (const [key, value] of Object.entries(params)) {\n this.params.set(key, value);\n }\n return this;\n }\n toString() {\n return this.path + '?' + this.params.toString() + this.hash;\n }\n}\n//# sourceMappingURL=PathWithParams.js.map","import { joinPath } from \"./path\";\nimport { PathWithParams } from \"./PathWithParams\";\nconst BASE_PATH = Symbol('BASE_PATH');\nexport { BASE_PATH };\nexport class LocationChangeEvent {\n name;\n type;\n location;\n state;\n _canceled = false;\n constructor(name, type, location, state) {\n this.name = name;\n this.type = type;\n this.location = location;\n this.state = state;\n }\n get isPageLoad() {\n return this.type === 'initial';\n }\n get isBackForward() {\n return this.type === 'popState';\n }\n get isLinkClick() {\n return this.type === 'linkClick';\n }\n get isNavigation() {\n return this.type === 'navigate';\n }\n get isCancelable() {\n return this.name === 'beforeChange';\n }\n cancel() {\n if (this.name === 'afterChange') {\n throw new Error('Cannot cancel afterChange event');\n }\n this._canceled = true;\n }\n}\nexport class BeforeLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('beforeChange', type, location, state);\n }\n}\nexport class AfterLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('afterChange', type, location, state);\n }\n}\nfunction getElementHrefAsUrl(elem) {\n if (elem && elem.tagName.toLowerCase() === 'a') {\n const href = elem?.href.trim();\n if (typeof href === 'string' && href.length > 0) {\n return new URL(href);\n }\n }\n return null;\n}\nexport class HistoryNavigator {\n // params to preserve in the query string when navigating\n stickyParams;\n _popStateListener;\n _linkNavListener;\n _listeners = [];\n constructor() {\n }\n addListener(listener) {\n this._listeners.push(listener);\n }\n fireLocationChange(event) {\n for (const listener of this._listeners) {\n listener(event);\n }\n }\n /**\n * Should be called when the page is first loaded.\n * It will fire a location change event with type `initial` and the current window.location as the location\n */\n firePageLoad() {\n this.fireLocationChange(new AfterLocationChangeEvent('initial', new URL(window.location.href)));\n }\n addStickyParams(path) {\n if (this.stickyParams) {\n return new PathWithParams(path).add(this.stickyParams).toString();\n }\n return path;\n }\n navigate(to, options = {}) {\n if (options.stepsBack && options.stepsBack > 0) {\n this.stepBack(options.stepsBack, options);\n return;\n }\n if (options.basePath) {\n let basePath = options.basePath;\n if (!basePath.startsWith('/')) {\n basePath = '/' + basePath;\n }\n to = joinPath(basePath, to);\n }\n to = this.addStickyParams(to);\n this._navigate(new URL(to, window.location.href), 'navigate', options);\n }\n stepBack(steps, options = {}) {\n const historyChain = window.history.state.historyChain || [];\n const to = historyChain.length >= steps\n ? new URL(historyChain[historyChain.length - steps].href, window.location.href)\n : new URL(window.location.origin, window.location.href);\n this._navigate(to, 'popState', options);\n const stateToStore = {\n from: window.location.href,\n historyChain: historyChain.slice(0, -steps),\n data: options.state || undefined,\n title: options.title || document.title\n };\n window.history['replaceState'](stateToStore, '', to.href);\n this.fireLocationChange(new AfterLocationChangeEvent('popState', to, options.state));\n }\n _navigate(to, type, options) {\n const beforeEvent = new BeforeLocationChangeEvent(type, to, options.state);\n this.fireLocationChange(beforeEvent);\n if (beforeEvent._canceled) {\n return;\n }\n // Build navigation chain by preserving previous history\n const currentState = window.history.state;\n const currentTitle = options.title || document.title;\n // Create new history chain entry\n const newChainEntry = {\n title: currentTitle,\n href: window.location.pathname + window.location.search + window.location.hash\n };\n // Build the history chain - clear if using replace\n let historyChain = [];\n if (!options.replace && currentState?.historyChain) {\n historyChain = [...currentState.historyChain];\n }\n // Only add to chain if not replacing\n if (!options.replace) {\n historyChain.push(newChainEntry);\n // Limit chain length to prevent memory issues (keep last 10 entries)\n if (historyChain.length > 10) {\n historyChain = historyChain.slice(-10);\n }\n }\n const stateToStore = {\n from: window.location.href,\n historyChain: historyChain,\n data: options.state || undefined,\n title: options.title || document.title\n };\n window.history[options.replace ? 'replaceState' : 'pushState'](stateToStore, '', to.href);\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, options.state));\n }\n start() {\n if (typeof window === \"undefined\") {\n return;\n }\n const _popStateListener = (ev) => {\n let type = ev.state ? 'popState' : 'linkClick';\n const to = new URL(window.location.href);\n let state = undefined;\n if (ev.state) {\n type = 'popState';\n state = ev.state.data;\n }\n else {\n type = 'linkClick';\n }\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, state));\n };\n const _linkNavListener = (ev) => {\n const target = ev.target;\n // Skip anchors with download attribute or blob: URLs - they are file downloads, not navigation\n if (target.tagName.toLowerCase() === 'a' && (target.hasAttribute('download') ||\n target.href?.startsWith('blob:'))) {\n return;\n }\n const url = getElementHrefAsUrl(target);\n if (url && url.origin === window.location.origin) {\n ev.preventDefault();\n const to = new URL(this.addStickyParams(url.href));\n const basePath = ev[BASE_PATH] || ev.target[BASE_PATH];\n if (basePath) {\n to.pathname = joinPath(basePath, to.pathname);\n }\n this._navigate(to, 'linkClick', {});\n }\n };\n this._popStateListener = _popStateListener;\n this._linkNavListener = _linkNavListener;\n window.addEventListener('popstate', _popStateListener);\n document.body.addEventListener('click', this._linkNavListener);\n }\n stop() {\n this._popStateListener && window.removeEventListener('popstate', this._popStateListener);\n this._linkNavListener && document.body.removeEventListener('click', this._linkNavListener);\n }\n}\n//# sourceMappingURL=HistoryNavigator.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useRef } from \"react\";\nimport { BASE_PATH } from \"./HistoryNavigator\";\nexport function FixLinks({ basePath, children }) {\n const ref = useRef(null);\n useEffect(() => {\n if (ref.current) {\n const divElem = ref.current;\n const listener = (ev) => {\n const elem = ev.target;\n if (elem.tagName.toLowerCase() === 'a') {\n ev[BASE_PATH] = basePath;\n }\n };\n divElem.addEventListener('click', listener);\n return () => {\n divElem.removeEventListener('click', listener);\n };\n }\n }, [ref.current]);\n return (_jsx(\"div\", { ref: ref, className: \"h-full w-full\", children: children }));\n}\n//# sourceMappingURL=FixLinks.js.map","import { getPathSegments, toSegments } from \"./path\";\n/**\n * Path matcher which support :param and *wildcard segments.\n * The wildcard segment is only supported as the last segment\n */\nexport class PathMatcher {\n tree = new RootSegmentNode();\n loadMapping(mapping) {\n for (const [key, value] of Object.entries(mapping)) {\n this.addSegments(getPathSegments(key), value);\n }\n }\n addPath(path, value) {\n this.addSegments(getPathSegments(path), value);\n }\n addSegments(segments, value) {\n let node = this.tree;\n for (let i = 0, l = segments.length; i < l; i++) {\n const segment = segments[i];\n if (segment[0] === ':') {\n let childNode = node.wildcard;\n if (!childNode) {\n childNode = new VariableSegmentNode(segment);\n node.wildcard = childNode;\n }\n else if (!(childNode instanceof VariableSegmentNode)) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \":\" segment will overwrite an existing wildcard segment at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node = childNode;\n }\n else if (segment === '*') {\n if (node.wildcard) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \"*\" segment already exists at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node.wildcard = new WildcardSegmentNode(segment, value);\n if (i < l - 1) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard segment must be the last segment`);\n }\n return;\n }\n else {\n let childNode = node.children[segment];\n if (!childNode) {\n childNode = new LiteralSegmentNode(segment);\n node.children[segment] = childNode;\n } // else // a literal segment already exists\n node = childNode;\n }\n }\n if (node.value !== undefined) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A value already exists at path: ${'/' + segments.join(\"/\")}`);\n }\n node.value = value;\n }\n match(path) {\n const segments = toSegments(path);\n if (segments.length === 0) {\n return null;\n }\n const params = {};\n let node = this.tree;\n for (const segment of segments) {\n const match = node.match(segment, params);\n if (match) {\n node = match;\n }\n else {\n return null;\n }\n }\n if (!node.value) { // not a leaf node (partial match)\n if (node instanceof ParentSegmentNode) {\n if (node.wildcard instanceof WildcardSegmentNode) {\n node = node.wildcard.match('', params);\n if (!node.value) {\n throw new Error(\"Wildcard segment node `*` must have a value\");\n }\n }\n }\n if (!node.value)\n return null; // not a leaf node, neither a trailing wildcard (partial match)\n }\n let matchedSegments, remainingSegments;\n if (params._ && params._.length > 0) {\n matchedSegments = segments.slice(0, -params._.length);\n remainingSegments = params._;\n }\n else {\n matchedSegments = segments;\n }\n return { params, matchedSegments, remainingSegments, value: node.value };\n }\n}\nclass ParentSegmentNode {\n name;\n value;\n children = {};\n wildcard;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n let node = this.children[segment];\n if (node) {\n return node;\n }\n else if (this.wildcard) {\n if (this.wildcard instanceof WildcardSegmentNode) {\n return this.wildcard.match(segment, params);\n }\n else if (this.wildcard instanceof VariableSegmentNode) {\n params[this.wildcard.paramName] = segment;\n return this.wildcard;\n }\n else {\n throw new Error(\"Unknown wildcard segment node type: \" + this.wildcard.constructor.name);\n }\n }\n else {\n return null;\n }\n }\n}\nclass RootSegmentNode extends ParentSegmentNode {\n constructor() {\n super(\"#root\");\n }\n}\nclass LiteralSegmentNode extends ParentSegmentNode {\n constructor(name, value) {\n super(name, value);\n }\n}\nclass VariableSegmentNode extends ParentSegmentNode {\n paramName;\n constructor(name, value) {\n super(name, value);\n this.paramName = name.substring(1);\n }\n}\nclass WildcardSegmentNode {\n name;\n value;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n if (!params._) {\n params._ = segment ? [segment] : [];\n }\n else {\n segment && params._.push(segment);\n }\n return this;\n }\n}\n//# sourceMappingURL=PathMatcher.js.map","import { createContext, useContext, useEffect } from \"react\";\nimport { HistoryNavigator } from \"./HistoryNavigator\";\nimport { PathMatcher } from \"./PathMatcher\";\nimport { isRootPath, joinPath } from \"./path\";\nexport class BaseRouter {\n // the path to use when navigating to the root of the router\n index;\n matcher = new PathMatcher();\n constructor(routes, index) {\n this.index = index;\n for (const route of routes) {\n this.matcher.addPath(route.path, route);\n }\n }\n match(path) {\n const useIndex = isRootPath(path) && this.index;\n return this.matcher.match(useIndex ? this.index : path);\n }\n}\nexport class Router extends BaseRouter {\n prompt;\n observer;\n navigator = new HistoryNavigator();\n constructor(routes, updateState) {\n super(routes);\n this.navigator.addListener((event) => {\n if (event.isCancelable && this.prompt && !!this.prompt.when) {\n if (!window.confirm(this.prompt.message))\n return;\n }\n if (this.observer) {\n this.observer(event);\n }\n // only process afterChange events\n if (event.name === \"afterChange\") {\n const match = this.match(event.location.pathname);\n if (match && match.value) {\n updateState({\n ...match,\n state: event.state,\n });\n }\n else {\n updateState(null);\n }\n }\n });\n }\n getTopRouter() {\n return this;\n }\n /**\n * Subsequent navigations will preserve the given params in the query string.\n * Use null to clear the sticky params.\n * @param params\n */\n setStickyParams(params) {\n this.navigator.stickyParams = params != null ? params : undefined;\n }\n withObserver(observer) {\n this.observer = observer;\n return this;\n }\n start() {\n this.navigator.start();\n // initialize with the current location\n this.navigator.firePageLoad();\n }\n stop() {\n this.navigator.stop();\n }\n navigate(path, options) {\n this.navigator.navigate(path, options);\n }\n}\nexport class NestedRouter extends BaseRouter {\n parent;\n basePath;\n constructor(parent, basePath, routes) {\n super(routes);\n this.parent = parent;\n this.basePath = basePath;\n }\n getTopRouter() {\n if (this.parent instanceof Router) {\n return this.parent;\n }\n else {\n return this.parent.getTopRouter();\n }\n }\n navigate(path, options) {\n // base path is nested by default in a NestedRouter unless explicitly set to false by caller\n const isBasePathNested = options?.isBasePathNested ?? true;\n let basePath;\n if (isBasePathNested) {\n const childBasePath = options?.basePath;\n // e.g. \"/store\" + \"/objects/123\" => \"/store/objects/123\"\n basePath = childBasePath ? joinPath(this.basePath, childBasePath) : this.basePath;\n }\n else {\n // e.g. \"/store\" + \"/studio\" => \"/studio\"\n basePath = options?.basePath ?? this.basePath;\n }\n this.parent.navigate(path, {\n ...options,\n basePath,\n });\n }\n}\nconst ReactRouterContext = createContext(undefined);\nexport { ReactRouterContext };\nexport function useRouterContext() {\n const ctx = useContext(ReactRouterContext);\n if (!ctx) {\n throw new Error(\"useRouter must be used within a RouterProvider\");\n }\n return ctx;\n}\nexport function useNavigate() {\n const { navigate } = useRouterContext();\n return navigate;\n}\nexport function useParams(arg) {\n const { params } = useRouterContext();\n if (arg) {\n return params[arg];\n }\n else {\n return params;\n }\n}\nexport function useLocation() {\n const { location } = useRouterContext();\n return location;\n}\nexport function useNavigationPrompt(prompt) {\n const { router } = useRouterContext();\n useEffect(() => {\n router.getTopRouter().prompt = prompt;\n return () => {\n router.getTopRouter().prompt = undefined;\n };\n }, []);\n useEffect(() => {\n if (prompt.when) {\n const doBlock = prompt.when;\n const listener = function (ev) {\n if (doBlock) {\n ev.preventDefault();\n ev.returnValue = \"\";\n }\n };\n window.addEventListener(\"beforeunload\", listener);\n return () => {\n window.removeEventListener(\"beforeunload\", listener);\n };\n }\n }, [prompt.when]);\n}\n//# sourceMappingURL=Router.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useNavigate, useRouterContext } from \"./Router\";\nexport function Nav({ children, onClick, replace = true }) {\n const navigate = useNavigate();\n const _onClick = (ev) => {\n const link = ev.target.closest('a');\n if (link && link.href) {\n ev.stopPropagation();\n ev.preventDefault();\n navigate(link.href, { replace });\n onClick?.(ev);\n }\n };\n return (_jsx(\"span\", { onClick: _onClick, children: children }));\n}\nexport function NavLink({ children, href, className, topLevelNav, clearBreadcrumbs = false }) {\n const { router } = useRouterContext();\n const _onClick = (ev) => {\n ev.stopPropagation();\n ev.preventDefault();\n const actualRouter = topLevelNav ? router.getTopRouter() : router;\n actualRouter.navigate(href, { replace: clearBreadcrumbs });\n };\n return (_jsx(\"a\", { href: href, className: className, onClick: _onClick, children: children }));\n}\n//# sourceMappingURL=Nav.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useState } from \"react\";\nimport { useRouterContext } from \"./Router\";\nexport function RouteComponent({ spinner }) {\n const ctx = useRouterContext();\n const route = ctx.route;\n if (route.Component) {\n const Component = route.Component;\n return _jsx(Component, { ...ctx.params });\n }\n else if (route.LazyComponent) {\n return _jsx(LazyRouteComponent, { route: route, spinner: spinner });\n }\n else {\n throw new Error(`Invalid route for ${route.path}. Either Component or LazyCOmponent must be specified.`);\n }\n}\nfunction LazyRouteComponent({ route, spinner }) {\n const [Component, setComponent] = useState(null);\n useEffect(() => {\n route.LazyComponent().then(module => {\n if (!module.default) {\n throw new Error(`Lazy module for ${route.path} does not have a default export`);\n }\n // we need to wrap the component type in an arrow function\n // otherwise the setState function will execute the function as a state update function\n setComponent(() => module.default);\n });\n }, [route]);\n return Component ? (_jsx(Component, {})) : spinner || null;\n}\n//# sourceMappingURL=RouteComponent.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { FixLinks } from \"./FixLinks\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, useRouterContext } from \"./Router\";\nimport { joinPath } from \"./path\";\nexport function NestedNavigationContext({ basePath, fixLinks = false, children }) {\n const ctx = useRouterContext();\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n navigate: (to, options) => {\n const actualBasePath = options?.basePath ? joinPath(basePath, options.basePath) : basePath;\n return ctx.navigate(to, { ...options, basePath: actualBasePath });\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedNavigationContext.js.map","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouterContext } from \"./Router\";\nexport function Route404Component() {\n const ctx = useRouterContext();\n return _jsxs(\"div\", { children: [\"Route not found for path \", ctx.matchedRoutePath] });\n}\nexport function createRoute404() {\n return {\n params: {},\n matchedSegments: [],\n state: null,\n value: {\n path: 'virtual:404',\n Component: () => _jsx(Route404Component, {})\n }\n };\n}\n//# sourceMappingURL=Route404.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { FixLinks } from \"./FixLinks\";\nimport { createRoute404 } from \"./Route404\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { NestedRouter, ReactRouterContext, useRouterContext } from \"./Router\";\nexport function NestedRouterProvider({ routes, index, children, fixLinks = false }) {\n const ctx = useRouterContext();\n const [nestedRouteMatch, setNestedRouteMatch] = useState(undefined);\n const nestedRouter = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const basePath = ctx.matchedRoutePath;\n const nestedRouter = new NestedRouter(ctx.router, basePath, routes);\n nestedRouter.index = index;\n return nestedRouter;\n }, []);\n useEffect(() => {\n if (nestedRouter) {\n if (ctx.matchedRoutePath !== nestedRouter.basePath) {\n // the change doesn't belong to this nested router\n // it should be handled by the top level router which will change the page or the nested router\n return;\n }\n const route = nestedRouter.match(ctx.remainingPath || '/') || createRoute404();\n setNestedRouteMatch(route);\n }\n }, [nestedRouter, ctx.remainingPath]);\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return nestedRouteMatch && (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n router: nestedRouter,\n route: nestedRouteMatch.value,\n params: nestedRouteMatch.params,\n matchedRoutePath: '/' + nestedRouteMatch.matchedSegments.join('/'),\n remainingPath: nestedRouteMatch.remainingSegments ? '/' + nestedRouteMatch.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return nestedRouter.navigate(to, options);\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedRouterProvider.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useSafeLayoutEffect } from \"@vertesia/ui/core\";\n//import { useSafeLayoutEffect } from \"../core\";\nimport { useMemo, useState } from \"react\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, Router } from \"./Router\";\nimport { createRoute404 } from \"./Route404\";\nexport function RouterProvider({ routes, index, onChange, children }) {\n const [state, setState] = useState(undefined);\n const router = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const router = new Router(routes, (match) => {\n if (match === null) {\n match = createRoute404();\n }\n setState({\n location: window.location,\n route: match.value,\n params: match.params,\n state: match.state,\n router: router,\n matchedRoutePath: '/' + match.matchedSegments.join('/'),\n remainingPath: match.remainingSegments ? '/' + match.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return router.navigate(to, options);\n }\n });\n }).withObserver(onChange);\n router.index = index;\n return router;\n }, []);\n useSafeLayoutEffect(() => {\n router && router.start();\n return () => {\n router && router.stop();\n };\n }, []);\n return state && (_jsx(ReactRouterContext.Provider, { value: state, children: children ? children : _jsx(RouteComponent, {}) }));\n}\n//# sourceMappingURL=RouterProvider.js.map"],"names":["isRootPath","path","joinPath","path1","path2","endsWith","startsWith","substring","getPathSegments","s","e","length","split","toSegments","Array","isArray","Error","PathWithParams","params","hash","constructor","i","lastIndexOf","this","indexOf","URLSearchParams","add","key","value","Object","entries","set","toString","BASE_PATH","Symbol","LocationChangeEvent","name","type","location","state","_canceled","isPageLoad","isBackForward","isLinkClick","isNavigation","isCancelable","cancel","BeforeLocationChangeEvent","super","AfterLocationChangeEvent","HistoryNavigator","stickyParams","_popStateListener","_linkNavListener","_listeners","addListener","listener","push","fireLocationChange","event","firePageLoad","URL","window","href","addStickyParams","navigate","to","options","stepsBack","stepBack","basePath","_navigate","steps","historyChain","history","origin","stateToStore","from","slice","data","undefined","title","document","beforeEvent","currentState","newChainEntry","pathname","search","replace","start","ev","target","tagName","toLowerCase","hasAttribute","url","elem","trim","getElementHrefAsUrl","preventDefault","addEventListener","body","stop","removeEventListener","FixLinks","children","ref","useRef","useEffect","current","divElem","_jsx","className","PathMatcher","tree","RootSegmentNode","loadMapping","mapping","addSegments","addPath","segments","node","l","segment","childNode","wildcard","VariableSegmentNode","join","WildcardSegmentNode","LiteralSegmentNode","match","matchedSegments","remainingSegments","ParentSegmentNode","_","paramName","BaseRouter","index","matcher","routes","route","useIndex","Router","prompt","observer","navigator","updateState","when","confirm","message","getTopRouter","setStickyParams","withObserver","NestedRouter","parent","isBasePathNested","childBasePath","ReactRouterContext","createContext","useRouterContext","ctx","useContext","useNavigate","useParams","arg","useLocation","useNavigationPrompt","router","doBlock","returnValue","Nav","onClick","link","closest","stopPropagation","NavLink","topLevelNav","clearBreadcrumbs","RouteComponent","spinner","Component","LazyComponent","LazyRouteComponent","setComponent","useState","then","module","default","NestedNavigationContext","fixLinks","wrapWithFixLinks","matchedRoutePath","Provider","actualBasePath","Route404Component","_jsxs","createRoute404","NestedRouterProvider","nestedRouteMatch","setNestedRouteMatch","nestedRouter","useMemo","remainingPath","RouterProvider","onChange","setState","useSafeLayoutEffect"],"mappings":"sNAAO,SAASA,EAAWC,GACvB,MAAgB,MAATA,GAAyB,KAATA,CAC3B,CACO,SAASC,EAASC,EAAOC,GAa5B,OAXIA,EADAD,EAAME,SAAS,MAAQD,EAAME,WAAW,KAChCH,EAAQC,EAAMG,UAAU,GAE3BJ,EAAME,SAAS,MAGfD,EAAME,WAAW,KAFdH,EAAQC,EAMRD,EAAQ,IAAMC,CAG9B,CACO,SAASI,EAAgBP,GAC5B,GAAa,KAATA,EACA,MAAO,GAEX,GAAa,MAATA,EACA,MAAO,CAAC,IAEZ,IAAIQ,EAAI,EAAGC,EAAIT,EAAKU,OAUpB,OATIV,EAAKK,WAAW,MAChBG,EAAI,EAECR,EAAKK,WAAW,OACrBG,EAAI,GAEJR,EAAKI,SAAS,OACdK,EAAIT,EAAKU,OAAS,IAEdF,EAAI,GAAKC,EAAIT,EAAKU,OAASV,EAAKM,UAAUE,EAAGC,GAAKT,GAAMW,MAAM,IAC1E,CACO,SAASC,EAAWZ,GACvB,GAAoB,iBAATA,EACP,OAAOO,EAAgBP,GAEtB,GAAIa,MAAMC,QAAQd,GACnB,OAAOA,EAGP,MAAM,IAAIe,MAAM,4BAA4Bf,IAEpD,8FC/CO,MAAMgB,EACThB,KACAiB,OACAC,KACA,WAAAC,CAAYnB,GACR,IAAIoB,EAAIpB,EAAKqB,YAAY,KACrBD,GAAI,GACJE,KAAKJ,KAAOlB,EAAKM,UAAUc,GAC3BpB,EAAOA,EAAKM,U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B,OAAOxB,SACjBsG,MAAOV,EAAMtG,MACbV,OAAQgH,EAAMhH,OACdqB,MAAO2F,EAAM3F,MACbgI,OAAQA,EACRwB,iBAAkB,IAAM7D,EAAMC,gBAAgBJ,KAAK,KACnD2E,cAAexE,EAAME,kBAAoB,IAAMF,EAAME,kBAAkBL,KAAK,UAAO/C,EACnFf,SAAU,CAACC,EAAIC,IACJoG,EAAOtG,SAASC,EAAIC,OAGpCqF,aAAaoD,GAEhB,OADArC,EAAO9B,MAAQA,EACR8B,GACR,IAOH,OANAuC,EAAoB,KAChBvC,GAAUA,EAAO9E,QACV,KACH8E,GAAUA,EAAOjE,SAEtB,IACI/D,GAAUwE,EAAK8C,EAAmBmC,SAAU,CAAEpK,MAAOW,EAAOkE,SAAUA,GAAsBM,EAAKmE,EAAgB,CAAA,IAC5H"}
1
+ {"version":3,"file":"vertesia-ui-router.js","sources":["esm/router/path.js","esm/router/PathWithParams.js","esm/router/HistoryNavigator.js","esm/router/FixLinks.js","esm/router/PathMatcher.js","esm/router/Router.js","esm/router/Nav.js","esm/router/RouteComponent.js","esm/router/NestedNavigationContext.js","esm/router/Route404.js","esm/router/NestedRouterProvider.js","esm/router/RouterProvider.js"],"sourcesContent":["export function isRootPath(path) {\n return path === '/' || path === '';\n}\nexport function joinPath(path1, path2) {\n if (path1.endsWith('/') && path2.startsWith('/')) {\n path2 = path1 + path2.substring(1);\n }\n else if (path1.endsWith('/')) {\n path2 = path1 + path2;\n }\n else if (path2.startsWith('/')) {\n path2 = path1 + path2;\n }\n else {\n path2 = path1 + '/' + path2;\n }\n return path2;\n}\nexport function getPathSegments(path) {\n if (path === '') {\n return [];\n }\n if (path === '/') {\n return [''];\n }\n let s = 0, e = path.length;\n if (path.startsWith('./')) {\n s = 2;\n }\n else if (path.startsWith('/')) {\n s = 1;\n }\n if (path.endsWith('/')) {\n e = path.length - 1;\n }\n return (s > 0 || e < path.length ? path.substring(s, e) : path).split('/');\n}\nexport function toSegments(path) {\n if (typeof path === 'string') {\n return getPathSegments(path);\n }\n else if (Array.isArray(path)) {\n return path;\n }\n else {\n throw new Error(`Unsupported path object: ${path}`);\n }\n}\n// export class Path {\n// static parse(path: string, abs = false) {\n// if (abs !== undefined) {\n// abs = path.startsWith('/');\n// }\n// return new Path(getPathSegments(path), abs);\n// }\n// constructor(public segments: string[], public isAbsolute = false) {\n// }\n// getParameters() {\n// const out = [];\n// for (const segment of this.segments) {\n// if (segment[0] === ':') {\n// out.push(segment.substring(1));\n// }\n// }\n// if (this.segments[this.segments.length - 1] === '*') {\n// out.push('_');\n// }\n// return out;\n// }\n// resolveParameters(path: string) {\n// const params: PathMatchParams = {};\n// const resolvedSegments = getPathSegments(path);\n// if (resolvedSegments.length < this.segments.length) {\n// return null;\n// }\n// const segments = this.segments;\n// for (let i = 0, l = segments.length; i < l; i++) {\n// const seg = segments[i];\n// if (seg[0] === ':') {\n// params[seg.substring(1)] = resolvedSegments[i];\n// }\n// }\n// if (resolvedSegments.length - this.segments.length) {\n// params._ = resolvedSegments.slice(this.segments.length);\n// }\n// return params;\n// }\n// match(path: string | string[] | Path) {\n// const segments = toSegments(path);\n// if (segments.length < this.segments.length) {\n// return false;\n// }\n// let params: PathMatchParams | undefined;\n// const mySegments = this.segments;\n// for (let i = 0, l = mySegments.length; i < l; i++) {\n// const segment = mySegments[i];\n// if (segment === ':') {\n// if (!params) params = {};\n// params[segment.substring(1)] = segment;\n// } else if (segment !== segments[i]) {\n// if (i === l - 1 && segment === '*') {\n// if (!params) params = {};\n// params._ = segments.slice(i);\n// return params;\n// }\n// return false;\n// }\n// }\n// return params ? params : false;\n// }\n// join(path: Path | string | string[]) {\n// const segments = toSegments(path);\n// return new Path(this.segments.concat(segments), this.isAbsolute);\n// }\n// getRelativePath(path: Path | string | string[], asAbsolute: boolean = false) {\n// const segments = toSegments(path);\n// const extraSegmentsCount = segments.length - this.segments.length;\n// if (extraSegmentsCount <= 0) {\n// return null;\n// }\n// return new Path(segments.slice(this.segments.length), asAbsolute);\n// }\n// prependSegments(segments: string[]) {\n// this.segments = segments.concat(this.segments);\n// }\n// appendSegments(segments: string[]) {\n// this.segments = this.segments.concat(segments);\n// }\n// toAbsolutePath() {\n// return '/' + this.segments.join('/');\n// }\n// toRelativePath() {\n// return this.segments.join('/');\n// }\n// toString() {\n// const path = this.segments.join('/');\n// return this.isAbsolute ? '/' + path : path;\n// }\n// }\n//# sourceMappingURL=path.js.map","export class PathWithParams {\n path;\n params;\n hash;\n constructor(path) {\n let i = path.lastIndexOf('#');\n if (i > -1) {\n this.hash = path.substring(i);\n path = path.substring(0, i);\n }\n else {\n this.hash = '';\n }\n i = path.indexOf('?');\n if (i > -1) {\n this.path = path.substring(0, i);\n this.params = new URLSearchParams(path.substring(i + 1));\n }\n else {\n this.path = path;\n this.params = new URLSearchParams();\n }\n }\n add(params) {\n for (const [key, value] of Object.entries(params)) {\n this.params.set(key, value);\n }\n return this;\n }\n toString() {\n return this.path + '?' + this.params.toString() + this.hash;\n }\n}\n//# sourceMappingURL=PathWithParams.js.map","import { joinPath } from \"./path\";\nimport { PathWithParams } from \"./PathWithParams\";\nconst BASE_PATH = Symbol('BASE_PATH');\nexport { BASE_PATH };\nexport class LocationChangeEvent {\n name;\n type;\n location;\n state;\n _canceled = false;\n constructor(name, type, location, state) {\n this.name = name;\n this.type = type;\n this.location = location;\n this.state = state;\n }\n get isPageLoad() {\n return this.type === 'initial';\n }\n get isBackForward() {\n return this.type === 'popState';\n }\n get isLinkClick() {\n return this.type === 'linkClick';\n }\n get isNavigation() {\n return this.type === 'navigate';\n }\n get isCancelable() {\n return this.name === 'beforeChange';\n }\n cancel() {\n if (this.name === 'afterChange') {\n throw new Error('Cannot cancel afterChange event');\n }\n this._canceled = true;\n }\n}\nexport class BeforeLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('beforeChange', type, location, state);\n }\n}\nexport class AfterLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('afterChange', type, location, state);\n }\n}\nfunction getElementHrefAsUrl(elem) {\n if (elem && elem.tagName.toLowerCase() === 'a') {\n const href = elem?.href.trim();\n if (typeof href === 'string' && href.length > 0) {\n return new URL(href);\n }\n }\n return null;\n}\nexport class HistoryNavigator {\n // params to preserve in the query string when navigating\n stickyParams;\n _popStateListener;\n _linkNavListener;\n _listeners = [];\n constructor() {\n }\n addListener(listener) {\n this._listeners.push(listener);\n }\n fireLocationChange(event) {\n for (const listener of this._listeners) {\n listener(event);\n }\n }\n /**\n * Should be called when the page is first loaded.\n * It will fire a location change event with type `initial` and the current window.location as the location\n */\n firePageLoad() {\n this.fireLocationChange(new AfterLocationChangeEvent('initial', new URL(window.location.href)));\n }\n addStickyParams(path) {\n if (this.stickyParams) {\n return new PathWithParams(path).add(this.stickyParams).toString();\n }\n return path;\n }\n navigate(to, options = {}) {\n if (options.stepsBack && options.stepsBack > 0) {\n this.stepBack(options.stepsBack, options);\n return;\n }\n if (options.basePath) {\n let basePath = options.basePath;\n if (!basePath.startsWith('/')) {\n basePath = '/' + basePath;\n }\n to = joinPath(basePath, to);\n }\n to = this.addStickyParams(to);\n this._navigate(new URL(to, window.location.href), 'navigate', options);\n }\n stepBack(steps, options = {}) {\n const historyChain = window.history.state.historyChain || [];\n const to = historyChain.length >= steps\n ? new URL(historyChain[historyChain.length - steps].href, window.location.href)\n : new URL(window.location.origin, window.location.href);\n this._navigate(to, 'popState', options);\n const stateToStore = {\n from: window.location.href,\n historyChain: historyChain.slice(0, -steps),\n data: options.state || undefined,\n title: options.title || document.title\n };\n window.history['replaceState'](stateToStore, '', to.href);\n this.fireLocationChange(new AfterLocationChangeEvent('popState', to, options.state));\n }\n _navigate(to, type, options) {\n const beforeEvent = new BeforeLocationChangeEvent(type, to, options.state);\n this.fireLocationChange(beforeEvent);\n if (beforeEvent._canceled) {\n return;\n }\n // Build navigation chain by preserving previous history\n const currentState = window.history.state;\n const currentTitle = options.title || document.title;\n // Create new history chain entry\n const newChainEntry = {\n title: currentTitle,\n href: window.location.pathname + window.location.search + window.location.hash\n };\n // Build the history chain - clear if using replace\n let historyChain = [];\n if (!options.replace && currentState?.historyChain) {\n historyChain = [...currentState.historyChain];\n }\n // Only add to chain if not replacing\n if (!options.replace) {\n historyChain.push(newChainEntry);\n // Limit chain length to prevent memory issues (keep last 10 entries)\n if (historyChain.length > 10) {\n historyChain = historyChain.slice(-10);\n }\n }\n const stateToStore = {\n from: window.location.href,\n historyChain: historyChain,\n data: options.state || undefined,\n title: options.title || document.title\n };\n window.history[options.replace ? 'replaceState' : 'pushState'](stateToStore, '', to.href);\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, options.state));\n }\n start() {\n if (typeof window === \"undefined\") {\n return;\n }\n const _popStateListener = (ev) => {\n let type;\n const to = new URL(window.location.href);\n let state = undefined;\n if (ev.state) {\n type = 'popState';\n state = ev.state.data;\n }\n else {\n type = 'linkClick';\n }\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, state));\n };\n const _linkNavListener = (ev) => {\n const target = ev.target;\n // Skip anchors with download attribute or blob: URLs - they are file downloads, not navigation\n if (target.tagName.toLowerCase() === 'a' && (target.hasAttribute('download') ||\n target.href?.startsWith('blob:'))) {\n return;\n }\n const url = getElementHrefAsUrl(target);\n if (url && url.origin === window.location.origin) {\n ev.preventDefault();\n const to = new URL(this.addStickyParams(url.href));\n const basePath = ev[BASE_PATH] || ev.target[BASE_PATH];\n if (basePath) {\n to.pathname = joinPath(basePath, to.pathname);\n }\n this._navigate(to, 'linkClick', {});\n }\n };\n this._popStateListener = _popStateListener;\n this._linkNavListener = _linkNavListener;\n window.addEventListener('popstate', _popStateListener);\n document.body.addEventListener('click', this._linkNavListener);\n }\n stop() {\n this._popStateListener && window.removeEventListener('popstate', this._popStateListener);\n this._linkNavListener && document.body.removeEventListener('click', this._linkNavListener);\n }\n}\n//# sourceMappingURL=HistoryNavigator.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useRef } from \"react\";\nimport { BASE_PATH } from \"./HistoryNavigator\";\nexport function FixLinks({ basePath, children }) {\n const ref = useRef(null);\n useEffect(() => {\n if (ref.current) {\n const divElem = ref.current;\n const listener = (ev) => {\n const elem = ev.target;\n if (elem.tagName.toLowerCase() === 'a') {\n ev[BASE_PATH] = basePath;\n }\n };\n divElem.addEventListener('click', listener);\n return () => {\n divElem.removeEventListener('click', listener);\n };\n }\n }, [ref.current]);\n return (_jsx(\"div\", { ref: ref, className: \"h-full w-full\", children: children }));\n}\n//# sourceMappingURL=FixLinks.js.map","import { getPathSegments, toSegments } from \"./path\";\n/**\n * Path matcher which support :param and *wildcard segments.\n * The wildcard segment is only supported as the last segment\n */\nexport class PathMatcher {\n tree = new RootSegmentNode();\n loadMapping(mapping) {\n for (const [key, value] of Object.entries(mapping)) {\n this.addSegments(getPathSegments(key), value);\n }\n }\n addPath(path, value) {\n this.addSegments(getPathSegments(path), value);\n }\n addSegments(segments, value) {\n let node = this.tree;\n for (let i = 0, l = segments.length; i < l; i++) {\n const segment = segments[i];\n if (segment[0] === ':') {\n let childNode = node.wildcard;\n if (!childNode) {\n childNode = new VariableSegmentNode(segment);\n node.wildcard = childNode;\n }\n else if (!(childNode instanceof VariableSegmentNode)) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \":\" segment will overwrite an existing wildcard segment at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node = childNode;\n }\n else if (segment === '*') {\n if (node.wildcard) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \"*\" segment already exists at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node.wildcard = new WildcardSegmentNode(segment, value);\n if (i < l - 1) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard segment must be the last segment`);\n }\n return;\n }\n else {\n let childNode = node.children[segment];\n if (!childNode) {\n childNode = new LiteralSegmentNode(segment);\n node.children[segment] = childNode;\n } // else // a literal segment already exists\n node = childNode;\n }\n }\n if (node.value !== undefined) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A value already exists at path: ${'/' + segments.join(\"/\")}`);\n }\n node.value = value;\n }\n match(path) {\n const segments = toSegments(path);\n if (segments.length === 0) {\n return null;\n }\n const params = {};\n let node = this.tree;\n for (const segment of segments) {\n const match = node.match(segment, params);\n if (match) {\n node = match;\n }\n else {\n return null;\n }\n }\n if (!node.value) { // not a leaf node (partial match)\n if (node instanceof ParentSegmentNode) {\n if (node.wildcard instanceof WildcardSegmentNode) {\n node = node.wildcard.match('', params);\n if (!node.value) {\n throw new Error(\"Wildcard segment node `*` must have a value\");\n }\n }\n }\n if (!node.value)\n return null; // not a leaf node, neither a trailing wildcard (partial match)\n }\n let matchedSegments, remainingSegments;\n if (params._ && params._.length > 0) {\n matchedSegments = segments.slice(0, -params._.length);\n remainingSegments = params._;\n }\n else {\n matchedSegments = segments;\n }\n return { params, matchedSegments, remainingSegments, value: node.value };\n }\n}\nclass ParentSegmentNode {\n name;\n value;\n children = {};\n wildcard;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n let node = this.children[segment];\n if (node) {\n return node;\n }\n else if (this.wildcard) {\n if (this.wildcard instanceof WildcardSegmentNode) {\n return this.wildcard.match(segment, params);\n }\n else if (this.wildcard instanceof VariableSegmentNode) {\n params[this.wildcard.paramName] = segment;\n return this.wildcard;\n }\n else {\n throw new Error(\"Unknown wildcard segment node type: \" + this.wildcard.constructor.name);\n }\n }\n else {\n return null;\n }\n }\n}\nclass RootSegmentNode extends ParentSegmentNode {\n constructor() {\n super(\"#root\");\n }\n}\nclass LiteralSegmentNode extends ParentSegmentNode {\n constructor(name, value) {\n super(name, value);\n }\n}\nclass VariableSegmentNode extends ParentSegmentNode {\n paramName;\n constructor(name, value) {\n super(name, value);\n this.paramName = name.substring(1);\n }\n}\nclass WildcardSegmentNode {\n name;\n value;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n if (!params._) {\n params._ = segment ? [segment] : [];\n }\n else {\n segment && params._.push(segment);\n }\n return this;\n }\n}\n//# sourceMappingURL=PathMatcher.js.map","import { createContext, useContext, useEffect } from \"react\";\nimport { HistoryNavigator } from \"./HistoryNavigator\";\nimport { PathMatcher } from \"./PathMatcher\";\nimport { isRootPath, joinPath } from \"./path\";\nexport class BaseRouter {\n // the path to use when navigating to the root of the router\n index;\n matcher = new PathMatcher();\n constructor(routes, index) {\n this.index = index;\n for (const route of routes) {\n this.matcher.addPath(route.path, route);\n }\n }\n match(path) {\n const useIndex = isRootPath(path) && this.index;\n return this.matcher.match(useIndex ? this.index : path);\n }\n}\nexport class Router extends BaseRouter {\n prompt;\n observer;\n navigator = new HistoryNavigator();\n constructor(routes, updateState) {\n super(routes);\n this.navigator.addListener((event) => {\n if (event.isCancelable && this.prompt && !!this.prompt.when) {\n if (!window.confirm(this.prompt.message))\n return;\n }\n if (this.observer) {\n this.observer(event);\n }\n // only process afterChange events\n if (event.name === \"afterChange\") {\n const match = this.match(event.location.pathname);\n if (match && match.value) {\n updateState({\n ...match,\n state: event.state,\n });\n }\n else {\n updateState(null);\n }\n }\n });\n }\n getTopRouter() {\n return this;\n }\n /**\n * Subsequent navigations will preserve the given params in the query string.\n * Use null to clear the sticky params.\n * @param params\n */\n setStickyParams(params) {\n this.navigator.stickyParams = params != null ? params : undefined;\n }\n withObserver(observer) {\n this.observer = observer;\n return this;\n }\n start() {\n this.navigator.start();\n // initialize with the current location\n this.navigator.firePageLoad();\n }\n stop() {\n this.navigator.stop();\n }\n navigate(path, options) {\n this.navigator.navigate(path, options);\n }\n}\nexport class NestedRouter extends BaseRouter {\n parent;\n basePath;\n constructor(parent, basePath, routes) {\n super(routes);\n this.parent = parent;\n this.basePath = basePath;\n }\n getTopRouter() {\n if (this.parent instanceof Router) {\n return this.parent;\n }\n else {\n return this.parent.getTopRouter();\n }\n }\n navigate(path, options) {\n // base path is nested by default in a NestedRouter unless explicitly set to false by caller\n const isBasePathNested = options?.isBasePathNested ?? true;\n let basePath;\n if (isBasePathNested) {\n const childBasePath = options?.basePath;\n // e.g. \"/store\" + \"/objects/123\" => \"/store/objects/123\"\n basePath = childBasePath ? joinPath(this.basePath, childBasePath) : this.basePath;\n this.parent.navigate(path, {\n ...options,\n basePath,\n });\n }\n else {\n // isBasePathNested === false: navigate to an absolute path without adding this router's basePath\n // Pass through to parent without adding our basePath prefix\n this.parent.navigate(path, {\n ...options,\n basePath: options?.basePath,\n });\n }\n }\n}\nconst ReactRouterContext = createContext(undefined);\nexport { ReactRouterContext };\nexport function useRouterContext() {\n const ctx = useContext(ReactRouterContext);\n if (!ctx) {\n throw new Error(\"useRouter must be used within a RouterProvider\");\n }\n return ctx;\n}\nexport function useNavigate() {\n const { navigate } = useRouterContext();\n return navigate;\n}\nexport function useRouterBasePath() {\n const { matchedRoutePath, router } = useRouterContext();\n return router instanceof NestedRouter ? router.basePath : matchedRoutePath;\n}\nexport function useParams(arg) {\n const { params } = useRouterContext();\n if (arg) {\n return params[arg];\n }\n else {\n return params;\n }\n}\nexport function useLocation() {\n const { location } = useRouterContext();\n return location;\n}\nexport function usePageTitle(title) {\n useEffect(() => {\n const prev = document.title;\n document.title = title;\n return () => { document.title = prev; };\n }, [title]);\n}\nexport function useNavigationPrompt(prompt) {\n const { router } = useRouterContext();\n useEffect(() => {\n router.getTopRouter().prompt = prompt;\n return () => {\n router.getTopRouter().prompt = undefined;\n };\n }, []);\n useEffect(() => {\n if (prompt.when) {\n const doBlock = prompt.when;\n const listener = function (ev) {\n if (doBlock) {\n ev.preventDefault();\n ev.returnValue = \"\";\n }\n };\n window.addEventListener(\"beforeunload\", listener);\n return () => {\n window.removeEventListener(\"beforeunload\", listener);\n };\n }\n }, [prompt.when]);\n}\n//# sourceMappingURL=Router.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useNavigate, useRouterContext } from \"./Router\";\nexport function Nav({ children, to, onClick, replace = true }) {\n const navigate = useNavigate();\n const _onClick = (ev) => {\n const link = ev.target.closest('a');\n const rawHref = link?.getAttribute('href');\n const target = to ?? rawHref;\n if (link && target) {\n ev.stopPropagation();\n ev.preventDefault();\n navigate(target, { replace });\n onClick?.(ev);\n }\n };\n return (_jsx(\"span\", { onClick: _onClick, children: children }));\n}\nexport function NavLink({ children, href, className, topLevelNav, clearBreadcrumbs = false }) {\n const { router } = useRouterContext();\n const _onClick = (ev) => {\n ev.stopPropagation();\n ev.preventDefault();\n const actualRouter = topLevelNav ? router.getTopRouter() : router;\n actualRouter.navigate(href, { replace: clearBreadcrumbs });\n };\n return (_jsx(\"a\", { href: href, className: className, onClick: _onClick, children: children }));\n}\n//# sourceMappingURL=Nav.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useState } from \"react\";\nimport { useRouterContext } from \"./Router\";\nexport function RouteComponent({ spinner }) {\n const ctx = useRouterContext();\n const route = ctx.route;\n if (route.Component) {\n const Component = route.Component;\n return _jsx(Component, { ...ctx.params });\n }\n else if (route.LazyComponent) {\n return _jsx(LazyRouteComponent, { route: route, spinner: spinner });\n }\n else {\n throw new Error(`Invalid route for ${route.path}. Either Component or LazyCOmponent must be specified.`);\n }\n}\nfunction LazyRouteComponent({ route, spinner }) {\n const [Component, setComponent] = useState(null);\n useEffect(() => {\n route.LazyComponent().then(module => {\n if (!module.default) {\n throw new Error(`Lazy module for ${route.path} does not have a default export`);\n }\n // we need to wrap the component type in an arrow function\n // otherwise the setState function will execute the function as a state update function\n setComponent(() => module.default);\n });\n }, [route]);\n return Component ? (_jsx(Component, {})) : spinner || null;\n}\n//# sourceMappingURL=RouteComponent.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { FixLinks } from \"./FixLinks\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, useRouterContext } from \"./Router\";\nimport { joinPath } from \"./path\";\nexport function NestedNavigationContext({ basePath, fixLinks = false, children }) {\n const ctx = useRouterContext();\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n navigate: (to, options) => {\n if (options?.isBasePathNested === false) {\n // Navigate to an absolute path without adding this context's basePath\n return ctx.navigate(to, options);\n }\n const actualBasePath = options?.basePath ? joinPath(basePath, options.basePath) : basePath;\n return ctx.navigate(to, { ...options, basePath: actualBasePath });\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedNavigationContext.js.map","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouterContext } from \"./Router\";\nexport function Route404Component() {\n const ctx = useRouterContext();\n return _jsxs(\"div\", { children: [\"Route not found for path \", ctx.matchedRoutePath] });\n}\nexport function createRoute404() {\n return {\n params: {},\n matchedSegments: [],\n state: null,\n value: {\n path: 'virtual:404',\n Component: () => _jsx(Route404Component, {})\n }\n };\n}\n//# sourceMappingURL=Route404.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { FixLinks } from \"./FixLinks\";\nimport { createRoute404 } from \"./Route404\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { NestedRouter, ReactRouterContext, useRouterContext } from \"./Router\";\nexport function NestedRouterProvider({ routes, index, children, fixLinks = false }) {\n const ctx = useRouterContext();\n const [nestedRouteMatch, setNestedRouteMatch] = useState(undefined);\n const nestedRouter = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const basePath = ctx.matchedRoutePath;\n const nestedRouter = new NestedRouter(ctx.router, basePath, routes);\n nestedRouter.index = index;\n return nestedRouter;\n }, []);\n useEffect(() => {\n if (nestedRouter) {\n if (ctx.matchedRoutePath !== nestedRouter.basePath) {\n // the change doesn't belong to this nested router\n // it should be handled by the top level router which will change the page or the nested router\n return;\n }\n const route = nestedRouter.match(ctx.remainingPath || '/') || createRoute404();\n setNestedRouteMatch(route);\n }\n }, [nestedRouter, ctx.remainingPath]);\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return nestedRouteMatch && (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n router: nestedRouter,\n route: nestedRouteMatch.value,\n params: nestedRouteMatch.params,\n matchedRoutePath: '/' + nestedRouteMatch.matchedSegments.join('/'),\n remainingPath: nestedRouteMatch.remainingSegments ? '/' + nestedRouteMatch.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n if (nestedRouter) {\n return nestedRouter.navigate(to, options);\n }\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedRouterProvider.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useSafeLayoutEffect } from \"@vertesia/ui/core\";\n//import { useSafeLayoutEffect } from \"../core\";\nimport { useMemo, useState } from \"react\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, Router } from \"./Router\";\nimport { createRoute404 } from \"./Route404\";\nexport function RouterProvider({ routes, index, onChange, children }) {\n const [state, setState] = useState(undefined);\n const router = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const router = new Router(routes, (match) => {\n if (match === null) {\n match = createRoute404();\n }\n setState({\n location: window.location,\n route: match.value,\n params: match.params,\n state: match.state,\n router: router,\n matchedRoutePath: '/' + match.matchedSegments.join('/'),\n remainingPath: match.remainingSegments ? '/' + match.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return router.navigate(to, options);\n }\n });\n }).withObserver(onChange);\n router.index = index;\n return router;\n }, []);\n useSafeLayoutEffect(() => {\n router && router.start();\n return () => {\n router && router.stop();\n };\n }, []);\n return state && (_jsx(ReactRouterContext.Provider, { value: state, children: children ? children : _jsx(RouteComponent, {}) }));\n}\n//# sourceMappingURL=RouterProvider.js.map"],"names":["isRootPath","path","joinPath","path1","path2","endsWith","startsWith","substring","getPathSegments","s","e","length","split","toSegments","Array","isArray","Error","PathWithParams","params","hash","constructor","i","lastIndexOf","this","indexOf","URLSearchParams","add","key","value","Object","entries","set","toString","BASE_PATH","Symbol","LocationChangeEvent","name","type","location","state","_canceled","isPageLoad","isBackForward","isLinkClick","isNavigation","isCancelable","cancel","BeforeLocationChangeEvent","super","AfterLocationChangeEvent","HistoryNavigator","stickyParams","_popStateListener","_linkNavListener","_listeners","addListener","listener","push","fireLocationChange","event","firePageLoad","URL","window","href","addStickyParams","navigate","to","options","stepsBack","stepBack","basePath","_navigate","steps","historyChain","history","origin","stateToStore","from","slice","data","undefined","title","document","beforeEvent","currentState","newChainEntry","pathname","search","replace","start","ev","target","tagName","toLowerCase","hasAttribute","url","elem","trim","getElementHrefAsUrl","preventDefault","addEventListener","body","stop","removeEventListener","FixLinks","children","ref","useRef","useEffect","current","divElem","_jsx","className","PathMatcher","tree","RootSegmentNode","loadMapping","mapping","addSegments","addPath","segments","node","l","segment","childNode","wildcard","VariableSegmentNode","join","WildcardSegmentNode","LiteralSegmentNode","match","matchedSegments","remainingSegments","ParentSegmentNode","_","paramName","BaseRouter","index","matcher","routes","route","useIndex","Router","prompt","observer","navigator","updateState","when","confirm","message","getTopRouter","setStickyParams","withObserver","NestedRouter","parent","isBasePathNested","childBasePath","ReactRouterContext","createContext","useRouterContext","ctx","useContext","useNavigate","useRouterBasePath","matchedRoutePath","router","useParams","arg","useLocation","usePageTitle","prev","useNavigationPrompt","doBlock","returnValue","Nav","onClick","link","closest","rawHref","getAttribute","stopPropagation","NavLink","topLevelNav","clearBreadcrumbs","RouteComponent","spinner","Component","LazyComponent","LazyRouteComponent","setComponent","useState","then","module","default","NestedNavigationContext","fixLinks","wrapWithFixLinks","Provider","actualBasePath","Route404Component","_jsxs","createRoute404","NestedRouterProvider","nestedRouteMatch","setNestedRouteMatch","nestedRouter","useMemo","remainingPath","RouterProvider","onChange","setState","useSafeLayoutEffect"],"mappings":"sNAAO,SAASA,EAAWC,GACvB,MAAgB,MAATA,GAAyB,KAATA,CAC3B,CACO,SAASC,EAASC,EA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