@iann29/rastro 0.10.9 → 0.11.0

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 (178) hide show
  1. package/README.md +8 -0
  2. package/agent/integration.md +45 -0
  3. package/agent/manifest.json +4 -4
  4. package/dist/client/federation.d.ts +82 -9
  5. package/dist/client/federation.d.ts.map +1 -1
  6. package/dist/client/federation.js +40 -2
  7. package/dist/client/federation.js.map +1 -1
  8. package/dist/client/index.d.ts +464 -8
  9. package/dist/client/index.d.ts.map +1 -1
  10. package/dist/client/index.js +259 -7
  11. package/dist/client/index.js.map +1 -1
  12. package/dist/component/_generated/api.d.ts +10 -0
  13. package/dist/component/_generated/api.d.ts.map +1 -1
  14. package/dist/component/_generated/api.js.map +1 -1
  15. package/dist/component/_generated/component.d.ts +273 -21
  16. package/dist/component/_generated/component.d.ts.map +1 -1
  17. package/dist/component/_generated/server.d.ts +2 -0
  18. package/dist/component/_generated/server.d.ts.map +1 -1
  19. package/dist/component/_generated/server.js.map +1 -1
  20. package/dist/component/constants.d.ts +31 -0
  21. package/dist/component/constants.d.ts.map +1 -1
  22. package/dist/component/constants.js +31 -0
  23. package/dist/component/constants.js.map +1 -1
  24. package/dist/component/convex.config.d.ts +2 -0
  25. package/dist/component/convex.config.js +7 -0
  26. package/dist/component/convex.config.js.map +1 -1
  27. package/dist/component/errors.d.ts +1 -1
  28. package/dist/component/errors.d.ts.map +1 -1
  29. package/dist/component/errors.js.map +1 -1
  30. package/dist/component/http.d.ts.map +1 -1
  31. package/dist/component/http.js +64 -0
  32. package/dist/component/http.js.map +1 -1
  33. package/dist/component/leadAdsValidators.d.ts +1092 -0
  34. package/dist/component/leadAdsValidators.d.ts.map +1 -0
  35. package/dist/component/leadAdsValidators.js +304 -0
  36. package/dist/component/leadAdsValidators.js.map +1 -0
  37. package/dist/component/leadFormRules.d.ts +60 -0
  38. package/dist/component/leadFormRules.d.ts.map +1 -0
  39. package/dist/component/leadFormRules.js +140 -0
  40. package/dist/component/leadFormRules.js.map +1 -0
  41. package/dist/component/leadFormStore.d.ts +16 -0
  42. package/dist/component/leadFormStore.d.ts.map +1 -0
  43. package/dist/component/leadFormStore.js +92 -0
  44. package/dist/component/leadFormStore.js.map +1 -0
  45. package/dist/component/leadgenToken.d.ts +56 -0
  46. package/dist/component/leadgenToken.d.ts.map +1 -0
  47. package/dist/component/leadgenToken.js +262 -0
  48. package/dist/component/leadgenToken.js.map +1 -0
  49. package/dist/component/leads.d.ts +76 -7
  50. package/dist/component/leads.d.ts.map +1 -1
  51. package/dist/component/leads.js +112 -78
  52. package/dist/component/leads.js.map +1 -1
  53. package/dist/component/meta.d.ts.map +1 -1
  54. package/dist/component/meta.js +21 -1
  55. package/dist/component/meta.js.map +1 -1
  56. package/dist/component/metaFake.d.ts +44 -0
  57. package/dist/component/metaFake.d.ts.map +1 -1
  58. package/dist/component/metaFake.js +400 -1
  59. package/dist/component/metaFake.js.map +1 -1
  60. package/dist/component/metaGraph.d.ts +91 -0
  61. package/dist/component/metaGraph.d.ts.map +1 -1
  62. package/dist/component/metaGraph.js +217 -0
  63. package/dist/component/metaGraph.js.map +1 -1
  64. package/dist/component/metaLeads.d.ts +681 -0
  65. package/dist/component/metaLeads.d.ts.map +1 -0
  66. package/dist/component/metaLeads.js +2634 -0
  67. package/dist/component/metaLeads.js.map +1 -0
  68. package/dist/component/schema.d.ts +414 -5
  69. package/dist/component/schema.d.ts.map +1 -1
  70. package/dist/component/schema.js +169 -1
  71. package/dist/component/schema.js.map +1 -1
  72. package/dist/component/validators.d.ts +235 -11
  73. package/dist/component/validators.d.ts.map +1 -1
  74. package/dist/component/validators.js +14 -1
  75. package/dist/component/validators.js.map +1 -1
  76. package/dist/tracker/generated.d.ts +1 -1
  77. package/dist/tracker/generated.js +1 -1
  78. package/dist/ui/campaigns/CampaignsView.d.ts +5 -1
  79. package/dist/ui/campaigns/CampaignsView.d.ts.map +1 -1
  80. package/dist/ui/campaigns/CampaignsView.js.map +1 -1
  81. package/dist/ui/campaigns/Drawer.d.ts.map +1 -1
  82. package/dist/ui/campaigns/Drawer.js +8 -26
  83. package/dist/ui/campaigns/Drawer.js.map +1 -1
  84. package/dist/ui/campaigns/labels.d.ts +29 -1
  85. package/dist/ui/campaigns/labels.d.ts.map +1 -1
  86. package/dist/ui/campaigns/labels.js +77 -2
  87. package/dist/ui/campaigns/labels.js.map +1 -1
  88. package/dist/ui/campaigns/model.js +2 -2
  89. package/dist/ui/campaigns/model.js.map +1 -1
  90. package/dist/ui/forms/FirstContact.d.ts +19 -0
  91. package/dist/ui/forms/FirstContact.d.ts.map +1 -0
  92. package/dist/ui/forms/FirstContact.js +81 -0
  93. package/dist/ui/forms/FirstContact.js.map +1 -0
  94. package/dist/ui/forms/FormLead.d.ts +28 -0
  95. package/dist/ui/forms/FormLead.d.ts.map +1 -0
  96. package/dist/ui/forms/FormLead.js +199 -0
  97. package/dist/ui/forms/FormLead.js.map +1 -0
  98. package/dist/ui/forms/FormRulesDrawer.d.ts +49 -0
  99. package/dist/ui/forms/FormRulesDrawer.d.ts.map +1 -0
  100. package/dist/ui/forms/FormRulesDrawer.js +149 -0
  101. package/dist/ui/forms/FormRulesDrawer.js.map +1 -0
  102. package/dist/ui/forms/FormsView.d.ts +10 -0
  103. package/dist/ui/forms/FormsView.d.ts.map +1 -0
  104. package/dist/ui/forms/FormsView.js +215 -0
  105. package/dist/ui/forms/FormsView.js.map +1 -0
  106. package/dist/ui/forms/Icons.d.ts +46 -0
  107. package/dist/ui/forms/Icons.d.ts.map +1 -0
  108. package/dist/ui/forms/Icons.js +45 -0
  109. package/dist/ui/forms/Icons.js.map +1 -0
  110. package/dist/ui/forms/RuleRow.d.ts +37 -0
  111. package/dist/ui/forms/RuleRow.d.ts.map +1 -0
  112. package/dist/ui/forms/RuleRow.js +80 -0
  113. package/dist/ui/forms/RuleRow.js.map +1 -0
  114. package/dist/ui/forms/WhatsAppButtonGuide.d.ts +33 -0
  115. package/dist/ui/forms/WhatsAppButtonGuide.d.ts.map +1 -0
  116. package/dist/ui/forms/WhatsAppButtonGuide.js +90 -0
  117. package/dist/ui/forms/WhatsAppButtonGuide.js.map +1 -0
  118. package/dist/ui/forms/index.d.ts +11 -0
  119. package/dist/ui/forms/index.d.ts.map +1 -0
  120. package/dist/ui/forms/index.js +7 -0
  121. package/dist/ui/forms/index.js.map +1 -0
  122. package/dist/ui/forms/journey.d.ts +19 -0
  123. package/dist/ui/forms/journey.d.ts.map +1 -0
  124. package/dist/ui/forms/journey.js +54 -0
  125. package/dist/ui/forms/journey.js.map +1 -0
  126. package/dist/ui/forms/model.d.ts +239 -0
  127. package/dist/ui/forms/model.d.ts.map +1 -0
  128. package/dist/ui/forms/model.js +556 -0
  129. package/dist/ui/forms/model.js.map +1 -0
  130. package/dist/ui/forms/sample.d.ts +36 -0
  131. package/dist/ui/forms/sample.d.ts.map +1 -0
  132. package/dist/ui/forms/sample.js +444 -0
  133. package/dist/ui/forms/sample.js.map +1 -0
  134. package/dist/ui/forms/types.d.ts +454 -0
  135. package/dist/ui/forms/types.d.ts.map +1 -0
  136. package/dist/ui/forms/types.js +2 -0
  137. package/dist/ui/forms/types.js.map +1 -0
  138. package/dist/ui/index.d.ts +2 -0
  139. package/dist/ui/index.d.ts.map +1 -1
  140. package/dist/ui/index.js +4 -0
  141. package/dist/ui/index.js.map +1 -1
  142. package/dist/ui/integrations/Overlay.d.ts +3 -1
  143. package/dist/ui/integrations/Overlay.d.ts.map +1 -1
  144. package/dist/ui/integrations/Overlay.js +2 -2
  145. package/dist/ui/integrations/Overlay.js.map +1 -1
  146. package/dist/ui/portfolio/PortfolioView.d.ts +4 -1
  147. package/dist/ui/portfolio/PortfolioView.d.ts.map +1 -1
  148. package/dist/ui/portfolio/PortfolioView.js.map +1 -1
  149. package/dist/ui/sample.d.ts +3 -1
  150. package/dist/ui/sample.d.ts.map +1 -1
  151. package/dist/ui/sample.js +2 -0
  152. package/dist/ui/sample.js.map +1 -1
  153. package/dist/ui/seed.d.ts +1 -1
  154. package/dist/ui/ui.css +2301 -0
  155. package/docs/federation.md +19 -0
  156. package/docs/meta-ads.md +713 -7
  157. package/docs/upgrading.md +70 -0
  158. package/llms.txt +1 -0
  159. package/package.json +1 -1
  160. package/src/component/_generated/api.ts +10 -0
  161. package/src/component/_generated/component.ts +289 -20
  162. package/src/component/_generated/server.ts +2 -0
  163. package/src/component/constants.ts +33 -0
  164. package/src/component/convex.config.ts +7 -0
  165. package/src/component/errors.ts +3 -1
  166. package/src/component/http.ts +75 -0
  167. package/src/component/leadAdsValidators.ts +365 -0
  168. package/src/component/leadFormRules.ts +202 -0
  169. package/src/component/leadFormStore.ts +129 -0
  170. package/src/component/leadgenToken.ts +348 -0
  171. package/src/component/leads.ts +136 -84
  172. package/src/component/meta.ts +21 -1
  173. package/src/component/metaFake.ts +485 -1
  174. package/src/component/metaGraph.ts +327 -0
  175. package/src/component/metaLeads.ts +3101 -0
  176. package/src/component/schema.ts +187 -1
  177. package/src/component/validators.ts +17 -1
  178. package/src/tracker/generated.ts +1 -1
