@burdenoff/microfe-subscriberbot 2026.1113.1 → 2026.1123.1
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.
- package/dist/subscriberbot/components/InfiniteScrollSentinel.d.ts +24 -0
- package/dist/subscriberbot/components/InfiniteScrollSentinel.js +44 -0
- package/dist/subscriberbot/components/InfiniteScrollSentinel.js.map +1 -0
- package/dist/subscriberbot/components/index.d.ts +4 -0
- package/dist/subscriberbot/components/index.js +5 -2
- package/dist/subscriberbot/components/tags/EntityTagPicker.d.ts +25 -0
- package/dist/subscriberbot/components/tags/EntityTagPicker.js +205 -0
- package/dist/subscriberbot/components/tags/EntityTagPicker.js.map +1 -0
- package/dist/subscriberbot/components/tags/index.d.ts +2 -0
- package/dist/subscriberbot/components/tags/index.js +1 -0
- package/dist/subscriberbot/hooks/index.d.ts +2 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +53 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +664 -373
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +192 -147
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +9 -9
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +264 -281
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +8 -8
- package/dist/subscriberbot/pages/InvoicesPage.js +62 -78
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +5 -5
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +81 -81
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +326 -314
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.js +17 -17
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +153 -140
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +135 -146
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +482 -437
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +59 -46
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +104 -111
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/types/index.d.ts +40 -1
- package/package.json +12 -9
|
@@ -2,11 +2,13 @@ import { useFormatters as e } from "../../hooks/useFormatters.js";
|
|
|
2
2
|
import { useFormError as t } from "../../hooks/useFormError.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
4
|
import { ErrorView as r } from "../../components/StateViews.js";
|
|
5
|
+
import "../../components/tags/index.js";
|
|
5
6
|
import { useSubscriberBot as i } from "../../context/SubscriberBotContext.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { EntityTagPicker as a } from "../../components/tags/EntityTagPicker.js";
|
|
8
|
+
import { useCreateRelationship as o, usePlans as s, useProviders as c, useReplaceEntityTags as l } from "../../hooks/useSubscriberBotApi.js";
|
|
9
|
+
import { useTr as u } from "../../hooks/useTr.js";
|
|
10
|
+
import { useState as d } from "react";
|
|
11
|
+
import { ArrowLeft as f, Building2 as ee, StickyNote as te, Tag as ne, Wallet as p } from "lucide-react";
|
|
10
12
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
13
|
import { GlassCard as g, PagePurpose as _ } from "@burdenoff/fe-libs/ui";
|
|
12
14
|
// src/subscriberbot/pages/relationships/RelationshipNewPage.tsx
|
|
@@ -65,10 +67,10 @@ function C({ icon: e, title: t, description: n, children: r, dataTour: i }) {
|
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
function w() {
|
|
68
|
-
let { formatEnumLabel: g } = e(), w =
|
|
70
|
+
let { formatEnumLabel: g } = e(), w = u(), { navigateTo: T } = i(), E = o(), re = l(), D = c({ pagination: {
|
|
69
71
|
limit: 100,
|
|
70
72
|
offset: 0
|
|
71
|
-
} }), [O,
|
|
73
|
+
} }), [O, ie] = d(""), [k, A] = d("SUBSCRIPTION"), [j, M] = d(""), [N, P] = d(""), [F, I] = d(""), [L, R] = d("USD"), [z, B] = d("MONTHLY"), [V, H] = d(""), [U, W] = d(!0), [G, K] = d(""), [q, J] = d(""), [Y, ae] = d([]), [X, Z, Q, oe] = t(), se = s(j || void 0), ce = D.data?.items ?? [], $ = se.data ?? [];
|
|
72
74
|
return D.isError ? /* @__PURE__ */ m(n, {
|
|
73
75
|
dataTour: "subscriberbot-relationship-new",
|
|
74
76
|
title: w("relationships.new.title", "Add relationship"),
|
|
@@ -85,7 +87,7 @@ function w() {
|
|
|
85
87
|
onClick: () => T("/relationships"),
|
|
86
88
|
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
87
89
|
children: [
|
|
88
|
-
/* @__PURE__ */ m(
|
|
90
|
+
/* @__PURE__ */ m(f, { className: "rtl:rotate-180 h-4 w-4" }),
|
|
89
91
|
" ",
|
|
90
92
|
w("relationships.new.back", "Back")
|
|
91
93
|
]
|
|
@@ -101,33 +103,39 @@ function w() {
|
|
|
101
103
|
}
|
|
102
104
|
let t = {
|
|
103
105
|
label: O.trim(),
|
|
104
|
-
kind:
|
|
105
|
-
interval:
|
|
106
|
-
autoRenew:
|
|
107
|
-
currency:
|
|
108
|
-
...
|
|
109
|
-
...
|
|
110
|
-
...
|
|
111
|
-
...
|
|
112
|
-
...
|
|
113
|
-
...
|
|
106
|
+
kind: k,
|
|
107
|
+
interval: z,
|
|
108
|
+
autoRenew: U,
|
|
109
|
+
currency: L.trim() || "USD",
|
|
110
|
+
...j ? { providerId: j } : {},
|
|
111
|
+
...N ? { planId: N } : {},
|
|
112
|
+
...F ? { amount: Number(F) } : {},
|
|
113
|
+
...V ? { renewsAt: new Date(V).toISOString() } : {},
|
|
114
|
+
...G.trim() ? { notes: G.trim() } : {},
|
|
115
|
+
...q.trim() ? { department: q.trim() } : {}
|
|
114
116
|
};
|
|
115
117
|
E.mutate(t, {
|
|
116
|
-
onSuccess: (e) =>
|
|
118
|
+
onSuccess: async (e) => {
|
|
119
|
+
Y.length > 0 && await re.mutateAsync({
|
|
120
|
+
entityType: "SUBSCRIBERBOT_RELATIONSHIP",
|
|
121
|
+
entityId: e.id,
|
|
122
|
+
tagIds: Y
|
|
123
|
+
}).catch(() => {}), T(`/relationships/${e.id}`);
|
|
124
|
+
},
|
|
117
125
|
onError: (e) => Z(e instanceof Error ? e.message : w("relationships.new.error", "Could not create relationship."))
|
|
118
126
|
});
|
|
119
127
|
},
|
|
120
128
|
className: "max-w-3xl space-y-5",
|
|
121
129
|
children: [
|
|
122
130
|
X && /* @__PURE__ */ m("div", {
|
|
123
|
-
id:
|
|
131
|
+
id: oe,
|
|
124
132
|
tabIndex: -1,
|
|
125
133
|
role: "alert",
|
|
126
134
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
127
135
|
children: X
|
|
128
136
|
}),
|
|
129
137
|
/* @__PURE__ */ m(C, {
|
|
130
|
-
icon: /* @__PURE__ */ m(
|
|
138
|
+
icon: /* @__PURE__ */ m(ne, { className: "h-4 w-4" }),
|
|
131
139
|
dataTour: "subscriberbot-relationship-new-basics",
|
|
132
140
|
title: w("relationships.new.basics.title", "Basics"),
|
|
133
141
|
description: w("relationships.new.basics.description", "Name this relationship and choose what kind it is."),
|
|
@@ -150,7 +158,7 @@ function w() {
|
|
|
150
158
|
id: "rel-label",
|
|
151
159
|
type: "text",
|
|
152
160
|
value: O,
|
|
153
|
-
onChange: (e) =>
|
|
161
|
+
onChange: (e) => ie(e.target.value),
|
|
154
162
|
placeholder: w("relationships.new.basics.labelPlaceholder", "e.g. Netflix Premium, AWS Production"),
|
|
155
163
|
className: x,
|
|
156
164
|
required: !0
|
|
@@ -164,8 +172,8 @@ function w() {
|
|
|
164
172
|
}), /* @__PURE__ */ m("select", {
|
|
165
173
|
...Q("rel-kind"),
|
|
166
174
|
id: "rel-kind",
|
|
167
|
-
value:
|
|
168
|
-
onChange: (e) =>
|
|
175
|
+
value: k,
|
|
176
|
+
onChange: (e) => A(e.target.value),
|
|
169
177
|
className: x,
|
|
170
178
|
children: v.map((e) => /* @__PURE__ */ m("option", {
|
|
171
179
|
value: e,
|
|
@@ -184,17 +192,22 @@ function w() {
|
|
|
184
192
|
id: "rel-department",
|
|
185
193
|
type: "text",
|
|
186
194
|
maxLength: 120,
|
|
187
|
-
value:
|
|
188
|
-
onChange: (e) =>
|
|
195
|
+
value: q,
|
|
196
|
+
onChange: (e) => J(e.target.value),
|
|
189
197
|
placeholder: w("relationships.new.basics.departmentPlaceholder", "e.g. Engineering, Marketing"),
|
|
190
198
|
className: x
|
|
191
199
|
})]
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ m(a, {
|
|
202
|
+
entityType: "SUBSCRIBERBOT_RELATIONSHIP",
|
|
203
|
+
draftTagIds: Y,
|
|
204
|
+
onDraftChange: ae
|
|
192
205
|
})
|
|
193
206
|
]
|
|
194
207
|
})
|
|
195
208
|
}),
|
|
196
209
|
/* @__PURE__ */ m(C, {
|
|
197
|
-
icon: /* @__PURE__ */ m(
|
|
210
|
+
icon: /* @__PURE__ */ m(ee, { className: "h-4 w-4" }),
|
|
198
211
|
dataTour: "subscriberbot-relationship-new-provider-plan",
|
|
199
212
|
title: w("relationships.new.providerPlan.title", "Provider & plan"),
|
|
200
213
|
description: w("relationships.new.providerPlan.description", "Link this relationship to a provider and plan from the registry (optional)."),
|
|
@@ -207,15 +220,15 @@ function w() {
|
|
|
207
220
|
}), /* @__PURE__ */ h("select", {
|
|
208
221
|
...Q("rel-provider"),
|
|
209
222
|
id: "rel-provider",
|
|
210
|
-
value:
|
|
223
|
+
value: j,
|
|
211
224
|
onChange: (e) => {
|
|
212
|
-
|
|
225
|
+
M(e.target.value), P("");
|
|
213
226
|
},
|
|
214
227
|
className: x,
|
|
215
228
|
children: [/* @__PURE__ */ m("option", {
|
|
216
229
|
value: "",
|
|
217
230
|
children: w("relationships.new.providerPlan.providerNone", "— None —")
|
|
218
|
-
}),
|
|
231
|
+
}), ce.map((e) => /* @__PURE__ */ m("option", {
|
|
219
232
|
value: e.id,
|
|
220
233
|
children: e.name
|
|
221
234
|
}, e.id))]
|
|
@@ -226,13 +239,13 @@ function w() {
|
|
|
226
239
|
}), /* @__PURE__ */ h("select", {
|
|
227
240
|
...Q("rel-plan"),
|
|
228
241
|
id: "rel-plan",
|
|
229
|
-
value:
|
|
230
|
-
onChange: (e) =>
|
|
242
|
+
value: N,
|
|
243
|
+
onChange: (e) => P(e.target.value),
|
|
231
244
|
className: x,
|
|
232
|
-
disabled: !
|
|
245
|
+
disabled: !j || $.length === 0,
|
|
233
246
|
children: [/* @__PURE__ */ m("option", {
|
|
234
247
|
value: "",
|
|
235
|
-
children:
|
|
248
|
+
children: j ? $.length === 0 ? w("relationships.new.providerPlan.noPlans", "No plans available") : w("relationships.new.providerPlan.planNone", "— None —") : w("relationships.new.providerPlan.selectProviderFirst", "Select a provider first")
|
|
236
249
|
}), $.map((e) => /* @__PURE__ */ m("option", {
|
|
237
250
|
value: e.id,
|
|
238
251
|
children: e.name
|
|
@@ -260,8 +273,8 @@ function w() {
|
|
|
260
273
|
type: "number",
|
|
261
274
|
min: "0",
|
|
262
275
|
step: "0.01",
|
|
263
|
-
value:
|
|
264
|
-
onChange: (e) =>
|
|
276
|
+
value: F,
|
|
277
|
+
onChange: (e) => I(e.target.value),
|
|
265
278
|
placeholder: w("relationships.new.pricing.amountPlaceholder", "0.00"),
|
|
266
279
|
className: x
|
|
267
280
|
})] }),
|
|
@@ -273,8 +286,8 @@ function w() {
|
|
|
273
286
|
...Q("rel-currency"),
|
|
274
287
|
id: "rel-currency",
|
|
275
288
|
type: "text",
|
|
276
|
-
value:
|
|
277
|
-
onChange: (e) =>
|
|
289
|
+
value: L,
|
|
290
|
+
onChange: (e) => R(e.target.value.toUpperCase()),
|
|
278
291
|
placeholder: w("relationships.new.pricing.currencyPlaceholder", "USD"),
|
|
279
292
|
maxLength: 3,
|
|
280
293
|
className: x
|
|
@@ -286,8 +299,8 @@ function w() {
|
|
|
286
299
|
}), /* @__PURE__ */ m("select", {
|
|
287
300
|
...Q("rel-interval"),
|
|
288
301
|
id: "rel-interval",
|
|
289
|
-
value:
|
|
290
|
-
onChange: (e) =>
|
|
302
|
+
value: z,
|
|
303
|
+
onChange: (e) => B(e.target.value),
|
|
291
304
|
className: x,
|
|
292
305
|
children: y.map((e) => /* @__PURE__ */ m("option", {
|
|
293
306
|
value: e,
|
|
@@ -305,15 +318,15 @@ function w() {
|
|
|
305
318
|
...Q("rel-renews"),
|
|
306
319
|
id: "rel-renews",
|
|
307
320
|
type: "date",
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
321
|
+
value: V,
|
|
322
|
+
onChange: (e) => H(e.target.value),
|
|
310
323
|
className: x
|
|
311
324
|
})] }), /* @__PURE__ */ h("label", {
|
|
312
325
|
className: "flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 sm:mt-6",
|
|
313
326
|
children: [/* @__PURE__ */ m("input", {
|
|
314
327
|
type: "checkbox",
|
|
315
|
-
checked:
|
|
316
|
-
onChange: (e) =>
|
|
328
|
+
checked: U,
|
|
329
|
+
onChange: (e) => W(e.target.checked),
|
|
317
330
|
className: "size-4 rounded border-border-subtle"
|
|
318
331
|
}), /* @__PURE__ */ m("span", {
|
|
319
332
|
className: "text-sm text-text-primary",
|
|
@@ -324,15 +337,15 @@ function w() {
|
|
|
324
337
|
})
|
|
325
338
|
}),
|
|
326
339
|
/* @__PURE__ */ m(C, {
|
|
327
|
-
icon: /* @__PURE__ */ m(
|
|
340
|
+
icon: /* @__PURE__ */ m(te, { className: "h-4 w-4" }),
|
|
328
341
|
title: w("relationships.new.notes.title", "Notes"),
|
|
329
342
|
description: w("relationships.new.notes.description", "Anything worth remembering about this relationship."),
|
|
330
343
|
children: /* @__PURE__ */ m("textarea", {
|
|
331
344
|
...Q("rel-notes"),
|
|
332
345
|
id: "rel-notes",
|
|
333
346
|
"aria-label": w("relationships.new.notes.title", "Notes"),
|
|
334
|
-
value:
|
|
335
|
-
onChange: (e) =>
|
|
347
|
+
value: G,
|
|
348
|
+
onChange: (e) => K(e.target.value),
|
|
336
349
|
rows: 3,
|
|
337
350
|
placeholder: w("relationships.new.notes.placeholder", "Anything worth remembering about this relationship…"),
|
|
338
351
|
className: x
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipNewPage.js","names":["KINDS","INTERVALS","KIND_KEY","inputCls","labelCls","FormSection","GlassCard","dataTour","icon","title","description","RelationshipNewPage","useFormatters","tr","useTr","useSubscriberBot","create","useCreateRelationship","providersQ","useProviders","label","setLabel","useState","kind","setKind","providerId","setProviderId","planId","setPlanId","amount","setAmount","currency","setCurrency","interval","setInterval","renewsAt","setRenewsAt","autoRenew","setAutoRenew","notes","setNotes","department","setDepartment","formError","setFormError","fieldErrorProps","formErrorId","useFormError","plansQ","usePlans","providers","plans","PageLayout","ErrorView","navigateTo","ArrowLeft","PagePurpose","input","rel","err","Tag","k","formatEnumLabel","Building2","p","pl","Wallet","i","StickyNote"],"sources":["../../../../src/subscriberbot/pages/relationships/RelationshipNewPage.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\nimport { useFormError } from '../../hooks/useFormError';\n/**\n * Create relationship\n * @module subscriberbot/pages/relationships\n *\n * Manual-add form for a recurring relationship AI can't auto-detect.\n * Writes `subCreateRelationship`. Provider + plan are optional pickers\n * sourced from the real registry (`subListProviders` / `subListPlans`).\n */\n\nimport { useState, type ReactNode } from 'react';\nimport { ArrowLeft, Tag, Building2, Wallet, StickyNote } from 'lucide-react';\nimport { GlassCard, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { ErrorView } from '../../components/StateViews';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useCreateRelationship, useProviders, usePlans } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\n\nimport type {\n SubBillingInterval,\n SubCreateRelationshipInput,\n SubRelationshipKind,\n} from '../../types';\n\nconst KINDS: SubRelationshipKind[] = [\n 'SUBSCRIPTION',\n 'MEMBERSHIP',\n 'LICENSE',\n 'CONTRACT',\n 'NEWSLETTER',\n 'RECURRING_PAYMENT',\n 'ENROLLMENT',\n 'TRIAL',\n];\n\nconst INTERVALS: SubBillingInterval[] = [\n 'MONTHLY',\n 'YEARLY',\n 'QUARTERLY',\n 'WEEKLY',\n 'DAILY',\n 'USAGE_BASED',\n 'LIFETIME',\n 'FREE',\n];\n\nconst KIND_KEY: Record<SubRelationshipKind, string> = {\n SUBSCRIPTION: 'relationships.kinds.subscription',\n MEMBERSHIP: 'relationships.kinds.membership',\n LICENSE: 'relationships.kinds.license',\n CONTRACT: 'relationships.kinds.contract',\n NEWSLETTER: 'relationships.kinds.newsletter',\n RECURRING_PAYMENT: 'relationships.kinds.recurringPayment',\n ENROLLMENT: 'relationships.kinds.enrollment',\n TRIAL: 'relationships.kinds.trial',\n};\n\nconst inputCls =\n 'w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\nconst labelCls = 'mb-1.5 block text-xs font-medium text-text-secondary';\n\n/** Grouped form section on a glass surface. */\nfunction FormSection({\n icon,\n title,\n description,\n children,\n dataTour,\n}: {\n icon: ReactNode;\n title: string;\n description: string;\n children: ReactNode;\n /** Stable product-tour anchor rendered as `data-tour` (BOFF-3358). */\n dataTour?: string;\n}) {\n return (\n <GlassCard treatment=\"metric\" className=\"p-5 sm:p-6\" data-tour={dataTour}>\n <div className=\"flex items-start gap-3\">\n <span className=\"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">{title}</h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{description}</p>\n </div>\n </div>\n <div className=\"mt-4\">{children}</div>\n </GlassCard>\n );\n}\n\nexport function RelationshipNewPage() {\n const { formatEnumLabel } = useFormatters();\n\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const create = useCreateRelationship();\n const providersQ = useProviders({ pagination: { limit: 100, offset: 0 } });\n\n const [label, setLabel] = useState('');\n const [kind, setKind] = useState<SubRelationshipKind>('SUBSCRIPTION');\n const [providerId, setProviderId] = useState('');\n const [planId, setPlanId] = useState('');\n const [amount, setAmount] = useState('');\n const [currency, setCurrency] = useState('USD');\n const [interval, setInterval] = useState<SubBillingInterval>('MONTHLY');\n const [renewsAt, setRenewsAt] = useState('');\n const [autoRenew, setAutoRenew] = useState(true);\n const [notes, setNotes] = useState('');\n const [department, setDepartment] = useState('');\n const [formError, setFormError, fieldErrorProps, formErrorId] = useFormError();\n\n const plansQ = usePlans(providerId || undefined);\n const providers = providersQ.data?.items ?? [];\n const plans = plansQ.data ?? [];\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setFormError(null);\n if (!label.trim()) {\n setFormError(\n tr('relationships.new.basics.labelRequired', 'A label is required.'),\n 'rel-label'\n );\n return;\n }\n const input: SubCreateRelationshipInput = {\n label: label.trim(),\n kind,\n interval,\n autoRenew,\n currency: currency.trim() || 'USD',\n ...(providerId ? { providerId } : {}),\n ...(planId ? { planId } : {}),\n ...(amount ? { amount: Number(amount) } : {}),\n ...(renewsAt ? { renewsAt: new Date(renewsAt).toISOString() } : {}),\n ...(notes.trim() ? { notes: notes.trim() } : {}),\n ...(department.trim() ? { department: department.trim() } : {}),\n };\n create.mutate(input, {\n onSuccess: (rel) => navigateTo(`/relationships/${rel.id}`),\n onError: (err) =>\n setFormError(\n err instanceof Error\n ? err.message\n : tr('relationships.new.error', 'Could not create relationship.')\n ),\n });\n };\n\n if (providersQ.isError) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-relationship-new\"\n title={tr('relationships.new.title', 'Add relationship')}\n >\n <ErrorView\n message={tr('relationships.new.providerError', 'Could not load the provider registry.')}\n onRetry={() => void providersQ.refetch()}\n />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n dataTour=\"subscriberbot-relationship-new\"\n title={tr('relationships.new.title', 'Add relationship')}\n description={tr(\n 'relationships.new.description',\n 'Track a new recurring digital relationship'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"rtl:rotate-180 h-4 w-4\" /> {tr('relationships.new.back', 'Back')}\n </button>\n }\n >\n <PagePurpose className=\"mb-6\">\n {tr(\n 'relationships.new.purpose',\n 'Manually add a subscription, membership, license or contract. Link it to a provider and plan from the registry, set the price and renewal date, and Subscriber Bot will track its lifecycle from here.'\n )}\n </PagePurpose>\n\n <form onSubmit={handleSubmit} className=\"max-w-3xl space-y-5\">\n {formError && (\n <div\n id={formErrorId}\n tabIndex={-1}\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {formError}\n </div>\n )}\n\n {/* Basics */}\n <FormSection\n icon={<Tag className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-basics\"\n title={tr('relationships.new.basics.title', 'Basics')}\n description={tr(\n 'relationships.new.basics.description',\n 'Name this relationship and choose what kind it is.'\n )}\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"rel-label\" className={labelCls}>\n {tr('relationships.new.basics.labelLabel', 'Label')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n {...fieldErrorProps('rel-label')}\n id=\"rel-label\"\n type=\"text\"\n value={label}\n onChange={(e) => setLabel(e.target.value)}\n placeholder={tr(\n 'relationships.new.basics.labelPlaceholder',\n 'e.g. Netflix Premium, AWS Production'\n )}\n className={inputCls}\n required\n />\n </div>\n <div className=\"max-w-xs\">\n <label htmlFor=\"rel-kind\" className={labelCls}>\n {tr('relationships.new.basics.kindLabel', 'Kind')}\n </label>\n <select\n {...fieldErrorProps('rel-kind')}\n id=\"rel-kind\"\n value={kind}\n onChange={(e) => setKind(e.target.value as SubRelationshipKind)}\n className={inputCls}\n >\n {KINDS.map((k) => (\n <option key={k} value={k}>\n {tr(KIND_KEY[k], formatEnumLabel(k))}\n </option>\n ))}\n </select>\n </div>\n <div className=\"max-w-xs\">\n <label htmlFor=\"rel-department\" className={labelCls}>\n {tr('relationships.new.basics.departmentLabel', 'Department or team')}\n </label>\n <input\n {...fieldErrorProps('rel-department')}\n id=\"rel-department\"\n type=\"text\"\n maxLength={120}\n value={department}\n onChange={(e) => setDepartment(e.target.value)}\n placeholder={tr(\n 'relationships.new.basics.departmentPlaceholder',\n 'e.g. Engineering, Marketing'\n )}\n className={inputCls}\n />\n </div>\n </div>\n </FormSection>\n\n {/* Provider & plan */}\n <FormSection\n icon={<Building2 className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-provider-plan\"\n title={tr('relationships.new.providerPlan.title', 'Provider & plan')}\n description={tr(\n 'relationships.new.providerPlan.description',\n 'Link this relationship to a provider and plan from the registry (optional).'\n )}\n >\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"rel-provider\" className={labelCls}>\n {tr('relationships.new.providerPlan.providerLabel', 'Provider')}\n </label>\n <select\n {...fieldErrorProps('rel-provider')}\n id=\"rel-provider\"\n value={providerId}\n onChange={(e) => {\n setProviderId(e.target.value);\n setPlanId('');\n }}\n className={inputCls}\n >\n <option value=\"\">\n {tr('relationships.new.providerPlan.providerNone', '— None —')}\n </option>\n {providers.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n </select>\n </div>\n <div>\n <label htmlFor=\"rel-plan\" className={labelCls}>\n {tr('relationships.new.providerPlan.planLabel', 'Plan')}\n </label>\n <select\n {...fieldErrorProps('rel-plan')}\n id=\"rel-plan\"\n value={planId}\n onChange={(e) => setPlanId(e.target.value)}\n className={inputCls}\n disabled={!providerId || plans.length === 0}\n >\n <option value=\"\">\n {providerId\n ? plans.length === 0\n ? tr('relationships.new.providerPlan.noPlans', 'No plans available')\n : tr('relationships.new.providerPlan.planNone', '— None —')\n : tr(\n 'relationships.new.providerPlan.selectProviderFirst',\n 'Select a provider first'\n )}\n </option>\n {plans.map((pl) => (\n <option key={pl.id} value={pl.id}>\n {pl.name}\n </option>\n ))}\n </select>\n </div>\n </div>\n </FormSection>\n\n {/* Pricing & billing */}\n <FormSection\n icon={<Wallet className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-pricing\"\n title={tr('relationships.new.pricing.title', 'Pricing & billing')}\n description={tr(\n 'relationships.new.pricing.description',\n 'Set the price, cadence and next renewal so Subscriber Bot can track it.'\n )}\n >\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"rel-amount\" className={labelCls}>\n {tr('relationships.new.pricing.amountLabel', 'Amount')}\n </label>\n <input\n {...fieldErrorProps('rel-amount')}\n id=\"rel-amount\"\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n value={amount}\n onChange={(e) => setAmount(e.target.value)}\n placeholder={tr('relationships.new.pricing.amountPlaceholder', '0.00')}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"rel-currency\" className={labelCls}>\n {tr('relationships.new.pricing.currencyLabel', 'Currency')}\n </label>\n <input\n {...fieldErrorProps('rel-currency')}\n id=\"rel-currency\"\n type=\"text\"\n value={currency}\n onChange={(e) => setCurrency(e.target.value.toUpperCase())}\n placeholder={tr('relationships.new.pricing.currencyPlaceholder', 'USD')}\n maxLength={3}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"rel-interval\" className={labelCls}>\n {tr('relationships.new.pricing.intervalLabel', 'Billing interval')}\n </label>\n <select\n {...fieldErrorProps('rel-interval')}\n id=\"rel-interval\"\n value={interval}\n onChange={(e) => setInterval(e.target.value as SubBillingInterval)}\n className={inputCls}\n >\n {INTERVALS.map((i) => (\n <option key={i} value={i}>\n {formatEnumLabel(i)}\n </option>\n ))}\n </select>\n </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"rel-renews\" className={labelCls}>\n {tr('relationships.new.pricing.renewsOnLabel', 'Renews on')}\n </label>\n <input\n {...fieldErrorProps('rel-renews')}\n id=\"rel-renews\"\n type=\"date\"\n value={renewsAt}\n onChange={(e) => setRenewsAt(e.target.value)}\n className={inputCls}\n />\n </div>\n <label className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 sm:mt-6\">\n <input\n type=\"checkbox\"\n checked={autoRenew}\n onChange={(e) => setAutoRenew(e.target.checked)}\n className=\"size-4 rounded border-border-subtle\"\n />\n <span className=\"text-sm text-text-primary\">\n {tr('relationships.new.pricing.autoRenews', 'Auto-renews')}\n </span>\n </label>\n </div>\n </div>\n </FormSection>\n\n {/* Notes */}\n <FormSection\n icon={<StickyNote className=\"h-4 w-4\" />}\n title={tr('relationships.new.notes.title', 'Notes')}\n description={tr(\n 'relationships.new.notes.description',\n 'Anything worth remembering about this relationship.'\n )}\n >\n <textarea\n {...fieldErrorProps('rel-notes')}\n id=\"rel-notes\"\n aria-label={tr('relationships.new.notes.title', 'Notes')}\n value={notes}\n onChange={(e) => setNotes(e.target.value)}\n rows={3}\n placeholder={tr(\n 'relationships.new.notes.placeholder',\n 'Anything worth remembering about this relationship…'\n )}\n className={inputCls}\n />\n </FormSection>\n\n <div\n className=\"flex flex-col gap-3 sm:flex-row\"\n data-tour=\"subscriberbot-relationship-new-actions\"\n >\n <button\n type=\"submit\"\n disabled={create.isPending}\n className=\"rounded-lg bg-action-primary-bg px-5 py-2.5 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {create.isPending\n ? tr('relationships.new.creating', 'Creating…')\n : tr('relationships.new.submit', 'Create relationship')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"rounded-lg border border-border-subtle px-5 py-2.5 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('relationships.new.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,IAAMA,IAA+B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEMC,IAAkC;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEMC,IAAgD;CACpD,cAAc;CACd,YAAY;CACZ,SAAS;CACT,UAAU;CACV,YAAY;CACZ,mBAAmB;CACnB,YAAY;CACZ,OAAO;AACT,GAEMC,IACJ,0MACIC,IAAW;AAGjB,SAASC,EAAY,EACnB,SACA,UACA,gBACA,aACA,eAQC;CACD,OACE,kBAACC,GAAD;EAAW,WAAU;EAAS,WAAU;EAAa,aAAWC;EAAhE,UAAA,CACE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IACb,UAAAC;GACG,CAAA,GACN,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,k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G,iCAAiC,OAAO;MACvD,OAAO0B;MACP,WAAW,MAAMC,EAAS,EAAE,OAAO,KAAK;MACxC,MAAM;MACN,aAAa3B,EACX,uCACA,qDACF;MACA,WAAWV;KACZ,CAAA;IACU,CAAA;IAEb,kBAAC,OAAD;KACE,WAAU;KACV,aAAU;KAFZ,UAAA,CAIE,kBAAC,UAAD;MACE,MAAK;MACL,UAAUa,EAAO;MACjB,WAAU;MAET,UAAAA,EAAO,YACJH,EAAG,8BAA8B,WAAW,IAC5CA,EAAG,4BAA4B,qBAAqB;KAClD,CAAA,GACR,kBAAC,UAAD;MACE,MAAK;MACL,eAAeyC,EAAW,gBAAgB;MAC1C,WAAU;MAET,UAAAzC,EAAG,4BAA4B,QAAQ;KAClC,CAAA,CACL;;GACD;EACI,CAAA,CAAA;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"RelationshipNewPage.js","names":["KINDS","INTERVALS","KIND_KEY","inputCls","labelCls","FormSection","GlassCard","dataTour","icon","title","description","RelationshipNewPage","useFormatters","tr","useTr","useSubscriberBot","create","useCreateRelationship","replaceTags","useReplaceEntityTags","providersQ","useProviders","label","setLabel","useState","kind","setKind","providerId","setProviderId","planId","setPlanId","amount","setAmount","currency","setCurrency","interval","setInterval","renewsAt","setRenewsAt","autoRenew","setAutoRenew","notes","setNotes","department","setDepartment","draftTagIds","setDraftTagIds","formError","setFormError","fieldErrorProps","formErrorId","useFormError","plansQ","usePlans","providers","plans","PageLayout","ErrorView","navigateTo","ArrowLeft","PagePurpose","input","rel","err","Tag","k","formatEnumLabel","EntityTagPicker","Building2","p","pl","Wallet","i","StickyNote"],"sources":["../../../../src/subscriberbot/pages/relationships/RelationshipNewPage.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\nimport { useFormError } from '../../hooks/useFormError';\n/**\n * Create relationship\n * @module subscriberbot/pages/relationships\n *\n * Manual-add form for a recurring relationship AI can't auto-detect.\n * Writes `subCreateRelationship`. Provider + plan are optional pickers\n * sourced from the real registry (`subListProviders` / `subListPlans`).\n */\n\nimport { useState, type ReactNode } from 'react';\nimport { ArrowLeft, Tag, Building2, Wallet, StickyNote } from 'lucide-react';\nimport { GlassCard, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { ErrorView } from '../../components/StateViews';\nimport { EntityTagPicker } from '../../components/tags';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport {\n useCreateRelationship,\n useProviders,\n usePlans,\n useReplaceEntityTags,\n} from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\n\nimport type {\n SubBillingInterval,\n SubCreateRelationshipInput,\n SubRelationshipKind,\n} from '../../types';\n\nconst KINDS: SubRelationshipKind[] = [\n 'SUBSCRIPTION',\n 'MEMBERSHIP',\n 'LICENSE',\n 'CONTRACT',\n 'NEWSLETTER',\n 'RECURRING_PAYMENT',\n 'ENROLLMENT',\n 'TRIAL',\n];\n\nconst INTERVALS: SubBillingInterval[] = [\n 'MONTHLY',\n 'YEARLY',\n 'QUARTERLY',\n 'WEEKLY',\n 'DAILY',\n 'USAGE_BASED',\n 'LIFETIME',\n 'FREE',\n];\n\nconst KIND_KEY: Record<SubRelationshipKind, string> = {\n SUBSCRIPTION: 'relationships.kinds.subscription',\n MEMBERSHIP: 'relationships.kinds.membership',\n LICENSE: 'relationships.kinds.license',\n CONTRACT: 'relationships.kinds.contract',\n NEWSLETTER: 'relationships.kinds.newsletter',\n RECURRING_PAYMENT: 'relationships.kinds.recurringPayment',\n ENROLLMENT: 'relationships.kinds.enrollment',\n TRIAL: 'relationships.kinds.trial',\n};\n\nconst inputCls =\n 'w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\nconst labelCls = 'mb-1.5 block text-xs font-medium text-text-secondary';\n\n/** Grouped form section on a glass surface. */\nfunction FormSection({\n icon,\n title,\n description,\n children,\n dataTour,\n}: {\n icon: ReactNode;\n title: string;\n description: string;\n children: ReactNode;\n /** Stable product-tour anchor rendered as `data-tour` (BOFF-3358). */\n dataTour?: string;\n}) {\n return (\n <GlassCard treatment=\"metric\" className=\"p-5 sm:p-6\" data-tour={dataTour}>\n <div className=\"flex items-start gap-3\">\n <span className=\"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">{title}</h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{description}</p>\n </div>\n </div>\n <div className=\"mt-4\">{children}</div>\n </GlassCard>\n );\n}\n\nexport function RelationshipNewPage() {\n const { formatEnumLabel } = useFormatters();\n\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const create = useCreateRelationship();\n const replaceTags = useReplaceEntityTags();\n const providersQ = useProviders({ pagination: { limit: 100, offset: 0 } });\n\n const [label, setLabel] = useState('');\n const [kind, setKind] = useState<SubRelationshipKind>('SUBSCRIPTION');\n const [providerId, setProviderId] = useState('');\n const [planId, setPlanId] = useState('');\n const [amount, setAmount] = useState('');\n const [currency, setCurrency] = useState('USD');\n const [interval, setInterval] = useState<SubBillingInterval>('MONTHLY');\n const [renewsAt, setRenewsAt] = useState('');\n const [autoRenew, setAutoRenew] = useState(true);\n const [notes, setNotes] = useState('');\n const [department, setDepartment] = useState('');\n const [draftTagIds, setDraftTagIds] = useState<string[]>([]);\n const [formError, setFormError, fieldErrorProps, formErrorId] = useFormError();\n\n const plansQ = usePlans(providerId || undefined);\n const providers = providersQ.data?.items ?? [];\n const plans = plansQ.data ?? [];\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setFormError(null);\n if (!label.trim()) {\n setFormError(\n tr('relationships.new.basics.labelRequired', 'A label is required.'),\n 'rel-label'\n );\n return;\n }\n const input: SubCreateRelationshipInput = {\n label: label.trim(),\n kind,\n interval,\n autoRenew,\n currency: currency.trim() || 'USD',\n ...(providerId ? { providerId } : {}),\n ...(planId ? { planId } : {}),\n ...(amount ? { amount: Number(amount) } : {}),\n ...(renewsAt ? { renewsAt: new Date(renewsAt).toISOString() } : {}),\n ...(notes.trim() ? { notes: notes.trim() } : {}),\n ...(department.trim() ? { department: department.trim() } : {}),\n };\n create.mutate(input, {\n onSuccess: async (rel) => {\n if (draftTagIds.length > 0) {\n await replaceTags\n .mutateAsync({\n entityType: 'SUBSCRIBERBOT_RELATIONSHIP',\n entityId: rel.id,\n tagIds: draftTagIds,\n })\n .catch(() => {});\n }\n navigateTo(`/relationships/${rel.id}`);\n },\n onError: (err) =>\n setFormError(\n err instanceof Error\n ? err.message\n : tr('relationships.new.error', 'Could not create relationship.')\n ),\n });\n };\n\n if (providersQ.isError) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-relationship-new\"\n title={tr('relationships.new.title', 'Add relationship')}\n >\n <ErrorView\n message={tr('relationships.new.providerError', 'Could not load the provider registry.')}\n onRetry={() => void providersQ.refetch()}\n />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n dataTour=\"subscriberbot-relationship-new\"\n title={tr('relationships.new.title', 'Add relationship')}\n description={tr(\n 'relationships.new.description',\n 'Track a new recurring digital relationship'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"rtl:rotate-180 h-4 w-4\" /> {tr('relationships.new.back', 'Back')}\n </button>\n }\n >\n <PagePurpose className=\"mb-6\">\n {tr(\n 'relationships.new.purpose',\n 'Manually add a subscription, membership, license or contract. Link it to a provider and plan from the registry, set the price and renewal date, and Subscriber Bot will track its lifecycle from here.'\n )}\n </PagePurpose>\n\n <form onSubmit={handleSubmit} className=\"max-w-3xl space-y-5\">\n {formError && (\n <div\n id={formErrorId}\n tabIndex={-1}\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {formError}\n </div>\n )}\n\n {/* Basics */}\n <FormSection\n icon={<Tag className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-basics\"\n title={tr('relationships.new.basics.title', 'Basics')}\n description={tr(\n 'relationships.new.basics.description',\n 'Name this relationship and choose what kind it is.'\n )}\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"rel-label\" className={labelCls}>\n {tr('relationships.new.basics.labelLabel', 'Label')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n {...fieldErrorProps('rel-label')}\n id=\"rel-label\"\n type=\"text\"\n value={label}\n onChange={(e) => setLabel(e.target.value)}\n placeholder={tr(\n 'relationships.new.basics.labelPlaceholder',\n 'e.g. Netflix Premium, AWS Production'\n )}\n className={inputCls}\n required\n />\n </div>\n <div className=\"max-w-xs\">\n <label htmlFor=\"rel-kind\" className={labelCls}>\n {tr('relationships.new.basics.kindLabel', 'Kind')}\n </label>\n <select\n {...fieldErrorProps('rel-kind')}\n id=\"rel-kind\"\n value={kind}\n onChange={(e) => setKind(e.target.value as SubRelationshipKind)}\n className={inputCls}\n >\n {KINDS.map((k) => (\n <option key={k} value={k}>\n {tr(KIND_KEY[k], formatEnumLabel(k))}\n </option>\n ))}\n </select>\n </div>\n <div className=\"max-w-xs\">\n <label htmlFor=\"rel-department\" className={labelCls}>\n {tr('relationships.new.basics.departmentLabel', 'Department or team')}\n </label>\n <input\n {...fieldErrorProps('rel-department')}\n id=\"rel-department\"\n type=\"text\"\n maxLength={120}\n value={department}\n onChange={(e) => setDepartment(e.target.value)}\n placeholder={tr(\n 'relationships.new.basics.departmentPlaceholder',\n 'e.g. Engineering, Marketing'\n )}\n className={inputCls}\n />\n </div>\n <EntityTagPicker\n entityType=\"SUBSCRIBERBOT_RELATIONSHIP\"\n draftTagIds={draftTagIds}\n onDraftChange={setDraftTagIds}\n />\n </div>\n </FormSection>\n\n {/* Provider & plan */}\n <FormSection\n icon={<Building2 className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-provider-plan\"\n title={tr('relationships.new.providerPlan.title', 'Provider & plan')}\n description={tr(\n 'relationships.new.providerPlan.description',\n 'Link this relationship to a provider and plan from the registry (optional).'\n )}\n >\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"rel-provider\" className={labelCls}>\n {tr('relationships.new.providerPlan.providerLabel', 'Provider')}\n </label>\n <select\n {...fieldErrorProps('rel-provider')}\n id=\"rel-provider\"\n value={providerId}\n onChange={(e) => {\n setProviderId(e.target.value);\n setPlanId('');\n }}\n className={inputCls}\n >\n <option value=\"\">\n {tr('relationships.new.providerPlan.providerNone', '— None —')}\n </option>\n {providers.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n </select>\n </div>\n <div>\n <label htmlFor=\"rel-plan\" className={labelCls}>\n {tr('relationships.new.providerPlan.planLabel', 'Plan')}\n </label>\n <select\n {...fieldErrorProps('rel-plan')}\n id=\"rel-plan\"\n value={planId}\n onChange={(e) => setPlanId(e.target.value)}\n className={inputCls}\n disabled={!providerId || plans.length === 0}\n >\n <option value=\"\">\n {providerId\n ? plans.length === 0\n ? tr('relationships.new.providerPlan.noPlans', 'No plans available')\n : tr('relationships.new.providerPlan.planNone', '— None —')\n : tr(\n 'relationships.new.providerPlan.selectProviderFirst',\n 'Select a provider first'\n )}\n </option>\n {plans.map((pl) => (\n <option key={pl.id} value={pl.id}>\n {pl.name}\n </option>\n ))}\n </select>\n </div>\n </div>\n </FormSection>\n\n {/* Pricing & billing */}\n <FormSection\n icon={<Wallet className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-pricing\"\n title={tr('relationships.new.pricing.title', 'Pricing & billing')}\n description={tr(\n 'relationships.new.pricing.description',\n 'Set the price, cadence and next renewal so Subscriber Bot can track it.'\n )}\n >\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"rel-amount\" className={labelCls}>\n {tr('relationships.new.pricing.amountLabel', 'Amount')}\n </label>\n <input\n {...fieldErrorProps('rel-amount')}\n id=\"rel-amount\"\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n value={amount}\n onChange={(e) => setAmount(e.target.value)}\n placeholder={tr('relationships.new.pricing.amountPlaceholder', '0.00')}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"rel-currency\" className={labelCls}>\n {tr('relationships.new.pricing.currencyLabel', 'Currency')}\n </label>\n <input\n {...fieldErrorProps('rel-currency')}\n id=\"rel-currency\"\n type=\"text\"\n value={currency}\n onChange={(e) => setCurrency(e.target.value.toUpperCase())}\n placeholder={tr('relationships.new.pricing.currencyPlaceholder', 'USD')}\n maxLength={3}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"rel-interval\" className={labelCls}>\n {tr('relationships.new.pricing.intervalLabel', 'Billing interval')}\n </label>\n <select\n {...fieldErrorProps('rel-interval')}\n id=\"rel-interval\"\n value={interval}\n onChange={(e) => setInterval(e.target.value as SubBillingInterval)}\n className={inputCls}\n >\n {INTERVALS.map((i) => (\n <option key={i} value={i}>\n {formatEnumLabel(i)}\n </option>\n ))}\n </select>\n </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"rel-renews\" className={labelCls}>\n {tr('relationships.new.pricing.renewsOnLabel', 'Renews on')}\n </label>\n <input\n {...fieldErrorProps('rel-renews')}\n id=\"rel-renews\"\n type=\"date\"\n value={renewsAt}\n onChange={(e) => setRenewsAt(e.target.value)}\n className={inputCls}\n />\n </div>\n <label className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 sm:mt-6\">\n <input\n type=\"checkbox\"\n checked={autoRenew}\n onChange={(e) => setAutoRenew(e.target.checked)}\n className=\"size-4 rounded border-border-subtle\"\n />\n <span className=\"text-sm text-text-primary\">\n {tr('relationships.new.pricing.autoRenews', 'Auto-renews')}\n </span>\n </label>\n </div>\n </div>\n </FormSection>\n\n {/* Notes */}\n <FormSection\n icon={<StickyNote className=\"h-4 w-4\" />}\n title={tr('relationships.new.notes.title', 'Notes')}\n description={tr(\n 'relationships.new.notes.description',\n 'Anything worth remembering about this relationship.'\n )}\n >\n <textarea\n {...fieldErrorProps('rel-notes')}\n id=\"rel-notes\"\n aria-label={tr('relationships.new.notes.title', 'Notes')}\n value={notes}\n onChange={(e) => setNotes(e.target.value)}\n rows={3}\n placeholder={tr(\n 'relationships.new.notes.placeholder',\n 'Anything worth remembering about this relationship…'\n )}\n className={inputCls}\n />\n </FormSection>\n\n <div\n className=\"flex flex-col gap-3 sm:flex-row\"\n data-tour=\"subscriberbot-relationship-new-actions\"\n >\n <button\n type=\"submit\"\n disabled={create.isPending}\n className=\"rounded-lg bg-action-primary-bg px-5 py-2.5 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {create.isPending\n ? tr('relationships.new.creating', 'Creating…')\n : tr('relationships.new.submit', 'Create relationship')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"rounded-lg border border-border-subtle px-5 py-2.5 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('relationships.new.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,IAAMA,IAA+B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEMC,IAAkC;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEMC,IAAgD;CACpD,cAAc;CACd,YAAY;CACZ,SAAS;CACT,UAAU;CACV,YAAY;CACZ,mBAAmB;CACnB,YAAY;CACZ,OAAO;AACT,GAEMC,IACJ,0MACIC,IAAW;AAGjB,SAASC,EAAY,EACnB,SACA,UACA,gBACA,a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