@wildo-ai/saas-frontend-lib 1.1.5 → 1.1.6

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 (777) hide show
  1. package/dist/esm/components/actions/action-bar.d.ts +15 -0
  2. package/dist/esm/components/actions/action-bar.d.ts.map +1 -1
  3. package/dist/esm/components/actions/action-bar.js +15 -0
  4. package/dist/esm/components/actions/action-bar.js.map +1 -1
  5. package/dist/esm/components/ai-elements/decision/approval.d.ts +97 -7
  6. package/dist/esm/components/ai-elements/decision/approval.d.ts.map +1 -1
  7. package/dist/esm/components/ai-elements/decision/approval.js.map +1 -1
  8. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.d.ts.map +1 -1
  9. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js +8 -3
  10. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js.map +1 -1
  11. package/dist/esm/components/auth/Auth_EnrollmentRequired.d.ts.map +1 -1
  12. package/dist/esm/components/auth/Auth_EnrollmentRequired.js +5 -1
  13. package/dist/esm/components/auth/Auth_EnrollmentRequired.js.map +1 -1
  14. package/dist/esm/components/auth/Auth_Main.d.ts.map +1 -1
  15. package/dist/esm/components/auth/Auth_Main.js +1 -4
  16. package/dist/esm/components/auth/Auth_Main.js.map +1 -1
  17. package/dist/esm/components/auth/Auth_Register.d.ts.map +1 -1
  18. package/dist/esm/components/auth/Auth_Register.js +1 -3
  19. package/dist/esm/components/auth/Auth_Register.js.map +1 -1
  20. package/dist/esm/components/auth/StepUpAuthDialog.d.ts +7 -0
  21. package/dist/esm/components/auth/StepUpAuthDialog.d.ts.map +1 -1
  22. package/dist/esm/components/auth/StepUpAuthDialog.js +13 -7
  23. package/dist/esm/components/auth/StepUpAuthDialog.js.map +1 -1
  24. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.d.ts.map +1 -1
  25. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.js +32 -33
  26. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.js.map +1 -1
  27. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.d.ts.map +1 -1
  28. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js +18 -20
  29. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js.map +1 -1
  30. package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.d.ts.map +1 -1
  31. package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.js +2 -3
  32. package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.js.map +1 -1
  33. package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.d.ts +13 -16
  34. package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.d.ts.map +1 -1
  35. package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.js +18 -15
  36. package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.js.map +1 -1
  37. package/dist/esm/components/billing/billing-invoice-history.js +2 -2
  38. package/dist/esm/components/billing/billing-invoice-history.js.map +1 -1
  39. package/dist/esm/components/billing/billing-portal-link.js +2 -2
  40. package/dist/esm/components/billing/billing-portal-link.js.map +1 -1
  41. package/dist/esm/components/billing/billing-pricing-table.d.ts +33 -1
  42. package/dist/esm/components/billing/billing-pricing-table.d.ts.map +1 -1
  43. package/dist/esm/components/billing/billing-pricing-table.js +34 -5
  44. package/dist/esm/components/billing/billing-pricing-table.js.map +1 -1
  45. package/dist/esm/components/billing/billing-subscription-status.js +2 -2
  46. package/dist/esm/components/billing/billing-subscription-status.js.map +1 -1
  47. package/dist/esm/components/billing/billing-usage-dashboard.d.ts +2 -0
  48. package/dist/esm/components/billing/billing-usage-dashboard.d.ts.map +1 -1
  49. package/dist/esm/components/billing/billing-usage-dashboard.js +1 -0
  50. package/dist/esm/components/billing/billing-usage-dashboard.js.map +1 -1
  51. package/dist/esm/components/data-display/DisplayField.d.ts.map +1 -1
  52. package/dist/esm/components/data-display/DisplayField.js +15 -1
  53. package/dist/esm/components/data-display/DisplayField.js.map +1 -1
  54. package/dist/esm/components/data-display/DisplayFieldArray.d.ts.map +1 -1
  55. package/dist/esm/components/data-display/DisplayFieldArray.js +11 -0
  56. package/dist/esm/components/data-display/DisplayFieldArray.js.map +1 -1
  57. package/dist/esm/components/data-display/DisplayFieldEditable.d.ts.map +1 -1
  58. package/dist/esm/components/data-display/DisplayFieldEditable.js +2 -2
  59. package/dist/esm/components/data-display/DisplayFieldEditable.js.map +1 -1
  60. package/dist/esm/components/data-display/DisplayFieldEditableArray.d.ts +12 -2
  61. package/dist/esm/components/data-display/DisplayFieldEditableArray.d.ts.map +1 -1
  62. package/dist/esm/components/data-display/DisplayFieldEditableArray.js +3 -2
  63. package/dist/esm/components/data-display/DisplayFieldEditableArray.js.map +1 -1
  64. package/dist/esm/components/data-display/DisplayFieldReadOnly.d.ts.map +1 -1
  65. package/dist/esm/components/data-display/DisplayFieldReadOnly.js +2 -2
  66. package/dist/esm/components/data-display/DisplayFieldReadOnly.js.map +1 -1
  67. package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.d.ts.map +1 -1
  68. package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.js +8 -2
  69. package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.js.map +1 -1
  70. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  71. package/dist/esm/components/data-display/DisplayValueDispatcher.js +18 -4
  72. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  73. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
  74. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +61 -3
  75. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
  76. package/dist/esm/components/data-display/ResourceSummaryDisplayer.d.ts +7 -5
  77. package/dist/esm/components/data-display/ResourceSummaryDisplayer.d.ts.map +1 -1
  78. package/dist/esm/components/data-display/ResourceSummaryDisplayer.js.map +1 -1
  79. package/dist/esm/components/data-display/chromes/DisplayFieldChrome.d.ts +11 -1
  80. package/dist/esm/components/data-display/chromes/DisplayFieldChrome.d.ts.map +1 -1
  81. package/dist/esm/components/data-display/chromes/DisplayFieldChrome.js +36 -11
  82. package/dist/esm/components/data-display/chromes/DisplayFieldChrome.js.map +1 -1
  83. package/dist/esm/components/data-display/display-field-resolved-props.d.ts +6 -0
  84. package/dist/esm/components/data-display/display-field-resolved-props.d.ts.map +1 -1
  85. package/dist/esm/components/data-display/display-field-resolved-props.js.map +1 -1
  86. package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.d.ts +23 -0
  87. package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.d.ts.map +1 -0
  88. package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.js +35 -0
  89. package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.js.map +1 -0
  90. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts +47 -0
  91. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -0
  92. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +124 -0
  93. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -0
  94. package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.d.ts +8 -0
  95. package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.d.ts.map +1 -0
  96. package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.js +46 -0
  97. package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.js.map +1 -0
  98. package/dist/esm/components/feedback/resource-empty-state.d.ts +21 -8
  99. package/dist/esm/components/feedback/resource-empty-state.d.ts.map +1 -1
  100. package/dist/esm/components/feedback/resource-empty-state.js +56 -26
  101. package/dist/esm/components/feedback/resource-empty-state.js.map +1 -1
  102. package/dist/esm/components/flows-actors/approval.d.ts +29 -7
  103. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  104. package/dist/esm/components/flows-actors/approval.js +231 -101
  105. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  106. package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
  107. package/dist/esm/components/flows-actors/approval.labels.js +57 -0
  108. package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
  109. package/dist/esm/components/flows-actors/system-catalog.d.ts.map +1 -1
  110. package/dist/esm/components/flows-actors/system-catalog.js +4 -4
  111. package/dist/esm/components/flows-actors/system-catalog.js.map +1 -1
  112. package/dist/esm/components/flows-actors/system-catalog.labels.d.ts.map +1 -1
  113. package/dist/esm/components/flows-actors/system-catalog.labels.js +0 -5
  114. package/dist/esm/components/flows-actors/system-catalog.labels.js.map +1 -1
  115. package/dist/esm/components/form/Form.d.ts +2 -2
  116. package/dist/esm/components/form/Form.js +2 -2
  117. package/dist/esm/components/form/Form.js.map +1 -1
  118. package/dist/esm/components/form/automated/AutomatedArrayField.d.ts +28 -3
  119. package/dist/esm/components/form/automated/AutomatedArrayField.d.ts.map +1 -1
  120. package/dist/esm/components/form/automated/AutomatedArrayField.js +43 -14
  121. package/dist/esm/components/form/automated/AutomatedArrayField.js.map +1 -1
  122. package/dist/esm/components/form/automated/FormField.d.ts +3 -0
  123. package/dist/esm/components/form/automated/FormField.d.ts.map +1 -1
  124. package/dist/esm/components/form/automated/FormField.js +60 -21
  125. package/dist/esm/components/form/automated/FormField.js.map +1 -1
  126. package/dist/esm/components/form/automated/FormFieldArray.d.ts +6 -3
  127. package/dist/esm/components/form/automated/FormFieldArray.d.ts.map +1 -1
  128. package/dist/esm/components/form/automated/FormFieldArray.js +3 -2
  129. package/dist/esm/components/form/automated/FormFieldArray.js.map +1 -1
  130. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts +5 -4
  131. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  132. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +148 -55
  133. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  134. package/dist/esm/components/form/automated/ResourceFormActionsContext.d.ts +30 -0
  135. package/dist/esm/components/form/automated/ResourceFormActionsContext.d.ts.map +1 -1
  136. package/dist/esm/components/form/automated/ResourceFormActionsContext.js +30 -1
  137. package/dist/esm/components/form/automated/ResourceFormActionsContext.js.map +1 -1
  138. package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.d.ts +79 -0
  139. package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.d.ts.map +1 -0
  140. package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.js +203 -0
  141. package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.js.map +1 -0
  142. package/dist/esm/components/form/automated/automated-form-submit.utils.d.ts +12 -0
  143. package/dist/esm/components/form/automated/automated-form-submit.utils.d.ts.map +1 -1
  144. package/dist/esm/components/form/automated/automated-form-submit.utils.js +11 -0
  145. package/dist/esm/components/form/automated/automated-form-submit.utils.js.map +1 -1
  146. package/dist/esm/components/form/chromes/FormFieldChrome.d.ts.map +1 -1
  147. package/dist/esm/components/form/chromes/FormFieldChrome.js +2 -2
  148. package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
  149. package/dist/esm/components/form/combobox.d.ts +7 -0
  150. package/dist/esm/components/form/combobox.d.ts.map +1 -1
  151. package/dist/esm/components/form/combobox.js.map +1 -1
  152. package/dist/esm/components/form/controls/form-field-checkbox-group.d.ts.map +1 -1
  153. package/dist/esm/components/form/controls/form-field-checkbox-group.js +13 -0
  154. package/dist/esm/components/form/controls/form-field-checkbox-group.js.map +1 -1
  155. package/dist/esm/components/form/fields/form-field-address.d.ts +58 -0
  156. package/dist/esm/components/form/fields/form-field-address.d.ts.map +1 -1
  157. package/dist/esm/components/form/fields/form-field-address.js +34 -6
  158. package/dist/esm/components/form/fields/form-field-address.js.map +1 -1
  159. package/dist/esm/components/form/fields/form-field-address.labels.d.ts.map +1 -1
  160. package/dist/esm/components/form/fields/form-field-address.labels.js +60 -1
  161. package/dist/esm/components/form/fields/form-field-address.labels.js.map +1 -1
  162. package/dist/esm/components/form/fields/form-field-file.d.ts +0 -12
  163. package/dist/esm/components/form/fields/form-field-file.d.ts.map +1 -1
  164. package/dist/esm/components/form/fields/form-field-file.js +34 -13
  165. package/dist/esm/components/form/fields/form-field-file.js.map +1 -1
  166. package/dist/esm/components/form/fields/form-field-file.labels.d.ts.map +1 -1
  167. package/dist/esm/components/form/fields/form-field-file.labels.js +46 -0
  168. package/dist/esm/components/form/fields/form-field-file.labels.js.map +1 -1
  169. package/dist/esm/components/form/fields/form-field-string-organization-role.d.ts +73 -0
  170. package/dist/esm/components/form/fields/form-field-string-organization-role.d.ts.map +1 -0
  171. package/dist/esm/components/form/fields/form-field-string-organization-role.js +64 -0
  172. package/dist/esm/components/form/fields/form-field-string-organization-role.js.map +1 -0
  173. package/dist/esm/components/form/fields/form-field-string.d.ts.map +1 -1
  174. package/dist/esm/components/form/fields/form-field-string.js +8 -1
  175. package/dist/esm/components/form/fields/form-field-string.js.map +1 -1
  176. package/dist/esm/components/form/fields/form-field-string.labels.d.ts.map +1 -1
  177. package/dist/esm/components/form/fields/form-field-string.labels.js +4 -0
  178. package/dist/esm/components/form/fields/form-field-string.labels.js.map +1 -1
  179. package/dist/esm/components/form/validation-errors/FormErrorSummary.js +1 -1
  180. package/dist/esm/components/form/validation-errors/FormErrorSummary.js.map +1 -1
  181. package/dist/esm/components/form/validation-errors/resolver-error-nesting.d.ts +31 -0
  182. package/dist/esm/components/form/validation-errors/resolver-error-nesting.d.ts.map +1 -0
  183. package/dist/esm/components/form/validation-errors/resolver-error-nesting.js +81 -0
  184. package/dist/esm/components/form/validation-errors/resolver-error-nesting.js.map +1 -0
  185. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts +14 -1
  186. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts.map +1 -1
  187. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js +14 -0
  188. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js.map +1 -1
  189. package/dist/esm/components/form/validation-errors/zod-issue-resolver.d.ts +22 -0
  190. package/dist/esm/components/form/validation-errors/zod-issue-resolver.d.ts.map +1 -1
  191. package/dist/esm/components/form/validation-errors/zod-issue-resolver.js +1 -22
  192. package/dist/esm/components/form/validation-errors/zod-issue-resolver.js.map +1 -1
  193. package/dist/esm/components/layout/resizable.d.ts +11 -0
  194. package/dist/esm/components/layout/resizable.d.ts.map +1 -1
  195. package/dist/esm/components/layout/resizable.js.map +1 -1
  196. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts +11 -1
  197. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts.map +1 -1
  198. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js +15 -3
  199. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js.map +1 -1
  200. package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.d.ts +2 -2
  201. package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.d.ts.map +1 -1
  202. package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.js.map +1 -1
  203. package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.d.ts +2 -2
  204. package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.js +2 -2
  205. package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.js.map +1 -1
  206. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js +18 -20
  207. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js.map +1 -1
  208. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts.map +1 -1
  209. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js +7 -1
  210. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js.map +1 -1
  211. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts.map +1 -1
  212. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js +4 -1
  213. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js.map +1 -1
  214. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts.map +1 -1
  215. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js +18 -2
  216. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js.map +1 -1
  217. package/dist/esm/components/navigation/app-level/useSidebarBehavior.d.ts.map +1 -1
  218. package/dist/esm/components/navigation/app-level/useSidebarBehavior.js +82 -10
  219. package/dist/esm/components/navigation/app-level/useSidebarBehavior.js.map +1 -1
  220. package/dist/esm/components/navigation/app-level/useStatusBarBehavior.d.ts +2 -2
  221. package/dist/esm/components/navigation/app-level/useStatusBarBehavior.d.ts.map +1 -1
  222. package/dist/esm/components/navigation/app-level/useStatusBarBehavior.js.map +1 -1
  223. package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.d.ts.map +1 -1
  224. package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.js +8 -1
  225. package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.js.map +1 -1
  226. package/dist/esm/components/resources/ResourceCollectionToolbar.d.ts +8 -2
  227. package/dist/esm/components/resources/ResourceCollectionToolbar.d.ts.map +1 -1
  228. package/dist/esm/components/resources/ResourceCollectionToolbar.js +6 -2
  229. package/dist/esm/components/resources/ResourceCollectionToolbar.js.map +1 -1
  230. package/dist/esm/components/resources/ResourceLayout_Breadcrumb.d.ts.map +1 -1
  231. package/dist/esm/components/resources/ResourceLayout_Breadcrumb.js +31 -16
  232. package/dist/esm/components/resources/ResourceLayout_Breadcrumb.js.map +1 -1
  233. package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.d.ts.map +1 -1
  234. package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.js +23 -8
  235. package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.js.map +1 -1
  236. package/dist/esm/components/resources/ResourceLayout_ContainerNested.js +2 -2
  237. package/dist/esm/components/resources/ResourceLayout_ContainerNested.js.map +1 -1
  238. package/dist/esm/components/resources/ResourceLayout_Header.d.ts +13 -0
  239. package/dist/esm/components/resources/ResourceLayout_Header.d.ts.map +1 -1
  240. package/dist/esm/components/resources/ResourceLayout_Header.js +55 -28
  241. package/dist/esm/components/resources/ResourceLayout_Header.js.map +1 -1
  242. package/dist/esm/components/resources/ResourceLayout_List.d.ts.map +1 -1
  243. package/dist/esm/components/resources/ResourceLayout_List.js +41 -20
  244. package/dist/esm/components/resources/ResourceLayout_List.js.map +1 -1
  245. package/dist/esm/components/resources/ResourceLayout_List.labels.d.ts.map +1 -1
  246. package/dist/esm/components/resources/ResourceLayout_List.labels.js +1 -2
  247. package/dist/esm/components/resources/ResourceLayout_List.labels.js.map +1 -1
  248. package/dist/esm/components/resources/ResourceLayout_Read.d.ts +9 -4
  249. package/dist/esm/components/resources/ResourceLayout_Read.d.ts.map +1 -1
  250. package/dist/esm/components/resources/ResourceLayout_Read.js +30 -11
  251. package/dist/esm/components/resources/ResourceLayout_Read.js.map +1 -1
  252. package/dist/esm/components/resources/ResourceLayout_ReadSummary.d.ts.map +1 -1
  253. package/dist/esm/components/resources/ResourceLayout_ReadSummary.js +4 -2
  254. package/dist/esm/components/resources/ResourceLayout_ReadSummary.js.map +1 -1
  255. package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.d.ts.map +1 -1
  256. package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.js +6 -2
  257. package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.js.map +1 -1
  258. package/dist/esm/components/resources/ResourceLayout_Search.d.ts.map +1 -1
  259. package/dist/esm/components/resources/ResourceLayout_Search.js +30 -14
  260. package/dist/esm/components/resources/ResourceLayout_Search.js.map +1 -1
  261. package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.d.ts.map +1 -1
  262. package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.js +14 -198
  263. package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.js.map +1 -1
  264. package/dist/esm/components/resources/ResourceLayout_Update.d.ts +2 -2
  265. package/dist/esm/components/resources/ResourceLayout_Update.js +2 -2
  266. package/dist/esm/components/resources/ResourceLayout_Update.js.map +1 -1
  267. package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
  268. package/dist/esm/components/resources/ResourceListItemRenderer.js +69 -39
  269. package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
  270. package/dist/esm/components/resources/ResourceOperationActionDropdown.d.ts +32 -0
  271. package/dist/esm/components/resources/ResourceOperationActionDropdown.d.ts.map +1 -0
  272. package/dist/esm/components/resources/ResourceOperationActionDropdown.js +130 -0
  273. package/dist/esm/components/resources/ResourceOperationActionDropdown.js.map +1 -0
  274. package/dist/esm/components/resources/collection-create-placement.utils.d.ts +32 -0
  275. package/dist/esm/components/resources/collection-create-placement.utils.d.ts.map +1 -0
  276. package/dist/esm/components/resources/collection-create-placement.utils.js +37 -0
  277. package/dist/esm/components/resources/collection-create-placement.utils.js.map +1 -0
  278. package/dist/esm/components/resources/embeds/RelatedResourcePreview.d.ts.map +1 -1
  279. package/dist/esm/components/resources/embeds/RelatedResourcePreview.js +5 -1
  280. package/dist/esm/components/resources/embeds/RelatedResourcePreview.js.map +1 -1
  281. package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts +8 -1
  282. package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts.map +1 -1
  283. package/dist/esm/components/resources/embeds/RelatedResourceSections.js +49 -2
  284. package/dist/esm/components/resources/embeds/RelatedResourceSections.js.map +1 -1
  285. package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts +22 -0
  286. package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts.map +1 -1
  287. package/dist/esm/components/resources/embeds/ResourceEmbeds.js +85 -2
  288. package/dist/esm/components/resources/embeds/ResourceEmbeds.js.map +1 -1
  289. package/dist/esm/components/resources/resourceLayout.utils.d.ts +14 -0
  290. package/dist/esm/components/resources/resourceLayout.utils.d.ts.map +1 -1
  291. package/dist/esm/components/resources/resourceLayout.utils.js +22 -0
  292. package/dist/esm/components/resources/resourceLayout.utils.js.map +1 -1
  293. package/dist/esm/components/resources/skeleton/ArrayField.d.ts.map +1 -1
  294. package/dist/esm/components/resources/skeleton/ArrayField.js +3 -0
  295. package/dist/esm/components/resources/skeleton/ArrayField.js.map +1 -1
  296. package/dist/esm/components/resources/skeleton/FormLayout.d.ts.map +1 -1
  297. package/dist/esm/components/resources/skeleton/FormLayout.js +33 -1
  298. package/dist/esm/components/resources/skeleton/FormLayout.js.map +1 -1
  299. package/dist/esm/components/resources/skeleton/ObjectScope.d.ts.map +1 -1
  300. package/dist/esm/components/resources/skeleton/ObjectScope.js +3 -0
  301. package/dist/esm/components/resources/skeleton/ObjectScope.js.map +1 -1
  302. package/dist/esm/components/resources/skeleton/Section.d.ts +12 -0
  303. package/dist/esm/components/resources/skeleton/Section.d.ts.map +1 -1
  304. package/dist/esm/components/resources/skeleton/Section.js +28 -2
  305. package/dist/esm/components/resources/skeleton/Section.js.map +1 -1
  306. package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts +70 -0
  307. package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts.map +1 -1
  308. package/dist/esm/components/resources/skeleton/SectionFieldsContext.js +157 -1
  309. package/dist/esm/components/resources/skeleton/SectionFieldsContext.js.map +1 -1
  310. package/dist/esm/components/resources/skeleton/WizardLayout.d.ts +6 -0
  311. package/dist/esm/components/resources/skeleton/WizardLayout.d.ts.map +1 -1
  312. package/dist/esm/components/resources/skeleton/WizardLayout.js +13 -2
  313. package/dist/esm/components/resources/skeleton/WizardLayout.js.map +1 -1
  314. package/dist/esm/components/resources/skeleton/WizardStep.d.ts.map +1 -1
  315. package/dist/esm/components/resources/skeleton/WizardStep.js +2 -1
  316. package/dist/esm/components/resources/skeleton/WizardStep.js.map +1 -1
  317. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
  318. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +61 -15
  319. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
  320. package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.d.ts +24 -2
  321. package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.d.ts.map +1 -1
  322. package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.js +69 -1
  323. package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.js.map +1 -1
  324. package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.d.ts.map +1 -1
  325. package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.js +18 -19
  326. package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.js.map +1 -1
  327. package/dist/esm/components/sections/ContentSectionContainer.d.ts.map +1 -1
  328. package/dist/esm/components/sections/ContentSectionContainer.js +5 -4
  329. package/dist/esm/components/sections/ContentSectionContainer.js.map +1 -1
  330. package/dist/esm/components/sections/stepper.d.ts +5 -0
  331. package/dist/esm/components/sections/stepper.d.ts.map +1 -1
  332. package/dist/esm/components/sections/stepper.js.map +1 -1
  333. package/dist/esm/components/sections/surface.d.ts.map +1 -1
  334. package/dist/esm/components/sections/surface.js +12 -3
  335. package/dist/esm/components/sections/surface.js.map +1 -1
  336. package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.d.ts +43 -0
  337. package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.d.ts.map +1 -0
  338. package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.js +129 -0
  339. package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.js.map +1 -0
  340. package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.d.ts +3 -0
  341. package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.d.ts.map +1 -0
  342. package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.js +34 -0
  343. package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.js.map +1 -0
  344. package/dist/esm/components/settings/AppPage_AppearanceSettings.d.ts.map +1 -1
  345. package/dist/esm/components/settings/AppPage_AppearanceSettings.js +9 -11
  346. package/dist/esm/components/settings/AppPage_AppearanceSettings.js.map +1 -1
  347. package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.d.ts.map +1 -1
  348. package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.js +3 -2
  349. package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.js.map +1 -1
  350. package/dist/esm/components/settings/AppPage_BillingSettings.d.ts +4 -2
  351. package/dist/esm/components/settings/AppPage_BillingSettings.d.ts.map +1 -1
  352. package/dist/esm/components/settings/AppPage_BillingSettings.js +21 -3
  353. package/dist/esm/components/settings/AppPage_BillingSettings.js.map +1 -1
  354. package/dist/esm/components/settings/AppPage_BillingSettings.labels.d.ts.map +1 -1
  355. package/dist/esm/components/settings/AppPage_BillingSettings.labels.js +5 -10
  356. package/dist/esm/components/settings/AppPage_BillingSettings.labels.js.map +1 -1
  357. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +58 -0
  358. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
  359. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +243 -40
  360. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
  361. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.d.ts.map +1 -1
  362. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js +67 -6
  363. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js.map +1 -1
  364. package/dist/esm/components/settings/AppPage_InvitationsSettings.d.ts.map +1 -1
  365. package/dist/esm/components/settings/AppPage_InvitationsSettings.js +19 -11
  366. package/dist/esm/components/settings/AppPage_InvitationsSettings.js.map +1 -1
  367. package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.d.ts.map +1 -1
  368. package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.js +4 -2
  369. package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.js.map +1 -1
  370. package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
  371. package/dist/esm/components/settings/SettingsHub.js +3 -0
  372. package/dist/esm/components/settings/SettingsHub.js.map +1 -1
  373. package/dist/esm/components/settings/SettingsResourceOperationPanel.d.ts.map +1 -1
  374. package/dist/esm/components/settings/SettingsResourceOperationPanel.js +16 -1
  375. package/dist/esm/components/settings/SettingsResourceOperationPanel.js.map +1 -1
  376. package/dist/esm/components/settings/useOwnerProviderConnections.d.ts +59 -0
  377. package/dist/esm/components/settings/useOwnerProviderConnections.d.ts.map +1 -0
  378. package/dist/esm/components/settings/useOwnerProviderConnections.js +136 -0
  379. package/dist/esm/components/settings/useOwnerProviderConnections.js.map +1 -0
  380. package/dist/esm/components/views/chart-view/chart-view.utils.d.ts +5 -0
  381. package/dist/esm/components/views/chart-view/chart-view.utils.d.ts.map +1 -1
  382. package/dist/esm/components/views/chart-view/chart-view.utils.js +5 -0
  383. package/dist/esm/components/views/chart-view/chart-view.utils.js.map +1 -1
  384. package/dist/esm/components/views/chart-view/useResourceChartData.d.ts +50 -0
  385. package/dist/esm/components/views/chart-view/useResourceChartData.d.ts.map +1 -0
  386. package/dist/esm/components/views/chart-view/useResourceChartData.js +72 -0
  387. package/dist/esm/components/views/chart-view/useResourceChartData.js.map +1 -0
  388. package/dist/esm/components/views/composite-view/CompositeLayout.d.ts.map +1 -1
  389. package/dist/esm/components/views/composite-view/CompositeLayout.js +2 -1
  390. package/dist/esm/components/views/composite-view/CompositeLayout.js.map +1 -1
  391. package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts +86 -0
  392. package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts.map +1 -0
  393. package/dist/esm/core/app-shell/AppShellBuildingBlocks.js +187 -0
  394. package/dist/esm/core/app-shell/AppShellBuildingBlocks.js.map +1 -0
  395. package/dist/esm/core/app-shell/PortalContainerContext.d.ts +5 -2
  396. package/dist/esm/core/app-shell/PortalContainerContext.d.ts.map +1 -1
  397. package/dist/esm/core/app-shell/PortalContainerContext.js +5 -2
  398. package/dist/esm/core/app-shell/PortalContainerContext.js.map +1 -1
  399. package/dist/esm/core/app-shell/app-shell.schemas.d.ts +18 -9
  400. package/dist/esm/core/app-shell/app-shell.schemas.d.ts.map +1 -1
  401. package/dist/esm/core/app-shell/app-shell.schemas.js +1 -0
  402. package/dist/esm/core/app-shell/app-shell.schemas.js.map +1 -1
  403. package/dist/esm/core/app-shell/useAppShellLayout.d.ts +10 -0
  404. package/dist/esm/core/app-shell/useAppShellLayout.d.ts.map +1 -1
  405. package/dist/esm/core/app-shell/useAppShellLayout.js +28 -5
  406. package/dist/esm/core/app-shell/useAppShellLayout.js.map +1 -1
  407. package/dist/esm/core/app-shell/usePublicShellLayout.d.ts.map +1 -1
  408. package/dist/esm/core/app-shell/usePublicShellLayout.js +38 -0
  409. package/dist/esm/core/app-shell/usePublicShellLayout.js.map +1 -1
  410. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts +15 -1
  411. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts.map +1 -1
  412. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js +47 -13
  413. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js.map +1 -1
  414. package/dist/esm/core/billing/BillingContext.d.ts +25 -2
  415. package/dist/esm/core/billing/BillingContext.d.ts.map +1 -1
  416. package/dist/esm/core/billing/BillingContext.js +16 -25
  417. package/dist/esm/core/billing/BillingContext.js.map +1 -1
  418. package/dist/esm/core/billing/billing-provider-display.frontend.utils.d.ts +11 -3
  419. package/dist/esm/core/billing/billing-provider-display.frontend.utils.d.ts.map +1 -1
  420. package/dist/esm/core/billing/billing-provider-display.frontend.utils.js +14 -8
  421. package/dist/esm/core/billing/billing-provider-display.frontend.utils.js.map +1 -1
  422. package/dist/esm/core/billing/useBillingPlanChange.d.ts.map +1 -1
  423. package/dist/esm/core/billing/useBillingPlanChange.js +2 -0
  424. package/dist/esm/core/billing/useBillingPlanChange.js.map +1 -1
  425. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
  426. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +1 -0
  427. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
  428. package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts +29 -229
  429. package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts.map +1 -1
  430. package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js +29 -327
  431. package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js.map +1 -1
  432. package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts +17 -27
  433. package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts.map +1 -1
  434. package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js +28 -48
  435. package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js.map +1 -1
  436. package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts +21 -11
  437. package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts.map +1 -1
  438. package/dist/esm/core/config/app-configuration-frontend.schemas.js +4 -4
  439. package/dist/esm/core/config/app-configuration-frontend.schemas.js.map +1 -1
  440. package/dist/esm/core/config/app-level-components.frontend.schemas.d.ts +17 -0
  441. package/dist/esm/core/config/app-level-components.frontend.schemas.d.ts.map +1 -1
  442. package/dist/esm/core/config/app-level-components.frontend.schemas.js +17 -0
  443. package/dist/esm/core/config/app-level-components.frontend.schemas.js.map +1 -1
  444. package/dist/esm/core/config/chart-view.frontend.schemas.d.ts +10 -10
  445. package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
  446. package/dist/esm/core/config/engine-settings-destinations.js +221 -6
  447. package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
  448. package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts +8 -0
  449. package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts.map +1 -1
  450. package/dist/esm/core/config/launcher-items.frontend.schemas.js +1 -0
  451. package/dist/esm/core/config/launcher-items.frontend.schemas.js.map +1 -1
  452. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +10 -1
  453. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
  454. package/dist/esm/core/config/settings-hub.frontend.schemas.js +9 -0
  455. package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
  456. package/dist/esm/core/config/verify-launcher-content.d.ts.map +1 -1
  457. package/dist/esm/core/config/verify-launcher-content.js +30 -19
  458. package/dist/esm/core/config/verify-launcher-content.js.map +1 -1
  459. package/dist/esm/core/errors/ErrorContext.d.ts.map +1 -1
  460. package/dist/esm/core/errors/ErrorContext.js +9 -1
  461. package/dist/esm/core/errors/ErrorContext.js.map +1 -1
  462. package/dist/esm/core/errors/GlobalErrorHandler.d.ts.map +1 -1
  463. package/dist/esm/core/errors/GlobalErrorHandler.js +5 -4
  464. package/dist/esm/core/errors/GlobalErrorHandler.js.map +1 -1
  465. package/dist/esm/core/errors/RouterErrorBoundary.js +1 -1
  466. package/dist/esm/core/errors/RouterErrorBoundary.js.map +1 -1
  467. package/dist/esm/core/errors/errors-builder.frontend.services.d.ts +2 -2
  468. package/dist/esm/core/errors/errors-builder.frontend.services.d.ts.map +1 -1
  469. package/dist/esm/core/errors/errors-builder.frontend.services.js +4 -4
  470. package/dist/esm/core/errors/errors-builder.frontend.services.js.map +1 -1
  471. package/dist/esm/core/errors/user-facing-error-message.frontend.utils.js +1 -1
  472. package/dist/esm/core/errors/user-facing-error-message.frontend.utils.js.map +1 -1
  473. package/dist/esm/core/events/NotificationContext.d.ts.map +1 -1
  474. package/dist/esm/core/events/NotificationContext.js +23 -5
  475. package/dist/esm/core/events/NotificationContext.js.map +1 -1
  476. package/dist/esm/core/events/events.frontend.schemas.d.ts +110 -43
  477. package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
  478. package/dist/esm/core/events/events.frontend.schemas.js +89 -15
  479. package/dist/esm/core/events/events.frontend.schemas.js.map +1 -1
  480. package/dist/esm/core/execution/useExecutionParticipationRMM.d.ts +2 -0
  481. package/dist/esm/core/execution/useExecutionParticipationRMM.d.ts.map +1 -1
  482. package/dist/esm/core/execution/useExecutionParticipationRMM.js +2 -1
  483. package/dist/esm/core/execution/useExecutionParticipationRMM.js.map +1 -1
  484. package/dist/esm/core/execution/useExecutionResourceOperationSurface.d.ts +1 -1
  485. package/dist/esm/core/execution/useExecutionResourceOperationSurface.d.ts.map +1 -1
  486. package/dist/esm/core/execution/useExecutionResourceOperationSurface.js +5 -2
  487. package/dist/esm/core/execution/useExecutionResourceOperationSurface.js.map +1 -1
  488. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts +63 -0
  489. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts.map +1 -0
  490. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js +131 -0
  491. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js.map +1 -0
  492. package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.d.ts +61 -0
  493. package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.d.ts.map +1 -0
  494. package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.js +178 -0
  495. package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.js.map +1 -0
  496. package/dist/esm/core/external-providers/ProviderAddressLookupHost.d.ts +52 -0
  497. package/dist/esm/core/external-providers/ProviderAddressLookupHost.d.ts.map +1 -0
  498. package/dist/esm/core/external-providers/ProviderAddressLookupHost.js +144 -0
  499. package/dist/esm/core/external-providers/ProviderAddressLookupHost.js.map +1 -0
  500. package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts +22 -1
  501. package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts.map +1 -1
  502. package/dist/esm/core/external-providers/ProviderFilePickerHost.js +23 -3
  503. package/dist/esm/core/external-providers/ProviderFilePickerHost.js.map +1 -1
  504. package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.d.ts +55 -0
  505. package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.d.ts.map +1 -0
  506. package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.js +65 -0
  507. package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.js.map +1 -0
  508. package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.d.ts +63 -0
  509. package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.d.ts.map +1 -0
  510. package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.js +100 -0
  511. package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.js.map +1 -0
  512. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +45 -7
  513. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
  514. package/dist/esm/core/flows-actors/FlowsActorsContext.js +112 -28
  515. package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
  516. package/dist/esm/core/flows-actors/usePendingDecisions.d.ts +32 -0
  517. package/dist/esm/core/flows-actors/usePendingDecisions.d.ts.map +1 -0
  518. package/dist/esm/core/flows-actors/usePendingDecisions.js +91 -0
  519. package/dist/esm/core/flows-actors/usePendingDecisions.js.map +1 -0
  520. package/dist/esm/core/guidance/GuidanceRenderer.d.ts.map +1 -1
  521. package/dist/esm/core/guidance/GuidanceRenderer.js +3 -2
  522. package/dist/esm/core/guidance/GuidanceRenderer.js.map +1 -1
  523. package/dist/esm/core/i18n/I18nContext.d.ts +22 -8
  524. package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
  525. package/dist/esm/core/i18n/I18nContext.js +21 -9
  526. package/dist/esm/core/i18n/I18nContext.js.map +1 -1
  527. package/dist/esm/core/i18n/component-label-resolution.utils.d.ts +5 -3
  528. package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
  529. package/dist/esm/core/i18n/component-label-resolution.utils.js +5 -3
  530. package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
  531. package/dist/esm/core/i18n/useI18n.d.ts +2 -1
  532. package/dist/esm/core/i18n/useI18n.d.ts.map +1 -1
  533. package/dist/esm/core/i18n/useI18n.js +2 -1
  534. package/dist/esm/core/i18n/useI18n.js.map +1 -1
  535. package/dist/esm/core/loading/LoadingContext.d.ts.map +1 -1
  536. package/dist/esm/core/loading/LoadingContext.js +7 -1
  537. package/dist/esm/core/loading/LoadingContext.js.map +1 -1
  538. package/dist/esm/core/loading/LoadingGate.d.ts.map +1 -1
  539. package/dist/esm/core/loading/LoadingGate.js +19 -1
  540. package/dist/esm/core/loading/LoadingGate.js.map +1 -1
  541. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +15 -2
  542. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
  543. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +183 -20
  544. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
  545. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +2 -2
  546. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
  547. package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.d.ts +7 -15
  548. package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.d.ts.map +1 -1
  549. package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.js +8 -26
  550. package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.js.map +1 -1
  551. package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.d.ts +12 -3
  552. package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.d.ts.map +1 -1
  553. package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.js +3 -2
  554. package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.js.map +1 -1
  555. package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.d.ts +42 -0
  556. package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.d.ts.map +1 -1
  557. package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.js +89 -5
  558. package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.js.map +1 -1
  559. package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.d.ts +2 -0
  560. package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.d.ts.map +1 -1
  561. package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.js +2 -0
  562. package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.js.map +1 -1
  563. package/dist/esm/core/navigation/NavigationContentAreas.d.ts +78 -0
  564. package/dist/esm/core/navigation/NavigationContentAreas.d.ts.map +1 -1
  565. package/dist/esm/core/navigation/NavigationContentAreas.js +264 -16
  566. package/dist/esm/core/navigation/NavigationContentAreas.js.map +1 -1
  567. package/dist/esm/core/navigation/NavigationContext.d.ts +8 -0
  568. package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
  569. package/dist/esm/core/navigation/NavigationContext.js +137 -30
  570. package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
  571. package/dist/esm/core/navigation/launcher-resolution.d.ts +2 -0
  572. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  573. package/dist/esm/core/navigation/launcher-resolution.js +1 -0
  574. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  575. package/dist/esm/core/navigation/navigation-cascade.d.ts +46 -0
  576. package/dist/esm/core/navigation/navigation-cascade.d.ts.map +1 -0
  577. package/dist/esm/core/navigation/navigation-cascade.js +222 -0
  578. package/dist/esm/core/navigation/navigation-cascade.js.map +1 -0
  579. package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.d.ts.map +1 -1
  580. package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.js +21 -2
  581. package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.js.map +1 -1
  582. package/dist/esm/core/navigation/navigation-controller-internals.d.ts +71 -0
  583. package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -0
  584. package/dist/esm/core/navigation/navigation-controller-internals.js +84 -0
  585. package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -0
  586. package/dist/esm/core/navigation/navigation-policy-resolver.service.d.ts +86 -2
  587. package/dist/esm/core/navigation/navigation-policy-resolver.service.d.ts.map +1 -1
  588. package/dist/esm/core/navigation/navigation-policy-resolver.service.js +242 -124
  589. package/dist/esm/core/navigation/navigation-policy-resolver.service.js.map +1 -1
  590. package/dist/esm/core/navigation/navigation.schemas.d.ts +170 -8
  591. package/dist/esm/core/navigation/navigation.schemas.d.ts.map +1 -1
  592. package/dist/esm/core/navigation/navigation.schemas.js +121 -2
  593. package/dist/esm/core/navigation/navigation.schemas.js.map +1 -1
  594. package/dist/esm/core/navigation/navigation.utils.d.ts +102 -6
  595. package/dist/esm/core/navigation/navigation.utils.d.ts.map +1 -1
  596. package/dist/esm/core/navigation/navigation.utils.js +283 -34
  597. package/dist/esm/core/navigation/navigation.utils.js.map +1 -1
  598. package/dist/esm/core/navigation/useIsStackEntryActive.d.ts +0 -10
  599. package/dist/esm/core/navigation/useIsStackEntryActive.d.ts.map +0 -1
  600. package/dist/esm/core/navigation/useIsStackEntryActive.js.map +0 -1
  601. package/dist/esm/core/navigation/useNavigationController.d.ts +28 -157
  602. package/dist/esm/core/navigation/useNavigationController.d.ts.map +1 -1
  603. package/dist/esm/core/navigation/useNavigationController.js +211 -1189
  604. package/dist/esm/core/navigation/useNavigationController.js.map +1 -1
  605. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts +174 -0
  606. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -0
  607. package/dist/esm/core/navigation/useNavigationRouterSync.js +977 -0
  608. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -0
  609. package/dist/esm/core/navigation/useOverlayTitle.d.ts +13 -1
  610. package/dist/esm/core/navigation/useOverlayTitle.d.ts.map +1 -1
  611. package/dist/esm/core/navigation/useOverlayTitle.js +15 -10
  612. package/dist/esm/core/navigation/useOverlayTitle.js.map +1 -1
  613. package/dist/esm/core/navigation/useResponsiveZoneMigration.d.ts +43 -0
  614. package/dist/esm/core/navigation/useResponsiveZoneMigration.d.ts.map +1 -0
  615. package/dist/esm/core/navigation/useResponsiveZoneMigration.js +44 -0
  616. package/dist/esm/core/navigation/useResponsiveZoneMigration.js.map +1 -0
  617. package/dist/esm/core/navigation/zone-collapse-migration.d.ts +83 -0
  618. package/dist/esm/core/navigation/zone-collapse-migration.d.ts.map +1 -0
  619. package/dist/esm/core/navigation/zone-collapse-migration.js +116 -0
  620. package/dist/esm/core/navigation/zone-collapse-migration.js.map +1 -0
  621. package/dist/esm/core/navigation/zone-collapse.d.ts +51 -0
  622. package/dist/esm/core/navigation/zone-collapse.d.ts.map +1 -0
  623. package/dist/esm/core/navigation/zone-collapse.js +59 -0
  624. package/dist/esm/core/navigation/zone-collapse.js.map +1 -0
  625. package/dist/esm/core/navigation/zone-emphasis.d.ts +3 -0
  626. package/dist/esm/core/navigation/zone-emphasis.d.ts.map +1 -1
  627. package/dist/esm/core/navigation/zone-emphasis.js +26 -4
  628. package/dist/esm/core/navigation/zone-emphasis.js.map +1 -1
  629. package/dist/esm/core/navigation/zone-visible-entry.d.ts +22 -0
  630. package/dist/esm/core/navigation/zone-visible-entry.d.ts.map +1 -1
  631. package/dist/esm/core/navigation/zone-visible-entry.js +25 -0
  632. package/dist/esm/core/navigation/zone-visible-entry.js.map +1 -1
  633. package/dist/esm/core/requests/websockets/WebSocketContext.d.ts.map +1 -1
  634. package/dist/esm/core/requests/websockets/WebSocketContext.js +53 -18
  635. package/dist/esm/core/requests/websockets/WebSocketContext.js.map +1 -1
  636. package/dist/esm/core/requests/websockets/WebSocketEventBridge.d.ts.map +1 -1
  637. package/dist/esm/core/requests/websockets/WebSocketEventBridge.js +3 -1
  638. package/dist/esm/core/requests/websockets/WebSocketEventBridge.js.map +1 -1
  639. package/dist/esm/core/requests/websockets/useNotificationBadges.d.ts +22 -0
  640. package/dist/esm/core/requests/websockets/useNotificationBadges.d.ts.map +1 -1
  641. package/dist/esm/core/requests/websockets/useNotificationBadges.js +72 -3
  642. package/dist/esm/core/requests/websockets/useNotificationBadges.js.map +1 -1
  643. package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.d.ts +28 -0
  644. package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.d.ts.map +1 -0
  645. package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.js +86 -0
  646. package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.js.map +1 -0
  647. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +38 -3
  648. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  649. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +57 -2
  650. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  651. package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.d.ts.map +1 -1
  652. package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js +4 -2
  653. package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js.map +1 -1
  654. package/dist/esm/core/requests/wildo-http-client.frontend.service.d.ts +30 -1
  655. package/dist/esm/core/requests/wildo-http-client.frontend.service.d.ts.map +1 -1
  656. package/dist/esm/core/requests/wildo-http-client.frontend.service.js +47 -4
  657. package/dist/esm/core/requests/wildo-http-client.frontend.service.js.map +1 -1
  658. package/dist/esm/core/resources/ResourceRegistryContext.d.ts.map +1 -1
  659. package/dist/esm/core/resources/ResourceRegistryContext.js +22 -1
  660. package/dist/esm/core/resources/ResourceRegistryContext.js.map +1 -1
  661. package/dist/esm/core/resources/context-resource-identifiers.frontend.utils.js +1 -1
  662. package/dist/esm/core/resources/context-resource-identifiers.frontend.utils.js.map +1 -1
  663. package/dist/esm/core/resources/frontend-resource.utils.d.ts +22 -1
  664. package/dist/esm/core/resources/frontend-resource.utils.d.ts.map +1 -1
  665. package/dist/esm/core/resources/frontend-resource.utils.js +25 -2
  666. package/dist/esm/core/resources/frontend-resource.utils.js.map +1 -1
  667. package/dist/esm/core/resources/operation-semantics.frontend.utils.d.ts +113 -13
  668. package/dist/esm/core/resources/operation-semantics.frontend.utils.d.ts.map +1 -1
  669. package/dist/esm/core/resources/operation-semantics.frontend.utils.js +173 -20
  670. package/dist/esm/core/resources/operation-semantics.frontend.utils.js.map +1 -1
  671. package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.d.ts +11 -0
  672. package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.d.ts.map +1 -1
  673. package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.js +7 -0
  674. package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.js.map +1 -1
  675. package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.d.ts +3 -2
  676. package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.d.ts.map +1 -1
  677. package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.js +13 -5
  678. package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.js.map +1 -1
  679. package/dist/esm/core/resources/resources-repository.frontend.service.d.ts +6 -0
  680. package/dist/esm/core/resources/resources-repository.frontend.service.d.ts.map +1 -1
  681. package/dist/esm/core/resources/resources-repository.frontend.service.js +90 -1
  682. package/dist/esm/core/resources/resources-repository.frontend.service.js.map +1 -1
  683. package/dist/esm/core/resources/resources.frontend.schemas.d.ts +139 -16
  684. package/dist/esm/core/resources/resources.frontend.schemas.d.ts.map +1 -1
  685. package/dist/esm/core/resources/resources.frontend.schemas.js +110 -11
  686. package/dist/esm/core/resources/resources.frontend.schemas.js.map +1 -1
  687. package/dist/esm/core/resources/rmm/ResourceMutationManager.d.ts.map +1 -1
  688. package/dist/esm/core/resources/rmm/ResourceMutationManager.js +3 -1
  689. package/dist/esm/core/resources/rmm/ResourceMutationManager.js.map +1 -1
  690. package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.d.ts +10 -0
  691. package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.d.ts.map +1 -1
  692. package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.js +8 -0
  693. package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.js.map +1 -1
  694. package/dist/esm/core/resources/rmm/useResourceRMM.d.ts +7 -0
  695. package/dist/esm/core/resources/rmm/useResourceRMM.d.ts.map +1 -1
  696. package/dist/esm/core/resources/rmm/useResourceRMM.js +9 -2
  697. package/dist/esm/core/resources/rmm/useResourceRMM.js.map +1 -1
  698. package/dist/esm/core/resources/useOperationDirectExecution.d.ts +59 -0
  699. package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -0
  700. package/dist/esm/core/resources/useOperationDirectExecution.js +278 -0
  701. package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -0
  702. package/dist/esm/core/resources/useResourceOperationActions.d.ts +1 -1
  703. package/dist/esm/core/resources/useResourceOperationActions.d.ts.map +1 -1
  704. package/dist/esm/core/resources/useResourceOperationActions.js +69 -22
  705. package/dist/esm/core/resources/useResourceOperationActions.js.map +1 -1
  706. package/dist/esm/core/resources/useResourceOperationSurface.d.ts +8 -6
  707. package/dist/esm/core/resources/useResourceOperationSurface.d.ts.map +1 -1
  708. package/dist/esm/core/resources/useResourceOperationSurface.js +3 -2
  709. package/dist/esm/core/resources/useResourceOperationSurface.js.map +1 -1
  710. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  711. package/dist/esm/core/runtime/AppRouter.js +23 -2
  712. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  713. package/dist/esm/core/runtime/ApplicationContext.shared.d.ts +4 -2
  714. package/dist/esm/core/runtime/ApplicationContext.shared.d.ts.map +1 -1
  715. package/dist/esm/core/runtime/ApplicationContext.shared.js.map +1 -1
  716. package/dist/esm/core/runtime/ApplicationMainContext.d.ts +12 -2
  717. package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
  718. package/dist/esm/core/runtime/ApplicationMainContext.js +5 -2
  719. package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
  720. package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts +25 -1
  721. package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts.map +1 -1
  722. package/dist/esm/core/runtime/domain-module.frontend.definitions.js +37 -1
  723. package/dist/esm/core/runtime/domain-module.frontend.definitions.js.map +1 -1
  724. package/dist/esm/core/runtime/start-application.frontend.service.d.ts +21 -2
  725. package/dist/esm/core/runtime/start-application.frontend.service.d.ts.map +1 -1
  726. package/dist/esm/core/runtime/start-application.frontend.service.js +51 -4
  727. package/dist/esm/core/runtime/start-application.frontend.service.js.map +1 -1
  728. package/dist/esm/core/security/AuthSessionContext.d.ts +11 -0
  729. package/dist/esm/core/security/AuthSessionContext.d.ts.map +1 -1
  730. package/dist/esm/core/security/AuthSessionContext.js +70 -22
  731. package/dist/esm/core/security/AuthSessionContext.js.map +1 -1
  732. package/dist/esm/core/security/StepUpAuthContext.d.ts.map +1 -1
  733. package/dist/esm/core/security/StepUpAuthContext.js +10 -2
  734. package/dist/esm/core/security/StepUpAuthContext.js.map +1 -1
  735. package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
  736. package/dist/esm/core/security/UserOrgsContext.js +72 -8
  737. package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
  738. package/dist/esm/core/security/route-organization-access.frontend.utils.d.ts +7 -0
  739. package/dist/esm/core/security/route-organization-access.frontend.utils.d.ts.map +1 -1
  740. package/dist/esm/core/security/route-organization-access.frontend.utils.js +8 -2
  741. package/dist/esm/core/security/route-organization-access.frontend.utils.js.map +1 -1
  742. package/dist/esm/core/security/useGrantedConsentPurposes.d.ts +30 -0
  743. package/dist/esm/core/security/useGrantedConsentPurposes.d.ts.map +1 -0
  744. package/dist/esm/core/security/useGrantedConsentPurposes.js +38 -0
  745. package/dist/esm/core/security/useGrantedConsentPurposes.js.map +1 -0
  746. package/dist/esm/core/ui/UIContext.d.ts.map +1 -1
  747. package/dist/esm/core/ui/UIContext.js +10 -6
  748. package/dist/esm/core/ui/UIContext.js.map +1 -1
  749. package/dist/esm/core/ui/color-conversion.utils.d.ts +20 -0
  750. package/dist/esm/core/ui/color-conversion.utils.d.ts.map +1 -1
  751. package/dist/esm/core/ui/color-conversion.utils.js +39 -5
  752. package/dist/esm/core/ui/color-conversion.utils.js.map +1 -1
  753. package/dist/esm/core/ui/themes/default.theme.d.ts.map +1 -1
  754. package/dist/esm/core/ui/themes/default.theme.js +22 -2
  755. package/dist/esm/core/ui/themes/default.theme.js.map +1 -1
  756. package/dist/esm/core/ui/ui.frontend.schemas.d.ts +6 -6
  757. package/dist/esm/core/ui/ui.frontend.schemas.d.ts.map +1 -1
  758. package/dist/esm/core/ui/ui.frontend.schemas.js +3 -3
  759. package/dist/esm/core/ui/ui.frontend.schemas.js.map +1 -1
  760. package/dist/esm/index.d.ts +10 -1
  761. package/dist/esm/index.d.ts.map +1 -1
  762. package/dist/esm/index.js +19 -1
  763. package/dist/esm/index.js.map +1 -1
  764. package/dist/esm/testing/app-shell-placement-coverage.d.ts +43 -0
  765. package/dist/esm/testing/app-shell-placement-coverage.d.ts.map +1 -0
  766. package/dist/esm/testing/app-shell-placement-coverage.js +114 -0
  767. package/dist/esm/testing/app-shell-placement-coverage.js.map +1 -0
  768. package/dist/esm/testing/mock-builders.d.ts.map +1 -1
  769. package/dist/esm/testing/mock-builders.js +5 -0
  770. package/dist/esm/testing/mock-builders.js.map +1 -1
  771. package/dist/esm/testing.d.ts +1 -0
  772. package/dist/esm/testing.d.ts.map +1 -1
  773. package/dist/esm/testing.js +1 -0
  774. package/dist/esm/testing.js.map +1 -1
  775. package/package.json +9 -7
  776. package/dist/esm/core/navigation/useIsStackEntryActive.js +0 -15
  777. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BillingContext.js","sourceRoot":"","sources":["../../../../../src/core/billing/BillingContext.tsx"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAc,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAehG,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,+CAA+C,EAC/C,wCAAwC,EACxC,gDAAgD,EAChD,4BAA4B,EAC5B,kCAAkC,EAClC,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACtH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mFAAmF,CAAC;AAC7H,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iEAAiE,CAAC;AAE3G,mCAAmC;AACnC,SAAS;AACT,mCAAmC;AAEnC,MAAM,aAAa,GAA0B,qBAAqB,CAAC,SAAS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e;QACf,gBAAgB;QAChB,KAAK;QACL,WAAW;QACX,YAAY;QACZ,kBAAkB;QAClB,iBAAiB;QACjB,iBAAiB;QACjB,SAAS;QACT,YAAY;QACZ,gBAAgB;QAChB,KAAK;QACL,OAAO,EAAE,iBAAiB;KAC3B,CAAC,EACF;QACE,SAAS;QACT,aAAa;QACb,eAAe;QACf,cAAc;QACd,YAAY;QACZ,cAAc;QACd,kBAAkB;QAClB,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,kBAAkB;QAClB,mBAAmB;QACnB,eAAe;QACf,gBAAgB;QAChB,KAAK;QACL,WAAW;QACX,YAAY;QACZ,kBAAkB;QAClB,iBAAiB;QACjB,iBAAiB;QACjB,SAAS;QACT,YAAY;QACZ,gBAAgB;QAChB,KAAK;QACL,iBAAiB;KAClB,CACF,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACzC,QAAQ,GACe,CAC3B,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,QAA+C;IAE/C,OAAO,CAAC,CAAC,QAAQ;WACZ,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,2BAA2B,CAAC,OAAO,CAAC;WAC3E,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import type { z } from 'zod';\n/**\n * BillingContext\n *\n * Central context for billing operations on the frontend.\n *\n * Responsibilities:\n * - Self-resolves scope (org/user) from AppScope + user context — no external props needed\n * - Fetches billing state via the GET_STATE resource operation on the billing account\n * - The backend auto-creates the billing account if one doesn't exist\n * - Provides actions: openCheckout, openCustomerPortal (via resource operations)\n * - Caches billing state and invalidates on WebSocket events\n * - Exposes convenience accessors for current plan, subscription status, etc.\n *\n * DELEGATION PRINCIPLE: The frontend does NOT build payment UI.\n * - Stripe Checkout (hosted page): for new subscriptions and upgrades\n * - Stripe Customer Portal (hosted page): for invoices, payment methods, cancellation\n */\n\nimport React, { createContext, useEffect, useState, useCallback, useMemo, useRef } from 'react';\nimport type {\n BillingAccount,\n BillingSubscriptionBase,\n Product,\n Price,\n Promotion,\n InvoiceRef,\n UsageSummary,\n BillingConfiguration,\n ProductDefinition,\n BillingStateResponse,\n BillingStateAvailability,\n WS_BillingEventPayload,\n} from '@wildo-ai/saas-models';\nimport {\n BillingAccount_Operations,\n BillingSubscription_Operations,\n BillingSubscription_PreviewPlanChangeRequestDto,\n BillingSubscription_ChangePlanRequestDto,\n BillingSubscription_PlanChangePreviewResponseDto,\n ResourceOperationVariantType,\n ResourcesConfig_OperationPathUtils,\n HttpMethod,\n BillingStateSlice,\n BillingSliceAvailability,\n BUILTIN_PROVIDER_CAPABILITY,\n BUILTIN_PROVIDER_PROTOCOL,\n CoreWebSocketEvent,\n CoreResourceType,\n ResourcePrimaryScope,\n MAIN_API_BASE_PATH,\n userRolesSatisfyRequiredRoles,\n} from '@wildo-ai/saas-models';\nimport type { FrontendAppProviderModule, FrontendAppProviderRef } from '@wildo-ai/external-connectors-public/app';\nimport { useWebSocket } from '~wildo-frontend-lib/core/requests/websockets/useWebSocket';\nimport { useUserOrgs } from '~wildo-frontend-lib/core/security/useUserOrgs';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication';\nimport { isResourceReachable, useResourceRegistrySafe } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service';\nimport { useEmitLoadingScope } from '~wildo-frontend-lib/core/loading/useEmitLoadingScope';\nimport { ContextLoadingIdentifier } from '~wildo-frontend-lib/core/loading/loading-types.frontend.schemas';\n\n// ================================\n// Logger\n// ================================\n\nconst billingLogger: LoggerFrontendService = LoggerFrontendService.getLogger();\nconst logDebug: (message: string, context?: Record<string, unknown>) => void = billingLogger.debugByType('BillingContext');\nbillingLogger.setDebugTypeLogging('BillingContext', false);\n\n// ================================\n// Constants\n// ================================\n\nconst API_PREFIX = MAIN_API_BASE_PATH;\n\n/** WebSocket events that trigger a refetch of billing state */\nconst INVALIDATION_EVENTS = [\n CoreWebSocketEvent.BILLING_STATUS_CHANGED,\n CoreWebSocketEvent.BILLING_SUBSCRIPTION_UPDATED,\n CoreWebSocketEvent.BILLING_ACCOUNT_CHANGED,\n CoreWebSocketEvent.BILLING_USAGE_UPDATED,\n CoreWebSocketEvent.BILLING_CREDIT_POOL_UPDATED,\n CoreWebSocketEvent.BILLING_FEATURES_UPDATED,\n] as const;\n\n/** Maps ResourcePrimaryScope → billing account variant resource type (for resource operations) */\nconst SCOPE_TO_BILLING_ACCOUNT_RESOURCE: Record<string, string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS,\n [ResourcePrimaryScope.USER_SELF]: CoreResourceType.USER_BILLING_ACCOUNTS,\n};\n\n// The billing-account GET_STATE / OPEN_CHECKOUT / OPEN_PORTAL custom operations\n// borrow COUNT / UPDATE / READ core semantics (see\n// `billing-account.shared.resources-config.schemas.ts`), so their canonical\n// routes follow the framework's scoped resource-operation shape:\n// GET_STATE (COUNT-like) → GET /<scope>/{id}/<res>/get-state/count\n// OPEN_CHECKOUT (UPDATE-like) → PUT /<scope>/{id}/<res>/{accountId}/open-checkout\n// OPEN_PORTAL (READ-like) → GET /<scope>/{id}/<res>/{accountId}/open-portal\n// Built here to mirror the routes the backend registers from the same\n// resources-config; the prior `/operations/open_checkout` POST 404'd.\n\n/** Maps ResourcePrimaryScope → GET_STATE URL builder (COUNT-like → trailing `/count`) */\nconst SCOPE_TO_GET_STATE_URL: Record<string, (scopeEntityId: string) => string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: (id) => `${API_PREFIX}/organizations/${id}/organization-billing-accounts/get-state/count`,\n [ResourcePrimaryScope.USER_SELF]: (id) => `${API_PREFIX}/users/${id}/user-billing-accounts/get-state/count`,\n};\n\n/** Maps ResourcePrimaryScope → OPEN_CHECKOUT URL builder (UPDATE-like → keyed PUT) */\nconst SCOPE_TO_OPEN_CHECKOUT_URL: Record<string, (scopeEntityId: string, billingAccountId: string) => string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: (id, acc) => `${API_PREFIX}/organizations/${id}/organization-billing-accounts/${acc}/open-checkout`,\n [ResourcePrimaryScope.USER_SELF]: (id, acc) => `${API_PREFIX}/users/${id}/user-billing-accounts/${acc}/open-checkout`,\n};\n\n/** Maps ResourcePrimaryScope → OPEN_PORTAL URL builder (READ-like → keyed GET) */\nconst SCOPE_TO_OPEN_PORTAL_URL: Record<string, (scopeEntityId: string, billingAccountId: string) => string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: (id, acc) => `${API_PREFIX}/organizations/${id}/organization-billing-accounts/${acc}/open-portal`,\n [ResourcePrimaryScope.USER_SELF]: (id, acc) => `${API_PREFIX}/users/${id}/user-billing-accounts/${acc}/open-portal`,\n};\n\n// ================================\n// API Response Types\n// ================================\n\n/** Response from PUT /<scope>/{id}/<billing-accounts>/{accountId}/open-checkout (OPEN_CHECKOUT) */\ninterface CheckoutSessionResponse {\n url: string;\n sessionId: string;\n}\n\n/** Response from GET /<scope>/{id}/<billing-accounts>/{accountId}/open-portal (OPEN_PORTAL) */\ninterface PortalSessionResponse {\n url: string;\n}\n\n// ================================\n// Context Type\n// ================================\n\n/**\n * @wildo_source:part:start saas.frontend.billing-context facet:layer:frontend facet:audience:app-developer\n *\n * Everything an application's own frontend reads or does about billing. Reached with `useBilling()`,\n * which throws outside a `BillingProvider`; `useBillingSafe()` returns `undefined` instead, for a\n * component that may render before the provider mounts or in an application where billing is off.\n *\n * The shipped billing components and the feature-gating hooks read this same context, so an\n * application composing its own purchase flow works from exactly what they do — no application code\n * builds the request.\n *\n * ## Starting a purchase\n *\n * `openCheckout(productKey, priceId, options)` posts to the scoped billing-account route and follows\n * the returned URL; success and cancel destinations come from the application's own redirect base. A\n * SECOND call while one is in flight is IGNORED, so a double-click cannot open two sessions — do not\n * add your own guard expecting otherwise, and do not read the silence as a failure.\n *\n * The `priceId` must belong to the product named by `productKey`; the checkout operation refuses a\n * mismatched pair. Resolve it through `getPricesForProduct` rather than assuming an ordering.\n *\n * `openCustomerPortal()` opens the provider's own portal — which is where payment methods, card\n * updates and receipt downloads live. Those are deliberately NOT rendered by the framework, so an\n * application that needs them links the portal rather than building them.\n *\n * ## What `usage` contains\n *\n * Metered consumption appears here only if the application RECORDS it. Nothing is automatic: a\n * metered product with no recorded usage shows an empty dashboard rather than an error.\n *\n * ## Invoices are capped\n *\n * `invoices` carries the fifty most recent, which is what the shipped history component renders. An\n * application needing more reads the invoices resource directly.\n */\nexport type BillingPlanChangeTarget = z.infer<typeof BillingSubscription_PreviewPlanChangeRequestDto>;\nexport type BillingPlanChangeConfirmation = z.infer<typeof BillingSubscription_ChangePlanRequestDto>;\nexport type BillingPlanChangePreviewResponse = z.infer<typeof BillingSubscription_PlanChangePreviewResponseDto>;\n\nexport interface BillingContextType {\n // ── Configuration ──\n isEnabled: boolean;\n billingConfiguration: BillingConfiguration | undefined;\n billingProvider: FrontendAppProviderModule | null;\n\n // ── Billing State ──\n billingAccount: BillingAccount | null;\n subscription: BillingSubscriptionBase | null;\n currentPlanKey: string | null;\n currentPlanProduct: Product | null;\n\n // ── Product Catalog ──\n products: Product[];\n prices: Price[];\n productDefinitions: ProductDefinition[];\n getPricesForProduct: (productId: string) => Price[];\n getProductByKey: (key: string) => Product | undefined;\n\n // ── Scope ──\n currentScope: ResourcePrimaryScope | null;\n\n // ── Invoices ──\n invoices: InvoiceRef[];\n\n // ── Promotions ──\n activePromotions: Promotion[];\n\n // ── Usage & Credits ──\n usage: UsageSummary;\n creditPools: Record<string, { available: number; totalPurchased: number; totalConsumed: number }>;\n\n // ── Actions ──\n openCheckout: (productKey: string, priceId: string, options?: {\n quantity?: number;\n promotionCode?: string;\n }) => Promise<void>;\n\n openCustomerPortal: () => Promise<void>;\n /** Provider estimate bound to the current subscription and selected target; never commits a change. */\n previewPlanChange: (target: BillingPlanChangeTarget, options?: { signal?: AbortSignal }) => Promise<BillingPlanChangePreviewResponse>;\n /** Confirm only the server token returned for the displayed preview. Successful mutation refreshes billing state. */\n confirmPlanChange: (confirmation: BillingPlanChangeConfirmation) => Promise<void>;\n\n // ── State ──\n isLoading: boolean;\n error: Error | null;\n /** Only a successful slice read establishes emptiness; failed or absent state is unavailable. */\n availability: BillingStateAvailability | null;\n isSliceAvailable: (slice: BillingStateSlice) => boolean;\n\n // ── Actions ──\n refetch: () => void;\n}\n\n// ── Default empty state ──\nconst EMPTY_USAGE: UsageSummary = {\n byProduct: {},\n};\n\n/** @wildo_source:part:end saas.frontend.billing-context */\n\nexport const BillingContext: React.Context<BillingContextType | undefined> = createContext<BillingContextType | undefined>(undefined);\n\n// ================================\n// Provider\n// ================================\n\nexport interface BillingProviderProps {\n children: React.ReactNode;\n productDefinitions?: ProductDefinition[];\n}\n\nexport function BillingProvider({ children, productDefinitions: injectedProductDefinitions }: BillingProviderProps): React.ReactElement {\n // ── Self-resolve configuration from hooks ──\n const userOrgs = useUserOrgs();\n const appScope = useAppScopeSafe();\n const { appConfig, frontendProviderRegistry } = useApplication();\n const resourceRegistry = useResourceRegistrySafe();\n const billingConfig = appConfig.billing;\n /** What the application CONFIGURED — see `isEnabled` below for why that is only half the answer. */\n const isConfiguredEnabled = billingConfig?.enabled ?? false;\n const billingProvider = useMemo(() => {\n const configuredProviderRef = billingConfig?.providerRef;\n\n const configuredProvider = configuredProviderRef\n ? frontendProviderRegistry?.getProviderByRef(\n configuredProviderRef as FrontendAppProviderRef,\n )\n : undefined;\n\n const resolvedProvider = isBillingFrontendProvider(configuredProvider)\n ? configuredProvider\n : frontendProviderRegistry?.findByProviderCapabilityAndProtocol(\n BUILTIN_PROVIDER_CAPABILITY.BILLING,\n BUILTIN_PROVIDER_PROTOCOL.BILLING_PROVIDER,\n ) ?? null;\n\n if (isConfiguredEnabled && configuredProviderRef && resolvedProvider?.metadata.ref !== configuredProviderRef) {\n logDebug('Billing config providerRef does not match the hydrated frontend billing provider', {\n configuredProviderRef,\n resolvedProviderRef: resolvedProvider?.metadata.ref,\n });\n }\n\n return resolvedProvider;\n }, [billingConfig?.providerRef, frontendProviderRegistry, isConfiguredEnabled]);\n\n // ── Self-resolve scope ──\n const enabledScopes = billingConfig?.enabledScopes ?? [ResourcePrimaryScope.ORGANIZATIONS];\n\n const { scopeType, scopeEntityId } = useMemo(() => {\n if (enabledScopes.includes(ResourcePrimaryScope.ORGANIZATIONS) && appScope?.currentOrganizationId) {\n return { scopeType: ResourcePrimaryScope.ORGANIZATIONS as ResourcePrimaryScope, scopeEntityId: appScope.currentOrganizationId };\n }\n if (enabledScopes.includes(ResourcePrimaryScope.USER_SELF) && userOrgs.user?._id) {\n return { scopeType: ResourcePrimaryScope.USER_SELF as ResourcePrimaryScope, scopeEntityId: userOrgs.user._id };\n }\n return { scopeType: null as ResourcePrimaryScope | null, scopeEntityId: null as string | null };\n }, [enabledScopes, appScope?.currentOrganizationId, userOrgs.user?._id]);\n\n // ── Derive variant resource type for operations ──\n const billingAccountResourceType = scopeType ? SCOPE_TO_BILLING_ACCOUNT_RESOURCE[scopeType] : null;\n\n /**\n * Enabled means CONFIGURED **and** REACHABLE — the config flag alone was not enough.\n *\n * Every request this provider makes is an operation on a billing-account resource, so a consumer\n * whose registry does not carry that resource cannot serve one no matter what the config says.\n * That is not hypothetical: the application-creation workbench excludes the whole tenant\n * vocabulary from its registry (it observes an application's creation and is not that\n * application's admin console) while rendering the OBSERVED application's config, which has\n * billing enabled — so it fired `organization-billing-accounts/get-state/count` at its own origin\n * on every page load, where the companion serves no billing routes, and answered 404 every time\n * (issue #268, reproduced live).\n *\n * Reading the registry rather than adding a second opt-out keeps the two halves from disagreeing:\n * a consumer that excludes the resource has already said billing is not part of its surface, and\n * saying it twice is how the two copies drift. A tenant application carries the resource and is\n * unaffected.\n */\n const isEnabled = isConfiguredEnabled\n && billingAccountResourceType !== null\n // The absent-registry-is-ignorance rule lives on the seam (`isResourceReachable`), shared with the\n // features, guidance and analytics providers since #1069 so the four cannot drift.\n && isResourceReachable(resourceRegistry, billingAccountResourceType);\n\n /**\n * Whether THIS CALLER may read the billing state served for this scope — kept separate from `isEnabled`, on purpose.\n *\n * `isEnabled` says billing is PART OF the application. Every consumer of it — feature availability, operation\n * gating, the launcher — needs that answer for every user alike, so it must not vary with who is looking.\n *\n * Fetching is a different question. `GET_STATE` is role-gated per scope (organization owners and administrators on\n * the organization variant), and a plain member used to request it on every page load, be refused with 403, and\n * see an access-denied message on a page with nothing wrong with it (#1039). That member already ended with a null\n * billing state — the refusal produced it — so not asking changes nothing they can see except the message.\n *\n * The required roles are read from the registry's OWN operation, never copied, and decided by the same\n * hierarchy-aware check the action bar uses. That check fails open on a role it cannot resolve, so a custom role\n * inheriting an administrator role is not locked out here — the server stays the authority either way. With no\n * registry, or no such operation in it, there is no evidence to withhold on, and the request goes out as before.\n */\n const permissions = userOrgs.permissions;\n const currentOrganizationId = appScope?.currentOrganizationId ?? null;\n const mayReadBillingState = useMemo((): boolean => {\n if (!isEnabled || !billingAccountResourceType) return false;\n const getStateOperation = resourceRegistry?.registry.resourceConfigurations[billingAccountResourceType]\n ?.operations.find((operation) =>\n String(operation.operationIdentifier) === BillingAccount_Operations.GET_STATE && operation.isOperationDefault === true);\n if (!getStateOperation) return true;\n return userRolesSatisfyRequiredRoles({\n requiredRoles: getStateOperation.roles,\n userAppRoles: permissions?.appLevel ?? [],\n userOrgRoles: currentOrganizationId ? permissions?.organizations?.[currentOrganizationId] ?? [] : [],\n });\n }, [isEnabled, billingAccountResourceType, resourceRegistry, permissions, currentOrganizationId]);\n\n // ── State ──\n const [billingState, setBillingState] = useState<BillingStateResponse | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(mayReadBillingState && !!scopeEntityId);\n const [error, setError] = useState<Error | null>(null);\n\n // L-2.b: mirror local loading state onto the LoadingContext event bus so\n // unrelated components can observe billing-state lifecycle via\n // `useComponentLoading({ customIdentifier: ContextLoadingIdentifier.BILLING_STATE })`\n // or `<LoadingGate scopes={[buildContextLoadingScope(BILLING_STATE)]}>`.\n // Local `isLoading` is still exposed for direct consumers (back-compat).\n useEmitLoadingScope({\n identifier: ContextLoadingIdentifier.BILLING_STATE,\n isLoading,\n hasLoadedOnce: billingState !== null,\n });\n\n // ── Refs for stable callbacks ──\n const fetchInFlightRef = useRef<boolean>(false);\n const mountedRef = useRef<boolean>(true);\n const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const checkoutInFlightRef = useRef<boolean>(false);\n\n // ── WebSocket ──\n const { on } = useWebSocket();\n\n // ── Resolve redirect base URL ──\n const resolvedRedirectBase = useMemo(\n () => typeof window !== 'undefined' ? window.location.origin : '',\n [],\n );\n\n // ── billingAccountId from response ──\n const billingAccountId = billingState?.billingAccount?._id ?? null;\n\n // ── Clear stale state on scope change ──\n useEffect(() => {\n setBillingState(null);\n setError(null);\n setIsLoading(mayReadBillingState && !!scopeEntityId);\n }, [scopeType, scopeEntityId, mayReadBillingState]);\n\n // ── Fetch billing state from backend ──\n const fetchBillingState = useCallback(async () => {\n if (!mayReadBillingState || !scopeType || !scopeEntityId) return;\n if (fetchInFlightRef.current) return;\n fetchInFlightRef.current = true;\n\n try {\n logDebug('Fetching billing state', { scopeType, scopeEntityId });\n const httpClient = getManualCallsHttpClient();\n\n const urlBuilder = SCOPE_TO_GET_STATE_URL[scopeType];\n if (!urlBuilder) return;\n const url = urlBuilder(scopeEntityId);\n const response = await httpClient.get<BillingStateResponse>(url);\n\n if (mountedRef.current) {\n setBillingState(response);\n setError(null);\n\n logDebug('Billing state fetched', {\n hasAccount: !!response.billingAccount,\n hasSubscription: !!response.subscription,\n productCount: response.products?.length ?? 0,\n priceCount: response.prices?.length ?? 0,\n billingAccountId: response.billingAccount?._id,\n });\n }\n } catch (err: unknown) {\n if (mountedRef.current) {\n const message = err instanceof Error ? err.message : 'Failed to fetch billing state';\n setBillingState(null);\n setError(err instanceof Error ? err : new Error(message));\n logDebug('Failed to fetch billing state', { error: message });\n }\n } finally {\n if (mountedRef.current) {\n setIsLoading(false);\n }\n fetchInFlightRef.current = false;\n }\n }, [mayReadBillingState, scopeType, scopeEntityId]);\n\n // ── Initial fetch ──\n useEffect(() => {\n mountedRef.current = true;\n if (mayReadBillingState && scopeType && scopeEntityId) {\n fetchBillingState();\n } else {\n setIsLoading(false);\n }\n return () => {\n mountedRef.current = false;\n };\n }, [fetchBillingState, mayReadBillingState, scopeType, scopeEntityId]);\n\n // ── WebSocket invalidation (debounced) ──\n useEffect(() => {\n if (!mayReadBillingState) return;\n\n const unsubscribers: Array<() => void> = [];\n\n const debouncedRefetch = () => {\n if (debounceTimerRef.current) {\n clearTimeout(debounceTimerRef.current);\n }\n debounceTimerRef.current = setTimeout(() => {\n debounceTimerRef.current = null;\n fetchBillingState();\n }, 300);\n };\n\n for (const event of INVALIDATION_EVENTS) {\n const unsub = on<WS_BillingEventPayload>(event, (payload) => {\n if (!scopeType || !scopeEntityId) {\n logDebug('Ignoring billing invalidation without active scope', { event, payload });\n return;\n }\n\n if (payload.scopeType !== scopeType || payload.scopeEntityId !== scopeEntityId) {\n logDebug('Ignoring billing invalidation for another scope', {\n event,\n payload,\n currentScopeType: scopeType,\n currentScopeEntityId: scopeEntityId,\n });\n return;\n }\n\n if (billingAccountId && payload.billingAccountId !== billingAccountId) {\n logDebug('Ignoring billing invalidation for another billing account', {\n event,\n payload,\n currentBillingAccountId: billingAccountId,\n });\n return;\n }\n\n logDebug('WebSocket invalidation event received, scheduling refetch', { event, payload });\n debouncedRefetch();\n });\n unsubscribers.push(unsub);\n }\n\n return () => {\n if (debounceTimerRef.current) {\n clearTimeout(debounceTimerRef.current);\n }\n for (const unsub of unsubscribers) {\n unsub();\n }\n };\n }, [on, fetchBillingState, mayReadBillingState, scopeType, scopeEntityId, billingAccountId]);\n\n // ── Derived state ──\n const availability = billingState?.availability ?? null;\n const isSliceAvailable = useCallback((slice: BillingStateSlice) => availability?.[slice] === BillingSliceAvailability.AVAILABLE, [availability]);\n\n const billingAccount = billingState?.billingAccount ?? null;\n const subscription = billingState?.subscription ?? null;\n const products = billingState?.products ?? [];\n const prices = billingState?.prices ?? [];\n const invoices = billingState?.invoices ?? [];\n const usage = billingState?.usage ?? EMPTY_USAGE;\n const creditPools = billingState?.creditPools ?? {};\n const activePromotions = billingState?.activePromotions ?? [];\n const currentScope = scopeType ?? null;\n\n // ── Product catalog lookups ──\n const productsByKey = useMemo(() => {\n const map = new Map<string, Product>();\n for (const p of products) {\n map.set(p.key, p);\n }\n return map;\n }, [products]);\n\n const pricesByProductId = useMemo(() => {\n const map = new Map<string, Price[]>();\n for (const price of prices) {\n const existing = map.get(price.productId) ?? [];\n existing.push(price);\n map.set(price.productId, existing);\n }\n return map;\n }, [prices]);\n\n const getPricesForProduct = useCallback(\n (productId: string): Price[] => pricesByProductId.get(productId) ?? [],\n [pricesByProductId],\n );\n\n const getProductByKey = useCallback(\n (key: string): Product | undefined => productsByKey.get(key),\n [productsByKey],\n );\n\n // ── Current plan derivation ──\n const { currentPlanKey, currentPlanProduct } = useMemo(() => {\n if (!subscription || !subscription.items?.length) {\n return { currentPlanKey: null, currentPlanProduct: null };\n }\n for (const item of subscription.items) {\n const product = products.find(p => p._id === item.productId);\n if (product && product.type === 'plan') {\n return { currentPlanKey: product.key, currentPlanProduct: product };\n }\n }\n return { currentPlanKey: null, currentPlanProduct: null };\n }, [subscription, products]);\n\n const productDefinitions = useMemo<ProductDefinition[]>(\n () => injectedProductDefinitions ?? [],\n [injectedProductDefinitions],\n );\n\n // ── Actions ──\n const openCheckout = useCallback(\n async (productKey: string, priceId: string, options?: {\n quantity?: number;\n promotionCode?: string;\n }): Promise<void> => {\n if (!billingAccountId || !billingAccountResourceType || !scopeType || !scopeEntityId) {\n throw new Error('No billing account available. Cannot open checkout.');\n }\n const checkoutUrl = SCOPE_TO_OPEN_CHECKOUT_URL[scopeType]?.(scopeEntityId, billingAccountId);\n if (!checkoutUrl) {\n throw new Error(`No OPEN_CHECKOUT URL builder for scope ${scopeType}.`);\n }\n if (checkoutInFlightRef.current) {\n logDebug('Checkout already in progress, ignoring duplicate request');\n return;\n }\n\n checkoutInFlightRef.current = true;\n try {\n logDebug('Opening checkout session', { productKey, priceId, ...options });\n const httpClient = getManualCallsHttpClient();\n\n // OPEN_CHECKOUT borrows UPDATE → keyed PUT on the scoped account route.\n const response = await httpClient.put<CheckoutSessionResponse>(\n checkoutUrl,\n {\n productKey,\n priceId,\n successUrl: `${resolvedRedirectBase}/billing/success?session_id={CHECKOUT_SESSION_ID}`,\n cancelUrl: `${resolvedRedirectBase}/billing/cancel`,\n quantity: options?.quantity,\n promotionCode: options?.promotionCode,\n },\n );\n\n if (response.url) {\n window.location.href = response.url;\n }\n } finally {\n checkoutInFlightRef.current = false;\n }\n },\n [billingAccountId, billingAccountResourceType, scopeType, scopeEntityId, resolvedRedirectBase],\n );\n\n const openCustomerPortal = useCallback(async (): Promise<void> => {\n if (!billingAccountId || !billingAccountResourceType || !scopeType || !scopeEntityId) {\n throw new Error('No billing account available. Cannot open customer portal.');\n }\n const portalUrlBase = SCOPE_TO_OPEN_PORTAL_URL[scopeType]?.(scopeEntityId, billingAccountId);\n if (!portalUrlBase) {\n throw new Error(`No OPEN_PORTAL URL builder for scope ${scopeType}.`);\n }\n\n logDebug('Opening customer portal session');\n const httpClient = getManualCallsHttpClient();\n\n // OPEN_PORTAL borrows READ → keyed GET on the scoped account route; the\n // returnUrl travels as a query param since GET carries no request body.\n const returnUrl = encodeURIComponent(`${resolvedRedirectBase}/billing`);\n const response = await httpClient.get<PortalSessionResponse>(\n `${portalUrlBase}?returnUrl=${returnUrl}`,\n );\n\n if (response.url) {\n window.location.href = response.url;\n }\n }, [billingAccountId, billingAccountResourceType, scopeType, scopeEntityId, resolvedRedirectBase]);\n\n // ── Context value (memoized for stable reference) ──\n // Use the registry's compiled operation paths and parameter vocabulary. Subscription routes have\n // account and scope parents; hand-authored URLs would silently diverge between org and user variants.\n const callPlanOperation = useCallback(async <TResponse,>(\n operationIdentifier: BillingSubscription_Operations,\n payload: BillingPlanChangeTarget | BillingPlanChangeConfirmation,\n signal?: AbortSignal,\n ): Promise<TResponse> => {\n if (!resourceRegistry || !subscription?._id || !billingAccountId || !billingAccountResourceType || !scopeType || !scopeEntityId\n || ![BillingStateSlice.BILLING_ACCOUNT, BillingStateSlice.SUBSCRIPTION, BillingStateSlice.PRODUCTS, BillingStateSlice.PRICES].every(isSliceAvailable)) {\n throw new Error('Billing plan change context is unavailable.');\n }\n const subscriptionType = scopeType === ResourcePrimaryScope.ORGANIZATIONS ? CoreResourceType.ORGANIZATION_SUBSCRIPTIONS : CoreResourceType.USER_SUBSCRIPTIONS;\n const config = resourceRegistry.registry.resourceConfigurations[subscriptionType];\n const operation = config?.operations.find(candidate => candidate.operationIdentifier === operationIdentifier\n && candidate.variantType === ResourceOperationVariantType.API_CALL && candidate.isOperationDefault);\n if (!operation || operation.variantType !== ResourceOperationVariantType.API_CALL) throw new Error('Billing plan change operation is unavailable.');\n const fields = resourceRegistry.registry.allResourceFieldIdentifiers;\n const scopeResourceType = scopeType === ResourcePrimaryScope.ORGANIZATIONS ? CoreResourceType.ORGANIZATIONS : CoreResourceType.USERS;\n const accountField = fields[billingAccountResourceType];\n const scopeField = fields[scopeResourceType];\n if (!config.resourceFieldIdentifier || !accountField || !scopeField) throw new Error('Billing plan change route context is unavailable.');\n return resourceRegistry.doOperation<TResponse>(ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation), {\n contextualParameters: { [config.resourceFieldIdentifier]: subscription._id, [accountField]: billingAccountId, [scopeField]: scopeEntityId },\n ...(operation.httpVerb === HttpMethod.GET ? { queryParameters: payload } : { requestData: payload }),\n }, { signal, silent: true });\n }, [resourceRegistry, subscription?._id, billingAccountId, billingAccountResourceType, scopeType, scopeEntityId, isSliceAvailable]);\n\n const previewPlanChange = useCallback(async (target: BillingPlanChangeTarget, options?: { signal?: AbortSignal }): Promise<BillingPlanChangePreviewResponse> => {\n const parsed = BillingSubscription_PreviewPlanChangeRequestDto.parse(target);\n const response = await callPlanOperation<BillingPlanChangePreviewResponse>(BillingSubscription_Operations.PREVIEW_PLAN_CHANGE, parsed, options?.signal);\n return BillingSubscription_PlanChangePreviewResponseDto.parse(response);\n }, [callPlanOperation]);\n\n const confirmPlanChange = useCallback(async (confirmation: BillingPlanChangeConfirmation): Promise<void> => {\n const parsed = BillingSubscription_ChangePlanRequestDto.parse(confirmation);\n await callPlanOperation(BillingSubscription_Operations.CHANGE_PLAN, parsed);\n await fetchBillingState();\n }, [callPlanOperation, fetchBillingState]);\n\n const contextValue: BillingContextType = useMemo(\n () => ({\n isEnabled,\n billingConfiguration: billingConfig,\n billingProvider,\n billingAccount,\n subscription,\n currentPlanKey,\n currentPlanProduct,\n currentScope,\n products,\n prices,\n invoices,\n productDefinitions,\n getPricesForProduct,\n getProductByKey,\n activePromotions,\n usage,\n creditPools,\n openCheckout,\n openCustomerPortal,\n previewPlanChange,\n confirmPlanChange,\n isLoading,\n availability,\n isSliceAvailable,\n error,\n refetch: fetchBillingState,\n }),\n [\n isEnabled,\n billingConfig,\n billingProvider,\n billingAccount,\n subscription,\n currentPlanKey,\n currentPlanProduct,\n currentScope,\n products,\n prices,\n invoices,\n productDefinitions,\n getPricesForProduct,\n getProductByKey,\n activePromotions,\n usage,\n creditPools,\n openCheckout,\n openCustomerPortal,\n previewPlanChange,\n confirmPlanChange,\n isLoading,\n availability,\n isSliceAvailable,\n error,\n fetchBillingState,\n ],\n );\n\n return (\n <BillingContext.Provider value={contextValue}>\n {children}\n </BillingContext.Provider>\n );\n}\n\nfunction isBillingFrontendProvider(\n provider: FrontendAppProviderModule | undefined,\n): provider is FrontendAppProviderModule {\n return !!provider\n && provider.providerCapabilities.includes(BUILTIN_PROVIDER_CAPABILITY.BILLING)\n && provider.protocols.includes(BUILTIN_PROVIDER_PROTOCOL.BILLING_PROVIDER);\n}\n"]}
