@rr0/ufoathome 0.178.4 → 0.179.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_en-ru7GkZlQ.js +1 -0
- package/dist-embed-interview/InterviewMessages_es-DkJurNrG.js +1 -0
- package/dist-embed-interview/InterviewMessages_fr-DAYgf8Ms.js +1 -0
- package/dist-embed-interview/InterviewMessages_it-6lenkmSg.js +1 -0
- package/dist-embed-interview/rr0-interview.mjs +2 -2
- package/dist-embed-scene/{BeamEditor-DFGRzRny.js → BeamEditor-DXIKipID.js} +1 -1
- package/dist-embed-scene/{LanternEditor-H8VYYbRn.js → LanternEditor-JvQQ8GOQ.js} +1 -1
- package/dist-embed-scene/LaunchEditor-DIxYPs4d.js +22 -0
- package/dist-embed-scene/{LaunchPlume-eEIp7_hM.js → LaunchPlume-FP3Yk-8B.js} +1 -1
- package/dist-embed-scene/{LaunchSimulation-DNNEzmzs.js → LaunchSimulation-v4khqz4r.js} +1 -1
- package/dist-embed-scene/{ModuleSession-DLoAutYP.js → ModuleSession-CLUE46BO.js} +2 -2
- package/dist-embed-scene/{ModuleThree-R2LhnY95.js → ModuleThree-DQfMGMDy.js} +1 -1
- package/dist-embed-scene/{ParameterForm-ez-n_0Dw.js → ParameterForm-BFp5BoHL.js} +9 -12
- package/dist-embed-scene/{ReentryEditor-CwY4oANp.js → ReentryEditor-ByVtt--5.js} +6 -6
- package/dist-embed-scene/{ReentrySimulation-BDgEPekW.js → ReentrySimulation-nzg5V3kJ.js} +1 -1
- package/dist-embed-scene/{TimelineTracks-BQXJMJaJ.js → TimelineTracks-BOjTfdGu.js} +2 -2
- package/dist-embed-scene/rr0-scene.mjs +333 -322
- package/dist-embed-sighting/{CaseReportExport-DHdgnsTQ.js → CaseReportExport-C30Foqx0.js} +1 -1
- package/dist-embed-sighting/{InterviewElement-Byb_sxbO.js → InterviewElement-BduwyUn5.js} +2 -2
- package/dist-embed-sighting/InterviewMessages_en-ru7GkZlQ.js +1 -0
- package/dist-embed-sighting/InterviewMessages_es-DkJurNrG.js +1 -0
- package/dist-embed-sighting/InterviewMessages_fr-DAYgf8Ms.js +1 -0
- package/dist-embed-sighting/InterviewMessages_it-6lenkmSg.js +1 -0
- package/dist-embed-sighting/rr0-sighting.mjs +36 -28
- package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-fZkxLAHp.js → AdsbLolArchiveProvider-DEqEth50.js} +1 -1
- package/dist-embed-sighting-editor/AssemblyAiTranscriptionProvider-o2kkPD5o.js +1 -0
- package/dist-embed-sighting-editor/{BallesterGuaspAssessor-DASadJjI.js → BallesterGuaspAssessor-ClwhCo4B.js} +1 -1
- package/dist-embed-sighting-editor/{BeamEditor-B2diaX_e.js → BeamEditor-vxinYAhV.js} +1 -1
- package/dist-embed-sighting-editor/{BeamSystem-BfNJfayv.js → BeamSystem-BMyP16H9.js} +1 -1
- package/dist-embed-sighting-editor/{BodyEditor-CCBXFuuL.js → BodyEditor-Dn5HrH2t.js} +1 -1
- package/dist-embed-sighting-editor/BrowserWhisperProvider-Dn44ZE45.js +1 -0
- package/dist-embed-sighting-editor/{CaseReportExport-D_e5Uij7.js → CaseReportExport-Ct_2DUSO.js} +2 -2
- package/dist-embed-sighting-editor/{ContrailSystem-BWvO9taK.js → ContrailSystem-Y75rFfLJ.js} +1 -1
- package/dist-embed-sighting-editor/{ControlPasses-BQ_DUxa_.js → ControlPasses-oqSnNDq6.js} +1 -1
- package/dist-embed-sighting-editor/{CoverageAssessor-CSktyUlP.js → CoverageAssessor-CN-3cMS9.js} +1 -1
- package/dist-embed-sighting-editor/{Flightradar24Provider-OvRZWZWj.js → Flightradar24Provider-D3bM2ckV.js} +1 -1
- package/dist-embed-sighting-editor/GLTFLoader-CJy8wjmO.js +1 -0
- package/dist-embed-sighting-editor/{GenerativeKitMessages-BtNG1usJ.js → GenerativeKitMessages-I8xH2ec9.js} +1 -1
- package/dist-embed-sighting-editor/{GeoExportTexts-DBGGdRnP.js → GeoExportTexts-DAllttgw.js} +1 -1
- package/dist-embed-sighting-editor/{GeoJsonExport-BZ-0v8fM.js → GeoJsonExport-_yjIEd4F.js} +1 -1
- package/dist-embed-sighting-editor/GeographicFigures-DC6Tw3ja.js +1 -0
- package/dist-embed-sighting-editor/{HeadlightSystem-C-8Gl3vu.js → HeadlightSystem-DZN_EX7x.js} +1 -1
- package/dist-embed-sighting-editor/{HynekAssessor-CH2E88xV.js → HynekAssessor-CKjvYcVe.js} +1 -1
- package/dist-embed-sighting-editor/InterviewEditorElement-C7eNBUfn.js +270 -0
- package/dist-embed-sighting-editor/InterviewMessages_en-ru7GkZlQ.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_es-DkJurNrG.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_fr-DAYgf8Ms.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_it-6lenkmSg.js +1 -0
- package/dist-embed-sighting-editor/{KmlExport-Bh4eTycx.js → KmlExport-dpml2tIJ.js} +1 -1
- package/dist-embed-sighting-editor/LanternEditor-CKKUIplQ.js +9 -0
- package/dist-embed-sighting-editor/{LaserBeam-CtogDP38.js → LaserBeam-Ct6opxMs.js} +1 -1
- package/dist-embed-sighting-editor/LaunchEditor-BfggZKq5.js +22 -0
- package/dist-embed-sighting-editor/{LaunchPlume-BtRrJTP9.js → LaunchPlume-CT777Ivp.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchSimulation-xKwguVJt.js → LaunchSimulation-BSlF3Uq4.js} +1 -1
- package/dist-embed-sighting-editor/{ModelSource-CnKzaNDn.js → ModelSource-BQm0eN7H.js} +1 -1
- package/dist-embed-sighting-editor/{ModelThumbnails-UE_Er5EW.js → ModelThumbnails-Bwh2px6A.js} +1 -1
- package/dist-embed-sighting-editor/{ModelViewer-DoCshJc6.js → ModelViewer-Dl5ichWV.js} +1 -1
- package/dist-embed-sighting-editor/ModuleConformance-B8OYKQop.js +2 -0
- package/dist-embed-sighting-editor/{ModuleSession-CJstaNEN.js → ModuleSession-BQSTCqob.js} +3 -3
- package/dist-embed-sighting-editor/ModuleThree-DwGM2nF4.js +1 -0
- package/dist-embed-sighting-editor/{ModulesPanelElement-DdGqqdn4.js → ModulesPanelElement-CZcbo6lq.js} +3 -3
- package/dist-embed-sighting-editor/{NearestApproach-BH3Yw8Qz.js → NearestApproach-DkpM-8sl.js} +1 -1
- package/dist-embed-sighting-editor/OpenAiTranscriptionProvider-DDW446tK.js +1 -0
- package/dist-embed-sighting-editor/{PictureRegistration-B9C6iY17.js → PictureRegistration-CbfytwCX.js} +1 -1
- package/dist-embed-sighting-editor/{PoherAssessor-DWcCWUfa.js → PoherAssessor-C5-F9VMn.js} +1 -1
- package/dist-embed-sighting-editor/{RailwaySystem-D3VBmx1X.js → RailwaySystem-BxHS7Jka.js} +1 -1
- package/dist-embed-sighting-editor/{ReentryEditor-BDyG-48K.js → ReentryEditor-BgpCftyc.js} +2 -2
- package/dist-embed-sighting-editor/{ReentrySimulation-BQj0wWXW.js → ReentrySimulation-BHjJYTL1.js} +1 -1
- package/dist-embed-sighting-editor/{ReferenceSystem-C9NRL7UY.js → ReferenceSystem-BxKEbMVI.js} +1 -1
- package/dist-embed-sighting-editor/{RoadMarkings-ByQL2MTo.js → RoadMarkings-D9-6Cy9S.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_en-BdRB6cjg.js → SceneNames_en-09L_ZfER.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_es-Dk0UmXHp.js → SceneNames_es-C4PEieol.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_fr-_z2iZ8Bm.js → SceneNames_fr-BGTFI_pF.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_it-CE7fanb3.js → SceneNames_it-DHk5C-uS.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-g262KZ3G.js → TraceSystem-DAa5Lzof.js} +2 -2
- package/dist-embed-sighting-editor/TranscriptionAudio-C_xvRUv2.js +5 -0
- package/dist-embed-sighting-editor/TranscriptionError-D_TCbYbt.js +1 -0
- package/dist-embed-sighting-editor/{UfoMessages_en-JeMK-39o.js → UfoMessages_en-FAvzKxmR.js} +1 -1
- package/dist-embed-sighting-editor/{WaterSystem-CIbQPMqE.js → WaterSystem-C7hE-tnY.js} +1 -1
- package/dist-embed-sighting-editor/interviewImport-CgWyTdKb.js +4 -0
- package/dist-embed-sighting-editor/{interviewJson-DXD8FSBX.js → interviewJson-iURHP4Zk.js} +1 -1
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +30 -22
- package/dist-embed-sighting-editor/{surroundingsSources-BExFsNzP.js → surroundingsSources-YIawBCws.js} +1 -1
- package/dist-embed-sighting-editor/{trafficRuntime-CPRQW0Ho.js → trafficRuntime-j8tnHTec.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-interview/InterviewMessages_en-BNau2xU8.js +0 -1
- package/dist-embed-interview/InterviewMessages_es-ypa0EDh9.js +0 -1
- package/dist-embed-interview/InterviewMessages_fr-OCQdwn9j.js +0 -1
- package/dist-embed-interview/InterviewMessages_it-awuOqf5v.js +0 -1
- package/dist-embed-scene/LaunchEditor-CIYcS0Y-.js +0 -22
- package/dist-embed-sighting/InterviewMessages_en-BNau2xU8.js +0 -1
- package/dist-embed-sighting/InterviewMessages_es-ypa0EDh9.js +0 -1
- package/dist-embed-sighting/InterviewMessages_fr-OCQdwn9j.js +0 -1
- package/dist-embed-sighting/InterviewMessages_it-awuOqf5v.js +0 -1
- package/dist-embed-sighting-editor/GLTFLoader-CM7Uk25s.js +0 -1
- package/dist-embed-sighting-editor/GeographicFigures-DqhWddS9.js +0 -1
- package/dist-embed-sighting-editor/InterviewEditorElement-Bz3hyZ-m.js +0 -234
- package/dist-embed-sighting-editor/InterviewMessages_en-BNau2xU8.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_es-ypa0EDh9.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_fr-OCQdwn9j.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_it-awuOqf5v.js +0 -1
- package/dist-embed-sighting-editor/LanternEditor-tTk1vUZm.js +0 -9
- package/dist-embed-sighting-editor/LaunchEditor-CteAalch.js +0 -22
- package/dist-embed-sighting-editor/ModuleConformance-BKvZnuw9.js +0 -2
- package/dist-embed-sighting-editor/ModuleThree-1hxqvWFa.js +0 -1
- package/dist-embed-sighting-editor/interviewImport-C-TiARLK.js +0 -4
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{by as Le,bz as Q,bA as he,bB as Me,bC as v,bD as de,a_ as y,a$ as pe,aQ as F,bE as w,bs as U,bj as be,bF as Se,au as ye,G as B,bG as we,V as C,Q as me,bH as Ne,C as ge,bI as Ie,bJ as Oe,aA as V,bK as Ce,bL as Te,bM as Fe,bN as Pe,bO as He,bt as J,bn as Re,bP as Z,bQ as ke,bR as De,bf as Ge,bS as X,bT as ve,ap as Ee,aC as Ue,aB as G,bU as Be,az as Ke,bV as je,an as Ve,bW as Xe,bX as ze,bY as qe,aO as We,ak as z,av as Ye,bd as Qe,bZ as Je,b_ as Ze,b$ as $e,c0 as en,c1 as nn,c2 as tn,c3 as xe,b5 as sn,bu as ne,c4 as te,c5 as se,c6 as ie,c7 as re,c8 as rn,c9 as on,aq as an,ar as cn}from"./rr0-sighting-editor.mjs";function oe(f,n){if(n===Le)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(n===Q||n===he){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const s=e.count-2,t=[];if(n===Q)for(let r=1;r<=s;r++)t.push(e.getX(0)),t.push(e.getX(r)),t.push(e.getX(r+1));else for(let r=0;r<s;r++)r%2===0?(t.push(e.getX(r)),t.push(e.getX(r+1)),t.push(e.getX(r+2))):(t.push(e.getX(r+2)),t.push(e.getX(r+1)),t.push(e.getX(r)));t.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=f.clone();return i.setIndex(t),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",n),f}class jn extends Me{constructor(n){super(n),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new dn(e)}),this.register(function(e){return new pn(e)}),this.register(function(e){return new Ln(e)}),this.register(function(e){return new Mn(e)}),this.register(function(e){return new bn(e)}),this.register(function(e){return new gn(e)}),this.register(function(e){return new Tn(e)}),this.register(function(e){return new Rn(e)}),this.register(function(e){return new En(e)}),this.register(function(e){return new hn(e)}),this.register(function(e){return new xn(e)}),this.register(function(e){return new mn(e)}),this.register(function(e){return new _n(e)}),this.register(function(e){return new An(e)}),this.register(function(e){return new ln(e)}),this.register(function(e){return new ae(e,g.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new ae(e,g.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new Sn(e)})}load(n,e,s,t){const i=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=v.extractUrlBase(n);r=v.resolveURL(c,this.path)}else r=v.extractUrlBase(n);this.manager.itemStart(n);const a=function(c){t?t(c):console.error(c),i.manager.itemError(n),i.manager.itemEnd(n)},o=new de(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(n,function(c){try{i.parse(c,r,function(u){e(u),i.manager.itemEnd(n)},a)}catch(u){a(u)}},s,a)}setDRACOLoader(n){return this.dracoLoader=n,this}setKTX2Loader(n){return this.ktx2Loader=n,this}setMeshoptDecoder(n){return this.meshoptDecoder=n,this}register(n){return this.pluginCallbacks.indexOf(n)===-1&&this.pluginCallbacks.push(n),this}unregister(n){return this.pluginCallbacks.indexOf(n)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(n),1),this}parse(n,e,s,t){let i;const r={},a={},o=new TextDecoder;if(typeof n=="string")i=JSON.parse(n);else if(n instanceof ArrayBuffer)if(o.decode(new Uint8Array(n,0,4))===Ae){try{r[g.KHR_BINARY_GLTF]=new yn(n)}catch(l){t&&t(l);return}i=JSON.parse(r[g.KHR_BINARY_GLTF].content)}else i=JSON.parse(o.decode(n));else i=n;if(i.asset===void 0||i.asset.version[0]<2){t&&t(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Un(i,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const l=this.pluginCallbacks[u](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(i.extensionsUsed)for(let u=0;u<i.extensionsUsed.length;++u){const l=i.extensionsUsed[u],h=i.extensionsRequired||[];switch(l){case g.KHR_MATERIALS_UNLIT:r[l]=new fn;break;case g.KHR_DRACO_MESH_COMPRESSION:r[l]=new wn(i,this.dracoLoader);break;case g.KHR_TEXTURE_TRANSFORM:r[l]=new Nn;break;case g.KHR_MESH_QUANTIZATION:r[l]=new In;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(s,t)}parseAsync(n,e){const s=this;return new Promise(function(t,i){s.parse(n,e,t,i)})}}function un(){let f={};return{get:function(n){return f[n]},add:function(n,e){f[n]=e},remove:function(n){delete f[n]},removeAll:function(){f={}}}}function _(f,n,e){const s=f.json.materials[n];return s.extensions&&s.extensions[e]?s.extensions[e]:null}const g={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",KHR_MESHOPT_COMPRESSION:"KHR_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ln{constructor(n){this.parser=n,this.name=g.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const n=this.parser,e=this.parser.json.nodes||[];for(let s=0,t=e.length;s<t;s++){const i=e[s];i.extensions&&i.extensions[this.name]&&i.extensions[this.name].light!==void 0&&n._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(n){const e=this.parser,s="light:"+n;let t=e.cache.get(s);if(t)return t;const i=e.json,o=((i.extensions&&i.extensions[this.name]||{}).lights||[])[n];let c;const u=new F(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],w);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new ye(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new Se(u),c.distance=l;break;case"spot":c=new be(u),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),S(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+n),t=Promise.resolve(c),e.cache.add(s,t),t}getDependency(n,e){if(n==="light")return this._loadLight(e)}createNodeAttachment(n){const e=this,s=this.parser,i=s.json.nodes[n],a=(i.extensions&&i.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return s._getNodeRef(e.cache,a,o)})}}class fn{constructor(){this.name=g.KHR_MATERIALS_UNLIT}getMaterialType(){return G}extendParams(n,e,s){const t=[];n.color=new F(1,1,1),n.opacity=1;const i=e.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const r=i.baseColorFactor;n.color.setRGB(r[0],r[1],r[2],w),n.opacity=r[3]}i.baseColorTexture!==void 0&&t.push(s.assignTexture(n,"map",i.baseColorTexture,U))}return Promise.all(t)}}class hn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||s.emissiveStrength!==void 0&&(e.emissiveIntensity=s.emissiveStrength),Promise.resolve()}}class dn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_CLEARCOAT}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];if(s.clearcoatFactor!==void 0&&(e.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&t.push(this.parser.assignTexture(e,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&t.push(this.parser.assignTexture(e,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(t.push(this.parser.assignTexture(e,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const i=s.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new pe(i,i)}return Promise.all(t)}}class pn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_DISPERSION}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||(e.dispersion=s.dispersion!==void 0?s.dispersion:0),Promise.resolve()}}class mn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_IRIDESCENCE}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.iridescenceFactor!==void 0&&(e.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&t.push(this.parser.assignTexture(e,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(e.iridescenceIOR=s.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&t.push(this.parser.assignTexture(e,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(t)}}class gn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_SHEEN}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];if(e.sheenColor=new F(0,0,0),e.sheenRoughness=0,e.sheen=1,s.sheenColorFactor!==void 0){const i=s.sheenColorFactor;e.sheenColor.setRGB(i[0],i[1],i[2],w)}return s.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&t.push(this.parser.assignTexture(e,"sheenColorMap",s.sheenColorTexture,U)),s.sheenRoughnessTexture!==void 0&&t.push(this.parser.assignTexture(e,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(t)}}class Tn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_TRANSMISSION}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.transmissionFactor!==void 0&&(e.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&t.push(this.parser.assignTexture(e,"transmissionMap",s.transmissionTexture)),Promise.all(t)}}class Rn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_VOLUME}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];e.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&t.push(this.parser.assignTexture(e,"thicknessMap",s.thicknessTexture)),e.attenuationDistance=s.attenuationDistance||1/0;const i=s.attenuationColor||[1,1,1];return e.attenuationColor=new F().setRGB(i[0],i[1],i[2],w),Promise.all(t)}}class En{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_IOR}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||(e.ior=s.ior!==void 0?s.ior:1.5,e.ior===0&&(e.ior=1e3)),Promise.resolve()}}class xn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_SPECULAR}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];e.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&t.push(this.parser.assignTexture(e,"specularIntensityMap",s.specularTexture));const i=s.specularColorFactor||[1,1,1];return e.specularColor=new F().setRGB(i[0],i[1],i[2],w),s.specularColorTexture!==void 0&&t.push(this.parser.assignTexture(e,"specularColorMap",s.specularColorTexture,U)),Promise.all(t)}}class An{constructor(n){this.parser=n,this.name=g.EXT_MATERIALS_BUMP}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return e.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&t.push(this.parser.assignTexture(e,"bumpMap",s.bumpTexture)),Promise.all(t)}}class _n{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_ANISOTROPY}getMaterialType(n){return _(this.parser,n,this.name)!==null?y:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.anisotropyStrength!==void 0&&(e.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(e.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&t.push(this.parser.assignTexture(e,"anisotropyMap",s.anisotropyTexture)),Promise.all(t)}}class Ln{constructor(n){this.parser=n,this.name=g.KHR_TEXTURE_BASISU}loadTexture(n){const e=this.parser,s=e.json,t=s.textures[n];if(!t.extensions||!t.extensions[this.name])return null;const i=t.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(n,i.source,r)}}class Mn{constructor(n){this.parser=n,this.name=g.EXT_TEXTURE_WEBP}loadTexture(n){const e=this.name,s=this.parser,t=s.json,i=t.textures[n];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],a=t.images[r.source];let o=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(o=c)}return s.loadTextureImage(n,r.source,o)}}class bn{constructor(n){this.parser=n,this.name=g.EXT_TEXTURE_AVIF}loadTexture(n){const e=this.name,s=this.parser,t=s.json,i=t.textures[n];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],a=t.images[r.source];let o=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(o=c)}return s.loadTextureImage(n,r.source,o)}}class ae{constructor(n,e){this.name=e,this.parser=n}loadBufferView(n){const e=this.parser.json,s=e.bufferViews[n];if(s.extensions&&s.extensions[this.name]){const t=s.extensions[this.name],i=this.parser.getDependency("buffer",t.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(a){const o=t.byteOffset||0,c=t.byteLength||0,u=t.count,l=t.byteStride,h=new Uint8Array(a,o,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(u,l,h,t.mode,t.filter).then(function(d){return d.buffer}):r.ready.then(function(){const d=new ArrayBuffer(u*l);return r.decodeGltfBuffer(new Uint8Array(d),u,l,h,t.mode,t.filter),d})})}else return null}}class Sn{constructor(n){this.name=g.EXT_MESH_GPU_INSTANCING,this.parser=n}createNodeMesh(n){const e=this.parser.json,s=e.nodes[n];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const t=e.meshes[s.mesh];for(const c of t.primitives)if(c.mode!==M.TRIANGLES&&c.mode!==M.TRIANGLE_STRIP&&c.mode!==M.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=s.extensions[this.name].attributes,a=[],o={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(u=>(o[c]=u,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(n)),Promise.all(a).then(c=>{const u=c.pop(),l=u.isGroup?u.children:[u],h=c[0].count,d=[];for(const p of l){const R=new B,m=new C,T=new me,A=new C(1,1,1),x=new we(p.geometry,p.material,h);for(let E=0;E<h;E++)o.TRANSLATION&&m.fromBufferAttribute(o.TRANSLATION,E),o.ROTATION&&T.fromBufferAttribute(o.ROTATION,E),o.SCALE&&A.fromBufferAttribute(o.SCALE,E),x.setMatrixAt(E,R.compose(m,T,A));for(const E in o)if(E==="_COLOR_0"){const L=o[E];x.instanceColor=new Ne(L.array,L.itemSize,L.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&p.geometry.setAttribute(E,o[E]);ge.prototype.copy.call(x,p),this.parser.assignFinalMaterial(x),d.push(x)}return u.isGroup?(u.clear(),u.add(...d),u):d[0]}))}}const Ae="glTF",D=12,ce={JSON:1313821514,BIN:5130562};class yn{constructor(n){this.name=g.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(n,0,D),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(n.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Ae)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const t=this.header.length-D,i=new DataView(n,D);let r=0;for(;r<t;){const a=i.getUint32(r,!0);r+=4;const o=i.getUint32(r,!0);if(r+=4,o===ce.JSON){const c=new Uint8Array(n,D+r,a);this.content=s.decode(c)}else if(o===ce.BIN){const c=D+r;this.body=n.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class wn{constructor(n,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=g.KHR_DRACO_MESH_COMPRESSION,this.json=n,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(n,e){const s=this.json,t=this.dracoLoader,i=n.extensions[this.name].bufferView,r=n.extensions[this.name].attributes,a={},o={},c={};for(const u in r){const l=$[u]||u.toLowerCase();a[l]=r[u]}for(const u in n.attributes){const l=$[u]||u.toLowerCase();if(r[u]!==void 0){const h=s.accessors[n.attributes[u]],d=H[h.componentType];c[l]=d.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",i).then(function(u){return new Promise(function(l,h){t.decodeDracoFile(u,function(d){for(const p in d.attributes){const R=d.attributes[p],m=o[p];m!==void 0&&(R.normalized=m)}l(d)},a,c,w,h)})})}}class Nn{constructor(){this.name=g.KHR_TEXTURE_TRANSFORM}extendTexture(n,e){return(e.texCoord===void 0||e.texCoord===n.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(n=n.clone(),e.texCoord!==void 0&&(n.channel=e.texCoord),e.offset!==void 0&&n.offset.fromArray(e.offset),e.rotation!==void 0&&(n.rotation=e.rotation),e.scale!==void 0&&n.repeat.fromArray(e.scale),n.needsUpdate=!0),n}}class In{constructor(){this.name=g.KHR_MESH_QUANTIZATION}}class _e extends on{constructor(n,e,s,t){super(n,e,s,t)}copySampleValue_(n){const e=this.resultBuffer,s=this.sampleValues,t=this.valueSize,i=n*t*3+t;for(let r=0;r!==t;r++)e[r]=s[i+r];return e}interpolate_(n,e,s,t){const i=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,u=t-e,l=(s-e)/u,h=l*l,d=h*l,p=n*c,R=p-c,m=-2*d+3*h,T=d-h,A=1-m,x=T-h+l;for(let E=0;E!==a;E++){const L=r[R+E+a],N=r[R+E+o]*u,b=r[p+E+a],k=r[p+E]*u;i[E]=A*L+x*N+m*b+T*k}return i}}const On=new me;class Cn extends _e{interpolate_(n,e,s,t){const i=super.interpolate_(n,e,s,t);return On.fromArray(i).normalize().toArray(i),i}}const M={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},H={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ue={9728:Re,9729:J,9984:He,9985:Pe,9986:Fe,9987:Te},le={33071:De,33648:ke,10497:Z},q={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},I={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Fn={CUBICSPLINE:void 0,LINEAR:xe,STEP:tn},W={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Pn(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new Ee({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:rn})),f.DefaultMaterial}function O(f,n,e){for(const s in e.extensions)f[s]===void 0&&(n.userData.gltfExtensions=n.userData.gltfExtensions||{},n.userData.gltfExtensions[s]=e.extensions[s])}function S(f,n){n.extras!==void 0&&(typeof n.extras=="object"?Object.assign(f.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function Hn(f,n,e){let s=!1,t=!1,i=!1;for(let c=0,u=n.length;c<u;c++){const l=n[c];if(l.POSITION!==void 0&&(s=!0),l.NORMAL!==void 0&&(t=!0),l.COLOR_0!==void 0&&(i=!0),s&&t&&i)break}if(!s&&!t&&!i)return Promise.resolve(f);const r=[],a=[],o=[];for(let c=0,u=n.length;c<u;c++){const l=n[c];if(s){const h=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):f.attributes.position;r.push(h)}if(t){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):f.attributes.normal;a.push(h)}if(i){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):f.attributes.color;o.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(c){const u=c[0],l=c[1],h=c[2];return s&&(f.morphAttributes.position=u),t&&(f.morphAttributes.normal=l),i&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function kn(f,n){if(f.updateMorphTargets(),n.weights!==void 0)for(let e=0,s=n.weights.length;e<s;e++)f.morphTargetInfluences[e]=n.weights[e];if(n.extras&&Array.isArray(n.extras.targetNames)){const e=n.extras.targetNames;if(f.morphTargetInfluences.length===e.length){f.morphTargetDictionary={};for(let s=0,t=e.length;s<t;s++)f.morphTargetDictionary[e[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Dn(f){let n;const e=f.extensions&&f.extensions[g.KHR_DRACO_MESH_COMPRESSION];if(e?n="draco:"+e.bufferView+":"+e.indices+":"+Y(e.attributes):n=f.indices+":"+Y(f.attributes)+":"+f.mode,f.targets!==void 0)for(let s=0,t=f.targets.length;s<t;s++)n+=":"+Y(f.targets[s]);return n}function Y(f){let n="";const e=Object.keys(f).sort();for(let s=0,t=e.length;s<t;s++)n+=e[s]+":"+f[e[s]]+";";return n}function ee(f){switch(f){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Gn(f){return f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0?"image/jpeg":f.search(/\.webp($|\?)/i)>0||f.search(/^data\:image\/webp/)===0?"image/webp":f.search(/\.ktx2($|\?)/i)>0||f.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const vn=new B;class Un{constructor(n={},e={}){this.json=n,this.extensions={},this.plugins={},this.options=e,this.cache=new un,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,t=-1,i=!1,r=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u"){const a=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);t=s&&o?parseInt(o[1],10):-1,i=a.indexOf("Firefox")>-1,r=i?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&t<17||i&&r<98?this.textureLoader=new Ie(this.options.manager):this.textureLoader=new Oe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new de(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(n){this.extensions=n}setPlugins(n){this.plugins=n}parse(n,e){const s=this,t=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(r){const a={scene:r[0][t.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:t.asset,parser:s,userData:{}};return O(i,a,t),S(a,t),Promise.all(s._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();n(a)})}).catch(e)}_markDefs(){const n=this.json.nodes||[],e=this.json.skins||[],s=this.json.meshes||[];for(let t=0,i=e.length;t<i;t++){const r=e[t].joints;for(let a=0,o=r.length;a<o;a++)n[r[a]].isBone=!0}for(let t=0,i=n.length;t<i;t++){const r=n[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(s[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(n,e){e!==void 0&&(n.refs[e]===void 0&&(n.refs[e]=n.uses[e]=0),n.refs[e]++)}_getNodeRef(n,e,s){if(n.refs[e]<=1)return s;const t=s.clone(),i=(r,a)=>{const o=this.associations.get(r);o!=null&&this.associations.set(a,o);for(const[c,u]of r.children.entries())i(u,a.children[c])};return i(s,t),t.name+="_instance_"+n.uses[e]++,t}_invokeOne(n){const e=Object.values(this.plugins);e.push(this);for(let s=0;s<e.length;s++){const t=n(e[s]);if(t)return t}return null}_invokeAll(n){const e=Object.values(this.plugins);e.unshift(this);const s=[];for(let t=0;t<e.length;t++){const i=n(e[t]);i&&s.push(i)}return s}getDependency(n,e){const s=n+":"+e;let t=this.cache.get(s);if(!t){switch(n){case"scene":t=this.loadScene(e);break;case"node":t=this._invokeOne(function(i){return i.loadNode&&i.loadNode(e)});break;case"mesh":t=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(e)});break;case"accessor":t=this.loadAccessor(e);break;case"bufferView":t=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(e)});break;case"buffer":t=this.loadBuffer(e);break;case"material":t=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(e)});break;case"texture":t=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(e)});break;case"skin":t=this.loadSkin(e);break;case"animation":t=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(e)});break;case"camera":t=this.loadCamera(e);break;default:if(t=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(n,e)}),!t)throw new Error("Unknown type: "+n);break}this.cache.add(s,t)}return t}getDependencies(n){let e=this.cache.get(n);if(!e){const s=this,t=this.json[n+(n==="mesh"?"es":"s")]||[];e=Promise.all(t.map(function(i,r){return s.getDependency(n,r)})),this.cache.add(n,e)}return e}loadBuffer(n){const e=this.json.buffers[n],s=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&n===0)return Promise.resolve(this.extensions[g.KHR_BINARY_GLTF].body);const t=this.options;return new Promise(function(i,r){s.load(v.resolveURL(e.uri,t.path),i,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(n){const e=this.json.bufferViews[n];return this.getDependency("buffer",e.buffer).then(function(s){const t=e.byteLength||0,i=e.byteOffset||0;return s.slice(i,i+t)})}loadAccessor(n){const e=this,s=this.json,t=this.json.accessors[n];if(t.bufferView===void 0&&t.sparse===void 0){const r=q[t.type],a=H[t.componentType],o=t.normalized===!0,c=new a(t.count*r);return Promise.resolve(new V(c,r,o))}const i=[];return t.bufferView!==void 0?i.push(this.getDependency("bufferView",t.bufferView)):i.push(null),t.sparse!==void 0&&(i.push(this.getDependency("bufferView",t.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",t.sparse.values.bufferView))),Promise.all(i).then(function(r){const a=r[0],o=q[t.type],c=H[t.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,h=t.byteOffset||0,d=t.bufferView!==void 0?s.bufferViews[t.bufferView].byteStride:void 0,p=t.normalized===!0;let R,m;if(d&&d!==l){const T=Math.floor(h/d),A="InterleavedBuffer:"+t.bufferView+":"+t.componentType+":"+T+":"+t.count;let x=e.cache.get(A);x||(R=new c(a,T*d,t.count*d/u),x=new Ce(R,d/u),e.cache.add(A,x)),m=new sn(x,o,h%d/u,p)}else a===null?R=new c(t.count*o):R=new c(a,h,t.count*o),m=new V(R,o,p);if(t.sparse!==void 0){const T=q.SCALAR,A=H[t.sparse.indices.componentType],x=t.sparse.indices.byteOffset||0,E=t.sparse.values.byteOffset||0,L=new A(r[1],x,t.sparse.count*T),N=new c(r[2],E,t.sparse.count*o);a!==null&&(m=new V(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let b=0,k=L.length;b<k;b++){const P=L[b];if(m.setX(P,N[b*o]),o>=2&&m.setY(P,N[b*o+1]),o>=3&&m.setZ(P,N[b*o+2]),o>=4&&m.setW(P,N[b*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=p}return m})}loadTexture(n){const e=this.json,s=this.options,i=e.textures[n].source,r=e.images[i];let a=this.textureLoader;if(r.uri){const o=s.manager.getHandler(r.uri);o!==null&&(a=o)}return this.loadTextureImage(n,i,a)}loadTextureImage(n,e,s){const t=this,i=this.json,r=i.textures[n],a=i.images[e],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,s).then(function(u){u.flipY=!1,u.name=r.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const h=(i.samplers||{})[r.sampler]||{};return u.magFilter=ue[h.magFilter]||J,u.minFilter=ue[h.minFilter]||Te,u.wrapS=le[h.wrapS]||Z,u.wrapT=le[h.wrapT]||Z,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Re&&u.minFilter!==J,t.associations.set(u,{textures:n}),u}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(n,e){const s=this,t=this.json,i=this.options;if(this.sourceCache[n]!==void 0)return this.sourceCache[n].then(l=>l.clone());const r=t.images[n],a=self.URL||self.webkitURL;let o=r.uri||"",c=!1;if(r.bufferView!==void 0)o=s.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return o=a.createObjectURL(h),o});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+n+" is missing URI and bufferView");const u=Promise.resolve(o).then(function(l){return new Promise(function(h,d){let p=h;e.isImageBitmapLoader===!0&&(p=function(R){const m=new ne(R);m.needsUpdate=!0,h(m)}),e.load(v.resolveURL(l,i.path),p,void 0,d)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),S(l,r),l.userData.mimeType=r.mimeType||Gn(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[n]=u,u}assignTexture(n,e,s,t){const i=this;return this.getDependency("texture",s.index).then(function(r){if(!r)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(r=r.clone(),r.channel=s.texCoord),i.extensions[g.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[g.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=i.associations.get(r);r=i.extensions[g.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),i.associations.set(r,o)}}return t!==void 0&&(r.colorSpace=t),n[e]=r,r})}assignFinalMaterial(n){const e=n.geometry;let s=n.material;const t=e.attributes.tangent===void 0,i=e.attributes.color!==void 0,r=e.attributes.normal===void 0;if(n.isPoints){const a="PointsMaterial:"+s.uuid;let o=this.cache.get(a);o||(o=new Ge,X.prototype.copy.call(o,s),o.color.copy(s.color),o.map=s.map,o.sizeAttenuation=!1,this.cache.add(a,o)),s=o}else if(n.isLine){const a="LineBasicMaterial:"+s.uuid;let o=this.cache.get(a);o||(o=new ve,X.prototype.copy.call(o,s),o.color.copy(s.color),o.map=s.map,this.cache.add(a,o)),s=o}if(t||i||r){let a="ClonedMaterial:"+s.uuid+":";t&&(a+="derivative-tangents:"),i&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=s.clone(),i&&(o.vertexColors=!0),r&&(o.flatShading=!0),t&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(s))),s=o}n.material=s}getMaterialType(){return Ee}loadMaterial(n){const e=this,s=this.json,t=this.extensions,i=s.materials[n];let r;const a={},o=i.extensions||{},c=[];if(o[g.KHR_MATERIALS_UNLIT]){const l=t[g.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,i,e))}else{const l=i.pbrMetallicRoughness||{};if(a.color=new F(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],w),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,U)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(n)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(n,a)})))}i.doubleSided===!0&&(a.side=Ue);const u=i.alphaMode||W.OPAQUE;if(u===W.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===W.MASK&&(a.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&r!==G&&(c.push(e.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new pe(1,1),i.normalTexture.scale!==void 0)){const l=i.normalTexture.scale;a.normalScale.set(l,l)}if(i.occlusionTexture!==void 0&&r!==G&&(c.push(e.assignTexture(a,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&r!==G){const l=i.emissiveFactor;a.emissive=new F().setRGB(l[0],l[1],l[2],w)}return i.emissiveTexture!==void 0&&r!==G&&c.push(e.assignTexture(a,"emissiveMap",i.emissiveTexture,U)),Promise.all(c).then(function(){const l=new r(a);return i.name&&(l.name=i.name),S(l,i),e.associations.set(l,{materials:n}),i.extensions&&O(t,l,i),l})}createUniqueName(n){const e=Be.sanitizeNodeName(n||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(n){const e=this,s=this.extensions,t=this.primitiveCache;function i(a){return s[g.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return fe(o,a,e)})}const r=[];for(let a=0,o=n.length;a<o;a++){const c=n[a],u=Dn(c),l=t[u];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[g.KHR_DRACO_MESH_COMPRESSION]?h=i(c):h=fe(new Ke,c,e),t[u]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(n){const e=this,s=this.json,t=this.extensions,i=s.meshes[n],r=i.primitives,a=[];for(let o=0,c=r.length;o<c;o++){const u=r[o].material===void 0?Pn(this.cache):this.getDependency("material",r[o].material);a.push(u)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),u=o[o.length-1],l=[];for(let d=0,p=u.length;d<p;d++){const R=u[d],m=r[d];let T;const A=c[d];if(m.mode===M.TRIANGLES||m.mode===M.TRIANGLE_STRIP||m.mode===M.TRIANGLE_FAN||m.mode===void 0)T=i.isSkinnedMesh===!0?new je(R,A):new Ve(R,A),T.isSkinnedMesh===!0&&T.normalizeSkinWeights(),m.mode===M.TRIANGLE_STRIP?T.geometry=oe(T.geometry,he):m.mode===M.TRIANGLE_FAN&&(T.geometry=oe(T.geometry,Q));else if(m.mode===M.LINES)T=new Xe(R,A);else if(m.mode===M.LINE_STRIP)T=new ze(R,A);else if(m.mode===M.LINE_LOOP)T=new qe(R,A);else if(m.mode===M.POINTS)T=new We(R,A);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(T.geometry.morphAttributes).length>0&&kn(T,i),T.name=e.createUniqueName(i.name||"mesh_"+n),S(T,i),m.extensions&&O(t,T,m),e.assignFinalMaterial(T),l.push(T)}for(let d=0,p=l.length;d<p;d++)e.associations.set(l[d],{meshes:n,primitives:d});if(l.length===1)return i.extensions&&O(t,l[0],i),l[0];const h=new z;i.extensions&&O(t,h,i),e.associations.set(h,{meshes:n});for(let d=0,p=l.length;d<p;d++)h.add(l[d]);return h})}loadCamera(n){let e;const s=this.json.cameras[n],t=s[s.type];if(!t){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?e=new Ye(Qe.radToDeg(t.yfov),t.aspectRatio||1,t.znear||1,t.zfar||2e6):s.type==="orthographic"&&(e=new Je(-t.xmag,t.xmag,t.ymag,-t.ymag,t.znear,t.zfar)),s.name&&(e.name=this.createUniqueName(s.name)),S(e,s),Promise.resolve(e)}loadSkin(n){const e=this.json.skins[n],s=[];for(let t=0,i=e.joints.length;t<i;t++)s.push(this._loadNodeShallow(e.joints[t]));return e.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",e.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(t){const i=t.pop(),r=t,a=[],o=[];for(let c=0,u=r.length;c<u;c++){const l=r[c];if(l){a.push(l);const h=new B;i!==null&&h.fromArray(i.array,c*16),o.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new Ze(a,o)})}loadAnimation(n){const e=this.json,s=this,t=e.animations[n],i=t.name?t.name:"animation_"+n,r=[],a=[],o=[],c=[],u=[];for(let l=0,h=t.channels.length;l<h;l++){const d=t.channels[l],p=t.samplers[d.sampler],R=d.target,m=R.node,T=t.parameters!==void 0?t.parameters[p.input]:p.input,A=t.parameters!==void 0?t.parameters[p.output]:p.output;R.node!==void 0&&(r.push(this.getDependency("node",m)),a.push(this.getDependency("accessor",T)),o.push(this.getDependency("accessor",A)),c.push(p),u.push(R))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(u)]).then(function(l){const h=l[0],d=l[1],p=l[2],R=l[3],m=l[4],T=[];for(let x=0,E=h.length;x<E;x++){const L=h[x],N=d[x],b=p[x],k=R[x],P=m[x];if(L===void 0)continue;L.updateMatrix&&L.updateMatrix();const K=s._createAnimationTracks(L,N,b,k,P);if(K)for(let j=0;j<K.length;j++)T.push(K[j])}const A=new $e(i,void 0,T);return S(A,t),A})}createNodeMesh(n){const e=this.json,s=this,t=e.nodes[n];return t.mesh===void 0?null:s.getDependency("mesh",t.mesh).then(function(i){const r=s._getNodeRef(s.meshCache,t.mesh,i);return t.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let o=0,c=t.weights.length;o<c;o++)a.morphTargetInfluences[o]=t.weights[o]}),r})}loadNode(n){const e=this.json,s=this,t=e.nodes[n],i=s._loadNodeShallow(n),r=[],a=t.children||[];for(let c=0,u=a.length;c<u;c++)r.push(s.getDependency("node",a[c]));const o=t.skin===void 0?Promise.resolve(null):s.getDependency("skin",t.skin);return Promise.all([i,Promise.all(r),o]).then(function(c){const u=c[0],l=c[1],h=c[2];h!==null&&u.traverse(function(d){d.isSkinnedMesh&&d.bind(h,vn)});for(let d=0,p=l.length;d<p;d++)u.add(l[d]);if(u.userData.pivot!==void 0&&l.length>0){const d=u.userData.pivot,p=l[0];u.pivot=new C().fromArray(d),u.position.x-=d[0],u.position.y-=d[1],u.position.z-=d[2],p.position.set(0,0,0),delete u.userData.pivot}return u})}_loadNodeShallow(n){const e=this.json,s=this.extensions,t=this;if(this.nodeCache[n]!==void 0)return this.nodeCache[n];const i=e.nodes[n],r=i.name?t.createUniqueName(i.name):"",a=[],o=t._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(n)});return o&&a.push(o),i.camera!==void 0&&a.push(t.getDependency("camera",i.camera).then(function(c){return t._getNodeRef(t.cameraCache,i.camera,c)})),t._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(n)}).forEach(function(c){a.push(c)}),this.nodeCache[n]=Promise.all(a).then(function(c){let u;if(i.isBone===!0?u=new en:c.length>1?u=new z:c.length===1?u=c[0]:u=new ge,u!==c[0])for(let l=0,h=c.length;l<h;l++)u.add(c[l]);if(i.name&&(u.userData.name=i.name,u.name=r),S(u,i),i.extensions&&O(s,u,i),i.matrix!==void 0){const l=new B;l.fromArray(i.matrix),u.applyMatrix4(l)}else i.translation!==void 0&&u.position.fromArray(i.translation),i.rotation!==void 0&&u.quaternion.fromArray(i.rotation),i.scale!==void 0&&u.scale.fromArray(i.scale);if(!t.associations.has(u))t.associations.set(u,{});else if(i.mesh!==void 0&&t.meshCache.refs[i.mesh]>1){const l=t.associations.get(u);t.associations.set(u,{...l})}return t.associations.get(u).nodes=n,u}),this.nodeCache[n]}loadScene(n){const e=this.extensions,s=this.json.scenes[n],t=this,i=new z;s.name&&(i.name=t.createUniqueName(s.name)),S(i,s),s.extensions&&O(e,i,s);const r=s.nodes||[],a=[];for(let o=0,c=r.length;o<c;o++)a.push(t.getDependency("node",r[o]));return Promise.all(a).then(function(o){for(let u=0,l=o.length;u<l;u++){const h=o[u];h.parent!==null?i.add(nn(h)):i.add(h)}const c=u=>{const l=new Map;for(const[h,d]of t.associations)(h instanceof X||h instanceof ne)&&l.set(h,d);return u.traverse(h=>{const d=t.associations.get(h);d!=null&&l.set(h,d)}),l};return t.associations=c(i),i})}_createAnimationTracks(n,e,s,t,i){const r=[],a=n.name?n.name:n.uuid,o=[];function c(d){d.morphTargetInfluences&&o.push(d.name?d.name:d.uuid)}I[i.path]===I.weights?(c(n),n.isGroup&&n.children.forEach(c)):o.push(a);let u;switch(I[i.path]){case I.weights:u=se;break;case I.rotation:u=ie;break;case I.translation:case I.scale:u=te;break;default:switch(s.itemSize){case 1:u=se;break;case 2:case 3:default:u=te;break}break}const l=t.interpolation!==void 0?Fn[t.interpolation]:xe,h=this._getArrayFromAccessor(s);for(let d=0,p=o.length;d<p;d++){const R=new u(o[d]+"."+I[i.path],e.array,h,l);t.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(R),r.push(R)}return r}_getArrayFromAccessor(n){let e=n.array;if(n.normalized){const s=ee(e.constructor),t=new Float32Array(e.length);for(let i=0,r=e.length;i<r;i++)t[i]=e[i]*s;e=t}return e}_createCubicSplineTrackInterpolant(n){n.createInterpolant=function(s){const t=this instanceof ie?Cn:_e;return new t(this.times,this.values,this.getValueSize()/3,s)},n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Bn(f,n,e){const s=n.attributes,t=new an;if(s.POSITION!==void 0){const a=e.json.accessors[s.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(t.set(new C(o[0],o[1],o[2]),new C(c[0],c[1],c[2])),a.normalized){const u=ee(H[a.componentType]);t.min.multiplyScalar(u),t.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=n.targets;if(i!==void 0){const a=new C,o=new C;for(let c=0,u=i.length;c<u;c++){const l=i[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],d=h.min,p=h.max;if(d!==void 0&&p!==void 0){if(o.setX(Math.max(Math.abs(d[0]),Math.abs(p[0]))),o.setY(Math.max(Math.abs(d[1]),Math.abs(p[1]))),o.setZ(Math.max(Math.abs(d[2]),Math.abs(p[2]))),h.normalized){const R=ee(H[h.componentType]);o.multiplyScalar(R)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}t.expandByVector(a)}f.boundingBox=t;const r=new cn;t.getCenter(r.center),r.radius=t.min.distanceTo(t.max)/2,f.boundingSphere=r}function fe(f,n,e){const s=n.attributes,t=[];function i(r,a){return e.getDependency("accessor",r).then(function(o){f.setAttribute(a,o)})}for(const r in s){const a=$[r]||r.toLowerCase();a in f.attributes||t.push(i(s[r],a))}if(n.indices!==void 0&&!f.index){const r=e.getDependency("accessor",n.indices).then(function(a){f.setIndex(a)});t.push(r)}return re.workingColorSpace!==w&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${re.workingColorSpace}" not supported.`),S(f,n),Bn(f,n,e),Promise.all(t).then(function(){return n.targets!==void 0?Hn(f,n.targets,e):f})}export{jn as GLTFLoader};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as L,B as v,L as k}from"./rr0-sighting-editor.mjs";const b=Math.PI/180;class l{static SIGHT_LINE_M=5e3;static FLAT={heightAt:()=>0};static of(n,t,e){return[...l.observer(n,t),...l.sightLines(n,t,e),...l.bodies(n,t,e),...l.traces(n,t,e)]}static observer(n,t){const e=[];for(const r of n.observerTrack.allKeyframes){const s=L(n,r.t);if(s?.lat===void 0||s.lng===void 0)continue;const d=s.elevationM??0;e.push({t:r.t,at:{lat:s.lat,lng:s.lng,altM:d+v.EYE_HEIGHT_M},...s.headingDeg===void 0?{}:{headingDeg:s.headingDeg},elevationM:d})}if(e.length===0)return[];const o=e[0],a=[{group:"observer",groupName:t.folderObserver,name:l.fill(t.observerPoint,{s:l.seconds(o.t)}),note:l.fill(t.observerNote,{elevation:l.round(o.elevationM,1),heading:o.headingDeg===void 0?"—":l.round(o.headingDeg,0)}),kind:"point",points:[o.at],heights:"observer-ground"}];return e.some(r=>r.at.lat!==o.at.lat||r.at.lng!==o.at.lng)&&a.push({group:"observer",groupName:t.folderObserver,name:t.observerPath,kind:"line",points:e.map(r=>r.at),heights:"observer-ground"}),a}static sightLines(n,t,e){const o=[];for(const a of n.timeline.allKeyframes){const i=L(n,a.t);if(i?.lat===void 0||i.lng===void 0)continue;const r={lat:i.lat,lng:i.lng,altM:(i.elevationM??0)+v.EYE_HEIGHT_M};for(const s of a.shapes){const d=s.shape.aim;d&&o.push({group:"sight-line",groupName:t.folderSightLines,name:l.fill(t.sightLine,{what:l.nameOf(e.read(s.shape.title),s.sourceId,t),s:l.seconds(a.t)}),note:l.fill(t.sightLineNote,{azimuth:l.round(d.azimuthDeg,1),altitude:l.round(d.altitudeDeg,1),km:l.round(l.SIGHT_LINE_M/1e3,0)}),kind:"line",points:[r,l.along(r,d.azimuthDeg,d.altitudeDeg)],heights:"observer-ground"})}}return o}static along(n,t,e){const o=l.SIGHT_LINE_M*Math.cos(e*b),a=k.toGeo({eastM:Math.sin(t*b)*o,northM:Math.cos(t*b)*o},n);return{lat:a.lat,lng:a.lng,altM:n.altM+l.SIGHT_LINE_M*Math.sin(e*b)}}static bodies(n,t,e){const o=n.interpretation?.bodies??[],a=L(n,0);if(o.length===0||a?.lat===void 0||a.lng===void 0)return[];const i={lat:a.lat,lng:a.lng},r=[];for(const s of o){const d=new v(s,l.FLAT,h=>v.eyeOf(n,h,l.FLAT)),f=[];for(const h of[...s.track].sort((c,m)=>c.t-m.t)){const c=d.at(h.t);if(!c)continue;const m=k.toGeo({eastM:c.eastM,northM:c.northM},i),u={lat:m.lat,lng:m.lng,altM:c.upM},M=f[f.length-1];M&&M.lat===u.lat&&M.lng===u.lng&&M.altM===u.altM||f.push(u)}if(f.length===0)continue;const y=l.nameOf(e.read(s.title),s.id,t);r.push({group:"body",groupName:t.folderBodies,name:l.fill(f.length===1?t.bodyPoint:t.bodyPath,{what:y}),note:t.bodyNote,kind:f.length===1?"point":"line",points:f,heights:"observer-ground"})}return r}static traces(n,t,e){return n.traces.map(o=>({group:"trace",groupName:t.folderTraces,name:e.read(o.title)??o.id,...e.read(o.source)?{note:e.read(o.source)}:{},kind:o.kind,points:o.points.map(a=>({lat:a.lat,lng:a.lng,altM:a.altM??0})),heights:o.altitude??"ground",...o.color?{color:o.color}:{}}))}static nameOf(n,t,e){return n&&n.trim()?n.trim():l.fill(e.unnamed,{id:t})}static seconds(n){return l.round(n/1e3,1)}static round(n,t){const e=10**t;return String(Math.round(n*e)/e)}static fill(n,t){return Object.entries(t).reduce((e,[o,a])=>e.replaceAll(`{${o}}`,a),n)}}export{l as G};
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SightingFileEditor-BCjntT4l.js","./index-DSNA74v6.js","./sightingSchema-RamhmoRU.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{S,a as T,H as M,s as j,U as I,I as P,b as W,P as z,c as y,W as N,r as D,d as J,E as L,e as H,A as B,f as E,M as q,_ as C,l as V}from"./rr0-sighting-editor.mjs";import{InterviewMedia as A}from"./InterviewMedia-CvAxC62V.js";import{InterviewFile as f}from"./interviewJson-DXD8FSBX.js";const $="rr0-interview",G=`
|
|
3
|
-
rr0-interview { display: block; --rr0-interview-line: color-mix(in srgb, currentColor 35%, transparent); }
|
|
4
|
-
rr0-interview [hidden] { display: none !important; }
|
|
5
|
-
rr0-interview .rr0-interview-status { font-size: .85em; opacity: .85; margin: 0 0 .5em; }
|
|
6
|
-
/* Scrolling only where a height is asked for: a box that scrolls keeps clear of the page's floated figures for all its height. */
|
|
7
|
-
rr0-interview .rr0-interview-turns { max-height: var(--rr0-interview-max-height, none); overflow-y: var(--rr0-interview-overflow, visible); }
|
|
8
|
-
/* An intervention: what one speaker says before another speaks, one turn or several; pointed at as a whole. */
|
|
9
|
-
rr0-interview .intervention { margin: 0 0 .4em; border-left: 3px solid var(--speaker); --speaker: hsl(var(--speaker-hue, 0) 55% 38%); transition: background-color .15s; }
|
|
10
|
-
@media (prefers-color-scheme: dark) { rr0-interview .intervention { --speaker: hsl(var(--speaker-hue, 0) 65% 70%); } }
|
|
11
|
-
rr0-interview .intervention:hover { background: color-mix(in srgb, var(--speaker) 7%, transparent); }
|
|
12
|
-
rr0-interview .turn { position: relative; padding: .2em .5em; }
|
|
13
|
-
rr0-interview .turn.flash { background: color-mix(in srgb, #fc3 28%, transparent); }
|
|
14
|
-
/* The passage the replay is inside stays lit while it is there, instead of a flash that is over before anyone looks. Nothing marks the
|
|
15
|
-
passages that are merely tied to a moment: each already carries its timecode, which says it (dicté). */
|
|
16
|
-
rr0-interview .turn.synced { background: color-mix(in srgb, #fc3 12%, transparent); }
|
|
17
|
-
rr0-interview .turn .who { font-size: .85em; font-weight: 600; color: var(--speaker); overflow-wrap: anywhere; }
|
|
18
|
-
rr0-interview .turn.is-redacted .who, rr0-interview .turn.goes-on .who { display: none; }
|
|
19
|
-
rr0-interview .turn .said, rr0-interview .turn .redacted { margin: 0; padding: 0; text-indent: 0; white-space: pre-wrap; }
|
|
20
|
-
rr0-interview .turn .said::before, rr0-interview .turn .said::after { content: none; }
|
|
21
|
-
/* Tooltips drawn here rather than left to the browser's own, which some hosts (an embedded pane) never show. */
|
|
22
|
-
rr0-interview .turn[data-time]:hover:not(:has(.bar:hover, .bar:focus, .said a:hover))::after { content: attr(data-time); position: absolute; right: .3em; top: .2em; z-index: 2;
|
|
23
|
-
padding: 0 .4em; border-radius: 3px; font-size: .8em; font-variant-numeric: tabular-nums; background: #222; color: #fff; pointer-events: none; }
|
|
24
|
-
rr0-interview .bar { position: relative; display: inline-block; width: 3em; height: .9em; vertical-align: -.1em; border-radius: 2px; background: currentColor; margin: 0 .2em; cursor: help; }
|
|
25
|
-
rr0-interview .bar::after { content: attr(data-tip); display: none; position: absolute; left: 0; top: 1.4em; z-index: 3; width: max-content; max-width: 22em; padding: .3em .5em;
|
|
26
|
-
border-radius: 4px; background: #222; color: #fff; font-size: .85em; line-height: 1.3; white-space: normal; }
|
|
27
|
-
rr0-interview .bar:hover::after, rr0-interview .bar:focus::after { display: block; }
|
|
28
|
-
rr0-interview .turn .refs { display: flex; flex-wrap: wrap; gap: .25em; }
|
|
29
|
-
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;
|
|
30
|
-
padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: .15em; }
|
|
31
|
-
rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
|
|
32
|
-
`;class O extends HTMLElement{messages;said=new S(["en"]);localeToken=0;loadToken=0;json;loading;base;status=document.createElement("p");turns=document.createElement("div");blocks=new Map;lastRevealed;syncedIndex;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,s){e==="src"&&s!==t&&this.isConnected&&this.load()}connectedCallback(){O.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 s=document.createElement("style");s.dataset.rr0Interview="",s.textContent=G,t.append(s)}async load(){const e=this.getAttribute("src"),t=++this.loadToken;if(this.loading=e??void 0,!e)return;const s=new URL(e,location.href).href;let r;try{r=f.read(await T.json(s))}catch{r=void 0}t===this.loadToken&&(this.base=s,this.json=r,this.draw())}async loadLocale(){const e=++this.localeToken,t=M.preferencesFor(this),s=j(t,I),r=await P.load(s);e===this.localeToken&&(this.said=new S(t),this.messages=r,this.draw())}speakerName(e,t){const s=f.speakerName(e,t),r=e.speakers?.[t]?.role;return s===r&&r in this.messages.roles?this.messages.roles[r]:s}seek(e,t){const s=this.json,r=t?f.said(t):void 0,i={sighting:e.sighting??f.sightingsOf(s)[0],at:e.at,...r?{quote:r}:{}};this.dispatchEvent(new CustomEvent(W,{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 s=document.createElement(t),r=document.createElement("span");r.className="bar";const i=`${this.messages.redacted}${this.messages.colon}${this.said.read(e)??""}`;return r.dataset.tip=i,r.tabIndex=0,r.setAttribute("role","img"),r.setAttribute("aria-label",i),s.append(r),s}saidNodes(e){if(!/[<&]/.test(e))return[document.createTextNode(e)];const t=document.createElement("template");t.innerHTML=e;for(const s of t.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(s.tagName)){s.remove();continue}for(const r of[...s.attributes])if(/^on/i.test(r.name)||/^\s*javascript:/i.test(r.value))s.removeAttribute(r.name);else if(["href","src"].includes(r.name))try{r.value=new URL(r.value,this.base??location.href).href}catch{}}return[...t.content.childNodes]}draw(){if(!this.messages)return;const e=this.messages,t=this.json;this.blocks.clear();const s=Array.isArray(t?.segments)?t.segments:[];if(!t||s.length===0){this.status.hidden=!0;const d=document.createElement("p");d.textContent=e.exchangesEmpty,this.turns.replaceChildren(d);return}const r=t.speakers??{},i=Object.keys(r);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;s.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=f.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 R="redacted"in w?"▮":f.plain(w.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(k)&&/^[\p{L}\p{N}(«“▮]/u.test(R)&&v.append(" "),"redacted"in w?v.append(this.gap(w.redacted.reason,"span")):v.append(...this.saidNodes(w.text)),k=R}}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=z.PLAY,w.append(f.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)}revealAt(e,t){const s=this.json;if(!s)return;const r=f.sightingsOf(s)[0];let i;if(s.segments?.forEach((a,n)=>{for(const l of a.refs??[]){const c=l.sighting??r;t!==void 0&&c!==void 0&&c!==t||l.at>e+.001||(!i||l.at>i.at)&&(i={index:n,at:l.at})}}),!!i)return i.index!==this.lastRevealed&&(this.lastRevealed=i.index,this.revealSegment(i.index)),this.markSynced(i.index),i.index}momentsCited(e){const t=this.json;if(!t)return[];const s=f.sightingsOf(t)[0],r=[];for(const i of t.segments??[])for(const a of i.refs??[]){const n=a.sighting??s;e!==void 0&&n!==void 0&&n!==e||r.push({at:a.at,quote:f.said(i)??""})}return r.sort((i,a)=>i.at-a.at)}markSynced(e){e!==this.syncedIndex&&(this.syncedIndex!==void 0&&this.blocks.get(this.syncedIndex)?.classList.remove("synced"),this.syncedIndex=e,this.blocks.get(e)?.classList.add("synced"))}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 Y(){customElements.get($)||customElements.define($,O)}class g{static partsOf(e){return e.parts?e.parts:e.redacted?[]:[{text:e.text??""}]}static shownRanges(e){const t=[];let s="",r=0;return e.forEach((i,a)=>{const n="redacted"in i?"▮":f.plain(i.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(s)&&/^[\p{L}\p{N}(«“▮]/u.test(n)&&(r+=1);const l="redacted"in i?0:n.length;t.push({part:a,from:r,to:r+l}),r+=l,s=n}),t}static words(e){return e.trim()===""?0:e.trim().split(/\s+/u).length}static redact(e,t,s,r){const i=[...g.partsOf(e)],a=g.shownRanges(i).find(x=>!("redacted"in i[x.part])&&t>=x.from&&s<=x.to);if(!a)return;const n=f.plain(i[a.part].text),l=/[\p{L}\p{N}'’-]/u;let c=t-a.from,o=s-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:r,words:g.words(d)}},...u!==""?[{text:u}]:[]],b=i.slice(0,a.part).filter(x=>"redacted"in x).length;return i.splice(a.part,1,...p),g.setParts(e,i),{text:d.trim(),nth:b}}static redactWhole(e,t){const s=JSON.stringify({text:e.text,parts:e.parts}),r=g.partsOf(e).reduce((i,a)=>i+("redacted"in a?a.redacted.words??0:g.words(f.plain(a.text))),0);if(delete e.text,delete e.parts,e.redacted={reason:t,...r>0?{words:r}:{}},e.refs)for(const i of e.refs)delete i.range;return s}static restoreWhole(e,t){const{text:s,parts:r}=JSON.parse(t);delete e.redacted,r?e.parts=r:e.text=s??""}static restorePart(e,t,s){const r=[...g.partsOf(e)];let i=-1;const a=r.findIndex(n=>"redacted"in n&&++i===t);a!==-1&&(r.splice(a,1,{text:s}),g.setParts(e,r))}static raw(e,t=()=>{}){let s=-1,r="",i="";for(const a of g.partsOf(e)){const n="redacted"in a?`⟦${t(++s)??"…"}⟧`:a.text;r!==""&&!/\s$/u.test(i)&&!/^\s/u.test(n)&&(r+=" "),r+=n,i=n}return r}static fromRaw(e,t,s){const r=g.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:r[n]?.redacted??{reason:s}}):(i.push({redacted:{reason:s,words:g.words(o)}}),a.set(n,o))}),delete e.redacted,g.setParts(e,i),a}static setParts(e,t){const s=[];for(const r of t){const i=s[s.length-1],a=!("redacted"in r)&&/^[,.;:!?)»”…]/u.test(r.text)?"":" ";i&&!("redacted"in i)&&!("redacted"in r)?s[s.length-1]={text:`${i.text}${a}${r.text}`.replace(/\s+/gu," ").trim()}:s.push(r)}if(s.some(r=>"redacted"in r)){if(e.parts=s,delete e.text,e.refs)for(const r of e.refs)delete r.range}else e.text=s.map(r=>r.text).join(" "),delete e.parts}}class U{constructor(e,t,s){this.host=t,this.messages=s,e.classList.add("player"),e.innerHTML=`<div class="player-video" hidden></div>
|
|
33
|
-
<div class="player-bar">
|
|
34
|
-
<button type="button" class="icon-btn player-play" disabled>${y.PLAY}</button>
|
|
35
|
-
<span class="player-time">0:00</span>
|
|
36
|
-
<div class="speaker-track" role="slider" tabindex="0" aria-valuemin="0"></div>
|
|
37
|
-
<span class="player-time player-end">0:00</span>
|
|
38
|
-
<button type="button" class="pill-btn player-recordings"></button>
|
|
39
|
-
</div>
|
|
40
|
-
<p class="player-empty"></p>
|
|
41
|
-
<dialog class="recordings-window"><h3></h3><div class="recording-rows"></div><button type="button" class="pill-btn recording-add">${y.PLUS}<span></span></button></dialog>`,this.play=e.querySelector(".player-play"),this.time=e.querySelector(".player-time"),this.end=e.querySelector(".player-end"),this.track=e.querySelector(".speaker-track"),this.video=e.querySelector(".player-video"),this.empty=e.querySelector(".player-empty"),this.open=e.querySelector(".player-recordings"),this.window=e.querySelector(".recordings-window"),this.play.addEventListener("click",()=>{this.media&&(this.media.paused?this.media.play().catch(()=>{}):this.media.pause())}),this.track.addEventListener("pointerdown",r=>{const i=this.track.getBoundingClientRect();i.width>0&&this.seek((r.clientX-i.left)/i.width*this.duration)}),this.track.addEventListener("keydown",r=>{(r.key==="ArrowRight"||r.key==="ArrowLeft")&&this.seek(this.now+(r.key==="ArrowRight"?5:-5))}),this.open.addEventListener("click",()=>this.showWindow()),e.querySelector(".recording-add").addEventListener("click",()=>this.edit(r=>r.push({kind:"audio",src:""}))),N.dialog(this.window,s.close,()=>this.window.close())}static CSS=`
|
|
42
|
-
.player { margin: 0 0 4px; border-radius: 12px; }
|
|
43
|
-
.player-video { aspect-ratio: 16 / 9; margin-bottom: 8px; border-radius: 10px; overflow: hidden; background: #0b1020; }
|
|
44
|
-
.player-video video { width: 100%; height: 100%; display: block; }
|
|
45
|
-
.player-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--ground-sunken); }
|
|
46
|
-
.player-time { font: 500 13px/1 var(--mono); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
|
|
47
|
-
.speaker-track { position: relative; flex: 1 1 auto; height: 28px; border-radius: 6px; cursor: pointer; overflow: hidden;
|
|
48
|
-
background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 4px); }
|
|
49
|
-
.speaker-track .seg { position: absolute; top: 4px; bottom: 4px; border-radius: 2px; }
|
|
50
|
-
.speaker-track .seg[data-role="witness"] { background: #c9a14a; }
|
|
51
|
-
.speaker-track .seg[data-role="interviewer"] { background: #5b8fc4; }
|
|
52
|
-
.speaker-track .seg[data-role="other"] { background: var(--ink-faint); }
|
|
53
|
-
.speaker-track .seg.redacted { background: repeating-linear-gradient(135deg, var(--ink-faint) 0 3px, transparent 3px 6px); }
|
|
54
|
-
.speaker-track .head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f5c451; }
|
|
55
|
-
.player-empty { margin: 6px 2px 0; font-size: 13px; color: var(--ink-faint); }
|
|
56
|
-
.recordings-window { max-width: min(36em, 94vw); padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--ground-raised); color: var(--ink); }
|
|
57
|
-
.recordings-window::backdrop { background: rgba(7, 10, 18, .5); }
|
|
58
|
-
.recordings-window h3 { margin: 0 0 12px; font: 600 19px/1.3 var(--serif); }
|
|
59
|
-
.recording-row { display: grid; grid-template-columns: 8em minmax(0, 1fr) 6em auto; gap: 8px; align-items: end; margin-bottom: 10px; }
|
|
60
|
-
.recording-row label { display: flex; flex-direction: column; gap: 4px; font: 600 12px/1.3 var(--sans); color: var(--ink-dim); }
|
|
61
|
-
.recording-row input, .recording-row select { box-sizing: border-box; width: 100%; font-weight: 400; }
|
|
62
|
-
.recording-file { display: flex; gap: 6px; }
|
|
63
|
-
.recording-status { grid-column: 1 / -1; margin: -4px 0 0; font-size: 12px; color: var(--ink-faint); }
|
|
64
|
-
.recording-status.error { color: var(--error); }
|
|
65
|
-
`;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(s=>s.end??s.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 s=document.createElement(e.kind==="video"?"video":"audio");s.preload="metadata",s.src=this.urlOf(e.src),s.addEventListener("loadedmetadata",()=>this.drawTrack()),s.addEventListener("timeupdate",()=>{this.placeHead(),this.host.timeChanged(this.now)});const r=()=>{const i=!s.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)};s.addEventListener("play",r),s.addEventListener("pause",r),e.kind==="video"&&(this.video.append(s),this.video.hidden=!1),this.media=s,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,s=(e?.segments??[]).filter(i=>i.start!==void 0);this.track.replaceChildren(...s.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 r=document.createElement("span");r.className="head",this.track.append(r),this.track.setAttribute("aria-valuemax",String(Math.round(t))),this.end.textContent=f.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=f.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,N.dialog(this.window,e.close,()=>this.window.close()),this.window.querySelector(".recording-rows").replaceChildren(...this.recordings.map((s,r)=>{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=s.kind,a.addEventListener("change",()=>this.edit(p=>{p[r].kind=a.value}));const n=document.createElement("input");n.type="text",n.value=s.src,n.placeholder="interview.mp3",n.addEventListener("change",()=>this.edit(p=>{p[r].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[r].src=p.name,p.type.startsWith("video/")&&(b[r].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=s.offset!==void 0?String(s.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[r].offset:p[r].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(r,1)}));const u=document.createElement("p");return u.className="recording-status",this.check(s,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,s){const r=document.createElement("label"),i=document.createElement("span");return i.textContent=e,r.append(i,t),s&&r.append(` ${s}`),r}check(e,t){if(e.src==="")return;const s=document.createElement(e.kind==="video"?"video":"audio");s.preload="metadata",s.addEventListener("loadedmetadata",()=>{t.textContent=f.clock(Math.round(s.duration)),t.classList.remove("error")}),s.addEventListener("error",()=>{t.textContent=this.messages.loadFailed,t.classList.add("error")}),s.src=this.urlOf(e.src)}edit(e){const t=structuredClone(this.recordings);e(t),this.host.recordingsChanged(t)}}const F="rr0-interview-editor",K=`
|
|
66
|
-
<style>
|
|
67
|
-
:host { display: block; }
|
|
68
|
-
/* 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. */
|
|
69
|
-
:host { --file-key: #1a5fb4; --file-string: #26662f; --file-literal: #a5321f; --rr0-alert: #c33; }
|
|
70
|
-
@media (prefers-color-scheme: dark) { :host { --file-key: #8cb8ff; --file-string: #8fd39a; --file-literal: #ffa08a; } }
|
|
71
|
-
[hidden] { display: none !important; }
|
|
72
|
-
/* Two groups as the recording's editor has its own (see sightingEditorTemplate): the open tab raised and joined to its panel. */
|
|
73
|
-
.group-tabs { --tab-line: color-mix(in srgb, CanvasText 35%, transparent); --tab-surface: color-mix(in srgb, CanvasText 5%, Canvas);
|
|
74
|
-
--tab-recessed: color-mix(in srgb, CanvasText 11%, Canvas); --tab-accent: #4a9eff;
|
|
75
|
-
display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0; margin: 0; padding: 0; border-bottom: 1px solid var(--tab-line); }
|
|
76
|
-
.group-tab { -webkit-user-select: none; user-select: none; font: inherit; font-weight: 600; cursor: pointer; color: color-mix(in srgb, CanvasText 70%, transparent); background: var(--tab-recessed);
|
|
77
|
-
border: 1px solid var(--tab-line); border-radius: 8px 8px 0 0; padding: .4em .6em; margin: 0 0 -1px -1px; position: relative; }
|
|
78
|
-
.group-tab:hover { color: CanvasText; background: color-mix(in srgb, CanvasText 16%, Canvas); }
|
|
79
|
-
.group-tab[aria-expanded="true"] { color: CanvasText; background: var(--tab-surface); border-bottom-color: var(--tab-surface); box-shadow: inset 0 2px 0 var(--tab-accent); z-index: 1; }
|
|
80
|
-
.group-tab:focus-visible { outline: 2px solid #4af; outline-offset: -2px; }
|
|
81
|
-
.group-panel { border: 1px solid var(--tab-line, color-mix(in srgb, CanvasText 35%, transparent)); border-top: 0; border-radius: 0 0 4px 4px;
|
|
82
|
-
background: color-mix(in srgb, CanvasText 5%, Canvas); padding: .5em .75em; margin: 0 0 .5em; }
|
|
83
|
-
.row { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; margin-bottom: .5em; }
|
|
84
|
-
.group-panel > .row:last-child { margin-bottom: 0; }
|
|
85
|
-
label { display: flex; align-items: center; gap: .4em; }
|
|
86
|
-
label.wide { flex: 1 1 100%; align-items: flex-start; }
|
|
87
|
-
label.wide textarea { flex: 1 1 auto; min-width: 0; min-height: 9em; }
|
|
88
|
-
label.fill { flex: 1 1 100%; }
|
|
89
|
-
label.fill input { flex: 1 1 auto; }
|
|
90
|
-
input[type="text"] { min-width: 0; }
|
|
91
|
-
#by { width: 16em; }
|
|
92
|
-
input[type="url"] { width: 18em; max-width: 100%; }
|
|
93
|
-
${J.CSS}
|
|
94
|
-
select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
|
|
95
|
-
fieldset.witnesses { display: flex; flex-wrap: wrap; align-items: center; gap: .25em .75em; border: 0; margin: 0; padding: 0; min-width: 0; }
|
|
96
|
-
fieldset.witnesses legend { float: left; padding: 0; margin-right: .4em; }
|
|
97
|
-
#exchanges { --rr0-interview-max-height: 32em; --rr0-interview-overflow: auto; }
|
|
98
|
-
.file-note { margin: .3em 0; }
|
|
99
|
-
${q.rules([".file-note"])}
|
|
100
|
-
.file-editor { min-height: 18em; margin-top: .5em; }
|
|
101
|
-
/* ---- The design handoff's look (design_handoff_editeurs_ufoathome, §2 and §5) ---- */
|
|
102
|
-
:host {
|
|
103
|
-
${L.TOKENS}
|
|
104
|
-
--rr0-field-radius: 8px;
|
|
105
|
-
--rr0-input-font-size: 15px;
|
|
106
|
-
container-type: inline-size;
|
|
107
|
-
font: 400 15px/1.5 var(--sans);
|
|
108
|
-
color: var(--ink);
|
|
109
|
-
}
|
|
110
|
-
${L.HEAD}
|
|
111
|
-
${L.fields(".interview-app")}
|
|
112
|
-
.recordings-window :is(button, input, select) { font: inherit; }
|
|
113
|
-
.recordings-window .pill-btn { min-height: 36px; }
|
|
114
|
-
/* Its parts, underlined, as the case's are. */
|
|
115
|
-
#tabs { display: flex; gap: 6px; padding: 0; border-bottom: 1px solid var(--line); }
|
|
116
|
-
#tabs .group-tab {
|
|
117
|
-
display: inline-flex; align-items: center; gap: 8px; min-height: 0; margin: 0 0 -1px; padding: 12px 10px;
|
|
118
|
-
border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; color: var(--ink-dim); font: 600 15px/1.2 var(--sans);
|
|
119
|
-
}
|
|
120
|
-
#tabs .group-tab:hover { background: none; color: var(--ink); }
|
|
121
|
-
#tabs .group-tab[aria-expanded="true"] { color: var(--ink); border-bottom-color: var(--glow-solid); background: none; box-shadow: none; }
|
|
122
|
-
.interview-app > .group-panel { margin: 0; padding: 18px 0 0; border: 0; border-radius: 0; background: none; color: var(--ink); }
|
|
123
|
-
/* Fields: the label above, the value under it, on a grid that fills the width; the title and what was established the whole width. */
|
|
124
|
-
#group-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
|
|
125
|
-
#group-summary > .row { display: contents; }
|
|
126
|
-
#group-summary label, #group-transcript label { display: flex; flex-direction: column; align-items: stretch; gap: 6px; font: 600 13px/1.3 var(--sans); color: var(--ink-dim); }
|
|
127
|
-
#group-summary :is(label.fill, label.wide) { grid-column: 1 / -1; }
|
|
128
|
-
#group-summary :is(input, select, textarea), #group-transcript input[type="text"] { box-sizing: border-box; width: 100%; font-weight: 400; }
|
|
129
|
-
#group-summary input[type="text"], #group-transcript input[type="text"] { height: 38px; }
|
|
130
|
-
#group-summary textarea { min-height: 9em; }
|
|
131
|
-
fieldset.witnesses { flex-direction: column; align-items: flex-start; gap: 6px; font: 600 13px/1.3 var(--sans); color: var(--ink-dim); }
|
|
132
|
-
/* A witness's name stays on one line beside its box: shrunk to its words, the label broke "Q. B." in two. */
|
|
133
|
-
#group-summary fieldset.witnesses label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); white-space: nowrap; }
|
|
134
|
-
/* The exchanges, one card an intervention, the speaker's colour down its side: a list that scrolls past 520 px (440 on a phone). */
|
|
135
|
-
#exchanges { --rr0-interview-max-height: 520px; --rr0-interview-line: var(--line-strong); }
|
|
136
|
-
#exchanges .rr0-interview-turns { padding-right: 4px; }
|
|
137
|
-
#exchanges .intervention { margin: 0 0 10px; padding: 6px 4px; border: 1px solid var(--line-strong); border-left: 3px solid var(--speaker); border-radius: 10px; background: var(--ground); }
|
|
138
|
-
#exchanges .intervention:hover { background: var(--ground-sunken); }
|
|
139
|
-
#exchanges .turn .who { display: inline-block; margin-bottom: 4px; padding: 1px 9px; border-radius: 999px; background: color-mix(in srgb, var(--speaker) 18%, transparent); color: var(--ink); font: 700 12px/1.5 var(--sans); }
|
|
140
|
-
#exchanges .turn .said { font-size: 15px; line-height: 1.55; color: var(--ink); }
|
|
141
|
-
#exchanges .turn .ref { border-color: var(--glow-dim); background: var(--warn-bg); color: var(--ink); font: 600 12px/1.6 var(--sans); padding: 1px 9px; }
|
|
142
|
-
#exchanges .turn.flash { background: var(--warn-bg); }
|
|
143
|
-
#exchanges .rr0-interview-status { padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--ink-dim); font-size: 13px; }
|
|
144
|
-
#group-transcript > .row { margin-bottom: 12px; }
|
|
145
|
-
@container (max-width: 640px) { #exchanges { --rr0-interview-max-height: 440px; } }
|
|
146
|
-
${U.CSS}
|
|
147
|
-
${H.CSS}
|
|
148
|
-
${N.CSS}
|
|
149
|
-
${B.CSS}
|
|
150
|
-
${y.CSS}
|
|
151
|
-
/* Who has proofread it, said once above the exchanges, with a box each to say they have (see renderReview); the reader's own line goes. */
|
|
152
|
-
#exchanges .rr0-interview-status { display: none; }
|
|
153
|
-
.review { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 10px; padding: 10px 14px;
|
|
154
|
-
border-radius: 10px; background: var(--warn-bg); font-size: 13px; color: var(--ink-dim); }
|
|
155
|
-
.review[data-done] { background: var(--neutral-bg); }
|
|
156
|
-
.review-boxes { display: flex; flex-wrap: wrap; gap: 14px; }
|
|
157
|
-
.review-boxes label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
|
|
158
|
-
.redact-row { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
|
|
159
|
-
.redact-note { font-size: 13px; color: var(--ink-faint); }
|
|
160
|
-
.redact-note.error { color: var(--error); }
|
|
161
|
-
/* Each turn: its time, which plays from there; what is taken out as a label that says how much, and puts it back while it is known. */
|
|
162
|
-
#exchanges .turn { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); column-gap: 14px; padding: 8px 10px; }
|
|
163
|
-
#exchanges .turn > .turn-time { grid-row: 1; grid-column: 1; }
|
|
164
|
-
#exchanges .turn > .who { grid-column: 1; align-self: start; }
|
|
165
|
-
#exchanges .turn > :not(.who, .turn-time) { grid-column: 2; }
|
|
166
|
-
#exchanges .turn > .said, #exchanges .turn > .redacted { grid-row: 1 / span 2; }
|
|
167
|
-
#exchanges .turn.goes-on > .who, #exchanges .turn.is-redacted > .who { display: block; visibility: hidden; }
|
|
168
|
-
/* The time is on the turn itself here: the reader's tooltip of it would say it twice. */
|
|
169
|
-
#exchanges .turn[data-time]::after { content: none !important; display: none !important; }
|
|
170
|
-
.turn-time { justify-self: start; min-height: 0; padding: 0; border: 0; background: none; color: var(--sky); font: 600 13px/1.4 var(--mono); cursor: pointer; }
|
|
171
|
-
.turn-time:hover:not(:disabled) { background: none; text-decoration: underline; }
|
|
172
|
-
#exchanges .bar.redacted-label { width: auto; height: auto; padding: 0 8px; border: 1px dashed var(--line-strong); border-radius: 999px; background: none; color: var(--ink-faint);
|
|
173
|
-
font: 600 12px/1.6 var(--sans); vertical-align: baseline; cursor: default; }
|
|
174
|
-
#exchanges .bar.redacted-label[data-restorable] { cursor: pointer; }
|
|
175
|
-
#exchanges .bar.redacted-label[data-restorable]:hover { border-color: var(--glow-dim); color: var(--ink); }
|
|
176
|
-
.turn-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; margin-top: 6px; }
|
|
177
|
-
.turn-tools button { min-height: 0; padding: 2px 4px; border: 0; background: none; color: var(--ink-faint); font: 600 13px/1.4 var(--sans); }
|
|
178
|
-
.turn-tools button:hover:not(:disabled) { background: none; color: var(--ink); }
|
|
179
|
-
.turn-tools .icon-btn { min-width: 0; }
|
|
180
|
-
#exchanges .turn.current { background: var(--warn-bg); border-radius: 8px; }
|
|
181
|
-
#exchanges .intervention:has(.turn.current) { border-color: var(--glow-dim); }
|
|
182
|
-
#exchanges .turn .refs { align-items: center; }
|
|
183
|
-
#exchanges .turn .ref { display: inline-block; max-width: calc(100% - 2em); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
184
|
-
#exchanges .turn .ref .moment-letter { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 4px; border-radius: 50%; background: var(--glow-solid); color: var(--glow-on-solid); font: 700 11px/1 var(--sans); }
|
|
185
|
-
#exchanges .turn .ref-unlink { min-height: 0; padding: 0 4px; border: 0; background: none; color: var(--ink-faint); font: 600 13px/1 var(--sans); }
|
|
186
|
-
.turn-edit { display: flex; flex-direction: column; gap: 6px; }
|
|
187
|
-
.turn-edit textarea { box-sizing: border-box; width: 100%; min-height: 6em; }
|
|
188
|
-
.turn-edit .hint { font-size: 12px; color: var(--ink-faint); }
|
|
189
|
-
.turn-edit .buttons { display: flex; gap: 8px; }
|
|
190
|
-
</style>
|
|
191
|
-
<div class="interview-app">
|
|
192
|
-
<!-- The player: what plays the interview's recordings, with who speaks along it (see InterviewPlayer). -->
|
|
193
|
-
<div id="player"></div>
|
|
194
|
-
<div id="tabs" class="group-tabs">
|
|
195
|
-
<button class="group-tab" type="button" aria-controls="group-summary" aria-expanded="true"><span id="label-summary-group"></span></button>
|
|
196
|
-
<button class="group-tab" type="button" aria-controls="group-exchanges" aria-expanded="false"><span id="label-exchanges-group"></span></button>
|
|
197
|
-
<button class="group-tab" type="button" aria-controls="group-transcript" aria-expanded="false"><span id="label-file-group"></span></button>
|
|
198
|
-
</div>
|
|
199
|
-
<section class="group-panel" id="group-summary" aria-labelledby="label-summary-group">
|
|
200
|
-
<div class="row">
|
|
201
|
-
<label class="fill"><span id="label-title"></span> <input id="title" type="text"/></label>
|
|
202
|
-
</div>
|
|
203
|
-
<div class="row">
|
|
204
|
-
<fieldset id="witness" class="witnesses"><legend id="label-witness"></legend></fieldset>
|
|
205
|
-
<label><span id="label-medium"></span> <select id="medium"></select></label>
|
|
206
|
-
<label><span id="label-time"></span> <input id="time" type="text" size="16" placeholder="2026-10-13 21:27"/></label>
|
|
207
|
-
<label><span id="label-by"></span> <input id="by" type="text" autocomplete="off" spellcheck="false"/></label>
|
|
208
|
-
</div>
|
|
209
|
-
<div class="row">
|
|
210
|
-
<label class="wide"><span id="label-summary"></span> <textarea id="summary"></textarea></label>
|
|
211
|
-
</div>
|
|
212
|
-
</section>
|
|
213
|
-
<section class="group-panel" id="group-exchanges" aria-labelledby="label-exchanges-group" hidden>
|
|
214
|
-
<div id="review" class="review" hidden></div>
|
|
215
|
-
<div class="redact-row">
|
|
216
|
-
<button id="redact-selection" type="button" class="pill-btn"></button>
|
|
217
|
-
<span id="redact-note" class="redact-note" role="status"></span>
|
|
218
|
-
</div>
|
|
219
|
-
<rr0-interview id="exchanges"></rr0-interview>
|
|
220
|
-
</section>
|
|
221
|
-
<section class="group-panel" id="group-transcript" aria-labelledby="label-file-group" hidden>
|
|
222
|
-
<div class="row">
|
|
223
|
-
<label class="fill"><span id="label-url"></span> <input id="url" type="text" autocomplete="off" spellcheck="false" placeholder="interview-….json"/></label>
|
|
224
|
-
</div>
|
|
225
|
-
<div class="row toolbar">
|
|
226
|
-
<span class="input-file-row"><span id="label-import-file"></span> <rr0-input-file id="import" name="import" accept="application/json,.json,.txt,.md,.vtt,.srt,text/*" placeholder="https://…/interview.json"></rr0-input-file></span>
|
|
227
|
-
<button id="save" type="button"></button>
|
|
228
|
-
</div>
|
|
229
|
-
<p id="file-note" class="file-note" hidden role="status"></p>
|
|
230
|
-
<div id="file-editor" class="file-editor"></div>
|
|
231
|
-
</section>
|
|
232
|
-
</div>
|
|
233
|
-
`;class m extends HTMLElement{shadow=this.attachShadow({mode:"open"});get importInput(){return this.shadow.getElementById("import")}messages;said=new S(["en"]);language="en";localeToken=0;current;options=[];group="summary";base;text;fileEditor;fileEditorLoading;shownFor;ready=Promise.resolve();player;drawn;takenOut=new Map;constructor(){super(),this.shadow.innerHTML=K,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.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.ready=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=M.preferencesFor(this),s=j(t,I),r=await P.load(s);e===this.localeToken&&(this.language=s,this.said=new S(t),this.messages=r,this.player||(this.player=new U(this.shadow.getElementById("player"),{timeChanged:i=>this.markCurrentTurn(i),recordingsChanged:i=>void this.editTranscript(a=>{i.length===0?delete a.recordings:a.recordings=i})},r),this.render()),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;if(!e)return;const 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),H.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 s=this.current,r=this.shadow.activeElement,i=(o,d)=>{this.field(o)!==r&&(this.field(o).value=d)};i("title",this.said.read(s?.title)??""),i("time",s?.time??""),i("by",m.byText(s?.by)),i("url",s?.url??""),i("summary",this.said.read(s?.summary)??"");const a=[s?.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(...A.ALL.map(o=>new Option(A.label(o,this.language),o))),s?.medium!==void 0&&!A.ALL.includes(s.medium)&&c.append(new Option(String(s.medium),String(s.medium))),s?.medium===void 0){const o=new Option(e.witnessNone,"");o.disabled=!0,o.hidden=!0,c.prepend(o)}c.value=s?.medium??"",this.applyReadonly()}write(e){const t=this.current;if(!t)return;const s=e==="witness"?"":this.field(e).value;switch(e){case"title":{const r=this.said.write(t.title,s,this.language);r===void 0?delete t.title:t.title=r;break}case"summary":{const r=this.said.write(t.summary,s,this.language);r===void 0?delete t.summary:t.summary=r;break}case"time":s.trim()===""?delete t.time:t.time=s.trim();break;case"url":s.trim()===""?delete t.url:t.url=s.trim();break;case"by":{const r=s.split(",").map(i=>i.trim()).filter(i=>i!=="");r.length===0?delete t.by:t.by=r.map(i=>({people:i}));break}case"witness":{const r=[...this.shadow.querySelectorAll("#witness input:checked")].map(i=>i.value);if(r.length===0){this.render();return}t.interviewOf=r.length===1?r[0]:r;break}case"medium":s===""?delete t.medium:t.medium=s;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 s of this.shadow.querySelectorAll("#tabs .group-tab"))s.setAttribute("aria-expanded",String(s.getAttribute("aria-controls")===t[e]));for(const[s,r]of Object.entries(t))this.shadow.getElementById(r).hidden=s!==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 f.read(JSON.parse(t));const s=this.transcriptUrl(e);if(s!==void 0)return f.read(await T.json(s))}catch{}}async showExchanges(){const e=this.current;if(!e)return;const t=++this.exchangesToken,s=await this.transcriptJson(e);await this.ready,!(t!==this.exchangesToken||this.current!==e)&&this.drawExchanges(s)}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 s=await this.transcriptJson(t)??JSON.parse(this.template(t));Array.isArray(s.segments)||(s.segments=[]),e(s);const r=m.pretty(m.withEventFields(s,t));this.fileEditor?.replaceText(r,!1),this.onEdited(r)}get redactReason(){return this.said.write(void 0,this.messages.redactReason,this.language)??this.messages.redactReason}speakerLabel(e,t){const s=f.speakerName(e,t),r=e.speakers?.[t]?.role;return s===r&&r in this.messages.roles?this.messages.roles[r]:s}renderReview(e){const t=this.shadow.getElementById("review"),s=Object.keys(e?.speakers??{});if(t.hidden=!e||s.length===0,!e||s.length===0)return;const r=l=>["approved","covered"].includes(e.proofreading?.[l]?.status??""),i=s.filter(l=>!r(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 s){const c=document.createElement("label"),o=document.createElement("input");o.type="checkbox",o.checked=r(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 s=e.speakers?.[t]?.of??f.sightingsOf(e)[0];return this.options.find(r=>r.id===s)?.moments??this.options.flatMap(r=>r.moments??[])}decorateExchanges(e){if(!e)return;const t=this.messages,s=this.hasAttribute("readonly");for(const r of this.shadow.querySelectorAll("#exchanges .turn[data-segment]")){const i=Number(r.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=f.clock(a.start),c.addEventListener("click",()=>this.player?.seek(a.start)),r.prepend(c)}const n=a.redacted?[a.redacted]:g.partsOf(a).flatMap(c=>"redacted"in c?[c.redacted]:[]);r.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);r.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??f.clock(d.at)))}if(s)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)}),s||r.append(this.turnTools(e,i,a,l))}}turnTools(e,t,s,r){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?.[s.speaker]?.role==="witness"&&!s.redacted){const o=n(i.linkMoment,()=>{});a.append(o),new B(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(r.length>0?r.map(h=>({value:String(h.at),label:i.momentLabel.replace("{k}",h.label).replace("{text}",h.note??f.clock(h.at))})):[{value:"",label:i.noMoments,disabledReason:i.noMoments}])}s.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(s.redacted||s.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`,g.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"),s=(h,u=!1)=>{t.textContent=h,t.classList.toggle("error",u)},r=this.shadow.getSelection?.()??document.getSelection(),i=r&&r.rangeCount>0?r.getRangeAt(0):void 0;if(!i||i.collapsed){s(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")){s(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=g.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))}),r?.removeAllRanges(),s(d?"":e.selectionOnePassage,!d)}static offsetIn(e,t,s){let r=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 r+s;if(t.contains(a)&&t!==a){const l=[...t.childNodes].slice(0,s);return r+l.reduce((c,o)=>c+(o instanceof Element&&o.closest(".bar")?0:(o.textContent??"").length),0)}r+=(a.textContent??"").length}return r}async restore(e){const t=this.takenOut.get(e);if(t===void 0)return;const[s,r]=e.split(":"),i=Number(s);await this.editTranscript(a=>{r==="all"?g.restoreWhole(a.segments[i],t):(g.restorePart(a.segments[i],Number(r),t),this.shiftParts(i,Number(r),-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(s=>s.startsWith(`${e}:`)).map(s=>Number(s.split(":")[1])).sort((s,r)=>r-s);for(const s of t)await this.restore(`${e}:${s}`)}editTurn(e){const s=this.drawn?.segments[e],r=this.shadow.querySelector(`#exchanges .turn[data-segment="${e}"] .said`);if(!s||!r)return;const i=this.messages,a=document.createElement("div");a.className="turn-edit";const n=document.createElement("textarea");n.value=g.raw(s,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=g.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),r.replaceWith(a),n.focus()}forget(e){for(const t of[...this.takenOut.keys()])t.startsWith(`${e}:`)&&this.takenOut.delete(t)}shiftParts(e,t,s=1){const r=[...this.takenOut].filter(([i])=>i.startsWith(`${e}:`)&&i!==`${e}:all`&&Number(i.split(":")[1])>=t+(s<0?1:0));for(const[i]of r)this.takenOut.delete(i);for(const[i,a]of r)this.takenOut.set(`${e}:${Number(i.split(":")[1])+s}`,a)}shiftTakenOut(e){const t=[...this.takenOut];this.takenOut.clear();for(const[s,r]of t){const[i,a]=s.split(":"),n=Number(i);n<e?this.takenOut.set(s,r):n>e&&this.takenOut.set(`${n-1}:${a}`,r)}}markCurrentTurn(e){const t=this.drawn?.segments??[];let s=-1;t.forEach((a,n)=>{a.start!==void 0&&a.start<=e&&(s=n)});for(const a of this.shadow.querySelectorAll("#exchanges .turn.current"))a.classList.remove("current");const r=this.shadow.querySelector(`#exchanges .turn[data-segment="${s}"]`);if(!r)return;r.classList.add("current");const i=r.closest(".rr0-interview-turns");i&&(r.offsetTop<i.scrollTop||r.offsetTop>i.scrollTop+i.clientHeight-r.offsetHeight)&&i.scrollTo({top:r.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)+`
|
|
234
|
-
`}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 s of m.ORDER)s in e&&(t[s]=e[s]);for(const s of Object.keys(e))s in t||(t[s]=e[s]);return t}static witnessesOf(e){return[e].flat().filter(t=>typeof t=="string")}static withEventFields(e,t){const s={...e};for(const i of m.SHARED)t[i]===void 0?delete s[i]:s[i]=structuredClone(t[i]);const r=s.speakers;if(typeof r=="object"&&r!==null){const i={...r},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)),s.speakers=i}return m.ordered(s)}applyFileToEvent(e,t){const s=this.current;if(!s)return!1;const r=JSON.stringify(m.SHARED.map(n=>s[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)?s[n]=structuredClone(l):t&&delete s[n]}return JSON.stringify(m.SHARED.map(n=>s[n]))!==r}syncFileFromEvent(){const e=this.current,t=this.fileEditor?.text??this.text;if(!e||t===void 0)return;let s;try{s=JSON.parse(t)}catch{return}if(typeof s!="object"||s===null||Array.isArray(s))return;const r=m.pretty(m.withEventFields(s,e));r!==t&&(this.text=r,this.fileEditor?.replaceText(r,!1),this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:"transcript",event:e,text:r}})))}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:s},r]=await Promise.all([C(()=>import("./SightingFileEditor-BCjntT4l.js"),__vite__mapDeps([0,1,2]),import.meta.url),C(()=>import("./interviewSchema-Dk0AWHwc.js"),[],import.meta.url),V(this.language)]);return this.fileEditor=new t(this.shadow.getElementById("file-editor"),e,i=>this.onEdited(i),this.messages.editorLabel,{baseline:e,phrases:r.fileSearchPhrases,schema:s}),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 s=this.transcriptUrl(e);if(s!==void 0)try{const r=await T.json(s);this.current===e&&typeof r=="object"&&r!==null&&!Array.isArray(r)?(this.applyFileToEvent(r,!1)&&this.fileChangedEvent(),t=m.pretty(m.withEventFields(r,e))):t=m.pretty(r)}catch{this.note(this.messages.loadFailed,"error")}t??=this.template(e)}if(this.current===e)try{const s=await this.loadFileEditor(t);if(this.current!==e)return;s.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,s=!0;try{t=JSON.parse(e)}catch{s=!1}this.note(s?void 0:this.messages.invalid,"error");const r=this.current;if(s&&r&&typeof t=="object"&&t!==null&&!Array.isArray(t)&&this.applyFileToEvent(t,!0)&&this.fileChangedEvent(),r&&!r.url&&e.trim()!==""){const i=r.id??"1";r.url=`${i.startsWith("interview")?i:`interview-${i}`}.json`,this.field("url").value=r.url,this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:"url",event:r}}))}this.dispatchEvent(new CustomEvent(E,{bubbles:!0,composed:!0,detail:{field:"transcript",event:r,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 s=m.pretty(t?m.withEventFields(e,t):e);await this.loadFileEditor(s).then(r=>r.replaceText(s,!1),()=>{}),this.shownFor=this.current,this.note(void 0),this.onEdited(s)}async importFromFile(e){try{const t=await e.text();let s;try{s=JSON.parse(t)}catch{s=void 0}if(typeof s!="object"||s===null){const{InterviewImport:r}=await C(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=r.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))});s=n&&{...n,transcription:{note:`Imported from ${e.name}: who speaks and when are as the file gave them, to be checked.`}}}s===void 0?this.note(this.messages.notATranscript,"error"):await this.take(s)}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`,s=URL.createObjectURL(new Blob([e],{type:"application/json"})),r=document.createElement("a");r.href=s,r.download=t,r.click(),URL.revokeObjectURL(s)}}function ee(){Y(),D(),customElements.get(F)||customElements.define(F,m)}export{E as INTERVIEW_CHANGE_EVENT,F as INTERVIEW_EDITOR_ELEMENT_NAME,W as INTERVIEW_SEEK_EVENT,m as InterviewEditorElement,ee as register};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{k as d,_ as l,aw as o,ax as u,$ as m,a1 as g,a0 as f,Y as y,ay as T,a2 as b,a3 as A}from"./rr0-sighting-editor.mjs";import{S as E}from"./SkyEventEditorStyle-CvY_AhbI.js";const w=d.catalog({en:()=>l(()=>import("./LanternParameterTexts_en-CcnGd8UH.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_en),fr:()=>l(()=>import("./LanternParameterTexts_fr-P2JwYOUy.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_fr),es:()=>l(()=>import("./LanternParameterTexts_es-CUTgNutZ.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_es),it:()=>l(()=>import("./LanternParameterTexts_it-CzNnIUrX.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_it)});class i{static RELEASE="letGo";static LANTERNS="lanterns";static AIR="air";static LANTERN="eachLantern";static instant(e,t,n){return{type:"number",key:e,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,required:!0,label:t,hint:n,group:i.LANTERNS}}static wind(e,t,n,s){return[{type:"number",key:`${e}.towardDeg`,min:0,max:360,step:1,unit:"°",group:i.AIR,hint:s,label:t},{type:"number",key:`${e}.speedMS`,min:0,max:60,step:.1,unit:"m/s",group:i.AIR,label:n}]}static SET={kind:"lantern",title:"skyLanterns",parameters:[{type:"said",key:"title",label:"name",group:i.RELEASE},{type:"position",key:"site.eastM",secondKey:"site.northM",saidKey:"site.saidPosition",native:"local",step:1,rangeM:1e5,group:i.RELEASE,label:"whereTheyAreLetGo",hint:"whereTheyAreLetGoFrom"},{type:"number",key:"site.altitudeM",min:-1e3,max:5e3,step:.1,unit:"m",group:i.RELEASE,effective:()=>0,label:"heightAboveThePlaceSGround",hint:"aGardenOnAHillAbove"},{type:"number",key:"site.originElevationM",min:-500,max:6e3,step:1,unit:"m",group:i.RELEASE,effective:()=>0,label:"thePlaceSGroundAboveThe",hint:"whatSetsHowThinTheAir"},{type:"number",key:"group.count",min:1,max:200,step:1,required:!0,group:i.LANTERNS,label:"howMany"},i.instant("group.fromT","firstLetGoAt","secondsOfTheRecordingBeforeIts"),i.instant("group.untilT","lastLetGoAt","secondsOfTheRecordingTheOthers"),{type:"number",key:"group.radiusM",min:0,max:5e3,step:1,unit:"m",group:i.LANTERNS,effective:()=>20,label:"letGoWithin",hint:"aCrowdLetsThemGoA"},{type:"number",key:"group.burnS.min",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>480,label:"burnsAtLeast",hint:"howLongEachBurnsFromWhen"},{type:"number",key:"group.burnS.max",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>900,label:"burnsAtMost"},{type:"number",key:"group.insideExcessK.min",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>125,label:"hotterThanTheAirAtLeast",hint:"howMuchHotterThanTheAir"},{type:"number",key:"group.insideExcessK.max",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>175,label:"hotterThanTheAirAtMost"},{type:"number",key:"group.burnedS",min:0,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>0,label:"alreadyBurntWhenLetGo",hint:"forLanternsTheAccountOnlyHas"},{type:"number",key:"group.seed",min:0,max:4294967295,step:1,group:i.LANTERNS,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFromAnother"},{type:"set",key:"group.explains",group:i.LANTERNS,label:"standForTheShapes",options:(e,t)=>{const n=t?.shapes??[],s=(e.group?.explains??[]).filter(r=>!n.some(h=>h.value===r));return[...n,...s.map(r=>({value:r,label:r}))]},empty:"noShape"},...i.wind("wind","windAtTheGroundTowards","windAtTheGroundSpeed","whereItBlowsTowardsWhichIs"),...i.wind("windAloft","windAloftTowards","windAloftSpeed","theWindHigherUpBlendedWith"),{type:"number",key:"windAloft.atM",min:10,max:1e4,step:10,unit:"m",group:i.AIR,label:"windAloftAt",hint:"metresAboveWhereTheyAreLet"},{type:"number",key:"airTemperatureC",min:-60,max:50,step:.5,unit:"°C",group:i.AIR,effective:()=>10,label:"airTemperature",hint:"atTheGroundFallingBy6"},{type:"number",key:"turbulence.horizontalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.horizontalMS,label:"gustsAcross",hint:"howFarTheAirSSpeed"},{type:"number",key:"turbulence.verticalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.verticalMS,label:"gustsUpAndDown"},{type:"number",key:"turbulence.timescaleS",min:1,max:600,step:1,unit:"s",group:i.AIR,effective:()=>o.TURBULENCE.timescaleS,label:"aGustLasts"},{type:"number",key:"lantern.luminousIntensityCd",min:.1,max:1e3,step:.1,unit:"cd",group:i.LANTERN,effective:()=>o.COMMON.luminousIntensityCd,label:"light",hint:"itsFlameSLightThroughThe"},{type:"choice",key:"lantern.shape",group:i.LANTERN,effective:()=>o.COMMON.shape,label:"shape",choices:[{value:"classic",label:"roundAtTheMouthSquareAt"},{value:"balloon",label:"balloonLobedTop"}]},{type:"colour",key:"lantern.paperColor",group:i.LANTERN,fallback:o.COMMON.paperColor,label:"paperColour",hint:"whatItLooksLikeByDay"},{type:"colour",key:"lantern.color",group:i.LANTERN,fallback:o.COMMON.color,label:"flameLight",hint:"itsFlameSLightThroughWhite"},{type:"number",key:"lantern.envelopeVolumeM3",min:.01,max:10,step:.01,unit:"m³",group:i.LANTERN,effective:()=>o.COMMON.envelopeVolumeM3,label:"airItHolds"},{type:"number",key:"lantern.massKg",min:.005,max:5,step:.001,unit:"kg",group:i.LANTERN,effective:()=>o.COMMON.massKg,label:"weightWhenLetGo"}]};static publish(){u.publish(i.SET)}}const v=d.catalog({en:()=>l(()=>import("./LanternEditorMessages_en-DaT3UNfD.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_en),fr:()=>l(()=>import("./LanternEditorMessages_fr-9mByTFMG.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_fr),es:()=>l(()=>import("./LanternEditorMessages_es-TDV5lKeJ.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_es),it:()=>l(()=>import("./LanternEditorMessages_it-MRkJnDQp.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_it)});class p{constructor(e,t,n){this.container=e,this.host=t,E.attach(e,"lantern-editor-part",p.STYLE),this.language=n,u.of("lantern")||i.publish(),this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;language;shown=[];static STYLE='.lantern-editor-part { flex-basis: 100%; min-width: 0; } .lantern-editor-part #lantern-list { flex-basis: 100%; min-width: 0; } .lantern-editor-part .launch-editor, .lantern-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .lantern-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .lantern-editor-part [hidden] { display: none !important; } .lantern-editor-part select { min-width: 0; width: 100%; } .lantern-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .lantern-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .lantern-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .lantern-editor-part input, .lantern-editor-part select { max-width: 100%; box-sizing: border-box; } .lantern-editor-part input[type="text"] { width: 12em; } .lantern-editor-part label { min-width: 0; max-width: 100%; } .lantern-editor-part input.parameter-derived::placeholder { opacity: .65; }';async setLanguage(e){const t=++this.languageToken;this.language=e;const[n,s]=await Promise.all([v.load(e),w.load(e)]);t===this.languageToken&&(this.messages=n,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.launches;this.shown=[...e],e.some(r=>r.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(r=>({id:r.id,label:this.labelOf(r)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("lantern-fields").hidden=t===void 0,!t)return;const n=t.releases?.length??0,s=this.element("lantern-releases");s.hidden=n===0,s.textContent=this.messages.releasesNote.replace("{n}",String(n)),this.form??=new m(this.element("lantern-parameters"),this.language,"lantern.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(i.SET),new g(()=>this.current,r=>this.editLaunch(h=>r(h)),()=>({shapes:this.host.shapes().map(r=>({value:r.id,label:r.label}))}),this.host.positionPlace?.()),()=>this.written())}refresh(){if(!this.messages)return;this.syncAddState();const e=this.launches;e.length===this.shown.length&&e.every((t,n)=>t.id===this.shown[n].id)||this.sync()}syncAddState(){const e=this.siteOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addLaunchNowhere)}get current(){return this.launches.find(e=>e.id===this.currentId)}resolved(e){return f.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
|
|
2
|
-
<p class="launch-intro">${e.intro}</p>
|
|
3
|
-
<div id="lantern-list"></div>
|
|
4
|
-
<div id="lantern-fields" class="launch-fields">
|
|
5
|
-
<div id="lantern-parameters" class="launch-parameters"></div>
|
|
6
|
-
<p id="lantern-releases" class="launch-intro" hidden></p>
|
|
7
|
-
<p class="launch-intro">${e.derivedNote}</p>
|
|
8
|
-
</div>
|
|
9
|
-
</div>`,this.list=new y({header:this.element("lantern-list"),body:this.element("lantern-fields"),ids:{list:"lantern-select",remove:"lantern-delete",add:"lantern-add"},onSelect:t=>{this.currentId=t,this.sync()},onAdd:()=>this.addLaunch(),onRemove:()=>this.deleteCurrent()}),this.list.setLabels({list:e.launch,remove:e.deleteLaunch,add:e.addLaunch,empty:e.none})}written(){const e=this.current;e&&this.list?.rename(e.id,this.labelOf(e))}editLaunch(e){const t=this.current;if(!t)return;const n=structuredClone(t);e(n),this.writeLaunches(this.launches.map(s=>s===t?n:s)),this.host.changed()}siteOfNew(){const e=this.host.sighting(),t=e.event?.place?.[0];if(t?.lat===void 0||t.lng===void 0)return;const n=e.observerTrack?.getInterpolatedPoseAt(0),s=(n?.headingDeg??0)*Math.PI/180,r=111320,h=n?.lng!==void 0?(n.lng-t.lng)*r*Math.cos(t.lat*Math.PI/180):0,c=n?.lat!==void 0?(n.lat-t.lat)*r:0;return{eastM:Math.round(h+1500*Math.sin(s)),northM:Math.round(c+1500*Math.cos(s))}}addLaunch(){const e=this.siteOfNew();if(!e)return;let t=this.launches.length+1;for(;this.launches.some(r=>r.id===`lanterns-${t}`);)t++;const n=T(this.host.sighting(),0),s={id:`lanterns-${t}`,site:e,group:{count:12,fromT:0,untilT:12e4,seed:t},wind:{towardDeg:Math.round((n.windDirectionDeg+180)%360),speedMS:Math.round(n.windSpeed*10)/10}};this.writeLaunches([...this.launches,s]),this.currentId=s.id,this.host.changed(),this.sync()}deleteCurrent(){const e=this.current;e&&(this.currentId=void 0,this.writeLaunches(this.launches.filter(t=>t!==e)),this.host.changed(),this.sync())}writeLaunches(e){const t=this.host.sighting(),n={...t.interpretation??{bodies:[]},lanterns:e.length>0?e:void 0};n.lanterns===void 0&&delete n.lanterns;const s=b.saysNothing(n,A.kinds());t.interpretation=s?void 0:n}labelOf(e){const t=this.host.said().read(e.title);return t?`${t} (${e.id})`:e.id}get launches(){return this.host.sighting().interpretation?.lanterns??[]}element(e){return this.container.querySelector(`#${e}`)}}export{p as LanternEditor};
|