@aglyn/aglyn 1.0.0-beta.218 → 1.0.0-beta.220

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 (455) hide show
  1. package/package.json +12 -12
  2. package/src/lib/app-utils/actions.d.ts +26 -433
  3. package/src/lib/app-utils/actions.js +108 -633
  4. package/src/lib/app-utils/actions.js.map +1 -1
  5. package/src/lib/app-utils/activity-presenter.d.ts +3 -3
  6. package/src/lib/app-utils/activity-presenter.js +36 -52
  7. package/src/lib/app-utils/activity-presenter.js.map +1 -1
  8. package/src/lib/app-utils/analytics-events.d.ts +1 -1
  9. package/src/lib/app-utils/analytics-events.js.map +1 -1
  10. package/src/lib/app-utils/analytics-provider.d.ts +182 -0
  11. package/src/lib/app-utils/analytics-provider.js +133 -0
  12. package/src/lib/app-utils/analytics-provider.js.map +1 -0
  13. package/src/lib/app-utils/api-plugins.d.ts +46 -0
  14. package/src/lib/app-utils/api-plugins.js +19 -0
  15. package/src/lib/app-utils/api-plugins.js.map +1 -1
  16. package/src/lib/app-utils/{marketplace-overrides.d.ts → artifact-overrides.d.ts} +9 -6
  17. package/src/lib/app-utils/{marketplace-overrides.js → artifact-overrides.js} +10 -7
  18. package/src/lib/app-utils/artifact-overrides.js.map +1 -0
  19. package/src/lib/app-utils/{marketplace-provenance.d.ts → artifact-provenance.d.ts} +12 -10
  20. package/src/lib/app-utils/{marketplace-provenance.js → artifact-provenance.js} +9 -7
  21. package/src/lib/app-utils/artifact-provenance.js.map +1 -0
  22. package/src/lib/app-utils/binding-token-catalog.d.ts +5 -13
  23. package/src/lib/app-utils/binding-token-catalog.js +17 -41
  24. package/src/lib/app-utils/binding-token-catalog.js.map +1 -1
  25. package/src/lib/app-utils/brand-support-line.d.ts +36 -0
  26. package/src/lib/app-utils/brand-support-line.js +38 -0
  27. package/src/lib/app-utils/brand-support-line.js.map +1 -0
  28. package/src/lib/app-utils/collection-entries.d.ts +2 -2
  29. package/src/lib/app-utils/collection-entries.js.map +1 -1
  30. package/src/lib/app-utils/consent-group-change.d.ts +4 -0
  31. package/src/lib/app-utils/consent-group-change.js.map +1 -1
  32. package/src/lib/app-utils/consent-groups.d.ts +1 -1
  33. package/src/lib/app-utils/consent-groups.js.map +1 -1
  34. package/src/lib/app-utils/console-routes.d.ts +15 -42
  35. package/src/lib/app-utils/console-routes.js +10 -39
  36. package/src/lib/app-utils/console-routes.js.map +1 -1
  37. package/src/lib/app-utils/contacts.d.ts +24 -2
  38. package/src/lib/app-utils/contacts.js +21 -5
  39. package/src/lib/app-utils/contacts.js.map +1 -1
  40. package/src/lib/app-utils/container-membership.d.ts +93 -0
  41. package/src/lib/app-utils/container-membership.js +165 -0
  42. package/src/lib/app-utils/container-membership.js.map +1 -0
  43. package/src/lib/app-utils/crm-task-reminders.d.ts +23 -6
  44. package/src/lib/app-utils/crm-task-reminders.js +32 -11
  45. package/src/lib/app-utils/crm-task-reminders.js.map +1 -1
  46. package/src/lib/app-utils/crm.d.ts +24 -4
  47. package/src/lib/app-utils/crm.js +23 -0
  48. package/src/lib/app-utils/crm.js.map +1 -1
  49. package/src/lib/app-utils/cross-pool-desync.d.ts +39 -0
  50. package/src/lib/app-utils/cross-pool-desync.js +47 -0
  51. package/src/lib/app-utils/cross-pool-desync.js.map +1 -0
  52. package/src/lib/app-utils/csv-upload.d.ts +29 -0
  53. package/src/lib/app-utils/csv-upload.js +29 -0
  54. package/src/lib/app-utils/csv-upload.js.map +1 -0
  55. package/src/lib/app-utils/{dataset-csv.d.ts → csv.d.ts} +10 -43
  56. package/src/lib/app-utils/{dataset-csv.js → csv.js} +10 -81
  57. package/src/lib/app-utils/csv.js.map +1 -0
  58. package/src/lib/app-utils/dataset-models.d.ts +5 -5
  59. package/src/lib/app-utils/dataset-models.js +19 -2
  60. package/src/lib/app-utils/dataset-models.js.map +1 -1
  61. package/src/lib/app-utils/datasets.d.ts +65 -30
  62. package/src/lib/app-utils/datasets.js +74 -24
  63. package/src/lib/app-utils/datasets.js.map +1 -1
  64. package/src/lib/app-utils/docs-deflection.d.ts +6 -6
  65. package/src/lib/app-utils/docs-deflection.js.map +1 -1
  66. package/src/lib/app-utils/docs-help.generated.d.ts +14 -8
  67. package/src/lib/app-utils/docs-help.generated.js +23 -6
  68. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  69. package/src/lib/app-utils/docs-index.generated.d.ts +2 -2
  70. package/src/lib/app-utils/docs-index.generated.js +570 -346
  71. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  72. package/src/lib/app-utils/docs-retrieval.d.ts +3 -3
  73. package/src/lib/app-utils/docs-retrieval.js +14 -10
  74. package/src/lib/app-utils/docs-retrieval.js.map +1 -1
  75. package/src/lib/app-utils/duplicate-resource.d.ts +4 -1
  76. package/src/lib/app-utils/duplicate-resource.js +7 -4
  77. package/src/lib/app-utils/duplicate-resource.js.map +1 -1
  78. package/src/lib/app-utils/dynamic-list-rule.d.ts +1 -1
  79. package/src/lib/app-utils/dynamic-list-rule.js +3 -3
  80. package/src/lib/app-utils/dynamic-list-rule.js.map +1 -1
  81. package/src/lib/app-utils/element-ui.d.ts +1 -1
  82. package/src/lib/app-utils/element-ui.js +1 -1
  83. package/src/lib/app-utils/element-ui.js.map +1 -1
  84. package/src/lib/app-utils/email-starter-policy.js +3 -3
  85. package/src/lib/app-utils/email-starter-policy.js.map +1 -1
  86. package/src/lib/app-utils/email-text.d.ts +80 -0
  87. package/src/lib/app-utils/email-text.js +189 -0
  88. package/src/lib/app-utils/email-text.js.map +1 -0
  89. package/src/lib/app-utils/{list-assignment-policy.d.ts → enrollment-basis.d.ts} +4 -0
  90. package/src/lib/app-utils/{list-assignment-policy.js → enrollment-basis.js} +5 -1
  91. package/src/lib/app-utils/enrollment-basis.js.map +1 -0
  92. package/src/lib/app-utils/entity-picker-context.d.ts +10 -5
  93. package/src/lib/app-utils/entity-picker-context.js.map +1 -1
  94. package/src/lib/app-utils/error-beacon.d.ts +75 -6
  95. package/src/lib/app-utils/error-beacon.js +160 -21
  96. package/src/lib/app-utils/error-beacon.js.map +1 -1
  97. package/src/lib/app-utils/expand-repeatables.d.ts +10 -10
  98. package/src/lib/app-utils/expand-repeatables.js +14 -14
  99. package/src/lib/app-utils/expand-repeatables.js.map +1 -1
  100. package/src/lib/app-utils/forms.js +2 -2
  101. package/src/lib/app-utils/forms.js.map +1 -1
  102. package/src/lib/app-utils/health-report.d.ts +2 -3
  103. package/src/lib/app-utils/health-report.js +8 -6
  104. package/src/lib/app-utils/health-report.js.map +1 -1
  105. package/src/lib/app-utils/host-events.d.ts +82 -0
  106. package/src/lib/app-utils/host-events.js +62 -0
  107. package/src/lib/app-utils/host-events.js.map +1 -0
  108. package/src/lib/app-utils/inbound-mail-domain.d.ts +27 -0
  109. package/src/lib/app-utils/inbound-mail-domain.js +31 -0
  110. package/src/lib/app-utils/inbound-mail-domain.js.map +1 -0
  111. package/src/lib/app-utils/lockdown.d.ts +11 -0
  112. package/src/lib/app-utils/lockdown.js +33 -3
  113. package/src/lib/app-utils/lockdown.js.map +1 -1
  114. package/src/lib/app-utils/margin-utilization.d.ts +4 -69
  115. package/src/lib/app-utils/margin-utilization.js +82 -69
  116. package/src/lib/app-utils/margin-utilization.js.map +1 -1
  117. package/src/lib/app-utils/member-email-aliases.d.ts +25 -0
  118. package/src/lib/app-utils/member-email-aliases.js +29 -0
  119. package/src/lib/app-utils/member-email-aliases.js.map +1 -1
  120. package/src/lib/app-utils/node-definition-sanitizer.d.ts +16 -16
  121. package/src/lib/app-utils/node-definition-sanitizer.js +24 -20
  122. package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -1
  123. package/src/lib/app-utils/node-interactions.d.ts +7 -7
  124. package/src/lib/app-utils/node-interactions.js.map +1 -1
  125. package/src/lib/app-utils/notifications.d.ts +147 -47
  126. package/src/lib/app-utils/notifications.js +182 -44
  127. package/src/lib/app-utils/notifications.js.map +1 -1
  128. package/src/lib/app-utils/operator-alerts.d.ts +15 -1
  129. package/src/lib/app-utils/operator-alerts.js +47 -10
  130. package/src/lib/app-utils/operator-alerts.js.map +1 -1
  131. package/src/lib/app-utils/payments-configured.d.ts +8 -21
  132. package/src/lib/app-utils/payments-configured.js +8 -23
  133. package/src/lib/app-utils/payments-configured.js.map +1 -1
  134. package/src/lib/app-utils/plan-entitlements.d.ts +207 -306
  135. package/src/lib/app-utils/plan-entitlements.js +345 -528
  136. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  137. package/src/lib/app-utils/platform-brand.d.ts +10 -0
  138. package/src/lib/app-utils/platform-brand.js +14 -3
  139. package/src/lib/app-utils/platform-brand.js.map +1 -1
  140. package/src/lib/app-utils/platform-marketing-consent.d.ts +56 -2
  141. package/src/lib/app-utils/platform-marketing-consent.js +6 -5
  142. package/src/lib/app-utils/platform-marketing-consent.js.map +1 -1
  143. package/src/lib/app-utils/plugin-api-rate-limit.d.ts +7 -1
  144. package/src/lib/app-utils/plugin-api-rate-limit.js +11 -3
  145. package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -1
  146. package/src/lib/app-utils/plugin-bundle-checks.js +2 -2
  147. package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -1
  148. package/src/lib/app-utils/plugin-host-events.generated.d.ts +12 -0
  149. package/src/lib/app-utils/plugin-host-events.generated.js +169 -0
  150. package/src/lib/app-utils/plugin-host-events.generated.js.map +1 -0
  151. package/src/lib/app-utils/plugin-release-flags.generated.d.ts +12 -0
  152. package/src/lib/app-utils/plugin-release-flags.generated.js +106 -0
  153. package/src/lib/app-utils/plugin-release-flags.generated.js.map +1 -0
  154. package/src/lib/app-utils/plugin-starter-templates.generated.d.ts +12 -0
  155. package/src/lib/app-utils/plugin-starter-templates.generated.js +711 -0
  156. package/src/lib/app-utils/plugin-starter-templates.generated.js.map +1 -0
  157. package/src/lib/app-utils/realm-host-surface.generated.js +2 -0
  158. package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
  159. package/src/lib/app-utils/release-flags.d.ts +14 -5
  160. package/src/lib/app-utils/release-flags.js +21 -125
  161. package/src/lib/app-utils/release-flags.js.map +1 -1
  162. package/src/lib/app-utils/repeat-query.d.ts +56 -0
  163. package/src/lib/app-utils/{dataset-query.js → repeat-query.js} +16 -16
  164. package/src/lib/app-utils/repeat-query.js.map +1 -0
  165. package/src/lib/app-utils/repeat-sources.d.ts +9 -0
  166. package/src/lib/app-utils/repeat-sources.js.map +1 -1
  167. package/src/lib/app-utils/retained-refusals.d.ts +73 -0
  168. package/src/lib/app-utils/retained-refusals.js +186 -0
  169. package/src/lib/app-utils/retained-refusals.js.map +1 -0
  170. package/src/lib/app-utils/scope-tokens.d.ts +27 -0
  171. package/src/lib/app-utils/scope-tokens.js +61 -0
  172. package/src/lib/app-utils/scope-tokens.js.map +1 -1
  173. package/src/lib/app-utils/screen-link-context.js +3 -3
  174. package/src/lib/app-utils/screen-link-context.js.map +1 -1
  175. package/src/lib/app-utils/screen-route.js +1 -1
  176. package/src/lib/app-utils/screen-route.js.map +1 -1
  177. package/src/lib/app-utils/seo-audit.d.ts +132 -0
  178. package/src/lib/app-utils/seo-audit.js +246 -0
  179. package/src/lib/app-utils/seo-audit.js.map +1 -0
  180. package/src/lib/app-utils/seo-keywords.d.ts +48 -0
  181. package/src/lib/app-utils/seo-keywords.js +60 -0
  182. package/src/lib/app-utils/seo-keywords.js.map +1 -0
  183. package/src/lib/app-utils/seo-page-facts.d.ts +66 -0
  184. package/src/lib/app-utils/seo-page-facts.js +155 -0
  185. package/src/lib/app-utils/seo-page-facts.js.map +1 -0
  186. package/src/lib/app-utils/seo-site-scan.d.ts +126 -0
  187. package/src/lib/app-utils/seo-site-scan.js +162 -0
  188. package/src/lib/app-utils/seo-site-scan.js.map +1 -0
  189. package/src/lib/app-utils/seo-title-variables.js +1 -1
  190. package/src/lib/app-utils/seo-title-variables.js.map +1 -1
  191. package/src/lib/app-utils/server.d.ts +13 -18
  192. package/src/lib/app-utils/server.js +33 -51
  193. package/src/lib/app-utils/server.js.map +1 -1
  194. package/src/lib/app-utils/site-interactions.d.ts +501 -0
  195. package/src/lib/app-utils/site-interactions.js +554 -0
  196. package/src/lib/app-utils/site-interactions.js.map +1 -0
  197. package/src/lib/app-utils/{marketplace-theme.d.ts → site-theme.d.ts} +13 -2
  198. package/src/lib/app-utils/{marketplace-theme.js → site-theme.js} +2 -2
  199. package/src/lib/app-utils/site-theme.js.map +1 -0
  200. package/src/lib/app-utils/sitemap.d.ts +4 -3
  201. package/src/lib/app-utils/sitemap.js +9 -7
  202. package/src/lib/app-utils/sitemap.js.map +1 -1
  203. package/src/lib/app-utils/stale-build-error.d.ts +51 -0
  204. package/src/lib/app-utils/stale-build-error.js +100 -1
  205. package/src/lib/app-utils/stale-build-error.js.map +1 -1
  206. package/src/lib/app-utils/starter-template-nodes.d.ts +137 -0
  207. package/src/lib/app-utils/starter-template-nodes.js +129 -0
  208. package/src/lib/app-utils/starter-template-nodes.js.map +1 -0
  209. package/src/lib/app-utils/starter-templates.d.ts +11 -34
  210. package/src/lib/app-utils/starter-templates.js +19 -230
  211. package/src/lib/app-utils/starter-templates.js.map +1 -1
  212. package/src/lib/app-utils/{email-topics.d.ts → subscription-topics.d.ts} +64 -48
  213. package/src/lib/app-utils/{email-topics.js → subscription-topics.js} +39 -109
  214. package/src/lib/app-utils/subscription-topics.js.map +1 -0
  215. package/src/lib/app-utils/tax-jurisdiction-figures.d.ts +118 -0
  216. package/src/lib/app-utils/tax-jurisdiction-figures.js +123 -0
  217. package/src/lib/app-utils/tax-jurisdiction-figures.js.map +1 -0
  218. package/src/lib/app-utils/theme-library.d.ts +10 -3
  219. package/src/lib/app-utils/theme-library.js +13 -4
  220. package/src/lib/app-utils/theme-library.js.map +1 -1
  221. package/src/lib/app-utils/usage-budget.d.ts +73 -188
  222. package/src/lib/app-utils/usage-budget.js +58 -194
  223. package/src/lib/app-utils/usage-budget.js.map +1 -1
  224. package/src/lib/app-utils/{campaign-attribution.d.ts → utm-attribution.d.ts} +11 -6
  225. package/src/lib/app-utils/{campaign-attribution.js → utm-attribution.js} +13 -8
  226. package/src/lib/app-utils/utm-attribution.js.map +1 -0
  227. package/src/lib/app-utils/{campaign-forwarding.d.ts → utm-forwarding.d.ts} +14 -14
  228. package/src/lib/app-utils/{campaign-forwarding.js → utm-forwarding.js} +26 -26
  229. package/src/lib/app-utils/utm-forwarding.js.map +1 -0
  230. package/src/lib/app-utils/{campaign-touch.d.ts → utm-touch.d.ts} +25 -17
  231. package/src/lib/app-utils/{campaign-touch.js → utm-touch.js} +38 -30
  232. package/src/lib/app-utils/utm-touch.js.map +1 -0
  233. package/src/lib/app-utils/variables.d.ts +9 -9
  234. package/src/lib/app-utils/variables.js.map +1 -1
  235. package/src/lib/app-utils/video-object.js +6 -5
  236. package/src/lib/app-utils/video-object.js.map +1 -1
  237. package/src/lib/app-utils/visitor-consent.d.ts +41 -164
  238. package/src/lib/app-utils/visitor-consent.js +66 -277
  239. package/src/lib/app-utils/visitor-consent.js.map +1 -1
  240. package/src/lib/app-utils/visitor-record-ceiling.d.ts +32 -0
  241. package/src/lib/app-utils/visitor-record-ceiling.js +39 -0
  242. package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -1
  243. package/src/lib/app-utils/web-vitals-rum.d.ts +7 -7
  244. package/src/lib/app-utils/web-vitals-rum.js +31 -63
  245. package/src/lib/app-utils/web-vitals-rum.js.map +1 -1
  246. package/src/lib/app-utils/where-used.d.ts +11 -6
  247. package/src/lib/app-utils/where-used.js +3 -8
  248. package/src/lib/app-utils/where-used.js.map +1 -1
  249. package/src/lib/foundation/definitions/components.types.d.ts +1 -1
  250. package/src/lib/foundation/definitions/components.types.js +1 -1
  251. package/src/lib/foundation/definitions/components.types.js.map +1 -1
  252. package/src/lib/foundation/definitions/org-billing.types.d.ts +11 -137
  253. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
  254. package/src/lib/foundation/definitions/organization.types.d.ts +1 -3
  255. package/src/lib/foundation/definitions/organization.types.js.map +1 -1
  256. package/src/lib/foundation/definitions/platform.types.d.ts +11 -5
  257. package/src/lib/foundation/definitions/platform.types.js.map +1 -1
  258. package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +16 -0
  259. package/src/lib/foundation/definitions/write-deny-coverage.util.js +20 -0
  260. package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -1
  261. package/src/lib/foundation/index.d.ts +1 -1
  262. package/src/lib/foundation/index.js.map +1 -1
  263. package/src/lib/plugin-manager/besigner-documents.d.ts +96 -0
  264. package/src/lib/plugin-manager/besigner-documents.js +61 -0
  265. package/src/lib/plugin-manager/besigner-documents.js.map +1 -0
  266. package/src/lib/plugin-manager/computed-variables.d.ts +71 -0
  267. package/src/lib/plugin-manager/computed-variables.js +74 -0
  268. package/src/lib/plugin-manager/computed-variables.js.map +1 -0
  269. package/src/lib/plugin-manager/custom-fields.d.ts +29 -2
  270. package/src/lib/plugin-manager/custom-fields.js +47 -1
  271. package/src/lib/plugin-manager/custom-fields.js.map +1 -1
  272. package/src/lib/plugin-manager/feature-plugins.d.ts +372 -99
  273. package/src/lib/plugin-manager/feature-plugins.js +126 -51
  274. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  275. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +134 -0
  276. package/src/lib/plugin-manager/first-party-plugins.generated.js +840 -10
  277. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  278. package/src/lib/plugin-manager/index.d.ts +0 -1
  279. package/src/lib/plugin-manager/index.js +0 -1
  280. package/src/lib/plugin-manager/index.js.map +1 -1
  281. package/src/lib/plugin-manager/plugin-activity-actions.d.ts +12 -0
  282. package/src/lib/plugin-manager/plugin-activity-actions.js +25 -0
  283. package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -1
  284. package/src/lib/plugin-manager/plugin-contact-capture.d.ts +9 -4
  285. package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
  286. package/src/lib/plugin-manager/plugin-containers.d.ts +68 -0
  287. package/src/lib/plugin-manager/plugin-containers.generated.d.ts +10 -0
  288. package/src/lib/plugin-manager/plugin-containers.generated.js +20 -0
  289. package/src/lib/plugin-manager/plugin-containers.generated.js.map +1 -0
  290. package/src/lib/plugin-manager/plugin-containers.js +27 -0
  291. package/src/lib/plugin-manager/plugin-containers.js.map +1 -0
  292. package/src/lib/plugin-manager/plugin-contributions.d.ts +1 -1
  293. package/src/lib/plugin-manager/plugin-contributions.js.map +1 -1
  294. package/src/lib/plugin-manager/plugin-declarations-repair.d.ts +36 -0
  295. package/src/lib/plugin-manager/plugin-declarations-repair.js +64 -0
  296. package/src/lib/plugin-manager/plugin-declarations-repair.js.map +1 -0
  297. package/src/lib/plugin-manager/plugin-dependents.d.ts +101 -0
  298. package/src/lib/plugin-manager/plugin-dependents.js +75 -0
  299. package/src/lib/plugin-manager/plugin-dependents.js.map +1 -0
  300. package/src/lib/plugin-manager/plugin-distribution.d.ts +55 -0
  301. package/src/lib/plugin-manager/plugin-distribution.js +45 -0
  302. package/src/lib/plugin-manager/plugin-distribution.js.map +1 -0
  303. package/src/lib/plugin-manager/plugin-entitlements.d.ts +8 -0
  304. package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -1
  305. package/src/lib/plugin-manager/plugin-host-collections.d.ts +17 -0
  306. package/src/lib/plugin-manager/plugin-host-collections.js +6 -0
  307. package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -1
  308. package/src/lib/plugin-manager/plugin-host-resources.d.ts +133 -0
  309. package/src/lib/plugin-manager/plugin-host-resources.js +52 -0
  310. package/src/lib/plugin-manager/plugin-host-resources.js.map +1 -0
  311. package/src/lib/plugin-manager/plugin-membership-detach.js +1 -1
  312. package/src/lib/plugin-manager/plugin-membership-detach.js.map +1 -1
  313. package/src/lib/plugin-manager/plugin-org-erasure.d.ts +28 -2
  314. package/src/lib/plugin-manager/plugin-org-erasure.js +61 -2
  315. package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -1
  316. package/src/lib/plugin-manager/plugin-plan-entitlements.d.ts +123 -0
  317. package/src/lib/plugin-manager/plugin-plan-entitlements.js +101 -0
  318. package/src/lib/plugin-manager/plugin-plan-entitlements.js.map +1 -0
  319. package/src/lib/plugin-manager/plugin-record-email-state.d.ts +69 -0
  320. package/src/lib/plugin-manager/plugin-record-email-state.js +32 -0
  321. package/src/lib/plugin-manager/plugin-record-email-state.js.map +1 -1
  322. package/src/lib/plugin-manager/plugin-record-index.d.ts +95 -0
  323. package/src/lib/plugin-manager/plugin-record-index.js +51 -0
  324. package/src/lib/plugin-manager/plugin-record-index.js.map +1 -0
  325. package/src/lib/plugin-manager/plugin-record-lists.d.ts +115 -0
  326. package/src/lib/plugin-manager/plugin-record-lists.js +75 -0
  327. package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -0
  328. package/src/lib/plugin-manager/plugin-record-timeline.d.ts +42 -8
  329. package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -1
  330. package/src/lib/plugin-manager/plugin-record-written.d.ts +58 -0
  331. package/src/lib/plugin-manager/plugin-record-written.js +42 -0
  332. package/src/lib/plugin-manager/plugin-record-written.js.map +1 -0
  333. package/src/lib/plugin-manager/plugin-revenue-sources.d.ts +213 -0
  334. package/src/lib/plugin-manager/plugin-revenue-sources.js +194 -0
  335. package/src/lib/plugin-manager/plugin-revenue-sources.js.map +1 -0
  336. package/src/lib/plugin-manager/plugin-site-beacons.d.ts +71 -0
  337. package/src/lib/plugin-manager/plugin-site-beacons.js +54 -0
  338. package/src/lib/plugin-manager/plugin-site-beacons.js.map +1 -0
  339. package/src/lib/plugin-manager/plugin-site-bundle.d.ts +145 -0
  340. package/src/lib/plugin-manager/plugin-site-bundle.js +78 -0
  341. package/src/lib/plugin-manager/plugin-site-bundle.js.map +1 -0
  342. package/src/lib/plugin-manager/plugin-site-cache.d.ts +12 -0
  343. package/src/lib/plugin-manager/plugin-site-cache.js.map +1 -1
  344. package/src/lib/plugin-manager/plugin-site-export.d.ts +81 -0
  345. package/src/lib/plugin-manager/plugin-site-export.js +40 -0
  346. package/src/lib/plugin-manager/plugin-site-export.js.map +1 -0
  347. package/src/lib/plugin-manager/plugin-sitemap-sections.d.ts +88 -0
  348. package/src/lib/plugin-manager/plugin-sitemap-sections.js +29 -0
  349. package/src/lib/plugin-manager/plugin-sitemap-sections.js.map +1 -0
  350. package/src/lib/plugin-manager/plugin-subscription-topics.generated.d.ts +11 -0
  351. package/src/lib/plugin-manager/plugin-subscription-topics.generated.js +41 -0
  352. package/src/lib/plugin-manager/plugin-subscription-topics.generated.js.map +1 -0
  353. package/src/lib/plugin-manager/plugin-tax-profile.d.ts +20 -4
  354. package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -1
  355. package/src/lib/plugin-manager/plugin-tax-return-sources.d.ts +255 -0
  356. package/src/lib/plugin-manager/plugin-tax-return-sources.js +191 -0
  357. package/src/lib/plugin-manager/plugin-tax-return-sources.js.map +1 -0
  358. package/src/lib/plugin-manager/plugin-template-sources.d.ts +75 -0
  359. package/src/lib/plugin-manager/plugin-template-sources.js +37 -0
  360. package/src/lib/plugin-manager/plugin-template-sources.js.map +1 -0
  361. package/src/lib/plugin-manager/plugin-usage-axes.d.ts +319 -0
  362. package/src/lib/plugin-manager/plugin-usage-axes.js +186 -0
  363. package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -0
  364. package/src/lib/plugin-manager/plugin-usage-meters.d.ts +108 -0
  365. package/src/lib/plugin-manager/plugin-usage-meters.js +105 -0
  366. package/src/lib/plugin-manager/plugin-usage-meters.js.map +1 -0
  367. package/src/lib/plugin-manager/plugin-zones.d.ts +4 -5
  368. package/src/lib/plugin-manager/plugin-zones.js.map +1 -1
  369. package/src/lib/plugin-manager/realm-host-aglyn.generated.js +2 -0
  370. package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
  371. package/src/lib/plugin-manager/record-captured-contact.d.ts +1 -14
  372. package/src/lib/plugin-manager/record-captured-contact.js +10 -32
  373. package/src/lib/plugin-manager/record-captured-contact.js.map +1 -1
  374. package/src/lib/plugin-manager/repeat-rows.d.ts +124 -0
  375. package/src/lib/plugin-manager/repeat-rows.js +108 -0
  376. package/src/lib/plugin-manager/repeat-rows.js.map +1 -0
  377. package/src/lib/plugin-manager/submission-record-target.d.ts +144 -0
  378. package/src/lib/plugin-manager/submission-record-target.js +125 -0
  379. package/src/lib/plugin-manager/submission-record-target.js.map +1 -0
  380. package/src/lib/plugin-manager/usage-alert-contributors.d.ts +76 -6
  381. package/src/lib/plugin-manager/usage-alert-contributors.js +23 -10
  382. package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -1
  383. package/src/lib/plugin-manager/video-embed-provider.d.ts +108 -0
  384. package/src/lib/plugin-manager/video-embed-provider.js +165 -0
  385. package/src/lib/plugin-manager/video-embed-provider.js.map +1 -0
  386. package/src/lib/types/nodes.d.ts +2 -2
  387. package/src/lib/types/nodes.js.map +1 -1
  388. package/src/lib/app-utils/assist-credits.d.ts +0 -482
  389. package/src/lib/app-utils/assist-credits.js +0 -509
  390. package/src/lib/app-utils/assist-credits.js.map +0 -1
  391. package/src/lib/app-utils/campaign-attribution.js.map +0 -1
  392. package/src/lib/app-utils/campaign-forwarding.js.map +0 -1
  393. package/src/lib/app-utils/campaign-membership.d.ts +0 -121
  394. package/src/lib/app-utils/campaign-membership.js +0 -189
  395. package/src/lib/app-utils/campaign-membership.js.map +0 -1
  396. package/src/lib/app-utils/campaign-touch.js.map +0 -1
  397. package/src/lib/app-utils/console-record-links.d.ts +0 -163
  398. package/src/lib/app-utils/console-record-links.js +0 -180
  399. package/src/lib/app-utils/console-record-links.js.map +0 -1
  400. package/src/lib/app-utils/contact-holder.d.ts +0 -68
  401. package/src/lib/app-utils/contact-holder.js +0 -129
  402. package/src/lib/app-utils/contact-holder.js.map +0 -1
  403. package/src/lib/app-utils/contact-merge.d.ts +0 -136
  404. package/src/lib/app-utils/contact-merge.js +0 -412
  405. package/src/lib/app-utils/contact-merge.js.map +0 -1
  406. package/src/lib/app-utils/crm-booking.d.ts +0 -75
  407. package/src/lib/app-utils/crm-booking.js +0 -133
  408. package/src/lib/app-utils/crm-booking.js.map +0 -1
  409. package/src/lib/app-utils/crm-csv.d.ts +0 -239
  410. package/src/lib/app-utils/crm-csv.js +0 -467
  411. package/src/lib/app-utils/crm-csv.js.map +0 -1
  412. package/src/lib/app-utils/crm-digest.d.ts +0 -185
  413. package/src/lib/app-utils/crm-digest.js +0 -272
  414. package/src/lib/app-utils/crm-digest.js.map +0 -1
  415. package/src/lib/app-utils/crm-inbound.d.ts +0 -245
  416. package/src/lib/app-utils/crm-inbound.js +0 -407
  417. package/src/lib/app-utils/crm-inbound.js.map +0 -1
  418. package/src/lib/app-utils/crm-reports.d.ts +0 -479
  419. package/src/lib/app-utils/crm-reports.js +0 -680
  420. package/src/lib/app-utils/crm-reports.js.map +0 -1
  421. package/src/lib/app-utils/dataset-csv.js.map +0 -1
  422. package/src/lib/app-utils/dataset-query.d.ts +0 -57
  423. package/src/lib/app-utils/dataset-query.js.map +0 -1
  424. package/src/lib/app-utils/email-topics.js.map +0 -1
  425. package/src/lib/app-utils/form-dataset-binding.d.ts +0 -50
  426. package/src/lib/app-utils/form-dataset-binding.js +0 -74
  427. package/src/lib/app-utils/form-dataset-binding.js.map +0 -1
  428. package/src/lib/app-utils/list-assignment-policy.js.map +0 -1
  429. package/src/lib/app-utils/list-import.d.ts +0 -158
  430. package/src/lib/app-utils/list-import.js +0 -332
  431. package/src/lib/app-utils/list-import.js.map +0 -1
  432. package/src/lib/app-utils/marketplace-listing-visibility.d.ts +0 -122
  433. package/src/lib/app-utils/marketplace-listing-visibility.js +0 -147
  434. package/src/lib/app-utils/marketplace-listing-visibility.js.map +0 -1
  435. package/src/lib/app-utils/marketplace-overrides.js.map +0 -1
  436. package/src/lib/app-utils/marketplace-provenance.js.map +0 -1
  437. package/src/lib/app-utils/marketplace-theme.js.map +0 -1
  438. package/src/lib/app-utils/marketplace-update-state.d.ts +0 -119
  439. package/src/lib/app-utils/marketplace-update-state.js +0 -132
  440. package/src/lib/app-utils/marketplace-update-state.js.map +0 -1
  441. package/src/lib/app-utils/publisher-agreement.d.ts +0 -289
  442. package/src/lib/app-utils/publisher-agreement.js +0 -321
  443. package/src/lib/app-utils/publisher-agreement.js.map +0 -1
  444. package/src/lib/app-utils/wistia-embed.d.ts +0 -104
  445. package/src/lib/app-utils/wistia-embed.js +0 -138
  446. package/src/lib/app-utils/wistia-embed.js.map +0 -1
  447. package/src/lib/app-utils/workflows.d.ts +0 -136
  448. package/src/lib/app-utils/workflows.js +0 -346
  449. package/src/lib/app-utils/workflows.js.map +0 -1
  450. package/src/lib/plugin-manager/commerce-zone-props.d.ts +0 -172
  451. package/src/lib/plugin-manager/commerce-zone-props.js +0 -31
  452. package/src/lib/plugin-manager/commerce-zone-props.js.map +0 -1
  453. package/src/lib/plugin-manager/plugin-metered-lines.d.ts +0 -97
  454. package/src/lib/plugin-manager/plugin-metered-lines.js +0 -123
  455. package/src/lib/plugin-manager/plugin-metered-lines.js.map +0 -1
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { ReleaseFlagKey } from '../app-utils/release-flags';
18
+ /** What the sweep tells a meter about one workspace's month. */
19
+ export interface PluginUsageMeterContext {
20
+ orgId: string;
21
+ /** The workspace document, as the sweep read it for every decision. */
22
+ org: Readonly<Record<string, unknown>>;
23
+ /** `YYYY-MM`, the month being measured. */
24
+ month: string;
25
+ /**
26
+ * Whether the month has CLOSED. A closed month is the one an invoice is
27
+ * about; an open one is measured daily for the budget and never billed.
28
+ */
29
+ closed: boolean;
30
+ /**
31
+ * The month's rollup as it stood before this run — for a stock meter, the
32
+ * last reading an earlier sweep stamped inside the month.
33
+ */
34
+ previous: Readonly<Record<string, unknown>>;
35
+ /**
36
+ * A release flag's verdict for this workspace, resolved as the sweep
37
+ * resolves every flag it gates billing on: bucketed by workspace, with its
38
+ * overrides and its tier.
39
+ */
40
+ releaseFlagOn: (key: ReleaseFlagKey) => boolean;
41
+ }
42
+ /** What a meter answers for one workspace's month. */
43
+ export interface PluginUsageMeterReading {
44
+ /**
45
+ * Written onto the month's rollup on every run, zeros included. A field the
46
+ * platform writes itself is never overwritten.
47
+ */
48
+ fields: Readonly<Record<string, unknown>>;
49
+ /**
50
+ * Written only while the month is OPEN — a stock meter's period-end reading,
51
+ * which a closed sweep then bills from. Never written for a closed month,
52
+ * so a re-run of a closed month reads the same input every time.
53
+ */
54
+ periodEndFields?: Readonly<Record<string, unknown>>;
55
+ /**
56
+ * Dollars that enter the month's billed figure. Rounded to cents per meter,
57
+ * like every plan-priced line beside it; 0 for a meter that bills nothing.
58
+ */
59
+ billedUsd: number;
60
+ /**
61
+ * For a stock meter on a CLOSED month: `true` when the reading came from a
62
+ * period-end stamp taken inside the month. The rollup's `stockBasis` is
63
+ * `period-end` when any stock reading was.
64
+ */
65
+ periodEndBasis?: boolean;
66
+ }
67
+ /** What a meter's close-out is told about one workspace's closed month. */
68
+ export interface PluginUsageMeterCloseContext extends PluginUsageMeterContext {
69
+ /**
70
+ * The workspace's Stripe customer, or `null` when it has none. Read only
71
+ * when asked, so a close-out with nothing to settle costs no read.
72
+ */
73
+ stripeCustomerId: () => Promise<string | null>;
74
+ }
75
+ /** A plugin's meter in the monthly usage sweep. */
76
+ export interface PluginUsageMeter {
77
+ pluginId: string;
78
+ /** As the plugin's `usageAxes` declaration names it under `meters`. */
79
+ id: string;
80
+ measure: (context: PluginUsageMeterContext) => Promise<PluginUsageMeterReading>;
81
+ /**
82
+ * Called once per workspace for a CLOSED month, every day the sweep runs,
83
+ * so a plugin that bills part of its usage itself can settle what is left
84
+ * of it. Idempotent by the plugin's own records; errors are logged.
85
+ */
86
+ closeMonth?: (context: PluginUsageMeterCloseContext) => Promise<void>;
87
+ }
88
+ /**
89
+ * Registers a meter. Idempotent per plugin and id: the same pair again
90
+ * replaces the earlier registration, so a declarations module evaluated twice
91
+ * measures once. A meter with no owner, no id or no `measure` throws.
92
+ */
93
+ export declare function registerPluginUsageMeter(meter: Omit<PluginUsageMeter, 'pluginId'> & {
94
+ pluginId?: string;
95
+ }): void;
96
+ /**
97
+ * Every registered meter, in the order the sweep runs them: declared meters in
98
+ * catalog order, then any other in registration order. The order is fixed so
99
+ * two processes write one workspace's rollup the same way.
100
+ */
101
+ export declare function listPluginUsageMeters(): PluginUsageMeter[];
102
+ /**
103
+ * Every DECLARED meter nothing registered, as `pluginId:id`. The sweep refuses
104
+ * to report a workspace's month while this is not empty.
105
+ */
106
+ export declare function unregisteredPluginUsageMeters(): string[];
107
+ /** Test seam: forget every meter. */
108
+ export declare function resetPluginUsageMetersForTests(): void;
@@ -0,0 +1,105 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /**
3
+ * @license
4
+ * Copyright 2026 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ /**
18
+ * A METER A PLUGIN MEASURES IN THE MONTHLY USAGE SWEEP (AGL-3080).
19
+ *
20
+ * The usage sweep (`/api/billing/report-usage`) writes one rollup per
21
+ * workspace and month — `orgs/{orgId}/usage/{month}` — and posts the month's
22
+ * billed figure as one Stripe meter event. The platform's own meters (storage,
23
+ * bandwidth, API requests, email) it measures itself. A plugin's meter it
24
+ * cannot: the plugin owns the collection the usage is recorded in, the band
25
+ * it is measured against and the price past the band.
26
+ *
27
+ * So the plugin registers a meter, and the sweep asks it once per workspace:
28
+ * `measure` answers the fields the plugin writes onto the rollup — under the
29
+ * names its usage axes declare, so the cost model and the utilization table
30
+ * read them — and the dollars that enter the month's billed figure. The sweep
31
+ * never learns what the meter counts or how it prices it, and the plugin
32
+ * never edits the sweep.
33
+ *
34
+ * ## Declared, then registered, and refused when missing
35
+ *
36
+ * A meter is a runtime registration because measuring is code — a read of the
37
+ * plugin's own storage, a band, a price. But a meter that failed to register
38
+ * is money the sweep would silently stop billing, so the plugin also DECLARES
39
+ * it (`usageAxes` → `meters`, compiled into the catalog file), and the sweep
40
+ * refuses to report a workspace's month while a declared meter is missing:
41
+ * the workspace fails loudly for this pass and is swept again tomorrow, which
42
+ * is late and visible, where a month billed without the meter would be short
43
+ * and final.
44
+ *
45
+ * ## A throw is the workspace's, not the sweep's
46
+ *
47
+ * `measure` throwing fails that workspace's pass the same way — a meter that
48
+ * could not measure has no figure worth billing. `closeMonth` is different:
49
+ * it settles what the plugin bills on its own, is logged when it fails, and
50
+ * never costs the platform's own metering.
51
+ */ import { getRegisteringPluginId } from "../app-utils/registering-plugin.js";
52
+ import { PLUGIN_USAGE_METERS_DECLARED } from "./first-party-plugins.generated.js";
53
+ const meters = new Map();
54
+ const keyOf = (pluginId, id)=>`${pluginId}:${id}`;
55
+ /**
56
+ * Registers a meter. Idempotent per plugin and id: the same pair again
57
+ * replaces the earlier registration, so a declarations module evaluated twice
58
+ * measures once. A meter with no owner, no id or no `measure` throws.
59
+ */ export function registerPluginUsageMeter(meter) {
60
+ var _ref, _getRegisteringPluginId, _meter_id;
61
+ const pluginId = ((_ref = (_getRegisteringPluginId = getRegisteringPluginId()) != null ? _getRegisteringPluginId : meter.pluginId) != null ? _ref : '').trim();
62
+ const id = String((_meter_id = meter.id) != null ? _meter_id : '').trim();
63
+ if (!pluginId || !id) {
64
+ throw new Error('a usage meter needs a pluginId and an id');
65
+ }
66
+ if (typeof meter.measure !== 'function') {
67
+ throw new Error(`usage meter "${keyOf(pluginId, id)}" has no measure function`);
68
+ }
69
+ meters.set(keyOf(pluginId, id), _extends({
70
+ pluginId,
71
+ id,
72
+ measure: meter.measure
73
+ }, typeof meter.closeMonth === 'function' ? {
74
+ closeMonth: meter.closeMonth
75
+ } : {}));
76
+ }
77
+ /**
78
+ * Every registered meter, in the order the sweep runs them: declared meters in
79
+ * catalog order, then any other in registration order. The order is fixed so
80
+ * two processes write one workspace's rollup the same way.
81
+ */ export function listPluginUsageMeters() {
82
+ const declared = PLUGIN_USAGE_METERS_DECLARED.map((one)=>keyOf(one.pluginId, one.id));
83
+ const rank = (key)=>{
84
+ const index = declared.indexOf(key);
85
+ return index === -1 ? Number.MAX_SAFE_INTEGER : index;
86
+ };
87
+ return [
88
+ ...meters.entries()
89
+ ].map(([key, meter], sequence)=>({
90
+ key,
91
+ meter,
92
+ sequence
93
+ })).sort((a, b)=>rank(a.key) - rank(b.key) || a.sequence - b.sequence).map(({ meter })=>_extends({}, meter));
94
+ }
95
+ /**
96
+ * Every DECLARED meter nothing registered, as `pluginId:id`. The sweep refuses
97
+ * to report a workspace's month while this is not empty.
98
+ */ export function unregisteredPluginUsageMeters() {
99
+ return PLUGIN_USAGE_METERS_DECLARED.map((one)=>keyOf(one.pluginId, one.id)).filter((key)=>!meters.has(key));
100
+ }
101
+ /** Test seam: forget every meter. */ export function resetPluginUsageMetersForTests() {
102
+ meters.clear();
103
+ }
104
+
105
+ //# sourceMappingURL=plugin-usage-meters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-usage-meters.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A METER A PLUGIN MEASURES IN THE MONTHLY USAGE SWEEP (AGL-3080).\n *\n * The usage sweep (`/api/billing/report-usage`) writes one rollup per\n * workspace and month — `orgs/{orgId}/usage/{month}` — and posts the month's\n * billed figure as one Stripe meter event. The platform's own meters (storage,\n * bandwidth, API requests, email) it measures itself. A plugin's meter it\n * cannot: the plugin owns the collection the usage is recorded in, the band\n * it is measured against and the price past the band.\n *\n * So the plugin registers a meter, and the sweep asks it once per workspace:\n * `measure` answers the fields the plugin writes onto the rollup — under the\n * names its usage axes declare, so the cost model and the utilization table\n * read them — and the dollars that enter the month's billed figure. The sweep\n * never learns what the meter counts or how it prices it, and the plugin\n * never edits the sweep.\n *\n * ## Declared, then registered, and refused when missing\n *\n * A meter is a runtime registration because measuring is code — a read of the\n * plugin's own storage, a band, a price. But a meter that failed to register\n * is money the sweep would silently stop billing, so the plugin also DECLARES\n * it (`usageAxes` → `meters`, compiled into the catalog file), and the sweep\n * refuses to report a workspace's month while a declared meter is missing:\n * the workspace fails loudly for this pass and is swept again tomorrow, which\n * is late and visible, where a month billed without the meter would be short\n * and final.\n *\n * ## A throw is the workspace's, not the sweep's\n *\n * `measure` throwing fails that workspace's pass the same way — a meter that\n * could not measure has no figure worth billing. `closeMonth` is different:\n * it settles what the plugin bills on its own, is logged when it fails, and\n * never costs the platform's own metering.\n */\n\nimport { getRegisteringPluginId } from '../app-utils/registering-plugin'\nimport type { ReleaseFlagKey } from '../app-utils/release-flags'\nimport { PLUGIN_USAGE_METERS_DECLARED } from './first-party-plugins.generated'\n\n/** What the sweep tells a meter about one workspace's month. */\nexport interface PluginUsageMeterContext {\n orgId: string\n /** The workspace document, as the sweep read it for every decision. */\n org: Readonly<Record<string, unknown>>\n /** `YYYY-MM`, the month being measured. */\n month: string\n /**\n * Whether the month has CLOSED. A closed month is the one an invoice is\n * about; an open one is measured daily for the budget and never billed.\n */\n closed: boolean\n /**\n * The month's rollup as it stood before this run — for a stock meter, the\n * last reading an earlier sweep stamped inside the month.\n */\n previous: Readonly<Record<string, unknown>>\n /**\n * A release flag's verdict for this workspace, resolved as the sweep\n * resolves every flag it gates billing on: bucketed by workspace, with its\n * overrides and its tier.\n */\n releaseFlagOn: (key: ReleaseFlagKey) => boolean\n}\n\n/** What a meter answers for one workspace's month. */\nexport interface PluginUsageMeterReading {\n /**\n * Written onto the month's rollup on every run, zeros included. A field the\n * platform writes itself is never overwritten.\n */\n fields: Readonly<Record<string, unknown>>\n /**\n * Written only while the month is OPEN — a stock meter's period-end reading,\n * which a closed sweep then bills from. Never written for a closed month,\n * so a re-run of a closed month reads the same input every time.\n */\n periodEndFields?: Readonly<Record<string, unknown>>\n /**\n * Dollars that enter the month's billed figure. Rounded to cents per meter,\n * like every plan-priced line beside it; 0 for a meter that bills nothing.\n */\n billedUsd: number\n /**\n * For a stock meter on a CLOSED month: `true` when the reading came from a\n * period-end stamp taken inside the month. The rollup's `stockBasis` is\n * `period-end` when any stock reading was.\n */\n periodEndBasis?: boolean\n}\n\n/** What a meter's close-out is told about one workspace's closed month. */\nexport interface PluginUsageMeterCloseContext extends PluginUsageMeterContext {\n /**\n * The workspace's Stripe customer, or `null` when it has none. Read only\n * when asked, so a close-out with nothing to settle costs no read.\n */\n stripeCustomerId: () => Promise<string | null>\n}\n\n/** A plugin's meter in the monthly usage sweep. */\nexport interface PluginUsageMeter {\n pluginId: string\n /** As the plugin's `usageAxes` declaration names it under `meters`. */\n id: string\n measure: (context: PluginUsageMeterContext) => Promise<PluginUsageMeterReading>\n /**\n * Called once per workspace for a CLOSED month, every day the sweep runs,\n * so a plugin that bills part of its usage itself can settle what is left\n * of it. Idempotent by the plugin's own records; errors are logged.\n */\n closeMonth?: (context: PluginUsageMeterCloseContext) => Promise<void>\n}\n\nconst meters = new Map<string, PluginUsageMeter>()\n\nconst keyOf = (pluginId: string, id: string) => `${pluginId}:${id}`\n\n/**\n * Registers a meter. Idempotent per plugin and id: the same pair again\n * replaces the earlier registration, so a declarations module evaluated twice\n * measures once. A meter with no owner, no id or no `measure` throws.\n */\nexport function registerPluginUsageMeter(\n meter: Omit<PluginUsageMeter, 'pluginId'> & { pluginId?: string },\n): void {\n const pluginId = (getRegisteringPluginId() ?? meter.pluginId ?? '').trim()\n const id = String(meter.id ?? '').trim()\n if (!pluginId || !id) {\n throw new Error('a usage meter needs a pluginId and an id')\n }\n if (typeof meter.measure !== 'function') {\n throw new Error(`usage meter \"${keyOf(pluginId, id)}\" has no measure function`)\n }\n meters.set(keyOf(pluginId, id), {\n pluginId,\n id,\n measure: meter.measure,\n ...(typeof meter.closeMonth === 'function'\n ? { closeMonth: meter.closeMonth }\n : {}),\n })\n}\n\n/**\n * Every registered meter, in the order the sweep runs them: declared meters in\n * catalog order, then any other in registration order. The order is fixed so\n * two processes write one workspace's rollup the same way.\n */\nexport function listPluginUsageMeters(): PluginUsageMeter[] {\n const declared = PLUGIN_USAGE_METERS_DECLARED.map((one) =>\n keyOf(one.pluginId, one.id),\n )\n const rank = (key: string) => {\n const index = declared.indexOf(key)\n return index === -1 ? Number.MAX_SAFE_INTEGER : index\n }\n return [...meters.entries()]\n .map(([key, meter], sequence) => ({ key, meter, sequence }))\n .sort((a, b) => rank(a.key) - rank(b.key) || a.sequence - b.sequence)\n .map(({ meter }) => ({ ...meter }))\n}\n\n/**\n * Every DECLARED meter nothing registered, as `pluginId:id`. The sweep refuses\n * to report a workspace's month while this is not empty.\n */\nexport function unregisteredPluginUsageMeters(): string[] {\n return PLUGIN_USAGE_METERS_DECLARED.map((one) =>\n keyOf(one.pluginId, one.id),\n ).filter((key) => !meters.has(key))\n}\n\n/** Test seam: forget every meter. */\nexport function resetPluginUsageMetersForTests(): void {\n meters.clear()\n}\n"],"names":["getRegisteringPluginId","PLUGIN_USAGE_METERS_DECLARED","meters","Map","keyOf","pluginId","id","registerPluginUsageMeter","meter","trim","String","Error","measure","set","closeMonth","listPluginUsageMeters","declared","map","one","rank","key","index","indexOf","Number","MAX_SAFE_INTEGER","entries","sequence","sort","a","b","unregisteredPluginUsageMeters","filter","has","resetPluginUsageMetersForTests","clear"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCC,GAED,SAASA,sBAAsB,QAAQ,qCAAiC;AAExE,SAASC,4BAA4B,QAAQ,qCAAiC;AA4E9E,MAAMC,SAAS,IAAIC;AAEnB,MAAMC,QAAQ,CAACC,UAAkBC,KAAe,GAAGD,SAAS,CAAC,EAAEC,IAAI;AAEnE;;;;CAIC,GACD,OAAO,SAASC,yBACdC,KAAiE;QAE/CR,MAAAA,yBACAQ;IADlB,MAAMH,WAAW,EAACL,QAAAA,0BAAAA,oCAAAA,0BAA4BQ,MAAMH,QAAQ,YAA1CL,OAA8C,IAAIS,IAAI;IACxE,MAAMH,KAAKI,QAAOF,YAAAA,MAAMF,EAAE,YAARE,YAAY,IAAIC,IAAI;IACtC,IAAI,CAACJ,YAAY,CAACC,IAAI;QACpB,MAAM,IAAIK,MAAM;IAClB;IACA,IAAI,OAAOH,MAAMI,OAAO,KAAK,YAAY;QACvC,MAAM,IAAID,MAAM,CAAC,aAAa,EAAEP,MAAMC,UAAUC,IAAI,yBAAyB,CAAC;IAChF;IACAJ,OAAOW,GAAG,CAACT,MAAMC,UAAUC,KAAK;QAC9BD;QACAC;QACAM,SAASJ,MAAMI,OAAO;OAClB,OAAOJ,MAAMM,UAAU,KAAK,aAC5B;QAAEA,YAAYN,MAAMM,UAAU;IAAC,IAC/B,CAAC;AAET;AAEA;;;;CAIC,GACD,OAAO,SAASC;IACd,MAAMC,WAAWf,6BAA6BgB,GAAG,CAAC,CAACC,MACjDd,MAAMc,IAAIb,QAAQ,EAAEa,IAAIZ,EAAE;IAE5B,MAAMa,OAAO,CAACC;QACZ,MAAMC,QAAQL,SAASM,OAAO,CAACF;QAC/B,OAAOC,UAAU,CAAC,IAAIE,OAAOC,gBAAgB,GAAGH;IAClD;IACA,OAAO;WAAInB,OAAOuB,OAAO;KAAG,CACzBR,GAAG,CAAC,CAAC,CAACG,KAAKZ,MAAM,EAAEkB,WAAc,CAAA;YAAEN;YAAKZ;YAAOkB;QAAS,CAAA,GACxDC,IAAI,CAAC,CAACC,GAAGC,IAAMV,KAAKS,EAAER,GAAG,IAAID,KAAKU,EAAET,GAAG,KAAKQ,EAAEF,QAAQ,GAAGG,EAAEH,QAAQ,EACnET,GAAG,CAAC,CAAC,EAAET,KAAK,EAAE,GAAM,aAAKA;AAC9B;AAEA;;;CAGC,GACD,OAAO,SAASsB;IACd,OAAO7B,6BAA6BgB,GAAG,CAAC,CAACC,MACvCd,MAAMc,IAAIb,QAAQ,EAAEa,IAAIZ,EAAE,GAC1ByB,MAAM,CAAC,CAACX,MAAQ,CAAClB,OAAO8B,GAAG,CAACZ;AAChC;AAEA,mCAAmC,GACnC,OAAO,SAASa;IACd/B,OAAOgC,KAAK;AACd"}
@@ -21,10 +21,9 @@
21
21
  * a slot id has always been an open string, so a plugin could already host a
