@apextelemed/partner-core 0.5.2 → 0.6.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 (44) hide show
  1. package/README.md +83 -14
  2. package/dist/api/index.d.ts +1 -1
  3. package/dist/api/index.js +3 -3
  4. package/dist/api/index.jsx +3 -3
  5. package/dist/chunk/{FUOUTRAO.jsx → 4ZSZHZQV.jsx} +2 -2
  6. package/dist/chunk/{ZJENZPAM.jsx → 5HNZ7SEM.jsx} +12 -8
  7. package/dist/chunk/{5D7SGF46.js → BEDW4XUM.js} +61 -5
  8. package/dist/chunk/BEDW4XUM.js.map +1 -0
  9. package/dist/chunk/{XHOD3HUQ.js → BVLA7ATM.js} +3 -3
  10. package/dist/chunk/{XHOD3HUQ.js.map → BVLA7ATM.js.map} +1 -1
  11. package/dist/chunk/{DQE4K55D.jsx → EVCGDF5D.jsx} +60 -4
  12. package/dist/chunk/{KO2JPCIP.js → HKNTNZRW.js} +3443 -1482
  13. package/dist/chunk/HKNTNZRW.js.map +1 -0
  14. package/dist/chunk/{JTG4H4I5.jsx → HXMLRDIJ.jsx} +92 -12
  15. package/dist/chunk/{C7TELVJF.js → MLXPHJLR.js} +3 -3
  16. package/dist/chunk/{C7TELVJF.js.map → MLXPHJLR.js.map} +1 -1
  17. package/dist/chunk/{2UWULNSX.jsx → NBB2VTQK.jsx} +2 -2
  18. package/dist/chunk/{ZD2MMEXL.js → NSRQXBHK.js} +13 -9
  19. package/dist/chunk/NSRQXBHK.js.map +1 -0
  20. package/dist/chunk/{7ZESUC4Q.js → QTGJY3YQ.js} +3 -3
  21. package/dist/chunk/{7ZESUC4Q.js.map → QTGJY3YQ.js.map} +1 -1
  22. package/dist/chunk/{I322BQIU.jsx → SSVJ27MR.jsx} +2650 -1224
  23. package/dist/chunk/{GNG53L37.jsx → WLEIDQ5M.jsx} +2 -2
  24. package/dist/chunk/{GPVYUP3H.js → WUE4VQBA.js} +92 -14
  25. package/dist/chunk/WUE4VQBA.js.map +1 -0
  26. package/dist/{client-BD9_HCZY.d.ts → client-B6Kt7LWo.d.ts} +129 -2
  27. package/dist/flows/index.d.ts +99 -7
  28. package/dist/flows/index.js +6 -6
  29. package/dist/flows/index.jsx +6 -6
  30. package/dist/index/index.d.ts +2 -2
  31. package/dist/index/index.js +7 -7
  32. package/dist/index/index.jsx +7 -7
  33. package/dist/pages/index.d.ts +13 -3
  34. package/dist/pages/index.js +5 -5
  35. package/dist/pages/index.jsx +5 -5
  36. package/dist/stores/index.d.ts +1 -1
  37. package/dist/stores/index.js +2 -2
  38. package/dist/stores/index.jsx +2 -2
  39. package/dist/theme/member-portal.css +213 -0
  40. package/package.json +1 -1
  41. package/dist/chunk/5D7SGF46.js.map +0 -1
  42. package/dist/chunk/GPVYUP3H.js.map +0 -1
  43. package/dist/chunk/KO2JPCIP.js.map +0 -1
  44. package/dist/chunk/ZD2MMEXL.js.map +0 -1
