@flamingo-stack/openframe-frontend-core 0.0.215 → 0.0.216

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.
Files changed (228) hide show
  1. package/dist/chunk-2V4SACHE.js +302 -0
  2. package/dist/chunk-2V4SACHE.js.map +1 -0
  3. package/dist/chunk-572WQWIX.cjs +348 -0
  4. package/dist/chunk-572WQWIX.cjs.map +1 -0
  5. package/dist/{chunk-WT5JV2GS.cjs → chunk-5V6MSE3B.cjs} +39 -39
  6. package/dist/chunk-5V6MSE3B.cjs.map +1 -0
  7. package/dist/{chunk-WQZP3JIZ.js → chunk-CDLYRFDE.js} +1894 -1472
  8. package/dist/chunk-CDLYRFDE.js.map +1 -0
  9. package/dist/chunk-GVNQAGXB.js +232 -0
  10. package/dist/chunk-GVNQAGXB.js.map +1 -0
  11. package/dist/{chunk-P5EE2VJX.cjs → chunk-HOHDXYPR.cjs} +1 -1
  12. package/dist/chunk-HOHDXYPR.cjs.map +1 -0
  13. package/dist/chunk-IH76P5R6.cjs +232 -0
  14. package/dist/chunk-IH76P5R6.cjs.map +1 -0
  15. package/dist/{chunk-24KCAECR.cjs → chunk-JJR27M56.cjs} +3 -3
  16. package/dist/{chunk-24KCAECR.cjs.map → chunk-JJR27M56.cjs.map} +1 -1
  17. package/dist/chunk-K4DFAVSO.cjs +302 -0
  18. package/dist/chunk-K4DFAVSO.cjs.map +1 -0
  19. package/dist/{chunk-HICZPTRR.js → chunk-LCLTCCXS.js} +14 -14
  20. package/dist/chunk-LCLTCCXS.js.map +1 -0
  21. package/dist/{chunk-VFKQMAUF.cjs → chunk-OB45JHDY.cjs} +3 -3
  22. package/dist/{chunk-VFKQMAUF.cjs.map → chunk-OB45JHDY.cjs.map} +1 -1
  23. package/dist/{chunk-4XLJWX2N.js → chunk-ORJREQ2W.js} +4 -4
  24. package/dist/{chunk-7PCP7YQR.js → chunk-QTKU6ULP.js} +6 -6
  25. package/dist/{chunk-CIPO6DXK.js → chunk-QY75VKAS.js} +5 -5
  26. package/dist/{chunk-ZG2YY5E7.js → chunk-RFONYT63.js} +1 -1
  27. package/dist/chunk-RFONYT63.js.map +1 -0
  28. package/dist/{chunk-NGFP4RVL.cjs → chunk-SMCG2CCC.cjs} +30 -30
  29. package/dist/{chunk-NGFP4RVL.cjs.map → chunk-SMCG2CCC.cjs.map} +1 -1
  30. package/dist/{chunk-MX5MIFWA.js → chunk-UEBM4PC4.js} +5 -5
  31. package/dist/chunk-VC3ND5RB.js +348 -0
  32. package/dist/chunk-VC3ND5RB.js.map +1 -0
  33. package/dist/{chunk-UXZ3ZJ3M.cjs → chunk-XDPSSE4O.cjs} +4 -4
  34. package/dist/{chunk-UXZ3ZJ3M.cjs.map → chunk-XDPSSE4O.cjs.map} +1 -1
  35. package/dist/{chunk-D4MNFY67.cjs → chunk-ZGTDUPTW.cjs} +1316 -894
  36. package/dist/chunk-ZGTDUPTW.cjs.map +1 -0
  37. package/dist/components/chat/entity-cards/blog-card.d.ts +1 -1
  38. package/dist/components/chat/entity-cards/blog-card.d.ts.map +1 -1
  39. package/dist/components/chat/entity-cards/case-study-card.d.ts +1 -1
  40. package/dist/components/chat/entity-cards/case-study-card.d.ts.map +1 -1
  41. package/dist/components/chat/entity-cards/customer-interview-card.d.ts +1 -1
  42. package/dist/components/chat/entity-cards/customer-interview-card.d.ts.map +1 -1
  43. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  44. package/dist/components/chat/entity-cards/investor-update-card.d.ts +1 -1
  45. package/dist/components/chat/entity-cards/investor-update-card.d.ts.map +1 -1
  46. package/dist/components/chat/entity-cards/onboarding-guide-card.d.ts +1 -1
  47. package/dist/components/chat/entity-cards/onboarding-guide-card.d.ts.map +1 -1
  48. package/dist/components/chat/entity-cards/program-card.d.ts +1 -1
  49. package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -1
  50. package/dist/components/chat/entity-cards/use-entity-card-link.d.ts +14 -0
  51. package/dist/components/chat/entity-cards/use-entity-card-link.d.ts.map +1 -0
  52. package/dist/components/chat/entity-cards/use-entity-card-placeholder.d.ts +13 -0
  53. package/dist/components/chat/entity-cards/use-entity-card-placeholder.d.ts.map +1 -0
  54. package/dist/components/chat/index.cjs +11 -11
  55. package/dist/components/chat/index.js +10 -10
  56. package/dist/components/contact/index.cjs +12 -12
  57. package/dist/components/contact/index.js +11 -11
  58. package/dist/components/features/captions-url.d.ts +18 -0
  59. package/dist/components/features/captions-url.d.ts.map +1 -0
  60. package/dist/components/features/index.cjs +23 -11
  61. package/dist/components/features/index.cjs.map +1 -1
  62. package/dist/components/features/index.d.ts +2 -0
  63. package/dist/components/features/index.d.ts.map +1 -1
  64. package/dist/components/features/index.js +24 -12
  65. package/dist/components/features/mux-origins.cjs +10 -0
  66. package/dist/components/features/mux-origins.cjs.map +1 -0
  67. package/dist/components/features/mux-origins.d.ts +26 -0
  68. package/dist/components/features/mux-origins.d.ts.map +1 -0
  69. package/dist/components/features/mux-origins.js +7 -0
  70. package/dist/components/features/mux-origins.js.map +1 -0
  71. package/dist/components/features/notifications/index.d.ts +2 -0
  72. package/dist/components/features/notifications/index.d.ts.map +1 -1
  73. package/dist/components/features/notifications/notification-drawer.d.ts +2 -1
  74. package/dist/components/features/notifications/notification-drawer.d.ts.map +1 -1
  75. package/dist/components/features/notifications/notification-popups.d.ts +10 -0
  76. package/dist/components/features/notifications/notification-popups.d.ts.map +1 -0
  77. package/dist/components/features/notifications/notifications-context.d.ts +8 -1
  78. package/dist/components/features/notifications/notifications-context.d.ts.map +1 -1
  79. package/dist/components/features/notifications/types.d.ts +1 -0
  80. package/dist/components/features/notifications/types.d.ts.map +1 -1
  81. package/dist/components/features/use-video-warmup.d.ts +53 -0
  82. package/dist/components/features/use-video-warmup.d.ts.map +1 -0
  83. package/dist/components/icons/index.cjs +3 -3
  84. package/dist/components/icons/index.js +2 -2
  85. package/dist/components/icons-v2-generated/index.cjs +2 -2
  86. package/dist/components/icons-v2-generated/index.cjs.map +1 -1
  87. package/dist/components/icons-v2-generated/index.js +4 -4
  88. package/dist/components/index.cjs +132 -102
  89. package/dist/components/index.cjs.map +1 -1
  90. package/dist/components/index.d.ts +1 -0
  91. package/dist/components/index.d.ts.map +1 -1
  92. package/dist/components/index.js +94 -64
  93. package/dist/components/index.js.map +1 -1
  94. package/dist/components/navigation/index.cjs +11 -11
  95. package/dist/components/navigation/index.js +10 -10
  96. package/dist/components/onboarding-guides/build-default-href.d.ts +15 -0
  97. package/dist/components/onboarding-guides/build-default-href.d.ts.map +1 -0
  98. package/dist/components/onboarding-guides/hooks/use-onboarding-guides.d.ts +28 -0
  99. package/dist/components/onboarding-guides/hooks/use-onboarding-guides.d.ts.map +1 -0
  100. package/dist/components/onboarding-guides/index.cjs +373 -0
  101. package/dist/components/onboarding-guides/index.cjs.map +1 -0
  102. package/dist/components/onboarding-guides/index.d.ts +25 -0
  103. package/dist/components/onboarding-guides/index.d.ts.map +1 -0
  104. package/dist/components/onboarding-guides/index.js +373 -0
  105. package/dist/components/onboarding-guides/index.js.map +1 -0
  106. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts +52 -0
  107. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -0
  108. package/dist/components/onboarding-guides/onboarding-guides-catalog-skeleton.d.ts +17 -0
  109. package/dist/components/onboarding-guides/onboarding-guides-catalog-skeleton.d.ts.map +1 -0
  110. package/dist/components/onboarding-guides/onboarding-guides-catalog-view.d.ts +43 -0
  111. package/dist/components/onboarding-guides/onboarding-guides-catalog-view.d.ts.map +1 -0
  112. package/dist/components/shared/doc-search/doc-search-bar.d.ts +59 -0
  113. package/dist/components/shared/doc-search/doc-search-bar.d.ts.map +1 -0
  114. package/dist/components/shared/doc-search/doc-search-result-row.d.ts +18 -0
  115. package/dist/components/shared/doc-search/doc-search-result-row.d.ts.map +1 -0
  116. package/dist/components/shared/doc-search/format-relative-path.d.ts +10 -0
  117. package/dist/components/shared/doc-search/format-relative-path.d.ts.map +1 -0
  118. package/dist/components/shared/doc-search/index.d.ts +8 -0
  119. package/dist/components/shared/doc-search/index.d.ts.map +1 -0
  120. package/dist/components/shared/doc-search/map-doc-search-results.d.ts +15 -0
  121. package/dist/components/shared/doc-search/map-doc-search-results.d.ts.map +1 -0
  122. package/dist/components/shared/doc-search/resolve-search-result-action.d.ts +37 -0
  123. package/dist/components/shared/doc-search/resolve-search-result-action.d.ts.map +1 -0
  124. package/dist/components/shared/doc-search/types.d.ts +29 -0
  125. package/dist/components/shared/doc-search/types.d.ts.map +1 -0
  126. package/dist/components/shared/doc-search/use-doc-search.d.ts +46 -0
  127. package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -0
  128. package/dist/components/tickets/help-center-card.d.ts +5 -1
  129. package/dist/components/tickets/help-center-card.d.ts.map +1 -1
  130. package/dist/components/tickets/hooks/use-ticket-actions.d.ts +8 -0
  131. package/dist/components/tickets/hooks/use-ticket-actions.d.ts.map +1 -1
  132. package/dist/components/tickets/index.cjs +316 -145
  133. package/dist/components/tickets/index.cjs.map +1 -1
  134. package/dist/components/tickets/index.js +237 -66
  135. package/dist/components/tickets/index.js.map +1 -1
  136. package/dist/components/tickets/ticket-detail-drawer.d.ts +11 -2
  137. package/dist/components/tickets/ticket-detail-drawer.d.ts.map +1 -1
  138. package/dist/components/tickets/types.d.ts +50 -1
  139. package/dist/components/tickets/types.d.ts.map +1 -1
  140. package/dist/components/ui/file-manager/index.cjs +51 -51
  141. package/dist/components/ui/file-manager/index.cjs.map +1 -1
  142. package/dist/components/ui/file-manager/index.js +2 -2
  143. package/dist/components/ui/filter-pill-row.d.ts +20 -0
  144. package/dist/components/ui/filter-pill-row.d.ts.map +1 -0
  145. package/dist/components/ui/index.cjs +16 -14
  146. package/dist/components/ui/index.cjs.map +1 -1
  147. package/dist/components/ui/index.d.ts +1 -0
  148. package/dist/components/ui/index.d.ts.map +1 -1
  149. package/dist/components/ui/index.js +21 -19
  150. package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
  151. package/dist/contexts/chat-runtime-context.d.ts +42 -0
  152. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  153. package/dist/contexts/index.cjs +2 -2
  154. package/dist/contexts/index.js +1 -1
  155. package/dist/embed-shims/index.cjs +3 -3
  156. package/dist/embed-shims/index.cjs.map +1 -1
  157. package/dist/embed-shims/index.js +5 -5
  158. package/dist/hooks/index.cjs +6 -6
  159. package/dist/hooks/index.js +5 -5
  160. package/dist/index.cjs +28 -14
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.js +59 -45
  163. package/dist/utils/dev-sections/openframe-dev-sections.d.ts +2 -2
  164. package/dist/utils/dev-sections/openframe-dev-sections.d.ts.map +1 -1
  165. package/dist/utils/index.cjs +11 -5
  166. package/dist/utils/index.cjs.map +1 -1
  167. package/dist/utils/index.js +11 -5
  168. package/dist/utils/index.js.map +1 -1
  169. package/package.json +13 -1
  170. package/src/components/chat/entity-cards/blog-card.tsx +17 -5
  171. package/src/components/chat/entity-cards/case-study-card.tsx +23 -1
  172. package/src/components/chat/entity-cards/customer-interview-card.tsx +23 -1
  173. package/src/components/chat/entity-cards/dispatch.tsx +21 -0
  174. package/src/components/chat/entity-cards/investor-update-card.tsx +23 -1
  175. package/src/components/chat/entity-cards/onboarding-guide-card.tsx +30 -4
  176. package/src/components/chat/entity-cards/program-card.tsx +17 -3
  177. package/src/components/chat/entity-cards/use-entity-card-link.ts +66 -0
  178. package/src/components/chat/entity-cards/use-entity-card-placeholder.ts +50 -0
  179. package/src/components/features/captions-url.ts +25 -0
  180. package/src/components/features/index.ts +2 -0
  181. package/src/components/features/mux-origins.ts +27 -0
  182. package/src/components/features/notifications/index.ts +2 -0
  183. package/src/components/features/notifications/notification-drawer.tsx +100 -16
  184. package/src/components/features/notifications/notification-popups.tsx +105 -0
  185. package/src/components/features/notifications/notifications-context.tsx +16 -0
  186. package/src/components/features/notifications/types.ts +1 -0
  187. package/src/components/features/use-video-warmup.ts +176 -0
  188. package/src/components/index.ts +5 -0
  189. package/src/components/onboarding-guides/build-default-href.ts +16 -0
  190. package/src/components/onboarding-guides/hooks/use-onboarding-guides.ts +90 -0
  191. package/src/components/onboarding-guides/index.ts +39 -0
  192. package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +215 -0
  193. package/src/components/onboarding-guides/onboarding-guides-catalog-skeleton.tsx +62 -0
  194. package/src/components/onboarding-guides/onboarding-guides-catalog-view.tsx +230 -0
  195. package/src/components/shared/doc-search/doc-search-bar.tsx +100 -0
  196. package/src/components/shared/doc-search/doc-search-result-row.tsx +73 -0
  197. package/src/components/shared/doc-search/format-relative-path.ts +17 -0
  198. package/src/components/shared/doc-search/index.ts +24 -0
  199. package/src/components/shared/doc-search/map-doc-search-results.ts +113 -0
  200. package/src/components/shared/doc-search/resolve-search-result-action.ts +68 -0
  201. package/src/components/shared/doc-search/types.ts +28 -0
  202. package/src/components/shared/doc-search/use-doc-search.ts +263 -0
  203. package/src/components/tickets/help-center-card.tsx +8 -0
  204. package/src/components/tickets/help-center-list.tsx +17 -3
  205. package/src/components/tickets/hooks/use-ticket-actions.ts +210 -14
  206. package/src/components/tickets/ticket-detail-drawer.tsx +145 -5
  207. package/src/components/tickets/types.ts +55 -0
  208. package/src/components/ui/filter-pill-row.tsx +72 -0
  209. package/src/components/ui/index.ts +1 -0
  210. package/src/components/ui/simple-markdown-renderer.tsx +24 -1
  211. package/src/components/ui/toaster.tsx +3 -3
  212. package/src/contexts/chat-runtime-context.tsx +41 -0
  213. package/src/stories/NotificationDrawer.stories.tsx +18 -2
  214. package/src/utils/dev-sections/openframe-dev-sections.ts +12 -5
  215. package/dist/chunk-2G3NXF6J.cjs +0 -521
  216. package/dist/chunk-2G3NXF6J.cjs.map +0 -1
  217. package/dist/chunk-D4MNFY67.cjs.map +0 -1
  218. package/dist/chunk-HICZPTRR.js.map +0 -1
  219. package/dist/chunk-P5EE2VJX.cjs.map +0 -1
  220. package/dist/chunk-R6MLPU4A.js +0 -521
  221. package/dist/chunk-R6MLPU4A.js.map +0 -1
  222. package/dist/chunk-WQZP3JIZ.js.map +0 -1
  223. package/dist/chunk-WT5JV2GS.cjs.map +0 -1
  224. package/dist/chunk-ZG2YY5E7.js.map +0 -1
  225. /package/dist/{chunk-4XLJWX2N.js.map → chunk-ORJREQ2W.js.map} +0 -0
  226. /package/dist/{chunk-7PCP7YQR.js.map → chunk-QTKU6ULP.js.map} +0 -0
  227. /package/dist/{chunk-CIPO6DXK.js.map → chunk-QY75VKAS.js.map} +0 -0
  228. /package/dist/{chunk-MX5MIFWA.js.map → chunk-UEBM4PC4.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-P5EE2VJX.cjs","../src/contexts/chat-runtime-context.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACiCA,8BAA0D;AAiGnD,IAAM,mBAAA,EAAqB,kCAAA,IAAsC,CAAA;AAQjE,SAAS,cAAA,CAAA,EAAqC;AACnD,EAAA,OAAO,+BAAA,kBAA6B,CAAA;AACtC;AAUO,SAAS,sBAAA,CAAA,EAAsC;AACpD,EAAA,MAAM,EAAA,EAAI,+BAAA,kBAA6B,CAAA;AACvC,EAAA,GAAA,CAAI,CAAC,CAAA,EAAG;AACN,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,IAMF,CAAA;AAAA,EACF;AACA,EAAA,OAAO,CAAA;AACT;ADpJA;AACA;AACE;AACA;AACA;AACF,kJAAC","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-P5EE2VJX.cjs","sourcesContent":[null,"'use client'\n\n/**\n * Chat runtime context — single seam for embedding the chat panel in a\n * different host (e.g. user1.openframe.ai reverse-proxying API calls\n * under /api/mingo-guide/* to hub.openframe.ai/api/*).\n *\n * Three concerns, one context:\n * 1. API endpoints: chatStreamUrl / approvalToolUrl / commandsUrl /\n * buildListUrl + attachment endpoints + chat-identity. The chat\n * reads them from runtime; hub vs embedded app supply different\n * strings via different providers.\n * 2. Navigation mode + callbacks: 'host' or 'embed' mode. Host wires\n * its own router/docNav via the optional `navigate` callback\n * (plain function, NOT a hook); embed forces new-tab via\n * `defaultContentOrigin` + lib's `resolveExternalNavigation`.\n * 3. Identity context: only `source` (required for localStorage\n * namespacing). The display identity (greeting first-name etc.)\n * comes from the server via `useChatIdentity()` — never injected\n * client-side, so it always matches the server-resolved auth.\n *\n * Sibling of EndpointsRuntimeContext (announcement bar, contact form,\n * access codes). Each runtime stays an independent React context so\n * embedders can opt into either feature without forcing the other.\n *\n * IMPORTANT for embedders: memoize the value passed to\n * `<ChatRuntimeContext.Provider value={...}>` (e.g. via React.useMemo).\n * Every change to its reference identity invalidates downstream\n * `useMemo` consumers (the chat input's slash-commands binding,\n * useNavLink's embed-resolution memo, useDocChat's streamFn factory).\n * The hub's `<HubRuntimeProvider>` already memoizes correctly with\n * stable deps. Embedded apps that build the value inline on each render\n * will pay an avoidable re-render cost across the entire chat tree.\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\n\n/**\n * Runtime config consumed by the chat panel.\n */\nexport interface ChatRuntime {\n endpoints: {\n /** POST streaming chat. Hub: '/api/docs/chat'. */\n chatStreamUrl: string\n /** POST agent approve/reject. Hub: '/api/chat/agent/confirm-tool'. */\n approvalToolUrl: string\n /** GET slash-command catalog. Hub: '/api/docs/commands'. */\n commandsUrl: string\n /** Build entity-card list URL for a content type + ids. Hub delegates\n * to the rag-table-config registry; embedded app provides its own\n * per-type URL builder against the reverse proxy. Returns null when\n * the type has no list endpoint (caller skips rendering). */\n buildListUrl: (type: string, ids: string[]) => string | null\n /** Chat-attachment endpoints — added for the v2 attachment feature.\n *\n * Three concerns:\n * - `attachmentUploadUrl` — POSTed by the chat-attachment hook\n * to mint a Supabase signed-upload-URL + HMAC view token.\n * - `attachmentViewUrlPrefix` — embedded in markdown URLs the\n * chat hosts in user message bubbles (`![]()` / `[Attached]`).\n * Stored in chat history; chosen at SEND time. In host mode the\n * relative `/api/storage/view/chat-attachments/` is sufficient\n * (same-origin); embedders supply an absolute hub URL so the\n * browser can fetch cross-origin.\n * - `identityUrl` — GET endpoint the `useChatIdentity` hook\n * hits to learn the `{authTier, source, attachmentsEnabled}`\n * capability bag for the current session. Used beyond chat\n * (tickets / contact form / any embedded surface that needs\n * to identify the proxied customer), so the name has no\n * \"chat\" prefix even though the consuming hook still does. */\n attachmentUploadUrl: string\n attachmentViewUrlPrefix: string\n identityUrl: string\n /** Optional URL prefix for the image proxy (`<prefix>?url=<external>`).\n * When unset, lib's `getProxiedImageUrl` returns the original URL\n * unchanged. Hub default: '/api/image-proxy'. Embedders that don't\n * host an image-proxy route leave this undefined → images load\n * directly cross-origin (CORS-permitting). */\n imageProxyUrlPrefix?: string\n /** Optional list of hostnames that should bypass the image proxy\n * (rendered direct). Hub uses ['openmsp.ai']; embedders typically\n * leave it unset. Matches the `skipDomains` parameter of\n * `getProxiedImageUrl`. */\n imageProxySkipDomains?: string[]\n }\n navigation: {\n /** ONE knob, two behaviors:\n * - 'host' = use the host page's existing click-routing untouched.\n * The chat panel calls `navigate?.()` for in-app routing.\n * - 'embed' = guest inside another app: short-circuit at the top\n * of click handlers to force new-tab + absolutize via\n * resolveExternalNavigation. */\n mode: 'host' | 'embed'\n /** Embed-only fallback origin for relative URLs whose target platform\n * can't be inferred. Used by resolveExternalNavigation when\n * `targetPlatform` is null — without this, a relative `/foo` href would\n * window.open against the embedder's origin, which is WRONG.\n * Set to your content host (e.g. 'https://hub.openframe.ai').\n * Required by the embedded app whenever mode='embed'. */\n defaultContentOrigin?: string\n /** Override for opening external URLs. MUST BE SYNCHRONOUS —\n * Safari/Firefox block popups opened outside a direct user gesture.\n * Default: window.open(href, '_blank', 'noopener,noreferrer'). */\n openExternal?: (href: string) => void\n /** Optional in-app navigation callback (host-mode only).\n * Returns `true` if the host handled the click in-app\n * (router.push + docNav.navigate); returns `false`, `undefined`,\n * or `void` → lib falls back to window.location.assign(href).\n * Hub wires this via HubRuntimeProvider's HubNavigationWiring;\n * embedders not in Next.js leave it undefined. */\n navigate?: (input: { href: string; path?: string | null; targetPlatform?: string | null }) => boolean | void\n /** Optional new-tab decision callback. Returns true → lib opens in\n * new tab; false → same tab via `navigate`. Hub wires the existing\n * `decideNewTab` logic from use-nav-link.tsx (re-imports the pure\n * helper from lib). Embedders may omit; lib defaults to:\n * same-origin/same-platform → same tab, else new tab. */\n decideNewTab?: (args: { href: string; targetPlatform?: string | null }) => boolean\n }\n /** Chat source identifier — REQUIRED. Used for localStorage\n * namespacing (`mingo-chat-<source>-v1`). Hub sets via\n * `currentPlatform()`; embedders set explicitly.\n * `useEmbeddedChat()` throws if source is empty/missing. */\n source: string\n // NOTE: No `user` field. The chat's display identity (greeting\n // first-name, etc.) comes from the SERVER-resolved auth via\n // `useChatIdentity()` — the same identity the server uses to\n // authorize requests. Letting embedders pass a client-side `user`\n // would let it desync from the actual auth tier, causing greetings\n // like \"Hey Bob\" while the server treats the session as\n // alice@example.com. Single source of truth: the server.\n}\n\nexport const ChatRuntimeContext = createContext<ChatRuntime | null>(null)\n\n/**\n * Returns the active runtime, or null when no provider is mounted.\n * NULL is a first-class value — it signals \"no chat runtime configured.\"\n * Optional consumers fall back to no-op behavior; strict consumers\n * use `useRequiredChatRuntime` (below).\n */\nexport function useChatRuntime(): ChatRuntime | null {\n return useContext(ChatRuntimeContext)\n}\n\n/**\n * Strict variant used INSIDE the chat panel. Throws if no provider.\n * The hub guarantees one exists by mounting `<HubRuntimeProvider>` at\n * root; the embedded app mounts its own `<ChatRuntimeContext.Provider>`\n * at the tree root. In Jest / Storybook tests that render chat\n * internals directly, wrap with `<HubRuntimeProvider>` (hub defaults)\n * or supply `<ChatRuntimeContext.Provider value={mockedRuntime}>`.\n */\nexport function useRequiredChatRuntime(): ChatRuntime {\n const v = useContext(ChatRuntimeContext)\n if (!v) {\n throw new Error(\n '[chat-runtime] hook called outside a <ChatRuntimeContext.Provider>. ' +\n 'The hub mounts <HubRuntimeProvider> at root — this only fires when ' +\n 'chat internals are rendered above the provider tree. ' +\n 'Fix: ensure the rendering subtree descends from the runtime provider. ' +\n 'In tests/Storybook: wrap with <HubRuntimeProvider> or supply ' +\n 'a <ChatRuntimeContext.Provider value={mockedRuntime}>.',\n )\n }\n return v\n}\n"]}
@@ -1,521 +0,0 @@
1
- "use client";
2
- import {
3
- OPENFRAME_DEV_SECTIONS,
4
- PageLayout,
5
- PageShell,
6
- Pagination,
7
- SearchInput,
8
- SquareAvatar,
9
- StatusBadge,
10
- StatusFilterComponent,
11
- TASK_TYPE_LABELS,
12
- TASK_TYPE_TEXT_COLORS,
13
- TicketAttachmentsList,
14
- formatRelativeTime,
15
- getStatusColorScheme,
16
- init_pagination
17
- } from "./chunk-WQZP3JIZ.js";
18
- import {
19
- init_next_navigation,
20
- usePathname,
21
- useRouter,
22
- useSearchParams
23
- } from "./chunk-PLJLE4A4.js";
24
- import {
25
- Button,
26
- init_button2 as init_button
27
- } from "./chunk-MX5MIFWA.js";
28
- import {
29
- cn,
30
- init_cn
31
- } from "./chunk-KSOOKNBG.js";
32
- import {
33
- init_next_link,
34
- next_link_default
35
- } from "./chunk-OHPI2HRK.js";
36
- import {
37
- __esm,
38
- __export
39
- } from "./chunk-GGWZFCYS.js";
40
-
41
- // src/components/unified-pagination.tsx
42
- var unified_pagination_exports = {};
43
- __export(unified_pagination_exports, {
44
- UnifiedPagination: () => UnifiedPagination
45
- });
46
- import { jsx as jsx2 } from "react/jsx-runtime";
47
- function UnifiedPagination({
48
- currentPage,
49
- totalPages,
50
- onPageChange,
51
- className = "mt-8 flex justify-center w-full"
52
- }) {
53
- const router = useRouter();
54
- const searchParams = useSearchParams();
55
- const pathname = usePathname();
56
- const handlePageChange = (page) => {
57
- const currentScrollY = window.scrollY;
58
- if (onPageChange) {
59
- onPageChange(page);
60
- }
61
- const params = new URLSearchParams(searchParams.toString());
62
- params.set("page", page.toString());
63
- const newUrl = `${pathname}?${params.toString()}`;
64
- window.history.replaceState(null, "", newUrl);
65
- setTimeout(() => {
66
- window.scrollTo({
67
- top: currentScrollY,
68
- behavior: "instant"
69
- // Instant to prevent any scroll animation
70
- });
71
- }, 0);
72
- };
73
- if (totalPages <= 1) return null;
74
- return /* @__PURE__ */ jsx2("div", { className, children: /* @__PURE__ */ jsx2(
75
- Pagination,
76
- {
77
- currentPage,
78
- totalPages,
79
- onPageChange: handlePageChange
80
- }
81
- ) });
82
- }
83
- var init_unified_pagination = __esm({
84
- "src/components/unified-pagination.tsx"() {
85
- "use strict";
86
- "use client";
87
- init_next_navigation();
88
- init_pagination();
89
- }
90
- });
91
-
92
- // src/components/empty-state.tsx
93
- init_button();
94
- init_next_navigation();
95
- import { Search, FileText, Package } from "lucide-react";
96
- import { jsx, jsxs } from "react/jsx-runtime";
97
- function EmptyState({
98
- type,
99
- title,
100
- description,
101
- showBackButton = false,
102
- onGoBack,
103
- backButtonText = "Go Back",
104
- showCTA = true,
105
- ctaText,
106
- onCtaClick,
107
- ctaVariant = "primary"
108
- }) {
109
- const router = useRouter();
110
- const getDefaultContent = () => {
111
- switch (type) {
112
- case "vendors":
113
- return {
114
- icon: /* @__PURE__ */ jsx(Package, { className: "w-full h-full" }),
115
- title: "No vendors found",
116
- description: "We couldn't find any vendors matching your criteria. Try adjusting your filters or search terms."
117
- };
118
- case "posts":
119
- return {
120
- icon: /* @__PURE__ */ jsx(FileText, { className: "w-full h-full" }),
121
- title: "No articles found",
122
- description: "We couldn't find any articles matching your criteria. Try different categories, tags, or search terms."
123
- };
124
- case "search":
125
- return {
126
- icon: /* @__PURE__ */ jsx(Search, { className: "w-full h-full" }),
127
- title: "No results found",
128
- description: "Your search didn't return any results. Try different keywords or browse our categories."
129
- };
130
- default:
131
- return {
132
- icon: /* @__PURE__ */ jsx(Search, { className: "w-full h-full" }),
133
- title: "Nothing found",
134
- description: "We couldn't find what you're looking for. Try adjusting your search or filters."
135
- };
136
- }
137
- };
138
- const getSmartCTA = () => {
139
- if (ctaText && onCtaClick) {
140
- return {
141
- text: ctaText,
142
- action: onCtaClick
143
- };
144
- }
145
- const isClient = typeof window !== "undefined";
146
- const currentPath = isClient ? window.location.pathname : "";
147
- switch (type) {
148
- case "search":
149
- return {
150
- text: "Reset Filters",
151
- action: () => {
152
- if (isClient) {
153
- const url = new URL(window.location.href);
154
- url.search = "";
155
- router.push(url.pathname);
156
- }
157
- }
158
- };
159
- case "posts":
160
- if (currentPath.includes("/blog")) {
161
- return {
162
- text: "Reset Filters",
163
- action: () => {
164
- if (isClient) {
165
- const url = new URL(window.location.href);
166
- url.search = "";
167
- router.push(url.pathname);
168
- }
169
- }
170
- };
171
- } else if (currentPath.includes("/profile")) {
172
- return {
173
- text: "Browse Vendors",
174
- action: () => router.push("/vendors")
175
- };
176
- }
177
- return {
178
- text: "View All Posts",
179
- action: () => router.push("/blog")
180
- };
181
- case "vendors":
182
- if (currentPath.includes("/profile")) {
183
- return {
184
- text: "Browse Vendors",
185
- action: () => router.push("/vendors")
186
- };
187
- } else if (currentPath.includes("/vendors") || currentPath.includes("/margin-increase/compare")) {
188
- return {
189
- text: "Reset Filters",
190
- action: () => {
191
- if (isClient) {
192
- const url = new URL(window.location.href);
193
- url.search = "";
194
- router.push(url.pathname);
195
- }
196
- }
197
- };
198
- }
199
- return {
200
- text: "Browse Vendors",
201
- action: () => router.push("/vendors")
202
- };
203
- default:
204
- return {
205
- text: "Browse Vendors",
206
- action: () => router.push("/vendors")
207
- };
208
- }
209
- };
210
- const defaultContent = getDefaultContent();
211
- const displayTitle = title || defaultContent.title;
212
- const displayDescription = description || defaultContent.description;
213
- const smartCTA = getSmartCTA();
214
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-6 md:py-16 px-6 text-center", children: [
215
- /* @__PURE__ */ jsx("div", { className: "mb-3 md:mb-6 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "rounded-full bg-ods-card p-3 md:p-6 border border-ods-border", children: /* @__PURE__ */ jsx("div", { className: "w-8 h-8 md:w-16 md:h-16 text-ods-text-secondary flex items-center justify-center", children: defaultContent.icon }) }) }),
216
- /* @__PURE__ */ jsx("h2", { className: "mb-2 md:mb-3 text-lg md:text-xl font-semibold font-['DM_Sans'] text-ods-text-primary tracking-[-0.02em]", children: displayTitle }),
217
- /* @__PURE__ */ jsx("p", { className: "mb-4 md:mb-8 max-w-md text-sm font-medium font-['DM_Sans'] text-ods-text-secondary leading-[1.43em]", children: displayDescription }),
218
- showCTA && smartCTA && /* @__PURE__ */ jsx("div", { className: "w-full max-w-xs mb-3", children: /* @__PURE__ */ jsx(
219
- Button,
220
- {
221
- onClick: smartCTA.action,
222
- className: ctaVariant === "primary" ? "w-full bg-[#FFC008] text-black hover:bg-[#FFC008]/90 transition-all duration-150 font-['DM_Sans'] font-medium" : "w-full bg-transparent border border-ods-border text-ods-text-primary hover:border-[#FFC008] hover:text-ods-accent transition-all duration-150 font-['DM_Sans'] font-medium",
223
- children: smartCTA.text
224
- }
225
- ) }),
226
- showBackButton && onGoBack && /* @__PURE__ */ jsx("div", { className: "w-full max-w-xs", children: /* @__PURE__ */ jsx(
227
- Button,
228
- {
229
- onClick: onGoBack,
230
- variant: "outline",
231
- className: "w-full transition-all duration-150 font-['DM_Sans'] font-medium",
232
- children: backButtonText
233
- }
234
- ) })
235
- ] });
236
- }
237
-
238
- // src/components/shared/dev-section/dev-section-view.tsx
239
- import { useState, useEffect } from "react";
240
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
241
- function DevSectionView({ sectionKey, hero, preControls, children }) {
242
- const section = OPENFRAME_DEV_SECTIONS[sectionKey];
243
- const router = useRouter();
244
- const pathname = usePathname();
245
- const searchParams = useSearchParams();
246
- const search = section.search;
247
- const filter = section.filter;
248
- const currentSearch = search ? searchParams.get(search.paramKey) || "" : "";
249
- const currentFilterValue = filter ? searchParams.get(filter.paramKey) || filter.defaultValue : "";
250
- const [searchValue, setSearchValue] = useState(() => currentSearch);
251
- useEffect(() => {
252
- setSearchValue(currentSearch);
253
- }, [currentSearch]);
254
- const handleSearchSubmit = (value) => {
255
- if (!search) return;
256
- const params = new URLSearchParams(searchParams.toString());
257
- if (value.trim()) params.set(search.paramKey, value.trim());
258
- else params.delete(search.paramKey);
259
- router.replace(`${pathname}?${params.toString()}`, { scroll: false });
260
- };
261
- const handleFilterChange = (value) => {
262
- if (!filter) return;
263
- const params = new URLSearchParams(searchParams.toString());
264
- if (value === filter.defaultValue) params.delete(filter.paramKey);
265
- else params.set(filter.paramKey, value);
266
- router.replace(`${pathname}?${params.toString()}`, { scroll: false });
267
- };
268
- return /* @__PURE__ */ jsxs2("div", { className: "w-full flex flex-col gap-10", children: [
269
- hero ? /* @__PURE__ */ jsxs2("div", { className: "space-y-4", children: [
270
- /* @__PURE__ */ jsxs2("h1", { className: "text-h1 tracking-[-1.12px] text-ods-text-primary flex items-center gap-3", children: [
271
- hero.icon,
272
- section.hero.title
273
- ] }),
274
- /* @__PURE__ */ jsx3("p", { className: "font-['DM_Sans'] font-medium text-[18px] leading-[28px] text-ods-text-secondary max-w-3xl", children: hero.description })
275
- ] }) : /* @__PURE__ */ jsx3("div", { className: "flex items-center justify-between w-full", children: /* @__PURE__ */ jsxs2("h2", { className: "font-['Azeret_Mono'] font-semibold text-[32px] md:text-[40px] lg:text-[48px] leading-[40px] md:leading-[48px] lg:leading-[56px] text-ods-text-primary tracking-[-0.64px] md:tracking-[-0.8px] lg:tracking-[-0.96px]", children: [
276
- section.hero.title,
277
- /* @__PURE__ */ jsx3("span", { className: "text-ods-accent", children: ":" })
278
- ] }) }),
279
- preControls,
280
- (search || filter) && /* @__PURE__ */ jsxs2("div", { className: "space-y-4", children: [
281
- search && /* @__PURE__ */ jsx3(
282
- SearchInput,
283
- {
284
- showDropdown: false,
285
- placeholder: search.placeholder,
286
- value: searchValue,
287
- onChange: setSearchValue,
288
- onSubmit: handleSearchSubmit
289
- }
290
- ),
291
- filter && /* @__PURE__ */ jsx3(
292
- StatusFilterComponent,
293
- {
294
- selectedStatus: currentFilterValue,
295
- onStatusChange: handleFilterChange,
296
- statusOptions: [...filter.options]
297
- }
298
- )
299
- ] }),
300
- children
301
- ] });
302
- }
303
-
304
- // src/components/shared/dev-section/dev-section-page.tsx
305
- init_next_navigation();
306
- import { jsx as jsx4 } from "react/jsx-runtime";
307
- var SECTION_HERO_ICON_CLASS = "h-10 w-10 text-ods-accent";
308
- function DevSectionPage({ sectionKey, children, preControls, backButton }) {
309
- const router = useRouter();
310
- const section = OPENFRAME_DEV_SECTIONS[sectionKey];
311
- const Icon = section.icon;
312
- const backCfg = backButton === false ? void 0 : {
313
- label: (backButton ? backButton.label : void 0) ?? "Back to home",
314
- onClick: () => router.push((backButton ? backButton.href : void 0) ?? "/")
315
- };
316
- return /* @__PURE__ */ jsx4(PageShell, { children: /* @__PURE__ */ jsx4(PageLayout, { backButton: backCfg, children: /* @__PURE__ */ jsx4(
317
- DevSectionView,
318
- {
319
- sectionKey,
320
- hero: {
321
- icon: /* @__PURE__ */ jsx4(Icon, { className: SECTION_HERO_ICON_CLASS }),
322
- description: section.hero.description
323
- },
324
- preControls,
325
- children
326
- }
327
- ) }) });
328
- }
329
-
330
- // src/components/shared/dev-section/dev-card-row.tsx
331
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
332
- function DevCardRowContent({
333
- title,
334
- subtitle,
335
- description,
336
- emptyDescription = "No description provided",
337
- rightBadges
338
- }) {
339
- return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col md:flex-row items-start justify-between gap-[12px] md:gap-[16px] w-full", children: [
340
- /* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0 w-full md:w-auto flex flex-col gap-[12px] md:gap-[16px]", children: [
341
- /* @__PURE__ */ jsx5("div", { className: "min-h-[24px] flex items-center", children: /* @__PURE__ */ jsx5("h3", { className: "text-h3 text-ods-text-primary tracking-[-0.36px] flex-1 line-clamp-2 md:truncate break-words", children: title }) }),
342
- /* @__PURE__ */ jsx5("div", { className: "min-h-[20px] flex items-center", children: /* @__PURE__ */ jsx5("p", { className: "text-h5 text-ods-text-secondary uppercase tracking-[-0.28px] truncate", children: subtitle }) }),
343
- /* @__PURE__ */ jsx5("div", { className: "min-h-[72px] flex items-center", children: /* @__PURE__ */ jsx5("p", { className: "text-h4 text-ods-text-secondary line-clamp-3 break-words", children: description || emptyDescription }) })
344
- ] }),
345
- /* @__PURE__ */ jsx5("div", { className: "flex-shrink-0 self-start flex flex-col gap-2", children: rightBadges })
346
- ] });
347
- }
348
- function ConversationCardRow({
349
- author,
350
- role,
351
- avatarSrc,
352
- timestamp,
353
- body,
354
- attachments,
355
- variant = "support"
356
- }) {
357
- const hasBody = body.trim().length > 0;
358
- const hasAttachments = !!attachments && attachments.length > 0;
359
- if (!hasBody && !hasAttachments) return null;
360
- const relativeTime = timestamp ? formatRelativeTime(timestamp) : null;
361
- return /* @__PURE__ */ jsxs3(
362
- "article",
363
- {
364
- className: "border-b border-ods-border last:border-b-0 p-[12px] md:p-[16px] flex gap-[12px] md:gap-[16px] w-full",
365
- "aria-label": `${author}${relativeTime ? ` \xB7 ${relativeTime}` : ""}`,
366
- children: [
367
- /* @__PURE__ */ jsx5(
368
- SquareAvatar,
369
- {
370
- src: avatarSrc,
371
- alt: author,
372
- fallback: author,
373
- size: "sm",
374
- variant: "round"
375
- }
376
- ),
377
- /* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0 flex flex-col gap-[8px] md:gap-[12px]", children: [
378
- /* @__PURE__ */ jsxs3("div", { className: "flex items-baseline justify-between gap-[8px] flex-wrap", children: [
379
- /* @__PURE__ */ jsxs3("div", { className: "flex items-baseline gap-[8px] min-w-0", children: [
380
- /* @__PURE__ */ jsx5("h3", { className: "text-h4 text-ods-text-primary truncate", children: author }),
381
- role && /* @__PURE__ */ jsx5("span", { className: "text-h6 text-ods-text-secondary uppercase tracking-[-0.28px] shrink-0", children: role })
382
- ] }),
383
- relativeTime && /* @__PURE__ */ jsx5(
384
- "time",
385
- {
386
- className: "text-h6 text-ods-text-secondary uppercase tracking-[-0.28px] shrink-0",
387
- dateTime: timestamp ?? void 0,
388
- title: timestamp ?? void 0,
389
- children: relativeTime
390
- }
391
- )
392
- ] }),
393
- hasBody && /* @__PURE__ */ jsx5("p", { className: "text-h4 text-ods-text-primary whitespace-pre-wrap break-words", children: body }),
394
- hasAttachments && /* @__PURE__ */ jsx5(TicketAttachmentsList, { attachments })
395
- ] })
396
- ]
397
- }
398
- );
399
- }
400
- function ConversationCardRowSkeleton() {
401
- return /* @__PURE__ */ jsxs3("div", { className: "border-b border-ods-border last:border-b-0 p-[12px] md:p-[16px] flex gap-[12px] md:gap-[16px] w-full", children: [
402
- /* @__PURE__ */ jsx5("div", { className: "h-8 w-8 shrink-0 rounded-full bg-ods-border animate-pulse" }),
403
- /* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0 flex flex-col gap-[8px] md:gap-[12px]", children: [
404
- /* @__PURE__ */ jsxs3("div", { className: "flex items-baseline justify-between gap-[8px]", children: [
405
- /* @__PURE__ */ jsxs3("div", { className: "flex items-baseline gap-[8px] flex-1", children: [
406
- /* @__PURE__ */ jsx5("div", { className: "h-[24px] w-32 bg-ods-border rounded animate-pulse" }),
407
- /* @__PURE__ */ jsx5("div", { className: "h-[20px] w-16 bg-ods-border rounded animate-pulse" })
408
- ] }),
409
- /* @__PURE__ */ jsx5("div", { className: "h-[20px] w-20 bg-ods-border rounded animate-pulse shrink-0" })
410
- ] }),
411
- /* @__PURE__ */ jsxs3("div", { className: "space-y-2", children: [
412
- /* @__PURE__ */ jsx5("div", { className: "h-[20px] w-full bg-ods-border rounded animate-pulse" }),
413
- /* @__PURE__ */ jsx5("div", { className: "h-[20px] w-3/4 bg-ods-border rounded animate-pulse" })
414
- ] })
415
- ] })
416
- ] });
417
- }
418
- function ConversationCardRowSkeletonList({ rows = 2 }) {
419
- return /* @__PURE__ */ jsx5("div", { className: "bg-ods-card border border-ods-border rounded-[6px] overflow-hidden w-full", children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsx5(ConversationCardRowSkeleton, {}, i)) });
420
- }
421
- function DevCardRowSkeleton() {
422
- return /* @__PURE__ */ jsx5("div", { className: "border-b border-ods-border last:border-b-0 p-[12px] md:p-[16px]", children: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col md:flex-row items-start justify-between gap-[12px] md:gap-[16px] w-full", children: [
423
- /* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0 w-full md:w-auto flex flex-col gap-[12px] md:gap-[16px]", children: [
424
- /* @__PURE__ */ jsx5("div", { className: "min-h-[24px] flex items-center", children: /* @__PURE__ */ jsx5("div", { className: "h-[20px] bg-ods-border rounded animate-pulse w-full" }) }),
425
- /* @__PURE__ */ jsx5("div", { className: "min-h-[20px] flex items-center", children: /* @__PURE__ */ jsx5("div", { className: "h-[20px] bg-ods-border rounded animate-pulse w-1/2" }) }),
426
- /* @__PURE__ */ jsx5("div", { className: "min-h-[72px] flex items-center", children: /* @__PURE__ */ jsxs3("div", { className: "flex-1 space-y-1", children: [
427
- /* @__PURE__ */ jsx5("div", { className: "h-[20px] bg-ods-border rounded animate-pulse w-full" }),
428
- /* @__PURE__ */ jsx5("div", { className: "h-[20px] bg-ods-border rounded animate-pulse w-full" }),
429
- /* @__PURE__ */ jsx5("div", { className: "h-[20px] bg-ods-border rounded animate-pulse w-2/3" })
430
- ] }) })
431
- ] }),
432
- /* @__PURE__ */ jsxs3("div", { className: "flex-shrink-0 self-start flex flex-col gap-2", children: [
433
- /* @__PURE__ */ jsx5("div", { className: "h-[32px] w-[100px] bg-ods-border rounded animate-pulse" }),
434
- /* @__PURE__ */ jsx5("div", { className: "h-[32px] w-[120px] bg-ods-border rounded animate-pulse" })
435
- ] })
436
- ] }) });
437
- }
438
- function DevCardRowSkeletonList({ rows = 5 }) {
439
- return /* @__PURE__ */ jsx5("div", { className: "bg-ods-card border border-ods-border rounded-[6px] overflow-hidden w-full", children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsx5(DevCardRowSkeleton, {}, i)) });
440
- }
441
-
442
- // src/components/shared/delivery/delivery-row.tsx
443
- init_next_link();
444
- init_cn();
445
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
446
- function getRelativeTime(timestamp) {
447
- const now = Date.now();
448
- const diff = now - timestamp;
449
- const days = Math.floor(diff / (1e3 * 60 * 60 * 24));
450
- const weeks = Math.floor(days / 7);
451
- const months = Math.floor(days / 30);
452
- if (months > 0) return months === 1 ? "last month" : `${months} months ago`;
453
- if (weeks > 0) return weeks === 1 ? "last week" : `${weeks} weeks ago`;
454
- if (days > 0) return days === 1 ? "yesterday" : `${days} days ago`;
455
- return "today";
456
- }
457
- function DeliveryRow({
458
- item,
459
- href,
460
- caption,
461
- className
462
- }) {
463
- const taskType = item.taskType;
464
- const typeBadgeLabel = TASK_TYPE_LABELS[taskType] || "TASK";
465
- const typeBadgeTextColor = TASK_TYPE_TEXT_COLORS[taskType] || "";
466
- const statusBadgeScheme = getStatusColorScheme(item.status);
467
- const relativeTime = getRelativeTime(item.dateUpdated);
468
- const subtitle = `ACTIVE ${relativeTime}${item.listNames.length > 0 ? `, ${item.listNames.join(", ")}` : ""}, ${item.id}`;
469
- const inner = /* @__PURE__ */ jsxs4("div", { className: "flex flex-col md:flex-row items-start justify-between gap-[12px] md:gap-[16px] w-full", children: [
470
- /* @__PURE__ */ jsxs4("div", { className: "flex-1 min-w-0 w-full md:w-auto flex flex-col gap-[12px] md:gap-[16px]", children: [
471
- caption && /* @__PURE__ */ jsx6("p", { className: "text-xs font-medium uppercase tracking-wider text-ods-text-secondary", children: caption }),
472
- /* @__PURE__ */ jsx6("div", { className: "min-h-[24px] md:min-h-[24px] flex items-center", children: /* @__PURE__ */ jsx6("h3", { className: "text-h3 text-ods-text-primary tracking-[-0.36px] flex-1 line-clamp-2 md:truncate break-words", children: item.title }) }),
473
- /* @__PURE__ */ jsx6("div", { className: "min-h-[20px] flex items-center", children: /* @__PURE__ */ jsx6("p", { className: "text-h5 text-ods-text-secondary uppercase tracking-[-0.28px] truncate", children: subtitle }) }),
474
- /* @__PURE__ */ jsx6("div", { className: "min-h-[72px] flex items-center", children: /* @__PURE__ */ jsx6("p", { className: "text-h4 text-ods-text-secondary line-clamp-3 break-words", children: item.description || "No description provided" }) })
475
- ] }),
476
- /* @__PURE__ */ jsxs4("div", { className: "flex-shrink-0 self-start flex flex-col gap-2", children: [
477
- /* @__PURE__ */ jsx6(
478
- StatusBadge,
479
- {
480
- text: item.status.toUpperCase(),
481
- colorScheme: statusBadgeScheme,
482
- variant: "card",
483
- className: "border border-ods-border"
484
- }
485
- ),
486
- /* @__PURE__ */ jsx6(
487
- StatusBadge,
488
- {
489
- text: typeBadgeLabel,
490
- variant: "card",
491
- className: `border border-ods-border ${typeBadgeTextColor}`
492
- }
493
- )
494
- ] })
495
- ] });
496
- const baseClass = cn(
497
- "block p-[12px] md:p-[16px] no-underline text-inherit transition-colors duration-150",
498
- href && "hover:bg-ods-bg-hover cursor-pointer",
499
- className
500
- );
501
- if (href) {
502
- return /* @__PURE__ */ jsx6(next_link_default, { href, className: baseClass, prefetch: false, children: inner });
503
- }
504
- return /* @__PURE__ */ jsx6("div", { className: baseClass, children: inner });
505
- }
506
-
507
- export {
508
- EmptyState,
509
- UnifiedPagination,
510
- unified_pagination_exports,
511
- init_unified_pagination,
512
- DevSectionView,
513
- DevSectionPage,
514
- DevCardRowContent,
515
- ConversationCardRow,
516
- ConversationCardRowSkeletonList,
517
- DevCardRowSkeleton,
518
- DevCardRowSkeletonList,
519
- DeliveryRow
520
- };
521
- //# sourceMappingURL=chunk-R6MLPU4A.js.map