@apextelemed/partner-core 0.17.0-dev.49 → 0.17.0-dev.51

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 (41) hide show
  1. package/dist/api/index.d.ts +1 -1
  2. package/dist/api/index.js +3 -3
  3. package/dist/api/index.jsx +5 -3
  4. package/dist/chunk/{IXT445LX.jsx → 3SPMZ7FK.jsx} +2 -2
  5. package/dist/chunk/{XEWZ4OIT.jsx → 545PPOE5.jsx} +2 -2
  6. package/dist/chunk/{EBREONQA.js → ANKLNWGB.js} +6 -6
  7. package/dist/chunk/{EBREONQA.js.map → ANKLNWGB.js.map} +1 -1
  8. package/dist/chunk/{ATSYHZSR.js → AXXQJC6M.js} +3 -3
  9. package/dist/chunk/{ATSYHZSR.js.map → AXXQJC6M.js.map} +1 -1
  10. package/dist/chunk/{4YJF3J74.jsx → HM5L6J62.jsx} +2 -2
  11. package/dist/chunk/{U426ASG4.js → ICGZXU3R.js} +26 -4
  12. package/dist/chunk/ICGZXU3R.js.map +1 -0
  13. package/dist/chunk/{XER7JXKW.js → L4DFQMYM.js} +2211 -1487
  14. package/dist/chunk/L4DFQMYM.js.map +1 -0
  15. package/dist/chunk/{3VSVNZH3.js → LFSDVMIY.js} +414 -6
  16. package/dist/chunk/LFSDVMIY.js.map +1 -0
  17. package/dist/chunk/{MBHIL2QL.jsx → OZZGMI6C.jsx} +2052 -1632
  18. package/dist/chunk/{FFZOIYPO.jsx → P4NWFY4T.jsx} +5 -5
  19. package/dist/chunk/{MH43RC7G.jsx → PHSZOZVK.jsx} +25 -2
  20. package/dist/chunk/{B5722F4T.js → TFA64PLK.js} +3 -3
  21. package/dist/chunk/{B5722F4T.js.map → TFA64PLK.js.map} +1 -1
  22. package/dist/chunk/{HHCDX47F.jsx → VE5ACNFB.jsx} +429 -5
  23. package/dist/chunk/{GYEK4TSP.js → Z6PDUPOU.js} +3 -3
  24. package/dist/chunk/{GYEK4TSP.js.map → Z6PDUPOU.js.map} +1 -1
  25. package/dist/{client-DoCsuJj3.d.ts → client-Baf1FSEp.d.ts} +128 -2
  26. package/dist/flows/index.d.ts +204 -2
  27. package/dist/flows/index.js +6 -6
  28. package/dist/flows/index.jsx +30 -8
  29. package/dist/index/index.d.ts +2 -2
  30. package/dist/index/index.js +7 -7
  31. package/dist/index/index.jsx +33 -9
  32. package/dist/pages/index.d.ts +1 -1
  33. package/dist/pages/index.js +5 -5
  34. package/dist/pages/index.jsx +5 -5
  35. package/dist/stores/index.d.ts +1 -1
  36. package/dist/stores/index.js +2 -2
  37. package/dist/stores/index.jsx +2 -2
  38. package/package.json +1 -1
  39. package/dist/chunk/3VSVNZH3.js.map +0 -1
  40. package/dist/chunk/U426ASG4.js.map +0 -1
  41. package/dist/chunk/XER7JXKW.js.map +0 -1
@@ -8,7 +8,7 @@ import {
8
8
  readPromoCode,
9
9
  resetCartId,
10
10
  stripCartToken
11
- } from "./IXT445LX.jsx";
11
+ } from "./3SPMZ7FK.jsx";
12
12
  import {
13
13
  bestOfferDiscount,
14
14
  catalogUnavailableMessage,
@@ -22,11 +22,11 @@ import {
22
22
  useCardTokenizer,
23
23
  useCatalogAvailability,
24
24
  validateAddress
25
- } from "./HHCDX47F.jsx";
25
+ } from "./VE5ACNFB.jsx";
26
26
  import {
27
27
  auth_default,
28
28
  cart_default
29
- } from "./XEWZ4OIT.jsx";
29
+ } from "./545PPOE5.jsx";
30
30
  import {
31
31
  ApiError,
32
32
  newIdempotencyKey,
@@ -34,7 +34,7 @@ import {
34
34
  promoCodesApi,
35
35
  subscriptionsApi,
36
36
  usersApi
37
- } from "./MH43RC7G.jsx";
37
+ } from "./PHSZOZVK.jsx";
38
38
  import {
39
39
  getConfig
40
40
  } from "./QVZ7BRNO.jsx";
@@ -648,4 +648,4 @@ export {
648
648
  restoreCartFromLink,
649
649
  startCartCapture
650
650
  };
651
- //# sourceMappingURL=FFZOIYPO.jsx.map
651
+ //# sourceMappingURL=P4NWFY4T.jsx.map
@@ -289,12 +289,16 @@ var ApiError = class extends Error {
289
289
  /** Machine-readable error code from the response body, when the endpoint
290
290
  * sends one (e.g. `SUBSCRIPTION_EXISTS`). Branch on this, never on message. */
291
291
  code;
292
+ /** The response body's `details`, untouched, for the few refusals whose
293
+ * specifics a caller acts on (e.g. which prices are missing). Never shown as prose. */
294
+ details;
292
295
  constructor(message, opts = {}) {
293
296
  super(message);
294
297
  this.name = "ApiError";
295
298
  this.status = opts.status;
296
299
  this.ambiguous = opts.ambiguous ?? false;
297
300
  this.code = opts.code;
301
+ this.details = opts.details;
298
302
  if (opts.cause !== void 0) this.cause = opts.cause;
299
303
  }
300
304
  };
