@corva/ui 3.75.0-13 → 3.75.0-15

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 (228) hide show
  1. package/cjs-bundle/components/AddComment/Popover.js +1 -1
  2. package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
  3. package/cjs-bundle/components/AddComment/components/Content.js +1 -1
  4. package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
  5. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +1 -1
  6. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
  7. package/cjs-bundle/components/BICOffsetPickerDialog/components/Map/Map.js +1 -1
  8. package/cjs-bundle/components/BICOffsetPickerDialog/components/Map/Map.js.map +1 -1
  9. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  10. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  11. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  12. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  13. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  14. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  15. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  16. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  17. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
  18. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  19. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  20. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  21. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  22. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  23. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  24. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  25. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  26. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  27. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  28. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  29. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  30. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  31. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  32. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  33. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  34. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  35. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  36. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  37. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  38. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  39. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  40. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  41. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  42. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  43. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  44. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  45. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  46. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  47. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  48. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  49. package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js +1 -1
  50. package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
  51. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  52. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  53. package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
  54. package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
  55. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  56. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  57. package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js +1 -1
  58. package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js.map +1 -1
  59. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js +1 -1
  60. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js.map +1 -1
  61. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  62. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  63. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js +1 -1
  64. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js.map +1 -1
  65. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  66. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  67. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  68. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  69. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  70. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  71. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  72. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  73. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  74. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  75. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  76. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  77. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  78. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  79. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js +1 -1
  80. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js.map +1 -1
  81. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js +1 -1
  82. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js.map +1 -1
  83. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js +1 -1
  84. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js.map +1 -1
  85. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  86. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  87. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
  88. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
  89. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js +1 -1
  90. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js.map +1 -1
  91. package/cjs-bundle/components/OffsetWellPickerV5/utils/getCoordinatedWells.js +1 -1
  92. package/cjs-bundle/components/OffsetWellPickerV5/utils/getCoordinatedWells.js.map +1 -1
  93. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  94. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  95. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  96. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  97. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js +1 -1
  98. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js.map +1 -1
  99. package/cjs-bundle/effects/useSignedURL.js +1 -1
  100. package/cjs-bundle/effects/useSignedURL.js.map +1 -1
  101. package/cjs-bundle/utils/signedLinkCache.js +2 -0
  102. package/cjs-bundle/utils/signedLinkCache.js.map +1 -0
  103. package/components/AddComment/Popover.js +1 -1
  104. package/components/AddComment/Popover.js.map +1 -1
  105. package/components/AddComment/components/Content.js +1 -1
  106. package/components/AddComment/components/Content.js.map +1 -1
  107. package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -1
  108. package/components/AttachmentPreview/useStoredAttachments.js +1 -1
  109. package/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
  110. package/components/BICOffsetPickerDialog/components/Map/Map.d.ts.map +1 -1
  111. package/components/BICOffsetPickerDialog/components/Map/Map.js +1 -1
  112. package/components/BICOffsetPickerDialog/components/Map/Map.js.map +1 -1
  113. package/components/BICOffsetPickerDialog/index.js +1 -1
  114. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  115. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  116. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  117. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  118. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  119. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  120. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  121. package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
  122. package/components/CommentComposer/useAttachmentUpload.js +1 -1
  123. package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  124. package/components/DocumentViewer/DocumentViewer.js +1 -1
  125. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  126. package/components/Drillstring/BHAComponentDetail/constants.d.ts +2 -2
  127. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  128. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  129. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  130. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  131. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  132. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  133. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  134. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  135. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  136. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  137. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  138. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  139. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  140. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  141. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  142. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  143. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  144. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  145. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  146. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  147. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  148. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  149. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  150. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  151. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  152. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  153. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  154. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  155. package/components/OffsetWellMap/OffsetWellMap.d.ts.map +1 -1
  156. package/components/OffsetWellMap/OffsetWellMap.js +1 -1
  157. package/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
  158. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  159. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  160. package/components/OffsetWellPickerV2/components/Map/Map.d.ts.map +1 -1
  161. package/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
  162. package/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
  163. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  164. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  165. package/components/OffsetWellPickerV2/effects/index.d.ts.map +1 -1
  166. package/components/OffsetWellPickerV2/effects/index.js +1 -1
  167. package/components/OffsetWellPickerV2/effects/index.js.map +1 -1
  168. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.d.ts.map +1 -1
  169. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js +1 -1
  170. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js.map +1 -1
  171. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  172. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  173. package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.d.ts.map +1 -1
  174. package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js +1 -1
  175. package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js.map +1 -1
  176. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  177. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  178. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  179. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  180. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  181. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  182. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  183. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  184. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  185. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  186. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  187. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  188. package/components/OffsetWellPickerV4/effects/useAdvancedWells.d.ts.map +1 -1
  189. package/components/OffsetWellPickerV4/utils/index.d.ts.map +1 -1
  190. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  191. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  192. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js +1 -1
  193. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js.map +1 -1
  194. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js +1 -1
  195. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js.map +1 -1
  196. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.d.ts.map +1 -1
  197. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js +1 -1
  198. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js.map +1 -1
  199. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  200. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  201. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
  202. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
  203. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.d.ts.map +1 -1
  204. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js +1 -1
  205. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js.map +1 -1
  206. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.d.ts.map +1 -1
  207. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.js +1 -1
  208. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.js.map +1 -1
  209. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  210. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  211. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  212. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  213. package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.d.ts.map +1 -1
  214. package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js +1 -1
  215. package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js.map +1 -1
  216. package/effects/useSignedURL.d.ts +1 -1
  217. package/effects/useSignedURL.d.ts.map +1 -1
  218. package/effects/useSignedURL.js +1 -1
  219. package/effects/useSignedURL.js.map +1 -1
  220. package/mcp-server/server.mjs +4 -4
  221. package/package.json +1 -1
  222. package/tsconfig.tsbuildinfo +1 -1
  223. package/utils/__tests__/signedLinkCache.test.d.ts +2 -0
  224. package/utils/__tests__/signedLinkCache.test.d.ts.map +1 -0
  225. package/utils/signedLinkCache.d.ts +9 -0
  226. package/utils/signedLinkCache.d.ts.map +1 -0
  227. package/utils/signedLinkCache.js +2 -0
  228. package/utils/signedLinkCache.js.map +1 -0
@@ -1,2 +1,2 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{useState as o,useRef as c,useMemo as i,useEffect as u}from"react";import{getAttachmentKind as a}from"./getAttachmentKind.js";import{getIsStoredKey as f}from"./useStoredAttachment.js";import{getS3DownloadLink as s}from"../../clients/jsonApi/index.js";function p(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var l=function(){var r=n(t.mark((function r(e,n){var o,c;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,s(e,n);case 3:return o=r.sent,c=o.url,r.abrupt("return",c);case 8:return r.prev=8,r.t0=r.catch(0),console.error('Failed to sign attachment "'.concat(e,'"'),r.t0),r.abrupt("return","");case 12:case"end":return r.stop()}}),r,null,[[0,8]])})));return function(e,n){return r.apply(this,arguments)}}(),b=function(n){var t=o({}),s=e(t,2),p=s[0],b=s[1],h=c(p);h.current=p;var v=i((function(){return null!=n?n:[]}),[n]),O=v.map((function(r){return r.name})).join("|");return u((function(){var e=v.filter((function(r){return!(r.name in h.current)}));if(e.length){var n=!0,t=function(e,n){return b((function(t){return m(m({},t),{},r({},e,m(m({},t[e]),n)))}))};return b((function(r){var n=m({},r);return e.forEach((function(r){var e;n[r.name]=null!==(e=n[r.name])&&void 0!==e?e:{}})),n})),e.forEach((function(r){f(r.name)?l(r.name,"inline").then((function(e){n&&e&&t(r.name,{src:e})})):t(r.name,{src:r.url})})),function(){n=!1}}}),[O]),v.reduce((function(r,e){var n=p[e.name];return null!=n&&n.src?(r.push({id:e.url,name:e.name,src:n.src,kind:a(e),size:e.size}),r):r}),[])};export{b as useStoredAttachments};
1
+ import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{useState as o,useRef as u,useMemo as c,useEffect as i}from"react";import{getAttachmentKind as a}from"./getAttachmentKind.js";import{getIsStoredKey as f}from"./useStoredAttachment.js";import{getSignedLink as m,peekSignedLink as s}from"../../utils/signedLinkCache.js";function p(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var b=function(){var r=n(t.mark((function r(e){return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,m(e,"inline");case 3:return r.abrupt("return",r.sent);case 6:return r.prev=6,r.t0=r.catch(0),console.error('Failed to sign attachment "'.concat(e,'"'),r.t0),r.abrupt("return","");case 10:case"end":return r.stop()}}),r,null,[[0,6]])})));return function(e){return r.apply(this,arguments)}}(),h=function(n){var t=o((function(){return function(r){return r.reduce((function(r,e){var n=f(e.name)?s(e.name,"inline"):e.url;return n&&(r[e.name]={src:n}),r}),{})}(null!=n?n:[])})),m=e(t,2),p=m[0],h=m[1],v=u(p);v.current=p;var O=c((function(){return null!=n?n:[]}),[n]),j=O.map((function(r){return r.name})).join("|");return i((function(){var e=O.filter((function(r){return!(r.name in v.current)}));if(e.length){var n=!0,t=function(e,n){return h((function(t){return l(l({},t),{},r({},e,l(l({},t[e]),n)))}))};return h((function(r){var n=l({},r);return e.forEach((function(r){var e;n[r.name]=null!==(e=n[r.name])&&void 0!==e?e:{}})),n})),e.forEach((function(r){f(r.name)?b(r.name).then((function(e){n&&e&&t(r.name,{src:e})})):t(r.name,{src:r.url})})),function(){n=!1}}}),[j]),O.reduce((function(r,e){var n=p[e.name];return null!=n&&n.src?(r.push({id:e.url,name:e.name,src:n.src,kind:a(e),size:e.size}),r):r}),[])};export{h as useStoredAttachments};
2
2
  //# sourceMappingURL=useStoredAttachments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStoredAttachments.js","sources":["../../../src/components/AttachmentPreview/useStoredAttachments.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { AttachmentPreviewItem } from './AttachmentPreview.types';\nimport { getAttachmentKind } from './getAttachmentKind';\nimport { getIsStoredKey, type StoredAttachment } from './useStoredAttachment';\n\nimport { getS3DownloadLink } from '~/clients/jsonApi';\n\ntype SignedLinks = Record<string, { src?: string }>;\n\nconst getSignedLink = async (name: string, disposition: 'attachment' | 'inline') => {\n try {\n const { url } = await getS3DownloadLink(name, disposition);\n\n return url;\n } catch (error) {\n console.error(`Failed to sign attachment \"${name}\"`, error);\n\n return '';\n }\n};\n\n/**\n * Signs a whole list of stored attachments — the hook-per-file `useStoredAttachment`\n * can't cover a list whose length changes between renders.\n */\nexport const useStoredAttachments = (\n attachments?: StoredAttachment[] | null\n): AttachmentPreviewItem[] => {\n const [links, setLinks] = useState<SignedLinks>({});\n const linksRef = useRef(links);\n linksRef.current = links;\n\n const list = useMemo(() => attachments ?? [], [attachments]);\n const key = list.map(attachment => attachment.name).join('|');\n\n useEffect(() => {\n const pending = list.filter(attachment => !(attachment.name in linksRef.current));\n if (!pending.length) return undefined;\n\n let isActive = true;\n\n const applyLink = (name: string, patch: SignedLinks[string]) =>\n setLinks(prev => ({ ...prev, [name]: { ...prev[name], ...patch } }));\n\n // Claim the names up front so a re-render mid-flight does not ask again.\n setLinks(prev => {\n const claimed = { ...prev };\n\n pending.forEach(attachment => {\n claimed[attachment.name] = claimed[attachment.name] ?? {};\n });\n\n return claimed;\n });\n\n pending.forEach(attachment => {\n // A linked attachment already carries a url that works; only a key of ours needs signing.\n if (!getIsStoredKey(attachment.name)) {\n applyLink(attachment.name, { src: attachment.url });\n\n return;\n }\n\n getSignedLink(attachment.name, 'inline').then(src => {\n if (isActive && src) applyLink(attachment.name, { src });\n });\n });\n\n return () => {\n isActive = false;\n };\n // `key` tracks the list contents; `list` itself is a fresh array on every render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [key]);\n\n return list.reduce<AttachmentPreviewItem[]>((acc, attachment) => {\n const link = links[attachment.name];\n if (!link?.src) return acc;\n\n acc.push({\n id: attachment.url,\n name: attachment.name,\n src: link.src,\n kind: getAttachmentKind(attachment),\n size: attachment.size,\n });\n return acc;\n }, []);\n};\n"],"names":["getSignedLink","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","name","disposition","_yield$getS3DownloadL","url","wrap","_context","prev","next","getS3DownloadLink","sent","abrupt","t0","console","error","stop","_x","_x2","apply","this","arguments","useStoredAttachments","attachments","_useState","useState","_useState2","_slicedToArray","links","setLinks","linksRef","useRef","current","list","useMemo","key","map","attachment","join","useEffect","pending","filter","length","isActive","applyLink","patch","_objectSpread","claimed","forEach","_claimed$attachment$n","getIsStoredKey","then","src","reduce","acc","link","push","id","kind","getAttachmentKind","size"],"mappings":"0gCAUA,IAAMA,EAAa,WAAA,IAAGC,EAAAC,EAAAC,EAAAC,MAAA,SAAAC,EAAOC,EAAcC,GAAoC,IAAAC,EAAAC,EAAA,OAAAN,EAAAO,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAC,KAAA,EAAAD,EAAAE,KAAA,EAErDC,EAAkBR,EAAMC,GAAY,KAAA,EAA/C,OAA+CC,EAAAG,EAAAI,KAAlDN,IAAAA,IAAGE,EAAAK,OAAA,SAEJP,GAAG,KAAA,EAEk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EAAWnC,MAM/BN,EAAcyC,EAAWnC,KAAM,UAAUiD,MAAK,SAAAC,GACxCT,GAAYS,GAAKR,EAAUP,EAAWnC,KAAM,CAAEkD,IAAAA,GACpD,IAPER,EAAUP,EAAWnC,KAAM,CAAEkD,IAAKf,EAAWhC,KAQjD,IAEO,WACLsC,GAAW,EAhCwB,CAoCvC,GAAG,CAACR,IAEGF,EAAKoB,QAAgC,SAACC,EAAKjB,GAChD,IAAMkB,EAAO3B,EAAMS,EAAWnC,MAC9B,OAAKqD,SAAAA,EAAMH,KAEXE,EAAIE,KAAK,CACPC,GAAIpB,EAAWhC,IACfH,KAAMmC,EAAWnC,KACjBkD,IAAKG,EAAKH,IACVM,KAAMC,EAAkBtB,GACxBuB,KAAMvB,EAAWuB,OAEZN,GATgBA,CAUxB,GAAE,GACL"}
