@corva/ui 3.74.0-0 → 3.74.0-2

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 (412) 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/AssetEditor/AssetEditorAutocomplete.js +1 -1
  6. package/cjs-bundle/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
  7. package/cjs-bundle/components/AssetEditorV2/index.js +1 -1
  8. package/cjs-bundle/components/AssetEditorV2/index.js.map +1 -1
  9. package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js +2 -0
  10. package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js.map +1 -0
  11. package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.js +1 -1
  12. package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.js.map +1 -1
  13. package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.scss.js +1 -1
  14. package/cjs-bundle/components/AttachmentLightbox/AttachmentPreviewPane.js +2 -0
  15. package/cjs-bundle/components/AttachmentLightbox/AttachmentPreviewPane.js.map +1 -0
  16. package/cjs-bundle/components/AttachmentLightbox/copyImageToClipboard.js +2 -0
  17. package/cjs-bundle/components/AttachmentLightbox/copyImageToClipboard.js.map +1 -0
  18. package/cjs-bundle/components/AttachmentLightbox/downloadAttachment.js +2 -0
  19. package/cjs-bundle/components/AttachmentLightbox/downloadAttachment.js.map +1 -0
  20. package/cjs-bundle/components/AttachmentLightbox/useAttachmentLightbox.js +1 -1
  21. package/cjs-bundle/components/AttachmentLightbox/useAttachmentLightbox.js.map +1 -1
  22. package/cjs-bundle/components/AttachmentLightbox/useZoomPan.js +2 -0
  23. package/cjs-bundle/components/AttachmentLightbox/useZoomPan.js.map +1 -0
  24. package/cjs-bundle/components/AttachmentPreview/AttachmentActionsMenu.js +2 -0
  25. package/cjs-bundle/components/AttachmentPreview/AttachmentActionsMenu.js.map +1 -0
  26. package/cjs-bundle/components/AttachmentPreview/AttachmentDownloadLink.js +2 -0
  27. package/cjs-bundle/components/AttachmentPreview/AttachmentDownloadLink.js.map +1 -0
  28. package/cjs-bundle/components/AttachmentPreview/AttachmentImage.js +2 -0
  29. package/cjs-bundle/components/AttachmentPreview/AttachmentImage.js.map +1 -0
  30. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
  31. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
  32. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
  33. package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js +1 -1
  34. package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js.map +1 -1
  35. package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js +1 -1
  36. package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js.map +1 -1
  37. package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js +2 -0
  38. package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js.map +1 -0
  39. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +1 -1
  40. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
  41. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  42. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  43. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  44. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  45. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  46. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  47. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  48. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  49. package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
  50. package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
  51. package/cjs-bundle/components/CommentCard/CommentMenu.js +1 -1
  52. package/cjs-bundle/components/CommentCard/CommentMenu.js.map +1 -1
  53. package/cjs-bundle/components/CommentComposer/CommentComposer.js +1 -1
  54. package/cjs-bundle/components/CommentComposer/CommentComposer.js.map +1 -1
  55. package/cjs-bundle/components/CommentComposer/CommentReplyInput.js +1 -1
  56. package/cjs-bundle/components/CommentComposer/CommentReplyInput.js.map +1 -1
  57. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
  58. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  59. package/cjs-bundle/components/CommentInputNext/CommentInputNext.js +1 -1
  60. package/cjs-bundle/components/CommentInputNext/CommentInputNext.js.map +1 -1
  61. package/cjs-bundle/components/CommentInputNext/useFilePaste.js +2 -0
  62. package/cjs-bundle/components/CommentInputNext/useFilePaste.js.map +1 -0
  63. package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
  64. package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
  65. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  66. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  67. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  68. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  69. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  70. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  71. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  72. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  73. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  74. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  75. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  76. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  77. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  78. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  79. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  80. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  81. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  82. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  83. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  84. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  85. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  86. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  87. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  88. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  89. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  90. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  91. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  92. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  93. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  94. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  95. package/cjs-bundle/components/IconMenu/index.js +1 -1
  96. package/cjs-bundle/components/IconMenu/index.js.map +1 -1
  97. package/cjs-bundle/components/KeyboardDateTimePicker.js +1 -1
  98. package/cjs-bundle/components/KeyboardDateTimePicker.js.map +1 -1
  99. package/cjs-bundle/components/LinkedText/LinkedText.js +2 -0
  100. package/cjs-bundle/components/LinkedText/LinkedText.js.map +1 -0
  101. package/cjs-bundle/components/LinkedText/LinkedText.scss.js +2 -0
  102. package/cjs-bundle/components/LinkedText/LinkedText.scss.js.map +1 -0
  103. package/cjs-bundle/components/NewDocumentViewer/utils.js +1 -1
  104. package/cjs-bundle/components/NewDocumentViewer/utils.js.map +1 -1
  105. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  106. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  107. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  108. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  109. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  110. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  111. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  112. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  113. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  114. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  115. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  116. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  117. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  118. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  119. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  120. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  121. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  122. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  123. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  124. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  125. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  126. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  127. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  128. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  129. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  130. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  131. package/cjs-bundle/components/PostInput/PostInput.js +1 -1
  132. package/cjs-bundle/components/PostInput/PostInput.js.map +1 -1
  133. package/cjs-bundle/components/UserMention/constants.js +1 -1
  134. package/cjs-bundle/components/UserMention/constants.js.map +1 -1
  135. package/cjs-bundle/components/UserMention/index.js +1 -1
  136. package/cjs-bundle/components/UserMention/index.js.map +1 -1
  137. package/cjs-bundle/components/index.js +1 -1
  138. package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
  139. package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js.map +1 -1
  140. package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.scss.js +1 -1
  141. package/cjs-bundle/componentsV2/Modal/Modal.js +1 -1
  142. package/cjs-bundle/componentsV2/Modal/Modal.js.map +1 -1
  143. package/cjs-bundle/componentsV2/Modal/constants.js +2 -0
  144. package/cjs-bundle/componentsV2/Modal/constants.js.map +1 -0
  145. package/cjs-bundle/effects/useOutsideClick.js +1 -1
  146. package/cjs-bundle/effects/useOutsideClick.js.map +1 -1
  147. package/cjs-bundle/utils/fetchAttachment.js +2 -0
  148. package/cjs-bundle/utils/fetchAttachment.js.map +1 -0
  149. package/cjs-bundle/utils/links.js +2 -0
  150. package/cjs-bundle/utils/links.js.map +1 -0
  151. package/components/AddComment/Popover.js +1 -1
  152. package/components/AddComment/Popover.js.map +1 -1
  153. package/components/AddComment/components/Content.js +1 -1
  154. package/components/AddComment/components/Content.js.map +1 -1
  155. package/components/AssetEditor/AssetEditorAutocomplete.d.ts +96 -13
  156. package/components/AssetEditor/AssetEditorAutocomplete.d.ts.map +1 -1
  157. package/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
  158. package/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
  159. package/components/AssetEditorV2/index.d.ts +28 -12
  160. package/components/AssetEditorV2/index.d.ts.map +1 -1
  161. package/components/AssetEditorV2/index.js +1 -1
  162. package/components/AssetEditorV2/index.js.map +1 -1
  163. package/components/AttachmentLightbox/AttachmentDocument.d.ts +6 -0
  164. package/components/AttachmentLightbox/AttachmentDocument.d.ts.map +1 -0
  165. package/components/AttachmentLightbox/AttachmentDocument.js +2 -0
  166. package/components/AttachmentLightbox/AttachmentDocument.js.map +1 -0
  167. package/components/AttachmentLightbox/AttachmentLightbox.d.ts +9 -8
  168. package/components/AttachmentLightbox/AttachmentLightbox.d.ts.map +1 -1
  169. package/components/AttachmentLightbox/AttachmentLightbox.js +1 -1
  170. package/components/AttachmentLightbox/AttachmentLightbox.js.map +1 -1
  171. package/components/AttachmentLightbox/AttachmentLightbox.scss.js +1 -1
  172. package/components/AttachmentLightbox/AttachmentPreviewPane.d.ts +9 -0
  173. package/components/AttachmentLightbox/AttachmentPreviewPane.d.ts.map +1 -0
  174. package/components/AttachmentLightbox/AttachmentPreviewPane.js +2 -0
  175. package/components/AttachmentLightbox/AttachmentPreviewPane.js.map +1 -0
  176. package/components/AttachmentLightbox/__tests__/AttachmentDocument.test.d.ts +2 -0
  177. package/components/AttachmentLightbox/__tests__/AttachmentDocument.test.d.ts.map +1 -0
  178. package/components/AttachmentLightbox/__tests__/AttachmentLightbox.test.d.ts +2 -0
  179. package/components/AttachmentLightbox/__tests__/AttachmentLightbox.test.d.ts.map +1 -0
  180. package/components/AttachmentLightbox/__tests__/copyImageToClipboard.test.d.ts +2 -0
  181. package/components/AttachmentLightbox/__tests__/copyImageToClipboard.test.d.ts.map +1 -0
  182. package/components/AttachmentLightbox/__tests__/downloadAttachment.test.d.ts +2 -0
  183. package/components/AttachmentLightbox/__tests__/downloadAttachment.test.d.ts.map +1 -0
  184. package/components/AttachmentLightbox/__tests__/useZoomPan.test.d.ts +2 -0
  185. package/components/AttachmentLightbox/__tests__/useZoomPan.test.d.ts.map +1 -0
  186. package/components/AttachmentLightbox/copyImageToClipboard.d.ts +4 -0
  187. package/components/AttachmentLightbox/copyImageToClipboard.d.ts.map +1 -0
  188. package/components/AttachmentLightbox/copyImageToClipboard.js +2 -0
  189. package/components/AttachmentLightbox/copyImageToClipboard.js.map +1 -0
  190. package/components/AttachmentLightbox/downloadAttachment.d.ts +10 -0
  191. package/components/AttachmentLightbox/downloadAttachment.d.ts.map +1 -0
  192. package/components/AttachmentLightbox/downloadAttachment.js +2 -0
  193. package/components/AttachmentLightbox/downloadAttachment.js.map +1 -0
  194. package/components/AttachmentLightbox/useAttachmentLightbox.d.ts +6 -2
  195. package/components/AttachmentLightbox/useAttachmentLightbox.d.ts.map +1 -1
  196. package/components/AttachmentLightbox/useAttachmentLightbox.js +1 -1
  197. package/components/AttachmentLightbox/useAttachmentLightbox.js.map +1 -1
  198. package/components/AttachmentLightbox/useZoomPan.d.ts +29 -0
  199. package/components/AttachmentLightbox/useZoomPan.d.ts.map +1 -0
  200. package/components/AttachmentLightbox/useZoomPan.js +2 -0
  201. package/components/AttachmentLightbox/useZoomPan.js.map +1 -0
  202. package/components/AttachmentPreview/AttachmentActionsMenu.d.ts +16 -0
  203. package/components/AttachmentPreview/AttachmentActionsMenu.d.ts.map +1 -0
  204. package/components/AttachmentPreview/AttachmentActionsMenu.js +2 -0
  205. package/components/AttachmentPreview/AttachmentActionsMenu.js.map +1 -0
  206. package/components/AttachmentPreview/AttachmentDownloadLink.d.ts +11 -0
  207. package/components/AttachmentPreview/AttachmentDownloadLink.d.ts.map +1 -0
  208. package/components/AttachmentPreview/AttachmentDownloadLink.js +2 -0
  209. package/components/AttachmentPreview/AttachmentDownloadLink.js.map +1 -0
  210. package/components/AttachmentPreview/AttachmentImage.d.ts +12 -0
  211. package/components/AttachmentPreview/AttachmentImage.d.ts.map +1 -0
  212. package/components/AttachmentPreview/AttachmentImage.js +2 -0
  213. package/components/AttachmentPreview/AttachmentImage.js.map +1 -0
  214. package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
  215. package/components/AttachmentPreview/AttachmentPreview.js +1 -1
  216. package/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
  217. package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
  218. package/components/AttachmentPreview/AttachmentPreview.types.d.ts +7 -0
  219. package/components/AttachmentPreview/AttachmentPreview.types.d.ts.map +1 -1
  220. package/components/AttachmentPreview/AttachmentRow.d.ts +7 -3
  221. package/components/AttachmentPreview/AttachmentRow.d.ts.map +1 -1
  222. package/components/AttachmentPreview/AttachmentRow.js +1 -1
  223. package/components/AttachmentPreview/AttachmentRow.js.map +1 -1
  224. package/components/AttachmentPreview/AttachmentTile.d.ts +5 -1
  225. package/components/AttachmentPreview/AttachmentTile.d.ts.map +1 -1
  226. package/components/AttachmentPreview/AttachmentTile.js +1 -1
  227. package/components/AttachmentPreview/AttachmentTile.js.map +1 -1
  228. package/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.d.ts +2 -0
  229. package/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.d.ts.map +1 -0
  230. package/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.d.ts +2 -0
  231. package/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.d.ts.map +1 -0
  232. package/components/AttachmentPreview/__tests__/AttachmentImage.test.d.ts +2 -0
  233. package/components/AttachmentPreview/__tests__/AttachmentImage.test.d.ts.map +1 -0
  234. package/components/AttachmentPreview/__tests__/AttachmentTile.test.d.ts +2 -0
  235. package/components/AttachmentPreview/__tests__/AttachmentTile.test.d.ts.map +1 -0
  236. package/components/AttachmentPreview/__tests__/useStoredAttachments.test.d.ts +2 -0
  237. package/components/AttachmentPreview/__tests__/useStoredAttachments.test.d.ts.map +1 -0
  238. package/components/AttachmentPreview/useStoredAttachment.d.ts +8 -0
  239. package/components/AttachmentPreview/useStoredAttachment.d.ts.map +1 -1
  240. package/components/AttachmentPreview/useStoredAttachment.js +2 -0
  241. package/components/AttachmentPreview/useStoredAttachment.js.map +1 -0
  242. package/components/AttachmentPreview/useStoredAttachments.d.ts +1 -1
  243. package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -1
  244. package/components/AttachmentPreview/useStoredAttachments.js +1 -1
  245. package/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
  246. package/components/BICOffsetPickerDialog/index.js +1 -1
  247. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  248. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  249. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  250. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  251. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  252. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  253. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  254. package/components/CommentCard/CommentCard.d.ts.map +1 -1
  255. package/components/CommentCard/CommentCard.js +1 -1
  256. package/components/CommentCard/CommentCard.js.map +1 -1
  257. package/components/CommentCard/CommentCard.types.d.ts +2 -0
  258. package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
  259. package/components/CommentCard/CommentMenu.d.ts.map +1 -1
  260. package/components/CommentCard/CommentMenu.js +1 -1
  261. package/components/CommentCard/CommentMenu.js.map +1 -1
  262. package/components/CommentComposer/CommentComposer.d.ts.map +1 -1
  263. package/components/CommentComposer/CommentComposer.js +1 -1
  264. package/components/CommentComposer/CommentComposer.js.map +1 -1
  265. package/components/CommentComposer/CommentReplyInput.d.ts.map +1 -1
  266. package/components/CommentComposer/CommentReplyInput.js +1 -1
  267. package/components/CommentComposer/CommentReplyInput.js.map +1 -1
  268. package/components/CommentComposer/__tests__/useAttachmentUpload.linked.test.d.ts +2 -0
  269. package/components/CommentComposer/__tests__/useAttachmentUpload.linked.test.d.ts.map +1 -0
  270. package/components/CommentComposer/useAttachmentUpload.d.ts +1 -0
  271. package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
  272. package/components/CommentComposer/useAttachmentUpload.js +1 -1
  273. package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  274. package/components/CommentInputNext/CommentInputNext.d.ts +2 -0
  275. package/components/CommentInputNext/CommentInputNext.d.ts.map +1 -1
  276. package/components/CommentInputNext/CommentInputNext.js +1 -1
  277. package/components/CommentInputNext/CommentInputNext.js.map +1 -1
  278. package/components/CommentInputNext/__tests__/useFilePaste.test.d.ts +2 -0
  279. package/components/CommentInputNext/__tests__/useFilePaste.test.d.ts.map +1 -0
  280. package/components/CommentInputNext/useFilePaste.d.ts +17 -0
  281. package/components/CommentInputNext/useFilePaste.d.ts.map +1 -0
  282. package/components/CommentInputNext/useFilePaste.js +2 -0
  283. package/components/CommentInputNext/useFilePaste.js.map +1 -0
  284. package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts +5 -1
  285. package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts.map +1 -1
  286. package/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
  287. package/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
  288. package/components/DocumentViewer/DocumentViewer.js +1 -1
  289. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  290. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  291. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  292. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  293. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  294. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  295. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  296. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  297. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  298. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  299. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  300. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  301. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  302. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  303. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  304. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  305. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  306. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  307. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  308. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  309. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  310. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  311. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  312. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  313. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  314. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  315. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  316. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  317. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  318. package/components/IconMenu/index.d.ts +67 -21
  319. package/components/IconMenu/index.d.ts.map +1 -1
  320. package/components/IconMenu/index.js +1 -1
  321. package/components/IconMenu/index.js.map +1 -1
  322. package/components/KeyboardDateTimePicker.d.ts +6 -7
  323. package/components/KeyboardDateTimePicker.d.ts.map +1 -1
  324. package/components/KeyboardDateTimePicker.js +1 -1
  325. package/components/KeyboardDateTimePicker.js.map +1 -1
  326. package/components/LinkedText/LinkedText.d.ts +17 -0
  327. package/components/LinkedText/LinkedText.d.ts.map +1 -0
  328. package/components/LinkedText/LinkedText.js +2 -0
  329. package/components/LinkedText/LinkedText.js.map +1 -0
  330. package/components/LinkedText/LinkedText.scss.js +2 -0
  331. package/components/LinkedText/LinkedText.scss.js.map +1 -0
  332. package/components/LinkedText/__tests__/LinkedText.test.d.ts +2 -0
  333. package/components/LinkedText/__tests__/LinkedText.test.d.ts.map +1 -0
  334. package/components/LinkedText/index.d.ts +2 -0
  335. package/components/LinkedText/index.d.ts.map +1 -0
  336. package/components/NewDocumentViewer/utils.d.ts.map +1 -1
  337. package/components/NewDocumentViewer/utils.js +1 -1
  338. package/components/NewDocumentViewer/utils.js.map +1 -1
  339. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  340. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  341. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  342. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  343. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  344. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  345. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  346. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  347. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  348. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  349. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  350. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  351. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  352. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  353. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  354. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  355. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  356. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  357. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  358. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  359. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  360. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  361. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  362. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  363. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  364. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  365. package/components/PostInput/PostInput.d.ts +20 -10
  366. package/components/PostInput/PostInput.d.ts.map +1 -1
  367. package/components/PostInput/PostInput.js +1 -1
  368. package/components/PostInput/PostInput.js.map +1 -1
  369. package/components/UserMention/__tests__/highlightLinks.test.d.ts +2 -0
  370. package/components/UserMention/__tests__/highlightLinks.test.d.ts.map +1 -0
  371. package/components/UserMention/constants.d.ts +1 -0
  372. package/components/UserMention/constants.d.ts.map +1 -1
  373. package/components/UserMention/constants.js +1 -1
  374. package/components/UserMention/constants.js.map +1 -1
  375. package/components/UserMention/index.js +1 -1
  376. package/components/UserMention/index.js.map +1 -1
  377. package/components/index.d.ts +2 -0
  378. package/components/index.d.ts.map +1 -1
  379. package/components/index.js +1 -1
  380. package/componentsV2/ButtonIcon/ButtonIcon.d.ts +2 -0
  381. package/componentsV2/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  382. package/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
  383. package/componentsV2/ButtonIcon/ButtonIcon.js.map +1 -1
  384. package/componentsV2/ButtonIcon/ButtonIcon.scss.js +1 -1
  385. package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts +1 -0
  386. package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts.map +1 -1
  387. package/componentsV2/Modal/Modal.d.ts.map +1 -1
  388. package/componentsV2/Modal/Modal.js +1 -1
  389. package/componentsV2/Modal/Modal.js.map +1 -1
  390. package/componentsV2/Modal/constants.d.ts +3 -0
  391. package/componentsV2/Modal/constants.d.ts.map +1 -0
  392. package/componentsV2/Modal/constants.js +2 -0
  393. package/componentsV2/Modal/constants.js.map +1 -0
  394. package/effects/__tests__/useOutsideClick.test.d.ts.map +1 -1
  395. package/effects/useOutsideClick.d.ts.map +1 -1
  396. package/effects/useOutsideClick.js +1 -1
  397. package/effects/useOutsideClick.js.map +1 -1
  398. package/mcp-server/server.mjs +35 -9
  399. package/package.json +1 -1
  400. package/tsconfig.tsbuildinfo +1 -1
  401. package/utils/__tests__/fetchAttachment.test.d.ts +2 -0
  402. package/utils/__tests__/fetchAttachment.test.d.ts.map +1 -0
  403. package/utils/__tests__/links.test.d.ts +2 -0
  404. package/utils/__tests__/links.test.d.ts.map +1 -0
  405. package/utils/fetchAttachment.d.ts +3 -0
  406. package/utils/fetchAttachment.d.ts.map +1 -0
  407. package/utils/fetchAttachment.js +2 -0
  408. package/utils/fetchAttachment.js.map +1 -0
  409. package/utils/links.d.ts +14 -0
  410. package/utils/links.d.ts.map +1 -0
  411. package/utils/links.js +2 -0
  412. package/utils/links.js.map +1 -0
