@burdenoff/microfe-brainyrich 2026.819.1 → 2026.827.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (514) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +1 -1
  2. package/dist/brainyrich/BrainyRichRoot.d.ts +0 -1
  3. package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
  4. package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
  5. package/dist/brainyrich/components/ActorName.js.map +1 -1
  6. package/dist/brainyrich/components/ConfirmDialog.d.ts +0 -1
  7. package/dist/brainyrich/components/ConfirmDialog.js.map +1 -1
  8. package/dist/brainyrich/components/LoadMore.js.map +1 -1
  9. package/dist/brainyrich/components/notify.js.map +1 -1
  10. package/dist/brainyrich/components/pickers.js.map +1 -1
  11. package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -1
  12. package/dist/brainyrich/components/reuse/DocumentsPanel.d.ts +4 -0
  13. package/dist/brainyrich/components/reuse/DocumentsPanel.d.ts.map +1 -1
  14. package/dist/brainyrich/components/reuse/DocumentsPanel.js +150 -99
  15. package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -1
  16. package/dist/brainyrich/components/reuse/TagField.js.map +1 -1
  17. package/dist/brainyrich/components/reuse/transport.js.map +1 -1
  18. package/dist/brainyrich/components/viz.d.ts +0 -1
  19. package/dist/brainyrich/components/viz.js.map +1 -1
  20. package/dist/brainyrich/hooks/useBrainyRichAnalytics.js.map +1 -1
  21. package/dist/brainyrich/hooks/useBrainyRichApi.d.ts +176 -1
  22. package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -1
  23. package/dist/brainyrich/hooks/useBrainyRichApi.js +96 -82
  24. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
  25. package/dist/brainyrich/pages/AccountsPage.d.ts.map +1 -1
  26. package/dist/brainyrich/pages/AccountsPage.js +367 -363
  27. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  28. package/dist/brainyrich/pages/AdminFirmPage.d.ts.map +1 -1
  29. package/dist/brainyrich/pages/AdminFirmPage.js +115 -83
  30. package/dist/brainyrich/pages/AdminFirmPage.js.map +1 -1
  31. package/dist/brainyrich/pages/AiAssistantPage.d.ts.map +1 -1
  32. package/dist/brainyrich/pages/AiAssistantPage.js +251 -230
  33. package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
  34. package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
  35. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  36. package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
  37. package/dist/brainyrich/pages/FirmPage.d.ts.map +1 -1
  38. package/dist/brainyrich/pages/FirmPage.js +148 -116
  39. package/dist/brainyrich/pages/FirmPage.js.map +1 -1
  40. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  41. package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
  42. package/dist/brainyrich/pages/PortfoliosPage.d.ts +14 -0
  43. package/dist/brainyrich/pages/PortfoliosPage.d.ts.map +1 -1
  44. package/dist/brainyrich/pages/PortfoliosPage.js +530 -353
  45. package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
  46. package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
  47. package/dist/brainyrich/pages/RiskPage.d.ts.map +1 -1
  48. package/dist/brainyrich/pages/RiskPage.js +381 -396
  49. package/dist/brainyrich/pages/RiskPage.js.map +1 -1
  50. package/dist/brainyrich/pages/TaxPage.js.map +1 -1
  51. package/dist/brainyrich/pages/_shared.d.ts +21 -1
  52. package/dist/brainyrich/pages/_shared.d.ts.map +1 -1
  53. package/dist/brainyrich/pages/_shared.js +66 -31
  54. package/dist/brainyrich/pages/_shared.js.map +1 -1
  55. package/dist/brainyrich/providers/BrainyRichProvider.d.ts +0 -1
  56. package/dist/brainyrich/providers/BrainyRichProvider.js.map +1 -1
  57. package/dist/brainyrich/services/createSandboxAssistantTransport.js.map +1 -1
  58. package/dist/brainyrich/types/bra.d.ts.map +1 -1
  59. package/dist/brainyrich/types/index.d.ts +0 -1
  60. package/dist/brainyrich/utils/cn.d.ts +0 -1
  61. package/dist/brainyrich/utils/i18n.d.ts +0 -1
  62. package/dist/brainyrich/utils/i18n.js.map +1 -1
  63. package/dist/brainyrich/utils/nativeControls.d.ts +0 -1
  64. package/dist/brainyrich/utils/nativeControls.js.map +1 -1
  65. package/dist/brainyrich/utils/navigation.js.map +1 -1
  66. package/dist/brainyrich/utils/pageContext.js.map +1 -1
  67. package/dist/dev/main.d.ts +0 -1
  68. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  69. package/dist/node_modules/d3-array/src/ascending.js.map +1 -1
  70. package/dist/node_modules/d3-array/src/bisect.js.map +1 -1
  71. package/dist/node_modules/d3-array/src/bisector.js.map +1 -1
  72. package/dist/node_modules/d3-array/src/descending.js.map +1 -1
  73. package/dist/node_modules/d3-array/src/max.js.map +1 -1
  74. package/dist/node_modules/d3-array/src/min.js.map +1 -1
  75. package/dist/node_modules/d3-array/src/number.js.map +1 -1
  76. package/dist/node_modules/d3-array/src/quantile.js.map +1 -1
  77. package/dist/node_modules/d3-array/src/quickselect.js.map +1 -1
  78. package/dist/node_modules/d3-array/src/range.js.map +1 -1
  79. package/dist/node_modules/d3-array/src/sort.js.map +1 -1
  80. package/dist/node_modules/d3-array/src/ticks.js.map +1 -1
  81. package/dist/node_modules/d3-color/src/color.js.map +1 -1
  82. package/dist/node_modules/d3-color/src/define.js.map +1 -1
  83. package/dist/node_modules/d3-format/src/defaultLocale.js.map +1 -1
  84. package/dist/node_modules/d3-format/src/exponent.js.map +1 -1
  85. package/dist/node_modules/d3-format/src/formatDecimal.js.map +1 -1
  86. package/dist/node_modules/d3-format/src/formatGroup.js.map +1 -1
  87. package/dist/node_modules/d3-format/src/formatNumerals.js.map +1 -1
  88. package/dist/node_modules/d3-format/src/formatPrefixAuto.js.map +1 -1
  89. package/dist/node_modules/d3-format/src/formatRounded.js.map +1 -1
  90. package/dist/node_modules/d3-format/src/formatSpecifier.js.map +1 -1
  91. package/dist/node_modules/d3-format/src/formatTrim.js.map +1 -1
  92. package/dist/node_modules/d3-format/src/formatTypes.js.map +1 -1
  93. package/dist/node_modules/d3-format/src/identity.js.map +1 -1
  94. package/dist/node_modules/d3-format/src/locale.js.map +1 -1
  95. package/dist/node_modules/d3-format/src/precisionFixed.js.map +1 -1
  96. package/dist/node_modules/d3-format/src/precisionPrefix.js.map +1 -1
  97. package/dist/node_modules/d3-format/src/precisionRound.js.map +1 -1
  98. package/dist/node_modules/d3-interpolate/src/array.js.map +1 -1
  99. package/dist/node_modules/d3-interpolate/src/basis.js.map +1 -1
  100. package/dist/node_modules/d3-interpolate/src/basisClosed.js.map +1 -1
  101. package/dist/node_modules/d3-interpolate/src/color.js.map +1 -1
  102. package/dist/node_modules/d3-interpolate/src/date.js.map +1 -1
  103. package/dist/node_modules/d3-interpolate/src/number.js.map +1 -1
  104. package/dist/node_modules/d3-interpolate/src/numberArray.js.map +1 -1
  105. package/dist/node_modules/d3-interpolate/src/object.js.map +1 -1
  106. package/dist/node_modules/d3-interpolate/src/piecewise.js.map +1 -1
  107. package/dist/node_modules/d3-interpolate/src/rgb.js.map +1 -1
  108. package/dist/node_modules/d3-interpolate/src/round.js.map +1 -1
  109. package/dist/node_modules/d3-interpolate/src/string.js.map +1 -1
  110. package/dist/node_modules/d3-interpolate/src/value.js.map +1 -1
  111. package/dist/node_modules/d3-path/src/path.js.map +1 -1
  112. package/dist/node_modules/d3-scale/src/band.js.map +1 -1
  113. package/dist/node_modules/d3-scale/src/constant.js.map +1 -1
  114. package/dist/node_modules/d3-scale/src/continuous.js.map +1 -1
  115. package/dist/node_modules/d3-scale/src/diverging.js.map +1 -1
  116. package/dist/node_modules/d3-scale/src/identity.js.map +1 -1
  117. package/dist/node_modules/d3-scale/src/init.js.map +1 -1
  118. package/dist/node_modules/d3-scale/src/linear.js.map +1 -1
  119. package/dist/node_modules/d3-scale/src/log.js.map +1 -1
  120. package/dist/node_modules/d3-scale/src/nice.js.map +1 -1
  121. package/dist/node_modules/d3-scale/src/number.js.map +1 -1
  122. package/dist/node_modules/d3-scale/src/ordinal.js.map +1 -1
  123. package/dist/node_modules/d3-scale/src/pow.js.map +1 -1
  124. package/dist/node_modules/d3-scale/src/quantile.js.map +1 -1
  125. package/dist/node_modules/d3-scale/src/quantize.js.map +1 -1
  126. package/dist/node_modules/d3-scale/src/radial.js.map +1 -1
  127. package/dist/node_modules/d3-scale/src/sequential.js.map +1 -1
  128. package/dist/node_modules/d3-scale/src/sequentialQuantile.js.map +1 -1
  129. package/dist/node_modules/d3-scale/src/symlog.js.map +1 -1
  130. package/dist/node_modules/d3-scale/src/threshold.js.map +1 -1
  131. package/dist/node_modules/d3-scale/src/tickFormat.js.map +1 -1
  132. package/dist/node_modules/d3-scale/src/time.js.map +1 -1
  133. package/dist/node_modules/d3-scale/src/utcTime.js.map +1 -1
  134. package/dist/node_modules/d3-shape/src/area.js.map +1 -1
  135. package/dist/node_modules/d3-shape/src/array.js.map +1 -1
  136. package/dist/node_modules/d3-shape/src/constant.js.map +1 -1
  137. package/dist/node_modules/d3-shape/src/curve/basis.js.map +1 -1
  138. package/dist/node_modules/d3-shape/src/curve/basisClosed.js.map +1 -1
  139. package/dist/node_modules/d3-shape/src/curve/basisOpen.js.map +1 -1
  140. package/dist/node_modules/d3-shape/src/curve/bump.js.map +1 -1
  141. package/dist/node_modules/d3-shape/src/curve/linear.js.map +1 -1
  142. package/dist/node_modules/d3-shape/src/curve/linearClosed.js.map +1 -1
  143. package/dist/node_modules/d3-shape/src/curve/monotone.js.map +1 -1
  144. package/dist/node_modules/d3-shape/src/curve/natural.js.map +1 -1
  145. package/dist/node_modules/d3-shape/src/curve/step.js.map +1 -1
  146. package/dist/node_modules/d3-shape/src/line.js.map +1 -1
  147. package/dist/node_modules/d3-shape/src/noop.js.map +1 -1
  148. package/dist/node_modules/d3-shape/src/offset/expand.js.map +1 -1
  149. package/dist/node_modules/d3-shape/src/offset/none.js.map +1 -1
  150. package/dist/node_modules/d3-shape/src/offset/silhouette.js.map +1 -1
  151. package/dist/node_modules/d3-shape/src/offset/wiggle.js.map +1 -1
  152. package/dist/node_modules/d3-shape/src/order/none.js.map +1 -1
  153. package/dist/node_modules/d3-shape/src/path.js.map +1 -1
  154. package/dist/node_modules/d3-shape/src/point.js.map +1 -1
  155. package/dist/node_modules/d3-shape/src/stack.js.map +1 -1
  156. package/dist/node_modules/d3-shape/src/symbol/circle.js.map +1 -1
  157. package/dist/node_modules/d3-shape/src/symbol/cross.js.map +1 -1
  158. package/dist/node_modules/d3-shape/src/symbol/diamond.js.map +1 -1
  159. package/dist/node_modules/d3-shape/src/symbol/square.js.map +1 -1
  160. package/dist/node_modules/d3-shape/src/symbol/star.js.map +1 -1
  161. package/dist/node_modules/d3-shape/src/symbol/triangle.js.map +1 -1
  162. package/dist/node_modules/d3-shape/src/symbol/wye.js.map +1 -1
  163. package/dist/node_modules/d3-shape/src/symbol.js.map +1 -1
  164. package/dist/node_modules/d3-time/src/day.js.map +1 -1
  165. package/dist/node_modules/d3-time/src/hour.js.map +1 -1
  166. package/dist/node_modules/d3-time/src/interval.js.map +1 -1
  167. package/dist/node_modules/d3-time/src/millisecond.js.map +1 -1
  168. package/dist/node_modules/d3-time/src/minute.js.map +1 -1
  169. package/dist/node_modules/d3-time/src/month.js.map +1 -1
  170. package/dist/node_modules/d3-time/src/second.js.map +1 -1
  171. package/dist/node_modules/d3-time/src/ticks.js.map +1 -1
  172. package/dist/node_modules/d3-time/src/week.js.map +1 -1
  173. package/dist/node_modules/d3-time/src/year.js.map +1 -1
  174. package/dist/node_modules/d3-time-format/src/defaultLocale.js.map +1 -1
  175. package/dist/node_modules/d3-time-format/src/locale.js.map +1 -1
  176. package/dist/node_modules/decimal.js-light/decimal.js.map +1 -1
  177. package/dist/node_modules/eventemitter3/index.js.map +1 -1
  178. package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
  179. package/dist/node_modules/internmap/src/index.js.map +1 -1
  180. package/dist/node_modules/lodash/_DataView.js.map +1 -1
  181. package/dist/node_modules/lodash/_Hash.js.map +1 -1
  182. package/dist/node_modules/lodash/_ListCache.js.map +1 -1
  183. package/dist/node_modules/lodash/_Map.js.map +1 -1
  184. package/dist/node_modules/lodash/_MapCache.js.map +1 -1
  185. package/dist/node_modules/lodash/_Promise.js.map +1 -1
  186. package/dist/node_modules/lodash/_Set.js.map +1 -1
  187. package/dist/node_modules/lodash/_SetCache.js.map +1 -1
  188. package/dist/node_modules/lodash/_Stack.js +2 -1
  189. package/dist/node_modules/lodash/_Stack.js.map +1 -1
  190. package/dist/node_modules/lodash/_Symbol.js.map +1 -1
  191. package/dist/node_modules/lodash/_Uint8Array.js.map +1 -1
  192. package/dist/node_modules/lodash/_WeakMap.js.map +1 -1
  193. package/dist/node_modules/lodash/_apply.js.map +1 -1
  194. package/dist/node_modules/lodash/_arrayEvery.js.map +1 -1
  195. package/dist/node_modules/lodash/_arrayFilter.js.map +1 -1
  196. package/dist/node_modules/lodash/_arrayIncludes.js.map +1 -1
  197. package/dist/node_modules/lodash/_arrayIncludesWith.js.map +1 -1
  198. package/dist/node_modules/lodash/_arrayLikeKeys.js.map +1 -1
  199. package/dist/node_modules/lodash/_arrayMap.js.map +1 -1
  200. package/dist/node_modules/lodash/_arrayPush.js.map +1 -1
  201. package/dist/node_modules/lodash/_arraySome.js.map +1 -1
  202. package/dist/node_modules/lodash/_asciiToArray.js.map +1 -1
  203. package/dist/node_modules/lodash/_assocIndexOf.js.map +1 -1
  204. package/dist/node_modules/lodash/_baseAssignValue.js.map +1 -1
  205. package/dist/node_modules/lodash/_baseEach.js.map +1 -1
  206. package/dist/node_modules/lodash/_baseEvery.js.map +1 -1
  207. package/dist/node_modules/lodash/_baseExtremum.js.map +1 -1
  208. package/dist/node_modules/lodash/_baseFindIndex.js.map +1 -1
  209. package/dist/node_modules/lodash/_baseFlatten.js.map +1 -1
  210. package/dist/node_modules/lodash/_baseFor.js.map +1 -1
  211. package/dist/node_modules/lodash/_baseForOwn.js.map +1 -1
  212. package/dist/node_modules/lodash/_baseGet.js.map +1 -1
  213. package/dist/node_modules/lodash/_baseGetAllKeys.js.map +1 -1
  214. package/dist/node_modules/lodash/_baseGetTag.js.map +1 -1
  215. package/dist/node_modules/lodash/_baseGt.js.map +1 -1
  216. package/dist/node_modules/lodash/_baseHasIn.js.map +1 -1
  217. package/dist/node_modules/lodash/_baseIndexOf.js.map +1 -1
  218. package/dist/node_modules/lodash/_baseIsArguments.js.map +1 -1
  219. package/dist/node_modules/lodash/_baseIsEqual.js.map +1 -1
  220. package/dist/node_modules/lodash/_baseIsEqualDeep.js.map +1 -1
  221. package/dist/node_modules/lodash/_baseIsMatch.js.map +1 -1
  222. package/dist/node_modules/lodash/_baseIsNaN.js.map +1 -1
  223. package/dist/node_modules/lodash/_baseIsNative.js.map +1 -1
  224. package/dist/node_modules/lodash/_baseIsTypedArray.js.map +1 -1
  225. package/dist/node_modules/lodash/_baseIteratee.js.map +1 -1
  226. package/dist/node_modules/lodash/_baseKeys.js.map +1 -1
  227. package/dist/node_modules/lodash/_baseLt.js.map +1 -1
  228. package/dist/node_modules/lodash/_baseMap.js.map +1 -1
  229. package/dist/node_modules/lodash/_baseMatches.js.map +1 -1
  230. package/dist/node_modules/lodash/_baseMatchesProperty.js.map +1 -1
  231. package/dist/node_modules/lodash/_baseOrderBy.js.map +1 -1
  232. package/dist/node_modules/lodash/_baseProperty.js.map +1 -1
  233. package/dist/node_modules/lodash/_basePropertyDeep.js.map +1 -1
  234. package/dist/node_modules/lodash/_baseRange.js.map +1 -1
  235. package/dist/node_modules/lodash/_baseRest.js.map +1 -1
  236. package/dist/node_modules/lodash/_baseSetToString.js.map +1 -1
  237. package/dist/node_modules/lodash/_baseSlice.js.map +1 -1
  238. package/dist/node_modules/lodash/_baseSome.js.map +1 -1
  239. package/dist/node_modules/lodash/_baseSortBy.js.map +1 -1
  240. package/dist/node_modules/lodash/_baseTimes.js.map +1 -1
  241. package/dist/node_modules/lodash/_baseToString.js.map +1 -1
  242. package/dist/node_modules/lodash/_baseTrim.js.map +1 -1
  243. package/dist/node_modules/lodash/_baseUnary.js.map +1 -1
  244. package/dist/node_modules/lodash/_baseUniq.js.map +1 -1
  245. package/dist/node_modules/lodash/_cacheHas.js.map +1 -1
  246. package/dist/node_modules/lodash/_castPath.js.map +1 -1
  247. package/dist/node_modules/lodash/_castSlice.js.map +1 -1
  248. package/dist/node_modules/lodash/_compareAscending.js.map +1 -1
  249. package/dist/node_modules/lodash/_compareMultiple.js.map +1 -1
  250. package/dist/node_modules/lodash/_coreJsData.js.map +1 -1
  251. package/dist/node_modules/lodash/_createBaseEach.js.map +1 -1
  252. package/dist/node_modules/lodash/_createBaseFor.js.map +1 -1
  253. package/dist/node_modules/lodash/_createCaseFirst.js.map +1 -1
  254. package/dist/node_modules/lodash/_createFind.js.map +1 -1
  255. package/dist/node_modules/lodash/_createRange.js.map +1 -1
  256. package/dist/node_modules/lodash/_createSet.js.map +1 -1
  257. package/dist/node_modules/lodash/_defineProperty.js.map +1 -1
  258. package/dist/node_modules/lodash/_equalArrays.js.map +1 -1
  259. package/dist/node_modules/lodash/_equalByTag.js.map +1 -1
  260. package/dist/node_modules/lodash/_equalObjects.js.map +1 -1
  261. package/dist/node_modules/lodash/_freeGlobal.js.map +1 -1
  262. package/dist/node_modules/lodash/_getAllKeys.js.map +1 -1
  263. package/dist/node_modules/lodash/_getMapData.js.map +1 -1
  264. package/dist/node_modules/lodash/_getMatchData.js.map +1 -1
  265. package/dist/node_modules/lodash/_getNative.js.map +1 -1
  266. package/dist/node_modules/lodash/_getPrototype.js.map +1 -1
  267. package/dist/node_modules/lodash/_getRawTag.js.map +1 -1
  268. package/dist/node_modules/lodash/_getSymbols.js.map +1 -1
  269. package/dist/node_modules/lodash/_getTag.js.map +1 -1
  270. package/dist/node_modules/lodash/_getValue.js.map +1 -1
  271. package/dist/node_modules/lodash/_hasPath.js.map +1 -1
  272. package/dist/node_modules/lodash/_hasUnicode.js.map +1 -1
  273. package/dist/node_modules/lodash/_hashClear.js.map +1 -1
  274. package/dist/node_modules/lodash/_hashDelete.js.map +1 -1
  275. package/dist/node_modules/lodash/_hashGet.js.map +1 -1
  276. package/dist/node_modules/lodash/_hashHas.js.map +1 -1
  277. package/dist/node_modules/lodash/_hashSet.js.map +1 -1
  278. package/dist/node_modules/lodash/_isFlattenable.js.map +1 -1
  279. package/dist/node_modules/lodash/_isIndex.js.map +1 -1
  280. package/dist/node_modules/lodash/_isIterateeCall.js.map +1 -1
  281. package/dist/node_modules/lodash/_isKey.js.map +1 -1
  282. package/dist/node_modules/lodash/_isKeyable.js.map +1 -1
  283. package/dist/node_modules/lodash/_isMasked.js.map +1 -1
  284. package/dist/node_modules/lodash/_isPrototype.js.map +1 -1
  285. package/dist/node_modules/lodash/_isStrictComparable.js.map +1 -1
  286. package/dist/node_modules/lodash/_listCacheClear.js.map +1 -1
  287. package/dist/node_modules/lodash/_listCacheDelete.js.map +1 -1
  288. package/dist/node_modules/lodash/_listCacheGet.js.map +1 -1
  289. package/dist/node_modules/lodash/_listCacheHas.js.map +1 -1
  290. package/dist/node_modules/lodash/_listCacheSet.js.map +1 -1
  291. package/dist/node_modules/lodash/_mapCacheClear.js.map +1 -1
  292. package/dist/node_modules/lodash/_mapCacheDelete.js.map +1 -1
  293. package/dist/node_modules/lodash/_mapCacheGet.js.map +1 -1
  294. package/dist/node_modules/lodash/_mapCacheHas.js.map +1 -1
  295. package/dist/node_modules/lodash/_mapCacheSet.js.map +1 -1
  296. package/dist/node_modules/lodash/_mapToArray.js.map +1 -1
  297. package/dist/node_modules/lodash/_matchesStrictComparable.js.map +1 -1
  298. package/dist/node_modules/lodash/_memoizeCapped.js.map +1 -1
  299. package/dist/node_modules/lodash/_nativeCreate.js.map +1 -1
  300. package/dist/node_modules/lodash/_nativeKeys.js.map +1 -1
  301. package/dist/node_modules/lodash/_nodeUtil.js.map +1 -1
  302. package/dist/node_modules/lodash/_objectToString.js.map +1 -1
  303. package/dist/node_modules/lodash/_overArg.js.map +1 -1
  304. package/dist/node_modules/lodash/_overRest.js.map +1 -1
  305. package/dist/node_modules/lodash/_root.js.map +1 -1
  306. package/dist/node_modules/lodash/_setCacheAdd.js.map +1 -1
  307. package/dist/node_modules/lodash/_setCacheHas.js.map +1 -1
  308. package/dist/node_modules/lodash/_setToArray.js.map +1 -1
  309. package/dist/node_modules/lodash/_setToString.js.map +1 -1
  310. package/dist/node_modules/lodash/_shortOut.js.map +1 -1
  311. package/dist/node_modules/lodash/_stackClear.js.map +1 -1
  312. package/dist/node_modules/lodash/_stackDelete.js.map +1 -1
  313. package/dist/node_modules/lodash/_stackGet.js.map +1 -1
  314. package/dist/node_modules/lodash/_stackHas.js.map +1 -1
  315. package/dist/node_modules/lodash/_stackSet.js.map +1 -1
  316. package/dist/node_modules/lodash/_strictIndexOf.js.map +1 -1
  317. package/dist/node_modules/lodash/_stringToArray.js.map +1 -1
  318. package/dist/node_modules/lodash/_stringToPath.js.map +1 -1
  319. package/dist/node_modules/lodash/_toKey.js.map +1 -1
  320. package/dist/node_modules/lodash/_toSource.js.map +1 -1
  321. package/dist/node_modules/lodash/_trimmedEndIndex.js.map +1 -1
  322. package/dist/node_modules/lodash/_unicodeToArray.js.map +1 -1
  323. package/dist/node_modules/lodash/constant.js.map +1 -1
  324. package/dist/node_modules/lodash/debounce.js.map +1 -1
  325. package/dist/node_modules/lodash/eq.js.map +1 -1
  326. package/dist/node_modules/lodash/every.js.map +1 -1
  327. package/dist/node_modules/lodash/find.js.map +1 -1
  328. package/dist/node_modules/lodash/findIndex.js.map +1 -1
  329. package/dist/node_modules/lodash/flatMap.js.map +1 -1
  330. package/dist/node_modules/lodash/get.js.map +1 -1
  331. package/dist/node_modules/lodash/hasIn.js.map +1 -1
  332. package/dist/node_modules/lodash/identity.js.map +1 -1
  333. package/dist/node_modules/lodash/isArguments.js.map +1 -1
  334. package/dist/node_modules/lodash/isArray.js.map +1 -1
  335. package/dist/node_modules/lodash/isArrayLike.js.map +1 -1
  336. package/dist/node_modules/lodash/isBoolean.js.map +1 -1
  337. package/dist/node_modules/lodash/isBuffer.js.map +1 -1
  338. package/dist/node_modules/lodash/isEqual.js.map +1 -1
  339. package/dist/node_modules/lodash/isFunction.js.map +1 -1
  340. package/dist/node_modules/lodash/isLength.js.map +1 -1
  341. package/dist/node_modules/lodash/isNaN.js.map +1 -1
  342. package/dist/node_modules/lodash/isNil.js.map +1 -1
  343. package/dist/node_modules/lodash/isNumber.js.map +1 -1
  344. package/dist/node_modules/lodash/isObject.js.map +1 -1
  345. package/dist/node_modules/lodash/isObjectLike.js.map +1 -1
  346. package/dist/node_modules/lodash/isPlainObject.js.map +1 -1
  347. package/dist/node_modules/lodash/isString.js.map +1 -1
  348. package/dist/node_modules/lodash/isSymbol.js.map +1 -1
  349. package/dist/node_modules/lodash/isTypedArray.js.map +1 -1
  350. package/dist/node_modules/lodash/keys.js.map +1 -1
  351. package/dist/node_modules/lodash/last.js.map +1 -1
  352. package/dist/node_modules/lodash/map.js.map +1 -1
  353. package/dist/node_modules/lodash/mapValues.js.map +1 -1
  354. package/dist/node_modules/lodash/max.js.map +1 -1
  355. package/dist/node_modules/lodash/maxBy.js.map +1 -1
  356. package/dist/node_modules/lodash/memoize.js.map +1 -1
  357. package/dist/node_modules/lodash/min.js.map +1 -1
  358. package/dist/node_modules/lodash/minBy.js.map +1 -1
  359. package/dist/node_modules/lodash/noop.js.map +1 -1
  360. package/dist/node_modules/lodash/now.js.map +1 -1
  361. package/dist/node_modules/lodash/property.js.map +1 -1
  362. package/dist/node_modules/lodash/range.js.map +1 -1
  363. package/dist/node_modules/lodash/some.js.map +1 -1
  364. package/dist/node_modules/lodash/sortBy.js.map +1 -1
  365. package/dist/node_modules/lodash/stubArray.js.map +1 -1
  366. package/dist/node_modules/lodash/stubFalse.js.map +1 -1
  367. package/dist/node_modules/lodash/throttle.js.map +1 -1
  368. package/dist/node_modules/lodash/toFinite.js.map +1 -1
  369. package/dist/node_modules/lodash/toInteger.js.map +1 -1
  370. package/dist/node_modules/lodash/toNumber.js.map +1 -1
  371. package/dist/node_modules/lodash/toString.js.map +1 -1
  372. package/dist/node_modules/lodash/uniqBy.js.map +1 -1
  373. package/dist/node_modules/lodash/upperFirst.js.map +1 -1
  374. package/dist/node_modules/object-assign/index.js.map +1 -1
  375. package/dist/node_modules/prop-types/checkPropTypes.js.map +1 -1
  376. package/dist/node_modules/prop-types/factoryWithThrowingShims.js.map +1 -1
  377. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
  378. package/dist/node_modules/prop-types/index.js.map +1 -1
  379. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +1 -1
  380. package/dist/node_modules/prop-types/lib/has.js.map +1 -1
  381. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js.map +1 -1
  382. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
  383. package/dist/node_modules/prop-types/node_modules/react-is/index.js.map +1 -1
  384. package/dist/node_modules/react-is/cjs/react-is.development.js.map +1 -1
  385. package/dist/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
  386. package/dist/node_modules/react-is/index.js.map +1 -1
  387. package/dist/node_modules/react-smooth/es6/Animate.js +2 -2
  388. package/dist/node_modules/react-smooth/es6/Animate.js.map +1 -1
  389. package/dist/node_modules/react-smooth/es6/AnimateManager.js.map +1 -1
  390. package/dist/node_modules/react-smooth/es6/configUpdate.js.map +1 -1
  391. package/dist/node_modules/react-smooth/es6/easing.js.map +1 -1
  392. package/dist/node_modules/react-smooth/es6/setRafTimeout.js.map +1 -1
  393. package/dist/node_modules/react-smooth/es6/util.js.map +1 -1
  394. package/dist/node_modules/recharts/es6/cartesian/Area.js +13 -13
  395. package/dist/node_modules/recharts/es6/cartesian/Area.js.map +1 -1
  396. package/dist/node_modules/recharts/es6/cartesian/Bar.js +9 -9
  397. package/dist/node_modules/recharts/es6/cartesian/Bar.js.map +1 -1
  398. package/dist/node_modules/recharts/es6/cartesian/Brush.js +12 -12
  399. package/dist/node_modules/recharts/es6/cartesian/Brush.js.map +1 -1
  400. package/dist/node_modules/recharts/es6/cartesian/CartesianAxis.js +7 -7
  401. package/dist/node_modules/recharts/es6/cartesian/CartesianAxis.js.map +1 -1
  402. package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js +4 -4
  403. package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js.map +1 -1
  404. package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js +3 -3
  405. package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js.map +1 -1
  406. package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js +3 -3
  407. package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js.map +1 -1
  408. package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js +4 -4
  409. package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js.map +1 -1
  410. package/dist/node_modules/recharts/es6/cartesian/XAxis.js +3 -3
  411. package/dist/node_modules/recharts/es6/cartesian/XAxis.js.map +1 -1
  412. package/dist/node_modules/recharts/es6/cartesian/YAxis.js +3 -3
  413. package/dist/node_modules/recharts/es6/cartesian/YAxis.js.map +1 -1
  414. package/dist/node_modules/recharts/es6/cartesian/getEquidistantTicks.js.map +1 -1
  415. package/dist/node_modules/recharts/es6/cartesian/getTicks.js.map +1 -1
  416. package/dist/node_modules/recharts/es6/chart/AccessibilityManager.js +1 -1
  417. package/dist/node_modules/recharts/es6/chart/AccessibilityManager.js.map +1 -1
  418. package/dist/node_modules/recharts/es6/chart/AreaChart.js.map +1 -1
  419. package/dist/node_modules/recharts/es6/chart/BarChart.js.map +1 -1
  420. package/dist/node_modules/recharts/es6/chart/PieChart.js.map +1 -1
  421. package/dist/node_modules/recharts/es6/chart/generateCategoricalChart.js +22 -22
  422. package/dist/node_modules/recharts/es6/chart/generateCategoricalChart.js.map +1 -1
  423. package/dist/node_modules/recharts/es6/component/Cell.js.map +1 -1
  424. package/dist/node_modules/recharts/es6/component/Cursor.js +1 -1
  425. package/dist/node_modules/recharts/es6/component/Cursor.js.map +1 -1
  426. package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js +11 -11
  427. package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js.map +1 -1
  428. package/dist/node_modules/recharts/es6/component/DefaultTooltipContent.js +6 -6
  429. package/dist/node_modules/recharts/es6/component/DefaultTooltipContent.js.map +1 -1
  430. package/dist/node_modules/recharts/es6/component/Label.js +14 -14
  431. package/dist/node_modules/recharts/es6/component/Label.js.map +1 -1
  432. package/dist/node_modules/recharts/es6/component/LabelList.js +6 -6
  433. package/dist/node_modules/recharts/es6/component/LabelList.js.map +1 -1
  434. package/dist/node_modules/recharts/es6/component/Legend.js +5 -5
  435. package/dist/node_modules/recharts/es6/component/Legend.js.map +1 -1
  436. package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js +3 -3
  437. package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js.map +1 -1
  438. package/dist/node_modules/recharts/es6/component/Text.js +2 -2
  439. package/dist/node_modules/recharts/es6/component/Text.js.map +1 -1
  440. package/dist/node_modules/recharts/es6/component/Tooltip.js +3 -3
  441. package/dist/node_modules/recharts/es6/component/Tooltip.js.map +1 -1
  442. package/dist/node_modules/recharts/es6/component/TooltipBoundingBox.js +2 -2
  443. package/dist/node_modules/recharts/es6/component/TooltipBoundingBox.js.map +1 -1
  444. package/dist/node_modules/recharts/es6/container/Layer.js +2 -2
  445. package/dist/node_modules/recharts/es6/container/Layer.js.map +1 -1
  446. package/dist/node_modules/recharts/es6/container/Surface.js +2 -2
  447. package/dist/node_modules/recharts/es6/container/Surface.js.map +1 -1
  448. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +2 -2
  449. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js.map +1 -1
  450. package/dist/node_modules/recharts/es6/polar/Pie.js +13 -13
  451. package/dist/node_modules/recharts/es6/polar/Pie.js.map +1 -1
  452. package/dist/node_modules/recharts/es6/polar/PolarAngleAxis.js +8 -8
  453. package/dist/node_modules/recharts/es6/polar/PolarAngleAxis.js.map +1 -1
  454. package/dist/node_modules/recharts/es6/polar/PolarRadiusAxis.js +6 -6
  455. package/dist/node_modules/recharts/es6/polar/PolarRadiusAxis.js.map +1 -1
  456. package/dist/node_modules/recharts/es6/shape/Cross.js +1 -1
  457. package/dist/node_modules/recharts/es6/shape/Cross.js.map +1 -1
  458. package/dist/node_modules/recharts/es6/shape/Curve.js +1 -1
  459. package/dist/node_modules/recharts/es6/shape/Curve.js.map +1 -1
  460. package/dist/node_modules/recharts/es6/shape/Dot.js +1 -1
  461. package/dist/node_modules/recharts/es6/shape/Dot.js.map +1 -1
  462. package/dist/node_modules/recharts/es6/shape/Polygon.js +4 -4
  463. package/dist/node_modules/recharts/es6/shape/Polygon.js.map +1 -1
  464. package/dist/node_modules/recharts/es6/shape/Rectangle.js +4 -4
  465. package/dist/node_modules/recharts/es6/shape/Rectangle.js.map +1 -1
  466. package/dist/node_modules/recharts/es6/shape/Sector.js +1 -1
  467. package/dist/node_modules/recharts/es6/shape/Sector.js.map +1 -1
  468. package/dist/node_modules/recharts/es6/shape/Symbols.js +1 -1
  469. package/dist/node_modules/recharts/es6/shape/Symbols.js.map +1 -1
  470. package/dist/node_modules/recharts/es6/shape/Trapezoid.js +4 -4
  471. package/dist/node_modules/recharts/es6/shape/Trapezoid.js.map +1 -1
  472. package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js +9 -9
  473. package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js.map +1 -1
  474. package/dist/node_modules/recharts/es6/util/BarUtils.js +1 -1
  475. package/dist/node_modules/recharts/es6/util/BarUtils.js.map +1 -1
  476. package/dist/node_modules/recharts/es6/util/CartesianUtils.js +1 -1
  477. package/dist/node_modules/recharts/es6/util/CartesianUtils.js.map +1 -1
  478. package/dist/node_modules/recharts/es6/util/ChartUtils.js.map +1 -1
  479. package/dist/node_modules/recharts/es6/util/CssPrefixUtils.js.map +1 -1
  480. package/dist/node_modules/recharts/es6/util/DOMUtils.js.map +1 -1
  481. package/dist/node_modules/recharts/es6/util/DataUtils.js.map +1 -1
  482. package/dist/node_modules/recharts/es6/util/DetectReferenceElementsDomain.js.map +1 -1
  483. package/dist/node_modules/recharts/es6/util/Events.js.map +1 -1
  484. package/dist/node_modules/recharts/es6/util/Global.js.map +1 -1
  485. package/dist/node_modules/recharts/es6/util/IfOverflowMatches.js.map +1 -1
  486. package/dist/node_modules/recharts/es6/util/LogUtils.js.map +1 -1
  487. package/dist/node_modules/recharts/es6/util/PolarUtils.js +1 -1
  488. package/dist/node_modules/recharts/es6/util/PolarUtils.js.map +1 -1
  489. package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
  490. package/dist/node_modules/recharts/es6/util/ReactUtils.js.map +1 -1
  491. package/dist/node_modules/recharts/es6/util/ReduceCSSCalc.js +1 -1
  492. package/dist/node_modules/recharts/es6/util/ReduceCSSCalc.js.map +1 -1
  493. package/dist/node_modules/recharts/es6/util/ShallowEqual.js.map +1 -1
  494. package/dist/node_modules/recharts/es6/util/TickUtils.js.map +1 -1
  495. package/dist/node_modules/recharts/es6/util/calculateViewBox.js.map +1 -1
  496. package/dist/node_modules/recharts/es6/util/cursor/getCursorPoints.js.map +1 -1
  497. package/dist/node_modules/recharts/es6/util/cursor/getCursorRectangle.js.map +1 -1
  498. package/dist/node_modules/recharts/es6/util/cursor/getRadialCursorPoints.js.map +1 -1
  499. package/dist/node_modules/recharts/es6/util/getEveryNthWithCondition.js.map +1 -1
  500. package/dist/node_modules/recharts/es6/util/getLegendProps.js.map +1 -1
  501. package/dist/node_modules/recharts/es6/util/isDomainSpecifiedByUser.js.map +1 -1
  502. package/dist/node_modules/recharts/es6/util/payload/getUniqPayload.js.map +1 -1
  503. package/dist/node_modules/recharts/es6/util/tooltip/translate.js.map +1 -1
  504. package/dist/node_modules/recharts/es6/util/types.js +1 -1
  505. package/dist/node_modules/recharts/es6/util/types.js.map +1 -1
  506. package/dist/node_modules/recharts-scale/es6/getNiceTickValues.js.map +1 -1
  507. package/dist/node_modules/recharts-scale/es6/util/arithmetic.js.map +1 -1
  508. package/dist/node_modules/recharts-scale/es6/util/utils.js.map +1 -1
  509. package/dist/node_modules/sonner/dist/index.js.map +1 -1
  510. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1 -1
  511. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  512. package/dist/node_modules/tiny-invariant/dist/esm/tiny-invariant.js.map +1 -1
  513. package/dist/stories/LoadMore.stories.d.ts +0 -1
  514. package/package.json +15 -7