1
+ {"version":3,"file":"BillingContext.js","sourceRoot":"","sources":["../../../../../src/core/billing/BillingContext.tsx"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAc,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAehG,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,+CAA+C,EAC/C,wCAAwC,EACxC,gDAAgD,EAChD,4BAA4B,EAC5B,kCAAkC,EAClC,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACtH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mFAAmF,CAAC;AAC7H,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iEAAiE,CAAC;AAE3G,mCAAmC;AACnC,SAAS;AACT,mCAAmC;AAEnC,MAAM,aAAa,GAA0B,qBAAqB,CAAC,SAAS,EAAE,CAAC;AAC/E,MAAM,QAAQ,GAAiE,aAAa,CAAC,WAAW,CAAC,gBAAgB,CAAC,C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BAAiB;KAC3B,CAAC,EACF;QACE,SAAS;QACT,aAAa;QACb,kBAAkB;QAClB,cAAc;QACd,YAAY;QACZ,cAAc;QACd,kBAAkB;QAClB,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,kBAAkB;QAClB,mBAAmB;QACnB,eAAe;QACf,mBAAmB;QACnB,gBAAgB;QAChB,KAAK;QACL,WAAW;QACX,YAAY;QACZ,kBAAkB;QAClB,iBAAiB;QACjB,iBAAiB;QACjB,uBAAuB;QACvB,SAAS;QACT,YAAY;QACZ,gBAAgB;QAChB,KAAK;QACL,iBAAiB;KAClB,CACF,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACzC,QAAQ,GACe,CAC3B,CAAC;AACJ,CAAC","sourcesContent":["import type { z } from 'zod';\n/**\n * BillingContext\n *\n * Central context for billing operations on the frontend.\n *\n * Responsibilities:\n * - Self-resolves scope (org/user) from AppScope + user context — no external props needed\n * - Fetches billing state via the GET_STATE resource operation on the billing account\n * - The backend auto-creates the billing account if one doesn't exist\n * - Provides actions: openCheckout, openCustomerPortal (via resource operations)\n * - Caches billing state and invalidates on WebSocket events\n * - Exposes convenience accessors for current plan, subscription status, etc.\n *\n * DELEGATION PRINCIPLE: The frontend does NOT build payment UI.\n * - Stripe Checkout (hosted page): for new subscriptions and upgrades\n * - Stripe Customer Portal (hosted page): for invoices, payment methods, cancellation\n */\n\nimport React, { createContext, useEffect, useState, useCallback, useMemo, useRef } from 'react';\nimport type {\n BillingAccount,\n BillingSubscriptionBase,\n Product,\n Price,\n Promotion,\n InvoiceRef,\n UsageSummary,\n BillingConfiguration,\n ProductDefinition,\n BillingStateResponse,\n BillingStateAvailability,\n WS_BillingEventPayload,\n} from '@wildo-ai/saas-models';\nimport {\n BillingAccount_Operations,\n BillingSubscription_Operations,\n BillingSubscription_PreviewPlanChangeRequestDto,\n BillingSubscription_ChangePlanRequestDto,\n BillingSubscription_PlanChangePreviewResponseDto,\n ResourceOperationVariantType,\n ResourcesConfig_OperationPathUtils,\n HttpMethod,\n BillingStateSlice,\n BillingSliceAvailability,\n CoreWebSocketEvent,\n CoreResourceType,\n ResourcePrimaryScope,\n MAIN_API_BASE_PATH,\n userRolesSatisfyRequiredRoles,\n} from '@wildo-ai/saas-models';\nimport { useWebSocket } from '~wildo-frontend-lib/core/requests/websockets/useWebSocket';\nimport { useUserOrgs } from '~wildo-frontend-lib/core/security/useUserOrgs';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication';\nimport { isResourceReachable, useResourceRegistrySafe } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service';\nimport { useEmitLoadingScope } from '~wildo-frontend-lib/core/loading/useEmitLoadingScope';\nimport { ContextLoadingIdentifier } from '~wildo-frontend-lib/core/loading/loading-types.frontend.schemas';\n\n// ================================\n// Logger\n// ================================\n\nconst billingLogger: LoggerFrontendService = LoggerFrontendService.getLogger();\nconst logDebug: (message: string, context?: Record<string, unknown>) => void = billingLogger.debugByType('BillingContext');\nbillingLogger.setDebugTypeLogging('BillingContext', false);\n\n// ================================\n// Constants\n// ================================\n\nconst API_PREFIX = MAIN_API_BASE_PATH;\n\n/** WebSocket events that trigger a refetch of billing state */\nconst INVALIDATION_EVENTS = [\n CoreWebSocketEvent.BILLING_STATUS_CHANGED,\n CoreWebSocketEvent.BILLING_SUBSCRIPTION_UPDATED,\n CoreWebSocketEvent.BILLING_ACCOUNT_CHANGED,\n CoreWebSocketEvent.BILLING_USAGE_UPDATED,\n CoreWebSocketEvent.BILLING_CREDIT_POOL_UPDATED,\n CoreWebSocketEvent.BILLING_FEATURES_UPDATED,\n] as const;\n\n/** Maps ResourcePrimaryScope → billing account variant resource type (for resource operations) */\nconst SCOPE_TO_BILLING_ACCOUNT_RESOURCE: Record<string, string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS,\n [ResourcePrimaryScope.USER_SELF]: CoreResourceType.USER_BILLING_ACCOUNTS,\n};\n\n// The billing-account GET_STATE / OPEN_CHECKOUT / OPEN_PORTAL custom operations\n// borrow COUNT / UPDATE / READ core semantics (see\n// `billing-account.shared.resources-config.schemas.ts`), so their canonical\n// routes follow the framework's scoped resource-operation shape:\n// GET_STATE (COUNT-like) → GET /<scope>/{id}/<res>/get-state/count\n// OPEN_CHECKOUT (UPDATE-like) → PUT /<scope>/{id}/<res>/{accountId}/open-checkout\n// OPEN_PORTAL (READ-like) → GET /<scope>/{id}/<res>/{accountId}/open-portal\n// Built here to mirror the routes the backend registers from the same\n// resources-config; the prior `/operations/open_checkout` POST 404'd.\n\n/** Maps ResourcePrimaryScope → GET_STATE URL builder (COUNT-like → trailing `/count`) */\nconst SCOPE_TO_GET_STATE_URL: Record<string, (scopeEntityId: string) => string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: (id) => `${API_PREFIX}/organizations/${id}/organization-billing-accounts/get-state/count`,\n [ResourcePrimaryScope.USER_SELF]: (id) => `${API_PREFIX}/users/${id}/user-billing-accounts/get-state/count`,\n};\n\n/** Maps ResourcePrimaryScope → OPEN_CHECKOUT URL builder (UPDATE-like → keyed PUT) */\nconst SCOPE_TO_OPEN_CHECKOUT_URL: Record<string, (scopeEntityId: string, billingAccountId: string) => string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: (id, acc) => `${API_PREFIX}/organizations/${id}/organization-billing-accounts/${acc}/open-checkout`,\n [ResourcePrimaryScope.USER_SELF]: (id, acc) => `${API_PREFIX}/users/${id}/user-billing-accounts/${acc}/open-checkout`,\n};\n\n/** Maps ResourcePrimaryScope → OPEN_PORTAL URL builder (READ-like → keyed GET) */\nconst SCOPE_TO_OPEN_PORTAL_URL: Record<string, (scopeEntityId: string, billingAccountId: string) => string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: (id, acc) => `${API_PREFIX}/organizations/${id}/organization-billing-accounts/${acc}/open-portal`,\n [ResourcePrimaryScope.USER_SELF]: (id, acc) => `${API_PREFIX}/users/${id}/user-billing-accounts/${acc}/open-portal`,\n};\n\n// ================================\n// API Response Types\n// ================================\n\n/** Response from PUT /<scope>/{id}/<billing-accounts>/{accountId}/open-checkout (OPEN_CHECKOUT) */\ninterface CheckoutSessionResponse {\n url: string;\n sessionId: string;\n}\n\n/** Response from GET /<scope>/{id}/<billing-accounts>/{accountId}/open-portal (OPEN_PORTAL) */\ninterface PortalSessionResponse {\n url: string;\n}\n\n// ================================\n// Context Type\n// ================================\n\n/**\n * @wildo_source:part:start saas.frontend.billing-context facet:layer:frontend facet:audience:app-developer\n *\n * Everything an application's own frontend reads or does about billing. Reached with `useBilling()`,\n * which throws outside a `BillingProvider`; `useBillingSafe()` returns `undefined` instead, for a\n * component that may render before the provider mounts or in an application where billing is off.\n *\n * The shipped billing components and the feature-gating hooks read this same context, so an\n * application composing its own purchase flow works from exactly what they do — no application code\n * builds the request.\n *\n * ## Starting a purchase\n *\n * `openCheckout(productKey, priceId, options)` posts to the scoped billing-account route and follows\n * the returned URL; success and cancel destinations come from the application's own redirect base. A\n * SECOND call while one is in flight is IGNORED, so a double-click cannot open two sessions — do not\n * add your own guard expecting otherwise, and do not read the silence as a failure.\n *\n * The `priceId` must belong to the product named by `productKey`; the checkout operation refuses a\n * mismatched pair. Resolve it through `getPricesForProduct` rather than assuming an ordering.\n *\n * `openCustomerPortal()` opens the provider's own portal — which is where payment methods, card\n * updates and receipt downloads live. Those are deliberately NOT rendered by the framework, so an\n * application that needs them links the portal rather than building them.\n *\n * ## What `usage` contains\n *\n * Metered consumption appears here only if the application RECORDS it. Nothing is automatic: a\n * metered product with no recorded usage shows an empty dashboard rather than an error.\n *\n * ## Invoices are capped\n *\n * `invoices` carries the fifty most recent, which is what the shipped history component renders. An\n * application needing more reads the invoices resource directly.\n */\nexport type BillingPlanChangeTarget = z.infer<typeof BillingSubscription_PreviewPlanChangeRequestDto>;\nexport type BillingPlanChangeConfirmation = z.infer<typeof BillingSubscription_ChangePlanRequestDto>;\nexport type BillingPlanChangePreviewResponse = z.infer<typeof BillingSubscription_PlanChangePreviewResponseDto>;\n\nexport interface BillingContextType {\n // ── Configuration ──\n isEnabled: boolean;\n billingConfiguration: BillingConfiguration | undefined;\n /**\n * The configured billing provider's REF (`billing.providerRef`), or null when billing is off or\n * names none. Surfaces show the vendor's name from it (`providers.<ref>.displayName`, #1895).\n *\n * It used to be a frontend provider MODULE, resolved from the registry by ref or by the `BILLING`\n * capability. The only such module was Stripe's, which loaded no Stripe code — checkout and the\n * customer portal are hosted redirects — and existed only to carry that name (#1701). The ref is the\n * fact the application configured; a module was a second place that had to agree with it.\n */\n billingProviderRef: string | null;\n\n // ── Billing State ──\n billingAccount: BillingAccount | null;\n subscription: BillingSubscriptionBase | null;\n currentPlanKey: string | null;\n currentPlanProduct: Product | null;\n\n // ── Product Catalog ──\n products: Product[];\n prices: Price[];\n productDefinitions: ProductDefinition[];\n getPricesForProduct: (productId: string) => Price[];\n getProductByKey: (key: string) => Product | undefined;\n /**\n * May this product be bought, or moved onto, right now? Answered from the billing state's\n * `acquirableProductKeys` — the set the backend derives with the SAME predicate its checkout,\n * plan-change and add-on doors enforce — so a surface never re-derives it from `isActive` and can\n * never offer a plan the backend refuses (a retired one, or an announced-but-upcoming one, #1835).\n * Fails closed: a state that did not carry the set answers `false`, because an unknown answer must\n * not offer a checkout.\n */\n isProductAcquirable: (key: string) => boolean;\n\n // ── Scope ──\n currentScope: ResourcePrimaryScope | null;\n\n // ── Invoices ──\n invoices: InvoiceRef[];\n\n // ── Promotions ──\n activePromotions: Promotion[];\n\n // ── Usage & Credits ──\n usage: UsageSummary;\n creditPools: Record<string, { available: number; totalPurchased: number; totalGranted: number; totalConsumed: number }>;\n\n // ── Actions ──\n openCheckout: (productKey: string, priceId: string, options?: {\n quantity?: number;\n promotionCode?: string;\n }) => Promise<void>;\n\n openCustomerPortal: () => Promise<void>;\n /** Provider estimate bound to the current subscription and selected target; never commits a change. */\n previewPlanChange: (target: BillingPlanChangeTarget, options?: { signal?: AbortSignal }) => Promise<BillingPlanChangePreviewResponse>;\n /** Confirm only the server token returned for the displayed preview. Successful mutation refreshes billing state. */\n confirmPlanChange: (confirmation: BillingPlanChangeConfirmation) => Promise<void>;\n /**\n * Withdraw the plan change pending at the end of the period (`subscription.pendingPlanChange`, #1868), so the subscription renews\n * on its current plan. Successful withdrawal refreshes billing state.\n */\n cancelPendingPlanChange: () => Promise<void>;\n\n // ── State ──\n isLoading: boolean;\n error: Error | null;\n /** Only a successful slice read establishes emptiness; failed or absent state is unavailable. */\n availability: BillingStateAvailability | null;\n isSliceAvailable: (slice: BillingStateSlice) => boolean;\n\n // ── Actions ──\n refetch: () => void;\n}\n\n// ── Default empty state ──\nconst EMPTY_USAGE: UsageSummary = {\n byProduct: {},\n};\n\n/** @wildo_source:part:end saas.frontend.billing-context */\n\nexport const BillingContext: React.Context<BillingContextType | undefined> = createContext<BillingContextType | undefined>(undefined);\n\n// ================================\n// Provider\n// ================================\n\nexport interface BillingProviderProps {\n children: React.ReactNode;\n productDefinitions?: ProductDefinition[];\n}\n\nexport function BillingProvider({ children, productDefinitions: injectedProductDefinitions }: BillingProviderProps): React.ReactElement {\n // ── Self-resolve configuration from hooks ──\n const userOrgs = useUserOrgs();\n const appScope = useAppScopeSafe();\n const { appConfig } = useApplication();\n const resourceRegistry = useResourceRegistrySafe();\n const billingConfig = appConfig.billing;\n /** What the application CONFIGURED — see `isEnabled` below for why that is only half the answer. */\n const isConfiguredEnabled = billingConfig?.enabled ?? false;\n const billingProviderRef = isConfiguredEnabled ? billingConfig?.providerRef ?? null : null;\n\n // ── Self-resolve scope ──\n const enabledScopes = billingConfig?.enabledScopes ?? [ResourcePrimaryScope.ORGANIZATIONS];\n\n const { scopeType, scopeEntityId } = useMemo(() => {\n if (enabledScopes.includes(ResourcePrimaryScope.ORGANIZATIONS) && appScope?.currentOrganizationId) {\n return { scopeType: ResourcePrimaryScope.ORGANIZATIONS as ResourcePrimaryScope, scopeEntityId: appScope.currentOrganizationId };\n }\n if (enabledScopes.includes(ResourcePrimaryScope.USER_SELF) && userOrgs.user?._id) {\n return { scopeType: ResourcePrimaryScope.USER_SELF as ResourcePrimaryScope, scopeEntityId: userOrgs.user._id };\n }\n return { scopeType: null as ResourcePrimaryScope | null, scopeEntityId: null as string | null };\n }, [enabledScopes, appScope?.currentOrganizationId, userOrgs.user?._id]);\n\n // ── Derive variant resource type for operations ──\n const billingAccountResourceType = scopeType ? SCOPE_TO_BILLING_ACCOUNT_RESOURCE[scopeType] : null;\n\n /**\n * Enabled means CONFIGURED **and** REACHABLE — the config flag alone was not enough.\n *\n * Every request this provider makes is an operation on a billing-account resource, so a consumer\n * whose registry does not carry that resource cannot serve one no matter what the config says.\n * That is not hypothetical: the application-creation workbench excludes the whole tenant\n * vocabulary from its registry (it observes an application's creation and is not that\n * application's admin console) while rendering the OBSERVED application's config, which has\n * billing enabled — so it fired `organization-billing-accounts/get-state/count` at its own origin\n * on every page load, where the companion serves no billing routes, and answered 404 every time\n * (issue #268, reproduced live).\n *\n * Reading the registry rather than adding a second opt-out keeps the two halves from disagreeing:\n * a consumer that excludes the resource has already said billing is not part of its surface, and\n * saying it twice is how the two copies drift. A tenant application carries the resource and is\n * unaffected.\n */\n const isEnabled = isConfiguredEnabled\n && billingAccountResourceType !== null\n // The absent-registry-is-ignorance rule lives on the seam (`isResourceReachable`), shared with the\n // features, guidance and analytics providers since #1069 so the four cannot drift.\n && isResourceReachable(resourceRegistry, billingAccountResourceType);\n\n /**\n * Whether THIS CALLER may read the billing state served for this scope — kept separate from `isEnabled`, on purpose.\n *\n * `isEnabled` says billing is PART OF the application. Every consumer of it — feature availability, operation\n * gating, the launcher — needs that answer for every user alike, so it must not vary with who is looking.\n *\n * Fetching is a different question. `GET_STATE` is role-gated per scope (organization owners and administrators on\n * the organization variant), and a plain member used to request it on every page load, be refused with 403, and\n * see an access-denied message on a page with nothing wrong with it (#1039). That member already ended with a null\n * billing state — the refusal produced it — so not asking changes nothing they can see except the message.\n *\n * The required roles are read from the registry's OWN operation, never copied, and decided by the same\n * hierarchy-aware check the action bar uses. That check fails open on a role it cannot resolve, so a custom role\n * inheriting an administrator role is not locked out here — the server stays the authority either way. With no\n * registry, or no such operation in it, there is no evidence to withhold on, and the request goes out as before.\n */\n const permissions = userOrgs.permissions;\n const currentOrganizationId = appScope?.currentOrganizationId ?? null;\n const mayReadBillingState = useMemo((): boolean => {\n if (!isEnabled || !billingAccountResourceType) return false;\n const getStateOperation = resourceRegistry?.registry.resourceConfigurations[billingAccountResourceType]\n ?.operations.find((operation) =>\n String(operation.operationIdentifier) === BillingAccount_Operations.GET_STATE && operation.isOperationDefault === true);\n if (!getStateOperation) return true;\n return userRolesSatisfyRequiredRoles({\n requiredRoles: getStateOperation.roles,\n userAppRoles: permissions?.appLevel ?? [],\n userOrgRoles: currentOrganizationId ? permissions?.organizations?.[currentOrganizationId] ?? [] : [],\n });\n }, [isEnabled, billingAccountResourceType, resourceRegistry, permissions, currentOrganizationId]);\n\n // ── State ──\n const [billingState, setBillingState] = useState<BillingStateResponse | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(mayReadBillingState && !!scopeEntityId);\n const [error, setError] = useState<Error | null>(null);\n\n // L-2.b: mirror local loading state onto the LoadingContext event bus so\n // unrelated components can observe billing-state lifecycle via\n // `useComponentLoading({ customIdentifier: ContextLoadingIdentifier.BILLING_STATE })`\n // or `<LoadingGate scopes={[buildContextLoadingScope(BILLING_STATE)]}>`.\n // Local `isLoading` is still exposed for direct consumers (back-compat).\n useEmitLoadingScope({\n identifier: ContextLoadingIdentifier.BILLING_STATE,\n isLoading,\n hasLoadedOnce: billingState !== null,\n });\n\n // ── Refs for stable callbacks ──\n const fetchInFlightRef = useRef<boolean>(false);\n const mountedRef = useRef<boolean>(true);\n const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const checkoutInFlightRef = useRef<boolean>(false);\n\n // ── WebSocket ──\n const { on } = useWebSocket();\n\n // ── Resolve redirect base URL ──\n const resolvedRedirectBase = useMemo(\n () => typeof window !== 'undefined' ? window.location.origin : '',\n [],\n );\n\n // ── billingAccountId from response ──\n const billingAccountId = billingState?.billingAccount?._id ?? null;\n\n // ── Clear stale state on scope change ──\n useEffect(() => {\n setBillingState(null);\n setError(null);\n setIsLoading(mayReadBillingState && !!scopeEntityId);\n }, [scopeType, scopeEntityId, mayReadBillingState]);\n\n // ── Fetch billing state from backend ──\n const fetchBillingState = useCallback(async () => {\n if (!mayReadBillingState || !scopeType || !scopeEntityId) return;\n if (fetchInFlightRef.current) return;\n fetchInFlightRef.current = true;\n\n try {\n logDebug('Fetching billing state', { scopeType, scopeEntityId });\n const httpClient = getManualCallsHttpClient();\n\n const urlBuilder = SCOPE_TO_GET_STATE_URL[scopeType];\n if (!urlBuilder) return;\n const url = urlBuilder(scopeEntityId);\n const response = await httpClient.get<BillingStateResponse>(url);\n\n if (mountedRef.current) {\n setBillingState(response);\n setError(null);\n\n logDebug('Billing state fetched', {\n hasAccount: !!response.billingAccount,\n hasSubscription: !!response.subscription,\n productCount: response.products?.length ?? 0,\n priceCount: response.prices?.length ?? 0,\n billingAccountId: response.billingAccount?._id,\n });\n }\n } catch (err: unknown) {\n if (mountedRef.current) {\n const message = err instanceof Error ? err.message : 'Failed to fetch billing state';\n setBillingState(null);\n setError(err instanceof Error ? err : new Error(message));\n logDebug('Failed to fetch billing state', { error: message });\n }\n } finally {\n if (mountedRef.current) {\n setIsLoading(false);\n }\n fetchInFlightRef.current = false;\n }\n }, [mayReadBillingState, scopeType, scopeEntityId]);\n\n // ── Initial fetch ──\n useEffect(() => {\n mountedRef.current = true;\n if (mayReadBillingState && scopeType && scopeEntityId) {\n fetchBillingState();\n } else {\n setIsLoading(false);\n }\n return () => {\n mountedRef.current = false;\n };\n }, [fetchBillingState, mayReadBillingState, scopeType, scopeEntityId]);\n\n // ── WebSocket invalidation (debounced) ──\n useEffect(() => {\n if (!mayReadBillingState) return;\n\n const unsubscribers: Array<() => void> = [];\n\n const debouncedRefetch = () => {\n if (debounceTimerRef.current) {\n clearTimeout(debounceTimerRef.current);\n }\n debounceTimerRef.current = setTimeout(() => {\n debounceTimerRef.current = null;\n fetchBillingState();\n }, 300);\n };\n\n for (const event of INVALIDATION_EVENTS) {\n const unsub = on<WS_BillingEventPayload>(event, (payload) => {\n if (!scopeType || !scopeEntityId) {\n logDebug('Ignoring billing invalidation without active scope', { event, payload });\n return;\n }\n\n if (payload.scopeType !== scopeType || payload.scopeEntityId !== scopeEntityId) {\n logDebug('Ignoring billing invalidation for another scope', {\n event,\n payload,\n currentScopeType: scopeType,\n currentScopeEntityId: scopeEntityId,\n });\n return;\n }\n\n if (billingAccountId && payload.billingAccountId !== billingAccountId) {\n logDebug('Ignoring billing invalidation for another billing account', {\n event,\n payload,\n currentBillingAccountId: billingAccountId,\n });\n return;\n }\n\n logDebug('WebSocket invalidation event received, scheduling refetch', { event, payload });\n debouncedRefetch();\n });\n unsubscribers.push(unsub);\n }\n\n return () => {\n if (debounceTimerRef.current) {\n clearTimeout(debounceTimerRef.current);\n }\n for (const unsub of unsubscribers) {\n unsub();\n }\n };\n }, [on, fetchBillingState, mayReadBillingState, scopeType, scopeEntityId, billingAccountId]);\n\n // ── Derived state ──\n const availability = billingState?.availability ?? null;\n const isSliceAvailable = useCallback((slice: BillingStateSlice) => availability?.[slice] === BillingSliceAvailability.AVAILABLE, [availability]);\n\n const billingAccount = billingState?.billingAccount ?? null;\n const subscription = billingState?.subscription ?? null;\n const products = billingState?.products ?? [];\n const prices = billingState?.prices ?? [];\n const invoices = billingState?.invoices ?? [];\n const usage = billingState?.usage ?? EMPTY_USAGE;\n const creditPools = billingState?.creditPools ?? {};\n const activePromotions = billingState?.activePromotions ?? [];\n const acquirableProductKeys = billingState?.acquirableProductKeys;\n const currentScope = scopeType ?? null;\n\n // ── Product catalog lookups ──\n const productsByKey = useMemo(() => {\n const map = new Map<string, Product>();\n for (const p of products) {\n map.set(p.key, p);\n }\n return map;\n }, [products]);\n\n const pricesByProductId = useMemo(() => {\n const map = new Map<string, Price[]>();\n for (const price of prices) {\n const existing = map.get(price.productId) ?? [];\n existing.push(price);\n map.set(price.productId, existing);\n }\n return map;\n }, [prices]);\n\n const getPricesForProduct = useCallback(\n (productId: string): Price[] => pricesByProductId.get(productId) ?? [],\n [pricesByProductId],\n );\n\n const getProductByKey = useCallback(\n (key: string): Product | undefined => productsByKey.get(key),\n [productsByKey],\n );\n\n const acquirableProductKeySet = useMemo(() => new Set(acquirableProductKeys ?? []), [acquirableProductKeys]);\n const isProductAcquirable = useCallback((key: string): boolean => acquirableProductKeySet.has(key), [acquirableProductKeySet]);\n\n // ── Current plan derivation ──\n const { currentPlanKey, currentPlanProduct } = useMemo(() => {\n if (!subscription || !subscription.items?.length) {\n return { currentPlanKey: null, currentPlanProduct: null };\n }\n for (const item of subscription.items) {\n const product = products.find(p => p._id === item.productId);\n if (product && product.type === 'plan') {\n return { currentPlanKey: product.key, currentPlanProduct: product };\n }\n }\n return { currentPlanKey: null, currentPlanProduct: null };\n }, [subscription, products]);\n\n const productDefinitions = useMemo<ProductDefinition[]>(\n () => injectedProductDefinitions ?? [],\n [injectedProductDefinitions],\n );\n\n // ── Actions ──\n const openCheckout = useCallback(\n async (productKey: string, priceId: string, options?: {\n quantity?: number;\n promotionCode?: string;\n }): Promise<void> => {\n if (!billingAccountId || !billingAccountResourceType || !scopeType || !scopeEntityId) {\n throw new Error('No billing account available. Cannot open checkout.');\n }\n const checkoutUrl = SCOPE_TO_OPEN_CHECKOUT_URL[scopeType]?.(scopeEntityId, billingAccountId);\n if (!checkoutUrl) {\n throw new Error(`No OPEN_CHECKOUT URL builder for scope ${scopeType}.`);\n }\n if (checkoutInFlightRef.current) {\n logDebug('Checkout already in progress, ignoring duplicate request');\n return;\n }\n\n checkoutInFlightRef.current = true;\n try {\n logDebug('Opening checkout session', { productKey, priceId, ...options });\n const httpClient = getManualCallsHttpClient();\n\n // OPEN_CHECKOUT borrows UPDATE → keyed PUT on the scoped account route.\n const response = await httpClient.put<CheckoutSessionResponse>(\n checkoutUrl,\n {\n productKey,\n priceId,\n successUrl: `${resolvedRedirectBase}/billing/success?session_id={CHECKOUT_SESSION_ID}`,\n cancelUrl: `${resolvedRedirectBase}/billing/cancel`,\n quantity: options?.quantity,\n promotionCode: options?.promotionCode,\n },\n );\n\n if (response.url) {\n window.location.href = response.url;\n }\n } finally {\n checkoutInFlightRef.current = false;\n }\n },\n [billingAccountId, billingAccountResourceType, scopeType, scopeEntityId, resolvedRedirectBase],\n );\n\n const openCustomerPortal = useCallback(async (): Promise<void> => {\n if (!billingAccountId || !billingAccountResourceType || !scopeType || !scopeEntityId) {\n throw new Error('No billing account available. Cannot open customer portal.');\n }\n const portalUrlBase = SCOPE_TO_OPEN_PORTAL_URL[scopeType]?.(scopeEntityId, billingAccountId);\n if (!portalUrlBase) {\n throw new Error(`No OPEN_PORTAL URL builder for scope ${scopeType}.`);\n }\n\n logDebug('Opening customer portal session');\n const httpClient = getManualCallsHttpClient();\n\n // OPEN_PORTAL borrows READ → keyed GET on the scoped account route; the\n // returnUrl travels as a query param since GET carries no request body.\n const returnUrl = encodeURIComponent(`${resolvedRedirectBase}/billing`);\n const response = await httpClient.get<PortalSessionResponse>(\n `${portalUrlBase}?returnUrl=${returnUrl}`,\n );\n\n if (response.url) {\n window.location.href = response.url;\n }\n }, [billingAccountId, billingAccountResourceType, scopeType, scopeEntityId, resolvedRedirectBase]);\n\n // ── Context value (memoized for stable reference) ──\n // Use the registry's compiled operation paths and parameter vocabulary. Subscription routes have\n // account and scope parents; hand-authored URLs would silently diverge between org and user variants.\n const callPlanOperation = useCallback(async <TResponse,>(\n operationIdentifier: BillingSubscription_Operations,\n payload: BillingPlanChangeTarget | BillingPlanChangeConfirmation | Record<string, never>,\n signal?: AbortSignal,\n ): Promise<TResponse> => {\n if (!resourceRegistry || !subscription?._id || !billingAccountId || !billingAccountResourceType || !scopeType || !scopeEntityId\n || ![BillingStateSlice.BILLING_ACCOUNT, BillingStateSlice.SUBSCRIPTION, BillingStateSlice.PRODUCTS, BillingStateSlice.PRICES].every(isSliceAvailable)) {\n throw new Error('Billing plan change context is unavailable.');\n }\n const subscriptionType = scopeType === ResourcePrimaryScope.ORGANIZATIONS ? CoreResourceType.ORGANIZATION_SUBSCRIPTIONS : CoreResourceType.USER_SUBSCRIPTIONS;\n const config = resourceRegistry.registry.resourceConfigurations[subscriptionType];\n const operation = config?.operations.find(candidate => candidate.operationIdentifier === operationIdentifier\n && candidate.variantType === ResourceOperationVariantType.API_CALL && candidate.isOperationDefault);\n if (!operation || operation.variantType !== ResourceOperationVariantType.API_CALL) throw new Error('Billing plan change operation is unavailable.');\n const fields = resourceRegistry.registry.allResourceFieldIdentifiers;\n const scopeResourceType = scopeType === ResourcePrimaryScope.ORGANIZATIONS ? CoreResourceType.ORGANIZATIONS : CoreResourceType.USERS;\n const accountField = fields[billingAccountResourceType];\n const scopeField = fields[scopeResourceType];\n if (!config.resourceFieldIdentifier || !accountField || !scopeField) throw new Error('Billing plan change route context is unavailable.');\n return resourceRegistry.doOperation<TResponse>(ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation), {\n contextualParameters: { [config.resourceFieldIdentifier]: subscription._id, [accountField]: billingAccountId, [scopeField]: scopeEntityId },\n ...(operation.httpVerb === HttpMethod.GET ? { queryParameters: payload } : { requestData: payload }),\n }, { signal, silent: true });\n }, [resourceRegistry, subscription?._id, billingAccountId, billingAccountResourceType, scopeType, scopeEntityId, isSliceAvailable]);\n\n const previewPlanChange = useCallback(async (target: BillingPlanChangeTarget, options?: { signal?: AbortSignal }): Promise<BillingPlanChangePreviewResponse> => {\n const parsed = BillingSubscription_PreviewPlanChangeRequestDto.parse(target);\n const response = await callPlanOperation<BillingPlanChangePreviewResponse>(BillingSubscription_Operations.PREVIEW_PLAN_CHANGE, parsed, options?.signal);\n return BillingSubscription_PlanChangePreviewResponseDto.parse(response);\n }, [callPlanOperation]);\n\n const confirmPlanChange = useCallback(async (confirmation: BillingPlanChangeConfirmation): Promise<void> => {\n const parsed = BillingSubscription_ChangePlanRequestDto.parse(confirmation);\n await callPlanOperation(BillingSubscription_Operations.CHANGE_PLAN, parsed);\n await fetchBillingState();\n }, [callPlanOperation, fetchBillingState]);\n\n const cancelPendingPlanChange = useCallback(async (): Promise<void> => {\n await callPlanOperation(BillingSubscription_Operations.CANCEL_PLAN_CHANGE, {});\n await fetchBillingState();\n }, [callPlanOperation, fetchBillingState]);\n\n const contextValue: BillingContextType = useMemo(\n () => ({\n isEnabled,\n billingConfiguration: billingConfig,\n billingProviderRef,\n billingAccount,\n subscription,\n currentPlanKey,\n currentPlanProduct,\n currentScope,\n products,\n prices,\n invoices,\n productDefinitions,\n getPricesForProduct,\n getProductByKey,\n isProductAcquirable,\n activePromotions,\n usage,\n creditPools,\n openCheckout,\n openCustomerPortal,\n previewPlanChange,\n confirmPlanChange,\n cancelPendingPlanChange,\n isLoading,\n availability,\n isSliceAvailable,\n error,\n refetch: fetchBillingState,\n }),\n [\n isEnabled,\n billingConfig,\n billingProviderRef,\n billingAccount,\n subscription,\n currentPlanKey,\n currentPlanProduct,\n currentScope,\n products,\n prices,\n invoices,\n productDefinitions,\n getPricesForProduct,\n getProductByKey,\n isProductAcquirable,\n activePromotions,\n usage,\n creditPools,\n openCheckout,\n openCustomerPortal,\n previewPlanChange,\n confirmPlanChange,\n cancelPendingPlanChange,\n isLoading,\n availability,\n isSliceAvailable,\n error,\n fetchBillingState,\n ],\n );\n\n return (\n <BillingContext.Provider value={contextValue}>\n {children}\n </BillingContext.Provider>\n );\n}\n"]}
@@ -1,7 +1,15 @@
1
- import type { FrontendAppProviderModule } from '@wildo-ai/external-connectors-public/app';
2
- export declare function collectBillingProviderLabelKeys(provider: FrontendAppProviderModule | null | undefined): string[];
1
+ /**
2
+ * The billing provider's name, for the three billing components that show it (portal link, invoice
3
+ * history, subscription status).
4
+ *
5
+ * Keyed on the configured `billing.providerRef` and nothing else (#1701). The name is
6
+ * `providers.<ref>.displayName`, planned and generated for every declared provider (#1895). It used to
7
+ * be read off a frontend provider module — Stripe's, which loaded no Stripe code and existed only to
8
+ * carry it — so billing's visible name depended on declaring a browser module that did nothing.
9
+ */
10
+ export declare function collectBillingProviderLabelKeys(providerRef: string | null | undefined): string[];
3
11
  export declare function resolveBillingProviderDisplayName(input: {
4
- provider: FrontendAppProviderModule | null | undefined;
12
+ providerRef: string | null | undefined;
5
13
  translate?: (key: string) => string;
6
14
  }): string | undefined;
7
15
  //# sourceMappingURL=billing-provider-display.frontend.utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing-provider-display.frontend.utils.d.ts","sourceRoot":"","sources":["../../../../../src/core/billing/billing-provider-display.frontend.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAM1F,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,yBAAyB,GAAG,IAAI,GAAG,SAAS,GACrD,MAAM,EAAE,CAIV;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,QAAQ,EAAE,yBAAyB,GAAG,IAAI,GAAG,SAAS,CAAC;IACvD,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC,GAAG,MAAM,GAAG,SAAS,CAWrB"}
1
+ {"version":3,"file":"billing-provider-display.frontend.utils.d.ts","sourceRoot":"","sources":["../../../../../src/core/billing/billing-provider-display.frontend.utils.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAEhG;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC,GAAG,MAAM,GAAG,SAAS,CASrB"}
@@ -1,17 +1,23 @@
1
+ import { buildProviderDisplayNameLabelKey } from '@wildo-ai/saas-models/public-runtime';
1
2
  import { collectFrontendProviderDisplayLabelKeys, resolveFrontendProviderDisplayLabel, } from '../../core/external-providers/frontend-provider-display-label.frontend.utils.js';
2
- export function collectBillingProviderLabelKeys(provider) {
3
- return collectFrontendProviderDisplayLabelKeys([
4
- provider?.metadata.displayNameLabelKey,
5
- ]);
3
+ /**
4
+ * The billing provider's name, for the three billing components that show it (portal link, invoice
5
+ * history, subscription status).
6
+ *
7
+ * Keyed on the configured `billing.providerRef` and nothing else (#1701). The name is
8
+ * `providers.<ref>.displayName`, planned and generated for every declared provider (#1895). It used to
9
+ * be read off a frontend provider module — Stripe's, which loaded no Stripe code and existed only to
10
+ * carry it — so billing's visible name depended on declaring a browser module that did nothing.
11
+ */
12
+ export function collectBillingProviderLabelKeys(providerRef) {
13
+ return collectFrontendProviderDisplayLabelKeys([providerRef ? buildProviderDisplayNameLabelKey(providerRef) : undefined]);
6
14
  }
7
15
  export function resolveBillingProviderDisplayName(input) {
8
- if (!input.provider) {
16
+ if (!input.providerRef) {
9
17
  return undefined;
10
18
  }
11
19
  return resolveFrontendProviderDisplayLabel({
12
- providerRef: input.provider.metadata.ref,
13
- displayName: input.provider.metadata.displayName,
14
- displayNameLabelKey: input.provider.metadata.displayNameLabelKey,
20
+ providerRef: input.providerRef,
15
21
  translate: input.translate,
16
22
  });
17
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"billing-provider-display.frontend.utils.js","sourceRoot":"","sources":["../../../../../src/core/billing/billing-provider-display.frontend.utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uCAAuC,EACvC,mCAAmC,GACpC,MAAM,4FAA4F,CAAC;AAEpG,MAAM,UAAU,+BAA+B,CAC7C,QAAsD;IAEtD,OAAO,uCAAuC,CAAC;QAC7C,QAAQ,EAAE,QAAQ,CAAC,mBAAmB;KACvC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,KAGjD;IACC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,mCAAmC,CAAC;QACzC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG;QACxC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW;QAChD,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,mBAAmB;QAChE,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { FrontendAppProviderModule } from '@wildo-ai/external-connectors-public/app';\nimport {\n collectFrontendProviderDisplayLabelKeys,\n resolveFrontendProviderDisplayLabel,\n} from '~wildo-frontend-lib/core/external-providers/frontend-provider-display-label.frontend.utils';\n\nexport function collectBillingProviderLabelKeys(\n provider: FrontendAppProviderModule | null | undefined,\n): string[] {\n return collectFrontendProviderDisplayLabelKeys([\n provider?.metadata.displayNameLabelKey,\n ]);\n}\n\nexport function resolveBillingProviderDisplayName(input: {\n provider: FrontendAppProviderModule | null | undefined;\n translate?: (key: string) => string;\n}): string | undefined {\n if (!input.provider) {\n return undefined;\n }\n\n return resolveFrontendProviderDisplayLabel({\n providerRef: input.provider.metadata.ref,\n displayName: input.provider.metadata.displayName,\n displayNameLabelKey: input.provider.metadata.displayNameLabelKey,\n translate: input.translate,\n });\n}\n"]}
1
+ {"version":3,"file":"billing-provider-display.frontend.utils.js","sourceRoot":"","sources":["../../../../../src/core/billing/billing-provider-display.frontend.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EACL,uCAAuC,EACvC,mCAAmC,GACpC,MAAM,4FAA4F,CAAC;AAEpG;;;;;;;;GAQG;AACH,MAAM,UAAU,+BAA+B,CAAC,WAAsC;IACpF,OAAO,uCAAuC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gCAAgC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5H,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,KAGjD;IACC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,mCAAmC,CAAC;QACzC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { buildProviderDisplayNameLabelKey } from '@wildo-ai/saas-models/public-runtime';\nimport {\n collectFrontendProviderDisplayLabelKeys,\n resolveFrontendProviderDisplayLabel,\n} from '~wildo-frontend-lib/core/external-providers/frontend-provider-display-label.frontend.utils';\n\n/**\n * The billing provider's name, for the three billing components that show it (portal link, invoice\n * history, subscription status).\n *\n * Keyed on the configured `billing.providerRef` and nothing else (#1701). The name is\n * `providers.<ref>.displayName`, planned and generated for every declared provider (#1895). It used to\n * be read off a frontend provider module — Stripe's, which loaded no Stripe code and existed only to\n * carry it — so billing's visible name depended on declaring a browser module that did nothing.\n */\nexport function collectBillingProviderLabelKeys(providerRef: string | null | undefined): string[] {\n return collectFrontendProviderDisplayLabelKeys([providerRef ? buildProviderDisplayNameLabelKey(providerRef) : undefined]);\n}\n\nexport function resolveBillingProviderDisplayName(input: {\n providerRef: string | null | undefined;\n translate?: (key: string) => string;\n}): string | undefined {\n if (!input.providerRef) {\n return undefined;\n }\n\n return resolveFrontendProviderDisplayLabel({\n providerRef: input.providerRef,\n translate: input.translate,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useBillingPlanChange.d.ts","sourceRoot":"","sources":["../../../../../src/core/billing/useBillingPlanChange.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAEtH,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,KAAK,SAAS,GAAG;IAAE,MAAM,EAAE,uBAAuB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAC9B;IAAE,KAAK,EAAE,sBAAsB,CAAC,IAAI,CAAA;CAAE,GACtC,CAAC,SAAS,GAAG;IAAE,KAAK,EAAE,sBAAsB,CAAC,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAA;CAAE,CAAC,GAC1F,CAAC,SAAS,GAAG;IAAE,KAAK,EAAE,sBAAsB,CAAC,KAAK,GAAG,sBAAsB,CAAC,UAAU,CAAC;IAAC,QAAQ,EAAE,gCAAgC,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEvL,sGAAsG;AACtG,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gCAAgC,GAAG,cAAc,CAYnG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS;;qBAgChC,uBAAuB;;;EA4ClE"}
1
+ {"version":3,"file":"useBillingPlanChange.d.ts","sourceRoot":"","sources":["../../../../../src/core/billing/useBillingPlanChange.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAEtH,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,KAAK,SAAS,GAAG;IAAE,MAAM,EAAE,uBAAuB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAC9B;IAAE,KAAK,EAAE,sBAAsB,CAAC,IAAI,CAAA;CAAE,GACtC,CAAC,SAAS,GAAG;IAAE,KAAK,EAAE,sBAAsB,CAAC,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAA;CAAE,CAAC,GAC1F,CAAC,SAAS,GAAG;IAAE,KAAK,EAAE,sBAAsB,CAAC,KAAK,GAAG,sBAAsB,CAAC,UAAU,CAAC;IAAC,QAAQ,EAAE,gCAAgC,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEvL,sGAAsG;AACtG,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gCAAgC,GAAG,cAAc,CAcnG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS;;qBAgChC,uBAAuB;;;EA4ClE"}
@@ -21,6 +21,8 @@ export function invoicePreviewForDisplay(response) {
21
21
  lineItems: response.lineItems.map(item => ({ ...item, amount: { amount: BigInt(item.amount), currency, decimals } })),
22
22
  periodStart: response.periodStart,
23
23
  periodEnd: response.periodEnd,
24
+ timing: response.timing,
25
+ effectiveAt: new Date(response.effectiveAt),
24
26
  };
25
27
  }
26
28
  /** Owns the composed selection flow. A server token is only usable with its original selection.
@@ -1 +1 @@
1
- {"version":3,"file":"useBillingPlanChange.js","sourceRoot":"","sources":["../../../../../src/core/billing/useBillingPlanChange.ts"],"names":[],"mappings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I,OAAO,CAAC,KAAK,KAAK,sBAAsB,CAAC,KAAK,IAAI,OAAO,CAAC,aAAa,KAAK,eAAe,CAAC,OAAO;YAAE,OAAO;QAC5J,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC;QAC7C,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,sBAAsB,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QACpF,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,iBAAiB,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;YACpG,IAAI,UAAU,CAAC,OAAO,KAAK,iBAAiB;gBAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,sBAAsB,CAAC,IAAI,EAAE,CAAC,CAAC;QACjG,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,UAAU,CAAC,OAAO,KAAK,iBAAiB;gBAAE,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9H,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,OAAO,GAAG,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAErB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC5C,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { currencyMinorUnitDecimals } from '@wildo-ai/zod-decorators';\nimport { BillingStateSlice, type InvoicePreview } from '@wildo-ai/saas-models';\nimport type { BillingContextType, BillingPlanChangeTarget, BillingPlanChangePreviewResponse } from './BillingContext';\n\nexport enum BillingPlanChangePhase {\n IDLE = 'idle',\n PREVIEWING = 'previewing',\n READY = 'ready',\n CONFIRMING = 'confirming',\n FAILED = 'failed',\n}\n\ntype Selection = { target: BillingPlanChangeTarget; scopeIdentity: string };\nexport type BillingPlanChangeState =\n | { phase: BillingPlanChangePhase.IDLE }\n | (Selection & { phase: BillingPlanChangePhase.PREVIEWING | BillingPlanChangePhase.FAILED })\n | (Selection & { phase: BillingPlanChangePhase.READY | BillingPlanChangePhase.CONFIRMING; response: BillingPlanChangePreviewResponse; preview: InvoicePreview; hasError?: boolean });\n\n/** A provider amount uses the currency's own minor units, not an authored price's arbitrary scale. */\nexport function invoicePreviewForDisplay(response: BillingPlanChangePreviewResponse): InvoicePreview {\n const currency = response.currency.toUpperCase();\n const decimals = currencyMinorUnitDecimals(currency);\n if (decimals === undefined || !Number.isSafeInteger(response.amount) || response.lineItems.some(item => !Number.isSafeInteger(item.amount))) {\n throw new Error('The invoice estimate contains unsupported monetary values.');\n }\n return {\n amount: { amount: BigInt(response.amount), currency, decimals },\n lineItems: response.lineItems.map(item => ({ ...item, amount: { amount: BigInt(item.amount), currency, decimals } })),\n periodStart: response.periodStart,\n periodEnd: response.periodEnd,\n };\n}\n\n/** Owns the composed selection flow. A server token is only usable with its original selection.\n * Request generation fences late responses; cancellation aborts only a preview, never an accepted mutation.\n * A failed confirmation retains its token for the server's idempotent retry path.\n */\nexport function useBillingPlanChange(billing: BillingContextType | undefined) {\n const [state, setState] = useState<BillingPlanChangeState>({ phase: BillingPlanChangePhase.IDLE });\n const generation = useRef(0);\n const pendingPreview = useRef<AbortController | null>(null);\n const confirming = useRef(false);\n const stateRef = useRef(state);\n stateRef.current = state;\n const scopeIdentity = JSON.stringify([billing?.currentScope, billing?.billingAccount?._id, billing?.subscription?._id]);\n const currentIdentity = useRef(scopeIdentity);\n currentIdentity.current = scopeIdentity;\n const ready = !!billing?.isEnabled && [BillingStateSlice.BILLING_ACCOUNT, BillingStateSlice.SUBSCRIPTION, BillingStateSlice.PRODUCTS, BillingStateSlice.PRICES].every(billing.isSliceAvailable);\n\n useEffect(() => {\n generation.current += 1;\n pendingPreview.current?.abort();\n setState({ phase: BillingPlanChangePhase.IDLE });\n return () => { generation.current += 1; pendingPreview.current?.abort(); };\n }, [scopeIdentity]);\n\n // A same-scope refresh cannot revoke an already submitted confirmation or its retry token.\n // Availability controls whether another dispatch is allowed; it is not evidence that the\n // provider did not accept the first one. The server validates the quote's semantic basis.\n useEffect(() => {\n const current = stateRef.current;\n if (confirming.current || (current.phase === BillingPlanChangePhase.READY && current.hasError)) return;\n if (!ready) {\n generation.current += 1;\n pendingPreview.current?.abort();\n setState({ phase: BillingPlanChangePhase.IDLE });\n }\n }, [ready]);\n\n const select = useCallback(async (target: BillingPlanChangeTarget) => {\n if (!billing || !ready || !billing.subscription || confirming.current) return;\n const requestGeneration = ++generation.current;\n pendingPreview.current?.abort();\n const controller = new AbortController();\n pendingPreview.current = controller;\n const selection = { target, scopeIdentity };\n setState({ ...selection, phase: BillingPlanChangePhase.PREVIEWING });\n try {\n const response = await billing.previewPlanChange(target, { signal: controller.signal });\n const preview = invoicePreviewForDisplay(response);\n if (!response.previewToken) throw new Error('The invoice estimate has no confirmation binding.');\n if (generation.current !== requestGeneration || currentIdentity.current !== scopeIdentity) return;\n setState({ ...selection, phase: BillingPlanChangePhase.READY, response, preview });\n } catch {\n if (generation.current !== requestGeneration || controller.signal.aborted) return;\n setState({ ...selection, phase: BillingPlanChangePhase.FAILED });\n }\n }, [billing, ready, scopeIdentity]);\n\n const cancel = useCallback(() => {\n if (confirming.current) return;\n generation.current += 1;\n pendingPreview.current?.abort();\n setState({ phase: BillingPlanChangePhase.IDLE });\n }, []);\n\n const confirm = useCallback(async () => {\n const current = stateRef.current;\n if (!billing || !ready || confirming.current || current.phase !== BillingPlanChangePhase.READY || current.scopeIdentity !== currentIdentity.current) return;\n confirming.current = true;\n const requestGeneration = generation.current;\n setState({ ...current, phase: BillingPlanChangePhase.CONFIRMING, hasError: false });\n try {\n await billing.confirmPlanChange({ ...current.target, previewToken: current.response.previewToken });\n if (generation.current === requestGeneration) setState({ phase: BillingPlanChangePhase.IDLE });\n } catch {\n if (generation.current === requestGeneration) setState({ ...current, phase: BillingPlanChangePhase.READY, hasError: true });\n } finally {\n confirming.current = false;\n }\n }, [billing, ready]);\n\n return { state, select, cancel, confirm };\n}\n"]}
1
+ {"version":3,"file":"useBillingPlanChange.js","sourceRoot":"","sources":["../../../../../src/core/billing/useBillingPlanChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAuB,MAAM,uBAAuB,CAAC;AAG/E,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,uCAAa,CAAA;IACb,mDAAyB,CAAA;IACzB,yCAAe,CAAA;IACf,mDAAyB,CAAA;IACzB,2CAAiB,CAAA;AACnB,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC;AAQD,sGAAsG;AACtG,MAAM,UAAU,wBAAwB,CAAC,QAA0C;IACjF,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IACjD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAC5I,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO;QACL,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC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CAAC,OAAO,GAAG,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAErB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC5C,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { currencyMinorUnitDecimals } from '@wildo-ai/zod-decorators';\nimport { BillingStateSlice, type InvoicePreview } from '@wildo-ai/saas-models';\nimport type { BillingContextType, BillingPlanChangeTarget, BillingPlanChangePreviewResponse } from './BillingContext';\n\nexport enum BillingPlanChangePhase {\n IDLE = 'idle',\n PREVIEWING = 'previewing',\n READY = 'ready',\n CONFIRMING = 'confirming',\n FAILED = 'failed',\n}\n\ntype Selection = { target: BillingPlanChangeTarget; scopeIdentity: string };\nexport type BillingPlanChangeState =\n | { phase: BillingPlanChangePhase.IDLE }\n | (Selection & { phase: BillingPlanChangePhase.PREVIEWING | BillingPlanChangePhase.FAILED })\n | (Selection & { phase: BillingPlanChangePhase.READY | BillingPlanChangePhase.CONFIRMING; response: BillingPlanChangePreviewResponse; preview: InvoicePreview; hasError?: boolean });\n\n/** A provider amount uses the currency's own minor units, not an authored price's arbitrary scale. */\nexport function invoicePreviewForDisplay(response: BillingPlanChangePreviewResponse): InvoicePreview {\n const currency = response.currency.toUpperCase();\n const decimals = currencyMinorUnitDecimals(currency);\n if (decimals === undefined || !Number.isSafeInteger(response.amount) || response.lineItems.some(item => !Number.isSafeInteger(item.amount))) {\n throw new Error('The invoice estimate contains unsupported monetary values.');\n }\n return {\n amount: { amount: BigInt(response.amount), currency, decimals },\n lineItems: response.lineItems.map(item => ({ ...item, amount: { amount: BigInt(item.amount), currency, decimals } })),\n periodStart: response.periodStart,\n periodEnd: response.periodEnd,\n timing: response.timing,\n effectiveAt: new Date(response.effectiveAt),\n };\n}\n\n/** Owns the composed selection flow. A server token is only usable with its original selection.\n * Request generation fences late responses; cancellation aborts only a preview, never an accepted mutation.\n * A failed confirmation retains its token for the server's idempotent retry path.\n */\nexport function useBillingPlanChange(billing: BillingContextType | undefined) {\n const [state, setState] = useState<BillingPlanChangeState>({ phase: BillingPlanChangePhase.IDLE });\n const generation = useRef(0);\n const pendingPreview = useRef<AbortController | null>(null);\n const confirming = useRef(false);\n const stateRef = useRef(state);\n stateRef.current = state;\n const scopeIdentity = JSON.stringify([billing?.currentScope, billing?.billingAccount?._id, billing?.subscription?._id]);\n const currentIdentity = useRef(scopeIdentity);\n currentIdentity.current = scopeIdentity;\n const ready = !!billing?.isEnabled && [BillingStateSlice.BILLING_ACCOUNT, BillingStateSlice.SUBSCRIPTION, BillingStateSlice.PRODUCTS, BillingStateSlice.PRICES].every(billing.isSliceAvailable);\n\n useEffect(() => {\n generation.current += 1;\n pendingPreview.current?.abort();\n setState({ phase: BillingPlanChangePhase.IDLE });\n return () => { generation.current += 1; pendingPreview.current?.abort(); };\n }, [scopeIdentity]);\n\n // A same-scope refresh cannot revoke an already submitted confirmation or its retry token.\n // Availability controls whether another dispatch is allowed; it is not evidence that the\n // provider did not accept the first one. The server validates the quote's semantic basis.\n useEffect(() => {\n const current = stateRef.current;\n if (confirming.current || (current.phase === BillingPlanChangePhase.READY && current.hasError)) return;\n if (!ready) {\n generation.current += 1;\n pendingPreview.current?.abort();\n setState({ phase: BillingPlanChangePhase.IDLE });\n }\n }, [ready]);\n\n const select = useCallback(async (target: BillingPlanChangeTarget) => {\n if (!billing || !ready || !billing.subscription || confirming.current) return;\n const requestGeneration = ++generation.current;\n pendingPreview.current?.abort();\n const controller = new AbortController();\n pendingPreview.current = controller;\n const selection = { target, scopeIdentity };\n setState({ ...selection, phase: BillingPlanChangePhase.PREVIEWING });\n try {\n const response = await billing.previewPlanChange(target, { signal: controller.signal });\n const preview = invoicePreviewForDisplay(response);\n if (!response.previewToken) throw new Error('The invoice estimate has no confirmation binding.');\n if (generation.current !== requestGeneration || currentIdentity.current !== scopeIdentity) return;\n setState({ ...selection, phase: BillingPlanChangePhase.READY, response, preview });\n } catch {\n if (generation.current !== requestGeneration || controller.signal.aborted) return;\n setState({ ...selection, phase: BillingPlanChangePhase.FAILED });\n }\n }, [billing, ready, scopeIdentity]);\n\n const cancel = useCallback(() => {\n if (confirming.current) return;\n generation.current += 1;\n pendingPreview.current?.abort();\n setState({ phase: BillingPlanChangePhase.IDLE });\n }, []);\n\n const confirm = useCallback(async () => {\n const current = stateRef.current;\n if (!billing || !ready || confirming.current || current.phase !== BillingPlanChangePhase.READY || current.scopeIdentity !== currentIdentity.current) return;\n confirming.current = true;\n const requestGeneration = generation.current;\n setState({ ...current, phase: BillingPlanChangePhase.CONFIRMING, hasError: false });\n try {\n await billing.confirmPlanChange({ ...current.target, previewToken: current.response.previewToken });\n if (generation.current === requestGeneration) setState({ phase: BillingPlanChangePhase.IDLE });\n } catch {\n if (generation.current === requestGeneration) setState({ ...current, phase: BillingPlanChangePhase.READY, hasError: true });\n } finally {\n confirming.current = false;\n }\n }, [billing, ready]);\n\n return { state, select, cancel, confirm };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"assert-registry-completeness.frontend.helper.d.ts","sourceRoot":"","sources":["../../../../../src/core/components-registry/assert-registry-completeness.frontend.helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AA4H5E,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,0BAA0B,CAoBxE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE;IACnD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,0BAA0B,CAwB7B"}
1
+ {"version":3,"file":"assert-registry-completeness.frontend.helper.d.ts","sourceRoot":"","sources":["../../../../../src/core/components-registry/assert-registry-completeness.frontend.helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AA6H5E,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,0BAA0B,CAoBxE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE;IACnD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,0BAA0B,CAwB7B"}
@@ -109,6 +109,7 @@ const KNOWN_NON_REGISTERED_COMPONENT_TYPES = new Set([
109
109
  FrontendComponentType.APP_LAYOUTS_INVITATIONS_SETTINGS,
110
110
  FrontendComponentType.APP_LAYOUTS_BILLING_SETTINGS,
111
111
  FrontendComponentType.APP_LAYOUTS_CONNECTED_ACCOUNTS_SETTINGS,
112
+ FrontendComponentType.APP_LAYOUTS_AGENT_WORK_OVERRIDE_RATE_SETTINGS,
112
113
  // (a) i18n-bundle-only — SurfaceErrorBoundary is rendered directly by `Surface` when the surface
113
114
  // policy asks for a boundary, never resolved through the registry. The enum entry exists so the
114
115
  // fallback's words are addressable labels.
@@ -1 +1 @@
1
- {"version":3,"file":"assert-registry-completeness.frontend.helper.js","sourceRoot":"","sources":["../../../../../src/core/components-registry/assert-registry-completeness.frontend.helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,C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,CAAC;IAED,OAAO;QACL,eAAe,EAAE,SAAS,CAAC,MAAM;QACjC,eAAe;QACf,eAAe,EAAE,oCAAoC,CAAC,IAAI;QAC1D,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAM1C;IACC,MAAM,MAAM,GAAG,2BAA2B,EAAE,CAAC;IAE7C,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,OAAO,GACX,yDAAyD,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG;QACjF,+DAA+D;QAC/D,qBAAqB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;QACzE,2CAA2C;QAC3C,gGAAgG;QAChG,sEAAsE;QACtE,gFAAgF;QAChF,+EAA+E,CAAC;IAElF,MAAM,KAAK,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,QAAQ,KAAK,aAAa,CAAC;IACxF,IAAI,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,8CAA8C,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAClG,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Tier-1 Registration Completeness Check\n *\n * Validates that every `FrontendComponentType` value that should have a\n * registered preset (Tier-1 — DI/registry-resolved) actually has one.\n *\n * Tier-2 / framework-internal / dispatcher / i18n-bundle-only slots are\n * explicitly deny-listed below. Any new addition to the enum that does\n * NOT belong on that list MUST be registered, otherwise this check fails.\n *\n * See `.cursor/plans/compound-component-system.md` Section 15 for the\n * full Tier-1 vs Tier-2 model.\n */\n\nimport { FrontendComponentType } from '@wildo-ai/presets-components-models';\nimport { ComponentRegistryService } from './component-registry.frontend.service';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\n\n/**\n * Enum entries that intentionally have NO registered preset.\n *\n * Each entry MUST have a one-line justification explaining why it is not\n * registered. Categories:\n *\n * (a) i18n-bundle-only — exists for `useI18n({ component })` lookup\n * but is rendered via direct composition, not via `resolve()`.\n * (b) framework-internal — the framework ships the implementation, so no\n * preset is registered and this check must not demand one. It does NOT\n * mean unswappable: a slot in this category may still consult the\n * registry first and fall back to its built-in (see the guidance\n * renderers below). Read each entry's own justification.\n * (c) deprecated — superseded by another slot, kept only for migration.\n * (d) dispatcher — meta-slot that resolves to one of several concrete\n * slots at render time (HIGH_LEVEL_VIEWS_COMPOSITE etc.).\n * (e) orphan — historical leftover, kept on the enum for back-compat\n * of i18n keys but no longer wired to any wrapper.\n */\nconst KNOWN_NON_REGISTERED_COMPONENT_TYPES: ReadonlySet<FrontendComponentType> = new Set([\n // (a) i18n-bundle-only — ContentSectionContainer uses direct composition. (The\n // SECTION / GROUP / LEGEND slots are now registered ContentSection primitives.)\n FrontendComponentType.LOW_LEVEL_CONTENT_SECTION_CONTAINER,\n // (a) i18n-bundle-only — used by OverlayContainer direct composition\n FrontendComponentType.LOW_LEVEL_OVERLAY_CONTAINER,\n\n // (b) framework-internal — Flows-Actors orchestration shells (engine/saas-frontend-lib/src/components/flows-actors/*)\n FrontendComponentType.LOW_LEVEL_AI_FLOW_NODE,\n FrontendComponentType.LOW_LEVEL_AI_FLOW_EXECUTION,\n FrontendComponentType.LOW_LEVEL_AI_SYSTEM_CATALOG,\n FrontendComponentType.LOW_LEVEL_AI_ACTOR,\n FrontendComponentType.LOW_LEVEL_AI_EXECUTION_PLAN,\n FrontendComponentType.LOW_LEVEL_AI_TASK_DETAIL,\n FrontendComponentType.LOW_LEVEL_AI_TASK_MEMORY,\n FrontendComponentType.LOW_LEVEL_AI_APPROVAL,\n FrontendComponentType.LOW_LEVEL_AI_DECISION,\n FrontendComponentType.LOW_LEVEL_AI_EXECUTION_STREAM,\n FrontendComponentType.LOW_LEVEL_AI_ARTIFACT_BROWSER,\n FrontendComponentType.LOW_LEVEL_AI_AGENT_CONFIG,\n\n /**\n * (b) framework-internal — Guidance renderers\n * (`engine/saas-frontend-lib/src/core/guidance/renderers/*`).\n *\n * Deny-listed because the ENGINE registers no preset for them: `GuidanceRenderer` ships working\n * built-in implementations and falls back to them. That is why they belong here and why the\n * check must not demand a registration.\n *\n * They are NOT unswappable, and this entry used to say they were. `GuidanceRenderer` resolves\n * each element type through `GUIDANCE_ELEMENT_COMPONENT_TYPE` against this registry BEFORE its\n * built-in map, so an application that registers a preset under `CorePresetNames.DEFAULT` for any\n * of these types replaces that renderer — which is what the frontend-component specifications for\n * these slots have always advertised.\n */\n FrontendComponentType.GUIDANCE_CHECKLIST,\n FrontendComponentType.GUIDANCE_CHECKLIST_ITEM,\n FrontendComponentType.GUIDANCE_TOUR,\n FrontendComponentType.GUIDANCE_TOOLTIP,\n FrontendComponentType.GUIDANCE_MODAL,\n FrontendComponentType.GUIDANCE_BANNER,\n FrontendComponentType.GUIDANCE_ANNOUNCEMENT,\n FrontendComponentType.GUIDANCE_BADGE,\n FrontendComponentType.GUIDANCE_CARD,\n FrontendComponentType.GUIDANCE_SURVEY,\n FrontendComponentType.GUIDANCE_ONBOARDING_VIEW,\n\n // (b) framework-internal — Progression renderers (engine/saas-frontend-lib/src/components/progression/*)\n FrontendComponentType.PROGRESSION_MILESTONE_TRACKER,\n FrontendComponentType.PROGRESSION_ACHIEVEMENT_BADGE,\n\n // (b) framework-internal — Lifecycle renderers (composed directly in app shells)\n FrontendComponentType.LIFECYCLE_HOME_ACTIVATION_PROGRESS,\n FrontendComponentType.LIFECYCLE_HOME_WELCOME_BACK,\n FrontendComponentType.LIFECYCLE_HOME_DASHBOARD,\n\n // (d) dispatcher — meta-slots that resolve to a concrete view at render time\n FrontendComponentType.HIGH_LEVEL_VIEWS_COMPOSITE,\n FrontendComponentType.HIGH_LEVEL_VIEWS_CHART,\n FrontendComponentType.HIGH_LEVEL_VIEWS_FULL_CUSTOM,\n FrontendComponentType.HIGH_LEVEL_VIEWS_FLOWS_ACTORS,\n FrontendComponentType.HIGH_LEVEL_VIEWS_EXECUTION,\n FrontendComponentType.HIGH_LEVEL_VIEWS_NOT_FOUND,\n\n // (b) framework-internal — H-8: app-owned shell slots. The enum entry is\n // kept so that (1) host apps can register their own preset implementation\n // for the slot if/when they need it, and (2) i18n labels remain\n // addressable. The framework itself does not ship a default preset because\n // the layout shape is intentionally app-owned (test harness page, security\n // settings page).\n FrontendComponentType.APP_LAYOUTS_TEST_COMPONENT,\n FrontendComponentType.APP_LAYOUTS_SECURITY_SETTINGS,\n // The Settings Hub + its bespoke panels are composed by the navigation\n // runtime (NavigationContentRenderer → SettingsHub) and the hub's own panel\n // resolver, NOT the ComponentRegistry. Their enum entries exist for i18n\n // label addressability + spec coverage; the framework ships no default preset.\n FrontendComponentType.APP_LAYOUTS_SETTINGS_HUB,\n FrontendComponentType.APP_LAYOUTS_APPEARANCE_SETTINGS,\n FrontendComponentType.APP_LAYOUTS_INVITATIONS_SETTINGS,\n FrontendComponentType.APP_LAYOUTS_BILLING_SETTINGS,\n FrontendComponentType.APP_LAYOUTS_CONNECTED_ACCOUNTS_SETTINGS,\n\n // (a) i18n-bundle-only — SurfaceErrorBoundary is rendered directly by `Surface` when the surface\n // policy asks for a boundary, never resolved through the registry. The enum entry exists so the\n // fallback's words are addressable labels.\n FrontendComponentType.APP_LAYOUTS_SURFACE_ERROR_BOUNDARY,\n\n // (e) orphan — H-5: FK editing AND display both flow through the\n // dedicated RESOURCES_FIELDS_RESOURCE_REFERENCE preset (registered by\n // category EDIT/DISPLAY in register-framework-layouts.ts) so there is no\n // separate FORM_FIELD / DISPLAY_FIELD wrapper to register. The enum\n // entries are kept on the schema for consumers that key i18n labels off\n // them; renaming has cross-package blast radius (presets, generated\n // specs, locale bundles), so we treat them as documented orphans rather\n // than removing them.\n FrontendComponentType.LOW_LEVEL_FORM_FIELD_FOREIGN_KEY,\n FrontendComponentType.LOW_LEVEL_DISPLAY_FIELD_FOREIGN_KEY,\n]);\n\nexport interface RegistryCompletenessReport {\n totalEnumValues: number;\n registeredCount: number;\n denyListedCount: number;\n missing: FrontendComponentType[];\n}\n\n/**\n * Compute (without throwing) the set of enum entries that should be\n * registered but are not. Useful for tests and for the boot-time check.\n */\nexport function computeRegistryCompleteness(): RegistryCompletenessReport {\n const allValues = Object.values(FrontendComponentType) as FrontendComponentType[];\n const missing: FrontendComponentType[] = [];\n let registeredCount = 0;\n\n for (const type of allValues) {\n if (KNOWN_NON_REGISTERED_COMPONENT_TYPES.has(type)) continue;\n if (ComponentRegistryService.hasComponentType(type)) {\n registeredCount += 1;\n } else {\n missing.push(type);\n }\n }\n\n return {\n totalEnumValues: allValues.length,\n registeredCount,\n denyListedCount: KNOWN_NON_REGISTERED_COMPONENT_TYPES.size,\n missing,\n };\n}\n\n/**\n * Boot-time guard.\n *\n * Call this once after every `registerDefaultPresets()` /\n * `registerFrameworkLayouts()` invocation completes during app startup.\n *\n * Behaviour:\n * - In `development`: throws a hard error listing all missing entries.\n * The developer must either register the missing component or add\n * its enum value to `KNOWN_NON_REGISTERED_COMPONENT_TYPES` with a\n * justification.\n * - In `production`: logs a warning and returns. Avoids breaking a\n * deployed app over a registration omission, but surfaces it loudly\n * in monitoring.\n *\n * @returns the same report `computeRegistryCompleteness()` returned.\n */\nexport function assertRegistryCompleteness(options?: {\n /**\n * When true, throw even outside `development`. Useful for CI / unit\n * tests that want a strict gate regardless of NODE_ENV.\n */\n strict?: boolean;\n}): RegistryCompletenessReport {\n const report = computeRegistryCompleteness();\n\n if (report.missing.length === 0) {\n return report;\n }\n\n const message =\n `[ComponentRegistry] Tier-1 completeness check failed: ${report.missing.length} ` +\n `FrontendComponentType value(s) have no registered preset.\\n\\n` +\n `Missing entries:\\n${report.missing.map(t => ` - ${t}`).join('\\n')}\\n\\n` +\n `For each missing entry you must EITHER:\\n` +\n ` (1) register a default preset in registerDefaultPresets() / registerFrameworkLayouts(); OR\\n` +\n ` (2) add the enum value to KNOWN_NON_REGISTERED_COMPONENT_TYPES in ` +\n `assert-registry-completeness.frontend.helper.ts with a one-line justification ` +\n `(see compound-component-system.md Section 15 for the Tier-1 vs Tier-2 model).`;\n\n const isDev = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';\n if (options?.strict || isDev) {\n throw new Error(message);\n }\n\n logger.warn('component-registry.completeness-check.failed', { message, missing: report.missing });\n return report;\n}\n"]}
1
+ {"version":3,"file":"assert-registry-completeness.frontend.helper.js","sourceRoot":"","sources":["../../../../../src/core/components-registry/assert-registry-completeness.frontend.helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAEpG,MAAM,MAAM,GAA0B,qBAAqB,CAAC,SAAS,EAAE,CAAC;AAExE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,oCAAoC,GAAuC,IAAI,GAAG,CAAC;IACvF,+EAA+E;IAC/E,gFAAgF;IAChF,qBAAqB,CAAC,mCAAmC;IACzD,qEAAqE;IACrE,qBAAqB,CAAC,2BAA2B;IAEjD,sHAAsH;IACtH,qBAAqB,CAAC,sBAAsB;IAC5C,qBAAqB,CAAC,2BAA2B;IACjD,qBAAqB,CAAC,2BAA2B;IACjD,qBAAqB,CAAC,kBAAkB;IACxC,qBAAqB,CAAC,2BAA2B;IACjD,qBAAqB,CAAC,wBAAwB;IAC9C,qBAAqB,CAAC,w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CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;QACzE,2CAA2C;QAC3C,gGAAgG;QAChG,sEAAsE;QACtE,gFAAgF;QAChF,+EAA+E,CAAC;IAElF,MAAM,KAAK,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,QAAQ,KAAK,aAAa,CAAC;IACxF,IAAI,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,8CAA8C,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAClG,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Tier-1 Registration Completeness Check\n *\n * Validates that every `FrontendComponentType` value that should have a\n * registered preset (Tier-1 — DI/registry-resolved) actually has one.\n *\n * Tier-2 / framework-internal / dispatcher / i18n-bundle-only slots are\n * explicitly deny-listed below. Any new addition to the enum that does\n * NOT belong on that list MUST be registered, otherwise this check fails.\n *\n * See `.cursor/plans/compound-component-system.md` Section 15 for the\n * full Tier-1 vs Tier-2 model.\n */\n\nimport { FrontendComponentType } from '@wildo-ai/presets-components-models';\nimport { ComponentRegistryService } from './component-registry.frontend.service';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\n\n/**\n * Enum entries that intentionally have NO registered preset.\n *\n * Each entry MUST have a one-line justification explaining why it is not\n * registered. Categories:\n *\n * (a) i18n-bundle-only — exists for `useI18n({ component })` lookup\n * but is rendered via direct composition, not via `resolve()`.\n * (b) framework-internal — the framework ships the implementation, so no\n * preset is registered and this check must not demand one. It does NOT\n * mean unswappable: a slot in this category may still consult the\n * registry first and fall back to its built-in (see the guidance\n * renderers below). Read each entry's own justification.\n * (c) deprecated — superseded by another slot, kept only for migration.\n * (d) dispatcher — meta-slot that resolves to one of several concrete\n * slots at render time (HIGH_LEVEL_VIEWS_COMPOSITE etc.).\n * (e) orphan — historical leftover, kept on the enum for back-compat\n * of i18n keys but no longer wired to any wrapper.\n */\nconst KNOWN_NON_REGISTERED_COMPONENT_TYPES: ReadonlySet<FrontendComponentType> = new Set([\n // (a) i18n-bundle-only — ContentSectionContainer uses direct composition. (The\n // SECTION / GROUP / LEGEND slots are now registered ContentSection primitives.)\n FrontendComponentType.LOW_LEVEL_CONTENT_SECTION_CONTAINER,\n // (a) i18n-bundle-only — used by OverlayContainer direct composition\n FrontendComponentType.LOW_LEVEL_OVERLAY_CONTAINER,\n\n // (b) framework-internal — Flows-Actors orchestration shells (engine/saas-frontend-lib/src/components/flows-actors/*)\n FrontendComponentType.LOW_LEVEL_AI_FLOW_NODE,\n FrontendComponentType.LOW_LEVEL_AI_FLOW_EXECUTION,\n FrontendComponentType.LOW_LEVEL_AI_SYSTEM_CATALOG,\n FrontendComponentType.LOW_LEVEL_AI_ACTOR,\n FrontendComponentType.LOW_LEVEL_AI_EXECUTION_PLAN,\n FrontendComponentType.LOW_LEVEL_AI_TASK_DETAIL,\n FrontendComponentType.LOW_LEVEL_AI_TASK_MEMORY,\n FrontendComponentType.LOW_LEVEL_AI_APPROVAL,\n FrontendComponentType.LOW_LEVEL_AI_DECISION,\n FrontendComponentType.LOW_LEVEL_AI_EXECUTION_STREAM,\n FrontendComponentType.LOW_LEVEL_AI_ARTIFACT_BROWSER,\n FrontendComponentType.LOW_LEVEL_AI_AGENT_CONFIG,\n\n /**\n * (b) framework-internal — Guidance renderers\n * (`engine/saas-frontend-lib/src/core/guidance/renderers/*`).\n *\n * Deny-listed because the ENGINE registers no preset for them: `GuidanceRenderer` ships working\n * built-in implementations and falls back to them. That is why they belong here and why the\n * check must not demand a registration.\n *\n * They are NOT unswappable, and this entry used to say they were. `GuidanceRenderer` resolves\n * each element type through `GUIDANCE_ELEMENT_COMPONENT_TYPE` against this registry BEFORE its\n * built-in map, so an application that registers a preset under `CorePresetNames.DEFAULT` for any\n * of these types replaces that renderer — which is what the frontend-component specifications for\n * these slots have always advertised.\n */\n FrontendComponentType.GUIDANCE_CHECKLIST,\n FrontendComponentType.GUIDANCE_CHECKLIST_ITEM,\n FrontendComponentType.GUIDANCE_TOUR,\n FrontendComponentType.GUIDANCE_TOOLTIP,\n FrontendComponentType.GUIDANCE_MODAL,\n FrontendComponentType.GUIDANCE_BANNER,\n FrontendComponentType.GUIDANCE_ANNOUNCEMENT,\n FrontendComponentType.GUIDANCE_BADGE,\n FrontendComponentType.GUIDANCE_CARD,\n FrontendComponentType.GUIDANCE_SURVEY,\n FrontendComponentType.GUIDANCE_ONBOARDING_VIEW,\n\n // (b) framework-internal — Progression renderers (engine/saas-frontend-lib/src/components/progression/*)\n FrontendComponentType.PROGRESSION_MILESTONE_TRACKER,\n FrontendComponentType.PROGRESSION_ACHIEVEMENT_BADGE,\n\n // (b) framework-internal — Lifecycle renderers (composed directly in app shells)\n FrontendComponentType.LIFECYCLE_HOME_ACTIVATION_PROGRESS,\n FrontendComponentType.LIFECYCLE_HOME_WELCOME_BACK,\n FrontendComponentType.LIFECYCLE_HOME_DASHBOARD,\n\n // (d) dispatcher — meta-slots that resolve to a concrete view at render time\n FrontendComponentType.HIGH_LEVEL_VIEWS_COMPOSITE,\n FrontendComponentType.HIGH_LEVEL_VIEWS_CHART,\n FrontendComponentType.HIGH_LEVEL_VIEWS_FULL_CUSTOM,\n FrontendComponentType.HIGH_LEVEL_VIEWS_FLOWS_ACTORS,\n FrontendComponentType.HIGH_LEVEL_VIEWS_EXECUTION,\n FrontendComponentType.HIGH_LEVEL_VIEWS_NOT_FOUND,\n\n // (b) framework-internal — H-8: app-owned shell slots. The enum entry is\n // kept so that (1) host apps can register their own preset implementation\n // for the slot if/when they need it, and (2) i18n labels remain\n // addressable. The framework itself does not ship a default preset because\n // the layout shape is intentionally app-owned (test harness page, security\n // settings page).\n FrontendComponentType.APP_LAYOUTS_TEST_COMPONENT,\n FrontendComponentType.APP_LAYOUTS_SECURITY_SETTINGS,\n // The Settings Hub + its bespoke panels are composed by the navigation\n // runtime (NavigationContentRenderer → SettingsHub) and the hub's own panel\n // resolver, NOT the ComponentRegistry. Their enum entries exist for i18n\n // label addressability + spec coverage; the framework ships no default preset.\n FrontendComponentType.APP_LAYOUTS_SETTINGS_HUB,\n FrontendComponentType.APP_LAYOUTS_APPEARANCE_SETTINGS,\n FrontendComponentType.APP_LAYOUTS_INVITATIONS_SETTINGS,\n FrontendComponentType.APP_LAYOUTS_BILLING_SETTINGS,\n FrontendComponentType.APP_LAYOUTS_CONNECTED_ACCOUNTS_SETTINGS,\n FrontendComponentType.APP_LAYOUTS_AGENT_WORK_OVERRIDE_RATE_SETTINGS,\n\n // (a) i18n-bundle-only — SurfaceErrorBoundary is rendered directly by `Surface` when the surface\n // policy asks for a boundary, never resolved through the registry. The enum entry exists so the\n // fallback's words are addressable labels.\n FrontendComponentType.APP_LAYOUTS_SURFACE_ERROR_BOUNDARY,\n\n // (e) orphan — H-5: FK editing AND display both flow through the\n // dedicated RESOURCES_FIELDS_RESOURCE_REFERENCE preset (registered by\n // category EDIT/DISPLAY in register-framework-layouts.ts) so there is no\n // separate FORM_FIELD / DISPLAY_FIELD wrapper to register. The enum\n // entries are kept on the schema for consumers that key i18n labels off\n // them; renaming has cross-package blast radius (presets, generated\n // specs, locale bundles), so we treat them as documented orphans rather\n // than removing them.\n FrontendComponentType.LOW_LEVEL_FORM_FIELD_FOREIGN_KEY,\n FrontendComponentType.LOW_LEVEL_DISPLAY_FIELD_FOREIGN_KEY,\n]);\n\nexport interface RegistryCompletenessReport {\n totalEnumValues: number;\n registeredCount: number;\n denyListedCount: number;\n missing: FrontendComponentType[];\n}\n\n/**\n * Compute (without throwing) the set of enum entries that should be\n * registered but are not. Useful for tests and for the boot-time check.\n */\nexport function computeRegistryCompleteness(): RegistryCompletenessReport {\n const allValues = Object.values(FrontendComponentType) as FrontendComponentType[];\n const missing: FrontendComponentType[] = [];\n let registeredCount = 0;\n\n for (const type of allValues) {\n if (KNOWN_NON_REGISTERED_COMPONENT_TYPES.has(type)) continue;\n if (ComponentRegistryService.hasComponentType(type)) {\n registeredCount += 1;\n } else {\n missing.push(type);\n }\n }\n\n return {\n totalEnumValues: allValues.length,\n registeredCount,\n denyListedCount: KNOWN_NON_REGISTERED_COMPONENT_TYPES.size,\n missing,\n };\n}\n\n/**\n * Boot-time guard.\n *\n * Call this once after every `registerDefaultPresets()` /\n * `registerFrameworkLayouts()` invocation completes during app startup.\n *\n * Behaviour:\n * - In `development`: throws a hard error listing all missing entries.\n * The developer must either register the missing component or add\n * its enum value to `KNOWN_NON_REGISTERED_COMPONENT_TYPES` with a\n * justification.\n * - In `production`: logs a warning and returns. Avoids breaking a\n * deployed app over a registration omission, but surfaces it loudly\n * in monitoring.\n *\n * @returns the same report `computeRegistryCompleteness()` returned.\n */\nexport function assertRegistryCompleteness(options?: {\n /**\n * When true, throw even outside `development`. Useful for CI / unit\n * tests that want a strict gate regardless of NODE_ENV.\n */\n strict?: boolean;\n}): RegistryCompletenessReport {\n const report = computeRegistryCompleteness();\n\n if (report.missing.length === 0) {\n return report;\n }\n\n const message =\n `[ComponentRegistry] Tier-1 completeness check failed: ${report.missing.length} ` +\n `FrontendComponentType value(s) have no registered preset.\\n\\n` +\n `Missing entries:\\n${report.missing.map(t => ` - ${t}`).join('\\n')}\\n\\n` +\n `For each missing entry you must EITHER:\\n` +\n ` (1) register a default preset in registerDefaultPresets() / registerFrameworkLayouts(); OR\\n` +\n ` (2) add the enum value to KNOWN_NON_REGISTERED_COMPONENT_TYPES in ` +\n `assert-registry-completeness.frontend.helper.ts with a one-line justification ` +\n `(see compound-component-system.md Section 15 for the Tier-1 vs Tier-2 model).`;\n\n const isDev = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';\n if (options?.strict || isDev) {\n throw new Error(message);\n }\n\n logger.warn('component-registry.completeness-check.failed', { message, missing: report.missing });\n return report;\n}\n"]}