@apextelemed/partner-core 0.8.0 → 0.9.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 (41) hide show
  1. package/dist/api/index.d.ts +1 -1
  2. package/dist/api/index.js +3 -3
  3. package/dist/api/index.jsx +3 -3
  4. package/dist/chunk/{QAFLR3EN.jsx → 33QXG46Z.jsx} +2 -2
  5. package/dist/chunk/{HKXDH266.js → 35C2PAUI.js} +14 -7
  6. package/dist/chunk/{HKXDH266.js.map → 35C2PAUI.js.map} +1 -1
  7. package/dist/chunk/{HEQMD3X4.js → 65LD7XAZ.js} +3 -3
  8. package/dist/chunk/{HEQMD3X4.js.map → 65LD7XAZ.js.map} +1 -1
  9. package/dist/chunk/{RUA3XYFO.js → 75B7QHIN.js} +23 -6
  10. package/dist/chunk/75B7QHIN.js.map +1 -0
  11. package/dist/chunk/{ZOZBYBNI.js → AJR7CBZ3.js} +3 -3
  12. package/dist/chunk/{ZOZBYBNI.js.map → AJR7CBZ3.js.map} +1 -1
  13. package/dist/chunk/{6UXFHBE2.jsx → C7RXQWXM.jsx} +5 -5
  14. package/dist/chunk/{2OOCTPLG.jsx → DEDIHIWD.jsx} +2 -2
  15. package/dist/chunk/{GNPMRN6O.jsx → IYLVDYRI.jsx} +1504 -789
  16. package/dist/chunk/{EHKYRS2R.js → JOX6EJMB.js} +6 -6
  17. package/dist/chunk/{EHKYRS2R.js.map → JOX6EJMB.js.map} +1 -1
  18. package/dist/chunk/{HYLIHVIE.js → MCSS436N.js} +1592 -590
  19. package/dist/chunk/MCSS436N.js.map +1 -0
  20. package/dist/chunk/{GL3OY7W5.jsx → MUEGVUP2.jsx} +2 -2
  21. package/dist/chunk/{JF2KCOOX.jsx → NTYUIUQO.jsx} +22 -5
  22. package/dist/chunk/{AW6DQGQR.jsx → VKSLQCMA.jsx} +13 -5
  23. package/dist/chunk/{4HOG2LES.js → Y2VD7NYA.js} +3 -3
  24. package/dist/chunk/{4HOG2LES.js.map → Y2VD7NYA.js.map} +1 -1
  25. package/dist/{client-ZnA3JEbd.d.ts → client-RY9ghN5Q.d.ts} +53 -5
  26. package/dist/flows/index.d.ts +1 -6
  27. package/dist/flows/index.js +6 -6
  28. package/dist/flows/index.jsx +6 -6
  29. package/dist/index/index.d.ts +1 -1
  30. package/dist/index/index.js +7 -7
  31. package/dist/index/index.jsx +7 -7
  32. package/dist/pages/index.d.ts +2 -2
  33. package/dist/pages/index.js +5 -5
  34. package/dist/pages/index.jsx +5 -5
  35. package/dist/stores/index.d.ts +1 -1
  36. package/dist/stores/index.js +2 -2
  37. package/dist/stores/index.jsx +2 -2
  38. package/dist/theme/admin.css +262 -0
  39. package/package.json +4 -1
  40. package/dist/chunk/HYLIHVIE.js.map +0 -1
  41. package/dist/chunk/RUA3XYFO.js.map +0 -1
@@ -1,12 +1,14 @@
1
1
  import { disqualificationReasonText, qualifiedDrugIds } from './LZWA44KD.js';
2
- import { SUPPORT_CATEGORIES, useSurveyFlow, reconcileCartAgainstCatalog, resolveSurveyV2DrugIntent, emailGateAnswered, redeemResumeLink, useSurveyV2Flow, availableStateOptions, US_STATE_OPTIONS, useCheckoutFlow, catalogUnavailableMessage, useCartCheckoutFlow, useSignupFlow, useRegisterFlow, useSubscribeFlow, useDashboardData, useUpdatePaymentMethodFlow, useMemberPortalData, useMessagesThread, captureFunnelEmail, markEmailGateAnswered, subscribeToSupportTopic, useAffiliateStats, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, stateAvailabilityNote, hasStateRestrictions, uploadPrescriptionPhoto, deriveAttention, deriveJourney, buildTimeline, lifecycleReason, accountSource, LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, isCssColorValue, categoryLabel, formatConversationTime, buildTrackerView, ACCOUNT_SOURCE_LABEL, fmtDay, formatCalendarDate, formatMessageTime, formatEventDate, formatStageDate, LIFECYCLE_TONE, buildTrackingUrl, isImageAttachment, buildRefillView, toTrackerRequest } from './HKXDH266.js';
3
- import { fetchFunnelConfig } from './HEQMD3X4.js';
2
+ import { SUPPORT_CATEGORIES, useSurveyFlow, reconcileCartAgainstCatalog, resolveSurveyV2DrugIntent, emailGateAnswered, redeemResumeLink, useSurveyV2Flow, availableStateOptions, US_STATE_OPTIONS, useCheckoutFlow, catalogUnavailableMessage, useCartCheckoutFlow, useSignupFlow, useRegisterFlow, useSubscribeFlow, useDashboardData, useUpdatePaymentMethodFlow, useMemberPortalData, useMessagesThread, captureFunnelEmail, markEmailGateAnswered, subscribeToSupportTopic, useAffiliateStats, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, stateAvailabilityNote, hasStateRestrictions, uploadPrescriptionPhoto, deriveAttention, deriveJourney, buildTimeline, lifecycleReason, accountSource, intakeEvidence, LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, isCssColorValue, categoryLabel, formatConversationTime, buildTrackerView, ACCOUNT_SOURCE_LABEL, fmtDay, formatCalendarDate, formatMessageTime, formatEventDate, formatStageDate, LIFECYCLE_TONE, buildTrackingUrl, isImageAttachment, buildRefillView, toTrackerRequest } from './35C2PAUI.js';
3
+ import { fetchFunnelConfig } from './65LD7XAZ.js';
4
4
  import { usePrimitives } from './67KHO66G.js';
5
- import { cart_default, auth_default, affiliateAuth_default } from './4HOG2LES.js';
6
- import { usersApi, adminApi, membersApi, affiliatePortalApi, authApi, adminAffiliatesApi, apiFetch, apexApi, SUPPORT_ATTACHMENT_MIME_TYPES, SUPPORT_ATTACHMENT_MAX_BYTES, ApiError, subscriptionsApi } from './RUA3XYFO.js';
5
+ import { cart_default, auth_default, affiliateAuth_default } from './Y2VD7NYA.js';
6
+ import { usersApi, adminApi, membersApi, affiliatePortalApi, authApi, adminAffiliatesApi, apiFetch, apexApi, SUPPORT_ATTACHMENT_MIME_TYPES, SUPPORT_ATTACHMENT_MAX_BYTES, ApiError, subscriptionsApi } from './75B7QHIN.js';
7
7
  import { delegateEvents, createComponent, insert, memo, effect, setStyleProperty, mergeProps, use, setAttribute, addEventListener, style, className, Dynamic, Portal, template } from 'solid-js/web';
8
- import { createContext, createEffect, on, Show, For, createResource, createSignal, createMemo, untrack, ErrorBoundary, Switch, Match, onMount, Index, onCleanup, useContext } from 'solid-js';
8
+ import { createContext, createEffect, on, Show, For, createResource, createSignal, createMemo, untrack, ErrorBoundary, Switch, Match, onMount, onCleanup, useContext, Index } from 'solid-js';
9
9
  import { isQuestionVisible } from '@apextelemed/survey-core';
10
+ import { Node, Editor } from '@tiptap/core';
11
+ import StarterKit from '@tiptap/starter-kit';
10
12
  import DOMPurify from 'dompurify';
11
13
 
12
14
  var _tmpl$ = /* @__PURE__ */ template(`<div style="text-align:center;padding:5rem 0"><p style=margin-top:1rem;opacity:0.7>Loading survey\u2026`);
@@ -205,7 +207,7 @@ function SurveyForm(props) {
205
207
  Heading,
206
208
  Banner,
207
209
  Button,
208
- Card: Card2
210
+ Card: Card3
209
211
  } = usePrimitives();
210
212
  const flow = props.flow;
211
213
  const progressPct = () => (flow.currentStep() + 1) / flow.totalSteps() * 100;
