pxengine 0.1.89 → 0.1.91

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 CHANGED
@@ -336,6 +336,7 @@ __export(index_exports, {
336
336
  TopPostsGrid: () => TopPostsGrid,
337
337
  VideoAtom: () => VideoAtom,
338
338
  WebSearchJobCard: () => WebSearchJobCard,
339
+ WidgetThemeContext: () => WidgetThemeContext,
339
340
  cn: () => cn,
340
341
  defaultFetchSelections: () => defaultFetchSelections,
341
342
  defaultPersistSelection: () => defaultPersistSelection,
@@ -347,12 +348,13 @@ __export(index_exports, {
347
348
  submitWidgetToAgent: () => submitWidgetToAgent,
348
349
  th: () => th,
349
350
  useCreatorWidgetPolling: () => useCreatorWidgetPolling,
351
+ useWidgetTheme: () => useWidgetTheme,
350
352
  withAlpha: () => withAlpha
351
353
  });
352
354
  module.exports = __toCommonJS(index_exports);
353
355
 
354
356
  // src/render/PXEngineRenderer.tsx
355
- var import_react93 = __toESM(require("react"), 1);
357
+ var import_react94 = __toESM(require("react"), 1);
356
358
 
357
359
  // src/atoms/index.ts
358
360
  var atoms_exports = {};
@@ -33964,14 +33966,22 @@ __export(molecules_exports, {
33964
33966
  TimelineCard: () => TimelineCard,
33965
33967
  TopPostsGrid: () => TopPostsGrid,
33966
33968
  WebSearchJobCard: () => WebSearchJobCard,
33969
+ WidgetThemeContext: () => WidgetThemeContext,
33967
33970
  defaultFetchSelections: () => defaultFetchSelections,
33968
33971
  defaultPersistSelection: () => defaultPersistSelection,
33969
33972
  th: () => th,
33970
33973
  useCreatorWidgetPolling: () => useCreatorWidgetPolling,
33974
+ useWidgetTheme: () => useWidgetTheme,
33971
33975
  withAlpha: () => withAlpha
33972
33976
  });
33973
33977
 
33974
33978
  // src/molecules/generic/widgetTheme.ts
33979
+ var import_react54 = require("react");
33980
+ var WidgetThemeContext = (0, import_react54.createContext)(void 0);
33981
+ function useWidgetTheme(explicit) {
33982
+ const ctx = (0, import_react54.useContext)(WidgetThemeContext);
33983
+ return explicit ?? ctx;
33984
+ }
33975
33985
  function withAlpha(color, alpha) {
33976
33986
  const hex = color.replace("#", "");
33977
33987
  if (hex.length === 6) {
@@ -33984,13 +33994,22 @@ function withAlpha(color, alpha) {
33984
33994
  }
33985
33995
  function th(theme) {
33986
33996
  const T = theme ?? {};
33997
+ const shape = {
33998
+ ...typeof T.borderWidth === "number" && { borderWidth: T.borderWidth },
33999
+ ...typeof T.radius === "number" && { borderRadius: T.radius },
34000
+ ...T.shadow && { boxShadow: T.shadow },
34001
+ ...T.fontFamily && { fontFamily: T.fontFamily }
34002
+ };
33987
34003
  const root = {
33988
34004
  ...T.background && { backgroundColor: T.background },
33989
- ...T.border && { borderColor: T.border }
34005
+ ...T.border && { borderColor: T.border },
34006
+ ...shape
33990
34007
  };
33991
34008
  const surface = {
33992
34009
  ...T.surface && { backgroundColor: T.surface },
33993
- ...T.border && { borderColor: T.border }
34010
+ ...T.border && { borderColor: T.border },
34011
+ ...typeof T.borderWidth === "number" && { borderWidth: T.borderWidth },
34012
+ ...typeof T.radius === "number" && { borderRadius: Math.max(0, T.radius - 4) }
33994
34013
  };
33995
34014
  const text = {
33996
34015
  ...T.text && { color: T.text }
@@ -34007,14 +34026,35 @@ function th(theme) {
34007
34026
  const accentBorder = {
34008
34027
  ...T.accent && { borderColor: T.accent }
34009
34028
  };
34029
+ const accentText = {
34030
+ ...T.accentForeground && { color: T.accentForeground }
34031
+ };
34010
34032
  const accentSubtle = (alpha = 0.12) => ({
34011
34033
  ...T.accent && { backgroundColor: withAlpha(T.accent, alpha) }
34012
34034
  });
34013
- return { root, surface, text, muted, accent, accentBg, accentBorder, accentSubtle };
34035
+ const semantic = (kind) => ({
34036
+ ...T[kind] && { color: T[kind] }
34037
+ });
34038
+ const gradientBg = {
34039
+ ...T.gradient && { backgroundImage: T.gradient }
34040
+ };
34041
+ return {
34042
+ root,
34043
+ surface,
34044
+ text,
34045
+ muted,
34046
+ accent,
34047
+ accentBg,
34048
+ accentBorder,
34049
+ accentText,
34050
+ accentSubtle,
34051
+ semantic,
34052
+ gradientBg
34053
+ };
34014
34054
  }
34015
34055
 
34016
34056
  // src/molecules/generic/EditableField/EditableField.tsx
34017
- var import_react54 = __toESM(require("react"), 1);
34057
+ var import_react55 = __toESM(require("react"), 1);
34018
34058
 
34019
34059
  // src/components/ui/hover-card.tsx
34020
34060
  var React82 = __toESM(require("react"), 1);
@@ -34333,7 +34373,7 @@ function Spinner({ className, ...props }) {
34333
34373
 
34334
34374
  // src/molecules/generic/EditableField/EditableField.tsx
34335
34375
  var import_jsx_runtime94 = require("react/jsx-runtime");
34336
- var EditableField = import_react54.default.memo(
34376
+ var EditableField = import_react55.default.memo(
34337
34377
  ({
34338
34378
  label,
34339
34379
  value,
@@ -34353,12 +34393,12 @@ var EditableField = import_react54.default.memo(
34353
34393
  ...rest
34354
34394
  }) => {
34355
34395
  void rest;
34356
- const [localValue, setLocalValue] = (0, import_react54.useState)(value);
34357
- const inputRef = (0, import_react54.useRef)(null);
34358
- (0, import_react54.useEffect)(() => {
34396
+ const [localValue, setLocalValue] = (0, import_react55.useState)(value);
34397
+ const inputRef = (0, import_react55.useRef)(null);
34398
+ (0, import_react55.useEffect)(() => {
34359
34399
  setLocalValue(value);
34360
34400
  }, [value, isEditingProp]);
34361
- (0, import_react54.useEffect)(() => {
34401
+ (0, import_react55.useEffect)(() => {
34362
34402
  if (isEditingProp) {
34363
34403
  setTimeout(() => inputRef.current?.focus(), 0);
34364
34404
  }
@@ -34545,9 +34585,9 @@ var EditableField = import_react54.default.memo(
34545
34585
  EditableField.displayName = "EditableField";
34546
34586
 
34547
34587
  // src/molecules/generic/ActionButton/ActionButton.tsx
34548
- var import_react55 = __toESM(require("react"), 1);
34588
+ var import_react56 = __toESM(require("react"), 1);
34549
34589
  var import_jsx_runtime95 = require("react/jsx-runtime");
34550
- var ActionButton = import_react55.default.memo(
34590
+ var ActionButton = import_react56.default.memo(
34551
34591
  ({
34552
34592
  label,
34553
34593
  secondaryLabel,
@@ -34562,13 +34602,13 @@ var ActionButton = import_react55.default.memo(
34562
34602
  className,
34563
34603
  showCountdown = true
34564
34604
  }) => {
34565
- const [timeLeft, setTimeLeft] = (0, import_react55.useState)(countdownProp || 0);
34566
- (0, import_react55.useEffect)(() => {
34605
+ const [timeLeft, setTimeLeft] = (0, import_react56.useState)(countdownProp || 0);
34606
+ (0, import_react56.useEffect)(() => {
34567
34607
  if (countdownProp !== void 0) {
34568
34608
  setTimeLeft(countdownProp);
34569
34609
  }
34570
34610
  }, [countdownProp]);
34571
- (0, import_react55.useEffect)(() => {
34611
+ (0, import_react56.useEffect)(() => {
34572
34612
  if (countdownProp === void 0 || countdownProp <= 0 || isPaused || isLoading || disabled) {
34573
34613
  return;
34574
34614
  }
@@ -34637,9 +34677,9 @@ var ActionButton = import_react55.default.memo(
34637
34677
  ActionButton.displayName = "ActionButton";
34638
34678
 
34639
34679
  // src/molecules/generic/FormCard/FormCard.tsx
34640
- var import_react56 = __toESM(require("react"), 1);
34680
+ var import_react57 = __toESM(require("react"), 1);
34641
34681
  var import_jsx_runtime96 = require("react/jsx-runtime");
34642
- var FormCard = import_react56.default.memo(
34682
+ var FormCard = import_react57.default.memo(
34643
34683
  ({
34644
34684
  title,
34645
34685
  fields,
@@ -34660,12 +34700,12 @@ var FormCard = import_react56.default.memo(
34660
34700
  footer,
34661
34701
  shouldStopPropagation = true
34662
34702
  }) => {
34663
- const [copied, setCopied] = (0, import_react56.useState)(false);
34664
- const [internalEditingFields, setInternalEditingFields] = (0, import_react56.useState)({});
34665
- const [internalSavingFields, setInternalSavingFields] = (0, import_react56.useState)({});
34666
- const [internalData, setInternalData] = (0, import_react56.useState)(data);
34667
- const [userEditedFields, setUserEditedFields] = (0, import_react56.useState)({});
34668
- import_react56.default.useEffect(() => {
34703
+ const [copied, setCopied] = (0, import_react57.useState)(false);
34704
+ const [internalEditingFields, setInternalEditingFields] = (0, import_react57.useState)({});
34705
+ const [internalSavingFields, setInternalSavingFields] = (0, import_react57.useState)({});
34706
+ const [internalData, setInternalData] = (0, import_react57.useState)(data);
34707
+ const [userEditedFields, setUserEditedFields] = (0, import_react57.useState)({});
34708
+ import_react57.default.useEffect(() => {
34669
34709
  setInternalData((prev) => {
34670
34710
  const newData = { ...data };
34671
34711
  Object.keys(userEditedFields).forEach((key) => {
@@ -34824,7 +34864,7 @@ var FormCard = import_react56.default.memo(
34824
34864
  FormCard.displayName = "FormCard";
34825
34865
 
34826
34866
  // src/molecules/generic/DynamicFormCard/DynamicFormCard.tsx
34827
- var import_react57 = __toESM(require("react"), 1);
34867
+ var import_react58 = __toESM(require("react"), 1);
34828
34868
 
34829
34869
  // src/lib/field-utils.ts
34830
34870
  function normalizeLabel(key) {
@@ -34900,7 +34940,7 @@ function generateFieldsFromPropDefinitions(propDefs, data) {
34900
34940
 
34901
34941
  // src/molecules/generic/DynamicFormCard/DynamicFormCard.tsx
34902
34942
  var import_jsx_runtime97 = require("react/jsx-runtime");
34903
- var DynamicFormCard = import_react57.default.memo(
34943
+ var DynamicFormCard = import_react58.default.memo(
34904
34944
  ({
34905
34945
  data = {},
34906
34946
  fields: providedFields,
@@ -34913,7 +34953,7 @@ var DynamicFormCard = import_react57.default.memo(
34913
34953
  showTimeline = true,
34914
34954
  ...rest
34915
34955
  }) => {
34916
- const fields = (0, import_react57.useMemo)(
34956
+ const fields = (0, import_react58.useMemo)(
34917
34957
  () => providedFields ?? generateFieldsFromData(data),
34918
34958
  [providedFields, data]
34919
34959
  );
@@ -35176,10 +35216,10 @@ var FilterBar = ({ filters, showSearch = true, className, onFilterToggle, onSear
35176
35216
  };
35177
35217
 
35178
35218
  // src/molecules/generic/FileUpload/FileUpload.tsx
35179
- var import_react58 = __toESM(require("react"), 1);
35219
+ var import_react59 = __toESM(require("react"), 1);
35180
35220
  var import_jsx_runtime102 = require("react/jsx-runtime");
35181
35221
  var FileUpload = ({ title, accept, multiple, className, style, onFilesSelected }) => {
35182
- const [isDragging, setIsDragging] = import_react58.default.useState(false);
35222
+ const [isDragging, setIsDragging] = import_react59.default.useState(false);
35183
35223
  const hasPxVars = style && Object.keys(style).some((k) => k.startsWith("--px-"));
35184
35224
  const wrapperStyle = {
35185
35225
  ...hasPxVars && {
@@ -35339,7 +35379,7 @@ var DataGrid = ({
35339
35379
  };
35340
35380
 
35341
35381
  // src/molecules/generic/StepWizard/StepWizard.tsx
35342
- var import_react59 = __toESM(require("react"), 1);
35382
+ var import_react60 = __toESM(require("react"), 1);
35343
35383
  var import_jsx_runtime105 = require("react/jsx-runtime");
35344
35384
  var StepWizard = ({
35345
35385
  steps,
@@ -35350,7 +35390,7 @@ var StepWizard = ({
35350
35390
  const isCompleted = i < currentStep;
35351
35391
  const isActive = i === currentStep;
35352
35392
  const isLast = i === steps.length - 1;
35353
- return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_react59.default.Fragment, { children: [
35393
+ return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_react60.default.Fragment, { children: [
35354
35394
  /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex flex-col items-center relative group", children: [
35355
35395
  /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
35356
35396
  "div",
@@ -35449,10 +35489,10 @@ var NotificationList = ({
35449
35489
  };
35450
35490
 
35451
35491
  // src/molecules/generic/SocialPostCard/SocialPostCard.tsx
35452
- var import_react61 = require("react");
35492
+ var import_react62 = require("react");
35453
35493
 
35454
35494
  // src/molecules/generic/SocialPostCard/PlatformPost.tsx
35455
- var import_react60 = require("react");
35495
+ var import_react61 = require("react");
35456
35496
  var import_jsx_runtime107 = require("react/jsx-runtime");
35457
35497
  var PLATFORM_STYLES = {
35458
35498
  twitter: {
@@ -35478,8 +35518,8 @@ var PLATFORM_STYLES = {
35478
35518
  }
35479
35519
  };
35480
35520
  var PlatformPost = ({ post, loading, className }) => {
35481
- const [copied, setCopied] = (0, import_react60.useState)(false);
35482
- const [caption, setCaption] = (0, import_react60.useState)(post.caption);
35521
+ const [copied, setCopied] = (0, import_react61.useState)(false);
35522
+ const [caption, setCaption] = (0, import_react61.useState)(post.caption);
35483
35523
  const style = PLATFORM_STYLES[post.platform] || PLATFORM_STYLES.twitter;
35484
35524
  const charCount = caption.length;
35485
35525
  const isOverLimit = charCount > post.character_limit;
@@ -35608,7 +35648,7 @@ var SocialPostCard = ({
35608
35648
  sendMessage: _sendMessage
35609
35649
  }) => {
35610
35650
  const initialSelected = posts?.map((p) => p.platform) || ALL_PLATFORMS.slice();
35611
- const [selectedPlatforms, setSelectedPlatforms] = (0, import_react61.useState)(initialSelected);
35651
+ const [selectedPlatforms, setSelectedPlatforms] = (0, import_react62.useState)(initialSelected);
35612
35652
  const togglePlatform = (platform) => {
35613
35653
  setSelectedPlatforms((prev) => {
35614
35654
  if (prev.includes(platform)) {
@@ -36744,9 +36784,9 @@ var GoogleSheetsListCard = ({
36744
36784
  };
36745
36785
 
36746
36786
  // src/molecules/generic/RecommendationCard/RecommendationCard.tsx
36747
- var import_react62 = __toESM(require("react"), 1);
36787
+ var import_react63 = __toESM(require("react"), 1);
36748
36788
  var import_jsx_runtime121 = require("react/jsx-runtime");
36749
- var RecommendationCard = import_react62.default.memo(
36789
+ var RecommendationCard = import_react63.default.memo(
36750
36790
  ({
36751
36791
  question,
36752
36792
  recommended,
@@ -36758,11 +36798,11 @@ var RecommendationCard = import_react62.default.memo(
36758
36798
  className,
36759
36799
  onAction
36760
36800
  }) => {
36761
- const [mode, setMode] = import_react62.default.useState(
36801
+ const [mode, setMode] = import_react63.default.useState(
36762
36802
  "recommended"
36763
36803
  );
36764
- const [customText, setCustomText] = import_react62.default.useState("");
36765
- const [isSubmitted, setIsSubmitted] = import_react62.default.useState(false);
36804
+ const [customText, setCustomText] = import_react63.default.useState("");
36805
+ const [isSubmitted, setIsSubmitted] = import_react63.default.useState(false);
36766
36806
  const isInteractive = isLatestMessage && !disabled && !isSubmitted;
36767
36807
  const handleModeChange = (newMode) => {
36768
36808
  if (isInteractive) {
@@ -36909,9 +36949,9 @@ var RecommendationCard = import_react62.default.memo(
36909
36949
  RecommendationCard.displayName = "RecommendationCard";
36910
36950
 
36911
36951
  // src/molecules/generic/ConfirmationCard/ConfirmationCard.tsx
36912
- var import_react63 = __toESM(require("react"), 1);
36952
+ var import_react64 = __toESM(require("react"), 1);
36913
36953
  var import_jsx_runtime122 = require("react/jsx-runtime");
36914
- var ConfirmationCard = import_react63.default.memo(
36954
+ var ConfirmationCard = import_react64.default.memo(
36915
36955
  ({
36916
36956
  title,
36917
36957
  description,
@@ -36924,8 +36964,8 @@ var ConfirmationCard = import_react63.default.memo(
36924
36964
  className,
36925
36965
  onAction
36926
36966
  }) => {
36927
- const [isSubmitted, setIsSubmitted] = import_react63.default.useState(false);
36928
- const [choice, setChoice] = import_react63.default.useState(null);
36967
+ const [isSubmitted, setIsSubmitted] = import_react64.default.useState(false);
36968
+ const [choice, setChoice] = import_react64.default.useState(null);
36929
36969
  const isInteractive = isLatestMessage && !disabled && !isSubmitted;
36930
36970
  const handleConfirm = (e) => {
36931
36971
  e.preventDefault();
@@ -36994,7 +37034,7 @@ var ConfirmationCard = import_react63.default.memo(
36994
37034
  ConfirmationCard.displayName = "ConfirmationCard";
36995
37035
 
36996
37036
  // src/molecules/generic/InputWidget/InputWidget.tsx
36997
- var import_react64 = __toESM(require("react"), 1);
37037
+ var import_react65 = __toESM(require("react"), 1);
36998
37038
 
36999
37039
  // src/lib/run-sse.ts
37000
37040
  var INPUT_ATOM_NAMES = /* @__PURE__ */ new Set([
@@ -37116,7 +37156,7 @@ var InputWidget = ({
37116
37156
  onAction,
37117
37157
  isSubmitting = false
37118
37158
  }) => {
37119
- const [values, setValues] = import_react64.default.useState(() => {
37159
+ const [values, setValues] = import_react65.default.useState(() => {
37120
37160
  const initial = {};
37121
37161
  for (const f of fields) {
37122
37162
  initial[f.key] = f.defaultValue ?? defaultForKind(f.kind);
@@ -37372,7 +37412,7 @@ function stringifyValue(value, atomName, props) {
37372
37412
  }
37373
37413
 
37374
37414
  // src/molecules/generic/KPIStatsCard/KPIStatsCard.tsx
37375
- var import_react65 = __toESM(require("react"), 1);
37415
+ var import_react66 = __toESM(require("react"), 1);
37376
37416
  var import_jsx_runtime124 = require("react/jsx-runtime");
37377
37417
  var TrendBadge = ({ item }) => {
37378
37418
  if (!item.delta && item.trend === void 0) return null;
@@ -37389,7 +37429,7 @@ var TrendBadge = ({ item }) => {
37389
37429
  item.delta
37390
37430
  ] });
37391
37431
  };
37392
- var KPIStatsCard = import_react65.default.memo(
37432
+ var KPIStatsCard = import_react66.default.memo(
37393
37433
  ({ title, subtitle, stats, items, theme, className, onAction: _onAction }) => {
37394
37434
  const s = th(theme);
37395
37435
  const displayStats = stats || items || [];
@@ -37449,7 +37489,7 @@ var KPIStatsCard = import_react65.default.memo(
37449
37489
  KPIStatsCard.displayName = "KPIStatsCard";
37450
37490
 
37451
37491
  // src/molecules/generic/ApprovalCard/ApprovalCard.tsx
37452
- var import_react66 = __toESM(require("react"), 1);
37492
+ var import_react67 = __toESM(require("react"), 1);
37453
37493
  var import_jsx_runtime125 = require("react/jsx-runtime");
37454
37494
  var STATUS_CONFIG2 = {
37455
37495
  pending: { label: "Pending Review", icon: Clock, className: "text-yellow-400 bg-yellow-500/10 border-yellow-500/20" },
@@ -37457,7 +37497,7 @@ var STATUS_CONFIG2 = {
37457
37497
  rejected: { label: "Rejected", icon: CircleX, className: "text-rose-400 bg-rose-500/10 border-rose-500/20" },
37458
37498
  changes_requested: { label: "Changes Requested", icon: MessageSquare, className: "text-blue-400 bg-blue-500/10 border-blue-500/20" }
37459
37499
  };
37460
- var ApprovalCard = import_react66.default.memo(
37500
+ var ApprovalCard = import_react67.default.memo(
37461
37501
  ({
37462
37502
  title,
37463
37503
  description,
@@ -37475,9 +37515,9 @@ var ApprovalCard = import_react66.default.memo(
37475
37515
  onAction
37476
37516
  }) => {
37477
37517
  const s = th(theme);
37478
- const [status, setStatus] = import_react66.default.useState(propStatus || "pending");
37479
- const [isSubmitted, setIsSubmitted] = import_react66.default.useState(!!propStatus && propStatus !== "pending");
37480
- import_react66.default.useEffect(() => {
37518
+ const [status, setStatus] = import_react67.default.useState(propStatus || "pending");
37519
+ const [isSubmitted, setIsSubmitted] = import_react67.default.useState(!!propStatus && propStatus !== "pending");
37520
+ import_react67.default.useEffect(() => {
37481
37521
  if (propStatus) {
37482
37522
  setStatus(propStatus);
37483
37523
  setIsSubmitted(propStatus !== "pending");
@@ -37565,7 +37605,7 @@ var ApprovalCard = import_react66.default.memo(
37565
37605
  ApprovalCard.displayName = "ApprovalCard";
37566
37606
 
37567
37607
  // src/molecules/generic/TimelineCard/TimelineCard.tsx
37568
- var import_react67 = __toESM(require("react"), 1);
37608
+ var import_react68 = __toESM(require("react"), 1);
37569
37609
  var import_jsx_runtime126 = require("react/jsx-runtime");
37570
37610
  var StepDot = ({ step, accentColor }) => {
37571
37611
  if (step.status === "completed") return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-emerald-500/20 ring-2 ring-emerald-500/40", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Check, { className: "h-3 w-3 text-emerald-400", strokeWidth: 2.5 }) });
@@ -37583,7 +37623,7 @@ var StepDot = ({ step, accentColor }) => {
37583
37623
  }
37584
37624
  return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-gray400/20 ring-2 ring-gray400/20", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Circle, { className: "h-2.5 w-2.5 text-cardText/20" }) });
37585
37625
  };
37586
- var TimelineCard = import_react67.default.memo(
37626
+ var TimelineCard = import_react68.default.memo(
37587
37627
  ({ title, steps, milestones, theme, className, onAction: _onAction }) => {
37588
37628
  const s = th(theme);
37589
37629
  const displaySteps = steps || milestones || [];
@@ -37641,9 +37681,9 @@ var TimelineCard = import_react67.default.memo(
37641
37681
  TimelineCard.displayName = "TimelineCard";
37642
37682
 
37643
37683
  // src/molecules/generic/FeedbackRatingCard/FeedbackRatingCard.tsx
37644
- var import_react68 = __toESM(require("react"), 1);
37684
+ var import_react69 = __toESM(require("react"), 1);
37645
37685
  var import_jsx_runtime127 = require("react/jsx-runtime");
37646
- var FeedbackRatingCard = import_react68.default.memo(
37686
+ var FeedbackRatingCard = import_react69.default.memo(
37647
37687
  ({
37648
37688
  question,
37649
37689
  max_rating = 5,
@@ -37659,10 +37699,10 @@ var FeedbackRatingCard = import_react68.default.memo(
37659
37699
  onAction
37660
37700
  }) => {
37661
37701
  const s = th(theme);
37662
- const [rating, setRating] = import_react68.default.useState(0);
37663
- const [hovered, setHovered] = import_react68.default.useState(0);
37664
- const [comment, setComment] = import_react68.default.useState("");
37665
- const [isSubmitted, setIsSubmitted] = import_react68.default.useState(false);
37702
+ const [rating, setRating] = import_react69.default.useState(0);
37703
+ const [hovered, setHovered] = import_react69.default.useState(0);
37704
+ const [comment, setComment] = import_react69.default.useState("");
37705
+ const [isSubmitted, setIsSubmitted] = import_react69.default.useState(false);
37666
37706
  const isInteractive = isLatestMessage && !disabled && !isSubmitted;
37667
37707
  const stars = Array.from({ length: max_rating }, (_, i) => i + 1);
37668
37708
  const handleSubmit = (e) => {
@@ -37741,9 +37781,9 @@ Feedback: ${comment}` : `Rating: ${rating}/${max_rating} ${label}`;
37741
37781
  FeedbackRatingCard.displayName = "FeedbackRatingCard";
37742
37782
 
37743
37783
  // src/molecules/generic/DataTableCard/DataTableCard.tsx
37744
- var import_react69 = __toESM(require("react"), 1);
37784
+ var import_react70 = __toESM(require("react"), 1);
37745
37785
  var import_jsx_runtime128 = require("react/jsx-runtime");
37746
- var DataTableCard = import_react69.default.memo(
37786
+ var DataTableCard = import_react70.default.memo(
37747
37787
  ({ title, caption, columns, rows, highlight_column, theme, className, onAction: _onAction }) => {
37748
37788
  const s = th(theme);
37749
37789
  return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: cn("w-full rounded-[16px] border border-gray400 bg-cardSurface overflow-hidden", className), style: s.root, children: [
@@ -37793,9 +37833,9 @@ var DataTableCard = import_react69.default.memo(
37793
37833
  DataTableCard.displayName = "DataTableCard";
37794
37834
 
37795
37835
  // src/molecules/generic/ChecklistCard/ChecklistCard.tsx
37796
- var import_react70 = __toESM(require("react"), 1);
37836
+ var import_react71 = __toESM(require("react"), 1);
37797
37837
  var import_jsx_runtime129 = require("react/jsx-runtime");
37798
- var ChecklistCard = import_react70.default.memo(
37838
+ var ChecklistCard = import_react71.default.memo(
37799
37839
  ({
37800
37840
  title,
37801
37841
  description,
@@ -37812,10 +37852,10 @@ var ChecklistCard = import_react70.default.memo(
37812
37852
  }) => {
37813
37853
  const s = th(theme);
37814
37854
  const source = items || tasks || [];
37815
- const [checked, setChecked] = import_react70.default.useState(
37855
+ const [checked, setChecked] = import_react71.default.useState(
37816
37856
  () => new Set(source.filter((i) => i.checked).map((i) => i.id))
37817
37857
  );
37818
- const [isSubmitted, setIsSubmitted] = import_react70.default.useState(false);
37858
+ const [isSubmitted, setIsSubmitted] = import_react71.default.useState(false);
37819
37859
  const isInteractive = isLatestMessage && !disabled && !isSubmitted;
37820
37860
  const toggle = (id) => {
37821
37861
  if (!isInteractive) return;
@@ -37928,9 +37968,9 @@ var ChecklistCard = import_react70.default.memo(
37928
37968
  ChecklistCard.displayName = "ChecklistCard";
37929
37969
 
37930
37970
  // src/molecules/generic/PollCard/PollCard.tsx
37931
- var import_react71 = __toESM(require("react"), 1);
37971
+ var import_react72 = __toESM(require("react"), 1);
37932
37972
  var import_jsx_runtime130 = require("react/jsx-runtime");
37933
- var PollCard = import_react71.default.memo(
37973
+ var PollCard = import_react72.default.memo(
37934
37974
  ({
37935
37975
  question,
37936
37976
  options,
@@ -37947,9 +37987,9 @@ var PollCard = import_react71.default.memo(
37947
37987
  }) => {
37948
37988
  const s = th(theme);
37949
37989
  const source = options || choices || [];
37950
- const [selected, setSelected] = import_react71.default.useState(/* @__PURE__ */ new Set());
37951
- const [hasVoted, setHasVoted] = import_react71.default.useState(false);
37952
- const [voteCounts, setVoteCounts] = import_react71.default.useState(
37990
+ const [selected, setSelected] = import_react72.default.useState(/* @__PURE__ */ new Set());
37991
+ const [hasVoted, setHasVoted] = import_react72.default.useState(false);
37992
+ const [voteCounts, setVoteCounts] = import_react72.default.useState(
37953
37993
  () => Object.fromEntries(source.map((o) => [o.id, o.votes ?? 0]))
37954
37994
  );
37955
37995
  const isInteractive = isLatestMessage && !disabled && !hasVoted;
@@ -38088,7 +38128,7 @@ Selected: ${labels.join(", ")}`);
38088
38128
  PollCard.displayName = "PollCard";
38089
38129
 
38090
38130
  // src/molecules/generic/CalendarEventCard/CalendarEventCard.tsx
38091
- var import_react72 = __toESM(require("react"), 1);
38131
+ var import_react73 = __toESM(require("react"), 1);
38092
38132
  var import_jsx_runtime131 = require("react/jsx-runtime");
38093
38133
  var STATUS_STYLES = {
38094
38134
  upcoming: { label: "Upcoming", className: "text-blue-400 bg-blue-500/10 border-blue-500/20", dot: "bg-blue-400" },
@@ -38109,7 +38149,7 @@ function AvatarInitials({ name }) {
38109
38149
  }
38110
38150
  );
38111
38151
  }
38112
- var CalendarEventCard = import_react72.default.memo(
38152
+ var CalendarEventCard = import_react73.default.memo(
38113
38153
  ({
38114
38154
  title,
38115
38155
  date,
@@ -38126,7 +38166,7 @@ var CalendarEventCard = import_react72.default.memo(
38126
38166
  }) => {
38127
38167
  const s = th(theme);
38128
38168
  const cfg = STATUS_STYLES[status];
38129
- const parsedDate = import_react72.default.useMemo(() => {
38169
+ const parsedDate = import_react73.default.useMemo(() => {
38130
38170
  try {
38131
38171
  const d = new Date(date);
38132
38172
  if (isNaN(d.getTime())) {
@@ -38212,7 +38252,7 @@ var CalendarEventCard = import_react72.default.memo(
38212
38252
  CalendarEventCard.displayName = "CalendarEventCard";
38213
38253
 
38214
38254
  // src/molecules/generic/BudgetAllocCard/BudgetAllocCard.tsx
38215
- var import_react73 = __toESM(require("react"), 1);
38255
+ var import_react74 = __toESM(require("react"), 1);
38216
38256
  var import_jsx_runtime132 = require("react/jsx-runtime");
38217
38257
  var PALETTE = [
38218
38258
  "#BFAD82",
@@ -38238,7 +38278,7 @@ function formatAmount(amount, currency) {
38238
38278
  if (amount >= 1e3) return `${currency}${(amount / 1e3).toFixed(0)}K`;
38239
38279
  return `${currency}${amount.toLocaleString()}`;
38240
38280
  }
38241
- var BudgetAllocCard = import_react73.default.memo(
38281
+ var BudgetAllocCard = import_react74.default.memo(
38242
38282
  ({
38243
38283
  title,
38244
38284
  currency = "$",
@@ -38355,7 +38395,7 @@ var BudgetAllocCard = import_react73.default.memo(
38355
38395
  BudgetAllocCard.displayName = "BudgetAllocCard";
38356
38396
 
38357
38397
  // src/molecules/generic/ComparisonCard/ComparisonCard.tsx
38358
- var import_react74 = __toESM(require("react"), 1);
38398
+ var import_react75 = __toESM(require("react"), 1);
38359
38399
  var import_jsx_runtime133 = require("react/jsx-runtime");
38360
38400
  var BADGE_COLORS = {
38361
38401
  gold: "text-gold border-gold/30 bg-gold/10",
@@ -38363,7 +38403,7 @@ var BADGE_COLORS = {
38363
38403
  emerald: "text-emerald-400 border-emerald-500/30 bg-emerald-500/10",
38364
38404
  violet: "text-violet-400 border-violet-500/30 bg-violet-500/10"
38365
38405
  };
38366
- var ComparisonCard = import_react74.default.memo(
38406
+ var ComparisonCard = import_react75.default.memo(
38367
38407
  ({
38368
38408
  title,
38369
38409
  description,
@@ -38378,8 +38418,8 @@ var ComparisonCard = import_react74.default.memo(
38378
38418
  onAction
38379
38419
  }) => {
38380
38420
  const s = th(theme);
38381
- const [selected, setSelected] = import_react74.default.useState(null);
38382
- const [isSubmitted, setIsSubmitted] = import_react74.default.useState(false);
38421
+ const [selected, setSelected] = import_react75.default.useState(null);
38422
+ const [isSubmitted, setIsSubmitted] = import_react75.default.useState(false);
38383
38423
  const isInteractive = isLatestMessage && !disabled && !isSubmitted;
38384
38424
  const handleSelect = (opt) => (e) => {
38385
38425
  e.preventDefault();
@@ -38974,7 +39014,7 @@ var NextStepCard = ({
38974
39014
  ] });
38975
39015
 
38976
39016
  // src/molecules/generic/PresentationJobCard/PresentationJobCard.tsx
38977
- var import_react75 = require("react");
39017
+ var import_react76 = require("react");
38978
39018
  var import_jsx_runtime147 = require("react/jsx-runtime");
38979
39019
  var DownloadIcon = () => /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
38980
39020
  /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
@@ -39031,7 +39071,7 @@ var FORMATS = [
39031
39071
  var ExportModal = ({ formats, title, onClose }) => {
39032
39072
  const available = FORMATS.filter((f) => formats[f.key]);
39033
39073
  const filename = title.replace(/[^a-z0-9]/gi, "-").toLowerCase();
39034
- const [downloadingKey, setDownloadingKey] = (0, import_react75.useState)(null);
39074
+ const [downloadingKey, setDownloadingKey] = (0, import_react76.useState)(null);
39035
39075
  const handleDownload = async (fmtKey, url, ext) => {
39036
39076
  if (downloadingKey) return;
39037
39077
  const downloadName = `${filename}${ext}`;
@@ -39099,10 +39139,10 @@ var ExportModal = ({ formats, title, onClose }) => {
39099
39139
  ] });
39100
39140
  };
39101
39141
  var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) => {
39102
- const [currentSlide, setCurrentSlide] = (0, import_react75.useState)(initialSlide);
39103
- const [iframeReady, setIframeReady] = (0, import_react75.useState)(false);
39104
- const iframeRef = (0, import_react75.useRef)(null);
39105
- (0, import_react75.useEffect)(() => {
39142
+ const [currentSlide, setCurrentSlide] = (0, import_react76.useState)(initialSlide);
39143
+ const [iframeReady, setIframeReady] = (0, import_react76.useState)(false);
39144
+ const iframeRef = (0, import_react76.useRef)(null);
39145
+ (0, import_react76.useEffect)(() => {
39106
39146
  const onKey = (e) => {
39107
39147
  if (e.key === "Escape") onClose();
39108
39148
  };
@@ -39120,7 +39160,7 @@ var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) =>
39120
39160
  window.removeEventListener("message", onMsg);
39121
39161
  };
39122
39162
  }, [onClose, iframeReady]);
39123
- (0, import_react75.useEffect)(() => {
39163
+ (0, import_react76.useEffect)(() => {
39124
39164
  document.body.style.overflow = "hidden";
39125
39165
  return () => {
39126
39166
  document.body.style.overflow = "";
@@ -39215,46 +39255,46 @@ var PresentationJobCard = ({
39215
39255
  onComplete,
39216
39256
  onFailed
39217
39257
  }) => {
39218
- const [status, setStatus] = (0, import_react75.useState)(initialStatus);
39219
- const [title, setTitle] = (0, import_react75.useState)(initialTitle);
39220
- const [slideCount, setSlideCount] = (0, import_react75.useState)(initialSlideCount ?? 0);
39221
- const [formats, setFormats] = (0, import_react75.useState)(initialFormats);
39222
- const [error, setError] = (0, import_react75.useState)(initialError);
39223
- const [progress, setProgress] = (0, import_react75.useState)(initialProgress);
39224
- const [showExport, setShowExport] = (0, import_react75.useState)(false);
39225
- const [showFullscreen, setShowFullscreen] = (0, import_react75.useState)(false);
39226
- const [copied, setCopied] = (0, import_react75.useState)(false);
39227
- const [currentSlide, setCurrentSlide] = (0, import_react75.useState)(1);
39228
- const [previewScale, setPreviewScale] = (0, import_react75.useState)(1);
39229
- const [iframeReady, setIframeReady] = (0, import_react75.useState)(false);
39230
- const intervalRef = (0, import_react75.useRef)(null);
39231
- const previewRef = (0, import_react75.useRef)(null);
39232
- const iframeRef = (0, import_react75.useRef)(null);
39233
- (0, import_react75.useEffect)(() => {
39258
+ const [status, setStatus] = (0, import_react76.useState)(initialStatus);
39259
+ const [title, setTitle] = (0, import_react76.useState)(initialTitle);
39260
+ const [slideCount, setSlideCount] = (0, import_react76.useState)(initialSlideCount ?? 0);
39261
+ const [formats, setFormats] = (0, import_react76.useState)(initialFormats);
39262
+ const [error, setError] = (0, import_react76.useState)(initialError);
39263
+ const [progress, setProgress] = (0, import_react76.useState)(initialProgress);
39264
+ const [showExport, setShowExport] = (0, import_react76.useState)(false);
39265
+ const [showFullscreen, setShowFullscreen] = (0, import_react76.useState)(false);
39266
+ const [copied, setCopied] = (0, import_react76.useState)(false);
39267
+ const [currentSlide, setCurrentSlide] = (0, import_react76.useState)(1);
39268
+ const [previewScale, setPreviewScale] = (0, import_react76.useState)(1);
39269
+ const [iframeReady, setIframeReady] = (0, import_react76.useState)(false);
39270
+ const intervalRef = (0, import_react76.useRef)(null);
39271
+ const previewRef = (0, import_react76.useRef)(null);
39272
+ const iframeRef = (0, import_react76.useRef)(null);
39273
+ (0, import_react76.useEffect)(() => {
39234
39274
  setStatus(initialStatus);
39235
39275
  }, [initialStatus]);
39236
39276
  const progressPct = initialProgress?.percentage;
39237
39277
  const progressStep = initialProgress?.current_step;
39238
- (0, import_react75.useEffect)(() => {
39278
+ (0, import_react76.useEffect)(() => {
39239
39279
  if (initialProgress) setProgress(initialProgress);
39240
39280
  }, [progressPct, progressStep]);
39241
- (0, import_react75.useEffect)(() => {
39281
+ (0, import_react76.useEffect)(() => {
39242
39282
  if (initialError) setError(initialError);
39243
39283
  }, [initialError]);
39244
- (0, import_react75.useEffect)(() => {
39284
+ (0, import_react76.useEffect)(() => {
39245
39285
  if (initialSlideCount !== void 0) setSlideCount(initialSlideCount);
39246
39286
  }, [initialSlideCount]);
39247
39287
  const htmlUrl = initialFormats?.html_url;
39248
- (0, import_react75.useEffect)(() => {
39288
+ (0, import_react76.useEffect)(() => {
39249
39289
  if (initialFormats) setFormats(initialFormats);
39250
39290
  }, [htmlUrl]);
39251
- (0, import_react75.useEffect)(() => {
39291
+ (0, import_react76.useEffect)(() => {
39252
39292
  if (initialTitle) setTitle(initialTitle);
39253
39293
  }, [initialTitle]);
39254
- const updateScale = (0, import_react75.useCallback)(() => {
39294
+ const updateScale = (0, import_react76.useCallback)(() => {
39255
39295
  if (previewRef.current) setPreviewScale(previewRef.current.offsetWidth / 1280);
39256
39296
  }, []);
39257
- (0, import_react75.useEffect)(() => {
39297
+ (0, import_react76.useEffect)(() => {
39258
39298
  updateScale();
39259
39299
  setIframeReady(false);
39260
39300
  if (typeof ResizeObserver === "undefined") return;
@@ -39262,7 +39302,7 @@ var PresentationJobCard = ({
39262
39302
  if (previewRef.current) ro.observe(previewRef.current);
39263
39303
  return () => ro.disconnect();
39264
39304
  }, [updateScale, formats.html_url]);
39265
- (0, import_react75.useEffect)(() => {
39305
+ (0, import_react76.useEffect)(() => {
39266
39306
  const handler = (e) => {
39267
39307
  if (e.data?.type === "slideChanged") {
39268
39308
  setCurrentSlide(e.data.slide);
@@ -39287,12 +39327,12 @@ var PresentationJobCard = ({
39287
39327
  iframe.contentWindow.postMessage({ type: command }, "*");
39288
39328
  };
39289
39329
  const isTerminal = status === "complete" || status === "failed";
39290
- const onCompleteRef = (0, import_react75.useRef)(onComplete);
39291
- const onFailedRef = (0, import_react75.useRef)(onFailed);
39292
- const hasNotifiedRef = (0, import_react75.useRef)(false);
39330
+ const onCompleteRef = (0, import_react76.useRef)(onComplete);
39331
+ const onFailedRef = (0, import_react76.useRef)(onFailed);
39332
+ const hasNotifiedRef = (0, import_react76.useRef)(false);
39293
39333
  onCompleteRef.current = onComplete;
39294
39334
  onFailedRef.current = onFailed;
39295
- (0, import_react75.useEffect)(() => {
39335
+ (0, import_react76.useEffect)(() => {
39296
39336
  if (isTerminal || !pollUrl) return;
39297
39337
  const poll = async () => {
39298
39338
  try {
@@ -39341,7 +39381,7 @@ var PresentationJobCard = ({
39341
39381
  if (intervalRef.current) clearInterval(intervalRef.current);
39342
39382
  };
39343
39383
  }, [isTerminal, pollUrl, authToken, initialTitle]);
39344
- (0, import_react75.useEffect)(() => {
39384
+ (0, import_react76.useEffect)(() => {
39345
39385
  if (isTerminal && intervalRef.current) {
39346
39386
  clearInterval(intervalRef.current);
39347
39387
  intervalRef.current = null;
@@ -39599,7 +39639,7 @@ var PresentationJobCard = ({
39599
39639
  };
39600
39640
 
39601
39641
  // src/molecules/generic/ResearchReportJobCard/ResearchReportJobCard.tsx
39602
- var import_react76 = require("react");
39642
+ var import_react77 = require("react");
39603
39643
  var import_jsx_runtime148 = require("react/jsx-runtime");
39604
39644
  var DEFAULT_THEME = {
39605
39645
  primary: "#8b5cf6",
@@ -39629,14 +39669,14 @@ var ExpandIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("svg", {
39629
39669
  /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("line", { x1: "3", y1: "21", x2: "10", y2: "14" })
39630
39670
  ] });
39631
39671
  var FullscreenPreviewModal = ({ url, title, onClose }) => {
39632
- (0, import_react76.useEffect)(() => {
39672
+ (0, import_react77.useEffect)(() => {
39633
39673
  const onKey = (e) => {
39634
39674
  if (e.key === "Escape") onClose();
39635
39675
  };
39636
39676
  document.addEventListener("keydown", onKey);
39637
39677
  return () => document.removeEventListener("keydown", onKey);
39638
39678
  }, [onClose]);
39639
- (0, import_react76.useEffect)(() => {
39679
+ (0, import_react77.useEffect)(() => {
39640
39680
  document.body.style.overflow = "hidden";
39641
39681
  return () => {
39642
39682
  document.body.style.overflow = "";
@@ -39695,79 +39735,79 @@ var ResearchReportJobCard = (props) => {
39695
39735
  compact = false
39696
39736
  } = props;
39697
39737
  const inferredStatus = initialStatus ?? (initialHtmlUrl ? "complete" : void 0);
39698
- const [status, setStatus] = (0, import_react76.useState)(inferredStatus);
39699
- const [title, setTitle] = (0, import_react76.useState)(initialTitle);
39700
- const [depth, setDepth] = (0, import_react76.useState)(initialDepth || "");
39701
- const [sectionCount, setSectionCount] = (0, import_react76.useState)(initialSectionCount ?? 0);
39702
- const [sourceCount, setSourceCount] = (0, import_react76.useState)(initialSourceCount ?? 0);
39703
- const [wordCount, setWordCount] = (0, import_react76.useState)(initialWordCount ?? 0);
39704
- const [summary, setSummary] = (0, import_react76.useState)(initialSummary || "");
39705
- const [htmlUrl, setHtmlUrl] = (0, import_react76.useState)(initialHtmlUrl || "");
39706
- const [theme, setTheme] = (0, import_react76.useState)(initialTheme || DEFAULT_THEME);
39707
- const [error, setError] = (0, import_react76.useState)(initialError);
39708
- const [progress, setProgress] = (0, import_react76.useState)(initialProgress);
39709
- const [showPreview, setShowPreview] = (0, import_react76.useState)(false);
39710
- const [previewScale, setPreviewScale] = (0, import_react76.useState)(1);
39711
- const previewRef = (0, import_react76.useRef)(null);
39712
- const intervalRef = (0, import_react76.useRef)(null);
39713
- const onCompleteRef = (0, import_react76.useRef)(onComplete);
39714
- const onFailedRef = (0, import_react76.useRef)(onFailed);
39715
- const hasNotifiedRef = (0, import_react76.useRef)(false);
39738
+ const [status, setStatus] = (0, import_react77.useState)(inferredStatus);
39739
+ const [title, setTitle] = (0, import_react77.useState)(initialTitle);
39740
+ const [depth, setDepth] = (0, import_react77.useState)(initialDepth || "");
39741
+ const [sectionCount, setSectionCount] = (0, import_react77.useState)(initialSectionCount ?? 0);
39742
+ const [sourceCount, setSourceCount] = (0, import_react77.useState)(initialSourceCount ?? 0);
39743
+ const [wordCount, setWordCount] = (0, import_react77.useState)(initialWordCount ?? 0);
39744
+ const [summary, setSummary] = (0, import_react77.useState)(initialSummary || "");
39745
+ const [htmlUrl, setHtmlUrl] = (0, import_react77.useState)(initialHtmlUrl || "");
39746
+ const [theme, setTheme] = (0, import_react77.useState)(initialTheme || DEFAULT_THEME);
39747
+ const [error, setError] = (0, import_react77.useState)(initialError);
39748
+ const [progress, setProgress] = (0, import_react77.useState)(initialProgress);
39749
+ const [showPreview, setShowPreview] = (0, import_react77.useState)(false);
39750
+ const [previewScale, setPreviewScale] = (0, import_react77.useState)(1);
39751
+ const previewRef = (0, import_react77.useRef)(null);
39752
+ const intervalRef = (0, import_react77.useRef)(null);
39753
+ const onCompleteRef = (0, import_react77.useRef)(onComplete);
39754
+ const onFailedRef = (0, import_react77.useRef)(onFailed);
39755
+ const hasNotifiedRef = (0, import_react77.useRef)(false);
39716
39756
  onCompleteRef.current = onComplete;
39717
39757
  onFailedRef.current = onFailed;
39718
- (0, import_react76.useEffect)(() => {
39758
+ (0, import_react77.useEffect)(() => {
39719
39759
  const newStatus = initialStatus ?? (initialHtmlUrl ? "complete" : void 0);
39720
39760
  setStatus(newStatus);
39721
39761
  }, [initialStatus, initialHtmlUrl]);
39722
- (0, import_react76.useEffect)(() => {
39762
+ (0, import_react77.useEffect)(() => {
39723
39763
  if (initialTitle) setTitle(initialTitle);
39724
39764
  }, [initialTitle]);
39725
- (0, import_react76.useEffect)(() => {
39765
+ (0, import_react77.useEffect)(() => {
39726
39766
  if (initialHtmlUrl) setHtmlUrl(initialHtmlUrl);
39727
39767
  }, [initialHtmlUrl]);
39728
- (0, import_react76.useEffect)(() => {
39768
+ (0, import_react77.useEffect)(() => {
39729
39769
  if (initialDepth) setDepth(initialDepth);
39730
39770
  }, [initialDepth]);
39731
- (0, import_react76.useEffect)(() => {
39771
+ (0, import_react77.useEffect)(() => {
39732
39772
  if (initialSectionCount !== void 0) setSectionCount(initialSectionCount);
39733
39773
  }, [initialSectionCount]);
39734
- (0, import_react76.useEffect)(() => {
39774
+ (0, import_react77.useEffect)(() => {
39735
39775
  if (initialSourceCount !== void 0) setSourceCount(initialSourceCount);
39736
39776
  }, [initialSourceCount]);
39737
- (0, import_react76.useEffect)(() => {
39777
+ (0, import_react77.useEffect)(() => {
39738
39778
  if (initialWordCount !== void 0) setWordCount(initialWordCount);
39739
39779
  }, [initialWordCount]);
39740
- (0, import_react76.useEffect)(() => {
39780
+ (0, import_react77.useEffect)(() => {
39741
39781
  if (initialSummary) setSummary(initialSummary);
39742
39782
  }, [initialSummary]);
39743
39783
  const themePrimary = initialTheme?.primary;
39744
- (0, import_react76.useEffect)(() => {
39784
+ (0, import_react77.useEffect)(() => {
39745
39785
  if (initialTheme) setTheme(initialTheme);
39746
39786
  }, [themePrimary]);
39747
- (0, import_react76.useEffect)(() => {
39787
+ (0, import_react77.useEffect)(() => {
39748
39788
  if (initialError) setError(initialError);
39749
39789
  }, [initialError]);
39750
39790
  const progressPct = initialProgress?.percentage;
39751
39791
  const progressStep = initialProgress?.current_step;
39752
- (0, import_react76.useEffect)(() => {
39792
+ (0, import_react77.useEffect)(() => {
39753
39793
  if (initialProgress) setProgress(initialProgress);
39754
39794
  }, [progressPct, progressStep]);
39755
39795
  const isTerminal = status === "complete" || status === "failed";
39756
39796
  const primaryColor = theme?.primary || DEFAULT_THEME.primary;
39757
39797
  const hasHTML = Boolean(htmlUrl);
39758
- const updateScale = (0, import_react76.useCallback)(() => {
39798
+ const updateScale = (0, import_react77.useCallback)(() => {
39759
39799
  if (previewRef.current) {
39760
39800
  setPreviewScale(previewRef.current.offsetWidth / 800);
39761
39801
  }
39762
39802
  }, []);
39763
- (0, import_react76.useEffect)(() => {
39803
+ (0, import_react77.useEffect)(() => {
39764
39804
  updateScale();
39765
39805
  if (typeof ResizeObserver === "undefined") return;
39766
39806
  const ro = new ResizeObserver(updateScale);
39767
39807
  if (previewRef.current) ro.observe(previewRef.current);
39768
39808
  return () => ro.disconnect();
39769
39809
  }, [updateScale, htmlUrl]);
39770
- (0, import_react76.useEffect)(() => {
39810
+ (0, import_react77.useEffect)(() => {
39771
39811
  if (isTerminal || !pollUrl) return;
39772
39812
  const poll = async () => {
39773
39813
  try {
@@ -39817,7 +39857,7 @@ var ResearchReportJobCard = (props) => {
39817
39857
  if (intervalRef.current) clearInterval(intervalRef.current);
39818
39858
  };
39819
39859
  }, [isTerminal, pollUrl, authToken, initialTitle]);
39820
- (0, import_react76.useEffect)(() => {
39860
+ (0, import_react77.useEffect)(() => {
39821
39861
  if (isTerminal && intervalRef.current) {
39822
39862
  clearInterval(intervalRef.current);
39823
39863
  intervalRef.current = null;
@@ -40088,7 +40128,7 @@ var ResearchReportJobCard = (props) => {
40088
40128
  };
40089
40129
 
40090
40130
  // src/molecules/generic/WebSearchJobCard/WebSearchJobCard.tsx
40091
- var import_react77 = require("react");
40131
+ var import_react78 = require("react");
40092
40132
  var import_jsx_runtime149 = require("react/jsx-runtime");
40093
40133
  var SearchIcon = () => /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
40094
40134
  /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
@@ -40109,6 +40149,7 @@ var WebSearchJobCard = ({
40109
40149
  summary: initialSummary,
40110
40150
  results: initialResults,
40111
40151
  error: initialError,
40152
+ progress: initialProgress,
40112
40153
  pollUrl,
40113
40154
  authToken,
40114
40155
  className,
@@ -40116,45 +40157,51 @@ var WebSearchJobCard = ({
40116
40157
  onFailed,
40117
40158
  compact = false
40118
40159
  }) => {
40119
- const [status, setStatus] = (0, import_react77.useState)(initialStatus);
40120
- const [query, setQuery] = (0, import_react77.useState)(initialQuery || initialTitle || "");
40121
- const [resultCount, setResultCount] = (0, import_react77.useState)(initialResultCount ?? 0);
40122
- const [searchCount, setSearchCount] = (0, import_react77.useState)(initialSearchCount ?? 0);
40123
- const [summary, setSummary] = (0, import_react77.useState)(initialSummary || "");
40124
- const [results, setResults] = (0, import_react77.useState)(initialResults || []);
40125
- const [error, setError] = (0, import_react77.useState)(initialError);
40126
- const intervalRef = (0, import_react77.useRef)(null);
40127
- const onCompleteRef = (0, import_react77.useRef)(onComplete);
40128
- const onFailedRef = (0, import_react77.useRef)(onFailed);
40129
- const hasNotifiedRef = (0, import_react77.useRef)(false);
40160
+ const [status, setStatus] = (0, import_react78.useState)(initialStatus);
40161
+ const [query, setQuery] = (0, import_react78.useState)(initialQuery || initialTitle || "");
40162
+ const [resultCount, setResultCount] = (0, import_react78.useState)(initialResultCount ?? 0);
40163
+ const [searchCount, setSearchCount] = (0, import_react78.useState)(initialSearchCount ?? 0);
40164
+ const [summary, setSummary] = (0, import_react78.useState)(initialSummary || "");
40165
+ const [results, setResults] = (0, import_react78.useState)(initialResults || []);
40166
+ const [error, setError] = (0, import_react78.useState)(initialError);
40167
+ const [progress, setProgress] = (0, import_react78.useState)(initialProgress);
40168
+ const intervalRef = (0, import_react78.useRef)(null);
40169
+ const onCompleteRef = (0, import_react78.useRef)(onComplete);
40170
+ const onFailedRef = (0, import_react78.useRef)(onFailed);
40171
+ const hasNotifiedRef = (0, import_react78.useRef)(false);
40130
40172
  onCompleteRef.current = onComplete;
40131
40173
  onFailedRef.current = onFailed;
40132
- (0, import_react77.useEffect)(() => {
40174
+ (0, import_react78.useEffect)(() => {
40133
40175
  setStatus(initialStatus);
40134
40176
  }, [initialStatus]);
40135
- (0, import_react77.useEffect)(() => {
40177
+ (0, import_react78.useEffect)(() => {
40136
40178
  if (initialQuery) setQuery(initialQuery);
40137
40179
  }, [initialQuery]);
40138
- (0, import_react77.useEffect)(() => {
40180
+ (0, import_react78.useEffect)(() => {
40139
40181
  if (initialTitle && !initialQuery) setQuery(initialTitle);
40140
40182
  }, [initialTitle, initialQuery]);
40141
- (0, import_react77.useEffect)(() => {
40183
+ (0, import_react78.useEffect)(() => {
40142
40184
  if (initialResultCount !== void 0) setResultCount(initialResultCount);
40143
40185
  }, [initialResultCount]);
40144
- (0, import_react77.useEffect)(() => {
40186
+ (0, import_react78.useEffect)(() => {
40145
40187
  if (initialSearchCount !== void 0) setSearchCount(initialSearchCount);
40146
40188
  }, [initialSearchCount]);
40147
- (0, import_react77.useEffect)(() => {
40189
+ (0, import_react78.useEffect)(() => {
40148
40190
  if (initialSummary) setSummary(initialSummary);
40149
40191
  }, [initialSummary]);
40150
- (0, import_react77.useEffect)(() => {
40192
+ (0, import_react78.useEffect)(() => {
40151
40193
  if (initialResults) setResults(initialResults);
40152
40194
  }, [initialResults]);
40153
- (0, import_react77.useEffect)(() => {
40195
+ (0, import_react78.useEffect)(() => {
40154
40196
  if (initialError) setError(initialError);
40155
40197
  }, [initialError]);
40198
+ const progressPct = initialProgress?.percentage;
40199
+ const progressStep = initialProgress?.current_step;
40200
+ (0, import_react78.useEffect)(() => {
40201
+ if (initialProgress) setProgress(initialProgress);
40202
+ }, [progressPct, progressStep]);
40156
40203
  const isTerminal = status === "complete" || status === "failed";
40157
- (0, import_react77.useEffect)(() => {
40204
+ (0, import_react78.useEffect)(() => {
40158
40205
  if (isTerminal || !pollUrl) return;
40159
40206
  const poll = async () => {
40160
40207
  try {
@@ -40165,6 +40212,9 @@ var WebSearchJobCard = ({
40165
40212
  const data = await res.json();
40166
40213
  const newStatus = data.status;
40167
40214
  setStatus(newStatus);
40215
+ if (data.progress) {
40216
+ setProgress(data.progress);
40217
+ }
40168
40218
  if (newStatus === "complete" && data.output) {
40169
40219
  const output = data.output;
40170
40220
  setQuery(output.query || "");
@@ -40194,38 +40244,94 @@ var WebSearchJobCard = ({
40194
40244
  if (intervalRef.current) clearInterval(intervalRef.current);
40195
40245
  };
40196
40246
  }, [isTerminal, pollUrl, authToken]);
40197
- (0, import_react77.useEffect)(() => {
40247
+ (0, import_react78.useEffect)(() => {
40198
40248
  if (isTerminal && intervalRef.current) {
40199
40249
  clearInterval(intervalRef.current);
40200
40250
  intervalRef.current = null;
40201
40251
  }
40202
40252
  }, [isTerminal]);
40203
40253
  if (status === "pending" || status === "running") {
40204
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "relative overflow-hidden rounded-xl border border-zinc-200/70 dark:border-zinc-800/70 bg-zinc-100 dark:bg-zinc-900", children: [
40205
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "p-5 space-y-3", children: [
40206
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex items-center gap-3", children: [
40207
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "w-10 h-10 rounded-xl bg-zinc-300 dark:bg-zinc-700 animate-pulse flex-shrink-0" }),
40208
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex-1 space-y-2", children: [
40209
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "h-[13px] w-[60%] rounded bg-zinc-300 dark:bg-zinc-700 animate-pulse" }),
40210
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "h-[10px] w-[25%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse", style: { animationDelay: "80ms" } })
40254
+ const pct = progress?.percentage ?? 0;
40255
+ const step = progress?.current_step ?? "Starting web search...";
40256
+ const details = progress?.details;
40257
+ const searchesCompleted = details?.searches_completed ?? 0;
40258
+ const searchesTotal = details?.searches_total ?? 0;
40259
+ const phase = details?.phase ?? progress?.step_type ?? "initializing";
40260
+ const getPhaseIcon = () => {
40261
+ switch (phase) {
40262
+ case "ai_generation":
40263
+ return "\u{1F50D}";
40264
+ case "processing":
40265
+ return "\u2699\uFE0F";
40266
+ case "uploading":
40267
+ return "\u2601\uFE0F";
40268
+ default:
40269
+ return "\u2728";
40270
+ }
40271
+ };
40272
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", children: [
40273
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
40274
+ "div",
40275
+ {
40276
+ className: "h-[3px]",
40277
+ style: {
40278
+ background: "linear-gradient(90deg, #d97706, #f59e0b, #d97706)",
40279
+ backgroundSize: "200% 100%",
40280
+ animation: "gradient-shift 2s ease-in-out infinite"
40281
+ }
40282
+ }
40283
+ ),
40284
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "p-5", children: [
40285
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex items-start gap-3", children: [
40286
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "w-10 h-10 rounded-xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "text-lg", children: getPhaseIcon() }) }),
40287
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex-1 min-w-0", children: [
40288
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", children: query || initialTitle || "Web Search" }),
40289
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("p", { className: "text-xs text-zinc-500 mt-0.5", children: "In progress" })
40211
40290
  ] })
40212
40291
  ] }),
40213
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "h-[9px] w-[85%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse", style: { animationDelay: "120ms" } }),
40214
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "h-[9px] w-[70%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse", style: { animationDelay: "160ms" } }),
40215
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "space-y-2 pt-1", children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
40216
- "div",
40217
- {
40218
- className: "rounded-xl border border-zinc-200 dark:border-zinc-800 p-3 space-y-1.5",
40219
- children: [
40220
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "h-[10px] w-[65%] rounded bg-zinc-300 dark:bg-zinc-700 animate-pulse", style: { animationDelay: `${200 + i * 80}ms` } }),
40221
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "h-[8px] w-[18%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse", style: { animationDelay: `${240 + i * 80}ms` } }),
40222
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "h-[8px] w-[90%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse", style: { animationDelay: `${280 + i * 80}ms` } })
40223
- ]
40224
- },
40225
- i
40226
- )) })
40227
- ] }),
40228
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "absolute inset-0 -translate-x-full animate-[shimmer_2s_ease-in-out_infinite] bg-gradient-to-r from-transparent via-white/10 to-transparent" })
40292
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "mt-4 space-y-3", children: [
40293
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "relative", children: [
40294
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "h-2 bg-zinc-800 rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
40295
+ "div",
40296
+ {
40297
+ className: "h-full rounded-full transition-all duration-500 ease-out",
40298
+ style: {
40299
+ width: `${Math.max(pct, 2)}%`,
40300
+ background: "linear-gradient(90deg, #d97706, #f59e0b)"
40301
+ }
40302
+ }
40303
+ ) }),
40304
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "absolute right-0 -top-5 text-xs text-zinc-500 font-medium tabular-nums", children: [
40305
+ pct,
40306
+ "%"
40307
+ ] })
40308
+ ] }),
40309
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex items-center gap-2", children: [
40310
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "w-2 h-2 rounded-full bg-amber-500 animate-pulse flex-shrink-0" }),
40311
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "text-xs text-zinc-400", children: step })
40312
+ ] }),
40313
+ phase === "ai_generation" && searchesTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "pt-1", children: [
40314
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex items-center justify-between mb-1.5", children: [
40315
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "text-xs text-zinc-500", children: "Web searches" }),
40316
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "text-xs text-zinc-500 tabular-nums", children: [
40317
+ searchesCompleted,
40318
+ "/",
40319
+ searchesTotal
40320
+ ] })
40321
+ ] }),
40322
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "flex gap-1", children: Array.from({ length: Math.min(searchesTotal, 20) }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
40323
+ "div",
40324
+ {
40325
+ className: cn(
40326
+ "flex-1 h-1 rounded-full transition-all duration-300",
40327
+ i < searchesCompleted ? "bg-amber-500" : i === searchesCompleted ? "bg-amber-500/50 animate-pulse" : "bg-zinc-700"
40328
+ )
40329
+ },
40330
+ i
40331
+ )) })
40332
+ ] })
40333
+ ] })
40334
+ ] })
40229
40335
  ] }) });
40230
40336
  }
40231
40337
  if (status === "failed") {
@@ -40282,10 +40388,10 @@ var WebSearchJobCard = ({
40282
40388
  };
40283
40389
 
40284
40390
  // src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx
40285
- var import_react79 = __toESM(require("react"), 1);
40391
+ var import_react80 = __toESM(require("react"), 1);
40286
40392
 
40287
40393
  // src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
40288
- var import_react78 = require("react");
40394
+ var import_react79 = require("react");
40289
40395
 
40290
40396
  // src/lib/countries.ts
40291
40397
  var countries = [
@@ -40497,10 +40603,10 @@ var CountrySelectEdit = ({
40497
40603
  value,
40498
40604
  onChange
40499
40605
  }) => {
40500
- const [isDropdownOpen, setIsDropdownOpen] = (0, import_react78.useState)(false);
40501
- const [searchTerm, setSearchTerm] = (0, import_react78.useState)("");
40502
- const dropdownRef = (0, import_react78.useRef)(null);
40503
- (0, import_react78.useEffect)(() => {
40606
+ const [isDropdownOpen, setIsDropdownOpen] = (0, import_react79.useState)(false);
40607
+ const [searchTerm, setSearchTerm] = (0, import_react79.useState)("");
40608
+ const dropdownRef = (0, import_react79.useRef)(null);
40609
+ (0, import_react79.useEffect)(() => {
40504
40610
  const handleClickOutside = (event) => {
40505
40611
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
40506
40612
  setIsDropdownOpen(false);
@@ -40509,7 +40615,7 @@ var CountrySelectEdit = ({
40509
40615
  document.addEventListener("mousedown", handleClickOutside);
40510
40616
  return () => document.removeEventListener("mousedown", handleClickOutside);
40511
40617
  }, []);
40512
- const inputValue = (0, import_react78.useMemo)(() => {
40618
+ const inputValue = (0, import_react79.useMemo)(() => {
40513
40619
  if (Array.isArray(value)) return value;
40514
40620
  if (typeof value === "string" && value.trim() !== "") {
40515
40621
  const foundCountry = countries.find(
@@ -40610,7 +40716,7 @@ var CountrySelectEdit = ({
40610
40716
  ] });
40611
40717
  };
40612
40718
  var CountrySelectDisplay = ({ value }) => {
40613
- const displayValues = (0, import_react78.useMemo)(() => {
40719
+ const displayValues = (0, import_react79.useMemo)(() => {
40614
40720
  if (Array.isArray(value)) return value;
40615
40721
  if (typeof value === "string" && value.trim() !== "") return [value];
40616
40722
  return [];
@@ -40786,7 +40892,7 @@ var PlatformSelectEdit = ({
40786
40892
  value,
40787
40893
  onChange
40788
40894
  }) => {
40789
- const selectedPlatforms = (0, import_react78.useMemo)(() => {
40895
+ const selectedPlatforms = (0, import_react79.useMemo)(() => {
40790
40896
  if (Array.isArray(value)) return value;
40791
40897
  if (typeof value === "string" && value.trim() !== "") {
40792
40898
  return value.split(",").map((s) => s.trim()).filter(Boolean);
@@ -40805,7 +40911,7 @@ var PlatformSelectEdit = ({
40805
40911
  onChange([...selectedPlatforms, platform]);
40806
40912
  }
40807
40913
  };
40808
- const options = (0, import_react78.useMemo)(() => {
40914
+ const options = (0, import_react79.useMemo)(() => {
40809
40915
  return DEFAULT_PLATFORMS;
40810
40916
  }, []);
40811
40917
  return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "flex flex-wrap gap-4 py-2", children: options.map((platform) => /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
@@ -40831,7 +40937,7 @@ var PlatformSelectEdit = ({
40831
40937
  )) });
40832
40938
  };
40833
40939
  var PlatformSelectDisplay = ({ value }) => {
40834
- const displayValues = (0, import_react78.useMemo)(() => {
40940
+ const displayValues = (0, import_react79.useMemo)(() => {
40835
40941
  if (Array.isArray(value)) return value;
40836
40942
  if (typeof value === "string" && value.trim() !== "") {
40837
40943
  return value.split(",").map((s) => s.trim()).filter(Boolean);
@@ -40991,7 +41097,7 @@ function buildCampaignSeedFields(data) {
40991
41097
  return generated;
40992
41098
  });
40993
41099
  }
40994
- var CampaignSeedCard = import_react79.default.memo(
41100
+ var CampaignSeedCard = import_react80.default.memo(
40995
41101
  ({
40996
41102
  selectionStatus,
40997
41103
  isLatestMessage = true,
@@ -41003,7 +41109,7 @@ var CampaignSeedCard = import_react79.default.memo(
41003
41109
  sendMessage,
41004
41110
  ...formCardProps
41005
41111
  }) => {
41006
- const fields = (0, import_react79.useMemo)(() => {
41112
+ const fields = (0, import_react80.useMemo)(() => {
41007
41113
  return providedFields || buildCampaignSeedFields(data);
41008
41114
  }, [providedFields, data]);
41009
41115
  const handleProceed = () => {
@@ -41037,7 +41143,7 @@ var CampaignSeedCard = import_react79.default.memo(
41037
41143
  CampaignSeedCard.displayName = "CampaignSeedCard";
41038
41144
 
41039
41145
  // src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx
41040
- var import_react80 = __toESM(require("react"), 1);
41146
+ var import_react81 = __toESM(require("react"), 1);
41041
41147
  var import_jsx_runtime152 = require("react/jsx-runtime");
41042
41148
  var ObjectDisplay2 = ({ value }) => {
41043
41149
  if (!value || typeof value !== "object") return null;
@@ -41153,7 +41259,7 @@ function buildSearchSpecFields(data) {
41153
41259
  return generated;
41154
41260
  });
41155
41261
  }
41156
- var SearchSpecCard = import_react80.default.memo(
41262
+ var SearchSpecCard = import_react81.default.memo(
41157
41263
  ({
41158
41264
  selectionStatus,
41159
41265
  isLatestMessage = true,
@@ -41167,7 +41273,7 @@ var SearchSpecCard = import_react80.default.memo(
41167
41273
  ...formCardProps
41168
41274
  }) => {
41169
41275
  const resolvedData = data || specData;
41170
- const fields = (0, import_react80.useMemo)(() => {
41276
+ const fields = (0, import_react81.useMemo)(() => {
41171
41277
  return providedFields || buildSearchSpecFields(resolvedData ?? {});
41172
41278
  }, [providedFields, resolvedData]);
41173
41279
  const handleProceed = () => {
@@ -41203,7 +41309,7 @@ var SearchSpecCard = import_react80.default.memo(
41203
41309
  SearchSpecCard.displayName = "SearchSpecCard";
41204
41310
 
41205
41311
  // src/molecules/creator-discovery/MCQCard/MCQCard.tsx
41206
- var import_react81 = __toESM(require("react"), 1);
41312
+ var import_react82 = __toESM(require("react"), 1);
41207
41313
 
41208
41314
  // src/molecules/creator-discovery/MCQCard/defaultFetchers.ts
41209
41315
  function getBackendOrigin() {
@@ -41304,7 +41410,7 @@ async function defaultPersistSelection(sessionId, questionKey, value) {
41304
41410
 
41305
41411
  // src/molecules/creator-discovery/MCQCard/MCQCard.tsx
41306
41412
  var import_jsx_runtime153 = require("react/jsx-runtime");
41307
- var MCQCard = import_react81.default.memo(
41413
+ var MCQCard = import_react82.default.memo(
41308
41414
  ({
41309
41415
  question,
41310
41416
  options,
@@ -41318,6 +41424,7 @@ var MCQCard = import_react81.default.memo(
41318
41424
  onAction,
41319
41425
  disabled = false,
41320
41426
  disableContinueInDiscovery,
41427
+ theme,
41321
41428
  // Self-contained props
41322
41429
  sessionId,
41323
41430
  sendMessage,
@@ -41327,18 +41434,17 @@ var MCQCard = import_react81.default.memo(
41327
41434
  }) => {
41328
41435
  const resolvedQuestion = question || allProps.Question || allProps.q || "";
41329
41436
  const resolvedOptions = options || allProps.Options || allProps.opts || {};
41330
- const resolvedRecommended = recommended || allProps.Recommended || allProps.rec;
41331
- console.log("[MCQCard] FULL PROPS:", { allProps, resolvedQuestion, resolvedOptions: Object.keys(resolvedOptions || {}), resolvedRecommended });
41332
- const [selectedOption, setSelectedOption] = import_react81.default.useState(propsSelectedOption);
41333
- const [isProceeded, setIsProceeded] = import_react81.default.useState(false);
41334
- const fetchedSessionRef = import_react81.default.useRef("");
41335
- import_react81.default.useEffect(() => {
41437
+ const t = th(theme);
41438
+ const [selectedOption, setSelectedOption] = import_react82.default.useState(propsSelectedOption);
41439
+ const [isProceeded, setIsProceeded] = import_react82.default.useState(false);
41440
+ const fetchedSessionRef = import_react82.default.useRef("");
41441
+ import_react82.default.useEffect(() => {
41336
41442
  if (propsSelectedOption) {
41337
41443
  setSelectedOption(propsSelectedOption);
41338
41444
  setIsProceeded(true);
41339
41445
  }
41340
41446
  }, [propsSelectedOption]);
41341
- const buildQuestionKey = import_react81.default.useCallback((sid, question2) => {
41447
+ const buildQuestionKey = import_react82.default.useCallback((sid, question2) => {
41342
41448
  let hash = 2166136261;
41343
41449
  for (let i = 0; i < question2.length; i++) {
41344
41450
  hash ^= question2.charCodeAt(i);
@@ -41346,31 +41452,27 @@ var MCQCard = import_react81.default.memo(
41346
41452
  }
41347
41453
  return `mcq_${sid}_${hash.toString(36)}`;
41348
41454
  }, []);
41349
- import_react81.default.useEffect(() => {
41455
+ import_react82.default.useEffect(() => {
41350
41456
  if (!sessionId || !resolvedQuestion) return;
41351
41457
  const fetchKey = `${sessionId}::${resolvedQuestion}`;
41352
41458
  if (fetchedSessionRef.current === fetchKey) return;
41353
41459
  if (propsSelectedOption) return;
41354
41460
  fetchedSessionRef.current = fetchKey;
41355
41461
  const questionKey = buildQuestionKey(sessionId, resolvedQuestion);
41356
- console.log("[MCQCard] Fetching with key:", questionKey, "(question:", resolvedQuestion, ")");
41357
41462
  fetchSelections(sessionId).then((selections) => {
41358
- console.log("[MCQCard] Got selections:", selections);
41359
41463
  const stored = selections[questionKey] || selections[resolvedQuestion] || selections[`mcq_${sessionId}`];
41360
41464
  if (stored) {
41361
- console.log("[MCQCard] Setting selected:", stored);
41362
41465
  setSelectedOption(stored);
41363
41466
  setIsProceeded(true);
41364
41467
  }
41365
- }).catch((err) => console.error("[MCQCard] Fetch error:", err));
41468
+ }).catch(() => {
41469
+ });
41366
41470
  }, [sessionId, propsSelectedOption, resolvedQuestion, buildQuestionKey]);
41367
41471
  const isDiscovery = disableContinueInDiscovery !== void 0 ? disableContinueInDiscovery : typeof window !== "undefined" && window.location.pathname.includes("creator-discovery");
41368
41472
  const handleOptionClick = (key, e) => {
41369
41473
  e.preventDefault();
41370
41474
  e.stopPropagation();
41371
- console.log("[MCQCard] Option clicked:", key, "Can select:", isLatestMessage && !isLoading && !disabled && !isProceeded);
41372
41475
  if (isLatestMessage && !isLoading && !disabled && !isProceeded) {
41373
- console.log("[MCQCard] Setting selected to:", key);
41374
41476
  setSelectedOption(key);
41375
41477
  onSelect?.(key);
41376
41478
  }
@@ -41388,7 +41490,6 @@ var MCQCard = import_react81.default.memo(
41388
41490
  setIsProceeded(true);
41389
41491
  if (sessionId && resolvedQuestion) {
41390
41492
  const questionKey = buildQuestionKey(sessionId, resolvedQuestion);
41391
- console.log("[MCQCard] Persisting:", questionKey, result);
41392
41493
  await persistSelection(sessionId, questionKey, result);
41393
41494
  }
41394
41495
  if (sendMessage) {
@@ -41416,8 +41517,9 @@ A: ${label}`);
41416
41517
  "p-4 rounded-lg border border-gray400 bg-cardSurface w-full",
41417
41518
  className
41418
41519
  ),
41520
+ style: t.root,
41419
41521
  children: [
41420
- /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", children: resolvedQuestion || "Select an option:" }) }),
41522
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", style: t.text, children: resolvedQuestion || "Select an option:" }) }),
41421
41523
  /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "space-y-2.5 mb-4", children: optionsEntries.map(([key, label]) => {
41422
41524
  const isSelected = selectedOption === key;
41423
41525
  const isRecommended = key === recommended;
@@ -41432,6 +41534,7 @@ A: ${label}`);
41432
41534
  !selectedOption && !isOptionsDisabled && "hover:border-gray500",
41433
41535
  (isLoading || isOptionsDisabled) && "opacity-50 cursor-not-allowed"
41434
41536
  ),
41537
+ style: isSelected ? { ...t.surface, ...t.accentBorder } : t.surface,
41435
41538
  children: /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex items-start gap-3", children: [
41436
41539
  /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "mt-0.5 flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
41437
41540
  "div",
@@ -41443,12 +41546,13 @@ A: ${label}`);
41443
41546
  !selectedOption && !isOptionsDisabled && "hover:border-gold"
41444
41547
  )
41445
41548
  ),
41446
- children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "w-2 h-2 rounded-full bg-gold" })
41549
+ style: isSelected ? t.accentBorder : void 0,
41550
+ children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "w-2 h-2 rounded-full bg-gold", style: t.accentBg })
41447
41551
  }
41448
41552
  ) }),
41449
41553
  /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex-1 min-w-0", children: [
41450
- isRecommended && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-xs font-semibold text-gold mb-1", children: "Recommended" }),
41451
- /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", children: label })
41554
+ isRecommended && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-xs font-semibold text-gold mb-1", style: t.accent, children: "Recommended" }),
41555
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", style: t.text, children: label })
41452
41556
  ] })
41453
41557
  ] })
41454
41558
  },
@@ -41465,6 +41569,7 @@ A: ${label}`);
41465
41569
  "disabled:opacity-50 disabled:cursor-not-allowed",
41466
41570
  "bg-cardSurface hover:bg-cardSurface/80 text-gold border-cardBorder"
41467
41571
  ),
41572
+ style: { ...t.surface, ...t.accent },
41468
41573
  children: isLoading ? "Sending..." : "Continue"
41469
41574
  }
41470
41575
  ) })
@@ -41952,9 +42057,9 @@ var CreatorActionHeader = ({
41952
42057
  };
41953
42058
 
41954
42059
  // src/molecules/creator-discovery/CreatorSearchBox/CreatorSearch.tsx
41955
- var import_react82 = __toESM(require("react"), 1);
42060
+ var import_react83 = __toESM(require("react"), 1);
41956
42061
  var import_jsx_runtime164 = require("react/jsx-runtime");
41957
- var CreatorSearch = import_react82.default.memo(
42062
+ var CreatorSearch = import_react83.default.memo(
41958
42063
  ({
41959
42064
  selectionStatus,
41960
42065
  isLatestMessage = true,
@@ -41963,7 +42068,7 @@ var CreatorSearch = import_react82.default.memo(
41963
42068
  data,
41964
42069
  ...formCardProps
41965
42070
  }) => {
41966
- const fields = (0, import_react82.useMemo)(() => {
42071
+ const fields = (0, import_react83.useMemo)(() => {
41967
42072
  const baseFields = providedFields || generateFieldsFromData(data);
41968
42073
  return baseFields.map((field) => {
41969
42074
  if (field.key === "platforms") {
@@ -42043,10 +42148,10 @@ var CreatorSearch = import_react82.default.memo(
42043
42148
  CreatorSearch.displayName = "CreatorSearch";
42044
42149
 
42045
42150
  // src/molecules/creator-discovery/CampaignConceptCard/CampaignConceptCard.tsx
42046
- var import_react83 = __toESM(require("react"), 1);
42151
+ var import_react84 = __toESM(require("react"), 1);
42047
42152
  var import_framer_motion = require("framer-motion");
42048
42153
  var import_jsx_runtime165 = require("react/jsx-runtime");
42049
- var CampaignConceptCard = import_react83.default.memo(
42154
+ var CampaignConceptCard = import_react84.default.memo(
42050
42155
  ({
42051
42156
  index,
42052
42157
  isRecommended,
@@ -42062,7 +42167,7 @@ var CampaignConceptCard = import_react83.default.memo(
42062
42167
  onAction,
42063
42168
  ...formCardProps
42064
42169
  }) => {
42065
- const [internalIsOpen, setInternalIsOpen] = (0, import_react83.useState)(false);
42170
+ const [internalIsOpen, setInternalIsOpen] = (0, import_react84.useState)(false);
42066
42171
  const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
42067
42172
  const handleToggle = () => {
42068
42173
  if (onToggle) {
@@ -42081,7 +42186,7 @@ var CampaignConceptCard = import_react83.default.memo(
42081
42186
  });
42082
42187
  };
42083
42188
  const effectiveIsLatest = isLatestMessage && !hasUserResponded;
42084
- const fields = (0, import_react83.useMemo)(() => {
42189
+ const fields = (0, import_react84.useMemo)(() => {
42085
42190
  const baseFields = providedFields || generateFieldsFromData(data);
42086
42191
  const FIELD_ORDER = [
42087
42192
  "description",
@@ -42393,14 +42498,14 @@ var CampaignConceptCard = import_react83.default.memo(
42393
42498
  CampaignConceptCard.displayName = "CampaignConceptCard";
42394
42499
 
42395
42500
  // src/molecules/creator-discovery/CreatorWidget/CreatorWidget.tsx
42396
- var import_react91 = require("react");
42501
+ var import_react92 = require("react");
42397
42502
 
42398
42503
  // src/molecules/creator-discovery/CreatorWidget/CreatorImageList.tsx
42399
- var import_react84 = require("react");
42504
+ var import_react85 = require("react");
42400
42505
  var import_jsx_runtime166 = require("react/jsx-runtime");
42401
42506
  function useMediaQuery(query) {
42402
- const [matches, setMatches] = (0, import_react84.useState)(false);
42403
- (0, import_react84.useEffect)(() => {
42507
+ const [matches, setMatches] = (0, import_react85.useState)(false);
42508
+ (0, import_react85.useEffect)(() => {
42404
42509
  const media = window.matchMedia(query);
42405
42510
  const listener = () => setMatches(media.matches);
42406
42511
  listener();
@@ -42483,7 +42588,7 @@ function CreatorImageList({
42483
42588
  }
42484
42589
 
42485
42590
  // src/molecules/creator-discovery/CreatorWidget/CreatorProgressBar.tsx
42486
- var import_react85 = require("react");
42591
+ var import_react86 = require("react");
42487
42592
  var import_framer_motion2 = require("framer-motion");
42488
42593
  var import_jsx_runtime167 = require("react/jsx-runtime");
42489
42594
  function truncateName(name, maxLength) {
@@ -42491,8 +42596,8 @@ function truncateName(name, maxLength) {
42491
42596
  return name.substring(0, maxLength) + "...";
42492
42597
  }
42493
42598
  function ProgressBar({ overallPercentage }) {
42494
- const [showTooltip, setShowTooltip] = (0, import_react85.useState)(true);
42495
- (0, import_react85.useEffect)(() => {
42599
+ const [showTooltip, setShowTooltip] = (0, import_react86.useState)(true);
42600
+ (0, import_react86.useEffect)(() => {
42496
42601
  if (overallPercentage && overallPercentage >= 100) {
42497
42602
  setShowTooltip(false);
42498
42603
  }
@@ -42652,7 +42757,7 @@ function CreatorCompactView({
42652
42757
  }
42653
42758
 
42654
42759
  // src/molecules/creator-discovery/CreatorWidget/CreatorExpandedPanel.tsx
42655
- var import_react89 = require("react");
42760
+ var import_react90 = require("react");
42656
42761
  var import_react_dom2 = __toESM(require("react-dom"), 1);
42657
42762
  var import_framer_motion5 = require("framer-motion");
42658
42763
 
@@ -43138,7 +43243,7 @@ function getPlatformIconColor(platform) {
43138
43243
  }
43139
43244
 
43140
43245
  // src/molecules/creator-discovery/CreatorWidget/PostCard.tsx
43141
- var import_react86 = require("react");
43246
+ var import_react87 = require("react");
43142
43247
  var import_jsx_runtime172 = require("react/jsx-runtime");
43143
43248
  var formatFollowerCount = (count) => {
43144
43249
  if (count >= 1e6) {
@@ -43152,8 +43257,8 @@ var formatFollowerCount = (count) => {
43152
43257
  return Math.floor(count).toString();
43153
43258
  };
43154
43259
  function PostCard({ post, platformUsername }) {
43155
- const [expanded, setExpanded] = (0, import_react86.useState)(false);
43156
- const [errored, setErrored] = (0, import_react86.useState)(false);
43260
+ const [expanded, setExpanded] = (0, import_react87.useState)(false);
43261
+ const [errored, setErrored] = (0, import_react87.useState)(false);
43157
43262
  const thumbnail = post.thumbnail_url || post.thumbnail || post.image || "";
43158
43263
  const likes = post.engagement?.likes ?? post.likes ?? null;
43159
43264
  const comments = post.engagement?.comments ?? post.comments ?? null;
@@ -43294,7 +43399,7 @@ function PlatformMetricsBanner({
43294
43399
  return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(
43295
43400
  "div",
43296
43401
  {
43297
- className: "\r\n grid grid-cols-1 gap-3 rounded-xl py-4 px-4 shadow-sm\r\n md:flex md:overflow-x-auto md:gap-6 md:rounded-l-xl md:py-4 md:px-4 md:items-center md:gap-0 md:px-0 md:ml-8\r\n ",
43402
+ className: "\n grid grid-cols-1 gap-3 rounded-xl py-4 px-4 shadow-sm\n md:flex md:overflow-x-auto md:gap-6 md:rounded-l-xl md:py-4 md:px-4 md:items-center md:gap-0 md:px-0 md:ml-8\n ",
43298
43403
  style: { backgroundColor: bgColor },
43299
43404
  children: [
43300
43405
  /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("div", { className: "flex flex-col items-center md:min-w-0", children: [
@@ -43362,7 +43467,7 @@ function PlatformPostsSection({
43362
43467
  }
43363
43468
 
43364
43469
  // src/molecules/creator-discovery/CreatorWidget/BrandCollaborationsList.tsx
43365
- var import_react87 = require("react");
43470
+ var import_react88 = require("react");
43366
43471
  var import_react_dom = __toESM(require("react-dom"), 1);
43367
43472
  var import_framer_motion3 = require("framer-motion");
43368
43473
  var import_jsx_runtime174 = require("react/jsx-runtime");
@@ -43564,8 +43669,8 @@ function BrandMentionDetails({
43564
43669
  function BrandCollaborationsList({
43565
43670
  brandBreakdown
43566
43671
  }) {
43567
- const [openDetails, setOpenDetails] = (0, import_react87.useState)(false);
43568
- const [selectedBrand, setSelectedBrand] = (0, import_react87.useState)("");
43672
+ const [openDetails, setOpenDetails] = (0, import_react88.useState)(false);
43673
+ const [selectedBrand, setSelectedBrand] = (0, import_react88.useState)("");
43569
43674
  if (!brandBreakdown?.insights?.brandBreakdown || brandBreakdown.insights.brandBreakdown.length === 0) {
43570
43675
  return null;
43571
43676
  }
@@ -43624,7 +43729,7 @@ function BrandCollaborationsList({
43624
43729
  }
43625
43730
 
43626
43731
  // src/molecules/creator-discovery/CreatorWidget/CreatorGridView.tsx
43627
- var import_react88 = require("react");
43732
+ var import_react89 = require("react");
43628
43733
  var import_framer_motion4 = require("framer-motion");
43629
43734
  var import_jsx_runtime175 = require("react/jsx-runtime");
43630
43735
  var formatFollowerCount3 = (count) => {
@@ -43673,25 +43778,25 @@ var itemsExplanation = [
43673
43778
  { key: "brandSafety", label: "Brand Safety" }
43674
43779
  ];
43675
43780
  function CreatorGridViewCard({ creator }) {
43676
- const [isExpanded, setIsExpanded] = (0, import_react88.useState)(false);
43677
- const [showFullDescription, setShowFullDescription] = (0, import_react88.useState)(false);
43678
- const [isDescriptionOverflowing, setIsDescriptionOverflowing] = (0, import_react88.useState)(false);
43679
- const descriptionRef = (0, import_react88.useRef)(null);
43680
- const cardRef = (0, import_react88.useRef)(null);
43681
- const checkDescriptionOverflow = (0, import_react88.useCallback)(() => {
43781
+ const [isExpanded, setIsExpanded] = (0, import_react89.useState)(false);
43782
+ const [showFullDescription, setShowFullDescription] = (0, import_react89.useState)(false);
43783
+ const [isDescriptionOverflowing, setIsDescriptionOverflowing] = (0, import_react89.useState)(false);
43784
+ const descriptionRef = (0, import_react89.useRef)(null);
43785
+ const cardRef = (0, import_react89.useRef)(null);
43786
+ const checkDescriptionOverflow = (0, import_react89.useCallback)(() => {
43682
43787
  const el = descriptionRef.current;
43683
43788
  if (!el) return;
43684
43789
  setIsDescriptionOverflowing(el.scrollHeight > el.clientHeight + 1);
43685
43790
  }, []);
43686
- (0, import_react88.useEffect)(() => {
43791
+ (0, import_react89.useEffect)(() => {
43687
43792
  checkDescriptionOverflow();
43688
43793
  }, [checkDescriptionOverflow, isExpanded, showFullDescription]);
43689
- (0, import_react88.useEffect)(() => {
43794
+ (0, import_react89.useEffect)(() => {
43690
43795
  const onResize = () => checkDescriptionOverflow();
43691
43796
  window.addEventListener("resize", onResize);
43692
43797
  return () => window.removeEventListener("resize", onResize);
43693
43798
  }, [checkDescriptionOverflow]);
43694
- const platformStats = (0, import_react88.useMemo)(() => {
43799
+ const platformStats = (0, import_react89.useMemo)(() => {
43695
43800
  return [
43696
43801
  {
43697
43802
  platform: "instagram",
@@ -44109,7 +44214,7 @@ function BrandMentionPerformance({ creator }) {
44109
44214
  ] });
44110
44215
  }
44111
44216
  function CreatorFitSummary({ creator, showBrandPerformance }) {
44112
- const [contentExpanded, setContentExpanded] = (0, import_react89.useState)(false);
44217
+ const [contentExpanded, setContentExpanded] = (0, import_react90.useState)(false);
44113
44218
  const hasDeepAnalysis = creator?.sentiment?.deepAnalysis?.deepAnalysis;
44114
44219
  const title = hasDeepAnalysis ? "CREATOR DEEP ANALYSIS" : "CREATOR FIT SUMMARY";
44115
44220
  const content = hasDeepAnalysis ? creator.sentiment.deepAnalysis.deepAnalysis : creator?.sentiment?.aiReasoning || "No data available.";
@@ -44129,7 +44234,7 @@ function CreatorFitSummary({ creator, showBrandPerformance }) {
44129
44234
  ] });
44130
44235
  }
44131
44236
  function ProfileSection({ creator, isValidationComplete }) {
44132
- const [descriptionExpanded, setDescriptionExpanded] = (0, import_react89.useState)(false);
44237
+ const [descriptionExpanded, setDescriptionExpanded] = (0, import_react90.useState)(false);
44133
44238
  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}` : "";
44134
44239
  const iso2 = normalizeToIso2(creator.country);
44135
44240
  const meta = codeToMeta[iso2];
@@ -44219,7 +44324,7 @@ function CreatorCard({
44219
44324
  creator,
44220
44325
  isValidationComplete
44221
44326
  }) {
44222
- const [detailsExpanded, setDetailsExpanded] = (0, import_react89.useState)(false);
44327
+ const [detailsExpanded, setDetailsExpanded] = (0, import_react90.useState)(false);
44223
44328
  const hasValidBrandMention = (() => {
44224
44329
  const insights = creator?.brandCollaborations?.insights;
44225
44330
  if (!insights) return false;
@@ -44261,7 +44366,7 @@ function CreatorDisplay({
44261
44366
  creators,
44262
44367
  isValidationComplete
44263
44368
  }) {
44264
- const [viewMode, setViewMode] = (0, import_react89.useState)("list");
44369
+ const [viewMode, setViewMode] = (0, import_react90.useState)("list");
44265
44370
  return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("div", { className: "px-4", children: [
44266
44371
  /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("div", { className: "flex justify-end items-center my-3 gap-1", children: [
44267
44372
  /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("span", { className: "text-xs text-gray600 mr-2", children: [
@@ -44342,10 +44447,10 @@ function CreatorExpandedPanel({
44342
44447
  searchSpec,
44343
44448
  fetchCreatorDetails
44344
44449
  }) {
44345
- const [creators, setCreators] = (0, import_react89.useState)([]);
44346
- const [loading, setLoading] = (0, import_react89.useState)(false);
44450
+ const [creators, setCreators] = (0, import_react90.useState)([]);
44451
+ const [loading, setLoading] = (0, import_react90.useState)(false);
44347
44452
  const fetcher = fetchCreatorDetails ?? defaultFetchCreatorDetails;
44348
- const loadCreators = (0, import_react89.useCallback)(async () => {
44453
+ const loadCreators = (0, import_react90.useCallback)(async () => {
44349
44454
  if (!creatorIds.length) return;
44350
44455
  setLoading(true);
44351
44456
  try {
@@ -44357,7 +44462,7 @@ function CreatorExpandedPanel({
44357
44462
  setLoading(false);
44358
44463
  }
44359
44464
  }, [creatorIds, sessionId, version, fetcher]);
44360
- (0, import_react89.useEffect)(() => {
44465
+ (0, import_react90.useEffect)(() => {
44361
44466
  if (isOpen && creatorIds.length > 0) {
44362
44467
  loadCreators();
44363
44468
  }
@@ -44411,7 +44516,7 @@ function CreatorExpandedPanel({
44411
44516
  }
44412
44517
 
44413
44518
  // src/molecules/creator-discovery/CreatorWidget/useCreatorWidgetPolling.ts
44414
- var import_react90 = require("react");
44519
+ var import_react91 = require("react");
44415
44520
  var DEFAULT_POLLING_CONFIG = {
44416
44521
  pollInterval: 5e3,
44417
44522
  maxDuration: 15 * 60 * 1e3,
@@ -44428,22 +44533,22 @@ function useCreatorWidgetPolling({
44428
44533
  }) {
44429
44534
  const fetchVersions = fetchVersionsProp ?? defaultFetchVersions;
44430
44535
  const fetchStatus = fetchStatusProp ?? defaultFetchStatus;
44431
- const config = (0, import_react90.useMemo)(
44536
+ const config = (0, import_react91.useMemo)(
44432
44537
  () => ({ ...DEFAULT_POLLING_CONFIG, ...pollingConfig }),
44433
44538
  [pollingConfig]
44434
44539
  );
44435
- const [versionData, setVersionData] = (0, import_react90.useState)(null);
44436
- const [totalVersions, setTotalVersions] = (0, import_react90.useState)(0);
44437
- const [selectedVersion, setSelectedVersion] = (0, import_react90.useState)();
44438
- const [isLoadingVersion, setIsLoadingVersion] = (0, import_react90.useState)(false);
44439
- const [isValidationComplete, setIsValidationComplete] = (0, import_react90.useState)(false);
44440
- const [versionStatus, setVersionStatus] = (0, import_react90.useState)("checking");
44441
- const [statusDetails, setStatusDetails] = (0, import_react90.useState)();
44442
- const [timeDisplay, setTimeDisplay] = (0, import_react90.useState)("");
44443
- const [loadingStatus, setLoadingStatus] = (0, import_react90.useState)(true);
44444
- const remainingTimeRef = (0, import_react90.useRef)(0);
44540
+ const [versionData, setVersionData] = (0, import_react91.useState)(null);
44541
+ const [totalVersions, setTotalVersions] = (0, import_react91.useState)(0);
44542
+ const [selectedVersion, setSelectedVersion] = (0, import_react91.useState)();
44543
+ const [isLoadingVersion, setIsLoadingVersion] = (0, import_react91.useState)(false);
44544
+ const [isValidationComplete, setIsValidationComplete] = (0, import_react91.useState)(false);
44545
+ const [versionStatus, setVersionStatus] = (0, import_react91.useState)("checking");
44546
+ const [statusDetails, setStatusDetails] = (0, import_react91.useState)();
44547
+ const [timeDisplay, setTimeDisplay] = (0, import_react91.useState)("");
44548
+ const [loadingStatus, setLoadingStatus] = (0, import_react91.useState)(true);
44549
+ const remainingTimeRef = (0, import_react91.useRef)(0);
44445
44550
  const requestedVersion = selectedVersion ?? currentVersion ?? versionData?.currentVersion;
44446
- const fetchVersionData = (0, import_react90.useCallback)(async () => {
44551
+ const fetchVersionData = (0, import_react91.useCallback)(async () => {
44447
44552
  if (!sessionId) return;
44448
44553
  if (!versionData) setIsLoadingVersion(true);
44449
44554
  try {
@@ -44464,17 +44569,17 @@ function useCreatorWidgetPolling({
44464
44569
  setIsLoadingVersion(false);
44465
44570
  }
44466
44571
  }, [sessionId, requestedVersion, isValidationComplete, fetchVersions, versionData]);
44467
- (0, import_react90.useEffect)(() => {
44572
+ (0, import_react91.useEffect)(() => {
44468
44573
  fetchVersionData();
44469
44574
  }, [sessionId, requestedVersion, isValidationComplete]);
44470
- (0, import_react90.useEffect)(() => {
44575
+ (0, import_react91.useEffect)(() => {
44471
44576
  if (totalVersions > 0 || !sessionId) return;
44472
44577
  const interval = setInterval(() => {
44473
44578
  if (totalVersions === 0) fetchVersionData();
44474
44579
  }, config.pollInterval);
44475
44580
  return () => clearInterval(interval);
44476
44581
  }, [totalVersions, sessionId, fetchVersionData, config.pollInterval]);
44477
- (0, import_react90.useEffect)(() => {
44582
+ (0, import_react91.useEffect)(() => {
44478
44583
  if (!selectedVersion && !requestedVersion) return;
44479
44584
  const activeVersion = selectedVersion ?? requestedVersion;
44480
44585
  let isMounted = true;
@@ -44557,7 +44662,7 @@ function useCreatorWidgetPolling({
44557
44662
  stopPolling();
44558
44663
  };
44559
44664
  }, [selectedVersion, requestedVersion, sessionId]);
44560
- const versionNumbers = (0, import_react90.useMemo)(() => {
44665
+ const versionNumbers = (0, import_react91.useMemo)(() => {
44561
44666
  if (!totalVersions) return [];
44562
44667
  return Array.from({ length: totalVersions }, (_, i) => i + 1);
44563
44668
  }, [totalVersions]);
@@ -44597,7 +44702,7 @@ function CreatorWidgetInner({
44597
44702
  onAction,
44598
44703
  className
44599
44704
  }) {
44600
- const [isExpanded, setIsExpanded] = (0, import_react91.useState)(false);
44705
+ const [isExpanded, setIsExpanded] = (0, import_react92.useState)(false);
44601
44706
  const {
44602
44707
  versionNumbers,
44603
44708
  selectedVersion,
@@ -44618,11 +44723,11 @@ function CreatorWidgetInner({
44618
44723
  pollingConfig,
44619
44724
  onStatusChange
44620
44725
  });
44621
- const handleVersionSelect = (0, import_react91.useCallback)(
44726
+ const handleVersionSelect = (0, import_react92.useCallback)(
44622
44727
  (version) => setSelectedVersion(version),
44623
44728
  [setSelectedVersion]
44624
44729
  );
44625
- const handleViewCreators = (0, import_react91.useCallback)(() => {
44730
+ const handleViewCreators = (0, import_react92.useCallback)(() => {
44626
44731
  setIsExpanded(true);
44627
44732
  onAction?.({
44628
44733
  type: "view-creators",
@@ -44663,7 +44768,7 @@ function CreatorWidgetInner({
44663
44768
  )
44664
44769
  ] });
44665
44770
  }
44666
- var CreatorWidget = (0, import_react91.memo)(CreatorWidgetInner);
44771
+ var CreatorWidget = (0, import_react92.memo)(CreatorWidgetInner);
44667
44772
 
44668
44773
  // src/components/ui/index.ts
44669
44774
  var ui_exports = {};
@@ -45120,7 +45225,7 @@ function EmptyContent({ className, ...props }) {
45120
45225
  }
45121
45226
 
45122
45227
  // src/components/ui/field.tsx
45123
- var import_react92 = require("react");
45228
+ var import_react93 = require("react");
45124
45229
  var import_class_variance_authority10 = require("class-variance-authority");
45125
45230
  var import_jsx_runtime180 = require("react/jsx-runtime");
45126
45231
  function FieldSet({ className, ...props }) {
@@ -45303,7 +45408,7 @@ function FieldError({
45303
45408
  errors,
45304
45409
  ...props
45305
45410
  }) {
45306
- const content = (0, import_react92.useMemo)(() => {
45411
+ const content = (0, import_react93.useMemo)(() => {
45307
45412
  if (children) {
45308
45413
  return children;
45309
45414
  }
@@ -46340,6 +46445,7 @@ ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
46340
46445
 
46341
46446
  // src/render/PXEngineRenderer.tsx
46342
46447
  var import_jsx_runtime187 = require("react/jsx-runtime");
46448
+ var MOLECULE_REFS = new Set(Object.values(molecules_exports));
46343
46449
  var CONTEXT_DEPENDENT_COMPONENTS = /* @__PURE__ */ new Set([
46344
46450
  // Form components - require FormField + FormItem context
46345
46451
  "FormLabel",
@@ -46533,18 +46639,21 @@ var normalizeProps = (props) => {
46533
46639
  var PXEngineRenderer = ({
46534
46640
  schema,
46535
46641
  onAction,
46536
- disabled
46642
+ disabled,
46643
+ theme
46537
46644
  }) => {
46645
+ const contextTheme = import_react94.default.useContext(WidgetThemeContext);
46646
+ const effectiveTheme = theme ?? contextTheme;
46538
46647
  if (!schema) return null;
46539
46648
  const root = schema.root || schema;
46540
46649
  const renderRecursive = (component, index) => {
46541
46650
  if (Array.isArray(component)) {
46542
- return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_react93.default.Fragment, { children: component.map((child, idx) => renderRecursive(child, idx)) }, index !== void 0 ? `array-${index}` : "array-root");
46651
+ return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_react94.default.Fragment, { children: component.map((child, idx) => renderRecursive(child, idx)) }, index !== void 0 ? `array-${index}` : "array-root");
46543
46652
  }
46544
46653
  if (typeof component === "string" || typeof component === "number") {
46545
46654
  return component;
46546
46655
  }
46547
- if (import_react93.default.isValidElement(component)) {
46656
+ if (import_react94.default.isValidElement(component)) {
46548
46657
  return component;
46549
46658
  }
46550
46659
  if (!component || typeof component !== "object") return null;
@@ -46624,6 +46733,9 @@ var PXEngineRenderer = ({
46624
46733
  "ResizableAtom"
46625
46734
  ]);
46626
46735
  const isAtomWithRenderProp = ATOMS_WITH_RENDER.has(atomName);
46736
+ if (effectiveTheme && finalProps.theme === void 0 && MOLECULE_REFS.has(TargetComponent)) {
46737
+ finalProps.theme = effectiveTheme;
46738
+ }
46627
46739
  const finalStyle = { ...dynamicStyle, ...finalProps.style || {} };
46628
46740
  if (isAtomWithRenderProp) {
46629
46741
  return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
@@ -46650,7 +46762,7 @@ var PXEngineRenderer = ({
46650
46762
  );
46651
46763
  }
46652
46764
  };
46653
- return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("div", { className: "px-engine-root relative w-full h-full", children: renderRecursive(root) });
46765
+ return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(WidgetThemeContext.Provider, { value: effectiveTheme, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("div", { className: "px-engine-root relative w-full h-full", children: renderRecursive(root) }) });
46654
46766
  };
46655
46767
  // Annotate the CommonJS export names for ESM import in node:
46656
46768
  0 && (module.exports = {
@@ -46960,6 +47072,7 @@ var PXEngineRenderer = ({
46960
47072
  TopPostsGrid,
46961
47073
  VideoAtom,
46962
47074
  WebSearchJobCard,
47075
+ WidgetThemeContext,
46963
47076
  cn,
46964
47077
  defaultFetchSelections,
46965
47078
  defaultPersistSelection,
@@ -46971,6 +47084,7 @@ var PXEngineRenderer = ({
46971
47084
  submitWidgetToAgent,
46972
47085
  th,
46973
47086
  useCreatorWidgetPolling,
47087
+ useWidgetTheme,
46974
47088
  withAlpha
46975
47089
  });
46976
47090
  /*! Bundled license information: