@burdenoff/microfe-billing 2026.623.3 → 2026.624.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/billing/BillingUserRoutes.js +3 -3
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +34 -34
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +94 -94
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +40 -40
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +10 -10
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +62 -62
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +7 -7
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +21 -21
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +4 -4
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +33 -33
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +4 -4
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +4 -4
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +57 -57
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +33 -33
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/shared/components/AccessDenied.js +4 -4
- package/dist/billing/shared/components/AccessDenied.js.map +1 -1
- package/dist/billing/shared/components/ActorIdentity.js +8 -8
- package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +11 -11
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatePromotionPage.js","names":[],"sources":["../../../../../src/billing/modules/promotions/pages/CreatePromotionPage.tsx"],"sourcesContent":["import { type FC, useState } from 'react';\nimport { ArrowLeft, Save, Gift, Info } from 'lucide-react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { AccessDenied, PageHeader } from '../../../shared/components';\nimport { useCreatePromotionMutation } from '../../../../generated/global-operations';\n\nconst KNOWN_PRODUCTS = ['vibecontrols', 'workspaces', 'botlit', 'fluidgrids', 'healthybowl'];\n\ninterface FormData {\n name: string;\n description: string;\n startsAt: string;\n expiresAt: string;\n bonusMonths: number;\n maxRedemptions: string;\n applicableProductIds: string[];\n applicablePlanIds: string;\n}\n\nexport const CreatePromotionPage: FC = () => {\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const [createPromotion] = useCreatePromotionMutation({ refetchQueries: ['ListPromotions'] });\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [errors, setErrors] = useState<Partial<Record<keyof FormData, string>>>({});\n\n const today = new Date().toISOString().split('T')[0];\n const [form, setForm] = useState<FormData>({\n name: '',\n description: '',\n startsAt: today,\n expiresAt: '',\n bonusMonths: 1,\n maxRedemptions: '',\n applicableProductIds: [],\n applicablePlanIds: '',\n });\n\n if (!permissions.canManagePlans) {\n return <AccessDenied message=\"You don't have permission to create promotions.\" />;\n }\n\n const set = <K extends keyof FormData>(k: K, v: FormData[K]) =>\n setForm((prev) => ({ ...prev, [k]: v }));\n\n const toggleProduct = (pid: string) => {\n set(\n 'applicableProductIds',\n form.applicableProductIds.includes(pid)\n ? form.applicableProductIds.filter((p) => p !== pid)\n : [...form.applicableProductIds, pid]\n );\n };\n\n const validate = () => {\n const e: typeof errors = {};\n if (!form.name.trim()) e.name = 'Name is required';\n if (!form.startsAt) e.startsAt = 'Start date is required';\n if (!form.expiresAt) e.expiresAt = 'End date is required';\n if (form.expiresAt && form.expiresAt <= form.startsAt)\n e.expiresAt = 'End date must be after start date';\n if (form.bonusMonths < 1) e.bonusMonths = 'Must be at least 1';\n setErrors(e);\n return Object.keys(e).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!validate()) return;\n setIsSubmitting(true);\n try {\n const planIds = form.applicablePlanIds.split(',').flatMap((s) => {\n const trimmed = s.trim();\n return trimmed ? [trimmed] : [];\n });\n\n await createPromotion({\n variables: {\n input: {\n name: form.name.trim(),\n description: form.description.trim() || undefined,\n startsAt: new Date(form.startsAt).toISOString(),\n expiresAt: new Date(form.expiresAt).toISOString(),\n bonusMonths: form.bonusMonths,\n maxRedemptions: form.maxRedemptions ? parseInt(form.maxRedemptions) : undefined,\n applicableProductIds: form.applicableProductIds,\n applicablePlanIds: planIds,\n },\n },\n });\n navigateTo('/promotions');\n } catch (err) {\n setErrors({ name: err instanceof Error ? err.message : 'Failed to create promotion' });\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n <div className=\"max-w-2xl mx-auto p-4 sm:p-6 space-y-6\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/promotions')}\n aria-label=\"Back to promotions\"\n className=\"p-2 rounded-button hover:bg-bg-sunken text-text-muted hover:text-text-primary transition-colors\"\n >\n <ArrowLeft className=\"size-5\" />\n </button>\n <PageHeader\n title=\"Create Promotion\"\n description=\"Offer bonus free renewal months to subscribers who sign up within the promotion window\"\n icon={<Gift className=\"size-6\" />}\n />\n </div>\n\n <form onSubmit={handleSubmit} className=\"space-y-5\">\n {/* Basic info */}\n <div className=\"bg-bg-surface border border-border-subtle rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Promotion Details</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">Name *</label>\n <input\n type=\"text\"\n value={form.name}\n onChange={(e) => set('name', e.target.value)}\n placeholder=\"e.g. June Launch Offer\"\n className={`w-full px-3 py-2 rounded-input border ${errors.name ? 'border-destructive' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.name && <p className=\"text-xs text-status-error-text mt-1\">{errors.name}</p>}\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">Description</label>\n <textarea\n value={form.description}\n onChange={(e) => set('description', e.target.value)}\n placeholder=\"Subscribe in June and get 2 extra months free!\"\n rows={2}\n className=\"w-full px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n\n {/* Bonus config */}\n <div className=\"bg-bg-surface border border-border-subtle rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Bonus Configuration</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Bonus Months *\n </label>\n <input\n type=\"number\"\n value={form.bonusMonths}\n min={1}\n max={12}\n onChange={(e) => set('bonusMonths', parseInt(e.target.value) || 1)}\n className={`w-32 px-3 py-2 rounded-input border ${errors.bonusMonths ? 'border-destructive' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.bonusMonths && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.bonusMonths}</p>\n )}\n <div className=\"mt-2 flex items-start gap-2 p-3 bg-[var(--color-accent-soft)] rounded-lg text-sm text-text-muted\">\n <Info className=\"size-4 shrink-0 mt-0.5 text-text-link\" />\n <span>\n Users who subscribe during this window get{' '}\n <strong className=\"text-text-primary\">\n {form.bonusMonths} free renewal{form.bonusMonths !== 1 ? 's' : ''}\n </strong>{' '}\n after their first paid period — their quota resets each month as normal.\n </span>\n </div>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Max Redemptions\n </label>\n <input\n type=\"number\"\n value={form.maxRedemptions}\n min={1}\n onChange={(e) => set('maxRedemptions', e.target.value)}\n placeholder=\"Unlimited\"\n className=\"w-48 px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"text-xs text-text-muted mt-1\">Leave empty for no cap</p>\n </div>\n </div>\n\n {/* Date window */}\n <div className=\"bg-bg-surface border border-border-subtle rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Active Window</h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Start Date *\n </label>\n <input\n type=\"date\"\n value={form.startsAt}\n onChange={(e) => set('startsAt', e.target.value)}\n className={`w-full px-3 py-2 rounded-input border ${errors.startsAt ? 'border-destructive' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.startsAt && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.startsAt}</p>\n )}\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">End Date *</label>\n <input\n type=\"date\"\n value={form.expiresAt}\n onChange={(e) => set('expiresAt', e.target.value)}\n min={form.startsAt}\n className={`w-full px-3 py-2 rounded-input border ${errors.expiresAt ? 'border-destructive' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.expiresAt && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.expiresAt}</p>\n )}\n </div>\n </div>\n <p className=\"text-xs text-text-muted\">\n Only purchases made between these dates will receive the bonus months\n </p>\n </div>\n\n {/* Scope */}\n <div className=\"bg-bg-surface border border-border-subtle rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Scope</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-2\">\n Applicable Products\n </label>\n <div className=\"flex flex-wrap gap-2\">\n {KNOWN_PRODUCTS.map((pid) => (\n <button\n key={pid}\n type=\"button\"\n onClick={() => toggleProduct(pid)}\n className={`px-3 py-1.5 rounded-lg border text-sm transition-colors ${\n form.applicableProductIds.includes(pid)\n ? 'border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium'\n : 'border-border-subtle hover:border-action-primary-bg/50'\n }`}\n >\n {pid}\n </button>\n ))}\n </div>\n <p className=\"text-xs text-text-muted mt-1\">\n {form.applicableProductIds.length === 0\n ? 'No selection = applies to all products'\n : `Applies to: ${form.applicableProductIds.join(', ')}`}\n </p>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Plan IDs (optional)\n </label>\n <input\n type=\"text\"\n value={form.applicablePlanIds}\n onChange={(e) => set('applicablePlanIds', e.target.value)}\n placeholder=\"plan-vibecontrols-pro-monthly, plan-vibecontrols-pro-yearly\"\n className=\"w-full px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"text-xs text-text-muted mt-1\">\n Comma-separated. Leave empty to apply to all plans\n </p>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-3 justify-end\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/promotions')}\n className=\"px-5 py-2 rounded-button border border-border-subtle text-text-primary hover:bg-bg-sunken text-sm font-medium transition-colors\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={isSubmitting}\n className=\"px-5 py-2 rounded-button bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover flex items-center gap-2 text-sm font-medium transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50\"\n >\n {isSubmitting ? (\n <div className=\"size-4 border-2 border-action-primary-text border-t-transparent rounded-full animate-spin\" />\n ) : (\n <Save className=\"size-4\" />\n )}\n Create Promotion\n </button>\n </div>\n </form>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;AAOA,IAAM,IAAiB;CAAC;CAAgB;CAAc;CAAU;CAAc;CAAc,EAa/E,UAAgC;CAC3C,IAAM,IAAa,GAAoB,EACjC,IAAc,GAAuB,EACrC,CAAC,KAAmB,EAA2B,EAAE,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,EACtF,CAAC,GAAc,KAAmB,EAAS,GAAM,EACjD,CAAC,GAAQ,KAAa,EAAkD,EAAE,CAAC,EAE3E,qBAAQ,IAAI,MAAM,EAAC,aAAa,CAAC,MAAM,IAAI,CAAC,IAC5C,CAAC,GAAM,KAAW,EAAmB;EACzC,MAAM;EACN,aAAa;EACb,UAAU;EACV,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,sBAAsB,EAAE;EACxB,mBAAmB;EACpB,CAAC;AAEF,KAAI,CAAC,EAAY,eACf,QAAO,kBAAC,GAAD,EAAc,SAAQ,mDAAoD,CAAA;CAGnF,IAAM,KAAiC,GAAM,MAC3C,GAAS,OAAU;EAAE,GAAG;GAAO,IAAI;EAAG,EAAE,EAEpC,KAAiB,MAAgB;AACrC,IACE,wBACA,EAAK,qBAAqB,SAAS,EAAI,GACnC,EAAK,qBAAqB,QAAQ,MAAM,MAAM,EAAI,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C,kBAAC,OAAD,EAAK,WAAU,6FAA8F,CAAA,GAE7G,kBAAC,GAAD,EAAM,WAAU,UAAW,CAAA,EAC3B,mBAEK;QACL;;IACD;KACH"}
|
|
1
|
+
{"version":3,"file":"CreatePromotionPage.js","names":[],"sources":["../../../../../src/billing/modules/promotions/pages/CreatePromotionPage.tsx"],"sourcesContent":["import { type FC, useState } from 'react';\nimport { ArrowLeft, Save, Gift, Info } from 'lucide-react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { AccessDenied, PageHeader } from '../../../shared/components';\nimport { useCreatePromotionMutation } from '../../../../generated/global-operations';\n\nconst KNOWN_PRODUCTS = ['vibecontrols', 'workspaces', 'botlit', 'fluidgrids', 'healthybowl'];\n\ninterface FormData {\n name: string;\n description: string;\n startsAt: string;\n expiresAt: string;\n bonusMonths: number;\n maxRedemptions: string;\n applicableProductIds: string[];\n applicablePlanIds: string;\n}\n\nexport const CreatePromotionPage: FC = () => {\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const [createPromotion] = useCreatePromotionMutation({ refetchQueries: ['ListPromotions'] });\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [errors, setErrors] = useState<Partial<Record<keyof FormData, string>>>({});\n\n const today = new Date().toISOString().split('T')[0];\n const [form, setForm] = useState<FormData>({\n name: '',\n description: '',\n startsAt: today,\n expiresAt: '',\n bonusMonths: 1,\n maxRedemptions: '',\n applicableProductIds: [],\n applicablePlanIds: '',\n });\n\n if (!permissions.canManagePlans) {\n return <AccessDenied message=\"You don't have permission to create promotions.\" />;\n }\n\n const set = <K extends keyof FormData>(k: K, v: FormData[K]) =>\n setForm((prev) => ({ ...prev, [k]: v }));\n\n const toggleProduct = (pid: string) => {\n set(\n 'applicableProductIds',\n form.applicableProductIds.includes(pid)\n ? form.applicableProductIds.filter((p) => p !== pid)\n : [...form.applicableProductIds, pid]\n );\n };\n\n const validate = () => {\n const e: typeof errors = {};\n if (!form.name.trim()) e.name = 'Name is required';\n if (!form.startsAt) e.startsAt = 'Start date is required';\n if (!form.expiresAt) e.expiresAt = 'End date is required';\n if (form.expiresAt && form.expiresAt <= form.startsAt)\n e.expiresAt = 'End date must be after start date';\n if (form.bonusMonths < 1) e.bonusMonths = 'Must be at least 1';\n setErrors(e);\n return Object.keys(e).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!validate()) return;\n setIsSubmitting(true);\n try {\n const planIds = form.applicablePlanIds.split(',').flatMap((s) => {\n const trimmed = s.trim();\n return trimmed ? [trimmed] : [];\n });\n\n await createPromotion({\n variables: {\n input: {\n name: form.name.trim(),\n description: form.description.trim() || undefined,\n startsAt: new Date(form.startsAt).toISOString(),\n expiresAt: new Date(form.expiresAt).toISOString(),\n bonusMonths: form.bonusMonths,\n maxRedemptions: form.maxRedemptions ? parseInt(form.maxRedemptions) : undefined,\n applicableProductIds: form.applicableProductIds,\n applicablePlanIds: planIds,\n },\n },\n });\n navigateTo('/promotions');\n } catch (err) {\n setErrors({ name: err instanceof Error ? err.message : 'Failed to create promotion' });\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n <div className=\"max-w-2xl mx-auto p-4 sm:p-6 space-y-6\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/promotions')}\n aria-label=\"Back to promotions\"\n className=\"p-2 rounded-button hover:bg-bg-sunken text-text-muted hover:text-text-primary transition-colors\"\n >\n <ArrowLeft className=\"size-5\" />\n </button>\n <PageHeader\n title=\"Create Promotion\"\n description=\"Offer bonus free renewal months to subscribers who sign up within the promotion window\"\n icon={<Gift className=\"size-6\" />}\n />\n </div>\n\n <form onSubmit={handleSubmit} className=\"space-y-5\">\n {/* Basic info */}\n <div className=\"bg-bg-surface border border-border-subtle rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Promotion Details</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">Name *</label>\n <input\n type=\"text\"\n value={form.name}\n onChange={(e) => set('name', e.target.value)}\n placeholder=\"e.g. June Launch Offer\"\n className={`w-full px-3 py-2 rounded-input border ${errors.name ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.name && <p className=\"text-xs text-status-error-text mt-1\">{errors.name}</p>}\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">Description</label>\n <textarea\n value={form.description}\n onChange={(e) => set('description', e.target.value)}\n placeholder=\"Subscribe in June and get 2 extra months free!\"\n rows={2}\n className=\"w-full px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n\n {/* Bonus config */}\n <div className=\"bg-bg-surface border border-border-subtle rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Bonus Configuration</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Bonus Months *\n </label>\n <input\n type=\"number\"\n value={form.bonusMonths}\n min={1}\n max={12}\n onChange={(e) => set('bonusMonths', parseInt(e.target.value) || 1)}\n className={`w-32 px-3 py-2 rounded-input border ${errors.bonusMonths ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.bonusMonths && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.bonusMonths}</p>\n )}\n <div className=\"mt-2 flex items-start gap-2 p-3 bg-[var(--color-accent-soft)] rounded-lg text-sm text-text-muted\">\n <Info className=\"size-4 shrink-0 mt-0.5 text-text-link\" />\n <span>\n Users who subscribe during this window get{' '}\n <strong className=\"text-text-primary\">\n {form.bonusMonths} free renewal{form.bonusMonths !== 1 ? 's' : ''}\n </strong>{' '}\n after their first paid period — their quota resets each month as normal.\n </span>\n </div>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Max Redemptions\n </label>\n <input\n type=\"number\"\n value={form.maxRedemptions}\n min={1}\n onChange={(e) => set('maxRedemptions', e.target.value)}\n placeholder=\"Unlimited\"\n className=\"w-48 px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"text-xs text-text-muted mt-1\">Leave empty for no cap</p>\n </div>\n </div>\n\n {/* Date window */}\n <div className=\"bg-bg-surface border border-border-subtle rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Active Window</h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Start Date *\n </label>\n <input\n type=\"date\"\n value={form.startsAt}\n onChange={(e) => set('startsAt', e.target.value)}\n className={`w-full px-3 py-2 rounded-input border ${errors.startsAt ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.startsAt && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.startsAt}</p>\n )}\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">End Date *</label>\n <input\n type=\"date\"\n value={form.expiresAt}\n onChange={(e) => set('expiresAt', e.target.value)}\n min={form.startsAt}\n className={`w-full px-3 py-2 rounded-input border ${errors.expiresAt ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.expiresAt && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.expiresAt}</p>\n )}\n </div>\n </div>\n <p className=\"text-xs text-text-muted\">\n Only purchases made between these dates will receive the bonus months\n </p>\n </div>\n\n {/* Scope */}\n <div className=\"bg-bg-surface border border-border-subtle rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Scope</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-2\">\n Applicable Products\n </label>\n <div className=\"flex flex-wrap gap-2\">\n {KNOWN_PRODUCTS.map((pid) => (\n <button\n key={pid}\n type=\"button\"\n onClick={() => toggleProduct(pid)}\n className={`px-3 py-1.5 rounded-lg border text-sm transition-colors ${\n form.applicableProductIds.includes(pid)\n ? 'border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium'\n : 'border-border-subtle hover:border-action-primary-bg/50'\n }`}\n >\n {pid}\n </button>\n ))}\n </div>\n <p className=\"text-xs text-text-muted mt-1\">\n {form.applicableProductIds.length === 0\n ? 'No selection = applies to all products'\n : `Applies to: ${form.applicableProductIds.join(', ')}`}\n </p>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Plan IDs (optional)\n </label>\n <input\n type=\"text\"\n value={form.applicablePlanIds}\n onChange={(e) => set('applicablePlanIds', e.target.value)}\n placeholder=\"plan-vibecontrols-pro-monthly, plan-vibecontrols-pro-yearly\"\n className=\"w-full px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"text-xs text-text-muted mt-1\">\n Comma-separated. Leave empty to apply to all plans\n </p>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-3 justify-end\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/promotions')}\n className=\"px-5 py-2 rounded-button border border-border-subtle text-text-primary hover:bg-bg-sunken text-sm font-medium transition-colors\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={isSubmitting}\n className=\"px-5 py-2 rounded-button bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover flex items-center gap-2 text-sm font-medium transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50\"\n >\n {isSubmitting ? (\n <div className=\"size-4 border-2 border-action-primary-text border-t-transparent rounded-full animate-spin\" />\n ) : (\n <Save className=\"size-4\" />\n )}\n Create Promotion\n </button>\n </div>\n </form>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;AAOA,IAAM,IAAiB;CAAC;CAAgB;CAAc;CAAU;CAAc;CAAc,EAa/E,UAAgC;CAC3C,IAAM,IAAa,GAAoB,EACjC,IAAc,GAAuB,EACrC,CAAC,KAAmB,EAA2B,EAAE,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,EACtF,CAAC,GAAc,KAAmB,EAAS,GAAM,EACjD,CAAC,GAAQ,KAAa,EAAkD,EAAE,CAAC,EAE3E,qBAAQ,IAAI,MAAM,EAAC,aAAa,CAAC,MAAM,IAAI,CAAC,IAC5C,CAAC,GAAM,KAAW,EAAmB;EACzC,MAAM;EACN,aAAa;EACb,UAAU;EACV,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,sBAAsB,EAAE;EACxB,mBAAmB;EACpB,CAAC;AAEF,KAAI,CAAC,EAAY,eACf,QAAO,kBAAC,GAAD,EAAc,SAAQ,mDAAoD,CAAA;CAGnF,IAAM,KAAiC,GAAM,MAC3C,GAAS,OAAU;EAAE,GAAG;GAAO,IAAI;EAAG,EAAE,EAEpC,KAAiB,MAAgB;AACrC,IACE,wBACA,EAAK,qBAAqB,SAAS,EAAI,GACnC,EAAK,qBAAqB,QAAQ,MAAM,MAAM,EAAI,GAClD,CAAC,GAAG,EAAK,sBAAsB,EAAI,CACxC;IAGG,UAAiB;EACrB,IAAM,IAAmB,EAAE;AAQ3B,SAPK,EAAK,KAAK,MAAM,KAAE,EAAE,OAAO,qBAC3B,EAAK,aAAU,EAAE,WAAW,2BAC5B,EAAK,cAAW,EAAE,YAAY,yBAC/B,EAAK,aAAa,EAAK,aAA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
|
|
146
146
|
className: "space-y-6 p-6",
|
|
147
|
-
children: [/* @__PURE__ */ s("div", { className: "h-8 w-48 bg-
|
|
148
|
-
className: "border border-border rounded-lg p-6 space-y-4",
|
|
147
|
+
children: [/* @__PURE__ */ s("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ s("div", {
|
|
148
|
+
className: "border border-border-subtle rounded-lg p-6 space-y-4",
|
|
149
149
|
children: [
|
|
150
150
|
1,
|
|
151
151
|
2,
|
|
152
152
|
3
|
|
153
|
-
].map((e) => /* @__PURE__ */ s("div", { className: "h-10 bg-
|
|
153
|
+
].map((e) => /* @__PURE__ */ s("div", { className: "h-10 bg-bg-sunken animate-pulse rounded" }, e))
|
|
154
154
|
})]
|
|
155
155
|
}) : /* @__PURE__ */ c("div", {
|
|
156
156
|
className: "space-y-6 p-6",
|
|
@@ -164,11 +164,11 @@ var d = () => {
|
|
|
164
164
|
children: [/* @__PURE__ */ c("button", {
|
|
165
165
|
type: "button",
|
|
166
166
|
onClick: () => S(!x),
|
|
167
|
-
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border rounded-lg bg-
|
|
167
|
+
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-subtle rounded-lg bg-bg-surface hover:bg-bg-sunken/50 transition-colors",
|
|
168
168
|
children: [/* @__PURE__ */ c("div", {
|
|
169
169
|
className: "flex items-center gap-3",
|
|
170
170
|
children: [/* @__PURE__ */ s("div", {
|
|
171
|
-
className: "size-8 rounded-lg bg-primary/10 flex items-center justify-center",
|
|
171
|
+
className: "size-8 rounded-lg bg-action-primary-bg/10 flex items-center justify-center",
|
|
172
172
|
children: /* @__PURE__ */ s("svg", {
|
|
173
173
|
className: "size-4 text-primary",
|
|
174
174
|
fill: "none",
|
|
@@ -184,15 +184,15 @@ var d = () => {
|
|
|
184
184
|
}), /* @__PURE__ */ c("div", {
|
|
185
185
|
className: "text-left",
|
|
186
186
|
children: [/* @__PURE__ */ s("p", {
|
|
187
|
-
className: "text-sm font-medium text-
|
|
187
|
+
className: "text-sm font-medium text-text-primary",
|
|
188
188
|
children: q?.name || p("billing.settings.selectAccount", "Select Account")
|
|
189
189
|
}), /* @__PURE__ */ s("p", {
|
|
190
|
-
className: "text-xs text-
|
|
190
|
+
className: "text-xs text-text-secondary",
|
|
191
191
|
children: q?.email
|
|
192
192
|
})]
|
|
193
193
|
})]
|
|
194
194
|
}), /* @__PURE__ */ s("svg", {
|
|
195
|
-
className: `size-4 text-
|
|
195
|
+
className: `size-4 text-text-secondary transition-transform ${x ? "rotate-180" : ""}`,
|
|
196
196
|
fill: "none",
|
|
197
197
|
viewBox: "0 0 24 24",
|
|
198
198
|
stroke: "currentColor",
|
|
@@ -207,17 +207,17 @@ var d = () => {
|
|
|
207
207
|
className: "fixed inset-0 z-10",
|
|
208
208
|
onClick: () => S(!1)
|
|
209
209
|
}), /* @__PURE__ */ s("div", {
|
|
210
|
-
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-popover border border-border rounded-lg shadow-lg z-20 py-1 max-h-60 overflow-y-auto",
|
|
210
|
+
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-popover border border-border-subtle rounded-lg shadow-lg z-20 py-1 max-h-60 overflow-y-auto",
|
|
211
211
|
children: L.map((e) => /* @__PURE__ */ c("button", {
|
|
212
212
|
type: "button",
|
|
213
213
|
onClick: () => he(e),
|
|
214
|
-
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-
|
|
214
|
+
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
215
215
|
children: [/* @__PURE__ */ c("div", {
|
|
216
216
|
className: "flex items-center gap-3 min-w-0",
|
|
217
217
|
children: [/* @__PURE__ */ s("div", {
|
|
218
|
-
className: "size-8 rounded-lg bg-
|
|
218
|
+
className: "size-8 rounded-lg bg-bg-sunken flex items-center justify-center flex-shrink-0",
|
|
219
219
|
children: /* @__PURE__ */ s("svg", {
|
|
220
|
-
className: "size-4 text-
|
|
220
|
+
className: "size-4 text-text-secondary",
|
|
221
221
|
fill: "none",
|
|
222
222
|
viewBox: "0 0 24 24",
|
|
223
223
|
stroke: "currentColor",
|
|
@@ -231,10 +231,10 @@ var d = () => {
|
|
|
231
231
|
}), /* @__PURE__ */ c("div", {
|
|
232
232
|
className: "text-left min-w-0",
|
|
233
233
|
children: [/* @__PURE__ */ s("p", {
|
|
234
|
-
className: "text-sm font-medium text-
|
|
234
|
+
className: "text-sm font-medium text-text-primary truncate",
|
|
235
235
|
children: e.name
|
|
236
236
|
}), /* @__PURE__ */ s("p", {
|
|
237
|
-
className: "text-xs text-
|
|
237
|
+
className: "text-xs text-text-secondary truncate",
|
|
238
238
|
children: e.email
|
|
239
239
|
})]
|
|
240
240
|
})]
|
|
@@ -254,19 +254,19 @@ var d = () => {
|
|
|
254
254
|
})] })]
|
|
255
255
|
}),
|
|
256
256
|
/* @__PURE__ */ c("div", {
|
|
257
|
-
className: "border border-border rounded-lg bg-
|
|
257
|
+
className: "border border-border-subtle rounded-lg bg-bg-surface",
|
|
258
258
|
children: [/* @__PURE__ */ s("div", {
|
|
259
|
-
className: "p-6 border-b border-border",
|
|
259
|
+
className: "p-6 border-b border-border-subtle",
|
|
260
260
|
children: /* @__PURE__ */ c("div", {
|
|
261
261
|
className: "flex items-center justify-between",
|
|
262
262
|
children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h2", {
|
|
263
|
-
className: "text-lg font-semibold text-
|
|
263
|
+
className: "text-lg font-semibold text-text-primary",
|
|
264
264
|
children: p("billing.settings.accountInfo", "Account Information")
|
|
265
265
|
}), /* @__PURE__ */ s("p", {
|
|
266
|
-
className: "text-sm text-
|
|
266
|
+
className: "text-sm text-text-secondary mt-1",
|
|
267
267
|
children: p("billing.settings.accountInfoDescription", "Update your billing contact details and tax information")
|
|
268
268
|
})] }), q?.isDefault && /* @__PURE__ */ c("span", {
|
|
269
|
-
className: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium bg-primary/10 text-primary rounded-full",
|
|
269
|
+
className: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium bg-action-primary-bg/10 text-primary rounded-full",
|
|
270
270
|
children: [/* @__PURE__ */ s("svg", {
|
|
271
271
|
className: "size-3",
|
|
272
272
|
fill: "currentColor",
|
|
@@ -283,52 +283,52 @@ var d = () => {
|
|
|
283
283
|
className: "p-6 space-y-6",
|
|
284
284
|
children: [
|
|
285
285
|
q && /* @__PURE__ */ c("div", {
|
|
286
|
-
className: "grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm pb-4 border-b border-border",
|
|
286
|
+
className: "grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm pb-4 border-b border-border-subtle",
|
|
287
287
|
children: [
|
|
288
288
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
289
|
-
className: "text-
|
|
289
|
+
className: "text-text-secondary",
|
|
290
290
|
children: p("billing.settings.status", "Status")
|
|
291
291
|
}), /* @__PURE__ */ s("p", {
|
|
292
|
-
className: `font-medium ${q.isActive ? "text-status-success-text" : "text-
|
|
292
|
+
className: `font-medium ${q.isActive ? "text-status-success-text" : "text-status-error-text"}`,
|
|
293
293
|
children: q.isActive ? p("billing.settings.active", "Active") : p("billing.settings.inactive", "Inactive")
|
|
294
294
|
})] }),
|
|
295
295
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
296
|
-
className: "text-
|
|
296
|
+
className: "text-text-secondary",
|
|
297
297
|
children: p("billing.settings.creditBalance", "Credit Balance")
|
|
298
298
|
}), /* @__PURE__ */ c("p", {
|
|
299
|
-
className: "font-medium text-
|
|
299
|
+
className: "font-medium text-text-primary",
|
|
300
300
|
children: [(q.creditAmount || 0).toLocaleString(), " Credits"]
|
|
301
301
|
})] }),
|
|
302
302
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
303
|
-
className: "text-
|
|
303
|
+
className: "text-text-secondary",
|
|
304
304
|
children: p("billing.settings.accountId", "Account ID")
|
|
305
305
|
}), /* @__PURE__ */ s("p", {
|
|
306
|
-
className: "font-mono text-xs text-
|
|
306
|
+
className: "font-mono text-xs text-text-primary truncate",
|
|
307
307
|
title: q.id,
|
|
308
308
|
children: q.id
|
|
309
309
|
})] }),
|
|
310
310
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
311
|
-
className: "text-
|
|
311
|
+
className: "text-text-secondary",
|
|
312
312
|
children: p("billing.settings.created", "Created")
|
|
313
313
|
}), /* @__PURE__ */ s("p", {
|
|
314
|
-
className: "font-medium text-
|
|
314
|
+
className: "font-medium text-text-primary",
|
|
315
315
|
children: q.createdAt ? new Date(q.createdAt).toLocaleDateString() : p("billing.settings.notAvailable", "N/A")
|
|
316
316
|
})] })
|
|
317
317
|
]
|
|
318
318
|
}),
|
|
319
319
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h3", {
|
|
320
|
-
className: "text-sm font-medium text-
|
|
320
|
+
className: "text-sm font-medium text-text-primary mb-4",
|
|
321
321
|
children: p("billing.settings.contactDetails", "Contact Details")
|
|
322
322
|
}), /* @__PURE__ */ c("div", {
|
|
323
323
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
324
324
|
children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("label", {
|
|
325
325
|
htmlFor: "billing-account-name",
|
|
326
|
-
className: "block text-sm font-medium text-
|
|
326
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
327
327
|
children: [
|
|
328
328
|
p("billing.settings.accountName", "Account Name"),
|
|
329
329
|
" ",
|
|
330
330
|
/* @__PURE__ */ s("span", {
|
|
331
|
-
className: "text-
|
|
331
|
+
className: "text-status-error-text",
|
|
332
332
|
children: "*"
|
|
333
333
|
})
|
|
334
334
|
]
|
|
@@ -337,15 +337,15 @@ var d = () => {
|
|
|
337
337
|
type: "text",
|
|
338
338
|
value: M.name,
|
|
339
339
|
onChange: (e) => J("name", e.target.value),
|
|
340
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
340
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
341
341
|
})] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("label", {
|
|
342
342
|
htmlFor: "billing-account-email",
|
|
343
|
-
className: "block text-sm font-medium text-
|
|
343
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
344
344
|
children: [
|
|
345
345
|
p("billing.settings.email", "Email"),
|
|
346
346
|
" ",
|
|
347
347
|
/* @__PURE__ */ s("span", {
|
|
348
|
-
className: "text-
|
|
348
|
+
className: "text-status-error-text",
|
|
349
349
|
children: "*"
|
|
350
350
|
})
|
|
351
351
|
]
|
|
@@ -354,7 +354,7 @@ var d = () => {
|
|
|
354
354
|
type: "email",
|
|
355
355
|
value: M.email,
|
|
356
356
|
onChange: (e) => J("email", e.target.value),
|
|
357
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
357
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
358
358
|
})] })]
|
|
359
359
|
})] }),
|
|
360
360
|
/* @__PURE__ */ s(u, {
|
|
@@ -366,7 +366,7 @@ var d = () => {
|
|
|
366
366
|
/* @__PURE__ */ c("div", { children: [
|
|
367
367
|
/* @__PURE__ */ s("label", {
|
|
368
368
|
htmlFor: "billing-account-billing-email",
|
|
369
|
-
className: "block text-sm font-medium text-
|
|
369
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
370
370
|
children: p("billing.settings.billingEmail", "Billing Email")
|
|
371
371
|
}),
|
|
372
372
|
/* @__PURE__ */ s("input", {
|
|
@@ -375,22 +375,22 @@ var d = () => {
|
|
|
375
375
|
value: M.billingEmail,
|
|
376
376
|
onChange: (e) => J("billingEmail", e.target.value),
|
|
377
377
|
placeholder: p("billing.settings.billingEmailPlaceholder", "Optional - defaults to account email"),
|
|
378
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
378
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
379
379
|
}),
|
|
380
380
|
/* @__PURE__ */ s("p", {
|
|
381
|
-
className: "text-xs text-
|
|
381
|
+
className: "text-xs text-text-secondary mt-1",
|
|
382
382
|
children: p("billing.settings.billingEmailHelp", "Invoices will be sent to this email if provided")
|
|
383
383
|
})
|
|
384
384
|
] }),
|
|
385
385
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
|
|
386
386
|
htmlFor: "billing-account-currency",
|
|
387
|
-
className: "block text-sm font-medium text-
|
|
387
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
388
388
|
children: p("billing.settings.currency", "Currency")
|
|
389
389
|
}), /* @__PURE__ */ c("select", {
|
|
390
390
|
id: "billing-account-currency",
|
|
391
391
|
value: M.currency,
|
|
392
392
|
onChange: (e) => J("currency", e.target.value),
|
|
393
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
393
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ s("option", {
|
|
396
396
|
value: "USD",
|
|
@@ -415,7 +415,7 @@ var d = () => {
|
|
|
415
415
|
children: [
|
|
416
416
|
/* @__PURE__ */ s("label", {
|
|
417
417
|
htmlFor: "billing-account-tax-id",
|
|
418
|
-
className: "block text-sm font-medium text-
|
|
418
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
419
419
|
children: p("billing.settings.taxId", "Tax ID / VAT Number")
|
|
420
420
|
}),
|
|
421
421
|
/* @__PURE__ */ s("input", {
|
|
@@ -424,10 +424,10 @@ var d = () => {
|
|
|
424
424
|
value: M.taxId,
|
|
425
425
|
onChange: (e) => J("taxId", e.target.value),
|
|
426
426
|
placeholder: p("billing.settings.taxIdPlaceholder", "Enter your tax identification number"),
|
|
427
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
427
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
428
428
|
}),
|
|
429
429
|
/* @__PURE__ */ s("p", {
|
|
430
|
-
className: "text-xs text-
|
|
430
|
+
className: "text-xs text-text-secondary mt-1",
|
|
431
431
|
children: p("billing.settings.taxIdHelp", "Used for invoices and tax compliance (e.g., GST, VAT number)")
|
|
432
432
|
})
|
|
433
433
|
]
|
|
@@ -436,7 +436,7 @@ var d = () => {
|
|
|
436
436
|
})
|
|
437
437
|
}),
|
|
438
438
|
q?.isActive && L.length > 1 && /* @__PURE__ */ s("div", {
|
|
439
|
-
className: "pt-4 border-t border-border",
|
|
439
|
+
className: "pt-4 border-t border-border-subtle",
|
|
440
440
|
children: /* @__PURE__ */ c("div", {
|
|
441
441
|
className: "flex items-start gap-3",
|
|
442
442
|
children: [/* @__PURE__ */ s("div", {
|
|
@@ -450,23 +450,23 @@ var d = () => {
|
|
|
450
450
|
isDefault: e.target.checked
|
|
451
451
|
})),
|
|
452
452
|
disabled: q?.isDefault,
|
|
453
|
-
className: "size-4 rounded border-border text-primary focus:ring-primary focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
453
|
+
className: "size-4 rounded border-border-subtle text-primary focus:ring-primary focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
454
454
|
})
|
|
455
455
|
}), /* @__PURE__ */ c("div", {
|
|
456
456
|
className: "flex-1",
|
|
457
457
|
children: [/* @__PURE__ */ s("label", {
|
|
458
458
|
htmlFor: "isDefault",
|
|
459
|
-
className: "text-sm font-medium text-
|
|
459
|
+
className: "text-sm font-medium text-text-primary cursor-pointer",
|
|
460
460
|
children: p("billing.settings.setDefault", "Set as default billing account")
|
|
461
461
|
}), /* @__PURE__ */ s("p", {
|
|
462
|
-
className: "text-xs text-
|
|
462
|
+
className: "text-xs text-text-secondary mt-0.5",
|
|
463
463
|
children: q?.isDefault ? p("billing.settings.currentDefaultDescription", "This is currently your default billing account") : p("billing.settings.makePrimaryDescription", "Make this your primary billing account for new subscriptions")
|
|
464
464
|
})]
|
|
465
465
|
})]
|
|
466
466
|
})
|
|
467
467
|
}),
|
|
468
468
|
/* @__PURE__ */ c("div", {
|
|
469
|
-
className: "pt-4 border-t border-border flex items-center justify-between",
|
|
469
|
+
className: "pt-4 border-t border-border-subtle flex items-center justify-between",
|
|
470
470
|
children: [/* @__PURE__ */ c("div", {
|
|
471
471
|
className: "flex items-center gap-2",
|
|
472
472
|
children: [ue && /* @__PURE__ */ c("div", {
|
|
@@ -484,7 +484,7 @@ var d = () => {
|
|
|
484
484
|
})
|
|
485
485
|
}), p("billing.settings.saveSuccess", "Changes saved successfully")]
|
|
486
486
|
}), D && /* @__PURE__ */ c("div", {
|
|
487
|
-
className: "flex items-center gap-2 text-sm text-
|
|
487
|
+
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
488
488
|
children: [/* @__PURE__ */ s("svg", {
|
|
489
489
|
className: "size-4",
|
|
490
490
|
fill: "none",
|
|
@@ -504,13 +504,13 @@ var d = () => {
|
|
|
504
504
|
type: "button",
|
|
505
505
|
onClick: _e,
|
|
506
506
|
disabled: C || T,
|
|
507
|
-
className: "px-4 py-2 text-sm font-medium border border-border text-status-error-text rounded-md hover:bg-status-error-bg-subtle disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
507
|
+
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-status-error-text rounded-md hover:bg-status-error-bg-subtle disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
508
508
|
children: T ? "Archiving..." : "Archive Account"
|
|
509
509
|
}) : null, /* @__PURE__ */ c("button", {
|
|
510
510
|
type: "button",
|
|
511
511
|
onClick: $,
|
|
512
512
|
disabled: !ge || C || T || !M.name || !M.email,
|
|
513
|
-
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-
|
|
513
|
+
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2",
|
|
514
514
|
children: [C && /* @__PURE__ */ c("svg", {
|
|
515
515
|
className: "size-4 animate-spin",
|
|
516
516
|
fill: "none",
|
|
@@ -545,19 +545,19 @@ var d = () => {
|
|
|
545
545
|
}), /* @__PURE__ */ s("div", {
|
|
546
546
|
className: "fixed inset-0 flex items-center justify-center z-50 p-4",
|
|
547
547
|
children: /* @__PURE__ */ c("div", {
|
|
548
|
-
className: "bg-
|
|
548
|
+
className: "bg-bg-surface border border-border-subtle rounded-lg shadow-xl max-w-md w-full p-6",
|
|
549
549
|
children: [
|
|
550
550
|
/* @__PURE__ */ s("h3", {
|
|
551
|
-
className: "text-lg font-semibold text-
|
|
551
|
+
className: "text-lg font-semibold text-text-primary mb-2",
|
|
552
552
|
children: "Confirm Default Account Change"
|
|
553
553
|
}),
|
|
554
554
|
/* @__PURE__ */ c("p", {
|
|
555
|
-
className: "text-sm text-
|
|
555
|
+
className: "text-sm text-text-secondary mb-4",
|
|
556
556
|
children: [
|
|
557
557
|
"You are about to set",
|
|
558
558
|
" ",
|
|
559
559
|
/* @__PURE__ */ s("strong", {
|
|
560
|
-
className: "text-
|
|
560
|
+
className: "text-text-primary",
|
|
561
561
|
children: q?.name
|
|
562
562
|
}),
|
|
563
563
|
" as your default billing account and save your changes."
|
|
@@ -601,13 +601,13 @@ var d = () => {
|
|
|
601
601
|
}));
|
|
602
602
|
},
|
|
603
603
|
disabled: C,
|
|
604
|
-
className: "px-4 py-2 text-sm font-medium text-
|
|
604
|
+
className: "px-4 py-2 text-sm font-medium text-text-primary border border-border-subtle rounded-md hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
605
605
|
children: "Cancel"
|
|
606
606
|
}), /* @__PURE__ */ c("button", {
|
|
607
607
|
type: "button",
|
|
608
608
|
onClick: Q,
|
|
609
609
|
disabled: C,
|
|
610
|
-
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-
|
|
610
|
+
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 transition-colors flex items-center gap-2",
|
|
611
611
|
children: [C && /* @__PURE__ */ c("svg", {
|
|
612
612
|
className: "size-4 animate-spin",
|
|
613
613
|
fill: "none",
|