@elevasis/ui 2.24.0 → 2.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/app/index.css +11 -0
  2. package/dist/app/index.d.ts +457 -357
  3. package/dist/app/index.js +8 -7
  4. package/dist/auth/index.js +4 -4
  5. package/dist/charts/index.js +7 -7
  6. package/dist/{chunk-DDZOHLHB.js → chunk-26HQMR7S.js} +1 -1
  7. package/dist/{chunk-4NWNS7TX.js → chunk-3AHEHVJ6.js} +3 -3
  8. package/dist/{chunk-LJWV4TWV.js → chunk-4ZFBVND2.js} +2 -2
  9. package/dist/{chunk-FUEXGRFR.js → chunk-7LJUTTXU.js} +5 -5
  10. package/dist/{chunk-KCJ6VATY.js → chunk-AZQY7AJR.js} +13 -24
  11. package/dist/{chunk-BIWHHWCJ.js → chunk-DWK2QIAK.js} +2 -1
  12. package/dist/{chunk-ZDKQNQ4X.js → chunk-GESXCQWY.js} +1 -1
  13. package/dist/{chunk-Z6FAH4XV.js → chunk-HKBEURCV.js} +1 -1
  14. package/dist/{chunk-HC2KV6BU.js → chunk-HOIT677G.js} +1 -1
  15. package/dist/chunk-IS53MXE4.js +230 -0
  16. package/dist/{chunk-MTR6AN2C.js → chunk-IX7LWINC.js} +6 -5
  17. package/dist/{chunk-AXXTN44Z.js → chunk-IYIZYMIE.js} +2 -2
  18. package/dist/{chunk-VGNAV3TH.js → chunk-JDQSCEEF.js} +1237 -642
  19. package/dist/chunk-JMI7L7Y7.js +524 -0
  20. package/dist/{chunk-TSSKOQBX.js → chunk-KMAXFJPH.js} +2 -2
  21. package/dist/{chunk-HQ7M6PBW.js → chunk-KU7ZDWQ7.js} +1 -1
  22. package/dist/{chunk-YBZT7MJR.js → chunk-L4RT57WU.js} +7 -7
  23. package/dist/{chunk-2WZ635SS.js → chunk-MU4VPAMR.js} +2 -2
  24. package/dist/{chunk-3JCMO7SD.js → chunk-N55DVMAG.js} +1 -1
  25. package/dist/{chunk-EIOJNUPL.js → chunk-PNLJIPV5.js} +1 -1
  26. package/dist/{chunk-6Z3G4U2R.js → chunk-Q5BEODAT.js} +3 -2
  27. package/dist/{chunk-M2HWJY6O.js → chunk-QB2CC4VH.js} +2045 -243
  28. package/dist/{chunk-QULLZ5PE.js → chunk-RSG2O3HF.js} +893 -642
  29. package/dist/{chunk-M25JL54Z.js → chunk-RYTEQBAO.js} +1 -1
  30. package/dist/{chunk-XUYBOO32.js → chunk-U36X6NZM.js} +15 -7
  31. package/dist/{chunk-QSTH6T77.js → chunk-VKMNWHTL.js} +1 -1
  32. package/dist/{chunk-KLFIJDTD.js → chunk-VOVZLL23.js} +4 -4
  33. package/dist/{chunk-SLH2QLKV.js → chunk-WFTNY755.js} +1 -1
  34. package/dist/{chunk-DK2HVHCY.js → chunk-WKJ47GIW.js} +1 -1
  35. package/dist/chunk-X4WBGKJQ.js +138 -0
  36. package/dist/{chunk-QHSW4WHM.js → chunk-XTVZFT7U.js} +1 -1
  37. package/dist/components/index.css +11 -0
  38. package/dist/components/index.d.ts +478 -386
  39. package/dist/components/index.js +138 -267
  40. package/dist/components/navigation/index.css +11 -0
  41. package/dist/components/navigation/index.js +8 -8
  42. package/dist/features/auth/index.css +11 -0
  43. package/dist/features/auth/index.d.ts +369 -363
  44. package/dist/features/auth/index.js +7 -7
  45. package/dist/features/crm/index.css +11 -0
  46. package/dist/features/crm/index.d.ts +551 -360
  47. package/dist/features/crm/index.js +19 -19
  48. package/dist/features/dashboard/index.css +11 -0
  49. package/dist/features/dashboard/index.js +20 -20
  50. package/dist/features/delivery/index.css +11 -0
  51. package/dist/features/delivery/index.d.ts +363 -357
  52. package/dist/features/delivery/index.js +19 -19
  53. package/dist/features/lead-gen/index.css +11 -0
  54. package/dist/features/lead-gen/index.d.ts +174 -4
  55. package/dist/features/lead-gen/index.js +20 -20
  56. package/dist/features/monitoring/index.css +11 -0
  57. package/dist/features/monitoring/index.js +21 -21
  58. package/dist/features/monitoring/requests/index.css +11 -0
  59. package/dist/features/monitoring/requests/index.js +17 -17
  60. package/dist/features/operations/index.css +11 -0
  61. package/dist/features/operations/index.js +24 -24
  62. package/dist/features/seo/index.js +2 -2
  63. package/dist/features/settings/index.css +11 -0
  64. package/dist/features/settings/index.d.ts +369 -363
  65. package/dist/features/settings/index.js +19 -19
  66. package/dist/hooks/delivery/index.css +11 -0
  67. package/dist/hooks/delivery/index.d.ts +363 -357
  68. package/dist/hooks/delivery/index.js +2 -2
  69. package/dist/hooks/index.css +11 -0
  70. package/dist/hooks/index.d.ts +769 -401
  71. package/dist/hooks/index.js +17 -17
  72. package/dist/hooks/published.css +11 -0
  73. package/dist/hooks/published.d.ts +769 -401
  74. package/dist/hooks/published.js +17 -17
  75. package/dist/index.css +11 -0
  76. package/dist/index.d.ts +885 -383
  77. package/dist/index.js +17 -17
  78. package/dist/initialization/index.d.ts +369 -363
  79. package/dist/initialization/index.js +4 -4
  80. package/dist/layout/index.d.ts +6 -0
  81. package/dist/layout/index.js +5 -5
  82. package/dist/organization/index.css +11 -0
  83. package/dist/organization/index.js +4 -4
  84. package/dist/profile/index.d.ts +369 -363
  85. package/dist/profile/index.js +2 -2
  86. package/dist/provider/ElevasisServiceContext.d.ts +1 -0
  87. package/dist/provider/ElevasisServiceContext.js +1 -1
  88. package/dist/provider/index.css +11 -0
  89. package/dist/provider/index.d.ts +503 -362
  90. package/dist/provider/index.js +14 -14
  91. package/dist/provider/published.css +11 -0
  92. package/dist/provider/published.d.ts +494 -359
  93. package/dist/provider/published.js +12 -12
  94. package/dist/supabase/index.d.ts +369 -357
  95. package/dist/test-utils/index.js +1 -1
  96. package/dist/typeform/index.js +49 -20
  97. package/dist/types/index.d.ts +382 -363
  98. package/package.json +2 -2
  99. package/dist/chunk-CEWTOKE7.js +0 -109
  100. package/dist/chunk-OWHQ65EQ.js +0 -211
  101. package/dist/chunk-UDJE54WN.js +0 -209
  102. /package/dist/{chunk-IRW7JMQ4.js → chunk-5WWZXCS5.js} +0 -0
  103. /package/dist/{chunk-QJ2KCHKX.js → chunk-E565XMTQ.js} +0 -0
