@apextelemed/partner-core 0.6.1 → 0.6.3

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.
@@ -15130,7 +15130,7 @@ function toInput(t) {
15130
15130
  closingText: t.closingText
15131
15131
  };
15132
15132
  }
15133
- function EmailTemplates() {
15133
+ function EmailTemplates(props = {}) {
15134
15134
  const [refreshKey, setRefreshKey] = createSignal(0);
15135
15135
  const [placeholders, setPlaceholders] = createSignal({});
15136
15136
  const [customTemplates, setCustomTemplates] = createSignal([]);
@@ -15165,7 +15165,10 @@ function EmailTemplates() {
15165
15165
  });
15166
15166
  return groups;
15167
15167
  };
15168
- const [selection, setSelection] = createSignal({
15168
+ const [selection, setSelection] = createSignal(props.initialCustomTemplateId ? {
15169
+ kind: "custom",
15170
+ id: props.initialCustomTemplateId
15171
+ } : {
15169
15172
  kind: "fixed",
15170
15173
  key: ""
15171
15174
  });
@@ -15202,6 +15205,14 @@ function EmailTemplates() {
15202
15205
  });
15203
15206
  }
15204
15207
  };
15208
+ createEffect(() => {
15209
+ const s = selection();
15210
+ const list = customTemplates();
15211
+ if (s.kind === "custom" && s.id && !customDraft()) {
15212
+ const saved = list.find((c) => c.id === s.id);
15213
+ if (saved) setCustomDraft(toInput(saved));
15214
+ }
15215
+ });
15205
15216
  const currentDraft = () => {
15206
15217
  ensureDraft();
15207
15218
  const d = draft();
@@ -15651,38 +15662,46 @@ function daysAgo(iso) {
15651
15662
  }
15652
15663
 
15653
15664
  // src/pages/admin/Sequences.tsx
15654
- var _tmpl$287 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">Send all due`);
15665
+ var _tmpl$287 = /* @__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.`);
15655
15666
  var _tmpl$288 = /* @__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>`);
15656
- var _tmpl$355 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><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>Waiting to send</h2><p style="font-size:0.75rem;margin:0.25rem 0 0">`);
15667
+ var _tmpl$355 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">Send all due`);
15657
15668
  var _tmpl$442 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit>`);
15658
- var _tmpl$537 = /* @__PURE__ */ template(`<tr><td data-label=Person></td><td data-label="Came from"></td><td data-label=Waiting></td><td data-label=Step>Step <!> of </td><td><div style=display:flex;gap:0.375rem;flex-wrap:wrap><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-sm"title="Move past this step without emailing. They stay in the sequence for the next one.">Skip`);
15669
+ var _tmpl$537 = /* @__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`);
15659
15670
  var _tmpl$635 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.75rem>No sequences yet \u2014 create one in the Sequences tab.`);
15660
15671
  var _tmpl$733 = /* @__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">`);
15661
15672
  var _tmpl$828 = /* @__PURE__ */ template(`<option>`);
15662
- var _tmpl$925 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Remove step`);
15663
- var _tmpl$021 = /* @__PURE__ */ template(`<option>(deleted template)`);
15664
- var _tmpl$1101 = /* @__PURE__ */ template(`<select class=app-admin-input><option value>Choose a template\u2026`);
15665
- var _tmpl$1014 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:1rem;display:grid;gap:1rem><div style=display:flex;justify-content:space-between;align-items:center><strong style=font-size:0.875rem>Step </strong><div style=display:flex;gap:0.375rem><button type=button class="app-admin-btn app-admin-btn-sm">Send me a test</button></div></div><div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(12rem, 1fr));gap:0.75rem"><label><span></span><input class=app-admin-input type=number min=1 max=720></label><label><span>Template</span></label><label><span>Link ({{link}})</span><select class=app-admin-input>`);
15666
- var _tmpl$1116 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-sm">Open Email \u203A Templates`);
15667
- var _tmpl$1213 = /* @__PURE__ */ template(`<div style=display:flex;gap:0.5rem;align-items:center;flex-wrap:wrap><span class=app-admin-text-muted style=font-size:0.8125rem>Create one under Email \u203A Templates first.`);
15668
- var _tmpl$1313 = /* @__PURE__ */ template(`<div style="padding:0 1.25rem">`);
15669
- var _tmpl$1413 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(14rem, 1fr));gap:0.75rem"><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 switching a feed on never mails months-old accounts. Add those by hand from the Funnel tab if you want them.</span></label><label style=font-size:0.8125rem;display:flex;gap:0.375rem;align-items:center><input type=checkbox>Skip people whose questionnaire did not qualify`);
15670
- var _tmpl$1513 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-danger-fg);font-size:0.8125rem;margin:0>`);
15671
- var _tmpl$1613 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-danger app-admin-btn-sm">Archive`);
15672
- var _tmpl$1713 = /* @__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>`);
15673
- var _tmpl$1812 = /* @__PURE__ */ template(`<div style="border-top:1px solid var(--app-admin-border-soft)"><div style="padding:0.75rem 1.25rem"><strong style=font-size:0.875rem>In this sequence \u2014 `);
15674
- var _tmpl$1912 = /* @__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"><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0></h2><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Back to list</button></div><div style="padding:1rem 1.25rem;display:grid;gap:1rem"><div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(14rem, 1fr));gap:0.75rem"><label><span>Name</span><input class=app-admin-input maxlength=120 placeholder="Finish your visit"></label><label><span>Description (internal)</span><input class=app-admin-input maxlength=500></label></div><div><button type=button class="app-admin-btn app-admin-btn-sm">Add a step</button></div><div class=app-admin-card-soft style=padding:1rem;display:grid;gap:0.75rem><strong style=font-size:0.875rem>Who gets enrolled</strong><p class=app-admin-text-muted style=font-size:0.75rem;margin:0>People you add from the Funnel tab are always enrolled. Tick segments below and the hourly check also enrolls anyone who enters them \u2014 and removes them when they leave. Their clock starts from their own entry.</p></div><div class=app-admin-card-soft style=padding:1rem;display:grid;gap:0.5rem><strong style=font-size:0.875rem>How emails go out</strong><label style=font-size:0.8125rem;display:flex;gap:0.375rem;align-items:center><input type=checkbox>Send automatically when a step is due</label><p class=app-admin-text-muted style=font-size:0.75rem;margin:0></p></div><div style=display:flex;gap:0.5rem;align-items:center><button type=button class="app-admin-btn app-admin-btn-primary">`);
15675
- var _tmpl$2010 = /* @__PURE__ */ template(`<div><div style=margin-bottom:0.25rem></div><div style="display:flex;flex-wrap:wrap;gap:0.5rem 1rem">`);
15676
- var _tmpl$2115 = /* @__PURE__ */ template(`<label style=font-size:0.8125rem;display:flex;gap:0.375rem;align-items:center><input type=checkbox>`);
15677
- var _tmpl$2212 = /* @__PURE__ */ template(`<tr><td data-label=Person><div class=app-admin-text-muted style=font-size:0.75rem> \xB7 </div></td><td data-label="Came from"></td><td data-label=Step> of </td><td data-label="Next due"class=app-admin-text-muted></td><td><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Remove`);
15678
- var _tmpl$2311 = /* @__PURE__ */ template(`<div>`);
15679
- var _tmpl$2411 = /* @__PURE__ */ template(`<table class=app-admin-table><thead><tr><th>Name</th><th>Steps</th><th>Fed by</th><th>Sending</th><th>In it</th><th>Due now</th><th>Sent</th><th>Bought</th><th>Unsubscribed</th></tr></thead><tbody>`);
15680
- var _tmpl$2511 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><div style="padding:1rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft);display:flex;justify-content:space-between;align-items:center"><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0>Sequences</h2><button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">New sequence`);
15681
- var _tmpl$2610 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
15682
- var _tmpl$2710 = /* @__PURE__ */ template(`<tr><td data-label=Name><button type=button class=app-admin-link-btn style=font-size:inherit;font-weight:600></button></td><td data-label=Steps></td><td data-label="Fed by"></td><td data-label=Sending></td><td data-label="In it"></td><td data-label="Due now"></td><td data-label=Sent></td><td data-label=Bought></td><td data-label=Unsubscribed>`);
15683
- var _tmpl$289 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>by hand`);
15684
- var _tmpl$295 = /* @__PURE__ */ template(`<strong>`);
15685
- var _tmpl$305 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>0`);
15673
+ var _tmpl$925 = /* @__PURE__ */ template(`<option>(deleted template)`);
15674
+ var _tmpl$021 = /* @__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`);
15675
+ var _tmpl$1101 = /* @__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.`);
15676
+ var _tmpl$1014 = /* @__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>`);
15677
+ var _tmpl$1116 = /* @__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">`);
15678
+ var _tmpl$1213 = /* @__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>`);
15679
+ var _tmpl$1313 = /* @__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.`);
15680
+ var _tmpl$1413 = /* @__PURE__ */ template(`<label style=font-size:0.8125rem;display:flex;gap:0.375rem;align-items:center><input type=checkbox>Skip people whose questionnaire did not qualify`);
15681
+ var _tmpl$1513 = /* @__PURE__ */ template(`<div style=display:grid;gap:0.75rem><p class=app-admin-text-muted style=font-size:0.75rem;margin:0>Anyone you add from the Funnel tab. Tick segments to also enroll whoever enters them (the hourly check adds and removes them; their clock starts at their own entry).`);
15682
+ var _tmpl$1613 = /* @__PURE__ */ template(`<div style=max-width:40rem>`);
15683
+ var _tmpl$1713 = /* @__PURE__ */ template(`<div><nav role=tablist aria-label="Sequence sections"style="display:flex;gap:0.25rem;border-bottom:1px solid var(--app-admin-border);margin:1rem 0 1.25rem">`);
15684
+ var _tmpl$1812 = /* @__PURE__ */ template(`<span style=text-transform:none>`);
15685
+ var _tmpl$1912 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"style=text-transform:none>`);
15686
+ var _tmpl$2010 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"style=text-transform:none> in it`);
15687
+ var _tmpl$2115 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Archive`);
15688
+ var _tmpl$2212 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary">`);
15689
+ var _tmpl$2311 = /* @__PURE__ */ template(`<span style=margin-left:0.375rem;opacity:0.7>`);
15690
+ var _tmpl$2411 = /* @__PURE__ */ template(`<button type=button role=tab style="padding:0.625rem 1rem;margin-bottom:-1px;font-size:0.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;border-bottom:2px solid;background:none;border-top:none;border-left:none;border-right:none;cursor:pointer">`);
15691
+ var _tmpl$2511 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-sm">Add step`);
15692
+ var _tmpl$2610 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-sm">Open Email \u203A Templates`);
15693
+ var _tmpl$2710 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;display:flex;gap:0.75rem;align-items:center;flex-wrap:wrap"><span class=app-admin-text-muted style=font-size:0.8125rem>A step sends a marketing template. Create one under Email \u203A Templates first.`);
15694
+ var _tmpl$289 = /* @__PURE__ */ template(`<tr><td data-label=Person><div class=app-admin-text-muted style=font-size:0.75rem> \xB7 </div></td><td data-label="Came from"></td><td data-label=Step> of </td><td data-label="Next due"class=app-admin-text-muted></td><td class=app-admin-table-cell--end><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Remove`);
15695
+ var _tmpl$295 = /* @__PURE__ */ template(`<div><div style=font-size:0.75rem;margin-bottom:0.25rem></div><div style=display:grid;gap:0.25rem>`);
15696
+ var _tmpl$305 = /* @__PURE__ */ template(`<label style=font-size:0.8125rem;display:flex;gap:0.375rem;align-items:center><input type=checkbox>`);
15697
+ var _tmpl$3112 = /* @__PURE__ */ template(`<div>`);
15698
+ var _tmpl$3210 = /* @__PURE__ */ template(`<table class=app-admin-table><thead><tr><th>Name</th><th>Steps</th><th>Fed by</th><th>Sending</th><th>In it</th><th>Due now</th><th>Sent</th><th>Bought</th><th>Unsubscribed</th></tr></thead><tbody>`);
15699
+ var _tmpl$3310 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><div style="padding:1rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft);display:flex;justify-content:space-between;align-items:center"><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0>Sequences</h2><button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">New sequence`);
15700
+ var _tmpl$3410 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
15701
+ var _tmpl$356 = /* @__PURE__ */ template(`<tr><td data-label=Name><button type=button class=app-admin-link-btn style=font-size:inherit;font-weight:600></button></td><td data-label=Steps></td><td data-label="Fed by"></td><td data-label=Sending></td><td data-label="In it"></td><td data-label="Due now"></td><td data-label=Sent></td><td data-label=Bought></td><td data-label=Unsubscribed>`);
15702
+ var _tmpl$363 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>by hand`);
15703
+ var _tmpl$372 = /* @__PURE__ */ template(`<strong>`);
15704
+ var _tmpl$382 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>0`);
15686
15705
  var LINKS = ["members", "resume_survey", "cart", "home", "none"];