@@ -220,7 +222,7 @@ function SurveyForm(props) {
220
222
  insert(_el$19, () => flow.currentStep() + 1, _el$22);
221
223
  insert(_el$19, () => flow.totalSteps(), null);
222
224
  insert(_el$23, () => flow.step()?.sectionTitle);
223
- insert(_el$14, createComponent(Card2, {
225
+ insert(_el$14, createComponent(Card3, {
224
226
  variant: "primary",
225
227
  padding: "lg",
226
228
  get children() {
@@ -673,12 +675,12 @@ function QuestionField(props) {
673
675
  }
674
676
  function DrugOption(props) {
675
677
  const {
676
- Card: Card2
678
+ Card: Card3
677
679
  } = usePrimitives();
678
680
  return (() => {
679
681
  var _el$38 = _tmpl$17();
680
682
  _el$38.$$click = () => props.onSelect();
681
- insert(_el$38, createComponent(Card2, {
683
+ insert(_el$38, createComponent(Card3, {
682
684
  get variant() {
683
685
  return props.selected ? "primary" : "inset";
684
686
  },
@@ -1040,11 +1042,11 @@ function CartLinesDroppedPanel(props) {
1040
1042
  const {
1041
1043
  Heading,
1042
1044
  Button,
1043
- Card: Card2
1045
+ Card: Card3
1044
1046
  } = usePrimitives();
1045
1047
  return (() => {
1046
1048
  var _el$3 = _tmpl$52();
1047
- insert(_el$3, createComponent(Card2, {
1049
+ insert(_el$3, createComponent(Card3, {
1048
1050
  get children() {
1049
1051
  return [createComponent(Heading, {
1050
1052
  level: 2,
@@ -1116,7 +1118,7 @@ function EmailGateView(props) {
1116
1118
  const {
1117
1119
  Heading,
1118
1120
  Button,
1119
- Card: Card2,
1121
+ Card: Card3,
1120
1122
  TextField
1121
1123
  } = usePrimitives();
1122
1124
  const [email, setEmail] = createSignal("");
@@ -1137,7 +1139,7 @@ function EmailGateView(props) {
1137
1139
  };
1138
1140
  return (() => {
1139
1141
  var _el$0 = _tmpl$02();
1140
- insert(_el$0, createComponent(Card2, {
1142
+ insert(_el$0, createComponent(Card3, {
1141
1143
  get children() {
1142
1144
  var _el$1 = _tmpl$92(), _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling;
1143
1145
  insert(_el$1, createComponent(Heading, {
@@ -1548,7 +1550,7 @@ function QuestionsView(props) {
1548
1550
  Heading,
1549
1551
  Banner,
1550
1552
  Button,
1551
- Card: Card2
1553
+ Card: Card3
1552
1554
  } = usePrimitives();
1553
1555
  const flow = props.flow;
1554
1556
  const totalForProgress = () => flow.totalSteps() + 1;
@@ -1683,7 +1685,7 @@ function QuestionsView(props) {
1683
1685
  insert(_el$38, () => flow.stepIndex() + 1, _el$41);
1684
1686
  insert(_el$38, totalForProgress, null);
1685
1687
  insert(_el$42, () => flow.currentStep()?.sectionTitle ?? "");
1686
- insert(_el$34, createComponent(Card2, {
1688
+ insert(_el$34, createComponent(Card3, {
1687
1689
  variant: "primary",
1688
1690
  padding: "lg",
1689
1691
  get children() {
@@ -1856,7 +1858,7 @@ function PatientInfoView(props) {
1856
1858
  Heading,
1857
1859
  Banner,
1858
1860
  Button,
1859
- Card: Card2,
1861
+ Card: Card3,
1860
1862
  TextField,
1861
1863
  Select
1862
1864
  } = usePrimitives();
@@ -1872,7 +1874,7 @@ function PatientInfoView(props) {
1872
1874
  level: 1,
1873
1875
  children: "Your information"
1874
1876
  }), _el$61);
1875
- insert(_el$59, createComponent(Card2, {
1877
+ insert(_el$59, createComponent(Card3, {
1876
1878
  variant: "primary",
1877
1879
  padding: "lg",
1878
1880
  get children() {
@@ -3486,7 +3488,7 @@ function PurchaseForm(props) {
3486
3488
  Heading,
3487
3489
  Banner,
3488
3490
  Button,
3489
- Card: Card2,
3491
+ Card: Card3,
3490
3492
  TextField,
3491
3493
  StatusPill
3492
3494
  } = usePrimitives();
@@ -3512,7 +3514,7 @@ function PurchaseForm(props) {
3512
3514
  children: "Purchase Medication"
3513
3515
  }), _el$19);
3514
3516
  insert(_el$19, () => isApproved() ? "Your prescription has been approved. Complete your purchase below." : "Complete your purchase to send your request to a licensed prescriber for review.");
3515
- insert(_el$20, createComponent(Card2, {
3517
+ insert(_el$20, createComponent(Card3, {
3516
3518
  variant: "primary",
3517
3519
  padding: "md",
3518
3520
  get children() {
@@ -3565,7 +3567,7 @@ function PurchaseForm(props) {
3565
3567
  })];
3566
3568
  }
3567
3569
  }));
3568
- insert(_el$17, createComponent(Card2, {
3570
+ insert(_el$17, createComponent(Card3, {
3569
3571
  variant: "primary",
3570
3572
  padding: "lg",
3571
3573
  get children() {
@@ -3626,7 +3628,7 @@ function PurchaseForm(props) {
3626
3628
  },
3627
3629
  get children() {
3628
3630
  var _el$35 = _tmpl$163();
3629
- insert(_el$35, createComponent(Card2, {
3631
+ insert(_el$35, createComponent(Card3, {
3630
3632
  variant: "inset",
3631
3633
  padding: "md",
3632
3634
  get children() {
@@ -3881,7 +3883,7 @@ function PurchaseForm2(props) {
3881
3883
  Heading,
3882
3884
  Banner,
3883
3885
  Button,
3884
- Card: Card2,
3886
+ Card: Card3,
3885
3887
  TextField
3886
3888
  } = usePrimitives();
3887
3889
  const flow = props.flow;
@@ -3896,7 +3898,7 @@ function PurchaseForm2(props) {
3896
3898
  }
3897
3899
  }), _el$12);
3898
3900
  insert(_el$12, () => props.subtitle ?? "Review your order and pay");
3899
- insert(_el$10, createComponent(Card2, {
3901
+ insert(_el$10, createComponent(Card3, {
3900
3902
  variant: "primary",
3901
3903
  padding: "lg",
3902
3904
  get children() {
@@ -4127,7 +4129,7 @@ function SignupContent(props) {
4127
4129
  Heading,
4128
4130
  Banner,
4129
4131
  Button,
4130
- Card: Card2,
4132
+ Card: Card3,
4131
4133
  StepIndicator
4132
4134
  } = usePrimitives();
4133
4135
  const flow = props.flow;
@@ -4148,7 +4150,7 @@ function SignupContent(props) {
4148
4150
  total: 4,
4149
4151
  labels: stepLabels
4150
4152
  }));
4151
- insert(_el$, createComponent(Card2, {
4153
+ insert(_el$, createComponent(Card3, {
4152
4154
  variant: "primary",
4153
4155
  padding: "lg",
4154
4156
  get children() {
@@ -4454,7 +4456,7 @@ function PaymentStep(props) {
4454
4456
  const {
4455
4457
  Heading,
4456
4458
  TextField,
4457
- Card: Card2
4459
+ Card: Card3
4458
4460
  } = usePrimitives();
4459
4461
  const flow = props.flow;
4460
4462
  return (() => {
@@ -4471,7 +4473,7 @@ function PaymentStep(props) {
4471
4473
  return props.paymentBanner();
4472
4474
  }
4473
4475
  }), _el$22);
4474
- insert(_el$15, createComponent(Card2, {
4476
+ insert(_el$15, createComponent(Card3, {
4475
4477
  variant: "inset",
4476
4478
  padding: "md",
4477
4479
  get children() {
@@ -4660,7 +4662,7 @@ function RegisterContent(props) {
4660
4662
  Heading,
4661
4663
  Banner,
4662
4664
  Button,
4663
- Card: Card2,
4665
+ Card: Card3,
4664
4666
  StepIndicator
4665
4667
  } = usePrimitives();
4666
4668
  const flow = props.flow;
@@ -4690,7 +4692,7 @@ function RegisterContent(props) {
4690
4692
  total: 3,
4691
4693
  labels: stepLabels
4692
4694
  }));
4693
- insert(_el$, createComponent(Card2, {
4695
+ insert(_el$, createComponent(Card3, {
4694
4696
  variant: "primary",
4695
4697
  padding: "lg",
4696
4698
  get children() {
@@ -5075,7 +5077,7 @@ function SubscribeContent(props) {
5075
5077
  Heading,
5076
5078
  Banner,
5077
5079
  Button,
5078
- Card: Card2,
5080
+ Card: Card3,
5079
5081
  TextField,
5080
5082
  Select
5081
5083
  } = usePrimitives();
@@ -5112,7 +5114,7 @@ function SubscribeContent(props) {
5112
5114
  }
5113
5115
  }), _el$5);
5114
5116
  insert(_el$5, () => props.subtitle);
5115
- insert(_el$6, createComponent(Card2, {
5117
+ insert(_el$6, createComponent(Card3, {
5116
5118
  variant: "primary",
5117
5119
  padding: "md",
5118
5120
  get children() {
@@ -5184,7 +5186,7 @@ function SubscribeContent(props) {
5184
5186
  })];
5185
5187
  }
5186
5188
  }));
5187
- insert(_el$3, createComponent(Card2, {
5189
+ insert(_el$3, createComponent(Card3, {
5188
5190
  variant: "primary",
5189
5191
  padding: "lg",
5190
5192
  get children() {
@@ -11014,6 +11016,7 @@ var _tmpl$622 = /* @__PURE__ */ template(`<div><div style=font-size:0.75rem;font
11014
11016
  var _tmpl$721 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>`);
11015
11017
  function FunnelActivity(props) {
11016
11018
  const f = () => props.funnel;
11019
+ const inferredFrom = () => props.intake?.kind === "inferred" ? props.intake.from : null;
11017
11020
  const nothing = () => f().captures.length === 0 && f().sessions.length === 0 && f().carts.length === 0;
11018
11021
  return (() => {
11019
11022
  var _el$ = _tmpl$249();
@@ -11025,8 +11028,20 @@ function FunnelActivity(props) {
11025
11028
  return f().captures.length > 0;
11026
11029
  },
11027
11030
  get fallback() {
11028
- return createComponent(Muted, {
11029
- children: "No completed intake survey on record."
11031
+ return createComponent(Show, {
11032
+ get when() {
11033
+ return inferredFrom();
11034
+ },
11035
+ get fallback() {
11036
+ return createComponent(Muted, {
11037
+ children: "No completed intake survey on record."
11038
+ });
11039
+ },
11040
+ children: (from) => createComponent(Muted, {
11041
+ get children() {
11042
+ return ["Completed \u2014 inferred from ", memo(() => from()), ". This site holds no survey answers for it: the survey was taken before intake records were kept here, or through a path that does not record them."];
11043
+ }
11044
+ })
11030
11045
  });
11031
11046
  },
11032
11047
  get children() {
@@ -11193,7 +11208,7 @@ function FunnelActivity(props) {
11193
11208
  },
11194
11209
  get children() {
11195
11210
  return createComponent(Muted, {
11196
- children: "Only completed surveys are recorded for this site. Turning on funnel telemetry would show which survey step people stop at."
11211
+ children: "Funnel telemetry is off for this site, so only completed surveys are recorded. With it on, this box also shows which survey step people stop at."
11197
11212
  });
11198
11213
  }
11199
11214
  }), null);
@@ -12613,6 +12628,9 @@ function CustomerDetail(props) {
12613
12628
  return createComponent(FunnelActivity, {
12614
12629
  get funnel() {
12615
12630
  return ov().funnel;
12631
+ },
12632
+ get intake() {
12633
+ return intakeEvidence(ov());
12616
12634
  }
12617
12635
  });
12618
12636
  }
@@ -14648,9 +14666,9 @@ function Products(props) {
14648
14666
  const [editingProduct, setEditingProduct] = createSignal(null);
14649
14667
  const [saving, setSaving] = createSignal(false);
14650
14668
  const [pending, setPending] = createSignal(/* @__PURE__ */ new Set());
14651
- const setRowPending = (id, on8) => setPending((prev) => {
14669
+ const setRowPending = (id, on9) => setPending((prev) => {
14652
14670
  const next = new Set(prev);
14653
- if (on8) next.add(id);
14671
+ if (on9) next.add(id);
14654
14672
  else next.delete(id);
14655
14673
  return next;
14656
14674
  });
@@ -14767,9 +14785,9 @@ function Products(props) {
14767
14785
  };
14768
14786
  const [checked, setChecked] = createSignal(/* @__PURE__ */ new Set());
14769
14787
  const isChecked = (entry) => checked().has(entry.drugId);
14770
- const setCheckedFor = (ids, on8) => setChecked((prev) => {
14788
+ const setCheckedFor = (ids, on9) => setChecked((prev) => {
14771
14789
  const next = new Set(prev);
14772
- for (const id of ids) on8 ? next.add(id) : next.delete(id);
14790
+ for (const id of ids) on9 ? next.add(id) : next.delete(id);
14773
14791
  return next;
14774
14792
  });
14775
14793
  createEffect(() => {
@@ -16917,79 +16935,766 @@ function Webhooks() {
16917
16935
  })();
16918
16936
  }
16919
16937
  delegateEvents(["click"]);
16920
- var _tmpl$291 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.5rem 0 0">`);
16921
- var _tmpl$295 = /* @__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>`);
16922
- var _tmpl$358 = /* @__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`);
16923
- var _tmpl$448 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.25rem><div><label class=app-admin-label>Subject</label><input type=text aria-label=Subject class=app-admin-input><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/</p></div><div><label class=app-admin-label>Greeting</label><input type=text aria-label=Greeting class=app-admin-input></div><div><label class=app-admin-label>Body Paragraphs (<!>/<!>)</label><div style=display:flex;flex-direction:column;gap:0.75rem></div></div><div><label class=app-admin-label>Closing Text</label><textarea aria-label="Closing Text"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>/`);
16924
- var _tmpl$540 = /* @__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">`);
16925
- var _tmpl$637 = /* @__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;`);
16926
- var _tmpl$734 = /* @__PURE__ */ template(`<div style=display:flex;gap:0.5rem><textarea rows=3 class=app-admin-input style=flex:1;resize:vertical>`);
16927
- var TEMPLATE_LIMITS = {
16928
- subject: 200,
16929
- closing: 500,
16930
- paragraphs: 10
16931
- };
16932
- function TemplateTextEditor(props) {
16933
- const [lastFocused, setLastFocused] = createSignal(null);
16934
- const set = (field2, value) => props.onChange({
16935
- ...props.value,
16936
- [field2]: value
16938
+
16939
+ // src/pages/admin/emailBodyHtml.ts
16940
+ var TOKEN_SOURCE = "\\{\\{[A-Za-z_][A-Za-z0-9_]*\\}\\}";
16941
+ var tokenPattern = () => new RegExp(TOKEN_SOURCE, "g");
16942
+ var LEADING_TOKEN = new RegExp(`^${TOKEN_SOURCE}`);
16943
+ var CHIP_ATTR = "data-placeholder";
16944
+ var ALLOWED_TAGS = /* @__PURE__ */ new Set(["p", "h2", "ul", "ol", "li", "strong", "em", "u", "br", "a"]);
16945
+ function isAllowedHref(href) {
16946
+ if (!href) return false;
16947
+ const value = href.trim();
16948
+ return /^(https?:|mailto:|tel:)/i.test(value) || LEADING_TOKEN.test(value);
16949
+ }
16950
+ function normalizeTypedHref(input) {
16951
+ const value = input.trim();
16952
+ if (!value) return "";
16953
+ if (isAllowedHref(value)) return value;
16954
+ if (/^[a-z][a-z0-9+.-]*:(?!\d)/i.test(value)) return value;
16955
+ if (/^[^\s@/]+@[^\s@/]+\.[^\s@/]+$/.test(value)) return `mailto:${value}`;
16956
+ return `https://${value}`;
16957
+ }
16958
+ function parseFragment(html) {
16959
+ return new DOMParser().parseFromString(`<!doctype html><body>${html}`, "text/html").body;
16960
+ }
16961
+ function textNodesOf(root) {
16962
+ const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);
16963
+ const out = [];
16964
+ for (let n = walker.nextNode(); n; n = walker.nextNode()) out.push(n);
16965
+ return out;
16966
+ }
16967
+ function tokensToChips(html) {
16968
+ const body = parseFragment(html);
16969
+ const doc = body.ownerDocument;
16970
+ for (const text of textNodesOf(body)) {
16971
+ const value = text.data;
16972
+ const matches = [...value.matchAll(tokenPattern())];
16973
+ if (matches.length === 0) continue;
16974
+ const frag = doc.createDocumentFragment();
16975
+ let cursor = 0;
16976
+ for (const m of matches) {
16977
+ const at = m.index;
16978
+ if (at > cursor) frag.append(value.slice(cursor, at));
16979
+ const chip = doc.createElement("span");
16980
+ chip.setAttribute(CHIP_ATTR, m[0]);
16981
+ chip.textContent = m[0];
16982
+ frag.append(chip);
16983
+ cursor = at + m[0].length;
16984
+ }
16985
+ if (cursor < value.length) frag.append(value.slice(cursor));
16986
+ text.replaceWith(frag);
16987
+ }
16988
+ return body.innerHTML;
16989
+ }
16990
+ function unwrap(el) {
16991
+ el.replaceWith(...Array.from(el.childNodes));
16992
+ }
16993
+ function canonicalizeBodyHtml(html) {
16994
+ const body = parseFragment(html);
16995
+ for (const chip of Array.from(body.querySelectorAll(`[${CHIP_ATTR}]`))) {
16996
+ chip.replaceWith(chip.getAttribute(CHIP_ATTR) ?? "");
16997
+ }
16998
+ for (const el of Array.from(body.querySelectorAll("*")).reverse()) {
16999
+ const tag = el.tagName.toLowerCase();
17000
+ if (!ALLOWED_TAGS.has(tag)) {
17001
+ unwrap(el);
17002
+ continue;
17003
+ }
17004
+ const href = tag === "a" ? el.getAttribute("href")?.trim() : void 0;
17005
+ const isButton = tag === "a" && el.hasAttribute("data-button") && el.parentElement === body;
17006
+ for (const attr of Array.from(el.attributes)) el.removeAttribute(attr.name);
17007
+ if (tag !== "a") continue;
17008
+ if (!isAllowedHref(href)) {
17009
+ if (isButton) {
17010
+ const p = body.ownerDocument.createElement("p");
17011
+ p.append(...Array.from(el.childNodes));
17012
+ el.replaceWith(p);
17013
+ } else {
17014
+ unwrap(el);
17015
+ }
17016
+ continue;
17017
+ }
17018
+ if (isButton) el.setAttribute("data-button", "");
17019
+ el.setAttribute("href", href);
17020
+ }
17021
+ for (const li of Array.from(body.querySelectorAll("li"))) {
17022
+ const paragraphs = Array.from(li.children).filter((c) => c.tagName === "P");
17023
+ if (paragraphs.length === 1 && li.firstChild === paragraphs[0]) unwrap(paragraphs[0]);
17024
+ }
17025
+ body.normalize();
17026
+ const out = body.innerHTML.replace(/<a data-button=""/g, "<a data-button");
17027
+ return out === "<p></p>" ? "" : out;
17028
+ }
17029
+
17030
+ // src/pages/admin/emailBodyExtensions.ts
17031
+ var PLACEHOLDER_NODE = "placeholder";
17032
+ var BUTTON_NODE = "emailButton";
17033
+ var UNKNOWN_PLACEHOLDER_TITLE = "Unknown placeholder \u2014 this template has no such value, so it would be sent as-is. Delete it.";
17034
+ var PlaceholderNode = Node.create({
17035
+ name: PLACEHOLDER_NODE,
17036
+ group: "inline",
17037
+ inline: true,
17038
+ atom: true,
17039
+ selectable: true,
17040
+ addOptions() {
17041
+ return { lookup: () => void 0 };
17042
+ },
17043
+ addAttributes() {
17044
+ return {
17045
+ token: {
17046
+ default: "",
17047
+ rendered: false,
17048
+ parseHTML: (el) => el.getAttribute(CHIP_ATTR) ?? ""
17049
+ }
17050
+ };
17051
+ },
17052
+ parseHTML() {
17053
+ return [{ tag: `span[${CHIP_ATTR}]` }];
17054
+ },
17055
+ renderHTML({ node }) {
17056
+ const token = node.attrs.token;
17057
+ const known = this.options.lookup(token);
17058
+ return [
17059
+ "span",
17060
+ {
17061
+ [CHIP_ATTR]: token,
17062
+ class: known ? "app-admin-email-chip" : "app-admin-email-chip app-admin-email-chip--unknown",
17063
+ title: known ? known.description : UNKNOWN_PLACEHOLDER_TITLE,
17064
+ contenteditable: "false"
17065
+ },
17066
+ token
17067
+ ];
17068
+ },
17069
+ renderText({ node }) {
17070
+ return node.attrs.token;
17071
+ }
17072
+ });
17073
+ var ButtonBlock = Node.create({
17074
+ name: BUTTON_NODE,
17075
+ group: "block",
17076
+ content: `(text | ${PLACEHOLDER_NODE})*`,
17077
+ marks: "",
17078
+ defining: true,
17079
+ addAttributes() {
17080
+ return {
17081
+ href: {
17082
+ default: "",
17083
+ rendered: false,
17084
+ parseHTML: (el) => el.getAttribute("href") ?? ""
17085
+ }
17086
+ };
17087
+ },
17088
+ parseHTML() {
17089
+ return [{ tag: "a[data-button]", priority: 1100 }];
17090
+ },
17091
+ renderHTML({ node }) {
17092
+ return ["a", { "data-button": "", href: node.attrs.href, class: "app-admin-email-button" }, 0];
17093
+ },
17094
+ addKeyboardShortcuts() {
17095
+ return {
17096
+ // Enter in a button starts a paragraph below it instead of splitting the
17097
+ // button in two.
17098
+ Enter: ({ editor }) => {
17099
+ const { $from } = editor.state.selection;
17100
+ if ($from.parent.type.name !== this.name) return false;
17101
+ const after = $from.after();
17102
+ return editor.chain().insertContentAt(after, { type: "paragraph" }).setTextSelection(after + 1).run();
17103
+ }
17104
+ };
17105
+ }
17106
+ });
17107
+ function buildEmailBodyExtensions(lookup) {
17108
+ return [
17109
+ StarterKit.configure({
17110
+ // Not in the allowlist.
17111
+ blockquote: false,
17112
+ code: false,
17113
+ codeBlock: false,
17114
+ strike: false,
17115
+ horizontalRule: false,
17116
+ // It appends an empty paragraph after a trailing list/heading/button,
17117
+ // which would make every such body serialize differently from how it loaded.
17118
+ trailingNode: false,
17119
+ heading: { levels: [2] },
17120
+ link: {
17121
+ openOnClick: false,
17122
+ defaultProtocol: "https",
17123
+ // Tiptap's defaults add target/rel to every link; the stored form is href only.
17124
+ HTMLAttributes: { target: null, rel: null, class: null },
17125
+ isAllowedUri: (url) => isAllowedHref(url)
17126
+ }
17127
+ }),
17128
+ PlaceholderNode.configure({ lookup }),
17129
+ ButtonBlock
17130
+ ];
17131
+ }
17132
+
17133
+ // src/pages/admin/EmailBodyEditor.tsx
17134
+ var _tmpl$291 = /* @__PURE__ */ template(`<button type=button>`);
17135
+ var _tmpl$295 = /* @__PURE__ */ template(`<strong>B`);
17136
+ var _tmpl$358 = /* @__PURE__ */ template(`<em>I`);
17137
+ var _tmpl$448 = /* @__PURE__ */ template(`<u>U`);
17138
+ var _tmpl$540 = /* @__PURE__ */ template(`<div class=app-admin-email-menu role=menu aria-label=Placeholders>`);
17139
+ var _tmpl$637 = /* @__PURE__ */ template(`<div class=app-admin-email-editor><div class=app-admin-email-toolbar role=toolbar aria-label=Formatting><span class=app-admin-email-tool-sep aria-hidden=true></span><span class=app-admin-email-tool-sep aria-hidden=true></span><span class=app-admin-email-tool-sep aria-hidden=true></span><div class=app-admin-email-menu-wrap><button type=button class=app-admin-email-tool aria-haspopup=menu>Insert placeholder &#9662;</button></div></div><div class=app-admin-email-canvas><div class=app-admin-email-page>`);
17140
+ var _tmpl$734 = /* @__PURE__ */ template(`<button type=button role=menuitem class=app-admin-email-menu-item><span class=app-admin-email-menu-token></span><span class=app-admin-email-menu-desc>`);
17141
+ var _tmpl$829 = /* @__PURE__ */ template(`<label class=app-admin-email-dialog-field><span></span><input type=text class=app-admin-input>`);
17142
+ var _tmpl$926 = /* @__PURE__ */ template(`<label class=app-admin-email-dialog-field><span>Web address</span><input type=text inputmode=url class=app-admin-input placeholder=https://>`);
17143
+ var _tmpl$022 = /* @__PURE__ */ template(`<p class=app-admin-field-error role=alert>`);
17144
+ var _tmpl$1104 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">`);
17145
+ var _tmpl$1017 = /* @__PURE__ */ template(`<div class=app-admin-email-dialog role=group><label class=app-admin-email-dialog-field><span>Link to</span><select class=app-admin-input><option value=__custom__>A web address</option></select></label><div class=app-admin-email-dialog-actions><button type=button class="app-admin-btn app-admin-btn-primary"></button><button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
17146
+ var _tmpl$1118 = /* @__PURE__ */ template(`<option> (<!>)`);
17147
+ var CUSTOM_TARGET = "__custom__";
17148
+ var placeholderKey = (list) => list.map((p) => p.token).join("|");
17149
+ function EmailBodyEditor(props) {
17150
+ let surface;
17151
+ const [editor, setEditor] = createSignal(null);
17152
+ const [tick, setTick] = createSignal(0);
17153
+ const [dialog, setDialog] = createSignal(null);
17154
+ const [menuOpen, setMenuOpen] = createSignal(false);
17155
+ let shown = null;
17156
+ let shownPlaceholders = "";
17157
+ const lookup = (token) => props.placeholders.find((p) => p.token === token);
17158
+ const urlPlaceholders = () => props.placeholders.filter((p) => p.kind === "url");
17159
+ const load = (value) => {
17160
+ editor()?.destroy();
17161
+ shown = value;
17162
+ shownPlaceholders = placeholderKey(props.placeholders);
17163
+ setDialog(null);
17164
+ setMenuOpen(false);
17165
+ setEditor(new Editor({
17166
+ element: surface,
17167
+ extensions: buildEmailBodyExtensions(lookup),
17168
+ content: tokensToChips(value),
17169
+ editorProps: {
17170
+ attributes: {
17171
+ class: "app-admin-email-surface",
17172
+ role: "textbox",
17173
+ "aria-multiline": "true",
17174
+ "aria-label": "Email body"
17175
+ }
17176
+ },
17177
+ onUpdate: ({
17178
+ editor: ed
17179
+ }) => {
17180
+ const html = canonicalizeBodyHtml(ed.getHTML());
17181
+ shown = html;
17182
+ props.onChange(html);
17183
+ },
17184
+ onTransaction: () => setTick((t) => t + 1),
17185
+ onFocus: () => props.onFocus?.()
17186
+ }));
17187
+ };
17188
+ onMount(() => {
17189
+ load(props.value);
17190
+ props.ref?.({
17191
+ insertPlaceholder,
17192
+ focus: () => editor()?.commands.focus()
17193
+ });
16937
17194
  });
16938
- const setParagraph = (index, value) => {
16939
- const updated = [...props.value.bodyParagraphs];
16940
- updated[index] = value;
16941
- set("bodyParagraphs", updated);
17195
+ createEffect(on(() => [props.value, placeholderKey(props.placeholders)], ([value, key]) => {
17196
+ if (!editor()) return;
17197
+ if (value !== shown || key !== shownPlaceholders) load(value);
17198
+ }, {
17199
+ defer: true
17200
+ }));
17201
+ onCleanup(() => editor()?.destroy());
17202
+ const isActive = (name, attrs) => {
17203
+ tick();
17204
+ return editor()?.isActive(name, attrs) ?? false;
17205
+ };
17206
+ const run = (fn) => {
17207
+ const ed = editor();
17208
+ if (ed) fn(ed);
17209
+ };
17210
+ function insertPlaceholder(token) {
17211
+ run((ed) => ed.chain().focus().insertContent({
17212
+ type: PLACEHOLDER_NODE,
17213
+ attrs: {
17214
+ token
17215
+ }
17216
+ }).run());
17217
+ }
17218
+ const splitHref = (href) => urlPlaceholders().some((p) => p.token === href) ? {
17219
+ target: href,
17220
+ url: ""
17221
+ } : {
17222
+ target: CUSTOM_TARGET,
17223
+ url: href
16942
17224
  };
16943
- const addParagraph = () => {
16944
- if (props.value.bodyParagraphs.length >= TEMPLATE_LIMITS.paragraphs) return;
16945
- set("bodyParagraphs", [...props.value.bodyParagraphs, ""]);
17225
+ const openLinkDialog = () => run((ed) => {
17226
+ setMenuOpen(false);
17227
+ const existing = ed.getAttributes("link").href ?? "";
17228
+ const {
17229
+ empty
17230
+ } = ed.state.selection;
17231
+ setDialog({
17232
+ mode: "link",
17233
+ editing: !!existing,
17234
+ needsText: empty && !existing,
17235
+ ...splitHref(existing),
17236
+ text: "",
17237
+ error: ""
17238
+ });
17239
+ });
17240
+ const openButtonDialog = () => run((ed) => {
17241
+ setMenuOpen(false);
17242
+ const inButton = ed.isActive(BUTTON_NODE);
17243
+ const {
17244
+ from,
17245
+ to
17246
+ } = ed.state.selection;
17247
+ setDialog({
17248
+ mode: "button",
17249
+ editing: inButton,
17250
+ needsText: !inButton,
17251
+ ...splitHref(inButton ? ed.getAttributes(BUTTON_NODE).href ?? "" : ""),
17252
+ // Selected text becomes the suggested label.
17253
+ text: inButton ? "" : ed.state.doc.textBetween(from, to, " ").trim(),
17254
+ error: ""
17255
+ });
17256
+ });
17257
+ const patchDialog = (patch) => {
17258
+ const d = dialog();
17259
+ if (d) setDialog({
17260
+ ...d,
17261
+ ...patch,
17262
+ error: patch.error ?? ""
17263
+ });
16946
17264
  };
16947
- const removeParagraph = (index) => {
16948
- if (props.value.bodyParagraphs.length <= 1) return;
16949
- set("bodyParagraphs", props.value.bodyParagraphs.filter((_, i) => i !== index));
17265
+ const closeDialog = () => {
17266
+ setDialog(null);
17267
+ editor()?.commands.focus();
16950
17268
  };
16951
- const insertToken = (token) => {
16952
- const f = lastFocused();
16953
- if (!f) return;
16954
- const el = f.el;
17269
+ const applyDialog = () => {
17270
+ const d = dialog();
17271
+ const ed = editor();
17272
+ if (!d || !ed) return;
17273
+ const href = d.target === CUSTOM_TARGET ? normalizeTypedHref(d.url) : d.target;
17274
+ if (!href) return patchDialog({
17275
+ error: "Enter a web address, or pick a placeholder to link to."
17276
+ });
17277
+ if (!isAllowedHref(href)) {
17278
+ return patchDialog({
17279
+ error: "Links must start with https://, http://, mailto: or tel: \u2014 or use a placeholder."
17280
+ });
17281
+ }
17282
+ const text = d.text.trim();
17283
+ if (d.needsText && !text) {
17284
+ return patchDialog({
17285
+ error: d.mode === "button" ? "Enter the button label." : "Enter the text to show for the link."
17286
+ });
17287
+ }
17288
+ if (d.mode === "link") {
17289
+ if (d.needsText) {
17290
+ ed.chain().focus().insertContent({
17291
+ type: "text",
17292
+ text,
17293
+ marks: [{
17294
+ type: "link",
17295
+ attrs: {
17296
+ href
17297
+ }
17298
+ }]
17299
+ }).run();
17300
+ } else {
17301
+ ed.chain().focus().extendMarkRange("link").setLink({
17302
+ href
17303
+ }).run();
17304
+ }
17305
+ } else if (d.editing) {
17306
+ ed.chain().focus().updateAttributes(BUTTON_NODE, {
17307
+ href
17308
+ }).run();
17309
+ } else {
17310
+ const {
17311
+ $from
17312
+ } = ed.state.selection;
17313
+ const node = {
17314
+ type: BUTTON_NODE,
17315
+ attrs: {
17316
+ href
17317
+ },
17318
+ content: [{
17319
+ type: "text",
17320
+ text
17321
+ }]
17322
+ };
17323
+ const top = $from.depth >= 1 ? $from.node(1) : null;
17324
+ const replaceEmpty = top?.type.name === "paragraph" && top.content.size === 0;
17325
+ const at = $from.depth >= 1 ? $from.after(1) : ed.state.doc.content.size;
17326
+ ed.chain().focus().insertContentAt(replaceEmpty ? {
17327
+ from: $from.before(1),
17328
+ to: at
17329
+ } : at, node).run();
17330
+ }
17331
+ setDialog(null);
17332
+ };
17333
+ const removeTarget = () => {
17334
+ const d = dialog();
17335
+ const ed = editor();
17336
+ if (!d || !ed) return;
17337
+ if (d.mode === "link") ed.chain().focus().extendMarkRange("link").unsetLink().run();
17338
+ else ed.chain().focus().setParagraph().run();
17339
+ setDialog(null);
17340
+ };
17341
+ const onDialogKeyDown = (e) => {
17342
+ if (e.key === "Escape") {
17343
+ e.preventDefault();
17344
+ closeDialog();
17345
+ } else if (e.key === "Enter" && e.target.tagName === "INPUT") {
17346
+ e.preventDefault();
17347
+ applyDialog();
17348
+ }
17349
+ };
17350
+ let menuButton;
17351
+ let menuEl;
17352
+ const closeMenu = (refocus = false) => {
17353
+ setMenuOpen(false);
17354
+ if (refocus) menuButton.focus();
17355
+ };
17356
+ const onDocPointerDown = (e) => {
17357
+ if (!menuOpen()) return;
17358
+ const t = e.target;
17359
+ if (!menuEl?.contains(t) && !menuButton.contains(t)) closeMenu();
17360
+ };
17361
+ onMount(() => document.addEventListener("mousedown", onDocPointerDown));
17362
+ onCleanup(() => document.removeEventListener("mousedown", onDocPointerDown));
17363
+ const moveFocus = (items, current2, delta) => {
17364
+ if (items.length === 0) return;
17365
+ const i = items.indexOf(current2);
17366
+ items[(i + delta + items.length) % items.length].focus();
17367
+ };
17368
+ const onMenuKeyDown = (e) => {
17369
+ const items = Array.from(menuEl?.querySelectorAll('[role="menuitem"]') ?? []);
17370
+ if (e.key === "Escape") {
17371
+ e.preventDefault();
17372
+ e.stopPropagation();
17373
+ closeMenu(true);
17374
+ } else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
17375
+ e.preventDefault();
17376
+ e.stopPropagation();
17377
+ moveFocus(items, document.activeElement, e.key === "ArrowDown" ? 1 : -1);
17378
+ } else if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
17379
+ e.stopPropagation();
17380
+ }
17381
+ };
17382
+ const toggleMenu = () => {
17383
+ const next = !menuOpen();
17384
+ setMenuOpen(next);
17385
+ if (next) {
17386
+ setDialog(null);
17387
+ queueMicrotask(() => menuEl?.querySelector('[role="menuitem"]')?.focus());
17388
+ }
17389
+ };
17390
+ const onToolbarKeyDown = (e) => {
17391
+ if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
17392
+ const bar = e.currentTarget;
17393
+ const items = Array.from(bar.querySelectorAll(":scope > button, :scope > .app-admin-email-menu-wrap > button"));
17394
+ if (!items.includes(document.activeElement)) return;
17395
+ e.preventDefault();
17396
+ moveFocus(items, document.activeElement, e.key === "ArrowRight" ? 1 : -1);
17397
+ };
17398
+ const ToolButton = (p) => (() => {
17399
+ var _el$ = _tmpl$291();
17400
+ addEventListener(_el$, "click", p.onClick, true);
17401
+ _el$.$$mousedown = (e) => e.preventDefault();
17402
+ insert(_el$, () => p.children);
17403
+ effect((_p$) => {
17404
+ var _v$ = `app-admin-email-tool${p.class ? ` ${p.class}` : ""}`, _v$2 = p.label, _v$3 = p.label, _v$4 = p.pressed ? p.pressed() ? "true" : "false" : void 0;
17405
+ _v$ !== _p$.e && className(_el$, _p$.e = _v$);
17406
+ _v$2 !== _p$.t && setAttribute(_el$, "aria-label", _p$.t = _v$2);
17407
+ _v$3 !== _p$.a && setAttribute(_el$, "title", _p$.a = _v$3);
17408
+ _v$4 !== _p$.o && setAttribute(_el$, "aria-pressed", _p$.o = _v$4);
17409
+ return _p$;
17410
+ }, {
17411
+ e: void 0,
17412
+ t: void 0,
17413
+ a: void 0,
17414
+ o: void 0
17415
+ });
17416
+ return _el$;
17417
+ })();
17418
+ return (() => {
17419
+ var _el$2 = _tmpl$637(), _el$3 = _el$2.firstChild, _el$7 = _el$3.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.firstChild, _el$11 = _el$3.nextSibling, _el$12 = _el$11.firstChild;
17420
+ _el$3.$$keydown = onToolbarKeyDown;
17421
+ insert(_el$3, createComponent(ToolButton, {
17422
+ label: "Bold",
17423
+ pressed: () => isActive("bold"),
17424
+ onClick: () => run((ed) => ed.chain().focus().toggleBold().run()),
17425
+ get children() {
17426
+ return _tmpl$295();
17427
+ }
17428
+ }), _el$7);
17429
+ insert(_el$3, createComponent(ToolButton, {
17430
+ label: "Italic",
17431
+ pressed: () => isActive("italic"),
17432
+ onClick: () => run((ed) => ed.chain().focus().toggleItalic().run()),
17433
+ get children() {
17434
+ return _tmpl$358();
17435
+ }
17436
+ }), _el$7);
17437
+ insert(_el$3, createComponent(ToolButton, {
17438
+ label: "Underline",
17439
+ pressed: () => isActive("underline"),
17440
+ onClick: () => run((ed) => ed.chain().focus().toggleUnderline().run()),
17441
+ get children() {
17442
+ return _tmpl$448();
17443
+ }
17444
+ }), _el$7);
17445
+ insert(_el$3, createComponent(ToolButton, {
17446
+ label: "Heading",
17447
+ pressed: () => isActive("heading", {
17448
+ level: 2
17449
+ }),
17450
+ onClick: () => run((ed) => ed.chain().focus().toggleHeading({
17451
+ level: 2
17452
+ }).run()),
17453
+ children: "Heading"
17454
+ }), _el$8);
17455
+ insert(_el$3, createComponent(ToolButton, {
17456
+ label: "Bullet list",
17457
+ pressed: () => isActive("bulletList"),
17458
+ onClick: () => run((ed) => ed.chain().focus().toggleBulletList().run()),
17459
+ children: "\u2022 List"
17460
+ }), _el$8);
17461
+ insert(_el$3, createComponent(ToolButton, {
17462
+ label: "Numbered list",
17463
+ pressed: () => isActive("orderedList"),
17464
+ onClick: () => run((ed) => ed.chain().focus().toggleOrderedList().run()),
17465
+ children: "1. List"
17466
+ }), _el$8);
17467
+ insert(_el$3, createComponent(ToolButton, {
17468
+ label: "Link",
17469
+ pressed: () => isActive("link"),
17470
+ onClick: openLinkDialog,
17471
+ children: "Link"
17472
+ }), _el$9);
17473
+ insert(_el$3, createComponent(ToolButton, {
17474
+ label: "Button",
17475
+ pressed: () => isActive(BUTTON_NODE),
17476
+ onClick: openButtonDialog,
17477
+ children: "Button"
17478
+ }), _el$9);
17479
+ _el$1.$$click = toggleMenu;
17480
+ _el$1.$$mousedown = (e) => e.preventDefault();
17481
+ var _ref$ = menuButton;
17482
+ typeof _ref$ === "function" ? use(_ref$, _el$1) : menuButton = _el$1;
17483
+ insert(_el$0, createComponent(Show, {
17484
+ get when() {
17485
+ return menuOpen();
17486
+ },
17487
+ get children() {
17488
+ var _el$10 = _tmpl$540();
17489
+ _el$10.$$keydown = onMenuKeyDown;
17490
+ var _ref$2 = menuEl;
17491
+ typeof _ref$2 === "function" ? use(_ref$2, _el$10) : menuEl = _el$10;
17492
+ insert(_el$10, createComponent(For, {
17493
+ get each() {
17494
+ return props.placeholders;
17495
+ },
17496
+ children: (p) => (() => {
17497
+ var _el$13 = _tmpl$734(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling;
17498
+ _el$13.$$click = () => {
17499
+ closeMenu();
17500
+ insertPlaceholder(p.token);
17501
+ };
17502
+ insert(_el$14, () => p.token);
17503
+ insert(_el$15, () => p.description);
17504
+ return _el$13;
17505
+ })()
17506
+ }));
17507
+ return _el$10;
17508
+ }
17509
+ }), null);
17510
+ insert(_el$2, createComponent(Show, {
17511
+ get when() {
17512
+ return dialog();
17513
+ },
17514
+ children: (d) => (() => {
17515
+ var _el$16 = _tmpl$1017(), _el$20 = _el$16.firstChild, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$22.firstChild, _el$28 = _el$20.nextSibling, _el$29 = _el$28.firstChild, _el$31 = _el$29.nextSibling;
17516
+ _el$16.$$keydown = onDialogKeyDown;
17517
+ insert(_el$16, createComponent(Show, {
17518
+ get when() {
17519
+ return d().needsText;
17520
+ },
17521
+ get children() {
17522
+ var _el$17 = _tmpl$829(), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling;
17523
+ insert(_el$18, () => d().mode === "button" ? "Button label" : "Link text");
17524
+ _el$19.$$input = (e) => patchDialog({
17525
+ text: e.currentTarget.value
17526
+ });
17527
+ use((el) => queueMicrotask(() => el.focus()), _el$19);
17528
+ effect(() => _el$19.value = d().text);
17529
+ return _el$17;
17530
+ }
17531
+ }), _el$20);
17532
+ _el$22.addEventListener("change", (e) => patchDialog({
17533
+ target: e.currentTarget.value
17534
+ }));
17535
+ use((el) => {
17536
+ if (!d().needsText && d().target !== CUSTOM_TARGET) queueMicrotask(() => el.focus());
17537
+ }, _el$22);
17538
+ insert(_el$22, createComponent(For, {
17539
+ get each() {
17540
+ return urlPlaceholders();
17541
+ },
17542
+ children: (p) => (() => {
17543
+ var _el$32 = _tmpl$1118(), _el$33 = _el$32.firstChild, _el$35 = _el$33.nextSibling; _el$35.nextSibling;
17544
+ insert(_el$32, () => p.description, _el$33);
17545
+ insert(_el$32, () => p.token, _el$35);
17546
+ effect(() => _el$32.selected = d().target === p.token);
17547
+ effect(() => _el$32.value = p.token);
17548
+ return _el$32;
17549
+ })()
17550
+ }), null);
17551
+ insert(_el$16, createComponent(Show, {
17552
+ get when() {
17553
+ return d().target === CUSTOM_TARGET;
17554
+ },
17555
+ get children() {
17556
+ var _el$24 = _tmpl$926(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
17557
+ _el$26.$$input = (e) => patchDialog({
17558
+ url: e.currentTarget.value
17559
+ });
17560
+ use((el) => {
17561
+ if (!d().needsText) queueMicrotask(() => el.focus());
17562
+ }, _el$26);
17563
+ effect(() => _el$26.value = d().url);
17564
+ return _el$24;
17565
+ }
17566
+ }), _el$28);
17567
+ insert(_el$16, createComponent(Show, {
17568
+ get when() {
17569
+ return d().error;
17570
+ },
17571
+ get children() {
17572
+ var _el$27 = _tmpl$022();
17573
+ insert(_el$27, () => d().error);
17574
+ return _el$27;
17575
+ }
17576
+ }), _el$28);
17577
+ _el$29.$$click = applyDialog;
17578
+ insert(_el$29, (() => {
17579
+ var _c$ = memo(() => !!d().editing);
17580
+ return () => _c$() ? "Update" : d().mode === "button" ? "Insert button" : "Add link";
17581
+ })());
17582
+ insert(_el$28, createComponent(Show, {
17583
+ get when() {
17584
+ return d().editing;
17585
+ },
17586
+ get children() {
17587
+ var _el$30 = _tmpl$1104();
17588
+ _el$30.$$click = removeTarget;
17589
+ insert(_el$30, () => d().mode === "button" ? "Remove button" : "Remove link");
17590
+ return _el$30;
17591
+ }
17592
+ }), _el$31);
17593
+ _el$31.$$click = closeDialog;
17594
+ effect((_p$) => {
17595
+ var _v$7 = d().mode === "button" ? "Button" : "Link", _v$8 = d().target === CUSTOM_TARGET;
17596
+ _v$7 !== _p$.e && setAttribute(_el$16, "aria-label", _p$.e = _v$7);
17597
+ _v$8 !== _p$.t && (_el$23.selected = _p$.t = _v$8);
17598
+ return _p$;
17599
+ }, {
17600
+ e: void 0,
17601
+ t: void 0
17602
+ });
17603
+ return _el$16;
17604
+ })()
17605
+ }), _el$11);
17606
+ var _ref$3 = surface;
17607
+ typeof _ref$3 === "function" ? use(_ref$3, _el$12) : surface = _el$12;
17608
+ effect((_p$) => {
17609
+ var _v$5 = menuOpen() ? "true" : "false", _v$6 = props.placeholders.length === 0;
17610
+ _v$5 !== _p$.e && setAttribute(_el$1, "aria-expanded", _p$.e = _v$5);
17611
+ _v$6 !== _p$.t && (_el$1.disabled = _p$.t = _v$6);
17612
+ return _p$;
17613
+ }, {
17614
+ e: void 0,
17615
+ t: void 0
17616
+ });
17617
+ return _el$2;
17618
+ })();
17619
+ }
17620
+ delegateEvents(["mousedown", "click", "keydown", "input"]);
17621
+
17622
+ // src/pages/admin/EmailTextEditor.tsx
17623
+ var _tmpl$296 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.5rem 0 0">`);
17624
+ var _tmpl$297 = /* @__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>Placeholders<span style=font-weight:400;color:var(--app-admin-fg-muted)> &mdash; replaced with the real value when the email is sent. Click the subject or the body, then a placeholder to insert it.</span></p><div style=display:flex;flex-wrap:wrap;gap:0.375rem>`);
17625
+ var _tmpl$359 = /* @__PURE__ */ template(`<p class=app-admin-field-error role=alert>This email is too long to save (<!> of <!> characters, formatting included). Shorten it.`);
17626
+ var _tmpl$449 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.25rem><div><label class=app-admin-label>Subject</label><input type=text aria-label=Subject class=app-admin-input><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/</p></div><div><span class=app-admin-label>Body`);
17627
+ var _tmpl$541 = /* @__PURE__ */ template(`<button type=button class=app-admin-email-token-btn>`);
17628
+ var TEMPLATE_LIMITS = {
17629
+ subject: 200,
17630
+ body: 2e4
17631
+ };
17632
+ function TemplateTextEditor(props) {
17633
+ const [target, setTarget] = createSignal("body");
17634
+ let subjectEl;
17635
+ let body;
17636
+ const fitsSubject = (p) => (p.kind ?? "text") === "text";
17637
+ const insertToken = (p) => {
17638
+ if (target() === "body") {
17639
+ body?.insertPlaceholder(p.token);
17640
+ return;
17641
+ }
17642
+ if (!fitsSubject(p)) return;
17643
+ const el = subjectEl;
16955
17644
  const start = el.selectionStart ?? el.value.length;
16956
17645
  const end = el.selectionEnd ?? start;
16957
- const next = el.value.slice(0, start) + token + el.value.slice(end);
16958
- if (f.field === "paragraph") setParagraph(f.index, next);
16959
- else set(f.field, next);
16960
- const caret = start + token.length;
17646
+ const next = (el.value.slice(0, start) + p.token + el.value.slice(end)).slice(0, TEMPLATE_LIMITS.subject);
17647
+ props.onChange({
17648
+ ...props.value,
17649
+ subject: next
17650
+ });
17651
+ const caret = Math.min(start + p.token.length, next.length);
16961
17652
  queueMicrotask(() => {
16962
17653
  el.focus();
16963
17654
  el.setSelectionRange(caret, caret);
16964
17655
  });
16965
17656
  };
17657
+ const bodyTooLong = () => props.value.body.length > TEMPLATE_LIMITS.body;
16966
17658
  return (() => {
16967
- var _el$ = _tmpl$448(), _el$8 = _el$.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$8.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.firstChild, _el$19 = _el$16.nextSibling, _el$17 = _el$19.nextSibling, _el$20 = _el$17.nextSibling; _el$20.nextSibling; var _el$21 = _el$15.nextSibling, _el$23 = _el$14.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$25.nextSibling, _el$27 = _el$26.firstChild;
17659
+ var _el$ = _tmpl$449(), _el$8 = _el$.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$8.nextSibling; _el$11.firstChild;
16968
17660
  insert(_el$, createComponent(Show, {
16969
17661
  get when() {
16970
17662
  return props.placeholders.length > 0;
16971
17663
  },
16972
17664
  get children() {
16973
- var _el$2 = _tmpl$295(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild; _el$4.nextSibling; var _el$6 = _el$3.nextSibling;
17665
+ var _el$2 = _tmpl$297(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild; _el$4.nextSibling; var _el$6 = _el$3.nextSibling;
16974
17666
  insert(_el$6, createComponent(For, {
16975
17667
  get each() {
16976
17668
  return props.placeholders;
16977
17669
  },
16978
- children: (p) => (() => {
16979
- var _el$28 = _tmpl$540();
16980
- _el$28.$$click = () => insertToken(p.token);
16981
- _el$28.$$mousedown = (e) => e.preventDefault();
16982
- insert(_el$28, () => p.token);
16983
- effect(() => setAttribute(_el$28, "title", p.description));
16984
- return _el$28;
16985
- })()
17670
+ children: (p) => {
17671
+ const blocked = () => target() === "subject" && !fitsSubject(p);
17672
+ return (() => {
17673
+ var _el$20 = _tmpl$541();
17674
+ _el$20.$$click = () => insertToken(p);
17675
+ _el$20.$$mousedown = (e) => e.preventDefault();
17676
+ insert(_el$20, () => p.token);
17677
+ effect((_p$) => {
17678
+ var _v$ = p.token, _v$2 = blocked() ? `${p.description} \u2014 a link, so it can only go in the body` : p.description, _v$3 = blocked();
17679
+ _v$ !== _p$.e && setAttribute(_el$20, "aria-label", _p$.e = _v$);
17680
+ _v$2 !== _p$.t && setAttribute(_el$20, "title", _p$.t = _v$2);
17681
+ _v$3 !== _p$.a && (_el$20.disabled = _p$.a = _v$3);
17682
+ return _p$;
17683
+ }, {
17684
+ e: void 0,
17685
+ t: void 0,
17686
+ a: void 0
17687
+ });
17688
+ return _el$20;
17689
+ })();
17690
+ }
16986
17691
  }));
16987
17692
  insert(_el$2, createComponent(Show, {
16988
17693
  get when() {
16989
17694
  return props.note;
16990
17695
  },
16991
17696
  get children() {
16992
- var _el$7 = _tmpl$291();
17697
+ var _el$7 = _tmpl$296();
16993
17698
  insert(_el$7, () => props.note);
16994
17699
  return _el$7;
16995
17700
  }
@@ -16997,92 +17702,58 @@ function TemplateTextEditor(props) {
16997
17702
  return _el$2;
16998
17703
  }
16999
17704
  }), _el$8);
17000
- _el$0.$$input = (e) => set("subject", e.currentTarget.value);
17001
- _el$0.addEventListener("focus", (e) => setLastFocused({
17002
- field: "subject",
17003
- el: e.currentTarget
17004
- }));
17705
+ _el$0.$$input = (e) => props.onChange({
17706
+ ...props.value,
17707
+ subject: e.currentTarget.value
17708
+ });
17709
+ _el$0.addEventListener("focus", () => setTarget("subject"));
17710
+ var _ref$ = subjectEl;
17711
+ typeof _ref$ === "function" ? use(_ref$, _el$0) : subjectEl = _el$0;
17005
17712
  insert(_el$1, () => props.value.subject.length, _el$10);
17006
17713
  insert(_el$1, () => TEMPLATE_LIMITS.subject, null);
17007
- _el$13.$$input = (e) => set("greeting", e.currentTarget.value);
17008
- _el$13.addEventListener("focus", (e) => setLastFocused({
17009
- field: "greeting",
17010
- el: e.currentTarget
17011
- }));
17012
- insert(_el$15, () => props.value.bodyParagraphs.length, _el$19);
17013
- insert(_el$15, () => TEMPLATE_LIMITS.paragraphs, _el$20);
17014
- insert(_el$21, createComponent(Index, {
17015
- get each() {
17016
- return props.value.bodyParagraphs;
17017
- },
17018
- children: (para, i) => (() => {
17019
- var _el$29 = _tmpl$734(), _el$30 = _el$29.firstChild;
17020
- _el$30.$$input = (e) => setParagraph(i, e.currentTarget.value);
17021
- _el$30.addEventListener("focus", (e) => setLastFocused({
17022
- field: "paragraph",
17023
- index: i,
17024
- el: e.currentTarget
17025
- }));
17026
- setAttribute(_el$30, "aria-label", `Paragraph ${i + 1}`);
17027
- insert(_el$29, createComponent(Show, {
17028
- get when() {
17029
- return props.value.bodyParagraphs.length > 1;
17030
- },
17031
- get children() {
17032
- var _el$31 = _tmpl$637();
17033
- _el$31.$$click = () => removeParagraph(i);
17034
- return _el$31;
17035
- }
17036
- }), null);
17037
- effect(() => _el$30.value = para());
17038
- return _el$29;
17039
- })()
17040
- }));
17041
- insert(_el$14, createComponent(Show, {
17714
+ insert(_el$11, createComponent(EmailBodyEditor, {
17715
+ get value() {
17716
+ return props.value.body;
17717
+ },
17718
+ get placeholders() {
17719
+ return props.placeholders;
17720
+ },
17721
+ onChange: (html) => props.onChange({
17722
+ ...props.value,
17723
+ body: html
17724
+ }),
17725
+ onFocus: () => setTarget("body"),
17726
+ ref: (h) => body = h
17727
+ }), null);
17728
+ insert(_el$11, createComponent(Show, {
17042
17729
  get when() {
17043
- return props.value.bodyParagraphs.length < TEMPLATE_LIMITS.paragraphs;
17730
+ return bodyTooLong();
17044
17731
  },
17045
17732
  get children() {
17046
- var _el$22 = _tmpl$358();
17047
- _el$22.$$click = addParagraph;
17048
- return _el$22;
17733
+ var _el$13 = _tmpl$359(), _el$14 = _el$13.firstChild, _el$18 = _el$14.nextSibling, _el$15 = _el$18.nextSibling, _el$19 = _el$15.nextSibling; _el$19.nextSibling;
17734
+ insert(_el$13, () => props.value.body.length.toLocaleString(), _el$18);
17735
+ insert(_el$13, () => TEMPLATE_LIMITS.body.toLocaleString(), _el$19);
17736
+ return _el$13;
17049
17737
  }
17050
17738
  }), null);
17051
- _el$25.$$input = (e) => set("closingText", e.currentTarget.value);
17052
- _el$25.addEventListener("focus", (e) => setLastFocused({
17053
- field: "closingText",
17054
- el: e.currentTarget
17055
- }));
17056
- insert(_el$26, () => props.value.closingText.length, _el$27);
17057
- insert(_el$26, () => TEMPLATE_LIMITS.closing, null);
17058
- effect((_p$) => {
17059
- var _v$ = TEMPLATE_LIMITS.subject, _v$2 = TEMPLATE_LIMITS.closing;
17060
- _v$ !== _p$.e && setAttribute(_el$0, "maxlength", _p$.e = _v$);
17061
- _v$2 !== _p$.t && setAttribute(_el$25, "maxlength", _p$.t = _v$2);
17062
- return _p$;
17063
- }, {
17064
- e: void 0,
17065
- t: void 0
17066
- });
17739
+ effect(() => setAttribute(_el$0, "maxlength", TEMPLATE_LIMITS.subject));
17067
17740
  effect(() => _el$0.value = props.value.subject);
17068
- effect(() => _el$13.value = props.value.greeting);
17069
- effect(() => _el$25.value = props.value.closingText);
17070
17741
  return _el$;
17071
17742
  })();
17072
17743
  }
17073
- delegateEvents(["input", "click", "mousedown"]);
17744
+ delegateEvents(["input", "mousedown", "click"]);
17074
17745
 
17075
17746
  // src/pages/admin/EmailTemplates.tsx
17076
- var _tmpl$296 = /* @__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">`);
17077
- var _tmpl$297 = /* @__PURE__ */ template(`<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>`);
17078
- var _tmpl$359 = /* @__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><div style=margin-bottom:0.25rem>`);
17079
- var _tmpl$449 = /* @__PURE__ */ template(`<div>`);
17080
- var _tmpl$541 = /* @__PURE__ */ template(`<div class=app-admin-empty>No email templates configured.`);
17747
+ var _tmpl$298 = /* @__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">`);
17748
+ var _tmpl$299 = /* @__PURE__ */ template(`<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>`);
17749
+ var _tmpl$360 = /* @__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><div style=margin-bottom:0.25rem>`);
17750
+ var _tmpl$450 = /* @__PURE__ */ template(`<div>`);
17751
+ var _tmpl$542 = /* @__PURE__ */ template(`<div class=app-admin-empty>No email templates configured.`);
17081
17752
  var _tmpl$638 = /* @__PURE__ */ template(`<div style=margin-bottom:0.25rem>`);
17082
17753
  var _tmpl$735 = /* @__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 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">`);
17083
- var _tmpl$829 = /* @__PURE__ */ template(`<p style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-top:0.25rem>Used by: `);
17084
- var _tmpl$926 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-danger">`);
17085
- var _tmpl$022 = /* @__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>Name</label><input type=text aria-label=Name maxlength=120 placeholder="Finish your visit"class=app-admin-input><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>How it appears when picking a template for a sequence step.</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">`);
17754
+ var _tmpl$830 = /* @__PURE__ */ template(`<p style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-top:0.25rem>Used by: `);
17755
+ var _tmpl$927 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-danger">`);
17756
+ var _tmpl$023 = /* @__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>Name</label><input type=text aria-label=Name maxlength=120 placeholder="Finish your visit"class=app-admin-input><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>How it appears when picking a template for a sequence step.</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">`);
17086
17757
  var CATEGORY_DEFS = [{
17087
17758
  label: "Subscription & Billing",
17088
17759
  keys: ["subscriptionConfirmation", "paymentFailed", "subscriptionSuspended", "subscriptionExpiring", "renewalReminder", "cardExpiring", "pastDueNudge"]
@@ -17111,22 +17782,19 @@ var isSameSelection = (a, b) => a.kind === b.kind && (a.kind === "fixed" ? a.key
17111
17782
  function humanize(key) {
17112
17783
  return key.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/^\w/, (c) => c.toUpperCase()).trim();
17113
17784
  }
17785
+ var BLANK_CUSTOM_BODY = "<p>Hi {{firstName}},</p><p>If you would rather not hear from us about this, {{unsubscribeLink}}.</p>";
17114
17786
  function blankCustom() {
17115
17787
  return {
17116
17788
  name: "",
17117
17789
  subject: "",
17118
- greeting: "Hi {{firstName}},",
17119
- bodyParagraphs: [""],
17120
- closingText: "If you would rather not hear from us about this, {{unsubscribeLink}}."
17790
+ body: BLANK_CUSTOM_BODY
17121
17791
  };
17122
17792
  }
17123
17793
  function toInput(t) {
17124
17794
  return {
17125
17795
  name: t.name,
17126
17796
  subject: t.subject,
17127
- greeting: t.greeting,
17128
- bodyParagraphs: [...t.bodyParagraphs],
17129
- closingText: t.closingText
17797
+ body: t.body
17130
17798
  };
17131
17799
  }
17132
17800
  function EmailTemplates(props = {}) {
@@ -17134,12 +17802,17 @@ function EmailTemplates(props = {}) {
17134
17802
  const [placeholders, setPlaceholders] = createSignal({});
17135
17803
  const [customTemplates, setCustomTemplates] = createSignal([]);
17136
17804
  const [customPlaceholders, setCustomPlaceholders] = createSignal([]);
17805
+ let adoptServerCopy = false;
17137
17806
  const [templates] = createResource(refreshKey, async () => {
17138
17807
  try {
17139
17808
  const res = await adminApi.getEmailTemplates();
17140
17809
  setPlaceholders(res.placeholders ?? {});
17141
17810
  setCustomTemplates(res.customTemplates ?? []);
17142
17811
  setCustomPlaceholders(res.customPlaceholders ?? []);
17812
+ if (adoptServerCopy) {
17813
+ adoptServerCopy = false;
17814
+ setDraft(structuredClone(res.templates));
17815
+ }
17143
17816
  return res.templates;
17144
17817
  } catch (err) {
17145
17818
  toastError(err instanceof Error ? err.message : "Failed to load email templates");
@@ -17283,7 +17956,7 @@ function EmailTemplates(props = {}) {
17283
17956
  try {
17284
17957
  await adminApi.saveEmailTemplates(d);
17285
17958
  toastSuccess("Templates saved");
17286
- setDraft(null);
17959
+ adoptServerCopy = true;
17287
17960
  setRefreshKey((k) => k + 1);
17288
17961
  } catch (err) {
17289
17962
  toastError(err instanceof Error ? err.message : "Failed to save templates");
@@ -17333,8 +18006,7 @@ function EmailTemplates(props = {}) {
17333
18006
  if (!cd) return null;
17334
18007
  return {
17335
18008
  ...cd,
17336
- name: cd.name.trim(),
17337
- bodyParagraphs: cd.bodyParagraphs.map((p) => p.trim()).filter(Boolean)
18009
+ name: cd.name.trim()
17338
18010
  };
17339
18011
  };
17340
18012
  const handleSaveCustom = async () => {
@@ -17406,7 +18078,7 @@ function EmailTemplates(props = {}) {
17406
18078
  }
17407
18079
  };
17408
18080
  const navButton = (opts) => (() => {
17409
- var _el$ = _tmpl$296();
18081
+ var _el$ = _tmpl$298();
17410
18082
  addEventListener(_el$, "click", opts.onClick, true);
17411
18083
  insert(_el$, () => opts.label);
17412
18084
  effect((_p$) => {
@@ -17421,14 +18093,14 @@ function EmailTemplates(props = {}) {
17421
18093
  return _el$;
17422
18094
  })();
17423
18095
  const groupHeader = (label3) => (() => {
17424
- var _el$2 = _tmpl$297(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
18096
+ var _el$2 = _tmpl$299(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
17425
18097
  _el$2.$$click = () => toggleCategory(label3);
17426
18098
  insert(_el$3, label3);
17427
18099
  insert(_el$4, () => collapsed()[label3] ? "\u25B8" : "\u25BE");
17428
18100
  return _el$2;
17429
18101
  })();
17430
18102
  return (() => {
17431
- var _el$5 = _tmpl$449();
18103
+ var _el$5 = _tmpl$450();
17432
18104
  insert(_el$5, createComponent(PageTitle, {
17433
18105
  subtitle: "Customize the transactional emails sent to your customers, and write the ones your sequences send.",
17434
18106
  children: "Email Templates"
@@ -17446,10 +18118,10 @@ function EmailTemplates(props = {}) {
17446
18118
  return templateKeys().length > 0;
17447
18119
  },
17448
18120
  get fallback() {
17449
- return _tmpl$541();
18121
+ return _tmpl$542();
17450
18122
  },
17451
18123
  get children() {
17452
- var _el$6 = _tmpl$359(), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild;
18124
+ var _el$6 = _tmpl$360(), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild;
17453
18125
  insert(_el$7, createComponent(For, {
17454
18126
  get each() {
17455
18127
  return categorizedKeys();
@@ -17546,7 +18218,7 @@ function EmailTemplates(props = {}) {
17546
18218
  return memo(() => !!isCustomSelected())() && customDraft();
17547
18219
  },
17548
18220
  children: (cd) => (() => {
17549
- var _el$15 = _tmpl$022(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling; _el$19.nextSibling; var _el$23 = _el$17.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling;
18221
+ var _el$15 = _tmpl$023(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling; _el$19.nextSibling; var _el$23 = _el$17.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling;
17550
18222
  _el$19.$$input = (e) => updateCustom({
17551
18223
  name: e.currentTarget.value
17552
18224
  });
@@ -17555,7 +18227,7 @@ function EmailTemplates(props = {}) {
17555
18227
  return (activeCustom()?.usedBy.length ?? 0) > 0;
17556
18228
  },
17557
18229
  get children() {
17558
- var _el$21 = _tmpl$829(); _el$21.firstChild;
18230
+ var _el$21 = _tmpl$830(); _el$21.firstChild;
17559
18231
  insert(_el$21, () => activeCustom().usedBy.map((u) => u.sequenceName).join(", "), null);
17560
18232
  return _el$21;
17561
18233
  }
@@ -17582,7 +18254,7 @@ function EmailTemplates(props = {}) {
17582
18254
  return activeCustomId();
17583
18255
  },
17584
18256
  get children() {
17585
- var _el$26 = _tmpl$926();
18257
+ var _el$26 = _tmpl$927();
17586
18258
  _el$26.$$click = () => void handleDeleteCustom();
17587
18259
  insert(_el$26, () => deleting() ? "Deleting\u2026" : "Delete");
17588
18260
  effect(() => _el$26.disabled = deleting());
@@ -17661,19 +18333,19 @@ function daysAgo(iso) {
17661
18333
  }
17662
18334
 
17663
18335
  // src/pages/admin/Sequences.tsx
17664
- var _tmpl$298 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style="font-size:0.75rem;margin:0;padding:0.625rem 1.25rem 0">Nothing here has been emailed, and nothing will be until you send it or turn automatic sending on.`);
17665
- var _tmpl$299 = /* @__PURE__ */ template(`<table class=app-admin-table><thead><tr><th>Person</th><th>Came from</th><th>Waiting</th><th>Step</th><th></th></tr></thead><tbody>`);
17666
- var _tmpl$360 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">Send all due`);
17667
- var _tmpl$450 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit>`);
17668
- var _tmpl$542 = /* @__PURE__ */ template(`<tr><td data-label=Person></td><td data-label="Came from"></td><td data-label=Waiting></td><td data-label=Step> of </td><td class=app-admin-table-cell--end><div style=display:flex;gap:0.375rem;justify-content:flex-end><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"title="Move past this step without emailing. They stay in the sequence for the next one.">Skip`);
18336
+ var _tmpl$300 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style="font-size:0.75rem;margin:0;padding:0.625rem 1.25rem 0">Nothing here has been emailed, and nothing will be until you send it or turn automatic sending on.`);
18337
+ var _tmpl$2100 = /* @__PURE__ */ template(`<table class=app-admin-table><thead><tr><th>Person</th><th>Came from</th><th>Waiting</th><th>Step</th><th></th></tr></thead><tbody>`);
18338
+ var _tmpl$361 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">Send all due`);
18339
+ var _tmpl$451 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit>`);
18340
+ var _tmpl$543 = /* @__PURE__ */ template(`<tr><td data-label=Person></td><td data-label="Came from"></td><td data-label=Waiting></td><td data-label=Step> of </td><td class=app-admin-table-cell--end><div style=display:flex;gap:0.375rem;justify-content:flex-end><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"title="Move past this step without emailing. They stay in the sequence for the next one.">Skip`);
17669
18341
  var _tmpl$639 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.75rem>No sequences yet \u2014 create one in the Sequences tab.`);
17670
18342
  var _tmpl$736 = /* @__PURE__ */ template(`<div style=display:flex;gap:0.5rem;align-items:center;flex-wrap:wrap><select class=app-admin-input aria-label=Sequence style=width:auto><option value>Add to sequence\u2026</option></select><button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">`);
17671
- var _tmpl$830 = /* @__PURE__ */ template(`<option>`);
17672
- var _tmpl$927 = /* @__PURE__ */ template(`<option>(deleted template)`);
17673
- var _tmpl$023 = /* @__PURE__ */ template(`<option> (unavailable)`);
17674
- var _tmpl$1104 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:2rem minmax(7rem, 9rem) minmax(12rem, 2fr) auto minmax(10rem, 1fr) auto;gap:0.5rem;align-items:center;padding:0.625rem 1.25rem"><span class=app-admin-text-muted style=font-size:0.8125rem;font-weight:600></span><label style=display:flex;gap:0.375rem;align-items:center;font-size:0.8125rem><span class=app-admin-text-muted></span><input class=app-admin-input type=number min=1 max=720 style=width:4.5rem><span class=app-admin-text-muted>h</span></label><select class=app-admin-input><option value>Choose a template\u2026</option></select><button type=button class=app-admin-link-btn style=font-size:0.8125rem;white-space:nowrap>Edit template</button><select class=app-admin-input></select><div style=display:flex;gap:0.25rem><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Test</button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm"title="Remove step">\xD7`);
17675
- var _tmpl$1017 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style="font-size:0.75rem;margin:0;padding:0.625rem 1.25rem 0">Each step waits the given hours after the previous one (the first, after enrollment), then sends its template with the chosen link.`);
17676
- var _tmpl$1118 = /* @__PURE__ */ template(`<table class=app-admin-table><thead><tr><th>Person</th><th>Came from</th><th>Step</th><th>Next due</th><th></th></tr></thead><tbody>`);
18343
+ var _tmpl$831 = /* @__PURE__ */ template(`<option>`);
18344
+ var _tmpl$928 = /* @__PURE__ */ template(`<option>(deleted template)`);
18345
+ var _tmpl$024 = /* @__PURE__ */ template(`<option> (unavailable)`);
18346
+ var _tmpl$1105 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:2rem minmax(7rem, 9rem) minmax(12rem, 2fr) auto minmax(10rem, 1fr) auto;gap:0.5rem;align-items:center;padding:0.625rem 1.25rem"><span class=app-admin-text-muted style=font-size:0.8125rem;font-weight:600></span><label style=display:flex;gap:0.375rem;align-items:center;font-size:0.8125rem><span class=app-admin-text-muted></span><input class=app-admin-input type=number min=1 max=720 style=width:4.5rem><span class=app-admin-text-muted>h</span></label><select class=app-admin-input><option value>Choose a template\u2026</option></select><button type=button class=app-admin-link-btn style=font-size:0.8125rem;white-space:nowrap>Edit template</button><select class=app-admin-input></select><div style=display:flex;gap:0.25rem><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Test</button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm"title="Remove step">\xD7`);
18347
+ var _tmpl$1018 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style="font-size:0.75rem;margin:0;padding:0.625rem 1.25rem 0">Each step waits the given hours after the previous one (the first, after enrollment), then sends its template with the chosen link.`);
18348
+ var _tmpl$1119 = /* @__PURE__ */ template(`<table class=app-admin-table><thead><tr><th>Person</th><th>Came from</th><th>Step</th><th>Next due</th><th></th></tr></thead><tbody>`);
17677
18349
  var _tmpl$1215 = /* @__PURE__ */ template(`<div style=display:grid;gap:0.75rem><label><span>Name</span><input class=app-admin-input maxlength=120 placeholder="Finish your visit"></label><label><span>Notes (internal)</span><input class=app-admin-input maxlength=500 placeholder="Who this is for and why">`);
17678
18350
  var _tmpl$1313 = /* @__PURE__ */ template(`<label><input type=checkbox aria-label="Send automatically when a step is due"><span>Send automatically when a step is due<span class=app-admin-text-muted style=display:block;font-size:0.75rem;margin-top:0.125rem>`);
17679
18351
  var _tmpl$1413 = /* @__PURE__ */ template(`<label><span>Only enroll people who entered in the last (days)</span><input class=app-admin-input type=number min=1 max=365><span class=app-admin-text-muted style=font-size:0.75rem>So a feed never mails months-old accounts. Add those by hand if you want them.`);
@@ -17785,7 +18457,7 @@ function SequenceQueue(props) {
17785
18457
  return rows().length > 0;
17786
18458
  },
17787
18459
  get children() {
17788
- var _el$5 = _tmpl$360();
18460
+ var _el$5 = _tmpl$361();
17789
18461
  _el$5.$$click = () => void sendAll();
17790
18462
  effect(() => _el$5.disabled = busy() === "all");
17791
18463
  return _el$5;
@@ -17798,7 +18470,7 @@ function SequenceQueue(props) {
17798
18470
  return !props.sequence.autoSend;
17799
18471
  },
17800
18472
  get children() {
17801
- return _tmpl$298();
18473
+ return _tmpl$300();
17802
18474
  }
17803
18475
  }), createComponent(Show, {
17804
18476
  get when() {
@@ -17820,13 +18492,13 @@ function SequenceQueue(props) {
17820
18492
  });
17821
18493
  },
17822
18494
  get children() {
17823
- var _el$2 = _tmpl$299(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
18495
+ var _el$2 = _tmpl$2100(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
17824
18496
  insert(_el$4, createComponent(For, {
17825
18497
  get each() {
17826
18498
  return rows();
17827
18499
  },
17828
18500
  children: (row) => (() => {
17829
- var _el$6 = _tmpl$542(), _el$7 = _el$6.firstChild, _el$9 = _el$7.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$1.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling;
18501
+ var _el$6 = _tmpl$543(), _el$7 = _el$6.firstChild, _el$9 = _el$7.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$1.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling;
17830
18502
  insert(_el$7, createComponent(Show, {
17831
18503
  get when() {
17832
18504
  return row.userId && nav;
@@ -17835,7 +18507,7 @@ function SequenceQueue(props) {
17835
18507
  return row.email;
17836
18508
  },
17837
18509
  get children() {
17838
- var _el$8 = _tmpl$450();
18510
+ var _el$8 = _tmpl$451();
17839
18511
  _el$8.$$click = () => nav.openCustomer(row.userId);
17840
18512
  insert(_el$8, () => row.email);
17841
18513
  return _el$8;
@@ -17910,7 +18582,7 @@ function AddToSequence(props) {
17910
18582
  return sequences()?.sequences ?? [];
17911
18583
  },
17912
18584
  children: (s) => (() => {
17913
- var _el$20 = _tmpl$830();
18585
+ var _el$20 = _tmpl$831();
17914
18586
  insert(_el$20, () => s.name);
17915
18587
  effect(() => _el$20.value = s.id);
17916
18588
  return _el$20;
@@ -17943,7 +18615,7 @@ function StepRow(props) {
17943
18615
  const missingTemplate = () => props.step.templateId && !props.templates.some((t) => t.id === props.step.templateId);
17944
18616
  const canEditTemplate = () => !!nav && !!props.step.templateId && !missingTemplate();
17945
18617
  return (() => {
17946
- var _el$21 = _tmpl$1104(), _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$23.nextSibling; _el$26.firstChild; var _el$29 = _el$26.nextSibling, _el$30 = _el$29.nextSibling, _el$33 = _el$30.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling;
18618
+ var _el$21 = _tmpl$1105(), _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$23.nextSibling; _el$26.firstChild; var _el$29 = _el$26.nextSibling, _el$30 = _el$29.nextSibling, _el$33 = _el$30.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling;
17947
18619
  insert(_el$22, () => props.index + 1);
17948
18620
  insert(_el$24, () => props.index === 0 ? "after" : "+");
17949
18621
  _el$25.$$input = (e) => set("waitHours", Number(e.currentTarget.value));
@@ -17953,7 +18625,7 @@ function StepRow(props) {
17953
18625
  return missingTemplate();
17954
18626
  },
17955
18627
  get children() {
17956
- var _el$28 = _tmpl$927();
18628
+ var _el$28 = _tmpl$928();
17957
18629
  effect(() => _el$28.value = props.step.templateId);
17958
18630
  return _el$28;
17959
18631
  }
@@ -17963,7 +18635,7 @@ function StepRow(props) {
17963
18635
  return props.templates;
17964
18636
  },
17965
18637
  children: (t) => (() => {
17966
- var _el$36 = _tmpl$830();
18638
+ var _el$36 = _tmpl$831();
17967
18639
  insert(_el$36, () => t.name);
17968
18640
  effect(() => _el$36.value = t.id);
17969
18641
  return _el$36;
@@ -17976,7 +18648,7 @@ function StepRow(props) {
17976
18648
  return memo(() => !!props.step.link)() && !props.links.includes(props.step.link);
17977
18649
  },
17978
18650
  get children() {
17979
- var _el$31 = _tmpl$023(), _el$32 = _el$31.firstChild;
18651
+ var _el$31 = _tmpl$024(), _el$32 = _el$31.firstChild;
17980
18652
  insert(_el$31, () => LINK_LABEL[props.step.link], _el$32);
17981
18653
  effect(() => _el$31.value = props.step.link);
17982
18654
  return _el$31;
@@ -17987,7 +18659,7 @@ function StepRow(props) {
17987
18659
  return props.links;
17988
18660
  },
17989
18661
  children: (l) => (() => {
17990
- var _el$37 = _tmpl$830();
18662
+ var _el$37 = _tmpl$831();
17991
18663
  _el$37.value = l;
17992
18664
  insert(_el$37, () => LINK_LABEL[l]);
17993
18665
  return _el$37;
@@ -18305,7 +18977,7 @@ function SequenceEditor(props) {
18305
18977
  })();
18306
18978
  },
18307
18979
  get children() {
18308
- return [_tmpl$1017(), createComponent(Index, {
18980
+ return [_tmpl$1018(), createComponent(Index, {
18309
18981
  get each() {
18310
18982
  return draft().steps;
18311
18983
  },
@@ -18368,7 +19040,7 @@ function SequenceEditor(props) {
18368
19040
  });
18369
19041
  },
18370
19042
  get children() {
18371
- var _el$41 = _tmpl$1118(), _el$42 = _el$41.firstChild, _el$43 = _el$42.nextSibling;
19043
+ var _el$41 = _tmpl$1119(), _el$42 = _el$41.firstChild, _el$43 = _el$42.nextSibling;
18372
19044
  insert(_el$43, createComponent(For, {
18373
19045
  get each() {
18374
19046
  return enrollments().enrollments;
@@ -18383,7 +19055,7 @@ function SequenceEditor(props) {
18383
19055
  return e.email;
18384
19056
  },
18385
19057
  get children() {
18386
- var _el$79 = _tmpl$450();
19058
+ var _el$79 = _tmpl$451();
18387
19059
  _el$79.$$click = () => nav.openCustomer(e.userId);
18388
19060
  insert(_el$79, () => e.email);
18389
19061
  return _el$79;
@@ -18655,19 +19327,19 @@ function Sequences() {
18655
19327
  delegateEvents(["click", "input"]);
18656
19328
 
18657
19329
  // src/pages/admin/Funnel.tsx
18658
- var _tmpl$300 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
18659
- var _tmpl$2100 = /* @__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>`);
18660
- var _tmpl$361 = /* @__PURE__ */ template(`<label style=font-size:0.8125rem;display:flex;gap:0.375rem;align-items:center;margin-top:0.25rem><input type=checkbox>Savings program only (<!>)`);
18661
- var _tmpl$451 = /* @__PURE__ */ template(`<th>Account`);
18662
- var _tmpl$543 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style="font-size:0.75rem;padding:0.625rem 1.25rem;margin:0">Showing the 50 most recent of <!>.`);
19330
+ var _tmpl$301 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
19331
+ var _tmpl$2101 = /* @__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>`);
19332
+ var _tmpl$365 = /* @__PURE__ */ template(`<label style=font-size:0.8125rem;display:flex;gap:0.375rem;align-items:center;margin-top:0.25rem><input type=checkbox>Savings program only (<!>)`);
19333
+ var _tmpl$453 = /* @__PURE__ */ template(`<th>Account`);
19334
+ var _tmpl$544 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style="font-size:0.75rem;padding:0.625rem 1.25rem;margin:0">Showing the 50 most recent of <!>.`);
18663
19335
  var _tmpl$640 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><div style="padding:1rem 1.25rem;display:grid;gap:0.5rem"></div><div style="padding:0.5rem 1.25rem 0.75rem;border-top:1px solid var(--app-admin-border-soft)"></div><table class=app-admin-table><thead><tr><th style=width:2rem><input type=checkbox aria-label="Select all"></th><th>Person</th><th>Where they stopped</th><th>Since</th></tr></thead><tbody>`);
18664
19336
  var _tmpl$737 = /* @__PURE__ */ template(`<span style=color:var(--app-admin-fg-subtle);margin-left:0.375rem> savings`);
18665
- var _tmpl$831 = /* @__PURE__ */ template(`<button type=button style="display:grid;grid-template-columns:12rem 1fr 7rem;align-items:center;gap:0.75rem;background:none;border:none;padding:0.125rem 0;cursor:pointer;text-align:left;color:inherit;font:inherit"><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)></span><span style=display:block;background:var(--app-admin-border-soft);border-radius:4px;height:1.125rem><span style=display:block;height:100%;background:var(--app-admin-primary);border-radius:4px></span></span><span style=font-size:0.8125rem;text-align:right>`);
18666
- var _tmpl$928 = /* @__PURE__ */ template(`<tr><td colspan=5>`);
18667
- var _tmpl$024 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit;font-weight:inherit>`);
18668
- var _tmpl$1105 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"style=margin-left:0.5rem>Opted out`);
18669
- var _tmpl$1018 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
18670
- var _tmpl$1119 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--info"style=margin-left:0.5rem>Savings`);
19337
+ var _tmpl$832 = /* @__PURE__ */ template(`<button type=button style="display:grid;grid-template-columns:12rem 1fr 7rem;align-items:center;gap:0.75rem;background:none;border:none;padding:0.125rem 0;cursor:pointer;text-align:left;color:inherit;font:inherit"><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)></span><span style=display:block;background:var(--app-admin-border-soft);border-radius:4px;height:1.125rem><span style=display:block;height:100%;background:var(--app-admin-primary);border-radius:4px></span></span><span style=font-size:0.8125rem;text-align:right>`);
19338
+ var _tmpl$929 = /* @__PURE__ */ template(`<tr><td colspan=5>`);
19339
+ var _tmpl$025 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit;font-weight:inherit>`);
19340
+ var _tmpl$1106 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"style=margin-left:0.5rem>Opted out`);
19341
+ var _tmpl$1019 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
19342
+ var _tmpl$1120 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--info"style=margin-left:0.5rem>Savings`);
18671
19343
  var _tmpl$1216 = /* @__PURE__ */ template(`<td data-label=Account><span class=app-admin-text-muted>`);
18672
19344
  var _tmpl$1314 = /* @__PURE__ */ template(`<tr><td><input type=checkbox></td><td data-label=Person><div></div></td><td data-label="Where they stopped"></td><td data-label=Since class=app-admin-text-muted>`);
18673
19345
  var _tmpl$1414 = /* @__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`);
@@ -18676,14 +19348,14 @@ var _tmpl$1614 = /* @__PURE__ */ template(`<span style=font-size:0.6875rem;color
18676
19348
  var _tmpl$1714 = /* @__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)>`);
18677
19349
  function CardHeader(props) {
18678
19350
  return (() => {
18679
- var _el$ = _tmpl$2100(), _el$2 = _el$.firstChild;
19351
+ var _el$ = _tmpl$2101(), _el$2 = _el$.firstChild;
18680
19352
  insert(_el$2, () => props.title);
18681
19353
  insert(_el$, createComponent(Show, {
18682
19354
  get when() {
18683
19355
  return props.note;
18684
19356
  },
18685
19357
  get children() {
18686
- var _el$3 = _tmpl$300();
19358
+ var _el$3 = _tmpl$301();
18687
19359
  insert(_el$3, () => props.note);
18688
19360
  return _el$3;
18689
19361
  }
@@ -18732,7 +19404,7 @@ function SegmentSection(props) {
18732
19404
  return props.summary.segments;
18733
19405
  },
18734
19406
  children: (seg) => (() => {
18735
- var _el$24 = _tmpl$831(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling, _el$27 = _el$26.firstChild, _el$28 = _el$26.nextSibling;
19407
+ var _el$24 = _tmpl$832(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling, _el$27 = _el$26.firstChild, _el$28 = _el$26.nextSibling;
18736
19408
  _el$24.$$click = () => setFilter(filter() === seg.key ? "all" : seg.key);
18737
19409
  insert(_el$25, () => SEGMENT_LABEL[seg.key]);
18738
19410
  insert(_el$28, () => seg.count, null);
@@ -18769,7 +19441,7 @@ function SegmentSection(props) {
18769
19441
  return hasSavings();
18770
19442
  },
18771
19443
  get children() {
18772
- var _el$6 = _tmpl$361(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$0 = _el$8.nextSibling; _el$0.nextSibling;
19444
+ var _el$6 = _tmpl$365(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$0 = _el$8.nextSibling; _el$0.nextSibling;
18773
19445
  _el$7.addEventListener("change", (e) => setSavingsOnly(e.currentTarget.checked));
18774
19446
  insert(_el$6, () => props.summary.savingsMembers, _el$0);
18775
19447
  effect(() => _el$7.checked = savingsOnly());
@@ -18795,7 +19467,7 @@ function SegmentSection(props) {
18795
19467
  return props.group === "b";
18796
19468
  },
18797
19469
  get children() {
18798
- return _tmpl$451();
19470
+ return _tmpl$453();
18799
19471
  }
18800
19472
  }), null);
18801
19473
  insert(_el$19, createComponent(Show, {
@@ -18804,7 +19476,7 @@ function SegmentSection(props) {
18804
19476
  },
18805
19477
  get fallback() {
18806
19478
  return (() => {
18807
- var _el$31 = _tmpl$928(), _el$32 = _el$31.firstChild;
19479
+ var _el$31 = _tmpl$929(), _el$32 = _el$31.firstChild;
18808
19480
  insert(_el$32, createComponent(LoadingSpinner, {}));
18809
19481
  return _el$31;
18810
19482
  })();
@@ -18815,7 +19487,7 @@ function SegmentSection(props) {
18815
19487
  },
18816
19488
  get fallback() {
18817
19489
  return (() => {
18818
- var _el$33 = _tmpl$928(), _el$34 = _el$33.firstChild;
19490
+ var _el$33 = _tmpl$929(), _el$34 = _el$33.firstChild;
18819
19491
  insert(_el$34, createComponent(EmptyState, {
18820
19492
  message: "Nobody here in this window"
18821
19493
  }));
@@ -18841,7 +19513,7 @@ function SegmentSection(props) {
18841
19513
  return p.name || p.email;
18842
19514
  },
18843
19515
  get children() {
18844
- var _el$40 = _tmpl$024();
19516
+ var _el$40 = _tmpl$025();
18845
19517
  _el$40.$$click = () => nav.openCustomer(p.userId);
18846
19518
  insert(_el$40, () => p.name || p.email);
18847
19519
  return _el$40;
@@ -18852,7 +19524,7 @@ function SegmentSection(props) {
18852
19524
  return p.optedOut;
18853
19525
  },
18854
19526
  get children() {
18855
- return _tmpl$1105();
19527
+ return _tmpl$1106();
18856
19528
  }
18857
19529
  }), null);
18858
19530
  insert(_el$38, createComponent(Show, {
@@ -18860,7 +19532,7 @@ function SegmentSection(props) {
18860
19532
  return p.name;
18861
19533
  },
18862
19534
  get children() {
18863
- var _el$42 = _tmpl$1018();
19535
+ var _el$42 = _tmpl$1019();
18864
19536
  insert(_el$42, () => p.email);
18865
19537
  return _el$42;
18866
19538
  }
@@ -18882,7 +19554,7 @@ function SegmentSection(props) {
18882
19554
  return p.savingsMember;
18883
19555
  },
18884
19556
  get children() {
18885
- return _tmpl$1119();
19557
+ return _tmpl$1120();
18886
19558
  }
18887
19559
  }), null);
18888
19560
  return _el$45;
@@ -18909,7 +19581,7 @@ function SegmentSection(props) {
18909
19581
  return people()?.hasMore;
18910
19582
  },
18911
19583
  get children() {
18912
- var _el$20 = _tmpl$543(), _el$21 = _el$20.firstChild, _el$23 = _el$21.nextSibling; _el$23.nextSibling;
19584
+ var _el$20 = _tmpl$544(), _el$21 = _el$20.firstChild, _el$23 = _el$21.nextSibling; _el$23.nextSibling;
18913
19585
  insert(_el$20, () => people().total, _el$23);
18914
19586
  return _el$20;
18915
19587
  }
@@ -19013,18 +19685,18 @@ function Funnel() {
19013
19685
  })();
19014
19686
  }
19015
19687
  delegateEvents(["click"]);
19016
- var _tmpl$301 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;margin:0.25rem 0 0">`);
19017
- var _tmpl$2101 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style="padding:1rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft);display:flex;justify-content:space-between;align-items:center;gap:1rem"><div><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0></h2></div></div><div style="padding:1rem 1.25rem;display:grid;gap:0.875rem">`);
19018
- var _tmpl$365 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox>`);
19019
- var _tmpl$453 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">`);
19020
- var _tmpl$544 = /* @__PURE__ */ template(`<div><div style=margin-bottom:0.375rem>Recipients</div><div style=display:flex;flex-wrap:wrap;gap:0.375rem;margin-bottom:0.5rem></div><div style=display:flex;gap:0.5rem;max-width:28rem><input type=email class=app-admin-input placeholder=admin@example.com aria-label="Add recipient"><button type=button class="app-admin-btn app-admin-btn-sm">Add`);
19688
+ var _tmpl$306 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;margin:0.25rem 0 0">`);
19689
+ var _tmpl$2102 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style="padding:1rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft);display:flex;justify-content:space-between;align-items:center;gap:1rem"><div><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0></h2></div></div><div style="padding:1rem 1.25rem;display:grid;gap:0.875rem">`);
19690
+ var _tmpl$366 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox>`);
19691
+ var _tmpl$454 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">`);
19692
+ var _tmpl$545 = /* @__PURE__ */ template(`<div><div style=margin-bottom:0.375rem>Recipients</div><div style=display:flex;flex-wrap:wrap;gap:0.375rem;margin-bottom:0.5rem></div><div style=display:flex;gap:0.5rem;max-width:28rem><input type=email class=app-admin-input placeholder=admin@example.com aria-label="Add recipient"><button type=button class="app-admin-btn app-admin-btn-sm">Add`);
19021
19693
  var _tmpl$641 = /* @__PURE__ */ template(`<div><div style=margin-bottom:0.375rem>Send a copy for</div><div style="display:grid;grid-template-columns:repeat(auto-fill, minmax(14rem, 1fr));gap:0.375rem 1rem">`);
19022
19694
  var _tmpl$738 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.8125rem>Nobody \u2014 admin copies go nowhere until someone is added.`);
19023
- var _tmpl$832 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"style=text-transform:none;display:inline-flex;gap:0.375rem;align-items:center><button type=button style=background:none;border:none;cursor:pointer;color:inherit;padding:0;font-size:1rem;line-height:1>&times;`);
19024
- var _tmpl$929 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(15rem, 1fr));gap:1rem"><div class=app-admin-card-soft style=padding:0.875rem;display:grid;gap:0.5rem><div>Days before renewal</div><div style=display:flex;flex-wrap:wrap;gap:0.375rem></div><div style=display:flex;gap:0.5rem><input type=number class=app-admin-input min=1 max=90 placeholder="e.g. 7"aria-label="Add days before"style=width:6rem><button type=button class="app-admin-btn app-admin-btn-sm">Add</button></div></div><div class=app-admin-card-soft style=padding:0.875rem;display:grid;gap:0.5rem><label style=display:grid;gap:0.25rem><span>Days before expiry</span><input type=number class=app-admin-input min=7 max=90></label></div><div class=app-admin-card-soft style=padding:0.875rem;display:grid;gap:0.5rem><label style=display:grid;gap:0.25rem><span>Every (days)</span><input type=number class=app-admin-input min=1 max=30></label><label style=display:grid;gap:0.25rem><span>At most (nudges)</span><input type=number class=app-admin-input min=1 max=20>`);
19025
- var _tmpl$025 = /* @__PURE__ */ template(`<button type=button style=background:none;border:none;cursor:pointer;color:inherit;padding:0>&times;`);
19026
- var _tmpl$1106 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"style=text-transform:none;display:inline-flex;gap:0.375rem>d`);
19027
- var _tmpl$1019 = /* @__PURE__ */ template(`<div>`);
19695
+ var _tmpl$833 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"style=text-transform:none;display:inline-flex;gap:0.375rem;align-items:center><button type=button style=background:none;border:none;cursor:pointer;color:inherit;padding:0;font-size:1rem;line-height:1>&times;`);
19696
+ var _tmpl$930 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(15rem, 1fr));gap:1rem"><div class=app-admin-card-soft style=padding:0.875rem;display:grid;gap:0.5rem><div>Days before renewal</div><div style=display:flex;flex-wrap:wrap;gap:0.375rem></div><div style=display:flex;gap:0.5rem><input type=number class=app-admin-input min=1 max=90 placeholder="e.g. 7"aria-label="Add days before"style=width:6rem><button type=button class="app-admin-btn app-admin-btn-sm">Add</button></div></div><div class=app-admin-card-soft style=padding:0.875rem;display:grid;gap:0.5rem><label style=display:grid;gap:0.25rem><span>Days before expiry</span><input type=number class=app-admin-input min=7 max=90></label></div><div class=app-admin-card-soft style=padding:0.875rem;display:grid;gap:0.5rem><label style=display:grid;gap:0.25rem><span>Every (days)</span><input type=number class=app-admin-input min=1 max=30></label><label style=display:grid;gap:0.25rem><span>At most (nudges)</span><input type=number class=app-admin-input min=1 max=20>`);
19697
+ var _tmpl$026 = /* @__PURE__ */ template(`<button type=button style=background:none;border:none;cursor:pointer;color:inherit;padding:0>&times;`);
19698
+ var _tmpl$1107 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"style=text-transform:none;display:inline-flex;gap:0.375rem>d`);
19699
+ var _tmpl$1020 = /* @__PURE__ */ template(`<div>`);
19028
19700
  function humanize2(key) {
19029
19701
  return key.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/^\w/, (c) => c.toUpperCase()).trim();
19030
19702
  }
@@ -19034,14 +19706,14 @@ var label2 = {
19034
19706
  };
19035
19707
  function Card(props) {
19036
19708
  return (() => {
19037
- var _el$ = _tmpl$2101(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$6 = _el$2.nextSibling;
19709
+ var _el$ = _tmpl$2102(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$6 = _el$2.nextSibling;
19038
19710
  insert(_el$4, () => props.title);
19039
19711
  insert(_el$3, createComponent(Show, {
19040
19712
  get when() {
19041
19713
  return props.note;
19042
19714
  },
19043
19715
  get children() {
19044
- var _el$5 = _tmpl$301();
19716
+ var _el$5 = _tmpl$306();
19045
19717
  insert(_el$5, () => props.note);
19046
19718
  effect((_$p) => style(_el$5, {
19047
19719
  ...label2
@@ -19056,7 +19728,7 @@ function Card(props) {
19056
19728
  }
19057
19729
  function Toggle(props) {
19058
19730
  return (() => {
19059
- var _el$7 = _tmpl$365(), _el$8 = _el$7.firstChild;
19731
+ var _el$7 = _tmpl$366(), _el$8 = _el$7.firstChild;
19060
19732
  _el$8.addEventListener("change", (e) => props.onChange(e.currentTarget.checked));
19061
19733
  insert(_el$7, () => props.label, null);
19062
19734
  effect(() => _el$8.checked = props.checked);
@@ -19105,7 +19777,7 @@ function NotificationsCard() {
19105
19777
  note: "Who receives a copy when one of these emails goes to a customer. Clinical emails (new messages, prescription updates) are never copied.",
19106
19778
  get aside() {
19107
19779
  return (() => {
19108
- var _el$9 = _tmpl$453();
19780
+ var _el$9 = _tmpl$454();
19109
19781
  _el$9.$$click = () => void save();
19110
19782
  insert(_el$9, () => saving() ? "Saving\u2026" : "Save");
19111
19783
  effect(() => _el$9.disabled = !dirty() || saving());
@@ -19121,7 +19793,7 @@ function NotificationsCard() {
19121
19793
  return createComponent(LoadingSpinner, {});
19122
19794
  },
19123
19795
  children: (s) => [(() => {
19124
- var _el$0 = _tmpl$544(), _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling, _el$11 = _el$10.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
19796
+ var _el$0 = _tmpl$545(), _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling, _el$11 = _el$10.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
19125
19797
  insert(_el$10, createComponent(For, {
19126
19798
  get each() {
19127
19799
  return s().recipientEmails;
@@ -19130,7 +19802,7 @@ function NotificationsCard() {
19130
19802
  return _tmpl$738();
19131
19803
  },
19132
19804
  children: (email) => (() => {
19133
- var _el$18 = _tmpl$832(), _el$19 = _el$18.firstChild;
19805
+ var _el$18 = _tmpl$833(), _el$19 = _el$18.firstChild;
19134
19806
  insert(_el$18, email, _el$19);
19135
19807
  _el$19.$$click = () => update({
19136
19808
  recipientEmails: s().recipientEmails.filter((e) => e !== email)
@@ -19226,7 +19898,7 @@ function BillingRemindersCard() {
19226
19898
  note: "Automated emails about upcoming renewals, expiring cards and past-due subscriptions. Each one's copy is under Templates.",
19227
19899
  get aside() {
19228
19900
  return (() => {
19229
- var _el$20 = _tmpl$453();
19901
+ var _el$20 = _tmpl$454();
19230
19902
  _el$20.$$click = () => void save();
19231
19903
  insert(_el$20, () => saving() ? "Saving\u2026" : "Save");
19232
19904
  effect(() => _el$20.disabled = !dirty() || saving());
@@ -19242,7 +19914,7 @@ function BillingRemindersCard() {
19242
19914
  return createComponent(LoadingSpinner, {});
19243
19915
  },
19244
19916
  children: (s) => (() => {
19245
- var _el$21 = _tmpl$929(), _el$22 = _el$21.firstChild, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$25 = _el$24.nextSibling, _el$26 = _el$25.firstChild, _el$27 = _el$26.nextSibling, _el$28 = _el$22.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$28.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling, _el$36 = _el$33.nextSibling, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling;
19917
+ var _el$21 = _tmpl$930(), _el$22 = _el$21.firstChild, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$25 = _el$24.nextSibling, _el$26 = _el$25.firstChild, _el$27 = _el$26.nextSibling, _el$28 = _el$22.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$28.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling, _el$36 = _el$33.nextSibling, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling;
19246
19918
  insert(_el$22, createComponent(Toggle, {
19247
19919
  label: "Renewal reminder",
19248
19920
  get checked() {
@@ -19260,14 +19932,14 @@ function BillingRemindersCard() {
19260
19932
  return s().renewalReminder.daysBefore;
19261
19933
  },
19262
19934
  children: (d) => (() => {
19263
- var _el$39 = _tmpl$1106(), _el$40 = _el$39.firstChild;
19935
+ var _el$39 = _tmpl$1107(), _el$40 = _el$39.firstChild;
19264
19936
  insert(_el$39, d, _el$40);
19265
19937
  insert(_el$39, createComponent(Show, {
19266
19938
  get when() {
19267
19939
  return s().renewalReminder.daysBefore.length > 1;
19268
19940
  },
19269
19941
  get children() {
19270
- var _el$41 = _tmpl$025();
19942
+ var _el$41 = _tmpl$026();
19271
19943
  _el$41.$$click = () => update({
19272
19944
  renewalReminder: {
19273
19945
  ...s().renewalReminder,
@@ -19351,7 +20023,7 @@ function BillingRemindersCard() {
19351
20023
  }
19352
20024
  function EmailNotifications() {
19353
20025
  return (() => {
19354
- var _el$42 = _tmpl$1019();
20026
+ var _el$42 = _tmpl$1020();
19355
20027
  insert(_el$42, createComponent(PageTitle, {
19356
20028
  subtitle: "Who gets admin copies, and when the automated billing reminders go out",
19357
20029
  children: "Notifications"
@@ -19362,14 +20034,330 @@ function EmailNotifications() {
19362
20034
  })();
19363
20035
  }
19364
20036
  delegateEvents(["click", "input", "keydown"]);
20037
+ var _tmpl$307 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><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></h2><p style="font-size:0.75rem;margin:0.25rem 0 0"></p></div><div>`);
20038
+ var _tmpl$2103 = /* @__PURE__ */ template(`<div style=font-size:0.75rem;margin-top:0.25rem>`);
20039
+ var _tmpl$367 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0.875rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft)"><div style=min-width:0><div style=font-size:0.875rem;font-weight:600></div><div style=margin-top:0.125rem></div></div><div style=flex-shrink:0>`);
20040
+ var _tmpl$455 = /* @__PURE__ */ template(`<div class=app-admin-notice role=alert style=margin-top:1.25rem>Features could not be loaded. `);
20041
+ var _tmpl$546 = /* @__PURE__ */ template(`<div>`);
20042
+ var _tmpl$642 = /* @__PURE__ */ template(`<button type=button role=switch class=app-admin-toggle><span class=app-admin-toggle__knob>`);
20043
+ var _tmpl$739 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--success">On`);
20044
+ var _tmpl$834 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-sm">Request`);
20045
+ var _tmpl$931 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--info"style=text-transform:none>Requested `);
20046
+ var _tmpl$027 = /* @__PURE__ */ template(`<p style="margin:0 0 0.875rem">`);
20047
+ var _tmpl$1108 = /* @__PURE__ */ template(`<label style=display:grid;gap:0.25rem><span>Anything we should know? (optional)</span><textarea class=app-admin-input rows=4 maxlength=1000>`);
20048
+ var _tmpl$1021 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;margin:0.75rem 0 0">We'll email our team and reply to you. Nothing changes on your site until we turn it on.`);
20049
+ var _tmpl$1121 = /* @__PURE__ */ template(`<div class=app-admin-btn-row><button type=button class=app-admin-btn>Cancel</button><button type=button class="app-admin-btn app-admin-btn-primary">`);
20050
+ var muted = {
20051
+ "font-size": "0.8125rem",
20052
+ color: "var(--app-admin-fg-muted)"
20053
+ };
20054
+ function formatDate2(iso) {
20055
+ const d = new Date(iso);
20056
+ return Number.isNaN(d.getTime()) ? "" : d.toLocaleDateString("en-US", {
20057
+ month: "short",
20058
+ day: "numeric",
20059
+ year: "numeric"
20060
+ });
20061
+ }
20062
+ function Card2(props) {
20063
+ return (() => {
20064
+ var _el$ = _tmpl$307(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling;
20065
+ insert(_el$3, () => props.title);
20066
+ insert(_el$4, () => props.note);
20067
+ insert(_el$5, () => props.children);
20068
+ effect((_$p) => style(_el$4, {
20069
+ ...muted
20070
+ }, _$p));
20071
+ return _el$;
20072
+ })();
20073
+ }
20074
+ function Row(props) {
20075
+ return (() => {
20076
+ var _el$6 = _tmpl$367(), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$1 = _el$7.nextSibling;
20077
+ insert(_el$8, () => props.feature.label);
20078
+ insert(_el$9, () => props.feature.description);
20079
+ insert(_el$7, createComponent(Show, {
20080
+ get when() {
20081
+ return props.note;
20082
+ },
20083
+ get children() {
20084
+ var _el$0 = _tmpl$2103();
20085
+ insert(_el$0, () => props.note);
20086
+ effect((_$p) => style(_el$0, {
20087
+ ...muted
20088
+ }, _$p));
20089
+ return _el$0;
20090
+ }
20091
+ }), null);
20092
+ insert(_el$1, () => props.children);
20093
+ effect((_p$) => {
20094
+ var _v$ = props.feature.key, _v$2 = {
20095
+ ...muted
20096
+ };
20097
+ _v$ !== _p$.e && setAttribute(_el$6, "data-feature", _p$.e = _v$);
20098
+ _p$.t = style(_el$9, _v$2, _p$.t);
20099
+ return _p$;
20100
+ }, {
20101
+ e: void 0,
20102
+ t: void 0
20103
+ });
20104
+ return _el$6;
20105
+ })();
20106
+ }
20107
+ function Features() {
20108
+ const [data, {
20109
+ mutate
20110
+ }] = createResource(() => adminApi.getFeatures());
20111
+ const [busyKey, setBusyKey] = createSignal(null);
20112
+ const [requesting, setRequesting] = createSignal(null);
20113
+ const [note, setNote] = createSignal("");
20114
+ const [sending, setSending] = createSignal(false);
20115
+ const features = () => data.error ? [] : data()?.features ?? [];
20116
+ const selfServe = () => features().filter((f) => f.access === "self_serve");
20117
+ const onRequest = () => features().filter((f) => f.access === "request");
20118
+ const blockedBy = (f) => !f.enabled && f.requires && !f.requires.enabled ? f.requires : null;
20119
+ const toggle = async (f) => {
20120
+ if (busyKey() || blockedBy(f)) return;
20121
+ const turnOn = !f.enabled;
20122
+ setBusyKey(f.key);
20123
+ try {
20124
+ const before = features();
20125
+ const res = await adminApi.setFeature(f.key, turnOn);
20126
+ mutate(res);
20127
+ const alsoOff = res.features.filter((n) => n.key !== f.key && !n.enabled && before.find((b) => b.key === n.key)?.enabled);
20128
+ const state = `${f.label} is ${turnOn ? "on" : "off"}`;
20129
+ toastSuccess(alsoOff.length > 0 ? `${state}. Also turned off: ${alsoOff.map((n) => n.label).join(", ")}` : state);
20130
+ } catch (e) {
20131
+ toastError(e.message);
20132
+ } finally {
20133
+ setBusyKey(null);
20134
+ }
20135
+ };
20136
+ const openRequest = (f) => {
20137
+ setNote("");
20138
+ setRequesting(f);
20139
+ };
20140
+ const sendRequest = async () => {
20141
+ const f = requesting();
20142
+ if (!f || sending()) return;
20143
+ setSending(true);
20144
+ try {
20145
+ const res = await adminApi.requestFeature(f.key, note().trim() || void 0);
20146
+ const current2 = data();
20147
+ if (current2) {
20148
+ mutate({
20149
+ features: current2.features.map((x) => x.key === f.key ? res.feature : x)
20150
+ });
20151
+ }
20152
+ setRequesting(null);
20153
+ if (res.alreadyRequested) {
20154
+ toastSuccess(`${f.label} was already requested`);
20155
+ } else if (res.emailed) {
20156
+ toastSuccess(`Request sent for ${f.label}`);
20157
+ } else {
20158
+ toastSuccess(`Request saved for ${f.label}. The email could not be sent, so let your Apex contact know.`);
20159
+ }
20160
+ } catch (e) {
20161
+ toastError(e.message);
20162
+ } finally {
20163
+ setSending(false);
20164
+ }
20165
+ };
20166
+ return (() => {
20167
+ var _el$10 = _tmpl$546();
20168
+ insert(_el$10, createComponent(PageTitle, {
20169
+ subtitle: "What this site has switched on, and what you can ask for",
20170
+ children: "Features"
20171
+ }), null);
20172
+ insert(_el$10, createComponent(Show, {
20173
+ get when() {
20174
+ return data.error;
20175
+ },
20176
+ get children() {
20177
+ var _el$11 = _tmpl$455(); _el$11.firstChild;
20178
+ insert(_el$11, () => data.error?.message, null);
20179
+ return _el$11;
20180
+ }
20181
+ }), null);
20182
+ insert(_el$10, createComponent(Show, {
20183
+ get when() {
20184
+ return memo(() => !!!data.error)() && data.loading;
20185
+ },
20186
+ get children() {
20187
+ return createComponent(LoadingSpinner, {});
20188
+ }
20189
+ }), null);
20190
+ insert(_el$10, createComponent(Show, {
20191
+ get when() {
20192
+ return memo(() => !!!data.error)() && data();
20193
+ },
20194
+ get children() {
20195
+ return [createComponent(Show, {
20196
+ get when() {
20197
+ return selfServe().length > 0;
20198
+ },
20199
+ get children() {
20200
+ return createComponent(Card2, {
20201
+ title: "Switch on yourself",
20202
+ note: "These take effect on your site right away.",
20203
+ get children() {
20204
+ return createComponent(For, {
20205
+ get each() {
20206
+ return selfServe();
20207
+ },
20208
+ children: (f) => createComponent(Row, {
20209
+ feature: f,
20210
+ get note() {
20211
+ return memo(() => !!blockedBy(f))() ? `Turn on "${blockedBy(f).label}" first.` : void 0;
20212
+ },
20213
+ get children() {
20214
+ var _el$13 = _tmpl$642();
20215
+ _el$13.$$click = () => void toggle(f);
20216
+ effect((_p$) => {
20217
+ var _v$3 = f.enabled, _v$4 = f.label, _v$5 = !!f.enabled, _v$6 = !!(busyKey() === f.key), _v$7 = !!busyKey() || !!blockedBy(f), _v$8 = blockedBy(f) ? {
20218
+ opacity: 0.4,
20219
+ cursor: "not-allowed"
20220
+ } : void 0;
20221
+ _v$3 !== _p$.e && setAttribute(_el$13, "aria-checked", _p$.e = _v$3);
20222
+ _v$4 !== _p$.t && setAttribute(_el$13, "aria-label", _p$.t = _v$4);
20223
+ _v$5 !== _p$.a && _el$13.classList.toggle("is-on", _p$.a = _v$5);
20224
+ _v$6 !== _p$.o && _el$13.classList.toggle("is-loading", _p$.o = _v$6);
20225
+ _v$7 !== _p$.i && (_el$13.disabled = _p$.i = _v$7);
20226
+ _p$.n = style(_el$13, _v$8, _p$.n);
20227
+ return _p$;
20228
+ }, {
20229
+ e: void 0,
20230
+ t: void 0,
20231
+ a: void 0,
20232
+ o: void 0,
20233
+ i: void 0,
20234
+ n: void 0
20235
+ });
20236
+ return _el$13;
20237
+ }
20238
+ })
20239
+ });
20240
+ }
20241
+ });
20242
+ }
20243
+ }), createComponent(Show, {
20244
+ get when() {
20245
+ return onRequest().length > 0;
20246
+ },
20247
+ get children() {
20248
+ return createComponent(Card2, {
20249
+ title: "Available on request",
20250
+ note: "These change billing or need setup on our side, so we turn them on for you.",
20251
+ get children() {
20252
+ return createComponent(For, {
20253
+ get each() {
20254
+ return onRequest();
20255
+ },
20256
+ children: (f) => createComponent(Row, {
20257
+ feature: f,
20258
+ get children() {
20259
+ return createComponent(Show, {
20260
+ get when() {
20261
+ return !f.enabled;
20262
+ },
20263
+ get fallback() {
20264
+ return _tmpl$739();
20265
+ },
20266
+ get children() {
20267
+ return createComponent(Show, {
20268
+ get when() {
20269
+ return f.request;
20270
+ },
20271
+ get fallback() {
20272
+ return (() => {
20273
+ var _el$15 = _tmpl$834();
20274
+ _el$15.$$click = () => openRequest(f);
20275
+ effect(() => setAttribute(_el$15, "aria-label", `Request ${f.label}`));
20276
+ return _el$15;
20277
+ })();
20278
+ },
20279
+ children: (r) => (() => {
20280
+ var _el$16 = _tmpl$931(); _el$16.firstChild;
20281
+ insert(_el$16, () => formatDate2(r().requestedAt), null);
20282
+ effect(() => setAttribute(_el$16, "title", `Requested by ${r().requestedBy}`));
20283
+ return _el$16;
20284
+ })()
20285
+ });
20286
+ }
20287
+ });
20288
+ }
20289
+ })
20290
+ });
20291
+ }
20292
+ });
20293
+ }
20294
+ })];
20295
+ }
20296
+ }), null);
20297
+ insert(_el$10, createComponent(Show, {
20298
+ get when() {
20299
+ return requesting();
20300
+ },
20301
+ children: (f) => createComponent(Modal, {
20302
+ get title() {
20303
+ return `Request ${f().label}`;
20304
+ },
20305
+ width: "32rem",
20306
+ onClose: () => !sending() && setRequesting(null),
20307
+ get footer() {
20308
+ return (() => {
20309
+ var _el$23 = _tmpl$1121(), _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling;
20310
+ _el$24.$$click = () => setRequesting(null);
20311
+ _el$25.$$click = () => void sendRequest();
20312
+ insert(_el$25, () => sending() ? "Sending\u2026" : "Send request");
20313
+ effect((_p$) => {
20314
+ var _v$9 = sending(), _v$0 = sending();
20315
+ _v$9 !== _p$.e && (_el$24.disabled = _p$.e = _v$9);
20316
+ _v$0 !== _p$.t && (_el$25.disabled = _p$.t = _v$0);
20317
+ return _p$;
20318
+ }, {
20319
+ e: void 0,
20320
+ t: void 0
20321
+ });
20322
+ return _el$23;
20323
+ })();
20324
+ },
20325
+ get children() {
20326
+ return [(() => {
20327
+ var _el$18 = _tmpl$027();
20328
+ insert(_el$18, () => f().description);
20329
+ effect((_$p) => style(_el$18, {
20330
+ ...muted
20331
+ }, _$p));
20332
+ return _el$18;
20333
+ })(), (() => {
20334
+ var _el$19 = _tmpl$1108(), _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling;
20335
+ _el$21.$$input = (e) => setNote(e.currentTarget.value);
20336
+ effect((_$p) => style(_el$20, muted, _$p));
20337
+ effect(() => _el$21.value = note());
20338
+ return _el$19;
20339
+ })(), (() => {
20340
+ var _el$22 = _tmpl$1021();
20341
+ effect((_$p) => style(_el$22, {
20342
+ ...muted
20343
+ }, _$p));
20344
+ return _el$22;
20345
+ })()];
20346
+ }
20347
+ })
20348
+ }), null);
20349
+ return _el$10;
20350
+ })();
20351
+ }
20352
+ delegateEvents(["click", "input"]);
19365
20353
 
19366
20354
  // src/pages/AdminDashboard.tsx
19367
- var _tmpl$306 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
19368
- var _tmpl$2102 = /* @__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">`);
19369
- var _tmpl$366 = /* @__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>`);
19370
- var _tmpl$454 = /* @__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">`);
19371
- var _tmpl$545 = /* @__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`);
19372
- var _tmpl$642 = /* @__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); } }`);
20355
+ var _tmpl$308 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
20356
+ var _tmpl$2104 = /* @__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">`);
20357
+ var _tmpl$368 = /* @__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>`);
20358
+ var _tmpl$456 = /* @__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">`);
20359
+ var _tmpl$547 = /* @__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`);
20360
+ var _tmpl$643 = /* @__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); } }`);
19373
20361
  var TAB_LABELS = {
19374
20362
  dashboard: "Dashboard",
19375
20363
  customers: "Customers",
@@ -19385,7 +20373,8 @@ var TAB_LABELS = {
19385
20373
  "email-templates": "Templates",
19386
20374
  "email-notifications": "Notifications",
19387
20375
  funnel: "Funnel",
19388
- sequences: "Sequences"
20376
+ sequences: "Sequences",
20377
+ features: "Features"
19389
20378
  };
19390
20379
  var DEFAULT_TOP_TABS = ["dashboard"];
19391
20380
  var DEFAULT_TAB_GROUPS = [
@@ -19411,6 +20400,11 @@ var DEFAULT_TAB_GROUPS = [
19411
20400
  {
19412
20401
  label: "Integrations",
19413
20402
  tabs: ["webhooks"]
20403
+ },
20404
+ // What this site has switched on, and what it can ask for.
20405
+ {
20406
+ label: "Settings",
20407
+ tabs: ["features"]
19414
20408
  }
19415
20409
  ];
19416
20410
  var filterEnabled = (tabs, enabled) => enabled ? tabs.filter((t) => enabled.includes(t)) : tabs;
@@ -19486,14 +20480,14 @@ function AdminDashboard(props) {
19486
20480
  };
19487
20481
  const topOffset = () => props.topOffset ?? "0px";
19488
20482
  const TabButton = (btnProps) => (() => {
19489
- var _el$ = _tmpl$2102();
20483
+ var _el$ = _tmpl$2104();
19490
20484
  _el$.$$click = () => handleTabClick(btnProps.tab);
19491
20485
  insert(_el$, createComponent(Show, {
19492
20486
  get when() {
19493
20487
  return props.tabIcons?.[btnProps.tab];
19494
20488
  },
19495
20489
  get children() {
19496
- var _el$2 = _tmpl$306();
20490
+ var _el$2 = _tmpl$308();
19497
20491
  effect(() => className(_el$2, props.tabIcons[btnProps.tab]));
19498
20492
  return _el$2;
19499
20493
  }
@@ -19525,7 +20519,7 @@ function AdminDashboard(props) {
19525
20519
  return createComponent(AdminNavContext.Provider, {
19526
20520
  value: adminNav,
19527
20521
  get children() {
19528
- var _el$3 = _tmpl$366(), _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;
20522
+ var _el$3 = _tmpl$368(), _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;
19529
20523
  _el$5.$$click = () => setDrawerOpen(true);
19530
20524
  insert(_el$6, () => TAB_LABELS[currentTab()]);
19531
20525
  _el$7.$$click = () => setDrawerOpen(false);
@@ -19542,7 +20536,7 @@ function AdminDashboard(props) {
19542
20536
  return visibleGroups();
19543
20537
  },
19544
20538
  children: (group) => [(() => {
19545
- var _el$11 = _tmpl$454();
20539
+ var _el$11 = _tmpl$456();
19546
20540
  insert(_el$11, () => group.label);
19547
20541
  return _el$11;
19548
20542
  })(), createComponent(For, {
@@ -19722,6 +20716,13 @@ function AdminDashboard(props) {
19722
20716
  get children() {
19723
20717
  return createComponent(EmailNotifications, {});
19724
20718
  }
20719
+ }), createComponent(Match, {
20720
+ get when() {
20721
+ return currentTab() === "features";
20722
+ },
20723
+ get children() {
20724
+ return createComponent(Features, {});
20725
+ }
19725
20726
  })];
19726
20727
  }
19727
20728
  });
@@ -19754,7 +20755,7 @@ function AdminTabError(props) {
19754
20755
  console.error("[AdminDashboard] tab failed to render:", props.error);
19755
20756
  const message = () => props.error instanceof Error ? props.error.message : String(props.error);
19756
20757
  return (() => {
19757
- var _el$12 = _tmpl$545(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling;
20758
+ var _el$12 = _tmpl$547(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling;
19758
20759
  insert(_el$14, message);
19759
20760
  _el$15.$$click = () => props.reset();
19760
20761
  return _el$12;
@@ -19762,7 +20763,7 @@ function AdminTabError(props) {
19762
20763
  }
19763
20764
  function AdminGateSpinner(props) {
19764
20765
  return (() => {
19765
- var _el$16 = _tmpl$642(); _el$16.firstChild;
20766
+ var _el$16 = _tmpl$643(); _el$16.firstChild;
19766
20767
  effect((_p$) => {
19767
20768
  var _v$8 = props.topOffset, _v$9 = `calc(100vh - ${props.topOffset})`;
19768
20769
  _v$8 !== _p$.e && setStyleProperty(_el$16, "top", _p$.e = _v$8);
@@ -19793,7 +20794,8 @@ var ADMIN_TAB_SEGMENTS = {
19793
20794
  "email-templates": "email-templates",
19794
20795
  funnel: "funnel",
19795
20796
  sequences: "sequences",
19796
- "email-notifications": "email-notifications"
20797
+ "email-notifications": "email-notifications",
20798
+ features: "features"
19797
20799
  };
19798
20800
  var AFFILIATE_SUB_TAB_SEGMENTS = {
19799
20801
  overview: "",
@@ -19839,19 +20841,19 @@ function affiliateSubTabFromPath(pathname, base = "/admin") {
19839
20841
  }
19840
20842
  return "overview";
19841
20843
  }
19842
- var _tmpl$307 = /* @__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`);
19843
- var _tmpl$2103 = /* @__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`);
19844
- var _tmpl$367 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>Could not load this customer's dashboard.`);
19845
- var _tmpl$455 = /* @__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">`);
19846
- var _tmpl$546 = /* @__PURE__ */ template(`<div><h3>Subscription`);
19847
- var _tmpl$643 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem>`);
19848
- var _tmpl$739 = /* @__PURE__ */ template(`<div><h3>Prescription requests`);
19849
- var _tmpl$833 = /* @__PURE__ */ template(`<div><h3>Pending surveys`);
19850
- var _tmpl$930 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No active subscription.`);
19851
- var _tmpl$026 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">Next charge `);
19852
- var _tmpl$1107 = /* @__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>`);
19853
- var _tmpl$1020 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
19854
- var _tmpl$1120 = /* @__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`);
20844
+ var _tmpl$309 = /* @__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`);
20845
+ var _tmpl$2105 = /* @__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`);
20846
+ var _tmpl$369 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>Could not load this customer's dashboard.`);
20847
+ var _tmpl$457 = /* @__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">`);
20848
+ var _tmpl$548 = /* @__PURE__ */ template(`<div><h3>Subscription`);
20849
+ var _tmpl$644 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem>`);
20850
+ var _tmpl$740 = /* @__PURE__ */ template(`<div><h3>Prescription requests`);
20851
+ var _tmpl$835 = /* @__PURE__ */ template(`<div><h3>Pending surveys`);
20852
+ var _tmpl$932 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No active subscription.`);
20853
+ var _tmpl$028 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">Next charge `);
20854
+ var _tmpl$1109 = /* @__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>`);
20855
+ var _tmpl$1022 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
20856
+ var _tmpl$1122 = /* @__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`);
19855
20857
  var _tmpl$1217 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No prescription requests.`);
19856
20858
  var _tmpl$1315 = /* @__PURE__ */ template(`<span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>`);
19857
20859
  var _tmpl$1415 = /* @__PURE__ */ template(`<span> \xB7 `);
@@ -19863,7 +20865,7 @@ function PatientDashboardPreview(props) {
19863
20865
  authToken: () => props.token
19864
20866
  });
19865
20867
  return (() => {
19866
- var _el$ = _tmpl$307(), _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;
20868
+ var _el$ = _tmpl$309(), _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;
19867
20869
  _el$.$$click = (e) => {
19868
20870
  if (e.target === e.currentTarget) props.onClose();
19869
20871
  };
@@ -19875,7 +20877,7 @@ function PatientDashboardPreview(props) {
19875
20877
  },
19876
20878
  keyed: true,
19877
20879
  children: (msg) => (() => {
19878
- var _el$1 = _tmpl$2103(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
20880
+ var _el$1 = _tmpl$2105(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
19879
20881
  insert(_el$10, msg);
19880
20882
  _el$11.$$click = () => data.retry();
19881
20883
  return _el$1;
@@ -19894,25 +20896,25 @@ function PatientDashboardPreview(props) {
19894
20896
  return data.profile();
19895
20897
  },
19896
20898
  get fallback() {
19897
- return _tmpl$367();
20899
+ return _tmpl$369();
19898
20900
  },
19899
20901
  children: (profile) => [(() => {
19900
- var _el$13 = _tmpl$455(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling;
20902
+ var _el$13 = _tmpl$457(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling;
19901
20903
  insert(_el$16, () => [profile().firstName, profile().lastName].filter(Boolean).join(" ") || "Member");
19902
20904
  insert(_el$17, () => profile().email);
19903
20905
  effect((_$p) => style(_el$14, panelSectionHeader, _$p));
19904
20906
  return _el$13;
19905
20907
  })(), (() => {
19906
- var _el$18 = _tmpl$546(), _el$19 = _el$18.firstChild;
20908
+ var _el$18 = _tmpl$548(), _el$19 = _el$18.firstChild;
19907
20909
  insert(_el$18, createComponent(Show, {
19908
20910
  get when() {
19909
20911
  return data.subscription();
19910
20912
  },
19911
20913
  get fallback() {
19912
- return _tmpl$930();
20914
+ return _tmpl$932();
19913
20915
  },
19914
20916
  children: (sub) => (() => {
19915
- var _el$27 = _tmpl$1107(), _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild;
20917
+ var _el$27 = _tmpl$1109(), _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild;
19916
20918
  insert(_el$29, createComponent(Show, {
19917
20919
  get when() {
19918
20920
  return sub().amount != null;
@@ -19932,7 +20934,7 @@ function PatientDashboardPreview(props) {
19932
20934
  return sub().nextBillingDate;
19933
20935
  },
19934
20936
  get children() {
19935
- var _el$30 = _tmpl$026(); _el$30.firstChild;
20937
+ var _el$30 = _tmpl$028(); _el$30.firstChild;
19936
20938
  insert(_el$30, () => fmtDate(sub().nextBillingDate), null);
19937
20939
  return _el$30;
19938
20940
  }
@@ -19947,7 +20949,7 @@ function PatientDashboardPreview(props) {
19947
20949
  return data.rxStatus();
19948
20950
  },
19949
20951
  children: (rx) => (() => {
19950
- var _el$32 = _tmpl$1120(), _el$33 = _el$32.firstChild, _el$34 = _el$33.nextSibling, _el$35 = _el$34.firstChild; _el$35.firstChild;
20952
+ var _el$32 = _tmpl$1122(), _el$33 = _el$32.firstChild, _el$34 = _el$33.nextSibling, _el$35 = _el$34.firstChild; _el$35.firstChild;
19951
20953
  insert(_el$35, createComponent(StatusBadge, {
19952
20954
  get status() {
19953
20955
  return rx().status;
@@ -19958,7 +20960,7 @@ function PatientDashboardPreview(props) {
19958
20960
  return rx().reason;
19959
20961
  },
19960
20962
  get children() {
19961
- var _el$37 = _tmpl$1020();
20963
+ var _el$37 = _tmpl$1022();
19962
20964
  insert(_el$37, () => rx().reason);
19963
20965
  return _el$37;
19964
20966
  }
@@ -19967,7 +20969,7 @@ function PatientDashboardPreview(props) {
19967
20969
  return _el$32;
19968
20970
  })()
19969
20971
  }), (() => {
19970
- var _el$20 = _tmpl$739(), _el$21 = _el$20.firstChild;
20972
+ var _el$20 = _tmpl$740(), _el$21 = _el$20.firstChild;
19971
20973
  insert(_el$20, createComponent(Show, {
19972
20974
  get when() {
19973
20975
  return (data.rxList() ?? []).length > 0;
@@ -19976,7 +20978,7 @@ function PatientDashboardPreview(props) {
19976
20978
  return _tmpl$1217();
19977
20979
  },
19978
20980
  get children() {
19979
- var _el$22 = _tmpl$643();
20981
+ var _el$22 = _tmpl$644();
19980
20982
  insert(_el$22, createComponent(For, {
19981
20983
  get each() {
19982
20984
  return data.rxList();
@@ -20019,7 +21021,7 @@ function PatientDashboardPreview(props) {
20019
21021
  effect((_$p) => style(_el$21, panelSectionHeader, _$p));
20020
21022
  return _el$20;
20021
21023
  })(), (() => {
20022
- var _el$23 = _tmpl$833(), _el$24 = _el$23.firstChild;
21024
+ var _el$23 = _tmpl$835(), _el$24 = _el$23.firstChild;
20023
21025
  insert(_el$23, createComponent(Show, {
20024
21026
  get when() {
20025
21027
  return (data.pendingSurveys() ?? []).length > 0;
@@ -20028,7 +21030,7 @@ function PatientDashboardPreview(props) {
20028
21030
  return _tmpl$1615();
20029
21031
  },
20030
21032
  get children() {
20031
- var _el$25 = _tmpl$643();
21033
+ var _el$25 = _tmpl$644();
20032
21034
  insert(_el$25, createComponent(For, {
20033
21035
  get each() {
20034
21036
  return data.pendingSurveys();
@@ -20053,9 +21055,9 @@ function PatientDashboardPreview(props) {
20053
21055
  })();
20054
21056
  }
20055
21057
  delegateEvents(["click"]);
20056
- var _tmpl$308 = /* @__PURE__ */ template(`<div style=margin-bottom:1rem>`);
20057
- var _tmpl$2104 = /* @__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>`);
20058
- var _tmpl$368 = /* @__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.`);
21058
+ var _tmpl$370 = /* @__PURE__ */ template(`<div style=margin-bottom:1rem>`);
21059
+ var _tmpl$2106 = /* @__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>`);
21060
+ var _tmpl$371 = /* @__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.`);
20059
21061
  var LIVE = /* @__PURE__ */ new Set(["active", "paused", "past_due"]);
20060
21062
  function UpdatePaymentMethod(props) {
20061
21063
  const {
@@ -20085,7 +21087,7 @@ function UpdatePaymentMethod(props) {
20085
21087
  if (ok) props.onDone();
20086
21088
  }
20087
21089
  return (() => {
20088
- var _el$ = _tmpl$368(), _el$2 = _el$.firstChild;
21090
+ var _el$ = _tmpl$371(), _el$2 = _el$.firstChild;
20089
21091
  insert(_el$, createComponent(Heading, {
20090
21092
  level: 1,
20091
21093
  get children() {
@@ -20116,14 +21118,14 @@ function UpdatePaymentMethod(props) {
20116
21118
  return memo(() => !!!resolving())() && !noSubscription();
20117
21119
  },
20118
21120
  get children() {
20119
- var _el$3 = _tmpl$2104(), _el$5 = _el$3.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.nextSibling;
21121
+ var _el$3 = _tmpl$2106(), _el$5 = _el$3.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.nextSibling;
20120
21122
  _el$3.addEventListener("submit", handleSubmit);
20121
21123
  insert(_el$3, createComponent(Show, {
20122
21124
  get when() {
20123
21125
  return flow.error();
20124
21126
  },
20125
21127
  get children() {
20126
- var _el$4 = _tmpl$308();
21128
+ var _el$4 = _tmpl$370();
20127
21129
  insert(_el$4, createComponent(Banner, {
20128
21130
  variant: "error",
20129
21131
  get children() {
@@ -20201,19 +21203,19 @@ function UpdatePaymentMethod(props) {
20201
21203
  return _el$;
20202
21204
  })();
20203
21205
  }
20204
- var _tmpl$309 = /* @__PURE__ */ template(`<a class=ship__track target=_blank rel="noopener noreferrer">Track<!> \u2197`);
20205
- var _tmpl$2105 = /* @__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>`);
20206
- var _tmpl$369 = /* @__PURE__ */ template(`<span class=refill__cycle>Day <!> of `);
20207
- var _tmpl$456 = /* @__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>`);
20208
- var _tmpl$547 = /* @__PURE__ */ template(`<span class=refill__cycle>Preparing your next fill`);
20209
- var _tmpl$644 = /* @__PURE__ */ template(`<div><span class=refill__dot aria-hidden=true></span><span class="lab-label refill__label"></span><span class=refill__date></span><span class=refill__rel>`);
20210
- var _tmpl$740 = /* @__PURE__ */ template(`<a class=refill__action>Complete check-in \u2192`);
20211
- var _tmpl$834 = /* @__PURE__ */ template(`<p class=tracker__empty-text data-testid=tracker-savings-note><strong>Member pricing is active on your account.</strong> It applies automatically when you check out.`);
20212
- var _tmpl$931 = /* @__PURE__ */ template(`<div class=tracker><span class=lab-label>Your order</span><div class=tracker__empty data-testid=tracker-empty><div class=tracker__empty-mark aria-hidden=true><span class=tracker__empty-bead></span></div><h2 class=tracker__empty-title>Your journey starts here</h2><p class=tracker__empty-text></p><a class="portal-btn portal-btn--primary">Start your intake`);
20213
- var _tmpl$027 = /* @__PURE__ */ template(`<span class=thread__halo aria-hidden=true>`);
20214
- var _tmpl$1108 = /* @__PURE__ */ template(`<time class=thread__time>`);
20215
- var _tmpl$1021 = /* @__PURE__ */ template(`<h2 class=thread__hero>`);
20216
- var _tmpl$1121 = /* @__PURE__ */ template(`<p class=thread__caption>`);
21206
+ var _tmpl$374 = /* @__PURE__ */ template(`<a class=ship__track target=_blank rel="noopener noreferrer">Track<!> \u2197`);
21207
+ var _tmpl$2107 = /* @__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>`);
21208
+ var _tmpl$375 = /* @__PURE__ */ template(`<span class=refill__cycle>Day <!> of `);
21209
+ var _tmpl$458 = /* @__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>`);
21210
+ var _tmpl$549 = /* @__PURE__ */ template(`<span class=refill__cycle>Preparing your next fill`);
21211
+ var _tmpl$645 = /* @__PURE__ */ template(`<div><span class=refill__dot aria-hidden=true></span><span class="lab-label refill__label"></span><span class=refill__date></span><span class=refill__rel>`);
21212
+ var _tmpl$741 = /* @__PURE__ */ template(`<a class=refill__action>Complete check-in \u2192`);
21213
+ var _tmpl$836 = /* @__PURE__ */ template(`<p class=tracker__empty-text data-testid=tracker-savings-note><strong>Member pricing is active on your account.</strong> It applies automatically when you check out.`);
21214
+ var _tmpl$933 = /* @__PURE__ */ template(`<div class=tracker><span class=lab-label>Your order</span><div class=tracker__empty data-testid=tracker-empty><div class=tracker__empty-mark aria-hidden=true><span class=tracker__empty-bead></span></div><h2 class=tracker__empty-title>Your journey starts here</h2><p class=tracker__empty-text></p><a class="portal-btn portal-btn--primary">Start your intake`);
21215
+ var _tmpl$029 = /* @__PURE__ */ template(`<span class=thread__halo aria-hidden=true>`);
21216
+ var _tmpl$1123 = /* @__PURE__ */ template(`<time class=thread__time>`);
21217
+ var _tmpl$1023 = /* @__PURE__ */ template(`<h2 class=thread__hero>`);
21218
+ var _tmpl$1124 = /* @__PURE__ */ template(`<p class=thread__caption>`);
20217
21219
  var _tmpl$1218 = /* @__PURE__ */ template(`<button type=button class="portal-btn portal-btn--ghost thread__action">Where's my order?`);
20218
21220
  var _tmpl$1316 = /* @__PURE__ */ template(`<button type=button class="portal-btn portal-btn--primary thread__action">Message your care team`);
20219
21221
  var _tmpl$1416 = /* @__PURE__ */ template(`<button type=button class="portal-btn portal-btn--ghost thread__action">Talk to your provider`);
@@ -20238,7 +21240,7 @@ function TrackingChip(props) {
20238
21240
  }
20239
21241
  };
20240
21242
  return (() => {
20241
- var _el$ = _tmpl$2105(), _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;
21243
+ var _el$ = _tmpl$2107(), _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;
20242
21244
  insert(_el$2, () => props.eta);
20243
21245
  _el$4.$$click = copy;
20244
21246
  insert(_el$5, () => props.number);
@@ -20249,7 +21251,7 @@ function TrackingChip(props) {
20249
21251
  return props.url;
20250
21252
  },
20251
21253
  get children() {
20252
- var _el$8 = _tmpl$309(), _el$9 = _el$8.firstChild, _el$1 = _el$9.nextSibling; _el$1.nextSibling;
21254
+ var _el$8 = _tmpl$374(), _el$9 = _el$8.firstChild, _el$1 = _el$9.nextSibling; _el$1.nextSibling;
20253
21255
  insert(_el$8, (() => {
20254
21256
  var _c$ = memo(() => !!props.carrier);
20255
21257
  return () => _c$() ? ` with ${props.carrier}` : "";
@@ -20270,16 +21272,16 @@ function OrderTracker(props) {
20270
21272
  return refill();
20271
21273
  },
20272
21274
  children: (r) => (() => {
20273
- var _el$11 = _tmpl$456(), _el$12 = _el$11.firstChild; _el$12.firstChild; var _el$18 = _el$12.nextSibling;
21275
+ var _el$11 = _tmpl$458(), _el$12 = _el$11.firstChild; _el$12.firstChild; var _el$18 = _el$12.nextSibling;
20274
21276
  insert(_el$12, createComponent(Show, {
20275
21277
  get when() {
20276
21278
  return !r().pendingFill;
20277
21279
  },
20278
21280
  get fallback() {
20279
- return _tmpl$547();
21281
+ return _tmpl$549();
20280
21282
  },
20281
21283
  get children() {
20282
- var _el$14 = _tmpl$369(), _el$15 = _el$14.firstChild, _el$17 = _el$15.nextSibling; _el$17.nextSibling;
21284
+ var _el$14 = _tmpl$375(), _el$15 = _el$14.firstChild, _el$17 = _el$15.nextSibling; _el$17.nextSibling;
20283
21285
  insert(_el$14, () => r().cycleDay, _el$17);
20284
21286
  insert(_el$14, () => r().cycleLength, null);
20285
21287
  return _el$14;
@@ -20290,7 +21292,7 @@ function OrderTracker(props) {
20290
21292
  return r().events;
20291
21293
  },
20292
21294
  children: (e) => (() => {
20293
- var _el$20 = _tmpl$644(), _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$22.nextSibling, _el$24 = _el$23.nextSibling;
21295
+ var _el$20 = _tmpl$645(), _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$22.nextSibling, _el$24 = _el$23.nextSibling;
20294
21296
  insert(_el$22, () => e.label);
20295
21297
  insert(_el$23, () => formatEventDate(e.date));
20296
21298
  insert(_el$24, (() => {
@@ -20303,7 +21305,7 @@ function OrderTracker(props) {
20303
21305
  },
20304
21306
  keyed: true,
20305
21307
  children: (rid) => (() => {
20306
- var _el$25 = _tmpl$740();
21308
+ var _el$25 = _tmpl$741();
20307
21309
  effect(() => setAttribute(_el$25, "href", props.renewHref(rid)));
20308
21310
  return _el$25;
20309
21311
  })()
@@ -20317,14 +21319,14 @@ function OrderTracker(props) {
20317
21319
  })()
20318
21320
  });
20319
21321
  const EmptyState2 = () => (() => {
20320
- var _el$26 = _tmpl$931(), _el$27 = _el$26.firstChild, _el$28 = _el$27.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$32 = _el$30.nextSibling, _el$33 = _el$32.nextSibling;
21322
+ var _el$26 = _tmpl$933(), _el$27 = _el$26.firstChild, _el$28 = _el$27.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$32 = _el$30.nextSibling, _el$33 = _el$32.nextSibling;
20321
21323
  insert(_el$26, createComponent(RefillStrip, {}), _el$28);
20322
21324
  insert(_el$28, createComponent(Show, {
20323
21325
  get when() {
20324
21326
  return props.savingsMember;
20325
21327
  },
20326
21328
  get children() {
20327
- return _tmpl$834();
21329
+ return _tmpl$836();
20328
21330
  }
20329
21331
  }), _el$32);
20330
21332
  insert(_el$32, () => props.savingsMember ? "Complete a short intake \u2014 about ten minutes \u2014 and a clinician reviews it from there. You\u2019ll watch every step come together right here, from review to delivery." : "Once you complete your intake, you\u2019ll watch every step of your prescription come together right here \u2014 from review to delivery.");
@@ -20340,7 +21342,7 @@ function OrderTracker(props) {
20340
21342
  insert(_el$36, createComponent(Show, {
20341
21343
  when: isActive,
20342
21344
  get children() {
20343
- return _tmpl$027();
21345
+ return _tmpl$029();
20344
21346
  }
20345
21347
  }));
20346
21348
  className(_el$38, `thread__content${isActive ? " thread__content--active" : ""}`);
@@ -20350,7 +21352,7 @@ function OrderTracker(props) {
20350
21352
  return s.timestamp;
20351
21353
  },
20352
21354
  get children() {
20353
- var _el$41 = _tmpl$1108();
21355
+ var _el$41 = _tmpl$1123();
20354
21356
  insert(_el$41, () => formatStageDate(s.timestamp));
20355
21357
  return _el$41;
20356
21358
  }
@@ -20360,7 +21362,7 @@ function OrderTracker(props) {
20360
21362
  return s.heroWord;
20361
21363
  },
20362
21364
  get children() {
20363
- var _el$42 = _tmpl$1021();
21365
+ var _el$42 = _tmpl$1023();
20364
21366
  insert(_el$42, () => s.heroWord);
20365
21367
  return _el$42;
20366
21368
  }
@@ -20370,7 +21372,7 @@ function OrderTracker(props) {
20370
21372
  return s.subCaption;
20371
21373
  },
20372
21374
  get children() {
20373
- var _el$43 = _tmpl$1121();
21375
+ var _el$43 = _tmpl$1124();
20374
21376
  insert(_el$43, () => s.subCaption);
20375
21377
  return _el$43;
20376
21378
  }
@@ -20518,9 +21520,9 @@ function OrderTracker(props) {
20518
21520
  });
20519
21521
  }
20520
21522
  delegateEvents(["click"]);
20521
- var _tmpl$370 = /* @__PURE__ */ template(`<span class=rx-row__dose> \xB7 `);
20522
- var _tmpl$2106 = /* @__PURE__ */ template(`<div class=rx-row__body>`);
20523
- var _tmpl$371 = /* @__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>`);
21523
+ var _tmpl$376 = /* @__PURE__ */ template(`<span class=rx-row__dose> \xB7 `);
21524
+ var _tmpl$2108 = /* @__PURE__ */ template(`<div class=rx-row__body>`);
21525
+ var _tmpl$377 = /* @__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>`);
20524
21526
  var STATUS_LABEL = {
20525
21527
  pending: "Under review",
20526
21528
  approved: "Approved",
@@ -20537,7 +21539,7 @@ function RxRow(props) {
20537
21539
  return STATUS_LABEL[props.rx.status] ?? props.rx.status;
20538
21540
  };
20539
21541
  return (() => {
20540
- var _el$ = _tmpl$371(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$6 = _el$3.nextSibling, _el$7 = _el$6.nextSibling;
21542
+ var _el$ = _tmpl$377(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$6 = _el$3.nextSibling, _el$7 = _el$6.nextSibling;
20541
21543
  _el$2.$$click = () => setOpen((v) => !v);
20542
21544
  insert(_el$3, () => props.rx.drugName ?? "Medication", null);
20543
21545
  insert(_el$3, createComponent(Show, {
@@ -20545,7 +21547,7 @@ function RxRow(props) {
20545
21547
  return props.rx.dosage;
20546
21548
  },
20547
21549
  get children() {
20548
- var _el$4 = _tmpl$370(); _el$4.firstChild;
21550
+ var _el$4 = _tmpl$376(); _el$4.firstChild;
20549
21551
  insert(_el$4, () => props.rx.dosage, null);
20550
21552
  return _el$4;
20551
21553
  }
@@ -20556,7 +21558,7 @@ function RxRow(props) {
20556
21558
  return open();
20557
21559
  },
20558
21560
  get children() {
20559
- var _el$8 = _tmpl$2106();
21561
+ var _el$8 = _tmpl$2108();
20560
21562
  insert(_el$8, createComponent(OrderTracker, {
20561
21563
  get request() {
20562
21564
  return props.request;
@@ -20599,17 +21601,17 @@ function RxRow(props) {
20599
21601
  })();
20600
21602
  }
20601
21603
  delegateEvents(["click"]);
20602
- var _tmpl$374 = /* @__PURE__ */ template(`<div class=plan data-testid=plan-billing><span class=lab-label>Plan &amp; billing`);
20603
- var _tmpl$2107 = /* @__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`);
20604
- var _tmpl$375 = /* @__PURE__ */ template(`<p class=membership__dose>`);
20605
- var _tmpl$457 = /* @__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 `);
20606
- var _tmpl$548 = /* @__PURE__ */ template(`<dl class=ledger><div class=ledger__row><dt>Member since</dt><dd></dd></div><div class=ledger__row><dt>Next billing date</dt><dd></dd></div><div class=ledger__row><dt>Billing amount</dt><dd>/mo`);
20607
- var _tmpl$645 = /* @__PURE__ */ template(`<p class=plan__note>Question about billing? <button type=button class=plan__note-link>Message support`);
20608
- var _tmpl$741 = /* @__PURE__ */ template(`<p class=plan__error role=alert>`);
20609
- var _tmpl$835 = /* @__PURE__ */ template(`<button type=button class=plan__link-btn>`);
20610
- var _tmpl$932 = /* @__PURE__ */ template(`<button type=button class="plan__link-btn plan__link-btn--quiet">Cancel subscription`);
20611
- var _tmpl$028 = /* @__PURE__ */ template(`<div class=plan__actions><a class=plan__link-btn>Update payment method`);
20612
- var _tmpl$1109 = /* @__PURE__ */ template(`<div class=confirm data-testid=cancel-confirm><p class=confirm__text>Cancel your subscription? You\u2019ll keep access until the end of your current billing period on <!>.</p><div class=confirm__actions><button type=button class="portal-btn portal-btn--ghost">Keep my plan</button><button type=button class="portal-btn portal-btn--danger">`);
21604
+ var _tmpl$378 = /* @__PURE__ */ template(`<div class=plan data-testid=plan-billing><span class=lab-label>Plan &amp; billing`);
21605
+ var _tmpl$2109 = /* @__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`);
21606
+ var _tmpl$379 = /* @__PURE__ */ template(`<p class=membership__dose>`);
21607
+ var _tmpl$459 = /* @__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 `);
21608
+ var _tmpl$550 = /* @__PURE__ */ template(`<dl class=ledger><div class=ledger__row><dt>Member since</dt><dd></dd></div><div class=ledger__row><dt>Next billing date</dt><dd></dd></div><div class=ledger__row><dt>Billing amount</dt><dd>/mo`);
21609
+ var _tmpl$646 = /* @__PURE__ */ template(`<p class=plan__note>Question about billing? <button type=button class=plan__note-link>Message support`);
21610
+ var _tmpl$742 = /* @__PURE__ */ template(`<p class=plan__error role=alert>`);
21611
+ var _tmpl$837 = /* @__PURE__ */ template(`<button type=button class=plan__link-btn>`);
21612
+ var _tmpl$934 = /* @__PURE__ */ template(`<button type=button class="plan__link-btn plan__link-btn--quiet">Cancel subscription`);
21613
+ var _tmpl$030 = /* @__PURE__ */ template(`<div class=plan__actions><a class=plan__link-btn>Update payment method`);
21614
+ var _tmpl$1125 = /* @__PURE__ */ template(`<div class=confirm data-testid=cancel-confirm><p class=confirm__text>Cancel your subscription? You\u2019ll keep access until the end of your current billing period on <!>.</p><div class=confirm__actions><button type=button class="portal-btn portal-btn--ghost">Keep my plan</button><button type=button class="portal-btn portal-btn--danger">`);
20613
21615
  function formatCents(cents) {
20614
21616
  if (cents == null || Number.isNaN(cents)) return "\u2014";
20615
21617
  return `$${(cents / 100).toFixed(2)}`;
@@ -20654,20 +21656,20 @@ function PlanBilling(props) {
20654
21656
  }
20655
21657
  };
20656
21658
  return (() => {
20657
- var _el$ = _tmpl$374(); _el$.firstChild;
21659
+ var _el$ = _tmpl$378(); _el$.firstChild;
20658
21660
  insert(_el$, createComponent(Show, {
20659
21661
  get when() {
20660
21662
  return primary();
20661
21663
  },
20662
21664
  get fallback() {
20663
21665
  return (() => {
20664
- var _el$3 = _tmpl$2107(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling;
21666
+ var _el$3 = _tmpl$2109(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling;
20665
21667
  effect(() => setAttribute(_el$6, "href", props.intakeHref));
20666
21668
  return _el$3;
20667
21669
  })();
20668
21670
  },
20669
21671
  children: (sub) => [(() => {
20670
- var _el$7 = _tmpl$457(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$9.nextSibling, _el$12 = _el$10.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$15 = _el$13.nextSibling; _el$15.firstChild;
21672
+ var _el$7 = _tmpl$459(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$9.nextSibling, _el$12 = _el$10.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$15 = _el$13.nextSibling; _el$15.firstChild;
20671
21673
  insert(_el$0, () => STATUS_COPY[sub().status] || sub().status);
20672
21674
  insert(_el$1, () => props.brandName);
20673
21675
  insert(_el$10, () => sub().medicationName ?? sub().medication);
@@ -20676,7 +21678,7 @@ function PlanBilling(props) {
20676
21678
  return sub().dosage;
20677
21679
  },
20678
21680
  get children() {
20679
- var _el$11 = _tmpl$375();
21681
+ var _el$11 = _tmpl$379();
20680
21682
  insert(_el$11, () => sub().dosage);
20681
21683
  return _el$11;
20682
21684
  }
@@ -20686,7 +21688,7 @@ function PlanBilling(props) {
20686
21688
  effect(() => className(_el$7, `membership membership--${sub().status}`));
20687
21689
  return _el$7;
20688
21690
  })(), (() => {
20689
- var _el$17 = _tmpl$548(), _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild, _el$20 = _el$19.nextSibling, _el$21 = _el$18.nextSibling, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$21.nextSibling, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling, _el$27 = _el$26.firstChild;
21691
+ var _el$17 = _tmpl$550(), _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild, _el$20 = _el$19.nextSibling, _el$21 = _el$18.nextSibling, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$21.nextSibling, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling, _el$27 = _el$26.firstChild;
20690
21692
  insert(_el$20, () => formatLongDate(sub().createdAt));
20691
21693
  insert(_el$23, () => formatLongDate(sub().currentPeriodEnd));
20692
21694
  insert(_el$26, () => formatCents(sub().amountCents), _el$27);
@@ -20696,7 +21698,7 @@ function PlanBilling(props) {
20696
21698
  return props.messagingEnabled;
20697
21699
  },
20698
21700
  get children() {
20699
- var _el$28 = _tmpl$645(), _el$29 = _el$28.firstChild, _el$31 = _el$29.nextSibling;
21701
+ var _el$28 = _tmpl$646(), _el$29 = _el$28.firstChild, _el$31 = _el$29.nextSibling;
20700
21702
  _el$31.$$click = () => props.onOpenMessages({
20701
21703
  channel: "support",
20702
21704
  category: "billing"
@@ -20708,18 +21710,18 @@ function PlanBilling(props) {
20708
21710
  return error();
20709
21711
  },
20710
21712
  get children() {
20711
- var _el$32 = _tmpl$741();
21713
+ var _el$32 = _tmpl$742();
20712
21714
  insert(_el$32, error);
20713
21715
  return _el$32;
20714
21716
  }
20715
21717
  }), (() => {
20716
- var _el$33 = _tmpl$028(), _el$36 = _el$33.firstChild;
21718
+ var _el$33 = _tmpl$030(), _el$36 = _el$33.firstChild;
20717
21719
  insert(_el$33, createComponent(Show, {
20718
21720
  get when() {
20719
21721
  return sub().status === "active";
20720
21722
  },
20721
21723
  get children() {
20722
- var _el$34 = _tmpl$835();
21724
+ var _el$34 = _tmpl$837();
20723
21725
  _el$34.$$click = () => run("pause", () => subscriptionsApi.pause(sub().id));
20724
21726
  insert(_el$34, () => action() === "pause" ? "Pausing\u2026" : "Pause subscription");
20725
21727
  effect(() => _el$34.disabled = !!action());
@@ -20731,7 +21733,7 @@ function PlanBilling(props) {
20731
21733
  return sub().status === "paused";
20732
21734
  },
20733
21735
  get children() {
20734
- var _el$35 = _tmpl$835();
21736
+ var _el$35 = _tmpl$837();
20735
21737
  _el$35.$$click = () => run("resume", () => subscriptionsApi.resume(sub().id));
20736
21738
  insert(_el$35, () => action() === "resume" ? "Resuming\u2026" : "Resume subscription");
20737
21739
  effect(() => _el$35.disabled = !!action());
@@ -20743,7 +21745,7 @@ function PlanBilling(props) {
20743
21745
  return memo(() => sub().status !== "cancelled")() && sub().status !== "expired";
20744
21746
  },
20745
21747
  get children() {
20746
- var _el$37 = _tmpl$932();
21748
+ var _el$37 = _tmpl$934();
20747
21749
  _el$37.$$click = () => setConfirmCancel(true);
20748
21750
  effect(() => _el$37.disabled = !!action());
20749
21751
  return _el$37;
@@ -20756,7 +21758,7 @@ function PlanBilling(props) {
20756
21758
  return confirmCancel();
20757
21759
  },
20758
21760
  get children() {
20759
- var _el$38 = _tmpl$1109(), _el$39 = _el$38.firstChild, _el$40 = _el$39.firstChild, _el$42 = _el$40.nextSibling; _el$42.nextSibling; var _el$43 = _el$39.nextSibling, _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling;
21761
+ var _el$38 = _tmpl$1125(), _el$39 = _el$38.firstChild, _el$40 = _el$39.firstChild, _el$42 = _el$40.nextSibling; _el$42.nextSibling; var _el$43 = _el$39.nextSibling, _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling;
20760
21762
  insert(_el$39, () => formatLongDate(sub().currentPeriodEnd), _el$42);
20761
21763
  _el$44.$$click = () => setConfirmCancel(false);
20762
21764
  _el$45.$$click = () => run("cancel", () => subscriptionsApi.cancel(sub().id)).then(() => setConfirmCancel(false));
@@ -20778,12 +21780,12 @@ function PlanBilling(props) {
20778
21780
  })();
20779
21781
  }
20780
21782
  delegateEvents(["click"]);
20781
- var _tmpl$376 = /* @__PURE__ */ template(`<p class=account__empty>We don\u2019t have your details on file yet.`);
20782
- var _tmpl$2108 = /* @__PURE__ */ template(`<p class=account__note>Need to update something? <button type=button class=account__note-link>Message support</button> and we\u2019ll take care of it.`);
20783
- var _tmpl$377 = /* @__PURE__ */ template(`<button type=button class="account__support-link account__support-btn">Messages`);
20784
- var _tmpl$458 = /* @__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`);
20785
- var _tmpl$549 = /* @__PURE__ */ template(`<div class=account__field><dt class=lab-label></dt><dd>`);
20786
- var _tmpl$646 = /* @__PURE__ */ template(`<a class=account__support-link>`);
21783
+ var _tmpl$380 = /* @__PURE__ */ template(`<p class=account__empty>We don\u2019t have your details on file yet.`);
21784
+ var _tmpl$2117 = /* @__PURE__ */ template(`<p class=account__note>Need to update something? <button type=button class=account__note-link>Message support</button> and we\u2019ll take care of it.`);
21785
+ var _tmpl$381 = /* @__PURE__ */ template(`<button type=button class="account__support-link account__support-btn">Messages`);
21786
+ var _tmpl$460 = /* @__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`);
21787
+ var _tmpl$551 = /* @__PURE__ */ template(`<div class=account__field><dt class=lab-label></dt><dd>`);
21788
+ var _tmpl$647 = /* @__PURE__ */ template(`<a class=account__support-link>`);
20787
21789
  function pick(member, ...keys) {
20788
21790
  if (!member) return "";
20789
21791
  for (const k of keys) {
@@ -20824,13 +21826,13 @@ function AccountPanel(props) {
20824
21826
  value: address()
20825
21827
  }].filter((f) => f.value);
20826
21828
  return (() => {
20827
- var _el$ = _tmpl$458(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$0 = _el$4.nextSibling, _el$10 = _el$0.nextSibling;
21829
+ var _el$ = _tmpl$460(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$0 = _el$4.nextSibling, _el$10 = _el$0.nextSibling;
20828
21830
  insert(_el$4, createComponent(For, {
20829
21831
  get each() {
20830
21832
  return fields();
20831
21833
  },
20832
21834
  children: (f) => (() => {
20833
- var _el$11 = _tmpl$549(), _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
21835
+ var _el$11 = _tmpl$551(), _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
20834
21836
  insert(_el$12, () => f.label);
20835
21837
  insert(_el$13, () => f.value);
20836
21838
  return _el$11;
@@ -20841,7 +21843,7 @@ function AccountPanel(props) {
20841
21843
  return fields().length === 0;
20842
21844
  },
20843
21845
  get children() {
20844
- return _tmpl$376();
21846
+ return _tmpl$380();
20845
21847
  }
20846
21848
  }), _el$0);
20847
21849
  insert(_el$, createComponent(Show, {
@@ -20849,7 +21851,7 @@ function AccountPanel(props) {
20849
21851
  return props.messagingEnabled;
20850
21852
  },
20851
21853
  get children() {
20852
- var _el$6 = _tmpl$2108(), _el$7 = _el$6.firstChild, _el$9 = _el$7.nextSibling;
21854
+ var _el$6 = _tmpl$2117(), _el$7 = _el$6.firstChild, _el$9 = _el$7.nextSibling;
20853
21855
  _el$9.$$click = () => props.onOpenMessages({
20854
21856
  channel: "support",
20855
21857
  category: "account"
@@ -20862,7 +21864,7 @@ function AccountPanel(props) {
20862
21864
  return props.messagingEnabled;
20863
21865
  },
20864
21866
  get children() {
20865
- var _el$1 = _tmpl$377();
21867
+ var _el$1 = _tmpl$381();
20866
21868
  _el$1.$$click = () => props.onOpenMessages();
20867
21869
  return _el$1;
20868
21870
  }
@@ -20872,7 +21874,7 @@ function AccountPanel(props) {
20872
21874
  return props.legalLinks ?? [];
20873
21875
  },
20874
21876
  children: (link) => (() => {
20875
- var _el$14 = _tmpl$646();
21877
+ var _el$14 = _tmpl$647();
20876
21878
  insert(_el$14, () => link.label);
20877
21879
  effect(() => setAttribute(_el$14, "href", link.href));
20878
21880
  return _el$14;
@@ -20883,12 +21885,12 @@ function AccountPanel(props) {
20883
21885
  })();
20884
21886
  }
20885
21887
  delegateEvents(["click"]);
20886
- var _tmpl$378 = /* @__PURE__ */ template(`<section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Birth control</h2><p class=leaflet__body>`);
20887
- var _tmpl$2109 = /* @__PURE__ */ template(`<ul class=leaflet__disclaimers id=leaflet-disclaimers>`);
20888
- var _tmpl$379 = /* @__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>`);
20889
- var _tmpl$459 = /* @__PURE__ */ template(`<li>`);
20890
- var _tmpl$550 = /* @__PURE__ */ template(`<li><span class=titration__bead aria-hidden=true></span><div class=titration__body><div class=titration__row><span class=titration__dose></span><span class="lab-label titration__phase"></span></div><span class=titration__time></span><p class=titration__note>`);
20891
- var _tmpl$647 = /* @__PURE__ */ template(`<li class=steps__item><span class=steps__num></span><div class=steps__body><h3 class=steps__title></h3><p class=steps__detail>`);
21888
+ var _tmpl$384 = /* @__PURE__ */ template(`<section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Birth control</h2><p class=leaflet__body>`);
21889
+ var _tmpl$2118 = /* @__PURE__ */ template(`<ul class=leaflet__disclaimers id=leaflet-disclaimers>`);
21890
+ var _tmpl$385 = /* @__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>`);
21891
+ var _tmpl$461 = /* @__PURE__ */ template(`<li>`);
21892
+ var _tmpl$552 = /* @__PURE__ */ template(`<li><span class=titration__bead aria-hidden=true></span><div class=titration__body><div class=titration__row><span class=titration__dose></span><span class="lab-label titration__phase"></span></div><span class=titration__time></span><p class=titration__note>`);
21893
+ var _tmpl$648 = /* @__PURE__ */ template(`<li class=steps__item><span class=steps__num></span><div class=steps__body><h3 class=steps__title></h3><p class=steps__detail>`);
20892
21894
  function firstNumber(s) {
20893
21895
  const m = (s || "").match(/\d+(\.\d+)?/);
20894
21896
  return m ? m[0] : null;
@@ -20909,7 +21911,7 @@ function MedicationGuide(props) {
20909
21911
  return "upcoming";
20910
21912
  };
20911
21913
  return (() => {
20912
- var _el$ = _tmpl$379(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling, _el$6 = _el$2.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$6.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$9.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$10.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$14.nextSibling, _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild, _el$20 = _el$19.nextSibling, _el$21 = _el$18.nextSibling, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$27 = _el$17.nextSibling, _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$28.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$27.nextSibling, _el$35 = _el$34.firstChild, _el$36 = _el$35.nextSibling, _el$37 = _el$34.nextSibling, _el$38 = _el$37.firstChild, _el$39 = _el$38.nextSibling, _el$40 = _el$37.nextSibling, _el$41 = _el$40.firstChild, _el$42 = _el$41.firstChild, _el$43 = _el$42.nextSibling;
21914
+ var _el$ = _tmpl$385(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling, _el$6 = _el$2.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$6.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$9.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$10.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$14.nextSibling, _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild, _el$20 = _el$19.nextSibling, _el$21 = _el$18.nextSibling, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$27 = _el$17.nextSibling, _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$28.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$27.nextSibling, _el$35 = _el$34.firstChild, _el$36 = _el$35.nextSibling, _el$37 = _el$34.nextSibling, _el$38 = _el$37.firstChild, _el$39 = _el$38.nextSibling, _el$40 = _el$37.nextSibling, _el$41 = _el$40.firstChild, _el$42 = _el$41.firstChild, _el$43 = _el$42.nextSibling;
20913
21915
  insert(_el$4, () => props.guide.title);
20914
21916
  insert(_el$5, () => props.guide.summary);
20915
21917
  insert(_el$8, () => props.guide.boxedWarning);
@@ -20918,7 +21920,7 @@ function MedicationGuide(props) {
20918
21920
  return props.guide.doNotUseIf;
20919
21921
  },
20920
21922
  children: (item) => (() => {
20921
- var _el$45 = _tmpl$459();
21923
+ var _el$45 = _tmpl$461();
20922
21924
  insert(_el$45, item);
20923
21925
  return _el$45;
20924
21926
  })()
@@ -20928,7 +21930,7 @@ function MedicationGuide(props) {
20928
21930
  return props.guide.titration;
20929
21931
  },
20930
21932
  children: (step, i) => (() => {
20931
- var _el$46 = _tmpl$550(), _el$47 = _el$46.firstChild, _el$48 = _el$47.nextSibling, _el$49 = _el$48.firstChild, _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling, _el$52 = _el$49.nextSibling, _el$53 = _el$52.nextSibling;
21933
+ var _el$46 = _tmpl$552(), _el$47 = _el$46.firstChild, _el$48 = _el$47.nextSibling, _el$49 = _el$48.firstChild, _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling, _el$52 = _el$49.nextSibling, _el$53 = _el$52.nextSibling;
20932
21934
  insert(_el$50, () => step.dose);
20933
21935
  insert(_el$51, () => step.phase);
20934
21936
  insert(_el$52, () => step.timeframe);
@@ -20942,7 +21944,7 @@ function MedicationGuide(props) {
20942
21944
  return props.guide.injectionSteps;
20943
21945
  },
20944
21946
  children: (step) => (() => {
20945
- var _el$54 = _tmpl$647(), _el$55 = _el$54.firstChild, _el$56 = _el$55.nextSibling, _el$57 = _el$56.firstChild, _el$58 = _el$57.nextSibling;
21947
+ var _el$54 = _tmpl$648(), _el$55 = _el$54.firstChild, _el$56 = _el$55.nextSibling, _el$57 = _el$56.firstChild, _el$58 = _el$57.nextSibling;
20946
21948
  insert(_el$55, () => step.n);
20947
21949
  insert(_el$57, () => step.title);
20948
21950
  insert(_el$58, () => step.detail);
@@ -20954,7 +21956,7 @@ function MedicationGuide(props) {
20954
21956
  return props.guide.storage;
20955
21957
  },
20956
21958
  children: (item) => (() => {
20957
- var _el$59 = _tmpl$459();
21959
+ var _el$59 = _tmpl$461();
20958
21960
  insert(_el$59, item);
20959
21961
  return _el$59;
20960
21962
  })()
@@ -20965,7 +21967,7 @@ function MedicationGuide(props) {
20965
21967
  return props.guide.contraception;
20966
21968
  },
20967
21969
  get children() {
20968
- var _el$24 = _tmpl$378(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
21970
+ var _el$24 = _tmpl$384(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
20969
21971
  insert(_el$26, () => props.guide.contraception);
20970
21972
  return _el$24;
20971
21973
  }
@@ -20975,7 +21977,7 @@ function MedicationGuide(props) {
20975
21977
  return props.guide.sideEffectsCommon;
20976
21978
  },
20977
21979
  children: (item) => (() => {
20978
- var _el$60 = _tmpl$459();
21980
+ var _el$60 = _tmpl$461();
20979
21981
  insert(_el$60, item);
20980
21982
  return _el$60;
20981
21983
  })()
@@ -20985,7 +21987,7 @@ function MedicationGuide(props) {
20985
21987
  return props.guide.sideEffectsSerious;
20986
21988
  },
20987
21989
  children: (item) => (() => {
20988
- var _el$61 = _tmpl$459();
21990
+ var _el$61 = _tmpl$461();
20989
21991
  insert(_el$61, item);
20990
21992
  return _el$61;
20991
21993
  })()
@@ -20995,7 +21997,7 @@ function MedicationGuide(props) {
20995
21997
  return props.guide.whenToCall;
20996
21998
  },
20997
21999
  children: (item) => (() => {
20998
- var _el$62 = _tmpl$459();
22000
+ var _el$62 = _tmpl$461();
20999
22001
  insert(_el$62, item);
21000
22002
  return _el$62;
21001
22003
  })()
@@ -21005,7 +22007,7 @@ function MedicationGuide(props) {
21005
22007
  return props.guide.tips;
21006
22008
  },
21007
22009
  children: (item) => (() => {
21008
- var _el$63 = _tmpl$459();
22010
+ var _el$63 = _tmpl$461();
21009
22011
  insert(_el$63, item);
21010
22012
  return _el$63;
21011
22013
  })()
@@ -21017,13 +22019,13 @@ function MedicationGuide(props) {
21017
22019
  return showDisclaimers();
21018
22020
  },
21019
22021
  get children() {
21020
- var _el$44 = _tmpl$2109();
22022
+ var _el$44 = _tmpl$2118();
21021
22023
  insert(_el$44, createComponent(For, {
21022
22024
  get each() {
21023
22025
  return props.guide.disclaimers;
21024
22026
  },
21025
22027
  children: (item) => (() => {
21026
- var _el$64 = _tmpl$459();
22028
+ var _el$64 = _tmpl$461();
21027
22029
  insert(_el$64, item);
21028
22030
  return _el$64;
21029
22031
  })()
@@ -21044,19 +22046,19 @@ function MedicationGuide(props) {
21044
22046
  })();
21045
22047
  }
21046
22048
  delegateEvents(["click"]);
21047
- var _tmpl$380 = /* @__PURE__ */ template(`<span data-testid=channel-chip>`);
21048
- var _tmpl$2117 = /* @__PURE__ */ template(`<span class=channel-chip__category>`);
21049
- var _tmpl$381 = /* @__PURE__ */ template(`<div class=msg-list__header><div class=msg-list__header-title><button type=button class=msg-list__back aria-label="Choose a different team"data-testid=messages-choose-different><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><h2 class=msg-list__title></h2></div><button type=button class=msg-list__new data-testid=messages-new-support><i class="ph-thin ph-plus"aria-hidden=true></i>New message`);
21050
- var _tmpl$460 = /* @__PURE__ */ template(`<div class=msg-list__state><div class=request-status__spinner>`);
21051
- var _tmpl$551 = /* @__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>`);
21052
- var _tmpl$648 = /* @__PURE__ */ template(`<div class=msg-list__scroll data-scrollable>`);
21053
- var _tmpl$742 = /* @__PURE__ */ template(`<span class=msg-list__pip>`);
21054
- var _tmpl$836 = /* @__PURE__ */ template(`<button type=button><div class=msg-list__row><span class=msg-list__name-group><span class=msg-list__name></span></span><span class=msg-list__time></span></div><div class=msg-list__row><span class=msg-list__preview>`);
21055
- var _tmpl$933 = /* @__PURE__ */ template(`<button type=button class=msg-attachment__image-link><img class=msg-attachment__image loading=lazy>`, true, false, false);
21056
- var _tmpl$029 = /* @__PURE__ */ template(`<button type=button class=msg-attachment__file><span class=msg-attachment__file-icon aria-hidden=true><i class="ph-thin ph-paperclip"></i></span><span class=msg-attachment__file-info><span class=msg-attachment__file-name></span><span class=msg-attachment__file-size>`);
21057
- var _tmpl$1122 = /* @__PURE__ */ template(`<span class=msg-attachment__fallback>`);
21058
- var _tmpl$1022 = /* @__PURE__ */ template(`<p class=msg-thread__sender>`);
21059
- var _tmpl$1123 = /* @__PURE__ */ template(`<div class=msg-thread__text>`);
22049
+ var _tmpl$386 = /* @__PURE__ */ template(`<span data-testid=channel-chip>`);
22050
+ var _tmpl$2119 = /* @__PURE__ */ template(`<span class=channel-chip__category>`);
22051
+ var _tmpl$387 = /* @__PURE__ */ template(`<div class=msg-list__header><div class=msg-list__header-title><button type=button class=msg-list__back aria-label="Choose a different team"data-testid=messages-choose-different><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><h2 class=msg-list__title></h2></div><button type=button class=msg-list__new data-testid=messages-new-support><i class="ph-thin ph-plus"aria-hidden=true></i>New message`);
22052
+ var _tmpl$463 = /* @__PURE__ */ template(`<div class=msg-list__state><div class=request-status__spinner>`);
22053
+ var _tmpl$553 = /* @__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>`);
22054
+ var _tmpl$649 = /* @__PURE__ */ template(`<div class=msg-list__scroll data-scrollable>`);
22055
+ var _tmpl$743 = /* @__PURE__ */ template(`<span class=msg-list__pip>`);
22056
+ var _tmpl$838 = /* @__PURE__ */ template(`<button type=button><div class=msg-list__row><span class=msg-list__name-group><span class=msg-list__name></span></span><span class=msg-list__time></span></div><div class=msg-list__row><span class=msg-list__preview>`);
22057
+ var _tmpl$935 = /* @__PURE__ */ template(`<button type=button class=msg-attachment__image-link><img class=msg-attachment__image loading=lazy>`, true, false, false);
22058
+ var _tmpl$031 = /* @__PURE__ */ template(`<button type=button class=msg-attachment__file><span class=msg-attachment__file-icon aria-hidden=true><i class="ph-thin ph-paperclip"></i></span><span class=msg-attachment__file-info><span class=msg-attachment__file-name></span><span class=msg-attachment__file-size>`);
22059
+ var _tmpl$1126 = /* @__PURE__ */ template(`<span class=msg-attachment__fallback>`);
22060
+ var _tmpl$1024 = /* @__PURE__ */ template(`<p class=msg-thread__sender>`);
22061
+ var _tmpl$1127 = /* @__PURE__ */ template(`<div class=msg-thread__text>`);
21060
22062
  var _tmpl$1219 = /* @__PURE__ */ template(`<div class=msg-attachment>`);
21061
22063
  var _tmpl$1317 = /* @__PURE__ */ template(`<div><div><p class=msg-thread__meta>`);
21062
22064
  var _tmpl$1417 = /* @__PURE__ */ template(`<p class=msg-thread__system data-testid=system-message>`);
@@ -21066,7 +22068,7 @@ var _tmpl$1717 = /* @__PURE__ */ template(`<p class=msg-compose__error role=aler
21066
22068
  var _tmpl$1815 = /* @__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 data-testid=support-compose-back><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 id=support-category-label>What's this about? <span class=msg-compose__label-optional>(optional)</span></label><div class=msg-compose__categories role=group aria-labelledby=support-category-label></div><label class=msg-compose__label for=support-subject>Subject</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>`);
21067
22069
  var _tmpl$1914 = /* @__PURE__ */ template(`<button type=button>`);
21068
22070
  var _tmpl$2013 = /* @__PURE__ */ template(`<form class="msg-thread msg-thread--compose"data-testid=care-compose><div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label=Back data-testid=care-compose-back><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name>Message your care team</h3><p class=msg-thread__role>Your prescriber or their team will reply</p></div></div><div class=msg-compose__new><label class=msg-compose__label for=care-body>Message</label><textarea id=care-body class=msg-compose__body rows=6 maxlength=5000 required placeholder="Tell your care team 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=care-compose-attach></label><button type=submit class=msg-compose__send data-testid=care-compose-send>`);
21069
- var _tmpl$2118 = /* @__PURE__ */ template(`<span class=msg-choice__option-badge data-testid=gate-care-badge>`);
22071
+ var _tmpl$2120 = /* @__PURE__ */ template(`<span class=msg-choice__option-badge data-testid=gate-care-badge>`);
21070
22072
  var _tmpl$2213 = /* @__PURE__ */ template(`<span class=msg-choice__option-badge data-testid=gate-support-badge>`);
21071
22073
  var _tmpl$2312 = /* @__PURE__ */ template(`<p class=msg-choice__notice-text data-testid=messages-gate-note>That conversation isn't available.`);
21072
22074
  var _tmpl$2412 = /* @__PURE__ */ template(`<div class="msg-thread msg-choice"data-testid=messages-gate><div class=msg-thread__header><div><h3 class=msg-thread__name>Messages</h3><p class=msg-thread__role>Who do you want to talk to?</p></div></div><div class=msg-choice__options><button type=button class=msg-choice__option data-testid=gate-care-team><i class="ph-thin ph-heartbeat msg-choice__option-icon"aria-hidden=true></i><span class=msg-choice__option-title>My care team</span><span class=msg-choice__option-sub>Treatment, medication or side effects</span></button><button type=button class=msg-choice__option data-testid=gate-support><i class="ph-thin ph-lifebuoy msg-choice__option-icon"aria-hidden=true></i><span class=msg-choice__option-title>Support</span><span class=msg-choice__option-sub>Account, orders, billing or the website`);
@@ -21083,7 +22085,7 @@ var _tmpl$3412 = /* @__PURE__ */ template(`<div class=msg-compose__staged>`);
21083
22085
  var _tmpl$3511 = /* @__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>`);
21084
22086
  var _tmpl$3610 = /* @__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>`);
21085
22087
  var _tmpl$3710 = /* @__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`);
21086
- var _tmpl$384 = /* @__PURE__ */ template(`<div class=msg-panel__layout><div></div><div>`);
22088
+ var _tmpl$388 = /* @__PURE__ */ template(`<div class=msg-panel__layout><div></div><div>`);
21087
22089
  var _tmpl$394 = /* @__PURE__ */ template(`<div class=msg-panel data-testid=messages-panel>`);
21088
22090
  var _tmpl$403 = /* @__PURE__ */ template(`<div class="msg-panel__layout msg-panel__layout--gate">`);
21089
22091
  var _tmpl$4111 = /* @__PURE__ */ template(`<div class=msg-panel__placeholder data-testid=messages-placeholder><p>Select a conversation to read and reply.`);
@@ -21272,14 +22274,14 @@ function MessagesPanel(props) {
21272
22274
  }
21273
22275
  }
21274
22276
  const ChannelChip = (p) => (() => {
21275
- var _el$ = _tmpl$380();
22277
+ var _el$ = _tmpl$386();
21276
22278
  insert(_el$, () => p.source === "clinical" ? "Care team" : "Support", null);
21277
22279
  insert(_el$, createComponent(Show, {
21278
22280
  get when() {
21279
22281
  return memo(() => p.source === "support")() && categoryLabel(p.category);
21280
22282
  },
21281
22283
  children: (label3) => (() => {
21282
- var _el$2 = _tmpl$2117();
22284
+ var _el$2 = _tmpl$2119();
21283
22285
  insert(_el$2, label3);
21284
22286
  return _el$2;
21285
22287
  })()
@@ -21297,19 +22299,19 @@ function MessagesPanel(props) {
21297
22299
  })();
21298
22300
  const channelConversations = () => thread().conversations().filter((c) => c.source === (channel() === "care" ? "clinical" : "support"));
21299
22301
  const ConversationList = () => [(() => {
21300
- var _el$3 = _tmpl$381(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling;
22302
+ var _el$3 = _tmpl$387(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling;
21301
22303
  _el$5.$$click = goToGate;
21302
22304
  insert(_el$6, () => channel() === "care" ? "My care team" : "Support");
21303
22305
  _el$7.$$click = openCompose;
21304
22306
  return _el$3;
21305
22307
  })(), (() => {
21306
- var _el$8 = _tmpl$648();
22308
+ var _el$8 = _tmpl$649();
21307
22309
  insert(_el$8, createComponent(Show, {
21308
22310
  get when() {
21309
22311
  return thread().loadingConversations();
21310
22312
  },
21311
22313
  get children() {
21312
- return _tmpl$460();
22314
+ return _tmpl$463();
21313
22315
  }
21314
22316
  }), null);
21315
22317
  insert(_el$8, createComponent(Show, {
@@ -21317,7 +22319,7 @@ function MessagesPanel(props) {
21317
22319
  return memo(() => !!!thread().loadingConversations())() && channelConversations().length === 0;
21318
22320
  },
21319
22321
  get children() {
21320
- var _el$0 = _tmpl$551(), _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling, _el$11 = _el$10.nextSibling;
22322
+ var _el$0 = _tmpl$553(), _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling, _el$11 = _el$10.nextSibling;
21321
22323
  insert(_el$11, createComponent(Show, {
21322
22324
  get when() {
21323
22325
  return channel() === "care";
@@ -21333,7 +22335,7 @@ function MessagesPanel(props) {
21333
22335
  return channelConversations();
21334
22336
  },
21335
22337
  children: (convo) => (() => {
21336
- var _el$12 = _tmpl$836(), _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, _el$16 = _el$14.nextSibling, _el$17 = _el$13.nextSibling, _el$18 = _el$17.firstChild;
22338
+ var _el$12 = _tmpl$838(), _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, _el$16 = _el$14.nextSibling, _el$17 = _el$13.nextSibling, _el$18 = _el$17.firstChild;
21337
22339
  _el$12.$$click = () => thread().selectConversation(convo.id);
21338
22340
  insert(_el$15, () => convo.participantName ?? "Provider");
21339
22341
  insert(_el$14, createComponent(ChannelChip, {
@@ -21351,7 +22353,7 @@ function MessagesPanel(props) {
21351
22353
  return (convo.unreadCount ?? 0) > 0;
21352
22354
  },
21353
22355
  get children() {
21354
- var _el$19 = _tmpl$742();
22356
+ var _el$19 = _tmpl$743();
21355
22357
  insert(_el$19, () => convo.unreadCount);
21356
22358
  return _el$19;
21357
22359
  }
@@ -21393,7 +22395,7 @@ function MessagesPanel(props) {
21393
22395
  },
21394
22396
  get fallback() {
21395
22397
  return (() => {
21396
- var _el$22 = _tmpl$029(), _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
22398
+ var _el$22 = _tmpl$031(), _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
21397
22399
  _el$22.$$click = openDocument;
21398
22400
  insert(_el$25, () => p.attachment.filename);
21399
22401
  insert(_el$26, () => formatFileSize(p.attachment.sizeBytes));
@@ -21408,13 +22410,13 @@ function MessagesPanel(props) {
21408
22410
  },
21409
22411
  get fallback() {
21410
22412
  return (() => {
21411
- var _el$27 = _tmpl$1122();
22413
+ var _el$27 = _tmpl$1126();
21412
22414
  insert(_el$27, () => failed() ? "Attachment unavailable" : "Loading\u2026");
21413
22415
  return _el$27;
21414
22416
  })();
21415
22417
  },
21416
22418
  get children() {
21417
- var _el$20 = _tmpl$933(), _el$21 = _el$20.firstChild;
22419
+ var _el$20 = _tmpl$935(), _el$21 = _el$20.firstChild;
21418
22420
  _el$20.$$click = openDocument;
21419
22421
  _el$21.addEventListener("error", () => {
21420
22422
  if (retried) {
@@ -21460,7 +22462,7 @@ function MessagesPanel(props) {
21460
22462
  return memo(() => !!!isOwn())() && p.msg.senderName;
21461
22463
  },
21462
22464
  get children() {
21463
- var _el$30 = _tmpl$1022();
22465
+ var _el$30 = _tmpl$1024();
21464
22466
  insert(_el$30, () => p.msg.senderName);
21465
22467
  return _el$30;
21466
22468
  }
@@ -21482,7 +22484,7 @@ function MessagesPanel(props) {
21482
22484
  })();
21483
22485
  },
21484
22486
  get children() {
21485
- var _el$31 = _tmpl$1123();
22487
+ var _el$31 = _tmpl$1127();
21486
22488
  effect(() => _el$31.innerHTML = sanitizeMessageHtml(body()));
21487
22489
  return _el$31;
21488
22490
  }
@@ -21640,7 +22642,7 @@ function MessagesPanel(props) {
21640
22642
  return careUnreadCount() > 0;
21641
22643
  },
21642
22644
  get children() {
21643
- var _el$74 = _tmpl$2118();
22645
+ var _el$74 = _tmpl$2120();
21644
22646
  insert(_el$74, careUnreadCount);
21645
22647
  return _el$74;
21646
22648
  }
@@ -21738,7 +22740,7 @@ function MessagesPanel(props) {
21738
22740
  return thread().loadingMessages();
21739
22741
  },
21740
22742
  get children() {
21741
- return _tmpl$460();
22743
+ return _tmpl$463();
21742
22744
  }
21743
22745
  }), _el$101);
21744
22746
  insert(_el$99, createComponent(For, {
@@ -21824,7 +22826,7 @@ function MessagesPanel(props) {
21824
22826
  })();
21825
22827
  },
21826
22828
  get children() {
21827
- var _el$116 = _tmpl$384(), _el$117 = _el$116.firstChild, _el$118 = _el$117.nextSibling;
22829
+ var _el$116 = _tmpl$388(), _el$117 = _el$116.firstChild, _el$118 = _el$117.nextSibling;
21828
22830
  insert(_el$117, createComponent(ConversationList, {}));
21829
22831
  insert(_el$118, createComponent(Show, {
21830
22832
  get when() {
@@ -21893,23 +22895,23 @@ function MessagesPanel(props) {
21893
22895
  })();
21894
22896
  }
21895
22897
  delegateEvents(["click", "input", "keydown"]);
21896
- var _tmpl$385 = /* @__PURE__ */ template(`<ul class=history-list data-testid=history-list>`);
21897
- var _tmpl$2119 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-error><p>We couldn't load your submitted surveys. Please try again in a moment.`);
21898
- var _tmpl$386 = /* @__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.`);
21899
- var _tmpl$461 = /* @__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>`);
21900
- var _tmpl$552 = /* @__PURE__ */ template(`<div data-testid=history-detail><button type=button class="portal-btn portal-btn--ghost history-back"><i class="ph-thin ph-caret-left portal-icon"aria-hidden=true></i> All questionnaires`);
21901
- var _tmpl$649 = /* @__PURE__ */ template(`<div class=portal-state><div class=request-status__spinner></div><p>Loading your answers\u2026`);
21902
- var _tmpl$743 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-detail-error><p>We couldn't load this questionnaire. Please try again in a moment.`);
21903
- var _tmpl$837 = /* @__PURE__ */ template(`<article class=history-transcript><header class=history-transcript__head><h2></h2><p class=history-transcript__meta>Submitted <!>. Your answers are shown exactly as they were at the time \u2014 they aren't updated afterwards.`);
21904
- var _tmpl$934 = /* @__PURE__ */ template(`<section class=history-section><h3 class=lab-label>`);
21905
- var _tmpl$030 = /* @__PURE__ */ template(`<div class=history-qa><p class=history-qa__q></p><p class=history-qa__a>`);
21906
- var _tmpl$1124 = /* @__PURE__ */ template(`<div class=survey-history data-testid=survey-history>`);
21907
- var _tmpl$1023 = /* @__PURE__ */ template(`<div class=portal-state><div class=request-status__spinner></div><p>Loading your submitted surveys\u2026`);
22898
+ var _tmpl$389 = /* @__PURE__ */ template(`<ul class=history-list data-testid=history-list>`);
22899
+ var _tmpl$2121 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-error><p>We couldn't load your submitted surveys. Please try again in a moment.`);
22900
+ var _tmpl$390 = /* @__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.`);
22901
+ var _tmpl$464 = /* @__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>`);
22902
+ var _tmpl$554 = /* @__PURE__ */ template(`<div data-testid=history-detail><button type=button class="portal-btn portal-btn--ghost history-back"><i class="ph-thin ph-caret-left portal-icon"aria-hidden=true></i> All questionnaires`);
22903
+ var _tmpl$650 = /* @__PURE__ */ template(`<div class=portal-state><div class=request-status__spinner></div><p>Loading your answers\u2026`);
22904
+ var _tmpl$744 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-detail-error><p>We couldn't load this questionnaire. Please try again in a moment.`);
22905
+ var _tmpl$839 = /* @__PURE__ */ template(`<article class=history-transcript><header class=history-transcript__head><h2></h2><p class=history-transcript__meta>Submitted <!>. Your answers are shown exactly as they were at the time \u2014 they aren't updated afterwards.`);
22906
+ var _tmpl$936 = /* @__PURE__ */ template(`<section class=history-section><h3 class=lab-label>`);
22907
+ var _tmpl$032 = /* @__PURE__ */ template(`<div class=history-qa><p class=history-qa__q></p><p class=history-qa__a>`);
22908
+ var _tmpl$1128 = /* @__PURE__ */ template(`<div class=survey-history data-testid=survey-history>`);
22909
+ var _tmpl$1025 = /* @__PURE__ */ template(`<div class=portal-state><div class=request-status__spinner></div><p>Loading your submitted surveys\u2026`);
21908
22910
  var MODE_LABELS = {
21909
22911
  initial: "Intake questionnaire",
21910
22912
  refill: "Refill check-in"
21911
22913
  };
21912
- function formatDate2(iso) {
22914
+ function formatDate3(iso) {
21913
22915
  if (!iso) return null;
21914
22916
  const d = new Date(iso);
21915
22917
  if (Number.isNaN(d.getTime())) return null;
@@ -21932,7 +22934,7 @@ function SurveyHistory() {
21932
22934
  return !list.error;
21933
22935
  },
21934
22936
  get fallback() {
21935
- return _tmpl$2119();
22937
+ return _tmpl$2121();
21936
22938
  },
21937
22939
  get children() {
21938
22940
  return createComponent(Show, {
@@ -21940,19 +22942,19 @@ function SurveyHistory() {
21940
22942
  return (list() ?? []).length > 0;
21941
22943
  },
21942
22944
  get fallback() {
21943
- return _tmpl$386();
22945
+ return _tmpl$390();
21944
22946
  },
21945
22947
  get children() {
21946
- var _el$ = _tmpl$385();
22948
+ var _el$ = _tmpl$389();
21947
22949
  insert(_el$, createComponent(For, {
21948
22950
  get each() {
21949
22951
  return list();
21950
22952
  },
21951
22953
  children: (item) => (() => {
21952
- var _el$4 = _tmpl$461(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
22954
+ var _el$4 = _tmpl$464(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
21953
22955
  _el$5.$$click = () => setSelectedId(item.id);
21954
22956
  insert(_el$6, () => MODE_LABELS[item.mode] ?? "Questionnaire");
21955
- insert(_el$7, () => formatDate2(item.submittedAt) ?? "Date unavailable");
22957
+ insert(_el$7, () => formatDate3(item.submittedAt) ?? "Date unavailable");
21956
22958
  return _el$4;
21957
22959
  })()
21958
22960
  }));
@@ -21962,14 +22964,14 @@ function SurveyHistory() {
21962
22964
  }
21963
22965
  });
21964
22966
  const DetailView = () => (() => {
21965
- var _el$8 = _tmpl$552(), _el$9 = _el$8.firstChild;
22967
+ var _el$8 = _tmpl$554(), _el$9 = _el$8.firstChild;
21966
22968
  _el$9.$$click = () => setSelectedId(null);
21967
22969
  insert(_el$8, createComponent(Show, {
21968
22970
  get when() {
21969
22971
  return !detail.loading;
21970
22972
  },
21971
22973
  get fallback() {
21972
- return _tmpl$649();
22974
+ return _tmpl$650();
21973
22975
  },
21974
22976
  get children() {
21975
22977
  return createComponent(Show, {
@@ -21977,25 +22979,25 @@ function SurveyHistory() {
21977
22979
  return memo(() => !!!detail.error)() && detail();
21978
22980
  },
21979
22981
  get fallback() {
21980
- return _tmpl$743();
22982
+ return _tmpl$744();
21981
22983
  },
21982
22984
  children: (t) => (() => {
21983
- var _el$10 = _tmpl$837(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling, _el$14 = _el$13.firstChild, _el$16 = _el$14.nextSibling; _el$16.nextSibling;
22985
+ var _el$10 = _tmpl$839(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling, _el$14 = _el$13.firstChild, _el$16 = _el$14.nextSibling; _el$16.nextSibling;
21984
22986
  insert(_el$12, () => MODE_LABELS[t().mode] ?? "Questionnaire");
21985
- insert(_el$13, () => formatDate2(t().completedAt ?? t().createdAt) ?? "\u2014", _el$16);
22987
+ insert(_el$13, () => formatDate3(t().completedAt ?? t().createdAt) ?? "\u2014", _el$16);
21986
22988
  insert(_el$10, createComponent(For, {
21987
22989
  get each() {
21988
22990
  return t().sections;
21989
22991
  },
21990
22992
  children: (section) => (() => {
21991
- var _el$17 = _tmpl$934(), _el$18 = _el$17.firstChild;
22993
+ var _el$17 = _tmpl$936(), _el$18 = _el$17.firstChild;
21992
22994
  insert(_el$18, () => section.title);
21993
22995
  insert(_el$17, createComponent(For, {
21994
22996
  get each() {
21995
22997
  return section.items;
21996
22998
  },
21997
22999
  children: (item) => (() => {
21998
- var _el$19 = _tmpl$030(), _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling;
23000
+ var _el$19 = _tmpl$032(), _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling;
21999
23001
  insert(_el$20, () => item.question);
22000
23002
  insert(_el$21, () => item.answer);
22001
23003
  return _el$19;
@@ -22012,13 +23014,13 @@ function SurveyHistory() {
22012
23014
  return _el$8;
22013
23015
  })();
22014
23016
  return (() => {
22015
- var _el$22 = _tmpl$1124();
23017
+ var _el$22 = _tmpl$1128();
22016
23018
  insert(_el$22, createComponent(Show, {
22017
23019
  get when() {
22018
23020
  return !list.loading || selectedId();
22019
23021
  },
22020
23022
  get fallback() {
22021
- return _tmpl$1023();
23023
+ return _tmpl$1025();
22022
23024
  },
22023
23025
  get children() {
22024
23026
  return createComponent(Show, {
@@ -22040,19 +23042,19 @@ function SurveyHistory() {
22040
23042
  delegateEvents(["click"]);
22041
23043
 
22042
23044
  // src/pages/MemberPortal.tsx
22043
- var _tmpl$387 = /* @__PURE__ */ template(`<span class=portal-item__live aria-label="In progress">`);
22044
- var _tmpl$2120 = /* @__PURE__ */ template(`<span>`);
22045
- var _tmpl$388 = /* @__PURE__ */ template(`<button type=button><i aria-hidden=true></i><span class=portal-item__label>`);
22046
- var _tmpl$463 = /* @__PURE__ */ template(`<div class=rx-others data-testid=rx-others><span class=lab-label>Other orders`);
22047
- var _tmpl$553 = /* @__PURE__ */ template(`<div class=rx-stack>`);
22048
- var _tmpl$650 = /* @__PURE__ */ template(`<div class=portal-state><div class=request-status__spinner></div><p>Loading your portal\u2026`);
22049
- var _tmpl$744 = /* @__PURE__ */ template(`<div class="request-status__error portal-state"><p class=request-status__error-text></p><button type=button class="portal-btn portal-btn--ghost">Try again`);
22050
- var _tmpl$838 = /* @__PURE__ */ template(`<p class=portal-rail__hi>Hi, `);
22051
- var _tmpl$935 = /* @__PURE__ */ template(`<a class=portal-rail__back data-testid=rail-back>\u2190 Back to shop`);
22052
- var _tmpl$031 = /* @__PURE__ */ template(`<a class=portal-topbar-back data-testid=mobile-back><span aria-hidden=true>\u2190</span> Back to shop`);
22053
- var _tmpl$1125 = /* @__PURE__ */ template(`<main class=portal data-testid=member-portal><aside class=portal-rail><div class=portal-rail__brand><a class=portal-rail__logo></a><span class=portal-rail__dot aria-hidden=true></span></div><nav class=portal-rail__nav aria-label="Portal sections"></nav><div class=portal-rail__foot><button type=button class=portal-rail__signout>\u2014 Sign out</button></div></aside><section class=portal-content><div></div></section><nav class=portal-tabs aria-label="Portal sections">`);
22054
- var _tmpl$1024 = /* @__PURE__ */ template(`<span class=portal-rail__wordmark>`);
22055
- var _tmpl$1126 = /* @__PURE__ */ template(`<img>`);
23045
+ var _tmpl$391 = /* @__PURE__ */ template(`<span class=portal-item__live aria-label="In progress">`);
23046
+ var _tmpl$2122 = /* @__PURE__ */ template(`<span>`);
23047
+ var _tmpl$395 = /* @__PURE__ */ template(`<button type=button><i aria-hidden=true></i><span class=portal-item__label>`);
23048
+ var _tmpl$465 = /* @__PURE__ */ template(`<div class=rx-others data-testid=rx-others><span class=lab-label>Other orders`);
23049
+ var _tmpl$555 = /* @__PURE__ */ template(`<div class=rx-stack>`);
23050
+ var _tmpl$651 = /* @__PURE__ */ template(`<div class=portal-state><div class=request-status__spinner></div><p>Loading your portal\u2026`);
23051
+ var _tmpl$745 = /* @__PURE__ */ template(`<div class="request-status__error portal-state"><p class=request-status__error-text></p><button type=button class="portal-btn portal-btn--ghost">Try again`);
23052
+ var _tmpl$840 = /* @__PURE__ */ template(`<p class=portal-rail__hi>Hi, `);
23053
+ var _tmpl$937 = /* @__PURE__ */ template(`<a class=portal-rail__back data-testid=rail-back>\u2190 Back to shop`);
23054
+ var _tmpl$033 = /* @__PURE__ */ template(`<a class=portal-topbar-back data-testid=mobile-back><span aria-hidden=true>\u2190</span> Back to shop`);
23055
+ var _tmpl$1129 = /* @__PURE__ */ template(`<main class=portal data-testid=member-portal><aside class=portal-rail><div class=portal-rail__brand><a class=portal-rail__logo></a><span class=portal-rail__dot aria-hidden=true></span></div><nav class=portal-rail__nav aria-label="Portal sections"></nav><div class=portal-rail__foot><button type=button class=portal-rail__signout>\u2014 Sign out</button></div></aside><section class=portal-content><div></div></section><nav class=portal-tabs aria-label="Portal sections">`);
23056
+ var _tmpl$1026 = /* @__PURE__ */ template(`<span class=portal-rail__wordmark>`);
23057
+ var _tmpl$1130 = /* @__PURE__ */ template(`<img>`);
22056
23058
  var ICONS = {
22057
23059
  tracker: "ph-thin ph-path",
22058
23060
  instructions: "ph-thin ph-first-aid-kit",
@@ -22174,7 +23176,7 @@ function MemberPortal(props) {
22174
23176
  return tabs();
22175
23177
  },
22176
23178
  children: (item) => (() => {
22177
- var _el$ = _tmpl$388(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
23179
+ var _el$ = _tmpl$395(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
22178
23180
  _el$.$$click = () => selectTab(item.key);
22179
23181
  insert(_el$3, () => item.label);
22180
23182
  insert(_el$, createComponent(Show, {
@@ -22182,7 +23184,7 @@ function MemberPortal(props) {
22182
23184
  return memo(() => item.key === "tracker")() && inMotion();
22183
23185
  },
22184
23186
  get children() {
22185
- return _tmpl$387();
23187
+ return _tmpl$391();
22186
23188
  }
22187
23189
  }), null);
22188
23190
  insert(_el$, createComponent(Show, {
@@ -22190,7 +23192,7 @@ function MemberPortal(props) {
22190
23192
  return memo(() => item.key === "messages")() && unreadTotal() > 0;
22191
23193
  },
22192
23194
  get children() {
22193
- var _el$5 = _tmpl$2120();
23195
+ var _el$5 = _tmpl$2122();
22194
23196
  insert(_el$5, (() => {
22195
23197
  var _c$ = memo(() => unreadTotal() > 99);
22196
23198
  return () => _c$() ? "99+" : unreadTotal();
@@ -22245,7 +23247,7 @@ function MemberPortal(props) {
22245
23247
  });
22246
23248
  },
22247
23249
  children: (primary) => (() => {
22248
- var _el$6 = _tmpl$553();
23250
+ var _el$6 = _tmpl$555();
22249
23251
  insert(_el$6, createComponent(OrderTracker, {
22250
23252
  get request() {
22251
23253
  return data.toTrackerRequest(primary());
@@ -22275,7 +23277,7 @@ function MemberPortal(props) {
22275
23277
  return data.otherRx().length > 0;
22276
23278
  },
22277
23279
  get children() {
22278
- var _el$7 = _tmpl$463(); _el$7.firstChild;
23280
+ var _el$7 = _tmpl$465(); _el$7.firstChild;
22279
23281
  insert(_el$7, createComponent(For, {
22280
23282
  get each() {
22281
23283
  return data.otherRx();
@@ -22311,7 +23313,7 @@ function MemberPortal(props) {
22311
23313
  return !data.loading();
22312
23314
  },
22313
23315
  get fallback() {
22314
- return _tmpl$650();
23316
+ return _tmpl$651();
22315
23317
  },
22316
23318
  get children() {
22317
23319
  return createComponent(Show, {
@@ -22320,7 +23322,7 @@ function MemberPortal(props) {
22320
23322
  },
22321
23323
  get fallback() {
22322
23324
  return (() => {
22323
- var _el$0 = _tmpl$744(), _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling;
23325
+ var _el$0 = _tmpl$745(), _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling;
22324
23326
  insert(_el$1, () => data.error());
22325
23327
  _el$10.$$click = () => data.refetch();
22326
23328
  return _el$0;
@@ -22417,20 +23419,20 @@ function MemberPortal(props) {
22417
23419
  }
22418
23420
  });
22419
23421
  return (() => {
22420
- var _el$11 = _tmpl$1125(), _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$17 = _el$13.nextSibling, _el$18 = _el$17.nextSibling, _el$20 = _el$18.firstChild, _el$22 = _el$12.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$22.nextSibling;
23422
+ var _el$11 = _tmpl$1129(), _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$17 = _el$13.nextSibling, _el$18 = _el$17.nextSibling, _el$20 = _el$18.firstChild, _el$22 = _el$12.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$22.nextSibling;
22421
23423
  insert(_el$14, createComponent(Show, {
22422
23424
  get when() {
22423
23425
  return props.brand.logoSrc;
22424
23426
  },
22425
23427
  get fallback() {
22426
23428
  return (() => {
22427
- var _el$25 = _tmpl$1024();
23429
+ var _el$25 = _tmpl$1026();
22428
23430
  insert(_el$25, () => props.brand.name);
22429
23431
  return _el$25;
22430
23432
  })();
22431
23433
  },
22432
23434
  children: (src) => (() => {
22433
- var _el$26 = _tmpl$1126();
23435
+ var _el$26 = _tmpl$1130();
22434
23436
  effect((_p$) => {
22435
23437
  var _v$8 = src(), _v$9 = props.brand.name;
22436
23438
  _v$8 !== _p$.e && setAttribute(_el$26, "src", _p$.e = _v$8);
@@ -22448,7 +23450,7 @@ function MemberPortal(props) {
22448
23450
  return data.firstName() !== "Member";
22449
23451
  },
22450
23452
  get children() {
22451
- var _el$15 = _tmpl$838(); _el$15.firstChild;
23453
+ var _el$15 = _tmpl$840(); _el$15.firstChild;
22452
23454
  insert(_el$15, () => data.firstName(), null);
22453
23455
  return _el$15;
22454
23456
  }
@@ -22461,7 +23463,7 @@ function MemberPortal(props) {
22461
23463
  return showBackLink();
22462
23464
  },
22463
23465
  get children() {
22464
- var _el$19 = _tmpl$935();
23466
+ var _el$19 = _tmpl$937();
22465
23467
  effect(() => setAttribute(_el$19, "href", catalogHref()));
22466
23468
  return _el$19;
22467
23469
  }
@@ -22472,7 +23474,7 @@ function MemberPortal(props) {
22472
23474
  return showBackLink();
22473
23475
  },
22474
23476
  get children() {
22475
- var _el$21 = _tmpl$031();
23477
+ var _el$21 = _tmpl$033();
22476
23478
  effect(() => setAttribute(_el$21, "href", catalogHref()));
22477
23479
  return _el$21;
22478
23480
  }
@@ -22498,11 +23500,11 @@ function MemberPortal(props) {
22498
23500
  })();
22499
23501
  }
22500
23502
  delegateEvents(["click"]);
22501
- var _tmpl$389 = /* @__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.`);
22502
- var _tmpl$2121 = /* @__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`);
22503
- var _tmpl$390 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading stats\u2026`);
22504
- var _tmpl$464 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));gap:1rem">`);
22505
- var _tmpl$554 = /* @__PURE__ */ template(`<div style="padding:1.25rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius)"><div style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted);margin-bottom:0.5rem></div><div style=font-family:var(--app-affiliate-font-display);font-size:1.75rem;color:var(--app-affiliate-fg)>`);
23503
+ var _tmpl$396 = /* @__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.`);
23504
+ var _tmpl$2123 = /* @__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`);
23505
+ var _tmpl$397 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading stats\u2026`);
23506
+ var _tmpl$466 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));gap:1rem">`);
23507
+ var _tmpl$556 = /* @__PURE__ */ template(`<div style="padding:1.25rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius)"><div style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted);margin-bottom:0.5rem></div><div style=font-family:var(--app-affiliate-font-display);font-size:1.75rem;color:var(--app-affiliate-fg)>`);
22506
23508
  function formatMoney(cents) {
22507
23509
  return `$${(cents / 100).toFixed(2)}`;
22508
23510
  }
@@ -22535,13 +23537,13 @@ function AffiliateOverview() {
22535
23537
  value: `${(s.conversionRate * 100).toFixed(1)}%`
22536
23538
  }];
22537
23539
  return (() => {
22538
- var _el$ = _tmpl$2121(); _el$.firstChild;
23540
+ var _el$ = _tmpl$2123(); _el$.firstChild;
22539
23541
  insert(_el$, createComponent(Show, {
22540
23542
  get when() {
22541
23543
  return isPending();
22542
23544
  },
22543
23545
  get children() {
22544
- return _tmpl$389();
23546
+ return _tmpl$396();
22545
23547
  }
22546
23548
  }), null);
22547
23549
  insert(_el$, createComponent(Show, {
@@ -22549,16 +23551,16 @@ function AffiliateOverview() {
22549
23551
  return stats();
22550
23552
  },
22551
23553
  get fallback() {
22552
- return _tmpl$390();
23554
+ return _tmpl$397();
22553
23555
  },
22554
23556
  children: (s) => (() => {
22555
- var _el$5 = _tmpl$464();
23557
+ var _el$5 = _tmpl$466();
22556
23558
  insert(_el$5, createComponent(For, {
22557
23559
  get each() {
22558
23560
  return cards(s());
22559
23561
  },
22560
23562
  children: (card) => (() => {
22561
- var _el$6 = _tmpl$554(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
23563
+ var _el$6 = _tmpl$556(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
22562
23564
  insert(_el$7, () => card.label);
22563
23565
  insert(_el$8, () => card.value);
22564
23566
  return _el$6;
@@ -22570,15 +23572,15 @@ function AffiliateOverview() {
22570
23572
  return _el$;
22571
23573
  })();
22572
23574
  }
22573
- var _tmpl$391 = /* @__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>`);
22574
- var _tmpl$2122 = /* @__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`);
22575
- var _tmpl$395 = /* @__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.`);
22576
- var _tmpl$465 = /* @__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`);
22577
- var _tmpl$555 = /* @__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">`);
23575
+ var _tmpl$398 = /* @__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>`);
23576
+ var _tmpl$2124 = /* @__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`);
23577
+ var _tmpl$399 = /* @__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.`);
23578
+ var _tmpl$467 = /* @__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`);
23579
+ var _tmpl$557 = /* @__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">`);
22578
23580
  function formatMoney2(cents) {
22579
23581
  return `$${(cents / 100).toFixed(2)}`;
22580
23582
  }
22581
- function formatDate3(iso) {
23583
+ function formatDate4(iso) {
22582
23584
  const d = new Date(iso);
22583
23585
  if (Number.isNaN(d.getTime())) return iso;
22584
23586
  return d.toLocaleDateString("en-US", {
@@ -22612,30 +23614,30 @@ function AffiliateConversions() {
22612
23614
  limit: 100
22613
23615
  });
22614
23616
  return (() => {
22615
- var _el$ = _tmpl$2122(); _el$.firstChild;
23617
+ var _el$ = _tmpl$2124(); _el$.firstChild;
22616
23618
  insert(_el$, createComponent(Show, {
22617
23619
  get when() {
22618
23620
  return (conversions() ?? []).length > 0;
22619
23621
  },
22620
23622
  get fallback() {
22621
- return _tmpl$395();
23623
+ return _tmpl$399();
22622
23624
  },
22623
23625
  get children() {
22624
- var _el$3 = _tmpl$391(), _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;
23626
+ var _el$3 = _tmpl$398(), _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;
22625
23627
  insert(_el$10, createComponent(For, {
22626
23628
  get each() {
22627
23629
  return conversions();
22628
23630
  },
22629
23631
  children: (c) => (() => {
22630
- var _el$12 = _tmpl$555(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling, _el$17 = _el$16.nextSibling, _el$18 = _el$17.nextSibling, _el$19 = _el$18.firstChild;
22631
- insert(_el$13, () => formatDate3(c.createdAt));
23632
+ var _el$12 = _tmpl$557(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling, _el$17 = _el$16.nextSibling, _el$18 = _el$17.nextSibling, _el$19 = _el$18.firstChild;
23633
+ insert(_el$13, () => formatDate4(c.createdAt));
22632
23634
  insert(_el$14, () => c.paymentType, null);
22633
23635
  insert(_el$14, createComponent(Show, {
22634
23636
  get when() {
22635
23637
  return c.tier === 2;
22636
23638
  },
22637
23639
  get children() {
22638
- return _tmpl$465();
23640
+ return _tmpl$467();
22639
23641
  }
22640
23642
  }), null);
22641
23643
  insert(_el$16, () => formatMoney2(c.orderTotalCents));
@@ -22706,11 +23708,11 @@ function td() {
22706
23708
  color: "var(--app-affiliate-fg)"
22707
23709
  };
22708
23710
  }
22709
- var _tmpl$396 = /* @__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>`);
22710
- var _tmpl$2123 = /* @__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.`);
22711
- var _tmpl$397 = /* @__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.`);
22712
- var _tmpl$466 = /* @__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>`);
22713
- function formatDate4(iso) {
23711
+ var _tmpl$400 = /* @__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>`);
23712
+ var _tmpl$2125 = /* @__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.`);
23713
+ var _tmpl$3100 = /* @__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.`);
23714
+ var _tmpl$468 = /* @__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>`);
23715
+ function formatDate5(iso) {
22714
23716
  const d = new Date(iso);
22715
23717
  if (Number.isNaN(d.getTime())) return iso;
22716
23718
  return d.toLocaleDateString("en-US", {
@@ -22742,26 +23744,26 @@ function AffiliateDownline() {
22742
23744
  downline
22743
23745
  } = useAffiliateDownline();
22744
23746
  return (() => {
22745
- var _el$ = _tmpl$2123(), _el$2 = _el$.firstChild; _el$2.nextSibling;
23747
+ var _el$ = _tmpl$2125(), _el$2 = _el$.firstChild; _el$2.nextSibling;
22746
23748
  insert(_el$, createComponent(Show, {
22747
23749
  get when() {
22748
23750
  return (downline() ?? []).length > 0;
22749
23751
  },
22750
23752
  get fallback() {
22751
- return _tmpl$397();
23753
+ return _tmpl$3100();
22752
23754
  },
22753
23755
  get children() {
22754
- var _el$4 = _tmpl$396(), _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;
23756
+ var _el$4 = _tmpl$400(), _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;
22755
23757
  insert(_el$10, createComponent(For, {
22756
23758
  get each() {
22757
23759
  return downline();
22758
23760
  },
22759
23761
  children: (d) => (() => {
22760
- var _el$12 = _tmpl$466(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$15.nextSibling;
23762
+ var _el$12 = _tmpl$468(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$15.nextSibling;
22761
23763
  insert(_el$13, () => d.affiliateCode);
22762
23764
  insert(_el$14, () => [d.firstName, d.lastName].filter(Boolean).join(" ") || "\u2014");
22763
23765
  insert(_el$16, () => d.status);
22764
- insert(_el$17, () => formatDate4(d.createdAt));
23766
+ insert(_el$17, () => formatDate5(d.createdAt));
22765
23767
  effect((_p$) => {
22766
23768
  var _v$5 = {
22767
23769
  ...td2()
@@ -22820,9 +23822,9 @@ function td2() {
22820
23822
  color: "var(--app-affiliate-fg)"
22821
23823
  };
22822
23824
  }
22823
- var _tmpl$398 = /* @__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.`);
22824
- var _tmpl$2124 = /* @__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`);
22825
- var _tmpl$399 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Your referral link will appear here once your account is approved.`);
23825
+ var _tmpl$401 = /* @__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.`);
23826
+ var _tmpl$2126 = /* @__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`);
23827
+ var _tmpl$3101 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Your referral link will appear here once your account is approved.`);
22826
23828
  function AffiliateReferralLink() {
22827
23829
  const {
22828
23830
  links
@@ -22847,16 +23849,16 @@ function AffiliateReferralLink() {
22847
23849
  }
22848
23850
  }
22849
23851
  return (() => {
22850
- var _el$ = _tmpl$2124(); _el$.firstChild;
23852
+ var _el$ = _tmpl$2126(); _el$.firstChild;
22851
23853
  insert(_el$, createComponent(Show, {
22852
23854
  get when() {
22853
23855
  return homepageLink();
22854
23856
  },
22855
23857
  get fallback() {
22856
- return _tmpl$399();
23858
+ return _tmpl$3101();
22857
23859
  },
22858
23860
  get children() {
22859
- var _el$3 = _tmpl$398(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling; _el$5.nextSibling;
23861
+ var _el$3 = _tmpl$401(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling; _el$5.nextSibling;
22860
23862
  insert(_el$6, homepageLink);
22861
23863
  _el$7.$$click = copy;
22862
23864
  insert(_el$7, () => copied() ? "Copied" : "Copy");
@@ -22867,10 +23869,10 @@ function AffiliateReferralLink() {
22867
23869
  })();
22868
23870
  }
22869
23871
  delegateEvents(["click"]);
22870
- var _tmpl$400 = /* @__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.`);
22871
- var _tmpl$2125 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading\u2026`);
22872
- var _tmpl$3100 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden">`);
22873
- var _tmpl$467 = /* @__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)>`);
23872
+ var _tmpl$404 = /* @__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.`);
23873
+ var _tmpl$2127 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading\u2026`);
23874
+ var _tmpl$3102 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden">`);
23875
+ var _tmpl$469 = /* @__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)>`);
22874
23876
  var STATUS_LABEL2 = {
22875
23877
  pending: "Pending approval",
22876
23878
  active: "Active",
@@ -22905,22 +23907,22 @@ function AffiliateSettings() {
22905
23907
  value: a.paymentEmail ?? "\u2014"
22906
23908
  }];
22907
23909
  return (() => {
22908
- var _el$ = _tmpl$400(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild; _el$3.nextSibling;
23910
+ var _el$ = _tmpl$404(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild; _el$3.nextSibling;
22909
23911
  insert(_el$, createComponent(Show, {
22910
23912
  get when() {
22911
23913
  return affiliate();
22912
23914
  },
22913
23915
  get fallback() {
22914
- return _tmpl$2125();
23916
+ return _tmpl$2127();
22915
23917
  },
22916
23918
  children: (a) => (() => {
22917
- var _el$7 = _tmpl$3100();
23919
+ var _el$7 = _tmpl$3102();
22918
23920
  insert(_el$7, createComponent(For, {
22919
23921
  get each() {
22920
23922
  return rows(a());
22921
23923
  },
22922
23924
  children: (row) => (() => {
22923
- var _el$8 = _tmpl$467(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
23925
+ var _el$8 = _tmpl$469(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
22924
23926
  insert(_el$9, () => row.label);
22925
23927
  insert(_el$0, () => row.value);
22926
23928
  return _el$8;
@@ -22936,10 +23938,10 @@ function AffiliateSettings() {
22936
23938
  delegateEvents(["click"]);
22937
23939
 
22938
23940
  // src/pages/AffiliatePortal.tsx
22939
- var _tmpl$401 = /* @__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>`);
22940
- var _tmpl$2126 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
22941
- var _tmpl$3101 = /* @__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">`);
22942
- var _tmpl$468 = /* @__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); } }`);
23941
+ var _tmpl$405 = /* @__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>`);
23942
+ var _tmpl$2128 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
23943
+ var _tmpl$3103 = /* @__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">`);
23944
+ var _tmpl$470 = /* @__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); } }`);
22943
23945
  var TAB_LABELS2 = {
22944
23946
  overview: "Overview",
22945
23947
  conversions: "Conversions",
@@ -22984,7 +23986,7 @@ function AffiliatePortal(props) {
22984
23986
  });
22985
23987
  },
22986
23988
  get children() {
22987
- var _el$ = _tmpl$401(), _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;
23989
+ var _el$ = _tmpl$405(), _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;
22988
23990
  _el$3.$$click = () => setDrawerOpen(true);
22989
23991
  insert(_el$4, () => TAB_LABELS2[currentTab()]);
22990
23992
  _el$5.$$click = () => setDrawerOpen(false);
@@ -22993,14 +23995,14 @@ function AffiliatePortal(props) {
22993
23995
  return orderedTabs();
22994
23996
  },
22995
23997
  children: (tab) => (() => {
22996
- var _el$1 = _tmpl$3101();
23998
+ var _el$1 = _tmpl$3103();
22997
23999
  _el$1.$$click = () => handleTabClick(tab);
22998
24000
  insert(_el$1, createComponent(Show, {
22999
24001
  get when() {
23000
24002
  return props.tabIcons?.[tab];
23001
24003
  },
23002
24004
  get children() {
23003
- var _el$10 = _tmpl$2126();
24005
+ var _el$10 = _tmpl$2128();
23004
24006
  effect(() => className(_el$10, props.tabIcons[tab]));
23005
24007
  return _el$10;
23006
24008
  }
@@ -23082,7 +24084,7 @@ function AffiliatePortal(props) {
23082
24084
  }
23083
24085
  function AffiliateGateSpinner(props) {
23084
24086
  return (() => {
23085
- var _el$11 = _tmpl$468(); _el$11.firstChild;
24087
+ var _el$11 = _tmpl$470(); _el$11.firstChild;
23086
24088
  effect((_p$) => {
23087
24089
  var _v$8 = props.topOffset, _v$9 = `calc(100vh - ${props.topOffset})`;
23088
24090
  _v$8 !== _p$.e && setStyleProperty(_el$11, "top", _p$.e = _v$8);
@@ -23096,11 +24098,11 @@ function AffiliateGateSpinner(props) {
23096
24098
  })();
23097
24099
  }
23098
24100
  delegateEvents(["click"]);
23099
- var _tmpl$404 = /* @__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">`);
24101
+ var _tmpl$406 = /* @__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">`);
23100
24102
  function AffiliatePasswordInput(props) {
23101
24103
  const [visible, setVisible] = createSignal(false);
23102
24104
  return (() => {
23103
- var _el$ = _tmpl$404(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
24105
+ var _el$ = _tmpl$406(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
23104
24106
  _el$2.$$input = (e) => props.onInput(e.currentTarget.value);
23105
24107
  _el$3.$$click = () => setVisible((v) => !v);
23106
24108
  insert(_el$3, () => visible() ? "Hide" : "Show");
@@ -23141,17 +24143,17 @@ function inputStyle() {
23141
24143
  delegateEvents(["input", "click"]);
23142
24144
 
23143
24145
  // src/pages/AffiliateRegister.tsx
23144
- var _tmpl$405 = /* @__PURE__ */ template(`<input type=text required autocomplete=given-name>`);
23145
- var _tmpl$2127 = /* @__PURE__ */ template(`<input type=text required autocomplete=family-name>`);
23146
- var _tmpl$3102 = /* @__PURE__ */ template(`<input type=email required autocomplete=email>`);
23147
- var _tmpl$469 = /* @__PURE__ */ template(`<input type=text required minlength=4>`);
23148
- var _tmpl$556 = /* @__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">`);
23149
- var _tmpl$651 = /* @__PURE__ */ template(`<button type=button>Already have an account? Log in`);
23150
- var _tmpl$745 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-surface-light);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius-sm);font-size:0.8125rem;line-height:1.5;color:var(--app-affiliate-fg-muted)">A customer's purchase earns you commission only if they reached the site through your referral link \u2014 the site address with <code>?ref=</code> appended:<div style=font-weight:600;word-break:break-all;margin-top:0.25rem;color:var(--app-affiliate-fg)>/?ref=</div>Make sure any marketing materials use that full link for tracking, not just the website address itself.</div><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">`);
23151
- var _tmpl$839 = /* @__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:28rem;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"><div><h1 style="font-family:var(--app-affiliate-font-display);margin:0 0 0.5rem;font-size:1.5rem">Become an affiliate</h1><p style=margin:0;color:var(--app-affiliate-fg-muted);font-size:0.875rem>New applications are reviewed by an admin before activation.`);
23152
- var _tmpl$936 = /* @__PURE__ */ template(`<div style=padding:1rem;background:var(--app-affiliate-success-bg);color:var(--app-affiliate-success-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem>Thanks \u2014 we received your application. You'll be able to log in once it's approved.`);
23153
- var _tmpl$032 = /* @__PURE__ */ template(`<span style=font-size:0.75rem;color:var(--app-affiliate-fg-subtle)>`);
23154
- var _tmpl$1127 = /* @__PURE__ */ template(`<label style=display:flex;flex-direction:column;gap:0.35rem><span style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted)>`);
24146
+ var _tmpl$407 = /* @__PURE__ */ template(`<input type=text required autocomplete=given-name>`);
24147
+ var _tmpl$2129 = /* @__PURE__ */ template(`<input type=text required autocomplete=family-name>`);
24148
+ var _tmpl$3104 = /* @__PURE__ */ template(`<input type=email required autocomplete=email>`);
24149
+ var _tmpl$471 = /* @__PURE__ */ template(`<input type=text required minlength=4>`);
24150
+ var _tmpl$558 = /* @__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">`);
24151
+ var _tmpl$652 = /* @__PURE__ */ template(`<button type=button>Already have an account? Log in`);
24152
+ var _tmpl$746 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-surface-light);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius-sm);font-size:0.8125rem;line-height:1.5;color:var(--app-affiliate-fg-muted)">A customer's purchase earns you commission only if they reached the site through your referral link \u2014 the site address with <code>?ref=</code> appended:<div style=font-weight:600;word-break:break-all;margin-top:0.25rem;color:var(--app-affiliate-fg)>/?ref=</div>Make sure any marketing materials use that full link for tracking, not just the website address itself.</div><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">`);
24153
+ var _tmpl$841 = /* @__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:28rem;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"><div><h1 style="font-family:var(--app-affiliate-font-display);margin:0 0 0.5rem;font-size:1.5rem">Become an affiliate</h1><p style=margin:0;color:var(--app-affiliate-fg-muted);font-size:0.875rem>New applications are reviewed by an admin before activation.`);
24154
+ var _tmpl$938 = /* @__PURE__ */ template(`<div style=padding:1rem;background:var(--app-affiliate-success-bg);color:var(--app-affiliate-success-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem>Thanks \u2014 we received your application. You'll be able to log in once it's approved.`);
24155
+ var _tmpl$034 = /* @__PURE__ */ template(`<span style=font-size:0.75rem;color:var(--app-affiliate-fg-subtle)>`);
24156
+ var _tmpl$1131 = /* @__PURE__ */ template(`<label style=display:flex;flex-direction:column;gap:0.35rem><span style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted)>`);
23155
24157
  function AffiliateRegister(props) {
23156
24158
  const [firstName, setFirstName] = createSignal("");
23157
24159
  const [lastName, setLastName] = createSignal("");
@@ -23182,48 +24184,48 @@ function AffiliateRegister(props) {
23182
24184
  }
23183
24185
  }
23184
24186
  return (() => {
23185
- var _el$ = _tmpl$839(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild; _el$4.nextSibling;
24187
+ var _el$ = _tmpl$841(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild; _el$4.nextSibling;
23186
24188
  insert(_el$2, createComponent(Show, {
23187
24189
  get when() {
23188
24190
  return !submitted();
23189
24191
  },
23190
24192
  get fallback() {
23191
- return _tmpl$936();
24193
+ return _tmpl$938();
23192
24194
  },
23193
24195
  get children() {
23194
- var _el$6 = _tmpl$745(), _el$1 = _el$6.firstChild, _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling; _el$12.firstChild; var _el$14 = _el$12.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$18 = _el$1.nextSibling;
24196
+ var _el$6 = _tmpl$746(), _el$1 = _el$6.firstChild, _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling; _el$12.firstChild; var _el$14 = _el$12.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$18 = _el$1.nextSibling;
23195
24197
  _el$6.addEventListener("submit", handleSubmit);
23196
- insert(_el$6, createComponent(Row, {
24198
+ insert(_el$6, createComponent(Row2, {
23197
24199
  label: "First name",
23198
24200
  get children() {
23199
- var _el$7 = _tmpl$405();
24201
+ var _el$7 = _tmpl$407();
23200
24202
  _el$7.$$input = (e) => setFirstName(e.currentTarget.value);
23201
24203
  effect((_$p) => style(_el$7, inputStyle2(), _$p));
23202
24204
  effect(() => _el$7.value = firstName());
23203
24205
  return _el$7;
23204
24206
  }
23205
24207
  }), _el$1);
23206
- insert(_el$6, createComponent(Row, {
24208
+ insert(_el$6, createComponent(Row2, {
23207
24209
  label: "Last name",
23208
24210
  get children() {
23209
- var _el$8 = _tmpl$2127();
24211
+ var _el$8 = _tmpl$2129();
23210
24212
  _el$8.$$input = (e) => setLastName(e.currentTarget.value);
23211
24213
  effect((_$p) => style(_el$8, inputStyle2(), _$p));
23212
24214
  effect(() => _el$8.value = lastName());
23213
24215
  return _el$8;
23214
24216
  }
23215
24217
  }), _el$1);
23216
- insert(_el$6, createComponent(Row, {
24218
+ insert(_el$6, createComponent(Row2, {
23217
24219
  label: "Email",
23218
24220
  get children() {
23219
- var _el$9 = _tmpl$3102();
24221
+ var _el$9 = _tmpl$3104();
23220
24222
  _el$9.$$input = (e) => setEmail(e.currentTarget.value);
23221
24223
  effect((_$p) => style(_el$9, inputStyle2(), _$p));
23222
24224
  effect(() => _el$9.value = email());
23223
24225
  return _el$9;
23224
24226
  }
23225
24227
  }), _el$1);
23226
- insert(_el$6, createComponent(Row, {
24228
+ insert(_el$6, createComponent(Row2, {
23227
24229
  label: "Password",
23228
24230
  hint: "At least 8 characters",
23229
24231
  get children() {
@@ -23238,11 +24240,11 @@ function AffiliateRegister(props) {
23238
24240
  });
23239
24241
  }
23240
24242
  }), _el$1);
23241
- insert(_el$6, createComponent(Row, {
24243
+ insert(_el$6, createComponent(Row2, {
23242
24244
  label: "Affiliate code",
23243
24245
  hint: "The handle in your referral URL (4+ characters)",
23244
24246
  get children() {
23245
- var _el$0 = _tmpl$469();
24247
+ var _el$0 = _tmpl$471();
23246
24248
  _el$0.$$input = (e) => setAffiliateCode(e.currentTarget.value);
23247
24249
  effect((_$p) => style(_el$0, inputStyle2(), _$p));
23248
24250
  effect(() => _el$0.value = affiliateCode());
@@ -23257,7 +24259,7 @@ function AffiliateRegister(props) {
23257
24259
  return error();
23258
24260
  },
23259
24261
  get children() {
23260
- var _el$17 = _tmpl$556();
24262
+ var _el$17 = _tmpl$558();
23261
24263
  insert(_el$17, error);
23262
24264
  return _el$17;
23263
24265
  }
@@ -23268,7 +24270,7 @@ function AffiliateRegister(props) {
23268
24270
  return props.onNavigateLogin;
23269
24271
  },
23270
24272
  get children() {
23271
- var _el$19 = _tmpl$651();
24273
+ var _el$19 = _tmpl$652();
23272
24274
  _el$19.$$click = () => props.onNavigateLogin?.();
23273
24275
  effect((_$p) => style(_el$19, linkStyle(), _$p));
23274
24276
  return _el$19;
@@ -23291,9 +24293,9 @@ function AffiliateRegister(props) {
23291
24293
  return _el$;
23292
24294
  })();
23293
24295
  }
23294
- function Row(props) {
24296
+ function Row2(props) {
23295
24297
  return (() => {
23296
- var _el$21 = _tmpl$1127(), _el$22 = _el$21.firstChild;
24298
+ var _el$21 = _tmpl$1131(), _el$22 = _el$21.firstChild;
23297
24299
  insert(_el$22, () => props.label);
23298
24300
  insert(_el$21, () => props.children, null);
23299
24301
  insert(_el$21, createComponent(Show, {
@@ -23301,7 +24303,7 @@ function Row(props) {
23301
24303
  return props.hint;
23302
24304
  },
23303
24305
  get children() {
23304
- var _el$23 = _tmpl$032();
24306
+ var _el$23 = _tmpl$034();
23305
24307
  insert(_el$23, () => props.hint);
23306
24308
  return _el$23;
23307
24309
  }
@@ -23335,10 +24337,10 @@ function linkStyle() {
23335
24337
  };
23336
24338
  }
23337
24339
  delegateEvents(["input", "click"]);
23338
- var _tmpl$406 = /* @__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">`);
23339
- var _tmpl$2128 = /* @__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?`);
23340
- var _tmpl$3103 = /* @__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`);
23341
- var _tmpl$470 = /* @__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">`);
24340
+ var _tmpl$408 = /* @__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">`);
24341
+ var _tmpl$2130 = /* @__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?`);
24342
+ var _tmpl$3105 = /* @__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`);
24343
+ var _tmpl$473 = /* @__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">`);
23342
24344
  function AffiliateLogin(props) {
23343
24345
  const [email, setEmail] = createSignal("");
23344
24346
  const [password, setPassword] = createSignal("");
@@ -23358,7 +24360,7 @@ function AffiliateLogin(props) {
23358
24360
  }
23359
24361
  }
23360
24362
  return (() => {
23361
- var _el$ = _tmpl$470(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _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$1 = _el$8.nextSibling;
24363
+ var _el$ = _tmpl$473(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _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$1 = _el$8.nextSibling;
23362
24364
  _el$4.addEventListener("submit", handleSubmit);
23363
24365
  _el$7.$$input = (e) => setEmail(e.currentTarget.value);
23364
24366
  insert(_el$8, createComponent(AffiliatePasswordInput, {
@@ -23374,7 +24376,7 @@ function AffiliateLogin(props) {
23374
24376
  return error();
23375
24377
  },
23376
24378
  get children() {
23377
- var _el$0 = _tmpl$406();
24379
+ var _el$0 = _tmpl$408();
23378
24380
  insert(_el$0, error);
23379
24381
  return _el$0;
23380
24382
  }
@@ -23385,7 +24387,7 @@ function AffiliateLogin(props) {
23385
24387
  return props.onNavigateForgotPassword;
23386
24388
  },
23387
24389
  get children() {
23388
- var _el$10 = _tmpl$2128();
24390
+ var _el$10 = _tmpl$2130();
23389
24391
  _el$10.$$click = () => props.onNavigateForgotPassword?.();
23390
24392
  return _el$10;
23391
24393
  }
@@ -23395,7 +24397,7 @@ function AffiliateLogin(props) {
23395
24397
  return props.onNavigateRegister;
23396
24398
  },
23397
24399
  get children() {
23398
- var _el$11 = _tmpl$3103();
24400
+ var _el$11 = _tmpl$3105();
23399
24401
  _el$11.$$click = () => props.onNavigateRegister?.();
23400
24402
  return _el$11;
23401
24403
  }
@@ -23443,12 +24445,12 @@ function inputStyle3() {
23443
24445
  };
23444
24446
  }
23445
24447
  delegateEvents(["input", "click"]);
23446
- var _tmpl$407 = /* @__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">`);
23447
- var _tmpl$2129 = /* @__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">`);
23448
- var _tmpl$3104 = /* @__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`);
23449
- var _tmpl$471 = /* @__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">`);
23450
- var _tmpl$557 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.8125rem;opacity:0.8>The link is good for one hour. If nothing arrives, check your spam folder \u2014 and make sure this is the address you signed up with.`);
23451
- var _tmpl$652 = /* @__PURE__ */ template(`<button type=button 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;cursor:pointer">Back to sign in`);
24448
+ var _tmpl$409 = /* @__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">`);
24449
+ var _tmpl$2131 = /* @__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">`);
24450
+ var _tmpl$3106 = /* @__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`);
24451
+ var _tmpl$474 = /* @__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">`);
24452
+ var _tmpl$559 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.8125rem;opacity:0.8>The link is good for one hour. If nothing arrives, check your spam folder \u2014 and make sure this is the address you signed up with.`);
24453
+ var _tmpl$653 = /* @__PURE__ */ template(`<button type=button 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;cursor:pointer">Back to sign in`);
23452
24454
  function ForgotPasswordPage(props) {
23453
24455
  const [email, setEmail] = createSignal("");
23454
24456
  const [submitting, setSubmitting] = createSignal(false);
@@ -23471,29 +24473,29 @@ function ForgotPasswordPage(props) {
23471
24473
  }
23472
24474
  }
23473
24475
  return (() => {
23474
- var _el$ = _tmpl$3104(), _el$2 = _el$.firstChild; _el$2.firstChild;
24476
+ var _el$ = _tmpl$3106(), _el$2 = _el$.firstChild; _el$2.firstChild;
23475
24477
  insert(_el$2, createComponent(Show, {
23476
24478
  get when() {
23477
24479
  return !message();
23478
24480
  },
23479
24481
  get fallback() {
23480
24482
  return [(() => {
23481
- var _el$0 = _tmpl$471();
24483
+ var _el$0 = _tmpl$474();
23482
24484
  insert(_el$0, message);
23483
24485
  return _el$0;
23484
- })(), _tmpl$557(), createComponent(Show, {
24486
+ })(), _tmpl$559(), createComponent(Show, {
23485
24487
  get when() {
23486
24488
  return props.onDone;
23487
24489
  },
23488
24490
  get children() {
23489
- var _el$10 = _tmpl$652();
24491
+ var _el$10 = _tmpl$653();
23490
24492
  _el$10.$$click = () => props.onDone?.();
23491
24493
  return _el$10;
23492
24494
  }
23493
24495
  })];
23494
24496
  },
23495
24497
  get children() {
23496
- var _el$4 = _tmpl$2129(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
24498
+ var _el$4 = _tmpl$2131(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
23497
24499
  _el$4.addEventListener("submit", handleSubmit);
23498
24500
  _el$7.$$input = (e) => setEmail(e.currentTarget.value);
23499
24501
  insert(_el$4, createComponent(Show, {
@@ -23501,7 +24503,7 @@ function ForgotPasswordPage(props) {
23501
24503
  return error();
23502
24504
  },
23503
24505
  get children() {
23504
- var _el$8 = _tmpl$407();
24506
+ var _el$8 = _tmpl$409();
23505
24507
  insert(_el$8, error);
23506
24508
  return _el$8;
23507
24509
  }
@@ -23551,10 +24553,10 @@ function inputStyle4() {
23551
24553
  };
23552
24554
  }
23553
24555
  delegateEvents(["input", "click"]);
23554
- var _tmpl$408 = /* @__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">`);
23555
- var _tmpl$2130 = /* @__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">`);
23556
- var _tmpl$3105 = /* @__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`);
23557
- var _tmpl$473 = /* @__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">`);
24556
+ var _tmpl$475 = /* @__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">`);
24557
+ var _tmpl$2132 = /* @__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">`);
24558
+ var _tmpl$3107 = /* @__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`);
24559
+ var _tmpl$476 = /* @__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">`);
23558
24560
  function queryParam(name) {
23559
24561
  if (typeof window === "undefined") return "";
23560
24562
  return new URLSearchParams(window.location.search).get(name) ?? "";
@@ -23594,20 +24596,20 @@ function ResetPasswordPage(props) {
23594
24596
  }
23595
24597
  }
23596
24598
  return (() => {
23597
- var _el$ = _tmpl$3105(), _el$2 = _el$.firstChild; _el$2.firstChild;
24599
+ var _el$ = _tmpl$3107(), _el$2 = _el$.firstChild; _el$2.firstChild;
23598
24600
  insert(_el$2, createComponent(Show, {
23599
24601
  get when() {
23600
24602
  return !message();
23601
24603
  },
23602
24604
  get fallback() {
23603
24605
  return (() => {
23604
- var _el$11 = _tmpl$473();
24606
+ var _el$11 = _tmpl$476();
23605
24607
  insert(_el$11, message);
23606
24608
  return _el$11;
23607
24609
  })();
23608
24610
  },
23609
24611
  get children() {
23610
- var _el$4 = _tmpl$2130(), _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;
24612
+ var _el$4 = _tmpl$2132(), _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;
23611
24613
  _el$4.addEventListener("submit", handleSubmit);
23612
24614
  _el$7.$$input = (e) => setPassword(e.currentTarget.value);
23613
24615
  _el$0.$$input = (e) => setConfirm(e.currentTarget.value);
@@ -23616,7 +24618,7 @@ function ResetPasswordPage(props) {
23616
24618
  return error();
23617
24619
  },
23618
24620
  get children() {
23619
- var _el$1 = _tmpl$408();
24621
+ var _el$1 = _tmpl$475();
23620
24622
  insert(_el$1, error);
23621
24623
  return _el$1;
23622
24624
  }
@@ -23671,11 +24673,11 @@ function inputStyle5() {
23671
24673
  };
23672
24674
  }
23673
24675
  delegateEvents(["input"]);
23674
- var _tmpl$409 = /* @__PURE__ */ template(`<div>`);
23675
- var _tmpl$2131 = /* @__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>`);
23676
- var _tmpl$3106 = /* @__PURE__ */ template(`<button type=button>Back to login`);
23677
- var _tmpl$474 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Reset your password`);
23678
- var _tmpl$558 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>`);
24676
+ var _tmpl$477 = /* @__PURE__ */ template(`<div>`);
24677
+ var _tmpl$2133 = /* @__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>`);
24678
+ var _tmpl$3108 = /* @__PURE__ */ template(`<button type=button>Back to login`);
24679
+ var _tmpl$478 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Reset your password`);
24680
+ var _tmpl$560 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>`);
23679
24681
  function AffiliateForgotPassword(props) {
23680
24682
  const [email, setEmail] = createSignal("");
23681
24683
  const [submitting, setSubmitting] = createSignal(false);
@@ -23698,20 +24700,20 @@ function AffiliateForgotPassword(props) {
23698
24700
  }
23699
24701
  }
23700
24702
  return (() => {
23701
- var _el$ = _tmpl$474(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
24703
+ var _el$ = _tmpl$478(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
23702
24704
  insert(_el$2, createComponent(Show, {
23703
24705
  get when() {
23704
24706
  return !message();
23705
24707
  },
23706
24708
  get fallback() {
23707
24709
  return (() => {
23708
- var _el$1 = _tmpl$558();
24710
+ var _el$1 = _tmpl$560();
23709
24711
  insert(_el$1, message);
23710
24712
  return _el$1;
23711
24713
  })();
23712
24714
  },
23713
24715
  get children() {
23714
- var _el$4 = _tmpl$2131(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
24716
+ var _el$4 = _tmpl$2133(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
23715
24717
  _el$4.addEventListener("submit", handleSubmit);
23716
24718
  _el$7.$$input = (e) => setEmail(e.currentTarget.value);
23717
24719
  insert(_el$4, createComponent(Show, {
@@ -23719,7 +24721,7 @@ function AffiliateForgotPassword(props) {
23719
24721
  return error();
23720
24722
  },
23721
24723
  get children() {
23722
- var _el$8 = _tmpl$409();
24724
+ var _el$8 = _tmpl$477();
23723
24725
  insert(_el$8, error);
23724
24726
  effect((_$p) => style(_el$8, errorStyle(), _$p));
23725
24727
  return _el$8;
@@ -23748,7 +24750,7 @@ function AffiliateForgotPassword(props) {
23748
24750
  return props.onNavigateLogin;
23749
24751
  },
23750
24752
  get children() {
23751
- var _el$0 = _tmpl$3106();
24753
+ var _el$0 = _tmpl$3108();
23752
24754
  _el$0.$$click = () => props.onNavigateLogin?.();
23753
24755
  effect((_$p) => style(_el$0, linkStyle2(), _$p));
23754
24756
  return _el$0;
@@ -23854,10 +24856,10 @@ function linkStyle2() {
23854
24856
  };
23855
24857
  }
23856
24858
  delegateEvents(["input", "click"]);
23857
- var _tmpl$475 = /* @__PURE__ */ template(`<div>`);
23858
- var _tmpl$2132 = /* @__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>`);
23859
- var _tmpl$3107 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Choose a new password`);
23860
- var _tmpl$476 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>Your password has been reset. You can now log in with your new password.`);
24859
+ var _tmpl$479 = /* @__PURE__ */ template(`<div>`);
24860
+ var _tmpl$2134 = /* @__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>`);
24861
+ var _tmpl$3109 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Choose a new password`);
24862
+ var _tmpl$480 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>Your password has been reset. You can now log in with your new password.`);
23861
24863
  function queryParam2(name) {
23862
24864
  if (typeof window === "undefined") return "";
23863
24865
  return new URLSearchParams(window.location.search).get(name) ?? "";
@@ -23901,16 +24903,16 @@ function AffiliateResetPassword(props) {
23901
24903
  }
23902
24904
  }
23903
24905
  return (() => {
23904
- var _el$ = _tmpl$3107(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
24906
+ var _el$ = _tmpl$3109(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
23905
24907
  insert(_el$2, createComponent(Show, {
23906
24908
  get when() {
23907
24909
  return !done();
23908
24910
  },
23909
24911
  get fallback() {
23910
- return _tmpl$476();
24912
+ return _tmpl$480();
23911
24913
  },
23912
24914
  get children() {
23913
- var _el$4 = _tmpl$2132(), _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;
24915
+ var _el$4 = _tmpl$2134(), _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;
23914
24916
  _el$4.addEventListener("submit", handleSubmit);
23915
24917
  insert(_el$5, createComponent(AffiliatePasswordInput, {
23916
24918
  required: true,
@@ -23935,7 +24937,7 @@ function AffiliateResetPassword(props) {
23935
24937
  return error();
23936
24938
  },
23937
24939
  get children() {
23938
- var _el$9 = _tmpl$475();
24940
+ var _el$9 = _tmpl$479();
23939
24941
  insert(_el$9, error);
23940
24942
  effect((_$p) => style(_el$9, errorStyle2(), _$p));
23941
24943
  return _el$9;
@@ -24034,5 +25036,5 @@ function primaryButtonStyle2(submitting) {
24034
25036
  }
24035
25037
 
24036
25038
  export { ADMIN_TAB_SEGMENTS, AFFILIATE_SUB_TAB_SEGMENTS, AddressFields, AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod, adminTabFromPath, adminTabPath, affiliateSubTabFromPath, affiliateSubTabPath };
24037
- //# sourceMappingURL=HYLIHVIE.js.map
24038
- //# sourceMappingURL=HYLIHVIE.js.map
25039
+ //# sourceMappingURL=MCSS436N.js.map
25040
+ //# sourceMappingURL=MCSS436N.js.map