@@ -371,10 +375,12 @@ async function coreFetch(endpoint, fetchOpts, track, call = {}) {
371
375
  if (!res.ok) {
372
376
  let errorMsg = `Request failed: ${res.status}`;
373
377
  let errorCode;
378
+ let errorDetails;
374
379
  try {
375
380
  const body = await res.json();
376
381
  errorMsg = body.error || body.message || errorMsg;
377
382
  errorCode = typeof body.code === "string" ? body.code : void 0;
383
+ errorDetails = body.details;
378
384
  if (track.enrichErrorDetails && Array.isArray(body.details) && body.details.length > 0) {
379
385
  const lines = body.details.map(
380
386
  (d) => typeof d === "string" ? d : d?.message
@@ -386,7 +392,12 @@ async function coreFetch(endpoint, fetchOpts, track, call = {}) {
386
392
  if (res.status === 403 && /recaptcha/i.test(errorMsg)) {
387
393
  errorMsg = "We couldn\u2019t verify you\u2019re human. Please refresh the page and try again.";
388
394
  }
389
- throw new ApiError(errorMsg, { status: res.status, ambiguous: res.status >= 500, code: errorCode });
395
+ throw new ApiError(errorMsg, {
396
+ status: res.status,
397
+ ambiguous: res.status >= 500,
398
+ code: errorCode,
399
+ ...errorDetails !== void 0 ? { details: errorDetails } : {}
400
+ });
390
401
  }
391
402
  if (res.status === 204) return void 0;
392
403
  return await res.json();
@@ -946,6 +957,17 @@ var adminCatalogConversionApi = {
946
957
  return post(`${conversionPath(productId)}/undo`, options);
947
958
  }
948
959
  };
960
+ var productPharmaciesPath = (productId) => `/admin/products/${encodeURIComponent(productId)}/pharmacies`;
961
+ var adminProductPharmaciesApi = {
962
+ /** What adding this pharmacy drug would do. Read-only for the admin; safe to repeat. */
963
+ plan(productId, drugId, doseMatches) {
964
+ return post(`${productPharmaciesPath(productId)}/plan`, doseMatches ? { drugId, doseMatches } : { drugId });
965
+ },
966
+ /** Adds it. Up to ~40 seconds on a single-pharmacy product; never retry blindly — re-read the product first. */
967
+ add(productId, body) {
968
+ return post(productPharmaciesPath(productId), body);
969
+ }
970
+ };
949
971
  var adminApi = {
950
972
  getDashboard() {
951
973
  return apiFetch("/admin/dashboard/stats");
@@ -1534,6 +1556,7 @@ export {
1534
1556
  membersApi,
1535
1557
  adminCatalogApi,
1536
1558
  adminCatalogConversionApi,
1559
+ adminProductPharmaciesApi,
1537
1560
  adminApi,
1538
1561
  adminAffiliatesApi,
1539
1562
  affiliateAuthStorageKey,
@@ -1542,4 +1565,4 @@ export {
1542
1565
  clearAffiliateTokens,
1543
1566
  affiliatePortalApi
1544
1567
  };
1545
- //# sourceMappingURL=MH43RC7G.jsx.map
1568
+ //# sourceMappingURL=PHSZOZVK.jsx.map
@@ -1,4 +1,4 @@
1
- import { peekFunnelSessionId, captureAuthHeader } from './GYEK4TSP.js';
1
+ import { peekFunnelSessionId, captureAuthHeader } from './Z6PDUPOU.js';
2
2
  import { getConfig } from './2IFPDU4D.js';
3
3
 
4
4
  // src/api/promoRef.ts
@@ -156,5 +156,5 @@ function stripCartToken() {
156
156
  }
157
157
 
158
158
  export { adoptCartId, capturePromoCode, cartId, clearPromoCode, fetchCartConfig, fetchResumedCart, postCartSnapshot, readCartToken, readPromoCode, resetCartConfigCache, resetCartId, stripCartToken };
159
- //# sourceMappingURL=B5722F4T.js.map
160
- //# sourceMappingURL=B5722F4T.js.map
159
+ //# sourceMappingURL=TFA64PLK.js.map
160
+ //# sourceMappingURL=TFA64PLK.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/api/promoRef.ts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Ae,OAAO,IAAA,CAAK,aAAA,KAAkB,QAAA,GAAW,KAAK,aAAA,GAAgB;AAAA,KAC/E;AAAA,EACF,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAGO,SAAS,aAAA,GAA+B;AAC7C,EAAA,IAAI;AACF,IAAA,MAAM,KAAA,GAAQ,IAAI,eAAA,CAAgB,MAAA,CAAO,SAAS,MAAM,CAAA,CAAE,IAAI,MAAM,CAAA;AACpE,IAAA,OAAO,KAAA,IAAS,KAAA,CAAM,MAAA,GAAS,CAAA,GAAI,KAAA,GAAQ,IAAA;AAAA,EAC7C,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAOO,SAAS,cAAA,GAAuB;AACrC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAI,MAAA,CAAO,SAAS,IAAI,CAAA;AACxC,IAAA,IAAI,CAAC,GAAA,CAAI,YAAA,CAAa,GAAA,CAAI,MAAM,CAAA,EAAG;AACnC,IAAA,GAAA,CAAI,YAAA,CAAa,OAAO,MAAM,CAAA;AAC9B,IAAA,MAAA,CAAO,QAAQ,YAAA,CAAa,IAAI,EAAA,EAAI,GAAA,CAAI,UAAU,CAAA;AAAA,EACpD,CAAA,CAAA,MAAQ;AAAA,EAER;AACF","file":"B5722F4T.js","sourcesContent":["// ── First-party promo-code capture from a `?promo=` landing ──────────\n//\n// A campaign link can carry its own code (`/?promo=TRUE10`) so the member does\n// not have to type it. Stashed in the storefront's own localStorage and read\n// back when the intake reaches the promo field.\n//\n// Mirrors `affiliateRef` deliberately — same storage shape, same 30-day window —\n// but is a SEPARATE concern: an affiliate ref attributes a sale to a partner and\n// is validated server-side at checkout, while this only pre-fills an input the\n// member still has to submit.\n\nimport { getConfig } from '../config';\n\n// Matches the affiliate-ref window. A stash that outlives the promo it carries\n// is not a correctness problem — the code is re-validated before it is used,\n// and silently dropped if it has expired — but there is no reason to keep one\n// around longer than a campaign plausibly runs.\nconst TTL_MS = 30 * 24 * 60 * 60 * 1000;\n\nconst storageKey = () => `${getConfig().storagePrefix}-promo-code`;\n\ninterface StoredPromo {\n code: string;\n ts: number;\n}\n\n/** Persist a promo code from a `?promo=` landing. No-op for empty input. */\nexport function capturePromoCode(code: string): void {\n if (typeof localStorage === 'undefined') return;\n const trimmed = code.trim();\n if (!trimmed) return;\n try {\n const entry: StoredPromo = { code: trimmed, ts: Date.now() };\n localStorage.setItem(storageKey(), JSON.stringify(entry));\n } catch {\n // storage unavailable (private mode / quota) — non-fatal\n }\n}\n\n/**\n * Read the stored promo code, or null if absent or past the storage window.\n *\n * Being within the window says nothing about whether the CODE is still valid —\n * a campaign can end while the stash is fresh. The caller re-validates against\n * the server before showing it to anyone.\n */\nexport function readPromoCode(): string | null {\n if (typeof localStorage === 'undefined') return null;\n try {\n const raw = localStorage.getItem(storageKey());\n if (!raw) return null;\n const parsed = JSON.parse(raw) as Partial<StoredPromo>;\n if (!parsed.code || typeof parsed.ts !== 'number') return null;\n if (Date.now() - parsed.ts > TTL_MS) {\n localStorage.removeItem(storageKey());\n return null;\n }\n return parsed.code;\n } catch {\n return null;\n }\n}\n\n/** Drop the stored promo code. */\nexport function clearPromoCode(): void {\n if (typeof localStorage === 'undefined') return;\n try {\n localStorage.removeItem(storageKey());\n } catch {\n // non-fatal\n }\n}\n","import { getConfig } from '../config';\nimport { captureAuthHeader, peekFunnelSessionId } from './funnel';\n\n// ── Abandoned-cart transport ────────────────────────────────────────────────\n//\n// Thin client for the-backend's cart-capture endpoints:\n// GET /config/cart → whether this tenant mirrors carts at all\n// POST /cart/snapshot → server-side mirror of the browser's cart\n// GET /cart/resume → trade an emailed token for the saved cart\n//\n// Sibling of ./funnel, and the same posture: fire-and-forget, fail-silent.\n// Cart capture is marketing instrumentation and must never break, block or\n// slow down shopping.\n\nexport interface CartCaptureConfig {\n /** Tenant opted in (features.cartRecovery); false = never send anything. */\n snapshot: boolean;\n}\n\nconst DISABLED: CartCaptureConfig = { snapshot: false };\n\nlet configPromise: Promise<CartCaptureConfig> | null = null;\n\n/**\n * The tenant's cart-capture posture, fetched once per page load and cached.\n * Fails closed: any error reads as \"off\".\n */\nexport function fetchCartConfig(): Promise<CartCaptureConfig> {\n if (!configPromise) {\n configPromise = (async () => {\n try {\n const cfg = getConfig();\n const res = await fetch(`${cfg.apiBase}/config/cart`, {\n headers: { 'X-Tenant-Key': cfg.tenantKey },\n });\n if (!res.ok) return DISABLED;\n const body = (await res.json()) as Partial<CartCaptureConfig>;\n return { snapshot: body.snapshot === true };\n } catch {\n return DISABLED;\n }\n })();\n }\n return configPromise;\n}\n\n/** Test seam: forget the cached config so the next fetch re-resolves. */\nexport function resetCartConfigCache(): void {\n configPromise = null;\n}\n\nconst cartIdKey = () => `${getConfig().storagePrefix}-cart-id`;\n\n/**\n * Stable id for this shopper's cart, minted on first use and kept in\n * localStorage — NOT sessionStorage like the survey session.\n *\n * A cart outlives the tab it was filled in: someone adds items, closes the\n * browser, comes back tomorrow and finds the cart still there (the cart store\n * itself persists the same way). The id has to survive with it, or every visit\n * would look like a brand-new abandoned cart and one shopper would accumulate\n * a row — and a reminder track — per session.\n */\nexport function cartId(): string {\n let id: string | null = null;\n try {\n id = localStorage.getItem(cartIdKey());\n } catch {\n /* storage unavailable (private mode) — fall through to an ephemeral id */\n }\n if (!id) {\n id =\n typeof crypto !== 'undefined' && 'randomUUID' in crypto\n ? crypto.randomUUID()\n : `${Date.now()}-${Math.random().toString(36).slice(2)}`;\n try {\n localStorage.setItem(cartIdKey(), id);\n } catch {\n /* ephemeral it is */\n }\n }\n return id;\n}\n\n/**\n * Continue the cart a recovery email points at, instead of the one this browser\n * happens to hold. Adopting the emailed id keeps the reminder history, the\n * email address and the eventual conversion on ONE row.\n */\nexport function adoptCartId(id: string): void {\n if (!id) return;\n try {\n localStorage.setItem(cartIdKey(), id);\n } catch {\n /* storage unavailable — the adoption is ephemeral */\n }\n}\n\n/**\n * Start a fresh cart id. Called after a purchase: the old id is stamped\n * converted server-side and must never be written to again, or a new cart\n * would inherit a bought cart's row (and its silence — converted rows are\n * never nudged).\n */\nexport function resetCartId(): void {\n try {\n localStorage.removeItem(cartIdKey());\n } catch {\n /* nothing to clear */\n }\n}\n\nexport interface CartSnapshotLine {\n productId: string;\n dosage?: string;\n quantity: number;\n}\n\n/**\n * Mirror the cart server-side. Identity only — the backend re-prices from the\n * catalog and ignores anything else we send, so there is no point shipping\n * names or prices.\n *\n * `keepalive` lets the request survive the page unload that so often IS the\n * abandonment.\n *\n * The bearer token, when there is one, is how a signed-in shopper's cart gets\n * their user id: the endpoint takes identity from the token and never from the\n * body (`optionalAuth`), so omitting it left every logged-in cart anonymous —\n * joinable only by whatever email happened to be attached.\n */\nexport function postCartSnapshot(params: {\n items: CartSnapshotLine[];\n promoCode?: string | null;\n email?: string | null;\n}): void {\n try {\n const cfg = getConfig();\n void fetch(`${cfg.apiBase}/cart/snapshot`, {\n method: 'POST',\n keepalive: true,\n headers: {\n 'Content-Type': 'application/json',\n 'X-Tenant-Key': cfg.tenantKey,\n ...captureAuthHeader(),\n },\n body: JSON.stringify({\n cartId: cartId(),\n items: params.items,\n promoCode: params.promoCode ?? null,\n ...(params.email ? { email: params.email } : {}),\n // Only when a survey session already exists: it lets the backend reuse\n // the address the pre-survey email gate collected, which is often the\n // only handle we have on an anonymous shopper.\n ...(peekFunnelSessionId() ? { sessionId: peekFunnelSessionId() } : {}),\n }),\n }).catch(() => {});\n } catch {\n /* not configured yet — drop */\n }\n}\n\n/** A resumed cart line, already re-priced against today's catalog. */\nexport interface ResumedCartLine {\n productId: string;\n dosage?: string;\n quantity: number;\n name: string;\n priceCents: number;\n salePriceCents: number | null;\n thumbnailUrl: string | null;\n isSubscription: boolean;\n apexDrugId: string | null;\n categories: string[];\n hideDoseLabel: boolean;\n}\n\nexport interface ResumedCart {\n cartId: string;\n items: ResumedCartLine[];\n /** Lines whose product has since been discontinued or deactivated. */\n unavailable: Array<{ productId: string; dosage?: string; quantity: number }>;\n promoCode: string | null;\n subtotalCents: number;\n}\n\n/**\n * Exchange an emailed recovery token for the saved cart.\n *\n * The token is the ONLY thing authorizing this read — the-backend verifies its\n * HMAC before returning anything. A 404 (expired, already bought, tampered, or\n * every product gone) resolves to null so the caller simply keeps whatever cart\n * this browser already had.\n */\nexport async function fetchResumedCart(token: string): Promise<ResumedCart | null> {\n try {\n const cfg = getConfig();\n const res = await fetch(`${cfg.apiBase}/cart/resume?token=${encodeURIComponent(token)}`, {\n headers: { 'X-Tenant-Key': cfg.tenantKey },\n });\n if (!res.ok) return null;\n const body = (await res.json()) as Partial<ResumedCart>;\n if (!body.cartId || !Array.isArray(body.items) || body.items.length === 0) return null;\n return {\n cartId: body.cartId,\n items: body.items,\n unavailable: Array.isArray(body.unavailable) ? body.unavailable : [],\n promoCode: body.promoCode ?? null,\n subtotalCents: typeof body.subtotalCents === 'number' ? body.subtotalCents : 0,\n };\n } catch {\n return null;\n }\n}\n\n/** Read the `?cart=` token from the current URL. */\nexport function readCartToken(): string | null {\n try {\n const token = new URLSearchParams(window.location.search).get('cart');\n return token && token.length > 0 ? token : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Drop `?cart=` from the address bar once it's been redeemed, so a refresh (or\n * a shared URL) doesn't re-run the restore over a cart the shopper has since\n * edited. History is replaced, not pushed — the token was never a page.\n */\nexport function stripCartToken(): void {\n try {\n const url = new URL(window.location.href);\n if (!url.searchParams.has('cart')) return;\n url.searchParams.delete('cart');\n window.history.replaceState({}, '', url.toString());\n } catch {\n /* no history API — leaving the param is harmless */\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/api/promoRef.ts","../../src/api/cart.ts"],"names":[],"mappings":";;;;AAiBA,IAAM,MAAA,GAAS,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK,GAAA;AAEnC,IAAM,UAAA,GAAa,MAAM,CAAA,EAAG,SAAA,GAAY,aAAa,CAAA,WAAA,CAAA;AAQ9C,SAA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AAM,KAAA,GAAQ,IAAI,eAAA,CAAgB,MAAA,CAAO,SAAS,MAAM,CAAA,CAAE,IAAI,MAAM,CAAA;AACpE,IAAA,OAAO,KAAA,IAAS,KAAA,CAAM,MAAA,GAAS,CAAA,GAAI,KAAA,GAAQ,IAAA;AAAA,EAC7C,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAOO,SAAS,cAAA,GAAuB;AACrC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAI,MAAA,CAAO,SAAS,IAAI,CAAA;AACxC,IAAA,IAAI,CAAC,GAAA,CAAI,YAAA,CAAa,GAAA,CAAI,MAAM,CAAA,EAAG;AACnC,IAAA,GAAA,CAAI,YAAA,CAAa,OAAO,MAAM,CAAA;AAC9B,IAAA,MAAA,CAAO,QAAQ,YAAA,CAAa,IAAI,EAAA,EAAI,GAAA,CAAI,UAAU,CAAA;AAAA,EACpD,CAAA,CAAA,MAAQ;AAAA,EAER;AACF","file":"TFA64PLK.js","sourcesContent":["// ── First-party promo-code capture from a `?promo=` landing ──────────\n//\n// A campaign link can carry its own code (`/?promo=TRUE10`) so the member does\n// not have to type it. Stashed in the storefront's own localStorage and read\n// back when the intake reaches the promo field.\n//\n// Mirrors `affiliateRef` deliberately — same storage shape, same 30-day window —\n// but is a SEPARATE concern: an affiliate ref attributes a sale to a partner and\n// is validated server-side at checkout, while this only pre-fills an input the\n// member still has to submit.\n\nimport { getConfig } from '../config';\n\n// Matches the affiliate-ref window. A stash that outlives the promo it carries\n// is not a correctness problem — the code is re-validated before it is used,\n// and silently dropped if it has expired — but there is no reason to keep one\n// around longer than a campaign plausibly runs.\nconst TTL_MS = 30 * 24 * 60 * 60 * 1000;\n\nconst storageKey = () => `${getConfig().storagePrefix}-promo-code`;\n\ninterface StoredPromo {\n code: string;\n ts: number;\n}\n\n/** Persist a promo code from a `?promo=` landing. No-op for empty input. */\nexport function capturePromoCode(code: string): void {\n if (typeof localStorage === 'undefined') return;\n const trimmed = code.trim();\n if (!trimmed) return;\n try {\n const entry: StoredPromo = { code: trimmed, ts: Date.now() };\n localStorage.setItem(storageKey(), JSON.stringify(entry));\n } catch {\n // storage unavailable (private mode / quota) — non-fatal\n }\n}\n\n/**\n * Read the stored promo code, or null if absent or past the storage window.\n *\n * Being within the window says nothing about whether the CODE is still valid —\n * a campaign can end while the stash is fresh. The caller re-validates against\n * the server before showing it to anyone.\n */\nexport function readPromoCode(): string | null {\n if (typeof localStorage === 'undefined') return null;\n try {\n const raw = localStorage.getItem(storageKey());\n if (!raw) return null;\n const parsed = JSON.parse(raw) as Partial<StoredPromo>;\n if (!parsed.code || typeof parsed.ts !== 'number') return null;\n if (Date.now() - parsed.ts > TTL_MS) {\n localStorage.removeItem(storageKey());\n return null;\n }\n return parsed.code;\n } catch {\n return null;\n }\n}\n\n/** Drop the stored promo code. */\nexport function clearPromoCode(): void {\n if (typeof localStorage === 'undefined') return;\n try {\n localStorage.removeItem(storageKey());\n } catch {\n // non-fatal\n }\n}\n","import { getConfig } from '../config';\nimport { captureAuthHeader, peekFunnelSessionId } from './funnel';\n\n// ── Abandoned-cart transport ────────────────────────────────────────────────\n//\n// Thin client for the-backend's cart-capture endpoints:\n// GET /config/cart → whether this tenant mirrors carts at all\n// POST /cart/snapshot → server-side mirror of the browser's cart\n// GET /cart/resume → trade an emailed token for the saved cart\n//\n// Sibling of ./funnel, and the same posture: fire-and-forget, fail-silent.\n// Cart capture is marketing instrumentation and must never break, block or\n// slow down shopping.\n\nexport interface CartCaptureConfig {\n /** Tenant opted in (features.cartRecovery); false = never send anything. */\n snapshot: boolean;\n}\n\nconst DISABLED: CartCaptureConfig = { snapshot: false };\n\nlet configPromise: Promise<CartCaptureConfig> | null = null;\n\n/**\n * The tenant's cart-capture posture, fetched once per page load and cached.\n * Fails closed: any error reads as \"off\".\n */\nexport function fetchCartConfig(): Promise<CartCaptureConfig> {\n if (!configPromise) {\n configPromise = (async () => {\n try {\n const cfg = getConfig();\n const res = await fetch(`${cfg.apiBase}/config/cart`, {\n headers: { 'X-Tenant-Key': cfg.tenantKey },\n });\n if (!res.ok) return DISABLED;\n const body = (await res.json()) as Partial<CartCaptureConfig>;\n return { snapshot: body.snapshot === true };\n } catch {\n return DISABLED;\n }\n })();\n }\n return configPromise;\n}\n\n/** Test seam: forget the cached config so the next fetch re-resolves. */\nexport function resetCartConfigCache(): void {\n configPromise = null;\n}\n\nconst cartIdKey = () => `${getConfig().storagePrefix}-cart-id`;\n\n/**\n * Stable id for this shopper's cart, minted on first use and kept in\n * localStorage — NOT sessionStorage like the survey session.\n *\n * A cart outlives the tab it was filled in: someone adds items, closes the\n * browser, comes back tomorrow and finds the cart still there (the cart store\n * itself persists the same way). The id has to survive with it, or every visit\n * would look like a brand-new abandoned cart and one shopper would accumulate\n * a row — and a reminder track — per session.\n */\nexport function cartId(): string {\n let id: string | null = null;\n try {\n id = localStorage.getItem(cartIdKey());\n } catch {\n /* storage unavailable (private mode) — fall through to an ephemeral id */\n }\n if (!id) {\n id =\n typeof crypto !== 'undefined' && 'randomUUID' in crypto\n ? crypto.randomUUID()\n : `${Date.now()}-${Math.random().toString(36).slice(2)}`;\n try {\n localStorage.setItem(cartIdKey(), id);\n } catch {\n /* ephemeral it is */\n }\n }\n return id;\n}\n\n/**\n * Continue the cart a recovery email points at, instead of the one this browser\n * happens to hold. Adopting the emailed id keeps the reminder history, the\n * email address and the eventual conversion on ONE row.\n */\nexport function adoptCartId(id: string): void {\n if (!id) return;\n try {\n localStorage.setItem(cartIdKey(), id);\n } catch {\n /* storage unavailable — the adoption is ephemeral */\n }\n}\n\n/**\n * Start a fresh cart id. Called after a purchase: the old id is stamped\n * converted server-side and must never be written to again, or a new cart\n * would inherit a bought cart's row (and its silence — converted rows are\n * never nudged).\n */\nexport function resetCartId(): void {\n try {\n localStorage.removeItem(cartIdKey());\n } catch {\n /* nothing to clear */\n }\n}\n\nexport interface CartSnapshotLine {\n productId: string;\n dosage?: string;\n quantity: number;\n}\n\n/**\n * Mirror the cart server-side. Identity only — the backend re-prices from the\n * catalog and ignores anything else we send, so there is no point shipping\n * names or prices.\n *\n * `keepalive` lets the request survive the page unload that so often IS the\n * abandonment.\n *\n * The bearer token, when there is one, is how a signed-in shopper's cart gets\n * their user id: the endpoint takes identity from the token and never from the\n * body (`optionalAuth`), so omitting it left every logged-in cart anonymous —\n * joinable only by whatever email happened to be attached.\n */\nexport function postCartSnapshot(params: {\n items: CartSnapshotLine[];\n promoCode?: string | null;\n email?: string | null;\n}): void {\n try {\n const cfg = getConfig();\n void fetch(`${cfg.apiBase}/cart/snapshot`, {\n method: 'POST',\n keepalive: true,\n headers: {\n 'Content-Type': 'application/json',\n 'X-Tenant-Key': cfg.tenantKey,\n ...captureAuthHeader(),\n },\n body: JSON.stringify({\n cartId: cartId(),\n items: params.items,\n promoCode: params.promoCode ?? null,\n ...(params.email ? { email: params.email } : {}),\n // Only when a survey session already exists: it lets the backend reuse\n // the address the pre-survey email gate collected, which is often the\n // only handle we have on an anonymous shopper.\n ...(peekFunnelSessionId() ? { sessionId: peekFunnelSessionId() } : {}),\n }),\n }).catch(() => {});\n } catch {\n /* not configured yet — drop */\n }\n}\n\n/** A resumed cart line, already re-priced against today's catalog. */\nexport interface ResumedCartLine {\n productId: string;\n dosage?: string;\n quantity: number;\n name: string;\n priceCents: number;\n salePriceCents: number | null;\n thumbnailUrl: string | null;\n isSubscription: boolean;\n apexDrugId: string | null;\n categories: string[];\n hideDoseLabel: boolean;\n}\n\nexport interface ResumedCart {\n cartId: string;\n items: ResumedCartLine[];\n /** Lines whose product has since been discontinued or deactivated. */\n unavailable: Array<{ productId: string; dosage?: string; quantity: number }>;\n promoCode: string | null;\n subtotalCents: number;\n}\n\n/**\n * Exchange an emailed recovery token for the saved cart.\n *\n * The token is the ONLY thing authorizing this read — the-backend verifies its\n * HMAC before returning anything. A 404 (expired, already bought, tampered, or\n * every product gone) resolves to null so the caller simply keeps whatever cart\n * this browser already had.\n */\nexport async function fetchResumedCart(token: string): Promise<ResumedCart | null> {\n try {\n const cfg = getConfig();\n const res = await fetch(`${cfg.apiBase}/cart/resume?token=${encodeURIComponent(token)}`, {\n headers: { 'X-Tenant-Key': cfg.tenantKey },\n });\n if (!res.ok) return null;\n const body = (await res.json()) as Partial<ResumedCart>;\n if (!body.cartId || !Array.isArray(body.items) || body.items.length === 0) return null;\n return {\n cartId: body.cartId,\n items: body.items,\n unavailable: Array.isArray(body.unavailable) ? body.unavailable : [],\n promoCode: body.promoCode ?? null,\n subtotalCents: typeof body.subtotalCents === 'number' ? body.subtotalCents : 0,\n };\n } catch {\n return null;\n }\n}\n\n/** Read the `?cart=` token from the current URL. */\nexport function readCartToken(): string | null {\n try {\n const token = new URLSearchParams(window.location.search).get('cart');\n return token && token.length > 0 ? token : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Drop `?cart=` from the address bar once it's been redeemed, so a refresh (or\n * a shared URL) doesn't re-run the restore over a cart the shopper has since\n * edited. History is replaced, not pushed — the token was never a page.\n */\nexport function stripCartToken(): void {\n try {\n const url = new URL(window.location.href);\n if (!url.searchParams.has('cart')) return;\n url.searchParams.delete('cart');\n window.history.replaceState({}, '', url.toString());\n } catch {\n /* no history API — leaving the param is harmless */\n }\n}\n"]}
@@ -6,19 +6,20 @@ import {
6
6
  readResumeToken,
7
7
  saveFunnelDraft,
8
8
  stripResumeToken
9
- } from "./4YJF3J74.jsx";
9
+ } from "./HM5L6J62.jsx";
10
10
  import {
11
11
  affiliateAuth_default,
12
12
  auth_default,
13
13
  cart_default,
14
14
  medication_default
15
- } from "./XEWZ4OIT.jsx";
15
+ } from "./545PPOE5.jsx";
16
16
  import {
17
17
  ApiError,
18
18
  addressesApi,
19
19
  adminApi,
20
20
  adminCatalogApi,
21
21
  adminCatalogConversionApi,
22
+ adminProductPharmaciesApi,
22
23
  affiliatePortalApi,
23
24
  apexApi,
24
25
  authApi,
@@ -32,7 +33,7 @@ import {
32
33
  subscriptionsApi,
33
34
  supportApi,
34
35
  usersApi
35
- } from "./MH43RC7G.jsx";
36
+ } from "./PHSZOZVK.jsx";
36
37
  import {
37
38
  getConfig
38
39
  } from "./QVZ7BRNO.jsx";
@@ -5958,6 +5959,417 @@ function useCatalogConversion(opts) {
5958
5959
  };
5959
5960
  }
5960
5961
 
5962
+ // src/flows/addPharmacy.ts
5963
+ import { createSignal as createSignal15, onCleanup as onCleanup5 } from "solid-js";
5964
+ var REPLAN_DEBOUNCE_MS = 300;
5965
+ var matchKey = (source) => JSON.stringify([source.dosage, source.apexSkuId]);
5966
+ function matchAnswersBody(questions, answers) {
5967
+ return questions.flatMap((q) => {
5968
+ const key = matchKey(q.source);
5969
+ return Object.prototype.hasOwnProperty.call(answers, key) ? [{ source: { dosage: q.source.dosage, apexSkuId: q.source.apexSkuId }, doseId: answers[key] }] : [];
5970
+ });
5971
+ }
5972
+ function visibleWarnings(plan) {
5973
+ return plan.warnings.filter((w) => w.audience === "admin");
5974
+ }
5975
+ function parseMoney(raw) {
5976
+ const t = (raw ?? "").trim();
5977
+ if (!/^\d+(\.\d{1,2})?$/.test(t)) return null;
5978
+ const n = Number(t);
5979
+ return Number.isFinite(n) && n > 0 ? n : null;
5980
+ }
5981
+ function missingPrices(plan, prices) {
5982
+ return plan.pricesRequired.filter((r) => parseMoney(prices[r.doseId]) === null).map((r) => r.doseId);
5983
+ }
5984
+ function strengthsChanged(plan) {
5985
+ const before = new Map(plan.strengthsBefore.map((s) => [s.dosage, s.price]));
5986
+ if (before.size !== plan.strengthsAfter.length) return true;
5987
+ return plan.strengthsAfter.some((s) => !before.has(s.dosage) || before.get(s.dosage) !== s.price);
5988
+ }
5989
+ function needsReview(plan) {
5990
+ return plan.blockers.length > 0 || visibleWarnings(plan).length > 0 || plan.pricesRequired.length > 0 || (plan.matchQuestions?.length ?? 0) > 0 || strengthsChanged(plan);
5991
+ }
5992
+ function compareStrengths(plan) {
5993
+ const after = new Map(plan.strengthsAfter.map((s) => [s.dosage, s]));
5994
+ const rows = plan.strengthsBefore.map((b) => {
5995
+ const a = after.get(b.dosage);
5996
+ return { dosage: b.dosage, before: b.price, after: a && !a.needsPrice ? a.price : null, isNew: false };
5997
+ });
5998
+ const seen = new Set(plan.strengthsBefore.map((b) => b.dosage));
5999
+ for (const a of plan.strengthsAfter) {
6000
+ if (!seen.has(a.dosage)) rows.push({ dosage: a.dosage, before: void 0, after: a.needsPrice ? null : a.price, isNew: true });
6001
+ }
6002
+ return rows;
6003
+ }
6004
+ function pharmacyLabel(plan) {
6005
+ return plan.pharmacy.pharmacyName ?? plan.pharmacy.drugName;
6006
+ }
6007
+ function buildSaveBody(plan, prices, savingsPrices = {}, matchAnswers = {}) {
6008
+ const entries = plan.pricesRequired.flatMap((r) => {
6009
+ const price = parseMoney(prices[r.doseId]);
6010
+ if (price === null) return [];
6011
+ const savings = parseMoney(savingsPrices[r.doseId]);
6012
+ return [{ doseId: r.doseId, price, ...savings !== null ? { savingsPrice: savings } : {} }];
6013
+ });
6014
+ const doseMatches = matchAnswersBody(plan.matchQuestions ?? [], matchAnswers);
6015
+ return {
6016
+ drugId: plan.pharmacy.drugId,
6017
+ ...plan.planHash ? { planHash: plan.planHash } : {},
6018
+ ...entries.length > 0 ? { prices: entries } : {},
6019
+ ...doseMatches.length > 0 ? { doseMatches } : {}
6020
+ };
6021
+ }
6022
+ function pharmacyIsOnProduct(product, plan) {
6023
+ const list = product?.pharmacies;
6024
+ if (!Array.isArray(list)) return false;
6025
+ return list.some((p) => p.drugId === plan.pharmacy.drugId);
6026
+ }
6027
+ var FINAL_REFUSALS = [
6028
+ "pharmacy_already_on_product",
6029
+ "classification_mismatch",
6030
+ "single_dose_binding_unmatched"
6031
+ ];
6032
+ var REFUSAL_COPY = {
6033
+ pharmacy_already_on_product: "This product already has that pharmacy. Choose a different one.",
6034
+ conversion_in_progress: "A change to this product is already running. Wait a few minutes, then check the product again."
6035
+ };
6036
+ var messageOf3 = (err, fallback) => err instanceof Error && err.message ? err.message : fallback;
6037
+ function missingFromDetails(details) {
6038
+ if (!Array.isArray(details)) return [];
6039
+ return details.flatMap((d) => {
6040
+ const id = d?.doseId;
6041
+ return typeof id === "string" ? [id] : [];
6042
+ });
6043
+ }
6044
+ function classifyAddPharmacyError(err) {
6045
+ const e = err ?? {};
6046
+ const status = typeof e.status === "number" ? e.status : void 0;
6047
+ const code = typeof e.code === "string" ? e.code : void 0;
6048
+ const message = messageOf3(err, "Something went wrong talking to the server.");
6049
+ if (status === 409 && (code === "plan_changed" || code === "plan_first")) return { kind: "replan", message, code };
6050
+ if (code === "prices_required") return { kind: "prices_required", message, missing: missingFromDetails(e.details) };
6051
+ if (e.ambiguous === true || status === void 0 || status >= 500) {
6052
+ return { kind: "ambiguous", message, serverFinished: code !== void 0, ...code ? { code } : {} };
6053
+ }
6054
+ return {
6055
+ kind: "refused",
6056
+ message: code && REFUSAL_COPY[code] || message,
6057
+ status,
6058
+ ...code ? { code } : {},
6059
+ retryable: !(code && FINAL_REFUSALS.includes(code))
6060
+ };
6061
+ }
6062
+ function useAddPharmacy(opts) {
6063
+ const [state, setState] = createSignal15({ kind: "idle" });
6064
+ const [notice, setNotice] = createSignal15(null);
6065
+ const [drugs, setDrugs] = createSignal15([]);
6066
+ const [drugsStatus, setDrugsStatus] = createSignal15("idle");
6067
+ const [selected, setSelected] = createSignal15("");
6068
+ const [prices, setPrices] = createSignal15({});
6069
+ const [savingsPrices, setSavingsPrices] = createSignal15({});
6070
+ const [flagged, setFlagged] = createSignal15(/* @__PURE__ */ new Set());
6071
+ const [matchAnswers, setMatchAnswers] = createSignal15({});
6072
+ const [replanning, setReplanning] = createSignal15(false);
6073
+ const [replanStale, setReplanStale] = createSignal15(false);
6074
+ let generation = 0;
6075
+ let replanTimer;
6076
+ let replanSeq = 0;
6077
+ const dropReplan = () => {
6078
+ clearTimeout(replanTimer);
6079
+ replanTimer = void 0;
6080
+ replanSeq++;
6081
+ setReplanning(false);
6082
+ setReplanStale(false);
6083
+ };
6084
+ onCleanup5(() => {
6085
+ generation++;
6086
+ dropReplan();
6087
+ });
6088
+ const current = () => state();
6089
+ const kindIs = (k) => current().kind === k;
6090
+ const busy = () => kindIs("planning") || kindIs("saving");
6091
+ const reviewingPlan = () => {
6092
+ const s = current();
6093
+ return s.kind === "reviewing" ? s.plan : null;
6094
+ };
6095
+ const missing = () => {
6096
+ const plan2 = reviewingPlan();
6097
+ return plan2 ? missingPrices(plan2, prices()) : [];
6098
+ };
6099
+ const savingsInvalid = () => {
6100
+ const plan2 = reviewingPlan();
6101
+ if (!plan2) return [];
6102
+ const typed = savingsPrices();
6103
+ return plan2.pricesRequired.filter((r) => (typed[r.doseId] ?? "").trim() !== "" && parseMoney(typed[r.doseId]) === null).map((r) => r.doseId);
6104
+ };
6105
+ const canSave = () => {
6106
+ const plan2 = reviewingPlan();
6107
+ return !!plan2 && !replanning() && !replanStale() && plan2.ready && plan2.blockers.length === 0 && missing().length === 0 && savingsInvalid().length === 0;
6108
+ };
6109
+ const loadDrugs = async (gen) => {
6110
+ setDrugsStatus("loading");
6111
+ try {
6112
+ const res = await adminCatalogApi.listDrugs();
6113
+ if (gen !== generation) return;
6114
+ setDrugs(res?.drugs ?? []);
6115
+ setDrugsStatus("ready");
6116
+ } catch {
6117
+ if (gen !== generation) return;
6118
+ setDrugsStatus("failed");
6119
+ }
6120
+ };
6121
+ const open = (drugId) => {
6122
+ if (busy()) return;
6123
+ const gen = ++generation;
6124
+ dropReplan();
6125
+ setMatchAnswers({});
6126
+ setNotice(null);
6127
+ setSelected(drugId ?? "");
6128
+ setState({ kind: "picking" });
6129
+ void loadDrugs(gen);
6130
+ };
6131
+ const cancel = () => {
6132
+ if (kindIs("saving")) return;
6133
+ generation++;
6134
+ dropReplan();
6135
+ setNotice(null);
6136
+ setState({ kind: "idle" });
6137
+ };
6138
+ const backToPicking = () => {
6139
+ if (busy()) return;
6140
+ const gen = ++generation;
6141
+ dropReplan();
6142
+ setMatchAnswers({});
6143
+ setNotice(null);
6144
+ setState({ kind: "picking" });
6145
+ if (drugsStatus() !== "ready") void loadDrugs(gen);
6146
+ };
6147
+ const adoptPlan = (plan2, next) => {
6148
+ const prevPrices = prices();
6149
+ const prevSavings = savingsPrices();
6150
+ const nextPrices = {};
6151
+ const nextSavings = {};
6152
+ for (const r of plan2.pricesRequired) {
6153
+ nextPrices[r.doseId] = prevPrices[r.doseId] ?? (r.suggestedPrice != null ? String(r.suggestedPrice) : "");
6154
+ if (prevSavings[r.doseId] !== void 0) nextSavings[r.doseId] = prevSavings[r.doseId];
6155
+ }
6156
+ setPrices(nextPrices);
6157
+ setSavingsPrices(nextSavings);
6158
+ const questions = new Set((plan2.matchQuestions ?? []).map((q) => matchKey(q.source)));
6159
+ setMatchAnswers((prev) => Object.fromEntries(Object.entries(prev).filter(([k]) => questions.has(k))));
6160
+ setFlagged(/* @__PURE__ */ new Set());
6161
+ setNotice(next);
6162
+ setState({ kind: "reviewing", plan: plan2 });
6163
+ };
6164
+ const fail = (drugId, plan2, message, flags = {}) => {
6165
+ setNotice(null);
6166
+ setState({ kind: "failed", message, drugId, plan: plan2, unconfirmed: flags.unconfirmed ?? false, canRetry: flags.canRetry ?? true });
6167
+ };
6168
+ const runPlan = async (drugId, next = null, prior) => {
6169
+ const gen = ++generation;
6170
+ dropReplan();
6171
+ const doseMatches = prior ? matchAnswersBody(prior.matchQuestions ?? [], matchAnswers()) : [];
6172
+ if (!prior) setMatchAnswers({});
6173
+ setNotice(null);
6174
+ setState({ kind: "planning", drugId });
6175
+ try {
6176
+ const plan2 = await (doseMatches.length > 0 ? adminProductPharmaciesApi.plan(opts.productId(), drugId, doseMatches) : adminProductPharmaciesApi.plan(opts.productId(), drugId));
6177
+ if (gen !== generation) return;
6178
+ adoptPlan(plan2, next);
6179
+ } catch (err) {
6180
+ if (gen !== generation) return;
6181
+ const f = classifyAddPharmacyError(err);
6182
+ fail(drugId, null, f.message, { canRetry: f.kind !== "refused" || f.retryable });
6183
+ }
6184
+ };
6185
+ const plan = async () => {
6186
+ const drugId = selected();
6187
+ if (!kindIs("picking") || !drugId) return;
6188
+ await runPlan(drugId);
6189
+ };
6190
+ const replan = async (gen) => {
6191
+ const p = reviewingPlan();
6192
+ if (!p || gen !== generation) return;
6193
+ const seq = ++replanSeq;
6194
+ const doseMatches = matchAnswersBody(p.matchQuestions ?? [], matchAnswers());
6195
+ try {
6196
+ const fresh = await adminProductPharmaciesApi.plan(opts.productId(), p.pharmacy.drugId, doseMatches);
6197
+ if (gen !== generation || seq !== replanSeq) return;
6198
+ setReplanning(false);
6199
+ setReplanStale(false);
6200
+ adoptPlan(fresh, null);
6201
+ } catch (err) {
6202
+ if (gen !== generation || seq !== replanSeq) return;
6203
+ setReplanning(false);
6204
+ setReplanStale(true);
6205
+ setNotice({
6206
+ tone: "danger",
6207
+ code: "replan_failed",
6208
+ message: `We couldn\u2019t update the prices for that choice: ${classifyAddPharmacyError(err).message} Choose again to retry.`
6209
+ });
6210
+ }
6211
+ };
6212
+ const setMatchAnswer = (source, doseId) => {
6213
+ if (!reviewingPlan()) return;
6214
+ setMatchAnswers((prev) => ({ ...prev, [matchKey(source)]: doseId }));
6215
+ const gen = generation;
6216
+ clearTimeout(replanTimer);
6217
+ replanSeq++;
6218
+ setReplanning(true);
6219
+ replanTimer = setTimeout(() => {
6220
+ replanTimer = void 0;
6221
+ void replan(gen);
6222
+ }, REPLAN_DEBOUNCE_MS);
6223
+ };
6224
+ const confirmOnProduct = async (p) => {
6225
+ const res = await adminApi.getProduct(opts.productId());
6226
+ return pharmacyIsOnProduct(res?.product, p);
6227
+ };
6228
+ const finish = (p, origin, status) => {
6229
+ const added = {
6230
+ productId: opts.productId(),
6231
+ pharmacyName: pharmacyLabel(p),
6232
+ origin,
6233
+ status: status ?? (p.kind === "convert" ? "converted" : "added")
6234
+ };
6235
+ setNotice(null);
6236
+ setState({ kind: "done", added });
6237
+ opts.onAdded?.(added);
6238
+ };
6239
+ const save = async () => {
6240
+ const p = reviewingPlan();
6241
+ if (!p || !canSave()) return;
6242
+ const gen = ++generation;
6243
+ const body = buildSaveBody(p, prices(), savingsPrices(), matchAnswers());
6244
+ setNotice(null);
6245
+ setState({ kind: "saving", plan: p });
6246
+ try {
6247
+ const res = await adminProductPharmaciesApi.add(opts.productId(), body);
6248
+ if (gen !== generation) return;
6249
+ finish(p, "saved", res?.status);
6250
+ } catch (err) {
6251
+ if (gen !== generation) return;
6252
+ const f = classifyAddPharmacyError(err);
6253
+ const drugId = p.pharmacy.drugId;
6254
+ if (f.kind === "replan") {
6255
+ await runPlan(
6256
+ drugId,
6257
+ {
6258
+ tone: "warn",
6259
+ code: f.code,
6260
+ message: "Something changed while you were reviewing, so we updated this. Check it over, then save again."
6261
+ },
6262
+ p
6263
+ );
6264
+ return;
6265
+ }
6266
+ if (f.kind === "prices_required") {
6267
+ const owed = new Set(p.pricesRequired.map((r) => r.doseId));
6268
+ if (f.missing.some((id) => !owed.has(id))) {
6269
+ await runPlan(drugId, { tone: "warn", code: "prices_required", message: "More prices are needed than we first showed. Enter them below." }, p);
6270
+ return;
6271
+ }
6272
+ setFlagged(new Set(f.missing));
6273
+ setNotice({ tone: "danger", code: "prices_required", message: "Enter a price for every strength marked below." });
6274
+ setState({ kind: "reviewing", plan: p });
6275
+ return;
6276
+ }
6277
+ if (f.kind === "refused") {
6278
+ fail(drugId, p, f.message, { canRetry: f.retryable });
6279
+ return;
6280
+ }
6281
+ try {
6282
+ if (await confirmOnProduct(p)) {
6283
+ if (gen === generation) finish(p, "recovered");
6284
+ return;
6285
+ }
6286
+ } catch {
6287
+ if (gen !== generation) return;
6288
+ fail(
6289
+ drugId,
6290
+ p,
6291
+ "We couldn\u2019t confirm whether the pharmacy was added. Check again in a moment before changing anything else.",
6292
+ { unconfirmed: true }
6293
+ );
6294
+ return;
6295
+ }
6296
+ if (gen !== generation) return;
6297
+ if (f.serverFinished) {
6298
+ fail(drugId, p, f.message);
6299
+ } else {
6300
+ fail(
6301
+ drugId,
6302
+ p,
6303
+ "We lost the connection while saving, and the pharmacy isn\u2019t on this product yet. It may still be finishing: check again in a moment, or start over.",
6304
+ { unconfirmed: true }
6305
+ );
6306
+ }
6307
+ }
6308
+ };
6309
+ const retry = async () => {
6310
+ const s = current();
6311
+ if (s.kind !== "failed") return;
6312
+ if (s.unconfirmed && s.plan) {
6313
+ const p = s.plan;
6314
+ const gen = ++generation;
6315
+ try {
6316
+ if (await confirmOnProduct(p)) {
6317
+ if (gen === generation) finish(p, "recovered");
6318
+ return;
6319
+ }
6320
+ if (gen !== generation) return;
6321
+ fail(s.drugId, p, "Not there yet. If you just saved, give it a moment and check again; otherwise start over.", { unconfirmed: true });
6322
+ } catch {
6323
+ if (gen !== generation) return;
6324
+ fail(s.drugId, p, "We still couldn\u2019t confirm it. Check again in a moment.", { unconfirmed: true });
6325
+ }
6326
+ return;
6327
+ }
6328
+ await runPlan(s.drugId);
6329
+ };
6330
+ const startOver = async () => {
6331
+ const s = current();
6332
+ if (s.kind !== "failed") return;
6333
+ await runPlan(s.drugId);
6334
+ };
6335
+ return {
6336
+ state,
6337
+ busy,
6338
+ notice,
6339
+ dismissNotice: () => setNotice(null),
6340
+ drugs,
6341
+ drugsStatus,
6342
+ selected,
6343
+ select: setSelected,
6344
+ open,
6345
+ cancel,
6346
+ backToPicking,
6347
+ plan,
6348
+ prices,
6349
+ savingsPrices,
6350
+ setPrice: (doseId, value) => {
6351
+ setPrices((prev) => ({ ...prev, [doseId]: value }));
6352
+ setFlagged((prev) => {
6353
+ if (!prev.has(doseId)) return prev;
6354
+ const next = new Set(prev);
6355
+ next.delete(doseId);
6356
+ return next;
6357
+ });
6358
+ },
6359
+ setSavingsPrice: (doseId, value) => setSavingsPrices((prev) => ({ ...prev, [doseId]: value })),
6360
+ missing,
6361
+ flagged,
6362
+ savingsInvalid,
6363
+ canSave,
6364
+ matchAnswers,
6365
+ setMatchAnswer,
6366
+ replanning,
6367
+ save,
6368
+ retry,
6369
+ startOver
6370
+ };
6371
+ }
6372
+
5961
6373
  export {
5962
6374
  isQuestionVisible,
5963
6375
  useSurveyFlow,
@@ -6088,6 +6500,18 @@ export {
6088
6500
  describeConversion,
6089
6501
  hasBlockers,
6090
6502
  hasConversion,
6091
- useCatalogConversion
6503
+ useCatalogConversion,
6504
+ matchKey,
6505
+ visibleWarnings,
6506
+ parseMoney,
6507
+ missingPrices,
6508
+ strengthsChanged,
6509
+ needsReview,
6510
+ compareStrengths,
6511
+ pharmacyLabel,
6512
+ buildSaveBody,
6513
+ pharmacyIsOnProduct,
6514
+ classifyAddPharmacyError,
6515
+ useAddPharmacy
6092
6516
  };
6093
- //# sourceMappingURL=HHCDX47F.jsx.map
6517
+ //# sourceMappingURL=VE5ACNFB.jsx.map