@apextelemed/partner-core 0.4.0 → 0.5.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/dist/api/index.d.ts +2 -2
  2. package/dist/api/index.js +3 -3
  3. package/dist/api/index.jsx +5 -3
  4. package/dist/{cart-CBH8Em8f.d.ts → cart-BwUwSzWh.d.ts} +25 -2
  5. package/dist/chunk/{OJSQZEB3.js → 4W5ONAFF.js} +7 -6
  6. package/dist/chunk/4W5ONAFF.js.map +1 -0
  7. package/dist/chunk/{DS4E7FAI.js → 4YUUZ532.js} +14 -4
  8. package/dist/chunk/4YUUZ532.js.map +1 -0
  9. package/dist/chunk/{T6IKS76T.jsx → 5CXUPFZU.jsx} +33 -15
  10. package/dist/chunk/{EIXZJX6R.js → 6MDLP62Y.js} +34 -17
  11. package/dist/chunk/6MDLP62Y.js.map +1 -0
  12. package/dist/chunk/{NYLIUR7O.jsx → 6QC4BETO.jsx} +6 -5
  13. package/dist/chunk/{ID67FV6R.js → 7COJH6FZ.js} +1014 -892
  14. package/dist/chunk/7COJH6FZ.js.map +1 -0
  15. package/dist/chunk/{MEF3FUQB.jsx → B5RBZKAK.jsx} +1 -1
  16. package/dist/chunk/{STEVQZ6U.jsx → CXBPVQ7W.jsx} +2 -2
  17. package/dist/chunk/{NP4CMOLW.jsx → GGY7VMZ2.jsx} +5 -3
  18. package/dist/chunk/{2XJBOTK5.js → ITK5F5AI.js} +2 -2
  19. package/dist/chunk/{2XJBOTK5.js.map → ITK5F5AI.js.map} +1 -1
  20. package/dist/chunk/{YHWX4NMV.js → NNTB7KL5.js} +3 -3
  21. package/dist/chunk/{YHWX4NMV.js.map → NNTB7KL5.js.map} +1 -1
  22. package/dist/chunk/{XMYPS7PT.js → O4V2YXBF.js} +5 -4
  23. package/dist/chunk/O4V2YXBF.js.map +1 -0
  24. package/dist/chunk/{HM27UGZM.jsx → YPZVHEBG.jsx} +1163 -1048
  25. package/dist/chunk/{I46Y2J5W.jsx → Z2CR6WKF.jsx} +15 -2
  26. package/dist/{client-DUrhrzOG.d.ts → client-Cm6n4V0r.d.ts} +8 -0
  27. package/dist/flows/index.d.ts +49 -3
  28. package/dist/flows/index.js +6 -6
  29. package/dist/flows/index.jsx +10 -8
  30. package/dist/index/index.d.ts +3 -3
  31. package/dist/index/index.js +7 -7
  32. package/dist/index/index.jsx +13 -9
  33. package/dist/pages/index.d.ts +1 -1
  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/package.json +1 -1
  40. package/dist/chunk/DS4E7FAI.js.map +0 -1
  41. package/dist/chunk/EIXZJX6R.js.map +0 -1
  42. package/dist/chunk/ID67FV6R.js.map +0 -1
  43. package/dist/chunk/OJSQZEB3.js.map +0 -1
  44. package/dist/chunk/XMYPS7PT.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { disqualificationReasonText, qualifiedDrugIds } from './LZWA44KD.js';
2
- import { useSurveyFlow, resolveSurveyV2DrugIntent, emailGateAnswered, redeemResumeLink, useSurveyV2Flow, availableStateOptions, US_STATE_OPTIONS, useCheckoutFlow, useCartCheckoutFlow, useSignupFlow, useRegisterFlow, useSubscribeFlow, useDashboardData, useUpdatePaymentMethodFlow, useMemberPortalData, useMessagesThread, captureFunnelEmail, markEmailGateAnswered, useAffiliateStats, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, stateAvailabilityNote, hasStateRestrictions, uploadPrescriptionPhoto, deriveAttention, deriveJourney, buildTimeline, lifecycleReason, accountSource, LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, formatConversationTime, buildTrackerView, ACCOUNT_SOURCE_LABEL, fmtDay, formatCalendarDate, formatMessageTime, formatEventDate, formatStageDate, LIFECYCLE_TONE, buildTrackingUrl, isImageAttachment, buildRefillView, toTrackerRequest } from './OJSQZEB3.js';
3
- import { fetchFunnelConfig } from './DS4E7FAI.js';
2
+ import { useSurveyFlow, resolveSurveyV2DrugIntent, emailGateAnswered, redeemResumeLink, useSurveyV2Flow, availableStateOptions, US_STATE_OPTIONS, useCheckoutFlow, useCartCheckoutFlow, useSignupFlow, useRegisterFlow, useSubscribeFlow, useDashboardData, useUpdatePaymentMethodFlow, useMemberPortalData, useMessagesThread, captureFunnelEmail, markEmailGateAnswered, useAffiliateStats, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, stateAvailabilityNote, hasStateRestrictions, uploadPrescriptionPhoto, deriveAttention, deriveJourney, buildTimeline, lifecycleReason, accountSource, LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, formatConversationTime, buildTrackerView, ACCOUNT_SOURCE_LABEL, fmtDay, formatCalendarDate, formatMessageTime, formatEventDate, formatStageDate, LIFECYCLE_TONE, buildTrackingUrl, isImageAttachment, buildRefillView, toTrackerRequest } from './4W5ONAFF.js';
3
+ import { fetchFunnelConfig } from './4YUUZ532.js';
4
4
  import { usePrimitives } from './67KHO66G.js';
5
- import { auth_default, cart_default, affiliateAuth_default } from './YHWX4NMV.js';
6
- import { usersApi, adminApi, membersApi, affiliatePortalApi, authApi, adminAffiliatesApi, SUPPORT_ATTACHMENT_MIME_TYPES, SUPPORT_ATTACHMENT_MAX_BYTES, apiFetch, apexApi, subscriptionsApi, ApiError } from './2XJBOTK5.js';
5
+ import { auth_default, cart_default, affiliateAuth_default } from './NNTB7KL5.js';
6
+ import { usersApi, adminApi, membersApi, affiliatePortalApi, authApi, adminAffiliatesApi, SUPPORT_ATTACHMENT_MIME_TYPES, SUPPORT_ATTACHMENT_MAX_BYTES, apiFetch, apexApi, subscriptionsApi, ApiError } from './ITK5F5AI.js';
7
7
  import { delegateEvents, createComponent, insert, memo, effect, setStyleProperty, mergeProps, use, setAttribute, addEventListener, style, className, Dynamic, template } from 'solid-js/web';
8
8
  import { createContext, createEffect, on, Show, For, createResource, createSignal, createMemo, Index, ErrorBoundary, Switch, Match, onMount, onCleanup, useContext } from 'solid-js';
9
9
  import { isQuestionVisible } from '@apextelemed/survey-core';
@@ -5095,6 +5095,9 @@ function datetimeLocalToIso(value) {
5095
5095
  return new Date(value).toISOString();
5096
5096
  }
5097
5097
  var LIVE_SUBSCRIPTION_STATUSES = /* @__PURE__ */ new Set(["active", "paused", "past_due"]);
5098
+ function subscriptionLabel(s, fallback = "Subscription") {
5099
+ return s.medicationName || s.medication || fallback;
5100
+ }
5098
5101
 
5099
5102
  // src/pages/admin/shared.tsx
5100
5103
  var _tmpl$51 = /* @__PURE__ */ template(`<span>`);
@@ -10134,239 +10137,25 @@ var AdminNavContext = createContext();
10134
10137
  function useAdminNav() {
10135
10138
  return useContext(AdminNavContext);
10136
10139
  }
