@rr0/ufoathome 0.122.0 → 0.123.1

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/README.md CHANGED
@@ -20,7 +20,7 @@ The project's history is in the [Wiki](https://github.com/RR0/UfoAtHome/wiki).
20
20
 
21
21
  ## Setup
22
22
 
23
- Node ≥ 20 (the site is built on Node 22, pinned in [`netlify.toml`](netlify.toml)).
23
+ Node ≥ 20 (Node 22 recommended, as pinned in [`netlify.toml`](netlify.toml)).
24
24
 
25
25
  ```bash
26
26
  git clone https://github.com/RR0/UfoAtHome.git
@@ -227,7 +227,8 @@ headed Chromium, hence outside the sandbox. Change the interface, retake the sho
227
227
  1. `npm test`, then `npm run build:site` and check the result with `npm run site:serve`.
228
228
  2. `npm version <patch|minor> --no-git-tag-version`, commit the bump as `<version>`.
229
229
  3. `npm publish` (`prepublishOnly` rebuilds the schema and the three embeds, and runs the tests).
230
- 4. `git push`: Netlify rebuilds ufoathome.org from `master` ([`netlify.toml`](netlify.toml)).
230
+ 4. `git push`, then `npm run deploy:site`: the site is built locally and uploaded to ufoathome.org (Netlify's git
231
+ builds are stopped, so a push alone deploys nothing). Needs `netlify login` or `NETLIFY_AUTH_TOKEN`.
231
232
  5. If demo recordings changed, `npm run sync:cases` and deploy rr0.org.
232
233
 
233
234
  ## License
@@ -1 +1 @@
1
- const e={title:"Título",time:"Fecha",by:"Entrevistador",medium:"Medio",witness:"Testigo",witnessNone:"—",summary:"Descripción",transcript:"Transcripción",transcriptHint:"Dirección del archivo de transcripción anonimizada (opcional)",summaryTab:"Resumen",fileTab:"Archivo",importFile:"Cargar un archivo (JSON, texto, WebVTT, SRT)",importUrl:"O desde una dirección",importButton:"Cargar",saveButton:"Guardar",loading:"Cargando la transcripción…",invalid:"Este texto aún no es JSON válido: la entrevista conserva la última transcripción que entendió.",notATranscript:"Ese archivo no es una transcripción de entrevista (no tiene turnos de palabra).",loadFailed:"No se pudo leer esa transcripción.",editorLabel:"Transcripción de la entrevista en JSON",byHint:"Identificadores de personas de RR0, separados por comas",exchangesTab:"Intercambios",exchangesEmpty:"Todavía no se ha dicho nada.",redacted:"Pasaje eliminado",proofreadAll:"Revisado por todos.",proofreadPending:"Aún no revisado por: {names}"};export{e as interviewMessages_es};
1
+ const e={title:"Título",time:"Fecha",by:"Entrevistador",medium:"Medio",witness:"Testigo",witnessNone:"—",summary:"Descripción",transcript:"Transcripción",transcriptHint:"Dirección del archivo de transcripción anonimizada (opcional)",summaryTab:"Resumen",fileTab:"Archivo",importFile:"Cargar un archivo (JSON, texto, WebVTT, SRT)",importUrl:"O desde una dirección",importButton:"Cargar",saveButton:"Guardar",loading:"Cargando la transcripción…",invalid:"Este texto aún no es JSON válido: la entrevista conserva la última transcripción que entendió.",notATranscript:"Ese archivo no es una transcripción de entrevista (no tiene turnos de palabra).",loadFailed:"No se pudo leer esa transcripción.",editorLabel:"Transcripción de la entrevista en JSON",byHint:"Identificadores de personas de RR0, separados por comas",exchangesTab:"Intercambios",exchangesEmpty:"Todavía no se ha dicho nada.",redacted:"Pasaje eliminado",proofreadAll:"Revisado por todos.",proofreadPending:"Aún no revisado por: {names}",roles:{interviewer:"Entrevistador",interviewee:"Entrevistado",witness:"Testigo"}};export{e as interviewMessages_es};
@@ -1 +1 @@
1
- const e={title:"Titre",time:"Date",by:"Enquêteur",medium:"Moyen",witness:"Témoin",witnessNone:"—",summary:"Description",transcript:"Transcription",transcriptHint:"Adresse du fichier de transcription anonymisée (facultative)",summaryTab:"Résumé",fileTab:"Fichier",importFile:"Charger un fichier (JSON, texte, WebVTT, SRT)",importUrl:"Ou depuis une adresse",importButton:"Charger",saveButton:"Sauver",loading:"Chargement de la transcription…",invalid:"Ce texte n'est pas encore du JSON valide : l'interview garde la dernière transcription qu'elle a comprise.",notATranscript:"Ce fichier n'est pas une transcription d'interview (il n'a pas de tours de parole).",loadFailed:"Cette transcription n'a pas pu être lue.",editorLabel:"Transcription de l'interview en JSON",byHint:"Identifiants de personnes RR0, séparés par des virgules",exchangesTab:"Échanges",exchangesEmpty:"Rien n'a encore été dit.",redacted:"Passage retiré",proofreadAll:"Relu par tous les participants.",proofreadPending:"Pas encore relu par : {names}"};export{e as interviewMessages_fr};
1
+ const e={title:"Titre",time:"Date",by:"Enquêteur",medium:"Moyen",witness:"Témoin",witnessNone:"—",summary:"Description",transcript:"Transcription",transcriptHint:"Adresse du fichier de transcription anonymisée (facultative)",summaryTab:"Résumé",fileTab:"Fichier",importFile:"Charger un fichier (JSON, texte, WebVTT, SRT)",importUrl:"Ou depuis une adresse",importButton:"Charger",saveButton:"Sauver",loading:"Chargement de la transcription…",invalid:"Ce texte n'est pas encore du JSON valide : l'interview garde la dernière transcription qu'elle a comprise.",notATranscript:"Ce fichier n'est pas une transcription d'interview (il n'a pas de tours de parole).",loadFailed:"Cette transcription n'a pas pu être lue.",editorLabel:"Transcription de l'interview en JSON",byHint:"Identifiants de personnes RR0, séparés par des virgules",exchangesTab:"Échanges",exchangesEmpty:"Rien n'a encore été dit.",redacted:"Passage retiré",proofreadAll:"Relu par tous les participants.",proofreadPending:"Pas encore relu par : {names}",roles:{interviewer:"Intervieweur",interviewee:"Interviewé",witness:"Témoin"}};export{e as interviewMessages_fr};
@@ -1 +1 @@
1
- const i={title:"Titolo",time:"Data",by:"Intervistatore",medium:"Mezzo",witness:"Testimone",witnessNone:"—",summary:"Descrizione",transcript:"Trascrizione",transcriptHint:"Indirizzo del file di trascrizione anonimizzata (facoltativo)",summaryTab:"Riepilogo",fileTab:"File",importFile:"Carica un file (JSON, testo, WebVTT, SRT)",importUrl:"O da un indirizzo",importButton:"Carica",saveButton:"Salva",loading:"Caricamento della trascrizione…",invalid:"Questo testo non è ancora JSON valido: l'intervista conserva l'ultima trascrizione che ha capito.",notATranscript:"Quel file non è una trascrizione di intervista (non ha turni di parola).",loadFailed:"Impossibile leggere quella trascrizione.",editorLabel:"Trascrizione dell'intervista in JSON",byHint:"Identificatori di persone RR0, separati da virgole",exchangesTab:"Scambi",exchangesEmpty:"Non è stato ancora detto nulla.",redacted:"Passaggio rimosso",proofreadAll:"Rivisto da tutti.",proofreadPending:"Non ancora rivisto da: {names}"};export{i as interviewMessages_it};
1
+ const i={title:"Titolo",time:"Data",by:"Intervistatore",medium:"Mezzo",witness:"Testimone",witnessNone:"—",summary:"Descrizione",transcript:"Trascrizione",transcriptHint:"Indirizzo del file di trascrizione anonimizzata (facoltativo)",summaryTab:"Riepilogo",fileTab:"File",importFile:"Carica un file (JSON, testo, WebVTT, SRT)",importUrl:"O da un indirizzo",importButton:"Carica",saveButton:"Salva",loading:"Caricamento della trascrizione…",invalid:"Questo testo non è ancora JSON valido: l'intervista conserva l'ultima trascrizione che ha capito.",notATranscript:"Quel file non è una trascrizione di intervista (non ha turni di parola).",loadFailed:"Impossibile leggere quella trascrizione.",editorLabel:"Trascrizione dell'intervista in JSON",byHint:"Identificatori di persone RR0, separati da virgole",exchangesTab:"Scambi",exchangesEmpty:"Non è stato ancora detto nulla.",redacted:"Passaggio rimosso",proofreadAll:"Rivisto da tutti.",proofreadPending:"Non ancora rivisto da: {names}",roles:{interviewer:"Intervistatore",interviewee:"Intervistato",witness:"Testimone"}};export{i as interviewMessages_it};
@@ -0,0 +1,34 @@
1
+ class w{constructor(e){this.preferences=e}read(e){if(e===void 0||typeof e=="string")return e===""?void 0:e;for(const t of this.preferences){const s=e[t]??e[w.base(t)];if(s)return s}const r=new Set(this.preferences.map(t=>w.base(t)));for(const[t,s]of Object.entries(e))if(s&&r.has(w.base(t)))return s;return Object.values(e).find(t=>t)??void 0}write(e,r,t){const s=r?.trim()?r.trim():void 0;if(e===void 0||typeof e=="string")return s;const n={...e},a=Object.keys(n).find(o=>o===t)??Object.keys(n).find(o=>w.base(o)===w.base(t))??t;return s===void 0?delete n[a]:n[a]=s,Object.keys(n).length===0?void 0:n}static base(e){return e.toLowerCase().split("-")[0]}}class b extends Error{constructor(e,r,t){super(`${e}: ${r}${t===void 0?"":` (HTTP ${t})`}`),this.kind=e,this.url=r,this.status=t,this.name="SightingFetchError"}}class x{static async json(e){const r=new URL(e,location.href);if(location.protocol==="https:"&&r.protocol==="http:")throw new b("mixed-content",e);let t;try{t=await fetch(e)}catch{throw await this.diagnose(e,r)}if(!t.ok)throw new b("status",e,t.status);try{return await t.json()}catch{throw new b("malformed",e)}}static async diagnose(e,r){if(r.origin===location.origin)return new b("unreachable",e);try{return await fetch(e,{mode:"no-cors"}),new b("cors",e)}catch{return new b("unreachable",e)}}}function A(u,e){for(const r of u){const t=r.toLowerCase().split("-")[0];if(e.includes(t))return t}return"en"}class ${static preferencesFor(e){const r=navigator.languages??[],t=this.declaredFor(e);return t?[t,...r]:r}static declaredFor(e){for(let r=e;r;){const t=r.closest("[lang]")?.getAttribute("lang")?.trim();if(t)return t;const s=r.getRootNode();r=s instanceof ShadowRoot?s.host:void 0}}}const M="modulepreload",O=function(u,e){return new URL(u,e).href},L={},y=function(e,r,t){let s=Promise.resolve();if(r&&r.length>0){let a=function(c){return Promise.all(c.map(f=>Promise.resolve(f).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const o=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),i=h?.nonce||h?.getAttribute("nonce");s=a(r.map(c=>{if(c=O(c,t),c in L)return;L[c]=!0;const f=c.endsWith(".css"),d=f?'[rel="stylesheet"]':"";if(!!t)for(let l=o.length-1;l>=0;l--){const g=o[l];if(g.href===c&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${d}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":M,f||(m.as="script"),m.crossOrigin="",m.href=c,i&&m.setAttribute("nonce",i),document.head.appendChild(m),f)return new Promise((l,g)=>{m.addEventListener("load",l),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function n(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&n(o.reason);return e().catch(n)})},R=["en","fr","es","it"],j={en:()=>y(()=>Promise.resolve().then(()=>P),void 0,import.meta.url).then(u=>u.interviewMessages_en),fr:()=>y(()=>import("./InterviewMessages_fr-CmScqfza.js"),[],import.meta.url).then(u=>u.interviewMessages_fr),es:()=>y(()=>import("./InterviewMessages_es-D5d2JVA3.js"),[],import.meta.url).then(u=>u.interviewMessages_es),it:()=>y(()=>import("./InterviewMessages_it-2SNw5xMp.js"),[],import.meta.url).then(u=>u.interviewMessages_it)};function C(u){return j[u]()}const E={title:"Title",time:"When",by:"Interviewer",medium:"Medium",witness:"Witness",witnessNone:"—",summary:"Description",transcript:"Transcript",transcriptHint:"Address of the anonymised transcript file (optional)",summaryTab:"Summary",fileTab:"File",importFile:"Load a file (JSON, text, WebVTT, SRT)",importUrl:"Or load from URL",importButton:"Load",saveButton:"Save",loading:"Loading the transcript…",invalid:"This text is not valid JSON yet: the interview keeps the last transcript it understood.",notATranscript:"That file is not an interview transcript (it has no segments).",loadFailed:"That transcript could not be read.",editorLabel:"Interview transcript as JSON",byHint:"RR0 people ids, separated by commas",exchangesTab:"Exchanges",exchangesEmpty:"Nothing was said yet.",redacted:"Passage removed",proofreadAll:"Proofread by everyone.",proofreadPending:"Not proofread yet by: {names}",roles:{interviewer:"Interviewer",interviewee:"Interviewee",witness:"Witness"}},P=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:E},Symbol.toStringTag,{value:"Module"})),_="interviewseek";class p{static isProofread(e){const r=Object.keys(e.speakers);return r.length>0&&r.every(t=>{const s=e.proofreading?.[t]?.status;return s==="approved"||s==="covered"})}static said(e){return e.parts?e.parts.map(r=>"redacted"in r?"…":p.plain(r.text)).join(" "):e.redacted?void 0:p.plain(e.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(e){return/[<&]/.test(e)?e.replace(/<br\s*\/?>/gi,`
2
+ `).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(r,t)=>String.fromCodePoint(parseInt(t,16))).replace(/&#(\d+);/g,(r,t)=>String.fromCodePoint(Number(t))).replace(/&(\w+);/g,(r,t)=>p.ENTITIES[t.toLowerCase()]??r):e}static sightingsOf(e){return[e.interviewOf].flat().filter(r=>typeof r=="string")}static passagesAbout(e,r){const t=p.sightingsOf(e),s=[];return e.segments.forEach((n,a)=>{for(const o of n.refs??[]){if(o.sighting===void 0?!t.includes(r):o.sighting!==r)continue;const h=p.said(n);s.push({index:a,speaker:n.speaker,at:o.at,...h!==void 0?{text:h}:{},...o.range?{range:o.range}:{}})}}),s.sort((n,a)=>n.at-a.at||n.index-a.index)}static clock(e,r=!1){const t=Math.round(e*10),s=Math.floor(t/10),n=h=>String(h).padStart(2,"0"),a=Math.floor(s/3600),o=`${a>0||r?n(Math.floor(s/60)%60):Math.floor(s/60)}:${n(s%60)}`;return`${a>0?`${a}:`:""}${o}${r||t%10!==0?`.${t%10}`:""}`}static speakerName(e,r){const t=e.speakers[r];if(!t)return r;const s=typeof t.title=="string"?t.title:t.title?Object.values(t.title)[0]:void 0;return s||t.by&&p.agentName(t.by)||t.role}static agentName(e){if("people"in e){const[r,...t]=e.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...t,r].join(" ")}return"org"in e?e.org:e.title??""}static stamp(e){const r=Math.round(e*1e3),t=(s,n=2)=>String(s).padStart(n,"0");return`${t(Math.floor(r/36e5))}:${t(Math.floor(r/6e4)%60)}:${t(Math.floor(r/1e3)%60)}.${t(r%1e3,3)}`}static toVtt(e){const r=n=>n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=e.segments.filter(n=>n.start!==void 0);return`WEBVTT
3
+
4
+ ${t.map((n,a)=>{const o=t[a+1],h=n.end??o?.start??n.start+5,i=o&&o.start<h?Math.max(n.start,o.start):h;return`${p.stamp(n.start)} --> ${p.stamp(i)}
5
+ <v ${r(p.speakerName(e,n.speaker))}>${r(p.said(n)??"[…]")}`}).join(`
6
+
7
+ `)}
8
+ `}}const S="rr0-interview",I=`
9
+ rr0-interview { display: block; --rr0-interview-line: color-mix(in srgb, currentColor 35%, transparent); }
10
+ rr0-interview [hidden] { display: none !important; }
11
+ rr0-interview .rr0-interview-status { font-size: .85em; opacity: .85; margin: 0 0 .5em; }
12
+ /* Scrolling only where a height is asked for: a box that scrolls keeps clear of the page's floated figures for all its height. */
13
+ rr0-interview .rr0-interview-turns { max-height: var(--rr0-interview-max-height, none); overflow-y: var(--rr0-interview-overflow, visible); }
14
+ rr0-interview .turn { position: relative; padding: .2em .5em; margin: 0 0 .4em; border-left: 3px solid var(--speaker); --speaker: hsl(var(--speaker-hue, 0) 55% 38%); }
15
+ @media (prefers-color-scheme: dark) { rr0-interview .turn { --speaker: hsl(var(--speaker-hue, 0) 65% 70%); } }
16
+ rr0-interview .turn { transition: background-color .15s; }
17
+ rr0-interview .turn:hover { background: color-mix(in srgb, var(--speaker) 7%, transparent); }
18
+ rr0-interview .turn.flash { background: color-mix(in srgb, #fc3 28%, transparent); }
19
+ rr0-interview .turn .who { font-size: .85em; font-weight: 600; color: var(--speaker); overflow-wrap: anywhere; }
20
+ rr0-interview .turn.is-redacted .who, rr0-interview .turn.goes-on .who { display: none; }
21
+ rr0-interview .turn.goes-on { margin-top: -.4em; padding-top: .6em; }
22
+ rr0-interview .turn .said, rr0-interview .turn .redacted { margin: 0; padding: 0; text-indent: 0; white-space: pre-wrap; }
23
+ rr0-interview .turn .said::before, rr0-interview .turn .said::after { content: none; }
24
+ /* Tooltips drawn here rather than left to the browser's own, which some hosts (an embedded pane) never show. */
25
+ rr0-interview .turn[data-time]:hover:not(:has(.bar:hover, .bar:focus, .said a:hover))::after { content: attr(data-time); position: absolute; right: .3em; top: .2em; z-index: 2;
26
+ padding: 0 .4em; border-radius: 3px; font-size: .8em; font-variant-numeric: tabular-nums; background: #222; color: #fff; pointer-events: none; }
27
+ rr0-interview .bar { position: relative; display: inline-block; width: 3em; height: .9em; vertical-align: -.1em; border-radius: 2px; background: currentColor; margin: 0 .2em; cursor: help; }
28
+ rr0-interview .bar::after { content: attr(data-tip); display: none; position: absolute; left: 0; top: 1.4em; z-index: 3; width: max-content; max-width: 22em; padding: .3em .5em;
29
+ border-radius: 4px; background: #222; color: #fff; font-size: .85em; line-height: 1.3; white-space: normal; }
30
+ rr0-interview .bar:hover::after, rr0-interview .bar:focus::after { display: block; }
31
+ rr0-interview .turn .refs { display: flex; flex-wrap: wrap; gap: .25em; }
32
+ rr0-interview .turn .ref { font: inherit; font-size: .8em; cursor: pointer; border: 1px solid var(--rr0-interview-line); border-radius: 999px; background: transparent; color: inherit;
33
+ padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; }
34
+ `;class N extends HTMLElement{messages=E;said=new w(["en"]);localeToken=0;loadToken=0;json;loading;base;status=document.createElement("p");turns=document.createElement("div");blocks=new Map;constructor(){super(),this.status.className="rr0-interview-status",this.status.setAttribute("role","status"),this.turns.className="rr0-interview-turns"}static get observedAttributes(){return["src"]}attributeChangedCallback(e,r,t){e==="src"&&t!==r&&this.isConnected&&this.load()}connectedCallback(){N.styleRoot(this.getRootNode()),this.contains(this.turns)||this.replaceChildren(this.status,this.turns),this.loadLocale(),this.hasAttribute("src")&&this.json===void 0&&this.loading!==this.getAttribute("src")&&this.load()}get interview(){return this.json}set interview(e){this.loadToken++,this.json=e,this.draw()}set documentUrl(e){this.base=e}static styleRoot(e){const r=e instanceof ShadowRoot?e:document.head;if(r.querySelector("style[data-rr0-interview]"))return;const t=document.createElement("style");t.dataset.rr0Interview="",t.textContent=I,r.append(t)}async load(){const e=this.getAttribute("src"),r=++this.loadToken;if(this.loading=e??void 0,!e)return;const t=new URL(e,location.href).href;let s;try{s=await x.json(t)}catch{s=void 0}r===this.loadToken&&(this.base=t,this.json=s,this.draw())}async loadLocale(){const e=++this.localeToken,r=$.preferencesFor(this),t=A(r,R),s=t==="en"?E:await C(t);e===this.localeToken&&(this.said=new w(r),this.messages=s,this.draw())}speakerName(e,r){const t=p.speakerName(e,r),s=e.speakers?.[r]?.role;return t===s&&s in this.messages.roles?this.messages.roles[s]:t}seek(e){const r=this.json,t={sighting:e.sighting??p.sightingsOf(r)[0],at:e.at};this.dispatchEvent(new CustomEvent(_,{bubbles:!0,composed:!0,detail:t}));const s=this.getAttribute("player");if(!s)return;const a=this.getRootNode().getElementById?.(s);typeof a?.seekTo=="function"&&(a.scrollIntoView?.({block:"center",behavior:"smooth"}),a.seekTo(t.at,t.sighting))}gap(e,r){const t=document.createElement(r),s=document.createElement("span");s.className="bar";const n=`${this.messages.redacted} : ${this.said.read(e)??""}`;return s.dataset.tip=n,s.tabIndex=0,s.setAttribute("role","img"),s.setAttribute("aria-label",n),t.append(s),t}saidNodes(e){if(!/[<&]/.test(e))return[document.createTextNode(e)];const r=document.createElement("template");r.innerHTML=e;for(const t of r.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(t.tagName)){t.remove();continue}for(const s of[...t.attributes])if(/^on/i.test(s.name)||/^\s*javascript:/i.test(s.value))t.removeAttribute(s.name);else if(["href","src"].includes(s.name))try{s.value=new URL(s.value,this.base??location.href).href}catch{}}return[...r.content.childNodes]}draw(){const e=this.messages,r=this.json;this.blocks.clear();const t=Array.isArray(r?.segments)?r.segments:[];if(!r||t.length===0){this.status.hidden=!0;const i=document.createElement("p");i.textContent=e.exchangesEmpty,this.turns.replaceChildren(i);return}const s=r.speakers??{},n=Object.keys(s);if(r.proofreading){const i=n.filter(c=>!["approved","covered"].includes(r.proofreading?.[c]?.status??""));this.status.textContent=i.length===0?e.proofreadAll:e.proofreadPending.replace("{names}",i.map(c=>this.speakerName(r,c)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const a=[];let o,h;t.forEach((i,c)=>{const f=i.redacted?JSON.stringify(i.redacted.reason):void 0;if(f!==void 0&&o?.reason===f){this.blocks.set(c,o.block);return}const d=document.createElement("div");d.className="turn",d.dataset.segment=String(c),d.style.setProperty("--speaker-hue",String((Math.max(0,n.indexOf(i.speaker))*67+210)%360));const k=document.createElement("div");k.className="who";const m=document.createElement("span");if(m.textContent=i.redacted?"":this.speakerName(r,i.speaker),i.start!==void 0&&(d.dataset.time=p.clock(i.start,!0)),!i.redacted&&h===i.speaker&&d.classList.add("goes-on"),h=i.redacted?void 0:i.speaker,k.append(m),i.redacted){d.classList.add("is-redacted");const l=this.gap(i.redacted.reason,"p");l.className="redacted",o={block:d,reason:f},d.append(k,l)}else{const l=document.createElement("p");if(l.className="said",i.parts){let g="";for(const v of i.parts){const T="redacted"in v?"▮":p.plain(v.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(g)&&/^[\p{L}\p{N}(«“▮]/u.test(T)&&l.append(" "),"redacted"in v?l.append(this.gap(v.redacted.reason,"span")):l.append(...this.saidNodes(v.text)),g=T}}else l.append(...this.saidNodes(i.text??""));o=void 0,d.append(k,l)}if(i.refs?.length){const l=document.createElement("div");l.className="refs";for(const g of i.refs){const v=document.createElement("button");v.type="button",v.className="ref",v.textContent=`↗ ${p.clock(g.at,!0)}`,v.addEventListener("click",()=>this.seek(g)),l.append(v)}d.append(l)}this.blocks.set(c,d),a.push(d)}),this.turns.replaceChildren(...a)}revealSegment(e){const r=this.blocks.get(e);r&&(r.scrollIntoView?.({block:"center"}),r.classList.add("flash"),window.setTimeout(()=>r.classList.remove("flash"),1600))}}function V(){customElements.get(S)||customElements.define(S,N)}V();