'use client'; import { useId } from 'react'; import { FACTIONS } from '@/game/catalog'; import { territory } from '@/game/board'; import { knowledgeFactInputError, SPICE_PEEK_VALUES, type KnowledgeFact } from '@/game/truthtrance-knowledge'; import { TRUTH_CARD_NAMES } from '@/game/truthtrance-card-names'; import { Input } from '@/components/ui/input'; type NumericKnowledgeFact = Exclude; function isNumericKnowledgeFact(fact: KnowledgeFact): fact is NumericKnowledgeFact { return fact.kind !== 'spicePeek' && fact.kind !== 'auctionPeek' && fact.kind !== 'ixPoolPeek' && (fact.kind !== 'prediction' || fact.field === 'turn'); } export function KnowledgeFactFields({ value, onChange, }: { value: KnowledgeFact; onChange: (fact: KnowledgeFact) => void; }) { const id = useId(); const isFaction = value.kind === 'prediction' && value.field === 'faction'; const numericValue = isNumericKnowledgeFact(value) ? value : null; const isTurn = numericValue?.kind === 'prediction' && numericValue.field === 'turn'; const min = isTurn ? 1 : numericValue?.kind === 'stormForecast' ? 1 : 0; const max = isTurn ? 10 : numericValue?.kind === 'stormForecast' ? 6 : 20; const invalid = knowledgeFactInputError(value); return ( <> {value.kind === 'ixPoolPeek' ? ( <>

In Basic Bidding, this asks whether the named card is in the Ixian’s recorded inspected auction pool. If that knowledge is unavailable, the answer is I don’t know. Only the answer is published; the pool itself remains private.

) : value.kind === 'auctionPeek' ? ( <>

This asks about the current ordinary auction card the target has privately inspected. If no current card is known, the answer is I don’t know. Only the answer is published.

) : value.kind === 'spicePeek' ? ( <>

This asks about the card the target currently knows from their private Spice Blow peek. If no card is known, the answer is I don’t know. Only the answer is published.

) : isFaction ? ( ) : numericValue && ( <> {(isTurn || numericValue.kind === 'stormDial' || numericValue.kind === 'stormForecast') && ( )}

This asks about an already recorded choice or a forecast the target currently knows. If no such value is available, the answer is I don’t know. Only the answer is published.

)} {isFaction &&

This asks about an already recorded faction choice. If no such value is available, the answer is I don’t know. Only the answer is published.

} {invalid && } ); }