@flamingo-stack/openframe-frontend-core 0.0.632 → 0.0.633
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-SXYHY7US.js → chunk-237XKNIC.js} +4 -4
- package/dist/{chunk-JONR3BDJ.cjs → chunk-47TANSTC.cjs} +2 -1
- package/dist/chunk-47TANSTC.cjs.map +1 -0
- package/dist/{chunk-WOWO3447.cjs → chunk-4P3BQN6Y.cjs} +3 -3
- package/dist/{chunk-WOWO3447.cjs.map → chunk-4P3BQN6Y.cjs.map} +1 -1
- package/dist/{chunk-SQVWK5II.js → chunk-4RUOZMHB.js} +4 -4
- package/dist/{chunk-Q3NNH7RA.cjs → chunk-AJ24EK2S.cjs} +3 -3
- package/dist/{chunk-Q3NNH7RA.cjs.map → chunk-AJ24EK2S.cjs.map} +1 -1
- package/dist/{chunk-TWQM5JOZ.js → chunk-BK3OXJRU.js} +2 -2
- package/dist/{chunk-Y3RQO33R.cjs → chunk-BVG5CL57.cjs} +33 -33
- package/dist/{chunk-Y3RQO33R.cjs.map → chunk-BVG5CL57.cjs.map} +1 -1
- package/dist/{chunk-XUMRUOI4.cjs → chunk-CQGMYZXY.cjs} +11 -5
- package/dist/chunk-CQGMYZXY.cjs.map +1 -0
- package/dist/{chunk-BIJTQG4B.cjs → chunk-DJGW5A5M.cjs} +3 -3
- package/dist/{chunk-BIJTQG4B.cjs.map → chunk-DJGW5A5M.cjs.map} +1 -1
- package/dist/{chunk-WLYJ32M3.cjs → chunk-F74RHLLI.cjs} +10 -10
- package/dist/{chunk-WLYJ32M3.cjs.map → chunk-F74RHLLI.cjs.map} +1 -1
- package/dist/{chunk-CBFB5RHZ.js → chunk-GERXFICX.js} +2 -2
- package/dist/{chunk-QAPCDXK2.cjs → chunk-JJ6BSPT2.cjs} +36 -36
- package/dist/{chunk-QAPCDXK2.cjs.map → chunk-JJ6BSPT2.cjs.map} +1 -1
- package/dist/{chunk-YFFVHU7C.cjs → chunk-JYU5BI5K.cjs} +51 -51
- package/dist/{chunk-YFFVHU7C.cjs.map → chunk-JYU5BI5K.cjs.map} +1 -1
- package/dist/{chunk-6ABNNO67.cjs → chunk-KJT3PIKG.cjs} +3 -3
- package/dist/{chunk-6ABNNO67.cjs.map → chunk-KJT3PIKG.cjs.map} +1 -1
- package/dist/{chunk-5KFR43HW.cjs → chunk-KKQ4O3WM.cjs} +13 -13
- package/dist/{chunk-5KFR43HW.cjs.map → chunk-KKQ4O3WM.cjs.map} +1 -1
- package/dist/{chunk-ZQ2A62FQ.js → chunk-KLLYTCID.js} +2 -2
- package/dist/{chunk-NWJHGRVA.js → chunk-N5OKHZGT.js} +2 -2
- package/dist/{chunk-NOFE35PG.cjs → chunk-NH575UGV.cjs} +4 -4
- package/dist/{chunk-NOFE35PG.cjs.map → chunk-NH575UGV.cjs.map} +1 -1
- package/dist/{chunk-ITOFOALW.js → chunk-P5MIIQHG.js} +11 -5
- package/dist/chunk-P5MIIQHG.js.map +1 -0
- package/dist/{chunk-7BYV2E2N.cjs → chunk-PXKS5Y6K.cjs} +17 -17
- package/dist/{chunk-7BYV2E2N.cjs.map → chunk-PXKS5Y6K.cjs.map} +1 -1
- package/dist/{chunk-YZ5VFLU5.js → chunk-QT6ZS73L.js} +3 -3
- package/dist/{chunk-THVPG7AR.cjs → chunk-RLHFS4GU.cjs} +17 -17
- package/dist/{chunk-THVPG7AR.cjs.map → chunk-RLHFS4GU.cjs.map} +1 -1
- package/dist/{chunk-XYCBACGX.js → chunk-RN2EPTJF.js} +5 -5
- package/dist/{chunk-FZ75FGQP.js → chunk-RVHLFDWH.js} +2 -2
- package/dist/{chunk-OJQFCGK7.cjs → chunk-T2CMORAR.cjs} +4 -4
- package/dist/{chunk-OJQFCGK7.cjs.map → chunk-T2CMORAR.cjs.map} +1 -1
- package/dist/{chunk-WBZ4HP7D.js → chunk-UBH5ONPB.js} +2 -1
- package/dist/{chunk-WBZ4HP7D.js.map → chunk-UBH5ONPB.js.map} +1 -1
- package/dist/{chunk-BRPTCKKT.js → chunk-UYTB2V2G.js} +2 -2
- package/dist/{chunk-3N5OA6G2.js → chunk-V7TVOJBR.js} +2 -2
- package/dist/{chunk-IHS2OB4J.cjs → chunk-YVROSVNU.cjs} +18 -18
- package/dist/{chunk-IHS2OB4J.cjs.map → chunk-YVROSVNU.cjs.map} +1 -1
- package/dist/{chunk-GW6SSWRH.js → chunk-YZL6CLQG.js} +2 -2
- package/dist/{chunk-WAAJE6V4.js → chunk-ZQ7U4YID.js} +5 -5
- package/dist/{chunk-M3AH4S23.js → chunk-ZW4EVXFK.js} +2 -2
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- 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 +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +32 -32
- package/dist/components/index.js +13 -13
- package/dist/components/meeting-scheduler/index.cjs +21 -21
- package/dist/components/meeting-scheduler/index.js +1 -1
- package/dist/components/navigation/index.cjs +5 -5
- package/dist/components/navigation/index.js +4 -4
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/card-registry.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +2 -2
- package/dist/components/related-content/index.js +1 -1
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/components/ui/people-cell.d.ts +8 -1
- package/dist/components/ui/people-cell.d.ts.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/dist/types/case-study.d.ts +4 -0
- package/dist/types/case-study.d.ts.map +1 -1
- package/dist/types/customer-interview.d.ts +5 -2
- package/dist/types/customer-interview.d.ts.map +1 -1
- package/dist/types/video-processing.d.ts +14 -0
- package/dist/types/video-processing.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/related-content/card-registry.tsx +1 -0
- package/src/components/ui/__tests__/people-cell.test.tsx +7 -0
- package/src/components/ui/people-cell.tsx +17 -3
- package/src/types/case-study.ts +4 -0
- package/src/types/customer-interview.ts +5 -0
- package/src/types/video-processing.ts +15 -0
- package/dist/chunk-ITOFOALW.js.map +0 -1
- package/dist/chunk-JONR3BDJ.cjs.map +0 -1
- package/dist/chunk-XUMRUOI4.cjs.map +0 -1
- /package/dist/{chunk-SXYHY7US.js.map → chunk-237XKNIC.js.map} +0 -0
- /package/dist/{chunk-SQVWK5II.js.map → chunk-4RUOZMHB.js.map} +0 -0
- /package/dist/{chunk-TWQM5JOZ.js.map → chunk-BK3OXJRU.js.map} +0 -0
- /package/dist/{chunk-CBFB5RHZ.js.map → chunk-GERXFICX.js.map} +0 -0
- /package/dist/{chunk-ZQ2A62FQ.js.map → chunk-KLLYTCID.js.map} +0 -0
- /package/dist/{chunk-NWJHGRVA.js.map → chunk-N5OKHZGT.js.map} +0 -0
- /package/dist/{chunk-YZ5VFLU5.js.map → chunk-QT6ZS73L.js.map} +0 -0
- /package/dist/{chunk-XYCBACGX.js.map → chunk-RN2EPTJF.js.map} +0 -0
- /package/dist/{chunk-FZ75FGQP.js.map → chunk-RVHLFDWH.js.map} +0 -0
- /package/dist/{chunk-BRPTCKKT.js.map → chunk-UYTB2V2G.js.map} +0 -0
- /package/dist/{chunk-3N5OA6G2.js.map → chunk-V7TVOJBR.js.map} +0 -0
- /package/dist/{chunk-GW6SSWRH.js.map → chunk-YZL6CLQG.js.map} +0 -0
- /package/dist/{chunk-WAAJE6V4.js.map → chunk-ZQ7U4YID.js.map} +0 -0
- /package/dist/{chunk-M3AH4S23.js.map → chunk-ZW4EVXFK.js.map} +0 -0
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ArticleAuthorByline,
|
|
4
4
|
DetailPageSkeleton
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KLLYTCID.js";
|
|
6
6
|
import {
|
|
7
7
|
DocSearchBar,
|
|
8
8
|
useDocSearch
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RVHLFDWH.js";
|
|
10
10
|
import {
|
|
11
11
|
useSelfFetch
|
|
12
12
|
} from "./chunk-F2KBCLUG.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
PageShell,
|
|
19
19
|
RichMarkdownRenderer,
|
|
20
20
|
resolveContentHref
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-P5MIIQHG.js";
|
|
22
22
|
import {
|
|
23
23
|
EntityVideoSection,
|
|
24
24
|
VideoBitesStrip,
|
|
@@ -389,4 +389,4 @@ export {
|
|
|
389
389
|
useOnboardingGuide,
|
|
390
390
|
useOnboardingGuideSections
|
|
391
391
|
};
|
|
392
|
-
//# sourceMappingURL=chunk-
|
|
392
|
+
//# sourceMappingURL=chunk-237XKNIC.js.map
|
|
@@ -216,6 +216,7 @@ var CUSTOMER_INTERVIEW_ROW_DEFAULTS = {
|
|
|
216
216
|
user_id: null,
|
|
217
217
|
main_video_url: null,
|
|
218
218
|
teasers: [],
|
|
219
|
+
quotes: [],
|
|
219
220
|
case_study_id: null,
|
|
220
221
|
seo_title: null,
|
|
221
222
|
seo_description: null,
|
|
@@ -878,4 +879,4 @@ function RelatedContentSection({
|
|
|
878
879
|
|
|
879
880
|
|
|
880
881
|
exports.GROUP_PAGE_SIZE = GROUP_PAGE_SIZE; exports.RelatedContentSection = RelatedContentSection;
|
|
881
|
-
//# sourceMappingURL=chunk-
|
|
882
|
+
//# sourceMappingURL=chunk-47TANSTC.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-47TANSTC.cjs","../src/components/related-content/related-content-section.tsx","../src/components/related-content/card-registry.tsx"],"names":["jsx","buildListUrl"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACMA,8BAAqD;ADJrD;AACA;AEkiBsB,+CAAA;AA/etB,SAAS,QAAA,CAAS,KAAA,EAAyC;AACzD,EAAA,OAAO,OAAO,MAAA,IAAU,SAAA,GAAY,MAAA,IAAU,KAAA,EAAQ,MAAA,EAAoC,CAAC,CAAA;AAC7F;AAGO,SAAS,SAAA,CAAU,GAAA,EAAc,GAAA,EAAiC;AACvE,EAAA,MAAM,MAAA,EAAQ,QAAA,CAAS,GAAG,CAAA,CAAE,GAAG,CAAA;AAC/B,EAAA,OAAO,OAAO,MAAA,IAAU,SAAA,EAAW,MAAA,EAAQ,KAAA,CAAA;AAC7C;AAEA,SAAS,GAAA,CAAI,GAAA,EAA8B,GAAA,EAAqB;AAC9D,EAAA,MAAM,MAAA,EAAQ,GAAA,CAAI,GAAG,CAAA;AACrB,EAAA,OAAO,OAAO,MAAA,IAAU,SAAA,EAAW,MAAA,EAAQ,EAAA;AAC7C;AAEA,SAAS,SAAA,CAAU,GAAA,EAA8B,GAAA,EAA4B;AAC3E,EAAA,MAAM,MAAA,EAAQ,GAAA,CAAI,GAAG,CAAA;AACrB,EAAA,OAAO,OAAO,MAAA,IAAU,SAAA,EAAW,MAAA,EAAQ,IAAA;AAC7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A,CAAa,MAAA,CAAO,CAAA,CAAA,EAAA,GAAK,uDAAA,CAAyB,EAAA,IAAM,mBAAmB,CAAA;AAC5F,IAAA,GAAA,CAAI,QAAA,CAAS,OAAA,EAAS,CAAA,EAAG;AACvB,MAAA,aAAA,EAAe,CAAC,GAAG,QAAA,EAAU,GAAG,YAAA,CAAa,MAAA,CAAO,CAAA,CAAA,EAAA,GAAK,uDAAA,CAAyB,EAAA,IAAM,mBAAmB,CAAC,CAAA;AAAA,IAC9G;AAAA,EACF;AAEA,EAAA,uBACE,8BAAA,KAAC,EAAA,EAAI,SAAA,EAAU,WAAA,EACb,QAAA,EAAA;AAAA,oBAAAA,6BAAAA,IAAC,EAAA,EAAG,SAAA,EAAU,+BAAA,EAAiC,QAAA,EAAA,MAAA,CAAM,CAAA;AAAA,IACpD,YAAA,CAAa,GAAA,CAAI,CAAA,IAAA,EAAA,mBAChBA,6BAAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QAEC,IAAA;AAAA,QACA,IAAA,EAAM,OAAA,CAAQ,IAAI,CAAA;AAAA,QAClB,OAAA;AAAA,QACA,QAAA,EAAU,qBAAA;AAAA,QACV,WAAA;AAAA,QACA,YAAA;AAAA,QACA,MAAA;AAAA,QACA,iBAAA;AAAA,QACA,OAAA,kBACEA,6BAAAA,IAAC,EAAA,EAAG,SAAA,EAAU,+CAAA,EAAiD,QAAA,EAAA,6DAAA,IAAkC,EAAA,CAAE;AAAA,MAAA,CAAA;AAAA,MAVhG;AAAA,IAYP,CACD;AAAA,EAAA,EAAA,CACH,CAAA;AAEJ;AD8JA;AACA;AACE;AACA;AACF,iGAAC","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-47TANSTC.cjs","sourcesContent":[null,"'use client';\n\n/**\n * RelatedContentSection\n *\n * Renders content references grouped by type using the canonical card\n * components. MOVED from the hub (`components/shared/related-content-card.tsx`)\n * so any consuming app can embed it; the hub keeps a thin wrapper that\n * pre-binds its host-specific injections (nav hook, URL recomposition,\n * program configs, admin campaign card).\n *\n * THREE data modes (precedence top-down):\n * 1. CONTROLLED — `contentRefs` provided (even `[]`): render exactly those\n * refs, no suggestion fetch (the original investor-update behavior).\n * 2. SUGGESTION — `entityType` + `entityId` provided: self-fetch\n * `GET {apiBaseUrl}/api/related-content?entityType&entityId[&count][&excludeTypes]`\n * (the generic 5-tier engine's second web service). `minResults` maps to\n * `count`; absent → param not sent (server default applies). Each ref\n * carries a `reason` (data-only — never rendered, matching the\n * FaqSection/FaqWithReason precedent).\n * 3. SSR-HYDRATED suggestion — also pass `initialItems` (the server page\n * called the engine directly); the first client fetch is skipped per the\n * `useSelfFetch` initialData contract.\n *\n * Group layout (list vs grid) + card size (lg vs default) come from\n * `CONTENT_REF_GROUPS` in `../../utils/content-ref-groups` — single source of\n * truth, no per-type logic in this file. Skeletons come from\n * `renderSkeletonForType` so the placeholder height matches the loaded card\n * exactly (zero layout shift on resolve).\n *\n * One API call per content type via the shared list-URL builder\n * (`buildListUrl` — injectable; defaults to the lib's byte-parity-tested\n * builder prefixed with `apiBaseUrl`). Fetching uses `useSelfFetch` (plain\n * fetch, NO react-query) so third-party embedders need no QueryClientProvider;\n * cards are imported via DEEP module paths (not the chat barrel) so this\n * chunk never reaches `@tanstack/react-query`.\n *\n * The per-type card + skeleton dispatch lives in `./card-registry`\n * (`RELATED_CARD_REGISTRY`): ONE entry per content type, each carrying that\n * type's own row type and the `unknown` → row decode, so a fetched row reaches\n * its card concretely typed. This file only picks the entry and builds the\n * shared render context.\n *\n * LOCKSTEP NOTE: that registry is the SIZED sibling of the chat-side\n * `CHAT_CARD_REGISTRY` (`../chat/entity-cards/dispatch.tsx`), which renders\n * compact `size='sm'` cards wired to the chat runtime. Two dispatchers by\n * design — when registering a new fetch-mode content type, add it BOTH there\n * and in `./card-registry` (card + skeleton + list URL).\n */\n\nimport type React from 'react';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useSelfFetch } from '../../hooks/use-self-fetch';\nimport type { ContentRef, ContentRefWithReason } from '../../types/content-ref';\nimport {\n CONTENT_REF_GROUPS,\n getContentRefLabelOrTitleCase,\n orderContentRefTypes,\n type ContentRefGroupConfig,\n} from '../../utils/content-ref-groups';\nimport { extractItems, extractItemId } from '../../utils/extract-items';\nimport { buildListUrl as libBuildListUrl, canonicalContentRefType } from '../../utils/list-url';\nimport { pageCount } from '../../utils/search-params';\nimport { buildSuggestionUrl } from '../../utils/suggestion-url';\n// Type-only — erased at build, no runtime dependency on the dispatch module.\nimport type { ChatCardDispatchExtras } from '../chat/entity-cards/dispatch';\nimport { decideNewTab } from '../chat/utils/decide-new-tab';\nimport { Pagination } from '../pagination';\n// The per-type card dispatch — one registry entry per content type, each\n// carrying its OWN row type — plus the DEEP card imports that keep this\n// chunk's source graph free of @tanstack/react-query (the `../chat` barrel\n// reaches it via embeddable-chat; deep paths don't). `CardSize` and\n// `CardLinkAnchorProps` are declared alongside the registry, its primary\n// consumer, and re-exported below so the subpath barrel is unchanged.\nimport {\n RELATED_CARD_REGISTRY,\n rowString,\n type CardLinkAnchorProps,\n type CardSize,\n type RelatedCardRegistryEntry,\n} from './card-registry';\n\nexport type { CardLinkAnchorProps };\n\n/** Render-prop component injection for the navigation decision — keeps hook\n * calls legal (hooks live INSIDE the injected component; `CardForType`\n * itself calls zero hooks). The hub injects a `useNavLink`-backed provider;\n * the default is hook-free (pure `decideNewTab`). MUST be defined at module\n * scope by hosts — an inline arrow would remount every card each render. */\nexport interface CardLinkProviderProps {\n href: string | null;\n targetPlatform: string | null;\n children: (linkProps: CardLinkAnchorProps | null) => React.ReactElement | null;\n}\nexport type CardLinkProvider = React.ComponentType<CardLinkProviderProps>;\n\n/** Default link provider for standalone embeds: relative/-same-origin hrefs\n * stay same-tab, cross-origin pops a new tab (pure `decideNewTab` with no\n * platform context — `currentSource: ''` falls through to the origin\n * check). No router integration, no hooks. */\nfunction DefaultLinkPropsProvider({\n href,\n targetPlatform,\n children,\n}: CardLinkProviderProps): React.ReactElement | null {\n if (!href) return children(null);\n const newTab = decideNewTab({ href, targetPlatform, currentSource: '' });\n return children(newTab ? { href, target: '_blank', rel: 'noopener noreferrer' } : { href });\n}\n\n/** Default href resolution: trust the ref's stored url/targetPlatform as the\n * API composed them. The hub overrides this with its `buildContentURL`\n * re-composition so dev gets localhost and prod gets platform domains. */\nfunction defaultResolveHref(ref: ContentRef): { href: string | null; targetPlatform: string | null } {\n return { href: ref.url || null, targetPlatform: ref.targetPlatform ?? null };\n}\n\n/** Host-injected renderer pair for the admin-only `marketing_campaign` type.\n * Absent (every non-hub embed) → the type renders nothing (its list URL\n * hits `/api/admin`, unreachable outside the hub anyway). */\nexport interface AdminCampaignCardSlot {\n /**\n * The host's own campaign card. Its `campaign` prop is a HOST row type this\n * lib cannot name (the hub's `MarketingCampaign`), and React props are\n * CONTRAVARIANT, so this is the one seam in the rail with no honest type.\n * All three alternatives were compiled against the hub's real\n * `CampaignCardAdmin`:\n *\n * - `unknown` — the host can no longer inject: TS2322, \"Type\n * '{ campaign: unknown }' is not assignable to\n * '{ campaign: MarketingCampaign }'\".\n * - `never` — every host component assigns, but the rail can no longer\n * hand it a row: TS2769, \"Type 'unknown' is not assignable to 'never'\".\n * - a generic on the slot's OWNER (`AdminCampaignCardSlot<TCampaign>`\n * threaded through `RelatedContentSectionProps`) — inference from the\n * host's card works, but the render still fails: TS2769, \"'TCampaign'\n * could be instantiated with an arbitrary type\". The rail holds an\n * unvalidated row; only the HOST knows how to narrow it.\n *\n * Typing this means changing the injection contract (a host-supplied\n * `render(row: unknown)` closure instead of a component), which is a\n * breaking change for every embedder that passes `{ Card, Skeleton }`.\n * Everything the rail renders ITSELF now goes through the per-type\n * `RELATED_CARD_REGISTRY`; this is the only `any` left.\n */\n Card: React.ComponentType<{ campaign: any }>;\n Skeleton: React.ComponentType<{ size?: 'default' | 'sm' }>;\n}\n\n/**\n * Per-type skeleton dispatch — returns the SAME colocated skeleton the\n * resolved card renders, sized to match (zero layout shift on resolve). One\n * lookup through `RELATED_CARD_REGISTRY`, exactly the way the chat-side\n * `CHAT_CARD_REGISTRY` does it via `entry.skeleton()`.\n *\n * `marketing_campaign` is the one type with no registry entry: BOTH its card\n * and its skeleton are host-injected (`AdminCampaignCardSlot`), so there is no\n * lib component to register.\n */\nfunction renderSkeletonForType(\n type: string,\n size: CardSize,\n adminCampaignCard?: AdminCampaignCardSlot,\n): React.ReactNode {\n if (type === 'marketing_campaign') {\n return adminCampaignCard ? <adminCampaignCard.Skeleton size={size === 'sm' ? 'sm' : 'default'} /> : null;\n }\n const entry: RelatedCardRegistryEntry | undefined = RELATED_CARD_REGISTRY[type];\n return entry ? entry.skeleton(size) : null;\n}\n\n/**\n * Per-type card dispatch — ONE lookup through `RELATED_CARD_REGISTRY`, whose\n * entries each pair a skeleton with a card renderer that closes over that\n * type's OWN row type. Sized cards (`'lg'` / `'default'`) are unique to this\n * rail; the chat dispatcher only renders `'sm'`.\n *\n * PURE FUNCTION COMPONENT WITH ZERO HOOK CALLS: the placeholder comes from a\n * plain `extras.buildOgPlaceholderUrl` call (the chat `dispatch.tsx`\n * pattern) and the anchor-prop bundle arrives via the `LinkProvider`\n * render-prop from the parent — so per-card hook legality is owned by the\n * injected provider component, not by this dispatcher.\n *\n * `href` comes from the host's `resolveHref(ref)` (hub: live\n * `buildContentURL` recomposition; default: the ref's stored url).\n */\nfunction CardForType({\n type,\n item,\n size,\n href,\n targetPlatform,\n linkProps,\n extras,\n adminCampaignCard,\n}: {\n type: string;\n /** One fetched row, still unvalidated. Its shape is decided at RUNTIME by\n * `type` (each group fetches from its own per-type list API), so it stays\n * `unknown` right up to the registry entry for that type — which owns the\n * `unknown` → row-type decode and hands its card a concretely typed row. */\n item: unknown;\n size: CardSize;\n href: string;\n targetPlatform: string | null;\n linkProps: CardLinkAnchorProps | null;\n extras?: ChatCardDispatchExtras;\n adminCampaignCard?: AdminCampaignCardSlot;\n}): React.ReactNode {\n // Host-injected admin slot — the only type with no registry entry, because\n // both its card and its skeleton come from the host (see\n // `AdminCampaignCardSlot`). Handled before the lookup so the registry stays\n // a pure lib-card table.\n if (type === 'marketing_campaign') {\n return adminCampaignCard ? <adminCampaignCard.Card campaign={item} /> : null;\n }\n\n const entry: RelatedCardRegistryEntry | undefined = RELATED_CARD_REGISTRY[type];\n if (!entry) return null;\n\n return entry.render(item, {\n size,\n // Most card variants accept only `{default, sm}`. `'lg'` collapses to\n // `'default'` for those. ProductReleaseCard uses its own lg/sm pair.\n legacySize: size === 'sm' ? 'sm' : 'default',\n href,\n targetPlatform,\n linkProps,\n // Top-level target/rel for cards that take them as separate props\n // (BlogCard, CaseStudyCard, …). ProductReleaseCard takes the bundle as a\n // single `anchorProps={...}` and uses `linkProps` directly. When the host\n // didn't surface a URL, `linkProps` is null and the card stays in\n // non-anchor mode.\n anchorAttrs: linkProps ? { target: linkProps.target, rel: linkProps.rel } : {},\n // OG placeholder URL — injected into the pure-presentation cards so they\n // render a branded fallback when the row's featured image is null. Plain\n // function call (NOT a hook). Title is the universal field across all card\n // row shapes used here.\n // `item?.title as string | undefined` claimed a string without checking one:\n // a numeric title reached `buildOgPlaceholderUrl` as a number. `rowString`\n // makes the claim true.\n placeholderUrl: extras?.buildOgPlaceholderUrl?.(rowString(item, 'title') ?? '') ?? undefined,\n extras,\n });\n}\n\n// =============================================================================\n// Fetch all items for a type in ONE server-sorted call, via the injectable\n// list-URL builder. `useSelfFetch` (URL = cache key) replaces the hub's old\n// react-query usage: `enabled` ≙ `url === null`, `!res.ok`/network error ≙\n// `error → items null → group renders nothing`. Accepted deltas vs\n// react-query: no retry/backoff, no focus refetch, no cross-mount cache.\n// =============================================================================\n\nfunction useGroupItems(type: string, refs: ContentRef[], buildUrl: (type: string, ids: string[]) => string | null) {\n const ids = refs.map(r => r.id);\n const url = ids.length > 0 ? buildUrl(type, ids) : null;\n const { data, isLoading } = useSelfFetch<unknown>(url);\n const items = data != null ? extractItems(data) : null;\n return { items, isLoading };\n}\n\n// =============================================================================\n// Per-group renderer — one API call, server-sorted, then render cards via the\n// dispatcher with per-type skeletons + per-type layout from CONTENT_REF_GROUPS.\n// =============================================================================\n\n/** Map columns prop → tailwind grid class. Only consulted for grid-layout\n * groups; list-layout groups stack vertically. */\nfunction gridClassFor(columns: 2 | 3): string {\n return columns === 3\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6'\n : 'grid grid-cols-1 sm:grid-cols-2 gap-6';\n}\n\n/** Resolve the group config for a type, falling back to a grid layout with\n * the default card size for unregistered types so the section still renders\n * rather than silently dropping them. The `label` field on the fallback is\n * intentionally a placeholder — the section heading goes through\n * `getContentRefLabelOrTitleCase(type)` instead so cross-surface labels\n * stay consistent between this rail and the investor-email builder. */\nfunction resolveGroupConfig(type: string): ContentRefGroupConfig {\n return (\n CONTENT_REF_GROUPS[type] ?? {\n label: type,\n order: 999,\n layout: 'grid',\n gridSize: 'default',\n }\n );\n}\n\n/** Items per page within one type group. Groups larger than this paginate\n * with the standard Pagination control (NO nested scrolling — a bounded\n * scrollbox inside the page traps wheel events and hides the sections\n * below it). MUST stay at or above the largest suggestion fill\n * (RELATED_SAME_TYPE_COUNT in the hub's lib/constants/suggestions.ts) so\n * current rails never paginate — only genuinely big groups (author pages)\n * do. Exported through the subpath barrel for the hub's module-load\n * assertion of that relation (entity-suggestion-sections.tsx). */\nexport const GROUP_PAGE_SIZE = 12;\n\nfunction ContentGroup({\n type,\n refs,\n columns,\n buildUrl,\n resolveHref,\n LinkProvider,\n extras,\n adminCampaignCard,\n heading,\n}: {\n type: string;\n refs: ContentRef[];\n columns: 2 | 3;\n buildUrl: (type: string, ids: string[]) => string | null;\n resolveHref: (ref: ContentRef) => { href: string | null; targetPlatform: string | null };\n LinkProvider: CardLinkProvider;\n extras?: ChatCardDispatchExtras;\n adminCampaignCard?: AdminCampaignCardSlot;\n /** Group heading, rendered INSIDE the group so a group that resolves to\n * nothing (fetch miss / unsupported type / missing program config) drops\n * its heading too — no orphaned titles. */\n heading: React.ReactNode;\n}) {\n const { items, isLoading } = useGroupItems(type, refs, buildUrl);\n const config = resolveGroupConfig(type);\n const isListLayout = config.layout === 'list';\n const cardSize = config.gridSize;\n\n // Per-group pagination for big groups (author pages): GROUP_PAGE_SIZE items\n // per page with the standard Pagination control below the group. Client-side\n // slicing — useGroupItems already fetched every row in one batched call, so\n // page flips are instant. Hooks live above every early return (file\n // convention). Page is clamped so a shrinking refs array (suggestion\n // refetch) can never strand the view past the last page, and RESET when the\n // ref set actually changes (shrink→grow must not return to a stale page).\n const [page, setPage] = useState(1);\n const refsKey = refs.map(r => r.id).join('|');\n const prevRefsKeyRef = useRef(refsKey);\n useEffect(() => {\n if (prevRefsKeyRef.current !== refsKey) {\n prevRefsKeyRef.current = refsKey;\n setPage(1);\n }\n }, [refsKey]);\n const totalGroupPages = pageCount(refs.length, GROUP_PAGE_SIZE);\n const safePage = Math.min(page, totalGroupPages);\n const visibleGroupRefs =\n refs.length > GROUP_PAGE_SIZE ? refs.slice((safePage - 1) * GROUP_PAGE_SIZE, safePage * GROUP_PAGE_SIZE) : refs;\n const groupPagination =\n totalGroupPages > 1 ? (\n <Pagination currentPage={safePage} totalPages={totalGroupPages} onPageChange={setPage} />\n ) : null;\n\n // Skeleton gate: `isLoading && !items` — SSR HTML and the client's first\n // paint render identical skeletons (useSelfFetch starts isLoading=true on\n // both sides), and once items exist they are never replaced by skeletons.\n if (isLoading && !items) {\n const skeletons = visibleGroupRefs.map(r => (\n <div key={r.id}>{renderSkeletonForType(type, cardSize, adminCampaignCard)}</div>\n ));\n return (\n <div className=\"space-y-4\">\n {heading}\n {isListLayout ? (\n <div className=\"space-y-4\">{skeletons}</div>\n ) : (\n <div className={gridClassFor(columns)}>{skeletons}</div>\n )}\n </div>\n );\n }\n\n if (!items || items.length === 0) return null;\n\n // Index fetched rows by id, then render in REF order — refs carry the\n // intended sequence (suggestion mode: the engine's tier order, so\n // same-platform/tag-matched items lead; controlled mode: the curated\n // display_order). The list APIs return rows date-sorted, which would\n // otherwise scramble that ordering (same-platform items sinking below\n // newer cross-platform ones).\n // Shared extractor (NOT raw `.id`) — some API shapes key items differently\n // (e.g. external_id types); raw access would silently drop valid items.\n const rowKey = (it: unknown): string => {\n const extracted = extractItemId(type, it);\n if (extracted !== null) return extracted;\n // Fallback for shapes `extractItemId` doesn't recognise — same\n // `String(it?.id)` the untyped version produced.\n return String(typeof it === 'object' && it !== null ? (it as { id?: unknown }).id : undefined);\n };\n const itemById = new Map(items.map(it => [rowKey(it), it]));\n\n const cards = visibleGroupRefs\n .map(contentRef => {\n const itemId = String(contentRef.id);\n const item = itemById.get(itemId);\n if (!item) return null;\n // Re-compose the URL via the host's resolver (hub: buildContentURL so\n // dev gets localhost and prod the right platform domain; default: the\n // ref's stored url as the API composed it).\n const resolved = resolveHref(contentRef);\n const href = resolved.href ?? '';\n const targetPlatform = resolved.targetPlatform ?? contentRef.targetPlatform ?? null;\n return (\n <div key={itemId}>\n <LinkProvider href={href || null} targetPlatform={targetPlatform}>\n {linkProps => (\n <CardForType\n type={type}\n item={item}\n size={cardSize}\n href={href}\n targetPlatform={targetPlatform}\n linkProps={linkProps}\n extras={extras}\n adminCampaignCard={adminCampaignCard}\n />\n )}\n </LinkProvider>\n </div>\n );\n })\n .filter(Boolean);\n\n if (cards.length === 0) {\n // Current PAGE resolved zero cards (rows deleted between the ref fetch\n // and the group fetch, or a stricter list-API gate dropped them). When a\n // pager exists the user must keep the controls to navigate back —\n // dropping the whole group would strand them. A genuinely empty group\n // (no pager) still vanishes with its heading.\n if (groupPagination) {\n return (\n <div className=\"space-y-4\">\n {heading}\n {groupPagination}\n </div>\n );\n }\n return null;\n }\n\n return (\n <div className=\"space-y-4\">\n {heading}\n {isListLayout ? <div className=\"space-y-4\">{cards}</div> : <div className={gridClassFor(columns)}>{cards}</div>}\n {groupPagination}\n </div>\n );\n}\n\n// =============================================================================\n// Main component\n// =============================================================================\n\ninterface RelatedContentResponse {\n refs: ContentRefWithReason[];\n}\n\nexport interface RelatedContentSectionProps {\n /** CONTROLLED mode (the original behavior). When defined — even `[]` — no\n * suggestion fetch runs and exactly these refs render. */\n contentRefs?: ContentRef[];\n /** SUGGESTION mode (with `entityId`): self-fetch suggestions for this host\n * entity from `{apiBaseUrl}/api/related-content`. Ignored when\n * `contentRefs` is provided. */\n entityType?: string;\n entityId?: number | string;\n /** AUTHOR mode: self-fetch ALL published content authored by this profile\n * from `{apiBaseUrl}/api/related-content?authorId=…` (grouped per type,\n * endless within each group). Ignored when `contentRefs` is provided;\n * takes precedence over the entityType/entityId suggestion scope.\n * SSR-hydrate via `initialItems`, same as suggestion mode. */\n authorId?: string;\n /** Maps to the suggestion API's `count` param — the PER-TYPE fill target\n * for every candidate type EXCEPT the host's own. Absent → param not sent\n * (server default applies). */\n minResults?: number;\n /** Maps to the suggestion API's `sameTypeCount` param — the budget for the\n * candidate type MATCHING the host's own `entityType` (same-type boost:\n * a blog post's rail leads with more blog posts). Absent → param not\n * sent (host's type uses the server's `count`). */\n sameTypeMinResults?: number;\n /** SSR hydrate for suggestion mode — the server page ran the engine and\n * drills the refs here; the first client fetch is skipped (useSelfFetch\n * initialData contract). */\n initialItems?: ContentRefWithReason[];\n /** Section title (default: \"Related Content\") */\n title?: string;\n /**\n * Grid columns at desktop. 2 = denser cards / wider summary (original\n * investor-update layout); 3 = more cards per row for dashboards.\n * Only consulted for grid-layout groups. Default: 2.\n */\n columns?: 2 | 3;\n /**\n * ContentRef.type values to exclude. Honored in ALL modes — controlled\n * mode post-filters (original behavior); suggestion mode ALSO forwards the\n * list verbatim as the API's `excludeTypes=` param so excluded types never\n * consume engine fill slots (`minResults` stays honored). The subtraction\n * happens SERVER-side — this component never mirrors the hub's candidate\n * list.\n */\n excludeTypes?: string[];\n /**\n * SUGGESTION-mode allow-list (rail vocabulary): which content types\n * participate in this rail. Sent verbatim as the API's `types=` param —\n * the SERVER intersects it with its own allowed candidate set, and\n * platform policy gates (e.g. internal-only types) ALWAYS win: the client\n * cannot request its way past them. Absent → all server-side candidates.\n */\n includeTypes?: string[];\n /** Fetch-URL prefix for third-party embeds / reverse proxies\n * ('' = same-origin). Applied to BOTH the suggestion fetch and the\n * default per-group list fetches. */\n apiBaseUrl?: string;\n /** Host injection bundle — REUSES the chat dispatcher's\n * `ChatCardDispatchExtras` (programConfigs, buildOgPlaceholderUrl,\n * buildProductReleaseCardProps override). Program groups render nothing\n * when their config is absent. */\n extras?: ChatCardDispatchExtras;\n /** Hub injects its `buildContentURL` recomposition; default uses the\n * ref's stored `url`/`targetPlatform` as the API composed them. */\n resolveHref?: (ref: ContentRef) => { href: string | null; targetPlatform: string | null };\n /** Hub injects its registry-driven entity-list-api builder; default = the\n * lib's `buildListUrl(type, ids, apiBaseUrl)`. */\n buildListUrl?: (type: string, ids: string[]) => string | null;\n /** Hub injects a `useNavLink`-backed render-prop provider; default = pure\n * anchor via `decideNewTab`. MUST be a module-scope component. */\n LinkProvider?: CardLinkProvider;\n /** Renderer pair for the admin-only `marketing_campaign` type. Absent →\n * the type renders nothing. */\n adminCampaignCard?: AdminCampaignCardSlot;\n /** When true, render the section shell (title + an empty-state line) even\n * with ZERO refs, instead of returning null. Default false (the original\n * behavior — empty rail = no shell). Opt-in per host page (e.g. people-hub's\n * \"What I Shipped\", where the section should always be present). */\n showWhenEmpty?: boolean;\n /** Empty-state copy shown under the title when `showWhenEmpty` and no refs.\n * Default: \"No related content yet.\" */\n emptyStateText?: string;\n /** Custom empty-state node (e.g. a hub `<EmptyState/>`) rendered under the\n * title when `showWhenEmpty` and there are no refs — overrides\n * `emptyStateText`. Lets a host match its canonical empty state. */\n emptyState?: React.ReactNode;\n}\n\nexport function RelatedContentSection({\n contentRefs,\n entityType,\n entityId,\n authorId,\n minResults,\n sameTypeMinResults,\n includeTypes,\n initialItems,\n title = 'Related Content',\n columns = 2,\n excludeTypes,\n apiBaseUrl = '',\n extras,\n resolveHref = defaultResolveHref,\n buildListUrl,\n LinkProvider = DefaultLinkPropsProvider,\n adminCampaignCard,\n showWhenEmpty = false,\n emptyStateText = 'No related content yet.',\n emptyState,\n}: RelatedContentSectionProps) {\n // ── Hooks above EVERY early return (the original `if (!contentRefs.length)\n // return null` guard moved below them). ──\n\n // Suggestion-mode fetch URL — null in controlled mode (contentRefs defined,\n // even []) or when the entity scope is incomplete.\n // `includeTypes: []` is an explicit \"nothing participates\" — skip the fetch\n // entirely (an empty-string `types=` param would be dropped by the URL\n // builder and read server-side as \"all candidates\") AND ignore SSR refs.\n const suggestionsDisabled = includeTypes?.length === 0;\n // Shared type-filter params — one spelling for both fetch modes so a future\n // normalization (trim/dedupe) can't diverge between them.\n const typeFilterParams = {\n types: includeTypes !== undefined ? includeTypes.join(',') : undefined,\n excludeTypes: excludeTypes && excludeTypes.length > 0 ? excludeTypes.join(',') : undefined,\n };\n // AUTHOR mode beats suggestion mode: when `authorId` is set the rail lists\n // everything that profile authored (the server returns ALL, no count).\n const authorUrl =\n contentRefs === undefined && authorId && !suggestionsDisabled\n ? buildSuggestionUrl('/api/related-content', {\n apiBaseUrl,\n extraParams: { authorId, ...typeFilterParams },\n })\n : null;\n const suggestUrl =\n authorUrl ??\n (contentRefs === undefined &&\n entityType &&\n entityId !== undefined &&\n entityId !== null &&\n entityId !== '' &&\n !suggestionsDisabled\n ? buildSuggestionUrl('/api/related-content', {\n apiBaseUrl,\n entityType,\n entityId,\n count: minResults,\n extraParams: {\n sameTypeCount: sameTypeMinResults !== undefined ? String(sameTypeMinResults) : undefined,\n ...typeFilterParams,\n },\n })\n : null);\n // Memoize the initialData wrapper — useSelfFetch re-syncs on [initialData],\n // and a fresh per-render object would loop setState under re-rendering\n // parents (the latent FaqSection bug, fixed there in the same change).\n const initialData = useMemo<RelatedContentResponse | undefined>(\n // An explicitly disabled rail (includeTypes: []) must ignore SSR-hydrated\n // refs too — otherwise useSelfFetch(null, {initialData}) keeps serving\n // initialItems and the \"nothing participates\" contract silently breaks.\n () => (!suggestionsDisabled && initialItems ? { refs: initialItems } : undefined),\n [initialItems, suggestionsDisabled],\n );\n const { data, isLoading } = useSelfFetch<RelatedContentResponse>(suggestUrl, { initialData });\n\n // Default group fetcher: the lib's byte-parity-tested builder, prefixed for\n // embeds. Memoized so group-fetch URLs stay value-stable across renders.\n const effectiveBuildListUrl = useMemo(\n () => buildListUrl ?? ((type: string, ids: string[]) => libBuildListUrl(type, ids, apiBaseUrl)),\n [buildListUrl, apiBaseUrl],\n );\n\n const refs: ContentRef[] = contentRefs ?? data?.refs ?? [];\n\n // Per-consumer type gating — drops refs whose `type` is in the exclude\n // list. In suggestion mode the server already subtracted these (the param\n // is forwarded above); the client filter stays as an idempotent guard and\n // IS the mechanism in controlled mode (original behavior).\n const exclude = new Set(excludeTypes || []);\n const visibleRefs = exclude.size > 0 ? refs.filter(r => !exclude.has(r.type)) : refs;\n // Zero refs (still loading in suggestion mode, or genuinely empty). Default:\n // no empty shell. Opt-in (`showWhenEmpty`): render the title + an empty-state\n // line so the section is always present (e.g. people-hub \"What I Shipped\").\n if (!visibleRefs.length) {\n if (!showWhenEmpty) return null; // non-showWhenEmpty consumers stay blank (unchanged)\n // Client-fetch loading (author/suggestion mode, no SSR initialItems): render a\n // SKELETON grid — reserves height + matches the rest of the app's loading, so\n // there's no blank-then-pop jump (the prior `return null` collapsed the tab to\n // zero height during the fetch). SSR controlled mode has isLoading=false → it\n // skips straight to the empty state below. Skeleton type = the requested rail\n // type (author mode passes a single `includeTypes`).\n if (isLoading) {\n const skeletonType = includeTypes?.[0] ?? entityType ?? 'blog_post_existing';\n return (\n <div className=\"space-y-8\">\n <h2 className=\"text-ods-text-primary text-h2\">{title}</h2>\n <div className={gridClassFor(columns)}>\n {Array.from({ length: 3 }).map((_, i) => (\n <div key={i}>{renderSkeletonForType(skeletonType, 'default', adminCampaignCard)}</div>\n ))}\n </div>\n </div>\n );\n }\n return (\n <div className=\"space-y-8\">\n <h2 className=\"text-2xl font-bold text-ods-text-primary\">{title}</h2>\n {emptyState ?? <p className=\"text-ods-text-secondary\">{emptyStateText}</p>}\n </div>\n );\n }\n\n const grouped: Record<string, ContentRef[]> = {};\n for (const ref of visibleRefs) {\n if (!grouped[ref.type]) grouped[ref.type] = [];\n grouped[ref.type].push(ref);\n }\n\n // Registered types in CONTENT_REF_GROUPS order, then any unregistered\n // types appended (same shape the investor-email builder uses — both\n // consume `orderContentRefTypes` so cross-surface ordering matches).\n // SAME-TYPE FIRST: when a host entityType is known (suggestion / SSR\n // modes), its own content-type group is hoisted to the top — a blog\n // post's rail leads with blog posts. Rail group keys are compared via\n // the shared alias canonicalizer (blog_post_existing ↔ blog_post).\n let orderedTypes = orderContentRefTypes(Object.keys(grouped));\n if (entityType) {\n // Canonicalize BOTH sides — hosts pass registry vocab ('blog_post') but\n // rail-vocab aliases ('blog_post_existing') are also legal inputs; a raw\n // comparison would silently lose the same-type-first hoist for aliases.\n const canonicalEntityType = canonicalContentRefType(entityType);\n const sameType = orderedTypes.filter(t => canonicalContentRefType(t) === canonicalEntityType);\n if (sameType.length > 0) {\n orderedTypes = [...sameType, ...orderedTypes.filter(t => canonicalContentRefType(t) !== canonicalEntityType)];\n }\n }\n\n return (\n <div className=\"space-y-8\">\n <h2 className=\"text-ods-text-primary text-h2\">{title}</h2>\n {orderedTypes.map(type => (\n <ContentGroup\n key={type}\n type={type}\n refs={grouped[type]}\n columns={columns}\n buildUrl={effectiveBuildListUrl}\n resolveHref={resolveHref}\n LinkProvider={LinkProvider}\n extras={extras}\n adminCampaignCard={adminCampaignCard}\n heading={\n <h3 className=\"font-semibold text-ods-text-secondary text-h5\">{getContentRefLabelOrTitleCase(type)}</h3>\n }\n />\n ))}\n </div>\n );\n}\n","'use client';\n\n/**\n * Per-type card registry for the related-content rail — the SIZED sibling of\n * the chat side's `CHAT_CARD_REGISTRY` (`../chat/entity-cards/dispatch.tsx`),\n * and built to the same shape: ONE entry per content type, carrying that\n * type's skeleton and its card renderer, dispatched once from\n * `related-content-section.tsx`.\n *\n * WHY THIS FILE EXISTS\n * --------------------\n * The rail fetches one row per ref from that type's public list API. The row\n * arrives as `unknown` (`useSelfFetch<unknown>` → `extractItems`), and its\n * SHAPE is decided at runtime by the ref's `type`. The rail used to bridge\n * that with a single `item: any` threaded through a ten-branch switch, so\n * every `prop={item}` forward was an unchecked promise: a row missing a field\n * reached a card that declared it required, and the card rendered the miss\n * (an empty heading, a version pill reading \"vundefined\").\n *\n * Each entry here closes over its OWN row type instead. `cardEntry<Row>` pairs\n * a `decode` (runtime `unknown` → `Row`) with a `render` that receives `Row`,\n * and erases `Row` from the stored entry — so the registry is homogeneous\n * (`Record<string, RelatedCardRegistryEntry>`) while every branch stays\n * concretely typed. No `any`, no assertions into card row types.\n *\n * ON THE `*_ROW_DEFAULTS` CONSTANTS\n * ---------------------------------\n * Each card declares the FULL entity type as its row prop (`BlogPostSummary`,\n * `CaseStudy`, …) while reading only a handful of fields off it, and the list\n * APIs return projections rather than whole rows. A decoder therefore reads\n * the card's read set from the row and takes every other required field from\n * a `*_ROW_DEFAULTS` literal. Those placeholders are inert BY CONSTRUCTION —\n * the decoded row goes nowhere but its own card, and the card never reads\n * them. They are annotated with the entity type on purpose: a new required\n * field on `CaseStudy` surfaces as a compile error here instead of silently\n * reaching a card as `undefined`, which is the exact failure this file\n * replaces.\n *\n * ADDING A TYPE: one entry below (skeleton + decode + render), plus the chat\n * side's `CHAT_CARD_REGISTRY` and the list-URL builder — see the LOCKSTEP note\n * in `related-content-section.tsx`.\n */\n\nimport type React from 'react';\nimport type { BlogPostSummary } from '../../types/blog';\nimport type { CaseStudy } from '../../types/case-study';\nimport type { CustomerInterview } from '../../types/customer-interview';\nimport type { EntityAuthor } from '../../types/entity-author';\nimport type { MSP } from '../../types/stack';\nimport type { UserProfile } from '../../types/user';\nimport { AiPromptCard, AiPromptCardSkeleton, type AiPromptCardData } from '../chat/entity-cards/ai-prompt-card';\n// DEEP card imports — NOT the `../chat` barrel. See the import note in\n// `related-content-section.tsx`: the barrel statically reaches\n// @tanstack/react-query, deep paths keep this module's source graph free of it.\nimport { BlogCard, BlogCardSkeleton } from '../chat/entity-cards/blog-card';\nimport { CaseStudyCard, CaseStudyCardSkeleton } from '../chat/entity-cards/case-study-card';\nimport { CustomerInterviewCard, CustomerInterviewCardSkeleton } from '../chat/entity-cards/customer-interview-card';\n// Type-only — erased at build, no runtime dependency on the dispatch module.\nimport type { ChatCardDispatchExtras } from '../chat/entity-cards/dispatch';\nimport { HowIWorkCard, HowIWorkCardSkeleton, type HowIWorkCardData } from '../chat/entity-cards/how-i-work-card';\nimport { InvestorUpdateCard, InvestorUpdateCardSkeleton } from '../chat/entity-cards/investor-update-card';\nimport { OnboardingGuideCard, OnboardingGuideCardSkeleton } from '../chat/entity-cards/onboarding-guide-card';\nimport { ProductReleaseCard, ProductReleaseCardSkeleton } from '../chat/entity-cards/product-release-card';\nimport { buildProductReleaseCardProps } from '../chat/entity-cards/product-release-card-defaults';\nimport { ProgramCard, ProgramCardSkeleton } from '../chat/entity-cards/program-card';\nimport { RoadmapCard, RoadmapCardSkeleton } from '../chat/entity-cards/roadmap-card';\nimport {\n WhatIShippedCard,\n WhatIShippedCardSkeleton,\n type WhatIShippedCardData,\n} from '../chat/entity-cards/what-i-shipped-card';\nimport type { InvestorUpdate } from '../chat/types/entities/investor-update';\nimport type { OnboardingGuide } from '../chat/types/entities/onboarding-guide';\nimport type { BaseProgramItem, ProgramHost } from '../chat/types/entities/program-types';\nimport type { RoadmapItem } from '../chat/types/entities/roadmap-item';\n\nexport type CardSize = 'lg' | 'default' | 'sm';\n\n/** Anchor prop bundle the per-card link surface receives — same shape the\n * hub's `useNavLink` returns and the chat dispatcher's anchor builders\n * produce. `null` = non-anchor mode (no URL). */\nexport interface CardLinkAnchorProps {\n href: string;\n target?: '_blank';\n rel?: 'noopener noreferrer';\n onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;\n}\n\n// =============================================================================\n// Row reading — the ONE place a runtime row is inspected.\n// =============================================================================\n\n/**\n * View an unvalidated row as a keyed bag. This claims nothing about the row's\n * SHAPE — every read below still checks the value's type — it only says \"this\n * is an object I may look keys up on\". A non-object row (null, a string, a\n * number) collapses to `{}`, so every decoder degrades to its defaults instead\n * of throwing.\n */\nfunction asRecord(value: unknown): Record<string, unknown> {\n return typeof value === 'object' && value !== null ? (value as Record<string, unknown>) : {};\n}\n\n/** A STRING field, or `undefined` when missing or wrong-typed. */\nexport function rowString(row: unknown, key: string): string | undefined {\n const value = asRecord(row)[key];\n return typeof value === 'string' ? value : undefined;\n}\n\nfunction str(row: Record<string, unknown>, key: string): string {\n const value = row[key];\n return typeof value === 'string' ? value : '';\n}\n\nfunction strOrNull(row: Record<string, unknown>, key: string): string | null {\n const value = row[key];\n return typeof value === 'string' ? value : null;\n}\n\nfunction numOrNull(row: Record<string, unknown>, key: string): number | null {\n const value = row[key];\n return typeof value === 'number' ? value : null;\n}\n\n/** `Array.isArray` narrows `unknown` to `any[]`; annotating the result keeps\n * the elements `unknown` so nothing downstream inherits `any`. Same guard the\n * shared `extractItems` normalizer uses. */\nfunction arrayOf(value: unknown): unknown[] {\n const list: unknown[] = Array.isArray(value) ? value : [];\n return list;\n}\n\nfunction stringList(value: unknown): string[] {\n return arrayOf(value).filter((entry): entry is string => typeof entry === 'string');\n}\n\n// =============================================================================\n// Shared nested-shape decoders (joins hydrated onto several row types).\n// =============================================================================\n\n/** `{ name, slug }` tag / category joins. Rows that carry only `name` (the\n * chat-side row shape) keep their label and get an empty slug — the cards\n * read `name` and nothing else. */\nfunction namedSlugList(value: unknown): { name: string; slug: string }[] {\n const out: { name: string; slug: string }[] = [];\n for (const entry of arrayOf(value)) {\n const record = asRecord(entry);\n const name = strOrNull(record, 'name');\n if (name === null) continue;\n out.push({ name, slug: str(record, 'slug') });\n }\n return out;\n}\n\nconst USER_PROFILE_DEFAULTS: UserProfile = {\n id: '',\n full_name: null,\n email: '',\n avatar_url: null,\n job_title: null,\n company: null,\n bio: null,\n employee_id: null,\n department_id: null,\n department: null,\n role: 'user',\n msp_id: null,\n created_at: '',\n updated_at: '',\n};\n\n/** The customer/author join on case studies + customer interviews. The cards\n * read `full_name`, `avatar_url` and `job_title`; absent join → `undefined`,\n * which is what those cards already fall back on. */\nfunction decodeUserProfile(value: unknown): UserProfile | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const record = asRecord(value);\n return {\n ...USER_PROFILE_DEFAULTS,\n id: str(record, 'id'),\n full_name: strOrNull(record, 'full_name'),\n avatar_url: strOrNull(record, 'avatar_url'),\n job_title: strOrNull(record, 'job_title'),\n };\n}\n\nconst MSP_DEFAULTS: MSP = { id: '', name: '', seat_count: 0, created_at: '', updated_at: '' };\n\n/** The MSP join — cards read `name` and `icon_url`. */\nfunction decodeMsp(value: unknown): MSP | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const record = asRecord(value);\n return {\n ...MSP_DEFAULTS,\n id: str(record, 'id'),\n name: str(record, 'name'),\n icon_url: rowString(record, 'icon_url'),\n };\n}\n\n/** The shared hydrated-author shape (`EntityAuthor`) — only `full_name` and\n * `avatar_url` are required, so this needs no defaults literal. */\nfunction decodeEntityAuthor(value: unknown): EntityAuthor | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const record = asRecord(value);\n return {\n id: rowString(record, 'id'),\n full_name: strOrNull(record, 'full_name'),\n avatar_url: strOrNull(record, 'avatar_url'),\n job_title: strOrNull(record, 'job_title'),\n about: strOrNull(record, 'about'),\n slug: rowString(record, 'slug'),\n };\n}\n\n/** Program hosts / speakers. `name` is the only required field; an entry\n * without one is dropped rather than rendered as a nameless avatar. */\nfunction decodeProgramHosts(value: unknown): ProgramHost[] | null {\n if (value == null) return null;\n const out: ProgramHost[] = [];\n for (const entry of arrayOf(value)) {\n const record = asRecord(entry);\n const name = strOrNull(record, 'name');\n if (name === null) continue;\n out.push({\n name,\n id: rowString(record, 'id'),\n email: rowString(record, 'email'),\n avatar_url: rowString(record, 'avatar_url'),\n bio: rowString(record, 'bio'),\n role: rowString(record, 'role'),\n });\n }\n return out;\n}\n\n// =============================================================================\n// Per-type row decoders. Each reads the fields ITS card renders; every other\n// required field comes from the type-annotated defaults literal above it.\n// =============================================================================\n\nfunction decodeBlogRow(row: unknown): BlogPostSummary {\n const record = asRecord(row);\n return {\n id: numOrNull(record, 'id') ?? 0,\n title: str(record, 'title'),\n slug: str(record, 'slug'),\n summary: strOrNull(record, 'summary'),\n featured_image: strOrNull(record, 'featured_image'),\n published_at: strOrNull(record, 'published_at'),\n author_name: strOrNull(record, 'author_name'),\n author_avatar: strOrNull(record, 'author_avatar'),\n categories: namedSlugList(record.categories),\n tags: namedSlugList(record.tags),\n view_count: numOrNull(record, 'view_count') ?? undefined,\n };\n}\n\nconst CASE_STUDY_ROW_DEFAULTS: CaseStudy = {\n id: 0,\n title: '',\n slug: '',\n summary: null,\n featured_image: null,\n user_id: null,\n challenge: null,\n solution: null,\n results: null,\n testimonial_video_url: null,\n main_video_url: null,\n video_source_type: null,\n video_source: null,\n video_bites: [],\n customer_interview_id: null,\n seo_title: null,\n seo_description: null,\n seo_keywords: null,\n og_image_url: null,\n status: 'published',\n published_at: null,\n author_id: null,\n created_at: '',\n updated_at: '',\n view_count: 0,\n};\n\nfunction decodeCaseStudyRow(row: unknown): CaseStudy {\n const record = asRecord(row);\n return {\n ...CASE_STUDY_ROW_DEFAULTS,\n id: numOrNull(record, 'id') ?? 0,\n title: str(record, 'title'),\n summary: strOrNull(record, 'summary'),\n featured_image: strOrNull(record, 'featured_image'),\n msp: decodeMsp(record.msp),\n user: decodeUserProfile(record.user),\n };\n}\n\nconst CUSTOMER_INTERVIEW_ROW_DEFAULTS: CustomerInterview = {\n id: 0,\n title: '',\n slug: '',\n video_summary: null,\n transcript: null,\n user_id: null,\n main_video_url: null,\n teasers: [],\n quotes: [],\n case_study_id: null,\n seo_title: null,\n seo_description: null,\n seo_keywords: null,\n og_image_url: null,\n featured_image: null,\n status: 'completed',\n completed_at: null,\n author_id: null,\n custom_instructions: null,\n created_at: '',\n updated_at: '',\n view_count: 0,\n};\n\nfunction decodeCustomerInterviewRow(row: unknown): CustomerInterview {\n const record = asRecord(row);\n return {\n ...CUSTOMER_INTERVIEW_ROW_DEFAULTS,\n id: numOrNull(record, 'id') ?? 0,\n title: str(record, 'title'),\n video_summary: strOrNull(record, 'video_summary'),\n main_video_url: strOrNull(record, 'main_video_url'),\n featured_image: strOrNull(record, 'featured_image'),\n msp: decodeMsp(record.msp),\n user: decodeUserProfile(record.user),\n };\n}\n\nconst INVESTOR_UPDATE_ROW_DEFAULTS: InvestorUpdate = {\n id: '',\n title: '',\n slug: '',\n update_number: null,\n period_start: null,\n period_end: null,\n platform_id: null,\n content: null,\n video_summary: null,\n transcript: null,\n main_video_url: null,\n highlight_video_url: null,\n highlight_video_thumbnail: null,\n main_video_thumbnail: null,\n video_bites: [],\n featured_image: null,\n strategic_update: null,\n financials: {},\n metrics_snapshot: {},\n content_refs: [],\n highlights: null,\n section_visibility: {},\n status: 'published',\n published_at: null,\n author_id: null,\n seo_title: null,\n seo_description: null,\n seo_keywords: null,\n og_image_url: null,\n hubspot_email_id: null,\n custom_instructions: null,\n created_at: '',\n updated_at: '',\n created_by: null,\n updated_by: null,\n};\n\nfunction decodeInvestorUpdateRow(row: unknown): InvestorUpdate {\n const record = asRecord(row);\n return {\n ...INVESTOR_UPDATE_ROW_DEFAULTS,\n id: str(record, 'id'),\n title: str(record, 'title'),\n update_number: numOrNull(record, 'update_number'),\n period_start: strOrNull(record, 'period_start'),\n period_end: strOrNull(record, 'period_end'),\n content: strOrNull(record, 'content'),\n strategic_update: strOrNull(record, 'strategic_update'),\n featured_image: strOrNull(record, 'featured_image'),\n };\n}\n\nconst ONBOARDING_GUIDE_ROW_DEFAULTS: OnboardingGuide = {\n id: '',\n title: '',\n slug: '',\n section: '',\n step_order: 0,\n section_order: 0,\n content: null,\n video_summary: null,\n transcript: null,\n transcript_words_data: null,\n srt_content: null,\n ai_transcript_formatted: null,\n main_video_url: null,\n main_video_thumbnail: null,\n youtube_url: null,\n highlight_video_url: null,\n highlight_video_thumbnail: null,\n highlight_video_duration_ms: null,\n highlight_video_source: null,\n video_bites: [],\n featured_image: null,\n og_image_url: null,\n seo_title: null,\n seo_description: null,\n seo_keywords: null,\n status: 'published',\n published_at: null,\n author_id: null,\n custom_instructions: null,\n config: null,\n ai_effort_score: null,\n created_at: '',\n updated_at: '',\n created_by: null,\n updated_by: null,\n};\n\nfunction decodeOnboardingGuideRow(row: unknown): OnboardingGuide {\n const record = asRecord(row);\n return {\n ...ONBOARDING_GUIDE_ROW_DEFAULTS,\n id: str(record, 'id'),\n title: str(record, 'title'),\n section: str(record, 'section'),\n step_order: numOrNull(record, 'step_order') ?? 0,\n content: strOrNull(record, 'content'),\n video_summary: strOrNull(record, 'video_summary'),\n featured_image: strOrNull(record, 'featured_image'),\n og_image_url: strOrNull(record, 'og_image_url'),\n main_video_thumbnail: strOrNull(record, 'main_video_thumbnail'),\n highlight_video_thumbnail: strOrNull(record, 'highlight_video_thumbnail'),\n highlight_video_duration_ms: numOrNull(record, 'highlight_video_duration_ms'),\n author: decodeEntityAuthor(record.author),\n };\n}\n\n/**\n * `RoadmapItem` is the one row type the card reads WHOLE, so this decoder\n * carries no defaults literal — every field is read off the row.\n *\n * `upvotes` / `downvotes` / `quarter` are required `number`/`string` props the\n * card renders directly. Read off an untyped row they were `any`, so a row\n * without them rendered the miss (a blank vote count). They now fall back to\n * `0` / `''`, matching how the card renders a genuinely zero-vote item.\n */\nfunction decodeRoadmapRow(row: unknown): RoadmapItem {\n const record = asRecord(row);\n const assignees: NonNullable<RoadmapItem['assignees']> = [];\n for (const entry of arrayOf(record.assignees)) {\n const assignee = asRecord(entry);\n assignees.push({\n id: numOrNull(assignee, 'id') ?? 0,\n name: strOrNull(assignee, 'name'),\n avatarUrl: strOrNull(assignee, 'avatarUrl'),\n });\n }\n return {\n id: str(record, 'id'),\n title: str(record, 'title'),\n description: str(record, 'description'),\n status: str(record, 'status'),\n statusColor: str(record, 'statusColor'),\n icon: strOrNull(record, 'icon'),\n figmaUrl: strOrNull(record, 'figmaUrl'),\n screenshots: stringList(record.screenshots),\n targetVersion: strOrNull(record, 'targetVersion'),\n upvotes: numOrNull(record, 'upvotes') ?? 0,\n downvotes: numOrNull(record, 'downvotes') ?? 0,\n quarter: str(record, 'quarter'),\n clickupUrl: str(record, 'clickupUrl'),\n customItemId: numOrNull(record, 'customItemId'),\n assignees,\n };\n}\n\n/**\n * Program rows (podcast / webinar / event) keep their EXTRA columns.\n *\n * `<ProgramCard>` is generic over the item, and the config the rail threads in\n * is an `AnyProgramConfig` — `ProgramConfig<BaseProgramItem &\n * Record<string, unknown>>` — precisely so per-program columns ride along. The\n * card branches on `'duration_seconds' in item` / `'location_name' in item` /\n * `'start_at' in item`, so dropping the unrecognised columns would silently\n * strip a podcast's runtime and an event's venue. The raw row is spread first\n * and the base fields are decoded over it.\n */\nfunction decodeProgramRow(row: unknown): BaseProgramItem & Record<string, unknown> {\n const record = asRecord(row);\n return {\n ...record,\n id: str(record, 'id'),\n title: str(record, 'title'),\n description: strOrNull(record, 'description'),\n cover_url: strOrNull(record, 'cover_url'),\n date: str(record, 'date'),\n external_url: strOrNull(record, 'external_url'),\n hosts: decodeProgramHosts(record.hosts),\n };\n}\n\n/** The two employee-entry cards already declare MINIMAL row shapes\n * (`EmployeeEntryCardData` + one date column each), so their decoders read\n * exactly the card's fields with nothing left over. */\nfunction decodeEmployeeEntryRow(row: unknown): WhatIShippedCardData & HowIWorkCardData & AiPromptCardData {\n const record = asRecord(row);\n const department = asRecord(record.department);\n const stepCount = record.step_count;\n return {\n title: strOrNull(record, 'title'),\n summary: strOrNull(record, 'summary'),\n status: strOrNull(record, 'status'),\n featured_image: strOrNull(record, 'featured_image'),\n main_video_thumbnail: strOrNull(record, 'main_video_thumbnail'),\n author: decodeEntityAuthor(record.author),\n entry_month: strOrNull(record, 'entry_month'),\n session_date: strOrNull(record, 'session_date'),\n discipline: strOrNull(record, 'discipline'),\n published_at: strOrNull(record, 'published_at'),\n department: record.department\n ? { name: strOrNull(department, 'name'), color: strOrNull(department, 'color') }\n : null,\n step_count: typeof stepCount === 'number' ? stepCount : null,\n };\n}\n\n// =============================================================================\n// Registry\n// =============================================================================\n\n/** Everything a card branch needs beyond its own row — computed once per card\n * by the rail's dispatcher and shared by every entry. */\nexport interface RelatedCardContext {\n /** Card density for this group, from `CONTENT_REF_GROUPS`. */\n size: CardSize;\n /** `size` with `'lg'` collapsed to `'default'` — most card variants accept\n * only that pair. */\n legacySize: 'default' | 'sm';\n href: string;\n targetPlatform: string | null;\n /** `null` = the host surfaced no URL; the card stays in non-anchor mode. */\n linkProps: CardLinkAnchorProps | null;\n /** `{ target, rel }` for the cards that take them as separate props. */\n anchorAttrs: Pick<CardLinkAnchorProps, 'target' | 'rel'>;\n /** Branded OG fallback for cards whose row has no featured image. */\n placeholderUrl?: string;\n extras?: ChatCardDispatchExtras;\n}\n\n/** One registered content type. `Row` is erased here — `cardEntry` below is\n * what keeps each branch's row type concrete. */\nexport interface RelatedCardRegistryEntry {\n /** Sized to match the resolved card exactly (zero layout shift). */\n skeleton: (size: CardSize) => React.ReactNode;\n render: (row: unknown, ctx: RelatedCardContext) => React.ReactNode;\n}\n\n/**\n * Register one type with its OWN row type.\n *\n * `Row` is bound by the definition object and never escapes: `render` is\n * handed a decoded `Row`, and the stored entry exposes only\n * `(row: unknown) => ReactNode`. That is what lets a single registry hold ten\n * heterogeneous row shapes without a shared supertype — the job `item: any`\n * used to do, minus the promise it could not keep.\n */\nfunction cardEntry<Row>(definition: {\n skeleton: (size: CardSize) => React.ReactNode;\n decode: (row: unknown) => Row;\n render: (row: Row, ctx: RelatedCardContext) => React.ReactNode;\n}): RelatedCardRegistryEntry {\n return {\n skeleton: definition.skeleton,\n render: (row, ctx) => definition.render(definition.decode(row), ctx),\n };\n}\n\n/** Podcast / webinar / event share one card + one skeleton and differ only by\n * which host-supplied `ProgramConfig` they render with. A group whose config\n * the host didn't supply renders nothing (the skeleton still reserves its\n * height, so a rail that never resolves collapses instead of flickering). */\nfunction programEntry(configKey: 'podcast' | 'webinar' | 'event'): RelatedCardRegistryEntry {\n return cardEntry({\n skeleton: size => <ProgramCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeProgramRow,\n render: (item, ctx) => {\n const config = ctx.extras?.programConfigs?.[configKey];\n if (!config) return null;\n return (\n <ProgramCard\n config={config}\n item={item}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n );\n },\n });\n}\n\n/** The three ClickUp-backed types render the same card, distinguished by\n * `cardType` (drives the compact icon slot). */\nfunction roadmapEntry(cardType: 'roadmap_item' | 'delivery_item' | 'internal_task'): RelatedCardRegistryEntry {\n return cardEntry({\n skeleton: size => <RoadmapCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeRoadmapRow,\n render: (item, ctx) => (\n <RoadmapCard\n item={item}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n userVote={null}\n onVote={() => {}}\n size={ctx.legacySize}\n cardType={cardType}\n {...ctx.anchorAttrs}\n />\n ),\n });\n}\n\nexport const RELATED_CARD_REGISTRY: Record<string, RelatedCardRegistryEntry> = {\n blog_post_existing: cardEntry({\n skeleton: size => <BlogCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeBlogRow,\n render: (post, ctx) => (\n <BlogCard\n post={post}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n case_study: cardEntry({\n skeleton: size => <CaseStudyCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeCaseStudyRow,\n render: (study, ctx) => (\n <CaseStudyCard\n study={study}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n customer_interview: cardEntry({\n skeleton: size => <CustomerInterviewCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeCustomerInterviewRow,\n render: (interview, ctx) => (\n <CustomerInterviewCard\n interview={interview}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n /**\n * Product releases derive their whole prop bundle through a HOST seam\n * (`extras.buildProductReleaseCardProps`, defaulting to the lib builder)\n * which already takes `unknown` — so this entry's row type is the bare\n * record, and the three props the rail sets itself are read off it.\n */\n product_release: cardEntry({\n skeleton: size => <ProductReleaseCardSkeleton size={size === 'sm' ? 'sm' : 'lg'} />,\n decode: asRecord,\n render: (release, ctx) => {\n const buildReleaseProps = ctx.extras?.buildProductReleaseCardProps ?? buildProductReleaseCardProps;\n const releaseProps = buildReleaseProps(release);\n return (\n <ProductReleaseCard\n size={ctx.size === 'sm' ? 'sm' : 'lg'}\n // `title` and `version` are REQUIRED `string` props. Read off an\n // untyped row they were `any`, so a release row missing either one\n // rendered an empty heading and a version pill reading \"vundefined\".\n // `summary` is `string | null | undefined` and the card renders\n // `summary ?? ''`, so a dropped one is indistinguishable from null.\n title={str(release, 'title')}\n summary={rowString(release, 'summary')}\n version={str(release, 'version')}\n {...releaseProps}\n // The card wraps in `<a {...anchorProps}>` ONLY when\n // `anchorProps.href` is set — `undefined` (not an empty object)\n // keeps it in non-anchor mode instead of rendering a dead <a>.\n anchorProps={ctx.linkProps ?? undefined}\n />\n );\n },\n }),\n\n podcast: programEntry('podcast'),\n webinar: programEntry('webinar'),\n event: programEntry('event'),\n\n investor_update: cardEntry({\n skeleton: size => <InvestorUpdateCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeInvestorUpdateRow,\n render: (update, ctx) => (\n <InvestorUpdateCard\n update={update}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n /** The rich CATALOG variant (hero + author grid, clamped description) — the\n * step-numbered 'default' variant is for the guide detail page's \"More in\n * section\" rail, not this full-width row. */\n onboarding_guide: cardEntry({\n skeleton: size => <OnboardingGuideCardSkeleton size={size === 'sm' ? 'sm' : 'catalog'} />,\n decode: decodeOnboardingGuideRow,\n render: (guide, ctx) => (\n <OnboardingGuideCard\n guide={guide}\n size={ctx.size === 'sm' ? 'sm' : 'catalog'}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n /** THE single What I Shipped card — same lib component the people-hub\n * dashboard renders. `anchorProps` makes the whole card a click-through\n * (the rail is read-only — no owner actions). Only pass it with a REAL\n * href: an object with `href: undefined` is still truthy and would wrap the\n * card in a dead <a>. */\n what_i_shipped: cardEntry({\n skeleton: () => <WhatIShippedCardSkeleton />,\n decode: decodeEmployeeEntryRow,\n render: (entry, ctx) => (\n <WhatIShippedCard\n entry={entry}\n placeholderUrl={ctx.placeholderUrl}\n anchorProps={ctx.linkProps ?? (ctx.href ? { href: ctx.href, ...ctx.anchorAttrs } : undefined)}\n />\n ),\n }),\n\n /** Same shared employee-entry shape + anchor contract as What I Shipped. */\n how_i_work: cardEntry({\n skeleton: () => <HowIWorkCardSkeleton />,\n decode: decodeEmployeeEntryRow,\n render: (entry, ctx) => (\n <HowIWorkCard\n entry={entry}\n placeholderUrl={ctx.placeholderUrl}\n anchorProps={ctx.linkProps ?? (ctx.href ? { href: ctx.href, ...ctx.anchorAttrs } : undefined)}\n />\n ),\n }),\n\n /** Same shared employee-entry shape + anchor contract as What I Shipped. */\n ai_prompt: cardEntry({\n skeleton: () => <AiPromptCardSkeleton />,\n decode: decodeEmployeeEntryRow,\n render: (entry, ctx) => (\n <AiPromptCard\n entry={entry}\n placeholderUrl={ctx.placeholderUrl}\n anchorProps={ctx.linkProps ?? (ctx.href ? { href: ctx.href, ...ctx.anchorAttrs } : undefined)}\n />\n ),\n }),\n\n roadmap_item: roadmapEntry('roadmap_item'),\n delivery_item: roadmapEntry('delivery_item'),\n internal_task: roadmapEntry('internal_task'),\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkCQGMYZXYcjs = require('./chunk-CQGMYZXY.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkCCWI3622cjs = require('./chunk-CCWI3622.cjs');
|
|
@@ -67,7 +67,7 @@ function DocSearchBar({
|
|
|
67
67
|
renderResult
|
|
68
68
|
}) {
|
|
69
69
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
70
|
-
|
|
70
|
+
_chunkCQGMYZXYcjs.SearchInput,
|
|
71
71
|
{
|
|
72
72
|
placeholder,
|
|
73
73
|
value: query,
|
|
@@ -381,4 +381,4 @@ function useDocSearch(config) {
|
|
|
381
381
|
|
|
382
382
|
|
|
383
383
|
exports.formatRelativePath = formatRelativePath; exports.DocSearchResultRow = DocSearchResultRow; exports.DocSearchBar = DocSearchBar; exports.mapDocSearchResults = mapDocSearchResults; exports.resolveSearchResultAction = resolveSearchResultAction; exports.useDocSearch = useDocSearch;
|
|
384
|
-
//# sourceMappingURL=chunk-
|
|
384
|
+
//# sourceMappingURL=chunk-4P3BQN6Y.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-WOWO3447.cjs","../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"names":["jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;AClBO,SAAS,kBAAA,CAAmB,QAAA,EAA0B;AAC3D,EAAA,GAAA,CAAI,CAAC,QAAA,EAAU,OAAO,EAAA;AACtB,EAAA,MAAM,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA;AAExD,EAAA,MAAM,eAAA,EAAiB,QAAA,CAAS,OAAA,EAAS,EAAA,EAAI,QAAA,CAAS,KAAA,CAAM,CAAA,EAAG,CAAA,CAAE,EAAA,EAAI,QAAA;AACrE,EAAA,OAAO,cAAA,CAAe,GAAA,CAAI,CAAA,GAAA,EAAA,GAAO,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,CAAY,EAAA,EAAI,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,CAAE,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAC,CAAA,CAAE,IAAA,CAAK,KAAK,CAAA;AAC5G;ADmBA;AACA;AEcQ,+CAAA;AAZD,SAAS,kBAAA,CAAmB,EAAE,MAAA,EAAQ,cAA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AA;AACrB,QAAA;AACF,MAAA;AACF,IAAA;AAGkB,IAAA;AAEL,IAAA;AACC,MAAA;AACd,IAAA;AAC0E,EAAA;AAID,EAAA;AAG7B,EAAA;AAEnB,EAAA;AAUpB,IAAA;AACyG,MAAA;AAavG,MAAA;AACgB,MAAA;AACO,QAAA;AACP,UAAA;AACC,YAAA;AACmC,YAAA;AACnD,YAAA;AACF,UAAA;AAOiB,UAAA;AAEkF,UAAA;AACjE,UAAA;AACY,UAAA;AAC9C,UAAA;AACF,QAAA;AACK,QAAA;AAIa,UAAA;AAQ0B,UAAA;AACiD,YAAA;AAC/D,YAAA;AACX,cAAA;AACb,cAAA;AACA,cAAA;AACM,YAAA;AACR,YAAA;AACF,UAAA;AACmD,UAAA;AACnD,UAAA;AACG,QAAA;AAMc,UAAA;AACsE,UAAA;AACvF,UAAA;AACG,QAAA;AAGc,UAAA;AACK,UAAA;AACtB,UAAA;AACG,QAAA;AACH,UAAA;AACJ,MAAA;AACF,IAAA;AACwF,IAAA;AAC1F,EAAA;AAK8D,EAAA;AAC9B,EAAA;AACL,IAAA;AACR,IAAA;AACnB,EAAA;AAEO,EAAA;AACL,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACkB,IAAA;AACpB,EAAA;AACF;ANsB8H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-WOWO3447.cjs","sourcesContent":[null,"/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return '';\n const segments = fullPath.replace(/\\.md$/, '').split('/');\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments;\n return parentSegments.map(seg => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' ')).join(' / ');\n}\n","'use client';\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta';\nimport { formatRelativePath } from './format-relative-path';\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string;\n path?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry;\n isHighlighted: boolean;\n}\n\nexport function DocSearchResultRow({ result, isHighlighted }: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined;\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined;\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n });\n const isGroup = result.metadata?.isGroup as boolean | undefined;\n\n return (\n <div className=\"flex w-full min-w-0 items-center gap-3\">\n <span className=\"flex-shrink-0 text-ods-text-secondary\" title={iconLabel}>\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className={`truncate text-h6 ${isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'}`}>\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"mt-0.5 truncate text-ods-text-secondary text-h6\">{formatRelativePath(result.path)}</div>\n )}\n </div>\n </div>\n );\n}\n","'use client';\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react';\nimport { SearchInput, type SearchResult } from '../../ui/search-input';\nimport { DocSearchResultRow } from './doc-search-result-row';\n\nexport interface DocSearchBarProps {\n placeholder: string;\n query: string;\n onQueryChange: (value: string) => void;\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[];\n isLoading: boolean;\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n },\n ) => void;\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean;\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number;\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number;\n className?: string;\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode;\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => <DocSearchResultRow result={result} isHighlighted={isHighlighted} />)\n }\n />\n );\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport type { SearchResult } from '../../ui/search-input';\nimport type { DocSearchResult } from './types';\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n]);\n\nconst ENTITY_LABELS: Record<string, string> = {\n 'financial-cap-table': 'Cap Table',\n 'financial-kpis': 'Financial KPIs',\n 'financial-pnl': 'Profit & Loss',\n 'financial-balance-sheet': 'Balance Sheets',\n 'financial-cash-flow': 'Cash Flow',\n 'blog-posts': 'Blog Posts',\n 'product-releases': 'Product Releases',\n 'case-studies': 'Case Studies',\n webinars: 'Webinars',\n events: 'Events',\n podcasts: 'Podcasts',\n};\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>();\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<{ type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }> = [];\n const seenRepos = new Set<string>();\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || [];\n group.push(doc);\n entityGroups.set(doc.sourceRepo, group);\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo);\n order.push({ type: 'entity', repo: doc.sourceRepo });\n }\n } else {\n order.push({ type: 'doc', doc });\n }\n }\n\n const results: SearchResult[] = [];\n for (const entry of order) {\n if (entry.type === 'entity') {\n // An 'entity' entry is only pushed AFTER its group lands in the map, so\n // a miss is unreachable — but dropping one group beats throwing away the\n // whole search dropdown if that ever stops holding.\n const rows = entityGroups.get(entry.repo);\n if (!rows || rows.length === 0) continue;\n const label = ENTITY_LABELS[entry.repo] || entry.repo;\n results.push({\n id: `group-${entry.repo}`,\n title: `${label} (${rows.length} ${rows.length === 1 ? 'record' : 'records'})`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map(r => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n });\n } else {\n const doc = entry.doc;\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown';\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null ? { targetPlatform: doc.targetPlatform } : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n });\n }\n }\n\n return results;\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → resolve the href through the host's\n * `composeContentUrl` seam (when wired), then use `decideNewTab` to\n * choose same-tab vs new-tab against the resolved `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { ComposeContentUrl } from '../../../utils/content-href';\nimport type { ChatRef } from '../../chat/chat-ref.types';\nimport { decideNewTab } from '../../chat/utils/decide-new-tab';\nimport type { SearchResult } from '../../ui/search-input';\n\n/** True for `https://…` and protocol-relative `//…`. A composed href that is\n * NOT absolute is an in-app route the host claimed via `hostedTypes` /\n * `overrides`. */\nfunction isAbsoluteHref(href: string): boolean {\n return /^(?:[a-z][a-z0-9+.-]*:)?\\/\\//i.test(href);\n}\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' };\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n /** The host's unified content-href seam (`runtime.composeContentUrl`).\n * When wired, an entity row's RAG `externalUrl` is re-resolved through it,\n * so a type the host serves in-app (`hostedTypes`) or deep-links itself\n * (`overrides`) lands on the SAME href the catalog cards and chat cards\n * use. Omitted → the legacy verbatim-`externalUrl` behavior. */\n composeContentUrl?: ComposeContentUrl,\n): SearchResultAction {\n const meta = result.metadata ?? {};\n const externalUrl = meta.externalUrl as string | undefined;\n const rowId = meta.id as string | undefined;\n const sourceRepo = meta.sourceRepo as string | undefined;\n const documentType = meta.documentType as string | undefined;\n if (externalUrl) {\n const targetPlatform = meta.targetPlatform as string | null | undefined;\n // Unified content-href seam — the same call `resolveSourceRowCTA` makes\n // for chat rows. Hosted types relativize the slug out of `externalUrl`;\n // everything else comes back verbatim, so an unwired host (or a row with\n // no `documentType`) keeps today's behavior byte-for-byte.\n const composed =\n composeContentUrl && documentType\n ? composeContentUrl({\n type: documentType,\n identifier: rowId ?? '',\n externalUrl,\n targetPlatform: targetPlatform ?? null,\n })\n : null;\n const href = composed?.href || externalUrl;\n // A RELATIVE composed href means the host claimed this row as in-app.\n // Short-circuit BEFORE `decideNewTab`: in embed mode that helper forces\n // new-tab unconditionally, which would fire `window.open()` on a path\n // that only resolves inside this app.\n if (composed && !isAbsoluteHref(href)) {\n return { kind: 'navigate-same-tab', href };\n }\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const isNewTab = decideNewTab({\n href,\n targetPlatform: composed ? composed.targetPlatform : targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n });\n return isNewTab ? { kind: 'navigate-new-tab', href } : { kind: 'navigate-same-tab', href };\n }\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n };\n }\n if (result.path) {\n return { kind: 'route', path: result.path };\n }\n return { kind: 'noop' };\n}\n","'use client';\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n *\n * ## Result hrefs go through the content-href seam\n *\n * A row's href is NOT the RAG `externalUrl` verbatim any more: when the\n * host wires `runtime.composeContentUrl` (or passes `composeContentUrl`\n * here), the row is re-resolved through it — the SAME seam the catalog\n * cards and the chat entity cards use. So a host that serves onboarding\n * guides at `/help-center/onboarding-guides/<slug>` gets that path from\n * the dropdown too, instead of bouncing the user to the canonical hub\n * URL. Unwired hosts keep the verbatim-`externalUrl` behavior.\n */\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context';\nimport { useRouter } from '../../../embed-shims';\nimport { useDebounce } from '../../../hooks/ui/use-debounce';\nimport type { ComposeContentUrl } from '../../../utils/content-href';\nimport { contentFetch } from '../../../utils/embed-content-fetch';\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution';\nimport type { SearchResult } from '../../ui/search-input';\nimport { mapDocSearchResults } from './map-doc-search-results';\nimport { resolveSearchResultAction } from './resolve-search-result-action';\nimport type { DocSearchResult } from './types';\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string;\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string;\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void;\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[];\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean;\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string;\n /** Optional content-href seam override. Same fall-back chain as\n * `searchEndpoint`: prop → `runtime.composeContentUrl` → none. Wired,\n * it makes a result row honor the host's `hostedTypes` / `overrides`\n * instead of navigating to the RAG's canonical hub URL — so a row\n * lands where the catalog card for the same entity lands. */\n composeContentUrl?: ComposeContentUrl;\n}\n\n/** One shared empty array, so \"no matches\" keeps a stable identity. */\nconst NO_RESULTS: SearchResult[] = [];\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/** `Array.isArray` narrows `unknown` to `any[]`; this keeps the elements `unknown`. */\nfunction isUnknownArray(value: unknown): value is readonly unknown[] {\n return Array.isArray(value);\n}\n\nfunction readString(source: Record<string, unknown>, key: string): string | undefined {\n const value = source[key];\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * Decode `/api/docs/search`'s `{ success, data }` envelope.\n *\n * `Response.json()` is typed `any`, so the rows used to reach\n * `mapDocSearchResults` through an `as DocSearchResult[]` that asserted a\n * shape nothing had checked. `path` and `name` are the two that bite: the\n * mapper uses `path` as the row's React `id` and `name` as its title, so a row\n * missing either renders as a blank, key-colliding entry in the dropdown.\n * Such rows are dropped; the rest of the result set still lists.\n *\n * Returns null when the envelope itself is not a successful result set.\n */\nfunction toDocSearchResults(payload: unknown): DocSearchResult[] | null {\n if (!isRecord(payload) || !payload.success || !isUnknownArray(payload.data)) return null;\n\n const rows: DocSearchResult[] = [];\n for (const entry of payload.data) {\n if (!isRecord(entry)) continue;\n const path = readString(entry, 'path');\n const name = readString(entry, 'name');\n const type = entry.type;\n if (path === undefined || name === undefined) continue;\n\n const targetPlatform = entry.targetPlatform;\n rows.push({\n path,\n name,\n type: type === 'folder' ? 'folder' : 'file',\n snippet: readString(entry, 'snippet') ?? '',\n matchType: entry.matchType === 'title' ? 'title' : 'content',\n documentType: readString(entry, 'documentType'),\n externalUrl: readString(entry, 'externalUrl'),\n targetPlatform: typeof targetPlatform === 'string' ? targetPlatform : null,\n sourceRepo: readString(entry, 'sourceRepo'),\n entityId: readString(entry, 'entityId'),\n });\n }\n return rows;\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const { source, baseRoute, onNavigate, tableIds, onInPageSwap, searchEndpoint, composeContentUrl } = config;\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : '';\n\n const router = useRouter();\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n // Also used as the proxy-prefix fallback for `searchEndpoint`, matching\n // how tickets resolves `findTicketUrl`.\n const runtime = useChatRuntime();\n const resolvedSearchEndpoint = searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? '/api/docs/search';\n // Content-href seam, same prop → runtime → none chain. Threading it into\n // `resolveSearchResultAction` is what makes the dropdown obey the host's\n // route map; without it the row navigates to the RAG's canonical hub URL\n // even when the host serves that content in-app under a different path.\n const resolvedComposeContentUrl = composeContentUrl ?? runtime?.composeContentUrl;\n\n const [query, setQuery] = useState('');\n const [results, setResults] = useState<SearchResult[]>(NO_RESULTS);\n const [isFetching, setIsFetching] = useState(false);\n const debouncedQuery = useDebounce(query, 300);\n\n // Falling below the two-character floor empties the dropdown. Adjusted while\n // rendering (React's documented pattern for a reset the render already has\n // the answer to) rather than from an effect, which committed one more frame\n // of the previous matches under a query that no longer searches for them.\n const searchable = debouncedQuery.trim().length >= 2;\n const [wasSearchable, setWasSearchable] = useState(searchable);\n if (wasSearchable !== searchable) {\n setWasSearchable(searchable);\n if (!searchable) {\n setResults(NO_RESULTS);\n setIsFetching(false);\n }\n }\n\n useEffect(() => {\n if (!searchable) return undefined;\n\n let cancelled = false;\n\n async function fetchResults() {\n setIsFetching(true);\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n });\n if (tableIdsKey) params.set('tableIds', tableIdsKey);\n\n const response = await contentFetch(`${resolvedSearchEndpoint}?${params.toString()}`);\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`);\n }\n\n const json: unknown = await response.json();\n\n if (!cancelled) {\n // An envelope that is not a successful result set now clears the\n // dropdown instead of leaving it untouched. Previously a 200 that\n // carried `success: false` (or a non-array `data`) fell through\n // every branch, so the PREVIOUS query's matches stayed on screen\n // under the new query — the throw path already reset them.\n const rows = toDocSearchResults(json);\n setResults(rows ? mapDocSearchResults(rows) : NO_RESULTS);\n }\n } catch (error) {\n console.error('Doc search error:', error);\n if (!cancelled) {\n setResults(NO_RESULTS);\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false);\n }\n }\n }\n\n // Never rejects — try/catch/finally, every write gated on `cancelled`.\n void fetchResults();\n\n return () => {\n cancelled = true;\n };\n }, [debouncedQuery, searchable, source, tableIdsKey, resolvedSearchEndpoint]);\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading = query.trim().length >= 2 && (query !== debouncedQuery || isFetching);\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false);\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n },\n ) => {\n const action = resolveSearchResultAction(result, source, runtime?.navigation.mode, resolvedComposeContentUrl);\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0));\n switch (action.kind) {\n case 'navigate-same-tab': {\n if (wantsNewTab) {\n setKeepOpen(true);\n window.open(action.href, '_blank', NEW_TAB_FEATURES);\n return;\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false);\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`) ? action.href.slice(baseRoute.length + 1) : null;\n if (path && onInPageSwap?.(path)) return;\n router.push(stripSameOriginToPath(action.href));\n return;\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true);\n // Embed-mode short-circuit — the row was clicked while the panel is\n // hosted inside an embedding app, so absolutize against the\n // embedder-supplied content origin and honor its `openExternal`\n // override. Not the only path an embed host takes: a composed\n // RELATIVE href resolves to `navigate-same-tab` above and never\n // reaches `decideNewTab`, which is what lets an embedder keep its\n // own in-app routes in-app.\n if (runtime?.navigation.mode === 'embed') {\n const targetPlatform = (result.metadata?.targetPlatform as string | null | undefined) ?? null;\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open();\n return;\n }\n window.open(action.href, '_blank', NEW_TAB_FEATURES);\n return;\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false);\n window.dispatchEvent(new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }));\n return;\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false);\n onNavigate(action.path);\n return;\n case 'noop':\n return;\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime, resolvedComposeContentUrl],\n );\n\n // Reset keepOpen when query changes. Adjusted while rendering, not from an\n // effect: the dropdown's open state is read from this in the same render the\n // keystroke produced, so an effect held it pinned open for one extra frame.\n const [keepOpenForQuery, setKeepOpenForQuery] = useState(query);\n if (keepOpenForQuery !== query) {\n setKeepOpenForQuery(query);\n setKeepOpen(false);\n }\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-4P3BQN6Y.cjs","../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"names":["jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC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ACmD,UAAA;AACnD,UAAA;AACG,QAAA;AAMc,UAAA;AACsE,UAAA;AACvF,UAAA;AACG,QAAA;AAGc,UAAA;AACK,UAAA;AACtB,UAAA;AACG,QAAA;AACH,UAAA;AACJ,MAAA;AACF,IAAA;AACwF,IAAA;AAC1F,EAAA;AAK8D,EAAA;AAC9B,EAAA;AACL,IAAA;AACR,IAAA;AACnB,EAAA;AAEO,EAAA;AACL,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACkB,IAAA;AACpB,EAAA;AACF;ANsB8H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-4P3BQN6Y.cjs","sourcesContent":[null,"/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return '';\n const segments = fullPath.replace(/\\.md$/, '').split('/');\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments;\n return parentSegments.map(seg => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' ')).join(' / ');\n}\n","'use client';\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta';\nimport { formatRelativePath } from './format-relative-path';\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string;\n path?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry;\n isHighlighted: boolean;\n}\n\nexport function DocSearchResultRow({ result, isHighlighted }: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined;\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined;\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n });\n const isGroup = result.metadata?.isGroup as boolean | undefined;\n\n return (\n <div className=\"flex w-full min-w-0 items-center gap-3\">\n <span className=\"flex-shrink-0 text-ods-text-secondary\" title={iconLabel}>\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className={`truncate text-h6 ${isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'}`}>\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"mt-0.5 truncate text-ods-text-secondary text-h6\">{formatRelativePath(result.path)}</div>\n )}\n </div>\n </div>\n );\n}\n","'use client';\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react';\nimport { SearchInput, type SearchResult } from '../../ui/search-input';\nimport { DocSearchResultRow } from './doc-search-result-row';\n\nexport interface DocSearchBarProps {\n placeholder: string;\n query: string;\n onQueryChange: (value: string) => void;\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[];\n isLoading: boolean;\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n },\n ) => void;\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean;\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number;\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number;\n className?: string;\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode;\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => <DocSearchResultRow result={result} isHighlighted={isHighlighted} />)\n }\n />\n );\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport type { SearchResult } from '../../ui/search-input';\nimport type { DocSearchResult } from './types';\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n]);\n\nconst ENTITY_LABELS: Record<string, string> = {\n 'financial-cap-table': 'Cap Table',\n 'financial-kpis': 'Financial KPIs',\n 'financial-pnl': 'Profit & Loss',\n 'financial-balance-sheet': 'Balance Sheets',\n 'financial-cash-flow': 'Cash Flow',\n 'blog-posts': 'Blog Posts',\n 'product-releases': 'Product Releases',\n 'case-studies': 'Case Studies',\n webinars: 'Webinars',\n events: 'Events',\n podcasts: 'Podcasts',\n};\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>();\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<{ type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }> = [];\n const seenRepos = new Set<string>();\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || [];\n group.push(doc);\n entityGroups.set(doc.sourceRepo, group);\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo);\n order.push({ type: 'entity', repo: doc.sourceRepo });\n }\n } else {\n order.push({ type: 'doc', doc });\n }\n }\n\n const results: SearchResult[] = [];\n for (const entry of order) {\n if (entry.type === 'entity') {\n // An 'entity' entry is only pushed AFTER its group lands in the map, so\n // a miss is unreachable — but dropping one group beats throwing away the\n // whole search dropdown if that ever stops holding.\n const rows = entityGroups.get(entry.repo);\n if (!rows || rows.length === 0) continue;\n const label = ENTITY_LABELS[entry.repo] || entry.repo;\n results.push({\n id: `group-${entry.repo}`,\n title: `${label} (${rows.length} ${rows.length === 1 ? 'record' : 'records'})`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map(r => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n });\n } else {\n const doc = entry.doc;\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown';\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null ? { targetPlatform: doc.targetPlatform } : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n });\n }\n }\n\n return results;\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → resolve the href through the host's\n * `composeContentUrl` seam (when wired), then use `decideNewTab` to\n * choose same-tab vs new-tab against the resolved `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { ComposeContentUrl } from '../../../utils/content-href';\nimport type { ChatRef } from '../../chat/chat-ref.types';\nimport { decideNewTab } from '../../chat/utils/decide-new-tab';\nimport type { SearchResult } from '../../ui/search-input';\n\n/** True for `https://…` and protocol-relative `//…`. A composed href that is\n * NOT absolute is an in-app route the host claimed via `hostedTypes` /\n * `overrides`. */\nfunction isAbsoluteHref(href: string): boolean {\n return /^(?:[a-z][a-z0-9+.-]*:)?\\/\\//i.test(href);\n}\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' };\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n /** The host's unified content-href seam (`runtime.composeContentUrl`).\n * When wired, an entity row's RAG `externalUrl` is re-resolved through it,\n * so a type the host serves in-app (`hostedTypes`) or deep-links itself\n * (`overrides`) lands on the SAME href the catalog cards and chat cards\n * use. Omitted → the legacy verbatim-`externalUrl` behavior. */\n composeContentUrl?: ComposeContentUrl,\n): SearchResultAction {\n const meta = result.metadata ?? {};\n const externalUrl = meta.externalUrl as string | undefined;\n const rowId = meta.id as string | undefined;\n const sourceRepo = meta.sourceRepo as string | undefined;\n const documentType = meta.documentType as string | undefined;\n if (externalUrl) {\n const targetPlatform = meta.targetPlatform as string | null | undefined;\n // Unified content-href seam — the same call `resolveSourceRowCTA` makes\n // for chat rows. Hosted types relativize the slug out of `externalUrl`;\n // everything else comes back verbatim, so an unwired host (or a row with\n // no `documentType`) keeps today's behavior byte-for-byte.\n const composed =\n composeContentUrl && documentType\n ? composeContentUrl({\n type: documentType,\n identifier: rowId ?? '',\n externalUrl,\n targetPlatform: targetPlatform ?? null,\n })\n : null;\n const href = composed?.href || externalUrl;\n // A RELATIVE composed href means the host claimed this row as in-app.\n // Short-circuit BEFORE `decideNewTab`: in embed mode that helper forces\n // new-tab unconditionally, which would fire `window.open()` on a path\n // that only resolves inside this app.\n if (composed && !isAbsoluteHref(href)) {\n return { kind: 'navigate-same-tab', href };\n }\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const isNewTab = decideNewTab({\n href,\n targetPlatform: composed ? composed.targetPlatform : targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n });\n return isNewTab ? { kind: 'navigate-new-tab', href } : { kind: 'navigate-same-tab', href };\n }\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n };\n }\n if (result.path) {\n return { kind: 'route', path: result.path };\n }\n return { kind: 'noop' };\n}\n","'use client';\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n *\n * ## Result hrefs go through the content-href seam\n *\n * A row's href is NOT the RAG `externalUrl` verbatim any more: when the\n * host wires `runtime.composeContentUrl` (or passes `composeContentUrl`\n * here), the row is re-resolved through it — the SAME seam the catalog\n * cards and the chat entity cards use. So a host that serves onboarding\n * guides at `/help-center/onboarding-guides/<slug>` gets that path from\n * the dropdown too, instead of bouncing the user to the canonical hub\n * URL. Unwired hosts keep the verbatim-`externalUrl` behavior.\n */\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context';\nimport { useRouter } from '../../../embed-shims';\nimport { useDebounce } from '../../../hooks/ui/use-debounce';\nimport type { ComposeContentUrl } from '../../../utils/content-href';\nimport { contentFetch } from '../../../utils/embed-content-fetch';\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution';\nimport type { SearchResult } from '../../ui/search-input';\nimport { mapDocSearchResults } from './map-doc-search-results';\nimport { resolveSearchResultAction } from './resolve-search-result-action';\nimport type { DocSearchResult } from './types';\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string;\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string;\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void;\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[];\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean;\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string;\n /** Optional content-href seam override. Same fall-back chain as\n * `searchEndpoint`: prop → `runtime.composeContentUrl` → none. Wired,\n * it makes a result row honor the host's `hostedTypes` / `overrides`\n * instead of navigating to the RAG's canonical hub URL — so a row\n * lands where the catalog card for the same entity lands. */\n composeContentUrl?: ComposeContentUrl;\n}\n\n/** One shared empty array, so \"no matches\" keeps a stable identity. */\nconst NO_RESULTS: SearchResult[] = [];\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/** `Array.isArray` narrows `unknown` to `any[]`; this keeps the elements `unknown`. */\nfunction isUnknownArray(value: unknown): value is readonly unknown[] {\n return Array.isArray(value);\n}\n\nfunction readString(source: Record<string, unknown>, key: string): string | undefined {\n const value = source[key];\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * Decode `/api/docs/search`'s `{ success, data }` envelope.\n *\n * `Response.json()` is typed `any`, so the rows used to reach\n * `mapDocSearchResults` through an `as DocSearchResult[]` that asserted a\n * shape nothing had checked. `path` and `name` are the two that bite: the\n * mapper uses `path` as the row's React `id` and `name` as its title, so a row\n * missing either renders as a blank, key-colliding entry in the dropdown.\n * Such rows are dropped; the rest of the result set still lists.\n *\n * Returns null when the envelope itself is not a successful result set.\n */\nfunction toDocSearchResults(payload: unknown): DocSearchResult[] | null {\n if (!isRecord(payload) || !payload.success || !isUnknownArray(payload.data)) return null;\n\n const rows: DocSearchResult[] = [];\n for (const entry of payload.data) {\n if (!isRecord(entry)) continue;\n const path = readString(entry, 'path');\n const name = readString(entry, 'name');\n const type = entry.type;\n if (path === undefined || name === undefined) continue;\n\n const targetPlatform = entry.targetPlatform;\n rows.push({\n path,\n name,\n type: type === 'folder' ? 'folder' : 'file',\n snippet: readString(entry, 'snippet') ?? '',\n matchType: entry.matchType === 'title' ? 'title' : 'content',\n documentType: readString(entry, 'documentType'),\n externalUrl: readString(entry, 'externalUrl'),\n targetPlatform: typeof targetPlatform === 'string' ? targetPlatform : null,\n sourceRepo: readString(entry, 'sourceRepo'),\n entityId: readString(entry, 'entityId'),\n });\n }\n return rows;\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const { source, baseRoute, onNavigate, tableIds, onInPageSwap, searchEndpoint, composeContentUrl } = config;\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : '';\n\n const router = useRouter();\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n // Also used as the proxy-prefix fallback for `searchEndpoint`, matching\n // how tickets resolves `findTicketUrl`.\n const runtime = useChatRuntime();\n const resolvedSearchEndpoint = searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? '/api/docs/search';\n // Content-href seam, same prop → runtime → none chain. Threading it into\n // `resolveSearchResultAction` is what makes the dropdown obey the host's\n // route map; without it the row navigates to the RAG's canonical hub URL\n // even when the host serves that content in-app under a different path.\n const resolvedComposeContentUrl = composeContentUrl ?? runtime?.composeContentUrl;\n\n const [query, setQuery] = useState('');\n const [results, setResults] = useState<SearchResult[]>(NO_RESULTS);\n const [isFetching, setIsFetching] = useState(false);\n const debouncedQuery = useDebounce(query, 300);\n\n // Falling below the two-character floor empties the dropdown. Adjusted while\n // rendering (React's documented pattern for a reset the render already has\n // the answer to) rather than from an effect, which committed one more frame\n // of the previous matches under a query that no longer searches for them.\n const searchable = debouncedQuery.trim().length >= 2;\n const [wasSearchable, setWasSearchable] = useState(searchable);\n if (wasSearchable !== searchable) {\n setWasSearchable(searchable);\n if (!searchable) {\n setResults(NO_RESULTS);\n setIsFetching(false);\n }\n }\n\n useEffect(() => {\n if (!searchable) return undefined;\n\n let cancelled = false;\n\n async function fetchResults() {\n setIsFetching(true);\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n });\n if (tableIdsKey) params.set('tableIds', tableIdsKey);\n\n const response = await contentFetch(`${resolvedSearchEndpoint}?${params.toString()}`);\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`);\n }\n\n const json: unknown = await response.json();\n\n if (!cancelled) {\n // An envelope that is not a successful result set now clears the\n // dropdown instead of leaving it untouched. Previously a 200 that\n // carried `success: false` (or a non-array `data`) fell through\n // every branch, so the PREVIOUS query's matches stayed on screen\n // under the new query — the throw path already reset them.\n const rows = toDocSearchResults(json);\n setResults(rows ? mapDocSearchResults(rows) : NO_RESULTS);\n }\n } catch (error) {\n console.error('Doc search error:', error);\n if (!cancelled) {\n setResults(NO_RESULTS);\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false);\n }\n }\n }\n\n // Never rejects — try/catch/finally, every write gated on `cancelled`.\n void fetchResults();\n\n return () => {\n cancelled = true;\n };\n }, [debouncedQuery, searchable, source, tableIdsKey, resolvedSearchEndpoint]);\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading = query.trim().length >= 2 && (query !== debouncedQuery || isFetching);\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false);\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n },\n ) => {\n const action = resolveSearchResultAction(result, source, runtime?.navigation.mode, resolvedComposeContentUrl);\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0));\n switch (action.kind) {\n case 'navigate-same-tab': {\n if (wantsNewTab) {\n setKeepOpen(true);\n window.open(action.href, '_blank', NEW_TAB_FEATURES);\n return;\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false);\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`) ? action.href.slice(baseRoute.length + 1) : null;\n if (path && onInPageSwap?.(path)) return;\n router.push(stripSameOriginToPath(action.href));\n return;\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true);\n // Embed-mode short-circuit — the row was clicked while the panel is\n // hosted inside an embedding app, so absolutize against the\n // embedder-supplied content origin and honor its `openExternal`\n // override. Not the only path an embed host takes: a composed\n // RELATIVE href resolves to `navigate-same-tab` above and never\n // reaches `decideNewTab`, which is what lets an embedder keep its\n // own in-app routes in-app.\n if (runtime?.navigation.mode === 'embed') {\n const targetPlatform = (result.metadata?.targetPlatform as string | null | undefined) ?? null;\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open();\n return;\n }\n window.open(action.href, '_blank', NEW_TAB_FEATURES);\n return;\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false);\n window.dispatchEvent(new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }));\n return;\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false);\n onNavigate(action.path);\n return;\n case 'noop':\n return;\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime, resolvedComposeContentUrl],\n );\n\n // Reset keepOpen when query changes. Adjusted while rendering, not from an\n // effect: the dropdown's open state is read from this in the same render the\n // keystroke produced, so an effect held it pinned open for one extra frame.\n const [keepOpenForQuery, setKeepOpenForQuery] = useState(query);\n if (keepOpenForQuery !== query) {\n setKeepOpenForQuery(query);\n setKeepOpen(false);\n }\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n };\n}\n"]}
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
DeliveryRow,
|
|
7
7
|
ListEmptyState
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-V7TVOJBR.js";
|
|
9
9
|
import {
|
|
10
10
|
EmptyState
|
|
11
11
|
} from "./chunk-X3LC6R37.js";
|
|
12
12
|
import {
|
|
13
13
|
DetailPageSkeleton
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KLLYTCID.js";
|
|
15
15
|
import {
|
|
16
16
|
useSelfFetch
|
|
17
17
|
} from "./chunk-F2KBCLUG.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
RichMarkdownRenderer,
|
|
31
31
|
devSectionAnchorId,
|
|
32
32
|
resolveContentHref
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-P5MIIQHG.js";
|
|
34
34
|
import {
|
|
35
35
|
useHumanitySignals,
|
|
36
36
|
useScrollToHash
|
|
@@ -1373,4 +1373,4 @@ export {
|
|
|
1373
1373
|
useLegalDocs,
|
|
1374
1374
|
LegalDocumentPage
|
|
1375
1375
|
};
|
|
1376
|
-
//# sourceMappingURL=chunk-
|
|
1376
|
+
//# sourceMappingURL=chunk-4RUOZMHB.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkCQGMYZXYcjs = require('./chunk-CQGMYZXY.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkW3FQLTHCcjs = require('./chunk-W3FQLTHC.cjs');
|
|
@@ -160,7 +160,7 @@ function TicketLiveProvider({ children, enabled = true }) {
|
|
|
160
160
|
_react2.default.useEffect(() => {
|
|
161
161
|
if (!streamEnabled) return void 0;
|
|
162
162
|
if (typeof window === "undefined") return void 0;
|
|
163
|
-
subscriptionRef.current =
|
|
163
|
+
subscriptionRef.current = _chunkCQGMYZXYcjs.createSseSubscription.call(void 0, {
|
|
164
164
|
url: streamUrl,
|
|
165
165
|
onEvent: (name, data) => handlersRef.current.onEvent(name, data),
|
|
166
166
|
onStatusChange: (status) => handlersRef.current.onStatus(status),
|
|
@@ -275,4 +275,4 @@ var TOAST_COPY = {
|
|
|
275
275
|
|
|
276
276
|
|
|
277
277
|
exports.useOptionalTicketLive = useOptionalTicketLive; exports.useTicketLive = useTicketLive; exports.TicketLiveProvider = TicketLiveProvider; exports.isOptimistic = isOptimistic; exports.TICKET_TEXT_MAX_CHARS = TICKET_TEXT_MAX_CHARS; exports.TICKET_MARK_READ_DEBOUNCE_MS = TICKET_MARK_READ_DEBOUNCE_MS; exports.TOAST_COPY = TOAST_COPY;
|
|
278
|
-
//# sourceMappingURL=chunk-
|
|
278
|
+
//# sourceMappingURL=chunk-AJ24EK2S.cjs.map
|