package/README.md CHANGED
@@ -4,6 +4,28 @@ Shared library for the telehealth patient-portal sites (perihelion, axiom-health
4
4
 
5
5
  > The local checkout for this repo lives at `the-frontend/` for historical reasons; the published package name is `@apextelemed/partner-core`.
6
6
 
7
+ ## Documentation
8
+
9
+ Consumer documentation lives on the Apex Telemed developer docs site, next to
10
+ the Partner API and survey helper docs:
11
+
12
+ **https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/**
13
+
14
+ - [Overview and tiers](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/)
15
+ - [Installation and configuration](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/installation/)
16
+ - [API client and stores](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/api-client-and-stores/)
17
+ - [Flow hooks](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/flows/)
18
+ - [Pages and primitives](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/pages-and-primitives/)
19
+ - [Theming](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/theming/)
20
+ - [Testing your site](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/testing-your-site/)
21
+ - [Gotchas](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/gotchas/)
22
+
23
+ Those pages are generated from this package's sources and are the reference
24
+ for consumers. The rest of this README is maintainer material: workspace
25
+ layout, publishing, the export map, and local development. Keep the site in
26
+ sync when the public surface changes; its source is the public
27
+ [apex-devdocs](https://github.com/thefortifiedgrp/apex-devdocs) repo.
28
+
7
29
  ## Agent guidance
8
30
 
9
31
  The Claude skill for this package now lives in the shared plugin repo
@@ -37,7 +59,10 @@ src/
37
59
  cart.ts cartStore singleton (items, promo, persistence)
38
60
  medication.ts medicationStore singleton (selected drug)
39
61
  flows/ headless hooks for survey/checkout/signup/dashboard/etc.
40
- (empty for now — populated as pages are migrated)
62
+ pages/ Tier 3 themed page components
63
+ primitives.tsx the Primitives contract sites implement
64
+ theme/ CSS-variable stylesheets + UnoCSS preset
65
+ testing/ the seam suite consumers run against their own site
41
66
  ```
42
67
 
43
68
  ## Consumer setup
@@ -320,29 +345,71 @@ The interface is defined in `src/primitives.tsx`. It is intentionally small —
320
345
 
321
346
  | Surface | Subpath | Tier |
322
347
  |---|---|---|
348
+ | Boot configuration | `/config` | 1 |
323
349
  | API client + types | `/api` | 1 |
324
350
  | Stores (auth, cart, medication) | `/stores` | 1 |
325
351
  | Headless flow hooks | `/flows` | 2 |
326
352
  | Tier 3 primitives contract | `/primitives` | 3 |
327
353
  | Tier 3 page components | `/pages` | 3 |
328
- | Admin theme (CSS variables + UnoCSS preset) | `/theme`, `/theme/admin.css` | — |
354
+ | Themes (CSS variables + UnoCSS preset) | `/theme`, `/theme/{admin,flow,affiliate,member-portal}.css` | — |
355
+ | Consumer seam suite | `/testing` | — |
329
356
 
330
357
  ### Tier 3 pages
331
358
 
332
- - `<SurveyPage>` — multi-step medical questionnaire
333
- - `<CheckoutPage>` — prescription purchase with Authorize.Net Accept.js
334
- - `<SignupPage>` — 4-step account creation with draft persistence
335
- - `<SubscribePage>` — standalone subscription start for already-signed-in users
359
+ Nineteen components ship from `/pages`. Per-page props and behaviour are
360
+ documented on the [docs site](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/pages-and-primitives/);
361
+ this list is the inventory.
362
+
363
+ **Customer funnel** — `<SurveyV2Page>` (questionnaire composed from `drugIds`,
364
+ qualifies guests), `<SurveyPage>` (deprecated v1 — needs a medication chosen
365
+ first), `<CheckoutPage>`, `<CartCheckoutPage>`, `<SignupPage>`,
366
+ `<RegisterPage>`, `<SubscribePage>`, `<UpdatePaymentMethod>`.
367
+
368
+ **Auth** — `<ForgotPasswordPage>`, `<ResetPasswordPage>`,
369
+ `<AffiliateForgotPassword>`, `<AffiliateResetPassword>`.
370
+
371
+ **Portals** — `<AdminDashboard>`, `<EmailTemplates>`,
372
+ `<PatientDashboardPreview>`, `<MemberPortal>`, `<AffiliatePortal>`,
373
+ `<AffiliateRegister>`, `<AffiliateLogin>`.
336
374
 
337
375
  ### Tier 2 flow hooks
338
376
 
339
- - `useSurveyFlow` — backs `<SurveyPage>`
340
- - `useCheckoutFlow` — backs `<CheckoutPage>`
341
- - `useSignupFlow` — backs `<SignupPage>`
342
- - `useSubscribeFlow` — backs `<SubscribePage>`
343
- - `useDashboardData` — patient dashboard (Tier 2 only — no shared JSX)
344
- - `useMessagesThread` — provider messaging with polling (Tier 2 only)
345
- - `useCatalog`, `useProductDetail`, `useMedicationSelect` — product browsing (Tier 2 only)
377
+ Twenty hooks ship from `/flows`, alongside the pure helpers each flow module
378
+ exports (formatters, `buildTrackerView`, the customer-360 derivations, the
379
+ address and subscription-status vocabularies). Signatures are on the
380
+ [docs site](https://thefortifiedgrp.github.io/apex-devdocs/partner-sdk/flows/).
381
+
382
+ - **Survey** — `useSurveyV2Flow`; `useSurveyFlow` (deprecated v1)
383
+ - **Purchase** — `useCheckoutFlow`, `useCartCheckoutFlow`, `useSignupFlow`,
384
+ `useRegisterFlow`, `useSubscribeFlow`, `useSubscriptionIntakeFlow`,
385
+ `useUpdatePaymentMethodFlow`
386
+ - **Portal data** — `useDashboardData`, `useMemberPortalData`,
387
+ `useMessagesThread`
388
+ - **Catalog** — `useCatalog`, `useProductDetail`, `useMedicationSelect`
389
+ - **Affiliate** — `useAffiliateStats`, `useAffiliateConversions`,
390
+ `useAffiliateDownline`, `useAffiliateLinks`
391
+ - **Forms** — `useAddressPair`
392
+
393
+ Hooks with no shared JSX (dashboard, messages, catalog, affiliate) are Tier 2
394
+ only: the site renders its own page on top.
395
+
396
+ #### Deep-linking into Messages
397
+
398
+ `<MemberPortal>`'s Messages tab reads its destination from the URL, so any
399
+ link into the portal — an email, a support macro, another tab's CTA — can
400
+ pre-select it instead of landing on the merged conversation list:
401
+
402
+ - `#messages` — open the tab itself.
403
+ - `?c=<id>` — open this exact conversation/thread. Wins over `to`/`cat` when
404
+ both are present; its channel is implied by the thread's own source.
405
+ - `?to=care|support` — pre-select which side of the merged inbox to land on.
406
+ - `?cat=<category>` — a support category (`billing`, `orders`, `account`,
407
+ `technical`, `other`); support-only, and implies `to=support` when `to` is
408
+ omitted. Unknown values on any of these params are ignored, not surfaced.
409
+
410
+ The same shape is `MessagesIntent` (exported from `/flows`), which every
411
+ in-portal CTA passes to `onOpenMessages(intent?)` — the URL query params are
412
+ just that intent's serialization for links, not a separate mechanism.
346
413
 
347
414
  ### Admin
348
415
 
@@ -376,7 +443,9 @@ export default defineConfig({
376
443
 
377
444
  The full variable list is exported as `ADMIN_CSS_VARIABLES` from `/theme` for sites that want to generate override stylesheets programmatically.
378
445
 
379
- `<AdminDashboard>` includes Promotions as a tab — it is not a separate page.
446
+ `<AdminDashboard>` has no single Promotions tab: Sales and Promo Codes are
447
+ separate tabs, grouped under Marketing with Affiliates and Funnel. They are
448
+ tabs of the dashboard, not separate pages.
380
449
 
381
450
  #### Customers and the detail-view standard
382
451
 
@@ -1,4 +1,4 @@
1
- export { A as AddressVerifyResult, a as AdminApexDrug, b as AdminBillingAttempt, c as AdminCategory, d as AdminCategoryInput, e as AdminCustomer, f as AdminCustomerFacts, g as AdminCustomerFunnel, h as AdminCustomerListParams, i as AdminCustomerOverview, j as AdminCustomerProfile, k as AdminCustomerRequest, l as AdminCustomerRow, m as AdminCustomerSupport, n as AdminCustomerSupportThread, o as AdminDashboardStats, p as AdminLifecycle, q as AdminLifecycleBucket, r as AdminListParams, s as AdminOrderSummary, t as AdminPayment, u as AdminPaymentDetail, v as AdminProduct, w as AdminPromoCode, x as AdminPromoCodeInput, y as AdminRefundResult, z as AdminSale, B as AdminSaleInput, C as AdminSubscription, D as AdminSubscriptionDetail, E as AdminSubscriptionPatch, F as AdminSubscriptionWriteResult, G as AdminSupportCustomer, H as AdminSupportStats, I as AdminSupportThread, J as AdminWebhookEvent, K as Affiliate, L as AffiliateAuthTokens, M as AffiliateClickRecord, N as AffiliateConversion, O as AffiliateDashboardLinks, P as AffiliateDashboardProfile, Q as AffiliateDashboardStats, R as AffiliateDownlineMember, S as AffiliateEarningsBreakdown, T as AffiliatePaymentMethod, U as AffiliateProgram, V as AffiliateRegisterInput, W as AffiliateRegisterResponse, X as AffiliateSession, Y as AffiliateStatsResponse, Z as AffiliateStatus, _ as AffiliateTrackResponse, $ as ApiError, a0 as ApiResponse, a1 as AttributionMethod, a2 as AuthTokens, a3 as CatalogProduct, a4 as CheckoutAddress, a5 as CheckoutPayload, a6 as CheckoutResult, a7 as CommissionConfig, a8 as CommissionStatus, a9 as CompleteSurveyPayload, aa as CreateAffiliatePayload, ab as CreateAffiliateProgramPayload, ac as CreateOrderPayload, ad as CreateRequestPayload, ae as CreateSubscriptionPayload, af as CustomerDiscountConfig, ag as DeliveryInfo, ah as DiscountType, ai as EmailTemplatesMap, aj as LoginPayload, ak as MemberPrescriptionRequest, al as MemberSurveyMode, am as MemberSurveyResponseSummary, an as MemberSurveyTranscript, ao as MemberSurveyTranscriptItem, ap as MemberSurveyTranscriptSection, aq as MembersMeResponse, ar as Order, as as OrderItemInput, at as PaginationParams, au as PaymentCallbackPayload, av as PaymentInitiatePayload, aw as PaymentType, ax as PendingRenewalSurvey, ay as Placeholder, az as ProductSaleSummary, aA as PromoValidationResponse, aB as PublicCategory, aC as RegisterAndSubscribePayload, aD as RegisterPayload, aE as RenewalStatus, aF as SUPPORT_ATTACHMENT_MAX_BYTES, aG as SUPPORT_ATTACHMENT_MIME_TYPES, aH as SelectDrugPayload, aI as SendMessagePayload, aJ as SendToPharmacyPayload, aK as SupportAttachment, aL as SupportMessage, aM as SupportRealtimeToken, aN as SupportThread, aO as SupportThreadStatus, aP as SurveySubmitPayload, aQ as TemplatePlaceholdersMap, aR as TemplateText, aS as TokenTrackName, aT as UpdateAffiliatePayload, aU as UpdateAffiliateProgramPayload, aV as UpdatePaymentMethodPayload, aW as UpdateProfilePayload, aX as User, aY as addressesApi, aZ as adminAffiliatesApi, a_ as adminApi, a$ as affiliateAuthStorageKey, b0 as affiliatePortalApi, b1 as apexApi, b2 as apiFetch, b3 as authApi, b4 as authStorageKey, b5 as clearAffiliateTokens, b6 as clearTokens, b7 as getAffiliateTokens, b8 as getTokens, b9 as membersApi, ba as messagesApi, bb as newIdempotencyKey, bc as onTokensCleared, bd as ordersApi, be as paymentsApi, bf as productsApi, bg as promoCodesApi, bh as setAffiliateTokens, bi as setTokens, bj as subscriptionsApi, bk as supportApi, bl as usersApi } from '../client-BD9_HCZY.js';
1
+ export { A as AddressVerifyResult, a as AdminApexDrug, b as AdminBillingAttempt, c as AdminCategory, d as AdminCategoryInput, e as AdminCustomer, f as AdminCustomerFacts, g as AdminCustomerFunnel, h as AdminCustomerListParams, i as AdminCustomerOverview, j as AdminCustomerProfile, k as AdminCustomerRequest, l as AdminCustomerRow, m as AdminCustomerSupport, n as AdminCustomerSupportThread, o as AdminDashboardStats, p as AdminLifecycle, q as AdminLifecycleBucket, r as AdminListParams, s as AdminOrderSummary, t as AdminPayment, u as AdminPaymentDetail, v as AdminProduct, w as AdminPromoCode, x as AdminPromoCodeInput, y as AdminRefundResult, z as AdminSale, B as AdminSaleInput, C as AdminSubscription, D as AdminSubscriptionDetail, E as AdminSubscriptionPatch, F as AdminSubscriptionWriteResult, G as AdminSupportCustomer, H as AdminSupportStats, I as AdminSupportThread, J as AdminWebhookEvent, K as Affiliate, L as AffiliateAuthTokens, M as AffiliateClickRecord, N as AffiliateConversion, O as AffiliateDashboardLinks, P as AffiliateDashboardProfile, Q as AffiliateDashboardStats, R as AffiliateDownlineMember, S as AffiliateEarningsBreakdown, T as AffiliatePaymentMethod, U as AffiliateProgram, V as AffiliateRegisterInput, W as AffiliateRegisterResponse, X as AffiliateSession, Y as AffiliateStatsResponse, Z as AffiliateStatus, _ as AffiliateTrackResponse, $ as ApiError, a0 as ApiResponse, a1 as AttributionMethod, a2 as AuthTokens, a3 as BillingReminderSettings, a4 as CatalogProduct, a5 as CheckoutAddress, a6 as CheckoutPayload, a7 as CheckoutResult, a8 as CommissionConfig, a9 as CommissionStatus, aa as CompleteSurveyPayload, ab as CreateAffiliatePayload, ac as CreateAffiliateProgramPayload, ad as CreateOrderPayload, ae as CreateRequestPayload, af as CreateSubscriptionPayload, ag as CustomTemplate, ah as CustomTemplateInput, ai as CustomerDiscountConfig, aj as DeliveryInfo, ak as DiscountType, al as EmailNotificationSettings, am as EmailTemplatesMap, an as LoginPayload, ao as MemberPrescriptionRequest, ap as MemberSurveyMode, aq as MemberSurveyResponseSummary, ar as MemberSurveyTranscript, as as MemberSurveyTranscriptItem, at as MemberSurveyTranscriptSection, au as MembersMeResponse, av as Order, aw as OrderItemInput, ax as PaginationParams, ay as PaymentCallbackPayload, az as PaymentInitiatePayload, aA as PaymentType, aB as PendingRenewalSurvey, aC as Placeholder, aD as ProductSaleSummary, aE as PromoValidationResponse, aF as PublicCategory, aG as RegisterAndSubscribePayload, aH as RegisterPayload, aI as RenewalStatus, aJ as SUPPORT_ATTACHMENT_MAX_BYTES, aK as SUPPORT_ATTACHMENT_MIME_TYPES, aL as SelectDrugPayload, aM as SendMessagePayload, aN as SendToPharmacyPayload, aO as SupportAttachment, aP as SupportMessage, aQ as SupportRealtimeToken, aR as SupportThread, aS as SupportThreadCategory, aT as SupportThreadStatus, aU as SurveySubmitPayload, aV as TemplatePlaceholdersMap, aW as TemplateText, aX as TokenTrackName, aY as UpdateAffiliatePayload, aZ as UpdateAffiliateProgramPayload, a_ as UpdatePaymentMethodPayload, a$ as UpdateProfilePayload, b0 as User, b1 as addressesApi, b2 as adminAffiliatesApi, b3 as adminApi, b4 as affiliateAuthStorageKey, b5 as affiliatePortalApi, b6 as apexApi, b7 as apiFetch, b8 as authApi, b9 as authStorageKey, ba as clearAffiliateTokens, bb as clearTokens, bc as getAffiliateTokens, bd as getTokens, be as membersApi, bf as messagesApi, bg as newIdempotencyKey, bh as onTokensCleared, bi as ordersApi, bj as paymentsApi, bk as productsApi, bl as promoCodesApi, bm as setAffiliateTokens, bn as setTokens, bo as subscriptionsApi, bp as supportApi, bq as usersApi } from '../client-B6Kt7LWo.js';
2
2
  export { EmbedApiError as ApexV2ApiError, EmbedApiClient, EmbedApiClientOptions, EmbedApiError, EmbedEvent, EmbedEventType, FetchLike, PatientInfo, V2Answer, V2ComposedSurvey, V2DrugResult, V2QualificationResult, V2Question, V2QuestionOption, V2Section, V2Step, V2SubmitResult, V2VisibilityCondition, createEmbedApiClient, disqualificationReasonText, disqualifiedDrugIds, qualifiedDrugIds } from '@apextelemed/survey-core';
3
3
  export { C as CartCaptureConfig, a as CartSnapshotLine, F as FunnelConfig, b as FunnelDraftPayload, R as ResumedCart, c as ResumedCartLine, d as ResumedDraft, e as adoptCartId, f as adoptFunnelSessionId, g as captureAuthHeader, h as cartId, i as fetchCartConfig, j as fetchFunnelConfig, k as fetchResumedCart, l as fetchResumedDraft, m as funnelSessionId, p as peekFunnelSessionId, n as postCartSnapshot, o as postFunnelEvent, r as readCartToken, q as readResumeToken, s as resetCartConfigCache, t as resetCartId, u as resetFunnelConfigCache, v as saveFunnelDraft, w as stripCartToken, x as stripResumeToken } from '../cart-BwUwSzWh.js';
4
4
 
package/dist/api/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import '../chunk/JSHO46VZ.js';
2
- export { adoptCartId, capturePromoCode, cartId, clearPromoCode, fetchCartConfig, fetchResumedCart, postCartSnapshot, readCartToken, readPromoCode, resetCartConfigCache, resetCartId, stripCartToken } from '../chunk/XHOD3HUQ.js';
2
+ export { adoptCartId, capturePromoCode, cartId, clearPromoCode, fetchCartConfig, fetchResumedCart, postCartSnapshot, readCartToken, readPromoCode, resetCartConfigCache, resetCartId, stripCartToken } from '../chunk/BVLA7ATM.js';
3
3
  export { EmbedApiError2 as ApexV2ApiError, EmbedApiError, createEmbedApiClient, disqualificationReasonText, disqualifiedDrugIds, qualifiedDrugIds } from '../chunk/LZWA44KD.js';
4
- export { adoptFunnelSessionId, captureAuthHeader, fetchFunnelConfig, fetchResumedDraft, funnelSessionId, peekFunnelSessionId, postFunnelEvent, readResumeToken, resetFunnelConfigCache, saveFunnelDraft, stripResumeToken } from '../chunk/7ZESUC4Q.js';
5
- export { ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, affiliateAuthStorageKey, affiliatePortalApi, apexApi, apiFetch, authApi, authStorageKey, captureAffiliateRef, clearAffiliateRef, clearAffiliateTokens, clearTokens, getAffiliateTokens, getTokens, membersApi, messagesApi, newIdempotencyKey, onTokensCleared, ordersApi, paymentsApi, productsApi, promoCodesApi, readAffiliateRef, setAffiliateTokens, setTokens, subscriptionsApi, supportApi, usersApi } from '../chunk/5D7SGF46.js';
4
+ export { adoptFunnelSessionId, captureAuthHeader, fetchFunnelConfig, fetchResumedDraft, funnelSessionId, peekFunnelSessionId, postFunnelEvent, readResumeToken, resetFunnelConfigCache, saveFunnelDraft, stripResumeToken } from '../chunk/QTGJY3YQ.js';
5
+ export { ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, affiliateAuthStorageKey, affiliatePortalApi, apexApi, apiFetch, authApi, authStorageKey, captureAffiliateRef, clearAffiliateRef, clearAffiliateTokens, clearTokens, getAffiliateTokens, getTokens, membersApi, messagesApi, newIdempotencyKey, onTokensCleared, ordersApi, paymentsApi, productsApi, promoCodesApi, readAffiliateRef, setAffiliateTokens, setTokens, subscriptionsApi, supportApi, usersApi } from '../chunk/BEDW4XUM.js';
6
6
  import '../chunk/5XGPFYIJ.js';
7
7
  //# sourceMappingURL=index.js.map
8
8
  //# sourceMappingURL=index.js.map
@@ -12,7 +12,7 @@ import {
12
12
  resetCartConfigCache,
13
13
  resetCartId,
14
14
  stripCartToken
15
- } from "../chunk/FUOUTRAO.jsx";
15
+ } from "../chunk/4ZSZHZQV.jsx";
16
16
  import {
17
17
  EmbedApiError,
18
18
  EmbedApiError2,
@@ -33,7 +33,7 @@ import {
33
33
  resetFunnelConfigCache,
34
34
  saveFunnelDraft,
35
35
  stripResumeToken
36
- } from "../chunk/2UWULNSX.jsx";
36
+ } from "../chunk/NBB2VTQK.jsx";
37
37
  import {
38
38
  ApiError,
39
39
  SUPPORT_ATTACHMENT_MAX_BYTES,
@@ -67,7 +67,7 @@ import {
67
67
  subscriptionsApi,
68
68
  supportApi,
69
69
  usersApi
70
- } from "../chunk/DQE4K55D.jsx";
70
+ } from "../chunk/EVCGDF5D.jsx";
71
71
  import "../chunk/LDZIUFDM.jsx";
72
72
  export {
73
73
  EmbedApiError2 as ApexV2ApiError,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  captureAuthHeader,
3
3
  peekFunnelSessionId
4
- } from "./2UWULNSX.jsx";
4
+ } from "./NBB2VTQK.jsx";
5
5
  import {
6
6
  getConfig
7
7
  } from "./LDZIUFDM.jsx";
@@ -174,4 +174,4 @@ export {
174
174
  readCartToken,
175
175
  stripCartToken
176
176
  };
177
- //# sourceMappingURL=FUOUTRAO.jsx.map
177
+ //# sourceMappingURL=4ZSZHZQV.jsx.map
@@ -8,7 +8,7 @@ import {
8
8
  readPromoCode,
9
9
  resetCartId,
10
10
  stripCartToken
11
- } from "./FUOUTRAO.jsx";
11
+ } from "./4ZSZHZQV.jsx";
12
12
  import {
13
13
  firstAddressError,
14
14
  formatCardNumber,
@@ -18,12 +18,12 @@ import {
18
18
  useAddressPair,
19
19
  useCardTokenizer,
20
20
  validateAddress
21
- } from "./JTG4H4I5.jsx";
21
+ } from "./HXMLRDIJ.jsx";
22
22
  import {
23
23
  auth_default,
24
24
  cart_default,
25
25
  medication_default
26
- } from "./GNG53L37.jsx";
26
+ } from "./WLEIDQ5M.jsx";
27
27
  import {
28
28
  ApiError,
29
29
  newIdempotencyKey,
@@ -31,7 +31,7 @@ import {
31
31
  promoCodesApi,
32
32
  subscriptionsApi,
33
33
  usersApi
34
- } from "./DQE4K55D.jsx";
34
+ } from "./EVCGDF5D.jsx";
35
35
  import {
36
36
  getConfig
37
37
  } from "./LDZIUFDM.jsx";
@@ -300,8 +300,10 @@ function useSubscriptionIntakeFlow(options) {
300
300
  productIds: [options.pricing.productId],
301
301
  subtotalCents: savingsBaseCents()
302
302
  });
303
- if (res.valid) setPromoCode(stashed);
304
- else clearPromoCode();
303
+ if (res.valid) {
304
+ setPromoCode(stashed);
305
+ setPromoApplied(res);
306
+ } else clearPromoCode();
305
307
  } catch {
306
308
  }
307
309
  });
@@ -513,6 +515,7 @@ function useSubscriptionIntakeFlow(options) {
513
515
  throw new Error(res.error || "Subscription failed. Please try again.");
514
516
  }
515
517
  } else {
518
+ const savingsMemberId = options.savingsMemberId?.() || void 0;
516
519
  await auth_default.signupAndSubscribe({
517
520
  email: email().trim(),
518
521
  password: password(),
@@ -540,7 +543,8 @@ function useSubscriptionIntakeFlow(options) {
540
543
  surveyResponseId: options.surveyResult.surveyResponseId,
541
544
  v2SurveyResponseId: options.surveyResult.v2SurveyResponseId,
542
545
  caseNotes: options.surveyResult.caseNotes,
543
- promoCode: promo?.valid ? promo.promoCode?.code : void 0
546
+ promoCode: promo?.valid ? promo.promoCode?.code : void 0,
547
+ ...savingsMemberId ? { savingsMemberId } : {}
544
548
  }, { idempotencyKey });
545
549
  }
546
550
  clearDraft();
@@ -770,4 +774,4 @@ export {
770
774
  restoreCartFromLink,
771
775
  startCartCapture
772
776
  };
773
- //# sourceMappingURL=ZJENZPAM.jsx.map
777
+ //# sourceMappingURL=5HNZ7SEM.jsx.map
@@ -622,6 +622,20 @@ var messagesApi = {
622
622
  listMessages(conversationId, params) {
623
623
  return apiFetch(`/messages/conversations/${conversationId}/messages${qs(params)}`);
624
624
  },
625
+ /**
626
+ * Start (or reuse) the member's care-team conversation with an opening
627
+ * message (1..5000 chars). Answers `{ conversation, message, created }`.
628
+ * 409 `{ error: 'no_care_team' }` means the member has never had a
629
+ * prescriber assigned — there is nothing to route the message to. Loosely
630
+ * typed like the rest of this object: the raw conversation/message shapes
631
+ * are reconciled onto `Conversation`/`ThreadMessage` in flows/messages.ts,
632
+ * which already owns that normalization for every other clinical response.
633
+ */
634
+ start(payload, opts) {
635
+ return post("/messages/conversations/start", payload, {
636
+ idempotencyKey: opts?.idempotencyKey
637
+ });
638
+ },
625
639
  sendMessage(conversationId, payload, opts) {
626
640
  return post(`/messages/conversations/${conversationId}/messages`, payload, {
627
641
  idempotencyKey: opts?.idempotencyKey
@@ -890,9 +904,20 @@ var adminApi = {
890
904
  return apiFetch(`/admin/webhook-events${qs(params)}`);
891
905
  },
892
906
  getEmailTemplates() {
893
- return apiFetch(
894
- "/admin/settings/email-templates"
895
- );
907
+ return apiFetch("/admin/settings/email-templates");
908
+ },
909
+ createCustomTemplate(input) {
910
+ return post("/admin/settings/email-templates/custom", input);
911
+ },
912
+ updateCustomTemplate(id, input) {
913
+ return put(`/admin/settings/email-templates/custom/${id}`, input);
914
+ },
915
+ /** Rejects with the server's message (409) while a sequence still uses it. */
916
+ deleteCustomTemplate(id) {
917
+ return apiFetch(`/admin/settings/email-templates/custom/${id}`, { method: "DELETE" });
918
+ },
919
+ sendCustomTemplateTest(id) {
920
+ return post(`/admin/settings/email-templates/custom/${id}/test`);
896
921
  },
897
922
  saveEmailTemplates(templates) {
898
923
  return put("/admin/settings/email-templates", { templates });
@@ -903,6 +928,18 @@ var adminApi = {
903
928
  sendTestEmail(templateKey) {
904
929
  return post("/admin/settings/email-templates/test", { templateKey });
905
930
  },
931
+ getEmailNotifications() {
932
+ return apiFetch("/admin/settings/email-notifications");
933
+ },
934
+ saveEmailNotifications(settings) {
935
+ return put("/admin/settings/email-notifications", settings);
936
+ },
937
+ getBillingReminders() {
938
+ return apiFetch("/admin/settings/billing-reminders");
939
+ },
940
+ saveBillingReminders(settings) {
941
+ return put("/admin/settings/billing-reminders", settings);
942
+ },
906
943
  // ── Products ───────────────────────────────────────────────────
907
944
  getProducts(params) {
908
945
  return apiFetch(`/admin/products${qs(params)}`);
@@ -995,6 +1032,25 @@ var adminApi = {
995
1032
  setSupportThreadStatus(id, status) {
996
1033
  return patch(`/admin/support/threads/${id}`, { status });
997
1034
  },
1035
+ /** Inline re-file from the admin detail view. `null` clears the category. */
1036
+ updateSupportThreadCategory(id, category) {
1037
+ return patch(`/admin/support/threads/${id}`, { category });
1038
+ },
1039
+ /**
1040
+ * Forward this thread to the customer's care team: sends every customer
1041
+ * message as one note to their prescriber, then redacts those message
1042
+ * bodies (`[moved to care team]`, attachments removed) and marks the
1043
+ * thread `transferred`. Support's own messages are untouched.
1044
+ *
1045
+ * - `409 no_care_team` — customer has no Apex member / no prescriber yet.
1046
+ * - `502` — could not reach the care team; safe to retry.
1047
+ * - `alreadyTransferred: true` — thread was already forwarded; no-op.
1048
+ * - `redacted: false` — the transfer happened but the redaction cleanup
1049
+ * step threw; the thread is transferred but bodies may not be scrubbed.
1050
+ */
1051
+ transferSupportThread(id) {
1052
+ return post(`/admin/support/threads/${id}/transfer`);
1053
+ },
998
1054
  getSupportAttachmentUrl(attachmentId) {
999
1055
  return apiFetch(`/admin/support/attachments/${attachmentId}`);
1000
1056
  },
@@ -1234,5 +1290,5 @@ var affiliatePortalApi = {
1234
1290
  };
1235
1291
 
1236
1292
  export { ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, affiliateAuthStorageKey, affiliatePortalApi, apexApi, apiFetch, authApi, authStorageKey, captureAffiliateRef, clearAffiliateRef, clearAffiliateTokens, clearTokens, getAffiliateTokens, getTokens, membersApi, messagesApi, newIdempotencyKey, onTokensCleared, ordersApi, paymentsApi, productsApi, promoCodesApi, readAffiliateRef, setAffiliateTokens, setTokens, subscriptionsApi, supportApi, usersApi };
1237
- //# sourceMappingURL=5D7SGF46.js.map
1238
- //# sourceMappingURL=5D7SGF46.js.map
1293
+ //# sourceMappingURL=BEDW4XUM.js.map
1294
+ //# sourceMappingURL=BEDW4XUM.js.map