10137
- var _tmpl$139 = /* @__PURE__ */ template(`<div class=app-admin-modal-backdrop><div class="app-admin-card app-admin-modal"style=max-width:32rem><div class=app-admin-modal-header><h3 class=app-admin-heading style=font-size:1rem;margin:0>Customer dashboard preview</h3><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div class=app-admin-modal-body><div style="padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);background:var(--app-admin-warning-bg);color:var(--app-admin-warning-fg);font-size:0.75rem;font-weight:500">Viewing as <!> \u2014 read-only`);
10138
- var _tmpl$246 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);font-size:0.75rem;font-weight:500"><span></span><button type=button class="app-admin-btn app-admin-btn-ghost"style="padding:0.25rem 0.75rem">Retry`);
10139
- var _tmpl$333 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>Could not load this customer's dashboard.`);
10140
- var _tmpl$423 = /* @__PURE__ */ template(`<div><h3>Profile</h3><div class=app-admin-card-soft style=padding:0.75rem><p style=font-weight:600;font-size:0.9375rem;margin:0></p><p style="font-size:0.8125rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
10141
- var _tmpl$520 = /* @__PURE__ */ template(`<div><h3>Subscription`);
10142
- var _tmpl$619 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem>`);
10143
- var _tmpl$718 = /* @__PURE__ */ template(`<div><h3>Prescription requests`);
10144
- var _tmpl$818 = /* @__PURE__ */ template(`<div><h3>Pending surveys`);
10145
- var _tmpl$917 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No active subscription.`);
10146
- var _tmpl$015 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">Next charge `);
10147
- var _tmpl$140 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><span style=font-size:0.875rem;font-weight:500>`);
10148
- var _tmpl$1010 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
10149
- var _tmpl$1113 = /* @__PURE__ */ template(`<div><h3>Prescription status</h3><div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><span style=font-size:0.875rem;font-weight:500>Current request`);
10150
- var _tmpl$1210 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No prescription requests.`);
10151
- var _tmpl$1310 = /* @__PURE__ */ template(`<span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>`);
10152
- var _tmpl$149 = /* @__PURE__ */ template(`<span> \xB7 `);
10153
- var _tmpl$159 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><div><span style=font-size:0.875rem;font-weight:500></span></div></div><div style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-top:0.25rem>`);
10154
- var _tmpl$169 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No pending surveys.`);
10155
- var _tmpl$179 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><span style=font-size:0.875rem;font-weight:500></span><span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>Cycle `);
10156
- function PatientDashboardPreview(props) {
10157
- const data = useDashboardData({
10158
- authToken: () => props.token
10159
- });
10160
- return (() => {
10161
- var _el$ = _tmpl$139(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$3.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$0 = _el$8.nextSibling; _el$0.nextSibling;
10162
- _el$.$$click = (e) => {
10163
- if (e.target === e.currentTarget) props.onClose();
10164
- };
10165
- addEventListener(_el$5, "click", props.onClose, true);
10166
- insert(_el$7, () => props.customerName || "customer", _el$0);
10167
- insert(_el$6, createComponent(Show, {
10168
- get when() {
10169
- return data.error();
10170
- },
10171
- keyed: true,
10172
- children: (msg) => (() => {
10173
- var _el$1 = _tmpl$246(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
10174
- insert(_el$10, msg);
10175
- _el$11.$$click = () => data.retry();
10176
- return _el$1;
10177
- })()
10178
- }), null);
10179
- insert(_el$6, createComponent(Show, {
10180
- get when() {
10181
- return !data.profile.loading;
10182
- },
10183
- get fallback() {
10184
- return createComponent(LoadingSpinner, {});
10185
- },
10186
- get children() {
10187
- return createComponent(Show, {
10188
- get when() {
10189
- return data.profile();
10190
- },
10191
- get fallback() {
10192
- return _tmpl$333();
10193
- },
10194
- children: (profile) => [(() => {
10195
- var _el$13 = _tmpl$423(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling;
10196
- insert(_el$16, () => [profile().firstName, profile().lastName].filter(Boolean).join(" ") || "Member");
10197
- insert(_el$17, () => profile().email);
10198
- effect((_$p) => style(_el$14, panelSectionHeader, _$p));
10199
- return _el$13;
10200
- })(), (() => {
10201
- var _el$18 = _tmpl$520(), _el$19 = _el$18.firstChild;
10202
- insert(_el$18, createComponent(Show, {
10203
- get when() {
10204
- return data.subscription();
10205
- },
10206
- get fallback() {
10207
- return _tmpl$917();
10208
- },
10209
- children: (sub) => (() => {
10210
- var _el$27 = _tmpl$140(), _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild;
10211
- insert(_el$29, createComponent(Show, {
10212
- get when() {
10213
- return sub().amount != null;
10214
- },
10215
- fallback: "Subscription",
10216
- get children() {
10217
- return [memo(() => centsToUsd(sub().amount)), "/mo"];
10218
- }
10219
- }));
10220
- insert(_el$28, createComponent(StatusBadge, {
10221
- get status() {
10222
- return sub().status;
10223
- }
10224
- }), null);
10225
- insert(_el$27, createComponent(Show, {
10226
- get when() {
10227
- return sub().nextBillingDate;
10228
- },
10229
- get children() {
10230
- var _el$30 = _tmpl$015(); _el$30.firstChild;
10231
- insert(_el$30, () => fmtDate(sub().nextBillingDate), null);
10232
- return _el$30;
10233
- }
10234
- }), null);
10235
- return _el$27;
10236
- })()
10237
- }), null);
10238
- effect((_$p) => style(_el$19, panelSectionHeader, _$p));
10239
- return _el$18;
10240
- })(), createComponent(Show, {
10241
- get when() {
10242
- return data.rxStatus();
10243
- },
10244
- children: (rx) => (() => {
10245
- var _el$32 = _tmpl$1113(), _el$33 = _el$32.firstChild, _el$34 = _el$33.nextSibling, _el$35 = _el$34.firstChild; _el$35.firstChild;
10246
- insert(_el$35, createComponent(StatusBadge, {
10247
- get status() {
10248
- return rx().status;
10249
- }
10250
- }), null);
10251
- insert(_el$34, createComponent(Show, {
10252
- get when() {
10253
- return rx().reason;
10254
- },
10255
- get children() {
10256
- var _el$37 = _tmpl$1010();
10257
- insert(_el$37, () => rx().reason);
10258
- return _el$37;
10259
- }
10260
- }), null);
10261
- effect((_$p) => style(_el$33, panelSectionHeader, _$p));
10262
- return _el$32;
10263
- })()
10264
- }), (() => {
10265
- var _el$20 = _tmpl$718(), _el$21 = _el$20.firstChild;
10266
- insert(_el$20, createComponent(Show, {
10267
- get when() {
10268
- return (data.rxList() ?? []).length > 0;
10269
- },
10270
- get fallback() {
10271
- return _tmpl$1210();
10272
- },
10273
- get children() {
10274
- var _el$22 = _tmpl$619();
10275
- insert(_el$22, createComponent(For, {
10276
- get each() {
10277
- return data.rxList();
10278
- },
10279
- children: (req) => (() => {
10280
- var _el$39 = _tmpl$159(), _el$40 = _el$39.firstChild, _el$41 = _el$40.firstChild, _el$42 = _el$41.firstChild, _el$44 = _el$40.nextSibling;
10281
- insert(_el$42, () => req.drugName || req.drugId || "Prescription");
10282
- insert(_el$41, createComponent(Show, {
10283
- get when() {
10284
- return req.dosage;
10285
- },
10286
- get children() {
10287
- var _el$43 = _tmpl$1310();
10288
- insert(_el$43, () => req.dosage);
10289
- return _el$43;
10290
- }
10291
- }), null);
10292
- insert(_el$40, createComponent(StatusBadge, {
10293
- get status() {
10294
- return req.status;
10295
- }
10296
- }), null);
10297
- insert(_el$44, createComponent(Show, {
10298
- get when() {
10299
- return req.priceCents != null;
10300
- },
10301
- get children() {
10302
- var _el$45 = _tmpl$149(), _el$46 = _el$45.firstChild;
10303
- insert(_el$45, () => centsToUsd(req.priceCents), _el$46);
10304
- return _el$45;
10305
- }
10306
- }), null);
10307
- insert(_el$44, () => fmtDate(req.createdAt), null);
10308
- return _el$39;
10309
- })()
10310
- }));
10311
- return _el$22;
10312
- }
10313
- }), null);
10314
- effect((_$p) => style(_el$21, panelSectionHeader, _$p));
10315
- return _el$20;
10316
- })(), (() => {
10317
- var _el$23 = _tmpl$818(), _el$24 = _el$23.firstChild;
10318
- insert(_el$23, createComponent(Show, {
10319
- get when() {
10320
- return (data.pendingSurveys() ?? []).length > 0;
10321
- },
10322
- get fallback() {
10323
- return _tmpl$169();
10324
- },
10325
- get children() {
10326
- var _el$25 = _tmpl$619();
10327
- insert(_el$25, createComponent(For, {
10328
- get each() {
10329
- return data.pendingSurveys();
10330
- },
10331
- children: (survey) => (() => {
10332
- var _el$48 = _tmpl$179(), _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling; _el$50.firstChild;
10333
- insert(_el$49, () => survey.drugName || survey.drugId || "Renewal survey");
10334
- insert(_el$50, () => survey.cycleNumber, null);
10335
- return _el$48;
10336
- })()
10337
- }));
10338
- return _el$25;
10339
- }
10340
- }), null);
10341
- effect((_$p) => style(_el$24, panelSectionHeader, _$p));
10342
- return _el$23;
10343
- })()]
10344
- });
10345
- }
10346
- }), null);
10347
- return _el$;
10348
- })();
10349
- }
10350
- delegateEvents(["click"]);
10351
- var _tmpl$141 = /* @__PURE__ */ template(`<span style=text-transform:none>`);
10140
+ var _tmpl$139 = /* @__PURE__ */ template(`<span style=text-transform:none>`);
10352
10141
  function LifecycleBadge(props) {
10353
10142
  const bucket = () => props.lifecycle?.bucket ?? props.bucket ?? null;
10354
10143
  const label = () => props.lifecycle?.label || (bucket() ? LIFECYCLE_LABEL[bucket()] : "Unknown");
10355
10144
  const tone = () => bucket() ? LIFECYCLE_TONE[bucket()] : "neutral";
10356
10145
  return (() => {
10357
- var _el$ = _tmpl$141();
10146
+ var _el$ = _tmpl$139();
10358
10147
  insert(_el$, label);
10359
10148
  effect(() => className(_el$, `app-admin-badge app-admin-badge--${tone()}`));
10360
10149
  return _el$;
10361
10150
  })();
10362
10151
  }
10363
- var _tmpl$150 = /* @__PURE__ */ template(`<input class=app-admin-input type=number inputmode=decimal min=0 step=0.01 autofocus>`);
10364
- var _tmpl$247 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>A recurring discount is still running on this subscription. Saving a new amount replaces it: the customer pays the new amount every period.`);
10365
- var _tmpl$334 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>This subscription is billed by the payment gateway, which holds the price. The change will be refused until it is moved to platform billing.`);
10366
- var _tmpl$424 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>`);
10367
- var _tmpl$521 = /* @__PURE__ */ template(`<form id=edit-amount-form style=display:flex;flex-direction:column;gap:0.75rem><p class=app-admin-text-muted style=margin:0;font-size:0.875rem> currently charges <!> every <!> days. The new amount applies to the next charge and every charge after it.`);
10368
- var _tmpl$620 = /* @__PURE__ */ template(`<button type=submit form=edit-amount-form class="app-admin-btn app-admin-btn-primary">`);
10369
- var _tmpl$719 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10152
+ var _tmpl$140 = /* @__PURE__ */ template(`<input class=app-admin-input type=number inputmode=decimal min=0 step=0.01 autofocus>`);
10153
+ var _tmpl$246 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>A recurring discount is still running on this subscription. Saving a new amount replaces it: the customer pays the new amount every period.`);
10154
+ var _tmpl$333 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>This subscription is billed by the payment gateway, which holds the price. The change will be refused until it is moved to platform billing.`);
10155
+ var _tmpl$423 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>`);
10156
+ var _tmpl$520 = /* @__PURE__ */ template(`<form id=edit-amount-form style=display:flex;flex-direction:column;gap:0.75rem><p class=app-admin-text-muted style=margin:0;font-size:0.875rem> currently charges <!> every <!> days. The new amount applies to the next charge and every charge after it.`);
10157
+ var _tmpl$619 = /* @__PURE__ */ template(`<button type=submit form=edit-amount-form class="app-admin-btn app-admin-btn-primary">`);
10158
+ var _tmpl$718 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10370
10159
  function EditAmountModal(props) {
10371
10160
  const current2 = () => props.subscription.amountCents ?? 0;
10372
10161
  const [dollars, setDollars] = createSignal((current2() / 100).toFixed(2));
@@ -10404,27 +10193,27 @@ function EditAmountModal(props) {
10404
10193
  },
10405
10194
  get footer() {
10406
10195
  return [(() => {
10407
- var _el$11 = _tmpl$620();
10196
+ var _el$11 = _tmpl$619();
10408
10197
  insert(_el$11, () => saving() ? "Saving\u2026" : "Save new amount");
10409
10198
  effect(() => _el$11.disabled = saving() || !valid());
10410
10199
  return _el$11;
10411
10200
  })(), (() => {
10412
- var _el$12 = _tmpl$719();
10201
+ var _el$12 = _tmpl$718();
10413
10202
  addEventListener(_el$12, "click", props.onClose, true);
10414
10203
  effect(() => _el$12.disabled = saving());
10415
10204
  return _el$12;
10416
10205
  })()];
10417
10206
  },
10418
10207
  get children() {
10419
- var _el$ = _tmpl$521(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$7 = _el$3.nextSibling, _el$4 = _el$7.nextSibling, _el$8 = _el$4.nextSibling; _el$8.nextSibling;
10208
+ var _el$ = _tmpl$520(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$7 = _el$3.nextSibling, _el$4 = _el$7.nextSibling, _el$8 = _el$4.nextSibling; _el$8.nextSibling;
10420
10209
  _el$.addEventListener("submit", submit);
10421
- insert(_el$2, () => props.subscription.medication || "Subscription", _el$3);
10210
+ insert(_el$2, () => subscriptionLabel(props.subscription), _el$3);
10422
10211
  insert(_el$2, () => centsToUsd(current2()), _el$7);
10423
10212
  insert(_el$2, () => props.subscription.intervalDays ?? 30, _el$8);
10424
10213
  insert(_el$, createComponent(FormRow, {
10425
10214
  label: "New amount (USD)",
10426
10215
  get children() {
10427
- var _el$9 = _tmpl$150();
10216
+ var _el$9 = _tmpl$140();
10428
10217
  _el$9.$$input = (e) => setDollars(e.currentTarget.value);
10429
10218
  effect(() => _el$9.value = dollars());
10430
10219
  return _el$9;
@@ -10435,7 +10224,7 @@ function EditAmountModal(props) {
10435
10224
  return discountActive();
10436
10225
  },
10437
10226
  get children() {
10438
- return _tmpl$247();
10227
+ return _tmpl$246();
10439
10228
  }
10440
10229
  }), null);
10441
10230
  insert(_el$, createComponent(Show, {
@@ -10443,7 +10232,7 @@ function EditAmountModal(props) {
10443
10232
  return props.subscription.billingMode === "gateway";
10444
10233
  },
10445
10234
  get children() {
10446
- return _tmpl$334();
10235
+ return _tmpl$333();
10447
10236
  }
10448
10237
  }), null);
10449
10238
  insert(_el$, createComponent(Show, {
@@ -10451,7 +10240,7 @@ function EditAmountModal(props) {
10451
10240
  return error();
10452
10241
  },
10453
10242
  get children() {
10454
- var _el$10 = _tmpl$424();
10243
+ var _el$10 = _tmpl$423();
10455
10244
  insert(_el$10, error);
10456
10245
  return _el$10;
10457
10246
  }
@@ -10461,14 +10250,14 @@ function EditAmountModal(props) {
10461
10250
  });
10462
10251
  }
10463
10252
  delegateEvents(["input", "click"]);
10464
- var _tmpl$151 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>This subscription is billed by the payment gateway. The gateway decides when to charge; these dates only change what the admin displays.`);
10465
- var _tmpl$248 = /* @__PURE__ */ template(`<input class=app-admin-input type=datetime-local autofocus>`);
10466
- var _tmpl$335 = /* @__PURE__ */ template(`<input class=app-admin-input type=datetime-local>`);
10467
- var _tmpl$425 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>The period end must be after its start.`);
10468
- var _tmpl$522 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>`);
10469
- var _tmpl$621 = /* @__PURE__ */ template(`<form id=edit-schedule-form style=display:flex;flex-direction:column;gap:0.75rem>`);
10470
- var _tmpl$720 = /* @__PURE__ */ template(`<button type=submit form=edit-schedule-form class="app-admin-btn app-admin-btn-primary">`);
10471
- var _tmpl$819 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10253
+ var _tmpl$141 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>This subscription is billed by the payment gateway. The gateway decides when to charge; these dates only change what the admin displays.`);
10254
+ var _tmpl$247 = /* @__PURE__ */ template(`<input class=app-admin-input type=datetime-local autofocus>`);
10255
+ var _tmpl$334 = /* @__PURE__ */ template(`<input class=app-admin-input type=datetime-local>`);
10256
+ var _tmpl$424 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>The period end must be after its start.`);
10257
+ var _tmpl$521 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>`);
10258
+ var _tmpl$620 = /* @__PURE__ */ template(`<form id=edit-schedule-form style=display:flex;flex-direction:column;gap:0.75rem>`);
10259
+ var _tmpl$719 = /* @__PURE__ */ template(`<button type=submit form=edit-schedule-form class="app-admin-btn app-admin-btn-primary">`);
10260
+ var _tmpl$818 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10472
10261
  function EditScheduleModal(props) {
10473
10262
  const [nextCharge, setNextCharge] = createSignal(isoToDatetimeLocal(props.subscription.nextChargeAt));
10474
10263
  const [periodStart, setPeriodStart] = createSignal(isoToDatetimeLocal(props.subscription.currentPeriodStart));
@@ -10514,26 +10303,26 @@ function EditScheduleModal(props) {
10514
10303
  },
10515
10304
  get footer() {
10516
10305
  return [(() => {
10517
- var _el$8 = _tmpl$720();
10306
+ var _el$8 = _tmpl$719();
10518
10307
  insert(_el$8, () => saving() ? "Saving\u2026" : "Save schedule");
10519
10308
  effect(() => _el$8.disabled = saving() || !dirty() || windowInverted());
10520
10309
  return _el$8;
10521
10310
  })(), (() => {
10522
- var _el$9 = _tmpl$819();
10311
+ var _el$9 = _tmpl$818();
10523
10312
  addEventListener(_el$9, "click", props.onClose, true);
10524
10313
  effect(() => _el$9.disabled = saving());
10525
10314
  return _el$9;
10526
10315
  })()];
10527
10316
  },
10528
10317
  get children() {
10529
- var _el$ = _tmpl$621();
10318
+ var _el$ = _tmpl$620();
10530
10319
  _el$.addEventListener("submit", submit);
10531
10320
  insert(_el$, createComponent(Show, {
10532
10321
  get when() {
10533
10322
  return props.subscription.billingMode === "gateway";
10534
10323
  },
10535
10324
  get children() {
10536
- return _tmpl$151();
10325
+ return _tmpl$141();
10537
10326
  }
10538
10327
  }), null);
10539
10328
  insert(_el$, createComponent(FormRow, {
@@ -10542,7 +10331,7 @@ function EditScheduleModal(props) {
10542
10331
  return memo(() => !!props.subscription.nextChargeAt)() ? `Currently ${fmtDate(props.subscription.nextChargeAt)}. Moving it later gives the customer more time; moving it earlier charges sooner.` : "No next charge is scheduled. Setting one restarts billing on that date.";
10543
10332
  },
10544
10333
  get children() {
10545
- var _el$3 = _tmpl$248();
10334
+ var _el$3 = _tmpl$247();
10546
10335
  _el$3.$$input = (e) => setNextCharge(e.currentTarget.value);
10547
10336
  effect(() => _el$3.value = nextCharge());
10548
10337
  return _el$3;
@@ -10551,7 +10340,7 @@ function EditScheduleModal(props) {
10551
10340
  insert(_el$, createComponent(FormRow, {
10552
10341
  label: "Current period start",
10553
10342
  get children() {
10554
- var _el$4 = _tmpl$335();
10343
+ var _el$4 = _tmpl$334();
10555
10344
  _el$4.$$input = (e) => setPeriodStart(e.currentTarget.value);
10556
10345
  effect(() => _el$4.value = periodStart());
10557
10346
  return _el$4;
@@ -10561,7 +10350,7 @@ function EditScheduleModal(props) {
10561
10350
  label: "Current period end",
10562
10351
  hint: "Shown to the customer as the end of their paid period.",
10563
10352
  get children() {
10564
- var _el$5 = _tmpl$335();
10353
+ var _el$5 = _tmpl$334();
10565
10354
  _el$5.$$input = (e) => setPeriodEnd(e.currentTarget.value);
10566
10355
  effect(() => _el$5.value = periodEnd());
10567
10356
  return _el$5;
@@ -10572,7 +10361,7 @@ function EditScheduleModal(props) {
10572
10361
  return windowInverted();
10573
10362
  },
10574
10363
  get children() {
10575
- return _tmpl$425();
10364
+ return _tmpl$424();
10576
10365
  }
10577
10366
  }), null);
10578
10367
  insert(_el$, createComponent(Show, {
@@ -10580,7 +10369,7 @@ function EditScheduleModal(props) {
10580
10369
  return error();
10581
10370
  },
10582
10371
  get children() {
10583
- var _el$7 = _tmpl$522();
10372
+ var _el$7 = _tmpl$521();
10584
10373
  insert(_el$7, error);
10585
10374
  return _el$7;
10586
10375
  }
@@ -10590,15 +10379,15 @@ function EditScheduleModal(props) {
10590
10379
  });
10591
10380
  }
10592
10381
  delegateEvents(["input", "click"]);
10593
- var _tmpl$160 = /* @__PURE__ */ template(`<input class=app-admin-input type=number inputmode=decimal min=0.01 step=0.01 autofocus>`);
10594
- var _tmpl$249 = /* @__PURE__ */ template(`<input class=app-admin-input type=text placeholder="e.g. duplicate charge">`);
10595
- var _tmpl$336 = /* @__PURE__ */ template(`<div class="app-admin-alert app-admin-alert--warning"style=flex-direction:column;gap:0.5rem><p class=app-admin-alert__title>This customer still has <!>. A refund does not stop billing.</p><ul style=margin:0;padding-left:1.25rem;font-size:0.8125rem;color:var(--app-admin-fg-muted)></ul><label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem><input type=checkbox>Also cancel <!> so they are not billed again`);
10596
- var _tmpl$426 = /* @__PURE__ */ template(`<form id=refund-form style=display:flex;flex-direction:column;gap:0.75rem><p class=app-admin-text-muted style=margin:0;font-size:0.875rem> paid<!>.`);
10597
- var _tmpl$523 = /* @__PURE__ */ template(`<button type=submit form=refund-form class="app-admin-btn app-admin-btn-primary">`);
10598
- var _tmpl$622 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10599
- var _tmpl$721 = /* @__PURE__ */ template(`<li> \u2014 `);
10600
- var _tmpl$820 = /* @__PURE__ */ template(`<div><p class=app-admin-alert__detail style=margin-bottom:0.5rem>The gateway has not settled this charge yet, so it can only be reversed in full right now. Partial refunds work once it settles, usually the next business day.</p><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Refund the full <!> instead`);
10601
- var _tmpl$918 = /* @__PURE__ */ template(`<div class="app-admin-alert app-admin-alert--danger"role=alert style=flex-direction:column;gap:0.5rem><p class=app-admin-alert__title>`);
10382
+ var _tmpl$149 = /* @__PURE__ */ template(`<input class=app-admin-input type=number inputmode=decimal min=0.01 step=0.01 autofocus>`);
10383
+ var _tmpl$248 = /* @__PURE__ */ template(`<input class=app-admin-input type=text placeholder="e.g. duplicate charge">`);
10384
+ var _tmpl$335 = /* @__PURE__ */ template(`<div class="app-admin-alert app-admin-alert--warning"style=flex-direction:column;gap:0.5rem><p class=app-admin-alert__title>This customer still has <!>. A refund does not stop billing.</p><ul style=margin:0;padding-left:1.25rem;font-size:0.8125rem;color:var(--app-admin-fg-muted)></ul><label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem><input type=checkbox>Also cancel <!> so they are not billed again`);
10385
+ var _tmpl$425 = /* @__PURE__ */ template(`<form id=refund-form style=display:flex;flex-direction:column;gap:0.75rem><p class=app-admin-text-muted style=margin:0;font-size:0.875rem> paid<!>.`);
10386
+ var _tmpl$522 = /* @__PURE__ */ template(`<button type=submit form=refund-form class="app-admin-btn app-admin-btn-primary">`);
10387
+ var _tmpl$621 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10388
+ var _tmpl$720 = /* @__PURE__ */ template(`<li> \u2014 `);
10389
+ var _tmpl$819 = /* @__PURE__ */ template(`<div><p class=app-admin-alert__detail style=margin-bottom:0.5rem>The gateway has not settled this charge yet, so it can only be reversed in full right now. Partial refunds work once it settles, usually the next business day.</p><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Refund the full <!> instead`);
10390
+ var _tmpl$917 = /* @__PURE__ */ template(`<div class="app-admin-alert app-admin-alert--danger"role=alert style=flex-direction:column;gap:0.5rem><p class=app-admin-alert__title>`);
10602
10391
  function RefundModal(props) {
10603
10392
  const remaining = () => Math.max(0, props.payment.amountCents - (props.payment.refundedAmountCents ?? 0));
10604
10393
  const [dollars, setDollars] = createSignal((remaining() / 100).toFixed(2));
@@ -10654,7 +10443,7 @@ function RefundModal(props) {
10654
10443
  },
10655
10444
  get footer() {
10656
10445
  return [(() => {
10657
- var _el$17 = _tmpl$523();
10446
+ var _el$17 = _tmpl$522();
10658
10447
  insert(_el$17, (() => {
10659
10448
  var _c$4 = memo(() => !!busy());
10660
10449
  return () => _c$4() ? "Refunding\u2026" : memo(() => !!isFull())() ? `Refund ${centsToUsd(remaining())}` : `Refund ${centsToUsd(cents() ?? 0)} of ${centsToUsd(remaining())}`;
@@ -10662,14 +10451,14 @@ function RefundModal(props) {
10662
10451
  effect(() => _el$17.disabled = busy() || !valid());
10663
10452
  return _el$17;
10664
10453
  })(), (() => {
10665
- var _el$18 = _tmpl$622();
10454
+ var _el$18 = _tmpl$621();
10666
10455
  addEventListener(_el$18, "click", props.onClose, true);
10667
10456
  effect(() => _el$18.disabled = busy());
10668
10457
  return _el$18;
10669
10458
  })()];
10670
10459
  },
10671
10460
  get children() {
10672
- var _el$ = _tmpl$426(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$5 = _el$3.nextSibling; _el$5.nextSibling;
10461
+ var _el$ = _tmpl$425(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$5 = _el$3.nextSibling; _el$5.nextSibling;
10673
10462
  _el$.addEventListener("submit", submit);
10674
10463
  insert(_el$2, () => centsToUsd(props.payment.amountCents), _el$3);
10675
10464
  insert(_el$2, (() => {
@@ -10694,7 +10483,7 @@ function RefundModal(props) {
10694
10483
  return `Up to ${centsToUsd(remaining())}.`;
10695
10484
  },
10696
10485
  get children() {
10697
- var _el$6 = _tmpl$160();
10486
+ var _el$6 = _tmpl$149();
10698
10487
  _el$6.$$input = (e) => setDollars(e.currentTarget.value);
10699
10488
  effect(() => setAttribute(_el$6, "max", (remaining() / 100).toFixed(2)));
10700
10489
  effect(() => _el$6.value = dollars());
@@ -10705,7 +10494,7 @@ function RefundModal(props) {
10705
10494
  label: "Reason (optional)",
10706
10495
  hint: "Kept on the payment record; not shown to the customer.",
10707
10496
  get children() {
10708
- var _el$7 = _tmpl$249();
10497
+ var _el$7 = _tmpl$248();
10709
10498
  _el$7.$$input = (e) => setReason(e.currentTarget.value);
10710
10499
  effect(() => _el$7.value = reason());
10711
10500
  return _el$7;
@@ -10716,7 +10505,7 @@ function RefundModal(props) {
10716
10505
  return props.liveSubscriptions.length > 0;
10717
10506
  },
10718
10507
  get children() {
10719
- var _el$8 = _tmpl$336(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$10 = _el$0.nextSibling; _el$10.nextSibling; var _el$11 = _el$9.nextSibling, _el$12 = _el$11.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling; _el$16.nextSibling;
10508
+ var _el$8 = _tmpl$335(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$10 = _el$0.nextSibling; _el$10.nextSibling; var _el$11 = _el$9.nextSibling, _el$12 = _el$11.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling; _el$16.nextSibling;
10720
10509
  insert(_el$9, (() => {
10721
10510
  var _c$3 = memo(() => props.liveSubscriptions.length === 1);
10722
10511
  return () => _c$3() ? "a live subscription" : `${props.liveSubscriptions.length} live subscriptions`;
@@ -10726,8 +10515,8 @@ function RefundModal(props) {
10726
10515
  return props.liveSubscriptions;
10727
10516
  },
10728
10517
  children: (s) => (() => {
10729
- var _el$19 = _tmpl$721(), _el$20 = _el$19.firstChild;
10730
- insert(_el$19, () => s.medication || "Subscription", _el$20);
10518
+ var _el$19 = _tmpl$720(), _el$20 = _el$19.firstChild;
10519
+ insert(_el$19, () => subscriptionLabel(s), _el$20);
10731
10520
  insert(_el$19, () => centsToUsd(s.amountCents), null);
10732
10521
  insert(_el$19, (() => {
10733
10522
  var _c$5 = memo(() => !!s.intervalDays);
@@ -10751,14 +10540,14 @@ function RefundModal(props) {
10751
10540
  return error();
10752
10541
  },
10753
10542
  children: (err) => (() => {
10754
- var _el$21 = _tmpl$918(), _el$22 = _el$21.firstChild;
10543
+ var _el$21 = _tmpl$917(), _el$22 = _el$21.firstChild;
10755
10544
  insert(_el$22, () => err().message);
10756
10545
  insert(_el$21, createComponent(Show, {
10757
10546
  get when() {
10758
10547
  return memo(() => err().code === "unsettled_requires_void")() && !isFull();
10759
10548
  },
10760
10549
  get children() {
10761
- var _el$23 = _tmpl$820(), _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$25.firstChild, _el$28 = _el$26.nextSibling; _el$28.nextSibling;
10550
+ var _el$23 = _tmpl$819(), _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$25.firstChild, _el$28 = _el$26.nextSibling; _el$28.nextSibling;
10762
10551
  _el$25.$$click = () => run({
10763
10552
  amountCents: void 0,
10764
10553
  reason: reason().trim() || void 0,
@@ -10777,18 +10566,18 @@ function RefundModal(props) {
10777
10566
  });
10778
10567
  }
10779
10568
  delegateEvents(["input", "click"]);
10780
- var _tmpl$161 = /* @__PURE__ */ template(`<ul style=margin:0;padding-left:1.1rem;font-size:0.8125rem>`);
10781
- var _tmpl$250 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
10782
- var _tmpl$337 = /* @__PURE__ */ template(`<li>Completed <!> \xB7 `);
10783
- var _tmpl$427 = /* @__PURE__ */ template(`<li>Started `);
10784
- var _tmpl$524 = /* @__PURE__ */ template(`<li> item<!> \xB7 `);
10785
- var _tmpl$623 = /* @__PURE__ */ template(`<div><div style=font-size:0.75rem;font-weight:600;color:var(--app-admin-fg-muted);margin-bottom:0.25rem>`);
10786
- var _tmpl$722 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>`);
10569
+ var _tmpl$150 = /* @__PURE__ */ template(`<ul style=margin:0;padding-left:1.1rem;font-size:0.8125rem>`);
10570
+ var _tmpl$249 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
10571
+ var _tmpl$336 = /* @__PURE__ */ template(`<li>Completed <!> \xB7 `);
10572
+ var _tmpl$426 = /* @__PURE__ */ template(`<li>Started `);
10573
+ var _tmpl$523 = /* @__PURE__ */ template(`<li> item<!> \xB7 `);
10574
+ var _tmpl$622 = /* @__PURE__ */ template(`<div><div style=font-size:0.75rem;font-weight:600;color:var(--app-admin-fg-muted);margin-bottom:0.25rem>`);
10575
+ var _tmpl$721 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>`);
10787
10576
  function FunnelActivity(props) {
10788
10577
  const f = () => props.funnel;
10789
10578
  const nothing = () => f().captures.length === 0 && f().sessions.length === 0 && f().carts.length === 0;
10790
10579
  return (() => {
10791
- var _el$ = _tmpl$250();
10580
+ var _el$ = _tmpl$249();
10792
10581
  insert(_el$, createComponent(Block, {
10793
10582
  title: "Intake survey",
10794
10583
  get children() {
@@ -10802,13 +10591,13 @@ function FunnelActivity(props) {
10802
10591
  });
10803
10592
  },
10804
10593
  get children() {
10805
- var _el$2 = _tmpl$161();
10594
+ var _el$2 = _tmpl$150();
10806
10595
  insert(_el$2, createComponent(For, {
10807
10596
  get each() {
10808
10597
  return f().captures;
10809
10598
  },
10810
10599
  children: (c) => (() => {
10811
- var _el$5 = _tmpl$337(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling; _el$8.nextSibling;
10600
+ var _el$5 = _tmpl$336(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling; _el$8.nextSibling;
10812
10601
  insert(_el$5, () => fmtDate(c.capturedAt), _el$8);
10813
10602
  insert(_el$5, () => c.qualified ? "qualified" : "did not qualify", null);
10814
10603
  insert(_el$5, createComponent(Show, {
@@ -10858,13 +10647,13 @@ function FunnelActivity(props) {
10858
10647
  });
10859
10648
  },
10860
10649
  get children() {
10861
- var _el$3 = _tmpl$161();
10650
+ var _el$3 = _tmpl$150();
10862
10651
  insert(_el$3, createComponent(For, {
10863
10652
  get each() {
10864
10653
  return f().sessions;
10865
10654
  },
10866
10655
  children: (s) => (() => {
10867
- var _el$9 = _tmpl$427(); _el$9.firstChild;
10656
+ var _el$9 = _tmpl$426(); _el$9.firstChild;
10868
10657
  insert(_el$9, () => fmtDate(s.startedAt), null);
10869
10658
  insert(_el$9, createComponent(Show, {
10870
10659
  get when() {
@@ -10931,13 +10720,13 @@ function FunnelActivity(props) {
10931
10720
  });
10932
10721
  },
10933
10722
  get children() {
10934
- var _el$4 = _tmpl$161();
10723
+ var _el$4 = _tmpl$150();
10935
10724
  insert(_el$4, createComponent(For, {
10936
10725
  get each() {
10937
10726
  return f().carts;
10938
10727
  },
10939
10728
  children: (c) => (() => {
10940
- var _el$1 = _tmpl$524(), _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling; _el$12.nextSibling;
10729
+ var _el$1 = _tmpl$523(), _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling; _el$12.nextSibling;
10941
10730
  insert(_el$1, () => c.itemCount, _el$10);
10942
10731
  insert(_el$1, () => c.itemCount === 1 ? "" : "s", _el$12);
10943
10732
  insert(_el$1, () => centsToUsd(c.subtotalCents), null);
@@ -10974,7 +10763,7 @@ function FunnelActivity(props) {
10974
10763
  }
10975
10764
  function Block(props) {
10976
10765
  return (() => {
10977
- var _el$13 = _tmpl$623(), _el$14 = _el$13.firstChild;
10766
+ var _el$13 = _tmpl$622(), _el$14 = _el$13.firstChild;
10978
10767
  insert(_el$14, () => props.title);
10979
10768
  insert(_el$13, () => props.children, null);
10980
10769
  return _el$13;
@@ -10982,18 +10771,18 @@ function Block(props) {
10982
10771
  }
10983
10772
  function Muted(props) {
10984
10773
  return (() => {
10985
- var _el$15 = _tmpl$722();
10774
+ var _el$15 = _tmpl$721();
10986
10775
  insert(_el$15, () => props.children);
10987
10776
  return _el$15;
10988
10777
  })();
10989
10778
  }
10990
- var _tmpl$170 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Amount</th><th>Status</th><th>Type</th><th>Detail</th><th style=width:6rem>Actions</th></tr></thead><tbody>`);
10991
- var _tmpl$251 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem> refunded`);
10992
- var _tmpl$338 = /* @__PURE__ */ template(`<div>`);
10993
- var _tmpl$428 = /* @__PURE__ */ template(`<div class=app-admin-text-mono style=font-size:0.75rem>`);
10994
- var _tmpl$525 = /* @__PURE__ */ template(`<div>Refunded `);
10995
- var _tmpl$624 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">`);
10996
- var _tmpl$723 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Amount></td><td data-label=Status></td><td data-label=Type class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Detail class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Actions>`);
10779
+ var _tmpl$151 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Amount</th><th>Status</th><th>Type</th><th>Detail</th><th style=width:6rem>Actions</th></tr></thead><tbody>`);
10780
+ var _tmpl$250 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem> refunded`);
10781
+ var _tmpl$337 = /* @__PURE__ */ template(`<div>`);
10782
+ var _tmpl$427 = /* @__PURE__ */ template(`<div class=app-admin-text-mono style=font-size:0.75rem>`);
10783
+ var _tmpl$524 = /* @__PURE__ */ template(`<div>Refunded `);
10784
+ var _tmpl$623 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">`);
10785
+ var _tmpl$722 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Amount></td><td data-label=Status></td><td data-label=Type class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Detail class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Actions>`);
10997
10786
  function typeWord(p) {
10998
10787
  if (p.detached) return "checkout (declined)";
10999
10788
  if (!p.type) return p.orderId ? "order" : p.subscriptionId ? "subscription" : "\u2014";
@@ -11012,13 +10801,13 @@ function PaymentsTable(props) {
11012
10801
  });
11013
10802
  },
11014
10803
  get children() {
11015
- var _el$ = _tmpl$170(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling; _el$9.nextSibling; var _el$1 = _el$3.nextSibling;
10804
+ var _el$ = _tmpl$151(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling; _el$9.nextSibling; var _el$1 = _el$3.nextSibling;
11016
10805
  insert(_el$1, createComponent(For, {
11017
10806
  get each() {
11018
10807
  return sorted();
11019
10808
  },
11020
10809
  children: (p) => (() => {
11021
- var _el$10 = _tmpl$723(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$15 = _el$12.nextSibling, _el$16 = _el$15.nextSibling, _el$17 = _el$16.nextSibling, _el$22 = _el$17.nextSibling;
10810
+ var _el$10 = _tmpl$722(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$15 = _el$12.nextSibling, _el$16 = _el$15.nextSibling, _el$17 = _el$16.nextSibling, _el$22 = _el$17.nextSibling;
11022
10811
  insert(_el$11, () => fmtDate(p.createdAt));
11023
10812
  insert(_el$12, () => centsToUsd(p.amountCents), null);
11024
10813
  insert(_el$12, createComponent(Show, {
@@ -11026,7 +10815,7 @@ function PaymentsTable(props) {
11026
10815
  return memo(() => (p.refundedAmountCents ?? 0) > 0)() && p.status !== "refunded";
11027
10816
  },
11028
10817
  get children() {
11029
- var _el$13 = _tmpl$251(), _el$14 = _el$13.firstChild;
10818
+ var _el$13 = _tmpl$250(), _el$14 = _el$13.firstChild;
11030
10819
  insert(_el$13, () => centsToUsd(p.refundedAmountCents), _el$14);
11031
10820
  return _el$13;
11032
10821
  }
@@ -11042,7 +10831,7 @@ function PaymentsTable(props) {
11042
10831
  return p.failureReason;
11043
10832
  },
11044
10833
  get children() {
11045
- var _el$18 = _tmpl$338();
10834
+ var _el$18 = _tmpl$337();
11046
10835
  insert(_el$18, () => p.failureReason);
11047
10836
  return _el$18;
11048
10837
  }
@@ -11052,7 +10841,7 @@ function PaymentsTable(props) {
11052
10841
  return p.transactionId;
11053
10842
  },
11054
10843
  get children() {
11055
- var _el$19 = _tmpl$428();
10844
+ var _el$19 = _tmpl$427();
11056
10845
  insert(_el$19, () => p.transactionId);
11057
10846
  return _el$19;
11058
10847
  }
@@ -11062,7 +10851,7 @@ function PaymentsTable(props) {
11062
10851
  return memo(() => !!p.refundedAt)() && p.status === "refunded";
11063
10852
  },
11064
10853
  get children() {
11065
- var _el$20 = _tmpl$525(); _el$20.firstChild;
10854
+ var _el$20 = _tmpl$524(); _el$20.firstChild;
11066
10855
  insert(_el$20, () => fmtDate(p.refundedAt), null);
11067
10856
  return _el$20;
11068
10857
  }
@@ -11072,7 +10861,7 @@ function PaymentsTable(props) {
11072
10861
  return refundable(p);
11073
10862
  },
11074
10863
  get children() {
11075
- var _el$23 = _tmpl$624();
10864
+ var _el$23 = _tmpl$623();
11076
10865
  _el$23.$$click = () => props.onRefund(p);
11077
10866
  insert(_el$23, (() => {
11078
10867
  var _c$ = memo(() => props.busyId === p.id);
@@ -11091,12 +10880,12 @@ function PaymentsTable(props) {
11091
10880
  });
11092
10881
  }
11093
10882
  delegateEvents(["click"]);
11094
- var _tmpl$171 = /* @__PURE__ */ template(`<input class=app-admin-input>`);
11095
- var _tmpl$256 = /* @__PURE__ */ template(`<form style="display:grid;grid-template-columns:1fr 1fr;gap:0.5rem"><div style="grid-column:1 / -1;display:flex;gap:0.5rem"><button type=submit class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"></button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Cancel`);
11096
- var _tmpl$339 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
11097
- var _tmpl$429 = /* @__PURE__ */ template(`<div style=display:flex;align-items:center;justify-content:space-between;gap:0.5rem><span style=font-size:0.875rem></span><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Edit name`);
11098
- var _tmpl$526 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>No name on file`);
11099
- var _tmpl$625 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
10883
+ var _tmpl$159 = /* @__PURE__ */ template(`<input class=app-admin-input>`);
10884
+ var _tmpl$251 = /* @__PURE__ */ template(`<form style="display:grid;grid-template-columns:1fr 1fr;gap:0.5rem"><div style="grid-column:1 / -1;display:flex;gap:0.5rem"><button type=submit class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"></button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Cancel`);
10885
+ var _tmpl$338 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
10886
+ var _tmpl$428 = /* @__PURE__ */ template(`<div style=display:flex;align-items:center;justify-content:space-between;gap:0.5rem><span style=font-size:0.875rem></span><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Edit name`);
10887
+ var _tmpl$525 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>No name on file`);
10888
+ var _tmpl$624 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11100
10889
  function ProfileCard(props) {
11101
10890
  const c = () => props.customer;
11102
10891
  const [editing, setEditing] = createSignal(false);
@@ -11129,26 +10918,26 @@ function ProfileCard(props) {
11129
10918
  return lines.length ? lines.join(" \xB7 ") : null;
11130
10919
  };
11131
10920
  return (() => {
11132
- var _el$ = _tmpl$339();
10921
+ var _el$ = _tmpl$338();
11133
10922
  insert(_el$, createComponent(Show, {
11134
10923
  get when() {
11135
10924
  return editing();
11136
10925
  },
11137
10926
  get fallback() {
11138
10927
  return (() => {
11139
- var _el$8 = _tmpl$429(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
11140
- insert(_el$9, () => [c().firstName, c().lastName].filter(Boolean).join(" ") || _tmpl$526());
10928
+ var _el$8 = _tmpl$428(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
10929
+ insert(_el$9, () => [c().firstName, c().lastName].filter(Boolean).join(" ") || _tmpl$525());
11141
10930
  _el$0.$$click = start;
11142
10931
  return _el$8;
11143
10932
  })();
11144
10933
  },
11145
10934
  get children() {
11146
- var _el$2 = _tmpl$256(), _el$5 = _el$2.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
10935
+ var _el$2 = _tmpl$251(), _el$5 = _el$2.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
11147
10936
  _el$2.addEventListener("submit", save);
11148
10937
  insert(_el$2, createComponent(FormRow, {
11149
10938
  label: "First name",
11150
10939
  get children() {
11151
- var _el$3 = _tmpl$171();
10940
+ var _el$3 = _tmpl$159();
11152
10941
  _el$3.$$input = (e) => setFirst(e.currentTarget.value);
11153
10942
  effect(() => _el$3.disabled = saving());
11154
10943
  effect(() => _el$3.value = first());
@@ -11158,7 +10947,7 @@ function ProfileCard(props) {
11158
10947
  insert(_el$2, createComponent(FormRow, {
11159
10948
  label: "Last name",
11160
10949
  get children() {
11161
- var _el$4 = _tmpl$171();
10950
+ var _el$4 = _tmpl$159();
11162
10951
  _el$4.$$input = (e) => setLast(e.currentTarget.value);
11163
10952
  effect(() => _el$4.disabled = saving());
11164
10953
  effect(() => _el$4.value = last());
@@ -11199,21 +10988,21 @@ function ProfileCard(props) {
11199
10988
  }, {
11200
10989
  label: "Savings member",
11201
10990
  value: c().savingsMemberId ? (() => {
11202
- var _el$10 = _tmpl$625();
10991
+ var _el$10 = _tmpl$624();
11203
10992
  insert(_el$10, () => c().savingsMemberId);
11204
10993
  return _el$10;
11205
10994
  })() : null
11206
10995
  }, {
11207
10996
  label: "Apex member",
11208
10997
  value: c().apexMemberId ? (() => {
11209
- var _el$11 = _tmpl$625();
10998
+ var _el$11 = _tmpl$624();
11210
10999
  insert(_el$11, () => c().apexMemberId);
11211
11000
  return _el$11;
11212
11001
  })() : null
11213
11002
  }, {
11214
11003
  label: "Customer id",
11215
11004
  value: (() => {
11216
- var _el$12 = _tmpl$625();
11005
+ var _el$12 = _tmpl$624();
11217
11006
  insert(_el$12, () => c().uid);
11218
11007
  return _el$12;
11219
11008
  })()
@@ -11224,14 +11013,14 @@ function ProfileCard(props) {
11224
11013
  })();
11225
11014
  }
11226
11015
  delegateEvents(["input", "click"]);
11227
- var _tmpl$180 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11228
- var _tmpl$257 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"title="Apex could not be reached; showing the last status we stored.">cached`);
11229
- var _tmpl$340 = /* @__PURE__ */ template(`<article class=app-admin-card-soft style="padding:1rem 1.25rem"><div style="display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0.5rem 0.75rem"><div style=display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;min-width:0><span style=font-weight:600></span></div><span class=app-admin-text-muted style=font-size:0.8125rem> \xB7 submitted </span></div><div style=margin-top:1rem></div><div style=margin-top:0.875rem>`);
11230
- var _tmpl$430 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"class=app-admin-text-mono style=color:var(--app-admin-primary-soft-fg)>`);
11231
- var _tmpl$527 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>`);
11232
- var _tmpl$626 = /* @__PURE__ */ template(`<span>`);
11233
- var _tmpl$724 = /* @__PURE__ */ template(`<span class=app-admin-text-mono>`);
11234
- var _tmpl$821 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11016
+ var _tmpl$160 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11017
+ var _tmpl$256 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"title="Apex could not be reached; showing the last status we stored.">cached`);
11018
+ var _tmpl$339 = /* @__PURE__ */ template(`<article class=app-admin-card-soft style="padding:1rem 1.25rem"><div style="display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0.5rem 0.75rem"><div style=display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;min-width:0><span style=font-weight:600></span></div><span class=app-admin-text-muted style=font-size:0.8125rem> \xB7 submitted </span></div><div style=margin-top:1rem></div><div style=margin-top:0.875rem>`);
11019
+ var _tmpl$429 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"class=app-admin-text-mono style=color:var(--app-admin-primary-soft-fg)>`);
11020
+ var _tmpl$526 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>`);
11021
+ var _tmpl$625 = /* @__PURE__ */ template(`<span>`);
11022
+ var _tmpl$723 = /* @__PURE__ */ template(`<span class=app-admin-text-mono>`);
11023
+ var _tmpl$820 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11235
11024
  var STAGE_TO_STEP = {
11236
11025
  done: "done",
11237
11026
  active: "active",
@@ -11273,14 +11062,14 @@ function RequestCard(props) {
11273
11062
  };
11274
11063
  const deliveryStatus = () => r().tracking?.deliveryStatus ?? r().delivery?.status ?? null;
11275
11064
  return (() => {
11276
- var _el$ = _tmpl$340(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$2.nextSibling, _el$0 = _el$9.nextSibling;
11065
+ var _el$ = _tmpl$339(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$2.nextSibling, _el$0 = _el$9.nextSibling;
11277
11066
  insert(_el$4, () => r().drugName || "Prescription request");
11278
11067
  insert(_el$3, createComponent(Show, {
11279
11068
  get when() {
11280
11069
  return r().dosage;
11281
11070
  },
11282
11071
  get children() {
11283
- var _el$5 = _tmpl$180();
11072
+ var _el$5 = _tmpl$160();
11284
11073
  insert(_el$5, () => r().dosage);
11285
11074
  return _el$5;
11286
11075
  }
@@ -11295,7 +11084,7 @@ function RequestCard(props) {
11295
11084
  return !r().live;
11296
11085
  },
11297
11086
  get children() {
11298
- return _tmpl$257();
11087
+ return _tmpl$256();
11299
11088
  }
11300
11089
  }), null);
11301
11090
  insert(_el$7, () => STATUS_WORD[r().status] ?? r().status.replace(/_/g, " "), _el$8);
@@ -11313,7 +11102,7 @@ function RequestCard(props) {
11313
11102
  return [{
11314
11103
  label: "Tracking",
11315
11104
  value: tracking() ? (() => {
11316
- var _el$1 = _tmpl$626();
11105
+ var _el$1 = _tmpl$625();
11317
11106
  insert(_el$1, (() => {
11318
11107
  var _c$ = memo(() => !!carrier());
11319
11108
  return () => _c$() ? `${carrier()} ` : "";
@@ -11324,13 +11113,13 @@ function RequestCard(props) {
11324
11113
  },
11325
11114
  get fallback() {
11326
11115
  return (() => {
11327
- var _el$12 = _tmpl$724();
11116
+ var _el$12 = _tmpl$723();
11328
11117
  insert(_el$12, tracking);
11329
11118
  return _el$12;
11330
11119
  })();
11331
11120
  },
11332
11121
  get children() {
11333
- var _el$10 = _tmpl$430();
11122
+ var _el$10 = _tmpl$429();
11334
11123
  insert(_el$10, tracking);
11335
11124
  effect(() => setAttribute(_el$10, "href", trackingUrl()));
11336
11125
  return _el$10;
@@ -11341,7 +11130,7 @@ function RequestCard(props) {
11341
11130
  return deliveryStatus();
11342
11131
  },
11343
11132
  get children() {
11344
- var _el$11 = _tmpl$527();
11133
+ var _el$11 = _tmpl$526();
11345
11134
  insert(_el$11, () => ` \xB7 ${deliveryStatus().replace(/_/g, " ")}`);
11346
11135
  return _el$11;
11347
11136
  }
@@ -11366,7 +11155,7 @@ function RequestCard(props) {
11366
11155
  }, {
11367
11156
  label: "Request id",
11368
11157
  value: (() => {
11369
- var _el$13 = _tmpl$821();
11158
+ var _el$13 = _tmpl$820();
11370
11159
  insert(_el$13, () => r().requestId);
11371
11160
  return _el$13;
11372
11161
  })()
@@ -11377,18 +11166,18 @@ function RequestCard(props) {
11377
11166
  return _el$;
11378
11167
  })();
11379
11168
  }
11380
- var _tmpl$181 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11381
- var _tmpl$258 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change amount`);
11382
- var _tmpl$341 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change schedule`);
11383
- var _tmpl$431 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">`);
11384
- var _tmpl$528 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">`);
11385
- var _tmpl$627 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-danger">`);
11386
- var _tmpl$725 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap style=margin-top:0.5rem><table class=app-admin-table style=font-size:0.8125rem><thead><tr><th>When</th><th>Period</th><th>Amount</th><th>Outcome</th><th>Reason</th><th></th></tr></thead><tbody>`);
11387
- var _tmpl$822 = /* @__PURE__ */ template(`<div style=margin-top:0.875rem><button type=button class=app-admin-link-btn> billing attempts (<!>)`);
11388
- var _tmpl$919 = /* @__PURE__ */ template(`<article class=app-admin-card-soft style="padding:1rem 1.25rem"><div style=display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:0.75rem><div style=min-width:0><div style=display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap><span style=font-weight:600></span></div><div class=app-admin-text-muted style=font-size:0.875rem;margin-top:0.25rem> every <!> days<!> \xB7 </div></div><div style=display:flex;flex-wrap:wrap;gap:0.375rem></div></div><div style=margin-top:0.875rem>`);
11389
- var _tmpl$016 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11390
- var _tmpl$188 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">Resolve`);
11391
- var _tmpl$1011 = /* @__PURE__ */ template(`<tr><td data-label=When class=app-admin-text-muted></td><td data-label=Period class=app-admin-text-muted></td><td data-label=Amount></td><td data-label=Outcome><span></span></td><td data-label=Reason class=app-admin-text-muted></td><td data-label class=app-admin-table-cell--no-label>`);
11169
+ var _tmpl$161 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11170
+ var _tmpl$257 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change amount`);
11171
+ var _tmpl$340 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change schedule`);
11172
+ var _tmpl$430 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">`);
11173
+ var _tmpl$527 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">`);
11174
+ var _tmpl$626 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-danger">`);
11175
+ var _tmpl$724 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap style=margin-top:0.5rem><table class=app-admin-table style=font-size:0.8125rem><thead><tr><th>When</th><th>Period</th><th>Amount</th><th>Outcome</th><th>Reason</th><th></th></tr></thead><tbody>`);
11176
+ var _tmpl$821 = /* @__PURE__ */ template(`<div style=margin-top:0.875rem><button type=button class=app-admin-link-btn> billing attempts (<!>)`);
11177
+ var _tmpl$918 = /* @__PURE__ */ template(`<article class=app-admin-card-soft style="padding:1rem 1.25rem"><div style=display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:0.75rem><div style=min-width:0><div style=display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap><span style=font-weight:600></span></div><div class=app-admin-text-muted style=font-size:0.875rem;margin-top:0.25rem> every <!> days<!> \xB7 </div></div><div style=display:flex;flex-wrap:wrap;gap:0.375rem></div></div><div style=margin-top:0.875rem>`);
11178
+ var _tmpl$015 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11179
+ var _tmpl$169 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">Resolve`);
11180
+ var _tmpl$1010 = /* @__PURE__ */ template(`<tr><td data-label=When class=app-admin-text-muted></td><td data-label=Period class=app-admin-text-muted></td><td data-label=Amount></td><td data-label=Outcome><span></span></td><td data-label=Reason class=app-admin-text-muted></td><td data-label class=app-admin-table-cell--no-label>`);
11392
11181
  function attemptTone(status) {
11393
11182
  if (status === "succeeded") return "success";
11394
11183
  if (status === "failed") return "danger";
@@ -11408,14 +11197,14 @@ function SubscriptionCard(props) {
11408
11197
  return null;
11409
11198
  };
11410
11199
  return (() => {
11411
- var _el$ = _tmpl$919(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$1 = _el$8.nextSibling, _el$9 = _el$1.nextSibling, _el$10 = _el$9.nextSibling; _el$10.nextSibling; var _el$11 = _el$3.nextSibling, _el$17 = _el$2.nextSibling;
11412
- insert(_el$5, () => s().medication || "Subscription");
11200
+ var _el$ = _tmpl$918(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$1 = _el$8.nextSibling, _el$9 = _el$1.nextSibling, _el$10 = _el$9.nextSibling; _el$10.nextSibling; var _el$11 = _el$3.nextSibling, _el$17 = _el$2.nextSibling;
11201
+ insert(_el$5, () => subscriptionLabel(s()));
11413
11202
  insert(_el$4, createComponent(Show, {
11414
11203
  get when() {
11415
11204
  return s().dosage;
11416
11205
  },
11417
11206
  get children() {
11418
- var _el$6 = _tmpl$181();
11207
+ var _el$6 = _tmpl$161();
11419
11208
  insert(_el$6, () => s().dosage);
11420
11209
  return _el$6;
11421
11210
  }
@@ -11442,7 +11231,7 @@ function SubscriptionCard(props) {
11442
11231
  },
11443
11232
  get children() {
11444
11233
  return [(() => {
11445
- var _el$12 = _tmpl$258();
11234
+ var _el$12 = _tmpl$257();
11446
11235
  _el$12.$$click = () => props.onEditAmount(s());
11447
11236
  effect((_p$) => {
11448
11237
  var _v$ = gateway(), _v$2 = gateway() ? "The gateway holds this price; move the subscription to platform billing first." : void 0;
@@ -11455,7 +11244,7 @@ function SubscriptionCard(props) {
11455
11244
  });
11456
11245
  return _el$12;
11457
11246
  })(), (() => {
11458
- var _el$13 = _tmpl$341();
11247
+ var _el$13 = _tmpl$340();
11459
11248
  _el$13.$$click = () => props.onEditSchedule(s());
11460
11249
  return _el$13;
11461
11250
  })()];
@@ -11466,7 +11255,7 @@ function SubscriptionCard(props) {
11466
11255
  return s().status === "active";
11467
11256
  },
11468
11257
  get children() {
11469
- var _el$14 = _tmpl$431();
11258
+ var _el$14 = _tmpl$430();
11470
11259
  _el$14.$$click = () => props.onPause(s());
11471
11260
  insert(_el$14, () => busy("pause") ? "Pausing\u2026" : "Pause");
11472
11261
  effect(() => _el$14.disabled = busy("pause"));
@@ -11478,7 +11267,7 @@ function SubscriptionCard(props) {
11478
11267
  return s().status === "paused";
11479
11268
  },
11480
11269
  get children() {
11481
- var _el$15 = _tmpl$528();
11270
+ var _el$15 = _tmpl$527();
11482
11271
  _el$15.$$click = () => props.onResume(s());
11483
11272
  insert(_el$15, () => busy("resume") ? "Resuming\u2026" : "Resume");
11484
11273
  effect(() => _el$15.disabled = busy("resume"));
@@ -11490,7 +11279,7 @@ function SubscriptionCard(props) {
11490
11279
  return live();
11491
11280
  },
11492
11281
  get children() {
11493
- var _el$16 = _tmpl$627();
11282
+ var _el$16 = _tmpl$626();
11494
11283
  _el$16.$$click = () => props.onCancel(s());
11495
11284
  insert(_el$16, () => busy("cancel") ? "\u2026" : "Cancel");
11496
11285
  effect(() => _el$16.disabled = busy("cancel"));
@@ -11523,7 +11312,7 @@ function SubscriptionCard(props) {
11523
11312
  }, {
11524
11313
  label: "Gateway id",
11525
11314
  value: s().gatewaySubscriptionId ? (() => {
11526
- var _el$27 = _tmpl$016();
11315
+ var _el$27 = _tmpl$015();
11527
11316
  insert(_el$27, () => s().gatewaySubscriptionId);
11528
11317
  return _el$27;
11529
11318
  })() : null
@@ -11535,7 +11324,7 @@ function SubscriptionCard(props) {
11535
11324
  return attempts().length > 0;
11536
11325
  },
11537
11326
  get children() {
11538
- var _el$18 = _tmpl$822(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$20.nextSibling; _el$22.nextSibling;
11327
+ var _el$18 = _tmpl$821(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$20.nextSibling; _el$22.nextSibling;
11539
11328
  _el$19.$$click = () => setShowAttempts((v) => !v);
11540
11329
  insert(_el$19, () => showAttempts() ? "Hide" : "Show", _el$20);
11541
11330
  insert(_el$19, () => attempts().length, _el$22);
@@ -11544,13 +11333,13 @@ function SubscriptionCard(props) {
11544
11333
  return showAttempts();
11545
11334
  },
11546
11335
  get children() {
11547
- var _el$23 = _tmpl$725(), _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
11336
+ var _el$23 = _tmpl$724(), _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
11548
11337
  insert(_el$26, createComponent(For, {
11549
11338
  get each() {
11550
11339
  return attempts();
11551
11340
  },
11552
11341
  children: (a) => (() => {
11553
- var _el$28 = _tmpl$1011(), _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$30.nextSibling, _el$32 = _el$31.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$32.nextSibling, _el$35 = _el$34.nextSibling;
11342
+ var _el$28 = _tmpl$1010(), _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$30.nextSibling, _el$32 = _el$31.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$32.nextSibling, _el$35 = _el$34.nextSibling;
11554
11343
  insert(_el$29, () => fmtDate(a.createdAt));
11555
11344
  insert(_el$30, () => (a.billingPeriod ?? 0) + 1, null);
11556
11345
  insert(_el$30, createComponent(Show, {
@@ -11569,7 +11358,7 @@ function SubscriptionCard(props) {
11569
11358
  return a.status === "pending" || a.status === "indeterminate";
11570
11359
  },
11571
11360
  get children() {
11572
- var _el$36 = _tmpl$188();
11361
+ var _el$36 = _tmpl$169();
11573
11362
  _el$36.$$click = () => props.onResolveAttempt(s(), a);
11574
11363
  effect(() => _el$36.disabled = props.busy === `resolve-${a.id}`);
11575
11364
  return _el$36;
@@ -11591,11 +11380,11 @@ function SubscriptionCard(props) {
11591
11380
  })();
11592
11381
  }
11593
11382
  delegateEvents(["click"]);
11594
- var _tmpl$189 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>Showing the latest <!>.`);
11595
- var _tmpl$259 = /* @__PURE__ */ template(`<div class=app-admin-section-stack style=gap:0.5rem><div class=app-admin-text-muted style=font-size:0.8125rem> thread</div><ul style=list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0.5rem>`);
11596
- var _tmpl$343 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>No support conversations.`);
11597
- var _tmpl$432 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Open`);
11598
- var _tmpl$529 = /* @__PURE__ */ template(`<li style=display:flex;align-items:center;justify-content:space-between;gap:0.5rem><div style=min-width:0><div style=font-size:0.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap></div><div class=app-admin-text-muted style=font-size:0.75rem>`);
11383
+ var _tmpl$170 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>Showing the latest <!>.`);
11384
+ var _tmpl$258 = /* @__PURE__ */ template(`<div class=app-admin-section-stack style=gap:0.5rem><div class=app-admin-text-muted style=font-size:0.8125rem> thread</div><ul style=list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0.5rem>`);
11385
+ var _tmpl$341 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>No support conversations.`);
11386
+ var _tmpl$431 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Open`);
11387
+ var _tmpl$528 = /* @__PURE__ */ template(`<li style=display:flex;align-items:center;justify-content:space-between;gap:0.5rem><div style=min-width:0><div style=font-size:0.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap></div><div class=app-admin-text-muted style=font-size:0.75rem>`);
11599
11388
  var STATUS_WORD2 = {
11600
11389
  open: "needs reply",
11601
11390
  pending: "awaiting customer",
@@ -11608,10 +11397,10 @@ function SupportSummary(props) {
11608
11397
  return s().threadCount > 0;
11609
11398
  },
11610
11399
  get fallback() {
11611
- return _tmpl$343();
11400
+ return _tmpl$341();
11612
11401
  },
11613
11402
  get children() {
11614
- var _el$ = _tmpl$259(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
11403
+ var _el$ = _tmpl$258(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
11615
11404
  insert(_el$2, () => s().threadCount, _el$3);
11616
11405
  insert(_el$2, () => s().threadCount === 1 ? "" : "s", null);
11617
11406
  insert(_el$2, createComponent(Show, {
@@ -11627,7 +11416,7 @@ function SupportSummary(props) {
11627
11416
  return s().threads;
11628
11417
  },
11629
11418
  children: (t) => (() => {
11630
- var _el$0 = _tmpl$529(), _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
11419
+ var _el$0 = _tmpl$528(), _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
11631
11420
  insert(_el$10, () => t.subject || "No subject");
11632
11421
  insert(_el$11, () => STATUS_WORD2[t.status] ?? t.status, null);
11633
11422
  insert(_el$11, createComponent(Show, {
@@ -11650,7 +11439,7 @@ function SupportSummary(props) {
11650
11439
  });
11651
11440
  },
11652
11441
  get children() {
11653
- var _el$12 = _tmpl$432();
11442
+ var _el$12 = _tmpl$431();
11654
11443
  _el$12.$$click = () => props.onOpenThread(t.id);
11655
11444
  return _el$12;
11656
11445
  }
@@ -11664,7 +11453,7 @@ function SupportSummary(props) {
11664
11453
  return s().threadCount > s().threads.length;
11665
11454
  },
11666
11455
  get children() {
11667
- var _el$5 = _tmpl$189(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling; _el$8.nextSibling;
11456
+ var _el$5 = _tmpl$170(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling; _el$8.nextSibling;
11668
11457
  insert(_el$5, () => s().threads.length, _el$8);
11669
11458
  return _el$5;
11670
11459
  }
@@ -11676,26 +11465,26 @@ function SupportSummary(props) {
11676
11465
  delegateEvents(["click"]);
11677
11466
 
11678
11467
  // src/pages/admin/customers/CustomerDetail.tsx
11679
- var _tmpl$190 = /* @__PURE__ */ template(`<div class=app-admin-detail>`);
11680
- var _tmpl$260 = /* @__PURE__ */ template(`<button type=button class=app-admin-back><span aria-hidden=true>\u2190</span>Customers`);
11681
- var _tmpl$344 = /* @__PURE__ */ template(`<div style=text-align:center><button type=button class=app-admin-link-btn>Try again`);
11682
- var _tmpl$433 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>Some sections did not load (<!>). <button type=button class=app-admin-link-btn>Reload`);
11683
- var _tmpl$530 = /* @__PURE__ */ template(`<div class=app-admin-alerts data-testid=customer-attention>`);
11684
- var _tmpl$628 = /* @__PURE__ */ template(`<span style=display:inline-flex;align-items:center;gap:0.5rem><input type=email aria-label="Customer email"class=app-admin-input style="width:16rem;padding:0.25rem 0.625rem"><button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"></button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Cancel`);
11685
- var _tmpl$726 = /* @__PURE__ */ template(`<span>`);
11686
- var _tmpl$823 = /* @__PURE__ */ template(`<span>Joined `);
11687
- var _tmpl$920 = /* @__PURE__ */ template(`<span style=display:inline-flex;align-items:center;gap:0.5rem><span></span><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm"style="padding:0.1rem 0.5rem">Edit`);
11688
- var _tmpl$017 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--info"style=text-transform:none>Savings member`);
11689
- var _tmpl$191 = /* @__PURE__ */ template(`<span style=font-size:0.9375rem>`);
11690
- var _tmpl$1012 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">`);
11691
- var _tmpl$1114 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
11692
- var _tmpl$1211 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>Older requests are shown from stored status only.`);
11693
- var _tmpl$1311 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Items</th><th>Total</th><th>Status</th></tr></thead><tbody>`);
11468
+ var _tmpl$171 = /* @__PURE__ */ template(`<div class=app-admin-detail>`);
11469
+ var _tmpl$259 = /* @__PURE__ */ template(`<button type=button class=app-admin-back><span aria-hidden=true>\u2190</span>Customers`);
11470
+ var _tmpl$343 = /* @__PURE__ */ template(`<div style=text-align:center><button type=button class=app-admin-link-btn>Try again`);
11471
+ var _tmpl$432 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>Some sections did not load (<!>). <button type=button class=app-admin-link-btn>Reload`);
11472
+ var _tmpl$529 = /* @__PURE__ */ template(`<div class=app-admin-alerts data-testid=customer-attention>`);
11473
+ var _tmpl$627 = /* @__PURE__ */ template(`<span style=display:inline-flex;align-items:center;gap:0.5rem><input type=email aria-label="Customer email"class=app-admin-input style="width:16rem;padding:0.25rem 0.625rem"><button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"></button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Cancel`);
11474
+ var _tmpl$725 = /* @__PURE__ */ template(`<span>`);
11475
+ var _tmpl$822 = /* @__PURE__ */ template(`<span>Joined `);
11476
+ var _tmpl$919 = /* @__PURE__ */ template(`<span style=display:inline-flex;align-items:center;gap:0.5rem><span></span><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm"style="padding:0.1rem 0.5rem">Edit`);
11477
+ var _tmpl$016 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--info"style=text-transform:none>Savings member`);
11478
+ var _tmpl$179 = /* @__PURE__ */ template(`<span style=font-size:0.9375rem>`);
11479
+ var _tmpl$1011 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">`);
11480
+ var _tmpl$1113 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
11481
+ var _tmpl$1210 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>Older requests are shown from stored status only.`);
11482
+ var _tmpl$1310 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Items</th><th>Total</th><th>Status</th></tr></thead><tbody>`);
11694
11483
  var _tmpl$1410 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.875rem>No subscriptions.`);
11695
11484
  var _tmpl$1510 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm"title="Cancel any prescription request still awaiting prescriber review. Approved and completed prescriptions are untouched.">`);
11696
11485
  var _tmpl$1610 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.875rem>No prescription requests.`);
11697
11486
  var _tmpl$1710 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Items></td><td data-label=Total></td><td data-label=Status>`);
11698
- var _tmpl$1810 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn>`);
11487
+ var _tmpl$188 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn>`);
11699
11488
  var _tmpl$198 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.875rem>Nothing recorded yet.`);
11700
11489
  var _tmpl$207 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.875rem>The <!> charge for period <!> is <strong></strong>. Check the gateway for this transaction before choosing.`);
11701
11490
  var _tmpl$2113 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem><button type=button class="app-admin-btn app-admin-btn-ghost">The gateway did not capture it: mark failed so billing retries</button><button type=button class="app-admin-btn app-admin-btn-ghost">The gateway captured it: mark succeeded`);
@@ -11722,8 +11511,6 @@ function CustomerDetail(props) {
11722
11511
  }
11723
11512
  });
11724
11513
  const [busy, setBusy] = createSignal(null);
11725
- const [previewToken, setPreviewToken] = createSignal(null);
11726
- const [previewName, setPreviewName] = createSignal("");
11727
11514
  const [editingEmail, setEditingEmail] = createSignal(false);
11728
11515
  const [emailDraft, setEmailDraft] = createSignal("");
11729
11516
  const [savingEmail, setSavingEmail] = createSignal(false);
@@ -11747,15 +11534,6 @@ function CustomerDetail(props) {
11747
11534
  setBusy(null);
11748
11535
  }
11749
11536
  };
11750
- const handleViewAsCustomer = () => withBusy("impersonate", async () => {
11751
- try {
11752
- const res = await adminApi.impersonateCustomer(props.uid);
11753
- setPreviewName([res.customer.firstName, res.customer.lastName].filter(Boolean).join(" ") || res.customer.email);
11754
- setPreviewToken(res.token);
11755
- } catch (err) {
11756
- toastError(err instanceof Error ? err.message : "Could not open customer view");
11757
- }
11758
- });
11759
11537
  const canSendReset = () => !!props.passwordResetRedirectUrl || !!o()?.tenant.passwordResetAvailable;
11760
11538
  const handleSendReset = () => {
11761
11539
  if (!confirm("Send a password reset email to this customer?")) return;
@@ -11798,7 +11576,7 @@ function CustomerDetail(props) {
11798
11576
  }
11799
11577
  };
11800
11578
  const handleCancel = (sub) => {
11801
- if (!confirm(`Cancel the ${sub.medication || ""} subscription? Billing stops now and any unapproved prescription requests are withdrawn.`)) return;
11579
+ if (!confirm(`Cancel the ${subscriptionLabel(sub, "")} subscription? Billing stops now and any unapproved prescription requests are withdrawn.`)) return;
11802
11580
  void withBusy(`cancel-${sub.id}`, async () => {
11803
11581
  try {
11804
11582
  const res = await adminApi.cancelSubscription(sub.id);
@@ -11916,7 +11694,7 @@ function CustomerDetail(props) {
11916
11694
  try {
11917
11695
  await adminApi.cancelSubscription(sub.id);
11918
11696
  } catch (err) {
11919
- failed.push(`${sub.medication || sub.id}: ${err instanceof Error ? err.message : "cancel failed"}`);
11697
+ failed.push(`${subscriptionLabel(sub, sub.id)}: ${err instanceof Error ? err.message : "cancel failed"}`);
11920
11698
  }
11921
11699
  }
11922
11700
  if (failed.length > 0) {
@@ -11983,7 +11761,7 @@ function CustomerDetail(props) {
11983
11761
  };
11984
11762
  const pendingRequests = () => (o()?.requests.items ?? []).filter((r) => r.status === "pending");
11985
11763
  return (() => {
11986
- var _el$ = _tmpl$190();
11764
+ var _el$ = _tmpl$171();
11987
11765
  insert(_el$, createComponent(Show, {
11988
11766
  get when() {
11989
11767
  return !overview.loading;
@@ -11998,7 +11776,7 @@ function CustomerDetail(props) {
11998
11776
  },
11999
11777
  get fallback() {
12000
11778
  return [(() => {
12001
- var _el$2 = _tmpl$260();
11779
+ var _el$2 = _tmpl$259();
12002
11780
  addEventListener(_el$2, "click", props.onBack, true);
12003
11781
  return _el$2;
12004
11782
  })(), createComponent(EmptyState, {
@@ -12006,7 +11784,7 @@ function CustomerDetail(props) {
12006
11784
  return loadError() ?? "This customer could not be loaded.";
12007
11785
  }
12008
11786
  }), (() => {
12009
- var _el$3 = _tmpl$344(), _el$4 = _el$3.firstChild;
11787
+ var _el$3 = _tmpl$343(), _el$4 = _el$3.firstChild;
12010
11788
  _el$4.$$click = () => refetch();
12011
11789
  return _el$3;
12012
11790
  })()];
@@ -12029,14 +11807,14 @@ function CustomerDetail(props) {
12029
11807
  },
12030
11808
  get fallback() {
12031
11809
  return (() => {
12032
- var _el$17 = _tmpl$920(), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling;
11810
+ var _el$17 = _tmpl$919(), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling;
12033
11811
  insert(_el$18, () => c().email);
12034
11812
  _el$19.$$click = () => startEditEmail(c().email);
12035
11813
  return _el$17;
12036
11814
  })();
12037
11815
  },
12038
11816
  get children() {
12039
- var _el$10 = _tmpl$628(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling;
11817
+ var _el$10 = _tmpl$627(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling;
12040
11818
  _el$11.$$input = (e) => setEmailDraft(e.currentTarget.value);
12041
11819
  _el$12.$$click = handleSaveEmail;
12042
11820
  insert(_el$12, () => savingEmail() ? "\u2026" : "Save");
@@ -12060,12 +11838,12 @@ function CustomerDetail(props) {
12060
11838
  return c().phone;
12061
11839
  },
12062
11840
  get children() {
12063
- var _el$14 = _tmpl$726();
11841
+ var _el$14 = _tmpl$725();
12064
11842
  insert(_el$14, () => c().phone);
12065
11843
  return _el$14;
12066
11844
  }
12067
11845
  }), (() => {
12068
- var _el$15 = _tmpl$823(); _el$15.firstChild;
11846
+ var _el$15 = _tmpl$822(); _el$15.firstChild;
12069
11847
  insert(_el$15, () => fmtDate(c().createdAt), null);
12070
11848
  return _el$15;
12071
11849
  })()];
@@ -12080,7 +11858,7 @@ function CustomerDetail(props) {
12080
11858
  return c().savingsMemberId;
12081
11859
  },
12082
11860
  get children() {
12083
- return _tmpl$017();
11861
+ return _tmpl$016();
12084
11862
  }
12085
11863
  }), createComponent(Show, {
12086
11864
  get when() {
@@ -12094,37 +11872,31 @@ function CustomerDetail(props) {
12094
11872
  });
12095
11873
  }
12096
11874
  }), (() => {
12097
- var _el$21 = _tmpl$191();
11875
+ var _el$21 = _tmpl$179();
12098
11876
  insert(_el$21, reason);
12099
11877
  return _el$21;
12100
11878
  })()];
12101
11879
  },
12102
11880
  get actions() {
12103
- return [(() => {
12104
- var _el$22 = _tmpl$1012();
12105
- _el$22.$$click = handleViewAsCustomer;
12106
- insert(_el$22, () => busy() === "impersonate" ? "Opening\u2026" : "View as customer");
12107
- effect(() => _el$22.disabled = busy() === "impersonate");
12108
- return _el$22;
12109
- })(), createComponent(Show, {
11881
+ return createComponent(Show, {
12110
11882
  get when() {
12111
11883
  return canSendReset();
12112
11884
  },
12113
11885
  get children() {
12114
- var _el$23 = _tmpl$1012();
12115
- _el$23.$$click = handleSendReset;
12116
- insert(_el$23, () => busy() === "send-reset" ? "Sending\u2026" : "Send password reset");
12117
- effect(() => _el$23.disabled = busy() === "send-reset");
12118
- return _el$23;
11886
+ var _el$22 = _tmpl$1011();
11887
+ _el$22.$$click = handleSendReset;
11888
+ insert(_el$22, () => busy() === "send-reset" ? "Sending\u2026" : "Send password reset");
11889
+ effect(() => _el$22.disabled = busy() === "send-reset");
11890
+ return _el$22;
12119
11891
  }
12120
- })];
11892
+ });
12121
11893
  }
12122
11894
  }), createComponent(Show, {
12123
11895
  get when() {
12124
11896
  return ov().partial.length > 0;
12125
11897
  },
12126
11898
  get children() {
12127
- var _el$5 = _tmpl$433(), _el$6 = _el$5.firstChild, _el$0 = _el$6.nextSibling, _el$7 = _el$0.nextSibling, _el$9 = _el$7.nextSibling;
11899
+ var _el$5 = _tmpl$432(), _el$6 = _el$5.firstChild, _el$0 = _el$6.nextSibling, _el$7 = _el$0.nextSibling, _el$9 = _el$7.nextSibling;
12128
11900
  insert(_el$5, () => ov().partial.join(", "), _el$0);
12129
11901
  _el$9.$$click = () => refetch();
12130
11902
  return _el$5;
@@ -12134,7 +11906,7 @@ function CustomerDetail(props) {
12134
11906
  return attention().length > 0;
12135
11907
  },
12136
11908
  get children() {
12137
- var _el$1 = _tmpl$530();
11909
+ var _el$1 = _tmpl$529();
12138
11910
  insert(_el$1, createComponent(For, {
12139
11911
  get each() {
12140
11912
  return attention();
@@ -12186,8 +11958,8 @@ function CustomerDetail(props) {
12186
11958
  return _tmpl$1410();
12187
11959
  },
12188
11960
  get children() {
12189
- var _el$24 = _tmpl$1114();
12190
- insert(_el$24, createComponent(For, {
11961
+ var _el$23 = _tmpl$1113();
11962
+ insert(_el$23, createComponent(For, {
12191
11963
  get each() {
12192
11964
  return [...ov().subscriptions].sort((a, b) => Date.parse(b.createdAt ?? "") - Date.parse(a.createdAt ?? ""));
12193
11965
  },
@@ -12207,7 +11979,7 @@ function CustomerDetail(props) {
12207
11979
  })
12208
11980
  })
12209
11981
  }));
12210
- return _el$24;
11982
+ return _el$23;
12211
11983
  }
12212
11984
  });
12213
11985
  }
@@ -12218,14 +11990,14 @@ function CustomerDetail(props) {
12218
11990
  },
12219
11991
  get action() {
12220
11992
  return (() => {
12221
- var _el$32 = _tmpl$1510();
12222
- _el$32.$$click = handleCancelUnapprovedRequests;
12223
- insert(_el$32, (() => {
11993
+ var _el$31 = _tmpl$1510();
11994
+ _el$31.$$click = handleCancelUnapprovedRequests;
11995
+ insert(_el$31, (() => {
12224
11996
  var _c$ = memo(() => busy() === "cancel-requests");
12225
11997
  return () => _c$() ? "Cancelling\u2026" : memo(() => pendingRequests().length > 0)() ? `Cancel unapproved requests (${pendingRequests().length})` : "Cancel unapproved requests";
12226
11998
  })());
12227
- effect(() => _el$32.disabled = busy() === "cancel-requests");
12228
- return _el$32;
11999
+ effect(() => _el$31.disabled = busy() === "cancel-requests");
12000
+ return _el$31;
12229
12001
  })();
12230
12002
  },
12231
12003
  get children() {
@@ -12237,8 +12009,8 @@ function CustomerDetail(props) {
12237
12009
  return _tmpl$1610();
12238
12010
  },
12239
12011
  get children() {
12240
- var _el$25 = _tmpl$1114();
12241
- insert(_el$25, createComponent(For, {
12012
+ var _el$24 = _tmpl$1113();
12013
+ insert(_el$24, createComponent(For, {
12242
12014
  get each() {
12243
12015
  return [...ov().requests.items].sort((a, b) => Date.parse(b.createdAt ?? "") - Date.parse(a.createdAt ?? ""));
12244
12016
  },
@@ -12249,15 +12021,15 @@ function CustomerDetail(props) {
12249
12021
  }
12250
12022
  })
12251
12023
  }), null);
12252
- insert(_el$25, createComponent(Show, {
12024
+ insert(_el$24, createComponent(Show, {
12253
12025
  get when() {
12254
12026
  return ov().requests.capped;
12255
12027
  },
12256
12028
  get children() {
12257
- return _tmpl$1211();
12029
+ return _tmpl$1210();
12258
12030
  }
12259
12031
  }), null);
12260
- return _el$25;
12032
+ return _el$24;
12261
12033
  }
12262
12034
  });
12263
12035
  }
@@ -12290,25 +12062,25 @@ function CustomerDetail(props) {
12290
12062
  },
12291
12063
  flush: true,
12292
12064
  get children() {
12293
- var _el$27 = _tmpl$1311(), _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling;
12294
- insert(_el$30, createComponent(For, {
12065
+ var _el$26 = _tmpl$1310(), _el$27 = _el$26.firstChild, _el$28 = _el$27.firstChild, _el$29 = _el$28.nextSibling;
12066
+ insert(_el$29, createComponent(For, {
12295
12067
  get each() {
12296
12068
  return ov().orders;
12297
12069
  },
12298
12070
  children: (order) => (() => {
12299
- var _el$34 = _tmpl$1710(), _el$35 = _el$34.firstChild, _el$36 = _el$35.nextSibling, _el$37 = _el$36.nextSibling, _el$38 = _el$37.nextSibling;
12300
- insert(_el$35, () => fmtDate(order.createdAt));
12301
- insert(_el$36, () => order.items.map((i) => `${i.quantity && i.quantity > 1 ? `${i.quantity}\xD7 ` : ""}${i.name ?? i.productId ?? "item"}${i.dosage ? ` (${i.dosage})` : ""}`).join(", ") || "\u2014");
12302
- insert(_el$37, () => centsToUsd(order.totalCents));
12303
- insert(_el$38, createComponent(StatusBadge, {
12071
+ var _el$33 = _tmpl$1710(), _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling, _el$36 = _el$35.nextSibling, _el$37 = _el$36.nextSibling;
12072
+ insert(_el$34, () => fmtDate(order.createdAt));
12073
+ insert(_el$35, () => order.items.map((i) => `${i.quantity && i.quantity > 1 ? `${i.quantity}\xD7 ` : ""}${i.name ?? i.productId ?? "item"}${i.dosage ? ` (${i.dosage})` : ""}`).join(", ") || "\u2014");
12074
+ insert(_el$36, () => centsToUsd(order.totalCents));
12075
+ insert(_el$37, createComponent(StatusBadge, {
12304
12076
  get status() {
12305
12077
  return order.status;
12306
12078
  }
12307
12079
  }));
12308
- return _el$34;
12080
+ return _el$33;
12309
12081
  })()
12310
12082
  }));
12311
- return _el$27;
12083
+ return _el$26;
12312
12084
  }
12313
12085
  });
12314
12086
  }
@@ -12357,10 +12129,10 @@ function CustomerDetail(props) {
12357
12129
  },
12358
12130
  get action() {
12359
12131
  return memo(() => timeline().length > TIMELINE_PREVIEW)() ? (() => {
12360
- var _el$39 = _tmpl$1810();
12361
- _el$39.$$click = () => setAllTimeline((v) => !v);
12362
- insert(_el$39, () => allTimeline() ? "Show recent" : "Show all");
12363
- return _el$39;
12132
+ var _el$38 = _tmpl$188();
12133
+ _el$38.$$click = () => setAllTimeline((v) => !v);
12134
+ insert(_el$38, () => allTimeline() ? "Show recent" : "Show all");
12135
+ return _el$38;
12364
12136
  })() : void 0;
12365
12137
  },
12366
12138
  get children() {
@@ -12429,6 +12201,7 @@ function CustomerDetail(props) {
12429
12201
  return liveSubs().map((s) => ({
12430
12202
  id: s.id,
12431
12203
  medication: s.medication,
12204
+ medicationName: s.medicationName,
12432
12205
  amountCents: s.amountCents ?? 0,
12433
12206
  intervalDays: s.intervalDays ?? void 0,
12434
12207
  nextChargeAt: s.nextChargeAt,
@@ -12448,61 +12221,47 @@ function CustomerDetail(props) {
12448
12221
  onClose: () => setResolveTarget(null),
12449
12222
  get children() {
12450
12223
  return [(() => {
12451
- var _el$41 = _tmpl$207(), _el$42 = _el$41.firstChild, _el$47 = _el$42.nextSibling, _el$43 = _el$47.nextSibling, _el$48 = _el$43.nextSibling, _el$44 = _el$48.nextSibling, _el$45 = _el$44.nextSibling, _el$46 = _el$45.nextSibling;
12452
- insert(_el$41, () => centsToUsd(t().attempt.amountCents), _el$47);
12453
- insert(_el$41, () => (t().attempt.billingPeriod ?? 0) + 1, _el$48);
12454
- insert(_el$45, () => t().attempt.status);
12455
- insert(_el$41, (() => {
12224
+ var _el$40 = _tmpl$207(), _el$41 = _el$40.firstChild, _el$46 = _el$41.nextSibling, _el$42 = _el$46.nextSibling, _el$47 = _el$42.nextSibling, _el$43 = _el$47.nextSibling, _el$44 = _el$43.nextSibling, _el$45 = _el$44.nextSibling;
12225
+ insert(_el$40, () => centsToUsd(t().attempt.amountCents), _el$46);
12226
+ insert(_el$40, () => (t().attempt.billingPeriod ?? 0) + 1, _el$47);
12227
+ insert(_el$44, () => t().attempt.status);
12228
+ insert(_el$40, (() => {
12456
12229
  var _c$2 = memo(() => !!t().attempt.errorMessage);
12457
12230
  return () => _c$2() ? ` (${t().attempt.errorMessage})` : "";
12458
- })(), _el$46);
12459
- return _el$41;
12231
+ })(), _el$45);
12232
+ return _el$40;
12460
12233
  })(), (() => {
12461
- var _el$49 = _tmpl$2113(), _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling;
12462
- _el$50.$$click = () => resolveAttempt("failed");
12463
- _el$51.$$click = () => resolveAttempt("succeeded");
12234
+ var _el$48 = _tmpl$2113(), _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling;
12235
+ _el$49.$$click = () => resolveAttempt("failed");
12236
+ _el$50.$$click = () => resolveAttempt("succeeded");
12464
12237
  effect((_p$) => {
12465
12238
  var _v$4 = busy() !== null, _v$5 = busy() !== null;
12466
- _v$4 !== _p$.e && (_el$50.disabled = _p$.e = _v$4);
12467
- _v$5 !== _p$.t && (_el$51.disabled = _p$.t = _v$5);
12239
+ _v$4 !== _p$.e && (_el$49.disabled = _p$.e = _v$4);
12240
+ _v$5 !== _p$.t && (_el$50.disabled = _p$.t = _v$5);
12468
12241
  return _p$;
12469
12242
  }, {
12470
12243
  e: void 0,
12471
12244
  t: void 0
12472
12245
  });
12473
- return _el$49;
12246
+ return _el$48;
12474
12247
  })()];
12475
12248
  }
12476
12249
  })
12477
12250
  }), null);
12478
- insert(_el$, createComponent(Show, {
12479
- get when() {
12480
- return previewToken();
12481
- },
12482
- children: (token) => createComponent(PatientDashboardPreview, {
12483
- get token() {
12484
- return token();
12485
- },
12486
- get customerName() {
12487
- return previewName();
12488
- },
12489
- onClose: () => setPreviewToken(null)
12490
- })
12491
- }), null);
12492
12251
  return _el$;
12493
12252
  })();
12494
12253
  }
12495
12254
  delegateEvents(["click", "input"]);
12496
- var _tmpl$199 = /* @__PURE__ */ template(`<label style=display:inline-flex;align-items:center;gap:0.375rem><input type=checkbox>Savings members only`);
12497
- var _tmpl$261 = /* @__PURE__ */ template(`<div style="padding:0.75rem 1rem;border-top:1px solid var(--app-admin-border-soft);display:flex;justify-content:center"><button type=button class="app-admin-btn app-admin-btn-ghost">`);
12498
- var _tmpl$345 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Customer</th><th>Status</th><th>Plan</th><th>Prescription</th><th>Last activity</th><th>Joined</th></tr></thead><tbody>`);
12499
- var _tmpl$434 = /* @__PURE__ */ template(`<div style=margin-top:0.75rem><button type=button class=app-admin-link-btn>Retry`);
12500
- var _tmpl$531 = /* @__PURE__ */ template(`<div><div style=display:flex;flex-direction:column;gap:0.875rem;margin-bottom:1.25rem><div style=max-width:28rem><input type=search placeholder="Search by name or email"aria-label="Search customers"class=app-admin-input></div><div class=app-admin-chips role=group aria-label="Filter by status"></div><div style=display:flex;flex-wrap:wrap;gap:1rem;font-size:0.8125rem;color:var(--app-admin-fg-muted)><label style=display:inline-flex;align-items:center;gap:0.375rem><input type=checkbox>Never completed intake`);
12501
- var _tmpl$629 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.8125rem>`);
12502
- var _tmpl$727 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.75rem>`);
12503
- var _tmpl$824 = /* @__PURE__ */ template(`<span style=text-transform:capitalize>`);
12504
- var _tmpl$921 = /* @__PURE__ */ template(`<tr class=is-clickable tabindex=0><td data-label=Customer class=app-admin-table-cell--title><div style=font-weight:500></div></td><td data-label=Status><div style=display:flex;flex-direction:column;gap:0.25rem;align-items:flex-start></div></td><td data-label=Plan class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Prescription class=app-admin-text-muted style=font-size:0.8125rem;text-transform:capitalize></td><td data-label="Last activity"class=app-admin-text-muted></td><td data-label=Joined class=app-admin-text-muted>`);
12505
- var _tmpl$018 = /* @__PURE__ */ template(`<span>\u2014`);
12255
+ var _tmpl$180 = /* @__PURE__ */ template(`<label style=display:inline-flex;align-items:center;gap:0.375rem><input type=checkbox>Savings members only`);
12256
+ var _tmpl$260 = /* @__PURE__ */ template(`<div style="padding:0.75rem 1rem;border-top:1px solid var(--app-admin-border-soft);display:flex;justify-content:center"><button type=button class="app-admin-btn app-admin-btn-ghost">`);
12257
+ var _tmpl$344 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Customer</th><th>Status</th><th>Plan</th><th>Prescription</th><th>Last activity</th><th>Joined</th></tr></thead><tbody>`);
12258
+ var _tmpl$433 = /* @__PURE__ */ template(`<div style=margin-top:0.75rem><button type=button class=app-admin-link-btn>Retry`);
12259
+ var _tmpl$530 = /* @__PURE__ */ template(`<div><div style=display:flex;flex-direction:column;gap:0.875rem;margin-bottom:1.25rem><div style=max-width:28rem><input type=search placeholder="Search by name or email"aria-label="Search customers"class=app-admin-input></div><div class=app-admin-chips role=group aria-label="Filter by status"></div><div style=display:flex;flex-wrap:wrap;gap:1rem;font-size:0.8125rem;color:var(--app-admin-fg-muted)><label style=display:inline-flex;align-items:center;gap:0.375rem><input type=checkbox>Never completed intake`);
12260
+ var _tmpl$628 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.8125rem>`);
12261
+ var _tmpl$726 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.75rem>`);
12262
+ var _tmpl$823 = /* @__PURE__ */ template(`<span style=text-transform:capitalize>`);
12263
+ var _tmpl$920 = /* @__PURE__ */ template(`<tr class=is-clickable tabindex=0><td data-label=Customer class=app-admin-table-cell--title><div style=font-weight:500></div></td><td data-label=Status><div style=display:flex;flex-direction:column;gap:0.25rem;align-items:flex-start></div></td><td data-label=Plan class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Prescription class=app-admin-text-muted style=font-size:0.8125rem;text-transform:capitalize></td><td data-label="Last activity"class=app-admin-text-muted></td><td data-label=Joined class=app-admin-text-muted>`);
12264
+ var _tmpl$017 = /* @__PURE__ */ template(`<span>\u2014`);
12506
12265
  var PAGE = 50;
12507
12266
  function hint(row) {
12508
12267
  const f = row.facts;
@@ -12612,7 +12371,7 @@ function CustomerList(props) {
12612
12371
  };
12613
12372
  const showSavingsToggle = () => savingsOnly() || rows().some((r) => r.facts?.isSavingsMember);
12614
12373
  return (() => {
12615
- var _el$ = _tmpl$531(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.nextSibling, _el$9 = _el$6.firstChild, _el$0 = _el$9.firstChild;
12374
+ var _el$ = _tmpl$530(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.nextSibling, _el$9 = _el$6.firstChild, _el$0 = _el$9.firstChild;
12616
12375
  insert(_el$, createComponent(PageTitle, {
12617
12376
  subtitle: "Every account on this site, with where each one is in the journey.",
12618
12377
  children: "Customers"
@@ -12648,7 +12407,7 @@ function CustomerList(props) {
12648
12407
  return showSavingsToggle();
12649
12408
  },
12650
12409
  get children() {
12651
- var _el$7 = _tmpl$199(), _el$8 = _el$7.firstChild;
12410
+ var _el$7 = _tmpl$180(), _el$8 = _el$7.firstChild;
12652
12411
  _el$8.addEventListener("change", (e) => setSavingsOnly(e.currentTarget.checked));
12653
12412
  effect(() => _el$8.checked = savingsOnly());
12654
12413
  return _el$7;
@@ -12663,7 +12422,7 @@ function CustomerList(props) {
12663
12422
  return createComponent(LoadingSpinner, {});
12664
12423
  },
12665
12424
  get children() {
12666
- var _el$1 = _tmpl$345(), _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
12425
+ var _el$1 = _tmpl$344(), _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
12667
12426
  insert(_el$13, createComponent(For, {
12668
12427
  get each() {
12669
12428
  return rows();
@@ -12672,7 +12431,7 @@ function CustomerList(props) {
12672
12431
  const name = () => [row.firstName, row.lastName].filter(Boolean).join(" ").trim();
12673
12432
  const lastActivity = () => row.facts?.lastPaymentAt ?? row.createdAt;
12674
12433
  return (() => {
12675
- var _el$18 = _tmpl$921(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$19.nextSibling, _el$23 = _el$22.firstChild, _el$25 = _el$22.nextSibling, _el$27 = _el$25.nextSibling, _el$28 = _el$27.nextSibling, _el$29 = _el$28.nextSibling;
12434
+ var _el$18 = _tmpl$920(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$19.nextSibling, _el$23 = _el$22.firstChild, _el$25 = _el$22.nextSibling, _el$27 = _el$25.nextSibling, _el$28 = _el$27.nextSibling, _el$29 = _el$28.nextSibling;
12676
12435
  _el$18.$$keydown = (e) => {
12677
12436
  if (e.key === "Enter" || e.key === " ") {
12678
12437
  e.preventDefault();
@@ -12686,7 +12445,7 @@ function CustomerList(props) {
12686
12445
  return name();
12687
12446
  },
12688
12447
  get children() {
12689
- var _el$21 = _tmpl$629();
12448
+ var _el$21 = _tmpl$628();
12690
12449
  insert(_el$21, () => row.email);
12691
12450
  return _el$21;
12692
12451
  }
@@ -12701,7 +12460,7 @@ function CustomerList(props) {
12701
12460
  return hint(row);
12702
12461
  },
12703
12462
  get children() {
12704
- var _el$24 = _tmpl$727();
12463
+ var _el$24 = _tmpl$726();
12705
12464
  insert(_el$24, () => hint(row));
12706
12465
  return _el$24;
12707
12466
  }
@@ -12711,11 +12470,11 @@ function CustomerList(props) {
12711
12470
  return memo(() => !!row.facts)() && row.facts.subscriptionCount > 0;
12712
12471
  },
12713
12472
  get fallback() {
12714
- return _tmpl$018();
12473
+ return _tmpl$017();
12715
12474
  },
12716
12475
  get children() {
12717
12476
  return [(() => {
12718
- var _el$26 = _tmpl$824();
12477
+ var _el$26 = _tmpl$823();
12719
12478
  insert(_el$26, () => (row.facts.latestSubscriptionStatus ?? row.subscriptionStatus).replace(/_/g, " "));
12720
12479
  return _el$26;
12721
12480
  })(), createComponent(Show, {
@@ -12752,7 +12511,7 @@ function CustomerList(props) {
12752
12511
  return hasMore();
12753
12512
  },
12754
12513
  get children() {
12755
- var _el$14 = _tmpl$261(), _el$15 = _el$14.firstChild;
12514
+ var _el$14 = _tmpl$260(), _el$15 = _el$14.firstChild;
12756
12515
  _el$15.$$click = loadMore;
12757
12516
  insert(_el$15, () => loadingMore() ? "Loading\u2026" : "Load more");
12758
12517
  effect(() => _el$15.disabled = loadingMore());
@@ -12767,7 +12526,7 @@ function CustomerList(props) {
12767
12526
  return page.error;
12768
12527
  },
12769
12528
  get children() {
12770
- var _el$16 = _tmpl$434(), _el$17 = _el$16.firstChild;
12529
+ var _el$16 = _tmpl$433(), _el$17 = _el$16.firstChild;
12771
12530
  _el$17.$$click = () => refetch();
12772
12531
  return _el$16;
12773
12532
  }
@@ -12864,10 +12623,10 @@ function Customers(props = {}) {
12864
12623
  })
12865
12624
  });
12866
12625
  }
12867
- var _tmpl$200 = /* @__PURE__ */ template(`<div data-testid=admin-stats style="display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))">`);
12868
- var _tmpl$266 = /* @__PURE__ */ template(`<div>`);
12869
- var _tmpl$346 = /* @__PURE__ */ template(`<span style="display:block;font-size:0.875rem;color:var(--app-admin-fg-muted);margin:0 0 0.5rem">`);
12870
- var _tmpl$435 = /* @__PURE__ */ template(`<span class=app-admin-heading style=display:block;font-size:1.875rem;margin:0>`);
12626
+ var _tmpl$181 = /* @__PURE__ */ template(`<div data-testid=admin-stats style="display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))">`);
12627
+ var _tmpl$261 = /* @__PURE__ */ template(`<div>`);
12628
+ var _tmpl$345 = /* @__PURE__ */ template(`<span style="display:block;font-size:0.875rem;color:var(--app-admin-fg-muted);margin:0 0 0.5rem">`);
12629
+ var _tmpl$434 = /* @__PURE__ */ template(`<span class=app-admin-heading style=display:block;font-size:1.875rem;margin:0>`);
12871
12630
  function Dashboard(props) {
12872
12631
  const [stats] = createResource(async () => {
12873
12632
  try {
@@ -12910,7 +12669,7 @@ function Dashboard(props) {
12910
12669
  ];
12911
12670
  };
12912
12671
  return (() => {
12913
- var _el$ = _tmpl$266();
12672
+ var _el$ = _tmpl$261();
12914
12673
  insert(_el$, createComponent(PageTitle, {
12915
12674
  children: "Dashboard"
12916
12675
  }), null);
@@ -12932,7 +12691,7 @@ function Dashboard(props) {
12932
12691
  });
12933
12692
  },
12934
12693
  get children() {
12935
- var _el$2 = _tmpl$200();
12694
+ var _el$2 = _tmpl$181();
12936
12695
  insert(_el$2, createComponent(For, {
12937
12696
  get each() {
12938
12697
  return cards();
@@ -12963,11 +12722,11 @@ function Dashboard(props) {
12963
12722
  },
12964
12723
  get children() {
12965
12724
  return [(() => {
12966
- var _el$3 = _tmpl$346();
12725
+ var _el$3 = _tmpl$345();
12967
12726
  insert(_el$3, () => card.label);
12968
12727
  return _el$3;
12969
12728
  })(), (() => {
12970
- var _el$4 = _tmpl$435();
12729
+ var _el$4 = _tmpl$434();
12971
12730
  insert(_el$4, () => card.value);
12972
12731
  effect((_$p) => setStyleProperty(_el$4, "color", card.tint));
12973
12732
  return _el$4;
@@ -12984,9 +12743,9 @@ function Dashboard(props) {
12984
12743
  return _el$;
12985
12744
  })();
12986
12745
  }
12987
- var _tmpl$201 = /* @__PURE__ */ template(`<div style="color:var(--admin-text-muted, #64748b);font-size:14px">Connected<!> \xB7 `);
12988
- var _tmpl$267 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border:1px solid var(--admin-border, #e2e8f0);border-radius:10px;margin-bottom:20px;background:var(--admin-surface, #fff)"><div><div style=font-weight:600>QuickBooks Payments</div></div><button class="btn btn-primary">`);
12989
- var _tmpl$347 = /* @__PURE__ */ template(`<div style="color:var(--admin-text-muted, #64748b);font-size:14px">Not connected \u2014 connect your QuickBooks account to accept payments.`);
12746
+ var _tmpl$189 = /* @__PURE__ */ template(`<div style="color:var(--admin-text-muted, #64748b);font-size:14px">Connected<!> \xB7 `);
12747
+ var _tmpl$266 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border:1px solid var(--admin-border, #e2e8f0);border-radius:10px;margin-bottom:20px;background:var(--admin-surface, #fff)"><div><div style=font-weight:600>QuickBooks Payments</div></div><button class="btn btn-primary">`);
12748
+ var _tmpl$346 = /* @__PURE__ */ template(`<div style="color:var(--admin-text-muted, #64748b);font-size:14px">Not connected \u2014 connect your QuickBooks account to accept payments.`);
12990
12749
  function QuickBooksCard() {
12991
12750
  const [status, {
12992
12751
  refetch
@@ -13024,16 +12783,16 @@ function QuickBooksCard() {
13024
12783
  return status()?.provider === "quickbooks";
13025
12784
  },
13026
12785
  get children() {
13027
- var _el$ = _tmpl$267(), _el$2 = _el$.firstChild; _el$2.firstChild; var _el$8 = _el$2.nextSibling;
12786
+ var _el$ = _tmpl$266(), _el$2 = _el$.firstChild; _el$2.firstChild; var _el$8 = _el$2.nextSibling;
13028
12787
  insert(_el$2, createComponent(Show, {
13029
12788
  get when() {
13030
12789
  return status()?.connected;
13031
12790
  },
13032
12791
  get fallback() {
13033
- return _tmpl$347();
12792
+ return _tmpl$346();
13034
12793
  },
13035
12794
  get children() {
13036
- var _el$4 = _tmpl$201(), _el$5 = _el$4.firstChild, _el$7 = _el$5.nextSibling; _el$7.nextSibling;
12795
+ var _el$4 = _tmpl$189(), _el$5 = _el$4.firstChild, _el$7 = _el$5.nextSibling; _el$7.nextSibling;
13037
12796
  insert(_el$4, (() => {
13038
12797
  var _c$ = memo(() => !!status()?.realmId);
13039
12798
  return () => _c$() ? ` \xB7 company ${status().realmId}` : "";
@@ -13055,13 +12814,13 @@ function QuickBooksCard() {
13055
12814
  delegateEvents(["click"]);
13056
12815
 
13057
12816
  // src/pages/admin/Payments.tsx
13058
- var _tmpl$208 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Customer</th><th>Amount</th><th>Status</th><th>Transaction ID</th><th style=width:6rem>Actions</th></tr></thead><tbody>`);
13059
- var _tmpl$268 = /* @__PURE__ */ template(`<div>`);
13060
- var _tmpl$348 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit;font-weight:inherit>`);
13061
- var _tmpl$436 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem> refunded`);
13062
- var _tmpl$532 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
13063
- var _tmpl$630 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">`);
13064
- var _tmpl$728 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Customer style=font-weight:500></td><td data-label=Amount></td><td data-label=Status></td><td data-label="Transaction ID"class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem></td><td data-label=Actions>`);
12817
+ var _tmpl$190 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Customer</th><th>Amount</th><th>Status</th><th>Transaction ID</th><th style=width:6rem>Actions</th></tr></thead><tbody>`);
12818
+ var _tmpl$267 = /* @__PURE__ */ template(`<div>`);
12819
+ var _tmpl$347 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit;font-weight:inherit>`);
12820
+ var _tmpl$435 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem> refunded`);
12821
+ var _tmpl$531 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
12822
+ var _tmpl$629 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">`);
12823
+ var _tmpl$727 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Customer style=font-weight:500></td><td data-label=Amount></td><td data-label=Status></td><td data-label="Transaction ID"class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem></td><td data-label=Actions>`);
13065
12824
  function Payments() {
13066
12825
  const nav = useAdminNav();
13067
12826
  const [refreshKey, setRefreshKey] = createSignal(0);
@@ -13115,7 +12874,7 @@ function Payments() {
13115
12874
  try {
13116
12875
  await adminApi.cancelSubscription(sub.id);
13117
12876
  } catch (err) {
13118
- failed.push(`${sub.medication || sub.id}: ${err instanceof Error ? err.message : "cancel failed"}`);
12877
+ failed.push(`${subscriptionLabel(sub, sub.id)}: ${err instanceof Error ? err.message : "cancel failed"}`);
13119
12878
  }
13120
12879
  }
13121
12880
  if (failed.length > 0) {
@@ -13138,7 +12897,7 @@ function Payments() {
13138
12897
  };
13139
12898
  const refundable = (p) => p.status === "succeeded" && p.amountCents - (p.refundedAmountCents ?? 0) > 0;
13140
12899
  return (() => {
13141
- var _el$ = _tmpl$268();
12900
+ var _el$ = _tmpl$267();
13142
12901
  insert(_el$, createComponent(PageTitle, {
13143
12902
  children: "Payments"
13144
12903
  }), null);
@@ -13151,13 +12910,13 @@ function Payments() {
13151
12910
  return createComponent(LoadingSpinner, {});
13152
12911
  },
13153
12912
  get children() {
13154
- var _el$2 = _tmpl$208(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling; _el$1.nextSibling; var _el$11 = _el$5.nextSibling;
12913
+ var _el$2 = _tmpl$190(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling; _el$1.nextSibling; var _el$11 = _el$5.nextSibling;
13155
12914
  insert(_el$11, createComponent(For, {
13156
12915
  get each() {
13157
12916
  return payments() ?? [];
13158
12917
  },
13159
12918
  children: (payment) => (() => {
13160
- var _el$12 = _tmpl$728(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling, _el$19 = _el$16.nextSibling, _el$21 = _el$19.nextSibling, _el$22 = _el$21.nextSibling;
12919
+ var _el$12 = _tmpl$727(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling, _el$19 = _el$16.nextSibling, _el$21 = _el$19.nextSibling, _el$22 = _el$21.nextSibling;
13161
12920
  insert(_el$13, () => fmtDate(payment.date));
13162
12921
  insert(_el$14, createComponent(Show, {
13163
12922
  get when() {
@@ -13167,7 +12926,7 @@ function Payments() {
13167
12926
  return payment.customerEmail;
13168
12927
  },
13169
12928
  get children() {
13170
- var _el$15 = _tmpl$348();
12929
+ var _el$15 = _tmpl$347();
13171
12930
  _el$15.$$click = () => nav.openCustomer(payment.customerUid);
13172
12931
  insert(_el$15, () => payment.customerEmail);
13173
12932
  return _el$15;
@@ -13179,7 +12938,7 @@ function Payments() {
13179
12938
  return memo(() => (payment.refundedAmountCents ?? 0) > 0)() && payment.status !== "refunded";
13180
12939
  },
13181
12940
  get children() {
13182
- var _el$17 = _tmpl$436(), _el$18 = _el$17.firstChild;
12941
+ var _el$17 = _tmpl$435(), _el$18 = _el$17.firstChild;
13183
12942
  insert(_el$17, () => centsToUsd(payment.refundedAmountCents), _el$18);
13184
12943
  return _el$17;
13185
12944
  }
@@ -13194,7 +12953,7 @@ function Payments() {
13194
12953
  return payment.failureReason;
13195
12954
  },
13196
12955
  get children() {
13197
- var _el$20 = _tmpl$532();
12956
+ var _el$20 = _tmpl$531();
13198
12957
  insert(_el$20, () => payment.failureReason);
13199
12958
  return _el$20;
13200
12959
  }
@@ -13205,7 +12964,7 @@ function Payments() {
13205
12964
  return refundable(payment);
13206
12965
  },
13207
12966
  get children() {
13208
- var _el$23 = _tmpl$630();
12967
+ var _el$23 = _tmpl$629();
13209
12968
  _el$23.$$click = () => openRefund(payment);
13210
12969
  insert(_el$23, () => loadingRefund() === payment.id ? "..." : "Refund");
13211
12970
  effect(() => _el$23.disabled = loadingRefund() === payment.id);
@@ -13246,6 +13005,7 @@ function Payments() {
13246
13005
  return target().liveSubs.map((s) => ({
13247
13006
  id: s.id,
13248
13007
  medication: s.medication,
13008
+ medicationName: s.medicationName,
13249
13009
  amountCents: s.amountCents,
13250
13010
  intervalDays: s.intervalDays,
13251
13011
  currentPeriodEnd: s.currentPeriodEnd
@@ -13282,34 +13042,34 @@ async function loadApexDrugs() {
13282
13042
  }
13283
13043
 
13284
13044
  // src/pages/admin/Products.tsx
13285
- var _tmpl$209 = /* @__PURE__ */ template(`<div style="background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);font-size:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);margin-bottom:0.5rem">`);
13286
- var _tmpl$269 = /* @__PURE__ */ template(`<div style=position:relative><img style="width:100%;height:8rem;object-fit:cover;border-radius:var(--app-admin-radius);border:1px solid var(--app-admin-border)"><div style="position:absolute;inset:0;background:rgba(0,0,0,0.6);border-radius:var(--app-admin-radius);display:flex;align-items:center;justify-content:center;gap:0.75rem;opacity:0;transition:opacity 0.15s"><button type=button class="app-admin-btn app-admin-btn-ghost"style=background:rgba(255,255,255,0.15);color:white></button><button type=button class="app-admin-btn app-admin-btn-danger">Remove`);
13287
- var _tmpl$349 = /* @__PURE__ */ template(`<div style=margin-bottom:1.25rem><input type=file accept=image/* style=display:none>`);
13288
- var _tmpl$437 = /* @__PURE__ */ template(`<button type=button style="width:100%;height:8rem;border:2px dashed var(--app-admin-border-strong);border-radius:var(--app-admin-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;color:var(--app-admin-fg-muted);background:transparent;cursor:pointer;font-size:0.75rem"><span>\u{1F4F7}</span><span>`);
13289
- var _tmpl$533 = /* @__PURE__ */ template(`<option value>`);
13290
- var _tmpl$631 = /* @__PURE__ */ template(`<option>`);
13291
- var _tmpl$729 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-top:0.5rem;font-size:0.75rem>Use Default from Apex`);
13292
- var _tmpl$825 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.375rem 0.75rem">`);
13293
- var _tmpl$922 = /* @__PURE__ */ template(`<select class=app-admin-input><option value>None (use Apex default)`);
13294
- var _tmpl$019 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox><span>Prescriber picks the dose (no fixed SKU sent)`);
13295
- var _tmpl$1100 = /* @__PURE__ */ template(`<div style=margin-top:0.5rem><label class=app-admin-label>Bound SKU</label><select class=app-admin-input>`);
13296
- var _tmpl$1013 = /* @__PURE__ */ template(`<div><label class=app-admin-label>Pharmacy SKU binding</label><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0.5rem;line-height:1.4">Bind each dose to a specific Apex SKU so the exact product is sent to the pharmacy \u2014 no fuzzy label matching. Turn on \u201CPrescriber picks\u201D for a titration product with no fixed SKU at order time.`);
13297
- var _tmpl$1115 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.625rem>`);
13298
- var _tmpl$1212 = /* @__PURE__ */ template(`<div><label class=app-admin-label>Available doses &amp; pricing</label><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0.5rem;line-height:1.4">Doses come from the linked Apex drug. Leave a price blank to charge the base price<!>.`);
13299
- var _tmpl$1312 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"title="Reset this product's fields to the built-in defaults">Reset to defaults`);
13045
+ var _tmpl$191 = /* @__PURE__ */ template(`<div style="background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);font-size:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);margin-bottom:0.5rem">`);
13046
+ var _tmpl$268 = /* @__PURE__ */ template(`<div style=position:relative><img style="width:100%;height:8rem;object-fit:cover;border-radius:var(--app-admin-radius);border:1px solid var(--app-admin-border)"><div style="position:absolute;inset:0;background:rgba(0,0,0,0.6);border-radius:var(--app-admin-radius);display:flex;align-items:center;justify-content:center;gap:0.75rem;opacity:0;transition:opacity 0.15s"><button type=button class="app-admin-btn app-admin-btn-ghost"style=background:rgba(255,255,255,0.15);color:white></button><button type=button class="app-admin-btn app-admin-btn-danger">Remove`);
13047
+ var _tmpl$348 = /* @__PURE__ */ template(`<div style=margin-bottom:1.25rem><input type=file accept=image/* style=display:none>`);
13048
+ var _tmpl$436 = /* @__PURE__ */ template(`<button type=button style="width:100%;height:8rem;border:2px dashed var(--app-admin-border-strong);border-radius:var(--app-admin-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;color:var(--app-admin-fg-muted);background:transparent;cursor:pointer;font-size:0.75rem"><span>\u{1F4F7}</span><span>`);
13049
+ var _tmpl$532 = /* @__PURE__ */ template(`<option value>`);
13050
+ var _tmpl$630 = /* @__PURE__ */ template(`<option>`);
13051
+ var _tmpl$728 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-top:0.5rem;font-size:0.75rem>Use Default from Apex`);
13052
+ var _tmpl$824 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.375rem 0.75rem">`);
13053
+ var _tmpl$921 = /* @__PURE__ */ template(`<select class=app-admin-input><option value>None (use Apex default)`);
13054
+ var _tmpl$018 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox><span>Prescriber picks the dose (no fixed SKU sent)`);
13055
+ var _tmpl$199 = /* @__PURE__ */ template(`<div style=margin-top:0.5rem><label class=app-admin-label>Bound SKU</label><select class=app-admin-input>`);
13056
+ var _tmpl$1012 = /* @__PURE__ */ template(`<div><label class=app-admin-label>Pharmacy SKU binding</label><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0.5rem;line-height:1.4">Bind each dose to a specific Apex SKU so the exact product is sent to the pharmacy \u2014 no fuzzy label matching. Turn on \u201CPrescriber picks\u201D for a titration product with no fixed SKU at order time.`);
13057
+ var _tmpl$1114 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.625rem>`);
13058
+ var _tmpl$1211 = /* @__PURE__ */ template(`<div><label class=app-admin-label>Available doses &amp; pricing</label><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0.5rem;line-height:1.4">Doses come from the linked Apex drug. Leave a price blank to charge the base price<!>.`);
13059
+ var _tmpl$1311 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"title="Reset this product's fields to the built-in defaults">Reset to defaults`);
13300
13060
  var _tmpl$1411 = /* @__PURE__ */ template(`<div class="app-admin-side-panel app-admin-side-panel--narrow"><div style=padding:1.5rem><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem><h2 class=app-admin-heading style=font-size:1.125rem;margin:0>Edit Product</h2><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div class="app-admin-text-mono app-admin-text-muted"style="font-size:0.75rem;background:var(--app-admin-surface-light);padding:0.25rem 0.5rem;border-radius:var(--app-admin-radius-sm);margin-bottom:1.5rem">Drug ID: </div><div style=display:flex;flex-direction:column;gap:1rem><div><label class=app-admin-label>Name</label><input type=text class=app-admin-input></div><div><label class=app-admin-label>Description</label><textarea rows=3 class=app-admin-input style=resize:vertical></textarea></div><div><label class=app-admin-label>Price ($)</label><input type=number step=0.01 class=app-admin-input></div><div><label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox><span>Featured product</span></label></div><div><label class=app-admin-label>Categories</label></div><div><label class=app-admin-label>Pricing Mode</label><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.5rem"></div><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0;line-height:1.4"></p></div><div><label class=app-admin-label>Default Dosage</label></div><div><label class=app-admin-label>Benefits (one per line)</label><textarea rows=4 class=app-admin-input style=resize:vertical></textarea></div><div style=display:flex;gap:0.75rem;padding-top:0.5rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=flex:1>Cancel</button><button type=button class="app-admin-btn app-admin-btn-primary"style=flex:1>`);
13301
13061
  var _tmpl$1511 = /* @__PURE__ */ template(`<p style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0>No categories defined yet. Create some on the Categories tab.`);
13302
13062
  var _tmpl$1611 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox><span>`);
13303
13063
  var _tmpl$1711 = /* @__PURE__ */ template(`<div style=margin-top:0.5rem;font-size:0.75rem;color:var(--app-admin-warning-fg)><div style=margin-bottom:0.25rem>Unknown categories on this product:</div><div style=display:flex;flex-wrap:wrap;gap:0.375rem>`);
13304
- var _tmpl$1811 = /* @__PURE__ */ template(`<span style="display:inline-flex;align-items:center;gap:0.25rem;padding:0.125rem 0.5rem;background:var(--app-admin-warning-bg);border:1px solid var(--app-admin-warning-bg-strong);border-radius:var(--app-admin-radius-sm)"><button type=button title=Remove style=background:none;border:none;color:inherit;cursor:pointer;line-height:1;padding:0>\xD7`);
13064
+ var _tmpl$1810 = /* @__PURE__ */ template(`<span style="display:inline-flex;align-items:center;gap:0.25rem;padding:0.125rem 0.5rem;background:var(--app-admin-warning-bg);border:1px solid var(--app-admin-warning-bg-strong);border-radius:var(--app-admin-radius-sm)"><button type=button title=Remove style=background:none;border:none;color:inherit;cursor:pointer;line-height:1;padding:0>\xD7`);
13305
13065
  var _tmpl$1910 = /* @__PURE__ */ template(`<button type=button style=font-size:0.75rem>`);
13306
- var _tmpl$2010 = /* @__PURE__ */ template(`<input type=text class=app-admin-input>`);
13066
+ var _tmpl$208 = /* @__PURE__ */ template(`<input type=text class=app-admin-input>`);
13307
13067
  var _tmpl$2114 = /* @__PURE__ */ template(`<p style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0>This drug publishes no Apex SKUs; requests are sent by drug id only (the prescriber selects the SKU).`);
13308
13068
  var _tmpl$2211 = /* @__PURE__ */ template(`<p style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0>`);
13309
13069
  var _tmpl$2310 = /* @__PURE__ */ template(`<select class=app-admin-input title="Bind this dose to an Apex SKU"style=flex:1;min-width:0>`);
13310
13070
  var _tmpl$2410 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg)></span><div style=display:flex;gap:0.5rem;align-items:center><input type=number step=0.01 class=app-admin-input style=width:7rem>`);
13311
13071
  var _tmpl$2510 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th style=width:4rem>Status</th><th>Drug</th><th>ID</th><th>Price</th><th>Dosages</th><th>Categories</th></tr></thead><tbody>`);
13312
- var _tmpl$2610 = /* @__PURE__ */ template(`<div style=display:flex;height:100%><div style="flex:1;min-width:0;transition:margin 0.2s">`);
13072
+ var _tmpl$269 = /* @__PURE__ */ template(`<div style=display:flex;height:100%><div style="flex:1;min-width:0;transition:margin 0.2s">`);
13313
13073
  var _tmpl$276 = /* @__PURE__ */ template(`<span style=opacity:0.5;font-size:0.75rem>Not configured`);
13314
13074
  var _tmpl$285 = /* @__PURE__ */ template(`<tr><td data-label=Status class=app-admin-table-cell--no-label><button type=button><span class=app-admin-toggle__knob></span></button></td><td data-label=Drug class=app-admin-table-cell--title></td><td data-label=ID class="app-admin-text-mono app-admin-text-muted app-admin-table-cell--end"style=font-size:0.75rem></td><td data-label=Price></td><td data-label=Dosages class=app-admin-text-muted style=font-size:0.75rem></td><td data-label=Categories class=app-admin-text-muted><div style=display:flex;flex-wrap:wrap;gap:0.25rem>`);
13315
13075
  var _tmpl$294 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>-`);
@@ -13360,7 +13120,7 @@ function ThumbnailUpload(props) {
13360
13120
  }
13361
13121
  };
13362
13122
  return (() => {
13363
- var _el$ = _tmpl$349(), _el$2 = _el$.firstChild;
13123
+ var _el$ = _tmpl$348(), _el$2 = _el$.firstChild;
13364
13124
  _el$2.addEventListener("change", (e) => {
13365
13125
  const file = e.currentTarget.files?.[0];
13366
13126
  if (file) handleFile(file);
@@ -13373,7 +13133,7 @@ function ThumbnailUpload(props) {
13373
13133
  return error();
13374
13134
  },
13375
13135
  get children() {
13376
- var _el$3 = _tmpl$209();
13136
+ var _el$3 = _tmpl$191();
13377
13137
  insert(_el$3, error);
13378
13138
  return _el$3;
13379
13139
  }
@@ -13384,7 +13144,7 @@ function ThumbnailUpload(props) {
13384
13144
  },
13385
13145
  get fallback() {
13386
13146
  return (() => {
13387
- var _el$9 = _tmpl$437(), _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling;
13147
+ var _el$9 = _tmpl$436(), _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling;
13388
13148
  _el$9.$$click = () => fileInput.click();
13389
13149
  insert(_el$1, () => uploading() ? "Uploading\u2026" : "Add thumbnail");
13390
13150
  effect(() => _el$9.disabled = uploading());
@@ -13392,7 +13152,7 @@ function ThumbnailUpload(props) {
13392
13152
  })();
13393
13153
  },
13394
13154
  get children() {
13395
- var _el$4 = _tmpl$269(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
13155
+ var _el$4 = _tmpl$268(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
13396
13156
  _el$6.addEventListener("mouseleave", (e) => e.currentTarget.style.opacity = "0");
13397
13157
  _el$6.addEventListener("mouseenter", (e) => e.currentTarget.style.opacity = "1");
13398
13158
  _el$7.$$click = () => fileInput.click();
@@ -13419,7 +13179,7 @@ function ThumbnailUpload(props) {
13419
13179
  }
13420
13180
  function SkuSelectOptions(props) {
13421
13181
  return [(() => {
13422
- var _el$10 = _tmpl$533();
13182
+ var _el$10 = _tmpl$532();
13423
13183
  insert(_el$10, () => props.placeholder);
13424
13184
  return _el$10;
13425
13185
  })(), createComponent(For, {
@@ -13427,7 +13187,7 @@ function SkuSelectOptions(props) {
13427
13187
  return props.skus;
13428
13188
  },
13429
13189
  children: (s) => (() => {
13430
- var _el$11 = _tmpl$631();
13190
+ var _el$11 = _tmpl$630();
13431
13191
  insert(_el$11, () => s.label, null);
13432
13192
  insert(_el$11, () => s.active === false ? " (inactive)" : "", null);
13433
13193
  effect(() => _el$11.value = s.id);
@@ -13593,7 +13353,7 @@ function ProductEditPanel(props) {
13593
13353
  return memo(() => !!apexAdCopy())() && apexAdCopy() !== description();
13594
13354
  },
13595
13355
  get children() {
13596
- var _el$26 = _tmpl$729();
13356
+ var _el$26 = _tmpl$728();
13597
13357
  _el$26.$$click = () => setDescription(apexAdCopy());
13598
13358
  return _el$26;
13599
13359
  }
@@ -13608,7 +13368,7 @@ function ProductEditPanel(props) {
13608
13368
  return _tmpl$1511();
13609
13369
  },
13610
13370
  get children() {
13611
- var _el$35 = _tmpl$825();
13371
+ var _el$35 = _tmpl$824();
13612
13372
  insert(_el$35, createComponent(For, {
13613
13373
  get each() {
13614
13374
  return props.availableCategories;
@@ -13641,7 +13401,7 @@ function ProductEditPanel(props) {
13641
13401
  return unknown();
13642
13402
  },
13643
13403
  children: (id) => (() => {
13644
- var _el$73 = _tmpl$1811(), _el$74 = _el$73.firstChild;
13404
+ var _el$73 = _tmpl$1810(), _el$74 = _el$73.firstChild;
13645
13405
  insert(_el$73, id, _el$74);
13646
13406
  _el$74.$$click = () => setSelectedCategoryIds((prev) => prev.filter((x) => x !== id));
13647
13407
  return _el$73;
@@ -13668,7 +13428,7 @@ function ProductEditPanel(props) {
13668
13428
  },
13669
13429
  get fallback() {
13670
13430
  return (() => {
13671
- var _el$76 = _tmpl$2010();
13431
+ var _el$76 = _tmpl$208();
13672
13432
  _el$76.$$input = (e) => setDosageOverride(e.currentTarget.value);
13673
13433
  effect(() => setAttribute(_el$76, "placeholder", loadingDosages() ? "Loading dosages\u2026" : "e.g. 5mg"));
13674
13434
  effect(() => _el$76.value = dosageOverride());
@@ -13676,14 +13436,14 @@ function ProductEditPanel(props) {
13676
13436
  })();
13677
13437
  },
13678
13438
  get children() {
13679
- var _el$42 = _tmpl$922(); _el$42.firstChild;
13439
+ var _el$42 = _tmpl$921(); _el$42.firstChild;
13680
13440
  _el$42.addEventListener("change", (e) => setDosageOverride(e.currentTarget.value));
13681
13441
  insert(_el$42, createComponent(For, {
13682
13442
  get each() {
13683
13443
  return apexDosages();
13684
13444
  },
13685
13445
  children: (d) => (() => {
13686
- var _el$77 = _tmpl$631();
13446
+ var _el$77 = _tmpl$630();
13687
13447
  _el$77.value = d;
13688
13448
  insert(_el$77, d);
13689
13449
  return _el$77;
@@ -13698,7 +13458,7 @@ function ProductEditPanel(props) {
13698
13458
  return props.product.apexDrugId;
13699
13459
  },
13700
13460
  get children() {
13701
- var _el$44 = _tmpl$1013(), _el$45 = _el$44.firstChild; _el$45.nextSibling;
13461
+ var _el$44 = _tmpl$1012(), _el$45 = _el$44.firstChild; _el$45.nextSibling;
13702
13462
  insert(_el$44, createComponent(Show, {
13703
13463
  get when() {
13704
13464
  return apexSkus().length > 0;
@@ -13708,7 +13468,7 @@ function ProductEditPanel(props) {
13708
13468
  },
13709
13469
  get children() {
13710
13470
  return [(() => {
13711
- var _el$47 = _tmpl$019(), _el$48 = _el$47.firstChild;
13471
+ var _el$47 = _tmpl$018(), _el$48 = _el$47.firstChild;
13712
13472
  _el$48.addEventListener("change", (e) => setPrescriberPicks(e.currentTarget.checked));
13713
13473
  effect(() => _el$48.checked = prescriberPicks());
13714
13474
  return _el$47;
@@ -13717,7 +13477,7 @@ function ProductEditPanel(props) {
13717
13477
  return memo(() => !!!prescriberPicks())() && pricingMode() === "flat_fee";
13718
13478
  },
13719
13479
  get children() {
13720
- var _el$49 = _tmpl$1100(), _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling;
13480
+ var _el$49 = _tmpl$199(), _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling;
13721
13481
  _el$51.addEventListener("change", (e) => setProductSkuId(e.currentTarget.value));
13722
13482
  insert(_el$51, createComponent(SkuSelectOptions, {
13723
13483
  get skus() {
@@ -13739,7 +13499,7 @@ function ProductEditPanel(props) {
13739
13499
  return pricingMode() === "per_dose";
13740
13500
  },
13741
13501
  get children() {
13742
- var _el$52 = _tmpl$1212(), _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.firstChild, _el$57 = _el$55.nextSibling; _el$57.nextSibling;
13502
+ var _el$52 = _tmpl$1211(), _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.firstChild, _el$57 = _el$55.nextSibling; _el$57.nextSibling;
13743
13503
  insert(_el$54, (() => {
13744
13504
  var _c$ = memo(() => !!price());
13745
13505
  return () => _c$() ? ` ($${price()})` : "";
@@ -13756,7 +13516,7 @@ function ProductEditPanel(props) {
13756
13516
  })();
13757
13517
  },
13758
13518
  get children() {
13759
- var _el$58 = _tmpl$1115();
13519
+ var _el$58 = _tmpl$1114();
13760
13520
  insert(_el$58, createComponent(For, {
13761
13521
  get each() {
13762
13522
  return apexDosages();
@@ -13799,7 +13559,7 @@ function ProductEditPanel(props) {
13799
13559
  return resetCandidate();
13800
13560
  },
13801
13561
  get children() {
13802
- var _el$63 = _tmpl$1312();
13562
+ var _el$63 = _tmpl$1311();
13803
13563
  _el$63.$$click = applyReset;
13804
13564
  effect(() => _el$63.disabled = props.saving);
13805
13565
  return _el$63;
@@ -13945,7 +13705,7 @@ function Products(props) {
13945
13705
  };
13946
13706
  const loading = () => products() === void 0;
13947
13707
  return (() => {
13948
- var _el$85 = _tmpl$2610(), _el$86 = _el$85.firstChild;
13708
+ var _el$85 = _tmpl$269(), _el$86 = _el$85.firstChild;
13949
13709
  insert(_el$86, createComponent(PageTitle, {
13950
13710
  subtitle: "Click any drug to configure it; use the toggle to make it available to customers",
13951
13711
  children: "Products"
@@ -14079,15 +13839,15 @@ function Products(props) {
14079
13839
  })();
14080
13840
  }
14081
13841
  delegateEvents(["click", "input"]);
14082
- var _tmpl$270 = /* @__PURE__ */ template(`<div style="background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);border:1px solid var(--app-admin-danger-bg-strong);font-size:0.875rem;border-radius:var(--app-admin-radius-sm);padding:0.5rem 0.75rem;margin-bottom:1rem">`);
14083
- var _tmpl$271 = /* @__PURE__ */ template(`<input type=number min=1 placeholder="Number of rebills"class=app-admin-input style=margin-top:0.5rem>`);
14084
- var _tmpl$350 = /* @__PURE__ */ template(`<div class=app-admin-side-panel style=width:440px><div style=padding:1.5rem><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem><h2 class=app-admin-heading style=font-size:1.125rem;margin:0></h2><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div style=display:flex;flex-direction:column;gap:1rem><div><label class=app-admin-label>Name</label><input type=text placeholder="Spring sale"class=app-admin-input></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.75rem"><div><label class=app-admin-label>Discount type</label><select class=app-admin-input><option value=percent>Percent off</option><option value=fixed>Fixed $ off</option></select></div><div><label class=app-admin-label></label><input type=number min=0 class=app-admin-input></div></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.75rem"><div><label class=app-admin-label>Start date</label><input type=datetime-local class=app-admin-input></div><div><label class=app-admin-label>End date</label><input type=datetime-local class=app-admin-input></div></div><div><label class=app-admin-label>Products <span style=text-transform:none;letter-spacing:normal;opacity:0.7>(required)</span></label><div class=app-admin-card-soft style=padding:0.5rem;max-height:11rem;overflow-y:auto></div></div><div><label class=app-admin-label>Recurring (subscriptions)</label><select class=app-admin-input><option value=none>Initial charge only</option><option value=finite>First N rebills</option><option value=indefinite>All recurring charges (indefinite)</option></select></div><label style=display:flex;align-items:center;gap:0.5rem;margin-top:0.5rem><input type=checkbox><span style=font-size:0.875rem>Exclusive (cannot stack with other discounts)</span></label><label style=display:flex;align-items:center;gap:0.5rem><input type=checkbox><span style=font-size:0.875rem>Active</span></label><div style=display:flex;gap:0.75rem;padding-top:0.5rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=flex:1>Cancel</button><button type=button class="app-admin-btn app-admin-btn-primary"style=flex:1>`);
14085
- var _tmpl$438 = /* @__PURE__ */ template(`<div style=color:var(--app-admin-fg-muted);font-size:0.875rem;padding:0.5rem>No products available.`);
14086
- var _tmpl$534 = /* @__PURE__ */ template(`<label style="display:flex;align-items:center;gap:0.5rem;padding:0.375rem 0.5rem;border-radius:var(--app-admin-radius-sm);cursor:pointer"><input type=checkbox><span style=font-size:0.875rem>`);
14087
- var _tmpl$632 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th>Name</th><th>Discount</th><th>Window</th><th>Products</th><th>Status</th><th style=width:8rem></th></tr></thead><tbody>`);
14088
- var _tmpl$730 = /* @__PURE__ */ template(`<div><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem><button type=button class="app-admin-btn app-admin-btn-primary">+ New sale`);
14089
- var _tmpl$826 = /* @__PURE__ */ template(`<span style=margin-left:0.5rem;font-size:0.75rem;color:var(--app-admin-warning-fg)>exclusive`);
14090
- var _tmpl$923 = /* @__PURE__ */ template(`<tr><td data-label=Name style=font-weight:500></td><td data-label=Discount></td><td data-label=Window class=app-admin-text-muted> \u2192 </td><td data-label=Products class=app-admin-text-muted></td><td data-label=Status><span></span></td><td data-label=Actions><button type=button style=background:none;border:none;color:var(--app-admin-primary-soft-fg);cursor:pointer;font-size:0.875rem>Edit</button><button type=button style=background:none;border:none;color:var(--app-admin-danger-fg);cursor:pointer;font-size:0.875rem;margin-left:0.75rem>Delete`);
13842
+ var _tmpl$200 = /* @__PURE__ */ template(`<div style="background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);border:1px solid var(--app-admin-danger-bg-strong);font-size:0.875rem;border-radius:var(--app-admin-radius-sm);padding:0.5rem 0.75rem;margin-bottom:1rem">`);
13843
+ var _tmpl$270 = /* @__PURE__ */ template(`<input type=number min=1 placeholder="Number of rebills"class=app-admin-input style=margin-top:0.5rem>`);
13844
+ var _tmpl$349 = /* @__PURE__ */ template(`<div class=app-admin-side-panel style=width:440px><div style=padding:1.5rem><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem><h2 class=app-admin-heading style=font-size:1.125rem;margin:0></h2><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div style=display:flex;flex-direction:column;gap:1rem><div><label class=app-admin-label>Name</label><input type=text placeholder="Spring sale"class=app-admin-input></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.75rem"><div><label class=app-admin-label>Discount type</label><select class=app-admin-input><option value=percent>Percent off</option><option value=fixed>Fixed $ off</option></select></div><div><label class=app-admin-label></label><input type=number min=0 class=app-admin-input></div></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.75rem"><div><label class=app-admin-label>Start date</label><input type=datetime-local class=app-admin-input></div><div><label class=app-admin-label>End date</label><input type=datetime-local class=app-admin-input></div></div><div><label class=app-admin-label>Products <span style=text-transform:none;letter-spacing:normal;opacity:0.7>(required)</span></label><div class=app-admin-card-soft style=padding:0.5rem;max-height:11rem;overflow-y:auto></div></div><div><label class=app-admin-label>Recurring (subscriptions)</label><select class=app-admin-input><option value=none>Initial charge only</option><option value=finite>First N rebills</option><option value=indefinite>All recurring charges (indefinite)</option></select></div><label style=display:flex;align-items:center;gap:0.5rem;margin-top:0.5rem><input type=checkbox><span style=font-size:0.875rem>Exclusive (cannot stack with other discounts)</span></label><label style=display:flex;align-items:center;gap:0.5rem><input type=checkbox><span style=font-size:0.875rem>Active</span></label><div style=display:flex;gap:0.75rem;padding-top:0.5rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=flex:1>Cancel</button><button type=button class="app-admin-btn app-admin-btn-primary"style=flex:1>`);
13845
+ var _tmpl$437 = /* @__PURE__ */ template(`<div style=color:var(--app-admin-fg-muted);font-size:0.875rem;padding:0.5rem>No products available.`);
13846
+ var _tmpl$533 = /* @__PURE__ */ template(`<label style="display:flex;align-items:center;gap:0.5rem;padding:0.375rem 0.5rem;border-radius:var(--app-admin-radius-sm);cursor:pointer"><input type=checkbox><span style=font-size:0.875rem>`);
13847
+ var _tmpl$631 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th>Name</th><th>Discount</th><th>Window</th><th>Products</th><th>Status</th><th style=width:8rem></th></tr></thead><tbody>`);
13848
+ var _tmpl$729 = /* @__PURE__ */ template(`<div><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem><button type=button class="app-admin-btn app-admin-btn-primary">+ New sale`);
13849
+ var _tmpl$825 = /* @__PURE__ */ template(`<span style=margin-left:0.5rem;font-size:0.75rem;color:var(--app-admin-warning-fg)>exclusive`);
13850
+ var _tmpl$922 = /* @__PURE__ */ template(`<tr><td data-label=Name style=font-weight:500></td><td data-label=Discount></td><td data-label=Window class=app-admin-text-muted> \u2192 </td><td data-label=Products class=app-admin-text-muted></td><td data-label=Status><span></span></td><td data-label=Actions><button type=button style=background:none;border:none;color:var(--app-admin-primary-soft-fg);cursor:pointer;font-size:0.875rem>Edit</button><button type=button style=background:none;border:none;color:var(--app-admin-danger-fg);cursor:pointer;font-size:0.875rem;margin-left:0.75rem>Delete`);
14091
13851
  function SaleEditPanel(props) {
14092
13852
  const editing = () => props.sale !== null;
14093
13853
  const initial = props.sale;
@@ -14147,7 +13907,7 @@ function SaleEditPanel(props) {
14147
13907
  }
14148
13908
  };
14149
13909
  return (() => {
14150
- var _el$ = _tmpl$350(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$8.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$10.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$1.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$17.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$16.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild; _el$25.nextSibling; var _el$28 = _el$24.nextSibling, _el$29 = _el$23.nextSibling, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$33 = _el$29.nextSibling, _el$34 = _el$33.firstChild; _el$34.nextSibling; var _el$36 = _el$33.nextSibling, _el$37 = _el$36.firstChild; _el$37.nextSibling; var _el$39 = _el$36.nextSibling, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling;
13910
+ var _el$ = _tmpl$349(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$8.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$10.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$1.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$17.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$16.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild; _el$25.nextSibling; var _el$28 = _el$24.nextSibling, _el$29 = _el$23.nextSibling, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$33 = _el$29.nextSibling, _el$34 = _el$33.firstChild; _el$34.nextSibling; var _el$36 = _el$33.nextSibling, _el$37 = _el$36.firstChild; _el$37.nextSibling; var _el$39 = _el$36.nextSibling, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling;
14151
13911
  insert(_el$4, () => editing() ? "Edit Sale" : "New Sale");
14152
13912
  addEventListener(_el$5, "click", props.onClose, true);
14153
13913
  insert(_el$2, createComponent(Show, {
@@ -14155,7 +13915,7 @@ function SaleEditPanel(props) {
14155
13915
  return error();
14156
13916
  },
14157
13917
  get children() {
14158
- var _el$6 = _tmpl$270();
13918
+ var _el$6 = _tmpl$200();
14159
13919
  insert(_el$6, error);
14160
13920
  return _el$6;
14161
13921
  }
@@ -14171,7 +13931,7 @@ function SaleEditPanel(props) {
14171
13931
  return props.products.length > 0;
14172
13932
  },
14173
13933
  get fallback() {
14174
- return _tmpl$438();
13934
+ return _tmpl$437();
14175
13935
  },
14176
13936
  get children() {
14177
13937
  return createComponent(For, {
@@ -14179,7 +13939,7 @@ function SaleEditPanel(props) {
14179
13939
  return props.products;
14180
13940
  },
14181
13941
  children: (p) => (() => {
14182
- var _el$43 = _tmpl$534(), _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling;
13942
+ var _el$43 = _tmpl$533(), _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling;
14183
13943
  _el$44.addEventListener("change", () => toggleProduct(p.id));
14184
13944
  insert(_el$45, () => p.name);
14185
13945
  effect(() => _el$44.checked = productIds().includes(p.id));
@@ -14194,7 +13954,7 @@ function SaleEditPanel(props) {
14194
13954
  return recurringMode() === "finite";
14195
13955
  },
14196
13956
  get children() {
14197
- var _el$32 = _tmpl$271();
13957
+ var _el$32 = _tmpl$270();
14198
13958
  _el$32.$$input = (e) => setRecurringCharges(parseInt(e.currentTarget.value, 10) || 0);
14199
13959
  effect(() => _el$32.value = recurringCharges());
14200
13960
  return _el$32;
@@ -14265,7 +14025,7 @@ function Sales() {
14265
14025
  }
14266
14026
  };
14267
14027
  return (() => {
14268
- var _el$46 = _tmpl$730(), _el$47 = _el$46.firstChild, _el$48 = _el$47.firstChild;
14028
+ var _el$46 = _tmpl$729(), _el$47 = _el$46.firstChild, _el$48 = _el$47.firstChild;
14269
14029
  insert(_el$47, createComponent(PageTitle, {
14270
14030
  subtitle: "Named promotions applied directly to selected products at checkout.",
14271
14031
  children: "Sales"
@@ -14279,20 +14039,20 @@ function Sales() {
14279
14039
  return createComponent(LoadingSpinner, {});
14280
14040
  },
14281
14041
  get children() {
14282
- var _el$49 = _tmpl$632(), _el$50 = _el$49.firstChild, _el$51 = _el$50.firstChild, _el$52 = _el$51.firstChild, _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.nextSibling, _el$56 = _el$55.nextSibling, _el$57 = _el$56.nextSibling; _el$57.nextSibling; var _el$59 = _el$51.nextSibling;
14042
+ var _el$49 = _tmpl$631(), _el$50 = _el$49.firstChild, _el$51 = _el$50.firstChild, _el$52 = _el$51.firstChild, _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.nextSibling, _el$56 = _el$55.nextSibling, _el$57 = _el$56.nextSibling; _el$57.nextSibling; var _el$59 = _el$51.nextSibling;
14283
14043
  insert(_el$59, createComponent(For, {
14284
14044
  get each() {
14285
14045
  return sales() ?? [];
14286
14046
  },
14287
14047
  children: (s) => (() => {
14288
- var _el$60 = _tmpl$923(), _el$61 = _el$60.firstChild, _el$63 = _el$61.nextSibling, _el$64 = _el$63.nextSibling, _el$65 = _el$64.firstChild, _el$66 = _el$64.nextSibling, _el$67 = _el$66.nextSibling, _el$68 = _el$67.firstChild, _el$69 = _el$67.nextSibling, _el$70 = _el$69.firstChild, _el$71 = _el$70.nextSibling;
14048
+ var _el$60 = _tmpl$922(), _el$61 = _el$60.firstChild, _el$63 = _el$61.nextSibling, _el$64 = _el$63.nextSibling, _el$65 = _el$64.firstChild, _el$66 = _el$64.nextSibling, _el$67 = _el$66.nextSibling, _el$68 = _el$67.firstChild, _el$69 = _el$67.nextSibling, _el$70 = _el$69.firstChild, _el$71 = _el$70.nextSibling;
14289
14049
  insert(_el$61, () => s.name, null);
14290
14050
  insert(_el$61, createComponent(Show, {
14291
14051
  get when() {
14292
14052
  return s.isExclusive;
14293
14053
  },
14294
14054
  get children() {
14295
- return _tmpl$826();
14055
+ return _tmpl$825();
14296
14056
  }
14297
14057
  }), null);
14298
14058
  insert(_el$63, () => fmtDiscount(s.discountType, s.discountValueCents));
@@ -14343,20 +14103,20 @@ function Sales() {
14343
14103
  })();
14344
14104
  }
14345
14105
  delegateEvents(["click", "input"]);
14346
- var _tmpl$277 = /* @__PURE__ */ template(`<button type=button style=display:block;padding:0;border:none;background:none;cursor:pointer;margin-top:0.5rem><img loading=lazy style=max-width:100%;max-height:15rem;border-radius:0.5rem;display:block>`, true, false, false);
14347
- var _tmpl$278 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-top:0.5rem;font-size:0.75rem>\u{1F4CE} `);
14348
- var _tmpl$351 = /* @__PURE__ */ template(`<p style=margin:0;white-space:pre-wrap;line-height:1.5>`);
14349
- var _tmpl$439 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style="padding:0.75rem 0.875rem;margin-bottom:0.5rem"><div style=display:flex;justify-content:space-between;gap:1rem;margin-bottom:0.25rem><strong style=font-size:0.75rem></strong><span class=app-admin-text-muted style=font-size:0.75rem>`);
14350
- var _tmpl$535 = /* @__PURE__ */ template(`<p class=app-admin-text-muted role=alert style=color:var(--app-admin-danger-fg)>`);
14351
- var _tmpl$633 = /* @__PURE__ */ template(`<div><div style=display:flex;gap:0.5rem;margin-bottom:1rem;flex-wrap:wrap></div><div style="display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1.6fr);gap:1rem"><div class=app-admin-card style=overflow:hidden;padding:0></div><div class=app-admin-card style=padding:1.25rem>`);
14352
- var _tmpl$731 = /* @__PURE__ */ template(`<button type=button>`);
14353
- var _tmpl$827 = /* @__PURE__ */ template(`<button type=button style="display:block;width:100%;text-align:left;padding:0.75rem 1rem;border:none;border-bottom:1px solid var(--app-admin-border);cursor:pointer"><div style=display:flex;justify-content:space-between;gap:0.5rem><span></span><span class=app-admin-text-muted style=font-size:0.75rem></span></div><div style=display:flex;justify-content:space-between;gap:0.5rem;margin-top:0.25rem><span class=app-admin-text-muted style=font-size:0.8125rem>`);
14354
- var _tmpl$924 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn>View customer`);
14355
- var _tmpl$020 = /* @__PURE__ */ template(`<div style=display:flex;justify-content:space-between;gap:1rem;align-items:flex-start><div><h3 style="margin:0 0 0.25rem"></h3><p class=app-admin-text-muted style=margin:0;font-size:0.8125rem></p></div><div style=display:flex;gap:0.375rem>`);
14356
- var _tmpl$1101 = /* @__PURE__ */ template(`<div data-scrollable style="margin:1rem 0;max-height:26rem;overflow-y:auto"><div>`);
14357
- var _tmpl$1014 = /* @__PURE__ */ template(`<form><textarea class=app-admin-input rows=4 maxlength=5000 placeholder="Write a reply\u2026"aria-label=Reply style=width:100%></textarea><div style=display:flex;gap:0.5rem;align-items:center;margin-top:0.5rem><button type=submit class="app-admin-btn app-admin-btn-primary"></button><label class="app-admin-btn app-admin-btn-ghost"style=cursor:pointer>\u{1F4CE} Attach<input type=file style=display:none>`);
14358
- var _tmpl$1116 = /* @__PURE__ */ template(`<button type=button style=font-size:0.75rem>`);
14359
- var _tmpl$1213 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.8125rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-left:0.25rem;font-size:0.75rem>remove`);
14106
+ var _tmpl$201 = /* @__PURE__ */ template(`<button type=button style=display:block;padding:0;border:none;background:none;cursor:pointer;margin-top:0.5rem><img loading=lazy style=max-width:100%;max-height:15rem;border-radius:0.5rem;display:block>`, true, false, false);
14107
+ var _tmpl$271 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-top:0.5rem;font-size:0.75rem>\u{1F4CE} `);
14108
+ var _tmpl$350 = /* @__PURE__ */ template(`<p style=margin:0;white-space:pre-wrap;line-height:1.5>`);
14109
+ var _tmpl$438 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style="padding:0.75rem 0.875rem;margin-bottom:0.5rem"><div style=display:flex;justify-content:space-between;gap:1rem;margin-bottom:0.25rem><strong style=font-size:0.75rem></strong><span class=app-admin-text-muted style=font-size:0.75rem>`);
14110
+ var _tmpl$534 = /* @__PURE__ */ template(`<p class=app-admin-text-muted role=alert style=color:var(--app-admin-danger-fg)>`);
14111
+ var _tmpl$632 = /* @__PURE__ */ template(`<div><div style=display:flex;gap:0.5rem;margin-bottom:1rem;flex-wrap:wrap></div><div style="display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1.6fr);gap:1rem"><div class=app-admin-card style=overflow:hidden;padding:0></div><div class=app-admin-card style=padding:1.25rem>`);
14112
+ var _tmpl$730 = /* @__PURE__ */ template(`<button type=button>`);
14113
+ var _tmpl$826 = /* @__PURE__ */ template(`<button type=button style="display:block;width:100%;text-align:left;padding:0.75rem 1rem;border:none;border-bottom:1px solid var(--app-admin-border);cursor:pointer"><div style=display:flex;justify-content:space-between;gap:0.5rem><span></span><span class=app-admin-text-muted style=font-size:0.75rem></span></div><div style=display:flex;justify-content:space-between;gap:0.5rem;margin-top:0.25rem><span class=app-admin-text-muted style=font-size:0.8125rem>`);
14114
+ var _tmpl$923 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn>View customer`);
14115
+ var _tmpl$019 = /* @__PURE__ */ template(`<div style=display:flex;justify-content:space-between;gap:1rem;align-items:flex-start><div><h3 style="margin:0 0 0.25rem"></h3><p class=app-admin-text-muted style=margin:0;font-size:0.8125rem></p></div><div style=display:flex;gap:0.375rem>`);
14116
+ var _tmpl$1100 = /* @__PURE__ */ template(`<div data-scrollable style="margin:1rem 0;max-height:26rem;overflow-y:auto"><div>`);
14117
+ var _tmpl$1013 = /* @__PURE__ */ template(`<form><textarea class=app-admin-input rows=4 maxlength=5000 placeholder="Write a reply\u2026"aria-label=Reply style=width:100%></textarea><div style=display:flex;gap:0.5rem;align-items:center;margin-top:0.5rem><button type=submit class="app-admin-btn app-admin-btn-primary"></button><label class="app-admin-btn app-admin-btn-ghost"style=cursor:pointer>\u{1F4CE} Attach<input type=file style=display:none>`);
14118
+ var _tmpl$1115 = /* @__PURE__ */ template(`<button type=button style=font-size:0.75rem>`);
14119
+ var _tmpl$1212 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.8125rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-left:0.25rem;font-size:0.75rem>remove`);
14360
14120
  var STATUS_FILTERS3 = [{
14361
14121
  value: "all",
14362
14122
  label: "All"
@@ -14522,14 +14282,14 @@ function Support(props = {}) {
14522
14282
  },
14523
14283
  get fallback() {
14524
14284
  return (() => {
14525
- var _el$3 = _tmpl$278(); _el$3.firstChild;
14285
+ var _el$3 = _tmpl$271(); _el$3.firstChild;
14526
14286
  _el$3.$$click = () => openAttachment(p.attachment.id);
14527
14287
  insert(_el$3, () => p.attachment.filename, null);
14528
14288
  return _el$3;
14529
14289
  })();
14530
14290
  },
14531
14291
  get children() {
14532
- var _el$ = _tmpl$277(), _el$2 = _el$.firstChild;
14292
+ var _el$ = _tmpl$201(), _el$2 = _el$.firstChild;
14533
14293
  _el$.$$click = () => openAttachment(p.attachment.id);
14534
14294
  _el$2.addEventListener("error", () => {
14535
14295
  if (retried) {
@@ -14555,7 +14315,7 @@ function Support(props = {}) {
14555
14315
  const Bubble = (p) => {
14556
14316
  const fromSupport = () => p.msg.sender === "support";
14557
14317
  return (() => {
14558
- var _el$5 = _tmpl$439(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
14318
+ var _el$5 = _tmpl$438(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
14559
14319
  insert(_el$7, () => fromSupport() ? "Support" : "Customer");
14560
14320
  insert(_el$8, () => formatWhen(p.msg.createdAt));
14561
14321
  insert(_el$5, createComponent(Show, {
@@ -14563,7 +14323,7 @@ function Support(props = {}) {
14563
14323
  return p.msg.body;
14564
14324
  },
14565
14325
  get children() {
14566
- var _el$9 = _tmpl$351();
14326
+ var _el$9 = _tmpl$350();
14567
14327
  insert(_el$9, () => p.msg.body);
14568
14328
  return _el$9;
14569
14329
  }
@@ -14593,7 +14353,7 @@ function Support(props = {}) {
14593
14353
  })();
14594
14354
  };
14595
14355
  return (() => {
14596
- var _el$0 = _tmpl$633(), _el$1 = _el$0.firstChild, _el$11 = _el$1.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
14356
+ var _el$0 = _tmpl$632(), _el$1 = _el$0.firstChild, _el$11 = _el$1.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
14597
14357
  insert(_el$0, createComponent(PageTitle, {
14598
14358
  subtitle: "Customer messages from the member portal",
14599
14359
  children: "Support"
@@ -14601,7 +14361,7 @@ function Support(props = {}) {
14601
14361
  insert(_el$1, createComponent(For, {
14602
14362
  each: STATUS_FILTERS3,
14603
14363
  children: (f) => (() => {
14604
- var _el$14 = _tmpl$731();
14364
+ var _el$14 = _tmpl$730();
14605
14365
  _el$14.$$click = () => {
14606
14366
  setStatusFilter(f.value);
14607
14367
  setSelectedId(null);
@@ -14616,7 +14376,7 @@ function Support(props = {}) {
14616
14376
  return error();
14617
14377
  },
14618
14378
  get children() {
14619
- var _el$10 = _tmpl$535();
14379
+ var _el$10 = _tmpl$534();
14620
14380
  insert(_el$10, error);
14621
14381
  return _el$10;
14622
14382
  }
@@ -14644,7 +14404,7 @@ function Support(props = {}) {
14644
14404
  return threads() ?? [];
14645
14405
  },
14646
14406
  children: (t) => (() => {
14647
- var _el$15 = _tmpl$827(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling, _el$19 = _el$16.nextSibling, _el$20 = _el$19.firstChild;
14407
+ var _el$15 = _tmpl$826(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling, _el$19 = _el$16.nextSibling, _el$20 = _el$19.firstChild;
14648
14408
  _el$15.$$click = () => setSelectedId(t.id);
14649
14409
  insert(_el$17, () => customerLabel(t));
14650
14410
  insert(_el$18, () => formatWhen(t.lastMessageAt));
@@ -14698,7 +14458,7 @@ function Support(props = {}) {
14698
14458
  });
14699
14459
  },
14700
14460
  children: (d) => [(() => {
14701
- var _el$21 = _tmpl$020(), _el$22 = _el$21.firstChild, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$26 = _el$22.nextSibling;
14461
+ var _el$21 = _tmpl$019(), _el$22 = _el$21.firstChild, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$26 = _el$22.nextSibling;
14702
14462
  insert(_el$23, () => d().thread.subject);
14703
14463
  insert(_el$24, () => d().customer?.email ?? "Unknown customer", null);
14704
14464
  insert(_el$24, createComponent(Show, {
@@ -14707,7 +14467,7 @@ function Support(props = {}) {
14707
14467
  },
14708
14468
  get children() {
14709
14469
  return [" \xB7 ", (() => {
14710
- var _el$25 = _tmpl$924();
14470
+ var _el$25 = _tmpl$923();
14711
14471
  _el$25.$$click = () => nav.openCustomer(d().thread.userId);
14712
14472
  return _el$25;
14713
14473
  })()];
@@ -14718,7 +14478,7 @@ function Support(props = {}) {
14718
14478
  return STATUS_FILTERS3.filter((f) => f.value !== "all");
14719
14479
  },
14720
14480
  children: (f) => (() => {
14721
- var _el$36 = _tmpl$1116();
14481
+ var _el$36 = _tmpl$1115();
14722
14482
  _el$36.$$click = () => changeStatus(f.value);
14723
14483
  insert(_el$36, () => f.label);
14724
14484
  effect((_p$) => {
@@ -14735,7 +14495,7 @@ function Support(props = {}) {
14735
14495
  }));
14736
14496
  return _el$21;
14737
14497
  })(), (() => {
14738
- var _el$27 = _tmpl$1101(), _el$28 = _el$27.firstChild;
14498
+ var _el$27 = _tmpl$1100(), _el$28 = _el$27.firstChild;
14739
14499
  var _ref$ = transcriptEnd.setContainer;
14740
14500
  typeof _ref$ === "function" ? use(_ref$, _el$27) : transcriptEnd.setContainer = _el$27;
14741
14501
  insert(_el$27, createComponent(For, {
@@ -14750,7 +14510,7 @@ function Support(props = {}) {
14750
14510
  typeof _ref$2 === "function" ? use(_ref$2, _el$28) : transcriptEnd.setEnd = _el$28;
14751
14511
  return _el$27;
14752
14512
  })(), (() => {
14753
- var _el$29 = _tmpl$1014(), _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling;
14513
+ var _el$29 = _tmpl$1013(), _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling;
14754
14514
  _el$29.addEventListener("submit", sendReply);
14755
14515
  _el$30.$$keydown = handleReplyKeyDown;
14756
14516
  _el$30.$$input = (e) => setReply(e.currentTarget.value);
@@ -14775,7 +14535,7 @@ function Support(props = {}) {
14775
14535
  return pendingFile();
14776
14536
  },
14777
14537
  children: (f) => (() => {
14778
- var _el$37 = _tmpl$1213(), _el$38 = _el$37.firstChild;
14538
+ var _el$37 = _tmpl$1212(), _el$38 = _el$37.firstChild;
14779
14539
  insert(_el$37, () => f().name, _el$38);
14780
14540
  _el$38.$$click = () => setPendingFile(null);
14781
14541
  return _el$37;
@@ -14802,10 +14562,10 @@ function Support(props = {}) {
14802
14562
  })();
14803
14563
  }
14804
14564
  delegateEvents(["click", "input", "keydown"]);
14805
- var _tmpl$279 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th>Date</th><th>Provider</th><th>Event Type</th><th>Status</th><th style=width:2.5rem></th></tr></thead><tbody>`);
14806
- var _tmpl$280 = /* @__PURE__ */ template(`<div>`);
14807
- var _tmpl$353 = /* @__PURE__ */ template(`<tr class=is-clickable><td data-label=Date class=app-admin-text-muted></td><td data-label=Provider style=font-weight:500></td><td data-label="Event type"class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem></td><td data-label=Status></td><td class=app-admin-text-muted style=font-size:0.75rem><span style="display:inline-block;transition:transform 0.15s">\u25B6`);
14808
- var _tmpl$440 = /* @__PURE__ */ template(`<tr><td colspan=5><pre class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem;background:var(--app-admin-surface-light);border-radius:var(--app-admin-radius-sm);padding:1rem;overflow-x:auto;white-space:pre-wrap;word-break:break-all;margin:0>`);
14565
+ var _tmpl$209 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th>Date</th><th>Provider</th><th>Event Type</th><th>Status</th><th style=width:2.5rem></th></tr></thead><tbody>`);
14566
+ var _tmpl$277 = /* @__PURE__ */ template(`<div>`);
14567
+ var _tmpl$351 = /* @__PURE__ */ template(`<tr class=is-clickable><td data-label=Date class=app-admin-text-muted></td><td data-label=Provider style=font-weight:500></td><td data-label="Event type"class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem></td><td data-label=Status></td><td class=app-admin-text-muted style=font-size:0.75rem><span style="display:inline-block;transition:transform 0.15s">\u25B6`);
14568
+ var _tmpl$439 = /* @__PURE__ */ template(`<tr><td colspan=5><pre class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem;background:var(--app-admin-surface-light);border-radius:var(--app-admin-radius-sm);padding:1rem;overflow-x:auto;white-space:pre-wrap;word-break:break-all;margin:0>`);
14809
14569
  function Webhooks() {
14810
14570
  const [expanded, setExpanded] = createSignal(null);
14811
14571
  const [webhooks] = createResource(async () => {
@@ -14822,7 +14582,7 @@ function Webhooks() {
14822
14582
  setExpanded((prev) => prev === id ? null : id);
14823
14583
  };
14824
14584
  return (() => {
14825
- var _el$ = _tmpl$280();
14585
+ var _el$ = _tmpl$277();
14826
14586
  insert(_el$, createComponent(PageTitle, {
14827
14587
  children: "Webhook Events"
14828
14588
  }), null);
@@ -14834,13 +14594,13 @@ function Webhooks() {
14834
14594
  return createComponent(LoadingSpinner, {});
14835
14595
  },
14836
14596
  get children() {
14837
- var _el$2 = _tmpl$279(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling; _el$9.nextSibling; var _el$1 = _el$4.nextSibling;
14597
+ var _el$2 = _tmpl$209(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling; _el$9.nextSibling; var _el$1 = _el$4.nextSibling;
14838
14598
  insert(_el$1, createComponent(For, {
14839
14599
  get each() {
14840
14600
  return webhooks() ?? [];
14841
14601
  },
14842
14602
  children: (event) => [(() => {
14843
- var _el$10 = _tmpl$353(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild;
14603
+ var _el$10 = _tmpl$351(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild;
14844
14604
  _el$10.$$click = () => toggleExpand(String(event.id));
14845
14605
  insert(_el$11, () => event.date);
14846
14606
  insert(_el$12, () => event.provider || "Authorize.Net");
@@ -14857,7 +14617,7 @@ function Webhooks() {
14857
14617
  return expanded() === String(event.id);
14858
14618
  },
14859
14619
  get children() {
14860
- var _el$17 = _tmpl$440(), _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild;
14620
+ var _el$17 = _tmpl$439(), _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild;
14861
14621
  insert(_el$19, (() => {
14862
14622
  var _c$ = memo(() => typeof event.payload === "string");
14863
14623
  return () => _c$() ? (() => {
@@ -14889,17 +14649,17 @@ function Webhooks() {
14889
14649
  })();
14890
14650
  }
14891
14651
  delegateEvents(["click"]);
14892
- var _tmpl$281 = /* @__PURE__ */ template(`<div style=display:flex;gap:1.5rem;align-items:flex-start><div class=app-admin-card style=min-width:14rem;max-width:14rem;padding:0.5rem;flex-shrink:0;max-height:70vh;overflow-y:auto;position:sticky;top:1rem>`);
14893
- var _tmpl$286 = /* @__PURE__ */ template(`<div>`);
14894
- var _tmpl$354 = /* @__PURE__ */ template(`<div class=app-admin-empty>No email templates configured.`);
14895
- var _tmpl$441 = /* @__PURE__ */ template(`<div style=margin-bottom:0.25rem><button type=button style="display:flex;align-items:center;justify-content:space-between;width:100%;text-align:left;padding:0.4rem 0.5rem;font-size:0.7rem;font-weight:700;letter-spacing:0.03em;text-transform:uppercase;border:none;background:transparent;color:var(--app-admin-fg-subtle);cursor:pointer"><span></span><span style=font-size:0.65rem>`);
14896
- var _tmpl$536 = /* @__PURE__ */ template(`<button type=button style="display:block;width:100%;text-align:left;padding:0.5rem 0.75rem;font-size:0.8rem;font-weight:500;border:none;border-radius:var(--app-admin-radius-sm);cursor:pointer;transition:color 0.15s, background 0.15s">`);
14897
- var _tmpl$634 = /* @__PURE__ */ template(`<div style="padding:0.75rem 0.875rem;background:var(--app-admin-info-bg);border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm)"><p style=font-size:0.75rem;font-weight:600;margin-bottom:0.5rem>Insert placeholder<span style=font-weight:400;color:var(--app-admin-fg-muted)> &mdash; click a field, then a token</span></p><div style=display:flex;flex-wrap:wrap;gap:0.375rem>`);
14898
- var _tmpl$732 = /* @__PURE__ */ template(`<button type=button style=margin-top:0.5rem;background:none;border:none;color:var(--app-admin-primary-soft-fg);cursor:pointer;font-size:0.8rem;font-weight:500>+ Add Paragraph`);
14899
- var _tmpl$828 = /* @__PURE__ */ template(`<div class=app-admin-card style=padding:1.25rem;flex:1;min-width:0><div style=display:flex;flex-direction:column;gap:1.25rem><div><label class=app-admin-label>Subject</label><input type=text maxlength=200 class=app-admin-input><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/200</p></div><div><label class=app-admin-label>Greeting</label><input type=text class=app-admin-input></div><div><label class=app-admin-label>Body Paragraphs (<!>/10)</label><div style=display:flex;flex-direction:column;gap:0.75rem></div></div><div><label class=app-admin-label>Closing Text</label><textarea maxlength=500 rows=3 class=app-admin-input style=resize:vertical></textarea><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/500</p></div><div style="display:flex;flex-wrap:wrap;gap:0.75rem;padding-top:1rem;border-top:1px solid var(--app-admin-border)"><button type=button class="app-admin-btn app-admin-btn-primary"></button><button type=button class="app-admin-btn app-admin-btn-ghost"></button><button type=button class="app-admin-btn app-admin-btn-ghost">`);
14900
- var _tmpl$925 = /* @__PURE__ */ template(`<button type=button style="font-family:var(--app-admin-font-mono);font-size:0.72rem;background:var(--app-admin-surface);border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm);padding:0.2rem 0.45rem;color:var(--app-admin-fg);cursor:pointer">`);
14901
- var _tmpl$021 = /* @__PURE__ */ template(`<button type=button title="Remove paragraph"style=align-self:flex-start;background:none;border:none;color:var(--app-admin-danger-fg);cursor:pointer;font-size:1.125rem;padding:0.375rem>&times;`);
14902
- var _tmpl$1102 = /* @__PURE__ */ template(`<div style=display:flex;gap:0.5rem><textarea rows=3 class=app-admin-input style=flex:1;resize:vertical>`);
14652
+ var _tmpl$278 = /* @__PURE__ */ template(`<div style=display:flex;gap:1.5rem;align-items:flex-start><div class=app-admin-card style=min-width:14rem;max-width:14rem;padding:0.5rem;flex-shrink:0;max-height:70vh;overflow-y:auto;position:sticky;top:1rem>`);
14653
+ var _tmpl$279 = /* @__PURE__ */ template(`<div>`);
14654
+ var _tmpl$353 = /* @__PURE__ */ template(`<div class=app-admin-empty>No email templates configured.`);
14655
+ var _tmpl$440 = /* @__PURE__ */ template(`<div style=margin-bottom:0.25rem><button type=button style="display:flex;align-items:center;justify-content:space-between;width:100%;text-align:left;padding:0.4rem 0.5rem;font-size:0.7rem;font-weight:700;letter-spacing:0.03em;text-transform:uppercase;border:none;background:transparent;color:var(--app-admin-fg-subtle);cursor:pointer"><span></span><span style=font-size:0.65rem>`);
14656
+ var _tmpl$535 = /* @__PURE__ */ template(`<button type=button style="display:block;width:100%;text-align:left;padding:0.5rem 0.75rem;font-size:0.8rem;font-weight:500;border:none;border-radius:var(--app-admin-radius-sm);cursor:pointer;transition:color 0.15s, background 0.15s">`);
14657
+ var _tmpl$633 = /* @__PURE__ */ template(`<div style="padding:0.75rem 0.875rem;background:var(--app-admin-info-bg);border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm)"><p style=font-size:0.75rem;font-weight:600;margin-bottom:0.5rem>Insert placeholder<span style=font-weight:400;color:var(--app-admin-fg-muted)> &mdash; click a field, then a token</span></p><div style=display:flex;flex-wrap:wrap;gap:0.375rem>`);
14658
+ var _tmpl$731 = /* @__PURE__ */ template(`<button type=button style=margin-top:0.5rem;background:none;border:none;color:var(--app-admin-primary-soft-fg);cursor:pointer;font-size:0.8rem;font-weight:500>+ Add Paragraph`);
14659
+ var _tmpl$827 = /* @__PURE__ */ template(`<div class=app-admin-card style=padding:1.25rem;flex:1;min-width:0><div style=display:flex;flex-direction:column;gap:1.25rem><div><label class=app-admin-label>Subject</label><input type=text maxlength=200 class=app-admin-input><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/200</p></div><div><label class=app-admin-label>Greeting</label><input type=text class=app-admin-input></div><div><label class=app-admin-label>Body Paragraphs (<!>/10)</label><div style=display:flex;flex-direction:column;gap:0.75rem></div></div><div><label class=app-admin-label>Closing Text</label><textarea maxlength=500 rows=3 class=app-admin-input style=resize:vertical></textarea><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/500</p></div><div style="display:flex;flex-wrap:wrap;gap:0.75rem;padding-top:1rem;border-top:1px solid var(--app-admin-border)"><button type=button class="app-admin-btn app-admin-btn-primary"></button><button type=button class="app-admin-btn app-admin-btn-ghost"></button><button type=button class="app-admin-btn app-admin-btn-ghost">`);
14660
+ var _tmpl$924 = /* @__PURE__ */ template(`<button type=button style="font-family:var(--app-admin-font-mono);font-size:0.72rem;background:var(--app-admin-surface);border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm);padding:0.2rem 0.45rem;color:var(--app-admin-fg);cursor:pointer">`);
14661
+ var _tmpl$020 = /* @__PURE__ */ template(`<button type=button title="Remove paragraph"style=align-self:flex-start;background:none;border:none;color:var(--app-admin-danger-fg);cursor:pointer;font-size:1.125rem;padding:0.375rem>&times;`);
14662
+ var _tmpl$1101 = /* @__PURE__ */ template(`<div style=display:flex;gap:0.5rem><textarea rows=3 class=app-admin-input style=flex:1;resize:vertical>`);
14903
14663
  var CATEGORY_DEFS = [{
14904
14664
  label: "Subscription & Billing",
14905
14665
  keys: ["subscriptionConfirmation", "paymentFailed", "subscriptionSuspended", "subscriptionExpiring", "renewalReminder", "cardExpiring", "pastDueNudge"]
@@ -15101,7 +14861,7 @@ function EmailTemplates() {
15101
14861
  }
15102
14862
  };
15103
14863
  return (() => {
15104
- var _el$ = _tmpl$286();
14864
+ var _el$ = _tmpl$279();
15105
14865
  insert(_el$, createComponent(PageTitle, {
15106
14866
  subtitle: "Customize the transactional emails sent to your customers.",
15107
14867
  children: "Email Templates"
@@ -15119,16 +14879,16 @@ function EmailTemplates() {
15119
14879
  return templateKeys().length > 0;
15120
14880
  },
15121
14881
  get fallback() {
15122
- return _tmpl$354();
14882
+ return _tmpl$353();
15123
14883
  },
15124
14884
  get children() {
15125
- var _el$2 = _tmpl$281(), _el$3 = _el$2.firstChild;
14885
+ var _el$2 = _tmpl$278(), _el$3 = _el$2.firstChild;
15126
14886
  insert(_el$3, createComponent(For, {
15127
14887
  get each() {
15128
14888
  return categorizedKeys();
15129
14889
  },
15130
14890
  children: (group) => (() => {
15131
- var _el$5 = _tmpl$441(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
14891
+ var _el$5 = _tmpl$440(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
15132
14892
  _el$6.$$click = () => toggleCategory(group.label);
15133
14893
  insert(_el$7, () => group.label);
15134
14894
  insert(_el$8, () => collapsed()[group.label] ? "\u25B8" : "\u25BE");
@@ -15142,7 +14902,7 @@ function EmailTemplates() {
15142
14902
  return group.keys;
15143
14903
  },
15144
14904
  children: (key) => (() => {
15145
- var _el$9 = _tmpl$536();
14905
+ var _el$9 = _tmpl$535();
15146
14906
  _el$9.$$click = () => handleTabSwitch(key);
15147
14907
  insert(_el$9, () => humanize(key));
15148
14908
  effect((_p$) => {
@@ -15167,19 +14927,19 @@ function EmailTemplates() {
15167
14927
  return currentDraft();
15168
14928
  },
15169
14929
  children: (cur) => (() => {
15170
- var _el$0 = _tmpl$828(), _el$1 = _el$0.firstChild, _el$15 = _el$1.firstChild, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$17.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$15.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$20.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$27 = _el$25.nextSibling; _el$27.nextSibling; var _el$28 = _el$24.nextSibling, _el$30 = _el$23.nextSibling, _el$31 = _el$30.firstChild, _el$32 = _el$31.nextSibling, _el$33 = _el$32.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$30.nextSibling, _el$36 = _el$35.firstChild, _el$37 = _el$36.nextSibling, _el$38 = _el$37.nextSibling;
14930
+ var _el$0 = _tmpl$827(), _el$1 = _el$0.firstChild, _el$15 = _el$1.firstChild, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$17.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$15.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$20.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$27 = _el$25.nextSibling; _el$27.nextSibling; var _el$28 = _el$24.nextSibling, _el$30 = _el$23.nextSibling, _el$31 = _el$30.firstChild, _el$32 = _el$31.nextSibling, _el$33 = _el$32.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$30.nextSibling, _el$36 = _el$35.firstChild, _el$37 = _el$36.nextSibling, _el$38 = _el$37.nextSibling;
15171
14931
  insert(_el$1, createComponent(Show, {
15172
14932
  get when() {
15173
14933
  return activePlaceholders().length > 0;
15174
14934
  },
15175
14935
  get children() {
15176
- var _el$10 = _tmpl$634(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild; _el$12.nextSibling; var _el$14 = _el$11.nextSibling;
14936
+ var _el$10 = _tmpl$633(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild; _el$12.nextSibling; var _el$14 = _el$11.nextSibling;
15177
14937
  insert(_el$14, createComponent(For, {
15178
14938
  get each() {
15179
14939
  return activePlaceholders();
15180
14940
  },
15181
14941
  children: (p) => (() => {
15182
- var _el$39 = _tmpl$925();
14942
+ var _el$39 = _tmpl$924();
15183
14943
  _el$39.$$click = () => insertToken(p.token);
15184
14944
  _el$39.$$mousedown = (e) => e.preventDefault();
15185
14945
  insert(_el$39, () => p.token);
@@ -15207,7 +14967,7 @@ function EmailTemplates() {
15207
14967
  return cur().bodyParagraphs;
15208
14968
  },
15209
14969
  children: (para, i) => (() => {
15210
- var _el$40 = _tmpl$1102(), _el$41 = _el$40.firstChild;
14970
+ var _el$40 = _tmpl$1101(), _el$41 = _el$40.firstChild;
15211
14971
  _el$41.$$input = (e) => updateParagraph(i, e.currentTarget.value);
15212
14972
  _el$41.addEventListener("focus", (e) => setLastFocused({
15213
14973
  field: "paragraph",
@@ -15219,7 +14979,7 @@ function EmailTemplates() {
15219
14979
  return cur().bodyParagraphs.length > 1;
15220
14980
  },
15221
14981
  get children() {
15222
- var _el$42 = _tmpl$021();
14982
+ var _el$42 = _tmpl$020();
15223
14983
  _el$42.$$click = () => removeParagraph(i);
15224
14984
  return _el$42;
15225
14985
  }
@@ -15233,7 +14993,7 @@ function EmailTemplates() {
15233
14993
  return cur().bodyParagraphs.length < 10;
15234
14994
  },
15235
14995
  get children() {
15236
- var _el$29 = _tmpl$732();
14996
+ var _el$29 = _tmpl$731();
15237
14997
  _el$29.$$click = addParagraph;
15238
14998
  return _el$29;
15239
14999
  }
@@ -15276,26 +15036,37 @@ function EmailTemplates() {
15276
15036
  })();
15277
15037
  }
15278
15038
  delegateEvents(["click", "input", "mousedown"]);
15279
- var _tmpl$287 = /* @__PURE__ */ template(`<div class=app-admin-card style="padding:1rem 1.25rem"><p style=font-size:0.8125rem;color:var(--app-admin-fg-muted);margin:0></p><p style="font-size:1.5rem;font-weight:600;margin:0.25rem 0 0">`);
15280
- var _tmpl$288 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
15281
- var _tmpl$355 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft)"><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0>`);
15282
- var _tmpl$442 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem>`);
15283
- var _tmpl$537 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-danger-fg);font-size:0.8125rem;margin:0>`);
15284
- var _tmpl$635 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-success-fg);font-size:0.8125rem;margin:0>`);
15285
- var _tmpl$733 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;display:grid;gap:0.875rem;max-width:34rem"><label style=display:flex;align-items:center;gap:0.625rem;cursor:pointer><input type=checkbox><span>Send recovery emails</span></label><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>Completed-survey reminders \u2014 hours after the survey was submitted (comma-separated)</span><input class=app-admin-input type=text placeholder="24, 72"></label><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>Mid-survey reminders \u2014 hours after last activity (comma-separated)</span><input class=app-admin-input type=text placeholder="4, 48"></label><div><button type=button class="app-admin-btn app-admin-btn--primary">`);
15286
- var _tmpl$829 = /* @__PURE__ */ template(`<div><div style=margin-bottom:1rem><select class=app-admin-input style=width:auto><option value=7>Last 7 days</option><option value=30>Last 30 days</option><option value=90>Last 90 days</option></select></div><div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Last seen</th><th>Progress</th><th>Email</th><th>Reminders</th></tr></thead><tbody></tbody></table></div><div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Captured</th><th>Name</th><th>Email</th><th>Qualified</th><th>Reminders</th></tr></thead><tbody>`);
15287
- var _tmpl$926 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(10rem, 1fr));gap:0.75rem">`);
15288
- var _tmpl$022 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style="padding:1rem 1.25rem;display:grid;gap:0.625rem">`);
15289
- var _tmpl$1103 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style=padding:1.25rem;display:flex;align-items:flex-end;gap:0.375rem;height:9rem>`);
15290
- var _tmpl$1015 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Track</th><th>Sent</th><th>Recovered</th></tr></thead><tbody><tr><td data-label=Track>Finish signup (completed surveys)</td><td data-label=Sent></td><td data-label=Recovered></td></tr><tr><td data-label=Track>Finish questionnaire (mid-survey)</td><td data-label=Sent></td><td data-label=Recovered></td></tr><tr><td data-label=Track class=app-admin-text-muted>Unsubscribes</td><td data-label=Count colspan=2>`);
15291
- var _tmpl$1117 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:10rem 1fr 7rem;align-items:center;gap:0.75rem"><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)></span><div style=background:var(--app-admin-border-soft);border-radius:4px;height:1.125rem><div style=height:100%;background:var(--app-admin-primary);border-radius:4px></div></div><span style=font-size:0.8125rem;text-align:right><span style=color:var(--app-admin-fg-subtle);margin-left:0.375rem>`);
15292
- var _tmpl$1214 = /* @__PURE__ */ template(`<span style=font-size:0.6875rem;color:var(--app-admin-fg-muted)>`);
15293
- var _tmpl$1313 = /* @__PURE__ */ template(`<div style=flex:1;display:flex;flex-direction:column;align-items:center;gap:0.25rem;height:100%;justify-content:flex-end><div style="width:100%;max-width:1.75rem;border-radius:4px 4px 0 0"></div><span style=font-size:0.625rem;color:var(--app-admin-fg-subtle)>`);
15294
- var _tmpl$1412 = /* @__PURE__ */ template(`<tr><td colspan=4>`);
15295
- var _tmpl$1512 = /* @__PURE__ */ template(`<tr><td data-label="Last seen"class=app-admin-text-muted></td><td data-label=Progress></td><td data-label=Email></td><td data-label=Reminders>`);
15296
- var _tmpl$1612 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>not captured`);
15297
- var _tmpl$1712 = /* @__PURE__ */ template(`<tr><td colspan=5>`);
15298
- var _tmpl$1812 = /* @__PURE__ */ template(`<tr><td data-label=Captured class=app-admin-text-muted></td><td data-label=Name></td><td data-label=Email></td><td data-label=Qualified></td><td data-label=Reminders>`);
15039
+ var _tmpl$280 = /* @__PURE__ */ template(`<div class=app-admin-card style="padding:1rem 1.25rem"><p style=font-size:0.8125rem;color:var(--app-admin-fg-muted);margin:0></p><p style="font-size:1.5rem;font-weight:600;margin:0.25rem 0 0">`);
15040
+ var _tmpl$281 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
15041
+ var _tmpl$354 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft)"><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0>`);
15042
+ var _tmpl$441 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem>`);
15043
+ var _tmpl$536 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-danger-fg);font-size:0.8125rem;margin:0>`);
15044
+ var _tmpl$634 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-success-fg);font-size:0.8125rem;margin:0>`);
15045
+ var _tmpl$732 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;display:grid;gap:0.875rem;max-width:34rem"><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>How reminders go out</span><select class=app-admin-input><option value=off>Off \u2014 send nothing</option><option value=review>Review \u2014 hold for approval, I send them</option><option value=auto>Automatic \u2014 send on the schedule below</option></select><span style=font-size:0.75rem;color:var(--app-admin-fg-muted)></span></label><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>Completed-survey reminders \u2014 hours after the survey was submitted (comma-separated)</span><input class=app-admin-input type=text placeholder="24, 72"></label><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>Mid-survey reminders \u2014 hours after last activity (comma-separated)</span><input class=app-admin-input type=text placeholder="4, 48"></label><div><button type=button class="app-admin-btn app-admin-btn--primary">`);
15046
+ var _tmpl$828 = /* @__PURE__ */ template(`<p style="color:var(--app-admin-danger-fg);font-size:0.8125rem;padding:0 1.25rem">`);
15047
+ var _tmpl$925 = /* @__PURE__ */ template(`<table class=app-admin-table><thead><tr><th>Person</th><th>Where they stopped</th><th>Waiting</th><th>Reminder</th><th></th></tr></thead><tbody>`);
15048
+ var _tmpl$021 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
15049
+ var _tmpl$1102 = /* @__PURE__ */ template(`<div style=display:flex;gap:0.375rem;flex-wrap:wrap><button type=button class="app-admin-btn app-admin-btn--primary"></button><button type=button class=app-admin-btn title="Move past this reminder without emailing. They stay in the funnel for the next one.">Skip</button><button type=button class=app-admin-btn title="Never contact this person about their visit again.">Don't contact`);
15050
+ var _tmpl$1014 = /* @__PURE__ */ template(`<tr><td data-label=Person><div></div></td><td data-label="Where they stopped"></td><td data-label=Waiting></td><td data-label=Reminder> of </td><td>`);
15051
+ var _tmpl$1116 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>`);
15052
+ var _tmpl$1213 = /* @__PURE__ */ template(`<div><div style=margin-bottom:1rem><select class=app-admin-input style=width:auto><option value=7>Last 7 days</option><option value=30>Last 30 days</option><option value=90>Last 90 days</option></select></div><div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Last seen</th><th>Progress</th><th>Email</th><th>Reminders</th></tr></thead><tbody></tbody></table></div><div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Captured</th><th>Name</th><th>Email</th><th>Qualified</th><th>Reminders</th></tr></thead><tbody>`);
15053
+ var _tmpl$1312 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(10rem, 1fr));gap:0.75rem">`);
15054
+ var _tmpl$1412 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style="padding:1rem 1.25rem;display:grid;gap:0.625rem">`);
15055
+ var _tmpl$1512 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style=padding:1.25rem;display:flex;align-items:flex-end;gap:0.375rem;height:9rem>`);
15056
+ var _tmpl$1612 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Track</th><th>Sent</th><th>Recovered</th></tr></thead><tbody><tr><td data-label=Track>Finish signup (completed surveys)</td><td data-label=Sent></td><td data-label=Recovered></td></tr><tr><td data-label=Track>Finish questionnaire (mid-survey)</td><td data-label=Sent></td><td data-label=Recovered></td></tr><tr><td data-label=Track class=app-admin-text-muted>Unsubscribes</td><td data-label=Count colspan=2>`);
15057
+ var _tmpl$1712 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:10rem 1fr 7rem;align-items:center;gap:0.75rem"><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)></span><div style=background:var(--app-admin-border-soft);border-radius:4px;height:1.125rem><div style=height:100%;background:var(--app-admin-primary);border-radius:4px></div></div><span style=font-size:0.8125rem;text-align:right><span style=color:var(--app-admin-fg-subtle);margin-left:0.375rem>`);
15058
+ var _tmpl$1811 = /* @__PURE__ */ template(`<span style=font-size:0.6875rem;color:var(--app-admin-fg-muted)>`);
15059
+ var _tmpl$1911 = /* @__PURE__ */ template(`<div style=flex:1;display:flex;flex-direction:column;align-items:center;gap:0.25rem;height:100%;justify-content:flex-end><div style="width:100%;max-width:1.75rem;border-radius:4px 4px 0 0"></div><span style=font-size:0.625rem;color:var(--app-admin-fg-subtle)>`);
15060
+ var _tmpl$2010 = /* @__PURE__ */ template(`<tr><td colspan=4>`);
15061
+ var _tmpl$2115 = /* @__PURE__ */ template(`<tr><td data-label="Last seen"class=app-admin-text-muted></td><td data-label=Progress></td><td data-label=Email></td><td data-label=Reminders>`);
15062
+ var _tmpl$2212 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>not captured`);
15063
+ var _tmpl$2311 = /* @__PURE__ */ template(`<tr><td colspan=5>`);
15064
+ var _tmpl$2411 = /* @__PURE__ */ template(`<tr><td data-label=Captured class=app-admin-text-muted></td><td data-label=Name></td><td data-label=Email></td><td data-label=Qualified></td><td data-label=Reminders>`);
15065
+ var MODE_HELP = {
15066
+ off: "Nothing is sent and nothing is queued.",
15067
+ review: 'The schedule decides who is due; nothing leaves until you send it. Due reminders appear under "Waiting for approval" below.',
15068
+ auto: "Reminders send by themselves, hourly, with no further review."
15069
+ };
15299
15070
  function pct(n, d) {
15300
15071
  if (!d) return "\u2014";
15301
15072
  return `${Math.round(n / d * 100)}%`;
@@ -15314,7 +15085,7 @@ function formatDate(dateStr) {
15314
15085
  }
15315
15086
  function StatCard(props) {
15316
15087
  return (() => {
15317
- var _el$ = _tmpl$287(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
15088
+ var _el$ = _tmpl$280(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
15318
15089
  insert(_el$2, () => props.label);
15319
15090
  insert(_el$3, () => props.value);
15320
15091
  return _el$;
@@ -15322,14 +15093,14 @@ function StatCard(props) {
15322
15093
  }
15323
15094
  function CardHeader(props) {
15324
15095
  return (() => {
15325
- var _el$4 = _tmpl$355(), _el$5 = _el$4.firstChild;
15096
+ var _el$4 = _tmpl$354(), _el$5 = _el$4.firstChild;
15326
15097
  insert(_el$5, () => props.title);
15327
15098
  insert(_el$4, createComponent(Show, {
15328
15099
  get when() {
15329
15100
  return props.note;
15330
15101
  },
15331
15102
  get children() {
15332
- var _el$6 = _tmpl$288();
15103
+ var _el$6 = _tmpl$281();
15333
15104
  insert(_el$6, () => props.note);
15334
15105
  return _el$6;
15335
15106
  }
@@ -15372,7 +15143,7 @@ function RecoverySettingsCard() {
15372
15143
  await apiFetch("/admin/settings/funnel-recovery", {
15373
15144
  method: "PUT",
15374
15145
  body: JSON.stringify({
15375
- enabled: s.enabled,
15146
+ mode: s.mode,
15376
15147
  stagesHours,
15377
15148
  incompleteStagesHours
15378
15149
  })
@@ -15393,7 +15164,7 @@ function RecoverySettingsCard() {
15393
15164
  }
15394
15165
  };
15395
15166
  return (() => {
15396
- var _el$7 = _tmpl$442();
15167
+ var _el$7 = _tmpl$441();
15397
15168
  insert(_el$7, createComponent(CardHeader, {
15398
15169
  title: "Recovery email settings"
15399
15170
  }), null);
@@ -15415,39 +15186,40 @@ function RecoverySettingsCard() {
15415
15186
  return createComponent(LoadingSpinner, {});
15416
15187
  },
15417
15188
  children: (s) => (() => {
15418
- var _el$8 = _tmpl$733(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$9.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling, _el$12 = _el$1.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$17 = _el$12.nextSibling, _el$18 = _el$17.firstChild;
15419
- _el$0.addEventListener("change", (e) => setSettings({
15189
+ var _el$8 = _tmpl$732(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$1.nextSibling, _el$11 = _el$9.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling, _el$14 = _el$11.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$19 = _el$14.nextSibling, _el$20 = _el$19.firstChild;
15190
+ _el$1.addEventListener("change", (e) => setSettings({
15420
15191
  ...s(),
15421
- enabled: e.currentTarget.checked
15192
+ mode: e.currentTarget.value
15422
15193
  }));
15423
- _el$11.$$input = (e) => setStagesText(e.currentTarget.value);
15424
- _el$14.$$input = (e) => setIncompleteText(e.currentTarget.value);
15194
+ insert(_el$10, () => MODE_HELP[s().mode]);
15195
+ _el$13.$$input = (e) => setStagesText(e.currentTarget.value);
15196
+ _el$16.$$input = (e) => setIncompleteText(e.currentTarget.value);
15425
15197
  insert(_el$8, createComponent(Show, {
15426
15198
  get when() {
15427
15199
  return error();
15428
15200
  },
15429
15201
  get children() {
15430
- var _el$15 = _tmpl$537();
15431
- insert(_el$15, error);
15432
- return _el$15;
15202
+ var _el$17 = _tmpl$536();
15203
+ insert(_el$17, error);
15204
+ return _el$17;
15433
15205
  }
15434
- }), _el$17);
15206
+ }), _el$19);
15435
15207
  insert(_el$8, createComponent(Show, {
15436
15208
  get when() {
15437
15209
  return status();
15438
15210
  },
15439
15211
  get children() {
15440
- var _el$16 = _tmpl$635();
15441
- insert(_el$16, status);
15442
- return _el$16;
15212
+ var _el$18 = _tmpl$634();
15213
+ insert(_el$18, status);
15214
+ return _el$18;
15443
15215
  }
15444
- }), _el$17);
15445
- _el$18.$$click = () => void save();
15446
- insert(_el$18, () => saving() ? "Saving\u2026" : "Save settings");
15447
- effect(() => _el$18.disabled = saving());
15448
- effect(() => _el$0.checked = s().enabled);
15449
- effect(() => _el$11.value = stagesText());
15450
- effect(() => _el$14.value = incompleteText());
15216
+ }), _el$19);
15217
+ _el$20.$$click = () => void save();
15218
+ insert(_el$20, () => saving() ? "Saving\u2026" : "Save settings");
15219
+ effect(() => _el$20.disabled = saving());
15220
+ effect(() => _el$1.value = s().mode);
15221
+ effect(() => _el$13.value = stagesText());
15222
+ effect(() => _el$16.value = incompleteText());
15451
15223
  return _el$8;
15452
15224
  })()
15453
15225
  });
@@ -15456,6 +15228,141 @@ function RecoverySettingsCard() {
15456
15228
  return _el$7;
15457
15229
  })();
15458
15230
  }
15231
+ function RecoveryQueue() {
15232
+ const [reload, setReload] = createSignal(0);
15233
+ const [busy, setBusy] = createSignal(null);
15234
+ const [error, setError] = createSignal(null);
15235
+ const [done, setDone] = createSignal({});
15236
+ const [queue, {
15237
+ refetch
15238
+ }] = createResource(reload, () => apiFetch("/admin/funnel/recovery-queue").catch(() => null));
15239
+ const key = (c) => `${c.kind}:${c.id}`;
15240
+ const act = async (c, action) => {
15241
+ setBusy(key(c));
15242
+ setError(null);
15243
+ try {
15244
+ await apiFetch(`/admin/funnel/recovery-queue/${action}`, {
15245
+ method: "POST",
15246
+ body: JSON.stringify({
15247
+ kind: c.kind,
15248
+ id: c.id
15249
+ })
15250
+ });
15251
+ setDone({
15252
+ ...done(),
15253
+ [key(c)]: action
15254
+ });
15255
+ void refetch();
15256
+ } catch (e) {
15257
+ setError(e.message);
15258
+ } finally {
15259
+ setBusy(null);
15260
+ }
15261
+ };
15262
+ const label = (c) => c.kind === "capture" ? "Finished the questionnaire, never signed up" : c.lastStep != null && c.stepCount ? `Stopped at step ${c.lastStep + 1} of ${c.stepCount}` : "Started the questionnaire, never finished";
15263
+ return createComponent(Show, {
15264
+ get when() {
15265
+ return queue()?.mode === "review";
15266
+ },
15267
+ get children() {
15268
+ var _el$21 = _tmpl$441();
15269
+ insert(_el$21, createComponent(CardHeader, {
15270
+ title: "Waiting for approval",
15271
+ note: "Due by the schedule below. Nothing here has been emailed, and nothing will be until you send it."
15272
+ }), null);
15273
+ insert(_el$21, createComponent(Show, {
15274
+ get when() {
15275
+ return error();
15276
+ },
15277
+ get children() {
15278
+ var _el$22 = _tmpl$828();
15279
+ insert(_el$22, error);
15280
+ return _el$22;
15281
+ }
15282
+ }), null);
15283
+ insert(_el$21, createComponent(Show, {
15284
+ get when() {
15285
+ return (queue()?.candidates.length ?? 0) > 0;
15286
+ },
15287
+ get fallback() {
15288
+ return createComponent(EmptyState, {
15289
+ message: "Nobody is due a reminder right now."
15290
+ });
15291
+ },
15292
+ get children() {
15293
+ var _el$23 = _tmpl$925(), _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling;
15294
+ insert(_el$25, createComponent(For, {
15295
+ get each() {
15296
+ return queue().candidates;
15297
+ },
15298
+ children: (c) => (() => {
15299
+ var _el$26 = _tmpl$1014(), _el$27 = _el$26.firstChild, _el$28 = _el$27.firstChild, _el$30 = _el$27.nextSibling, _el$31 = _el$30.nextSibling, _el$32 = _el$31.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$32.nextSibling;
15300
+ insert(_el$28, () => c.name || c.email);
15301
+ insert(_el$27, createComponent(Show, {
15302
+ get when() {
15303
+ return c.name;
15304
+ },
15305
+ get children() {
15306
+ var _el$29 = _tmpl$021();
15307
+ insert(_el$29, () => c.email);
15308
+ return _el$29;
15309
+ }
15310
+ }), null);
15311
+ insert(_el$30, () => label(c));
15312
+ insert(_el$31, () => daysAgo(c.lastActivityAt));
15313
+ insert(_el$32, () => c.stage + 1, _el$33);
15314
+ insert(_el$32, () => c.totalStages, null);
15315
+ insert(_el$34, createComponent(Show, {
15316
+ get when() {
15317
+ return !done()[key(c)];
15318
+ },
15319
+ get fallback() {
15320
+ return (() => {
15321
+ var _el$39 = _tmpl$1116();
15322
+ insert(_el$39, () => DONE_LABEL[done()[key(c)]]);
15323
+ return _el$39;
15324
+ })();
15325
+ },
15326
+ get children() {
15327
+ var _el$35 = _tmpl$1102(), _el$36 = _el$35.firstChild, _el$37 = _el$36.nextSibling, _el$38 = _el$37.nextSibling;
15328
+ _el$36.$$click = () => void act(c, "send");
15329
+ insert(_el$36, () => busy() === key(c) ? "Sending\u2026" : "Send");
15330
+ _el$37.$$click = () => void act(c, "skip");
15331
+ _el$38.$$click = () => void act(c, "suppress");
15332
+ effect((_p$) => {
15333
+ var _v$ = busy() === key(c), _v$2 = busy() === key(c), _v$3 = busy() === key(c);
15334
+ _v$ !== _p$.e && (_el$36.disabled = _p$.e = _v$);
15335
+ _v$2 !== _p$.t && (_el$37.disabled = _p$.t = _v$2);
15336
+ _v$3 !== _p$.a && (_el$38.disabled = _p$.a = _v$3);
15337
+ return _p$;
15338
+ }, {
15339
+ e: void 0,
15340
+ t: void 0,
15341
+ a: void 0
15342
+ });
15343
+ return _el$35;
15344
+ }
15345
+ }));
15346
+ return _el$26;
15347
+ })()
15348
+ }));
15349
+ return _el$23;
15350
+ }
15351
+ }), null);
15352
+ return _el$21;
15353
+ }
15354
+ });
15355
+ }
15356
+ var DONE_LABEL = {
15357
+ send: "Sent",
15358
+ skip: "Skipped",
15359
+ suppress: "Suppressed"
15360
+ };
15361
+ function daysAgo(iso) {
15362
+ const days = Math.floor((Date.now() - new Date(iso).getTime()) / 864e5);
15363
+ if (days < 1) return "today";
15364
+ return days === 1 ? "1 day" : `${days} days`;
15365
+ }
15459
15366
  function Funnel() {
15460
15367
  const [days, setDays] = createSignal(30);
15461
15368
  const [summary] = createResource(days, (d) => apiFetch(`/admin/funnel/summary?days=${d}`));
@@ -15482,13 +15389,13 @@ function Funnel() {
15482
15389
  const dropoffMax = () => Math.max(1, ...(summary()?.stepDropoff ?? []).map((b) => b.count));
15483
15390
  const totalRecovered = () => (summary()?.recovery.captureRecovered ?? 0) + (summary()?.recovery.sessionRecovered ?? 0);
15484
15391
  return (() => {
15485
- var _el$19 = _tmpl$829(), _el$20 = _el$19.firstChild, _el$21 = _el$20.firstChild, _el$22 = _el$20.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$22.nextSibling, _el$27 = _el$26.firstChild, _el$28 = _el$27.firstChild, _el$29 = _el$28.nextSibling;
15486
- insert(_el$19, createComponent(PageTitle, {
15392
+ var _el$40 = _tmpl$1213(), _el$41 = _el$40.firstChild, _el$42 = _el$41.firstChild, _el$43 = _el$41.nextSibling, _el$44 = _el$43.firstChild, _el$45 = _el$44.firstChild, _el$46 = _el$45.nextSibling, _el$47 = _el$43.nextSibling, _el$48 = _el$47.firstChild, _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling;
15393
+ insert(_el$40, createComponent(PageTitle, {
15487
15394
  subtitle: "Survey drop-off and abandoned-checkout recovery",
15488
15395
  children: "Funnel"
15489
- }), _el$20);
15490
- _el$21.addEventListener("change", (e) => setDays(parseInt(e.currentTarget.value)));
15491
- insert(_el$19, createComponent(Show, {
15396
+ }), _el$41);
15397
+ _el$42.addEventListener("change", (e) => setDays(parseInt(e.currentTarget.value)));
15398
+ insert(_el$40, createComponent(Show, {
15492
15399
  get when() {
15493
15400
  return summary();
15494
15401
  },
@@ -15496,141 +15403,142 @@ function Funnel() {
15496
15403
  return createComponent(LoadingSpinner, {});
15497
15404
  },
15498
15405
  children: (s) => [(() => {
15499
- var _el$30 = _tmpl$926();
15500
- insert(_el$30, createComponent(StatCard, {
15406
+ var _el$51 = _tmpl$1312();
15407
+ insert(_el$51, createComponent(StatCard, {
15501
15408
  label: "Surveys Started",
15502
15409
  get value() {
15503
15410
  return s().sessions.started;
15504
15411
  }
15505
15412
  }), null);
15506
- insert(_el$30, createComponent(StatCard, {
15413
+ insert(_el$51, createComponent(StatCard, {
15507
15414
  label: "Completion Rate",
15508
15415
  get value() {
15509
15416
  return pct(s().captures.total, s().sessions.started);
15510
15417
  }
15511
15418
  }), null);
15512
- insert(_el$30, createComponent(StatCard, {
15419
+ insert(_el$51, createComponent(StatCard, {
15513
15420
  label: "Qualified Rate",
15514
15421
  get value() {
15515
15422
  return pct(s().captures.qualified, s().captures.total);
15516
15423
  }
15517
15424
  }), null);
15518
- insert(_el$30, createComponent(StatCard, {
15425
+ insert(_el$51, createComponent(StatCard, {
15519
15426
  label: "Signup Conversion",
15520
15427
  get value() {
15521
15428
  return pct(s().captures.converted, s().captures.leads);
15522
15429
  }
15523
15430
  }), null);
15524
- insert(_el$30, createComponent(StatCard, {
15431
+ insert(_el$51, createComponent(StatCard, {
15525
15432
  label: "Recovered by Email",
15526
15433
  get value() {
15527
15434
  return totalRecovered();
15528
15435
  }
15529
15436
  }), null);
15530
- return _el$30;
15437
+ return _el$51;
15531
15438
  })(), (() => {
15532
- var _el$31 = _tmpl$022(), _el$32 = _el$31.firstChild;
15533
- insert(_el$31, createComponent(CardHeader, {
15439
+ var _el$52 = _tmpl$1412(), _el$53 = _el$52.firstChild;
15440
+ insert(_el$52, createComponent(CardHeader, {
15534
15441
  title: "Funnel stages"
15535
- }), _el$32);
15536
- insert(_el$32, createComponent(For, {
15442
+ }), _el$53);
15443
+ insert(_el$53, createComponent(For, {
15537
15444
  get each() {
15538
15445
  return stages();
15539
15446
  },
15540
15447
  children: (stage, i) => (() => {
15541
- var _el$50 = _tmpl$1117(), _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling, _el$53 = _el$52.firstChild, _el$54 = _el$52.nextSibling, _el$55 = _el$54.firstChild;
15542
- insert(_el$51, () => stage.label);
15543
- insert(_el$54, () => stage.value, _el$55);
15544
- insert(_el$55, (() => {
15448
+ var _el$71 = _tmpl$1712(), _el$72 = _el$71.firstChild, _el$73 = _el$72.nextSibling, _el$74 = _el$73.firstChild, _el$75 = _el$73.nextSibling, _el$76 = _el$75.firstChild;
15449
+ insert(_el$72, () => stage.label);
15450
+ insert(_el$75, () => stage.value, _el$76);
15451
+ insert(_el$76, (() => {
15545
15452
  var _c$ = memo(() => i() > 0);
15546
15453
  return () => _c$() ? pct(stage.value, stages()[i() - 1].value) : "";
15547
15454
  })());
15548
15455
  effect((_p$) => {
15549
- var _v$ = `${stage.label}: ${stage.value}`, _v$2 = `${stage.value / stageMax() * 100}%`, _v$3 = stage.value > 0 ? "4px" : "0";
15550
- _v$ !== _p$.e && setAttribute(_el$50, "title", _p$.e = _v$);
15551
- _v$2 !== _p$.t && setStyleProperty(_el$53, "width", _p$.t = _v$2);
15552
- _v$3 !== _p$.a && setStyleProperty(_el$53, "min-width", _p$.a = _v$3);
15456
+ var _v$4 = `${stage.label}: ${stage.value}`, _v$5 = `${stage.value / stageMax() * 100}%`, _v$6 = stage.value > 0 ? "4px" : "0";
15457
+ _v$4 !== _p$.e && setAttribute(_el$71, "title", _p$.e = _v$4);
15458
+ _v$5 !== _p$.t && setStyleProperty(_el$74, "width", _p$.t = _v$5);
15459
+ _v$6 !== _p$.a && setStyleProperty(_el$74, "min-width", _p$.a = _v$6);
15553
15460
  return _p$;
15554
15461
  }, {
15555
15462
  e: void 0,
15556
15463
  t: void 0,
15557
15464
  a: void 0
15558
15465
  });
15559
- return _el$50;
15466
+ return _el$71;
15560
15467
  })()
15561
15468
  }));
15562
- return _el$31;
15469
+ return _el$52;
15563
15470
  })(), (() => {
15564
- var _el$33 = _tmpl$1103(), _el$34 = _el$33.firstChild;
15565
- insert(_el$33, createComponent(CardHeader, {
15471
+ var _el$54 = _tmpl$1512(), _el$55 = _el$54.firstChild;
15472
+ insert(_el$54, createComponent(CardHeader, {
15566
15473
  title: "Where abandons quit",
15567
15474
  get note() {
15568
15475
  return "Survey progress at last activity \u2014 the final bucket is the contact-info step. Leaving the page counts immediately; a silently-dropped session counts after 4 quiet hours." + (s().sessions.active > 0 ? ` ${s().sessions.active} session${s().sessions.active === 1 ? "" : "s"} still in progress \u2014 not counted yet.` : "");
15569
15476
  }
15570
- }), _el$34);
15571
- insert(_el$34, createComponent(For, {
15477
+ }), _el$55);
15478
+ insert(_el$55, createComponent(For, {
15572
15479
  get each() {
15573
15480
  return s().stepDropoff;
15574
15481
  },
15575
15482
  children: (b) => (() => {
15576
- var _el$56 = _tmpl$1313(), _el$58 = _el$56.firstChild, _el$59 = _el$58.nextSibling;
15577
- insert(_el$56, createComponent(Show, {
15483
+ var _el$77 = _tmpl$1911(), _el$79 = _el$77.firstChild, _el$80 = _el$79.nextSibling;
15484
+ insert(_el$77, createComponent(Show, {
15578
15485
  get when() {
15579
15486
  return b.count > 0;
15580
15487
  },
15581
15488
  get children() {
15582
- var _el$57 = _tmpl$1214();
15583
- insert(_el$57, () => b.count);
15584
- return _el$57;
15489
+ var _el$78 = _tmpl$1811();
15490
+ insert(_el$78, () => b.count);
15491
+ return _el$78;
15585
15492
  }
15586
- }), _el$58);
15587
- insert(_el$59, (() => {
15493
+ }), _el$79);
15494
+ insert(_el$80, (() => {
15588
15495
  var _c$2 = memo(() => b.bucket === 0);
15589
15496
  return () => _c$2() ? "Start" : memo(() => b.bucket === 10)() ? "Info" : b.bucket === 5 ? "50%" : "";
15590
15497
  })());
15591
15498
  effect((_p$) => {
15592
- var _v$4 = `${b.bucket * 10}% through: ${b.count} abandon${b.count === 1 ? "" : "s"}`, _v$5 = `${Math.max(b.count > 0 ? 6 : 2, b.count / dropoffMax() * 100)}px`, _v$6 = b.count > 0 ? "var(--app-admin-primary)" : "var(--app-admin-border-soft)";
15593
- _v$4 !== _p$.e && setAttribute(_el$56, "title", _p$.e = _v$4);
15594
- _v$5 !== _p$.t && setStyleProperty(_el$58, "height", _p$.t = _v$5);
15595
- _v$6 !== _p$.a && setStyleProperty(_el$58, "background", _p$.a = _v$6);
15499
+ var _v$7 = `${b.bucket * 10}% through: ${b.count} abandon${b.count === 1 ? "" : "s"}`, _v$8 = `${Math.max(b.count > 0 ? 6 : 2, b.count / dropoffMax() * 100)}px`, _v$9 = b.count > 0 ? "var(--app-admin-primary)" : "var(--app-admin-border-soft)";
15500
+ _v$7 !== _p$.e && setAttribute(_el$77, "title", _p$.e = _v$7);
15501
+ _v$8 !== _p$.t && setStyleProperty(_el$79, "height", _p$.t = _v$8);
15502
+ _v$9 !== _p$.a && setStyleProperty(_el$79, "background", _p$.a = _v$9);
15596
15503
  return _p$;
15597
15504
  }, {
15598
15505
  e: void 0,
15599
15506
  t: void 0,
15600
15507
  a: void 0
15601
15508
  });
15602
- return _el$56;
15509
+ return _el$77;
15603
15510
  })()
15604
15511
  }));
15605
- return _el$33;
15512
+ return _el$54;
15606
15513
  })(), (() => {
15607
- var _el$35 = _tmpl$1015(), _el$36 = _el$35.firstChild, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$38.firstChild, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling, _el$42 = _el$41.nextSibling, _el$43 = _el$39.nextSibling, _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling, _el$46 = _el$45.nextSibling, _el$47 = _el$43.nextSibling, _el$48 = _el$47.firstChild, _el$49 = _el$48.nextSibling;
15608
- insert(_el$35, createComponent(CardHeader, {
15514
+ var _el$56 = _tmpl$1612(), _el$57 = _el$56.firstChild, _el$58 = _el$57.firstChild, _el$59 = _el$58.nextSibling, _el$60 = _el$59.firstChild, _el$61 = _el$60.firstChild, _el$62 = _el$61.nextSibling, _el$63 = _el$62.nextSibling, _el$64 = _el$60.nextSibling, _el$65 = _el$64.firstChild, _el$66 = _el$65.nextSibling, _el$67 = _el$66.nextSibling, _el$68 = _el$64.nextSibling, _el$69 = _el$68.firstChild, _el$70 = _el$69.nextSibling;
15515
+ insert(_el$56, createComponent(CardHeader, {
15609
15516
  title: "Recovery emails"
15610
- }), _el$36);
15611
- insert(_el$41, () => s().recovery.captureRemindersSent);
15612
- insert(_el$42, () => s().recovery.captureRecovered);
15613
- insert(_el$45, () => s().recovery.sessionRemindersSent);
15614
- insert(_el$46, () => s().recovery.sessionRecovered);
15615
- insert(_el$49, () => s().recovery.optOuts);
15616
- return _el$35;
15517
+ }), _el$57);
15518
+ insert(_el$62, () => s().recovery.captureRemindersSent);
15519
+ insert(_el$63, () => s().recovery.captureRecovered);
15520
+ insert(_el$66, () => s().recovery.sessionRemindersSent);
15521
+ insert(_el$67, () => s().recovery.sessionRecovered);
15522
+ insert(_el$70, () => s().recovery.optOuts);
15523
+ return _el$56;
15617
15524
  })()]
15618
- }), _el$22);
15619
- insert(_el$19, createComponent(RecoverySettingsCard, {}), _el$22);
15620
- insert(_el$22, createComponent(CardHeader, {
15525
+ }), _el$43);
15526
+ insert(_el$40, createComponent(RecoveryQueue, {}), _el$43);
15527
+ insert(_el$40, createComponent(RecoverySettingsCard, {}), _el$43);
15528
+ insert(_el$43, createComponent(CardHeader, {
15621
15529
  title: "Recent abandons"
15622
- }), _el$23);
15623
- insert(_el$25, createComponent(Show, {
15530
+ }), _el$44);
15531
+ insert(_el$46, createComponent(Show, {
15624
15532
  get when() {
15625
15533
  return (abandons()?.sessions ?? []).length > 0;
15626
15534
  },
15627
15535
  get fallback() {
15628
15536
  return (() => {
15629
- var _el$60 = _tmpl$1412(), _el$61 = _el$60.firstChild;
15630
- insert(_el$61, createComponent(EmptyState, {
15537
+ var _el$81 = _tmpl$2010(), _el$82 = _el$81.firstChild;
15538
+ insert(_el$82, createComponent(EmptyState, {
15631
15539
  message: "No abandoned sessions"
15632
15540
  }));
15633
- return _el$60;
15541
+ return _el$81;
15634
15542
  })();
15635
15543
  },
15636
15544
  get children() {
@@ -15639,33 +15547,33 @@ function Funnel() {
15639
15547
  return abandons()?.sessions;
15640
15548
  },
15641
15549
  children: (sess) => (() => {
15642
- var _el$62 = _tmpl$1512(), _el$63 = _el$62.firstChild, _el$64 = _el$63.nextSibling, _el$65 = _el$64.nextSibling, _el$66 = _el$65.nextSibling;
15643
- insert(_el$63, () => formatDate(sess.last_seen_at));
15644
- insert(_el$64, (() => {
15550
+ var _el$83 = _tmpl$2115(), _el$84 = _el$83.firstChild, _el$85 = _el$84.nextSibling, _el$86 = _el$85.nextSibling, _el$87 = _el$86.nextSibling;
15551
+ insert(_el$84, () => formatDate(sess.last_seen_at));
15552
+ insert(_el$85, (() => {
15645
15553
  var _c$3 = memo(() => !!(sess.last_step != null && sess.step_count));
15646
15554
  return () => _c$3() ? `Step ${Math.min(sess.last_step + 1, sess.step_count)} of ${sess.step_count}` : "\u2014";
15647
15555
  })());
15648
- insert(_el$65, () => sess.email ?? _tmpl$1612());
15649
- insert(_el$66, () => sess.reminders_sent);
15650
- return _el$62;
15556
+ insert(_el$86, () => sess.email ?? _tmpl$2212());
15557
+ insert(_el$87, () => sess.reminders_sent);
15558
+ return _el$83;
15651
15559
  })()
15652
15560
  });
15653
15561
  }
15654
15562
  }));
15655
- insert(_el$26, createComponent(CardHeader, {
15563
+ insert(_el$47, createComponent(CardHeader, {
15656
15564
  title: "Completed surveys, not signed up"
15657
- }), _el$27);
15658
- insert(_el$29, createComponent(Show, {
15565
+ }), _el$48);
15566
+ insert(_el$50, createComponent(Show, {
15659
15567
  get when() {
15660
15568
  return (leads()?.captures ?? []).length > 0;
15661
15569
  },
15662
15570
  get fallback() {
15663
15571
  return (() => {
15664
- var _el$68 = _tmpl$1712(), _el$69 = _el$68.firstChild;
15665
- insert(_el$69, createComponent(EmptyState, {
15572
+ var _el$89 = _tmpl$2311(), _el$90 = _el$89.firstChild;
15573
+ insert(_el$90, createComponent(EmptyState, {
15666
15574
  message: "No unconverted captures"
15667
15575
  }));
15668
- return _el$68;
15576
+ return _el$89;
15669
15577
  })();
15670
15578
  },
15671
15579
  get children() {
@@ -15674,30 +15582,30 @@ function Funnel() {
15674
15582
  return leads()?.captures;
15675
15583
  },
15676
15584
  children: (c) => (() => {
15677
- var _el$70 = _tmpl$1812(), _el$71 = _el$70.firstChild, _el$72 = _el$71.nextSibling, _el$73 = _el$72.nextSibling, _el$74 = _el$73.nextSibling, _el$75 = _el$74.nextSibling;
15678
- insert(_el$71, () => formatDate(c.captured_at));
15679
- insert(_el$72, () => c.patient_name ?? "\u2014");
15680
- insert(_el$73, () => c.email ?? "\u2014");
15681
- insert(_el$74, () => c.qualified ? "Yes" : "No");
15682
- insert(_el$75, () => c.reminders_sent);
15683
- return _el$70;
15585
+ var _el$91 = _tmpl$2411(), _el$92 = _el$91.firstChild, _el$93 = _el$92.nextSibling, _el$94 = _el$93.nextSibling, _el$95 = _el$94.nextSibling, _el$96 = _el$95.nextSibling;
15586
+ insert(_el$92, () => formatDate(c.captured_at));
15587
+ insert(_el$93, () => c.patient_name ?? "\u2014");
15588
+ insert(_el$94, () => c.email ?? "\u2014");
15589
+ insert(_el$95, () => c.qualified ? "Yes" : "No");
15590
+ insert(_el$96, () => c.reminders_sent);
15591
+ return _el$91;
15684
15592
  })()
15685
15593
  });
15686
15594
  }
15687
15595
  }));
15688
- effect(() => _el$21.value = days());
15689
- return _el$19;
15596
+ effect(() => _el$42.value = days());
15597
+ return _el$40;
15690
15598
  })();
15691
15599
  }
15692
15600
  delegateEvents(["input", "click"]);
15693
15601
 
15694
15602
  // src/pages/AdminDashboard.tsx
15695
- var _tmpl$289 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
15696
- var _tmpl$290 = /* @__PURE__ */ template(`<button type=button style="display:flex;align-items:center;gap:0.75rem;padding:0.625rem 0.75rem;border-radius:var(--app-admin-radius-sm);font-size:0.875rem;font-weight:500;text-align:left;border:none;cursor:pointer">`);
15697
- var _tmpl$356 = /* @__PURE__ */ template(`<div class="app-admin-root app-admin-shell"style=position:sticky><div class=app-admin-shell-header><button type=button class=app-admin-shell-menu-trigger aria-label="Open admin menu"><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=18 x2=21 y2=18></line></svg></button><span class=app-admin-shell-header-title></span></div><div class=app-admin-backdrop aria-hidden=true></div><aside class=app-admin-sidebar><div style=padding:1.25rem><h2 style="font-size:0.7rem;font-weight:500;color:var(--app-admin-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 1rem">Admin Panel</h2><nav style=display:flex;flex-direction:column;gap:0.25rem></nav></div></aside><div class=app-admin-content>`);
15698
- var _tmpl$443 = /* @__PURE__ */ template(`<h3 style="font-size:0.625rem;font-weight:600;color:var(--app-admin-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:1rem 0 0.375rem;padding:0 0.75rem">`);
15699
- var _tmpl$538 = /* @__PURE__ */ template(`<div role=alert style="margin:1rem 0;padding:1.25rem 1.5rem;border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm);background:var(--app-admin-surface);color:var(--app-admin-fg)"><div style=font-weight:600;margin-bottom:0.375rem>This section failed to load</div><div style=font-size:0.875rem;color:var(--app-admin-fg-muted);margin-bottom:1rem;word-break:break-word></div><button type=button style="padding:0.5rem 0.875rem;border-radius:var(--app-admin-radius-sm);border:1px solid var(--app-admin-border);background:var(--app-admin-primary-soft);color:var(--app-admin-primary-soft-fg);font-size:0.875rem;font-weight:500;cursor:pointer">Try again`);
15700
- var _tmpl$636 = /* @__PURE__ */ template(`<div class=app-admin-root style=display:flex;align-items:center;justify-content:center;position:sticky;background:var(--app-admin-bg)><div role=status aria-label="Loading admin"style="width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--app-admin-border);border-top-color:var(--app-admin-primary);animation:app-admin-gate-spin 0.8s linear infinite"></div><style>@keyframes app-admin-gate-spin { to { transform: rotate(360deg); } }`);
15603
+ var _tmpl$286 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
15604
+ var _tmpl$287 = /* @__PURE__ */ template(`<button type=button style="display:flex;align-items:center;gap:0.75rem;padding:0.625rem 0.75rem;border-radius:var(--app-admin-radius-sm);font-size:0.875rem;font-weight:500;text-align:left;border:none;cursor:pointer">`);
15605
+ var _tmpl$355 = /* @__PURE__ */ template(`<div class="app-admin-root app-admin-shell"style=position:sticky><div class=app-admin-shell-header><button type=button class=app-admin-shell-menu-trigger aria-label="Open admin menu"><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=18 x2=21 y2=18></line></svg></button><span class=app-admin-shell-header-title></span></div><div class=app-admin-backdrop aria-hidden=true></div><aside class=app-admin-sidebar><div style=padding:1.25rem><h2 style="font-size:0.7rem;font-weight:500;color:var(--app-admin-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 1rem">Admin Panel</h2><nav style=display:flex;flex-direction:column;gap:0.25rem></nav></div></aside><div class=app-admin-content>`);
15606
+ var _tmpl$442 = /* @__PURE__ */ template(`<h3 style="font-size:0.625rem;font-weight:600;color:var(--app-admin-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:1rem 0 0.375rem;padding:0 0.75rem">`);
15607
+ var _tmpl$537 = /* @__PURE__ */ template(`<div role=alert style="margin:1rem 0;padding:1.25rem 1.5rem;border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm);background:var(--app-admin-surface);color:var(--app-admin-fg)"><div style=font-weight:600;margin-bottom:0.375rem>This section failed to load</div><div style=font-size:0.875rem;color:var(--app-admin-fg-muted);margin-bottom:1rem;word-break:break-word></div><button type=button style="padding:0.5rem 0.875rem;border-radius:var(--app-admin-radius-sm);border:1px solid var(--app-admin-border);background:var(--app-admin-primary-soft);color:var(--app-admin-primary-soft-fg);font-size:0.875rem;font-weight:500;cursor:pointer">Try again`);
15608
+ var _tmpl$635 = /* @__PURE__ */ template(`<div class=app-admin-root style=display:flex;align-items:center;justify-content:center;position:sticky;background:var(--app-admin-bg)><div role=status aria-label="Loading admin"style="width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--app-admin-border);border-top-color:var(--app-admin-primary);animation:app-admin-gate-spin 0.8s linear infinite"></div><style>@keyframes app-admin-gate-spin { to { transform: rotate(360deg); } }`);
15701
15609
  var TAB_LABELS = {
15702
15610
  dashboard: "Dashboard",
15703
15611
  customers: "Customers",
@@ -15796,14 +15704,14 @@ function AdminDashboard(props) {
15796
15704
  };
15797
15705
  const topOffset = () => props.topOffset ?? "0px";
15798
15706
  const TabButton = (btnProps) => (() => {
15799
- var _el$ = _tmpl$290();
15707
+ var _el$ = _tmpl$287();
15800
15708
  _el$.$$click = () => handleTabClick(btnProps.tab);
15801
15709
  insert(_el$, createComponent(Show, {
15802
15710
  get when() {
15803
15711
  return props.tabIcons?.[btnProps.tab];
15804
15712
  },
15805
15713
  get children() {
15806
- var _el$2 = _tmpl$289();
15714
+ var _el$2 = _tmpl$286();
15807
15715
  effect(() => className(_el$2, props.tabIcons[btnProps.tab]));
15808
15716
  return _el$2;
15809
15717
  }
@@ -15835,7 +15743,7 @@ function AdminDashboard(props) {
15835
15743
  return createComponent(AdminNavContext.Provider, {
15836
15744
  value: adminNav,
15837
15745
  get children() {
15838
- var _el$3 = _tmpl$356(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$8.nextSibling;
15746
+ var _el$3 = _tmpl$355(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$8.nextSibling;
15839
15747
  _el$5.$$click = () => setDrawerOpen(true);
15840
15748
  insert(_el$6, () => TAB_LABELS[currentTab()]);
15841
15749
  _el$7.$$click = () => setDrawerOpen(false);
@@ -15852,7 +15760,7 @@ function AdminDashboard(props) {
15852
15760
  return visibleGroups();
15853
15761
  },
15854
15762
  children: (group) => [(() => {
15855
- var _el$11 = _tmpl$443();
15763
+ var _el$11 = _tmpl$442();
15856
15764
  insert(_el$11, () => group.label);
15857
15765
  return _el$11;
15858
15766
  })(), createComponent(For, {
@@ -16046,7 +15954,7 @@ function AdminTabError(props) {
16046
15954
  console.error("[AdminDashboard] tab failed to render:", props.error);
16047
15955
  const message = () => props.error instanceof Error ? props.error.message : String(props.error);
16048
15956
  return (() => {
16049
- var _el$12 = _tmpl$538(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling;
15957
+ var _el$12 = _tmpl$537(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling;
16050
15958
  insert(_el$14, message);
16051
15959
  _el$15.$$click = () => props.reset();
16052
15960
  return _el$12;
@@ -16054,7 +15962,7 @@ function AdminTabError(props) {
16054
15962
  }
16055
15963
  function AdminGateSpinner(props) {
16056
15964
  return (() => {
16057
- var _el$16 = _tmpl$636(); _el$16.firstChild;
15965
+ var _el$16 = _tmpl$635(); _el$16.firstChild;
16058
15966
  effect((_p$) => {
16059
15967
  var _v$8 = props.topOffset, _v$9 = `calc(100vh - ${props.topOffset})`;
16060
15968
  _v$8 !== _p$.e && setStyleProperty(_el$16, "top", _p$.e = _v$8);
@@ -16068,8 +15976,222 @@ function AdminGateSpinner(props) {
16068
15976
  })();
16069
15977
  }
16070
15978
  delegateEvents(["click"]);
16071
- var _tmpl$291 = /* @__PURE__ */ template(`<div style=margin-bottom:1rem>`);
16072
- var _tmpl$295 = /* @__PURE__ */ template(`<form><div style=display:grid;gap:1rem;margin-bottom:1.5rem><div style="display:grid;grid-template-columns:repeat(2, 1fr);gap:1rem"></div></div><div style=margin-bottom:1.5rem></div><div style=display:flex;gap:0.75rem>`);
15979
+ var _tmpl$288 = /* @__PURE__ */ template(`<div class=app-admin-modal-backdrop><div class="app-admin-card app-admin-modal"style=max-width:32rem><div class=app-admin-modal-header><h3 class=app-admin-heading style=font-size:1rem;margin:0>Customer dashboard preview</h3><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div class=app-admin-modal-body><div style="padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);background:var(--app-admin-warning-bg);color:var(--app-admin-warning-fg);font-size:0.75rem;font-weight:500">Viewing as <!> \u2014 read-only`);
15980
+ var _tmpl$289 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);font-size:0.75rem;font-weight:500"><span></span><button type=button class="app-admin-btn app-admin-btn-ghost"style="padding:0.25rem 0.75rem">Retry`);
15981
+ var _tmpl$356 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>Could not load this customer's dashboard.`);
15982
+ var _tmpl$443 = /* @__PURE__ */ template(`<div><h3>Profile</h3><div class=app-admin-card-soft style=padding:0.75rem><p style=font-weight:600;font-size:0.9375rem;margin:0></p><p style="font-size:0.8125rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
15983
+ var _tmpl$538 = /* @__PURE__ */ template(`<div><h3>Subscription`);
15984
+ var _tmpl$636 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem>`);
15985
+ var _tmpl$733 = /* @__PURE__ */ template(`<div><h3>Prescription requests`);
15986
+ var _tmpl$829 = /* @__PURE__ */ template(`<div><h3>Pending surveys`);
15987
+ var _tmpl$926 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No active subscription.`);
15988
+ var _tmpl$022 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">Next charge `);
15989
+ var _tmpl$1103 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><span style=font-size:0.875rem;font-weight:500>`);
15990
+ var _tmpl$1015 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
15991
+ var _tmpl$1117 = /* @__PURE__ */ template(`<div><h3>Prescription status</h3><div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><span style=font-size:0.875rem;font-weight:500>Current request`);
15992
+ var _tmpl$1214 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No prescription requests.`);
15993
+ var _tmpl$1313 = /* @__PURE__ */ template(`<span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>`);
15994
+ var _tmpl$1413 = /* @__PURE__ */ template(`<span> \xB7 `);
15995
+ var _tmpl$1513 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><div><span style=font-size:0.875rem;font-weight:500></span></div></div><div style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-top:0.25rem>`);
15996
+ var _tmpl$1613 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No pending surveys.`);
15997
+ var _tmpl$1713 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><span style=font-size:0.875rem;font-weight:500></span><span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>Cycle `);
15998
+ function PatientDashboardPreview(props) {
15999
+ const data = useDashboardData({
16000
+ authToken: () => props.token
16001
+ });
16002
+ return (() => {
16003
+ var _el$ = _tmpl$288(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$3.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$0 = _el$8.nextSibling; _el$0.nextSibling;
16004
+ _el$.$$click = (e) => {
16005
+ if (e.target === e.currentTarget) props.onClose();
16006
+ };
16007
+ addEventListener(_el$5, "click", props.onClose, true);
16008
+ insert(_el$7, () => props.customerName || "customer", _el$0);
16009
+ insert(_el$6, createComponent(Show, {
16010
+ get when() {
16011
+ return data.error();
16012
+ },
16013
+ keyed: true,
16014
+ children: (msg) => (() => {
16015
+ var _el$1 = _tmpl$289(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
16016
+ insert(_el$10, msg);
16017
+ _el$11.$$click = () => data.retry();
16018
+ return _el$1;
16019
+ })()
16020
+ }), null);
16021
+ insert(_el$6, createComponent(Show, {
16022
+ get when() {
16023
+ return !data.profile.loading;
16024
+ },
16025
+ get fallback() {
16026
+ return createComponent(LoadingSpinner, {});
16027
+ },
16028
+ get children() {
16029
+ return createComponent(Show, {
16030
+ get when() {
16031
+ return data.profile();
16032
+ },
16033
+ get fallback() {
16034
+ return _tmpl$356();
16035
+ },
16036
+ children: (profile) => [(() => {
16037
+ var _el$13 = _tmpl$443(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling;
16038
+ insert(_el$16, () => [profile().firstName, profile().lastName].filter(Boolean).join(" ") || "Member");
16039
+ insert(_el$17, () => profile().email);
16040
+ effect((_$p) => style(_el$14, panelSectionHeader, _$p));
16041
+ return _el$13;
16042
+ })(), (() => {
16043
+ var _el$18 = _tmpl$538(), _el$19 = _el$18.firstChild;
16044
+ insert(_el$18, createComponent(Show, {
16045
+ get when() {
16046
+ return data.subscription();
16047
+ },
16048
+ get fallback() {
16049
+ return _tmpl$926();
16050
+ },
16051
+ children: (sub) => (() => {
16052
+ var _el$27 = _tmpl$1103(), _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild;
16053
+ insert(_el$29, createComponent(Show, {
16054
+ get when() {
16055
+ return sub().amount != null;
16056
+ },
16057
+ fallback: "Subscription",
16058
+ get children() {
16059
+ return [memo(() => centsToUsd(sub().amount)), "/mo"];
16060
+ }
16061
+ }));
16062
+ insert(_el$28, createComponent(StatusBadge, {
16063
+ get status() {
16064
+ return sub().status;
16065
+ }
16066
+ }), null);
16067
+ insert(_el$27, createComponent(Show, {
16068
+ get when() {
16069
+ return sub().nextBillingDate;
16070
+ },
16071
+ get children() {
16072
+ var _el$30 = _tmpl$022(); _el$30.firstChild;
16073
+ insert(_el$30, () => fmtDate(sub().nextBillingDate), null);
16074
+ return _el$30;
16075
+ }
16076
+ }), null);
16077
+ return _el$27;
16078
+ })()
16079
+ }), null);
16080
+ effect((_$p) => style(_el$19, panelSectionHeader, _$p));
16081
+ return _el$18;
16082
+ })(), createComponent(Show, {
16083
+ get when() {
16084
+ return data.rxStatus();
16085
+ },
16086
+ children: (rx) => (() => {
16087
+ var _el$32 = _tmpl$1117(), _el$33 = _el$32.firstChild, _el$34 = _el$33.nextSibling, _el$35 = _el$34.firstChild; _el$35.firstChild;
16088
+ insert(_el$35, createComponent(StatusBadge, {
16089
+ get status() {
16090
+ return rx().status;
16091
+ }
16092
+ }), null);
16093
+ insert(_el$34, createComponent(Show, {
16094
+ get when() {
16095
+ return rx().reason;
16096
+ },
16097
+ get children() {
16098
+ var _el$37 = _tmpl$1015();
16099
+ insert(_el$37, () => rx().reason);
16100
+ return _el$37;
16101
+ }
16102
+ }), null);
16103
+ effect((_$p) => style(_el$33, panelSectionHeader, _$p));
16104
+ return _el$32;
16105
+ })()
16106
+ }), (() => {
16107
+ var _el$20 = _tmpl$733(), _el$21 = _el$20.firstChild;
16108
+ insert(_el$20, createComponent(Show, {
16109
+ get when() {
16110
+ return (data.rxList() ?? []).length > 0;
16111
+ },
16112
+ get fallback() {
16113
+ return _tmpl$1214();
16114
+ },
16115
+ get children() {
16116
+ var _el$22 = _tmpl$636();
16117
+ insert(_el$22, createComponent(For, {
16118
+ get each() {
16119
+ return data.rxList();
16120
+ },
16121
+ children: (req) => (() => {
16122
+ var _el$39 = _tmpl$1513(), _el$40 = _el$39.firstChild, _el$41 = _el$40.firstChild, _el$42 = _el$41.firstChild, _el$44 = _el$40.nextSibling;
16123
+ insert(_el$42, () => req.drugName || req.drugId || "Prescription");
16124
+ insert(_el$41, createComponent(Show, {
16125
+ get when() {
16126
+ return req.dosage;
16127
+ },
16128
+ get children() {
16129
+ var _el$43 = _tmpl$1313();
16130
+ insert(_el$43, () => req.dosage);
16131
+ return _el$43;
16132
+ }
16133
+ }), null);
16134
+ insert(_el$40, createComponent(StatusBadge, {
16135
+ get status() {
16136
+ return req.status;
16137
+ }
16138
+ }), null);
16139
+ insert(_el$44, createComponent(Show, {
16140
+ get when() {
16141
+ return req.priceCents != null;
16142
+ },
16143
+ get children() {
16144
+ var _el$45 = _tmpl$1413(), _el$46 = _el$45.firstChild;
16145
+ insert(_el$45, () => centsToUsd(req.priceCents), _el$46);
16146
+ return _el$45;
16147
+ }
16148
+ }), null);
16149
+ insert(_el$44, () => fmtDate(req.createdAt), null);
16150
+ return _el$39;
16151
+ })()
16152
+ }));
16153
+ return _el$22;
16154
+ }
16155
+ }), null);
16156
+ effect((_$p) => style(_el$21, panelSectionHeader, _$p));
16157
+ return _el$20;
16158
+ })(), (() => {
16159
+ var _el$23 = _tmpl$829(), _el$24 = _el$23.firstChild;
16160
+ insert(_el$23, createComponent(Show, {
16161
+ get when() {
16162
+ return (data.pendingSurveys() ?? []).length > 0;
16163
+ },
16164
+ get fallback() {
16165
+ return _tmpl$1613();
16166
+ },
16167
+ get children() {
16168
+ var _el$25 = _tmpl$636();
16169
+ insert(_el$25, createComponent(For, {
16170
+ get each() {
16171
+ return data.pendingSurveys();
16172
+ },
16173
+ children: (survey) => (() => {
16174
+ var _el$48 = _tmpl$1713(), _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling; _el$50.firstChild;
16175
+ insert(_el$49, () => survey.drugName || survey.drugId || "Renewal survey");
16176
+ insert(_el$50, () => survey.cycleNumber, null);
16177
+ return _el$48;
16178
+ })()
16179
+ }));
16180
+ return _el$25;
16181
+ }
16182
+ }), null);
16183
+ effect((_$p) => style(_el$24, panelSectionHeader, _$p));
16184
+ return _el$23;
16185
+ })()]
16186
+ });
16187
+ }
16188
+ }), null);
16189
+ return _el$;
16190
+ })();
16191
+ }
16192
+ delegateEvents(["click"]);
16193
+ var _tmpl$290 = /* @__PURE__ */ template(`<div style=margin-bottom:1rem>`);
16194
+ var _tmpl$291 = /* @__PURE__ */ template(`<form><div style=display:grid;gap:1rem;margin-bottom:1.5rem><div style="display:grid;grid-template-columns:repeat(2, 1fr);gap:1rem"></div></div><div style=margin-bottom:1.5rem></div><div style=display:flex;gap:0.75rem>`);
16073
16195
  var _tmpl$357 = /* @__PURE__ */ template(`<div class=pay-method style="max-width:480px;margin:0 auto;padding:2rem 1.25rem"><p style="color:var(--app-portal-fg-muted, #6e6a66);margin-bottom:1.5rem">Enter a new card for your subscription. Your current card stays active until this succeeds.`);
16074
16196
  var LIVE = /* @__PURE__ */ new Set(["active", "paused", "past_due"]);
16075
16197
  function UpdatePaymentMethod(props) {
@@ -16131,14 +16253,14 @@ function UpdatePaymentMethod(props) {
16131
16253
  return memo(() => !!!resolving())() && !noSubscription();
16132
16254
  },
16133
16255
  get children() {
16134
- var _el$3 = _tmpl$295(), _el$5 = _el$3.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.nextSibling;
16256
+ var _el$3 = _tmpl$291(), _el$5 = _el$3.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.nextSibling;
16135
16257
  _el$3.addEventListener("submit", handleSubmit);
16136
16258
  insert(_el$3, createComponent(Show, {
16137
16259
  get when() {
16138
16260
  return flow.error();
16139
16261
  },
16140
16262
  get children() {
16141
- var _el$4 = _tmpl$291();
16263
+ var _el$4 = _tmpl$290();
16142
16264
  insert(_el$4, createComponent(Banner, {
16143
16265
  variant: "error",
16144
16266
  get children() {
@@ -16216,8 +16338,8 @@ function UpdatePaymentMethod(props) {
16216
16338
  return _el$;
16217
16339
  })();
16218
16340
  }
16219
- var _tmpl$296 = /* @__PURE__ */ template(`<a class=ship__track target=_blank rel="noopener noreferrer">Track<!> \u2197`);
16220
- var _tmpl$297 = /* @__PURE__ */ template(`<div class=ship><p class=ship__eta></p><div class=ship__chip-row><button type=button class=ship__chip><span class=ship__num></span><i class="ph ph-copy ship__copy-icon"aria-hidden=true></i><span class=ship__copied>Copied \u2713</span></button></div><span class=portal-sr-only role=status aria-live=polite>`);
16341
+ var _tmpl$295 = /* @__PURE__ */ template(`<a class=ship__track target=_blank rel="noopener noreferrer">Track<!> \u2197`);
16342
+ var _tmpl$296 = /* @__PURE__ */ template(`<div class=ship><p class=ship__eta></p><div class=ship__chip-row><button type=button class=ship__chip><span class=ship__num></span><i class="ph ph-copy ship__copy-icon"aria-hidden=true></i><span class=ship__copied>Copied \u2713</span></button></div><span class=portal-sr-only role=status aria-live=polite>`);
16221
16343
  var _tmpl$358 = /* @__PURE__ */ template(`<span class=refill__cycle>Day <!> of `);
16222
16344
  var _tmpl$444 = /* @__PURE__ */ template(`<div class=refill data-testid=refill-strip><div class=refill__head><span class=lab-label>Your plan</span></div><div class=refill__rail>`);
16223
16345
  var _tmpl$539 = /* @__PURE__ */ template(`<span class=refill__cycle>Preparing your next fill`);
@@ -16231,10 +16353,10 @@ var _tmpl$1016 = /* @__PURE__ */ template(`<p class=thread__caption>`);
16231
16353
  var _tmpl$1118 = /* @__PURE__ */ template(`<button type=button class="portal-btn portal-btn--primary thread__action">Message your care team`);
16232
16354
  var _tmpl$1215 = /* @__PURE__ */ template(`<button type=button class="portal-btn portal-btn--ghost thread__action">Talk to your provider`);
16233
16355
  var _tmpl$1314 = /* @__PURE__ */ template(`<li><div class=thread__rail><span class=thread__bead></span></div><div><div class=thread__top><span class="lab-label thread__label">`);
16234
- var _tmpl$1413 = /* @__PURE__ */ template(`<p class="thread__caption thread__await"data-testid=await-messaging>Your care team is reviewing your request. You\u2019ll be able to message them here once your consult begins.`);
16235
- var _tmpl$1513 = /* @__PURE__ */ template(`<p class="thread__caption thread__await"data-testid=await-messaging>Your provider will follow up with you about next steps.`);
16236
- var _tmpl$1613 = /* @__PURE__ */ template(`<span class=tracker__dose> \xB7 `);
16237
- var _tmpl$1713 = /* @__PURE__ */ template(`<div class=tracker data-testid=order-tracker><div class=tracker__intro><span class=lab-label>Your order</span><p class=tracker__med></p></div><ol>`);
16356
+ var _tmpl$1414 = /* @__PURE__ */ template(`<p class="thread__caption thread__await"data-testid=await-messaging>Your care team is reviewing your request. You\u2019ll be able to message them here once your consult begins.`);
16357
+ var _tmpl$1514 = /* @__PURE__ */ template(`<p class="thread__caption thread__await"data-testid=await-messaging>Your provider will follow up with you about next steps.`);
16358
+ var _tmpl$1614 = /* @__PURE__ */ template(`<span class=tracker__dose> \xB7 `);
16359
+ var _tmpl$1714 = /* @__PURE__ */ template(`<div class=tracker data-testid=order-tracker><div class=tracker__intro><span class=lab-label>Your order</span><p class=tracker__med></p></div><ol>`);
16238
16360
  function TrackingChip(props) {
16239
16361
  let copied;
16240
16362
  const [announce, setAnnounce] = createSignal("");
@@ -16251,7 +16373,7 @@ function TrackingChip(props) {
16251
16373
  }
16252
16374
  };
16253
16375
  return (() => {
16254
- var _el$ = _tmpl$297(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$10 = _el$3.nextSibling;
16376
+ var _el$ = _tmpl$296(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$10 = _el$3.nextSibling;
16255
16377
  insert(_el$2, () => props.eta);
16256
16378
  _el$4.$$click = copy;
16257
16379
  insert(_el$5, () => props.number);
@@ -16262,7 +16384,7 @@ function TrackingChip(props) {
16262
16384
  return props.url;
16263
16385
  },
16264
16386
  get children() {
16265
- var _el$8 = _tmpl$296(), _el$9 = _el$8.firstChild, _el$1 = _el$9.nextSibling; _el$1.nextSibling;
16387
+ var _el$8 = _tmpl$295(), _el$9 = _el$8.firstChild, _el$1 = _el$9.nextSibling; _el$1.nextSibling;
16266
16388
  insert(_el$8, (() => {
16267
16389
  var _c$ = memo(() => !!props.carrier);
16268
16390
  return () => _c$() ? ` with ${props.carrier}` : "";
@@ -16410,7 +16532,7 @@ function OrderTracker(props) {
16410
16532
  return props.messagingEnabled;
16411
16533
  },
16412
16534
  get fallback() {
16413
- return _tmpl$1413();
16535
+ return _tmpl$1414();
16414
16536
  },
16415
16537
  get children() {
16416
16538
  var _el$43 = _tmpl$1118();
@@ -16430,7 +16552,7 @@ function OrderTracker(props) {
16430
16552
  return props.messagingEnabled;
16431
16553
  },
16432
16554
  get fallback() {
16433
- return _tmpl$1513();
16555
+ return _tmpl$1514();
16434
16556
  },
16435
16557
  get children() {
16436
16558
  var _el$44 = _tmpl$1215();
@@ -16464,14 +16586,14 @@ function OrderTracker(props) {
16464
16586
  children: (rx) => {
16465
16587
  const view = buildTrackerView(rx());
16466
16588
  return (() => {
16467
- var _el$47 = _tmpl$1713(), _el$48 = _el$47.firstChild, _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling, _el$53 = _el$48.nextSibling;
16589
+ var _el$47 = _tmpl$1714(), _el$48 = _el$47.firstChild, _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling, _el$53 = _el$48.nextSibling;
16468
16590
  insert(_el$50, () => props.medicationName, null);
16469
16591
  insert(_el$50, createComponent(Show, {
16470
16592
  get when() {
16471
16593
  return rx().dosage;
16472
16594
  },
16473
16595
  get children() {
16474
- var _el$51 = _tmpl$1613(); _el$51.firstChild;
16596
+ var _el$51 = _tmpl$1614(); _el$51.firstChild;
16475
16597
  insert(_el$51, () => rx().dosage, null);
16476
16598
  return _el$51;
16477
16599
  }
@@ -16506,8 +16628,8 @@ function OrderTracker(props) {
16506
16628
  });
16507
16629
  }
16508
16630
  delegateEvents(["click"]);
16509
- var _tmpl$298 = /* @__PURE__ */ template(`<span class=rx-row__dose> \xB7 `);
16510
- var _tmpl$299 = /* @__PURE__ */ template(`<div class=rx-row__body>`);
16631
+ var _tmpl$297 = /* @__PURE__ */ template(`<span class=rx-row__dose> \xB7 `);
16632
+ var _tmpl$298 = /* @__PURE__ */ template(`<div class=rx-row__body>`);
16511
16633
  var _tmpl$359 = /* @__PURE__ */ template(`<div data-testid=rx-row><button type=button class=rx-row__head><span class=rx-row__med></span><span class=rx-row__status></span><i aria-hidden=true>`);
16512
16634
  var STATUS_LABEL = {
16513
16635
  pending: "Under review",
@@ -16533,7 +16655,7 @@ function RxRow(props) {
16533
16655
  return props.rx.dosage;
16534
16656
  },
16535
16657
  get children() {
16536
- var _el$4 = _tmpl$298(); _el$4.firstChild;
16658
+ var _el$4 = _tmpl$297(); _el$4.firstChild;
16537
16659
  insert(_el$4, () => props.rx.dosage, null);
16538
16660
  return _el$4;
16539
16661
  }
@@ -16544,7 +16666,7 @@ function RxRow(props) {
16544
16666
  return open();
16545
16667
  },
16546
16668
  get children() {
16547
- var _el$8 = _tmpl$299();
16669
+ var _el$8 = _tmpl$298();
16548
16670
  insert(_el$8, createComponent(OrderTracker, {
16549
16671
  get request() {
16550
16672
  return props.request;
@@ -16587,7 +16709,7 @@ function RxRow(props) {
16587
16709
  })();
16588
16710
  }
16589
16711
  delegateEvents(["click"]);
16590
- var _tmpl$300 = /* @__PURE__ */ template(`<div class=plan data-testid=plan-billing><span class=lab-label>Plan &amp; billing`);
16712
+ var _tmpl$299 = /* @__PURE__ */ template(`<div class=plan data-testid=plan-billing><span class=lab-label>Plan &amp; billing`);
16591
16713
  var _tmpl$2100 = /* @__PURE__ */ template(`<div class=plan__empty><h2 class=plan__empty-title>No active plan</h2><p class=plan__empty-text>Start your treatment to set up your monthly plan.</p><a class="portal-btn portal-btn--primary">Start your intake`);
16592
16714
  var _tmpl$360 = /* @__PURE__ */ template(`<p class=membership__dose>`);
16593
16715
  var _tmpl$445 = /* @__PURE__ */ template(`<div data-testid=membership-card><div class=membership__sheen aria-hidden=true></div><div class=membership__top><span class="lab-label membership__status"></span><span class=membership__brand></span></div><h2 class=membership__med></h2><div class=membership__bottom><span class=membership__price><span class=membership__per>/mo</span></span><span class=membership__renew>Renews `);
@@ -16641,7 +16763,7 @@ function PlanBilling(props) {
16641
16763
  }
16642
16764
  };
16643
16765
  return (() => {
16644
- var _el$ = _tmpl$300(); _el$.firstChild;
16766
+ var _el$ = _tmpl$299(); _el$.firstChild;
16645
16767
  insert(_el$, createComponent(Show, {
16646
16768
  get when() {
16647
16769
  return primary();
@@ -16753,7 +16875,7 @@ function PlanBilling(props) {
16753
16875
  })();
16754
16876
  }
16755
16877
  delegateEvents(["click"]);
16756
- var _tmpl$301 = /* @__PURE__ */ template(`<p class=account__empty>We don\u2019t have your details on file yet.`);
16878
+ var _tmpl$300 = /* @__PURE__ */ template(`<p class=account__empty>We don\u2019t have your details on file yet.`);
16757
16879
  var _tmpl$2101 = /* @__PURE__ */ template(`<p class=account__note>Need to update something? <button type=button class=account__note-link>Message your care team</button> and we\u2019ll take care of it.`);
16758
16880
  var _tmpl$361 = /* @__PURE__ */ template(`<button type=button class="account__support-link account__support-btn">Messages`);
16759
16881
  var _tmpl$446 = /* @__PURE__ */ template(`<div class=account data-testid=account-panel><span class=lab-label>Account</span><h1 class=account__title>Your details</h1><dl class=account__fields></dl><div class=account__support></div><button type=button class="portal-btn portal-btn--ghost account__signout">Sign out`);
@@ -16816,7 +16938,7 @@ function AccountPanel(props) {
16816
16938
  return fields().length === 0;
16817
16939
  },
16818
16940
  get children() {
16819
- return _tmpl$301();
16941
+ return _tmpl$300();
16820
16942
  }
16821
16943
  }), _el$0);
16822
16944
  insert(_el$, createComponent(Show, {
@@ -16855,7 +16977,7 @@ function AccountPanel(props) {
16855
16977
  })();
16856
16978
  }
16857
16979
  delegateEvents(["click"]);
16858
- var _tmpl$305 = /* @__PURE__ */ template(`<section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Birth control</h2><p class=leaflet__body>`);
16980
+ var _tmpl$301 = /* @__PURE__ */ template(`<section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Birth control</h2><p class=leaflet__body>`);
16859
16981
  var _tmpl$2102 = /* @__PURE__ */ template(`<ul class=leaflet__disclaimers id=leaflet-disclaimers>`);
16860
16982
  var _tmpl$363 = /* @__PURE__ */ template(`<div class=leaflet data-testid=medication-guide><header class=leaflet__header><span class=lab-label>How to take it</span><h1 class=leaflet__title></h1><p class=leaflet__summary></p></header><section class=leaflet__boxed aria-label="Boxed warning"><div class=leaflet__boxed-head><i class="ph-fill ph-warning"aria-hidden=true></i><span>Important warning</span></div><p></p></section><section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Do not use this medicine if\u2026</h2><ul class="leaflet__list leaflet__list--caution"></ul></section><section class=leaflet__section><h2 class=leaflet__h2>Your dose over time</h2><p class=leaflet__note>A typical step-up. Your prescriber sets your exact doses and timing.</p><ol class=titration></ol></section><section class=leaflet__section><h2 class=leaflet__h2>Giving your injection</h2><ol class=steps></ol></section><div class=leaflet__grid><section class=leaflet__section><h2 class=leaflet__h2>Storing your medicine</h2><ul class=leaflet__list></ul></section><section class=leaflet__section><h2 class=leaflet__h2>If you miss a dose</h2><p class=leaflet__body></p></section></div><div class=leaflet__grid><section class=leaflet__section><h2 class=leaflet__h2>Common side effects</h2><ul class="leaflet__list leaflet__list--check"></ul></section><section class="leaflet__section leaflet__section--alert"><h2 class=leaflet__h2>Call right away if you notice\u2026</h2><ul class="leaflet__list leaflet__list--alert"></ul></section></div><section class=leaflet__section><h2 class=leaflet__h2>When to contact your care team</h2><ul class=leaflet__list></ul></section><section class=leaflet__section><h2 class=leaflet__h2>Tips for feeling your best</h2><ul class="leaflet__list leaflet__list--check"></ul></section><section class=leaflet__footnote><button type=button class=leaflet__disclose aria-controls=leaflet-disclaimers> the important details<i aria-hidden=true>`);
16861
16983
  var _tmpl$447 = /* @__PURE__ */ template(`<li>`);
@@ -16937,7 +17059,7 @@ function MedicationGuide(props) {
16937
17059
  return props.guide.contraception;
16938
17060
  },
16939
17061
  get children() {
16940
- var _el$24 = _tmpl$305(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
17062
+ var _el$24 = _tmpl$301(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
16941
17063
  insert(_el$26, () => props.guide.contraception);
16942
17064
  return _el$24;
16943
17065
  }
@@ -17016,7 +17138,7 @@ function MedicationGuide(props) {
17016
17138
  })();
17017
17139
  }
17018
17140
  delegateEvents(["click"]);
17019
- var _tmpl$306 = /* @__PURE__ */ template(`<div class=msg-list__header><h2 class=msg-list__title>Messages</h2><button type=button class=msg-list__new data-testid=messages-new-support><i class="ph-thin ph-plus"aria-hidden=true></i>Message support`);
17141
+ var _tmpl$305 = /* @__PURE__ */ template(`<div class=msg-list__header><h2 class=msg-list__title>Messages</h2><button type=button class=msg-list__new data-testid=messages-new-support><i class="ph-thin ph-plus"aria-hidden=true></i>Message support`);
17020
17142
  var _tmpl$2103 = /* @__PURE__ */ template(`<div class=msg-list__state><div class=request-status__spinner>`);
17021
17143
  var _tmpl$364 = /* @__PURE__ */ template(`<div class="msg-list__state msg-list__state--empty"data-testid=messages-empty><i class="ph-thin ph-chat-circle msg-list__empty-icon"aria-hidden=true></i><p class=msg-list__empty-title>No conversations yet.</p><p class=msg-list__empty-hint>Your care team will reach out after reviewing your case \u2014 or message support with a question any time.`);
17022
17144
  var _tmpl$448 = /* @__PURE__ */ template(`<div class=msg-list__scroll data-scrollable>`);
@@ -17031,19 +17153,19 @@ var _tmpl$1017 = /* @__PURE__ */ template(`<div class=msg-attachment>`);
17031
17153
  var _tmpl$1119 = /* @__PURE__ */ template(`<div><div><p class=msg-thread__meta>`);
17032
17154
  var _tmpl$1216 = /* @__PURE__ */ template(`<p class=msg-thread__system data-testid=system-message>`);
17033
17155
  var _tmpl$1315 = /* @__PURE__ */ template(`<p class=msg-thread__text>`);
17034
- var _tmpl$1414 = /* @__PURE__ */ template(`<button type=button class="msg-compose__staged-remove msg-compose__staged-remove--inline">Remove file`);
17035
- var _tmpl$1514 = /* @__PURE__ */ template(`<p class=msg-compose__error role=alert>`);
17036
- var _tmpl$1614 = /* @__PURE__ */ template(`<form class="msg-thread msg-thread--compose"data-testid=support-compose><div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name>Message support</h3><p class=msg-thread__role>We usually reply within one business day</p></div></div><div class=msg-compose__new><label class=msg-compose__label for=support-subject>What's this about?</label><input id=support-subject class=msg-compose__subject type=text maxlength=500 required placeholder="e.g. Question about my order"><label class=msg-compose__label for=support-body>How can we help?</label><textarea id=support-body class=msg-compose__body rows=6 maxlength=5000 required placeholder="Tell us what's going on\u2026"></textarea><label class="msg-compose__attach msg-compose__attach--block"title="Attach a file"><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-compose__attach-label></span><input class=msg-compose__file-input type=file data-testid=support-compose-attach></label><button type=submit class=msg-compose__send data-testid=support-compose-send>`);
17037
- var _tmpl$1714 = /* @__PURE__ */ template(`<span class=msg-thread__status data-testid=thread-status-closed>Resolved`);
17038
- var _tmpl$1813 = /* @__PURE__ */ template(`<div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"data-testid=messages-back><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name></h3><p class=msg-thread__role>`);
17039
- var _tmpl$1911 = /* @__PURE__ */ template(`<div class=msg-thread__messages data-scrollable><div>`);
17156
+ var _tmpl$1415 = /* @__PURE__ */ template(`<button type=button class="msg-compose__staged-remove msg-compose__staged-remove--inline">Remove file`);
17157
+ var _tmpl$1515 = /* @__PURE__ */ template(`<p class=msg-compose__error role=alert>`);
17158
+ var _tmpl$1615 = /* @__PURE__ */ template(`<form class="msg-thread msg-thread--compose"data-testid=support-compose><div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name>Message support</h3><p class=msg-thread__role>We usually reply within one business day</p></div></div><div class=msg-compose__new><label class=msg-compose__label for=support-subject>What's this about?</label><input id=support-subject class=msg-compose__subject type=text maxlength=500 required placeholder="e.g. Question about my order"><label class=msg-compose__label for=support-body>How can we help?</label><textarea id=support-body class=msg-compose__body rows=6 maxlength=5000 required placeholder="Tell us what's going on\u2026"></textarea><label class="msg-compose__attach msg-compose__attach--block"title="Attach a file"><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-compose__attach-label></span><input class=msg-compose__file-input type=file data-testid=support-compose-attach></label><button type=submit class=msg-compose__send data-testid=support-compose-send>`);
17159
+ var _tmpl$1715 = /* @__PURE__ */ template(`<span class=msg-thread__status data-testid=thread-status-closed>Resolved`);
17160
+ var _tmpl$1812 = /* @__PURE__ */ template(`<div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"data-testid=messages-back><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name></h3><p class=msg-thread__role>`);
17161
+ var _tmpl$1912 = /* @__PURE__ */ template(`<div class=msg-thread__messages data-scrollable><div>`);
17040
17162
  var _tmpl$2011 = /* @__PURE__ */ template(`<span class=msg-compose__error role=alert>`);
17041
- var _tmpl$2115 = /* @__PURE__ */ template(`<div class=msg-compose__staged>`);
17042
- var _tmpl$2212 = /* @__PURE__ */ template(`<label class=msg-compose__attach title="Attach a file"><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-compose__attach-label>Attach a file</span><input class=msg-compose__file-input type=file data-testid=messages-attach>`);
17043
- var _tmpl$2311 = /* @__PURE__ */ template(`<div class=msg-compose><textarea class=msg-compose__input rows=1 placeholder="Type a message\u2026"aria-label=Message></textarea><button type=button class=msg-compose__send data-testid=messages-send>`);
17044
- var _tmpl$2411 = /* @__PURE__ */ template(`<span class=msg-compose__staged-file data-testid=staged-file><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-attachment__file-size></span><button type=button class=msg-compose__staged-remove aria-label="Remove attachment">\xD7`);
17163
+ var _tmpl$2116 = /* @__PURE__ */ template(`<div class=msg-compose__staged>`);
17164
+ var _tmpl$2213 = /* @__PURE__ */ template(`<label class=msg-compose__attach title="Attach a file"><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-compose__attach-label>Attach a file</span><input class=msg-compose__file-input type=file data-testid=messages-attach>`);
17165
+ var _tmpl$2312 = /* @__PURE__ */ template(`<div class=msg-compose><textarea class=msg-compose__input rows=1 placeholder="Type a message\u2026"aria-label=Message></textarea><button type=button class=msg-compose__send data-testid=messages-send>`);
17166
+ var _tmpl$2412 = /* @__PURE__ */ template(`<span class=msg-compose__staged-file data-testid=staged-file><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-attachment__file-size></span><button type=button class=msg-compose__staged-remove aria-label="Remove attachment">\xD7`);
17045
17167
  var _tmpl$2511 = /* @__PURE__ */ template(`<div class=msg-panel data-testid=messages-panel><div class=msg-panel__layout><div></div><div>`);
17046
- var _tmpl$2611 = /* @__PURE__ */ template(`<div class=msg-panel__placeholder data-testid=messages-placeholder><p>Select a conversation to read and reply.`);
17168
+ var _tmpl$2610 = /* @__PURE__ */ template(`<div class=msg-panel__placeholder data-testid=messages-placeholder><p>Select a conversation to read and reply.`);
17047
17169
  function sanitizeMessageHtml(html) {
17048
17170
  return DOMPurify.sanitize(html, {
17049
17171
  ALLOWED_TAGS: ["a", "b", "strong", "i", "em", "u", "s", "p", "br", "ul", "ol", "li", "blockquote", "h1", "h2", "h3", "h4", "span", "div", "table", "thead", "tbody", "tr", "th", "td", "img", "hr", "code", "pre"],
@@ -17140,7 +17262,7 @@ function MessagesPanel(props) {
17140
17262
  }
17141
17263
  }
17142
17264
  const ConversationList = () => [(() => {
17143
- var _el$ = _tmpl$306(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
17265
+ var _el$ = _tmpl$305(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
17144
17266
  _el$3.$$click = openCompose;
17145
17267
  return _el$;
17146
17268
  })(), (() => {
@@ -17346,7 +17468,7 @@ function MessagesPanel(props) {
17346
17468
  });
17347
17469
  };
17348
17470
  const NewSupportThread = () => (() => {
17349
- var _el$28 = _tmpl$1614(), _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$29.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.nextSibling, _el$35 = _el$34.nextSibling, _el$36 = _el$35.nextSibling, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$38.nextSibling, _el$42 = _el$36.nextSibling;
17471
+ var _el$28 = _tmpl$1615(), _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$29.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.nextSibling, _el$35 = _el$34.nextSibling, _el$36 = _el$35.nextSibling, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$38.nextSibling, _el$42 = _el$36.nextSibling;
17350
17472
  _el$28.addEventListener("submit", submitCompose);
17351
17473
  _el$30.$$click = () => setComposing(false);
17352
17474
  _el$33.$$input = (e) => setNewSubject(e.currentTarget.value);
@@ -17358,7 +17480,7 @@ function MessagesPanel(props) {
17358
17480
  return newFile();
17359
17481
  },
17360
17482
  get children() {
17361
- var _el$40 = _tmpl$1414();
17483
+ var _el$40 = _tmpl$1415();
17362
17484
  _el$40.$$click = () => setNewFile(null);
17363
17485
  return _el$40;
17364
17486
  }
@@ -17368,7 +17490,7 @@ function MessagesPanel(props) {
17368
17490
  return attachError() || composeError();
17369
17491
  },
17370
17492
  get children() {
17371
- var _el$41 = _tmpl$1514();
17493
+ var _el$41 = _tmpl$1515();
17372
17494
  insert(_el$41, () => attachError() ?? composeError());
17373
17495
  return _el$41;
17374
17496
  }
@@ -17388,7 +17510,7 @@ function MessagesPanel(props) {
17388
17510
  return _el$28;
17389
17511
  })();
17390
17512
  const Thread = () => [(() => {
17391
- var _el$43 = _tmpl$1813(), _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling, _el$46 = _el$45.firstChild, _el$47 = _el$46.nextSibling;
17513
+ var _el$43 = _tmpl$1812(), _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling, _el$46 = _el$45.firstChild, _el$47 = _el$46.nextSibling;
17392
17514
  _el$44.$$click = () => thread().clearSelection();
17393
17515
  insert(_el$46, () => selectedConvo()?.participantName ?? "Provider");
17394
17516
  insert(_el$47, () => selectedConvo()?.participantRole ?? "Prescriber");
@@ -17397,12 +17519,12 @@ function MessagesPanel(props) {
17397
17519
  return memo(() => selectedConvo()?.source === "support")() && selectedConvo()?.status === "closed";
17398
17520
  },
17399
17521
  get children() {
17400
- return _tmpl$1714();
17522
+ return _tmpl$1715();
17401
17523
  }
17402
17524
  }), null);
17403
17525
  return _el$43;
17404
17526
  })(), (() => {
17405
- var _el$49 = _tmpl$1911(), _el$51 = _el$49.firstChild;
17527
+ var _el$49 = _tmpl$1912(), _el$51 = _el$49.firstChild;
17406
17528
  insert(_el$49, createComponent(Show, {
17407
17529
  get when() {
17408
17530
  return thread().loadingMessages();
@@ -17427,13 +17549,13 @@ function MessagesPanel(props) {
17427
17549
  return pendingFile() || attachError();
17428
17550
  },
17429
17551
  get children() {
17430
- var _el$52 = _tmpl$2115();
17552
+ var _el$52 = _tmpl$2116();
17431
17553
  insert(_el$52, createComponent(Show, {
17432
17554
  get when() {
17433
17555
  return pendingFile();
17434
17556
  },
17435
17557
  children: (file) => (() => {
17436
- var _el$61 = _tmpl$2411(), _el$62 = _el$61.firstChild, _el$63 = _el$62.nextSibling, _el$64 = _el$63.nextSibling;
17558
+ var _el$61 = _tmpl$2412(), _el$62 = _el$61.firstChild, _el$63 = _el$62.nextSibling, _el$64 = _el$63.nextSibling;
17437
17559
  insert(_el$61, () => file().name, _el$63);
17438
17560
  insert(_el$63, () => formatFileSize(file().size));
17439
17561
  _el$64.$$click = () => setPendingFile(null);
@@ -17453,13 +17575,13 @@ function MessagesPanel(props) {
17453
17575
  return _el$52;
17454
17576
  }
17455
17577
  }), (() => {
17456
- var _el$54 = _tmpl$2311(), _el$59 = _el$54.firstChild, _el$60 = _el$59.nextSibling;
17578
+ var _el$54 = _tmpl$2312(), _el$59 = _el$54.firstChild, _el$60 = _el$59.nextSibling;
17457
17579
  insert(_el$54, createComponent(Show, {
17458
17580
  get when() {
17459
17581
  return thread().selectedSource() === "support";
17460
17582
  },
17461
17583
  get children() {
17462
- var _el$55 = _tmpl$2212(), _el$56 = _el$55.firstChild, _el$57 = _el$56.nextSibling, _el$58 = _el$57.nextSibling;
17584
+ var _el$55 = _tmpl$2213(), _el$56 = _el$55.firstChild, _el$57 = _el$56.nextSibling, _el$58 = _el$57.nextSibling;
17463
17585
  _el$58.addEventListener("change", (e) => stageFile(e.currentTarget, setPendingFile));
17464
17586
  effect(() => setAttribute(_el$58, "accept", SUPPORT_ATTACHMENT_MIME_TYPES.join(",")));
17465
17587
  return _el$55;
@@ -17494,7 +17616,7 @@ function MessagesPanel(props) {
17494
17616
  return thread().selectedId() != null;
17495
17617
  },
17496
17618
  get fallback() {
17497
- return _tmpl$2611();
17619
+ return _tmpl$2610();
17498
17620
  },
17499
17621
  get children() {
17500
17622
  return createComponent(Thread, {});
@@ -17515,7 +17637,7 @@ function MessagesPanel(props) {
17515
17637
  })();
17516
17638
  }
17517
17639
  delegateEvents(["click", "input", "keydown"]);
17518
- var _tmpl$307 = /* @__PURE__ */ template(`<ul class=history-list data-testid=history-list>`);
17640
+ var _tmpl$306 = /* @__PURE__ */ template(`<ul class=history-list data-testid=history-list>`);
17519
17641
  var _tmpl$2104 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-error><p>We couldn't load your submitted surveys. Please try again in a moment.`);
17520
17642
  var _tmpl$365 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-empty><p>No submitted questionnaires yet.</p><p class=history-hint>Your intake and refill check-in answers will appear here once you've submitted them.`);
17521
17643
  var _tmpl$449 = /* @__PURE__ */ template(`<li><button type=button class=history-row><span class=history-row__mode></span><span class=history-row__date></span><i class="ph-thin ph-caret-right portal-icon"aria-hidden=true>`);
@@ -17565,7 +17687,7 @@ function SurveyHistory() {
17565
17687
  return _tmpl$365();
17566
17688
  },
17567
17689
  get children() {
17568
- var _el$ = _tmpl$307();
17690
+ var _el$ = _tmpl$306();
17569
17691
  insert(_el$, createComponent(For, {
17570
17692
  get each() {
17571
17693
  return list();
@@ -17662,7 +17784,7 @@ function SurveyHistory() {
17662
17784
  delegateEvents(["click"]);
17663
17785
 
17664
17786
  // src/pages/MemberPortal.tsx
17665
- var _tmpl$308 = /* @__PURE__ */ template(`<span class=portal-item__live aria-label="In progress">`);
17787
+ var _tmpl$307 = /* @__PURE__ */ template(`<span class=portal-item__live aria-label="In progress">`);
17666
17788
  var _tmpl$2105 = /* @__PURE__ */ template(`<span>`);
17667
17789
  var _tmpl$366 = /* @__PURE__ */ template(`<button type=button><i aria-hidden=true></i><span class=portal-item__label>`);
17668
17790
  var _tmpl$450 = /* @__PURE__ */ template(`<div class=rx-others data-testid=rx-others><span class=lab-label>Other orders`);
@@ -17764,7 +17886,7 @@ function MemberPortal(props) {
17764
17886
  return memo(() => item.key === "tracker")() && inMotion();
17765
17887
  },
17766
17888
  get children() {
17767
- return _tmpl$308();
17889
+ return _tmpl$307();
17768
17890
  }
17769
17891
  }), null);
17770
17892
  insert(_el$, createComponent(Show, {
@@ -18070,7 +18192,7 @@ function MemberPortal(props) {
18070
18192
  })();
18071
18193
  }
18072
18194
  delegateEvents(["click"]);
18073
- var _tmpl$309 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;border-radius:var(--app-affiliate-radius);background:var(--app-affiliate-warning-bg);color:var(--app-affiliate-warning-fg);border:1px solid var(--app-affiliate-border)">Your affiliate account is awaiting approval. Once an admin activates it, your referral link will start earning commissions.`);
18195
+ var _tmpl$308 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;border-radius:var(--app-affiliate-radius);background:var(--app-affiliate-warning-bg);color:var(--app-affiliate-warning-fg);border:1px solid var(--app-affiliate-border)">Your affiliate account is awaiting approval. Once an admin activates it, your referral link will start earning commissions.`);
18074
18196
  var _tmpl$2106 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Overview`);
18075
18197
  var _tmpl$367 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading stats\u2026`);
18076
18198
  var _tmpl$451 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));gap:1rem">`);
@@ -18113,7 +18235,7 @@ function AffiliateOverview() {
18113
18235
  return isPending();
18114
18236
  },
18115
18237
  get children() {
18116
- return _tmpl$309();
18238
+ return _tmpl$308();
18117
18239
  }
18118
18240
  }), null);
18119
18241
  insert(_el$, createComponent(Show, {
@@ -18142,9 +18264,9 @@ function AffiliateOverview() {
18142
18264
  return _el$;
18143
18265
  })();
18144
18266
  }
18145
- var _tmpl$368 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden"><table class=app-affiliate-table style=width:100%;border-collapse:collapse;font-size:0.875rem><thead><tr style=background:var(--app-affiliate-surface-light)><th>Date</th><th>Type</th><th>Order total</th><th>Commission</th><th>Status</th></tr></thead><tbody>`);
18267
+ var _tmpl$309 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden"><table class=app-affiliate-table style=width:100%;border-collapse:collapse;font-size:0.875rem><thead><tr style=background:var(--app-affiliate-surface-light)><th>Date</th><th>Type</th><th>Order total</th><th>Commission</th><th>Status</th></tr></thead><tbody>`);
18146
18268
  var _tmpl$2107 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Conversions`);
18147
- var _tmpl$369 = /* @__PURE__ */ template(`<div style="padding:2rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);color:var(--app-affiliate-fg-muted);text-align:center">No conversions yet. Share your referral link to start earning.`);
18269
+ var _tmpl$368 = /* @__PURE__ */ template(`<div style="padding:2rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);color:var(--app-affiliate-fg-muted);text-align:center">No conversions yet. Share your referral link to start earning.`);
18148
18270
  var _tmpl$452 = /* @__PURE__ */ template(`<span title="Override commission earned on a sub-affiliate's sale"style="margin-left:0.4rem;padding:0.1rem 0.45rem;border-radius:999px;font-size:0.65rem;font-weight:600;background:var(--app-affiliate-primary-soft);color:var(--app-affiliate-primary-soft-fg)">Override`);
18149
18271
  var _tmpl$547 = /* @__PURE__ */ template(`<tr style="border-top:1px solid var(--app-affiliate-border)"><td data-label=Date></td><td data-label=Type></td><td data-label="Order total"></td><td data-label=Commission style=color:var(--app-affiliate-fg);font-weight:600></td><td data-label=Status><span style="padding:0.2rem 0.6rem;border-radius:999px;font-size:0.75rem;font-weight:600">`);
18150
18272
  function formatMoney2(cents) {
@@ -18190,10 +18312,10 @@ function AffiliateConversions() {
18190
18312
  return (conversions() ?? []).length > 0;
18191
18313
  },
18192
18314
  get fallback() {
18193
- return _tmpl$369();
18315
+ return _tmpl$368();
18194
18316
  },
18195
18317
  get children() {
18196
- var _el$3 = _tmpl$368(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$5.nextSibling;
18318
+ var _el$3 = _tmpl$309(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$5.nextSibling;
18197
18319
  insert(_el$10, createComponent(For, {
18198
18320
  get each() {
18199
18321
  return conversions();
@@ -18275,9 +18397,9 @@ function td() {
18275
18397
  color: "var(--app-affiliate-fg)"
18276
18398
  };
18277
18399
  }
18278
- var _tmpl$370 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden"><table class=app-affiliate-table style=width:100%;border-collapse:collapse;font-size:0.875rem><thead><tr style=background:var(--app-affiliate-surface-light)><th>Code</th><th>Name</th><th>Status</th><th>Joined</th></tr></thead><tbody>`);
18400
+ var _tmpl$369 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden"><table class=app-affiliate-table style=width:100%;border-collapse:collapse;font-size:0.875rem><thead><tr style=background:var(--app-affiliate-surface-light)><th>Code</th><th>Name</th><th>Status</th><th>Joined</th></tr></thead><tbody>`);
18279
18401
  var _tmpl$2108 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Downline</h1><p style=margin:0;color:var(--app-affiliate-fg-muted);font-size:0.875rem>Affiliates you've referred. You earn an override commission on every qualifying sale they make \u2014 those show up as \u201COverride\u201D rows on your Conversions.`);
18280
- var _tmpl$371 = /* @__PURE__ */ template(`<div style="padding:2rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);color:var(--app-affiliate-fg-muted);text-align:center">No sub-affiliates yet.`);
18402
+ var _tmpl$370 = /* @__PURE__ */ template(`<div style="padding:2rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);color:var(--app-affiliate-fg-muted);text-align:center">No sub-affiliates yet.`);
18281
18403
  var _tmpl$453 = /* @__PURE__ */ template(`<tr style="border-top:1px solid var(--app-affiliate-border)"><td data-label=Code style=font-family:var(--app-affiliate-font-mono)></td><td data-label=Name></td><td data-label=Status><span style="padding:0.2rem 0.6rem;border-radius:999px;font-size:0.75rem;font-weight:600"></span></td><td data-label=Joined>`);
18282
18404
  function formatDate4(iso) {
18283
18405
  const d = new Date(iso);
@@ -18317,10 +18439,10 @@ function AffiliateDownline() {
18317
18439
  return (downline() ?? []).length > 0;
18318
18440
  },
18319
18441
  get fallback() {
18320
- return _tmpl$371();
18442
+ return _tmpl$370();
18321
18443
  },
18322
18444
  get children() {
18323
- var _el$4 = _tmpl$370(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$6.nextSibling;
18445
+ var _el$4 = _tmpl$369(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$6.nextSibling;
18324
18446
  insert(_el$10, createComponent(For, {
18325
18447
  get each() {
18326
18448
  return downline();
@@ -18389,9 +18511,9 @@ function td2() {
18389
18511
  color: "var(--app-affiliate-fg)"
18390
18512
  };
18391
18513
  }
18392
- var _tmpl$372 = /* @__PURE__ */ template(`<div style="padding:1.5rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);display:flex;flex-direction:column;gap:0.75rem"><div style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted)>Share this link</div><div style=display:flex;gap:0.5rem;align-items:stretch;flex-wrap:wrap><code style="flex:1;min-width:16rem;padding:0.75rem 1rem;background:var(--app-affiliate-surface-light);border-radius:var(--app-affiliate-radius-sm);font-family:var(--app-affiliate-font-mono);color:var(--app-affiliate-fg);word-break:break-all"></code><button type=button style="padding:0.75rem 1.25rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600;cursor:pointer"></button></div><div style=font-size:0.875rem;color:var(--app-affiliate-fg-muted)>Anyone who visits this URL has a tracking cookie set for the duration of your program. If they sign up and subscribe within the cookie window, you earn commission on the conversion.`);
18514
+ var _tmpl$371 = /* @__PURE__ */ template(`<div style="padding:1.5rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);display:flex;flex-direction:column;gap:0.75rem"><div style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted)>Share this link</div><div style=display:flex;gap:0.5rem;align-items:stretch;flex-wrap:wrap><code style="flex:1;min-width:16rem;padding:0.75rem 1rem;background:var(--app-affiliate-surface-light);border-radius:var(--app-affiliate-radius-sm);font-family:var(--app-affiliate-font-mono);color:var(--app-affiliate-fg);word-break:break-all"></code><button type=button style="padding:0.75rem 1.25rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600;cursor:pointer"></button></div><div style=font-size:0.875rem;color:var(--app-affiliate-fg-muted)>Anyone who visits this URL has a tracking cookie set for the duration of your program. If they sign up and subscribe within the cookie window, you earn commission on the conversion.`);
18393
18515
  var _tmpl$2109 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Referral link`);
18394
- var _tmpl$373 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Your referral link will appear here once your account is approved.`);
18516
+ var _tmpl$372 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Your referral link will appear here once your account is approved.`);
18395
18517
  function AffiliateReferralLink() {
18396
18518
  const {
18397
18519
  links
@@ -18422,10 +18544,10 @@ function AffiliateReferralLink() {
18422
18544
  return homepageLink();
18423
18545
  },
18424
18546
  get fallback() {
18425
- return _tmpl$373();
18547
+ return _tmpl$372();
18426
18548
  },
18427
18549
  get children() {
18428
- var _el$3 = _tmpl$372(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling; _el$5.nextSibling;
18550
+ var _el$3 = _tmpl$371(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling; _el$5.nextSibling;
18429
18551
  insert(_el$6, homepageLink);
18430
18552
  _el$7.$$click = copy;
18431
18553
  insert(_el$7, () => copied() ? "Copied" : "Copy");
@@ -18436,9 +18558,9 @@ function AffiliateReferralLink() {
18436
18558
  })();
18437
18559
  }
18438
18560
  delegateEvents(["click"]);
18439
- var _tmpl$374 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Account</h1><div><button type=button style="padding:0.75rem 1.25rem;background:transparent;color:var(--app-affiliate-fg);border:1px solid var(--app-affiliate-border-strong);border-radius:var(--app-affiliate-radius-sm);cursor:pointer;font-weight:500">Log out</button></div><div style=font-size:0.875rem;color:var(--app-affiliate-fg-muted)>To update your profile or payment details, contact your program administrator.`);
18440
- var _tmpl$2116 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading\u2026`);
18441
- var _tmpl$375 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden">`);
18561
+ var _tmpl$373 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Account</h1><div><button type=button style="padding:0.75rem 1.25rem;background:transparent;color:var(--app-affiliate-fg);border:1px solid var(--app-affiliate-border-strong);border-radius:var(--app-affiliate-radius-sm);cursor:pointer;font-weight:500">Log out</button></div><div style=font-size:0.875rem;color:var(--app-affiliate-fg-muted)>To update your profile or payment details, contact your program administrator.`);
18562
+ var _tmpl$2117 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading\u2026`);
18563
+ var _tmpl$374 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden">`);
18442
18564
  var _tmpl$454 = /* @__PURE__ */ template(`<div style="display:flex;justify-content:space-between;align-items:center;padding:0.875rem 1.25rem;border-bottom:1px solid var(--app-affiliate-border)"><div style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted)></div><div style=color:var(--app-affiliate-fg)>`);
18443
18565
  var STATUS_LABEL2 = {
18444
18566
  pending: "Pending approval",
@@ -18474,16 +18596,16 @@ function AffiliateSettings() {
18474
18596
  value: a.paymentEmail ?? "\u2014"
18475
18597
  }];
18476
18598
  return (() => {
18477
- var _el$ = _tmpl$374(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild; _el$3.nextSibling;
18599
+ var _el$ = _tmpl$373(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild; _el$3.nextSibling;
18478
18600
  insert(_el$, createComponent(Show, {
18479
18601
  get when() {
18480
18602
  return affiliate();
18481
18603
  },
18482
18604
  get fallback() {
18483
- return _tmpl$2116();
18605
+ return _tmpl$2117();
18484
18606
  },
18485
18607
  children: (a) => (() => {
18486
- var _el$7 = _tmpl$375();
18608
+ var _el$7 = _tmpl$374();
18487
18609
  insert(_el$7, createComponent(For, {
18488
18610
  get each() {
18489
18611
  return rows(a());
@@ -18505,9 +18627,9 @@ function AffiliateSettings() {
18505
18627
  delegateEvents(["click"]);
18506
18628
 
18507
18629
  // src/pages/AffiliatePortal.tsx
18508
- var _tmpl$376 = /* @__PURE__ */ template(`<div class="app-affiliate-root app-affiliate-shell"style=position:sticky;background:var(--app-affiliate-bg);color:var(--app-affiliate-fg)><div class=app-affiliate-shell-header><button type=button class=app-affiliate-shell-menu-trigger aria-label="Open portal menu"><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=18 x2=21 y2=18></line></svg></button><span class=app-affiliate-shell-header-title></span></div><div class=app-affiliate-backdrop aria-hidden=true></div><aside class=app-affiliate-sidebar><div style=padding:1.25rem><h2 style="font-size:0.7rem;font-weight:500;color:var(--app-affiliate-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 1rem">Affiliate Portal</h2><nav style=display:flex;flex-direction:column;gap:0.25rem></nav></div></aside><div class=app-affiliate-content>`);
18509
- var _tmpl$2117 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
18510
- var _tmpl$377 = /* @__PURE__ */ template(`<button type=button style="display:flex;align-items:center;gap:0.75rem;padding:0.625rem 0.75rem;border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem;font-weight:500;text-align:left;border:none;cursor:pointer">`);
18630
+ var _tmpl$375 = /* @__PURE__ */ template(`<div class="app-affiliate-root app-affiliate-shell"style=position:sticky;background:var(--app-affiliate-bg);color:var(--app-affiliate-fg)><div class=app-affiliate-shell-header><button type=button class=app-affiliate-shell-menu-trigger aria-label="Open portal menu"><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=18 x2=21 y2=18></line></svg></button><span class=app-affiliate-shell-header-title></span></div><div class=app-affiliate-backdrop aria-hidden=true></div><aside class=app-affiliate-sidebar><div style=padding:1.25rem><h2 style="font-size:0.7rem;font-weight:500;color:var(--app-affiliate-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 1rem">Affiliate Portal</h2><nav style=display:flex;flex-direction:column;gap:0.25rem></nav></div></aside><div class=app-affiliate-content>`);
18631
+ var _tmpl$2118 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
18632
+ var _tmpl$376 = /* @__PURE__ */ template(`<button type=button style="display:flex;align-items:center;gap:0.75rem;padding:0.625rem 0.75rem;border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem;font-weight:500;text-align:left;border:none;cursor:pointer">`);
18511
18633
  var _tmpl$455 = /* @__PURE__ */ template(`<div class=app-affiliate-root style=display:flex;align-items:center;justify-content:center;position:sticky;background:var(--app-affiliate-bg)><div role=status aria-label="Loading affiliate portal"style="width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--app-affiliate-border);border-top-color:var(--app-affiliate-primary);animation:app-affiliate-gate-spin 0.8s linear infinite"></div><style>@keyframes app-affiliate-gate-spin { to { transform: rotate(360deg); } }`);
18512
18634
  var TAB_LABELS2 = {
18513
18635
  overview: "Overview",
@@ -18553,7 +18675,7 @@ function AffiliatePortal(props) {
18553
18675
  });
18554
18676
  },
18555
18677
  get children() {
18556
- var _el$ = _tmpl$376(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$6.nextSibling;
18678
+ var _el$ = _tmpl$375(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$6.nextSibling;
18557
18679
  _el$3.$$click = () => setDrawerOpen(true);
18558
18680
  insert(_el$4, () => TAB_LABELS2[currentTab()]);
18559
18681
  _el$5.$$click = () => setDrawerOpen(false);
@@ -18562,14 +18684,14 @@ function AffiliatePortal(props) {
18562
18684
  return orderedTabs();
18563
18685
  },
18564
18686
  children: (tab) => (() => {
18565
- var _el$1 = _tmpl$377();
18687
+ var _el$1 = _tmpl$376();
18566
18688
  _el$1.$$click = () => handleTabClick(tab);
18567
18689
  insert(_el$1, createComponent(Show, {
18568
18690
  get when() {
18569
18691
  return props.tabIcons?.[tab];
18570
18692
  },
18571
18693
  get children() {
18572
- var _el$10 = _tmpl$2117();
18694
+ var _el$10 = _tmpl$2118();
18573
18695
  effect(() => className(_el$10, props.tabIcons[tab]));
18574
18696
  return _el$10;
18575
18697
  }
@@ -18665,11 +18787,11 @@ function AffiliateGateSpinner(props) {
18665
18787
  })();
18666
18788
  }
18667
18789
  delegateEvents(["click"]);
18668
- var _tmpl$378 = /* @__PURE__ */ template(`<div style=position:relative><input><button type=button style="position:absolute;top:0;right:0;height:100%;display:flex;align-items:center;padding:0 0.75rem;background:transparent;border:none;color:var(--app-affiliate-fg-muted);cursor:pointer;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em">`);
18790
+ var _tmpl$377 = /* @__PURE__ */ template(`<div style=position:relative><input><button type=button style="position:absolute;top:0;right:0;height:100%;display:flex;align-items:center;padding:0 0.75rem;background:transparent;border:none;color:var(--app-affiliate-fg-muted);cursor:pointer;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em">`);
18669
18791
  function AffiliatePasswordInput(props) {
18670
18792
  const [visible, setVisible] = createSignal(false);
18671
18793
  return (() => {
18672
- var _el$ = _tmpl$378(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
18794
+ var _el$ = _tmpl$377(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
18673
18795
  _el$2.$$input = (e) => props.onInput(e.currentTarget.value);
18674
18796
  _el$3.$$click = () => setVisible((v) => !v);
18675
18797
  insert(_el$3, () => visible() ? "Hide" : "Show");
@@ -18710,9 +18832,9 @@ function inputStyle() {
18710
18832
  delegateEvents(["input", "click"]);
18711
18833
 
18712
18834
  // src/pages/AffiliateRegister.tsx
18713
- var _tmpl$379 = /* @__PURE__ */ template(`<input type=text required autocomplete=given-name>`);
18714
- var _tmpl$2118 = /* @__PURE__ */ template(`<input type=text required autocomplete=family-name>`);
18715
- var _tmpl$380 = /* @__PURE__ */ template(`<input type=email required autocomplete=email>`);
18835
+ var _tmpl$378 = /* @__PURE__ */ template(`<input type=text required autocomplete=given-name>`);
18836
+ var _tmpl$2119 = /* @__PURE__ */ template(`<input type=text required autocomplete=family-name>`);
18837
+ var _tmpl$379 = /* @__PURE__ */ template(`<input type=email required autocomplete=email>`);
18716
18838
  var _tmpl$456 = /* @__PURE__ */ template(`<input type=text required minlength=4>`);
18717
18839
  var _tmpl$548 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
18718
18840
  var _tmpl$644 = /* @__PURE__ */ template(`<button type=button>Already have an account? Log in`);
@@ -18765,7 +18887,7 @@ function AffiliateRegister(props) {
18765
18887
  insert(_el$6, createComponent(Row, {
18766
18888
  label: "First name",
18767
18889
  get children() {
18768
- var _el$7 = _tmpl$379();
18890
+ var _el$7 = _tmpl$378();
18769
18891
  _el$7.$$input = (e) => setFirstName(e.currentTarget.value);
18770
18892
  effect((_$p) => style(_el$7, inputStyle2(), _$p));
18771
18893
  effect(() => _el$7.value = firstName());
@@ -18775,7 +18897,7 @@ function AffiliateRegister(props) {
18775
18897
  insert(_el$6, createComponent(Row, {
18776
18898
  label: "Last name",
18777
18899
  get children() {
18778
- var _el$8 = _tmpl$2118();
18900
+ var _el$8 = _tmpl$2119();
18779
18901
  _el$8.$$input = (e) => setLastName(e.currentTarget.value);
18780
18902
  effect((_$p) => style(_el$8, inputStyle2(), _$p));
18781
18903
  effect(() => _el$8.value = lastName());
@@ -18785,7 +18907,7 @@ function AffiliateRegister(props) {
18785
18907
  insert(_el$6, createComponent(Row, {
18786
18908
  label: "Email",
18787
18909
  get children() {
18788
- var _el$9 = _tmpl$380();
18910
+ var _el$9 = _tmpl$379();
18789
18911
  _el$9.$$input = (e) => setEmail(e.currentTarget.value);
18790
18912
  effect((_$p) => style(_el$9, inputStyle2(), _$p));
18791
18913
  effect(() => _el$9.value = email());
@@ -18904,9 +19026,9 @@ function linkStyle() {
18904
19026
  };
18905
19027
  }
18906
19028
  delegateEvents(["input", "click"]);
18907
- var _tmpl$381 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
18908
- var _tmpl$2119 = /* @__PURE__ */ template(`<button type=button style=background:transparent;border:none;color:var(--app-affiliate-fg-muted);cursor:pointer;text-decoration:underline;font-size:0.875rem;padding:0;text-align:center>Forgot your password?`);
18909
- var _tmpl$382 = /* @__PURE__ */ template(`<button type=button style=background:transparent;border:none;color:var(--app-affiliate-primary-soft-fg);cursor:pointer;text-decoration:underline;font-size:0.875rem;padding:0;text-align:center>New affiliate? Apply`);
19029
+ var _tmpl$380 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19030
+ var _tmpl$2120 = /* @__PURE__ */ template(`<button type=button style=background:transparent;border:none;color:var(--app-affiliate-fg-muted);cursor:pointer;text-decoration:underline;font-size:0.875rem;padding:0;text-align:center>Forgot your password?`);
19031
+ var _tmpl$381 = /* @__PURE__ */ template(`<button type=button style=background:transparent;border:none;color:var(--app-affiliate-primary-soft-fg);cursor:pointer;text-decoration:underline;font-size:0.875rem;padding:0;text-align:center>New affiliate? Apply`);
18910
19032
  var _tmpl$457 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Affiliate login</h1><form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>Email</span><input type=email required autocomplete=email></label><label style=display:flex;flex-direction:column;gap:0.35rem><span>Password</span></label><button type=submit style="padding:0.75rem 1rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600">`);
18911
19033
  function AffiliateLogin(props) {
18912
19034
  const [email, setEmail] = createSignal("");
@@ -18943,7 +19065,7 @@ function AffiliateLogin(props) {
18943
19065
  return error();
18944
19066
  },
18945
19067
  get children() {
18946
- var _el$0 = _tmpl$381();
19068
+ var _el$0 = _tmpl$380();
18947
19069
  insert(_el$0, error);
18948
19070
  return _el$0;
18949
19071
  }
@@ -18954,7 +19076,7 @@ function AffiliateLogin(props) {
18954
19076
  return props.onNavigateForgotPassword;
18955
19077
  },
18956
19078
  get children() {
18957
- var _el$10 = _tmpl$2119();
19079
+ var _el$10 = _tmpl$2120();
18958
19080
  _el$10.$$click = () => props.onNavigateForgotPassword?.();
18959
19081
  return _el$10;
18960
19082
  }
@@ -18964,7 +19086,7 @@ function AffiliateLogin(props) {
18964
19086
  return props.onNavigateRegister;
18965
19087
  },
18966
19088
  get children() {
18967
- var _el$11 = _tmpl$382();
19089
+ var _el$11 = _tmpl$381();
18968
19090
  _el$11.$$click = () => props.onNavigateRegister?.();
18969
19091
  return _el$11;
18970
19092
  }
@@ -19012,9 +19134,9 @@ function inputStyle3() {
19012
19134
  };
19013
19135
  }
19014
19136
  delegateEvents(["input", "click"]);
19015
- var _tmpl$383 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19016
- var _tmpl$2120 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>Email</span><input type=email required></label><button type=submit style="padding:0.75rem 1rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600">`);
19017
- var _tmpl$384 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Reset your password`);
19137
+ var _tmpl$382 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19138
+ var _tmpl$2121 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>Email</span><input type=email required></label><button type=submit style="padding:0.75rem 1rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600">`);
19139
+ var _tmpl$383 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Reset your password`);
19018
19140
  var _tmpl$458 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-surface-light);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19019
19141
  function ForgotPasswordPage(props) {
19020
19142
  const [email, setEmail] = createSignal("");
@@ -19039,7 +19161,7 @@ function ForgotPasswordPage(props) {
19039
19161
  }
19040
19162
  }
19041
19163
  return (() => {
19042
- var _el$ = _tmpl$384(), _el$2 = _el$.firstChild; _el$2.firstChild;
19164
+ var _el$ = _tmpl$383(), _el$2 = _el$.firstChild; _el$2.firstChild;
19043
19165
  insert(_el$2, createComponent(Show, {
19044
19166
  get when() {
19045
19167
  return !message();
@@ -19052,7 +19174,7 @@ function ForgotPasswordPage(props) {
19052
19174
  })();
19053
19175
  },
19054
19176
  get children() {
19055
- var _el$4 = _tmpl$2120(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
19177
+ var _el$4 = _tmpl$2121(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
19056
19178
  _el$4.addEventListener("submit", handleSubmit);
19057
19179
  _el$7.$$input = (e) => setEmail(e.currentTarget.value);
19058
19180
  insert(_el$4, createComponent(Show, {
@@ -19060,7 +19182,7 @@ function ForgotPasswordPage(props) {
19060
19182
  return error();
19061
19183
  },
19062
19184
  get children() {
19063
- var _el$8 = _tmpl$383();
19185
+ var _el$8 = _tmpl$382();
19064
19186
  insert(_el$8, error);
19065
19187
  return _el$8;
19066
19188
  }
@@ -19110,9 +19232,9 @@ function inputStyle4() {
19110
19232
  };
19111
19233
  }
19112
19234
  delegateEvents(["input"]);
19113
- var _tmpl$385 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19114
- var _tmpl$2121 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>New password</span><input type=password required autocomplete=new-password></label><label style=display:flex;flex-direction:column;gap:0.35rem><span>Confirm password</span><input type=password required autocomplete=new-password></label><button type=submit style="padding:0.75rem 1rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600">`);
19115
- var _tmpl$386 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Choose a new password`);
19235
+ var _tmpl$384 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19236
+ var _tmpl$2122 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>New password</span><input type=password required autocomplete=new-password></label><label style=display:flex;flex-direction:column;gap:0.35rem><span>Confirm password</span><input type=password required autocomplete=new-password></label><button type=submit style="padding:0.75rem 1rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600">`);
19237
+ var _tmpl$385 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Choose a new password`);
19116
19238
  var _tmpl$459 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-surface-light);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19117
19239
  function queryParam(name) {
19118
19240
  if (typeof window === "undefined") return "";
@@ -19153,7 +19275,7 @@ function ResetPasswordPage(props) {
19153
19275
  }
19154
19276
  }
19155
19277
  return (() => {
19156
- var _el$ = _tmpl$386(), _el$2 = _el$.firstChild; _el$2.firstChild;
19278
+ var _el$ = _tmpl$385(), _el$2 = _el$.firstChild; _el$2.firstChild;
19157
19279
  insert(_el$2, createComponent(Show, {
19158
19280
  get when() {
19159
19281
  return !message();
@@ -19166,7 +19288,7 @@ function ResetPasswordPage(props) {
19166
19288
  })();
19167
19289
  },
19168
19290
  get children() {
19169
- var _el$4 = _tmpl$2121(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$10 = _el$8.nextSibling;
19291
+ var _el$4 = _tmpl$2122(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$10 = _el$8.nextSibling;
19170
19292
  _el$4.addEventListener("submit", handleSubmit);
19171
19293
  _el$7.$$input = (e) => setPassword(e.currentTarget.value);
19172
19294
  _el$0.$$input = (e) => setConfirm(e.currentTarget.value);
@@ -19175,7 +19297,7 @@ function ResetPasswordPage(props) {
19175
19297
  return error();
19176
19298
  },
19177
19299
  get children() {
19178
- var _el$1 = _tmpl$385();
19300
+ var _el$1 = _tmpl$384();
19179
19301
  insert(_el$1, error);
19180
19302
  return _el$1;
19181
19303
  }
@@ -19230,9 +19352,9 @@ function inputStyle5() {
19230
19352
  };
19231
19353
  }
19232
19354
  delegateEvents(["input"]);
19233
- var _tmpl$387 = /* @__PURE__ */ template(`<div>`);
19234
- var _tmpl$2122 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>Email</span><input type=email required autocomplete=email></label><button type=submit>`);
19235
- var _tmpl$388 = /* @__PURE__ */ template(`<button type=button>Back to login`);
19355
+ var _tmpl$386 = /* @__PURE__ */ template(`<div>`);
19356
+ var _tmpl$2123 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>Email</span><input type=email required autocomplete=email></label><button type=submit>`);
19357
+ var _tmpl$387 = /* @__PURE__ */ template(`<button type=button>Back to login`);
19236
19358
  var _tmpl$460 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Reset your password`);
19237
19359
  var _tmpl$549 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>`);
19238
19360
  function AffiliateForgotPassword(props) {
@@ -19270,7 +19392,7 @@ function AffiliateForgotPassword(props) {
19270
19392
  })();
19271
19393
  },
19272
19394
  get children() {
19273
- var _el$4 = _tmpl$2122(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
19395
+ var _el$4 = _tmpl$2123(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
19274
19396
  _el$4.addEventListener("submit", handleSubmit);
19275
19397
  _el$7.$$input = (e) => setEmail(e.currentTarget.value);
19276
19398
  insert(_el$4, createComponent(Show, {
@@ -19278,7 +19400,7 @@ function AffiliateForgotPassword(props) {
19278
19400
  return error();
19279
19401
  },
19280
19402
  get children() {
19281
- var _el$8 = _tmpl$387();
19403
+ var _el$8 = _tmpl$386();
19282
19404
  insert(_el$8, error);
19283
19405
  effect((_$p) => style(_el$8, errorStyle(), _$p));
19284
19406
  return _el$8;
@@ -19307,7 +19429,7 @@ function AffiliateForgotPassword(props) {
19307
19429
  return props.onNavigateLogin;
19308
19430
  },
19309
19431
  get children() {
19310
- var _el$0 = _tmpl$388();
19432
+ var _el$0 = _tmpl$387();
19311
19433
  _el$0.$$click = () => props.onNavigateLogin?.();
19312
19434
  effect((_$p) => style(_el$0, linkStyle2(), _$p));
19313
19435
  return _el$0;
@@ -19413,9 +19535,9 @@ function linkStyle2() {
19413
19535
  };
19414
19536
  }
19415
19537
  delegateEvents(["input", "click"]);
19416
- var _tmpl$389 = /* @__PURE__ */ template(`<div>`);
19417
- var _tmpl$2123 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>New password</span></label><label style=display:flex;flex-direction:column;gap:0.35rem><span>Confirm new password</span></label><button type=submit>`);
19418
- var _tmpl$390 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Choose a new password`);
19538
+ var _tmpl$388 = /* @__PURE__ */ template(`<div>`);
19539
+ var _tmpl$2124 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>New password</span></label><label style=display:flex;flex-direction:column;gap:0.35rem><span>Confirm new password</span></label><button type=submit>`);
19540
+ var _tmpl$389 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Choose a new password`);
19419
19541
  var _tmpl$461 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>Your password has been reset. You can now log in with your new password.`);
19420
19542
  function queryParam2(name) {
19421
19543
  if (typeof window === "undefined") return "";
@@ -19460,7 +19582,7 @@ function AffiliateResetPassword(props) {
19460
19582
  }
19461
19583
  }
19462
19584
  return (() => {
19463
- var _el$ = _tmpl$390(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
19585
+ var _el$ = _tmpl$389(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
19464
19586
  insert(_el$2, createComponent(Show, {
19465
19587
  get when() {
19466
19588
  return !done();
@@ -19469,7 +19591,7 @@ function AffiliateResetPassword(props) {
19469
19591
  return _tmpl$461();
19470
19592
  },
19471
19593
  get children() {
19472
- var _el$4 = _tmpl$2123(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.firstChild, _el$0 = _el$7.nextSibling;
19594
+ var _el$4 = _tmpl$2124(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.firstChild, _el$0 = _el$7.nextSibling;
19473
19595
  _el$4.addEventListener("submit", handleSubmit);
19474
19596
  insert(_el$5, createComponent(AffiliatePasswordInput, {
19475
19597
  required: true,
@@ -19494,7 +19616,7 @@ function AffiliateResetPassword(props) {
19494
19616
  return error();
19495
19617
  },
19496
19618
  get children() {
19497
- var _el$9 = _tmpl$389();
19619
+ var _el$9 = _tmpl$388();
19498
19620
  insert(_el$9, error);
19499
19621
  effect((_$p) => style(_el$9, errorStyle2(), _$p));
19500
19622
  return _el$9;
@@ -19593,5 +19715,5 @@ function primaryButtonStyle2(submitting) {
19593
19715
  }
19594
19716
 
19595
19717
  export { AddressFields, AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod };
19596
- //# sourceMappingURL=ID67FV6R.js.map
19597
- //# sourceMappingURL=ID67FV6R.js.map
19718
+ //# sourceMappingURL=7COJH6FZ.js.map
19719
+ //# sourceMappingURL=7COJH6FZ.js.map