@aglyn/plugins-crm 1.0.0-beta.143

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 (669) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +57 -0
  4. package/src/index.d.ts +21 -0
  5. package/src/index.js +29 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/activity-list.d.ts +98 -0
  8. package/src/lib/components/activity-list.js +321 -0
  9. package/src/lib/components/activity-list.js.map +1 -0
  10. package/src/lib/components/activity-queries.d.ts +117 -0
  11. package/src/lib/components/activity-queries.js +198 -0
  12. package/src/lib/components/activity-queries.js.map +1 -0
  13. package/src/lib/components/add-to-list-button.d.ts +25 -0
  14. package/src/lib/components/add-to-list-button.js +64 -0
  15. package/src/lib/components/add-to-list-button.js.map +1 -0
  16. package/src/lib/components/add-to-list-dialog.d.ts +24 -0
  17. package/src/lib/components/add-to-list-dialog.js +327 -0
  18. package/src/lib/components/add-to-list-dialog.js.map +1 -0
  19. package/src/lib/components/assignment-rule-drawer.d.ts +43 -0
  20. package/src/lib/components/assignment-rule-drawer.js +293 -0
  21. package/src/lib/components/assignment-rule-drawer.js.map +1 -0
  22. package/src/lib/components/companies-bulk-bar.d.ts +29 -0
  23. package/src/lib/components/companies-bulk-bar.js +274 -0
  24. package/src/lib/components/companies-bulk-bar.js.map +1 -0
  25. package/src/lib/components/companies-section.d.ts +54 -0
  26. package/src/lib/components/companies-section.js +522 -0
  27. package/src/lib/components/companies-section.js.map +1 -0
  28. package/src/lib/components/company-contacts-card.d.ts +49 -0
  29. package/src/lib/components/company-contacts-card.js +435 -0
  30. package/src/lib/components/company-contacts-card.js.map +1 -0
  31. package/src/lib/components/company-deals-card.d.ts +20 -0
  32. package/src/lib/components/company-deals-card.js +38 -0
  33. package/src/lib/components/company-deals-card.js.map +1 -0
  34. package/src/lib/components/company-detail-page.d.ts +20 -0
  35. package/src/lib/components/company-detail-page.js +165 -0
  36. package/src/lib/components/company-detail-page.js.map +1 -0
  37. package/src/lib/components/company-edit-drawer.d.ts +65 -0
  38. package/src/lib/components/company-edit-drawer.js +433 -0
  39. package/src/lib/components/company-edit-drawer.js.map +1 -0
  40. package/src/lib/components/company-import-drawer.d.ts +42 -0
  41. package/src/lib/components/company-import-drawer.js +99 -0
  42. package/src/lib/components/company-import-drawer.js.map +1 -0
  43. package/src/lib/components/company-picker.d.ts +127 -0
  44. package/src/lib/components/company-picker.js +323 -0
  45. package/src/lib/components/company-picker.js.map +1 -0
  46. package/src/lib/components/company-properties-card.d.ts +47 -0
  47. package/src/lib/components/company-properties-card.js +289 -0
  48. package/src/lib/components/company-properties-card.js.map +1 -0
  49. package/src/lib/components/contact-address-fields.d.ts +29 -0
  50. package/src/lib/components/contact-address-fields.js +149 -0
  51. package/src/lib/components/contact-address-fields.js.map +1 -0
  52. package/src/lib/components/contact-associations-card.d.ts +72 -0
  53. package/src/lib/components/contact-associations-card.js +296 -0
  54. package/src/lib/components/contact-associations-card.js.map +1 -0
  55. package/src/lib/components/contact-custom-columns.d.ts +38 -0
  56. package/src/lib/components/contact-custom-columns.js +102 -0
  57. package/src/lib/components/contact-custom-columns.js.map +1 -0
  58. package/src/lib/components/contact-custom-fields-card.d.ts +39 -0
  59. package/src/lib/components/contact-custom-fields-card.js +204 -0
  60. package/src/lib/components/contact-custom-fields-card.js.map +1 -0
  61. package/src/lib/components/contact-deals-card.d.ts +20 -0
  62. package/src/lib/components/contact-deals-card.js +38 -0
  63. package/src/lib/components/contact-deals-card.js.map +1 -0
  64. package/src/lib/components/contact-detail-page.d.ts +46 -0
  65. package/src/lib/components/contact-detail-page.js +535 -0
  66. package/src/lib/components/contact-detail-page.js.map +1 -0
  67. package/src/lib/components/contact-duplicates-card.d.ts +42 -0
  68. package/src/lib/components/contact-duplicates-card.js +167 -0
  69. package/src/lib/components/contact-duplicates-card.js.map +1 -0
  70. package/src/lib/components/contact-field-drawer.d.ts +64 -0
  71. package/src/lib/components/contact-field-drawer.js +251 -0
  72. package/src/lib/components/contact-field-drawer.js.map +1 -0
  73. package/src/lib/components/contact-import-drawer.d.ts +46 -0
  74. package/src/lib/components/contact-import-drawer.js +149 -0
  75. package/src/lib/components/contact-import-drawer.js.map +1 -0
  76. package/src/lib/components/contact-known-by-card.d.ts +39 -0
  77. package/src/lib/components/contact-known-by-card.js +142 -0
  78. package/src/lib/components/contact-known-by-card.js.map +1 -0
  79. package/src/lib/components/contact-list-columns.d.ts +53 -0
  80. package/src/lib/components/contact-list-columns.js +288 -0
  81. package/src/lib/components/contact-list-columns.js.map +1 -0
  82. package/src/lib/components/contact-merge-dialog.d.ts +79 -0
  83. package/src/lib/components/contact-merge-dialog.js +405 -0
  84. package/src/lib/components/contact-merge-dialog.js.map +1 -0
  85. package/src/lib/components/contact-properties-card.d.ts +89 -0
  86. package/src/lib/components/contact-properties-card.js +492 -0
  87. package/src/lib/components/contact-properties-card.js.map +1 -0
  88. package/src/lib/components/contact-timeline-card.d.ts +68 -0
  89. package/src/lib/components/contact-timeline-card.js +435 -0
  90. package/src/lib/components/contact-timeline-card.js.map +1 -0
  91. package/src/lib/components/contacts-bulk-bar.d.ts +91 -0
  92. package/src/lib/components/contacts-bulk-bar.js +493 -0
  93. package/src/lib/components/contacts-bulk-bar.js.map +1 -0
  94. package/src/lib/components/contacts-section.d.ts +26 -0
  95. package/src/lib/components/contacts-section.js +1025 -0
  96. package/src/lib/components/contacts-section.js.map +1 -0
  97. package/src/lib/components/copy-capture-address-button.d.ts +33 -0
  98. package/src/lib/components/copy-capture-address-button.js +60 -0
  99. package/src/lib/components/copy-capture-address-button.js.map +1 -0
  100. package/src/lib/components/crm-attribution-zone.d.ts +38 -0
  101. package/src/lib/components/crm-attribution-zone.js +36 -0
  102. package/src/lib/components/crm-attribution-zone.js.map +1 -0
  103. package/src/lib/components/crm-booking-zone.d.ts +61 -0
  104. package/src/lib/components/crm-booking-zone.js +50 -0
  105. package/src/lib/components/crm-booking-zone.js.map +1 -0
  106. package/src/lib/components/crm-bulk-bar-frame.d.ts +47 -0
  107. package/src/lib/components/crm-bulk-bar-frame.js +137 -0
  108. package/src/lib/components/crm-bulk-bar-frame.js.map +1 -0
  109. package/src/lib/components/crm-call-actions.d.ts +65 -0
  110. package/src/lib/components/crm-call-actions.js +110 -0
  111. package/src/lib/components/crm-call-actions.js.map +1 -0
  112. package/src/lib/components/crm-column-menu.d.ts +21 -0
  113. package/src/lib/components/crm-column-menu.js +103 -0
  114. package/src/lib/components/crm-column-menu.js.map +1 -0
  115. package/src/lib/components/crm-console-page.d.ts +19 -0
  116. package/src/lib/components/crm-console-page.js +151 -0
  117. package/src/lib/components/crm-console-page.js.map +1 -0
  118. package/src/lib/components/crm-console-sections.d.ts +52 -0
  119. package/src/lib/components/crm-console-sections.js +83 -0
  120. package/src/lib/components/crm-console-sections.js.map +1 -0
  121. package/src/lib/components/crm-custom-field-control.d.ts +26 -0
  122. package/src/lib/components/crm-custom-field-control.js +131 -0
  123. package/src/lib/components/crm-custom-field-control.js.map +1 -0
  124. package/src/lib/components/crm-email-template-tools.d.ts +69 -0
  125. package/src/lib/components/crm-email-template-tools.js +240 -0
  126. package/src/lib/components/crm-email-template-tools.js.map +1 -0
  127. package/src/lib/components/crm-export-all-button.d.ts +39 -0
  128. package/src/lib/components/crm-export-all-button.js +98 -0
  129. package/src/lib/components/crm-export-all-button.js.map +1 -0
  130. package/src/lib/components/crm-filter-bar.d.ts +53 -0
  131. package/src/lib/components/crm-filter-bar.js +294 -0
  132. package/src/lib/components/crm-filter-bar.js.map +1 -0
  133. package/src/lib/components/crm-glance-card.d.ts +54 -0
  134. package/src/lib/components/crm-glance-card.js +219 -0
  135. package/src/lib/components/crm-glance-card.js.map +1 -0
  136. package/src/lib/components/crm-next-activity-column.d.ts +35 -0
  137. package/src/lib/components/crm-next-activity-column.js +100 -0
  138. package/src/lib/components/crm-next-activity-column.js.map +1 -0
  139. package/src/lib/components/crm-record-header.d.ts +97 -0
  140. package/src/lib/components/crm-record-header.js +160 -0
  141. package/src/lib/components/crm-record-header.js.map +1 -0
  142. package/src/lib/components/crm-record-insights-zone.d.ts +50 -0
  143. package/src/lib/components/crm-record-insights-zone.js +169 -0
  144. package/src/lib/components/crm-record-insights-zone.js.map +1 -0
  145. package/src/lib/components/crm-record-picker.d.ts +42 -0
  146. package/src/lib/components/crm-record-picker.js +104 -0
  147. package/src/lib/components/crm-record-picker.js.map +1 -0
  148. package/src/lib/components/crm-send-email-button.d.ts +39 -0
  149. package/src/lib/components/crm-send-email-button.js +81 -0
  150. package/src/lib/components/crm-send-email-button.js.map +1 -0
  151. package/src/lib/components/crm-send-email-dialog.d.ts +61 -0
  152. package/src/lib/components/crm-send-email-dialog.js +851 -0
  153. package/src/lib/components/crm-send-email-dialog.js.map +1 -0
  154. package/src/lib/components/crm-site-picker.d.ts +61 -0
  155. package/src/lib/components/crm-site-picker.js +99 -0
  156. package/src/lib/components/crm-site-picker.js.map +1 -0
  157. package/src/lib/components/crm-suite-lock.d.ts +29 -0
  158. package/src/lib/components/crm-suite-lock.js +114 -0
  159. package/src/lib/components/crm-suite-lock.js.map +1 -0
  160. package/src/lib/components/crm-tasks-due-card.d.ts +42 -0
  161. package/src/lib/components/crm-tasks-due-card.js +225 -0
  162. package/src/lib/components/crm-tasks-due-card.js.map +1 -0
  163. package/src/lib/components/crm-views-control.d.ts +65 -0
  164. package/src/lib/components/crm-views-control.js +518 -0
  165. package/src/lib/components/crm-views-control.js.map +1 -0
  166. package/src/lib/components/csv-import-drawer.d.ts +132 -0
  167. package/src/lib/components/csv-import-drawer.js +746 -0
  168. package/src/lib/components/csv-import-drawer.js.map +1 -0
  169. package/src/lib/components/deal-board.d.ts +70 -0
  170. package/src/lib/components/deal-board.js +478 -0
  171. package/src/lib/components/deal-board.js.map +1 -0
  172. package/src/lib/components/deal-detail-page.d.ts +18 -0
  173. package/src/lib/components/deal-detail-page.js +323 -0
  174. package/src/lib/components/deal-detail-page.js.map +1 -0
  175. package/src/lib/components/deal-edit-drawer.d.ts +59 -0
  176. package/src/lib/components/deal-edit-drawer.js +640 -0
  177. package/src/lib/components/deal-edit-drawer.js.map +1 -0
  178. package/src/lib/components/deal-import-drawer.d.ts +24 -0
  179. package/src/lib/components/deal-import-drawer.js +83 -0
  180. package/src/lib/components/deal-import-drawer.js.map +1 -0
  181. package/src/lib/components/deal-products-card.d.ts +48 -0
  182. package/src/lib/components/deal-products-card.js +614 -0
  183. package/src/lib/components/deal-products-card.js.map +1 -0
  184. package/src/lib/components/deal-properties-card.d.ts +29 -0
  185. package/src/lib/components/deal-properties-card.js +144 -0
  186. package/src/lib/components/deal-properties-card.js.map +1 -0
  187. package/src/lib/components/deal-stage-card.d.ts +24 -0
  188. package/src/lib/components/deal-stage-card.js +199 -0
  189. package/src/lib/components/deal-stage-card.js.map +1 -0
  190. package/src/lib/components/deals-bulk-bar.d.ts +31 -0
  191. package/src/lib/components/deals-bulk-bar.js +340 -0
  192. package/src/lib/components/deals-bulk-bar.js.map +1 -0
  193. package/src/lib/components/deals-section.d.ts +49 -0
  194. package/src/lib/components/deals-section.js +767 -0
  195. package/src/lib/components/deals-section.js.map +1 -0
  196. package/src/lib/components/email-capture-card.d.ts +42 -0
  197. package/src/lib/components/email-capture-card.js +134 -0
  198. package/src/lib/components/email-capture-card.js.map +1 -0
  199. package/src/lib/components/email-template-drawer.d.ts +33 -0
  200. package/src/lib/components/email-template-drawer.js +209 -0
  201. package/src/lib/components/email-template-drawer.js.map +1 -0
  202. package/src/lib/components/email-templates-card.d.ts +33 -0
  203. package/src/lib/components/email-templates-card.js +370 -0
  204. package/src/lib/components/email-templates-card.js.map +1 -0
  205. package/src/lib/components/erase-person-action.d.ts +92 -0
  206. package/src/lib/components/erase-person-action.js +261 -0
  207. package/src/lib/components/erase-person-action.js.map +1 -0
  208. package/src/lib/components/fields-section.d.ts +37 -0
  209. package/src/lib/components/fields-section.js +641 -0
  210. package/src/lib/components/fields-section.js.map +1 -0
  211. package/src/lib/components/form-contact-fields-card.d.ts +46 -0
  212. package/src/lib/components/form-contact-fields-card.js +253 -0
  213. package/src/lib/components/form-contact-fields-card.js.map +1 -0
  214. package/src/lib/components/insert-link-at-caret.d.ts +28 -0
  215. package/src/lib/components/insert-link-at-caret.js +37 -0
  216. package/src/lib/components/insert-link-at-caret.js.map +1 -0
  217. package/src/lib/components/lead-convert-dialog.d.ts +32 -0
  218. package/src/lib/components/lead-convert-dialog.js +493 -0
  219. package/src/lib/components/lead-convert-dialog.js.map +1 -0
  220. package/src/lib/components/lead-detail-page.d.ts +16 -0
  221. package/src/lib/components/lead-detail-page.js +163 -0
  222. package/src/lib/components/lead-detail-page.js.map +1 -0
  223. package/src/lib/components/lead-history-card.d.ts +32 -0
  224. package/src/lib/components/lead-history-card.js +165 -0
  225. package/src/lib/components/lead-history-card.js.map +1 -0
  226. package/src/lib/components/lead-import-drawer.d.ts +24 -0
  227. package/src/lib/components/lead-import-drawer.js +95 -0
  228. package/src/lib/components/lead-import-drawer.js.map +1 -0
  229. package/src/lib/components/lead-owner-select.d.ts +35 -0
  230. package/src/lib/components/lead-owner-select.js +91 -0
  231. package/src/lib/components/lead-owner-select.js.map +1 -0
  232. package/src/lib/components/lead-properties-card.d.ts +61 -0
  233. package/src/lib/components/lead-properties-card.js +395 -0
  234. package/src/lib/components/lead-properties-card.js.map +1 -0
  235. package/src/lib/components/lead-status-chip.d.ts +12 -0
  236. package/src/lib/components/lead-status-chip.js +43 -0
  237. package/src/lib/components/lead-status-chip.js.map +1 -0
  238. package/src/lib/components/lead-surfaces-note.d.ts +126 -0
  239. package/src/lib/components/lead-surfaces-note.js +262 -0
  240. package/src/lib/components/lead-surfaces-note.js.map +1 -0
  241. package/src/lib/components/lead-unqualify-dialog.d.ts +24 -0
  242. package/src/lib/components/lead-unqualify-dialog.js +125 -0
  243. package/src/lib/components/lead-unqualify-dialog.js.map +1 -0
  244. package/src/lib/components/leads-bulk-bar.d.ts +58 -0
  245. package/src/lib/components/leads-bulk-bar.js +307 -0
  246. package/src/lib/components/leads-bulk-bar.js.map +1 -0
  247. package/src/lib/components/leads-section.d.ts +23 -0
  248. package/src/lib/components/leads-section.js +664 -0
  249. package/src/lib/components/leads-section.js.map +1 -0
  250. package/src/lib/components/linked-deals-card.d.ts +32 -0
  251. package/src/lib/components/linked-deals-card.js +163 -0
  252. package/src/lib/components/linked-deals-card.js.map +1 -0
  253. package/src/lib/components/log-activity-dialog.d.ts +60 -0
  254. package/src/lib/components/log-activity-dialog.js +368 -0
  255. package/src/lib/components/log-activity-dialog.js.map +1 -0
  256. package/src/lib/components/lost-reason-dialog.d.ts +26 -0
  257. package/src/lib/components/lost-reason-dialog.js +95 -0
  258. package/src/lib/components/lost-reason-dialog.js.map +1 -0
  259. package/src/lib/components/new-contact-drawer.d.ts +78 -0
  260. package/src/lib/components/new-contact-drawer.js +343 -0
  261. package/src/lib/components/new-contact-drawer.js.map +1 -0
  262. package/src/lib/components/org-lead-surfaces-note.d.ts +57 -0
  263. package/src/lib/components/org-lead-surfaces-note.js +172 -0
  264. package/src/lib/components/org-lead-surfaces-note.js.map +1 -0
  265. package/src/lib/components/owner-avatar.d.ts +18 -0
  266. package/src/lib/components/owner-avatar.js +61 -0
  267. package/src/lib/components/owner-avatar.js.map +1 -0
  268. package/src/lib/components/pipeline-stages-dialog.d.ts +43 -0
  269. package/src/lib/components/pipeline-stages-dialog.js +339 -0
  270. package/src/lib/components/pipeline-stages-dialog.js.map +1 -0
  271. package/src/lib/components/pipelines-dialog.d.ts +55 -0
  272. package/src/lib/components/pipelines-dialog.js +517 -0
  273. package/src/lib/components/pipelines-dialog.js.map +1 -0
  274. package/src/lib/components/recent-activity-feed.d.ts +39 -0
  275. package/src/lib/components/recent-activity-feed.js +103 -0
  276. package/src/lib/components/recent-activity-feed.js.map +1 -0
  277. package/src/lib/components/recipes-card.d.ts +39 -0
  278. package/src/lib/components/recipes-card.js +485 -0
  279. package/src/lib/components/recipes-card.js.map +1 -0
  280. package/src/lib/components/record-activity-card.d.ts +26 -0
  281. package/src/lib/components/record-activity-card.js +121 -0
  282. package/src/lib/components/record-activity-card.js.map +1 -0
  283. package/src/lib/components/record-files-card.d.ts +67 -0
  284. package/src/lib/components/record-files-card.js +290 -0
  285. package/src/lib/components/record-files-card.js.map +1 -0
  286. package/src/lib/components/record-tasks-card.d.ts +32 -0
  287. package/src/lib/components/record-tasks-card.js +306 -0
  288. package/src/lib/components/record-tasks-card.js.map +1 -0
  289. package/src/lib/components/reports/activity-card.d.ts +57 -0
  290. package/src/lib/components/reports/activity-card.js +281 -0
  291. package/src/lib/components/reports/activity-card.js.map +1 -0
  292. package/src/lib/components/reports/closed-deals-card.d.ts +20 -0
  293. package/src/lib/components/reports/closed-deals-card.js +194 -0
  294. package/src/lib/components/reports/closed-deals-card.js.map +1 -0
  295. package/src/lib/components/reports/contacts-mix-card.d.ts +27 -0
  296. package/src/lib/components/reports/contacts-mix-card.js +161 -0
  297. package/src/lib/components/reports/contacts-mix-card.js.map +1 -0
  298. package/src/lib/components/reports/contacts-trend-card.d.ts +31 -0
  299. package/src/lib/components/reports/contacts-trend-card.js +144 -0
  300. package/src/lib/components/reports/contacts-trend-card.js.map +1 -0
  301. package/src/lib/components/reports/forecast-card.d.ts +22 -0
  302. package/src/lib/components/reports/forecast-card.js +251 -0
  303. package/src/lib/components/reports/forecast-card.js.map +1 -0
  304. package/src/lib/components/reports/lead-counts.d.ts +32 -0
  305. package/src/lib/components/reports/lead-counts.js +44 -0
  306. package/src/lib/components/reports/lead-counts.js.map +1 -0
  307. package/src/lib/components/reports/lead-funnel-card.d.ts +38 -0
  308. package/src/lib/components/reports/lead-funnel-card.js +375 -0
  309. package/src/lib/components/reports/lead-funnel-card.js.map +1 -0
  310. package/src/lib/components/reports/pipeline-card.d.ts +19 -0
  311. package/src/lib/components/reports/pipeline-card.js +338 -0
  312. package/src/lib/components/reports/pipeline-card.js.map +1 -0
  313. package/src/lib/components/reports/report-bar-chart.d.ts +39 -0
  314. package/src/lib/components/reports/report-bar-chart.js +133 -0
  315. package/src/lib/components/reports/report-bar-chart.js.map +1 -0
  316. package/src/lib/components/reports/report-breakdown.d.ts +32 -0
  317. package/src/lib/components/reports/report-breakdown.js +105 -0
  318. package/src/lib/components/reports/report-breakdown.js.map +1 -0
  319. package/src/lib/components/reports/report-export.d.ts +37 -0
  320. package/src/lib/components/reports/report-export.js +66 -0
  321. package/src/lib/components/reports/report-export.js.map +1 -0
  322. package/src/lib/components/reports/report-format.d.ts +36 -0
  323. package/src/lib/components/reports/report-format.js +43 -0
  324. package/src/lib/components/reports/report-format.js.map +1 -0
  325. package/src/lib/components/reports/report-scope.d.ts +81 -0
  326. package/src/lib/components/reports/report-scope.js +58 -0
  327. package/src/lib/components/reports/report-scope.js.map +1 -0
  328. package/src/lib/components/reports/report-stat-tile.d.ts +47 -0
  329. package/src/lib/components/reports/report-stat-tile.js +96 -0
  330. package/src/lib/components/reports/report-stat-tile.js.map +1 -0
  331. package/src/lib/components/reports/source-conversion-card.d.ts +28 -0
  332. package/src/lib/components/reports/source-conversion-card.js +205 -0
  333. package/src/lib/components/reports/source-conversion-card.js.map +1 -0
  334. package/src/lib/components/reports/tasks-card.d.ts +26 -0
  335. package/src/lib/components/reports/tasks-card.js +279 -0
  336. package/src/lib/components/reports/tasks-card.js.map +1 -0
  337. package/src/lib/components/reports/use-aggregate-read.d.ts +99 -0
  338. package/src/lib/components/reports/use-aggregate-read.js +195 -0
  339. package/src/lib/components/reports/use-aggregate-read.js.map +1 -0
  340. package/src/lib/components/reports/won-lost-by-owner-card.d.ts +30 -0
  341. package/src/lib/components/reports/won-lost-by-owner-card.js +168 -0
  342. package/src/lib/components/reports/won-lost-by-owner-card.js.map +1 -0
  343. package/src/lib/components/reports-section.d.ts +42 -0
  344. package/src/lib/components/reports-section.js +308 -0
  345. package/src/lib/components/reports-section.js.map +1 -0
  346. package/src/lib/components/sending-addresses-card.d.ts +49 -0
  347. package/src/lib/components/sending-addresses-card.js +262 -0
  348. package/src/lib/components/sending-addresses-card.js.map +1 -0
  349. package/src/lib/components/settings-section.d.ts +151 -0
  350. package/src/lib/components/settings-section.js +783 -0
  351. package/src/lib/components/settings-section.js.map +1 -0
  352. package/src/lib/components/task-cells.d.ts +51 -0
  353. package/src/lib/components/task-cells.js +139 -0
  354. package/src/lib/components/task-cells.js.map +1 -0
  355. package/src/lib/components/task-edit-drawer.d.ts +53 -0
  356. package/src/lib/components/task-edit-drawer.js +483 -0
  357. package/src/lib/components/task-edit-drawer.js.map +1 -0
  358. package/src/lib/components/task-import-drawer.d.ts +24 -0
  359. package/src/lib/components/task-import-drawer.js +82 -0
  360. package/src/lib/components/task-import-drawer.js.map +1 -0
  361. package/src/lib/components/task-snooze-menu.d.ts +65 -0
  362. package/src/lib/components/task-snooze-menu.js +207 -0
  363. package/src/lib/components/task-snooze-menu.js.map +1 -0
  364. package/src/lib/components/tasks-bulk-bar.d.ts +25 -0
  365. package/src/lib/components/tasks-bulk-bar.js +348 -0
  366. package/src/lib/components/tasks-bulk-bar.js.map +1 -0
  367. package/src/lib/components/tasks-calendar.d.ts +38 -0
  368. package/src/lib/components/tasks-calendar.js +228 -0
  369. package/src/lib/components/tasks-calendar.js.map +1 -0
  370. package/src/lib/components/tasks-section.d.ts +27 -0
  371. package/src/lib/components/tasks-section.js +579 -0
  372. package/src/lib/components/tasks-section.js.map +1 -0
  373. package/src/lib/components/use-contact-campaign-emails.d.ts +32 -0
  374. package/src/lib/components/use-contact-campaign-emails.js +83 -0
  375. package/src/lib/components/use-contact-campaign-emails.js.map +1 -0
  376. package/src/lib/components/use-crm-api.d.ts +44 -0
  377. package/src/lib/components/use-crm-api.js +84 -0
  378. package/src/lib/components/use-crm-api.js.map +1 -0
  379. package/src/lib/components/use-crm-inbound-address.d.ts +60 -0
  380. package/src/lib/components/use-crm-inbound-address.js +124 -0
  381. package/src/lib/components/use-crm-inbound-address.js.map +1 -0
  382. package/src/lib/components/use-emails-hub-path.d.ts +24 -0
  383. package/src/lib/components/use-emails-hub-path.js +59 -0
  384. package/src/lib/components/use-emails-hub-path.js.map +1 -0
  385. package/src/lib/components/use-member-email-aliases.d.ts +54 -0
  386. package/src/lib/components/use-member-email-aliases.js +186 -0
  387. package/src/lib/components/use-member-email-aliases.js.map +1 -0
  388. package/src/lib/components/use-org-members.d.ts +40 -0
  389. package/src/lib/components/use-org-members.js +100 -0
  390. package/src/lib/components/use-org-members.js.map +1 -0
  391. package/src/lib/constants/api-routes.d.ts +109 -0
  392. package/src/lib/constants/api-routes.js +74 -0
  393. package/src/lib/constants/api-routes.js.map +1 -0
  394. package/src/lib/constants/bundle-common.d.ts +14 -0
  395. package/src/lib/constants/bundle-common.js +14 -0
  396. package/src/lib/constants/bundle-common.js.map +1 -0
  397. package/src/lib/constants/company-filters.d.ts +18 -0
  398. package/src/lib/constants/company-filters.js +51 -0
  399. package/src/lib/constants/company-filters.js.map +1 -0
  400. package/src/lib/constants/contact-filters.d.ts +38 -0
  401. package/src/lib/constants/contact-filters.js +294 -0
  402. package/src/lib/constants/contact-filters.js.map +1 -0
  403. package/src/lib/hooks/use-contact-field-definitions.d.ts +48 -0
  404. package/src/lib/hooks/use-contact-field-definitions.js +72 -0
  405. package/src/lib/hooks/use-contact-field-definitions.js.map +1 -0
  406. package/src/lib/hooks/use-contact-update.d.ts +25 -0
  407. package/src/lib/hooks/use-contact-update.js +80 -0
  408. package/src/lib/hooks/use-contact-update.js.map +1 -0
  409. package/src/lib/hooks/use-crm-activity-logger.d.ts +73 -0
  410. package/src/lib/hooks/use-crm-activity-logger.js +101 -0
  411. package/src/lib/hooks/use-crm-activity-logger.js.map +1 -0
  412. package/src/lib/hooks/use-crm-bulk-apply.d.ts +52 -0
  413. package/src/lib/hooks/use-crm-bulk-apply.js +112 -0
  414. package/src/lib/hooks/use-crm-bulk-apply.js.map +1 -0
  415. package/src/lib/hooks/use-crm-default-view.d.ts +24 -0
  416. package/src/lib/hooks/use-crm-default-view.js +64 -0
  417. package/src/lib/hooks/use-crm-default-view.js.map +1 -0
  418. package/src/lib/hooks/use-crm-email-templates.d.ts +59 -0
  419. package/src/lib/hooks/use-crm-email-templates.js +103 -0
  420. package/src/lib/hooks/use-crm-email-templates.js.map +1 -0
  421. package/src/lib/hooks/use-crm-hub-path.d.ts +29 -0
  422. package/src/lib/hooks/use-crm-hub-path.js +41 -0
  423. package/src/lib/hooks/use-crm-hub-path.js.map +1 -0
  424. package/src/lib/hooks/use-crm-org-mount.d.ts +97 -0
  425. package/src/lib/hooks/use-crm-org-mount.js +215 -0
  426. package/src/lib/hooks/use-crm-org-mount.js.map +1 -0
  427. package/src/lib/hooks/use-crm-record-names.d.ts +52 -0
  428. package/src/lib/hooks/use-crm-record-names.js +126 -0
  429. package/src/lib/hooks/use-crm-record-names.js.map +1 -0
  430. package/src/lib/hooks/use-crm-records-quota.d.ts +68 -0
  431. package/src/lib/hooks/use-crm-records-quota.js +118 -0
  432. package/src/lib/hooks/use-crm-records-quota.js.map +1 -0
  433. package/src/lib/hooks/use-crm-saved-view.d.ts +96 -0
  434. package/src/lib/hooks/use-crm-saved-view.js +329 -0
  435. package/src/lib/hooks/use-crm-saved-view.js.map +1 -0
  436. package/src/lib/hooks/use-crm-scope.d.ts +117 -0
  437. package/src/lib/hooks/use-crm-scope.js +147 -0
  438. package/src/lib/hooks/use-crm-scope.js.map +1 -0
  439. package/src/lib/hooks/use-crm-tasks.d.ts +85 -0
  440. package/src/lib/hooks/use-crm-tasks.js +153 -0
  441. package/src/lib/hooks/use-crm-tasks.js.map +1 -0
  442. package/src/lib/hooks/use-crm-view-grid.d.ts +55 -0
  443. package/src/lib/hooks/use-crm-view-grid.js +170 -0
  444. package/src/lib/hooks/use-crm-view-grid.js.map +1 -0
  445. package/src/lib/hooks/use-crm-views.d.ts +42 -0
  446. package/src/lib/hooks/use-crm-views.js +84 -0
  447. package/src/lib/hooks/use-crm-views.js.map +1 -0
  448. package/src/lib/hooks/use-deal-stage-api.d.ts +69 -0
  449. package/src/lib/hooks/use-deal-stage-api.js +78 -0
  450. package/src/lib/hooks/use-deal-stage-api.js.map +1 -0
  451. package/src/lib/hooks/use-deals.d.ts +47 -0
  452. package/src/lib/hooks/use-deals.js +105 -0
  453. package/src/lib/hooks/use-deals.js.map +1 -0
  454. package/src/lib/hooks/use-org-leads.d.ts +53 -0
  455. package/src/lib/hooks/use-org-leads.js +114 -0
  456. package/src/lib/hooks/use-org-leads.js.map +1 -0
  457. package/src/lib/hooks/use-org-member-directory.d.ts +36 -0
  458. package/src/lib/hooks/use-org-member-directory.js +116 -0
  459. package/src/lib/hooks/use-org-member-directory.js.map +1 -0
  460. package/src/lib/hooks/use-org-member-options.d.ts +38 -0
  461. package/src/lib/hooks/use-org-member-options.js +131 -0
  462. package/src/lib/hooks/use-org-member-options.js.map +1 -0
  463. package/src/lib/hooks/use-pipeline.d.ts +71 -0
  464. package/src/lib/hooks/use-pipeline.js +159 -0
  465. package/src/lib/hooks/use-pipeline.js.map +1 -0
  466. package/src/lib/model/companies-bulk-writes.d.ts +40 -0
  467. package/src/lib/model/companies-bulk-writes.js +103 -0
  468. package/src/lib/model/companies-bulk-writes.js.map +1 -0
  469. package/src/lib/model/companies-csv.d.ts +36 -0
  470. package/src/lib/model/companies-csv.js +38 -0
  471. package/src/lib/model/companies-csv.js.map +1 -0
  472. package/src/lib/model/companies.d.ts +99 -0
  473. package/src/lib/model/companies.js +168 -0
  474. package/src/lib/model/companies.js.map +1 -0
  475. package/src/lib/model/company-delete-route.d.ts +43 -0
  476. package/src/lib/model/company-delete-route.js +31 -0
  477. package/src/lib/model/company-delete-route.js.map +1 -0
  478. package/src/lib/model/company-delete.d.ts +42 -0
  479. package/src/lib/model/company-delete.js +52 -0
  480. package/src/lib/model/company-delete.js.map +1 -0
  481. package/src/lib/model/contact-duplicates.d.ts +58 -0
  482. package/src/lib/model/contact-duplicates.js +67 -0
  483. package/src/lib/model/contact-duplicates.js.map +1 -0
  484. package/src/lib/model/contact-record.d.ts +113 -0
  485. package/src/lib/model/contact-record.js +70 -0
  486. package/src/lib/model/contact-record.js.map +1 -0
  487. package/src/lib/model/contact-update.d.ts +93 -0
  488. package/src/lib/model/contact-update.js +50 -0
  489. package/src/lib/model/contact-update.js.map +1 -0
  490. package/src/lib/model/contacts-bulk-writes.d.ts +173 -0
  491. package/src/lib/model/contacts-bulk-writes.js +196 -0
  492. package/src/lib/model/contacts-bulk-writes.js.map +1 -0
  493. package/src/lib/model/contacts-csv.d.ts +54 -0
  494. package/src/lib/model/contacts-csv.js +67 -0
  495. package/src/lib/model/contacts-csv.js.map +1 -0
  496. package/src/lib/model/contacts-list-seed.d.ts +51 -0
  497. package/src/lib/model/contacts-list-seed.js +63 -0
  498. package/src/lib/model/contacts-list-seed.js.map +1 -0
  499. package/src/lib/model/crm-activity-report.d.ts +27 -0
  500. package/src/lib/model/crm-activity-report.js +56 -0
  501. package/src/lib/model/crm-activity-report.js.map +1 -0
  502. package/src/lib/model/crm-api.d.ts +49 -0
  503. package/src/lib/model/crm-api.js +47 -0
  504. package/src/lib/model/crm-api.js.map +1 -0
  505. package/src/lib/model/crm-bulk-writes.d.ts +147 -0
  506. package/src/lib/model/crm-bulk-writes.js +207 -0
  507. package/src/lib/model/crm-bulk-writes.js.map +1 -0
  508. package/src/lib/model/crm-company-import.d.ts +154 -0
  509. package/src/lib/model/crm-company-import.js +331 -0
  510. package/src/lib/model/crm-company-import.js.map +1 -0
  511. package/src/lib/model/crm-custom-draft.d.ts +62 -0
  512. package/src/lib/model/crm-custom-draft.js +67 -0
  513. package/src/lib/model/crm-custom-draft.js.map +1 -0
  514. package/src/lib/model/crm-deal-import.d.ts +112 -0
  515. package/src/lib/model/crm-deal-import.js +263 -0
  516. package/src/lib/model/crm-deal-import.js.map +1 -0
  517. package/src/lib/model/crm-import.d.ts +244 -0
  518. package/src/lib/model/crm-import.js +466 -0
  519. package/src/lib/model/crm-import.js.map +1 -0
  520. package/src/lib/model/crm-lead-import.d.ts +105 -0
  521. package/src/lib/model/crm-lead-import.js +255 -0
  522. package/src/lib/model/crm-lead-import.js.map +1 -0
  523. package/src/lib/model/crm-record-routes.d.ts +21 -0
  524. package/src/lib/model/crm-record-routes.js +70 -0
  525. package/src/lib/model/crm-record-routes.js.map +1 -0
  526. package/src/lib/model/crm-routes.d.ts +101 -0
  527. package/src/lib/model/crm-routes.js +92 -0
  528. package/src/lib/model/crm-routes.js.map +1 -0
  529. package/src/lib/model/crm-task-import.d.ts +94 -0
  530. package/src/lib/model/crm-task-import.js +275 -0
  531. package/src/lib/model/crm-task-import.js.map +1 -0
  532. package/src/lib/model/crm-view-param.d.ts +43 -0
  533. package/src/lib/model/crm-view-param.js +49 -0
  534. package/src/lib/model/crm-view-param.js.map +1 -0
  535. package/src/lib/model/deal-board-model.d.ts +241 -0
  536. package/src/lib/model/deal-board-model.js +439 -0
  537. package/src/lib/model/deal-board-model.js.map +1 -0
  538. package/src/lib/model/deal-form-model.d.ts +114 -0
  539. package/src/lib/model/deal-form-model.js +218 -0
  540. package/src/lib/model/deal-form-model.js.map +1 -0
  541. package/src/lib/model/deals-csv.d.ts +32 -0
  542. package/src/lib/model/deals-csv.js +37 -0
  543. package/src/lib/model/deals-csv.js.map +1 -0
  544. package/src/lib/model/import-column-shapes.d.ts +36 -0
  545. package/src/lib/model/import-column-shapes.js +76 -0
  546. package/src/lib/model/import-column-shapes.js.map +1 -0
  547. package/src/lib/model/lead-company-suggestion.d.ts +61 -0
  548. package/src/lib/model/lead-company-suggestion.js +65 -0
  549. package/src/lib/model/lead-company-suggestion.js.map +1 -0
  550. package/src/lib/model/lead-filters.d.ts +29 -0
  551. package/src/lib/model/lead-filters.js +39 -0
  552. package/src/lib/model/lead-filters.js.map +1 -0
  553. package/src/lib/model/lead-surfaces.d.ts +58 -0
  554. package/src/lib/model/lead-surfaces.js +67 -0
  555. package/src/lib/model/lead-surfaces.js.map +1 -0
  556. package/src/lib/model/leads-csv.d.ts +40 -0
  557. package/src/lib/model/leads-csv.js +40 -0
  558. package/src/lib/model/leads-csv.js.map +1 -0
  559. package/src/lib/model/next-activity-api.d.ts +31 -0
  560. package/src/lib/model/next-activity-api.js +57 -0
  561. package/src/lib/model/next-activity-api.js.map +1 -0
  562. package/src/lib/model/next-activity.d.ts +64 -0
  563. package/src/lib/model/next-activity.js +47 -0
  564. package/src/lib/model/next-activity.js.map +1 -0
  565. package/src/lib/model/person-key-web.d.ts +43 -0
  566. package/src/lib/model/person-key-web.js +52 -0
  567. package/src/lib/model/person-key-web.js.map +1 -0
  568. package/src/lib/model/record-facts.d.ts +282 -0
  569. package/src/lib/model/record-facts.js +434 -0
  570. package/src/lib/model/record-facts.js.map +1 -0
  571. package/src/lib/model/task-api.d.ts +28 -0
  572. package/src/lib/model/task-api.js +57 -0
  573. package/src/lib/model/task-api.js.map +1 -0
  574. package/src/lib/model/task-calendar.d.ts +108 -0
  575. package/src/lib/model/task-calendar.js +139 -0
  576. package/src/lib/model/task-calendar.js.map +1 -0
  577. package/src/lib/model/task-routes.d.ts +177 -0
  578. package/src/lib/model/task-routes.js +197 -0
  579. package/src/lib/model/task-routes.js.map +1 -0
  580. package/src/lib/model/task-scope.d.ts +45 -0
  581. package/src/lib/model/task-scope.js +51 -0
  582. package/src/lib/model/task-scope.js.map +1 -0
  583. package/src/lib/model/task-views.d.ts +149 -0
  584. package/src/lib/model/task-views.js +286 -0
  585. package/src/lib/model/task-views.js.map +1 -0
  586. package/src/lib/model/tasks-csv.d.ts +28 -0
  587. package/src/lib/model/tasks-csv.js +28 -0
  588. package/src/lib/model/tasks-csv.js.map +1 -0
  589. package/src/lib/plugin.d.ts +32 -0
  590. package/src/lib/plugin.js +208 -0
  591. package/src/lib/plugin.js.map +1 -0
  592. package/src/lib/server/companies-import.d.ts +57 -0
  593. package/src/lib/server/companies-import.js +242 -0
  594. package/src/lib/server/companies-import.js.map +1 -0
  595. package/src/lib/server/company-delete.d.ts +59 -0
  596. package/src/lib/server/company-delete.js +146 -0
  597. package/src/lib/server/company-delete.js.map +1 -0
  598. package/src/lib/server/contact-email-history.d.ts +82 -0
  599. package/src/lib/server/contact-email-history.js +264 -0
  600. package/src/lib/server/contact-email-history.js.map +1 -0
  601. package/src/lib/server/contact-profile.d.ts +41 -0
  602. package/src/lib/server/contact-profile.js +45 -0
  603. package/src/lib/server/contact-profile.js.map +1 -0
  604. package/src/lib/server/contact-update.d.ts +92 -0
  605. package/src/lib/server/contact-update.js +512 -0
  606. package/src/lib/server/contact-update.js.map +1 -0
  607. package/src/lib/server/contacts-import.d.ts +73 -0
  608. package/src/lib/server/contacts-import.js +263 -0
  609. package/src/lib/server/contacts-import.js.map +1 -0
  610. package/src/lib/server/contacts-merge.d.ts +86 -0
  611. package/src/lib/server/contacts-merge.js +206 -0
  612. package/src/lib/server/contacts-merge.js.map +1 -0
  613. package/src/lib/server/deals-import.d.ts +76 -0
  614. package/src/lib/server/deals-import.js +246 -0
  615. package/src/lib/server/deals-import.js.map +1 -0
  616. package/src/lib/server/email-send.d.ts +119 -0
  617. package/src/lib/server/email-send.js +667 -0
  618. package/src/lib/server/email-send.js.map +1 -0
  619. package/src/lib/server/email-template-duplicate.d.ts +19 -0
  620. package/src/lib/server/email-template-duplicate.js +206 -0
  621. package/src/lib/server/email-template-duplicate.js.map +1 -0
  622. package/src/lib/server/erase-person.d.ts +108 -0
  623. package/src/lib/server/erase-person.js +309 -0
  624. package/src/lib/server/erase-person.js.map +1 -0
  625. package/src/lib/server/import-context.d.ts +85 -0
  626. package/src/lib/server/import-context.js +181 -0
  627. package/src/lib/server/import-context.js.map +1 -0
  628. package/src/lib/server/inbound-address.d.ts +61 -0
  629. package/src/lib/server/inbound-address.js +188 -0
  630. package/src/lib/server/inbound-address.js.map +1 -0
  631. package/src/lib/server/lead-convert.d.ts +78 -0
  632. package/src/lib/server/lead-convert.js +250 -0
  633. package/src/lib/server/lead-convert.js.map +1 -0
  634. package/src/lib/server/leads-import.d.ts +84 -0
  635. package/src/lib/server/leads-import.js +261 -0
  636. package/src/lib/server/leads-import.js.map +1 -0
  637. package/src/lib/server/next-activity-routes.d.ts +33 -0
  638. package/src/lib/server/next-activity-routes.js +110 -0
  639. package/src/lib/server/next-activity-routes.js.map +1 -0
  640. package/src/lib/server/org-activity.d.ts +61 -0
  641. package/src/lib/server/org-activity.js +120 -0
  642. package/src/lib/server/org-activity.js.map +1 -0
  643. package/src/lib/server/org-caller.d.ts +110 -0
  644. package/src/lib/server/org-caller.js +154 -0
  645. package/src/lib/server/org-caller.js.map +1 -0
  646. package/src/lib/server/recipe-routes.d.ts +75 -0
  647. package/src/lib/server/recipe-routes.js +442 -0
  648. package/src/lib/server/recipe-routes.js.map +1 -0
  649. package/src/lib/server/record-facts.d.ts +65 -0
  650. package/src/lib/server/record-facts.js +337 -0
  651. package/src/lib/server/record-facts.js.map +1 -0
  652. package/src/lib/server/record-timeline.d.ts +51 -0
  653. package/src/lib/server/record-timeline.js +215 -0
  654. package/src/lib/server/record-timeline.js.map +1 -0
  655. package/src/lib/server/suite-gate.d.ts +42 -0
  656. package/src/lib/server/suite-gate.js +87 -0
  657. package/src/lib/server/suite-gate.js.map +1 -0
  658. package/src/lib/server/task-routes.d.ts +132 -0
  659. package/src/lib/server/task-routes.js +699 -0
  660. package/src/lib/server/task-routes.js.map +1 -0
  661. package/src/lib/server/tasks-import.d.ts +54 -0
  662. package/src/lib/server/tasks-import.js +157 -0
  663. package/src/lib/server/tasks-import.js.map +1 -0
  664. package/src/lib/server-deal-stage.d.ts +88 -0
  665. package/src/lib/server-deal-stage.js +316 -0
  666. package/src/lib/server-deal-stage.js.map +1 -0
  667. package/src/lib/server.d.ts +149 -0
  668. package/src/lib/server.js +615 -0
  669. package/src/lib/server.js.map +1 -0
