{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contract-redline-diff",
  "title": "Contract Redline Diff",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/contract-redline-diff/ContractRedlineDiff.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { useState, useMemo } from 'react'\nimport {\n  Check,\n  CheckCircle2,\n  Clock,\n  FileMinus2,\n  FilePlus2,\n  FileText,\n  History,\n  MessageSquare,\n  MessageSquareReply,\n  Scale,\n  Send,\n  X,\n  XCircle,\n} from 'lucide-react'\nimport { cn } from '@/lib/utils'\nimport { Avatar, AvatarFallback } from '@/components/ui/avatar'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'\nimport { Separator } from '@/components/ui/separator'\n\nexport interface CommentItem {\n  id: string\n  clauseId: string\n  clauseTitle: string\n  authorName: string\n  authorRole: string\n  authorInitials: string\n  timestamp: string\n  commentText: string\n  proposedChange: string\n  status: 'pending' | 'resolved'\n  severity?: 'critical' | 'moderate' | 'standard'\n}\n\nexport interface RedlineStats {\n  additions: string\n  additionsSub: string\n  deletions: string\n  deletionsSub: string\n  openComments: number\n  resolvedComments: number\n  liabilityCap: string\n  liabilityCapSub: string\n}\n\nexport interface ContractRedlineDiffProps {\n  contractTitle?: string\n  counterparty?: string\n  counselFirm?: string\n  versionComparison?: string\n  initialStats?: RedlineStats\n  initialComments?: CommentItem[]\n  className?: string\n}\n\nconst defaultComments: CommentItem[] = [\n  {\n    id: 'c-1',\n    clauseId: 'clause-4-2',\n    clauseTitle: 'Section 4.2 · Service Level Agreement Credits',\n    authorName: 'Sarah Lin',\n    authorRole: 'Senior Counsel, Davis Polk & Wardwell LLP',\n    authorInitials: 'SL',\n    timestamp: '2 hours ago',\n    commentText:\n      'Acme enterprise infrastructure requires a 25% credit for downtime exceeding 4 hours given Tier-1 mission-critical workload dependency. We also propose extending the scheduled maintenance notice window to 7 business days.',\n    proposedChange: '25% monthly fee credit (was 10%) · 7 business days notice (was 48 hours)',\n    status: 'pending',\n    severity: 'critical',\n  },\n  {\n    id: 'c-2',\n    clauseId: 'clause-8-1',\n    clauseTitle: 'Section 8.1 · Limitation of Liability & Super-Cap',\n    authorName: 'Marcus Vance',\n    authorRole: 'VP Legal & AGC, Acme Enterprise Corp',\n    authorInitials: 'MV',\n    timestamp: '4 hours ago',\n    commentText:\n      'We cannot agree to a standard 12-month trailing fee liability cap due to GDPR Article 82 joint-controller exposure and confidential IP storage. A $2.5M aggregate super-cap is our committee floor for cloud vendor onboarding.',\n    proposedChange: 'Super-cap of $2,500,000 or 2.5x total contract value for data protection breaches',\n    status: 'pending',\n    severity: 'critical',\n  },\n  {\n    id: 'c-3',\n    clauseId: 'clause-12-3',\n    clauseTitle: 'Section 12.3 · Governing Law & Commercial Arbitration',\n    authorName: 'Elena Rostova',\n    authorRole: 'Partner, Technology Transactions Counsel',\n    authorInitials: 'ER',\n    timestamp: 'Yesterday at 17:45',\n    commentText:\n      'Replaced Delaware Chancery court litigation with AAA expedited commercial arbitration seated in New York to contain cross-border litigation exposure, expedite timeline, and guarantee reciprocal fee shifting.',\n    proposedChange: 'AAA Commercial Arbitration (New York, NY) + Prevailing party attorney fee shifting',\n    status: 'pending',\n    severity: 'moderate',\n  },\n  {\n    id: 'c-4',\n    clauseId: 'clause-2-4',\n    clauseTitle: 'Section 2.4 · Customer Data & AI Model Training',\n    authorName: 'David Kim',\n    authorRole: 'Lead In-House Commercial Counsel',\n    authorInitials: 'DK',\n    timestamp: 'Resolved 5 hours ago',\n    commentText:\n      'Provider confirmed in writing that customer telemetry is strictly quarantined and excluded from foundation LLM model training. Mutually agreed language inserted.',\n    proposedChange: 'Explicit carve-out prohibiting Customer Data ingestion into generative AI training sets',\n    status: 'resolved',\n    severity: 'standard',\n  },\n]\n\nexport function ContractRedlineDiff({\n  contractTitle = 'Master Services Agreement · Redline Review v3.2 vs v3.1',\n  counterparty = 'Acme Enterprise Corp',\n  counselFirm = 'Davis Polk & Wardwell LLP',\n  versionComparison = 'v3.2 (Counterparty Redlines) vs v3.1 (Baseline Executed)',\n  initialComments,\n  className,\n}: ContractRedlineDiffProps) {\n  const [comments, setComments] = useState<CommentItem[]>(initialComments ? [...initialComments] : [...defaultComments])\n  const [activeCommentId, setActiveCommentId] = useState<string>('c-1')\n  const [selectedFilter, setSelectedFilter] = useState<'all' | 'pending' | 'resolved'>('all')\n  const [replyingCommentId, setReplyingCommentId] = useState<string | null>(null)\n  const [replyDraftText, setReplyDraftText] = useState<string>('')\n  const [actionBannerMessage, setActionBannerMessage] = useState<string | null>(null)\n\n  const pendingCount = useMemo(() => comments.filter((c) => c.status === 'pending').length, [comments])\n  const resolvedCount = useMemo(() => comments.filter((c) => c.status === 'resolved').length, [comments])\n\n  const filteredComments = useMemo(() => {\n    if (selectedFilter === 'pending') {\n      return comments.filter((c) => c.status === 'pending')\n    }\n    if (selectedFilter === 'resolved') {\n      return comments.filter((c) => c.status === 'resolved')\n    }\n    return comments\n  }, [comments, selectedFilter])\n\n  const selectComment = (id: string, clauseId?: string) => {\n    setActiveCommentId(id)\n    if (clauseId && typeof document !== 'undefined') {\n      const el = document.getElementById(clauseId)\n      if (el) {\n        el.scrollIntoView({ behavior: 'smooth', block: 'center' })\n      }\n    }\n  }\n\n  const toggleAcceptTweak = (id: string) => {\n    setComments((prev) =>\n      prev.map((c) => {\n        if (c.id === id) {\n          const nextStatus = c.status === 'pending' ? 'resolved' : 'pending'\n          if (nextStatus === 'resolved') {\n            setActionBannerMessage(`Accepted proposed language for \"${c.clauseTitle}\"`)\n          } else {\n            setActionBannerMessage(`Reopened review for \"${c.clauseTitle}\"`)\n          }\n          return { ...c, status: nextStatus }\n        }\n        return c\n      }),\n    )\n  }\n\n  const handleAcceptAll = () => {\n    setComments((prev) => prev.map((c) => ({ ...c, status: 'resolved' })))\n    setActionBannerMessage('All 3 pending redlines and attorney comments have been accepted into draft v3.3')\n  }\n\n  const handleRejectAll = () => {\n    setComments((prev) => prev.map((c) => ({ ...c, status: 'pending' })))\n    setActionBannerMessage('Redline proposals flagged for revision. Counterparty notified of rejection.')\n  }\n\n  const toggleReply = (id: string) => {\n    if (replyingCommentId === id) {\n      setReplyingCommentId(null)\n      setReplyDraftText('')\n    } else {\n      setReplyingCommentId(id)\n      setReplyDraftText('')\n    }\n  }\n\n  const submitReply = (id: string) => {\n    if (!replyDraftText.trim()) return\n    const target = comments.find((c) => c.id === id)\n    setActionBannerMessage(`Reply posted to counsel thread on ${target?.clauseTitle}`)\n    setReplyingCommentId(null)\n    setReplyDraftText('')\n  }\n\n  return (\n    <div data-slot=\"contract-redline-diff\" className={cn('bg-background text-foreground w-full space-y-6', className)}>\n      {/* Header Section */}\n      <header className=\"border-border bg-card rounded-xl border p-5 shadow-xs sm:p-6\">\n        <div className=\"flex flex-col gap-5 lg:flex-row lg:items-center lg:justify-between\">\n          <div className=\"space-y-2\">\n            <div className=\"flex flex-wrap items-center gap-2.5\">\n              <span className=\"text-muted-foreground font-mono text-xs tracking-wider uppercase\">\n                CLM Contract Workspace &bull; MSA-2026-0882\n              </span>\n              {pendingCount > 0 ? (\n                <Badge\n                  wrap\n                  variant=\"outline\"\n                  className=\"border-warning/30 bg-warning/10 text-warning font-mono text-xs font-semibold\"\n                >\n                  <span className=\"bg-warning mr-1.5 size-1.5 rounded-full\" />\n                  {pendingCount} Pending Redlines &bull; {resolvedCount} Resolved\n                </Badge>\n              ) : (\n                <Badge\n                  wrap\n                  variant=\"outline\"\n                  className=\"border-success/30 bg-success/10 text-success font-mono text-xs font-semibold\"\n                >\n                  <CheckCircle2 className=\"text-success mr-1 size-3\" aria-hidden=\"true\" />\n                  All Changes Accepted &bull; Ready for Execution\n                </Badge>\n              )}\n            </div>\n\n            <h1 className=\"text-foreground text-2xl font-bold tracking-tight sm:text-3xl\">{contractTitle}</h1>\n\n            <div className=\"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs sm:text-sm\">\n              <div className=\"text-muted-foreground flex items-center gap-1.5\">\n                <span className=\"text-foreground font-medium\">Counterparty:</span>\n                <span>{counterparty}</span>\n              </div>\n              <span className=\"text-muted-foreground/40 hidden sm:inline\">&bull;</span>\n              <div className=\"text-muted-foreground flex items-center gap-1.5\">\n                <span className=\"text-foreground font-medium\">Outside Counsel:</span>\n                <span>{counselFirm}</span>\n              </div>\n              <span className=\"text-muted-foreground/40 hidden sm:inline\">&bull;</span>\n              <div className=\"text-muted-foreground flex items-center gap-1.5\">\n                <History className=\"size-3.5\" aria-hidden=\"true\" />\n                <span>{versionComparison}</span>\n              </div>\n            </div>\n          </div>\n\n          {/* Header Action Controls */}\n          <div className=\"flex flex-wrap items-center gap-3\">\n            <Button variant=\"outline\" size=\"sm\" className=\"gap-1.5 text-xs font-medium\" onClick={handleRejectAll}>\n              <XCircle className=\"text-muted-foreground size-4\" aria-hidden=\"true\" />\n              <span>Reject Changes</span>\n            </Button>\n\n            <Button\n              variant=\"default\"\n              size=\"sm\"\n              className=\"gap-1.5 text-xs font-semibold shadow-xs\"\n              onClick={handleAcceptAll}\n            >\n              <Check className=\"size-4\" aria-hidden=\"true\" />\n              <span>Accept All Changes</span>\n            </Button>\n          </div>\n        </div>\n\n        {/* Action Feedback Banner */}\n        {actionBannerMessage && (\n          <div className=\"border-primary/20 bg-primary/5 mt-4 flex items-center justify-between rounded-lg border px-4 py-2.5 text-xs\">\n            <div className=\"text-foreground flex items-center gap-2 font-medium\">\n              <CheckCircle2 className=\"text-primary size-4 shrink-0\" aria-hidden=\"true\" />\n              <span>{actionBannerMessage}</span>\n            </div>\n            <button\n              type=\"button\"\n              className=\"text-muted-foreground hover:text-foreground focus-visible:ring-ring rounded p-1 focus-visible:ring-2 focus-visible:outline-none\"\n              onClick={() => setActionBannerMessage(null)}\n              aria-label=\"Dismiss notification\"\n            >\n              <X className=\"size-3.5\" />\n            </button>\n          </div>\n        )}\n      </header>\n\n      {/* 4 Redline Summary Metric Cards */}\n      <section aria-label=\"Redline metrics overview\" className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n        {/* Metric 1: Additions / Insertions */}\n        <Card className=\"border-border bg-card shadow-xs\">\n          <CardHeader className=\"p-4 pb-2\">\n            <div className=\"flex items-center justify-between\">\n              <CardTitle className=\"text-muted-foreground text-xs font-medium tracking-wider uppercase\">\n                Additions / Insertions\n              </CardTitle>\n              <div className=\"bg-success/10 text-success rounded-md p-1.5\">\n                <FilePlus2 className=\"size-4\" aria-hidden=\"true\" />\n              </div>\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-1 p-4 pt-0\">\n            <p className=\"text-success font-mono text-2xl font-bold tracking-tight\">+14 Clauses / Sentences</p>\n            <p className=\"text-muted-foreground text-xs leading-relaxed\">\n              +620 words &bull; Enhanced SLA credits, audit rights &amp; ML carve-outs\n            </p>\n          </CardContent>\n        </Card>\n\n        {/* Metric 2: Deletions / Removals */}\n        <Card className=\"border-border bg-card shadow-xs\">\n          <CardHeader className=\"p-4 pb-2\">\n            <div className=\"flex items-center justify-between\">\n              <CardTitle className=\"text-muted-foreground text-xs font-medium tracking-wider uppercase\">\n                Deletions / Removals\n              </CardTitle>\n              <div className=\"bg-destructive/10 text-destructive rounded-md p-1.5\">\n                <FileMinus2 className=\"size-4\" aria-hidden=\"true\" />\n              </div>\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-1 p-4 pt-0\">\n            <p className=\"text-destructive font-mono text-2xl font-bold tracking-tight\">-8 Clauses Struck Through</p>\n            <p className=\"text-muted-foreground text-xs leading-relaxed\">\n              -310 words &bull; Excised unilateral termination &amp; uncapped liability\n            </p>\n          </CardContent>\n        </Card>\n\n        {/* Metric 3: Pending Review Comments */}\n        <Card className=\"border-border bg-card shadow-xs\">\n          <CardHeader className=\"p-4 pb-2\">\n            <div className=\"flex items-center justify-between\">\n              <CardTitle className=\"text-muted-foreground text-xs font-medium tracking-wider uppercase\">\n                Review Comments\n              </CardTitle>\n              <div className=\"bg-warning/10 text-warning rounded-md p-1.5\">\n                <MessageSquare className=\"size-4\" aria-hidden=\"true\" />\n              </div>\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-1 p-4 pt-0\">\n            <p className=\"text-warning font-mono text-2xl font-bold tracking-tight\">\n              {pendingCount} Open Counsel Comments\n            </p>\n            <p className=\"text-muted-foreground text-xs leading-relaxed\">\n              {resolvedCount} resolved &bull; 2 require General Counsel sign-off\n            </p>\n          </CardContent>\n        </Card>\n\n        {/* Metric 4: Liability Cap Shift */}\n        <Card className=\"border-border bg-card shadow-xs\">\n          <CardHeader className=\"p-4 pb-2\">\n            <div className=\"flex items-center justify-between\">\n              <CardTitle className=\"text-muted-foreground text-xs font-medium tracking-wider uppercase\">\n                Liability Cap Shift\n              </CardTitle>\n              <div className=\"bg-primary/10 text-primary rounded-md p-1.5\">\n                <Scale className=\"size-4\" aria-hidden=\"true\" />\n              </div>\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-1 p-4 pt-0\">\n            <p className=\"text-primary font-mono text-2xl font-bold tracking-tight\">$1.0M &rarr; $2.5M Super-Cap</p>\n            <p className=\"text-muted-foreground text-xs leading-relaxed\">\n              Shifted from 1x annual fees to 2.5x aggregate contract liability\n            </p>\n          </CardContent>\n        </Card>\n      </section>\n\n      {/* 2-Column Redline Workspace */}\n      <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-12 lg:items-start\">\n        {/* Left Column: Redlined Document Prose */}\n        <main className=\"space-y-6 lg:col-span-8\">\n          <div className=\"border-border bg-card rounded-xl border shadow-xs\">\n            {/* Document Controls & Legend Top Bar */}\n            <div className=\"border-border bg-muted/40 flex flex-wrap items-center justify-between gap-3 border-b px-5 py-3.5\">\n              <div className=\"flex items-center gap-2\">\n                <FileText className=\"text-primary size-4\" aria-hidden=\"true\" />\n                <span className=\"text-foreground text-xs font-semibold sm:text-sm\">\n                  Master Services Agreement (MSA) &bull; Draft v3.2\n                </span>\n              </div>\n\n              {/* Visual Legend */}\n              <div className=\"flex flex-wrap items-center gap-3 text-xs\">\n                <div className=\"flex items-center gap-1.5\">\n                  <span className=\"border-success/30 bg-success/20 inline-block h-3 w-5 rounded border\" />\n                  <span className=\"text-muted-foreground\">Insertion (Acme Counsel)</span>\n                </div>\n                <div className=\"flex items-center gap-1.5\">\n                  <span className=\"border-destructive/30 bg-destructive/20 inline-block h-3 w-5 rounded border\" />\n                  <span className=\"text-muted-foreground\">Deletion (Struck Out)</span>\n                </div>\n              </div>\n            </div>\n\n            {/* Document Content Body */}\n            <div className=\"divide-border space-y-8 divide-y px-5 py-6 sm:px-8\">\n              {/* Section 2: Intellectual Property & Data Ownership */}\n              <section id=\"clause-2-4\" className=\"scroll-mt-6 space-y-3 pt-6 first:pt-0\">\n                <div className=\"flex flex-wrap items-center justify-between gap-2\">\n                  <div className=\"flex items-center gap-2\">\n                    <h2 className=\"text-foreground text-sm font-bold tracking-tight sm:text-base\">\n                      Section 2 &bull; Intellectual Property &amp; Customer Data\n                    </h2>\n                    <Badge\n                      wrap\n                      variant=\"outline\"\n                      className=\"border-success/30 bg-success/10 text-success font-mono text-xs\"\n                    >\n                      [RESOLVED] &bull; § 2.4 ML Carve-out\n                    </Badge>\n                  </div>\n                  <Button\n                    variant=\"ghost\"\n                    size=\"sm\"\n                    className=\"text-muted-foreground hover:text-foreground h-7 gap-1 px-2 text-xs\"\n                    onClick={() => selectComment('c-4', 'clause-2-4')}\n                  >\n                    <MessageSquare className=\"text-success size-3.5\" />\n                    <span>View Resolution</span>\n                  </Button>\n                </div>\n\n                <div className=\"border-border bg-muted/20 space-y-3 rounded-lg border p-4 text-xs leading-relaxed sm:text-sm\">\n                  <p className=\"text-foreground\">\n                    <strong className=\"text-foreground font-semibold\">\n                      2.4 Proprietary Rights &amp; Restrictions.\n                    </strong>\n                    Customer retains all right, title, and interest in and to Customer Data, including all Intellectual\n                    Property Rights therein. Provider shall not acquire any ownership interest in or rights to Customer\n                    Data, except for the limited license granted herein to perform the Services.{' '}\n                    <span className=\"bg-success/10 text-success text-success rounded px-1 py-0.5 font-medium underline decoration-emerald-500/40\">\n                      Under no circumstances shall Provider utilize, parse, vectorize, or ingest Customer Data,\n                      confidential telemetry, or user communications to train, fine-tune, or benchmark any public or\n                      proprietary artificial intelligence, large language, or algorithmic model without express prior\n                      written addendum.\n                    </span>\n                  </p>\n                </div>\n              </section>\n\n              {/* Section 4: Service Level Agreements */}\n              <section id=\"clause-4-2\" className=\"scroll-mt-6 space-y-3 pt-8\">\n                <div className=\"flex flex-wrap items-center justify-between gap-2\">\n                  <div className=\"flex items-center gap-2\">\n                    <h2 className=\"text-foreground text-sm font-bold tracking-tight sm:text-base\">\n                      Section 4 &bull; Service Level Agreements &amp; Availability Commitments\n                    </h2>\n                    <Badge\n                      wrap\n                      variant=\"outline\"\n                      className=\"border-warning/30 bg-warning/10 text-warning font-mono text-xs\"\n                    >\n                      [DIFF-4.2] &bull; 2 Pending Redlines\n                    </Badge>\n                  </div>\n                  <Button\n                    variant=\"outline\"\n                    size=\"sm\"\n                    className={cn(\n                      'h-7 gap-1.5 px-2.5 text-xs',\n                      activeCommentId === 'c-1'\n                        ? 'border-primary bg-primary/10 text-primary font-semibold'\n                        : 'text-muted-foreground',\n                    )}\n                    onClick={() => selectComment('c-1', 'clause-4-2')}\n                  >\n                    <MessageSquare className=\"text-warning size-3.5\" />\n                    <span>Comment #1 &bull; Sarah Lin</span>\n                  </Button>\n                </div>\n\n                <div\n                  className={cn(\n                    'border-border bg-card space-y-4 rounded-lg border p-4 text-xs leading-relaxed transition-colors sm:p-5 sm:text-sm',\n                    activeCommentId === 'c-1' ? 'ring-primary/40 ring-2' : '',\n                  )}\n                >\n                  <p className=\"text-foreground\">\n                    <strong className=\"text-foreground font-semibold\">4.1 Monthly Uptime Commitment.</strong>\n                    Provider warrants that the Production Cloud Service will achieve a Monthly Uptime Percentage of no\n                    less than{' '}\n                    <span className=\"bg-destructive/10 text-destructive text-destructive rounded px-1 py-0.5 font-medium line-through decoration-rose-500/60\">\n                      ninety-nine and one-half percent (99.5%)\n                    </span>{' '}\n                    <span className=\"bg-success/10 text-success text-success rounded px-1 py-0.5 font-medium underline decoration-emerald-500/40\">\n                      ninety-nine and ninety-five hundredths percent (99.95%)\n                    </span>{' '}\n                    during each calendar billing month of the applicable Order Term (&ldquo;Service Level\n                    Standard&rdquo;).\n                  </p>\n\n                  <p className=\"text-foreground\">\n                    <strong className=\"text-foreground font-semibold\">\n                      4.2 SLA Failure Remedies &amp; Maintenance Notice.\n                    </strong>\n                    If Provider fails to meet the Service Level Standard for any calendar month, Customer shall be\n                    entitled to an immediate credit against future invoices equal to{' '}\n                    <span className=\"bg-destructive/10 text-destructive text-destructive rounded px-1 py-0.5 font-medium line-through decoration-rose-500/60\">\n                      ten percent (10%)\n                    </span>{' '}\n                    <span className=\"bg-success/10 text-success text-success rounded px-1 py-0.5 font-medium underline decoration-emerald-500/40\">\n                      twenty-five percent (25%)\n                    </span>{' '}\n                    of the prorated monthly fees for such month. Scheduled Maintenance windows shall occur solely\n                    between 01:00 and 04:00 UTC on Sunday mornings and require no less than{' '}\n                    <span className=\"bg-destructive/10 text-destructive text-destructive rounded px-1 py-0.5 font-medium line-through decoration-rose-500/60\">\n                      forty-eight (48) hours\n                    </span>{' '}\n                    <span className=\"bg-success/10 text-success text-success rounded px-1 py-0.5 font-medium underline decoration-emerald-500/40\">\n                      seven (7) business days\n                    </span>{' '}\n                    advance electronic notice to Customer&rsquo;s Lead SRE contact.\n                  </p>\n                </div>\n              </section>\n\n              {/* Section 8: Limitation of Liability */}\n              <section id=\"clause-8-1\" className=\"scroll-mt-6 space-y-3 pt-8\">\n                <div className=\"flex flex-wrap items-center justify-between gap-2\">\n                  <div className=\"flex items-center gap-2\">\n                    <h2 className=\"text-foreground text-sm font-bold tracking-tight sm:text-base\">\n                      Section 8 &bull; Limitation of Liability &amp; Super-Cap Allocation\n                    </h2>\n                    <Badge\n                      wrap\n                      variant=\"outline\"\n                      className=\"border-destructive/30 bg-destructive/10 text-destructive font-mono text-xs font-semibold\"\n                    >\n                      [DIFF-8.1] &bull; HIGH IMPACT SHIFT\n                    </Badge>\n                  </div>\n                  <Button\n                    variant=\"outline\"\n                    size=\"sm\"\n                    className={cn(\n                      'h-7 gap-1.5 px-2.5 text-xs',\n                      activeCommentId === 'c-2'\n                        ? 'border-primary bg-primary/10 text-primary font-semibold'\n                        : 'text-muted-foreground',\n                    )}\n                    onClick={() => selectComment('c-2', 'clause-8-1')}\n                  >\n                    <MessageSquare className=\"text-destructive size-3.5\" />\n                    <span>Comment #2 &bull; Marcus Vance</span>\n                  </Button>\n                </div>\n\n                <div\n                  className={cn(\n                    'border-border bg-card space-y-4 rounded-lg border p-4 text-xs leading-relaxed transition-colors sm:p-5 sm:text-sm',\n                    activeCommentId === 'c-2' ? 'ring-primary/40 ring-2' : '',\n                  )}\n                >\n                  <p className=\"text-foreground font-mono text-xs leading-relaxed uppercase\">\n                    <strong className=\"text-foreground font-bold\">8.1 AGGREGATE LIABILITY CAP.</strong>\n                    EXCEPT FOR LIABILITIES ARISING FROM A BREACH OF CONFIDENTIALITY UNDER SECTION 6, FRAUD, OR\n                    INDEMNIFICATION OBLIGATIONS UNDER SECTION 10, NEITHER PARTY&rsquo;S MAXIMUM AGGREGATE LIABILITY\n                    UNDER THIS AGREEMENT SHALL EXCEED{' '}\n                    <span className=\"bg-destructive/10 text-destructive text-destructive rounded px-1 py-0.5 font-medium line-through decoration-rose-500/60\">\n                      THE TOTAL FEES ACTUALLY PAID BY CUSTOMER TO PROVIDER IN THE TWELVE (12) MONTHS PRECEDING THE EVENT\n                      GIVING RISE TO LIABILITY.\n                    </span>{' '}\n                    <span className=\"bg-success/10 text-success text-success rounded px-1 py-0.5 font-medium underline decoration-emerald-500/40\">\n                      THE GREATER OF TWO MILLION FIVE HUNDRED THOUSAND UNITED STATES DOLLARS ($2,500,000 USD) OR TWO AND\n                      ONE-HALF TIMES (2.5X) THE AGGREGATE FEES PAYABLE OVER THE ENTIRE ORDER FORM DURATION\n                      (&ldquo;SUPER-CAP&rdquo;).\n                    </span>\n                  </p>\n\n                  <p className=\"text-foreground\">\n                    <strong className=\"text-foreground font-semibold\">8.2 Direct Damages Carve-Out.</strong>\n                    Notwithstanding anything to the contrary, the mutual waiver of consequential damages in Section 8.3\n                    shall not preclude or limit recovery of{' '}\n                    <span className=\"bg-success/10 text-success text-success rounded px-1 py-0.5 font-medium underline decoration-emerald-500/40\">\n                      reasonable third-party forensic incident investigation expenses, statutory breach notification\n                      mailings, and credit monitoring services required under GDPR, HIPAA, or State Data Privacy laws.\n                    </span>\n                  </p>\n                </div>\n              </section>\n\n              {/* Section 12: Governing Law & Arbitration */}\n              <section id=\"clause-12-3\" className=\"scroll-mt-6 space-y-3 pt-8\">\n                <div className=\"flex flex-wrap items-center justify-between gap-2\">\n                  <div className=\"flex items-center gap-2\">\n                    <h2 className=\"text-foreground text-sm font-bold tracking-tight sm:text-base\">\n                      Section 12 &bull; Governing Law, Venue &amp; Arbitration\n                    </h2>\n                    <Badge\n                      wrap\n                      variant=\"outline\"\n                      className=\"border-primary/30 bg-primary/10 text-primary font-mono text-xs\"\n                    >\n                      [DIFF-12.3] &bull; Modified Venue\n                    </Badge>\n                  </div>\n                  <Button\n                    variant=\"outline\"\n                    size=\"sm\"\n                    className={cn(\n                      'h-7 gap-1.5 px-2.5 text-xs',\n                      activeCommentId === 'c-3'\n                        ? 'border-primary bg-primary/10 text-primary font-semibold'\n                        : 'text-muted-foreground',\n                    )}\n                    onClick={() => selectComment('c-3', 'clause-12-3')}\n                  >\n                    <MessageSquare className=\"text-primary size-3.5\" />\n                    <span>Comment #3 &bull; Elena Rostova</span>\n                  </Button>\n                </div>\n\n                <div\n                  className={cn(\n                    'border-border bg-card space-y-4 rounded-lg border p-4 text-xs leading-relaxed transition-colors sm:p-5 sm:text-sm',\n                    activeCommentId === 'c-3' ? 'ring-primary/40 ring-2' : '',\n                  )}\n                >\n                  <p className=\"text-foreground\">\n                    <strong className=\"text-foreground font-semibold\">12.1 Applicable Law.</strong>\n                    This Agreement shall be governed by, construed, and enforced in accordance with the substantive laws\n                    of the State of Delaware, without reference to its conflict-of-law principles.\n                  </p>\n\n                  <p className=\"text-foreground\">\n                    <strong className=\"text-foreground font-semibold\">\n                      12.3 Binding Commercial Arbitration &amp; Fee Recovery.\n                    </strong>\n                    Any controversy, dispute, or claim arising out of or relating to this Agreement, or the breach\n                    thereof, shall be resolved by{' '}\n                    <span className=\"bg-destructive/10 text-destructive text-destructive rounded px-1 py-0.5 font-medium line-through decoration-rose-500/60\">\n                      the state or federal courts situated in Wilmington, Delaware.\n                    </span>{' '}\n                    <span className=\"bg-success/10 text-success text-success rounded px-1 py-0.5 font-medium underline decoration-emerald-500/40\">\n                      binding arbitration administered by the American Arbitration Association (AAA) in accordance with\n                      its Commercial Arbitration Rules, before a single neutral arbitrator seated in the City and State\n                      of New York.\n                    </span>{' '}\n                    <span className=\"bg-success/10 text-success text-success rounded px-1 py-0.5 font-medium underline decoration-emerald-500/40\">\n                      The prevailing party in any proceeding to enforce or interpret this Agreement shall be entitled to\n                      recover from the non-prevailing party all reasonable attorneys&rsquo; fees, arbitrator\n                      compensation, and expert witness disbursements incurred in connection therewith.\n                    </span>\n                  </p>\n                </div>\n              </section>\n            </div>\n          </div>\n        </main>\n\n        {/* Right Column: Attorney Comments & Negotiations Sidebar */}\n        <aside className=\"space-y-4 lg:sticky lg:top-6 lg:col-span-4\">\n          <div className=\"border-border bg-card space-y-4 rounded-xl border p-4 shadow-xs\">\n            {/* Sidebar Header */}\n            <div className=\"flex items-center justify-between pb-1\">\n              <div className=\"flex items-center gap-2\">\n                <MessageSquare className=\"text-primary size-4\" aria-hidden=\"true\" />\n                <h2 className=\"text-foreground text-sm font-bold tracking-tight\">Counsel Comments &amp; Markups</h2>\n              </div>\n              <span className=\"text-muted-foreground font-mono text-xs font-medium\">\n                {filteredComments.length} items\n              </span>\n            </div>\n\n            {/* Filter Pills */}\n            <div className=\"bg-muted/60 flex items-center gap-1.5 rounded-lg p-1\">\n              <button\n                type=\"button\"\n                className={cn(\n                  'focus-visible:ring-ring flex-1 rounded-md px-2 py-1 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                  selectedFilter === 'all'\n                    ? 'bg-background text-foreground font-semibold shadow-xs'\n                    : 'text-muted-foreground hover:text-foreground',\n                )}\n                onClick={() => setSelectedFilter('all')}\n              >\n                All ({comments.length})\n              </button>\n              <button\n                type=\"button\"\n                className={cn(\n                  'focus-visible:ring-ring flex-1 rounded-md px-2 py-1 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                  selectedFilter === 'pending'\n                    ? 'bg-background text-foreground font-semibold shadow-xs'\n                    : 'text-muted-foreground hover:text-foreground',\n                )}\n                onClick={() => setSelectedFilter('pending')}\n              >\n                Pending ({pendingCount})\n              </button>\n              <button\n                type=\"button\"\n                className={cn(\n                  'focus-visible:ring-ring flex-1 rounded-md px-2 py-1 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                  selectedFilter === 'resolved'\n                    ? 'bg-background text-foreground font-semibold shadow-xs'\n                    : 'text-muted-foreground hover:text-foreground',\n                )}\n                onClick={() => setSelectedFilter('resolved')}\n              >\n                Resolved ({resolvedCount})\n              </button>\n            </div>\n\n            <Separator />\n\n            {/* Comments Feed */}\n            <div className=\"space-y-3.5\">\n              {filteredComments.map((comment) => (\n                <Card\n                  key={comment.id}\n                  role=\"button\"\n                  tabIndex={0}\n                  aria-pressed={activeCommentId === comment.id}\n                  className={cn(\n                    'border-border hover:border-primary/40 focus-visible:ring-ring cursor-pointer transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                    activeCommentId === comment.id ? 'border-primary/60 bg-muted/20 ring-primary/30 ring-1' : 'bg-card',\n                    comment.status === 'resolved' ? 'opacity-75' : '',\n                  )}\n                  onClick={() => selectComment(comment.id, comment.clauseId)}\n                  onKeyDown={(e) => {\n                    if (e.target === e.currentTarget && (e.key === 'Enter' || e.key === ' ')) {\n                      e.preventDefault()\n                      selectComment(comment.id, comment.clauseId)\n                    }\n                  }}\n                >\n                  <CardHeader className=\"p-3.5 pb-2\">\n                    <div className=\"flex flex-wrap items-start justify-between gap-2\">\n                      <div className=\"flex items-center gap-2.5\">\n                        <Avatar className=\"border-border size-7 border\">\n                          <AvatarFallback className=\"bg-primary/10 text-primary font-mono text-xs font-bold\">\n                            {comment.authorInitials}\n                          </AvatarFallback>\n                        </Avatar>\n                        <div>\n                          <p className=\"text-foreground text-xs leading-none font-semibold\">{comment.authorName}</p>\n                          <p className=\"text-muted-foreground mt-0.5 max-w-[170px] truncate text-xs\">\n                            {comment.authorRole}\n                          </p>\n                        </div>\n                      </div>\n\n                      <Badge\n                        wrap\n                        variant=\"outline\"\n                        className={cn(\n                          'shrink-0 font-mono text-xs',\n                          comment.status === 'resolved'\n                            ? 'border-success/30 bg-success/10 text-success'\n                            : 'border-warning/30 bg-warning/10 text-warning',\n                        )}\n                      >\n                        {comment.status === 'resolved' ? 'Resolved' : 'Pending'}\n                      </Badge>\n                    </div>\n                  </CardHeader>\n\n                  <CardContent className=\"space-y-2.5 p-3.5 pt-0 text-xs\">\n                    {/* Clause context pill */}\n                    <div className=\"bg-muted/50 text-muted-foreground rounded px-2 py-1 font-mono text-xs\">\n                      {comment.clauseTitle}\n                    </div>\n\n                    {/* Comment narrative */}\n                    <p className=\"text-foreground leading-relaxed\">&ldquo;{comment.commentText}&rdquo;</p>\n\n                    {/* Proposed change box */}\n                    <div className=\"border-success/20 bg-success/5 rounded border p-2 text-xs\">\n                      <span className=\"text-success mb-0.5 block font-semibold\">Proposed Redline Tweak:</span>\n                      <span className=\"text-muted-foreground\">{comment.proposedChange}</span>\n                    </div>\n\n                    <div className=\"text-muted-foreground flex items-center justify-between pt-1 text-xs\">\n                      <span className=\"flex items-center gap-1\">\n                        <Clock className=\"size-3\" aria-hidden=\"true\" />\n                        {comment.timestamp}\n                      </span>\n                    </div>\n                  </CardContent>\n\n                  <CardFooter className=\"border-border bg-muted/10 flex items-center justify-between gap-2 border-t p-2.5\">\n                    <Button\n                      variant=\"outline\"\n                      size=\"sm\"\n                      className=\"h-7 gap-1 text-xs\"\n                      onClick={(e) => {\n                        e.stopPropagation()\n                        toggleReply(comment.id)\n                      }}\n                    >\n                      <MessageSquareReply className=\"text-muted-foreground size-3\" aria-hidden=\"true\" />\n                      <span>Reply</span>\n                    </Button>\n\n                    <Button\n                      variant={comment.status === 'resolved' ? 'outline' : 'default'}\n                      size=\"sm\"\n                      className={cn(\n                        'h-7 gap-1 text-xs',\n                        comment.status === 'resolved' ? 'text-muted-foreground' : 'font-medium',\n                      )}\n                      onClick={(e) => {\n                        e.stopPropagation()\n                        toggleAcceptTweak(comment.id)\n                      }}\n                    >\n                      <Check className=\"size-3\" aria-hidden=\"true\" />\n                      <span>{comment.status === 'resolved' ? 'Reopen' : 'Accept Tweak'}</span>\n                    </Button>\n                  </CardFooter>\n\n                  {/* Inline Thread Reply Input */}\n                  {replyingCommentId === comment.id && (\n                    <div\n                      className=\"border-border bg-background space-y-2 border-t p-3\"\n                      onClick={(e) => e.stopPropagation()}\n                    >\n                      <textarea\n                        value={replyDraftText}\n                        onChange={(e) => setReplyDraftText(e.target.value)}\n                        placeholder=\"Draft reply to counsel thread...\"\n                        className=\"border-border bg-card placeholder:text-muted-foreground focus-visible:ring-ring w-full resize-none rounded-md border p-2 text-xs focus-visible:ring-2 focus-visible:outline-none\"\n                        rows={2}\n                      />\n                      <div className=\"flex items-center justify-end gap-2\">\n                        <Button\n                          variant=\"ghost\"\n                          size=\"sm\"\n                          className=\"h-6 px-2 text-xs\"\n                          onClick={() => setReplyingCommentId(null)}\n                        >\n                          Cancel\n                        </Button>\n                        <Button\n                          variant=\"default\"\n                          size=\"sm\"\n                          className=\"h-6 gap-1 px-2.5 text-xs font-semibold\"\n                          onClick={() => submitReply(comment.id)}\n                        >\n                          <Send className=\"size-3\" aria-hidden=\"true\" />\n                          <span>Send</span>\n                        </Button>\n                      </div>\n                    </div>\n                  )}\n                </Card>\n              ))}\n            </div>\n          </div>\n        </aside>\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/ContractRedlineDiff.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/avatar.json",
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/separator.json"
  ],
  "description": "Ironclad and DocuSign CLM style legal contract redline diff viewer with clause additions, deletions, liability super-cap shift analysis, and attorney comments negotiations sidebar.",
  "categories": [
    "legal",
    "app",
    "management"
  ]
}