@@ -0,0 +1,524 @@
1
+ import { ApiClientProvider, useApiClient } from './chunk-T6INEVX6.js';
2
+ import { OrganizationProvider } from './chunk-HOIT677G.js';
3
+ import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-SGXXJE52.js';
4
+ import { InitializationProvider } from './chunk-WKJ47GIW.js';
5
+ import { useOrganization } from './chunk-DD3CCMCZ.js';
6
+ import { ProfileProvider } from './chunk-XTVZFT7U.js';
7
+ import { ElevasisServiceProvider } from './chunk-5WWZXCS5.js';
8
+ import { useAuthContext } from './chunk-BRJ3QZ4E.js';
9
+ import { createContext, lazy, useContext, Suspense, useRef } from 'react';
10
+ import { jsx } from 'react/jsx-runtime';
11
+ import { z } from 'zod';
12
+ import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
13
+
14
+ var consoleAdapter = {
15
+ success(title, message) {
16
+ console.log(`[Notification][Success] ${title}: ${message}`);
17
+ },
18
+ error(title, message) {
19
+ console.warn(`[Notification][Error] ${title}: ${message}`);
20
+ },
21
+ info(title, message) {
22
+ console.log(`[Notification][Info] ${title}: ${message}`);
23
+ },
24
+ warning(title, message) {
25
+ console.warn(`[Notification][Warning] ${title}: ${message}`);
26
+ },
27
+ apiError(error) {
28
+ const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
29
+ const title = getErrorTitle(code);
30
+ const formatted = formatErrorMessage(message, requestId, fields, retryAfter);
31
+ console.warn(`[Notification][API Error] ${title}: ${formatted}`);
32
+ }
33
+ };
34
+ var NotificationContext = createContext(consoleAdapter);
35
+ function NotificationProvider({ adapter, children }) {
36
+ return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: adapter, children });
37
+ }
38
+ function useNotificationAdapter() {
39
+ return useContext(NotificationContext);
40
+ }
41
+ var ModelIdSchema = z.string().trim().min(1).max(100).regex(/^[a-z0-9]+(?:[-._][a-z0-9]+)*$/, "IDs must be lowercase and use -, _, or . separators");
42
+ var LabelSchema = z.string().trim().min(1).max(120);
43
+ var DescriptionSchema = z.string().trim().min(1).max(2e3);
44
+ var ColorTokenSchema = z.string().trim().min(1).max(50);
45
+ var IconNameSchema = z.string().trim().min(1).max(80);
46
+ var PathSchema = z.string().trim().startsWith("/").max(300);
47
+ var ReferenceIdsSchema = z.array(ModelIdSchema).default([]);
48
+ var DisplayMetadataSchema = z.object({
49
+ label: LabelSchema,
50
+ description: DescriptionSchema.optional(),
51
+ color: ColorTokenSchema.optional(),
52
+ icon: IconNameSchema.optional()
53
+ });
54
+ var TechStackEntrySchema = z.object({
55
+ /** Name of the external platform (e.g. "HubSpot", "Stripe", "Notion"). */
56
+ platform: z.string().trim().min(1).max(200),
57
+ /** Free-form description of what this integration is used for. */
58
+ purpose: z.string().trim().min(1).max(500),
59
+ /**
60
+ * Health of the credential backing this integration.
61
+ * - configured: credential present and valid
62
+ * - pending: not yet set up
63
+ * - expired: credential existed but has lapsed
64
+ * - missing: expected but not present
65
+ */
66
+ credentialStatus: z.enum(["configured", "pending", "expired", "missing"]),
67
+ /**
68
+ * Whether this integration is the primary system of record for its domain
69
+ * (e.g. HubSpot is SoR for contacts). Defaults to false.
70
+ */
71
+ isSystemOfRecord: z.boolean().default(false)
72
+ });
73
+ DisplayMetadataSchema.extend({
74
+ id: ModelIdSchema,
75
+ resourceId: z.string().trim().min(1).max(255),
76
+ resourceType: z.enum(["workflow", "agent", "trigger", "integration", "external", "human_checkpoint"]),
77
+ featureIds: ReferenceIdsSchema,
78
+ entityIds: ReferenceIdsSchema,
79
+ surfaceIds: ReferenceIdsSchema,
80
+ capabilityIds: ReferenceIdsSchema,
81
+ /** Optional tech-stack metadata for external-SaaS integrations. */
82
+ techStack: TechStackEntrySchema.optional()
83
+ });
84
+ var SalesStageSemanticClassSchema = z.enum(["open", "active", "nurturing", "closed_won", "closed_lost"]);
85
+ var SalesStageSchema = DisplayMetadataSchema.extend({
86
+ id: ModelIdSchema,
87
+ order: z.number().int().min(0),
88
+ semanticClass: SalesStageSemanticClassSchema,
89
+ surfaceIds: ReferenceIdsSchema,
90
+ resourceIds: ReferenceIdsSchema
91
+ });
92
+ var SalesPipelineSchema = z.object({
93
+ id: ModelIdSchema,
94
+ label: z.string().trim().min(1).max(120),
95
+ description: DescriptionSchema.optional(),
96
+ entityId: ModelIdSchema,
97
+ stages: z.array(SalesStageSchema).min(1)
98
+ });
99
+ var OrganizationModelSalesSchema = z.object({
100
+ entityId: ModelIdSchema,
101
+ defaultPipelineId: ModelIdSchema,
102
+ pipelines: z.array(SalesPipelineSchema).min(1)
103
+ });
104
+ function findPipeline(definitions, pipelineKey) {
105
+ return definitions.find((def) => def.pipelineKey === pipelineKey);
106
+ }
107
+ var CRM_DISCOVERY_REPLIED_STATE = {
108
+ stateKey: "discovery_replied"};
109
+ var CRM_DISCOVERY_LINK_SENT_STATE = {
110
+ stateKey: "discovery_link_sent"};
111
+ var CRM_DISCOVERY_NUDGING_STATE = {
112
+ stateKey: "discovery_nudging"};
113
+ var CRM_DISCOVERY_BOOKING_CANCELLED_STATE = {
114
+ stateKey: "discovery_booking_cancelled"};
115
+ var CRM_PRIORITY_BUCKETS = [
116
+ { bucketKey: "needs_response", label: "Needs Response", rank: 10, color: "red" },
117
+ { bucketKey: "follow_up_due", label: "Follow-up Due", rank: 20, color: "orange" },
118
+ { bucketKey: "waiting", label: "Waiting", rank: 30, color: "blue" },
119
+ { bucketKey: "stale", label: "Stale", rank: 40, color: "gray" },
120
+ { bucketKey: "closed_low", label: "Closed", rank: 50, color: "dark" }
121
+ ];
122
+ var DEFAULT_CRM_PRIORITY_RULE_CONFIG = {
123
+ buckets: CRM_PRIORITY_BUCKETS,
124
+ closedStageKeys: ["closed_won", "closed_lost"],
125
+ followUpAfterDaysByStateKey: {
126
+ discovery_link_sent: 3,
127
+ discovery_nudging: 2,
128
+ reply_sent: 3,
129
+ followup_1_sent: 3,
130
+ followup_2_sent: 5,
131
+ followup_3_sent: 7
132
+ },
133
+ staleAfterDays: 14
134
+ };
135
+ var PENDING_STATE = { stateKey: "pending", label: "Pending" };
136
+ var ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE = {
137
+ pipelineKey: "lead-gen",
138
+ label: "Lead Generation",
139
+ entityKey: "acq.list-member",
140
+ stages: [
141
+ {
142
+ stageKey: "outreach",
143
+ label: "Outreach",
144
+ states: [
145
+ PENDING_STATE,
146
+ { stateKey: "personalized", label: "Personalized" },
147
+ { stateKey: "uploaded", label: "Uploaded" },
148
+ { stateKey: "interested", label: "Interested" }
149
+ ]
150
+ },
151
+ {
152
+ stageKey: "prospecting",
153
+ label: "Prospecting",
154
+ states: [
155
+ PENDING_STATE,
156
+ { stateKey: "discovered", label: "Discovered" },
157
+ { stateKey: "verified", label: "Verified" }
158
+ ]
159
+ },
160
+ {
161
+ stageKey: "qualification",
162
+ label: "Qualification",
163
+ states: [PENDING_STATE]
164
+ }
165
+ ]
166
+ };
167
+ var ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE = {
168
+ pipelineKey: "lead-gen",
169
+ label: "Lead Generation",
170
+ entityKey: "acq.list-company",
171
+ stages: [
172
+ {
173
+ stageKey: "outreach",
174
+ label: "Outreach",
175
+ states: [PENDING_STATE]
176
+ },
177
+ {
178
+ stageKey: "prospecting",
179
+ label: "Prospecting",
180
+ states: [
181
+ PENDING_STATE,
182
+ { stateKey: "populated", label: "Populated" },
183
+ { stateKey: "extracted", label: "Extracted" }
184
+ ]
185
+ },
186
+ {
187
+ stageKey: "qualification",
188
+ label: "Qualification",
189
+ states: [PENDING_STATE, { stateKey: "qualified", label: "Qualified" }]
190
+ }
191
+ ]
192
+ };
193
+ var LEAD_GEN_PIPELINE_DEFINITIONS = {
194
+ "acq.list-member": [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
195
+ "acq.list-company": [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
196
+ };
197
+ var LEAD_GEN_STAGE_CATALOG = {
198
+ // Prospecting — company population
199
+ scraped: {
200
+ key: "scraped",
201
+ label: "Scraped",
202
+ description: "Company was scraped from a source directory (Apify actor run).",
203
+ order: 1,
204
+ entity: "company"
205
+ },
206
+ populated: {
207
+ key: "populated",
208
+ label: "Populated",
209
+ description: "Company record populated with structured data from scrape results.",
210
+ order: 2,
211
+ entity: "company"
212
+ },
213
+ extracted: {
214
+ key: "extracted",
215
+ label: "Extracted",
216
+ description: "Website content extracted and parsed for company intelligence.",
217
+ order: 3,
218
+ entity: "company"
219
+ },
220
+ enriched: {
221
+ key: "enriched",
222
+ label: "Enriched",
223
+ description: "Company or contact enriched with third-party data (e.g. Tomba, Anymailfinder).",
224
+ order: 4,
225
+ entity: "company"
226
+ },
227
+ // Prospecting — contact discovery
228
+ discovered: {
229
+ key: "discovered",
230
+ label: "Discovered",
231
+ description: "Contact email address discovered via an email-discovery workflow.",
232
+ order: 5,
233
+ entity: "contact"
234
+ },
235
+ verified: {
236
+ key: "verified",
237
+ label: "Verified",
238
+ description: "Contact email address verified as deliverable (email verification workflow).",
239
+ order: 6,
240
+ entity: "contact"
241
+ },
242
+ // Qualification
243
+ qualified: {
244
+ key: "qualified",
245
+ label: "Qualified",
246
+ description: "Company passed the ICP qualification rubric (company-qualification workflow).",
247
+ order: 7,
248
+ entity: "company"
249
+ },
250
+ // Outreach
251
+ personalized: {
252
+ key: "personalized",
253
+ label: "Personalized",
254
+ description: "Outreach message personalized for the contact (Instantly personalization workflow).",
255
+ order: 8,
256
+ entity: "contact"
257
+ },
258
+ uploaded: {
259
+ key: "uploaded",
260
+ label: "Uploaded",
261
+ description: "Contact uploaded to an Instantly campaign for outreach.",
262
+ order: 9,
263
+ entity: "contact"
264
+ },
265
+ interested: {
266
+ key: "interested",
267
+ label: "Interested",
268
+ description: "Contact replied with a positive signal (Instantly reply-handler transition).",
269
+ order: 10,
270
+ entity: "contact"
271
+ }
272
+ };
273
+
274
+ // ../core/src/business/acquisition/deal-ownership.ts
275
+ var INBOUND_EVENT_TYPES = ["reply_received"];
276
+ var OUTBOUND_EVENT_TYPES = [
277
+ "reply_sent_to_lead",
278
+ "booking_nudge_sent",
279
+ "reminder_sent",
280
+ "rebook_sent",
281
+ "followup_email_sent",
282
+ "reply_followup_sent",
283
+ "lead_deferred_next_step"
284
+ ];
285
+ var INBOUND_SET = new Set(INBOUND_EVENT_TYPES);
286
+ var OUTBOUND_SET = new Set(OUTBOUND_EVENT_TYPES);
287
+ function getDealOwnership(deal) {
288
+ if (deal.state_key === "closed_won" || deal.state_key === "closed_lost") {
289
+ return null;
290
+ }
291
+ if (!Array.isArray(deal.activity_log)) return null;
292
+ let latestInboundMs = null;
293
+ let latestOutboundMs = null;
294
+ for (const entry of deal.activity_log) {
295
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) continue;
296
+ const record = entry;
297
+ const type = typeof record.type === "string" ? record.type : null;
298
+ if (!type) continue;
299
+ const isInbound = INBOUND_SET.has(type);
300
+ const isOutbound = OUTBOUND_SET.has(type);
301
+ if (!isInbound && !isOutbound) continue;
302
+ const occurredAt = resolveTimestamp(record);
303
+ if (occurredAt === null) continue;
304
+ if (isInbound && (latestInboundMs === null || occurredAt > latestInboundMs)) {
305
+ latestInboundMs = occurredAt;
306
+ }
307
+ if (isOutbound && (latestOutboundMs === null || occurredAt > latestOutboundMs)) {
308
+ latestOutboundMs = occurredAt;
309
+ }
310
+ }
311
+ if (latestInboundMs === null && latestOutboundMs === null) return null;
312
+ if (latestOutboundMs !== null && (latestInboundMs === null || latestOutboundMs >= latestInboundMs)) {
313
+ return "them";
314
+ }
315
+ return "us";
316
+ }
317
+ function resolveTimestamp(record) {
318
+ return parseMs(record.timestamp) ?? parseMs(record.occurredAt) ?? parseMs(record.createdAt) ?? parseMs(record.updatedAt) ?? parseMs(record.sentAt) ?? null;
319
+ }
320
+ function parseMs(value) {
321
+ if (value instanceof Date) {
322
+ const ms2 = value.getTime();
323
+ return Number.isNaN(ms2) ? null : ms2;
324
+ }
325
+ if (typeof value !== "string") return null;
326
+ const ms = new Date(value).getTime();
327
+ return Number.isNaN(ms) ? null : ms;
328
+ }
329
+
330
+ // ../core/src/business/acquisition/derive-actions.ts
331
+ var SendReplyActionPayloadSchema = z.object({
332
+ replyBody: z.string().trim().min(1).max(1e4)
333
+ }).strict();
334
+ var DEFAULT_CRM_ACTIONS = [
335
+ {
336
+ key: "move_to_proposal",
337
+ label: "Move to Proposal",
338
+ isAvailableFor: (deal) => deal.stage_key === "interested",
339
+ workflowId: "move_to_proposal-workflow"
340
+ },
341
+ {
342
+ key: "move_to_closing",
343
+ label: "Move to Closing",
344
+ isAvailableFor: (deal) => deal.stage_key === "proposal",
345
+ workflowId: "move_to_closing-workflow"
346
+ },
347
+ {
348
+ key: "move_to_closed_won",
349
+ label: "Close Won",
350
+ isAvailableFor: (deal) => deal.stage_key === "closing",
351
+ workflowId: "move_to_closed_won-workflow"
352
+ },
353
+ {
354
+ key: "move_to_closed_lost",
355
+ label: "Close Lost",
356
+ isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
357
+ workflowId: "move_to_closed_lost-workflow"
358
+ },
359
+ {
360
+ key: "move_to_nurturing",
361
+ label: "Move to Nurturing",
362
+ isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
363
+ workflowId: "move_to_nurturing-workflow"
364
+ },
365
+ {
366
+ key: "send_reply",
367
+ label: "Send Reply",
368
+ isAvailableFor: (deal) => deal.stage_key === "interested" && isOurReplyAction(deal) && (deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey || deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
369
+ workflowId: "crm-send-reply-workflow",
370
+ payloadSchema: SendReplyActionPayloadSchema
371
+ },
372
+ {
373
+ key: "send_link",
374
+ label: "Send Booking Link",
375
+ isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey,
376
+ workflowId: "crm-send-booking-link-workflow"
377
+ },
378
+ {
379
+ key: "send_nudge",
380
+ label: "Send Nudge",
381
+ isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
382
+ workflowId: "crm-send-nudge-workflow"
383
+ },
384
+ {
385
+ key: "mark_no_show",
386
+ label: "Mark No-Show",
387
+ isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
388
+ // Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
389
+ // both manual-click and timeout move the deal to closed_lost. The action_taken activity
390
+ // event captures operator intent and distinguishes the manual variant from the timed one.
391
+ workflowId: "mark_no_show-workflow"
392
+ },
393
+ {
394
+ key: "rebook",
395
+ label: "Rebook",
396
+ isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey,
397
+ workflowId: "crm-rebook-workflow"
398
+ }
399
+ ];
400
+ function deriveActions(deal, actions = DEFAULT_CRM_ACTIONS) {
401
+ return actions.filter((a) => a.isAvailableFor(deal)).map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }));
402
+ }
403
+ function isOurReplyAction(deal) {
404
+ if (Object.prototype.hasOwnProperty.call(deal, "nextAction")) {
405
+ return deal.nextAction === "send_reply";
406
+ }
407
+ return (deal.ownership ?? getDealOwnership(deal)) === "us";
408
+ }
409
+ var CrmActionsContext = createContext(DEFAULT_CRM_ACTIONS);
410
+ function CrmActionsProvider({ actions, children }) {
411
+ return /* @__PURE__ */ jsx(CrmActionsContext.Provider, { value: actions, children });
412
+ }
413
+ function useCrmActions() {
414
+ return useContext(CrmActionsContext);
415
+ }
416
+ var EMPTY_LIST_ACTIONS = Object.freeze([]);
417
+ var ListActionsContext = createContext(EMPTY_LIST_ACTIONS);
418
+ function ListActionsProvider({
419
+ registry = EMPTY_LIST_ACTIONS,
420
+ children
421
+ }) {
422
+ return /* @__PURE__ */ jsx(ListActionsContext.Provider, { value: registry, children });
423
+ }
424
+ function useListActions() {
425
+ return useContext(ListActionsContext);
426
+ }
427
+ function findListActionByCapability(registry, capabilityKey) {
428
+ return registry.find((action) => action.capabilityKey === capabilityKey);
429
+ }
430
+ function getListActionWorkflowId(action) {
431
+ return action.workflowId ?? action.resourceId;
432
+ }
433
+ var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-QC62UHTZ.js').then((m) => ({ default: m.CoreAuthKitInner })));
434
+ var defaultQueryClient = null;
435
+ function getDefaultQueryClient() {
436
+ if (!defaultQueryClient) {
437
+ defaultQueryClient = new QueryClient({
438
+ defaultOptions: { queries: { retry: 1 } }
439
+ });
440
+ }
441
+ return defaultQueryClient;
442
+ }
443
+ var consoleNotificationAdapter = {
444
+ success(title, message) {
445
+ console.log(`[Notification][Success] ${title}: ${message}`);
446
+ },
447
+ error(title, message) {
448
+ console.warn(`[Notification][Error] ${title}: ${message}`);
449
+ },
450
+ info(title, message) {
451
+ console.log(`[Notification][Info] ${title}: ${message}`);
452
+ },
453
+ warning(title, message) {
454
+ console.warn(`[Notification][Warning] ${title}: ${message}`);
455
+ },
456
+ apiError(error) {
457
+ console.warn(`[Notification][API Error]`, error);
458
+ }
459
+ };
460
+ function ElevasisCoreProvider({
461
+ auth,
462
+ queryClient,
463
+ apiUrl,
464
+ onError,
465
+ notifications,
466
+ crmActions,
467
+ listActions,
468
+ children
469
+ }) {
470
+ if (auth.mode === "apiKey") {
471
+ throw new Error(
472
+ `ElevasisCoreProvider: auth mode 'apiKey' is not yet implemented. Only 'authkit' mode is supported.`
473
+ );
474
+ }
475
+ const resolvedQueryClient = queryClient ?? getDefaultQueryClient();
476
+ const resolvedCrmActions = crmActions ?? DEFAULT_CRM_ACTIONS;
477
+ const resolvedListActions = listActions ?? EMPTY_LIST_ACTIONS;
478
+ const content = apiUrl ? /* @__PURE__ */ jsx(ServiceStack, { apiUrl, onError, notifications, children }) : children;
479
+ const AuthInner = /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCoreAuthKitInner, { auth, children: content }) });
480
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: resolvedQueryClient, children: /* @__PURE__ */ jsx(CrmActionsProvider, { actions: resolvedCrmActions, children: /* @__PURE__ */ jsx(ListActionsProvider, { registry: resolvedListActions, children: AuthInner }) }) });
481
+ }
482
+ function ServiceStack({
483
+ apiUrl,
484
+ onError,
485
+ notifications,
486
+ children
487
+ }) {
488
+ const { getAccessToken } = useAuthContext();
489
+ const orgIdRef = useRef(null);
490
+ const getOrganizationId = useRef(() => orgIdRef.current).current;
491
+ return /* @__PURE__ */ jsx(
492
+ ApiClientProvider,
493
+ {
494
+ getAccessToken,
495
+ getOrganizationId,
496
+ isOrganizationReady: false,
497
+ onError,
498
+ children: /* @__PURE__ */ jsx(ServiceStackInner, { apiUrl, orgIdRef, notifications, children })
499
+ }
500
+ );
501
+ }
502
+ function ServiceStackInner({
503
+ apiUrl,
504
+ orgIdRef,
505
+ notifications,
506
+ children
507
+ }) {
508
+ const { apiRequest } = useApiClient(apiUrl);
509
+ const resolvedNotifications = notifications ?? consoleNotificationAdapter;
510
+ return /* @__PURE__ */ jsx(ProfileProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrganizationProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrgServiceBridge, { orgIdRef, apiRequest, notifications: resolvedNotifications, children }) }) });
511
+ }
512
+ function OrgServiceBridge({
513
+ orgIdRef,
514
+ apiRequest,
515
+ notifications,
516
+ children
517
+ }) {
518
+ const { currentWorkOSOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
519
+ orgIdRef.current = currentWorkOSOrganizationId;
520
+ const isReady = !!currentWorkOSOrganizationId && !isInitializing && !isOrgRefreshing;
521
+ return /* @__PURE__ */ jsx(ElevasisServiceProvider, { apiRequest, organizationId: currentWorkOSOrganizationId, isReady, children: /* @__PURE__ */ jsx(NotificationProvider, { adapter: notifications, children: /* @__PURE__ */ jsx(InitializationProvider, { children }) }) });
522
+ }
523
+
524
+ export { CRM_PRIORITY_BUCKETS, ColorTokenSchema, CrmActionsProvider, DEFAULT_CRM_PRIORITY_RULE_CONFIG, DescriptionSchema, DisplayMetadataSchema, EMPTY_LIST_ACTIONS, ElevasisCoreProvider, IconNameSchema, LEAD_GEN_PIPELINE_DEFINITIONS, LEAD_GEN_STAGE_CATALOG, LabelSchema, ListActionsProvider, ModelIdSchema, NotificationProvider, OrganizationModelSalesSchema, PathSchema, ReferenceIdsSchema, deriveActions, findListActionByCapability, findPipeline, getListActionWorkflowId, useCrmActions, useListActions, useNotificationAdapter };
@@ -1,5 +1,5 @@
1
- import { useErrorTrends } from './chunk-QSTH6T77.js';
2
- import { CardHeader, CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-XUYBOO32.js';
1
+ import { useErrorTrends } from './chunk-VKMNWHTL.js';
2
+ import { CardHeader, CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-U36X6NZM.js';
3
3
  import { getTimeRangeLabel, getTimeRangeDates, formatBucketTime } from './chunk-SGXXJE52.js';
4
4
  import { useRef, useState, useLayoutEffect, useEffect, useMemo, useCallback } from 'react';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -1,4 +1,4 @@
1
- import { useUserProfile } from './chunk-QHSW4WHM.js';
1
+ import { useUserProfile } from './chunk-XTVZFT7U.js';
2
2
  import { useAuthContext } from './chunk-BRJ3QZ4E.js';
3
3
  import { useMemo, useCallback } from 'react';
4
4
 
@@ -1,14 +1,14 @@
1
- import { AppShellLoader } from './chunk-M25JL54Z.js';
1
+ import { AppShellLoader } from './chunk-RYTEQBAO.js';
2
2
  import { FilterBar } from './chunk-PDHTXPSF.js';
3
3
  import { CustomModal } from './chunk-KVJ3LFH2.js';
4
4
  import { useAvailablePresets } from './chunk-SNHGSCKH.js';
5
- import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-QULLZ5PE.js';
6
- import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-Z6FAH4XV.js';
7
- import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-XUYBOO32.js';
8
- import { RoleBadge } from './chunk-ZDKQNQ4X.js';
5
+ import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-RSG2O3HF.js';
6
+ import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-HKBEURCV.js';
7
+ import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-U36X6NZM.js';
8
+ import { RoleBadge } from './chunk-GESXCQWY.js';
9
9
  import { isAPIClientError, formatDateTime, OAUTH_POPUP_CHECK_INTERVAL, OAUTH_FLOW_TIMEOUT } from './chunk-SGXXJE52.js';
10
- import { useInitialization } from './chunk-DK2HVHCY.js';
11
- import { useElevasisServices } from './chunk-IRW7JMQ4.js';
10
+ import { useInitialization } from './chunk-WKJ47GIW.js';
11
+ import { useElevasisServices } from './chunk-5WWZXCS5.js';
12
12
  import { createUseExternalEvents, Text, Table, Group, Tooltip, ActionIcon, Stack, Title, Button, Select, TextInput, Alert, PasswordInput, Anchor, Paper, Card, Switch, Badge, Center, Loader, Box, Code, CopyButton, ThemeIcon, SimpleGrid, UnstyledButton, Divider, Textarea, Tabs, MultiSelect } from '@mantine/core';
13
13
  import { IconSettings, IconShieldOff, IconKey, IconCalendar, IconPencil, IconTrash, IconAlertTriangle, IconInfoCircle, IconExclamationMark, IconPlus, IconAlertCircle, IconUsers, IconSearch, IconBuilding, IconWebhook, IconCheck, IconCopy, IconUser, IconMail, IconRefresh, IconPalette, IconEye, IconSparkles, IconTrendingUp, IconClock, IconPlayerPause, IconPlayerPlay, IconActivity, IconShieldLock, IconAdjustments, IconBrandDropbox, IconBrandGoogleDrive, IconPlug, IconEdit, IconUserX, IconUserCheck } from '@tabler/icons-react';
14
14
  import { z } from 'zod';
@@ -1,8 +1,8 @@
1
1
  import { PRESETS, getPreset, generateShades, mantineThemeOverride, createCssVariablesResolver, PresetsProvider } from './chunk-QIW6OCEI.js';
2
2
  import { AppBackground } from './chunk-WLOQ4IBG.js';
3
- import { ElevasisCoreProvider } from './chunk-UDJE54WN.js';
3
+ import { ElevasisCoreProvider } from './chunk-JMI7L7Y7.js';
4
4
  import { ElevasisLoader } from './chunk-SZHARWKU.js';
5
- import { AppearanceProvider } from './chunk-QJ2KCHKX.js';
5
+ import { AppearanceProvider } from './chunk-E565XMTQ.js';
6
6
  import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-SGXXJE52.js';
7
7
  import { useMemo, useEffect } from 'react';
8
8
  import { Loader, mergeThemeOverrides, MantineProvider } from '@mantine/core';
@@ -1,4 +1,4 @@
1
- import { useAppearance } from './chunk-QJ2KCHKX.js';
1
+ import { useAppearance } from './chunk-E565XMTQ.js';
2
2
  import { Center, Box } from '@mantine/core';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -1,4 +1,4 @@
1
- import { ElevasisFeaturesProvider } from './chunk-LJWV4TWV.js';
1
+ import { ElevasisFeaturesProvider } from './chunk-4ZFBVND2.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
4
  function createTestFeaturesProvider({
@@ -1,7 +1,7 @@
1
- import { SubshellNavItem } from './chunk-CEWTOKE7.js';
1
+ import { SubshellNavItem } from './chunk-X4WBGKJQ.js';
2
2
  import { NavigationButton } from './chunk-NYBEU5TE.js';
3
3
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
4
- import { useAppearance } from './chunk-QJ2KCHKX.js';
4
+ import { useAppearance } from './chunk-E565XMTQ.js';
5
5
  import { sidebarItemGap, sidebarSubLinkPaddingY, sidebarSubLinkPaddingX, sidebarSubLinkIndent, sidebarHoverDelay, sidebarTransitionDuration, sidebarCollapsedWidth, sidebarWidth, topbarHeight, sidebarToggleIconSize, sidebarSectionPadding, sidebarGroupChevronSize, sidebarIconInnerSize } from './chunk-DT3QYZVU.js';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import { createContext, memo, useEffect, createElement, useContext, useRef, useLayoutEffect, useState } from 'react';
@@ -1071,6 +1071,7 @@ var SubshellNavList = ({ items }) => {
1071
1071
  icon: item.icon,
1072
1072
  label: item.label,
1073
1073
  isActive,
1074
+ href: item.to,
1074
1075
  onClick: () => navigate(item.to)
1075
1076
  },
1076
1077
  item.to