@@ -0,0 +1,454 @@
1
+ /**
2
+ * The shapes the Formulários screens read: Lead Ads (contract §12). The
3
+ * component's reads (`metaPages`, `metaForms`, `formRules`,
4
+ * `simulateFormRules`, `formsReport`) are mirrored here as view models, so a
5
+ * host can render the screens before its Rastro serves them; fields the
6
+ * approved design draws beyond the contract are marked "screen" and are
7
+ * optional. Personal data never appears here: a form lead's name, phone and
8
+ * e-mail stay with the host (§12, Ian's decisions).
9
+ */
10
+ import type { IntegrationsAudience, IntegrationSite, IntegrationsPartner } from "../integrations/types.js";
11
+ export type { IntegrationsAudience, IntegrationSite, IntegrationsPartner };
12
+ /** A Facebook Page the connection lists (`metaPages`). */
13
+ export interface MetaPage {
14
+ pageId: string;
15
+ name: string;
16
+ /** The login granted `leads_retrieval` for this Page. */
17
+ leadsAllowed: boolean;
18
+ /** When the Page was subscribed to `leadgen`; null until it is. */
19
+ subscribedAt: number | null;
20
+ /** The site the Page feeds (one Page, one site), or null. */
21
+ linkedSiteId: string | null;
22
+ /**
23
+ * The Page feeds a site outside the reader's grant: the host hides which
24
+ * one (`linkedSiteId` is null), and the screen shows it taken, never free.
25
+ */
26
+ linkedOutsideScope?: boolean;
27
+ /**
28
+ * False when another owner of the site linked the Page: the screen shows
29
+ * the lock ("Ligado pelo uze.ai") and offers no unlink. Null (the host's
30
+ * answer for a free Page) or absent means own.
31
+ */
32
+ own?: boolean | null;
33
+ /** The tasks the login holds on the Page (`MANAGE`, `ADVERTISE`…). */
34
+ tasks?: string[];
35
+ /**
36
+ * Why the Page's leads are held back, as a code (`META_TOKEN_INVALID`,
37
+ * `META_PERMISSION_MISSING`, `HANDLER_MISSING`, `META_RATE_LIMITED`…); null
38
+ * when all is well. `pageIssue` turns it into the screen's words.
39
+ */
40
+ lastError?: string | null;
41
+ /**
42
+ * Whether the host registered its form lead handler. False holds every
43
+ * lead back; absent (older hosts) reads as ready.
44
+ */
45
+ handlerReady?: boolean;
46
+ /**
47
+ * Dashboard: why it cannot forward this linked Page's leads the moment
48
+ * Meta announces them (`HOST_NOT_READY`, `ISSUER_MISMATCH`,
49
+ * `AUDIENCE_MISMATCH`, `HOST_SITE_URL_MISSING`, `HOST_SITE_URL_UNTRUSTED`,
50
+ * `CONFLICT`, `HOST_REFUSED` when the host refused the last forward, or
51
+ * `NOT_ROUTED` for a host it does not forward to); null or
52
+ * absent when it can. The leads still come in with the host's
53
+ * reconciliation, every 15 minutes.
54
+ */
55
+ routeIssue?: string | null;
56
+ /** Screen: the Instagram account tied to the Page ("@clinicasorriso"). */
57
+ instagram?: string | null;
58
+ }
59
+ export interface MetaFormOption {
60
+ key: string;
61
+ value: string;
62
+ }
63
+ /** A form question; only the ones with `options` can drive a rule. */
64
+ export interface MetaFormQuestion {
65
+ key: string;
66
+ label: string;
67
+ type: string;
68
+ options?: MetaFormOption[];
69
+ }
70
+ /** Meta's form status: `ACTIVE`, `ARCHIVED`, `DELETED`, `DRAFT`. */
71
+ export type MetaFormStatus = "ACTIVE" | "ARCHIVED" | "DELETED" | "DRAFT" | (string & {});
72
+ /**
73
+ * An instant form on a linked Page: one row of `metaForms`, flattened with
74
+ * its Page's id (`metaFormsRows` turns the host's answer into these).
75
+ */
76
+ export interface MetaForm {
77
+ pageId: string;
78
+ formId: string;
79
+ name: string;
80
+ status: MetaFormStatus;
81
+ questions: MetaFormQuestion[];
82
+ /**
83
+ * The end screen's "Falar no WhatsApp" button, as Meta shows it; null when
84
+ * Meta does not say (the drawer then offers the manual "Já liguei").
85
+ */
86
+ whatsappButton: boolean | null;
87
+ /** The company marked the button as set by hand ("Já liguei"). */
88
+ whatsappButtonConfirmed?: boolean;
89
+ syncedAt: number;
90
+ /** When Meta created the form (`createdTime`), for "novo na Meta". */
91
+ createdAt?: number | null;
92
+ /** Leads in the 30 days up to the host's `now`; null without it. */
93
+ leads30d?: number | null;
94
+ /** Those leads per day, oldest first, for the sparkline. */
95
+ daily?: number[] | null;
96
+ /** The newest lead's arrival ("último há 4 min"). */
97
+ lastLeadAt?: number | null;
98
+ /**
99
+ * The rules' summary `metaForms` carries: what the list shows. The full
100
+ * rules (`formRules`) are only read for the open drawer.
101
+ */
102
+ rules?: FormRulesSummary;
103
+ }
104
+ /** A form's rules as the list reads them (`metaForms`' `rules`). */
105
+ export interface FormRulesSummary {
106
+ configured: boolean;
107
+ count: number;
108
+ entryColumn: string | null;
109
+ /** False when another owner set them (a lock). Absent means own. */
110
+ own?: boolean;
111
+ }
112
+ /** One form as the host's `metaForms` lists it, under its Page. */
113
+ export interface MetaFormsRow {
114
+ formId: string;
115
+ name: string;
116
+ status: MetaFormStatus;
117
+ questions: MetaFormQuestion[];
118
+ whatsappButton: boolean | null;
119
+ whatsappButtonConfirmed: boolean;
120
+ createdTime: number | null;
121
+ syncedAt: number;
122
+ leads30d: number | null;
123
+ daily: number[] | null;
124
+ lastLeadAt: number | null;
125
+ rules: FormRulesSummary;
126
+ }
127
+ /** The host's `metaForms({ siteId, now })`: the site's Pages, each with forms. */
128
+ export interface MetaFormsPage {
129
+ pageId: string;
130
+ pageName: string;
131
+ leadsAllowed: boolean;
132
+ subscribedAt: number | null;
133
+ lastReconcileAt: number | null;
134
+ lastLeadAt: number | null;
135
+ lastError: string | null;
136
+ own?: boolean;
137
+ handlerReady: boolean;
138
+ forms: MetaFormsRow[];
139
+ }
140
+ /** Where a rule sends the lead: a board column, or the discard with a reason. */
141
+ export type FormRuleTarget = {
142
+ column: string;
143
+ } | {
144
+ discard: string;
145
+ };
146
+ /** "If <question> is one of <answers> → <to>". Answers are option keys. */
147
+ export interface FormRule {
148
+ questionKey: string;
149
+ answers: string[];
150
+ to: FormRuleTarget;
151
+ }
152
+ /**
153
+ * How the first contact happens (§12, Ian's decisions):
154
+ * - `lead_starts`: the form's end screen has the WhatsApp button, the lead
155
+ * writes first (recommended);
156
+ * - `one_click`: a person sends the suggested text with one click (always
157
+ * available on the card);
158
+ * - `automatic`: the host sends the text on its own, with brakes, after the
159
+ * company acknowledged the risk.
160
+ */
161
+ export type FirstContactMode = "lead_starts" | "one_click" | "automatic";
162
+ export interface FirstContactBrakes {
163
+ /** Wait for the lead to write first; at least 15. */
164
+ waitMinutes: number;
165
+ maxPerHour: number;
166
+ businessHoursOnly: boolean;
167
+ }
168
+ export interface FirstContact {
169
+ mode: FirstContactMode;
170
+ /** The suggested text, with `{primeiro_nome}`. */
171
+ text?: string;
172
+ brakes?: FirstContactBrakes;
173
+ }
174
+ /** `setFormRules`'s argument. */
175
+ export interface SetFormRulesInput {
176
+ siteId: string;
177
+ formId: string;
178
+ entryColumn: string | null;
179
+ rules: FormRule[];
180
+ firstContact: FirstContact;
181
+ /** "Já liguei": the company set the end screen's button by hand. */
182
+ whatsappButtonConfirmed?: boolean;
183
+ }
184
+ /** What the drawer saves for a form: the rules without who and where. */
185
+ export type FormRulesChoice = Omit<SetFormRulesInput, "siteId" | "formId">;
186
+ /**
187
+ * What `simulateFormRules` reads from a draft: the entry and the complete
188
+ * rules. The first contact decides nothing about where a lead goes.
189
+ */
190
+ export type FormRulesDraft = Pick<FormRulesChoice, "entryColumn" | "rules">;
191
+ /**
192
+ * `formRules({ siteId, formId, now })`: always an object; `configured` is
193
+ * false for a form that never had rules ("Novo · sem regra").
194
+ */
195
+ export interface FormRules {
196
+ siteId?: string;
197
+ formId?: string;
198
+ configured: boolean;
199
+ entryColumn: string | null;
200
+ /** In order: the first that matches decides. */
201
+ rules: Array<FormRule & {
202
+ monthCount: number | null;
203
+ }>;
204
+ firstContact: FirstContact;
205
+ /** "Já liguei", as saved. */
206
+ whatsappButtonConfirmed: boolean;
207
+ /** False when another owner set them (a lock). Absent means own. */
208
+ own?: boolean;
209
+ updatedAt?: number | null;
210
+ }
211
+ /** A count per board column. */
212
+ export interface FormColumnCount {
213
+ column: string;
214
+ leads: number;
215
+ }
216
+ /** A count per discard reason. */
217
+ export interface FormDiscardCount {
218
+ reason: string;
219
+ leads: number;
220
+ }
221
+ /**
222
+ * `simulateFormRules` for a draft: where the last 30 days' leads would have
223
+ * gone. `entry` is what no rule matched. When the draft names an entry
224
+ * column those leads are under `columns` too (the component counts there
225
+ * every lead that lands in a column), so `columns` plus `discarded` falls
226
+ * short of `total` only by the leads left to the host's own entry.
227
+ */
228
+ export interface FormRulesSimulation {
229
+ total: number;
230
+ entry: number;
231
+ /** Per draft rule, in order: the leads it would decide. */
232
+ rules: number[];
233
+ columns: FormColumnCount[];
234
+ discarded: FormDiscardCount[];
235
+ /** A read cap was hit: the figures cover the newest leads only. */
236
+ partial: boolean;
237
+ }
238
+ /** One form in `formsReport({ siteIds, from, to })`. */
239
+ export interface FormReportRow {
240
+ siteId: string;
241
+ pageId: string;
242
+ formId: string;
243
+ name: string | null;
244
+ leads: number;
245
+ qualified: number;
246
+ won: number;
247
+ revenueCents: number;
248
+ /** What the rules (or the entry column) sent to each column. */
249
+ columns: FormColumnCount[];
250
+ /** Leads that went to the host's own entry (no column named). */
251
+ entry: number;
252
+ discarded: FormDiscardCount[];
253
+ /** Discarded leads someone sent back to the funnel. */
254
+ returned: number;
255
+ /** Screen: the campaign that runs the form ("Clareamento — outubro"). */
256
+ campaignName?: string | null;
257
+ }
258
+ /** `formsReport`: per form, and whether a read cap cut the counts. */
259
+ export interface FormsReport {
260
+ forms: FormReportRow[];
261
+ /** A read cap was hit: the decision counts are a lower bound. */
262
+ partial: boolean;
263
+ }
264
+ /** A board column as the host declared it (`setPipeline`, §11.1). */
265
+ export interface FormColumn {
266
+ key: string;
267
+ name: string;
268
+ color?: string | null;
269
+ group?: string | null;
270
+ }
271
+ /** A site's board: its columns and the two the rules lean on. */
272
+ export interface FormBoard {
273
+ columns: readonly FormColumn[];
274
+ /**
275
+ * The board's own entry ("porta de entrada"): where a lead goes when the
276
+ * form names no entry column.
277
+ */
278
+ entryColumn?: string | null;
279
+ /** The column discarded leads land in, with their reason. */
280
+ discardColumn?: string | null;
281
+ /** The funnel's name ("Funil principal"), shown beside the entry. */
282
+ label?: string | null;
283
+ }
284
+ /** The write in flight. */
285
+ export type FormsBusy = "link" | "unlink" | "rules" | "refresh" | null;
286
+ /** A check the WhatsApp button guide lists ("Número da Recepção conectado"). */
287
+ export interface GuideCheck {
288
+ label: string;
289
+ state: "ok" | "waiting" | "todo" | "optional";
290
+ }
291
+ export interface FormsViewProps {
292
+ /** `agency` by default; `business` speaks to one company (the first site). */
293
+ audience?: IntegrationsAudience;
294
+ /** Business: the partner whose rules show the lock "Ligado pelo parceiro". */
295
+ partner?: IntegrationsPartner | null;
296
+ /** Who reads the forms and hands the leads over: "Rastro" by default. */
297
+ productName?: string;
298
+ /** How the host calls its board ("Kanban do uze"); "Kanban" by default. */
299
+ boardLabel?: string;
300
+ /**
301
+ * Who linked what `own: false` marks: "uze.ai" by default; with a
302
+ * `partner`, "parceiro <name>".
303
+ */
304
+ otherOwnerLabel?: string;
305
+ /**
306
+ * The reader edits a client's rules as its partner (uze.ai's portal): the
307
+ * drawer says the company sees them and can turn them off.
308
+ */
309
+ editsAsPartner?: boolean;
310
+ sites: readonly IntegrationSite[];
311
+ /** `metaPages`; undefined while loading. */
312
+ pages: readonly MetaPage[] | undefined;
313
+ /**
314
+ * Whether the host registered its form lead handler (`metaLinkedPages`'
315
+ * `handlerReady`). False with no Pages says the host is not ready instead
316
+ * of asking to reconnect Meta: without the handler no Page is read.
317
+ */
318
+ handlerReady?: boolean;
319
+ /** `metaForms` of the linked Pages; undefined while loading. */
320
+ forms: readonly MetaForm[] | undefined;
321
+ /** `formsReport` for the last 30 days. */
322
+ report?: FormsReport | undefined;
323
+ /**
324
+ * `formRules` per form id: undefined while loading, null when the host
325
+ * could not answer. The drawer then saves nothing, so an empty draft never
326
+ * overwrites rules that were only unreadable. The list reads each form's
327
+ * `rules` summary when its full rules are absent, so a host may pass only
328
+ * the open drawer's.
329
+ */
330
+ rules?: Record<string, FormRules | null | undefined> | undefined;
331
+ /** Each site's board, by site id. */
332
+ boards?: Record<string, FormBoard> | undefined;
333
+ /** The open drawer's draft simulated (`simulateFormRules`). */
334
+ simulation?: FormRulesSimulation | null | undefined;
335
+ /** Asks for the draft's simulation; without it the drawer shows none. */
336
+ onSimulate?: (siteId: string, formId: string, draft: FormRulesDraft) => void;
337
+ /** A drawer opened (or closed, with null), for the host's subscriptions. */
338
+ onOpenForm?: (form: {
339
+ siteId: string;
340
+ formId: string;
341
+ } | null) => void;
342
+ /** False for a reader without configure: the same screens, read only. */
343
+ permitted: boolean;
344
+ busy?: FormsBusy;
345
+ /** The last write's refusal, in pt-BR. */
346
+ error?: string | null;
347
+ notice?: string | null;
348
+ /** "Reconectar a Meta": a Page without lead permission. */
349
+ onReconnect: () => void;
350
+ onLinkPage: (siteId: string, pageId: string) => void;
351
+ onUnlinkPage: (siteId: string, pageId: string) => void;
352
+ /**
353
+ * Saves a form's rules. The drawer closes when this resolves to anything
354
+ * but false; on false (or a rejection) it stays open with the draft.
355
+ */
356
+ onSaveRules: (siteId: string, formId: string, rules: FormRulesChoice) => Promise<boolean | void> | boolean | void;
357
+ /** "Conferir de novo" in the WhatsApp guide: read the forms again. */
358
+ onRefreshForms?: (siteId: string) => void;
359
+ /** Where the first message leaves from ("Recepção · (11) 94567-1200"). */
360
+ senderLabel?: string;
361
+ /** The sender's number in the guide's illustration ("+55 11 94567-1200"). */
362
+ whatsappNumber?: string;
363
+ /** The company's hours, for the automatic brakes ("Seg a sex · 8h às 19h"). */
364
+ businessHoursLabel?: string;
365
+ /** The host's own checks for the guide ("Número da Recepção conectado"). */
366
+ guideChecks?: readonly GuideCheck[];
367
+ /** A form's page on Meta; the Page's forms library by default. */
368
+ formUrl?: (form: MetaForm) => string;
369
+ now: number;
370
+ loading?: boolean;
371
+ }
372
+ /** Where a form lead came from: the ad that ran the form. */
373
+ export interface FormLeadOrigin {
374
+ /** Meta's `platform`: `ig` or `fb` (`instagram`/`facebook` also read). */
375
+ platform?: string | null;
376
+ /** "Stories", "Feed". */
377
+ placement?: string | null;
378
+ campaignName?: string | null;
379
+ adsetName?: string | null;
380
+ adName?: string | null;
381
+ }
382
+ /** The rule that decided a lead: "Quer agendar = Sim". */
383
+ export interface FormLeadRuleMatch {
384
+ question: string;
385
+ answers: string[];
386
+ }
387
+ /**
388
+ * What the rules decided, ready to show: a column (by a rule or the entry)
389
+ * or the discard with its reason.
390
+ */
391
+ export type FormLeadDecision = {
392
+ kind: "column" | "entry";
393
+ column: string;
394
+ color?: string | null;
395
+ rule?: FormLeadRuleMatch | null;
396
+ } | {
397
+ kind: "discard";
398
+ reason: string;
399
+ rule?: FormLeadRuleMatch | null;
400
+ };
401
+ /** One step of the path a lead followed, oldest first. */
402
+ export type FormLeadStep = {
403
+ kind: "ad";
404
+ at: number | null;
405
+ adName: string | null;
406
+ platform?: string | null;
407
+ } | {
408
+ kind: "form";
409
+ at: number;
410
+ formName: string;
411
+ platform?: string | null;
412
+ } | {
413
+ kind: "rule";
414
+ at: number;
415
+ rule: FormLeadRuleMatch;
416
+ column: string;
417
+ } | {
418
+ kind: "entry";
419
+ at: number;
420
+ column: string;
421
+ } | {
422
+ kind: "discard";
423
+ at: number;
424
+ reason: string;
425
+ rule?: FormLeadRuleMatch | null;
426
+ } | {
427
+ kind: "button";
428
+ at: number | null;
429
+ wrote: boolean;
430
+ } | {
431
+ kind: "waiting";
432
+ since: number;
433
+ } | {
434
+ kind: "note";
435
+ at: number;
436
+ text: string;
437
+ };
438
+ /**
439
+ * A form lead as the host's card shows it: the answers (Rastro keeps the
440
+ * choice ones; the host may add the free ones it holds), the origin, the
441
+ * decision and the path. Rastro never stores the person.
442
+ */
443
+ export interface FormLead {
444
+ formName: string;
445
+ receivedAt: number;
446
+ answers: Array<{
447
+ question: string;
448
+ answer: string;
449
+ }>;
450
+ origin?: FormLeadOrigin | null;
451
+ decision?: FormLeadDecision | null;
452
+ path?: FormLeadStep[];
453
+ }
454
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ui/forms/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC;AAE3E,0DAA0D;AAC1D,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,YAAY,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6DAA6D;IAC7D,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACrB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;;OAI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ClC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC;CACvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ui/forms/types.ts"],"names":[],"mappings":""}
@@ -18,4 +18,6 @@ export { portfolioFigures } from "./portfolio/figures.js";
18
18
  export type { ClientFigures, PortfolioFigures, PortfolioSite, } from "./portfolio/figures.js";