1
+ {"version":3,"file":"useStoredAttachments.js","sources":["../../../src/components/AttachmentPreview/useStoredAttachments.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { AttachmentPreviewItem } from './AttachmentPreview.types';\nimport { getAttachmentKind } from './getAttachmentKind';\nimport { getIsStoredKey, type StoredAttachment } from './useStoredAttachment';\n\nimport { getSignedLink, peekSignedLink } from '~/utils/signedLinkCache';\n\ntype SignedLinks = Record<string, { src?: string }>;\n\nconst signStoredLink = async (name: string) => {\n try {\n return await getSignedLink(name, 'inline');\n } catch (error) {\n console.error(`Failed to sign attachment \"${name}\"`, error);\n\n return '';\n }\n};\n\nconst seedLinks = (attachments: StoredAttachment[]): SignedLinks =>\n attachments.reduce<SignedLinks>((acc, attachment) => {\n const src = getIsStoredKey(attachment.name)\n ? peekSignedLink(attachment.name, 'inline')\n : attachment.url;\n if (src) acc[attachment.name] = { src };\n\n return acc;\n }, {});\n\n/**\n * Signs a whole list of stored attachments — the hook-per-file `useStoredAttachment`\n * can't cover a list whose length changes between renders.\n */\nexport const useStoredAttachments = (\n attachments?: StoredAttachment[] | null\n): AttachmentPreviewItem[] => {\n const [links, setLinks] = useState<SignedLinks>(() => seedLinks(attachments ?? []));\n const linksRef = useRef(links);\n linksRef.current = links;\n\n const list = useMemo(() => attachments ?? [], [attachments]);\n const key = list.map(attachment => attachment.name).join('|');\n\n useEffect(() => {\n const pending = list.filter(attachment => !(attachment.name in linksRef.current));\n if (!pending.length) return undefined;\n\n let isActive = true;\n\n const applyLink = (name: string, patch: SignedLinks[string]) =>\n setLinks(prev => ({ ...prev, [name]: { ...prev[name], ...patch } }));\n\n // Claim the names up front so a re-render mid-flight does not ask again.\n setLinks(prev => {\n const claimed = { ...prev };\n\n pending.forEach(attachment => {\n claimed[attachment.name] = claimed[attachment.name] ?? {};\n });\n\n return claimed;\n });\n\n pending.forEach(attachment => {\n // A linked attachment already carries a url that works; only a key of ours needs signing.\n if (!getIsStoredKey(attachment.name)) {\n applyLink(attachment.name, { src: attachment.url });\n\n return;\n }\n\n signStoredLink(attachment.name).then(src => {\n if (isActive && src) applyLink(attachment.name, { src });\n });\n });\n\n return () => {\n isActive = false;\n };\n // `key` tracks the list contents; `list` itself is a fresh array on every render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [key]);\n\n return list.reduce<AttachmentPreviewItem[]>((acc, attachment) => {\n const link = links[attachment.name];\n if (!link?.src) return acc;\n\n acc.push({\n id: attachment.url,\n name: attachment.name,\n src: link.src,\n kind: getAttachmentKind(attachment),\n size: attachment.size,\n });\n return acc;\n }, []);\n};\n"],"names":["signStoredLink","_ref","_asyncToGenerator","_regeneratorRuntime","mark","name","wrap","_context","prev","next","getSignedLink","abrupt","sent","t0","console","error","stop","_callee","_x","apply","this","arguments","useStoredAttachments","attachments","_useState","useState","reduce","acc","attachment","src","getIsStoredKey","peekSignedLink","url","seedLinks","_useState2","_slicedToArray","links","setLinks","linksRef","useRef","current","list","useMemo","key","map","join","useEffect","pending","filter","length","isActive","applyLink","patch","_objectSpread","claimed","forEach","_claimed$attachment$n","then","link","push","id","kind","getAttachmentKind","size"],"mappings":"0hCAUA,I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AAC,EAChB,WAAkB,EAClB,KAAK,EACL,WAAkB,EAClB,MAAM,EACN,qBAAkE,EAClE,cAAmD,EACnD,cAAgD,GACjD;;;;;;;;CAAA,+BAmOA"}
1
+ {"version":3,"file":"Map.d.ts","sourceRoot":"","sources":["../../../../../src/components/BICOffsetPickerDialog/components/Map/Map.js"],"names":[],"mappings":"AAUA,OAAO,8BAA8B,CAAC;AAyCtC,iBAAS,QAAQ,CAAC,EAChB,WAAkB,EAClB,KAAK,EACL,WAAkB,EAClB,MAAM,EACN,qBAAkE,EAClE,cAAmD,EACnD,cAAgD,GACjD;;;;;;;;CAAA,+BAmOA"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import{memo as r,useRef as t,useState as o,useMemo as n,useEffect as i,createElement as u}from"react";import a from"prop-types";import{get as l}from"lodash";import c from"./Map.css.js";import{mapbox as s}from"../../../../utils/index.js";import{createAdaptiveRoot as d}from"../../../../utils/createAdaptiveRoot.js";import"../../../../config/mapboxGl/index.js";import{IS_MAPBOX_ENABLED as p}from"../../../../config/mapbox/index.js";import"mapbox-gl/dist/mapbox-gl.css";import{jsx as f}from"react/jsx-runtime";import m from"mapbox-gl";var v=s.isValidCoordinates,y=[29.749907,-95.358421],g="wells-highlight",h={type:"FeatureCollection",features:[]},w=function(r){var t=e(r,2),o=t[0];return[t[1],o]};function b(r){var a=r.subjectWell,s=void 0===a?null:a,b=r.wells,j=r.offsetWells,C=void 0===j?null:j,M=r.radius,D=r.subjectWellMarkerSize,F=void 0===D?x:D,P=r.wellMarkerSize,L=void 0===P?S:P,W=r.coordsDataPath,k=void 0===W?"settings.top_hole.coordinates":W,z=t(null),B=t(null),I=t(null),R=t(null),T=t(null),q=t(null),N=t(),O=o(!1),A=e(O,2),E=A[0],G=A[1],H=n((function(){return s&&l(s,k)}),[s,k]);i((function(){if(p){B.current=new m.Map({container:z.current,style:"mapbox://styles/mapbox/dark-v9",center:w(y),zoom:1,attributionControl:!1,scrollZoom:!1}),B.current.addControl(new m.NavigationControl({showCompass:!1}),"bottom-right"),B.current.on("load",(function(){B.current.addSource("radius-circle",{type:"geojson",data:h}),B.current.addLayer({id:"radius-circle",type:"fill",source:"radius-circle",paint:{"fill-color":"#03BCD4","fill-opacity":.2}}),B.current.addSource("wells",{type:"geojson",data:h}),B.current.addLayer({id:"wells",type:"circle",source:"wells",paint:{"circle-radius":["get","radius"],"circle-color":"#FFC107","circle-opacity":["get","opacity"]}}),B.current.addSource(g,{type:"geojson",data:h}),B.current.addLayer({id:g,type:"circle",source:g,paint:{"circle-radius":["get","radius"],"circle-color":"#FFC107","circle-opacity":.2}}),G(!0)}));var e=B.current;return function(){var r;null===(r=T.current)||void 0===r||r.unmount(),T.current=null,q.current=null,e.remove(),B.current=null,I.current=null}}}),[]),i((function(){if(B.current&&E)if(H){var r=function(r,t){for(var o=e(r,2),n=o[0],i=o[1],u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,a=[],l=t/(111320*Math.cos(n*Math.PI/180)),c=t/110574,s=0;s<=u;s+=1){var d=s/u*(2*Math.PI);a.push([i+l*Math.cos(d),n+c*Math.sin(d)])}return a}(H,1609.34*M);B.current.getSource("radius-circle").setData({type:"Feature",geometry:{type:"Polygon",coordinates:[r]}})}else B.current.getSource("radius-circle").setData(h)}),[M,H,E]);return i((function(){var e;if(B.current&&E){var r=N.current;N.current=b,null===(e=R.current)||void 0===e||e.remove(),B.current.getSource(g).setData(h);var t=C.map((function(e){return e.id})),o=[],n={},i=new m.LngLatBounds;b.forEach((function(e){var r=l(e,k);if(r&&v(r)){var u=s&&s.id===e.id,a=t.includes(e.id),c=u?F:L,d=u||a?1:.3;n[e.id]=e,i.extend(w(r)),o.push({type:"Feature",geometry:{type:"Point",coordinates:w(r)},properties:{wellId:e.id,radius:c,opacity:d}})}})),B.current.getSource("wells").setData({type:"FeatureCollection",features:o}),I.current=o.length?i:null;var a=B.current,c=null,p=function(e){a.getCanvas().style.cursor="pointer";var r=n[e.features[0].properties.wellId];if(r&&r.id!==c){c=r.id;var t=l(r,k);q.current||(q.current=document.createElement("div"),T.current=d(q.current)),T.current.render(u((function(e){var r=e.well;return f("div",{style:{color:"#fff",background:"##414141"},children:f("span",{style:{fontSize:"11px",lineHeight:"16px"},children:l(r,"name")})})}),{well:r})),R.current||(R.current=new m.Popup({closeButton:!1,maxWidth:"none"})),R.current.setLngLat(w(t)).setDOMContent(q.current).addTo(a),function(e,r){B.current.getSource(g).setData({type:"Feature",geometry:{type:"Point",coordinates:w(e)},properties:{radius:3*r}})}(t,e.features[0].properties.radius)}},y=function(){var e;c=null,a.getCanvas().style.cursor="",a.getSource(g).setData(h),null===(e=R.current)||void 0===e||e.remove()},x=function(e){null!=e&&e.point&&a.queryRenderedFeatures(e.point,{layers:[g]}).length||y()};return a.on("mousemove","wells",p),a.on("mouseleave","wells",x),a.on("mouseleave",g,y),setTimeout((function(){B.current&&I.current&&b!==r&&B.current.fitBounds(I.current)}),500),function(){a.off("mousemove","wells",p),a.off("mouseleave","wells",x),a.off("mouseleave",g,y)}}}),[s,b,C,E]),f("div",{className:c.map,children:f("div",{className:c.mapMain,ref:z})})}b.propTypes={subjectWell:a.shape({id:a.number,formation:a.string}),wells:a.arrayOf(a.shape({})).isRequired,offsetWells:a.arrayOf(a.shape({})),radius:a.number.isRequired,subjectWellMarkerSize:a.number,wellMarkerSize:a.number,coordsDataPath:a.string};var x=8,S=5,j=r(b);export{j as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import{memo as r,useRef as t,useState as o,useMemo as n,useEffect as i,createElement as u}from"react";import a from"prop-types";import{get as l}from"lodash";import c from"./Map.css.js";import{mapbox as s}from"../../../../utils/index.js";import{createAdaptiveRoot as d}from"../../../../utils/createAdaptiveRoot.js";import"../../../../config/mapboxGl/index.js";import{IS_MAPBOX_ENABLED as p}from"../../../../config/mapbox/index.js";import"mapbox-gl/dist/mapbox-gl.css";import{jsx as f}from"react/jsx-runtime";import m from"mapbox-gl";var v=[29.749907,-95.358421],y="wells-highlight",g={type:"FeatureCollection",features:[]},h=function(r){var t=e(r,2),o=t[0];return[t[1],o]};function w(r){var a=r.subjectWell,w=void 0===a?null:a,S=r.wells,j=r.offsetWells,C=void 0===j?null:j,M=r.radius,D=r.subjectWellMarkerSize,F=void 0===D?b:D,P=r.wellMarkerSize,L=void 0===P?x:P,W=r.coordsDataPath,k=void 0===W?"settings.top_hole.coordinates":W,z=t(null),B=t(null),I=t(null),R=t(null),T=t(null),q=t(null),N=t(),O=o(!1),A=e(O,2),E=A[0],G=A[1],H=n((function(){return w&&l(w,k)}),[w,k]);i((function(){if(p){B.current=new m.Map({container:z.current,style:"mapbox://styles/mapbox/dark-v9",center:h(v),zoom:1,attributionControl:!1,scrollZoom:!1}),B.current.addControl(new m.NavigationControl({showCompass:!1}),"bottom-right"),B.current.on("load",(function(){B.current.addSource("radius-circle",{type:"geojson",data:g}),B.current.addLayer({id:"radius-circle",type:"fill",source:"radius-circle",paint:{"fill-color":"#03BCD4","fill-opacity":.2}}),B.current.addSource("wells",{type:"geojson",data:g}),B.current.addLayer({id:"wells",type:"circle",source:"wells",paint:{"circle-radius":["get","radius"],"circle-color":"#FFC107","circle-opacity":["get","opacity"]}}),B.current.addSource(y,{type:"geojson",data:g}),B.current.addLayer({id:y,type:"circle",source:y,paint:{"circle-radius":["get","radius"],"circle-color":"#FFC107","circle-opacity":.2}}),G(!0)}));var e=B.current;return function(){var r;null===(r=T.current)||void 0===r||r.unmount(),T.current=null,q.current=null,e.remove(),B.current=null,I.current=null}}}),[]),i((function(){if(B.current&&E)if(H){var r=function(r,t){for(var o=e(r,2),n=o[0],i=o[1],u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,a=[],l=t/(111320*Math.cos(n*Math.PI/180)),c=t/110574,s=0;s<=u;s+=1){var d=s/u*(2*Math.PI);a.push([i+l*Math.cos(d),n+c*Math.sin(d)])}return a}(H,1609.34*M);B.current.getSource("radius-circle").setData({type:"Feature",geometry:{type:"Polygon",coordinates:[r]}})}else B.current.getSource("radius-circle").setData(g)}),[M,H,E]);return i((function(){var e;if(B.current&&E){var r=N.current;N.current=S,null===(e=R.current)||void 0===e||e.remove(),B.current.getSource(y).setData(g);var t=C.map((function(e){return e.id})),o=[],n={},i=new m.LngLatBounds;S.forEach((function(e){var r=l(e,k);if(r&&s.isValidCoordinates(r)){var u=w&&w.id===e.id,a=t.includes(e.id),c=u?F:L,d=u||a?1:.3;n[e.id]=e,i.extend(h(r)),o.push({type:"Feature",geometry:{type:"Point",coordinates:h(r)},properties:{wellId:e.id,radius:c,opacity:d}})}})),B.current.getSource("wells").setData({type:"FeatureCollection",features:o}),I.current=o.length?i:null;var a=B.current,c=null,p=function(e){a.getCanvas().style.cursor="pointer";var r=n[e.features[0].properties.wellId];if(r&&r.id!==c){c=r.id;var t=l(r,k);q.current||(q.current=document.createElement("div"),T.current=d(q.current)),T.current.render(u((function(e){var r=e.well;return f("div",{style:{color:"#fff",background:"##414141"},children:f("span",{style:{fontSize:"11px",lineHeight:"16px"},children:l(r,"name")})})}),{well:r})),R.current||(R.current=new m.Popup({closeButton:!1,maxWidth:"none"})),R.current.setLngLat(h(t)).setDOMContent(q.current).addTo(a),function(e,r){B.current.getSource(y).setData({type:"Feature",geometry:{type:"Point",coordinates:h(e)},properties:{radius:3*r}})}(t,e.features[0].properties.radius)}},v=function(){var e;c=null,a.getCanvas().style.cursor="",a.getSource(y).setData(g),null===(e=R.current)||void 0===e||e.remove()},b=function(e){null!=e&&e.point&&a.queryRenderedFeatures(e.point,{layers:[y]}).length||v()};return a.on("mousemove","wells",p),a.on("mouseleave","wells",b),a.on("mouseleave",y,v),setTimeout((function(){B.current&&I.current&&S!==r&&B.current.fitBounds(I.current)}),500),function(){a.off("mousemove","wells",p),a.off("mouseleave","wells",b),a.off("mouseleave",y,v)}}}),[w,S,C,E]),f("div",{className:c.map,children:f("div",{className:c.mapMain,ref:z})})}w.propTypes={subjectWell:a.shape({id:a.number,formation:a.string}),wells:a.arrayOf(a.shape({})).isRequired,offsetWells:a.arrayOf(a.shape({})),radius:a.number.isRequired,subjectWellMarkerSize:a.number,wellMarkerSize:a.number,coordsDataPath:a.string};var b=8,x=5,S=r(w);export{S as default};
2
2
  //# sourceMappingURL=Map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Map.js","sources":["../../../../../src/components/BICOffsetPickerDialog/components/Map/Map.js"],"sourcesContent":["import { createElement, memo, useRef, useEffect, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { get } from 'lodash';\n\nimport styles from './Map.css';\n\nimport { mapbox } from '~/utils';\nimport { createAdaptiveRoot } from '~/utils/createAdaptiveRoot';\nimport mapboxgl from '~/config/mapboxGl';\nimport { IS_MAPBOX_ENABLED } from '~/config/mapbox';\nimport 'mapbox-gl/dist/mapbox-gl.css';\n\nconst { isValidCoordinates } = mapbox;\n\nconst RADIUS_CIRCLE_COLOR = '#03BCD4';\nconst METERS_IN_MILE = 1609.34;\nconst DEFAULT_SUBJECT_WELL_MARKER_SIZE = 8;\nconst DEFAULT_WELL_MARKER_SIZE = 5;\nconst OFFSET_WELL_COLOR = '#FFC107';\n\nconst DEFAULT_COORDS = [29.749907, -95.358421]; // TX coordinates\n\nconst RADIUS_CIRCLE_ID = 'radius-circle';\nconst WELLS_ID = 'wells';\nconst HIGHLIGHT_ID = 'wells-highlight';\nconst EMPTY_FEATURE_COLLECTION = { type: 'FeatureCollection', features: [] };\n\nconst toLngLat = ([lat, lng]) => [lng, lat];\n\n// NOTE: mapbox-gl has no geographic-radius circle primitive, so approximate it with a polygon\nconst makeCirclePolygon = ([lat, lng], radiusMeters, points = 64) => {\n const ring = [];\n const distanceX = radiusMeters / (111320 * Math.cos((lat * Math.PI) / 180));\n const distanceY = radiusMeters / 110574;\n for (let i = 0; i <= points; i += 1) {\n const theta = (i / points) * (2 * Math.PI);\n ring.push([lng + distanceX * Math.cos(theta), lat + distanceY * Math.sin(theta)]);\n }\n return ring;\n};\n\nconst toolTip =\n () =>\n // eslint-disable-next-line react/prop-types\n ({ well }) => {\n return (\n <div style={{ color: '#fff', background: '##414141' }}>\n <span style={{ fontSize: '11px', lineHeight: '16px' }}>{get(well, 'name')}</span>\n </div>\n );\n };\n\n// eslint-disable-next-line no-unused-vars\nfunction WellsMap({\n subjectWell = null,\n wells,\n offsetWells = null,\n radius,\n subjectWellMarkerSize = DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE,\n wellMarkerSize = DEFAULT_WELLS_MAP_WELL_MARKER_SIZE,\n coordsDataPath = 'settings.top_hole.coordinates',\n}) {\n const mapContainerRef = useRef(null);\n const mapRef = useRef(null);\n const markersBoundsRef = useRef(null);\n const popupRef = useRef(null);\n const tooltipRootRef = useRef(null);\n const tooltipContainerRef = useRef(null);\n const prevWellsRef = useRef();\n const [isMapReady, setIsMapReady] = useState(false);\n\n const subjectWellCoords = useMemo(() => {\n return subjectWell && get(subjectWell, coordsDataPath);\n }, [subjectWell, coordsDataPath]);\n\n // NOTE: Initialize map\n useEffect(() => {\n if (!IS_MAPBOX_ENABLED) return undefined;\n\n mapRef.current = new mapboxgl.Map({\n container: mapContainerRef.current,\n style: 'mapbox://styles/mapbox/dark-v9',\n center: toLngLat(DEFAULT_COORDS),\n zoom: 1,\n attributionControl: false,\n scrollZoom: false,\n });\n\n mapRef.current.addControl(\n new mapboxgl.NavigationControl({ showCompass: false }),\n 'bottom-right'\n );\n\n // NOTE: Sources/layers can only be added once the style has loaded.\n // The radius circle layer is added first so well markers render above it (was bringToBack),\n // and the hover highlight layer last so it renders on top of the markers\n mapRef.current.on('load', () => {\n mapRef.current.addSource(RADIUS_CIRCLE_ID, {\n type: 'geojson',\n data: EMPTY_FEATURE_COLLECTION,\n });\n mapRef.current.addLayer({\n id: RADIUS_CIRCLE_ID,\n type: 'fill',\n source: RADIUS_CIRCLE_ID,\n paint: {\n 'fill-color': RADIUS_CIRCLE_COLOR,\n 'fill-opacity': 0.2,\n },\n });\n\n mapRef.current.addSource(WELLS_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n mapRef.current.addLayer({\n id: WELLS_ID,\n type: 'circle',\n source: WELLS_ID,\n paint: {\n 'circle-radius': ['get', 'radius'],\n 'circle-color': OFFSET_WELL_COLOR,\n 'circle-opacity': ['get', 'opacity'],\n },\n });\n\n mapRef.current.addSource(HIGHLIGHT_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n mapRef.current.addLayer({\n id: HIGHLIGHT_ID,\n type: 'circle',\n source: HIGHLIGHT_ID,\n paint: {\n 'circle-radius': ['get', 'radius'],\n 'circle-color': OFFSET_WELL_COLOR,\n 'circle-opacity': 0.2,\n },\n });\n\n setIsMapReady(true);\n });\n\n const map = mapRef.current;\n return () => {\n tooltipRootRef.current?.unmount();\n tooltipRootRef.current = null;\n tooltipContainerRef.current = null;\n\n map.remove();\n mapRef.current = null;\n markersBoundsRef.current = null;\n };\n }, []);\n\n // NOTE: Radius circle\n useEffect(() => {\n if (!mapRef.current || !isMapReady) {\n return;\n }\n\n if (!subjectWellCoords) {\n mapRef.current.getSource(RADIUS_CIRCLE_ID).setData(EMPTY_FEATURE_COLLECTION);\n return;\n }\n\n const ring = makeCirclePolygon(subjectWellCoords, radius * METERS_IN_MILE);\n mapRef.current.getSource(RADIUS_CIRCLE_ID).setData({\n type: 'Feature',\n geometry: { type: 'Polygon', coordinates: [ring] },\n });\n }, [radius, subjectWellCoords, isMapReady]);\n\n const handleMouseOver = (coords, r) => {\n // Highlight the hovered well with a bigger translucent circle\n mapRef.current.getSource(HIGHLIGHT_ID).setData({\n type: 'Feature',\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: { radius: r * 3 },\n });\n };\n\n // NOTE: Well markers\n useEffect(() => {\n if (!mapRef.current || !isMapReady) {\n return undefined;\n }\n\n const prevWells = prevWellsRef.current;\n prevWellsRef.current = wells;\n\n popupRef.current?.remove();\n mapRef.current.getSource(HIGHLIGHT_ID).setData(EMPTY_FEATURE_COLLECTION);\n\n const offsetWellIds = offsetWells.map(well => well.id);\n\n const features = [];\n const wellsById = {};\n const bounds = new mapboxgl.LngLatBounds();\n wells.forEach(well => {\n const coords = get(well, coordsDataPath);\n\n if (coords && isValidCoordinates(coords)) {\n const isWellSubject = subjectWell && subjectWell.id === well.id;\n const isWellOffset = offsetWellIds.includes(well.id);\n const r = isWellSubject ? subjectWellMarkerSize : wellMarkerSize;\n const opacity = isWellSubject || isWellOffset ? 1 : 0.3;\n\n wellsById[well.id] = well;\n bounds.extend(toLngLat(coords));\n features.push({\n type: 'Feature',\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: { wellId: well.id, radius: r, opacity },\n });\n }\n });\n\n mapRef.current.getSource(WELLS_ID).setData({ type: 'FeatureCollection', features });\n markersBoundsRef.current = features.length ? bounds : null;\n\n const map = mapRef.current;\n let hoveredWellId = null;\n\n const handleMouseMove = e => {\n map.getCanvas().style.cursor = 'pointer';\n\n const well = wellsById[e.features[0].properties.wellId];\n if (!well || well.id === hoveredWellId) {\n return;\n }\n hoveredWellId = well.id;\n\n const coords = get(well, coordsDataPath);\n\n // Tooltip\n if (!tooltipContainerRef.current) {\n tooltipContainerRef.current = document.createElement('div');\n tooltipRootRef.current = createAdaptiveRoot(tooltipContainerRef.current);\n }\n tooltipRootRef.current.render(createElement(toolTip(), { well }));\n\n if (!popupRef.current) {\n popupRef.current = new mapboxgl.Popup({ closeButton: false, maxWidth: 'none' });\n }\n popupRef.current\n .setLngLat(toLngLat(coords))\n .setDOMContent(tooltipContainerRef.current)\n .addTo(map);\n\n // Highlight\n handleMouseOver(coords, e.features[0].properties.radius);\n };\n\n // NOTE: was the mouseout handler of the Leaflet highlight marker\n const handleHighlightMouseLeave = () => {\n hoveredWellId = null;\n map.getCanvas().style.cursor = '';\n map.getSource(HIGHLIGHT_ID).setData(EMPTY_FEATURE_COLLECTION);\n popupRef.current?.remove();\n };\n\n // NOTE: If the pointer exits before the highlight renders under it, the highlight\n // layer never emits mouseleave — clear here unless the cursor is inside the highlight\n const handleWellsMouseLeave = e => {\n if (e?.point && map.queryRenderedFeatures(e.point, { layers: [HIGHLIGHT_ID] }).length) {\n return;\n }\n handleHighlightMouseLeave();\n };\n\n map.on('mousemove', WELLS_ID, handleMouseMove);\n map.on('mouseleave', WELLS_ID, handleWellsMouseLeave);\n map.on('mouseleave', HIGHLIGHT_ID, handleHighlightMouseLeave);\n\n setTimeout(() => {\n if (mapRef.current && markersBoundsRef.current && wells !== prevWells) {\n mapRef.current.fitBounds(markersBoundsRef.current);\n }\n }, 500);\n\n return () => {\n map.off('mousemove', WELLS_ID, handleMouseMove);\n map.off('mouseleave', WELLS_ID, handleWellsMouseLeave);\n map.off('mouseleave', HIGHLIGHT_ID, handleHighlightMouseLeave);\n };\n }, [subjectWell, wells, offsetWells, isMapReady]);\n\n return (\n <div className={styles.map}>\n <div className={styles.mapMain} ref={mapContainerRef} />\n </div>\n );\n}\n\nWellsMap.propTypes = {\n subjectWell: PropTypes.shape({\n id: PropTypes.number,\n formation: PropTypes.string,\n }),\n wells: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n offsetWells: PropTypes.arrayOf(PropTypes.shape({})),\n radius: PropTypes.number.isRequired,\n subjectWellMarkerSize: PropTypes.number,\n wellMarkerSize: PropTypes.number,\n coordsDataPath: PropTypes.string,\n};\n\nconst DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE = DEFAULT_SUBJECT_WELL_MARKER_SIZE;\nconst DEFAULT_WELLS_MAP_WELL_MARKER_SIZE = DEFAULT_WELL_MARKER_SIZE;\n\nexport default memo(WellsMap);\n"],"names":["isValidCoordinates","mapbox","DEFAULT_COORDS","HIGHLIGHT_ID","EMPTY_FEATURE_COLLECTION","type","features","toLngLat","_ref","_ref2","_slicedToArray","lat","WellsMap","_ref6","_ref6$subjectWell","subjectWell","wells","_ref6$offsetWells","offsetWells","radius","_ref6$subjectWellMark","subjectWellMarkerSize","DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE","_ref6$wellMarkerSize","wellMarkerSize","DEFAULT_WELLS_MAP_WELL_MARKER_SIZE","_ref6$coordsDataPath","coordsDataPath","mapContainerRef","useRef","mapRef","markersBoundsRef","popupRef","tooltipRootRef","tooltipContainerRef","prevWellsRef","useState","_useState2","_useState","isMapReady","setIsMapReady","subjectWellCoords","useMemo","get","useEffect","IS_MAPBOX_ENABLED","current","mapboxgl","Map","container","style","center","zoom","attributionControl","scrollZoom","addControl","NavigationControl","showCompass","on","addSource","data","addLayer","id","source","paint","map","_tooltipRootRef$curre","unmount","remove","ring","_ref3","radiusMeters","_ref4","lng","points","distanceX","Math","cos","PI","distanceY","i","theta","push","sin","makeCirclePolygon","getSource","setData","geometry","coordinates","_popupRef$current","prevWells","offsetWellIds","well","wellsById","bounds","LngLatBounds","forEach","coords","isWellSubject","isWellOffset","includes","r","opacity","extend","properties","wellId","length","hoveredWellId","handleMouseMove","e","getCanvas","cursor","document","createElement","createAdaptiveRoot","render","_ref5","_jsx","color","background","children","fontSize","lineHeight","Popup","closeButton","maxWidth","setLngLat","setDOMContent","addTo","handleMouseOver","handleHighlightMouseLeave","_popupRef$current2","handleWellsMouseLeave","point","queryRenderedFeatures","layers","setTimeout","fitBounds","off","className","styles","mapMain","ref","propTypes","PropTypes","shape","number","formation","string","arrayOf","isRequired","memo"],"mappings":"wkBAYA,IAAQA,EAAuBC,EAAvBD,mBAQFE,EAAiB,CAAC,WAAY,WAI9BC,EAAe,kBACfC,EAA2B,CAAEC,KAAM,oBAAqBC,SAAU,IAElEC,EAAW,SAAHC,GAAA,IAAAC,EAAAC,EAAAF,EAAA,GAAKG,EAAGF,EAAA,GAAK,MAAM,CAANA,EAAA,GAAYE,EAAI,EA0B3C,SAASC,EAQNC,GAAA,IAAAC,EAAAD,EAPDE,YAAAA,aAAc,KAAID,EAClBE,IAAAA,MAAKC,EAAAJ,EACLK,YAAAA,aAAc,KAAID,EAClBE,IAAAA,OAAMC,EAAAP,EACNQ,sBAAAA,aAAwBC,EAA0CF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Q2F,UAAU1G,EAAiBe,QAE7C,GAAE,KAEI,WACLmB,EAAIyE,IAAI,YA9PG,QA8PoB9B,GAC/B3C,EAAIyE,IAAI,aA/PG,QA+PqBN,GAChCnE,EAAIyE,IAAI,aAAcvI,EAAc+H,GAlGtC,CAoGD,GAAE,CAACnH,EAAaC,EAAOE,EAAaqB,IAGnC8E,EAAA,MAAA,CAAKsB,UAAWC,EAAO3E,IAAIuD,SACzBH,EAAA,MAAA,CAAKsB,UAAWC,EAAOC,QAASC,IAAKlH,KAG3C,CAEAhB,EAASmI,UAAY,CACnBhI,YAAaiI,EAAUC,MAAM,CAC3BnF,GAAIkF,EAAUE,OACdC,UAAWH,EAAUI,SAEvBpI,MAAOgI,EAAUK,QAAQL,EAAUC,MAAM,CAAA,IAAKK,WAC9CpI,YAAa8H,EAAUK,QAAQL,EAAUC,MAAM,CAAE,IACjD9H,OAAQ6H,EAAUE,OAAOI,WACzBjI,sBAAuB2H,EAAUE,OACjC1H,eAAgBwH,EAAUE,OAC1BvH,eAAgBqH,EAAUI,QAG5B,IAAM9H,EA/RmC,EAgSnCG,EA/R2B,EAiSlB8H,EAAAA,EAAK3I"}
1
+ {"version":3,"file":"Map.js","sources":["../../../../../src/components/BICOffsetPickerDialog/components/Map/Map.js"],"sourcesContent":["import { createElement, memo, useRef, useEffect, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { get } from 'lodash';\n\nimport styles from './Map.css';\n\nimport { mapbox } from '~/utils';\nimport { createAdaptiveRoot } from '~/utils/createAdaptiveRoot';\nimport mapboxgl from '~/config/mapboxGl';\nimport { IS_MAPBOX_ENABLED } from '~/config/mapbox';\nimport 'mapbox-gl/dist/mapbox-gl.css';\n\nconst RADIUS_CIRCLE_COLOR = '#03BCD4';\nconst METERS_IN_MILE = 1609.34;\nconst DEFAULT_SUBJECT_WELL_MARKER_SIZE = 8;\nconst DEFAULT_WELL_MARKER_SIZE = 5;\nconst OFFSET_WELL_COLOR = '#FFC107';\n\nconst DEFAULT_COORDS = [29.749907, -95.358421]; // TX coordinates\n\nconst RADIUS_CIRCLE_ID = 'radius-circle';\nconst WELLS_ID = 'wells';\nconst HIGHLIGHT_ID = 'wells-highlight';\nconst EMPTY_FEATURE_COLLECTION = { type: 'FeatureCollection', features: [] };\n\nconst toLngLat = ([lat, lng]) => [lng, lat];\n\n// NOTE: mapbox-gl has no geographic-radius circle primitive, so approximate it with a polygon\nconst makeCirclePolygon = ([lat, lng], radiusMeters, points = 64) => {\n const ring = [];\n const distanceX = radiusMeters / (111320 * Math.cos((lat * Math.PI) / 180));\n const distanceY = radiusMeters / 110574;\n for (let i = 0; i <= points; i += 1) {\n const theta = (i / points) * (2 * Math.PI);\n ring.push([lng + distanceX * Math.cos(theta), lat + distanceY * Math.sin(theta)]);\n }\n return ring;\n};\n\nconst toolTip =\n () =>\n // eslint-disable-next-line react/prop-types\n ({ well }) => {\n return (\n <div style={{ color: '#fff', background: '##414141' }}>\n <span style={{ fontSize: '11px', lineHeight: '16px' }}>{get(well, 'name')}</span>\n </div>\n );\n };\n\n// eslint-disable-next-line no-unused-vars\nfunction WellsMap({\n subjectWell = null,\n wells,\n offsetWells = null,\n radius,\n subjectWellMarkerSize = DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE,\n wellMarkerSize = DEFAULT_WELLS_MAP_WELL_MARKER_SIZE,\n coordsDataPath = 'settings.top_hole.coordinates',\n}) {\n const mapContainerRef = useRef(null);\n const mapRef = useRef(null);\n const markersBoundsRef = useRef(null);\n const popupRef = useRef(null);\n const tooltipRootRef = useRef(null);\n const tooltipContainerRef = useRef(null);\n const prevWellsRef = useRef();\n const [isMapReady, setIsMapReady] = useState(false);\n\n const subjectWellCoords = useMemo(() => {\n return subjectWell && get(subjectWell, coordsDataPath);\n }, [subjectWell, coordsDataPath]);\n\n // NOTE: Initialize map\n useEffect(() => {\n if (!IS_MAPBOX_ENABLED) return undefined;\n\n mapRef.current = new mapboxgl.Map({\n container: mapContainerRef.current,\n style: 'mapbox://styles/mapbox/dark-v9',\n center: toLngLat(DEFAULT_COORDS),\n zoom: 1,\n attributionControl: false,\n scrollZoom: false,\n });\n\n mapRef.current.addControl(\n new mapboxgl.NavigationControl({ showCompass: false }),\n 'bottom-right'\n );\n\n // NOTE: Sources/layers can only be added once the style has loaded.\n // The radius circle layer is added first so well markers render above it (was bringToBack),\n // and the hover highlight layer last so it renders on top of the markers\n mapRef.current.on('load', () => {\n mapRef.current.addSource(RADIUS_CIRCLE_ID, {\n type: 'geojson',\n data: EMPTY_FEATURE_COLLECTION,\n });\n mapRef.current.addLayer({\n id: RADIUS_CIRCLE_ID,\n type: 'fill',\n source: RADIUS_CIRCLE_ID,\n paint: {\n 'fill-color': RADIUS_CIRCLE_COLOR,\n 'fill-opacity': 0.2,\n },\n });\n\n mapRef.current.addSource(WELLS_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n mapRef.current.addLayer({\n id: WELLS_ID,\n type: 'circle',\n source: WELLS_ID,\n paint: {\n 'circle-radius': ['get', 'radius'],\n 'circle-color': OFFSET_WELL_COLOR,\n 'circle-opacity': ['get', 'opacity'],\n },\n });\n\n mapRef.current.addSource(HIGHLIGHT_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n mapRef.current.addLayer({\n id: HIGHLIGHT_ID,\n type: 'circle',\n source: HIGHLIGHT_ID,\n paint: {\n 'circle-radius': ['get', 'radius'],\n 'circle-color': OFFSET_WELL_COLOR,\n 'circle-opacity': 0.2,\n },\n });\n\n setIsMapReady(true);\n });\n\n const map = mapRef.current;\n return () => {\n tooltipRootRef.current?.unmount();\n tooltipRootRef.current = null;\n tooltipContainerRef.current = null;\n\n map.remove();\n mapRef.current = null;\n markersBoundsRef.current = null;\n };\n }, []);\n\n // NOTE: Radius circle\n useEffect(() => {\n if (!mapRef.current || !isMapReady) {\n return;\n }\n\n if (!subjectWellCoords) {\n mapRef.current.getSource(RADIUS_CIRCLE_ID).setData(EMPTY_FEATURE_COLLECTION);\n return;\n }\n\n const ring = makeCirclePolygon(subjectWellCoords, radius * METERS_IN_MILE);\n mapRef.current.getSource(RADIUS_CIRCLE_ID).setData({\n type: 'Feature',\n geometry: { type: 'Polygon', coordinates: [ring] },\n });\n }, [radius, subjectWellCoords, isMapReady]);\n\n const handleMouseOver = (coords, r) => {\n // Highlight the hovered well with a bigger translucent circle\n mapRef.current.getSource(HIGHLIGHT_ID).setData({\n type: 'Feature',\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: { radius: r * 3 },\n });\n };\n\n // NOTE: Well markers\n useEffect(() => {\n if (!mapRef.current || !isMapReady) {\n return undefined;\n }\n\n const prevWells = prevWellsRef.current;\n prevWellsRef.current = wells;\n\n popupRef.current?.remove();\n mapRef.current.getSource(HIGHLIGHT_ID).setData(EMPTY_FEATURE_COLLECTION);\n\n const offsetWellIds = offsetWells.map(well => well.id);\n\n const features = [];\n const wellsById = {};\n const bounds = new mapboxgl.LngLatBounds();\n wells.forEach(well => {\n const coords = get(well, coordsDataPath);\n\n if (coords && mapbox.isValidCoordinates(coords)) {\n const isWellSubject = subjectWell && subjectWell.id === well.id;\n const isWellOffset = offsetWellIds.includes(well.id);\n const r = isWellSubject ? subjectWellMarkerSize : wellMarkerSize;\n const opacity = isWellSubject || isWellOffset ? 1 : 0.3;\n\n wellsById[well.id] = well;\n bounds.extend(toLngLat(coords));\n features.push({\n type: 'Feature',\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: { wellId: well.id, radius: r, opacity },\n });\n }\n });\n\n mapRef.current.getSource(WELLS_ID).setData({ type: 'FeatureCollection', features });\n markersBoundsRef.current = features.length ? bounds : null;\n\n const map = mapRef.current;\n let hoveredWellId = null;\n\n const handleMouseMove = e => {\n map.getCanvas().style.cursor = 'pointer';\n\n const well = wellsById[e.features[0].properties.wellId];\n if (!well || well.id === hoveredWellId) {\n return;\n }\n hoveredWellId = well.id;\n\n const coords = get(well, coordsDataPath);\n\n // Tooltip\n if (!tooltipContainerRef.current) {\n tooltipContainerRef.current = document.createElement('div');\n tooltipRootRef.current = createAdaptiveRoot(tooltipContainerRef.current);\n }\n tooltipRootRef.current.render(createElement(toolTip(), { well }));\n\n if (!popupRef.current) {\n popupRef.current = new mapboxgl.Popup({ closeButton: false, maxWidth: 'none' });\n }\n popupRef.current\n .setLngLat(toLngLat(coords))\n .setDOMContent(tooltipContainerRef.current)\n .addTo(map);\n\n // Highlight\n handleMouseOver(coords, e.features[0].properties.radius);\n };\n\n // NOTE: was the mouseout handler of the Leaflet highlight marker\n const handleHighlightMouseLeave = () => {\n hoveredWellId = null;\n map.getCanvas().style.cursor = '';\n map.getSource(HIGHLIGHT_ID).setData(EMPTY_FEATURE_COLLECTION);\n popupRef.current?.remove();\n };\n\n // NOTE: If the pointer exits before the highlight renders under it, the highlight\n // layer never emits mouseleave — clear here unless the cursor is inside the highlight\n const handleWellsMouseLeave = e => {\n if (e?.point && map.queryRenderedFeatures(e.point, { layers: [HIGHLIGHT_ID] }).length) {\n return;\n }\n handleHighlightMouseLeave();\n };\n\n map.on('mousemove', WELLS_ID, handleMouseMove);\n map.on('mouseleave', WELLS_ID, handleWellsMouseLeave);\n map.on('mouseleave', HIGHLIGHT_ID, handleHighlightMouseLeave);\n\n setTimeout(() => {\n if (mapRef.current && markersBoundsRef.current && wells !== prevWells) {\n mapRef.current.fitBounds(markersBoundsRef.current);\n }\n }, 500);\n\n return () => {\n map.off('mousemove', WELLS_ID, handleMouseMove);\n map.off('mouseleave', WELLS_ID, handleWellsMouseLeave);\n map.off('mouseleave', HIGHLIGHT_ID, handleHighlightMouseLeave);\n };\n }, [subjectWell, wells, offsetWells, isMapReady]);\n\n return (\n <div className={styles.map}>\n <div className={styles.mapMain} ref={mapContainerRef} />\n </div>\n );\n}\n\nWellsMap.propTypes = {\n subjectWell: PropTypes.shape({\n id: PropTypes.number,\n formation: PropTypes.string,\n }),\n wells: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n offsetWells: PropTypes.arrayOf(PropTypes.shape({})),\n radius: PropTypes.number.isRequired,\n subjectWellMarkerSize: PropTypes.number,\n wellMarkerSize: PropTypes.number,\n coordsDataPath: PropTypes.string,\n};\n\nconst DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE = DEFAULT_SUBJECT_WELL_MARKER_SIZE;\nconst DEFAULT_WELLS_MAP_WELL_MARKER_SIZE = DEFAULT_WELL_MARKER_SIZE;\n\nexport default memo(WellsMap);\n"],"names":["DEFAULT_COORDS","HIGHLIGHT_ID","EMPTY_FEATURE_COLLECTION","type","features","toLngLat","_ref","_ref2","_slicedToArray","lat","WellsMap","_ref6","_ref6$subjectWell","subjectWell","wells","_ref6$offsetWells","offsetWells","radius","_ref6$subjectWellMark","subjectWellMarkerSize","DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE","_ref6$wellMarkerSize","wellMarkerSize","DEFAULT_WELLS_MAP_WELL_MARKER_SIZE","_ref6$coordsDataPath","coordsDataPath","mapContainerRef","useRef","mapRef","markersBoundsRef","popupRef","tooltipRootRef","tooltipContainerRef","prevWellsRef","useState","_useState2","_useState","isMapReady","setIsMapReady","subjectWellCoords","useMemo","get","useEffect","IS_MAPBOX_ENABLED","current","mapboxgl","Map","container","style","center","zoom","attributionControl","scrollZoom","addControl","NavigationControl","showCompass","on","addSource","data","addLayer","id","source","paint","map","_tooltipRootRef$curre","unmount","remove","ring","_ref3","radiusMeters","_ref4","lng","points","distanceX","Math","cos","PI","distanceY","i","theta","push","sin","makeCirclePolygon","getSource","setData","geometry","coordinates","_popupRef$current","prevWells","offsetWellIds","well","wellsById","bounds","LngLatBounds","forEach","coords","mapbox","isValidCoordinates","isWellSubject","isWellOffset","includes","r","opacity","extend","properties","wellId","length","hoveredWellId","handleMouseMove","e","getCanvas","cursor","document","createElement","createAdaptiveRoot","render","_ref5","_jsx","color","background","children","fontSize","lineHeight","Popup","closeButton","maxWidth","setLngLat","setDOMContent","addTo","handleMouseOver","handleHighlightMouseLeave","_popupRef$current2","handleWellsMouseLeave","point","queryRenderedFeatures","layers","setTimeout","fitBounds","off","className","styles","mapMain","ref","propTypes","PropTypes","shape","number","formation","string","arrayOf","isRequired","memo"],"mappings":"wkBAYA,IAMMA,EAAiB,CAAC,WAAY,WAI9BC,EAAe,kBACfC,EAA2B,CAAEC,KAAM,oBAAqBC,SAAU,IAElEC,EAAW,SAAHC,GAAA,IAAAC,EAAAC,EAAAF,EAAA,GAAKG,EAAGF,EAAA,GAAK,MAAM,CAANA,EAAA,GAAYE,EAAI,EA0B3C,SAASC,EAQNC,GAAA,IAAAC,EAAAD,EAPDE,YAAAA,aAAc,KAAID,EAClBE,IAAAA,MAAKC,EAAAJ,EACLK,YAAAA,aAAc,KAAID,EAClBE,IAAAA,OAAMC,EAAAP,EACNQ,sBAAAA,aAAwBC,EAA0CF,EAAAG,EAAAV,EAClEW,eAAAA,aAAiBC,EAAkCF,EAAAG,EAAAb,EACnDc,eAAAA,aAAiB,gCAA+BD,EAE1CE,EAAkBC,EAAO,MACzBC,EAASD,EAAO,MAChBE,EAAmBF,EAAO,MAC1BG,EAAWH,EAAO,MAClBI,EAAiBJ,EAAO,MACxBK,EAAsBL,EAAO,MAC7BM,EAAeN,IACeO,EAAAA,GAAS,GAAMC,EAAA3B,EAAA4B,EAAA,GAA5CC,EAAUF,EAAA,GAAEG,EAAaH,EAAA,GAE1BI,EAAoBC,GAAQ,WAChC,OAAO3B,GAAe4B,EAAI5B,EAAaY,EACzC,GAAG,CAACZ,EAAaY,IAGjBiB,GAAU,WACR,GAAKC,EAAL,CAEAf,EAAOgB,QAAU,IAAIC,EAASC,IAAI,CAChCC,UAAWrB,EAAgBkB,QAC3BI,MAAO,iCACPC,OAAQ5C,EAASL,GACjBkD,KAAM,EACNC,oBAAoB,EACpBC,YAAY,IAGdxB,EAAOgB,QAAQS,WACb,IAAIR,EAASS,kBAAkB,CAAEC,aAAa,IAC9C,gBAMF3B,EAAOgB,QAAQY,GAAG,QAAQ,WACxB5B,EAAOg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@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/typeof";import t from"@babel/runtime/helpers/toConsumableArray";import o from"@babel/runtime/helpers/slicedToArray";import s from"@babel/runtime/helpers/defineProperty";import{useState as n,useRef as i,useMemo as r,useEffect as p,useCallback as m}from"react";import c from"prop-types";import{get as a,uniq as l,includes as d,isEqual as j}from"lodash";import u from"classnames";import{makeStyles as C,Dialog as I,DialogTitle as A,Typography as f,Tooltip as S,IconButton as h,DialogContent as V,DialogActions as g,Button as v}from"@material-ui/core";import{Close as b}from"@material-ui/icons";import T from"./components/Map/index.js";import F from"./components/WellSection/index.js";import{useWells as x,useFetchBicWellsData as D}from"./effects/index.js";import{DEFAULT_WELL_SECTIONS as P}from"./constants.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@babel/runtime/helpers/objectWithoutProperties";import"../Modal/CorvaModal.scss.js";import"@icon-park/react/es/all";import{jsxs as y,Fragment as k,jsx as B}from"react/jsx-runtime";import"../../icons/IconParkProvider.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/InfoRounded.js";import"../../icons/customIcons/icons/FlameFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import"../../utils/mobileDetect.js";import"../IconButton/index.js";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../constants/corvaCompanyId.js";import"../GradientManager/configuration/constants.js";import"uuid";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../AppIcon/AppIcon.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router-dom";import"query-string";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../utils/index.js";import"../EmptyState/EmptyState.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/styles.js";import"@material-ui/pickers";import"@date-io/moment";import"moment";import"../../config/theme/index.js";import"../../hocs/withAssetEditorLockHOC.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.js";import"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../ConfirmationDialog.js";import"immutable";import"../../permissions/PermissionsContext.js";import"../../permissions/constants/index.js";import"../../permissions/withPermissionsHOC.js";import"../../clients/jsonApi/index.js";import"../../permissions/ProvidePermissions.js";import"../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Header/Header.scss.js";import"../../componentsV2/Tooltip/Tooltip.scss.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/AppHeader/AppAssets/utils.js";import"../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../PadModeSelect/PadModeSelect.js";import"../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../constants/streamSourceType.js";import"../../componentsV2/PadModeSelect/PadModeSelect.js";import"../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../componentsV2/AppCommonsProvider/AppCommonsProvider.js";import"../../componentsV2/utils.js";import"../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../componentsV2/Button/Button.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../componentsV2/Popover/Popover.js";import"../../componentsV2/Accordion/Accordion.scss.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/ModalWindow/ModalWindow.js";import"../../componentsV2/Modal/Modal.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../utils/getSingleAsset.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../clients/subscriptions/constants.js";import"querystring";import"uuid/v1";import"../../clients/subscriptions.v1.js";import"../../clients/subscriptions/subscriptions-client.factory.js";import"jsona";import"../../utils/env.js";import"../StatusBadge/constants.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"../../clients/api/apiCore.js";import"../../clients/constants.js";import"../../clients/sso/auth0.js";import"../../clients/sso/oauth2.js";import"../../clients/api/rateLimiter.js";import"lodash/isEmpty";import"lodash/sortBy";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../componentsV2/AppHeader/V3/constants.scss.js";import"../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.js";import"../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.constants.js";import"../../componentsV2/AppSettings/AppSettings.js";import"../../componentsV2/AppSettings/AppSettings.constants.js";import"../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../componentsV2/AppHeader/AppHeader.scss.js";import"../../componentsV2/EmptyState/EmptyState.scss.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.scss.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Cell.js";import"../../componentsV2/PopoverPanel/PopoverPanel.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInputNext/TextInputNext.js";import"../../componentsV2/TextArea/TextArea.js";import"../../componentsV2/Label/Label.js";import"../../componentsV2/TextLink/TextLink.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/Avatar/Avatar.js";import"../../componentsV2/AvatarGroup/AvatarGroup.js";import"@material-ui/lab";import"../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../componentsV2/Paper/Paper.js";import"../../componentsV2/Hint/Hint.scss.js";import"../../componentsV2/Counter/Counter.js";import"../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../componentsV2/TemplatesControl/TemplatesControl.js";import"zustand";import"../../componentsV2/TemplatesControl/utils.js";import"../../componentsV2/TemplatesControl/icons/folder/index.js";import"../../componentsV2/TemplatesControl/Store/utils.js";import"../../componentsV2/TemplatesControl/types.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/FileIcon/FileIcon.js";import"../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../componentsV2/FilesLoader/FilesLoader.scss.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../componentsV2/Skeleton/Skeleton.scss.js";import"../../utils/main.js";import"../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../componentsV2/Stepper/Step/Step.scss.js";import"../../componentsV2/Stepper/Stepper.scss.js";import"../../componentsV2/ButtonLive/ButtonLive.js";import"../../componentsV2/ButtonText/ButtonText.js";import"../../componentsV2/IndicatorLive/IndicatorLive.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppFooter/AppFooter.js";import"../../componentsV2/OffsetWellsButton/OffsetWellsButton.js";import"../../componentsV2/ChartAxisExtreme/ChartAxisExtreme.scss.js";import"highcharts";import"../../componentsV2/ChartAxisExtreme/ChartAxisExtremeDragTracker.js";import"../../componentsV2/Autocomplete/Autocomplete.js";import"../../componentsV2/Select/Select.js";import"../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../componentsV2/DatePicker/DatePicker.js";import"../../componentsV2/DragHandle/DragHandle.js";import"../../componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js";import"../../componentsV2/Slider/constants.js";import"../../componentsV2/Slider/components/SliderThumb.js";import"../../componentsV2/Slider/Slider.scss.js";import"../../componentsV2/SliderAdvanced/SliderAdvanced.js";import"react-color";import"../../componentsV2/ColorPicker/Swatches/Swatches.scss.js";import"../../componentsV2/ColorPicker/OpacityDragtracker/OpacityDragTracker.scss.js";import"../../componentsV2/ColorPicker/ColorPicker.scss.js";import"../../componentsV2/ChartHelper/ChartHelper.scss.js";import"../../componentsV2/Hotkey/Hotkey.js";import"@tanstack/react-query";import"../../componentsV2/InterventionEventSelector/useInterventionUnitEvents.js";import"../../componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.css.js";import"../Icons/AnnotationIcon.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/RestoreAppSizeButton.css.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.scss.js";import"../Toaster/Toaster.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import W from"../LoadingIndicator/LoadingIndicator.js";import"../Typography.js";import"../RealTimeValuesSidebar/RealTimeSidebar.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"slate";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"../SettingEditors/ColorEditor/style.css.js";import"../SettingEditors/DropdownEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/ChartSelect.js";import"../Chart/ChartWrapperContext.js";import"../Chart/effects/useChartModifier.js";import"../Chart/components/buttons/HideAxesButton.js";import"../Chart/components/buttons/ChartTypeButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../MiddleTruncatedText/MiddleTruncatedText.js";import"../RangeSlider/constants.js";import"../RangeSlider/Input.css.js";import"../RangeSlider/RangeSlider.css.js";import"../AdvancedSlider/AdvancedSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Select/SelectFilterBy.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../GradientPicker/GradientPicker.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.scss.js";import"../GradientManager/GradientManager.styles.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../OffsetWellButton/OffsetWellButton.js";import E from"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js";import"../OffsetWellMap/OffsetWellMap.js";import"@material-ui/core/Snackbar";import"../Notifications/Toast.js";import"../Notifications/Notifications.scss.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/index.js";import"../MenuItem/index.js";import"../MiddleTruncate/MiddleTruncate.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import"../Table/TablePagination/TablePagination.js";import"../Table/TablePaginationActions/TablePaginationActions.js";import"../Tooltip/ScrollableTooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Stepper.js";import"../Stepper/Step/Step.js";import"../Stepper/StepsWrapper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../../componentsV2/FileIcon/icons/ArchiveFileIcon.js";import"../../componentsV2/FileIcon/icons/CSVFileIcon.js";import"../../componentsV2/FileIcon/icons/DocFileIcon.js";import"../../componentsV2/FileIcon/icons/EDMFileIcon.js";import"../../componentsV2/FileIcon/icons/ExcelFileIcon.js";import"../../componentsV2/FileIcon/icons/ImageFileIcon.js";import"../../componentsV2/FileIcon/icons/JsonFileIcon.js";import"../../componentsV2/FileIcon/icons/LasFileIcon.js";import"../../componentsV2/FileIcon/icons/OtherFileIcon.js";import"../../componentsV2/FileIcon/icons/PdfFileIcon.js";import"../../componentsV2/FileIcon/icons/PowerPointFileIcon.js";import"../../componentsV2/FileIcon/icons/TxtFileIcon.js";import"../../componentsV2/FileIcon/icons/UnknownFileIcon.js";import"../../componentsV2/FileIcon/icons/VideoFileIcon.js";import"../../componentsV2/FileIcon/icons/XmlFileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/Groups.js";import"../Search/components/SelectAllListItem.js";import"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../AssetNameLabel/AssetStatusBadge.js";import"../AssetEditorV2/components/PrimaryAssetSelect.js";import"../AssetEditorV2/components/SecondaryAssetSelect.js";import"../AssetEditorV2/components/SelectItem.js";import"../AssetEditorV2/components/MultipleAssetsToggle.js";import"../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../EChartsWrapper/EChartsWrapper.js";import"../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../GoogleDocsViewer/index.js";import"../NewDocumentViewer/effects/useFileContent.js";import"../NewDocumentViewer/styles.js";import"../FilesLoaderV2/styles.js";import"../FilesDropzone/styles.js";import"../FilesProcessor/styles.js";import"../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../Formula/useFormulaStyles.js";import"../Formula/RootXIcon.js";import"../Formula/FormulaTextEditor.js";import"../Formula/CloseSuggestion.js";import"../Formula/SuggestionsMenu.js";import"../CommentCard/CommentCard.js";import"@material-ui/icons/AlternateEmail";import"../AttachFileButton/AttachFileButton.scss.js";import"../CommentInputNext/CommentInputNext.js";import"../UserMention/utils/index.js";import"react-s3-uploader/s3upload";import"../CommentComposer/CommentMetaLine.scss.js";import"../CommentComposer/ChatChannelSelector.scss.js";import"../CommentComposer/ShareToChatRow.scss.js";import"../CommentComposer/CommentComposer.scss.js";import"../AttachmentPreview/AttachmentPreview.js";import"../AttachmentPreview/AttachmentImage.js";import"../AttachmentPreview/AttachmentPreview.scss.js";import"../CommentPin/CommentPin.js";import"../FeedCard/FeedCard.js";import"../FeedItemCard/FeedItemCard.js";import"../NewCommentCursor/NewCommentCursor.js";import"../LinkedText/LinkedText.js";import"../FeedItem/feedItemTypes/AlertFeedItem.js";import"../FeedItem/feedItemTypes/PostFeedItem.js";import"../FeedItem/feedItemTypes/GeosteeringFeedItem.js";import"../FeedItem/feedItemTypes/DrillingOperationalNoteFeedItem.js";import"../FeedItem/feedItemTypes/DrillingOperationSummaryFeedItem.js";import"../FeedItem/feedItemTypes/DrillingDailyCostFeedItem.js";import"../FeedItem/feedItemTypes/DocumentFeedItem.js";import"../FeedItem/feedItemTypes/DrillerMemoFeedItem.js";import"../FeedItem/feedItemTypes/NptFeedItem.js";import"../FeedItem/feedItemTypes/SurveyStationFeedItem/index.js";import"../FeedItem/feedItemTypes/LessonsLearnedFeedItem/index.js";import"../FeedItem/feedItemTypes/TracesMemoFeedItem.js";import"../FeedItem/feedItemTypes/DepthCommentFeedItem.js";import"../FeedItem/feedItemTypes/CompletionOperationalNoteFeedItem.js";import"../FeedItem/feedItemTypes/CompletionOperationSummaryFeedItem.js";import"../FeedItem/feedItemTypes/CompletionDailyCostFeedItem.js";import"../FeedItem/feedItemTypes/CompletionDocumentFeedItem.js";import"../FeedItem/feedItemTypes/CompletionNptFeedItem.js";import"../FeedItem/feedItemTypes/StageOverviewFeedItem/index.js";import"../FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js";import"../FeedItem/feedItemTypes/WellPlanFeedItem/index.js";import"../FeedItem/feedItemTypes/FluidReportFeedItem.js";import"../FeedItem/feedItemTypes/BhaFeedItem/BhaFeedItem.js";import"../FeedItem/feedItemTypes/DvDCommentFeedItem.js";import"../FeedItem/feedItemTypes/PCCommentFeedItem.js";import"../FeedItem/feedItemTypes/HookloadCommentFeedItem.js";import"../FeedItem/feedItemTypes/NptLessonsCommentFeedItem.js";import"../FeedItem/feedItemTypes/GenericDataCommentFeedItem.js";function w(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function O(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?w(Object(o),!0).forEach((function(t){s(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):w(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var L=C((function(e){return{paper:{width:"552px"},dialogTitles:{display:"flex",flexDirection:"column"},titleContent:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},title:{fontSize:"20px",color:e.palette.primary.text1},description:{fontSize:"16px",fontWeight:"normal",color:e.palette.primary.text6,marginTop:16},closeIconButton:{fontSize:"20px",padding:4,"&:hover $closeIcon":{color:"#fff"}},closeIcon:{color:e.palette.primary.text6},topShadow:{width:"100%",height:"16px",backgroundImage:"linear-gradient(0deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9,")"),position:"absolute",top:"155px",zIndex:2},bottomShadow:{width:"100%",height:"16px",backgroundImage:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9,")"),position:"absolute",bottom:"52px",zIndex:2},dialogActions:{display:"flex",justifyContent:"flex-end",paddingTop:8,paddingBottom:8},dialogActionsSmallScreen:{paddingRight:"100px"},dialogContent:{display:"flex",flexDirection:"column",overflowX:"hidden"},buttonContainer:{display:"flex",gap:"16px"}}}));function M(e,t){var o=e.find((function(e){return e.id===t}));return a(o,"name")||"-"}function H(e,t){var o=e.find((function(e){return e.id===t}));return a(o,"rigName")||"-"}function R(e,t){return"well"===e.value?"Best Wells":"area"===e.value?"Area Offsets":"Best ".concat(e.value,"section"===t?" Wells":' " Wells')}function N(e){return e.map((function(e){return O(O({},e),{},{wells:e.wells.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}))})}))}function G(e){var t=a(e,"bicWellIds")||[],o=a(e,"manualWellIds")||[],s=a(e,"selectedWellIds")||[];return l(t.concat(o).concat(s))}function q(s){var c=s.defaultSubjectWell,C=void 0===c?null:c,w=s.offsetSetting,q=void 0===w?z:w,_=s.currentUser,K=void 0===_?U:_,X=s.isOpen,J=s.onClose,Q=s.onSave,Z=s.addWellsUsabilityInfo,$=void 0===Z?null:Z,Y=s.unusableWellAlarm,ee=void 0===Y?"Unable to add":Y,te=n(!1),oe=o(te,2),se=oe[0],ne=oe[1],ie=L({scrolling:se}),re=i(null),pe=i(!0),me=n(a(C,"companyId")||a(q,"companyId")||+a(K,"company_id")),ce=o(me,2),ae=ce[0],le=ce[1],de=n(a(C,"asset_id")||a(q,"subjectWellId")||null),je=o(de,2),ue=je[0],Ce=je[1],Ie=x(ae,X),Ae=D(ue,X),fe=n([]),Se=o(fe,2),he=Se[0],Ve=Se[1],ge=n(!1),ve=o(ge,2),be=ve[0],Te=ve[1],Fe=n(q),xe=o(Fe,2),De=xe[0],Pe=xe[1],ye=n(!1),ke=o(ye,2),Be=ke[0],We=ke[1],Ee=r((function(){if(Ie){var e=G(De);return Ie.filter((function(t){return e.find((function(e){return e===a(t,"id")}))}))}return[]}),[Ie,De]);p((function(){X&&(le(a(C,"companyId")||a(q,"companyId")||+a(K,"company_id")),Ce(a(C,"asset_id")||a(q,"subjectWellId")||null),Pe(q),We(!1),pe.current=!0)}),[q,X]),p((function(){if(X&&Ie&&pe.current){var o,s=a(De,"selectedWellIds")||[],n=a(De,"manualWellIds")||[],i=a(De,"bicWellIds")||[],r=s.concat(n),p=r.filter((function(e){return Ie.find((function(t){return t.id===e}))})).map((function(e){return{id:e,checked:!0,name:M(Ie,e),rigName:H(Ie,e),kind:s.includes(e)?"advanced":"manual"}}));if(Ae&&Ae.filters&&Ae.result){var m,c=[],j=[{name:"Wells within Area",value:"area"}].concat(t(a(Ae,["filters","filterTabs"]))),u=(null===(m=Ae.filters)||void 0===m?void 0:m.filterMode)||"holeSize",C=l(j);o=[{name:"Search Results",wells:p,expanded:Be}].concat(t(C.map((function(t){var o;return{name:R(t,u),wells:(null===(o=Ae.result[t.value])||void 0===o?void 0:o.filter((function(e){return Ie.find((function(t){return t.id===e}))})).map((function(t){var o="object"===e(t)?t.id:t;return c.push(o),{id:o,checked:!1,name:M(Ie,o),rigName:H(Ie,o),kind:"best"}})))||[],expanded:!1}}))))}else o=[{name:"Search Results",wells:p,expanded:Be}].concat(t(P));var I=o.map((function(e){var t=e.wells.map((function(e){return d(i,e.id)||d(r,e.id)?O(O({},e),{},{checked:!0}):O({},e)}));return O(O({},e),{},{wells:t})}));Ve(N(I))}}),[X,Ie,Ae,De]);var we=m((function(){return G(De).length}),[De]),Oe=m((function(){return(a(De,"bicWellIds")||[]).length}),[]),Le=i(null),Me=!Ie;return y(k,{children:[y(I,{onBackdropClick:J,onEscapeKeyDown:J,open:X,classes:{paper:ie.paper},children:[B(A,{children:y("div",{className:ie.dialogTitles,children:[y("div",{className:ie.titleContent,children:[B(f,{className:ie.title,children:"Select Offset Wells"}),B(S,{title:"Close",children:B(h,{"data-not-migrated-muiiconbutton":!0,"aria-label":"close",className:ie.closeIconButton,onClick:J,children:B(b,{className:ie.closeIcon})})})]}),B("div",{className:ie.description,children:"Quickly add all of the Best-In-Class Wells per section selected from the Offsets Well Selection Application."})]})}),se&&B("div",{className:ie.topShadow}),B(V,{className:ie.dialogContent,ref:re,onScroll:function(){ne(!0),clearTimeout(Le.current),Le.current=setTimeout((function(){ne(!1)}),1e3)},children:Me?B(W,{fullscreen:!1}):y(k,{children:[B(T,{wells:Ee,offsetWells:Ee}),B(F,{company:ae,wellSections:he,getWellName:M,onChangeWellSections:function(e){var t=N(e);Ve(t),We(t[0].expanded);var o=[],s=[],n=[];t.forEach((function(e){e.wells.forEach((function(e){e.checked&&"advanced"===e.kind&&o.push(e.id),e.checked&&"manual"===e.kind&&s.push(e.id),e.checked&&"best"===e.kind&&n.push(e.id)}))}));var i=o.concat(s).concat(n),r=O(O({},De),{},{selectedWellIds:l(o),manualWellIds:l(s),bicWellIds:l(n),resultWellIds:l(i)});Pe(r),pe.current=!1},onExploreMode:function(){Te(!0)}})]})}),B("div",{className:ie.bottomShadow}),B(g,{className:u(ie.dialogActions),children:y("div",{className:ie.buttonContainer,children:[B(v,{"data-testid":"".concat("BICOffsetPickerDialog","_cancel"),onClick:J,color:"primary",children:"Cancel"}),y(v,{"data-testid":"".concat("BICOffsetPickerDialog","_add"),variant:"contained",color:"primary",onClick:function(){var e=G(De),t=Ie.filter((function(t){return d(e,t.id)})),o=O(O({},De),{},{companyId:+ae,resultWellIds:e});Te(!1),Q(o,t)},children:["Add (",we(),")"]})]})})]}),be&&B(E,{defaultSubjectWellId:a(C,"asset_id"),companyId:+ae,offsetSetting:De,currentUser:K,addWellsUsabilityInfo:$,unusableWellAlarm:ee,isAdvancedSearch:!0,bestCount:Oe(),isOpen:be,onClose:function(){Te(!1)},onSave:function(e){var t=e;C||(j(ue,a(t,"subjectWellId"))&&j(ae,a(t,"companyId"))||(t=O(O({},t),{},{bicWellIds:[],manualWellIds:[],resultWellIds:[]})),Ce(a(t,"subjectWellId")),le(a(t,"companyId")));var o=a(t,"manualWellIds")||[],s=a(t,"selectedWellIds")||[];o=o.filter((function(e){return!s.includes(e)})),t=O(O({},t),{},{manualWellIds:o}),Pe(t),pe.current=!0,We(!0),Te(!1)}})]})}q.propTypes={defaultSubjectWell:c.shape({}),offsetSetting:c.shape({subjectWellId:c.number,companyId:c.number}),currentUser:c.shape({}),isOpen:c.bool.isRequired,onClose:c.func.isRequired,onSave:c.func.isRequired,addWellsUsabilityInfo:c.func,unusableWellAlarm:c.string};var z={},U={};export{q as default};
1
+ import e from"@babel/runtime/helpers/typeof";import t from"@babel/runtime/helpers/toConsumableArray";import o from"@babel/runtime/helpers/slicedToArray";import s from"@babel/runtime/helpers/defineProperty";import{useState as n,useRef as i,useMemo as r,useEffect as p,useCallback as m}from"react";import c from"prop-types";import{get as a,uniq as l,includes as d,isEqual as j}from"lodash";import u from"classnames";import{makeStyles as C,Dialog as I,DialogTitle as A,Typography as f,Tooltip as S,IconButton as h,DialogContent as g,DialogActions as V,Button as v}from"@material-ui/core";import{Close as b}from"@material-ui/icons";import T from"./components/Map/index.js";import x from"./components/WellSection/index.js";import{useWells as F,useFetchBicWellsData as D}from"./effects/index.js";import{DEFAULT_WELL_SECTIONS as P}from"./constants.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@babel/runtime/helpers/objectWithoutProperties";import"../Modal/CorvaModal.scss.js";import"@icon-park/react/es/all";import{jsxs as y,Fragment as k,jsx as B}from"react/jsx-runtime";import"../../icons/IconParkProvider.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/InfoRounded.js";import"../../icons/customIcons/icons/FlameFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import"../../utils/mobileDetect.js";import"../IconButton/index.js";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../constants/corvaCompanyId.js";import"../GradientManager/configuration/constants.js";import"uuid";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../AppIcon/AppIcon.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router-dom";import"query-string";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../utils/index.js";import"../EmptyState/EmptyState.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/styles.js";import"@material-ui/pickers";import"@date-io/moment";import"moment";import"../../config/theme/index.js";import"../../hocs/withAssetEditorLockHOC.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.js";import"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../ConfirmationDialog.js";import"immutable";import"../../permissions/PermissionsContext.js";import"../../permissions/constants/index.js";import"../../permissions/withPermissionsHOC.js";import"../../clients/jsonApi/index.js";import"../../permissions/ProvidePermissions.js";import"../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Header/Header.scss.js";import"../../componentsV2/Tooltip/Tooltip.scss.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/AppHeader/AppAssets/utils.js";import"../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../PadModeSelect/PadModeSelect.js";import"../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../constants/streamSourceType.js";import"../../componentsV2/PadModeSelect/PadModeSelect.js";import"../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../componentsV2/AppCommonsProvider/AppCommonsProvider.js";import"../../componentsV2/utils.js";import"../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../componentsV2/Button/Button.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../componentsV2/Popover/Popover.js";import"../../componentsV2/Accordion/Accordion.scss.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/ModalWindow/ModalWindow.js";import"../../componentsV2/Modal/Modal.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../utils/getSingleAsset.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../clients/subscriptions/constants.js";import"querystring";import"uuid/v1";import"../../clients/subscriptions.v1.js";import"../../clients/subscriptions/subscriptions-client.factory.js";import"jsona";import"../../utils/env.js";import"../StatusBadge/constants.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"../../clients/api/apiCore.js";import"../../clients/constants.js";import"../../clients/sso/auth0.js";import"../../clients/sso/oauth2.js";import"../../clients/api/rateLimiter.js";import"lodash/isEmpty";import"lodash/sortBy";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../componentsV2/AppHeader/V3/constants.scss.js";import"../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.js";import"../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.constants.js";import"../../componentsV2/AppSettings/AppSettings.js";import"../../componentsV2/AppSettings/AppSettings.constants.js";import"../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../componentsV2/AppHeader/AppHeader.scss.js";import"../../componentsV2/EmptyState/EmptyState.scss.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.scss.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Cell.js";import"../../componentsV2/PopoverPanel/PopoverPanel.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInputNext/TextInputNext.js";import"../../componentsV2/TextArea/TextArea.js";import"../../componentsV2/Label/Label.js";import"../../componentsV2/TextLink/TextLink.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/Avatar/Avatar.js";import"../../componentsV2/AvatarGroup/AvatarGroup.js";import"@material-ui/lab";import"../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../componentsV2/Paper/Paper.js";import"../../componentsV2/Hint/Hint.scss.js";import"../../componentsV2/Counter/Counter.js";import"../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../componentsV2/TemplatesControl/TemplatesControl.js";import"zustand";import"../../componentsV2/TemplatesControl/utils.js";import"../../componentsV2/TemplatesControl/icons/folder/index.js";import"../../componentsV2/TemplatesControl/Store/utils.js";import"../../componentsV2/TemplatesControl/types.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/FileIcon/FileIcon.js";import"../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../componentsV2/FilesLoader/FilesLoader.scss.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../componentsV2/Skeleton/Skeleton.scss.js";import"../../utils/main.js";import"../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../componentsV2/Stepper/Step/Step.scss.js";import"../../componentsV2/Stepper/Stepper.scss.js";import"../../componentsV2/ButtonLive/ButtonLive.js";import"../../componentsV2/ButtonText/ButtonText.js";import"../../componentsV2/IndicatorLive/IndicatorLive.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppFooter/AppFooter.js";import"../../componentsV2/OffsetWellsButton/OffsetWellsButton.js";import"../../componentsV2/ChartAxisExtreme/ChartAxisExtreme.scss.js";import"highcharts";import"../../componentsV2/ChartAxisExtreme/ChartAxisExtremeDragTracker.js";import"../../componentsV2/Autocomplete/Autocomplete.js";import"../../componentsV2/Select/Select.js";import"../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../componentsV2/DatePicker/DatePicker.js";import"../../componentsV2/DragHandle/DragHandle.js";import"../../componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js";import"../../componentsV2/Slider/constants.js";import"../../componentsV2/Slider/components/SliderThumb.js";import"../../componentsV2/Slider/Slider.scss.js";import"../../componentsV2/SliderAdvanced/SliderAdvanced.js";import"react-color";import"../../componentsV2/ColorPicker/Swatches/Swatches.scss.js";import"../../componentsV2/ColorPicker/OpacityDragtracker/OpacityDragTracker.scss.js";import"../../componentsV2/ColorPicker/ColorPicker.scss.js";import"../../componentsV2/ChartHelper/ChartHelper.scss.js";import"../../componentsV2/Hotkey/Hotkey.js";import"@tanstack/react-query";import"../../componentsV2/InterventionEventSelector/useInterventionUnitEvents.js";import"../../componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.css.js";import"../Icons/AnnotationIcon.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/RestoreAppSizeButton.css.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.scss.js";import"../Toaster/Toaster.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import W from"../LoadingIndicator/LoadingIndicator.js";import"../Typography.js";import"../RealTimeValuesSidebar/RealTimeSidebar.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"slate";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"../SettingEditors/ColorEditor/style.css.js";import"../SettingEditors/DropdownEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/ChartSelect.js";import"../Chart/ChartWrapperContext.js";import"../Chart/effects/useChartModifier.js";import"../Chart/components/buttons/HideAxesButton.js";import"../Chart/components/buttons/ChartTypeButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../MiddleTruncatedText/MiddleTruncatedText.js";import"../RangeSlider/constants.js";import"../RangeSlider/Input.css.js";import"../RangeSlider/RangeSlider.css.js";import"../AdvancedSlider/AdvancedSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Select/SelectFilterBy.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../GradientPicker/GradientPicker.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.scss.js";import"../GradientManager/GradientManager.styles.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../OffsetWellButton/OffsetWellButton.js";import E from"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js";import"mapbox-gl/dist/mapbox-gl.css";import"@material-ui/icons/Info";import"@material-ui/icons/Block";import"../OffsetWellMap/WellTooltip.module.css.js";import"../OffsetWellMap/OffsetWellMap.module.css.js";import"../../config/mapboxGl/index.js";import"../../config/mapbox/index.js";import"react-dom";import"@material-ui/core/Snackbar";import"../Notifications/Toast.js";import"../Notifications/Notifications.scss.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/index.js";import"../MenuItem/index.js";import"../MiddleTruncate/MiddleTruncate.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import"../Table/TablePagination/TablePagination.js";import"../Table/TablePaginationActions/TablePaginationActions.js";import"../Tooltip/ScrollableTooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Stepper.js";import"../Stepper/Step/Step.js";import"../Stepper/StepsWrapper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../../componentsV2/FileIcon/icons/ArchiveFileIcon.js";import"../../componentsV2/FileIcon/icons/CSVFileIcon.js";import"../../componentsV2/FileIcon/icons/DocFileIcon.js";import"../../componentsV2/FileIcon/icons/EDMFileIcon.js";import"../../componentsV2/FileIcon/icons/ExcelFileIcon.js";import"../../componentsV2/FileIcon/icons/ImageFileIcon.js";import"../../componentsV2/FileIcon/icons/JsonFileIcon.js";import"../../componentsV2/FileIcon/icons/LasFileIcon.js";import"../../componentsV2/FileIcon/icons/OtherFileIcon.js";import"../../componentsV2/FileIcon/icons/PdfFileIcon.js";import"../../componentsV2/FileIcon/icons/PowerPointFileIcon.js";import"../../componentsV2/FileIcon/icons/TxtFileIcon.js";import"../../componentsV2/FileIcon/icons/UnknownFileIcon.js";import"../../componentsV2/FileIcon/icons/VideoFileIcon.js";import"../../componentsV2/FileIcon/icons/XmlFileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/Groups.js";import"../Search/components/SelectAllListItem.js";import"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../AssetNameLabel/AssetStatusBadge.js";import"../AssetEditorV2/components/PrimaryAssetSelect.js";import"../AssetEditorV2/components/SecondaryAssetSelect.js";import"../AssetEditorV2/components/SelectItem.js";import"../AssetEditorV2/components/MultipleAssetsToggle.js";import"../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../EChartsWrapper/EChartsWrapper.js";import"../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../GoogleDocsViewer/index.js";import"../NewDocumentViewer/effects/useFileContent.js";import"../NewDocumentViewer/styles.js";import"../FilesLoaderV2/styles.js";import"../FilesDropzone/styles.js";import"../FilesProcessor/styles.js";import"../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../Formula/useFormulaStyles.js";import"../Formula/RootXIcon.js";import"../Formula/FormulaTextEditor.js";import"../Formula/CloseSuggestion.js";import"../Formula/SuggestionsMenu.js";import"../CommentCard/CommentCard.js";import"@material-ui/icons/AlternateEmail";import"../AttachFileButton/AttachFileButton.scss.js";import"../CommentInputNext/CommentInputNext.js";import"../UserMention/utils/index.js";import"react-s3-uploader/s3upload";import"../CommentComposer/CommentMetaLine.scss.js";import"../CommentComposer/ChatChannelSelector.scss.js";import"../CommentComposer/ShareToChatRow.scss.js";import"../CommentComposer/CommentComposer.scss.js";import"../AttachmentPreview/AttachmentPreview.js";import"../AttachmentPreview/AttachmentImage.js";import"../AttachmentPreview/AttachmentPreview.scss.js";import"../CommentPin/CommentPin.js";import"../FeedCard/FeedCard.js";import"../FeedItemCard/FeedItemCard.js";import"../NewCommentCursor/NewCommentCursor.js";import"../LinkedText/LinkedText.js";import"../FeedItem/feedItemTypes/AlertFeedItem.js";import"../FeedItem/feedItemTypes/PostFeedItem.js";import"../FeedItem/feedItemTypes/GeosteeringFeedItem.js";import"../FeedItem/feedItemTypes/DrillingOperationalNoteFeedItem.js";import"../FeedItem/feedItemTypes/DrillingOperationSummaryFeedItem.js";import"../FeedItem/feedItemTypes/DrillingDailyCostFeedItem.js";import"../FeedItem/feedItemTypes/DocumentFeedItem.js";import"../FeedItem/feedItemTypes/DrillerMemoFeedItem.js";import"../FeedItem/feedItemTypes/NptFeedItem.js";import"../FeedItem/feedItemTypes/SurveyStationFeedItem/index.js";import"../FeedItem/feedItemTypes/LessonsLearnedFeedItem/index.js";import"../FeedItem/feedItemTypes/TracesMemoFeedItem.js";import"../FeedItem/feedItemTypes/DepthCommentFeedItem.js";import"../FeedItem/feedItemTypes/CompletionOperationalNoteFeedItem.js";import"../FeedItem/feedItemTypes/CompletionOperationSummaryFeedItem.js";import"../FeedItem/feedItemTypes/CompletionDailyCostFeedItem.js";import"../FeedItem/feedItemTypes/CompletionDocumentFeedItem.js";import"../FeedItem/feedItemTypes/CompletionNptFeedItem.js";import"../FeedItem/feedItemTypes/StageOverviewFeedItem/index.js";import"../FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js";import"../FeedItem/feedItemTypes/WellPlanFeedItem/index.js";import"../FeedItem/feedItemTypes/FluidReportFeedItem.js";import"../FeedItem/feedItemTypes/BhaFeedItem/BhaFeedItem.js";import"../FeedItem/feedItemTypes/DvDCommentFeedItem.js";import"../FeedItem/feedItemTypes/PCCommentFeedItem.js";import"../FeedItem/feedItemTypes/HookloadCommentFeedItem.js";import"../FeedItem/feedItemTypes/NptLessonsCommentFeedItem.js";import"../FeedItem/feedItemTypes/GenericDataCommentFeedItem.js";function w(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function O(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?w(Object(o),!0).forEach((function(t){s(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):w(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var L=C((function(e){return{paper:{width:"552px"},dialogTitles:{display:"flex",flexDirection:"column"},titleContent:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},title:{fontSize:"20px",color:e.palette.primary.text1},description:{fontSize:"16px",fontWeight:"normal",color:e.palette.primary.text6,marginTop:16},closeIconButton:{fontSize:"20px",padding:4,"&:hover $closeIcon":{color:"#fff"}},closeIcon:{color:e.palette.primary.text6},topShadow:{width:"100%",height:"16px",backgroundImage:"linear-gradient(0deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9,")"),position:"absolute",top:"155px",zIndex:2},bottomShadow:{width:"100%",height:"16px",backgroundImage:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9,")"),position:"absolute",bottom:"52px",zIndex:2},dialogActions:{display:"flex",justifyContent:"flex-end",paddingTop:8,paddingBottom:8},dialogActionsSmallScreen:{paddingRight:"100px"},dialogContent:{display:"flex",flexDirection:"column",overflowX:"hidden"},buttonContainer:{display:"flex",gap:"16px"}}}));function M(e,t){var o=e.find((function(e){return e.id===t}));return a(o,"name")||"-"}function H(e,t){var o=e.find((function(e){return e.id===t}));return a(o,"rigName")||"-"}function R(e,t){return"well"===e.value?"Best Wells":"area"===e.value?"Area Offsets":"Best ".concat(e.value,"section"===t?" Wells":' " Wells')}function N(e){return e.map((function(e){return O(O({},e),{},{wells:e.wells.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}))})}))}function G(e){var t=a(e,"bicWellIds")||[],o=a(e,"manualWellIds")||[],s=a(e,"selectedWellIds")||[];return l(t.concat(o).concat(s))}function q(s){var c=s.defaultSubjectWell,C=void 0===c?null:c,w=s.offsetSetting,q=void 0===w?z:w,_=s.currentUser,K=void 0===_?U:_,X=s.isOpen,J=s.onClose,Q=s.onSave,Z=s.addWellsUsabilityInfo,$=void 0===Z?null:Z,Y=s.unusableWellAlarm,ee=void 0===Y?"Unable to add":Y,te=n(!1),oe=o(te,2),se=oe[0],ne=oe[1],ie=L({scrolling:se}),re=i(null),pe=i(!0),me=n(a(C,"companyId")||a(q,"companyId")||+a(K,"company_id")),ce=o(me,2),ae=ce[0],le=ce[1],de=n(a(C,"asset_id")||a(q,"subjectWellId")||null),je=o(de,2),ue=je[0],Ce=je[1],Ie=F(ae,X),Ae=D(ue,X),fe=n([]),Se=o(fe,2),he=Se[0],ge=Se[1],Ve=n(!1),ve=o(Ve,2),be=ve[0],Te=ve[1],xe=n(q),Fe=o(xe,2),De=Fe[0],Pe=Fe[1],ye=n(!1),ke=o(ye,2),Be=ke[0],We=ke[1],Ee=r((function(){if(Ie){var e=G(De);return Ie.filter((function(t){return e.find((function(e){return e===a(t,"id")}))}))}return[]}),[Ie,De]);p((function(){X&&(le(a(C,"companyId")||a(q,"companyId")||+a(K,"company_id")),Ce(a(C,"asset_id")||a(q,"subjectWellId")||null),Pe(q),We(!1),pe.current=!0)}),[q,X]),p((function(){if(X&&Ie&&pe.current){var o,s=a(De,"selectedWellIds")||[],n=a(De,"manualWellIds")||[],i=a(De,"bicWellIds")||[],r=s.concat(n),p=r.filter((function(e){return Ie.find((function(t){return t.id===e}))})).map((function(e){return{id:e,checked:!0,name:M(Ie,e),rigName:H(Ie,e),kind:s.includes(e)?"advanced":"manual"}}));if(Ae&&Ae.filters&&Ae.result){var m,c=[],j=[{name:"Wells within Area",value:"area"}].concat(t(a(Ae,["filters","filterTabs"]))),u=(null===(m=Ae.filters)||void 0===m?void 0:m.filterMode)||"holeSize",C=l(j);o=[{name:"Search Results",wells:p,expanded:Be}].concat(t(C.map((function(t){var o;return{name:R(t,u),wells:(null===(o=Ae.result[t.value])||void 0===o?void 0:o.filter((function(e){return Ie.find((function(t){return t.id===e}))})).map((function(t){var o="object"===e(t)?t.id:t;return c.push(o),{id:o,checked:!1,name:M(Ie,o),rigName:H(Ie,o),kind:"best"}})))||[],expanded:!1}}))))}else o=[{name:"Search Results",wells:p,expanded:Be}].concat(t(P));var I=o.map((function(e){var t=e.wells.map((function(e){return d(i,e.id)||d(r,e.id)?O(O({},e),{},{checked:!0}):O({},e)}));return O(O({},e),{},{wells:t})}));ge(N(I))}}),[X,Ie,Ae,De]);var we=m((function(){return G(De).length}),[De]),Oe=m((function(){return(a(De,"bicWellIds")||[]).length}),[]),Le=i(null),Me=!Ie;return y(k,{children:[y(I,{onBackdropClick:J,onEscapeKeyDown:J,open:X,classes:{paper:ie.paper},children:[B(A,{children:y("div",{className:ie.dialogTitles,children:[y("div",{className:ie.titleContent,children:[B(f,{className:ie.title,children:"Select Offset Wells"}),B(S,{title:"Close",children:B(h,{"data-not-migrated-muiiconbutton":!0,"aria-label":"close",className:ie.closeIconButton,onClick:J,children:B(b,{className:ie.closeIcon})})})]}),B("div",{className:ie.description,children:"Quickly add all of the Best-In-Class Wells per section selected from the Offsets Well Selection Application."})]})}),se&&B("div",{className:ie.topShadow}),B(g,{className:ie.dialogContent,ref:re,onScroll:function(){ne(!0),clearTimeout(Le.current),Le.current=setTimeout((function(){ne(!1)}),1e3)},children:Me?B(W,{fullscreen:!1}):y(k,{children:[B(T,{wells:Ee,offsetWells:Ee}),B(x,{company:ae,wellSections:he,getWellName:M,onChangeWellSections:function(e){var t=N(e);ge(t),We(t[0].expanded);var o=[],s=[],n=[];t.forEach((function(e){e.wells.forEach((function(e){e.checked&&"advanced"===e.kind&&o.push(e.id),e.checked&&"manual"===e.kind&&s.push(e.id),e.checked&&"best"===e.kind&&n.push(e.id)}))}));var i=o.concat(s).concat(n),r=O(O({},De),{},{selectedWellIds:l(o),manualWellIds:l(s),bicWellIds:l(n),resultWellIds:l(i)});Pe(r),pe.current=!1},onExploreMode:function(){Te(!0)}})]})}),B("div",{className:ie.bottomShadow}),B(V,{className:u(ie.dialogActions),children:y("div",{className:ie.buttonContainer,children:[B(v,{"data-testid":"".concat("BICOffsetPickerDialog","_cancel"),onClick:J,color:"primary",children:"Cancel"}),y(v,{"data-testid":"".concat("BICOffsetPickerDialog","_add"),variant:"contained",color:"primary",onClick:function(){var e=G(De),t=Ie.filter((function(t){return d(e,t.id)})),o=O(O({},De),{},{companyId:+ae,resultWellIds:e});Te(!1),Q(o,t)},children:["Add (",we(),")"]})]})})]}),be&&B(E,{defaultSubjectWellId:a(C,"asset_id"),companyId:+ae,offsetSetting:De,currentUser:K,addWellsUsabilityInfo:$,unusableWellAlarm:ee,isAdvancedSearch:!0,bestCount:Oe(),isOpen:be,onClose:function(){Te(!1)},onSave:function(e){var t=e;C||(j(ue,a(t,"subjectWellId"))&&j(ae,a(t,"companyId"))||(t=O(O({},t),{},{bicWellIds:[],manualWellIds:[],resultWellIds:[]})),Ce(a(t,"subjectWellId")),le(a(t,"companyId")));var o=a(t,"manualWellIds")||[],s=a(t,"selectedWellIds")||[];o=o.filter((function(e){return!s.includes(e)})),t=O(O({},t),{},{manualWellIds:o}),Pe(t),pe.current=!0,We(!0),Te(!1)}})]})}q.propTypes={defaultSubjectWell:c.shape({}),offsetSetting:c.shape({subjectWellId:c.number,companyId:c.number}),currentUser:c.shape({}),isOpen:c.bool.isRequired,onClose:c.func.isRequired,onSave:c.func.isRequired,addWellsUsabilityInfo:c.func,unusableWellAlarm:c.string};var z={},U={};export{q as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/BICOffsetPickerDialog/index.js"],"sourcesContent":["import { useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { get, uniq, includes, isEqual } from 'lodash';\nimport classnames from 'classnames';\nimport {\n Button,\n IconButton,\n Typography,\n Dialog,\n DialogContent,\n DialogTitle,\n DialogActions,\n Tooltip,\n makeStyles,\n} from '@material-ui/core';\nimport { Close as CloseIcon } from '@material-ui/icons';\n\nimport WellsMap from './components/Map';\nimport WellSection from './components/WellSection';\nimport { useWells, useFetchBicWellsData } from './effects';\nimport { DEFAULT_WELL_SECTIONS } from './constants';\n\nimport { LoadingIndicator, OffsetWellPickerV2 } from '~/components';\n\nconst PAGE_NAME = 'BICOffsetPickerDialog';\n\nconst useStyles = makeStyles(theme => ({\n paper: {\n width: '552px',\n },\n dialogTitles: {\n display: 'flex',\n flexDirection: 'column',\n },\n titleContent: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n },\n title: {\n fontSize: '20px',\n color: theme.palette.primary.text1,\n },\n description: {\n fontSize: '16px',\n fontWeight: 'normal',\n color: theme.palette.primary.text6,\n marginTop: 16,\n },\n closeIconButton: {\n fontSize: '20px',\n padding: 4,\n '&:hover $closeIcon': {\n color: '#fff',\n },\n },\n closeIcon: {\n color: theme.palette.primary.text6,\n },\n topShadow: {\n width: '100%',\n height: '16px',\n backgroundImage: `linear-gradient(0deg, rgba(65, 65, 65, 0) 0%, ${theme.palette.background.b9})`,\n position: 'absolute',\n top: '155px',\n zIndex: 2,\n },\n bottomShadow: {\n width: '100%',\n height: '16px',\n backgroundImage: `linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ${theme.palette.background.b9})`,\n position: 'absolute',\n bottom: '52px',\n zIndex: 2,\n },\n dialogActions: {\n display: 'flex',\n justifyContent: 'flex-end',\n paddingTop: 8,\n paddingBottom: 8,\n },\n dialogActionsSmallScreen: {\n paddingRight: '100px', // Intercom\n },\n dialogContent: {\n display: 'flex',\n flexDirection: 'column',\n overflowX: 'hidden',\n },\n buttonContainer: {\n display: 'flex',\n gap: '16px',\n },\n}));\n\nfunction getWellName(wells, wellId) {\n const well = wells.find(item => item.id === wellId);\n return get(well, 'name') || '-';\n}\n\nfunction getRigName(wells, wellId) {\n const well = wells.find(item => item.id === wellId);\n return get(well, 'rigName') || '-';\n}\n\nfunction getSectionName(area, filterMode) {\n if (area.value === 'well') return 'Best Wells';\n else if (area.value === 'area') return 'Area Offsets';\n else if (filterMode === 'section') return `Best ${area.value} Wells`;\n return `Best ${area.value} \" Wells`;\n}\n\nfunction sortWells(sections) {\n const sortedWells = sections.map(section => ({\n ...section,\n wells: section.wells.sort((a, b) => {\n if (a.name < b.name) return -1;\n if (a.name > b.name) return 1;\n return 0;\n }),\n }));\n return sortedWells;\n}\n\nfunction getResultWellIds(offsetSetting) {\n const bicWellIds = get(offsetSetting, 'bicWellIds') || [];\n const manualWellIds = get(offsetSetting, 'manualWellIds') || [];\n const selectedWellIds = get(offsetSetting, 'selectedWellIds') || [];\n const resultWellIds = uniq(bicWellIds.concat(manualWellIds).concat(selectedWellIds));\n return resultWellIds;\n}\n\nfunction BICOffsetPickerDialog({\n defaultSubjectWell = null,\n offsetSetting = DEFAULT_BICOFFSET_PICKER_DIALOG_OFFSET_SETTING,\n currentUser = DEFAULT_BICOFFSET_PICKER_DIALOG_CURRENT_USER,\n isOpen,\n onClose,\n onSave,\n addWellsUsabilityInfo = null,\n unusableWellAlarm = 'Unable to add',\n}) {\n const [scrolling, setScrolling] = useState(false);\n const classes = useStyles({ scrolling });\n const dialogContentRef = useRef(null);\n const loadingRef = useRef(true);\n const [companyId, setCompanyId] = useState(\n get(defaultSubjectWell, 'companyId') ||\n get(offsetSetting, 'companyId') ||\n +get(currentUser, 'company_id')\n );\n const [subjectWellId, setSubjectWellId] = useState(\n get(defaultSubjectWell, 'asset_id') || get(offsetSetting, 'subjectWellId') || null\n );\n const wells = useWells(companyId, isOpen);\n const bicData = useFetchBicWellsData(subjectWellId, isOpen);\n const [wellSections, setWellSections] = useState([]);\n const [isOpenOffsetDialog, setIsOpenOffsetsDialog] = useState(false);\n const [interimOffsetSetting, setInterimOffsetSetting] = useState(offsetSetting);\n const [expandedSearchResult, setExpandedSearchResult] = useState(false);\n const offsetWells = useMemo(() => {\n if (wells) {\n const resultWellIds = getResultWellIds(interimOffsetSetting);\n const data = wells.filter(well => resultWellIds.find(id => id === get(well, 'id')));\n return data;\n }\n return [];\n }, [wells, interimOffsetSetting]);\n\n useEffect(() => {\n if (isOpen) {\n setCompanyId(\n get(defaultSubjectWell, 'companyId') ||\n get(offsetSetting, 'companyId') ||\n +get(currentUser, 'company_id')\n );\n setSubjectWellId(\n get(defaultSubjectWell, 'asset_id') || get(offsetSetting, 'subjectWellId') || null\n );\n setInterimOffsetSetting(offsetSetting);\n setExpandedSearchResult(false);\n loadingRef.current = true;\n }\n }, [offsetSetting, isOpen]);\n\n // NOTE: update well section wells data\n useEffect(() => {\n if (!isOpen || !wells || !loadingRef.current) return;\n\n const selectedWellIds = get(interimOffsetSetting, 'selectedWellIds') || [];\n const manualWellIds = get(interimOffsetSetting, 'manualWellIds') || [];\n const bicWellIds = get(interimOffsetSetting, 'bicWellIds') || [];\n\n // Make Search Results Tab\n const allManualWellIds = selectedWellIds.concat(manualWellIds);\n const searchResults = allManualWellIds\n .filter(id => wells.find(well => well.id === id))\n .map(id => {\n return {\n id,\n checked: true,\n name: getWellName(wells, id),\n rigName: getRigName(wells, id),\n kind: selectedWellIds.includes(id) ? 'advanced' : 'manual',\n };\n });\n\n // Make Best Wells Tabs\n let mergedSections;\n if (!bicData || !bicData.filters || !bicData.result) {\n mergedSections = [\n { name: 'Search Results', wells: searchResults, expanded: expandedSearchResult },\n ...DEFAULT_WELL_SECTIONS,\n ];\n } else {\n const bestWellIds = [];\n const filteredTabs = [\n { name: 'Wells within Area', value: 'area' },\n ...get(bicData, ['filters', 'filterTabs']),\n ];\n const filterMode = bicData.filters?.filterMode || 'holeSize';\n const tabs = uniq(filteredTabs);\n mergedSections = [\n { name: 'Search Results', wells: searchResults, expanded: expandedSearchResult },\n ...tabs.map(area => {\n return {\n name: getSectionName(area, filterMode),\n wells:\n bicData.result[area.value]\n ?.filter(id => wells.find(well => well.id === id))\n .map(item => {\n const id = typeof item === 'object' ? item.id : item;\n bestWellIds.push(id);\n return {\n id,\n checked: false,\n name: getWellName(wells, id),\n rigName: getRigName(wells, id),\n kind: 'best',\n };\n }) || [],\n expanded: false,\n };\n }),\n ];\n }\n\n // Check if any best well is checked\n const sectionsData = mergedSections.map(section => {\n const data = section.wells.map(item => {\n if (includes(bicWellIds, item.id) || includes(allManualWellIds, item.id)) {\n return {\n ...item,\n checked: true,\n };\n } else {\n return { ...item };\n }\n });\n return {\n ...section,\n wells: data,\n };\n });\n // Sort by name\n setWellSections(sortWells(sectionsData));\n }, [isOpen, wells, bicData, interimOffsetSetting]);\n\n // NOTE: BIC Wells\n const handleChangeWellSections = sections => {\n const sortedSections = sortWells(sections);\n setWellSections(sortedSections);\n setExpandedSearchResult(sortedSections[0].expanded);\n\n const newSelectedWellIds = [];\n const newManualWellIds = [];\n const newBicWellIds = [];\n sortedSections.forEach(section => {\n section.wells.forEach(well => {\n if (well.checked && well.kind === 'advanced') newSelectedWellIds.push(well.id);\n if (well.checked && well.kind === 'manual') newManualWellIds.push(well.id);\n if (well.checked && well.kind === 'best') newBicWellIds.push(well.id);\n });\n });\n const newResultWellIds = newSelectedWellIds.concat(newManualWellIds).concat(newBicWellIds);\n const newOffsetSetting = {\n ...interimOffsetSetting,\n selectedWellIds: uniq(newSelectedWellIds),\n manualWellIds: uniq(newManualWellIds),\n bicWellIds: uniq(newBicWellIds),\n resultWellIds: uniq(newResultWellIds),\n };\n setInterimOffsetSetting(newOffsetSetting);\n loadingRef.current = false;\n };\n\n const handleCloseAdvancedWells = () => {\n setIsOpenOffsetsDialog(false);\n };\n\n const handleAddAdvancedWells = newOffsetSetting => {\n let offsetSettings = newOffsetSetting;\n if (!defaultSubjectWell) {\n if (\n !isEqual(subjectWellId, get(offsetSettings, 'subjectWellId')) ||\n !isEqual(companyId, get(offsetSettings, 'companyId'))\n ) {\n offsetSettings = {\n ...offsetSettings,\n bicWellIds: [],\n manualWellIds: [],\n resultWellIds: [],\n };\n }\n setSubjectWellId(get(offsetSettings, 'subjectWellId'));\n setCompanyId(get(offsetSettings, 'companyId'));\n }\n\n let manualWellIds = get(offsetSettings, 'manualWellIds') || [];\n const selectedWellIds = get(offsetSettings, 'selectedWellIds') || [];\n manualWellIds = manualWellIds.filter(id => !selectedWellIds.includes(id));\n offsetSettings = {\n ...offsetSettings,\n manualWellIds,\n };\n setInterimOffsetSetting(offsetSettings);\n loadingRef.current = true;\n setExpandedSearchResult(true);\n setIsOpenOffsetsDialog(false);\n };\n\n const handleOpenAdvancedDialog = () => {\n setIsOpenOffsetsDialog(true);\n };\n\n const handleAdd = () => {\n const resultWellIds = getResultWellIds(interimOffsetSetting);\n\n const allOffsetWells = wells.filter(well => includes(resultWellIds, well.id));\n const newOffsetSetting = {\n ...interimOffsetSetting,\n companyId: +companyId,\n resultWellIds,\n };\n\n setIsOpenOffsetsDialog(false);\n onSave(newOffsetSetting, allOffsetWells);\n };\n\n const getResultCount = useCallback(() => {\n const resultWellIds = getResultWellIds(interimOffsetSetting);\n return resultWellIds.length;\n }, [interimOffsetSetting]);\n\n const getBestCount = useCallback(() => {\n const bicWellIds = get(interimOffsetSetting, 'bicWellIds') || [];\n return bicWellIds.length;\n }, []);\n const scrollTimeoutRef = useRef(null);\n\n const handleScroll = () => {\n setScrolling(true);\n clearTimeout(scrollTimeoutRef.current);\n scrollTimeoutRef.current = setTimeout(() => {\n setScrolling(false);\n }, 1000);\n };\n\n const isLoading = !wells;\n\n return (\n <>\n <Dialog\n onBackdropClick={onClose}\n onEscapeKeyDown={onClose}\n open={isOpen}\n classes={{ paper: classes.paper }}\n >\n <DialogTitle>\n <div className={classes.dialogTitles}>\n <div className={classes.titleContent}>\n <Typography className={classes.title}>Select Offset Wells</Typography>\n <Tooltip title=\"Close\">\n <IconButton\n data-not-migrated-muiiconbutton\n aria-label=\"close\"\n className={classes.closeIconButton}\n onClick={onClose}\n >\n <CloseIcon className={classes.closeIcon} />\n </IconButton>\n </Tooltip>\n </div>\n <div className={classes.description}>\n Quickly add all of the Best-In-Class Wells per section selected from the Offsets Well\n Selection Application.\n </div>\n </div>\n </DialogTitle>\n {scrolling && <div className={classes.topShadow} />}\n <DialogContent\n className={classes.dialogContent}\n ref={dialogContentRef}\n onScroll={handleScroll}\n >\n {!isLoading ? (\n <>\n <WellsMap wells={offsetWells} offsetWells={offsetWells} />\n <WellSection\n company={companyId}\n wellSections={wellSections}\n getWellName={getWellName}\n onChangeWellSections={handleChangeWellSections}\n onExploreMode={handleOpenAdvancedDialog}\n />\n </>\n ) : (\n <LoadingIndicator fullscreen={false} />\n )}\n </DialogContent>\n <div className={classes.bottomShadow} />\n <DialogActions className={classnames(classes.dialogActions)}>\n <div className={classes.buttonContainer}>\n <Button data-testid={`${PAGE_NAME}_cancel`} onClick={onClose} color=\"primary\">\n Cancel\n </Button>\n <Button\n data-testid={`${PAGE_NAME}_add`}\n variant=\"contained\"\n color=\"primary\"\n onClick={handleAdd}\n >\n Add ({getResultCount()})\n </Button>\n </div>\n </DialogActions>\n </Dialog>\n\n {isOpenOffsetDialog && (\n <OffsetWellPickerV2\n defaultSubjectWellId={get(defaultSubjectWell, 'asset_id')}\n companyId={+companyId}\n offsetSetting={interimOffsetSetting}\n currentUser={currentUser}\n addWellsUsabilityInfo={addWellsUsabilityInfo}\n unusableWellAlarm={unusableWellAlarm}\n isAdvancedSearch\n bestCount={getBestCount()}\n isOpen={isOpenOffsetDialog}\n onClose={handleCloseAdvancedWells}\n onSave={handleAddAdvancedWells}\n />\n )}\n </>\n );\n}\n\nBICOffsetPickerDialog.propTypes = {\n defaultSubjectWell: PropTypes.shape({}),\n offsetSetting: PropTypes.shape({\n subjectWellId: PropTypes.number,\n companyId: PropTypes.number,\n }),\n currentUser: PropTypes.shape({}),\n isOpen: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n addWellsUsabilityInfo: PropTypes.func, // update offset wells usability info in specific apps (\"is_usable\" field)\n unusableWellAlarm: PropTypes.string,\n};\n\nconst DEFAULT_BICOFFSET_PICKER_DIALOG_OFFSET_SETTING = {};\nconst DEFAULT_BICOFFSET_PICKER_DIALOG_CURRENT_USER = {};\n\nexport default BICOffsetPickerDialog;\n"],"names":["useStyles","makeStyles","theme","paper","width","dialogTitles","display","flexDirection","titleContent","justifyContent","alignItems","title","fontSize","color","palette","primary","text1","description","fontWeight","text6","marginTop","closeIconButton","padding","closeIcon","topShadow","height","backgroundImage","concat","background","b9","position","top","zIndex","bottomShadow","bottom","dialogActions","paddingTop","paddingBottom","dialogActionsSmallScreen","paddingRight","dialogContent","overflowX","buttonContainer","gap","getWellName","wells","wellId","well","find","item","id","get","getRigName","getSectionName","area","filterMode","value","sortWells","sections","map","section","_objectSpread","sort","a","b","name","getResultWellIds","offsetSetting","bicWellIds","manualWellIds","selectedWellIds","uniq","BICOffsetPickerDialog","_ref","_ref$defaultSubjectWe","defaultSubjectWell","_ref$offsetSetting","DEFAULT_BICOFFSET_PICKER_DIALOG_OFFSET_SETTING","_ref$currentUser","currentUser","DEFAULT_BICOFFSET_PICKER_DIALOG_CURRENT_USER","isOpen","onClose","onSave","_ref$addWellsUsabilit","addWellsUsabilityInfo","_ref$unusableWellAlar","unusableWellAlarm","useState","_useState2","_slicedToArray","_useState","scrolling","setScrolling","classes","dialogContentRef","useRef","loadingRef","_useState4","_useState3","companyId","setCompanyId","_useState5","_useState6","subjectWellId","setSubjectWellId","useWells","bicData","useFetchBicWellsData","_useState8","_useState7","wellSections","setWellSections","_useState10","_useState9","isOpenOffsetDialog","setIsOpenOffsetsDialog","_useState12","_useState11","interimOffsetSetting","setInterimOffsetSetting","_useState14","_useState13","expandedSearchResult","setExpandedSearchResult","offsetWells","useMemo","resultWellIds","filter","useEffect","current","mergedSections","allManualWellIds","searchResults","checked","rigName","kind","includes","filters","result","_bicData$filters","bestWellIds","filteredTabs","_toConsumableArray","tabs","expanded","_bicData$result$area$","_typeof","push","DEFAULT_WELL_SECTIONS","sectionsData","data","getResultCount","useCallback","length","getBestCount","scrollTimeoutRef","isLoading","_jsxs","_Fragment","children","Dialog","onBackdropClick","onEscapeKeyDown","open","_jsx","DialogTitle","className","Typography","Tooltip","IconButton","onClick","CloseIcon","DialogContent","ref","onScroll","clearTimeout","setTimeout","LoadingIndicator","fullscreen","WellsMap","WellSection","company","onChangeWellSections","sortedSections","newSelectedWellIds","newManualWellIds","newBicWellIds","forEach","newResultWellIds","newOffsetSetting","onExploreMode","DialogActions","classnames","Button","variant","allOffsetWells","OffsetWellPickerV2","defaultSubjectWellId","isAdvancedSearch","bestCount","offsetSettings","isEqual","propTypes","PropTypes","shape","number","bool","isRequired","func","string"],"mappings":"mw3BAwBA,IAEMA,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,MAAO,CACLC,MAAO,SAETC,aAAc,CACZC,QAAS,OACTC,cAAe,UAEjBC,aAAc,CACZF,Q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+H3B,CAEA5C,EAAsBmI,UAAY,CAChChI,mBAAoBiI,EAAUC,MAAM,IACpC1I,cAAeyI,EAAUC,MAAM,CAC7BrG,cAAeoG,EAAUE,OACzB1G,UAAWwG,EAAUE,SAEvB/H,YAAa6H,EAAUC,MAAM,IAC7B5H,OAAQ2H,EAAUG,KAAKC,WACvB9H,QAAS0H,EAAUK,KAAKD,WACxB7H,OAAQyH,EAAUK,KAAKD,WACvB3H,sBAAuBuH,EAAUK,KACjC1H,kBAAmBqH,EAAUM,QAG/B,IAAMrI,EAAiD,CAAA,EACjDG,EAA+C,CAAE"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/BICOffsetPickerDialog/index.js"],"sourcesContent":["import { useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { get, uniq, includes, isEqual } from 'lodash';\nimport classnames from 'classnames';\nimport {\n Button,\n IconButton,\n Typography,\n Dialog,\n DialogContent,\n DialogTitle,\n DialogActions,\n Tooltip,\n makeStyles,\n} from '@material-ui/core';\nimport { Close as CloseIcon } from '@material-ui/icons';\n\nimport WellsMap from './components/Map';\nimport WellSection from './components/WellSection';\nimport { useWells, useFetchBicWellsData } from './effects';\nimport { DEFAULT_WELL_SECTIONS } from './constants';\n\nimport { LoadingIndicator, OffsetWellPickerV2 } from '~/components';\n\nconst PAGE_NAME = 'BICOffsetPickerDialog';\n\nconst useStyles = makeStyles(theme => ({\n paper: {\n width: '552px',\n },\n dialogTitles: {\n display: 'flex',\n flexDirection: 'column',\n },\n titleContent: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n },\n title: {\n fontSize: '20px',\n color: theme.palette.primary.text1,\n },\n description: {\n fontSize: '16px',\n fontWeight: 'normal',\n color: theme.palette.primary.text6,\n marginTop: 16,\n },\n closeIconButton: {\n fontSize: '20px',\n padding: 4,\n '&:hover $closeIcon': {\n color: '#fff',\n },\n },\n closeIcon: {\n color: theme.palette.primary.text6,\n },\n topShadow: {\n width: '100%',\n height: '16px',\n backgroundImage: `linear-gradient(0deg, rgba(65, 65, 65, 0) 0%, ${theme.palette.background.b9})`,\n position: 'absolute',\n top: '155px',\n zIndex: 2,\n },\n bottomShadow: {\n width: '100%',\n height: '16px',\n backgroundImage: `linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ${theme.palette.background.b9})`,\n position: 'absolute',\n bottom: '52px',\n zIndex: 2,\n },\n dialogActions: {\n display: 'flex',\n justifyContent: 'flex-end',\n paddingTop: 8,\n paddingBottom: 8,\n },\n dialogActionsSmallScreen: {\n paddingRight: '100px', // Intercom\n },\n dialogContent: {\n display: 'flex',\n flexDirection: 'column',\n overflowX: 'hidden',\n },\n buttonContainer: {\n display: 'flex',\n gap: '16px',\n },\n}));\n\nfunction getWellName(wells, wellId) {\n const well = wells.find(item => item.id === wellId);\n return get(well, 'name') || '-';\n}\n\nfunction getRigName(wells, wellId) {\n const well = wells.find(item => item.id === wellId);\n return get(well, 'rigName') || '-';\n}\n\nfunction getSectionName(area, filterMode) {\n if (area.value === 'well') return 'Best Wells';\n else if (area.value === 'area') return 'Area Offsets';\n else if (filterMode === 'section') return `Best ${area.value} Wells`;\n return `Best ${area.value} \" Wells`;\n}\n\nfunction sortWells(sections) {\n const sortedWells = sections.map(section => ({\n ...section,\n wells: section.wells.sort((a, b) => {\n if (a.name < b.name) return -1;\n if (a.name > b.name) return 1;\n return 0;\n }),\n }));\n return sortedWells;\n}\n\nfunction getResultWellIds(offsetSetting) {\n const bicWellIds = get(offsetSetting, 'bicWellIds') || [];\n const manualWellIds = get(offsetSetting, 'manualWellIds') || [];\n const selectedWellIds = get(offsetSetting, 'selectedWellIds') || [];\n const resultWellIds = uniq(bicWellIds.concat(manualWellIds).concat(selectedWellIds));\n return resultWellIds;\n}\n\nfunction BICOffsetPickerDialog({\n defaultSubjectWell = null,\n offsetSetting = DEFAULT_BICOFFSET_PICKER_DIALOG_OFFSET_SETTING,\n currentUser = DEFAULT_BICOFFSET_PICKER_DIALOG_CURRENT_USER,\n isOpen,\n onClose,\n onSave,\n addWellsUsabilityInfo = null,\n unusableWellAlarm = 'Unable to add',\n}) {\n const [scrolling, setScrolling] = useState(false);\n const classes = useStyles({ scrolling });\n const dialogContentRef = useRef(null);\n const loadingRef = useRef(true);\n const [companyId, setCompanyId] = useState(\n get(defaultSubjectWell, 'companyId') ||\n get(offsetSetting, 'companyId') ||\n +get(currentUser, 'company_id')\n );\n const [subjectWellId, setSubjectWellId] = useState(\n get(defaultSubjectWell, 'asset_id') || get(offsetSetting, 'subjectWellId') || null\n );\n const wells = useWells(companyId, isOpen);\n const bicData = useFetchBicWellsData(subjectWellId, isOpen);\n const [wellSections, setWellSections] = useState([]);\n const [isOpenOffsetDialog, setIsOpenOffsetsDialog] = useState(false);\n const [interimOffsetSetting, setInterimOffsetSetting] = useState(offsetSetting);\n const [expandedSearchResult, setExpandedSearchResult] = useState(false);\n const offsetWells = useMemo(() => {\n if (wells) {\n const resultWellIds = getResultWellIds(interimOffsetSetting);\n const data = wells.filter(well => resultWellIds.find(id => id === get(well, 'id')));\n return data;\n }\n return [];\n }, [wells, interimOffsetSetting]);\n\n useEffect(() => {\n if (isOpen) {\n setCompanyId(\n get(defaultSubjectWell, 'companyId') ||\n get(offsetSetting, 'companyId') ||\n +get(currentUser, 'company_id')\n );\n setSubjectWellId(\n get(defaultSubjectWell, 'asset_id') || get(offsetSetting, 'subjectWellId') || null\n );\n setInterimOffsetSetting(offsetSetting);\n setExpandedSearchResult(false);\n loadingRef.current = true;\n }\n }, [offsetSetting, isOpen]);\n\n // NOTE: update well section wells data\n useEffect(() => {\n if (!isOpen || !wells || !loadingRef.current) return;\n\n const selectedWellIds = get(interimOffsetSetting, 'selectedWellIds') || [];\n const manualWellIds = get(interimOffsetSetting, 'manualWellIds') || [];\n const bicWellIds = get(interimOffsetSetting, 'bicWellIds') || [];\n\n // Make Search Results Tab\n const allManualWellIds = selectedWellIds.concat(manualWellIds);\n const searchResults = allManualWellIds\n .filter(id => wells.find(well => well.id === id))\n .map(id => {\n return {\n id,\n checked: true,\n name: getWellName(wells, id),\n rigName: getRigName(wells, id),\n kind: selectedWellIds.includes(id) ? 'advanced' : 'manual',\n };\n });\n\n // Make Best Wells Tabs\n let mergedSections;\n if (!bicData || !bicData.filters || !bicData.result) {\n mergedSections = [\n { name: 'Search Results', wells: searchResults, expanded: expandedSearchResult },\n ...DEFAULT_WELL_SECTIONS,\n ];\n } else {\n const bestWellIds = [];\n const filteredTabs = [\n { name: 'Wells within Area', value: 'area' },\n ...get(bicData, ['filters', 'filterTabs']),\n ];\n const filterMode = bicData.filters?.filterMode || 'holeSize';\n const tabs = uniq(filteredTabs);\n mergedSections = [\n { name: 'Search Results', wells: searchResults, expanded: expandedSearchResult },\n ...tabs.map(area => {\n return {\n name: getSectionName(area, filterMode),\n wells:\n bicData.result[area.value]\n ?.filter(id => wells.find(well => well.id === id))\n .map(item => {\n const id = typeof item === 'object' ? item.id : item;\n bestWellIds.push(id);\n return {\n id,\n checked: false,\n name: getWellName(wells, id),\n rigName: getRigName(wells, id),\n kind: 'best',\n };\n }) || [],\n expanded: false,\n };\n }),\n ];\n }\n\n // Check if any best well is checked\n const sectionsData = mergedSections.map(section => {\n const data = section.wells.map(item => {\n if (includes(bicWellIds, item.id) || includes(allManualWellIds, item.id)) {\n return {\n ...item,\n checked: true,\n };\n } else {\n return { ...item };\n }\n });\n return {\n ...section,\n wells: data,\n };\n });\n // Sort by name\n setWellSections(sortWells(sectionsData));\n }, [isOpen, wells, bicData, interimOffsetSetting]);\n\n // NOTE: BIC Wells\n const handleChangeWellSections = sections => {\n const sortedSections = sortWells(sections);\n setWellSections(sortedSections);\n setExpandedSearchResult(sortedSections[0].expanded);\n\n const newSelectedWellIds = [];\n const newManualWellIds = [];\n const newBicWellIds = [];\n sortedSections.forEach(section => {\n section.wells.forEach(well => {\n if (well.checked && well.kind === 'advanced') newSelectedWellIds.push(well.id);\n if (well.checked && well.kind === 'manual') newManualWellIds.push(well.id);\n if (well.checked && well.kind === 'best') newBicWellIds.push(well.id);\n });\n });\n const newResultWellIds = newSelectedWellIds.concat(newManualWellIds).concat(newBicWellIds);\n const newOffsetSetting = {\n ...interimOffsetSetting,\n selectedWellIds: uniq(newSelectedWellIds),\n manualWellIds: uniq(newManualWellIds),\n bicWellIds: uniq(newBicWellIds),\n resultWellIds: uniq(newResultWellIds),\n };\n setInterimOffsetSetting(newOffsetSetting);\n loadingRef.current = false;\n };\n\n const handleCloseAdvancedWells = () => {\n setIsOpenOffsetsDialog(false);\n };\n\n const handleAddAdvancedWells = newOffsetSetting => {\n let offsetSettings = newOffsetSetting;\n if (!defaultSubjectWell) {\n if (\n !isEqual(subjectWellId, get(offsetSettings, 'subjectWellId')) ||\n !isEqual(companyId, get(offsetSettings, 'companyId'))\n ) {\n offsetSettings = {\n ...offsetSettings,\n bicWellIds: [],\n manualWellIds: [],\n resultWellIds: [],\n };\n }\n setSubjectWellId(get(offsetSettings, 'subjectWellId'));\n setCompanyId(get(offsetSettings, 'companyId'));\n }\n\n let manualWellIds = get(offsetSettings, 'manualWellIds') || [];\n const selectedWellIds = get(offsetSettings, 'selectedWellIds') || [];\n manualWellIds = manualWellIds.filter(id => !selectedWellIds.includes(id));\n offsetSettings = {\n ...offsetSettings,\n manualWellIds,\n };\n setInterimOffsetSetting(offsetSettings);\n loadingRef.current = true;\n setExpandedSearchResult(true);\n setIsOpenOffsetsDialog(false);\n };\n\n const handleOpenAdvancedDialog = () => {\n setIsOpenOffsetsDialog(true);\n };\n\n const handleAdd = () => {\n const resultWellIds = getResultWellIds(interimOffsetSetting);\n\n const allOffsetWells = wells.filter(well => includes(resultWellIds, well.id));\n const newOffsetSetting = {\n ...interimOffsetSetting,\n companyId: +companyId,\n resultWellIds,\n };\n\n setIsOpenOffsetsDialog(false);\n onSave(newOffsetSetting, allOffsetWells);\n };\n\n const getResultCount = useCallback(() => {\n const resultWellIds = getResultWellIds(interimOffsetSetting);\n return resultWellIds.length;\n }, [interimOffsetSetting]);\n\n const getBestCount = useCallback(() => {\n const bicWellIds = get(interimOffsetSetting, 'bicWellIds') || [];\n return bicWellIds.length;\n }, []);\n const scrollTimeoutRef = useRef(null);\n\n const handleScroll = () => {\n setScrolling(true);\n clearTimeout(scrollTimeoutRef.current);\n scrollTimeoutRef.current = setTimeout(() => {\n setScrolling(false);\n }, 1000);\n };\n\n const isLoading = !wells;\n\n return (\n <>\n <Dialog\n onBackdropClick={onClose}\n onEscapeKeyDown={onClose}\n open={isOpen}\n classes={{ paper: classes.paper }}\n >\n <DialogTitle>\n <div className={classes.dialogTitles}>\n <div className={classes.titleContent}>\n <Typography className={classes.title}>Select Offset Wells</Typography>\n <Tooltip title=\"Close\">\n <IconButton\n data-not-migrated-muiiconbutton\n aria-label=\"close\"\n className={classes.closeIconButton}\n onClick={onClose}\n >\n <CloseIcon className={classes.closeIcon} />\n </IconButton>\n </Tooltip>\n </div>\n <div className={classes.description}>\n Quickly add all of the Best-In-Class Wells per section selected from the Offsets Well\n Selection Application.\n </div>\n </div>\n </DialogTitle>\n {scrolling && <div className={classes.topShadow} />}\n <DialogContent\n className={classes.dialogContent}\n ref={dialogContentRef}\n onScroll={handleScroll}\n >\n {!isLoading ? (\n <>\n <WellsMap wells={offsetWells} offsetWells={offsetWells} />\n <WellSection\n company={companyId}\n wellSections={wellSections}\n getWellName={getWellName}\n onChangeWellSections={handleChangeWellSections}\n onExploreMode={handleOpenAdvancedDialog}\n />\n </>\n ) : (\n <LoadingIndicator fullscreen={false} />\n )}\n </DialogContent>\n <div className={classes.bottomShadow} />\n <DialogActions className={classnames(classes.dialogActions)}>\n <div className={classes.buttonContainer}>\n <Button data-testid={`${PAGE_NAME}_cancel`} onClick={onClose} color=\"primary\">\n Cancel\n </Button>\n <Button\n data-testid={`${PAGE_NAME}_add`}\n variant=\"contained\"\n color=\"primary\"\n onClick={handleAdd}\n >\n Add ({getResultCount()})\n </Button>\n </div>\n </DialogActions>\n </Dialog>\n\n {isOpenOffsetDialog && (\n <OffsetWellPickerV2\n defaultSubjectWellId={get(defaultSubjectWell, 'asset_id')}\n companyId={+companyId}\n offsetSetting={interimOffsetSetting}\n currentUser={currentUser}\n addWellsUsabilityInfo={addWellsUsabilityInfo}\n unusableWellAlarm={unusableWellAlarm}\n isAdvancedSearch\n bestCount={getBestCount()}\n isOpen={isOpenOffsetDialog}\n onClose={handleCloseAdvancedWells}\n onSave={handleAddAdvancedWells}\n />\n )}\n </>\n );\n}\n\nBICOffsetPickerDialog.propTypes = {\n defaultSubjectWell: PropTypes.shape({}),\n offsetSetting: PropTypes.shape({\n subjectWellId: PropTypes.number,\n companyId: PropTypes.number,\n }),\n currentUser: PropTypes.shape({}),\n isOpen: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n addWellsUsabilityInfo: PropTypes.func, // update offset wells usability info in specific apps (\"is_usable\" field)\n unusableWellAlarm: PropTypes.string,\n};\n\nconst DEFAULT_BICOFFSET_PICKER_DIALOG_OFFSET_SETTING = {};\nconst DEFAULT_BICOFFSET_PICKER_DIALOG_CURRENT_USER = {};\n\nexport default BICOffsetPickerDialog;\n"],"names":["useStyles","makeStyles","theme","paper","width","dialogTitles","display","flexDirection","titleContent","justifyContent","alignItems","title","fontSize","color","palette","primary","text1","description","fontWeight","text6","marginTop","closeIconButton","padding","closeIcon","topShadow","height","backgroundImage","concat","background","b9","position","top","zIndex","bottomShadow","bottom","dialogActions","paddingTop","paddingBottom","dialogActionsSmallScreen","paddingRight","dialogContent","overflowX","buttonContainer","gap","getWellName","wells","wellId","well","find","item","id","get","getRigName","getSectionName","area","filterMode","value","sortWells","sections","map","section","_objectSpread","sort","a","b","name","getResultWellIds","offsetSetting","bicWellIds","manualWellIds","selectedWellIds","uniq","BICOffsetPickerDialog","_ref","_ref$defaultSubjectWe","defaultSubjectWell","_ref$offsetSetting","DEFAULT_BICOFFSET_PICKER_DIALOG_OFFSET_SETTING","_ref$currentUser","currentUser","DEFAULT_BICOFFSET_PICKER_DIALOG_CURRENT_USER","isOpen","onClose","onSave","_ref$addWellsUsabilit","addWellsUsabilityInfo","_ref$unusableWellAlar","unusableWellAlarm","useState","_useState2","_slicedToArray","_useState","scrolling","setScrolling","classes","dialogContentRef","useRef","loadingRef","_useState4","_useState3","companyId","setCompanyId","_useState5","_useState6","subjectWellId","setSubjectWellId","useWells","bicData","useFetchBicWellsData","_useState8","_useState7","wellSections","setWellSections","_useState10","_useState9","isOpenOffsetDialog","setIsOpenOffsetsDialog","_useState12","_useState11","interimOffsetSetting","setInterimOffsetSetting","_useState14","_useState13","expandedSearchResult","setExpandedSearchResult","offsetWells","useMemo","resultWellIds","filter","useEffect","current","mergedSections","allManualWellIds","searchResults","checked","rigName","kind","includes","filters","result","_bicData$filters","bestWellIds","filteredTabs","_toConsumableArray","tabs","expanded","_bicData$result$area$","_typeof","push","DEFAULT_WELL_SECTIONS","sectionsData","data","getResultCount","useCallback","length","getBestCount","scrollTimeoutRef","isLoading","_jsxs","_Fragment","children","Dialog","onBackdropClick","onEscapeKeyDown","open","_jsx","DialogTitle","className","Typography","Tooltip","IconButton","onClick","CloseIcon","DialogContent","ref","onScroll","clearTimeout","setTimeout","LoadingIndicator","fullscreen","WellsMap","WellSection","company","onChangeWellSections","sortedSections","newSelectedWellIds","newManualWellIds","newBicWellIds","forEach","newResultWellIds","newOffsetSetting","onExploreMode","DialogActions","classnames","Button","variant","allOffsetWells","OffsetWellPickerV2","defaultSubjectWellId","isAdvancedSearch","bestCount","offsetSettings","isEqual","propTypes","PropTypes","shape","number","bool","isRequired","func","string"],"mappings":"qg4BAwBA,IAEMA,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,MAAO,CACLC,MAAO,SAETC,aAAc,CACZC,QAAS,OACTC,cAAe,UAEjBC,aAAc,CACZF,QAAS,OACTC,cAAe,MACfE,eAAgB,gBAChBC,WAAY,UAEdC,MAAO,CACLC,SAAU,OACVC,MAAOX,EAAMY,QAAQC,QAAQ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