@@ -2,6 +2,14 @@ import type { AttachmentPreviewItem } from './AttachmentPreview.types';
2
2
  export type StoredAttachment = {
3
3
  name: string;
4
4
  url: string;
5
+ /** Bytes, as recorded at upload time. */
6
+ size?: number;
5
7
  };
8
+ /**
9
+ * One of ours is stored under an S3 key, which is a path. An attachment that was linked rather
10
+ * than uploaded keeps a bare file name and a url that already works, so signing it would only
11
+ * produce a link to an object that was never there.
12
+ */
13
+ export declare const getIsStoredKey: (name: string) => boolean;
6
14
  export declare const useStoredAttachment: (attachment?: StoredAttachment | null) => AttachmentPreviewItem | null;
7
15
  //# sourceMappingURL=useStoredAttachment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStoredAttachment.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/useStoredAttachment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,mBAAmB,gBACjB,gBAAgB,GAAG,IAAI,KACnC,qBAAqB,GAAG,IAe1B,CAAC"}
1
+ {"version":3,"file":"useStoredAttachment.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/useStoredAttachment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,OAA6B,CAAC;AAE5E,eAAO,MAAM,mBAAmB,gBACjB,gBAAgB,GAAG,IAAI,KACnC,qBAAqB,GAAG,IAkB1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"@babel/runtime/helpers/slicedToArray";import"react";import"../../clients/jsonApi/index.js";import"file-extension";import"image-extensions";import"video-extensions";var e=function(e){return e.includes("/")};export{e as getIsStoredKey};
2
+ //# sourceMappingURL=useStoredAttachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStoredAttachment.js","sources":["../../../src/components/AttachmentPreview/useStoredAttachment.ts"],"sourcesContent":["import useSignedURL from '../../effects/useSignedURL';\n\nimport type { AttachmentPreviewItem } from './AttachmentPreview.types';\nimport { getAttachmentKind } from './getAttachmentKind';\n\nexport type StoredAttachment = {\n name: string;\n url: string;\n /** Bytes, as recorded at upload time. */\n size?: number;\n};\n\n/**\n * One of ours is stored under an S3 key, which is a path. An attachment that was linked rather\n * than uploaded keeps a bare file name and a url that already works, so signing it would only\n * produce a link to an object that was never there.\n */\nexport const getIsStoredKey = (name: string): boolean => name.includes('/');\n\nexport const useStoredAttachment = (\n attachment?: StoredAttachment | null\n): AttachmentPreviewItem | null => {\n const kind = attachment ? getAttachmentKind(attachment) : undefined;\n const key = attachment && getIsStoredKey(attachment.name) ? attachment.name : '';\n const signed = useSignedURL(key, 'inline');\n // `download` is ignored cross-origin, so only an attachment-disposition link saves.\n const downloadUrl = useSignedURL(key, 'attachment');\n const src = key ? signed : attachment?.url;\n\n if (!attachment || !src) return null;\n\n return {\n id: attachment.url,\n name: attachment.name,\n src,\n kind,\n size: attachment.size,\n downloadUrl: downloadUrl || undefined,\n };\n};\n"],"names":["getIsStoredKey","name","includes"],"mappings":"+KAiBaA,EAAiB,SAACC,GAAY,OAAcA,EAAKC,SAAS,IAAI"}
@@ -1,5 +1,5 @@
1
1
  import type { AttachmentPreviewItem } from './AttachmentPreview.types';
2
- import type { StoredAttachment } from './useStoredAttachment';
2
+ import { type StoredAttachment } from './useStoredAttachment';
3
3
  /**
4
4
  * Signs a whole list of stored attachments — the hook-per-file `useStoredAttachment`
5
5
  * can't cover a list whose length changes between renders.
@@ -1 +1 @@
1
- {"version":3,"file":"useStoredAttachments.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/useStoredAttachments.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA2B9D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,iBACjB,gBAAgB,EAAE,GAAG,IAAI,KACtC,qBAAqB,EAuCvB,CAAC"}
1
+ {"version":3,"file":"useStoredAttachments.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/useStoredAttachments.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAkB9E;;;GAGG;AACH,eAAO,MAAM,oBAAoB,iBACjB,gBAAgB,EAAE,GAAG,IAAI,KACtC,qBAAqB,EA6DvB,CAAC"}
@@ -1,2 +1,2 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import{useState as o,useRef as c,useMemo as a,useEffect as u}from"react";import{getAttachmentKind as i}from"./getAttachmentKind.js";import{getS3DownloadLink as s}from"../../clients/jsonApi/index.js";function p(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var l=function(){var r=t(n.mark((function r(e,t){var o,c;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,s(e,t);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,t){return r.apply(this,arguments)}}(),m=function(){var r=t(n.mark((function r(e,t){var o,c;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l(e,"inline");case 2:if(o=r.sent,"file"!==t){r.next=9;break}return r.next=6,l(e,"attachment");case 6:r.t0=r.sent,r.next=10;break;case 9:r.t0="";case 10:return c=r.t0,r.abrupt("return",[e,{src:o,downloadUrl:c}]);case 12:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),b=function(r){var t=o({}),n=e(t,2),s=n[0],p=n[1],l=c(s);l.current=s;var b=a((function(){return null!=r?r:[]}),[r]),d=b.map((function(r){return r.name})).join("|");return u((function(){var r=b.filter((function(r){return!(r.name in l.current)}));if(r.length){var e=!0;return Promise.all(r.map((function(r){return m(r.name,i(r))}))).then((function(r){e&&p((function(e){return f(f({},e),Object.fromEntries(r))}))})),function(){e=!1}}}),[d]),b.reduce((function(r,e){var t=s[e.name];return null!=t&&t.src?(r.push({id:e.url,name:e.name,src:t.src,kind:i(e),downloadUrl:t.downloadUrl||void 0}),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 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};
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 type { StoredAttachment } from './useStoredAttachment';\n\nimport { getS3DownloadLink } from '~/clients/jsonApi';\n\ntype SignedLinks = Record<string, { src: string; downloadUrl: 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\nconst sign = async (name: string, kind: string) => {\n const src = await getSignedLink(name, 'inline');\n\n // Only documents get a download action; images and videos skip the extra round trip.\n const downloadUrl = kind === 'file' ? await getSignedLink(name, 'attachment') : '';\n\n return [name, { src, downloadUrl }] as const;\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 Promise.all(\n pending.map(attachment => sign(attachment.name, getAttachmentKind(attachment)))\n ).then(resolved => {\n if (isActive) setLinks(prev => ({ ...prev, ...Object.fromEntries(resolved) }));\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 downloadUrl: link.downloadUrl || undefined,\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","sign","_ref2","_callee2","kind","src","downloadUrl","_context2","_x3","_x4","useStoredAttachments","attachments","_useState","useState","_useState2","_slicedToArray","links","setLinks","linksRef","useRef","current","list","useMemo","key","map","attachment","join","useEffect","pending","filter","length","isActive","Promise","all","getAttachmentKind","then","resolved","_objectSpread","Object","fromEntries","reduce","acc","link","push","id","undefined"],"mappings":"g9BAUA,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,EAEkD,OAFlDE,EAAAC,KAAA,EAAAD,EAAAM,GAAAN,EAAA,MAAA,GAEVO,QAAQC,MAAoCb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AAMF,EAAKG,KAAI,SAAAC,GAAU,OAAIA,EAAW5C,IAAI,IAAE6C,KAAK,KAoBzD,OAlBAC,GAAU,WACR,IAAMC,EAAUP,EAAKQ,QAAO,SAAAJ,GAAU,QAAMA,EAAW5C,QAAQqC,EAASE,YACxE,GAAKQ,EAAQE,OAAb,CAEA,IAAIC,GAAW,EAOf,OANAC,QAAQC,IACNL,EAAQJ,KAAI,SAAAC,GAAU,OAAIxB,EAAKwB,EAAW5C,KAAMqD,EAAkBT,GAAY,KAC9EU,MAAK,SAAAC,GACDL,GAAUd,GAAS,SAAA9B,GAAI,OAAAkD,EAAAA,EAAA,GAAUlD,GAASmD,OAAOC,YAAYH,GAAS,GAC5E,IAEO,WACLL,GAAW,EAVwB,CAcvC,GAAG,CAACR,IAEGF,EAAKmB,QAAgC,SAACC,EAAKhB,GAChD,IAAMiB,EAAO1B,EAAMS,EAAW5C,MAC9B,OAAK6D,SAAAA,EAAMrC,KAEXoC,EAAIE,KAAK,CACPC,GAAInB,EAAWzC,IACfH,KAAM4C,EAAW5C,KACjBwB,IAAKqC,EAAKrC,IACVD,KAAM8B,EAAkBT,GACxBnB,YAAaoC,EAAKpC,kBAAeuC,IAE5BJ,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 { 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,EAEkD,OAFlDE,EAAAC,KAAA,EAAAD,EAAAM,GAAAN,EAAA,MAAA,GAEVO,QAAQC,MAAoCb,8BAAAA,OAAAA,EAAe,KAAAK,EAAAM,IAACN,EAAAK,OAAA,SAErD,IAAE,KAAA,GAAA,IAAA,MAAA,OAAAL,EAAAS,OAAA,GAAAf,EAAA,KAAA,CAAA,CAAA,EAAA,IAEZ,KAAA,OAAA,SAVkBgB,EAAAC,GAAA,OAAArB,EAAAsB,MAAAC,KAAAC,UAAA,CAAA,CAAA,GAgBNC,EAAuB,SAClCC,GAEA,IAAAC,EAA0BC,EAAsB,IAAGC,EAAAC,EAAAH,EAAA,GAA5CI,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAChBI,EAAWC,EAAOH,GACxBE,EAASE,QAAUJ,EAEnB,IAAMK,EAAOC,GAAQ,WAAA,OAAMX,QAAAA,EAAe,KAAI,CAACA,IACzCY,EAAMF,EAAKG,KAAI,SAAAC,GAAU,OAAIA,EAAWnC,IAAI,IAAEoC,KAAK,KA0CzD,OAxCAC,GAAU,WACR,IAAMC,EAAUP,EAAKQ,QAAO,SAAAJ,GAAU,QAAMA,EAAWnC,QAAQ4B,EAASE,YACxE,GAAKQ,EAAQE,OAAb,CAEA,IAAIC,GAAW,EAETC,EAAY,SAAC1C,EAAc2C,GAA0B,OACzDhB,GAAS,SAAArB,GAAI,OAAUA,EAAAA,EAAAA,CAAAA,EAAAA,WAAON,EAAI4C,EAAAA,EAAA,CAAA,EAAQtC,EAAKN,IAAU2C,IAAK,GAAM,EA0BtE,OAvBAhB,GAAS,SAAArB,GACP,IAAMuC,EAAevC,EAAAA,CAAAA,EAAAA,GAMrB,OAJAgC,EAAQQ,SAAQ,SAAAX,GAAc,IAAAY,EAC5BF,EAAQV,EAAWnC,MAAgC,QAAxB6C,EAAAA,EAAQV,EAAWnC,aAAK,IAAA+C,EAAAA,EAAI,CAAA,CACzD,IAEOF,CACT,IAEAP,EAAQQ,SAAQ,SAAAX,GAETa,EAAeb,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,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 g,DialogContent as h,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 D from"./components/WellSection/index.js";import{useWells as F,useFetchBicWellsData as x}from"./effects/index.js";import{DEFAULT_WELL_SECTIONS as P}from"./constants.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/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 B,jsx as k}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/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"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Cell.js";import"../../componentsV2/Header/Header.scss.js";import"../../componentsV2/Button/Button.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../componentsV2/Tooltip/Tooltip.scss.js";import"../../componentsV2/Popover/Popover.js";import"../../componentsV2/PopoverPanel/PopoverPanel.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/TextInputNext/TextInputNext.js";import"../../componentsV2/Label/Label.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/TextLink/TextLink.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/ChipIndicator/ChipIndicator.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/ModalWindow/ModalWindow.js";import"../../componentsV2/Modal/Modal.scss.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/utils.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"../../clients/jsonApi/index.js";import"../../permissions/PermissionsContext.js";import"../../permissions/constants/index.js";import"../../permissions/withPermissionsHOC.js";import"../../permissions/ProvidePermissions.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/EmptyState/EmptyState.scss.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/Accordion/Accordion.scss.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/AppFooter/AppFooter.js";import"immutable";import"../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.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/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"moment";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.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"../../utils/getSingleAsset.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.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/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"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.scss.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.scss.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../Toaster/Toaster.js";import"../HelpCenter/HelpCenterIcon.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"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.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"../EmptyState/EmptyState.js";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"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.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"@material-ui/icons/AddCircle";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.styles.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"../DisabledSettingsMessage/DisabledSettingsMessage.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 w 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"../ConfirmationDialog.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"@material-ui/icons/ArrowDropDown";import"@material-ui/icons/Search";import"../CommentComposer/ChatChannelSelector.scss.js";import"../CommentComposer/ShareToChatRow.scss.js";import"../CommentComposer/CommentComposer.scss.js";import"../AttachmentPreview/AttachmentPreview.js";import"../AttachmentPreview/AttachmentPreview.scss.js";import"../CommentPin/CommentPin.js";import"../FeedCard/FeedCard.js";import"../FeedItemCard/FeedItemCard.js";import"../NewCommentCursor/NewCommentCursor.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 O(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 E(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?O(Object(o),!0).forEach((function(t){s(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):O(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 N(e,t){return"well"===e.value?"Best Wells":"area"===e.value?"Area Offsets":"Best ".concat(e.value,"section"===t?" Wells":' " Wells')}function R(e){return e.map((function(e){return E(E({},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,O=s.offsetSetting,q=void 0===O?z:O,_=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=x(ue,X),fe=n([]),Se=o(fe,2),ge=Se[0],he=Se[1],Ve=n(!1),ve=o(Ve,2),be=ve[0],Te=ve[1],De=n(q),Fe=o(De,2),xe=Fe[0],Pe=Fe[1],ye=n(!1),Be=o(ye,2),ke=Be[0],We=Be[1],we=r((function(){if(Ie){var e=G(xe);return Ie.filter((function(t){return e.find((function(e){return e===a(t,"id")}))}))}return[]}),[Ie,xe]);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(xe,"selectedWellIds")||[],n=a(xe,"manualWellIds")||[],i=a(xe,"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:ke}].concat(t(C.map((function(t){var o;return{name:N(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:ke}].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)?E(E({},e),{},{checked:!0}):E({},e)}));return E(E({},e),{},{wells:t})}));he(R(I))}}),[X,Ie,Ae,xe]);var Oe=m((function(){return G(xe).length}),[xe]),Ee=m((function(){return(a(xe,"bicWellIds")||[]).length}),[]),Le=i(null),Me=!Ie;return y(B,{children:[y(I,{onBackdropClick:J,onEscapeKeyDown:J,open:X,classes:{paper:ie.paper},children:[k(A,{children:y("div",{className:ie.dialogTitles,children:[y("div",{className:ie.titleContent,children:[k(f,{className:ie.title,children:"Select Offset Wells"}),k(S,{title:"Close",children:k(g,{"data-not-migrated-muiiconbutton":!0,"aria-label":"close",className:ie.closeIconButton,onClick:J,children:k(b,{className:ie.closeIcon})})})]}),k("div",{className:ie.description,children:"Quickly add all of the Best-In-Class Wells per section selected from the Offsets Well Selection Application."})]})}),se&&k("div",{className:ie.topShadow}),k(h,{className:ie.dialogContent,ref:re,onScroll:function(){ne(!0),clearTimeout(Le.current),Le.current=setTimeout((function(){ne(!1)}),1e3)},children:Me?k(W,{fullscreen:!1}):y(B,{children:[k(T,{wells:we,offsetWells:we}),k(D,{company:ae,wellSections:ge,getWellName:M,onChangeWellSections:function(e){var t=R(e);he(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=E(E({},xe),{},{selectedWellIds:l(o),manualWellIds:l(s),bicWellIds:l(n),resultWellIds:l(i)});Pe(r),pe.current=!1},onExploreMode:function(){Te(!0)}})]})}),k("div",{className:ie.bottomShadow}),k(V,{className:u(ie.dialogActions),children:y("div",{className:ie.buttonContainer,children:[k(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(xe),t=Ie.filter((function(t){return d(e,t.id)})),o=E(E({},xe),{},{companyId:+ae,resultWellIds:e});Te(!1),Q(o,t)},children:["Add (",Oe(),")"]})]})})]}),be&&k(w,{defaultSubjectWellId:a(C,"asset_id"),companyId:+ae,offsetSetting:xe,currentUser:K,addWellsUsabilityInfo:$,unusableWellAlarm:ee,isAdvancedSearch:!0,bestCount:Ee(),isOpen:be,onClose:function(){Te(!1)},onSave:function(e){var t=e;C||(j(ue,a(t,"subjectWellId"))&&j(ae,a(t,"companyId"))||(t=E(E({},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=E(E({},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 g,DialogContent as h,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 D from"./components/WellSection/index.js";import{useWells as F,useFetchBicWellsData as x}from"./effects/index.js";import{DEFAULT_WELL_SECTIONS as P}from"./constants.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/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 B,jsx as k}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/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"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Cell.js";import"../../componentsV2/Header/Header.scss.js";import"../../componentsV2/Button/Button.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../componentsV2/Tooltip/Tooltip.scss.js";import"../../componentsV2/Popover/Popover.js";import"../../componentsV2/PopoverPanel/PopoverPanel.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/TextInputNext/TextInputNext.js";import"../../componentsV2/Label/Label.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/TextLink/TextLink.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/ChipIndicator/ChipIndicator.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/ModalWindow/ModalWindow.js";import"../../componentsV2/Modal/Modal.scss.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/utils.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"../../clients/jsonApi/index.js";import"../../permissions/PermissionsContext.js";import"../../permissions/constants/index.js";import"../../permissions/withPermissionsHOC.js";import"../../permissions/ProvidePermissions.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/EmptyState/EmptyState.scss.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/Accordion/Accordion.scss.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/AppFooter/AppFooter.js";import"immutable";import"../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.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/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"moment";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.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"../../utils/getSingleAsset.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.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/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"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.scss.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.scss.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../Toaster/Toaster.js";import"../HelpCenter/HelpCenterIcon.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"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.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"../EmptyState/EmptyState.js";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"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.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"@material-ui/icons/AddCircle";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.styles.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"../DisabledSettingsMessage/DisabledSettingsMessage.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 w 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"../ConfirmationDialog.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"@material-ui/icons/ArrowDropDown";import"@material-ui/icons/Search";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 O(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 E(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?O(Object(o),!0).forEach((function(t){s(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):O(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 N(e,t){return"well"===e.value?"Best Wells":"area"===e.value?"Area Offsets":"Best ".concat(e.value,"section"===t?" Wells":' " Wells')}function R(e){return e.map((function(e){return E(E({},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,O=s.offsetSetting,q=void 0===O?z:O,_=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=x(ue,X),fe=n([]),Se=o(fe,2),ge=Se[0],he=Se[1],ve=n(!1),Ve=o(ve,2),be=Ve[0],Te=Ve[1],De=n(q),Fe=o(De,2),xe=Fe[0],Pe=Fe[1],ye=n(!1),Be=o(ye,2),ke=Be[0],We=Be[1],we=r((function(){if(Ie){var e=G(xe);return Ie.filter((function(t){return e.find((function(e){return e===a(t,"id")}))}))}return[]}),[Ie,xe]);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(xe,"selectedWellIds")||[],n=a(xe,"manualWellIds")||[],i=a(xe,"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:ke}].concat(t(C.map((function(t){var o;return{name:N(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:ke}].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)?E(E({},e),{},{checked:!0}):E({},e)}));return E(E({},e),{},{wells:t})}));he(R(I))}}),[X,Ie,Ae,xe]);var Oe=m((function(){return G(xe).length}),[xe]),Ee=m((function(){return(a(xe,"bicWellIds")||[]).length}),[]),Le=i(null),Me=!Ie;return y(B,{children:[y(I,{onBackdropClick:J,onEscapeKeyDown:J,open:X,classes:{paper:ie.paper},children:[k(A,{children:y("div",{className:ie.dialogTitles,children:[y("div",{className:ie.titleContent,children:[k(f,{className:ie.title,children:"Select Offset Wells"}),k(S,{title:"Close",children:k(g,{"data-not-migrated-muiiconbutton":!0,"aria-label":"close",className:ie.closeIconButton,onClick:J,children:k(b,{className:ie.closeIcon})})})]}),k("div",{className:ie.description,children:"Quickly add all of the Best-In-Class Wells per section selected from the Offsets Well Selection Application."})]})}),se&&k("div",{className:ie.topShadow}),k(h,{className:ie.dialogContent,ref:re,onScroll:function(){ne(!0),clearTimeout(Le.current),Le.current=setTimeout((function(){ne(!1)}),1e3)},children:Me?k(W,{fullscreen:!1}):y(B,{children:[k(T,{wells:we,offsetWells:we}),k(D,{company:ae,wellSections:ge,getWellName:M,onChangeWellSections:function(e){var t=R(e);he(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=E(E({},xe),{},{selectedWellIds:l(o),manualWellIds:l(s),bicWellIds:l(n),resultWellIds:l(i)});Pe(r),pe.current=!1},onExploreMode:function(){Te(!0)}})]})}),k("div",{className:ie.bottomShadow}),k(v,{className:u(ie.dialogActions),children:y("div",{className:ie.buttonContainer,children:[k(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(xe),t=Ie.filter((function(t){return d(e,t.id)})),o=E(E({},xe),{},{companyId:+ae,resultWellIds:e});Te(!1),Q(o,t)},children:["Add (",Oe(),")"]})]})})]}),be&&k(w,{defaultSubjectWellId:a(C,"asset_id"),companyId:+ae,offsetSetting:xe,currentUser:K,addWellsUsabilityInfo:$,unusableWellAlarm:ee,isAdvancedSearch:!0,bestCount:Ee(),isOpen:be,onClose:function(){Te(!1)},onSave:function(e){var t=e;C||(j(ue,a(t,"subjectWellId"))&&j(ae,a(t,"companyId"))||(t=E(E({},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=E(E({},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":"+62BAwBA,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,QAAQC,OAE/BC,YAAa,CACXL,SAAU,OACVM,WAAY,SACZL,MAAOX,EAAMY,QAAQC,QAAQI,MAC7BC,UAAW,IAEbC,gBAAiB,CACfT,SAAU,OACVU,QAAS,EACT,qBAAsB,CACpBT,MAAO,SAGXU,UAAW,CACTV,MAAOX,EAAMY,QAAQC,QAAQI,OAE/BK,UAAW,CACTpB,MAAO,OACPqB,OAAQ,OACRC,gBAAe,iDAAAC,OAAmDzB,EAAMY,QAAQc,WAAWC,GAAK,KAChGC,SAAU,WACVC,IAAK,QACLC,OAAQ,GAEVC,aAAc,CACZ7B,MAAO,OACPqB,OAAQ,OACRC,gBAAe,mDAAAC,OAAqDzB,EAAMY,QAAQc,WAAWC,GAAK,KAClGC,SAAU,WACVI,OAAQ,OACRF,OAAQ,GAEVG,cAAe,CACb7B,QAAS,OACTG,eAAgB,WAChB2B,WAAY,EACZC,cAAe,GAEjBC,y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yJjBjC,OAtJuB,SAAA2G,GAC7B,IAAIW,EAAiBX,EAChBnH,IAEA+H,EAAQlG,GAAerD,EAAIsJ,EAAgB,mBAC3CC,EAAQtG,GAAWjD,EAAIsJ,EAAgB,gBAExCA,SACKA,GAAc,CAAA,EAAA,CACjBrI,WAAY,GACZC,cAAe,GACf0D,cAAe,MAGnBtB,GAAiBtD,EAAIsJ,EAAgB,kBACrCpG,GAAalD,EAAIsJ,EAAgB,eAGnC,IAAIpI,EAAgBlB,EAAIsJ,EAAgB,kBAAoB,GACtDnI,EAAkBnB,EAAIsJ,EAAgB,oBAAsB,GAClEpI,EAAgBA,EAAc2D,QAAO,SAAA9E,GAAE,OAAKoB,EAAgBmE,SAASvF,MACrEuJ,SACKA,GAAc,CAAA,EAAA,CACjBpI,cAAAA,IAEFmD,GAAwBiF,GACxBxG,GAAWiC,SAAU,EACrBN,IAAwB,GACxBR,IAAuB,QA+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":"mg3BAwBA,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,QAAQC,OAE/BC,YAAa,CACXL,SAAU,OACVM,WAAY,SACZL,MAAOX,EAAMY,QAAQC,QAAQI,MAC7BC,UAAW,IAEbC,gBAAiB,CACfT,SAAU,OACVU,QAAS,EACT,qBAAsB,CACpBT,MAAO,SAGXU,UAAW,CACTV,MAAOX,EAAMY,QAAQC,QAAQI,OAE/BK,UAAW,CACTpB,MAAO,OACPqB,OAAQ,OACRC,gBAAe,iDAAAC,OAAmDzB,EAAMY,QAAQc,WAAWC,GAAK,KAChGC,SAAU,WACVC,IAAK,QACLC,OAAQ,GAEVC,aAAc,CACZ7B,MAAO,OACPqB,OAAQ,OACRC,gBAAe,mDAAAC,OAAqDzB,EAAMY,QAAQc,WAAWC,GAAK,KAClGC,SAAU,WACVI,OAAQ,OACRF,OAAQ,GAEVG,cAAe,CACb7B,QAAS,OACTG,eAAgB,WAChB2B,WAAY,EACZC,cAAe,GAEjBC,yBAA0B,CACxBC,aAAc,SAEhBC,cAAe,CACblC,QAAS,OACTC,cAAe,SACfkC,UAAW,UAEbC,gBAAiB,CACfpC,QAAS,O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