@@ -1,5 +1,5 @@
1
1
  //#region \0rolldown/runtime.js
2
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), s = (e, n) => {
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
3
3
  let r = {};
4
4
  for (var i in e) t(r, i, {
5
5
  get: e[i],
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { BrainyRichRootProps } from './types';
3
-
4
3
  export declare const BrainyRichRoot: FC<BrainyRichRootProps>;
5
4
  //# sourceMappingURL=BrainyRichRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrainyRichRoot.js","names":[],"sources":["../../src/brainyrich/BrainyRichRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport {\n LayoutDashboard,\n Briefcase,\n TrendingUp,\n Target,\n Landmark,\n BarChart3,\n ShieldAlert,\n Calculator,\n UsersRound,\n FileBarChart,\n Bot,\n Building2,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { BrainyRichProvider } from './providers/BrainyRichProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, BrainyRichRootProps } from './types';\nimport { tWithFallback } from './utils/i18n';\nimport { BrainyRichRoutes } from './BrainyRichRoutes';\nimport { joinPath } from './utils/navigation';\n\nexport const BrainyRichRoot: FC<BrainyRichRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const translate = (key: string, fallback: string) => tWithFallback(t, key, fallback);\n\n useEffect(() => {\n if (!registerNavItems) return;\n const navItem: NavItem = {\n id: 'brainyrich',\n label: translate('brainyrich.nav.root', 'BrainyRich'),\n path: basePath,\n icon: <LayoutDashboard size={20} />,\n order: 80,\n group: 'products',\n children: [\n // Overview\n {\n id: 'brainyrich-dashboard',\n label: translate('brainyrich.nav.dashboard', 'Dashboard'),\n path: basePath,\n icon: <LayoutDashboard size={16} />,\n order: 0,\n },\n\n // Wealth Management\n {\n id: 'brainyrich-portfolios',\n label: translate('brainyrich.nav.portfolios', 'Portfolios'),\n path: joinPath(basePath, 'portfolios'),\n icon: <Briefcase size={16} />,\n order: 10,\n },\n {\n id: 'brainyrich-investments',\n label: translate('brainyrich.nav.investments', 'Investments'),\n path: joinPath(basePath, 'investments'),\n icon: <TrendingUp size={16} />,\n order: 11,\n },\n {\n id: 'brainyrich-goals',\n label: translate('brainyrich.nav.goals', 'Goals'),\n path: joinPath(basePath, 'goals'),\n icon: <Target size={16} />,\n order: 12,\n },\n {\n id: 'brainyrich-accounts',\n label: translate('brainyrich.nav.accounts', 'Accounts'),\n path: joinPath(basePath, 'accounts'),\n icon: <Landmark size={16} />,\n order: 13,\n },\n\n // Advisory & Insights\n {\n id: 'brainyrich-analytics',\n label: translate('brainyrich.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={16} />,\n order: 21,\n },\n {\n id: 'brainyrich-risk',\n label: translate('brainyrich.nav.risk', 'Rebalancing'),\n path: joinPath(basePath, 'risk'),\n icon: <ShieldAlert size={16} />,\n order: 22,\n },\n\n // Tax\n {\n id: 'brainyrich-tax',\n label: translate('brainyrich.nav.tax', 'Tax'),\n path: joinPath(basePath, 'tax'),\n icon: <Calculator size={16} />,\n order: 30,\n },\n\n // Households & Reports\n {\n id: 'brainyrich-family',\n label: translate('brainyrich.nav.family', 'Households'),\n path: joinPath(basePath, 'family'),\n icon: <UsersRound size={16} />,\n order: 40,\n },\n {\n id: 'brainyrich-reports',\n label: translate('brainyrich.nav.reports', 'Reports'),\n path: joinPath(basePath, 'reports'),\n icon: <FileBarChart size={16} />,\n order: 42,\n },\n {\n id: 'brainyrich-firm',\n label: translate('brainyrich.nav.firm', 'Firm'),\n path: joinPath(basePath, 'firm'),\n icon: <Building2 size={16} />,\n order: 45,\n },\n\n // Insights\n {\n id: 'brainyrich-ai-assistant',\n label: translate('brainyrich.nav.aiAssistant', 'Insights'),\n path: joinPath(basePath, 'ai-assistant'),\n icon: <Bot size={16} />,\n order: 50,\n },\n ],\n };\n return registerNavItems(navItem);\n }, [registerNavItems, basePath, t]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'brainyrich-status',\n label: translate('brainyrich.footer.ready', 'BrainyRich Ready'),\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems, t]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <BrainyRichProvider {...props}>\n <BrainyRichRoutes />\n </BrainyRichProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AAwBA,IAAa,KAA2C,MAAU;CAChE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,SAAM,GAAS,EACjB,KAAa,GAAa,MAAqB,EAAc,GAAG,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OAAO,EAAU,sBAAsB,MAAM;KAC7C,MAAM,EAAS,GAAU,MAAM;KAC/B,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;KAC9B,OAAO;KACR;IAGD;KACE,IAAI;KACJ,OAAO,EAAU,yBAAyB,aAAa;KACvD,MAAM,EAAS,GAAU,SAAS;KAClC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;KAC9B,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAU,0BAA0B,UAAU;KACrD,MAAM,EAAS,GAAU,UAAU;KACnC,MAAM,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA;KAChC,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAU,uBAAuB,OAAO;KAC/C,MAAM,EAAS,GAAU,OAAO;KAChC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAC7B,OAAO;KACR;IAGD;KACE,IAAI;KACJ,OAAO,EAAU,8BAA8B,WAAW;KAC1D,MAAM,EAAS,GAAU,eAAe;KACxC,MAAM,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;KACvB,OAAO;KACR;IACF;GACF,CAC+B;IAC/B;EAAC;EAAkB;EAAU;EAAE,CAAC,EAEnC,QAAgB;AACT,QACL,QAAO,EAAoB,CACzB;GACE,IAAI;GACJ,OAAO,EAAU,2BAA2B,mBAAmB;GAC/D,MAAM;GACN,SAAS;GACT,OAAO;GACR,CACF,CAAC;IACD,CAAC,GAAqB,EAAE,CAAC,EAG1B,kBAAC,GAAD;EAAqB,aAAa;EAAM,SAAQ;EAAS,gBAAgB;YACvE,kBAAC,GAAD;GAAoB,GAAI;aACtB,kBAAC,GAAD,EAAoB,CAAA;GACD,CAAA;EACD,CAAA"}
1
+ {"version":3,"file":"BrainyRichRoot.js","names":[],"sources":["../../src/brainyrich/BrainyRichRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport {\n LayoutDashboard,\n Briefcase,\n TrendingUp,\n Target,\n Landmark,\n BarChart3,\n ShieldAlert,\n Calculator,\n UsersRound,\n FileBarChart,\n Bot,\n Building2,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { BrainyRichProvider } from './providers/BrainyRichProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, BrainyRichRootProps } from './types';\nimport { tWithFallback } from './utils/i18n';\nimport { BrainyRichRoutes } from './BrainyRichRoutes';\nimport { joinPath } from './utils/navigation';\n\nexport const BrainyRichRoot: FC<BrainyRichRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const translate = (key: string, fallback: string) => tWithFallback(t, key, fallback);\n\n useEffect(() => {\n if (!registerNavItems) return;\n const navItem: NavItem = {\n id: 'brainyrich',\n label: translate('brainyrich.nav.root', 'BrainyRich'),\n path: basePath,\n icon: <LayoutDashboard size={20} />,\n order: 80,\n group: 'products',\n children: [\n // Overview\n {\n id: 'brainyrich-dashboard',\n label: translate('brainyrich.nav.dashboard', 'Dashboard'),\n path: basePath,\n icon: <LayoutDashboard size={16} />,\n order: 0,\n },\n\n // Wealth Management\n {\n id: 'brainyrich-portfolios',\n label: translate('brainyrich.nav.portfolios', 'Portfolios'),\n path: joinPath(basePath, 'portfolios'),\n icon: <Briefcase size={16} />,\n order: 10,\n },\n {\n id: 'brainyrich-investments',\n label: translate('brainyrich.nav.investments', 'Investments'),\n path: joinPath(basePath, 'investments'),\n icon: <TrendingUp size={16} />,\n order: 11,\n },\n {\n id: 'brainyrich-goals',\n label: translate('brainyrich.nav.goals', 'Goals'),\n path: joinPath(basePath, 'goals'),\n icon: <Target size={16} />,\n order: 12,\n },\n {\n id: 'brainyrich-accounts',\n label: translate('brainyrich.nav.accounts', 'Accounts'),\n path: joinPath(basePath, 'accounts'),\n icon: <Landmark size={16} />,\n order: 13,\n },\n\n // Advisory & Insights\n {\n id: 'brainyrich-analytics',\n label: translate('brainyrich.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={16} />,\n order: 21,\n },\n {\n id: 'brainyrich-risk',\n label: translate('brainyrich.nav.risk', 'Rebalancing'),\n path: joinPath(basePath, 'risk'),\n icon: <ShieldAlert size={16} />,\n order: 22,\n },\n\n // Tax\n {\n id: 'brainyrich-tax',\n label: translate('brainyrich.nav.tax', 'Tax'),\n path: joinPath(basePath, 'tax'),\n icon: <Calculator size={16} />,\n order: 30,\n },\n\n // Households & Reports\n {\n id: 'brainyrich-family',\n label: translate('brainyrich.nav.family', 'Households'),\n path: joinPath(basePath, 'family'),\n icon: <UsersRound size={16} />,\n order: 40,\n },\n {\n id: 'brainyrich-reports',\n label: translate('brainyrich.nav.reports', 'Reports'),\n path: joinPath(basePath, 'reports'),\n icon: <FileBarChart size={16} />,\n order: 42,\n },\n {\n id: 'brainyrich-firm',\n label: translate('brainyrich.nav.firm', 'Firm'),\n path: joinPath(basePath, 'firm'),\n icon: <Building2 size={16} />,\n order: 45,\n },\n\n // Insights\n {\n id: 'brainyrich-ai-assistant',\n label: translate('brainyrich.nav.aiAssistant', 'Insights'),\n path: joinPath(basePath, 'ai-assistant'),\n icon: <Bot size={16} />,\n order: 50,\n },\n ],\n };\n return registerNavItems(navItem);\n }, [registerNavItems, basePath, t]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'brainyrich-status',\n label: translate('brainyrich.footer.ready', 'BrainyRich Ready'),\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems, t]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <BrainyRichProvider {...props}>\n <BrainyRichRoutes />\n </BrainyRichProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AAwBA,IAAa,KAA2C,MAAU;CAChE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW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ources":["../../src/brainyrich/BrainyRichRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, type ReactNode } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { Loader2 } from 'lucide-react';\nimport { FeatureGate } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { DashboardPage as IndexPage } from './pages/DashboardPage';\n\nconst AiAssistantPage = lazy(() =>\n import('./pages/AiAssistantPage').then((m) => ({ default: m.AiAssistantPage }))\n);\nconst AnalyticsPage = lazy(() =>\n import('./pages/AnalyticsPage').then((m) => ({ default: m.AnalyticsPage }))\n);\nconst AccountsPage = lazy(() =>\n import('./pages/AccountsPage').then((m) => ({ default: m.AccountsPage }))\n);\nconst FamilyPage = lazy(() =>\n import('./pages/FamilyPage').then((m) => ({ default: m.FamilyPage }))\n);\nconst FirmPage = lazy(() => import('./pages/FirmPage').then((m) => ({ default: m.FirmPage })));\nconst AdminFirmPage = lazy(() =>\n import('./pages/AdminFirmPage').then((m) => ({ default: m.AdminFirmPage }))\n);\nconst GoalsPage = lazy(() => import('./pages/GoalsPage').then((m) => ({ default: m.GoalsPage })));\nconst InvestmentsPage = lazy(() =>\n import('./pages/InvestmentsPage').then((m) => ({ default: m.InvestmentsPage }))\n);\nconst PortfoliosPage = lazy(() =>\n import('./pages/PortfoliosPage').then((m) => ({ default: m.PortfoliosPage }))\n);\nconst ReportsPage = lazy(() =>\n import('./pages/ReportsPage').then((m) => ({ default: m.ReportsPage }))\n);\nconst RiskPage = lazy(() => import('./pages/RiskPage').then((m) => ({ default: m.RiskPage })));\nconst TaxPage = lazy(() => import('./pages/TaxPage').then((m) => ({ default: m.TaxPage })));\n\nfunction PageLoader() {\n return (\n <div className=\"flex min-h-[320px] items-center justify-center\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n );\n}\n\nfunction gatedRoute(flag: string, element: ReactNode) {\n return (\n <FeatureGate flag={flag} fallback={<Navigate to=\"\" replace />} defaultValue>\n {element}\n </FeatureGate>\n );\n}\n\nexport function BrainyRichRoutes() {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<IndexPage />} />\n <Route\n path=\"ai-assistant\"\n element={gatedRoute('brainyrich.route.aiAssistant', <AiAssistantPage />)}\n />\n <Route\n path=\"analytics\"\n element={gatedRoute('brainyrich.route.analytics', <AnalyticsPage />)}\n />\n <Route\n path=\"accounts\"\n element={gatedRoute('brainyrich.route.accounts', <AccountsPage />)}\n />\n <Route path=\"family\" element={gatedRoute('brainyrich.route.family', <FamilyPage />)} />\n <Route path=\"firm\" element={gatedRoute('brainyrich.route.firm', <FirmPage />)} />\n <Route\n path=\"admin/firm\"\n element={gatedRoute('brainyrich.route.admin.firm', <AdminFirmPage />)}\n />\n <Route path=\"goals\" element={gatedRoute('brainyrich.route.goals', <GoalsPage />)} />\n <Route\n path=\"investments\"\n element={gatedRoute('brainyrich.route.investments', <InvestmentsPage />)}\n />\n <Route\n path=\"portfolios\"\n element={gatedRoute('brainyrich.route.portfolios', <PortfoliosPage />)}\n />\n <Route path=\"reports\" element={gatedRoute('brainyrich.route.reports', <ReportsPage />)} />\n <Route path=\"risk\" element={gatedRoute('brainyrich.route.risk', <RiskPage />)} />\n <Route path=\"tax\" element={gatedRoute('brainyrich.route.tax', <TaxPage />)} />\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;AAMA,IAAM,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAgB,QACpB,OAAO,4BAAyB,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAC5E,EACK,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAa,QACjB,OAAO,yBAAsB,MAAM,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CACtE,EACK,IAAW,QAAW,OAAO,uBAAo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["../../src/brainyrich/BrainyRichRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, type ReactNode } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { Loader2 } from 'lucide-react';\nimport { FeatureGate } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { DashboardPage as IndexPage } from './pages/DashboardPage';\n\nconst AiAssistantPage = lazy(() =>\n import('./pages/AiAssistantPage').then((m) => ({ default: m.AiAssistantPage }))\n);\nconst AnalyticsPage = lazy(() =>\n import('./pages/AnalyticsPage').then((m) => ({ default: m.AnalyticsPage }))\n);\nconst AccountsPage = lazy(() =>\n import('./pages/AccountsPage').then((m) => ({ default: m.AccountsPage }))\n);\nconst FamilyPage = lazy(() =>\n import('./pages/FamilyPage').then((m) => ({ default: m.FamilyPage }))\n);\nconst FirmPage = lazy(() => import('./pages/FirmPage').then((m) => ({ default: m.FirmPage })));\nconst AdminFirmPage = lazy(() =>\n import('./pages/AdminFirmPage').then((m) => ({ default: m.AdminFirmPage }))\n);\nconst GoalsPage = lazy(() => import('./pages/GoalsPage').then((m) => ({ default: m.GoalsPage })));\nconst InvestmentsPage = lazy(() =>\n import('./pages/InvestmentsPage').then((m) => ({ default: m.InvestmentsPage }))\n);\nconst PortfoliosPage = lazy(() =>\n import('./pages/PortfoliosPage').then((m) => ({ default: m.PortfoliosPage }))\n);\nconst ReportsPage = lazy(() =>\n import('./pages/ReportsPage').then((m) => ({ default: m.ReportsPage }))\n);\nconst RiskPage = lazy(() => import('./pages/RiskPage').then((m) => ({ default: m.RiskPage })));\nconst TaxPage = lazy(() => import('./pages/TaxPage').then((m) => ({ default: m.TaxPage })));\n\nfunction PageLoader() {\n return (\n <div className=\"flex min-h-[320px] items-center justify-center\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n );\n}\n\nfunction gatedRoute(flag: string, element: ReactNode) {\n return (\n <FeatureGate flag={flag} fallback={<Navigate to=\"\" replace />} defaultValue>\n {element}\n </FeatureGate>\n );\n}\n\nexport function BrainyRichRoutes() {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<IndexPage />} />\n <Route\n path=\"ai-assistant\"\n element={gatedRoute('brainyrich.route.aiAssistant', <AiAssistantPage />)}\n />\n <Route\n path=\"analytics\"\n element={gatedRoute('brainyrich.route.analytics', <AnalyticsPage />)}\n />\n <Route\n path=\"accounts\"\n element={gatedRoute('brainyrich.route.accounts', <AccountsPage />)}\n />\n <Route path=\"family\" element={gatedRoute('brainyrich.route.family', <FamilyPage />)} />\n <Route path=\"firm\" element={gatedRoute('brainyrich.route.firm', <FirmPage />)} />\n <Route\n path=\"admin/firm\"\n element={gatedRoute('brainyrich.route.admin.firm', <AdminFirmPage />)}\n />\n <Route path=\"goals\" element={gatedRoute('brainyrich.route.goals', <GoalsPage />)} />\n <Route\n path=\"investments\"\n element={gatedRoute('brainyrich.route.investments', <InvestmentsPage />)}\n />\n <Route\n path=\"portfolios\"\n element={gatedRoute('brainyrich.route.portfolios', <PortfoliosPage />)}\n />\n <Route path=\"reports\" element={gatedRoute('brainyrich.route.reports', <ReportsPage />)} />\n <Route path=\"risk\" element={gatedRoute('brainyrich.route.risk', <RiskPage />)} />\n <Route path=\"tax\" element={gatedRoute('brainyrich.route.tax', <TaxPage />)} />\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;AAMA,IAAM,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAChF,GACM,IAAgB,QACpB,OAAO,4BAAyB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC5E,GACM,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAC1E,GACM,IAAa,QACjB,OAAO,yBAAsB,MAAM,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CACtE,GACM,IAAW,QAAW,OAAO,uBAAoB,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orName.js","names":[],"sources":["../../../src/brainyrich/components/ActorName.tsx"],"sourcesContent":["/**\n * Render an actor UUID (owner / advisor / proposedBy / acknowledgedBy …) as a\n * human-readable display name.\n * @module brainyrich/components/ActorName\n *\n * Wraps fe-libs `useActorProfiles`, which resolves identities via the GLOBAL\n * gateway (workspace-member → org-member → admin lookup → local fallback) with\n * an internal 5-minute cache. The MFE is handed a *workspace* `apiGatewayUrl`;\n * `useActorProfiles` detects that and only uses it for the workspace-scoped\n * tier, resolving the global gateway from the hostname itself — so forwarding\n * our workspace URL is safe. Network failures degrade to a short-id fallback,\n * never an error.\n */\n\nimport { useMemo } from 'react';\nimport { useActorProfiles, type ActorInput } from '@burdenoff/fe-libs/shared';\nimport { useBrainyRich } from '../providers/BrainyRichProvider';\n\nexport interface ActorNameProps {\n /** Actor id (usually a user UUID). */\n id?: string | null;\n /** Actor type — 'user' (default), 'app', 'service', 'super_admin'. */\n actorType?: string;\n className?: string;\n /** Shown when `id` is absent/empty (default \"—\"). */\n fallback?: string;\n /** Also render the secondary label (email / short id) under the name. */\n withSecondary?: boolean;\n}\n\nexport function ActorName({\n id,\n actorType = 'user',\n className = '',\n fallback = '—',\n withSecondary = false,\n}: ActorNameProps) {\n const { apiGatewayUrl, authToken, workspaceId } = useBrainyRich();\n\n // Stable single-actor input list. Hook is always called (never conditional).\n const actors = useMemo<ActorInput[]>(\n () => (id ? [{ actorId: id, actorType }] : []),\n [id, actorType]\n );\n const profiles = useActorProfiles(actors, { apiGatewayUrl, authToken, workspaceId });\n\n if (!id) return <span className={className}>{fallback}</span>;\n\n const profile = profiles[id];\n const displayName = profile?.displayName ?? id;\n\n if (withSecondary && profile?.secondaryLabel && profile.secondaryLabel !== displayName) {\n return (\n <span className={className}>\n <span className=\"text-text-primary\">{displayName}</span>\n <span className=\"block text-xs text-text-secondary\">{profile.secondaryLabel}</span>\n </span>\n );\n }\n\n return (\n <span className={className} title={profile?.email ?? id}>\n {displayName}\n </span>\n );\n}\n"],"mappings":";;;;;AA8BA,SAAgB,EAAU,EACxB,OACA,eAAY,QACZ,eAAY,IACZ,cAAW,KACX,mBAAgB,MACC;CACjB,IAAM,EAAE,kBAAe,cAAW,mBAAgB,GAAe,EAO3D,IAAW,EAJF,QACN,IAAK,CAAC;EAAE,SAAS;EAAI;EAAW,CAAC,GAAG,EAAE,EAC7C,CAAC,GAAI,EAAU,CAChB,EACyC;EAAE;EAAe;EAAW;EAAa,CAAC;AAEpF,KAAI,CAAC,EAAI,QAAO,kBAAC,QAAD;EAAiB;YAAY;EAAgB,CAAA;CAE7D,IAAM,IAAU,EAAS,IACnB,IAAc,GAAS,eAAe;AAW5C,QATI,KAAiB,GAAS,kBAAkB,EAAQ,mBAAmB,IAEvE,kBAAC,QAAD;EAAiB;YAAjB,CACE,kBAAC,QAAD;GAAM,WAAU;aAAqB;GAAmB,CAAA,EACxD,kBAAC,QAAD;GAAM,WAAU;aAAqC,EAAQ;GAAsB,CAAA,CAC9E;MAKT,kBAAC,QAAD;EAAiB;EAAW,OAAO,GAAS,SAAS;YAClD;EACI,CAAA"}
1
+ {"version":3,"file":"ActorName.js","names":[],"sources":["../../../src/brainyrich/components/ActorName.tsx"],"sourcesContent":["/**\n * Render an actor UUID (owner / advisor / proposedBy / acknowledgedBy …) as a\n * human-readable display name.\n * @module brainyrich/components/ActorName\n *\n * Wraps fe-libs `useActorProfiles`, which resolves identities via the GLOBAL\n * gateway (workspace-member → org-member → admin lookup → local fallback) with\n * an internal 5-minute cache. The MFE is handed a *workspace* `apiGatewayUrl`;\n * `useActorProfiles` detects that and only uses it for the workspace-scoped\n * tier, resolving the global gateway from the hostname itself — so forwarding\n * our workspace URL is safe. Network failures degrade to a short-id fallback,\n * never an error.\n */\n\nimport { useMemo } from 'react';\nimport { useActorProfiles, type ActorInput } from '@burdenoff/fe-libs/shared';\nimport { useBrainyRich } from '../providers/BrainyRichProvider';\n\nexport interface ActorNameProps {\n /** Actor id (usually a user UUID). */\n id?: string | null;\n /** Actor type — 'user' (default), 'app', 'service', 'super_admin'. */\n actorType?: string;\n className?: string;\n /** Shown when `id` is absent/empty (default \"—\"). */\n fallback?: string;\n /** Also render the secondary label (email / short id) under the name. */\n withSecondary?: boolean;\n}\n\nexport function ActorName({\n id,\n actorType = 'user',\n className = '',\n fallback = '—',\n withSecondary = false,\n}: ActorNameProps) {\n const { apiGatewayUrl, authToken, workspaceId } = useBrainyRich();\n\n // Stable single-actor input list. Hook is always called (never conditional).\n const actors = useMemo<ActorInput[]>(\n () => (id ? [{ actorId: id, actorType }] : []),\n [id, actorType]\n );\n const profiles = useActorProfiles(actors, { apiGatewayUrl, authToken, workspaceId });\n\n if (!id) return <span className={className}>{fallback}</span>;\n\n const profile = profiles[id];\n const displayName = profile?.displayName ?? id;\n\n if (withSecondary && profile?.secondaryLabel && profile.secondaryLabel !== displayName) {\n return (\n <span className={className}>\n <span className=\"text-text-primary\">{displayName}</span>\n <span className=\"block text-xs text-text-secondary\">{profile.secondaryLabel}</span>\n </span>\n );\n }\n\n return (\n <span className={className} title={profile?.email ?? id}>\n {displayName}\n </span>\n );\n}\n"],"mappings":";;;;;AA8BA,SAAgB,EAAU,EACxB,OACA,eAAY,QACZ,eAAY,IACZ,cAAW,KACX,mBAAgB,MACC;CACjB,IAAM,EAAE,kBAAe,cAAW,mBAAgB,EAAc,GAO1D,IAAW,EAJF,QACN,IAAK,CAAC;EAAE,SAAS;EAAI;CAAU,CAAC,IAAI,CAAC,GAC5C,CAAC,GAAI,CAAS,CAEkB,GAAQ;EAAE;EAAe;EAAW;CAAY,CAAC;CAEnF,IAAI,CAAC,GAAI,OAAO,kBAAC,QAAD;EAAiB;YAAY;CAAe,CAAA;CAE5D,IAAM,IAAU,EAAS,IACnB,IAAc,GAAS,eAAe;CAW5C,OATI,KAAiB,GAAS,kBAAkB,EAAQ,mBAAmB,IAEvE,kBAAC,QAAD;EAAiB;YAAjB,CACE,kBAAC,QAAD;GAAM,WAAU;aAAqB;EAAkB,CAAA,GACvD,kBAAC,QAAD;GAAM,WAAU;aAAqC,EAAQ;EAAqB,CAAA,CAC9E;MAKR,kBAAC,QAAD;EAAiB;EAAW,OAAO,GAAS,SAAS;YAClD;CACG,CAAA;AAEV"}
@@ -1,5 +1,4 @@
1
1
  import { ReactNode } from 'react';
2
-
3
2
  export interface ConfirmDialogProps {
4
3
  open: boolean;
5
4
  onOpenChange: (open: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../../src/brainyrich/components/ConfirmDialog.tsx"],"sourcesContent":["/**\n * Shared confirmation dialog for destructive / irreversible actions.\n * @module brainyrich/components/ConfirmDialog\n *\n * Modeled on the archive-confirm dialog previously inlined in AccountsPage so\n * every destructive action (archive account/portfolio/goal/household, delete\n * holding, unlink funding, dismiss insight, reject rebalance) shares one\n * accessible, pending-aware surface.\n */\n\nimport type { ReactNode } from 'react';\nimport {\n Button,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n} from '@burdenoff/fe-libs/ui';\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description?: ReactNode;\n /** Label for the confirm button (default \"Confirm\"). */\n confirmLabel?: string;\n /** Label shown while `pending` (default \"Working…\"). */\n pendingLabel?: string;\n cancelLabel?: string;\n /** Render the confirm button with the destructive variant. */\n destructive?: boolean;\n /** Confirm action in flight — disables buttons + swaps the label. */\n pending?: boolean;\n onConfirm: () => void;\n}\n\nexport function ConfirmDialog({\n open,\n onOpenChange,\n title,\n description,\n confirmLabel = 'Confirm',\n pendingLabel = 'Working…',\n cancelLabel = 'Cancel',\n destructive = false,\n pending = false,\n onConfirm,\n}: ConfirmDialogProps) {\n return (\n <ResponsiveDialog open={open} onOpenChange={(next) => !pending && onOpenChange(next)}>\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>{title}</ResponsiveDialogTitle>\n {description ? (\n <ResponsiveDialogDescription>{description}</ResponsiveDialogDescription>\n ) : null}\n </ResponsiveDialogHeader>\n <ResponsiveDialogFooter>\n <Button variant=\"outline\" onClick={() => onOpenChange(false)} disabled={pending}>\n {cancelLabel}\n </Button>\n <Button\n variant={destructive ? 'destructive' : 'default'}\n onClick={onConfirm}\n disabled={pending}\n aria-busy={pending}\n >\n {pending ? pendingLabel : confirmLabel}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"],"mappings":";;;AAsCA,SAAgB,EAAc,EAC5B,SACA,iBACA,UACA,gBACA,kBAAe,WACf,kBAAe,YACf,iBAAc,UACd,iBAAc,IACd,aAAU,IACV,gBACqB;AACrB,QACE,kBAAC,GAAD;EAAwB;EAAM,eAAe,MAAS,CAAC,KAAW,EAAa,EAAK;YAClF,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAwB,GAA8B,CAAA,EACrD,IACC,kBAAC,GAAD,EAAA,UAA8B,GAA0C,CAAA,GACtE,KACmB,EAAA,CAAA,EACzB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GAAQ,SAAQ;GAAU,eAAe,EAAa,GAAM;GAAE,UAAU;aACrE;GACM,CAAA,EACT,kBAAC,GAAD;GACE,SAAS,IAAc,gBAAgB;GACvC,SAAS;GACT,UAAU;GACV,aAAW;aAEV,IAAU,IAAe;GACnB,CAAA,CACc,EAAA,CAAA,CACD,EAAA,CAAA;EACT,CAAA"}
1
+ {"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../../src/brainyrich/components/ConfirmDialog.tsx"],"sourcesContent":["/**\n * Shared confirmation dialog for destructive / irreversible actions.\n * @module brainyrich/components/ConfirmDialog\n *\n * Modeled on the archive-confirm dialog previously inlined in AccountsPage so\n * every destructive action (archive account/portfolio/goal/household, delete\n * holding, unlink funding, dismiss insight, reject rebalance) shares one\n * accessible, pending-aware surface.\n */\n\nimport type { ReactNode } from 'react';\nimport {\n Button,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n} from '@burdenoff/fe-libs/ui';\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description?: ReactNode;\n /** Label for the confirm button (default \"Confirm\"). */\n confirmLabel?: string;\n /** Label shown while `pending` (default \"Working…\"). */\n pendingLabel?: string;\n cancelLabel?: string;\n /** Render the confirm button with the destructive variant. */\n destructive?: boolean;\n /** Confirm action in flight — disables buttons + swaps the label. */\n pending?: boolean;\n onConfirm: () => void;\n}\n\nexport function ConfirmDialog({\n open,\n onOpenChange,\n title,\n description,\n confirmLabel = 'Confirm',\n pendingLabel = 'Working…',\n cancelLabel = 'Cancel',\n destructive = false,\n pending = false,\n onConfirm,\n}: ConfirmDialogProps) {\n return (\n <ResponsiveDialog open={open} onOpenChange={(next) => !pending && onOpenChange(next)}>\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>{title}</ResponsiveDialogTitle>\n {description ? (\n <ResponsiveDialogDescription>{description}</ResponsiveDialogDescription>\n ) : null}\n </ResponsiveDialogHeader>\n <ResponsiveDialogFooter>\n <Button variant=\"outline\" onClick={() => onOpenChange(false)} disabled={pending}>\n {cancelLabel}\n </Button>\n <Button\n variant={destructive ? 'destructive' : 'default'}\n onClick={onConfirm}\n disabled={pending}\n aria-busy={pending}\n >\n {pending ? pendingLabel : confirmLabel}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"],"mappings":";;;AAsCA,SAAgB,EAAc,EAC5B,SACA,iBACA,UACA,gBACA,kBAAe,WACf,kBAAe,YACf,iBAAc,UACd,iBAAc,IACd,aAAU,IACV,gBACqB;CACrB,OACE,kBAAC,GAAD;EAAwB;EAAM,eAAe,MAAS,CAAC,KAAW,EAAa,CAAI;YACjF,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAwB,EAA6B,CAAA,GACpD,IACC,kBAAC,GAAD,EAAA,UAA8B,EAAyC,CAAA,IACrE,IACkB,EAAA,CAAA,GACxB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GAAQ,SAAQ;GAAU,eAAe,EAAa,EAAK;GAAG,UAAU;aACrE;EACK,CAAA,GACR,kBAAC,GAAD;GACE,SAAS,IAAc,gBAAgB;GACvC,SAAS;GACT,UAAU;GACV,aAAW;aAEV,IAAU,IAAe;EACpB,CAAA,CACc,EAAA,CAAA,CACD,EAAA,CAAA;CACT,CAAA;AAEtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoadMore.js","names":[],"sources":["../../../src/brainyrich/components/LoadMore.tsx"],"sourcesContent":["/**\n * \"Load more\" button for cursor-paginated list pages.\n * @module brainyrich/components/LoadMore\n *\n * Pair with the `usePaged*` hooks in `../hooks/useBrainyRichApi` (they expose\n * `hasMore`, `loadMore`, `isFetchingNextPage`). Renders nothing when there is\n * no next page, so it can be dropped unconditionally at the end of a list.\n */\n\nimport { Loader2 } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\nexport interface LoadMoreProps {\n /** Whether another page exists. Component renders null when false. */\n hasMore: boolean;\n /** Fetch the next page. */\n onClick: () => void;\n /** Next-page fetch in flight. */\n loading?: boolean;\n label?: string;\n loadingLabel?: string;\n className?: string;\n}\n\nexport function LoadMore({\n hasMore,\n onClick,\n loading = false,\n label = 'Load more',\n loadingLabel = 'Loading…',\n className = '',\n}: LoadMoreProps) {\n if (!hasMore) return null;\n return (\n <div className={`flex justify-center pt-4 ${className}`}>\n <Button variant=\"outline\" size=\"sm\" onClick={onClick} disabled={loading} aria-busy={loading}>\n {loading ? (\n <>\n <Loader2 className=\"size-4 motion-safe:animate-spin\" aria-hidden=\"true\" />\n {loadingLabel}\n </>\n ) : (\n label\n )}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;AAwBA,SAAgB,EAAS,EACvB,YACA,YACA,aAAU,IACV,WAAQ,aACR,kBAAe,YACf,eAAY,MACI;AAEhB,QADK,IAEH,kBAAC,OAAD;EAAK,WAAW,4BAA4B;YAC1C,kBAAC,GAAD;GAAQ,SAAQ;GAAU,MAAK;GAAc;GAAS,UAAU;GAAS,aAAW;aACjF,IACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IAAS,WAAU;IAAkC,eAAY;IAAS,CAAA,EACzE,EACA,EAAA,CAAA,GAEH;GAEK,CAAA;EACL,CAAA,GAba"}
1
+ {"version":3,"file":"LoadMore.js","names":[],"sources":["../../../src/brainyrich/components/LoadMore.tsx"],"sourcesContent":["/**\n * \"Load more\" button for cursor-paginated list pages.\n * @module brainyrich/components/LoadMore\n *\n * Pair with the `usePaged*` hooks in `../hooks/useBrainyRichApi` (they expose\n * `hasMore`, `loadMore`, `isFetchingNextPage`). Renders nothing when there is\n * no next page, so it can be dropped unconditionally at the end of a list.\n */\n\nimport { Loader2 } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\nexport interface LoadMoreProps {\n /** Whether another page exists. Component renders null when false. */\n hasMore: boolean;\n /** Fetch the next page. */\n onClick: () => void;\n /** Next-page fetch in flight. */\n loading?: boolean;\n label?: string;\n loadingLabel?: string;\n className?: string;\n}\n\nexport function LoadMore({\n hasMore,\n onClick,\n loading = false,\n label = 'Load more',\n loadingLabel = 'Loading…',\n className = '',\n}: LoadMoreProps) {\n if (!hasMore) return null;\n return (\n <div className={`flex justify-center pt-4 ${className}`}>\n <Button variant=\"outline\" size=\"sm\" onClick={onClick} disabled={loading} aria-busy={loading}>\n {loading ? (\n <>\n <Loader2 className=\"size-4 motion-safe:animate-spin\" aria-hidden=\"true\" />\n {loadingLabel}\n </>\n ) : (\n label\n )}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;AAwBA,SAAgB,EAAS,EACvB,YACA,YACA,aAAU,IACV,WAAQ,aACR,kBAAe,YACf,eAAY,MACI;CAEhB,OADK,IAEH,kBAAC,OAAD;EAAK,WAAW,4BAA4B;YAC1C,kBAAC,GAAD;GAAQ,SAAQ;GAAU,MAAK;GAAc;GAAS,UAAU;GAAS,aAAW;aACjF,IACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IAAS,WAAU;IAAkC,eAAY;GAAQ,CAAA,GACxE,CACD,EAAA,CAAA,IAEF;EAEI,CAAA;CACL,CAAA,IAbc;AAevB"}
@@ -1 +1 @@
1
- {"version":3,"file":"notify.js","names":[],"sources":["../../../src/brainyrich/components/notify.ts"],"sourcesContent":["/**\n * Centralized user-feedback surface for the BrainyRich MFE.\n * @module brainyrich/components/notify\n *\n * WHY sonner `toast()` and NOT a scoped `<Toaster/>`:\n * sonner exposes a *module-level singleton* store — every `toast()` call\n * renders through whichever `<Toaster/>` is mounted. The host application\n * shell (`AppShellProvider` in `@burdenoff/fe-libs`) already mounts exactly\n * one `<Toaster/>` (see `AppShellProvider.tsx`), so calling `toast()` from\n * here renders through it. Mounting a SECOND `<Toaster/>` in BrainyRichRoot\n * would produce the documented double-toast regression, so we deliberately\n * do not. `sonner` is pinned to the same `^2.0.7` fe-libs uses so the bundler\n * dedupes to a single instance (a duplicated copy would break the singleton).\n *\n * Every page/component and every mutation hook emits feedback through these\n * helpers instead of hand-rolling markup. Durations follow the platform\n * notification spec: success/info auto-dismiss; errors stay until dismissed\n * (sonner renders a close button + announces via aria-live for WCAG AA).\n */\n\nimport { toast } from 'sonner';\nimport { extractBackendError } from '@burdenoff/fe-libs/shared/utils';\n\nexport const notify = {\n success(message: string, description?: string): void {\n toast.success(message, { description, duration: 4000 });\n },\n info(message: string, description?: string): void {\n toast.info(message, { description, duration: 4000 });\n },\n warning(message: string, description?: string): void {\n toast.warning(message, { description, duration: 8000 });\n },\n error(message: string, description?: string): void {\n toast.error(message, { description, duration: Infinity, closeButton: true });\n },\n};\n\n/**\n * Resolve a human-friendly message from any thrown value. The bra transport\n * throws `new Error(<graphql error message>)`, so this runs that message through\n * fe-libs' `extractBackendError` (which maps known codes to friendly copy and\n * hides technical/prisma strings) and falls back to the raw message.\n */\nexport function errorMessage(\n error: unknown,\n fallback = 'Something went wrong. Please try again.'\n): string {\n const extracted = extractBackendError(error);\n if (extracted?.message) return extracted.message;\n if (error instanceof Error && error.message.trim()) return error.message;\n return fallback;\n}\n"],"mappings":";;;AAuBA,IAAa,IAAS;CACpB,QAAQ,GAAiB,GAA4B;AACnD,IAAM,QAAQ,GAAS;GAAE;GAAa,UAAU;GAAM,CAAC;;CAEzD,KAAK,GAAiB,GAA4B;AAChD,IAAM,KAAK,GAAS;GAAE;GAAa,UAAU;GAAM,CAAC;;CAEtD,QAAQ,GAAiB,GAA4B;AACnD,IAAM,QAAQ,GAAS;GAAE;GAAa,UAAU;GAAM,CAAC;;CAEzD,MAAM,GAAiB,GAA4B;AACjD,IAAM,MAAM,GAAS;GAAE;GAAa,UAAU;GAAU,aAAa;GAAM,CAAC;;CAE/E;AAQD,SAAgB,EACd,GACA,IAAW,2CACH;CACR,IAAM,IAAY,EAAoB,EAAM;AAG5C,QAFI,GAAW,UAAgB,EAAU,UACrC,aAAiB,SAAS,EAAM,QAAQ,MAAM,GAAS,EAAM,UAC1D"}
1
+ {"version":3,"file":"notify.js","names":[],"sources":["../../../src/brainyrich/components/notify.ts"],"sourcesContent":["/**\n * Centralized user-feedback surface for the BrainyRich MFE.\n * @module brainyrich/components/notify\n *\n * WHY sonner `toast()` and NOT a scoped `<Toaster/>`:\n * sonner exposes a *module-level singleton* store — every `toast()` call\n * renders through whichever `<Toaster/>` is mounted. The host application\n * shell (`AppShellProvider` in `@burdenoff/fe-libs`) already mounts exactly\n * one `<Toaster/>` (see `AppShellProvider.tsx`), so calling `toast()` from\n * here renders through it. Mounting a SECOND `<Toaster/>` in BrainyRichRoot\n * would produce the documented double-toast regression, so we deliberately\n * do not. `sonner` is pinned to the same `^2.0.7` fe-libs uses so the bundler\n * dedupes to a single instance (a duplicated copy would break the singleton).\n *\n * Every page/component and every mutation hook emits feedback through these\n * helpers instead of hand-rolling markup. Durations follow the platform\n * notification spec: success/info auto-dismiss; errors stay until dismissed\n * (sonner renders a close button + announces via aria-live for WCAG AA).\n */\n\nimport { toast } from 'sonner';\nimport { extractBackendError } from '@burdenoff/fe-libs/shared/utils';\n\nexport const notify = {\n success(message: string, description?: string): void {\n toast.success(message, { description, duration: 4000 });\n },\n info(message: string, description?: string): void {\n toast.info(message, { description, duration: 4000 });\n },\n warning(message: string, description?: string): void {\n toast.warning(message, { description, duration: 8000 });\n },\n error(message: string, description?: string): void {\n toast.error(message, { description, duration: Infinity, closeButton: true });\n },\n};\n\n/**\n * Resolve a human-friendly message from any thrown value. The bra transport\n * throws `new Error(<graphql error message>)`, so this runs that message through\n * fe-libs' `extractBackendError` (which maps known codes to friendly copy and\n * hides technical/prisma strings) and falls back to the raw message.\n */\nexport function errorMessage(\n error: unknown,\n fallback = 'Something went wrong. Please try again.'\n): string {\n const extracted = extractBackendError(error);\n if (extracted?.message) return extracted.message;\n if (error instanceof Error && error.message.trim()) return error.message;\n return fallback;\n}\n"],"mappings":";;;AAuBA,IAAa,IAAS;CACpB,QAAQ,GAAiB,GAA4B;EACnD,EAAM,QAAQ,GAAS;GAAE;GAAa,UAAU;EAAK,CAAC;CACxD;CACA,KAAK,GAAiB,GAA4B;EAChD,EAAM,KAAK,GAAS;GAAE;GAAa,UAAU;EAAK,CAAC;CACrD;CACA,QAAQ,GAAiB,GAA4B;EACnD,EAAM,QAAQ,GAAS;GAAE;GAAa,UAAU;EAAK,CAAC;CACxD;CACA,MAAM,GAAiB,GAA4B;EACjD,EAAM,MAAM,GAAS;GAAE;GAAa,UAAU;GAAU,aAAa;EAAK,CAAC;CAC7E;AACF;AAQA,SAAgB,EACd,GACA,IAAW,2CACH;CACR,IAAM,IAAY,EAAoB,CAAK;CAG3C,OAFI,GAAW,UAAgB,EAAU,UACrC,aAAiB,SAAS,EAAM,QAAQ,KAAK,IAAU,EAAM,UAC1D;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"pickers.js","names":[],"sources":["../../../src/brainyrich/components/pickers.tsx"],"sourcesContent":["/**\n * Reusable entity / subject pickers.\n * @module brainyrich/components/pickers\n *\n * - `SubjectPicker` — encodes `SUBJECT_TYPE:id` across accounts, portfolios,\n * goals and households (for the AiAssistant insight subject).\n * - `EntityPicker` — generic account / household Select returning a bare id.\n * - `AccountPicker` — convenience wrapper (kind=\"account\").\n * - `HouseholdPicker` — OPTIONAL household Select with a \"None\" option, for the\n * account create/edit form (accounts can be linked to a\n * household). Never a dead-end when no households exist.\n *\n * When a *required* source list is empty every picker renders a CTA that routes\n * the user to create the missing entity instead of showing an empty dropdown.\n */\n\nimport { Loader2 } from 'lucide-react';\nimport {\n Button,\n Label,\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectTrigger,\n SelectValue,\n} from '@burdenoff/fe-libs/ui';\nimport { useAccounts, useGoals, useHouseholds, usePortfolios } from '../hooks/useBrainyRichApi';\nimport { useBrainyRich } from '../providers/BrainyRichProvider';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Subject encoding (matches the SDL `subjectType` convention — uppercase)\n// ============================================================================\n\nexport const SUBJECT_KINDS = ['ACCOUNT', 'PORTFOLIO', 'GOAL', 'HOUSEHOLD'] as const;\nexport type SubjectKind = (typeof SUBJECT_KINDS)[number];\n\nconst SUBJECT_KIND_LABEL: Record<SubjectKind, string> = {\n ACCOUNT: 'Account',\n PORTFOLIO: 'Portfolio',\n GOAL: 'Goal',\n HOUSEHOLD: 'Household',\n};\n\n/** Encode a subject selection as the `SUBJECT_TYPE:id` token a SubjectPicker emits. */\nexport function encodeSubject(kind: SubjectKind, id: string): string {\n return `${kind}:${id}`;\n}\n\n/** Decode a `SUBJECT_TYPE:id` token back into `{ subjectType, subjectId }`. */\nexport function parseSubject(\n value: string | null | undefined\n): { subjectType: SubjectKind; subjectId: string } | null {\n if (!value) return null;\n const idx = value.indexOf(':');\n if (idx < 0) return null;\n const kind = value.slice(0, idx) as SubjectKind;\n const id = value.slice(idx + 1);\n if (!SUBJECT_KINDS.includes(kind) || !id) return null;\n return { subjectType: kind, subjectId: id };\n}\n\n// ============================================================================\n// Shared empty-state CTA (routes to the create surface, never a dead-end)\n// ============================================================================\n\nfunction PickerCTA({\n message,\n cta,\n relativePath,\n}: {\n message: string;\n cta: string;\n relativePath: string;\n}) {\n const { basePath = '/', navigate } = useBrainyRich();\n const target = joinPath(basePath, relativePath);\n return (\n <div className=\"rounded-lg border border-dashed border-border-subtle bg-bg-surface px-4 py-3 text-sm\">\n <p className=\"text-text-secondary\">{message}</p>\n {navigate ? (\n <Button variant=\"outline\" size=\"sm\" className=\"mt-2\" onClick={() => navigate(target)}>\n {cta}\n </Button>\n ) : null}\n </div>\n );\n}\n\nfunction PickerLoading({ id, label }: { id?: string; label?: string }) {\n return (\n <div className=\"space-y-2\">\n {label ? <Label htmlFor={id}>{label}</Label> : null}\n <div\n className=\"flex h-9 items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-secondary\"\n aria-busy=\"true\"\n >\n <Loader2 className=\"size-4 motion-safe:animate-spin\" aria-hidden=\"true\" />\n Loading…\n </div>\n </div>\n );\n}\n\n// ============================================================================\n// SubjectPicker — accounts + portfolios + goals + households\n// ============================================================================\n\nexport interface SubjectPickerProps {\n /** Current `SUBJECT_TYPE:id` token, or empty. */\n value?: string;\n onChange: (value: string) => void;\n id?: string;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n}\n\nexport function SubjectPicker({\n value,\n onChange,\n id = 'subject-picker',\n label = 'Subject',\n placeholder = 'Select a subject',\n disabled = false,\n}: SubjectPickerProps) {\n const accounts = useAccounts();\n const portfolios = usePortfolios();\n const goals = useGoals();\n const households = useHouseholds();\n\n const loading =\n accounts.isLoading || portfolios.isLoading || goals.isLoading || households.isLoading;\n const total =\n accounts.data.length + portfolios.data.length + goals.data.length + households.data.length;\n\n if (loading) return <PickerLoading id={id} label={label} />;\n\n if (total === 0) {\n return (\n <div className=\"space-y-2\">\n {label ? <Label htmlFor={id}>{label}</Label> : null}\n <PickerCTA\n message=\"No accounts, portfolios, goals or households yet — create one to attach this insight.\"\n cta=\"Create an account\"\n relativePath=\"accounts\"\n />\n </div>\n );\n }\n\n const groups: Array<{ kind: SubjectKind; items: Array<{ id: string; name: string }> }> = [\n { kind: 'ACCOUNT', items: accounts.data.map((a) => ({ id: a.id, name: a.name })) },\n { kind: 'PORTFOLIO', items: portfolios.data.map((p) => ({ id: p.id, name: p.name })) },\n { kind: 'GOAL', items: goals.data.map((g) => ({ id: g.id, name: g.name })) },\n { kind: 'HOUSEHOLD', items: households.data.map((h) => ({ id: h.id, name: h.name })) },\n ];\n\n return (\n <div className=\"space-y-2\">\n {label ? <Label htmlFor={id}>{label}</Label> : null}\n <Select value={value || undefined} onValueChange={onChange} disabled={disabled}>\n <SelectTrigger id={id} aria-label={label}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {groups\n .filter((group) => group.items.length > 0)\n .map((group) => (\n <SelectGroup key={group.kind}>\n <SelectLabel>{SUBJECT_KIND_LABEL[group.kind]}</SelectLabel>\n {group.items.map((item) => (\n <SelectItem\n key={`${group.kind}:${item.id}`}\n value={encodeSubject(group.kind, item.id)}\n >\n {item.name}\n </SelectItem>\n ))}\n </SelectGroup>\n ))}\n </SelectContent>\n </Select>\n </div>\n );\n}\n\n// ============================================================================\n// EntityPicker — generic account / household id picker\n// ============================================================================\n\nexport interface EntityPickerProps {\n kind: 'account' | 'household';\n value?: string | null;\n onChange: (id: string) => void;\n id?: string;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n}\n\nconst ENTITY_META: Record<\n EntityPickerProps['kind'],\n { label: string; placeholder: string; relativePath: string; cta: string; emptyMessage: string }\n> = {\n account: {\n label: 'Account',\n placeholder: 'Select an account',\n relativePath: 'accounts',\n cta: 'Create an account',\n emptyMessage: 'No accounts yet — create one first.',\n },\n household: {\n label: 'Household',\n placeholder: 'Select a household',\n relativePath: 'family',\n cta: 'Create a household',\n emptyMessage: 'No households yet — create one first.',\n },\n};\n\nexport function EntityPicker({\n kind,\n value,\n onChange,\n id,\n label,\n placeholder,\n disabled = false,\n}: EntityPickerProps) {\n const meta = ENTITY_META[kind];\n const accounts = useAccounts();\n const households = useHouseholds();\n const source = kind === 'account' ? accounts : households;\n const fieldId = id ?? `${kind}-picker`;\n const fieldLabel = label ?? meta.label;\n\n if (source.isLoading) return <PickerLoading id={fieldId} label={fieldLabel} />;\n\n const options = source.data.map((entity) => ({ id: entity.id, name: entity.name }));\n\n if (options.length === 0) {\n return (\n <div className=\"space-y-2\">\n {fieldLabel ? <Label htmlFor={fieldId}>{fieldLabel}</Label> : null}\n <PickerCTA message={meta.emptyMessage} cta={meta.cta} relativePath={meta.relativePath} />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-2\">\n {fieldLabel ? <Label htmlFor={fieldId}>{fieldLabel}</Label> : null}\n <Select value={value || undefined} onValueChange={onChange} disabled={disabled}>\n <SelectTrigger id={fieldId} aria-label={fieldLabel}>\n <SelectValue placeholder={placeholder ?? meta.placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((option) => (\n <SelectItem key={option.id} value={option.id}>\n {option.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n );\n}\n\n/** Convenience wrapper — a required account picker. */\nexport function AccountPicker(props: Omit<EntityPickerProps, 'kind'>) {\n return <EntityPicker kind=\"account\" {...props} />;\n}\n\n// ============================================================================\n// HouseholdPicker — OPTIONAL household link (account form, item 6)\n// ============================================================================\n\nconst HOUSEHOLD_NONE = '__none__';\n\nexport interface HouseholdPickerProps {\n /** Current householdId, or null/undefined for \"no household\". */\n value?: string | null;\n onChange: (householdId: string | null) => void;\n id?: string;\n label?: string;\n /** Label for the \"unlinked\" option (default \"No household\"). */\n noneLabel?: string;\n disabled?: boolean;\n}\n\n/**\n * OPTIONAL household selector. Always offers a \"No household\" option, so it is\n * never a dead-end even when zero households exist (it just shows a hint). Emits\n * `null` for the none option and a bare householdId otherwise.\n */\nexport function HouseholdPicker({\n value,\n onChange,\n id = 'household-picker',\n label = 'Household',\n noneLabel = 'No household',\n disabled = false,\n}: HouseholdPickerProps) {\n const households = useHouseholds();\n\n if (households.isLoading) return <PickerLoading id={id} label={label} />;\n\n return (\n <div className=\"space-y-2\">\n {label ? <Label htmlFor={id}>{label}</Label> : null}\n <Select\n value={value ?? HOUSEHOLD_NONE}\n onValueChange={(next) => onChange(next === HOUSEHOLD_NONE ? null : next)}\n disabled={disabled}\n >\n <SelectTrigger id={id} aria-label={label}>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={HOUSEHOLD_NONE}>{noneLabel}</SelectItem>\n {households.data.map((household) => (\n <SelectItem key={household.id} value={household.id}>\n {household.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {households.data.length === 0 ? (\n <p className=\"text-xs text-text-secondary\">\n No households yet — you can create one in Households and link this account later.\n </p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAoCA,IAAa,IAAgB;CAAC;CAAW;CAAa;CAAQ;CAAY,EAGpE,IAAkD;CACtD,SAAS;CACT,WAAW;CACX,MAAM;CACN,WAAW;CACZ;AAGD,SAAgB,EAAc,GAAmB,GAAoB;AACnE,QAAO,GAAG,EAAK,GAAG;;AAIpB,SAAgB,EACd,GACwD;AACxD,KAAI,CAAC,EAAO,QAAO;CACnB,IAAM,IAAM,EAAM,QAAQ,IAAI;AAC9B,KAAI,IAAM,EAAG,QAAO;CACpB,IAAM,IAAO,EAAM,MAAM,GAAG,EAAI,EAC1B,IAAK,EAAM,MAAM,IAAM,EAAE;AAE/B,QADI,CAAC,EAAc,SAAS,EAAK,IAAI,CAAC,IAAW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,IAAa,GAAe;AAIlC,QAFI,EAAW,YAAkB,kBAAC,GAAD;EAAmB;EAAW;EAAS,CAAA,GAGtE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACG,IAAQ,kBAAC,GAAD;IAAO,SAAS;cAAK;IAAc,CAAA,GAAG;GAC/C,kBAAC,GAAD;IACE,OAAO,KAAS;IAChB,gBAAgB,MAAS,EAAS,MAAS,IAAiB,OAAO,EAAK;IAC9D;cAHZ,CAKE,kBAAC,GAAD;KAAmB;KAAI,cAAY;eACjC,kBAAC,GAAD,EAAe,CAAA;KACD,CAAA,EAChB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;KAAY,OAAO;eAAiB;KAAuB,CAAA,EAC1D,EAAW,KAAK,KAAK,MACpB,kBAAC,GAAD;KAA+B,OAAO,EAAU;eAC7C,EAAU;KACA,EAFI,EAAU,GAEd,CACb,CACY,EAAA,CAAA,CACT;;GACR,EAAW,KAAK,WAAW,IAC1B,kBAAC,KAAD;IAAG,WAAU;cAA8B;IAEvC,CAAA,GACF;GACA"}
1
+ {"version":3,"file":"pickers.js","names":[],"sources":["../../../src/brainyrich/components/pickers.tsx"],"sourcesContent":["/**\n * Reusable entity / subject pickers.\n * @module brainyrich/components/pickers\n *\n * - `SubjectPicker` — encodes `SUBJECT_TYPE:id` across accounts, portfolios,\n * goals and households (for the AiAssistant insight subject).\n * - `EntityPicker` — generic account / household Select returning a bare id.\n * - `AccountPicker` — convenience wrapper (kind=\"account\").\n * - `HouseholdPicker` — OPTIONAL household Select with a \"None\" option, for the\n * account create/edit form (accounts can be linked to a\n * household). Never a dead-end when no households exist.\n *\n * When a *required* source list is empty every picker renders a CTA that routes\n * the user to create the missing entity instead of showing an empty dropdown.\n */\n\nimport { Loader2 } from 'lucide-react';\nimport {\n Button,\n Label,\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectTrigger,\n SelectValue,\n} from '@burdenoff/fe-libs/ui';\nimport { useAccounts, useGoals, useHouseholds, usePortfolios } from '../hooks/useBrainyRichApi';\nimport { useBrainyRich } from '../providers/BrainyRichProvider';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Subject encoding (matches the SDL `subjectType` convention — uppercase)\n// ============================================================================\n\nexport const SUBJECT_KINDS = ['ACCOUNT', 'PORTFOLIO', 'GOAL', 'HOUSEHOLD'] as const;\nexport type SubjectKind = (typeof SUBJECT_KINDS)[number];\n\nconst SUBJECT_KIND_LABEL: Record<SubjectKind, string> = {\n ACCOUNT: 'Account',\n PORTFOLIO: 'Portfolio',\n GOAL: 'Goal',\n HOUSEHOLD: 'Household',\n};\n\n/** Encode a subject selection as the `SUBJECT_TYPE:id` token a SubjectPicker emits. */\nexport function encodeSubject(kind: SubjectKind, id: string): string {\n return `${kind}:${id}`;\n}\n\n/** Decode a `SUBJECT_TYPE:id` token back into `{ subjectType, subjectId }`. */\nexport function parseSubject(\n value: string | null | undefined\n): { subjectType: SubjectKind; subjectId: string } | null {\n if (!value) return null;\n const idx = value.indexOf(':');\n if (idx < 0) return null;\n const kind = value.slice(0, idx) as SubjectKind;\n const id = value.slice(idx + 1);\n if (!SUBJECT_KINDS.includes(kind) || !id) return null;\n return { subjectType: kind, subjectId: id };\n}\n\n// ============================================================================\n// Shared empty-state CTA (routes to the create surface, never a dead-end)\n// ============================================================================\n\nfunction PickerCTA({\n message,\n cta,\n relativePath,\n}: {\n message: string;\n cta: string;\n relativePath: string;\n}) {\n const { basePath = '/', navigate } = useBrainyRich();\n const target = joinPath(basePath, relativePath);\n return (\n <div className=\"rounded-lg border border-dashed border-border-subtle bg-bg-surface px-4 py-3 text-sm\">\n <p className=\"text-text-secondary\">{message}</p>\n {navigate ? (\n <Button variant=\"outline\" size=\"sm\" className=\"mt-2\" onClick={() => navigate(target)}>\n {cta}\n </Button>\n ) : null}\n </div>\n );\n}\n\nfunction PickerLoading({ id, label }: { id?: string; label?: string }) {\n return (\n <div className=\"space-y-2\">\n {label ? <Label htmlFor={id}>{label}</Label> : null}\n <div\n className=\"flex h-9 items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-secondary\"\n aria-busy=\"true\"\n >\n <Loader2 className=\"size-4 motion-safe:animate-spin\" aria-hidden=\"true\" />\n Loading…\n </div>\n </div>\n );\n}\n\n// ============================================================================\n// SubjectPicker — accounts + portfolios + goals + households\n// ============================================================================\n\nexport interface SubjectPickerProps {\n /** Current `SUBJECT_TYPE:id` token, or empty. */\n value?: string;\n onChange: (value: string) => void;\n id?: string;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n}\n\nexport function SubjectPicker({\n value,\n onChange,\n id = 'subject-picker',\n label = 'Subject',\n placeholder = 'Select a subject',\n disabled = false,\n}: SubjectPickerProps) {\n const accounts = useAccounts();\n const portfolios = usePortfolios();\n const goals = useGoals();\n const households = useHouseholds();\n\n const loading =\n accounts.isLoading || portfolios.isLoading || goals.isLoading || households.isLoading;\n const total =\n accounts.data.length + portfolios.data.length + goals.data.length + households.data.length;\n\n if (loading) return <PickerLoading id={id} label={label} />;\n\n if (total === 0) {\n return (\n <div className=\"space-y-2\">\n {label ? <Label htmlFor={id}>{label}</Label> : null}\n <PickerCTA\n message=\"No accounts, portfolios, goals or households yet — create one to attach this insight.\"\n cta=\"Create an account\"\n relativePath=\"accounts\"\n />\n </div>\n );\n }\n\n const groups: Array<{ kind: SubjectKind; items: Array<{ id: string; name: string }> }> = [\n { kind: 'ACCOUNT', items: accounts.data.map((a) => ({ id: a.id, name: a.name })) },\n { kind: 'PORTFOLIO', items: portfolios.data.map((p) => ({ id: p.id, name: p.name })) },\n { kind: 'GOAL', items: goals.data.map((g) => ({ id: g.id, name: g.name })) },\n { kind: 'HOUSEHOLD', items: households.data.map((h) => ({ id: h.id, name: h.name })) },\n ];\n\n return (\n <div className=\"space-y-2\">\n {label ? <Label htmlFor={id}>{label}</Label> : null}\n <Select value={value || undefined} onValueChange={onChange} disabled={disabled}>\n <SelectTrigger id={id} aria-label={label}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {groups\n .filter((group) => group.items.length > 0)\n .map((group) => (\n <SelectGroup key={group.kind}>\n <SelectLabel>{SUBJECT_KIND_LABEL[group.kind]}</SelectLabel>\n {group.items.map((item) => (\n <SelectItem\n key={`${group.kind}:${item.id}`}\n value={encodeSubject(group.kind, item.id)}\n >\n {item.name}\n </SelectItem>\n ))}\n </SelectGroup>\n ))}\n </SelectContent>\n </Select>\n </div>\n );\n}\n\n// ============================================================================\n// EntityPicker — generic account / household id picker\n// ============================================================================\n\nexport interface EntityPickerProps {\n kind: 'account' | 'household';\n value?: string | null;\n onChange: (id: string) => void;\n id?: string;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n}\n\nconst ENTITY_META: Record<\n EntityPickerProps['kind'],\n { label: string; placeholder: string; relativePath: string; cta: string; emptyMessage: string }\n> = {\n account: {\n label: 'Account',\n placeholder: 'Select an account',\n relativePath: 'accounts',\n cta: 'Create an account',\n emptyMessage: 'No accounts yet — create one first.',\n },\n household: {\n label: 'Household',\n placeholder: 'Select a household',\n relativePath: 'family',\n cta: 'Create a household',\n emptyMessage: 'No households yet — create one first.',\n },\n};\n\nexport function EntityPicker({\n kind,\n value,\n onChange,\n id,\n label,\n placeholder,\n disabled = false,\n}: EntityPickerProps) {\n const meta = ENTITY_META[kind];\n const accounts = useAccounts();\n const households = useHouseholds();\n const source = kind === 'account' ? accounts : households;\n const fieldId = id ?? `${kind}-picker`;\n const fieldLabel = label ?? meta.label;\n\n if (source.isLoading) return <PickerLoading id={fieldId} label={fieldLabel} />;\n\n const options = source.data.map((entity) => ({ id: entity.id, name: entity.name }));\n\n if (options.length === 0) {\n return (\n <div className=\"space-y-2\">\n {fieldLabel ? <Label htmlFor={fieldId}>{fieldLabel}</Label> : null}\n <PickerCTA message={meta.emptyMessage} cta={meta.cta} relativePath={meta.relativePath} />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-2\">\n {fieldLabel ? <Label htmlFor={fieldId}>{fieldLabel}</Label> : null}\n <Select value={value || undefined} onValueChange={onChange} disabled={disabled}>\n <SelectTrigger id={fieldId} aria-label={fieldLabel}>\n <SelectValue placeholder={placeholder ?? meta.placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((option) => (\n <SelectItem key={option.id} value={option.id}>\n {option.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n );\n}\n\n/** Convenience wrapper — a required account picker. */\nexport function AccountPicker(props: Omit<EntityPickerProps, 'kind'>) {\n return <EntityPicker kind=\"account\" {...props} />;\n}\n\n// ============================================================================\n// HouseholdPicker — OPTIONAL household link (account form, item 6)\n// ============================================================================\n\nconst HOUSEHOLD_NONE = '__none__';\n\nexport interface HouseholdPickerProps {\n /** Current householdId, or null/undefined for \"no household\". */\n value?: string | null;\n onChange: (householdId: string | null) => void;\n id?: string;\n label?: string;\n /** Label for the \"unlinked\" option (default \"No household\"). */\n noneLabel?: string;\n disabled?: boolean;\n}\n\n/**\n * OPTIONAL household selector. Always offers a \"No household\" option, so it is\n * never a dead-end even when zero households exist (it just shows a hint). Emits\n * `null` for the none option and a bare householdId otherwise.\n */\nexport function HouseholdPicker({\n value,\n onChange,\n id = 'household-picker',\n label = 'Household',\n noneLabel = 'No household',\n disabled = false,\n}: HouseholdPickerProps) {\n const households = useHouseholds();\n\n if (households.isLoading) return <PickerLoading id={id} label={label} />;\n\n return (\n <div className=\"space-y-2\">\n {label ? <Label htmlFor={id}>{label}</Label> : null}\n <Select\n value={value ?? HOUSEHOLD_NONE}\n onValueChange={(next) => onChange(next === HOUSEHOLD_NONE ? null : next)}\n disabled={disabled}\n >\n <SelectTrigger id={id} aria-label={label}>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={HOUSEHOLD_NONE}>{noneLabel}</SelectItem>\n {households.data.map((household) => (\n <SelectItem key={household.id} value={household.id}>\n {household.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {households.data.length === 0 ? (\n <p className=\"text-xs text-text-secondary\">\n No households yet — you can create one in Households and link this account later.\n </p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAoCA,IAAa,IAAgB;CAAC;CAAW;CAAa;CAAQ;AAAW,GAGnE,IAAkD;CACtD,SAAS;CACT,WAAW;CACX,MAAM;CACN,WAAW;AACb;AAGA,SAAgB,EAAc,GAAmB,GAAoB;CACnE,OAAO,GAAG,EAAK,GAAG;AACpB;AAGA,SAAgB,EACd,GACwD;CACxD,IAAI,CAAC,GAAO,OAAO;CACnB,IAAM,IAAM,EAAM,QAAQ,GAAG;CAC7B,IAAI,IAAM,GAAG,OAAO;CACpB,IAAM,IAAO,EAAM,MAAM,GAAG,CAAG,GACzB,IAAK,EAAM,MAAM,IAAM,CAAC;CAE9B,OADI,CAAC,EAAc,SAAS,CAAI,KAAK,CAAC,IAAW,OAC1C;EAAE,aAAa;EAAM,WAAW;CAAG;AAC5C;AAMA,SAAS,EAAU,EACjB,YACA,QACA,mBAKC;CACD,IAAM,EAAE,cAAW,KAAK,gBAAa,EAAc,GAC7C,IAAS,EAAS,GAAU,CAAY;CAC9C,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,KAAD;GAAG,WAAU;aAAuB;EAAW,CAAA,GAC9C,IACC,kBAAC,GAAD;GAAQ,SAAQ;GAAU,MAAK;GAAK,WAAU;GAAO,eAAe,EAAS,CAAM;aAChF;EACK,CAAA,IACN,IACD;;AAET;AAEA,SAAS,EAAc,EAAE,OAAI,YAA0C;CACrE,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACG,IAAQ,kBAAC,GAAD;GAAO,SAAS;aAAK;EAAa,CAAA,IAAI,MAC/C,kBAAC,OAAD;GACE,WAAU;GACV,aAAU;aAFZ,CAIE,kBAAC,GAAD;IAAS,WAAU;IAAkC,eAAY;GAAQ,CAAA,GAAC,UAEvE;IACF;;AAET;AAgBA,SAAgB,EAAc,EAC5B,UACA,aACA,QAAK,kBACL,WAAQ,WAC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
1
- {"version":3,"file":"CommentThread.js","names":[],"sources":["../../../../src/brainyrich/components/reuse/CommentThread.tsx"],"sourcesContent":["/**\n * CommentThread — REUSE of `wspace-conversations-svc` EntityComment as a real\n * comment thread.\n * @module brainyrich/components/reuse/CommentThread\n *\n * Replaces the single-field notes / rationale fork on Households / Portfolios /\n * RebalanceProposals with a threaded, multi-author comment log keyed by\n * `(entityType, entityId)`.\n *\n * Why not the fe-libs `contextConversationWidget`? That folder ships a kit of\n * sub-components + Apollo hooks (subscriptions, `sendContextMessage`, a\n * conversationId-resolution flow) but exports NO mountable root widget and no\n * single mount hook — it is not wrappable as `<CommentThread>` without importing\n * its internals. Per the task's fallback, we build a minimal thread directly on\n * the platform EntityComment API, which is purpose-built for exactly this\n * \"comments on an arbitrary entity\" case:\n * - `getEntityComments(input)` → list (newest first)\n * - `createEntityComment(input)` → post\n * - `deleteEntityComment(input)` → remove own comment (soft)\n *\n * All ops route through the workspace supergraph the MFE already uses.\n * Presentational + self-contained: owns its hooks, reads gateway base URL +\n * current user from `useBrainyRich()`, uses fe-libs/ui + semantic tokens.\n */\n\nimport { useState, type KeyboardEvent } from 'react';\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { MessagesSquare, Send, Trash2 } from 'lucide-react';\nimport { Button, Skeleton, Textarea } from '@burdenoff/fe-libs/ui';\n\nimport { useBrainyRich } from '../../providers/BrainyRichProvider';\nimport { formatDate } from '../../pages/_shared';\nimport { wspaceFetch, wspaceMutate } from './transport';\n\ninterface EntityComment {\n id: string;\n authorId: string;\n authorType: string;\n content: { text: string | null; markdown: string | null };\n createdAt: string;\n edited: boolean;\n status: string;\n}\n\nconst COMMENT_FIELDS = `\n id authorId authorType content { text markdown } createdAt edited status\n`;\n\nconst commentsKey = (entityType: string, entityId: string) =>\n ['brainyrich', 'entity-comments', entityType, entityId] as const;\n\nconst useEntityComments = (entityType: string, entityId: string | undefined) => {\n const { apiGatewayUrl } = useBrainyRich();\n return useQuery({\n queryKey: commentsKey(entityType, entityId ?? ''),\n enabled: Boolean(entityId),\n queryFn: async () => {\n const data = await wspaceFetch<{\n getEntityComments: { items: EntityComment[]; total: number };\n }>(\n `query BraGetEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n items { ${COMMENT_FIELDS} }\n total\n }\n }`,\n {\n input: { entityType, entityId, take: 50, sortBy: 'createdAt', sortOrder: 'desc' },\n },\n apiGatewayUrl\n );\n return data.getEntityComments;\n },\n });\n};\n\nconst useCreateComment = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useBrainyRich();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (text: string) => {\n const trimmed = text.trim();\n if (!trimmed) throw new Error('A comment is required.');\n const data = await wspaceMutate<{ createEntityComment: { id: string } }>(\n `mutation BraCreateEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) { id }\n }`,\n { input: { entityType, entityId, content: { text: trimmed } } },\n apiGatewayUrl\n );\n return data.createEntityComment;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: commentsKey(entityType, entityId) }),\n });\n};\n\nconst useDeleteComment = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useBrainyRich();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const data = await wspaceMutate<{ deleteEntityComment: boolean }>(\n `mutation BraDeleteEntityComment($input: DeleteCommentInput!) {\n deleteEntityComment(input: $input)\n }`,\n { input: { id, soft: true } },\n apiGatewayUrl\n );\n return data.deleteEntityComment;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: commentsKey(entityType, entityId) }),\n });\n};\n\nconst authorInitials = (authorId: string, isSelf: boolean): string => {\n if (isSelf) return 'You';\n return authorId.slice(0, 2).toUpperCase();\n};\n\nexport interface CommentThreadProps {\n /** Polymorphic entity type, e.g. \"brainyrich-household\". */\n entityType: string;\n /** The bra entity's id (an ID scalar). */\n entityId: string;\n /** Optional heading; hide with `hideHeading`. */\n heading?: string;\n hideHeading?: boolean;\n}\n\nexport function CommentThread({\n entityType,\n entityId,\n heading = 'Discussion',\n hideHeading = false,\n}: CommentThreadProps) {\n const { currentUser } = useBrainyRich();\n const [draft, setDraft] = useState('');\n const comments = useEntityComments(entityType, entityId);\n const create = useCreateComment(entityType, entityId);\n const remove = useDeleteComment(entityType, entityId);\n\n const items = (comments.data?.items ?? []).filter((c) => c.status !== 'DELETED');\n const selfName =\n currentUser?.name ||\n [currentUser?.firstName, currentUser?.lastName].filter(Boolean).join(' ') ||\n currentUser?.email ||\n 'You';\n\n const submit = async () => {\n if (!draft.trim() || create.isPending) return;\n await create.mutateAsync(draft);\n setDraft('');\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') {\n event.preventDefault();\n void submit();\n }\n };\n\n return (\n <div className=\"space-y-3\">\n {!hideHeading && (\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <MessagesSquare className=\"size-4\" aria-hidden=\"true\" />\n {heading}\n {comments.data ? (\n <span className=\"text-xs font-normal text-text-secondary\">({items.length})</span>\n ) : null}\n </h3>\n )}\n\n {/* Composer */}\n <div className=\"space-y-2\">\n <label htmlFor={`comment-${entityId}`} className=\"sr-only\">\n Add a comment\n </label>\n <Textarea\n id={`comment-${entityId}`}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKeyDown}\n placeholder=\"Add a note or rationale…\"\n rows={3}\n disabled={create.isPending}\n />\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs text-text-secondary\">⌘/Ctrl + Enter to post</span>\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={submit}\n disabled={!draft.trim() || create.isPending}\n >\n <Send className=\"size-4\" aria-hidden=\"true\" />\n {create.isPending ? 'Posting…' : 'Post'}\n </Button>\n </div>\n {create.isError && (\n <p className=\"text-sm text-status-error-text\">\n Could not post your comment. Please try again.\n </p>\n )}\n </div>\n\n {/* Thread */}\n {comments.isLoading ? (\n <div className=\"space-y-3\" aria-busy=\"true\">\n <Skeleton className=\"h-16 w-full rounded-md\" />\n <Skeleton className=\"h-16 w-full rounded-md\" />\n </div>\n ) : comments.isError ? (\n <p className=\"text-sm text-status-error-text\">\n Could not load the discussion.{' '}\n <button\n type=\"button\"\n className=\"underline underline-offset-2\"\n onClick={() => comments.refetch()}\n >\n Retry\n </button>\n </p>\n ) : items.length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border-subtle bg-bg-surface px-4 py-8 text-center\">\n <MessagesSquare className=\"mx-auto mb-2 size-6 text-text-secondary\" aria-hidden=\"true\" />\n <p className=\"text-sm text-text-primary\">No comments yet</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n Start the discussion with a note or rationale.\n </p>\n </div>\n ) : (\n <ul className=\"space-y-3\">\n {items.map((c) => {\n const isSelf = Boolean(currentUser?.id) && c.authorId === currentUser?.id;\n const body = c.content.text ?? c.content.markdown ?? '';\n return (\n <li key={c.id} className=\"flex gap-3\">\n <div\n className=\"flex size-8 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-xs font-medium text-text-secondary\"\n aria-hidden=\"true\"\n >\n {authorInitials(c.authorId, isSelf)}\n </div>\n <div className=\"min-w-0 flex-1 rounded-lg border border-border-subtle bg-bg-surface p-3\">\n <div className=\"mb-1 flex items-center gap-2\">\n <span className=\"text-sm font-medium text-text-primary\">\n {isSelf ? selfName : 'Team member'}\n </span>\n <span className=\"text-xs text-text-secondary\">{formatDate(c.createdAt)}</span>\n {c.edited ? (\n <span className=\"text-xs text-text-secondary\">(edited)</span>\n ) : null}\n {isSelf && (\n <button\n type=\"button\"\n aria-label=\"Delete comment\"\n className=\"ml-auto rounded p-1 text-text-secondary hover:bg-bg-sunken hover:text-status-error-text focus-visible:outline focus-visible:outline-2 focus-visible:outline-border-focus disabled:opacity-50\"\n disabled={remove.isPending}\n onClick={() => remove.mutate(c.id)}\n >\n <Trash2 className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n <p className=\"whitespace-pre-wrap break-words text-sm text-text-primary\">\n {body}\n </p>\n </div>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AA4CA,IAAM,IAAiB,kFAIjB,KAAe,GAAoB,MACvC;CAAC;CAAc;CAAmB;CAAY;CAAS,EAEnD,KAAqB,GAAoB,MAAiC;CAC9E,IAAM,EAAE,qBAAkB,GAAe;AACzC,QAAO,EAAS;EACd,UAAU,EAAY,GAAY,KAAY,GAAG;EACjD,SAAS,EAAQ;EACjB,SAAS,aACM,MAAM,EAGjB;;sBAEc,EAAe;;;YAI7B,EACE,OAAO;GAAE;GAAY;GAAU,MAAM;GAAI,QAAQ;GAAa,WAAW;GAAQ,EAClF,EACD,EACD,EACW;EAEf,CAAC;GAGE,KAAoB,GAAoB,MAAqB;CACjE,IAAM,EAAE,qBAAkB,GAAe,EACnC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,MAAiB;GAClC,IAAM,IAAU,EAAK,MAAM;AAC3B,OAAI,CAAC,EAAS,OAAU,MAAM,yBAAyB;AAQvD,WAPa,MAAM,EACjB,wIAGA,EAAE,OAAO;IAAE;IAAY;IAAU,SAAS,EAAE,MAAM,GAAS;IAAE,EAAE,EAC/D,EACD,EACW;;EAEd,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAY,GAAY,EAAS,EAAE,CAAC;EACvF,CAAC;GAGE,KAAoB,GAAoB,MAAqB;CACjE,IAAM,EAAE,qBAAkB,GAAe,EACnC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB,2HAGA,EAAE,OAAO;GAAE;GAAI,MAAM;GAAM,EAAE,EAC7B,EACD,EACW;EAEd,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAY,GAAY,EAAS,EAAE,CAAC;EACvF,CAAC;GAGE,KAAkB,GAAkB,MACpC,IAAe,QACZ,EAAS,MAAM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;UAAM,WAAU;oBAA+B,EAAW,EAAE,UAAU;UAAQ,CAAA;SAC7E,EAAE,SACD,kBAAC,QAAD;UAAM,WAAU;oBAA8B;UAAe,CAAA,GAC3D;SACH,KACC,kBAAC,UAAD;UACE,MAAK;UACL,cAAW;UACX,WAAU;UACV,UAAU,EAAO;UACjB,eAAe,EAAO,OAAO,EAAE,GAAG;oBAElC,kBAAC,GAAD;WAAQ,WAAU;WAAW,eAAY;WAAS,CAAA;UAC3C,CAAA;SAEP;WACN,kBAAC,KAAD;QAAG,WAAU;kBACV;QACC,CAAA,CACA;SACH;QAhCI,EAAE,GAgCN;MAEP;IACC,CAAA;GAEH"}
1
+ {"version":3,"file":"CommentThread.js","names":[],"sources":["../../../../src/brainyrich/components/reuse/CommentThread.tsx"],"sourcesContent":["/**\n * CommentThread — REUSE of `wspace-conversations-svc` EntityComment as a real\n * comment thread.\n * @module brainyrich/components/reuse/CommentThread\n *\n * Replaces the single-field notes / rationale fork on Households / Portfolios /\n * RebalanceProposals with a threaded, multi-author comment log keyed by\n * `(entityType, entityId)`.\n *\n * Why not the fe-libs `contextConversationWidget`? That folder ships a kit of\n * sub-components + Apollo hooks (subscriptions, `sendContextMessage`, a\n * conversationId-resolution flow) but exports NO mountable root widget and no\n * single mount hook — it is not wrappable as `<CommentThread>` without importing\n * its internals. Per the task's fallback, we build a minimal thread directly on\n * the platform EntityComment API, which is purpose-built for exactly this\n * \"comments on an arbitrary entity\" case:\n * - `getEntityComments(input)` → list (newest first)\n * - `createEntityComment(input)` → post\n * - `deleteEntityComment(input)` → remove own comment (soft)\n *\n * All ops route through the workspace supergraph the MFE already uses.\n * Presentational + self-contained: owns its hooks, reads gateway base URL +\n * current user from `useBrainyRich()`, uses fe-libs/ui + semantic tokens.\n */\n\nimport { useState, type KeyboardEvent } from 'react';\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { MessagesSquare, Send, Trash2 } from 'lucide-react';\nimport { Button, Skeleton, Textarea } from '@burdenoff/fe-libs/ui';\n\nimport { useBrainyRich } from '../../providers/BrainyRichProvider';\nimport { formatDate } from '../../pages/_shared';\nimport { wspaceFetch, wspaceMutate } from './transport';\n\ninterface EntityComment {\n id: string;\n authorId: string;\n authorType: string;\n content: { text: string | null; markdown: string | null };\n createdAt: string;\n edited: boolean;\n status: string;\n}\n\nconst COMMENT_FIELDS = `\n id authorId authorType content { text markdown } createdAt edited status\n`;\n\nconst commentsKey = (entityType: string, entityId: string) =>\n ['brainyrich', 'entity-comments', entityType, entityId] as const;\n\nconst useEntityComments = (entityType: string, entityId: string | undefined) => {\n const { apiGatewayUrl } = useBrainyRich();\n return useQuery({\n queryKey: commentsKey(entityType, entityId ?? ''),\n enabled: Boolean(entityId),\n queryFn: async () => {\n const data = await wspaceFetch<{\n getEntityComments: { items: EntityComment[]; total: number };\n }>(\n `query BraGetEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n items { ${COMMENT_FIELDS} }\n total\n }\n }`,\n {\n input: { entityType, entityId, take: 50, sortBy: 'createdAt', sortOrder: 'desc' },\n },\n apiGatewayUrl\n );\n return data.getEntityComments;\n },\n });\n};\n\nconst useCreateComment = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useBrainyRich();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (text: string) => {\n const trimmed = text.trim();\n if (!trimmed) throw new Error('A comment is required.');\n const data = await wspaceMutate<{ createEntityComment: { id: string } }>(\n `mutation BraCreateEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) { id }\n }`,\n { input: { entityType, entityId, content: { text: trimmed } } },\n apiGatewayUrl\n );\n return data.createEntityComment;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: commentsKey(entityType, entityId) }),\n });\n};\n\nconst useDeleteComment = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useBrainyRich();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const data = await wspaceMutate<{ deleteEntityComment: boolean }>(\n `mutation BraDeleteEntityComment($input: DeleteCommentInput!) {\n deleteEntityComment(input: $input)\n }`,\n { input: { id, soft: true } },\n apiGatewayUrl\n );\n return data.deleteEntityComment;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: commentsKey(entityType, entityId) }),\n });\n};\n\nconst authorInitials = (authorId: string, isSelf: boolean): string => {\n if (isSelf) return 'You';\n return authorId.slice(0, 2).toUpperCase();\n};\n\nexport interface CommentThreadProps {\n /** Polymorphic entity type, e.g. \"brainyrich-household\". */\n entityType: string;\n /** The bra entity's id (an ID scalar). */\n entityId: string;\n /** Optional heading; hide with `hideHeading`. */\n heading?: string;\n hideHeading?: boolean;\n}\n\nexport function CommentThread({\n entityType,\n entityId,\n heading = 'Discussion',\n hideHeading = false,\n}: CommentThreadProps) {\n const { currentUser } = useBrainyRich();\n const [draft, setDraft] = useState('');\n const comments = useEntityComments(entityType, entityId);\n const create = useCreateComment(entityType, entityId);\n const remove = useDeleteComment(entityType, entityId);\n\n const items = (comments.data?.items ?? []).filter((c) => c.status !== 'DELETED');\n const selfName =\n currentUser?.name ||\n [currentUser?.firstName, currentUser?.lastName].filter(Boolean).join(' ') ||\n currentUser?.email ||\n 'You';\n\n const submit = async () => {\n if (!draft.trim() || create.isPending) return;\n await create.mutateAsync(draft);\n setDraft('');\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') {\n event.preventDefault();\n void submit();\n }\n };\n\n return (\n <div className=\"space-y-3\">\n {!hideHeading && (\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <MessagesSquare className=\"size-4\" aria-hidden=\"true\" />\n {heading}\n {comments.data ? (\n <span className=\"text-xs font-normal text-text-secondary\">({items.length})</span>\n ) : null}\n </h3>\n )}\n\n {/* Composer */}\n <div className=\"space-y-2\">\n <label htmlFor={`comment-${entityId}`} className=\"sr-only\">\n Add a comment\n </label>\n <Textarea\n id={`comment-${entityId}`}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKeyDown}\n placeholder=\"Add a note or rationale…\"\n rows={3}\n disabled={create.isPending}\n />\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs text-text-secondary\">⌘/Ctrl + Enter to post</span>\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={submit}\n disabled={!draft.trim() || create.isPending}\n >\n <Send className=\"size-4\" aria-hidden=\"true\" />\n {create.isPending ? 'Posting…' : 'Post'}\n </Button>\n </div>\n {create.isError && (\n <p className=\"text-sm text-status-error-text\">\n Could not post your comment. Please try again.\n </p>\n )}\n </div>\n\n {/* Thread */}\n {comments.isLoading ? (\n <div className=\"space-y-3\" aria-busy=\"true\">\n <Skeleton className=\"h-16 w-full rounded-md\" />\n <Skeleton className=\"h-16 w-full rounded-md\" />\n </div>\n ) : comments.isError ? (\n <p className=\"text-sm text-status-error-text\">\n Could not load the discussion.{' '}\n <button\n type=\"button\"\n className=\"underline underline-offset-2\"\n onClick={() => comments.refetch()}\n >\n Retry\n </button>\n </p>\n ) : items.length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border-subtle bg-bg-surface px-4 py-8 text-center\">\n <MessagesSquare className=\"mx-auto mb-2 size-6 text-text-secondary\" aria-hidden=\"true\" />\n <p className=\"text-sm text-text-primary\">No comments yet</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n Start the discussion with a note or rationale.\n </p>\n </div>\n ) : (\n <ul className=\"space-y-3\">\n {items.map((c) => {\n const isSelf = Boolean(currentUser?.id) && c.authorId === currentUser?.id;\n const body = c.content.text ?? c.content.markdown ?? '';\n return (\n <li key={c.id} className=\"flex gap-3\">\n <div\n className=\"flex size-8 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-xs font-medium text-text-secondary\"\n aria-hidden=\"true\"\n >\n {authorInitials(c.authorId, isSelf)}\n </div>\n <div className=\"min-w-0 flex-1 rounded-lg border border-border-subtle bg-bg-surface p-3\">\n <div className=\"mb-1 flex items-center gap-2\">\n <span className=\"text-sm font-medium text-text-primary\">\n {isSelf ? selfName : 'Team member'}\n </span>\n <span className=\"text-xs text-text-secondary\">{formatDate(c.createdAt)}</span>\n {c.edited ? (\n <span className=\"text-xs text-text-secondary\">(edited)</span>\n ) : null}\n {isSelf && (\n <button\n type=\"button\"\n aria-label=\"Delete comment\"\n className=\"ml-auto rounded p-1 text-text-secondary hover:bg-bg-sunken hover:text-status-error-text focus-visible:outline focus-visible:outline-2 focus-visible:outline-border-focus disabled:opacity-50\"\n disabled={remove.isPending}\n onClick={() => remove.mutate(c.id)}\n >\n <Trash2 className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n <p className=\"whitespace-pre-wrap break-words text-sm text-text-primary\">\n {body}\n </p>\n </div>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AA4CA,IAAM,IAAiB,kFAIjB,KAAe,GAAoB,MACvC;CAAC;CAAc;CAAmB;CAAY;AAAQ,GAElD,KAAqB,GAAoB,MAAiC;CAC9E,IAAM,EAAE,qBAAkB,EAAc;CACxC,OAAO,EAAS;EACd,UAAU,EAAY,GAAY,KAAY,EAAE;EAChD,SAAS,EAAQ;EACjB,SAAS,aAeA,MAdY,EAGjB;;sBAEc,EAAe;;;YAI7B,EACE,OAAO;GAAE;GAAY;GAAU,MAAM;GAAI,QAAQ;GAAa,WAAW;EAAO,EAClF,GACA,CACF,GACY;CAEhB,CAAC;AACH,GAEM,KAAoB,GAAoB,MAAqB;CACjE,IAAM,EAAE,qBAAkB,EAAc,GAClC,IAAK,EAAe;CAC1B,OAAO,EAAY;EACjB,YAAY,OAAO,MAAiB;GAClC,IAAM,IAAU,EAAK,KAAK;GAC1B,IAAI,CAAC,GAAS,MAAU,MAAM,wBAAwB;GAQtD,QAAO,MAPY,EACjB,wIAGA,EAAE,OAAO;IAAE;IAAY;IAAU,SAAS,EAAE,MAAM,EAAQ;GAAE,EAAE,GAC9D,CACF,GACY;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A;QAEL,kBAAC,MAAD;IAAI,WAAU;cACX,EAAM,KAAK,MAAM;KAChB,IAAM,IAAS,EAAQ,GAAa,MAAO,EAAE,aAAa,GAAa,IACjE,IAAO,EAAE,QAAQ,QAAQ,EAAE,QAAQ,YAAY;KACrD,OACE,kBAAC,MAAD;MAAe,WAAU;gBAAzB,CACE,kBAAC,OAAD;OACE,WAAU;OACV,eAAY;iBAEX,EAAe,EAAE,UAAU,CAAM;MAC/B,CAAA,GACL,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,OAAD;QAAK,WAAU;kBAAf;SACE,kBAAC,QAAD;UAAM,WAAU;oBACb,IAAS,IAAW;SACjB,CAAA;SACN,kBAAC,QAAD;UAAM,WAAU;oBAA+B,EAAW,EAAE,SAAS;SAAQ,CAAA;SAC5E,EAAE,SACD,kBAAC,QAAD;UAAM,WAAU;oBAA8B;SAAc,CAAA,IAC1D;SACH,KACC,kBAAC,UAAD;UACE,MAAK;UACL,cAAW;UACX,WAAU;UACV,UAAU,EAAO;UACjB,eAAe,EAAO,OAAO,EAAE,EAAE;oBAEjC,kBAAC,GAAD;WAAQ,WAAU;WAAW,eAAY;UAAQ,CAAA;SAC3C,CAAA;QAEP;WACL,kBAAC,KAAD;QAAG,WAAU;kBACV;OACA,CAAA,CACA;QACH;QAhCK,EAAE,EAgCP;IAER,CAAC;GACC,CAAA;EAEH;;AAET"}
@@ -14,8 +14,12 @@
14
14
  * first upload via `createFolder`); no side-effects on read.
15
15
  * - list → `getFilesInFolder(folderId, pagination)`
16
16
  * - upload (3-step) → `initiateUpload` → S3 `PUT` (byte-progress) → `completeUpload`
17
+ * reachable by click OR by dropping a file on the zone; both take one file,
18
+ * which is exactly what the single-file upload mutation supports.
17
19
  * - download → `getFileDownloadUrl(id, expiresIn)` capped at 21600s to
18
20
  * avoid the >604800 fleet bug (S3 7-day cap → 500).
21
+ * - delete → `deleteFile(id)` (RBAC `delete`/`file`, enforced at the
22
+ * gateway) behind a confirm step.
19
23
  *
20
24
  * Presentational + self-contained: owns its hooks, reads the gateway base URL
21
25
  * from `useBrainyRich()`, uses fe-libs/ui primitives + semantic tokens.
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentsPanel.d.ts","sourceRoot":"","sources":["../../../../src/brainyrich/components/reuse/DocumentsPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAkOH,MAAM,WAAW,mBAAmB;IAClC,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,QAAQ,EACR,OAAqB,EACrB,WAAmB,GACpB,EAAE,mBAAmB,2CA0IrB"}
1
+ {"version":3,"file":"DocumentsPanel.d.ts","sourceRoot":"","sources":["../../../../src/brainyrich/components/reuse/DocumentsPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAyPH,MAAM,WAAW,mBAAmB;IAClC,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,QAAQ,EACR,OAAqB,EACrB,WAAmB,GACpB,EAAE,mBAAmB,2CAmNrB"}