pxengine 0.1.97 → 0.1.98

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
@@ -51,6 +51,7 @@ __export(index_exports, {
51
51
  AlertDialogTitle: () => AlertDialogTitle,
52
52
  AlertDialogTrigger: () => AlertDialogTrigger,
53
53
  AlertTitle: () => AlertTitle,
54
+ AnalyticsChart: () => AnalyticsChart,
54
55
  ApprovalCard: () => ApprovalCard,
55
56
  ArrowToggleAtom: () => ArrowToggleAtom,
56
57
  AspectRatio: () => AspectRatio,
@@ -354,7 +355,7 @@ __export(index_exports, {
354
355
  module.exports = __toCommonJS(index_exports);
355
356
 
356
357
  // src/render/PXEngineRenderer.tsx
357
- var import_react95 = __toESM(require("react"), 1);
358
+ var import_react96 = __toESM(require("react"), 1);
358
359
 
359
360
  // src/atoms/index.ts
360
361
  var atoms_exports = {};
@@ -33941,6 +33942,7 @@ var molecules_exports = {};
33941
33942
  __export(molecules_exports, {
33942
33943
  ActionButton: () => ActionButton,
33943
33944
  ActionPriorityCard: () => ActionPriorityCard,
33945
+ AnalyticsChart: () => AnalyticsChart,
33944
33946
  ApprovalCard: () => ApprovalCard,
33945
33947
  AudienceDemographicsCard: () => AudienceDemographicsCard,
33946
33948
  AudienceMetricCard: () => AudienceMetricCard,
@@ -39290,7 +39292,8 @@ var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) =>
39290
39292
  setIframeReady(true);
39291
39293
  iframeRef.current?.contentWindow?.postMessage({ type: "goToSlide", slide: initialSlide }, "*");
39292
39294
  },
39293
- sandbox: "allow-same-origin allow-scripts allow-fullscreen",
39295
+ sandbox: "allow-same-origin allow-scripts",
39296
+ allow: "fullscreen",
39294
39297
  className: "absolute inset-0 w-full h-full border-0"
39295
39298
  }
39296
39299
  ) })
