"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RFPIntegrationDemo = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const react_2 = require("@chakra-ui/react");
const icons_1 = require("@chakra-ui/icons");
const BFUIProvider_js_1 = require("../core/BFUIProvider.js");
const pages_js_1 = require("../pages.js");
/**
 * Comprehensive demo showing how to integrate the RFP Intelligence System
 * with the bfui component library and bfapi services
 */
const RFPIntegrationDemo = () => {
    const [activeDemo, setActiveDemo] = (0, react_1.useState)('overview');
    const integrationSteps = [
        {
            title: 'Install Dependencies',
            description: 'Add the required packages to your project',
            code: `npm install @bluefly/ui @bluefly/api-client @bluefly/llmcli
# or with yarn
yarn add @bluefly/ui @bluefly/api-client @bluefly/llmcli`
        },
        {
            title: 'Setup Providers',
            description: 'Wrap your application with the necessary providers',
            code: `import React from 'react';
import { BFUIProvider } from '@bluefly/ui';
import { llm-gateway-sdk } from '@bluefly/api-client';

const apiClient = new llm-gateway-sdk({
  baseURL: process.env.REACT_APP_API_URL || 'http://localhost:3000',
  timeout: 30000
});

function App() {
  return (
    <BFUIProvider>
      <APIClientProvider client={apiClient}>
        <YourAppComponents />
      </APIClientProvider>
    </BFUIProvider>
  );
}`
        },
        {
            title: 'Use RFP Components',
            description: 'Import and use the RFP intelligence components',
            code: `import React from 'react';
import { 
  RFPDashboard, 
  RFPDocumentUpload, 
  RFPContentGenerator 
} from '@bluefly/ui';

export const MyRFPApplication = () => {
  const handleDocumentProcessed = (documents) => {
    // Process uploaded documents
    console.log('Documents processed:', documents);
  };

  const handleContentGenerated = (sections) => {
    // Handle generated RFP content
    console.log('Content generated:', sections);
  };

  return (
    <div>
      <RFPDashboard 
        onCreateProject={() => setView('upload')}
        onOpenProject={(id) => openProject(id)}
      />
      <RFPDocumentUpload 
        onDocumentsProcessed={handleDocumentProcessed}
        maxFileSize={10}
        acceptedFormats={['pdf', 'doc', 'docx']}
      />
      <RFPContentGenerator 
        onContentGenerated={handleContentGenerated}
        onExportRequest={(format) => exportContent(format)}
      />
    </div>
  );
};`
        },
        {
            title: 'Backend Integration',
            description: 'Connect to the RFP intelligence backend services',
            code: `// Connect to bfrfp service for RFP processing
import { RFPIntelligenceClient } from '@bluefly/api-client';

const rfpClient = new RFPIntelligenceClient({
  baseURL: 'http://localhost:3003', // bfrfp service
  apiKey: process.env.REACT_APP_RFP_API_KEY
});

// Process documents
const processDocuments = async (files) => {
  const response = await rfpClient.processDocuments({
    files,
    enableCompetitiveAnalysis: true,
    enableGovernmentData: true
  });
  return response.data;
};

// Generate content
const generateContent = async (requirements) => {
  const response = await rfpClient.generateContent({
    requirements,
    companyProfile: await getCompanyProfile(),
    competitiveAnalysis: await getCompetitiveAnalysis()
  });
  return response.data;
};`
        }
    ];
    const features = [
        {
            category: 'Document Processing',
            items: [
                'Multi-format document upload (PDF, DOC, DOCX)',
                'URL and Google Drive integration',
                'AI-powered requirement extraction',
                'Government document parsing'
            ]
        },
        {
            category: 'Competitive Intelligence',
            items: [
                'SAM.gov and FPDS API integration',
                'Market analysis and pricing intelligence',
                'Winning pattern recognition',
                'Strategic recommendations'
            ]
        },
        {
            category: 'AI Content Generation',
            items: [
                'LangChain-powered content creation',
                'Section-by-section generation',
                'Confidence scoring and quality metrics',
                'Real-time editing and enhancement'
            ]
        },
        {
            category: 'Export & Integration',
            items: [
                'Multiple export formats (PDF, DOCX, Markdown)',
                'GitLab Pages preview integration',
                'Version control and collaboration',
                'Enterprise security and compliance'
            ]
        }
    ];
    return ((0, jsx_runtime_1.jsx)(react_2.Container, { maxW: "7xl", py: 8, children: (0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 8, align: "stretch", children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { textAlign: "center", children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "xl", mb: 4, children: "RFP Intelligence System Integration Demo" }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "lg", color: "gray.600", maxW: "3xl", mx: "auto", children: "A comprehensive demonstration of how to integrate the AI-powered RFP intelligence system with the bfui component library and platform services." })] }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { justify: "center", spacing: 4, children: [(0, jsx_runtime_1.jsx)(react_2.Button, { variant: activeDemo === 'overview' ? 'solid' : 'outline', onClick: () => setActiveDemo('overview'), children: "Overview" }), (0, jsx_runtime_1.jsx)(react_2.Button, { variant: activeDemo === 'components' ? 'solid' : 'outline', onClick: () => setActiveDemo('components'), children: "Components" }), (0, jsx_runtime_1.jsx)(react_2.Button, { variant: activeDemo === 'integration' ? 'solid' : 'outline', onClick: () => setActiveDemo('integration'), children: "Integration" }), (0, jsx_runtime_1.jsx)(react_2.Button, { variant: activeDemo === 'fullapp' ? 'solid' : 'outline', onClick: () => setActiveDemo('fullapp'), children: "Full App Demo" })] }), activeDemo === 'overview' && ((0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 6, align: "stretch", children: [(0, jsx_runtime_1.jsxs)(react_2.Alert, { status: "info", children: [(0, jsx_runtime_1.jsx)(react_2.AlertIcon, {}), (0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.AlertTitle, { children: "System Architecture!" }), (0, jsx_runtime_1.jsx)(react_2.AlertDescription, { children: "The RFP Intelligence System combines multiple services: bfui (React components), bfrfp (RFP processing), bfapi (API gateway), and bfllm (AI models) to create a comprehensive solution for government contracting." })] })] }), (0, jsx_runtime_1.jsx)(react_2.SimpleGrid, { columns: { base: 1, md: 2 }, spacing: 6, children: features.map((feature, idx) => ((0, jsx_runtime_1.jsxs)(react_2.Card, { children: [(0, jsx_runtime_1.jsx)(react_2.CardHeader, { children: (0, jsx_runtime_1.jsx)(react_2.Heading, { size: "md", children: feature.category }) }), (0, jsx_runtime_1.jsx)(react_2.CardBody, { children: (0, jsx_runtime_1.jsx)(react_2.List, { spacing: 2, children: feature.items.map((item, itemIdx) => ((0, jsx_runtime_1.jsxs)(react_2.ListItem, { fontSize: "sm", children: [(0, jsx_runtime_1.jsx)(react_2.ListIcon, { as: icons_1.CheckIcon, color: "green.500" }), item] }, itemIdx))) }) })] }, idx))) }), (0, jsx_runtime_1.jsx)(react_2.Card, { bg: "blue.50", borderColor: "blue.200", children: (0, jsx_runtime_1.jsx)(react_2.CardBody, { children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { align: "start", spacing: 4, children: [(0, jsx_runtime_1.jsx)(react_2.Box, { children: (0, jsx_runtime_1.jsx)(icons_1.CodeIcon, { color: "blue.500", boxSize: 6 }) }), (0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "sm", mb: 2, children: "Platform Integration" }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", children: "This system integrates seamlessly with your existing Drupal platform, providing AI-powered RFP capabilities through modern React components and enterprise-grade API services." })] })] }) }) })] })), activeDemo === 'components' && ((0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 6, align: "stretch", children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "lg", children: "Component Library Overview" }), (0, jsx_runtime_1.jsxs)(react_2.SimpleGrid, { columns: { base: 1, lg: 3 }, spacing: 6, children: [(0, jsx_runtime_1.jsxs)(react_2.Card, { children: [(0, jsx_runtime_1.jsxs)(react_2.CardHeader, { children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "md", children: "RFPDashboard" }), (0, jsx_runtime_1.jsx)(react_2.Badge, { colorScheme: "blue", mt: 1, children: "Primary Interface" })] }), (0, jsx_runtime_1.jsx)(react_2.CardBody, { children: (0, jsx_runtime_1.jsxs)(react_2.VStack, { align: "start", spacing: 3, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", children: "Central dashboard for managing RFP projects with analytics, project status tracking, and quick actions." }), (0, jsx_runtime_1.jsxs)(react_2.List, { spacing: 1, fontSize: "sm", children: [(0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Project management" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Win rate analytics" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Pipeline tracking" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Quick project creation" })] })] }) })] }), (0, jsx_runtime_1.jsxs)(react_2.Card, { children: [(0, jsx_runtime_1.jsxs)(react_2.CardHeader, { children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "md", children: "RFPDocumentUpload" }), (0, jsx_runtime_1.jsx)(react_2.Badge, { colorScheme: "green", mt: 1, children: "Data Input" })] }), (0, jsx_runtime_1.jsx)(react_2.CardBody, { children: (0, jsx_runtime_1.jsxs)(react_2.VStack, { align: "start", spacing: 3, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", children: "Advanced document upload with drag-and-drop, URL processing, and real-time analysis feedback." }), (0, jsx_runtime_1.jsxs)(react_2.List, { spacing: 1, fontSize: "sm", children: [(0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Multi-format support" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Progress tracking" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Real-time validation" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Requirement extraction" })] })] }) })] }), (0, jsx_runtime_1.jsxs)(react_2.Card, { children: [(0, jsx_runtime_1.jsxs)(react_2.CardHeader, { children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "md", children: "RFPContentGenerator" }), (0, jsx_runtime_1.jsx)(react_2.Badge, { colorScheme: "purple", mt: 1, children: "AI Powered" })] }), (0, jsx_runtime_1.jsx)(react_2.CardBody, { children: (0, jsx_runtime_1.jsxs)(react_2.VStack, { align: "start", spacing: 3, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", children: "AI-powered content generation with section management, quality scoring, and real-time editing capabilities." }), (0, jsx_runtime_1.jsxs)(react_2.List, { spacing: 1, fontSize: "sm", children: [(0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Section generation" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Quality metrics" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Real-time editing" }), (0, jsx_runtime_1.jsx)(react_2.ListItem, { children: "\u2022 Export options" })] })] }) })] })] }), (0, jsx_runtime_1.jsxs)(react_2.Alert, { status: "success", children: [(0, jsx_runtime_1.jsx)(react_2.AlertIcon, {}), (0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.AlertTitle, { children: "Fully Integrated Components" }), (0, jsx_runtime_1.jsx)(react_2.AlertDescription, { children: "All components are built with Chakra UI, include TypeScript definitions, comprehensive testing, and follow enterprise accessibility standards." })] })] })] })), activeDemo === 'integration' && ((0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 6, align: "stretch", children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "lg", children: "Integration Guide" }), (0, jsx_runtime_1.jsxs)(react_2.Tabs, { variant: "enclosed", colorScheme: "blue", children: [(0, jsx_runtime_1.jsxs)(react_2.TabList, { children: [(0, jsx_runtime_1.jsx)(react_2.Tab, { children: "Setup" }), (0, jsx_runtime_1.jsx)(react_2.Tab, { children: "Configuration" }), (0, jsx_runtime_1.jsx)(react_2.Tab, { children: "API Integration" }), (0, jsx_runtime_1.jsx)(react_2.Tab, { children: "Deployment" })] }), (0, jsx_runtime_1.jsxs)(react_2.TabPanels, { children: [(0, jsx_runtime_1.jsx)(react_2.TabPanel, { children: (0, jsx_runtime_1.jsx)(react_2.VStack, { spacing: 4, align: "stretch", children: integrationSteps.map((step, idx) => ((0, jsx_runtime_1.jsxs)(react_2.Card, { children: [(0, jsx_runtime_1.jsx)(react_2.CardHeader, { children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { children: [(0, jsx_runtime_1.jsx)(react_2.Badge, { colorScheme: "blue", children: idx + 1 }), (0, jsx_runtime_1.jsx)(react_2.Heading, { size: "sm", children: step.title })] }) }), (0, jsx_runtime_1.jsxs)(react_2.CardBody, { children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", mb: 3, children: step.description }), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: "gray.50", p: 4, borderRadius: "md", overflowX: "auto", children: (0, jsx_runtime_1.jsx)(react_2.Code, { fontSize: "sm", whiteSpace: "pre-wrap", children: step.code }) })] })] }, idx))) }) }), (0, jsx_runtime_1.jsx)(react_2.TabPanel, { children: (0, jsx_runtime_1.jsxs)(react_2.Card, { children: [(0, jsx_runtime_1.jsx)(react_2.CardHeader, { children: (0, jsx_runtime_1.jsx)(react_2.Heading, { size: "md", children: "Environment Configuration" }) }), (0, jsx_runtime_1.jsxs)(react_2.CardBody, { children: [(0, jsx_runtime_1.jsx)(react_2.Text, { mb: 4, children: "Configure your environment variables for proper service integration:" }), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: "gray.50", p: 4, borderRadius: "md", children: (0, jsx_runtime_1.jsx)(react_2.Code, { fontSize: "sm", whiteSpace: "pre-wrap", children: `# .env file
REACT_APP_API_URL=http://localhost:3000
REACT_APP_RFP_SERVICE_URL=http://localhost:3003
REACT_APP_LLM_SERVICE_URL=http://localhost:3002
REACT_APP_MCP_SERVICE_URL=http://localhost:3001

# API Keys
REACT_APP_OPENAI_API_KEY=your_openai_key
REACT_APP_SAM_GOV_API_KEY=your_sam_gov_key

# Feature Flags
REACT_APP_ENABLE_COMPETITIVE_ANALYSIS=true
REACT_APP_ENABLE_GOVERNMENT_DATA=true
REACT_APP_ENABLE_AI_ENHANCEMENT=true` }) })] })] }) }), (0, jsx_runtime_1.jsx)(react_2.TabPanel, { children: (0, jsx_runtime_1.jsxs)(react_2.Card, { children: [(0, jsx_runtime_1.jsx)(react_2.CardHeader, { children: (0, jsx_runtime_1.jsx)(react_2.Heading, { size: "md", children: "Service Integration" }) }), (0, jsx_runtime_1.jsxs)(react_2.CardBody, { children: [(0, jsx_runtime_1.jsx)(react_2.Text, { mb: 4, children: "Connect to backend services for full functionality:" }), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: "gray.50", p: 4, borderRadius: "md", children: (0, jsx_runtime_1.jsx)(react_2.Code, { fontSize: "sm", whiteSpace: "pre-wrap", children: `// services/rfp-client.ts
import { createClient } from '@bluefly/api-client';

export const rfpClient = createClient({
  services: {
    api: process.env.REACT_APP_API_URL,
    rfp: process.env.REACT_APP_RFP_SERVICE_URL,
    llm: process.env.REACT_APP_LLM_SERVICE_URL,
    mcp: process.env.REACT_APP_MCP_SERVICE_URL
  },
  auth: {
    apiKey: process.env.REACT_APP_API_KEY
  },
  retries: 3,
  timeout: 30000
});

// Usage in components
export const useRFPServices = () => {
  const processDocuments = async (files) => {
    return await rfpClient.rfp.processDocuments(files);
  };

  const generateContent = async (config) => {
    return await rfpClient.llm.generateContent(config);
  };

  return { processDocuments, generateContent };
};` }) })] })] }) }), (0, jsx_runtime_1.jsx)(react_2.TabPanel, { children: (0, jsx_runtime_1.jsxs)(react_2.Card, { children: [(0, jsx_runtime_1.jsx)(react_2.CardHeader, { children: (0, jsx_runtime_1.jsx)(react_2.Heading, { size: "md", children: "Deployment Setup" }) }), (0, jsx_runtime_1.jsxs)(react_2.CardBody, { children: [(0, jsx_runtime_1.jsx)(react_2.Text, { mb: 4, children: "Deploy using the llmcli tool and GitLab CI/CD:" }), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: "gray.50", p: 4, borderRadius: "md", children: (0, jsx_runtime_1.jsx)(react_2.Code, { fontSize: "sm", whiteSpace: "pre-wrap", children: `# Using llmcli for deployment
llmcli project:init --template=rfp-app
llmcli services:start --env=development
llmcli build --target=production
llmcli deploy --platform=gitlab-pages

# GitLab CI/CD (.gitlab-ci.yml)
include:
  - project: 'llm/bfcicomponents'
    file: '/templates/react-app.yml'

variables:
  APP_NAME: "rfp-intelligence-app"
  NODE_VERSION: "20"
  
stages:
  - build
  - test
  - deploy

build:
  extends: .react-build-template
  
test:
  extends: .react-test-template
  
deploy:
  extends: .gitlab-pages-deploy-template` }) })] })] }) })] })] })] })), activeDemo === 'fullapp' && ((0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 6, align: "stretch", children: [(0, jsx_runtime_1.jsxs)(react_2.Alert, { status: "warning", children: [(0, jsx_runtime_1.jsx)(react_2.AlertIcon, {}), (0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.AlertTitle, { children: "Interactive Demo" }), (0, jsx_runtime_1.jsx)(react_2.AlertDescription, { children: "This is a fully functional demo of the RFP Intelligence System. You can interact with all components and see how they work together." })] })] }), (0, jsx_runtime_1.jsx)(react_2.Box, { border: "2px solid", borderColor: "blue.200", borderRadius: "lg", p: 1, children: (0, jsx_runtime_1.jsx)(BFUIProvider_js_1.BFUIProvider, { children: (0, jsx_runtime_1.jsx)(pages_js_1.RFPApp, {}) }) })] })), (0, jsx_runtime_1.jsx)(react_2.Divider, {}), (0, jsx_runtime_1.jsxs)(react_2.Box, { textAlign: "center", py: 4, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: "gray.600", children: "RFP Intelligence System \u2022 Built with bfui, bfapi, bfrfp, and bfllm" }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { justify: "center", spacing: 4, mt: 2, children: [(0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", variant: "link", leftIcon: (0, jsx_runtime_1.jsx)(icons_1.ExternalLinkIcon, {}), children: "Documentation" }), (0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", variant: "link", leftIcon: (0, jsx_runtime_1.jsx)(icons_1.ExternalLinkIcon, {}), children: "API Reference" }), (0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", variant: "link", leftIcon: (0, jsx_runtime_1.jsx)(icons_1.ExternalLinkIcon, {}), children: "GitHub Repository" })] })] })] }) }));
};
exports.RFPIntegrationDemo = RFPIntegrationDemo;
exports.default = exports.RFPIntegrationDemo;
//# sourceMappingURL=RFPIntegrationDemo.js.map