@infuro/cms-core 1.0.39 → 1.0.41
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/admin.cjs +214 -111
- package/dist/admin.js +215 -112
- package/dist/api.cjs +32 -32
- package/dist/api.d.cts +4 -1
- package/dist/api.d.ts +4 -1
- package/dist/api.js +1 -1
- package/dist/auth.cjs +12 -12
- package/dist/auth.js +1 -1
- package/dist/{chunk-SBRBR3VO.js → chunk-4BG7XYSH.js} +1 -0
- package/dist/{chunk-SFDZMGHD.js → chunk-EG4ICILK.js} +460 -102
- package/dist/{chunk-E6WVP7BK.cjs → chunk-ETZN4OQI.cjs} +1 -0
- package/dist/{chunk-ERJK5QXN.cjs → chunk-QU554KAZ.cjs} +461 -100
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +210 -198
- package/dist/index.d.cts +84 -68
- package/dist/index.d.ts +84 -68
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/admin.cjs
CHANGED
|
@@ -492,7 +492,7 @@ var init_admin_config_context = __esm({
|
|
|
492
492
|
var CMS_VERSION;
|
|
493
493
|
var init_cms_version = __esm({
|
|
494
494
|
"src/lib/cms-version.ts"() {
|
|
495
|
-
CMS_VERSION = "1.0.
|
|
495
|
+
CMS_VERSION = "1.0.41" ;
|
|
496
496
|
}
|
|
497
497
|
});
|
|
498
498
|
function useCatalogCategories(enabled = true) {
|
|
@@ -9145,11 +9145,40 @@ function InvitePageContent() {
|
|
|
9145
9145
|
confirmPassword: ""
|
|
9146
9146
|
});
|
|
9147
9147
|
const [loading, setLoading] = React26.useState(false);
|
|
9148
|
+
const [checking, setChecking] = React26.useState(Boolean(token));
|
|
9149
|
+
const [inviteValid, setInviteValid] = React26.useState(false);
|
|
9148
9150
|
const [message, setMessage] = React26.useState("");
|
|
9149
9151
|
React26.useEffect(() => {
|
|
9150
9152
|
if (!token) {
|
|
9151
9153
|
setMessage("Invalid invite link. Token is missing.");
|
|
9154
|
+
setChecking(false);
|
|
9155
|
+
return;
|
|
9152
9156
|
}
|
|
9157
|
+
let cancelled = false;
|
|
9158
|
+
void (async () => {
|
|
9159
|
+
try {
|
|
9160
|
+
const res = await fetch(`/api/users/invite?token=${encodeURIComponent(token)}`);
|
|
9161
|
+
const result = await res.json();
|
|
9162
|
+
if (cancelled) return;
|
|
9163
|
+
if (res.ok && result.valid === true) {
|
|
9164
|
+
setInviteValid(true);
|
|
9165
|
+
setMessage("");
|
|
9166
|
+
} else {
|
|
9167
|
+
setInviteValid(false);
|
|
9168
|
+
setMessage(result.error || "This invitation is no longer valid.");
|
|
9169
|
+
}
|
|
9170
|
+
} catch {
|
|
9171
|
+
if (!cancelled) {
|
|
9172
|
+
setInviteValid(false);
|
|
9173
|
+
setMessage("Could not verify this invite link. Please try again.");
|
|
9174
|
+
}
|
|
9175
|
+
} finally {
|
|
9176
|
+
if (!cancelled) setChecking(false);
|
|
9177
|
+
}
|
|
9178
|
+
})();
|
|
9179
|
+
return () => {
|
|
9180
|
+
cancelled = true;
|
|
9181
|
+
};
|
|
9153
9182
|
}, [
|
|
9154
9183
|
token
|
|
9155
9184
|
]);
|
|
@@ -9192,12 +9221,21 @@ function InvitePageContent() {
|
|
|
9192
9221
|
setLoading(false);
|
|
9193
9222
|
}
|
|
9194
9223
|
}, "handleSubmit");
|
|
9195
|
-
if (!token) {
|
|
9224
|
+
if (!token || checking) {
|
|
9196
9225
|
return /* @__PURE__ */ React26__namespace.default.createElement(AuthPageLayout, null, /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
9197
9226
|
className: "w-full space-y-4 p-5 sm:p-6 bg-white rounded-lg shadow-md text-center"
|
|
9198
9227
|
}, /* @__PURE__ */ React26__namespace.default.createElement("h2", {
|
|
9199
9228
|
className: "text-xl font-bold text-gray-900"
|
|
9200
|
-
}, "Invalid invite"), /* @__PURE__ */ React26__namespace.default.createElement("p", {
|
|
9229
|
+
}, checking ? "Checking invite\u2026" : "Invalid invite"), !checking && /* @__PURE__ */ React26__namespace.default.createElement("p", {
|
|
9230
|
+
className: "text-sm text-gray-600"
|
|
9231
|
+
}, message)));
|
|
9232
|
+
}
|
|
9233
|
+
if (!inviteValid) {
|
|
9234
|
+
return /* @__PURE__ */ React26__namespace.default.createElement(AuthPageLayout, null, /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
9235
|
+
className: "w-full space-y-4 p-5 sm:p-6 bg-white rounded-lg shadow-md text-center"
|
|
9236
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("h2", {
|
|
9237
|
+
className: "text-xl font-bold text-gray-900"
|
|
9238
|
+
}, "Invite unavailable"), /* @__PURE__ */ React26__namespace.default.createElement("p", {
|
|
9201
9239
|
className: "text-sm text-gray-600"
|
|
9202
9240
|
}, message)));
|
|
9203
9241
|
}
|
|
@@ -12705,7 +12743,7 @@ function SettingsPage() {
|
|
|
12705
12743
|
onCheckedChange: setMultiVendorEnabled
|
|
12706
12744
|
}), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Label3, {
|
|
12707
12745
|
className: "text-sm font-medium text-gray-700"
|
|
12708
|
-
}, "Multi Vendor
|
|
12746
|
+
}, "Multi Vendor"), /* @__PURE__ */ React.createElement("p", {
|
|
12709
12747
|
className: "text-xs text-gray-500"
|
|
12710
12748
|
}, "Enable vendor portals, vendor logins, and vendor-scoped store data. Disabling this blocks vendor-only accounts from signing in."))), storeEnabled && /* @__PURE__ */ React.createElement("div", {
|
|
12711
12749
|
className: "mt-4 flex items-center gap-3 p-4 bg-gray-50 rounded-lg border border-gray-200"
|
|
@@ -31530,10 +31568,10 @@ function VendorEditPage({ vendorId }) {
|
|
|
31530
31568
|
const [ownerPhone, setOwnerPhone] = React26.useState("");
|
|
31531
31569
|
const [ownerDesignation, setOwnerDesignation] = React26.useState("");
|
|
31532
31570
|
const [termsAccepted, setTermsAccepted] = React26.useState(false);
|
|
31533
|
-
const [
|
|
31534
|
-
const [
|
|
31535
|
-
const [
|
|
31536
|
-
const [
|
|
31571
|
+
const [reinviting, setReinviting] = React26.useState(false);
|
|
31572
|
+
const [inviteDialog, setInviteDialog] = React26.useState(null);
|
|
31573
|
+
const [sendingInviteEmail, setSendingInviteEmail] = React26.useState(false);
|
|
31574
|
+
const [linkCopied, setLinkCopied] = React26.useState(false);
|
|
31537
31575
|
const vendorPayload = /* @__PURE__ */ __name(() => ({
|
|
31538
31576
|
name: name.trim(),
|
|
31539
31577
|
legalName: legalName.trim() || null,
|
|
@@ -31613,11 +31651,115 @@ function VendorEditPage({ vendorId }) {
|
|
|
31613
31651
|
vendorId,
|
|
31614
31652
|
create
|
|
31615
31653
|
]);
|
|
31654
|
+
const canReinviteOwner = !create && (inviteStatus === "pending" || inviteStatus === "expired");
|
|
31655
|
+
const handleReinviteOwner = /* @__PURE__ */ __name(async () => {
|
|
31656
|
+
setReinviting(true);
|
|
31657
|
+
setErrors([]);
|
|
31658
|
+
try {
|
|
31659
|
+
const res = await fetch(`/api/admin/vendors/${vendorId}/resend-invite`, {
|
|
31660
|
+
method: "POST",
|
|
31661
|
+
headers: {
|
|
31662
|
+
"Content-Type": "application/json"
|
|
31663
|
+
},
|
|
31664
|
+
body: JSON.stringify({
|
|
31665
|
+
sendEmail: true
|
|
31666
|
+
})
|
|
31667
|
+
});
|
|
31668
|
+
const data = await res.json();
|
|
31669
|
+
if (!res.ok) {
|
|
31670
|
+
setErrors([
|
|
31671
|
+
data.error || data.message || "Failed to resend invite"
|
|
31672
|
+
]);
|
|
31673
|
+
return;
|
|
31674
|
+
}
|
|
31675
|
+
const refreshRes = await fetch(`/api/vendors/${vendorId}`);
|
|
31676
|
+
if (refreshRes.ok) {
|
|
31677
|
+
const refreshed = await refreshRes.json();
|
|
31678
|
+
setInviteStatus(refreshed.inviteStatus ?? "pending");
|
|
31679
|
+
setMetadata(refreshed.metadata && typeof refreshed.metadata === "object" ? refreshed.metadata : null);
|
|
31680
|
+
} else {
|
|
31681
|
+
setInviteStatus("pending");
|
|
31682
|
+
}
|
|
31683
|
+
const inviteLink = typeof data.inviteLink === "string" ? data.inviteLink.trim() : "";
|
|
31684
|
+
if (inviteLink) {
|
|
31685
|
+
try {
|
|
31686
|
+
await navigator.clipboard.writeText(inviteLink);
|
|
31687
|
+
sonner.toast.success(data.message || "Invite resent. New link copied \u2014 previous invite links no longer work.");
|
|
31688
|
+
} catch {
|
|
31689
|
+
sonner.toast.success(data.message || "Invite resent.");
|
|
31690
|
+
sonner.toast.message("New invite link (previous links are invalid)", {
|
|
31691
|
+
description: inviteLink
|
|
31692
|
+
});
|
|
31693
|
+
}
|
|
31694
|
+
} else {
|
|
31695
|
+
sonner.toast.success(data.message || "Invite resent.");
|
|
31696
|
+
}
|
|
31697
|
+
} catch {
|
|
31698
|
+
setErrors([
|
|
31699
|
+
"Failed to resend invite"
|
|
31700
|
+
]);
|
|
31701
|
+
} finally {
|
|
31702
|
+
setReinviting(false);
|
|
31703
|
+
}
|
|
31704
|
+
}, "handleReinviteOwner");
|
|
31616
31705
|
if (!canOnboardVendors(session?.user)) {
|
|
31617
31706
|
return /* @__PURE__ */ React26__namespace.default.createElement(VendorAccessDenied, {
|
|
31618
31707
|
groupName: sessionUser?.groupName
|
|
31619
31708
|
});
|
|
31620
31709
|
}
|
|
31710
|
+
const copyInviteLink = /* @__PURE__ */ __name(async () => {
|
|
31711
|
+
const inviteLink = inviteDialog?.inviteLink;
|
|
31712
|
+
if (!inviteLink) {
|
|
31713
|
+
sonner.toast.error("Invite link is not available");
|
|
31714
|
+
return;
|
|
31715
|
+
}
|
|
31716
|
+
try {
|
|
31717
|
+
await navigator.clipboard.writeText(inviteLink);
|
|
31718
|
+
setLinkCopied(true);
|
|
31719
|
+
sonner.toast.success("Invite link copied");
|
|
31720
|
+
window.setTimeout(() => setLinkCopied(false), 2e3);
|
|
31721
|
+
} catch {
|
|
31722
|
+
sonner.toast.error("Could not copy invite link");
|
|
31723
|
+
}
|
|
31724
|
+
}, "copyInviteLink");
|
|
31725
|
+
const sendInviteEmail = /* @__PURE__ */ __name(async () => {
|
|
31726
|
+
if (!inviteDialog) return;
|
|
31727
|
+
setSendingInviteEmail(true);
|
|
31728
|
+
try {
|
|
31729
|
+
const res = await fetch(`/api/admin/vendors/${inviteDialog.vendorId}/resend-invite`, {
|
|
31730
|
+
method: "POST",
|
|
31731
|
+
headers: {
|
|
31732
|
+
"Content-Type": "application/json"
|
|
31733
|
+
},
|
|
31734
|
+
body: JSON.stringify({
|
|
31735
|
+
sendEmail: true,
|
|
31736
|
+
rotate: false
|
|
31737
|
+
})
|
|
31738
|
+
});
|
|
31739
|
+
const data = await res.json();
|
|
31740
|
+
if (!res.ok) {
|
|
31741
|
+
sonner.toast.error(data.error || data.message || "Failed to send invite email");
|
|
31742
|
+
return;
|
|
31743
|
+
}
|
|
31744
|
+
const nextLink = typeof data.inviteLink === "string" ? data.inviteLink.trim() : "";
|
|
31745
|
+
if (nextLink) {
|
|
31746
|
+
setInviteDialog((prev) => prev ? {
|
|
31747
|
+
...prev,
|
|
31748
|
+
inviteLink: nextLink
|
|
31749
|
+
} : prev);
|
|
31750
|
+
}
|
|
31751
|
+
sonner.toast.success(data.emailSent ? "Invite email sent" : data.message || "Invite email queued");
|
|
31752
|
+
} catch {
|
|
31753
|
+
sonner.toast.error("Failed to send invite email");
|
|
31754
|
+
} finally {
|
|
31755
|
+
setSendingInviteEmail(false);
|
|
31756
|
+
}
|
|
31757
|
+
}, "sendInviteEmail");
|
|
31758
|
+
const closeInviteDialog = /* @__PURE__ */ __name(() => {
|
|
31759
|
+
setInviteDialog(null);
|
|
31760
|
+
setLinkCopied(false);
|
|
31761
|
+
router.push(listReturnUrl);
|
|
31762
|
+
}, "closeInviteDialog");
|
|
31621
31763
|
const handleCreate = /* @__PURE__ */ __name(async () => {
|
|
31622
31764
|
setSaving(true);
|
|
31623
31765
|
setErrors([]);
|
|
@@ -31643,29 +31785,6 @@ function VendorEditPage({ vendorId }) {
|
|
|
31643
31785
|
setSaving(false);
|
|
31644
31786
|
return;
|
|
31645
31787
|
}
|
|
31646
|
-
if (activationMode === "password") {
|
|
31647
|
-
if (!ownerPassword) {
|
|
31648
|
-
setErrors([
|
|
31649
|
-
"Enter a password for the owner account"
|
|
31650
|
-
]);
|
|
31651
|
-
setSaving(false);
|
|
31652
|
-
return;
|
|
31653
|
-
}
|
|
31654
|
-
if (ownerPassword !== ownerPasswordConfirm) {
|
|
31655
|
-
setErrors([
|
|
31656
|
-
"Passwords do not match"
|
|
31657
|
-
]);
|
|
31658
|
-
setSaving(false);
|
|
31659
|
-
return;
|
|
31660
|
-
}
|
|
31661
|
-
if (ownerPassword.length < 6) {
|
|
31662
|
-
setErrors([
|
|
31663
|
-
"Password must be at least 6 characters"
|
|
31664
|
-
]);
|
|
31665
|
-
setSaving(false);
|
|
31666
|
-
return;
|
|
31667
|
-
}
|
|
31668
|
-
}
|
|
31669
31788
|
try {
|
|
31670
31789
|
const res = await fetch("/api/admin/vendors/onboard", {
|
|
31671
31790
|
method: "POST",
|
|
@@ -31673,18 +31792,15 @@ function VendorEditPage({ vendorId }) {
|
|
|
31673
31792
|
"Content-Type": "application/json"
|
|
31674
31793
|
},
|
|
31675
31794
|
body: JSON.stringify({
|
|
31676
|
-
activation:
|
|
31677
|
-
sendOwnerEmail,
|
|
31795
|
+
activation: "invite",
|
|
31796
|
+
sendOwnerEmail: false,
|
|
31678
31797
|
termsAccepted: true,
|
|
31679
31798
|
vendor: vendorPayload(),
|
|
31680
31799
|
user: {
|
|
31681
31800
|
name: ownerName.trim(),
|
|
31682
31801
|
email: ownerEmail.trim(),
|
|
31683
31802
|
phone: ownerPhone.trim() || void 0,
|
|
31684
|
-
designation: ownerDesignation.trim() || void 0
|
|
31685
|
-
...activationMode === "password" ? {
|
|
31686
|
-
password: ownerPassword
|
|
31687
|
-
} : {}
|
|
31803
|
+
designation: ownerDesignation.trim() || void 0
|
|
31688
31804
|
}
|
|
31689
31805
|
})
|
|
31690
31806
|
});
|
|
@@ -31695,22 +31811,19 @@ function VendorEditPage({ vendorId }) {
|
|
|
31695
31811
|
]);
|
|
31696
31812
|
return;
|
|
31697
31813
|
}
|
|
31698
|
-
const
|
|
31699
|
-
const inviteLink = typeof data.inviteLink === "string" ? data.inviteLink.trim() : "";
|
|
31700
|
-
if (inviteLink) {
|
|
31701
|
-
|
|
31702
|
-
|
|
31703
|
-
|
|
31704
|
-
} catch {
|
|
31705
|
-
sonner.toast.success(message);
|
|
31706
|
-
sonner.toast.message("Invite link", {
|
|
31707
|
-
description: inviteLink
|
|
31708
|
-
});
|
|
31709
|
-
}
|
|
31710
|
-
} else {
|
|
31711
|
-
sonner.toast.success(message);
|
|
31814
|
+
const vendorIdNum = Number(data.vendor?.id);
|
|
31815
|
+
const inviteLink = typeof data.inviteLink === "string" && data.inviteLink.trim() ? data.inviteLink.trim() : "";
|
|
31816
|
+
if (!Number.isFinite(vendorIdNum) || vendorIdNum <= 0 || !inviteLink) {
|
|
31817
|
+
sonner.toast.success(data.message || "Vendor created");
|
|
31818
|
+
router.push(listReturnUrl);
|
|
31819
|
+
return;
|
|
31712
31820
|
}
|
|
31713
|
-
|
|
31821
|
+
sonner.toast.success(data.message || "Vendor created");
|
|
31822
|
+
setLinkCopied(false);
|
|
31823
|
+
setInviteDialog({
|
|
31824
|
+
vendorId: vendorIdNum,
|
|
31825
|
+
inviteLink
|
|
31826
|
+
});
|
|
31714
31827
|
} catch {
|
|
31715
31828
|
setErrors([
|
|
31716
31829
|
"Request failed"
|
|
@@ -31781,7 +31894,6 @@ function VendorEditPage({ vendorId }) {
|
|
|
31781
31894
|
setSaving(false);
|
|
31782
31895
|
}
|
|
31783
31896
|
}, "handleSave");
|
|
31784
|
-
const createSubmitLabel = activationMode === "password" ? sendOwnerEmail ? "Create vendor & send welcome email" : "Create vendor & set password" : sendOwnerEmail ? "Create vendor & send invite" : "Create vendor & copy invite link";
|
|
31785
31897
|
if (loading) {
|
|
31786
31898
|
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
31787
31899
|
className: "flex items-center justify-center py-12"
|
|
@@ -31793,11 +31905,11 @@ function VendorEditPage({ vendorId }) {
|
|
|
31793
31905
|
className: "rounded-lg bg-white shadow-md min-h-[420px]"
|
|
31794
31906
|
}, /* @__PURE__ */ React26__namespace.default.createElement(DetailPageHeader, {
|
|
31795
31907
|
title: create ? "Add vendor" : "Edit vendor",
|
|
31796
|
-
subtitle: create ? "Register a vendor store and create the owner
|
|
31908
|
+
subtitle: create ? "Register a vendor store and create the owner invite" : "Update store and registration details",
|
|
31797
31909
|
closeHref: listReturnUrl,
|
|
31798
31910
|
menuItems: create ? [
|
|
31799
31911
|
{
|
|
31800
|
-
label: saving ? "Creating\u2026" :
|
|
31912
|
+
label: saving ? "Creating\u2026" : "Create vendor",
|
|
31801
31913
|
icon: LucideIcons.Save,
|
|
31802
31914
|
onClick: handleCreate
|
|
31803
31915
|
}
|
|
@@ -32044,7 +32156,20 @@ function VendorEditPage({ vendorId }) {
|
|
|
32044
32156
|
readOnly: true,
|
|
32045
32157
|
value: inviteStatus,
|
|
32046
32158
|
className: `mt-1 ${fieldClass} bg-gray-100`
|
|
32047
|
-
})),
|
|
32159
|
+
})), canReinviteOwner && /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
32160
|
+
className: "pt-1"
|
|
32161
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(Button, {
|
|
32162
|
+
type: "button",
|
|
32163
|
+
variant: "outline",
|
|
32164
|
+
size: "sm",
|
|
32165
|
+
className: "w-full",
|
|
32166
|
+
disabled: reinviting || saving,
|
|
32167
|
+
onClick: /* @__PURE__ */ __name(() => void handleReinviteOwner(), "onClick")
|
|
32168
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(LucideIcons.Mail, {
|
|
32169
|
+
className: "h-4 w-4 mr-2"
|
|
32170
|
+
}), reinviting ? "Sending invite\u2026" : "Re-invite owner"), /* @__PURE__ */ React26__namespace.default.createElement("p", {
|
|
32171
|
+
className: "mt-2 text-xs text-gray-500"
|
|
32172
|
+
}, "Sends a new invite email and invalidates any previous invite link immediately.")), /* @__PURE__ */ React26__namespace.default.createElement("div", null, /* @__PURE__ */ React26__namespace.default.createElement(FieldLabel, null, "Active"), /* @__PURE__ */ React26__namespace.default.createElement(Input, {
|
|
32048
32173
|
readOnly: true,
|
|
32049
32174
|
value: active ? "Yes" : "No",
|
|
32050
32175
|
className: `mt-1 ${fieldClass} bg-gray-100`
|
|
@@ -32052,64 +32177,42 @@ function VendorEditPage({ vendorId }) {
|
|
|
32052
32177
|
className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2"
|
|
32053
32178
|
}, "Owner access"), /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
32054
32179
|
className: sectionCls6
|
|
32055
|
-
}, /* @__PURE__ */ React26__namespace.default.createElement(
|
|
32056
|
-
|
|
32057
|
-
|
|
32058
|
-
className: "gap-3"
|
|
32059
|
-
}, /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
32060
|
-
className: "flex items-start gap-2"
|
|
32061
|
-
}, /* @__PURE__ */ React26__namespace.default.createElement(RadioGroupItem, {
|
|
32062
|
-
value: "invite",
|
|
32063
|
-
id: "activation-invite",
|
|
32064
|
-
className: "mt-0.5"
|
|
32065
|
-
}), /* @__PURE__ */ React26__namespace.default.createElement(Label3, {
|
|
32066
|
-
htmlFor: "activation-invite",
|
|
32067
|
-
className: "font-normal cursor-pointer text-sm"
|
|
32068
|
-
}, "Send invite link")), /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
32069
|
-
className: "flex items-start gap-2"
|
|
32070
|
-
}, /* @__PURE__ */ React26__namespace.default.createElement(RadioGroupItem, {
|
|
32071
|
-
value: "password",
|
|
32072
|
-
id: "activation-password",
|
|
32073
|
-
className: "mt-0.5"
|
|
32074
|
-
}), /* @__PURE__ */ React26__namespace.default.createElement(Label3, {
|
|
32075
|
-
htmlFor: "activation-password",
|
|
32076
|
-
className: "font-normal cursor-pointer text-sm"
|
|
32077
|
-
}, "Set password now"))), /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
32078
|
-
className: "flex items-center gap-2 pt-1"
|
|
32079
|
-
}, /* @__PURE__ */ React26__namespace.default.createElement(Checkbox, {
|
|
32080
|
-
id: "sendOwnerEmail",
|
|
32081
|
-
checked: sendOwnerEmail,
|
|
32082
|
-
onCheckedChange: /* @__PURE__ */ __name((checked) => setSendOwnerEmail(checked === true), "onCheckedChange")
|
|
32083
|
-
}), /* @__PURE__ */ React26__namespace.default.createElement(Label3, {
|
|
32084
|
-
htmlFor: "sendOwnerEmail",
|
|
32085
|
-
className: "font-normal cursor-pointer text-sm"
|
|
32086
|
-
}, activationMode === "invite" ? "Send invite email" : "Send welcome email")), activationMode === "password" && /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
32087
|
-
className: "space-y-3 pt-1"
|
|
32088
|
-
}, /* @__PURE__ */ React26__namespace.default.createElement("div", null, /* @__PURE__ */ React26__namespace.default.createElement(FieldLabel, {
|
|
32089
|
-
htmlFor: "ownerPassword",
|
|
32090
|
-
required: true
|
|
32091
|
-
}, "Password"), /* @__PURE__ */ React26__namespace.default.createElement(Input, {
|
|
32092
|
-
id: "ownerPassword",
|
|
32093
|
-
type: "password",
|
|
32094
|
-
value: ownerPassword,
|
|
32095
|
-
onChange: /* @__PURE__ */ __name((e) => setOwnerPassword(e.target.value), "onChange"),
|
|
32096
|
-
className: `mt-1 ${fieldClass}`
|
|
32097
|
-
})), /* @__PURE__ */ React26__namespace.default.createElement("div", null, /* @__PURE__ */ React26__namespace.default.createElement(FieldLabel, {
|
|
32098
|
-
htmlFor: "ownerPasswordConfirm",
|
|
32099
|
-
required: true
|
|
32100
|
-
}, "Confirm password"), /* @__PURE__ */ React26__namespace.default.createElement(Input, {
|
|
32101
|
-
id: "ownerPasswordConfirm",
|
|
32102
|
-
type: "password",
|
|
32103
|
-
value: ownerPasswordConfirm,
|
|
32104
|
-
onChange: /* @__PURE__ */ __name((e) => setOwnerPasswordConfirm(e.target.value), "onChange"),
|
|
32105
|
-
className: `mt-1 ${fieldClass}`
|
|
32106
|
-
}))), /* @__PURE__ */ React26__namespace.default.createElement(Button, {
|
|
32180
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("p", {
|
|
32181
|
+
className: "text-sm text-gray-600"
|
|
32182
|
+
}, "Creates the vendor and an invite for the owner. After create, you can send the invite email or copy the invite link."), /* @__PURE__ */ React26__namespace.default.createElement(Button, {
|
|
32107
32183
|
type: "button",
|
|
32108
32184
|
disabled: saving,
|
|
32109
32185
|
onClick: handleCreate,
|
|
32110
32186
|
className: "w-full"
|
|
32111
|
-
}, saving ? "Creating\u2026" :
|
|
32112
|
-
})
|
|
32187
|
+
}, saving ? "Creating\u2026" : "Create vendor"))) : void 0)
|
|
32188
|
+
}), /* @__PURE__ */ React26__namespace.default.createElement(Dialog, {
|
|
32189
|
+
open: inviteDialog != null,
|
|
32190
|
+
onOpenChange: /* @__PURE__ */ __name((open) => {
|
|
32191
|
+
if (!open) closeInviteDialog();
|
|
32192
|
+
}, "onOpenChange")
|
|
32193
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(DialogContent, {
|
|
32194
|
+
className: "max-w-md"
|
|
32195
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(DialogHeader, null, /* @__PURE__ */ React26__namespace.default.createElement(DialogTitle, null, "Vendor created"), /* @__PURE__ */ React26__namespace.default.createElement(DialogDescription, null, "Send an invite email to the owner, or copy the invite link to share another way. The link is not shown here.")), /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
32196
|
+
className: "flex flex-col gap-2 py-2"
|
|
32197
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(Button, {
|
|
32198
|
+
type: "button",
|
|
32199
|
+
disabled: sendingInviteEmail,
|
|
32200
|
+
onClick: /* @__PURE__ */ __name(() => void sendInviteEmail(), "onClick")
|
|
32201
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(LucideIcons.Mail, {
|
|
32202
|
+
className: "h-4 w-4 mr-2"
|
|
32203
|
+
}), sendingInviteEmail ? "Sending\u2026" : "Send email"), /* @__PURE__ */ React26__namespace.default.createElement(Button, {
|
|
32204
|
+
type: "button",
|
|
32205
|
+
variant: "outline",
|
|
32206
|
+
onClick: /* @__PURE__ */ __name(() => void copyInviteLink(), "onClick")
|
|
32207
|
+
}, linkCopied ? /* @__PURE__ */ React26__namespace.default.createElement(LucideIcons.Check, {
|
|
32208
|
+
className: "h-4 w-4 mr-2"
|
|
32209
|
+
}) : /* @__PURE__ */ React26__namespace.default.createElement(LucideIcons.Copy, {
|
|
32210
|
+
className: "h-4 w-4 mr-2"
|
|
32211
|
+
}), linkCopied ? "Copied" : "Copy invite link")), /* @__PURE__ */ React26__namespace.default.createElement(DialogFooter, null, /* @__PURE__ */ React26__namespace.default.createElement(Button, {
|
|
32212
|
+
type: "button",
|
|
32213
|
+
variant: "secondary",
|
|
32214
|
+
onClick: closeInviteDialog
|
|
32215
|
+
}, "Done")))));
|
|
32113
32216
|
}
|
|
32114
32217
|
var isCreate6, fieldClass, selectClass, sectionCls6;
|
|
32115
32218
|
var init_VendorEditPage = __esm({
|
|
@@ -32125,7 +32228,7 @@ var init_VendorEditPage = __esm({
|
|
|
32125
32228
|
init_label();
|
|
32126
32229
|
init_textarea();
|
|
32127
32230
|
init_checkbox();
|
|
32128
|
-
|
|
32231
|
+
init_dialog();
|
|
32129
32232
|
init_vendor_profile();
|
|
32130
32233
|
init_vendor_list_config();
|
|
32131
32234
|
init_vendor_access_denied();
|