@equinor/videx-3d 5.1.0-beta

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 (235) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +120 -0
  3. package/dist/chunk-BX-cez1_.js +23 -0
  4. package/dist/chunk-CnY6Tmof.js +358 -0
  5. package/dist/chunk-MFzFdEWm.js +591 -0
  6. package/dist/chunk-iY0wQ9Z6.js +887 -0
  7. package/dist/generators.js +711 -0
  8. package/dist/main.js +8405 -0
  9. package/dist/sdk.js +610 -0
  10. package/dist/shaderLib/color-conversion.glsl +33 -0
  11. package/dist/shaderLib/colors.glsl +8 -0
  12. package/dist/shaderLib/glyphs.glsl +78 -0
  13. package/dist/shaderLib/random.glsl +3 -0
  14. package/dist/shaderLib/remap.glsl +13 -0
  15. package/dist/shaderLib/render-number.glsl +74 -0
  16. package/dist/shaderLib/render-text.glsl +66 -0
  17. package/dist/shaderLib/rotation.glsl +19 -0
  18. package/dist/shaderLib/sdf-functions.glsl +18 -0
  19. package/dist/textures/normal_map.jpg +0 -0
  20. package/dist/types/common/color-ramps.d.ts +5 -0
  21. package/dist/types/common/types.d.ts +25 -0
  22. package/dist/types/components/Annotations/Annotations.d.ts +42 -0
  23. package/dist/types/components/Annotations/AnnotationsHMTL.d.ts +1 -0
  24. package/dist/types/components/Annotations/AnnotationsLayer.d.ts +46 -0
  25. package/dist/types/components/Annotations/AutoUpdate.d.ts +3 -0
  26. package/dist/types/components/Annotations/DefaultLabelComponent.d.ts +11 -0
  27. package/dist/types/components/Annotations/TestAnnotations.d.ts +12 -0
  28. package/dist/types/components/Annotations/annotations-renderer.d.ts +26 -0
  29. package/dist/types/components/Annotations/annotations-state.d.ts +88 -0
  30. package/dist/types/components/Annotations/helpers.d.ts +11 -0
  31. package/dist/types/components/Annotations/index.d.ts +8 -0
  32. package/dist/types/components/Annotations/types.d.ts +80 -0
  33. package/dist/types/components/Annotations/update-annotations.d.ts +12 -0
  34. package/dist/types/components/CameraTargetMarker/CameraTargetMarker.d.ts +29 -0
  35. package/dist/types/components/Distance/Distance.d.ts +35 -0
  36. package/dist/types/components/Distance/DistanceContext.d.ts +12 -0
  37. package/dist/types/components/Distance/index.d.ts +2 -0
  38. package/dist/types/components/EventEmitter/EventEmitter.d.ts +20 -0
  39. package/dist/types/components/EventEmitter/EventEmitterContext.d.ts +90 -0
  40. package/dist/types/components/EventEmitter/index.d.ts +3 -0
  41. package/dist/types/components/EventEmitter/picking-helper.d.ts +32 -0
  42. package/dist/types/components/EventEmitter/picking-material.d.ts +11 -0
  43. package/dist/types/components/Grids/BoxGrid/BoxGrid.d.ts +52 -0
  44. package/dist/types/components/Grids/Grid/Grid.d.ts +62 -0
  45. package/dist/types/components/Grids/Grid/GridAxesLabels.d.ts +24 -0
  46. package/dist/types/components/Grids/Grid/UtmGrid.d.ts +30 -0
  47. package/dist/types/components/Grids/Grid/grid-helpers.d.ts +2 -0
  48. package/dist/types/components/Grids/index.d.ts +5 -0
  49. package/dist/types/components/Highlighter/Highlighter.d.ts +23 -0
  50. package/dist/types/components/Highlighter/highlight-state.d.ts +43 -0
  51. package/dist/types/components/Highlighter/index.d.ts +2 -0
  52. package/dist/types/components/Html/DepthSelector.d.ts +1 -0
  53. package/dist/types/components/Html/OutputPanel/OutputPanel.d.ts +10 -0
  54. package/dist/types/components/Html/OutputPanel/index.d.ts +2 -0
  55. package/dist/types/components/Html/OutputPanel/output-panel-state.d.ts +38 -0
  56. package/dist/types/components/Html/Panel/Panel.d.ts +20 -0
  57. package/dist/types/components/Html/WellMap/ActiveTrack.d.ts +9 -0
  58. package/dist/types/components/Html/WellMap/DepthCursor.d.ts +8 -0
  59. package/dist/types/components/Html/WellMap/DepthReadout.d.ts +6 -0
  60. package/dist/types/components/Html/WellMap/Schematic.d.ts +15 -0
  61. package/dist/types/components/Html/WellMap/Track.d.ts +13 -0
  62. package/dist/types/components/Html/WellMap/WellMap.d.ts +47 -0
  63. package/dist/types/components/Html/WellMap/addons/WellMapCasingShoes.d.ts +14 -0
  64. package/dist/types/components/Html/WellMap/addons/WellMapCompletionIntervals.d.ts +15 -0
  65. package/dist/types/components/Html/WellMap/addons/WellMapFormations.d.ts +14 -0
  66. package/dist/types/components/Html/WellMap/addons/WellMapTvd.d.ts +14 -0
  67. package/dist/types/components/Html/WellMap/addons/index.d.ts +4 -0
  68. package/dist/types/components/Html/WellMap/index.d.ts +4 -0
  69. package/dist/types/components/Html/WellMap/themes.d.ts +13 -0
  70. package/dist/types/components/Html/WellMap/well-map-context.d.ts +34 -0
  71. package/dist/types/components/Html/WellMap/well-map-state.d.ts +38 -0
  72. package/dist/types/components/Html/index.d.ts +5 -0
  73. package/dist/types/components/ObservableGroup/ObservableGroup.d.ts +38 -0
  74. package/dist/types/components/SDFTest/SDFTest.d.ts +12 -0
  75. package/dist/types/components/Surfaces/Surface.d.ts +46 -0
  76. package/dist/types/components/Surfaces/SurfaceMaterial.d.ts +53 -0
  77. package/dist/types/components/Surfaces/index.d.ts +4 -0
  78. package/dist/types/components/Surfaces/surface-defs.d.ts +7 -0
  79. package/dist/types/components/Symbol/Symbol.d.ts +45 -0
  80. package/dist/types/components/Symbol/index.d.ts +1 -0
  81. package/dist/types/components/UtmArea/UtmArea.d.ts +37 -0
  82. package/dist/types/components/UtmArea/UtmAreaContext.d.ts +32 -0
  83. package/dist/types/components/UtmArea/UtmPosition.d.ts +26 -0
  84. package/dist/types/components/UtmArea/Wgs84Position.d.ts +26 -0
  85. package/dist/types/components/UtmArea/index.d.ts +4 -0
  86. package/dist/types/components/Wellbores/BasicTrajectory/BasicTrajectory.d.ts +27 -0
  87. package/dist/types/components/Wellbores/BasicTrajectory/basic-trajectory-defs.d.ts +3 -0
  88. package/dist/types/components/Wellbores/BasicTrajectory/index.d.ts +2 -0
  89. package/dist/types/components/Wellbores/Casings/CasingAnnotations/CasingAnnotations.d.ts +9 -0
  90. package/dist/types/components/Wellbores/Casings/CasingAnnotations/CasingLabel.d.ts +9 -0
  91. package/dist/types/components/Wellbores/Casings/CasingAnnotations/casing-annotations-defs.d.ts +1 -0
  92. package/dist/types/components/Wellbores/Casings/Casings.d.ts +42 -0
  93. package/dist/types/components/Wellbores/Casings/casings-defs.d.ts +6 -0
  94. package/dist/types/components/Wellbores/Casings/index.d.ts +5 -0
  95. package/dist/types/components/Wellbores/CompletionTools/CompletionAnnotations/CompletionAnnotations.d.ts +9 -0
  96. package/dist/types/components/Wellbores/CompletionTools/CompletionAnnotations/completion-annotations-defs.d.ts +1 -0
  97. package/dist/types/components/Wellbores/CompletionTools/CompletionTools.d.ts +31 -0
  98. package/dist/types/components/Wellbores/CompletionTools/Screen/screen-material.d.ts +8 -0
  99. package/dist/types/components/Wellbores/CompletionTools/completion-tools-defs.d.ts +4 -0
  100. package/dist/types/components/Wellbores/CompletionTools/index.d.ts +5 -0
  101. package/dist/types/components/Wellbores/DepthMarkers/DepthMarkerLabel.d.ts +11 -0
  102. package/dist/types/components/Wellbores/DepthMarkers/DepthMarkers.d.ts +27 -0
  103. package/dist/types/components/Wellbores/DepthMarkers/depth-markers-defs.d.ts +1 -0
  104. package/dist/types/components/Wellbores/DepthMarkers/index.d.ts +3 -0
  105. package/dist/types/components/Wellbores/FormationMarkers/FormationMarkerLabel.d.ts +10 -0
  106. package/dist/types/components/Wellbores/FormationMarkers/FormationMarkers.d.ts +33 -0
  107. package/dist/types/components/Wellbores/FormationMarkers/formation-markers-defs.d.ts +3 -0
  108. package/dist/types/components/Wellbores/FormationMarkers/index.d.ts +3 -0
  109. package/dist/types/components/Wellbores/Perforations/Perforations.d.ts +32 -0
  110. package/dist/types/components/Wellbores/Perforations/index.d.ts +2 -0
  111. package/dist/types/components/Wellbores/Perforations/perforations-defs.d.ts +3 -0
  112. package/dist/types/components/Wellbores/Perimeter/Perimeter.d.ts +29 -0
  113. package/dist/types/components/Wellbores/Perimeter/index.d.ts +2 -0
  114. package/dist/types/components/Wellbores/Perimeter/perimeter-defs.d.ts +3 -0
  115. package/dist/types/components/Wellbores/PositionMarkers/PositionMarkers.d.ts +12 -0
  116. package/dist/types/components/Wellbores/PositionMarkers/position-markers-defs.d.ts +3 -0
  117. package/dist/types/components/Wellbores/Shoes/Shoes.d.ts +34 -0
  118. package/dist/types/components/Wellbores/Shoes/index.d.ts +2 -0
  119. package/dist/types/components/Wellbores/Shoes/shoes-defs.d.ts +3 -0
  120. package/dist/types/components/Wellbores/TubeTrajectory/TubeTrajectory.d.ts +25 -0
  121. package/dist/types/components/Wellbores/TubeTrajectory/index.d.ts +2 -0
  122. package/dist/types/components/Wellbores/TubeTrajectory/tube-geometry-defs.d.ts +3 -0
  123. package/dist/types/components/Wellbores/Wellbore/Wellbore.d.ts +45 -0
  124. package/dist/types/components/Wellbores/Wellbore/WellboreContext.d.ts +19 -0
  125. package/dist/types/components/Wellbores/Wellbore/index.d.ts +2 -0
  126. package/dist/types/components/Wellbores/WellboreBounds/WellboreBounds.d.ts +47 -0
  127. package/dist/types/components/Wellbores/WellboreBounds/index.d.ts +2 -0
  128. package/dist/types/components/Wellbores/WellboreBounds/wellbore-bounds-defs.d.ts +1 -0
  129. package/dist/types/components/Wellbores/WellboreFormationColumn/WellboreFormationColumn.d.ts +30 -0
  130. package/dist/types/components/Wellbores/WellboreFormationColumn/index.d.ts +2 -0
  131. package/dist/types/components/Wellbores/WellboreFormationColumn/wellbore-formation-column-defs.d.ts +3 -0
  132. package/dist/types/components/Wellbores/WellboreLabel/WellboreAnnotationLabel.d.ts +10 -0
  133. package/dist/types/components/Wellbores/WellboreLabel/WellboreLabel.d.ts +25 -0
  134. package/dist/types/components/Wellbores/WellboreLabel/index.d.ts +3 -0
  135. package/dist/types/components/Wellbores/WellboreLabel/wellbore-label-defs.d.ts +1 -0
  136. package/dist/types/components/Wellbores/WellboreRibbon/WellboreRibbon.d.ts +22 -0
  137. package/dist/types/components/Wellbores/WellboreRibbon/WellboreRibbonContext.d.ts +16 -0
  138. package/dist/types/components/Wellbores/WellboreRibbon/index.d.ts +4 -0
  139. package/dist/types/components/Wellbores/WellboreRibbon/stripes/FormationsStripe.d.ts +30 -0
  140. package/dist/types/components/Wellbores/WellboreRibbon/stripes/MeasuredDepthStripe.d.ts +28 -0
  141. package/dist/types/components/Wellbores/WellboreSeismicSection/WellboreSeismicSection.d.ts +34 -0
  142. package/dist/types/components/Wellbores/WellboreSeismicSection/index.d.ts +2 -0
  143. package/dist/types/components/Wellbores/WellboreSeismicSection/wellbore-seismic-section-defs.d.ts +12 -0
  144. package/dist/types/components/Wellbores/Wells/Wells.d.ts +43 -0
  145. package/dist/types/components/Wellbores/Wells/index.d.ts +1 -0
  146. package/dist/types/contexts/DataContext.d.ts +15 -0
  147. package/dist/types/contexts/DataContextProvider.d.ts +33 -0
  148. package/dist/types/contexts/GeneratorsContext.d.ts +13 -0
  149. package/dist/types/contexts/GeneratorsContextProvider.d.ts +34 -0
  150. package/dist/types/contexts/GlyphsContext.d.ts +19 -0
  151. package/dist/types/contexts/GlyphsContextProvider.d.ts +29 -0
  152. package/dist/types/events/camera-events.d.ts +34 -0
  153. package/dist/types/events/depth-events.d.ts +22 -0
  154. package/dist/types/events/interaction-events.d.ts +7 -0
  155. package/dist/types/events/wellbore-events.d.ts +46 -0
  156. package/dist/types/generators/basic-trajectory-generator.d.ts +2 -0
  157. package/dist/types/generators/casing-annotations-generator.d.ts +8 -0
  158. package/dist/types/generators/casings-generator.d.ts +4 -0
  159. package/dist/types/generators/completion-annotations-generator.d.ts +7 -0
  160. package/dist/types/generators/completion-tools-generator.d.ts +2 -0
  161. package/dist/types/generators/depth-markers-generator.d.ts +3 -0
  162. package/dist/types/generators/formation-markers-generator.d.ts +2 -0
  163. package/dist/types/generators/index.d.ts +20 -0
  164. package/dist/types/generators/perforations-generator.d.ts +2 -0
  165. package/dist/types/generators/perimieter-generator.d.ts +2 -0
  166. package/dist/types/generators/position-markers-generator.d.ts +2 -0
  167. package/dist/types/generators/shoes-generator.d.ts +2 -0
  168. package/dist/types/generators/surface-generator.d.ts +4 -0
  169. package/dist/types/generators/tube-trajectory-generator.d.ts +2 -0
  170. package/dist/types/generators/wellbore-bounds-generator.d.ts +2 -0
  171. package/dist/types/generators/wellbore-formation-column-generator.d.ts +2 -0
  172. package/dist/types/generators/wellbore-label-generator.d.ts +7 -0
  173. package/dist/types/generators/wellbore-seismic-section-generator.d.ts +3 -0
  174. package/dist/types/hooks/useData.d.ts +25 -0
  175. package/dist/types/hooks/useGenerator.d.ts +43 -0
  176. package/dist/types/hooks/useWellboreContext.d.ts +13 -0
  177. package/dist/types/layers/layers.d.ts +6 -0
  178. package/dist/types/main.d.ts +48 -0
  179. package/dist/types/rendering/fullscreen-renderer.d.ts +9 -0
  180. package/dist/types/rendering/index.d.ts +2 -0
  181. package/dist/types/rendering/render-passes.d.ts +16 -0
  182. package/dist/types/sdk/data/DataLoader.d.ts +54 -0
  183. package/dist/types/sdk/data/GeneratorRegistry.d.ts +15 -0
  184. package/dist/types/sdk/data/Store.d.ts +29 -0
  185. package/dist/types/sdk/data/helpers/formations-helpers.d.ts +24 -0
  186. package/dist/types/sdk/data/helpers/well-helpers.d.ts +9 -0
  187. package/dist/types/sdk/data/types/Casing.d.ts +8 -0
  188. package/dist/types/sdk/data/types/CompletionTool.d.ts +11 -0
  189. package/dist/types/sdk/data/types/DepthReferencePoint.d.ts +1 -0
  190. package/dist/types/sdk/data/types/Formation.d.ts +32 -0
  191. package/dist/types/sdk/data/types/PerforationInterval.d.ts +9 -0
  192. package/dist/types/sdk/data/types/Pick.d.ts +8 -0
  193. package/dist/types/sdk/data/types/PositionLog.d.ts +17 -0
  194. package/dist/types/sdk/data/types/StratColumn.d.ts +18 -0
  195. package/dist/types/sdk/data/types/SurfaceMeta.d.ts +23 -0
  196. package/dist/types/sdk/data/types/SurfaceValues.d.ts +1 -0
  197. package/dist/types/sdk/data/types/Symbol.d.ts +6 -0
  198. package/dist/types/sdk/data/types/VerticalSlice.d.ts +9 -0
  199. package/dist/types/sdk/data/types/WellboreHeader.d.ts +15 -0
  200. package/dist/types/sdk/data/types/index.d.ts +11 -0
  201. package/dist/types/sdk/geometries/curve/curve-3d.d.ts +46 -0
  202. package/dist/types/sdk/geometries/curve/tube-geometry.d.ts +34 -0
  203. package/dist/types/sdk/geometries/delatin.d.ts +44 -0
  204. package/dist/types/sdk/geometries/fence.d.ts +3 -0
  205. package/dist/types/sdk/geometries/packing.d.ts +46 -0
  206. package/dist/types/sdk/geometries/triangulate-grid-delaunay.d.ts +8 -0
  207. package/dist/types/sdk/geometries/triangulate-grid.d.ts +28 -0
  208. package/dist/types/sdk/index.d.ts +39 -0
  209. package/dist/types/sdk/managers/CameraManager.d.ts +11 -0
  210. package/dist/types/sdk/managers/WellboreManager.d.ts +18 -0
  211. package/dist/types/sdk/materials/depth-material.d.ts +4 -0
  212. package/dist/types/sdk/materials/ribbon-material.d.ts +24 -0
  213. package/dist/types/sdk/materials/tube-material.d.ts +7 -0
  214. package/dist/types/sdk/materials/uv-material.d.ts +2 -0
  215. package/dist/types/sdk/projection/crs.d.ts +37 -0
  216. package/dist/types/sdk/types/common.d.ts +4 -0
  217. package/dist/types/sdk/utils/array.d.ts +0 -0
  218. package/dist/types/sdk/utils/colors.d.ts +2 -0
  219. package/dist/types/sdk/utils/conversions.d.ts +5 -0
  220. package/dist/types/sdk/utils/depth-reader.d.ts +5 -0
  221. package/dist/types/sdk/utils/elevation-map.d.ts +15 -0
  222. package/dist/types/sdk/utils/glyphs.d.ts +50 -0
  223. package/dist/types/sdk/utils/irapbin-parser.d.ts +17 -0
  224. package/dist/types/sdk/utils/num-array.d.ts +2 -0
  225. package/dist/types/sdk/utils/numbers.d.ts +5 -0
  226. package/dist/types/sdk/utils/packing.d.ts +1 -0
  227. package/dist/types/sdk/utils/scene.d.ts +2 -0
  228. package/dist/types/sdk/utils/segments.d.ts +4 -0
  229. package/dist/types/sdk/utils/strings.d.ts +2 -0
  230. package/dist/types/sdk/utils/trajectory.d.ts +59 -0
  231. package/dist/types/sdk/utils/trigonometry.d.ts +12 -0
  232. package/dist/types/sdk/utils/typed-2d-array.d.ts +52 -0
  233. package/dist/types/sdk/utils/typed-array.d.ts +2 -0
  234. package/dist/types/sdk/utils/vector-operations.d.ts +29 -0
  235. package/package.json +127 -0