22
22
  * zone of its own. What it could not do is say what that zone HANDS a widget.
23
23
  * The props had to be a type, the type had to be somewhere both sides import,
24
- * and "somewhere both sides import" was read as the core — which is how
25
- * `plugin-manager/commerce-zone-props.ts` and `plugin-manager/record-zone-props.ts`
26
- * came to spell out the commerce catalog and the record vocabulary of two
27
- * named plugins inside the platform.
24
+ * and "somewhere both sides import" was read as the core — which is how a
25
+ * named plugin's catalog or record vocabulary comes to be spelled out inside
26
+ * the platform.
28
27
  *
29
28
  * So the declaration moves to the plugin. A plugin defines a token for its
30
29
  * zone with {@link definePluginZone}, carrying the props type on the token,
@@ -36,7 +35,7 @@
36
35
  *
37
36
  * A zone token is `{ id }` and nothing else: `__props` is a phantom field that
38
37
  * never holds a value, so the props type is carried at the type level and
39
- * erased. That is the same trick the two type-only modules above use, and it
38
+ * erased. That is the same trick a type-only props module uses, and it
40
39
  * is load-bearing rather than tidy — AGL-3082 measured the zone catalog on the
41
40
  * published page's static graph, and a declaration that put a plugin's prop
42
41
  * SHAPES there would have made every published page carry the console's
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-zones.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getRegisteringPluginId } from '../app-utils/registering-plugin'\nimport {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginServices,\n} from './plugin-services'\n\n/**\n * A zone a plugin declares, and the props it hands each widget (AGL-3124).\n *\n * `CONSOLE_WIDGET_SLOTS` is the catalog of zones the console SHELL draws, and\n * a slot id has always been an open string, so a plugin could already host a\n * zone of its own. What it could not do is say what that zone HANDS a widget.\n * The props had to be a type, the type had to be somewhere both sides import,\n * and \"somewhere both sides import\" was read as the core — which is how\n * `plugin-manager/commerce-zone-props.ts` and `plugin-manager/record-zone-props.ts`\n * came to spell out the commerce catalog and the record vocabulary of two\n * named plugins inside the platform.\n *\n * So the declaration moves to the plugin. A plugin defines a token for its\n * zone with {@link definePluginZone}, carrying the props type on the token,\n * and registers it here with a label and the surface it is drawn on. A widget\n * author takes the props type off the token — `PluginZoneProps<typeof ZONE>`\n * — without the core ever naming a product, a deal or a lead.\n *\n * ## Nothing here reaches a published page\n *\n * A zone token is `{ id }` and nothing else: `__props` is a phantom field that\n * never holds a value, so the props type is carried at the type level and\n * erased. That is the same trick the two type-only modules above use, and it\n * is load-bearing rather than tidy — AGL-3082 measured the zone catalog on the\n * published page's static graph, and a declaration that put a plugin's prop\n * SHAPES there would have made every published page carry the console's\n * vocabulary. `plugin-zones.spec.ts` pins the token's own key set so a field\n * added to it later has to be a decision.\n *\n * This module is reached by its own subpath and is deliberately absent from\n * `plugin-manager/index.ts`, for the reason that barrel already states about\n * `plugin-figures`: what a published page does not need, it must not import.\n *\n * ## One zone id, one owner\n *\n * A zone is a position on a page somebody draws. Two plugins declaring the\n * same id would each believe they set what a widget there receives, and the\n * widget author would have no way to tell whose props arrived — so a second\n * plugin's declaration is refused naming both, and the incumbent keeps its\n * zone. The same plugin declaring again — a second surface, a hot reload —\n * replaces its own.\n */\n\n/**\n * A zone's identity, with the props it hands a widget carried at the type\n * level. `__props` never holds a value.\n */\nexport interface PluginZone<Props> {\n readonly id: string\n readonly __props?: Props\n}\n\n/** The props a zone hands each widget, read off its token. */\nexport type PluginZoneProps<Zone> = Zone extends PluginZone<infer Props>\n ? Props\n : never\n\n/**\n * A zone token. Pure: it allocates no registration and reads no registry, so\n * a plugin may define one at module scope and register it from its register\n * fn, where the loader's owner marker is set.\n */\nexport function definePluginZone<Props>(id: string): PluginZone<Props> {\n const zoneId = id.trim()\n if (!zoneId) throw new Error('a plugin zone needs an id')\n return { id: zoneId }\n}\n\n/** Where a zone is drawn, which is what decides the gates around it. */\nexport type PluginZoneSurface = 'console' | 'besigner' | 'site'\n\nexport interface PluginZoneDeclaration<Props = unknown> {\n zone: PluginZone<Props>\n /** What the plugin's own manifest and the widget picker call the zone. */\n label: string\n /** The surface the zone is drawn on. */\n surface: PluginZoneSurface\n /**\n * What a widget here may do, and what it may not — the sentence a widget\n * author reads before writing one. Every zone in the core catalog carries\n * the same distinction (a widget proposes, the host writes), and a plugin's\n * zone owes its widgets the same statement.\n */\n description?: string\n /**\n * How the zone places its widgets. `stack`, the default, is one block of\n * the page: its widgets are cards, spaced, and the block takes no room when\n * nothing in it drew. `bare` adds no element of its own: every widget is one\n * item of a layout the HOST draws — a button in a row of actions, a control\n * beside a form's fields, a dialog that portals out of the page. A wrapper\n * would put every button of a row into one column.\n */\n layout?: PluginZoneLayout\n}\n\n/** See {@link PluginZoneDeclaration.layout}. */\nexport type PluginZoneLayout = 'stack' | 'bare'\n\n/** A declaration with the plugin that made it. */\nexport type ResolvedPluginZone = PluginZoneDeclaration<unknown> & {\n pluginId: string\n}\n\nexport const PLUGIN_ZONES = definePluginServiceContract<\n PluginZoneDeclaration<never>\n>('core.zones', { multiple: true })\n\n/**\n * Declares a zone the registering plugin hosts. The owner is the loader's\n * marker when a register fn is running, else `options.pluginId`; with neither\n * the registration throws. A zone id another plugin declared throws naming\n * both.\n */\nexport function registerPluginZone<Props>(\n declaration: PluginZoneDeclaration<Props>,\n options?: { pluginId?: string },\n): void {\n const key = declaration.zone?.id?.trim() ?? ''\n if (!key) throw new Error('a plugin zone needs an id')\n if (!declaration.label?.trim()) {\n throw new Error(`plugin zone \"${key}\" needs a label`)\n }\n const pluginId = (getRegisteringPluginId() ?? options?.pluginId ?? '').trim()\n const incumbent = resolvePluginServices(PLUGIN_ZONES).find(\n (entry) => entry.key === key,\n )\n if (incumbent && pluginId && incumbent.pluginId !== pluginId) {\n throw new Error(\n `zone \"${key}\" is already declared by \"${incumbent.pluginId}\"; ` +\n `refused \"${pluginId}\"`,\n )\n }\n registerPluginService(\n PLUGIN_ZONES,\n declaration as unknown as PluginZoneDeclaration<never>,\n {\n ...(options?.pluginId ? { pluginId: options.pluginId } : {}),\n key,\n },\n )\n}\n\n/** Every declared zone, with its owner, in registration order. */\nexport function listPluginZones(): ResolvedPluginZone[] {\n return resolvePluginServices(PLUGIN_ZONES).map((entry) => ({\n ...(entry.impl as unknown as PluginZoneDeclaration<unknown>),\n pluginId: entry.pluginId,\n }))\n}\n\n/** One declared zone by id, with its owner, or `null` when nobody declares it. */\nexport function pluginZone(zoneId: string): ResolvedPluginZone | null {\n const key = zoneId.trim()\n const entry = resolvePluginServices(PLUGIN_ZONES).find(\n (one) => one.key === key,\n )\n return entry\n ? {\n ...(entry.impl as unknown as PluginZoneDeclaration<unknown>),\n pluginId: entry.pluginId,\n }\n : null\n}\n\n/** The plugin that declared a zone, for attribution, or `undefined`. */\nexport function pluginIdForZone(zoneId: string): string | undefined {\n return pluginZone(zoneId)?.pluginId\n}\n"],"names":["getRegisteringPluginId","definePluginServiceContract","registerPluginService","resolvePluginServices","definePluginZone","id","zoneId","trim","Error","PLUGIN_ZONES","multiple","registerPluginZone","declaration","options","key","zone","label","pluginId","incumbent","find","entry","listPluginZones","map","impl","pluginZone","one","pluginIdForZone"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,sBAAsB,QAAQ,qCAAiC;AACxE,SACEC,2BAA2B,EAC3BC,qBAAqB,EACrBC,qBAAqB,QAChB,uBAAmB;AA2D1B;;;;CAIC,GACD,OAAO,SAASC,iBAAwBC,EAAU;IAChD,MAAMC,SAASD,GAAGE,IAAI;IACtB,IAAI,CAACD,QAAQ,MAAM,IAAIE,MAAM;IAC7B,OAAO;QAAEH,IAAIC;IAAO;AACtB;AAqCA,OAAO,MAAMG,eAAeR,4BAE1B,cAAc;IAAES,UAAU;AAAK,GAAE;AAEnC;;;;;CAKC,GACD,OAAO,SAASC,mBACdC,WAAyC,EACzCC,OAA+B;cAObb,OAAAA;QALNY,sBAAAA,mBAEPA;IAFL,MAAME,eAAMF,oBAAAA,YAAYG,IAAI,sBAAhBH,uBAAAA,kBAAkBP,EAAE,qBAApBO,qBAAsBL,IAAI,qBAAM;IAC5C,IAAI,CAACO,KAAK,MAAM,IAAIN,MAAM;IAC1B,IAAI,GAACI,qBAAAA,YAAYI,KAAK,qBAAjBJ,mBAAmBL,IAAI,KAAI;QAC9B,MAAM,IAAIC,MAAM,CAAC,aAAa,EAAEM,IAAI,eAAe,CAAC;IACtD;IACA,MAAMG,WAAW,EAACjB,SAAAA,0BAAAA,oCAAAA,0BAA4Ba,2BAAAA,QAASI,QAAQ,YAA7CjB,QAAiD,IAAIO,IAAI;IAC3E,MAAMW,YAAYf,sBAAsBM,cAAcU,IAAI,CACxD,CAACC,QAAUA,MAAMN,GAAG,KAAKA;IAE3B,IAAII,aAAaD,YAAYC,UAAUD,QAAQ,KAAKA,UAAU;QAC5D,MAAM,IAAIT,MACR,CAAC,MAAM,EAAEM,IAAI,0BAA0B,EAAEI,UAAUD,QAAQ,CAAC,GAAG,CAAC,GAC9D,CAAC,SAAS,EAAEA,SAAS,CAAC,CAAC;IAE7B;IACAf,sBACEO,cACAG,aACA,aACMC,CAAAA,2BAAAA,QAASI,QAAQ,IAAG;QAAEA,UAAUJ,QAAQI,QAAQ;IAAC,IAAI,CAAC;QAC1DH;;AAGN;AAEA,gEAAgE,GAChE,OAAO,SAASO;IACd,OAAOlB,sBAAsBM,cAAca,GAAG,CAAC,CAACF,QAAW,aACrDA,MAAMG,IAAI;YACdN,UAAUG,MAAMH,QAAQ;;AAE5B;AAEA,gFAAgF,GAChF,OAAO,SAASO,WAAWlB,MAAc;IACvC,MAAMQ,MAAMR,OAAOC,IAAI;IACvB,MAAMa,QAAQjB,sBAAsBM,cAAcU,IAAI,CACpD,CAACM,MAAQA,IAAIX,GAAG,KAAKA;IAEvB,OAAOM,QACH,aACMA,MAAMG,IAAI;QACdN,UAAUG,MAAMH,QAAQ;SAE1B;AACN;AAEA,sEAAsE,GACtE,OAAO,SAASS,gBAAgBpB,MAAc;QACrCkB;IAAP,QAAOA,cAAAA,WAAWlB,4BAAXkB,YAAoBP,QAAQ;AACrC"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-zones.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getRegisteringPluginId } from '../app-utils/registering-plugin'\nimport {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginServices,\n} from './plugin-services'\n\n/**\n * A zone a plugin declares, and the props it hands each widget (AGL-3124).\n *\n * `CONSOLE_WIDGET_SLOTS` is the catalog of zones the console SHELL draws, and\n * a slot id has always been an open string, so a plugin could already host a\n * zone of its own. What it could not do is say what that zone HANDS a widget.\n * The props had to be a type, the type had to be somewhere both sides import,\n * and \"somewhere both sides import\" was read as the core — which is how a\n * named plugin's catalog or record vocabulary comes to be spelled out inside\n * the platform.\n *\n * So the declaration moves to the plugin. A plugin defines a token for its\n * zone with {@link definePluginZone}, carrying the props type on the token,\n * and registers it here with a label and the surface it is drawn on. A widget\n * author takes the props type off the token — `PluginZoneProps<typeof ZONE>`\n * — without the core ever naming a product, a deal or a lead.\n *\n * ## Nothing here reaches a published page\n *\n * A zone token is `{ id }` and nothing else: `__props` is a phantom field that\n * never holds a value, so the props type is carried at the type level and\n * erased. That is the same trick a type-only props module uses, and it\n * is load-bearing rather than tidy — AGL-3082 measured the zone catalog on the\n * published page's static graph, and a declaration that put a plugin's prop\n * SHAPES there would have made every published page carry the console's\n * vocabulary. `plugin-zones.spec.ts` pins the token's own key set so a field\n * added to it later has to be a decision.\n *\n * This module is reached by its own subpath and is deliberately absent from\n * `plugin-manager/index.ts`, for the reason that barrel already states about\n * `plugin-figures`: what a published page does not need, it must not import.\n *\n * ## One zone id, one owner\n *\n * A zone is a position on a page somebody draws. Two plugins declaring the\n * same id would each believe they set what a widget there receives, and the\n * widget author would have no way to tell whose props arrived — so a second\n * plugin's declaration is refused naming both, and the incumbent keeps its\n * zone. The same plugin declaring again — a second surface, a hot reload —\n * replaces its own.\n */\n\n/**\n * A zone's identity, with the props it hands a widget carried at the type\n * level. `__props` never holds a value.\n */\nexport interface PluginZone<Props> {\n readonly id: string\n readonly __props?: Props\n}\n\n/** The props a zone hands each widget, read off its token. */\nexport type PluginZoneProps<Zone> = Zone extends PluginZone<infer Props>\n ? Props\n : never\n\n/**\n * A zone token. Pure: it allocates no registration and reads no registry, so\n * a plugin may define one at module scope and register it from its register\n * fn, where the loader's owner marker is set.\n */\nexport function definePluginZone<Props>(id: string): PluginZone<Props> {\n const zoneId = id.trim()\n if (!zoneId) throw new Error('a plugin zone needs an id')\n return { id: zoneId }\n}\n\n/** Where a zone is drawn, which is what decides the gates around it. */\nexport type PluginZoneSurface = 'console' | 'besigner' | 'site'\n\nexport interface PluginZoneDeclaration<Props = unknown> {\n zone: PluginZone<Props>\n /** What the plugin's own manifest and the widget picker call the zone. */\n label: string\n /** The surface the zone is drawn on. */\n surface: PluginZoneSurface\n /**\n * What a widget here may do, and what it may not — the sentence a widget\n * author reads before writing one. Every zone in the core catalog carries\n * the same distinction (a widget proposes, the host writes), and a plugin's\n * zone owes its widgets the same statement.\n */\n description?: string\n /**\n * How the zone places its widgets. `stack`, the default, is one block of\n * the page: its widgets are cards, spaced, and the block takes no room when\n * nothing in it drew. `bare` adds no element of its own: every widget is one\n * item of a layout the HOST draws — a button in a row of actions, a control\n * beside a form's fields, a dialog that portals out of the page. A wrapper\n * would put every button of a row into one column.\n */\n layout?: PluginZoneLayout\n}\n\n/** See {@link PluginZoneDeclaration.layout}. */\nexport type PluginZoneLayout = 'stack' | 'bare'\n\n/** A declaration with the plugin that made it. */\nexport type ResolvedPluginZone = PluginZoneDeclaration<unknown> & {\n pluginId: string\n}\n\nexport const PLUGIN_ZONES = definePluginServiceContract<\n PluginZoneDeclaration<never>\n>('core.zones', { multiple: true })\n\n/**\n * Declares a zone the registering plugin hosts. The owner is the loader's\n * marker when a register fn is running, else `options.pluginId`; with neither\n * the registration throws. A zone id another plugin declared throws naming\n * both.\n */\nexport function registerPluginZone<Props>(\n declaration: PluginZoneDeclaration<Props>,\n options?: { pluginId?: string },\n): void {\n const key = declaration.zone?.id?.trim() ?? ''\n if (!key) throw new Error('a plugin zone needs an id')\n if (!declaration.label?.trim()) {\n throw new Error(`plugin zone \"${key}\" needs a label`)\n }\n const pluginId = (getRegisteringPluginId() ?? options?.pluginId ?? '').trim()\n const incumbent = resolvePluginServices(PLUGIN_ZONES).find(\n (entry) => entry.key === key,\n )\n if (incumbent && pluginId && incumbent.pluginId !== pluginId) {\n throw new Error(\n `zone \"${key}\" is already declared by \"${incumbent.pluginId}\"; ` +\n `refused \"${pluginId}\"`,\n )\n }\n registerPluginService(\n PLUGIN_ZONES,\n declaration as unknown as PluginZoneDeclaration<never>,\n {\n ...(options?.pluginId ? { pluginId: options.pluginId } : {}),\n key,\n },\n )\n}\n\n/** Every declared zone, with its owner, in registration order. */\nexport function listPluginZones(): ResolvedPluginZone[] {\n return resolvePluginServices(PLUGIN_ZONES).map((entry) => ({\n ...(entry.impl as unknown as PluginZoneDeclaration<unknown>),\n pluginId: entry.pluginId,\n }))\n}\n\n/** One declared zone by id, with its owner, or `null` when nobody declares it. */\nexport function pluginZone(zoneId: string): ResolvedPluginZone | null {\n const key = zoneId.trim()\n const entry = resolvePluginServices(PLUGIN_ZONES).find(\n (one) => one.key === key,\n )\n return entry\n ? {\n ...(entry.impl as unknown as PluginZoneDeclaration<unknown>),\n pluginId: entry.pluginId,\n }\n : null\n}\n\n/** The plugin that declared a zone, for attribution, or `undefined`. */\nexport function pluginIdForZone(zoneId: string): string | undefined {\n return pluginZone(zoneId)?.pluginId\n}\n"],"names":["getRegisteringPluginId","definePluginServiceContract","registerPluginService","resolvePluginServices","definePluginZone","id","zoneId","trim","Error","PLUGIN_ZONES","multiple","registerPluginZone","declaration","options","key","zone","label","pluginId","incumbent","find","entry","listPluginZones","map","impl","pluginZone","one","pluginIdForZone"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,sBAAsB,QAAQ,qCAAiC;AACxE,SACEC,2BAA2B,EAC3BC,qBAAqB,EACrBC,qBAAqB,QAChB,uBAAmB;AA0D1B;;;;CAIC,GACD,OAAO,SAASC,iBAAwBC,EAAU;IAChD,MAAMC,SAASD,GAAGE,IAAI;IACtB,IAAI,CAACD,QAAQ,MAAM,IAAIE,MAAM;IAC7B,OAAO;QAAEH,IAAIC;IAAO;AACtB;AAqCA,OAAO,MAAMG,eAAeR,4BAE1B,cAAc;IAAES,UAAU;AAAK,GAAE;AAEnC;;;;;CAKC,GACD,OAAO,SAASC,mBACdC,WAAyC,EACzCC,OAA+B;cAObb,OAAAA;QALNY,sBAAAA,mBAEPA;IAFL,MAAME,eAAMF,oBAAAA,YAAYG,IAAI,sBAAhBH,uBAAAA,kBAAkBP,EAAE,qBAApBO,qBAAsBL,IAAI,qBAAM;IAC5C,IAAI,CAACO,KAAK,MAAM,IAAIN,MAAM;IAC1B,IAAI,GAACI,qBAAAA,YAAYI,KAAK,qBAAjBJ,mBAAmBL,IAAI,KAAI;QAC9B,MAAM,IAAIC,MAAM,CAAC,aAAa,EAAEM,IAAI,eAAe,CAAC;IACtD;IACA,MAAMG,WAAW,EAACjB,SAAAA,0BAAAA,oCAAAA,0BAA4Ba,2BAAAA,QAASI,QAAQ,YAA7CjB,QAAiD,IAAIO,IAAI;IAC3E,MAAMW,YAAYf,sBAAsBM,cAAcU,IAAI,CACxD,CAACC,QAAUA,MAAMN,GAAG,KAAKA;IAE3B,IAAII,aAAaD,YAAYC,UAAUD,QAAQ,KAAKA,UAAU;QAC5D,MAAM,IAAIT,MACR,CAAC,MAAM,EAAEM,IAAI,0BAA0B,EAAEI,UAAUD,QAAQ,CAAC,GAAG,CAAC,GAC9D,CAAC,SAAS,EAAEA,SAAS,CAAC,CAAC;IAE7B;IACAf,sBACEO,cACAG,aACA,aACMC,CAAAA,2BAAAA,QAASI,QAAQ,IAAG;QAAEA,UAAUJ,QAAQI,QAAQ;IAAC,IAAI,CAAC;QAC1DH;;AAGN;AAEA,gEAAgE,GAChE,OAAO,SAASO;IACd,OAAOlB,sBAAsBM,cAAca,GAAG,CAAC,CAACF,QAAW,aACrDA,MAAMG,IAAI;YACdN,UAAUG,MAAMH,QAAQ;;AAE5B;AAEA,gFAAgF,GAChF,OAAO,SAASO,WAAWlB,MAAc;IACvC,MAAMQ,MAAMR,OAAOC,IAAI;IACvB,MAAMa,QAAQjB,sBAAsBM,cAAcU,IAAI,CACpD,CAACM,MAAQA,IAAIX,GAAG,KAAKA;IAEvB,OAAOM,QACH,aACMA,MAAMG,IAAI;QACdN,UAAUG,MAAMH,QAAQ;SAE1B;AACN;AAEA,sEAAsE,GACtE,OAAO,SAASS,gBAAgBpB,MAAc;QACrCkB;IAAP,QAAOA,cAAAA,WAAWlB,4BAAXkB,YAAoBP,QAAQ;AACrC"}
@@ -79,6 +79,7 @@ export const AGLYN_HOST_SURFACE = Object.freeze({
79
79
  FieldComponentType: m10.FieldComponentType,
80
80
  FieldValidatorType: m10.FieldValidatorType,
81
81
  LinealDirectiveFlag: m10.LinealDirectiveFlag,
82
+ CONSOLE_SEARCH_LOAD_POINT: m11.CONSOLE_SEARCH_LOAD_POINT,
82
83
  CONSOLE_STAFF_WIDGET_SLOTS: m11.CONSOLE_STAFF_WIDGET_SLOTS,
83
84
  CONSOLE_WIDGET_SLOTS: m11.CONSOLE_WIDGET_SLOTS,
84
85
  MUI_BUNDLE_ID: m11.MUI_BUNDLE_ID,
@@ -89,6 +90,7 @@ export const AGLYN_HOST_SURFACE = Object.freeze({
89
90
  listConsoleNavItems: m11.listConsoleNavItems,
90
91
  listConsoleOrgNavItems: m11.listConsoleOrgNavItems,
91
92
  listConsoleProviders: m11.listConsoleProviders,
93
+ listConsoleSearchSources: m11.listConsoleSearchSources,
92
94
  listConsoleStaffPages: m11.listConsoleStaffPages,
93
95
  listConsoleThemePresets: m11.listConsoleThemePresets,
94
96
  listConsoleWidgets: m11.listConsoleWidgets,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/realm-host-aglyn.generated.ts"],"sourcesContent":["/**\n * GENERATED FILE — do not edit. Regenerate with:\n * node tools/scripts/generate-realm-host-exports.mjs\n *\n * The realm plugin surface of `@aglyn/aglyn` (AGL-3392): what a signed\n * bundle reads from core. Imported only by the lazily loaded host module.\n */\n/* eslint-disable */\n\nimport * as m0 from \"../aglyn\"\nimport * as m1 from \"../app-utils/binding-tokens\"\nimport * as m2 from \"../app-utils/enabled-plugins-context\"\nimport * as m3 from \"../app-utils/functions\"\nimport * as m4 from \"../app-utils/node-identity\"\nimport * as m5 from \"../app-utils/screen-link-context-value\"\nimport * as m6 from \"../app-utils/site-context\"\nimport * as m7 from \"../app-utils/variables\"\nimport * as m8 from \"../foundation/constants/components\"\nimport * as m9 from \"../foundation/constants/shared\"\nimport * as m10 from \"../foundation/definitions/components.types\"\nimport * as m11 from \"./feature-plugins\"\nimport * as m12 from \"../types/nodes\"\n\nexport const AGLYN_HOST_SURFACE: Readonly<Record<string, unknown>> = Object.freeze({\n Aglyn: m0.Aglyn,\n aglyn: m0.aglyn,\n canvas: m0.canvas,\n components: m0.components,\n emitter: m0.emitter,\n logger: m0.logger,\n plugins: m0.plugins,\n FUNCTION_TOKEN_PATTERN: m1.FUNCTION_TOKEN_PATTERN,\n MISSING_BINDING_LABEL: m1.MISSING_BINDING_LABEL,\n NAME_TOKEN_PATTERN: m1.NAME_TOKEN_PATTERN,\n VARIABLE_ID_TOKEN_PATTERN: m1.VARIABLE_ID_TOKEN_PATTERN,\n bindingTokenNeedsDeep: m1.bindingTokenNeedsDeep,\n displayBindingTokens: m1.displayBindingTokens,\n editableBindingTokens: m1.editableBindingTokens,\n formatFunctionIdToken: m1.formatFunctionIdToken,\n formatVariableIdToken: m1.formatVariableIdToken,\n keyById: m1.keyById,\n nodesReferenceBinding: m1.nodesReferenceBinding,\n normalizeBindingTokens: m1.normalizeBindingTokens,\n rewriteBindingTokensDeep: m1.rewriteBindingTokensDeep,\n textReferencesBinding: m1.textReferencesBinding,\n CATEGORY_REQUIRED_CAPABILITY: m2.CATEGORY_REQUIRED_CAPABILITY,\n EnabledPluginsContext: m2.EnabledPluginsContext,\n isCategoryCapabilityEnabled: m2.isCategoryCapabilityEnabled,\n isFromEnabledPlugin: m2.isFromEnabledPlugin,\n isSwitchedOffForRenderedSite: m2.isSwitchedOffForRenderedSite,\n useEnabledPlugins: m2.useEnabledPlugins,\n FUNCTION_BUILTIN_NAMES: m3.FUNCTION_BUILTIN_NAMES,\n FUNCTION_MAX_OPERATIONS: m3.FUNCTION_MAX_OPERATIONS,\n evaluateExpression: m3.evaluateExpression,\n evaluateHostFunction: m3.evaluateHostFunction,\n expressionIdentifiers: m3.expressionIdentifiers,\n formatFunctionParameterOptions: m3.formatFunctionParameterOptions,\n functionReferencedNames: m3.functionReferencedNames,\n parseFunctionParameterOptions: m3.parseFunctionParameterOptions,\n NodeIdentityContext: m4.NodeIdentityContext,\n useNodeId: m4.useNodeId,\n ScreenLinkContext: m5.ScreenLinkContext,\n PREVIEW_REFUSED_STATUS: m6.PREVIEW_REFUSED_STATUS,\n PREVIEW_WRITE_BLOCKED_EVENT: m6.PREVIEW_WRITE_BLOCKED_EVENT,\n SiteContext: m6.SiteContext,\n isPreviewRefusal: m6.isPreviewRefusal,\n useSite: m6.useSite,\n useSiteFetch: m6.useSiteFetch,\n HOST_VARIABLE_TYPE_LABELS: m7.HOST_VARIABLE_TYPE_LABELS,\n VARIABLE_NAME_PATTERN: m7.VARIABLE_NAME_PATTERN,\n attachFunctionDefinitions: m7.attachFunctionDefinitions,\n formatVariableValue: m7.formatVariableValue,\n functionGlobals: m7.functionGlobals,\n hasBindings: m7.hasBindings,\n resolveBindings: m7.resolveBindings,\n resolveNodesBindings: m7.resolveNodesBindings,\n COMPONENT_CATEGORY_ORDER: m8.COMPONENT_CATEGORY_ORDER,\n ComponentCategory: m8.ComponentCategory,\n REUSABLE_COMPONENT_CATEGORY: m8.REUSABLE_COMPONENT_CATEGORY,\n REUSABLE_EMAIL_BLOCK_CATEGORY: m8.REUSABLE_EMAIL_BLOCK_CATEGORY,\n FEATURE_FLAG: m9.FEATURE_FLAG,\n RICH_TEXT_COMMANDS: m9.RICH_TEXT_COMMANDS,\n FieldComponentType: m10.FieldComponentType,\n FieldValidatorType: m10.FieldValidatorType,\n LinealDirectiveFlag: m10.LinealDirectiveFlag,\n CONSOLE_STAFF_WIDGET_SLOTS: m11.CONSOLE_STAFF_WIDGET_SLOTS,\n CONSOLE_WIDGET_SLOTS: m11.CONSOLE_WIDGET_SLOTS,\n MUI_BUNDLE_ID: m11.MUI_BUNDLE_ID,\n THEME_PRESETS_LOAD_POINT: m11.THEME_PRESETS_LOAD_POINT,\n defineUiFeatureBundle: m11.defineUiFeatureBundle,\n isConsoleStaffWidgetSlot: m11.isConsoleStaffWidgetSlot,\n listConsoleExtensions: m11.listConsoleExtensions,\n listConsoleNavItems: m11.listConsoleNavItems,\n listConsoleOrgNavItems: m11.listConsoleOrgNavItems,\n listConsoleProviders: m11.listConsoleProviders,\n listConsoleStaffPages: m11.listConsoleStaffPages,\n listConsoleThemePresets: m11.listConsoleThemePresets,\n listConsoleWidgets: m11.listConsoleWidgets,\n registerConsoleExtension: m11.registerConsoleExtension,\n resolveConsoleOrgPluginPage: m11.resolveConsoleOrgPluginPage,\n resolveConsolePluginPage: m11.resolveConsolePluginPage,\n resolveConsoleStaffPage: m11.resolveConsoleStaffPage,\n unregisterConsoleExtension: m11.unregisterConsoleExtension,\n NodeType: m12.NodeType,\n})\n"],"names":["m0","m1","m2","m3","m4","m5","m6","m7","m8","m9","m10","m11","m12","AGLYN_HOST_SURFACE","Object","freeze","Aglyn","aglyn","canvas","components","emitter","logger","plugins","FUNCTION_TOKEN_PATTERN","MISSING_BINDING_LABEL","NAME_TOKEN_PATTERN","VARIABLE_ID_TOKEN_PATTERN","bindingTokenNeedsDeep","displayBindingTokens","editableBindingTokens","formatFunctionIdToken","formatVariableIdToken","keyById","nodesReferenceBinding","normalizeBindingTokens","rewriteBindingTokensDeep","textReferencesBinding","CATEGORY_REQUIRED_CAPABILITY","EnabledPluginsContext","isCategoryCapabilityEnabled","isFromEnabledPlugin","isSwitchedOffForRenderedSite","useEnabledPlugins","FUNCTION_BUILTIN_NAMES","FUNCTION_MAX_OPERATIONS","evaluateExpression","evaluateHostFunction","expressionIdentifiers","formatFunctionParameterOptions","functionReferencedNames","parseFunctionParameterOptions","NodeIdentityContext","useNodeId","ScreenLinkContext","PREVIEW_REFUSED_STATUS","PREVIEW_WRITE_BLOCKED_EVENT","SiteContext","isPreviewRefusal","useSite","useSiteFetch","HOST_VARIABLE_TYPE_LABELS","VARIABLE_NAME_PATTERN","attachFunctionDefinitions","formatVariableValue","functionGlobals","hasBindings","resolveBindings","resolveNodesBindings","COMPONENT_CATEGORY_ORDER","ComponentCategory","REUSABLE_COMPONENT_CATEGORY","REUSABLE_EMAIL_BLOCK_CATEGORY","FEATURE_FLAG","RICH_TEXT_COMMANDS","FieldComponentType","FieldValidatorType","LinealDirectiveFlag","CONSOLE_STAFF_WIDGET_SLOTS","CONSOLE_WIDGET_SLOTS","MUI_BUNDLE_ID","THEME_PRESETS_LOAD_POINT","defineUiFeatureBundle","isConsoleStaffWidgetSlot","listConsoleExtensions","listConsoleNavItems","listConsoleOrgNavItems","listConsoleProviders","listConsoleStaffPages","listConsoleThemePresets","listConsoleWidgets","registerConsoleExtension","resolveConsoleOrgPluginPage","resolveConsolePluginPage","resolveConsoleStaffPage","unregisterConsoleExtension","NodeType"],"mappings":"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"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/realm-host-aglyn.generated.ts"],"sourcesContent":["/**\n * GENERATED FILE — do not edit. Regenerate with:\n * node tools/scripts/generate-realm-host-exports.mjs\n *\n * The realm plugin surface of `@aglyn/aglyn` (AGL-3392): what a signed\n * bundle reads from core. Imported only by the lazily loaded host module.\n */\n/* eslint-disable */\n\nimport * as m0 from \"../aglyn\"\nimport * as m1 from \"../app-utils/binding-tokens\"\nimport * as m2 from \"../app-utils/enabled-plugins-context\"\nimport * as m3 from \"../app-utils/functions\"\nimport * as m4 from \"../app-utils/node-identity\"\nimport * as m5 from \"../app-utils/screen-link-context-value\"\nimport * as m6 from \"../app-utils/site-context\"\nimport * as m7 from \"../app-utils/variables\"\nimport * as m8 from \"../foundation/constants/components\"\nimport * as m9 from \"../foundation/constants/shared\"\nimport * as m10 from \"../foundation/definitions/components.types\"\nimport * as m11 from \"./feature-plugins\"\nimport * as m12 from \"../types/nodes\"\n\nexport const AGLYN_HOST_SURFACE: Readonly<Record<string, unknown>> = Object.freeze({\n Aglyn: m0.Aglyn,\n aglyn: m0.aglyn,\n canvas: m0.canvas,\n components: m0.components,\n emitter: m0.emitter,\n logger: m0.logger,\n plugins: m0.plugins,\n FUNCTION_TOKEN_PATTERN: m1.FUNCTION_TOKEN_PATTERN,\n MISSING_BINDING_LABEL: m1.MISSING_BINDING_LABEL,\n NAME_TOKEN_PATTERN: m1.NAME_TOKEN_PATTERN,\n VARIABLE_ID_TOKEN_PATTERN: m1.VARIABLE_ID_TOKEN_PATTERN,\n bindingTokenNeedsDeep: m1.bindingTokenNeedsDeep,\n displayBindingTokens: m1.displayBindingTokens,\n editableBindingTokens: m1.editableBindingTokens,\n formatFunctionIdToken: m1.formatFunctionIdToken,\n formatVariableIdToken: m1.formatVariableIdToken,\n keyById: m1.keyById,\n nodesReferenceBinding: m1.nodesReferenceBinding,\n normalizeBindingTokens: m1.normalizeBindingTokens,\n rewriteBindingTokensDeep: m1.rewriteBindingTokensDeep,\n textReferencesBinding: m1.textReferencesBinding,\n CATEGORY_REQUIRED_CAPABILITY: m2.CATEGORY_REQUIRED_CAPABILITY,\n EnabledPluginsContext: m2.EnabledPluginsContext,\n isCategoryCapabilityEnabled: m2.isCategoryCapabilityEnabled,\n isFromEnabledPlugin: m2.isFromEnabledPlugin,\n isSwitchedOffForRenderedSite: m2.isSwitchedOffForRenderedSite,\n useEnabledPlugins: m2.useEnabledPlugins,\n FUNCTION_BUILTIN_NAMES: m3.FUNCTION_BUILTIN_NAMES,\n FUNCTION_MAX_OPERATIONS: m3.FUNCTION_MAX_OPERATIONS,\n evaluateExpression: m3.evaluateExpression,\n evaluateHostFunction: m3.evaluateHostFunction,\n expressionIdentifiers: m3.expressionIdentifiers,\n formatFunctionParameterOptions: m3.formatFunctionParameterOptions,\n functionReferencedNames: m3.functionReferencedNames,\n parseFunctionParameterOptions: m3.parseFunctionParameterOptions,\n NodeIdentityContext: m4.NodeIdentityContext,\n useNodeId: m4.useNodeId,\n ScreenLinkContext: m5.ScreenLinkContext,\n PREVIEW_REFUSED_STATUS: m6.PREVIEW_REFUSED_STATUS,\n PREVIEW_WRITE_BLOCKED_EVENT: m6.PREVIEW_WRITE_BLOCKED_EVENT,\n SiteContext: m6.SiteContext,\n isPreviewRefusal: m6.isPreviewRefusal,\n useSite: m6.useSite,\n useSiteFetch: m6.useSiteFetch,\n HOST_VARIABLE_TYPE_LABELS: m7.HOST_VARIABLE_TYPE_LABELS,\n VARIABLE_NAME_PATTERN: m7.VARIABLE_NAME_PATTERN,\n attachFunctionDefinitions: m7.attachFunctionDefinitions,\n formatVariableValue: m7.formatVariableValue,\n functionGlobals: m7.functionGlobals,\n hasBindings: m7.hasBindings,\n resolveBindings: m7.resolveBindings,\n resolveNodesBindings: m7.resolveNodesBindings,\n COMPONENT_CATEGORY_ORDER: m8.COMPONENT_CATEGORY_ORDER,\n ComponentCategory: m8.ComponentCategory,\n REUSABLE_COMPONENT_CATEGORY: m8.REUSABLE_COMPONENT_CATEGORY,\n REUSABLE_EMAIL_BLOCK_CATEGORY: m8.REUSABLE_EMAIL_BLOCK_CATEGORY,\n FEATURE_FLAG: m9.FEATURE_FLAG,\n RICH_TEXT_COMMANDS: m9.RICH_TEXT_COMMANDS,\n FieldComponentType: m10.FieldComponentType,\n FieldValidatorType: m10.FieldValidatorType,\n LinealDirectiveFlag: m10.LinealDirectiveFlag,\n CONSOLE_SEARCH_LOAD_POINT: m11.CONSOLE_SEARCH_LOAD_POINT,\n CONSOLE_STAFF_WIDGET_SLOTS: m11.CONSOLE_STAFF_WIDGET_SLOTS,\n CONSOLE_WIDGET_SLOTS: m11.CONSOLE_WIDGET_SLOTS,\n MUI_BUNDLE_ID: m11.MUI_BUNDLE_ID,\n THEME_PRESETS_LOAD_POINT: m11.THEME_PRESETS_LOAD_POINT,\n defineUiFeatureBundle: m11.defineUiFeatureBundle,\n isConsoleStaffWidgetSlot: m11.isConsoleStaffWidgetSlot,\n listConsoleExtensions: m11.listConsoleExtensions,\n listConsoleNavItems: m11.listConsoleNavItems,\n listConsoleOrgNavItems: m11.listConsoleOrgNavItems,\n listConsoleProviders: m11.listConsoleProviders,\n listConsoleSearchSources: m11.listConsoleSearchSources,\n listConsoleStaffPages: m11.listConsoleStaffPages,\n listConsoleThemePresets: m11.listConsoleThemePresets,\n listConsoleWidgets: m11.listConsoleWidgets,\n registerConsoleExtension: m11.registerConsoleExtension,\n resolveConsoleOrgPluginPage: m11.resolveConsoleOrgPluginPage,\n resolveConsolePluginPage: m11.resolveConsolePluginPage,\n resolveConsoleStaffPage: m11.resolveConsoleStaffPage,\n unregisterConsoleExtension: m11.unregisterConsoleExtension,\n NodeType: m12.NodeType,\n})\n"],"names":["m0","m1","m2","m3","m4","m5","m6","m7","m8","m9","m10","m11","m12","AGLYN_HOST_SURFACE","Object","freeze","Aglyn","aglyn","canvas","components","emitter","logger","plugins","FUNCTION_TOKEN_PATTERN","MISSING_BINDING_LABEL","NAME_TOKEN_PATTERN","VARIABLE_ID_TOKEN_PATTERN","bindingTokenNeedsDeep","displayBindingTokens","editableBindingTokens","formatFunctionIdToken","formatVariableIdToken","keyById","nodesReferenceBinding","normalizeBindingTokens","rewriteBindingTokensDeep","textReferencesBinding","CATEGORY_REQUIRED_CAPABILITY","EnabledPluginsContext","isCategoryCapabilityEnabled","isFromEnabledPlugin","isSwitchedOffForRenderedSite","useEnabledPlugins","FUNCTION_BUILTIN_NAMES","FUNCTION_MAX_OPERATIONS","evaluateExpression","evaluateHostFunction","expressionIdentifiers","formatFunctionParameterOptions","functionReferencedNames","parseFunctionParameterOptions","NodeIdentityContext","useNodeId","ScreenLinkContext","PREVIEW_REFUSED_STATUS","PREVIEW_WRITE_BLOCKED_EVENT","SiteContext","isPreviewRefusal","useSite","useSiteFetch","HOST_VARIABLE_TYPE_LABELS","VARIABLE_NAME_PATTERN","attachFunctionDefinitions","formatVariableValue","functionGlobals","hasBindings","resolveBindings","resolveNodesBindings","COMPONENT_CATEGORY_ORDER","ComponentCategory","REUSABLE_COMPONENT_CATEGORY","REUSABLE_EMAIL_BLOCK_CATEGORY","FEATURE_FLAG","RICH_TEXT_COMMANDS","FieldComponentType","FieldValidatorType","LinealDirectiveFlag","CONSOLE_SEARCH_LOAD_POINT","CONSOLE_STAFF_WIDGET_SLOTS","CONSOLE_WIDGET_SLOTS","MUI_BUNDLE_ID","THEME_PRESETS_LOAD_POINT","defineUiFeatureBundle","isConsoleStaffWidgetSlot","listConsoleExtensions","listConsoleNavItems","listConsoleOrgNavItems","listConsoleProviders","listConsoleSearchSources","listConsoleStaffPages","listConsoleThemePresets","listConsoleWidgets","registerConsoleExtension","resolveConsoleOrgPluginPage","resolveConsolePluginPage","resolveConsoleStaffPage","unregisterConsoleExtension","NodeType"],"mappings":"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"}
@@ -71,19 +71,6 @@
71
71
  * `plugin-manager/index.ts`.
72
72
  */
73
73
  import { type PluginContactCaptureRequest, type PluginContactCaptured } from './plugin-contact-capture';
74
- /**
75
- * The app offers its boot step, so a capture that finds nobody can run it.
76
- *
77
- * Called at boot from the app's own instrumentation, beside the declarations
78
- * themselves and BEFORE them — this is a plain assignment that cannot fail,
79
- * and the failure it exists to repair is the one immediately after it. The
80
- * app passes a function rather than core importing the generated manifest,
81
- * which core may not do: the manifest names every plugin.
82
- *
83
- * Idempotent and last-one-wins; an app registers exactly once per process.
84
- */
85
- export declare function registerPluginDeclarationsRepair(run: () => Promise<void>): void;
86
- /** Only for specs: forgets the registered boot step. */
87
- export declare function resetPluginDeclarationsRepairForTests(): void;
74
+ export { registerPluginDeclarationsRepair, resetPluginDeclarationsRepairForTests, } from './plugin-declarations-repair';
88
75
  export declare function recordCapturedContact(request: PluginContactCaptureRequest): Promise<PluginContactCaptured | null>;
89
76
  export default recordCapturedContact;
@@ -69,31 +69,12 @@
69
69
  * Server-side: reached by its own subpath, never through
70
70
  * `plugin-manager/index.ts`.
71
71
  */ import { pluginContactCaptureWriter } from "./plugin-contact-capture.js";
72
- /**
73
- * The app's boot-time declarations step, when it has offered one.
74
- *
75
- * Held on `globalThis` rather than in a module `let` (AGL-3412): the app
76
- * offers it from `instrumentation.ts`, which Next compiles into a different
77
- * module graph from the routes that capture, so a module-scoped slot is set
78
- * in one copy and read as empty in the other.
79
- */ const REPAIR_KEY = Symbol.for('@aglyn/aglyn:plugin-declarations-repair');
80
- const globalScope = globalThis;
81
- /**
82
- * The app offers its boot step, so a capture that finds nobody can run it.
83
- *
84
- * Called at boot from the app's own instrumentation, beside the declarations
85
- * themselves and BEFORE them — this is a plain assignment that cannot fail,
86
- * and the failure it exists to repair is the one immediately after it. The
87
- * app passes a function rather than core importing the generated manifest,
88
- * which core may not do: the manifest names every plugin.
89
- *
90
- * Idempotent and last-one-wins; an app registers exactly once per process.
91
- */ export function registerPluginDeclarationsRepair(run) {
92
- globalScope[REPAIR_KEY] = run;
93
- }
94
- /** Only for specs: forgets the registered boot step. */ export function resetPluginDeclarationsRepairForTests() {
95
- globalScope[REPAIR_KEY] = null;
96
- }
72
+ import { runPluginDeclarationsRepair } from "./plugin-declarations-repair.js";
73
+ /*
74
+ * The boot step's slot lives in its own leaf (AGL-2773), because the custom
75
+ * field registry reads it too and that registry is client-safe. Re-exported
76
+ * so the apps' instrumentation keeps importing it from here.
77
+ */ export { registerPluginDeclarationsRepair, resetPluginDeclarationsRepairForTests } from "./plugin-declarations-repair.js";
97
78
  export async function recordCapturedContact(request) {
98
79
  const where = `${request.interaction.source} on ${request.hostId}`;
99
80
  const found = pluginContactCaptureWriter();
@@ -102,13 +83,10 @@ export async function recordCapturedContact(request) {
102
83
  // that registers the writer failed and every capture in this process has
103
84
  // been going nowhere. Run it and ask again — the registration memoizes its
104
85
  // own promise, so this is one attempt per process and not one per capture.
105
- const repair = globalScope[REPAIR_KEY];
106
- if (repair) {
107
- try {
108
- await repair();
109
- } catch (error) {
110
- console.error(`[capture] plugin declarations failed before ${where}`, error);
111
- }
86
+ try {
87
+ await runPluginDeclarationsRepair();
88
+ } catch (error) {
89
+ console.error(`[capture] plugin declarations failed before ${where}`, error);
112
90
  }
113
91
  const late = pluginContactCaptureWriter();
114
92
  if (!late) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/record-captured-contact.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * How a door hands somebody it just met to whichever plugin keeps people\n * (AGL-3080).\n *\n * `capturePluginContact` is the contract; this is the three things every\n * door calling it has to get right, in one place so no door has to remember\n * them. It lives in core rather than in an app because the doors are not all\n * in one place: a form submission is a core route in the tenant app, a\n * newsletter signup and a membership registration are commerce's, a booking\n * request is bookings'. A plugin may not import an app, so a wrapper that\n * lived in one would be a wrapper the plugin doors had to copy — and a copy\n * is where the two halves of this behaviour would drift.\n *\n * ## It makes sure somebody is listening, without slowing down the case where\n * somebody already is\n *\n * `capturePluginContact` answers `null` when no plugin keeps people, and the\n * plugin that does registers itself from the server declarations each app\n * runs at boot. That boot step is wrapped in a `catch` — a declaration that\n * fails to load must not cost every route — so a boot that went wrong leaves\n * a process where every capture answers `null` and no contact is ever\n * written, with one line in a log nobody is reading.\n *\n * So the writer is looked up FIRST, synchronously, and handed the capture\n * with no await in between. That matters for more than speed: every caller\n * is fire-and-forget, and a door that awaited anything before reaching the\n * writer would hand the capture to a request that may already have returned.\n * Only when no writer answers does this run the app's boot step and try once\n * more — repairing the broken-boot case rather than just reporting it.\n *\n * The boot step itself is the app's, because the list of plugins to declare\n * is generated per app and core may not import a plugin. The app hands it\n * over at boot with {@link registerPluginDeclarationsRepair}. An app that has\n * not — or a process that never ran its instrumentation at all — loses the\n * repair and keeps every other behaviour here, which is the honest outcome:\n * a process that ran no boot step has bigger silences than this one.\n *\n * ## It tells the difference between the two silences\n *\n * `null` is \"this workspace has no record system\", which is a real and quiet\n * answer for a workspace with the record plugin switched off. It is ALSO what\n * a broken registration looks like, and the two are indistinguishable from\n * here. So it is logged rather than ignored: a workspace that should be\n * keeping contacts and has silently stopped is the failure mode this seam can\n * produce, and a line naming the site is what turns an unreproducible support\n * ticket into a one-minute answer. A refusal is different again — the owner\n * considered this person and declined, for a reason it states — and is logged\n * as itself.\n *\n * ⚠️ IT NEVER THROWS, and callers use it fire-and-forget. Every door has\n * already done the thing it is recording; losing the submission, the signup\n * or the booking over the contact would be the larger failure.\n *\n * Server-side: reached by its own subpath, never through\n * `plugin-manager/index.ts`.\n */\n\nimport {\n pluginContactCaptureWriter,\n type PluginContactCaptureRequest,\n type PluginContactCaptureWriter,\n type PluginContactCaptured,\n} from './plugin-contact-capture'\n\n/**\n * The app's boot-time declarations step, when it has offered one.\n *\n * Held on `globalThis` rather than in a module `let` (AGL-3412): the app\n * offers it from `instrumentation.ts`, which Next compiles into a different\n * module graph from the routes that capture, so a module-scoped slot is set\n * in one copy and read as empty in the other.\n */\nconst REPAIR_KEY = Symbol.for('@aglyn/aglyn:plugin-declarations-repair')\n\nconst globalScope = globalThis as typeof globalThis & {\n [REPAIR_KEY]?: (() => Promise<void>) | null\n}\n\n/**\n * The app offers its boot step, so a capture that finds nobody can run it.\n *\n * Called at boot from the app's own instrumentation, beside the declarations\n * themselves and BEFORE them — this is a plain assignment that cannot fail,\n * and the failure it exists to repair is the one immediately after it. The\n * app passes a function rather than core importing the generated manifest,\n * which core may not do: the manifest names every plugin.\n *\n * Idempotent and last-one-wins; an app registers exactly once per process.\n */\nexport function registerPluginDeclarationsRepair(run: () => Promise<void>): void {\n globalScope[REPAIR_KEY] = run\n}\n\n/** Only for specs: forgets the registered boot step. */\nexport function resetPluginDeclarationsRepairForTests(): void {\n globalScope[REPAIR_KEY] = null\n}\n\nexport async function recordCapturedContact(\n request: PluginContactCaptureRequest,\n): Promise<PluginContactCaptured | null> {\n const where = `${request.interaction.source} on ${request.hostId}`\n const found = pluginContactCaptureWriter()\n if (found) return await handedTo(found.writer, request, where)\n\n // Nobody answers. Either this workspace keeps no records, or the boot step\n // that registers the writer failed and every capture in this process has\n // been going nowhere. Run it and ask again — the registration memoizes its\n // own promise, so this is one attempt per process and not one per capture.\n const repair = globalScope[REPAIR_KEY]\n if (repair) {\n try {\n await repair()\n } catch (error) {\n console.error(`[capture] plugin declarations failed before ${where}`, error)\n }\n }\n const late = pluginContactCaptureWriter()\n if (!late) {\n console.warn(\n `[capture] no plugin keeps people, so the ${where} recorded nobody. ` +\n 'Expected when the record plugin is off for this workspace; a bug otherwise.',\n )\n return null\n }\n console.warn(\n `[capture] the ${where} found no writer until it registered one itself — ` +\n 'the boot-time declarations did not run in this process.',\n )\n return await handedTo(late.writer, request, where)\n}\n\n/** One capture, with the two failures a door must not be made to handle. */\nasync function handedTo(\n writer: PluginContactCaptureWriter,\n request: PluginContactCaptureRequest,\n where: string,\n): Promise<PluginContactCaptured | null> {\n try {\n const verdict = await writer.capture(request)\n if (verdict.ok === false) {\n console.warn(`[capture] ${where} was refused (${verdict.reason})`)\n }\n return verdict\n } catch (error) {\n // The contract says a writer RETURNS its refusals, so reaching here means\n // one broke its own contract. It still costs the door nothing.\n console.error(`[capture] ${where} threw`, error)\n return null\n }\n}\n\nexport default recordCapturedContact\n"],"names":["pluginContactCaptureWriter","REPAIR_KEY","Symbol","for","globalScope","globalThis","registerPluginDeclarationsRepair","run","resetPluginDeclarationsRepairForTests","recordCapturedContact","request","where","interaction","source","hostId","found","handedTo","writer","repair","error","console","late","warn","verdict","capture","ok","reason"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDC,GAED,SACEA,0BAA0B,QAIrB,8BAA0B;AAEjC;;;;;;;CAOC,GACD,MAAMC,aAAaC,OAAOC,GAAG,CAAC;AAE9B,MAAMC,cAAcC;AAIpB;;;;;;;;;;CAUC,GACD,OAAO,SAASC,iCAAiCC,GAAwB;IACvEH,WAAW,CAACH,WAAW,GAAGM;AAC5B;AAEA,sDAAsD,GACtD,OAAO,SAASC;IACdJ,WAAW,CAACH,WAAW,GAAG;AAC5B;AAEA,OAAO,eAAeQ,sBACpBC,OAAoC;IAEpC,MAAMC,QAAQ,GAAGD,QAAQE,WAAW,CAACC,MAAM,CAAC,IAAI,EAAEH,QAAQI,MAAM,EAAE;IAClE,MAAMC,QAAQf;IACd,IAAIe,OAAO,OAAO,MAAMC,SAASD,MAAME,MAAM,EAAEP,SAASC;IAExD,2EAA2E;IAC3E,yEAAyE;IACzE,2EAA2E;IAC3E,2EAA2E;IAC3E,MAAMO,SAASd,WAAW,CAACH,WAAW;IACtC,IAAIiB,QAAQ;QACV,IAAI;YACF,MAAMA;QACR,EAAE,OAAOC,OAAO;YACdC,QAAQD,KAAK,CAAC,CAAC,4CAA4C,EAAER,OAAO,EAAEQ;QACxE;IACF;IACA,MAAME,OAAOrB;IACb,IAAI,CAACqB,MAAM;QACTD,QAAQE,IAAI,CACV,CAAC,yCAAyC,EAAEX,MAAM,kBAAkB,CAAC,GACnE;QAEJ,OAAO;IACT;IACAS,QAAQE,IAAI,CACV,CAAC,cAAc,EAAEX,MAAM,kDAAkD,CAAC,GACxE;IAEJ,OAAO,MAAMK,SAASK,KAAKJ,MAAM,EAAEP,SAASC;AAC9C;AAEA,0EAA0E,GAC1E,eAAeK,SACbC,MAAkC,EAClCP,OAAoC,EACpCC,KAAa;IAEb,IAAI;QACF,MAAMY,UAAU,MAAMN,OAAOO,OAAO,CAACd;QACrC,IAAIa,QAAQE,EAAE,KAAK,OAAO;YACxBL,QAAQE,IAAI,CAAC,CAAC,UAAU,EAAEX,MAAM,cAAc,EAAEY,QAAQG,MAAM,CAAC,CAAC,CAAC;QACnE;QACA,OAAOH;IACT,EAAE,OAAOJ,OAAO;QACd,0EAA0E;QAC1E,+DAA+D;QAC/DC,QAAQD,KAAK,CAAC,CAAC,UAAU,EAAER,MAAM,MAAM,CAAC,EAAEQ;QAC1C,OAAO;IACT;AACF;AAEA,eAAeV,sBAAqB"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/record-captured-contact.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * How a door hands somebody it just met to whichever plugin keeps people\n * (AGL-3080).\n *\n * `capturePluginContact` is the contract; this is the three things every\n * door calling it has to get right, in one place so no door has to remember\n * them. It lives in core rather than in an app because the doors are not all\n * in one place: a form submission is a core route in the tenant app, a\n * newsletter signup and a membership registration are commerce's, a booking\n * request is bookings'. A plugin may not import an app, so a wrapper that\n * lived in one would be a wrapper the plugin doors had to copy — and a copy\n * is where the two halves of this behaviour would drift.\n *\n * ## It makes sure somebody is listening, without slowing down the case where\n * somebody already is\n *\n * `capturePluginContact` answers `null` when no plugin keeps people, and the\n * plugin that does registers itself from the server declarations each app\n * runs at boot. That boot step is wrapped in a `catch` — a declaration that\n * fails to load must not cost every route — so a boot that went wrong leaves\n * a process where every capture answers `null` and no contact is ever\n * written, with one line in a log nobody is reading.\n *\n * So the writer is looked up FIRST, synchronously, and handed the capture\n * with no await in between. That matters for more than speed: every caller\n * is fire-and-forget, and a door that awaited anything before reaching the\n * writer would hand the capture to a request that may already have returned.\n * Only when no writer answers does this run the app's boot step and try once\n * more — repairing the broken-boot case rather than just reporting it.\n *\n * The boot step itself is the app's, because the list of plugins to declare\n * is generated per app and core may not import a plugin. The app hands it\n * over at boot with {@link registerPluginDeclarationsRepair}. An app that has\n * not — or a process that never ran its instrumentation at all — loses the\n * repair and keeps every other behaviour here, which is the honest outcome:\n * a process that ran no boot step has bigger silences than this one.\n *\n * ## It tells the difference between the two silences\n *\n * `null` is \"this workspace has no record system\", which is a real and quiet\n * answer for a workspace with the record plugin switched off. It is ALSO what\n * a broken registration looks like, and the two are indistinguishable from\n * here. So it is logged rather than ignored: a workspace that should be\n * keeping contacts and has silently stopped is the failure mode this seam can\n * produce, and a line naming the site is what turns an unreproducible support\n * ticket into a one-minute answer. A refusal is different again — the owner\n * considered this person and declined, for a reason it states — and is logged\n * as itself.\n *\n * ⚠️ IT NEVER THROWS, and callers use it fire-and-forget. Every door has\n * already done the thing it is recording; losing the submission, the signup\n * or the booking over the contact would be the larger failure.\n *\n * Server-side: reached by its own subpath, never through\n * `plugin-manager/index.ts`.\n */\n\nimport {\n pluginContactCaptureWriter,\n type PluginContactCaptureRequest,\n type PluginContactCaptureWriter,\n type PluginContactCaptured,\n} from './plugin-contact-capture'\nimport { runPluginDeclarationsRepair } from './plugin-declarations-repair'\n\n/*\n * The boot step's slot lives in its own leaf (AGL-2773), because the custom\n * field registry reads it too and that registry is client-safe. Re-exported\n * so the apps' instrumentation keeps importing it from here.\n */\nexport {\n registerPluginDeclarationsRepair,\n resetPluginDeclarationsRepairForTests,\n} from './plugin-declarations-repair'\n\nexport async function recordCapturedContact(\n request: PluginContactCaptureRequest,\n): Promise<PluginContactCaptured | null> {\n const where = `${request.interaction.source} on ${request.hostId}`\n const found = pluginContactCaptureWriter()\n if (found) return await handedTo(found.writer, request, where)\n\n // Nobody answers. Either this workspace keeps no records, or the boot step\n // that registers the writer failed and every capture in this process has\n // been going nowhere. Run it and ask again — the registration memoizes its\n // own promise, so this is one attempt per process and not one per capture.\n try {\n await runPluginDeclarationsRepair()\n } catch (error) {\n console.error(`[capture] plugin declarations failed before ${where}`, error)\n }\n const late = pluginContactCaptureWriter()\n if (!late) {\n console.warn(\n `[capture] no plugin keeps people, so the ${where} recorded nobody. ` +\n 'Expected when the record plugin is off for this workspace; a bug otherwise.',\n )\n return null\n }\n console.warn(\n `[capture] the ${where} found no writer until it registered one itself — ` +\n 'the boot-time declarations did not run in this process.',\n )\n return await handedTo(late.writer, request, where)\n}\n\n/** One capture, with the two failures a door must not be made to handle. */\nasync function handedTo(\n writer: PluginContactCaptureWriter,\n request: PluginContactCaptureRequest,\n where: string,\n): Promise<PluginContactCaptured | null> {\n try {\n const verdict = await writer.capture(request)\n if (verdict.ok === false) {\n console.warn(`[capture] ${where} was refused (${verdict.reason})`)\n }\n return verdict\n } catch (error) {\n // The contract says a writer RETURNS its refusals, so reaching here means\n // one broke its own contract. It still costs the door nothing.\n console.error(`[capture] ${where} threw`, error)\n return null\n }\n}\n\nexport default recordCapturedContact\n"],"names":["pluginContactCaptureWriter","runPluginDeclarationsRepair","registerPluginDeclarationsRepair","resetPluginDeclarationsRepairForTests","recordCapturedContact","request","where","interaction","source","hostId","found","handedTo","writer","error","console","late","warn","verdict","capture","ok","reason"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDC,GAED,SACEA,0BAA0B,QAIrB,8BAA0B;AACjC,SAASC,2BAA2B,QAAQ,kCAA8B;AAE1E;;;;CAIC,GACD,SACEC,gCAAgC,EAChCC,qCAAqC,QAChC,kCAA8B;AAErC,OAAO,eAAeC,sBACpBC,OAAoC;IAEpC,MAAMC,QAAQ,GAAGD,QAAQE,WAAW,CAACC,MAAM,CAAC,IAAI,EAAEH,QAAQI,MAAM,EAAE;IAClE,MAAMC,QAAQV;IACd,IAAIU,OAAO,OAAO,MAAMC,SAASD,MAAME,MAAM,EAAEP,SAASC;IAExD,2EAA2E;IAC3E,yEAAyE;IACzE,2EAA2E;IAC3E,2EAA2E;IAC3E,IAAI;QACF,MAAML;IACR,EAAE,OAAOY,OAAO;QACdC,QAAQD,KAAK,CAAC,CAAC,4CAA4C,EAAEP,OAAO,EAAEO;IACxE;IACA,MAAME,OAAOf;IACb,IAAI,CAACe,MAAM;QACTD,QAAQE,IAAI,CACV,CAAC,yCAAyC,EAAEV,MAAM,kBAAkB,CAAC,GACnE;QAEJ,OAAO;IACT;IACAQ,QAAQE,IAAI,CACV,CAAC,cAAc,EAAEV,MAAM,kDAAkD,CAAC,GACxE;IAEJ,OAAO,MAAMK,SAASI,KAAKH,MAAM,EAAEP,SAASC;AAC9C;AAEA,0EAA0E,GAC1E,eAAeK,SACbC,MAAkC,EAClCP,OAAoC,EACpCC,KAAa;IAEb,IAAI;QACF,MAAMW,UAAU,MAAML,OAAOM,OAAO,CAACb;QACrC,IAAIY,QAAQE,EAAE,KAAK,OAAO;YACxBL,QAAQE,IAAI,CAAC,CAAC,UAAU,EAAEV,MAAM,cAAc,EAAEW,QAAQG,MAAM,CAAC,CAAC,CAAC;QACnE;QACA,OAAOH;IACT,EAAE,OAAOJ,OAAO;QACd,0EAA0E;QAC1E,+DAA+D;QAC/DC,QAAQD,KAAK,CAAC,CAAC,UAAU,EAAEP,MAAM,MAAM,CAAC,EAAEO;QAC1C,OAAO;IACT;AACF;AAEA,eAAeT,sBAAqB"}