@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.
@@ -3875,7 +3875,7 @@ var US_STATES3 = [
3875
3875
  var US_STATE_OPTIONS3 = US_STATES3.map((s) => ({ value: s, label: s }));
3876
3876
 
3877
3877
  // src/pages/AdminDashboard.tsx
3878
- import { createEffect as createEffect10, createSignal as createSignal31, ErrorBoundary, Match as Match2, Show as Show46, Switch as Switch2, For as For34 } from "solid-js";
3878
+ import { createEffect as createEffect11, createSignal as createSignal31, ErrorBoundary, Match as Match3, Show as Show46, Switch as Switch3, For as For34 } from "solid-js";
3879
3879
 
3880
3880
  // src/pages/admin/Affiliates.tsx
3881
3881
  import { createSignal as createSignal10, For as For14, Match, Switch } from "solid-js";
@@ -13577,7 +13577,7 @@ function Webhooks() {
13577
13577
  }
13578
13578
 
13579
13579
  // src/pages/admin/EmailTemplates.tsx
13580
- import { createSignal as createSignal27, createResource as createResource19, For as For30, Show as Show42 } from "solid-js";
13580
+ import { createEffect as createEffect10, createSignal as createSignal27, createResource as createResource19, For as For30, Show as Show42 } from "solid-js";
13581
13581
 
13582
13582
  // src/pages/admin/EmailTextEditor.tsx
13583
13583
  import { createSignal as createSignal26, For as For29, Index, Show as Show41 } from "solid-js";
@@ -13817,7 +13817,7 @@ function toInput(t) {
13817
13817
  closingText: t.closingText
13818
13818
  };
13819
13819
  }
