pxengine 0.1.47 → 0.1.48
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/index.cjs +2190 -426
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -8
- package/dist/index.d.ts +68 -8
- package/dist/index.mjs +2303 -542
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +251 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -33310,6 +33310,7 @@ __export(molecules_exports, {
|
|
|
33310
33310
|
CountrySelectEdit: () => CountrySelectEdit,
|
|
33311
33311
|
CreatorActionHeader: () => CreatorActionHeader,
|
|
33312
33312
|
CreatorCompactView: () => CreatorCompactView,
|
|
33313
|
+
CreatorExpandedPanel: () => CreatorExpandedPanel,
|
|
33313
33314
|
CreatorGridCard: () => CreatorGridCard,
|
|
33314
33315
|
CreatorImageList: () => CreatorImageList,
|
|
33315
33316
|
CreatorProfileSummary: () => CreatorProfileSummary,
|
|
@@ -33345,6 +33346,8 @@ __export(molecules_exports, {
|
|
|
33345
33346
|
TopPostsGrid: () => TopPostsGrid,
|
|
33346
33347
|
UIComponentSelector: () => UIComponentSelector,
|
|
33347
33348
|
WorkflowVisualizer: () => WorkflowVisualizer,
|
|
33349
|
+
defaultFetchSelections: () => defaultFetchSelections,
|
|
33350
|
+
defaultPersistSelection: () => defaultPersistSelection,
|
|
33348
33351
|
useCreatorWidgetPolling: () => useCreatorWidgetPolling
|
|
33349
33352
|
});
|
|
33350
33353
|
|
|
@@ -35417,12 +35420,16 @@ var CampaignSeedCard = React90.memo(
|
|
|
35417
35420
|
fields: providedFields,
|
|
35418
35421
|
data,
|
|
35419
35422
|
onAction,
|
|
35423
|
+
sendMessage,
|
|
35420
35424
|
...formCardProps
|
|
35421
35425
|
}) => {
|
|
35422
35426
|
const fields = useMemo5(() => {
|
|
35423
35427
|
return providedFields || buildCampaignSeedFields(data);
|
|
35424
35428
|
}, [providedFields, data]);
|
|
35425
35429
|
const handleProceed = () => {
|
|
35430
|
+
if (sendMessage) {
|
|
35431
|
+
sendMessage("Continue to concepts");
|
|
35432
|
+
}
|
|
35426
35433
|
onAction?.({
|
|
35427
35434
|
type: "brief_confirmation",
|
|
35428
35435
|
value: "Continue to concepts",
|
|
@@ -35579,6 +35586,7 @@ var SearchSpecCard = React91.memo(
|
|
|
35579
35586
|
data,
|
|
35580
35587
|
specData,
|
|
35581
35588
|
onAction,
|
|
35589
|
+
sendMessage,
|
|
35582
35590
|
...formCardProps
|
|
35583
35591
|
}) => {
|
|
35584
35592
|
const resolvedData = data || specData;
|
|
@@ -35586,6 +35594,9 @@ var SearchSpecCard = React91.memo(
|
|
|
35586
35594
|
return providedFields || buildSearchSpecFields(resolvedData ?? {});
|
|
35587
35595
|
}, [providedFields, resolvedData]);
|
|
35588
35596
|
const handleProceed = () => {
|
|
35597
|
+
if (sendMessage) {
|
|
35598
|
+
sendMessage("Continue with search");
|
|
35599
|
+
}
|
|
35589
35600
|
onAction?.({
|
|
35590
35601
|
type: "search_spec_confirmation",
|
|
35591
35602
|
value: "Continue with search",
|
|
@@ -35616,6 +35627,41 @@ SearchSpecCard.displayName = "SearchSpecCard";
|
|
|
35616
35627
|
|
|
35617
35628
|
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
35618
35629
|
import React92 from "react";
|
|
35630
|
+
|
|
35631
|
+
// src/molecules/creator-discovery/MCQCard/defaultFetchers.ts
|
|
35632
|
+
async function defaultFetchSelections(sessionId) {
|
|
35633
|
+
try {
|
|
35634
|
+
const res = await fetch(
|
|
35635
|
+
`/api/agents-proxy/custom-agents/sessions/${sessionId}/mcq-selections/get`,
|
|
35636
|
+
{
|
|
35637
|
+
method: "POST",
|
|
35638
|
+
headers: { "Content-Type": "application/json" },
|
|
35639
|
+
body: "{}"
|
|
35640
|
+
}
|
|
35641
|
+
);
|
|
35642
|
+
if (!res.ok) return {};
|
|
35643
|
+
const data = await res.json();
|
|
35644
|
+
return data.selections || {};
|
|
35645
|
+
} catch {
|
|
35646
|
+
return {};
|
|
35647
|
+
}
|
|
35648
|
+
}
|
|
35649
|
+
async function defaultPersistSelection(sessionId, questionKey, value) {
|
|
35650
|
+
try {
|
|
35651
|
+
await fetch(
|
|
35652
|
+
`/api/agents-proxy/custom-agents/sessions/${sessionId}/mcq-selections`,
|
|
35653
|
+
{
|
|
35654
|
+
method: "PATCH",
|
|
35655
|
+
headers: { "Content-Type": "application/json" },
|
|
35656
|
+
body: JSON.stringify({ question_key: questionKey, value })
|
|
35657
|
+
}
|
|
35658
|
+
);
|
|
35659
|
+
} catch (err) {
|
|
35660
|
+
console.warn("[MCQ persist failed]", err);
|
|
35661
|
+
}
|
|
35662
|
+
}
|
|
35663
|
+
|
|
35664
|
+
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
35619
35665
|
import { jsx as jsx109, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
35620
35666
|
var MCQCard = React92.memo(
|
|
35621
35667
|
({
|
|
@@ -35628,22 +35674,39 @@ var MCQCard = React92.memo(
|
|
|
35628
35674
|
isLatestMessage = true,
|
|
35629
35675
|
isLoading = false,
|
|
35630
35676
|
className,
|
|
35631
|
-
// selectionStatus,
|
|
35632
35677
|
onAction,
|
|
35633
35678
|
disabled = false,
|
|
35634
|
-
disableContinueInDiscovery
|
|
35635
|
-
//
|
|
35679
|
+
disableContinueInDiscovery,
|
|
35680
|
+
// Self-contained props
|
|
35681
|
+
sessionId,
|
|
35682
|
+
sendMessage,
|
|
35683
|
+
fetchSelections = defaultFetchSelections,
|
|
35684
|
+
persistSelection = defaultPersistSelection
|
|
35636
35685
|
}) => {
|
|
35637
35686
|
const [selectedOption, setSelectedOption] = React92.useState(
|
|
35638
35687
|
propsSelectedOption
|
|
35639
35688
|
);
|
|
35640
35689
|
const [isProceeded, setIsProceeded] = React92.useState(false);
|
|
35690
|
+
const fetchedSessionRef = React92.useRef("");
|
|
35641
35691
|
React92.useEffect(() => {
|
|
35642
35692
|
if (propsSelectedOption) {
|
|
35643
35693
|
setSelectedOption(propsSelectedOption);
|
|
35644
35694
|
setIsProceeded(true);
|
|
35645
35695
|
}
|
|
35646
35696
|
}, [propsSelectedOption]);
|
|
35697
|
+
React92.useEffect(() => {
|
|
35698
|
+
if (!sessionId || fetchedSessionRef.current === sessionId) return;
|
|
35699
|
+
if (propsSelectedOption) return;
|
|
35700
|
+
fetchedSessionRef.current = sessionId;
|
|
35701
|
+
const questionKey = question || "unknown";
|
|
35702
|
+
fetchSelections(sessionId).then((selections) => {
|
|
35703
|
+
const stored = selections[questionKey];
|
|
35704
|
+
if (stored) {
|
|
35705
|
+
setSelectedOption(stored);
|
|
35706
|
+
setIsProceeded(true);
|
|
35707
|
+
}
|
|
35708
|
+
});
|
|
35709
|
+
}, [sessionId, question, propsSelectedOption, fetchSelections]);
|
|
35647
35710
|
const isDiscovery = disableContinueInDiscovery !== void 0 ? disableContinueInDiscovery : typeof window !== "undefined" && window.location.pathname.includes("creator-discovery");
|
|
35648
35711
|
const handleOptionClick = (key, e) => {
|
|
35649
35712
|
e.preventDefault();
|
|
@@ -35658,12 +35721,20 @@ var MCQCard = React92.memo(
|
|
|
35658
35721
|
e.stopPropagation();
|
|
35659
35722
|
if ((selectedOption || recommended) && !disabled && !isProceeded) {
|
|
35660
35723
|
const result = selectedOption || recommended || "";
|
|
35724
|
+
const label = options && options[result] || result;
|
|
35661
35725
|
setIsProceeded(true);
|
|
35726
|
+
if (sessionId) {
|
|
35727
|
+
const questionKey = question || "unknown";
|
|
35728
|
+
persistSelection(sessionId, questionKey, result);
|
|
35729
|
+
}
|
|
35730
|
+
if (sendMessage) {
|
|
35731
|
+
sendMessage(`Selected: ${label}`);
|
|
35732
|
+
}
|
|
35662
35733
|
onProceed?.(result);
|
|
35663
35734
|
onAction?.({
|
|
35664
35735
|
type: "mcq_selection",
|
|
35665
35736
|
value: result,
|
|
35666
|
-
label
|
|
35737
|
+
label
|
|
35667
35738
|
});
|
|
35668
35739
|
}
|
|
35669
35740
|
};
|
|
@@ -36668,7 +36739,7 @@ var CampaignConceptCard = React94.memo(
|
|
|
36668
36739
|
CampaignConceptCard.displayName = "CampaignConceptCard";
|
|
36669
36740
|
|
|
36670
36741
|
// src/molecules/creator-discovery/CreatorWidget/CreatorWidget.tsx
|
|
36671
|
-
import { useCallback as
|
|
36742
|
+
import { useCallback as useCallback7, useState as useState17, memo } from "react";
|
|
36672
36743
|
|
|
36673
36744
|
// src/molecules/creator-discovery/CreatorWidget/CreatorImageList.tsx
|
|
36674
36745
|
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
@@ -36782,152 +36853,1823 @@ function ProgressBar({ overallPercentage }) {
|
|
|
36782
36853
|
children: /* @__PURE__ */ jsx123(AnimatePresence2, { children: showTooltip && /* @__PURE__ */ jsxs82(
|
|
36783
36854
|
motion2.div,
|
|
36784
36855
|
{
|
|
36785
|
-
initial: { opacity: 0, y: 5 },
|
|
36786
|
-
animate: { opacity: 1, y: 0 },
|
|
36787
|
-
exit: { opacity: 0, y: 5 },
|
|
36788
|
-
className: "absolute -top-10 right-[-25px] bg-gray50 text-gray900 text-lg px-1 rounded-[6px] shadow-lg whitespace-nowrap border-2 border-gray300",
|
|
36789
|
-
children: [
|
|
36790
|
-
overallPercentage ? Math.round(overallPercentage) : 0,
|
|
36791
|
-
"%",
|
|
36792
|
-
/* @__PURE__ */ jsxs82("div", { className: "absolute left-1/2 top-full -translate-x-1/2", children: [
|
|
36793
|
-
/* @__PURE__ */ jsx123("div", { className: "w-0 h-0 border-l-[6px] border-r-[6px] border-t-[6px] border-transparent border-t-gray300" }),
|
|
36794
|
-
/* @__PURE__ */ jsx123("div", { className: "absolute left-1/2 top-[-1px] -translate-x-1/2 w-0 h-0 border-l-[5px] border-r-[5px] border-t-[5px] border-transparent border-t-gray50" })
|
|
36795
|
-
] })
|
|
36796
|
-
]
|
|
36856
|
+
initial: { opacity: 0, y: 5 },
|
|
36857
|
+
animate: { opacity: 1, y: 0 },
|
|
36858
|
+
exit: { opacity: 0, y: 5 },
|
|
36859
|
+
className: "absolute -top-10 right-[-25px] bg-gray50 text-gray900 text-lg px-1 rounded-[6px] shadow-lg whitespace-nowrap border-2 border-gray300",
|
|
36860
|
+
children: [
|
|
36861
|
+
overallPercentage ? Math.round(overallPercentage) : 0,
|
|
36862
|
+
"%",
|
|
36863
|
+
/* @__PURE__ */ jsxs82("div", { className: "absolute left-1/2 top-full -translate-x-1/2", children: [
|
|
36864
|
+
/* @__PURE__ */ jsx123("div", { className: "w-0 h-0 border-l-[6px] border-r-[6px] border-t-[6px] border-transparent border-t-gray300" }),
|
|
36865
|
+
/* @__PURE__ */ jsx123("div", { className: "absolute left-1/2 top-[-1px] -translate-x-1/2 w-0 h-0 border-l-[5px] border-r-[5px] border-t-[5px] border-transparent border-t-gray50" })
|
|
36866
|
+
] })
|
|
36867
|
+
]
|
|
36868
|
+
}
|
|
36869
|
+
) })
|
|
36870
|
+
}
|
|
36871
|
+
) }) });
|
|
36872
|
+
}
|
|
36873
|
+
function CreatorProgressBar({
|
|
36874
|
+
statusDetails,
|
|
36875
|
+
timeRemaining: _timeRemaining
|
|
36876
|
+
}) {
|
|
36877
|
+
return /* @__PURE__ */ jsxs82("div", { children: [
|
|
36878
|
+
/* @__PURE__ */ jsx123(ProgressBar, { overallPercentage: statusDetails?.overall_percentage }),
|
|
36879
|
+
/* @__PURE__ */ jsx123("div", { className: "dark:text-gray400 text-gray-500 text-xs mt-2", children: (statusDetails?.overall_percentage ?? 0) < 100 && /* @__PURE__ */ jsx123("span", { children: statusDetails?.thinking_message ? truncateName(statusDetails.thinking_message, 200) : "Processing..." }) })
|
|
36880
|
+
] });
|
|
36881
|
+
}
|
|
36882
|
+
|
|
36883
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorWidgetSkeleton.tsx
|
|
36884
|
+
import { jsx as jsx124, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
36885
|
+
function CreatorWidgetSkeleton() {
|
|
36886
|
+
return /* @__PURE__ */ jsx124("div", { className: "bg-background dark:bg-gray50 rounded-[25px] border border-gray300 overflow-hidden shadow-sm w-full relative", children: /* @__PURE__ */ jsxs83("div", { className: "p-4 md:p-6 space-y-4", children: [
|
|
36887
|
+
/* @__PURE__ */ jsx124("div", { className: "flex flex-col md:flex-row md:items-center md:justify-between gap-4 relative", children: /* @__PURE__ */ jsxs83("div", { className: "flex flex-col gap-2 md:gap-4", children: [
|
|
36888
|
+
/* @__PURE__ */ jsx124("div", { className: "w-40 h-6 bg-purple200 rounded-md animate-pulse" }),
|
|
36889
|
+
/* @__PURE__ */ jsx124("div", { className: "w-64 h-7 bg-gray200 dark:bg-gray300 rounded animate-pulse" })
|
|
36890
|
+
] }) }),
|
|
36891
|
+
/* @__PURE__ */ jsxs83("div", { className: "bg-paperBackground rounded-lg px-3 md:px-4 py-4 md:py-5 flex flex-col md:flex-row md:items-center md:justify-between gap-4 md:gap-0", children: [
|
|
36892
|
+
/* @__PURE__ */ jsxs83("div", { className: "flex flex-col gap-4 md:gap-6 min-w-0", children: [
|
|
36893
|
+
/* @__PURE__ */ jsx124("div", { className: "flex -space-x-2", children: Array.from({ length: 10 }).map((_, idx) => /* @__PURE__ */ jsx124(
|
|
36894
|
+
"div",
|
|
36895
|
+
{
|
|
36896
|
+
className: "w-8 h-8 md:w-10 md:h-10 rounded-full border-2 border-gray300 bg-gray200 animate-pulse"
|
|
36897
|
+
},
|
|
36898
|
+
idx
|
|
36899
|
+
)) }),
|
|
36900
|
+
/* @__PURE__ */ jsx124("div", { className: "space-y-2", children: /* @__PURE__ */ jsx124("div", { className: "w-full max-w-xs bg-gray200 rounded-full h-2 animate-pulse" }) })
|
|
36901
|
+
] }),
|
|
36902
|
+
/* @__PURE__ */ jsx124("div", { className: "px-6 py-2 bg-gray200 rounded-[30px] animate-pulse h-10 w-48" })
|
|
36903
|
+
] })
|
|
36904
|
+
] }) });
|
|
36905
|
+
}
|
|
36906
|
+
|
|
36907
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorCompactView.tsx
|
|
36908
|
+
import { Fragment as Fragment5, jsx as jsx125, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
36909
|
+
function CreatorCompactView({
|
|
36910
|
+
versions,
|
|
36911
|
+
selectedVersion,
|
|
36912
|
+
creatorImages,
|
|
36913
|
+
creatorLength,
|
|
36914
|
+
isAgentOutput,
|
|
36915
|
+
onVersionSelect,
|
|
36916
|
+
onViewCreators,
|
|
36917
|
+
versionStatus,
|
|
36918
|
+
statusDetails,
|
|
36919
|
+
timeDisplay,
|
|
36920
|
+
isLoading
|
|
36921
|
+
}) {
|
|
36922
|
+
const isComplete = versionStatus === "completed" || versionStatus === "complete";
|
|
36923
|
+
const statusTitle = isComplete ? "Creator Search Complete" : versionStatus === "failed" ? "Creator Search Failed" : "Creator Search Processing";
|
|
36924
|
+
if (isLoading) {
|
|
36925
|
+
return /* @__PURE__ */ jsx125(CreatorWidgetSkeleton, {});
|
|
36926
|
+
}
|
|
36927
|
+
return /* @__PURE__ */ jsx125("div", { className: "bg-background dark:bg-gray100 rounded-[25px] border border-gray300 overflow-hidden shadow-sm w-full relative", children: /* @__PURE__ */ jsxs84("div", { className: "p-4 md:p-6 space-y-4", children: [
|
|
36928
|
+
/* @__PURE__ */ jsxs84("div", { className: "flex flex-col md:flex-row md:items-center md:justify-between gap-4 relative", children: [
|
|
36929
|
+
/* @__PURE__ */ jsxs84("div", { className: "flex flex-col gap-2 md:gap-4", children: [
|
|
36930
|
+
/* @__PURE__ */ jsx125("h4", { className: "w-fit rounded-md bg-purple200 px-2 py-[4px] text-xs font-medium text-purpleText", children: "VERIFIED CREATORS LIST" }),
|
|
36931
|
+
/* @__PURE__ */ jsx125("h3", { className: "text-gray900 md:text-lg font-bold", children: statusTitle })
|
|
36932
|
+
] }),
|
|
36933
|
+
versions.length > 1 && /* @__PURE__ */ jsx125("div", { className: "relative md:self-start", children: /* @__PURE__ */ jsxs84(DropdownMenu, { children: [
|
|
36934
|
+
/* @__PURE__ */ jsxs84(
|
|
36935
|
+
DropdownMenuTrigger,
|
|
36936
|
+
{
|
|
36937
|
+
disabled: !isComplete,
|
|
36938
|
+
className: `flex items-center gap-2 border-2 border-gray400 px-3 md:px-4 py-1 rounded-full text-xs md:text-sm outline-none ${!isComplete ? "bg-gray100 text-gray400 cursor-not-allowed opacity-60" : "text-gray600 hover:bg-purple100/20 cursor-pointer"}`,
|
|
36939
|
+
children: [
|
|
36940
|
+
"Version ",
|
|
36941
|
+
selectedVersion ?? "-",
|
|
36942
|
+
/* @__PURE__ */ jsx125(ChevronDown, { className: "w-3 h-3 md:w-4 md:h-4 transition-transform" })
|
|
36943
|
+
]
|
|
36944
|
+
}
|
|
36945
|
+
),
|
|
36946
|
+
/* @__PURE__ */ jsx125(DropdownMenuContent, { className: "bg-gray25 border-2 border-gray400 min-w-[120px] max-h-[150px] overflow-y-auto", children: versions.map((v) => /* @__PURE__ */ jsxs84(
|
|
36947
|
+
DropdownMenuItem,
|
|
36948
|
+
{
|
|
36949
|
+
onClick: () => onVersionSelect(v),
|
|
36950
|
+
className: "cursor-pointer text-sm",
|
|
36951
|
+
children: [
|
|
36952
|
+
"Version ",
|
|
36953
|
+
v
|
|
36954
|
+
]
|
|
36955
|
+
},
|
|
36956
|
+
v
|
|
36957
|
+
)) })
|
|
36958
|
+
] }) })
|
|
36959
|
+
] }),
|
|
36960
|
+
/* @__PURE__ */ jsx125("div", { className: "bg-paperBackground rounded-lg px-3 md:px-4 py-4 md:py-5 flex flex-col md:flex-row md:items-center md:justify-between gap-4 md:gap-0", children: versionStatus === "failed" ? /* @__PURE__ */ jsxs84("div", { className: "flex flex-col items-center justify-center w-full py-6 md:py-8 text-center text-red-500", children: [
|
|
36961
|
+
/* @__PURE__ */ jsx125("p", { className: "text-base md:text-lg font-semibold mb-2", children: "Creator Search Failed" }),
|
|
36962
|
+
/* @__PURE__ */ jsx125("p", { className: "text-xs md:text-sm text-gray600 px-2", children: "Something went wrong while fetching creators. Please try again later or regenerate a new version." })
|
|
36963
|
+
] }) : /* @__PURE__ */ jsxs84(Fragment5, { children: [
|
|
36964
|
+
/* @__PURE__ */ jsxs84("div", { className: "flex flex-col gap-4 md:gap-6 min-w-0", children: [
|
|
36965
|
+
/* @__PURE__ */ jsx125(
|
|
36966
|
+
CreatorImageList,
|
|
36967
|
+
{
|
|
36968
|
+
creatorImages,
|
|
36969
|
+
creatorLength,
|
|
36970
|
+
isAgentOutput,
|
|
36971
|
+
initialCreatorsPercentage: statusDetails?.social_fetch_percentage
|
|
36972
|
+
}
|
|
36973
|
+
),
|
|
36974
|
+
/* @__PURE__ */ jsx125(
|
|
36975
|
+
CreatorProgressBar,
|
|
36976
|
+
{
|
|
36977
|
+
statusDetails,
|
|
36978
|
+
timeRemaining: timeDisplay
|
|
36979
|
+
}
|
|
36980
|
+
)
|
|
36981
|
+
] }),
|
|
36982
|
+
/* @__PURE__ */ jsxs84(
|
|
36983
|
+
"button",
|
|
36984
|
+
{
|
|
36985
|
+
className: `px-4 py-2 text-xs md:text-sm rounded-[30px] shadow flex items-center justify-center gap-2 w-full md:w-auto md:flex-shrink-0 whitespace-nowrap ${!isComplete ? "bg-gray300 text-gray500 border-2 border-gray300 cursor-not-allowed" : "bg-purpleLight dark:bg-purple200 text-purpleText2 dark:text-purpleText border-2 border-purple100 cursor-pointer hover:bg-purpleText1 dark:hover:bg-purple100 dark:hover:text-background"}`,
|
|
36986
|
+
onClick: onViewCreators,
|
|
36987
|
+
disabled: !isComplete,
|
|
36988
|
+
children: [
|
|
36989
|
+
"View ",
|
|
36990
|
+
creatorLength,
|
|
36991
|
+
" Verified Creators",
|
|
36992
|
+
/* @__PURE__ */ jsx125(Triangle, { className: "w-3 h-3 md:w-4 md:h-4 rotate-90 font-bold" })
|
|
36993
|
+
]
|
|
36994
|
+
}
|
|
36995
|
+
)
|
|
36996
|
+
] }) })
|
|
36997
|
+
] }) });
|
|
36998
|
+
}
|
|
36999
|
+
|
|
37000
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorExpandedPanel.tsx
|
|
37001
|
+
import { useState as useState15, useEffect as useEffect10, useCallback as useCallback5 } from "react";
|
|
37002
|
+
import ReactDOM2 from "react-dom";
|
|
37003
|
+
import { AnimatePresence as AnimatePresence4, motion as motion5 } from "framer-motion";
|
|
37004
|
+
|
|
37005
|
+
// src/molecules/creator-discovery/CreatorWidget/defaultFetchers.ts
|
|
37006
|
+
async function defaultFetchVersions(params) {
|
|
37007
|
+
const versionParam = params.version ? `&version=${params.version}` : "";
|
|
37008
|
+
const res = await fetch(
|
|
37009
|
+
`/api/get-creator-versions?sessionId=${params.sessionId}${versionParam}&validated=${params.validated}`
|
|
37010
|
+
);
|
|
37011
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37012
|
+
return res.json();
|
|
37013
|
+
}
|
|
37014
|
+
async function defaultFetchStatus(params) {
|
|
37015
|
+
const res = await fetch(
|
|
37016
|
+
`/api/get-creator-detail-status?session_id=${params.sessionId}&version_no=${params.versionNo}`
|
|
37017
|
+
);
|
|
37018
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37019
|
+
return res.json();
|
|
37020
|
+
}
|
|
37021
|
+
async function defaultFetchCreatorDetails(params) {
|
|
37022
|
+
const res = await fetch("/api/get-creator-details-by-id", {
|
|
37023
|
+
method: "POST",
|
|
37024
|
+
headers: { "Content-Type": "application/json" },
|
|
37025
|
+
body: JSON.stringify({
|
|
37026
|
+
creator_ids: params.creatorIds,
|
|
37027
|
+
session_id: params.sessionId,
|
|
37028
|
+
version_no: params.versionNo
|
|
37029
|
+
})
|
|
37030
|
+
});
|
|
37031
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37032
|
+
return res.json();
|
|
37033
|
+
}
|
|
37034
|
+
|
|
37035
|
+
// src/molecules/creator-discovery/CreatorWidget/countries.ts
|
|
37036
|
+
var countries2 = [
|
|
37037
|
+
{ code: "AF", name: "Afghanistan", flag: "\u{1F1E6}\u{1F1EB}" },
|
|
37038
|
+
{ code: "AL", name: "Albania", flag: "\u{1F1E6}\u{1F1F1}" },
|
|
37039
|
+
{ code: "DZ", name: "Algeria", flag: "\u{1F1E9}\u{1F1FF}" },
|
|
37040
|
+
{ code: "AD", name: "Andorra", flag: "\u{1F1E6}\u{1F1E9}" },
|
|
37041
|
+
{ code: "AO", name: "Angola", flag: "\u{1F1E6}\u{1F1F4}" },
|
|
37042
|
+
{ code: "AG", name: "Antigua and Barbuda", flag: "\u{1F1E6}\u{1F1EC}" },
|
|
37043
|
+
{ code: "AR", name: "Argentina", flag: "\u{1F1E6}\u{1F1F7}" },
|
|
37044
|
+
{ code: "AM", name: "Armenia", flag: "\u{1F1E6}\u{1F1F2}" },
|
|
37045
|
+
{ code: "AU", name: "Australia", flag: "\u{1F1E6}\u{1F1FA}" },
|
|
37046
|
+
{ code: "AT", name: "Austria", flag: "\u{1F1E6}\u{1F1F9}" },
|
|
37047
|
+
{ code: "AZ", name: "Azerbaijan", flag: "\u{1F1E6}\u{1F1FF}" },
|
|
37048
|
+
{ code: "BS", name: "Bahamas", flag: "\u{1F1E7}\u{1F1F8}" },
|
|
37049
|
+
{ code: "BH", name: "Bahrain", flag: "\u{1F1E7}\u{1F1ED}" },
|
|
37050
|
+
{ code: "BD", name: "Bangladesh", flag: "\u{1F1E7}\u{1F1E9}" },
|
|
37051
|
+
{ code: "BB", name: "Barbados", flag: "\u{1F1E7}\u{1F1E7}" },
|
|
37052
|
+
{ code: "BY", name: "Belarus", flag: "\u{1F1E7}\u{1F1FE}" },
|
|
37053
|
+
{ code: "BE", name: "Belgium", flag: "\u{1F1E7}\u{1F1EA}" },
|
|
37054
|
+
{ code: "BZ", name: "Belize", flag: "\u{1F1E7}\u{1F1FF}" },
|
|
37055
|
+
{ code: "BJ", name: "Benin", flag: "\u{1F1E7}\u{1F1EF}" },
|
|
37056
|
+
{ code: "BT", name: "Bhutan", flag: "\u{1F1E7}\u{1F1F9}" },
|
|
37057
|
+
{ code: "BO", name: "Bolivia", flag: "\u{1F1E7}\u{1F1F4}" },
|
|
37058
|
+
{ code: "BA", name: "Bosnia and Herzegovina", flag: "\u{1F1E7}\u{1F1E6}" },
|
|
37059
|
+
{ code: "BW", name: "Botswana", flag: "\u{1F1E7}\u{1F1FC}" },
|
|
37060
|
+
{ code: "BR", name: "Brazil", flag: "\u{1F1E7}\u{1F1F7}" },
|
|
37061
|
+
{ code: "BN", name: "Brunei", flag: "\u{1F1E7}\u{1F1F3}" },
|
|
37062
|
+
{ code: "BG", name: "Bulgaria", flag: "\u{1F1E7}\u{1F1EC}" },
|
|
37063
|
+
{ code: "BF", name: "Burkina Faso", flag: "\u{1F1E7}\u{1F1EB}" },
|
|
37064
|
+
{ code: "BI", name: "Burundi", flag: "\u{1F1E7}\u{1F1EE}" },
|
|
37065
|
+
{ code: "CV", name: "Cabo Verde", flag: "\u{1F1E8}\u{1F1FB}" },
|
|
37066
|
+
{ code: "KH", name: "Cambodia", flag: "\u{1F1F0}\u{1F1ED}" },
|
|
37067
|
+
{ code: "CM", name: "Cameroon", flag: "\u{1F1E8}\u{1F1F2}" },
|
|
37068
|
+
{ code: "CA", name: "Canada", flag: "\u{1F1E8}\u{1F1E6}" },
|
|
37069
|
+
{ code: "CF", name: "Central African Republic", flag: "\u{1F1E8}\u{1F1EB}" },
|
|
37070
|
+
{ code: "TD", name: "Chad", flag: "\u{1F1F9}\u{1F1E9}" },
|
|
37071
|
+
{ code: "CL", name: "Chile", flag: "\u{1F1E8}\u{1F1F1}" },
|
|
37072
|
+
{ code: "CN", name: "China", flag: "\u{1F1E8}\u{1F1F3}" },
|
|
37073
|
+
{ code: "CO", name: "Colombia", flag: "\u{1F1E8}\u{1F1F4}" },
|
|
37074
|
+
{ code: "KM", name: "Comoros", flag: "\u{1F1F0}\u{1F1F2}" },
|
|
37075
|
+
{ code: "CG", name: "Congo", flag: "\u{1F1E8}\u{1F1EC}" },
|
|
37076
|
+
{ code: "CD", name: "Democratic Republic of the Congo", flag: "\u{1F1E8}\u{1F1E9}" },
|
|
37077
|
+
{ code: "CR", name: "Costa Rica", flag: "\u{1F1E8}\u{1F1F7}" },
|
|
37078
|
+
{ code: "HR", name: "Croatia", flag: "\u{1F1ED}\u{1F1F7}" },
|
|
37079
|
+
{ code: "CU", name: "Cuba", flag: "\u{1F1E8}\u{1F1FA}" },
|
|
37080
|
+
{ code: "CY", name: "Cyprus", flag: "\u{1F1E8}\u{1F1FE}" },
|
|
37081
|
+
{ code: "CZ", name: "Czech Republic", flag: "\u{1F1E8}\u{1F1FF}" },
|
|
37082
|
+
{ code: "CI", name: "Ivory Coast", flag: "\u{1F1E8}\u{1F1EE}" },
|
|
37083
|
+
{ code: "DK", name: "Denmark", flag: "\u{1F1E9}\u{1F1F0}" },
|
|
37084
|
+
{ code: "DJ", name: "Djibouti", flag: "\u{1F1E9}\u{1F1EF}" },
|
|
37085
|
+
{ code: "DM", name: "Dominica", flag: "\u{1F1E9}\u{1F1F2}" },
|
|
37086
|
+
{ code: "DO", name: "Dominican Republic", flag: "\u{1F1E9}\u{1F1F4}" },
|
|
37087
|
+
{ code: "EC", name: "Ecuador", flag: "\u{1F1EA}\u{1F1E8}" },
|
|
37088
|
+
{ code: "EG", name: "Egypt", flag: "\u{1F1EA}\u{1F1EC}" },
|
|
37089
|
+
{ code: "SV", name: "El Salvador", flag: "\u{1F1F8}\u{1F1FB}" },
|
|
37090
|
+
{ code: "GQ", name: "Equatorial Guinea", flag: "\u{1F1EC}\u{1F1F6}" },
|
|
37091
|
+
{ code: "ER", name: "Eritrea", flag: "\u{1F1EA}\u{1F1F7}" },
|
|
37092
|
+
{ code: "EE", name: "Estonia", flag: "\u{1F1EA}\u{1F1EA}" },
|
|
37093
|
+
{ code: "SZ", name: "Eswatini", flag: "\u{1F1F8}\u{1F1FF}" },
|
|
37094
|
+
{ code: "ET", name: "Ethiopia", flag: "\u{1F1EA}\u{1F1F9}" },
|
|
37095
|
+
{ code: "FJ", name: "Fiji", flag: "\u{1F1EB}\u{1F1EF}" },
|
|
37096
|
+
{ code: "FI", name: "Finland", flag: "\u{1F1EB}\u{1F1EE}" },
|
|
37097
|
+
{ code: "FR", name: "France", flag: "\u{1F1EB}\u{1F1F7}" },
|
|
37098
|
+
{ code: "GA", name: "Gabon", flag: "\u{1F1EC}\u{1F1E6}" },
|
|
37099
|
+
{ code: "GM", name: "Gambia", flag: "\u{1F1EC}\u{1F1F2}" },
|
|
37100
|
+
{ code: "GE", name: "Georgia", flag: "\u{1F1EC}\u{1F1EA}" },
|
|
37101
|
+
{ code: "DE", name: "Germany", flag: "\u{1F1E9}\u{1F1EA}" },
|
|
37102
|
+
{ code: "GH", name: "Ghana", flag: "\u{1F1EC}\u{1F1ED}" },
|
|
37103
|
+
{ code: "GR", name: "Greece", flag: "\u{1F1EC}\u{1F1F7}" },
|
|
37104
|
+
{ code: "GD", name: "Grenada", flag: "\u{1F1EC}\u{1F1E9}" },
|
|
37105
|
+
{ code: "GT", name: "Guatemala", flag: "\u{1F1EC}\u{1F1F9}" },
|
|
37106
|
+
{ code: "GN", name: "Guinea", flag: "\u{1F1EC}\u{1F1F3}" },
|
|
37107
|
+
{ code: "GW", name: "Guinea-Bissau", flag: "\u{1F1EC}\u{1F1FC}" },
|
|
37108
|
+
{ code: "GY", name: "Guyana", flag: "\u{1F1EC}\u{1F1FE}" },
|
|
37109
|
+
{ code: "HT", name: "Haiti", flag: "\u{1F1ED}\u{1F1F9}" },
|
|
37110
|
+
{ code: "HN", name: "Honduras", flag: "\u{1F1ED}\u{1F1F3}" },
|
|
37111
|
+
{ code: "HU", name: "Hungary", flag: "\u{1F1ED}\u{1F1FA}" },
|
|
37112
|
+
{ code: "HK", name: "Hong Kong", flag: "\u{1F1ED}\u{1F1F0}" },
|
|
37113
|
+
{ code: "IS", name: "Iceland", flag: "\u{1F1EE}\u{1F1F8}" },
|
|
37114
|
+
{ code: "IN", name: "India", flag: "\u{1F1EE}\u{1F1F3}" },
|
|
37115
|
+
{ code: "ID", name: "Indonesia", flag: "\u{1F1EE}\u{1F1E9}" },
|
|
37116
|
+
{ code: "IR", name: "Iran", flag: "\u{1F1EE}\u{1F1F7}" },
|
|
37117
|
+
{ code: "IQ", name: "Iraq", flag: "\u{1F1EE}\u{1F1F6}" },
|
|
37118
|
+
{ code: "IE", name: "Ireland", flag: "\u{1F1EE}\u{1F1EA}" },
|
|
37119
|
+
{ code: "IL", name: "Israel", flag: "\u{1F1EE}\u{1F1F1}" },
|
|
37120
|
+
{ code: "IT", name: "Italy", flag: "\u{1F1EE}\u{1F1F9}" },
|
|
37121
|
+
{ code: "JM", name: "Jamaica", flag: "\u{1F1EF}\u{1F1F2}" },
|
|
37122
|
+
{ code: "JP", name: "Japan", flag: "\u{1F1EF}\u{1F1F5}" },
|
|
37123
|
+
{ code: "JO", name: "Jordan", flag: "\u{1F1EF}\u{1F1F4}" },
|
|
37124
|
+
{ code: "KZ", name: "Kazakhstan", flag: "\u{1F1F0}\u{1F1FF}" },
|
|
37125
|
+
{ code: "KE", name: "Kenya", flag: "\u{1F1F0}\u{1F1EA}" },
|
|
37126
|
+
{ code: "KI", name: "Kiribati", flag: "\u{1F1F0}\u{1F1EE}" },
|
|
37127
|
+
{ code: "KP", name: "North Korea", flag: "\u{1F1F0}\u{1F1F5}" },
|
|
37128
|
+
{ code: "KR", name: "South Korea", flag: "\u{1F1F0}\u{1F1F7}" },
|
|
37129
|
+
{ code: "KW", name: "Kuwait", flag: "\u{1F1F0}\u{1F1FC}" },
|
|
37130
|
+
{ code: "KG", name: "Kyrgyzstan", flag: "\u{1F1F0}\u{1F1EC}" },
|
|
37131
|
+
{ code: "LA", name: "Laos", flag: "\u{1F1F1}\u{1F1E6}" },
|
|
37132
|
+
{ code: "LV", name: "Latvia", flag: "\u{1F1F1}\u{1F1FB}" },
|
|
37133
|
+
{ code: "LB", name: "Lebanon", flag: "\u{1F1F1}\u{1F1E7}" },
|
|
37134
|
+
{ code: "LS", name: "Lesotho", flag: "\u{1F1F1}\u{1F1F8}" },
|
|
37135
|
+
{ code: "LR", name: "Liberia", flag: "\u{1F1F1}\u{1F1F7}" },
|
|
37136
|
+
{ code: "LY", name: "Libya", flag: "\u{1F1F1}\u{1F1FE}" },
|
|
37137
|
+
{ code: "LI", name: "Liechtenstein", flag: "\u{1F1F1}\u{1F1EE}" },
|
|
37138
|
+
{ code: "LT", name: "Lithuania", flag: "\u{1F1F1}\u{1F1F9}" },
|
|
37139
|
+
{ code: "LU", name: "Luxembourg", flag: "\u{1F1F1}\u{1F1FA}" },
|
|
37140
|
+
{ code: "MG", name: "Madagascar", flag: "\u{1F1F2}\u{1F1EC}" },
|
|
37141
|
+
{ code: "MW", name: "Malawi", flag: "\u{1F1F2}\u{1F1FC}" },
|
|
37142
|
+
{ code: "MY", name: "Malaysia", flag: "\u{1F1F2}\u{1F1FE}" },
|
|
37143
|
+
{ code: "MV", name: "Maldives", flag: "\u{1F1F2}\u{1F1FB}" },
|
|
37144
|
+
{ code: "ML", name: "Mali", flag: "\u{1F1F2}\u{1F1F1}" },
|
|
37145
|
+
{ code: "MT", name: "Malta", flag: "\u{1F1F2}\u{1F1F9}" },
|
|
37146
|
+
{ code: "MH", name: "Marshall Islands", flag: "\u{1F1F2}\u{1F1ED}" },
|
|
37147
|
+
{ code: "MR", name: "Mauritania", flag: "\u{1F1F2}\u{1F1F7}" },
|
|
37148
|
+
{ code: "MU", name: "Mauritius", flag: "\u{1F1F2}\u{1F1FA}" },
|
|
37149
|
+
{ code: "MX", name: "Mexico", flag: "\u{1F1F2}\u{1F1FD}" },
|
|
37150
|
+
{ code: "FM", name: "Micronesia", flag: "\u{1F1EB}\u{1F1F2}" },
|
|
37151
|
+
{ code: "MD", name: "Moldova", flag: "\u{1F1F2}\u{1F1E9}" },
|
|
37152
|
+
{ code: "MC", name: "Monaco", flag: "\u{1F1F2}\u{1F1E8}" },
|
|
37153
|
+
{ code: "MN", name: "Mongolia", flag: "\u{1F1F2}\u{1F1F3}" },
|
|
37154
|
+
{ code: "ME", name: "Montenegro", flag: "\u{1F1F2}\u{1F1EA}" },
|
|
37155
|
+
{ code: "MA", name: "Morocco", flag: "\u{1F1F2}\u{1F1E6}" },
|
|
37156
|
+
{ code: "MZ", name: "Mozambique", flag: "\u{1F1F2}\u{1F1FF}" },
|
|
37157
|
+
{ code: "MM", name: "Myanmar", flag: "\u{1F1F2}\u{1F1F2}" },
|
|
37158
|
+
{ code: "NA", name: "Namibia", flag: "\u{1F1F3}\u{1F1E6}" },
|
|
37159
|
+
{ code: "NR", name: "Nauru", flag: "\u{1F1F3}\u{1F1F7}" },
|
|
37160
|
+
{ code: "NP", name: "Nepal", flag: "\u{1F1F3}\u{1F1F5}" },
|
|
37161
|
+
{ code: "NL", name: "Netherlands", flag: "\u{1F1F3}\u{1F1F1}" },
|
|
37162
|
+
{ code: "NZ", name: "New Zealand", flag: "\u{1F1F3}\u{1F1FF}" },
|
|
37163
|
+
{ code: "NI", name: "Nicaragua", flag: "\u{1F1F3}\u{1F1EE}" },
|
|
37164
|
+
{ code: "NE", name: "Niger", flag: "\u{1F1F3}\u{1F1EA}" },
|
|
37165
|
+
{ code: "NG", name: "Nigeria", flag: "\u{1F1F3}\u{1F1EC}" },
|
|
37166
|
+
{ code: "MK", name: "North Macedonia", flag: "\u{1F1F2}\u{1F1F0}" },
|
|
37167
|
+
{ code: "NO", name: "Norway", flag: "\u{1F1F3}\u{1F1F4}" },
|
|
37168
|
+
{ code: "OM", name: "Oman", flag: "\u{1F1F4}\u{1F1F2}" },
|
|
37169
|
+
{ code: "PK", name: "Pakistan", flag: "\u{1F1F5}\u{1F1F0}" },
|
|
37170
|
+
{ code: "PW", name: "Palau", flag: "\u{1F1F5}\u{1F1FC}" },
|
|
37171
|
+
{ code: "PS", name: "Palestine", flag: "\u{1F1F5}\u{1F1F8}" },
|
|
37172
|
+
{ code: "PA", name: "Panama", flag: "\u{1F1F5}\u{1F1E6}" },
|
|
37173
|
+
{ code: "PG", name: "Papua New Guinea", flag: "\u{1F1F5}\u{1F1EC}" },
|
|
37174
|
+
{ code: "PY", name: "Paraguay", flag: "\u{1F1F5}\u{1F1FE}" },
|
|
37175
|
+
{ code: "PE", name: "Peru", flag: "\u{1F1F5}\u{1F1EA}" },
|
|
37176
|
+
{ code: "PH", name: "Philippines", flag: "\u{1F1F5}\u{1F1ED}" },
|
|
37177
|
+
{ code: "PL", name: "Poland", flag: "\u{1F1F5}\u{1F1F1}" },
|
|
37178
|
+
{ code: "PT", name: "Portugal", flag: "\u{1F1F5}\u{1F1F9}" },
|
|
37179
|
+
{ code: "QA", name: "Qatar", flag: "\u{1F1F6}\u{1F1E6}" },
|
|
37180
|
+
{ code: "RO", name: "Romania", flag: "\u{1F1F7}\u{1F1F4}" },
|
|
37181
|
+
{ code: "RU", name: "Russia", flag: "\u{1F1F7}\u{1F1FA}" },
|
|
37182
|
+
{ code: "RW", name: "Rwanda", flag: "\u{1F1F7}\u{1F1FC}" },
|
|
37183
|
+
{ code: "KN", name: "Saint Kitts and Nevis", flag: "\u{1F1F0}\u{1F1F3}" },
|
|
37184
|
+
{ code: "LC", name: "Saint Lucia", flag: "\u{1F1F1}\u{1F1E8}" },
|
|
37185
|
+
{ code: "VC", name: "Saint Vincent and the Grenadines", flag: "\u{1F1FB}\u{1F1E8}" },
|
|
37186
|
+
{ code: "WS", name: "Samoa", flag: "\u{1F1FC}\u{1F1F8}" },
|
|
37187
|
+
{ code: "SM", name: "San Marino", flag: "\u{1F1F8}\u{1F1F2}" },
|
|
37188
|
+
{ code: "ST", name: "Sao Tome and Principe", flag: "\u{1F1F8}\u{1F1F9}" },
|
|
37189
|
+
{ code: "SA", name: "Saudi Arabia", flag: "\u{1F1F8}\u{1F1E6}" },
|
|
37190
|
+
{ code: "SN", name: "Senegal", flag: "\u{1F1F8}\u{1F1F3}" },
|
|
37191
|
+
{ code: "RS", name: "Serbia", flag: "\u{1F1F7}\u{1F1F8}" },
|
|
37192
|
+
{ code: "SC", name: "Seychelles", flag: "\u{1F1F8}\u{1F1E8}" },
|
|
37193
|
+
{ code: "SL", name: "Sierra Leone", flag: "\u{1F1F8}\u{1F1F1}" },
|
|
37194
|
+
{ code: "SG", name: "Singapore", flag: "\u{1F1F8}\u{1F1EC}" },
|
|
37195
|
+
{ code: "SK", name: "Slovakia", flag: "\u{1F1F8}\u{1F1F0}" },
|
|
37196
|
+
{ code: "SI", name: "Slovenia", flag: "\u{1F1F8}\u{1F1EE}" },
|
|
37197
|
+
{ code: "SB", name: "Solomon Islands", flag: "\u{1F1F8}\u{1F1E7}" },
|
|
37198
|
+
{ code: "SO", name: "Somalia", flag: "\u{1F1F8}\u{1F1F4}" },
|
|
37199
|
+
{ code: "ZA", name: "South Africa", flag: "\u{1F1FF}\u{1F1E6}" },
|
|
37200
|
+
{ code: "SS", name: "South Sudan", flag: "\u{1F1F8}\u{1F1F8}" },
|
|
37201
|
+
{ code: "ES", name: "Spain", flag: "\u{1F1EA}\u{1F1F8}" },
|
|
37202
|
+
{ code: "LK", name: "Sri Lanka", flag: "\u{1F1F1}\u{1F1F0}" },
|
|
37203
|
+
{ code: "SD", name: "Sudan", flag: "\u{1F1F8}\u{1F1E9}" },
|
|
37204
|
+
{ code: "SR", name: "Suriname", flag: "\u{1F1F8}\u{1F1F7}" },
|
|
37205
|
+
{ code: "SE", name: "Sweden", flag: "\u{1F1F8}\u{1F1EA}" },
|
|
37206
|
+
{ code: "CH", name: "Switzerland", flag: "\u{1F1E8}\u{1F1ED}" },
|
|
37207
|
+
{ code: "SY", name: "Syria", flag: "\u{1F1F8}\u{1F1FE}" },
|
|
37208
|
+
{ code: "TW", name: "Taiwan", flag: "\u{1F1F9}\u{1F1FC}" },
|
|
37209
|
+
{ code: "TJ", name: "Tajikistan", flag: "\u{1F1F9}\u{1F1EF}" },
|
|
37210
|
+
{ code: "TZ", name: "Tanzania", flag: "\u{1F1F9}\u{1F1FF}" },
|
|
37211
|
+
{ code: "TH", name: "Thailand", flag: "\u{1F1F9}\u{1F1ED}" },
|
|
37212
|
+
{ code: "TL", name: "Timor-Leste", flag: "\u{1F1F9}\u{1F1F1}" },
|
|
37213
|
+
{ code: "TG", name: "Togo", flag: "\u{1F1F9}\u{1F1EC}" },
|
|
37214
|
+
{ code: "TO", name: "Tonga", flag: "\u{1F1F9}\u{1F1F4}" },
|
|
37215
|
+
{ code: "TT", name: "Trinidad and Tobago", flag: "\u{1F1F9}\u{1F1F9}" },
|
|
37216
|
+
{ code: "TN", name: "Tunisia", flag: "\u{1F1F9}\u{1F1F3}" },
|
|
37217
|
+
{ code: "TR", name: "Turkey", flag: "\u{1F1F9}\u{1F1F7}" },
|
|
37218
|
+
{ code: "TM", name: "Turkmenistan", flag: "\u{1F1F9}\u{1F1F2}" },
|
|
37219
|
+
{ code: "TV", name: "Tuvalu", flag: "\u{1F1F9}\u{1F1FB}" },
|
|
37220
|
+
{ code: "UG", name: "Uganda", flag: "\u{1F1FA}\u{1F1EC}" },
|
|
37221
|
+
{ code: "UA", name: "Ukraine", flag: "\u{1F1FA}\u{1F1E6}" },
|
|
37222
|
+
{ code: "AE", name: "United Arab Emirates", flag: "\u{1F1E6}\u{1F1EA}" },
|
|
37223
|
+
{ code: "GB", name: "United Kingdom", flag: "\u{1F1EC}\u{1F1E7}" },
|
|
37224
|
+
{ code: "US", name: "United States", flag: "\u{1F1FA}\u{1F1F8}" },
|
|
37225
|
+
{ code: "UY", name: "Uruguay", flag: "\u{1F1FA}\u{1F1FE}" },
|
|
37226
|
+
{ code: "UZ", name: "Uzbekistan", flag: "\u{1F1FA}\u{1F1FF}" },
|
|
37227
|
+
{ code: "VU", name: "Vanuatu", flag: "\u{1F1FB}\u{1F1FA}" },
|
|
37228
|
+
{ code: "VA", name: "Vatican City", flag: "\u{1F1FB}\u{1F1E6}" },
|
|
37229
|
+
{ code: "VE", name: "Venezuela", flag: "\u{1F1FB}\u{1F1EA}" },
|
|
37230
|
+
{ code: "VN", name: "Vietnam", flag: "\u{1F1FB}\u{1F1F3}" },
|
|
37231
|
+
{ code: "YE", name: "Yemen", flag: "\u{1F1FE}\u{1F1EA}" },
|
|
37232
|
+
{ code: "ZM", name: "Zambia", flag: "\u{1F1FF}\u{1F1F2}" },
|
|
37233
|
+
{ code: "ZW", name: "Zimbabwe", flag: "\u{1F1FF}\u{1F1FC}" }
|
|
37234
|
+
];
|
|
37235
|
+
var codeToMeta = Object.fromEntries(countries2.map((c) => [c.code, { name: c.name, flag: c.flag }]));
|
|
37236
|
+
var nameToCode = Object.fromEntries(countries2.map((c) => [c.name, c.code]));
|
|
37237
|
+
var normalizeToIso2 = (input) => {
|
|
37238
|
+
if (!input) return "US";
|
|
37239
|
+
const trimmed = String(input).trim();
|
|
37240
|
+
const upper = trimmed.toUpperCase();
|
|
37241
|
+
if (upper.length === 2 && codeToMeta[upper]) return upper;
|
|
37242
|
+
const fromName = nameToCode[trimmed];
|
|
37243
|
+
if (fromName) return fromName;
|
|
37244
|
+
return "US";
|
|
37245
|
+
};
|
|
37246
|
+
|
|
37247
|
+
// src/molecules/creator-discovery/CreatorWidget/EngagedAudienceDemographics.tsx
|
|
37248
|
+
import { jsx as jsx126, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
37249
|
+
function EngagedAudienceDemographics({
|
|
37250
|
+
audienceDemographics
|
|
37251
|
+
}) {
|
|
37252
|
+
if (!audienceDemographics) return null;
|
|
37253
|
+
const hasCities = audienceDemographics?.cities && Object.keys(audienceDemographics.cities).length > 0;
|
|
37254
|
+
const hasCountries = audienceDemographics?.countries && Object.keys(audienceDemographics.countries).length > 0;
|
|
37255
|
+
const hasAges = audienceDemographics?.ages && Object.keys(audienceDemographics.ages).length > 0;
|
|
37256
|
+
const hasGenders = audienceDemographics?.genders && Object.keys(audienceDemographics.genders).length > 0;
|
|
37257
|
+
if (!hasCities && !hasCountries && !hasAges && !hasGenders) {
|
|
37258
|
+
return null;
|
|
37259
|
+
}
|
|
37260
|
+
const columns = [];
|
|
37261
|
+
if (hasCities) columns.push("1fr");
|
|
37262
|
+
if (hasCountries) columns.push("1fr");
|
|
37263
|
+
if (hasAges) columns.push("1fr");
|
|
37264
|
+
if (hasGenders) columns.push("0.4fr");
|
|
37265
|
+
const gridTemplate = columns.join(" ");
|
|
37266
|
+
return /* @__PURE__ */ jsxs85("div", { className: "flex flex-col gap-4", children: [
|
|
37267
|
+
/* @__PURE__ */ jsx126("div", { className: "text-purpleText text-xs", children: /* @__PURE__ */ jsx126("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "ENGAGED AUDIENCE" }) }),
|
|
37268
|
+
/* @__PURE__ */ jsxs85(
|
|
37269
|
+
"div",
|
|
37270
|
+
{
|
|
37271
|
+
className: "flex flex-col sm:col-span-3 sm:grid gap-6",
|
|
37272
|
+
style: { gridTemplateColumns: gridTemplate },
|
|
37273
|
+
children: [
|
|
37274
|
+
hasCities && /* @__PURE__ */ jsxs85("div", { children: [
|
|
37275
|
+
/* @__PURE__ */ jsx126("h4", { className: "text-xs text-gray700 mb-3", children: "Cities" }),
|
|
37276
|
+
/* @__PURE__ */ jsx126("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.cities || {}).map(
|
|
37277
|
+
([code, value]) => /* @__PURE__ */ jsxs85(
|
|
37278
|
+
"div",
|
|
37279
|
+
{
|
|
37280
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37281
|
+
children: [
|
|
37282
|
+
/* @__PURE__ */ jsx126("span", { className: "w-[90px]", children: /* @__PURE__ */ jsx126("div", { className: "flex gap-1 items-center", children: /* @__PURE__ */ jsx126("span", { children: code.split(",")[0] }) }) }),
|
|
37283
|
+
/* @__PURE__ */ jsx126("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ jsx126(
|
|
37284
|
+
"div",
|
|
37285
|
+
{
|
|
37286
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37287
|
+
style: { width: `${value}%` }
|
|
37288
|
+
}
|
|
37289
|
+
) }),
|
|
37290
|
+
/* @__PURE__ */ jsxs85("span", { className: "w-10 text-right font-medium", children: [
|
|
37291
|
+
value,
|
|
37292
|
+
"%"
|
|
37293
|
+
] })
|
|
37294
|
+
]
|
|
37295
|
+
},
|
|
37296
|
+
code
|
|
37297
|
+
)
|
|
37298
|
+
) })
|
|
37299
|
+
] }),
|
|
37300
|
+
hasCountries && /* @__PURE__ */ jsxs85("div", { children: [
|
|
37301
|
+
/* @__PURE__ */ jsx126("h4", { className: "text-xs text-gray700 mb-3", children: "Countries" }),
|
|
37302
|
+
/* @__PURE__ */ jsx126("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.countries || {}).map(
|
|
37303
|
+
([code, value]) => {
|
|
37304
|
+
const iso2 = normalizeToIso2(code);
|
|
37305
|
+
const meta = codeToMeta[iso2];
|
|
37306
|
+
return /* @__PURE__ */ jsxs85(
|
|
37307
|
+
"div",
|
|
37308
|
+
{
|
|
37309
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37310
|
+
children: [
|
|
37311
|
+
/* @__PURE__ */ jsx126("span", { className: "w-10", children: /* @__PURE__ */ jsxs85("div", { className: "flex gap-1 items-center", children: [
|
|
37312
|
+
/* @__PURE__ */ jsx126("span", { className: "text-base", children: meta?.flag }),
|
|
37313
|
+
/* @__PURE__ */ jsx126("span", { children: code })
|
|
37314
|
+
] }) }),
|
|
37315
|
+
/* @__PURE__ */ jsx126("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ jsx126(
|
|
37316
|
+
"div",
|
|
37317
|
+
{
|
|
37318
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37319
|
+
style: { width: `${value}%` }
|
|
37320
|
+
}
|
|
37321
|
+
) }),
|
|
37322
|
+
/* @__PURE__ */ jsxs85("span", { className: "w-10 text-right font-medium", children: [
|
|
37323
|
+
value,
|
|
37324
|
+
"%"
|
|
37325
|
+
] })
|
|
37326
|
+
]
|
|
37327
|
+
},
|
|
37328
|
+
code
|
|
37329
|
+
);
|
|
37330
|
+
}
|
|
37331
|
+
) })
|
|
37332
|
+
] }),
|
|
37333
|
+
hasAges && /* @__PURE__ */ jsxs85("div", { children: [
|
|
37334
|
+
/* @__PURE__ */ jsx126("h4", { className: "text-xs text-gray700 mb-3", children: "Ages" }),
|
|
37335
|
+
/* @__PURE__ */ jsx126("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.ages || {}).map(
|
|
37336
|
+
([ageRange, value]) => /* @__PURE__ */ jsxs85(
|
|
37337
|
+
"div",
|
|
37338
|
+
{
|
|
37339
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37340
|
+
children: [
|
|
37341
|
+
/* @__PURE__ */ jsx126("span", { className: "w-12", children: ageRange }),
|
|
37342
|
+
/* @__PURE__ */ jsx126("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ jsx126(
|
|
37343
|
+
"div",
|
|
37344
|
+
{
|
|
37345
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37346
|
+
style: { width: `${value}%` }
|
|
37347
|
+
}
|
|
37348
|
+
) }),
|
|
37349
|
+
/* @__PURE__ */ jsxs85("span", { className: "w-10 text-right font-medium", children: [
|
|
37350
|
+
value,
|
|
37351
|
+
"%"
|
|
37352
|
+
] })
|
|
37353
|
+
]
|
|
37354
|
+
},
|
|
37355
|
+
ageRange
|
|
37356
|
+
)
|
|
37357
|
+
) })
|
|
37358
|
+
] }),
|
|
37359
|
+
hasGenders && /* @__PURE__ */ jsx126("div", { className: "flex flex-col justify-center", children: /* @__PURE__ */ jsx126("div", { className: "flex sm:flex-col gap-3", children: Object.entries(audienceDemographics?.genders || {}).map(
|
|
37360
|
+
([gender, value]) => /* @__PURE__ */ jsxs85(
|
|
37361
|
+
"div",
|
|
37362
|
+
{
|
|
37363
|
+
className: "flex flex-col justify-center text-sm",
|
|
37364
|
+
children: [
|
|
37365
|
+
/* @__PURE__ */ jsxs85("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
37366
|
+
gender === "female" ? /* @__PURE__ */ jsx126(Venus, { className: "text-red-500", strokeWidth: 3 }) : /* @__PURE__ */ jsx126(Mars, { className: "text-blue-500", strokeWidth: 3 }),
|
|
37367
|
+
/* @__PURE__ */ jsxs85("span", { className: "capitalize text-gray800 text-xl", children: [
|
|
37368
|
+
value,
|
|
37369
|
+
"%"
|
|
37370
|
+
] })
|
|
37371
|
+
] }),
|
|
37372
|
+
/* @__PURE__ */ jsx126("span", { className: "text-lg text-gray700", children: gender.charAt(0).toUpperCase() + gender.slice(1) })
|
|
37373
|
+
]
|
|
37374
|
+
},
|
|
37375
|
+
gender
|
|
37376
|
+
)
|
|
37377
|
+
) }) })
|
|
37378
|
+
]
|
|
37379
|
+
}
|
|
37380
|
+
)
|
|
37381
|
+
] });
|
|
37382
|
+
}
|
|
37383
|
+
|
|
37384
|
+
// src/molecules/creator-discovery/CreatorWidget/PlatformIcons.tsx
|
|
37385
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
37386
|
+
function InstagramIcon({ className }) {
|
|
37387
|
+
return /* @__PURE__ */ jsx127(
|
|
37388
|
+
"svg",
|
|
37389
|
+
{
|
|
37390
|
+
className,
|
|
37391
|
+
viewBox: "0 0 24 24",
|
|
37392
|
+
fill: "currentColor",
|
|
37393
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37394
|
+
children: /* @__PURE__ */ jsx127("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z" })
|
|
37395
|
+
}
|
|
37396
|
+
);
|
|
37397
|
+
}
|
|
37398
|
+
function YouTubeIcon({ className }) {
|
|
37399
|
+
return /* @__PURE__ */ jsx127(
|
|
37400
|
+
"svg",
|
|
37401
|
+
{
|
|
37402
|
+
className,
|
|
37403
|
+
viewBox: "0 0 24 24",
|
|
37404
|
+
fill: "currentColor",
|
|
37405
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37406
|
+
children: /* @__PURE__ */ jsx127("path", { d: "M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" })
|
|
37407
|
+
}
|
|
37408
|
+
);
|
|
37409
|
+
}
|
|
37410
|
+
function TikTokIcon3({ className }) {
|
|
37411
|
+
return /* @__PURE__ */ jsx127(
|
|
37412
|
+
"svg",
|
|
37413
|
+
{
|
|
37414
|
+
className,
|
|
37415
|
+
viewBox: "0 0 24 24",
|
|
37416
|
+
fill: "currentColor",
|
|
37417
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37418
|
+
children: /* @__PURE__ */ jsx127("path", { d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z" })
|
|
37419
|
+
}
|
|
37420
|
+
);
|
|
37421
|
+
}
|
|
37422
|
+
function getPlatformIcon(platform) {
|
|
37423
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37424
|
+
if (key === "instagram") return InstagramIcon;
|
|
37425
|
+
if (key === "tiktok") return TikTokIcon3;
|
|
37426
|
+
if (key === "youtube") return YouTubeIcon;
|
|
37427
|
+
return InstagramIcon;
|
|
37428
|
+
}
|
|
37429
|
+
function getPlatformName(platform) {
|
|
37430
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37431
|
+
if (key === "instagram") return "Instagram";
|
|
37432
|
+
if (key === "tiktok") return "TikTok";
|
|
37433
|
+
if (key === "youtube") return "YouTube";
|
|
37434
|
+
return platform;
|
|
37435
|
+
}
|
|
37436
|
+
function getPlatformBgColor(platform) {
|
|
37437
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37438
|
+
if (key === "instagram") return "#C4338680";
|
|
37439
|
+
if (key === "tiktok") return "#EBEBEB40";
|
|
37440
|
+
if (key === "youtube") return "#ff000080";
|
|
37441
|
+
return "#ccc";
|
|
37442
|
+
}
|
|
37443
|
+
function getPlatformIconColor(platform) {
|
|
37444
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37445
|
+
if (key === "instagram") return "text-[#7b1551]";
|
|
37446
|
+
if (key === "tiktok") return "text-pink-500";
|
|
37447
|
+
if (key === "youtube") return "text-red-600";
|
|
37448
|
+
return "text-primary";
|
|
37449
|
+
}
|
|
37450
|
+
|
|
37451
|
+
// src/molecules/creator-discovery/CreatorWidget/PostCard.tsx
|
|
37452
|
+
import { useState as useState12 } from "react";
|
|
37453
|
+
import { Fragment as Fragment6, jsx as jsx128, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
37454
|
+
var formatFollowerCount = (count) => {
|
|
37455
|
+
if (count >= 1e6) {
|
|
37456
|
+
const millions = count / 1e6;
|
|
37457
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
37458
|
+
} else if (count >= 1e4) {
|
|
37459
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
37460
|
+
} else if (count >= 1e3) {
|
|
37461
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
37462
|
+
}
|
|
37463
|
+
return Math.floor(count).toString();
|
|
37464
|
+
};
|
|
37465
|
+
function PostCard({ post, platformUsername }) {
|
|
37466
|
+
const [expanded, setExpanded] = useState12(false);
|
|
37467
|
+
const [errored, setErrored] = useState12(false);
|
|
37468
|
+
const thumbnail = post.thumbnail_url || post.thumbnail || post.image || "";
|
|
37469
|
+
const likes = post.engagement?.likes ?? post.likes ?? null;
|
|
37470
|
+
const comments = post.engagement?.comments ?? post.comments ?? null;
|
|
37471
|
+
const views = post.engagement?.views ?? post.engagement?.plays ?? post.views ?? post.plays ?? null;
|
|
37472
|
+
const impressions = post.impressions ?? null;
|
|
37473
|
+
const reach = post.reach ?? null;
|
|
37474
|
+
return /* @__PURE__ */ jsxs86(
|
|
37475
|
+
"div",
|
|
37476
|
+
{
|
|
37477
|
+
className: "rounded-xl overflow-hidden border border-gray500 bg-transparent shadow-sm cursor-pointer",
|
|
37478
|
+
onClick: (e) => {
|
|
37479
|
+
e.stopPropagation();
|
|
37480
|
+
window.open(post.url, "_blank", "noopener,noreferrer");
|
|
37481
|
+
},
|
|
37482
|
+
children: [
|
|
37483
|
+
/* @__PURE__ */ jsx128("div", { className: "w-full aspect-square relative bg-gray25", children: thumbnail && !errored ? /* @__PURE__ */ jsx128(
|
|
37484
|
+
"img",
|
|
37485
|
+
{
|
|
37486
|
+
src: thumbnail,
|
|
37487
|
+
alt: post.title || "post",
|
|
37488
|
+
className: "w-full h-full object-cover",
|
|
37489
|
+
onError: () => setErrored(true)
|
|
37490
|
+
}
|
|
37491
|
+
) : /* @__PURE__ */ jsx128("div", { className: "w-full h-full flex items-center justify-center text-gray500 text-sm", children: "No preview" }) }),
|
|
37492
|
+
/* @__PURE__ */ jsxs86("div", { className: "p-3", children: [
|
|
37493
|
+
/* @__PURE__ */ jsxs86("div", { className: "flex items-center gap-4 text-sm text-gray600 mb-2", children: [
|
|
37494
|
+
likes !== null && /* @__PURE__ */ jsxs86("div", { className: "flex items-center gap-1", children: [
|
|
37495
|
+
/* @__PURE__ */ jsx128("span", { children: formatFollowerCount(likes) }),
|
|
37496
|
+
" ",
|
|
37497
|
+
/* @__PURE__ */ jsx128(Heart, { size: 14 })
|
|
37498
|
+
] }),
|
|
37499
|
+
comments !== null && /* @__PURE__ */ jsxs86("div", { className: "flex items-center gap-1", children: [
|
|
37500
|
+
/* @__PURE__ */ jsx128("span", { children: formatFollowerCount(comments) }),
|
|
37501
|
+
" ",
|
|
37502
|
+
/* @__PURE__ */ jsx128(MessageCircle, { size: 14 })
|
|
37503
|
+
] }),
|
|
37504
|
+
views !== null && /* @__PURE__ */ jsxs86("div", { className: "flex items-center gap-1", children: [
|
|
37505
|
+
/* @__PURE__ */ jsx128("span", { children: formatFollowerCount(views) }),
|
|
37506
|
+
" ",
|
|
37507
|
+
/* @__PURE__ */ jsx128(Eye, { size: 14 })
|
|
37508
|
+
] })
|
|
37509
|
+
] }),
|
|
37510
|
+
/* @__PURE__ */ jsxs86("div", { className: "flex gap-4 text-sm text-gray800 mb-2", children: [
|
|
37511
|
+
impressions !== null && /* @__PURE__ */ jsxs86("div", { children: [
|
|
37512
|
+
/* @__PURE__ */ jsx128("span", { className: "text-gray500 font-bold", children: formatFollowerCount(impressions) }),
|
|
37513
|
+
" ",
|
|
37514
|
+
"est.Impressions"
|
|
37515
|
+
] }),
|
|
37516
|
+
reach !== null && /* @__PURE__ */ jsxs86("div", { children: [
|
|
37517
|
+
/* @__PURE__ */ jsx128("span", { className: "text-gray500 font-bold", children: formatFollowerCount(reach) }),
|
|
37518
|
+
" ",
|
|
37519
|
+
"est.Reach"
|
|
37520
|
+
] })
|
|
37521
|
+
] }),
|
|
37522
|
+
/* @__PURE__ */ jsxs86("div", { className: "text-sm mb-1", children: [
|
|
37523
|
+
platformUsername && /* @__PURE__ */ jsxs86("div", { className: "text-md font-semibold text-gray500", children: [
|
|
37524
|
+
"@",
|
|
37525
|
+
platformUsername
|
|
37526
|
+
] }),
|
|
37527
|
+
["instagram", "tiktok"].includes(
|
|
37528
|
+
post.platform?.toLowerCase() || ""
|
|
37529
|
+
) ? /* @__PURE__ */ jsx128(Fragment6, { children: (() => {
|
|
37530
|
+
const text = post.title || post.description || "";
|
|
37531
|
+
return /* @__PURE__ */ jsxs86(Fragment6, { children: [
|
|
37532
|
+
/* @__PURE__ */ jsx128(
|
|
37533
|
+
"div",
|
|
37534
|
+
{
|
|
37535
|
+
className: `text-gray900 font-light mt-2 text-sm ${!expanded ? "line-clamp-3" : ""}`,
|
|
37536
|
+
children: text
|
|
37537
|
+
}
|
|
37538
|
+
),
|
|
37539
|
+
text.length > 100 && /* @__PURE__ */ jsx128(
|
|
37540
|
+
"button",
|
|
37541
|
+
{
|
|
37542
|
+
onClick: (e) => {
|
|
37543
|
+
e.stopPropagation();
|
|
37544
|
+
setExpanded((s) => !s);
|
|
37545
|
+
},
|
|
37546
|
+
className: "text-xs text-purpleText mt-2",
|
|
37547
|
+
children: expanded ? "Show less" : "Show more"
|
|
37548
|
+
}
|
|
37549
|
+
)
|
|
37550
|
+
] });
|
|
37551
|
+
})() }) : /* @__PURE__ */ jsxs86(Fragment6, { children: [
|
|
37552
|
+
post.title && /* @__PURE__ */ jsx128("div", { className: "text-gray900 font-light", children: post.title }),
|
|
37553
|
+
post.description && /* @__PURE__ */ jsx128(
|
|
37554
|
+
"div",
|
|
37555
|
+
{
|
|
37556
|
+
className: "mt-2 text-sm text-gray900 overflow-hidden font-light",
|
|
37557
|
+
style: { maxHeight: expanded ? void 0 : 200 },
|
|
37558
|
+
children: post.description
|
|
37559
|
+
}
|
|
37560
|
+
),
|
|
37561
|
+
post.description && post.description.length > 200 && /* @__PURE__ */ jsx128(
|
|
37562
|
+
"button",
|
|
37563
|
+
{
|
|
37564
|
+
onClick: (e) => {
|
|
37565
|
+
e.stopPropagation();
|
|
37566
|
+
setExpanded((s) => !s);
|
|
37567
|
+
},
|
|
37568
|
+
className: "text-xs text-purpleText mt-2",
|
|
37569
|
+
children: expanded ? "Show less" : "Show more"
|
|
37570
|
+
}
|
|
37571
|
+
)
|
|
37572
|
+
] })
|
|
37573
|
+
] })
|
|
37574
|
+
] })
|
|
37575
|
+
]
|
|
37576
|
+
}
|
|
37577
|
+
);
|
|
37578
|
+
}
|
|
37579
|
+
|
|
37580
|
+
// src/molecules/creator-discovery/CreatorWidget/PlatformPostsSection.tsx
|
|
37581
|
+
import { jsx as jsx129, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
37582
|
+
var formatFollowerCount2 = (count) => {
|
|
37583
|
+
if (count >= 1e6) {
|
|
37584
|
+
const millions = count / 1e6;
|
|
37585
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
37586
|
+
} else if (count >= 1e4) {
|
|
37587
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
37588
|
+
} else if (count >= 1e3) {
|
|
37589
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
37590
|
+
}
|
|
37591
|
+
return Math.floor(count).toString();
|
|
37592
|
+
};
|
|
37593
|
+
function filterPostsByPlatform(posts, platform) {
|
|
37594
|
+
const postsArr = (posts ?? []).slice();
|
|
37595
|
+
const shortKey = platform.replace(/Metrics$/i, "").toLowerCase();
|
|
37596
|
+
return postsArr.filter((p) => (p.platform || "").toLowerCase() === shortKey).slice(0, 3);
|
|
37597
|
+
}
|
|
37598
|
+
function PlatformMetricsBanner({
|
|
37599
|
+
platform,
|
|
37600
|
+
metrics
|
|
37601
|
+
}) {
|
|
37602
|
+
const platformName = getPlatformName(platform);
|
|
37603
|
+
const bgColor = getPlatformBgColor(platform);
|
|
37604
|
+
const IconComponent = getPlatformIcon(platform);
|
|
37605
|
+
return /* @__PURE__ */ jsxs87(
|
|
37606
|
+
"div",
|
|
37607
|
+
{
|
|
37608
|
+
className: "\n flex overflow-x-auto gap-6 rounded-l-xl py-4 px-4 shadow-sm\n md:grid md:grid-cols-[0.5fr_1fr_1fr_1fr_1fr] md:items-center md:gap-0 md:px-0 md:ml-8\n ",
|
|
37609
|
+
style: { backgroundColor: bgColor },
|
|
37610
|
+
children: [
|
|
37611
|
+
/* @__PURE__ */ jsxs87("div", { className: "flex flex-col items-center min-w-[90px] md:min-w-0", children: [
|
|
37612
|
+
/* @__PURE__ */ jsx129(IconComponent, { className: "w-5 h-5 md:w-6 md:h-6 text-gray900" }),
|
|
37613
|
+
/* @__PURE__ */ jsx129("span", { className: "text-lg md:text-xl font-bold text-gray900", children: platform === "youtubeMetrics" ? formatFollowerCount2(metrics.subscribers || 0) : formatFollowerCount2(metrics.followers || 0) })
|
|
37614
|
+
] }),
|
|
37615
|
+
/* @__PURE__ */ jsxs87("div", { className: "flex flex-col items-start min-w-[130px] md:min-w-0", children: [
|
|
37616
|
+
/* @__PURE__ */ jsxs87(
|
|
37617
|
+
"span",
|
|
37618
|
+
{
|
|
37619
|
+
className: "text-base md:text-lg dark:text-white max-w-[90%] truncate cursor-default",
|
|
37620
|
+
title: `@${platform === "youtubeMetrics" ? metrics.channelName : metrics.username}`,
|
|
37621
|
+
children: [
|
|
37622
|
+
"@",
|
|
37623
|
+
platform === "youtubeMetrics" ? metrics.channelName : metrics.username
|
|
37624
|
+
]
|
|
37625
|
+
}
|
|
37626
|
+
),
|
|
37627
|
+
/* @__PURE__ */ jsx129("span", { className: "text-xs md:text-sm text-gray900 opacity-90", children: platformName })
|
|
37628
|
+
] }),
|
|
37629
|
+
/* @__PURE__ */ jsxs87("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37630
|
+
/* @__PURE__ */ jsxs87("span", { className: "text-sm md:text-md font-semibold text-gray900", children: [
|
|
37631
|
+
(metrics.engagementRate * 100).toFixed(2),
|
|
37632
|
+
"%"
|
|
37633
|
+
] }),
|
|
37634
|
+
/* @__PURE__ */ jsx129("span", { className: "text-xs text-gray900 opacity-80", children: "Engagement Rate" })
|
|
37635
|
+
] }),
|
|
37636
|
+
/* @__PURE__ */ jsxs87("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37637
|
+
/* @__PURE__ */ jsx129("span", { className: "text-sm md:text-md font-semibold text-gray900", children: Math.round(metrics.avgLikes)?.toLocaleString() }),
|
|
37638
|
+
/* @__PURE__ */ jsx129("span", { className: "text-xs text-gray900 opacity-80", children: "Avg Likes" })
|
|
37639
|
+
] }),
|
|
37640
|
+
/* @__PURE__ */ jsxs87("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37641
|
+
/* @__PURE__ */ jsx129("span", { className: "text-sm md:text-md font-semibold text-gray900", children: Math.round(metrics.avgComments)?.toLocaleString() }),
|
|
37642
|
+
/* @__PURE__ */ jsx129("span", { className: "text-xs text-gray900 opacity-80", children: "Avg Comments" })
|
|
37643
|
+
] })
|
|
37644
|
+
]
|
|
37645
|
+
}
|
|
37646
|
+
);
|
|
37647
|
+
}
|
|
37648
|
+
function PlatformPostsSection({
|
|
37649
|
+
platformMetrics,
|
|
37650
|
+
posts = []
|
|
37651
|
+
}) {
|
|
37652
|
+
if (!platformMetrics) return null;
|
|
37653
|
+
return /* @__PURE__ */ jsx129("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsx129("div", { className: "flex flex-col gap-8", children: Object.entries(platformMetrics || {}).map(
|
|
37654
|
+
([platform, metrics]) => {
|
|
37655
|
+
if (!metrics) return null;
|
|
37656
|
+
if (metrics.followers === 0 && metrics.subscribers === 0)
|
|
37657
|
+
return null;
|
|
37658
|
+
const platformPosts = filterPostsByPlatform(posts, platform);
|
|
37659
|
+
const platformUsername = metrics.username ?? metrics.channelName ?? "";
|
|
37660
|
+
return /* @__PURE__ */ jsxs87("div", { className: "w-full flex flex-col gap-8", children: [
|
|
37661
|
+
/* @__PURE__ */ jsx129(PlatformMetricsBanner, { platform, metrics }),
|
|
37662
|
+
platformPosts.length > 0 && /* @__PURE__ */ jsx129("div", { className: "pr-6 sm:ml-8 sm:pr-7", children: /* @__PURE__ */ jsx129("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: platformPosts.map((post, idx) => /* @__PURE__ */ jsx129(
|
|
37663
|
+
PostCard,
|
|
37664
|
+
{
|
|
37665
|
+
post,
|
|
37666
|
+
platformUsername
|
|
37667
|
+
},
|
|
37668
|
+
post.post_id ?? post.url ?? idx
|
|
37669
|
+
)) }) })
|
|
37670
|
+
] }, platform);
|
|
37671
|
+
}
|
|
37672
|
+
) }) });
|
|
37673
|
+
}
|
|
37674
|
+
|
|
37675
|
+
// src/molecules/creator-discovery/CreatorWidget/BrandCollaborationsList.tsx
|
|
37676
|
+
import { useState as useState13 } from "react";
|
|
37677
|
+
import ReactDOM from "react-dom";
|
|
37678
|
+
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "framer-motion";
|
|
37679
|
+
import { Fragment as Fragment7, jsx as jsx130, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
37680
|
+
var getSentimentRank = (score) => {
|
|
37681
|
+
if (score >= 80) {
|
|
37682
|
+
return {
|
|
37683
|
+
rank: "STRONG FIT",
|
|
37684
|
+
bgColor: "bg-greenBackground",
|
|
37685
|
+
textColor: "text-greenText",
|
|
37686
|
+
scoreColor: "text-[#499C54]"
|
|
37687
|
+
};
|
|
37688
|
+
} else if (score >= 50) {
|
|
37689
|
+
return {
|
|
37690
|
+
rank: "MODERATE FIT",
|
|
37691
|
+
bgColor: "bg-orangeBackground",
|
|
37692
|
+
textColor: "text-orangeText",
|
|
37693
|
+
scoreColor: "text-[#B3512F]"
|
|
37694
|
+
};
|
|
37695
|
+
} else if (score >= 0) {
|
|
37696
|
+
return {
|
|
37697
|
+
rank: "POOR FIT",
|
|
37698
|
+
bgColor: "bg-redBackground",
|
|
37699
|
+
textColor: "text-redText",
|
|
37700
|
+
scoreColor: "text-[#BE2C35]"
|
|
37701
|
+
};
|
|
37702
|
+
}
|
|
37703
|
+
return {
|
|
37704
|
+
rank: "Unranked",
|
|
37705
|
+
bgColor: "bg-gray500",
|
|
37706
|
+
textColor: "text-gray200",
|
|
37707
|
+
scoreColor: "text-gray500"
|
|
37708
|
+
};
|
|
37709
|
+
};
|
|
37710
|
+
function BrandMentionDetails({
|
|
37711
|
+
open,
|
|
37712
|
+
onClose,
|
|
37713
|
+
brandBreakdown,
|
|
37714
|
+
selectedBrand
|
|
37715
|
+
}) {
|
|
37716
|
+
const brandStats = brandBreakdown?.insights?.brandBreakdown?.find(
|
|
37717
|
+
(b) => b.brand.toLowerCase() === selectedBrand?.toLowerCase()
|
|
37718
|
+
);
|
|
37719
|
+
const brandMentions = brandBreakdown?.mentions?.filter(
|
|
37720
|
+
(m) => m.normalizedBrand?.toLowerCase() === selectedBrand?.toLowerCase() || m.brand?.toLowerCase() === selectedBrand?.toLowerCase()
|
|
37721
|
+
) || [];
|
|
37722
|
+
if (typeof window === "undefined") return null;
|
|
37723
|
+
return ReactDOM.createPortal(
|
|
37724
|
+
/* @__PURE__ */ jsx130(AnimatePresence3, { mode: "sync", children: open && /* @__PURE__ */ jsxs88(Fragment7, { children: [
|
|
37725
|
+
/* @__PURE__ */ jsx130(
|
|
37726
|
+
motion3.div,
|
|
37727
|
+
{
|
|
37728
|
+
initial: { opacity: 0 },
|
|
37729
|
+
animate: { opacity: 1 },
|
|
37730
|
+
exit: { opacity: 0 },
|
|
37731
|
+
transition: { duration: 0.2 },
|
|
37732
|
+
className: "fixed inset-0 bg-black bg-opacity-50 z-[80]",
|
|
37733
|
+
onClick: (e) => {
|
|
37734
|
+
e.stopPropagation();
|
|
37735
|
+
onClose();
|
|
37736
|
+
}
|
|
37737
|
+
},
|
|
37738
|
+
"brand-overlay"
|
|
37739
|
+
),
|
|
37740
|
+
/* @__PURE__ */ jsxs88(
|
|
37741
|
+
motion3.div,
|
|
37742
|
+
{
|
|
37743
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
37744
|
+
animate: { opacity: 1, scale: 1 },
|
|
37745
|
+
exit: { opacity: 0, scale: 0.95 },
|
|
37746
|
+
transition: { duration: 0.2 },
|
|
37747
|
+
className: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[90] w-full max-w-lg bg-background rounded-xl border border-gray300 shadow-2xl",
|
|
37748
|
+
onClick: (e) => e.stopPropagation(),
|
|
37749
|
+
children: [
|
|
37750
|
+
/* @__PURE__ */ jsxs88("div", { className: "flex justify-between items-center p-4 border-b border-gray300", children: [
|
|
37751
|
+
/* @__PURE__ */ jsxs88("h3", { className: "text-lg font-bold text-gray900", children: [
|
|
37752
|
+
"Brand Mention Details: ",
|
|
37753
|
+
selectedBrand
|
|
37754
|
+
] }),
|
|
37755
|
+
/* @__PURE__ */ jsx130(
|
|
37756
|
+
"button",
|
|
37757
|
+
{
|
|
37758
|
+
onClick: onClose,
|
|
37759
|
+
className: "p-1 rounded-full hover:bg-gray200 transition-colors",
|
|
37760
|
+
children: /* @__PURE__ */ jsx130(X, { className: "w-4 h-4" })
|
|
37761
|
+
}
|
|
37762
|
+
)
|
|
37763
|
+
] }),
|
|
37764
|
+
/* @__PURE__ */ jsxs88("div", { className: "flex flex-col gap-6 max-h-[70vh] overflow-y-auto p-4", children: [
|
|
37765
|
+
brandStats && /* @__PURE__ */ jsxs88("div", { className: "bg-gray25 border-2 border-gray200 rounded-xl p-4", children: [
|
|
37766
|
+
/* @__PURE__ */ jsx130("h3", { className: "text-lg font-bold text-gray900 mb-4", children: "Overview" }),
|
|
37767
|
+
/* @__PURE__ */ jsxs88("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
37768
|
+
/* @__PURE__ */ jsxs88("div", { className: "bg-background rounded-lg p-3", children: [
|
|
37769
|
+
/* @__PURE__ */ jsx130("div", { className: "text-xs text-gray600", children: "Total Mentions" }),
|
|
37770
|
+
/* @__PURE__ */ jsx130("div", { className: "text-2xl font-bold text-gray900", children: brandStats.mentions })
|
|
37771
|
+
] }),
|
|
37772
|
+
/* @__PURE__ */ jsxs88("div", { className: "bg-background rounded-lg p-3", children: [
|
|
37773
|
+
/* @__PURE__ */ jsx130("div", { className: "text-xs text-gray600", children: "Posts Count" }),
|
|
37774
|
+
/* @__PURE__ */ jsx130("div", { className: "text-2xl font-bold text-gray900", children: brandStats.postCount })
|
|
37775
|
+
] }),
|
|
37776
|
+
/* @__PURE__ */ jsxs88("div", { className: "bg-background rounded-lg p-3", children: [
|
|
37777
|
+
/* @__PURE__ */ jsx130("div", { className: "text-xs text-gray600", children: "Avg Engagement" }),
|
|
37778
|
+
/* @__PURE__ */ jsxs88("div", { className: "text-2xl font-bold text-gray900", children: [
|
|
37779
|
+
brandStats.averageEngagementRate?.toFixed(2),
|
|
37780
|
+
"%"
|
|
37781
|
+
] })
|
|
37782
|
+
] }),
|
|
37783
|
+
/* @__PURE__ */ jsxs88("div", { className: "bg-background rounded-lg p-3", children: [
|
|
37784
|
+
/* @__PURE__ */ jsx130("div", { className: "text-xs text-gray600", children: "Effectiveness" }),
|
|
37785
|
+
/* @__PURE__ */ jsxs88(
|
|
37786
|
+
"div",
|
|
37787
|
+
{
|
|
37788
|
+
className: `text-2xl font-bold ${getSentimentRank(brandStats.effectivenessPercent).scoreColor}`,
|
|
37789
|
+
children: [
|
|
37790
|
+
brandStats.effectivenessPercent,
|
|
37791
|
+
"%"
|
|
37792
|
+
]
|
|
37793
|
+
}
|
|
37794
|
+
)
|
|
37795
|
+
] })
|
|
37796
|
+
] }),
|
|
37797
|
+
/* @__PURE__ */ jsx130("div", { className: "mt-3 flex gap-2 flex-wrap", children: brandStats.collaborationTypes?.map(
|
|
37798
|
+
(type, idx) => /* @__PURE__ */ jsx130(
|
|
37799
|
+
"span",
|
|
37800
|
+
{
|
|
37801
|
+
className: "px-3 py-1 rounded-md text-xs font-medium bg-[#1D4324] text-[#72E285]",
|
|
37802
|
+
children: type
|
|
37803
|
+
},
|
|
37804
|
+
idx
|
|
37805
|
+
)
|
|
37806
|
+
) })
|
|
37807
|
+
] }),
|
|
37808
|
+
/* @__PURE__ */ jsxs88("div", { children: [
|
|
37809
|
+
/* @__PURE__ */ jsxs88("h3", { className: "text-lg font-bold text-gray900 mb-3", children: [
|
|
37810
|
+
"Individual Mentions (",
|
|
37811
|
+
brandMentions.length,
|
|
37812
|
+
")"
|
|
37813
|
+
] }),
|
|
37814
|
+
/* @__PURE__ */ jsx130("div", { className: "flex flex-col gap-3", children: brandMentions.map((mention, index) => {
|
|
37815
|
+
const IconComponent = getPlatformIcon(mention?.platform);
|
|
37816
|
+
return /* @__PURE__ */ jsxs88(
|
|
37817
|
+
"div",
|
|
37818
|
+
{
|
|
37819
|
+
className: "bg-gray50 border-2 border-gray200 rounded-xl p-4 hover:border-purple100 transition-colors",
|
|
37820
|
+
children: [
|
|
37821
|
+
/* @__PURE__ */ jsxs88("div", { className: "flex items-center justify-between mb-3", children: [
|
|
37822
|
+
/* @__PURE__ */ jsxs88("div", { className: "flex items-center gap-2", children: [
|
|
37823
|
+
/* @__PURE__ */ jsx130(IconComponent, { className: "w-5 h-5 text-gray900" }),
|
|
37824
|
+
/* @__PURE__ */ jsx130("span", { className: "text-sm font-medium text-gray700 capitalize", children: mention.platform })
|
|
37825
|
+
] }),
|
|
37826
|
+
/* @__PURE__ */ jsxs88("div", { className: "flex items-center gap-2", children: [
|
|
37827
|
+
/* @__PURE__ */ jsx130("span", { className: "px-2 py-1 rounded-md text-xs font-medium bg-[#1D4324] text-[#72E285]", children: mention.collaborationType }),
|
|
37828
|
+
/* @__PURE__ */ jsxs88("span", { className: "text-xs text-gray600", children: [
|
|
37829
|
+
Math.round(mention.confidence * 100),
|
|
37830
|
+
"% confidence"
|
|
37831
|
+
] })
|
|
37832
|
+
] })
|
|
37833
|
+
] }),
|
|
37834
|
+
/* @__PURE__ */ jsxs88("div", { className: "mb-2", children: [
|
|
37835
|
+
/* @__PURE__ */ jsxs88("span", { className: "text-xs text-gray500", children: [
|
|
37836
|
+
"Post ID:",
|
|
37837
|
+
" "
|
|
37838
|
+
] }),
|
|
37839
|
+
/* @__PURE__ */ jsx130("span", { className: "text-xs font-mono text-gray700", children: mention.post_id })
|
|
37840
|
+
] }),
|
|
37841
|
+
/* @__PURE__ */ jsxs88("div", { className: "bg-background rounded-lg p-3 border border-gray300", children: [
|
|
37842
|
+
/* @__PURE__ */ jsx130("div", { className: "text-xs text-gray600 mb-1", children: "Evidence:" }),
|
|
37843
|
+
/* @__PURE__ */ jsxs88("p", { className: "text-sm text-gray800 italic", children: [
|
|
37844
|
+
"\u201C",
|
|
37845
|
+
mention.evidence,
|
|
37846
|
+
"\u201D"
|
|
37847
|
+
] })
|
|
37848
|
+
] }),
|
|
37849
|
+
/* @__PURE__ */ jsxs88("div", { className: "mt-2 text-xs text-gray500", children: [
|
|
37850
|
+
"Source:",
|
|
37851
|
+
" ",
|
|
37852
|
+
/* @__PURE__ */ jsx130("span", { className: "font-medium", children: mention.source }),
|
|
37853
|
+
mention.handle && /* @__PURE__ */ jsxs88("span", { className: "ml-2", children: [
|
|
37854
|
+
"Handle:",
|
|
37855
|
+
" ",
|
|
37856
|
+
/* @__PURE__ */ jsx130("span", { className: "font-medium", children: mention.handle })
|
|
37857
|
+
] })
|
|
37858
|
+
] })
|
|
37859
|
+
]
|
|
37860
|
+
},
|
|
37861
|
+
index
|
|
37862
|
+
);
|
|
37863
|
+
}) })
|
|
37864
|
+
] }),
|
|
37865
|
+
brandMentions.length === 0 && /* @__PURE__ */ jsx130("div", { className: "text-center py-8 text-gray500", children: "No mentions found for this brand" })
|
|
37866
|
+
] })
|
|
37867
|
+
]
|
|
37868
|
+
},
|
|
37869
|
+
"brand-modal"
|
|
37870
|
+
)
|
|
37871
|
+
] }) }),
|
|
37872
|
+
document.body
|
|
37873
|
+
);
|
|
37874
|
+
}
|
|
37875
|
+
function BrandCollaborationsList({
|
|
37876
|
+
brandBreakdown
|
|
37877
|
+
}) {
|
|
37878
|
+
const [openDetails, setOpenDetails] = useState13(false);
|
|
37879
|
+
const [selectedBrand, setSelectedBrand] = useState13("");
|
|
37880
|
+
if (!brandBreakdown?.insights?.brandBreakdown || brandBreakdown.insights.brandBreakdown.length === 0) {
|
|
37881
|
+
return null;
|
|
37882
|
+
}
|
|
37883
|
+
return /* @__PURE__ */ jsxs88(Fragment7, { children: [
|
|
37884
|
+
/* @__PURE__ */ jsxs88("div", { children: [
|
|
37885
|
+
/* @__PURE__ */ jsx130("div", { className: "text-purpleText text-xs mb-2", children: /* @__PURE__ */ jsx130("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "BRAND MENTIONS" }) }),
|
|
37886
|
+
/* @__PURE__ */ jsx130("div", { className: "flex flex-col gap-2 max-h-[220px] overflow-y-auto", children: brandBreakdown.insights.brandBreakdown.map(
|
|
37887
|
+
(item, index) => /* @__PURE__ */ jsxs88(
|
|
37888
|
+
"div",
|
|
37889
|
+
{
|
|
37890
|
+
className: "flex gap-4 bg-gray50 border-2 border-gray25 rounded-xl px-3 py-3 shadow-sm cursor-pointer hover:border-purple100 transition-colors",
|
|
37891
|
+
onClick: (e) => {
|
|
37892
|
+
e.stopPropagation();
|
|
37893
|
+
setSelectedBrand(item?.brand);
|
|
37894
|
+
setOpenDetails(true);
|
|
37895
|
+
},
|
|
37896
|
+
children: [
|
|
37897
|
+
/* @__PURE__ */ jsx130("div", { className: "w-10 h-10 rounded-full bg-gray200 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx130("span", { className: "text-sm font-bold text-gray700", children: item.brand?.charAt(0)?.toUpperCase() || "?" }) }),
|
|
37898
|
+
/* @__PURE__ */ jsxs88("div", { className: "flex flex-col gap-1", children: [
|
|
37899
|
+
/* @__PURE__ */ jsx130("div", { className: "text-gray900 text-sm", children: item.brand }),
|
|
37900
|
+
/* @__PURE__ */ jsxs88("div", { className: "flex gap-2 text-xs text-gray600", children: [
|
|
37901
|
+
/* @__PURE__ */ jsxs88("div", { children: [
|
|
37902
|
+
/* @__PURE__ */ jsx130("span", { className: "text-gray900", children: item?.mentions }),
|
|
37903
|
+
" ",
|
|
37904
|
+
"Mention"
|
|
37905
|
+
] }),
|
|
37906
|
+
/* @__PURE__ */ jsxs88("div", { children: [
|
|
37907
|
+
/* @__PURE__ */ jsx130(
|
|
37908
|
+
"span",
|
|
37909
|
+
{
|
|
37910
|
+
className: `${getSentimentRank(item.effectivenessPercent).scoreColor} font-bold`,
|
|
37911
|
+
children: item.effectivenessPercent ? `${item.effectivenessPercent}%` : "N/A"
|
|
37912
|
+
}
|
|
37913
|
+
),
|
|
37914
|
+
" ",
|
|
37915
|
+
"Effectiveness"
|
|
37916
|
+
] })
|
|
37917
|
+
] })
|
|
37918
|
+
] })
|
|
37919
|
+
]
|
|
37920
|
+
},
|
|
37921
|
+
index
|
|
37922
|
+
)
|
|
37923
|
+
) })
|
|
37924
|
+
] }),
|
|
37925
|
+
/* @__PURE__ */ jsx130(
|
|
37926
|
+
BrandMentionDetails,
|
|
37927
|
+
{
|
|
37928
|
+
open: openDetails,
|
|
37929
|
+
onClose: () => setOpenDetails(false),
|
|
37930
|
+
brandBreakdown,
|
|
37931
|
+
selectedBrand
|
|
37932
|
+
}
|
|
37933
|
+
)
|
|
37934
|
+
] });
|
|
37935
|
+
}
|
|
37936
|
+
|
|
37937
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorGridView.tsx
|
|
37938
|
+
import { useState as useState14, useMemo as useMemo9, useRef as useRef6, useCallback as useCallback4, useEffect as useEffect9 } from "react";
|
|
37939
|
+
import { motion as motion4 } from "framer-motion";
|
|
37940
|
+
import { jsx as jsx131, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
37941
|
+
var formatFollowerCount3 = (count) => {
|
|
37942
|
+
if (count >= 1e6) {
|
|
37943
|
+
const millions = count / 1e6;
|
|
37944
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
37945
|
+
} else if (count >= 1e4) {
|
|
37946
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
37947
|
+
} else if (count >= 1e3) {
|
|
37948
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
37949
|
+
}
|
|
37950
|
+
return Math.floor(count).toString();
|
|
37951
|
+
};
|
|
37952
|
+
var getSentimentRank2 = (score) => {
|
|
37953
|
+
if (score >= 80) {
|
|
37954
|
+
return {
|
|
37955
|
+
bgColor: "bg-greenBackground",
|
|
37956
|
+
textColor: "text-greenText",
|
|
37957
|
+
scoreColor: "text-[#499C54]"
|
|
37958
|
+
};
|
|
37959
|
+
} else if (score >= 50) {
|
|
37960
|
+
return {
|
|
37961
|
+
bgColor: "bg-orangeBackground",
|
|
37962
|
+
textColor: "text-orangeText",
|
|
37963
|
+
scoreColor: "text-[#B3512F]"
|
|
37964
|
+
};
|
|
37965
|
+
} else if (score >= 0) {
|
|
37966
|
+
return {
|
|
37967
|
+
bgColor: "bg-redBackground",
|
|
37968
|
+
textColor: "text-redText",
|
|
37969
|
+
scoreColor: "text-[#BE2C35]"
|
|
37970
|
+
};
|
|
37971
|
+
}
|
|
37972
|
+
return {
|
|
37973
|
+
bgColor: "bg-gray500",
|
|
37974
|
+
textColor: "text-gray200",
|
|
37975
|
+
scoreColor: "text-gray200"
|
|
37976
|
+
};
|
|
37977
|
+
};
|
|
37978
|
+
var itemsExplanation = [
|
|
37979
|
+
{ key: "contentRelevance", label: "Content Relevance" },
|
|
37980
|
+
{ key: "audienceMatch", label: "Audience Match" },
|
|
37981
|
+
{ key: "authorityExpertise", label: "Expertise" },
|
|
37982
|
+
{ key: "contentQuality", label: "Content Quality" },
|
|
37983
|
+
{ key: "authenticity", label: "Authenticity" },
|
|
37984
|
+
{ key: "brandSafety", label: "Brand Safety" }
|
|
37985
|
+
];
|
|
37986
|
+
function CreatorGridViewCard({ creator }) {
|
|
37987
|
+
const [isExpanded, setIsExpanded] = useState14(false);
|
|
37988
|
+
const [showFullDescription, setShowFullDescription] = useState14(false);
|
|
37989
|
+
const [isDescriptionOverflowing, setIsDescriptionOverflowing] = useState14(false);
|
|
37990
|
+
const descriptionRef = useRef6(null);
|
|
37991
|
+
const cardRef = useRef6(null);
|
|
37992
|
+
const checkDescriptionOverflow = useCallback4(() => {
|
|
37993
|
+
const el = descriptionRef.current;
|
|
37994
|
+
if (!el) return;
|
|
37995
|
+
setIsDescriptionOverflowing(el.scrollHeight > el.clientHeight + 1);
|
|
37996
|
+
}, []);
|
|
37997
|
+
useEffect9(() => {
|
|
37998
|
+
checkDescriptionOverflow();
|
|
37999
|
+
}, [checkDescriptionOverflow, isExpanded, showFullDescription]);
|
|
38000
|
+
useEffect9(() => {
|
|
38001
|
+
const onResize = () => checkDescriptionOverflow();
|
|
38002
|
+
window.addEventListener("resize", onResize);
|
|
38003
|
+
return () => window.removeEventListener("resize", onResize);
|
|
38004
|
+
}, [checkDescriptionOverflow]);
|
|
38005
|
+
const platformStats = useMemo9(() => {
|
|
38006
|
+
return [
|
|
38007
|
+
{
|
|
38008
|
+
platform: "instagram",
|
|
38009
|
+
icon: InstagramIcon,
|
|
38010
|
+
followers: creator.metrics?.instagram?.followers || 0,
|
|
38011
|
+
engagement: creator.metrics?.instagram?.engagement || 0
|
|
38012
|
+
},
|
|
38013
|
+
{
|
|
38014
|
+
platform: "youtube",
|
|
38015
|
+
icon: YouTubeIcon,
|
|
38016
|
+
followers: creator.metrics?.youtube?.followers || 0,
|
|
38017
|
+
engagement: creator.metrics?.youtube?.engagement || 0
|
|
38018
|
+
},
|
|
38019
|
+
{
|
|
38020
|
+
platform: "tiktok",
|
|
38021
|
+
icon: TikTokIcon3,
|
|
38022
|
+
followers: creator.metrics?.tiktok?.followers || 0,
|
|
38023
|
+
engagement: creator.metrics?.tiktok?.engagement || 0
|
|
38024
|
+
}
|
|
38025
|
+
];
|
|
38026
|
+
}, [creator]);
|
|
38027
|
+
const toggleExpanded = () => {
|
|
38028
|
+
const willExpand = !isExpanded;
|
|
38029
|
+
setIsExpanded(willExpand);
|
|
38030
|
+
setTimeout(() => {
|
|
38031
|
+
if (cardRef.current) {
|
|
38032
|
+
cardRef.current.scrollIntoView({
|
|
38033
|
+
behavior: "smooth",
|
|
38034
|
+
block: willExpand ? "center" : "nearest"
|
|
38035
|
+
});
|
|
38036
|
+
}
|
|
38037
|
+
}, 100);
|
|
38038
|
+
};
|
|
38039
|
+
const iso2 = normalizeToIso2(creator.country);
|
|
38040
|
+
const meta = codeToMeta[iso2];
|
|
38041
|
+
return /* @__PURE__ */ jsx131(
|
|
38042
|
+
motion4.div,
|
|
38043
|
+
{
|
|
38044
|
+
ref: cardRef,
|
|
38045
|
+
layout: "position",
|
|
38046
|
+
initial: { opacity: 0, y: 10 },
|
|
38047
|
+
animate: { opacity: 1, y: 0 },
|
|
38048
|
+
transition: { duration: 0.3 },
|
|
38049
|
+
className: `bg-paperBackground dark:bg-gray50 rounded-[10px] border border-gray300 hover:border-purple100 shadow-sm cursor-pointer transition-all duration-300 ease-in-out ${isExpanded ? "col-span-full border-purple100" : ""}`,
|
|
38050
|
+
style: isExpanded ? { gridColumn: "1 / -1" } : {},
|
|
38051
|
+
onClick: toggleExpanded,
|
|
38052
|
+
children: /* @__PURE__ */ jsxs89("div", { className: "flex", children: [
|
|
38053
|
+
/* @__PURE__ */ jsxs89("div", { className: `${isExpanded ? "w-1/3" : "w-full"}`, children: [
|
|
38054
|
+
/* @__PURE__ */ jsxs89("div", { className: "relative w-full aspect-square mb-2", children: [
|
|
38055
|
+
creator.profile_pic ? /* @__PURE__ */ jsx131(
|
|
38056
|
+
"img",
|
|
38057
|
+
{
|
|
38058
|
+
src: creator.profile_pic,
|
|
38059
|
+
alt: creator.name,
|
|
38060
|
+
className: "w-full h-full object-cover bg-primary/10",
|
|
38061
|
+
style: { borderRadius: "10px 10px 0 0" }
|
|
38062
|
+
}
|
|
38063
|
+
) : /* @__PURE__ */ jsx131(
|
|
38064
|
+
"div",
|
|
38065
|
+
{
|
|
38066
|
+
className: "w-full h-full bg-primary/10 flex items-center justify-center",
|
|
38067
|
+
style: { borderRadius: "10px 10px 0 0" },
|
|
38068
|
+
children: /* @__PURE__ */ jsx131("span", { className: "text-2xl text-primary", children: creator.name?.charAt(0) || "?" })
|
|
38069
|
+
}
|
|
38070
|
+
),
|
|
38071
|
+
/* @__PURE__ */ jsx131(
|
|
38072
|
+
"div",
|
|
38073
|
+
{
|
|
38074
|
+
className: `absolute bottom-2 right-2 ${getSentimentRank2(creator.sentiment?.matchScore || 0).bgColor} ${getSentimentRank2(creator.sentiment?.matchScore || 0).textColor} px-2 py-1 rounded-md text-md font-medium`,
|
|
38075
|
+
children: creator.sentiment ? `${creator.sentiment?.matchScore?.toFixed(1)}%` : "N/A"
|
|
38076
|
+
}
|
|
38077
|
+
)
|
|
38078
|
+
] }),
|
|
38079
|
+
/* @__PURE__ */ jsxs89("div", { className: "px-3 pb-1", children: [
|
|
38080
|
+
/* @__PURE__ */ jsxs89("div", { children: [
|
|
38081
|
+
/* @__PURE__ */ jsx131(
|
|
38082
|
+
"h3",
|
|
38083
|
+
{
|
|
38084
|
+
className: `${isExpanded ? "text-md" : "text-sm"} font-normal text-gray900 mb-1 line-clamp-2 text-start`,
|
|
38085
|
+
children: creator.name || "Unnamed"
|
|
38086
|
+
}
|
|
38087
|
+
),
|
|
38088
|
+
/* @__PURE__ */ jsxs89(
|
|
38089
|
+
"div",
|
|
38090
|
+
{
|
|
38091
|
+
className: `${isExpanded ? "text-sm" : "text-xs"} text-gray700 mb-1 text-start flex items-center gap-1`,
|
|
38092
|
+
children: [
|
|
38093
|
+
/* @__PURE__ */ jsx131("span", { className: "text-base", children: meta?.flag }),
|
|
38094
|
+
/* @__PURE__ */ jsx131("span", { children: meta?.name || creator.country || "Unknown" })
|
|
38095
|
+
]
|
|
38096
|
+
}
|
|
38097
|
+
),
|
|
38098
|
+
isExpanded && creator?.sentiment?.detailedScores && /* @__PURE__ */ jsx131("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsx131("div", { className: "mt-2 w-[150px] flex gap-2", children: Object.entries(creator.sentiment.detailedScores).map(
|
|
38099
|
+
([key, value]) => {
|
|
38100
|
+
const itemRank = getSentimentRank2(value);
|
|
38101
|
+
return /* @__PURE__ */ jsxs89(
|
|
38102
|
+
"div",
|
|
38103
|
+
{
|
|
38104
|
+
className: "flex flex-col items-center w-[100px]",
|
|
38105
|
+
children: [
|
|
38106
|
+
/* @__PURE__ */ jsxs89(
|
|
38107
|
+
"span",
|
|
38108
|
+
{
|
|
38109
|
+
className: `text-[14px] font-bold ${itemRank.scoreColor}`,
|
|
38110
|
+
children: [
|
|
38111
|
+
value,
|
|
38112
|
+
"%"
|
|
38113
|
+
]
|
|
38114
|
+
}
|
|
38115
|
+
),
|
|
38116
|
+
/* @__PURE__ */ jsx131("div", { className: "flex items-center justify-center gap-1 w-full", children: /* @__PURE__ */ jsx131("span", { className: "text-xs dark:text-gray500 text-center px-1", children: itemsExplanation.find(
|
|
38117
|
+
(item) => item.key === key
|
|
38118
|
+
)?.label }) })
|
|
38119
|
+
]
|
|
38120
|
+
},
|
|
38121
|
+
key
|
|
38122
|
+
);
|
|
38123
|
+
}
|
|
38124
|
+
) }) })
|
|
38125
|
+
] }),
|
|
38126
|
+
!isExpanded && /* @__PURE__ */ jsx131("div", { className: "flex gap-2 justify-between", children: platformStats.map(
|
|
38127
|
+
({ platform, icon: Icon3, followers }) => /* @__PURE__ */ jsxs89(
|
|
38128
|
+
"div",
|
|
38129
|
+
{
|
|
38130
|
+
className: "flex flex-col items-center gap-1",
|
|
38131
|
+
title: `${formatFollowerCount3(followers)} followers`,
|
|
38132
|
+
children: [
|
|
38133
|
+
/* @__PURE__ */ jsx131(
|
|
38134
|
+
Icon3,
|
|
38135
|
+
{
|
|
38136
|
+
className: `w-5 h-5 ${getPlatformIconColor(platform)}`
|
|
38137
|
+
}
|
|
38138
|
+
),
|
|
38139
|
+
/* @__PURE__ */ jsx131("span", { className: "text-xs dark:text-gray500", children: followers > 0 && formatFollowerCount3(followers) })
|
|
38140
|
+
]
|
|
38141
|
+
},
|
|
38142
|
+
platform
|
|
38143
|
+
)
|
|
38144
|
+
) })
|
|
38145
|
+
] })
|
|
38146
|
+
] }),
|
|
38147
|
+
isExpanded && /* @__PURE__ */ jsx131("div", { className: "flex-1 border-l border-gray300 p-6 overflow-hidden transition-all duration-300 ease-in-out", children: /* @__PURE__ */ jsxs89("div", { className: "space-y-4", children: [
|
|
38148
|
+
/* @__PURE__ */ jsxs89("div", { children: [
|
|
38149
|
+
/* @__PURE__ */ jsxs89(
|
|
38150
|
+
"div",
|
|
38151
|
+
{
|
|
38152
|
+
ref: descriptionRef,
|
|
38153
|
+
className: `${showFullDescription ? "" : "max-h-[80px] overflow-hidden"} relative`,
|
|
38154
|
+
children: [
|
|
38155
|
+
/* @__PURE__ */ jsx131("p", { className: "text-sm text-gray700 leading-relaxed", children: creator.description || "No description provided." }),
|
|
38156
|
+
!showFullDescription && isDescriptionOverflowing && /* @__PURE__ */ jsx131("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 h-10 bg-gradient-to-t from-gray25 to-transparent" })
|
|
38157
|
+
]
|
|
38158
|
+
}
|
|
38159
|
+
),
|
|
38160
|
+
(isDescriptionOverflowing || showFullDescription) && /* @__PURE__ */ jsx131(
|
|
38161
|
+
"button",
|
|
38162
|
+
{
|
|
38163
|
+
onClick: (e) => {
|
|
38164
|
+
e.stopPropagation();
|
|
38165
|
+
setShowFullDescription((v) => !v);
|
|
38166
|
+
},
|
|
38167
|
+
className: "mt-1 px-3 py-1 rounded border border-gray300 text-sm text-gray700 hover:text-gray900",
|
|
38168
|
+
children: showFullDescription ? "Show less" : "Show more"
|
|
38169
|
+
}
|
|
38170
|
+
)
|
|
38171
|
+
] }),
|
|
38172
|
+
/* @__PURE__ */ jsx131("div", { className: "flex gap-6 justify-start items-center", children: platformStats.map(
|
|
38173
|
+
({ platform, icon: Icon3, followers, engagement }) => /* @__PURE__ */ jsxs89("div", { className: "flex items-center gap-3", children: [
|
|
38174
|
+
/* @__PURE__ */ jsxs89(
|
|
38175
|
+
"div",
|
|
38176
|
+
{
|
|
38177
|
+
className: "flex items-center gap-1",
|
|
38178
|
+
title: `${formatFollowerCount3(followers)} followers`,
|
|
38179
|
+
children: [
|
|
38180
|
+
/* @__PURE__ */ jsx131(
|
|
38181
|
+
Icon3,
|
|
38182
|
+
{
|
|
38183
|
+
className: `w-5 h-5 ${getPlatformIconColor(platform)}`
|
|
38184
|
+
}
|
|
38185
|
+
),
|
|
38186
|
+
/* @__PURE__ */ jsx131("span", { className: "text-xs dark:text-gray500", children: followers > 0 ? formatFollowerCount3(followers) : "0" })
|
|
38187
|
+
]
|
|
38188
|
+
}
|
|
38189
|
+
),
|
|
38190
|
+
/* @__PURE__ */ jsxs89("div", { className: "flex items-center gap-1", children: [
|
|
38191
|
+
/* @__PURE__ */ jsx131(ChartColumn, { className: "w-5 h-5 dark:text-gray500" }),
|
|
38192
|
+
/* @__PURE__ */ jsxs89("span", { className: "text-sm dark:text-gray500 w-[40px]", children: [
|
|
38193
|
+
(engagement * 100).toFixed(1),
|
|
38194
|
+
"%"
|
|
38195
|
+
] })
|
|
38196
|
+
] })
|
|
38197
|
+
] }, platform)
|
|
38198
|
+
) }),
|
|
38199
|
+
creator.posts?.length > 0 && /* @__PURE__ */ jsxs89("div", { className: "w-full overflow-hidden", children: [
|
|
38200
|
+
/* @__PURE__ */ jsx131("h3", { className: "mb-2 text-sm font-medium text-gray900", children: "Recent Posts" }),
|
|
38201
|
+
/* @__PURE__ */ jsx131("div", { className: "flex gap-3 overflow-x-auto", children: creator.posts.filter(
|
|
38202
|
+
(post) => post.thumbnail || post.thumbnail_url
|
|
38203
|
+
).slice(0, 8).map((post, idx) => /* @__PURE__ */ jsx131(
|
|
38204
|
+
"a",
|
|
38205
|
+
{
|
|
38206
|
+
href: post.url || "#",
|
|
38207
|
+
target: "_blank",
|
|
38208
|
+
rel: "noopener noreferrer",
|
|
38209
|
+
className: "block flex-shrink-0",
|
|
38210
|
+
onClick: (e) => e.stopPropagation(),
|
|
38211
|
+
children: /* @__PURE__ */ jsx131(
|
|
38212
|
+
"img",
|
|
38213
|
+
{
|
|
38214
|
+
src: post.thumbnail_url || post.thumbnail,
|
|
38215
|
+
alt: post.title || `Post ${idx + 1}`,
|
|
38216
|
+
className: "rounded-md object-cover w-[120px] h-[120px]"
|
|
38217
|
+
}
|
|
38218
|
+
)
|
|
38219
|
+
},
|
|
38220
|
+
idx
|
|
38221
|
+
)) })
|
|
38222
|
+
] }),
|
|
38223
|
+
creator?.sentiment?.aiReasoning && /* @__PURE__ */ jsxs89("div", { className: "text-gray700 max-h-[200px] overflow-auto", children: [
|
|
38224
|
+
/* @__PURE__ */ jsx131("h4", { className: "font-semibold text-sm", children: "AI Analysis" }),
|
|
38225
|
+
/* @__PURE__ */ jsx131("p", { className: "text-sm", children: creator.sentiment.aiReasoning })
|
|
38226
|
+
] })
|
|
38227
|
+
] }) })
|
|
38228
|
+
] })
|
|
38229
|
+
}
|
|
38230
|
+
);
|
|
38231
|
+
}
|
|
38232
|
+
function CreatorGridView({
|
|
38233
|
+
creatorData
|
|
38234
|
+
}) {
|
|
38235
|
+
return /* @__PURE__ */ jsx131("div", { className: "grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 [&>*]:transition-all [&>*]:duration-300 auto-rows-min relative grid-flow-dense", children: creatorData.map((creator) => /* @__PURE__ */ jsx131(CreatorGridViewCard, { creator }, creator._id)) });
|
|
38236
|
+
}
|
|
38237
|
+
|
|
38238
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorExpandedPanel.tsx
|
|
38239
|
+
import { Fragment as Fragment8, jsx as jsx132, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
38240
|
+
var formatFollowerCount4 = (count) => {
|
|
38241
|
+
if (count >= 1e6) {
|
|
38242
|
+
const millions = count / 1e6;
|
|
38243
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
38244
|
+
} else if (count >= 1e4) {
|
|
38245
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
38246
|
+
} else if (count >= 1e3) {
|
|
38247
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
38248
|
+
}
|
|
38249
|
+
return Math.floor(count).toString();
|
|
38250
|
+
};
|
|
38251
|
+
var getSentimentRank3 = (score) => {
|
|
38252
|
+
if (score >= 80) {
|
|
38253
|
+
return {
|
|
38254
|
+
rank: "STRONG FIT",
|
|
38255
|
+
bgColor: "bg-greenBackground",
|
|
38256
|
+
textColor: "text-greenText",
|
|
38257
|
+
scoreColor: "text-[#499C54]"
|
|
38258
|
+
};
|
|
38259
|
+
} else if (score >= 50) {
|
|
38260
|
+
return {
|
|
38261
|
+
rank: "MODERATE FIT",
|
|
38262
|
+
bgColor: "bg-orangeBackground",
|
|
38263
|
+
textColor: "text-orangeText",
|
|
38264
|
+
scoreColor: "text-[#B3512F]"
|
|
38265
|
+
};
|
|
38266
|
+
} else if (score >= 0) {
|
|
38267
|
+
return {
|
|
38268
|
+
rank: "POOR FIT",
|
|
38269
|
+
bgColor: "bg-redBackground",
|
|
38270
|
+
textColor: "text-redText",
|
|
38271
|
+
scoreColor: "text-[#BE2C35]"
|
|
38272
|
+
};
|
|
38273
|
+
}
|
|
38274
|
+
return {
|
|
38275
|
+
rank: "Unranked",
|
|
38276
|
+
bgColor: "bg-gray500",
|
|
38277
|
+
textColor: "text-gray200",
|
|
38278
|
+
scoreColor: "text-gray500"
|
|
38279
|
+
};
|
|
38280
|
+
};
|
|
38281
|
+
function formatCreator(raw) {
|
|
38282
|
+
return {
|
|
38283
|
+
_id: raw.creator_id || raw.profile?.upfluenceId,
|
|
38284
|
+
name: raw.profile?.name || "",
|
|
38285
|
+
description: raw.profile?.description || "",
|
|
38286
|
+
isVerified: raw.profile?.isVerified || false,
|
|
38287
|
+
country: raw.profile?.country || "",
|
|
38288
|
+
profile_pic: raw.profile?.profilePicture || "",
|
|
38289
|
+
platforms: raw.profile?.platforms,
|
|
38290
|
+
platformMetrics: raw.platformMetrics || {},
|
|
38291
|
+
metrics: {
|
|
38292
|
+
instagram: {
|
|
38293
|
+
engagement: raw.platformMetrics?.instagramMetrics?.engagementRate || 0,
|
|
38294
|
+
followers: raw.platformMetrics?.instagramMetrics?.followers || 0,
|
|
38295
|
+
avgLikes: raw.platformMetrics?.instagramMetrics?.avgLikes || 0,
|
|
38296
|
+
avgComments: raw.platformMetrics?.instagramMetrics?.avgComments || 0
|
|
38297
|
+
},
|
|
38298
|
+
youtube: {
|
|
38299
|
+
engagement: raw.platformMetrics?.youtubeMetrics?.engagementRate || 0,
|
|
38300
|
+
followers: raw.platformMetrics?.youtubeMetrics?.subscribers || 0,
|
|
38301
|
+
avgLikes: raw.platformMetrics?.youtubeMetrics?.avgLikes || 0,
|
|
38302
|
+
avgComments: raw.platformMetrics?.youtubeMetrics?.avgComments || 0
|
|
38303
|
+
},
|
|
38304
|
+
tiktok: {
|
|
38305
|
+
engagement: raw.platformMetrics?.tiktokMetrics?.engagementRate || 0,
|
|
38306
|
+
followers: raw.platformMetrics?.tiktokMetrics?.followers || 0,
|
|
38307
|
+
avgLikes: raw.platformMetrics?.tiktokMetrics?.avgLikes || 0,
|
|
38308
|
+
avgComments: raw.platformMetrics?.tiktokMetrics?.avgComments || 0
|
|
38309
|
+
}
|
|
38310
|
+
},
|
|
38311
|
+
posts: raw.posts || [],
|
|
38312
|
+
sentiment: raw.sentiment || null,
|
|
38313
|
+
audienceDemographics: raw.audienceDemographics || null,
|
|
38314
|
+
brandCollaborations: raw.brandCollaborations || null,
|
|
38315
|
+
profile: raw.profile || {}
|
|
38316
|
+
};
|
|
38317
|
+
}
|
|
38318
|
+
var truncateName2 = (name, maxLen) => {
|
|
38319
|
+
if (!name) return "";
|
|
38320
|
+
return name.length > maxLen ? name.slice(0, maxLen) + "..." : name;
|
|
38321
|
+
};
|
|
38322
|
+
function SearchSpecDisplay({ spec }) {
|
|
38323
|
+
if (!spec) return null;
|
|
38324
|
+
const priorityOneBundles = Array.isArray(spec?.keyword_bundles) ? spec.keyword_bundles.filter((b) => b?.priority !== void 0 ? b.priority === 1 : true).flatMap((b) => b?.keywords || []) : [];
|
|
38325
|
+
const textClass = "text-sm text-white dark:text-gray900";
|
|
38326
|
+
const paddingClass = "px-4 py-1";
|
|
38327
|
+
const roundedClass = "rounded-lg";
|
|
38328
|
+
const tagClass = `${textClass} ${paddingClass} bg-[#85888f] dark:bg-[rgba(249,249,249,0.2)] ${roundedClass} border border-[#85888f] dark:border-gray800 font-medium`;
|
|
38329
|
+
const items = [
|
|
38330
|
+
{
|
|
38331
|
+
key: "platforms",
|
|
38332
|
+
title: "Platforms",
|
|
38333
|
+
content: /* @__PURE__ */ jsx132("div", { className: "flex flex-wrap gap-2", children: (spec.platforms || []).filter((p) => ["instagram", "youtube", "tiktok"].includes(p.toLowerCase())).map((p, idx) => /* @__PURE__ */ jsx132("span", { className: `${tagClass} flex items-center justify-center`, children: p.charAt(0).toUpperCase() + p.slice(1).toLowerCase() }, idx)) })
|
|
38334
|
+
},
|
|
38335
|
+
{
|
|
38336
|
+
key: "follower_range",
|
|
38337
|
+
title: "Follower Range",
|
|
38338
|
+
content: /* @__PURE__ */ jsxs90("div", { className: `inline-block ${tagClass} font-grotesk`, children: [
|
|
38339
|
+
formatFollowerCount4(spec?.follower_range?.min ?? 0),
|
|
38340
|
+
" -",
|
|
38341
|
+
" ",
|
|
38342
|
+
formatFollowerCount4(spec?.follower_range?.max ?? 0)
|
|
38343
|
+
] })
|
|
38344
|
+
},
|
|
38345
|
+
{
|
|
38346
|
+
key: "geography",
|
|
38347
|
+
title: "Geography",
|
|
38348
|
+
content: /* @__PURE__ */ jsx132("div", { className: `inline-block ${tagClass} font-grotesk`, children: /* @__PURE__ */ jsx132(
|
|
38349
|
+
"div",
|
|
38350
|
+
{
|
|
38351
|
+
className: "max-w-[200px] overflow-x-auto whitespace-nowrap",
|
|
38352
|
+
style: { scrollbarWidth: "none", textOverflow: "ellipsis", overflow: "hidden" },
|
|
38353
|
+
onMouseEnter: (e) => {
|
|
38354
|
+
e.currentTarget.style.textOverflow = "clip";
|
|
38355
|
+
e.currentTarget.style.overflow = "auto";
|
|
38356
|
+
},
|
|
38357
|
+
onMouseLeave: (e) => {
|
|
38358
|
+
e.currentTarget.style.textOverflow = "ellipsis";
|
|
38359
|
+
e.currentTarget.style.overflow = "hidden";
|
|
38360
|
+
e.currentTarget.scrollLeft = 0;
|
|
38361
|
+
},
|
|
38362
|
+
children: (spec.geography || []).map((g, idx) => /* @__PURE__ */ jsxs90("span", { children: [
|
|
38363
|
+
g,
|
|
38364
|
+
idx < spec.geography.length - 1 ? ", " : ""
|
|
38365
|
+
] }, idx))
|
|
36797
38366
|
}
|
|
36798
38367
|
) })
|
|
38368
|
+
},
|
|
38369
|
+
{
|
|
38370
|
+
key: "keyword_bundles",
|
|
38371
|
+
title: "Keyword",
|
|
38372
|
+
content: /* @__PURE__ */ jsx132("div", { className: "flex gap-2 font-grotesk font-medium max-w-[500px] overflow-x-auto whitespace-nowrap", style: { scrollbarWidth: "none" }, children: priorityOneBundles.length === 0 ? /* @__PURE__ */ jsx132("div", { className: `${textClass} text-white/70`, children: "No priority 1 keywords" }) : priorityOneBundles.map((kw, idx) => /* @__PURE__ */ jsx132("span", { className: tagClass, children: kw }, idx)) })
|
|
36799
38373
|
}
|
|
36800
|
-
|
|
38374
|
+
];
|
|
38375
|
+
const itemsToShow = ["platforms", "follower_range", "geography", "keyword_bundles"];
|
|
38376
|
+
return /* @__PURE__ */ jsx132("div", { className: "mt-3", children: /* @__PURE__ */ jsx132("div", { className: "flex gap-4 pr-[30px] overflow-x-auto", style: { scrollbarWidth: "none" }, children: items.filter(({ key }) => itemsToShow.includes(key) && spec?.[key] !== void 0 && spec?.[key] !== null).map(({ key, title, content }) => /* @__PURE__ */ jsxs90("div", { className: "flex-none p-5 bg-paperBackground rounded-lg", children: [
|
|
38377
|
+
/* @__PURE__ */ jsx132("div", { className: "text-purpleText text-sm mb-4", children: /* @__PURE__ */ jsx132("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: title.toUpperCase() }) }),
|
|
38378
|
+
/* @__PURE__ */ jsx132("div", { className: `flex text-gray900 ${textClass}`, children: content })
|
|
38379
|
+
] }, key)) }) });
|
|
36801
38380
|
}
|
|
36802
|
-
function
|
|
36803
|
-
|
|
36804
|
-
|
|
38381
|
+
function SentimentScoreRank({
|
|
38382
|
+
score,
|
|
38383
|
+
isValidationComplete,
|
|
38384
|
+
showMinialView = false
|
|
36805
38385
|
}) {
|
|
36806
|
-
|
|
36807
|
-
|
|
36808
|
-
/* @__PURE__ */
|
|
36809
|
-
|
|
36810
|
-
|
|
36811
|
-
|
|
36812
|
-
|
|
36813
|
-
|
|
36814
|
-
|
|
36815
|
-
|
|
36816
|
-
/* @__PURE__ */
|
|
36817
|
-
/* @__PURE__ */ jsx124("div", { className: "w-40 h-6 bg-purple200 rounded-md animate-pulse" }),
|
|
36818
|
-
/* @__PURE__ */ jsx124("div", { className: "w-64 h-7 bg-gray200 dark:bg-gray300 rounded animate-pulse" })
|
|
36819
|
-
] }) }),
|
|
36820
|
-
/* @__PURE__ */ jsxs83("div", { className: "bg-paperBackground rounded-lg px-3 md:px-4 py-4 md:py-5 flex flex-col md:flex-row md:items-center md:justify-between gap-4 md:gap-0", children: [
|
|
36821
|
-
/* @__PURE__ */ jsxs83("div", { className: "flex flex-col gap-4 md:gap-6 min-w-0", children: [
|
|
36822
|
-
/* @__PURE__ */ jsx124("div", { className: "flex -space-x-2", children: Array.from({ length: 10 }).map((_, idx) => /* @__PURE__ */ jsx124(
|
|
36823
|
-
"div",
|
|
36824
|
-
{
|
|
36825
|
-
className: "w-8 h-8 md:w-10 md:h-10 rounded-full border-2 border-gray300 bg-gray200 animate-pulse"
|
|
36826
|
-
},
|
|
36827
|
-
idx
|
|
36828
|
-
)) }),
|
|
36829
|
-
/* @__PURE__ */ jsx124("div", { className: "space-y-2", children: /* @__PURE__ */ jsx124("div", { className: "w-full max-w-xs bg-gray200 rounded-full h-2 animate-pulse" }) })
|
|
36830
|
-
] }),
|
|
36831
|
-
/* @__PURE__ */ jsx124("div", { className: "px-6 py-2 bg-gray200 rounded-[30px] animate-pulse h-10 w-48" })
|
|
36832
|
-
] })
|
|
38386
|
+
const sentimentScoreRank = getSentimentRank3(score);
|
|
38387
|
+
return /* @__PURE__ */ jsx132("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ jsxs90("div", { className: `flex flex-col justify-end ${showMinialView ? "w-[120px]" : "w-[150px]"} text-sm`, children: [
|
|
38388
|
+
score !== void 0 && /* @__PURE__ */ jsx132("div", { className: "flex justify-center items-center mb-2", children: /* @__PURE__ */ jsx132(
|
|
38389
|
+
"span",
|
|
38390
|
+
{
|
|
38391
|
+
className: `${isValidationComplete ? sentimentScoreRank.bgColor : "bg-gray500"} ${isValidationComplete ? sentimentScoreRank.textColor : "text-gray200"} text-center rounded-md ${showMinialView ? "text-xs px-[6px] py-[2px]" : "text-sm px-2 py-[2px]"}`,
|
|
38392
|
+
children: isValidationComplete ? sentimentScoreRank.rank : "Unranked"
|
|
38393
|
+
}
|
|
38394
|
+
) }),
|
|
38395
|
+
/* @__PURE__ */ jsx132("div", { className: `flex justify-center ${showMinialView ? "text-[24px]" : "text-[28px]"} font-bold mb-3 ${sentimentScoreRank.scoreColor}`, children: isValidationComplete ? score >= 0 ? `${score}%` : "0%" : /* @__PURE__ */ jsx132("div", { className: "flex items-center justify-center py-2", children: /* @__PURE__ */ jsx132("div", { className: "w-6 h-6 border-2 border-purple100 border-t-transparent rounded-full animate-spin" }) }) }),
|
|
38396
|
+
!showMinialView && /* @__PURE__ */ jsx132("p", { className: "text-gray600 dark:text-gray500 text-center", children: "Match Score" })
|
|
36833
38397
|
] }) });
|
|
36834
38398
|
}
|
|
36835
|
-
|
|
36836
|
-
|
|
36837
|
-
|
|
36838
|
-
|
|
36839
|
-
|
|
36840
|
-
|
|
36841
|
-
creatorImages,
|
|
36842
|
-
creatorLength,
|
|
36843
|
-
isAgentOutput,
|
|
36844
|
-
onVersionSelect,
|
|
36845
|
-
onViewCreators,
|
|
36846
|
-
versionStatus,
|
|
36847
|
-
statusDetails,
|
|
36848
|
-
timeDisplay,
|
|
36849
|
-
isLoading
|
|
36850
|
-
}) {
|
|
36851
|
-
const isComplete = versionStatus === "completed" || versionStatus === "complete";
|
|
36852
|
-
const statusTitle = isComplete ? "Creator Search Complete" : versionStatus === "failed" ? "Creator Search Failed" : "Creator Search Processing";
|
|
36853
|
-
if (isLoading) {
|
|
36854
|
-
return /* @__PURE__ */ jsx125(CreatorWidgetSkeleton, {});
|
|
38399
|
+
function BrandMentionPerformance({ creator }) {
|
|
38400
|
+
const insights = creator?.brandCollaborations?.insights;
|
|
38401
|
+
if (!insights) return null;
|
|
38402
|
+
const isValid2 = (val) => val !== null && val !== void 0 && val !== 0 && val !== "0" && val !== "" && !Number.isNaN(val);
|
|
38403
|
+
if (!isValid2(insights.averageBrandEngagementRate) && !isValid2(insights.effectivenessPercent) && !isValid2(insights.saturationRate)) {
|
|
38404
|
+
return null;
|
|
36855
38405
|
}
|
|
36856
|
-
|
|
36857
|
-
|
|
36858
|
-
|
|
36859
|
-
|
|
36860
|
-
|
|
38406
|
+
const metrics = [
|
|
38407
|
+
{ title: "Avg engagement rate", subtitle: "on brand mention", value: `${insights?.averageBrandEngagementRate || 0} %` },
|
|
38408
|
+
{ title: "Effectiveness", subtitle: "compared to all posts", value: `${insights?.effectivenessPercent || 0} %` },
|
|
38409
|
+
{ title: "Saturation Rate", subtitle: "on brand mention", value: `${insights?.saturationRate || 0} %` }
|
|
38410
|
+
];
|
|
38411
|
+
return /* @__PURE__ */ jsxs90("div", { children: [
|
|
38412
|
+
/* @__PURE__ */ jsx132("div", { className: "text-purpleText text-xs mb-4", children: /* @__PURE__ */ jsx132("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "BRAND MENTION PERFORMANCE" }) }),
|
|
38413
|
+
/* @__PURE__ */ jsx132("div", { className: "flex flex-col gap-3", children: metrics.map((item) => /* @__PURE__ */ jsxs90("div", { className: "flex justify-between items-center text-gray700 text-sm", children: [
|
|
38414
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex flex-col gap-1", children: [
|
|
38415
|
+
/* @__PURE__ */ jsx132("h5", { children: item.title }),
|
|
38416
|
+
/* @__PURE__ */ jsx132("p", { className: "text-xs", children: item.subtitle })
|
|
36861
38417
|
] }),
|
|
36862
|
-
|
|
36863
|
-
|
|
36864
|
-
|
|
38418
|
+
/* @__PURE__ */ jsx132("p", { className: "text-purpleText text-lg", children: item.value })
|
|
38419
|
+
] }, item.title)) })
|
|
38420
|
+
] });
|
|
38421
|
+
}
|
|
38422
|
+
function CreatorFitSummary({ creator, showBrandPerformance }) {
|
|
38423
|
+
const hasDeepAnalysis = creator?.sentiment?.deepAnalysis?.deepAnalysis;
|
|
38424
|
+
const title = hasDeepAnalysis ? "CREATOR DEEP ANALYSIS" : "CREATOR FIT SUMMARY";
|
|
38425
|
+
const content = hasDeepAnalysis ? creator.sentiment.deepAnalysis.deepAnalysis : creator?.sentiment?.aiReasoning || "No data available.";
|
|
38426
|
+
return /* @__PURE__ */ jsxs90("div", { className: showBrandPerformance ? "col-span-1" : "col-span-2", children: [
|
|
38427
|
+
/* @__PURE__ */ jsx132("div", { className: "text-purpleText text-xs mb-4", children: /* @__PURE__ */ jsx132("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: title }) }),
|
|
38428
|
+
/* @__PURE__ */ jsx132("div", { className: "max-h-[140px] overflow-y-auto slim-scrollbar", children: /* @__PURE__ */ jsx132("p", { className: "text-gray700 text-sm", children: content }) })
|
|
38429
|
+
] });
|
|
38430
|
+
}
|
|
38431
|
+
function ProfileSection({ creator, isValidationComplete }) {
|
|
38432
|
+
const username = creator.platformMetrics?.instagramMetrics?.username ? `@${creator.platformMetrics.instagramMetrics.username}` : creator.platformMetrics?.youtubeMetrics?.channelName ? `@${creator.platformMetrics.youtubeMetrics.channelName}` : creator.platformMetrics?.tiktokMetrics?.username ? `@${creator.platformMetrics.tiktokMetrics.username}` : "";
|
|
38433
|
+
const iso2 = normalizeToIso2(creator.country);
|
|
38434
|
+
const meta = codeToMeta[iso2];
|
|
38435
|
+
return /* @__PURE__ */ jsxs90("div", { className: "flex items-start gap-1 md:gap-6", children: [
|
|
38436
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex flex-col items-center gap-6", children: [
|
|
38437
|
+
/* @__PURE__ */ jsx132("div", { className: "w-[5rem] h-[5rem] rounded-[10px] bg-primary/10 flex items-center justify-center flex-shrink-0 relative overflow-hidden", children: creator.profile_pic ? /* @__PURE__ */ jsxs90(Fragment8, { children: [
|
|
38438
|
+
/* @__PURE__ */ jsx132(
|
|
38439
|
+
"img",
|
|
36865
38440
|
{
|
|
36866
|
-
|
|
36867
|
-
|
|
36868
|
-
|
|
36869
|
-
"Version ",
|
|
36870
|
-
selectedVersion ?? "-",
|
|
36871
|
-
/* @__PURE__ */ jsx125(ChevronDown, { className: "w-3 h-3 md:w-4 md:h-4 transition-transform" })
|
|
36872
|
-
]
|
|
38441
|
+
src: creator.profile_pic,
|
|
38442
|
+
alt: creator.name,
|
|
38443
|
+
className: "object-cover w-[5rem] h-[5rem] rounded-[15px]"
|
|
36873
38444
|
}
|
|
36874
38445
|
),
|
|
36875
|
-
|
|
36876
|
-
|
|
38446
|
+
creator?.profile?.isVerified && /* @__PURE__ */ jsx132(
|
|
38447
|
+
BadgeCheck,
|
|
36877
38448
|
{
|
|
36878
|
-
|
|
36879
|
-
className: "
|
|
36880
|
-
|
|
36881
|
-
|
|
36882
|
-
|
|
36883
|
-
|
|
36884
|
-
},
|
|
36885
|
-
v
|
|
36886
|
-
)) })
|
|
36887
|
-
] }) })
|
|
38449
|
+
size: 35,
|
|
38450
|
+
className: "absolute -top-2 -right-2 text-blue-500 drop-shadow-sm fill-blue-300"
|
|
38451
|
+
}
|
|
38452
|
+
)
|
|
38453
|
+
] }) : /* @__PURE__ */ jsx132("span", { className: "text-2xl text-primary", children: creator.name?.charAt(0) || "?" }) }),
|
|
38454
|
+
/* @__PURE__ */ jsx132("div", { className: "block sm:hidden", children: /* @__PURE__ */ jsx132(SentimentScoreRank, { score: creator?.sentiment?.matchScore || -1, isValidationComplete, showMinialView: true }) })
|
|
36888
38455
|
] }),
|
|
36889
|
-
/* @__PURE__ */
|
|
36890
|
-
/* @__PURE__ */
|
|
36891
|
-
/* @__PURE__ */
|
|
36892
|
-
|
|
36893
|
-
|
|
36894
|
-
/* @__PURE__ */
|
|
36895
|
-
|
|
38456
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex flex-col gap-3 truncate", children: [
|
|
38457
|
+
/* @__PURE__ */ jsx132("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx132("h4", { className: "text-lg text-gray900 max-w-[150px]", title: creator.name, children: truncateName2(creator.name, 100) }) }),
|
|
38458
|
+
username && /* @__PURE__ */ jsx132("div", { className: "text-xs text-gray700", children: username }),
|
|
38459
|
+
/* @__PURE__ */ jsxs90("div", { className: "text-sm text-gray700 flex items-center gap-2", children: [
|
|
38460
|
+
/* @__PURE__ */ jsx132("span", { className: "text-base", children: meta?.flag }),
|
|
38461
|
+
/* @__PURE__ */ jsx132("span", { children: meta?.name || creator.country || "Unknown" })
|
|
38462
|
+
] }),
|
|
38463
|
+
/* @__PURE__ */ jsx132("div", { className: "text-xs text-gray700 text-wrap", children: truncateName2(creator.description, 100) })
|
|
38464
|
+
] })
|
|
38465
|
+
] });
|
|
38466
|
+
}
|
|
38467
|
+
function CreatorCardExpandedSection({
|
|
38468
|
+
creator
|
|
38469
|
+
}) {
|
|
38470
|
+
const hasBrandBreakdown = creator?.brandCollaborations?.insights?.brandBreakdown && creator?.sentiment?.deepAnalysis;
|
|
38471
|
+
return /* @__PURE__ */ jsxs90(
|
|
38472
|
+
motion5.div,
|
|
38473
|
+
{
|
|
38474
|
+
initial: { y: 20, opacity: 0 },
|
|
38475
|
+
animate: { y: 0, opacity: 1 },
|
|
38476
|
+
transition: { duration: 0.3, delay: 0.1 },
|
|
38477
|
+
className: "md:mt-6 space-y-5",
|
|
38478
|
+
children: [
|
|
38479
|
+
/* @__PURE__ */ jsxs90("div", { className: "md:grid md:grid-cols-[1.3fr_1fr_2fr_120px] gap-8 py-4 pr-7", children: [
|
|
38480
|
+
/* @__PURE__ */ jsx132("div", { className: "col-span-4 sm:col-span-1", children: hasBrandBreakdown ? /* @__PURE__ */ jsx132(
|
|
38481
|
+
BrandCollaborationsList,
|
|
38482
|
+
{
|
|
38483
|
+
brandBreakdown: creator?.brandCollaborations
|
|
38484
|
+
}
|
|
38485
|
+
) : /* @__PURE__ */ jsx132("div", { className: "hidden sm:block" }) }),
|
|
38486
|
+
/* @__PURE__ */ jsx132("div", { className: "col-span-4 sm:col-span-3", children: creator?.audienceDemographics ? /* @__PURE__ */ jsx132(
|
|
38487
|
+
EngagedAudienceDemographics,
|
|
38488
|
+
{
|
|
38489
|
+
audienceDemographics: creator.audienceDemographics
|
|
38490
|
+
}
|
|
38491
|
+
) : null })
|
|
38492
|
+
] }),
|
|
38493
|
+
/* @__PURE__ */ jsx132(
|
|
38494
|
+
PlatformPostsSection,
|
|
36896
38495
|
{
|
|
36897
|
-
|
|
36898
|
-
|
|
36899
|
-
isAgentOutput,
|
|
36900
|
-
initialCreatorsPercentage: statusDetails?.social_fetch_percentage
|
|
38496
|
+
platformMetrics: creator.platformMetrics,
|
|
38497
|
+
posts: creator.posts ?? creator.post
|
|
36901
38498
|
}
|
|
36902
|
-
)
|
|
36903
|
-
|
|
36904
|
-
|
|
38499
|
+
)
|
|
38500
|
+
]
|
|
38501
|
+
}
|
|
38502
|
+
);
|
|
38503
|
+
}
|
|
38504
|
+
function CreatorCard({
|
|
38505
|
+
creator,
|
|
38506
|
+
isValidationComplete
|
|
38507
|
+
}) {
|
|
38508
|
+
const [detailsExpanded, setDetailsExpanded] = useState15(false);
|
|
38509
|
+
const hasValidBrandMention = (() => {
|
|
38510
|
+
const insights = creator?.brandCollaborations?.insights;
|
|
38511
|
+
if (!insights) return false;
|
|
38512
|
+
const isValid2 = (val) => val !== null && val !== void 0 && val !== 0 && val !== "0" && val !== "" && !Number.isNaN(val);
|
|
38513
|
+
return isValid2(insights.averageBrandEngagementRate) || isValid2(insights.effectivenessPercent) || isValid2(insights.saturationRate);
|
|
38514
|
+
})();
|
|
38515
|
+
return /* @__PURE__ */ jsxs90(
|
|
38516
|
+
motion5.div,
|
|
38517
|
+
{
|
|
38518
|
+
layout: true,
|
|
38519
|
+
initial: { opacity: 0, y: 20 },
|
|
38520
|
+
animate: { opacity: 1, y: 0 },
|
|
38521
|
+
exit: { opacity: 0, y: -20 },
|
|
38522
|
+
transition: { duration: 0.4, ease: [0.22, 1, 0.36, 1] },
|
|
38523
|
+
className: `flex flex-col bg-paperBackground rounded-[25px] py-5 pl-7 border-2 shadow-sm cursor-pointer transition-all ${detailsExpanded ? "border-purple100" : "border-gray300"}`,
|
|
38524
|
+
onClick: () => setDetailsExpanded((prev) => !prev),
|
|
38525
|
+
children: [
|
|
38526
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex flex-col gap-4 sm:grid sm:grid-cols-[1.3fr_1fr_2fr_120px] gap-8 items-start w-full pr-7", children: [
|
|
38527
|
+
/* @__PURE__ */ jsx132(ProfileSection, { creator, isValidationComplete }),
|
|
38528
|
+
hasValidBrandMention && /* @__PURE__ */ jsx132(BrandMentionPerformance, { creator }),
|
|
38529
|
+
/* @__PURE__ */ jsx132(CreatorFitSummary, { creator, showBrandPerformance: hasValidBrandMention }),
|
|
38530
|
+
/* @__PURE__ */ jsx132("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx132(SentimentScoreRank, { score: creator?.sentiment?.matchScore || -1, isValidationComplete }) })
|
|
38531
|
+
] }),
|
|
38532
|
+
/* @__PURE__ */ jsx132(AnimatePresence4, { children: detailsExpanded && /* @__PURE__ */ jsx132(
|
|
38533
|
+
motion5.div,
|
|
36905
38534
|
{
|
|
36906
|
-
|
|
36907
|
-
|
|
38535
|
+
initial: { height: 0, opacity: 0 },
|
|
38536
|
+
animate: { height: "auto", opacity: 1, transition: { height: { duration: 0.4, ease: [0.04, 0.62, 0.23, 0.98] }, opacity: { duration: 0.3, delay: 0.1 } } },
|
|
38537
|
+
exit: { height: 0, opacity: 0, transition: { height: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] }, opacity: { duration: 0.2 } } },
|
|
38538
|
+
className: "overflow-hidden mt-4",
|
|
38539
|
+
children: /* @__PURE__ */ jsx132(CreatorCardExpandedSection, { creator })
|
|
36908
38540
|
}
|
|
36909
|
-
)
|
|
38541
|
+
) })
|
|
38542
|
+
]
|
|
38543
|
+
}
|
|
38544
|
+
);
|
|
38545
|
+
}
|
|
38546
|
+
function CreatorDisplay({
|
|
38547
|
+
creators,
|
|
38548
|
+
isValidationComplete
|
|
38549
|
+
}) {
|
|
38550
|
+
const [viewMode, setViewMode] = useState15("list");
|
|
38551
|
+
return /* @__PURE__ */ jsxs90("div", { className: "px-4", children: [
|
|
38552
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex justify-end items-center my-3 gap-1", children: [
|
|
38553
|
+
/* @__PURE__ */ jsxs90("span", { className: "text-xs text-gray600 mr-2", children: [
|
|
38554
|
+
creators.length,
|
|
38555
|
+
" creators"
|
|
36910
38556
|
] }),
|
|
36911
|
-
/* @__PURE__ */
|
|
38557
|
+
/* @__PURE__ */ jsx132(
|
|
36912
38558
|
"button",
|
|
36913
38559
|
{
|
|
36914
|
-
className: `
|
|
36915
|
-
onClick:
|
|
36916
|
-
|
|
36917
|
-
|
|
36918
|
-
|
|
36919
|
-
|
|
36920
|
-
|
|
36921
|
-
|
|
36922
|
-
|
|
38560
|
+
className: `h-7 w-7 flex items-center justify-center rounded ${viewMode === "list" ? "bg-gray200" : ""}`,
|
|
38561
|
+
onClick: () => setViewMode("list"),
|
|
38562
|
+
children: /* @__PURE__ */ jsx132(
|
|
38563
|
+
AlignJustify,
|
|
38564
|
+
{
|
|
38565
|
+
className: `h-5 w-5 ${viewMode === "list" ? "text-gray900 dark:text-white" : "text-gray500"}`
|
|
38566
|
+
}
|
|
38567
|
+
)
|
|
38568
|
+
}
|
|
38569
|
+
),
|
|
38570
|
+
/* @__PURE__ */ jsx132(
|
|
38571
|
+
"button",
|
|
38572
|
+
{
|
|
38573
|
+
className: `h-7 w-7 flex items-center justify-center rounded ${viewMode === "grid" ? "bg-gray200" : ""}`,
|
|
38574
|
+
onClick: () => setViewMode("grid"),
|
|
38575
|
+
children: /* @__PURE__ */ jsx132(
|
|
38576
|
+
LayoutGrid,
|
|
38577
|
+
{
|
|
38578
|
+
className: `h-5 w-5 ${viewMode === "grid" ? "text-gray900 dark:text-white" : "text-gray500"}`
|
|
38579
|
+
}
|
|
38580
|
+
)
|
|
36923
38581
|
}
|
|
36924
38582
|
)
|
|
36925
|
-
] })
|
|
36926
|
-
|
|
38583
|
+
] }),
|
|
38584
|
+
creators.length > 0 ? viewMode === "list" ? /* @__PURE__ */ jsx132("div", { className: "space-y-4", children: creators.map((creator) => /* @__PURE__ */ jsx132(CreatorCard, { creator, isValidationComplete }, creator._id)) }) : /* @__PURE__ */ jsx132(CreatorGridView, { creatorData: creators }) : /* @__PURE__ */ jsxs90("div", { className: "text-center py-8 bg-gray100 rounded-lg border border-gray300", children: [
|
|
38585
|
+
/* @__PURE__ */ jsx132("div", { className: "w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ jsx132(Users, { className: "w-6 h-6 text-primary" }) }),
|
|
38586
|
+
/* @__PURE__ */ jsx132("h3", { className: "text-base font-medium text-gray900", children: "No creators found" }),
|
|
38587
|
+
/* @__PURE__ */ jsx132("p", { className: "mt-1 text-sm text-gray600", children: "Try adjusting your search criteria" })
|
|
38588
|
+
] })
|
|
38589
|
+
] });
|
|
38590
|
+
}
|
|
38591
|
+
function CreatorExpandedPanel({
|
|
38592
|
+
isOpen,
|
|
38593
|
+
onClose,
|
|
38594
|
+
sessionId,
|
|
38595
|
+
creatorIds,
|
|
38596
|
+
version,
|
|
38597
|
+
searchSpec,
|
|
38598
|
+
fetchCreatorDetails
|
|
38599
|
+
}) {
|
|
38600
|
+
const [creators, setCreators] = useState15([]);
|
|
38601
|
+
const [loading, setLoading] = useState15(false);
|
|
38602
|
+
const fetcher = fetchCreatorDetails ?? defaultFetchCreatorDetails;
|
|
38603
|
+
const loadCreators = useCallback5(async () => {
|
|
38604
|
+
if (!creatorIds.length) return;
|
|
38605
|
+
setLoading(true);
|
|
38606
|
+
try {
|
|
38607
|
+
const data = await fetcher({ creatorIds, sessionId, versionNo: version });
|
|
38608
|
+
setCreators((data.creatorData || []).map(formatCreator));
|
|
38609
|
+
} catch (err) {
|
|
38610
|
+
console.error("Failed to fetch creator details:", err);
|
|
38611
|
+
} finally {
|
|
38612
|
+
setLoading(false);
|
|
38613
|
+
}
|
|
38614
|
+
}, [creatorIds, sessionId, version, fetcher]);
|
|
38615
|
+
useEffect10(() => {
|
|
38616
|
+
if (isOpen && creatorIds.length > 0) {
|
|
38617
|
+
loadCreators();
|
|
38618
|
+
}
|
|
38619
|
+
}, [isOpen, loadCreators]);
|
|
38620
|
+
if (typeof window === "undefined") return null;
|
|
38621
|
+
return ReactDOM2.createPortal(
|
|
38622
|
+
/* @__PURE__ */ jsx132(AnimatePresence4, { mode: "sync", children: isOpen && /* @__PURE__ */ jsxs90(Fragment8, { children: [
|
|
38623
|
+
/* @__PURE__ */ jsx132(
|
|
38624
|
+
motion5.div,
|
|
38625
|
+
{
|
|
38626
|
+
initial: { opacity: 0 },
|
|
38627
|
+
animate: { opacity: 1 },
|
|
38628
|
+
exit: { opacity: 0, display: "none" },
|
|
38629
|
+
transition: { duration: 0.3 },
|
|
38630
|
+
className: "fixed inset-0 bg-black bg-opacity-50 z-[60]",
|
|
38631
|
+
onClick: (e) => {
|
|
38632
|
+
e.stopPropagation();
|
|
38633
|
+
onClose();
|
|
38634
|
+
}
|
|
38635
|
+
},
|
|
38636
|
+
"overlay"
|
|
38637
|
+
),
|
|
38638
|
+
/* @__PURE__ */ jsx132(
|
|
38639
|
+
motion5.div,
|
|
38640
|
+
{
|
|
38641
|
+
initial: { x: "100%" },
|
|
38642
|
+
animate: { x: 0 },
|
|
38643
|
+
exit: { x: "100%" },
|
|
38644
|
+
transition: { type: "spring", damping: 30, stiffness: 400 },
|
|
38645
|
+
className: "fixed top-0 right-0 h-full w-full max-w-7xl bg-background dark:bg-gray25 z-[70] shadow-2xl overflow-y-auto border border-gray300",
|
|
38646
|
+
children: /* @__PURE__ */ jsxs90("div", { className: "py-4 font-noto", children: [
|
|
38647
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex justify-between items-center w-full mb-4 pl-2", children: [
|
|
38648
|
+
/* @__PURE__ */ jsx132("button", { onClick: onClose, className: "p-2 rounded-full transition-colors", children: /* @__PURE__ */ jsx132(X, { className: "w-5 h-5" }) }),
|
|
38649
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex-1 flex flex-col w-[80%]", children: [
|
|
38650
|
+
/* @__PURE__ */ jsx132("div", { className: "flex flex-col md:flex-row justify-between gap-2 md:gap-0 md:items-center pr-16", children: /* @__PURE__ */ jsxs90("div", { className: "flex flex-col", children: [
|
|
38651
|
+
/* @__PURE__ */ jsx132("div", { className: "w-fit rounded-md bg-purple200 px-2 py-[4px] mb-2", children: /* @__PURE__ */ jsx132("h4", { className: "text-xs font-medium text-purpleText", children: "VERIFIED SEARCH RESULTS" }) }),
|
|
38652
|
+
/* @__PURE__ */ jsx132("h2", { className: "text-xl font-bold mb-1", children: "Creators Search Results" })
|
|
38653
|
+
] }) }),
|
|
38654
|
+
searchSpec && /* @__PURE__ */ jsx132(SearchSpecDisplay, { spec: searchSpec })
|
|
38655
|
+
] })
|
|
38656
|
+
] }),
|
|
38657
|
+
/* @__PURE__ */ jsx132("div", { className: "border-b border-gray300" }),
|
|
38658
|
+
loading ? /* @__PURE__ */ jsxs90("div", { className: "flex flex-col items-center justify-center py-16 gap-3", children: [
|
|
38659
|
+
/* @__PURE__ */ jsx132("div", { className: "w-8 h-8 border-3 border-purple100 border-t-transparent rounded-full animate-spin" }),
|
|
38660
|
+
/* @__PURE__ */ jsx132("p", { className: "text-sm text-gray600", children: "Fetching Creators" })
|
|
38661
|
+
] }) : /* @__PURE__ */ jsx132(CreatorDisplay, { creators, isValidationComplete: version !== void 0 })
|
|
38662
|
+
] })
|
|
38663
|
+
},
|
|
38664
|
+
"creator-panel"
|
|
38665
|
+
)
|
|
38666
|
+
] }) }),
|
|
38667
|
+
document.body
|
|
38668
|
+
);
|
|
36927
38669
|
}
|
|
36928
38670
|
|
|
36929
38671
|
// src/molecules/creator-discovery/CreatorWidget/useCreatorWidgetPolling.ts
|
|
36930
|
-
import { useState as
|
|
38672
|
+
import { useState as useState16, useEffect as useEffect11, useCallback as useCallback6, useMemo as useMemo10, useRef as useRef7 } from "react";
|
|
36931
38673
|
var DEFAULT_POLLING_CONFIG = {
|
|
36932
38674
|
pollInterval: 5e3,
|
|
36933
38675
|
maxDuration: 15 * 60 * 1e3,
|
|
@@ -36937,27 +38679,29 @@ var DEFAULT_POLLING_CONFIG = {
|
|
|
36937
38679
|
function useCreatorWidgetPolling({
|
|
36938
38680
|
sessionId,
|
|
36939
38681
|
currentVersion,
|
|
36940
|
-
fetchVersions,
|
|
36941
|
-
fetchStatus,
|
|
38682
|
+
fetchVersions: fetchVersionsProp,
|
|
38683
|
+
fetchStatus: fetchStatusProp,
|
|
36942
38684
|
pollingConfig,
|
|
36943
38685
|
onStatusChange
|
|
36944
38686
|
}) {
|
|
36945
|
-
const
|
|
38687
|
+
const fetchVersions = fetchVersionsProp ?? defaultFetchVersions;
|
|
38688
|
+
const fetchStatus = fetchStatusProp ?? defaultFetchStatus;
|
|
38689
|
+
const config = useMemo10(
|
|
36946
38690
|
() => ({ ...DEFAULT_POLLING_CONFIG, ...pollingConfig }),
|
|
36947
38691
|
[pollingConfig]
|
|
36948
38692
|
);
|
|
36949
|
-
const [versionData, setVersionData] =
|
|
36950
|
-
const [totalVersions, setTotalVersions] =
|
|
36951
|
-
const [selectedVersion, setSelectedVersion] =
|
|
36952
|
-
const [isLoadingVersion, setIsLoadingVersion] =
|
|
36953
|
-
const [isValidationComplete, setIsValidationComplete] =
|
|
36954
|
-
const [versionStatus, setVersionStatus] =
|
|
36955
|
-
const [statusDetails, setStatusDetails] =
|
|
36956
|
-
const [timeDisplay, setTimeDisplay] =
|
|
36957
|
-
const [loadingStatus, setLoadingStatus] =
|
|
36958
|
-
const remainingTimeRef =
|
|
38693
|
+
const [versionData, setVersionData] = useState16(null);
|
|
38694
|
+
const [totalVersions, setTotalVersions] = useState16(0);
|
|
38695
|
+
const [selectedVersion, setSelectedVersion] = useState16();
|
|
38696
|
+
const [isLoadingVersion, setIsLoadingVersion] = useState16(false);
|
|
38697
|
+
const [isValidationComplete, setIsValidationComplete] = useState16(false);
|
|
38698
|
+
const [versionStatus, setVersionStatus] = useState16("checking");
|
|
38699
|
+
const [statusDetails, setStatusDetails] = useState16();
|
|
38700
|
+
const [timeDisplay, setTimeDisplay] = useState16("");
|
|
38701
|
+
const [loadingStatus, setLoadingStatus] = useState16(true);
|
|
38702
|
+
const remainingTimeRef = useRef7(0);
|
|
36959
38703
|
const requestedVersion = selectedVersion ?? currentVersion ?? versionData?.currentVersion;
|
|
36960
|
-
const fetchVersionData =
|
|
38704
|
+
const fetchVersionData = useCallback6(async () => {
|
|
36961
38705
|
if (!sessionId) return;
|
|
36962
38706
|
if (!versionData) setIsLoadingVersion(true);
|
|
36963
38707
|
try {
|
|
@@ -36978,17 +38722,17 @@ function useCreatorWidgetPolling({
|
|
|
36978
38722
|
setIsLoadingVersion(false);
|
|
36979
38723
|
}
|
|
36980
38724
|
}, [sessionId, requestedVersion, isValidationComplete, fetchVersions, versionData]);
|
|
36981
|
-
|
|
38725
|
+
useEffect11(() => {
|
|
36982
38726
|
fetchVersionData();
|
|
36983
38727
|
}, [sessionId, requestedVersion, isValidationComplete]);
|
|
36984
|
-
|
|
38728
|
+
useEffect11(() => {
|
|
36985
38729
|
if (totalVersions > 0 || !sessionId) return;
|
|
36986
38730
|
const interval = setInterval(() => {
|
|
36987
38731
|
if (totalVersions === 0) fetchVersionData();
|
|
36988
38732
|
}, config.pollInterval);
|
|
36989
38733
|
return () => clearInterval(interval);
|
|
36990
38734
|
}, [totalVersions, sessionId, fetchVersionData, config.pollInterval]);
|
|
36991
|
-
|
|
38735
|
+
useEffect11(() => {
|
|
36992
38736
|
if (!selectedVersion && !requestedVersion) return;
|
|
36993
38737
|
const activeVersion = selectedVersion ?? requestedVersion;
|
|
36994
38738
|
let isMounted = true;
|
|
@@ -37071,7 +38815,7 @@ function useCreatorWidgetPolling({
|
|
|
37071
38815
|
stopPolling();
|
|
37072
38816
|
};
|
|
37073
38817
|
}, [selectedVersion, requestedVersion, sessionId]);
|
|
37074
|
-
const versionNumbers =
|
|
38818
|
+
const versionNumbers = useMemo10(() => {
|
|
37075
38819
|
if (!totalVersions) return [];
|
|
37076
38820
|
return Array.from({ length: totalVersions }, (_, i) => i + 1);
|
|
37077
38821
|
}, [totalVersions]);
|
|
@@ -37098,18 +38842,20 @@ function useCreatorWidgetPolling({
|
|
|
37098
38842
|
}
|
|
37099
38843
|
|
|
37100
38844
|
// src/molecules/creator-discovery/CreatorWidget/CreatorWidget.tsx
|
|
37101
|
-
import { jsx as
|
|
38845
|
+
import { jsx as jsx133, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
37102
38846
|
function CreatorWidgetInner({
|
|
37103
38847
|
sessionId,
|
|
37104
38848
|
currentVersion,
|
|
37105
38849
|
isAgentOutput = false,
|
|
37106
38850
|
fetchVersions,
|
|
37107
38851
|
fetchStatus,
|
|
38852
|
+
fetchCreatorDetails,
|
|
37108
38853
|
pollingConfig,
|
|
37109
38854
|
onStatusChange,
|
|
37110
38855
|
onAction,
|
|
37111
38856
|
className
|
|
37112
38857
|
}) {
|
|
38858
|
+
const [isExpanded, setIsExpanded] = useState17(false);
|
|
37113
38859
|
const {
|
|
37114
38860
|
versionNumbers,
|
|
37115
38861
|
selectedVersion,
|
|
@@ -37130,11 +38876,12 @@ function CreatorWidgetInner({
|
|
|
37130
38876
|
pollingConfig,
|
|
37131
38877
|
onStatusChange
|
|
37132
38878
|
});
|
|
37133
|
-
const handleVersionSelect =
|
|
38879
|
+
const handleVersionSelect = useCallback7(
|
|
37134
38880
|
(version) => setSelectedVersion(version),
|
|
37135
38881
|
[setSelectedVersion]
|
|
37136
38882
|
);
|
|
37137
|
-
const handleViewCreators =
|
|
38883
|
+
const handleViewCreators = useCallback7(() => {
|
|
38884
|
+
setIsExpanded(true);
|
|
37138
38885
|
onAction?.({
|
|
37139
38886
|
type: "view-creators",
|
|
37140
38887
|
sessionId,
|
|
@@ -37143,30 +38890,41 @@ function CreatorWidgetInner({
|
|
|
37143
38890
|
searchSpec
|
|
37144
38891
|
});
|
|
37145
38892
|
}, [onAction, sessionId, creatorIds, selectedVersion, searchSpec]);
|
|
37146
|
-
|
|
37147
|
-
|
|
37148
|
-
|
|
37149
|
-
|
|
37150
|
-
|
|
37151
|
-
|
|
37152
|
-
|
|
37153
|
-
|
|
37154
|
-
|
|
37155
|
-
|
|
37156
|
-
|
|
37157
|
-
|
|
37158
|
-
|
|
37159
|
-
|
|
37160
|
-
|
|
37161
|
-
|
|
37162
|
-
|
|
37163
|
-
|
|
37164
|
-
|
|
38893
|
+
return /* @__PURE__ */ jsxs91("div", { className, children: [
|
|
38894
|
+
/* @__PURE__ */ jsx133(
|
|
38895
|
+
CreatorCompactView,
|
|
38896
|
+
{
|
|
38897
|
+
versions: versionNumbers,
|
|
38898
|
+
selectedVersion,
|
|
38899
|
+
creatorImages,
|
|
38900
|
+
creatorLength,
|
|
38901
|
+
isAgentOutput,
|
|
38902
|
+
onVersionSelect: handleVersionSelect,
|
|
38903
|
+
onViewCreators: handleViewCreators,
|
|
38904
|
+
versionStatus,
|
|
38905
|
+
statusDetails,
|
|
38906
|
+
timeDisplay,
|
|
38907
|
+
isLoading
|
|
38908
|
+
}
|
|
38909
|
+
),
|
|
38910
|
+
/* @__PURE__ */ jsx133(
|
|
38911
|
+
CreatorExpandedPanel,
|
|
38912
|
+
{
|
|
38913
|
+
isOpen: isExpanded,
|
|
38914
|
+
onClose: () => setIsExpanded(false),
|
|
38915
|
+
sessionId,
|
|
38916
|
+
creatorIds,
|
|
38917
|
+
version: selectedVersion,
|
|
38918
|
+
searchSpec,
|
|
38919
|
+
fetchCreatorDetails
|
|
38920
|
+
}
|
|
38921
|
+
)
|
|
38922
|
+
] });
|
|
37165
38923
|
}
|
|
37166
38924
|
var CreatorWidget = memo(CreatorWidgetInner);
|
|
37167
38925
|
|
|
37168
38926
|
// src/molecules/workstream-builder/ToolListCard/ToolListCard.tsx
|
|
37169
|
-
import { jsx as
|
|
38927
|
+
import { jsx as jsx134, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
37170
38928
|
var FONT_STYLE = {
|
|
37171
38929
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37172
38930
|
};
|
|
@@ -37237,7 +38995,7 @@ var ToolListCard = ({
|
|
|
37237
38995
|
grouped[cat].push(tool);
|
|
37238
38996
|
}
|
|
37239
38997
|
const categories = Object.keys(grouped);
|
|
37240
|
-
return /* @__PURE__ */
|
|
38998
|
+
return /* @__PURE__ */ jsxs92(
|
|
37241
38999
|
"div",
|
|
37242
39000
|
{
|
|
37243
39001
|
className: cn(
|
|
@@ -37246,34 +39004,34 @@ var ToolListCard = ({
|
|
|
37246
39004
|
),
|
|
37247
39005
|
style: FONT_STYLE,
|
|
37248
39006
|
children: [
|
|
37249
|
-
/* @__PURE__ */
|
|
37250
|
-
/* @__PURE__ */
|
|
37251
|
-
/* @__PURE__ */
|
|
37252
|
-
/* @__PURE__ */
|
|
39007
|
+
/* @__PURE__ */ jsxs92("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03] flex items-center gap-2.5", children: [
|
|
39008
|
+
/* @__PURE__ */ jsx134("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ jsx134(Wrench, { className: "w-3.5 h-3.5 text-interactive" }) }),
|
|
39009
|
+
/* @__PURE__ */ jsx134("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: "Available Tools" }),
|
|
39010
|
+
/* @__PURE__ */ jsx134("span", { className: "ml-auto text-[11px] font-medium text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.06] px-2 py-0.5 rounded-full", children: tools.length })
|
|
37253
39011
|
] }),
|
|
37254
|
-
/* @__PURE__ */
|
|
39012
|
+
/* @__PURE__ */ jsx134("div", { className: "divide-y divide-[var(--border-color)]", children: categories.map((cat) => {
|
|
37255
39013
|
const CatIcon = resolveCategoryIcon(cat);
|
|
37256
39014
|
const headerBg = CATEGORY_HEADER_BG[cat.toLowerCase()] || CATEGORY_HEADER_BG.general;
|
|
37257
|
-
return /* @__PURE__ */
|
|
37258
|
-
/* @__PURE__ */
|
|
37259
|
-
/* @__PURE__ */
|
|
37260
|
-
/* @__PURE__ */
|
|
37261
|
-
/* @__PURE__ */
|
|
39015
|
+
return /* @__PURE__ */ jsxs92("div", { className: "px-4 py-3", children: [
|
|
39016
|
+
/* @__PURE__ */ jsxs92("div", { className: cn("flex items-center gap-2 mb-2.5 -mx-4 px-4 py-1.5", headerBg), children: [
|
|
39017
|
+
/* @__PURE__ */ jsx134(CatIcon, { className: "w-3.5 h-3.5 text-interactive/70" }),
|
|
39018
|
+
/* @__PURE__ */ jsx134("span", { className: "text-[11px] font-semibold text-[var(--foreground)]/50 uppercase tracking-wider", children: cat }),
|
|
39019
|
+
/* @__PURE__ */ jsx134("span", { className: "text-[10px] text-[var(--foreground)]/30", children: grouped[cat].length })
|
|
37262
39020
|
] }),
|
|
37263
|
-
/* @__PURE__ */
|
|
39021
|
+
/* @__PURE__ */ jsx134("div", { className: "space-y-1.5", children: grouped[cat].map((tool) => {
|
|
37264
39022
|
const ToolIcon = resolveIcon(tool);
|
|
37265
|
-
return /* @__PURE__ */
|
|
39023
|
+
return /* @__PURE__ */ jsxs92(
|
|
37266
39024
|
"div",
|
|
37267
39025
|
{
|
|
37268
39026
|
className: "group flex items-start gap-3 px-3 py-2 rounded-lg hover:bg-[var(--foreground)]/[0.03] transition-colors",
|
|
37269
39027
|
children: [
|
|
37270
|
-
/* @__PURE__ */
|
|
37271
|
-
/* @__PURE__ */
|
|
37272
|
-
/* @__PURE__ */
|
|
37273
|
-
tool.display_name && tool.display_name !== tool.name && /* @__PURE__ */
|
|
37274
|
-
/* @__PURE__ */
|
|
39028
|
+
/* @__PURE__ */ jsx134("div", { className: "shrink-0 mt-0.5 w-5 h-5 rounded flex items-center justify-center bg-interactive/[0.08]", children: /* @__PURE__ */ jsx134(ToolIcon, { className: "w-3 h-3 text-interactive/60" }) }),
|
|
39029
|
+
/* @__PURE__ */ jsxs92("div", { className: "flex-1 min-w-0", children: [
|
|
39030
|
+
/* @__PURE__ */ jsxs92("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
39031
|
+
tool.display_name && tool.display_name !== tool.name && /* @__PURE__ */ jsx134("span", { className: "text-[13px] font-medium text-[var(--foreground)] truncate max-w-full", children: tool.display_name }),
|
|
39032
|
+
/* @__PURE__ */ jsx134("span", { className: "text-[11px] font-mono px-1.5 py-0.5 rounded bg-[var(--foreground)]/[0.06] text-[var(--foreground)]/50 border border-[var(--foreground)]/[0.06] truncate", children: tool.name })
|
|
37275
39033
|
] }),
|
|
37276
|
-
tool.description && /* @__PURE__ */
|
|
39034
|
+
tool.description && /* @__PURE__ */ jsx134("p", { className: "text-xs text-[var(--foreground)]/50 leading-relaxed mt-0.5 break-words whitespace-normal", children: tool.description })
|
|
37277
39035
|
] })
|
|
37278
39036
|
]
|
|
37279
39037
|
},
|
|
@@ -37288,8 +39046,8 @@ var ToolListCard = ({
|
|
|
37288
39046
|
};
|
|
37289
39047
|
|
|
37290
39048
|
// src/molecules/workstream-builder/AgentCard/AgentCard.tsx
|
|
37291
|
-
import { useState as
|
|
37292
|
-
import { Fragment as
|
|
39049
|
+
import { useState as useState18, useCallback as useCallback8 } from "react";
|
|
39050
|
+
import { Fragment as Fragment9, jsx as jsx135, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
37293
39051
|
var FONT_STYLE2 = {
|
|
37294
39052
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37295
39053
|
};
|
|
@@ -37300,15 +39058,15 @@ var AgentCard = ({
|
|
|
37300
39058
|
onSave,
|
|
37301
39059
|
className
|
|
37302
39060
|
}) => {
|
|
37303
|
-
const [isEditing, setIsEditing] =
|
|
37304
|
-
const [isSaving, setIsSaving] =
|
|
37305
|
-
const [editState, setEditState] =
|
|
39061
|
+
const [isEditing, setIsEditing] = useState18(false);
|
|
39062
|
+
const [isSaving, setIsSaving] = useState18(false);
|
|
39063
|
+
const [editState, setEditState] = useState18({
|
|
37306
39064
|
display_name: agent.display_name,
|
|
37307
39065
|
description: agent.description,
|
|
37308
39066
|
image: agent.image || ""
|
|
37309
39067
|
});
|
|
37310
39068
|
const avatarUrl = agent.image || `https://api.dicebear.com/7.x/avataaars/svg?seed=${agent.name}`;
|
|
37311
|
-
const handleEdit =
|
|
39069
|
+
const handleEdit = useCallback8(() => {
|
|
37312
39070
|
setEditState({
|
|
37313
39071
|
display_name: agent.display_name,
|
|
37314
39072
|
description: agent.description,
|
|
@@ -37316,10 +39074,10 @@ var AgentCard = ({
|
|
|
37316
39074
|
});
|
|
37317
39075
|
setIsEditing(true);
|
|
37318
39076
|
}, [agent]);
|
|
37319
|
-
const handleCancel =
|
|
39077
|
+
const handleCancel = useCallback8(() => {
|
|
37320
39078
|
setIsEditing(false);
|
|
37321
39079
|
}, []);
|
|
37322
|
-
const handleSave =
|
|
39080
|
+
const handleSave = useCallback8(async () => {
|
|
37323
39081
|
if (!onSave) return;
|
|
37324
39082
|
const updates = {};
|
|
37325
39083
|
if (editState.display_name !== agent.display_name)
|
|
@@ -37343,7 +39101,7 @@ var AgentCard = ({
|
|
|
37343
39101
|
}
|
|
37344
39102
|
}, [onSave, agent, editState]);
|
|
37345
39103
|
if (compact) {
|
|
37346
|
-
return /* @__PURE__ */
|
|
39104
|
+
return /* @__PURE__ */ jsxs93(
|
|
37347
39105
|
"div",
|
|
37348
39106
|
{
|
|
37349
39107
|
className: cn(
|
|
@@ -37352,14 +39110,14 @@ var AgentCard = ({
|
|
|
37352
39110
|
),
|
|
37353
39111
|
style: FONT_STYLE2,
|
|
37354
39112
|
children: [
|
|
37355
|
-
/* @__PURE__ */
|
|
37356
|
-
/* @__PURE__ */
|
|
37357
|
-
/* @__PURE__ */
|
|
39113
|
+
/* @__PURE__ */ jsxs93(Avatar, { className: "h-8 w-8 shrink-0", children: [
|
|
39114
|
+
/* @__PURE__ */ jsx135(AvatarImage, { src: avatarUrl, alt: agent.display_name }),
|
|
39115
|
+
/* @__PURE__ */ jsx135(AvatarFallback, { className: "bg-interactive/10 text-interactive text-xs font-bold", children: agent.display_name.charAt(0) })
|
|
37358
39116
|
] }),
|
|
37359
|
-
/* @__PURE__ */
|
|
37360
|
-
/* @__PURE__ */
|
|
37361
|
-
/* @__PURE__ */
|
|
37362
|
-
/* @__PURE__ */
|
|
39117
|
+
/* @__PURE__ */ jsxs93("div", { className: "flex-1 min-w-0", children: [
|
|
39118
|
+
/* @__PURE__ */ jsxs93("div", { className: "flex items-center gap-2", children: [
|
|
39119
|
+
/* @__PURE__ */ jsx135("span", { className: "text-[var(--foreground)] text-sm font-semibold truncate", children: agent.display_name }),
|
|
39120
|
+
/* @__PURE__ */ jsxs93(
|
|
37363
39121
|
"span",
|
|
37364
39122
|
{
|
|
37365
39123
|
className: cn(
|
|
@@ -37367,7 +39125,7 @@ var AgentCard = ({
|
|
|
37367
39125
|
agent.enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37368
39126
|
),
|
|
37369
39127
|
children: [
|
|
37370
|
-
/* @__PURE__ */
|
|
39128
|
+
/* @__PURE__ */ jsx135("span", { className: cn(
|
|
37371
39129
|
"w-1.5 h-1.5 rounded-full",
|
|
37372
39130
|
agent.enabled ? "bg-emerald-500" : "bg-red-500"
|
|
37373
39131
|
) }),
|
|
@@ -37376,13 +39134,13 @@ var AgentCard = ({
|
|
|
37376
39134
|
}
|
|
37377
39135
|
)
|
|
37378
39136
|
] }),
|
|
37379
|
-
/* @__PURE__ */
|
|
39137
|
+
/* @__PURE__ */ jsx135("p", { className: "text-[var(--foreground)]/50 text-xs truncate", children: agent.description })
|
|
37380
39138
|
] })
|
|
37381
39139
|
]
|
|
37382
39140
|
}
|
|
37383
39141
|
);
|
|
37384
39142
|
}
|
|
37385
|
-
return /* @__PURE__ */
|
|
39143
|
+
return /* @__PURE__ */ jsxs93(
|
|
37386
39144
|
"div",
|
|
37387
39145
|
{
|
|
37388
39146
|
className: cn(
|
|
@@ -37391,14 +39149,14 @@ var AgentCard = ({
|
|
|
37391
39149
|
),
|
|
37392
39150
|
style: FONT_STYLE2,
|
|
37393
39151
|
children: [
|
|
37394
|
-
/* @__PURE__ */
|
|
37395
|
-
/* @__PURE__ */
|
|
37396
|
-
/* @__PURE__ */
|
|
37397
|
-
/* @__PURE__ */
|
|
39152
|
+
/* @__PURE__ */ jsxs93("div", { className: "flex items-start gap-4 px-5 py-4 bg-gradient-to-r from-[var(--foreground)]/[0.02] to-transparent", children: [
|
|
39153
|
+
/* @__PURE__ */ jsxs93(Avatar, { className: "h-12 w-12 shrink-0 border-2 border-interactive/20", children: [
|
|
39154
|
+
/* @__PURE__ */ jsx135(AvatarImage, { src: isEditing && editState.image ? editState.image : avatarUrl, alt: agent.display_name }),
|
|
39155
|
+
/* @__PURE__ */ jsx135(AvatarFallback, { className: "bg-interactive/10 text-interactive text-lg font-bold", children: agent.display_name.charAt(0) })
|
|
37398
39156
|
] }),
|
|
37399
|
-
/* @__PURE__ */
|
|
37400
|
-
/* @__PURE__ */
|
|
37401
|
-
isEditing ? /* @__PURE__ */
|
|
39157
|
+
/* @__PURE__ */ jsxs93("div", { className: "flex-1 min-w-0", children: [
|
|
39158
|
+
/* @__PURE__ */ jsxs93("div", { className: "flex items-center gap-2", children: [
|
|
39159
|
+
isEditing ? /* @__PURE__ */ jsx135(
|
|
37402
39160
|
"input",
|
|
37403
39161
|
{
|
|
37404
39162
|
type: "text",
|
|
@@ -37408,9 +39166,9 @@ var AgentCard = ({
|
|
|
37408
39166
|
className: "flex-1 bg-transparent border-b border-interactive/30 text-sm font-semibold text-foreground outline-none focus:border-interactive transition-all",
|
|
37409
39167
|
placeholder: "Agent name"
|
|
37410
39168
|
}
|
|
37411
|
-
) : /* @__PURE__ */
|
|
37412
|
-
/* @__PURE__ */
|
|
37413
|
-
/* @__PURE__ */
|
|
39169
|
+
) : /* @__PURE__ */ jsx135("h4", { className: "text-sm font-semibold text-[var(--foreground)] truncate", children: agent.display_name }),
|
|
39170
|
+
/* @__PURE__ */ jsx135("span", { className: "text-[11px] font-mono text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.05] px-1.5 py-0.5 rounded", children: agent.name }),
|
|
39171
|
+
/* @__PURE__ */ jsxs93(
|
|
37414
39172
|
"span",
|
|
37415
39173
|
{
|
|
37416
39174
|
className: cn(
|
|
@@ -37418,7 +39176,7 @@ var AgentCard = ({
|
|
|
37418
39176
|
agent.enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37419
39177
|
),
|
|
37420
39178
|
children: [
|
|
37421
|
-
/* @__PURE__ */
|
|
39179
|
+
/* @__PURE__ */ jsx135("span", { className: cn(
|
|
37422
39180
|
"w-1.5 h-1.5 rounded-full",
|
|
37423
39181
|
agent.enabled ? "bg-emerald-500" : "bg-red-500"
|
|
37424
39182
|
) }),
|
|
@@ -37427,7 +39185,7 @@ var AgentCard = ({
|
|
|
37427
39185
|
}
|
|
37428
39186
|
)
|
|
37429
39187
|
] }),
|
|
37430
|
-
/* @__PURE__ */
|
|
39188
|
+
/* @__PURE__ */ jsx135("div", { className: "mt-1", children: isEditing ? /* @__PURE__ */ jsx135(
|
|
37431
39189
|
"textarea",
|
|
37432
39190
|
{
|
|
37433
39191
|
value: editState.description,
|
|
@@ -37437,10 +39195,10 @@ var AgentCard = ({
|
|
|
37437
39195
|
rows: 2,
|
|
37438
39196
|
placeholder: "Describe this agent..."
|
|
37439
39197
|
}
|
|
37440
|
-
) : /* @__PURE__ */
|
|
37441
|
-
isEditing && /* @__PURE__ */
|
|
37442
|
-
/* @__PURE__ */
|
|
37443
|
-
/* @__PURE__ */
|
|
39198
|
+
) : /* @__PURE__ */ jsx135("p", { className: "text-xs text-[var(--foreground)]/60 leading-relaxed whitespace-normal", children: agent.description }) }),
|
|
39199
|
+
isEditing && /* @__PURE__ */ jsxs93("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
39200
|
+
/* @__PURE__ */ jsx135("span", { className: "text-[10px] text-[var(--foreground)]/30 uppercase font-semibold", children: "Avatar:" }),
|
|
39201
|
+
/* @__PURE__ */ jsx135(
|
|
37444
39202
|
"input",
|
|
37445
39203
|
{
|
|
37446
39204
|
type: "text",
|
|
@@ -37453,8 +39211,8 @@ var AgentCard = ({
|
|
|
37453
39211
|
)
|
|
37454
39212
|
] })
|
|
37455
39213
|
] }),
|
|
37456
|
-
editable && onSave && /* @__PURE__ */
|
|
37457
|
-
/* @__PURE__ */
|
|
39214
|
+
editable && onSave && /* @__PURE__ */ jsx135("div", { className: "flex items-center gap-1.5 shrink-0", children: isEditing ? /* @__PURE__ */ jsxs93(Fragment9, { children: [
|
|
39215
|
+
/* @__PURE__ */ jsx135(
|
|
37458
39216
|
"button",
|
|
37459
39217
|
{
|
|
37460
39218
|
onClick: handleCancel,
|
|
@@ -37463,7 +39221,7 @@ var AgentCard = ({
|
|
|
37463
39221
|
children: "Cancel"
|
|
37464
39222
|
}
|
|
37465
39223
|
),
|
|
37466
|
-
/* @__PURE__ */
|
|
39224
|
+
/* @__PURE__ */ jsx135(
|
|
37467
39225
|
"button",
|
|
37468
39226
|
{
|
|
37469
39227
|
onClick: handleSave,
|
|
@@ -37472,7 +39230,7 @@ var AgentCard = ({
|
|
|
37472
39230
|
children: isSaving ? "Saving..." : "Save"
|
|
37473
39231
|
}
|
|
37474
39232
|
)
|
|
37475
|
-
] }) : /* @__PURE__ */
|
|
39233
|
+
] }) : /* @__PURE__ */ jsx135(
|
|
37476
39234
|
"button",
|
|
37477
39235
|
{
|
|
37478
39236
|
onClick: handleEdit,
|
|
@@ -37481,18 +39239,18 @@ var AgentCard = ({
|
|
|
37481
39239
|
}
|
|
37482
39240
|
) })
|
|
37483
39241
|
] }),
|
|
37484
|
-
/* @__PURE__ */
|
|
39242
|
+
/* @__PURE__ */ jsx135("div", { className: "flex flex-wrap items-center gap-3 px-5 pb-3 text-xs", children: /* @__PURE__ */ jsxs93("span", { className: "text-[var(--foreground)]/40", children: [
|
|
37485
39243
|
"Model:",
|
|
37486
39244
|
" ",
|
|
37487
|
-
/* @__PURE__ */
|
|
39245
|
+
/* @__PURE__ */ jsx135("span", { className: "font-mono text-[var(--foreground)]/70", children: agent.model })
|
|
37488
39246
|
] }) }),
|
|
37489
|
-
agent.tools && agent.tools.length > 0 && /* @__PURE__ */
|
|
37490
|
-
/* @__PURE__ */
|
|
39247
|
+
agent.tools && agent.tools.length > 0 && /* @__PURE__ */ jsxs93("div", { className: "border-t border-[var(--border-color)] px-5 py-3", children: [
|
|
39248
|
+
/* @__PURE__ */ jsxs93("p", { className: "text-[11px] font-semibold text-[var(--foreground)]/40 uppercase tracking-wide mb-2", children: [
|
|
37491
39249
|
"Tools (",
|
|
37492
39250
|
agent.tools.length,
|
|
37493
39251
|
")"
|
|
37494
39252
|
] }),
|
|
37495
|
-
/* @__PURE__ */
|
|
39253
|
+
/* @__PURE__ */ jsx135("div", { className: "flex flex-wrap gap-1.5", children: agent.tools.map((tool) => /* @__PURE__ */ jsx135(
|
|
37496
39254
|
"span",
|
|
37497
39255
|
{
|
|
37498
39256
|
className: "text-[11px] px-2 py-0.5 rounded-md bg-interactive/10 text-interactive font-mono border border-interactive/20",
|
|
@@ -37507,7 +39265,7 @@ var AgentCard = ({
|
|
|
37507
39265
|
};
|
|
37508
39266
|
|
|
37509
39267
|
// src/molecules/workstream-builder/AgentDataTable/AgentDataTable.tsx
|
|
37510
|
-
import { jsx as
|
|
39268
|
+
import { jsx as jsx136, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
37511
39269
|
var FONT_STYLE3 = {
|
|
37512
39270
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37513
39271
|
};
|
|
@@ -37518,7 +39276,7 @@ var AgentDataTable = ({
|
|
|
37518
39276
|
}) => {
|
|
37519
39277
|
const renderCell = (value) => {
|
|
37520
39278
|
if (typeof value === "boolean") {
|
|
37521
|
-
return /* @__PURE__ */
|
|
39279
|
+
return /* @__PURE__ */ jsxs94(
|
|
37522
39280
|
"span",
|
|
37523
39281
|
{
|
|
37524
39282
|
className: cn(
|
|
@@ -37526,18 +39284,18 @@ var AgentDataTable = ({
|
|
|
37526
39284
|
value ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37527
39285
|
),
|
|
37528
39286
|
children: [
|
|
37529
|
-
value ? /* @__PURE__ */
|
|
37530
|
-
/* @__PURE__ */
|
|
37531
|
-
/* @__PURE__ */
|
|
39287
|
+
value ? /* @__PURE__ */ jsx136("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx136("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs94("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
39288
|
+
/* @__PURE__ */ jsx136("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
39289
|
+
/* @__PURE__ */ jsx136("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
37532
39290
|
] }),
|
|
37533
39291
|
value ? "Yes" : "No"
|
|
37534
39292
|
]
|
|
37535
39293
|
}
|
|
37536
39294
|
);
|
|
37537
39295
|
}
|
|
37538
|
-
return /* @__PURE__ */
|
|
39296
|
+
return /* @__PURE__ */ jsx136("span", { className: "text-[var(--foreground)]", children: String(value) });
|
|
37539
39297
|
};
|
|
37540
|
-
return /* @__PURE__ */
|
|
39298
|
+
return /* @__PURE__ */ jsx136(
|
|
37541
39299
|
"div",
|
|
37542
39300
|
{
|
|
37543
39301
|
className: cn(
|
|
@@ -37545,8 +39303,8 @@ var AgentDataTable = ({
|
|
|
37545
39303
|
className
|
|
37546
39304
|
),
|
|
37547
39305
|
style: FONT_STYLE3,
|
|
37548
|
-
children: /* @__PURE__ */
|
|
37549
|
-
/* @__PURE__ */
|
|
39306
|
+
children: /* @__PURE__ */ jsx136("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs94("table", { className: "w-full text-xs", children: [
|
|
39307
|
+
/* @__PURE__ */ jsx136("thead", { children: /* @__PURE__ */ jsx136("tr", { className: "border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03]", children: headers.map((header) => /* @__PURE__ */ jsx136(
|
|
37550
39308
|
"th",
|
|
37551
39309
|
{
|
|
37552
39310
|
className: "text-left px-4 py-2.5 text-[11px] font-semibold text-[var(--foreground)]/60 uppercase tracking-wide whitespace-nowrap",
|
|
@@ -37554,14 +39312,14 @@ var AgentDataTable = ({
|
|
|
37554
39312
|
},
|
|
37555
39313
|
header
|
|
37556
39314
|
)) }) }),
|
|
37557
|
-
/* @__PURE__ */
|
|
39315
|
+
/* @__PURE__ */ jsx136("tbody", { children: rows.map((row, rowIdx) => /* @__PURE__ */ jsx136(
|
|
37558
39316
|
"tr",
|
|
37559
39317
|
{
|
|
37560
39318
|
className: cn(
|
|
37561
39319
|
"border-b border-[var(--border-color)] last:border-b-0 hover:bg-[var(--foreground)]/[0.03] transition-colors",
|
|
37562
39320
|
rowIdx % 2 === 1 && "bg-[var(--foreground)]/[0.015]"
|
|
37563
39321
|
),
|
|
37564
|
-
children: row.map((cell, cellIdx) => /* @__PURE__ */
|
|
39322
|
+
children: row.map((cell, cellIdx) => /* @__PURE__ */ jsx136(
|
|
37565
39323
|
"td",
|
|
37566
39324
|
{
|
|
37567
39325
|
className: "px-4 py-2.5 text-xs whitespace-nowrap",
|
|
@@ -37578,8 +39336,8 @@ var AgentDataTable = ({
|
|
|
37578
39336
|
};
|
|
37579
39337
|
|
|
37580
39338
|
// src/molecules/workstream-builder/WorkflowVisualizer/WorkflowVisualizer.tsx
|
|
37581
|
-
import { useState as
|
|
37582
|
-
import { jsx as
|
|
39339
|
+
import { useState as useState19 } from "react";
|
|
39340
|
+
import { jsx as jsx137, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
37583
39341
|
var FONT_STYLE4 = {
|
|
37584
39342
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37585
39343
|
};
|
|
@@ -37587,10 +39345,10 @@ var WorkflowVisualizer = ({
|
|
|
37587
39345
|
steps,
|
|
37588
39346
|
className
|
|
37589
39347
|
}) => {
|
|
37590
|
-
const [expandedStep, setExpandedStep] =
|
|
39348
|
+
const [expandedStep, setExpandedStep] = useState19(
|
|
37591
39349
|
steps[0]?.id || null
|
|
37592
39350
|
);
|
|
37593
|
-
return /* @__PURE__ */
|
|
39351
|
+
return /* @__PURE__ */ jsxs95(
|
|
37594
39352
|
"div",
|
|
37595
39353
|
{
|
|
37596
39354
|
className: cn(
|
|
@@ -37599,8 +39357,8 @@ var WorkflowVisualizer = ({
|
|
|
37599
39357
|
),
|
|
37600
39358
|
style: FONT_STYLE4,
|
|
37601
39359
|
children: [
|
|
37602
|
-
/* @__PURE__ */
|
|
37603
|
-
/* @__PURE__ */
|
|
39360
|
+
/* @__PURE__ */ jsxs95("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03] flex items-center gap-2.5", children: [
|
|
39361
|
+
/* @__PURE__ */ jsx137("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ jsx137(
|
|
37604
39362
|
"svg",
|
|
37605
39363
|
{
|
|
37606
39364
|
width: "14",
|
|
@@ -37612,24 +39370,24 @@ var WorkflowVisualizer = ({
|
|
|
37612
39370
|
className: "text-interactive",
|
|
37613
39371
|
strokeLinecap: "round",
|
|
37614
39372
|
strokeLinejoin: "round",
|
|
37615
|
-
children: /* @__PURE__ */
|
|
39373
|
+
children: /* @__PURE__ */ jsx137("polyline", { points: "22 12 18 12 15 21 9 3 6 12 2 12" })
|
|
37616
39374
|
}
|
|
37617
39375
|
) }),
|
|
37618
|
-
/* @__PURE__ */
|
|
37619
|
-
/* @__PURE__ */
|
|
39376
|
+
/* @__PURE__ */ jsx137("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: "Workflow" }),
|
|
39377
|
+
/* @__PURE__ */ jsxs95("span", { className: "ml-auto text-[11px] font-medium text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.06] px-2 py-0.5 rounded-full", children: [
|
|
37620
39378
|
steps.length,
|
|
37621
39379
|
" steps"
|
|
37622
39380
|
] })
|
|
37623
39381
|
] }),
|
|
37624
|
-
/* @__PURE__ */
|
|
39382
|
+
/* @__PURE__ */ jsx137("div", { className: "px-4 py-3", children: steps.map((step, idx) => {
|
|
37625
39383
|
const isLast = idx === steps.length - 1;
|
|
37626
39384
|
const isExpanded = expandedStep === step.id;
|
|
37627
|
-
return /* @__PURE__ */
|
|
37628
|
-
/* @__PURE__ */
|
|
37629
|
-
/* @__PURE__ */
|
|
37630
|
-
!isLast && /* @__PURE__ */
|
|
39385
|
+
return /* @__PURE__ */ jsxs95("div", { className: "flex gap-3", children: [
|
|
39386
|
+
/* @__PURE__ */ jsxs95("div", { className: "flex flex-col items-center shrink-0", children: [
|
|
39387
|
+
/* @__PURE__ */ jsx137("div", { className: "w-7 h-7 rounded-full bg-interactive/10 border-2 border-interactive/30 flex items-center justify-center", children: /* @__PURE__ */ jsx137("span", { className: "text-[10px] font-bold text-interactive", children: idx + 1 }) }),
|
|
39388
|
+
!isLast && /* @__PURE__ */ jsx137("div", { className: "w-0.5 flex-1 min-h-[16px] bg-interactive/15" })
|
|
37631
39389
|
] }),
|
|
37632
|
-
/* @__PURE__ */
|
|
39390
|
+
/* @__PURE__ */ jsxs95(
|
|
37633
39391
|
"div",
|
|
37634
39392
|
{
|
|
37635
39393
|
className: cn(
|
|
@@ -37637,14 +39395,14 @@ var WorkflowVisualizer = ({
|
|
|
37637
39395
|
isExpanded ? "bg-[var(--foreground)]/[0.02] shadow-sm" : "hover:bg-[var(--foreground)]/[0.02] hover:shadow-sm hover:-translate-y-0.5"
|
|
37638
39396
|
),
|
|
37639
39397
|
children: [
|
|
37640
|
-
/* @__PURE__ */
|
|
39398
|
+
/* @__PURE__ */ jsxs95(
|
|
37641
39399
|
"button",
|
|
37642
39400
|
{
|
|
37643
39401
|
onClick: () => setExpandedStep(isExpanded ? null : step.id),
|
|
37644
39402
|
className: "w-full text-left px-3 py-2.5 flex items-center gap-2 whitespace-normal",
|
|
37645
39403
|
children: [
|
|
37646
|
-
/* @__PURE__ */
|
|
37647
|
-
/* @__PURE__ */
|
|
39404
|
+
/* @__PURE__ */ jsx137("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx137("span", { className: "text-[13px] font-medium text-[var(--foreground)]", children: step.name }) }),
|
|
39405
|
+
/* @__PURE__ */ jsx137(
|
|
37648
39406
|
"svg",
|
|
37649
39407
|
{
|
|
37650
39408
|
width: "12",
|
|
@@ -37657,28 +39415,28 @@ var WorkflowVisualizer = ({
|
|
|
37657
39415
|
"shrink-0 text-[var(--foreground)]/30 transition-transform",
|
|
37658
39416
|
isExpanded && "rotate-180"
|
|
37659
39417
|
),
|
|
37660
|
-
children: /* @__PURE__ */
|
|
39418
|
+
children: /* @__PURE__ */ jsx137("polyline", { points: "6 9 12 15 18 9" })
|
|
37661
39419
|
}
|
|
37662
39420
|
)
|
|
37663
39421
|
]
|
|
37664
39422
|
}
|
|
37665
39423
|
),
|
|
37666
|
-
isExpanded && /* @__PURE__ */
|
|
37667
|
-
step.description && /* @__PURE__ */
|
|
37668
|
-
step.sub_steps && step.sub_steps.length > 0 && /* @__PURE__ */
|
|
39424
|
+
isExpanded && /* @__PURE__ */ jsxs95("div", { className: "px-3 pb-3 space-y-2.5", children: [
|
|
39425
|
+
step.description && /* @__PURE__ */ jsx137("p", { className: "text-xs text-[var(--foreground)]/50 leading-relaxed whitespace-normal", children: step.description }),
|
|
39426
|
+
step.sub_steps && step.sub_steps.length > 0 && /* @__PURE__ */ jsx137("div", { className: "space-y-1", children: step.sub_steps.map((sub) => /* @__PURE__ */ jsxs95(
|
|
37669
39427
|
"div",
|
|
37670
39428
|
{
|
|
37671
39429
|
className: "flex items-start gap-2 text-xs",
|
|
37672
39430
|
children: [
|
|
37673
|
-
/* @__PURE__ */
|
|
37674
|
-
/* @__PURE__ */
|
|
39431
|
+
/* @__PURE__ */ jsx137("span", { className: "shrink-0 mt-0.5 w-1.5 h-1.5 rounded-full bg-interactive/40" }),
|
|
39432
|
+
/* @__PURE__ */ jsx137("span", { className: "text-[var(--foreground)]/60", children: sub.action })
|
|
37675
39433
|
]
|
|
37676
39434
|
},
|
|
37677
39435
|
sub.id
|
|
37678
39436
|
)) }),
|
|
37679
|
-
step.tools && step.tools.length > 0 && /* @__PURE__ */
|
|
37680
|
-
/* @__PURE__ */
|
|
37681
|
-
step.tools.map((tool) => /* @__PURE__ */
|
|
39437
|
+
step.tools && step.tools.length > 0 && /* @__PURE__ */ jsxs95("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
|
|
39438
|
+
/* @__PURE__ */ jsx137("span", { className: "text-[10px] text-[var(--foreground)]/30 uppercase font-semibold tracking-wider", children: "Tools:" }),
|
|
39439
|
+
step.tools.map((tool) => /* @__PURE__ */ jsx137(
|
|
37682
39440
|
"span",
|
|
37683
39441
|
{
|
|
37684
39442
|
className: "text-[10px] font-mono px-1.5 py-0.5 rounded bg-interactive/[0.08] text-interactive/70 border border-interactive/10",
|
|
@@ -37687,9 +39445,9 @@ var WorkflowVisualizer = ({
|
|
|
37687
39445
|
tool
|
|
37688
39446
|
))
|
|
37689
39447
|
] }),
|
|
37690
|
-
step.on_failure && /* @__PURE__ */
|
|
37691
|
-
/* @__PURE__ */
|
|
37692
|
-
/* @__PURE__ */
|
|
39448
|
+
step.on_failure && /* @__PURE__ */ jsxs95("div", { className: "flex items-start gap-2 text-xs bg-[var(--redBackground,_#ef4444)]/[0.06] border border-[var(--redText,_#ef4444)]/10 rounded-md px-2.5 py-2 whitespace-normal", children: [
|
|
39449
|
+
/* @__PURE__ */ jsx137("span", { className: "shrink-0 text-[10px] font-semibold text-[var(--redText,_#ef4444)]/70 uppercase tracking-wider mt-px", children: "On failure:" }),
|
|
39450
|
+
/* @__PURE__ */ jsx137("span", { className: "text-[var(--foreground)]/50", children: step.on_failure })
|
|
37693
39451
|
] })
|
|
37694
39452
|
] })
|
|
37695
39453
|
]
|
|
@@ -37703,8 +39461,8 @@ var WorkflowVisualizer = ({
|
|
|
37703
39461
|
};
|
|
37704
39462
|
|
|
37705
39463
|
// src/molecules/workstream-builder/InstructionPreview/InstructionPreview.tsx
|
|
37706
|
-
import { useState as
|
|
37707
|
-
import { jsx as
|
|
39464
|
+
import { useState as useState20, useCallback as useCallback9 } from "react";
|
|
39465
|
+
import { jsx as jsx138, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
37708
39466
|
var FONT_STYLE5 = {
|
|
37709
39467
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37710
39468
|
};
|
|
@@ -37716,12 +39474,12 @@ var InstructionPreview = ({
|
|
|
37716
39474
|
tools,
|
|
37717
39475
|
className
|
|
37718
39476
|
}) => {
|
|
37719
|
-
const [isExpanded, setIsExpanded] =
|
|
37720
|
-
const [copied, setCopied] =
|
|
39477
|
+
const [isExpanded, setIsExpanded] = useState20(false);
|
|
39478
|
+
const [copied, setCopied] = useState20(false);
|
|
37721
39479
|
const previewLength = 300;
|
|
37722
39480
|
const isLong = instruction.length > previewLength;
|
|
37723
39481
|
const displayText = isExpanded || !isLong ? instruction : instruction.slice(0, previewLength) + "...";
|
|
37724
|
-
const handleCopy =
|
|
39482
|
+
const handleCopy = useCallback9(async () => {
|
|
37725
39483
|
try {
|
|
37726
39484
|
await navigator.clipboard.writeText(instruction);
|
|
37727
39485
|
setCopied(true);
|
|
@@ -37739,7 +39497,7 @@ var InstructionPreview = ({
|
|
|
37739
39497
|
setTimeout(() => setCopied(false), 2e3);
|
|
37740
39498
|
}
|
|
37741
39499
|
}, [instruction]);
|
|
37742
|
-
return /* @__PURE__ */
|
|
39500
|
+
return /* @__PURE__ */ jsxs96(
|
|
37743
39501
|
"div",
|
|
37744
39502
|
{
|
|
37745
39503
|
className: cn(
|
|
@@ -37748,8 +39506,8 @@ var InstructionPreview = ({
|
|
|
37748
39506
|
),
|
|
37749
39507
|
style: FONT_STYLE5,
|
|
37750
39508
|
children: [
|
|
37751
|
-
/* @__PURE__ */
|
|
37752
|
-
/* @__PURE__ */
|
|
39509
|
+
/* @__PURE__ */ jsx138("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03]", children: /* @__PURE__ */ jsxs96("div", { className: "flex items-center gap-2.5", children: [
|
|
39510
|
+
/* @__PURE__ */ jsx138("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ jsxs96(
|
|
37753
39511
|
"svg",
|
|
37754
39512
|
{
|
|
37755
39513
|
width: "14",
|
|
@@ -37762,24 +39520,24 @@ var InstructionPreview = ({
|
|
|
37762
39520
|
strokeLinecap: "round",
|
|
37763
39521
|
strokeLinejoin: "round",
|
|
37764
39522
|
children: [
|
|
37765
|
-
/* @__PURE__ */
|
|
37766
|
-
/* @__PURE__ */
|
|
37767
|
-
/* @__PURE__ */
|
|
37768
|
-
/* @__PURE__ */
|
|
37769
|
-
/* @__PURE__ */
|
|
39523
|
+
/* @__PURE__ */ jsx138("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
39524
|
+
/* @__PURE__ */ jsx138("polyline", { points: "14 2 14 8 20 8" }),
|
|
39525
|
+
/* @__PURE__ */ jsx138("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
39526
|
+
/* @__PURE__ */ jsx138("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
39527
|
+
/* @__PURE__ */ jsx138("polyline", { points: "10 9 9 9 8 9" })
|
|
37770
39528
|
]
|
|
37771
39529
|
}
|
|
37772
39530
|
) }),
|
|
37773
|
-
/* @__PURE__ */
|
|
37774
|
-
/* @__PURE__ */
|
|
37775
|
-
description && /* @__PURE__ */
|
|
39531
|
+
/* @__PURE__ */ jsxs96("div", { className: "flex-1 min-w-0", children: [
|
|
39532
|
+
/* @__PURE__ */ jsx138("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: agent_name }),
|
|
39533
|
+
description && /* @__PURE__ */ jsx138("p", { className: "text-[11px] text-[var(--foreground)]/40 mt-0.5 whitespace-normal", children: description })
|
|
37776
39534
|
] })
|
|
37777
39535
|
] }) }),
|
|
37778
|
-
/* @__PURE__ */
|
|
37779
|
-
/* @__PURE__ */
|
|
37780
|
-
/* @__PURE__ */
|
|
37781
|
-
/* @__PURE__ */
|
|
37782
|
-
/* @__PURE__ */
|
|
39536
|
+
/* @__PURE__ */ jsxs96("div", { className: "px-4 py-3 space-y-3", children: [
|
|
39537
|
+
/* @__PURE__ */ jsxs96("div", { children: [
|
|
39538
|
+
/* @__PURE__ */ jsxs96("div", { className: "flex items-center justify-between mb-1.5", children: [
|
|
39539
|
+
/* @__PURE__ */ jsx138("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider", children: "Instruction" }),
|
|
39540
|
+
/* @__PURE__ */ jsx138(
|
|
37783
39541
|
"button",
|
|
37784
39542
|
{
|
|
37785
39543
|
onClick: handleCopy,
|
|
@@ -37788,14 +39546,14 @@ var InstructionPreview = ({
|
|
|
37788
39546
|
}
|
|
37789
39547
|
)
|
|
37790
39548
|
] }),
|
|
37791
|
-
/* @__PURE__ */
|
|
37792
|
-
isLong && /* @__PURE__ */
|
|
39549
|
+
/* @__PURE__ */ jsx138("div", { className: "text-xs text-[var(--foreground)]/60 leading-relaxed whitespace-pre-wrap font-mono bg-[var(--foreground)]/[0.02] border border-[var(--border-color)] rounded-lg p-3", children: displayText }),
|
|
39550
|
+
isLong && /* @__PURE__ */ jsxs96(
|
|
37793
39551
|
"button",
|
|
37794
39552
|
{
|
|
37795
39553
|
onClick: () => setIsExpanded(!isExpanded),
|
|
37796
39554
|
className: "inline-flex items-center gap-1 text-[11px] text-interactive hover:underline mt-1",
|
|
37797
39555
|
children: [
|
|
37798
|
-
/* @__PURE__ */
|
|
39556
|
+
/* @__PURE__ */ jsx138(
|
|
37799
39557
|
"svg",
|
|
37800
39558
|
{
|
|
37801
39559
|
width: "12",
|
|
@@ -37805,7 +39563,7 @@ var InstructionPreview = ({
|
|
|
37805
39563
|
stroke: "currentColor",
|
|
37806
39564
|
strokeWidth: "2",
|
|
37807
39565
|
className: cn("transition-transform", isExpanded && "rotate-180"),
|
|
37808
|
-
children: /* @__PURE__ */
|
|
39566
|
+
children: /* @__PURE__ */ jsx138("polyline", { points: "6 9 12 15 18 9" })
|
|
37809
39567
|
}
|
|
37810
39568
|
),
|
|
37811
39569
|
isExpanded ? "Show less" : "Show full instruction"
|
|
@@ -37813,16 +39571,16 @@ var InstructionPreview = ({
|
|
|
37813
39571
|
}
|
|
37814
39572
|
)
|
|
37815
39573
|
] }),
|
|
37816
|
-
workflow_summary && workflow_summary.length > 0 && /* @__PURE__ */
|
|
37817
|
-
/* @__PURE__ */
|
|
37818
|
-
/* @__PURE__ */
|
|
37819
|
-
/* @__PURE__ */
|
|
37820
|
-
/* @__PURE__ */
|
|
39574
|
+
workflow_summary && workflow_summary.length > 0 && /* @__PURE__ */ jsxs96("div", { children: [
|
|
39575
|
+
/* @__PURE__ */ jsx138("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider mb-1.5", children: "Workflow" }),
|
|
39576
|
+
/* @__PURE__ */ jsx138("div", { className: "space-y-1", children: workflow_summary.map((step, idx) => /* @__PURE__ */ jsxs96("div", { className: "flex items-start gap-2 text-xs", children: [
|
|
39577
|
+
/* @__PURE__ */ jsx138("span", { className: "shrink-0 w-5 h-5 rounded-full bg-interactive/10 flex items-center justify-center text-[10px] font-bold text-interactive", children: idx + 1 }),
|
|
39578
|
+
/* @__PURE__ */ jsx138("span", { className: "text-[var(--foreground)]/50 mt-0.5", children: step })
|
|
37821
39579
|
] }, idx)) })
|
|
37822
39580
|
] }),
|
|
37823
|
-
tools && tools.length > 0 && /* @__PURE__ */
|
|
37824
|
-
/* @__PURE__ */
|
|
37825
|
-
/* @__PURE__ */
|
|
39581
|
+
tools && tools.length > 0 && /* @__PURE__ */ jsxs96("div", { children: [
|
|
39582
|
+
/* @__PURE__ */ jsx138("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider mb-1.5", children: "Tools" }),
|
|
39583
|
+
/* @__PURE__ */ jsx138("div", { className: "flex flex-wrap gap-1.5", children: tools.map((tool) => /* @__PURE__ */ jsx138(
|
|
37826
39584
|
"span",
|
|
37827
39585
|
{
|
|
37828
39586
|
className: "text-[10px] font-mono px-2 py-0.5 rounded bg-interactive/[0.08] text-interactive/70 border border-interactive/10",
|
|
@@ -37838,8 +39596,8 @@ var InstructionPreview = ({
|
|
|
37838
39596
|
};
|
|
37839
39597
|
|
|
37840
39598
|
// src/molecules/workstream-builder/UIComponentSelector/UIComponentSelector.tsx
|
|
37841
|
-
import { useState as
|
|
37842
|
-
import { jsx as
|
|
39599
|
+
import { useState as useState21 } from "react";
|
|
39600
|
+
import { jsx as jsx139, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
37843
39601
|
var FONT_STYLE6 = {
|
|
37844
39602
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37845
39603
|
};
|
|
@@ -37850,11 +39608,11 @@ function UIComponentSelector({
|
|
|
37850
39608
|
className,
|
|
37851
39609
|
isLatestMessage = true
|
|
37852
39610
|
}) {
|
|
37853
|
-
const [selected, setSelected] =
|
|
39611
|
+
const [selected, setSelected] = useState21(() => {
|
|
37854
39612
|
const recommended = components.filter((c) => c.recommended).map((c) => c.name);
|
|
37855
39613
|
return new Set(recommended);
|
|
37856
39614
|
});
|
|
37857
|
-
const [submitted, setSubmitted] =
|
|
39615
|
+
const [submitted, setSubmitted] = useState21(false);
|
|
37858
39616
|
const grouped = components.reduce(
|
|
37859
39617
|
(acc, comp) => {
|
|
37860
39618
|
const cat = comp.category || "Other";
|
|
@@ -37878,7 +39636,7 @@ function UIComponentSelector({
|
|
|
37878
39636
|
onSelect?.(Array.from(selected));
|
|
37879
39637
|
};
|
|
37880
39638
|
const categoryOrder = Object.keys(grouped).sort();
|
|
37881
|
-
return /* @__PURE__ */
|
|
39639
|
+
return /* @__PURE__ */ jsxs97(
|
|
37882
39640
|
"div",
|
|
37883
39641
|
{
|
|
37884
39642
|
className: cn(
|
|
@@ -37887,8 +39645,8 @@ function UIComponentSelector({
|
|
|
37887
39645
|
),
|
|
37888
39646
|
style: FONT_STYLE6,
|
|
37889
39647
|
children: [
|
|
37890
|
-
/* @__PURE__ */
|
|
37891
|
-
/* @__PURE__ */
|
|
39648
|
+
/* @__PURE__ */ jsx139("div", { className: "px-4 py-3 border-b border-border/60 bg-muted/40", children: /* @__PURE__ */ jsxs97("div", { className: "flex items-center gap-2", children: [
|
|
39649
|
+
/* @__PURE__ */ jsx139("div", { className: "w-5 h-5 rounded-md bg-interactive/15 flex items-center justify-center", children: /* @__PURE__ */ jsxs97(
|
|
37892
39650
|
"svg",
|
|
37893
39651
|
{
|
|
37894
39652
|
width: "12",
|
|
@@ -37899,21 +39657,21 @@ function UIComponentSelector({
|
|
|
37899
39657
|
strokeWidth: "2",
|
|
37900
39658
|
className: "text-interactive",
|
|
37901
39659
|
children: [
|
|
37902
|
-
/* @__PURE__ */
|
|
37903
|
-
/* @__PURE__ */
|
|
37904
|
-
/* @__PURE__ */
|
|
37905
|
-
/* @__PURE__ */
|
|
39660
|
+
/* @__PURE__ */ jsx139("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
39661
|
+
/* @__PURE__ */ jsx139("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
39662
|
+
/* @__PURE__ */ jsx139("rect", { x: "3", y: "14", width: "7", height: "7" }),
|
|
39663
|
+
/* @__PURE__ */ jsx139("rect", { x: "14", y: "14", width: "7", height: "7" })
|
|
37906
39664
|
]
|
|
37907
39665
|
}
|
|
37908
39666
|
) }),
|
|
37909
|
-
/* @__PURE__ */
|
|
37910
|
-
/* @__PURE__ */
|
|
37911
|
-
/* @__PURE__ */
|
|
39667
|
+
/* @__PURE__ */ jsxs97("div", { children: [
|
|
39668
|
+
/* @__PURE__ */ jsx139("h3", { className: "text-xs font-semibold text-foreground", children: "Select UI Components" }),
|
|
39669
|
+
/* @__PURE__ */ jsx139("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: "Choose which visual components this agent can use in its responses." })
|
|
37912
39670
|
] })
|
|
37913
39671
|
] }) }),
|
|
37914
|
-
/* @__PURE__ */
|
|
37915
|
-
/* @__PURE__ */
|
|
37916
|
-
/* @__PURE__ */
|
|
39672
|
+
/* @__PURE__ */ jsx139("div", { className: "px-4 py-3 space-y-4", children: categoryOrder.map((category) => /* @__PURE__ */ jsxs97("div", { children: [
|
|
39673
|
+
/* @__PURE__ */ jsx139("h4", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-2", children: category }),
|
|
39674
|
+
/* @__PURE__ */ jsx139("div", { className: "space-y-1.5", children: grouped[category].map((comp) => /* @__PURE__ */ jsxs97(
|
|
37917
39675
|
"label",
|
|
37918
39676
|
{
|
|
37919
39677
|
className: cn(
|
|
@@ -37923,7 +39681,7 @@ function UIComponentSelector({
|
|
|
37923
39681
|
selected.has(comp.name) && submitted && "bg-interactive/5"
|
|
37924
39682
|
),
|
|
37925
39683
|
children: [
|
|
37926
|
-
/* @__PURE__ */
|
|
39684
|
+
/* @__PURE__ */ jsx139(
|
|
37927
39685
|
"div",
|
|
37928
39686
|
{
|
|
37929
39687
|
className: cn(
|
|
@@ -37934,7 +39692,7 @@ function UIComponentSelector({
|
|
|
37934
39692
|
e.preventDefault();
|
|
37935
39693
|
toggle(comp.name);
|
|
37936
39694
|
},
|
|
37937
|
-
children: selected.has(comp.name) && /* @__PURE__ */
|
|
39695
|
+
children: selected.has(comp.name) && /* @__PURE__ */ jsx139(
|
|
37938
39696
|
"svg",
|
|
37939
39697
|
{
|
|
37940
39698
|
width: "10",
|
|
@@ -37943,12 +39701,12 @@ function UIComponentSelector({
|
|
|
37943
39701
|
fill: "none",
|
|
37944
39702
|
stroke: "white",
|
|
37945
39703
|
strokeWidth: "3",
|
|
37946
|
-
children: /* @__PURE__ */
|
|
39704
|
+
children: /* @__PURE__ */ jsx139("polyline", { points: "20 6 9 17 4 12" })
|
|
37947
39705
|
}
|
|
37948
39706
|
)
|
|
37949
39707
|
}
|
|
37950
39708
|
),
|
|
37951
|
-
/* @__PURE__ */
|
|
39709
|
+
/* @__PURE__ */ jsx139(
|
|
37952
39710
|
"input",
|
|
37953
39711
|
{
|
|
37954
39712
|
type: "checkbox",
|
|
@@ -37958,11 +39716,11 @@ function UIComponentSelector({
|
|
|
37958
39716
|
className: "sr-only"
|
|
37959
39717
|
}
|
|
37960
39718
|
),
|
|
37961
|
-
/* @__PURE__ */
|
|
37962
|
-
/* @__PURE__ */
|
|
37963
|
-
/* @__PURE__ */
|
|
37964
|
-
comp.recommended && /* @__PURE__ */
|
|
37965
|
-
onPreview && /* @__PURE__ */
|
|
39719
|
+
/* @__PURE__ */ jsxs97("div", { className: "flex-1 min-w-0", children: [
|
|
39720
|
+
/* @__PURE__ */ jsxs97("div", { className: "flex items-center gap-1", children: [
|
|
39721
|
+
/* @__PURE__ */ jsx139("span", { className: "text-sm font-medium text-foreground", children: comp.display_name }),
|
|
39722
|
+
comp.recommended && /* @__PURE__ */ jsx139("span", { className: "px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider rounded-full bg-emerald-500/10 text-emerald-600 border border-emerald-500/20", children: "Recommended" }),
|
|
39723
|
+
onPreview && /* @__PURE__ */ jsx139(
|
|
37966
39724
|
"button",
|
|
37967
39725
|
{
|
|
37968
39726
|
type: "button",
|
|
@@ -37973,7 +39731,7 @@ function UIComponentSelector({
|
|
|
37973
39731
|
},
|
|
37974
39732
|
className: "shrink-0 p-0.5 rounded hover:bg-muted transition-colors",
|
|
37975
39733
|
title: `Preview ${comp.display_name}`,
|
|
37976
|
-
children: /* @__PURE__ */
|
|
39734
|
+
children: /* @__PURE__ */ jsxs97(
|
|
37977
39735
|
"svg",
|
|
37978
39736
|
{
|
|
37979
39737
|
width: "14",
|
|
@@ -37986,28 +39744,28 @@ function UIComponentSelector({
|
|
|
37986
39744
|
strokeLinejoin: "round",
|
|
37987
39745
|
className: "text-muted-foreground hover:text-interactive",
|
|
37988
39746
|
children: [
|
|
37989
|
-
/* @__PURE__ */
|
|
37990
|
-
/* @__PURE__ */
|
|
37991
|
-
/* @__PURE__ */
|
|
39747
|
+
/* @__PURE__ */ jsx139("circle", { cx: "12", cy: "12", r: "10" }),
|
|
39748
|
+
/* @__PURE__ */ jsx139("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
39749
|
+
/* @__PURE__ */ jsx139("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
37992
39750
|
]
|
|
37993
39751
|
}
|
|
37994
39752
|
)
|
|
37995
39753
|
}
|
|
37996
39754
|
)
|
|
37997
39755
|
] }),
|
|
37998
|
-
/* @__PURE__ */
|
|
39756
|
+
/* @__PURE__ */ jsx139("span", { className: "ml-0 text-xs text-muted-foreground", children: comp.description })
|
|
37999
39757
|
] })
|
|
38000
39758
|
]
|
|
38001
39759
|
},
|
|
38002
39760
|
comp.name
|
|
38003
39761
|
)) })
|
|
38004
39762
|
] }, category)) }),
|
|
38005
|
-
!submitted && isLatestMessage && /* @__PURE__ */
|
|
38006
|
-
/* @__PURE__ */
|
|
39763
|
+
!submitted && isLatestMessage && /* @__PURE__ */ jsxs97("div", { className: "px-4 py-3 border-t border-border/60 flex items-center justify-between bg-muted/30", children: [
|
|
39764
|
+
/* @__PURE__ */ jsxs97("span", { className: "text-xs text-muted-foreground", children: [
|
|
38007
39765
|
selected.size,
|
|
38008
39766
|
" selected"
|
|
38009
39767
|
] }),
|
|
38010
|
-
/* @__PURE__ */
|
|
39768
|
+
/* @__PURE__ */ jsx139(
|
|
38011
39769
|
"button",
|
|
38012
39770
|
{
|
|
38013
39771
|
onClick: handleContinue,
|
|
@@ -38016,14 +39774,14 @@ function UIComponentSelector({
|
|
|
38016
39774
|
}
|
|
38017
39775
|
)
|
|
38018
39776
|
] }),
|
|
38019
|
-
submitted && /* @__PURE__ */
|
|
39777
|
+
submitted && /* @__PURE__ */ jsx139("div", { className: "px-4 pb-3", children: /* @__PURE__ */ jsx139("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5", children: "Selections confirmed" }) })
|
|
38020
39778
|
]
|
|
38021
39779
|
}
|
|
38022
39780
|
);
|
|
38023
39781
|
}
|
|
38024
39782
|
|
|
38025
39783
|
// src/molecules/workstream-builder/MultiAgentCard/MultiAgentCard.tsx
|
|
38026
|
-
import { jsx as
|
|
39784
|
+
import { jsx as jsx140, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
38027
39785
|
var FONT_STYLE7 = {
|
|
38028
39786
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38029
39787
|
};
|
|
@@ -38036,7 +39794,7 @@ var MultiAgentCard = ({
|
|
|
38036
39794
|
className
|
|
38037
39795
|
}) => {
|
|
38038
39796
|
const avatarUrl = `https://api.dicebear.com/7.x/avataaars/svg?seed=${name}`;
|
|
38039
|
-
return /* @__PURE__ */
|
|
39797
|
+
return /* @__PURE__ */ jsxs98(
|
|
38040
39798
|
"div",
|
|
38041
39799
|
{
|
|
38042
39800
|
className: cn(
|
|
@@ -38045,14 +39803,14 @@ var MultiAgentCard = ({
|
|
|
38045
39803
|
),
|
|
38046
39804
|
style: FONT_STYLE7,
|
|
38047
39805
|
children: [
|
|
38048
|
-
/* @__PURE__ */
|
|
38049
|
-
/* @__PURE__ */
|
|
38050
|
-
/* @__PURE__ */
|
|
38051
|
-
/* @__PURE__ */
|
|
38052
|
-
/* @__PURE__ */
|
|
38053
|
-
/* @__PURE__ */
|
|
38054
|
-
/* @__PURE__ */
|
|
38055
|
-
/* @__PURE__ */
|
|
39806
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex items-start gap-4 px-5 py-4 bg-gradient-to-r from-[var(--foreground)]/[0.02] to-transparent", children: [
|
|
39807
|
+
/* @__PURE__ */ jsx140("div", { className: "h-12 w-12 shrink-0 rounded-full border-2 border-interactive/20 overflow-hidden bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ jsx140("img", { src: avatarUrl, alt: display_name, className: "h-full w-full" }) }),
|
|
39808
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex-1 min-w-0", children: [
|
|
39809
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex items-center gap-2", children: [
|
|
39810
|
+
/* @__PURE__ */ jsx140("h4", { className: "text-sm font-semibold text-[var(--foreground)] truncate", children: display_name }),
|
|
39811
|
+
/* @__PURE__ */ jsx140("span", { className: "text-[11px] font-mono text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.05] px-1.5 py-0.5 rounded", children: name }),
|
|
39812
|
+
/* @__PURE__ */ jsx140("span", { className: "text-[10px] px-2 py-0.5 rounded-full font-medium bg-interactive/10 text-interactive", children: "Multi-Agent" }),
|
|
39813
|
+
/* @__PURE__ */ jsxs98(
|
|
38056
39814
|
"span",
|
|
38057
39815
|
{
|
|
38058
39816
|
className: cn(
|
|
@@ -38060,7 +39818,7 @@ var MultiAgentCard = ({
|
|
|
38060
39818
|
enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
38061
39819
|
),
|
|
38062
39820
|
children: [
|
|
38063
|
-
/* @__PURE__ */
|
|
39821
|
+
/* @__PURE__ */ jsx140("span", { className: cn(
|
|
38064
39822
|
"w-1.5 h-1.5 rounded-full",
|
|
38065
39823
|
enabled ? "bg-emerald-500" : "bg-red-500"
|
|
38066
39824
|
) }),
|
|
@@ -38069,18 +39827,18 @@ var MultiAgentCard = ({
|
|
|
38069
39827
|
}
|
|
38070
39828
|
)
|
|
38071
39829
|
] }),
|
|
38072
|
-
/* @__PURE__ */
|
|
39830
|
+
/* @__PURE__ */ jsx140("p", { className: "text-xs text-[var(--foreground)]/60 leading-relaxed mt-1 whitespace-normal", style: { textWrap: "auto" }, children: description })
|
|
38073
39831
|
] })
|
|
38074
39832
|
] }),
|
|
38075
|
-
stages.length > 0 && /* @__PURE__ */
|
|
38076
|
-
/* @__PURE__ */
|
|
39833
|
+
stages.length > 0 && /* @__PURE__ */ jsxs98("div", { className: "border-t border-[var(--border-color)] px-5 py-4", children: [
|
|
39834
|
+
/* @__PURE__ */ jsxs98("p", { className: "text-[11px] font-semibold text-[var(--foreground)]/40 uppercase tracking-wide mb-3", children: [
|
|
38077
39835
|
"Stages (",
|
|
38078
39836
|
stages.length,
|
|
38079
39837
|
")"
|
|
38080
39838
|
] }),
|
|
38081
|
-
/* @__PURE__ */
|
|
38082
|
-
/* @__PURE__ */
|
|
38083
|
-
/* @__PURE__ */
|
|
39839
|
+
/* @__PURE__ */ jsx140("div", { className: "flex flex-col gap-0", children: stages.map((stage, idx) => /* @__PURE__ */ jsxs98("div", { className: "flex items-stretch", children: [
|
|
39840
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex flex-col items-center mr-3 w-5", children: [
|
|
39841
|
+
/* @__PURE__ */ jsx140(
|
|
38084
39842
|
"div",
|
|
38085
39843
|
{
|
|
38086
39844
|
className: cn(
|
|
@@ -38090,20 +39848,20 @@ var MultiAgentCard = ({
|
|
|
38090
39848
|
children: idx + 1
|
|
38091
39849
|
}
|
|
38092
39850
|
),
|
|
38093
|
-
idx < stages.length - 1 && /* @__PURE__ */
|
|
39851
|
+
idx < stages.length - 1 && /* @__PURE__ */ jsx140("div", { className: "w-px flex-1 min-h-[16px] border-l border-dashed border-interactive/30" })
|
|
38094
39852
|
] }),
|
|
38095
|
-
/* @__PURE__ */
|
|
38096
|
-
/* @__PURE__ */
|
|
38097
|
-
/* @__PURE__ */
|
|
38098
|
-
/* @__PURE__ */
|
|
39853
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex-1 mb-2 p-3 rounded-lg border border-[var(--border-color)] bg-[var(--foreground)]/[0.02]", children: [
|
|
39854
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex items-center gap-2", children: [
|
|
39855
|
+
/* @__PURE__ */ jsx140("span", { className: "text-xs font-semibold text-[var(--foreground)]", children: stage.name }),
|
|
39856
|
+
/* @__PURE__ */ jsx140("span", { className: "text-[10px] font-mono text-[var(--foreground)]/30 bg-[var(--foreground)]/[0.04] px-1.5 py-0.5 rounded", children: stage.agent_name })
|
|
38099
39857
|
] }),
|
|
38100
|
-
/* @__PURE__ */
|
|
38101
|
-
stage.tools && stage.tools.length > 0 && /* @__PURE__ */
|
|
39858
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex items-center gap-3 mt-1.5 text-[10px] text-[var(--foreground)]/50", children: [
|
|
39859
|
+
stage.tools && stage.tools.length > 0 && /* @__PURE__ */ jsxs98("span", { children: [
|
|
38102
39860
|
stage.tools.length,
|
|
38103
39861
|
" tool",
|
|
38104
39862
|
stage.tools.length !== 1 ? "s" : ""
|
|
38105
39863
|
] }),
|
|
38106
|
-
stage.ui_components && stage.ui_components.length > 0 && /* @__PURE__ */
|
|
39864
|
+
stage.ui_components && stage.ui_components.length > 0 && /* @__PURE__ */ jsxs98("span", { children: [
|
|
38107
39865
|
stage.ui_components.length,
|
|
38108
39866
|
" component",
|
|
38109
39867
|
stage.ui_components.length !== 1 ? "s" : ""
|
|
@@ -38118,7 +39876,7 @@ var MultiAgentCard = ({
|
|
|
38118
39876
|
};
|
|
38119
39877
|
|
|
38120
39878
|
// src/molecules/workstream-builder/MultiAgentPlan/MultiAgentPlan.tsx
|
|
38121
|
-
import { jsx as
|
|
39879
|
+
import { jsx as jsx141, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
38122
39880
|
var FONT_STYLE8 = {
|
|
38123
39881
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38124
39882
|
};
|
|
@@ -38126,7 +39884,7 @@ var MultiAgentPlan = ({
|
|
|
38126
39884
|
stages = [],
|
|
38127
39885
|
className
|
|
38128
39886
|
}) => {
|
|
38129
|
-
return /* @__PURE__ */
|
|
39887
|
+
return /* @__PURE__ */ jsxs99(
|
|
38130
39888
|
"div",
|
|
38131
39889
|
{
|
|
38132
39890
|
className: cn(
|
|
@@ -38135,8 +39893,8 @@ var MultiAgentPlan = ({
|
|
|
38135
39893
|
),
|
|
38136
39894
|
style: FONT_STYLE8,
|
|
38137
39895
|
children: [
|
|
38138
|
-
/* @__PURE__ */
|
|
38139
|
-
/* @__PURE__ */
|
|
39896
|
+
/* @__PURE__ */ jsx141("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-gradient-to-r from-[var(--foreground)]/[0.02] to-transparent", children: /* @__PURE__ */ jsxs99("div", { className: "flex items-center gap-2", children: [
|
|
39897
|
+
/* @__PURE__ */ jsx141("div", { className: "w-4 h-4 rounded bg-violet-500/20 flex items-center justify-center", children: /* @__PURE__ */ jsx141(
|
|
38140
39898
|
"svg",
|
|
38141
39899
|
{
|
|
38142
39900
|
width: "10",
|
|
@@ -38146,20 +39904,20 @@ var MultiAgentPlan = ({
|
|
|
38146
39904
|
stroke: "currentColor",
|
|
38147
39905
|
strokeWidth: "2",
|
|
38148
39906
|
className: "text-violet-600",
|
|
38149
|
-
children: /* @__PURE__ */
|
|
39907
|
+
children: /* @__PURE__ */ jsx141("path", { d: "M16 3h5v5M4 20L21 3M21 16v5h-5M15 15l6 6M4 4l5 5" })
|
|
38150
39908
|
}
|
|
38151
39909
|
) }),
|
|
38152
|
-
/* @__PURE__ */
|
|
38153
|
-
/* @__PURE__ */
|
|
39910
|
+
/* @__PURE__ */ jsx141("span", { className: "text-xs font-semibold text-[var(--foreground)]", children: "Proposed Multi-Agent Workflow" }),
|
|
39911
|
+
/* @__PURE__ */ jsx141("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-600 font-medium", children: "Draft" })
|
|
38154
39912
|
] }) }),
|
|
38155
|
-
/* @__PURE__ */
|
|
38156
|
-
/* @__PURE__ */
|
|
38157
|
-
/* @__PURE__ */
|
|
38158
|
-
idx < stages.length - 1 && /* @__PURE__ */
|
|
39913
|
+
/* @__PURE__ */ jsx141("div", { className: "px-4 py-3", children: /* @__PURE__ */ jsx141("div", { className: "flex flex-col gap-0", children: stages.map((stage, idx) => /* @__PURE__ */ jsxs99("div", { className: "flex items-stretch min-w-0", children: [
|
|
39914
|
+
/* @__PURE__ */ jsxs99("div", { className: "flex flex-col items-center mr-3 w-6", children: [
|
|
39915
|
+
/* @__PURE__ */ jsx141("div", { className: "w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 bg-interactive/10 text-interactive border border-interactive/30", children: idx + 1 }),
|
|
39916
|
+
idx < stages.length - 1 && /* @__PURE__ */ jsx141("div", { className: "w-px flex-1 min-h-[12px] border-l border-dashed border-interactive/30" })
|
|
38159
39917
|
] }),
|
|
38160
|
-
/* @__PURE__ */
|
|
38161
|
-
/* @__PURE__ */
|
|
38162
|
-
stage.description && /* @__PURE__ */
|
|
39918
|
+
/* @__PURE__ */ jsxs99("div", { className: "flex-1 mb-2 pb-2 min-w-0", children: [
|
|
39919
|
+
/* @__PURE__ */ jsx141("p", { className: "text-xs font-semibold text-foreground", children: stage.name }),
|
|
39920
|
+
stage.description && /* @__PURE__ */ jsx141(
|
|
38163
39921
|
"p",
|
|
38164
39922
|
{
|
|
38165
39923
|
className: "text-[11px] text-foreground/50 mt-0.5 whitespace-normal",
|
|
@@ -38167,7 +39925,7 @@ var MultiAgentPlan = ({
|
|
|
38167
39925
|
children: stage.description
|
|
38168
39926
|
}
|
|
38169
39927
|
),
|
|
38170
|
-
stage.proposed_tools && stage.proposed_tools.length > 0 && /* @__PURE__ */
|
|
39928
|
+
stage.proposed_tools && stage.proposed_tools.length > 0 && /* @__PURE__ */ jsx141("div", { className: "flex flex-wrap gap-1 mt-1.5", children: stage.proposed_tools.map((tool) => /* @__PURE__ */ jsx141(
|
|
38171
39929
|
"span",
|
|
38172
39930
|
{
|
|
38173
39931
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-interactive/10 text-interactive font-mono",
|
|
@@ -38183,8 +39941,8 @@ var MultiAgentPlan = ({
|
|
|
38183
39941
|
};
|
|
38184
39942
|
|
|
38185
39943
|
// src/molecules/workstream-builder/MultiAgentUISelector/MultiAgentUISelector.tsx
|
|
38186
|
-
import { useState as
|
|
38187
|
-
import { jsx as
|
|
39944
|
+
import { useState as useState22, useCallback as useCallback10 } from "react";
|
|
39945
|
+
import { jsx as jsx142, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
38188
39946
|
var FONT_STYLE9 = {
|
|
38189
39947
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38190
39948
|
};
|
|
@@ -38196,8 +39954,8 @@ var MultiAgentUISelector = ({
|
|
|
38196
39954
|
className,
|
|
38197
39955
|
isLatestMessage = true
|
|
38198
39956
|
}) => {
|
|
38199
|
-
const [activeStageId, setActiveStageId] =
|
|
38200
|
-
const [selections, setSelections] =
|
|
39957
|
+
const [activeStageId, setActiveStageId] = useState22(stages[0]?.id || "");
|
|
39958
|
+
const [selections, setSelections] = useState22(
|
|
38201
39959
|
() => {
|
|
38202
39960
|
const init = {};
|
|
38203
39961
|
const recommendedNames = components.filter((c) => c.recommended).map((c) => c.name);
|
|
@@ -38208,14 +39966,14 @@ var MultiAgentUISelector = ({
|
|
|
38208
39966
|
return init;
|
|
38209
39967
|
}
|
|
38210
39968
|
);
|
|
38211
|
-
const [submitted, setSubmitted] =
|
|
39969
|
+
const [submitted, setSubmitted] = useState22(false);
|
|
38212
39970
|
const grouped = components.reduce((acc, comp) => {
|
|
38213
39971
|
const cat = comp.category || "Other";
|
|
38214
39972
|
if (!acc[cat]) acc[cat] = [];
|
|
38215
39973
|
acc[cat].push(comp);
|
|
38216
39974
|
return acc;
|
|
38217
39975
|
}, {});
|
|
38218
|
-
const toggleComponent =
|
|
39976
|
+
const toggleComponent = useCallback10(
|
|
38219
39977
|
(stageId, compName) => {
|
|
38220
39978
|
if (submitted || !isLatestMessage) return;
|
|
38221
39979
|
setSelections((prev) => {
|
|
@@ -38232,7 +39990,7 @@ var MultiAgentUISelector = ({
|
|
|
38232
39990
|
},
|
|
38233
39991
|
[submitted]
|
|
38234
39992
|
);
|
|
38235
|
-
const selectAll =
|
|
39993
|
+
const selectAll = useCallback10(
|
|
38236
39994
|
(stageId) => {
|
|
38237
39995
|
if (submitted || !isLatestMessage) return;
|
|
38238
39996
|
setSelections((prev) => {
|
|
@@ -38243,7 +40001,7 @@ var MultiAgentUISelector = ({
|
|
|
38243
40001
|
},
|
|
38244
40002
|
[submitted, isLatestMessage, components]
|
|
38245
40003
|
);
|
|
38246
|
-
const clearAll =
|
|
40004
|
+
const clearAll = useCallback10(
|
|
38247
40005
|
(stageId) => {
|
|
38248
40006
|
if (submitted || !isLatestMessage) return;
|
|
38249
40007
|
setSelections((prev) => {
|
|
@@ -38254,7 +40012,7 @@ var MultiAgentUISelector = ({
|
|
|
38254
40012
|
},
|
|
38255
40013
|
[submitted, isLatestMessage]
|
|
38256
40014
|
);
|
|
38257
|
-
const handleContinue =
|
|
40015
|
+
const handleContinue = useCallback10(() => {
|
|
38258
40016
|
setSubmitted(true);
|
|
38259
40017
|
if (onSelect) {
|
|
38260
40018
|
const result = {};
|
|
@@ -38265,7 +40023,7 @@ var MultiAgentUISelector = ({
|
|
|
38265
40023
|
}
|
|
38266
40024
|
}, [onSelect, selections]);
|
|
38267
40025
|
const activeStage = stages.find((s) => s.id === activeStageId);
|
|
38268
|
-
return /* @__PURE__ */
|
|
40026
|
+
return /* @__PURE__ */ jsxs100(
|
|
38269
40027
|
"div",
|
|
38270
40028
|
{
|
|
38271
40029
|
className: cn(
|
|
@@ -38274,8 +40032,8 @@ var MultiAgentUISelector = ({
|
|
|
38274
40032
|
),
|
|
38275
40033
|
style: FONT_STYLE9,
|
|
38276
40034
|
children: [
|
|
38277
|
-
/* @__PURE__ */
|
|
38278
|
-
/* @__PURE__ */
|
|
40035
|
+
/* @__PURE__ */ jsx142("div", { className: "px-4 py-3 border-b border-border/60 bg-muted/40", children: /* @__PURE__ */ jsxs100("div", { className: "flex items-center gap-2", children: [
|
|
40036
|
+
/* @__PURE__ */ jsx142("div", { className: "w-5 h-5 rounded-md bg-interactive/15 flex items-center justify-center", children: /* @__PURE__ */ jsxs100(
|
|
38279
40037
|
"svg",
|
|
38280
40038
|
{
|
|
38281
40039
|
width: "12",
|
|
@@ -38286,16 +40044,16 @@ var MultiAgentUISelector = ({
|
|
|
38286
40044
|
strokeWidth: "2",
|
|
38287
40045
|
className: "text-interactive",
|
|
38288
40046
|
children: [
|
|
38289
|
-
/* @__PURE__ */
|
|
38290
|
-
/* @__PURE__ */
|
|
38291
|
-
/* @__PURE__ */
|
|
38292
|
-
/* @__PURE__ */
|
|
40047
|
+
/* @__PURE__ */ jsx142("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
40048
|
+
/* @__PURE__ */ jsx142("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
40049
|
+
/* @__PURE__ */ jsx142("rect", { x: "3", y: "14", width: "7", height: "7" }),
|
|
40050
|
+
/* @__PURE__ */ jsx142("rect", { x: "14", y: "14", width: "7", height: "7" })
|
|
38293
40051
|
]
|
|
38294
40052
|
}
|
|
38295
40053
|
) }),
|
|
38296
|
-
/* @__PURE__ */
|
|
40054
|
+
/* @__PURE__ */ jsx142("span", { className: "text-xs font-semibold text-foreground", children: "UI Components per Stage" })
|
|
38297
40055
|
] }) }),
|
|
38298
|
-
/* @__PURE__ */
|
|
40056
|
+
/* @__PURE__ */ jsx142("div", { className: "flex gap-1 border-b border-border/60 px-4 py-2 bg-muted/20", children: stages.map((stage) => /* @__PURE__ */ jsx142(
|
|
38299
40057
|
"button",
|
|
38300
40058
|
{
|
|
38301
40059
|
onClick: () => setActiveStageId(stage.id),
|
|
@@ -38307,17 +40065,17 @@ var MultiAgentUISelector = ({
|
|
|
38307
40065
|
},
|
|
38308
40066
|
stage.id
|
|
38309
40067
|
)) }),
|
|
38310
|
-
/* @__PURE__ */
|
|
38311
|
-
activeStage && /* @__PURE__ */
|
|
38312
|
-
/* @__PURE__ */
|
|
40068
|
+
/* @__PURE__ */ jsxs100("div", { className: "px-4 py-3", children: [
|
|
40069
|
+
activeStage && /* @__PURE__ */ jsxs100("div", { className: "flex items-center justify-between mb-3", children: [
|
|
40070
|
+
/* @__PURE__ */ jsxs100("p", { className: "text-[10px] text-muted-foreground", children: [
|
|
38313
40071
|
"Select components for ",
|
|
38314
|
-
/* @__PURE__ */
|
|
40072
|
+
/* @__PURE__ */ jsx142("strong", { className: "text-foreground", children: activeStage.name }),
|
|
38315
40073
|
" (",
|
|
38316
40074
|
activeStage.agent_name,
|
|
38317
40075
|
")"
|
|
38318
40076
|
] }),
|
|
38319
|
-
!submitted && isLatestMessage && /* @__PURE__ */
|
|
38320
|
-
/* @__PURE__ */
|
|
40077
|
+
!submitted && isLatestMessage && /* @__PURE__ */ jsxs100("div", { className: "flex items-center gap-2", children: [
|
|
40078
|
+
/* @__PURE__ */ jsx142(
|
|
38321
40079
|
"button",
|
|
38322
40080
|
{
|
|
38323
40081
|
onClick: () => selectAll(activeStageId),
|
|
@@ -38325,8 +40083,8 @@ var MultiAgentUISelector = ({
|
|
|
38325
40083
|
children: "Select All"
|
|
38326
40084
|
}
|
|
38327
40085
|
),
|
|
38328
|
-
/* @__PURE__ */
|
|
38329
|
-
/* @__PURE__ */
|
|
40086
|
+
/* @__PURE__ */ jsx142("span", { className: "text-muted-foreground/40", children: "|" }),
|
|
40087
|
+
/* @__PURE__ */ jsx142(
|
|
38330
40088
|
"button",
|
|
38331
40089
|
{
|
|
38332
40090
|
onClick: () => clearAll(activeStageId),
|
|
@@ -38336,11 +40094,11 @@ var MultiAgentUISelector = ({
|
|
|
38336
40094
|
)
|
|
38337
40095
|
] })
|
|
38338
40096
|
] }),
|
|
38339
|
-
Object.entries(grouped).map(([category, comps]) => /* @__PURE__ */
|
|
38340
|
-
/* @__PURE__ */
|
|
38341
|
-
/* @__PURE__ */
|
|
40097
|
+
Object.entries(grouped).map(([category, comps]) => /* @__PURE__ */ jsxs100("div", { className: "mb-3", children: [
|
|
40098
|
+
/* @__PURE__ */ jsx142("p", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5", children: category }),
|
|
40099
|
+
/* @__PURE__ */ jsx142("div", { className: "grid grid-cols-2 gap-1.5", children: comps.map((comp) => {
|
|
38342
40100
|
const isSelected = selections[activeStageId]?.has(comp.name) || false;
|
|
38343
|
-
return /* @__PURE__ */
|
|
40101
|
+
return /* @__PURE__ */ jsxs100(
|
|
38344
40102
|
"div",
|
|
38345
40103
|
{
|
|
38346
40104
|
role: "button",
|
|
@@ -38358,15 +40116,15 @@ var MultiAgentUISelector = ({
|
|
|
38358
40116
|
(submitted || !isLatestMessage) && "opacity-60 cursor-default"
|
|
38359
40117
|
),
|
|
38360
40118
|
children: [
|
|
38361
|
-
/* @__PURE__ */
|
|
38362
|
-
/* @__PURE__ */
|
|
40119
|
+
/* @__PURE__ */ jsxs100("div", { className: "flex items-center gap-1.5", children: [
|
|
40120
|
+
/* @__PURE__ */ jsx142(
|
|
38363
40121
|
"div",
|
|
38364
40122
|
{
|
|
38365
40123
|
className: cn(
|
|
38366
40124
|
"w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0",
|
|
38367
40125
|
isSelected ? "bg-interactive border-interactive" : "border-muted-foreground/30"
|
|
38368
40126
|
),
|
|
38369
|
-
children: isSelected && /* @__PURE__ */
|
|
40127
|
+
children: isSelected && /* @__PURE__ */ jsx142(
|
|
38370
40128
|
"svg",
|
|
38371
40129
|
{
|
|
38372
40130
|
width: "8",
|
|
@@ -38375,14 +40133,14 @@ var MultiAgentUISelector = ({
|
|
|
38375
40133
|
fill: "none",
|
|
38376
40134
|
stroke: "white",
|
|
38377
40135
|
strokeWidth: "3",
|
|
38378
|
-
children: /* @__PURE__ */
|
|
40136
|
+
children: /* @__PURE__ */ jsx142("polyline", { points: "20 6 9 17 4 12" })
|
|
38379
40137
|
}
|
|
38380
40138
|
)
|
|
38381
40139
|
}
|
|
38382
40140
|
),
|
|
38383
|
-
/* @__PURE__ */
|
|
38384
|
-
comp.recommended && /* @__PURE__ */
|
|
38385
|
-
onPreview && /* @__PURE__ */
|
|
40141
|
+
/* @__PURE__ */ jsx142("span", { className: "font-medium text-foreground", children: comp.display_name }),
|
|
40142
|
+
comp.recommended && /* @__PURE__ */ jsx142("span", { className: "px-1 py-px text-[8px] font-semibold uppercase tracking-wider rounded-full bg-emerald-500/10 text-emerald-600 border border-emerald-500/20 leading-tight", children: "Rec" }),
|
|
40143
|
+
onPreview && /* @__PURE__ */ jsx142(
|
|
38386
40144
|
"button",
|
|
38387
40145
|
{
|
|
38388
40146
|
type: "button",
|
|
@@ -38392,7 +40150,7 @@ var MultiAgentUISelector = ({
|
|
|
38392
40150
|
},
|
|
38393
40151
|
className: "ml-auto shrink-0 p-0.5 rounded hover:bg-muted transition-colors",
|
|
38394
40152
|
title: `Preview ${comp.display_name}`,
|
|
38395
|
-
children: /* @__PURE__ */
|
|
40153
|
+
children: /* @__PURE__ */ jsxs100(
|
|
38396
40154
|
"svg",
|
|
38397
40155
|
{
|
|
38398
40156
|
width: "14",
|
|
@@ -38405,16 +40163,16 @@ var MultiAgentUISelector = ({
|
|
|
38405
40163
|
strokeLinejoin: "round",
|
|
38406
40164
|
className: "text-muted-foreground hover:text-primary",
|
|
38407
40165
|
children: [
|
|
38408
|
-
/* @__PURE__ */
|
|
38409
|
-
/* @__PURE__ */
|
|
38410
|
-
/* @__PURE__ */
|
|
40166
|
+
/* @__PURE__ */ jsx142("circle", { cx: "12", cy: "12", r: "10" }),
|
|
40167
|
+
/* @__PURE__ */ jsx142("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
40168
|
+
/* @__PURE__ */ jsx142("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
38411
40169
|
]
|
|
38412
40170
|
}
|
|
38413
40171
|
)
|
|
38414
40172
|
}
|
|
38415
40173
|
)
|
|
38416
40174
|
] }),
|
|
38417
|
-
/* @__PURE__ */
|
|
40175
|
+
/* @__PURE__ */ jsx142("p", { className: "text-[10px] text-muted-foreground mt-0.5 ml-5 whitespace-normal", children: comp.description })
|
|
38418
40176
|
]
|
|
38419
40177
|
},
|
|
38420
40178
|
comp.name
|
|
@@ -38422,7 +40180,7 @@ var MultiAgentUISelector = ({
|
|
|
38422
40180
|
}) })
|
|
38423
40181
|
] }, category))
|
|
38424
40182
|
] }),
|
|
38425
|
-
!submitted && isLatestMessage && /* @__PURE__ */
|
|
40183
|
+
!submitted && isLatestMessage && /* @__PURE__ */ jsx142("div", { className: "px-4 py-3 border-t border-border/60 bg-muted/30", children: /* @__PURE__ */ jsx142(
|
|
38426
40184
|
"button",
|
|
38427
40185
|
{
|
|
38428
40186
|
onClick: handleContinue,
|
|
@@ -38430,14 +40188,14 @@ var MultiAgentUISelector = ({
|
|
|
38430
40188
|
children: "Continue"
|
|
38431
40189
|
}
|
|
38432
40190
|
) }),
|
|
38433
|
-
submitted && /* @__PURE__ */
|
|
40191
|
+
submitted && /* @__PURE__ */ jsx142("div", { className: "px-4 pb-3", children: /* @__PURE__ */ jsx142("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5", children: "Selections confirmed" }) })
|
|
38434
40192
|
]
|
|
38435
40193
|
}
|
|
38436
40194
|
);
|
|
38437
40195
|
};
|
|
38438
40196
|
|
|
38439
40197
|
// src/molecules/workstream-builder/StageIndicator/StageIndicator.tsx
|
|
38440
|
-
import { jsx as
|
|
40198
|
+
import { jsx as jsx143, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
38441
40199
|
var FONT_STYLE10 = {
|
|
38442
40200
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38443
40201
|
};
|
|
@@ -38446,7 +40204,7 @@ var StageIndicator = ({
|
|
|
38446
40204
|
agent_name,
|
|
38447
40205
|
className
|
|
38448
40206
|
}) => {
|
|
38449
|
-
return /* @__PURE__ */
|
|
40207
|
+
return /* @__PURE__ */ jsxs101(
|
|
38450
40208
|
"div",
|
|
38451
40209
|
{
|
|
38452
40210
|
className: cn(
|
|
@@ -38455,12 +40213,12 @@ var StageIndicator = ({
|
|
|
38455
40213
|
),
|
|
38456
40214
|
style: { ...FONT_STYLE10, animation: "fadeIn 0.3s ease-out" },
|
|
38457
40215
|
children: [
|
|
38458
|
-
/* @__PURE__ */
|
|
38459
|
-
/* @__PURE__ */
|
|
38460
|
-
/* @__PURE__ */
|
|
38461
|
-
/* @__PURE__ */
|
|
40216
|
+
/* @__PURE__ */ jsx143("div", { className: "flex-1 h-px bg-[var(--border-color)]" }),
|
|
40217
|
+
/* @__PURE__ */ jsxs101("div", { className: "flex items-center gap-1.5 px-3 py-1 rounded-full bg-violet-500/10 border border-violet-500/20", children: [
|
|
40218
|
+
/* @__PURE__ */ jsx143("div", { className: "w-1.5 h-1.5 rounded-full bg-violet-500 animate-pulse" }),
|
|
40219
|
+
/* @__PURE__ */ jsx143("span", { className: "text-[10px] font-medium text-violet-600", children: stage_name || agent_name })
|
|
38462
40220
|
] }),
|
|
38463
|
-
/* @__PURE__ */
|
|
40221
|
+
/* @__PURE__ */ jsx143("div", { className: "flex-1 h-px bg-[var(--border-color)]" })
|
|
38464
40222
|
]
|
|
38465
40223
|
}
|
|
38466
40224
|
);
|
|
@@ -38758,7 +40516,7 @@ __export(ui_exports, {
|
|
|
38758
40516
|
// src/components/ui/button-group.tsx
|
|
38759
40517
|
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
38760
40518
|
import { cva as cva8 } from "class-variance-authority";
|
|
38761
|
-
import { jsx as
|
|
40519
|
+
import { jsx as jsx144 } from "react/jsx-runtime";
|
|
38762
40520
|
var buttonGroupVariants = cva8(
|
|
38763
40521
|
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
38764
40522
|
{
|
|
@@ -38778,7 +40536,7 @@ function ButtonGroup({
|
|
|
38778
40536
|
orientation,
|
|
38779
40537
|
...props
|
|
38780
40538
|
}) {
|
|
38781
|
-
return /* @__PURE__ */
|
|
40539
|
+
return /* @__PURE__ */ jsx144(
|
|
38782
40540
|
"div",
|
|
38783
40541
|
{
|
|
38784
40542
|
role: "group",
|
|
@@ -38795,7 +40553,7 @@ function ButtonGroupText({
|
|
|
38795
40553
|
...props
|
|
38796
40554
|
}) {
|
|
38797
40555
|
const Comp = asChild ? Slot4 : "div";
|
|
38798
|
-
return /* @__PURE__ */
|
|
40556
|
+
return /* @__PURE__ */ jsx144(
|
|
38799
40557
|
Comp,
|
|
38800
40558
|
{
|
|
38801
40559
|
className: cn(
|
|
@@ -38811,7 +40569,7 @@ function ButtonGroupSeparator({
|
|
|
38811
40569
|
orientation = "vertical",
|
|
38812
40570
|
...props
|
|
38813
40571
|
}) {
|
|
38814
|
-
return /* @__PURE__ */
|
|
40572
|
+
return /* @__PURE__ */ jsx144(
|
|
38815
40573
|
Separator2,
|
|
38816
40574
|
{
|
|
38817
40575
|
"data-slot": "button-group-separator",
|
|
@@ -38827,9 +40585,9 @@ function ButtonGroupSeparator({
|
|
|
38827
40585
|
|
|
38828
40586
|
// src/components/ui/empty.tsx
|
|
38829
40587
|
import { cva as cva9 } from "class-variance-authority";
|
|
38830
|
-
import { jsx as
|
|
40588
|
+
import { jsx as jsx145 } from "react/jsx-runtime";
|
|
38831
40589
|
function Empty({ className, ...props }) {
|
|
38832
|
-
return /* @__PURE__ */
|
|
40590
|
+
return /* @__PURE__ */ jsx145(
|
|
38833
40591
|
"div",
|
|
38834
40592
|
{
|
|
38835
40593
|
"data-slot": "empty",
|
|
@@ -38842,7 +40600,7 @@ function Empty({ className, ...props }) {
|
|
|
38842
40600
|
);
|
|
38843
40601
|
}
|
|
38844
40602
|
function EmptyHeader({ className, ...props }) {
|
|
38845
|
-
return /* @__PURE__ */
|
|
40603
|
+
return /* @__PURE__ */ jsx145(
|
|
38846
40604
|
"div",
|
|
38847
40605
|
{
|
|
38848
40606
|
"data-slot": "empty-header",
|
|
@@ -38873,7 +40631,7 @@ function EmptyMedia({
|
|
|
38873
40631
|
variant = "default",
|
|
38874
40632
|
...props
|
|
38875
40633
|
}) {
|
|
38876
|
-
return /* @__PURE__ */
|
|
40634
|
+
return /* @__PURE__ */ jsx145(
|
|
38877
40635
|
"div",
|
|
38878
40636
|
{
|
|
38879
40637
|
"data-slot": "empty-icon",
|
|
@@ -38884,7 +40642,7 @@ function EmptyMedia({
|
|
|
38884
40642
|
);
|
|
38885
40643
|
}
|
|
38886
40644
|
function EmptyTitle({ className, ...props }) {
|
|
38887
|
-
return /* @__PURE__ */
|
|
40645
|
+
return /* @__PURE__ */ jsx145(
|
|
38888
40646
|
"div",
|
|
38889
40647
|
{
|
|
38890
40648
|
"data-slot": "empty-title",
|
|
@@ -38894,7 +40652,7 @@ function EmptyTitle({ className, ...props }) {
|
|
|
38894
40652
|
);
|
|
38895
40653
|
}
|
|
38896
40654
|
function EmptyDescription({ className, ...props }) {
|
|
38897
|
-
return /* @__PURE__ */
|
|
40655
|
+
return /* @__PURE__ */ jsx145(
|
|
38898
40656
|
"div",
|
|
38899
40657
|
{
|
|
38900
40658
|
"data-slot": "empty-description",
|
|
@@ -38907,7 +40665,7 @@ function EmptyDescription({ className, ...props }) {
|
|
|
38907
40665
|
);
|
|
38908
40666
|
}
|
|
38909
40667
|
function EmptyContent({ className, ...props }) {
|
|
38910
|
-
return /* @__PURE__ */
|
|
40668
|
+
return /* @__PURE__ */ jsx145(
|
|
38911
40669
|
"div",
|
|
38912
40670
|
{
|
|
38913
40671
|
"data-slot": "empty-content",
|
|
@@ -38921,11 +40679,11 @@ function EmptyContent({ className, ...props }) {
|
|
|
38921
40679
|
}
|
|
38922
40680
|
|
|
38923
40681
|
// src/components/ui/field.tsx
|
|
38924
|
-
import { useMemo as
|
|
40682
|
+
import { useMemo as useMemo11 } from "react";
|
|
38925
40683
|
import { cva as cva10 } from "class-variance-authority";
|
|
38926
|
-
import { jsx as
|
|
40684
|
+
import { jsx as jsx146, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
38927
40685
|
function FieldSet({ className, ...props }) {
|
|
38928
|
-
return /* @__PURE__ */
|
|
40686
|
+
return /* @__PURE__ */ jsx146(
|
|
38929
40687
|
"fieldset",
|
|
38930
40688
|
{
|
|
38931
40689
|
"data-slot": "field-set",
|
|
@@ -38943,7 +40701,7 @@ function FieldLegend({
|
|
|
38943
40701
|
variant = "legend",
|
|
38944
40702
|
...props
|
|
38945
40703
|
}) {
|
|
38946
|
-
return /* @__PURE__ */
|
|
40704
|
+
return /* @__PURE__ */ jsx146(
|
|
38947
40705
|
"legend",
|
|
38948
40706
|
{
|
|
38949
40707
|
"data-slot": "field-legend",
|
|
@@ -38959,7 +40717,7 @@ function FieldLegend({
|
|
|
38959
40717
|
);
|
|
38960
40718
|
}
|
|
38961
40719
|
function FieldGroup({ className, ...props }) {
|
|
38962
|
-
return /* @__PURE__ */
|
|
40720
|
+
return /* @__PURE__ */ jsx146(
|
|
38963
40721
|
"div",
|
|
38964
40722
|
{
|
|
38965
40723
|
"data-slot": "field-group",
|
|
@@ -38999,7 +40757,7 @@ function Field({
|
|
|
38999
40757
|
orientation = "vertical",
|
|
39000
40758
|
...props
|
|
39001
40759
|
}) {
|
|
39002
|
-
return /* @__PURE__ */
|
|
40760
|
+
return /* @__PURE__ */ jsx146(
|
|
39003
40761
|
"div",
|
|
39004
40762
|
{
|
|
39005
40763
|
role: "group",
|
|
@@ -39011,7 +40769,7 @@ function Field({
|
|
|
39011
40769
|
);
|
|
39012
40770
|
}
|
|
39013
40771
|
function FieldContent({ className, ...props }) {
|
|
39014
|
-
return /* @__PURE__ */
|
|
40772
|
+
return /* @__PURE__ */ jsx146(
|
|
39015
40773
|
"div",
|
|
39016
40774
|
{
|
|
39017
40775
|
"data-slot": "field-content",
|
|
@@ -39027,7 +40785,7 @@ function FieldLabel({
|
|
|
39027
40785
|
className,
|
|
39028
40786
|
...props
|
|
39029
40787
|
}) {
|
|
39030
|
-
return /* @__PURE__ */
|
|
40788
|
+
return /* @__PURE__ */ jsx146(
|
|
39031
40789
|
Label,
|
|
39032
40790
|
{
|
|
39033
40791
|
"data-slot": "field-label",
|
|
@@ -39042,7 +40800,7 @@ function FieldLabel({
|
|
|
39042
40800
|
);
|
|
39043
40801
|
}
|
|
39044
40802
|
function FieldTitle({ className, ...props }) {
|
|
39045
|
-
return /* @__PURE__ */
|
|
40803
|
+
return /* @__PURE__ */ jsx146(
|
|
39046
40804
|
"div",
|
|
39047
40805
|
{
|
|
39048
40806
|
"data-slot": "field-label",
|
|
@@ -39055,7 +40813,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
39055
40813
|
);
|
|
39056
40814
|
}
|
|
39057
40815
|
function FieldDescription({ className, ...props }) {
|
|
39058
|
-
return /* @__PURE__ */
|
|
40816
|
+
return /* @__PURE__ */ jsx146(
|
|
39059
40817
|
"p",
|
|
39060
40818
|
{
|
|
39061
40819
|
"data-slot": "field-description",
|
|
@@ -39074,7 +40832,7 @@ function FieldSeparator({
|
|
|
39074
40832
|
className,
|
|
39075
40833
|
...props
|
|
39076
40834
|
}) {
|
|
39077
|
-
return /* @__PURE__ */
|
|
40835
|
+
return /* @__PURE__ */ jsxs102(
|
|
39078
40836
|
"div",
|
|
39079
40837
|
{
|
|
39080
40838
|
"data-slot": "field-separator",
|
|
@@ -39085,8 +40843,8 @@ function FieldSeparator({
|
|
|
39085
40843
|
),
|
|
39086
40844
|
...props,
|
|
39087
40845
|
children: [
|
|
39088
|
-
/* @__PURE__ */
|
|
39089
|
-
children && /* @__PURE__ */
|
|
40846
|
+
/* @__PURE__ */ jsx146(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
40847
|
+
children && /* @__PURE__ */ jsx146(
|
|
39090
40848
|
"span",
|
|
39091
40849
|
{
|
|
39092
40850
|
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
@@ -39104,7 +40862,7 @@ function FieldError({
|
|
|
39104
40862
|
errors,
|
|
39105
40863
|
...props
|
|
39106
40864
|
}) {
|
|
39107
|
-
const content =
|
|
40865
|
+
const content = useMemo11(() => {
|
|
39108
40866
|
if (children) {
|
|
39109
40867
|
return children;
|
|
39110
40868
|
}
|
|
@@ -39114,14 +40872,14 @@ function FieldError({
|
|
|
39114
40872
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
39115
40873
|
return errors[0].message;
|
|
39116
40874
|
}
|
|
39117
|
-
return /* @__PURE__ */
|
|
39118
|
-
(error, index) => error?.message && /* @__PURE__ */
|
|
40875
|
+
return /* @__PURE__ */ jsx146("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
40876
|
+
(error, index) => error?.message && /* @__PURE__ */ jsx146("li", { children: error.message }, index)
|
|
39119
40877
|
) });
|
|
39120
40878
|
}, [children, errors]);
|
|
39121
40879
|
if (!content) {
|
|
39122
40880
|
return null;
|
|
39123
40881
|
}
|
|
39124
|
-
return /* @__PURE__ */
|
|
40882
|
+
return /* @__PURE__ */ jsx146(
|
|
39125
40883
|
"div",
|
|
39126
40884
|
{
|
|
39127
40885
|
role: "alert",
|
|
@@ -39135,9 +40893,9 @@ function FieldError({
|
|
|
39135
40893
|
|
|
39136
40894
|
// src/components/ui/input-group.tsx
|
|
39137
40895
|
import { cva as cva11 } from "class-variance-authority";
|
|
39138
|
-
import { jsx as
|
|
40896
|
+
import { jsx as jsx147 } from "react/jsx-runtime";
|
|
39139
40897
|
function InputGroup({ className, ...props }) {
|
|
39140
|
-
return /* @__PURE__ */
|
|
40898
|
+
return /* @__PURE__ */ jsx147(
|
|
39141
40899
|
"div",
|
|
39142
40900
|
{
|
|
39143
40901
|
"data-slot": "input-group",
|
|
@@ -39181,7 +40939,7 @@ function InputGroupAddon({
|
|
|
39181
40939
|
align = "inline-start",
|
|
39182
40940
|
...props
|
|
39183
40941
|
}) {
|
|
39184
|
-
return /* @__PURE__ */
|
|
40942
|
+
return /* @__PURE__ */ jsx147(
|
|
39185
40943
|
"div",
|
|
39186
40944
|
{
|
|
39187
40945
|
role: "group",
|
|
@@ -39221,7 +40979,7 @@ function InputGroupButton({
|
|
|
39221
40979
|
size = "xs",
|
|
39222
40980
|
...props
|
|
39223
40981
|
}) {
|
|
39224
|
-
return /* @__PURE__ */
|
|
40982
|
+
return /* @__PURE__ */ jsx147(
|
|
39225
40983
|
Button,
|
|
39226
40984
|
{
|
|
39227
40985
|
type,
|
|
@@ -39233,7 +40991,7 @@ function InputGroupButton({
|
|
|
39233
40991
|
);
|
|
39234
40992
|
}
|
|
39235
40993
|
function InputGroupText({ className, ...props }) {
|
|
39236
|
-
return /* @__PURE__ */
|
|
40994
|
+
return /* @__PURE__ */ jsx147(
|
|
39237
40995
|
"span",
|
|
39238
40996
|
{
|
|
39239
40997
|
className: cn(
|
|
@@ -39248,7 +41006,7 @@ function InputGroupInput({
|
|
|
39248
41006
|
className,
|
|
39249
41007
|
...props
|
|
39250
41008
|
}) {
|
|
39251
|
-
return /* @__PURE__ */
|
|
41009
|
+
return /* @__PURE__ */ jsx147(
|
|
39252
41010
|
Input,
|
|
39253
41011
|
{
|
|
39254
41012
|
"data-slot": "input-group-control",
|
|
@@ -39264,7 +41022,7 @@ function InputGroupTextarea({
|
|
|
39264
41022
|
className,
|
|
39265
41023
|
...props
|
|
39266
41024
|
}) {
|
|
39267
|
-
return /* @__PURE__ */
|
|
41025
|
+
return /* @__PURE__ */ jsx147(
|
|
39268
41026
|
Textarea,
|
|
39269
41027
|
{
|
|
39270
41028
|
"data-slot": "input-group-control",
|
|
@@ -39280,9 +41038,9 @@ function InputGroupTextarea({
|
|
|
39280
41038
|
// src/components/ui/item.tsx
|
|
39281
41039
|
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
39282
41040
|
import { cva as cva12 } from "class-variance-authority";
|
|
39283
|
-
import { jsx as
|
|
41041
|
+
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
39284
41042
|
function ItemGroup({ className, ...props }) {
|
|
39285
|
-
return /* @__PURE__ */
|
|
41043
|
+
return /* @__PURE__ */ jsx148(
|
|
39286
41044
|
"div",
|
|
39287
41045
|
{
|
|
39288
41046
|
role: "list",
|
|
@@ -39296,7 +41054,7 @@ function ItemSeparator({
|
|
|
39296
41054
|
className,
|
|
39297
41055
|
...props
|
|
39298
41056
|
}) {
|
|
39299
|
-
return /* @__PURE__ */
|
|
41057
|
+
return /* @__PURE__ */ jsx148(
|
|
39300
41058
|
Separator2,
|
|
39301
41059
|
{
|
|
39302
41060
|
"data-slot": "item-separator",
|
|
@@ -39334,7 +41092,7 @@ function Item8({
|
|
|
39334
41092
|
...props
|
|
39335
41093
|
}) {
|
|
39336
41094
|
const Comp = asChild ? Slot5 : "div";
|
|
39337
|
-
return /* @__PURE__ */
|
|
41095
|
+
return /* @__PURE__ */ jsx148(
|
|
39338
41096
|
Comp,
|
|
39339
41097
|
{
|
|
39340
41098
|
"data-slot": "item",
|
|
@@ -39365,7 +41123,7 @@ function ItemMedia({
|
|
|
39365
41123
|
variant = "default",
|
|
39366
41124
|
...props
|
|
39367
41125
|
}) {
|
|
39368
|
-
return /* @__PURE__ */
|
|
41126
|
+
return /* @__PURE__ */ jsx148(
|
|
39369
41127
|
"div",
|
|
39370
41128
|
{
|
|
39371
41129
|
"data-slot": "item-media",
|
|
@@ -39376,7 +41134,7 @@ function ItemMedia({
|
|
|
39376
41134
|
);
|
|
39377
41135
|
}
|
|
39378
41136
|
function ItemContent({ className, ...props }) {
|
|
39379
|
-
return /* @__PURE__ */
|
|
41137
|
+
return /* @__PURE__ */ jsx148(
|
|
39380
41138
|
"div",
|
|
39381
41139
|
{
|
|
39382
41140
|
"data-slot": "item-content",
|
|
@@ -39389,7 +41147,7 @@ function ItemContent({ className, ...props }) {
|
|
|
39389
41147
|
);
|
|
39390
41148
|
}
|
|
39391
41149
|
function ItemTitle({ className, ...props }) {
|
|
39392
|
-
return /* @__PURE__ */
|
|
41150
|
+
return /* @__PURE__ */ jsx148(
|
|
39393
41151
|
"div",
|
|
39394
41152
|
{
|
|
39395
41153
|
"data-slot": "item-title",
|
|
@@ -39402,7 +41160,7 @@ function ItemTitle({ className, ...props }) {
|
|
|
39402
41160
|
);
|
|
39403
41161
|
}
|
|
39404
41162
|
function ItemDescription({ className, ...props }) {
|
|
39405
|
-
return /* @__PURE__ */
|
|
41163
|
+
return /* @__PURE__ */ jsx148(
|
|
39406
41164
|
"p",
|
|
39407
41165
|
{
|
|
39408
41166
|
"data-slot": "item-description",
|
|
@@ -39416,7 +41174,7 @@ function ItemDescription({ className, ...props }) {
|
|
|
39416
41174
|
);
|
|
39417
41175
|
}
|
|
39418
41176
|
function ItemActions({ className, ...props }) {
|
|
39419
|
-
return /* @__PURE__ */
|
|
41177
|
+
return /* @__PURE__ */ jsx148(
|
|
39420
41178
|
"div",
|
|
39421
41179
|
{
|
|
39422
41180
|
"data-slot": "item-actions",
|
|
@@ -39426,7 +41184,7 @@ function ItemActions({ className, ...props }) {
|
|
|
39426
41184
|
);
|
|
39427
41185
|
}
|
|
39428
41186
|
function ItemHeader({ className, ...props }) {
|
|
39429
|
-
return /* @__PURE__ */
|
|
41187
|
+
return /* @__PURE__ */ jsx148(
|
|
39430
41188
|
"div",
|
|
39431
41189
|
{
|
|
39432
41190
|
"data-slot": "item-header",
|
|
@@ -39439,7 +41197,7 @@ function ItemHeader({ className, ...props }) {
|
|
|
39439
41197
|
);
|
|
39440
41198
|
}
|
|
39441
41199
|
function ItemFooter({ className, ...props }) {
|
|
39442
|
-
return /* @__PURE__ */
|
|
41200
|
+
return /* @__PURE__ */ jsx148(
|
|
39443
41201
|
"div",
|
|
39444
41202
|
{
|
|
39445
41203
|
"data-slot": "item-footer",
|
|
@@ -39453,9 +41211,9 @@ function ItemFooter({ className, ...props }) {
|
|
|
39453
41211
|
}
|
|
39454
41212
|
|
|
39455
41213
|
// src/components/ui/kbd.tsx
|
|
39456
|
-
import { jsx as
|
|
41214
|
+
import { jsx as jsx149 } from "react/jsx-runtime";
|
|
39457
41215
|
function Kbd({ className, ...props }) {
|
|
39458
|
-
return /* @__PURE__ */
|
|
41216
|
+
return /* @__PURE__ */ jsx149(
|
|
39459
41217
|
"kbd",
|
|
39460
41218
|
{
|
|
39461
41219
|
"data-slot": "kbd",
|
|
@@ -39470,7 +41228,7 @@ function Kbd({ className, ...props }) {
|
|
|
39470
41228
|
);
|
|
39471
41229
|
}
|
|
39472
41230
|
function KbdGroup({ className, ...props }) {
|
|
39473
|
-
return /* @__PURE__ */
|
|
41231
|
+
return /* @__PURE__ */ jsx149(
|
|
39474
41232
|
"kbd",
|
|
39475
41233
|
{
|
|
39476
41234
|
"data-slot": "kbd-group",
|
|
@@ -39503,7 +41261,7 @@ function useIsMobile() {
|
|
|
39503
41261
|
}
|
|
39504
41262
|
|
|
39505
41263
|
// src/components/ui/sidebar.tsx
|
|
39506
|
-
import { jsx as
|
|
41264
|
+
import { jsx as jsx150, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
39507
41265
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
39508
41266
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
39509
41267
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -39570,7 +41328,7 @@ var SidebarProvider = React100.forwardRef(
|
|
|
39570
41328
|
}),
|
|
39571
41329
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
39572
41330
|
);
|
|
39573
|
-
return /* @__PURE__ */
|
|
41331
|
+
return /* @__PURE__ */ jsx150(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx150(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx150(
|
|
39574
41332
|
"div",
|
|
39575
41333
|
{
|
|
39576
41334
|
style: {
|
|
@@ -39601,7 +41359,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39601
41359
|
}, ref) => {
|
|
39602
41360
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
39603
41361
|
if (collapsible === "none") {
|
|
39604
|
-
return /* @__PURE__ */
|
|
41362
|
+
return /* @__PURE__ */ jsx150(
|
|
39605
41363
|
"div",
|
|
39606
41364
|
{
|
|
39607
41365
|
className: cn(
|
|
@@ -39615,7 +41373,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39615
41373
|
);
|
|
39616
41374
|
}
|
|
39617
41375
|
if (isMobile) {
|
|
39618
|
-
return /* @__PURE__ */
|
|
41376
|
+
return /* @__PURE__ */ jsx150(Sheet2, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs103(
|
|
39619
41377
|
SheetContent,
|
|
39620
41378
|
{
|
|
39621
41379
|
"data-sidebar": "sidebar",
|
|
@@ -39626,16 +41384,16 @@ var Sidebar = React100.forwardRef(
|
|
|
39626
41384
|
},
|
|
39627
41385
|
side,
|
|
39628
41386
|
children: [
|
|
39629
|
-
/* @__PURE__ */
|
|
39630
|
-
/* @__PURE__ */
|
|
39631
|
-
/* @__PURE__ */
|
|
41387
|
+
/* @__PURE__ */ jsxs103(SheetHeader, { className: "sr-only", children: [
|
|
41388
|
+
/* @__PURE__ */ jsx150(SheetTitle, { children: "Sidebar" }),
|
|
41389
|
+
/* @__PURE__ */ jsx150(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
39632
41390
|
] }),
|
|
39633
|
-
/* @__PURE__ */
|
|
41391
|
+
/* @__PURE__ */ jsx150("div", { className: "flex h-full w-full flex-col", children })
|
|
39634
41392
|
]
|
|
39635
41393
|
}
|
|
39636
41394
|
) });
|
|
39637
41395
|
}
|
|
39638
|
-
return /* @__PURE__ */
|
|
41396
|
+
return /* @__PURE__ */ jsxs103(
|
|
39639
41397
|
"div",
|
|
39640
41398
|
{
|
|
39641
41399
|
ref,
|
|
@@ -39645,7 +41403,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39645
41403
|
"data-variant": variant,
|
|
39646
41404
|
"data-side": side,
|
|
39647
41405
|
children: [
|
|
39648
|
-
/* @__PURE__ */
|
|
41406
|
+
/* @__PURE__ */ jsx150(
|
|
39649
41407
|
"div",
|
|
39650
41408
|
{
|
|
39651
41409
|
className: cn(
|
|
@@ -39656,7 +41414,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39656
41414
|
)
|
|
39657
41415
|
}
|
|
39658
41416
|
),
|
|
39659
|
-
/* @__PURE__ */
|
|
41417
|
+
/* @__PURE__ */ jsx150(
|
|
39660
41418
|
"div",
|
|
39661
41419
|
{
|
|
39662
41420
|
className: cn(
|
|
@@ -39667,7 +41425,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39667
41425
|
className
|
|
39668
41426
|
),
|
|
39669
41427
|
...props,
|
|
39670
|
-
children: /* @__PURE__ */
|
|
41428
|
+
children: /* @__PURE__ */ jsx150(
|
|
39671
41429
|
"div",
|
|
39672
41430
|
{
|
|
39673
41431
|
"data-sidebar": "sidebar",
|
|
@@ -39685,7 +41443,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39685
41443
|
Sidebar.displayName = "Sidebar";
|
|
39686
41444
|
var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
39687
41445
|
const { toggleSidebar } = useSidebar();
|
|
39688
|
-
return /* @__PURE__ */
|
|
41446
|
+
return /* @__PURE__ */ jsxs103(
|
|
39689
41447
|
Button,
|
|
39690
41448
|
{
|
|
39691
41449
|
ref,
|
|
@@ -39699,8 +41457,8 @@ var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref)
|
|
|
39699
41457
|
},
|
|
39700
41458
|
...props,
|
|
39701
41459
|
children: [
|
|
39702
|
-
/* @__PURE__ */
|
|
39703
|
-
/* @__PURE__ */
|
|
41460
|
+
/* @__PURE__ */ jsx150(PanelLeft, {}),
|
|
41461
|
+
/* @__PURE__ */ jsx150("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
39704
41462
|
]
|
|
39705
41463
|
}
|
|
39706
41464
|
);
|
|
@@ -39708,7 +41466,7 @@ var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref)
|
|
|
39708
41466
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
39709
41467
|
var SidebarRail = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39710
41468
|
const { toggleSidebar } = useSidebar();
|
|
39711
|
-
return /* @__PURE__ */
|
|
41469
|
+
return /* @__PURE__ */ jsx150(
|
|
39712
41470
|
"button",
|
|
39713
41471
|
{
|
|
39714
41472
|
ref,
|
|
@@ -39732,7 +41490,7 @@ var SidebarRail = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39732
41490
|
});
|
|
39733
41491
|
SidebarRail.displayName = "SidebarRail";
|
|
39734
41492
|
var SidebarInset = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39735
|
-
return /* @__PURE__ */
|
|
41493
|
+
return /* @__PURE__ */ jsx150(
|
|
39736
41494
|
"main",
|
|
39737
41495
|
{
|
|
39738
41496
|
ref,
|
|
@@ -39747,7 +41505,7 @@ var SidebarInset = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39747
41505
|
});
|
|
39748
41506
|
SidebarInset.displayName = "SidebarInset";
|
|
39749
41507
|
var SidebarInput = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39750
|
-
return /* @__PURE__ */
|
|
41508
|
+
return /* @__PURE__ */ jsx150(
|
|
39751
41509
|
Input,
|
|
39752
41510
|
{
|
|
39753
41511
|
ref,
|
|
@@ -39762,7 +41520,7 @@ var SidebarInput = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39762
41520
|
});
|
|
39763
41521
|
SidebarInput.displayName = "SidebarInput";
|
|
39764
41522
|
var SidebarHeader = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39765
|
-
return /* @__PURE__ */
|
|
41523
|
+
return /* @__PURE__ */ jsx150(
|
|
39766
41524
|
"div",
|
|
39767
41525
|
{
|
|
39768
41526
|
ref,
|
|
@@ -39774,7 +41532,7 @@ var SidebarHeader = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39774
41532
|
});
|
|
39775
41533
|
SidebarHeader.displayName = "SidebarHeader";
|
|
39776
41534
|
var SidebarFooter = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39777
|
-
return /* @__PURE__ */
|
|
41535
|
+
return /* @__PURE__ */ jsx150(
|
|
39778
41536
|
"div",
|
|
39779
41537
|
{
|
|
39780
41538
|
ref,
|
|
@@ -39786,7 +41544,7 @@ var SidebarFooter = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39786
41544
|
});
|
|
39787
41545
|
SidebarFooter.displayName = "SidebarFooter";
|
|
39788
41546
|
var SidebarSeparator = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39789
|
-
return /* @__PURE__ */
|
|
41547
|
+
return /* @__PURE__ */ jsx150(
|
|
39790
41548
|
Separator2,
|
|
39791
41549
|
{
|
|
39792
41550
|
ref,
|
|
@@ -39798,7 +41556,7 @@ var SidebarSeparator = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39798
41556
|
});
|
|
39799
41557
|
SidebarSeparator.displayName = "SidebarSeparator";
|
|
39800
41558
|
var SidebarContent = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39801
|
-
return /* @__PURE__ */
|
|
41559
|
+
return /* @__PURE__ */ jsx150(
|
|
39802
41560
|
"div",
|
|
39803
41561
|
{
|
|
39804
41562
|
ref,
|
|
@@ -39813,7 +41571,7 @@ var SidebarContent = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39813
41571
|
});
|
|
39814
41572
|
SidebarContent.displayName = "SidebarContent";
|
|
39815
41573
|
var SidebarGroup = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39816
|
-
return /* @__PURE__ */
|
|
41574
|
+
return /* @__PURE__ */ jsx150(
|
|
39817
41575
|
"div",
|
|
39818
41576
|
{
|
|
39819
41577
|
ref,
|
|
@@ -39826,7 +41584,7 @@ var SidebarGroup = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39826
41584
|
SidebarGroup.displayName = "SidebarGroup";
|
|
39827
41585
|
var SidebarGroupLabel = React100.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
39828
41586
|
const Comp = asChild ? Slot6 : "div";
|
|
39829
|
-
return /* @__PURE__ */
|
|
41587
|
+
return /* @__PURE__ */ jsx150(
|
|
39830
41588
|
Comp,
|
|
39831
41589
|
{
|
|
39832
41590
|
ref,
|
|
@@ -39843,7 +41601,7 @@ var SidebarGroupLabel = React100.forwardRef(({ className, asChild = false, ...pr
|
|
|
39843
41601
|
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
39844
41602
|
var SidebarGroupAction = React100.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
39845
41603
|
const Comp = asChild ? Slot6 : "button";
|
|
39846
|
-
return /* @__PURE__ */
|
|
41604
|
+
return /* @__PURE__ */ jsx150(
|
|
39847
41605
|
Comp,
|
|
39848
41606
|
{
|
|
39849
41607
|
ref,
|
|
@@ -39860,7 +41618,7 @@ var SidebarGroupAction = React100.forwardRef(({ className, asChild = false, ...p
|
|
|
39860
41618
|
);
|
|
39861
41619
|
});
|
|
39862
41620
|
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
39863
|
-
var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
41621
|
+
var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx150(
|
|
39864
41622
|
"div",
|
|
39865
41623
|
{
|
|
39866
41624
|
ref,
|
|
@@ -39870,7 +41628,7 @@ var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) =>
|
|
|
39870
41628
|
}
|
|
39871
41629
|
));
|
|
39872
41630
|
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
39873
|
-
var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
41631
|
+
var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx150(
|
|
39874
41632
|
"ul",
|
|
39875
41633
|
{
|
|
39876
41634
|
ref,
|
|
@@ -39880,7 +41638,7 @@ var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
39880
41638
|
}
|
|
39881
41639
|
));
|
|
39882
41640
|
SidebarMenu.displayName = "SidebarMenu";
|
|
39883
|
-
var SidebarMenuItem = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
41641
|
+
var SidebarMenuItem = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx150(
|
|
39884
41642
|
"li",
|
|
39885
41643
|
{
|
|
39886
41644
|
ref,
|
|
@@ -39922,7 +41680,7 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
39922
41680
|
}, ref) => {
|
|
39923
41681
|
const Comp = asChild ? Slot6 : "button";
|
|
39924
41682
|
const { isMobile, state } = useSidebar();
|
|
39925
|
-
const button = /* @__PURE__ */
|
|
41683
|
+
const button = /* @__PURE__ */ jsx150(
|
|
39926
41684
|
Comp,
|
|
39927
41685
|
{
|
|
39928
41686
|
ref,
|
|
@@ -39941,9 +41699,9 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
39941
41699
|
children: tooltip
|
|
39942
41700
|
};
|
|
39943
41701
|
}
|
|
39944
|
-
return /* @__PURE__ */
|
|
39945
|
-
/* @__PURE__ */
|
|
39946
|
-
/* @__PURE__ */
|
|
41702
|
+
return /* @__PURE__ */ jsxs103(Tooltip, { children: [
|
|
41703
|
+
/* @__PURE__ */ jsx150(TooltipTrigger, { asChild: true, children: button }),
|
|
41704
|
+
/* @__PURE__ */ jsx150(
|
|
39947
41705
|
TooltipContent,
|
|
39948
41706
|
{
|
|
39949
41707
|
side: "right",
|
|
@@ -39958,7 +41716,7 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
39958
41716
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
39959
41717
|
var SidebarMenuAction = React100.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
39960
41718
|
const Comp = asChild ? Slot6 : "button";
|
|
39961
|
-
return /* @__PURE__ */
|
|
41719
|
+
return /* @__PURE__ */ jsx150(
|
|
39962
41720
|
Comp,
|
|
39963
41721
|
{
|
|
39964
41722
|
ref,
|
|
@@ -39979,7 +41737,7 @@ var SidebarMenuAction = React100.forwardRef(({ className, asChild = false, showO
|
|
|
39979
41737
|
);
|
|
39980
41738
|
});
|
|
39981
41739
|
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
39982
|
-
var SidebarMenuBadge = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
41740
|
+
var SidebarMenuBadge = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx150(
|
|
39983
41741
|
"div",
|
|
39984
41742
|
{
|
|
39985
41743
|
ref,
|
|
@@ -40001,7 +41759,7 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40001
41759
|
const width = React100.useMemo(() => {
|
|
40002
41760
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
40003
41761
|
}, []);
|
|
40004
|
-
return /* @__PURE__ */
|
|
41762
|
+
return /* @__PURE__ */ jsxs103(
|
|
40005
41763
|
"div",
|
|
40006
41764
|
{
|
|
40007
41765
|
ref,
|
|
@@ -40009,14 +41767,14 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40009
41767
|
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
40010
41768
|
...props,
|
|
40011
41769
|
children: [
|
|
40012
|
-
showIcon && /* @__PURE__ */
|
|
41770
|
+
showIcon && /* @__PURE__ */ jsx150(
|
|
40013
41771
|
Skeleton,
|
|
40014
41772
|
{
|
|
40015
41773
|
className: "size-4 rounded-md",
|
|
40016
41774
|
"data-sidebar": "menu-skeleton-icon"
|
|
40017
41775
|
}
|
|
40018
41776
|
),
|
|
40019
|
-
/* @__PURE__ */
|
|
41777
|
+
/* @__PURE__ */ jsx150(
|
|
40020
41778
|
Skeleton,
|
|
40021
41779
|
{
|
|
40022
41780
|
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
@@ -40031,7 +41789,7 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40031
41789
|
);
|
|
40032
41790
|
});
|
|
40033
41791
|
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
40034
|
-
var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
41792
|
+
var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx150(
|
|
40035
41793
|
"ul",
|
|
40036
41794
|
{
|
|
40037
41795
|
ref,
|
|
@@ -40045,11 +41803,11 @@ var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
40045
41803
|
}
|
|
40046
41804
|
));
|
|
40047
41805
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
40048
|
-
var SidebarMenuSubItem = React100.forwardRef(({ ...props }, ref) => /* @__PURE__ */
|
|
41806
|
+
var SidebarMenuSubItem = React100.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx150("li", { ref, ...props }));
|
|
40049
41807
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
40050
41808
|
var SidebarMenuSubButton = React100.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
40051
41809
|
const Comp = asChild ? Slot6 : "a";
|
|
40052
|
-
return /* @__PURE__ */
|
|
41810
|
+
return /* @__PURE__ */ jsx150(
|
|
40053
41811
|
Comp,
|
|
40054
41812
|
{
|
|
40055
41813
|
ref,
|
|
@@ -40073,20 +41831,20 @@ SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
|
40073
41831
|
// src/components/ui/sonner.tsx
|
|
40074
41832
|
import { useTheme } from "next-themes";
|
|
40075
41833
|
import { Toaster as Sonner } from "sonner";
|
|
40076
|
-
import { jsx as
|
|
41834
|
+
import { jsx as jsx151 } from "react/jsx-runtime";
|
|
40077
41835
|
var Toaster = ({ ...props }) => {
|
|
40078
41836
|
const { theme = "system" } = useTheme();
|
|
40079
|
-
return /* @__PURE__ */
|
|
41837
|
+
return /* @__PURE__ */ jsx151(
|
|
40080
41838
|
Sonner,
|
|
40081
41839
|
{
|
|
40082
41840
|
theme,
|
|
40083
41841
|
className: "toaster group",
|
|
40084
41842
|
icons: {
|
|
40085
|
-
success: /* @__PURE__ */
|
|
40086
|
-
info: /* @__PURE__ */
|
|
40087
|
-
warning: /* @__PURE__ */
|
|
40088
|
-
error: /* @__PURE__ */
|
|
40089
|
-
loading: /* @__PURE__ */
|
|
41843
|
+
success: /* @__PURE__ */ jsx151(CircleCheck, { className: "h-4 w-4" }),
|
|
41844
|
+
info: /* @__PURE__ */ jsx151(Info, { className: "h-4 w-4" }),
|
|
41845
|
+
warning: /* @__PURE__ */ jsx151(TriangleAlert, { className: "h-4 w-4" }),
|
|
41846
|
+
error: /* @__PURE__ */ jsx151(OctagonX, { className: "h-4 w-4" }),
|
|
41847
|
+
loading: /* @__PURE__ */ jsx151(LoaderCircle, { className: "h-4 w-4 animate-spin" })
|
|
40090
41848
|
},
|
|
40091
41849
|
toastOptions: {
|
|
40092
41850
|
classNames: {
|
|
@@ -40104,24 +41862,24 @@ var Toaster = ({ ...props }) => {
|
|
|
40104
41862
|
// src/components/ui/toggle-group.tsx
|
|
40105
41863
|
import * as React101 from "react";
|
|
40106
41864
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
40107
|
-
import { jsx as
|
|
41865
|
+
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
40108
41866
|
var ToggleGroupContext = React101.createContext({
|
|
40109
41867
|
size: "default",
|
|
40110
41868
|
variant: "default"
|
|
40111
41869
|
});
|
|
40112
|
-
var ToggleGroup = React101.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */
|
|
41870
|
+
var ToggleGroup = React101.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx152(
|
|
40113
41871
|
ToggleGroupPrimitive.Root,
|
|
40114
41872
|
{
|
|
40115
41873
|
ref,
|
|
40116
41874
|
className: cn("flex items-center justify-center gap-1", className),
|
|
40117
41875
|
...props,
|
|
40118
|
-
children: /* @__PURE__ */
|
|
41876
|
+
children: /* @__PURE__ */ jsx152(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
40119
41877
|
}
|
|
40120
41878
|
));
|
|
40121
41879
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
40122
41880
|
var ToggleGroupItem = React101.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
40123
41881
|
const context = React101.useContext(ToggleGroupContext);
|
|
40124
|
-
return /* @__PURE__ */
|
|
41882
|
+
return /* @__PURE__ */ jsx152(
|
|
40125
41883
|
ToggleGroupPrimitive.Item,
|
|
40126
41884
|
{
|
|
40127
41885
|
ref,
|
|
@@ -40140,7 +41898,7 @@ var ToggleGroupItem = React101.forwardRef(({ className, children, variant, size,
|
|
|
40140
41898
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
40141
41899
|
|
|
40142
41900
|
// src/render/PXEngineRenderer.tsx
|
|
40143
|
-
import { jsx as
|
|
41901
|
+
import { jsx as jsx153, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
40144
41902
|
var CONTEXT_DEPENDENT_COMPONENTS = /* @__PURE__ */ new Set([
|
|
40145
41903
|
// Form components - require FormField + FormItem context
|
|
40146
41904
|
"FormLabel",
|
|
@@ -40232,24 +41990,24 @@ var COMPONENT_SUGGESTIONS = {
|
|
|
40232
41990
|
};
|
|
40233
41991
|
var renderContextDependentError = (componentName, normalizedName, key) => {
|
|
40234
41992
|
const suggestion = COMPONENT_SUGGESTIONS[normalizedName] || `${componentName}Atom (if available)`;
|
|
40235
|
-
return /* @__PURE__ */
|
|
41993
|
+
return /* @__PURE__ */ jsxs104(
|
|
40236
41994
|
"div",
|
|
40237
41995
|
{
|
|
40238
41996
|
className: "p-4 border-2 border-amber-500/50 rounded-lg bg-amber-50/80 space-y-2 my-2",
|
|
40239
41997
|
children: [
|
|
40240
|
-
/* @__PURE__ */
|
|
40241
|
-
/* @__PURE__ */
|
|
40242
|
-
/* @__PURE__ */
|
|
40243
|
-
/* @__PURE__ */
|
|
41998
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex items-start gap-2", children: [
|
|
41999
|
+
/* @__PURE__ */ jsx153("span", { className: "text-amber-600 font-bold text-lg", children: "\u26A0\uFE0F" }),
|
|
42000
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex-1", children: [
|
|
42001
|
+
/* @__PURE__ */ jsxs104("p", { className: "text-sm font-semibold text-amber-900", children: [
|
|
40244
42002
|
"Invalid Component: ",
|
|
40245
42003
|
componentName
|
|
40246
42004
|
] }),
|
|
40247
|
-
/* @__PURE__ */
|
|
42005
|
+
/* @__PURE__ */ jsx153("p", { className: "text-xs text-amber-700 mt-1", children: "This component requires React Context and cannot be rendered directly in schemas." })
|
|
40248
42006
|
] })
|
|
40249
42007
|
] }),
|
|
40250
|
-
/* @__PURE__ */
|
|
40251
|
-
/* @__PURE__ */
|
|
40252
|
-
/* @__PURE__ */
|
|
42008
|
+
/* @__PURE__ */ jsxs104("div", { className: "bg-white/60 p-3 rounded border border-amber-200", children: [
|
|
42009
|
+
/* @__PURE__ */ jsx153("p", { className: "text-xs font-semibold text-gray-700 mb-1.5", children: "\u2713 Use instead:" }),
|
|
42010
|
+
/* @__PURE__ */ jsx153("code", { className: "text-xs text-blue-700 bg-blue-50 px-2 py-1 rounded", children: suggestion })
|
|
40253
42011
|
] })
|
|
40254
42012
|
]
|
|
40255
42013
|
},
|
|
@@ -40408,7 +42166,7 @@ var PXEngineRenderer = ({
|
|
|
40408
42166
|
const isAtomWithRenderProp = ATOMS_WITH_RENDER.has(atomName);
|
|
40409
42167
|
const finalStyle = { ...dynamicStyle, ...finalProps.style || {} };
|
|
40410
42168
|
if (isAtomWithRenderProp) {
|
|
40411
|
-
return /* @__PURE__ */
|
|
42169
|
+
return /* @__PURE__ */ jsx153(
|
|
40412
42170
|
TargetComponent,
|
|
40413
42171
|
{
|
|
40414
42172
|
...finalProps,
|
|
@@ -40420,7 +42178,7 @@ var PXEngineRenderer = ({
|
|
|
40420
42178
|
uniqueKey
|
|
40421
42179
|
);
|
|
40422
42180
|
} else {
|
|
40423
|
-
return /* @__PURE__ */
|
|
42181
|
+
return /* @__PURE__ */ jsx153(
|
|
40424
42182
|
TargetComponent,
|
|
40425
42183
|
{
|
|
40426
42184
|
...finalProps,
|
|
@@ -40432,7 +42190,7 @@ var PXEngineRenderer = ({
|
|
|
40432
42190
|
);
|
|
40433
42191
|
}
|
|
40434
42192
|
};
|
|
40435
|
-
return /* @__PURE__ */
|
|
42193
|
+
return /* @__PURE__ */ jsx153("div", { className: "px-engine-root relative w-full h-full", children: renderRecursive(root) });
|
|
40436
42194
|
};
|
|
40437
42195
|
export {
|
|
40438
42196
|
Accordion,
|
|
@@ -40527,6 +42285,7 @@ export {
|
|
|
40527
42285
|
CountrySelectEdit,
|
|
40528
42286
|
CreatorActionHeader,
|
|
40529
42287
|
CreatorCompactView,
|
|
42288
|
+
CreatorExpandedPanel,
|
|
40530
42289
|
CreatorGridCard,
|
|
40531
42290
|
CreatorImageList,
|
|
40532
42291
|
CreatorProfileSummary,
|
|
@@ -40712,6 +42471,8 @@ export {
|
|
|
40712
42471
|
VideoAtom,
|
|
40713
42472
|
WorkflowVisualizer,
|
|
40714
42473
|
cn,
|
|
42474
|
+
defaultFetchSelections,
|
|
42475
|
+
defaultPersistSelection,
|
|
40715
42476
|
generateFieldsFromData,
|
|
40716
42477
|
generateFieldsFromPropDefinitions,
|
|
40717
42478
|
useCreatorWidgetPolling
|