@@ -41501,13 +41504,63 @@ async function defaultPersistSelection(sessionId, questionKey, value) {
41501
41504
 
41502
41505
  // src/molecules/creator-discovery/MCQCard/MCQCard.tsx
41503
41506
  var import_jsx_runtime153 = require("react/jsx-runtime");
41507
+ var NUMBER_WORDS = {
41508
+ one: 1,
41509
+ two: 2,
41510
+ three: 3,
41511
+ four: 4,
41512
+ five: 5,
41513
+ six: 6,
41514
+ seven: 7,
41515
+ eight: 8,
41516
+ nine: 9,
41517
+ ten: 10
41518
+ };
41519
+ function wordToNum(s) {
41520
+ const n = parseInt(s, 10);
41521
+ if (!Number.isNaN(n)) return n;
41522
+ return NUMBER_WORDS[s.toLowerCase()] ?? NaN;
41523
+ }
41524
+ function toPositiveInt(v) {
41525
+ const n = Math.floor(Number(v));
41526
+ return Number.isFinite(n) && n > 0 ? n : void 0;
41527
+ }
41528
+ function inferSelectionLimits(text, optionCount) {
41529
+ if (!text) return null;
41530
+ const q = text.toLowerCase();
41531
+ const all = optionCount > 0 ? optionCount : 99;
41532
+ if (/all that apply|select all|check all|choose all|select multiple|choose multiple|more than one|as many as|any that apply/.test(q)) {
41533
+ return { max: all, min: 1, mode: "all" };
41534
+ }
41535
+ const upTo = q.match(/up to (\d+|one|two|three|four|five|six|seven|eight|nine|ten)/);
41536
+ if (upTo) {
41537
+ const n = wordToNum(upTo[1]);
41538
+ if (n > 1) return { max: Math.min(n, all), min: 1, mode: "upto" };
41539
+ }
41540
+ const pickN = q.match(/(?:select|choose|pick)\s+(?:any\s+|your\s+|the\s+)?(?:top\s+)?(\d+|one|two|three|four|five|six|seven|eight|nine|ten)\b/);
41541
+ if (pickN) {
41542
+ const n = wordToNum(pickN[1]);
41543
+ if (n > 1 && n <= all) return { max: n, min: n, mode: "exact" };
41544
+ }
41545
+ if (/(?:select|choose|pick)\s+(?:your\s+|the\s+)?(?:preferred|favorite|favourite|relevant|applicable|matching)\s+\w+s\b/.test(q)) {
41546
+ return { max: all, min: 1, mode: "all" };
41547
+ }
41548
+ if (/(?:choose|select|pick)\s+the\s+\w+s\s+that\s+(?:match|apply|fit|describe|best|are)/.test(q)) {
41549
+ return { max: all, min: 1, mode: "all" };
41550
+ }
41551
+ return null;
41552
+ }
41504
41553
  var MCQCard = import_react83.default.memo(
41505
41554
  ({
41506
41555
  question,
41507
41556
  options,
41508
41557
  recommended,
41509
41558
  selectedOption: propsSelectedOption,
41559
+ selectedOptions: propsSelectedOptions,
41560
+ maxSelections,
41561
+ minSelections,
41510
41562
  onSelect,
41563
+ onSelectMultiple,
41511
41564
  onProceed,
41512
41565
  isLatestMessage = true,
41513
41566
  isLoading = false,
@@ -41525,20 +41578,54 @@ var MCQCard = import_react83.default.memo(
41525
41578
  }) => {
41526
41579
  const resolvedQuestion = question || allProps.Question || allProps.q || "";
41527
41580
  const resolvedOptions = options || allProps.Options || allProps.opts || {};
41581
+ const optionCount = resolvedOptions && typeof resolvedOptions === "object" ? Object.keys(resolvedOptions).length : 0;
41582
+ const explicitMax = toPositiveInt(
41583
+ maxSelections ?? allProps.MaxSelections ?? allProps.max_selections ?? allProps.maxSelect
41584
+ );
41585
+ const explicitMin = toPositiveInt(
41586
+ minSelections ?? allProps.MinSelections ?? allProps.min_selections
41587
+ );
41588
+ const inferenceText = [
41589
+ resolvedQuestion,
41590
+ allProps.Context,
41591
+ allProps.context,
41592
+ allProps.instruction,
41593
+ allProps.helperText
41594
+ ].filter(Boolean).join(" ");
41595
+ const inferred = explicitMax ? null : inferSelectionLimits(inferenceText, optionCount);
41596
+ const maxSel = explicitMax ?? inferred?.max ?? 1;
41597
+ const isMulti = maxSel > 1;
41598
+ const minSel = Math.min(
41599
+ maxSel,
41600
+ Math.max(1, explicitMin ?? inferred?.min ?? (isMulti ? maxSel : 1))
41601
+ );
41602
+ const isSelectAll = isMulti && !explicitMax && inferred?.mode === "all";
41528
41603
  const t = th(theme);
41529
- const [selectedOption, setSelectedOption] = import_react83.default.useState(propsSelectedOption);
41530
- const [isProceeded, setIsProceeded] = import_react83.default.useState(false);
41604
+ const seedSelection = () => {
41605
+ if (Array.isArray(propsSelectedOptions) && propsSelectedOptions.length > 0) {
41606
+ return propsSelectedOptions.slice(0, maxSel);
41607
+ }
41608
+ if (propsSelectedOption) return [propsSelectedOption];
41609
+ return [];
41610
+ };
41611
+ const [selectedKeys, setSelectedKeys] = import_react83.default.useState(seedSelection);
41612
+ const [isProceeded, setIsProceeded] = import_react83.default.useState(
41613
+ Boolean(propsSelectedOption || propsSelectedOptions && propsSelectedOptions.length)
41614
+ );
41531
41615
  const fetchedSessionRef = import_react83.default.useRef("");
41532
41616
  import_react83.default.useEffect(() => {
41533
41617
  if (propsSelectedOption) {
41534
- setSelectedOption(propsSelectedOption);
41618
+ setSelectedKeys([propsSelectedOption]);
41619
+ setIsProceeded(true);
41620
+ } else if (Array.isArray(propsSelectedOptions) && propsSelectedOptions.length > 0) {
41621
+ setSelectedKeys(propsSelectedOptions.slice(0, maxSel));
41535
41622
  setIsProceeded(true);
41536
41623
  }
41537
- }, [propsSelectedOption]);
41538
- const buildQuestionKey = import_react83.default.useCallback((sid, question2) => {
41624
+ }, [propsSelectedOption, propsSelectedOptions]);
41625
+ const buildQuestionKey = import_react83.default.useCallback((sid, q) => {
41539
41626
  let hash = 2166136261;
41540
- for (let i = 0; i < question2.length; i++) {
41541
- hash ^= question2.charCodeAt(i);
41627
+ for (let i = 0; i < q.length; i++) {
41628
+ hash ^= q.charCodeAt(i);
41542
41629
  hash = hash * 16777619 >>> 0;
41543
41630
  }
41544
41631
  return `mcq_${sid}_${hash.toString(36)}`;
@@ -41553,54 +41640,83 @@ var MCQCard = import_react83.default.memo(
41553
41640
  fetchSelections(sessionId).then((selections) => {
41554
41641
  const stored = selections[questionKey] || selections[resolvedQuestion] || selections[`mcq_${sessionId}`];
41555
41642
  if (stored) {
41556
- setSelectedOption(stored);
41557
- setIsProceeded(true);
41643
+ const restored = String(stored).split(",").map((s) => s.trim()).filter(Boolean);
41644
+ if (restored.length) {
41645
+ setSelectedKeys(restored);
41646
+ setIsProceeded(true);
41647
+ }
41558
41648
  }
41559
41649
  }).catch(() => {
41560
41650
  });
41561
41651
  }, [sessionId, propsSelectedOption, resolvedQuestion, buildQuestionKey]);
41562
41652
  const isDiscovery = disableContinueInDiscovery !== void 0 ? disableContinueInDiscovery : typeof window !== "undefined" && window.location.pathname.includes("creator-discovery");
41653
+ const isOptionsDisabled = disabled || !isLatestMessage || isProceeded && !disableContinueInDiscovery;
41563
41654
  const handleOptionClick = (key, e) => {
41564
41655
  e.preventDefault();
41565
41656
  e.stopPropagation();
41566
- if (isLatestMessage && !isLoading && !disabled && !isProceeded) {
41567
- setSelectedOption(key);
41657
+ if (!isLatestMessage || isLoading || disabled || isProceeded) return;
41658
+ if (!isMulti) {
41659
+ setSelectedKeys([key]);
41568
41660
  onSelect?.(key);
41661
+ onSelectMultiple?.([key]);
41662
+ return;
41569
41663
  }
41664
+ setSelectedKeys((prev) => {
41665
+ let next;
41666
+ if (prev.includes(key)) {
41667
+ next = prev.filter((k) => k !== key);
41668
+ } else if (prev.length < maxSel) {
41669
+ next = [...prev, key];
41670
+ } else {
41671
+ next = prev;
41672
+ }
41673
+ onSelect?.(key);
41674
+ onSelectMultiple?.(next);
41675
+ return next;
41676
+ });
41677
+ };
41678
+ const optionsEntries = resolvedOptions && Object.keys(resolvedOptions).length > 0 ? Object.entries(resolvedOptions).map(([key, val]) => [
41679
+ key,
41680
+ typeof val === "string" ? val : typeof val === "object" && val !== null ? val.label || val.description || val.id || JSON.stringify(val) : String(val ?? "")
41681
+ ]) : [];
41682
+ const labelFor = (key) => {
41683
+ const found = optionsEntries.find(([k]) => k === key);
41684
+ return found ? found[1] : key;
41570
41685
  };
41571
41686
  const handleProceed = async (e) => {
41572
41687
  e.preventDefault();
41573
41688
  e.stopPropagation();
41574
- if ((selectedOption || recommended) && !disabled && !isProceeded) {
41575
- const result = selectedOption || recommended || "";
41576
- if (!selectedOption && recommended) {
41577
- setSelectedOption(recommended);
41578
- }
41579
- const rawLabel = options && options[result];
41580
- const label = typeof rawLabel === "string" ? rawLabel : typeof rawLabel === "object" && rawLabel !== null ? rawLabel.label || rawLabel.description || result : result;
41581
- setIsProceeded(true);
41582
- if (sessionId && resolvedQuestion) {
41583
- const questionKey = buildQuestionKey(sessionId, resolvedQuestion);
41584
- await persistSelection(sessionId, questionKey, result);
41585
- }
41586
- if (sendMessage) {
41587
- sendMessage(`Q: ${resolvedQuestion}
41689
+ if (disabled || isProceeded) return;
41690
+ let finalKeys = selectedKeys.length ? selectedKeys : recommended ? [recommended] : [];
41691
+ finalKeys = finalKeys.slice(0, maxSel);
41692
+ if (finalKeys.length < minSel) return;
41693
+ if (selectedKeys.length === 0 && recommended) {
41694
+ setSelectedKeys(finalKeys);
41695
+ }
41696
+ const value = finalKeys.join(",");
41697
+ const label = finalKeys.map(labelFor).join(", ");
41698
+ setIsProceeded(true);
41699
+ if (sessionId && resolvedQuestion) {
41700
+ const questionKey = buildQuestionKey(sessionId, resolvedQuestion);
41701
+ await persistSelection(sessionId, questionKey, value);
41702
+ }
41703
+ if (sendMessage) {
41704
+ sendMessage(`Q: ${resolvedQuestion}
41588
41705
  A: ${label}`);
41589
- }
41590
- onProceed?.(result);
41591
- onAction?.({
41592
- type: "mcq_selection",
41593
- value: result,
41594
- label
41595
- });
41596
41706
  }
41707
+ onProceed?.(value);
41708
+ onAction?.({
41709
+ type: "mcq_selection",
41710
+ value,
41711
+ label,
41712
+ values: finalKeys,
41713
+ labels: finalKeys.map(labelFor)
41714
+ });
41597
41715
  };
41598
- const isOptionsDisabled = disabled || !isLatestMessage || isProceeded && !disableContinueInDiscovery;
41716
+ const selectedCount = selectedKeys.length;
41717
+ const meetsMin = (selectedCount || (recommended ? 1 : 0)) >= minSel;
41599
41718
  const isContinueDisabled = disabled || !isLatestMessage || isProceeded || isDiscovery;
41600
- const optionsEntries = resolvedOptions && Object.keys(resolvedOptions).length > 0 ? Object.entries(resolvedOptions).map(([key, val]) => [
41601
- key,
41602
- typeof val === "string" ? val : typeof val === "object" && val !== null ? val.label || val.description || val.id || JSON.stringify(val) : String(val ?? "")
41603
- ]) : [];
41719
+ const guidance = !isMulti ? "Select one option" : isSelectAll ? "Select all that apply" : minSel === maxSel ? `Select ${maxSel} options` : minSel <= 1 ? `Choose up to ${maxSel} options` : `Select between ${minSel} and ${maxSel} options`;
41604
41720
  return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
41605
41721
  "div",
41606
41722
  {
@@ -41611,10 +41727,24 @@ A: ${label}`);
41611
41727
  ),
41612
41728
  style: t.root,
41613
41729
  children: [
41614
- /* @__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:" }) }),
41730
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "mb-4", children: [
41731
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", style: t.text, children: resolvedQuestion || "Select an option:" }),
41732
+ isMulti && /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("p", { className: "mt-1 text-xs text-gray500 flex items-center gap-1.5", children: [
41733
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { children: guidance }),
41734
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("span", { className: "text-gold", style: t.accent, children: [
41735
+ "(",
41736
+ selectedCount,
41737
+ "/",
41738
+ maxSel,
41739
+ " selected)"
41740
+ ] })
41741
+ ] })
41742
+ ] }),
41615
41743
  /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "space-y-2.5 mb-4", children: optionsEntries.map(([key, label]) => {
41616
- const isSelected = selectedOption === key;
41744
+ const isSelected = selectedKeys.includes(key);
41617
41745
  const isRecommended = key === recommended;
41746
+ const atCap = isMulti && !isSelected && selectedCount >= maxSel;
41747
+ const allowHover = !isOptionsDisabled && !atCap && (isMulti || selectedCount === 0);
41618
41748
  return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
41619
41749
  "div",
41620
41750
  {
@@ -41625,8 +41755,8 @@ A: ${label}`);
41625
41755
  "cursor-pointer rounded-lg p-3 transition-colors",
41626
41756
  "border bg-black",
41627
41757
  isSelected ? "border-cardBorder" : "border-gray400",
41628
- !selectedOption && !isOptionsDisabled && "hover:border-gray500",
41629
- (isLoading || isOptionsDisabled) && "opacity-50 cursor-not-allowed"
41758
+ allowHover && "hover:border-gray500",
41759
+ (isLoading || isOptionsDisabled || atCap) && "opacity-50 cursor-not-allowed"
41630
41760
  ),
41631
41761
  style: isSelected ? { ...t.surface, ...t.accentBorder } : t.surface,
41632
41762
  children: /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex items-start gap-3", children: [
@@ -41634,14 +41764,28 @@ A: ${label}`);
41634
41764
  "div",
41635
41765
  {
41636
41766
  className: cn(
41637
- "w-4 h-4 rounded-full border-2 flex items-center justify-center transition-colors",
41767
+ "w-4 h-4 border-2 flex items-center justify-center transition-colors",
41768
+ isMulti ? "rounded" : "rounded-full",
41638
41769
  isSelected ? "border-gold" : cn(
41639
41770
  "border-gray500",
41640
- !selectedOption && !isOptionsDisabled && "hover:border-gold"
41771
+ allowHover && "hover:border-gold"
41641
41772
  )
41642
41773
  ),
41643
41774
  style: isSelected ? t.accentBorder : void 0,
41644
- children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "w-2 h-2 rounded-full bg-gold", style: t.accentBg })
41775
+ children: isSelected && (isMulti ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
41776
+ "svg",
41777
+ {
41778
+ viewBox: "0 0 16 16",
41779
+ className: "w-3 h-3 text-gold",
41780
+ style: t.accent,
41781
+ fill: "none",
41782
+ stroke: "currentColor",
41783
+ strokeWidth: "2.5",
41784
+ strokeLinecap: "round",
41785
+ strokeLinejoin: "round",
41786
+ children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("path", { d: "M3.5 8.5l3 3 6-7" })
41787
+ }
41788
+ ) : /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "w-2 h-2 rounded-full bg-gold", style: t.accentBg }))
41645
41789
  }
41646
41790
  ) }),
41647
41791
  /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex-1 min-w-0", children: [
@@ -41658,7 +41802,7 @@ A: ${label}`);
41658
41802
  {
41659
41803
  "data-testid": "mcq-continue",
41660
41804
  onClick: handleProceed,
41661
- disabled: isContinueDisabled || isLoading || !selectedOption && !recommended,
41805
+ disabled: isContinueDisabled || isLoading || !meetsMin,
41662
41806
  className: cn(
41663
41807
  "px-4 py-1.5 border rounded-lg text-xs font-medium transition-colors",
41664
41808
  "disabled:opacity-50 disabled:cursor-not-allowed",
@@ -44865,6 +45009,190 @@ function CreatorWidgetInner({
44865
45009
  }
44866
45010
  var CreatorWidget = (0, import_react93.memo)(CreatorWidgetInner);
44867
45011
 
45012
+ // src/molecules/analytics/AnalyticsChart.tsx
45013
+ var import_react94 = require("react");
45014
+ var import_jsx_runtime178 = require("react/jsx-runtime");
45015
+ function getCSSVar(name) {
45016
+ if (typeof document === "undefined") return "";
45017
+ return getComputedStyle(document.documentElement).getPropertyValue(name).trim();
45018
+ }
45019
+ var FALLBACK_COLORS = ["#C4AD7C", "#A189E8", "#5BC582", "#F59E0B", "#3B82F6", "#EC81B6", "#4DB8AC", "#F97316"];
45020
+ function normalizeConfig(config) {
45021
+ const xAxisType = Array.isArray(config.xAxis) ? config.xAxis[0]?.type : config.xAxis?.type;
45022
+ if (xAxisType !== "category") return config;
45023
+ return {
45024
+ ...config,
45025
+ series: (config.series || []).map((s) => ({
45026
+ ...s,
45027
+ data: (s.data || []).map((pt) => {
45028
+ if (pt && typeof pt === "object" && typeof pt.x === "string") {
45029
+ const { x, ...rest } = pt;
45030
+ return rest;
45031
+ }
45032
+ return pt;
45033
+ })
45034
+ }))
45035
+ };
45036
+ }
45037
+ function stripNulls(val) {
45038
+ if (val === null || val === void 0) return void 0;
45039
+ if (Array.isArray(val)) return val.map(stripNulls).filter((v) => v !== void 0);
45040
+ if (typeof val === "object") {
45041
+ const out = {};
45042
+ for (const k of Object.keys(val)) {
45043
+ const v = stripNulls(val[k]);
45044
+ if (v !== void 0) out[k] = v;
45045
+ }
45046
+ return out;
45047
+ }
45048
+ return val;
45049
+ }
45050
+ var hcSingleton = null;
45051
+ var hcLoadPromise = null;
45052
+ function loadHighcharts() {
45053
+ if (hcSingleton) return Promise.resolve(hcSingleton);
45054
+ if (hcLoadPromise) return hcLoadPromise;
45055
+ hcLoadPromise = import("highcharts").then((m) => {
45056
+ hcSingleton = m.default ?? m;
45057
+ return hcSingleton;
45058
+ });
45059
+ return hcLoadPromise;
45060
+ }
45061
+ function buildTheme(height) {
45062
+ const colors = [1, 2, 3, 4, 5, 6, 7, 8].map((i) => getCSSVar(`--chart-${i}`)).filter(Boolean);
45063
+ return {
45064
+ colors: colors.length ? colors : FALLBACK_COLORS,
45065
+ chart: {
45066
+ backgroundColor: getCSSVar("--paperBackground") || "#0a0a0a",
45067
+ style: { fontFamily: "Inter, sans-serif" },
45068
+ height
45069
+ },
45070
+ title: { style: { color: getCSSVar("--txtColor") || "#E5E5E5", fontSize: "14px", fontWeight: "600" } },
45071
+ subtitle: { style: { color: getCSSVar("--textSecondary") || "#9A9080", fontSize: "12px" } },
45072
+ xAxis: {
45073
+ labels: { style: { color: getCSSVar("--textSecondary") || "#9A9080", fontSize: "11px" } },
45074
+ gridLineColor: getCSSVar("--chart-grid") || "rgba(255,255,255,0.05)",
45075
+ lineColor: getCSSVar("--gray300") || "#363843",
45076
+ tickColor: getCSSVar("--gray300") || "#363843"
45077
+ },
45078
+ yAxis: {
45079
+ labels: { style: { color: getCSSVar("--textSecondary") || "#9A9080", fontSize: "11px" } },
45080
+ gridLineColor: getCSSVar("--chart-grid") || "rgba(255,255,255,0.05)",
45081
+ title: { style: { color: getCSSVar("--textSecondary") || "#9A9080" } }
45082
+ },
45083
+ legend: {
45084
+ itemStyle: { color: getCSSVar("--txtColor") || "#E5E5E5", fontSize: "11px", fontWeight: "normal" },
45085
+ itemHoverStyle: { color: getCSSVar("--gray900") || "#f5f5f5" }
45086
+ },
45087
+ tooltip: {
45088
+ backgroundColor: getCSSVar("--gray100") || "#1b1c22",
45089
+ style: { color: getCSSVar("--txtColor") || "#E5E5E5", fontSize: "12px" },
45090
+ borderColor: getCSSVar("--gray300") || "#363843",
45091
+ borderRadius: 6
45092
+ },
45093
+ plotOptions: { series: { animation: { duration: 400 } } },
45094
+ credits: { enabled: false }
45095
+ };
45096
+ }
45097
+ function AnalyticsChart({
45098
+ config: configProp,
45099
+ chartId,
45100
+ apiBase = "",
45101
+ authToken,
45102
+ height = 400,
45103
+ className,
45104
+ loading: loadingProp,
45105
+ error: errorProp
45106
+ }) {
45107
+ const [mounted, setMounted] = (0, import_react94.useState)(false);
45108
+ const [fetchedConfig, setFetchedConfig] = (0, import_react94.useState)(null);
45109
+ const [fetching, setFetching] = (0, import_react94.useState)(false);
45110
+ const [fetchError, setFetchError] = (0, import_react94.useState)(null);
45111
+ const containerRef = (0, import_react94.useRef)(null);
45112
+ const chartRef = (0, import_react94.useRef)(null);
45113
+ (0, import_react94.useEffect)(() => {
45114
+ setMounted(true);
45115
+ }, []);
45116
+ (0, import_react94.useEffect)(() => {
45117
+ if (!chartId || configProp) return;
45118
+ let cancelled = false;
45119
+ setFetching(true);
45120
+ setFetchError(null);
45121
+ const headers = {};
45122
+ if (authToken) headers["Authorization"] = `Bearer ${authToken}`;
45123
+ fetch(`${apiBase}/api/charts/${chartId}`, { headers }).then((r) => {
45124
+ if (!r.ok) throw new Error(`${r.status}`);
45125
+ return r.json();
45126
+ }).then((d) => {
45127
+ if (!cancelled) setFetchedConfig(d.chart_config ?? d);
45128
+ }).catch((e) => {
45129
+ if (!cancelled) setFetchError(e.message ?? "Failed to load chart");
45130
+ }).finally(() => {
45131
+ if (!cancelled) setFetching(false);
45132
+ });
45133
+ return () => {
45134
+ cancelled = true;
45135
+ };
45136
+ }, [chartId, apiBase, authToken, configProp]);
45137
+ const activeConfig = configProp ?? fetchedConfig;
45138
+ (0, import_react94.useEffect)(() => {
45139
+ if (!mounted || !activeConfig || !containerRef.current) return;
45140
+ const container = containerRef.current;
45141
+ let cancelled = false;
45142
+ loadHighcharts().then((HC) => {
45143
+ if (cancelled || !container) return;
45144
+ if (chartRef.current) {
45145
+ try {
45146
+ chartRef.current.destroy();
45147
+ } catch {
45148
+ }
45149
+ chartRef.current = null;
45150
+ }
45151
+ HC.setOptions(buildTheme(height));
45152
+ chartRef.current = HC.chart(container, normalizeConfig(stripNulls(activeConfig)));
45153
+ });
45154
+ return () => {
45155
+ cancelled = true;
45156
+ };
45157
+ }, [mounted, activeConfig]);
45158
+ (0, import_react94.useEffect)(() => {
45159
+ return () => {
45160
+ if (chartRef.current) {
45161
+ try {
45162
+ chartRef.current.destroy();
45163
+ } catch {
45164
+ }
45165
+ chartRef.current = null;
45166
+ }
45167
+ };
45168
+ }, []);
45169
+ (0, import_react94.useEffect)(() => {
45170
+ if (!mounted || !containerRef.current) return;
45171
+ const obs = new ResizeObserver(() => {
45172
+ try {
45173
+ chartRef.current?.reflow();
45174
+ } catch {
45175
+ }
45176
+ });
45177
+ obs.observe(containerRef.current);
45178
+ return () => obs.disconnect();
45179
+ }, [mounted]);
45180
+ const bg = getCSSVar("--paperBackground") || "#0a0a0a";
45181
+ const mutedColor = getCSSVar("--gray300") || "#363843";
45182
+ const displayError = errorProp ?? fetchError;
45183
+ const isLoading = loadingProp || fetching || !mounted || !activeConfig;
45184
+ if (displayError) {
45185
+ return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)("div", { className, style: { height, display: "flex", alignItems: "center", justifyContent: "center", backgroundColor: bg, borderRadius: 8, border: `1px solid ${mutedColor}` }, children: /* @__PURE__ */ (0, import_jsx_runtime178.jsx)("p", { style: { color: getCSSVar("--redText") || "#f87171", fontSize: 13, margin: 0 }, children: displayError }) });
45186
+ }
45187
+ if (isLoading) {
45188
+ return /* @__PURE__ */ (0, import_jsx_runtime178.jsxs)("div", { className, style: { height, borderRadius: 8, overflow: "hidden", position: "relative", backgroundColor: bg, border: `1px solid ${mutedColor}` }, children: [
45189
+ /* @__PURE__ */ (0, import_jsx_runtime178.jsx)("div", { style: { position: "absolute", inset: 0, background: "linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.06) 50%,transparent 100%)", animation: "hc-shimmer 1.6s ease-in-out infinite" } }),
45190
+ /* @__PURE__ */ (0, import_jsx_runtime178.jsx)("style", { children: `@keyframes hc-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}` })
45191
+ ] });
45192
+ }
45193
+ return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)("div", { ref: containerRef, className, style: { width: "100%", minWidth: 0, height } });
45194
+ }
45195
+
44868
45196
  // src/components/ui/index.ts
44869
45197
  var ui_exports = {};
44870
45198
  __export(ui_exports, {
@@ -45157,7 +45485,7 @@ __export(ui_exports, {
45157
45485
  // src/components/ui/button-group.tsx
45158
45486
  var import_react_slot4 = require("@radix-ui/react-slot");
45159
45487
  var import_class_variance_authority8 = require("class-variance-authority");
45160
- var import_jsx_runtime178 = require("react/jsx-runtime");
45488
+ var import_jsx_runtime179 = require("react/jsx-runtime");
45161
45489
  var buttonGroupVariants = (0, import_class_variance_authority8.cva)(
45162
45490
  "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
45163
45491
  {
@@ -45177,7 +45505,7 @@ function ButtonGroup({
45177
45505
  orientation,
45178
45506
  ...props
45179
45507
  }) {
45180
- return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
45508
+ return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45181
45509
  "div",
45182
45510
  {
45183
45511
  role: "group",
@@ -45194,7 +45522,7 @@ function ButtonGroupText({
45194
45522
  ...props
45195
45523
  }) {
45196
45524
  const Comp = asChild ? import_react_slot4.Slot : "div";
45197
- return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
45525
+ return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45198
45526
  Comp,
45199
45527
  {
45200
45528
  className: cn(
@@ -45210,7 +45538,7 @@ function ButtonGroupSeparator({
45210
45538
  orientation = "vertical",
45211
45539
  ...props
45212
45540
  }) {
45213
- return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
45541
+ return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45214
45542
  Separator2,
45215
45543
  {
45216
45544
  "data-slot": "button-group-separator",
@@ -45226,9 +45554,9 @@ function ButtonGroupSeparator({
45226
45554
 
45227
45555
  // src/components/ui/empty.tsx
45228
45556
  var import_class_variance_authority9 = require("class-variance-authority");
45229
- var import_jsx_runtime179 = require("react/jsx-runtime");
45557
+ var import_jsx_runtime180 = require("react/jsx-runtime");
45230
45558
  function Empty({ className, ...props }) {
45231
- return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45559
+ return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45232
45560
  "div",
45233
45561
  {
45234
45562
  "data-slot": "empty",
@@ -45241,7 +45569,7 @@ function Empty({ className, ...props }) {
45241
45569
  );
45242
45570
  }
45243
45571
  function EmptyHeader({ className, ...props }) {
45244
- return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45572
+ return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45245
45573
  "div",
45246
45574
  {
45247
45575
  "data-slot": "empty-header",
@@ -45272,7 +45600,7 @@ function EmptyMedia({
45272
45600
  variant = "default",
45273
45601
  ...props
45274
45602
  }) {
45275
- return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45603
+ return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45276
45604
  "div",
45277
45605
  {
45278
45606
  "data-slot": "empty-icon",
@@ -45283,7 +45611,7 @@ function EmptyMedia({
45283
45611
  );
45284
45612
  }
45285
45613
  function EmptyTitle({ className, ...props }) {
45286
- return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45614
+ return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45287
45615
  "div",
45288
45616
  {
45289
45617
  "data-slot": "empty-title",
@@ -45293,7 +45621,7 @@ function EmptyTitle({ className, ...props }) {
45293
45621
  );
45294
45622
  }
45295
45623
  function EmptyDescription({ className, ...props }) {
45296
- return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45624
+ return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45297
45625
  "div",
45298
45626
  {
45299
45627
  "data-slot": "empty-description",
@@ -45306,7 +45634,7 @@ function EmptyDescription({ className, ...props }) {
45306
45634
  );
45307
45635
  }
45308
45636
  function EmptyContent({ className, ...props }) {
45309
- return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
45637
+ return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45310
45638
  "div",
45311
45639
  {
45312
45640
  "data-slot": "empty-content",
@@ -45320,11 +45648,11 @@ function EmptyContent({ className, ...props }) {
45320
45648
  }
45321
45649
 
45322
45650
  // src/components/ui/field.tsx
45323
- var import_react94 = require("react");
45651
+ var import_react95 = require("react");
45324
45652
  var import_class_variance_authority10 = require("class-variance-authority");
45325
- var import_jsx_runtime180 = require("react/jsx-runtime");
45653
+ var import_jsx_runtime181 = require("react/jsx-runtime");
45326
45654
  function FieldSet({ className, ...props }) {
45327
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45655
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45328
45656
  "fieldset",
45329
45657
  {
45330
45658
  "data-slot": "field-set",
@@ -45342,7 +45670,7 @@ function FieldLegend({
45342
45670
  variant = "legend",
45343
45671
  ...props
45344
45672
  }) {
45345
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45673
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45346
45674
  "legend",
45347
45675
  {
45348
45676
  "data-slot": "field-legend",
@@ -45358,7 +45686,7 @@ function FieldLegend({
45358
45686
  );
45359
45687
  }
45360
45688
  function FieldGroup({ className, ...props }) {
45361
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45689
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45362
45690
  "div",
45363
45691
  {
45364
45692
  "data-slot": "field-group",
@@ -45398,7 +45726,7 @@ function Field({
45398
45726
  orientation = "vertical",
45399
45727
  ...props
45400
45728
  }) {
45401
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45729
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45402
45730
  "div",
45403
45731
  {
45404
45732
  role: "group",
@@ -45410,7 +45738,7 @@ function Field({
45410
45738
  );
45411
45739
  }
45412
45740
  function FieldContent({ className, ...props }) {
45413
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45741
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45414
45742
  "div",
45415
45743
  {
45416
45744
  "data-slot": "field-content",
@@ -45426,7 +45754,7 @@ function FieldLabel({
45426
45754
  className,
45427
45755
  ...props
45428
45756
  }) {
45429
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45757
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45430
45758
  Label,
45431
45759
  {
45432
45760
  "data-slot": "field-label",
@@ -45441,7 +45769,7 @@ function FieldLabel({
45441
45769
  );
45442
45770
  }
45443
45771
  function FieldTitle({ className, ...props }) {
45444
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45772
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45445
45773
  "div",
45446
45774
  {
45447
45775
  "data-slot": "field-label",
@@ -45454,7 +45782,7 @@ function FieldTitle({ className, ...props }) {
45454
45782
  );
45455
45783
  }
45456
45784
  function FieldDescription({ className, ...props }) {
45457
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45785
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45458
45786
  "p",
45459
45787
  {
45460
45788
  "data-slot": "field-description",
@@ -45473,7 +45801,7 @@ function FieldSeparator({
45473
45801
  className,
45474
45802
  ...props
45475
45803
  }) {
45476
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsxs)(
45804
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsxs)(
45477
45805
  "div",
45478
45806
  {
45479
45807
  "data-slot": "field-separator",
@@ -45484,8 +45812,8 @@ function FieldSeparator({
45484
45812
  ),
45485
45813
  ...props,
45486
45814
  children: [
45487
- /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(Separator2, { className: "absolute inset-0 top-1/2" }),
45488
- children && /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45815
+ /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(Separator2, { className: "absolute inset-0 top-1/2" }),
45816
+ children && /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45489
45817
  "span",
45490
45818
  {
45491
45819
  className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
@@ -45503,7 +45831,7 @@ function FieldError({
45503
45831
  errors,
45504
45832
  ...props
45505
45833
  }) {
45506
- const content = (0, import_react94.useMemo)(() => {
45834
+ const content = (0, import_react95.useMemo)(() => {
45507
45835
  if (children) {
45508
45836
  return children;
45509
45837
  }
@@ -45513,14 +45841,14 @@ function FieldError({
45513
45841
  if (errors?.length === 1 && errors[0]?.message) {
45514
45842
  return errors[0].message;
45515
45843
  }
45516
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
45517
- (error, index) => error?.message && /* @__PURE__ */ (0, import_jsx_runtime180.jsx)("li", { children: error.message }, index)
45844
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
45845
+ (error, index) => error?.message && /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("li", { children: error.message }, index)
45518
45846
  ) });
45519
45847
  }, [children, errors]);
45520
45848
  if (!content) {
45521
45849
  return null;
45522
45850
  }
45523
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
45851
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45524
45852
  "div",
45525
45853
  {
45526
45854
  role: "alert",
@@ -45534,9 +45862,9 @@ function FieldError({
45534
45862
 
45535
45863
  // src/components/ui/input-group.tsx
45536
45864
  var import_class_variance_authority11 = require("class-variance-authority");
45537
- var import_jsx_runtime181 = require("react/jsx-runtime");
45865
+ var import_jsx_runtime182 = require("react/jsx-runtime");
45538
45866
  function InputGroup({ className, ...props }) {
45539
- return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45867
+ return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
45540
45868
  "div",
45541
45869
  {
45542
45870
  "data-slot": "input-group",
@@ -45580,7 +45908,7 @@ function InputGroupAddon({
45580
45908
  align = "inline-start",
45581
45909
  ...props
45582
45910
  }) {
45583
- return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45911
+ return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
45584
45912
  "div",
45585
45913
  {
45586
45914
  role: "group",
@@ -45620,7 +45948,7 @@ function InputGroupButton({
45620
45948
  size = "xs",
45621
45949
  ...props
45622
45950
  }) {
45623
- return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45951
+ return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
45624
45952
  Button,
45625
45953
  {
45626
45954
  type,
@@ -45632,7 +45960,7 @@ function InputGroupButton({
45632
45960
  );
45633
45961
  }
45634
45962
  function InputGroupText({ className, ...props }) {
45635
- return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45963
+ return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
45636
45964
  "span",
45637
45965
  {
45638
45966
  className: cn(
@@ -45647,7 +45975,7 @@ function InputGroupInput({
45647
45975
  className,
45648
45976
  ...props
45649
45977
  }) {
45650
- return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45978
+ return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
45651
45979
  Input,
45652
45980
  {
45653
45981
  "data-slot": "input-group-control",
@@ -45663,7 +45991,7 @@ function InputGroupTextarea({
45663
45991
  className,
45664
45992
  ...props
45665
45993
  }) {
45666
- return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
45994
+ return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
45667
45995
  Textarea,
45668
45996
  {
45669
45997
  "data-slot": "input-group-control",
@@ -45679,9 +46007,9 @@ function InputGroupTextarea({
45679
46007
  // src/components/ui/item.tsx
45680
46008
  var import_react_slot5 = require("@radix-ui/react-slot");
45681
46009
  var import_class_variance_authority12 = require("class-variance-authority");
45682
- var import_jsx_runtime182 = require("react/jsx-runtime");
46010
+ var import_jsx_runtime183 = require("react/jsx-runtime");
45683
46011
  function ItemGroup({ className, ...props }) {
45684
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46012
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45685
46013
  "div",
45686
46014
  {
45687
46015
  role: "list",
@@ -45695,7 +46023,7 @@ function ItemSeparator({
45695
46023
  className,
45696
46024
  ...props
45697
46025
  }) {
45698
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46026
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45699
46027
  Separator2,
45700
46028
  {
45701
46029
  "data-slot": "item-separator",
@@ -45733,7 +46061,7 @@ function Item8({
45733
46061
  ...props
45734
46062
  }) {
45735
46063
  const Comp = asChild ? import_react_slot5.Slot : "div";
45736
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46064
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45737
46065
  Comp,
45738
46066
  {
45739
46067
  "data-slot": "item",
@@ -45764,7 +46092,7 @@ function ItemMedia({
45764
46092
  variant = "default",
45765
46093
  ...props
45766
46094
  }) {
45767
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46095
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45768
46096
  "div",
45769
46097
  {
45770
46098
  "data-slot": "item-media",
@@ -45775,7 +46103,7 @@ function ItemMedia({
45775
46103
  );
45776
46104
  }
45777
46105
  function ItemContent({ className, ...props }) {
45778
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46106
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45779
46107
  "div",
45780
46108
  {
45781
46109
  "data-slot": "item-content",
@@ -45788,7 +46116,7 @@ function ItemContent({ className, ...props }) {
45788
46116
  );
45789
46117
  }
45790
46118
  function ItemTitle({ className, ...props }) {
45791
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46119
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45792
46120
  "div",
45793
46121
  {
45794
46122
  "data-slot": "item-title",
@@ -45801,7 +46129,7 @@ function ItemTitle({ className, ...props }) {
45801
46129
  );
45802
46130
  }
45803
46131
  function ItemDescription({ className, ...props }) {
45804
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46132
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45805
46133
  "p",
45806
46134
  {
45807
46135
  "data-slot": "item-description",
@@ -45815,7 +46143,7 @@ function ItemDescription({ className, ...props }) {
45815
46143
  );
45816
46144
  }
45817
46145
  function ItemActions({ className, ...props }) {
45818
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46146
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45819
46147
  "div",
45820
46148
  {
45821
46149
  "data-slot": "item-actions",
@@ -45825,7 +46153,7 @@ function ItemActions({ className, ...props }) {
45825
46153
  );
45826
46154
  }
45827
46155
  function ItemHeader({ className, ...props }) {
45828
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46156
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45829
46157
  "div",
45830
46158
  {
45831
46159
  "data-slot": "item-header",
@@ -45838,7 +46166,7 @@ function ItemHeader({ className, ...props }) {
45838
46166
  );
45839
46167
  }
45840
46168
  function ItemFooter({ className, ...props }) {
45841
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
46169
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
45842
46170
  "div",
45843
46171
  {
45844
46172
  "data-slot": "item-footer",
@@ -45852,9 +46180,9 @@ function ItemFooter({ className, ...props }) {
45852
46180
  }
45853
46181
 
45854
46182
  // src/components/ui/kbd.tsx
45855
- var import_jsx_runtime183 = require("react/jsx-runtime");
46183
+ var import_jsx_runtime184 = require("react/jsx-runtime");
45856
46184
  function Kbd({ className, ...props }) {
45857
- return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
46185
+ return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
45858
46186
  "kbd",
45859
46187
  {
45860
46188
  "data-slot": "kbd",
@@ -45869,7 +46197,7 @@ function Kbd({ className, ...props }) {
45869
46197
  );
45870
46198
  }
45871
46199
  function KbdGroup({ className, ...props }) {
45872
- return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
46200
+ return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
45873
46201
  "kbd",
45874
46202
  {
45875
46203
  "data-slot": "kbd-group",
@@ -45902,7 +46230,7 @@ function useIsMobile() {
45902
46230
  }
45903
46231
 
45904
46232
  // src/components/ui/sidebar.tsx
45905
- var import_jsx_runtime184 = require("react/jsx-runtime");
46233
+ var import_jsx_runtime185 = require("react/jsx-runtime");
45906
46234
  var SIDEBAR_COOKIE_NAME = "sidebar_state";
45907
46235
  var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
45908
46236
  var SIDEBAR_WIDTH = "16rem";
@@ -45969,7 +46297,7 @@ var SidebarProvider = React116.forwardRef(
45969
46297
  }),
45970
46298
  [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
45971
46299
  );
45972
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46300
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
45973
46301
  "div",
45974
46302
  {
45975
46303
  style: {
@@ -46000,7 +46328,7 @@ var Sidebar = React116.forwardRef(
46000
46328
  }, ref) => {
46001
46329
  const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
46002
46330
  if (collapsible === "none") {
46003
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46331
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46004
46332
  "div",
46005
46333
  {
46006
46334
  className: cn(
@@ -46014,7 +46342,7 @@ var Sidebar = React116.forwardRef(
46014
46342
  );
46015
46343
  }
46016
46344
  if (isMobile) {
46017
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(Sheet2, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(
46345
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(Sheet2, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
46018
46346
  SheetContent,
46019
46347
  {
46020
46348
  "data-sidebar": "sidebar",
@@ -46025,16 +46353,16 @@ var Sidebar = React116.forwardRef(
46025
46353
  },
46026
46354
  side,
46027
46355
  children: [
46028
- /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(SheetHeader, { className: "sr-only", children: [
46029
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(SheetTitle, { children: "Sidebar" }),
46030
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
46356
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(SheetHeader, { className: "sr-only", children: [
46357
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(SheetTitle, { children: "Sidebar" }),
46358
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
46031
46359
  ] }),
46032
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)("div", { className: "flex h-full w-full flex-col", children })
46360
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)("div", { className: "flex h-full w-full flex-col", children })
46033
46361
  ]
46034
46362
  }
46035
46363
  ) });
46036
46364
  }
46037
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(
46365
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
46038
46366
  "div",
46039
46367
  {
46040
46368
  ref,
@@ -46044,7 +46372,7 @@ var Sidebar = React116.forwardRef(
46044
46372
  "data-variant": variant,
46045
46373
  "data-side": side,
46046
46374
  children: [
46047
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46375
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46048
46376
  "div",
46049
46377
  {
46050
46378
  className: cn(
@@ -46055,7 +46383,7 @@ var Sidebar = React116.forwardRef(
46055
46383
  )
46056
46384
  }
46057
46385
  ),
46058
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46386
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46059
46387
  "div",
46060
46388
  {
46061
46389
  className: cn(
@@ -46066,7 +46394,7 @@ var Sidebar = React116.forwardRef(
46066
46394
  className
46067
46395
  ),
46068
46396
  ...props,
46069
- children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46397
+ children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46070
46398
  "div",
46071
46399
  {
46072
46400
  "data-sidebar": "sidebar",
@@ -46084,7 +46412,7 @@ var Sidebar = React116.forwardRef(
46084
46412
  Sidebar.displayName = "Sidebar";
46085
46413
  var SidebarTrigger = React116.forwardRef(({ className, onClick, ...props }, ref) => {
46086
46414
  const { toggleSidebar } = useSidebar();
46087
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(
46415
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
46088
46416
  Button,
46089
46417
  {
46090
46418
  ref,
@@ -46098,8 +46426,8 @@ var SidebarTrigger = React116.forwardRef(({ className, onClick, ...props }, ref)
46098
46426
  },
46099
46427
  ...props,
46100
46428
  children: [
46101
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(PanelLeft, {}),
46102
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
46429
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(PanelLeft, {}),
46430
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
46103
46431
  ]
46104
46432
  }
46105
46433
  );
@@ -46107,7 +46435,7 @@ var SidebarTrigger = React116.forwardRef(({ className, onClick, ...props }, ref)
46107
46435
  SidebarTrigger.displayName = "SidebarTrigger";
46108
46436
  var SidebarRail = React116.forwardRef(({ className, ...props }, ref) => {
46109
46437
  const { toggleSidebar } = useSidebar();
46110
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46438
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46111
46439
  "button",
46112
46440
  {
46113
46441
  ref,
@@ -46131,7 +46459,7 @@ var SidebarRail = React116.forwardRef(({ className, ...props }, ref) => {
46131
46459
  });
46132
46460
  SidebarRail.displayName = "SidebarRail";
46133
46461
  var SidebarInset = React116.forwardRef(({ className, ...props }, ref) => {
46134
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46462
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46135
46463
  "main",
46136
46464
  {
46137
46465
  ref,
@@ -46146,7 +46474,7 @@ var SidebarInset = React116.forwardRef(({ className, ...props }, ref) => {
46146
46474
  });
46147
46475
  SidebarInset.displayName = "SidebarInset";
46148
46476
  var SidebarInput = React116.forwardRef(({ className, ...props }, ref) => {
46149
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46477
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46150
46478
  Input,
46151
46479
  {
46152
46480
  ref,
@@ -46161,7 +46489,7 @@ var SidebarInput = React116.forwardRef(({ className, ...props }, ref) => {
46161
46489
  });
46162
46490
  SidebarInput.displayName = "SidebarInput";
46163
46491
  var SidebarHeader = React116.forwardRef(({ className, ...props }, ref) => {
46164
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46492
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46165
46493
  "div",
46166
46494
  {
46167
46495
  ref,
@@ -46173,7 +46501,7 @@ var SidebarHeader = React116.forwardRef(({ className, ...props }, ref) => {
46173
46501
  });
46174
46502
  SidebarHeader.displayName = "SidebarHeader";
46175
46503
  var SidebarFooter = React116.forwardRef(({ className, ...props }, ref) => {
46176
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46504
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46177
46505
  "div",
46178
46506
  {
46179
46507
  ref,
@@ -46185,7 +46513,7 @@ var SidebarFooter = React116.forwardRef(({ className, ...props }, ref) => {
46185
46513
  });
46186
46514
  SidebarFooter.displayName = "SidebarFooter";
46187
46515
  var SidebarSeparator = React116.forwardRef(({ className, ...props }, ref) => {
46188
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46516
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46189
46517
  Separator2,
46190
46518
  {
46191
46519
  ref,
@@ -46197,7 +46525,7 @@ var SidebarSeparator = React116.forwardRef(({ className, ...props }, ref) => {
46197
46525
  });
46198
46526
  SidebarSeparator.displayName = "SidebarSeparator";
46199
46527
  var SidebarContent = React116.forwardRef(({ className, ...props }, ref) => {
46200
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46528
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46201
46529
  "div",
46202
46530
  {
46203
46531
  ref,
@@ -46212,7 +46540,7 @@ var SidebarContent = React116.forwardRef(({ className, ...props }, ref) => {
46212
46540
  });
46213
46541
  SidebarContent.displayName = "SidebarContent";
46214
46542
  var SidebarGroup = React116.forwardRef(({ className, ...props }, ref) => {
46215
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46543
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46216
46544
  "div",
46217
46545
  {
46218
46546
  ref,
@@ -46225,7 +46553,7 @@ var SidebarGroup = React116.forwardRef(({ className, ...props }, ref) => {
46225
46553
  SidebarGroup.displayName = "SidebarGroup";
46226
46554
  var SidebarGroupLabel = React116.forwardRef(({ className, asChild = false, ...props }, ref) => {
46227
46555
  const Comp = asChild ? import_react_slot6.Slot : "div";
46228
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46556
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46229
46557
  Comp,
46230
46558
  {
46231
46559
  ref,
@@ -46242,7 +46570,7 @@ var SidebarGroupLabel = React116.forwardRef(({ className, asChild = false, ...pr
46242
46570
  SidebarGroupLabel.displayName = "SidebarGroupLabel";
46243
46571
  var SidebarGroupAction = React116.forwardRef(({ className, asChild = false, ...props }, ref) => {
46244
46572
  const Comp = asChild ? import_react_slot6.Slot : "button";
46245
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46573
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46246
46574
  Comp,
46247
46575
  {
46248
46576
  ref,
@@ -46259,7 +46587,7 @@ var SidebarGroupAction = React116.forwardRef(({ className, asChild = false, ...p
46259
46587
  );
46260
46588
  });
46261
46589
  SidebarGroupAction.displayName = "SidebarGroupAction";
46262
- var SidebarGroupContent = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46590
+ var SidebarGroupContent = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46263
46591
  "div",
46264
46592
  {
46265
46593
  ref,
@@ -46269,7 +46597,7 @@ var SidebarGroupContent = React116.forwardRef(({ className, ...props }, ref) =>
46269
46597
  }
46270
46598
  ));
46271
46599
  SidebarGroupContent.displayName = "SidebarGroupContent";
46272
- var SidebarMenu = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46600
+ var SidebarMenu = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46273
46601
  "ul",
46274
46602
  {
46275
46603
  ref,
@@ -46279,7 +46607,7 @@ var SidebarMenu = React116.forwardRef(({ className, ...props }, ref) => /* @__PU
46279
46607
  }
46280
46608
  ));
46281
46609
  SidebarMenu.displayName = "SidebarMenu";
46282
- var SidebarMenuItem = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46610
+ var SidebarMenuItem = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46283
46611
  "li",
46284
46612
  {
46285
46613
  ref,
@@ -46321,7 +46649,7 @@ var SidebarMenuButton = React116.forwardRef(
46321
46649
  }, ref) => {
46322
46650
  const Comp = asChild ? import_react_slot6.Slot : "button";
46323
46651
  const { isMobile, state } = useSidebar();
46324
- const button = /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46652
+ const button = /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46325
46653
  Comp,
46326
46654
  {
46327
46655
  ref,
@@ -46340,9 +46668,9 @@ var SidebarMenuButton = React116.forwardRef(
46340
46668
  children: tooltip
46341
46669
  };
46342
46670
  }
46343
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(Tooltip, { children: [
46344
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(TooltipTrigger, { asChild: true, children: button }),
46345
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46671
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(Tooltip, { children: [
46672
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(TooltipTrigger, { asChild: true, children: button }),
46673
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46346
46674
  TooltipContent,
46347
46675
  {
46348
46676
  side: "right",
@@ -46357,7 +46685,7 @@ var SidebarMenuButton = React116.forwardRef(
46357
46685
  SidebarMenuButton.displayName = "SidebarMenuButton";
46358
46686
  var SidebarMenuAction = React116.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
46359
46687
  const Comp = asChild ? import_react_slot6.Slot : "button";
46360
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46688
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46361
46689
  Comp,
46362
46690
  {
46363
46691
  ref,
@@ -46378,7 +46706,7 @@ var SidebarMenuAction = React116.forwardRef(({ className, asChild = false, showO
46378
46706
  );
46379
46707
  });
46380
46708
  SidebarMenuAction.displayName = "SidebarMenuAction";
46381
- var SidebarMenuBadge = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46709
+ var SidebarMenuBadge = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46382
46710
  "div",
46383
46711
  {
46384
46712
  ref,
@@ -46400,7 +46728,7 @@ var SidebarMenuSkeleton = React116.forwardRef(({ className, showIcon = false, ..
46400
46728
  const width = React116.useMemo(() => {
46401
46729
  return `${Math.floor(Math.random() * 40) + 50}%`;
46402
46730
  }, []);
46403
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(
46731
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
46404
46732
  "div",
46405
46733
  {
46406
46734
  ref,
@@ -46408,14 +46736,14 @@ var SidebarMenuSkeleton = React116.forwardRef(({ className, showIcon = false, ..
46408
46736
  className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
46409
46737
  ...props,
46410
46738
  children: [
46411
- showIcon && /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46739
+ showIcon && /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46412
46740
  Skeleton,
46413
46741
  {
46414
46742
  className: "size-4 rounded-md",
46415
46743
  "data-sidebar": "menu-skeleton-icon"
46416
46744
  }
46417
46745
  ),
46418
- /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46746
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46419
46747
  Skeleton,
46420
46748
  {
46421
46749
  className: "h-4 max-w-[--skeleton-width] flex-1",
@@ -46430,7 +46758,7 @@ var SidebarMenuSkeleton = React116.forwardRef(({ className, showIcon = false, ..
46430
46758
  );
46431
46759
  });
46432
46760
  SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
46433
- var SidebarMenuSub = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46761
+ var SidebarMenuSub = React116.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46434
46762
  "ul",
46435
46763
  {
46436
46764
  ref,
@@ -46444,11 +46772,11 @@ var SidebarMenuSub = React116.forwardRef(({ className, ...props }, ref) => /* @_
46444
46772
  }
46445
46773
  ));
46446
46774
  SidebarMenuSub.displayName = "SidebarMenuSub";
46447
- var SidebarMenuSubItem = React116.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime184.jsx)("li", { ref, ...props }));
46775
+ var SidebarMenuSubItem = React116.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime185.jsx)("li", { ref, ...props }));
46448
46776
  SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
46449
46777
  var SidebarMenuSubButton = React116.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
46450
46778
  const Comp = asChild ? import_react_slot6.Slot : "a";
46451
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
46779
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46452
46780
  Comp,
46453
46781
  {
46454
46782
  ref,
@@ -46472,20 +46800,20 @@ SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
46472
46800
  // src/components/ui/sonner.tsx
46473
46801
  var import_next_themes = require("next-themes");
46474
46802
  var import_sonner = require("sonner");
46475
- var import_jsx_runtime185 = require("react/jsx-runtime");
46803
+ var import_jsx_runtime186 = require("react/jsx-runtime");
46476
46804
  var Toaster = ({ ...props }) => {
46477
46805
  const { theme = "system" } = (0, import_next_themes.useTheme)();
46478
- return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
46806
+ return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
46479
46807
  import_sonner.Toaster,
46480
46808
  {
46481
46809
  theme,
46482
46810
  className: "toaster group",
46483
46811
  icons: {
46484
- success: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(CircleCheck, { className: "h-4 w-4" }),
46485
- info: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(Info, { className: "h-4 w-4" }),
46486
- warning: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(TriangleAlert, { className: "h-4 w-4" }),
46487
- error: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(OctagonX, { className: "h-4 w-4" }),
46488
- loading: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(LoaderCircle, { className: "h-4 w-4 animate-spin" })
46812
+ success: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(CircleCheck, { className: "h-4 w-4" }),
46813
+ info: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(Info, { className: "h-4 w-4" }),
46814
+ warning: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(TriangleAlert, { className: "h-4 w-4" }),
46815
+ error: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(OctagonX, { className: "h-4 w-4" }),
46816
+ loading: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(LoaderCircle, { className: "h-4 w-4 animate-spin" })
46489
46817
  },
46490
46818
  toastOptions: {
46491
46819
  classNames: {
@@ -46503,24 +46831,24 @@ var Toaster = ({ ...props }) => {
46503
46831
  // src/components/ui/toggle-group.tsx
46504
46832
  var React117 = __toESM(require("react"), 1);
46505
46833
  var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
46506
- var import_jsx_runtime186 = require("react/jsx-runtime");
46834
+ var import_jsx_runtime187 = require("react/jsx-runtime");
46507
46835
  var ToggleGroupContext = React117.createContext({
46508
46836
  size: "default",
46509
46837
  variant: "default"
46510
46838
  });
46511
- var ToggleGroup = React117.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
46839
+ var ToggleGroup = React117.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
46512
46840
  ToggleGroupPrimitive.Root,
46513
46841
  {
46514
46842
  ref,
46515
46843
  className: cn("flex items-center justify-center gap-1", className),
46516
46844
  ...props,
46517
- children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(ToggleGroupContext.Provider, { value: { variant, size }, children })
46845
+ children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(ToggleGroupContext.Provider, { value: { variant, size }, children })
46518
46846
  }
46519
46847
  ));
46520
46848
  ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
46521
46849
  var ToggleGroupItem = React117.forwardRef(({ className, children, variant, size, ...props }, ref) => {
46522
46850
  const context = React117.useContext(ToggleGroupContext);
46523
- return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
46851
+ return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
46524
46852
  ToggleGroupPrimitive.Item,
46525
46853
  {
46526
46854
  ref,
@@ -46539,7 +46867,7 @@ var ToggleGroupItem = React117.forwardRef(({ className, children, variant, size,
46539
46867
  ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
46540
46868
 
46541
46869
  // src/render/PXEngineRenderer.tsx
46542
- var import_jsx_runtime187 = require("react/jsx-runtime");
46870
+ var import_jsx_runtime188 = require("react/jsx-runtime");
46543
46871
  var MOLECULE_REFS = new Set(Object.values(molecules_exports));
46544
46872
  var CONTEXT_DEPENDENT_COMPONENTS = /* @__PURE__ */ new Set([
46545
46873
  // Form components - require FormField + FormItem context
@@ -46645,24 +46973,24 @@ var REGISTERED_COMPONENTS = /* @__PURE__ */ new Set([
46645
46973
  ]);
46646
46974
  var renderContextDependentError = (componentName, normalizedName, key) => {
46647
46975
  const suggestion = COMPONENT_SUGGESTIONS[normalizedName] || `${componentName}Atom (if available)`;
46648
- return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
46976
+ return /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(
46649
46977
  "div",
46650
46978
  {
46651
46979
  className: "p-4 border-2 border-amber-500/50 rounded-lg bg-amber-50/80 space-y-2 my-2",
46652
46980
  children: [
46653
- /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)("div", { className: "flex items-start gap-2", children: [
46654
- /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("span", { className: "text-amber-600 font-bold text-lg", children: "\u26A0\uFE0F" }),
46655
- /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)("div", { className: "flex-1", children: [
46656
- /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)("p", { className: "text-sm font-semibold text-amber-900", children: [
46981
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)("div", { className: "flex items-start gap-2", children: [
46982
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsx)("span", { className: "text-amber-600 font-bold text-lg", children: "\u26A0\uFE0F" }),
46983
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)("div", { className: "flex-1", children: [
46984
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)("p", { className: "text-sm font-semibold text-amber-900", children: [
46657
46985
  "Invalid Component: ",
46658
46986
  componentName
46659
46987
  ] }),
46660
- /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("p", { className: "text-xs text-amber-700 mt-1", children: "This component requires React Context and cannot be rendered directly in schemas." })
46988
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsx)("p", { className: "text-xs text-amber-700 mt-1", children: "This component requires React Context and cannot be rendered directly in schemas." })
46661
46989
  ] })
46662
46990
  ] }),
46663
- /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)("div", { className: "bg-white/60 p-3 rounded border border-amber-200", children: [
46664
- /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("p", { className: "text-xs font-semibold text-gray-700 mb-1.5", children: "\u2713 Use instead:" }),
46665
- /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("code", { className: "text-xs text-blue-700 bg-blue-50 px-2 py-1 rounded", children: suggestion })
46991
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)("div", { className: "bg-white/60 p-3 rounded border border-amber-200", children: [
46992
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsx)("p", { className: "text-xs font-semibold text-gray-700 mb-1.5", children: "\u2713 Use instead:" }),
46993
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsx)("code", { className: "text-xs text-blue-700 bg-blue-50 px-2 py-1 rounded", children: suggestion })
46666
46994
  ] })
46667
46995
  ]
46668
46996
  },
@@ -46755,11 +47083,11 @@ var PXEngineRenderer = ({
46755
47083
  theme,
46756
47084
  onFormSubmit
46757
47085
  }) => {
46758
- const contextTheme = import_react95.default.useContext(WidgetThemeContext);
47086
+ const contextTheme = import_react96.default.useContext(WidgetThemeContext);
46759
47087
  const effectiveTheme = theme ?? contextTheme;
46760
- const formValuesRef = import_react95.default.useRef({});
46761
- const [, forceUpdate] = import_react95.default.useReducer((x) => x + 1, 0);
46762
- const handleInputValueChange = import_react95.default.useCallback((key, value) => {
47088
+ const formValuesRef = import_react96.default.useRef({});
47089
+ const [, forceUpdate] = import_react96.default.useReducer((x) => x + 1, 0);
47090
+ const handleInputValueChange = import_react96.default.useCallback((key, value) => {
46763
47091
  formValuesRef.current[key] = value;
46764
47092
  forceUpdate();
46765
47093
  }, []);
@@ -46767,12 +47095,12 @@ var PXEngineRenderer = ({
46767
47095
  const root = schema.root || schema;
46768
47096
  const renderRecursive = (component, index) => {
46769
47097
  if (Array.isArray(component)) {
46770
- return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_react95.default.Fragment, { children: component.map((child, idx) => renderRecursive(child, idx)) }, index !== void 0 ? `array-${index}` : "array-root");
47098
+ return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_react96.default.Fragment, { children: component.map((child, idx) => renderRecursive(child, idx)) }, index !== void 0 ? `array-${index}` : "array-root");
46771
47099
  }
46772
47100
  if (typeof component === "string" || typeof component === "number") {
46773
47101
  return component;
46774
47102
  }
46775
- if (import_react95.default.isValidElement(component)) {
47103
+ if (import_react96.default.isValidElement(component)) {
46776
47104
  return component;
46777
47105
  }
46778
47106
  if (!component || typeof component !== "object") return null;
@@ -46890,7 +47218,7 @@ var PXEngineRenderer = ({
46890
47218
  const effectiveOnAction = finalProps.onAction ?? onAction;
46891
47219
  delete finalProps.onAction;
46892
47220
  if (isAtomWithRenderProp) {
46893
- return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
47221
+ return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
46894
47222
  TargetComponent,
46895
47223
  {
46896
47224
  ...finalProps,
@@ -46902,7 +47230,7 @@ var PXEngineRenderer = ({
46902
47230
  uniqueKey
46903
47231
  );
46904
47232
  } else {
46905
- return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
47233
+ return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
46906
47234
  TargetComponent,
46907
47235
  {
46908
47236
  ...finalProps,
@@ -46914,7 +47242,7 @@ var PXEngineRenderer = ({
46914
47242
  );
46915
47243
  }
46916
47244
  };
46917
- 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) }) });
47245
+ return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(WidgetThemeContext.Provider, { value: effectiveTheme, children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)("div", { className: "px-engine-root relative w-full h-full", children: renderRecursive(root) }) });
46918
47246
  };
46919
47247
  // Annotate the CommonJS export names for ESM import in node:
46920
47248
  0 && (module.exports = {
@@ -46939,6 +47267,7 @@ var PXEngineRenderer = ({
46939
47267
  AlertDialogTitle,
46940
47268
  AlertDialogTrigger,
46941
47269
  AlertTitle,
47270
+ AnalyticsChart,
46942
47271
  ApprovalCard,
46943
47272
  ArrowToggleAtom,
46944
47273
  AspectRatio,