/* global React, CiteChip, ArtChip, Stamp, Redact, useRunSequence */ const { useState, useEffect, useRef, useMemo } = React; /* ============================================================================ ASK — source-grounded legal question ============================================================================ */ const ASK_SUGGESTIONS = [ "What weight does Barneloven §31 give to a child's stated preference?", "Under ECHR Art. 8, what reunification duty does Norway owe after a care order?", "Does Abdi Ibrahim v. Norway (2021) require religious matching of foster parents?", "What contact frequency post-care-order has Strasbourg found compatible with Art. 8?", ]; function AskView({ onTrace, lang, setLang }) { const [q, setQ] = useState(ASK_SUGGESTIONS[0]); const [running, setRunning] = useState(false); const [done, setDone] = useState(false); const [highlight, setHighlight] = useState(null); const { run } = useRunSequence(); function go() { if (running) return; setRunning(true); setDone(false); setHighlight(null); onTrace([]); const seq = [ { delay: 400, step: { label: "Query interpreted", detail: "ECHR Art. 8 reunification duty · Barneloven §43 · post-care-order contact", status: "" } }, { delay: 1200, step: { label: "Hybrid retrieval", detail: "Vector + BM25 · 24 candidates · reciprocal rank fusion · 7 selected", status: "" } }, { delay: 1000, step: { label: "Reviewer pass running", detail: "Cross-checking every claim against retrieved Strasbourg + Lovdata chunks", status: "running" } }, { delay: 1400, step: { label: "Reviewer: approved", detail: "All claims supported. Strand Lobben (2019) and Pedersen (2020) cited.", status: "" } }, { delay: 700, step: { label: "Uncertainty noted", detail: "Post-2024 amendments to Barnevernsloven may not yet be indexed.", status: "warning" } }, ]; let acc = []; run(seq, (st, idx, last) => { acc = [...acc.map(s => s.status === "running" ? { ...s, status: "" } : s), st]; onTrace([...acc]); if (last) { setRunning(false); setDone(true); } }); } return (

Source-grounded ask · ECHR + Lovdata

Ask a legal question

Reviewer on