@flamingo-stack/openframe-frontend-core 0.0.391-snapshot.20260709132828 → 0.0.391
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/{chunk-45IP2W4W.js → chunk-2TFCOMFQ.js} +2 -2
- package/dist/{chunk-2RCCOZHC.cjs → chunk-3YV3FI5E.cjs} +15 -15
- package/dist/{chunk-2RCCOZHC.cjs.map → chunk-3YV3FI5E.cjs.map} +1 -1
- package/dist/{chunk-GCUAXBR6.cjs → chunk-5HCC7RSF.cjs} +9 -9
- package/dist/{chunk-GCUAXBR6.cjs.map → chunk-5HCC7RSF.cjs.map} +1 -1
- package/dist/{chunk-ANLFC67D.cjs → chunk-7GG5RDQB.cjs} +37 -37
- package/dist/{chunk-ANLFC67D.cjs.map → chunk-7GG5RDQB.cjs.map} +1 -1
- package/dist/{chunk-UCXBVKSM.cjs → chunk-AC4E7PQD.cjs} +26 -26
- package/dist/{chunk-UCXBVKSM.cjs.map → chunk-AC4E7PQD.cjs.map} +1 -1
- package/dist/{chunk-TTL3ILIM.cjs → chunk-AFYFMJPJ.cjs} +31 -31
- package/dist/{chunk-TTL3ILIM.cjs.map → chunk-AFYFMJPJ.cjs.map} +1 -1
- package/dist/{chunk-R2VRTPLY.js → chunk-EXJXZAAJ.js} +2 -2
- package/dist/{chunk-J6QEZIRO.js → chunk-GJ6TQJSO.js} +2 -2
- package/dist/{chunk-AGZMMTRL.js → chunk-GX67RMZM.js} +4 -4
- package/dist/{chunk-CSHLDG7J.js → chunk-IEIDLOYZ.js} +2 -2
- package/dist/{chunk-DHJVMIKE.cjs → chunk-IWWYZDOO.cjs} +26 -26
- package/dist/{chunk-DHJVMIKE.cjs.map → chunk-IWWYZDOO.cjs.map} +1 -1
- package/dist/{chunk-AQUU74K4.js → chunk-MQTSJILV.js} +4 -4
- package/dist/{chunk-4ZCXV6GB.js → chunk-OTCBUP5O.js} +4 -4
- package/dist/{chunk-2KW2GOFW.js → chunk-QDLI65SB.js} +140 -146
- package/dist/chunk-QDLI65SB.js.map +1 -0
- package/dist/{chunk-5PF4BSCV.cjs → chunk-QEYIABOI.cjs} +12 -12
- package/dist/{chunk-5PF4BSCV.cjs.map → chunk-QEYIABOI.cjs.map} +1 -1
- package/dist/{chunk-YV4UMWDP.cjs → chunk-RYEF2GHD.cjs} +59 -59
- package/dist/{chunk-YV4UMWDP.cjs.map → chunk-RYEF2GHD.cjs.map} +1 -1
- package/dist/{chunk-NYAZENBC.cjs → chunk-SZ2A35GQ.cjs} +7 -7
- package/dist/{chunk-NYAZENBC.cjs.map → chunk-SZ2A35GQ.cjs.map} +1 -1
- package/dist/{chunk-QEN2T5AV.js → chunk-UHCO2INP.js} +2 -2
- package/dist/{chunk-3YBDFKBZ.cjs → chunk-V4KVHAAF.cjs} +132 -138
- package/dist/chunk-V4KVHAAF.cjs.map +1 -0
- package/dist/{chunk-SGKMMZBD.js → chunk-V5ABSONJ.js} +2 -2
- package/dist/{chunk-2Q2PIMSX.cjs → chunk-V7WGZ7OA.cjs} +5 -5
- package/dist/{chunk-2Q2PIMSX.cjs.map → chunk-V7WGZ7OA.cjs.map} +1 -1
- package/dist/{chunk-4L4JG5GB.js → chunk-XDKKZB6T.js} +2 -2
- package/dist/{chunk-HXFHEKGD.js → chunk-XUPZ3KY5.js} +4 -4
- package/dist/{chunk-FGZ23YLT.cjs → chunk-ZONZ2HLZ.cjs} +62 -62
- package/dist/{chunk-FGZ23YLT.cjs.map → chunk-ZONZ2HLZ.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +120 -120
- package/dist/components/index.js +9 -9
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/chat/chat-message-enhanced.tsx +1 -11
- package/src/styles/app-globals.css +17 -30
- package/dist/chunk-2KW2GOFW.js.map +0 -1
- package/dist/chunk-3YBDFKBZ.cjs.map +0 -1
- /package/dist/{chunk-45IP2W4W.js.map → chunk-2TFCOMFQ.js.map} +0 -0
- /package/dist/{chunk-R2VRTPLY.js.map → chunk-EXJXZAAJ.js.map} +0 -0
- /package/dist/{chunk-J6QEZIRO.js.map → chunk-GJ6TQJSO.js.map} +0 -0
- /package/dist/{chunk-AGZMMTRL.js.map → chunk-GX67RMZM.js.map} +0 -0
- /package/dist/{chunk-CSHLDG7J.js.map → chunk-IEIDLOYZ.js.map} +0 -0
- /package/dist/{chunk-AQUU74K4.js.map → chunk-MQTSJILV.js.map} +0 -0
- /package/dist/{chunk-4ZCXV6GB.js.map → chunk-OTCBUP5O.js.map} +0 -0
- /package/dist/{chunk-QEN2T5AV.js.map → chunk-UHCO2INP.js.map} +0 -0
- /package/dist/{chunk-SGKMMZBD.js.map → chunk-V5ABSONJ.js.map} +0 -0
- /package/dist/{chunk-4L4JG5GB.js.map → chunk-XDKKZB6T.js.map} +0 -0
- /package/dist/{chunk-HXFHEKGD.js.map → chunk-XUPZ3KY5.js.map} +0 -0
|
@@ -4494,135 +4494,6 @@ ChatInput.displayName = "ChatInput";
|
|
|
4494
4494
|
init_cn();
|
|
4495
4495
|
import React9, { forwardRef as forwardRef11, memo as memo3, useMemo as useMemo6, useRef as useRef6 } from "react";
|
|
4496
4496
|
|
|
4497
|
-
// src/utils/date-utils.ts
|
|
4498
|
-
function formatTicketRelativeTime(iso) {
|
|
4499
|
-
const now = /* @__PURE__ */ new Date();
|
|
4500
|
-
const date = new Date(iso);
|
|
4501
|
-
if (Number.isNaN(date.getTime())) return "";
|
|
4502
|
-
const diffMs = now.getTime() - date.getTime();
|
|
4503
|
-
const diffMin = Math.floor(diffMs / 6e4);
|
|
4504
|
-
if (diffMin < 1) return "Just now";
|
|
4505
|
-
if (diffMin < 60) return `${diffMin} min ago`;
|
|
4506
|
-
const diffHours = Math.floor(diffMin / 60);
|
|
4507
|
-
if (diffHours < 24) return diffHours === 1 ? "1 hour ago" : `${diffHours} hours ago`;
|
|
4508
|
-
const mm = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
4509
|
-
const dd = String(date.getUTCDate()).padStart(2, "0");
|
|
4510
|
-
const yyyy = date.getUTCFullYear();
|
|
4511
|
-
return `${mm}/${dd}/${yyyy}`;
|
|
4512
|
-
}
|
|
4513
|
-
function formatTicketFullTimestamp(iso) {
|
|
4514
|
-
const date = new Date(iso);
|
|
4515
|
-
if (Number.isNaN(date.getTime())) return "";
|
|
4516
|
-
const mm = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
4517
|
-
const dd = String(date.getUTCDate()).padStart(2, "0");
|
|
4518
|
-
const yyyy = date.getUTCFullYear();
|
|
4519
|
-
let hours = date.getUTCHours();
|
|
4520
|
-
const minutes = String(date.getUTCMinutes()).padStart(2, "0");
|
|
4521
|
-
const ampm = hours >= 12 ? "PM" : "AM";
|
|
4522
|
-
hours = hours % 12 || 12;
|
|
4523
|
-
return `${mm}/${dd}/${yyyy}, ${hours}:${minutes} ${ampm}`;
|
|
4524
|
-
}
|
|
4525
|
-
function formatRelativeTime(timestamp) {
|
|
4526
|
-
const now = /* @__PURE__ */ new Date();
|
|
4527
|
-
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
4528
|
-
if (isNaN(targetTime.getTime())) {
|
|
4529
|
-
console.warn("\u26A0\uFE0F Invalid timestamp in formatRelativeTime:", timestamp);
|
|
4530
|
-
return "Unknown time";
|
|
4531
|
-
}
|
|
4532
|
-
const diffInMs = now.getTime() - targetTime.getTime();
|
|
4533
|
-
const diffInMinutes = Math.floor(diffInMs / (1e3 * 60));
|
|
4534
|
-
if (diffInMinutes < 0) {
|
|
4535
|
-
return "Just now";
|
|
4536
|
-
}
|
|
4537
|
-
if (diffInMinutes < 1) return "Just now";
|
|
4538
|
-
if (diffInMinutes < 60) return `${diffInMinutes}m ago`;
|
|
4539
|
-
const diffInHours = Math.floor(diffInMinutes / 60);
|
|
4540
|
-
if (diffInHours < 24) return `${diffInHours}h ago`;
|
|
4541
|
-
const diffInDays = Math.floor(diffInHours / 24);
|
|
4542
|
-
if (diffInDays < 7) return `${diffInDays}d ago`;
|
|
4543
|
-
if (diffInDays < 30) {
|
|
4544
|
-
const weeks = Math.floor(diffInDays / 7);
|
|
4545
|
-
return `${weeks}w ago`;
|
|
4546
|
-
}
|
|
4547
|
-
return targetTime.toLocaleDateString("en-US", {
|
|
4548
|
-
month: "short",
|
|
4549
|
-
day: "numeric",
|
|
4550
|
-
year: targetTime.getUTCFullYear() !== now.getUTCFullYear() ? "numeric" : void 0,
|
|
4551
|
-
timeZone: "UTC"
|
|
4552
|
-
});
|
|
4553
|
-
}
|
|
4554
|
-
function formatAbsoluteDate(timestamp, options = {}) {
|
|
4555
|
-
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
4556
|
-
if (isNaN(targetTime.getTime())) {
|
|
4557
|
-
console.warn("\u26A0\uFE0F Invalid timestamp in formatAbsoluteDate:", timestamp);
|
|
4558
|
-
return "Invalid date";
|
|
4559
|
-
}
|
|
4560
|
-
const defaultOptions2 = {
|
|
4561
|
-
year: "numeric",
|
|
4562
|
-
month: "short",
|
|
4563
|
-
day: "numeric",
|
|
4564
|
-
// Pin to UTC so SSR (Vercel = UTC) and the client agree (React #418).
|
|
4565
|
-
// Caller can override via `options`.
|
|
4566
|
-
timeZone: "UTC",
|
|
4567
|
-
...options
|
|
4568
|
-
};
|
|
4569
|
-
return targetTime.toLocaleDateString("en-US", defaultOptions2);
|
|
4570
|
-
}
|
|
4571
|
-
function formatDateTime(timestamp, options = {}) {
|
|
4572
|
-
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
4573
|
-
if (isNaN(targetTime.getTime())) {
|
|
4574
|
-
console.warn("\u26A0\uFE0F Invalid timestamp in formatDateTime:", timestamp);
|
|
4575
|
-
return "Invalid date";
|
|
4576
|
-
}
|
|
4577
|
-
const defaultOptions2 = {
|
|
4578
|
-
year: "numeric",
|
|
4579
|
-
month: "short",
|
|
4580
|
-
day: "numeric",
|
|
4581
|
-
hour: "numeric",
|
|
4582
|
-
minute: "2-digit",
|
|
4583
|
-
// Pin to UTC so SSR (Vercel = UTC) and the client agree (React #418).
|
|
4584
|
-
// Caller can override via `options`.
|
|
4585
|
-
timeZone: "UTC",
|
|
4586
|
-
...options
|
|
4587
|
-
};
|
|
4588
|
-
return targetTime.toLocaleDateString("en-US", defaultOptions2);
|
|
4589
|
-
}
|
|
4590
|
-
function getDetailedTimeDifference(timestamp) {
|
|
4591
|
-
const now = /* @__PURE__ */ new Date();
|
|
4592
|
-
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
4593
|
-
if (isNaN(targetTime.getTime())) {
|
|
4594
|
-
return "Invalid date";
|
|
4595
|
-
}
|
|
4596
|
-
const diffInMs = now.getTime() - targetTime.getTime();
|
|
4597
|
-
const diffInSeconds = Math.floor(diffInMs / 1e3);
|
|
4598
|
-
const diffInMinutes = Math.floor(diffInSeconds / 60);
|
|
4599
|
-
const diffInHours = Math.floor(diffInMinutes / 60);
|
|
4600
|
-
const diffInDays = Math.floor(diffInHours / 24);
|
|
4601
|
-
if (diffInSeconds < 60) return `${diffInSeconds} seconds ago`;
|
|
4602
|
-
if (diffInMinutes < 60) return `${diffInMinutes} minutes ago`;
|
|
4603
|
-
if (diffInHours < 24) return `${diffInHours} hours ago`;
|
|
4604
|
-
if (diffInDays < 30) return `${diffInDays} days ago`;
|
|
4605
|
-
const diffInMonths = Math.floor(diffInDays / 30);
|
|
4606
|
-
if (diffInMonths < 12) return `${diffInMonths} months ago`;
|
|
4607
|
-
const diffInYears = Math.floor(diffInDays / 365);
|
|
4608
|
-
return `${diffInYears} years ago`;
|
|
4609
|
-
}
|
|
4610
|
-
function isToday(timestamp) {
|
|
4611
|
-
const today = /* @__PURE__ */ new Date();
|
|
4612
|
-
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
4613
|
-
return today.toDateString() === targetTime.toDateString();
|
|
4614
|
-
}
|
|
4615
|
-
function isWithinMinutes(timestamp, minutes) {
|
|
4616
|
-
const now = /* @__PURE__ */ new Date();
|
|
4617
|
-
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
4618
|
-
const diffInMs = now.getTime() - targetTime.getTime();
|
|
4619
|
-
const diffInMinutes = diffInMs / (1e3 * 60);
|
|
4620
|
-
return diffInMinutes <= minutes && diffInMinutes >= 0;
|
|
4621
|
-
}
|
|
4622
|
-
function createUTCTimestamp() {
|
|
4623
|
-
return (/* @__PURE__ */ new Date()).toISOString();
|
|
4624
|
-
}
|
|
4625
|
-
|
|
4626
4497
|
// src/components/chat/tool-execution-display.tsx
|
|
4627
4498
|
init_cn();
|
|
4628
4499
|
import { forwardRef as forwardRef10, useMemo as useMemo4, useState as useState9 } from "react";
|
|
@@ -5232,12 +5103,6 @@ function ChatContextChipStrip({
|
|
|
5232
5103
|
import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5233
5104
|
var MENTION_MARKER_REGEX = /(^|[^\w@])@[a-z]+:([A-Za-z0-9_.+/=-]*[A-Za-z0-9_+/=])/g;
|
|
5234
5105
|
var CARD_MARKER_REGEX = /\[card:\/\/([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)[\])]/g;
|
|
5235
|
-
function formatMessageTimestamp(timestamp) {
|
|
5236
|
-
const time = timestamp.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
|
|
5237
|
-
if (isToday(timestamp)) return time;
|
|
5238
|
-
const date = timestamp.toLocaleDateString("en-US", { month: "2-digit", day: "2-digit", year: "numeric" });
|
|
5239
|
-
return `${date} ${time}`;
|
|
5240
|
-
}
|
|
5241
5106
|
function normalizeContent(content) {
|
|
5242
5107
|
if (typeof content === "string") {
|
|
5243
5108
|
return content ? [{ type: "text", text: content }] : [];
|
|
@@ -5437,7 +5302,7 @@ var ChatMessageEnhanced = forwardRef11(
|
|
|
5437
5302
|
name || (isUser ? "User" : assistantType === "mingo" ? "Mingo" : "Fae"),
|
|
5438
5303
|
!isSystem && ":"
|
|
5439
5304
|
] }),
|
|
5440
|
-
timestamp && /* @__PURE__ */ jsx26("span", { className: "font-sans text-heading-5 font-medium text-ods-text-secondary shrink-0 whitespace-nowrap", children:
|
|
5305
|
+
timestamp && /* @__PURE__ */ jsx26("span", { className: "font-sans text-heading-5 font-medium text-ods-text-secondary shrink-0 whitespace-nowrap", children: timestamp.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
|
|
5441
5306
|
] }),
|
|
5442
5307
|
(!isSystem || segments.length > 0) && /* @__PURE__ */ jsx26("div", { className: "flex flex-col gap-2", children: segments.map((segment, index) => {
|
|
5443
5308
|
if (segment.type === "text") {
|
|
@@ -22548,6 +22413,135 @@ async function extractImageEdgeColorAsync(imageUrl) {
|
|
|
22548
22413
|
});
|
|
22549
22414
|
}
|
|
22550
22415
|
|
|
22416
|
+
// src/utils/date-utils.ts
|
|
22417
|
+
function formatTicketRelativeTime(iso) {
|
|
22418
|
+
const now = /* @__PURE__ */ new Date();
|
|
22419
|
+
const date = new Date(iso);
|
|
22420
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
22421
|
+
const diffMs = now.getTime() - date.getTime();
|
|
22422
|
+
const diffMin = Math.floor(diffMs / 6e4);
|
|
22423
|
+
if (diffMin < 1) return "Just now";
|
|
22424
|
+
if (diffMin < 60) return `${diffMin} min ago`;
|
|
22425
|
+
const diffHours = Math.floor(diffMin / 60);
|
|
22426
|
+
if (diffHours < 24) return diffHours === 1 ? "1 hour ago" : `${diffHours} hours ago`;
|
|
22427
|
+
const mm = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
22428
|
+
const dd = String(date.getUTCDate()).padStart(2, "0");
|
|
22429
|
+
const yyyy = date.getUTCFullYear();
|
|
22430
|
+
return `${mm}/${dd}/${yyyy}`;
|
|
22431
|
+
}
|
|
22432
|
+
function formatTicketFullTimestamp(iso) {
|
|
22433
|
+
const date = new Date(iso);
|
|
22434
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
22435
|
+
const mm = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
22436
|
+
const dd = String(date.getUTCDate()).padStart(2, "0");
|
|
22437
|
+
const yyyy = date.getUTCFullYear();
|
|
22438
|
+
let hours = date.getUTCHours();
|
|
22439
|
+
const minutes = String(date.getUTCMinutes()).padStart(2, "0");
|
|
22440
|
+
const ampm = hours >= 12 ? "PM" : "AM";
|
|
22441
|
+
hours = hours % 12 || 12;
|
|
22442
|
+
return `${mm}/${dd}/${yyyy}, ${hours}:${minutes} ${ampm}`;
|
|
22443
|
+
}
|
|
22444
|
+
function formatRelativeTime(timestamp) {
|
|
22445
|
+
const now = /* @__PURE__ */ new Date();
|
|
22446
|
+
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
22447
|
+
if (isNaN(targetTime.getTime())) {
|
|
22448
|
+
console.warn("\u26A0\uFE0F Invalid timestamp in formatRelativeTime:", timestamp);
|
|
22449
|
+
return "Unknown time";
|
|
22450
|
+
}
|
|
22451
|
+
const diffInMs = now.getTime() - targetTime.getTime();
|
|
22452
|
+
const diffInMinutes = Math.floor(diffInMs / (1e3 * 60));
|
|
22453
|
+
if (diffInMinutes < 0) {
|
|
22454
|
+
return "Just now";
|
|
22455
|
+
}
|
|
22456
|
+
if (diffInMinutes < 1) return "Just now";
|
|
22457
|
+
if (diffInMinutes < 60) return `${diffInMinutes}m ago`;
|
|
22458
|
+
const diffInHours = Math.floor(diffInMinutes / 60);
|
|
22459
|
+
if (diffInHours < 24) return `${diffInHours}h ago`;
|
|
22460
|
+
const diffInDays = Math.floor(diffInHours / 24);
|
|
22461
|
+
if (diffInDays < 7) return `${diffInDays}d ago`;
|
|
22462
|
+
if (diffInDays < 30) {
|
|
22463
|
+
const weeks = Math.floor(diffInDays / 7);
|
|
22464
|
+
return `${weeks}w ago`;
|
|
22465
|
+
}
|
|
22466
|
+
return targetTime.toLocaleDateString("en-US", {
|
|
22467
|
+
month: "short",
|
|
22468
|
+
day: "numeric",
|
|
22469
|
+
year: targetTime.getUTCFullYear() !== now.getUTCFullYear() ? "numeric" : void 0,
|
|
22470
|
+
timeZone: "UTC"
|
|
22471
|
+
});
|
|
22472
|
+
}
|
|
22473
|
+
function formatAbsoluteDate(timestamp, options = {}) {
|
|
22474
|
+
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
22475
|
+
if (isNaN(targetTime.getTime())) {
|
|
22476
|
+
console.warn("\u26A0\uFE0F Invalid timestamp in formatAbsoluteDate:", timestamp);
|
|
22477
|
+
return "Invalid date";
|
|
22478
|
+
}
|
|
22479
|
+
const defaultOptions2 = {
|
|
22480
|
+
year: "numeric",
|
|
22481
|
+
month: "short",
|
|
22482
|
+
day: "numeric",
|
|
22483
|
+
// Pin to UTC so SSR (Vercel = UTC) and the client agree (React #418).
|
|
22484
|
+
// Caller can override via `options`.
|
|
22485
|
+
timeZone: "UTC",
|
|
22486
|
+
...options
|
|
22487
|
+
};
|
|
22488
|
+
return targetTime.toLocaleDateString("en-US", defaultOptions2);
|
|
22489
|
+
}
|
|
22490
|
+
function formatDateTime(timestamp, options = {}) {
|
|
22491
|
+
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
22492
|
+
if (isNaN(targetTime.getTime())) {
|
|
22493
|
+
console.warn("\u26A0\uFE0F Invalid timestamp in formatDateTime:", timestamp);
|
|
22494
|
+
return "Invalid date";
|
|
22495
|
+
}
|
|
22496
|
+
const defaultOptions2 = {
|
|
22497
|
+
year: "numeric",
|
|
22498
|
+
month: "short",
|
|
22499
|
+
day: "numeric",
|
|
22500
|
+
hour: "numeric",
|
|
22501
|
+
minute: "2-digit",
|
|
22502
|
+
// Pin to UTC so SSR (Vercel = UTC) and the client agree (React #418).
|
|
22503
|
+
// Caller can override via `options`.
|
|
22504
|
+
timeZone: "UTC",
|
|
22505
|
+
...options
|
|
22506
|
+
};
|
|
22507
|
+
return targetTime.toLocaleDateString("en-US", defaultOptions2);
|
|
22508
|
+
}
|
|
22509
|
+
function getDetailedTimeDifference(timestamp) {
|
|
22510
|
+
const now = /* @__PURE__ */ new Date();
|
|
22511
|
+
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
22512
|
+
if (isNaN(targetTime.getTime())) {
|
|
22513
|
+
return "Invalid date";
|
|
22514
|
+
}
|
|
22515
|
+
const diffInMs = now.getTime() - targetTime.getTime();
|
|
22516
|
+
const diffInSeconds = Math.floor(diffInMs / 1e3);
|
|
22517
|
+
const diffInMinutes = Math.floor(diffInSeconds / 60);
|
|
22518
|
+
const diffInHours = Math.floor(diffInMinutes / 60);
|
|
22519
|
+
const diffInDays = Math.floor(diffInHours / 24);
|
|
22520
|
+
if (diffInSeconds < 60) return `${diffInSeconds} seconds ago`;
|
|
22521
|
+
if (diffInMinutes < 60) return `${diffInMinutes} minutes ago`;
|
|
22522
|
+
if (diffInHours < 24) return `${diffInHours} hours ago`;
|
|
22523
|
+
if (diffInDays < 30) return `${diffInDays} days ago`;
|
|
22524
|
+
const diffInMonths = Math.floor(diffInDays / 30);
|
|
22525
|
+
if (diffInMonths < 12) return `${diffInMonths} months ago`;
|
|
22526
|
+
const diffInYears = Math.floor(diffInDays / 365);
|
|
22527
|
+
return `${diffInYears} years ago`;
|
|
22528
|
+
}
|
|
22529
|
+
function isToday(timestamp) {
|
|
22530
|
+
const today = /* @__PURE__ */ new Date();
|
|
22531
|
+
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
22532
|
+
return today.toDateString() === targetTime.toDateString();
|
|
22533
|
+
}
|
|
22534
|
+
function isWithinMinutes(timestamp, minutes) {
|
|
22535
|
+
const now = /* @__PURE__ */ new Date();
|
|
22536
|
+
const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
|
|
22537
|
+
const diffInMs = now.getTime() - targetTime.getTime();
|
|
22538
|
+
const diffInMinutes = diffInMs / (1e3 * 60);
|
|
22539
|
+
return diffInMinutes <= minutes && diffInMinutes >= 0;
|
|
22540
|
+
}
|
|
22541
|
+
function createUTCTimestamp() {
|
|
22542
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
22543
|
+
}
|
|
22544
|
+
|
|
22551
22545
|
// src/utils/source-icons.ts
|
|
22552
22546
|
var SOURCE_ICON_NAMES = {
|
|
22553
22547
|
// Doc tables
|
|
@@ -52054,15 +52048,6 @@ export {
|
|
|
52054
52048
|
ICON_OPTIONS,
|
|
52055
52049
|
SlashCommandSuggestions,
|
|
52056
52050
|
ChatInput,
|
|
52057
|
-
formatTicketRelativeTime,
|
|
52058
|
-
formatTicketFullTimestamp,
|
|
52059
|
-
formatRelativeTime,
|
|
52060
|
-
formatAbsoluteDate,
|
|
52061
|
-
formatDateTime,
|
|
52062
|
-
getDetailedTimeDifference,
|
|
52063
|
-
isToday,
|
|
52064
|
-
isWithinMinutes,
|
|
52065
|
-
createUTCTimestamp,
|
|
52066
52051
|
ToolExecutionDisplay,
|
|
52067
52052
|
remarkCardLinks,
|
|
52068
52053
|
remarkMentionChips,
|
|
@@ -52409,6 +52394,15 @@ export {
|
|
|
52409
52394
|
getBestContrastColor,
|
|
52410
52395
|
analyzeImageColor,
|
|
52411
52396
|
extractImageEdgeColorAsync,
|
|
52397
|
+
formatTicketRelativeTime,
|
|
52398
|
+
formatTicketFullTimestamp,
|
|
52399
|
+
formatRelativeTime,
|
|
52400
|
+
formatAbsoluteDate,
|
|
52401
|
+
formatDateTime,
|
|
52402
|
+
getDetailedTimeDifference,
|
|
52403
|
+
isToday,
|
|
52404
|
+
isWithinMinutes,
|
|
52405
|
+
createUTCTimestamp,
|
|
52412
52406
|
readLeadingDecisionFrame,
|
|
52413
52407
|
AVAILABLE_SVG_ICONS,
|
|
52414
52408
|
releaseTypeOptions,
|
|
@@ -52722,4 +52716,4 @@ export {
|
|
|
52722
52716
|
LogsList,
|
|
52723
52717
|
assets
|
|
52724
52718
|
};
|
|
52725
|
-
//# sourceMappingURL=chunk-
|
|
52719
|
+
//# sourceMappingURL=chunk-QDLI65SB.js.map
|