@@ -0,0 +1,1025 @@
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
+ */ 'use client';
17
+ import { _ as _extends } from "@swc/helpers/_/_extends";
18
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
19
+ import { CONTACT_LIFECYCLE_STAGE_LABELS, CONTACT_LIFECYCLE_STAGES, CONTACT_SOURCE_LABELS, CRM_CONTACT_VIEW_FIELDS, crmContactCustomColumn, crmViewFiltersFromSegment, crmViewSegmentFilters, newResourceScopeFields, ORG_SCOPE_TOKEN, pluginDocsHelp } from "@aglyn/aglyn";
20
+ import { hiddenFilterVisibility, matchListFilter } from "@aglyn/shared-ui-jsx/const/list-filter";
21
+ import { ListTable } from "@aglyn/shared-ui-jsx/components/list-table.component";
22
+ import { CONTACT_LIST_FILTER_FIELDS, CONTACT_LIST_FILTER_HEADERS, contactCustomFilterFields, contactCustomFilterHeaders } from "../constants/contact-filters.js";
23
+ import { contactPrimaryGroup, contactRecordFromDoc } from "../model/contact-record.js";
24
+ import { useCrmOrgMount } from "../hooks/use-crm-org-mount.js";
25
+ import { crmVisibleToClause, useCrmScope } from "../hooks/use-crm-scope.js";
26
+ import { contactsListSeed } from "../model/contacts-list-seed.js";
27
+ import { crmRoutes } from "../model/crm-routes.js";
28
+ import { contactsCsv, downloadTextFile } from "../model/contacts-csv.js";
29
+ import { useCrmRecordsQuota } from "../hooks/use-crm-records-quota.js";
30
+ import { CardDisplay } from "@aglyn/shared-ui-jsx";
31
+ import EmptyStateComponent from "@aglyn/shared-ui-jsx/components/empty-state.component";
32
+ import ContactsBulkBar from "./contacts-bulk-bar.js";
33
+ import { ContactImportButton } from "./contact-import-drawer.js";
34
+ import { useSnackbar } from "@aglyn/shared-ui-snackstack";
35
+ import { listFilterPlan, useFirestore, useFirestoreCollection, useFirestoreDoc, useUser } from "@aglyn/tenant-feature-instance";
36
+ import { Alert, Button, Dialog, DialogActions, DialogContent, DialogTitle, Stack, TextField, Typography } from "@mui/material";
37
+ import { addDoc, collection, deleteDoc, doc, limit, orderBy, query } from "firebase/firestore";
38
+ import { useRouter, useSearchParams } from "next/navigation";
39
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
40
+ import RecentActivityFeed from "./recent-activity-feed.js";
41
+ import { CONTACT_FILTER_COLUMNS, CONTACT_OPTIONAL_COLUMNS, contactListColumns } from "./contact-list-columns.js";
42
+ import NewContactDrawer from "./new-contact-drawer.js";
43
+ import { useCrmApi } from "./use-crm-api.js";
44
+ import { useOrgMembers } from "./use-org-members.js";
45
+ import { useContactFieldDefinitions } from "../hooks/use-contact-field-definitions.js";
46
+ import { customFieldColumns } from "./contact-custom-columns.js";
47
+ import { useCrmSavedView } from "../hooks/use-crm-saved-view.js";
48
+ import { useCrmViewGrid } from "../hooks/use-crm-view-grid.js";
49
+ import { CRM_LIST_SLOTS, CrmColumnOrderProvider } from "./crm-column-menu.js";
50
+ import { NoNextActivityToggle } from "./crm-next-activity-column.js";
51
+ import { useCompanyOptions } from "./company-picker.js";
52
+ import CrmFilterBar from "./crm-filter-bar.js";
53
+ import CrmViewsControl from "./crm-views-control.js";
54
+ import { CrmSuiteLockedButton, CrmSuiteNotice, crmSuiteIncluded } from "./crm-suite-lock.js";
55
+ /**
56
+ * The shared labels, under the name this file has always called them.
57
+ *
58
+ * The map lives beside the `ContactSource` union so the dynamic-list rule
59
+ * editor and this filter cannot disagree about what `order` is called.
60
+ */ const SOURCE_LABELS = CONTACT_SOURCE_LABELS;
61
+ /**
62
+ * What the list keeps out of sight until a view says otherwise: the
63
+ * filter-only columns, which never show, and the optional columns
64
+ * (AGL-2616), which start hidden and come back through the column menu or
65
+ * a saved view's column list.
66
+ */ const HIDDEN_COLUMNS = _extends({}, hiddenFilterVisibility(CONTACT_LIST_FILTER_FIELDS, CONTACT_FILTER_COLUMNS), Object.fromEntries(CONTACT_OPTIONAL_COLUMNS.map((field)=>[
67
+ field,
68
+ false
69
+ ])));
70
+ /**
71
+ * Why a refund found no contact to record itself against (AGL-2329).
72
+ *
73
+ * The three reasons `recordContactRefund` distinguishes, in the operator's
74
+ * language rather than the writer's enum. They are not interchangeable: two
75
+ * of them are things the merchant can act on and one is a deletion nothing
76
+ * should undo, and collapsing them into "unmatched" would turn an actionable
77
+ * fact into a statistic.
78
+ */ const UNMATCHED_REFUND_REASON = {
79
+ 'no-email': 'the order carried no email address',
80
+ 'no-contact': 'no contact record matched the buyer',
81
+ 'contact-deleted': 'the contact was deleted between the sale and the refund'
82
+ };
83
+ /**
84
+ * Contacts CRM (AGL-198): the unified people list fed by AGL-197's
85
+ * ingestion — search, source badges, a profile drawer with the
86
+ * interaction timeline plus tags/notes editing, and CSV export. Part of
87
+ * the CRM, included from Starter (AGL-2851); the contactsPerHost band
88
+ * counts the records in it.
89
+ */ /**
90
+ * Contacts CRM (AGL-109 → AGL-395): the unified contacts list, segments,
91
+ * and profile drawer, owned by the contacts plugin and rendered by the
92
+ * shell's generic plugin route. The shell applies the `release_crm`
93
+ * gate (via the nav tab) and passes the resolved `org` doc for the
94
+ * `contactsPerHost` quota check.
95
+ *
96
+ * Since AGL-2595 this is the `people` SECTION of the Contacts hub rather
97
+ * than the whole page: `crm-console-page.tsx` routes to it, and the
98
+ * companies, deals, tasks, reports and fields sections sit beside it. The
99
+ * body is the v1 page unchanged, and it takes the shell's full prop bag so
100
+ * nothing the v1 page read has to be threaded through the hub by name.
101
+ */ export function ContactsPeopleSection(props) {
102
+ var _ref, _ref1, _ref2, _records_contactsCount, _ref3, _ref4, _ref5, _ref6, _ref7, _filterHeaders_windowClauses__field, _filterHeaders_plan_served_field;
103
+ var _plan_served;
104
+ const { hostId, org, releaseFlag, basePath } = props;
105
+ /*
106
+ * A row is a LINK now (AGL-2596): opening a person navigates to their own
107
+ * page rather than a drawer over the list, so the address can be pasted
108
+ * and every other CRM record can point at it. `basePath` is what the hub
109
+ * hands every section; the empty fallback only exists for a direct mount
110
+ * without the shell, where there is nowhere to navigate to anyway.
111
+ */ const routes = crmRoutes(basePath != null ? basePath : '');
112
+ const router = useRouter();
113
+ // Whether the audience overage on this page is actually INVOICED
114
+ // (AGL-1662), and whether that question has been answered yet.
115
+ //
116
+ // AGL-1604 stopped the usage cron putting `contactsOverageUsd` into
117
+ // `billedCents` while `release_crm` is off for the org; `db5ecdf2b`
118
+ // taught the console billing page's caption the same thing. This page's own
119
+ // alert still quoted the dollar figure with no flag check — and this is the
120
+ // surface a staff member reaches with the flag OFF, because the shell's
121
+ // `FeatureGate` admits them on `visible` (`released || isStaff`). Support
122
+ // then reads that number back to a customer whose invoice will not carry it.
123
+ //
124
+ // The shell resolves this from `released`, never `visible`: staff opening a
125
+ // page does not put a line on the customer's bill.
126
+ //
127
+ // Both default to the WITHHELD answer when the prop is absent, which only
128
+ // happens in a direct mount — the shell always supplies it for a surface
129
+ // with a nav-tab flag. A caller that has not resolved the verdict has not
130
+ // earned the right to quote a charge.
131
+ const contactsBilled = (_ref = releaseFlag == null ? void 0 : releaseFlag.released) != null ? _ref : false;
132
+ const releaseFlagsReady = (_ref1 = releaseFlag == null ? void 0 : releaseFlag.ready) != null ? _ref1 : false;
133
+ // Org-shared data root (AGL-237). Null until the org lookup settles
134
+ // (AGL-1061), and for a host with no owning org — the pre-migration host
135
+ // path this used to fall back to is gone (AGL-1050), so the CRM lists
136
+ // nothing rather than listing somewhere else. Resolved by the one scope
137
+ // hook (AGL-2614), which also answers for the organization-level mount
138
+ // (AGL-2630): there `hostId` is null, the org comes from the hub's mount,
139
+ // and the viewing group and the scope clause are both `null`.
140
+ const crmScope = useCrmScope({
141
+ hostId,
142
+ org
143
+ });
144
+ const { scope: dataScope, orgId, consentGroup, visibleTo: visibleToTokens } = crmScope;
145
+ /*
146
+ * THE CRM (AGL-2788). This list is the CRM's, and the shell mounts no CRM
147
+ * page for a plan without it (AGL-2851). The locks below — adding a person
148
+ * by hand, importing a file, a saved view, the owner, stage and company of
149
+ * a selection — draw only for an org whose plan lacks the CRM. The shell
150
+ * mounts this page only once the org has settled, so the plan read here
151
+ * is an answer.
152
+ */ const suiteIncluded = crmSuiteIncluded(org);
153
+ // The org's site list, at the organization level only — what names the
154
+ // sites in the "Known by" column (AGL-2630).
155
+ const mount = useCrmOrgMount();
156
+ // The org's custom fields, for the optional columns below (AGL-2601).
157
+ const customFields = useContactFieldDefinitions((_ref2 = dataScope == null ? void 0 : dataScope[1]) != null ? _ref2 : null);
158
+ /*==========================================
159
+ * THE CONTROLLER THIS PAGE IS SHOWING.
160
+ *
161
+ * A contact document is shared by every site in the org — one human who
162
+ * touched two sites is one row, which is the dedupe the shared address book
163
+ * exists for and the reason the org is billed once for them. Almost nothing
164
+ * ON that row is shared: the notes, tags, timeline and lifetime value are
165
+ * the holder's own business records, and while they lived at the top of the
166
+ * document every site in an agency's account could read every client's.
167
+ *
168
+ * So the page resolves the group it is being viewed as — the sites declared
169
+ * to be one sender, or this site alone — and reads that group's facet.
170
+ * Pure, from the org document the shell already passed, so it costs no
171
+ * read. `consentGroup` above is that group; at the ORGANIZATION level it
172
+ * is `null`, and each row is flattened through the person's own primary
173
+ * holder instead (`contactPrimaryGroup`), so an org-wide member reads the
174
+ * profile the first capturing site keeps — and the "Known by" column says
175
+ * which other sites hold one.
176
+ *=========================================*/ const firestore = useFirestore();
177
+ const { enqueueSnackbar } = useSnackbar();
178
+ const { data: user } = useUser();
179
+ /*
180
+ * WHAT THE LIST WAS OPENED FOR (AGL-2612).
181
+ *
182
+ * Two surfaces address this list with a question rather than a record: a
183
+ * form's own page ("who came in through this form") and an Inbox
184
+ * submission row ("open the person with this address"). Both arrive as
185
+ * query keys, parsed once into the same filter the grid's panel would
186
+ * produce, so the seeded query IS a typed query and nothing here is a
187
+ * second predicate.
188
+ */ const searchParams = useSearchParams();
189
+ const seed = useMemo(()=>contactsListSeed(searchParams), [
190
+ searchParams
191
+ ]);
192
+ /*
193
+ * The seed as CLAUSES, in front of everything else (AGL-2617).
194
+ *
195
+ * A view holds a list of clauses in the grammar the grid's panel speaks,
196
+ * and the seed is two of them — the form's captures and the address, plus
197
+ * the source the form link names. They lead every state the list works
198
+ * from, whichever view is open, so the query serves the seed (it reaches
199
+ * the whole collection, as it did before views) and a view narrows what
200
+ * comes back. The controller keeps them out of what a view SAVES.
201
+ */ const seedFilters = useMemo(()=>[
202
+ ...seed.filter ? [
203
+ seed.filter
204
+ ] : [],
205
+ ...seed.source ? [
206
+ {
207
+ field: CRM_CONTACT_VIEW_FIELDS.source,
208
+ op: 'equals',
209
+ value: seed.source
210
+ }
211
+ ] : []
212
+ ], [
213
+ seed
214
+ ]);
215
+ const viewInitial = useMemo(()=>({
216
+ filters: seedFilters
217
+ }), [
218
+ seedFilters
219
+ ]);
220
+ const views = useCrmSavedView({
221
+ section: 'contacts',
222
+ hostId,
223
+ org,
224
+ basePath: basePath != null ? basePath : '',
225
+ initial: viewInitial
226
+ });
227
+ /*
228
+ * The grammar this list speaks: the declared fields, and one field per
229
+ * custom contact field the org has defined — so a view can filter on
230
+ * "plan is enterprise" the way it filters on a stage.
231
+ */ const filterFields = useMemo(()=>[
232
+ ...CONTACT_LIST_FILTER_FIELDS,
233
+ ...contactCustomFilterFields(customFields.active)
234
+ ], [
235
+ customFields.active
236
+ ]);
237
+ const filterHeaders = useMemo(()=>_extends({}, CONTACT_LIST_FILTER_HEADERS, contactCustomFilterHeaders(customFields.active)), [
238
+ customFields.active
239
+ ]);
240
+ /*
241
+ * ONE clause on the query, the rest over the window.
242
+ *
243
+ * Firestore takes one array clause per query and composes the rest only
244
+ * through indexes nobody built for every pair of columns, so the first
245
+ * clause the translator can serve is the one that reaches every contact
246
+ * and every other narrows the thousand the query returned. The caption
247
+ * under the bar says which is which; the chips mark the served one.
248
+ */ const plan = useMemo(()=>listFilterPlan(filterFields, views.state.filters), [
249
+ filterFields,
250
+ views.state.filters
251
+ ]);
252
+ const filter = plan.served;
253
+ /**
254
+ * The one filter that cannot carry the scope clause.
255
+ *
256
+ * `formIds` is an `array-contains` on the mirror, and Firestore takes one
257
+ * array clause per query — so this listener drops its `visibleTo`
258
+ * predicate for it, exactly as the company contacts card does for
259
+ * `companyIds`, and the rules then admit the read to an org-wide member
260
+ * only. A scoped member's listener errors instead of listing, and the
261
+ * alert below says so rather than showing an empty form.
262
+ */ const byForm = (filter == null ? void 0 : filter.field) === 'formIds';
263
+ const { data: contactDocs, status: contactsStatus, /**
264
+ * The rows the profile drawer is seeded from are unconfirmed by the
265
+ * server (AGL-1358). This payload is narrower than most sites in this
266
+ * issue — `email`, `sources` and `interactions` are not in it — but the
267
+ * two fields that are, `tags` and `notes`, are BOTH written on every
268
+ * save and both come off the seed. Edit the notes against a cached read
269
+ * and the tags go back with them, and tags are what
270
+ * `contactMatchesSegment` runs on: a saved segment is a campaign
271
+ * audience, so a rollback here silently changes who gets emailed.
272
+ */ fromCache: contactsFromCache } = useFirestoreCollection(()=>{
273
+ if (!dataScope) return null;
274
+ /*
275
+ * ORDERED, and filtered by the QUERY (AGL-2501, AGL-2292).
276
+ *
277
+ * Two bugs shared this one line. `limit(1000)` with no `orderBy` returns
278
+ * documents in ID order — contacts are created with `.add()` and
279
+ * `createResourceUid()`, so that is a pseudo-random SAMPLE of a thousand,
280
+ * and the client `.sort()` below made it look reliably newest-first. An
281
+ * org with forty thousand contacts saw a thousand arbitrary ones,
282
+ * convincingly sorted.
283
+ *
284
+ * The search then ran over that sample, so a name on the wrong side of
285
+ * the cap answered "no contacts match" — the answer a search must never
286
+ * give wrongly, on the list a merchant uses to find one person.
287
+ *
288
+ * The cap STAYS: nobody needs forty thousand rows streamed into a table,
289
+ * and the head-count has been a server aggregate since AGL-1706. What
290
+ * changes is that the thousand are now the newest thousand, and that a
291
+ * filter reaches the whole collection before the cap applies.
292
+ */ const constraints = plan.constraints;
293
+ /*
294
+ * SCOPED, and this is the leak it closes.
295
+ *
296
+ * The listener had no `where()` at all: `hostId` reached it only to
297
+ * resolve which ORG owns the data, so every site in the account listed
298
+ * every contact in the account. An agency's client opened Contacts and
299
+ * read the other clients' customers.
300
+ *
301
+ * `array-contains-any` over the group's tokens is the same predicate
302
+ * the rules evaluate with `hasAny`, so a filtered query is provable
303
+ * per-document and an UNFILTERED one is now permission-denied rather
304
+ * than quietly returning everything.
305
+ */ return query(collection(firestore, dataScope[0], dataScope[1], 'contacts'), // Dropped for the form mirror alone — see `byForm` — and absent at
306
+ // the organization level, where the tokens are `null` (AGL-2630).
307
+ ...byForm ? [] : crmVisibleToClause(visibleToTokens), ...constraints != null ? constraints : [
308
+ orderBy('updatedAt', 'desc')
309
+ ], limit(1000));
310
+ }, [
311
+ firestore,
312
+ dataScope,
313
+ plan.constraints,
314
+ byForm,
315
+ visibleToTokens
316
+ ], {
317
+ idField: '$id'
318
+ });
319
+ /*
320
+ * OPENED FOR ONE ADDRESS: move straight on to the record (AGL-2612).
321
+ *
322
+ * The Inbox links here with an email because a contact's id is minted at
323
+ * capture and nothing outside the CRM holds it; the list is the lookup.
324
+ * Once the seeded `email equals` query has answered with exactly one row,
325
+ * that row is the person and the list is a detour — `replace`, so Back
326
+ * returns to the Inbox rather than to this redirect. Nothing else
327
+ * navigates: no match leaves the filtered list on screen, which is the
328
+ * honest answer for a submission whose contact the band dropped, and a
329
+ * filter the reader has since changed is theirs.
330
+ */ const openedByEmail = useRef(false);
331
+ useEffect(()=>{
332
+ if (openedByEmail.current || !seed.openEmail) return;
333
+ if (contactsStatus !== 'success') return;
334
+ if ((filter == null ? void 0 : filter.field) !== 'email' || filter.value !== seed.openEmail) return;
335
+ const only = (contactDocs != null ? contactDocs : []).length === 1 ? contactDocs == null ? void 0 : contactDocs[0] : null;
336
+ if (!only) return;
337
+ openedByEmail.current = true;
338
+ router.replace(routes.contact(String(only.$id)));
339
+ }, [
340
+ seed.openEmail,
341
+ contactsStatus,
342
+ filter,
343
+ contactDocs,
344
+ router,
345
+ routes
346
+ ]);
347
+ /**
348
+ * Every row, flattened through THIS group's facet.
349
+ *
350
+ * One projection rather than a facet read at each of the nine places that
351
+ * touch `tags`, `notes`, `name` or `interactions`: a surface that reads one
352
+ * of them off the top of the document is a surface showing another
353
+ * holder's records, and nine chances to forget is nine leaks.
354
+ *
355
+ * The canonical `name` is the fallback and the shared identity; a holder's
356
+ * own override wins, so one business renaming a person cannot change what
357
+ * an unrelated business sees.
358
+ */ const contacts = useMemo(()=>(contactDocs != null ? contactDocs : []).map((row)=>contactRecordFromDoc(row, consentGroup != null ? consentGroup : contactPrimaryGroup(row, org))), [
359
+ contactDocs,
360
+ consentGroup,
361
+ org
362
+ ]);
363
+ /*
364
+ * The roster, for the Owner column — read only once a loaded row actually
365
+ * carries an owner. A list of people nobody has assigned never pays for
366
+ * the team list, and the create drawer asks for it in its own right.
367
+ */ const [createOpen, setCreateOpen] = useState(false);
368
+ /*
369
+ * The filter bar's pickers name people and companies, so the roster is
370
+ * also read once the reader has reached for a filter, or is looking at a
371
+ * view that names an owner or a company (AGL-2617).
372
+ */ const [filterOpened, setFilterOpened] = useState(false);
373
+ const namesFilter = views.state.filters.some((clause)=>clause.field === CRM_CONTACT_VIEW_FIELDS.owner || clause.field === CRM_CONTACT_VIEW_FIELDS.company);
374
+ const members = useOrgMembers(orgId, {
375
+ enabled: createOpen || filterOpened || namesFilter || contacts.some((contact)=>Boolean(contact.ownerUid))
376
+ });
377
+ /**
378
+ * The HEAD-COUNT, read as a server-side aggregate (AGL-1706).
379
+ *
380
+ * The listener above is `limit(1000)` and always will be — nobody needs
381
+ * 40,000 rows streamed into a table. What it must not do is answer "how
382
+ * many contacts does this org have", and it did: `contacts.length`
383
+ * saturated at 1,000, which is *exactly* the smallest paid included band
384
+ * (`starter`). So `overageContacts = max(0, used − included)` was 0 on
385
+ * every stock plan and the alert below could not render at all.
386
+ *
387
+ * Worse than the dead alert, the same capped number fed the readout in the
388
+ * toolbar. An org with 40,000 contacts on Pro read "1,000 contacts ·
389
+ * 10,000 included" — a page whose job is telling a customer where they sit
390
+ * in their band, telling them they have room they do not have. The console
391
+ * billing page read the truth from `getCountFromServer` on this very
392
+ * collection, so the two surfaces disagreed about the same org's audience.
393
+ *
394
+ * THE LIST AND THE COUNT ARE DIFFERENT QUESTIONS and now have different
395
+ * answers: one aggregate read per mount, the same call
396
+ * `billing-usage.component.tsx` already makes against the same path.
397
+ *
398
+ * The counting RULE is untouched — `checkCrmRecordsQuota` is an
399
+ * entitlement input and the usage cron is what bills from it. Only this
400
+ * page's input stopped being a saturated one.
401
+ *
402
+ * THE BAND IS THE RECORDS BAND (AGL-2611): contacts, companies and deals
403
+ * together, so the alert below is fed the sum of three aggregates while
404
+ * the readout beside the toolbar keeps the people count — a workspace
405
+ * whose hundred records are ninety companies is told it holds ten
406
+ * contacts and that its band is full, which are both true. The three
407
+ * reads and the fallback rule live in `useCrmRecordsQuota`, shared with
408
+ * the company and deal drawers so every door on this hub refuses on the
409
+ * same number.
410
+ */ const records = useCrmRecordsQuota(dataScope, org, {
411
+ contactsFallback: contacts.length
412
+ });
413
+ // Pending or denied, the listener length stands in. It can only UNDERSTATE
414
+ // (it is the same collection, capped), never overstate, so no alert this
415
+ // number gates can fire on a count larger than the truth.
416
+ const contactCount = (_records_contactsCount = records.contactsCount) != null ? _records_contactsCount : contacts.length;
417
+ // Records bands (AGL-890): a plan with an overage rate meters past the
418
+ // included count instead of blocking; a plan without one hard-bands
419
+ // (quota.allowed = false).
420
+ const quota = records.quota;
421
+ // Signups whose CRM record was dropped at a hard band (AGL-891), Free's
422
+ // included: capture still fills that band on a plan without the CRM.
423
+ // Written by upsert-contact, host-scoped.
424
+ // Host-scoped, so absent at the organization level (AGL-2630): the
425
+ // counter is a fact about one site's capture, and summing thirty of them
426
+ // would be a figure about nothing in particular.
427
+ const { data: droppedCounter } = useFirestoreDoc(()=>hostId ? doc(firestore, 'hosts', hostId, 'counters', 'contactsDropped') : null, [
428
+ firestore,
429
+ hostId
430
+ ]);
431
+ const droppedTotal = Number((_ref3 = droppedCounter == null ? void 0 : droppedCounter['total']) != null ? _ref3 : 0);
432
+ /*==========================================
433
+ * REFUNDS THAT REACHED NO CONTACT (AGL-2329).
434
+ *
435
+ * `recordContactRefund` refuses to create a contact for a refund — a
436
+ * contact holding a refund and no purchase is a phantom record with
437
+ * negative lifetime value — and increments
438
+ * `hosts/{hostId}/counters/contactRefundsUnmatched` instead. Its own
439
+ * comment says the shape mirrors `contactsDropped` "so an operator…", and
440
+ * there the sentence stops: `contactsDropped` had this reader and the
441
+ * refund counter had none, so a refund that reached no contact record
442
+ * incremented a number nobody could see.
443
+ *
444
+ * It sits beside the dropped-signup alert because they are the same kind
445
+ * of fact — something that happened to this host's CRM and left no row —
446
+ * and an operator reconciling their contact list needs both or neither.
447
+ *=========================================*/ const { data: unmatchedRefundCounter } = useFirestoreDoc(()=>hostId ? doc(firestore, 'hosts', hostId, 'counters', 'contactRefundsUnmatched') : null, [
448
+ firestore,
449
+ hostId
450
+ ]);
451
+ const unmatchedRefundTotal = Number((_ref4 = unmatchedRefundCounter == null ? void 0 : unmatchedRefundCounter['total']) != null ? _ref4 : 0);
452
+ const unmatchedRefundReason = String((_ref5 = unmatchedRefundCounter == null ? void 0 : unmatchedRefundCounter['lastReason']) != null ? _ref5 : '');
453
+ // Saved segments (AGL-199): reusable audience filters.
454
+ const { data: segmentDocs } = useFirestoreCollection(()=>dataScope ? query(collection(firestore, dataScope[0], dataScope[1], 'contactSegments'), limit(50)) : null, [
455
+ firestore,
456
+ dataScope
457
+ ], {
458
+ idField: '$id'
459
+ });
460
+ const segments = useMemo(()=>[
461
+ ...segmentDocs != null ? segmentDocs : []
462
+ ].sort((a, b)=>{
463
+ var _a_name, _b_name;
464
+ return String((_a_name = a.name) != null ? _a_name : '').localeCompare(String((_b_name = b.name) != null ? _b_name : ''));
465
+ }), [
466
+ segmentDocs
467
+ ]);
468
+ /*
469
+ * Every saved segment, offered in the views menu as a view (AGL-2617):
470
+ * choosing one puts its tag and source clauses on the filter bar. A
471
+ * segment can only have come FROM an org scope, so the delete is
472
+ * unreachable without one in practice — but the scope is nullable
473
+ * (AGL-1050) and an unguarded deref would be a crash rather than a no-op
474
+ * if that ever stopped being true.
475
+ */ const segmentPresets = useMemo(()=>segments.map((segment)=>{
476
+ var _segment_name, _segment_tags, _segment_sources;
477
+ return {
478
+ id: String(segment.$id),
479
+ label: String((_segment_name = segment.name) != null ? _segment_name : ''),
480
+ filters: crmViewFiltersFromSegment({
481
+ tags: (_segment_tags = segment.tags) != null ? _segment_tags : [],
482
+ sources: (_segment_sources = segment.sources) != null ? _segment_sources : []
483
+ }),
484
+ onRemove: dataScope ? ()=>deleteDoc(doc(firestore, dataScope[0], dataScope[1], 'contactSegments', String(segment.$id))) : undefined
485
+ };
486
+ }), [
487
+ segments,
488
+ dataScope,
489
+ firestore
490
+ ]);
491
+ /*
492
+ * THE WINDOW CLAUSES narrow in the browser, and the caption says so.
493
+ *
494
+ * An owner, a stage, a source, a company and a custom value all live on
495
+ * the viewing group's FACET, and a facet path is per group, so none of
496
+ * them is a field the query grammar can reach without an index per
497
+ * group; a second tag clause, or "any of these tags", is an array clause
498
+ * the scope predicate already occupies. So every clause the plan could
499
+ * not serve refines the ordered window rather than the collection —
500
+ * through the same matcher the grammar declares, so a chip and the rows
501
+ * under it agree. Ordinary orgs load their whole list into the window
502
+ * anyway; the caption below says what these narrow for the ones that do
503
+ * not.
504
+ */ const uid = (_ref6 = user == null ? void 0 : user.uid) != null ? _ref6 : '';
505
+ const windowClauses = plan.window;
506
+ const visible = useMemo(()=>windowClauses.length ? contacts.filter((contact)=>windowClauses.every((clause)=>matchListFilter(contact, filterFields, clause))) : contacts, [
507
+ contacts,
508
+ windowClauses,
509
+ filterFields
510
+ ]);
511
+ /*
512
+ * The choices the filter bar picks from. The companies are read only once
513
+ * the reader has reached for a filter or is looking at a view that names
514
+ * one — a read a list nobody is narrowing should not pay for, the same
515
+ * bargain the roster gets above. A stage and a source are fixed lists and
516
+ * cost nothing; a custom `select` field offers its own options.
517
+ */ const companies = useCompanyOptions({
518
+ hostId,
519
+ org,
520
+ enabled: filterOpened || namesFilter
521
+ });
522
+ const filterOptions = useMemo(()=>_extends({
523
+ [CRM_CONTACT_VIEW_FIELDS.owner]: [
524
+ ...uid ? [
525
+ {
526
+ value: uid,
527
+ label: 'Me'
528
+ }
529
+ ] : [],
530
+ ...members.options.filter((option)=>option.uid !== uid).map((option)=>({
531
+ value: option.uid,
532
+ label: option.label
533
+ }))
534
+ ],
535
+ [CRM_CONTACT_VIEW_FIELDS.stage]: CONTACT_LIFECYCLE_STAGES.map((stage)=>({
536
+ value: stage,
537
+ label: CONTACT_LIFECYCLE_STAGE_LABELS[stage]
538
+ })),
539
+ [CRM_CONTACT_VIEW_FIELDS.source]: Object.entries(SOURCE_LABELS).map(([value, label])=>({
540
+ value,
541
+ label
542
+ })),
543
+ [CRM_CONTACT_VIEW_FIELDS.company]: companies.options.map((company)=>({
544
+ value: company.id,
545
+ label: company.name
546
+ }))
547
+ }, Object.fromEntries(customFields.active.filter((definition)=>{
548
+ var _definition_options;
549
+ return definition.type === 'select' && ((_definition_options = definition.options) == null ? void 0 : _definition_options.length);
550
+ }).map((definition)=>{
551
+ var _definition_options;
552
+ return [
553
+ crmContactCustomColumn(definition.key),
554
+ ((_definition_options = definition.options) != null ? _definition_options : []).map((option)=>({
555
+ value: option,
556
+ label: option
557
+ }))
558
+ ];
559
+ }))), [
560
+ uid,
561
+ members.options,
562
+ companies.options,
563
+ customFields.active
564
+ ]);
565
+ /* One row grammar, the console's (AGL-2501) — the same table everywhere. */ const contactColumns = useMemo(()=>[
566
+ ...contactListColumns({
567
+ memberName: members.memberName,
568
+ // "Known by", at the organization level only (AGL-2630).
569
+ siteName: mount ? mount.siteName : undefined
570
+ }),
571
+ // The org's custom fields as optional columns (AGL-2601).
572
+ ...customFieldColumns(customFields.active)
573
+ ], [
574
+ members.memberName,
575
+ mount,
576
+ customFields.active
577
+ ]);
578
+ /*
579
+ * The grid's column and sort models are the VIEW'S (AGL-2617). The
580
+ * filter-only hidden columns — the declared fields that are not table
581
+ * columns, never the custom ones, which are shown — stay hidden whatever
582
+ * a view says, so a saved arrangement cannot unhide a strip of blank
583
+ * cells.
584
+ */ const grid = useCrmViewGrid(views, contactColumns, HIDDEN_COLUMNS);
585
+ /*
586
+ * A SEGMENT IS A VIEW'S TAG AND SOURCE CLAUSES, kept where a campaign
587
+ * can reach them (AGL-2617).
588
+ *
589
+ * The segment stays: it is what a campaign audience and a dynamic list
590
+ * resolve, and `contactMatchesSegment` is the one predicate both the
591
+ * console and the sender read. What changed is where it comes from — the
592
+ * filter bar's tag and source clauses, read back through
593
+ * `crmViewSegmentFilters`, so "Save as segment" is offered exactly when
594
+ * the working filters hold something a segment can hold. Each saved
595
+ * segment is offered in the views menu as a preset, and applying one
596
+ * puts its clauses on the bar, where they can be narrowed further and
597
+ * saved as a view.
598
+ */ const segmentFilters = useMemo(()=>crmViewSegmentFilters(views.state.filters), [
599
+ views.state.filters
600
+ ]);
601
+ const [segmentName, setSegmentName] = useState(null);
602
+ const handleSaveSegment = useCallback(async ()=>{
603
+ const name = (segmentName != null ? segmentName : '').trim().slice(0, 60);
604
+ // No org, no place to put it (AGL-1050). The button is disabled in
605
+ // this state; the guard is here so the callback cannot outlive it.
606
+ if (!name || !segmentFilters || !dataScope) return;
607
+ setSegmentName(null);
608
+ try {
609
+ var _segmentFilters_tags, _segmentFilters_sources;
610
+ await addDoc(collection(firestore, dataScope[0], dataScope[1], 'contactSegments'), _extends({
611
+ name,
612
+ tags: (_segmentFilters_tags = segmentFilters.tags) != null ? _segmentFilters_tags : [],
613
+ sources: (_segmentFilters_sources = segmentFilters.sources) != null ? _segmentFilters_sources : []
614
+ }, newResourceScopeFields([
615
+ ORG_SCOPE_TOKEN
616
+ ]), {
617
+ createdAt: new Date()
618
+ }));
619
+ enqueueSnackbar(`Segment "${name}" saved — usable as a campaign audience`, {
620
+ variant: 'success',
621
+ persist: false
622
+ });
623
+ } catch (error) {
624
+ console.error(error);
625
+ enqueueSnackbar('An error has occurred', {
626
+ variant: 'error',
627
+ allowDuplicate: true
628
+ });
629
+ }
630
+ }, [
631
+ segmentName,
632
+ segmentFilters,
633
+ firestore,
634
+ dataScope,
635
+ enqueueSnackbar
636
+ ]);
637
+ /** The rows ticked for a bulk action (AGL-2603); the bar above the table acts on them. */ const [selectedIds, setSelectedIds] = useState([]);
638
+ /*==========================================
639
+ * ADDING ONE PERSON BY HAND (AGL-2596).
640
+ *
641
+ * Through the plugin's server route rather than a client write, because
642
+ * creating a contact is the one act on this surface the rules cannot fully
643
+ * judge: the dedupe against every holder's rows is a lookup the capturing
644
+ * site may not read, and the audience band is a count the browser cannot
645
+ * take. The route answers `{ contactId, created }`; a merge onto somebody
646
+ * already in the address book is not an error, and the page says which
647
+ * happened before it opens the record.
648
+ *=========================================*/ // The site the route resolves the org from and stamps the record with: the
649
+ // mounted site, or at the organization level the one the drawer's picker
650
+ // named (AGL-2630) — the drawer holds its submit until it is known.
651
+ const crmApi = useCrmApi(crmScope.createHostId);
652
+ const [createBusy, setCreateBusy] = useState(false);
653
+ const [createError, setCreateError] = useState(null);
654
+ const handleCreate = useCallback(async (values)=>{
655
+ setCreateBusy(true);
656
+ setCreateError(null);
657
+ try {
658
+ var _payload_contactId;
659
+ const { response, payload } = await crmApi('contacts-create', _extends({
660
+ email: values.email
661
+ }, values.name ? {
662
+ name: values.name
663
+ } : {}, values.phone ? {
664
+ phone: values.phone
665
+ } : {}, values.jobTitle ? {
666
+ jobTitle: values.jobTitle
667
+ } : {}, values.companyName ? {
668
+ companyName: values.companyName
669
+ } : {}, values.companyId ? {
670
+ companyId: values.companyId
671
+ } : {}, values.address ? {
672
+ address: values.address
673
+ } : {}, values.ownerUid ? {
674
+ ownerUid: values.ownerUid
675
+ } : {}, values.lifecycleStage ? {
676
+ lifecycleStage: values.lifecycleStage
677
+ } : {}, values.tags.length ? {
678
+ tags: values.tags
679
+ } : {}, {
680
+ marketingConsent: values.marketingConsent
681
+ }));
682
+ if (!response.ok) {
683
+ var _payload_error;
684
+ // The route's own sentence, shown above the form unchanged: the
685
+ // band refusal is the list's wording, and a field refusal names
686
+ // the field.
687
+ setCreateError(String((_payload_error = payload['error']) != null ? _payload_error : 'The contact could not be added.'));
688
+ return;
689
+ }
690
+ const contactId = String((_payload_contactId = payload['contactId']) != null ? _payload_contactId : '');
691
+ // The activity entry is the route's (AGL-2622): it verified the
692
+ // caller and performed the write, so it is the one writer that
693
+ // cannot record an add that did not happen — and a second entry
694
+ // from here would put two rows on one act.
695
+ enqueueSnackbar(payload['created'] ? 'Contact added' : 'Already a contact — what you entered was merged into their record', {
696
+ variant: 'success',
697
+ persist: false
698
+ });
699
+ setCreateOpen(false);
700
+ if (contactId) router.push(routes.contact(contactId));
701
+ } catch (error) {
702
+ console.error(error);
703
+ setCreateError('The contact could not be added.');
704
+ } finally{
705
+ setCreateBusy(false);
706
+ }
707
+ }, [
708
+ crmApi,
709
+ enqueueSnackbar,
710
+ router,
711
+ routes
712
+ ]);
713
+ /*
714
+ * The file is `contactsCsv()`'s — every CRM column, the owner by address,
715
+ * one column per custom field — and the same options reach the bulk bar,
716
+ * so the table's export and the selection's are one file over two row
717
+ * sets (AGL-2621).
718
+ */ const csvOptions = useMemo(()=>({
719
+ ownerEmail: members.memberEmail,
720
+ customFields: customFields.active
721
+ }), [
722
+ members.memberEmail,
723
+ customFields.active
724
+ ]);
725
+ const handleExport = useCallback(()=>{
726
+ downloadTextFile('contacts.csv', 'text/csv', contactsCsv(visible, csvOptions));
727
+ }, [
728
+ visible,
729
+ csvOptions
730
+ ]);
731
+ return /*#__PURE__*/ _jsxs(_Fragment, {
732
+ children: [
733
+ /*#__PURE__*/ _jsx(CardDisplay, {
734
+ header: 'Contacts',
735
+ help: pluginDocsHelp('contacts', {
736
+ anchor: '#the-contacts-page'
737
+ }),
738
+ contentGutterX: true,
739
+ contentGutterY: true,
740
+ children: /*#__PURE__*/ _jsxs(Stack, {
741
+ spacing: 2,
742
+ children: [
743
+ /*#__PURE__*/ _jsxs(Stack, {
744
+ direction: "row",
745
+ spacing: 1,
746
+ sx: {
747
+ alignItems: 'center',
748
+ flexWrap: 'wrap',
749
+ rowGap: 1
750
+ },
751
+ children: [
752
+ /*#__PURE__*/ _jsx(Typography, {
753
+ variant: "body2",
754
+ color: "text.secondary",
755
+ sx: {
756
+ flex: 1
757
+ },
758
+ children: `${contactCount.toLocaleString()} contacts · ${Number.isFinite(quota.included) ? `${quota.used.toLocaleString()} of ${quota.included.toLocaleString()} CRM records` : `${quota.used.toLocaleString()} CRM records`}`
759
+ }),
760
+ suiteIncluded ? /*#__PURE__*/ _jsx(ContactImportButton, {
761
+ hostId: hostId,
762
+ org: org
763
+ }) : /*#__PURE__*/ _jsx(CrmSuiteLockedButton, {
764
+ children: 'Import CSV'
765
+ }),
766
+ /*#__PURE__*/ _jsx(Button, {
767
+ size: "small",
768
+ onClick: handleExport,
769
+ disabled: !visible.length,
770
+ children: 'Export CSV'
771
+ }),
772
+ suiteIncluded ? /*#__PURE__*/ _jsx(Button, {
773
+ size: "small",
774
+ variant: "contained",
775
+ color: "primary",
776
+ disabled: !dataScope,
777
+ onClick: ()=>{
778
+ setCreateError(null);
779
+ setCreateOpen(true);
780
+ },
781
+ children: 'New contact'
782
+ }) : /*#__PURE__*/ _jsx(CrmSuiteLockedButton, {
783
+ variant: "contained",
784
+ color: "primary",
785
+ children: 'New contact'
786
+ })
787
+ ]
788
+ }),
789
+ suiteIncluded ? null : /*#__PURE__*/ _jsx(CrmSuiteNotice, {
790
+ children: 'Contacts arrive here on their own from your forms, sign-ups, ' + 'orders and bookings. Adding one by hand, importing a CSV, ' + "saved views, and a contact's owner, stage and company are " + 'part of the CRM.'
791
+ }),
792
+ /*#__PURE__*/ _jsxs(Stack, {
793
+ spacing: 1,
794
+ children: [
795
+ /*#__PURE__*/ _jsx(CrmViewsControl, {
796
+ controller: views,
797
+ allLabel: "All contacts",
798
+ suiteLocked: !suiteIncluded,
799
+ presets: segmentPresets,
800
+ onSaveAsSegment: segmentFilters && dataScope ? ()=>setSegmentName('') : null
801
+ }),
802
+ /*#__PURE__*/ _jsx(CrmFilterBar, {
803
+ fields: filterFields,
804
+ headers: filterHeaders,
805
+ clauses: views.state.filters,
806
+ onChange: views.setFilters,
807
+ options: filterOptions,
808
+ servedField: (_ref7 = (_plan_served = plan.served) == null ? void 0 : _plan_served.field) != null ? _ref7 : null,
809
+ onOpen: ()=>setFilterOpened(true)
810
+ }),
811
+ /*#__PURE__*/ _jsx(Stack, {
812
+ direction: "row",
813
+ children: /*#__PURE__*/ _jsx(NoNextActivityToggle, {
814
+ filters: views.state.filters,
815
+ onChange: views.setFilters
816
+ })
817
+ })
818
+ ]
819
+ }),
820
+ !quota.allowed ? /*#__PURE__*/ _jsx(Alert, {
821
+ severity: "warning",
822
+ children: 'CRM records limit reached — new visitors are no longer ' + 'captured' + (droppedTotal > 0 ? ` (${droppedTotal.toLocaleString()} missed so far)` : '') + '. Upgrade in Billing to keep collecting.'
823
+ }) : quota.overageRecords > 0 && quota.overageRateUsd != null && // No claim about money until the verdict that decides it has
824
+ // settled (AGL-1662). Before Remote Config activation the flag
825
+ // reads its registry default, which is no org's verdict, so an
826
+ // ungated alert could assert the wrong wording for one paint.
827
+ releaseFlagsReady ? /*#__PURE__*/ _jsx(Alert, {
828
+ severity: "info",
829
+ children: contactsBilled ? // basis (AGL-2399): the count here is LIVE, the invoice
830
+ // charges the last reading before the month closes, so the
831
+ // dollar figure is a projection until the month ends. Staff
832
+ // and customer must not read different sentences about the
833
+ // same org's money — that applies to WHEN it is measured as
834
+ // much as to how much.
835
+ `${quota.overageRecords.toLocaleString()} CRM records over ` + `your plan's included ${quota.included.toLocaleString()} — ` + `metered at $${quota.overageRateUsd}/1,000 per month ` + `(≈$${quota.overageMonthlyUsd.toFixed(2)} if your list ends ` + 'the month at this size). ' + 'Upgrade in Billing for a larger included audience.' : // itself the wording `1a2aed5cb` published to
836
+ // `billing-and-plans/overview.md` (AGL-1601/1603). Staff and
837
+ // customer must not read different sentences about the same
838
+ // org's money.
839
+ //
840
+ // THE COUNT STAYS, THE TOTAL GOES: the head-count is real —
841
+ // ingestion captured those records — and is not a claim
842
+ // about money. The upgrade nudge goes with the total, since
843
+ // it prompts a purchase premised on a charge that is not
844
+ // happening.
845
+ `${quota.overageRecords.toLocaleString()} CRM records over ` + `your plan's included ${quota.included.toLocaleString()} — ` + 'not billed while the CRM is unavailable. ' + `The $${quota.overageRateUsd}/1,000 rate applies once ` + 'Contacts opens.'
846
+ }) : droppedTotal > 0 ? /*#__PURE__*/ _jsx(Alert, {
847
+ severity: "info",
848
+ children: `${droppedTotal.toLocaleString()} earlier visitor${droppedTotal === 1 ? ' was' : 's were'} not captured while your CRM records band was full.`
849
+ }) : null,
850
+ unmatchedRefundTotal > 0 ? /*#__PURE__*/ _jsx(Alert, {
851
+ severity: "warning",
852
+ children: `${unmatchedRefundTotal.toLocaleString()} refund${unmatchedRefundTotal === 1 ? '' : 's'} could not be recorded against a contact${UNMATCHED_REFUND_REASON[unmatchedRefundReason] ? ` — most recently because ${UNMATCHED_REFUND_REASON[unmatchedRefundReason]}` : ''}. The money moved; the customer's timeline does not show it.`
853
+ }) : null,
854
+ byForm && contactsStatus === 'error' ? /*#__PURE__*/ _jsx(Alert, {
855
+ severity: "info",
856
+ children: 'The contacts this form captured could not be listed. Your ' + 'access is limited to specific sites, and a form filter ' + 'cannot be narrowed to them — an organization administrator ' + 'can see it.'
857
+ }) : contacts.length === 0 && filter ? /*#__PURE__*/ _jsx(Typography, {
858
+ variant: "body2",
859
+ color: "text.secondary",
860
+ children: contactsStatus === 'loading' ? 'Loading…' : 'No contacts match this filter.'
861
+ }) : contacts.length === 0 ? /*#__PURE__*/ _jsx(EmptyStateComponent, {
862
+ label: contactsStatus === 'loading' ? 'Loading contacts…' : 'No contacts yet',
863
+ description: contactsStatus === 'loading' ? undefined : suiteIncluded ? 'Form submissions, member sign-ups, orders and bookings become contacts on their own; add one by hand or bring a list in from a CSV.' : 'Form submissions, member sign-ups, orders and bookings become contacts on their own.',
864
+ action: contactsStatus === 'loading' ? undefined : !suiteIncluded ? /*#__PURE__*/ _jsxs(Stack, {
865
+ direction: "row",
866
+ spacing: 1,
867
+ children: [
868
+ /*#__PURE__*/ _jsx(CrmSuiteLockedButton, {
869
+ variant: "contained",
870
+ color: "primary",
871
+ children: 'New contact'
872
+ }),
873
+ /*#__PURE__*/ _jsx(CrmSuiteLockedButton, {
874
+ children: 'Import CSV'
875
+ })
876
+ ]
877
+ }) : /*#__PURE__*/ _jsxs(Stack, {
878
+ direction: "row",
879
+ spacing: 1,
880
+ children: [
881
+ /*#__PURE__*/ _jsx(Button, {
882
+ size: "small",
883
+ variant: "contained",
884
+ color: "primary",
885
+ disabled: !dataScope,
886
+ onClick: ()=>{
887
+ setCreateError(null);
888
+ setCreateOpen(true);
889
+ },
890
+ children: 'New contact'
891
+ }),
892
+ /*#__PURE__*/ _jsx(ContactImportButton, {
893
+ hostId: hostId,
894
+ org: org
895
+ })
896
+ ]
897
+ })
898
+ }) : /*#__PURE__*/ _jsxs(_Fragment, {
899
+ children: [
900
+ windowClauses.length ? /*#__PURE__*/ _jsx(Typography, {
901
+ variant: "caption",
902
+ color: "text.secondary",
903
+ children: (windowClauses.length === 1 ? `${(_filterHeaders_windowClauses__field = filterHeaders[windowClauses[0].field]) != null ? _filterHeaders_windowClauses__field : windowClauses[0].field} narrows ` : `${windowClauses.length} of the filters narrow `) + 'the loaded window — the newest 1,000 contacts' + (plan.served ? ` matching ${(_filterHeaders_plan_served_field = filterHeaders[plan.served.field]) != null ? _filterHeaders_plan_served_field : plan.served.field}, which reached every contact.` : '.') + ' Sorting reorders that window.'
904
+ }) : null,
905
+ /*#__PURE__*/ _jsx(ContactsBulkBar, {
906
+ hostId: hostId,
907
+ org: org,
908
+ scope: dataScope,
909
+ consentGroup: consentGroup,
910
+ rows: visible,
911
+ selected: selectedIds,
912
+ onSelectedChange: setSelectedIds,
913
+ csv: csvOptions,
914
+ suiteLocked: !suiteIncluded
915
+ }),
916
+ /*#__PURE__*/ _jsx(CrmColumnOrderProvider, {
917
+ value: grid.columnOrder,
918
+ children: /*#__PURE__*/ _jsx(ListTable, {
919
+ rows: visible,
920
+ columns: grid.columns,
921
+ slots: CRM_LIST_SLOTS,
922
+ selectable: {
923
+ selected: selectedIds,
924
+ onChange: setSelectedIds
925
+ },
926
+ onOpen: (id)=>router.push(routes.contact(id)),
927
+ /*
928
+ * The grid must NOT also filter: the bar above is the one
929
+ * editor of the clauses, and the grid's own filter panel
930
+ * holds one item where a view holds several. Columns and
931
+ * sort are the view's, controlled so a saved arrangement
932
+ * is what the grid shows and a change is what it saves.
933
+ */ disableColumnFilter: true,
934
+ columnVisibilityModel: grid.columnVisibilityModel,
935
+ onColumnVisibilityModelChange: grid.onColumnVisibilityModelChange,
936
+ sortModel: grid.sortModel,
937
+ onSortModelChange: grid.onSortModelChange
938
+ })
939
+ })
940
+ ]
941
+ }),
942
+ /*#__PURE__*/ _jsx(RecentActivityFeed, {
943
+ hostId: hostId,
944
+ org: org,
945
+ basePath: props.basePath
946
+ })
947
+ ]
948
+ })
949
+ }),
950
+ /*#__PURE__*/ _jsxs(Dialog, {
951
+ open: segmentName !== null,
952
+ onClose: ()=>setSegmentName(null),
953
+ maxWidth: "xs",
954
+ fullWidth: true,
955
+ children: [
956
+ /*#__PURE__*/ _jsx(DialogTitle, {
957
+ children: 'Save as segment'
958
+ }),
959
+ /*#__PURE__*/ _jsx(DialogContent, {
960
+ children: /*#__PURE__*/ _jsxs(Stack, {
961
+ spacing: 2,
962
+ sx: {
963
+ pt: 1
964
+ },
965
+ children: [
966
+ /*#__PURE__*/ _jsx(Typography, {
967
+ variant: "body2",
968
+ color: "text.secondary",
969
+ children: 'The tag and source filters, kept as a segment an email campaign or a dynamic list can send to. The other filters stay on this view only.'
970
+ }),
971
+ /*#__PURE__*/ _jsx(TextField, {
972
+ autoFocus: true,
973
+ size: "small",
974
+ label: "Segment name",
975
+ value: segmentName != null ? segmentName : '',
976
+ onChange: (event)=>setSegmentName(event.target.value.slice(0, 60)),
977
+ onKeyDown: (event)=>{
978
+ if (event.key === 'Enter') {
979
+ event.preventDefault();
980
+ void handleSaveSegment();
981
+ }
982
+ },
983
+ slotProps: {
984
+ htmlInput: {
985
+ maxLength: 60
986
+ }
987
+ }
988
+ })
989
+ ]
990
+ })
991
+ }),
992
+ /*#__PURE__*/ _jsxs(DialogActions, {
993
+ children: [
994
+ /*#__PURE__*/ _jsx(Button, {
995
+ onClick: ()=>setSegmentName(null),
996
+ children: 'Cancel'
997
+ }),
998
+ /*#__PURE__*/ _jsx(Button, {
999
+ variant: "contained",
1000
+ disabled: !(segmentName != null ? segmentName : '').trim() || !dataScope,
1001
+ onClick: ()=>void handleSaveSegment(),
1002
+ children: 'Save segment'
1003
+ })
1004
+ ]
1005
+ })
1006
+ ]
1007
+ }),
1008
+ createOpen ? /*#__PURE__*/ _jsx(NewContactDrawer, {
1009
+ open: true,
1010
+ onClose: ()=>setCreateOpen(false),
1011
+ hostId: hostId,
1012
+ org: org,
1013
+ busy: createBusy,
1014
+ error: createError,
1015
+ owners: members.options,
1016
+ ownersReady: members.ready,
1017
+ onSubmit: (values)=>void handleCreate(values)
1018
+ }) : null
1019
+ ]
1020
+ });
1021
+ }
1022
+ ContactsPeopleSection.displayName = 'ContactsPeopleSection';
1023
+ export default ContactsPeopleSection;
1024
+
1025
+ //# sourceMappingURL=contacts-section.js.map