19
19
  export { clientRows, eventMapCopyTargets, IntegrationsBadge, IntegrationsView, integrationsHeadline, suggestedAccount, } from "./integrations/index.js";
20
20
  export type { ClientRow, ClientState, EventMap, EventMapChoice, EventMapColumn, IntegrationConversion, IntegrationsAudience, IntegrationsBusy, IntegrationSite, IntegrationsPartner, IntegrationStatus, IntegrationsViewProps, MetaColumnEvent, MetaConnection, MetaConnectionAdAccount, MetaEventName, MetaPixel, MetaPixelSource, PixelChoice, SentCounts, SetEventMapInput, UnlinkPreview, } from "./integrations/index.js";
21
+ export { buttonState, choiceQuestions, DEFAULT_BRAKES, defaultFirstContactText, defaultFormLeadPath, entryOf, fillTemplate, FIRST_NAME_VARIABLE, FormLeadAnswers, FormLeadBadge, formLeadFromJourney, FormRulesDrawer, formsSummary, formState, formStatusLabel, FormsView, guideChecks, metaFormsRows, MIN_WAIT_MINUTES, pageErrorCode, pageGroups, pageIssue, pagesWithStatus, reportKey, reportRowOf, rulesSummaryOf, simulationDraftOf, simulationSegments, templateParts, WhatsAppButtonGuide, } from "./forms/index.js";
22
+ export type { ButtonState, FirstContact, FirstContactBrakes, FirstContactMode, FormBoard, FormColumn, FormColumnCount, FormDiscardCount, FormLead, FormLeadDecision, FormLeadOrigin, FormLeadRuleMatch, FormLeadStep, FormReportRow, FormRow, FormRule, FormRules, FormRulesChoice, FormRulesDraft, FormRulesDrawerProps, FormRulesSimulation, FormRulesSummary, FormRuleTarget, FormsBusy, FormsReport, FormState, FormsViewProps, GuideCheck, JourneyForm, MetaForm, MetaFormOption, MetaFormQuestion, MetaFormsPage, MetaFormsRow, MetaFormStatus, MetaPage, PageGroup, PageIssue, PageIssueKind, SetFormRulesInput, SimulationSegment, } from "./forms/index.js";
21
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,QAAQ,EACR,SAAS,GACV,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,SAAS,EACT,WAAW,EACX,QAAQ,EACR,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,SAAS,EACT,eAAe,EACf,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,aA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AAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,WAAW,EACX,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC"}
package/dist/ui/index.js CHANGED
@@ -17,4 +17,8 @@ export { portfolioFigures } from "./portfolio/figures.js";
17
17
  // pixel, and which board columns go back to Meta as events; with
