@surf-kit/agent 0.2.2 → 0.3.0
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/chat/index.cjs +625 -204
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +11 -6
- package/dist/chat/index.d.ts +11 -6
- package/dist/chat/index.js +606 -185
- package/dist/chat/index.js.map +1 -1
- package/dist/{chat--OifhIRe.d.ts → chat-BIIDOGrD.d.ts} +10 -1
- package/dist/{chat-ChYl2XjV.d.cts → chat-CGamM7Mz.d.cts} +10 -1
- package/dist/{hooks-DLfF18IU.d.cts → hooks-B1NYoLLs.d.cts} +21 -5
- package/dist/{hooks-BGs8-4GK.d.ts → hooks-CTeEqnBQ.d.ts} +21 -5
- package/dist/hooks.cjs +126 -81
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +3 -3
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +126 -81
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +686 -265
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +645 -224
- package/dist/index.js.map +1 -1
- package/dist/layouts/index.cjs +646 -225
- package/dist/layouts/index.cjs.map +1 -1
- package/dist/layouts/index.d.cts +1 -1
- package/dist/layouts/index.d.ts +1 -1
- package/dist/layouts/index.js +622 -201
- package/dist/layouts/index.js.map +1 -1
- package/dist/mcp/index.cjs +1 -1
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +2 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/response/index.cjs +66 -12
- package/dist/response/index.cjs.map +1 -1
- package/dist/response/index.d.cts +2 -2
- package/dist/response/index.d.ts +2 -2
- package/dist/response/index.js +64 -10
- package/dist/response/index.js.map +1 -1
- package/dist/sources/index.cjs +30 -1
- package/dist/sources/index.cjs.map +1 -1
- package/dist/sources/index.js +30 -1
- package/dist/sources/index.js.map +1 -1
- package/dist/streaming/index.cjs +202 -93
- package/dist/streaming/index.cjs.map +1 -1
- package/dist/streaming/index.d.cts +4 -3
- package/dist/streaming/index.d.ts +4 -3
- package/dist/streaming/index.js +172 -73
- package/dist/streaming/index.js.map +1 -1
- package/dist/{streaming-DbQxScpi.d.ts → streaming-Bx-ff2tt.d.ts} +1 -1
- package/dist/{streaming-DfT22A0z.d.cts → streaming-x7umFHoP.d.cts} +1 -1
- package/package.json +15 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/sources/index.ts","../../src/sources/SourceCard/SourceCard.tsx","../../src/sources/SourceList/SourceList.tsx","../../src/sources/SourceInline/SourceInline.tsx","../../src/sources/SourceDrawer/SourceDrawer.tsx","../../src/sources/SourceBadge/SourceBadge.tsx"],"sourcesContent":["export { SourceCard } from './SourceCard'\nexport type { SourceCardProps } from './SourceCard'\n\nexport { SourceList } from './SourceList'\nexport type { SourceListProps } from './SourceList'\n\nexport { SourceInline } from './SourceInline'\nexport type { SourceInlineProps } from './SourceInline'\n\nexport { SourceDrawer } from './SourceDrawer'\nexport type { SourceDrawerProps } from './SourceDrawer'\n\nexport { SourceBadge } from './SourceBadge'\nexport type { SourceBadgeProps } from './SourceBadge'\n","import React from 'react'\nimport { Badge } from '@surf-kit/core'\nimport { twMerge } from 'tailwind-merge'\nimport type { Source } from '../../types/agent'\n\ntype SourceCardProps = {\n source: Source\n variant?: 'compact' | 'expanded'\n onNavigate?: (source: Source) => void\n className?: string\n}\n\nfunction getConfidenceIntent(confidence: number) {\n if (confidence >= 0.8) return 'success' as const\n if (confidence >= 0.5) return 'warning' as const\n return 'error' as const\n}\n\nfunction getConfidenceLabel(confidence: number) {\n if (confidence >= 0.8) return 'High'\n if (confidence >= 0.5) return 'Medium'\n return 'Low'\n}\n\nfunction SourceCard({ source, variant = 'compact', onNavigate, className }: SourceCardProps) {\n const handleClick = () => {\n if (onNavigate) {\n onNavigate(source)\n }\n }\n\n const isCompact = variant === 'compact'\n\n return (\n <div\n className={twMerge(\n 'rounded-xl border transition-all duration-200',\n 'bg-surface border-border',\n onNavigate && 'cursor-pointer hover:border-border-strong',\n className,\n )}\n data-document-id={source.document_id}\n data-testid=\"source-card\"\n >\n <div\n className={isCompact ? 'px-4 py-3' : 'px-6 py-4'}\n onClick={handleClick}\n role={onNavigate ? 'button' : undefined}\n tabIndex={onNavigate ? 0 : undefined}\n onKeyDown={\n onNavigate\n ? (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleClick()\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">\n {source.title}\n </p>\n {source.section && (\n <p className=\"text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate mt-0.5\">\n {source.section}\n </p>\n )}\n </div>\n <Badge\n intent={getConfidenceIntent(source.confidence)}\n size=\"sm\"\n >\n {getConfidenceLabel(source.confidence)}\n </Badge>\n </div>\n {!isCompact && (\n <p className=\"text-xs text-text-secondary mt-2 line-clamp-3 leading-relaxed\">\n {source.snippet}\n </p>\n )}\n </div>\n </div>\n )\n}\n\nexport { SourceCard }\nexport type { SourceCardProps }\n","'use client'\n\nimport React, { useState } from 'react'\nimport type { Source } from '../../types/agent'\nimport { SourceCard } from '../SourceCard'\n\ntype SourceListProps = {\n sources: Source[]\n variant?: 'compact' | 'expanded'\n collapsible?: boolean\n defaultExpanded?: boolean\n onNavigate?: (source: Source) => void\n className?: string\n}\n\nfunction SourceList({\n sources,\n variant = 'compact',\n collapsible = false,\n defaultExpanded = true,\n onNavigate,\n className,\n}: SourceListProps) {\n const [isExpanded, setIsExpanded] = useState(defaultExpanded)\n\n if (sources.length === 0) return null\n\n const content = (\n <div className=\"flex flex-col gap-1.5\" data-testid=\"source-list-items\">\n {sources.map((source) => (\n <SourceCard\n key={source.document_id}\n source={source}\n variant={variant}\n onNavigate={onNavigate}\n />\n ))}\n </div>\n )\n\n if (!collapsible) {\n return (\n <div className={className} data-testid=\"source-list\">\n {content}\n </div>\n )\n }\n\n return (\n <div className={className} data-testid=\"source-list\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded(prev => !prev)}\n aria-expanded={isExpanded}\n className=\"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary hover:text-accent mb-2 transition-colors duration-200\"\n >\n <svg\n className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n Sources ({sources.length})\n </button>\n {isExpanded && content}\n </div>\n )\n}\n\nexport { SourceList }\nexport type { SourceListProps }\n","import React from 'react'\nimport { Tooltip } from '@surf-kit/core'\n\nimport type { Source } from '../../types/agent'\n\ntype SourceInlineProps = {\n source: Source\n index: number\n className?: string\n}\n\nfunction SourceInline({ source, index, className }: SourceInlineProps) {\n const tooltipContent = `${source.title}${source.section ? ` - ${source.section}` : ''}: ${source.snippet.slice(0, 120)}${source.snippet.length > 120 ? '...' : ''}`\n\n return (\n <Tooltip content={tooltipContent} placement=\"top\">\n <span\n className={`inline-flex items-center justify-center text-xs text-accent font-medium cursor-help ${className ?? ''}`}\n data-testid=\"source-inline\"\n data-document-id={source.document_id}\n aria-label={`Source ${index}: ${source.title}`}\n >\n [{index}]\n </span>\n </Tooltip>\n )\n}\n\nexport { SourceInline }\nexport type { SourceInlineProps }\n","import React from 'react'\nimport { Sheet, Badge } from '@surf-kit/core'\nimport type { Source } from '../../types/agent'\n\ntype SourceDrawerProps = {\n source: Source | null\n isOpen: boolean\n onClose: () => void\n className?: string\n}\n\nfunction getConfidenceIntent(confidence: number) {\n if (confidence >= 0.8) return 'success' as const\n if (confidence >= 0.5) return 'warning' as const\n return 'error' as const\n}\n\nfunction SourceDrawer({ source, isOpen, onClose, className }: SourceDrawerProps) {\n if (!source) return null\n\n return (\n <Sheet\n isOpen={isOpen}\n onClose={onClose}\n title={source.title}\n size=\"md\"\n className={className}\n >\n <div data-testid=\"source-drawer\" data-document-id={source.document_id}>\n {source.section && (\n <p className=\"text-sm text-text-secondary mb-4\">{source.section}</p>\n )}\n\n <div className=\"flex items-center gap-2 mb-4\">\n <span className=\"text-sm text-text-secondary\">Confidence:</span>\n <Badge intent={getConfidenceIntent(source.confidence)} size=\"sm\">\n {Math.round(source.confidence * 100)}%\n </Badge>\n </div>\n\n <div className=\"mb-4\">\n <h3 className=\"text-sm font-medium text-text-primary mb-2\">Snippet</h3>\n <p className=\"text-sm text-text-secondary bg-surface-raised p-4 rounded-lg\">\n {source.snippet}\n </p>\n </div>\n\n {source.url && (\n <div>\n <h3 className=\"text-sm font-medium text-text-primary mb-2\">Source URL</h3>\n <a\n href={source.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm text-accent hover:underline break-all\"\n >\n {source.url}\n </a>\n </div>\n )}\n </div>\n </Sheet>\n )\n}\n\nexport { SourceDrawer }\nexport type { SourceDrawerProps }\n","import React from 'react'\nimport { Badge } from '@surf-kit/core'\n\ntype SourceBadgeProps = {\n count: number\n className?: string\n}\n\nfunction SourceBadge({ count, className }: SourceBadgeProps) {\n if (count === 0) return null\n\n return (\n <Badge intent=\"info\" size=\"sm\" className={className} data-testid=\"source-badge\">\n {count} {count === 1 ? 'source' : 'sources'}\n </Badge>\n )\n}\n\nexport { SourceBadge }\nexport type { SourceBadgeProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,kBAAsB;AACtB,4BAAwB;AA2Dd;AAjDV,SAAS,oBAAoB,YAAoB;AAC/C,MAAI,cAAc,IAAK,QAAO;AAC9B,MAAI,cAAc,IAAK,QAAO;AAC9B,SAAO;AACT;AAEA,SAAS,mBA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ACb,QAAO;AAAA,cACP,KAAI;AAAA,cACJ,WAAU;AAAA,cAET,iBAAO;AAAA;AAAA,UACV;AAAA,WACF;AAAA,SAEJ;AAAA;AAAA,EACF;AAEJ;;;AC9DA,IAAAC,eAAsB;AAWlB,IAAAC,sBAAA;AAJJ,SAAS,YAAY,EAAE,OAAO,UAAU,GAAqB;AAC3D,MAAI,UAAU,EAAG,QAAO;AAExB,SACE,8CAAC,sBAAM,QAAO,QAAO,MAAK,MAAK,WAAsB,eAAY,gBAC9D;AAAA;AAAA,IAAM;AAAA,IAAE,UAAU,IAAI,WAAW;AAAA,KACpC;AAEJ;","names":["import_jsx_runtime","import_core","import_jsx_runtime","import_core","import_jsx_runtime","getConfidenceIntent","import_core","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/sources/index.ts","../../src/sources/SourceCard/SourceCard.tsx","../../src/sources/SourceList/SourceList.tsx","../../src/sources/SourceInline/SourceInline.tsx","../../src/sources/SourceDrawer/SourceDrawer.tsx","../../src/sources/SourceBadge/SourceBadge.tsx"],"sourcesContent":["export { SourceCard } from './SourceCard'\nexport type { SourceCardProps } from './SourceCard'\n\nexport { SourceList } from './SourceList'\nexport type { SourceListProps } from './SourceList'\n\nexport { SourceInline } from './SourceInline'\nexport type { SourceInlineProps } from './SourceInline'\n\nexport { SourceDrawer } from './SourceDrawer'\nexport type { SourceDrawerProps } from './SourceDrawer'\n\nexport { SourceBadge } from './SourceBadge'\nexport type { SourceBadgeProps } from './SourceBadge'\n","import React from 'react'\nimport { Badge } from '@surf-kit/core'\nimport { twMerge } from 'tailwind-merge'\nimport type { Source } from '../../types/agent'\n\ntype SourceCardProps = {\n source: Source\n variant?: 'compact' | 'expanded'\n onNavigate?: (source: Source) => void\n className?: string\n}\n\nfunction getConfidenceIntent(confidence: number) {\n if (confidence >= 0.8) return 'success' as const\n if (confidence >= 0.5) return 'warning' as const\n return 'error' as const\n}\n\nfunction getConfidenceLabel(confidence: number) {\n if (confidence >= 0.8) return 'High'\n if (confidence >= 0.5) return 'Medium'\n return 'Low'\n}\n\nfunction SourceCard({ source, variant = 'compact', onNavigate, className }: SourceCardProps) {\n const handleClick = () => {\n if (onNavigate) {\n onNavigate(source)\n }\n }\n\n const isCompact = variant === 'compact'\n\n return (\n <div\n className={twMerge(\n 'rounded-xl border transition-all duration-200',\n 'bg-surface border-border',\n onNavigate && 'cursor-pointer hover:border-border-strong',\n className,\n )}\n data-document-id={source.document_id}\n data-testid=\"source-card\"\n >\n <div\n className={isCompact ? 'px-4 py-3' : 'px-6 py-4'}\n onClick={handleClick}\n role={onNavigate ? 'button' : undefined}\n tabIndex={onNavigate ? 0 : undefined}\n onKeyDown={\n onNavigate\n ? (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleClick()\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex-1 min-w-0\">\n {source.url ? (\n <a\n href={source.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm font-medium text-accent hover:underline truncate block\"\n onClick={(e) => e.stopPropagation()}\n >\n {source.title}\n <svg\n className=\"inline-block ml-1 w-3 h-3 opacity-60\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6\" />\n <polyline points=\"15 3 21 3 21 9\" />\n <line x1=\"10\" y1=\"14\" x2=\"21\" y2=\"3\" />\n </svg>\n </a>\n ) : (\n <p className=\"text-sm font-medium text-text-primary truncate\">\n {source.title}\n </p>\n )}\n {source.section && (\n <p className=\"text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate mt-0.5\">\n {source.section}\n </p>\n )}\n </div>\n <Badge\n intent={getConfidenceIntent(source.confidence)}\n size=\"sm\"\n >\n {getConfidenceLabel(source.confidence)}\n </Badge>\n </div>\n {!isCompact && (\n <p className=\"text-xs text-text-secondary mt-2 line-clamp-3 leading-relaxed\">\n {source.snippet}\n </p>\n )}\n </div>\n </div>\n )\n}\n\nexport { SourceCard }\nexport type { SourceCardProps }\n","'use client'\n\nimport React, { useState } from 'react'\nimport type { Source } from '../../types/agent'\nimport { SourceCard } from '../SourceCard'\n\ntype SourceListProps = {\n sources: Source[]\n variant?: 'compact' | 'expanded'\n collapsible?: boolean\n defaultExpanded?: boolean\n onNavigate?: (source: Source) => void\n className?: string\n}\n\nfunction SourceList({\n sources,\n variant = 'compact',\n collapsible = false,\n defaultExpanded = true,\n onNavigate,\n className,\n}: SourceListProps) {\n const [isExpanded, setIsExpanded] = useState(defaultExpanded)\n\n if (sources.length === 0) return null\n\n const content = (\n <div className=\"flex flex-col gap-1.5\" data-testid=\"source-list-items\">\n {sources.map((source) => (\n <SourceCard\n key={source.document_id}\n source={source}\n variant={variant}\n onNavigate={onNavigate}\n />\n ))}\n </div>\n )\n\n if (!collapsible) {\n return (\n <div className={className} data-testid=\"source-list\">\n {content}\n </div>\n )\n }\n\n return (\n <div className={className} data-testid=\"source-list\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded(prev => !prev)}\n aria-expanded={isExpanded}\n className=\"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary hover:text-accent mb-2 transition-colors duration-200\"\n >\n <svg\n className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n Sources ({sources.length})\n </button>\n {isExpanded && content}\n </div>\n )\n}\n\nexport { SourceList }\nexport type { SourceListProps }\n","import React from 'react'\nimport { Tooltip } from '@surf-kit/core'\n\nimport type { Source } from '../../types/agent'\n\ntype SourceInlineProps = {\n source: Source\n index: number\n className?: string\n}\n\nfunction SourceInline({ source, index, className }: SourceInlineProps) {\n const tooltipContent = `${source.title}${source.section ? ` - ${source.section}` : ''}: ${source.snippet.slice(0, 120)}${source.snippet.length > 120 ? '...' : ''}`\n\n return (\n <Tooltip content={tooltipContent} placement=\"top\">\n <span\n className={`inline-flex items-center justify-center text-xs text-accent font-medium cursor-help ${className ?? ''}`}\n data-testid=\"source-inline\"\n data-document-id={source.document_id}\n aria-label={`Source ${index}: ${source.title}`}\n >\n [{index}]\n </span>\n </Tooltip>\n )\n}\n\nexport { SourceInline }\nexport type { SourceInlineProps }\n","import React from 'react'\nimport { Sheet, Badge } from '@surf-kit/core'\nimport type { Source } from '../../types/agent'\n\ntype SourceDrawerProps = {\n source: Source | null\n isOpen: boolean\n onClose: () => void\n className?: string\n}\n\nfunction getConfidenceIntent(confidence: number) {\n if (confidence >= 0.8) return 'success' as const\n if (confidence >= 0.5) return 'warning' as const\n return 'error' as const\n}\n\nfunction SourceDrawer({ source, isOpen, onClose, className }: SourceDrawerProps) {\n if (!source) return null\n\n return (\n <Sheet\n isOpen={isOpen}\n onClose={onClose}\n title={source.title}\n size=\"md\"\n className={className}\n >\n <div data-testid=\"source-drawer\" data-document-id={source.document_id}>\n {source.section && (\n <p className=\"text-sm text-text-secondary mb-4\">{source.section}</p>\n )}\n\n <div className=\"flex items-center gap-2 mb-4\">\n <span className=\"text-sm text-text-secondary\">Confidence:</span>\n <Badge intent={getConfidenceIntent(source.confidence)} size=\"sm\">\n {Math.round(source.confidence * 100)}%\n </Badge>\n </div>\n\n <div className=\"mb-4\">\n <h3 className=\"text-sm font-medium text-text-primary mb-2\">Snippet</h3>\n <p className=\"text-sm text-text-secondary bg-surface-raised p-4 rounded-lg\">\n {source.snippet}\n </p>\n </div>\n\n {source.url && (\n <div>\n <h3 className=\"text-sm font-medium text-text-primary mb-2\">Source URL</h3>\n <a\n href={source.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm text-accent hover:underline break-all\"\n >\n {source.url}\n </a>\n </div>\n )}\n </div>\n </Sheet>\n )\n}\n\nexport { SourceDrawer }\nexport type { SourceDrawerProps }\n","import React from 'react'\nimport { Badge } from '@surf-kit/core'\n\ntype SourceBadgeProps = {\n count: number\n className?: string\n}\n\nfunction SourceBadge({ count, className }: SourceBadgeProps) {\n if (count === 0) return null\n\n return (\n <Badge intent=\"info\" size=\"sm\" className={className} data-testid=\"source-badge\">\n {count} {count === 1 ? 'source' : 'sources'}\n </Badge>\n )\n}\n\nexport { SourceBadge }\nexport type { SourceBadgeProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,kBAAsB;AACtB,4BAAwB;AAqER;AA3DhB,SAAS,oBAAoB,YAAoB;AAC/C,MAAI,cAAc,IAAK,QAAO;AAC9B,MAAI,cAAc,IAAK,QAAO;AAC9B,SAAO;AACT;AAEA,SAAS,mBAAmB,YAAoB;AAC9C,MAAI,cAAc,IAAK,QAAO;AAC9B,MAAI,cAAc,IAAK,QAAO;AAC9B,SAAO;AACT;AAEA,SAAS,WAAW,EAAE,QAAQ,UAAU,WAAW,YAAY,UAAU,GAAoB;AAC3F,QAAM,cAAc,MAAM;AACxB,QAAI,YAAY;AACd,iBAAW,MAAM;AAAA,IACnB;AAAA,EACF;AAEA,QAAM,YAAY,YAAY;AAE9B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,cAAc;AAAA,QACd;AAAA,MACF;AAAA,MACA,oBAAkB,OAAO;AAAA,MACzB,eAAY;AAAA,MAEZ;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,YAAY,cAAc;AAAA,UACrC,SAAS;AAAA,UACT,MAAM,aAAa,WAAW;AAAA,UAC9B,UAAU,aAAa,IAAI;AAAA,UAC3B,WACE,aACI,CAAC,MAA2B;AAC1B,gBAAI,EAAE,QAAQ,WAAW,EAAE,Q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AA;AAAA,UACV;AAAA,WACF;AAAA,SAEJ;AAAA;AAAA,EACF;AAEJ;;;AC9DA,IAAAC,eAAsB;AAWlB,IAAAC,sBAAA;AAJJ,SAAS,YAAY,EAAE,OAAO,UAAU,GAAqB;AAC3D,MAAI,UAAU,EAAG,QAAO;AAExB,SACE,8CAAC,sBAAM,QAAO,QAAO,MAAK,MAAK,WAAsB,eAAY,gBAC9D;AAAA;AAAA,IAAM;AAAA,IAAE,UAAU,IAAI,WAAW;AAAA,KACpC;AAEJ;","names":["import_jsx_runtime","import_core","import_jsx_runtime","import_core","import_jsx_runtime","getConfidenceIntent","import_core","import_jsx_runtime"]}
|
package/dist/sources/index.js
CHANGED
|
@@ -48,7 +48,36 @@ function SourceCard({ source, variant = "compact", onNavigate, className }) {
|
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
50
50
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
source.url ? /* @__PURE__ */ jsxs(
|
|
52
|
+
"a",
|
|
53
|
+
{
|
|
54
|
+
href: source.url,
|
|
55
|
+
target: "_blank",
|
|
56
|
+
rel: "noopener noreferrer",
|
|
57
|
+
className: "text-sm font-medium text-accent hover:underline truncate block",
|
|
58
|
+
onClick: (e) => e.stopPropagation(),
|
|
59
|
+
children: [
|
|
60
|
+
source.title,
|
|
61
|
+
/* @__PURE__ */ jsxs(
|
|
62
|
+
"svg",
|
|
63
|
+
{
|
|
64
|
+
className: "inline-block ml-1 w-3 h-3 opacity-60",
|
|
65
|
+
viewBox: "0 0 24 24",
|
|
66
|
+
fill: "none",
|
|
67
|
+
stroke: "currentColor",
|
|
68
|
+
strokeWidth: "2",
|
|
69
|
+
strokeLinecap: "round",
|
|
70
|
+
strokeLinejoin: "round",
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }),
|
|
73
|
+
/* @__PURE__ */ jsx("polyline", { points: "15 3 21 3 21 9" }),
|
|
74
|
+
/* @__PURE__ */ jsx("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) : /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-text-primary truncate", children: source.title }),
|
|
52
81
|
source.section && /* @__PURE__ */ jsx("p", { className: "text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate mt-0.5", children: source.section })
|
|
53
82
|
] }),
|
|
54
83
|
/* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/sources/SourceCard/SourceCard.tsx","../../src/sources/SourceList/SourceList.tsx","../../src/sources/SourceInline/SourceInline.tsx","../../src/sources/SourceDrawer/SourceDrawer.tsx","../../src/sources/SourceBadge/SourceBadge.tsx"],"sourcesContent":["import React from 'react'\nimport { Badge } from '@surf-kit/core'\nimport { twMerge } from 'tailwind-merge'\nimport type { Source } from '../../types/agent'\n\ntype SourceCardProps = {\n source: Source\n variant?: 'compact' | 'expanded'\n onNavigate?: (source: Source) => void\n className?: string\n}\n\nfunction getConfidenceIntent(confidence: number) {\n if (confidence >= 0.8) return 'success' as const\n if (confidence >= 0.5) return 'warning' as const\n return 'error' as const\n}\n\nfunction getConfidenceLabel(confidence: number) {\n if (confidence >= 0.8) return 'High'\n if (confidence >= 0.5) return 'Medium'\n return 'Low'\n}\n\nfunction SourceCard({ source, variant = 'compact', onNavigate, className }: SourceCardProps) {\n const handleClick = () => {\n if (onNavigate) {\n onNavigate(source)\n }\n }\n\n const isCompact = variant === 'compact'\n\n return (\n <div\n className={twMerge(\n 'rounded-xl border transition-all duration-200',\n 'bg-surface border-border',\n onNavigate && 'cursor-pointer hover:border-border-strong',\n className,\n )}\n data-document-id={source.document_id}\n data-testid=\"source-card\"\n >\n <div\n className={isCompact ? 'px-4 py-3' : 'px-6 py-4'}\n onClick={handleClick}\n role={onNavigate ? 'button' : undefined}\n tabIndex={onNavigate ? 0 : undefined}\n onKeyDown={\n onNavigate\n ? (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleClick()\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">\n {source.title}\n </p>\n {source.section && (\n <p className=\"text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate mt-0.5\">\n {source.section}\n </p>\n )}\n </div>\n <Badge\n intent={getConfidenceIntent(source.confidence)}\n size=\"sm\"\n >\n {getConfidenceLabel(source.confidence)}\n </Badge>\n </div>\n {!isCompact && (\n <p className=\"text-xs text-text-secondary mt-2 line-clamp-3 leading-relaxed\">\n {source.snippet}\n </p>\n )}\n </div>\n </div>\n )\n}\n\nexport { SourceCard }\nexport type { SourceCardProps }\n","'use client'\n\nimport React, { useState } from 'react'\nimport type { Source } from '../../types/agent'\nimport { SourceCard } from '../SourceCard'\n\ntype SourceListProps = {\n sources: Source[]\n variant?: 'compact' | 'expanded'\n collapsible?: boolean\n defaultExpanded?: boolean\n onNavigate?: (source: Source) => void\n className?: string\n}\n\nfunction SourceList({\n sources,\n variant = 'compact',\n collapsible = false,\n defaultExpanded = true,\n onNavigate,\n className,\n}: SourceListProps) {\n const [isExpanded, setIsExpanded] = useState(defaultExpanded)\n\n if (sources.length === 0) return null\n\n const content = (\n <div className=\"flex flex-col gap-1.5\" data-testid=\"source-list-items\">\n {sources.map((source) => (\n <SourceCard\n key={source.document_id}\n source={source}\n variant={variant}\n onNavigate={onNavigate}\n />\n ))}\n </div>\n )\n\n if (!collapsible) {\n return (\n <div className={className} data-testid=\"source-list\">\n {content}\n </div>\n )\n }\n\n return (\n <div className={className} data-testid=\"source-list\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded(prev => !prev)}\n aria-expanded={isExpanded}\n className=\"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary hover:text-accent mb-2 transition-colors duration-200\"\n >\n <svg\n className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n Sources ({sources.length})\n </button>\n {isExpanded && content}\n </div>\n )\n}\n\nexport { SourceList }\nexport type { SourceListProps }\n","import React from 'react'\nimport { Tooltip } from '@surf-kit/core'\n\nimport type { Source } from '../../types/agent'\n\ntype SourceInlineProps = {\n source: Source\n index: number\n className?: string\n}\n\nfunction SourceInline({ source, index, className }: SourceInlineProps) {\n const tooltipContent = `${source.title}${source.section ? ` - ${source.section}` : ''}: ${source.snippet.slice(0, 120)}${source.snippet.length > 120 ? '...' : ''}`\n\n return (\n <Tooltip content={tooltipContent} placement=\"top\">\n <span\n className={`inline-flex items-center justify-center text-xs text-accent font-medium cursor-help ${className ?? ''}`}\n data-testid=\"source-inline\"\n data-document-id={source.document_id}\n aria-label={`Source ${index}: ${source.title}`}\n >\n [{index}]\n </span>\n </Tooltip>\n )\n}\n\nexport { SourceInline }\nexport type { SourceInlineProps }\n","import React from 'react'\nimport { Sheet, Badge } from '@surf-kit/core'\nimport type { Source } from '../../types/agent'\n\ntype SourceDrawerProps = {\n source: Source | null\n isOpen: boolean\n onClose: () => void\n className?: string\n}\n\nfunction getConfidenceIntent(confidence: number) {\n if (confidence >= 0.8) return 'success' as const\n if (confidence >= 0.5) return 'warning' as const\n return 'error' as const\n}\n\nfunction SourceDrawer({ source, isOpen, onClose, className }: SourceDrawerProps) {\n if (!source) return null\n\n return (\n <Sheet\n isOpen={isOpen}\n onClose={onClose}\n title={source.title}\n size=\"md\"\n className={className}\n >\n <div data-testid=\"source-drawer\" data-document-id={source.document_id}>\n {source.section && (\n <p className=\"text-sm text-text-secondary mb-4\">{source.section}</p>\n )}\n\n <div className=\"flex items-center gap-2 mb-4\">\n <span className=\"text-sm text-text-secondary\">Confidence:</span>\n <Badge intent={getConfidenceIntent(source.confidence)} size=\"sm\">\n {Math.round(source.confidence * 100)}%\n </Badge>\n </div>\n\n <div className=\"mb-4\">\n <h3 className=\"text-sm font-medium text-text-primary mb-2\">Snippet</h3>\n <p className=\"text-sm text-text-secondary bg-surface-raised p-4 rounded-lg\">\n {source.snippet}\n </p>\n </div>\n\n {source.url && (\n <div>\n <h3 className=\"text-sm font-medium text-text-primary mb-2\">Source URL</h3>\n <a\n href={source.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm text-accent hover:underline break-all\"\n >\n {source.url}\n </a>\n </div>\n )}\n </div>\n </Sheet>\n )\n}\n\nexport { SourceDrawer }\nexport type { SourceDrawerProps }\n","import React from 'react'\nimport { Badge } from '@surf-kit/core'\n\ntype SourceBadgeProps = {\n count: number\n className?: string\n}\n\nfunction SourceBadge({ count, className }: SourceBadgeProps) {\n if (count === 0) return null\n\n return (\n <Badge intent=\"info\" size=\"sm\" className={className} data-testid=\"source-badge\">\n {count} {count === 1 ? 'source' : 'sources'}\n </Badge>\n )\n}\n\nexport { SourceBadge }\nexport type { SourceBadgeProps }\n"],"mappings":";;;AACA,SAAS,aAAa;AACtB,SAAS,eAAe;AA2Dd,SACE,KADF;AAjDV,SAAS,oBAAoB,YAAoB;AAC/C,MAAI,cAAc,IAAK,QAAO;AAC9B,MAAI,cAAc,IAAK,QAAO;AAC9B,SAAO;AACT;AAEA,SAAS,mBAAmB,YAAoB;AAC9C,MAAI,cAAc,IAAK,QAAO;AAC9B,MAAI,cAAc,IAAK,QAAO;AAC9B,SAAO;AACT;AAEA,SAAS,WAAW,EAAE,QAAQ,UAAU,WAAW,YAAY,UAAU,GAAoB;AAC3F,QAAM,cAAc,MAAM;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AA;AAAA,cACC,MAAM,OAAO;AAAA,cACb,QAAO;AAAA,cACP,KAAI;AAAA,cACJ,WAAU;AAAA,cAET,iBAAO;AAAA;AAAA,UACV;AAAA,WACF;AAAA,SAEJ;AAAA;AAAA,EACF;AAEJ;;;AC9DA,SAAS,SAAAG,cAAa;AAWlB,iBAAAC,aAAA;AAJJ,SAAS,YAAY,EAAE,OAAO,UAAU,GAAqB;AAC3D,MAAI,UAAU,EAAG,QAAO;AAExB,SACE,gBAAAA,MAACD,QAAA,EAAM,QAAO,QAAO,MAAK,MAAK,WAAsB,eAAY,gBAC9D;AAAA;AAAA,IAAM;AAAA,IAAE,UAAU,IAAI,WAAW;AAAA,KACpC;AAEJ;","names":["jsx","jsxs","jsx","jsxs","Badge","jsx","jsxs","getConfidenceIntent","Badge","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../../src/sources/SourceCard/SourceCard.tsx","../../src/sources/SourceList/SourceList.tsx","../../src/sources/SourceInline/SourceInline.tsx","../../src/sources/SourceDrawer/SourceDrawer.tsx","../../src/sources/SourceBadge/SourceBadge.tsx"],"sourcesContent":["import React from 'react'\nimport { Badge } from '@surf-kit/core'\nimport { twMerge } from 'tailwind-merge'\nimport type { Source } from '../../types/agent'\n\ntype SourceCardProps = {\n source: Source\n variant?: 'compact' | 'expanded'\n onNavigate?: (source: Source) => void\n className?: string\n}\n\nfunction getConfidenceIntent(confidence: number) {\n if (confidence >= 0.8) return 'success' as const\n if (confidence >= 0.5) return 'warning' as const\n return 'error' as const\n}\n\nfunction getConfidenceLabel(confidence: number) {\n if (confidence >= 0.8) return 'High'\n if (confidence >= 0.5) return 'Medium'\n return 'Low'\n}\n\nfunction SourceCard({ source, variant = 'compact', onNavigate, className }: SourceCardProps) {\n const handleClick = () => {\n if (onNavigate) {\n onNavigate(source)\n }\n }\n\n const isCompact = variant === 'compact'\n\n return (\n <div\n className={twMerge(\n 'rounded-xl border transition-all duration-200',\n 'bg-surface border-border',\n onNavigate && 'cursor-pointer hover:border-border-strong',\n className,\n )}\n data-document-id={source.document_id}\n data-testid=\"source-card\"\n >\n <div\n className={isCompact ? 'px-4 py-3' : 'px-6 py-4'}\n onClick={handleClick}\n role={onNavigate ? 'button' : undefined}\n tabIndex={onNavigate ? 0 : undefined}\n onKeyDown={\n onNavigate\n ? (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleClick()\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex-1 min-w-0\">\n {source.url ? (\n <a\n href={source.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm font-medium text-accent hover:underline truncate block\"\n onClick={(e) => e.stopPropagation()}\n >\n {source.title}\n <svg\n className=\"inline-block ml-1 w-3 h-3 opacity-60\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6\" />\n <polyline points=\"15 3 21 3 21 9\" />\n <line x1=\"10\" y1=\"14\" x2=\"21\" y2=\"3\" />\n </svg>\n </a>\n ) : (\n <p className=\"text-sm font-medium text-text-primary truncate\">\n {source.title}\n </p>\n )}\n {source.section && (\n <p className=\"text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate mt-0.5\">\n {source.section}\n </p>\n )}\n </div>\n <Badge\n intent={getConfidenceIntent(source.confidence)}\n size=\"sm\"\n >\n {getConfidenceLabel(source.confidence)}\n </Badge>\n </div>\n {!isCompact && (\n <p className=\"text-xs text-text-secondary mt-2 line-clamp-3 leading-relaxed\">\n {source.snippet}\n </p>\n )}\n </div>\n </div>\n )\n}\n\nexport { SourceCard }\nexport type { SourceCardProps }\n","'use client'\n\nimport React, { useState } from 'react'\nimport type { Source } from '../../types/agent'\nimport { SourceCard } from '../SourceCard'\n\ntype SourceListProps = {\n sources: Source[]\n variant?: 'compact' | 'expanded'\n collapsible?: boolean\n defaultExpanded?: boolean\n onNavigate?: (source: Source) => void\n className?: string\n}\n\nfunction SourceList({\n sources,\n variant = 'compact',\n collapsible = false,\n defaultExpanded = true,\n onNavigate,\n className,\n}: SourceListProps) {\n const [isExpanded, setIsExpanded] = useState(defaultExpanded)\n\n if (sources.length === 0) return null\n\n const content = (\n <div className=\"flex flex-col gap-1.5\" data-testid=\"source-list-items\">\n {sources.map((source) => (\n <SourceCard\n key={source.document_id}\n source={source}\n variant={variant}\n onNavigate={onNavigate}\n />\n ))}\n </div>\n )\n\n if (!collapsible) {\n return (\n <div className={className} data-testid=\"source-list\">\n {content}\n </div>\n )\n }\n\n return (\n <div className={className} data-testid=\"source-list\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded(prev => !prev)}\n aria-expanded={isExpanded}\n className=\"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary hover:text-accent mb-2 transition-colors duration-200\"\n >\n <svg\n className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n Sources ({sources.length})\n </button>\n {isExpanded && content}\n </div>\n )\n}\n\nexport { SourceList }\nexport type { SourceListProps }\n","import React from 'react'\nimport { Tooltip } from '@surf-kit/core'\n\nimport type { Source } from '../../types/agent'\n\ntype SourceInlineProps = {\n source: Source\n index: number\n className?: string\n}\n\nfunction SourceInline({ source, index, className }: SourceInlineProps) {\n const tooltipContent = `${source.title}${source.section ? ` - ${source.section}` : ''}: ${source.snippet.slice(0, 120)}${source.snippet.length > 120 ? '...' : ''}`\n\n return (\n <Tooltip content={tooltipContent} placement=\"top\">\n <span\n className={`inline-flex items-center justify-center text-xs text-accent font-medium cursor-help ${className ?? ''}`}\n data-testid=\"source-inline\"\n data-document-id={source.document_id}\n aria-label={`Source ${index}: ${source.title}`}\n >\n [{index}]\n </span>\n </Tooltip>\n )\n}\n\nexport { SourceInline }\nexport type { SourceInlineProps }\n","import React from 'react'\nimport { Sheet, Badge } from '@surf-kit/core'\nimport type { Source } from '../../types/agent'\n\ntype SourceDrawerProps = {\n source: Source | null\n isOpen: boolean\n onClose: () => void\n className?: string\n}\n\nfunction getConfidenceIntent(confidence: number) {\n if (confidence >= 0.8) return 'success' as const\n if (confidence >= 0.5) return 'warning' as const\n return 'error' as const\n}\n\nfunction SourceDrawer({ source, isOpen, onClose, className }: SourceDrawerProps) {\n if (!source) return null\n\n return (\n <Sheet\n isOpen={isOpen}\n onClose={onClose}\n title={source.title}\n size=\"md\"\n className={className}\n >\n <div data-testid=\"source-drawer\" data-document-id={source.document_id}>\n {source.section && (\n <p className=\"text-sm text-text-secondary mb-4\">{source.section}</p>\n )}\n\n <div className=\"flex items-center gap-2 mb-4\">\n <span className=\"text-sm text-text-secondary\">Confidence:</span>\n <Badge intent={getConfidenceIntent(source.confidence)} size=\"sm\">\n {Math.round(source.confidence * 100)}%\n </Badge>\n </div>\n\n <div className=\"mb-4\">\n <h3 className=\"text-sm font-medium text-text-primary mb-2\">Snippet</h3>\n <p className=\"text-sm text-text-secondary bg-surface-raised p-4 rounded-lg\">\n {source.snippet}\n </p>\n </div>\n\n {source.url && (\n <div>\n <h3 className=\"text-sm font-medium text-text-primary mb-2\">Source URL</h3>\n <a\n href={source.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm text-accent hover:underline break-all\"\n >\n {source.url}\n </a>\n </div>\n )}\n </div>\n </Sheet>\n )\n}\n\nexport { SourceDrawer }\nexport type { SourceDrawerProps }\n","import React from 'react'\nimport { Badge } from '@surf-kit/core'\n\ntype SourceBadgeProps = {\n count: number\n className?: string\n}\n\nfunction SourceBadge({ count, className }: SourceBadgeProps) {\n if (count === 0) return null\n\n return (\n <Badge intent=\"info\" size=\"sm\" className={className} data-testid=\"source-badge\">\n {count} {count === 1 ? 'source' : 'sources'}\n </Badge>\n )\n}\n\nexport { SourceBadge }\nexport type { SourceBadgeProps }\n"],"mappings":";;;AACA,SAAS,aAAa;AACtB,SAAS,eAAe;AAqER,SASE,KATF;AA3DhB,SAAS,oBAAoB,YAAoB;AAC/C,MAAI,cAAc,IAAK,QAAO;AAC9B,MAAI,cAAc,IAAK,QAAO;AAC9B,SAAO;AACT;AAEA,SAAS,mBAAmB,YAAoB;AAC9C,MAAI,cAAc,IAAK,QAAO;AAC9B,MAAI,cAAc,IAAK,QAAO;AAC9B,SAAO;AACT;AAEA,SAAS,WAAW,EAAE,QAAQ,UAAU,WAAW,YAAY,UAAU,GAAoB;AAC3F,QAAM,cAAc,MAAM;AACxB,QAAI,YAAY;AACd,iBAAW,MAAM;AAAA,IACnB;AAAA,EACF;AAEA,QAAM,YAAY,YAAY;AAE9B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,cAAc;AAAA,QACd;AAAA,MACF;AAAA,MACA,oBAAkB,OAAO;AAAA,MACzB,eAAY;AAAA,MAEZ;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,YAAY,cAAc;AAAA,UACrC,SAAS;AAAA,UACT,MAAM,aAAa,WAAW;AAAA,UAC9B,UAAU,aAAa,IAAI;AAAA,UAC3B,WACE,aACI,CAAC,MAA2B;AAC1B,gBAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;AACtC,gBAAE,eAAe;AACjB,0BAAY;AAAA,YACd;AAAA,UACF,IACA;AAAA,UAGN;AAAA,iCAAC,SAAI,WAAU,0CACb;AAAA,mCAAC,SAAI,WAAU,kBACZ;AAAA,uBAAO,MACN;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAM,OAAO;AAAA,oBACb,QAAO;AAAA,oBACP,KAAI;AAAA,oBACJ,WAAU;AAAA,oBACV,SAAS,CAAC,MAAM,EAAE,gBAAgB;A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