15687
15706
  var EMPTY_STEP = {
15688
15707
  waitHours: 24,
@@ -15715,12 +15734,9 @@ var field = {
15715
15734
  };
15716
15735
  function SequenceQueue(props) {
15717
15736
  const nav = useAdminNav();
15718
- const [reload, setReload] = createSignal(0);
15719
15737
  const [busy, setBusy] = createSignal(null);
15720
- const [queue, {
15721
- refetch
15722
- }] = createResource(reload, () => apiFetch("/admin/funnel/queue"));
15723
- const rows = () => (queue()?.due ?? []).filter((r) => r.sequenceId === props.sequence.id);
15738
+ const rows = () => props.rows ?? [];
15739
+ const refetch = () => props.refetch();
15724
15740
  const act = async (row, action) => {
15725
15741
  setBusy(row.enrollmentId);
15726
15742
  try {
@@ -15749,7 +15765,7 @@ function SequenceQueue(props) {
15749
15765
  method: "POST"
15750
15766
  });
15751
15767
  toastSuccess(Object.entries(r.outcomes).map(([k, n]) => `${n} ${OUTCOME_LABEL[k] ?? k}`).join(", ") || "Nothing was due");
15752
- setReload(reload() + 1);
15768
+ refetch();
15753
15769
  props.onChanged();
15754
15770
  } catch (e) {
15755
15771
  toastError(e.message);
@@ -15757,92 +15773,100 @@ function SequenceQueue(props) {
15757
15773
  setBusy(null);
15758
15774
  }
15759
15775
  };
15760
- return (() => {
15761
- var _el$ = _tmpl$355(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild; _el$4.firstChild; var _el$6 = _el$4.nextSibling;
15762
- insert(_el$4, (() => {
15763
- var _c$ = memo(() => !!queue());
15764
- return () => _c$() ? ` \u2014 ${rows().length} due` : "";
15765
- })(), null);
15766
- insert(_el$6, () => props.sequence.autoSend ? "Sending is automatic: the hourly check mails these itself. Anything listed here is due before its next run." : "Due by this sequence's schedule. Nothing here has been emailed, and nothing will be until you send it or turn automatic sending on.");
15767
- insert(_el$2, createComponent(Show, {
15768
- get when() {
15769
- return rows().length > 0;
15770
- },
15771
- get children() {
15772
- var _el$7 = _tmpl$287();
15773
- _el$7.$$click = () => void sendAll();
15774
- effect(() => _el$7.disabled = busy() === "all");
15775
- return _el$7;
15776
- }
15777
- }), null);
15778
- insert(_el$, createComponent(Show, {
15779
- get when() {
15780
- return queue();
15781
- },
15782
- get fallback() {
15783
- return createComponent(LoadingSpinner, {});
15784
- },
15785
- get children() {
15786
- return createComponent(Show, {
15787
- get when() {
15788
- return rows().length > 0;
15789
- },
15790
- get fallback() {
15791
- return createComponent(EmptyState, {
15792
- message: "Nobody in this sequence is due right now."
15793
- });
15794
- },
15795
- get children() {
15796
- var _el$8 = _tmpl$288(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
15797
- insert(_el$0, createComponent(For, {
15798
- get each() {
15799
- return rows();
15800
- },
15801
- children: (row) => (() => {
15802
- var _el$1 = _tmpl$537(), _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$13.nextSibling, _el$15 = _el$14.firstChild, _el$17 = _el$15.nextSibling; _el$17.nextSibling; var _el$18 = _el$14.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling;
15803
- insert(_el$10, createComponent(Show, {
15804
- get when() {
15805
- return row.userId && nav;
15806
- },
15807
- get fallback() {
15808
- return row.email;
15809
- },
15810
- get children() {
15811
- var _el$11 = _tmpl$442();
15812
- _el$11.$$click = () => nav.openCustomer(row.userId);
15813
- insert(_el$11, () => row.email);
15814
- return _el$11;
15815
- }
15816
- }));
15817
- insert(_el$12, () => segmentLongLabel(row.segmentAtAdd));
15818
- insert(_el$13, () => daysAgo(row.anchoredAt));
15819
- insert(_el$14, () => row.stepIndex + 1, _el$17);
15820
- insert(_el$14, () => row.stepCount, null);
15821
- _el$20.$$click = () => void act(row, "send");
15822
- insert(_el$20, () => busy() === row.enrollmentId ? "Sending\u2026" : "Send");
15823
- _el$21.$$click = () => void act(row, "skip");
15824
- effect((_p$) => {
15825
- var _v$ = busy() === row.enrollmentId, _v$2 = busy() === row.enrollmentId;
15826
- _v$ !== _p$.e && (_el$20.disabled = _p$.e = _v$);
15827
- _v$2 !== _p$.t && (_el$21.disabled = _p$.t = _v$2);
15828
- return _p$;
15829
- }, {
15830
- e: void 0,
15831
- t: void 0
15832
- });
15833
- return _el$1;
15834
- })()
15835
- }));
15836
- return _el$8;
15837
- }
15838
- });
15839
- }
15840
- }), null);
15841
- effect((_$p) => style(_el$6, {
15842
- ...label
15843
- }, _$p));
15844
- return _el$;
15845
- })();
15776
+ return createComponent(Section, {
15777
+ title: "Waiting to send",
15778
+ get count() {
15779
+ return rows().length;
15780
+ },
15781
+ flush: true,
15782
+ get action() {
15783
+ return createComponent(Show, {
15784
+ get when() {
15785
+ return rows().length > 0;
15786
+ },
15787
+ get children() {
15788
+ var _el$5 = _tmpl$355();
15789
+ _el$5.$$click = () => void sendAll();
15790
+ effect(() => _el$5.disabled = busy() === "all");
15791
+ return _el$5;
15792
+ }
15793
+ });
15794
+ },
15795
+ get children() {
15796
+ return [createComponent(Show, {
15797
+ get when() {
15798
+ return !props.sequence.autoSend;
15799
+ },
15800
+ get children() {
15801
+ return _tmpl$287();
15802
+ }
15803
+ }), createComponent(Show, {
15804
+ get when() {
15805
+ return props.rows;
15806
+ },
15807
+ get fallback() {
15808
+ return createComponent(LoadingSpinner, {});
15809
+ },
15810
+ get children() {
15811
+ return createComponent(Show, {
15812
+ get when() {
15813
+ return rows().length > 0;
15814
+ },
15815
+ get fallback() {
15816
+ return createComponent(EmptyState, {
15817
+ get message() {
15818
+ return props.sequence.autoSend ? "Nothing due \u2014 the hourly check sends these itself." : "Nobody is due right now.";
15819
+ }
15820
+ });
15821
+ },
15822
+ get children() {
15823
+ var _el$2 = _tmpl$288(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
15824
+ insert(_el$4, createComponent(For, {
15825
+ get each() {
15826
+ return rows();
15827
+ },
15828
+ children: (row) => (() => {
15829
+ var _el$6 = _tmpl$537(), _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;
15830
+ insert(_el$7, createComponent(Show, {
15831
+ get when() {
15832
+ return row.userId && nav;
15833
+ },
15834
+ get fallback() {
15835
+ return row.email;
15836
+ },
15837
+ get children() {
15838
+ var _el$8 = _tmpl$442();
15839
+ _el$8.$$click = () => nav.openCustomer(row.userId);
15840
+ insert(_el$8, () => row.email);
15841
+ return _el$8;
15842
+ }
15843
+ }));
15844
+ insert(_el$9, () => segmentLongLabel(row.segmentAtAdd));
15845
+ insert(_el$0, () => daysAgo(row.anchoredAt));
15846
+ insert(_el$1, () => row.stepIndex + 1, _el$10);
15847
+ insert(_el$1, () => row.stepCount, null);
15848
+ _el$13.$$click = () => void act(row, "send");
15849
+ insert(_el$13, () => busy() === row.enrollmentId ? "Sending\u2026" : "Send");
15850
+ _el$14.$$click = () => void act(row, "skip");
15851
+ effect((_p$) => {
15852
+ var _v$ = busy() === row.enrollmentId, _v$2 = busy() === row.enrollmentId;
15853
+ _v$ !== _p$.e && (_el$13.disabled = _p$.e = _v$);
15854
+ _v$2 !== _p$.t && (_el$14.disabled = _p$.t = _v$2);
15855
+ return _p$;
15856
+ }, {
15857
+ e: void 0,
15858
+ t: void 0
15859
+ });
15860
+ return _el$6;
15861
+ })()
15862
+ }));
15863
+ return _el$2;
15864
+ }
15865
+ });
15866
+ }
15867
+ })];
15868
+ }
15869
+ });
15846
15870
  }
15847
15871
  var OUTCOME_LABEL = {
15848
15872
  sent: "sent",
@@ -15879,25 +15903,25 @@ function AddToSequence(props) {
15879
15903
  }
15880
15904
  };
15881
15905
  return (() => {
15882
- var _el$22 = _tmpl$733(), _el$23 = _el$22.firstChild; _el$23.firstChild; var _el$25 = _el$23.nextSibling;
15883
- _el$23.addEventListener("change", (e) => setTarget(e.currentTarget.value));
15884
- insert(_el$23, createComponent(For, {
15906
+ var _el$15 = _tmpl$733(), _el$16 = _el$15.firstChild; _el$16.firstChild; var _el$18 = _el$16.nextSibling;
15907
+ _el$16.addEventListener("change", (e) => setTarget(e.currentTarget.value));
15908
+ insert(_el$16, createComponent(For, {
15885
15909
  get each() {
15886
15910
  return sequences()?.sequences ?? [];
15887
15911
  },
15888
15912
  children: (s) => (() => {
15889
- var _el$27 = _tmpl$828();
15890
- insert(_el$27, () => s.name);
15891
- effect(() => _el$27.value = s.id);
15892
- return _el$27;
15913
+ var _el$20 = _tmpl$828();
15914
+ insert(_el$20, () => s.name);
15915
+ effect(() => _el$20.value = s.id);
15916
+ return _el$20;
15893
15917
  })()
15894
15918
  }), null);
15895
- _el$25.$$click = () => void add();
15896
- insert(_el$25, (() => {
15897
- var _c$2 = memo(() => !!busy());
15898
- return () => _c$2() ? "Adding\u2026" : `Add ${props.people.length}`;
15919
+ _el$18.$$click = () => void add();
15920
+ insert(_el$18, (() => {
15921
+ var _c$ = memo(() => !!busy());
15922
+ return () => _c$() ? "Adding\u2026" : `Add ${props.people.length}`;
15899
15923
  })());
15900
- insert(_el$22, createComponent(Show, {
15924
+ insert(_el$15, createComponent(Show, {
15901
15925
  get when() {
15902
15926
  return memo(() => !!sequences())() && sequences().sequences.length === 0;
15903
15927
  },
@@ -15905,98 +15929,71 @@ function AddToSequence(props) {
15905
15929
  return _tmpl$635();
15906
15930
  }
15907
15931
  }), null);
15908
- effect(() => _el$25.disabled = busy() || !target() || props.people.length === 0);
15909
- effect(() => _el$23.value = target());
15910
- return _el$22;
15932
+ effect(() => _el$18.disabled = busy() || !target() || props.people.length === 0);
15933
+ effect(() => _el$16.value = target());
15934
+ return _el$15;
15911
15935
  })();
15912
15936
  }
15913
- function StepEditor(props) {
15937
+ function StepRow(props) {
15914
15938
  const nav = useAdminNav();
15915
15939
  const set = (k, v) => props.onChange({
15916
15940
  ...props.step,
15917
15941
  [k]: v
15918
15942
  });
15919
15943
  const missingTemplate = () => props.step.templateId && !props.templates.some((t) => t.id === props.step.templateId);
15944
+ const canEditTemplate = () => !!nav && !!props.step.templateId && !missingTemplate();
15920
15945
  return (() => {
15921
- var _el$28 = _tmpl$1014(), _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild; _el$30.firstChild; var _el$32 = _el$30.nextSibling, _el$33 = _el$32.firstChild, _el$35 = _el$29.nextSibling, _el$36 = _el$35.firstChild, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$36.nextSibling, _el$40 = _el$39.firstChild, _el$44 = _el$39.nextSibling, _el$45 = _el$44.firstChild, _el$46 = _el$45.nextSibling;
15922
- insert(_el$30, () => props.index + 1, null);
15923
- _el$33.$$click = () => props.onTest();
15924
- insert(_el$32, createComponent(Show, {
15946
+ var _el$21 = _tmpl$021(), _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$31 = _el$30.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling;
15947
+ insert(_el$22, () => props.index + 1);
15948
+ insert(_el$24, () => props.index === 0 ? "after" : "+");
15949
+ _el$25.$$input = (e) => set("waitHours", Number(e.currentTarget.value));
15950
+ _el$26.addEventListener("change", (e) => set("templateId", e.currentTarget.value));
15951
+ insert(_el$26, createComponent(Show, {
15925
15952
  get when() {
15926
- return props.count > 1;
15953
+ return missingTemplate();
15927
15954
  },
15928
15955
  get children() {
15929
- var _el$34 = _tmpl$925();
15930
- _el$34.$$click = () => props.onRemove();
15931
- return _el$34;
15956
+ var _el$28 = _tmpl$925();
15957
+ effect(() => _el$28.value = props.step.templateId);
15958
+ return _el$28;
15932
15959
  }
15933
15960
  }), null);
15934
- insert(_el$37, () => props.index === 0 ? "Hours after they are added" : "Hours after the previous step");
15935
- _el$38.$$input = (e) => set("waitHours", Number(e.currentTarget.value));
15936
- insert(_el$39, createComponent(Show, {
15937
- get when() {
15938
- return props.templates.length > 0;
15939
- },
15940
- get fallback() {
15941
- return (() => {
15942
- var _el$47 = _tmpl$1213(); _el$47.firstChild;
15943
- insert(_el$47, createComponent(Show, {
15944
- when: nav,
15945
- get children() {
15946
- var _el$49 = _tmpl$1116();
15947
- _el$49.$$click = () => nav.selectTab("email-templates");
15948
- return _el$49;
15949
- }
15950
- }), null);
15951
- return _el$47;
15952
- })();
15961
+ insert(_el$26, createComponent(For, {
15962
+ get each() {
15963
+ return props.templates;
15953
15964
  },
15954
- get children() {
15955
- var _el$41 = _tmpl$1101(); _el$41.firstChild;
15956
- _el$41.addEventListener("change", (e) => set("templateId", e.currentTarget.value));
15957
- insert(_el$41, createComponent(Show, {
15958
- get when() {
15959
- return missingTemplate();
15960
- },
15961
- get children() {
15962
- var _el$43 = _tmpl$021();
15963
- effect(() => _el$43.value = props.step.templateId);
15964
- return _el$43;
15965
- }
15966
- }), null);
15967
- insert(_el$41, createComponent(For, {
15968
- get each() {
15969
- return props.templates;
15970
- },
15971
- children: (t) => (() => {
15972
- var _el$50 = _tmpl$828();
15973
- insert(_el$50, () => t.name);
15974
- effect(() => _el$50.value = t.id);
15975
- return _el$50;
15976
- })()
15977
- }), null);
15978
- effect(() => _el$41.value = props.step.templateId);
15979
- return _el$41;
15980
- }
15965
+ children: (t) => (() => {
15966
+ var _el$34 = _tmpl$828();
15967
+ insert(_el$34, () => t.name);
15968
+ effect(() => _el$34.value = t.id);
15969
+ return _el$34;
15970
+ })()
15981
15971
  }), null);
15982
- _el$46.addEventListener("change", (e) => set("link", e.currentTarget.value));
15983
- insert(_el$46, createComponent(For, {
15972
+ _el$29.$$click = () => nav.openEmailTemplate(props.step.templateId);
15973
+ _el$30.addEventListener("change", (e) => set("link", e.currentTarget.value));
15974
+ insert(_el$30, createComponent(For, {
15984
15975
  each: LINKS,
15985
15976
  children: (l) => (() => {
15986
- var _el$51 = _tmpl$828();
15987
- _el$51.value = l;
15988
- insert(_el$51, () => LINK_LABEL[l]);
15989
- return _el$51;
15977
+ var _el$35 = _tmpl$828();
15978
+ _el$35.value = l;
15979
+ insert(_el$35, () => LINK_LABEL[l]);
15980
+ return _el$35;
15990
15981
  })()
15991
15982
  }));
15983
+ _el$32.$$click = () => props.onTest();
15984
+ _el$33.$$click = () => props.onRemove();
15992
15985
  effect((_p$) => {
15993
- var _v$3 = field, _v$4 = label, _v$5 = field, _v$6 = label, _v$7 = field, _v$8 = label;
15994
- _p$.e = style(_el$36, _v$3, _p$.e);
15995
- _p$.t = style(_el$37, _v$4, _p$.t);
15996
- _p$.a = style(_el$39, _v$5, _p$.a);
15997
- _p$.o = style(_el$40, _v$6, _p$.o);
15998
- _p$.i = style(_el$44, _v$7, _p$.i);
15999
- _p$.n = style(_el$45, _v$8, _p$.n);
15986
+ var _v$3 = props.index === 0 ? "none" : "1px solid var(--app-admin-border-soft)", _v$4 = `Step ${props.index + 1} wait hours`, _v$5 = `Step ${props.index + 1} template`, _v$6 = canEditTemplate() ? "visible" : "hidden", _v$7 = `Edit template for step ${props.index + 1}`, _v$8 = `Step ${props.index + 1} link`, _v$9 = !props.canTest, _v$0 = props.canTest ? "Email this step to me" : "Save first", _v$1 = props.count <= 1, _v$10 = `Remove step ${props.index + 1}`;
15987
+ _v$3 !== _p$.e && setStyleProperty(_el$21, "border-top", _p$.e = _v$3);
15988
+ _v$4 !== _p$.t && setAttribute(_el$25, "aria-label", _p$.t = _v$4);
15989
+ _v$5 !== _p$.a && setAttribute(_el$26, "aria-label", _p$.a = _v$5);
15990
+ _v$6 !== _p$.o && setStyleProperty(_el$29, "visibility", _p$.o = _v$6);
15991
+ _v$7 !== _p$.i && setAttribute(_el$29, "aria-label", _p$.i = _v$7);
15992
+ _v$8 !== _p$.n && setAttribute(_el$30, "aria-label", _p$.n = _v$8);
15993
+ _v$9 !== _p$.s && (_el$32.disabled = _p$.s = _v$9);
15994
+ _v$0 !== _p$.h && setAttribute(_el$32, "title", _p$.h = _v$0);
15995
+ _v$1 !== _p$.r && (_el$33.disabled = _p$.r = _v$1);
15996
+ _v$10 !== _p$.d && setAttribute(_el$33, "aria-label", _p$.d = _v$10);
16000
15997
  return _p$;
16001
15998
  }, {
16002
15999
  e: void 0,
@@ -16004,22 +16001,47 @@ function StepEditor(props) {
16004
16001
  a: void 0,
16005
16002
  o: void 0,
16006
16003
  i: void 0,
16007
- n: void 0
16004
+ n: void 0,
16005
+ s: void 0,
16006
+ h: void 0,
16007
+ r: void 0,
16008
+ d: void 0
16008
16009
  });
16009
- effect(() => _el$38.value = props.step.waitHours);
16010
- effect(() => _el$46.value = props.step.link);
16011
- return _el$28;
16010
+ effect(() => _el$25.value = props.step.waitHours);
16011
+ effect(() => _el$26.value = props.step.templateId);
16012
+ effect(() => _el$30.value = props.step.link);
16013
+ return _el$21;
16012
16014
  })();
16013
16015
  }
16016
+ var checkboxRow = {
16017
+ "font-size": "0.8125rem",
16018
+ display: "flex",
16019
+ gap: "0.5rem",
16020
+ "align-items": "flex-start"
16021
+ };
16014
16022
  function SequenceEditor(props) {
16015
16023
  const nav = useAdminNav();
16016
16024
  const [draft, setDraft] = createSignal(JSON.parse(JSON.stringify(props.initial)));
16017
16025
  const [saving, setSaving] = createSignal(false);
16018
16026
  const [error, setError] = createSignal(null);
16019
16027
  const isNew = () => !draft().id;
16028
+ const dirty = () => JSON.stringify(draft()) !== JSON.stringify(props.initial);
16020
16029
  const [enrollments, {
16021
16030
  refetch: refetchEnrollments
16022
16031
  }] = createResource(() => props.initial.id || null, (id) => apiFetch(`/admin/funnel/sequences/${id}/enrollments`));
16032
+ const [queue, {
16033
+ refetch: refetchQueue
16034
+ }] = createResource(() => props.initial.id || null, () => apiFetch("/admin/funnel/queue"));
16035
+ const dueRows = () => queue() ? queue().due.filter((r) => r.sequenceId === props.initial.id) : void 0;
16036
+ const [tab, setTab] = createSignal(isNew() ? "settings" : "queue");
16037
+ const tabKeys = () => isNew() ? ["steps", "settings"] : ["queue", "steps", "people", "settings"];
16038
+ const TAB_LABEL = {
16039
+ queue: "Queue",
16040
+ steps: "Steps",
16041
+ people: "People",
16042
+ settings: "Settings"
16043
+ };
16044
+ const tabCount = (key) => key === "queue" ? dueRows()?.length : key === "steps" ? draft().steps.length : key === "people" ? enrollments()?.enrollments.length : void 0;
16023
16045
  const update = (patch) => setDraft({
16024
16046
  ...draft(),
16025
16047
  ...patch
@@ -16076,10 +16098,6 @@ function SequenceEditor(props) {
16076
16098
  }
16077
16099
  };
16078
16100
  const test = async (stepIndex) => {
16079
- if (isNew()) {
16080
- toastError("Save the sequence first, then send a test.");
16081
- return;
16082
- }
16083
16101
  try {
16084
16102
  const r = await apiFetch(`/admin/funnel/sequences/${draft().id}/test`, {
16085
16103
  method: "POST",
@@ -16109,230 +16127,387 @@ function SequenceEditor(props) {
16109
16127
  feedSegments: cur.includes(key) ? cur.filter((k) => k !== key) : [...cur, key]
16110
16128
  });
16111
16129
  };
16130
+ const feedSummary = () => draft().feedSegments.length > 0 ? `Fed by ${draft().feedSegments.length} segment${draft().feedSegments.length === 1 ? "" : "s"}, last ${draft().feedMaxAgeDays ?? 30} days` : "Enrolled by hand only";
16112
16131
  return (() => {
16113
- var _el$52 = _tmpl$1912(), _el$53 = _el$52.firstChild, _el$54 = _el$53.firstChild, _el$55 = _el$54.nextSibling, _el$57 = _el$53.nextSibling, _el$58 = _el$57.firstChild, _el$59 = _el$58.firstChild, _el$60 = _el$59.firstChild, _el$61 = _el$60.nextSibling, _el$62 = _el$59.nextSibling, _el$63 = _el$62.firstChild, _el$64 = _el$63.nextSibling, _el$65 = _el$58.nextSibling, _el$66 = _el$65.firstChild, _el$67 = _el$65.nextSibling, _el$68 = _el$67.firstChild; _el$68.nextSibling; var _el$77 = _el$67.nextSibling, _el$78 = _el$77.firstChild, _el$79 = _el$78.nextSibling, _el$80 = _el$79.firstChild, _el$81 = _el$79.nextSibling, _el$83 = _el$77.nextSibling, _el$84 = _el$83.firstChild;
16114
- insert(_el$54, (() => {
16115
- var _c$3 = memo(() => !!isNew());
16116
- return () => _c$3() ? "New sequence" : draft().name;
16117
- })());
16118
- _el$55.$$click = () => props.onClose();
16119
- insert(_el$52, createComponent(Show, {
16120
- get when() {
16121
- return !isNew();
16132
+ var _el$36 = _tmpl$1713(), _el$37 = _el$36.firstChild;
16133
+ insert(_el$36, createComponent(DetailHeader, {
16134
+ backLabel: "Sequences",
16135
+ onBack: () => props.onClose(),
16136
+ get title() {
16137
+ return memo(() => !!isNew())() ? "New sequence" : draft().name || "Untitled sequence";
16122
16138
  },
16123
- get children() {
16124
- var _el$56 = _tmpl$1313();
16125
- insert(_el$56, createComponent(SequenceQueue, {
16126
- get sequence() {
16127
- return props.initial;
16139
+ get subtitle() {
16140
+ return draft().description || (isNew() ? "Timed emails for people who stopped short of a subscription." : void 0);
16141
+ },
16142
+ get badges() {
16143
+ return [(() => {
16144
+ var _el$63 = _tmpl$1812();
16145
+ insert(_el$63, () => draft().autoSend ? "Sends automatically" : "Sends on review");
16146
+ effect(() => className(_el$63, `app-admin-badge app-admin-badge--${draft().autoSend ? "success" : "info"}`));
16147
+ return _el$63;
16148
+ })(), (() => {
16149
+ var _el$64 = _tmpl$1912();
16150
+ insert(_el$64, feedSummary);
16151
+ return _el$64;
16152
+ })(), createComponent(Show, {
16153
+ get when() {
16154
+ return memo(() => !!!isNew())() && enrollments();
16128
16155
  },
16129
- get onChanged() {
16130
- return props.onChanged;
16156
+ get children() {
16157
+ var _el$65 = _tmpl$2010(), _el$66 = _el$65.firstChild;
16158
+ insert(_el$65, () => enrollments().enrollments.length, _el$66);
16159
+ return _el$65;
16131
16160
  }
16132
- }));
16133
- return _el$56;
16134
- }
16135
- }), _el$57);
16136
- _el$61.$$input = (e) => update({
16137
- name: e.currentTarget.value
16138
- });
16139
- _el$64.$$input = (e) => update({
16140
- description: e.currentTarget.value || null
16141
- });
16142
- insert(_el$57, createComponent(Index, {
16143
- get each() {
16144
- return draft().steps;
16161
+ })];
16145
16162
  },
16146
- children: (step, i) => createComponent(StepEditor, {
16147
- index: i,
16148
- get step() {
16149
- return step();
16150
- },
16151
- get count() {
16152
- return draft().steps.length;
16153
- },
16154
- get templates() {
16155
- return props.templates;
16156
- },
16157
- onChange: (s) => setStep(i, s),
16158
- onRemove: () => update({
16159
- steps: draft().steps.filter((_, j) => j !== i)
16160
- }),
16161
- onTest: () => void test(i)
16162
- })
16163
- }), _el$65);
16164
- _el$66.$$click = () => update({
16165
- steps: [...draft().steps, {
16166
- ...EMPTY_STEP,
16167
- waitHours: 72
16168
- }]
16169
- });
16170
- insert(_el$67, createComponent(For, {
16171
- each: ["a", "b"],
16172
- children: (g) => (() => {
16173
- var _el$93 = _tmpl$2010(), _el$94 = _el$93.firstChild, _el$95 = _el$94.nextSibling;
16174
- insert(_el$94, () => GROUP_LABEL[g]);
16175
- insert(_el$95, createComponent(For, {
16176
- get each() {
16177
- return SEGMENT_KEYS[g];
16163
+ get actions() {
16164
+ return [createComponent(Show, {
16165
+ get when() {
16166
+ return !isNew();
16178
16167
  },
16179
- children: (key) => (() => {
16180
- var _el$96 = _tmpl$2115(), _el$97 = _el$96.firstChild;
16181
- _el$97.addEventListener("change", () => toggleSegment(key));
16182
- insert(_el$96, () => SEGMENT_LABEL[key], null);
16183
- effect(() => _el$97.checked = draft().feedSegments.includes(key));
16184
- return _el$96;
16185
- })()
16186
- }));
16187
- effect((_$p) => style(_el$94, {
16188
- ...label
16189
- }, _$p));
16190
- return _el$93;
16191
- })()
16192
- }), null);
16193
- insert(_el$67, createComponent(Show, {
16168
+ get children() {
16169
+ var _el$67 = _tmpl$2115();
16170
+ _el$67.$$click = () => void archive();
16171
+ return _el$67;
16172
+ }
16173
+ }), (() => {
16174
+ var _el$68 = _tmpl$2212();
16175
+ _el$68.$$click = () => void save();
16176
+ insert(_el$68, (() => {
16177
+ var _c$2 = memo(() => !!saving());
16178
+ return () => _c$2() ? "Saving\u2026" : isNew() ? "Create sequence" : "Save changes";
16179
+ })());
16180
+ effect(() => _el$68.disabled = saving() || !isNew() && !dirty());
16181
+ return _el$68;
16182
+ })()];
16183
+ }
16184
+ }), _el$37);
16185
+ insert(_el$36, createComponent(Show, {
16194
16186
  get when() {
16195
- return draft().feedSegments.length > 0;
16187
+ return error();
16196
16188
  },
16197
16189
  get children() {
16198
- var _el$70 = _tmpl$1413(), _el$71 = _el$70.firstChild, _el$72 = _el$71.firstChild, _el$73 = _el$72.nextSibling; _el$73.nextSibling; var _el$75 = _el$71.nextSibling, _el$76 = _el$75.firstChild;
16199
- _el$73.$$input = (e) => update({
16200
- feedMaxAgeDays: Number(e.currentTarget.value)
16190
+ return createComponent(AlertItem, {
16191
+ severity: "danger",
16192
+ title: "Could not save",
16193
+ get detail() {
16194
+ return error();
16195
+ }
16201
16196
  });
16202
- _el$76.addEventListener("change", (e) => update({
16203
- feedQualifiedOnly: e.currentTarget.checked
16204
- }));
16197
+ }
16198
+ }), _el$37);
16199
+ insert(_el$37, createComponent(For, {
16200
+ get each() {
16201
+ return tabKeys();
16202
+ },
16203
+ children: (key) => (() => {
16204
+ var _el$69 = _tmpl$2411();
16205
+ _el$69.$$click = () => setTab(key);
16206
+ insert(_el$69, () => TAB_LABEL[key], null);
16207
+ insert(_el$69, createComponent(Show, {
16208
+ get when() {
16209
+ return tabCount(key) !== void 0;
16210
+ },
16211
+ get children() {
16212
+ var _el$70 = _tmpl$2311();
16213
+ insert(_el$70, () => tabCount(key));
16214
+ return _el$70;
16215
+ }
16216
+ }), null);
16205
16217
  effect((_p$) => {
16206
- var _v$9 = field, _v$0 = label;
16207
- _p$.e = style(_el$71, _v$9, _p$.e);
16208
- _p$.t = style(_el$72, _v$0, _p$.t);
16218
+ var _v$17 = tab() === key, _v$18 = tab() === key ? "var(--app-admin-primary)" : "transparent", _v$19 = tab() === key ? "var(--app-admin-primary)" : "var(--app-admin-fg-muted)";
16219
+ _v$17 !== _p$.e && setAttribute(_el$69, "aria-selected", _p$.e = _v$17);
16220
+ _v$18 !== _p$.t && setStyleProperty(_el$69, "border-color", _p$.t = _v$18);
16221
+ _v$19 !== _p$.a && setStyleProperty(_el$69, "color", _p$.a = _v$19);
16209
16222
  return _p$;
16210
16223
  }, {
16211
16224
  e: void 0,
16212
- t: void 0
16225
+ t: void 0,
16226
+ a: void 0
16213
16227
  });
16214
- effect(() => _el$73.value = draft().feedMaxAgeDays ?? 30);
16215
- effect(() => _el$76.checked = draft().feedQualifiedOnly);
16216
- return _el$70;
16217
- }
16218
- }), null);
16219
- _el$80.addEventListener("change", (e) => update({
16220
- autoSend: e.currentTarget.checked
16228
+ return _el$69;
16229
+ })()
16221
16230
  }));
16222
- insert(_el$81, () => draft().autoSend ? "Due steps are emailed by the hourly check with no further review. Anyone who buys or unsubscribes drops out first; nobody gets more than one sequence email a day." : "Due steps wait under \u201CWaiting to send\u201D for you to send or skip them.");
16223
- insert(_el$57, createComponent(Show, {
16224
- get when() {
16225
- return error();
16226
- },
16231
+ insert(_el$36, createComponent(Switch, {
16227
16232
  get children() {
16228
- var _el$82 = _tmpl$1513();
16229
- insert(_el$82, error);
16230
- return _el$82;
16231
- }
16232
- }), _el$83);
16233
- _el$84.$$click = () => void save();
16234
- insert(_el$84, (() => {
16235
- var _c$4 = memo(() => !!saving());
16236
- return () => _c$4() ? "Saving\u2026" : isNew() ? "Create sequence" : "Save changes";
16237
- })());
16238
- insert(_el$83, createComponent(Show, {
16239
- get when() {
16240
- return !isNew();
16241
- },
16242
- get children() {
16243
- var _el$85 = _tmpl$1613();
16244
- _el$85.$$click = () => void archive();
16245
- return _el$85;
16246
- }
16247
- }), null);
16248
- insert(_el$52, createComponent(Show, {
16249
- get when() {
16250
- return !isNew();
16251
- },
16252
- get children() {
16253
- var _el$86 = _tmpl$1812(), _el$87 = _el$86.firstChild, _el$88 = _el$87.firstChild; _el$88.firstChild;
16254
- insert(_el$88, () => enrollments()?.enrollments.length ?? "\u2026", null);
16255
- insert(_el$86, createComponent(Show, {
16233
+ return [createComponent(Match, {
16256
16234
  get when() {
16257
- return enrollments();
16235
+ return tab() === "queue";
16258
16236
  },
16259
- get fallback() {
16260
- return createComponent(LoadingSpinner, {});
16237
+ get children() {
16238
+ return createComponent(SequenceQueue, {
16239
+ get sequence() {
16240
+ return props.initial;
16241
+ },
16242
+ get rows() {
16243
+ return dueRows();
16244
+ },
16245
+ refetch: () => void refetchQueue(),
16246
+ get onChanged() {
16247
+ return props.onChanged;
16248
+ }
16249
+ });
16250
+ }
16251
+ }), createComponent(Match, {
16252
+ get when() {
16253
+ return tab() === "steps";
16261
16254
  },
16262
16255
  get children() {
16263
- return createComponent(Show, {
16264
- get when() {
16265
- return enrollments().enrollments.length > 0;
16256
+ return createComponent(Section, {
16257
+ title: "Steps",
16258
+ get count() {
16259
+ return draft().steps.length;
16266
16260
  },
16267
- get fallback() {
16268
- return createComponent(EmptyState, {
16269
- message: "Nobody yet. Add people from the Funnel tab, or tick a segment above."
16261
+ flush: true,
16262
+ get action() {
16263
+ return (() => {
16264
+ var _el$71 = _tmpl$2511();
16265
+ _el$71.$$click = () => update({
16266
+ steps: [...draft().steps, {
16267
+ ...EMPTY_STEP,
16268
+ waitHours: 72
16269
+ }]
16270
+ });
16271
+ effect(() => _el$71.disabled = draft().steps.length >= 8);
16272
+ return _el$71;
16273
+ })();
16274
+ },
16275
+ get children() {
16276
+ return createComponent(Show, {
16277
+ get when() {
16278
+ return props.templates.length > 0;
16279
+ },
16280
+ get fallback() {
16281
+ return (() => {
16282
+ var _el$72 = _tmpl$2710(); _el$72.firstChild;
16283
+ insert(_el$72, createComponent(Show, {
16284
+ when: nav,
16285
+ get children() {
16286
+ var _el$74 = _tmpl$2610();
16287
+ _el$74.$$click = () => nav.selectTab("email-templates");
16288
+ return _el$74;
16289
+ }
16290
+ }), null);
16291
+ return _el$72;
16292
+ })();
16293
+ },
16294
+ get children() {
16295
+ return [_tmpl$1101(), createComponent(Index, {
16296
+ get each() {
16297
+ return draft().steps;
16298
+ },
16299
+ children: (step, i) => createComponent(StepRow, {
16300
+ index: i,
16301
+ get step() {
16302
+ return step();
16303
+ },
16304
+ get count() {
16305
+ return draft().steps.length;
16306
+ },
16307
+ get templates() {
16308
+ return props.templates;
16309
+ },
16310
+ get canTest() {
16311
+ return !isNew();
16312
+ },
16313
+ onChange: (s) => setStep(i, s),
16314
+ onRemove: () => update({
16315
+ steps: draft().steps.filter((_, j) => j !== i)
16316
+ }),
16317
+ onTest: () => void test(i)
16318
+ })
16319
+ })];
16320
+ }
16270
16321
  });
16322
+ }
16323
+ });
16324
+ }
16325
+ }), createComponent(Match, {
16326
+ get when() {
16327
+ return tab() === "people";
16328
+ },
16329
+ get children() {
16330
+ return createComponent(Section, {
16331
+ title: "People in this sequence",
16332
+ get count() {
16333
+ return enrollments()?.enrollments.length;
16271
16334
  },
16335
+ flush: true,
16272
16336
  get children() {
16273
- var _el$90 = _tmpl$1713(), _el$91 = _el$90.firstChild, _el$92 = _el$91.nextSibling;
16274
- insert(_el$92, createComponent(For, {
16275
- get each() {
16276
- return enrollments().enrollments;
16337
+ return createComponent(Show, {
16338
+ get when() {
16339
+ return enrollments();
16340
+ },
16341
+ get fallback() {
16342
+ return createComponent(LoadingSpinner, {});
16277
16343
  },
16278
- children: (e) => (() => {
16279
- var _el$98 = _tmpl$2212(), _el$99 = _el$98.firstChild, _el$101 = _el$99.firstChild, _el$102 = _el$101.firstChild, _el$103 = _el$99.nextSibling, _el$104 = _el$103.nextSibling, _el$105 = _el$104.firstChild, _el$106 = _el$104.nextSibling, _el$107 = _el$106.nextSibling, _el$108 = _el$107.firstChild;
16280
- insert(_el$99, createComponent(Show, {
16344
+ get children() {
16345
+ return createComponent(Show, {
16281
16346
  get when() {
16282
- return e.userId && nav;
16347
+ return enrollments().enrollments.length > 0;
16283
16348
  },
16284
16349
  get fallback() {
16285
- return e.email;
16350
+ return createComponent(EmptyState, {
16351
+ message: "Nobody yet. Add people from the Funnel tab, or feed the sequence from a segment."
16352
+ });
16286
16353
  },
16287
16354
  get children() {
16288
- var _el$100 = _tmpl$442();
16289
- _el$100.$$click = () => nav.openCustomer(e.userId);
16290
- insert(_el$100, () => e.email);
16291
- return _el$100;
16355
+ var _el$39 = _tmpl$1014(), _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling;
16356
+ insert(_el$41, createComponent(For, {
16357
+ get each() {
16358
+ return enrollments().enrollments;
16359
+ },
16360
+ children: (e) => (() => {
16361
+ var _el$75 = _tmpl$289(), _el$76 = _el$75.firstChild, _el$78 = _el$76.firstChild, _el$79 = _el$78.firstChild, _el$80 = _el$76.nextSibling, _el$81 = _el$80.nextSibling, _el$82 = _el$81.firstChild, _el$83 = _el$81.nextSibling, _el$84 = _el$83.nextSibling, _el$85 = _el$84.firstChild;
16362
+ insert(_el$76, createComponent(Show, {
16363
+ get when() {
16364
+ return e.userId && nav;
16365
+ },
16366
+ get fallback() {
16367
+ return e.email;
16368
+ },
16369
+ get children() {
16370
+ var _el$77 = _tmpl$442();
16371
+ _el$77.$$click = () => nav.openCustomer(e.userId);
16372
+ insert(_el$77, () => e.email);
16373
+ return _el$77;
16374
+ }
16375
+ }), _el$78);
16376
+ insert(_el$78, () => e.source === "feed" ? "enrolled by the feed" : "added by hand", _el$79);
16377
+ insert(_el$78, () => formatDate(e.addedAt), null);
16378
+ insert(_el$80, () => segmentLongLabel(e.segmentAtAdd));
16379
+ insert(_el$81, () => Math.min(e.stepIndex + 1, draft().steps.length), _el$82);
16380
+ insert(_el$81, () => draft().steps.length, null);
16381
+ insert(_el$83, (() => {
16382
+ var _c$3 = memo(() => !!e.nextDueAt);
16383
+ return () => _c$3() ? formatDate(e.nextDueAt) : "\u2014";
16384
+ })());
16385
+ _el$85.$$click = () => void remove(e);
16386
+ return _el$75;
16387
+ })()
16388
+ }));
16389
+ return _el$39;
16292
16390
  }
16293
- }), _el$101);
16294
- insert(_el$101, () => e.source === "feed" ? "enrolled by the feed" : "added by hand", _el$102);
16295
- insert(_el$101, () => formatDate(e.addedAt), null);
16296
- insert(_el$103, () => segmentLongLabel(e.segmentAtAdd));
16297
- insert(_el$104, () => Math.min(e.stepIndex + 1, draft().steps.length), _el$105);
16298
- insert(_el$104, () => draft().steps.length, null);
16299
- insert(_el$106, (() => {
16300
- var _c$5 = memo(() => !!e.nextDueAt);
16301
- return () => _c$5() ? formatDate(e.nextDueAt) : "\u2014";
16302
- })());
16303
- _el$108.$$click = () => void remove(e);
16304
- return _el$98;
16305
- })()
16306
- }));
16307
- return _el$90;
16391
+ });
16392
+ }
16393
+ });
16308
16394
  }
16309
16395
  });
16310
16396
  }
16311
- }), null);
16312
- return _el$86;
16397
+ }), createComponent(Match, {
16398
+ get when() {
16399
+ return tab() === "settings";
16400
+ },
16401
+ get children() {
16402
+ var _el$42 = _tmpl$1613();
16403
+ insert(_el$42, createComponent(Section, {
16404
+ title: "About",
16405
+ get children() {
16406
+ var _el$43 = _tmpl$1116(), _el$44 = _el$43.firstChild, _el$45 = _el$44.firstChild, _el$46 = _el$45.nextSibling, _el$47 = _el$44.nextSibling, _el$48 = _el$47.firstChild, _el$49 = _el$48.nextSibling;
16407
+ _el$46.$$input = (e) => update({
16408
+ name: e.currentTarget.value
16409
+ });
16410
+ _el$49.$$input = (e) => update({
16411
+ description: e.currentTarget.value || null
16412
+ });
16413
+ effect((_p$) => {
16414
+ var _v$11 = field, _v$12 = label, _v$13 = field, _v$14 = label;
16415
+ _p$.e = style(_el$44, _v$11, _p$.e);
16416
+ _p$.t = style(_el$45, _v$12, _p$.t);
16417
+ _p$.a = style(_el$47, _v$13, _p$.a);
16418
+ _p$.o = style(_el$48, _v$14, _p$.o);
16419
+ return _p$;
16420
+ }, {
16421
+ e: void 0,
16422
+ t: void 0,
16423
+ a: void 0,
16424
+ o: void 0
16425
+ });
16426
+ effect(() => _el$46.value = draft().name);
16427
+ effect(() => _el$49.value = draft().description ?? "");
16428
+ return _el$43;
16429
+ }
16430
+ }), null);
16431
+ insert(_el$42, createComponent(Section, {
16432
+ title: "Sending",
16433
+ get children() {
16434
+ var _el$50 = _tmpl$1213(), _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling, _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling;
16435
+ style(_el$50, checkboxRow);
16436
+ _el$51.addEventListener("change", (e) => update({
16437
+ autoSend: e.currentTarget.checked
16438
+ }));
16439
+ insert(_el$54, () => draft().autoSend ? "The hourly check emails due steps itself. Buyers and unsubscribes drop out first; one sequence email per person per day." : "Off: due steps wait under \u201CWaiting to send\u201D for you.");
16440
+ effect(() => _el$51.checked = draft().autoSend);
16441
+ return _el$50;
16442
+ }
16443
+ }), null);
16444
+ insert(_el$42, createComponent(Section, {
16445
+ title: "Who gets enrolled",
16446
+ get children() {
16447
+ var _el$55 = _tmpl$1513(); _el$55.firstChild;
16448
+ insert(_el$55, createComponent(For, {
16449
+ each: ["a", "b"],
16450
+ children: (g) => (() => {
16451
+ var _el$86 = _tmpl$295(), _el$87 = _el$86.firstChild, _el$88 = _el$87.nextSibling;
16452
+ insert(_el$87, () => GROUP_LABEL[g]);
16453
+ insert(_el$88, createComponent(For, {
16454
+ get each() {
16455
+ return SEGMENT_KEYS[g];
16456
+ },
16457
+ children: (key) => (() => {
16458
+ var _el$89 = _tmpl$305(), _el$90 = _el$89.firstChild;
16459
+ _el$90.addEventListener("change", () => toggleSegment(key));
16460
+ insert(_el$89, () => SEGMENT_LABEL[key], null);
16461
+ effect(() => _el$90.checked = draft().feedSegments.includes(key));
16462
+ return _el$89;
16463
+ })()
16464
+ }));
16465
+ effect((_$p) => style(_el$87, {
16466
+ ...label
16467
+ }, _$p));
16468
+ return _el$86;
16469
+ })()
16470
+ }), null);
16471
+ insert(_el$55, createComponent(Show, {
16472
+ get when() {
16473
+ return draft().feedSegments.length > 0;
16474
+ },
16475
+ get children() {
16476
+ return [(() => {
16477
+ var _el$57 = _tmpl$1313(), _el$58 = _el$57.firstChild, _el$59 = _el$58.nextSibling; _el$59.nextSibling;
16478
+ _el$59.$$input = (e) => update({
16479
+ feedMaxAgeDays: Number(e.currentTarget.value)
16480
+ });
16481
+ effect((_p$) => {
16482
+ var _v$15 = field, _v$16 = label;
16483
+ _p$.e = style(_el$57, _v$15, _p$.e);
16484
+ _p$.t = style(_el$58, _v$16, _p$.t);
16485
+ return _p$;
16486
+ }, {
16487
+ e: void 0,
16488
+ t: void 0
16489
+ });
16490
+ effect(() => _el$59.value = draft().feedMaxAgeDays ?? 30);
16491
+ return _el$57;
16492
+ })(), (() => {
16493
+ var _el$61 = _tmpl$1413(), _el$62 = _el$61.firstChild;
16494
+ _el$62.addEventListener("change", (e) => update({
16495
+ feedQualifiedOnly: e.currentTarget.checked
16496
+ }));
16497
+ effect(() => _el$62.checked = draft().feedQualifiedOnly);
16498
+ return _el$61;
16499
+ })()];
16500
+ }
16501
+ }), null);
16502
+ return _el$55;
16503
+ }
16504
+ }), null);
16505
+ return _el$42;
16506
+ }
16507
+ })];
16313
16508
  }
16314
16509
  }), null);
16315
- effect((_p$) => {
16316
- var _v$1 = field, _v$10 = label, _v$11 = field, _v$12 = label, _v$13 = draft().steps.length >= 8, _v$14 = saving();
16317
- _p$.e = style(_el$59, _v$1, _p$.e);
16318
- _p$.t = style(_el$60, _v$10, _p$.t);
16319
- _p$.a = style(_el$62, _v$11, _p$.a);
16320
- _p$.o = style(_el$63, _v$12, _p$.o);
16321
- _v$13 !== _p$.i && (_el$66.disabled = _p$.i = _v$13);
16322
- _v$14 !== _p$.n && (_el$84.disabled = _p$.n = _v$14);
16323
- return _p$;
16324
- }, {
16325
- e: void 0,
16326
- t: void 0,
16327
- a: void 0,
16328
- o: void 0,
16329
- i: void 0,
16330
- n: void 0
16331
- });
16332
- effect(() => _el$61.value = draft().name);
16333
- effect(() => _el$64.value = draft().description ?? "");
16334
- effect(() => _el$80.checked = draft().autoSend);
16335
- return _el$52;
16510
+ return _el$36;
16336
16511
  })();
16337
16512
  }
16338
16513
  function Sequences() {
@@ -16354,20 +16529,27 @@ function Sequences() {
16354
16529
  void refetchQueue();
16355
16530
  };
16356
16531
  return (() => {
16357
- var _el$109 = _tmpl$2311();
16358
- insert(_el$109, createComponent(PageTitle, {
16359
- subtitle: "Timed emails for people who stopped short of a subscription",
16360
- children: "Sequences"
16532
+ var _el$91 = _tmpl$3112();
16533
+ insert(_el$91, createComponent(Show, {
16534
+ get when() {
16535
+ return !editing();
16536
+ },
16537
+ get children() {
16538
+ return createComponent(PageTitle, {
16539
+ subtitle: "Timed emails for people who stopped short of a subscription",
16540
+ children: "Sequences"
16541
+ });
16542
+ }
16361
16543
  }), null);
16362
- insert(_el$109, createComponent(Show, {
16544
+ insert(_el$91, createComponent(Show, {
16363
16545
  get when() {
16364
16546
  return editing();
16365
16547
  },
16366
16548
  get fallback() {
16367
16549
  return (() => {
16368
- var _el$110 = _tmpl$2511(), _el$111 = _el$110.firstChild, _el$112 = _el$111.firstChild, _el$113 = _el$112.nextSibling;
16369
- _el$113.$$click = () => setEditing(blankSequence());
16370
- insert(_el$110, createComponent(Show, {
16550
+ var _el$92 = _tmpl$3310(), _el$93 = _el$92.firstChild, _el$94 = _el$93.firstChild, _el$95 = _el$94.nextSibling;
16551
+ _el$95.$$click = () => setEditing(blankSequence());
16552
+ insert(_el$92, createComponent(Show, {
16371
16553
  get when() {
16372
16554
  return list();
16373
16555
  },
@@ -16385,52 +16567,52 @@ function Sequences() {
16385
16567
  });
16386
16568
  },
16387
16569
  get children() {
16388
- var _el$114 = _tmpl$2411(), _el$115 = _el$114.firstChild, _el$116 = _el$115.nextSibling;
16389
- insert(_el$116, createComponent(For, {
16570
+ var _el$96 = _tmpl$3210(), _el$97 = _el$96.firstChild, _el$98 = _el$97.nextSibling;
16571
+ insert(_el$98, createComponent(For, {
16390
16572
  get each() {
16391
16573
  return list().sequences;
16392
16574
  },
16393
16575
  children: (s) => (() => {
16394
- var _el$117 = _tmpl$2710(), _el$118 = _el$117.firstChild, _el$119 = _el$118.firstChild, _el$121 = _el$118.nextSibling, _el$122 = _el$121.nextSibling, _el$123 = _el$122.nextSibling, _el$124 = _el$123.nextSibling, _el$125 = _el$124.nextSibling, _el$126 = _el$125.nextSibling, _el$127 = _el$126.nextSibling, _el$128 = _el$127.nextSibling;
16395
- _el$119.$$click = () => setEditing(s);
16396
- insert(_el$119, () => s.name);
16397
- insert(_el$118, createComponent(Show, {
16576
+ var _el$99 = _tmpl$356(), _el$100 = _el$99.firstChild, _el$101 = _el$100.firstChild, _el$103 = _el$100.nextSibling, _el$104 = _el$103.nextSibling, _el$105 = _el$104.nextSibling, _el$106 = _el$105.nextSibling, _el$107 = _el$106.nextSibling, _el$108 = _el$107.nextSibling, _el$109 = _el$108.nextSibling, _el$110 = _el$109.nextSibling;
16577
+ _el$101.$$click = () => setEditing(s);
16578
+ insert(_el$101, () => s.name);
16579
+ insert(_el$100, createComponent(Show, {
16398
16580
  get when() {
16399
16581
  return s.description;
16400
16582
  },
16401
16583
  get children() {
16402
- var _el$120 = _tmpl$2610();
16403
- insert(_el$120, () => s.description);
16404
- return _el$120;
16584
+ var _el$102 = _tmpl$3410();
16585
+ insert(_el$102, () => s.description);
16586
+ return _el$102;
16405
16587
  }
16406
16588
  }), null);
16407
- insert(_el$121, () => s.steps.length);
16408
- insert(_el$122, (() => {
16409
- var _c$6 = memo(() => s.feedSegments.length > 0);
16410
- return () => _c$6() ? `${s.feedSegments.length} segment${s.feedSegments.length === 1 ? "" : "s"}, \u2264${s.feedMaxAgeDays}d` : _tmpl$289();
16589
+ insert(_el$103, () => s.steps.length);
16590
+ insert(_el$104, (() => {
16591
+ var _c$4 = memo(() => s.feedSegments.length > 0);
16592
+ return () => _c$4() ? `${s.feedSegments.length} segment${s.feedSegments.length === 1 ? "" : "s"}, \u2264${s.feedMaxAgeDays}d` : _tmpl$363();
16411
16593
  })());
16412
- insert(_el$123, () => s.autoSend ? "Automatic" : "Review");
16413
- insert(_el$124, () => s.stats.active);
16414
- insert(_el$125, (() => {
16415
- var _c$7 = memo(() => dueFor(s.id) > 0);
16416
- return () => _c$7() ? (() => {
16417
- var _el$130 = _tmpl$295();
16418
- insert(_el$130, () => dueFor(s.id));
16419
- return _el$130;
16420
- })() : _tmpl$305();
16594
+ insert(_el$105, () => s.autoSend ? "Automatic" : "Review");
16595
+ insert(_el$106, () => s.stats.active);
16596
+ insert(_el$107, (() => {
16597
+ var _c$5 = memo(() => dueFor(s.id) > 0);
16598
+ return () => _c$5() ? (() => {
16599
+ var _el$112 = _tmpl$372();
16600
+ insert(_el$112, () => dueFor(s.id));
16601
+ return _el$112;
16602
+ })() : _tmpl$382();
16421
16603
  })());
16422
- insert(_el$126, () => s.stats.sent);
16423
- insert(_el$127, () => s.stats.boughtAfterEnroll);
16424
- insert(_el$128, () => s.stats.unsubscribed);
16425
- return _el$117;
16604
+ insert(_el$108, () => s.stats.sent);
16605
+ insert(_el$109, () => s.stats.boughtAfterEnroll);
16606
+ insert(_el$110, () => s.stats.unsubscribed);
16607
+ return _el$99;
16426
16608
  })()
16427
16609
  }));
16428
- return _el$114;
16610
+ return _el$96;
16429
16611
  }
16430
16612
  });
16431
16613
  }
16432
16614
  }), null);
16433
- return _el$110;
16615
+ return _el$92;
16434
16616
  })();
16435
16617
  },
16436
16618
  children: (seq) => createComponent(SequenceEditor, {
@@ -16448,7 +16630,7 @@ function Sequences() {
16448
16630
  onChanged: changed
16449
16631
  })
16450
16632
  }), null);
16451
- return _el$109;
16633
+ return _el$91;
16452
16634
  })();
16453
16635
  }
16454
16636
  delegateEvents(["click", "input"]);
@@ -16456,7 +16638,7 @@ delegateEvents(["click", "input"]);
16456
16638
  // src/pages/admin/Funnel.tsx
16457
16639
  var _tmpl$290 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
16458
16640
  var _tmpl$291 = /* @__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>`);
16459
- var _tmpl$356 = /* @__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 (<!>)`);
16641
+ var _tmpl$357 = /* @__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 (<!>)`);
16460
16642
  var _tmpl$443 = /* @__PURE__ */ template(`<th>Account`);
16461
16643
  var _tmpl$538 = /* @__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 <!>.`);
16462
16644
  var _tmpl$636 = /* @__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>`);
@@ -16568,7 +16750,7 @@ function SegmentSection(props) {
16568
16750
  return hasSavings();
16569
16751
  },
16570
16752
  get children() {
16571
- var _el$6 = _tmpl$356(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$0 = _el$8.nextSibling; _el$0.nextSibling;
16753
+ var _el$6 = _tmpl$357(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$0 = _el$8.nextSibling; _el$0.nextSibling;
16572
16754
  _el$7.addEventListener("change", (e) => setSavingsOnly(e.currentTarget.checked));
16573
16755
  insert(_el$6, () => props.summary.savingsMembers, _el$0);
16574
16756
  effect(() => _el$7.checked = savingsOnly());
@@ -16814,7 +16996,7 @@ function Funnel() {
16814
16996
  delegateEvents(["click"]);
16815
16997
  var _tmpl$296 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;margin:0.25rem 0 0">`);
16816
16998
  var _tmpl$297 = /* @__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">`);
16817
- var _tmpl$357 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox>`);
16999
+ var _tmpl$358 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox>`);
16818
17000
  var _tmpl$444 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">`);
16819
17001
  var _tmpl$539 = /* @__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`);
16820
17002
  var _tmpl$637 = /* @__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">`);
@@ -16855,7 +17037,7 @@ function Card(props) {
16855
17037
  }
16856
17038
  function Toggle(props) {
16857
17039
  return (() => {
16858
- var _el$7 = _tmpl$357(), _el$8 = _el$7.firstChild;
17040
+ var _el$7 = _tmpl$358(), _el$8 = _el$7.firstChild;
16859
17041
  _el$8.addEventListener("change", (e) => props.onChange(e.currentTarget.checked));
16860
17042
  insert(_el$7, () => props.label, null);
16861
17043
  effect(() => _el$8.checked = props.checked);
@@ -17165,7 +17347,7 @@ delegateEvents(["click", "input", "keydown"]);
17165
17347
  // src/pages/AdminDashboard.tsx
17166
17348
  var _tmpl$298 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
17167
17349
  var _tmpl$299 = /* @__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">`);
17168
- var _tmpl$358 = /* @__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>`);
17350
+ var _tmpl$359 = /* @__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>`);
17169
17351
  var _tmpl$445 = /* @__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">`);
17170
17352
  var _tmpl$540 = /* @__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`);
17171
17353
  var _tmpl$638 = /* @__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); } }`);
@@ -17247,6 +17429,7 @@ function AdminDashboard(props) {
17247
17429
  };
17248
17430
  const [pendingCustomerUid, setPendingCustomerUid] = createSignal(null);
17249
17431
  const [pendingThreadId, setPendingThreadId] = createSignal(null);
17432
+ const [pendingTemplateId, setPendingTemplateId] = createSignal(null);
17250
17433
  const handleTabClick = (tab, opts) => {
17251
17434
  if (!opts?.keepPending) {
17252
17435
  setPendingCustomerUid(null);
@@ -17274,6 +17457,12 @@ function AdminDashboard(props) {
17274
17457
  handleTabClick("support", {
17275
17458
  keepPending: true
17276
17459
  });
17460
+ },
17461
+ openEmailTemplate: (templateId) => {
17462
+ setPendingTemplateId(templateId);
17463
+ handleTabClick("email-templates", {
17464
+ keepPending: true
17465
+ });
17277
17466
  }
17278
17467
  };
17279
17468
  const topOffset = () => props.topOffset ?? "0px";
@@ -17317,7 +17506,7 @@ function AdminDashboard(props) {
17317
17506
  return createComponent(AdminNavContext.Provider, {
17318
17507
  value: adminNav,
17319
17508
  get children() {
17320
- var _el$3 = _tmpl$358(), _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;
17509
+ var _el$3 = _tmpl$359(), _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;
17321
17510
  _el$5.$$click = () => setDrawerOpen(true);
17322
17511
  insert(_el$6, () => TAB_LABELS[currentTab()]);
17323
17512
  _el$7.$$click = () => setDrawerOpen(false);
@@ -17487,7 +17676,11 @@ function AdminDashboard(props) {
17487
17676
  return currentTab() === "email-templates";
17488
17677
  },
17489
17678
  get children() {
17490
- return createComponent(EmailTemplates, {});
17679
+ return createComponent(EmailTemplates, {
17680
+ get initialCustomTemplateId() {
17681
+ return pendingTemplateId();
17682
+ }
17683
+ });
17491
17684
  }
17492
17685
  }), createComponent(Match, {
17493
17686
  get when() {
@@ -17566,7 +17759,7 @@ function AdminGateSpinner(props) {
17566
17759
  delegateEvents(["click"]);
17567
17760
  var _tmpl$300 = /* @__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`);
17568
17761
  var _tmpl$2100 = /* @__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`);
17569
- var _tmpl$359 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>Could not load this customer's dashboard.`);
17762
+ var _tmpl$360 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>Could not load this customer's dashboard.`);
17570
17763
  var _tmpl$446 = /* @__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">`);
17571
17764
  var _tmpl$541 = /* @__PURE__ */ template(`<div><h3>Subscription`);
17572
17765
  var _tmpl$639 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem>`);
@@ -17619,7 +17812,7 @@ function PatientDashboardPreview(props) {
17619
17812
  return data.profile();
17620
17813
  },
17621
17814
  get fallback() {
17622
- return _tmpl$359();
17815
+ return _tmpl$360();
17623
17816
  },
17624
17817
  children: (profile) => [(() => {
17625
17818
  var _el$13 = _tmpl$446(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling;
@@ -17780,7 +17973,7 @@ function PatientDashboardPreview(props) {
17780
17973
  delegateEvents(["click"]);
17781
17974
  var _tmpl$301 = /* @__PURE__ */ template(`<div style=margin-bottom:1rem>`);
17782
17975
  var _tmpl$2101 = /* @__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>`);
17783
- var _tmpl$360 = /* @__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.`);
17976
+ var _tmpl$361 = /* @__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.`);
17784
17977
  var LIVE = /* @__PURE__ */ new Set(["active", "paused", "past_due"]);
17785
17978
  function UpdatePaymentMethod(props) {
17786
17979
  const {
@@ -17810,7 +18003,7 @@ function UpdatePaymentMethod(props) {
17810
18003
  if (ok) props.onDone();
17811
18004
  }
17812
18005
  return (() => {
17813
- var _el$ = _tmpl$360(), _el$2 = _el$.firstChild;
18006
+ var _el$ = _tmpl$361(), _el$2 = _el$.firstChild;
17814
18007
  insert(_el$, createComponent(Heading, {
17815
18008
  level: 1,
17816
18009
  get children() {
@@ -17928,7 +18121,7 @@ function UpdatePaymentMethod(props) {
17928
18121
  }
17929
18122
  var _tmpl$306 = /* @__PURE__ */ template(`<a class=ship__track target=_blank rel="noopener noreferrer">Track<!> \u2197`);
17930
18123
  var _tmpl$2102 = /* @__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>`);
17931
- var _tmpl$361 = /* @__PURE__ */ template(`<span class=refill__cycle>Day <!> of `);
18124
+ var _tmpl$364 = /* @__PURE__ */ template(`<span class=refill__cycle>Day <!> of `);
17932
18125
  var _tmpl$447 = /* @__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>`);
17933
18126
  var _tmpl$542 = /* @__PURE__ */ template(`<span class=refill__cycle>Preparing your next fill`);
17934
18127
  var _tmpl$640 = /* @__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>`);
@@ -18004,7 +18197,7 @@ function OrderTracker(props) {
18004
18197
  return _tmpl$542();
18005
18198
  },
18006
18199
  get children() {
18007
- var _el$14 = _tmpl$361(), _el$15 = _el$14.firstChild, _el$17 = _el$15.nextSibling; _el$17.nextSibling;
18200
+ var _el$14 = _tmpl$364(), _el$15 = _el$14.firstChild, _el$17 = _el$15.nextSibling; _el$17.nextSibling;
18008
18201
  insert(_el$14, () => r().cycleDay, _el$17);
18009
18202
  insert(_el$14, () => r().cycleLength, null);
18010
18203
  return _el$14;
@@ -18245,7 +18438,7 @@ function OrderTracker(props) {
18245
18438
  delegateEvents(["click"]);
18246
18439
  var _tmpl$307 = /* @__PURE__ */ template(`<span class=rx-row__dose> \xB7 `);
18247
18440
  var _tmpl$2103 = /* @__PURE__ */ template(`<div class=rx-row__body>`);
18248
- var _tmpl$363 = /* @__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>`);
18441
+ var _tmpl$365 = /* @__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>`);
18249
18442
  var STATUS_LABEL = {
18250
18443
  pending: "Under review",
18251
18444
  approved: "Approved",
@@ -18262,7 +18455,7 @@ function RxRow(props) {
18262
18455
  return STATUS_LABEL[props.rx.status] ?? props.rx.status;
18263
18456
  };
18264
18457
  return (() => {
18265
- var _el$ = _tmpl$363(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$6 = _el$3.nextSibling, _el$7 = _el$6.nextSibling;
18458
+ var _el$ = _tmpl$365(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$6 = _el$3.nextSibling, _el$7 = _el$6.nextSibling;
18266
18459
  _el$2.$$click = () => setOpen((v) => !v);
18267
18460
  insert(_el$3, () => props.rx.drugName ?? "Medication", null);
18268
18461
  insert(_el$3, createComponent(Show, {
@@ -18326,7 +18519,7 @@ function RxRow(props) {
18326
18519
  delegateEvents(["click"]);
18327
18520
  var _tmpl$308 = /* @__PURE__ */ template(`<div class=plan data-testid=plan-billing><span class=lab-label>Plan &amp; billing`);
18328
18521
  var _tmpl$2104 = /* @__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`);
18329
- var _tmpl$364 = /* @__PURE__ */ template(`<p class=membership__dose>`);
18522
+ var _tmpl$366 = /* @__PURE__ */ template(`<p class=membership__dose>`);
18330
18523
  var _tmpl$448 = /* @__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 `);
18331
18524
  var _tmpl$543 = /* @__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`);
18332
18525
  var _tmpl$641 = /* @__PURE__ */ template(`<p class=plan__note>Question about billing? <button type=button class=plan__note-link>Message support`);
@@ -18401,7 +18594,7 @@ function PlanBilling(props) {
18401
18594
  return sub().dosage;
18402
18595
  },
18403
18596
  get children() {
18404
- var _el$11 = _tmpl$364();
18597
+ var _el$11 = _tmpl$366();
18405
18598
  insert(_el$11, () => sub().dosage);
18406
18599
  return _el$11;
18407
18600
  }
@@ -18505,7 +18698,7 @@ function PlanBilling(props) {
18505
18698
  delegateEvents(["click"]);
18506
18699
  var _tmpl$309 = /* @__PURE__ */ template(`<p class=account__empty>We don\u2019t have your details on file yet.`);
18507
18700
  var _tmpl$2105 = /* @__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.`);
18508
- var _tmpl$365 = /* @__PURE__ */ template(`<button type=button class="account__support-link account__support-btn">Messages`);
18701
+ var _tmpl$367 = /* @__PURE__ */ template(`<button type=button class="account__support-link account__support-btn">Messages`);
18509
18702
  var _tmpl$449 = /* @__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`);
18510
18703
  var _tmpl$544 = /* @__PURE__ */ template(`<div class=account__field><dt class=lab-label></dt><dd>`);
18511
18704
  var _tmpl$642 = /* @__PURE__ */ template(`<a class=account__support-link>`);
@@ -18587,7 +18780,7 @@ function AccountPanel(props) {
18587
18780
  return props.messagingEnabled;
18588
18781
  },
18589
18782
  get children() {
18590
- var _el$1 = _tmpl$365();
18783
+ var _el$1 = _tmpl$367();
18591
18784
  _el$1.$$click = () => props.onOpenMessages();
18592
18785
  return _el$1;
18593
18786
  }
@@ -18608,9 +18801,9 @@ function AccountPanel(props) {
18608
18801
  })();
18609
18802
  }
18610
18803
  delegateEvents(["click"]);
18611
- var _tmpl$366 = /* @__PURE__ */ template(`<section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Birth control</h2><p class=leaflet__body>`);
18804
+ var _tmpl$368 = /* @__PURE__ */ template(`<section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Birth control</h2><p class=leaflet__body>`);
18612
18805
  var _tmpl$2106 = /* @__PURE__ */ template(`<ul class=leaflet__disclaimers id=leaflet-disclaimers>`);
18613
- var _tmpl$367 = /* @__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>`);
18806
+ var _tmpl$369 = /* @__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>`);
18614
18807
  var _tmpl$450 = /* @__PURE__ */ template(`<li>`);
18615
18808
  var _tmpl$545 = /* @__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>`);
18616
18809
  var _tmpl$643 = /* @__PURE__ */ template(`<li class=steps__item><span class=steps__num></span><div class=steps__body><h3 class=steps__title></h3><p class=steps__detail>`);
@@ -18634,7 +18827,7 @@ function MedicationGuide(props) {
18634
18827
  return "upcoming";
18635
18828
  };
18636
18829
  return (() => {
18637
- var _el$ = _tmpl$367(), _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;
18830
+ var _el$ = _tmpl$369(), _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;
18638
18831
  insert(_el$4, () => props.guide.title);
18639
18832
  insert(_el$5, () => props.guide.summary);
18640
18833
  insert(_el$8, () => props.guide.boxedWarning);
@@ -18690,7 +18883,7 @@ function MedicationGuide(props) {
18690
18883
  return props.guide.contraception;
18691
18884
  },
18692
18885
  get children() {
18693
- var _el$24 = _tmpl$366(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
18886
+ var _el$24 = _tmpl$368(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
18694
18887
  insert(_el$26, () => props.guide.contraception);
18695
18888
  return _el$24;
18696
18889
  }
@@ -18769,9 +18962,9 @@ function MedicationGuide(props) {
18769
18962
  })();
18770
18963
  }
18771
18964
  delegateEvents(["click"]);
18772
- var _tmpl$368 = /* @__PURE__ */ template(`<span data-testid=channel-chip>`);
18965
+ var _tmpl$370 = /* @__PURE__ */ template(`<span data-testid=channel-chip>`);
18773
18966
  var _tmpl$2107 = /* @__PURE__ */ template(`<span class=channel-chip__category>`);
18774
- var _tmpl$369 = /* @__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`);
18967
+ var _tmpl$371 = /* @__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`);
18775
18968
  var _tmpl$451 = /* @__PURE__ */ template(`<div class=msg-list__state><div class=request-status__spinner>`);
18776
18969
  var _tmpl$546 = /* @__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>`);
18777
18970
  var _tmpl$644 = /* @__PURE__ */ template(`<div class=msg-list__scroll data-scrollable>`);
@@ -18801,14 +18994,14 @@ var _tmpl$2711 = /* @__PURE__ */ template(`<div class="msg-thread msg-choice"dat
18801
18994
  var _tmpl$2810 = /* @__PURE__ */ template(`<span class=msg-thread__status data-testid=thread-status-closed>Resolved`);
18802
18995
  var _tmpl$2910 = /* @__PURE__ */ template(`<span class=msg-thread__status data-testid=thread-status-transferred>Moved to care team`);
18803
18996
  var _tmpl$3010 = /* @__PURE__ */ template(`<div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"data-testid=messages-back><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><div class=msg-thread__title-row><h3 class=msg-thread__name></h3></div><p class=msg-thread__role>`);
18804
- var _tmpl$3112 = /* @__PURE__ */ template(`<div class=msg-thread__banner><button type=button class=msg-thread__banner-link data-testid=continue-with-care-team>Continue with your care team`);
18805
- var _tmpl$3210 = /* @__PURE__ */ template(`<div class=msg-thread__messages data-scrollable><div>`);
18806
- var _tmpl$3310 = /* @__PURE__ */ template(`<span class=msg-compose__error role=alert>`);
18807
- var _tmpl$3410 = /* @__PURE__ */ template(`<div class=msg-compose__staged>`);
18997
+ var _tmpl$3113 = /* @__PURE__ */ template(`<div class=msg-thread__banner><button type=button class=msg-thread__banner-link data-testid=continue-with-care-team>Continue with your care team`);
18998
+ var _tmpl$3211 = /* @__PURE__ */ template(`<div class=msg-thread__messages data-scrollable><div>`);
18999
+ var _tmpl$3311 = /* @__PURE__ */ template(`<span class=msg-compose__error role=alert>`);
19000
+ var _tmpl$3411 = /* @__PURE__ */ template(`<div class=msg-compose__staged>`);
18808
19001
  var _tmpl$3510 = /* @__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>`);
18809
19002
  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>`);
18810
- var _tmpl$372 = /* @__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`);
18811
- var _tmpl$382 = /* @__PURE__ */ template(`<div class=msg-panel__layout><div></div><div>`);
19003
+ var _tmpl$373 = /* @__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`);
19004
+ var _tmpl$383 = /* @__PURE__ */ template(`<div class=msg-panel__layout><div></div><div>`);
18812
19005
  var _tmpl$392 = /* @__PURE__ */ template(`<div class=msg-panel data-testid=messages-panel>`);
18813
19006
  var _tmpl$402 = /* @__PURE__ */ template(`<div class="msg-panel__layout msg-panel__layout--gate">`);
18814
19007
  var _tmpl$4110 = /* @__PURE__ */ template(`<div class=msg-panel__placeholder data-testid=messages-placeholder><p>Select a conversation to read and reply.`);
@@ -18997,7 +19190,7 @@ function MessagesPanel(props) {
18997
19190
  }
18998
19191
  }
18999
19192
  const ChannelChip = (p) => (() => {
19000
- var _el$ = _tmpl$368();
19193
+ var _el$ = _tmpl$370();
19001
19194
  insert(_el$, () => p.source === "clinical" ? "Care team" : "Support", null);
19002
19195
  insert(_el$, createComponent(Show, {
19003
19196
  get when() {
@@ -19022,7 +19215,7 @@ function MessagesPanel(props) {
19022
19215
  })();
19023
19216
  const channelConversations = () => thread().conversations().filter((c) => c.source === (channel() === "care" ? "clinical" : "support"));
19024
19217
  const ConversationList = () => [(() => {
19025
- var _el$3 = _tmpl$369(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling;
19218
+ var _el$3 = _tmpl$371(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling;
19026
19219
  _el$5.$$click = goToGate;
19027
19220
  insert(_el$6, () => channel() === "care" ? "My care team" : "Support");
19028
19221
  _el$7.$$click = openCompose;
@@ -19452,12 +19645,12 @@ function MessagesPanel(props) {
19452
19645
  return memo(() => selectedConvo()?.source === "support")() && (selectedConvo()?.status === "closed" || selectedConvo()?.status === "transferred");
19453
19646
  },
19454
19647
  get children() {
19455
- var _el$97 = _tmpl$3112(), _el$98 = _el$97.firstChild;
19648
+ var _el$97 = _tmpl$3113(), _el$98 = _el$97.firstChild;
19456
19649
  _el$98.$$click = continueWithCareTeam;
19457
19650
  return _el$97;
19458
19651
  }
19459
19652
  }), (() => {
19460
- var _el$99 = _tmpl$3210(), _el$101 = _el$99.firstChild;
19653
+ var _el$99 = _tmpl$3211(), _el$101 = _el$99.firstChild;
19461
19654
  insert(_el$99, createComponent(Show, {
19462
19655
  get when() {
19463
19656
  return thread().loadingMessages();
@@ -19482,13 +19675,13 @@ function MessagesPanel(props) {
19482
19675
  return pendingFile() || attachError();
19483
19676
  },
19484
19677
  get children() {
19485
- var _el$102 = _tmpl$3410();
19678
+ var _el$102 = _tmpl$3411();
19486
19679
  insert(_el$102, createComponent(Show, {
19487
19680
  get when() {
19488
19681
  return pendingFile();
19489
19682
  },
19490
19683
  children: (file) => (() => {
19491
- var _el$111 = _tmpl$372(), _el$112 = _el$111.firstChild, _el$113 = _el$112.nextSibling, _el$114 = _el$113.nextSibling;
19684
+ var _el$111 = _tmpl$373(), _el$112 = _el$111.firstChild, _el$113 = _el$112.nextSibling, _el$114 = _el$113.nextSibling;
19492
19685
  insert(_el$111, () => file().name, _el$113);
19493
19686
  insert(_el$113, () => formatFileSize(file().size));
19494
19687
  _el$114.$$click = () => setPendingFile(null);
@@ -19500,7 +19693,7 @@ function MessagesPanel(props) {
19500
19693
  return attachError();
19501
19694
  },
19502
19695
  get children() {
19503
- var _el$103 = _tmpl$3310();
19696
+ var _el$103 = _tmpl$3311();
19504
19697
  insert(_el$103, attachError);
19505
19698
  return _el$103;
19506
19699
  }
@@ -19549,7 +19742,7 @@ function MessagesPanel(props) {
19549
19742
  })();
19550
19743
  },
19551
19744
  get children() {
19552
- var _el$116 = _tmpl$382(), _el$117 = _el$116.firstChild, _el$118 = _el$117.nextSibling;
19745
+ var _el$116 = _tmpl$383(), _el$117 = _el$116.firstChild, _el$118 = _el$117.nextSibling;
19553
19746
  insert(_el$117, createComponent(ConversationList, {}));
19554
19747
  insert(_el$118, createComponent(Show, {
19555
19748
  get when() {
@@ -19618,9 +19811,9 @@ function MessagesPanel(props) {
19618
19811
  })();
19619
19812
  }
19620
19813
  delegateEvents(["click", "input", "keydown"]);
19621
- var _tmpl$370 = /* @__PURE__ */ template(`<ul class=history-list data-testid=history-list>`);
19814
+ var _tmpl$374 = /* @__PURE__ */ template(`<ul class=history-list data-testid=history-list>`);
19622
19815
  var _tmpl$2108 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-error><p>We couldn't load your submitted surveys. Please try again in a moment.`);
19623
- var _tmpl$371 = /* @__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.`);
19816
+ var _tmpl$375 = /* @__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.`);
19624
19817
  var _tmpl$452 = /* @__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>`);
19625
19818
  var _tmpl$547 = /* @__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`);
19626
19819
  var _tmpl$645 = /* @__PURE__ */ template(`<div class=portal-state><div class=request-status__spinner></div><p>Loading your answers\u2026`);
@@ -19665,10 +19858,10 @@ function SurveyHistory() {
19665
19858
  return (list() ?? []).length > 0;
19666
19859
  },
19667
19860
  get fallback() {
19668
- return _tmpl$371();
19861
+ return _tmpl$375();
19669
19862
  },
19670
19863
  get children() {
19671
- var _el$ = _tmpl$370();
19864
+ var _el$ = _tmpl$374();
19672
19865
  insert(_el$, createComponent(For, {
19673
19866
  get each() {
19674
19867
  return list();
@@ -19765,9 +19958,9 @@ function SurveyHistory() {
19765
19958
  delegateEvents(["click"]);
19766
19959
 
19767
19960
  // src/pages/MemberPortal.tsx
19768
- var _tmpl$373 = /* @__PURE__ */ template(`<span class=portal-item__live aria-label="In progress">`);
19961
+ var _tmpl$376 = /* @__PURE__ */ template(`<span class=portal-item__live aria-label="In progress">`);
19769
19962
  var _tmpl$2109 = /* @__PURE__ */ template(`<span>`);
19770
- var _tmpl$374 = /* @__PURE__ */ template(`<button type=button><i aria-hidden=true></i><span class=portal-item__label>`);
19963
+ var _tmpl$377 = /* @__PURE__ */ template(`<button type=button><i aria-hidden=true></i><span class=portal-item__label>`);
19771
19964
  var _tmpl$453 = /* @__PURE__ */ template(`<div class=rx-others data-testid=rx-others><span class=lab-label>Other orders`);
19772
19965
  var _tmpl$548 = /* @__PURE__ */ template(`<div class=rx-stack>`);
19773
19966
  var _tmpl$646 = /* @__PURE__ */ template(`<div class=portal-state><div class=request-status__spinner></div><p>Loading your portal\u2026`);
@@ -19899,7 +20092,7 @@ function MemberPortal(props) {
19899
20092
  return tabs();
19900
20093
  },
19901
20094
  children: (item) => (() => {
19902
- var _el$ = _tmpl$374(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
20095
+ var _el$ = _tmpl$377(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
19903
20096
  _el$.$$click = () => selectTab(item.key);
19904
20097
  insert(_el$3, () => item.label);
19905
20098
  insert(_el$, createComponent(Show, {
@@ -19907,7 +20100,7 @@ function MemberPortal(props) {
19907
20100
  return memo(() => item.key === "tracker")() && inMotion();
19908
20101
  },
19909
20102
  get children() {
19910
- return _tmpl$373();
20103
+ return _tmpl$376();
19911
20104
  }
19912
20105
  }), null);
19913
20106
  insert(_el$, createComponent(Show, {
@@ -20223,9 +20416,9 @@ function MemberPortal(props) {
20223
20416
  })();
20224
20417
  }
20225
20418
  delegateEvents(["click"]);
20226
- var _tmpl$375 = /* @__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.`);
20419
+ var _tmpl$378 = /* @__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.`);
20227
20420
  var _tmpl$2117 = /* @__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`);
20228
- var _tmpl$376 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading stats\u2026`);
20421
+ var _tmpl$379 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading stats\u2026`);
20229
20422
  var _tmpl$454 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));gap:1rem">`);
20230
20423
  var _tmpl$549 = /* @__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)>`);
20231
20424
  function formatMoney(cents) {
@@ -20266,7 +20459,7 @@ function AffiliateOverview() {
20266
20459
  return isPending();
20267
20460
  },
20268
20461
  get children() {
20269
- return _tmpl$375();
20462
+ return _tmpl$378();
20270
20463
  }
20271
20464
  }), null);
20272
20465
  insert(_el$, createComponent(Show, {
@@ -20274,7 +20467,7 @@ function AffiliateOverview() {
20274
20467
  return stats();
20275
20468
  },
20276
20469
  get fallback() {
20277
- return _tmpl$376();
20470
+ return _tmpl$379();
20278
20471
  },
20279
20472
  children: (s) => (() => {
20280
20473
  var _el$5 = _tmpl$454();
@@ -20295,9 +20488,9 @@ function AffiliateOverview() {
20295
20488
  return _el$;
20296
20489
  })();
20297
20490
  }
20298
- var _tmpl$377 = /* @__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>`);
20491
+ var _tmpl$380 = /* @__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>`);
20299
20492
  var _tmpl$2118 = /* @__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`);
20300
- var _tmpl$378 = /* @__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.`);
20493
+ var _tmpl$381 = /* @__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.`);
20301
20494
  var _tmpl$455 = /* @__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`);
20302
20495
  var _tmpl$550 = /* @__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">`);
20303
20496
  function formatMoney2(cents) {
@@ -20343,10 +20536,10 @@ function AffiliateConversions() {
20343
20536
  return (conversions() ?? []).length > 0;
20344
20537
  },
20345
20538
  get fallback() {
20346
- return _tmpl$378();
20539
+ return _tmpl$381();
20347
20540
  },
20348
20541
  get children() {
20349
- var _el$3 = _tmpl$377(), _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;
20542
+ var _el$3 = _tmpl$380(), _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;
20350
20543
  insert(_el$10, createComponent(For, {
20351
20544
  get each() {
20352
20545
  return conversions();
@@ -20428,9 +20621,9 @@ function td() {
20428
20621
  color: "var(--app-affiliate-fg)"
20429
20622
  };
20430
20623
  }
20431
- var _tmpl$379 = /* @__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>`);
20624
+ var _tmpl$384 = /* @__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>`);
20432
20625
  var _tmpl$2119 = /* @__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.`);
20433
- var _tmpl$380 = /* @__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.`);
20626
+ var _tmpl$385 = /* @__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.`);
20434
20627
  var _tmpl$456 = /* @__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>`);
20435
20628
  function formatDate4(iso) {
20436
20629
  const d = new Date(iso);
@@ -20470,10 +20663,10 @@ function AffiliateDownline() {
20470
20663
  return (downline() ?? []).length > 0;
20471
20664
  },
20472
20665
  get fallback() {
20473
- return _tmpl$380();
20666
+ return _tmpl$385();
20474
20667
  },
20475
20668
  get children() {
20476
- var _el$4 = _tmpl$379(), _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;
20669
+ var _el$4 = _tmpl$384(), _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;
20477
20670
  insert(_el$10, createComponent(For, {
20478
20671
  get each() {
20479
20672
  return downline();
@@ -20542,9 +20735,9 @@ function td2() {
20542
20735
  color: "var(--app-affiliate-fg)"
20543
20736
  };
20544
20737
  }
20545
- var _tmpl$381 = /* @__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.`);
20738
+ var _tmpl$386 = /* @__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.`);
20546
20739
  var _tmpl$2120 = /* @__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`);
20547
- var _tmpl$383 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Your referral link will appear here once your account is approved.`);
20740
+ var _tmpl$387 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Your referral link will appear here once your account is approved.`);
20548
20741
  function AffiliateReferralLink() {
20549
20742
  const {
20550
20743
  links
@@ -20575,10 +20768,10 @@ function AffiliateReferralLink() {
20575
20768
  return homepageLink();
20576
20769
  },
20577
20770
  get fallback() {
20578
- return _tmpl$383();
20771
+ return _tmpl$387();
20579
20772
  },
20580
20773
  get children() {
20581
- var _el$3 = _tmpl$381(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling; _el$5.nextSibling;
20774
+ var _el$3 = _tmpl$386(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling; _el$5.nextSibling;
20582
20775
  insert(_el$6, homepageLink);
20583
20776
  _el$7.$$click = copy;
20584
20777
  insert(_el$7, () => copied() ? "Copied" : "Copy");
@@ -20589,9 +20782,9 @@ function AffiliateReferralLink() {
20589
20782
  })();
20590
20783
  }
20591
20784
  delegateEvents(["click"]);
20592
- var _tmpl$384 = /* @__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.`);
20785
+ var _tmpl$388 = /* @__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.`);
20593
20786
  var _tmpl$2121 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading\u2026`);
20594
- var _tmpl$385 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden">`);
20787
+ var _tmpl$389 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden">`);
20595
20788
  var _tmpl$457 = /* @__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)>`);
20596
20789
  var STATUS_LABEL2 = {
20597
20790
  pending: "Pending approval",
@@ -20627,7 +20820,7 @@ function AffiliateSettings() {
20627
20820
  value: a.paymentEmail ?? "\u2014"
20628
20821
  }];
20629
20822
  return (() => {
20630
- var _el$ = _tmpl$384(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild; _el$3.nextSibling;
20823
+ var _el$ = _tmpl$388(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild; _el$3.nextSibling;
20631
20824
  insert(_el$, createComponent(Show, {
20632
20825
  get when() {
20633
20826
  return affiliate();
@@ -20636,7 +20829,7 @@ function AffiliateSettings() {
20636
20829
  return _tmpl$2121();
20637
20830
  },
20638
20831
  children: (a) => (() => {
20639
- var _el$7 = _tmpl$385();
20832
+ var _el$7 = _tmpl$389();
20640
20833
  insert(_el$7, createComponent(For, {
20641
20834
  get each() {
20642
20835
  return rows(a());
@@ -20658,9 +20851,9 @@ function AffiliateSettings() {
20658
20851
  delegateEvents(["click"]);
20659
20852
 
20660
20853
  // src/pages/AffiliatePortal.tsx
20661
- var _tmpl$386 = /* @__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>`);
20854
+ var _tmpl$390 = /* @__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>`);
20662
20855
  var _tmpl$2122 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
20663
- var _tmpl$387 = /* @__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">`);
20856
+ var _tmpl$391 = /* @__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">`);
20664
20857
  var _tmpl$458 = /* @__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); } }`);
20665
20858
  var TAB_LABELS2 = {
20666
20859
  overview: "Overview",
@@ -20706,7 +20899,7 @@ function AffiliatePortal(props) {
20706
20899
  });
20707
20900
  },
20708
20901
  get children() {
20709
- var _el$ = _tmpl$386(), _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;
20902
+ var _el$ = _tmpl$390(), _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;
20710
20903
  _el$3.$$click = () => setDrawerOpen(true);
20711
20904
  insert(_el$4, () => TAB_LABELS2[currentTab()]);
20712
20905
  _el$5.$$click = () => setDrawerOpen(false);
@@ -20715,7 +20908,7 @@ function AffiliatePortal(props) {
20715
20908
  return orderedTabs();
20716
20909
  },
20717
20910
  children: (tab) => (() => {
20718
- var _el$1 = _tmpl$387();
20911
+ var _el$1 = _tmpl$391();
20719
20912
  _el$1.$$click = () => handleTabClick(tab);
20720
20913
  insert(_el$1, createComponent(Show, {
20721
20914
  get when() {
@@ -20818,11 +21011,11 @@ function AffiliateGateSpinner(props) {
20818
21011
  })();
20819
21012
  }
20820
21013
  delegateEvents(["click"]);
20821
- var _tmpl$388 = /* @__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">`);
21014
+ var _tmpl$393 = /* @__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">`);
20822
21015
  function AffiliatePasswordInput(props) {
20823
21016
  const [visible, setVisible] = createSignal(false);
20824
21017
  return (() => {
20825
- var _el$ = _tmpl$388(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
21018
+ var _el$ = _tmpl$393(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
20826
21019
  _el$2.$$input = (e) => props.onInput(e.currentTarget.value);
20827
21020
  _el$3.$$click = () => setVisible((v) => !v);
20828
21021
  insert(_el$3, () => visible() ? "Hide" : "Show");
@@ -20863,9 +21056,9 @@ function inputStyle() {
20863
21056
  delegateEvents(["input", "click"]);
20864
21057
 
20865
21058
  // src/pages/AffiliateRegister.tsx
20866
- var _tmpl$389 = /* @__PURE__ */ template(`<input type=text required autocomplete=given-name>`);
21059
+ var _tmpl$394 = /* @__PURE__ */ template(`<input type=text required autocomplete=given-name>`);
20867
21060
  var _tmpl$2123 = /* @__PURE__ */ template(`<input type=text required autocomplete=family-name>`);
20868
- var _tmpl$390 = /* @__PURE__ */ template(`<input type=email required autocomplete=email>`);
21061
+ var _tmpl$395 = /* @__PURE__ */ template(`<input type=email required autocomplete=email>`);
20869
21062
  var _tmpl$459 = /* @__PURE__ */ template(`<input type=text required minlength=4>`);
20870
21063
  var _tmpl$551 = /* @__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">`);
20871
21064
  var _tmpl$647 = /* @__PURE__ */ template(`<button type=button>Already have an account? Log in`);
@@ -20918,7 +21111,7 @@ function AffiliateRegister(props) {
20918
21111
  insert(_el$6, createComponent(Row, {
20919
21112
  label: "First name",
20920
21113
  get children() {
20921
- var _el$7 = _tmpl$389();
21114
+ var _el$7 = _tmpl$394();
20922
21115
  _el$7.$$input = (e) => setFirstName(e.currentTarget.value);
20923
21116
  effect((_$p) => style(_el$7, inputStyle2(), _$p));
20924
21117
  effect(() => _el$7.value = firstName());
@@ -20938,7 +21131,7 @@ function AffiliateRegister(props) {
20938
21131
  insert(_el$6, createComponent(Row, {
20939
21132
  label: "Email",
20940
21133
  get children() {
20941
- var _el$9 = _tmpl$390();
21134
+ var _el$9 = _tmpl$395();
20942
21135
  _el$9.$$input = (e) => setEmail(e.currentTarget.value);
20943
21136
  effect((_$p) => style(_el$9, inputStyle2(), _$p));
20944
21137
  effect(() => _el$9.value = email());
@@ -21057,9 +21250,9 @@ function linkStyle() {
21057
21250
  };
21058
21251
  }
21059
21252
  delegateEvents(["input", "click"]);
21060
- var _tmpl$391 = /* @__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">`);
21253
+ var _tmpl$396 = /* @__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">`);
21061
21254
  var _tmpl$2124 = /* @__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?`);
21062
- var _tmpl$393 = /* @__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`);
21255
+ var _tmpl$397 = /* @__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`);
21063
21256
  var _tmpl$460 = /* @__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">`);
21064
21257
  function AffiliateLogin(props) {
21065
21258
  const [email, setEmail] = createSignal("");
@@ -21096,7 +21289,7 @@ function AffiliateLogin(props) {
21096
21289
  return error();
21097
21290
  },
21098
21291
  get children() {
21099
- var _el$0 = _tmpl$391();
21292
+ var _el$0 = _tmpl$396();
21100
21293
  insert(_el$0, error);
21101
21294
  return _el$0;
21102
21295
  }
@@ -21117,7 +21310,7 @@ function AffiliateLogin(props) {
21117
21310
  return props.onNavigateRegister;
21118
21311
  },
21119
21312
  get children() {
21120
- var _el$11 = _tmpl$393();
21313
+ var _el$11 = _tmpl$397();
21121
21314
  _el$11.$$click = () => props.onNavigateRegister?.();
21122
21315
  return _el$11;
21123
21316
  }
@@ -21165,9 +21358,9 @@ function inputStyle3() {
21165
21358
  };
21166
21359
  }
21167
21360
  delegateEvents(["input", "click"]);
21168
- var _tmpl$394 = /* @__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">`);
21361
+ var _tmpl$398 = /* @__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">`);
21169
21362
  var _tmpl$2125 = /* @__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">`);
21170
- var _tmpl$395 = /* @__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`);
21363
+ var _tmpl$399 = /* @__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`);
21171
21364
  var _tmpl$461 = /* @__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">`);
21172
21365
  var _tmpl$552 = /* @__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.`);
21173
21366
  var _tmpl$648 = /* @__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`);
@@ -21193,7 +21386,7 @@ function ForgotPasswordPage(props) {
21193
21386
  }
21194
21387
  }
21195
21388
  return (() => {
21196
- var _el$ = _tmpl$395(), _el$2 = _el$.firstChild; _el$2.firstChild;
21389
+ var _el$ = _tmpl$399(), _el$2 = _el$.firstChild; _el$2.firstChild;
21197
21390
  insert(_el$2, createComponent(Show, {
21198
21391
  get when() {
21199
21392
  return !message();
@@ -21223,7 +21416,7 @@ function ForgotPasswordPage(props) {
21223
21416
  return error();
21224
21417
  },
21225
21418
  get children() {
21226
- var _el$8 = _tmpl$394();
21419
+ var _el$8 = _tmpl$398();
21227
21420
  insert(_el$8, error);
21228
21421
  return _el$8;
21229
21422
  }
@@ -21273,9 +21466,9 @@ function inputStyle4() {
21273
21466
  };
21274
21467
  }
21275
21468
  delegateEvents(["input", "click"]);
21276
- var _tmpl$396 = /* @__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">`);
21469
+ var _tmpl$400 = /* @__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">`);
21277
21470
  var _tmpl$2126 = /* @__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">`);
21278
- var _tmpl$397 = /* @__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`);
21471
+ var _tmpl$3100 = /* @__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`);
21279
21472
  var _tmpl$462 = /* @__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">`);
21280
21473
  function queryParam(name) {
21281
21474
  if (typeof window === "undefined") return "";
@@ -21316,7 +21509,7 @@ function ResetPasswordPage(props) {
21316
21509
  }
21317
21510
  }
21318
21511
  return (() => {
21319
- var _el$ = _tmpl$397(), _el$2 = _el$.firstChild; _el$2.firstChild;
21512
+ var _el$ = _tmpl$3100(), _el$2 = _el$.firstChild; _el$2.firstChild;
21320
21513
  insert(_el$2, createComponent(Show, {
21321
21514
  get when() {
21322
21515
  return !message();
@@ -21338,7 +21531,7 @@ function ResetPasswordPage(props) {
21338
21531
  return error();
21339
21532
  },
21340
21533
  get children() {
21341
- var _el$1 = _tmpl$396();
21534
+ var _el$1 = _tmpl$400();
21342
21535
  insert(_el$1, error);
21343
21536
  return _el$1;
21344
21537
  }
@@ -21393,9 +21586,9 @@ function inputStyle5() {
21393
21586
  };
21394
21587
  }
21395
21588
  delegateEvents(["input"]);
21396
- var _tmpl$398 = /* @__PURE__ */ template(`<div>`);
21589
+ var _tmpl$401 = /* @__PURE__ */ template(`<div>`);
21397
21590
  var _tmpl$2127 = /* @__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>`);
21398
- var _tmpl$399 = /* @__PURE__ */ template(`<button type=button>Back to login`);
21591
+ var _tmpl$3101 = /* @__PURE__ */ template(`<button type=button>Back to login`);
21399
21592
  var _tmpl$463 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Reset your password`);
21400
21593
  var _tmpl$553 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>`);
21401
21594
  function AffiliateForgotPassword(props) {
@@ -21441,7 +21634,7 @@ function AffiliateForgotPassword(props) {
21441
21634
  return error();
21442
21635
  },
21443
21636
  get children() {
21444
- var _el$8 = _tmpl$398();
21637
+ var _el$8 = _tmpl$401();
21445
21638
  insert(_el$8, error);
21446
21639
  effect((_$p) => style(_el$8, errorStyle(), _$p));
21447
21640
  return _el$8;
@@ -21470,7 +21663,7 @@ function AffiliateForgotPassword(props) {
21470
21663
  return props.onNavigateLogin;
21471
21664
  },
21472
21665
  get children() {
21473
- var _el$0 = _tmpl$399();
21666
+ var _el$0 = _tmpl$3101();
21474
21667
  _el$0.$$click = () => props.onNavigateLogin?.();
21475
21668
  effect((_$p) => style(_el$0, linkStyle2(), _$p));
21476
21669
  return _el$0;
@@ -21576,9 +21769,9 @@ function linkStyle2() {
21576
21769
  };
21577
21770
  }
21578
21771
  delegateEvents(["input", "click"]);
21579
- var _tmpl$400 = /* @__PURE__ */ template(`<div>`);
21772
+ var _tmpl$403 = /* @__PURE__ */ template(`<div>`);
21580
21773
  var _tmpl$2128 = /* @__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>`);
21581
- var _tmpl$3100 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Choose a new password`);
21774
+ var _tmpl$3102 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Choose a new password`);
21582
21775
  var _tmpl$464 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>Your password has been reset. You can now log in with your new password.`);
21583
21776
  function queryParam2(name) {
21584
21777
  if (typeof window === "undefined") return "";
@@ -21623,7 +21816,7 @@ function AffiliateResetPassword(props) {
21623
21816
  }
21624
21817
  }
21625
21818
  return (() => {
21626
- var _el$ = _tmpl$3100(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
21819
+ var _el$ = _tmpl$3102(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
21627
21820
  insert(_el$2, createComponent(Show, {
21628
21821
  get when() {
21629
21822
  return !done();
@@ -21657,7 +21850,7 @@ function AffiliateResetPassword(props) {
21657
21850
  return error();
21658
21851
  },
21659
21852
  get children() {
21660
- var _el$9 = _tmpl$400();
21853
+ var _el$9 = _tmpl$403();
21661
21854
  insert(_el$9, error);
21662
21855
  effect((_$p) => style(_el$9, errorStyle2(), _$p));
21663
21856
  return _el$9;
@@ -21756,5 +21949,5 @@ function primaryButtonStyle2(submitting) {
21756
21949
  }
21757
21950
 
21758
21951
  export { AddressFields, AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod };
21759
- //# sourceMappingURL=WCYQ2AYW.js.map
21760
- //# sourceMappingURL=WCYQ2AYW.js.map
21952
+ //# sourceMappingURL=UCF2EXRL.js.map
21953
+ //# sourceMappingURL=UCF2EXRL.js.map