18
18
  // `audience="business"`, one company connecting its own Meta.
19
19
  export { clientRows, eventMapCopyTargets, IntegrationsBadge, IntegrationsView, integrationsHeadline, suggestedAccount, } from "./integrations/index.js";
20
+ // Formulários (wave 4, Lead Ads): the Pages and their instant forms, each
21
+ // form's rules (answer → column or discard) and first contact, the WhatsApp
22
+ // button guide, and the lead's badge and answers for the host's card.
23
+ export { buttonState, choiceQuestions, DEFAULT_BRAKES, defaultFirstContactText, defaultFormLeadPath, entryOf, fillTemplate, FIRST_NAME_VARIABLE, FormLeadAnswers, FormLeadBadge, formLeadFromJourney, FormRulesDrawer, formsSummary, formState, formStatusLabel, FormsView, guideChecks, metaFormsRows, MIN_WAIT_MINUTES, pageErrorCode, pageGroups, pageIssue, pagesWithStatus, reportKey, reportRowOf, rulesSummaryOf, simulationDraftOf, simulationSegments, templateParts, WhatsAppButtonGuide, } from "./forms/index.js";
20
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,cAAc,CAAC;AAWtB,iCAAiC;AACjC,OAAO,EACL,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,SAAS,GACV,MAAM,sBAAsB,CAAC;AAW9B,uEAAuE;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO1D,8EAA8E;AAC9E,iEAAiE;AACjE,8DAA8D;AAC9D,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,cAAc,CAAC;AAWtB,iCAAiC;AACjC,OAAO,EACL,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,SAAS,GACV,MAAM,sBAAsB,CAAC;AAW9B,uEAAuE;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO1D,8EAA8E;AAC9E,iEAAiE;AACjE,8DAA8D;AAC9D,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AA0BjC,0EAA0E;AAC1E,4EAA4E;AAC5E,sEAAsE;AACtE,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,SAAS,EACT,eAAe,EACf,SAAS,EACT,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
@@ -5,7 +5,9 @@ import { type ReactNode, type RefObject } from "react";
5
5
  * fixed` would be trapped), and makes the page behind it inert. It stays in
6
6
  * the DOM where it is rendered, so it inherits the host's `--rastro-*` theme.
7
7
  */
8
- export declare function Overlay({ role, labelledBy, describedBy, side, initialFocus, onClose, children, }: {
8
+ export declare function Overlay({ role, labelledBy, describedBy, side, initialFocus, className, onClose, children, }: {
9
+ /** The scrim's class: another view's own (the forms drawer's). */
10
+ className?: string;
9
11
  role?: "dialog" | "alertdialog";
10
12
  labelledBy: string;
11
13
  describedBy?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../../src/ui/integrations/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1E;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAe,EACf,UAAU,EACV,WAAW,EACX,IAAY,EACZ,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAiCA"}
1
+ {"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../../src/ui/integrations/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1E;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAe,EACf,UAAU,EACV,WAAW,EACX,IAAY,EACZ,YAAY,EACZ,SAAwC,EACxC,OAAO,EACP,QAAQ,GACT,EAAE;IACD,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAiCA"}
@@ -7,7 +7,7 @@ import { useModal } from "./modal.js";
7
7
  * fixed` would be trapped), and makes the page behind it inert. It stays in