13820
- function EmailTemplates() {
13820
+ function EmailTemplates(props = {}) {
13821
13821
  const [refreshKey, setRefreshKey] = createSignal27(0);
13822
13822
  const [placeholders, setPlaceholders] = createSignal27({});
13823
13823
  const [customTemplates, setCustomTemplates] = createSignal27([]);
@@ -13849,7 +13849,9 @@ function EmailTemplates() {
13849
13849
  if (other.length > 0) groups.push({ label: "Other", keys: other });
13850
13850
  return groups;
13851
13851
  };
13852
- const [selection, setSelection] = createSignal27({ kind: "fixed", key: "" });
13852
+ const [selection, setSelection] = createSignal27(
13853
+ props.initialCustomTemplateId ? { kind: "custom", id: props.initialCustomTemplateId } : { kind: "fixed", key: "" }
13854
+ );
13853
13855
  const [draft, setDraft] = createSignal27(null);
13854
13856
  const [customDraft, setCustomDraft] = createSignal27(null);
13855
13857
  const [saving, setSaving] = createSignal27(false);
@@ -13877,6 +13879,14 @@ function EmailTemplates() {
13877
13879
  if (keys.length > 0 && s.kind === "fixed" && !s.key) setSelection({ kind: "fixed", key: keys[0] });
13878
13880
  }
13879
13881
  };
13882
+ createEffect10(() => {
13883
+ const s = selection();
13884
+ const list = customTemplates();
13885
+ if (s.kind === "custom" && s.id && !customDraft()) {
13886
+ const saved = list.find((c) => c.id === s.id);
13887
+ if (saved) setCustomDraft(toInput(saved));
13888
+ }
13889
+ });
13880
13890
  const currentDraft = () => {
13881
13891
  ensureDraft();
13882
13892
  const d = draft();
@@ -14289,7 +14299,7 @@ function EmailTemplates() {
14289
14299
  import { createResource as createResource21, createSignal as createSignal29, For as For32, Show as Show44 } from "solid-js";
14290
14300
 
14291
14301
  // src/pages/admin/Sequences.tsx
14292
- import { createResource as createResource20, createSignal as createSignal28, For as For31, Index as Index2, Show as Show43 } from "solid-js";
14302
+ import { createResource as createResource20, createSignal as createSignal28, For as For31, Index as Index2, Match as Match2, Show as Show43, Switch as Switch2 } from "solid-js";
14293
14303
 
14294
14304
  // src/pages/admin/funnelShared.ts
14295
14305
  var SEGMENT_KEYS = {
@@ -14360,10 +14370,9 @@ var label = { "font-size": "0.8125rem", color: "var(--app-admin-fg-muted)" };
14360
14370
  var field = { display: "grid", gap: "0.25rem" };
14361
14371
  function SequenceQueue(props) {
14362
14372
  const nav = useAdminNav();
14363
- const [reload, setReload] = createSignal28(0);
14364
14373
  const [busy, setBusy] = createSignal28(null);
14365
- const [queue, { refetch }] = createResource20(reload, () => apiFetch("/admin/funnel/queue"));
14366
- const rows = () => (queue()?.due ?? []).filter((r) => r.sequenceId === props.sequence.id);
14374
+ const rows = () => props.rows ?? [];
14375
+ const refetch = () => props.refetch();
14367
14376
  const act = async (row, action) => {
14368
14377
  setBusy(row.enrollmentId);
14369
14378
  try {
@@ -14390,7 +14399,7 @@ function SequenceQueue(props) {
14390
14399
  toastSuccess(
14391
14400
  Object.entries(r.outcomes).map(([k, n]) => `${n} ${OUTCOME_LABEL[k] ?? k}`).join(", ") || "Nothing was due"
14392
14401
  );
14393
- setReload(reload() + 1);
14402
+ refetch();
14394
14403
  props.onChanged();
14395
14404
  } catch (e) {
14396
14405
  toastError(e.message);
@@ -14398,24 +14407,28 @@ function SequenceQueue(props) {
14398
14407
  setBusy(null);
14399
14408
  }
14400
14409
  };
14401
- return <div class="app-admin-card" style={{ "margin-top": "1.25rem", overflow: "hidden" }}>
14402
- <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" }}>
14403
- <div>
14404
- <h2 class="app-admin-heading" style={{ "font-size": "0.9375rem", "font-weight": "600", margin: 0 }}>
14405
- Waiting to send{queue() ? ` \u2014 ${rows().length} due` : ""}
14406
- </h2>
14407
- <p style={{ ...label, "font-size": "0.75rem", margin: "0.25rem 0 0" }}>
14408
- {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."}
14409
- </p>
14410
- </div>
14411
- <Show43 when={rows().length > 0}>
14410
+ return <Section
14411
+ title="Waiting to send"
14412
+ count={rows().length}
14413
+ flush
14414
+ action={<Show43 when={rows().length > 0}>
14412
14415
  <button type="button" class="app-admin-btn app-admin-btn-primary app-admin-btn-sm" disabled={busy() === "all"} onClick={() => void sendAll()}>
14413
14416
  Send all due
14414
14417
  </button>
14415
- </Show43>
14416
- </div>
14417
- <Show43 when={queue()} fallback={<LoadingSpinner />}>
14418
- <Show43 when={rows().length > 0} fallback={<EmptyState message="Nobody in this sequence is due right now." />}>
14418
+ </Show43>}
14419
+ >
14420
+ <Show43 when={!props.sequence.autoSend}>
14421
+ <p class="app-admin-text-muted" style={{ "font-size": "0.75rem", margin: 0, padding: "0.625rem 1.25rem 0" }}>
14422
+ Nothing here has been emailed, and nothing will be until you send it or turn automatic sending on.
14423
+ </p>
14424
+ </Show43>
14425
+ <Show43 when={props.rows} fallback={<LoadingSpinner />}>
14426
+ <Show43
14427
+ when={rows().length > 0}
14428
+ fallback={<EmptyState
14429
+ message={props.sequence.autoSend ? "Nothing due \u2014 the hourly check sends these itself." : "Nobody is due right now."}
14430
+ />}
14431
+ >
14419
14432
  <table class="app-admin-table">
14420
14433
  <thead>
14421
14434
  <tr><th>Person</th><th>Came from</th><th>Waiting</th><th>Step</th><th /></tr>
@@ -14430,13 +14443,13 @@ function SequenceQueue(props) {
14430
14443
  </td>
14431
14444
  <td data-label="Came from">{segmentLongLabel(row.segmentAtAdd)}</td>
14432
14445
  <td data-label="Waiting">{daysAgo(row.anchoredAt)}</td>
14433
- <td data-label="Step">Step {row.stepIndex + 1} of {row.stepCount}</td>
14434
- <td>
14435
- <div style={{ display: "flex", gap: "0.375rem", "flex-wrap": "wrap" }}>
14446
+ <td data-label="Step">{row.stepIndex + 1} of {row.stepCount}</td>
14447
+ <td class="app-admin-table-cell--end">
14448
+ <div style={{ display: "flex", gap: "0.375rem", "justify-content": "flex-end" }}>
14436
14449
  <button type="button" class="app-admin-btn app-admin-btn-primary app-admin-btn-sm" disabled={busy() === row.enrollmentId} onClick={() => void act(row, "send")}>
14437
14450
  {busy() === row.enrollmentId ? "Sending\u2026" : "Send"}
14438
14451
  </button>
14439
- <button type="button" class="app-admin-btn app-admin-btn-sm" disabled={busy() === row.enrollmentId} onClick={() => void act(row, "skip")} title="Move past this step without emailing. They stay in the sequence for the next one.">
14452
+ <button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" disabled={busy() === row.enrollmentId} onClick={() => void act(row, "skip")} title="Move past this step without emailing. They stay in the sequence for the next one.">
14440
14453
  Skip
14441
14454
  </button>
14442
14455
  </div>
@@ -14447,7 +14460,7 @@ function SequenceQueue(props) {
14447
14460
  </table>
14448
14461
  </Show43>
14449
14462
  </Show43>
14450
- </div>;
14463
+ </Section>;
14451
14464
  }
14452
14465
  var OUTCOME_LABEL = {
14453
14466
  sent: "sent",
@@ -14494,64 +14507,76 @@ function AddToSequence(props) {
14494
14507
  </Show43>
14495
14508
  </div>;
14496
14509
  }
14497
- function StepEditor(props) {
14510
+ function StepRow(props) {
14498
14511
  const nav = useAdminNav();
14499
14512
  const set = (k, v) => props.onChange({ ...props.step, [k]: v });
14500
14513
  const missingTemplate = () => props.step.templateId && !props.templates.some((t) => t.id === props.step.templateId);
14501
- return <div class="app-admin-card-soft" style={{ padding: "1rem", display: "grid", gap: "1rem" }}>
14502
- <div style={{ display: "flex", "justify-content": "space-between", "align-items": "center" }}>
14503
- <strong style={{ "font-size": "0.875rem" }}>Step {props.index + 1}</strong>
14504
- <div style={{ display: "flex", gap: "0.375rem" }}>
14505
- <button type="button" class="app-admin-btn app-admin-btn-sm" onClick={() => props.onTest()}>Send me a test</button>
14506
- <Show43 when={props.count > 1}>
14507
- <button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" onClick={() => props.onRemove()}>Remove step</button>
14508
- </Show43>
14509
- </div>
14510
- </div>
14511
- <div style={{ display: "grid", "grid-template-columns": "repeat(auto-fit, minmax(12rem, 1fr))", gap: "0.75rem" }}>
14512
- <label style={field}>
14513
- <span style={label}>{props.index === 0 ? "Hours after they are added" : "Hours after the previous step"}</span>
14514
- <input class="app-admin-input" type="number" min="1" max="720" value={props.step.waitHours} onInput={(e) => set("waitHours", Number(e.currentTarget.value))} />
14515
- </label>
14516
- <label style={field}>
14517
- <span style={label}>Template</span>
14518
- <Show43
14519
- when={props.templates.length > 0}
14520
- fallback={<div style={{ display: "flex", gap: "0.5rem", "align-items": "center", "flex-wrap": "wrap" }}>
14521
- <span class="app-admin-text-muted" style={{ "font-size": "0.8125rem" }}>Create one under Email › Templates first.</span>
14522
- <Show43 when={nav}>
14523
- <button type="button" class="app-admin-btn app-admin-btn-sm" onClick={() => nav.selectTab("email-templates")}>Open Email › Templates</button>
14524
- </Show43>
14525
- </div>}
14514
+ const canEditTemplate = () => !!nav && !!props.step.templateId && !missingTemplate();
14515
+ return <div
14516
+ style={{
14517
+ display: "grid",
14518
+ "grid-template-columns": "2rem minmax(7rem, 9rem) minmax(12rem, 2fr) auto minmax(10rem, 1fr) auto",
14519
+ gap: "0.5rem",
14520
+ "align-items": "center",
14521
+ padding: "0.625rem 1.25rem",
14522
+ "border-top": props.index === 0 ? "none" : "1px solid var(--app-admin-border-soft)"
14523
+ }}
14524
+ >
14525
+ <span class="app-admin-text-muted" style={{ "font-size": "0.8125rem", "font-weight": "600" }}>{props.index + 1}</span>
14526
+ <label style={{ display: "flex", gap: "0.375rem", "align-items": "center", "font-size": "0.8125rem" }}>
14527
+ <span class="app-admin-text-muted">{props.index === 0 ? "after" : "+"}</span>
14528
+ <input class="app-admin-input" type="number" min="1" max="720" aria-label={`Step ${props.index + 1} wait hours`} value={props.step.waitHours} onInput={(e) => set("waitHours", Number(e.currentTarget.value))} style={{ width: "4.5rem" }} />
14529
+ <span class="app-admin-text-muted">h</span>
14530
+ </label>
14531
+ <select class="app-admin-input" aria-label={`Step ${props.index + 1} template`} value={props.step.templateId} onChange={(e) => set("templateId", e.currentTarget.value)}>
14532
+ <option value="">Choose a template…</option>
14533
+ <Show43 when={missingTemplate()}>
14534
+ <option value={props.step.templateId}>(deleted template)</option>
14535
+ </Show43>
14536
+ <For31 each={props.templates}>{(t) => <option value={t.id}>{t.name}</option>}</For31>
14537
+ </select>
14538
+ {
14539
+ /* Straight to the copy: the template opens in Email › Templates. */
14540
+ }
14541
+ <button
14542
+ type="button"
14543
+ class="app-admin-link-btn"
14544
+ style={{ "font-size": "0.8125rem", "white-space": "nowrap", visibility: canEditTemplate() ? "visible" : "hidden" }}
14545
+ aria-label={`Edit template for step ${props.index + 1}`}
14546
+ onClick={() => nav.openEmailTemplate(props.step.templateId)}
14526
14547
  >
14527
- <select class="app-admin-input" value={props.step.templateId} onChange={(e) => set("templateId", e.currentTarget.value)}>
14528
- <option value="">Choose a template…</option>
14529
- <Show43 when={missingTemplate()}>
14530
- <option value={props.step.templateId}>(deleted template)</option>
14531
- </Show43>
14532
- <For31 each={props.templates}>{(t) => <option value={t.id}>{t.name}</option>}</For31>
14533
- </select>
14534
- </Show43>
14535
- </label>
14536
- <label style={field}>
14537
- <span style={label}>Link ({"{{link}}"})</span>
14538
- <select class="app-admin-input" value={props.step.link} onChange={(e) => set("link", e.currentTarget.value)}>
14539
- <For31 each={LINKS}>{(l) => <option value={l}>{LINK_LABEL[l]}</option>}</For31>
14540
- </select>
14541
- </label>
14548
+ Edit template
14549
+ </button>
14550
+ <select class="app-admin-input" aria-label={`Step ${props.index + 1} link`} value={props.step.link} onChange={(e) => set("link", e.currentTarget.value)}>
14551
+ <For31 each={LINKS}>{(l) => <option value={l}>{LINK_LABEL[l]}</option>}</For31>
14552
+ </select>
14553
+ <div style={{ display: "flex", gap: "0.25rem" }}>
14554
+ <button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" disabled={!props.canTest} title={props.canTest ? "Email this step to me" : "Save first"} onClick={() => props.onTest()}>Test</button>
14555
+ <button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" disabled={props.count <= 1} title="Remove step" aria-label={`Remove step ${props.index + 1}`} onClick={() => props.onRemove()}>×</button>
14542
14556
  </div>
14543
14557
  </div>;
14544
14558
  }
14559
+ var checkboxRow = { "font-size": "0.8125rem", display: "flex", gap: "0.5rem", "align-items": "flex-start" };
14545
14560
  function SequenceEditor(props) {
14546
14561
  const nav = useAdminNav();
14547
14562
  const [draft, setDraft] = createSignal28(JSON.parse(JSON.stringify(props.initial)));
14548
14563
  const [saving, setSaving] = createSignal28(false);
14549
14564
  const [error, setError] = createSignal28(null);
14550
14565
  const isNew = () => !draft().id;
14566
+ const dirty = () => JSON.stringify(draft()) !== JSON.stringify(props.initial);
14551
14567
  const [enrollments, { refetch: refetchEnrollments }] = createResource20(
14552
14568
  () => props.initial.id || null,
14553
14569
  (id) => apiFetch(`/admin/funnel/sequences/${id}/enrollments`)
14554
14570
  );
14571
+ const [queue, { refetch: refetchQueue }] = createResource20(
14572
+ () => props.initial.id || null,
14573
+ () => apiFetch("/admin/funnel/queue")
14574
+ );
14575
+ const dueRows = () => queue() ? queue().due.filter((r) => r.sequenceId === props.initial.id) : void 0;
14576
+ const [tab, setTab] = createSignal28(isNew() ? "settings" : "queue");
14577
+ const tabKeys = () => isNew() ? ["steps", "settings"] : ["queue", "steps", "people", "settings"];
14578
+ const TAB_LABEL = { queue: "Queue", steps: "Steps", people: "People", settings: "Settings" };
14579
+ const tabCount = (key) => key === "queue" ? dueRows()?.length : key === "steps" ? draft().steps.length : key === "people" ? enrollments()?.enrollments.length : void 0;
14555
14580
  const update = (patch) => setDraft({ ...draft(), ...patch });
14556
14581
  const setStep = (i, s) => update({ steps: draft().steps.map((x, j) => j === i ? s : x) });
14557
14582
  const payload = () => {
@@ -14591,10 +14616,6 @@ function SequenceEditor(props) {
14591
14616
  }
14592
14617
  };
14593
14618
  const test = async (stepIndex) => {
14594
- if (isNew()) {
14595
- toastError("Save the sequence first, then send a test.");
14596
- return;
14597
- }
14598
14619
  try {
14599
14620
  const r = await apiFetch(`/admin/funnel/sequences/${draft().id}/test`, { method: "POST", body: JSON.stringify({ stepIndex }) });
14600
14621
  toastSuccess(`Test sent to ${r.to} \u2014 uses the saved step and its template, not unsaved edits.`);
@@ -14615,137 +14636,200 @@ function SequenceEditor(props) {
14615
14636
  const cur = draft().feedSegments;
14616
14637
  update({ feedSegments: cur.includes(key) ? cur.filter((k) => k !== key) : [...cur, key] });
14617
14638
  };
14618
- return <div class="app-admin-card" style={{ "margin-top": "1.25rem" }}>
14619
- <div style={{ padding: "1rem 1.25rem", "border-bottom": "1px solid var(--app-admin-border-soft)", display: "flex", "justify-content": "space-between", "align-items": "center" }}>
14620
- <h2 class="app-admin-heading" style={{ "font-size": "0.9375rem", "font-weight": "600", margin: 0 }}>{isNew() ? "New sequence" : draft().name}</h2>
14621
- <button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" onClick={() => props.onClose()}>Back to list</button>
14622
- </div>
14639
+ 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";
14640
+ return <div>
14641
+ <DetailHeader
14642
+ backLabel="Sequences"
14643
+ onBack={() => props.onClose()}
14644
+ title={isNew() ? "New sequence" : draft().name || "Untitled sequence"}
14645
+ subtitle={draft().description || (isNew() ? "Timed emails for people who stopped short of a subscription." : void 0)}
14646
+ badges={<>
14647
+ <span class={`app-admin-badge app-admin-badge--${draft().autoSend ? "success" : "info"}`} style={{ "text-transform": "none" }}>{draft().autoSend ? "Sends automatically" : "Sends on review"}</span>
14648
+ <span class="app-admin-badge app-admin-badge--neutral" style={{ "text-transform": "none" }}>{feedSummary()}</span>
14649
+ <Show43 when={!isNew() && enrollments()}>
14650
+ <span class="app-admin-badge app-admin-badge--neutral" style={{ "text-transform": "none" }}>{enrollments().enrollments.length} in it</span>
14651
+ </Show43>
14652
+ </>}
14653
+ actions={<>
14654
+ <Show43 when={!isNew()}>
14655
+ <button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" onClick={() => void archive()}>Archive</button>
14656
+ </Show43>
14657
+ <button type="button" class="app-admin-btn app-admin-btn-primary" disabled={saving() || !isNew() && !dirty()} onClick={() => void save()}>
14658
+ {saving() ? "Saving\u2026" : isNew() ? "Create sequence" : "Save changes"}
14659
+ </button>
14660
+ </>}
14661
+ />
14623
14662
 
14624
- <Show43 when={!isNew()}>
14625
- <div style={{ padding: "0 1.25rem" }}>
14626
- <SequenceQueue sequence={props.initial} onChanged={props.onChanged} />
14627
- </div>
14663
+ <Show43 when={error()}>
14664
+ <AlertItem severity="danger" title="Could not save" detail={error()} />
14628
14665
  </Show43>
14629
14666
 
14630
- <div style={{ padding: "1rem 1.25rem", display: "grid", gap: "1rem" }}>
14631
- <div style={{ display: "grid", "grid-template-columns": "repeat(auto-fit, minmax(14rem, 1fr))", gap: "0.75rem" }}>
14632
- <label style={field}>
14633
- <span style={label}>Name</span>
14634
- <input class="app-admin-input" value={draft().name} maxLength={120} onInput={(e) => update({ name: e.currentTarget.value })} placeholder="Finish your visit" />
14635
- </label>
14636
- <label style={field}>
14637
- <span style={label}>Description (internal)</span>
14638
- <input class="app-admin-input" value={draft().description ?? ""} maxLength={500} onInput={(e) => update({ description: e.currentTarget.value || null })} />
14639
- </label>
14640
- </div>
14641
-
14667
+ <nav
14668
+ role="tablist"
14669
+ aria-label="Sequence sections"
14670
+ style={{ display: "flex", gap: "0.25rem", "border-bottom": "1px solid var(--app-admin-border)", margin: "1rem 0 1.25rem" }}
14671
+ >
14672
+ <For31 each={tabKeys()}>
14673
+ {(key) => <button
14674
+ type="button"
14675
+ role="tab"
14676
+ aria-selected={tab() === key}
14677
+ onClick={() => setTab(key)}
14678
+ style={{
14679
+ padding: "0.625rem 1rem",
14680
+ "margin-bottom": "-1px",
14681
+ "font-size": "0.8125rem",
14682
+ "font-weight": "600",
14683
+ "text-transform": "uppercase",
14684
+ "letter-spacing": "0.05em",
14685
+ "border-bottom": "2px solid",
14686
+ "border-color": tab() === key ? "var(--app-admin-primary)" : "transparent",
14687
+ color: tab() === key ? "var(--app-admin-primary)" : "var(--app-admin-fg-muted)",
14688
+ background: "none",
14689
+ "border-top": "none",
14690
+ "border-left": "none",
14691
+ "border-right": "none",
14692
+ cursor: "pointer"
14693
+ }}
14694
+ >
14695
+ {TAB_LABEL[key]}
14696
+ <Show43 when={tabCount(key) !== void 0}>
14697
+ <span style={{ "margin-left": "0.375rem", opacity: 0.7 }}>{tabCount(key)}</span>
14698
+ </Show43>
14699
+ </button>}
14700
+ </For31>
14701
+ </nav>
14642
14702
 
14643
- <Index2 each={draft().steps}>
14644
- {(step, i) => <StepEditor
14703
+ <Switch2>
14704
+ <Match2 when={tab() === "queue"}>
14705
+ <SequenceQueue sequence={props.initial} rows={dueRows()} refetch={() => void refetchQueue()} onChanged={props.onChanged} />
14706
+ </Match2>
14707
+ <Match2 when={tab() === "steps"}>
14708
+ <Section
14709
+ title="Steps"
14710
+ count={draft().steps.length}
14711
+ flush
14712
+ action={<button type="button" class="app-admin-btn app-admin-btn-sm" disabled={draft().steps.length >= 8} onClick={() => update({ steps: [...draft().steps, { ...EMPTY_STEP, waitHours: 72 }] })}>
14713
+ Add step
14714
+ </button>}
14715
+ >
14716
+ <Show43
14717
+ when={props.templates.length > 0}
14718
+ fallback={<div style={{ padding: "1rem 1.25rem", display: "flex", gap: "0.75rem", "align-items": "center", "flex-wrap": "wrap" }}>
14719
+ <span class="app-admin-text-muted" style={{ "font-size": "0.8125rem" }}>A step sends a marketing template. Create one under Email › Templates first.</span>
14720
+ <Show43 when={nav}>
14721
+ <button type="button" class="app-admin-btn app-admin-btn-sm" onClick={() => nav.selectTab("email-templates")}>Open Email › Templates</button>
14722
+ </Show43>
14723
+ </div>}
14724
+ >
14725
+ <p class="app-admin-text-muted" style={{ "font-size": "0.75rem", margin: 0, padding: "0.625rem 1.25rem 0" }}>
14726
+ Each step waits the given hours after the previous one (the first, after enrollment), then sends its template with the chosen link.
14727
+ </p>
14728
+ <Index2 each={draft().steps}>
14729
+ {(step, i) => <StepRow
14645
14730
  index={i}
14646
14731
  step={step()}
14647
14732
  count={draft().steps.length}
14648
14733
  templates={props.templates}
14734
+ canTest={!isNew()}
14649
14735
  onChange={(s) => setStep(i, s)}
14650
14736
  onRemove={() => update({ steps: draft().steps.filter((_, j) => j !== i) })}
14651
14737
  onTest={() => void test(i)}
14652
14738
  />}
14653
- </Index2>
14654
- <div>
14655
- <button type="button" class="app-admin-btn app-admin-btn-sm" disabled={draft().steps.length >= 8} onClick={() => update({ steps: [...draft().steps, { ...EMPTY_STEP, waitHours: 72 }] })}>
14656
- Add a step
14657
- </button>
14658
- </div>
14659
-
14660
- <div class="app-admin-card-soft" style={{ padding: "1rem", display: "grid", gap: "0.75rem" }}>
14661
- <strong style={{ "font-size": "0.875rem" }}>Who gets enrolled</strong>
14662
- <p class="app-admin-text-muted" style={{ "font-size": "0.75rem", margin: 0 }}>
14663
- People you add from the Funnel tab are always enrolled. Tick segments below and the hourly check also enrolls anyone who enters them — and removes them when they leave. Their clock starts from their own entry.
14664
- </p>
14665
- <For31 each={["a", "b"]}>
14666
- {(g) => <div>
14667
- <div style={{ ...label, "margin-bottom": "0.25rem" }}>{GROUP_LABEL[g]}</div>
14668
- <div style={{ display: "flex", "flex-wrap": "wrap", gap: "0.5rem 1rem" }}>
14669
- <For31 each={SEGMENT_KEYS[g]}>
14670
- {(key) => <label style={{ "font-size": "0.8125rem", display: "flex", gap: "0.375rem", "align-items": "center" }}>
14671
- <input type="checkbox" checked={draft().feedSegments.includes(key)} onChange={() => toggleSegment(key)} />
14672
- {SEGMENT_LABEL[key]}
14673
- </label>}
14674
- </For31>
14675
- </div>
14676
- </div>}
14677
- </For31>
14678
- <Show43 when={draft().feedSegments.length > 0}>
14679
- <div style={{ display: "grid", "grid-template-columns": "repeat(auto-fit, minmax(14rem, 1fr))", gap: "0.75rem" }}>
14680
- <label style={field}>
14681
- <span style={label}>Only enroll people who entered in the last (days)</span>
14682
- <input class="app-admin-input" type="number" min="1" max="365" value={draft().feedMaxAgeDays ?? 30} onInput={(e) => update({ feedMaxAgeDays: Number(e.currentTarget.value) })} />
14683
- <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>
14684
- </label>
14685
- <label style={{ "font-size": "0.8125rem", display: "flex", gap: "0.375rem", "align-items": "center" }}>
14686
- <input type="checkbox" checked={draft().feedQualifiedOnly} onChange={(e) => update({ feedQualifiedOnly: e.currentTarget.checked })} />
14687
- Skip people whose questionnaire did not qualify
14739
+ </Index2>
14740
+ </Show43>
14741
+ </Section>
14742
+ </Match2>
14743
+ <Match2 when={tab() === "people"}>
14744
+ <Section title="People in this sequence" count={enrollments()?.enrollments.length} flush>
14745
+ <Show43 when={enrollments()} fallback={<LoadingSpinner />}>
14746
+ <Show43 when={enrollments().enrollments.length > 0} fallback={<EmptyState message="Nobody yet. Add people from the Funnel tab, or feed the sequence from a segment." />}>
14747
+ <table class="app-admin-table">
14748
+ <thead>
14749
+ <tr><th>Person</th><th>Came from</th><th>Step</th><th>Next due</th><th /></tr>
14750
+ </thead>
14751
+ <tbody>
14752
+ <For31 each={enrollments().enrollments}>
14753
+ {(e) => <tr>
14754
+ <td data-label="Person">
14755
+ <Show43 when={e.userId && nav} fallback={e.email}>
14756
+ <button type="button" class="app-admin-link-btn" style={{ "font-size": "inherit" }} onClick={() => nav.openCustomer(e.userId)}>{e.email}</button>
14757
+ </Show43>
14758
+ <div class="app-admin-text-muted" style={{ "font-size": "0.75rem" }}>{e.source === "feed" ? "enrolled by the feed" : "added by hand"} · {formatDate(e.addedAt)}</div>
14759
+ </td>
14760
+ <td data-label="Came from">{segmentLongLabel(e.segmentAtAdd)}</td>
14761
+ <td data-label="Step">{Math.min(e.stepIndex + 1, draft().steps.length)} of {draft().steps.length}</td>
14762
+ <td data-label="Next due" class="app-admin-text-muted">{e.nextDueAt ? formatDate(e.nextDueAt) : "\u2014"}</td>
14763
+ <td class="app-admin-table-cell--end"><button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" onClick={() => void remove(e)}>Remove</button></td>
14764
+ </tr>}
14765
+ </For31>
14766
+ </tbody>
14767
+ </table>
14768
+ </Show43>
14769
+ </Show43>
14770
+ </Section>
14771
+ </Match2>
14772
+ <Match2 when={tab() === "settings"}>
14773
+ <div style={{ "max-width": "40rem" }}>
14774
+ <Section title="About">
14775
+ <div style={{ display: "grid", gap: "0.75rem" }}>
14776
+ <label style={field}>
14777
+ <span style={label}>Name</span>
14778
+ <input class="app-admin-input" value={draft().name} maxLength={120} onInput={(e) => update({ name: e.currentTarget.value })} placeholder="Finish your visit" />
14779
+ </label>
14780
+ <label style={field}>
14781
+ <span style={label}>Notes (internal)</span>
14782
+ <input class="app-admin-input" value={draft().description ?? ""} maxLength={500} onInput={(e) => update({ description: e.currentTarget.value || null })} placeholder="Who this is for and why" />
14783
+ </label>
14784
+ </div>
14785
+ </Section>
14786
+
14787
+ <Section title="Sending">
14788
+ <label style={checkboxRow}>
14789
+ <input type="checkbox" aria-label="Send automatically when a step is due" checked={draft().autoSend} onChange={(e) => update({ autoSend: e.currentTarget.checked })} />
14790
+ <span>
14791
+ Send automatically when a step is due
14792
+ <span class="app-admin-text-muted" style={{ display: "block", "font-size": "0.75rem", "margin-top": "0.125rem" }}>
14793
+ {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."}
14794
+ </span>
14795
+ </span>
14688
14796
  </label>
14689
- </div>
14690
- </Show43>
14691
- </div>
14797
+ </Section>
14692
14798
 
14693
- <div class="app-admin-card-soft" style={{ padding: "1rem", display: "grid", gap: "0.5rem" }}>
14694
- <strong style={{ "font-size": "0.875rem" }}>How emails go out</strong>
14695
- <label style={{ "font-size": "0.8125rem", display: "flex", gap: "0.375rem", "align-items": "center" }}>
14696
- <input type="checkbox" checked={draft().autoSend} onChange={(e) => update({ autoSend: e.currentTarget.checked })} />
14697
- Send automatically when a step is due
14698
- </label>
14699
- <p class="app-admin-text-muted" style={{ "font-size": "0.75rem", margin: 0 }}>
14700
- {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."}
14701
- </p>
14702
- </div>
14703
-
14704
- <Show43 when={error()}>
14705
- <p style={{ color: "var(--app-admin-danger-fg)", "font-size": "0.8125rem", margin: 0 }}>{error()}</p>
14706
- </Show43>
14707
- <div style={{ display: "flex", gap: "0.5rem", "align-items": "center" }}>
14708
- <button type="button" class="app-admin-btn app-admin-btn-primary" disabled={saving()} onClick={() => void save()}>
14709
- {saving() ? "Saving\u2026" : isNew() ? "Create sequence" : "Save changes"}
14710
- </button>
14711
- <Show43 when={!isNew()}>
14712
- <button type="button" class="app-admin-btn app-admin-btn-danger app-admin-btn-sm" onClick={() => void archive()}>Archive</button>
14713
- </Show43>
14714
- </div>
14715
- </div>
14716
-
14717
- <Show43 when={!isNew()}>
14718
- <div style={{ "border-top": "1px solid var(--app-admin-border-soft)" }}>
14719
- <div style={{ padding: "0.75rem 1.25rem" }}>
14720
- <strong style={{ "font-size": "0.875rem" }}>In this sequence — {enrollments()?.enrollments.length ?? "\u2026"}</strong>
14799
+ <Section title="Who gets enrolled">
14800
+ <div style={{ display: "grid", gap: "0.75rem" }}>
14801
+ <p class="app-admin-text-muted" style={{ "font-size": "0.75rem", margin: 0 }}>
14802
+ 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).
14803
+ </p>
14804
+ <For31 each={["a", "b"]}>
14805
+ {(g) => <div>
14806
+ <div style={{ ...label, "font-size": "0.75rem", "margin-bottom": "0.25rem" }}>{GROUP_LABEL[g]}</div>
14807
+ <div style={{ display: "grid", gap: "0.25rem" }}>
14808
+ <For31 each={SEGMENT_KEYS[g]}>
14809
+ {(key) => <label style={{ "font-size": "0.8125rem", display: "flex", gap: "0.375rem", "align-items": "center" }}>
14810
+ <input type="checkbox" checked={draft().feedSegments.includes(key)} onChange={() => toggleSegment(key)} />
14811
+ {SEGMENT_LABEL[key]}
14812
+ </label>}
14813
+ </For31>
14814
+ </div>
14815
+ </div>}
14816
+ </For31>
14817
+ <Show43 when={draft().feedSegments.length > 0}>
14818
+ <label style={field}>
14819
+ <span style={label}>Only enroll people who entered in the last (days)</span>
14820
+ <input class="app-admin-input" type="number" min="1" max="365" value={draft().feedMaxAgeDays ?? 30} onInput={(e) => update({ feedMaxAgeDays: Number(e.currentTarget.value) })} />
14821
+ <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.</span>
14822
+ </label>
14823
+ <label style={{ "font-size": "0.8125rem", display: "flex", gap: "0.375rem", "align-items": "center" }}>
14824
+ <input type="checkbox" checked={draft().feedQualifiedOnly} onChange={(e) => update({ feedQualifiedOnly: e.currentTarget.checked })} />
14825
+ Skip people whose questionnaire did not qualify
14826
+ </label>
14827
+ </Show43>
14828
+ </div>
14829
+ </Section>
14721
14830
  </div>
14722
- <Show43 when={enrollments()} fallback={<LoadingSpinner />}>
14723
- <Show43 when={enrollments().enrollments.length > 0} fallback={<EmptyState message="Nobody yet. Add people from the Funnel tab, or tick a segment above." />}>
14724
- <table class="app-admin-table">
14725
- <thead>
14726
- <tr><th>Person</th><th>Came from</th><th>Step</th><th>Next due</th><th /></tr>
14727
- </thead>
14728
- <tbody>
14729
- <For31 each={enrollments().enrollments}>
14730
- {(e) => <tr>
14731
- <td data-label="Person">
14732
- <Show43 when={e.userId && nav} fallback={e.email}>
14733
- <button type="button" class="app-admin-link-btn" style={{ "font-size": "inherit" }} onClick={() => nav.openCustomer(e.userId)}>{e.email}</button>
14734
- </Show43>
14735
- <div class="app-admin-text-muted" style={{ "font-size": "0.75rem" }}>{e.source === "feed" ? "enrolled by the feed" : "added by hand"} · {formatDate(e.addedAt)}</div>
14736
- </td>
14737
- <td data-label="Came from">{segmentLongLabel(e.segmentAtAdd)}</td>
14738
- <td data-label="Step">{Math.min(e.stepIndex + 1, draft().steps.length)} of {draft().steps.length}</td>
14739
- <td data-label="Next due" class="app-admin-text-muted">{e.nextDueAt ? formatDate(e.nextDueAt) : "\u2014"}</td>
14740
- <td><button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" onClick={() => void remove(e)}>Remove</button></td>
14741
- </tr>}
14742
- </For31>
14743
- </tbody>
14744
- </table>
14745
- </Show43>
14746
- </Show43>
14747
- </div>
14748
- </Show43>
14831
+ </Match2>
14832
+ </Switch2>
14749
14833
  </div>;
14750
14834
  }
14751
14835
  function Sequences() {
@@ -14761,7 +14845,9 @@ function Sequences() {
14761
14845
  void refetchQueue();
14762
14846
  };
14763
14847
  return <div>
14764
- <PageTitle subtitle="Timed emails for people who stopped short of a subscription">Sequences</PageTitle>
14848
+ <Show43 when={!editing()}>
14849
+ <PageTitle subtitle="Timed emails for people who stopped short of a subscription">Sequences</PageTitle>
14850
+ </Show43>
14765
14851
 
14766
14852
  <Show43
14767
14853
  when={editing()}
@@ -15339,10 +15425,10 @@ function AdminDashboard(props) {
15339
15425
  const [internalTab, setInternalTab] = createSignal31(fallbackTab());
15340
15426
  const currentTab = () => props.activeTab ?? internalTab();
15341
15427
  const [drawerOpen, setDrawerOpen] = createSignal31(false);
15342
- createEffect10(() => {
15428
+ createEffect11(() => {
15343
15429
  setAdminToast(props.toast);
15344
15430
  });
15345
- createEffect10(() => {
15431
+ createEffect11(() => {
15346
15432
  const auth = props.auth;
15347
15433
  if (!auth) return;
15348
15434
  if (!auth.isAuthenticated()) {
@@ -15360,6 +15446,7 @@ function AdminDashboard(props) {
15360
15446
  };
15361
15447
  const [pendingCustomerUid, setPendingCustomerUid] = createSignal31(null);
15362
15448
  const [pendingThreadId, setPendingThreadId] = createSignal31(null);
15449
+ const [pendingTemplateId, setPendingTemplateId] = createSignal31(null);
15363
15450
  const handleTabClick = (tab, opts) => {
15364
15451
  if (!opts?.keepPending) {
15365
15452
  setPendingCustomerUid(null);
@@ -15383,6 +15470,10 @@ function AdminDashboard(props) {
15383
15470
  openSupportThread: (threadId) => {
15384
15471
  setPendingThreadId(threadId);
15385
15472
  handleTabClick("support", { keepPending: true });
15473
+ },
15474
+ openEmailTemplate: (templateId) => {
15475
+ setPendingTemplateId(templateId);
15476
+ handleTabClick("email-templates", { keepPending: true });
15386
15477
  }
15387
15478
  };
15388
15479
  const topOffset = () => props.topOffset ?? "0px";
@@ -15492,22 +15583,22 @@ function AdminDashboard(props) {
15492
15583
  }
15493
15584
  <Show46 when={currentTab()} keyed>
15494
15585
  <ErrorBoundary fallback={(err, reset) => <AdminTabError error={err} reset={reset} />}>
15495
- <Switch2 fallback={<Dashboard onSelectTab={handleTabClick} isTabEnabled={isTabEnabled} />}>
15496
- <Match2 when={currentTab() === "dashboard"}>
15586
+ <Switch3 fallback={<Dashboard onSelectTab={handleTabClick} isTabEnabled={isTabEnabled} />}>
15587
+ <Match3 when={currentTab() === "dashboard"}>
15497
15588
  <Dashboard onSelectTab={handleTabClick} isTabEnabled={isTabEnabled} />
15498
- </Match2>
15499
- <Match2 when={currentTab() === "customers"}>
15589
+ </Match3>
15590
+ <Match3 when={currentTab() === "customers"}>
15500
15591
  <Customers
15501
15592
  passwordResetRedirectUrl={props.passwordResetRedirectUrl}
15502
15593
  activeUid={props.customers?.activeUid}
15503
15594
  onSelectCustomer={props.customers?.onSelectCustomer}
15504
15595
  initialUid={pendingCustomerUid()}
15505
15596
  />
15506
- </Match2>
15507
- <Match2 when={currentTab() === "payments"}>
15597
+ </Match3>
15598
+ <Match3 when={currentTab() === "payments"}>
15508
15599
  <Payments />
15509
- </Match2>
15510
- <Match2 when={currentTab() === "subscriptions"}>
15600
+ </Match3>
15601
+ <Match3 when={currentTab() === "subscriptions"}>
15511
15602
  {
15512
15603
  /* Retired tab alias: the customer list, filtered to active subscribers. */
15513
15604
  }
@@ -15517,41 +15608,41 @@ function AdminDashboard(props) {
15517
15608
  activeUid={props.customers?.activeUid}
15518
15609
  onSelectCustomer={props.customers?.onSelectCustomer}
15519
15610
  />
15520
- </Match2>
15521
- <Match2 when={currentTab() === "products"}>
15611
+ </Match3>
15612
+ <Match3 when={currentTab() === "products"}>
15522
15613
  <Products productDefaultsLookup={props.productDefaultsLookup} />
15523
- </Match2>
15524
- <Match2 when={currentTab() === "categories"}>
15614
+ </Match3>
15615
+ <Match3 when={currentTab() === "categories"}>
15525
15616
  <Categories />
15526
- </Match2>
15527
- <Match2 when={currentTab() === "sales"}>
15617
+ </Match3>
15618
+ <Match3 when={currentTab() === "sales"}>
15528
15619
  <Sales />
15529
- </Match2>
15530
- <Match2 when={currentTab() === "promo-codes"}>
15620
+ </Match3>
15621
+ <Match3 when={currentTab() === "promo-codes"}>
15531
15622
  <PromoCodes affiliatesEnabled={affiliatesEnabled()} />
15532
- </Match2>
15533
- <Match2 when={currentTab() === "affiliates"}>
15623
+ </Match3>
15624
+ <Match3 when={currentTab() === "affiliates"}>
15534
15625
  <Affiliates {...props.affiliates ?? {}} />
15535
- </Match2>
15536
- <Match2 when={currentTab() === "support"}>
15626
+ </Match3>
15627
+ <Match3 when={currentTab() === "support"}>
15537
15628
  <Support initialThreadId={pendingThreadId()} />
15538
- </Match2>
15539
- <Match2 when={currentTab() === "webhooks"}>
15629
+ </Match3>
15630
+ <Match3 when={currentTab() === "webhooks"}>
15540
15631
  <Webhooks />
15541
- </Match2>
15542
- <Match2 when={currentTab() === "email-templates"}>
15543
- <EmailTemplates />
15544
- </Match2>
15545
- <Match2 when={currentTab() === "funnel"}>
15632
+ </Match3>
15633
+ <Match3 when={currentTab() === "email-templates"}>
15634
+ <EmailTemplates initialCustomTemplateId={pendingTemplateId()} />
15635
+ </Match3>
15636
+ <Match3 when={currentTab() === "funnel"}>
15546
15637
  <Funnel />
15547
- </Match2>
15548
- <Match2 when={currentTab() === "sequences"}>
15638
+ </Match3>
15639
+ <Match3 when={currentTab() === "sequences"}>
15549
15640
  <Sequences />
15550
- </Match2>
15551
- <Match2 when={currentTab() === "email-notifications"}>
15641
+ </Match3>
15642
+ <Match3 when={currentTab() === "email-notifications"}>
15552
15643
  <EmailNotifications />
15553
- </Match2>
15554
- </Switch2>
15644
+ </Match3>
15645
+ </Switch3>
15555
15646
  </ErrorBoundary>
15556
15647
  </Show46>
15557
15648
  </div>
@@ -16028,7 +16119,7 @@ function UpdatePaymentMethod(props) {
16028
16119
  }
16029
16120
 
16030
16121
  // src/pages/MemberPortal.tsx
16031
- import { Show as Show56, Switch as Switch4, Match as Match4, For as For41, createSignal as createSignal38, onMount as onMount3 } from "solid-js";
16122
+ import { Show as Show56, Switch as Switch5, Match as Match5, For as For41, createSignal as createSignal38, onMount as onMount3 } from "solid-js";
16032
16123
 
16033
16124
  // src/pages/member/OrderTracker.tsx
16034
16125
  import { Show as Show49, For as For36, createSignal as createSignal32 } from "solid-js";
@@ -16693,7 +16784,7 @@ function MedicationGuide(props) {
16693
16784
  }
16694
16785
 
16695
16786
  // src/pages/member/MessagesPanel.tsx
16696
- import { Show as Show54, For as For39, Switch as Switch3, Match as Match3, createEffect as createEffect11, createSignal as createSignal36, on as on7 } from "solid-js";
16787
+ import { Show as Show54, For as For39, Switch as Switch4, Match as Match4, createEffect as createEffect12, createSignal as createSignal36, on as on7 } from "solid-js";
16697
16788
  import DOMPurify from "dompurify";
16698
16789
  function sanitizeMessageHtml(html) {
16699
16790
  return DOMPurify.sanitize(html, {
@@ -16807,7 +16898,7 @@ function MessagesPanel(props) {
16807
16898
  setComposing(true);
16808
16899
  }
16809
16900
  let composerRef;
16810
- createEffect11(
16901
+ createEffect12(
16811
16902
  on7(
16812
16903
  () => props.intent,
16813
16904
  (current2) => {
@@ -16839,7 +16930,7 @@ function MessagesPanel(props) {
16839
16930
  }
16840
16931
  )
16841
16932
  );
16842
- createEffect11(() => {
16933
+ createEffect12(() => {
16843
16934
  const id = pendingThreadIntentId();
16844
16935
  if (!id) return;
16845
16936
  if (thread().loadingConversations()) return;
@@ -16910,7 +17001,7 @@ function MessagesPanel(props) {
16910
17001
  }
16911
17002
  const selectedConvo = () => thread().conversations().find((c) => c.id === thread().selectedId());
16912
17003
  let endRef;
16913
- createEffect11(() => {
17004
+ createEffect12(() => {
16914
17005
  void thread().messages();
16915
17006
  requestAnimationFrame(() => endRef?.scrollIntoView?.({ behavior: "smooth", block: "end" }));
16916
17007
  });
@@ -17013,7 +17104,7 @@ function MessagesPanel(props) {
17013
17104
  else setFailed(true);
17014
17105
  return next;
17015
17106
  };
17016
- createEffect11(() => {
17107
+ createEffect12(() => {
17017
17108
  if (isImageAttachment(p.attachment) && !url()) void resolve();
17018
17109
  });
17019
17110
  const openDocument = async () => {
@@ -17528,17 +17619,17 @@ function MessagesPanel(props) {
17528
17619
  </div>
17529
17620
  <div class={`msg-panel__main${threadOpen() ? "" : " msg-panel__main--hidden-mobile"}`}>
17530
17621
  <Show54 when={composing()}>
17531
- <Switch3>
17532
- <Match3 when={composeStep() === "care"}>
17622
+ <Switch4>
17623
+ <Match4 when={composeStep() === "care"}>
17533
17624
  <NewCareTeamThread />
17534
- </Match3>
17535
- <Match3 when={composeStep() === "care-notice"}>
17625
+ </Match4>
17626
+ <Match4 when={composeStep() === "care-notice"}>
17536
17627
  <CareTeamNotice />
17537
- </Match3>
17538
- <Match3 when={composeStep() === "support"}>
17628
+ </Match4>
17629
+ <Match4 when={composeStep() === "support"}>
17539
17630
  <NewSupportThread />
17540
- </Match3>
17541
- </Switch3>
17631
+ </Match4>
17632
+ </Switch4>
17542
17633
  </Show54>
17543
17634
  <Show54 when={!composing()}>
17544
17635
  <Show54
@@ -17841,11 +17932,11 @@ function MemberPortal(props) {
17841
17932
  </button>
17842
17933
  </div>}
17843
17934
  >
17844
- <Switch4 fallback={<TrackerTab />}>
17845
- <Match4 when={tab() === "instructions" && guide()}>
17935
+ <Switch5 fallback={<TrackerTab />}>
17936
+ <Match5 when={tab() === "instructions" && guide()}>
17846
17937
  {(g) => <MedicationGuide guide={g()} currentDose={currentDose()} />}
17847
- </Match4>
17848
- <Match4 when={tab() === "plan"}>
17938
+ </Match5>
17939
+ <Match5 when={tab() === "plan"}>
17849
17940
  <PlanBilling
17850
17941
  subscriptions={data.subscriptions()}
17851
17942
  brandName={props.brand.name}
@@ -17855,11 +17946,11 @@ function MemberPortal(props) {
17855
17946
  onOpenMessages={openMessages}
17856
17947
  messagingEnabled={messagingEnabled()}
17857
17948
  />
17858
- </Match4>
17859
- <Match4 when={tab() === "history" && props.surveyHistory}>
17949
+ </Match5>
17950
+ <Match5 when={tab() === "history" && props.surveyHistory}>
17860
17951
  <SurveyHistory />
17861
- </Match4>
17862
- <Match4 when={tab() === "account"}>
17952
+ </Match5>
17953
+ <Match5 when={tab() === "account"}>
17863
17954
  <AccountPanel
17864
17955
  member={data.member()}
17865
17956
  legalLinks={props.legalLinks}
@@ -17867,11 +17958,11 @@ function MemberPortal(props) {
17867
17958
  onOpenMessages={openMessages}
17868
17959
  messagingEnabled={messagingEnabled()}
17869
17960
  />
17870
- </Match4>
17871
- <Match4 when={tab() === "messages"}>
17961
+ </Match5>
17962
+ <Match5 when={tab() === "messages"}>
17872
17963
  <MessagesPanel thread={messages} intent={intent()} />
17873
- </Match4>
17874
- </Switch4>
17964
+ </Match5>
17965
+ </Switch5>
17875
17966
  </Show56>
17876
17967
  </Show56>;
17877
17968
  return <main
@@ -17943,7 +18034,7 @@ function MemberPortal(props) {
17943
18034
  }
17944
18035
 
17945
18036
  // src/pages/AffiliatePortal.tsx
17946
- import { createEffect as createEffect12, createSignal as createSignal40, Match as Match5, Show as Show62, Switch as Switch5, For as For46 } from "solid-js";
18037
+ import { createEffect as createEffect13, createSignal as createSignal40, Match as Match6, Show as Show62, Switch as Switch6, For as For46 } from "solid-js";
17947
18038
 
17948
18039
  // src/pages/affiliate/Overview.tsx
17949
18040
  import { Show as Show57, For as For42 } from "solid-js";
@@ -18529,7 +18620,7 @@ function AffiliatePortal(props) {
18529
18620
  const [internalTab, setInternalTab] = createSignal40(fallbackTab());
18530
18621
  const currentTab = () => props.activeTab ?? internalTab();
18531
18622
  const [drawerOpen, setDrawerOpen] = createSignal40(false);
18532
- createEffect12(() => {
18623
+ createEffect13(() => {
18533
18624
  const auth = props.auth;
18534
18625
  if (!auth) return;
18535
18626
  if (!auth.isAuthenticated()) {
@@ -18629,23 +18720,23 @@ function AffiliatePortal(props) {
18629
18720
  </aside>
18630
18721
 
18631
18722
  <div class="app-affiliate-content">
18632
- <Switch5 fallback={<AffiliateOverview />}>
18633
- <Match5 when={currentTab() === "overview"}>
18723
+ <Switch6 fallback={<AffiliateOverview />}>
18724
+ <Match6 when={currentTab() === "overview"}>
18634
18725
  <AffiliateOverview />
18635
- </Match5>
18636
- <Match5 when={currentTab() === "conversions"}>
18726
+ </Match6>
18727
+ <Match6 when={currentTab() === "conversions"}>
18637
18728
  <AffiliateConversions />
18638
- </Match5>
18639
- <Match5 when={currentTab() === "downline"}>
18729
+ </Match6>
18730
+ <Match6 when={currentTab() === "downline"}>
18640
18731
  <AffiliateDownline />
18641
- </Match5>
18642
- <Match5 when={currentTab() === "referral"}>
18732
+ </Match6>
18733
+ <Match6 when={currentTab() === "referral"}>
18643
18734
  <AffiliateReferralLink />
18644
- </Match5>
18645
- <Match5 when={currentTab() === "settings"}>
18735
+ </Match6>
18736
+ <Match6 when={currentTab() === "settings"}>
18646
18737
  <AffiliateSettings />
18647
- </Match5>
18648
- </Switch5>
18738
+ </Match6>
18739
+ </Switch6>
18649
18740
  </div>
18650
18741
  </div>
18651
18742
  </Show62>;
@@ -19839,4 +19930,4 @@ export {
19839
19930
  AffiliateForgotPassword,
19840
19931
  AffiliateResetPassword
19841
19932
  };
19842
- //# sourceMappingURL=5NWE3FVH.jsx.map
19933
+ //# sourceMappingURL=WODHGSBM.jsx.map