@@ -0,0 +1,887 @@
1
+ import { EPS as at, CurveInterpolator as it } from "curve-interpolator";
2
+ import { BufferGeometry as X, BufferAttribute as U, Vector3 as v, ShaderMaterial as Y, OrthographicCamera as ct, Scene as lt, PlaneGeometry as ut, Mesh as dt, WebGLRenderTarget as ft, RGBAFormat as mt, UnsignedByteType as gt } from "three";
3
+ async function Wt(t, e, r, n) {
4
+ const o = await r.get("formations", t) || [];
5
+ n = n === void 0 ? -1 / 0 : n;
6
+ const s = o.filter(
7
+ (a) => a.stratColumnId === e && a.exit.mdMsl > n
8
+ );
9
+ return s.sort(
10
+ (a, i) => a.entry.mdMsl - i.entry.mdMsl || a.level - i.level
11
+ ), s.length && s[0].entry.mdMsl < n && (s[0].entry.mdMsl = n), s;
12
+ }
13
+ function O(t, e, r) {
14
+ return {
15
+ mdMslFrom: e,
16
+ mdMslTo: r,
17
+ name: t.name,
18
+ level: t.level,
19
+ color: t.color,
20
+ properties: { ...t.properties || {} }
21
+ };
22
+ }
23
+ function St(t) {
24
+ if (!t.length) return [];
25
+ let e = [];
26
+ const r = [...t].sort((n, o) => {
27
+ const s = o.level - n.level || n.entry.mdMsl - o.entry.mdMsl;
28
+ if (s === 0 && (n.properties?.updated || o.properties?.updated)) {
29
+ const a = n.properties?.updated ? new Date(n.properties?.updated) : null, i = o.properties?.updated ? new Date(o.properties?.updated) : null;
30
+ return a === null ? 1 : i === null ? -1 : i.getTime() - a.getTime();
31
+ }
32
+ return s;
33
+ });
34
+ for (let n = 0; n < r.length; n++) {
35
+ const o = r[n];
36
+ let s = o.entry.mdMsl;
37
+ const a = [...e];
38
+ for (let i = 0; i < e.length && s < o.exit.mdMsl; i++) {
39
+ const c = e[i];
40
+ if (s < c.mdMslFrom) {
41
+ const l = Math.min(o.exit.mdMsl, c.mdMslFrom);
42
+ a.push(O(o, s, l));
43
+ }
44
+ s = Math.max(s, c.mdMslTo);
45
+ }
46
+ s < o.exit.mdMsl && a.push(
47
+ O(o, s, o.exit.mdMsl)
48
+ ), e = a.sort((i, c) => i.mdMslFrom - c.mdMslFrom);
49
+ }
50
+ return e;
51
+ }
52
+ function zt(t) {
53
+ const e = [], r = [...t].sort(
54
+ (s, a) => s.entry.mdMsl - a.entry.mdMsl || a.level - s.level
55
+ );
56
+ let n = null, o = -1 / 0;
57
+ for (let s = 0; s < r.length; s++) {
58
+ const a = r[s];
59
+ a.entry.mdMsl > o && (o = a.entry.mdMsl, n && n.exit.mdMsl < o && e.push({
60
+ color: n.color,
61
+ name: n.name,
62
+ type: "base",
63
+ mdMsl: n.exit.mdMsl,
64
+ tvdMsl: n.exit.tvdMsl,
65
+ level: n.level
66
+ }), e.push({
67
+ color: a.color,
68
+ name: a.name,
69
+ type: "top",
70
+ mdMsl: o,
71
+ tvdMsl: a.entry.tvdMsl,
72
+ level: a.level
73
+ }), n = a);
74
+ }
75
+ return n && e.push({
76
+ color: n.color,
77
+ name: n.name,
78
+ type: "base",
79
+ mdMsl: n.exit.mdMsl,
80
+ tvdMsl: n.exit.tvdMsl,
81
+ level: n.level
82
+ }), e;
83
+ }
84
+ function B(t, e = 0, r = 1) {
85
+ return t < e ? e : t > r ? r : t;
86
+ }
87
+ function ht(t, e, r) {
88
+ return r = B(r, 0, 1), (1 - r) * t + r * e;
89
+ }
90
+ function pt(t, e, r) {
91
+ return (t - e) / (r - e);
92
+ }
93
+ function Nt(t, e, r, n, o) {
94
+ const s = pt(t, e, r);
95
+ return ht(n, o, s);
96
+ }
97
+ const jt = (t) => {
98
+ if (t < 0) return [0, 0, 0];
99
+ if (t > 16777.215) throw Error("Value out of range!");
100
+ const e = Math.round(t * 1e3), r = Math.floor(e / 65536), n = Math.floor(e / 256) - r * 256, o = Math.floor(e) - r * 65536 - n * 256;
101
+ return [r, n, o];
102
+ }, _t = Math.PI, H = 2 * Math.PI, yt = Math.PI / 2, Gt = Math.PI / 4, qt = Math.PI / 8;
103
+ function Zt(t, e) {
104
+ for (; e < -Math.PI; )
105
+ e += H;
106
+ for (; e > Math.PI; )
107
+ e -= H;
108
+ const r = Math.atan2(t[1], t[0]), n = Math.tan(e);
109
+ let o;
110
+ e > -r && e <= r ? o = 1 : e > r && e <= Math.PI - r ? o = 2 : e > Math.PI - r || e <= -(Math.PI - r) ? o = 3 : o = 4;
111
+ const s = [0, 0];
112
+ let a = 1, i = 1;
113
+ switch (o) {
114
+ case 1:
115
+ i = -1;
116
+ break;
117
+ case 2:
118
+ i = -1;
119
+ break;
120
+ case 3:
121
+ a = -1;
122
+ break;
123
+ case 4:
124
+ a = -1;
125
+ break;
126
+ }
127
+ return o === 1 || o === 3 ? (s[0] += a * (t[0] / 2), s[1] += i * (t[0] / 2) * n) : (s[0] += a * (t[1] / (2 * n)), s[1] += i * (t[1] / 2)), s;
128
+ }
129
+ function Ot(t) {
130
+ return t[0] = -t[0], t[1] = -t[1], t[2] = -t[2], t;
131
+ }
132
+ function Ht(t, e) {
133
+ return [t[e], t[e + 1], t[e + 2]];
134
+ }
135
+ function $t(t, e, r) {
136
+ t[e] = r[0], t[e + 1] = r[1], t[e + 2] = r[2];
137
+ }
138
+ function Qt(t, e) {
139
+ return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
140
+ }
141
+ function tt(t, e) {
142
+ return [t[0] - e[0], t[1] - e[1], t[2] - e[2]];
143
+ }
144
+ function Jt(t, e) {
145
+ return t[0] = t[0] * e, t[1] = t[1] * e, t[2] = t[2] * e, t;
146
+ }
147
+ function et(t) {
148
+ const e = t[0] ** 2 + t[1] ** 2 + t[2] ** 2;
149
+ return e > 0 ? Math.sqrt(e) : 0;
150
+ }
151
+ function E(t, e) {
152
+ return [
153
+ t[1] * e[2] - t[2] * e[1],
154
+ t[2] * e[0] - t[0] * e[2],
155
+ t[0] * e[1] - t[1] * e[0]
156
+ ];
157
+ }
158
+ function q(t, e) {
159
+ return t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
160
+ }
161
+ function z(t) {
162
+ const e = Math.sqrt(t[0] * t[0] + t[1] * t[1] + t[2] * t[2]);
163
+ return e ? (t[0] = t[0] / e, t[1] = t[1] / e, t[2] = t[2] / e, t) : [0, 0, 0];
164
+ }
165
+ function Kt(t, e, r = 0.5) {
166
+ const n = 1 - r;
167
+ return [
168
+ t[0] * n + e[0] * r,
169
+ t[1] * n + e[1] * r,
170
+ t[2] * n + e[2] * r
171
+ ];
172
+ }
173
+ function Mt(t) {
174
+ return [t[0], t[1], t[2]];
175
+ }
176
+ function Xt(t, e) {
177
+ const r = Math.sqrt(
178
+ (t[0] ** 2 + t[1] ** 2 + t[2] ** 2) * (e[0] ** 2 + e[1] ** 2 + e[2] ** 2)
179
+ );
180
+ if (r === 0) return yt;
181
+ const n = q(t, e) / r;
182
+ return Math.acos(B(n, -1, 1));
183
+ }
184
+ function At(t, e = [0, 1, 0], r = 0) {
185
+ const n = Math.cos(r), o = Math.sin(r), s = 1 - n, a = t[0], i = t[1], c = t[2], l = e[0], d = e[1], f = e[2], m = s * l, u = s * d;
186
+ return [
187
+ (m * l + n) * a + (m * d - o * f) * i + (m * f + o * d) * c,
188
+ (m * d + o * f) * a + (u * d + n) * i + (u * f - o * l) * c,
189
+ (m * f - o * d) * a + (u * f + o * l) * i + (s * f * f + n) * c
190
+ ];
191
+ }
192
+ function Yt(t, e) {
193
+ return z(tt(e, t));
194
+ }
195
+ function te(t, e) {
196
+ return et(tt(e, t));
197
+ }
198
+ function ee(t, e) {
199
+ return [t[e], t[e + 1]];
200
+ }
201
+ function ne(t, e, r) {
202
+ t[e] = r[0], t[e + 1] = r[1];
203
+ }
204
+ function nt(t) {
205
+ const e = Math.sqrt(t[0] * t[0] + t[1] * t[1]);
206
+ return e ? (t[0] = t[0] / e, t[1] = t[1] / e, t) : [0, 0];
207
+ }
208
+ function $(t, e) {
209
+ return [t[0] + e[0], t[1] + e[1]];
210
+ }
211
+ function Z(t, e) {
212
+ return [t[0] - e[0], t[1] - e[1]];
213
+ }
214
+ function rt(t, e) {
215
+ return t[0] * e[0] + t[1] * e[1];
216
+ }
217
+ function re(t) {
218
+ return t[0] = -t[0], t[1] = -t[1], t;
219
+ }
220
+ function se(t, e) {
221
+ return t[0] = t[0] * e, t[1] = t[1] * e, t;
222
+ }
223
+ function bt(t) {
224
+ const e = t[0] ** 2 + t[1] ** 2;
225
+ return e > 0 ? Math.sqrt(e) : 0;
226
+ }
227
+ function oe(t, e, r = 0.5) {
228
+ const n = 1 - r;
229
+ return [t[0] * n + e[0] * r, t[1] * n + e[1] * r];
230
+ }
231
+ function W(t, e) {
232
+ return nt(Z(e, t));
233
+ }
234
+ function S(t, e) {
235
+ return bt(Z(e, t));
236
+ }
237
+ function wt(t, e = !1) {
238
+ const r = {
239
+ alpha: 1,
240
+ tension: 0,
241
+ closed: e
242
+ }, n = new it(t, r);
243
+ return {
244
+ getPointAt: (s) => n.getPointAt(s),
245
+ getPoints: (s, a = 0, i = 1) => n.getPoints(s, null, a, i),
246
+ getTangentAt: (s) => n.getTangentAt(s),
247
+ getNormalAt: (s) => n.getNormalAt(s),
248
+ getBoundingBox: (s = 0, a = 1) => {
249
+ const i = n.getBoundingBox(s, a);
250
+ return {
251
+ min: i.min,
252
+ max: i.max
253
+ };
254
+ },
255
+ nearest: (s) => {
256
+ const a = n.getNearestPosition(s);
257
+ return {
258
+ position: a.u,
259
+ point: a.point,
260
+ distance: a.distance
261
+ };
262
+ },
263
+ get length() {
264
+ return n.length;
265
+ },
266
+ closed: e
267
+ };
268
+ }
269
+ function ae(t, e) {
270
+ const r = e.length, n = new Array(r);
271
+ if (!n.length) return [];
272
+ e.forEach((l, d) => {
273
+ n[d] = {
274
+ curvePosition: l,
275
+ position: t.getPointAt(l),
276
+ tangent: t.getTangentAt(l),
277
+ normal: [0, 0, 0],
278
+ binormal: [0, 0, 0]
279
+ };
280
+ });
281
+ let o = [0, 1, 0], s = Math.abs(n[0].tangent[1]);
282
+ const a = Math.abs(n[0].tangent[0]), i = Math.abs(n[0].tangent[2]);
283
+ a <= s && (s = a, o = [1, 0, 0]), i <= s && (o = [0, 0, 1]);
284
+ let c = z(E(n[0].tangent, o));
285
+ n[0].normal = E(n[0].tangent, c), n[0].binormal = E(n[0].tangent, n[0].normal);
286
+ for (let l = 1; l < e.length; l++) {
287
+ if (c = E(n[l - 1].tangent, n[l].tangent), n[l].normal = Mt(n[l - 1].normal), et(c) > at) {
288
+ z(c);
289
+ const d = Math.acos(
290
+ B(q(n[l - 1].tangent, n[l].tangent), -1, 1)
291
+ );
292
+ n[l].normal = At(n[l - 1].normal, c, d);
293
+ }
294
+ n[l].binormal = E(n[l].tangent, n[l].normal);
295
+ }
296
+ return n;
297
+ }
298
+ function ie(t, e = 0, r = 1, n = 0.1, o = 0) {
299
+ const s = [], a = t.length, i = Math.ceil(n * a), c = 1 / i, l = 1 / (a * 0.01);
300
+ o && (o *= 0.1), s.push(e);
301
+ let d = o ? t.getTangentAt(e) : null;
302
+ const f = Math.floor(e * i);
303
+ let m = e;
304
+ for (let u = f; u <= i; u++) {
305
+ const h = u * c, y = h - m, g = o ? t.getTangentAt(h) : null;
306
+ h > e && h < r && (y >= l || !o || Math.abs(q(d, g)) < 1 - o) && (s.push(h), d = g, m = h);
307
+ }
308
+ return s.push(r), s;
309
+ }
310
+ function ce(t, e) {
311
+ if (!e || e.length < 8) return null;
312
+ const [r, , n] = e, o = new Array(e.length / 4);
313
+ for (let f = 0, m = 0; f < o.length; f++, m += 4)
314
+ o[f] = [
315
+ e[m] - r,
316
+ -e[m + 1],
317
+ n - e[m + 2]
318
+ ];
319
+ const s = wt(o, !1);
320
+ if (!s) return null;
321
+ const a = e[3], i = e[e.length - 1], c = i - a, l = (f, m = !1) => {
322
+ let u = (f - a) / c;
323
+ return m && (u = B(u, 0, 1)), u < 0 || u > 1 ? null : u;
324
+ };
325
+ return {
326
+ id: t,
327
+ curve: s,
328
+ get measuredLength() {
329
+ return c;
330
+ },
331
+ get measuredTop() {
332
+ return a;
333
+ },
334
+ get measuredBottom() {
335
+ return i;
336
+ },
337
+ getPositionAtDepth: l,
338
+ getPointAtDepth: (f, m = !1) => {
339
+ const u = l(f, m);
340
+ return u !== null ? s.getPointAt(u) : null;
341
+ }
342
+ };
343
+ }
344
+ function le(t, e = (n) => n, r = 1e-7) {
345
+ if (t.length <= 2) return t;
346
+ let n = e(t[0]), o = [0, 0];
347
+ const s = [t[0]];
348
+ for (let a = 1; a < t.length - 1; a++) {
349
+ const i = e(t[a]), c = nt(Z(i, n));
350
+ Math.abs(rt(o, c)) < 1 - r && (s.push(t[a]), o = c, n = i);
351
+ }
352
+ return s.push(t[t.length - 1]), s;
353
+ }
354
+ function ue(t, e, r = 1e3, n = 2e3, o = 0) {
355
+ if (!t || t.length < 1) return null;
356
+ const s = [];
357
+ let a = 0;
358
+ const i = [t[0][0], t[0][2]];
359
+ let c = t[0][1], l = c, d = 1;
360
+ s.push(i);
361
+ let f = s[s.length - 1];
362
+ for (; d < t.length; ) {
363
+ const u = [t[d][0], t[d][2]];
364
+ t[d][1] > c && (c = t[d][1]), t[d][1] < l && (l = t[d][1]);
365
+ const h = S(f, u);
366
+ if (h < e)
367
+ d === t.length - 1 && s.length > 1 && (a += h, s.push(u)), d++;
368
+ else if (a += e, h > e) {
369
+ const y = W(f, u), g = [
370
+ f[0] + y[0] * e,
371
+ f[1] + y[1] * e
372
+ ];
373
+ s.push(g), f = g;
374
+ } else
375
+ s.push(u), f = u, d++;
376
+ }
377
+ const m = s.length;
378
+ if (r || a < n) {
379
+ let u = 0, h = r;
380
+ a + r / 2 < n && (u = (n - a) / 2, h = u);
381
+ let y = [
382
+ Math.cos(o),
383
+ Math.sin(o)
384
+ ];
385
+ if (h) {
386
+ m > 1 && (y = W(
387
+ s[s.length - 2],
388
+ s[s.length - 1]
389
+ ));
390
+ const g = s[s.length - 1], L = Math.floor(h / e), k = [
391
+ y[0] * e,
392
+ y[1] * e
393
+ ], P = [
394
+ g[0] + y[0] * h,
395
+ g[1] + y[1] * h
396
+ ];
397
+ let b = g;
398
+ for (let T = 0; T < L; T++)
399
+ b = $(b, k), s.push(b);
400
+ S(b, P) && s.push(P);
401
+ }
402
+ if (u) {
403
+ let g;
404
+ m > 1 ? g = W(s[1], s[0]) : g = [
405
+ -Math.cos(o),
406
+ -Math.sin(o)
407
+ ], (a < 100 || Math.abs(rt(y, g)) > 0.95) && (g = [
408
+ -y[0],
409
+ -y[1]
410
+ ]);
411
+ const L = Math.floor(u / e), k = [
412
+ g[0] * e,
413
+ g[1] * e
414
+ ], P = [
415
+ i[0] + g[0] * u,
416
+ i[1] + g[1] * u
417
+ ];
418
+ let b = i;
419
+ for (let T = 0; T < L; T++)
420
+ b = $(b, k), s.unshift(b);
421
+ S(
422
+ b,
423
+ P
424
+ ) && s.unshift(P);
425
+ }
426
+ }
427
+ return {
428
+ positions: s,
429
+ top: c,
430
+ bottom: l,
431
+ length: a
432
+ };
433
+ }
434
+ function D(t) {
435
+ if (t.constructor === Uint8Array) return "Uint8Array";
436
+ if (t.constructor === Uint16Array) return "Uint16Array";
437
+ if (t.constructor === Uint32Array) return "Uint32Array";
438
+ if (t.constructor === Int8Array) return "Int8Array";
439
+ if (t.constructor === Int16Array) return "Int16Array";
440
+ if (t.constructor === Int32Array) return "Int32Array";
441
+ if (t.constructor === Float32Array) return "Float32Array";
442
+ if (t.constructor === Float64Array) return "Float64Array";
443
+ throw Error("Unsupported typed array!");
444
+ }
445
+ function C(t, e) {
446
+ switch (e) {
447
+ case "Uint8Array":
448
+ return new Uint8Array(t);
449
+ case "Uint16Array":
450
+ return new Uint16Array(t);
451
+ case "Uint32Array":
452
+ return new Uint32Array(t);
453
+ case "Int8Array":
454
+ return new Int8Array(t);
455
+ case "Int16Array":
456
+ return new Int16Array(t);
457
+ case "Int32Array":
458
+ return new Int32Array(t);
459
+ case "Float32Array":
460
+ return new Float32Array(t);
461
+ case "Float64Array":
462
+ return new Float64Array(t);
463
+ default:
464
+ throw Error("Unsupported typed array!");
465
+ }
466
+ }
467
+ function xt(t, e = 1) {
468
+ return {
469
+ buffer: t.buffer,
470
+ attributeType: D(t),
471
+ itemSize: e
472
+ };
473
+ }
474
+ function de(t) {
475
+ const e = [], r = {
476
+ drawRange: t.drawRange || { start: 0, count: 1 / 0 },
477
+ groups: t.groups || [],
478
+ attributes: {},
479
+ index: t.index,
480
+ indexType: t.index ? D(t.index) : void 0,
481
+ userData: t.userData ? structuredClone(t.userData) : void 0
482
+ };
483
+ for (const n in t.attributes)
484
+ r.attributes[n] = xt(
485
+ t.attributes[n].array,
486
+ t.attributes[n].itemSize
487
+ ), e.push(r.attributes[n].buffer);
488
+ return [r, e];
489
+ }
490
+ function vt(t) {
491
+ const e = [], r = {
492
+ drawRange: t.drawRange,
493
+ groups: t.groups,
494
+ attributes: {},
495
+ index: void 0,
496
+ indexType: void 0
497
+ }, n = t.getIndex();
498
+ n && (r.index = n.array.buffer, r.indexType = D(n.array));
499
+ for (const o in t.attributes) {
500
+ const s = t.getAttribute(o);
501
+ r.attributes[o] = {
502
+ buffer: s.array.buffer,
503
+ attributeType: D(s.array),
504
+ itemSize: s.itemSize
505
+ }, e.push(r.attributes[o].buffer);
506
+ }
507
+ return t.userData && (r.userData = structuredClone(t.userData)), [r, e];
508
+ }
509
+ function fe(t) {
510
+ const e = {}, r = [];
511
+ for (const n in t) {
512
+ const o = t[n], s = vt(o);
513
+ e[n] = s[0], s[1].length && r.push(...s[1]);
514
+ }
515
+ return { data: e, transferrables: r };
516
+ }
517
+ function me(t) {
518
+ const e = new X();
519
+ if (t.index) {
520
+ const r = C(
521
+ t.index,
522
+ t.indexType || "Uint32Array"
523
+ ), n = new U(r, 1);
524
+ e.setIndex(n);
525
+ }
526
+ for (const r in t.attributes) {
527
+ const n = new U(
528
+ C(
529
+ t.attributes[r].buffer,
530
+ t.attributes[r].attributeType
531
+ ),
532
+ t.attributes[r].itemSize
533
+ );
534
+ e.setAttribute(r, n);
535
+ }
536
+ return e.drawRange = t.drawRange, e.groups = t.groups, t.userData && (e.userData = t.userData), e;
537
+ }
538
+ function ge(t) {
539
+ const e = {};
540
+ for (const r in t) {
541
+ const n = new X();
542
+ if (t[r].index) {
543
+ const o = C(
544
+ t[r].index,
545
+ t[r].indexType || "Uint32Array"
546
+ ), s = new U(o, 1);
547
+ n.setIndex(s);
548
+ }
549
+ for (const o in t[r].attributes) {
550
+ const s = new U(
551
+ C(
552
+ t[r].attributes[o].buffer,
553
+ t[r].attributes[o].attributeType
554
+ ),
555
+ t[r].attributes[o].itemSize
556
+ );
557
+ n.setAttribute(o, s);
558
+ }
559
+ n.drawRange = t[r].drawRange, n.groups = t[r].groups, e[r] = n;
560
+ }
561
+ return e;
562
+ }
563
+ const N = "camera-set-position", j = "camera-focus-point";
564
+ class he extends CustomEvent {
565
+ constructor(e) {
566
+ super(N, { detail: e });
567
+ }
568
+ }
569
+ class pe extends CustomEvent {
570
+ constructor(e) {
571
+ super(j, { detail: e });
572
+ }
573
+ }
574
+ const M = new v(), p = new v(), x = new v(), I = new v(), Q = new v();
575
+ async function Pt(t, e, r) {
576
+ r.normalizeRotations();
577
+ const n = Math.min(r.distance, e);
578
+ return M.set(...t), r.getPosition(p), x.subVectors(M, p), e = Math.min(x.length() * 1.5, n), x.normalize(), p.copy(M).addScaledVector(x, -n), r.setLookAt(
579
+ p.x,
580
+ p.y,
581
+ p.z,
582
+ M.x,
583
+ M.y,
584
+ M.z,
585
+ !0
586
+ );
587
+ }
588
+ function Tt(t, e) {
589
+ e.normalizeRotations(), I.set(...t), e.getTarget(M), Q.subVectors(M, I), e.getPosition(p), p.sub(Q), e.setPosition(p.x, p.y, p.z), e.setTarget(I.x, I.y, I.z);
590
+ }
591
+ class ye {
592
+ controls = null;
593
+ removeEventlisteners = null;
594
+ constructor() {
595
+ this.setControls = this.setControls.bind(this);
596
+ }
597
+ addEventListeners() {
598
+ const e = (n) => {
599
+ this.controls && Tt(n.detail, this.controls);
600
+ }, r = (n) => {
601
+ if (this.controls) {
602
+ const o = n.detail.callback;
603
+ Pt(
604
+ n.detail.point,
605
+ n.detail.distance || 200,
606
+ this.controls
607
+ ).then(() => {
608
+ o && o();
609
+ });
610
+ }
611
+ };
612
+ addEventListener(N, e), addEventListener(j, r), this.removeEventlisteners = () => {
613
+ removeEventListener(N, e), removeEventListener(j, r);
614
+ };
615
+ }
616
+ async setTarget(e) {
617
+ const r = this.controls;
618
+ return r ? (M.set(...e), r.getPosition(p), x.subVectors(M, p), x.normalize(), r.setLookAt(
619
+ p.x,
620
+ p.y,
621
+ p.z,
622
+ M.x,
623
+ M.y,
624
+ M.z,
625
+ !0
626
+ )) : null;
627
+ }
628
+ setControls(e) {
629
+ this.controls = e, this.removeEventlisteners && this.removeEventlisteners(), this.addEventListeners();
630
+ }
631
+ dispose() {
632
+ this.controls = null, this.removeEventlisteners && this.removeEventlisteners();
633
+ }
634
+ }
635
+ const Et = "wellbore-selected", _ = "wellbore-added", G = "wellbore-removed";
636
+ class Me extends CustomEvent {
637
+ constructor(e) {
638
+ super(Et, { detail: e });
639
+ }
640
+ }
641
+ class Ae extends CustomEvent {
642
+ constructor(e) {
643
+ super(_, { detail: e });
644
+ }
645
+ }
646
+ class be extends CustomEvent {
647
+ constructor(e) {
648
+ super(G, { detail: e });
649
+ }
650
+ }
651
+ const J = new v();
652
+ class we {
653
+ map = /* @__PURE__ */ new Map();
654
+ constructor() {
655
+ this.onWellboreAdded = this.onWellboreAdded.bind(this), this.onWellboreRemoved = this.onWellboreRemoved.bind(this), addEventListener(_, this.onWellboreAdded), addEventListener(G, this.onWellboreRemoved);
656
+ }
657
+ onWellboreAdded(e) {
658
+ this.map.set(e.detail.id, {
659
+ wellboreId: e.detail.id,
660
+ object: e.detail.object
661
+ });
662
+ }
663
+ onWellboreRemoved(e) {
664
+ this.map.delete(e.detail.id);
665
+ }
666
+ getInfo(e) {
667
+ const r = this.map.get(e);
668
+ if (r)
669
+ return r.object.getWorldPosition(J), {
670
+ ...r,
671
+ position: J.toArray()
672
+ };
673
+ }
674
+ dispose() {
675
+ removeEventListener(_, this.onWellboreAdded), removeEventListener(G, this.onWellboreRemoved);
676
+ }
677
+ }
678
+ function xe(t) {
679
+ return t / 3.28084;
680
+ }
681
+ function ve(t) {
682
+ return t * (Math.PI / 180);
683
+ }
684
+ const Pe = (t, e = 1, r = 1) => [t[0] / e * 2 - 1, -(t[1] / r) * 2 + 1], Te = (t, e = 1, r = 1) => [(t[0] + 1) / 2 * e, (1 - t[1]) / 2 * r];
685
+ var It = `#include <common>
686
+
687
+ varying vec2 vUv;
688
+
689
+ void main() {
690
+ vUv = uv;
691
+ gl_Position = vec4(position, 1.0);
692
+ }`, Ft = `#include <common>
693
+ #include <packing>
694
+
695
+ varying vec2 vUv;
696
+ uniform sampler2D depthTexture;
697
+ uniform float cameraFar;
698
+ uniform float cameraNear;
699
+
700
+ float linearizeDepth(in float depth) {
701
+ float a = cameraFar / (cameraFar - cameraNear);
702
+ float b = cameraFar * cameraNear / (cameraNear - cameraFar);
703
+
704
+ return a + b / depth;
705
+ }
706
+
707
+ float linearizeLogDepth(in float depth) {
708
+ float z = exp2(depth * log2(cameraFar + 1.0)) - 1.0;
709
+ return linearizeDepth(z);
710
+ }
711
+
712
+ void main() {
713
+ float depth = texture(depthTexture, vUv).r;
714
+ float viewZ;
715
+ #if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) || defined( USE_LOGDEPTHBUF )
716
+ viewZ = linearizeLogDepth(depth);
717
+ #else
718
+ viewZ = depth;
719
+ #endif
720
+
721
+ gl_FragColor = packDepthToRGBA(viewZ);
722
+ }`;
723
+ class Vt extends Y {
724
+ constructor() {
725
+ super({
726
+ vertexShader: It,
727
+ fragmentShader: Ft,
728
+ uniforms: {
729
+ cameraNear: { value: 0 },
730
+ cameraFar: { value: 1 },
731
+ depthTexture: { value: null },
732
+ cameraWasPerspective: { value: null }
733
+ },
734
+ toneMapped: !1,
735
+ depthWrite: !1,
736
+ depthTest: !1
737
+ });
738
+ }
739
+ }
740
+ const V = 255 / 256, R = new Float32Array([
741
+ V,
742
+ V / 256,
743
+ V / 256 ** 2,
744
+ V / 256 ** 3
745
+ ]);
746
+ function K(t, e, r, n) {
747
+ return t / 255 * R[0] + e / 255 * R[1] + r / 255 * R[2] + n / 255 * R[3];
748
+ }
749
+ const Rt = new ct(-1, 1, 1, -1, 0, 1), F = new Vt(), st = new lt(), Ut = new ut(2, 2), Dt = new dt(Ut, F);
750
+ let w = null, A = null;
751
+ st.add(Dt);
752
+ async function Ee(t, e, r, n) {
753
+ if (!t) return null;
754
+ try {
755
+ const { width: o, height: s } = t;
756
+ if ((!w || !A || w.width !== o || w.height !== s) && (w?.dispose(), A = new Uint8Array(4 * o * s), w = new ft(o, s, {
757
+ type: gt,
758
+ format: mt,
759
+ depthBuffer: !1,
760
+ stencilBuffer: !1
761
+ })), F.uniforms.depthTexture.value = t, F.uniforms.cameraNear.value = r.near, F.uniforms.cameraFar.value = r.far, F.uniforms.cameraWasPerspective.value = r.isPerspectiveCamera, e.setRenderTarget(w), e.clear(), e.render(st, Rt), e.setRenderTarget(null), await e.readRenderTargetPixelsAsync(
762
+ w,
763
+ 0,
764
+ // x
765
+ 0,
766
+ // y
767
+ o,
768
+ s,
769
+ A
770
+ ), n !== void 0 && Number.isFinite(n))
771
+ return K(
772
+ A[n],
773
+ A[n + 1],
774
+ A[n + 2],
775
+ A[n + 3]
776
+ ) * 2 - 1;
777
+ {
778
+ const a = new Array(A.length / 4);
779
+ for (let i = 0; i < a.length; i++) {
780
+ const c = i * 4;
781
+ a[i] = K(
782
+ A[c],
783
+ A[c + 1],
784
+ A[c + 2],
785
+ A[c + 3]
786
+ ) * 2 - 1;
787
+ }
788
+ return a;
789
+ }
790
+ } catch (o) {
791
+ return console.error(o), null;
792
+ }
793
+ }
794
+ var Ct = `varying vec2 vUv;
795
+
796
+ void main() {
797
+ vUv = uv;
798
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
799
+
800
+ }`, Bt = `varying vec2 vUv;
801
+
802
+ void main() {
803
+
804
+ gl_FragColor = vec4(vUv, 1.0, 1.0);
805
+
806
+ }`;
807
+ const Ie = new Y({
808
+ vertexShader: Ct,
809
+ fragmentShader: Bt
810
+ });
811
+ export {
812
+ ht as $,
813
+ Qt as A,
814
+ Xt as B,
815
+ pe as C,
816
+ Vt as D,
817
+ Mt as E,
818
+ E as F,
819
+ ve as G,
820
+ W as H,
821
+ Yt as I,
822
+ S as J,
823
+ te as K,
824
+ rt as L,
825
+ q as M,
826
+ xe as N,
827
+ zt as O,
828
+ _t as P,
829
+ ue as Q,
830
+ wt as R,
831
+ C as S,
832
+ H as T,
833
+ D as U,
834
+ ee as V,
835
+ Ae as W,
836
+ Ht as X,
837
+ pt as Y,
838
+ bt as Z,
839
+ et as _,
840
+ Gt as a,
841
+ Kt as a0,
842
+ re as a1,
843
+ Ot as a2,
844
+ z as a3,
845
+ xt as a4,
846
+ fe as a5,
847
+ vt as a6,
848
+ de as a7,
849
+ Ee as a8,
850
+ Nt as a9,
851
+ At as aa,
852
+ se as ab,
853
+ Jt as ac,
854
+ Pe as ad,
855
+ ne as ae,
856
+ $t as af,
857
+ le as ag,
858
+ tt as ah,
859
+ jt as ai,
860
+ ge as aj,
861
+ Ie as ak,
862
+ yt as b,
863
+ qt as c,
864
+ B as d,
865
+ Zt as e,
866
+ Te as f,
867
+ Wt as g,
868
+ St as h,
869
+ ce as i,
870
+ be as j,
871
+ N as k,
872
+ j as l,
873
+ oe as m,
874
+ nt as n,
875
+ ie as o,
876
+ ae as p,
877
+ he as q,
878
+ Me as r,
879
+ Z as s,
880
+ G as t,
881
+ me as u,
882
+ Et as v,
883
+ _ as w,
884
+ ye as x,
885
+ we as y,
886
+ $ as z
887
+ };