@rr0/ufoathome 0.197.0 → 0.198.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist-embed-scene/rr0-scene.mjs +122 -122
  2. package/dist-embed-sighting/{CaseReportExport-CCjvTS2q.js → CaseReportExport-BetcYOov.js} +1 -1
  3. package/dist-embed-sighting/rr0-sighting.mjs +300 -286
  4. package/dist-embed-sighting-editor/{CaseEditorMessages_en-u4MyW2Ah.js → CaseEditorMessages_en-CpJLWbJD.js} +1 -1
  5. package/{dist-embed-ufoathome/CaseEditorMessages_es-BuLTG_5Q.js → dist-embed-sighting-editor/CaseEditorMessages_es-C5YOqVpF.js} +1 -1
  6. package/{dist-embed-ufoathome/CaseEditorMessages_fr-Car1_lOm.js → dist-embed-sighting-editor/CaseEditorMessages_fr-rMlMgrqV.js} +1 -1
  7. package/{dist-embed-ufoathome/CaseEditorMessages_it-DAHTKU_c.js → dist-embed-sighting-editor/CaseEditorMessages_it-Bkiv2Hun.js} +1 -1
  8. package/dist-embed-sighting-editor/CaseElement-IzaexO7n.js +121 -0
  9. package/dist-embed-sighting-editor/{CaseReportExport-CAEcShgX.js → CaseReportExport-U-dk4A7z.js} +1 -1
  10. package/dist-embed-sighting-editor/{SightingElement-Ddf6hzfp.js → SightingElement-BhyoU_gg.js} +3 -3
  11. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +214 -192
  12. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-B-IiOm3p.js → AdsbLolArchiveProvider-CUkfGJbL.js} +1 -1
  13. package/dist-embed-ufoathome/{BallesterGuaspAssessor-CKFQRcfa.js → BallesterGuaspAssessor-CB2F8A6P.js} +1 -1
  14. package/dist-embed-ufoathome/{BeamEditor-BWkQrCPy.js → BeamEditor-Q_m3KK0S.js} +1 -1
  15. package/dist-embed-ufoathome/{BeamSystem-D6XsTULo.js → BeamSystem-CVMU5DeE.js} +1 -1
  16. package/dist-embed-ufoathome/{BirdEditor-6vr7bLHy.js → BirdEditor-07sg3Pt0.js} +1 -1
  17. package/dist-embed-ufoathome/{BodyEditor-D1odTty_.js → BodyEditor-BwsMj37A.js} +1 -1
  18. package/dist-embed-ufoathome/{CaseEditorElement-3g_c6R7G.js → CaseEditorElement-BrcX9sp0.js} +130 -113
  19. package/dist-embed-ufoathome/{CaseEditorMessages_en-u4MyW2Ah.js → CaseEditorMessages_en-CpJLWbJD.js} +1 -1
  20. package/{dist-embed-sighting-editor/CaseEditorMessages_es-BuLTG_5Q.js → dist-embed-ufoathome/CaseEditorMessages_es-C5YOqVpF.js} +1 -1
  21. package/{dist-embed-sighting-editor/CaseEditorMessages_fr-Car1_lOm.js → dist-embed-ufoathome/CaseEditorMessages_fr-rMlMgrqV.js} +1 -1
  22. package/{dist-embed-sighting-editor/CaseEditorMessages_it-DAHTKU_c.js → dist-embed-ufoathome/CaseEditorMessages_it-Bkiv2Hun.js} +1 -1
  23. package/dist-embed-ufoathome/CaseElement-Ca8ctACA.js +121 -0
  24. package/dist-embed-ufoathome/{CaseReportExport-ZNhCiJjJ.js → CaseReportExport--IhmS67e.js} +3 -3
  25. package/dist-embed-ufoathome/{ColumnResize-UnDz8hFM.js → ColumnResize-CMfGWQHi.js} +20 -15
  26. package/dist-embed-ufoathome/{ContrailSystem-1Y9tarlk.js → ContrailSystem-CuFduINP.js} +1 -1
  27. package/dist-embed-ufoathome/{ControlPasses-CNOyd9SV.js → ControlPasses-BS7yyZOR.js} +1 -1
  28. package/dist-embed-ufoathome/{CoverageAssessor-BDtOq9aQ.js → CoverageAssessor-BwXJv4OD.js} +1 -1
  29. package/dist-embed-ufoathome/{DroneEditor-C3SH8yYq.js → DroneEditor-ByVlCauS.js} +1 -1
  30. package/dist-embed-ufoathome/{Flightradar24Provider-2yiCbULq.js → Flightradar24Provider-Cd4o260r.js} +1 -1
  31. package/dist-embed-ufoathome/{GLTFLoader-BTxAZ2H9.js → GLTFLoader-BegH9SUA.js} +1 -1
  32. package/dist-embed-ufoathome/{GeoJsonExport-taSDSkPz.js → GeoJsonExport-Czm1iAIW.js} +1 -1
  33. package/dist-embed-ufoathome/{GeographicFigures-BTNgtesN.js → GeographicFigures-CKg7JYgf.js} +1 -1
  34. package/dist-embed-ufoathome/{HeadlightSystem-DrcLjLtQ.js → HeadlightSystem-DIk-C7_5.js} +1 -1
  35. package/dist-embed-ufoathome/{HynekAssessor-B29m-sN8.js → HynekAssessor-BybLMdda.js} +1 -1
  36. package/dist-embed-ufoathome/{InterviewEditorElement-2QYSmoHm.js → InterviewEditorElement-CbTakhyi.js} +1 -1
  37. package/dist-embed-ufoathome/{InterviewElement-dtYF5S-4.js → InterviewElement-fI19BieO.js} +1 -1
  38. package/dist-embed-ufoathome/{KmlExport-BmpKnlBj.js → KmlExport-De-2dnYz.js} +1 -1
  39. package/dist-embed-ufoathome/{LanternEditor-BaRDgTw-.js → LanternEditor-BRqgj1S6.js} +1 -1
  40. package/dist-embed-ufoathome/{LaserBeam-ejbRCvnX.js → LaserBeam-CouNB7Pe.js} +1 -1
  41. package/dist-embed-ufoathome/{LaunchEditor-DlL4ZqRi.js → LaunchEditor-BNInX90c.js} +1 -1
  42. package/dist-embed-ufoathome/{LaunchPlume-oAya2eEa.js → LaunchPlume-DVxzb0wy.js} +1 -1
  43. package/dist-embed-ufoathome/{LaunchSimulation-DkwJLwOo.js → LaunchSimulation-CCvSd6qD.js} +1 -1
  44. package/dist-embed-ufoathome/{ModelSource-B_nU_FPQ.js → ModelSource-BZ1U1VU1.js} +1 -1
  45. package/dist-embed-ufoathome/{ModelThumbnails-DaDiyuM2.js → ModelThumbnails-Ckdb3qoW.js} +1 -1
  46. package/dist-embed-ufoathome/{ModelViewer-iv0GdyTZ.js → ModelViewer-B9PZN5c7.js} +1 -1
  47. package/dist-embed-ufoathome/{ModuleConformance-BDZbbpPz.js → ModuleConformance-8JN5JVgE.js} +2 -2
  48. package/dist-embed-ufoathome/{ModuleSession-DbiU7Mg7.js → ModuleSession-ClSpEZMn.js} +3 -3
  49. package/dist-embed-ufoathome/{ModuleThree-CLOnw_DZ.js → ModuleThree-CRG8PTLA.js} +1 -1
  50. package/dist-embed-ufoathome/{ModulesPanelElement-CMyuCril.js → ModulesPanelElement-D4Hos-mF.js} +3 -3
  51. package/dist-embed-ufoathome/{NearestApproach-DM8py_qI.js → NearestApproach-DrJN7h_1.js} +1 -1
  52. package/dist-embed-ufoathome/{ParameterForm-DfpJQGku.js → ParameterForm-DcVFxrcO.js} +1 -1
  53. package/dist-embed-ufoathome/{PictureRegistration-rU4sVWnY.js → PictureRegistration-LxhNTA4v.js} +1 -1
  54. package/dist-embed-ufoathome/{PoherAssessor-DXsufNSL.js → PoherAssessor-RyKMyps7.js} +1 -1
  55. package/dist-embed-ufoathome/{RailwaySystem-DZ1rEPSL.js → RailwaySystem-BOQvJ2r4.js} +1 -1
  56. package/dist-embed-ufoathome/{ReentryEditor-BVDyVhGo.js → ReentryEditor-B1H_TUMf.js} +1 -1
  57. package/dist-embed-ufoathome/{ReentrySimulation-DFisNsmn.js → ReentrySimulation-C7XZlAED.js} +1 -1
  58. package/dist-embed-ufoathome/{ReferenceSystem-DnHhAxWO.js → ReferenceSystem-BcsjHgaw.js} +1 -1
  59. package/dist-embed-ufoathome/{RoadMarkings-BsN3rh0W.js → RoadMarkings-DDRxawvf.js} +1 -1
  60. package/dist-embed-ufoathome/SaidPosition-CXZLm-ck.js +4 -0
  61. package/dist-embed-ufoathome/{ShareDialogElement-C5QkyK7i.js → ShareDialogElement-DHlxoHWP.js} +13 -13
  62. package/dist-embed-ufoathome/{Sighting-CBpJpdm9.js → Sighting-Ch4eiBNK.js} +1 -1
  63. package/dist-embed-ufoathome/{SightingElement-cd7C-Ge-.js → SightingElement-COJwKNNg.js} +3 -3
  64. package/dist-embed-ufoathome/{TimelineTracks-X_GEZi12.js → TimelineTracks-BgZmkKhn.js} +1 -1
  65. package/dist-embed-ufoathome/{TraceSystem-CM4QYSkU.js → TraceSystem-BBCpq8-v.js} +1 -1
  66. package/dist-embed-ufoathome/{VideoButton-CZlR9Bk0.js → VideoButton-CGQI7iUA.js} +1 -1
  67. package/dist-embed-ufoathome/{WaterSystem-C8MrXEEk.js → WaterSystem-BrIS0Wzy.js} +1 -1
  68. package/dist-embed-ufoathome/rr0-ufoathome.mjs +3 -3
  69. package/dist-embed-ufoathome/{surroundingsSources-CKDz9k9A.js → surroundingsSources-Dg6vMWL7.js} +1 -1
  70. package/dist-embed-ufoathome/{trafficRuntime-AtbE4bAN.js → trafficRuntime-BT5Ol_v5.js} +1 -1
  71. package/package.json +1 -1
  72. package/dist-embed-sighting-editor/CaseElement-DYeBpKhp.js +0 -112
  73. package/dist-embed-ufoathome/CaseElement-CZzC4Bj8.js +0 -112
  74. package/dist-embed-ufoathome/SaidPosition-CWiVNaNW.js +0 -4