8
8
  * the DOM where it is rendered, so it inherits the host's `--rastro-*` theme.
9
9
  */
10
- export function Overlay({ role = "dialog", labelledBy, describedBy, side = false, initialFocus, onClose, children, }) {
10
+ export function Overlay({ role = "dialog", labelledBy, describedBy, side = false, initialFocus, className = "rastro-integrations__scrim", onClose, children, }) {
11
11
  const ref = useRef(null);
12
12
  useEffect(() => {
13
13
  const dialog = ref.current;
@@ -26,7 +26,7 @@ export function Overlay({ role = "dialog", labelledBy, describedBy, side = false
26
26
  };
27
27
  }, []);
28
28
  useModal(ref, onClose, initialFocus);
29
- return (_jsx("dialog", { ref: ref, className: "rastro-integrations__scrim", "data-side": side ? "" : undefined, role: role === "alertdialog" ? "alertdialog" : undefined, "aria-modal": "true", "aria-labelledby": labelledBy, "aria-describedby": describedBy,
29
+ return (_jsx("dialog", { ref: ref, className: className, "data-side": side ? "" : undefined, role: role === "alertdialog" ? "alertdialog" : undefined, "aria-modal": "true", "aria-labelledby": labelledBy, "aria-describedby": describedBy,
30
30
  // Esc is handled by useModal so React state stays the source of truth.
31
31
  onCancel: (event) => event.preventDefault(), onClick: (event) => {
32
32
  if (event.target === event.currentTarget)
@@ -1 +1 @@
1
- {"version":3,"file":"Overlay.js","sourceRoot":"","sources":["../../../src/ui/integrations/Overlay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAkC,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,IAAI,GAAG,QAAQ,EACf,UAAU,EACV,WAAW,EACX,IAAI,GAAG,KAAK,EACZ,YAAY,EACZ,OAAO,EACP,QAAQ,GAUT;IACC,MAAM,GAAG,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAC5C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;QAC3B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI;YAAE,OAA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
7
7
  report: LeadsReport | undefined;
8
8
  /** The same report for the period before, for the KPI changes. */
9
9
  previous?: LeadsReport | undefined;
10
- /** `leads.daily` per client with `origin: "ctwa_ad"`, for sparklines and alerts. */
10
+ /**
11
+ * `leads.daily` per client with `origin: "paid"` (`"ctwa_ad"` on hosts
12
+ * before 0.11), for sparklines and alerts.
13
+ */
11
14
  dailyBySite?: Record<string, LeadsDaily> | undefined;
12
15
  /** `meta.status` for the clients: ad accounts and their last sync. */
13
16
  status?: MetaStatus | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"PortfolioView.d.ts","sourceRoot":"","sources":["../../../src/ui/portfolio/PortfolioView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACX,MAAM,uBAAuB,CAAC;AAa/B,OAAO,EAIL,KAAK,aAAa,EAGnB,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAChC,iFAAiF;IACjF,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACnC,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC;IACrD,sEAAsE;IACtE,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,wDAAwD;IACxD,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAslBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,MAAM,EACN,UAAU,EACV,GAAG,EACH,OAAO,GACR,EAAE,kBAAkB,+BAwGpB"}
1
+ {"version":3,"file":"PortfolioView.d.ts","sourceRoot":"","sources":["../../../src/ui/portfolio/PortfolioView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACX,MAAM,uBAAuB,CAAC;AAa/B,OAAO,EAIL,KAAK,aAAa,EAGnB,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAChC,iFAAiF;IACjF,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC;IACrD,sEAAsE;IACtE,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,wDAAwD;IACxD,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAslBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,MAAM,EACN,UAAU,EACV,GAAG,EACH,OAAO,GACR,EAAE,kBAAkB,+BAwGpB"}