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.cjs
CHANGED
|
@@ -122,6 +122,7 @@ __export(index_exports, {
|
|
|
122
122
|
CountrySelectEdit: () => CountrySelectEdit,
|
|
123
123
|
CreatorActionHeader: () => CreatorActionHeader,
|
|
124
124
|
CreatorCompactView: () => CreatorCompactView,
|
|
125
|
+
CreatorExpandedPanel: () => CreatorExpandedPanel,
|
|
125
126
|
CreatorGridCard: () => CreatorGridCard,
|
|
126
127
|
CreatorImageList: () => CreatorImageList,
|
|
127
128
|
CreatorProfileSummary: () => CreatorProfileSummary,
|
|
@@ -307,6 +308,8 @@ __export(index_exports, {
|
|
|
307
308
|
VideoAtom: () => VideoAtom,
|
|
308
309
|
WorkflowVisualizer: () => WorkflowVisualizer,
|
|
309
310
|
cn: () => cn,
|
|
311
|
+
defaultFetchSelections: () => defaultFetchSelections,
|
|
312
|
+
defaultPersistSelection: () => defaultPersistSelection,
|
|
310
313
|
generateFieldsFromData: () => generateFieldsFromData,
|
|
311
314
|
generateFieldsFromPropDefinitions: () => generateFieldsFromPropDefinitions,
|
|
312
315
|
useCreatorWidgetPolling: () => useCreatorWidgetPolling
|
|
@@ -314,7 +317,7 @@ __export(index_exports, {
|
|
|
314
317
|
module.exports = __toCommonJS(index_exports);
|
|
315
318
|
|
|
316
319
|
// src/render/PXEngineRenderer.tsx
|
|
317
|
-
var
|
|
320
|
+
var import_react79 = __toESM(require("react"), 1);
|
|
318
321
|
|
|
319
322
|
// src/atoms/index.ts
|
|
320
323
|
var atoms_exports = {};
|
|
@@ -33598,6 +33601,7 @@ __export(molecules_exports, {
|
|
|
33598
33601
|
CountrySelectEdit: () => CountrySelectEdit,
|
|
33599
33602
|
CreatorActionHeader: () => CreatorActionHeader,
|
|
33600
33603
|
CreatorCompactView: () => CreatorCompactView,
|
|
33604
|
+
CreatorExpandedPanel: () => CreatorExpandedPanel,
|
|
33601
33605
|
CreatorGridCard: () => CreatorGridCard,
|
|
33602
33606
|
CreatorImageList: () => CreatorImageList,
|
|
33603
33607
|
CreatorProfileSummary: () => CreatorProfileSummary,
|
|
@@ -33633,6 +33637,8 @@ __export(molecules_exports, {
|
|
|
33633
33637
|
TopPostsGrid: () => TopPostsGrid,
|
|
33634
33638
|
UIComponentSelector: () => UIComponentSelector,
|
|
33635
33639
|
WorkflowVisualizer: () => WorkflowVisualizer,
|
|
33640
|
+
defaultFetchSelections: () => defaultFetchSelections,
|
|
33641
|
+
defaultPersistSelection: () => defaultPersistSelection,
|
|
33636
33642
|
useCreatorWidgetPolling: () => useCreatorWidgetPolling
|
|
33637
33643
|
});
|
|
33638
33644
|
|
|
@@ -35705,12 +35711,16 @@ var CampaignSeedCard = import_react60.default.memo(
|
|
|
35705
35711
|
fields: providedFields,
|
|
35706
35712
|
data,
|
|
35707
35713
|
onAction,
|
|
35714
|
+
sendMessage,
|
|
35708
35715
|
...formCardProps
|
|
35709
35716
|
}) => {
|
|
35710
35717
|
const fields = (0, import_react60.useMemo)(() => {
|
|
35711
35718
|
return providedFields || buildCampaignSeedFields(data);
|
|
35712
35719
|
}, [providedFields, data]);
|
|
35713
35720
|
const handleProceed = () => {
|
|
35721
|
+
if (sendMessage) {
|
|
35722
|
+
sendMessage("Continue to concepts");
|
|
35723
|
+
}
|
|
35714
35724
|
onAction?.({
|
|
35715
35725
|
type: "brief_confirmation",
|
|
35716
35726
|
value: "Continue to concepts",
|
|
@@ -35867,6 +35877,7 @@ var SearchSpecCard = import_react61.default.memo(
|
|
|
35867
35877
|
data,
|
|
35868
35878
|
specData,
|
|
35869
35879
|
onAction,
|
|
35880
|
+
sendMessage,
|
|
35870
35881
|
...formCardProps
|
|
35871
35882
|
}) => {
|
|
35872
35883
|
const resolvedData = data || specData;
|
|
@@ -35874,6 +35885,9 @@ var SearchSpecCard = import_react61.default.memo(
|
|
|
35874
35885
|
return providedFields || buildSearchSpecFields(resolvedData ?? {});
|
|
35875
35886
|
}, [providedFields, resolvedData]);
|
|
35876
35887
|
const handleProceed = () => {
|
|
35888
|
+
if (sendMessage) {
|
|
35889
|
+
sendMessage("Continue with search");
|
|
35890
|
+
}
|
|
35877
35891
|
onAction?.({
|
|
35878
35892
|
type: "search_spec_confirmation",
|
|
35879
35893
|
value: "Continue with search",
|
|
@@ -35904,6 +35918,41 @@ SearchSpecCard.displayName = "SearchSpecCard";
|
|
|
35904
35918
|
|
|
35905
35919
|
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
35906
35920
|
var import_react62 = __toESM(require("react"), 1);
|
|
35921
|
+
|
|
35922
|
+
// src/molecules/creator-discovery/MCQCard/defaultFetchers.ts
|
|
35923
|
+
async function defaultFetchSelections(sessionId) {
|
|
35924
|
+
try {
|
|
35925
|
+
const res = await fetch(
|
|
35926
|
+
`/api/agents-proxy/custom-agents/sessions/${sessionId}/mcq-selections/get`,
|
|
35927
|
+
{
|
|
35928
|
+
method: "POST",
|
|
35929
|
+
headers: { "Content-Type": "application/json" },
|
|
35930
|
+
body: "{}"
|
|
35931
|
+
}
|
|
35932
|
+
);
|
|
35933
|
+
if (!res.ok) return {};
|
|
35934
|
+
const data = await res.json();
|
|
35935
|
+
return data.selections || {};
|
|
35936
|
+
} catch {
|
|
35937
|
+
return {};
|
|
35938
|
+
}
|
|
35939
|
+
}
|
|
35940
|
+
async function defaultPersistSelection(sessionId, questionKey, value) {
|
|
35941
|
+
try {
|
|
35942
|
+
await fetch(
|
|
35943
|
+
`/api/agents-proxy/custom-agents/sessions/${sessionId}/mcq-selections`,
|
|
35944
|
+
{
|
|
35945
|
+
method: "PATCH",
|
|
35946
|
+
headers: { "Content-Type": "application/json" },
|
|
35947
|
+
body: JSON.stringify({ question_key: questionKey, value })
|
|
35948
|
+
}
|
|
35949
|
+
);
|
|
35950
|
+
} catch (err) {
|
|
35951
|
+
console.warn("[MCQ persist failed]", err);
|
|
35952
|
+
}
|
|
35953
|
+
}
|
|
35954
|
+
|
|
35955
|
+
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
35907
35956
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
35908
35957
|
var MCQCard = import_react62.default.memo(
|
|
35909
35958
|
({
|
|
@@ -35916,22 +35965,39 @@ var MCQCard = import_react62.default.memo(
|
|
|
35916
35965
|
isLatestMessage = true,
|
|
35917
35966
|
isLoading = false,
|
|
35918
35967
|
className,
|
|
35919
|
-
// selectionStatus,
|
|
35920
35968
|
onAction,
|
|
35921
35969
|
disabled = false,
|
|
35922
|
-
disableContinueInDiscovery
|
|
35923
|
-
//
|
|
35970
|
+
disableContinueInDiscovery,
|
|
35971
|
+
// Self-contained props
|
|
35972
|
+
sessionId,
|
|
35973
|
+
sendMessage,
|
|
35974
|
+
fetchSelections = defaultFetchSelections,
|
|
35975
|
+
persistSelection = defaultPersistSelection
|
|
35924
35976
|
}) => {
|
|
35925
35977
|
const [selectedOption, setSelectedOption] = import_react62.default.useState(
|
|
35926
35978
|
propsSelectedOption
|
|
35927
35979
|
);
|
|
35928
35980
|
const [isProceeded, setIsProceeded] = import_react62.default.useState(false);
|
|
35981
|
+
const fetchedSessionRef = import_react62.default.useRef("");
|
|
35929
35982
|
import_react62.default.useEffect(() => {
|
|
35930
35983
|
if (propsSelectedOption) {
|
|
35931
35984
|
setSelectedOption(propsSelectedOption);
|
|
35932
35985
|
setIsProceeded(true);
|
|
35933
35986
|
}
|
|
35934
35987
|
}, [propsSelectedOption]);
|
|
35988
|
+
import_react62.default.useEffect(() => {
|
|
35989
|
+
if (!sessionId || fetchedSessionRef.current === sessionId) return;
|
|
35990
|
+
if (propsSelectedOption) return;
|
|
35991
|
+
fetchedSessionRef.current = sessionId;
|
|
35992
|
+
const questionKey = question || "unknown";
|
|
35993
|
+
fetchSelections(sessionId).then((selections) => {
|
|
35994
|
+
const stored = selections[questionKey];
|
|
35995
|
+
if (stored) {
|
|
35996
|
+
setSelectedOption(stored);
|
|
35997
|
+
setIsProceeded(true);
|
|
35998
|
+
}
|
|
35999
|
+
});
|
|
36000
|
+
}, [sessionId, question, propsSelectedOption, fetchSelections]);
|
|
35935
36001
|
const isDiscovery = disableContinueInDiscovery !== void 0 ? disableContinueInDiscovery : typeof window !== "undefined" && window.location.pathname.includes("creator-discovery");
|
|
35936
36002
|
const handleOptionClick = (key, e) => {
|
|
35937
36003
|
e.preventDefault();
|
|
@@ -35946,12 +36012,20 @@ var MCQCard = import_react62.default.memo(
|
|
|
35946
36012
|
e.stopPropagation();
|
|
35947
36013
|
if ((selectedOption || recommended) && !disabled && !isProceeded) {
|
|
35948
36014
|
const result = selectedOption || recommended || "";
|
|
36015
|
+
const label = options && options[result] || result;
|
|
35949
36016
|
setIsProceeded(true);
|
|
36017
|
+
if (sessionId) {
|
|
36018
|
+
const questionKey = question || "unknown";
|
|
36019
|
+
persistSelection(sessionId, questionKey, result);
|
|
36020
|
+
}
|
|
36021
|
+
if (sendMessage) {
|
|
36022
|
+
sendMessage(`Selected: ${label}`);
|
|
36023
|
+
}
|
|
35950
36024
|
onProceed?.(result);
|
|
35951
36025
|
onAction?.({
|
|
35952
36026
|
type: "mcq_selection",
|
|
35953
36027
|
value: result,
|
|
35954
|
-
label
|
|
36028
|
+
label
|
|
35955
36029
|
});
|
|
35956
36030
|
}
|
|
35957
36031
|
};
|
|
@@ -36956,7 +37030,7 @@ var CampaignConceptCard = import_react64.default.memo(
|
|
|
36956
37030
|
CampaignConceptCard.displayName = "CampaignConceptCard";
|
|
36957
37031
|
|
|
36958
37032
|
// src/molecules/creator-discovery/CreatorWidget/CreatorWidget.tsx
|
|
36959
|
-
var
|
|
37033
|
+
var import_react72 = require("react");
|
|
36960
37034
|
|
|
36961
37035
|
// src/molecules/creator-discovery/CreatorWidget/CreatorImageList.tsx
|
|
36962
37036
|
var import_react65 = require("react");
|
|
@@ -37214,8 +37288,1679 @@ function CreatorCompactView({
|
|
|
37214
37288
|
] }) });
|
|
37215
37289
|
}
|
|
37216
37290
|
|
|
37217
|
-
// src/molecules/creator-discovery/CreatorWidget/
|
|
37291
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorExpandedPanel.tsx
|
|
37292
|
+
var import_react70 = require("react");
|
|
37293
|
+
var import_react_dom2 = __toESM(require("react-dom"), 1);
|
|
37294
|
+
var import_framer_motion5 = require("framer-motion");
|
|
37295
|
+
|
|
37296
|
+
// src/molecules/creator-discovery/CreatorWidget/defaultFetchers.ts
|
|
37297
|
+
async function defaultFetchVersions(params) {
|
|
37298
|
+
const versionParam = params.version ? `&version=${params.version}` : "";
|
|
37299
|
+
const res = await fetch(
|
|
37300
|
+
`/api/get-creator-versions?sessionId=${params.sessionId}${versionParam}&validated=${params.validated}`
|
|
37301
|
+
);
|
|
37302
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37303
|
+
return res.json();
|
|
37304
|
+
}
|
|
37305
|
+
async function defaultFetchStatus(params) {
|
|
37306
|
+
const res = await fetch(
|
|
37307
|
+
`/api/get-creator-detail-status?session_id=${params.sessionId}&version_no=${params.versionNo}`
|
|
37308
|
+
);
|
|
37309
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37310
|
+
return res.json();
|
|
37311
|
+
}
|
|
37312
|
+
async function defaultFetchCreatorDetails(params) {
|
|
37313
|
+
const res = await fetch("/api/get-creator-details-by-id", {
|
|
37314
|
+
method: "POST",
|
|
37315
|
+
headers: { "Content-Type": "application/json" },
|
|
37316
|
+
body: JSON.stringify({
|
|
37317
|
+
creator_ids: params.creatorIds,
|
|
37318
|
+
session_id: params.sessionId,
|
|
37319
|
+
version_no: params.versionNo
|
|
37320
|
+
})
|
|
37321
|
+
});
|
|
37322
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37323
|
+
return res.json();
|
|
37324
|
+
}
|
|
37325
|
+
|
|
37326
|
+
// src/molecules/creator-discovery/CreatorWidget/countries.ts
|
|
37327
|
+
var countries2 = [
|
|
37328
|
+
{ code: "AF", name: "Afghanistan", flag: "\u{1F1E6}\u{1F1EB}" },
|
|
37329
|
+
{ code: "AL", name: "Albania", flag: "\u{1F1E6}\u{1F1F1}" },
|
|
37330
|
+
{ code: "DZ", name: "Algeria", flag: "\u{1F1E9}\u{1F1FF}" },
|
|
37331
|
+
{ code: "AD", name: "Andorra", flag: "\u{1F1E6}\u{1F1E9}" },
|
|
37332
|
+
{ code: "AO", name: "Angola", flag: "\u{1F1E6}\u{1F1F4}" },
|
|
37333
|
+
{ code: "AG", name: "Antigua and Barbuda", flag: "\u{1F1E6}\u{1F1EC}" },
|
|
37334
|
+
{ code: "AR", name: "Argentina", flag: "\u{1F1E6}\u{1F1F7}" },
|
|
37335
|
+
{ code: "AM", name: "Armenia", flag: "\u{1F1E6}\u{1F1F2}" },
|
|
37336
|
+
{ code: "AU", name: "Australia", flag: "\u{1F1E6}\u{1F1FA}" },
|
|
37337
|
+
{ code: "AT", name: "Austria", flag: "\u{1F1E6}\u{1F1F9}" },
|
|
37338
|
+
{ code: "AZ", name: "Azerbaijan", flag: "\u{1F1E6}\u{1F1FF}" },
|
|
37339
|
+
{ code: "BS", name: "Bahamas", flag: "\u{1F1E7}\u{1F1F8}" },
|
|
37340
|
+
{ code: "BH", name: "Bahrain", flag: "\u{1F1E7}\u{1F1ED}" },
|
|
37341
|
+
{ code: "BD", name: "Bangladesh", flag: "\u{1F1E7}\u{1F1E9}" },
|
|
37342
|
+
{ code: "BB", name: "Barbados", flag: "\u{1F1E7}\u{1F1E7}" },
|
|
37343
|
+
{ code: "BY", name: "Belarus", flag: "\u{1F1E7}\u{1F1FE}" },
|
|
37344
|
+
{ code: "BE", name: "Belgium", flag: "\u{1F1E7}\u{1F1EA}" },
|
|
37345
|
+
{ code: "BZ", name: "Belize", flag: "\u{1F1E7}\u{1F1FF}" },
|
|
37346
|
+
{ code: "BJ", name: "Benin", flag: "\u{1F1E7}\u{1F1EF}" },
|
|
37347
|
+
{ code: "BT", name: "Bhutan", flag: "\u{1F1E7}\u{1F1F9}" },
|
|
37348
|
+
{ code: "BO", name: "Bolivia", flag: "\u{1F1E7}\u{1F1F4}" },
|
|
37349
|
+
{ code: "BA", name: "Bosnia and Herzegovina", flag: "\u{1F1E7}\u{1F1E6}" },
|
|
37350
|
+
{ code: "BW", name: "Botswana", flag: "\u{1F1E7}\u{1F1FC}" },
|
|
37351
|
+
{ code: "BR", name: "Brazil", flag: "\u{1F1E7}\u{1F1F7}" },
|
|
37352
|
+
{ code: "BN", name: "Brunei", flag: "\u{1F1E7}\u{1F1F3}" },
|
|
37353
|
+
{ code: "BG", name: "Bulgaria", flag: "\u{1F1E7}\u{1F1EC}" },
|
|
37354
|
+
{ code: "BF", name: "Burkina Faso", flag: "\u{1F1E7}\u{1F1EB}" },
|
|
37355
|
+
{ code: "BI", name: "Burundi", flag: "\u{1F1E7}\u{1F1EE}" },
|
|
37356
|
+
{ code: "CV", name: "Cabo Verde", flag: "\u{1F1E8}\u{1F1FB}" },
|
|
37357
|
+
{ code: "KH", name: "Cambodia", flag: "\u{1F1F0}\u{1F1ED}" },
|
|
37358
|
+
{ code: "CM", name: "Cameroon", flag: "\u{1F1E8}\u{1F1F2}" },
|
|
37359
|
+
{ code: "CA", name: "Canada", flag: "\u{1F1E8}\u{1F1E6}" },
|
|
37360
|
+
{ code: "CF", name: "Central African Republic", flag: "\u{1F1E8}\u{1F1EB}" },
|
|
37361
|
+
{ code: "TD", name: "Chad", flag: "\u{1F1F9}\u{1F1E9}" },
|
|
37362
|
+
{ code: "CL", name: "Chile", flag: "\u{1F1E8}\u{1F1F1}" },
|
|
37363
|
+
{ code: "CN", name: "China", flag: "\u{1F1E8}\u{1F1F3}" },
|
|
37364
|
+
{ code: "CO", name: "Colombia", flag: "\u{1F1E8}\u{1F1F4}" },
|
|
37365
|
+
{ code: "KM", name: "Comoros", flag: "\u{1F1F0}\u{1F1F2}" },
|
|
37366
|
+
{ code: "CG", name: "Congo", flag: "\u{1F1E8}\u{1F1EC}" },
|
|
37367
|
+
{ code: "CD", name: "Democratic Republic of the Congo", flag: "\u{1F1E8}\u{1F1E9}" },
|
|
37368
|
+
{ code: "CR", name: "Costa Rica", flag: "\u{1F1E8}\u{1F1F7}" },
|
|
37369
|
+
{ code: "HR", name: "Croatia", flag: "\u{1F1ED}\u{1F1F7}" },
|
|
37370
|
+
{ code: "CU", name: "Cuba", flag: "\u{1F1E8}\u{1F1FA}" },
|
|
37371
|
+
{ code: "CY", name: "Cyprus", flag: "\u{1F1E8}\u{1F1FE}" },
|
|
37372
|
+
{ code: "CZ", name: "Czech Republic", flag: "\u{1F1E8}\u{1F1FF}" },
|
|
37373
|
+
{ code: "CI", name: "Ivory Coast", flag: "\u{1F1E8}\u{1F1EE}" },
|
|
37374
|
+
{ code: "DK", name: "Denmark", flag: "\u{1F1E9}\u{1F1F0}" },
|
|
37375
|
+
{ code: "DJ", name: "Djibouti", flag: "\u{1F1E9}\u{1F1EF}" },
|
|
37376
|
+
{ code: "DM", name: "Dominica", flag: "\u{1F1E9}\u{1F1F2}" },
|
|
37377
|
+
{ code: "DO", name: "Dominican Republic", flag: "\u{1F1E9}\u{1F1F4}" },
|
|
37378
|
+
{ code: "EC", name: "Ecuador", flag: "\u{1F1EA}\u{1F1E8}" },
|
|
37379
|
+
{ code: "EG", name: "Egypt", flag: "\u{1F1EA}\u{1F1EC}" },
|
|
37380
|
+
{ code: "SV", name: "El Salvador", flag: "\u{1F1F8}\u{1F1FB}" },
|
|
37381
|
+
{ code: "GQ", name: "Equatorial Guinea", flag: "\u{1F1EC}\u{1F1F6}" },
|
|
37382
|
+
{ code: "ER", name: "Eritrea", flag: "\u{1F1EA}\u{1F1F7}" },
|
|
37383
|
+
{ code: "EE", name: "Estonia", flag: "\u{1F1EA}\u{1F1EA}" },
|
|
37384
|
+
{ code: "SZ", name: "Eswatini", flag: "\u{1F1F8}\u{1F1FF}" },
|
|
37385
|
+
{ code: "ET", name: "Ethiopia", flag: "\u{1F1EA}\u{1F1F9}" },
|
|
37386
|
+
{ code: "FJ", name: "Fiji", flag: "\u{1F1EB}\u{1F1EF}" },
|
|
37387
|
+
{ code: "FI", name: "Finland", flag: "\u{1F1EB}\u{1F1EE}" },
|
|
37388
|
+
{ code: "FR", name: "France", flag: "\u{1F1EB}\u{1F1F7}" },
|
|
37389
|
+
{ code: "GA", name: "Gabon", flag: "\u{1F1EC}\u{1F1E6}" },
|
|
37390
|
+
{ code: "GM", name: "Gambia", flag: "\u{1F1EC}\u{1F1F2}" },
|
|
37391
|
+
{ code: "GE", name: "Georgia", flag: "\u{1F1EC}\u{1F1EA}" },
|
|
37392
|
+
{ code: "DE", name: "Germany", flag: "\u{1F1E9}\u{1F1EA}" },
|
|
37393
|
+
{ code: "GH", name: "Ghana", flag: "\u{1F1EC}\u{1F1ED}" },
|
|
37394
|
+
{ code: "GR", name: "Greece", flag: "\u{1F1EC}\u{1F1F7}" },
|
|
37395
|
+
{ code: "GD", name: "Grenada", flag: "\u{1F1EC}\u{1F1E9}" },
|
|
37396
|
+
{ code: "GT", name: "Guatemala", flag: "\u{1F1EC}\u{1F1F9}" },
|
|
37397
|
+
{ code: "GN", name: "Guinea", flag: "\u{1F1EC}\u{1F1F3}" },
|
|
37398
|
+
{ code: "GW", name: "Guinea-Bissau", flag: "\u{1F1EC}\u{1F1FC}" },
|
|
37399
|
+
{ code: "GY", name: "Guyana", flag: "\u{1F1EC}\u{1F1FE}" },
|
|
37400
|
+
{ code: "HT", name: "Haiti", flag: "\u{1F1ED}\u{1F1F9}" },
|
|
37401
|
+
{ code: "HN", name: "Honduras", flag: "\u{1F1ED}\u{1F1F3}" },
|
|
37402
|
+
{ code: "HU", name: "Hungary", flag: "\u{1F1ED}\u{1F1FA}" },
|
|
37403
|
+
{ code: "HK", name: "Hong Kong", flag: "\u{1F1ED}\u{1F1F0}" },
|
|
37404
|
+
{ code: "IS", name: "Iceland", flag: "\u{1F1EE}\u{1F1F8}" },
|
|
37405
|
+
{ code: "IN", name: "India", flag: "\u{1F1EE}\u{1F1F3}" },
|
|
37406
|
+
{ code: "ID", name: "Indonesia", flag: "\u{1F1EE}\u{1F1E9}" },
|
|
37407
|
+
{ code: "IR", name: "Iran", flag: "\u{1F1EE}\u{1F1F7}" },
|
|
37408
|
+
{ code: "IQ", name: "Iraq", flag: "\u{1F1EE}\u{1F1F6}" },
|
|
37409
|
+
{ code: "IE", name: "Ireland", flag: "\u{1F1EE}\u{1F1EA}" },
|
|
37410
|
+
{ code: "IL", name: "Israel", flag: "\u{1F1EE}\u{1F1F1}" },
|
|
37411
|
+
{ code: "IT", name: "Italy", flag: "\u{1F1EE}\u{1F1F9}" },
|
|
37412
|
+
{ code: "JM", name: "Jamaica", flag: "\u{1F1EF}\u{1F1F2}" },
|
|
37413
|
+
{ code: "JP", name: "Japan", flag: "\u{1F1EF}\u{1F1F5}" },
|
|
37414
|
+
{ code: "JO", name: "Jordan", flag: "\u{1F1EF}\u{1F1F4}" },
|
|
37415
|
+
{ code: "KZ", name: "Kazakhstan", flag: "\u{1F1F0}\u{1F1FF}" },
|
|
37416
|
+
{ code: "KE", name: "Kenya", flag: "\u{1F1F0}\u{1F1EA}" },
|
|
37417
|
+
{ code: "KI", name: "Kiribati", flag: "\u{1F1F0}\u{1F1EE}" },
|
|
37418
|
+
{ code: "KP", name: "North Korea", flag: "\u{1F1F0}\u{1F1F5}" },
|
|
37419
|
+
{ code: "KR", name: "South Korea", flag: "\u{1F1F0}\u{1F1F7}" },
|
|
37420
|
+
{ code: "KW", name: "Kuwait", flag: "\u{1F1F0}\u{1F1FC}" },
|
|
37421
|
+
{ code: "KG", name: "Kyrgyzstan", flag: "\u{1F1F0}\u{1F1EC}" },
|
|
37422
|
+
{ code: "LA", name: "Laos", flag: "\u{1F1F1}\u{1F1E6}" },
|
|
37423
|
+
{ code: "LV", name: "Latvia", flag: "\u{1F1F1}\u{1F1FB}" },
|
|
37424
|
+
{ code: "LB", name: "Lebanon", flag: "\u{1F1F1}\u{1F1E7}" },
|
|
37425
|
+
{ code: "LS", name: "Lesotho", flag: "\u{1F1F1}\u{1F1F8}" },
|
|
37426
|
+
{ code: "LR", name: "Liberia", flag: "\u{1F1F1}\u{1F1F7}" },
|
|
37427
|
+
{ code: "LY", name: "Libya", flag: "\u{1F1F1}\u{1F1FE}" },
|
|
37428
|
+
{ code: "LI", name: "Liechtenstein", flag: "\u{1F1F1}\u{1F1EE}" },
|
|
37429
|
+
{ code: "LT", name: "Lithuania", flag: "\u{1F1F1}\u{1F1F9}" },
|
|
37430
|
+
{ code: "LU", name: "Luxembourg", flag: "\u{1F1F1}\u{1F1FA}" },
|
|
37431
|
+
{ code: "MG", name: "Madagascar", flag: "\u{1F1F2}\u{1F1EC}" },
|
|
37432
|
+
{ code: "MW", name: "Malawi", flag: "\u{1F1F2}\u{1F1FC}" },
|
|
37433
|
+
{ code: "MY", name: "Malaysia", flag: "\u{1F1F2}\u{1F1FE}" },
|
|
37434
|
+
{ code: "MV", name: "Maldives", flag: "\u{1F1F2}\u{1F1FB}" },
|
|
37435
|
+
{ code: "ML", name: "Mali", flag: "\u{1F1F2}\u{1F1F1}" },
|
|
37436
|
+
{ code: "MT", name: "Malta", flag: "\u{1F1F2}\u{1F1F9}" },
|
|
37437
|
+
{ code: "MH", name: "Marshall Islands", flag: "\u{1F1F2}\u{1F1ED}" },
|
|
37438
|
+
{ code: "MR", name: "Mauritania", flag: "\u{1F1F2}\u{1F1F7}" },
|
|
37439
|
+
{ code: "MU", name: "Mauritius", flag: "\u{1F1F2}\u{1F1FA}" },
|
|
37440
|
+
{ code: "MX", name: "Mexico", flag: "\u{1F1F2}\u{1F1FD}" },
|
|
37441
|
+
{ code: "FM", name: "Micronesia", flag: "\u{1F1EB}\u{1F1F2}" },
|
|
37442
|
+
{ code: "MD", name: "Moldova", flag: "\u{1F1F2}\u{1F1E9}" },
|
|
37443
|
+
{ code: "MC", name: "Monaco", flag: "\u{1F1F2}\u{1F1E8}" },
|
|
37444
|
+
{ code: "MN", name: "Mongolia", flag: "\u{1F1F2}\u{1F1F3}" },
|
|
37445
|
+
{ code: "ME", name: "Montenegro", flag: "\u{1F1F2}\u{1F1EA}" },
|
|
37446
|
+
{ code: "MA", name: "Morocco", flag: "\u{1F1F2}\u{1F1E6}" },
|
|
37447
|
+
{ code: "MZ", name: "Mozambique", flag: "\u{1F1F2}\u{1F1FF}" },
|
|
37448
|
+
{ code: "MM", name: "Myanmar", flag: "\u{1F1F2}\u{1F1F2}" },
|
|
37449
|
+
{ code: "NA", name: "Namibia", flag: "\u{1F1F3}\u{1F1E6}" },
|
|
37450
|
+
{ code: "NR", name: "Nauru", flag: "\u{1F1F3}\u{1F1F7}" },
|
|
37451
|
+
{ code: "NP", name: "Nepal", flag: "\u{1F1F3}\u{1F1F5}" },
|
|
37452
|
+
{ code: "NL", name: "Netherlands", flag: "\u{1F1F3}\u{1F1F1}" },
|
|
37453
|
+
{ code: "NZ", name: "New Zealand", flag: "\u{1F1F3}\u{1F1FF}" },
|
|
37454
|
+
{ code: "NI", name: "Nicaragua", flag: "\u{1F1F3}\u{1F1EE}" },
|
|
37455
|
+
{ code: "NE", name: "Niger", flag: "\u{1F1F3}\u{1F1EA}" },
|
|
37456
|
+
{ code: "NG", name: "Nigeria", flag: "\u{1F1F3}\u{1F1EC}" },
|
|
37457
|
+
{ code: "MK", name: "North Macedonia", flag: "\u{1F1F2}\u{1F1F0}" },
|
|
37458
|
+
{ code: "NO", name: "Norway", flag: "\u{1F1F3}\u{1F1F4}" },
|
|
37459
|
+
{ code: "OM", name: "Oman", flag: "\u{1F1F4}\u{1F1F2}" },
|
|
37460
|
+
{ code: "PK", name: "Pakistan", flag: "\u{1F1F5}\u{1F1F0}" },
|
|
37461
|
+
{ code: "PW", name: "Palau", flag: "\u{1F1F5}\u{1F1FC}" },
|
|
37462
|
+
{ code: "PS", name: "Palestine", flag: "\u{1F1F5}\u{1F1F8}" },
|
|
37463
|
+
{ code: "PA", name: "Panama", flag: "\u{1F1F5}\u{1F1E6}" },
|
|
37464
|
+
{ code: "PG", name: "Papua New Guinea", flag: "\u{1F1F5}\u{1F1EC}" },
|
|
37465
|
+
{ code: "PY", name: "Paraguay", flag: "\u{1F1F5}\u{1F1FE}" },
|
|
37466
|
+
{ code: "PE", name: "Peru", flag: "\u{1F1F5}\u{1F1EA}" },
|
|
37467
|
+
{ code: "PH", name: "Philippines", flag: "\u{1F1F5}\u{1F1ED}" },
|
|
37468
|
+
{ code: "PL", name: "Poland", flag: "\u{1F1F5}\u{1F1F1}" },
|
|
37469
|
+
{ code: "PT", name: "Portugal", flag: "\u{1F1F5}\u{1F1F9}" },
|
|
37470
|
+
{ code: "QA", name: "Qatar", flag: "\u{1F1F6}\u{1F1E6}" },
|
|
37471
|
+
{ code: "RO", name: "Romania", flag: "\u{1F1F7}\u{1F1F4}" },
|
|
37472
|
+
{ code: "RU", name: "Russia", flag: "\u{1F1F7}\u{1F1FA}" },
|
|
37473
|
+
{ code: "RW", name: "Rwanda", flag: "\u{1F1F7}\u{1F1FC}" },
|
|
37474
|
+
{ code: "KN", name: "Saint Kitts and Nevis", flag: "\u{1F1F0}\u{1F1F3}" },
|
|
37475
|
+
{ code: "LC", name: "Saint Lucia", flag: "\u{1F1F1}\u{1F1E8}" },
|
|
37476
|
+
{ code: "VC", name: "Saint Vincent and the Grenadines", flag: "\u{1F1FB}\u{1F1E8}" },
|
|
37477
|
+
{ code: "WS", name: "Samoa", flag: "\u{1F1FC}\u{1F1F8}" },
|
|
37478
|
+
{ code: "SM", name: "San Marino", flag: "\u{1F1F8}\u{1F1F2}" },
|
|
37479
|
+
{ code: "ST", name: "Sao Tome and Principe", flag: "\u{1F1F8}\u{1F1F9}" },
|
|
37480
|
+
{ code: "SA", name: "Saudi Arabia", flag: "\u{1F1F8}\u{1F1E6}" },
|
|
37481
|
+
{ code: "SN", name: "Senegal", flag: "\u{1F1F8}\u{1F1F3}" },
|
|
37482
|
+
{ code: "RS", name: "Serbia", flag: "\u{1F1F7}\u{1F1F8}" },
|
|
37483
|
+
{ code: "SC", name: "Seychelles", flag: "\u{1F1F8}\u{1F1E8}" },
|
|
37484
|
+
{ code: "SL", name: "Sierra Leone", flag: "\u{1F1F8}\u{1F1F1}" },
|
|
37485
|
+
{ code: "SG", name: "Singapore", flag: "\u{1F1F8}\u{1F1EC}" },
|
|
37486
|
+
{ code: "SK", name: "Slovakia", flag: "\u{1F1F8}\u{1F1F0}" },
|
|
37487
|
+
{ code: "SI", name: "Slovenia", flag: "\u{1F1F8}\u{1F1EE}" },
|
|
37488
|
+
{ code: "SB", name: "Solomon Islands", flag: "\u{1F1F8}\u{1F1E7}" },
|
|
37489
|
+
{ code: "SO", name: "Somalia", flag: "\u{1F1F8}\u{1F1F4}" },
|
|
37490
|
+
{ code: "ZA", name: "South Africa", flag: "\u{1F1FF}\u{1F1E6}" },
|
|
37491
|
+
{ code: "SS", name: "South Sudan", flag: "\u{1F1F8}\u{1F1F8}" },
|
|
37492
|
+
{ code: "ES", name: "Spain", flag: "\u{1F1EA}\u{1F1F8}" },
|
|
37493
|
+
{ code: "LK", name: "Sri Lanka", flag: "\u{1F1F1}\u{1F1F0}" },
|
|
37494
|
+
{ code: "SD", name: "Sudan", flag: "\u{1F1F8}\u{1F1E9}" },
|
|
37495
|
+
{ code: "SR", name: "Suriname", flag: "\u{1F1F8}\u{1F1F7}" },
|
|
37496
|
+
{ code: "SE", name: "Sweden", flag: "\u{1F1F8}\u{1F1EA}" },
|
|
37497
|
+
{ code: "CH", name: "Switzerland", flag: "\u{1F1E8}\u{1F1ED}" },
|
|
37498
|
+
{ code: "SY", name: "Syria", flag: "\u{1F1F8}\u{1F1FE}" },
|
|
37499
|
+
{ code: "TW", name: "Taiwan", flag: "\u{1F1F9}\u{1F1FC}" },
|
|
37500
|
+
{ code: "TJ", name: "Tajikistan", flag: "\u{1F1F9}\u{1F1EF}" },
|
|
37501
|
+
{ code: "TZ", name: "Tanzania", flag: "\u{1F1F9}\u{1F1FF}" },
|
|
37502
|
+
{ code: "TH", name: "Thailand", flag: "\u{1F1F9}\u{1F1ED}" },
|
|
37503
|
+
{ code: "TL", name: "Timor-Leste", flag: "\u{1F1F9}\u{1F1F1}" },
|
|
37504
|
+
{ code: "TG", name: "Togo", flag: "\u{1F1F9}\u{1F1EC}" },
|
|
37505
|
+
{ code: "TO", name: "Tonga", flag: "\u{1F1F9}\u{1F1F4}" },
|
|
37506
|
+
{ code: "TT", name: "Trinidad and Tobago", flag: "\u{1F1F9}\u{1F1F9}" },
|
|
37507
|
+
{ code: "TN", name: "Tunisia", flag: "\u{1F1F9}\u{1F1F3}" },
|
|
37508
|
+
{ code: "TR", name: "Turkey", flag: "\u{1F1F9}\u{1F1F7}" },
|
|
37509
|
+
{ code: "TM", name: "Turkmenistan", flag: "\u{1F1F9}\u{1F1F2}" },
|
|
37510
|
+
{ code: "TV", name: "Tuvalu", flag: "\u{1F1F9}\u{1F1FB}" },
|
|
37511
|
+
{ code: "UG", name: "Uganda", flag: "\u{1F1FA}\u{1F1EC}" },
|
|
37512
|
+
{ code: "UA", name: "Ukraine", flag: "\u{1F1FA}\u{1F1E6}" },
|
|
37513
|
+
{ code: "AE", name: "United Arab Emirates", flag: "\u{1F1E6}\u{1F1EA}" },
|
|
37514
|
+
{ code: "GB", name: "United Kingdom", flag: "\u{1F1EC}\u{1F1E7}" },
|
|
37515
|
+
{ code: "US", name: "United States", flag: "\u{1F1FA}\u{1F1F8}" },
|
|
37516
|
+
{ code: "UY", name: "Uruguay", flag: "\u{1F1FA}\u{1F1FE}" },
|
|
37517
|
+
{ code: "UZ", name: "Uzbekistan", flag: "\u{1F1FA}\u{1F1FF}" },
|
|
37518
|
+
{ code: "VU", name: "Vanuatu", flag: "\u{1F1FB}\u{1F1FA}" },
|
|
37519
|
+
{ code: "VA", name: "Vatican City", flag: "\u{1F1FB}\u{1F1E6}" },
|
|
37520
|
+
{ code: "VE", name: "Venezuela", flag: "\u{1F1FB}\u{1F1EA}" },
|
|
37521
|
+
{ code: "VN", name: "Vietnam", flag: "\u{1F1FB}\u{1F1F3}" },
|
|
37522
|
+
{ code: "YE", name: "Yemen", flag: "\u{1F1FE}\u{1F1EA}" },
|
|
37523
|
+
{ code: "ZM", name: "Zambia", flag: "\u{1F1FF}\u{1F1F2}" },
|
|
37524
|
+
{ code: "ZW", name: "Zimbabwe", flag: "\u{1F1FF}\u{1F1FC}" }
|
|
37525
|
+
];
|
|
37526
|
+
var codeToMeta = Object.fromEntries(countries2.map((c) => [c.code, { name: c.name, flag: c.flag }]));
|
|
37527
|
+
var nameToCode = Object.fromEntries(countries2.map((c) => [c.name, c.code]));
|
|
37528
|
+
var normalizeToIso2 = (input) => {
|
|
37529
|
+
if (!input) return "US";
|
|
37530
|
+
const trimmed = String(input).trim();
|
|
37531
|
+
const upper = trimmed.toUpperCase();
|
|
37532
|
+
if (upper.length === 2 && codeToMeta[upper]) return upper;
|
|
37533
|
+
const fromName = nameToCode[trimmed];
|
|
37534
|
+
if (fromName) return fromName;
|
|
37535
|
+
return "US";
|
|
37536
|
+
};
|
|
37537
|
+
|
|
37538
|
+
// src/molecules/creator-discovery/CreatorWidget/EngagedAudienceDemographics.tsx
|
|
37539
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
37540
|
+
function EngagedAudienceDemographics({
|
|
37541
|
+
audienceDemographics
|
|
37542
|
+
}) {
|
|
37543
|
+
if (!audienceDemographics) return null;
|
|
37544
|
+
const hasCities = audienceDemographics?.cities && Object.keys(audienceDemographics.cities).length > 0;
|
|
37545
|
+
const hasCountries = audienceDemographics?.countries && Object.keys(audienceDemographics.countries).length > 0;
|
|
37546
|
+
const hasAges = audienceDemographics?.ages && Object.keys(audienceDemographics.ages).length > 0;
|
|
37547
|
+
const hasGenders = audienceDemographics?.genders && Object.keys(audienceDemographics.genders).length > 0;
|
|
37548
|
+
if (!hasCities && !hasCountries && !hasAges && !hasGenders) {
|
|
37549
|
+
return null;
|
|
37550
|
+
}
|
|
37551
|
+
const columns = [];
|
|
37552
|
+
if (hasCities) columns.push("1fr");
|
|
37553
|
+
if (hasCountries) columns.push("1fr");
|
|
37554
|
+
if (hasAges) columns.push("1fr");
|
|
37555
|
+
if (hasGenders) columns.push("0.4fr");
|
|
37556
|
+
const gridTemplate = columns.join(" ");
|
|
37557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
37558
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "text-purpleText text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "ENGAGED AUDIENCE" }) }),
|
|
37559
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37560
|
+
"div",
|
|
37561
|
+
{
|
|
37562
|
+
className: "flex flex-col sm:col-span-3 sm:grid gap-6",
|
|
37563
|
+
style: { gridTemplateColumns: gridTemplate },
|
|
37564
|
+
children: [
|
|
37565
|
+
hasCities && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
|
|
37566
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h4", { className: "text-xs text-gray700 mb-3", children: "Cities" }),
|
|
37567
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.cities || {}).map(
|
|
37568
|
+
([code, value]) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37569
|
+
"div",
|
|
37570
|
+
{
|
|
37571
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37572
|
+
children: [
|
|
37573
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "w-[90px]", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex gap-1 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { children: code.split(",")[0] }) }) }),
|
|
37574
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
37575
|
+
"div",
|
|
37576
|
+
{
|
|
37577
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37578
|
+
style: { width: `${value}%` }
|
|
37579
|
+
}
|
|
37580
|
+
) }),
|
|
37581
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { className: "w-10 text-right font-medium", children: [
|
|
37582
|
+
value,
|
|
37583
|
+
"%"
|
|
37584
|
+
] })
|
|
37585
|
+
]
|
|
37586
|
+
},
|
|
37587
|
+
code
|
|
37588
|
+
)
|
|
37589
|
+
) })
|
|
37590
|
+
] }),
|
|
37591
|
+
hasCountries && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
|
|
37592
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h4", { className: "text-xs text-gray700 mb-3", children: "Countries" }),
|
|
37593
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.countries || {}).map(
|
|
37594
|
+
([code, value]) => {
|
|
37595
|
+
const iso2 = normalizeToIso2(code);
|
|
37596
|
+
const meta = codeToMeta[iso2];
|
|
37597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37598
|
+
"div",
|
|
37599
|
+
{
|
|
37600
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37601
|
+
children: [
|
|
37602
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "w-10", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex gap-1 items-center", children: [
|
|
37603
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "text-base", children: meta?.flag }),
|
|
37604
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { children: code })
|
|
37605
|
+
] }) }),
|
|
37606
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
37607
|
+
"div",
|
|
37608
|
+
{
|
|
37609
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37610
|
+
style: { width: `${value}%` }
|
|
37611
|
+
}
|
|
37612
|
+
) }),
|
|
37613
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { className: "w-10 text-right font-medium", children: [
|
|
37614
|
+
value,
|
|
37615
|
+
"%"
|
|
37616
|
+
] })
|
|
37617
|
+
]
|
|
37618
|
+
},
|
|
37619
|
+
code
|
|
37620
|
+
);
|
|
37621
|
+
}
|
|
37622
|
+
) })
|
|
37623
|
+
] }),
|
|
37624
|
+
hasAges && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
|
|
37625
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h4", { className: "text-xs text-gray700 mb-3", children: "Ages" }),
|
|
37626
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.ages || {}).map(
|
|
37627
|
+
([ageRange, value]) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37628
|
+
"div",
|
|
37629
|
+
{
|
|
37630
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37631
|
+
children: [
|
|
37632
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "w-12", children: ageRange }),
|
|
37633
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
37634
|
+
"div",
|
|
37635
|
+
{
|
|
37636
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37637
|
+
style: { width: `${value}%` }
|
|
37638
|
+
}
|
|
37639
|
+
) }),
|
|
37640
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { className: "w-10 text-right font-medium", children: [
|
|
37641
|
+
value,
|
|
37642
|
+
"%"
|
|
37643
|
+
] })
|
|
37644
|
+
]
|
|
37645
|
+
},
|
|
37646
|
+
ageRange
|
|
37647
|
+
)
|
|
37648
|
+
) })
|
|
37649
|
+
] }),
|
|
37650
|
+
hasGenders && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex sm:flex-col gap-3", children: Object.entries(audienceDemographics?.genders || {}).map(
|
|
37651
|
+
([gender, value]) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37652
|
+
"div",
|
|
37653
|
+
{
|
|
37654
|
+
className: "flex flex-col justify-center text-sm",
|
|
37655
|
+
children: [
|
|
37656
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
37657
|
+
gender === "female" ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Venus, { className: "text-red-500", strokeWidth: 3 }) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Mars, { className: "text-blue-500", strokeWidth: 3 }),
|
|
37658
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { className: "capitalize text-gray800 text-xl", children: [
|
|
37659
|
+
value,
|
|
37660
|
+
"%"
|
|
37661
|
+
] })
|
|
37662
|
+
] }),
|
|
37663
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "text-lg text-gray700", children: gender.charAt(0).toUpperCase() + gender.slice(1) })
|
|
37664
|
+
]
|
|
37665
|
+
},
|
|
37666
|
+
gender
|
|
37667
|
+
)
|
|
37668
|
+
) }) })
|
|
37669
|
+
]
|
|
37670
|
+
}
|
|
37671
|
+
)
|
|
37672
|
+
] });
|
|
37673
|
+
}
|
|
37674
|
+
|
|
37675
|
+
// src/molecules/creator-discovery/CreatorWidget/PlatformIcons.tsx
|
|
37676
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
37677
|
+
function InstagramIcon({ className }) {
|
|
37678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
37679
|
+
"svg",
|
|
37680
|
+
{
|
|
37681
|
+
className,
|
|
37682
|
+
viewBox: "0 0 24 24",
|
|
37683
|
+
fill: "currentColor",
|
|
37684
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("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" })
|
|
37686
|
+
}
|
|
37687
|
+
);
|
|
37688
|
+
}
|
|
37689
|
+
function YouTubeIcon({ className }) {
|
|
37690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
37691
|
+
"svg",
|
|
37692
|
+
{
|
|
37693
|
+
className,
|
|
37694
|
+
viewBox: "0 0 24 24",
|
|
37695
|
+
fill: "currentColor",
|
|
37696
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37697
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("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" })
|
|
37698
|
+
}
|
|
37699
|
+
);
|
|
37700
|
+
}
|
|
37701
|
+
function TikTokIcon3({ className }) {
|
|
37702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
37703
|
+
"svg",
|
|
37704
|
+
{
|
|
37705
|
+
className,
|
|
37706
|
+
viewBox: "0 0 24 24",
|
|
37707
|
+
fill: "currentColor",
|
|
37708
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("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" })
|
|
37710
|
+
}
|
|
37711
|
+
);
|
|
37712
|
+
}
|
|
37713
|
+
function getPlatformIcon(platform) {
|
|
37714
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37715
|
+
if (key === "instagram") return InstagramIcon;
|
|
37716
|
+
if (key === "tiktok") return TikTokIcon3;
|
|
37717
|
+
if (key === "youtube") return YouTubeIcon;
|
|
37718
|
+
return InstagramIcon;
|
|
37719
|
+
}
|
|
37720
|
+
function getPlatformName(platform) {
|
|
37721
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37722
|
+
if (key === "instagram") return "Instagram";
|
|
37723
|
+
if (key === "tiktok") return "TikTok";
|
|
37724
|
+
if (key === "youtube") return "YouTube";
|
|
37725
|
+
return platform;
|
|
37726
|
+
}
|
|
37727
|
+
function getPlatformBgColor(platform) {
|
|
37728
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37729
|
+
if (key === "instagram") return "#C4338680";
|
|
37730
|
+
if (key === "tiktok") return "#EBEBEB40";
|
|
37731
|
+
if (key === "youtube") return "#ff000080";
|
|
37732
|
+
return "#ccc";
|
|
37733
|
+
}
|
|
37734
|
+
function getPlatformIconColor(platform) {
|
|
37735
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37736
|
+
if (key === "instagram") return "text-[#7b1551]";
|
|
37737
|
+
if (key === "tiktok") return "text-pink-500";
|
|
37738
|
+
if (key === "youtube") return "text-red-600";
|
|
37739
|
+
return "text-primary";
|
|
37740
|
+
}
|
|
37741
|
+
|
|
37742
|
+
// src/molecules/creator-discovery/CreatorWidget/PostCard.tsx
|
|
37218
37743
|
var import_react67 = require("react");
|
|
37744
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
37745
|
+
var formatFollowerCount = (count) => {
|
|
37746
|
+
if (count >= 1e6) {
|
|
37747
|
+
const millions = count / 1e6;
|
|
37748
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
37749
|
+
} else if (count >= 1e4) {
|
|
37750
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
37751
|
+
} else if (count >= 1e3) {
|
|
37752
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
37753
|
+
}
|
|
37754
|
+
return Math.floor(count).toString();
|
|
37755
|
+
};
|
|
37756
|
+
function PostCard({ post, platformUsername }) {
|
|
37757
|
+
const [expanded, setExpanded] = (0, import_react67.useState)(false);
|
|
37758
|
+
const [errored, setErrored] = (0, import_react67.useState)(false);
|
|
37759
|
+
const thumbnail = post.thumbnail_url || post.thumbnail || post.image || "";
|
|
37760
|
+
const likes = post.engagement?.likes ?? post.likes ?? null;
|
|
37761
|
+
const comments = post.engagement?.comments ?? post.comments ?? null;
|
|
37762
|
+
const views = post.engagement?.views ?? post.engagement?.plays ?? post.views ?? post.plays ?? null;
|
|
37763
|
+
const impressions = post.impressions ?? null;
|
|
37764
|
+
const reach = post.reach ?? null;
|
|
37765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
37766
|
+
"div",
|
|
37767
|
+
{
|
|
37768
|
+
className: "rounded-xl overflow-hidden border border-gray500 bg-transparent shadow-sm cursor-pointer",
|
|
37769
|
+
onClick: (e) => {
|
|
37770
|
+
e.stopPropagation();
|
|
37771
|
+
window.open(post.url, "_blank", "noopener,noreferrer");
|
|
37772
|
+
},
|
|
37773
|
+
children: [
|
|
37774
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "w-full aspect-square relative bg-gray25", children: thumbnail && !errored ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37775
|
+
"img",
|
|
37776
|
+
{
|
|
37777
|
+
src: thumbnail,
|
|
37778
|
+
alt: post.title || "post",
|
|
37779
|
+
className: "w-full h-full object-cover",
|
|
37780
|
+
onError: () => setErrored(true)
|
|
37781
|
+
}
|
|
37782
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "w-full h-full flex items-center justify-center text-gray500 text-sm", children: "No preview" }) }),
|
|
37783
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "p-3", children: [
|
|
37784
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-4 text-sm text-gray600 mb-2", children: [
|
|
37785
|
+
likes !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
37786
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { children: formatFollowerCount(likes) }),
|
|
37787
|
+
" ",
|
|
37788
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Heart, { size: 14 })
|
|
37789
|
+
] }),
|
|
37790
|
+
comments !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
37791
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { children: formatFollowerCount(comments) }),
|
|
37792
|
+
" ",
|
|
37793
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(MessageCircle, { size: 14 })
|
|
37794
|
+
] }),
|
|
37795
|
+
views !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
37796
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { children: formatFollowerCount(views) }),
|
|
37797
|
+
" ",
|
|
37798
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Eye, { size: 14 })
|
|
37799
|
+
] })
|
|
37800
|
+
] }),
|
|
37801
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex gap-4 text-sm text-gray800 mb-2", children: [
|
|
37802
|
+
impressions !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { children: [
|
|
37803
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "text-gray500 font-bold", children: formatFollowerCount(impressions) }),
|
|
37804
|
+
" ",
|
|
37805
|
+
"est.Impressions"
|
|
37806
|
+
] }),
|
|
37807
|
+
reach !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { children: [
|
|
37808
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "text-gray500 font-bold", children: formatFollowerCount(reach) }),
|
|
37809
|
+
" ",
|
|
37810
|
+
"est.Reach"
|
|
37811
|
+
] })
|
|
37812
|
+
] }),
|
|
37813
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "text-sm mb-1", children: [
|
|
37814
|
+
platformUsername && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "text-md font-semibold text-gray500", children: [
|
|
37815
|
+
"@",
|
|
37816
|
+
platformUsername
|
|
37817
|
+
] }),
|
|
37818
|
+
["instagram", "tiktok"].includes(
|
|
37819
|
+
post.platform?.toLowerCase() || ""
|
|
37820
|
+
) ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_jsx_runtime128.Fragment, { children: (() => {
|
|
37821
|
+
const text = post.title || post.description || "";
|
|
37822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
37823
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37824
|
+
"div",
|
|
37825
|
+
{
|
|
37826
|
+
className: `text-gray900 font-light mt-2 text-sm ${!expanded ? "line-clamp-3" : ""}`,
|
|
37827
|
+
children: text
|
|
37828
|
+
}
|
|
37829
|
+
),
|
|
37830
|
+
text.length > 100 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37831
|
+
"button",
|
|
37832
|
+
{
|
|
37833
|
+
onClick: (e) => {
|
|
37834
|
+
e.stopPropagation();
|
|
37835
|
+
setExpanded((s) => !s);
|
|
37836
|
+
},
|
|
37837
|
+
className: "text-xs text-purpleText mt-2",
|
|
37838
|
+
children: expanded ? "Show less" : "Show more"
|
|
37839
|
+
}
|
|
37840
|
+
)
|
|
37841
|
+
] });
|
|
37842
|
+
})() }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
37843
|
+
post.title && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "text-gray900 font-light", children: post.title }),
|
|
37844
|
+
post.description && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37845
|
+
"div",
|
|
37846
|
+
{
|
|
37847
|
+
className: "mt-2 text-sm text-gray900 overflow-hidden font-light",
|
|
37848
|
+
style: { maxHeight: expanded ? void 0 : 200 },
|
|
37849
|
+
children: post.description
|
|
37850
|
+
}
|
|
37851
|
+
),
|
|
37852
|
+
post.description && post.description.length > 200 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37853
|
+
"button",
|
|
37854
|
+
{
|
|
37855
|
+
onClick: (e) => {
|
|
37856
|
+
e.stopPropagation();
|
|
37857
|
+
setExpanded((s) => !s);
|
|
37858
|
+
},
|
|
37859
|
+
className: "text-xs text-purpleText mt-2",
|
|
37860
|
+
children: expanded ? "Show less" : "Show more"
|
|
37861
|
+
}
|
|
37862
|
+
)
|
|
37863
|
+
] })
|
|
37864
|
+
] })
|
|
37865
|
+
] })
|
|
37866
|
+
]
|
|
37867
|
+
}
|
|
37868
|
+
);
|
|
37869
|
+
}
|
|
37870
|
+
|
|
37871
|
+
// src/molecules/creator-discovery/CreatorWidget/PlatformPostsSection.tsx
|
|
37872
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
37873
|
+
var formatFollowerCount2 = (count) => {
|
|
37874
|
+
if (count >= 1e6) {
|
|
37875
|
+
const millions = count / 1e6;
|
|
37876
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
37877
|
+
} else if (count >= 1e4) {
|
|
37878
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
37879
|
+
} else if (count >= 1e3) {
|
|
37880
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
37881
|
+
}
|
|
37882
|
+
return Math.floor(count).toString();
|
|
37883
|
+
};
|
|
37884
|
+
function filterPostsByPlatform(posts, platform) {
|
|
37885
|
+
const postsArr = (posts ?? []).slice();
|
|
37886
|
+
const shortKey = platform.replace(/Metrics$/i, "").toLowerCase();
|
|
37887
|
+
return postsArr.filter((p) => (p.platform || "").toLowerCase() === shortKey).slice(0, 3);
|
|
37888
|
+
}
|
|
37889
|
+
function PlatformMetricsBanner({
|
|
37890
|
+
platform,
|
|
37891
|
+
metrics
|
|
37892
|
+
}) {
|
|
37893
|
+
const platformName = getPlatformName(platform);
|
|
37894
|
+
const bgColor = getPlatformBgColor(platform);
|
|
37895
|
+
const IconComponent = getPlatformIcon(platform);
|
|
37896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
37897
|
+
"div",
|
|
37898
|
+
{
|
|
37899
|
+
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 ",
|
|
37900
|
+
style: { backgroundColor: bgColor },
|
|
37901
|
+
children: [
|
|
37902
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-center min-w-[90px] md:min-w-0", children: [
|
|
37903
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(IconComponent, { className: "w-5 h-5 md:w-6 md:h-6 text-gray900" }),
|
|
37904
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-lg md:text-xl font-bold text-gray900", children: platform === "youtubeMetrics" ? formatFollowerCount2(metrics.subscribers || 0) : formatFollowerCount2(metrics.followers || 0) })
|
|
37905
|
+
] }),
|
|
37906
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-start min-w-[130px] md:min-w-0", children: [
|
|
37907
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
37908
|
+
"span",
|
|
37909
|
+
{
|
|
37910
|
+
className: "text-base md:text-lg dark:text-white max-w-[90%] truncate cursor-default",
|
|
37911
|
+
title: `@${platform === "youtubeMetrics" ? metrics.channelName : metrics.username}`,
|
|
37912
|
+
children: [
|
|
37913
|
+
"@",
|
|
37914
|
+
platform === "youtubeMetrics" ? metrics.channelName : metrics.username
|
|
37915
|
+
]
|
|
37916
|
+
}
|
|
37917
|
+
),
|
|
37918
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-xs md:text-sm text-gray900 opacity-90", children: platformName })
|
|
37919
|
+
] }),
|
|
37920
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37921
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("span", { className: "text-sm md:text-md font-semibold text-gray900", children: [
|
|
37922
|
+
(metrics.engagementRate * 100).toFixed(2),
|
|
37923
|
+
"%"
|
|
37924
|
+
] }),
|
|
37925
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-xs text-gray900 opacity-80", children: "Engagement Rate" })
|
|
37926
|
+
] }),
|
|
37927
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37928
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-sm md:text-md font-semibold text-gray900", children: Math.round(metrics.avgLikes)?.toLocaleString() }),
|
|
37929
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-xs text-gray900 opacity-80", children: "Avg Likes" })
|
|
37930
|
+
] }),
|
|
37931
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37932
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-sm md:text-md font-semibold text-gray900", children: Math.round(metrics.avgComments)?.toLocaleString() }),
|
|
37933
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-xs text-gray900 opacity-80", children: "Avg Comments" })
|
|
37934
|
+
] })
|
|
37935
|
+
]
|
|
37936
|
+
}
|
|
37937
|
+
);
|
|
37938
|
+
}
|
|
37939
|
+
function PlatformPostsSection({
|
|
37940
|
+
platformMetrics,
|
|
37941
|
+
posts = []
|
|
37942
|
+
}) {
|
|
37943
|
+
if (!platformMetrics) return null;
|
|
37944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex flex-col gap-8", children: Object.entries(platformMetrics || {}).map(
|
|
37945
|
+
([platform, metrics]) => {
|
|
37946
|
+
if (!metrics) return null;
|
|
37947
|
+
if (metrics.followers === 0 && metrics.subscribers === 0)
|
|
37948
|
+
return null;
|
|
37949
|
+
const platformPosts = filterPostsByPlatform(posts, platform);
|
|
37950
|
+
const platformUsername = metrics.username ?? metrics.channelName ?? "";
|
|
37951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "w-full flex flex-col gap-8", children: [
|
|
37952
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(PlatformMetricsBanner, { platform, metrics }),
|
|
37953
|
+
platformPosts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "pr-6 sm:ml-8 sm:pr-7", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: platformPosts.map((post, idx) => /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
37954
|
+
PostCard,
|
|
37955
|
+
{
|
|
37956
|
+
post,
|
|
37957
|
+
platformUsername
|
|
37958
|
+
},
|
|
37959
|
+
post.post_id ?? post.url ?? idx
|
|
37960
|
+
)) }) })
|
|
37961
|
+
] }, platform);
|
|
37962
|
+
}
|
|
37963
|
+
) }) });
|
|
37964
|
+
}
|
|
37965
|
+
|
|
37966
|
+
// src/molecules/creator-discovery/CreatorWidget/BrandCollaborationsList.tsx
|
|
37967
|
+
var import_react68 = require("react");
|
|
37968
|
+
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
37969
|
+
var import_framer_motion3 = require("framer-motion");
|
|
37970
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
37971
|
+
var getSentimentRank = (score) => {
|
|
37972
|
+
if (score >= 80) {
|
|
37973
|
+
return {
|
|
37974
|
+
rank: "STRONG FIT",
|
|
37975
|
+
bgColor: "bg-greenBackground",
|
|
37976
|
+
textColor: "text-greenText",
|
|
37977
|
+
scoreColor: "text-[#499C54]"
|
|
37978
|
+
};
|
|
37979
|
+
} else if (score >= 50) {
|
|
37980
|
+
return {
|
|
37981
|
+
rank: "MODERATE FIT",
|
|
37982
|
+
bgColor: "bg-orangeBackground",
|
|
37983
|
+
textColor: "text-orangeText",
|
|
37984
|
+
scoreColor: "text-[#B3512F]"
|
|
37985
|
+
};
|
|
37986
|
+
} else if (score >= 0) {
|
|
37987
|
+
return {
|
|
37988
|
+
rank: "POOR FIT",
|
|
37989
|
+
bgColor: "bg-redBackground",
|
|
37990
|
+
textColor: "text-redText",
|
|
37991
|
+
scoreColor: "text-[#BE2C35]"
|
|
37992
|
+
};
|
|
37993
|
+
}
|
|
37994
|
+
return {
|
|
37995
|
+
rank: "Unranked",
|
|
37996
|
+
bgColor: "bg-gray500",
|
|
37997
|
+
textColor: "text-gray200",
|
|
37998
|
+
scoreColor: "text-gray500"
|
|
37999
|
+
};
|
|
38000
|
+
};
|
|
38001
|
+
function BrandMentionDetails({
|
|
38002
|
+
open,
|
|
38003
|
+
onClose,
|
|
38004
|
+
brandBreakdown,
|
|
38005
|
+
selectedBrand
|
|
38006
|
+
}) {
|
|
38007
|
+
const brandStats = brandBreakdown?.insights?.brandBreakdown?.find(
|
|
38008
|
+
(b) => b.brand.toLowerCase() === selectedBrand?.toLowerCase()
|
|
38009
|
+
);
|
|
38010
|
+
const brandMentions = brandBreakdown?.mentions?.filter(
|
|
38011
|
+
(m) => m.normalizedBrand?.toLowerCase() === selectedBrand?.toLowerCase() || m.brand?.toLowerCase() === selectedBrand?.toLowerCase()
|
|
38012
|
+
) || [];
|
|
38013
|
+
if (typeof window === "undefined") return null;
|
|
38014
|
+
return import_react_dom.default.createPortal(
|
|
38015
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_framer_motion3.AnimatePresence, { mode: "sync", children: open && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
38016
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38017
|
+
import_framer_motion3.motion.div,
|
|
38018
|
+
{
|
|
38019
|
+
initial: { opacity: 0 },
|
|
38020
|
+
animate: { opacity: 1 },
|
|
38021
|
+
exit: { opacity: 0 },
|
|
38022
|
+
transition: { duration: 0.2 },
|
|
38023
|
+
className: "fixed inset-0 bg-black bg-opacity-50 z-[80]",
|
|
38024
|
+
onClick: (e) => {
|
|
38025
|
+
e.stopPropagation();
|
|
38026
|
+
onClose();
|
|
38027
|
+
}
|
|
38028
|
+
},
|
|
38029
|
+
"brand-overlay"
|
|
38030
|
+
),
|
|
38031
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
38032
|
+
import_framer_motion3.motion.div,
|
|
38033
|
+
{
|
|
38034
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
38035
|
+
animate: { opacity: 1, scale: 1 },
|
|
38036
|
+
exit: { opacity: 0, scale: 0.95 },
|
|
38037
|
+
transition: { duration: 0.2 },
|
|
38038
|
+
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",
|
|
38039
|
+
onClick: (e) => e.stopPropagation(),
|
|
38040
|
+
children: [
|
|
38041
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex justify-between items-center p-4 border-b border-gray300", children: [
|
|
38042
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("h3", { className: "text-lg font-bold text-gray900", children: [
|
|
38043
|
+
"Brand Mention Details: ",
|
|
38044
|
+
selectedBrand
|
|
38045
|
+
] }),
|
|
38046
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38047
|
+
"button",
|
|
38048
|
+
{
|
|
38049
|
+
onClick: onClose,
|
|
38050
|
+
className: "p-1 rounded-full hover:bg-gray200 transition-colors",
|
|
38051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(X, { className: "w-4 h-4" })
|
|
38052
|
+
}
|
|
38053
|
+
)
|
|
38054
|
+
] }),
|
|
38055
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-6 max-h-[70vh] overflow-y-auto p-4", children: [
|
|
38056
|
+
brandStats && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-gray25 border-2 border-gray200 rounded-xl p-4", children: [
|
|
38057
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("h3", { className: "text-lg font-bold text-gray900 mb-4", children: "Overview" }),
|
|
38058
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
38059
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3", children: [
|
|
38060
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600", children: "Total Mentions" }),
|
|
38061
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-2xl font-bold text-gray900", children: brandStats.mentions })
|
|
38062
|
+
] }),
|
|
38063
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3", children: [
|
|
38064
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600", children: "Posts Count" }),
|
|
38065
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-2xl font-bold text-gray900", children: brandStats.postCount })
|
|
38066
|
+
] }),
|
|
38067
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3", children: [
|
|
38068
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600", children: "Avg Engagement" }),
|
|
38069
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "text-2xl font-bold text-gray900", children: [
|
|
38070
|
+
brandStats.averageEngagementRate?.toFixed(2),
|
|
38071
|
+
"%"
|
|
38072
|
+
] })
|
|
38073
|
+
] }),
|
|
38074
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3", children: [
|
|
38075
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600", children: "Effectiveness" }),
|
|
38076
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
38077
|
+
"div",
|
|
38078
|
+
{
|
|
38079
|
+
className: `text-2xl font-bold ${getSentimentRank(brandStats.effectivenessPercent).scoreColor}`,
|
|
38080
|
+
children: [
|
|
38081
|
+
brandStats.effectivenessPercent,
|
|
38082
|
+
"%"
|
|
38083
|
+
]
|
|
38084
|
+
}
|
|
38085
|
+
)
|
|
38086
|
+
] })
|
|
38087
|
+
] }),
|
|
38088
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "mt-3 flex gap-2 flex-wrap", children: brandStats.collaborationTypes?.map(
|
|
38089
|
+
(type, idx) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38090
|
+
"span",
|
|
38091
|
+
{
|
|
38092
|
+
className: "px-3 py-1 rounded-md text-xs font-medium bg-[#1D4324] text-[#72E285]",
|
|
38093
|
+
children: type
|
|
38094
|
+
},
|
|
38095
|
+
idx
|
|
38096
|
+
)
|
|
38097
|
+
) })
|
|
38098
|
+
] }),
|
|
38099
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
|
|
38100
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("h3", { className: "text-lg font-bold text-gray900 mb-3", children: [
|
|
38101
|
+
"Individual Mentions (",
|
|
38102
|
+
brandMentions.length,
|
|
38103
|
+
")"
|
|
38104
|
+
] }),
|
|
38105
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex flex-col gap-3", children: brandMentions.map((mention, index) => {
|
|
38106
|
+
const IconComponent = getPlatformIcon(mention?.platform);
|
|
38107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
38108
|
+
"div",
|
|
38109
|
+
{
|
|
38110
|
+
className: "bg-gray50 border-2 border-gray200 rounded-xl p-4 hover:border-purple100 transition-colors",
|
|
38111
|
+
children: [
|
|
38112
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
38113
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
38114
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(IconComponent, { className: "w-5 h-5 text-gray900" }),
|
|
38115
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-sm font-medium text-gray700 capitalize", children: mention.platform })
|
|
38116
|
+
] }),
|
|
38117
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
38118
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "px-2 py-1 rounded-md text-xs font-medium bg-[#1D4324] text-[#72E285]", children: mention.collaborationType }),
|
|
38119
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "text-xs text-gray600", children: [
|
|
38120
|
+
Math.round(mention.confidence * 100),
|
|
38121
|
+
"% confidence"
|
|
38122
|
+
] })
|
|
38123
|
+
] })
|
|
38124
|
+
] }),
|
|
38125
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "mb-2", children: [
|
|
38126
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "text-xs text-gray500", children: [
|
|
38127
|
+
"Post ID:",
|
|
38128
|
+
" "
|
|
38129
|
+
] }),
|
|
38130
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-xs font-mono text-gray700", children: mention.post_id })
|
|
38131
|
+
] }),
|
|
38132
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3 border border-gray300", children: [
|
|
38133
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600 mb-1", children: "Evidence:" }),
|
|
38134
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("p", { className: "text-sm text-gray800 italic", children: [
|
|
38135
|
+
"\u201C",
|
|
38136
|
+
mention.evidence,
|
|
38137
|
+
"\u201D"
|
|
38138
|
+
] })
|
|
38139
|
+
] }),
|
|
38140
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "mt-2 text-xs text-gray500", children: [
|
|
38141
|
+
"Source:",
|
|
38142
|
+
" ",
|
|
38143
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "font-medium", children: mention.source }),
|
|
38144
|
+
mention.handle && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "ml-2", children: [
|
|
38145
|
+
"Handle:",
|
|
38146
|
+
" ",
|
|
38147
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "font-medium", children: mention.handle })
|
|
38148
|
+
] })
|
|
38149
|
+
] })
|
|
38150
|
+
]
|
|
38151
|
+
},
|
|
38152
|
+
index
|
|
38153
|
+
);
|
|
38154
|
+
}) })
|
|
38155
|
+
] }),
|
|
38156
|
+
brandMentions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-center py-8 text-gray500", children: "No mentions found for this brand" })
|
|
38157
|
+
] })
|
|
38158
|
+
]
|
|
38159
|
+
},
|
|
38160
|
+
"brand-modal"
|
|
38161
|
+
)
|
|
38162
|
+
] }) }),
|
|
38163
|
+
document.body
|
|
38164
|
+
);
|
|
38165
|
+
}
|
|
38166
|
+
function BrandCollaborationsList({
|
|
38167
|
+
brandBreakdown
|
|
38168
|
+
}) {
|
|
38169
|
+
const [openDetails, setOpenDetails] = (0, import_react68.useState)(false);
|
|
38170
|
+
const [selectedBrand, setSelectedBrand] = (0, import_react68.useState)("");
|
|
38171
|
+
if (!brandBreakdown?.insights?.brandBreakdown || brandBreakdown.insights.brandBreakdown.length === 0) {
|
|
38172
|
+
return null;
|
|
38173
|
+
}
|
|
38174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
38175
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
|
|
38176
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-purpleText text-xs mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "BRAND MENTIONS" }) }),
|
|
38177
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex flex-col gap-2 max-h-[220px] overflow-y-auto", children: brandBreakdown.insights.brandBreakdown.map(
|
|
38178
|
+
(item, index) => /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
38179
|
+
"div",
|
|
38180
|
+
{
|
|
38181
|
+
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",
|
|
38182
|
+
onClick: (e) => {
|
|
38183
|
+
e.stopPropagation();
|
|
38184
|
+
setSelectedBrand(item?.brand);
|
|
38185
|
+
setOpenDetails(true);
|
|
38186
|
+
},
|
|
38187
|
+
children: [
|
|
38188
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "w-10 h-10 rounded-full bg-gray200 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-sm font-bold text-gray700", children: item.brand?.charAt(0)?.toUpperCase() || "?" }) }),
|
|
38189
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
38190
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-gray900 text-sm", children: item.brand }),
|
|
38191
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex gap-2 text-xs text-gray600", children: [
|
|
38192
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
|
|
38193
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-gray900", children: item?.mentions }),
|
|
38194
|
+
" ",
|
|
38195
|
+
"Mention"
|
|
38196
|
+
] }),
|
|
38197
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
|
|
38198
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38199
|
+
"span",
|
|
38200
|
+
{
|
|
38201
|
+
className: `${getSentimentRank(item.effectivenessPercent).scoreColor} font-bold`,
|
|
38202
|
+
children: item.effectivenessPercent ? `${item.effectivenessPercent}%` : "N/A"
|
|
38203
|
+
}
|
|
38204
|
+
),
|
|
38205
|
+
" ",
|
|
38206
|
+
"Effectiveness"
|
|
38207
|
+
] })
|
|
38208
|
+
] })
|
|
38209
|
+
] })
|
|
38210
|
+
]
|
|
38211
|
+
},
|
|
38212
|
+
index
|
|
38213
|
+
)
|
|
38214
|
+
) })
|
|
38215
|
+
] }),
|
|
38216
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38217
|
+
BrandMentionDetails,
|
|
38218
|
+
{
|
|
38219
|
+
open: openDetails,
|
|
38220
|
+
onClose: () => setOpenDetails(false),
|
|
38221
|
+
brandBreakdown,
|
|
38222
|
+
selectedBrand
|
|
38223
|
+
}
|
|
38224
|
+
)
|
|
38225
|
+
] });
|
|
38226
|
+
}
|
|
38227
|
+
|
|
38228
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorGridView.tsx
|
|
38229
|
+
var import_react69 = require("react");
|
|
38230
|
+
var import_framer_motion4 = require("framer-motion");
|
|
38231
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
38232
|
+
var formatFollowerCount3 = (count) => {
|
|
38233
|
+
if (count >= 1e6) {
|
|
38234
|
+
const millions = count / 1e6;
|
|
38235
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
38236
|
+
} else if (count >= 1e4) {
|
|
38237
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
38238
|
+
} else if (count >= 1e3) {
|
|
38239
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
38240
|
+
}
|
|
38241
|
+
return Math.floor(count).toString();
|
|
38242
|
+
};
|
|
38243
|
+
var getSentimentRank2 = (score) => {
|
|
38244
|
+
if (score >= 80) {
|
|
38245
|
+
return {
|
|
38246
|
+
bgColor: "bg-greenBackground",
|
|
38247
|
+
textColor: "text-greenText",
|
|
38248
|
+
scoreColor: "text-[#499C54]"
|
|
38249
|
+
};
|
|
38250
|
+
} else if (score >= 50) {
|
|
38251
|
+
return {
|
|
38252
|
+
bgColor: "bg-orangeBackground",
|
|
38253
|
+
textColor: "text-orangeText",
|
|
38254
|
+
scoreColor: "text-[#B3512F]"
|
|
38255
|
+
};
|
|
38256
|
+
} else if (score >= 0) {
|
|
38257
|
+
return {
|
|
38258
|
+
bgColor: "bg-redBackground",
|
|
38259
|
+
textColor: "text-redText",
|
|
38260
|
+
scoreColor: "text-[#BE2C35]"
|
|
38261
|
+
};
|
|
38262
|
+
}
|
|
38263
|
+
return {
|
|
38264
|
+
bgColor: "bg-gray500",
|
|
38265
|
+
textColor: "text-gray200",
|
|
38266
|
+
scoreColor: "text-gray200"
|
|
38267
|
+
};
|
|
38268
|
+
};
|
|
38269
|
+
var itemsExplanation = [
|
|
38270
|
+
{ key: "contentRelevance", label: "Content Relevance" },
|
|
38271
|
+
{ key: "audienceMatch", label: "Audience Match" },
|
|
38272
|
+
{ key: "authorityExpertise", label: "Expertise" },
|
|
38273
|
+
{ key: "contentQuality", label: "Content Quality" },
|
|
38274
|
+
{ key: "authenticity", label: "Authenticity" },
|
|
38275
|
+
{ key: "brandSafety", label: "Brand Safety" }
|
|
38276
|
+
];
|
|
38277
|
+
function CreatorGridViewCard({ creator }) {
|
|
38278
|
+
const [isExpanded, setIsExpanded] = (0, import_react69.useState)(false);
|
|
38279
|
+
const [showFullDescription, setShowFullDescription] = (0, import_react69.useState)(false);
|
|
38280
|
+
const [isDescriptionOverflowing, setIsDescriptionOverflowing] = (0, import_react69.useState)(false);
|
|
38281
|
+
const descriptionRef = (0, import_react69.useRef)(null);
|
|
38282
|
+
const cardRef = (0, import_react69.useRef)(null);
|
|
38283
|
+
const checkDescriptionOverflow = (0, import_react69.useCallback)(() => {
|
|
38284
|
+
const el = descriptionRef.current;
|
|
38285
|
+
if (!el) return;
|
|
38286
|
+
setIsDescriptionOverflowing(el.scrollHeight > el.clientHeight + 1);
|
|
38287
|
+
}, []);
|
|
38288
|
+
(0, import_react69.useEffect)(() => {
|
|
38289
|
+
checkDescriptionOverflow();
|
|
38290
|
+
}, [checkDescriptionOverflow, isExpanded, showFullDescription]);
|
|
38291
|
+
(0, import_react69.useEffect)(() => {
|
|
38292
|
+
const onResize = () => checkDescriptionOverflow();
|
|
38293
|
+
window.addEventListener("resize", onResize);
|
|
38294
|
+
return () => window.removeEventListener("resize", onResize);
|
|
38295
|
+
}, [checkDescriptionOverflow]);
|
|
38296
|
+
const platformStats = (0, import_react69.useMemo)(() => {
|
|
38297
|
+
return [
|
|
38298
|
+
{
|
|
38299
|
+
platform: "instagram",
|
|
38300
|
+
icon: InstagramIcon,
|
|
38301
|
+
followers: creator.metrics?.instagram?.followers || 0,
|
|
38302
|
+
engagement: creator.metrics?.instagram?.engagement || 0
|
|
38303
|
+
},
|
|
38304
|
+
{
|
|
38305
|
+
platform: "youtube",
|
|
38306
|
+
icon: YouTubeIcon,
|
|
38307
|
+
followers: creator.metrics?.youtube?.followers || 0,
|
|
38308
|
+
engagement: creator.metrics?.youtube?.engagement || 0
|
|
38309
|
+
},
|
|
38310
|
+
{
|
|
38311
|
+
platform: "tiktok",
|
|
38312
|
+
icon: TikTokIcon3,
|
|
38313
|
+
followers: creator.metrics?.tiktok?.followers || 0,
|
|
38314
|
+
engagement: creator.metrics?.tiktok?.engagement || 0
|
|
38315
|
+
}
|
|
38316
|
+
];
|
|
38317
|
+
}, [creator]);
|
|
38318
|
+
const toggleExpanded = () => {
|
|
38319
|
+
const willExpand = !isExpanded;
|
|
38320
|
+
setIsExpanded(willExpand);
|
|
38321
|
+
setTimeout(() => {
|
|
38322
|
+
if (cardRef.current) {
|
|
38323
|
+
cardRef.current.scrollIntoView({
|
|
38324
|
+
behavior: "smooth",
|
|
38325
|
+
block: willExpand ? "center" : "nearest"
|
|
38326
|
+
});
|
|
38327
|
+
}
|
|
38328
|
+
}, 100);
|
|
38329
|
+
};
|
|
38330
|
+
const iso2 = normalizeToIso2(creator.country);
|
|
38331
|
+
const meta = codeToMeta[iso2];
|
|
38332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38333
|
+
import_framer_motion4.motion.div,
|
|
38334
|
+
{
|
|
38335
|
+
ref: cardRef,
|
|
38336
|
+
layout: "position",
|
|
38337
|
+
initial: { opacity: 0, y: 10 },
|
|
38338
|
+
animate: { opacity: 1, y: 0 },
|
|
38339
|
+
transition: { duration: 0.3 },
|
|
38340
|
+
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" : ""}`,
|
|
38341
|
+
style: isExpanded ? { gridColumn: "1 / -1" } : {},
|
|
38342
|
+
onClick: toggleExpanded,
|
|
38343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex", children: [
|
|
38344
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: `${isExpanded ? "w-1/3" : "w-full"}`, children: [
|
|
38345
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "relative w-full aspect-square mb-2", children: [
|
|
38346
|
+
creator.profile_pic ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38347
|
+
"img",
|
|
38348
|
+
{
|
|
38349
|
+
src: creator.profile_pic,
|
|
38350
|
+
alt: creator.name,
|
|
38351
|
+
className: "w-full h-full object-cover bg-primary/10",
|
|
38352
|
+
style: { borderRadius: "10px 10px 0 0" }
|
|
38353
|
+
}
|
|
38354
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38355
|
+
"div",
|
|
38356
|
+
{
|
|
38357
|
+
className: "w-full h-full bg-primary/10 flex items-center justify-center",
|
|
38358
|
+
style: { borderRadius: "10px 10px 0 0" },
|
|
38359
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-2xl text-primary", children: creator.name?.charAt(0) || "?" })
|
|
38360
|
+
}
|
|
38361
|
+
),
|
|
38362
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38363
|
+
"div",
|
|
38364
|
+
{
|
|
38365
|
+
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`,
|
|
38366
|
+
children: creator.sentiment ? `${creator.sentiment?.matchScore?.toFixed(1)}%` : "N/A"
|
|
38367
|
+
}
|
|
38368
|
+
)
|
|
38369
|
+
] }),
|
|
38370
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "px-3 pb-1", children: [
|
|
38371
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { children: [
|
|
38372
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38373
|
+
"h3",
|
|
38374
|
+
{
|
|
38375
|
+
className: `${isExpanded ? "text-md" : "text-sm"} font-normal text-gray900 mb-1 line-clamp-2 text-start`,
|
|
38376
|
+
children: creator.name || "Unnamed"
|
|
38377
|
+
}
|
|
38378
|
+
),
|
|
38379
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38380
|
+
"div",
|
|
38381
|
+
{
|
|
38382
|
+
className: `${isExpanded ? "text-sm" : "text-xs"} text-gray700 mb-1 text-start flex items-center gap-1`,
|
|
38383
|
+
children: [
|
|
38384
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-base", children: meta?.flag }),
|
|
38385
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { children: meta?.name || creator.country || "Unknown" })
|
|
38386
|
+
]
|
|
38387
|
+
}
|
|
38388
|
+
),
|
|
38389
|
+
isExpanded && creator?.sentiment?.detailedScores && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "mt-2 w-[150px] flex gap-2", children: Object.entries(creator.sentiment.detailedScores).map(
|
|
38390
|
+
([key, value]) => {
|
|
38391
|
+
const itemRank = getSentimentRank2(value);
|
|
38392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38393
|
+
"div",
|
|
38394
|
+
{
|
|
38395
|
+
className: "flex flex-col items-center w-[100px]",
|
|
38396
|
+
children: [
|
|
38397
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38398
|
+
"span",
|
|
38399
|
+
{
|
|
38400
|
+
className: `text-[14px] font-bold ${itemRank.scoreColor}`,
|
|
38401
|
+
children: [
|
|
38402
|
+
value,
|
|
38403
|
+
"%"
|
|
38404
|
+
]
|
|
38405
|
+
}
|
|
38406
|
+
),
|
|
38407
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex items-center justify-center gap-1 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-xs dark:text-gray500 text-center px-1", children: itemsExplanation.find(
|
|
38408
|
+
(item) => item.key === key
|
|
38409
|
+
)?.label }) })
|
|
38410
|
+
]
|
|
38411
|
+
},
|
|
38412
|
+
key
|
|
38413
|
+
);
|
|
38414
|
+
}
|
|
38415
|
+
) }) })
|
|
38416
|
+
] }),
|
|
38417
|
+
!isExpanded && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex gap-2 justify-between", children: platformStats.map(
|
|
38418
|
+
({ platform, icon: Icon3, followers }) => /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38419
|
+
"div",
|
|
38420
|
+
{
|
|
38421
|
+
className: "flex flex-col items-center gap-1",
|
|
38422
|
+
title: `${formatFollowerCount3(followers)} followers`,
|
|
38423
|
+
children: [
|
|
38424
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38425
|
+
Icon3,
|
|
38426
|
+
{
|
|
38427
|
+
className: `w-5 h-5 ${getPlatformIconColor(platform)}`
|
|
38428
|
+
}
|
|
38429
|
+
),
|
|
38430
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-xs dark:text-gray500", children: followers > 0 && formatFollowerCount3(followers) })
|
|
38431
|
+
]
|
|
38432
|
+
},
|
|
38433
|
+
platform
|
|
38434
|
+
)
|
|
38435
|
+
) })
|
|
38436
|
+
] })
|
|
38437
|
+
] }),
|
|
38438
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex-1 border-l border-gray300 p-6 overflow-hidden transition-all duration-300 ease-in-out", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "space-y-4", children: [
|
|
38439
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { children: [
|
|
38440
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38441
|
+
"div",
|
|
38442
|
+
{
|
|
38443
|
+
ref: descriptionRef,
|
|
38444
|
+
className: `${showFullDescription ? "" : "max-h-[80px] overflow-hidden"} relative`,
|
|
38445
|
+
children: [
|
|
38446
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { className: "text-sm text-gray700 leading-relaxed", children: creator.description || "No description provided." }),
|
|
38447
|
+
!showFullDescription && isDescriptionOverflowing && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 h-10 bg-gradient-to-t from-gray25 to-transparent" })
|
|
38448
|
+
]
|
|
38449
|
+
}
|
|
38450
|
+
),
|
|
38451
|
+
(isDescriptionOverflowing || showFullDescription) && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38452
|
+
"button",
|
|
38453
|
+
{
|
|
38454
|
+
onClick: (e) => {
|
|
38455
|
+
e.stopPropagation();
|
|
38456
|
+
setShowFullDescription((v) => !v);
|
|
38457
|
+
},
|
|
38458
|
+
className: "mt-1 px-3 py-1 rounded border border-gray300 text-sm text-gray700 hover:text-gray900",
|
|
38459
|
+
children: showFullDescription ? "Show less" : "Show more"
|
|
38460
|
+
}
|
|
38461
|
+
)
|
|
38462
|
+
] }),
|
|
38463
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex gap-6 justify-start items-center", children: platformStats.map(
|
|
38464
|
+
({ platform, icon: Icon3, followers, engagement }) => /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
38465
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38466
|
+
"div",
|
|
38467
|
+
{
|
|
38468
|
+
className: "flex items-center gap-1",
|
|
38469
|
+
title: `${formatFollowerCount3(followers)} followers`,
|
|
38470
|
+
children: [
|
|
38471
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38472
|
+
Icon3,
|
|
38473
|
+
{
|
|
38474
|
+
className: `w-5 h-5 ${getPlatformIconColor(platform)}`
|
|
38475
|
+
}
|
|
38476
|
+
),
|
|
38477
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-xs dark:text-gray500", children: followers > 0 ? formatFollowerCount3(followers) : "0" })
|
|
38478
|
+
]
|
|
38479
|
+
}
|
|
38480
|
+
),
|
|
38481
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
38482
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ChartColumn, { className: "w-5 h-5 dark:text-gray500" }),
|
|
38483
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("span", { className: "text-sm dark:text-gray500 w-[40px]", children: [
|
|
38484
|
+
(engagement * 100).toFixed(1),
|
|
38485
|
+
"%"
|
|
38486
|
+
] })
|
|
38487
|
+
] })
|
|
38488
|
+
] }, platform)
|
|
38489
|
+
) }),
|
|
38490
|
+
creator.posts?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "w-full overflow-hidden", children: [
|
|
38491
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("h3", { className: "mb-2 text-sm font-medium text-gray900", children: "Recent Posts" }),
|
|
38492
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex gap-3 overflow-x-auto", children: creator.posts.filter(
|
|
38493
|
+
(post) => post.thumbnail || post.thumbnail_url
|
|
38494
|
+
).slice(0, 8).map((post, idx) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38495
|
+
"a",
|
|
38496
|
+
{
|
|
38497
|
+
href: post.url || "#",
|
|
38498
|
+
target: "_blank",
|
|
38499
|
+
rel: "noopener noreferrer",
|
|
38500
|
+
className: "block flex-shrink-0",
|
|
38501
|
+
onClick: (e) => e.stopPropagation(),
|
|
38502
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38503
|
+
"img",
|
|
38504
|
+
{
|
|
38505
|
+
src: post.thumbnail_url || post.thumbnail,
|
|
38506
|
+
alt: post.title || `Post ${idx + 1}`,
|
|
38507
|
+
className: "rounded-md object-cover w-[120px] h-[120px]"
|
|
38508
|
+
}
|
|
38509
|
+
)
|
|
38510
|
+
},
|
|
38511
|
+
idx
|
|
38512
|
+
)) })
|
|
38513
|
+
] }),
|
|
38514
|
+
creator?.sentiment?.aiReasoning && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "text-gray700 max-h-[200px] overflow-auto", children: [
|
|
38515
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("h4", { className: "font-semibold text-sm", children: "AI Analysis" }),
|
|
38516
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { className: "text-sm", children: creator.sentiment.aiReasoning })
|
|
38517
|
+
] })
|
|
38518
|
+
] }) })
|
|
38519
|
+
] })
|
|
38520
|
+
}
|
|
38521
|
+
);
|
|
38522
|
+
}
|
|
38523
|
+
function CreatorGridView({
|
|
38524
|
+
creatorData
|
|
38525
|
+
}) {
|
|
38526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("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__ */ (0, import_jsx_runtime131.jsx)(CreatorGridViewCard, { creator }, creator._id)) });
|
|
38527
|
+
}
|
|
38528
|
+
|
|
38529
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorExpandedPanel.tsx
|
|
38530
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
38531
|
+
var formatFollowerCount4 = (count) => {
|
|
38532
|
+
if (count >= 1e6) {
|
|
38533
|
+
const millions = count / 1e6;
|
|
38534
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
38535
|
+
} else if (count >= 1e4) {
|
|
38536
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
38537
|
+
} else if (count >= 1e3) {
|
|
38538
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
38539
|
+
}
|
|
38540
|
+
return Math.floor(count).toString();
|
|
38541
|
+
};
|
|
38542
|
+
var getSentimentRank3 = (score) => {
|
|
38543
|
+
if (score >= 80) {
|
|
38544
|
+
return {
|
|
38545
|
+
rank: "STRONG FIT",
|
|
38546
|
+
bgColor: "bg-greenBackground",
|
|
38547
|
+
textColor: "text-greenText",
|
|
38548
|
+
scoreColor: "text-[#499C54]"
|
|
38549
|
+
};
|
|
38550
|
+
} else if (score >= 50) {
|
|
38551
|
+
return {
|
|
38552
|
+
rank: "MODERATE FIT",
|
|
38553
|
+
bgColor: "bg-orangeBackground",
|
|
38554
|
+
textColor: "text-orangeText",
|
|
38555
|
+
scoreColor: "text-[#B3512F]"
|
|
38556
|
+
};
|
|
38557
|
+
} else if (score >= 0) {
|
|
38558
|
+
return {
|
|
38559
|
+
rank: "POOR FIT",
|
|
38560
|
+
bgColor: "bg-redBackground",
|
|
38561
|
+
textColor: "text-redText",
|
|
38562
|
+
scoreColor: "text-[#BE2C35]"
|
|
38563
|
+
};
|
|
38564
|
+
}
|
|
38565
|
+
return {
|
|
38566
|
+
rank: "Unranked",
|
|
38567
|
+
bgColor: "bg-gray500",
|
|
38568
|
+
textColor: "text-gray200",
|
|
38569
|
+
scoreColor: "text-gray500"
|
|
38570
|
+
};
|
|
38571
|
+
};
|
|
38572
|
+
function formatCreator(raw) {
|
|
38573
|
+
return {
|
|
38574
|
+
_id: raw.creator_id || raw.profile?.upfluenceId,
|
|
38575
|
+
name: raw.profile?.name || "",
|
|
38576
|
+
description: raw.profile?.description || "",
|
|
38577
|
+
isVerified: raw.profile?.isVerified || false,
|
|
38578
|
+
country: raw.profile?.country || "",
|
|
38579
|
+
profile_pic: raw.profile?.profilePicture || "",
|
|
38580
|
+
platforms: raw.profile?.platforms,
|
|
38581
|
+
platformMetrics: raw.platformMetrics || {},
|
|
38582
|
+
metrics: {
|
|
38583
|
+
instagram: {
|
|
38584
|
+
engagement: raw.platformMetrics?.instagramMetrics?.engagementRate || 0,
|
|
38585
|
+
followers: raw.platformMetrics?.instagramMetrics?.followers || 0,
|
|
38586
|
+
avgLikes: raw.platformMetrics?.instagramMetrics?.avgLikes || 0,
|
|
38587
|
+
avgComments: raw.platformMetrics?.instagramMetrics?.avgComments || 0
|
|
38588
|
+
},
|
|
38589
|
+
youtube: {
|
|
38590
|
+
engagement: raw.platformMetrics?.youtubeMetrics?.engagementRate || 0,
|
|
38591
|
+
followers: raw.platformMetrics?.youtubeMetrics?.subscribers || 0,
|
|
38592
|
+
avgLikes: raw.platformMetrics?.youtubeMetrics?.avgLikes || 0,
|
|
38593
|
+
avgComments: raw.platformMetrics?.youtubeMetrics?.avgComments || 0
|
|
38594
|
+
},
|
|
38595
|
+
tiktok: {
|
|
38596
|
+
engagement: raw.platformMetrics?.tiktokMetrics?.engagementRate || 0,
|
|
38597
|
+
followers: raw.platformMetrics?.tiktokMetrics?.followers || 0,
|
|
38598
|
+
avgLikes: raw.platformMetrics?.tiktokMetrics?.avgLikes || 0,
|
|
38599
|
+
avgComments: raw.platformMetrics?.tiktokMetrics?.avgComments || 0
|
|
38600
|
+
}
|
|
38601
|
+
},
|
|
38602
|
+
posts: raw.posts || [],
|
|
38603
|
+
sentiment: raw.sentiment || null,
|
|
38604
|
+
audienceDemographics: raw.audienceDemographics || null,
|
|
38605
|
+
brandCollaborations: raw.brandCollaborations || null,
|
|
38606
|
+
profile: raw.profile || {}
|
|
38607
|
+
};
|
|
38608
|
+
}
|
|
38609
|
+
var truncateName2 = (name, maxLen) => {
|
|
38610
|
+
if (!name) return "";
|
|
38611
|
+
return name.length > maxLen ? name.slice(0, maxLen) + "..." : name;
|
|
38612
|
+
};
|
|
38613
|
+
function SearchSpecDisplay({ spec }) {
|
|
38614
|
+
if (!spec) return null;
|
|
38615
|
+
const priorityOneBundles = Array.isArray(spec?.keyword_bundles) ? spec.keyword_bundles.filter((b) => b?.priority !== void 0 ? b.priority === 1 : true).flatMap((b) => b?.keywords || []) : [];
|
|
38616
|
+
const textClass = "text-sm text-white dark:text-gray900";
|
|
38617
|
+
const paddingClass = "px-4 py-1";
|
|
38618
|
+
const roundedClass = "rounded-lg";
|
|
38619
|
+
const tagClass = `${textClass} ${paddingClass} bg-[#85888f] dark:bg-[rgba(249,249,249,0.2)] ${roundedClass} border border-[#85888f] dark:border-gray800 font-medium`;
|
|
38620
|
+
const items = [
|
|
38621
|
+
{
|
|
38622
|
+
key: "platforms",
|
|
38623
|
+
title: "Platforms",
|
|
38624
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-wrap gap-2", children: (spec.platforms || []).filter((p) => ["instagram", "youtube", "tiktok"].includes(p.toLowerCase())).map((p, idx) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: `${tagClass} flex items-center justify-center`, children: p.charAt(0).toUpperCase() + p.slice(1).toLowerCase() }, idx)) })
|
|
38625
|
+
},
|
|
38626
|
+
{
|
|
38627
|
+
key: "follower_range",
|
|
38628
|
+
title: "Follower Range",
|
|
38629
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: `inline-block ${tagClass} font-grotesk`, children: [
|
|
38630
|
+
formatFollowerCount4(spec?.follower_range?.min ?? 0),
|
|
38631
|
+
" -",
|
|
38632
|
+
" ",
|
|
38633
|
+
formatFollowerCount4(spec?.follower_range?.max ?? 0)
|
|
38634
|
+
] })
|
|
38635
|
+
},
|
|
38636
|
+
{
|
|
38637
|
+
key: "geography",
|
|
38638
|
+
title: "Geography",
|
|
38639
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: `inline-block ${tagClass} font-grotesk`, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38640
|
+
"div",
|
|
38641
|
+
{
|
|
38642
|
+
className: "max-w-[200px] overflow-x-auto whitespace-nowrap",
|
|
38643
|
+
style: { scrollbarWidth: "none", textOverflow: "ellipsis", overflow: "hidden" },
|
|
38644
|
+
onMouseEnter: (e) => {
|
|
38645
|
+
e.currentTarget.style.textOverflow = "clip";
|
|
38646
|
+
e.currentTarget.style.overflow = "auto";
|
|
38647
|
+
},
|
|
38648
|
+
onMouseLeave: (e) => {
|
|
38649
|
+
e.currentTarget.style.textOverflow = "ellipsis";
|
|
38650
|
+
e.currentTarget.style.overflow = "hidden";
|
|
38651
|
+
e.currentTarget.scrollLeft = 0;
|
|
38652
|
+
},
|
|
38653
|
+
children: (spec.geography || []).map((g, idx) => /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { children: [
|
|
38654
|
+
g,
|
|
38655
|
+
idx < spec.geography.length - 1 ? ", " : ""
|
|
38656
|
+
] }, idx))
|
|
38657
|
+
}
|
|
38658
|
+
) })
|
|
38659
|
+
},
|
|
38660
|
+
{
|
|
38661
|
+
key: "keyword_bundles",
|
|
38662
|
+
title: "Keyword",
|
|
38663
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("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__ */ (0, import_jsx_runtime132.jsx)("div", { className: `${textClass} text-white/70`, children: "No priority 1 keywords" }) : priorityOneBundles.map((kw, idx) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: tagClass, children: kw }, idx)) })
|
|
38664
|
+
}
|
|
38665
|
+
];
|
|
38666
|
+
const itemsToShow = ["platforms", "follower_range", "geography", "keyword_bundles"];
|
|
38667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("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__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex-none p-5 bg-paperBackground rounded-lg", children: [
|
|
38668
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-purpleText text-sm mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: title.toUpperCase() }) }),
|
|
38669
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: `flex text-gray900 ${textClass}`, children: content })
|
|
38670
|
+
] }, key)) }) });
|
|
38671
|
+
}
|
|
38672
|
+
function SentimentScoreRank({
|
|
38673
|
+
score,
|
|
38674
|
+
isValidationComplete,
|
|
38675
|
+
showMinialView = false
|
|
38676
|
+
}) {
|
|
38677
|
+
const sentimentScoreRank = getSentimentRank3(score);
|
|
38678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: `flex flex-col justify-end ${showMinialView ? "w-[120px]" : "w-[150px]"} text-sm`, children: [
|
|
38679
|
+
score !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex justify-center items-center mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38680
|
+
"span",
|
|
38681
|
+
{
|
|
38682
|
+
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]"}`,
|
|
38683
|
+
children: isValidationComplete ? sentimentScoreRank.rank : "Unranked"
|
|
38684
|
+
}
|
|
38685
|
+
) }),
|
|
38686
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: `flex justify-center ${showMinialView ? "text-[24px]" : "text-[28px]"} font-bold mb-3 ${sentimentScoreRank.scoreColor}`, children: isValidationComplete ? score >= 0 ? `${score}%` : "0%" : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex items-center justify-center py-2", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-6 h-6 border-2 border-purple100 border-t-transparent rounded-full animate-spin" }) }) }),
|
|
38687
|
+
!showMinialView && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-gray600 dark:text-gray500 text-center", children: "Match Score" })
|
|
38688
|
+
] }) });
|
|
38689
|
+
}
|
|
38690
|
+
function BrandMentionPerformance({ creator }) {
|
|
38691
|
+
const insights = creator?.brandCollaborations?.insights;
|
|
38692
|
+
if (!insights) return null;
|
|
38693
|
+
const isValid2 = (val) => val !== null && val !== void 0 && val !== 0 && val !== "0" && val !== "" && !Number.isNaN(val);
|
|
38694
|
+
if (!isValid2(insights.averageBrandEngagementRate) && !isValid2(insights.effectivenessPercent) && !isValid2(insights.saturationRate)) {
|
|
38695
|
+
return null;
|
|
38696
|
+
}
|
|
38697
|
+
const metrics = [
|
|
38698
|
+
{ title: "Avg engagement rate", subtitle: "on brand mention", value: `${insights?.averageBrandEngagementRate || 0} %` },
|
|
38699
|
+
{ title: "Effectiveness", subtitle: "compared to all posts", value: `${insights?.effectivenessPercent || 0} %` },
|
|
38700
|
+
{ title: "Saturation Rate", subtitle: "on brand mention", value: `${insights?.saturationRate || 0} %` }
|
|
38701
|
+
];
|
|
38702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { children: [
|
|
38703
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-purpleText text-xs mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "BRAND MENTION PERFORMANCE" }) }),
|
|
38704
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-col gap-3", children: metrics.map((item) => /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex justify-between items-center text-gray700 text-sm", children: [
|
|
38705
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
38706
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h5", { children: item.title }),
|
|
38707
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-xs", children: item.subtitle })
|
|
38708
|
+
] }),
|
|
38709
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-purpleText text-lg", children: item.value })
|
|
38710
|
+
] }, item.title)) })
|
|
38711
|
+
] });
|
|
38712
|
+
}
|
|
38713
|
+
function CreatorFitSummary({ creator, showBrandPerformance }) {
|
|
38714
|
+
const hasDeepAnalysis = creator?.sentiment?.deepAnalysis?.deepAnalysis;
|
|
38715
|
+
const title = hasDeepAnalysis ? "CREATOR DEEP ANALYSIS" : "CREATOR FIT SUMMARY";
|
|
38716
|
+
const content = hasDeepAnalysis ? creator.sentiment.deepAnalysis.deepAnalysis : creator?.sentiment?.aiReasoning || "No data available.";
|
|
38717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: showBrandPerformance ? "col-span-1" : "col-span-2", children: [
|
|
38718
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-purpleText text-xs mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: title }) }),
|
|
38719
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "max-h-[140px] overflow-y-auto slim-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-gray700 text-sm", children: content }) })
|
|
38720
|
+
] });
|
|
38721
|
+
}
|
|
38722
|
+
function ProfileSection({ creator, isValidationComplete }) {
|
|
38723
|
+
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}` : "";
|
|
38724
|
+
const iso2 = normalizeToIso2(creator.country);
|
|
38725
|
+
const meta = codeToMeta[iso2];
|
|
38726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex items-start gap-1 md:gap-6", children: [
|
|
38727
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col items-center gap-6", children: [
|
|
38728
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("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__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
|
|
38729
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38730
|
+
"img",
|
|
38731
|
+
{
|
|
38732
|
+
src: creator.profile_pic,
|
|
38733
|
+
alt: creator.name,
|
|
38734
|
+
className: "object-cover w-[5rem] h-[5rem] rounded-[15px]"
|
|
38735
|
+
}
|
|
38736
|
+
),
|
|
38737
|
+
creator?.profile?.isVerified && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38738
|
+
BadgeCheck,
|
|
38739
|
+
{
|
|
38740
|
+
size: 35,
|
|
38741
|
+
className: "absolute -top-2 -right-2 text-blue-500 drop-shadow-sm fill-blue-300"
|
|
38742
|
+
}
|
|
38743
|
+
)
|
|
38744
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "text-2xl text-primary", children: creator.name?.charAt(0) || "?" }) }),
|
|
38745
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "block sm:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SentimentScoreRank, { score: creator?.sentiment?.matchScore || -1, isValidationComplete, showMinialView: true }) })
|
|
38746
|
+
] }),
|
|
38747
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col gap-3 truncate", children: [
|
|
38748
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h4", { className: "text-lg text-gray900 max-w-[150px]", title: creator.name, children: truncateName2(creator.name, 100) }) }),
|
|
38749
|
+
username && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-xs text-gray700", children: username }),
|
|
38750
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "text-sm text-gray700 flex items-center gap-2", children: [
|
|
38751
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "text-base", children: meta?.flag }),
|
|
38752
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { children: meta?.name || creator.country || "Unknown" })
|
|
38753
|
+
] }),
|
|
38754
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-xs text-gray700 text-wrap", children: truncateName2(creator.description, 100) })
|
|
38755
|
+
] })
|
|
38756
|
+
] });
|
|
38757
|
+
}
|
|
38758
|
+
function CreatorCardExpandedSection({
|
|
38759
|
+
creator
|
|
38760
|
+
}) {
|
|
38761
|
+
const hasBrandBreakdown = creator?.brandCollaborations?.insights?.brandBreakdown && creator?.sentiment?.deepAnalysis;
|
|
38762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
|
|
38763
|
+
import_framer_motion5.motion.div,
|
|
38764
|
+
{
|
|
38765
|
+
initial: { y: 20, opacity: 0 },
|
|
38766
|
+
animate: { y: 0, opacity: 1 },
|
|
38767
|
+
transition: { duration: 0.3, delay: 0.1 },
|
|
38768
|
+
className: "md:mt-6 space-y-5",
|
|
38769
|
+
children: [
|
|
38770
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "md:grid md:grid-cols-[1.3fr_1fr_2fr_120px] gap-8 py-4 pr-7", children: [
|
|
38771
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "col-span-4 sm:col-span-1", children: hasBrandBreakdown ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38772
|
+
BrandCollaborationsList,
|
|
38773
|
+
{
|
|
38774
|
+
brandBreakdown: creator?.brandCollaborations
|
|
38775
|
+
}
|
|
38776
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "hidden sm:block" }) }),
|
|
38777
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "col-span-4 sm:col-span-3", children: creator?.audienceDemographics ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38778
|
+
EngagedAudienceDemographics,
|
|
38779
|
+
{
|
|
38780
|
+
audienceDemographics: creator.audienceDemographics
|
|
38781
|
+
}
|
|
38782
|
+
) : null })
|
|
38783
|
+
] }),
|
|
38784
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38785
|
+
PlatformPostsSection,
|
|
38786
|
+
{
|
|
38787
|
+
platformMetrics: creator.platformMetrics,
|
|
38788
|
+
posts: creator.posts ?? creator.post
|
|
38789
|
+
}
|
|
38790
|
+
)
|
|
38791
|
+
]
|
|
38792
|
+
}
|
|
38793
|
+
);
|
|
38794
|
+
}
|
|
38795
|
+
function CreatorCard({
|
|
38796
|
+
creator,
|
|
38797
|
+
isValidationComplete
|
|
38798
|
+
}) {
|
|
38799
|
+
const [detailsExpanded, setDetailsExpanded] = (0, import_react70.useState)(false);
|
|
38800
|
+
const hasValidBrandMention = (() => {
|
|
38801
|
+
const insights = creator?.brandCollaborations?.insights;
|
|
38802
|
+
if (!insights) return false;
|
|
38803
|
+
const isValid2 = (val) => val !== null && val !== void 0 && val !== 0 && val !== "0" && val !== "" && !Number.isNaN(val);
|
|
38804
|
+
return isValid2(insights.averageBrandEngagementRate) || isValid2(insights.effectivenessPercent) || isValid2(insights.saturationRate);
|
|
38805
|
+
})();
|
|
38806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
|
|
38807
|
+
import_framer_motion5.motion.div,
|
|
38808
|
+
{
|
|
38809
|
+
layout: true,
|
|
38810
|
+
initial: { opacity: 0, y: 20 },
|
|
38811
|
+
animate: { opacity: 1, y: 0 },
|
|
38812
|
+
exit: { opacity: 0, y: -20 },
|
|
38813
|
+
transition: { duration: 0.4, ease: [0.22, 1, 0.36, 1] },
|
|
38814
|
+
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"}`,
|
|
38815
|
+
onClick: () => setDetailsExpanded((prev) => !prev),
|
|
38816
|
+
children: [
|
|
38817
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("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: [
|
|
38818
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(ProfileSection, { creator, isValidationComplete }),
|
|
38819
|
+
hasValidBrandMention && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(BrandMentionPerformance, { creator }),
|
|
38820
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorFitSummary, { creator, showBrandPerformance: hasValidBrandMention }),
|
|
38821
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SentimentScoreRank, { score: creator?.sentiment?.matchScore || -1, isValidationComplete }) })
|
|
38822
|
+
] }),
|
|
38823
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_framer_motion5.AnimatePresence, { children: detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38824
|
+
import_framer_motion5.motion.div,
|
|
38825
|
+
{
|
|
38826
|
+
initial: { height: 0, opacity: 0 },
|
|
38827
|
+
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 } } },
|
|
38828
|
+
exit: { height: 0, opacity: 0, transition: { height: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] }, opacity: { duration: 0.2 } } },
|
|
38829
|
+
className: "overflow-hidden mt-4",
|
|
38830
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorCardExpandedSection, { creator })
|
|
38831
|
+
}
|
|
38832
|
+
) })
|
|
38833
|
+
]
|
|
38834
|
+
}
|
|
38835
|
+
);
|
|
38836
|
+
}
|
|
38837
|
+
function CreatorDisplay({
|
|
38838
|
+
creators,
|
|
38839
|
+
isValidationComplete
|
|
38840
|
+
}) {
|
|
38841
|
+
const [viewMode, setViewMode] = (0, import_react70.useState)("list");
|
|
38842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "px-4", children: [
|
|
38843
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex justify-end items-center my-3 gap-1", children: [
|
|
38844
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "text-xs text-gray600 mr-2", children: [
|
|
38845
|
+
creators.length,
|
|
38846
|
+
" creators"
|
|
38847
|
+
] }),
|
|
38848
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38849
|
+
"button",
|
|
38850
|
+
{
|
|
38851
|
+
className: `h-7 w-7 flex items-center justify-center rounded ${viewMode === "list" ? "bg-gray200" : ""}`,
|
|
38852
|
+
onClick: () => setViewMode("list"),
|
|
38853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38854
|
+
AlignJustify,
|
|
38855
|
+
{
|
|
38856
|
+
className: `h-5 w-5 ${viewMode === "list" ? "text-gray900 dark:text-white" : "text-gray500"}`
|
|
38857
|
+
}
|
|
38858
|
+
)
|
|
38859
|
+
}
|
|
38860
|
+
),
|
|
38861
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38862
|
+
"button",
|
|
38863
|
+
{
|
|
38864
|
+
className: `h-7 w-7 flex items-center justify-center rounded ${viewMode === "grid" ? "bg-gray200" : ""}`,
|
|
38865
|
+
onClick: () => setViewMode("grid"),
|
|
38866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38867
|
+
LayoutGrid,
|
|
38868
|
+
{
|
|
38869
|
+
className: `h-5 w-5 ${viewMode === "grid" ? "text-gray900 dark:text-white" : "text-gray500"}`
|
|
38870
|
+
}
|
|
38871
|
+
)
|
|
38872
|
+
}
|
|
38873
|
+
)
|
|
38874
|
+
] }),
|
|
38875
|
+
creators.length > 0 ? viewMode === "list" ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "space-y-4", children: creators.map((creator) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorCard, { creator, isValidationComplete }, creator._id)) }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorGridView, { creatorData: creators }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "text-center py-8 bg-gray100 rounded-lg border border-gray300", children: [
|
|
38876
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Users, { className: "w-6 h-6 text-primary" }) }),
|
|
38877
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h3", { className: "text-base font-medium text-gray900", children: "No creators found" }),
|
|
38878
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "mt-1 text-sm text-gray600", children: "Try adjusting your search criteria" })
|
|
38879
|
+
] })
|
|
38880
|
+
] });
|
|
38881
|
+
}
|
|
38882
|
+
function CreatorExpandedPanel({
|
|
38883
|
+
isOpen,
|
|
38884
|
+
onClose,
|
|
38885
|
+
sessionId,
|
|
38886
|
+
creatorIds,
|
|
38887
|
+
version,
|
|
38888
|
+
searchSpec,
|
|
38889
|
+
fetchCreatorDetails
|
|
38890
|
+
}) {
|
|
38891
|
+
const [creators, setCreators] = (0, import_react70.useState)([]);
|
|
38892
|
+
const [loading, setLoading] = (0, import_react70.useState)(false);
|
|
38893
|
+
const fetcher = fetchCreatorDetails ?? defaultFetchCreatorDetails;
|
|
38894
|
+
const loadCreators = (0, import_react70.useCallback)(async () => {
|
|
38895
|
+
if (!creatorIds.length) return;
|
|
38896
|
+
setLoading(true);
|
|
38897
|
+
try {
|
|
38898
|
+
const data = await fetcher({ creatorIds, sessionId, versionNo: version });
|
|
38899
|
+
setCreators((data.creatorData || []).map(formatCreator));
|
|
38900
|
+
} catch (err) {
|
|
38901
|
+
console.error("Failed to fetch creator details:", err);
|
|
38902
|
+
} finally {
|
|
38903
|
+
setLoading(false);
|
|
38904
|
+
}
|
|
38905
|
+
}, [creatorIds, sessionId, version, fetcher]);
|
|
38906
|
+
(0, import_react70.useEffect)(() => {
|
|
38907
|
+
if (isOpen && creatorIds.length > 0) {
|
|
38908
|
+
loadCreators();
|
|
38909
|
+
}
|
|
38910
|
+
}, [isOpen, loadCreators]);
|
|
38911
|
+
if (typeof window === "undefined") return null;
|
|
38912
|
+
return import_react_dom2.default.createPortal(
|
|
38913
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_framer_motion5.AnimatePresence, { mode: "sync", children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
|
|
38914
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38915
|
+
import_framer_motion5.motion.div,
|
|
38916
|
+
{
|
|
38917
|
+
initial: { opacity: 0 },
|
|
38918
|
+
animate: { opacity: 1 },
|
|
38919
|
+
exit: { opacity: 0, display: "none" },
|
|
38920
|
+
transition: { duration: 0.3 },
|
|
38921
|
+
className: "fixed inset-0 bg-black bg-opacity-50 z-[60]",
|
|
38922
|
+
onClick: (e) => {
|
|
38923
|
+
e.stopPropagation();
|
|
38924
|
+
onClose();
|
|
38925
|
+
}
|
|
38926
|
+
},
|
|
38927
|
+
"overlay"
|
|
38928
|
+
),
|
|
38929
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38930
|
+
import_framer_motion5.motion.div,
|
|
38931
|
+
{
|
|
38932
|
+
initial: { x: "100%" },
|
|
38933
|
+
animate: { x: 0 },
|
|
38934
|
+
exit: { x: "100%" },
|
|
38935
|
+
transition: { type: "spring", damping: 30, stiffness: 400 },
|
|
38936
|
+
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",
|
|
38937
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "py-4 font-noto", children: [
|
|
38938
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex justify-between items-center w-full mb-4 pl-2", children: [
|
|
38939
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("button", { onClick: onClose, className: "p-2 rounded-full transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(X, { className: "w-5 h-5" }) }),
|
|
38940
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex-1 flex flex-col w-[80%]", children: [
|
|
38941
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-col md:flex-row justify-between gap-2 md:gap-0 md:items-center pr-16", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col", children: [
|
|
38942
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-fit rounded-md bg-purple200 px-2 py-[4px] mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h4", { className: "text-xs font-medium text-purpleText", children: "VERIFIED SEARCH RESULTS" }) }),
|
|
38943
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h2", { className: "text-xl font-bold mb-1", children: "Creators Search Results" })
|
|
38944
|
+
] }) }),
|
|
38945
|
+
searchSpec && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SearchSpecDisplay, { spec: searchSpec })
|
|
38946
|
+
] })
|
|
38947
|
+
] }),
|
|
38948
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "border-b border-gray300" }),
|
|
38949
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 gap-3", children: [
|
|
38950
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-8 h-8 border-3 border-purple100 border-t-transparent rounded-full animate-spin" }),
|
|
38951
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-sm text-gray600", children: "Fetching Creators" })
|
|
38952
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorDisplay, { creators, isValidationComplete: version !== void 0 })
|
|
38953
|
+
] })
|
|
38954
|
+
},
|
|
38955
|
+
"creator-panel"
|
|
38956
|
+
)
|
|
38957
|
+
] }) }),
|
|
38958
|
+
document.body
|
|
38959
|
+
);
|
|
38960
|
+
}
|
|
38961
|
+
|
|
38962
|
+
// src/molecules/creator-discovery/CreatorWidget/useCreatorWidgetPolling.ts
|
|
38963
|
+
var import_react71 = require("react");
|
|
37219
38964
|
var DEFAULT_POLLING_CONFIG = {
|
|
37220
38965
|
pollInterval: 5e3,
|
|
37221
38966
|
maxDuration: 15 * 60 * 1e3,
|
|
@@ -37225,27 +38970,29 @@ var DEFAULT_POLLING_CONFIG = {
|
|
|
37225
38970
|
function useCreatorWidgetPolling({
|
|
37226
38971
|
sessionId,
|
|
37227
38972
|
currentVersion,
|
|
37228
|
-
fetchVersions,
|
|
37229
|
-
fetchStatus,
|
|
38973
|
+
fetchVersions: fetchVersionsProp,
|
|
38974
|
+
fetchStatus: fetchStatusProp,
|
|
37230
38975
|
pollingConfig,
|
|
37231
38976
|
onStatusChange
|
|
37232
38977
|
}) {
|
|
37233
|
-
const
|
|
38978
|
+
const fetchVersions = fetchVersionsProp ?? defaultFetchVersions;
|
|
38979
|
+
const fetchStatus = fetchStatusProp ?? defaultFetchStatus;
|
|
38980
|
+
const config = (0, import_react71.useMemo)(
|
|
37234
38981
|
() => ({ ...DEFAULT_POLLING_CONFIG, ...pollingConfig }),
|
|
37235
38982
|
[pollingConfig]
|
|
37236
38983
|
);
|
|
37237
|
-
const [versionData, setVersionData] = (0,
|
|
37238
|
-
const [totalVersions, setTotalVersions] = (0,
|
|
37239
|
-
const [selectedVersion, setSelectedVersion] = (0,
|
|
37240
|
-
const [isLoadingVersion, setIsLoadingVersion] = (0,
|
|
37241
|
-
const [isValidationComplete, setIsValidationComplete] = (0,
|
|
37242
|
-
const [versionStatus, setVersionStatus] = (0,
|
|
37243
|
-
const [statusDetails, setStatusDetails] = (0,
|
|
37244
|
-
const [timeDisplay, setTimeDisplay] = (0,
|
|
37245
|
-
const [loadingStatus, setLoadingStatus] = (0,
|
|
37246
|
-
const remainingTimeRef = (0,
|
|
38984
|
+
const [versionData, setVersionData] = (0, import_react71.useState)(null);
|
|
38985
|
+
const [totalVersions, setTotalVersions] = (0, import_react71.useState)(0);
|
|
38986
|
+
const [selectedVersion, setSelectedVersion] = (0, import_react71.useState)();
|
|
38987
|
+
const [isLoadingVersion, setIsLoadingVersion] = (0, import_react71.useState)(false);
|
|
38988
|
+
const [isValidationComplete, setIsValidationComplete] = (0, import_react71.useState)(false);
|
|
38989
|
+
const [versionStatus, setVersionStatus] = (0, import_react71.useState)("checking");
|
|
38990
|
+
const [statusDetails, setStatusDetails] = (0, import_react71.useState)();
|
|
38991
|
+
const [timeDisplay, setTimeDisplay] = (0, import_react71.useState)("");
|
|
38992
|
+
const [loadingStatus, setLoadingStatus] = (0, import_react71.useState)(true);
|
|
38993
|
+
const remainingTimeRef = (0, import_react71.useRef)(0);
|
|
37247
38994
|
const requestedVersion = selectedVersion ?? currentVersion ?? versionData?.currentVersion;
|
|
37248
|
-
const fetchVersionData = (0,
|
|
38995
|
+
const fetchVersionData = (0, import_react71.useCallback)(async () => {
|
|
37249
38996
|
if (!sessionId) return;
|
|
37250
38997
|
if (!versionData) setIsLoadingVersion(true);
|
|
37251
38998
|
try {
|
|
@@ -37266,17 +39013,17 @@ function useCreatorWidgetPolling({
|
|
|
37266
39013
|
setIsLoadingVersion(false);
|
|
37267
39014
|
}
|
|
37268
39015
|
}, [sessionId, requestedVersion, isValidationComplete, fetchVersions, versionData]);
|
|
37269
|
-
(0,
|
|
39016
|
+
(0, import_react71.useEffect)(() => {
|
|
37270
39017
|
fetchVersionData();
|
|
37271
39018
|
}, [sessionId, requestedVersion, isValidationComplete]);
|
|
37272
|
-
(0,
|
|
39019
|
+
(0, import_react71.useEffect)(() => {
|
|
37273
39020
|
if (totalVersions > 0 || !sessionId) return;
|
|
37274
39021
|
const interval = setInterval(() => {
|
|
37275
39022
|
if (totalVersions === 0) fetchVersionData();
|
|
37276
39023
|
}, config.pollInterval);
|
|
37277
39024
|
return () => clearInterval(interval);
|
|
37278
39025
|
}, [totalVersions, sessionId, fetchVersionData, config.pollInterval]);
|
|
37279
|
-
(0,
|
|
39026
|
+
(0, import_react71.useEffect)(() => {
|
|
37280
39027
|
if (!selectedVersion && !requestedVersion) return;
|
|
37281
39028
|
const activeVersion = selectedVersion ?? requestedVersion;
|
|
37282
39029
|
let isMounted = true;
|
|
@@ -37359,7 +39106,7 @@ function useCreatorWidgetPolling({
|
|
|
37359
39106
|
stopPolling();
|
|
37360
39107
|
};
|
|
37361
39108
|
}, [selectedVersion, requestedVersion, sessionId]);
|
|
37362
|
-
const versionNumbers = (0,
|
|
39109
|
+
const versionNumbers = (0, import_react71.useMemo)(() => {
|
|
37363
39110
|
if (!totalVersions) return [];
|
|
37364
39111
|
return Array.from({ length: totalVersions }, (_, i) => i + 1);
|
|
37365
39112
|
}, [totalVersions]);
|
|
@@ -37386,18 +39133,20 @@ function useCreatorWidgetPolling({
|
|
|
37386
39133
|
}
|
|
37387
39134
|
|
|
37388
39135
|
// src/molecules/creator-discovery/CreatorWidget/CreatorWidget.tsx
|
|
37389
|
-
var
|
|
39136
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
37390
39137
|
function CreatorWidgetInner({
|
|
37391
39138
|
sessionId,
|
|
37392
39139
|
currentVersion,
|
|
37393
39140
|
isAgentOutput = false,
|
|
37394
39141
|
fetchVersions,
|
|
37395
39142
|
fetchStatus,
|
|
39143
|
+
fetchCreatorDetails,
|
|
37396
39144
|
pollingConfig,
|
|
37397
39145
|
onStatusChange,
|
|
37398
39146
|
onAction,
|
|
37399
39147
|
className
|
|
37400
39148
|
}) {
|
|
39149
|
+
const [isExpanded, setIsExpanded] = (0, import_react72.useState)(false);
|
|
37401
39150
|
const {
|
|
37402
39151
|
versionNumbers,
|
|
37403
39152
|
selectedVersion,
|
|
@@ -37418,11 +39167,12 @@ function CreatorWidgetInner({
|
|
|
37418
39167
|
pollingConfig,
|
|
37419
39168
|
onStatusChange
|
|
37420
39169
|
});
|
|
37421
|
-
const handleVersionSelect = (0,
|
|
39170
|
+
const handleVersionSelect = (0, import_react72.useCallback)(
|
|
37422
39171
|
(version) => setSelectedVersion(version),
|
|
37423
39172
|
[setSelectedVersion]
|
|
37424
39173
|
);
|
|
37425
|
-
const handleViewCreators = (0,
|
|
39174
|
+
const handleViewCreators = (0, import_react72.useCallback)(() => {
|
|
39175
|
+
setIsExpanded(true);
|
|
37426
39176
|
onAction?.({
|
|
37427
39177
|
type: "view-creators",
|
|
37428
39178
|
sessionId,
|
|
@@ -37431,30 +39181,41 @@ function CreatorWidgetInner({
|
|
|
37431
39181
|
searchSpec
|
|
37432
39182
|
});
|
|
37433
39183
|
}, [onAction, sessionId, creatorIds, selectedVersion, searchSpec]);
|
|
37434
|
-
|
|
37435
|
-
|
|
37436
|
-
|
|
37437
|
-
|
|
37438
|
-
|
|
37439
|
-
|
|
37440
|
-
|
|
37441
|
-
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
|
|
37446
|
-
|
|
37447
|
-
|
|
37448
|
-
|
|
37449
|
-
|
|
37450
|
-
|
|
37451
|
-
|
|
37452
|
-
|
|
39184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className, children: [
|
|
39185
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
39186
|
+
CreatorCompactView,
|
|
39187
|
+
{
|
|
39188
|
+
versions: versionNumbers,
|
|
39189
|
+
selectedVersion,
|
|
39190
|
+
creatorImages,
|
|
39191
|
+
creatorLength,
|
|
39192
|
+
isAgentOutput,
|
|
39193
|
+
onVersionSelect: handleVersionSelect,
|
|
39194
|
+
onViewCreators: handleViewCreators,
|
|
39195
|
+
versionStatus,
|
|
39196
|
+
statusDetails,
|
|
39197
|
+
timeDisplay,
|
|
39198
|
+
isLoading
|
|
39199
|
+
}
|
|
39200
|
+
),
|
|
39201
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
39202
|
+
CreatorExpandedPanel,
|
|
39203
|
+
{
|
|
39204
|
+
isOpen: isExpanded,
|
|
39205
|
+
onClose: () => setIsExpanded(false),
|
|
39206
|
+
sessionId,
|
|
39207
|
+
creatorIds,
|
|
39208
|
+
version: selectedVersion,
|
|
39209
|
+
searchSpec,
|
|
39210
|
+
fetchCreatorDetails
|
|
39211
|
+
}
|
|
39212
|
+
)
|
|
39213
|
+
] });
|
|
37453
39214
|
}
|
|
37454
|
-
var CreatorWidget = (0,
|
|
39215
|
+
var CreatorWidget = (0, import_react72.memo)(CreatorWidgetInner);
|
|
37455
39216
|
|
|
37456
39217
|
// src/molecules/workstream-builder/ToolListCard/ToolListCard.tsx
|
|
37457
|
-
var
|
|
39218
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
37458
39219
|
var FONT_STYLE = {
|
|
37459
39220
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37460
39221
|
};
|
|
@@ -37525,7 +39286,7 @@ var ToolListCard = ({
|
|
|
37525
39286
|
grouped[cat].push(tool);
|
|
37526
39287
|
}
|
|
37527
39288
|
const categories = Object.keys(grouped);
|
|
37528
|
-
return /* @__PURE__ */ (0,
|
|
39289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
37529
39290
|
"div",
|
|
37530
39291
|
{
|
|
37531
39292
|
className: cn(
|
|
@@ -37534,34 +39295,34 @@ var ToolListCard = ({
|
|
|
37534
39295
|
),
|
|
37535
39296
|
style: FONT_STYLE,
|
|
37536
39297
|
children: [
|
|
37537
|
-
/* @__PURE__ */ (0,
|
|
37538
|
-
/* @__PURE__ */ (0,
|
|
37539
|
-
/* @__PURE__ */ (0,
|
|
37540
|
-
/* @__PURE__ */ (0,
|
|
39298
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03] flex items-center gap-2.5", children: [
|
|
39299
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Wrench, { className: "w-3.5 h-3.5 text-interactive" }) }),
|
|
39300
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: "Available Tools" }),
|
|
39301
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("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 })
|
|
37541
39302
|
] }),
|
|
37542
|
-
/* @__PURE__ */ (0,
|
|
39303
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "divide-y divide-[var(--border-color)]", children: categories.map((cat) => {
|
|
37543
39304
|
const CatIcon = resolveCategoryIcon(cat);
|
|
37544
39305
|
const headerBg = CATEGORY_HEADER_BG[cat.toLowerCase()] || CATEGORY_HEADER_BG.general;
|
|
37545
|
-
return /* @__PURE__ */ (0,
|
|
37546
|
-
/* @__PURE__ */ (0,
|
|
37547
|
-
/* @__PURE__ */ (0,
|
|
37548
|
-
/* @__PURE__ */ (0,
|
|
37549
|
-
/* @__PURE__ */ (0,
|
|
39306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "px-4 py-3", children: [
|
|
39307
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: cn("flex items-center gap-2 mb-2.5 -mx-4 px-4 py-1.5", headerBg), children: [
|
|
39308
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(CatIcon, { className: "w-3.5 h-3.5 text-interactive/70" }),
|
|
39309
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "text-[11px] font-semibold text-[var(--foreground)]/50 uppercase tracking-wider", children: cat }),
|
|
39310
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "text-[10px] text-[var(--foreground)]/30", children: grouped[cat].length })
|
|
37550
39311
|
] }),
|
|
37551
|
-
/* @__PURE__ */ (0,
|
|
39312
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "space-y-1.5", children: grouped[cat].map((tool) => {
|
|
37552
39313
|
const ToolIcon = resolveIcon(tool);
|
|
37553
|
-
return /* @__PURE__ */ (0,
|
|
39314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
37554
39315
|
"div",
|
|
37555
39316
|
{
|
|
37556
39317
|
className: "group flex items-start gap-3 px-3 py-2 rounded-lg hover:bg-[var(--foreground)]/[0.03] transition-colors",
|
|
37557
39318
|
children: [
|
|
37558
|
-
/* @__PURE__ */ (0,
|
|
37559
|
-
/* @__PURE__ */ (0,
|
|
37560
|
-
/* @__PURE__ */ (0,
|
|
37561
|
-
tool.display_name && tool.display_name !== tool.name && /* @__PURE__ */ (0,
|
|
37562
|
-
/* @__PURE__ */ (0,
|
|
39319
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "shrink-0 mt-0.5 w-5 h-5 rounded flex items-center justify-center bg-interactive/[0.08]", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(ToolIcon, { className: "w-3 h-3 text-interactive/60" }) }),
|
|
39320
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39321
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
39322
|
+
tool.display_name && tool.display_name !== tool.name && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "text-[13px] font-medium text-[var(--foreground)] truncate max-w-full", children: tool.display_name }),
|
|
39323
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("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 })
|
|
37563
39324
|
] }),
|
|
37564
|
-
tool.description && /* @__PURE__ */ (0,
|
|
39325
|
+
tool.description && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-xs text-[var(--foreground)]/50 leading-relaxed mt-0.5 break-words whitespace-normal", children: tool.description })
|
|
37565
39326
|
] })
|
|
37566
39327
|
]
|
|
37567
39328
|
},
|
|
@@ -37576,8 +39337,8 @@ var ToolListCard = ({
|
|
|
37576
39337
|
};
|
|
37577
39338
|
|
|
37578
39339
|
// src/molecules/workstream-builder/AgentCard/AgentCard.tsx
|
|
37579
|
-
var
|
|
37580
|
-
var
|
|
39340
|
+
var import_react73 = require("react");
|
|
39341
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
37581
39342
|
var FONT_STYLE2 = {
|
|
37582
39343
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37583
39344
|
};
|
|
@@ -37588,15 +39349,15 @@ var AgentCard = ({
|
|
|
37588
39349
|
onSave,
|
|
37589
39350
|
className
|
|
37590
39351
|
}) => {
|
|
37591
|
-
const [isEditing, setIsEditing] = (0,
|
|
37592
|
-
const [isSaving, setIsSaving] = (0,
|
|
37593
|
-
const [editState, setEditState] = (0,
|
|
39352
|
+
const [isEditing, setIsEditing] = (0, import_react73.useState)(false);
|
|
39353
|
+
const [isSaving, setIsSaving] = (0, import_react73.useState)(false);
|
|
39354
|
+
const [editState, setEditState] = (0, import_react73.useState)({
|
|
37594
39355
|
display_name: agent.display_name,
|
|
37595
39356
|
description: agent.description,
|
|
37596
39357
|
image: agent.image || ""
|
|
37597
39358
|
});
|
|
37598
39359
|
const avatarUrl = agent.image || `https://api.dicebear.com/7.x/avataaars/svg?seed=${agent.name}`;
|
|
37599
|
-
const handleEdit = (0,
|
|
39360
|
+
const handleEdit = (0, import_react73.useCallback)(() => {
|
|
37600
39361
|
setEditState({
|
|
37601
39362
|
display_name: agent.display_name,
|
|
37602
39363
|
description: agent.description,
|
|
@@ -37604,10 +39365,10 @@ var AgentCard = ({
|
|
|
37604
39365
|
});
|
|
37605
39366
|
setIsEditing(true);
|
|
37606
39367
|
}, [agent]);
|
|
37607
|
-
const handleCancel = (0,
|
|
39368
|
+
const handleCancel = (0, import_react73.useCallback)(() => {
|
|
37608
39369
|
setIsEditing(false);
|
|
37609
39370
|
}, []);
|
|
37610
|
-
const handleSave = (0,
|
|
39371
|
+
const handleSave = (0, import_react73.useCallback)(async () => {
|
|
37611
39372
|
if (!onSave) return;
|
|
37612
39373
|
const updates = {};
|
|
37613
39374
|
if (editState.display_name !== agent.display_name)
|
|
@@ -37631,7 +39392,7 @@ var AgentCard = ({
|
|
|
37631
39392
|
}
|
|
37632
39393
|
}, [onSave, agent, editState]);
|
|
37633
39394
|
if (compact) {
|
|
37634
|
-
return /* @__PURE__ */ (0,
|
|
39395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
37635
39396
|
"div",
|
|
37636
39397
|
{
|
|
37637
39398
|
className: cn(
|
|
@@ -37640,14 +39401,14 @@ var AgentCard = ({
|
|
|
37640
39401
|
),
|
|
37641
39402
|
style: FONT_STYLE2,
|
|
37642
39403
|
children: [
|
|
37643
|
-
/* @__PURE__ */ (0,
|
|
37644
|
-
/* @__PURE__ */ (0,
|
|
37645
|
-
/* @__PURE__ */ (0,
|
|
39404
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(Avatar, { className: "h-8 w-8 shrink-0", children: [
|
|
39405
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(AvatarImage, { src: avatarUrl, alt: agent.display_name }),
|
|
39406
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(AvatarFallback, { className: "bg-interactive/10 text-interactive text-xs font-bold", children: agent.display_name.charAt(0) })
|
|
37646
39407
|
] }),
|
|
37647
|
-
/* @__PURE__ */ (0,
|
|
37648
|
-
/* @__PURE__ */ (0,
|
|
37649
|
-
/* @__PURE__ */ (0,
|
|
37650
|
-
/* @__PURE__ */ (0,
|
|
39408
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39409
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
39410
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-[var(--foreground)] text-sm font-semibold truncate", children: agent.display_name }),
|
|
39411
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
37651
39412
|
"span",
|
|
37652
39413
|
{
|
|
37653
39414
|
className: cn(
|
|
@@ -37655,7 +39416,7 @@ var AgentCard = ({
|
|
|
37655
39416
|
agent.enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37656
39417
|
),
|
|
37657
39418
|
children: [
|
|
37658
|
-
/* @__PURE__ */ (0,
|
|
39419
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: cn(
|
|
37659
39420
|
"w-1.5 h-1.5 rounded-full",
|
|
37660
39421
|
agent.enabled ? "bg-emerald-500" : "bg-red-500"
|
|
37661
39422
|
) }),
|
|
@@ -37664,13 +39425,13 @@ var AgentCard = ({
|
|
|
37664
39425
|
}
|
|
37665
39426
|
)
|
|
37666
39427
|
] }),
|
|
37667
|
-
/* @__PURE__ */ (0,
|
|
39428
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-[var(--foreground)]/50 text-xs truncate", children: agent.description })
|
|
37668
39429
|
] })
|
|
37669
39430
|
]
|
|
37670
39431
|
}
|
|
37671
39432
|
);
|
|
37672
39433
|
}
|
|
37673
|
-
return /* @__PURE__ */ (0,
|
|
39434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
37674
39435
|
"div",
|
|
37675
39436
|
{
|
|
37676
39437
|
className: cn(
|
|
@@ -37679,14 +39440,14 @@ var AgentCard = ({
|
|
|
37679
39440
|
),
|
|
37680
39441
|
style: FONT_STYLE2,
|
|
37681
39442
|
children: [
|
|
37682
|
-
/* @__PURE__ */ (0,
|
|
37683
|
-
/* @__PURE__ */ (0,
|
|
37684
|
-
/* @__PURE__ */ (0,
|
|
37685
|
-
/* @__PURE__ */ (0,
|
|
39443
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-start gap-4 px-5 py-4 bg-gradient-to-r from-[var(--foreground)]/[0.02] to-transparent", children: [
|
|
39444
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(Avatar, { className: "h-12 w-12 shrink-0 border-2 border-interactive/20", children: [
|
|
39445
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(AvatarImage, { src: isEditing && editState.image ? editState.image : avatarUrl, alt: agent.display_name }),
|
|
39446
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(AvatarFallback, { className: "bg-interactive/10 text-interactive text-lg font-bold", children: agent.display_name.charAt(0) })
|
|
37686
39447
|
] }),
|
|
37687
|
-
/* @__PURE__ */ (0,
|
|
37688
|
-
/* @__PURE__ */ (0,
|
|
37689
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
39448
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39449
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
39450
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37690
39451
|
"input",
|
|
37691
39452
|
{
|
|
37692
39453
|
type: "text",
|
|
@@ -37696,9 +39457,9 @@ var AgentCard = ({
|
|
|
37696
39457
|
className: "flex-1 bg-transparent border-b border-interactive/30 text-sm font-semibold text-foreground outline-none focus:border-interactive transition-all",
|
|
37697
39458
|
placeholder: "Agent name"
|
|
37698
39459
|
}
|
|
37699
|
-
) : /* @__PURE__ */ (0,
|
|
37700
|
-
/* @__PURE__ */ (0,
|
|
37701
|
-
/* @__PURE__ */ (0,
|
|
39460
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)] truncate", children: agent.display_name }),
|
|
39461
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("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 }),
|
|
39462
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
37702
39463
|
"span",
|
|
37703
39464
|
{
|
|
37704
39465
|
className: cn(
|
|
@@ -37706,7 +39467,7 @@ var AgentCard = ({
|
|
|
37706
39467
|
agent.enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37707
39468
|
),
|
|
37708
39469
|
children: [
|
|
37709
|
-
/* @__PURE__ */ (0,
|
|
39470
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: cn(
|
|
37710
39471
|
"w-1.5 h-1.5 rounded-full",
|
|
37711
39472
|
agent.enabled ? "bg-emerald-500" : "bg-red-500"
|
|
37712
39473
|
) }),
|
|
@@ -37715,7 +39476,7 @@ var AgentCard = ({
|
|
|
37715
39476
|
}
|
|
37716
39477
|
)
|
|
37717
39478
|
] }),
|
|
37718
|
-
/* @__PURE__ */ (0,
|
|
39479
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "mt-1", children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37719
39480
|
"textarea",
|
|
37720
39481
|
{
|
|
37721
39482
|
value: editState.description,
|
|
@@ -37725,10 +39486,10 @@ var AgentCard = ({
|
|
|
37725
39486
|
rows: 2,
|
|
37726
39487
|
placeholder: "Describe this agent..."
|
|
37727
39488
|
}
|
|
37728
|
-
) : /* @__PURE__ */ (0,
|
|
37729
|
-
isEditing && /* @__PURE__ */ (0,
|
|
37730
|
-
/* @__PURE__ */ (0,
|
|
37731
|
-
/* @__PURE__ */ (0,
|
|
39489
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-xs text-[var(--foreground)]/60 leading-relaxed whitespace-normal", children: agent.description }) }),
|
|
39490
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
39491
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-[10px] text-[var(--foreground)]/30 uppercase font-semibold", children: "Avatar:" }),
|
|
39492
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37732
39493
|
"input",
|
|
37733
39494
|
{
|
|
37734
39495
|
type: "text",
|
|
@@ -37741,8 +39502,8 @@ var AgentCard = ({
|
|
|
37741
39502
|
)
|
|
37742
39503
|
] })
|
|
37743
39504
|
] }),
|
|
37744
|
-
editable && onSave && /* @__PURE__ */ (0,
|
|
37745
|
-
/* @__PURE__ */ (0,
|
|
39505
|
+
editable && onSave && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex items-center gap-1.5 shrink-0", children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
39506
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37746
39507
|
"button",
|
|
37747
39508
|
{
|
|
37748
39509
|
onClick: handleCancel,
|
|
@@ -37751,7 +39512,7 @@ var AgentCard = ({
|
|
|
37751
39512
|
children: "Cancel"
|
|
37752
39513
|
}
|
|
37753
39514
|
),
|
|
37754
|
-
/* @__PURE__ */ (0,
|
|
39515
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37755
39516
|
"button",
|
|
37756
39517
|
{
|
|
37757
39518
|
onClick: handleSave,
|
|
@@ -37760,7 +39521,7 @@ var AgentCard = ({
|
|
|
37760
39521
|
children: isSaving ? "Saving..." : "Save"
|
|
37761
39522
|
}
|
|
37762
39523
|
)
|
|
37763
|
-
] }) : /* @__PURE__ */ (0,
|
|
39524
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37764
39525
|
"button",
|
|
37765
39526
|
{
|
|
37766
39527
|
onClick: handleEdit,
|
|
@@ -37769,18 +39530,18 @@ var AgentCard = ({
|
|
|
37769
39530
|
}
|
|
37770
39531
|
) })
|
|
37771
39532
|
] }),
|
|
37772
|
-
/* @__PURE__ */ (0,
|
|
39533
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex flex-wrap items-center gap-3 px-5 pb-3 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("span", { className: "text-[var(--foreground)]/40", children: [
|
|
37773
39534
|
"Model:",
|
|
37774
39535
|
" ",
|
|
37775
|
-
/* @__PURE__ */ (0,
|
|
39536
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "font-mono text-[var(--foreground)]/70", children: agent.model })
|
|
37776
39537
|
] }) }),
|
|
37777
|
-
agent.tools && agent.tools.length > 0 && /* @__PURE__ */ (0,
|
|
37778
|
-
/* @__PURE__ */ (0,
|
|
39538
|
+
agent.tools && agent.tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "border-t border-[var(--border-color)] px-5 py-3", children: [
|
|
39539
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("p", { className: "text-[11px] font-semibold text-[var(--foreground)]/40 uppercase tracking-wide mb-2", children: [
|
|
37779
39540
|
"Tools (",
|
|
37780
39541
|
agent.tools.length,
|
|
37781
39542
|
")"
|
|
37782
39543
|
] }),
|
|
37783
|
-
/* @__PURE__ */ (0,
|
|
39544
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex flex-wrap gap-1.5", children: agent.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37784
39545
|
"span",
|
|
37785
39546
|
{
|
|
37786
39547
|
className: "text-[11px] px-2 py-0.5 rounded-md bg-interactive/10 text-interactive font-mono border border-interactive/20",
|
|
@@ -37795,7 +39556,7 @@ var AgentCard = ({
|
|
|
37795
39556
|
};
|
|
37796
39557
|
|
|
37797
39558
|
// src/molecules/workstream-builder/AgentDataTable/AgentDataTable.tsx
|
|
37798
|
-
var
|
|
39559
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
37799
39560
|
var FONT_STYLE3 = {
|
|
37800
39561
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37801
39562
|
};
|
|
@@ -37806,7 +39567,7 @@ var AgentDataTable = ({
|
|
|
37806
39567
|
}) => {
|
|
37807
39568
|
const renderCell = (value) => {
|
|
37808
39569
|
if (typeof value === "boolean") {
|
|
37809
|
-
return /* @__PURE__ */ (0,
|
|
39570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
37810
39571
|
"span",
|
|
37811
39572
|
{
|
|
37812
39573
|
className: cn(
|
|
@@ -37814,18 +39575,18 @@ var AgentDataTable = ({
|
|
|
37814
39575
|
value ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37815
39576
|
),
|
|
37816
39577
|
children: [
|
|
37817
|
-
value ? /* @__PURE__ */ (0,
|
|
37818
|
-
/* @__PURE__ */ (0,
|
|
37819
|
-
/* @__PURE__ */ (0,
|
|
39578
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
39579
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
39580
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
37820
39581
|
] }),
|
|
37821
39582
|
value ? "Yes" : "No"
|
|
37822
39583
|
]
|
|
37823
39584
|
}
|
|
37824
39585
|
);
|
|
37825
39586
|
}
|
|
37826
|
-
return /* @__PURE__ */ (0,
|
|
39587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { className: "text-[var(--foreground)]", children: String(value) });
|
|
37827
39588
|
};
|
|
37828
|
-
return /* @__PURE__ */ (0,
|
|
39589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
37829
39590
|
"div",
|
|
37830
39591
|
{
|
|
37831
39592
|
className: cn(
|
|
@@ -37833,8 +39594,8 @@ var AgentDataTable = ({
|
|
|
37833
39594
|
className
|
|
37834
39595
|
),
|
|
37835
39596
|
style: FONT_STYLE3,
|
|
37836
|
-
children: /* @__PURE__ */ (0,
|
|
37837
|
-
/* @__PURE__ */ (0,
|
|
39597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("table", { className: "w-full text-xs", children: [
|
|
39598
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("tr", { className: "border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03]", children: headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
37838
39599
|
"th",
|
|
37839
39600
|
{
|
|
37840
39601
|
className: "text-left px-4 py-2.5 text-[11px] font-semibold text-[var(--foreground)]/60 uppercase tracking-wide whitespace-nowrap",
|
|
@@ -37842,14 +39603,14 @@ var AgentDataTable = ({
|
|
|
37842
39603
|
},
|
|
37843
39604
|
header
|
|
37844
39605
|
)) }) }),
|
|
37845
|
-
/* @__PURE__ */ (0,
|
|
39606
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("tbody", { children: rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
37846
39607
|
"tr",
|
|
37847
39608
|
{
|
|
37848
39609
|
className: cn(
|
|
37849
39610
|
"border-b border-[var(--border-color)] last:border-b-0 hover:bg-[var(--foreground)]/[0.03] transition-colors",
|
|
37850
39611
|
rowIdx % 2 === 1 && "bg-[var(--foreground)]/[0.015]"
|
|
37851
39612
|
),
|
|
37852
|
-
children: row.map((cell, cellIdx) => /* @__PURE__ */ (0,
|
|
39613
|
+
children: row.map((cell, cellIdx) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
37853
39614
|
"td",
|
|
37854
39615
|
{
|
|
37855
39616
|
className: "px-4 py-2.5 text-xs whitespace-nowrap",
|
|
@@ -37866,8 +39627,8 @@ var AgentDataTable = ({
|
|
|
37866
39627
|
};
|
|
37867
39628
|
|
|
37868
39629
|
// src/molecules/workstream-builder/WorkflowVisualizer/WorkflowVisualizer.tsx
|
|
37869
|
-
var
|
|
37870
|
-
var
|
|
39630
|
+
var import_react74 = require("react");
|
|
39631
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
37871
39632
|
var FONT_STYLE4 = {
|
|
37872
39633
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37873
39634
|
};
|
|
@@ -37875,10 +39636,10 @@ var WorkflowVisualizer = ({
|
|
|
37875
39636
|
steps,
|
|
37876
39637
|
className
|
|
37877
39638
|
}) => {
|
|
37878
|
-
const [expandedStep, setExpandedStep] = (0,
|
|
39639
|
+
const [expandedStep, setExpandedStep] = (0, import_react74.useState)(
|
|
37879
39640
|
steps[0]?.id || null
|
|
37880
39641
|
);
|
|
37881
|
-
return /* @__PURE__ */ (0,
|
|
39642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
37882
39643
|
"div",
|
|
37883
39644
|
{
|
|
37884
39645
|
className: cn(
|
|
@@ -37887,8 +39648,8 @@ var WorkflowVisualizer = ({
|
|
|
37887
39648
|
),
|
|
37888
39649
|
style: FONT_STYLE4,
|
|
37889
39650
|
children: [
|
|
37890
|
-
/* @__PURE__ */ (0,
|
|
37891
|
-
/* @__PURE__ */ (0,
|
|
39651
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03] flex items-center gap-2.5", children: [
|
|
39652
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
37892
39653
|
"svg",
|
|
37893
39654
|
{
|
|
37894
39655
|
width: "14",
|
|
@@ -37900,24 +39661,24 @@ var WorkflowVisualizer = ({
|
|
|
37900
39661
|
className: "text-interactive",
|
|
37901
39662
|
strokeLinecap: "round",
|
|
37902
39663
|
strokeLinejoin: "round",
|
|
37903
|
-
children: /* @__PURE__ */ (0,
|
|
39664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("polyline", { points: "22 12 18 12 15 21 9 3 6 12 2 12" })
|
|
37904
39665
|
}
|
|
37905
39666
|
) }),
|
|
37906
|
-
/* @__PURE__ */ (0,
|
|
37907
|
-
/* @__PURE__ */ (0,
|
|
39667
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: "Workflow" }),
|
|
39668
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("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: [
|
|
37908
39669
|
steps.length,
|
|
37909
39670
|
" steps"
|
|
37910
39671
|
] })
|
|
37911
39672
|
] }),
|
|
37912
|
-
/* @__PURE__ */ (0,
|
|
39673
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "px-4 py-3", children: steps.map((step, idx) => {
|
|
37913
39674
|
const isLast = idx === steps.length - 1;
|
|
37914
39675
|
const isExpanded = expandedStep === step.id;
|
|
37915
|
-
return /* @__PURE__ */ (0,
|
|
37916
|
-
/* @__PURE__ */ (0,
|
|
37917
|
-
/* @__PURE__ */ (0,
|
|
37918
|
-
!isLast && /* @__PURE__ */ (0,
|
|
39676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex gap-3", children: [
|
|
39677
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex flex-col items-center shrink-0", children: [
|
|
39678
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "w-7 h-7 rounded-full bg-interactive/10 border-2 border-interactive/30 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[10px] font-bold text-interactive", children: idx + 1 }) }),
|
|
39679
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "w-0.5 flex-1 min-h-[16px] bg-interactive/15" })
|
|
37919
39680
|
] }),
|
|
37920
|
-
/* @__PURE__ */ (0,
|
|
39681
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
37921
39682
|
"div",
|
|
37922
39683
|
{
|
|
37923
39684
|
className: cn(
|
|
@@ -37925,14 +39686,14 @@ var WorkflowVisualizer = ({
|
|
|
37925
39686
|
isExpanded ? "bg-[var(--foreground)]/[0.02] shadow-sm" : "hover:bg-[var(--foreground)]/[0.02] hover:shadow-sm hover:-translate-y-0.5"
|
|
37926
39687
|
),
|
|
37927
39688
|
children: [
|
|
37928
|
-
/* @__PURE__ */ (0,
|
|
39689
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
37929
39690
|
"button",
|
|
37930
39691
|
{
|
|
37931
39692
|
onClick: () => setExpandedStep(isExpanded ? null : step.id),
|
|
37932
39693
|
className: "w-full text-left px-3 py-2.5 flex items-center gap-2 whitespace-normal",
|
|
37933
39694
|
children: [
|
|
37934
|
-
/* @__PURE__ */ (0,
|
|
37935
|
-
/* @__PURE__ */ (0,
|
|
39695
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[13px] font-medium text-[var(--foreground)]", children: step.name }) }),
|
|
39696
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
37936
39697
|
"svg",
|
|
37937
39698
|
{
|
|
37938
39699
|
width: "12",
|
|
@@ -37945,28 +39706,28 @@ var WorkflowVisualizer = ({
|
|
|
37945
39706
|
"shrink-0 text-[var(--foreground)]/30 transition-transform",
|
|
37946
39707
|
isExpanded && "rotate-180"
|
|
37947
39708
|
),
|
|
37948
|
-
children: /* @__PURE__ */ (0,
|
|
39709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
|
37949
39710
|
}
|
|
37950
39711
|
)
|
|
37951
39712
|
]
|
|
37952
39713
|
}
|
|
37953
39714
|
),
|
|
37954
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
37955
|
-
step.description && /* @__PURE__ */ (0,
|
|
37956
|
-
step.sub_steps && step.sub_steps.length > 0 && /* @__PURE__ */ (0,
|
|
39715
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "px-3 pb-3 space-y-2.5", children: [
|
|
39716
|
+
step.description && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("p", { className: "text-xs text-[var(--foreground)]/50 leading-relaxed whitespace-normal", children: step.description }),
|
|
39717
|
+
step.sub_steps && step.sub_steps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "space-y-1", children: step.sub_steps.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
37957
39718
|
"div",
|
|
37958
39719
|
{
|
|
37959
39720
|
className: "flex items-start gap-2 text-xs",
|
|
37960
39721
|
children: [
|
|
37961
|
-
/* @__PURE__ */ (0,
|
|
37962
|
-
/* @__PURE__ */ (0,
|
|
39722
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "shrink-0 mt-0.5 w-1.5 h-1.5 rounded-full bg-interactive/40" }),
|
|
39723
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[var(--foreground)]/60", children: sub.action })
|
|
37963
39724
|
]
|
|
37964
39725
|
},
|
|
37965
39726
|
sub.id
|
|
37966
39727
|
)) }),
|
|
37967
|
-
step.tools && step.tools.length > 0 && /* @__PURE__ */ (0,
|
|
37968
|
-
/* @__PURE__ */ (0,
|
|
37969
|
-
step.tools.map((tool) => /* @__PURE__ */ (0,
|
|
39728
|
+
step.tools && step.tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
|
|
39729
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[10px] text-[var(--foreground)]/30 uppercase font-semibold tracking-wider", children: "Tools:" }),
|
|
39730
|
+
step.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
37970
39731
|
"span",
|
|
37971
39732
|
{
|
|
37972
39733
|
className: "text-[10px] font-mono px-1.5 py-0.5 rounded bg-interactive/[0.08] text-interactive/70 border border-interactive/10",
|
|
@@ -37975,9 +39736,9 @@ var WorkflowVisualizer = ({
|
|
|
37975
39736
|
tool
|
|
37976
39737
|
))
|
|
37977
39738
|
] }),
|
|
37978
|
-
step.on_failure && /* @__PURE__ */ (0,
|
|
37979
|
-
/* @__PURE__ */ (0,
|
|
37980
|
-
/* @__PURE__ */ (0,
|
|
39739
|
+
step.on_failure && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("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: [
|
|
39740
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "shrink-0 text-[10px] font-semibold text-[var(--redText,_#ef4444)]/70 uppercase tracking-wider mt-px", children: "On failure:" }),
|
|
39741
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[var(--foreground)]/50", children: step.on_failure })
|
|
37981
39742
|
] })
|
|
37982
39743
|
] })
|
|
37983
39744
|
]
|
|
@@ -37991,8 +39752,8 @@ var WorkflowVisualizer = ({
|
|
|
37991
39752
|
};
|
|
37992
39753
|
|
|
37993
39754
|
// src/molecules/workstream-builder/InstructionPreview/InstructionPreview.tsx
|
|
37994
|
-
var
|
|
37995
|
-
var
|
|
39755
|
+
var import_react75 = require("react");
|
|
39756
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
37996
39757
|
var FONT_STYLE5 = {
|
|
37997
39758
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37998
39759
|
};
|
|
@@ -38004,12 +39765,12 @@ var InstructionPreview = ({
|
|
|
38004
39765
|
tools,
|
|
38005
39766
|
className
|
|
38006
39767
|
}) => {
|
|
38007
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
38008
|
-
const [copied, setCopied] = (0,
|
|
39768
|
+
const [isExpanded, setIsExpanded] = (0, import_react75.useState)(false);
|
|
39769
|
+
const [copied, setCopied] = (0, import_react75.useState)(false);
|
|
38009
39770
|
const previewLength = 300;
|
|
38010
39771
|
const isLong = instruction.length > previewLength;
|
|
38011
39772
|
const displayText = isExpanded || !isLong ? instruction : instruction.slice(0, previewLength) + "...";
|
|
38012
|
-
const handleCopy = (0,
|
|
39773
|
+
const handleCopy = (0, import_react75.useCallback)(async () => {
|
|
38013
39774
|
try {
|
|
38014
39775
|
await navigator.clipboard.writeText(instruction);
|
|
38015
39776
|
setCopied(true);
|
|
@@ -38027,7 +39788,7 @@ var InstructionPreview = ({
|
|
|
38027
39788
|
setTimeout(() => setCopied(false), 2e3);
|
|
38028
39789
|
}
|
|
38029
39790
|
}, [instruction]);
|
|
38030
|
-
return /* @__PURE__ */ (0,
|
|
39791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
38031
39792
|
"div",
|
|
38032
39793
|
{
|
|
38033
39794
|
className: cn(
|
|
@@ -38036,8 +39797,8 @@ var InstructionPreview = ({
|
|
|
38036
39797
|
),
|
|
38037
39798
|
style: FONT_STYLE5,
|
|
38038
39799
|
children: [
|
|
38039
|
-
/* @__PURE__ */ (0,
|
|
38040
|
-
/* @__PURE__ */ (0,
|
|
39800
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03]", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
39801
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
38041
39802
|
"svg",
|
|
38042
39803
|
{
|
|
38043
39804
|
width: "14",
|
|
@@ -38050,24 +39811,24 @@ var InstructionPreview = ({
|
|
|
38050
39811
|
strokeLinecap: "round",
|
|
38051
39812
|
strokeLinejoin: "round",
|
|
38052
39813
|
children: [
|
|
38053
|
-
/* @__PURE__ */ (0,
|
|
38054
|
-
/* @__PURE__ */ (0,
|
|
38055
|
-
/* @__PURE__ */ (0,
|
|
38056
|
-
/* @__PURE__ */ (0,
|
|
38057
|
-
/* @__PURE__ */ (0,
|
|
39814
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
39815
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("polyline", { points: "14 2 14 8 20 8" }),
|
|
39816
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
39817
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
39818
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("polyline", { points: "10 9 9 9 8 9" })
|
|
38058
39819
|
]
|
|
38059
39820
|
}
|
|
38060
39821
|
) }),
|
|
38061
|
-
/* @__PURE__ */ (0,
|
|
38062
|
-
/* @__PURE__ */ (0,
|
|
38063
|
-
description && /* @__PURE__ */ (0,
|
|
39822
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39823
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: agent_name }),
|
|
39824
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-[11px] text-[var(--foreground)]/40 mt-0.5 whitespace-normal", children: description })
|
|
38064
39825
|
] })
|
|
38065
39826
|
] }) }),
|
|
38066
|
-
/* @__PURE__ */ (0,
|
|
38067
|
-
/* @__PURE__ */ (0,
|
|
38068
|
-
/* @__PURE__ */ (0,
|
|
38069
|
-
/* @__PURE__ */ (0,
|
|
38070
|
-
/* @__PURE__ */ (0,
|
|
39827
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "px-4 py-3 space-y-3", children: [
|
|
39828
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { children: [
|
|
39829
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex items-center justify-between mb-1.5", children: [
|
|
39830
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider", children: "Instruction" }),
|
|
39831
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
38071
39832
|
"button",
|
|
38072
39833
|
{
|
|
38073
39834
|
onClick: handleCopy,
|
|
@@ -38076,14 +39837,14 @@ var InstructionPreview = ({
|
|
|
38076
39837
|
}
|
|
38077
39838
|
)
|
|
38078
39839
|
] }),
|
|
38079
|
-
/* @__PURE__ */ (0,
|
|
38080
|
-
isLong && /* @__PURE__ */ (0,
|
|
39840
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("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 }),
|
|
39841
|
+
isLong && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
38081
39842
|
"button",
|
|
38082
39843
|
{
|
|
38083
39844
|
onClick: () => setIsExpanded(!isExpanded),
|
|
38084
39845
|
className: "inline-flex items-center gap-1 text-[11px] text-interactive hover:underline mt-1",
|
|
38085
39846
|
children: [
|
|
38086
|
-
/* @__PURE__ */ (0,
|
|
39847
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
38087
39848
|
"svg",
|
|
38088
39849
|
{
|
|
38089
39850
|
width: "12",
|
|
@@ -38093,7 +39854,7 @@ var InstructionPreview = ({
|
|
|
38093
39854
|
stroke: "currentColor",
|
|
38094
39855
|
strokeWidth: "2",
|
|
38095
39856
|
className: cn("transition-transform", isExpanded && "rotate-180"),
|
|
38096
|
-
children: /* @__PURE__ */ (0,
|
|
39857
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
|
38097
39858
|
}
|
|
38098
39859
|
),
|
|
38099
39860
|
isExpanded ? "Show less" : "Show full instruction"
|
|
@@ -38101,16 +39862,16 @@ var InstructionPreview = ({
|
|
|
38101
39862
|
}
|
|
38102
39863
|
)
|
|
38103
39864
|
] }),
|
|
38104
|
-
workflow_summary && workflow_summary.length > 0 && /* @__PURE__ */ (0,
|
|
38105
|
-
/* @__PURE__ */ (0,
|
|
38106
|
-
/* @__PURE__ */ (0,
|
|
38107
|
-
/* @__PURE__ */ (0,
|
|
38108
|
-
/* @__PURE__ */ (0,
|
|
39865
|
+
workflow_summary && workflow_summary.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { children: [
|
|
39866
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider mb-1.5", children: "Workflow" }),
|
|
39867
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "space-y-1", children: workflow_summary.map((step, idx) => /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex items-start gap-2 text-xs", children: [
|
|
39868
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("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 }),
|
|
39869
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "text-[var(--foreground)]/50 mt-0.5", children: step })
|
|
38109
39870
|
] }, idx)) })
|
|
38110
39871
|
] }),
|
|
38111
|
-
tools && tools.length > 0 && /* @__PURE__ */ (0,
|
|
38112
|
-
/* @__PURE__ */ (0,
|
|
38113
|
-
/* @__PURE__ */ (0,
|
|
39872
|
+
tools && tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { children: [
|
|
39873
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider mb-1.5", children: "Tools" }),
|
|
39874
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "flex flex-wrap gap-1.5", children: tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
38114
39875
|
"span",
|
|
38115
39876
|
{
|
|
38116
39877
|
className: "text-[10px] font-mono px-2 py-0.5 rounded bg-interactive/[0.08] text-interactive/70 border border-interactive/10",
|
|
@@ -38126,8 +39887,8 @@ var InstructionPreview = ({
|
|
|
38126
39887
|
};
|
|
38127
39888
|
|
|
38128
39889
|
// src/molecules/workstream-builder/UIComponentSelector/UIComponentSelector.tsx
|
|
38129
|
-
var
|
|
38130
|
-
var
|
|
39890
|
+
var import_react76 = require("react");
|
|
39891
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
38131
39892
|
var FONT_STYLE6 = {
|
|
38132
39893
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38133
39894
|
};
|
|
@@ -38138,11 +39899,11 @@ function UIComponentSelector({
|
|
|
38138
39899
|
className,
|
|
38139
39900
|
isLatestMessage = true
|
|
38140
39901
|
}) {
|
|
38141
|
-
const [selected, setSelected] = (0,
|
|
39902
|
+
const [selected, setSelected] = (0, import_react76.useState)(() => {
|
|
38142
39903
|
const recommended = components.filter((c) => c.recommended).map((c) => c.name);
|
|
38143
39904
|
return new Set(recommended);
|
|
38144
39905
|
});
|
|
38145
|
-
const [submitted, setSubmitted] = (0,
|
|
39906
|
+
const [submitted, setSubmitted] = (0, import_react76.useState)(false);
|
|
38146
39907
|
const grouped = components.reduce(
|
|
38147
39908
|
(acc, comp) => {
|
|
38148
39909
|
const cat = comp.category || "Other";
|
|
@@ -38166,7 +39927,7 @@ function UIComponentSelector({
|
|
|
38166
39927
|
onSelect?.(Array.from(selected));
|
|
38167
39928
|
};
|
|
38168
39929
|
const categoryOrder = Object.keys(grouped).sort();
|
|
38169
|
-
return /* @__PURE__ */ (0,
|
|
39930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
38170
39931
|
"div",
|
|
38171
39932
|
{
|
|
38172
39933
|
className: cn(
|
|
@@ -38175,8 +39936,8 @@ function UIComponentSelector({
|
|
|
38175
39936
|
),
|
|
38176
39937
|
style: FONT_STYLE6,
|
|
38177
39938
|
children: [
|
|
38178
|
-
/* @__PURE__ */ (0,
|
|
38179
|
-
/* @__PURE__ */ (0,
|
|
39939
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "px-4 py-3 border-b border-border/60 bg-muted/40", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
39940
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "w-5 h-5 rounded-md bg-interactive/15 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
38180
39941
|
"svg",
|
|
38181
39942
|
{
|
|
38182
39943
|
width: "12",
|
|
@@ -38187,21 +39948,21 @@ function UIComponentSelector({
|
|
|
38187
39948
|
strokeWidth: "2",
|
|
38188
39949
|
className: "text-interactive",
|
|
38189
39950
|
children: [
|
|
38190
|
-
/* @__PURE__ */ (0,
|
|
38191
|
-
/* @__PURE__ */ (0,
|
|
38192
|
-
/* @__PURE__ */ (0,
|
|
38193
|
-
/* @__PURE__ */ (0,
|
|
39951
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
39952
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
39953
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("rect", { x: "3", y: "14", width: "7", height: "7" }),
|
|
39954
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("rect", { x: "14", y: "14", width: "7", height: "7" })
|
|
38194
39955
|
]
|
|
38195
39956
|
}
|
|
38196
39957
|
) }),
|
|
38197
|
-
/* @__PURE__ */ (0,
|
|
38198
|
-
/* @__PURE__ */ (0,
|
|
38199
|
-
/* @__PURE__ */ (0,
|
|
39958
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { children: [
|
|
39959
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("h3", { className: "text-xs font-semibold text-foreground", children: "Select UI Components" }),
|
|
39960
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: "Choose which visual components this agent can use in its responses." })
|
|
38200
39961
|
] })
|
|
38201
39962
|
] }) }),
|
|
38202
|
-
/* @__PURE__ */ (0,
|
|
38203
|
-
/* @__PURE__ */ (0,
|
|
38204
|
-
/* @__PURE__ */ (0,
|
|
39963
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "px-4 py-3 space-y-4", children: categoryOrder.map((category) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { children: [
|
|
39964
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("h4", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-2", children: category }),
|
|
39965
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "space-y-1.5", children: grouped[category].map((comp) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
38205
39966
|
"label",
|
|
38206
39967
|
{
|
|
38207
39968
|
className: cn(
|
|
@@ -38211,7 +39972,7 @@ function UIComponentSelector({
|
|
|
38211
39972
|
selected.has(comp.name) && submitted && "bg-interactive/5"
|
|
38212
39973
|
),
|
|
38213
39974
|
children: [
|
|
38214
|
-
/* @__PURE__ */ (0,
|
|
39975
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38215
39976
|
"div",
|
|
38216
39977
|
{
|
|
38217
39978
|
className: cn(
|
|
@@ -38222,7 +39983,7 @@ function UIComponentSelector({
|
|
|
38222
39983
|
e.preventDefault();
|
|
38223
39984
|
toggle(comp.name);
|
|
38224
39985
|
},
|
|
38225
|
-
children: selected.has(comp.name) && /* @__PURE__ */ (0,
|
|
39986
|
+
children: selected.has(comp.name) && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38226
39987
|
"svg",
|
|
38227
39988
|
{
|
|
38228
39989
|
width: "10",
|
|
@@ -38231,12 +39992,12 @@ function UIComponentSelector({
|
|
|
38231
39992
|
fill: "none",
|
|
38232
39993
|
stroke: "white",
|
|
38233
39994
|
strokeWidth: "3",
|
|
38234
|
-
children: /* @__PURE__ */ (0,
|
|
39995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("polyline", { points: "20 6 9 17 4 12" })
|
|
38235
39996
|
}
|
|
38236
39997
|
)
|
|
38237
39998
|
}
|
|
38238
39999
|
),
|
|
38239
|
-
/* @__PURE__ */ (0,
|
|
40000
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38240
40001
|
"input",
|
|
38241
40002
|
{
|
|
38242
40003
|
type: "checkbox",
|
|
@@ -38246,11 +40007,11 @@ function UIComponentSelector({
|
|
|
38246
40007
|
className: "sr-only"
|
|
38247
40008
|
}
|
|
38248
40009
|
),
|
|
38249
|
-
/* @__PURE__ */ (0,
|
|
38250
|
-
/* @__PURE__ */ (0,
|
|
38251
|
-
/* @__PURE__ */ (0,
|
|
38252
|
-
comp.recommended && /* @__PURE__ */ (0,
|
|
38253
|
-
onPreview && /* @__PURE__ */ (0,
|
|
40010
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
40011
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
40012
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { className: "text-sm font-medium text-foreground", children: comp.display_name }),
|
|
40013
|
+
comp.recommended && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("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" }),
|
|
40014
|
+
onPreview && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38254
40015
|
"button",
|
|
38255
40016
|
{
|
|
38256
40017
|
type: "button",
|
|
@@ -38261,7 +40022,7 @@ function UIComponentSelector({
|
|
|
38261
40022
|
},
|
|
38262
40023
|
className: "shrink-0 p-0.5 rounded hover:bg-muted transition-colors",
|
|
38263
40024
|
title: `Preview ${comp.display_name}`,
|
|
38264
|
-
children: /* @__PURE__ */ (0,
|
|
40025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
38265
40026
|
"svg",
|
|
38266
40027
|
{
|
|
38267
40028
|
width: "14",
|
|
@@ -38274,28 +40035,28 @@ function UIComponentSelector({
|
|
|
38274
40035
|
strokeLinejoin: "round",
|
|
38275
40036
|
className: "text-muted-foreground hover:text-interactive",
|
|
38276
40037
|
children: [
|
|
38277
|
-
/* @__PURE__ */ (0,
|
|
38278
|
-
/* @__PURE__ */ (0,
|
|
38279
|
-
/* @__PURE__ */ (0,
|
|
40038
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
40039
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
40040
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
38280
40041
|
]
|
|
38281
40042
|
}
|
|
38282
40043
|
)
|
|
38283
40044
|
}
|
|
38284
40045
|
)
|
|
38285
40046
|
] }),
|
|
38286
|
-
/* @__PURE__ */ (0,
|
|
40047
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { className: "ml-0 text-xs text-muted-foreground", children: comp.description })
|
|
38287
40048
|
] })
|
|
38288
40049
|
]
|
|
38289
40050
|
},
|
|
38290
40051
|
comp.name
|
|
38291
40052
|
)) })
|
|
38292
40053
|
] }, category)) }),
|
|
38293
|
-
!submitted && isLatestMessage && /* @__PURE__ */ (0,
|
|
38294
|
-
/* @__PURE__ */ (0,
|
|
40054
|
+
!submitted && isLatestMessage && /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "px-4 py-3 border-t border-border/60 flex items-center justify-between bg-muted/30", children: [
|
|
40055
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
38295
40056
|
selected.size,
|
|
38296
40057
|
" selected"
|
|
38297
40058
|
] }),
|
|
38298
|
-
/* @__PURE__ */ (0,
|
|
40059
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38299
40060
|
"button",
|
|
38300
40061
|
{
|
|
38301
40062
|
onClick: handleContinue,
|
|
@@ -38304,14 +40065,14 @@ function UIComponentSelector({
|
|
|
38304
40065
|
}
|
|
38305
40066
|
)
|
|
38306
40067
|
] }),
|
|
38307
|
-
submitted && /* @__PURE__ */ (0,
|
|
40068
|
+
submitted && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "px-4 pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5", children: "Selections confirmed" }) })
|
|
38308
40069
|
]
|
|
38309
40070
|
}
|
|
38310
40071
|
);
|
|
38311
40072
|
}
|
|
38312
40073
|
|
|
38313
40074
|
// src/molecules/workstream-builder/MultiAgentCard/MultiAgentCard.tsx
|
|
38314
|
-
var
|
|
40075
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
38315
40076
|
var FONT_STYLE7 = {
|
|
38316
40077
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38317
40078
|
};
|
|
@@ -38324,7 +40085,7 @@ var MultiAgentCard = ({
|
|
|
38324
40085
|
className
|
|
38325
40086
|
}) => {
|
|
38326
40087
|
const avatarUrl = `https://api.dicebear.com/7.x/avataaars/svg?seed=${name}`;
|
|
38327
|
-
return /* @__PURE__ */ (0,
|
|
40088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
38328
40089
|
"div",
|
|
38329
40090
|
{
|
|
38330
40091
|
className: cn(
|
|
@@ -38333,14 +40094,14 @@ var MultiAgentCard = ({
|
|
|
38333
40094
|
),
|
|
38334
40095
|
style: FONT_STYLE7,
|
|
38335
40096
|
children: [
|
|
38336
|
-
/* @__PURE__ */ (0,
|
|
38337
|
-
/* @__PURE__ */ (0,
|
|
38338
|
-
/* @__PURE__ */ (0,
|
|
38339
|
-
/* @__PURE__ */ (0,
|
|
38340
|
-
/* @__PURE__ */ (0,
|
|
38341
|
-
/* @__PURE__ */ (0,
|
|
38342
|
-
/* @__PURE__ */ (0,
|
|
38343
|
-
/* @__PURE__ */ (0,
|
|
40097
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-start gap-4 px-5 py-4 bg-gradient-to-r from-[var(--foreground)]/[0.02] to-transparent", children: [
|
|
40098
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("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__ */ (0, import_jsx_runtime140.jsx)("img", { src: avatarUrl, alt: display_name, className: "h-full w-full" }) }),
|
|
40099
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
40100
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40101
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)] truncate", children: display_name }),
|
|
40102
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "text-[11px] font-mono text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.05] px-1.5 py-0.5 rounded", children: name }),
|
|
40103
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "text-[10px] px-2 py-0.5 rounded-full font-medium bg-interactive/10 text-interactive", children: "Multi-Agent" }),
|
|
40104
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
38344
40105
|
"span",
|
|
38345
40106
|
{
|
|
38346
40107
|
className: cn(
|
|
@@ -38348,7 +40109,7 @@ var MultiAgentCard = ({
|
|
|
38348
40109
|
enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
38349
40110
|
),
|
|
38350
40111
|
children: [
|
|
38351
|
-
/* @__PURE__ */ (0,
|
|
40112
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: cn(
|
|
38352
40113
|
"w-1.5 h-1.5 rounded-full",
|
|
38353
40114
|
enabled ? "bg-emerald-500" : "bg-red-500"
|
|
38354
40115
|
) }),
|
|
@@ -38357,18 +40118,18 @@ var MultiAgentCard = ({
|
|
|
38357
40118
|
}
|
|
38358
40119
|
)
|
|
38359
40120
|
] }),
|
|
38360
|
-
/* @__PURE__ */ (0,
|
|
40121
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "text-xs text-[var(--foreground)]/60 leading-relaxed mt-1 whitespace-normal", style: { textWrap: "auto" }, children: description })
|
|
38361
40122
|
] })
|
|
38362
40123
|
] }),
|
|
38363
|
-
stages.length > 0 && /* @__PURE__ */ (0,
|
|
38364
|
-
/* @__PURE__ */ (0,
|
|
40124
|
+
stages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "border-t border-[var(--border-color)] px-5 py-4", children: [
|
|
40125
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("p", { className: "text-[11px] font-semibold text-[var(--foreground)]/40 uppercase tracking-wide mb-3", children: [
|
|
38365
40126
|
"Stages (",
|
|
38366
40127
|
stages.length,
|
|
38367
40128
|
")"
|
|
38368
40129
|
] }),
|
|
38369
|
-
/* @__PURE__ */ (0,
|
|
38370
|
-
/* @__PURE__ */ (0,
|
|
38371
|
-
/* @__PURE__ */ (0,
|
|
40130
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "flex flex-col gap-0", children: stages.map((stage, idx) => /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-stretch", children: [
|
|
40131
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex flex-col items-center mr-3 w-5", children: [
|
|
40132
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
38372
40133
|
"div",
|
|
38373
40134
|
{
|
|
38374
40135
|
className: cn(
|
|
@@ -38378,20 +40139,20 @@ var MultiAgentCard = ({
|
|
|
38378
40139
|
children: idx + 1
|
|
38379
40140
|
}
|
|
38380
40141
|
),
|
|
38381
|
-
idx < stages.length - 1 && /* @__PURE__ */ (0,
|
|
40142
|
+
idx < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "w-px flex-1 min-h-[16px] border-l border-dashed border-interactive/30" })
|
|
38382
40143
|
] }),
|
|
38383
|
-
/* @__PURE__ */ (0,
|
|
38384
|
-
/* @__PURE__ */ (0,
|
|
38385
|
-
/* @__PURE__ */ (0,
|
|
38386
|
-
/* @__PURE__ */ (0,
|
|
40144
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex-1 mb-2 p-3 rounded-lg border border-[var(--border-color)] bg-[var(--foreground)]/[0.02]", children: [
|
|
40145
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40146
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "text-xs font-semibold text-[var(--foreground)]", children: stage.name }),
|
|
40147
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("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 })
|
|
38387
40148
|
] }),
|
|
38388
|
-
/* @__PURE__ */ (0,
|
|
38389
|
-
stage.tools && stage.tools.length > 0 && /* @__PURE__ */ (0,
|
|
40149
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-center gap-3 mt-1.5 text-[10px] text-[var(--foreground)]/50", children: [
|
|
40150
|
+
stage.tools && stage.tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("span", { children: [
|
|
38390
40151
|
stage.tools.length,
|
|
38391
40152
|
" tool",
|
|
38392
40153
|
stage.tools.length !== 1 ? "s" : ""
|
|
38393
40154
|
] }),
|
|
38394
|
-
stage.ui_components && stage.ui_components.length > 0 && /* @__PURE__ */ (0,
|
|
40155
|
+
stage.ui_components && stage.ui_components.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("span", { children: [
|
|
38395
40156
|
stage.ui_components.length,
|
|
38396
40157
|
" component",
|
|
38397
40158
|
stage.ui_components.length !== 1 ? "s" : ""
|
|
@@ -38406,7 +40167,7 @@ var MultiAgentCard = ({
|
|
|
38406
40167
|
};
|
|
38407
40168
|
|
|
38408
40169
|
// src/molecules/workstream-builder/MultiAgentPlan/MultiAgentPlan.tsx
|
|
38409
|
-
var
|
|
40170
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
38410
40171
|
var FONT_STYLE8 = {
|
|
38411
40172
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38412
40173
|
};
|
|
@@ -38414,7 +40175,7 @@ var MultiAgentPlan = ({
|
|
|
38414
40175
|
stages = [],
|
|
38415
40176
|
className
|
|
38416
40177
|
}) => {
|
|
38417
|
-
return /* @__PURE__ */ (0,
|
|
40178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
38418
40179
|
"div",
|
|
38419
40180
|
{
|
|
38420
40181
|
className: cn(
|
|
@@ -38423,8 +40184,8 @@ var MultiAgentPlan = ({
|
|
|
38423
40184
|
),
|
|
38424
40185
|
style: FONT_STYLE8,
|
|
38425
40186
|
children: [
|
|
38426
|
-
/* @__PURE__ */ (0,
|
|
38427
|
-
/* @__PURE__ */ (0,
|
|
40187
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("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__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40188
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "w-4 h-4 rounded bg-violet-500/20 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
38428
40189
|
"svg",
|
|
38429
40190
|
{
|
|
38430
40191
|
width: "10",
|
|
@@ -38434,20 +40195,20 @@ var MultiAgentPlan = ({
|
|
|
38434
40195
|
stroke: "currentColor",
|
|
38435
40196
|
strokeWidth: "2",
|
|
38436
40197
|
className: "text-violet-600",
|
|
38437
|
-
children: /* @__PURE__ */ (0,
|
|
40198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("path", { d: "M16 3h5v5M4 20L21 3M21 16v5h-5M15 15l6 6M4 4l5 5" })
|
|
38438
40199
|
}
|
|
38439
40200
|
) }),
|
|
38440
|
-
/* @__PURE__ */ (0,
|
|
38441
|
-
/* @__PURE__ */ (0,
|
|
40201
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("span", { className: "text-xs font-semibold text-[var(--foreground)]", children: "Proposed Multi-Agent Workflow" }),
|
|
40202
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-600 font-medium", children: "Draft" })
|
|
38442
40203
|
] }) }),
|
|
38443
|
-
/* @__PURE__ */ (0,
|
|
38444
|
-
/* @__PURE__ */ (0,
|
|
38445
|
-
/* @__PURE__ */ (0,
|
|
38446
|
-
idx < stages.length - 1 && /* @__PURE__ */ (0,
|
|
40204
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "flex flex-col gap-0", children: stages.map((stage, idx) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "flex items-stretch min-w-0", children: [
|
|
40205
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "flex flex-col items-center mr-3 w-6", children: [
|
|
40206
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("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 }),
|
|
40207
|
+
idx < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "w-px flex-1 min-h-[12px] border-l border-dashed border-interactive/30" })
|
|
38447
40208
|
] }),
|
|
38448
|
-
/* @__PURE__ */ (0,
|
|
38449
|
-
/* @__PURE__ */ (0,
|
|
38450
|
-
stage.description && /* @__PURE__ */ (0,
|
|
40209
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "flex-1 mb-2 pb-2 min-w-0", children: [
|
|
40210
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("p", { className: "text-xs font-semibold text-foreground", children: stage.name }),
|
|
40211
|
+
stage.description && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
38451
40212
|
"p",
|
|
38452
40213
|
{
|
|
38453
40214
|
className: "text-[11px] text-foreground/50 mt-0.5 whitespace-normal",
|
|
@@ -38455,7 +40216,7 @@ var MultiAgentPlan = ({
|
|
|
38455
40216
|
children: stage.description
|
|
38456
40217
|
}
|
|
38457
40218
|
),
|
|
38458
|
-
stage.proposed_tools && stage.proposed_tools.length > 0 && /* @__PURE__ */ (0,
|
|
40219
|
+
stage.proposed_tools && stage.proposed_tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "flex flex-wrap gap-1 mt-1.5", children: stage.proposed_tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
38459
40220
|
"span",
|
|
38460
40221
|
{
|
|
38461
40222
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-interactive/10 text-interactive font-mono",
|
|
@@ -38471,8 +40232,8 @@ var MultiAgentPlan = ({
|
|
|
38471
40232
|
};
|
|
38472
40233
|
|
|
38473
40234
|
// src/molecules/workstream-builder/MultiAgentUISelector/MultiAgentUISelector.tsx
|
|
38474
|
-
var
|
|
38475
|
-
var
|
|
40235
|
+
var import_react77 = require("react");
|
|
40236
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
38476
40237
|
var FONT_STYLE9 = {
|
|
38477
40238
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38478
40239
|
};
|
|
@@ -38484,8 +40245,8 @@ var MultiAgentUISelector = ({
|
|
|
38484
40245
|
className,
|
|
38485
40246
|
isLatestMessage = true
|
|
38486
40247
|
}) => {
|
|
38487
|
-
const [activeStageId, setActiveStageId] = (0,
|
|
38488
|
-
const [selections, setSelections] = (0,
|
|
40248
|
+
const [activeStageId, setActiveStageId] = (0, import_react77.useState)(stages[0]?.id || "");
|
|
40249
|
+
const [selections, setSelections] = (0, import_react77.useState)(
|
|
38489
40250
|
() => {
|
|
38490
40251
|
const init = {};
|
|
38491
40252
|
const recommendedNames = components.filter((c) => c.recommended).map((c) => c.name);
|
|
@@ -38496,14 +40257,14 @@ var MultiAgentUISelector = ({
|
|
|
38496
40257
|
return init;
|
|
38497
40258
|
}
|
|
38498
40259
|
);
|
|
38499
|
-
const [submitted, setSubmitted] = (0,
|
|
40260
|
+
const [submitted, setSubmitted] = (0, import_react77.useState)(false);
|
|
38500
40261
|
const grouped = components.reduce((acc, comp) => {
|
|
38501
40262
|
const cat = comp.category || "Other";
|
|
38502
40263
|
if (!acc[cat]) acc[cat] = [];
|
|
38503
40264
|
acc[cat].push(comp);
|
|
38504
40265
|
return acc;
|
|
38505
40266
|
}, {});
|
|
38506
|
-
const toggleComponent = (0,
|
|
40267
|
+
const toggleComponent = (0, import_react77.useCallback)(
|
|
38507
40268
|
(stageId, compName) => {
|
|
38508
40269
|
if (submitted || !isLatestMessage) return;
|
|
38509
40270
|
setSelections((prev) => {
|
|
@@ -38520,7 +40281,7 @@ var MultiAgentUISelector = ({
|
|
|
38520
40281
|
},
|
|
38521
40282
|
[submitted]
|
|
38522
40283
|
);
|
|
38523
|
-
const selectAll = (0,
|
|
40284
|
+
const selectAll = (0, import_react77.useCallback)(
|
|
38524
40285
|
(stageId) => {
|
|
38525
40286
|
if (submitted || !isLatestMessage) return;
|
|
38526
40287
|
setSelections((prev) => {
|
|
@@ -38531,7 +40292,7 @@ var MultiAgentUISelector = ({
|
|
|
38531
40292
|
},
|
|
38532
40293
|
[submitted, isLatestMessage, components]
|
|
38533
40294
|
);
|
|
38534
|
-
const clearAll = (0,
|
|
40295
|
+
const clearAll = (0, import_react77.useCallback)(
|
|
38535
40296
|
(stageId) => {
|
|
38536
40297
|
if (submitted || !isLatestMessage) return;
|
|
38537
40298
|
setSelections((prev) => {
|
|
@@ -38542,7 +40303,7 @@ var MultiAgentUISelector = ({
|
|
|
38542
40303
|
},
|
|
38543
40304
|
[submitted, isLatestMessage]
|
|
38544
40305
|
);
|
|
38545
|
-
const handleContinue = (0,
|
|
40306
|
+
const handleContinue = (0, import_react77.useCallback)(() => {
|
|
38546
40307
|
setSubmitted(true);
|
|
38547
40308
|
if (onSelect) {
|
|
38548
40309
|
const result = {};
|
|
@@ -38553,7 +40314,7 @@ var MultiAgentUISelector = ({
|
|
|
38553
40314
|
}
|
|
38554
40315
|
}, [onSelect, selections]);
|
|
38555
40316
|
const activeStage = stages.find((s) => s.id === activeStageId);
|
|
38556
|
-
return /* @__PURE__ */ (0,
|
|
40317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
38557
40318
|
"div",
|
|
38558
40319
|
{
|
|
38559
40320
|
className: cn(
|
|
@@ -38562,8 +40323,8 @@ var MultiAgentUISelector = ({
|
|
|
38562
40323
|
),
|
|
38563
40324
|
style: FONT_STYLE9,
|
|
38564
40325
|
children: [
|
|
38565
|
-
/* @__PURE__ */ (0,
|
|
38566
|
-
/* @__PURE__ */ (0,
|
|
40326
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "px-4 py-3 border-b border-border/60 bg-muted/40", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40327
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "w-5 h-5 rounded-md bg-interactive/15 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
38567
40328
|
"svg",
|
|
38568
40329
|
{
|
|
38569
40330
|
width: "12",
|
|
@@ -38574,16 +40335,16 @@ var MultiAgentUISelector = ({
|
|
|
38574
40335
|
strokeWidth: "2",
|
|
38575
40336
|
className: "text-interactive",
|
|
38576
40337
|
children: [
|
|
38577
|
-
/* @__PURE__ */ (0,
|
|
38578
|
-
/* @__PURE__ */ (0,
|
|
38579
|
-
/* @__PURE__ */ (0,
|
|
38580
|
-
/* @__PURE__ */ (0,
|
|
40338
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
40339
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
40340
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("rect", { x: "3", y: "14", width: "7", height: "7" }),
|
|
40341
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("rect", { x: "14", y: "14", width: "7", height: "7" })
|
|
38581
40342
|
]
|
|
38582
40343
|
}
|
|
38583
40344
|
) }),
|
|
38584
|
-
/* @__PURE__ */ (0,
|
|
40345
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "text-xs font-semibold text-foreground", children: "UI Components per Stage" })
|
|
38585
40346
|
] }) }),
|
|
38586
|
-
/* @__PURE__ */ (0,
|
|
40347
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "flex gap-1 border-b border-border/60 px-4 py-2 bg-muted/20", children: stages.map((stage) => /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38587
40348
|
"button",
|
|
38588
40349
|
{
|
|
38589
40350
|
onClick: () => setActiveStageId(stage.id),
|
|
@@ -38595,17 +40356,17 @@ var MultiAgentUISelector = ({
|
|
|
38595
40356
|
},
|
|
38596
40357
|
stage.id
|
|
38597
40358
|
)) }),
|
|
38598
|
-
/* @__PURE__ */ (0,
|
|
38599
|
-
activeStage && /* @__PURE__ */ (0,
|
|
38600
|
-
/* @__PURE__ */ (0,
|
|
40359
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "px-4 py-3", children: [
|
|
40360
|
+
activeStage && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
40361
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("p", { className: "text-[10px] text-muted-foreground", children: [
|
|
38601
40362
|
"Select components for ",
|
|
38602
|
-
/* @__PURE__ */ (0,
|
|
40363
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("strong", { className: "text-foreground", children: activeStage.name }),
|
|
38603
40364
|
" (",
|
|
38604
40365
|
activeStage.agent_name,
|
|
38605
40366
|
")"
|
|
38606
40367
|
] }),
|
|
38607
|
-
!submitted && isLatestMessage && /* @__PURE__ */ (0,
|
|
38608
|
-
/* @__PURE__ */ (0,
|
|
40368
|
+
!submitted && isLatestMessage && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40369
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38609
40370
|
"button",
|
|
38610
40371
|
{
|
|
38611
40372
|
onClick: () => selectAll(activeStageId),
|
|
@@ -38613,8 +40374,8 @@ var MultiAgentUISelector = ({
|
|
|
38613
40374
|
children: "Select All"
|
|
38614
40375
|
}
|
|
38615
40376
|
),
|
|
38616
|
-
/* @__PURE__ */ (0,
|
|
38617
|
-
/* @__PURE__ */ (0,
|
|
40377
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "text-muted-foreground/40", children: "|" }),
|
|
40378
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38618
40379
|
"button",
|
|
38619
40380
|
{
|
|
38620
40381
|
onClick: () => clearAll(activeStageId),
|
|
@@ -38624,11 +40385,11 @@ var MultiAgentUISelector = ({
|
|
|
38624
40385
|
)
|
|
38625
40386
|
] })
|
|
38626
40387
|
] }),
|
|
38627
|
-
Object.entries(grouped).map(([category, comps]) => /* @__PURE__ */ (0,
|
|
38628
|
-
/* @__PURE__ */ (0,
|
|
38629
|
-
/* @__PURE__ */ (0,
|
|
40388
|
+
Object.entries(grouped).map(([category, comps]) => /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "mb-3", children: [
|
|
40389
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5", children: category }),
|
|
40390
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "grid grid-cols-2 gap-1.5", children: comps.map((comp) => {
|
|
38630
40391
|
const isSelected = selections[activeStageId]?.has(comp.name) || false;
|
|
38631
|
-
return /* @__PURE__ */ (0,
|
|
40392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
38632
40393
|
"div",
|
|
38633
40394
|
{
|
|
38634
40395
|
role: "button",
|
|
@@ -38646,15 +40407,15 @@ var MultiAgentUISelector = ({
|
|
|
38646
40407
|
(submitted || !isLatestMessage) && "opacity-60 cursor-default"
|
|
38647
40408
|
),
|
|
38648
40409
|
children: [
|
|
38649
|
-
/* @__PURE__ */ (0,
|
|
38650
|
-
/* @__PURE__ */ (0,
|
|
40410
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
40411
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38651
40412
|
"div",
|
|
38652
40413
|
{
|
|
38653
40414
|
className: cn(
|
|
38654
40415
|
"w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0",
|
|
38655
40416
|
isSelected ? "bg-interactive border-interactive" : "border-muted-foreground/30"
|
|
38656
40417
|
),
|
|
38657
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
40418
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38658
40419
|
"svg",
|
|
38659
40420
|
{
|
|
38660
40421
|
width: "8",
|
|
@@ -38663,14 +40424,14 @@ var MultiAgentUISelector = ({
|
|
|
38663
40424
|
fill: "none",
|
|
38664
40425
|
stroke: "white",
|
|
38665
40426
|
strokeWidth: "3",
|
|
38666
|
-
children: /* @__PURE__ */ (0,
|
|
40427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("polyline", { points: "20 6 9 17 4 12" })
|
|
38667
40428
|
}
|
|
38668
40429
|
)
|
|
38669
40430
|
}
|
|
38670
40431
|
),
|
|
38671
|
-
/* @__PURE__ */ (0,
|
|
38672
|
-
comp.recommended && /* @__PURE__ */ (0,
|
|
38673
|
-
onPreview && /* @__PURE__ */ (0,
|
|
40432
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "font-medium text-foreground", children: comp.display_name }),
|
|
40433
|
+
comp.recommended && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("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" }),
|
|
40434
|
+
onPreview && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38674
40435
|
"button",
|
|
38675
40436
|
{
|
|
38676
40437
|
type: "button",
|
|
@@ -38680,7 +40441,7 @@ var MultiAgentUISelector = ({
|
|
|
38680
40441
|
},
|
|
38681
40442
|
className: "ml-auto shrink-0 p-0.5 rounded hover:bg-muted transition-colors",
|
|
38682
40443
|
title: `Preview ${comp.display_name}`,
|
|
38683
|
-
children: /* @__PURE__ */ (0,
|
|
40444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
38684
40445
|
"svg",
|
|
38685
40446
|
{
|
|
38686
40447
|
width: "14",
|
|
@@ -38693,16 +40454,16 @@ var MultiAgentUISelector = ({
|
|
|
38693
40454
|
strokeLinejoin: "round",
|
|
38694
40455
|
className: "text-muted-foreground hover:text-primary",
|
|
38695
40456
|
children: [
|
|
38696
|
-
/* @__PURE__ */ (0,
|
|
38697
|
-
/* @__PURE__ */ (0,
|
|
38698
|
-
/* @__PURE__ */ (0,
|
|
40457
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
40458
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
40459
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
38699
40460
|
]
|
|
38700
40461
|
}
|
|
38701
40462
|
)
|
|
38702
40463
|
}
|
|
38703
40464
|
)
|
|
38704
40465
|
] }),
|
|
38705
|
-
/* @__PURE__ */ (0,
|
|
40466
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "text-[10px] text-muted-foreground mt-0.5 ml-5 whitespace-normal", children: comp.description })
|
|
38706
40467
|
]
|
|
38707
40468
|
},
|
|
38708
40469
|
comp.name
|
|
@@ -38710,7 +40471,7 @@ var MultiAgentUISelector = ({
|
|
|
38710
40471
|
}) })
|
|
38711
40472
|
] }, category))
|
|
38712
40473
|
] }),
|
|
38713
|
-
!submitted && isLatestMessage && /* @__PURE__ */ (0,
|
|
40474
|
+
!submitted && isLatestMessage && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "px-4 py-3 border-t border-border/60 bg-muted/30", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38714
40475
|
"button",
|
|
38715
40476
|
{
|
|
38716
40477
|
onClick: handleContinue,
|
|
@@ -38718,14 +40479,14 @@ var MultiAgentUISelector = ({
|
|
|
38718
40479
|
children: "Continue"
|
|
38719
40480
|
}
|
|
38720
40481
|
) }),
|
|
38721
|
-
submitted && /* @__PURE__ */ (0,
|
|
40482
|
+
submitted && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "px-4 pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5", children: "Selections confirmed" }) })
|
|
38722
40483
|
]
|
|
38723
40484
|
}
|
|
38724
40485
|
);
|
|
38725
40486
|
};
|
|
38726
40487
|
|
|
38727
40488
|
// src/molecules/workstream-builder/StageIndicator/StageIndicator.tsx
|
|
38728
|
-
var
|
|
40489
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
38729
40490
|
var FONT_STYLE10 = {
|
|
38730
40491
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38731
40492
|
};
|
|
@@ -38734,7 +40495,7 @@ var StageIndicator = ({
|
|
|
38734
40495
|
agent_name,
|
|
38735
40496
|
className
|
|
38736
40497
|
}) => {
|
|
38737
|
-
return /* @__PURE__ */ (0,
|
|
40498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
38738
40499
|
"div",
|
|
38739
40500
|
{
|
|
38740
40501
|
className: cn(
|
|
@@ -38743,12 +40504,12 @@ var StageIndicator = ({
|
|
|
38743
40504
|
),
|
|
38744
40505
|
style: { ...FONT_STYLE10, animation: "fadeIn 0.3s ease-out" },
|
|
38745
40506
|
children: [
|
|
38746
|
-
/* @__PURE__ */ (0,
|
|
38747
|
-
/* @__PURE__ */ (0,
|
|
38748
|
-
/* @__PURE__ */ (0,
|
|
38749
|
-
/* @__PURE__ */ (0,
|
|
40507
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "flex-1 h-px bg-[var(--border-color)]" }),
|
|
40508
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "flex items-center gap-1.5 px-3 py-1 rounded-full bg-violet-500/10 border border-violet-500/20", children: [
|
|
40509
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "w-1.5 h-1.5 rounded-full bg-violet-500 animate-pulse" }),
|
|
40510
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: "text-[10px] font-medium text-violet-600", children: stage_name || agent_name })
|
|
38750
40511
|
] }),
|
|
38751
|
-
/* @__PURE__ */ (0,
|
|
40512
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "flex-1 h-px bg-[var(--border-color)]" })
|
|
38752
40513
|
]
|
|
38753
40514
|
}
|
|
38754
40515
|
);
|
|
@@ -39046,7 +40807,7 @@ __export(ui_exports, {
|
|
|
39046
40807
|
// src/components/ui/button-group.tsx
|
|
39047
40808
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
39048
40809
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
39049
|
-
var
|
|
40810
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
39050
40811
|
var buttonGroupVariants = (0, import_class_variance_authority8.cva)(
|
|
39051
40812
|
"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",
|
|
39052
40813
|
{
|
|
@@ -39066,7 +40827,7 @@ function ButtonGroup({
|
|
|
39066
40827
|
orientation,
|
|
39067
40828
|
...props
|
|
39068
40829
|
}) {
|
|
39069
|
-
return /* @__PURE__ */ (0,
|
|
40830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
39070
40831
|
"div",
|
|
39071
40832
|
{
|
|
39072
40833
|
role: "group",
|
|
@@ -39083,7 +40844,7 @@ function ButtonGroupText({
|
|
|
39083
40844
|
...props
|
|
39084
40845
|
}) {
|
|
39085
40846
|
const Comp = asChild ? import_react_slot4.Slot : "div";
|
|
39086
|
-
return /* @__PURE__ */ (0,
|
|
40847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
39087
40848
|
Comp,
|
|
39088
40849
|
{
|
|
39089
40850
|
className: cn(
|
|
@@ -39099,7 +40860,7 @@ function ButtonGroupSeparator({
|
|
|
39099
40860
|
orientation = "vertical",
|
|
39100
40861
|
...props
|
|
39101
40862
|
}) {
|
|
39102
|
-
return /* @__PURE__ */ (0,
|
|
40863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
39103
40864
|
Separator2,
|
|
39104
40865
|
{
|
|
39105
40866
|
"data-slot": "button-group-separator",
|
|
@@ -39115,9 +40876,9 @@ function ButtonGroupSeparator({
|
|
|
39115
40876
|
|
|
39116
40877
|
// src/components/ui/empty.tsx
|
|
39117
40878
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
39118
|
-
var
|
|
40879
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
39119
40880
|
function Empty({ className, ...props }) {
|
|
39120
|
-
return /* @__PURE__ */ (0,
|
|
40881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39121
40882
|
"div",
|
|
39122
40883
|
{
|
|
39123
40884
|
"data-slot": "empty",
|
|
@@ -39130,7 +40891,7 @@ function Empty({ className, ...props }) {
|
|
|
39130
40891
|
);
|
|
39131
40892
|
}
|
|
39132
40893
|
function EmptyHeader({ className, ...props }) {
|
|
39133
|
-
return /* @__PURE__ */ (0,
|
|
40894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39134
40895
|
"div",
|
|
39135
40896
|
{
|
|
39136
40897
|
"data-slot": "empty-header",
|
|
@@ -39161,7 +40922,7 @@ function EmptyMedia({
|
|
|
39161
40922
|
variant = "default",
|
|
39162
40923
|
...props
|
|
39163
40924
|
}) {
|
|
39164
|
-
return /* @__PURE__ */ (0,
|
|
40925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39165
40926
|
"div",
|
|
39166
40927
|
{
|
|
39167
40928
|
"data-slot": "empty-icon",
|
|
@@ -39172,7 +40933,7 @@ function EmptyMedia({
|
|
|
39172
40933
|
);
|
|
39173
40934
|
}
|
|
39174
40935
|
function EmptyTitle({ className, ...props }) {
|
|
39175
|
-
return /* @__PURE__ */ (0,
|
|
40936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39176
40937
|
"div",
|
|
39177
40938
|
{
|
|
39178
40939
|
"data-slot": "empty-title",
|
|
@@ -39182,7 +40943,7 @@ function EmptyTitle({ className, ...props }) {
|
|
|
39182
40943
|
);
|
|
39183
40944
|
}
|
|
39184
40945
|
function EmptyDescription({ className, ...props }) {
|
|
39185
|
-
return /* @__PURE__ */ (0,
|
|
40946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39186
40947
|
"div",
|
|
39187
40948
|
{
|
|
39188
40949
|
"data-slot": "empty-description",
|
|
@@ -39195,7 +40956,7 @@ function EmptyDescription({ className, ...props }) {
|
|
|
39195
40956
|
);
|
|
39196
40957
|
}
|
|
39197
40958
|
function EmptyContent({ className, ...props }) {
|
|
39198
|
-
return /* @__PURE__ */ (0,
|
|
40959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39199
40960
|
"div",
|
|
39200
40961
|
{
|
|
39201
40962
|
"data-slot": "empty-content",
|
|
@@ -39209,11 +40970,11 @@ function EmptyContent({ className, ...props }) {
|
|
|
39209
40970
|
}
|
|
39210
40971
|
|
|
39211
40972
|
// src/components/ui/field.tsx
|
|
39212
|
-
var
|
|
40973
|
+
var import_react78 = require("react");
|
|
39213
40974
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
39214
|
-
var
|
|
40975
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
39215
40976
|
function FieldSet({ className, ...props }) {
|
|
39216
|
-
return /* @__PURE__ */ (0,
|
|
40977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39217
40978
|
"fieldset",
|
|
39218
40979
|
{
|
|
39219
40980
|
"data-slot": "field-set",
|
|
@@ -39231,7 +40992,7 @@ function FieldLegend({
|
|
|
39231
40992
|
variant = "legend",
|
|
39232
40993
|
...props
|
|
39233
40994
|
}) {
|
|
39234
|
-
return /* @__PURE__ */ (0,
|
|
40995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39235
40996
|
"legend",
|
|
39236
40997
|
{
|
|
39237
40998
|
"data-slot": "field-legend",
|
|
@@ -39247,7 +41008,7 @@ function FieldLegend({
|
|
|
39247
41008
|
);
|
|
39248
41009
|
}
|
|
39249
41010
|
function FieldGroup({ className, ...props }) {
|
|
39250
|
-
return /* @__PURE__ */ (0,
|
|
41011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39251
41012
|
"div",
|
|
39252
41013
|
{
|
|
39253
41014
|
"data-slot": "field-group",
|
|
@@ -39287,7 +41048,7 @@ function Field({
|
|
|
39287
41048
|
orientation = "vertical",
|
|
39288
41049
|
...props
|
|
39289
41050
|
}) {
|
|
39290
|
-
return /* @__PURE__ */ (0,
|
|
41051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39291
41052
|
"div",
|
|
39292
41053
|
{
|
|
39293
41054
|
role: "group",
|
|
@@ -39299,7 +41060,7 @@ function Field({
|
|
|
39299
41060
|
);
|
|
39300
41061
|
}
|
|
39301
41062
|
function FieldContent({ className, ...props }) {
|
|
39302
|
-
return /* @__PURE__ */ (0,
|
|
41063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39303
41064
|
"div",
|
|
39304
41065
|
{
|
|
39305
41066
|
"data-slot": "field-content",
|
|
@@ -39315,7 +41076,7 @@ function FieldLabel({
|
|
|
39315
41076
|
className,
|
|
39316
41077
|
...props
|
|
39317
41078
|
}) {
|
|
39318
|
-
return /* @__PURE__ */ (0,
|
|
41079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39319
41080
|
Label,
|
|
39320
41081
|
{
|
|
39321
41082
|
"data-slot": "field-label",
|
|
@@ -39330,7 +41091,7 @@ function FieldLabel({
|
|
|
39330
41091
|
);
|
|
39331
41092
|
}
|
|
39332
41093
|
function FieldTitle({ className, ...props }) {
|
|
39333
|
-
return /* @__PURE__ */ (0,
|
|
41094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39334
41095
|
"div",
|
|
39335
41096
|
{
|
|
39336
41097
|
"data-slot": "field-label",
|
|
@@ -39343,7 +41104,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
39343
41104
|
);
|
|
39344
41105
|
}
|
|
39345
41106
|
function FieldDescription({ className, ...props }) {
|
|
39346
|
-
return /* @__PURE__ */ (0,
|
|
41107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39347
41108
|
"p",
|
|
39348
41109
|
{
|
|
39349
41110
|
"data-slot": "field-description",
|
|
@@ -39362,7 +41123,7 @@ function FieldSeparator({
|
|
|
39362
41123
|
className,
|
|
39363
41124
|
...props
|
|
39364
41125
|
}) {
|
|
39365
|
-
return /* @__PURE__ */ (0,
|
|
41126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
39366
41127
|
"div",
|
|
39367
41128
|
{
|
|
39368
41129
|
"data-slot": "field-separator",
|
|
@@ -39373,8 +41134,8 @@ function FieldSeparator({
|
|
|
39373
41134
|
),
|
|
39374
41135
|
...props,
|
|
39375
41136
|
children: [
|
|
39376
|
-
/* @__PURE__ */ (0,
|
|
39377
|
-
children && /* @__PURE__ */ (0,
|
|
41137
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
41138
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39378
41139
|
"span",
|
|
39379
41140
|
{
|
|
39380
41141
|
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
@@ -39392,7 +41153,7 @@ function FieldError({
|
|
|
39392
41153
|
errors,
|
|
39393
41154
|
...props
|
|
39394
41155
|
}) {
|
|
39395
|
-
const content = (0,
|
|
41156
|
+
const content = (0, import_react78.useMemo)(() => {
|
|
39396
41157
|
if (children) {
|
|
39397
41158
|
return children;
|
|
39398
41159
|
}
|
|
@@ -39402,14 +41163,14 @@ function FieldError({
|
|
|
39402
41163
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
39403
41164
|
return errors[0].message;
|
|
39404
41165
|
}
|
|
39405
|
-
return /* @__PURE__ */ (0,
|
|
39406
|
-
(error, index) => error?.message && /* @__PURE__ */ (0,
|
|
41166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
41167
|
+
(error, index) => error?.message && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("li", { children: error.message }, index)
|
|
39407
41168
|
) });
|
|
39408
41169
|
}, [children, errors]);
|
|
39409
41170
|
if (!content) {
|
|
39410
41171
|
return null;
|
|
39411
41172
|
}
|
|
39412
|
-
return /* @__PURE__ */ (0,
|
|
41173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39413
41174
|
"div",
|
|
39414
41175
|
{
|
|
39415
41176
|
role: "alert",
|
|
@@ -39423,9 +41184,9 @@ function FieldError({
|
|
|
39423
41184
|
|
|
39424
41185
|
// src/components/ui/input-group.tsx
|
|
39425
41186
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
39426
|
-
var
|
|
41187
|
+
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
39427
41188
|
function InputGroup({ className, ...props }) {
|
|
39428
|
-
return /* @__PURE__ */ (0,
|
|
41189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39429
41190
|
"div",
|
|
39430
41191
|
{
|
|
39431
41192
|
"data-slot": "input-group",
|
|
@@ -39469,7 +41230,7 @@ function InputGroupAddon({
|
|
|
39469
41230
|
align = "inline-start",
|
|
39470
41231
|
...props
|
|
39471
41232
|
}) {
|
|
39472
|
-
return /* @__PURE__ */ (0,
|
|
41233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39473
41234
|
"div",
|
|
39474
41235
|
{
|
|
39475
41236
|
role: "group",
|
|
@@ -39509,7 +41270,7 @@ function InputGroupButton({
|
|
|
39509
41270
|
size = "xs",
|
|
39510
41271
|
...props
|
|
39511
41272
|
}) {
|
|
39512
|
-
return /* @__PURE__ */ (0,
|
|
41273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39513
41274
|
Button,
|
|
39514
41275
|
{
|
|
39515
41276
|
type,
|
|
@@ -39521,7 +41282,7 @@ function InputGroupButton({
|
|
|
39521
41282
|
);
|
|
39522
41283
|
}
|
|
39523
41284
|
function InputGroupText({ className, ...props }) {
|
|
39524
|
-
return /* @__PURE__ */ (0,
|
|
41285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39525
41286
|
"span",
|
|
39526
41287
|
{
|
|
39527
41288
|
className: cn(
|
|
@@ -39536,7 +41297,7 @@ function InputGroupInput({
|
|
|
39536
41297
|
className,
|
|
39537
41298
|
...props
|
|
39538
41299
|
}) {
|
|
39539
|
-
return /* @__PURE__ */ (0,
|
|
41300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39540
41301
|
Input,
|
|
39541
41302
|
{
|
|
39542
41303
|
"data-slot": "input-group-control",
|
|
@@ -39552,7 +41313,7 @@ function InputGroupTextarea({
|
|
|
39552
41313
|
className,
|
|
39553
41314
|
...props
|
|
39554
41315
|
}) {
|
|
39555
|
-
return /* @__PURE__ */ (0,
|
|
41316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39556
41317
|
Textarea,
|
|
39557
41318
|
{
|
|
39558
41319
|
"data-slot": "input-group-control",
|
|
@@ -39568,9 +41329,9 @@ function InputGroupTextarea({
|
|
|
39568
41329
|
// src/components/ui/item.tsx
|
|
39569
41330
|
var import_react_slot5 = require("@radix-ui/react-slot");
|
|
39570
41331
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
39571
|
-
var
|
|
41332
|
+
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
39572
41333
|
function ItemGroup({ className, ...props }) {
|
|
39573
|
-
return /* @__PURE__ */ (0,
|
|
41334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39574
41335
|
"div",
|
|
39575
41336
|
{
|
|
39576
41337
|
role: "list",
|
|
@@ -39584,7 +41345,7 @@ function ItemSeparator({
|
|
|
39584
41345
|
className,
|
|
39585
41346
|
...props
|
|
39586
41347
|
}) {
|
|
39587
|
-
return /* @__PURE__ */ (0,
|
|
41348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39588
41349
|
Separator2,
|
|
39589
41350
|
{
|
|
39590
41351
|
"data-slot": "item-separator",
|
|
@@ -39622,7 +41383,7 @@ function Item8({
|
|
|
39622
41383
|
...props
|
|
39623
41384
|
}) {
|
|
39624
41385
|
const Comp = asChild ? import_react_slot5.Slot : "div";
|
|
39625
|
-
return /* @__PURE__ */ (0,
|
|
41386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39626
41387
|
Comp,
|
|
39627
41388
|
{
|
|
39628
41389
|
"data-slot": "item",
|
|
@@ -39653,7 +41414,7 @@ function ItemMedia({
|
|
|
39653
41414
|
variant = "default",
|
|
39654
41415
|
...props
|
|
39655
41416
|
}) {
|
|
39656
|
-
return /* @__PURE__ */ (0,
|
|
41417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39657
41418
|
"div",
|
|
39658
41419
|
{
|
|
39659
41420
|
"data-slot": "item-media",
|
|
@@ -39664,7 +41425,7 @@ function ItemMedia({
|
|
|
39664
41425
|
);
|
|
39665
41426
|
}
|
|
39666
41427
|
function ItemContent({ className, ...props }) {
|
|
39667
|
-
return /* @__PURE__ */ (0,
|
|
41428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39668
41429
|
"div",
|
|
39669
41430
|
{
|
|
39670
41431
|
"data-slot": "item-content",
|
|
@@ -39677,7 +41438,7 @@ function ItemContent({ className, ...props }) {
|
|
|
39677
41438
|
);
|
|
39678
41439
|
}
|
|
39679
41440
|
function ItemTitle({ className, ...props }) {
|
|
39680
|
-
return /* @__PURE__ */ (0,
|
|
41441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39681
41442
|
"div",
|
|
39682
41443
|
{
|
|
39683
41444
|
"data-slot": "item-title",
|
|
@@ -39690,7 +41451,7 @@ function ItemTitle({ className, ...props }) {
|
|
|
39690
41451
|
);
|
|
39691
41452
|
}
|
|
39692
41453
|
function ItemDescription({ className, ...props }) {
|
|
39693
|
-
return /* @__PURE__ */ (0,
|
|
41454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39694
41455
|
"p",
|
|
39695
41456
|
{
|
|
39696
41457
|
"data-slot": "item-description",
|
|
@@ -39704,7 +41465,7 @@ function ItemDescription({ className, ...props }) {
|
|
|
39704
41465
|
);
|
|
39705
41466
|
}
|
|
39706
41467
|
function ItemActions({ className, ...props }) {
|
|
39707
|
-
return /* @__PURE__ */ (0,
|
|
41468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39708
41469
|
"div",
|
|
39709
41470
|
{
|
|
39710
41471
|
"data-slot": "item-actions",
|
|
@@ -39714,7 +41475,7 @@ function ItemActions({ className, ...props }) {
|
|
|
39714
41475
|
);
|
|
39715
41476
|
}
|
|
39716
41477
|
function ItemHeader({ className, ...props }) {
|
|
39717
|
-
return /* @__PURE__ */ (0,
|
|
41478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39718
41479
|
"div",
|
|
39719
41480
|
{
|
|
39720
41481
|
"data-slot": "item-header",
|
|
@@ -39727,7 +41488,7 @@ function ItemHeader({ className, ...props }) {
|
|
|
39727
41488
|
);
|
|
39728
41489
|
}
|
|
39729
41490
|
function ItemFooter({ className, ...props }) {
|
|
39730
|
-
return /* @__PURE__ */ (0,
|
|
41491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39731
41492
|
"div",
|
|
39732
41493
|
{
|
|
39733
41494
|
"data-slot": "item-footer",
|
|
@@ -39741,9 +41502,9 @@ function ItemFooter({ className, ...props }) {
|
|
|
39741
41502
|
}
|
|
39742
41503
|
|
|
39743
41504
|
// src/components/ui/kbd.tsx
|
|
39744
|
-
var
|
|
41505
|
+
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
39745
41506
|
function Kbd({ className, ...props }) {
|
|
39746
|
-
return /* @__PURE__ */ (0,
|
|
41507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
39747
41508
|
"kbd",
|
|
39748
41509
|
{
|
|
39749
41510
|
"data-slot": "kbd",
|
|
@@ -39758,7 +41519,7 @@ function Kbd({ className, ...props }) {
|
|
|
39758
41519
|
);
|
|
39759
41520
|
}
|
|
39760
41521
|
function KbdGroup({ className, ...props }) {
|
|
39761
|
-
return /* @__PURE__ */ (0,
|
|
41522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
39762
41523
|
"kbd",
|
|
39763
41524
|
{
|
|
39764
41525
|
"data-slot": "kbd-group",
|
|
@@ -39791,7 +41552,7 @@ function useIsMobile() {
|
|
|
39791
41552
|
}
|
|
39792
41553
|
|
|
39793
41554
|
// src/components/ui/sidebar.tsx
|
|
39794
|
-
var
|
|
41555
|
+
var import_jsx_runtime150 = require("react/jsx-runtime");
|
|
39795
41556
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
39796
41557
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
39797
41558
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -39858,7 +41619,7 @@ var SidebarProvider = React100.forwardRef(
|
|
|
39858
41619
|
}),
|
|
39859
41620
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
39860
41621
|
);
|
|
39861
|
-
return /* @__PURE__ */ (0,
|
|
41622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39862
41623
|
"div",
|
|
39863
41624
|
{
|
|
39864
41625
|
style: {
|
|
@@ -39889,7 +41650,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39889
41650
|
}, ref) => {
|
|
39890
41651
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
39891
41652
|
if (collapsible === "none") {
|
|
39892
|
-
return /* @__PURE__ */ (0,
|
|
41653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39893
41654
|
"div",
|
|
39894
41655
|
{
|
|
39895
41656
|
className: cn(
|
|
@@ -39903,7 +41664,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39903
41664
|
);
|
|
39904
41665
|
}
|
|
39905
41666
|
if (isMobile) {
|
|
39906
|
-
return /* @__PURE__ */ (0,
|
|
41667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Sheet2, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
39907
41668
|
SheetContent,
|
|
39908
41669
|
{
|
|
39909
41670
|
"data-sidebar": "sidebar",
|
|
@@ -39914,16 +41675,16 @@ var Sidebar = React100.forwardRef(
|
|
|
39914
41675
|
},
|
|
39915
41676
|
side,
|
|
39916
41677
|
children: [
|
|
39917
|
-
/* @__PURE__ */ (0,
|
|
39918
|
-
/* @__PURE__ */ (0,
|
|
39919
|
-
/* @__PURE__ */ (0,
|
|
41678
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(SheetHeader, { className: "sr-only", children: [
|
|
41679
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(SheetTitle, { children: "Sidebar" }),
|
|
41680
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
39920
41681
|
] }),
|
|
39921
|
-
/* @__PURE__ */ (0,
|
|
41682
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
39922
41683
|
]
|
|
39923
41684
|
}
|
|
39924
41685
|
) });
|
|
39925
41686
|
}
|
|
39926
|
-
return /* @__PURE__ */ (0,
|
|
41687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
39927
41688
|
"div",
|
|
39928
41689
|
{
|
|
39929
41690
|
ref,
|
|
@@ -39933,7 +41694,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39933
41694
|
"data-variant": variant,
|
|
39934
41695
|
"data-side": side,
|
|
39935
41696
|
children: [
|
|
39936
|
-
/* @__PURE__ */ (0,
|
|
41697
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39937
41698
|
"div",
|
|
39938
41699
|
{
|
|
39939
41700
|
className: cn(
|
|
@@ -39944,7 +41705,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39944
41705
|
)
|
|
39945
41706
|
}
|
|
39946
41707
|
),
|
|
39947
|
-
/* @__PURE__ */ (0,
|
|
41708
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39948
41709
|
"div",
|
|
39949
41710
|
{
|
|
39950
41711
|
className: cn(
|
|
@@ -39955,7 +41716,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39955
41716
|
className
|
|
39956
41717
|
),
|
|
39957
41718
|
...props,
|
|
39958
|
-
children: /* @__PURE__ */ (0,
|
|
41719
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39959
41720
|
"div",
|
|
39960
41721
|
{
|
|
39961
41722
|
"data-sidebar": "sidebar",
|
|
@@ -39973,7 +41734,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39973
41734
|
Sidebar.displayName = "Sidebar";
|
|
39974
41735
|
var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
39975
41736
|
const { toggleSidebar } = useSidebar();
|
|
39976
|
-
return /* @__PURE__ */ (0,
|
|
41737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
39977
41738
|
Button,
|
|
39978
41739
|
{
|
|
39979
41740
|
ref,
|
|
@@ -39987,8 +41748,8 @@ var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref)
|
|
|
39987
41748
|
},
|
|
39988
41749
|
...props,
|
|
39989
41750
|
children: [
|
|
39990
|
-
/* @__PURE__ */ (0,
|
|
39991
|
-
/* @__PURE__ */ (0,
|
|
41751
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(PanelLeft, {}),
|
|
41752
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
39992
41753
|
]
|
|
39993
41754
|
}
|
|
39994
41755
|
);
|
|
@@ -39996,7 +41757,7 @@ var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref)
|
|
|
39996
41757
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
39997
41758
|
var SidebarRail = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39998
41759
|
const { toggleSidebar } = useSidebar();
|
|
39999
|
-
return /* @__PURE__ */ (0,
|
|
41760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40000
41761
|
"button",
|
|
40001
41762
|
{
|
|
40002
41763
|
ref,
|
|
@@ -40020,7 +41781,7 @@ var SidebarRail = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40020
41781
|
});
|
|
40021
41782
|
SidebarRail.displayName = "SidebarRail";
|
|
40022
41783
|
var SidebarInset = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40023
|
-
return /* @__PURE__ */ (0,
|
|
41784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40024
41785
|
"main",
|
|
40025
41786
|
{
|
|
40026
41787
|
ref,
|
|
@@ -40035,7 +41796,7 @@ var SidebarInset = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40035
41796
|
});
|
|
40036
41797
|
SidebarInset.displayName = "SidebarInset";
|
|
40037
41798
|
var SidebarInput = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40038
|
-
return /* @__PURE__ */ (0,
|
|
41799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40039
41800
|
Input,
|
|
40040
41801
|
{
|
|
40041
41802
|
ref,
|
|
@@ -40050,7 +41811,7 @@ var SidebarInput = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40050
41811
|
});
|
|
40051
41812
|
SidebarInput.displayName = "SidebarInput";
|
|
40052
41813
|
var SidebarHeader = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40053
|
-
return /* @__PURE__ */ (0,
|
|
41814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40054
41815
|
"div",
|
|
40055
41816
|
{
|
|
40056
41817
|
ref,
|
|
@@ -40062,7 +41823,7 @@ var SidebarHeader = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40062
41823
|
});
|
|
40063
41824
|
SidebarHeader.displayName = "SidebarHeader";
|
|
40064
41825
|
var SidebarFooter = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40065
|
-
return /* @__PURE__ */ (0,
|
|
41826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40066
41827
|
"div",
|
|
40067
41828
|
{
|
|
40068
41829
|
ref,
|
|
@@ -40074,7 +41835,7 @@ var SidebarFooter = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40074
41835
|
});
|
|
40075
41836
|
SidebarFooter.displayName = "SidebarFooter";
|
|
40076
41837
|
var SidebarSeparator = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40077
|
-
return /* @__PURE__ */ (0,
|
|
41838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40078
41839
|
Separator2,
|
|
40079
41840
|
{
|
|
40080
41841
|
ref,
|
|
@@ -40086,7 +41847,7 @@ var SidebarSeparator = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40086
41847
|
});
|
|
40087
41848
|
SidebarSeparator.displayName = "SidebarSeparator";
|
|
40088
41849
|
var SidebarContent = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40089
|
-
return /* @__PURE__ */ (0,
|
|
41850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40090
41851
|
"div",
|
|
40091
41852
|
{
|
|
40092
41853
|
ref,
|
|
@@ -40101,7 +41862,7 @@ var SidebarContent = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40101
41862
|
});
|
|
40102
41863
|
SidebarContent.displayName = "SidebarContent";
|
|
40103
41864
|
var SidebarGroup = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40104
|
-
return /* @__PURE__ */ (0,
|
|
41865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40105
41866
|
"div",
|
|
40106
41867
|
{
|
|
40107
41868
|
ref,
|
|
@@ -40114,7 +41875,7 @@ var SidebarGroup = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40114
41875
|
SidebarGroup.displayName = "SidebarGroup";
|
|
40115
41876
|
var SidebarGroupLabel = React100.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
40116
41877
|
const Comp = asChild ? import_react_slot6.Slot : "div";
|
|
40117
|
-
return /* @__PURE__ */ (0,
|
|
41878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40118
41879
|
Comp,
|
|
40119
41880
|
{
|
|
40120
41881
|
ref,
|
|
@@ -40131,7 +41892,7 @@ var SidebarGroupLabel = React100.forwardRef(({ className, asChild = false, ...pr
|
|
|
40131
41892
|
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
40132
41893
|
var SidebarGroupAction = React100.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
40133
41894
|
const Comp = asChild ? import_react_slot6.Slot : "button";
|
|
40134
|
-
return /* @__PURE__ */ (0,
|
|
41895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40135
41896
|
Comp,
|
|
40136
41897
|
{
|
|
40137
41898
|
ref,
|
|
@@ -40148,7 +41909,7 @@ var SidebarGroupAction = React100.forwardRef(({ className, asChild = false, ...p
|
|
|
40148
41909
|
);
|
|
40149
41910
|
});
|
|
40150
41911
|
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
40151
|
-
var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
41912
|
+
var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40152
41913
|
"div",
|
|
40153
41914
|
{
|
|
40154
41915
|
ref,
|
|
@@ -40158,7 +41919,7 @@ var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) =>
|
|
|
40158
41919
|
}
|
|
40159
41920
|
));
|
|
40160
41921
|
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
40161
|
-
var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
41922
|
+
var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40162
41923
|
"ul",
|
|
40163
41924
|
{
|
|
40164
41925
|
ref,
|
|
@@ -40168,7 +41929,7 @@ var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
40168
41929
|
}
|
|
40169
41930
|
));
|
|
40170
41931
|
SidebarMenu.displayName = "SidebarMenu";
|
|
40171
|
-
var SidebarMenuItem = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
41932
|
+
var SidebarMenuItem = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40172
41933
|
"li",
|
|
40173
41934
|
{
|
|
40174
41935
|
ref,
|
|
@@ -40210,7 +41971,7 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
40210
41971
|
}, ref) => {
|
|
40211
41972
|
const Comp = asChild ? import_react_slot6.Slot : "button";
|
|
40212
41973
|
const { isMobile, state } = useSidebar();
|
|
40213
|
-
const button = /* @__PURE__ */ (0,
|
|
41974
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40214
41975
|
Comp,
|
|
40215
41976
|
{
|
|
40216
41977
|
ref,
|
|
@@ -40229,9 +41990,9 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
40229
41990
|
children: tooltip
|
|
40230
41991
|
};
|
|
40231
41992
|
}
|
|
40232
|
-
return /* @__PURE__ */ (0,
|
|
40233
|
-
/* @__PURE__ */ (0,
|
|
40234
|
-
/* @__PURE__ */ (0,
|
|
41993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(Tooltip, { children: [
|
|
41994
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
41995
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40235
41996
|
TooltipContent,
|
|
40236
41997
|
{
|
|
40237
41998
|
side: "right",
|
|
@@ -40246,7 +42007,7 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
40246
42007
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
40247
42008
|
var SidebarMenuAction = React100.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
40248
42009
|
const Comp = asChild ? import_react_slot6.Slot : "button";
|
|
40249
|
-
return /* @__PURE__ */ (0,
|
|
42010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40250
42011
|
Comp,
|
|
40251
42012
|
{
|
|
40252
42013
|
ref,
|
|
@@ -40267,7 +42028,7 @@ var SidebarMenuAction = React100.forwardRef(({ className, asChild = false, showO
|
|
|
40267
42028
|
);
|
|
40268
42029
|
});
|
|
40269
42030
|
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
40270
|
-
var SidebarMenuBadge = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
42031
|
+
var SidebarMenuBadge = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40271
42032
|
"div",
|
|
40272
42033
|
{
|
|
40273
42034
|
ref,
|
|
@@ -40289,7 +42050,7 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40289
42050
|
const width = React100.useMemo(() => {
|
|
40290
42051
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
40291
42052
|
}, []);
|
|
40292
|
-
return /* @__PURE__ */ (0,
|
|
42053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
40293
42054
|
"div",
|
|
40294
42055
|
{
|
|
40295
42056
|
ref,
|
|
@@ -40297,14 +42058,14 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40297
42058
|
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
40298
42059
|
...props,
|
|
40299
42060
|
children: [
|
|
40300
|
-
showIcon && /* @__PURE__ */ (0,
|
|
42061
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40301
42062
|
Skeleton,
|
|
40302
42063
|
{
|
|
40303
42064
|
className: "size-4 rounded-md",
|
|
40304
42065
|
"data-sidebar": "menu-skeleton-icon"
|
|
40305
42066
|
}
|
|
40306
42067
|
),
|
|
40307
|
-
/* @__PURE__ */ (0,
|
|
42068
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40308
42069
|
Skeleton,
|
|
40309
42070
|
{
|
|
40310
42071
|
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
@@ -40319,7 +42080,7 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40319
42080
|
);
|
|
40320
42081
|
});
|
|
40321
42082
|
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
40322
|
-
var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
42083
|
+
var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40323
42084
|
"ul",
|
|
40324
42085
|
{
|
|
40325
42086
|
ref,
|
|
@@ -40333,11 +42094,11 @@ var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
40333
42094
|
}
|
|
40334
42095
|
));
|
|
40335
42096
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
40336
|
-
var SidebarMenuSubItem = React100.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0,
|
|
42097
|
+
var SidebarMenuSubItem = React100.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("li", { ref, ...props }));
|
|
40337
42098
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
40338
42099
|
var SidebarMenuSubButton = React100.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
40339
42100
|
const Comp = asChild ? import_react_slot6.Slot : "a";
|
|
40340
|
-
return /* @__PURE__ */ (0,
|
|
42101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40341
42102
|
Comp,
|
|
40342
42103
|
{
|
|
40343
42104
|
ref,
|
|
@@ -40361,20 +42122,20 @@ SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
|
40361
42122
|
// src/components/ui/sonner.tsx
|
|
40362
42123
|
var import_next_themes = require("next-themes");
|
|
40363
42124
|
var import_sonner = require("sonner");
|
|
40364
|
-
var
|
|
42125
|
+
var import_jsx_runtime151 = require("react/jsx-runtime");
|
|
40365
42126
|
var Toaster = ({ ...props }) => {
|
|
40366
42127
|
const { theme = "system" } = (0, import_next_themes.useTheme)();
|
|
40367
|
-
return /* @__PURE__ */ (0,
|
|
42128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
40368
42129
|
import_sonner.Toaster,
|
|
40369
42130
|
{
|
|
40370
42131
|
theme,
|
|
40371
42132
|
className: "toaster group",
|
|
40372
42133
|
icons: {
|
|
40373
|
-
success: /* @__PURE__ */ (0,
|
|
40374
|
-
info: /* @__PURE__ */ (0,
|
|
40375
|
-
warning: /* @__PURE__ */ (0,
|
|
40376
|
-
error: /* @__PURE__ */ (0,
|
|
40377
|
-
loading: /* @__PURE__ */ (0,
|
|
42134
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(CircleCheck, { className: "h-4 w-4" }),
|
|
42135
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Info, { className: "h-4 w-4" }),
|
|
42136
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(TriangleAlert, { className: "h-4 w-4" }),
|
|
42137
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(OctagonX, { className: "h-4 w-4" }),
|
|
42138
|
+
loading: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(LoaderCircle, { className: "h-4 w-4 animate-spin" })
|
|
40378
42139
|
},
|
|
40379
42140
|
toastOptions: {
|
|
40380
42141
|
classNames: {
|
|
@@ -40392,24 +42153,24 @@ var Toaster = ({ ...props }) => {
|
|
|
40392
42153
|
// src/components/ui/toggle-group.tsx
|
|
40393
42154
|
var React101 = __toESM(require("react"), 1);
|
|
40394
42155
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
|
|
40395
|
-
var
|
|
42156
|
+
var import_jsx_runtime152 = require("react/jsx-runtime");
|
|
40396
42157
|
var ToggleGroupContext = React101.createContext({
|
|
40397
42158
|
size: "default",
|
|
40398
42159
|
variant: "default"
|
|
40399
42160
|
});
|
|
40400
|
-
var ToggleGroup = React101.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
42161
|
+
var ToggleGroup = React101.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
40401
42162
|
ToggleGroupPrimitive.Root,
|
|
40402
42163
|
{
|
|
40403
42164
|
ref,
|
|
40404
42165
|
className: cn("flex items-center justify-center gap-1", className),
|
|
40405
42166
|
...props,
|
|
40406
|
-
children: /* @__PURE__ */ (0,
|
|
42167
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
40407
42168
|
}
|
|
40408
42169
|
));
|
|
40409
42170
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
40410
42171
|
var ToggleGroupItem = React101.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
40411
42172
|
const context = React101.useContext(ToggleGroupContext);
|
|
40412
|
-
return /* @__PURE__ */ (0,
|
|
42173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
40413
42174
|
ToggleGroupPrimitive.Item,
|
|
40414
42175
|
{
|
|
40415
42176
|
ref,
|
|
@@ -40428,7 +42189,7 @@ var ToggleGroupItem = React101.forwardRef(({ className, children, variant, size,
|
|
|
40428
42189
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
40429
42190
|
|
|
40430
42191
|
// src/render/PXEngineRenderer.tsx
|
|
40431
|
-
var
|
|
42192
|
+
var import_jsx_runtime153 = require("react/jsx-runtime");
|
|
40432
42193
|
var CONTEXT_DEPENDENT_COMPONENTS = /* @__PURE__ */ new Set([
|
|
40433
42194
|
// Form components - require FormField + FormItem context
|
|
40434
42195
|
"FormLabel",
|
|
@@ -40520,24 +42281,24 @@ var COMPONENT_SUGGESTIONS = {
|
|
|
40520
42281
|
};
|
|
40521
42282
|
var renderContextDependentError = (componentName, normalizedName, key) => {
|
|
40522
42283
|
const suggestion = COMPONENT_SUGGESTIONS[normalizedName] || `${componentName}Atom (if available)`;
|
|
40523
|
-
return /* @__PURE__ */ (0,
|
|
42284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
|
|
40524
42285
|
"div",
|
|
40525
42286
|
{
|
|
40526
42287
|
className: "p-4 border-2 border-amber-500/50 rounded-lg bg-amber-50/80 space-y-2 my-2",
|
|
40527
42288
|
children: [
|
|
40528
|
-
/* @__PURE__ */ (0,
|
|
40529
|
-
/* @__PURE__ */ (0,
|
|
40530
|
-
/* @__PURE__ */ (0,
|
|
40531
|
-
/* @__PURE__ */ (0,
|
|
42289
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
42290
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: "text-amber-600 font-bold text-lg", children: "\u26A0\uFE0F" }),
|
|
42291
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex-1", children: [
|
|
42292
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("p", { className: "text-sm font-semibold text-amber-900", children: [
|
|
40532
42293
|
"Invalid Component: ",
|
|
40533
42294
|
componentName
|
|
40534
42295
|
] }),
|
|
40535
|
-
/* @__PURE__ */ (0,
|
|
42296
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-xs text-amber-700 mt-1", children: "This component requires React Context and cannot be rendered directly in schemas." })
|
|
40536
42297
|
] })
|
|
40537
42298
|
] }),
|
|
40538
|
-
/* @__PURE__ */ (0,
|
|
40539
|
-
/* @__PURE__ */ (0,
|
|
40540
|
-
/* @__PURE__ */ (0,
|
|
42299
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "bg-white/60 p-3 rounded border border-amber-200", children: [
|
|
42300
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-xs font-semibold text-gray-700 mb-1.5", children: "\u2713 Use instead:" }),
|
|
42301
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("code", { className: "text-xs text-blue-700 bg-blue-50 px-2 py-1 rounded", children: suggestion })
|
|
40541
42302
|
] })
|
|
40542
42303
|
]
|
|
40543
42304
|
},
|
|
@@ -40617,7 +42378,7 @@ var PXEngineRenderer = ({
|
|
|
40617
42378
|
if (typeof component === "string" || typeof component === "number") {
|
|
40618
42379
|
return component;
|
|
40619
42380
|
}
|
|
40620
|
-
if (
|
|
42381
|
+
if (import_react79.default.isValidElement(component)) {
|
|
40621
42382
|
return component;
|
|
40622
42383
|
}
|
|
40623
42384
|
if (!component || typeof component !== "object") return null;
|
|
@@ -40696,7 +42457,7 @@ var PXEngineRenderer = ({
|
|
|
40696
42457
|
const isAtomWithRenderProp = ATOMS_WITH_RENDER.has(atomName);
|
|
40697
42458
|
const finalStyle = { ...dynamicStyle, ...finalProps.style || {} };
|
|
40698
42459
|
if (isAtomWithRenderProp) {
|
|
40699
|
-
return /* @__PURE__ */ (0,
|
|
42460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
40700
42461
|
TargetComponent,
|
|
40701
42462
|
{
|
|
40702
42463
|
...finalProps,
|
|
@@ -40708,7 +42469,7 @@ var PXEngineRenderer = ({
|
|
|
40708
42469
|
uniqueKey
|
|
40709
42470
|
);
|
|
40710
42471
|
} else {
|
|
40711
|
-
return /* @__PURE__ */ (0,
|
|
42472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
40712
42473
|
TargetComponent,
|
|
40713
42474
|
{
|
|
40714
42475
|
...finalProps,
|
|
@@ -40720,7 +42481,7 @@ var PXEngineRenderer = ({
|
|
|
40720
42481
|
);
|
|
40721
42482
|
}
|
|
40722
42483
|
};
|
|
40723
|
-
return /* @__PURE__ */ (0,
|
|
42484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "px-engine-root relative w-full h-full", children: renderRecursive(root) });
|
|
40724
42485
|
};
|
|
40725
42486
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40726
42487
|
0 && (module.exports = {
|
|
@@ -40816,6 +42577,7 @@ var PXEngineRenderer = ({
|
|
|
40816
42577
|
CountrySelectEdit,
|
|
40817
42578
|
CreatorActionHeader,
|
|
40818
42579
|
CreatorCompactView,
|
|
42580
|
+
CreatorExpandedPanel,
|
|
40819
42581
|
CreatorGridCard,
|
|
40820
42582
|
CreatorImageList,
|
|
40821
42583
|
CreatorProfileSummary,
|
|
@@ -41001,6 +42763,8 @@ var PXEngineRenderer = ({
|
|
|
41001
42763
|
VideoAtom,
|
|
41002
42764
|
WorkflowVisualizer,
|
|
41003
42765
|
cn,
|
|
42766
|
+
defaultFetchSelections,
|
|
42767
|
+
defaultPersistSelection,
|
|
41004
42768
|
generateFieldsFromData,
|
|
41005
42769
|
generateFieldsFromPropDefinitions,
|
|
41006
42770
|
useCreatorWidgetPolling
|