@@ -1 +1 @@
1
- import{b2 as S,cJ as G,bz as _,bg as M,cK as f,bj as b,bb as F,cD as R,cE as w,b7 as N,b4 as y,cL as H,cM as C,cN as L,p as j}from"./ShareDialogElement-C5QkyK7i.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CWiVNaNW.js";import"./Sighting-CBpJpdm9.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class h{static RADIUS=840;static MAX_SEGMENTS=1024;static VERTICES_PER_SEGMENT=12;static MIN_HALF_WIDTH_DEG=.1;static BRIGHT_HALF_WIDTH_DEG=.22;static TRAIN_SHARE=.9;static TRAIN_FALLOFF=1.2;object=new S;tiers;trains;positions;colors;shown=0;drawn=[];constructor(){this.object.name="reentries",this.tiers=G.map(i=>{const o=new _(new M,f.material(i.size,!1));return f.track(o),o.frustumCulled=!1,this.object.add(o),o});const s=h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT;this.positions=new Float32Array(s*3),this.colors=new Float32Array(s*3);const t=new M;t.setAttribute("position",new b(this.positions,3)),t.setAttribute("color",new b(this.colors,3)),t.setDrawRange(0,0),this.trains=new F(t,R.material()),this.trains.frustumCulled=!1,R.track(this.trains),this.object.add(this.trains)}nearest(s,t){let i,o=t;for(const e of this.drawn){const n=e.direction.dot(s);(n>o||i&&n===o&&e.magnitude<i.magnitude)&&(o=n,i=e)}return i}static directionOf(s){const{x:t,y:i,z:o}=w(s.altitudeDeg,s.azimuthDeg,1);return new N(t,i,o)}get count(){return this.shown}set(s,t,i,o){const e=this.tiers.map(()=>[]);let n=0,E=0;const r=new y;this.drawn=[];for(const a of s){const u=i(a.head);if(u<=0)continue;const c=a.magnitude-2.5*Math.log10(u);if(c>t)continue;E++,this.drawn.push({direction:h.directionOf(a.head),view:a,magnitude:c}),r.set(a.color);const d=H(c,t)*a.fade,{x:A,y:m,z:g}=w(a.head.altitudeDeg,a.head.azimuthDeg,h.RADIUS),[p,I,T]=o(a.head,c),z=a.fade,D=Math.max(r.r,r.g,r.b)||1;e[C(d)].push({x:A,y:m,z:g,r:p*r.r*z/D,g:I*r.g*z/D,b:T*r.b*z/D}),n=this.pushTrain(n,a.train,d,r)}this.shown=E,this.tiers.forEach((a,u)=>{const c=e[u],d=new Float32Array(c.length*3),A=new Float32Array(c.length*3);c.forEach((g,p)=>{d.set([g.x,g.y,g.z],p*3),A.set([g.r,g.g,g.b],p*3)}),a.geometry.dispose();const m=new M;m.setAttribute("position",new b(d,3)),m.setAttribute("color",new b(A,3)),a.geometry=m});const l=this.trains.geometry;l.setDrawRange(0,n),l.getAttribute("position").needsUpdate=!0,l.getAttribute("color").needsUpdate=!0}pushTrain(s,t,i,o){const e=t.length-1;for(let n=0;n<e;n++){if(s+h.VERTICES_PER_SEGMENT>h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT)return s;const E=1-n/e,r=1-(n+1)/e,l=w(t[n].altitudeDeg,t[n].azimuthDeg,h.RADIUS),a=w(t[n+1].altitudeDeg,t[n+1].azimuthDeg,h.RADIUS),u=d=>h.RADIUS*((h.MIN_HALF_WIDTH_DEG+h.BRIGHT_HALF_WIDTH_DEG*i*d)*Math.PI/180),c=d=>h.TRAIN_SHARE*i*d**h.TRAIN_FALLOFF;s=this.pushRibbon(s,l,a,u(E),u(r),c(E),c(r),o)}return s}pushRibbon(s,t,i,o,e,n,E,r){const l={x:i.x-t.x,y:i.y-t.y,z:i.z-t.z};if(Math.hypot(l.x,l.y,l.z)<1e-9)return s;const a=this.normalise(this.cross(this.normalise(t),this.normalise(l)));for(const[u,c]of[[-1,0],[0,1]]){const d=this.across(t,a,o,u),A=this.across(i,a,e,u),m=this.across(t,a,o,c),g=this.across(i,a,e,c),p=(I,T)=>I===0?T:0;s=this.push(s,d,p(u,n),r),s=this.push(s,A,p(u,E),r),s=this.push(s,m,p(c,n),r),s=this.push(s,A,p(u,E),r),s=this.push(s,g,p(c,E),r),s=this.push(s,m,p(c,n),r)}return s}across(s,t,i,o){return{x:s.x+t.x*i*o,y:s.y+t.y*i*o,z:s.z+t.z*i*o}}push(s,t,i,o){const e=s*3;this.positions[e]=t.x,this.positions[e+1]=t.y,this.positions[e+2]=t.z;const n=L.relativeOfResponse(Math.max(0,Math.min(1,i)));return this.colors[e]=n*o.r,this.colors[e+1]=n*o.g,this.colors[e+2]=n*o.b,s+1}cross(s,t){return{x:s.y*t.z-s.z*t.y,y:s.z*t.x-s.x*t.z,z:s.x*t.y-s.y*t.x}}normalise(s){const t=Math.hypot(s.x,s.y,s.z)||1;return{x:s.x/t,y:s.y/t,z:s.z/t}}dispose(){for(const s of this.tiers)s.geometry.dispose(),s.material.dispose();this.trains.geometry.dispose(),this.trains.material.dispose(),this.object.removeFromParent()}}class ${inSky=!0;hiddenFromEye=!0;pieces=new h;get object(){return this.pieces.object}get drawnCount(){return this.pieces.count}update(s,t,i){const o=s.length===0?[]:j.viewsAt(s,t,i.observer);o.length===0&&this.pieces.count===0||(this.pieces.set(o,i.magnitudeLimit,e=>i.cloudTransmission(e),(e,n)=>i.arrivingIlluminance(e,n,1)),i.lightFrom(o.map(e=>({position:e.head,magnitude:e.magnitude}))),i.glareFrom(o.map(e=>({key:`${e.reentryId}:${e.fragmentId}`,position:e.head,magnitude:e.magnitude,fade:e.fade}))))}pick(s,t,i){const o=this.pieces.nearest(t,i.nearestCos);return o&&{id:o.view.reentryId,detail:o}}dispose(){this.pieces.dispose()}}export{$ as ReentrySimulation};
1
+ import{b2 as S,cJ as G,bz as _,bg as M,cK as f,bj as b,bb as F,cD as R,cE as w,b7 as N,b4 as y,cL as H,cM as C,cN as L,p as j}from"./ShareDialogElement-DHlxoHWP.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class h{static RADIUS=840;static MAX_SEGMENTS=1024;static VERTICES_PER_SEGMENT=12;static MIN_HALF_WIDTH_DEG=.1;static BRIGHT_HALF_WIDTH_DEG=.22;static TRAIN_SHARE=.9;static TRAIN_FALLOFF=1.2;object=new S;tiers;trains;positions;colors;shown=0;drawn=[];constructor(){this.object.name="reentries",this.tiers=G.map(i=>{const o=new _(new M,f.material(i.size,!1));return f.track(o),o.frustumCulled=!1,this.object.add(o),o});const s=h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT;this.positions=new Float32Array(s*3),this.colors=new Float32Array(s*3);const t=new M;t.setAttribute("position",new b(this.positions,3)),t.setAttribute("color",new b(this.colors,3)),t.setDrawRange(0,0),this.trains=new F(t,R.material()),this.trains.frustumCulled=!1,R.track(this.trains),this.object.add(this.trains)}nearest(s,t){let i,o=t;for(const e of this.drawn){const n=e.direction.dot(s);(n>o||i&&n===o&&e.magnitude<i.magnitude)&&(o=n,i=e)}return i}static directionOf(s){const{x:t,y:i,z:o}=w(s.altitudeDeg,s.azimuthDeg,1);return new N(t,i,o)}get count(){return this.shown}set(s,t,i,o){const e=this.tiers.map(()=>[]);let n=0,E=0;const r=new y;this.drawn=[];for(const a of s){const u=i(a.head);if(u<=0)continue;const c=a.magnitude-2.5*Math.log10(u);if(c>t)continue;E++,this.drawn.push({direction:h.directionOf(a.head),view:a,magnitude:c}),r.set(a.color);const d=H(c,t)*a.fade,{x:A,y:m,z:g}=w(a.head.altitudeDeg,a.head.azimuthDeg,h.RADIUS),[p,I,T]=o(a.head,c),z=a.fade,D=Math.max(r.r,r.g,r.b)||1;e[C(d)].push({x:A,y:m,z:g,r:p*r.r*z/D,g:I*r.g*z/D,b:T*r.b*z/D}),n=this.pushTrain(n,a.train,d,r)}this.shown=E,this.tiers.forEach((a,u)=>{const c=e[u],d=new Float32Array(c.length*3),A=new Float32Array(c.length*3);c.forEach((g,p)=>{d.set([g.x,g.y,g.z],p*3),A.set([g.r,g.g,g.b],p*3)}),a.geometry.dispose();const m=new M;m.setAttribute("position",new b(d,3)),m.setAttribute("color",new b(A,3)),a.geometry=m});const l=this.trains.geometry;l.setDrawRange(0,n),l.getAttribute("position").needsUpdate=!0,l.getAttribute("color").needsUpdate=!0}pushTrain(s,t,i,o){const e=t.length-1;for(let n=0;n<e;n++){if(s+h.VERTICES_PER_SEGMENT>h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT)return s;const E=1-n/e,r=1-(n+1)/e,l=w(t[n].altitudeDeg,t[n].azimuthDeg,h.RADIUS),a=w(t[n+1].altitudeDeg,t[n+1].azimuthDeg,h.RADIUS),u=d=>h.RADIUS*((h.MIN_HALF_WIDTH_DEG+h.BRIGHT_HALF_WIDTH_DEG*i*d)*Math.PI/180),c=d=>h.TRAIN_SHARE*i*d**h.TRAIN_FALLOFF;s=this.pushRibbon(s,l,a,u(E),u(r),c(E),c(r),o)}return s}pushRibbon(s,t,i,o,e,n,E,r){const l={x:i.x-t.x,y:i.y-t.y,z:i.z-t.z};if(Math.hypot(l.x,l.y,l.z)<1e-9)return s;const a=this.normalise(this.cross(this.normalise(t),this.normalise(l)));for(const[u,c]of[[-1,0],[0,1]]){const d=this.across(t,a,o,u),A=this.across(i,a,e,u),m=this.across(t,a,o,c),g=this.across(i,a,e,c),p=(I,T)=>I===0?T:0;s=this.push(s,d,p(u,n),r),s=this.push(s,A,p(u,E),r),s=this.push(s,m,p(c,n),r),s=this.push(s,A,p(u,E),r),s=this.push(s,g,p(c,E),r),s=this.push(s,m,p(c,n),r)}return s}across(s,t,i,o){return{x:s.x+t.x*i*o,y:s.y+t.y*i*o,z:s.z+t.z*i*o}}push(s,t,i,o){const e=s*3;this.positions[e]=t.x,this.positions[e+1]=t.y,this.positions[e+2]=t.z;const n=L.relativeOfResponse(Math.max(0,Math.min(1,i)));return this.colors[e]=n*o.r,this.colors[e+1]=n*o.g,this.colors[e+2]=n*o.b,s+1}cross(s,t){return{x:s.y*t.z-s.z*t.y,y:s.z*t.x-s.x*t.z,z:s.x*t.y-s.y*t.x}}normalise(s){const t=Math.hypot(s.x,s.y,s.z)||1;return{x:s.x/t,y:s.y/t,z:s.z/t}}dispose(){for(const s of this.tiers)s.geometry.dispose(),s.material.dispose();this.trains.geometry.dispose(),this.trains.material.dispose(),this.object.removeFromParent()}}class ${inSky=!0;hiddenFromEye=!0;pieces=new h;get object(){return this.pieces.object}get drawnCount(){return this.pieces.count}update(s,t,i){const o=s.length===0?[]:j.viewsAt(s,t,i.observer);o.length===0&&this.pieces.count===0||(this.pieces.set(o,i.magnitudeLimit,e=>i.cloudTransmission(e),(e,n)=>i.arrivingIlluminance(e,n,1)),i.lightFrom(o.map(e=>({position:e.head,magnitude:e.magnitude}))),i.glareFrom(o.map(e=>({key:`${e.reentryId}:${e.fragmentId}`,position:e.head,magnitude:e.magnitude,fade:e.fade}))))}pick(s,t,i){const o=this.pieces.nearest(t,i.nearestCos);return o&&{id:o.view.reentryId,detail:o}}dispose(){this.pieces.dispose()}}export{$ as ReentrySimulation};
@@ -1 +1 @@
1
- import{bM as w,bN as M,bO as g,be as c,bP as b,bb as y,bD as k,bQ as O,bR as T,bS as E,bT as D}from"./ShareDialogElement-C5QkyK7i.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as I}from"./SaidPosition-CWiVNaNW.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import"./rr0-ufoathome.mjs";import"./Sighting-CBpJpdm9.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";const v=3,u=800,l=Math.PI/180;class r{constructor(t,i,s=r.fetchImage,e=r.openVideo){this.scene=t,this.onImageLoaded=i,this.loadImage=s,this.loadVideo=e}meshes=new Map;signatures=new Map;images=new Map;loading=new Map;failed=new Map;references=[];views=new Map;shown=!0;observerAt;clock={t:0,playing:!1,timeScale:1};static PRESENT_WITHIN_M=2;static GONE_BEYOND_M=20;static presenceAt(t,i){if(!t.from||!i)return 1;const s=I(i.lat,i.lng,t.from.lat,t.from.lng),a=(Math.hypot(s.x,s.z)-r.PRESENT_WITHIN_M)/(r.GONE_BEYOND_M-r.PRESENT_WITHIN_M),o=Math.min(Math.max(a,0),1);return 1-o*o*(3-2*o)}set(t,i=this.views,s){this.references=t,this.observerAt=s,this.views=i;const e=new Set(t.map(a=>a.id));for(const[a,o]of this.meshes)e.has(a)||(this.dispose(o),this.meshes.delete(a),this.signatures.delete(a));for(const[a,o]of this.images){const n=t.find(p=>p.id===a);if(n&&n.src===o.texture.userData.src&&n.kind==="video"==(o.video!==void 0))continue;r.release(o),this.images.delete(a);const h=this.meshes.get(a);h&&(this.dispose(h),this.meshes.delete(a),this.signatures.delete(a))}for(const a of t){const o=this.images.get(a.id);if(!o){this.load(a);continue}this.build(a,o)}this.follow()}setTime(t){this.clock=t,this.follow()}setShown(t){this.shown=t;for(const i of this.meshes.values())i.visible=t&&this.opacityOf(i.userData.id)>0}setView(t,i){this.views.set(t,i);const s=this.meshes.get(t);s&&this.applyOpacity(s,t)}layer=v;get any(){for(const t of this.meshes.values())if(t.visible)return!0;return!1}place(t){const i=this.held;i&&t.getWorldQuaternion(this.cameraTurn);for(const s of this.meshes.values()){if(!s.visible)continue;s.position.copy(t.position);const e=i?.get(s);e&&s.quaternion.copy(this.cameraTurn).multiply(e),s.updateMatrixWorld()}}hold(t){t.getWorldQuaternion(this.cameraTurn);const i=this.cameraTurn.clone().invert();this.held=new Map([...this.meshes.values()].map(s=>[s,i.clone().multiply(s.quaternion)])),this.registered=new Map([...this.meshes.values()].map(s=>[s,s.quaternion.clone()]))}release(){if(this.held){for(const[t,i]of this.registered??[])t.quaternion.copy(i);this.held=void 0,this.registered=void 0}}registered;held;cameraTurn=new w;get furthestM(){return this.meshes.size>0?u:0}directionOfPixel(t,i,s,e){const a=this.images.get(t.id),o=a?a.width/a.height:1,n=d.registrationAt(t,this.clock.t),h=Math.tan(n.fovDeg/2*l),p=h*o;return e.set((i*2-1)*p,(1-s*2)*h,-1).normalize(),e.applyQuaternion(r.orientation(n))}aspectOf(t){const i=this.images.get(t);return i?i.width/i.height:void 0}failureOf(t){return this.failed.get(t)}follow(){for(const t of this.references){const i=this.meshes.get(t.id),s=this.images.get(t.id)?.video;s&&this.sync(t,s),i&&(t.registrationTrack?.length&&r.point(i,t,d.registrationAt(t,this.clock.t)),t.kind==="video"&&this.applyOpacity(i,t.id))}}sync(t,i){const s=d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,Number.isFinite(i.duration)?i.duration:void 0);if(s===void 0){i.paused||i.pause();return}const e=d.command(i.currentTime,s,this.clock.playing,d.rateOf(t));i.playbackRate=e.rate,e.seekS!==void 0&&!i.seeking&&(i.currentTime=e.seekS),e.play&&i.paused&&i.play().catch(()=>{}),!e.play&&!i.paused&&i.pause()}load(t){const i=t.src;if(this.loading.has(t.id)||this.failed.has(i))return;const s=t.kind==="video",a=(s?this.loadVideo(i,()=>this.onVideoFrame()):this.loadImage(i)).then(o=>{this.loading.delete(t.id);const n=this.references.find(h=>h.id===t.id);if(!n||n.src!==i||n.kind==="video"!==s){r.release(o);return}o.texture.userData.src=i,this.images.set(t.id,o),this.build(n,o),this.follow(),this.onImageLoaded()},o=>{this.loading.delete(t.id),this.failed.set(i,m.failureOf(o)),this.onImageLoaded()});this.loading.set(t.id,a)}onVideoFrame(){this.follow(),this.onFrame?.()}onFrame;static openVideo(t,i){return new Promise((s,e)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.playsInline=!0,a.preload="auto",a.addEventListener("loadeddata",()=>{const o=new M(a);o.colorSpace=g,o.minFilter=c,o.magFilter=c,o.generateMipmaps=!1,a.addEventListener("seeked",i);const n=()=>{a.paused&&i(),a.src&&a.requestVideoFrameCallback(n)};"requestVideoFrameCallback"in a&&a.requestVideoFrameCallback(n),s({texture:o,width:a.videoWidth,height:a.videoHeight,video:a})},{once:!0}),a.addEventListener("error",()=>{m.whyVideoUnread(t).then(o=>e(new f(t,o)))},{once:!0}),a.src=t})}static release(t){t.texture.dispose();const i=t.video;i&&(i.pause(),i.removeAttribute?.("src"),i.load?.())}static async fetchImage(t){const i=await m.blob(t),s=await createImageBitmap(i,{imageOrientation:"flipY"}).catch(()=>{throw new f(t,{kind:"notPicture"})}),e=new b(s);return e.flipY=!1,e.colorSpace=g,e.minFilter=c,e.magFilter=c,e.generateMipmaps=!1,e.needsUpdate=!0,{texture:e,width:s.width,height:s.height}}build(t,i){const s=r.signatureOf(t,i);let e=this.meshes.get(t.id);if(e&&this.signatures.get(t.id)===s){this.applyOpacity(e,t.id);return}e&&(this.dispose(e),this.meshes.delete(t.id)),e=new y(r.geometryOf(t,i),new k({map:i.texture,transparent:!0,depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1})),t.kind==="panorama"&&(e.material.side=O),e.frustumCulled=!1,e.layers.set(v),e.userData.id=t.id,r.point(e,t,d.registrationAt(t,this.clock.t)),this.scene.add(e),this.meshes.set(t.id,e),this.signatures.set(t.id,s),this.applyOpacity(e,t.id)}static geometryOf(t,i){if(t.kind==="panorama"){const o=new T(u,64,32,Math.PI/2,Math.PI*2),n=o.attributes.uv;for(let h=0;h<n.count;h++)n.setX(h,1-n.getX(h));return n.needsUpdate=!0,o}const s=2*u*Math.tan(t.registration.fovDeg/2*l),e=s*(i.width/Math.max(i.height,1)),a=new E(e,s);return a.translate(0,0,-u),a}static orientation({headingDeg:t,pitchDeg:i,rollDeg:s}){const e=new D;return e.rotation.set(i*l,-t*l,-(s??0)*l,"YXZ"),e.quaternion}static point(t,i,s){if(t.quaternion.copy(r.orientation(s)),i.kind==="panorama")return;const e=Math.tan(s.fovDeg/2*l)/Math.tan(i.registration.fovDeg/2*l);t.scale.set(e,e,1)}inTime(t){if(t.kind!=="video")return!0;const i=this.images.get(t.id)?.video?.duration;return d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,i!==void 0&&Number.isFinite(i)?i:void 0)!==void 0}opacityOf(t){const i=this.references.find(a=>a.id===t);if(i&&!this.inTime(i))return 0;const s=this.views.get(t),e=i?r.presenceAt(i,this.observerAt):1;return(s?.opacity??i?.opacity??0)*e}applyOpacity(t,i){const s=this.opacityOf(i);t.material.opacity=s,t.visible=this.shown&&s>0}static signatureOf(t,i){const{headingDeg:s,pitchDeg:e,rollDeg:a,fovDeg:o}=t.registration;return[t.kind,t.src,i.width,i.height,s,e,a??0,o].join("|")}dispose(t){this.scene.remove(t),t.geometry.dispose(),t.material.dispose()}disposeAll(){for(const t of this.meshes.values())this.dispose(t);this.meshes.clear(),this.signatures.clear();for(const t of this.images.values())r.release(t);this.images.clear()}}export{v as REFERENCE_LAYER,r as ReferenceSystem};
1
+ import{bM as w,bN as M,bO as g,be as c,bP as b,bb as y,bD as k,bQ as O,bR as T,bS as E,bT as D}from"./ShareDialogElement-DHlxoHWP.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as I}from"./SaidPosition-CXZLm-ck.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import"./rr0-ufoathome.mjs";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";const v=3,u=800,l=Math.PI/180;class r{constructor(t,i,s=r.fetchImage,e=r.openVideo){this.scene=t,this.onImageLoaded=i,this.loadImage=s,this.loadVideo=e}meshes=new Map;signatures=new Map;images=new Map;loading=new Map;failed=new Map;references=[];views=new Map;shown=!0;observerAt;clock={t:0,playing:!1,timeScale:1};static PRESENT_WITHIN_M=2;static GONE_BEYOND_M=20;static presenceAt(t,i){if(!t.from||!i)return 1;const s=I(i.lat,i.lng,t.from.lat,t.from.lng),a=(Math.hypot(s.x,s.z)-r.PRESENT_WITHIN_M)/(r.GONE_BEYOND_M-r.PRESENT_WITHIN_M),o=Math.min(Math.max(a,0),1);return 1-o*o*(3-2*o)}set(t,i=this.views,s){this.references=t,this.observerAt=s,this.views=i;const e=new Set(t.map(a=>a.id));for(const[a,o]of this.meshes)e.has(a)||(this.dispose(o),this.meshes.delete(a),this.signatures.delete(a));for(const[a,o]of this.images){const n=t.find(p=>p.id===a);if(n&&n.src===o.texture.userData.src&&n.kind==="video"==(o.video!==void 0))continue;r.release(o),this.images.delete(a);const h=this.meshes.get(a);h&&(this.dispose(h),this.meshes.delete(a),this.signatures.delete(a))}for(const a of t){const o=this.images.get(a.id);if(!o){this.load(a);continue}this.build(a,o)}this.follow()}setTime(t){this.clock=t,this.follow()}setShown(t){this.shown=t;for(const i of this.meshes.values())i.visible=t&&this.opacityOf(i.userData.id)>0}setView(t,i){this.views.set(t,i);const s=this.meshes.get(t);s&&this.applyOpacity(s,t)}layer=v;get any(){for(const t of this.meshes.values())if(t.visible)return!0;return!1}place(t){const i=this.held;i&&t.getWorldQuaternion(this.cameraTurn);for(const s of this.meshes.values()){if(!s.visible)continue;s.position.copy(t.position);const e=i?.get(s);e&&s.quaternion.copy(this.cameraTurn).multiply(e),s.updateMatrixWorld()}}hold(t){t.getWorldQuaternion(this.cameraTurn);const i=this.cameraTurn.clone().invert();this.held=new Map([...this.meshes.values()].map(s=>[s,i.clone().multiply(s.quaternion)])),this.registered=new Map([...this.meshes.values()].map(s=>[s,s.quaternion.clone()]))}release(){if(this.held){for(const[t,i]of this.registered??[])t.quaternion.copy(i);this.held=void 0,this.registered=void 0}}registered;held;cameraTurn=new w;get furthestM(){return this.meshes.size>0?u:0}directionOfPixel(t,i,s,e){const a=this.images.get(t.id),o=a?a.width/a.height:1,n=d.registrationAt(t,this.clock.t),h=Math.tan(n.fovDeg/2*l),p=h*o;return e.set((i*2-1)*p,(1-s*2)*h,-1).normalize(),e.applyQuaternion(r.orientation(n))}aspectOf(t){const i=this.images.get(t);return i?i.width/i.height:void 0}failureOf(t){return this.failed.get(t)}follow(){for(const t of this.references){const i=this.meshes.get(t.id),s=this.images.get(t.id)?.video;s&&this.sync(t,s),i&&(t.registrationTrack?.length&&r.point(i,t,d.registrationAt(t,this.clock.t)),t.kind==="video"&&this.applyOpacity(i,t.id))}}sync(t,i){const s=d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,Number.isFinite(i.duration)?i.duration:void 0);if(s===void 0){i.paused||i.pause();return}const e=d.command(i.currentTime,s,this.clock.playing,d.rateOf(t));i.playbackRate=e.rate,e.seekS!==void 0&&!i.seeking&&(i.currentTime=e.seekS),e.play&&i.paused&&i.play().catch(()=>{}),!e.play&&!i.paused&&i.pause()}load(t){const i=t.src;if(this.loading.has(t.id)||this.failed.has(i))return;const s=t.kind==="video",a=(s?this.loadVideo(i,()=>this.onVideoFrame()):this.loadImage(i)).then(o=>{this.loading.delete(t.id);const n=this.references.find(h=>h.id===t.id);if(!n||n.src!==i||n.kind==="video"!==s){r.release(o);return}o.texture.userData.src=i,this.images.set(t.id,o),this.build(n,o),this.follow(),this.onImageLoaded()},o=>{this.loading.delete(t.id),this.failed.set(i,m.failureOf(o)),this.onImageLoaded()});this.loading.set(t.id,a)}onVideoFrame(){this.follow(),this.onFrame?.()}onFrame;static openVideo(t,i){return new Promise((s,e)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.playsInline=!0,a.preload="auto",a.addEventListener("loadeddata",()=>{const o=new M(a);o.colorSpace=g,o.minFilter=c,o.magFilter=c,o.generateMipmaps=!1,a.addEventListener("seeked",i);const n=()=>{a.paused&&i(),a.src&&a.requestVideoFrameCallback(n)};"requestVideoFrameCallback"in a&&a.requestVideoFrameCallback(n),s({texture:o,width:a.videoWidth,height:a.videoHeight,video:a})},{once:!0}),a.addEventListener("error",()=>{m.whyVideoUnread(t).then(o=>e(new f(t,o)))},{once:!0}),a.src=t})}static release(t){t.texture.dispose();const i=t.video;i&&(i.pause(),i.removeAttribute?.("src"),i.load?.())}static async fetchImage(t){const i=await m.blob(t),s=await createImageBitmap(i,{imageOrientation:"flipY"}).catch(()=>{throw new f(t,{kind:"notPicture"})}),e=new b(s);return e.flipY=!1,e.colorSpace=g,e.minFilter=c,e.magFilter=c,e.generateMipmaps=!1,e.needsUpdate=!0,{texture:e,width:s.width,height:s.height}}build(t,i){const s=r.signatureOf(t,i);let e=this.meshes.get(t.id);if(e&&this.signatures.get(t.id)===s){this.applyOpacity(e,t.id);return}e&&(this.dispose(e),this.meshes.delete(t.id)),e=new y(r.geometryOf(t,i),new k({map:i.texture,transparent:!0,depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1})),t.kind==="panorama"&&(e.material.side=O),e.frustumCulled=!1,e.layers.set(v),e.userData.id=t.id,r.point(e,t,d.registrationAt(t,this.clock.t)),this.scene.add(e),this.meshes.set(t.id,e),this.signatures.set(t.id,s),this.applyOpacity(e,t.id)}static geometryOf(t,i){if(t.kind==="panorama"){const o=new T(u,64,32,Math.PI/2,Math.PI*2),n=o.attributes.uv;for(let h=0;h<n.count;h++)n.setX(h,1-n.getX(h));return n.needsUpdate=!0,o}const s=2*u*Math.tan(t.registration.fovDeg/2*l),e=s*(i.width/Math.max(i.height,1)),a=new E(e,s);return a.translate(0,0,-u),a}static orientation({headingDeg:t,pitchDeg:i,rollDeg:s}){const e=new D;return e.rotation.set(i*l,-t*l,-(s??0)*l,"YXZ"),e.quaternion}static point(t,i,s){if(t.quaternion.copy(r.orientation(s)),i.kind==="panorama")return;const e=Math.tan(s.fovDeg/2*l)/Math.tan(i.registration.fovDeg/2*l);t.scale.set(e,e,1)}inTime(t){if(t.kind!=="video")return!0;const i=this.images.get(t.id)?.video?.duration;return d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,i!==void 0&&Number.isFinite(i)?i:void 0)!==void 0}opacityOf(t){const i=this.references.find(a=>a.id===t);if(i&&!this.inTime(i))return 0;const s=this.views.get(t),e=i?r.presenceAt(i,this.observerAt):1;return(s?.opacity??i?.opacity??0)*e}applyOpacity(t,i){const s=this.opacityOf(i);t.material.opacity=s,t.visible=this.shown&&s>0}static signatureOf(t,i){const{headingDeg:s,pitchDeg:e,rollDeg:a,fovDeg:o}=t.registration;return[t.kind,t.src,i.width,i.height,s,e,a??0,o].join("|")}dispose(t){this.scene.remove(t),t.geometry.dispose(),t.material.dispose()}disposeAll(){for(const t of this.meshes.values())this.dispose(t);this.meshes.clear(),this.signatures.clear();for(const t of this.images.values())r.release(t);this.images.clear()}}export{v as REFERENCE_LAYER,r as ReferenceSystem};
@@ -1 +1 @@
1
- import{g as D}from"./SaidPosition-CWiVNaNW.js";class M{static MIN_ROAD_M=5.5;static WIDE_ROAD_M=9;static LINE_WIDTH_M=.12;static DASH_M=3;static GAP_M=10;static RIVE_DASH_M=2.5;static RIVE_GAP_M=3.5;static MIN_DASH_M=.5;static LANE_M=3.5;static SHOULDER_MIN_M=1.5;static SOLID_EDGE_FROM_M=7;static SOLID_EDGE_FROM_KMH=80;static BEND_RADIUS_M=300;static EDGE_SETBACK_M=.4;static PAINT_RADIUS_M=450;static LIFT_M=.015;static BARRIER_MAX_AXES_M=40;static BARRIER_MIN_AXES_M=5;static BARRIER_HEIGHT_M=.8;static BARRIER_HALF_WIDTH_M=.2;static BARRIER_STEP_M=4;static painted(t){return t.surface==="paved"&&t.widthM>=M.MIN_ROAD_M&&t.kind!=="roundabout"}static plan(t){if(!M.painted(t))return[];const u=t.widthM,l=u/2,i=M.EDGE_SETBACK_M;if(!(t.direction!==void 0&&t.lanes!==void 0)){const I=[{offsetM:l-i,pattern:"solid"},{offsetM:-(l-i),pattern:"solid"}],A=u>=M.WIDE_ROAD_M?[-u/4,u/4]:[0];for(const x of A)I.push({offsetM:x,pattern:"dashed"});return I}const s=t.lanes,n=u>=M.SOLID_EDGE_FROM_M||(t.speedKmh??0)>=M.SOLID_EDGE_FROM_KMH?"solid":"rive";if(t.direction==="both"){if(s<2)return[];const I=[{offsetM:l-i,pattern:n},{offsetM:-(l-i),pattern:n}];if(s>=4){I.push({offsetM:.1,pattern:"solid"},{offsetM:-.1,pattern:"solid"});const A=Math.floor(s/2),x=u/s;for(let z=1;z<A;z++)I.push({offsetM:z*x,pattern:"dashed"},{offsetM:-z*x,pattern:"dashed"})}else I.push({offsetM:0,pattern:"dashed",solidInBends:!0});return I}const r=t.direction==="backward"?-1:1,o=I=>r*(l-I),c=Math.min(M.LANE_M,u/Math.max(s,1)),h=s*c,d=u-h,_=(t.kind==="motorway"||t.kind==="dual")&&d>=M.SHOULDER_MIN_M,E=[{offsetM:o(i),pattern:t.kind==="motorway"||t.kind==="dual"?"solid":n}];E.push({offsetM:o(_?h:u-i),pattern:t.kind==="motorway"||t.kind==="dual"?"solid":n});for(let I=1;I<s;I++)E.push({offsetM:o(I*c),pattern:"dashed"});return E}static lay(t,u,l,i){let e=0;const s=(f,n)=>{i(f,M.LINE_WIDTH_M,{offsetM:n,liftM:M.LIFT_M,minHalfM:M.LINE_WIDTH_M/2}),e++};for(const f of t){const n=M.plan(f);if(n.length===0)continue;const r=f.points.map(o=>D(o.lat,o.lng,u,l));for(const o of M.near(r,M.PAINT_RADIUS_M))for(const c of n){if(c.pattern==="solid"){s(o,c.offsetM);continue}const[h,d]=c.pattern==="dashed"?[M.DASH_M,M.GAP_M]:[M.RIVE_DASH_M,M.RIVE_GAP_M];for(const _ of c.solidInBends?M.byBends(o):[{path:o,bend:!1}])if(_.bend)s(_.path,c.offsetM);else for(const E of M.dashes(_.path,h,d))s(E,c.offsetM)}}return e}static byBends(t){if(t.length<3)return[{path:t,bend:!1}];const u=(e,s)=>Math.atan2(s.x-e.x,-(s.z-e.z)),l=new Array(t.length-1).fill(!1);for(let e=1;e<t.length-1;e++){const s=Math.hypot(t[e].x-t[e-1].x,t[e].z-t[e-1].z),f=Math.hypot(t[e+1].x-t[e].x,t[e+1].z-t[e].z);if(s<1e-6||f<1e-6)continue;let n=Math.abs(u(t[e],t[e+1])-u(t[e-1],t[e]));n>Math.PI&&(n=2*Math.PI-n),(s+f)/2/Math.max(n,1e-6)<M.BEND_RADIUS_M&&(l[e-1]=!0,l[e]=!0)}const i=[];for(let e=0;e<l.length;e++){const s=i.at(-1);s&&s.bend===l[e]?s.path.push(t[e+1]):i.push({path:[t[e],t[e+1]],bend:l[e]})}return i}static barriers(t,u,l){const i=t.filter(n=>(n.kind==="motorway"||n.kind==="dual")&&(n.direction==="forward"||n.direction==="backward")),e=i.map(n=>{const r=n.points.map(o=>D(o.lat,o.lng,u,l));return n.direction==="backward"?[...r].reverse():r}),s=[],f=M.BARRIER_STEP_M;return i.forEach((n,r)=>{for(const o of M.near(e[r],M.PAINT_RADIUS_M)){let c=[];for(const h of M.resample(o,f)){const d=M.midwayToOpposite(h,r,i,e);d?c.push(d):c.length>0&&(c.length>=2&&s.push(c),c=[])}c.length>=2&&s.push(c)}}),s}static midwayToOpposite(t,u,l,i){let e;for(let s=0;s<i.length;s++){if(s===u||l[s].id<l[u].id)continue;const f=i[s];for(let n=0;n<f.length-1;n++){const r=f[n+1].x-f[n].x,o=f[n+1].z-f[n].z,c=r*r+o*o;if(c<1e-9||(r*t.dx+o*t.dz)/Math.sqrt(c)>-.9)continue;const h=Math.max(0,Math.min(1,((t.x-f[n].x)*r+(t.z-f[n].z)*o)/c)),d={x:f[n].x+r*h,z:f[n].z+o*h},_=Math.hypot(t.x-d.x,t.z-d.z);_<M.BARRIER_MIN_AXES_M||_>M.BARRIER_MAX_AXES_M||(!e||_<e.distance)&&(e={distance:_,point:d})}}return e?{x:(t.x+e.point.x)/2,z:(t.z+e.point.z)/2}:void 0}static resample(t,u){const l=[];for(let e=0;e<t.length-1;e++){const s=Math.hypot(t[e+1].x-t[e].x,t[e+1].z-t[e].z);if(s<1e-6)continue;const f=(t[e+1].x-t[e].x)/s,n=(t[e+1].z-t[e].z)/s;for(let r=0;r<s;r+=u)l.push({x:t[e].x+f*r,z:t[e].z+n*r,dx:f,dz:n})}const i=l.at(-1);return i&&l.push({...t[t.length-1],dx:i.dx,dz:i.dz}),l}static barrierGeometry(t,u){const l=[],i=[],e=M.BARRIER_HALF_WIDTH_M;for(const s of t){if(s.length<2)continue;const f=l.length/3;for(let n=0;n<s.length;n++){const r=s[Math.max(0,n-1)],o=s[Math.min(s.length-1,n+1)],c=Math.hypot(o.x-r.x,o.z-r.z)||1,h=-(o.z-r.z)/c*e,d=(o.x-r.x)/c*e,_=u(s[n].x,s[n].z);l.push(s[n].x+h,_,s[n].z+d,s[n].x+h,_+M.BARRIER_HEIGHT_M,s[n].z+d,s[n].x-h,_+M.BARRIER_HEIGHT_M,s[n].z-d,s[n].x-h,_,s[n].z-d)}for(let n=0;n<s.length-1;n++){const r=f+n*4,o=r+4;for(let c=0;c<3;c++)i.push(r+c,o+c,r+c+1,r+c+1,o+c,o+c+1)}}return{positions:l,indices:i}}static near(t,u){const l=[];let i;for(let e=0;e<t.length-1;e++)Math.min(Math.hypot(t[e].x,t[e].z),Math.hypot(t[e+1].x,t[e+1].z))<=u||Math.hypot((t[e].x+t[e+1].x)/2,(t[e].z+t[e+1].z)/2)<=u?(i||(i=[t[e]]),i.push(t[e+1])):i&&(l.push(i),i=void 0);return i&&l.push(i),l}static dashes(t,u,l){const i=[],e=u+l;let s=0,f;const n=(o,c)=>({x:t[o].x+(t[o+1].x-t[o].x)*c,z:t[o].z+(t[o+1].z-t[o].z)*c});for(let o=0;o<t.length-1;o++){const c=Math.hypot(t[o+1].x-t[o].x,t[o+1].z-t[o].z);if(c<1e-6)continue;let h=0;for(;h<c;){const d=(s+h)%e,_=d<u,E=_?u-d:e-d,I=Math.min(c,h+E);_&&(f||(f=[n(o,h/c)]),f.push(n(o,I/c)),I-h>=E-1e-9&&(i.push(f),f=void 0)),h=I}s+=c}f&&f.length>=2&&i.push(f);const r=o=>o.slice(1).reduce((c,h,d)=>c+Math.hypot(h.x-o[d].x,h.z-o[d].z),0);return i.filter(o=>o.length>=2&&r(o)>=M.MIN_DASH_M)}}export{M as RoadMarkings};
1
+ import{g as D}from"./SaidPosition-CXZLm-ck.js";class M{static MIN_ROAD_M=5.5;static WIDE_ROAD_M=9;static LINE_WIDTH_M=.12;static DASH_M=3;static GAP_M=10;static RIVE_DASH_M=2.5;static RIVE_GAP_M=3.5;static MIN_DASH_M=.5;static LANE_M=3.5;static SHOULDER_MIN_M=1.5;static SOLID_EDGE_FROM_M=7;static SOLID_EDGE_FROM_KMH=80;static BEND_RADIUS_M=300;static EDGE_SETBACK_M=.4;static PAINT_RADIUS_M=450;static LIFT_M=.015;static BARRIER_MAX_AXES_M=40;static BARRIER_MIN_AXES_M=5;static BARRIER_HEIGHT_M=.8;static BARRIER_HALF_WIDTH_M=.2;static BARRIER_STEP_M=4;static painted(t){return t.surface==="paved"&&t.widthM>=M.MIN_ROAD_M&&t.kind!=="roundabout"}static plan(t){if(!M.painted(t))return[];const u=t.widthM,l=u/2,i=M.EDGE_SETBACK_M;if(!(t.direction!==void 0&&t.lanes!==void 0)){const I=[{offsetM:l-i,pattern:"solid"},{offsetM:-(l-i),pattern:"solid"}],A=u>=M.WIDE_ROAD_M?[-u/4,u/4]:[0];for(const x of A)I.push({offsetM:x,pattern:"dashed"});return I}const s=t.lanes,n=u>=M.SOLID_EDGE_FROM_M||(t.speedKmh??0)>=M.SOLID_EDGE_FROM_KMH?"solid":"rive";if(t.direction==="both"){if(s<2)return[];const I=[{offsetM:l-i,pattern:n},{offsetM:-(l-i),pattern:n}];if(s>=4){I.push({offsetM:.1,pattern:"solid"},{offsetM:-.1,pattern:"solid"});const A=Math.floor(s/2),x=u/s;for(let z=1;z<A;z++)I.push({offsetM:z*x,pattern:"dashed"},{offsetM:-z*x,pattern:"dashed"})}else I.push({offsetM:0,pattern:"dashed",solidInBends:!0});return I}const r=t.direction==="backward"?-1:1,o=I=>r*(l-I),c=Math.min(M.LANE_M,u/Math.max(s,1)),h=s*c,d=u-h,_=(t.kind==="motorway"||t.kind==="dual")&&d>=M.SHOULDER_MIN_M,E=[{offsetM:o(i),pattern:t.kind==="motorway"||t.kind==="dual"?"solid":n}];E.push({offsetM:o(_?h:u-i),pattern:t.kind==="motorway"||t.kind==="dual"?"solid":n});for(let I=1;I<s;I++)E.push({offsetM:o(I*c),pattern:"dashed"});return E}static lay(t,u,l,i){let e=0;const s=(f,n)=>{i(f,M.LINE_WIDTH_M,{offsetM:n,liftM:M.LIFT_M,minHalfM:M.LINE_WIDTH_M/2}),e++};for(const f of t){const n=M.plan(f);if(n.length===0)continue;const r=f.points.map(o=>D(o.lat,o.lng,u,l));for(const o of M.near(r,M.PAINT_RADIUS_M))for(const c of n){if(c.pattern==="solid"){s(o,c.offsetM);continue}const[h,d]=c.pattern==="dashed"?[M.DASH_M,M.GAP_M]:[M.RIVE_DASH_M,M.RIVE_GAP_M];for(const _ of c.solidInBends?M.byBends(o):[{path:o,bend:!1}])if(_.bend)s(_.path,c.offsetM);else for(const E of M.dashes(_.path,h,d))s(E,c.offsetM)}}return e}static byBends(t){if(t.length<3)return[{path:t,bend:!1}];const u=(e,s)=>Math.atan2(s.x-e.x,-(s.z-e.z)),l=new Array(t.length-1).fill(!1);for(let e=1;e<t.length-1;e++){const s=Math.hypot(t[e].x-t[e-1].x,t[e].z-t[e-1].z),f=Math.hypot(t[e+1].x-t[e].x,t[e+1].z-t[e].z);if(s<1e-6||f<1e-6)continue;let n=Math.abs(u(t[e],t[e+1])-u(t[e-1],t[e]));n>Math.PI&&(n=2*Math.PI-n),(s+f)/2/Math.max(n,1e-6)<M.BEND_RADIUS_M&&(l[e-1]=!0,l[e]=!0)}const i=[];for(let e=0;e<l.length;e++){const s=i.at(-1);s&&s.bend===l[e]?s.path.push(t[e+1]):i.push({path:[t[e],t[e+1]],bend:l[e]})}return i}static barriers(t,u,l){const i=t.filter(n=>(n.kind==="motorway"||n.kind==="dual")&&(n.direction==="forward"||n.direction==="backward")),e=i.map(n=>{const r=n.points.map(o=>D(o.lat,o.lng,u,l));return n.direction==="backward"?[...r].reverse():r}),s=[],f=M.BARRIER_STEP_M;return i.forEach((n,r)=>{for(const o of M.near(e[r],M.PAINT_RADIUS_M)){let c=[];for(const h of M.resample(o,f)){const d=M.midwayToOpposite(h,r,i,e);d?c.push(d):c.length>0&&(c.length>=2&&s.push(c),c=[])}c.length>=2&&s.push(c)}}),s}static midwayToOpposite(t,u,l,i){let e;for(let s=0;s<i.length;s++){if(s===u||l[s].id<l[u].id)continue;const f=i[s];for(let n=0;n<f.length-1;n++){const r=f[n+1].x-f[n].x,o=f[n+1].z-f[n].z,c=r*r+o*o;if(c<1e-9||(r*t.dx+o*t.dz)/Math.sqrt(c)>-.9)continue;const h=Math.max(0,Math.min(1,((t.x-f[n].x)*r+(t.z-f[n].z)*o)/c)),d={x:f[n].x+r*h,z:f[n].z+o*h},_=Math.hypot(t.x-d.x,t.z-d.z);_<M.BARRIER_MIN_AXES_M||_>M.BARRIER_MAX_AXES_M||(!e||_<e.distance)&&(e={distance:_,point:d})}}return e?{x:(t.x+e.point.x)/2,z:(t.z+e.point.z)/2}:void 0}static resample(t,u){const l=[];for(let e=0;e<t.length-1;e++){const s=Math.hypot(t[e+1].x-t[e].x,t[e+1].z-t[e].z);if(s<1e-6)continue;const f=(t[e+1].x-t[e].x)/s,n=(t[e+1].z-t[e].z)/s;for(let r=0;r<s;r+=u)l.push({x:t[e].x+f*r,z:t[e].z+n*r,dx:f,dz:n})}const i=l.at(-1);return i&&l.push({...t[t.length-1],dx:i.dx,dz:i.dz}),l}static barrierGeometry(t,u){const l=[],i=[],e=M.BARRIER_HALF_WIDTH_M;for(const s of t){if(s.length<2)continue;const f=l.length/3;for(let n=0;n<s.length;n++){const r=s[Math.max(0,n-1)],o=s[Math.min(s.length-1,n+1)],c=Math.hypot(o.x-r.x,o.z-r.z)||1,h=-(o.z-r.z)/c*e,d=(o.x-r.x)/c*e,_=u(s[n].x,s[n].z);l.push(s[n].x+h,_,s[n].z+d,s[n].x+h,_+M.BARRIER_HEIGHT_M,s[n].z+d,s[n].x-h,_+M.BARRIER_HEIGHT_M,s[n].z-d,s[n].x-h,_,s[n].z-d)}for(let n=0;n<s.length-1;n++){const r=f+n*4,o=r+4;for(let c=0;c<3;c++)i.push(r+c,o+c,r+c+1,r+c+1,o+c,o+c+1)}}return{positions:l,indices:i}}static near(t,u){const l=[];let i;for(let e=0;e<t.length-1;e++)Math.min(Math.hypot(t[e].x,t[e].z),Math.hypot(t[e+1].x,t[e+1].z))<=u||Math.hypot((t[e].x+t[e+1].x)/2,(t[e].z+t[e+1].z)/2)<=u?(i||(i=[t[e]]),i.push(t[e+1])):i&&(l.push(i),i=void 0);return i&&l.push(i),l}static dashes(t,u,l){const i=[],e=u+l;let s=0,f;const n=(o,c)=>({x:t[o].x+(t[o+1].x-t[o].x)*c,z:t[o].z+(t[o+1].z-t[o].z)*c});for(let o=0;o<t.length-1;o++){const c=Math.hypot(t[o+1].x-t[o].x,t[o+1].z-t[o].z);if(c<1e-6)continue;let h=0;for(;h<c;){const d=(s+h)%e,_=d<u,E=_?u-d:e-d,I=Math.min(c,h+E);_&&(f||(f=[n(o,h/c)]),f.push(n(o,I/c)),I-h>=E-1e-9&&(i.push(f),f=void 0)),h=I}s+=c}f&&f.length>=2&&i.push(f);const r=o=>o.slice(1).reduce((c,h,d)=>c+Math.hypot(h.x-o[d].x,h.z-o[d].z),0);return i.filter(o=>o.length>=2&&r(o)>=M.MIN_DASH_M)}}export{M as RoadMarkings};
@@ -0,0 +1,4 @@
1
+ class Nt{static read(t,e){let r=t;for(const a of e.split(".")){if(r=Nt.bare(r),r===null||typeof r!="object")return;r=r[a]}return Nt.bare(r)}static write(t,e,r){const a=e.split("."),i=[];let o=t;for(let p=0;p<a.length-1;p++){let m=Nt.bare(o[a[p]]);if(m===null||typeof m!="object"||Array.isArray(m)){if(r===void 0)return;m={}}o[a[p]]=m,i.push({owner:o,part:a[p]}),o=m}const u=a[a.length-1];r===void 0?delete o[u]:o[u]=r;for(let p=i.length-1;p>=0;p--){const m=i[p].owner[i[p].part];if(Object.keys(m).length>0)break;delete i[p].owner[i[p].part]}}static stated(t,e){return Nt.read(t,e)!==void 0}static bare(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&"value"in t&&"basis"in t?t.value:t}}class Kt{static sets=new Map;static publish(t){Kt.sets.set(t.kind,t)}static of(t){return Kt.sets.get(t)}static kinds(){return[...Kt.sets.keys()]}}class de{static resolved=new WeakMap;static resolve(t,e){let r=de.resolved.get(t);r||de.resolved.set(t,r=new WeakMap);let a=r.get(e);if(!a){const i=e,o=p=>{if(typeof p!="string")return p;if(typeof i[p]=="string")return i[p];const m=p.split(" ");return m.length>1&&m.every(w=>typeof i[w]=="string")?m.map(w=>i[w]).join(" "):p},u=p=>p.map(m=>({...m,label:o(m.label)}));a={...t,title:o(t.title),parameters:t.parameters.map(p=>{const m={...p,label:o(p.label),hint:o(p.hint),summary:o(p.summary),group:o(p.group),..."placeholder"in p?{placeholder:o(p.placeholder)}:{},..."empty"in p?{empty:o(p.empty)}:{}};if(m.type==="choice"){const w=m.optionsOf;return{...m,choices:u(m.choices),...w?{optionsOf:(f,b)=>u(w(f,b))}:{}}}if(m.type==="set"){const w=m.options;return{...m,options:(f,b)=>u(w(f,b))}}return m})},r.set(e,a)}return a}static missing(t,e){const r=e,a=new Set,i=o=>{if(typeof o=="string")for(const u of o.split(" "))/^[a-z][A-Za-z0-9]*$/.test(u)&&r[u]===void 0&&a.add(u)};i(t.title);for(const o of t.parameters)if(i(o.label),i(o.hint),i(o.summary),i(o.group),"placeholder"in o&&i(o.placeholder),"empty"in o&&i(o.empty),o.type==="choice")for(const u of o.choices)i(u.label);return[...a]}}class j extends Error{}class Pt{constructor(t){this.name=t}validate(t){return!0}}class wr extends Pt{min;max;constructor(t,e,r){super(t),this.min=e,this.max=r}validate(t){if(typeof t!="number")throw new j(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new j(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class M{name;min;max;duration;subUnit;validator;constructor(t,e,r,a,i=new wr(t,e,r)){this.name=t,this.min=e,this.max=r,this.subUnit=a,this.duration=a?(a.max-a.min+1)*a.duration:1,this.validator=i}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class fe{millisecond;second;minute;hour;day;month;year}class Ar extends fe{}class Sr extends Ar{millisecond=new M("millisecond",0,999,void 0);second=new M("second",0,59,this.millisecond);minute=new M("minute",0,59,this.second);hour=new M("hour",0,23,this.minute);day=new M("day",1,31,this.hour);month=new M("month",1,12,this.day);year=new M("year",0,9999,this.month)}const l=new Sr;class yr extends wr{constructor(t=1,e=12){super("month",t,e)}}class pt extends M{static Month28=new pt(28);static Month29=new pt(29);static ThirtyDays=new pt(30);static ThirtyOneDays=new pt(31);constructor(t,e=new yr(1,t)){super("month",1,t,l.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new j("Unsupported month",t,e)}}}class B{static instance=new B;render(t){return t.value.toString()}}class V{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new Pt(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=B.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class h{static#t=new Map;static register(t,e){h.#t.set(t,e)}static get(t){const e=h.#t.get(t);if(!e)throw new j(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class ft extends V{constructor(t=new Date().getFullYear(),e=l.year){super(t,e)}static fromString(t,e=h.get(ft)){return new ft(e.parse(t))}}class q extends B{static default=new q("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class gt extends V{constructor(t=new Date().getMonth()+1,e=l.month){super(t,e)}static fromString(t,e=h.get(gt)){return new gt(e.parse(t))}toString(t=q.default){return super.toString(t)}}class wt extends V{constructor(t=new Date().getDate(),e=l.day){super(t,e)}static fromString(t,e=h.get(wt)){const r=e.parse(t);return new wt(r)}toString(t=q.default){return super.toString(t)}}class St extends V{constructor(t=new Date().getHours(),e=l.hour){super(t,e)}static fromString(t,e=h.get(St)){return new St(e.parse(t))}toString(t=q.default){return super.toString(t)}}class yt extends V{constructor(t=new Date().getMinutes(),e=l.minute){super(t,e)}static fromString(t,e=h.get(yt)){return new yt(e.parse(t))}toString(t=q.default){return super.toString(t)}}class Mt extends V{constructor(t=new Date().getSeconds(),e=l.second){super(t,e)}static fromString(t,e=h.get(Mt)){return new Mt(e.parse(t),l.second)}toString(t=q.default){return super.toString(t)}}class at extends V{static renderer=new q("0",3);constructor(t,e=l.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=at.renderer){return super.toString(t)}}class Rr{render(t){return t.toString()}}class Fr extends Rr{render(t){const e=t.value,r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(a===0&&i===0)return"Z";{const o=e<0?"-":"+",u=a.toString().padStart(2,"0"),p=i>0?":"+i.toString().padEnd(2,"0"):"";return o+u+p}}}class st{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=h.get(st),r=void 0){const a=e.parse(t,r);return new st(a)}toString(t=new Fr){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class F{static timeshift(t,e){return t+(F.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:r,day:a}=t,i=t.hour??12;if(![e,r,a].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const o=F.rule(e);if(!o)return!1;const u=F.rank(r,a,i);return u>=F.rank(o.start.month,o.start.day,2)&&u<F.rank(o.end.month,o.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:F.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:F.sunday(t,3,2)},end:{month:11,day:F.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:F.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:F.sunday(t,4,-1)},end:e}}static sunday(t,e,r){const a=new Date(Date.UTC(2e3,e-1,1));a.setUTCFullYear(t);const i=1+(7-a.getUTCDay())%7;if(r>0)return i+7*(r-1);const o=[31,F.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let u=i;for(;u+7<=o;)u+=7;return u}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,r){return(t*100+e)*100+r}}const Vr={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},$r={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},kr={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},jr={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},vr={name:"PT",timeshift:n=>F.timeshift(-480,n),title:"Pacific Time (US)"},zr={name:"MT",timeshift:n=>F.timeshift(-420,n),title:"Mountain Time (US)"},Hr={name:"CT",timeshift:n=>F.timeshift(-360,n),title:"Central Time (US)"},Br={name:"ET",timeshift:n=>F.timeshift(-300,n),title:"Eastern Time (US)"},Ur={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},qr={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Cr={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},Yr={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},Wr={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},Xr={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},Or={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},Zr={name:"Z",timeshift:"Z",title:"UTC"},Jr={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},Kr={name:"BST",timeshift:"+01",title:"British Summer Time"},Qr={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},Ir={name:"CET",timeshift:"+01",title:"Central European Time"},Dr={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},Pr={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},Lr={name:"BJT",timeshift:"+08",title:"Beijing Time"},_r={name:"CST",timeshift:"-06",title:"Central Standard Time"},tn={name:"JST",timeshift:"+09",title:"Japan Standard Time"},en={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},rn={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},nn={name:"LST",timeshift:"?",title:"Local Sideral Time"},be=[Xr,en,Wr,Lr,Kr,_r,qr,Ir,Qr,Hr,Ur,Yr,Cr,Br,Jr,Pr,tn,nn,kr,Dr,jr,zr,rn,$r,Vr,vr,Or,Zr];class Lt{static instance=new Lt;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const r=[];t.hour&&r.push(this.renderComponent(t,"hour")),t.minute&&r.push(this.renderComponent(t,"minute")),t.second&&r.push(this.renderSecond(t));const a=e.join("-"),i=t.timeshift?t.timeshift.toString():"",o=r.join(":")+i;return a+(o.length>0?"T"+o:"")}}class it extends j{constructor(t="method is abstract"){super(t)}}class ge{units;constructor(t){this.units=t}newYear(t){throw new it}newMonth(t){throw new it}newDay(t){throw new it}newHour(t){throw new it}newMinute(t){throw new it}newSecond(t){throw new it}}class sn extends fe{millisecond=new M("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new M("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new M("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new M("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new M("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new M("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new M("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const Zt=new sn;class _t{static instance=new _t;render(t){const e=H.toSpec(t);let r="P";const a=e.years;a&&(r+=a.toString()+"Y");const i=e.months;i&&(r+=i.toString(B.instance)+"MM");const o=e.days;o&&(r+=o.toString(B.instance)+"D");const u=e.hours;u&&(r+=u.toString(B.instance)+"H");const p=e.minutes;p&&(r+=p.toString(B.instance)+"M");const m=e.seconds;return m&&(r+=m.toString(B.instance)+"S"),r}}class H extends V{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*l.year.duration:0)+(t.months?t.months*l.month.duration:0)+(t.days?t.days*l.day.duration:0)+(t.hours?t.hours*l.hour.duration:0)+(t.minutes?t.minutes*l.minute.duration:0)+(t.seconds?t.seconds*l.second.duration:0)},new M("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=on){let r=typeof t=="number"?t:t.value;const a=r>0?1:-1;r=Math.abs(r);const i={},o=r/l.year.duration,u=Math.floor(o);u>0&&(i.years=e.newYear(a*u),r-=u*l.year.duration);const p=r/l.month.duration,m=Math.floor(p);m>0&&(i.months=e.newMonth(a*m),r-=m*l.month.duration);const w=r/l.day.duration,f=Math.floor(w);f>0&&(i.days=e.newDay(a*f),r-=f*l.day.duration);const b=r/l.hour.duration,S=Math.floor(b);S>0&&(i.hours=e.newHour(a*S),r-=S*l.hour.duration);const z=r/l.minute.duration,N=Math.floor(z);N>0&&(i.minutes=e.newMinute(a*N),r-=N*l.minute.duration);const C=r/l.second.duration,I=Math.floor(a*C);return I>0&&(i.seconds=e.newSecond(I)),i}static fromString(t,e=h.get(H)){return new H(e.parse(t))}static between(t,e){const r=e.getTime(),a=t.getTime();return new H(r-a)}toSpec(){return H.toSpec(this)}toString(t=_t.instance){return t.render(this)}}class Mr extends ge{constructor(t){super(t)}newYear(t){return new ft(t,this.units.year)}newMonth(t){return new gt(t,this.units.month)}newDay(t){return new wt(t,this.units.day)}newHour(t){return new St(t,this.units.hour)}newMinute(t){return new yt(t,this.units.minute)}newSecond(t){return new Mt(t,this.units.second)}newMillisecond(t){return new at(t,this.units.millisecond)}newTimeshift(t){return new st(typeof t=="number"?t:t.value)}}const an=new Mr(l),on=new Mr(Zt);class R{#t;#e;#r;#n;#s;#a;#i;#o;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:R.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof V?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof V?t:this.factory.newMonth(t)}get day(){return this.#r}set day(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newDay(t):!t||t.start||t instanceof V?t:this.factory.newDay(t)}get hour(){return this.#n}set hour(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newHour(t):!t||t.start||t instanceof V?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof V?t:this.factory.newMinute(t)}get second(){return this.#a}set second(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e?this.factory.newSecond(t):!t||t.start||t instanceof V?t:this.factory.newSecond(t)}get millisecond(){return this.#i}set millisecond(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof V)?this.factory.newMillisecond(t):t}get timeshift(){return this.#o}set timeshift(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e||t&&!(t instanceof st)?this.factory.newTimeshift(t):t}get factory(){return an}static fromString(t,e=h.get(R)){const{year:r,month:a,day:i,hour:o,minute:u,second:p,millisecond:m,timeshift:w}=e.parse(t);return new R({year:r,month:a,day:i,hour:o,minute:u,second:p,millisecond:m,timeshift:w})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new R({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:R.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return R.fromString(r)}#u(t){if(this.constructor.name!==t.constructor.name)throw new Pt(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new H(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new R(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=Lt.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const r=this.month?.toSpec();r&&(t.month=r);const a=this.day?.toSpec();a&&(t.day=a);const i=this.hour?.toSpec();i&&(t.hour=i);const o=this.minute?.toSpec();o&&(t.minute=o);const u=this.second?.toSpec();u&&(t.second=u);const p=this.millisecond?.toSpec();p&&(t.millisecond=p);const m=this.timeshift?.toSpec();return m&&(t.timeshift=m),t}toJSON(){return this.toSpec()}}class we{static instance=new we;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class Et{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=R.fromString(t)),t&&!(t instanceof R)&&!(t instanceof H))throw new j("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=R.fromString(t)),t&&!(t instanceof R)&&!(t instanceof H))throw new j("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Et)){const{start:r,end:a}=e.parse(t);return new Et(r,a)}toString(t=we.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class Jt extends B{static instance=new Jt(q.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class U extends V{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=Jt.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class Gr extends Sr{year=new M("year",-9999,9999,this.month);yearExtended=new M("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const Qt=new Gr;class L extends U{constructor(t,e=Qt.year){super(t,e)}static fromString(t,e=Qt.year,r=h.get(L)){const a=r.parse(t),i=a.value.start;if(t.startsWith("Y")&&(e=Qt.yearExtended),i!==void 0){const o=new L(Object.assign({...a},{value:Math.max(i,e.min)})),u=new L(Object.assign({...a},{value:Math.min(a.value.end,e.max)}));return{start:o,end:u}}else return new L(a,e)}}class xr extends Pt{monthValidator=new yr;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class _ extends U{constructor(t,e=new M(l.month.name,1,24,l.day,new xr)){super(t,e)}static fromString(t,e=h.get(_)){const r=e.parse(t),a=r.value.start;if(a!==void 0){let i=l.month;const o=new _(Object.assign({...r},{value:Math.max(a,i.min)})),u=new _(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new _(r)}toString(t){return super.toString(t).padStart(2,"0")}}class tt extends U{constructor(t,e=l.day){super(t,e)}static fromString(t,e=h.get(tt)){const r=e.parse(t),a=r.value.start;if(a!==void 0){let i=l.day;const o=new tt(Object.assign({...r},{value:Math.max(a,i.min)})),u=new tt(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new tt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class et extends U{constructor(t,e=l.hour){super(t,e)}static fromString(t,e=h.get(et)){const r=e.parse(t),a=r.value.start;if(a!==void 0){let i=l.hour;const o=new et(Object.assign({...r},{value:Math.max(a,i.min)})),u=new et(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new et(r)}}class rt extends U{constructor(t,e=l.minute){super(t,e)}static fromString(t,e=h.get(rt)){const r=e.parse(t),a=r.value.start;if(a!==void 0){const i=l.minute,o=new rt(Object.assign({...r},{value:Math.max(a,i.min)})),u=new rt(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new rt(r)}toString(t=Jt.instance){return super.toString(t)}}class nt extends U{constructor(t,e=l.second){super(t,e)}static fromString(t,e=h.get(nt)){const r=e.parse(t),a=r.value.start;if(a!==void 0){const i=l.second,o=new nt(Object.assign({...r},{value:Math.max(a,i.min)})),u=new nt(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new nt(r)}}class ct extends st{static fromString(t,e=h.get(ct),r=void 0){return new ct(e.parse(t,r))}}class br extends ge{constructor(t){super(t)}newYear(t){return new L(t,this.units.year)}newMonth(t){return new _(t,this.units.month)}newDay(t){return new tt(t,this.units.day)}newHour(t){return new et(t,this.units.hour)}newMinute(t){return new rt(t,this.units.minute)}newSecond(t){return new nt(t,this.units.second)}newMillisecond(t){return new at(t,this.units.millisecond)}newTimeshift(t){return new ct(typeof t=="number"?t:t.value)}}const un=new br(Qt),cn=new br(Zt);class $ extends R{constructor(t){super(t)}get factory(){return un}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new $({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:R.timeshiftOf(t)})}static fromString(t,e=h.get($)){const r=e.parse(t);return new $(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return $.fromString(r)}clone(){return new $(this.toSpec())}}const A=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class te extends _t{static instance=new te;render(t){return super.render(t)}}class T extends U{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:T.getValue(t,A.year)+T.getValue(t,A.month)+T.getValue(t,A.day)+T.getValue(t,A.hour)+T.getValue(t,A.minute)+T.getValue(t,A.second),uncertain:T.getBoolean(t,A.uncertain),approximate:T.getBoolean(t,"approximate")},Zt.millisecond)}static getBoolean(t,e){return t[e]||t[A.year+"s"]?.[e]||t[A.month+"s"]?.[e]||t[A.day+"s"]?.[e]||t[A.hour+"s"]?.[e]||t[A.minute+"s"]?.[e]||t[A.second+"s"]?.[e]||!1}static getValue(t,e){let r=0,a=t[e+"s"];if(a instanceof U?a=a.value:typeof t=="number"&&(a=t),a){const i=l[e];r=a*i.duration}return r}static toSpec(t,e=cn){return{...H.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=h.get(T)){const r=e.parse(t);return new T(r)}static between(t,e){const r=e.getTime(),a=t.getTime();return new T(r-a)}toString(t=te.instance){return super.toString(t)}toSpec(){return T.toSpec(this)}}class Tt extends Et{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=$.fromString(t)),t&&!(t instanceof $)&&!(t instanceof T))throw new j("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=$.fromString(t)),t&&!(t instanceof $)&&!(t instanceof T))throw new j("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Tt)){const{start:r,end:a}=e.parse(t);return new Tt(r,a)}}class xt extends U{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class mn extends Gr{year=new M("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const le=new mn;class Y extends xt{constructor(t,e=le.year){super(t,e)}static fromString(t,e=le.year,r=h.get(Y)){const a=r.parse(t),i=a.value.start;if(i!==void 0){const o=new Y(Object.assign({...a},{value:Math.max(i,e.min)})),u=new Y(Object.assign({...a},{value:Math.min(a.value.end,e.max)})),p={start:o,end:u},m=a.value.estimate;return m&&(p.estimate=m),p}else return new Y(a)}}class pn extends xr{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class W extends xt{constructor(t,e=new M(l.month.name,1,41,l.day,new pn)){super(t,e)}static fromString(t,e=h.get(W)){const r=e.parse(t),a=r.value.start;if(a!==void 0){const i=l.month,o=new W(Object.assign({...r},{value:Math.max(a,i.min)})),u=new W(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new W(r)}toString(t){return super.toString(t).padStart(2,"0")}}class X extends xt{constructor(t,e=l.day){super(t,e)}static fromString(t,e=h.get(X)){const r=e.parse(t),a=r.value.start;if(a!==void 0){const i=l.day,o=new X(Object.assign({...r},{value:Math.max(a,i.min)})),u=new X(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new X(r)}toString(t){return super.toString(t).padStart(2,"0")}}class O extends xt{constructor(t,e=l.hour){super(t,e)}static fromString(t,e=h.get(O)){const r=e.parse(t),a=r.value.start;if(a!==void 0){const i=l.hour,o=new O(Object.assign({...r},{value:Math.max(a,i.min)})),u=new O(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new O(r)}}class Z extends xt{constructor(t,e=l.minute){super(t,e)}static fromString(t,e=h.get(Z)){const r=e.parse(t),a=r.value.start;if(a!==void 0){const i=l.minute,o=new Z(Object.assign({...r},{value:Math.max(a,i.min)})),u=new Z(Object.assign({...r},{value:Math.min(r.value.end,i.max)}));return{start:o,end:u}}else return new Z(r)}}class J extends xt{constructor(t,e=l.second){super(t,e)}static fromString(t,e=l.second,r=h.get(J)){const a=r.parse(t),i=a.value.start;if(i!==void 0){const o=new J(Object.assign({...a},{value:Math.max(i,e.min)})),u=new J(Object.assign({...a},{value:Math.min(a.value.end,e.max)}));return{start:o,end:u}}else return new J(a,e)}}class Nr extends ct{}class hn extends Jt{qualifier(){return""}}class D extends Lt{static instance=new D;static valueRenderer=new hn(q.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const r=t[e],a=D.names.slice(D.names.indexOf(e)+1).map(u=>t[u]).filter(Boolean),i=D.qualifier(r.uncertainComponent,r.approximateComponent),o=D.qualifier(r.uncertainGroup&&!r.uncertainComponent&&!a.some(u=>u.uncertain),r.approximateGroup&&!r.approximateComponent&&!a.some(u=>u.approximate));return i+r.toString(D.valueRenderer)+o}}class Er extends ge{constructor(t){super(t)}newYear(t){return new Y(t,this.units.year)}newMonth(t){return new W(t,this.units.month)}newDay(t){return new X(t,this.units.day)}newHour(t){return new O(t,this.units.hour)}newMinute(t){return new Z(t,this.units.minute)}newSecond(t){return new J(t,this.units.second)}newMillisecond(t){return new at(t,this.units.millisecond)}newTimeshift(t){return new Nr(typeof t=="number"?t:t.value)}}const dn=new Er(le),ln=new Er(Zt);class k extends ${constructor(t){super(t)}toString(t=D.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return dn}static fromDate(t){return new k({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:R.timeshiftOf(t)})}static fromString(t,e=h.get(k)){const r=e.parse(t);return new k(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return k.fromString(r)}clone(){return new k(this.toSpec())}}class K{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new j(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new it(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class ht extends te{static instance=new ht;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=ht.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let r=e+"P";for(const[a,i]of ht.designators){const o=t.components[a];o&&(r+=ht.qualifier(o.uncertainComponent,o.approximateComponent)+o.value+i)}return r}}class E extends T{#t;constructor(t){if(super(typeof t=="number"?t:{value:E.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},Zt.millisecond),typeof t!="number"){const e={};for(const r of E.componentNames)t[r]instanceof U&&(e[r]=t[r]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return E.getValue(t,A.year)+E.getValue(t,A.month)+E.getValue(t,A.day)+E.getValue(t,A.hour)+E.getValue(t,A.minute)+E.getValue(t,A.second)}static toSpec(t,e=ln){const r=T.toSpec(t,e);if(t instanceof E&&t.hasQualifiedComponent)for(const a of E.componentNames)delete r[a],t.components[a]&&(r[a]=t.components[a]);return r}static fromString(t,e=h.get(E)){const r=e.parse(t);return new E(r)}static between(t,e){const r=e.getTime(),a=t.getTime();return new E(r-a)}toSpec(){return E.toSpec(this)}toString(t=ht.instance){return super.toString(t)}}class At extends Tt{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=k.fromString(t)),t&&!(t instanceof k)&&!(t instanceof E))throw new j("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=k.fromString(t)),t&&!(t instanceof k)&&!(t instanceof E))throw new j("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=h.get(At)){const{start:r,end:a}=e.parse(t);return new At(r,a)}}class It extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const r of this)if(r.toString()===e)return!0;return!1}static fromString(t,e=h.get(It)){const{exclusive:r,values:a}=e.parse(t);return new It(a,r)}}class Q extends K{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return Q.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new j(`${this.name} cannot be negative`);return super.parse(t)}}class s{static groupName(...t){return t.reduce((e,r)=>e?e+r.charAt(0).toUpperCase()+r.substring(1):r,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return s.optional(s.group(t,...e))}static optionalNonCapturingGroup(...t){return s.optional(s.nonCapturingGroup(...t))}static numberGroup(t,e,r,a="\\d"){return s.group(t,`${r||""}[${a}]${e}`)}}const Ne="yearValue";class Rt extends Q{static format(t=""){return s.numberGroup(s.groupName(t,Ne),"{4}",void 0)}constructor(){super(Ne,Rt.format())}}const Ee="monthValue";class Ft extends Q{static format(t=""){return s.numberGroup(s.groupName(t,Ee),"{1,2}",void 0)}constructor(){super(Ee,Ft.format())}}const Te="dayValue";class dt extends Q{static format(t=""){return s.numberGroup(s.groupName(t,Te),"{1,2}",void 0)}constructor(){super(Te,dt.format())}}const Ae="hourValue";class lt extends Q{static format(t=""){return s.numberGroup(s.groupName(t,Ae),"{1,2}",void 0)}constructor(){super(Ae,lt.format())}}const Re="minuteValue";class Vt extends Q{static format(t=""){return s.numberGroup(s.groupName(t,Re),"{1,2}",void 0)}constructor(){super(Re,Vt.format())}}const Fe="secondValue";class $t extends Q{static format(t=""){return s.numberGroup(s.groupName(t,Fe),"{1,2}",void 0)}constructor(){super(Fe,$t.format())}}const Ve="timeshiftValue",$e="shiftHour",ke="shiftMinute";class Gt extends K{static format(t=""){return be.map(e=>e.name).join("|")+"|"+s.nonCapturingGroup(s.group(t+$e,s.numberGroup(s.groupName(t,Ve),"{2}","[+-]")),s.optionalNonCapturingGroup(":?",s.numberGroup(s.groupName(t,ke),"{2}",void 0)))}constructor(){super(Ve,Gt.format())}parse(t,e){let r=0;const a=be.find(i=>i.name===t);if(a){if(typeof a.timeshift=="function")try{return a.timeshift(e??{})}catch(i){throw new j(`The time zone ${t} depends on the date: ${i.message}`)}t=a.timeshift}if(t!=="Z"){const i=this.regexGroups(t),o=i[$e];o&&(r+=parseInt(o,10)*60);const u=i[ke];u&&(r+=parseInt(u,10))}return r}}const je="year",ve="month",ze="day",He="hour",Be="minute",Ue="second",qe="millisecond",Ce="timeshift";class ot extends K{static format(t=""){return s.group(s.groupName(t,je),Rt.format(t))+s.optionalNonCapturingGroup("-",s.group(s.groupName(t,ve),Ft.format(t)),s.optionalNonCapturingGroup("-",s.group(s.groupName(t,ze),dt.format(t)),s.optionalNonCapturingGroup("[T ]",s.group(s.groupName(t,He),lt.format(t)),":?",s.group(s.groupName(t,Be),Vt.format(t)),s.optionalNonCapturingGroup(":",s.group(s.groupName(t,Ue),$t.format(t)),s.optionalNonCapturingGroup("[.,]",s.group(s.groupName(t,qe),"\\d+"))),"\\s*",s.optionalGroup(s.groupName(t,Ce),Gt.format(t)))))}constructor(){super("date",ot.format())}parse(t){const e=this.regexGroups(t),r=e[je],a=e[ve],i=e[ze],o=e[He],u=e[Be],p=e[Ue],m=e[qe],w=e[Ce],f=r?new ft(Rt.read(r)):void 0,b=a?Ft.read(a):void 0;return{year:f,month:b?new gt(b,pt.create(b.value,f?.value)):void 0,day:i?new wt(dt.read(i)):void 0,hour:o?new St(lt.read(o)):void 0,minute:u?new yt(Vt.read(u)):void 0,second:p?new Mt($t.read(p)):void 0,millisecond:m?at.parseFraction(m):void 0,timeshift:w?st.fromString(w,new Gt,{year:f?.value,month:b?.value,day:i?dt.read(i).value:void 0,hour:o?lt.read(o).value:void 0}):void 0}}}const Ye="years",re="months",fn="days",We="hours",Xe="minutes",Oe="seconds";class Se extends K{static format(t=""){return"P"+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,Ye),"+",void 0,"\\d"),"Y")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,re),"+",void 0,"\\d"),"MM")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,fn),"+",void 0,"\\d"),"D")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,We),"+",void 0,"\\d"),"H")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,Xe),"+",void 0,"\\d"),"M")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,Oe),"+",void 0,"\\d"),"S")}constructor(){super("duration",Se.format())}parseGroups(t){return{years:t[Ye],months:t[re],days:t[re],hours:t[We],minutes:t[Xe],seconds:t[Oe]}}}const ne="start",se="end";class ye extends K{static format=s.group(ne,ot.format(ne))+"/"+s.group(se,ot.format(se));constructor(){super("interval",ye.format)}parse(t){const e=this.regexGroups(t),r=e[ne],a=e[se];return{start:r?R.fromString(r,new ot):void 0,end:a?R.fromString(a,new ot):void 0}}}class G extends Q{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=G.uncertainGroup+G.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return s.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(s.groupName(G.uncertainGroup,t),"?")+this.qualifierFormat(s.groupName(G.approximateGroup,t),"~")+this.qualifierFormat(s.groupName(G.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,r){return s.numberGroup(t,e,r,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],r;return e.charAt(0)==="-"?(r=-1,e=e.substring(1)):r=1,{valueStr:e,sign:r}}parseGroups(t){const{valueStr:e,sign:r}=this.getValueAndSign(t);let a=0,i;for(i=0;i<e.length;i++){const m=e[i];if(m==="X")break;a=a*10+parseInt(m,10)}if(i<e.length){let m=1;for(let b=0;b<e.length-i;b++)m*=10;const w=r*a*m,f=w+m-1;a={start:w,end:f}}else a*=r;const o=t[s.groupName(G.uncertainAndApproximateGroup,this.name)],u=t[s.groupName(G.approximateGroup,this.name)]||o,p=t[s.groupName(G.uncertainGroup,this.name)]||o;return{value:a,approximate:u?!!u:!1,uncertain:p?!!p:!1}}}const Ze="yearValue";class kt extends G{constructor(){super(Ze,kt.format())}static format(t=""){return"Y?"+G.numberFormat(s.groupName(t,Ze),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Je="monthValue";class jt extends G{static format(t=""){return G.numberFormat(s.groupName(t,Je),"{1,2}",void 0)}constructor(){super(Je,jt.format())}}const Ke="dayValue";class vt extends G{static format(t=""){return G.numberFormat(s.groupName(t,Ke),"{1,2}",void 0)}constructor(){super(Ke,vt.format())}}const Qe="hourValue";class zt extends G{static format(t=""){return G.numberFormat(s.groupName(t,Qe),"{1,2}",void 0)}constructor(){super(Qe,zt.format())}}const Ie="minuteValue";class Ht extends G{static format(t=""){return G.numberFormat(s.groupName(t,Ie),"{1,2}",void 0)}constructor(){super(Ie,Ht.format())}}const De="secondValue";class Bt extends G{static format(t=""){return G.numberFormat(s.groupName(t,De),"{1,2}",void 0)}constructor(){super(De,Bt.format())}}class Ut extends Gt{}class x extends K{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=x.format()){super("date",t)}static format(t=""){return s.group(s.groupName(t,x.yearGroup),kt.format(t))+s.optionalNonCapturingGroup("-",s.group(s.groupName(t,x.monthGroup),jt.format(t)),s.optionalNonCapturingGroup("-",s.group(s.groupName(t,x.dayGroup),vt.format(t)),s.optionalNonCapturingGroup("[T ]",s.group(s.groupName(t,x.hourGroup),zt.format(t)),":",s.group(s.groupName(t,x.minuteGroup),Ht.format(t)),s.optionalNonCapturingGroup(":",s.group(s.groupName(t,x.secondGroup),Bt.format(t)),s.optionalNonCapturingGroup("[.,]",s.group(s.groupName(t,x.millisecondGroup),"\\d+"))),s.optionalGroup(s.groupName(t,x.timeshiftGroup),Ut.format(t)))))}parseGroups(t){const e=t[x.millisecondGroup],r=e?at.parseFraction(e):void 0,a=t[x.secondGroup],i=a?nt.fromString(a,new Bt):void 0,o=t[x.minuteGroup];let u;o&&(u=rt.fromString(o,new Ht),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[x.hourGroup];let m;p&&(m=et.fromString(p,new zt),m.uncertain=m.uncertain||u?.uncertain||!1,m.approximate=m.approximate||u?.approximate||!1);const w=t[x.dayGroup];let f;w&&(f=tt.fromString(w,new vt),f.uncertain=f.uncertain||m?.uncertain||!1,f.approximate=f.approximate||m?.approximate||!1);const b=t[x.monthGroup];let S;b&&(S=_.fromString(b,new jt),S.uncertain=S.uncertain||f?.uncertain||!1,S.approximate=S.approximate||f?.approximate||!1);const z=t[x.yearGroup];let N;z&&(N=L.fromString(z,void 0,new kt),N.uncertain=N.uncertain||S?.uncertain||!1,N.approximate=N.approximate||S?.approximate||!1);const C=t[x.timeshiftGroup],I=C?ct.fromString(C,new Ut,{year:N?.value,month:S?.value,day:f?.value,hour:m?.value}):void 0;return{year:N,month:S,day:f,hour:m,minute:u,second:i,millisecond:r,timeshift:I}}}const Pe="years",Le="months",_e="days",tr="hours",er="minutes",rr="seconds";class ut extends G{static format(t=""){return"P"+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,Pe),"+",void 0,"\\d"),"Y")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,Le),"+",void 0,"\\d"),"MM")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,_e),"+",void 0,"\\d"),"D")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,tr),"+",void 0,"\\d"),"H")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,er),"+",void 0,"\\d"),"M")+s.optionalNonCapturingGroup(s.numberGroup(s.groupName(t,rr),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",ut.format())}parseGroups(t){return{years:t[Pe],months:t[Le],days:t[_e],hours:t[tr],minutes:t[er],seconds:t[rr],uncertain:!!t[G.uncertainGroup],approximate:!!t[G.approximateGroup]}}}const gn="dates",ae="start",ie="end",nr="durations",oe="durationMin",ue="durationMax";class Me extends K{static format=s.group(gn,s.optionalGroup(ae,s.group("openStart","\\.\\.")+"|"+x.format(ae))+"/"+s.optionalGroup(ie,s.group("openEnd","\\.\\.")+"|"+x.format(ie)))+"|"+s.group(nr,s.group(oe,ut.format(oe))+"/"+s.group(ue,ut.format(ue)));constructor(t="interval",e=Me.format){super(t,e)}parseGroups(t){let e,r;if(t[nr]){const i=t[oe];e=T.fromString(i,new ut);const o=t[ue];r=T.fromString(o,new ut)}else{const i=t[ae];switch(i){case void 0:e=null;break;case"..":e=void 0;break;default:e=$.fromString(i,new x)}const o=t[ie];switch(o){case void 0:r=null;break;case"..":r=void 0;break;default:r=$.fromString(o,new x)}}return{start:e,end:r}}}class g extends G{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=g.uncertainGroup+g.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,r){return this.qualifierFormat(s.groupName(g.uncertainGroup,t),"?")+this.qualifierFormat(s.groupName(g.approximateGroup,t),"~")+this.qualifierFormat(s.groupName(g.uncertainAndApproximateGroup,t),"%")+G.numberFormat(t,e,r)}parseGroups(t){const e=super.parseGroups(t),r=t[s.groupName(g.uncertainAndApproximateGroup,this.name)];return(t[s.groupName(g.uncertainGroup,this.name)]||r)&&(e.uncertainComponent=!0),(t[s.groupName(g.approximateGroup,this.name)]||r)&&(e.approximateComponent=!0),e}}const bt="yearValue",sr="exp",ar="signif";class qt extends g{constructor(){super(bt,qt.format())}static format(t=""){return"Y?"+s.nonCapturingGroup(s.group(s.groupName(t,sr),"[-]?\\d+E\\d+")+"|"+g.numberFormat(s.groupName(t,bt),"+","[-]?")+s.optionalGroup(s.groupName(t,ar),"S\\d+"))}parseGroups(t){const e=t[sr];if(e){const o=e.indexOf("E"),u=parseInt(e.substring(o+1),10),m=parseInt(e.substring(0,o),10)*Math.pow(10,u);t[bt]=m.toString()}const r=t[ar],a=t[bt];if(r){const o=parseInt(r.substring(1),10),{valueStr:u,sign:p}=this.getValueAndSign(t);let m="";for(let w=0;w<u.length;w++)m+=w<o?u.charAt(w):"X";t[bt]=(p<0?"-":"")+m}const i=super.parseGroups(t);return r&&(i.value.estimate=parseInt(a,10)),i}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const ir="monthValue";class Ct extends g{static format(t=""){return g.numberFormat(s.groupName(t,ir),"{1,2}",void 0)}constructor(){super(ir,Ct.format())}}const or="dayValue";class Yt extends g{static format(t=""){return g.numberFormat(s.groupName(t,or),"{1,2}",void 0)}constructor(){super(or,Yt.format())}}const ur="hourValue";class Wt extends g{static format(t=""){return g.numberFormat(s.groupName(t,ur),"{1,2}",void 0)}constructor(){super(ur,Wt.format())}}const cr="secondValue";class Xt extends g{static format(t=""){return g.numberFormat(s.groupName(t,cr),"{1,2}",void 0)}constructor(){super(cr,Xt.format())}}const mr="minuteValue";class Ot extends g{static format(t=""){return g.numberFormat(s.groupName(t,mr),"{1,2}",void 0)}constructor(){super(mr,Ot.format())}}class wn extends Ut{}class y extends K{static yearGroup=x.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",y.format())}static format(t=""){return s.group(s.groupName(t,y.yearGroup),qt.format(t))+s.optionalNonCapturingGroup("-",s.group(s.groupName(t,y.monthGroup),Ct.format(t)),s.optionalNonCapturingGroup("-",s.group(s.groupName(t,y.dayGroup),Yt.format(t)),s.optionalNonCapturingGroup("[T ]",s.group(s.groupName(t,y.hourGroup),Wt.format(t)),":",s.group(s.groupName(t,y.minuteGroup),Ot.format(t)),s.optionalNonCapturingGroup(":",s.group(s.groupName(t,y.secondGroup),Xt.format(t)),s.optionalNonCapturingGroup("[.,]",s.group(s.groupName(t,y.millisecondGroup),"\\d+"))),s.optionalGroup(s.groupName(t,y.timeshiftGroup),wn.format(t)))))}parseGroups(t){const e=t[y.millisecondGroup],r=e?at.parseFraction(e):void 0,a=t[y.secondGroup];let i;a&&(i=J.fromString(a,void 0,new Xt),i.uncertain=i?.uncertain||!1,i.approximate=i?.approximate||!1);const o=t[y.minuteGroup];let u;o&&(u=Z.fromString(o,new Ot),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[y.hourGroup];let m;p&&(m=O.fromString(p,new Wt),m.uncertain=m.uncertain||u?.uncertain||!1,m.approximate=m.approximate||u?.approximate||!1);const w=t[y.dayGroup];let f;w&&(f=X.fromString(w,new Yt),f.uncertain=f.uncertain||m?.uncertain||!1,f.approximate=f.approximate||m?.approximate||!1);const b=t[y.monthGroup];let S;b&&(S=W.fromString(b,new Ct),S.uncertain=S.uncertain||f?.uncertain||!1,S.approximate=S.approximate||f?.approximate||!1);const z=t[y.yearGroup];let N;z&&(N=Y.fromString(z,void 0,new qt),N.uncertain=N.uncertain||S?.uncertain||!1,N.approximate=N.approximate||S?.approximate||!1);const C=t[y.timeshiftGroup],I=C?Nr.fromString(C,new Ut,{year:N?.value,month:S?.value,day:f?.value,hour:m?.value}):void 0;return{year:N,month:S,day:f,hour:m,minute:u,second:i,millisecond:r,timeshift:I}}}const pr="durationValue";class Ge extends g{static format(t=""){return"^"+g.numberFormat(s.groupName(t,pr),"+",void 0)}constructor(){super(pr,Ge.format())}}class Sn extends fe{millisecond=new M("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new M("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new M("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new M("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new M("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new M("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new M("year",0,Number.MAX_SAFE_INTEGER,this.month)}const mt=new Sn;class d extends g{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new Ge;static componentFormat(t,e,r,a,i=""){const o=s.group(s.groupName(t,d.quantityGroup(e)),g.numberFormat(s.groupName(t,r),"+",void 0,"\\d"));return s.group(s.groupName(t,e),o,a,i)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",d.format())}static format(t=""){const e=s.groupName(t,d.durationGroup);return this.qualifierFormat(s.groupName(g.uncertainGroup,e),"?")+this.qualifierFormat(s.groupName(g.approximateGroup,e),"~")+this.qualifierFormat(s.groupName(g.uncertainAndApproximateGroup,e),"%")+"P"+s.optional(d.componentFormat(t,d.yearsGroup,y.yearGroup,"Y"))+s.optionalNonCapturingGroup(d.componentFormat(t,d.monthsGroup,y.monthGroup,"MM")+"|"+d.componentFormat(t,d.isoMonthsGroup,"isoMonth","M",d.isoMonthsLookahead))+s.optional(d.componentFormat(t,d.daysGroup,y.dayGroup,"D"))+"T?"+s.optional(d.componentFormat(t,d.hoursGroup,y.hourGroup,"H"))+s.optional(d.componentFormat(t,d.minutesGroup,y.minuteGroup,"M"))+s.optional(d.componentFormat(t,d.secondsGroup,y.secondGroup,"S"))+s.optionalGroup(s.groupName(t,d.suffixGroup),"[?~%]")}static parseComponent(t,e,r){const a=d.componentParser.parse(t);return new e(a,r)}parseGroups(t){const e=t[d.quantityGroup(d.secondsGroup)];let r;e&&(r=d.parseComponent(e,J,mt.second),r.uncertain=!!t[s.groupName(g.uncertainGroup,d.secondsGroup)]||!1,r.approximate=!!t[s.groupName(g.approximateGroup,d.secondsGroup)]||!1);const a=t[d.quantityGroup(d.minutesGroup)];let i;a&&(i=d.parseComponent(a,Z,mt.minute),i.uncertain=i.uncertain||r?.uncertain||!1,i.approximate=i.approximate||r?.approximate||!1);const o=t[d.quantityGroup(d.hoursGroup)];let u;o&&(u=d.parseComponent(o,O,mt.hour),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[d.quantityGroup(d.daysGroup)];let m;p&&(m=d.parseComponent(p,X,mt.day),m.uncertain=m.uncertain||u?.uncertain||!1,m.approximate=m.approximate||u?.approximate||!1);const w=t[d.quantityGroup(d.monthsGroup)]||t[d.quantityGroup(d.isoMonthsGroup)];let f;w&&(f=d.parseComponent(w,W,mt.month),f.uncertain=f.uncertain||m?.uncertain||!1,f.approximate=f.approximate||m?.approximate||!1);const b=t[d.quantityGroup(d.yearsGroup)];let S;b&&(S=d.parseComponent(b,Y,mt.year),S.uncertain=S.uncertain||f?.uncertain||!1,S.approximate=S.approximate||f?.approximate||!1);const z=t[d.suffixGroup],N=!!t[s.groupName(g.uncertainAndApproximateGroup,d.durationGroup)]||z==="%",C=N||!!t[s.groupName(g.uncertainGroup,d.durationGroup)]||z==="?",I=N||!!t[s.groupName(g.approximateGroup,d.durationGroup)]||z==="~";return{years:S,months:f,days:m,hours:u,minutes:i,seconds:r,uncertain:C,approximate:I}}}const yn="dates",ce="start",me="end",hr="durations",pe="durationMin",he="durationMax";class ee extends K{static format=s.group(yn,s.optionalGroup(ce,s.group("openStart","\\.\\.")+"|"+y.format(ce))+"/"+s.optionalGroup(me,s.group("openEnd","\\.\\.")+"|"+y.format(me)))+"|"+s.group(hr,s.group(pe,d.format(pe))+"/"+s.group(he,d.format(he)));constructor(t="interval",e=ee.format){super(t,e)}parseGroups(t){let e,r;if(t[hr]){const i=t[pe];e=E.fromString(i,new d);const o=t[he];r=E.fromString(o,new d)}else{const i=t[ce];switch(i){case void 0:e=null;break;case"..":e=void 0;break;default:e=k.fromString(i,new y)}const o=t[me];switch(o){case void 0:r=null;break;case"..":r=void 0;break;default:r=k.fromString(o,new y)}}return{start:e,end:r}}}class Mn{parse(t){t=t.trim();const e=t.startsWith("["),a=t.substring(1,t.length-1).split(","),i=[];for(const o of a){let u;o.includes("..")?u=At.fromString(o.replace("..","/"),new ee):u=k.fromString(o,new y),i.push(u)}return{values:i,exclusive:e}}}class c{static draw(t,e="none"){return`<svg class="icon" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="${e}" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">${t}</svg>`}static TRASH=c.draw('<path d="M2.5 4.5h11"/><path d="M6 4.5V3h4v1.5"/><path d="M4 4.5l.7 9h6.6l.7-9"/><path d="M6.8 7v4.5M9.2 7v4.5"/>');static TARGET=c.draw('<circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.6"/><path d="M8 1v2.2M8 12.8V15M1 8h2.2M12.8 8H15"/>');static PLAY=c.draw('<path d="M5 3.2v9.6L12.6 8z"/>',"currentColor");static PAUSE=c.draw('<path d="M5.5 3.5v9M10.5 3.5v9"/>');static RECORD=c.draw('<circle cx="8" cy="8" r="4.2" fill="var(--error, #d93025)" stroke="none"/>');static STOP=c.draw('<rect x="4" y="4" width="8" height="8" rx="1.2"/>',"currentColor");static PREVIOUS_MARK=c.draw('<path d="M6.5 4 2.5 8l4 4"/><path d="M11 5.2 13.8 8 11 10.8 8.2 8z"/>');static NEXT_MARK=c.draw('<path d="M9.5 4l4 4-4 4"/><path d="M5 5.2 7.8 8 5 10.8 2.2 8z"/>');static CLOSE=c.draw('<path d="M4 4l8 8M12 4l-8 8"/>');static PLUS=c.draw('<path d="M8 3v10M3 8h10"/>');static COPY=c.draw('<rect x="5.5" y="5.5" width="8" height="8" rx="1.3"/><path d="M10.5 3.2h-7a1.3 1.3 0 0 0-1.3 1.3v7"/>');static CLOCK=c.draw('<circle cx="8" cy="8" r="6"/><path d="M8 4.6V8l2.4 1.6"/>');static INTERVIEW=c.draw('<path d="M13.3 9.2a1.6 1.6 0 0 1-1.6 1.6H6.2L3 13.4V4.4a1.6 1.6 0 0 1 1.6-1.6h7.1a1.6 1.6 0 0 1 1.6 1.6z"/><path d="M5.8 6.1h5.1M5.8 8.4h3.2"/>');static LOCK=c.draw('<rect x="3.2" y="7.2" width="9.6" height="6.4" rx="1.4"/><path d="M5.6 7.2V5.4a2.4 2.4 0 0 1 4.8 0v1.8"/>');static LOCK_OPEN=c.draw('<rect x="3.2" y="7.2" width="9.6" height="6.4" rx="1.4"/><path d="M5.6 7.2V5.4a2.4 2.4 0 0 1 4.6-.7"/>');static METEOR=c.draw('<path d="M2.5 2.5l7 7"/><path d="M5.5 2.5l5 5"/><circle cx="11.5" cy="11.5" r="2"/>');static COMET=c.draw('<circle cx="11" cy="11" r="2.4"/><path d="M9.3 9.3 2.5 2.5M9 11.2 3 7M11.2 9 7 3"/>');static STAR=c.draw('<path d="M8 2.2l1.7 3.6 3.9.5-2.9 2.7.8 3.9L8 11l-3.5 1.9.8-3.9-2.9-2.7 3.9-.5z"/>');static SATELLITE=c.draw('<rect x="6.3" y="6.3" width="3.4" height="3.4" transform="rotate(45 8 8)"/><path d="M5.4 5.4 3 3M10.6 10.6 13 13"/><path d="M1.8 4.2 4.2 1.8M11.8 14.2l2.4-2.4"/><path d="M10.5 3.5a3 3 0 0 1 2 2"/>');static FIREBALL=c.draw('<circle cx="10.5" cy="10.5" r="2.6"/><path d="M8.6 8.6 3 3M8 10.6 4.5 8.5M10.6 8 8.5 4.5"/>');static SUMMARY=c.draw('<rect x="3" y="2" width="10" height="12" rx="1.5"/><path d="M5.5 5.5h5M5.5 8h5M5.5 10.5h3"/>');static WITNESS=c.draw('<circle cx="8" cy="5" r="2.6"/><path d="M2.8 14c.6-3 2.6-4.6 5.2-4.6s4.6 1.6 5.2 4.6"/>');static LOCATION=c.draw('<path d="M8 14.3s4.5-4.3 4.5-7.8a4.5 4.5 0 0 0-9 0c0 3.5 4.5 7.8 4.5 7.8z"/><circle cx="8" cy="6.5" r="1.6"/>');static DATE=c.draw('<rect x="2.3" y="3.3" width="11.4" height="10.4" rx="1.5"/><path d="M2.3 6.6h11.4M5.3 1.8v2.8M10.7 1.8v2.8"/>');static ENVIRONMENT=c.draw('<path d="M1.5 14h13"/><path d="M2.8 14V8.3L6.3 5.5l3.5 2.8V14"/><path d="M12.2 14V9.4"/><circle cx="12.2" cy="7.4" r="2.1"/>');static SKY=c.draw('<path d="M4.6 12.5h7a2.6 2.6 0 0 0 .3-5.2 3.8 3.8 0 0 0-7.3-.6 2.9 2.9 0 0 0 0 5.8z"/>');static PHENOMENON=c.draw('<ellipse cx="8" cy="9" rx="6.3" ry="2.1"/><path d="M4.6 7.8a3.4 3.4 0 0 1 6.8 0"/><path d="M5 13.4l.6-1.4M11 13.4l-.6-1.4M8 14v-1.4"/>');static SOUND=c.draw('<path d="M2.5 6.2h2.3L8 3.5v9L4.8 9.8H2.5z"/><path d="M10.5 6a2.8 2.8 0 0 1 0 4M12.3 4.2a5.4 5.4 0 0 1 0 7.6"/>');static PICTURES=c.draw('<rect x="2" y="3" width="12" height="10" rx="1.5"/><circle cx="5.8" cy="6.4" r="1.2"/><path d="M2.5 12l3.8-3.6 2.4 2.2 2.2-1.8 2.6 2.5"/>');static FILES=c.draw('<path d="M4 1.8h5.2L12.5 5v9.2H4z"/><path d="M9 1.8V5.2h3.5"/>');static RAIN=c.draw('<path d="M4.6 9.3h6.6a2.3 2.3 0 0 0 .3-4.6 3.4 3.4 0 0 0-6.5-.5 2.6 2.6 0 0 0-.4 5.1z"/><path d="M5.6 11.3l-.8 2.2M8.3 11.3l-.8 2.2M11 11.3l-.8 2.2"/>');static WIND=c.draw('<path d="M2 6.2h8.3a2 2 0 1 0-2-2"/><path d="M2 9.6h10.3a1.9 1.9 0 1 1-1.9 1.9"/><path d="M2 13h4.5"/>');static AIRCRAFT=c.draw('<path d="M8 1.8c.6 0 .9.8.9 1.8v3l5.1 2.9v1.3L8.9 9.4v2.8l1.6 1.2v1.1L8 13.8l-2.5.7v-1.1l1.6-1.2V9.4L2 10.8V9.5l5.1-2.9v-3c0-1 .3-1.8.9-1.8z"/>');static LANTERN=c.draw('<path d="M5.2 4.6h5.6l-.9 7.2H6.1z"/><path d="M6.5 4.6V3h3v1.6"/><path d="M8 11.8v2.4"/><path d="M8 7.2c.7.6.7 1.5 0 2.1-.7-.6-.7-1.5 0-2.1z"/>');static BIRD=c.draw('<path d="M1.8 7.8c2-1.8 4-1.6 6.2.9 2.2-2.5 4.2-2.7 6.2-.9"/>');static DRONE=c.draw('<rect x="6" y="6.5" width="4" height="3" rx=".8"/><path d="M6 7 3.8 4.8M10 7l2.2-2.2M6 9l-2.2 2.2M10 9l2.2 2.2"/><path d="M2 4.8h3.6M10.4 4.8H14M2 11.2h3.6M10.4 11.2H14"/>');static LAUNCH=c.draw('<path d="M8 1.8c2 1.6 3 3.9 3 6.6V11H5V8.4c0-2.7 1-5 3-6.6z"/><path d="M5 9.2 3.2 11v2.2L5 12M11 9.2l1.8 1.8v2.2L11 12"/><path d="M7 13.2 8 15l1-1.8"/><circle cx="8" cy="6.5" r="1.1"/>');static BEAM=c.draw('<path d="M7.4 12.6 4.2 2M8.6 12.6 11.8 2"/><path d="M6.2 12.6h3.6v1.8H6.2z"/>');static SHAPES=c.draw('<circle cx="5.6" cy="6" r="3.2"/><rect x="8.2" y="8.2" width="5.8" height="5.8" rx="1"/>');static BODIES=c.draw('<path d="M8 1.8 13.5 4.8v6.4L8 14.2 2.5 11.2V4.8z"/><path d="M2.5 4.8 8 7.8l5.5-3M8 7.8v6.4"/>');static ID_CARD=c.draw('<rect x="2" y="3.5" width="12" height="9" rx="1.5"/><circle cx="5.8" cy="7.2" r="1.4"/><path d="M3.8 10.8c.4-1.1 1.1-1.6 2-1.6s1.6.5 2 1.6M9.5 6.5h3M9.5 9h2.5"/>');static STRANGE=c.draw('<circle cx="8" cy="8" r="6"/><path d="M6.3 6.3a1.8 1.8 0 1 1 2.5 1.7c-.5.2-.8.6-.8 1.1v.4"/><path d="M8 11.6v.1"/>');static EYE=c.draw('<path d="M1.5 8s2.4-4.3 6.5-4.3S14.5 8 14.5 8 12.1 12.3 8 12.3 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/>');static PERCEPTION=c.draw('<circle cx="8" cy="8" r="2"/><path d="M8 2v2M8 12v2M2 8h2M12 8h2M3.8 3.8l1.4 1.4M10.8 10.8l1.4 1.4M3.8 12.2l1.4-1.4M10.8 5.2l1.4-1.4"/>');static GAUGE=c.draw('<path d="M2.5 11a5.5 5.5 0 0 1 11 0"/><path d="M8 11l2.6-3.2"/><circle cx="8" cy="11" r=".9"/>');static HAZE=c.draw('<path d="M2 5.5h12M3.5 8.5h9M2 11.5h12"/>');static MOON=c.draw('<path d="M10.8 2.6a5.6 5.6 0 1 0 2.6 9.6 4.6 4.6 0 0 1-2.6-9.6z"/>');static SLIDERS=c.draw('<path d="M2.5 4h11M2.5 8h11M2.5 12h11"/><circle cx="6" cy="4" r="1.3" fill="var(--ground-raised, Canvas)"/><circle cx="10.5" cy="8" r="1.3" fill="var(--ground-raised, Canvas)"/><circle cx="5" cy="12" r="1.3" fill="var(--ground-raised, Canvas)"/>');static GLOBE=c.draw('<circle cx="8" cy="8" r="6"/><path d="M2 8h12M8 2c1.8 1.7 2.6 3.7 2.6 6S9.8 12.3 8 14M8 2C6.2 3.7 5.4 5.7 5.4 8s.8 4.3 2.6 6"/>');static GAZE=c.draw('<circle cx="8" cy="8" r="6"/><path d="M10.6 5.4 9 9 5.4 10.6 7 7z"/>');static EVENTS=c.draw('<path d="M2 8h12"/><circle cx="4" cy="8" r="1.4"/><circle cx="8.5" cy="8" r="1.4"/><circle cx="12.5" cy="8" r="1.4"/>');static TOWN=c.draw('<path d="M1.5 13.5h13"/><path d="M3 13.5V9l2.5-2L8 9v4.5"/><path d="M10 13.5v-6h3.5v6"/>');static FLAG=c.draw('<path d="M4 14V2.5"/><path d="M4 3h7.5l-1.8 2.6L11.5 8.2H4"/>');static MIC=c.draw('<rect x="6" y="2" width="4" height="7.5" rx="2"/><path d="M3.8 7.8a4.2 4.2 0 0 0 8.4 0M8 12v2"/>');static CAMERA=c.draw('<path d="M2 5.5h2.6l1.2-1.8h4.4l1.2 1.8H14V13H2z"/><circle cx="8" cy="9" r="2.3"/>');static LANDMARK=c.draw('<path d="M1.5 13.5 6 5l3 5.2 1.6-2.4 3.9 5.7z"/>');static GHOST=c.draw('<path d="M8 2.2 13 5.1v5.8L8 13.8 3 10.9V5.1z"/>');static TRACE=c.draw('<path d="M2.5 12.5c2-4 4-1 6-4s3.5-3 5-5"/><circle cx="2.5" cy="12.5" r="1"/><circle cx="13.5" cy="3.5" r="1"/>');static APPEARANCE=c.draw('<path d="M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"/>');static RULER=c.draw('<rect x="1.8" y="5.5" width="12.4" height="5" rx="1"/><path d="M4.5 5.5v2M7 5.5v2.6M9.5 5.5v2M12 5.5v2.6"/>');static PATH=c.draw('<path d="M2.5 12C4 6 9 3.5 13 4"/><path d="M10.5 2.3 13 4l-2 2.3"/>');static IDEA=c.draw('<path d="M5.5 10.5a4 4 0 1 1 5 0c-.6.5-.9 1-.9 1.6v.4H6.4v-.4c0-.6-.3-1.1-.9-1.6z"/><path d="M6.5 14.2h3"/>');static section(t){return{"label-section-identity":c.ID_CARD,"label-section-profile":c.WITNESS,"label-section-testimony":c.INTERVIEW,"strangeness-section":c.STRANGE,"label-section-vision":c.EYE,"label-section-perception":c.PERCEPTION,"witness-conditions":c.GAUGE,"viewing-conditions":c.HAZE,"moon-gauge":c.MOON,"error-parameters":c.SLIDERS,"label-section-coordinates":c.GLOBE,"label-section-gaze":c.GAZE,"label-section-events":c.EVENTS,"label-section-night-sky":c.STAR,"around-section":c.TOWN,"label-section-survey":c.ENVIRONMENT,"label-section-period":c.DATE,"label-milestones":c.FLAG,"label-section-heard":c.SOUND,"label-section-sound-recording":c.MIC,"label-section-picture":c.PICTURES,"label-section-pose":c.CAMERA,"label-reference-landmarks":c.LANDMARK,"label-reference-ghosts":c.GHOST,"label-trace-import":c.TRACE,"label-section-appearance":c.APPEARANCE,"label-section-size":c.RULER,"label-section-path":c.PATH,"label-section-phenomenon-events":c.EVENTS,"label-section-bodies-events":c.EVENTS,candidates:c.IDEA}[t]}static part(t){return{"weather-precipitation":c.RAIN,"weather-clouds":c.SKY,"weather-wind":c.WIND,"weather-aircraft":c.AIRCRAFT,"interpretation-lanterns":c.LANTERN,"interpretation-birds":c.BIRD,"interpretation-drones":c.DRONE,"sky-event-launches":c.LAUNCH,"sky-event-beams":c.BEAM,"sky-event-reentries":c.FIREBALL,"shape-shapes":c.SHAPES,"shape-bodies":c.BODIES}[t]}static BY_GLYPH={"🗑":c.TRASH,"🎯":c.TARGET,"+":c.PLUS,"✕":c.CLOSE,"▶":c.PLAY,"⏸":c.PAUSE,"⏺":c.RECORD,"⏹":c.STOP};static show(t,e){if(t.dataset.icon===e&&t.firstChild)return;const r=c.BY_GLYPH[e];r?t.innerHTML=r:t.textContent=e,t.dataset.icon=e}static CSS=`
2
+ .icon { display: block; flex: none; }
3
+ button:has(> .icon:only-child) { display: inline-flex; align-items: center; justify-content: center; }
4
+ `}h.register(R,()=>new ot);h.register(wt,()=>new dt);h.register(H,()=>new Se);h.register(St,()=>new lt);h.register(Et,()=>new ye);h.register(yt,()=>new Vt);h.register(gt,()=>new Ft);h.register(Mt,()=>new $t);h.register(st,()=>new Gt);h.register(ft,()=>new Rt);h.register($,()=>new x);h.register(tt,()=>new vt);h.register(T,()=>new ut);h.register(et,()=>new zt);h.register(Tt,()=>new Me);h.register(rt,()=>new Ht);h.register(_,()=>new jt);h.register(nt,()=>new Bt);h.register(ct,()=>new Ut);h.register(L,()=>new kt);h.register(k,()=>new y);h.register(X,()=>new Yt);h.register(E,()=>new d);h.register(O,()=>new Wt);h.register(At,()=>new ee);h.register(Z,()=>new Ot);h.register(W,()=>new Ct);h.register(J,()=>new Xt);h.register(It,()=>new Mn);h.register(Y,()=>new qt);class P{constructor(t){this.preferences=t}read(t){var e,r;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const i of this.preferences){const o=(e=t[i])!==null&&e!==void 0?e:t[P.base(i)];if(o)return o}const a=new Set(this.preferences.map(i=>P.base(i)));for(const[i,o]of Object.entries(t))if(o&&a.has(P.base(i)))return o;return(r=Object.values(t).find(i=>i))!==null&&r!==void 0?r:void 0}write(t,e,r){var a,i;const o=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return o;const u={...t},p=(i=(a=Object.keys(u).find(m=>m===r))!==null&&a!==void 0?a:Object.keys(u).find(m=>P.base(m)===P.base(r)))!==null&&i!==void 0?i:r;return o===void 0?delete u[p]:u[p]=o,Object.keys(u).length===0?void 0:u}static base(t){return t.toLowerCase().split("-")[0]}}P.any=new P([]);var dr;(function(n){n.abductee="abductee",n.actor="actor",n.artist="artist",n.anthropologist="anthropologist",n.archeologist="archeologist",n.astronaut="astronaut",n.astronomer="astronomer",n.astrologist="astrologist",n.astrophysicist="astrophysicist",n.banker="banker",n.barman="barman",n.biologist="biologist",n.biochemist="biochemist",n.biophysicist="biophysicist",n.bishop="bishop",n.businessman="businessman",n.botanist="botanist",n.cameraman="cameraman",n.chemist="chemist",n.contactee="contactee",n.cryptozoologist="cryptozoologist",n.dentist="dentist",n.director="director",n.diplomat="diplomat",n.diver="diver",n.electronics="electronics",n.engineer="engineer",n.ethnologist="ethnologist",n.exobiologist="exobiologist",n.farmer="farmer",n.firefighter="firefighter",n.flightAttendant="flightAttendant",n.geologist="geologist",n.geophysicist="geophysicist",n.geographer="geographer",n.historian="historian",n.houseWife="houseWife",n.hypnotherapist="hypnotherapist",n.illusionist="illusionist",n.journalist="journalist",n.judge="judge",n.lawyer="lawyer",n.leader="leader",n.librarian="librarian",n.logger="logger",n.mathematician="mathematician",n.mechanic="mechanic",n.meteorologist="meteorologist",n.military="military",n.musician="musician",n.neurologist="neurologist",n.neuroscientist="neuroscientist",n.neuropsychiatrist="neuropsychiatrist",n.nurse="nurse",n.oceanographer="oceanographer",n.painter="painter",n.parapsychologist="parapsychologist",n.philosopher="philosopher",n.photographer="photographer",n.physician="physician",n.physicist="physicist",n.pilot="pilot",n.politician="politician",n.policeman="policeman",n.priest="priest",n.producer="producer",n.prospector="prospector",n.psychologist="psychologist",n.psychiatrist="psychiatrist",n.radioastronomer="radioastronomer",n.radioamateur="radioamateur",n.salesman="salesman",n.sailor="sailor",n.sociologist="sociologist",n.softwareEngineer="softwareEngineer",n.stuntman="stuntman",n.taxiDriver="taxiDriver",n.teacher="teacher",n.telegrapher="telegrapher",n.truckDriver="truckDriver",n.ufologist="ufologist",n.ufoWitness="ufoWitness",n.ufoWitness2="ufoWitness2",n.worker="worker",n.writer="writer"})(dr||(dr={}));var lr;(function(n){n.neutral="neutral",n.male="male",n.female="female"})(lr||(lr={}));class Gn extends Error{constructor(t,e){super(t),this.cause=e}}class xe extends Gn{constructor(t=xe.defaultMessage,e){super(t,e)}}xe.defaultMessage="Assertion failed";var fr;(function(n){n.country="country",n.region="region",n.department="department",n.city="city",n.company="company"})(fr||(fr={}));var gr;(function(n){n.at="at",n.au="au",n.ar="ar",n.be="be",n.br="br",n.ca="ca",n.ch="ch",n.cn="cn",n.cl="cl",n.co="co",n.cy="cy",n.de="de",n.dk="dk",n.do="do",n.dz="dz",n.gr="gr",n.ec="ec",n.eg="eg",n.es="es",n.fi="fi",n.fr="fr",n.ga="ga",n.ge="ge",n.hu="hu",n.in="in",n.ie="ie",n.ir="ir",n.il="il",n.it="it",n.jp="jp",n.kr="kr",n.ma="ma",n.mx="mx",n.my="my",n.mz="mz",n.nl="nl",n.no="no",n.nz="nz",n.pa="pa",n.pe="pe",n.ph="ph",n.pl="pl",n.pt="pt",n.ro="ro",n.ru="ru",n.sc="sc",n.tr="tr",n.ua="ua",n.uk="uk",n.us="us",n.sa="sa",n.se="se",n.su="su",n.tn="tn",n.tw="tw",n.ve="ve",n.za="za"})(gr||(gr={}));const Tr=Math.PI/180,Dt=111320;function xn(n,t,e,r){const a=Dt*Math.cos(e*Tr),i=(n-e)*Dt;return{x:(t-r)*a,z:-i}}function bn(n,t,e,r){const a=Dt*Math.cos(e*Tr),i=-t,o=n;return{lat:e+i/Dt,lng:r+o/a}}class v{static isRelative(t){return t!==void 0&&typeof t.eastM=="number"&&typeof t.northM=="number"}static isAbsolute(t){return t!==void 0&&typeof t.lat=="number"&&typeof t.lng=="number"}static referenceOf(t,e){return e.references.find(r=>(r.id??void 0)===(t.relativeTo??void 0))}static resolve(t,e){if(v.isRelative(t)){const r=v.referenceOf(t,e);return r?{eastM:r.eastM+t.eastM,northM:r.northM+t.northM}:void 0}return v.isAbsolute(t)&&e.origin?v.toLocal(t,e.origin):void 0}static restated(t,e,r){if(v.isRelative(t)){const i=v.referenceOf(t,r);return i?v.relative(e.eastM-i.eastM,e.northM-i.northM,t.relativeTo):void 0}if(!r.origin)return t;const a=v.toGeo(e,r.origin);return{lat:v.degrees(a.lat),lng:v.degrees(a.lng)}}static relative(t,e,r){const a={eastM:v.metres(t),northM:v.metres(e)};return r!==void 0&&(a.relativeTo=r),a}static toLocal(t,e){const r=xn(t.lat,t.lng,e.lat,e.lng);return{eastM:r.x,northM:-r.z}}static toGeo(t,e){return bn(t.eastM,-t.northM,e.lat,e.lng)}static metres(t){return Math.round(t*100)/100}static degrees(t){return Math.round(t*1e7)/1e7}}export{c as I,k as L,de as P,P as S,v as a,Nt as b,y as c,Kt as d,xn as g,bn as l};