@rr0/ufoathome 0.163.1 → 0.164.0
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/dist-embed-interview/InterviewMessages_es-ypa0EDh9.js +1 -0
- package/dist-embed-interview/InterviewMessages_fr-OCQdwn9j.js +1 -0
- package/dist-embed-interview/InterviewMessages_it-awuOqf5v.js +1 -0
- package/dist-embed-interview/rr0-interview.mjs +2 -2
- package/dist-embed-scene/SceneNames_es-xcbww_vR.js +1 -0
- package/dist-embed-scene/SceneNames_fr-COj1rUw_.js +1 -0
- package/dist-embed-scene/SceneNames_it-BiqZMsLB.js +1 -0
- package/dist-embed-scene/UfoMessages_es-BxNc9t8X.js +1 -0
- package/dist-embed-scene/UfoMessages_fr-DnD6eSjQ.js +1 -0
- package/dist-embed-scene/UfoMessages_it-BubvnWTa.js +1 -0
- package/dist-embed-scene/rr0-scene.mjs +354 -354
- package/dist-embed-sighting/SceneNames_es-Cu0CS6c0.js +1 -0
- package/dist-embed-sighting/SceneNames_fr-BAQt0-Zp.js +1 -0
- package/dist-embed-sighting/SceneNames_it-CeXG9jCC.js +1 -0
- package/dist-embed-sighting/SightingMessages_es-t6G0aKl4.js +1 -0
- package/dist-embed-sighting/SightingMessages_fr-D6DpE28c.js +1 -0
- package/dist-embed-sighting/SightingMessages_it-Dtm-W4pl.js +1 -0
- package/dist-embed-sighting/UfoMessages_es-BxNc9t8X.js +1 -0
- package/dist-embed-sighting/UfoMessages_fr-DnD6eSjQ.js +1 -0
- package/dist-embed-sighting/UfoMessages_it-BubvnWTa.js +1 -0
- package/dist-embed-sighting/rr0-sighting.mjs +361 -361
- package/dist-embed-sighting-editor/{BeamEditor-BzrEOJOy.js → BeamEditor-DDNul0KE.js} +1 -1
- package/dist-embed-sighting-editor/{BeamEditorMessages_en-DBs2OUXJ.js → BeamEditorMessages_en-SQumGyrS.js} +1 -1
- package/dist-embed-sighting-editor/{BeamEditorMessages_es-DB8K5GtE.js → BeamEditorMessages_es-BrR6Pk6G.js} +1 -1
- package/dist-embed-sighting-editor/{BeamEditorMessages_fr-D1j_IF07.js → BeamEditorMessages_fr-CT24bHfq.js} +1 -1
- package/dist-embed-sighting-editor/{BeamEditorMessages_it-BT3ezMwC.js → BeamEditorMessages_it-BgwwRjlh.js} +1 -1
- package/dist-embed-sighting-editor/{BodyEditor-D5VXWcru.js → BodyEditor-Br-GYDsy.js} +2 -2
- package/dist-embed-sighting-editor/BodyEditorMessages_en-esgrRKGZ.js +1 -0
- package/dist-embed-sighting-editor/BodyEditorMessages_es-C1ZvwV-v.js +1 -0
- package/dist-embed-sighting-editor/BodyEditorMessages_fr-B_exFt_Q.js +1 -0
- package/dist-embed-sighting-editor/BodyEditorMessages_it-AJ_KrzkS.js +1 -0
- package/dist-embed-sighting-editor/{CaseEditorMessages_es-DUelIN8x.js → CaseEditorMessages_es-D9fqVpx3.js} +1 -1
- package/dist-embed-sighting-editor/{CaseEditorMessages_fr-BppxXK1E.js → CaseEditorMessages_fr-DA4NmMM1.js} +1 -1
- package/dist-embed-sighting-editor/{CaseEditorMessages_it-BIYStAk9.js → CaseEditorMessages_it-BoJUJ83I.js} +1 -1
- package/dist-embed-sighting-editor/{InterviewEditorElement-B_M9d5Gp.js → InterviewEditorElement-1brfxXM5.js} +7 -6
- package/dist-embed-sighting-editor/InterviewMessages_en-BNau2xU8.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_es-ypa0EDh9.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_fr-OCQdwn9j.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_it-awuOqf5v.js +1 -0
- package/dist-embed-sighting-editor/LanternEditor-DpZQqBGL.js +9 -0
- package/dist-embed-sighting-editor/{LanternEditorMessages_en-3XzIx2c4.js → LanternEditorMessages_en-DaT3UNfD.js} +1 -1
- package/dist-embed-sighting-editor/{LanternEditorMessages_es-BwzbSSd3.js → LanternEditorMessages_es-TDV5lKeJ.js} +1 -1
- package/dist-embed-sighting-editor/{LanternEditorMessages_fr-Cf444dJM.js → LanternEditorMessages_fr-9mByTFMG.js} +1 -1
- package/dist-embed-sighting-editor/{LanternEditorMessages_it-Bhk0A4Ug.js → LanternEditorMessages_it-MRkJnDQp.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditor-DcYWYLQN.js → LaunchEditor-BvnOtPyj.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditorMessages_en-DH8gI1vo.js → LaunchEditorMessages_en-9lV7bQZy.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditorMessages_es-WCfaY4uY.js → LaunchEditorMessages_es-D-Kz7fI5.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditorMessages_fr-CWCGUG_A.js → LaunchEditorMessages_fr-VEZBh9Ky.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditorMessages_it-DxSSiAd7.js → LaunchEditorMessages_it-B0MeP7ki.js} +1 -1
- package/dist-embed-sighting-editor/SceneNames_es-DFcAoDph.js +1 -0
- package/dist-embed-sighting-editor/SceneNames_fr-Cf8NgtIe.js +1 -0
- package/dist-embed-sighting-editor/SceneNames_it-CLLu_NHU.js +1 -0
- package/dist-embed-sighting-editor/SightingEditorMessages_es-oZAu3CCU.js +12 -0
- package/dist-embed-sighting-editor/SightingEditorMessages_fr-ycaYW34j.js +12 -0
- package/dist-embed-sighting-editor/SightingEditorMessages_it-Chlr7U2v.js +12 -0
- package/dist-embed-sighting-editor/SightingFileEditor-BekK-f3R.js +8 -0
- package/dist-embed-sighting-editor/UfoMessages_es-BxNc9t8X.js +1 -0
- package/dist-embed-sighting-editor/UfoMessages_fr-DnD6eSjQ.js +1 -0
- package/dist-embed-sighting-editor/UfoMessages_it-BubvnWTa.js +1 -0
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +467 -462
- package/package.json +3 -2
- package/dist-embed-interview/InterviewMessages_es-B0Ut-uel.js +0 -1
- package/dist-embed-interview/InterviewMessages_fr-mhX8Zuyu.js +0 -1
- package/dist-embed-interview/InterviewMessages_it-DaxIoAIG.js +0 -1
- package/dist-embed-scene/SceneNames_es-DU-mbey8.js +0 -1
- package/dist-embed-scene/SceneNames_fr-D5foX9zZ.js +0 -1
- package/dist-embed-scene/SceneNames_it-CsSU00Qr.js +0 -1
- package/dist-embed-scene/UfoMessages_es-BRCWkzr3.js +0 -1
- package/dist-embed-scene/UfoMessages_fr-Cs2GCHEt.js +0 -1
- package/dist-embed-scene/UfoMessages_it-B2hvjhgb.js +0 -1
- package/dist-embed-sighting/SceneNames_es-yKx3UAlW.js +0 -1
- package/dist-embed-sighting/SceneNames_fr-CRYRL6bz.js +0 -1
- package/dist-embed-sighting/SceneNames_it-YZZnoK8j.js +0 -1
- package/dist-embed-sighting/SightingMessages_es-Dsr6169b.js +0 -1
- package/dist-embed-sighting/SightingMessages_fr-DQNbBD0c.js +0 -1
- package/dist-embed-sighting/SightingMessages_it-WE-_Cuu4.js +0 -1
- package/dist-embed-sighting/UfoMessages_es-BRCWkzr3.js +0 -1
- package/dist-embed-sighting/UfoMessages_fr-Cs2GCHEt.js +0 -1
- package/dist-embed-sighting/UfoMessages_it-B2hvjhgb.js +0 -1
- package/dist-embed-sighting-editor/BodyEditorMessages_en-DmM8Dasm.js +0 -1
- package/dist-embed-sighting-editor/BodyEditorMessages_es-BiV1oFuY.js +0 -1
- package/dist-embed-sighting-editor/BodyEditorMessages_fr-D03RAZjQ.js +0 -1
- package/dist-embed-sighting-editor/BodyEditorMessages_it-34r0JMIX.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_en-CC5D0e6J.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_es-B0Ut-uel.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_fr-mhX8Zuyu.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_it-DaxIoAIG.js +0 -1
- package/dist-embed-sighting-editor/LanternEditor-C60IT7Cv.js +0 -9
- package/dist-embed-sighting-editor/SceneNames_es-CtE-QSrH.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_fr-hz4p4u7a.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_it-CRn1NGKM.js +0 -1
- package/dist-embed-sighting-editor/SightingEditorMessages_es-DZtPaOcp.js +0 -12
- package/dist-embed-sighting-editor/SightingEditorMessages_fr-CeuEUqAw.js +0 -12
- package/dist-embed-sighting-editor/SightingEditorMessages_it-BpcvGK7E.js +0 -12
- package/dist-embed-sighting-editor/SightingFileEditor-I2GVdPxG.js +0 -8
- package/dist-embed-sighting-editor/UfoMessages_es-BRCWkzr3.js +0 -1
- package/dist-embed-sighting-editor/UfoMessages_fr-Cs2GCHEt.js +0 -1
- package/dist-embed-sighting-editor/UfoMessages_it-B2hvjhgb.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as o}from"./LaserBeam-DZ6ILkZ8.js";import{y as m,U as f,D as b,v as d,w as h,u,G as v}from"./rr0-sighting-editor.mjs";import{beamEditorMessages_en as c}from"./BeamEditorMessages_en-
|
|
1
|
+
import{L as o}from"./LaserBeam-DZ6ILkZ8.js";import{y as m,U as f,D as b,v as d,w as h,u,G as v}from"./rr0-sighting-editor.mjs";import{beamEditorMessages_en as c}from"./BeamEditorMessages_en-SQumGyrS.js";class i{static LIGHT={en:"Light",fr:"Lumière",es:"Luz",it:"Luce"};static WHEN={en:"When",fr:"Quand",es:"Cuándo",it:"Quando"};static nextPlace(e){const t=e[e.length-1]??{lat:0,lng:0,altitudeM:0},s=e[e.length-2];return s?{lat:2*t.lat-s.lat,lng:2*t.lng-s.lng,altitudeM:2*t.altitudeM-s.altitudeM}:{lat:t.lat,lng:t.lng+500/(111320*Math.max(.05,Math.cos(t.lat*Math.PI/180))),altitudeM:t.altitudeM}}static instant(e,t,s){return{type:"number",key:e,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:t,hint:s,group:i.WHEN}}static SET={kind:"beam",title:{en:"Beam",fr:"Faisceau",es:"Haz",it:"Fascio"},parameters:[{type:"said",key:"title",label:{en:"Name",fr:"Nom",es:"Nombre",it:"Nome"},group:i.LIGHT},{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",required:!0,group:i.LIGHT,label:{en:"Wavelength",fr:"Longueur d'onde",es:"Longitud de onda",it:"Lunghezza d'onda"},hint:{en:"Its colour: 532 for the green of a frequency-doubled laser, 520 for a green diode, 638 for a red one, 450 for a blue one.",fr:"Sa couleur : 532 pour le vert d'un laser doublé en fréquence, 520 pour une diode verte, 638 pour une rouge, 450 pour une bleue.",es:"Su color: 532 para el verde de un láser doblado en frecuencia, 520 para un diodo verde, 638 para uno rojo, 450 para uno azul.",it:"Il suo colore: 532 per il verde di un laser a frequenza raddoppiata, 520 per un diodo verde, 638 per uno rosso, 450 per uno blu."}},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",required:!0,group:i.LIGHT,label:{en:"Power",fr:"Puissance",es:"Potencia",it:"Potenza"},hint:{en:"The optical power it carries, its mean for a pulsed laser, whose pulses no eye tells apart. What is seen of it is what the air scatters.",fr:"La puissance optique qu'il porte, sa moyenne pour un laser pulsé, dont aucun œil ne distingue les impulsions. Ce qui s'en voit est ce que l'air en diffuse.",es:"La potencia óptica que lleva, su media para un láser pulsado, cuyos pulsos ningún ojo distingue. Lo que se ve de él es lo que el aire difunde.",it:"La potenza ottica che porta, la sua media per un laser pulsato, i cui impulsi nessun occhio distingue. Ciò che se ne vede è ciò che l'aria diffonde."}},{type:"number",key:"divergenceMrad",min:.001,max:1e3,step:.001,unit:"mrad",group:i.LIGHT,effective:()=>o.DEFAULT_DIVERGENCE_MRAD,label:{en:"Divergence",fr:"Divergence",es:"Divergencia",it:"Divergenza"},hint:{en:"How fast it widens, full angle: 0.1 mrad is a metre wide at 10 km.",fr:"À quelle vitesse il s'élargit, angle total : 0,1 mrad fait un mètre de large à 10 km.",es:"Lo rápido que se ensancha, ángulo total: 0,1 mrad es un metro de ancho a 10 km.",it:"Quanto in fretta si allarga, angolo totale: 0,1 mrad è un metro di larghezza a 10 km."}},{type:"number",key:"apertureM",min:.001,max:10,step:.001,unit:"m",group:i.LIGHT,effective:()=>o.DEFAULT_APERTURE_M,label:{en:"Width at the emitter",fr:"Largeur à l'émetteur",es:"Anchura en el emisor",it:"Larghezza all'emettitore"}},i.instant("fromT",{en:"On from",fr:"Allumé à",es:"Encendido a",it:"Acceso a"},{en:"Seconds of the recording; empty, from its start.",fr:"Secondes de l'enregistrement ; vide, dès son début.",es:"Segundos de la grabación; vacío, desde su inicio.",it:"Secondi della registrazione; vuoto, dal suo inizio."}),i.instant("untilT",{en:"Off at",fr:"Éteint à",es:"Apagado a",it:"Spento a"},{en:"Seconds of the recording; empty, until its end.",fr:"Secondes de l'enregistrement ; vide, jusqu'à sa fin.",es:"Segundos de la grabación; vacío, hasta su final.",it:"Secondi della registrazione; vuoto, fino alla sua fine."})]};static PLACE={kind:"beam-place",title:{en:"Point of the path",fr:"Point du trajet",es:"Punto del trayecto",it:"Punto del percorso"},parameters:[{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:.1,label:{en:"Position",fr:"Position",es:"Posición",it:"Posizione"}},{type:"number",key:"altitudeM",min:-500,max:1e5,step:.1,unit:"m",required:!0,label:{en:"Altitude",fr:"Altitude",es:"Altitud",it:"Altitudine"},hint:{en:"Above the sea, not the ground: an emitter at a window twelve metres up a building on ground at 160 m is at 172 m.",fr:"Au-dessus de la mer, pas du sol : un émetteur à une fenêtre à douze mètres de haut, sur un sol à 160 m, est à 172 m.",es:"Sobre el mar, no sobre el suelo: un emisor en una ventana a doce metros de altura, sobre un suelo a 160 m, está a 172 m.",it:"Sul mare, non sul suolo: un emettitore a una finestra a dodici metri d'altezza, su un suolo a 160 m, è a 172 m."}}]};static publish(){m.publish(i.SET)}}class r{constructor(e,t,s){this.container=e,this.host=t,this.language=s,m.of("beam")||i.publish(),this.render(),this.setLanguage(s)}messages=c;languageToken=0;currentId;form;list;places;placeForm;placeIndex=0;language;shown=[];async setLanguage(e){const t=++this.languageToken;this.language=e;const s=f.includes(e)?e:"en",a=s==="en"?c:await b(s);t===this.languageToken&&(this.messages=a,this.render(),this.sync())}sync(){const e=this.beams;this.shown=[...e],e.some(s=>s.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(s=>({id:s.id,label:this.labelOf(s)})),this.currentId),this.syncAddState();const t=this.current;this.element("beam-fields").hidden=t===void 0,t&&(this.syncPlaces(t),this.form??=new d(this.element("beam-parameters"),this.language,"beam.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(i.SET,new h(()=>this.current,s=>this.editBeam(a=>s(a))),()=>this.written()))}refresh(){this.syncAddState();const e=this.beams;e.length===this.shown.length&&e.every((t,s)=>t.id===this.shown[s].id)||this.sync()}syncAddState(){const e=this.pathOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addBeamNowhere)}get current(){return this.beams.find(e=>e.id===this.currentId)}show(e){this.currentId=e,this.placeIndex=0,this.sync()}render(){const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
|
|
2
2
|
<p class="launch-intro">${e.intro}</p>
|
|
3
3
|
<div id="beam-list"></div>
|
|
4
4
|
<div id="beam-fields" class="launch-fields">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={intro:"A beam of light sent through the air from the ground while the recording runs: a laser shot, a searchlight. A fact of the sky, not a reading of the account. Its path goes from the emitter through any mirror to where it ends; how bright it shows is what the air scatters of it, computed.",none:"No beam in this recording",beam:"Beam",deleteBeam:"Delete the beam",addBeam:"Add a beam",path:"Path",place:"Point of the path",addPlace:"Add a point to the path, going on as it goes",deletePlace:"Remove this point",previousPlace:"Previous point",nextPlace:"Next point",addBeamNowhere:"Give the recording a place first: a beam is put in front of the
|
|
1
|
+
const e={intro:"A beam of light sent through the air from the ground while the recording runs: a laser shot, a searchlight. A fact of the sky, not a reading of the account. Its path goes from the emitter through any mirror to where it ends; how bright it shows is what the air scatters of it, computed.",none:"No beam in this recording",beam:"Beam",deleteBeam:"Delete the beam",addBeam:"Add a beam",path:"Path",place:"Point of the path",addPlace:"Add a point to the path, going on as it goes",deletePlace:"Remove this point",previousPlace:"Previous point",nextPlace:"Next point",addBeamNowhere:"Give the recording a place first: a beam is put in front of the witness",derivedNote:"An empty field shows, greyed, the value in use. Clear a field to go back to it."};export{e as beamEditorMessages_en};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={intro:"Un haz de luz enviado por el aire desde el suelo durante la grabación: un disparo láser, un reflector. Un hecho del cielo, no una lectura del relato. Su trayecto va del emisor, por posibles espejos, hasta donde termina; su brillo es lo que el aire difunde de él, calculado.",none:"Ningún haz en esta grabación",beam:"Haz",deleteBeam:"Eliminar el haz",addBeam:"Añadir un haz",path:"Trayecto",place:"Punto del trayecto",addPlace:"Añadir un punto al trayecto, en su continuidad",deletePlace:"Quitar este punto",previousPlace:"Punto anterior",nextPlace:"Punto siguiente",addBeamNowhere:"Dé primero un lugar a la grabación: un haz se coloca delante del
|
|
1
|
+
const e={intro:"Un haz de luz enviado por el aire desde el suelo durante la grabación: un disparo láser, un reflector. Un hecho del cielo, no una lectura del relato. Su trayecto va del emisor, por posibles espejos, hasta donde termina; su brillo es lo que el aire difunde de él, calculado.",none:"Ningún haz en esta grabación",beam:"Haz",deleteBeam:"Eliminar el haz",addBeam:"Añadir un haz",path:"Trayecto",place:"Punto del trayecto",addPlace:"Añadir un punto al trayecto, en su continuidad",deletePlace:"Quitar este punto",previousPlace:"Punto anterior",nextPlace:"Punto siguiente",addBeamNowhere:"Dé primero un lugar a la grabación: un haz se coloca delante del testigo",derivedNote:"Un campo vacío muestra, en gris, el valor usado. Vacíe un campo para volver a él."};export{e as beamEditorMessages_es};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={intro:"Un faisceau de lumière envoyé dans l'air depuis le sol pendant l'enregistrement : un tir laser, un projecteur. Un fait du ciel, pas une lecture du compte rendu. Son trajet va de l'émetteur, par d'éventuels miroirs, jusqu'à là où il finit ; son éclat est ce que l'air en diffuse, calculé.",none:"Aucun faisceau dans cet enregistrement",beam:"Faisceau",deleteBeam:"Supprimer le faisceau",addBeam:"Ajouter un faisceau",path:"Trajet",place:"Point du trajet",addPlace:"Ajouter un point au trajet, dans la continuité",deletePlace:"Retirer ce point",previousPlace:"Point précédent",nextPlace:"Point suivant",addBeamNowhere:"Donnez d'abord un lieu à l'enregistrement : un faisceau est placé devant
|
|
1
|
+
const e={intro:"Un faisceau de lumière envoyé dans l'air depuis le sol pendant l'enregistrement : un tir laser, un projecteur. Un fait du ciel, pas une lecture du compte rendu. Son trajet va de l'émetteur, par d'éventuels miroirs, jusqu'à là où il finit ; son éclat est ce que l'air en diffuse, calculé.",none:"Aucun faisceau dans cet enregistrement",beam:"Faisceau",deleteBeam:"Supprimer le faisceau",addBeam:"Ajouter un faisceau",path:"Trajet",place:"Point du trajet",addPlace:"Ajouter un point au trajet, dans la continuité",deletePlace:"Retirer ce point",previousPlace:"Point précédent",nextPlace:"Point suivant",addBeamNowhere:"Donnez d'abord un lieu à l'enregistrement : un faisceau est placé devant le témoin",derivedNote:"Un champ vide montre, en grisé, la valeur utilisée. Videz un champ pour y revenir."};export{e as beamEditorMessages_fr};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={intro:"Un fascio di luce inviato nell'aria dal suolo durante la registrazione: un tiro laser, un proiettore. Un fatto del cielo, non una lettura del resoconto. Il suo percorso va dall'emettitore, attraverso eventuali specchi, fin dove finisce; la sua luminosità è ciò che l'aria ne diffonde, calcolata.",none:"Nessun fascio in questa registrazione",beam:"Fascio",deleteBeam:"Elimina il fascio",addBeam:"Aggiungi un fascio",path:"Percorso",place:"Punto del percorso",addPlace:"Aggiungi un punto al percorso, in continuità",deletePlace:"Togli questo punto",previousPlace:"Punto precedente",nextPlace:"Punto successivo",addBeamNowhere:"Dai prima un luogo alla registrazione: un fascio è posto davanti
|
|
1
|
+
const e={intro:"Un fascio di luce inviato nell'aria dal suolo durante la registrazione: un tiro laser, un proiettore. Un fatto del cielo, non una lettura del resoconto. Il suo percorso va dall'emettitore, attraverso eventuali specchi, fin dove finisce; la sua luminosità è ciò che l'aria ne diffonde, calcolata.",none:"Nessun fascio in questa registrazione",beam:"Fascio",deleteBeam:"Elimina il fascio",addBeam:"Aggiungi un fascio",path:"Percorso",place:"Punto del percorso",addPlace:"Aggiungi un punto al percorso, in continuità",deletePlace:"Togli questo punto",previousPlace:"Punto precedente",nextPlace:"Punto successivo",addBeamNowhere:"Dai prima un luogo alla registrazione: un fascio è posto davanti al testimone",derivedNote:"Un campo vuoto mostra, in grigio, il valore usato. Svuota un campo per tornarci."};export{e as beamEditorMessages_it};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{U as A,t as O,B as u,u as
|
|
1
|
+
import{U as A,t as O,B as u,u as M,v,w as k}from"./rr0-sighting-editor.mjs";import{bodyEditorMessages_en as w}from"./BodyEditorMessages_en-esgrRKGZ.js";class p{static before(e,i){const t=[...e.track].sort((s,o)=>s.t-o.t);return[...t].reverse().find(s=>s.t<=i)??t[0]}static viewOf(e,i,t){const s=p.before(e,i),o=n=>Number(n.toFixed(2));return{mode:s?.eastM!==void 0&&s.northM!==void 0?"world":"observer",azimuthDeg:o(t.azimuthDeg),elevationDeg:o(t.altitudeDeg),distanceM:o(t.distanceM),eastM:o(t.eastM),northM:o(t.northM),saidPosition:e.track.find(n=>n.t===i)?.saidPosition,aboveGroundM:o(t.aboveGroundM),onGround:s?.onGround===!0,widthM:o(t.sizeM.widthM),lengthM:o(t.sizeM.lengthM),heightM:o(t.sizeM.heightM),headingDeg:o(t.attitude.headingDeg),pitchDeg:o(t.attitude.pitchDeg),rollDeg:o(t.attitude.rollDeg),color:t.appearance.color,albedo:o(t.appearance.albedo),luminanceCdM2:o(t.appearance.luminanceCdM2),transparency:o(t.appearance.transparency??0),haloScale:o(t.appearance.haloScale??1)}}static keyframeOf(e,i,t,s){const o=r=>Number.isFinite(r)?r:0,n=e.mode==="world"?{t:i,eastM:o(e.eastM),northM:o(e.northM),...e.saidPosition?{saidPosition:e.saidPosition}:{},...e.onGround?{onGround:!0}:{altitudeAboveGroundM:o(e.aboveGroundM)}}:{t:i,azimuthDeg:o(e.azimuthDeg),altitudeDeg:o(e.elevationDeg),distanceM:Math.max(.1,o(e.distanceM)),...e.onGround?{onGround:!0}:{}},d=s?{color:e.color,albedo:Math.max(0,Math.min(1,o(e.albedo))),luminanceCdM2:Math.max(0,o(e.luminanceCdM2)),transparency:Math.max(0,Math.min(1,o(e.transparency))),haloScale:Math.max(0,o(e.haloScale))}:t?.appearance;return{...p.withoutPlacement(t),...n,sizeM:{widthM:Math.max(.01,o(e.widthM)),lengthM:Math.max(.01,o(e.lengthM)),heightM:Math.max(.01,o(e.heightM))},attitude:{headingDeg:o(e.headingDeg),pitchDeg:o(e.pitchDeg),rollDeg:o(e.rollDeg)},...d?{appearance:d}:{}}}static withoutPlacement(e){if(!e)return{};const{eastM:i,northM:t,saidPosition:s,azimuthDeg:o,altitudeDeg:n,distanceM:d,onGround:r,altitudeAboveGroundM:a,sizeM:l,attitude:c,appearance:m,...y}=e;return y}}class h{static number(e,i,t,s,o,n,d={}){return{type:"number",key:e,label:i,min:t,max:s,step:o,unit:n,required:!0,...d}}static BODY={kind:"body",title:{en:"Body",fr:"Corps",es:"Cuerpo",it:"Corpo"},parameters:[{type:"text",key:"id",required:!0,label:{en:"ID",fr:"Identifiant",es:"Identificador",it:"Identificativo"},validate:(e,i,t)=>!(t?.ids??[]).some(s=>s===e&&s!==i.id)},{type:"said",key:"title",label:{en:"Name",fr:"Nom",es:"Nombre",it:"Nome"}},{type:"set",key:"explains",label:{en:"Stands for the shapes",fr:"Représente les formes",es:"Representa las formas",it:"Rappresenta le forme"},options:(e,i)=>{const t=i?.shapes??[],s=(e.explains??[]).filter(o=>!t.some(n=>n.value===o));return[...t,...s.map(o=>({value:o,label:o}))]},empty:{en:"No shape",fr:"Aucune forme",es:"Ninguna forma",it:"Nessuna forma"}},{type:"text",key:"outlineNode",label:{en:"Part drawn by the witness",fr:"Partie dessinée par le témoin",es:"Parte dibujada por el testigo",it:"Parte disegnata dal testimone"},placeholder:{en:"Node of the model, e.g. hull",fr:"Nœud du modèle, par ex. hull",es:"Nodo del modelo, p. ej. hull",it:"Nodo del modello, ad es. hull"}}]};static KEYFRAME={kind:"body-keyframe",title:{en:"At the playhead",fr:"À l'instant courant",es:"En el instante actual",it:"All'istante corrente"},parameters:[{type:"choice",key:"mode",required:!0,label:{en:"Position",fr:"Position",es:"Posición",it:"Posizione"},choices:[{value:"observer",label:{en:"From the witness",fr:"Depuis le témoin",es:"Desde el testigo",it:"Dal testimone"}},{value:"world",label:{en:"In the world",fr:"Dans le monde",es:"En el mundo",it:"Nel mondo"}}]},h.number("azimuthDeg",{en:"Azimuth",fr:"Azimut",es:"Acimut",it:"Azimut"},0,360,.01,"°",{visibleWhen:e=>e.mode==="observer"}),h.number("elevationDeg",{en:"Elevation",fr:"Hauteur",es:"Elevación",it:"Elevazione"},-90,90,.01,"°",{visibleWhen:e=>e.mode==="observer"}),h.number("distanceM",{en:"Distance",fr:"Distance",es:"Distancia",it:"Distanza"},.1,3e4,.1,"m",{visibleWhen:e=>e.mode==="observer"}),{type:"position",key:"eastM",secondKey:"northM",saidKey:"saidPosition",native:"local",step:.1,label:{en:"In the world",fr:"Dans le monde",es:"En el mundo",it:"Nel mondo"},visibleWhen:e=>e.mode==="world"},{type:"boolean",key:"onGround",label:{en:"On the ground",fr:"Au sol",es:"En el suelo",it:"A terra"}},h.number("aboveGroundM",{en:"Above the ground",fr:"Au-dessus du sol",es:"Sobre el suelo",it:"Sopra il suolo"},0,3e4,.1,"m",{visibleWhen:e=>e.mode==="world"&&e.onGround!==!0}),h.number("widthM",{en:"Width",fr:"Largeur",es:"Ancho",it:"Larghezza"},.01,1e3,.01,"m"),h.number("lengthM",{en:"Length",fr:"Longueur",es:"Largo",it:"Lunghezza"},.01,1e3,.01,"m"),h.number("heightM",{en:"Height",fr:"Hauteur",es:"Alto",it:"Altezza"},.01,1e3,.01,"m"),h.number("headingDeg",{en:"Heading",fr:"Cap",es:"Rumbo",it:"Rotta"},0,360,.1,"°"),h.number("pitchDeg",{en:"Pitch",fr:"Tangage",es:"Cabeceo",it:"Beccheggio"},-90,90,.1,"°"),h.number("rollDeg",{en:"Roll",fr:"Roulis",es:"Alabeo",it:"Rollio"},-180,180,.1,"°"),{type:"colour",key:"color",label:{en:"Colour",fr:"Couleur",es:"Color",it:"Colore"},fallback:"#c8c8c8",visibleWhen:(e,i)=>i?.drawnFromModel!==!0},h.number("albedo",{en:"Albedo",fr:"Albédo",es:"Albedo",it:"Albedo"},0,1,.01,void 0),h.number("luminanceCdM2",{en:"Light of its own",fr:"Lumière propre",es:"Luz propia",it:"Luce propria"},0,1e10,.1,"cd/m²"),h.number("transparency",{en:"Transparency",fr:"Transparence",es:"Transparencia",it:"Trasparenza"},0,1,.01,void 0),h.number("haloScale",{en:"Halo",fr:"Halo",es:"Halo",it:"Alone"},0,20,.1,"×")]}}class b{constructor(e,i,t){this.container=e,this.host=i,this.language=t,this.render(),this.setLanguage(t)}static APPEARANCE_KEYS=["color","albedo","luminanceCdM2","transparency","haloScale"];messages=w;languageToken=0;currentId;catalogueToken=0;shownEntry;syncedId;bodyForm;keyForm;async setLanguage(e){const i=++this.languageToken;this.language=e;const t=A.includes(e)?e:"en",s=t==="en"?w:await O(t);i===this.languageToken&&s!==this.messages&&(this.messages=s,this.render())}get selectedId(){return this.currentId}sync(){const e=this.bodies;e.some(n=>n.id===this.currentId)||(this.currentId=e[0]?.id),this.input("body-interpretation-title").value=this.host.said().read(this.interpretation?.title)??"",this.list?.setItems(e.map(n=>({id:n.id,label:this.labelOf(n)})),this.currentId),this.host.bodySelected?.(this.currentId);const i=this.host.newBodyStart();this.list?.setAddState(i!==void 0,i?i.label!==void 0?this.messages.addBodyHint.replace("{shape}",i.label):this.messages.addBodyHintView:void 0),this.input("body-interpretation-title").closest("label").hidden=!1;const t=this.current;if(this.element("body-fields").hidden=t===void 0,!t)return;this.bodyForm?.sync(),this.syncModelOptions(t);const s=t.model;this.input("body-model-url").value=s.url??"",this.input("body-model-title").value=s.credit?.title??"",this.input("body-model-author").value=s.credit?.author??"",this.input("body-model-license").value=s.credit?.license??"",this.input("body-model-source").value=s.credit?.sourceUrl??"";const o=this.element("body-model-advanced");o.open=s.url!==void 0||o.open&&t.id===this.syncedId,this.syncedId=t.id,this.element("body-model-incomplete").hidden=s.url===void 0||s.credit?.title!==void 0&&s.credit.license!==void 0,this.syncKeyframe()}syncKeyframe(e=!1){const i=this.current;if(!i)return;const t=this.host.currentTime(),s=this.messages,o=this.host.readingOf(i,t),n=i.track.find(r=>r.t===t),d=this.element("body-key-legend");d.textContent=s.atPlayhead.replace("{t}",b.seconds(t)),d.hidden=n!==void 0,this.element("body-key-note").textContent=o?n?s.keyframeHere:s.keyframeAdded:s.notPlaced,this.keyList?.setItems(i.track.map(r=>({id:String(r.t),label:b.seconds(r.t)})),n?String(n.t):""),this.keyList?.setAddState(o!==void 0&&n===void 0),this.keyList?.setStepState(i.track.some(r=>r.t<t),i.track.some(r=>r.t>t)),this.element("body-key-parameters").hidden=!o,o&&this.keyForm?.sync(e)}stepKeyframe(e){const i=this.current;if(!i)return;const t=this.host.currentTime(),s=i.track.map(o=>o.t).filter(o=>e<0?o<t:o>t);s.length!==0&&(this.host.seekTo(e<0?Math.max(...s):Math.min(...s)),this.syncKeyframe(!0))}keyframeContext(){const e=this.current?.model;return{drawnFromModel:e===void 0||e.url!==void 0||!u.includes(e.id??"")}}keyframeView(){const e=this.current;if(!e)return;const i=this.host.currentTime(),t=this.host.readingOf(e,i);return t?p.viewOf(e,i,t):void 0}render(){const e=this.messages,i=(d,r,a="text",l="",c="",m="")=>`<label><span>${r}</span> <input id="${d}" type="${a}" placeholder="${l}" ${m} autocomplete="off"/>${c?` ${c}`:""}</label>`;this.container.innerHTML=`<div class="body-editor">
|
|
2
2
|
<p class="body-intro">${e.intro}</p>
|
|
3
3
|
${i("body-interpretation-title",e.interpretationTitle)}
|
|
4
4
|
<div id="body-list" class="body-list"></div>
|
|
@@ -24,4 +24,4 @@ import{U as A,t as O,B as u,u as v,v as M,w as k}from"./rr0-sighting-editor.mjs"
|
|
|
24
24
|
<p class="body-intro">${e.pictureHint}</p>
|
|
25
25
|
</fieldset>
|
|
26
26
|
</div>
|
|
27
|
-
</div>`;const t=this.element("body-list");this.list=new v({header:t,body:this.element("body-fields"),ids:{list:"body-select",remove:"body-delete",add:"body-add"},actions:[{id:"body-look",glyph:"🎯",onClick:()=>{const d=this.current;d&&this.host.lookAt(d)}}],onSelect:d=>{this.currentId=d,this.sync()},onAdd:()=>void this.addBody(),onRemove:()=>this.deleteCurrent()}),this.list.setLabels({list:e.body,remove:e.deleteBody,add:e.addBody,empty:e.none,actions:{"body-look":e.lookAtBody}}),this.input("body-interpretation-title").addEventListener("change",()=>this.updateInterpretationTitle());for(const d of["body-model-url","body-model-title","body-model-author","body-model-license","body-model-source"])this.input(d).addEventListener("change",()=>this.updateCurrent());this.select("body-model").addEventListener("change",()=>{const d=this.select("body-model").value;d!==""&&(this.input("body-model-url").value=""),this.updateCurrent(),this.syncModelOptions(this.current),d!==""&&this.adoptCatalogueSize(d),this.element("body-model-advanced").open=d!==""&&!u.includes(d)});const s=this.element("body-keys");this.keyList=new v({header:s,optional:!0,ids:{list:"body-key",remove:"body-key-delete",add:"body-key-add"},navigation:{scope:this.container,onStep:d=>this.stepKeyframe(d)},onSelect:d=>{d!==""&&this.host.seekTo(Number(d)),this.syncKeyframe(!0)},onAdd:()=>this.keyframeHere(),onRemove:()=>this.deleteKeyframe()}),this.keyList.setLabels({list:e.keyframes,remove:e.deleteKeyframe,add:e.addKeyframe,none:e.noKeyframeHere,previous:e.previousKeyframe,next:e.nextKeyframe}),this.host.modelPicker().enhance(this.select("body-model"),d=>this.modelSourceOf(d),{current:()=>{const d=this.current?.model;return d?.url===void 0?void 0:{url:d.url,title:d.credit?.title??"",author:d.credit?.author??"",license:d.credit?.license??"",source:d.credit?.sourceUrl??""}},apply:d=>{this.input("body-model-url").value=d.url,this.input("body-model-title").value=d.title,this.input("body-model-author").value=d.author,this.input("body-model-license").value=d.license,this.input("body-model-source").value=d.source,this.shownEntry=void 0,this.select("body-model").value="",this.updateCurrent(),this.syncModelOptions(this.current)}});const o=this.select("body-model").nextElementSibling;o&&(o.disabled=!0,o.title=e.modelFixed),this.input("body-model-url").readOnly=!0;const n={said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()};this.bodyForm=new M(this.element("body-parameters"),this.language,"body.",n),this.bodyForm.show(h.BODY,new k(()=>this.current,d=>this.editBody(d),()=>({ids:this.bodies.map(d=>d.id),shapes:this.host.shapes().map(d=>({value:d.id,label:d.label}))})),()=>{}),this.keyForm=new M(this.element("body-key-parameters"),this.language,"bodyKey."),this.keyForm.show(h.KEYFRAME,new k(()=>this.keyframeView(),(d,r)=>this.editView(d,b.APPEARANCE_KEYS.includes(r.key)),()=>this.keyframeContext(),this.host.positionPlace?.()),()=>{}),this.sync()}async syncModelOptions(e){const i=++this.catalogueToken,t=await this.host.modelProvider().entries().catch(()=>[]);if(i!==this.catalogueToken)return;const s=this.messages,o=this.select("body-model"),n=e.model.url===void 0?e.model.id:void 0,d=n===void 0||u.includes(n)||t.some(a=>a.id===n),r=[s.primitives,s.catalogue,t.map(a=>`${a.id}:${a.name}`).join(),e.model.url!==void 0,d?"":n].join("|");if(o.dataset.signature!==r){o.dataset.signature=r;const a=document.createElement("optgroup");a.label=s.primitives,a.append(...u.map(c=>new Option(s.primitive[c],c)));const l=document.createElement("optgroup");l.label=s.catalogue,l.append(...t.map(c=>new Option(c.name,c.id))),o.replaceChildren(a,l),e.model.url!==void 0&&o.prepend(new Option(s.modelAdvanced,"")),d||o.append(new Option(n,n))}o.value=n??"",this.showCatalogueModel(e.model.url===void 0?t.find(a=>a.id===e.model.id):void 0)}showCatalogueModel(e){const i=this.current;if(!i||i.model.url!==void 0){this.shownEntry=void 0,this.element("body-model-catalogue").hidden=!0;return}this.shownEntry=e;const t=this.container.getRootNode().activeElement,s=[["body-model-url",e?.url],["body-model-title",e?.credit.title],["body-model-author",e?.credit.author],["body-model-license",e?.credit.license],["body-model-source",e?.credit.sourceUrl]];for(const[o,n]of s)this.input(o)!==t&&(this.input(o).value=n??"");this.element("body-model-catalogue").hidden=e===void 0,this.element("body-model-incomplete").hidden=!0}updateInterpretationTitle(){const e=this.interpretation??{bodies:[]},i=this.host.said().write(e.title,this.input("body-interpretation-title").value,this.host.writingLanguage());this.write({...e,title:i})}updateCurrent(){const e=this.current;e&&this.write({...this.interpretation,bodies:this.bodies.map(i=>i===e?{...e,model:this.statedModel(e.model)}:i)})}editBody(e){const i=this.current;if(!i)return;const t=structuredClone(i);e(t),this.currentId=t.id,this.write({...this.interpretation,bodies:this.bodies.map(s=>s===i?t:s)})}editView(e,i=!1){const t=this.current,s=this.keyframeView();if(!t||!s)return;const o=this.host.currentTime();e(s);const n=p.keyframeOf(s,o,t.track.find(r=>r.t===o),i),d=[...t.track.filter(r=>r.t!==o),n].sort((r,a)=>r.t-a.t);this.write({...this.interpretation,bodies:this.bodies.map(r=>r===t?{...t,track:d}:r)}),this.syncKeyframe()}async addBody(){if(!this.host.newBodyStart())return;const e=this.messages,i=await this.host.modelProvider().entries().catch(()=>[]),t=document.createElement("select"),s=document.createElement("optgroup");s.label=e.primitives,s.append(...u.map(n=>new Option(e.primitive[n],n)));const o=document.createElement("optgroup");o.label=e.catalogue,o.append(...i.map(n=>new Option(n.name,n.id))),t.append(s,o),this.host.modelPicker().chooseFrom(t,n=>this.modelSourceOf(n),n=>{this.createBody({id:n}),u.includes(n)||this.adoptCatalogueSize(n)},{current:()=>{},apply:n=>this.createBody({url:n.url,credit:n.title!==""&&n.license!==""?{title:n.title,license:n.license,author:n.author||void 0,sourceUrl:n.source||void 0}:void 0})})}createBody(e){const i=this.host.newBodyStart();if(!i)return;const t=new Set(this.bodies.map(d=>d.id));let s=t.size+1;for(;t.has(`body-${s}`);)s++;const o={id:`body-${s}`,explains:i.sourceId!==void 0?[i.sourceId]:void 0,model:e,track:[i.keyframe]};this.currentId=o.id;const n=this.interpretation??{bodies:[]};this.write({...n,bodies:[...this.bodies,o]},!0)}modelSourceOf(e){return u.includes(e)?Promise.resolve({shape:e}):this.host.modelProvider().entry(e).then(i=>i&&{url:i.url,headingOffsetDeg:i.headingOffsetDeg})}async adoptCatalogueSize(e){const t=(await this.host.modelProvider().entry(e).catch(()=>{}))?.sizeM,s=this.current;if(!t||!s||s.model.id!==e)return;if(!s.track.some(n=>n.sizeM)&&s.track.length>0){const[n,...d]=[...s.track].sort((l,c)=>l.t-c.t),r={widthM:t.widthM??1,lengthM:t.lengthM??t.widthM??1,heightM:t.heightM??1},a=[{...n,sizeM:r},...d];this.write({...this.interpretation,bodies:this.bodies.map(l=>l===s?{...s,track:a}:l)},!0);return}const o=s.track.map(n=>{const d=n.sizeM?.widthM,r=t.widthM??d;if(!n.sizeM||d===void 0||r===void 0||d<=0)return n;const a=r/d,l={widthM:t.widthM??n.sizeM.widthM*a,lengthM:t.lengthM??n.sizeM.lengthM*a,heightM:t.heightM??n.sizeM.heightM*a};return n.distanceM!==void 0&&n.azimuthDeg!==void 0?{...n,sizeM:l,distanceM:Number((n.distanceM*a).toFixed(1))}:{...n,sizeM:l}});this.write({...this.interpretation,bodies:this.bodies.map(n=>n===s?{...s,track:o}:n)},!0)}keyframeHere(){this.editView(()=>{})}get currentBodyId(){return this.current?.id}resize(e){const i=t=>Number(Math.max(.01,t).toFixed(2));this.editView(t=>Object.assign(t,{widthM:i(e.widthM),lengthM:i(e.lengthM),heightM:i(e.heightM)}))}turnTo(e){const i=t=>((t+180)%360+360)%360-180;this.editView(t=>Object.assign(t,{headingDeg:Number(((e.headingDeg%360+360)%360).toFixed(1)),pitchDeg:Number(Math.max(-90,Math.min(90,e.pitchDeg)).toFixed(1)),rollDeg:Number(i(e.rollDeg).toFixed(1))}))}show(e){!this.bodies.some(i=>i.id===e)||e===this.currentId||(this.currentId=e,this.sync())}readingNow(){const e=this.current;return e&&this.host.readingOf(e,this.host.currentTime())}dragTo(e,i){const t=this.readingNow();if(!t)return;const s=this.host.currentTime(),o=Math.PI/180,n=d=>Number(d.toFixed(2));this.editView(d=>{const r=d,a=r.onGround?this.host.groundAlong(e,i,s):void 0;if(r.mode==="world"){const l=Math.cos(t.altitudeDeg*o),c=t.eastM-Math.sin(t.azimuthDeg*o)*l*t.distanceM,m=t.northM-Math.cos(t.azimuthDeg*o)*l*t.distanceM,y=Math.hypot(t.eastM-c,t.northM-m),g=a!==void 0?a*Math.cos(i*o):y;if(r.eastM=n(c+Math.sin(e*o)*g),r.northM=n(m+Math.cos(e*o)*g),!r.onGround){const f=D=>Math.max(-89,Math.min(89,D))*o;r.aboveGroundM=n(Math.max(0,t.aboveGroundM+g*(Math.tan(f(i))-Math.tan(f(t.altitudeDeg)))))}}else r.azimuthDeg=n((e%360+360)%360),r.elevationDeg=n(Math.max(-90,Math.min(90,i))),a!==void 0&&(r.distanceM=n(a))})}scaleDistance(e){const i=this.readingNow();if(!i)return;const t=s=>Number(s.toFixed(2));this.editView(s=>{const o=s;if(o.mode==="world"){const n=Math.PI/180,d=Math.cos(i.altitudeDeg*n),r=i.eastM-Math.sin(i.azimuthDeg*n)*d*i.distanceM,a=i.northM-Math.cos(i.azimuthDeg*n)*d*i.distanceM;o.eastM=t(r+(i.eastM-r)*e),o.northM=t(a+(i.northM-a)*e)}else o.distanceM=t(Math.max(.1,i.distanceM*e))})}deleteKeyframe(){const e=this.current;if(!e)return;const i=this.host.currentTime(),t=e.track.filter(s=>s.t!==i);t.length!==e.track.length&&this.write({...this.interpretation,bodies:this.bodies.map(s=>s===e?{...e,track:t}:s)},!0)}static seconds(e){return`${Math.round(e/100)/10} s`}deleteCurrent(){const e=this.current;e&&(this.currentId=void 0,this.write({...this.interpretation,bodies:this.bodies.filter(i=>i!==e)},!0))}statedModel(e){const i=this.stringOrUndefined(this.input("body-model-url").value),t=this.shownEntry,s=n=>this.stringOrUndefined(this.input(n).value);if(t&&i===t.url&&s("body-model-title")===t.credit.title&&s("body-model-author")===t.credit.author&&s("body-model-license")===t.credit.license&&s("body-model-source")===t.credit.sourceUrl)return{id:t.id};if(i){const n=this.stringOrUndefined(this.input("body-model-title").value),d=this.stringOrUndefined(this.input("body-model-license").value);return{url:i,headingOffsetDeg:e.url!==void 0?e.headingOffsetDeg:void 0,credit:n!==void 0&&d!==void 0?{title:n,license:d,author:this.stringOrUndefined(this.input("body-model-author").value),sourceUrl:this.stringOrUndefined(this.input("body-model-source").value)}:void 0}}return{id:this.stringOrUndefined(this.select("body-model").value)??e.id??"ellipsoid"}}write(e,i=!1){const t=e.bodies.length===0&&e.title===void 0&&e.smoke===void 0&&e.flares===void 0&&e.lanterns===void 0;if(this.host.sighting().interpretation=t?void 0:e,this.host.changed(),i){this.sync();return}this.list?.setItems(this.bodies.map(o=>({id:o.id,label:this.labelOf(o)})),this.currentId);const s=this.current;s&&(this.element("body-model-incomplete").hidden=s.model.url===void 0||s.model.credit!==void 0,this.syncModelOptions(s))}labelOf(e){const i=this.host.said().read(e.title);return i?`${i} (${e.id})`:e.id}get interpretation(){return this.host.sighting().interpretation}get bodies(){return this.interpretation?.bodies??[]}get current(){return this.bodies.find(e=>e.id===this.currentId)}stringOrUndefined(e){const i=e.trim();return i===""?void 0:i}list;keyList;element(e){return this.container.querySelector("#"+e)}input(e){return this.element(e)}select(e){return this.element(e)}}export{b as BodyEditor};
|
|
27
|
+
</div>`;const t=this.element("body-list");this.list=new M({header:t,body:this.element("body-fields"),ids:{list:"body-select",remove:"body-delete",add:"body-add"},actions:[{id:"body-look",glyph:"🎯",onClick:()=>{const d=this.current;d&&this.host.lookAt(d)}}],onSelect:d=>{this.currentId=d,this.sync()},onAdd:()=>void this.addBody(),onRemove:()=>this.deleteCurrent()}),this.list.setLabels({list:e.body,remove:e.deleteBody,add:e.addBody,empty:e.none,actions:{"body-look":e.lookAtBody}}),this.input("body-interpretation-title").addEventListener("change",()=>this.updateInterpretationTitle());for(const d of["body-model-url","body-model-title","body-model-author","body-model-license","body-model-source"])this.input(d).addEventListener("change",()=>this.updateCurrent());this.select("body-model").addEventListener("change",()=>{const d=this.select("body-model").value;d!==""&&(this.input("body-model-url").value=""),this.updateCurrent(),this.syncModelOptions(this.current),d!==""&&this.adoptCatalogueSize(d),this.element("body-model-advanced").open=d!==""&&!u.includes(d)});const s=this.element("body-keys");this.keyList=new M({header:s,optional:!0,ids:{list:"body-key",remove:"body-key-delete",add:"body-key-add"},navigation:{scope:this.container,onStep:d=>this.stepKeyframe(d)},onSelect:d=>{d!==""&&this.host.seekTo(Number(d)),this.syncKeyframe(!0)},onAdd:()=>this.keyframeHere(),onRemove:()=>this.deleteKeyframe()}),this.keyList.setLabels({list:e.keyframes,remove:e.deleteKeyframe,add:e.addKeyframe,none:e.noKeyframeHere,previous:e.previousKeyframe,next:e.nextKeyframe}),this.host.modelPicker().enhance(this.select("body-model"),d=>this.modelSourceOf(d),{current:()=>{const d=this.current?.model;return d?.url===void 0?void 0:{url:d.url,title:d.credit?.title??"",author:d.credit?.author??"",license:d.credit?.license??"",source:d.credit?.sourceUrl??""}},apply:d=>{this.input("body-model-url").value=d.url,this.input("body-model-title").value=d.title,this.input("body-model-author").value=d.author,this.input("body-model-license").value=d.license,this.input("body-model-source").value=d.source,this.shownEntry=void 0,this.select("body-model").value="",this.updateCurrent(),this.syncModelOptions(this.current)}});const o=this.select("body-model").nextElementSibling;o&&(o.disabled=!0,o.title=e.modelFixed),this.input("body-model-url").readOnly=!0;const n={said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()};this.bodyForm=new v(this.element("body-parameters"),this.language,"body.",n),this.bodyForm.show(h.BODY,new k(()=>this.current,d=>this.editBody(d),()=>({ids:this.bodies.map(d=>d.id),shapes:this.host.shapes().map(d=>({value:d.id,label:d.label}))})),()=>{}),this.keyForm=new v(this.element("body-key-parameters"),this.language,"bodyKey."),this.keyForm.show(h.KEYFRAME,new k(()=>this.keyframeView(),(d,r)=>this.editView(d,b.APPEARANCE_KEYS.includes(r.key)),()=>this.keyframeContext(),this.host.positionPlace?.()),()=>{}),this.sync()}async syncModelOptions(e){const i=++this.catalogueToken,t=await this.host.modelProvider().entries().catch(()=>[]);if(i!==this.catalogueToken)return;const s=this.messages,o=this.select("body-model"),n=e.model.url===void 0?e.model.id:void 0,d=n===void 0||u.includes(n)||t.some(a=>a.id===n),r=[s.primitives,s.catalogue,t.map(a=>`${a.id}:${a.name}`).join(),e.model.url!==void 0,d?"":n].join("|");if(o.dataset.signature!==r){o.dataset.signature=r;const a=document.createElement("optgroup");a.label=s.primitives,a.append(...u.map(c=>new Option(s.primitive[c],c)));const l=document.createElement("optgroup");l.label=s.catalogue,l.append(...t.map(c=>new Option(c.name,c.id))),o.replaceChildren(a,l),e.model.url!==void 0&&o.prepend(new Option(s.modelAdvanced,"")),d||o.append(new Option(n,n))}o.value=n??"",this.showCatalogueModel(e.model.url===void 0?t.find(a=>a.id===e.model.id):void 0)}showCatalogueModel(e){const i=this.current;if(!i||i.model.url!==void 0){this.shownEntry=void 0,this.element("body-model-catalogue").hidden=!0;return}this.shownEntry=e;const t=this.container.getRootNode().activeElement,s=[["body-model-url",e?.url],["body-model-title",e?.credit.title],["body-model-author",e?.credit.author],["body-model-license",e?.credit.license],["body-model-source",e?.credit.sourceUrl]];for(const[o,n]of s)this.input(o)!==t&&(this.input(o).value=n??"");this.element("body-model-catalogue").hidden=e===void 0,this.element("body-model-incomplete").hidden=!0}updateInterpretationTitle(){const e=this.interpretation??{bodies:[]},i=this.host.said().write(e.title,this.input("body-interpretation-title").value,this.host.writingLanguage());this.write({...e,title:i})}updateCurrent(){const e=this.current;e&&this.write({...this.interpretation,bodies:this.bodies.map(i=>i===e?{...e,model:this.statedModel(e.model)}:i)})}editBody(e){const i=this.current;if(!i)return;const t=structuredClone(i);e(t),this.currentId=t.id,this.write({...this.interpretation,bodies:this.bodies.map(s=>s===i?t:s)})}editView(e,i=!1){const t=this.current,s=this.keyframeView();if(!t||!s)return;const o=this.host.currentTime();e(s);const n=p.keyframeOf(s,o,t.track.find(r=>r.t===o),i),d=[...t.track.filter(r=>r.t!==o),n].sort((r,a)=>r.t-a.t);this.write({...this.interpretation,bodies:this.bodies.map(r=>r===t?{...t,track:d}:r)}),this.syncKeyframe()}async addBody(){if(!this.host.newBodyStart())return;const e=this.messages,i=await this.host.modelProvider().entries().catch(()=>[]),t=document.createElement("select"),s=document.createElement("optgroup");s.label=e.primitives,s.append(...u.map(n=>new Option(e.primitive[n],n)));const o=document.createElement("optgroup");o.label=e.catalogue,o.append(...i.map(n=>new Option(n.name,n.id))),t.append(s,o),this.host.modelPicker().chooseFrom(t,n=>this.modelSourceOf(n),n=>{this.createBody({id:n}),u.includes(n)||this.adoptCatalogueSize(n)},{current:()=>{},apply:n=>this.createBody({url:n.url,credit:n.title!==""&&n.license!==""?{title:n.title,license:n.license,author:n.author||void 0,sourceUrl:n.source||void 0}:void 0})})}createBody(e){const i=this.host.newBodyStart();if(!i)return;const t=new Set(this.bodies.map(d=>d.id));let s=t.size+1;for(;t.has(`body-${s}`);)s++;const o={id:`body-${s}`,explains:i.sourceId!==void 0?[i.sourceId]:void 0,model:e,track:[i.keyframe]};this.currentId=o.id;const n=this.interpretation??{bodies:[]};this.write({...n,bodies:[...this.bodies,o]},!0)}modelSourceOf(e){return u.includes(e)?Promise.resolve({shape:e}):this.host.modelProvider().entry(e).then(i=>i&&{url:i.url,headingOffsetDeg:i.headingOffsetDeg})}async adoptCatalogueSize(e){const t=(await this.host.modelProvider().entry(e).catch(()=>{}))?.sizeM,s=this.current;if(!t||!s||s.model.id!==e)return;if(!s.track.some(n=>n.sizeM)&&s.track.length>0){const[n,...d]=[...s.track].sort((l,c)=>l.t-c.t),r={widthM:t.widthM??1,lengthM:t.lengthM??t.widthM??1,heightM:t.heightM??1},a=[{...n,sizeM:r},...d];this.write({...this.interpretation,bodies:this.bodies.map(l=>l===s?{...s,track:a}:l)},!0);return}const o=s.track.map(n=>{const d=n.sizeM?.widthM,r=t.widthM??d;if(!n.sizeM||d===void 0||r===void 0||d<=0)return n;const a=r/d,l={widthM:t.widthM??n.sizeM.widthM*a,lengthM:t.lengthM??n.sizeM.lengthM*a,heightM:t.heightM??n.sizeM.heightM*a};return n.distanceM!==void 0&&n.azimuthDeg!==void 0?{...n,sizeM:l,distanceM:Number((n.distanceM*a).toFixed(1))}:{...n,sizeM:l}});this.write({...this.interpretation,bodies:this.bodies.map(n=>n===s?{...s,track:o}:n)},!0)}keyframeHere(){this.editView(()=>{})}get currentBodyId(){return this.current?.id}resize(e){const i=t=>Number(Math.max(.01,t).toFixed(2));this.editView(t=>Object.assign(t,{widthM:i(e.widthM),lengthM:i(e.lengthM),heightM:i(e.heightM)}))}turnTo(e){const i=t=>((t+180)%360+360)%360-180;this.editView(t=>Object.assign(t,{headingDeg:Number(((e.headingDeg%360+360)%360).toFixed(1)),pitchDeg:Number(Math.max(-90,Math.min(90,e.pitchDeg)).toFixed(1)),rollDeg:Number(i(e.rollDeg).toFixed(1))}))}show(e){!this.bodies.some(i=>i.id===e)||e===this.currentId||(this.currentId=e,this.sync())}readingNow(){const e=this.current;return e&&this.host.readingOf(e,this.host.currentTime())}dragTo(e,i){const t=this.readingNow();if(!t)return;const s=this.host.currentTime(),o=Math.PI/180,n=d=>Number(d.toFixed(2));this.editView(d=>{const r=d,a=r.onGround?this.host.groundAlong(e,i,s):void 0;if(r.mode==="world"){const l=Math.cos(t.altitudeDeg*o),c=t.eastM-Math.sin(t.azimuthDeg*o)*l*t.distanceM,m=t.northM-Math.cos(t.azimuthDeg*o)*l*t.distanceM,y=Math.hypot(t.eastM-c,t.northM-m),g=a!==void 0?a*Math.cos(i*o):y;if(r.eastM=n(c+Math.sin(e*o)*g),r.northM=n(m+Math.cos(e*o)*g),!r.onGround){const f=D=>Math.max(-89,Math.min(89,D))*o;r.aboveGroundM=n(Math.max(0,t.aboveGroundM+g*(Math.tan(f(i))-Math.tan(f(t.altitudeDeg)))))}}else r.azimuthDeg=n((e%360+360)%360),r.elevationDeg=n(Math.max(-90,Math.min(90,i))),a!==void 0&&(r.distanceM=n(a))})}scaleDistance(e){const i=this.readingNow();if(!i)return;const t=s=>Number(s.toFixed(2));this.editView(s=>{const o=s;if(o.mode==="world"){const n=Math.PI/180,d=Math.cos(i.altitudeDeg*n),r=i.eastM-Math.sin(i.azimuthDeg*n)*d*i.distanceM,a=i.northM-Math.cos(i.azimuthDeg*n)*d*i.distanceM;o.eastM=t(r+(i.eastM-r)*e),o.northM=t(a+(i.northM-a)*e)}else o.distanceM=t(Math.max(.1,i.distanceM*e))})}deleteKeyframe(){const e=this.current;if(!e)return;const i=this.host.currentTime(),t=e.track.filter(s=>s.t!==i);t.length!==e.track.length&&this.write({...this.interpretation,bodies:this.bodies.map(s=>s===e?{...e,track:t}:s)},!0)}static seconds(e){return`${Math.round(e/100)/10} s`}deleteCurrent(){const e=this.current;e&&(this.currentId=void 0,this.write({...this.interpretation,bodies:this.bodies.filter(i=>i!==e)},!0))}statedModel(e){const i=this.stringOrUndefined(this.input("body-model-url").value),t=this.shownEntry,s=n=>this.stringOrUndefined(this.input(n).value);if(t&&i===t.url&&s("body-model-title")===t.credit.title&&s("body-model-author")===t.credit.author&&s("body-model-license")===t.credit.license&&s("body-model-source")===t.credit.sourceUrl)return{id:t.id};if(i){const n=this.stringOrUndefined(this.input("body-model-title").value),d=this.stringOrUndefined(this.input("body-model-license").value);return{url:i,headingOffsetDeg:e.url!==void 0?e.headingOffsetDeg:void 0,credit:n!==void 0&&d!==void 0?{title:n,license:d,author:this.stringOrUndefined(this.input("body-model-author").value),sourceUrl:this.stringOrUndefined(this.input("body-model-source").value)}:void 0}}return{id:this.stringOrUndefined(this.select("body-model").value)??e.id??"ellipsoid"}}write(e,i=!1){const t=e.bodies.length===0&&e.title===void 0&&e.smoke===void 0&&e.flares===void 0&&e.lanterns===void 0;if(this.host.sighting().interpretation=t?void 0:e,this.host.changed(),i){this.sync();return}this.list?.setItems(this.bodies.map(o=>({id:o.id,label:this.labelOf(o)})),this.currentId);const s=this.current;s&&(this.element("body-model-incomplete").hidden=s.model.url===void 0||s.model.credit!==void 0,this.syncModelOptions(s))}labelOf(e){const i=this.host.said().read(e.title);return i?`${i} (${e.id})`:e.id}get interpretation(){return this.host.sighting().interpretation}get bodies(){return this.interpretation?.bodies??[]}get current(){return this.bodies.find(e=>e.id===this.currentId)}stringOrUndefined(e){const i=e.trim();return i===""?void 0:i}list;keyList;element(e){return this.container.querySelector("#"+e)}input(e){return this.element(e)}select(e){return this.element(e)}}export{b as BodyEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={intro:"What the witness said the phenomenon was, in 3D: each body stands for one or more of the shapes drawn. Its movement comes from the file.",interpretationTitle:"Interpretation title",body:"Body",none:"No body yet: the witness said nothing of what it was, or it is still to be entered",deleteBody:"Delete body",addBody:"Add a body",addBodyHintView:"Where the witness is looking now",lookAtBody:"Look at it",addBodyHint:'Standing for the shape "{shape}", where the scene draws it now',model:"3D model",primitives:"Built-in shapes",catalogue:"Catalogue",modelAdvanced:"Model from an address",modelUrl:"glTF/GLB address",modelUrlHint:"Absolute, or relative to this sighting.json",modelTitle:"Model name",modelAuthor:"Author",modelLicense:"Licence",modelSource:"Where it came from",modelIncomplete:"Not drawn until the model's name and licence are given",modelFromCatalogue:"From the catalogue, which the recording names it by. Change a field and it becomes this recording's own address.",keyframes:"Keyframes",addKeyframe:"Add a keyframe at this instant",noKeyframeHere:"No keyframe at this instant",previousKeyframe:"Previous keyframe",nextKeyframe:"Next keyframe",atPlayhead:"At {t}",modelFixed:"The model is chosen when the body is added: for another one, delete this body and add one with it",keyframeHere:"A keyframe stands here: editing changes it",keyframeAdded:"Editing adds a keyframe here",appearanceNote:"The colour and the albedo paint the built-in shapes; a model of its own keeps its materials. Light of its own is what it gives out, lit or not.",deleteKeyframe:"Delete this keyframe",pictureHint:"On the picture: drag the body to move it, the wheel takes it nearer or further, the corners and sides size it, the stem turns it (with Shift: up and down pitches it, sideways rolls it).",notPlaced:"Not in the scene at this instant",primitive:{ellipsoid:"Ellipsoid",sphere:"Sphere",disc:"Disc",cylinder:"Cylinder",cone:"Cone",box:"Box",torus:"Torus",figure:"Human figure"}};export{e as bodyEditorMessages_en};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={intro:"Lo que el testigo dijo que era el fenómeno, en 3D: cada cuerpo representa una o varias de las formas dibujadas. Su movimiento viene del archivo.",interpretationTitle:"Título de la interpretación",body:"Cuerpo",none:"Aún no hay ningún cuerpo: el testigo no dijo nada de lo que era, o falta introducirlo",deleteBody:"Eliminar el cuerpo",addBody:"Añadir un cuerpo",addBodyHintView:"Donde mira el testigo en este momento",lookAtBody:"Mirarlo",addBodyHint:"Representando la forma «{shape}», donde la escena la dibuja en este momento",model:"Modelo 3D",primitives:"Formas básicas",catalogue:"Catálogo",modelAdvanced:"Modelo desde una dirección",modelUrl:"Dirección glTF/GLB",modelUrlHint:"Absoluta, o relativa a este sighting.json",modelTitle:"Nombre del modelo",modelAuthor:"Autor",modelLicense:"Licencia",modelSource:"Procedencia",modelIncomplete:"No se dibuja mientras falten el nombre y la licencia del modelo",modelFromCatalogue:"Del catálogo, por el que la grabación lo nombra. Cambia un campo y pasa a ser la dirección propia de esta grabación.",keyframes:"Fotogramas clave",addKeyframe:"Añadir un fotograma clave en este instante",noKeyframeHere:"Ningún fotograma clave en este instante",previousKeyframe:"Fotograma clave anterior",nextKeyframe:"Fotograma clave siguiente",atPlayhead:"En {t}",modelFixed:"El modelo se elige al añadir el cuerpo: para cambiarlo, elimine este cuerpo y añada otro con el nuevo modelo",keyframeHere:"Aquí hay un fotograma clave: editar lo modifica",keyframeAdded:"Editar añade aquí un fotograma clave",appearanceNote:"El color y el albedo pintan las formas básicas; un modelo propio conserva sus materiales. La luz propia es la que emite, esté iluminado o no.",deleteKeyframe:"Eliminar este fotograma clave",pictureHint:"En la imagen: arrastrar el cuerpo lo desplaza, la rueda lo acerca o lo aleja, las esquinas y los lados lo dimensionan, el vástago lo gira (con Mayús: arriba y abajo lo cabecean, los lados lo hacen alabear).",notPlaced:"No está en la escena en este instante",primitive:{ellipsoid:"Elipsoide",sphere:"Esfera",disc:"Disco",cylinder:"Cilindro",cone:"Cono",box:"Caja",torus:"Toro",figure:"Silueta humana"}};export{e as bodyEditorMessages_es};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={intro:"Ce que le témoin a dit que le phénomène était, en 3D : chaque corps représente une ou plusieurs des formes dessinées. Son mouvement vient du fichier.",interpretationTitle:"Titre de l'interprétation",body:"Corps",none:"Aucun corps pour l'instant : le témoin n'a rien dit de ce que c'était, ou c'est encore à saisir",deleteBody:"Supprimer le corps",addBody:"Ajouter un corps",addBodyHintView:"Là où le témoin regarde à cet instant",lookAtBody:"Le regarder",addBodyHint:"Représentant la forme « {shape} », là où la scène la dessine à cet instant",model:"Modèle 3D",primitives:"Formes de base",catalogue:"Catalogue",modelAdvanced:"Modèle depuis une adresse",modelUrl:"Adresse glTF/GLB",modelUrlHint:"Absolue, ou relative à ce sighting.json",modelTitle:"Nom du modèle",modelAuthor:"Auteur",modelLicense:"Licence",modelSource:"Provenance",modelIncomplete:"Pas dessiné tant que le nom et la licence du modèle manquent",modelFromCatalogue:"Du catalogue, par lequel l'enregistrement le nomme. Modifiez un champ et il devient l'adresse propre à cet enregistrement.",keyframes:"Images clés",addKeyframe:"Ajouter une image clé à cet instant",noKeyframeHere:"Aucune image clé à cet instant",previousKeyframe:"Image clé précédente",nextKeyframe:"Image clé suivante",atPlayhead:"À {t}",modelFixed:"Le modèle se choisit à l'ajout du corps : pour en changer, supprimez ce corps et ajoutez-en un avec l'autre modèle",keyframeHere:"Une image clé est ici : l'éditer la modifie",keyframeAdded:"Éditer ajoute une image clé ici",appearanceNote:"La couleur et l'albédo peignent les formes de base ; un modèle garde ses propres matériaux. La lumière propre est ce qu'il émet, éclairé ou non.",deleteKeyframe:"Supprimer cette image clé",pictureHint:"Sur l'image : glisser le corps le déplace, la molette le rapproche ou l'éloigne, les coins et les côtés le dimensionnent, la tige le tourne (avec Maj : haut et bas le cabrent, les côtés le font rouler).",notPlaced:"Pas dans la scène à cet instant",primitive:{ellipsoid:"Ellipsoïde",sphere:"Sphère",disc:"Disque",cylinder:"Cylindre",cone:"Cône",box:"Boîte",torus:"Tore",figure:"Silhouette humaine"}};export{e as bodyEditorMessages_fr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={intro:"Ciò che il testimone ha detto che era il fenomeno, in 3D: ogni corpo rappresenta una o più delle forme disegnate. Il suo movimento viene dal file.",interpretationTitle:"Titolo dell'interpretazione",body:"Corpo",none:"Ancora nessun corpo: il testimone non ha detto nulla di ciò che era, o è ancora da inserire",deleteBody:"Elimina il corpo",addBody:"Aggiungi un corpo",addBodyHintView:"Dove guarda il testimone in questo momento",lookAtBody:"Guardalo",addBodyHint:"In rappresentanza della forma «{shape}», dove la scena la disegna in questo momento",model:"Modello 3D",primitives:"Forme di base",catalogue:"Catalogo",modelAdvanced:"Modello da un indirizzo",modelUrl:"Indirizzo glTF/GLB",modelUrlHint:"Assoluto, o relativo a questo sighting.json",modelTitle:"Nome del modello",modelAuthor:"Autore",modelLicense:"Licenza",modelSource:"Provenienza",modelIncomplete:"Non disegnato finché mancano il nome e la licenza del modello",modelFromCatalogue:"Dal catalogo, con cui la registrazione lo nomina. Modifica un campo e diventa l'indirizzo proprio di questa registrazione.",keyframes:"Fotogrammi chiave",addKeyframe:"Aggiungi un fotogramma chiave a questo istante",noKeyframeHere:"Nessun fotogramma chiave a questo istante",previousKeyframe:"Fotogramma chiave precedente",nextKeyframe:"Fotogramma chiave successivo",atPlayhead:"A {t}",modelFixed:"Il modello si sceglie quando si aggiunge il corpo: per cambiarlo, elimina questo corpo e aggiungine uno con l'altro modello",keyframeHere:"Qui c'è un fotogramma chiave: modificarlo lo cambia",keyframeAdded:"Modificare aggiunge qui un fotogramma chiave",appearanceNote:"Il colore e l'albedo dipingono le forme di base; un modello proprio conserva i suoi materiali. La luce propria è quella che emette, illuminato o no.",deleteKeyframe:"Elimina questo fotogramma chiave",pictureHint:"Sull'immagine: trascinare il corpo lo sposta, la rotellina lo avvicina o lo allontana, gli angoli e i lati lo dimensionano, lo stelo lo ruota (con Maiusc: su e giù lo fanno beccheggiare, i lati lo fanno rollare).",notPlaced:"Non è nella scena in questo istante",primitive:{ellipsoid:"Ellissoide",sphere:"Sfera",disc:"Disco",cylinder:"Cilindro",cone:"Cono",box:"Scatola",torus:"Toro",figure:"Sagoma umana"}};export{e as bodyEditorMessages_it};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={event:"Evento",accountOf:"Observación de",passagesHeading:"Relatado en",interviewOf:"Entrevista a",untitledInterview:"Entrevista {n}",deleteInterviewQuestion:"¿Eliminar esta entrevista del caso? Nada se escribe hasta guardar el caso.",untitledReading:"Lectura {n}",eventsInTime:"Eventos · en orden cronológico",citedMoment:"Momento {k}, citado en {title}: «{quote}»",backToInterview:"Volver a la entrevista",openEvent:"Abrir",previousEvent:"Evento anterior",nextEvent:"Evento siguiente",kindReading:"Lectura",readingsCount:"{n} lectura(s)",untitledObservation:"Observación {n}",deleteRecording:"Quitar esta grabación del caso",deleteReadingQuestion:"¿Eliminar esta lectura? Nada se escribe hasta guardar el caso.",deleteObservationQuestion:"¿Eliminar esta observación del caso? Nada se escribe hasta guardar el caso.",deleteRefused:"Esta observación es interpretada por {n} lectura(s): elimínelas primero.",titleField:"Título de la interpretación",authorField:"Autor",addTitle:"Añadir un evento",kindField:"Tipo",kindObservation:"Observación",kindInterview:"Entrevista",witnessField:"Testigo",mediumField:"Medio",interviewerField:"Entrevistador",plainTitleField:"Título",sourceField:"Origen",sourceBlank:"Una grabación en blanco",sourceFile:"Un registro existente",observerField:"Testigo",fileField:"Archivo",loadFailed:"No se pudo leer esa grabación.",isACase:"Eso es un caso, no una grabación.",ok:"Aceptar",cancel:"Cancelar",caseHeading:"Caso",caseId:"Identificador",recordingId:"Identificador",idTaken:"Otra grabación del caso tiene este identificador.",idInvalid:"Un identificador se compone de letras, dígitos, guiones y guiones bajos, y empieza por una letra o un dígito.",idNeeded:"Una interpretación designa esta grabación por su identificador: no puede quedar vacío.",idDuplicated:"Dos eventos del caso tienen el identificador «{id}»: una interpretación que lo designa es ambigua.",readingUnresolved:"Una interpretación designa «{id}», que ningún evento del caso tiene como identificador, ni ninguna grabación que enumera.",caseTitle:"Título",caseTime:"Fecha",eventsTab:"Eventos",fileTab:"Archivo",importFile:"Cargar un archivo de caso",inputFileFromFile:"desde su disco",inputFileFromUrl:"desde una dirección",inputFileModeHint:"Pulsar para darlo de la otra forma: un archivo suyo o una dirección",inputFileLoad:"Cargar",fileNotACase:"Ese archivo no es un caso (no tiene eventos).",formatVersionError:"Este archivo indica la versión {found} de su formato; este UFO@home lee hasta la versión {supported}. Ábralo con un UFO@home más reciente.",fileInvalid:"Este texto aún no es JSON válido, o no es un caso: el caso conserva lo último que entendió.",fileLoading:"Cargando el editor…",add:"Añadir",addHint:"Añadir un evento",interpretationOf:"Interpretación de",interpretationOfNone:"—",exportButton:"Guardar",exportTitle:"Guardar el caso",exportAlso:"Guardar también las observaciones",addToCase:"Añadir a un caso",unsavedChanges:"Cambios sin guardar",discardQuestion:"Hay cambios que aún no se han guardado. ¿Cargar de todos modos y perderlos?",discardTitle:"Cambios sin guardar",discardOk:"Cargar de todos modos",leaveQuestion:"Hay cambios que aún no se han guardado. ¿Salir de todos modos y perderlos?",leaveOk:"Salir de todos modos"};export{e as caseEditorMessages_es};
|
|
1
|
+
const e={event:"Evento",accountOf:"Observación de",passagesHeading:"Relatado en",interviewOf:"Entrevista a",untitledInterview:"Entrevista {n}",deleteInterviewQuestion:"¿Eliminar esta entrevista del caso? Nada se escribe hasta guardar el caso.",untitledReading:"Lectura {n}",eventsInTime:"Eventos · en orden cronológico",citedMoment:"Momento {k}, citado en {title}: «{quote}»",backToInterview:"Volver a la entrevista",openEvent:"Abrir",previousEvent:"Evento anterior",nextEvent:"Evento siguiente",kindReading:"Lectura",readingsCount:"{n} lectura(s)",untitledObservation:"Observación {n}",deleteRecording:"Quitar esta grabación del caso",deleteReadingQuestion:"¿Eliminar esta lectura? Nada se escribe hasta guardar el caso.",deleteObservationQuestion:"¿Eliminar esta observación del caso? Nada se escribe hasta guardar el caso.",deleteRefused:"Esta observación es interpretada por {n} lectura(s): elimínelas primero.",titleField:"Título de la interpretación",authorField:"Autor",addTitle:"Añadir un evento",kindField:"Tipo",kindObservation:"Observación",kindInterview:"Entrevista",witnessField:"Testigo",mediumField:"Medio",interviewerField:"Entrevistador",plainTitleField:"Título",sourceField:"Origen",sourceBlank:"Una grabación en blanco",sourceFile:"Un registro existente",observerField:"Testigo",fileField:"Archivo",loadFailed:"No se pudo leer esa grabación.",isACase:"Eso es un caso, no una grabación.",ok:"Aceptar",cancel:"Cancelar",caseHeading:"Caso",caseId:"Identificador",recordingId:"Identificador",idTaken:"Otra grabación del caso tiene este identificador.",idInvalid:"Un identificador se compone de letras, dígitos, guiones y guiones bajos, y empieza por una letra o un dígito.",idNeeded:"Una interpretación designa esta grabación por su identificador: no puede quedar vacío.",idDuplicated:"Dos eventos del caso tienen el identificador «{id}»: una interpretación que lo designa es ambigua.",readingUnresolved:"Una interpretación designa «{id}», que ningún evento del caso tiene como identificador, ni ninguna grabación que enumera.",caseTitle:"Título",caseTime:"Fecha",eventsTab:"Eventos",fileTab:"Archivo",importFile:"Cargar un archivo de caso",inputFileFromFile:"desde su disco",inputFileFromUrl:"desde una dirección",inputFileModeHint:"Pulsar para darlo de la otra forma: un archivo suyo o una dirección",inputFileLoad:"Cargar",fileNotACase:"Ese archivo no es un caso (no tiene eventos).",formatVersionError:"Este archivo indica la versión {found} de su formato; este UFO@home lee hasta la versión {supported}. Ábralo con un UFO@home más reciente.",fileInvalid:"Este texto aún no es JSON válido, o no es un caso: el caso conserva lo último que entendió.",fileLoading:"Cargando el editor…",add:"Añadir",addHint:"Añadir un evento",interpretationOf:"Interpretación de",colon:": ",quoted:"«{text}»",interpretationOfNone:"—",exportButton:"Guardar",exportTitle:"Guardar el caso",exportAlso:"Guardar también las observaciones",addToCase:"Añadir a un caso",unsavedChanges:"Cambios sin guardar",discardQuestion:"Hay cambios que aún no se han guardado. ¿Cargar de todos modos y perderlos?",discardTitle:"Cambios sin guardar",discardOk:"Cargar de todos modos",leaveQuestion:"Hay cambios que aún no se han guardado. ¿Salir de todos modos y perderlos?",leaveOk:"Salir de todos modos"};export{e as caseEditorMessages_es};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={event:"Événement",accountOf:"Observation de",passagesHeading:"Relaté dans",interviewOf:"Interview de",untitledInterview:"Interview {n}",deleteInterviewQuestion:"Supprimer cet entretien du dossier ? Rien n'est écrit avant la sauvegarde du dossier.",untitledReading:"Lecture {n}",eventsInTime:"Événements · dans l'ordre du temps",citedMoment:"Moment {k}, cité dans {title} : « {quote} »",backToInterview:"Revenir à l'entretien",openEvent:"Ouvrir",previousEvent:"Événement précédent",nextEvent:"Événement suivant",kindReading:"Lecture",readingsCount:"{n} lecture(s)",untitledObservation:"Observation {n}",deleteRecording:"Retirer cet enregistrement du dossier",deleteReadingQuestion:"Supprimer cette lecture ? Rien n'est écrit avant la sauvegarde du dossier.",deleteObservationQuestion:"Supprimer cette observation du dossier ? Rien n'est écrit avant la sauvegarde du dossier.",deleteRefused:"Cette observation est interprétée par {n} lecture(s) : supprimez-les d'abord.",titleField:"Titre de l'interprétation",authorField:"Auteur",addTitle:"Ajouter un événement",kindField:"Type",kindObservation:"Observation",kindInterview:"Interview",witnessField:"Témoin",mediumField:"Moyen",interviewerField:"Enquêteur",plainTitleField:"Titre",sourceField:"Source",sourceBlank:"Un enregistrement vierge",sourceFile:"Un enregistrement existant",observerField:"Témoin",fileField:"Fichier",loadFailed:"Cet enregistrement n'a pas pu être lu.",isACase:"C'est un dossier, pas un enregistrement.",ok:"OK",cancel:"Annuler",caseHeading:"Dossier",caseId:"Identifiant",recordingId:"Identifiant",idTaken:"Un autre enregistrement du dossier porte cet identifiant.",idInvalid:"Un identifiant est fait de lettres, de chiffres, de tirets et de soulignés, et commence par une lettre ou un chiffre.",idNeeded:"Une interprétation désigne cet enregistrement par son identifiant : il ne peut pas rester vide.",idDuplicated:"Deux événements du dossier portent l'identifiant « {id} » : une interprétation qui le désigne est ambiguë.",readingUnresolved:"Une interprétation désigne « {id} », qu'aucun événement du dossier ne porte comme identifiant, ni aucun enregistrement qu'il liste.",caseTitle:"Titre",caseTime:"Date",eventsTab:"Événements",fileTab:"Fichier",importFile:"Charger un fichier de dossier",inputFileFromFile:"depuis votre disque",inputFileFromUrl:"depuis une adresse",inputFileModeHint:"Cliquer pour le donner autrement : un fichier à vous, ou une adresse",inputFileLoad:"Charger",fileNotACase:"Ce fichier n'est pas un dossier (il n'a pas d'événements).",formatVersionError:"Ce fichier indique la version {found} de son format ; cet UFO@home lit jusqu'à la version {supported}. Ouvrez-le avec un UFO@home plus récent.",fileInvalid:"Ce texte n'est pas encore du JSON valide, ou pas un dossier : le dossier garde ce qu'il a compris en dernier.",fileLoading:"Chargement de l'éditeur…",add:"Ajouter",addHint:"Ajouter un événement",interpretationOf:"Interprétation de",interpretationOfNone:"—",exportButton:"Sauver",exportTitle:"Sauver le dossier",exportAlso:"Sauver aussi les observations",addToCase:"Ajouter à un dossier",unsavedChanges:"Modifications non sauvées",discardQuestion:"Des modifications ne sont pas encore sauvées. Charger quand même et les perdre ?",discardTitle:"Modifications non sauvées",discardOk:"Charger quand même",leaveQuestion:"Des modifications ne sont pas encore sauvées. Quitter quand même et les perdre ?",leaveOk:"Quitter quand même"};export{e as caseEditorMessages_fr};
|
|
1
|
+
const e={event:"Événement",accountOf:"Observation de",passagesHeading:"Relaté dans",interviewOf:"Interview de",untitledInterview:"Interview {n}",deleteInterviewQuestion:"Supprimer cet entretien du dossier ? Rien n'est écrit avant la sauvegarde du dossier.",untitledReading:"Lecture {n}",eventsInTime:"Événements · dans l'ordre du temps",citedMoment:"Moment {k}, cité dans {title} : « {quote} »",backToInterview:"Revenir à l'entretien",openEvent:"Ouvrir",previousEvent:"Événement précédent",nextEvent:"Événement suivant",kindReading:"Lecture",readingsCount:"{n} lecture(s)",untitledObservation:"Observation {n}",deleteRecording:"Retirer cet enregistrement du dossier",deleteReadingQuestion:"Supprimer cette lecture ? Rien n'est écrit avant la sauvegarde du dossier.",deleteObservationQuestion:"Supprimer cette observation du dossier ? Rien n'est écrit avant la sauvegarde du dossier.",deleteRefused:"Cette observation est interprétée par {n} lecture(s) : supprimez-les d'abord.",titleField:"Titre de l'interprétation",authorField:"Auteur",addTitle:"Ajouter un événement",kindField:"Type",kindObservation:"Observation",kindInterview:"Interview",witnessField:"Témoin",mediumField:"Moyen",interviewerField:"Enquêteur",plainTitleField:"Titre",sourceField:"Source",sourceBlank:"Un enregistrement vierge",sourceFile:"Un enregistrement existant",observerField:"Témoin",fileField:"Fichier",loadFailed:"Cet enregistrement n'a pas pu être lu.",isACase:"C'est un dossier, pas un enregistrement.",ok:"OK",cancel:"Annuler",caseHeading:"Dossier",caseId:"Identifiant",recordingId:"Identifiant",idTaken:"Un autre enregistrement du dossier porte cet identifiant.",idInvalid:"Un identifiant est fait de lettres, de chiffres, de tirets et de soulignés, et commence par une lettre ou un chiffre.",idNeeded:"Une interprétation désigne cet enregistrement par son identifiant : il ne peut pas rester vide.",idDuplicated:"Deux événements du dossier portent l'identifiant « {id} » : une interprétation qui le désigne est ambiguë.",readingUnresolved:"Une interprétation désigne « {id} », qu'aucun événement du dossier ne porte comme identifiant, ni aucun enregistrement qu'il liste.",caseTitle:"Titre",caseTime:"Date",eventsTab:"Événements",fileTab:"Fichier",importFile:"Charger un fichier de dossier",inputFileFromFile:"depuis votre disque",inputFileFromUrl:"depuis une adresse",inputFileModeHint:"Cliquer pour le donner autrement : un fichier à vous, ou une adresse",inputFileLoad:"Charger",fileNotACase:"Ce fichier n'est pas un dossier (il n'a pas d'événements).",formatVersionError:"Ce fichier indique la version {found} de son format ; cet UFO@home lit jusqu'à la version {supported}. Ouvrez-le avec un UFO@home plus récent.",fileInvalid:"Ce texte n'est pas encore du JSON valide, ou pas un dossier : le dossier garde ce qu'il a compris en dernier.",fileLoading:"Chargement de l'éditeur…",add:"Ajouter",addHint:"Ajouter un événement",interpretationOf:"Interprétation de",colon:" : ",quoted:"« {text} »",interpretationOfNone:"—",exportButton:"Sauver",exportTitle:"Sauver le dossier",exportAlso:"Sauver aussi les observations",addToCase:"Ajouter à un dossier",unsavedChanges:"Modifications non sauvées",discardQuestion:"Des modifications ne sont pas encore sauvées. Charger quand même et les perdre ?",discardTitle:"Modifications non sauvées",discardOk:"Charger quand même",leaveQuestion:"Des modifications ne sont pas encore sauvées. Quitter quand même et les perdre ?",leaveOk:"Quitter quand même"};export{e as caseEditorMessages_fr};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={event:"Evento",accountOf:"Osservazione di",passagesHeading:"Riportato in",interviewOf:"Intervista a",untitledInterview:"Intervista {n}",deleteInterviewQuestion:"Eliminare questa intervista dal caso? Nulla viene scritto prima del salvataggio del caso.",untitledReading:"Lettura {n}",eventsInTime:"Eventi · in ordine di tempo",citedMoment:"Momento {k}, citato in {title}: «{quote}»",backToInterview:"Torna all'intervista",openEvent:"Apri",previousEvent:"Evento precedente",nextEvent:"Evento successivo",kindReading:"Lettura",readingsCount:"{n} lettura/e",untitledObservation:"Osservazione {n}",deleteRecording:"Togliere questa registrazione dal caso",deleteReadingQuestion:"Eliminare questa lettura? Nulla viene scritto prima del salvataggio del caso.",deleteObservationQuestion:"Eliminare questa osservazione dal caso? Nulla viene scritto prima del salvataggio del caso.",deleteRefused:"Questa osservazione è interpretata da {n} lettura/e: eliminale prima.",titleField:"Titolo dell'interpretazione",authorField:"Autore",addTitle:"Aggiungi un evento",kindField:"Tipo",kindObservation:"Osservazione",kindInterview:"Intervista",witnessField:"Testimone",mediumField:"Mezzo",interviewerField:"Intervistatore",plainTitleField:"Titolo",sourceField:"Origine",sourceBlank:"Una registrazione vuota",sourceFile:"Una registrazione esistente",observerField:"Testimone",fileField:"File",loadFailed:"Impossibile leggere quella registrazione.",isACase:"Questo è un caso, non una registrazione.",ok:"OK",cancel:"Annulla",caseHeading:"Caso",caseId:"Identificativo",recordingId:"Identificativo",idTaken:"Un'altra registrazione del caso ha questo identificativo.",idInvalid:"Un identificativo è fatto di lettere, cifre, trattini e trattini bassi, e inizia con una lettera o una cifra.",idNeeded:"Un'interpretazione designa questa registrazione con il suo identificativo: non può restare vuoto.",idDuplicated:"Due eventi del caso hanno l'identificativo «{id}»: un'interpretazione che lo designa è ambigua.",readingUnresolved:"Un'interpretazione designa «{id}», che nessun evento del caso ha come identificativo, né alcuna registrazione che elenca.",caseTitle:"Titolo",caseTime:"Data",eventsTab:"Eventi",fileTab:"File",importFile:"Carica un file di caso",inputFileFromFile:"dal proprio disco",inputFileFromUrl:"da un indirizzo",inputFileModeHint:"Fare clic per darlo nell'altro modo: un proprio file o un indirizzo",inputFileLoad:"Carica",fileNotACase:"Quel file non è un caso (non ha eventi).",formatVersionError:"Questo file indica la versione {found} del suo formato; questo UFO@home legge fino alla versione {supported}. Lo apra con un UFO@home più recente.",fileInvalid:"Questo testo non è ancora JSON valido, o non è un caso: il caso conserva l'ultimo che ha capito.",fileLoading:"Caricamento dell'editor…",add:"Aggiungi",addHint:"Aggiungi un evento",interpretationOf:"Interpretazione di",interpretationOfNone:"—",exportButton:"Salva",exportTitle:"Salva il caso",exportAlso:"Salva anche le osservazioni",addToCase:"Aggiungi a un caso",unsavedChanges:"Modifiche non salvate",discardQuestion:"Alcune modifiche non sono ancora state salvate. Caricare comunque e perderle?",discardTitle:"Modifiche non salvate",discardOk:"Carica comunque",leaveQuestion:"Alcune modifiche non sono ancora state salvate. Uscire comunque e perderle?",leaveOk:"Esci comunque"};export{e as caseEditorMessages_it};
|
|
1
|
+
const e={event:"Evento",accountOf:"Osservazione di",passagesHeading:"Riportato in",interviewOf:"Intervista a",untitledInterview:"Intervista {n}",deleteInterviewQuestion:"Eliminare questa intervista dal caso? Nulla viene scritto prima del salvataggio del caso.",untitledReading:"Lettura {n}",eventsInTime:"Eventi · in ordine di tempo",citedMoment:"Momento {k}, citato in {title}: «{quote}»",backToInterview:"Torna all'intervista",openEvent:"Apri",previousEvent:"Evento precedente",nextEvent:"Evento successivo",kindReading:"Lettura",readingsCount:"{n} lettura/e",untitledObservation:"Osservazione {n}",deleteRecording:"Togliere questa registrazione dal caso",deleteReadingQuestion:"Eliminare questa lettura? Nulla viene scritto prima del salvataggio del caso.",deleteObservationQuestion:"Eliminare questa osservazione dal caso? Nulla viene scritto prima del salvataggio del caso.",deleteRefused:"Questa osservazione è interpretata da {n} lettura/e: eliminale prima.",titleField:"Titolo dell'interpretazione",authorField:"Autore",addTitle:"Aggiungi un evento",kindField:"Tipo",kindObservation:"Osservazione",kindInterview:"Intervista",witnessField:"Testimone",mediumField:"Mezzo",interviewerField:"Intervistatore",plainTitleField:"Titolo",sourceField:"Origine",sourceBlank:"Una registrazione vuota",sourceFile:"Una registrazione esistente",observerField:"Testimone",fileField:"File",loadFailed:"Impossibile leggere quella registrazione.",isACase:"Questo è un caso, non una registrazione.",ok:"OK",cancel:"Annulla",caseHeading:"Caso",caseId:"Identificativo",recordingId:"Identificativo",idTaken:"Un'altra registrazione del caso ha questo identificativo.",idInvalid:"Un identificativo è fatto di lettere, cifre, trattini e trattini bassi, e inizia con una lettera o una cifra.",idNeeded:"Un'interpretazione designa questa registrazione con il suo identificativo: non può restare vuoto.",idDuplicated:"Due eventi del caso hanno l'identificativo «{id}»: un'interpretazione che lo designa è ambigua.",readingUnresolved:"Un'interpretazione designa «{id}», che nessun evento del caso ha come identificativo, né alcuna registrazione che elenca.",caseTitle:"Titolo",caseTime:"Data",eventsTab:"Eventi",fileTab:"File",importFile:"Carica un file di caso",inputFileFromFile:"dal proprio disco",inputFileFromUrl:"da un indirizzo",inputFileModeHint:"Fare clic per darlo nell'altro modo: un proprio file o un indirizzo",inputFileLoad:"Carica",fileNotACase:"Quel file non è un caso (non ha eventi).",formatVersionError:"Questo file indica la versione {found} del suo formato; questo UFO@home legge fino alla versione {supported}. Lo apra con un UFO@home più recente.",fileInvalid:"Questo testo non è ancora JSON valido, o non è un caso: il caso conserva l'ultimo che ha capito.",fileLoading:"Caricamento dell'editor…",add:"Aggiungi",addHint:"Aggiungi un evento",interpretationOf:"Interpretazione di",colon:": ",quoted:"«{text}»",interpretationOfNone:"—",exportButton:"Salva",exportTitle:"Salva il caso",exportAlso:"Salva anche le osservazioni",addToCase:"Aggiungi a un caso",unsavedChanges:"Modifiche non salvate",discardQuestion:"Alcune modifiche non sono ancora state salvate. Caricare comunque e perderle?",discardTitle:"Modifiche non salvate",discardOk:"Carica comunque",leaveQuestion:"Alcune modifiche non sono ancora state salvate. Uscire comunque e perderle?",leaveOk:"Esci comunque"};export{e as caseEditorMessages_it};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SightingFileEditor-
|
|
2
|
-
import{S as L,a as T,H as j,s as P,U as H,l as I,I as z,P as J,b as y,W as O,r as D,c as V,E as C,d as B,A as U,e as E,M as q,_ as A,f as G}from"./rr0-sighting-editor.mjs";import{interviewMessages_en as S}from"./InterviewMessages_en-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SightingFileEditor-BekK-f3R.js","./index-DSNA74v6.js","./sightingSchema-CnDwuCov.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{S as L,a as T,H as j,s as P,U as H,l as I,I as z,P as J,b as y,W as O,r as D,c as V,E as C,d as B,A as U,e as E,M as q,_ as A,f as G}from"./rr0-sighting-editor.mjs";import{interviewMessages_en as S}from"./InterviewMessages_en-BNau2xU8.js";import{InterviewMedia as N}from"./InterviewMedia-CvAxC62V.js";import{InterviewFile as g}from"./interviewJson-DXD8FSBX.js";const F="rr0-interview",Y=`
|
|
3
3
|
rr0-interview { display: block; --rr0-interview-line: color-mix(in srgb, currentColor 35%, transparent); }
|
|
4
4
|
rr0-interview [hidden] { display: none !important; }
|
|
5
5
|
rr0-interview .rr0-interview-status { font-size: .85em; opacity: .85; margin: 0 0 .5em; }
|
|
@@ -26,7 +26,7 @@ rr0-interview .turn .refs { display: flex; flex-wrap: wrap; gap: .25em; }
|
|
|
26
26
|
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;
|
|
27
27
|
padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: .15em; }
|
|
28
28
|
rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
|
|
29
|
-
`;class R extends HTMLElement{messages=S;said=new L(["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,t,r){e==="src"&&r!==t&&this.isConnected&&this.load()}connectedCallback(){R.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 t=e instanceof ShadowRoot?e:document.head;if(t.querySelector("style[data-rr0-interview]"))return;const r=document.createElement("style");r.dataset.rr0Interview="",r.textContent=Y,t.append(r)}async load(){const e=this.getAttribute("src"),t=++this.loadToken;if(this.loading=e??void 0,!e)return;const r=new URL(e,location.href).href;let s;try{s=g.read(await T.json(r))}catch{s=void 0}t===this.loadToken&&(this.base=r,this.json=s,this.draw())}async loadLocale(){const e=++this.localeToken,t=j.preferencesFor(this),r=P(t,H),s=r==="en"?S:await I(r);e===this.localeToken&&(this.said=new L(t),this.messages=s,this.draw())}speakerName(e,t){const r=g.speakerName(e,t),s=e.speakers?.[t]?.role;return r===s&&s in this.messages.roles?this.messages.roles[s]:r}seek(e,t){const r=this.json,s=t?g.said(t):void 0,i={sighting:e.sighting??g.sightingsOf(r)[0],at:e.at,...s?{quote:s}:{}};this.dispatchEvent(new CustomEvent(z,{bubbles:!0,composed:!0,detail:i}));const a=this.getAttribute("player");if(!a)return;const l=this.getRootNode().getElementById?.(a);typeof l?.seekTo=="function"&&(l.scrollIntoView?.({block:"center",behavior:"smooth"}),l.seekTo(i.at,i.sighting))}gap(e,t){const r=document.createElement(t),s=document.createElement("span");s.className="bar";const i=`${this.messages.redacted}
|
|
29
|
+
`;class R extends HTMLElement{messages=S;said=new L(["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,t,r){e==="src"&&r!==t&&this.isConnected&&this.load()}connectedCallback(){R.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 t=e instanceof ShadowRoot?e:document.head;if(t.querySelector("style[data-rr0-interview]"))return;const r=document.createElement("style");r.dataset.rr0Interview="",r.textContent=Y,t.append(r)}async load(){const e=this.getAttribute("src"),t=++this.loadToken;if(this.loading=e??void 0,!e)return;const r=new URL(e,location.href).href;let s;try{s=g.read(await T.json(r))}catch{s=void 0}t===this.loadToken&&(this.base=r,this.json=s,this.draw())}async loadLocale(){const e=++this.localeToken,t=j.preferencesFor(this),r=P(t,H),s=r==="en"?S:await I(r);e===this.localeToken&&(this.said=new L(t),this.messages=s,this.draw())}speakerName(e,t){const r=g.speakerName(e,t),s=e.speakers?.[t]?.role;return r===s&&s in this.messages.roles?this.messages.roles[s]:r}seek(e,t){const r=this.json,s=t?g.said(t):void 0,i={sighting:e.sighting??g.sightingsOf(r)[0],at:e.at,...s?{quote:s}:{}};this.dispatchEvent(new CustomEvent(z,{bubbles:!0,composed:!0,detail:i}));const a=this.getAttribute("player");if(!a)return;const l=this.getRootNode().getElementById?.(a);typeof l?.seekTo=="function"&&(l.scrollIntoView?.({block:"center",behavior:"smooth"}),l.seekTo(i.at,i.sighting))}gap(e,t){const r=document.createElement(t),s=document.createElement("span");s.className="bar";const i=`${this.messages.redacted}${this.messages.colon}${this.said.read(e)??""}`;return s.dataset.tip=i,s.tabIndex=0,s.setAttribute("role","img"),s.setAttribute("aria-label",i),r.append(s),r}saidNodes(e){if(!/[<&]/.test(e))return[document.createTextNode(e)];const t=document.createElement("template");t.innerHTML=e;for(const r of t.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(r.tagName)){r.remove();continue}for(const s of[...r.attributes])if(/^on/i.test(s.name)||/^\s*javascript:/i.test(s.value))r.removeAttribute(s.name);else if(["href","src"].includes(s.name))try{s.value=new URL(s.value,this.base??location.href).href}catch{}}return[...t.content.childNodes]}draw(){const e=this.messages,t=this.json;this.blocks.clear();const r=Array.isArray(t?.segments)?t.segments:[];if(!t||r.length===0){this.status.hidden=!0;const d=document.createElement("p");d.textContent=e.exchangesEmpty,this.turns.replaceChildren(d);return}const s=t.speakers??{},i=Object.keys(s);if(t.proofreading){const d=i.filter(h=>!["approved","covered"].includes(t.proofreading?.[h]?.status??""));this.status.textContent=d.length===0?e.proofreadAll:e.proofreadPending.replace("{names}",d.map(h=>this.speakerName(t,h)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const a=[];let n,l=!1,c,o;r.forEach((d,h)=>{const u=d.redacted?JSON.stringify(d.redacted.reason):void 0;if(u!==void 0&&c?.reason===u){this.blocks.set(h,c.block),d.speaker!==o&&(o=void 0);return}const p=document.createElement("div");p.className="turn",p.dataset.segment=String(h);const b=document.createElement("div");b.className="who";const x=document.createElement("span");if(x.textContent=d.redacted?"":this.speakerName(t,d.speaker),d.start!==void 0&&(p.dataset.time=g.clock(d.start,!0)),o!==d.speaker&&(n=document.createElement("div"),n.className="intervention",n.style.setProperty("--speaker-hue",String((Math.max(0,i.indexOf(d.speaker))*67+210)%360)),a.push(n),l=!1),d.redacted||(l&&p.classList.add("goes-on"),l=!0),n.append(p),o=d.speaker,b.append(x),d.redacted){p.classList.add("is-redacted");const v=this.gap(d.redacted.reason,"p");v.className="redacted",c={block:p,reason:u},p.append(b,v)}else{const v=document.createElement("p");if(v.className="said",d.parts){let k="";for(const w of d.parts){const $="redacted"in w?"▮":g.plain(w.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(k)&&/^[\p{L}\p{N}(«“▮]/u.test($)&&v.append(" "),"redacted"in w?v.append(this.gap(w.redacted.reason,"span")):v.append(...this.saidNodes(w.text)),k=$}}else v.append(...this.saidNodes(d.text??""));c=void 0,p.append(b,v)}if(d.refs?.length){const v=document.createElement("div");v.className="refs";for(const k of d.refs){const w=document.createElement("button");w.type="button",w.className="ref",w.innerHTML=J.PLAY,w.append(g.clock(k.at,!0)),w.addEventListener("click",()=>this.seek(k,d)),v.append(w)}p.append(v)}this.blocks.set(h,p)}),this.turns.replaceChildren(...a)}revealSegment(e){const t=this.blocks.get(e);t&&(t.scrollIntoView?.({block:"center"}),t.classList.add("flash"),window.setTimeout(()=>t.classList.remove("flash"),1600))}}function K(){customElements.get(F)||customElements.define(F,R)}class f{static partsOf(e){return e.parts?e.parts:e.redacted?[]:[{text:e.text??""}]}static shownRanges(e){const t=[];let r="",s=0;return e.forEach((i,a)=>{const n="redacted"in i?"▮":g.plain(i.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(r)&&/^[\p{L}\p{N}(«“▮]/u.test(n)&&(s+=1);const l="redacted"in i?0:n.length;t.push({part:a,from:s,to:s+l}),s+=l,r=n}),t}static words(e){return e.trim()===""?0:e.trim().split(/\s+/u).length}static redact(e,t,r,s){const i=[...f.partsOf(e)],a=f.shownRanges(i).find(x=>!("redacted"in i[x.part])&&t>=x.from&&r<=x.to);if(!a)return;const n=g.plain(i[a.part].text),l=/[\p{L}\p{N}'’-]/u;let c=t-a.from,o=r-a.from;for(;c>0&&l.test(n[c-1])&&l.test(n[c]);)c--;for(;o<n.length&&l.test(n[o])&&l.test(n[o-1]);)o++;const d=n.slice(c,o);if(d.trim()==="")return;const h=n.slice(0,c).trimEnd(),u=n.slice(o).trimStart(),p=[...h!==""?[{text:h}]:[],{redacted:{reason:s,words:f.words(d)}},...u!==""?[{text:u}]:[]],b=i.slice(0,a.part).filter(x=>"redacted"in x).length;return i.splice(a.part,1,...p),f.setParts(e,i),{text:d.trim(),nth:b}}static redactWhole(e,t){const r=JSON.stringify({text:e.text,parts:e.parts}),s=f.partsOf(e).reduce((i,a)=>i+("redacted"in a?a.redacted.words??0:f.words(g.plain(a.text))),0);if(delete e.text,delete e.parts,e.redacted={reason:t,...s>0?{words:s}:{}},e.refs)for(const i of e.refs)delete i.range;return r}static restoreWhole(e,t){const{text:r,parts:s}=JSON.parse(t);delete e.redacted,s?e.parts=s:e.text=r??""}static restorePart(e,t,r){const s=[...f.partsOf(e)];let i=-1;const a=s.findIndex(n=>"redacted"in n&&++i===t);a!==-1&&(s.splice(a,1,{text:r}),f.setParts(e,s))}static raw(e,t=()=>{}){let r=-1,s="",i="";for(const a of f.partsOf(e)){const n="redacted"in a?`⟦${t(++r)??"…"}⟧`:a.text;s!==""&&!/\s$/u.test(i)&&!/^\s/u.test(n)&&(s+=" "),s+=n,i=n}return s}static fromRaw(e,t,r){const s=f.partsOf(e).filter(l=>"redacted"in l),i=[],a=new Map;let n=-1;return t.split(/⟦([^⟧]*)⟧/u).forEach((l,c)=>{if(c%2===0){l.trim()!==""&&i.push({text:l.trim()});return}n++;const o=l.trim();o===""||o==="…"||o==="..."?i.push({redacted:s[n]?.redacted??{reason:r}}):(i.push({redacted:{reason:r,words:f.words(o)}}),a.set(n,o))}),delete e.redacted,f.setParts(e,i),a}static setParts(e,t){const r=[];for(const s of t){const i=r[r.length-1],a=!("redacted"in s)&&/^[,.;:!?)»”…]/u.test(s.text)?"":" ";i&&!("redacted"in i)&&!("redacted"in s)?r[r.length-1]={text:`${i.text}${a}${s.text}`.replace(/\s+/gu," ").trim()}:r.push(s)}if(r.some(s=>"redacted"in s)){if(e.parts=r,delete e.text,e.refs)for(const s of e.refs)delete s.range}else e.text=r.map(s=>s.text).join(" "),delete e.parts}}class W{constructor(e,t,r){this.host=t,this.messages=r,e.classList.add("player"),e.innerHTML=`<div class="player-video" hidden></div>
|
|
30
30
|
<div class="player-bar">
|
|
31
31
|
<button type="button" class="icon-btn player-play" disabled>${y.PLAY}</button>
|
|
32
32
|
<span class="player-time">0:00</span>
|
|
@@ -59,7 +59,7 @@ rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
|
|
|
59
59
|
.recording-file { display: flex; gap: 6px; }
|
|
60
60
|
.recording-status { grid-column: 1 / -1; margin: -4px 0 0; font-size: 12px; color: var(--ink-faint); }
|
|
61
61
|
.recording-status.error { color: var(--error); }
|
|
62
|
-
`;json;base;media;mediaFor="";picked=new Map;messages;play;time;end;track;video;empty;open;window;setMessages(e){this.messages=e,this.render()}show(e,t){this.json=e,this.base=t,this.render()}get now(){return this.media?Math.max(0,this.media.currentTime-(this.recordings[0]?.offset??0)):this.position}seek(e){this.position=Math.min(this.duration,Math.max(0,e)),this.media&&(this.media.currentTime=this.position+(this.recordings[0]?.offset??0)),this.placeHead(),this.host.timeChanged(this.position)}position=0;get recordings(){return Array.isArray(this.json?.recordings)?this.json.recordings:[]}get duration(){const e=this.media&&Number.isFinite(this.media.duration)?this.media.duration-(this.recordings[0]?.offset??0):0,t=Math.max(0,...(this.json?.segments??[]).map(r=>r.end??r.start??0));return Math.max(1,e,t)}render(){const e=this.messages,t=this.recordings;this.open.innerHTML='<svg class="icon" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M6 12V3.5l7-1.5V10.5"/><circle cx="4.5" cy="12" r="1.5"/><circle cx="11.5" cy="10.5" r="1.5"/></svg>',this.open.append(e.recordings.replace("{n}",String(t.length))),this.empty.textContent=t.length===0?e.noRecording:"",this.empty.hidden=t.length>0,this.play.title=e.play,this.play.setAttribute("aria-label",e.play),this.track.setAttribute("aria-label",e.recordingsTitle),this.ensureMedia(),this.drawTrack(),this.window.open&&this.drawRows()}ensureMedia(){const e=this.recordings[0],t=e?`${e.kind}|${e.src}`:"";if(t===this.mediaFor||(this.mediaFor=t,this.media?.pause(),this.media=void 0,this.video.replaceChildren(),this.video.hidden=!0,this.play.disabled=!0,!e||e.src===""))return;const r=document.createElement(e.kind==="video"?"video":"audio");r.preload="metadata",r.src=this.urlOf(e.src),r.addEventListener("loadedmetadata",()=>this.drawTrack()),r.addEventListener("timeupdate",()=>{this.placeHead(),this.host.timeChanged(this.now)});const s=()=>{const i=!r.paused;this.play.innerHTML=i?y.PAUSE:y.PLAY;const a=i?this.messages.pause:this.messages.play;this.play.title=a,this.play.setAttribute("aria-label",a)};r.addEventListener("play",s),r.addEventListener("pause",s),e.kind==="video"&&(this.video.append(r),this.video.hidden=!1),this.media=r,this.play.disabled=!1}urlOf(e){const t=this.picked.get(e);if(t)return t;try{return new URL(e,this.base??location.href).href}catch{return e}}drawTrack(){const e=this.json,t=this.duration,r=(e?.segments??[]).filter(i=>i.start!==void 0);this.track.replaceChildren(...r.map(i=>{const a=document.createElement("span"),n=e?.speakers?.[i.speaker]?.role;a.className=i.redacted?"seg redacted":"seg",a.dataset.role=n==="witness"||n==="interviewer"?n:"other";const l=i.start??0,c=i.end??l+1;return a.style.left=`${l/t*100}%`,a.style.width=`${Math.max(.3,(c-l)/t*100)}%`,a}));const s=document.createElement("span");s.className="head",this.track.append(s),this.track.setAttribute("aria-valuemax",String(Math.round(t))),this.end.textContent=g.clock(t),this.placeHead()}placeHead(){const e=this.now,t=this.track.querySelector(".head");t&&(t.style.left=`${Math.min(e,this.duration)/this.duration*100}%`),this.time.textContent=g.clock(Math.floor(e)),this.track.setAttribute("aria-valuenow",String(Math.round(e)))}showWindow(){this.drawRows(),typeof this.window.showModal=="function"?this.window.showModal():this.window.setAttribute("open","")}drawRows(){const e=this.messages;this.window.querySelector("h3").textContent=e.recordingsTitle,this.window.querySelector(".recording-add span").textContent=e.recordingAdd,O.dialog(this.window,e.close,()=>this.window.close()),this.window.querySelector(".recording-rows").replaceChildren(...this.recordings.map((r,s)=>{const i=document.createElement("div");i.className="recording-row";const a=document.createElement("select");a.append(new Option(e.recordingAudio,"audio"),new Option(e.recordingVideo,"video")),a.value=r.kind,a.addEventListener("change",()=>this.edit(p=>{p[s].kind=a.value}));const n=document.createElement("input");n.type="text",n.value=r.src,n.placeholder="interview.mp3",n.addEventListener("change",()=>this.edit(p=>{p[s].src=n.value.trim()}));const l=document.createElement("input");l.type="file",l.accept="audio/*,video/*",l.hidden=!0,l.addEventListener("change",()=>{const p=l.files?.[0];p&&(this.picked.set(p.name,URL.createObjectURL(p)),this.edit(b=>{b[s].src=p.name,p.type.startsWith("video/")&&(b[s].kind="video")}))});const c=document.createElement("button");c.type="button",c.className="icon-btn",c.title=e.recordingFile,c.setAttribute("aria-label",e.recordingFile),c.innerHTML='<svg class="icon" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M2.5 4.5h4l1.5 1.5h5.5v6.5h-11z"/></svg>',c.addEventListener("click",()=>l.click());const o=document.createElement("span");o.className="recording-file",o.append(n,c,l);const d=document.createElement("input");d.type="number",d.step="0.1",d.value=r.offset!==void 0?String(r.offset):"",d.placeholder="0",d.addEventListener("change",()=>this.edit(p=>{const b=Number(d.value);d.value.trim()===""||!Number.isFinite(b)||b===0?delete p[s].offset:p[s].offset=b}));const h=document.createElement("button");h.type="button",h.className="icon-btn",h.innerHTML=y.TRASH,h.title=e.recordingRemove,h.setAttribute("aria-label",e.recordingRemove),h.addEventListener("click",()=>this.edit(p=>{p.splice(s,1)}));const u=document.createElement("p");return u.className="recording-status",this.check(r,u),i.append(this.labelled(e.recordingKind,a),this.labelled(e.recordingFile,o),this.labelled(e.recordingOffset,d,"s"),h,u),i}))}labelled(e,t,r){const s=document.createElement("label"),i=document.createElement("span");return i.textContent=e,s.append(i,t),r&&s.append(` ${r}`),s}check(e,t){if(e.src==="")return;const r=document.createElement(e.kind==="video"?"video":"audio");r.preload="metadata",r.addEventListener("loadedmetadata",()=>{t.textContent=g.clock(Math.round(r.duration)),t.classList.remove("error")}),r.addEventListener("error",()=>{t.textContent=this.messages.loadFailed,t.classList.add("error")}),r.src=this.urlOf(e.src)}edit(e){const t=structuredClone(this.recordings);e(t),this.host.recordingsChanged(t)}}const
|
|
62
|
+
`;json;base;media;mediaFor="";picked=new Map;messages;play;time;end;track;video;empty;open;window;setMessages(e){this.messages=e,this.render()}show(e,t){this.json=e,this.base=t,this.render()}get now(){return this.media?Math.max(0,this.media.currentTime-(this.recordings[0]?.offset??0)):this.position}seek(e){this.position=Math.min(this.duration,Math.max(0,e)),this.media&&(this.media.currentTime=this.position+(this.recordings[0]?.offset??0)),this.placeHead(),this.host.timeChanged(this.position)}position=0;get recordings(){return Array.isArray(this.json?.recordings)?this.json.recordings:[]}get duration(){const e=this.media&&Number.isFinite(this.media.duration)?this.media.duration-(this.recordings[0]?.offset??0):0,t=Math.max(0,...(this.json?.segments??[]).map(r=>r.end??r.start??0));return Math.max(1,e,t)}render(){const e=this.messages,t=this.recordings;this.open.innerHTML='<svg class="icon" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M6 12V3.5l7-1.5V10.5"/><circle cx="4.5" cy="12" r="1.5"/><circle cx="11.5" cy="10.5" r="1.5"/></svg>',this.open.append(e.recordings.replace("{n}",String(t.length))),this.empty.textContent=t.length===0?e.noRecording:"",this.empty.hidden=t.length>0,this.play.title=e.play,this.play.setAttribute("aria-label",e.play),this.track.setAttribute("aria-label",e.recordingsTitle),this.ensureMedia(),this.drawTrack(),this.window.open&&this.drawRows()}ensureMedia(){const e=this.recordings[0],t=e?`${e.kind}|${e.src}`:"";if(t===this.mediaFor||(this.mediaFor=t,this.media?.pause(),this.media=void 0,this.video.replaceChildren(),this.video.hidden=!0,this.play.disabled=!0,!e||e.src===""))return;const r=document.createElement(e.kind==="video"?"video":"audio");r.preload="metadata",r.src=this.urlOf(e.src),r.addEventListener("loadedmetadata",()=>this.drawTrack()),r.addEventListener("timeupdate",()=>{this.placeHead(),this.host.timeChanged(this.now)});const s=()=>{const i=!r.paused;this.play.innerHTML=i?y.PAUSE:y.PLAY;const a=i?this.messages.pause:this.messages.play;this.play.title=a,this.play.setAttribute("aria-label",a)};r.addEventListener("play",s),r.addEventListener("pause",s),e.kind==="video"&&(this.video.append(r),this.video.hidden=!1),this.media=r,this.play.disabled=!1}urlOf(e){const t=this.picked.get(e);if(t)return t;try{return new URL(e,this.base??location.href).href}catch{return e}}drawTrack(){const e=this.json,t=this.duration,r=(e?.segments??[]).filter(i=>i.start!==void 0);this.track.replaceChildren(...r.map(i=>{const a=document.createElement("span"),n=e?.speakers?.[i.speaker]?.role;a.className=i.redacted?"seg redacted":"seg",a.dataset.role=n==="witness"||n==="interviewer"?n:"other";const l=i.start??0,c=i.end??l+1;return a.style.left=`${l/t*100}%`,a.style.width=`${Math.max(.3,(c-l)/t*100)}%`,a}));const s=document.createElement("span");s.className="head",this.track.append(s),this.track.setAttribute("aria-valuemax",String(Math.round(t))),this.end.textContent=g.clock(t),this.placeHead()}placeHead(){const e=this.now,t=this.track.querySelector(".head");t&&(t.style.left=`${Math.min(e,this.duration)/this.duration*100}%`),this.time.textContent=g.clock(Math.floor(e)),this.track.setAttribute("aria-valuenow",String(Math.round(e)))}showWindow(){this.drawRows(),typeof this.window.showModal=="function"?this.window.showModal():this.window.setAttribute("open","")}drawRows(){const e=this.messages;this.window.querySelector("h3").textContent=e.recordingsTitle,this.window.querySelector(".recording-add span").textContent=e.recordingAdd,O.dialog(this.window,e.close,()=>this.window.close()),this.window.querySelector(".recording-rows").replaceChildren(...this.recordings.map((r,s)=>{const i=document.createElement("div");i.className="recording-row";const a=document.createElement("select");a.append(new Option(e.recordingAudio,"audio"),new Option(e.recordingVideo,"video")),a.value=r.kind,a.addEventListener("change",()=>this.edit(p=>{p[s].kind=a.value}));const n=document.createElement("input");n.type="text",n.value=r.src,n.placeholder="interview.mp3",n.addEventListener("change",()=>this.edit(p=>{p[s].src=n.value.trim()}));const l=document.createElement("input");l.type="file",l.accept="audio/*,video/*",l.hidden=!0,l.addEventListener("change",()=>{const p=l.files?.[0];p&&(this.picked.set(p.name,URL.createObjectURL(p)),this.edit(b=>{b[s].src=p.name,p.type.startsWith("video/")&&(b[s].kind="video")}))});const c=document.createElement("button");c.type="button",c.className="icon-btn",c.title=e.recordingFile,c.setAttribute("aria-label",e.recordingFile),c.innerHTML='<svg class="icon" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M2.5 4.5h4l1.5 1.5h5.5v6.5h-11z"/></svg>',c.addEventListener("click",()=>l.click());const o=document.createElement("span");o.className="recording-file",o.append(n,c,l);const d=document.createElement("input");d.type="number",d.step="0.1",d.value=r.offset!==void 0?String(r.offset):"",d.placeholder="0",d.addEventListener("change",()=>this.edit(p=>{const b=Number(d.value);d.value.trim()===""||!Number.isFinite(b)||b===0?delete p[s].offset:p[s].offset=b}));const h=document.createElement("button");h.type="button",h.className="icon-btn",h.innerHTML=y.TRASH,h.title=e.recordingRemove,h.setAttribute("aria-label",e.recordingRemove),h.addEventListener("click",()=>this.edit(p=>{p.splice(s,1)}));const u=document.createElement("p");return u.className="recording-status",this.check(r,u),i.append(this.labelled(e.recordingKind,a),this.labelled(e.recordingFile,o),this.labelled(e.recordingOffset,d,"s"),h,u),i}))}labelled(e,t,r){const s=document.createElement("label"),i=document.createElement("span");return i.textContent=e,s.append(i,t),r&&s.append(` ${r}`),s}check(e,t){if(e.src==="")return;const r=document.createElement(e.kind==="video"?"video":"audio");r.preload="metadata",r.addEventListener("loadedmetadata",()=>{t.textContent=g.clock(Math.round(r.duration)),t.classList.remove("error")}),r.addEventListener("error",()=>{t.textContent=this.messages.loadFailed,t.classList.add("error")}),r.src=this.urlOf(e.src)}edit(e){const t=structuredClone(this.recordings);e(t),this.host.recordingsChanged(t)}}const M="rr0-interview-editor",X=`
|
|
63
63
|
<style>
|
|
64
64
|
:host { display: block; }
|
|
65
65
|
/* The colours of the transcript's text editor (see SightingFileEditor): a key, a string, a number or a word, and a mistake. Dark mode redefines them. */
|
|
@@ -126,7 +126,8 @@ rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
|
|
|
126
126
|
#group-summary input[type="text"], #group-transcript input[type="text"] { height: 38px; }
|
|
127
127
|
#group-summary textarea { min-height: 9em; }
|
|
128
128
|
fieldset.witnesses { flex-direction: column; align-items: flex-start; gap: 6px; font: 600 13px/1.3 var(--sans); color: var(--ink-dim); }
|
|
129
|
-
|
|
129
|
+
/* A witness's name stays on one line beside its box: shrunk to its words, the label broke "Q. B." in two. */
|
|
130
|
+
#group-summary fieldset.witnesses label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); white-space: nowrap; }
|
|
130
131
|
/* The exchanges, one card an intervention, the speaker's colour down its side: a list that scrolls past 520 px (440 on a phone). */
|
|
131
132
|
#exchanges { --rr0-interview-max-height: 520px; --rr0-interview-line: var(--line-strong); }
|
|
132
133
|
#exchanges .rr0-interview-turns { padding-right: 4px; }
|
|
@@ -227,4 +228,4 @@ rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
|
|
|
227
228
|
</section>
|
|
228
229
|
</div>
|
|
229
230
|
`;class m extends HTMLElement{shadow=this.attachShadow({mode:"open"});get importInput(){return this.shadow.getElementById("import")}messages=S;said=new L(["en"]);language="en";localeToken=0;current;options=[];group="summary";base;text;fileEditor;fileEditorLoading;shownFor;player;drawn;takenOut=new Map;constructor(){super(),this.shadow.innerHTML=X,customElements.upgrade(this.shadow),this.importInput.build();for(const e of["title","time","by","url","summary","witness","medium"])this.shadow.getElementById(e).addEventListener(e==="witness"||e==="medium"?"change":"input",()=>this.write(e));for(const e of this.shadow.querySelectorAll("#tabs .group-tab"))e.addEventListener("click",()=>this.openGroup(m.GROUPS[e.getAttribute("aria-controls")]??"summary"));this.shadow.getElementById("url").addEventListener("change",()=>{this.shownFor=void 0,this.text===void 0&&this.group==="file"&&this.showTranscript()}),this.importInput.addEventListener("filepick",e=>{const t=e.detail;t.file?this.importFromFile(t.file):this.importFromUrl(t.url)}),this.shadow.getElementById("save").addEventListener("click",()=>this.save()),this.player=new W(this.shadow.getElementById("player"),{timeChanged:e=>this.markCurrentTurn(e),recordingsChanged:e=>void this.editTranscript(t=>{e.length===0?delete t.recordings:t.recordings=e})},this.messages),this.shadow.getElementById("redact-selection").addEventListener("click",()=>void this.redactSelection()),this.shadow.getElementById("exchanges").addEventListener("click",e=>{const t=e.target.closest(".bar[data-restorable]");t&&this.restore(t.dataset.restorable)})}static GROUPS={"group-summary":"summary","group-exchanges":"exchanges","group-transcript":"file"};static get observedAttributes(){return["readonly"]}attributeChangedCallback(){this.applyReadonly()}connectedCallback(){this.loadLocale()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||this.releaseFileEditor()})}releaseFileEditor(){this.fileEditor&&(this.text=this.fileEditor.text,this.fileEditor.destroy(),this.fileEditor=void 0,this.fileEditorLoading=void 0,this.shownFor=void 0)}get event(){return this.current}set event(e){e!==this.current&&(this.shownFor=void 0),this.current=e,this.render(),this.takenOut.clear(),this.group==="file"&&this.showTranscript(),queueMicrotask(()=>{this.current===e&&this.showExchanges()})}set witnesses(e){this.options=e,this.render()}set documentUrl(e){this.base=e}get transcriptText(){return this.text}set transcriptText(e){this.text=e,this.shownFor=void 0}field(e){return this.shadow.getElementById(e)}async loadLocale(){const e=++this.localeToken,t=j.preferencesFor(this),r=P(t,H),s=r==="en"?S:await I(r);e===this.localeToken&&(this.language=r,this.said=new L(t),this.messages=s,this.render())}applyReadonly(){const e=this.hasAttribute("readonly");for(const t of["title","time","by","url","summary"])this.field(t).readOnly=e;for(const t of this.shadow.querySelectorAll("#witness input"))t.disabled=e;this.field("medium").disabled=e,this.importInput.disabled=e}static byText(e){return(e??[]).map(t=>"people"in t?t.people:"org"in t?t.org:t.title??"").filter(t=>t!=="").join(", ")}render(){const e=this.messages,t=(o,d)=>{this.shadow.getElementById(o).textContent=d};t("label-summary-group",e.summaryTab),t("label-file-group",e.fileTab),t("label-exchanges-group",e.exchangesTab),t("label-title",e.title),t("label-witness",e.witness),t("label-medium",e.medium),t("label-time",e.time),t("label-by",e.by),t("label-summary",e.summary),t("label-url",e.transcript),B.say(this.shadow.getElementById("label-import-file"),e.importFile,e.importFileHint),t("redact-selection",e.redactSelection),this.player?.setMessages(e),this.importInput.messages=e,t("save",e.saveButton),this.field("url").title=e.transcriptHint,this.field("by").title=e.byHint;const r=this.current,s=this.shadow.activeElement,i=(o,d)=>{this.field(o)!==s&&(this.field(o).value=d)};i("title",this.said.read(r?.title)??""),i("time",r?.time??""),i("by",m.byText(r?.by)),i("url",r?.url??""),i("summary",this.said.read(r?.summary)??"");const a=[r?.interviewOf].flat().filter(o=>typeof o=="string"),n=this.shadow.getElementById("witness"),l=[...this.options,...a.filter(o=>!this.options.some(d=>d.id===o)).map(o=>({id:o,label:o}))];n.replaceChildren(n.querySelector("legend"),...l.map(o=>{const d=document.createElement("label"),h=document.createElement("input");return h.type="checkbox",h.value=o.id,h.checked=a.includes(o.id),d.append(h,o.label),d}));const c=this.shadow.getElementById("medium");if(c.replaceChildren(...N.ALL.map(o=>new Option(N.label(o,this.language),o))),r?.medium!==void 0&&!N.ALL.includes(r.medium)&&c.append(new Option(String(r.medium),String(r.medium))),r?.medium===void 0){const o=new Option(e.witnessNone,"");o.disabled=!0,o.hidden=!0,c.prepend(o)}c.value=r?.medium??"",this.applyReadonly()}write(e){const t=this.current;if(!t)return;const r=e==="witness"?"":this.field(e).value;switch(e){case"title":{const s=this.said.write(t.title,r,this.language);s===void 0?delete t.title:t.title=s;break}case"summary":{const s=this.said.write(t.summary,r,this.language);s===void 0?delete t.summary:t.summary=s;break}case"time":r.trim()===""?delete t.time:t.time=r.trim();break;case"url":r.trim()===""?delete t.url:t.url=r.trim();break;case"by":{const s=r.split(",").map(i=>i.trim()).filter(i=>i!=="");s.length===0?delete t.by:t.by=s.map(i=>({people:i}));break}case"witness":{const s=[...this.shadow.querySelectorAll("#witness input:checked")].map(i=>i.value);if(s.length===0){this.render();return}t.interviewOf=s.length===1?s[0]:s;break}case"medium":r===""?delete t.medium:t.medium=r;break}this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:e,event:t}})),e==="medium"&&this.render(),e!=="url"&&this.syncFileFromEvent()}openGroup(e){this.group=e;const t={summary:"group-summary",exchanges:"group-exchanges",file:"group-transcript"};for(const r of this.shadow.querySelectorAll("#tabs .group-tab"))r.setAttribute("aria-expanded",String(r.getAttribute("aria-controls")===t[e]));for(const[r,s]of Object.entries(t))this.shadow.getElementById(s).hidden=r!==e;e==="file"&&this.showTranscript(),e==="exchanges"&&this.showExchanges()}exchangesToken=0;async transcriptJson(e){try{const t=this.fileEditor?.text??this.text;if(t!==void 0)return g.read(JSON.parse(t));const r=this.transcriptUrl(e);if(r!==void 0)return g.read(await T.json(r))}catch{}}async showExchanges(){const e=this.current;if(!e)return;const t=++this.exchangesToken,r=await this.transcriptJson(e);t!==this.exchangesToken||this.current!==e||this.drawExchanges(r)}drawExchanges(e){const t=this.shadow.getElementById("exchanges");t.documentUrl=this.current?this.transcriptUrl(this.current):void 0,t.interview=e,this.drawn=e,this.player.show(e,this.current?this.transcriptUrl(this.current):void 0),this.renderReview(e),this.decorateExchanges(e)}async editTranscript(e){const t=this.current;if(!t||this.hasAttribute("readonly"))return;const r=await this.transcriptJson(t)??JSON.parse(this.template(t));Array.isArray(r.segments)||(r.segments=[]),e(r);const s=m.pretty(m.withEventFields(r,t));this.fileEditor?.replaceText(s,!1),this.onEdited(s)}get redactReason(){return this.said.write(void 0,this.messages.redactReason,this.language)??this.messages.redactReason}speakerLabel(e,t){const r=g.speakerName(e,t),s=e.speakers?.[t]?.role;return r===s&&s in this.messages.roles?this.messages.roles[s]:r}renderReview(e){const t=this.shadow.getElementById("review"),r=Object.keys(e?.speakers??{});if(t.hidden=!e||r.length===0,!e||r.length===0)return;const s=l=>["approved","covered"].includes(e.proofreading?.[l]?.status??""),i=r.filter(l=>!s(l)),a=document.createElement("span");a.textContent=i.length===0?this.messages.proofreadAll:this.messages.proofreadPending.replace("{names}",i.map(l=>this.speakerLabel(e,l)).join(", ")),t.toggleAttribute("data-done",i.length===0);const n=document.createElement("span");n.className="review-boxes";for(const l of r){const c=document.createElement("label"),o=document.createElement("input");o.type="checkbox",o.checked=s(l),o.disabled=this.hasAttribute("readonly"),o.addEventListener("change",()=>void this.editTranscript(d=>{d.proofreading??={},o.checked?d.proofreading[l]={status:"approved",date:new Date().toISOString().slice(0,10)}:d.proofreading[l]={status:"pending"}})),c.append(o,this.messages.reviewedBy.replace("{name}",this.speakerLabel(e,l))),n.append(c)}t.replaceChildren(a,n)}momentsOf(e,t){const r=e.speakers?.[t]?.of??g.sightingsOf(e)[0];return this.options.find(s=>s.id===r)?.moments??this.options.flatMap(s=>s.moments??[])}decorateExchanges(e){if(!e)return;const t=this.messages,r=this.hasAttribute("readonly");for(const s of this.shadow.querySelectorAll("#exchanges .turn[data-segment]")){const i=Number(s.dataset.segment),a=e.segments[i];if(!a)continue;if(a.start!==void 0){const c=document.createElement("button");c.type="button",c.className="turn-time",c.textContent=g.clock(a.start),c.addEventListener("click",()=>this.player.seek(a.start)),s.prepend(c)}const n=a.redacted?[a.redacted]:f.partsOf(a).flatMap(c=>"redacted"in c?[c.redacted]:[]);s.querySelectorAll(".bar").forEach((c,o)=>{const d=n[o]?.words;c.textContent=d!==void 0?t.redactedWords.replace("{n}",String(d)):t.redacted,c.classList.add("redacted-label");const h=a.redacted?`${i}:all`:`${i}:${o}`;this.takenOut.has(h)&&(c.dataset.restorable=h)});const l=this.momentsOf(e,a.speaker);s.querySelectorAll(".ref").forEach((c,o)=>{const d=a.refs?.[o];if(!d)return;const h=l.find(p=>Math.abs(p.at-d.at)<.05);if(h){const p=document.createElement("span");p.className="moment-letter",p.textContent=h.label.slice(0,2),c.replaceChildren(p,t.momentLabel.replace("{k}",h.label).replace("{text}",h.note??g.clock(d.at)))}if(r)return;const u=document.createElement("button");u.type="button",u.className="ref-unlink",u.textContent="×",u.title=t.unlinkMoment,u.setAttribute("aria-label",t.unlinkMoment),u.addEventListener("click",()=>void this.editTranscript(p=>{p.segments[i].refs?.splice(o,1),p.segments[i].refs?.length===0&&delete p.segments[i].refs})),c.after(u)}),r||s.append(this.turnTools(e,i,a,l))}}turnTools(e,t,r,s){const i=this.messages,a=document.createElement("div");a.className="turn-tools";const n=(o,d)=>{const h=document.createElement("button");return h.type="button",h.textContent=o,h.addEventListener("click",d),h};if(e.speakers?.[r.speaker]?.role==="witness"&&!r.redacted){const o=n(i.linkMoment,()=>{});a.append(o),new U(o,`moment-menu-${t}`,h=>void this.editTranscript(u=>{const p=u.segments[t].refs??[];p.some(b=>Math.abs(b.at-Number(h))<.05)||p.push({at:Number(h)}),u.segments[t].refs=p}),h=>`moment-${t}-${h}`).setKinds(s.length>0?s.map(h=>({value:String(h.at),label:i.momentLabel.replace("{k}",h.label).replace("{text}",h.note??g.clock(h.at))})):[{value:"",label:i.noMoments,disabledReason:i.noMoments}])}r.redacted||a.append(n(i.editTurn,()=>this.editTurn(t)));const l=this.takenOut.has(`${t}:all`)||[...this.takenOut.keys()].some(o=>o.startsWith(`${t}:`));if(r.redacted||r.parts&&l){const o=n(i.restoreAll,()=>void this.restoreAll(t));o.disabled=!l,a.append(o)}else a.append(n(i.redactAll,()=>void this.editTranscript(o=>{this.forget(t),this.takenOut.set(`${t}:all`,f.redactWhole(o.segments[t],this.redactReason))})));const c=n("",()=>void this.editTranscript(o=>{o.segments.splice(t,1),this.shiftTakenOut(t)}));return c.className="icon-btn",c.innerHTML=y.TRASH,c.title=i.deleteTurn,c.setAttribute("aria-label",i.deleteTurn),a.append(c),a}async redactSelection(){const e=this.messages,t=this.shadow.getElementById("redact-note"),r=(h,u=!1)=>{t.textContent=h,t.classList.toggle("error",u)},s=this.shadow.getSelection?.()??document.getSelection(),i=s&&s.rangeCount>0?s.getRangeAt(0):void 0;if(!i||i.collapsed){r(e.selectionNone);return}const a=h=>h instanceof Element?h:h.parentElement,n=a(i.startContainer)?.closest(".said");if(!n||a(i.endContainer)?.closest(".said")!==n||a(i.startContainer)?.closest(".bar")||a(i.endContainer)?.closest(".bar")){r(e.selectionOnePassage,!0);return}const l=Number(n.closest(".turn").dataset.segment),c=m.offsetIn(n,i.startContainer,i.startOffset),o=m.offsetIn(n,i.endContainer,i.endOffset);let d=!1;await this.editTranscript(h=>{const u=f.redact(h.segments[l],Math.min(c,o),Math.max(c,o),this.redactReason);u&&(d=!0,this.shiftParts(l,u.nth),this.takenOut.set(`${l}:${u.nth}`,u.text))}),s?.removeAllRanges(),r(d?"":e.selectionOnePassage,!d)}static offsetIn(e,t,r){let s=0;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:a=>a.parentElement?.closest(".bar")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let a=i.nextNode();a;a=i.nextNode()){if(a===t)return s+r;if(t.contains(a)&&t!==a){const l=[...t.childNodes].slice(0,r);return s+l.reduce((c,o)=>c+(o instanceof Element&&o.closest(".bar")?0:(o.textContent??"").length),0)}s+=(a.textContent??"").length}return s}async restore(e){const t=this.takenOut.get(e);if(t===void 0)return;const[r,s]=e.split(":"),i=Number(r);await this.editTranscript(a=>{s==="all"?f.restoreWhole(a.segments[i],t):(f.restorePart(a.segments[i],Number(s),t),this.shiftParts(i,Number(s),-1)),this.takenOut.delete(e)})}async restoreAll(e){if(this.takenOut.has(`${e}:all`)){await this.restore(`${e}:all`);return}const t=[...this.takenOut.keys()].filter(r=>r.startsWith(`${e}:`)).map(r=>Number(r.split(":")[1])).sort((r,s)=>s-r);for(const r of t)await this.restore(`${e}:${r}`)}editTurn(e){const r=this.drawn?.segments[e],s=this.shadow.querySelector(`#exchanges .turn[data-segment="${e}"] .said`);if(!r||!s)return;const i=this.messages,a=document.createElement("div");a.className="turn-edit";const n=document.createElement("textarea");n.value=f.raw(r,h=>this.takenOut.get(`${e}:${h}`));const l=document.createElement("span");l.className="hint",l.textContent=i.turnEditHint;const c=document.createElement("div");c.className="buttons";const o=document.createElement("button");o.type="button",o.className="pill-btn primary",o.textContent=i.saveTurn,o.addEventListener("click",()=>void this.editTranscript(h=>{const u=f.fromRaw(h.segments[e],n.value,this.redactReason);this.forget(e);for(const[p,b]of u)this.takenOut.set(`${e}:${p}`,b)}));const d=document.createElement("button");d.type="button",d.className="pill-btn",d.textContent=i.cancelTurn,d.addEventListener("click",()=>this.drawExchanges(this.drawn)),c.append(o,d),a.append(n,l,c),s.replaceWith(a),n.focus()}forget(e){for(const t of[...this.takenOut.keys()])t.startsWith(`${e}:`)&&this.takenOut.delete(t)}shiftParts(e,t,r=1){const s=[...this.takenOut].filter(([i])=>i.startsWith(`${e}:`)&&i!==`${e}:all`&&Number(i.split(":")[1])>=t+(r<0?1:0));for(const[i]of s)this.takenOut.delete(i);for(const[i,a]of s)this.takenOut.set(`${e}:${Number(i.split(":")[1])+r}`,a)}shiftTakenOut(e){const t=[...this.takenOut];this.takenOut.clear();for(const[r,s]of t){const[i,a]=r.split(":"),n=Number(i);n<e?this.takenOut.set(r,s):n>e&&this.takenOut.set(`${n-1}:${a}`,s)}}markCurrentTurn(e){const t=this.drawn?.segments??[];let r=-1;t.forEach((a,n)=>{a.start!==void 0&&a.start<=e&&(r=n)});for(const a of this.shadow.querySelectorAll("#exchanges .turn.current"))a.classList.remove("current");const s=this.shadow.querySelector(`#exchanges .turn[data-segment="${r}"]`);if(!s)return;s.classList.add("current");const i=s.closest(".rr0-interview-turns");i&&(s.offsetTop<i.scrollTop||s.offsetTop>i.scrollTop+i.clientHeight-s.offsetHeight)&&i.scrollTo({top:s.offsetTop-i.clientHeight/3,behavior:"smooth"})}async revealSegment(e){this.openGroup("exchanges"),await this.showExchanges(),this.shadow.getElementById("exchanges").revealSegment(e)}note(e,t="info"){q.show(this.shadow.getElementById("file-note"),e,t)}transcriptUrl(e){return e.url?new URL(e.url,this.base??location.href).href:void 0}static pretty(e){return JSON.stringify(e,null,2)+`
|
|
230
|
-
`}static SHARED=["title","time","medium","by","interviewOf","summary"];static ORDER=["version","id","language","title","time","medium","by","interviewOf","summary","speakers","transcription","proofreading","anonymization","recordings","segments"];static ordered(e){const t={};for(const r of m.ORDER)r in e&&(t[r]=e[r]);for(const r of Object.keys(e))r in t||(t[r]=e[r]);return t}static witnessesOf(e){return[e].flat().filter(t=>typeof t=="string")}static withEventFields(e,t){const r={...e};for(const i of m.SHARED)t[i]===void 0?delete r[i]:r[i]=structuredClone(t[i]);const s=r.speakers;if(typeof s=="object"&&s!==null){const i={...s},a=(n,l,c)=>{c.forEach((o,d)=>{const h=d===0?n:`${n}${d+1}`;i[h]?i[h]={...i[h],[l]:o}:d>0&&(i[h]={role:n,[l]:o})})};a("interviewer","by",t.by??[]),a("witness","of",m.witnessesOf(t.interviewOf)),r.speakers=i}return m.ordered(r)}applyFileToEvent(e,t){const r=this.current;if(!r)return!1;const s=JSON.stringify(m.SHARED.map(n=>r[n])),i=n=>typeof n=="string"||typeof n=="object"&&n!==null&&!Array.isArray(n),a={title:i,summary:i,time:n=>typeof n=="string",medium:n=>typeof n=="string",by:n=>Array.isArray(n),interviewOf:n=>typeof n=="string"||Array.isArray(n)};for(const n of m.SHARED){const l=e[n];l!==void 0&&a[n](l)?r[n]=structuredClone(l):t&&delete r[n]}return JSON.stringify(m.SHARED.map(n=>r[n]))!==s}syncFileFromEvent(){const e=this.current,t=this.fileEditor?.text??this.text;if(!e||t===void 0)return;let r;try{r=JSON.parse(t)}catch{return}if(typeof r!="object"||r===null||Array.isArray(r))return;const s=m.pretty(m.withEventFields(r,e));s!==t&&(this.text=s,this.fileEditor?.replaceText(s,!1),this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:"transcript",event:e,text:s}})))}template(e){return m.pretty(m.withEventFields({version:1,language:this.language,speakers:{interviewer:{role:"interviewer"},witness:{role:"witness"}},segments:[]},e))}loadFileEditor(e){return this.fileEditorLoading??=(async()=>{try{const[{SightingFileEditor:t},{default:r},s]=await Promise.all([A(()=>import("./SightingFileEditor-
|
|
231
|
+
`}static SHARED=["title","time","medium","by","interviewOf","summary"];static ORDER=["version","id","language","title","time","medium","by","interviewOf","summary","speakers","transcription","proofreading","anonymization","recordings","segments"];static ordered(e){const t={};for(const r of m.ORDER)r in e&&(t[r]=e[r]);for(const r of Object.keys(e))r in t||(t[r]=e[r]);return t}static witnessesOf(e){return[e].flat().filter(t=>typeof t=="string")}static withEventFields(e,t){const r={...e};for(const i of m.SHARED)t[i]===void 0?delete r[i]:r[i]=structuredClone(t[i]);const s=r.speakers;if(typeof s=="object"&&s!==null){const i={...s},a=(n,l,c)=>{c.forEach((o,d)=>{const h=d===0?n:`${n}${d+1}`;i[h]?i[h]={...i[h],[l]:o}:d>0&&(i[h]={role:n,[l]:o})})};a("interviewer","by",t.by??[]),a("witness","of",m.witnessesOf(t.interviewOf)),r.speakers=i}return m.ordered(r)}applyFileToEvent(e,t){const r=this.current;if(!r)return!1;const s=JSON.stringify(m.SHARED.map(n=>r[n])),i=n=>typeof n=="string"||typeof n=="object"&&n!==null&&!Array.isArray(n),a={title:i,summary:i,time:n=>typeof n=="string",medium:n=>typeof n=="string",by:n=>Array.isArray(n),interviewOf:n=>typeof n=="string"||Array.isArray(n)};for(const n of m.SHARED){const l=e[n];l!==void 0&&a[n](l)?r[n]=structuredClone(l):t&&delete r[n]}return JSON.stringify(m.SHARED.map(n=>r[n]))!==s}syncFileFromEvent(){const e=this.current,t=this.fileEditor?.text??this.text;if(!e||t===void 0)return;let r;try{r=JSON.parse(t)}catch{return}if(typeof r!="object"||r===null||Array.isArray(r))return;const s=m.pretty(m.withEventFields(r,e));s!==t&&(this.text=s,this.fileEditor?.replaceText(s,!1),this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:"transcript",event:e,text:s}})))}template(e){return m.pretty(m.withEventFields({version:1,language:this.language,speakers:{interviewer:{role:"interviewer"},witness:{role:"witness"}},segments:[]},e))}loadFileEditor(e){return this.fileEditorLoading??=(async()=>{try{const[{SightingFileEditor:t},{default:r},s]=await Promise.all([A(()=>import("./SightingFileEditor-BekK-f3R.js"),__vite__mapDeps([0,1,2]),import.meta.url),A(()=>import("./interviewSchema-D82l9P1r.js"),[],import.meta.url),G(this.language)]);return this.fileEditor=new t(this.shadow.getElementById("file-editor"),e,i=>this.onEdited(i),this.messages.editorLabel,{baseline:e,phrases:s.fileSearchPhrases,schema:r}),this.fileEditor}catch(t){throw this.fileEditorLoading=void 0,t}})(),this.fileEditorLoading}async showTranscript(){const e=this.current;if(!e||this.shownFor===e)return;this.note(this.messages.loading);let t=this.text;if(t===void 0){const r=this.transcriptUrl(e);if(r!==void 0)try{const s=await T.json(r);this.current===e&&typeof s=="object"&&s!==null&&!Array.isArray(s)?(this.applyFileToEvent(s,!1)&&this.fileChangedEvent(),t=m.pretty(m.withEventFields(s,e))):t=m.pretty(s)}catch{this.note(this.messages.loadFailed,"error")}t??=this.template(e)}if(this.current===e)try{const r=await this.loadFileEditor(t);if(this.current!==e)return;r.replaceText(t,!1),this.shownFor=e,this.text!==void 0||this.transcriptUrl(e)===void 0?this.note(void 0):this.shadow.getElementById("file-note").textContent===this.messages.loading&&this.note(void 0)}catch{this.note(this.messages.loadFailed,"error")}}onEdited(e){this.text=e;let t,r=!0;try{t=JSON.parse(e)}catch{r=!1}this.note(r?void 0:this.messages.invalid,"error");const s=this.current;if(r&&s&&typeof t=="object"&&t!==null&&!Array.isArray(t)&&this.applyFileToEvent(t,!0)&&this.fileChangedEvent(),s&&!s.url&&e.trim()!==""){const i=s.id??"1";s.url=`${i.startsWith("interview")?i:`interview-${i}`}.json`,this.field("url").value=s.url,this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:"url",event:s}}))}this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:"transcript",event:s,text:e}})),this.showExchanges()}fileChangedEvent(){this.render(),this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:"file",event:this.current}}))}async take(e){if(typeof e!="object"||e===null||!Array.isArray(e.segments)){this.note(this.messages.notATranscript,"error");return}const t=this.current;t&&this.applyFileToEvent(e,!1)&&this.fileChangedEvent();const r=m.pretty(t?m.withEventFields(e,t):e);await this.loadFileEditor(r).then(s=>s.replaceText(r,!1),()=>{}),this.shownFor=this.current,this.note(void 0),this.onEdited(r)}async importFromFile(e){try{const t=await e.text();let r;try{r=JSON.parse(t)}catch{r=void 0}if(typeof r!="object"||r===null){const{InterviewImport:s}=await A(async()=>{const{InterviewImport:l}=await import("./interviewImport-C-TiARLK.js");return{InterviewImport:l}},[],import.meta.url),i=this.current,a=[i?.interviewOf].flat().filter(l=>typeof l=="string"),n=s.parse(t,{by:(i?.by??[]).map(l=>m.byText([l])).filter(l=>l!==""),witnesses:this.options.filter(l=>a.length===0||a.includes(l.id))});r=n&&{...n,transcription:{note:`Imported from ${e.name}: who speaks and when are as the file gave them, to be checked.`}}}r===void 0?this.note(this.messages.notATranscript,"error"):await this.take(r)}catch{this.note(this.messages.loadFailed,"error")}}async importFromUrl(e){try{await this.take(await T.json(new URL(e,this.base??location.href).href))}catch{this.note(this.messages.loadFailed,"error")}}save(){const e=this.fileEditor?.text??this.text;if(e===void 0)return;const t=(this.current?.url??"").split("/").pop()||`${this.current?.id??"interview"}.json`,r=URL.createObjectURL(new Blob([e],{type:"application/json"})),s=document.createElement("a");s.href=r,s.download=t,s.click(),URL.revokeObjectURL(r)}}function re(){K(),D(),customElements.get(M)||customElements.define(M,m)}export{E as INTERVIEW_CHANGE_EVENT,M as INTERVIEW_EDITOR_ELEMENT_NAME,z as INTERVIEW_SEEK_EVENT,m as InterviewEditorElement,re as register};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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",importFileHint:"JSON, text, WebVTT, SRT",inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"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",colon:": ",proofreadAll:"Proofread by everyone.",proofreadPending:"Not proofread yet by: {names}",play:"Play",pause:"Pause",recordings:"Recordings ({n})",recordingsTitle:"Recordings",recordingKind:"Type",recordingAudio:"Audio",recordingVideo:"Video",recordingFile:"File",recordingOffset:"Offset",recordingRemove:"Remove",recordingAdd:"Add a recording",close:"Close",noRecording:"No recording: add the audio or video file of the interview to listen to it.",redactSelection:"Take out the selection",redactedWords:"passage taken out · {n} word(s)",redactAll:"Take all out",restoreAll:"Restore all",editTurn:"Edit",deleteTurn:"Delete this turn",saveTurn:"Save",cancelTurn:"Cancel",turnEditHint:"⟦ … ⟧ marks a passage taken out",selectionOnePassage:"The selection has to stay within one passage not taken out.",selectionNone:"Select words of a passage to take them out.",reviewedBy:"{name} has proofread",linkMoment:"Link to a moment…",momentLabel:"Moment {k} · {text}",unlinkMoment:"Remove this link",noMoments:"The observation has no named moment yet.",redactReason:"taken out at proofreading",roles:{interviewer:"Interviewer",interviewee:"Interviewee",witness:"Witness"}};export{e as interviewMessages_en};
|
|
@@ -0,0 +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",importFileHint:"JSON, texto, WebVTT, SRT",inputFileFromFile:"desde su disco",inputFileFromUrl:"desde una dirección",inputFileModeHint:"Pulsar para darlo de la otra forma: un archivo suyo o una dirección",inputFileLoad:"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",colon:": ",proofreadAll:"Revisado por todos.",proofreadPending:"Aún no revisado por: {names}",play:"Reproducir",pause:"Pausa",recordings:"Grabaciones ({n})",recordingsTitle:"Grabaciones",recordingKind:"Tipo",recordingAudio:"Audio",recordingVideo:"Vídeo",recordingFile:"Archivo",recordingOffset:"Desfase",recordingRemove:"Quitar",recordingAdd:"Añadir una grabación",close:"Cerrar",noRecording:"Sin grabación: añada el archivo de audio o vídeo de la entrevista para poder escucharla.",redactSelection:"Retirar la selección",redactedWords:"pasaje retirado · {n} palabra(s)",redactAll:"Retirar todo",restoreAll:"Restablecer todo",editTurn:"Modificar",deleteTurn:"Eliminar este turno de palabra",saveTurn:"Guardar",cancelTurn:"Cancelar",turnEditHint:"⟦ … ⟧ marca un pasaje retirado",selectionOnePassage:"La selección debe caber en un solo pasaje no retirado.",selectionNone:"Seleccione palabras de un pasaje para retirarlas.",reviewedBy:"{name} ha revisado",linkMoment:"Vincular a un momento…",momentLabel:"Momento {k} · {text}",unlinkMoment:"Quitar este vínculo",noMoments:"La observación aún no tiene momentos con nombre.",redactReason:"retirado en la revisión",roles:{interviewer:"Entrevistador",interviewee:"Entrevistado",witness:"Testigo"}};export{e as interviewMessages_es};
|
|
@@ -0,0 +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",importFileHint:"JSON, texte, WebVTT, SRT",inputFileFromFile:"depuis votre disque",inputFileFromUrl:"depuis une adresse",inputFileModeHint:"Cliquer pour le donner autrement : un fichier à vous, ou une adresse",inputFileLoad:"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é",colon:" : ",proofreadAll:"Relu par tous les participants.",proofreadPending:"Pas encore relu par : {names}",play:"Lecture",pause:"Pause",recordings:"Enregistrements ({n})",recordingsTitle:"Enregistrements",recordingKind:"Type",recordingAudio:"Audio",recordingVideo:"Vidéo",recordingFile:"Fichier",recordingOffset:"Décalage",recordingRemove:"Retirer",recordingAdd:"Ajouter un enregistrement",close:"Fermer",noRecording:"Aucun enregistrement : ajoutez le fichier audio ou vidéo de l'entretien pour pouvoir l'écouter.",redactSelection:"Retirer la sélection",redactedWords:"passage retiré · {n} mot(s)",redactAll:"Retirer tout",restoreAll:"Rétablir tout",editTurn:"Modifier",deleteTurn:"Supprimer ce tour de parole",saveTurn:"Enregistrer",cancelTurn:"Annuler",turnEditHint:"⟦ … ⟧ marque un passage retiré",selectionOnePassage:"La sélection doit tenir dans un seul passage non retiré.",selectionNone:"Sélectionnez des mots d'un passage pour les retirer.",reviewedBy:"{name} a relu",linkMoment:"Relier à un moment…",momentLabel:"Moment {k} · {text}",unlinkMoment:"Retirer ce lien",noMoments:"L'observation n'a pas encore de moment nommé.",redactReason:"retiré à la relecture",roles:{interviewer:"Intervieweur",interviewee:"Interviewé",witness:"Témoin"}};export{e as interviewMessages_fr};
|
|
@@ -0,0 +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",importFileHint:"JSON, testo, WebVTT, SRT",inputFileFromFile:"dal proprio disco",inputFileFromUrl:"da un indirizzo",inputFileModeHint:"Fare clic per darlo nell'altro modo: un proprio file o un indirizzo",inputFileLoad:"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",colon:": ",proofreadAll:"Rivisto da tutti.",proofreadPending:"Non ancora rivisto da: {names}",play:"Riproduci",pause:"Pausa",recordings:"Registrazioni ({n})",recordingsTitle:"Registrazioni",recordingKind:"Tipo",recordingAudio:"Audio",recordingVideo:"Video",recordingFile:"File",recordingOffset:"Scarto",recordingRemove:"Rimuovi",recordingAdd:"Aggiungi una registrazione",close:"Chiudi",noRecording:"Nessuna registrazione: aggiungi il file audio o video dell'intervista per poterla ascoltare.",redactSelection:"Rimuovi la selezione",redactedWords:"passaggio rimosso · {n} parola/e",redactAll:"Rimuovi tutto",restoreAll:"Ripristina tutto",editTurn:"Modifica",deleteTurn:"Elimina questo turno",saveTurn:"Salva",cancelTurn:"Annulla",turnEditHint:"⟦ … ⟧ indica un passaggio rimosso",selectionOnePassage:"La selezione deve restare in un solo passaggio non rimosso.",selectionNone:"Seleziona parole di un passaggio per rimuoverle.",reviewedBy:"{name} ha riletto",linkMoment:"Collega a un momento…",momentLabel:"Momento {k} · {text}",unlinkMoment:"Rimuovi questo collegamento",noMoments:"L'osservazione non ha ancora momenti con nome.",redactReason:"rimosso in rilettura",roles:{interviewer:"Intervistatore",interviewee:"Intervistato",witness:"Testimone"}};export{i as interviewMessages_it};
|