@corva/ui 3.77.0-2 → 3.77.0-20

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 (845) hide show
  1. package/MCP_README.md +9 -6
  2. package/README.md +8 -2
  3. package/cjs-bundle/clients/jsonApi/index.js +1 -1
  4. package/cjs-bundle/clients/jsonApi/index.js.map +1 -1
  5. package/cjs-bundle/components/AddComment/Popover.js +1 -1
  6. package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
  7. package/cjs-bundle/components/AddComment/components/Content.js +1 -1
  8. package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
  9. package/cjs-bundle/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js +1 -1
  10. package/cjs-bundle/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js.map +1 -1
  11. package/cjs-bundle/components/Annotations/components/AnnotationsList/index.js +1 -1
  12. package/cjs-bundle/components/Annotations/components/AnnotationsList/index.js.map +1 -1
  13. package/cjs-bundle/components/AssetEditorV2/components/MultipleAssetsToggle.js.map +1 -1
  14. package/cjs-bundle/components/AssetEditorV2/components/PrimaryAssetSelect.js +1 -1
  15. package/cjs-bundle/components/AssetEditorV2/components/PrimaryAssetSelect.js.map +1 -1
  16. package/cjs-bundle/components/AssetEditorV2/components/PrimaryAssetSelectV2.js +1 -1
  17. package/cjs-bundle/components/AssetEditorV2/components/PrimaryAssetSelectV2.js.map +1 -1
  18. package/cjs-bundle/components/AssetEditorV2/components/SecondaryAssetSelect.js +1 -1
  19. package/cjs-bundle/components/AssetEditorV2/components/SecondaryAssetSelect.js.map +1 -1
  20. package/cjs-bundle/components/AssetEditorV2/components/SelectItem.js +1 -1
  21. package/cjs-bundle/components/AssetEditorV2/components/SelectItem.js.map +1 -1
  22. package/cjs-bundle/components/AssetEditorV2/constants.js.map +1 -1
  23. package/cjs-bundle/components/AssetEditorV2/effects/assetResponse.js +2 -0
  24. package/cjs-bundle/components/AssetEditorV2/effects/assetResponse.js.map +1 -0
  25. package/cjs-bundle/components/AssetEditorV2/effects/index.js +1 -1
  26. package/cjs-bundle/components/AssetEditorV2/effects/index.js.map +1 -1
  27. package/cjs-bundle/components/AssetEditorV2/effects/usePrimaryAssetSelectData.js +1 -1
  28. package/cjs-bundle/components/AssetEditorV2/effects/usePrimaryAssetSelectData.js.map +1 -1
  29. package/cjs-bundle/components/AssetEditorV2/index.js +1 -1
  30. package/cjs-bundle/components/AssetEditorV2/index.js.map +1 -1
  31. package/cjs-bundle/components/AssetEditorV2/utils/index.js +1 -1
  32. package/cjs-bundle/components/AssetEditorV2/utils/index.js.map +1 -1
  33. package/cjs-bundle/components/AssetsMultipleSelector/AssetsMultipleSelector.js +1 -1
  34. package/cjs-bundle/components/AssetsMultipleSelector/AssetsMultipleSelector.js.map +1 -1
  35. package/cjs-bundle/components/Attachment/index.js +1 -1
  36. package/cjs-bundle/components/Attachment/index.js.map +1 -1
  37. package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js +1 -1
  38. package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js.map +1 -1
  39. package/cjs-bundle/components/BICOffsetPickerDialog/components/Map/Map.js +1 -1
  40. package/cjs-bundle/components/BICOffsetPickerDialog/components/Map/Map.js.map +1 -1
  41. package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
  42. package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/index.js.map +1 -1
  43. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  44. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  45. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  46. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  47. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  48. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  49. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  50. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  51. package/cjs-bundle/components/CollapsableSidebar.js +1 -1
  52. package/cjs-bundle/components/CollapsableSidebar.js.map +1 -1
  53. package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
  54. package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
  55. package/cjs-bundle/components/CommentCard/CommentCard.scss.js +1 -1
  56. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
  57. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  58. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
  59. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/utils.js.map +1 -1
  60. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  61. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  62. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
  63. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
  64. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
  65. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js.map +1 -1
  66. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
  67. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
  68. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js +1 -1
  69. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js.map +1 -1
  70. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js +1 -1
  71. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js.map +1 -1
  72. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
  73. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js.map +1 -1
  74. package/cjs-bundle/components/DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js +1 -1
  75. package/cjs-bundle/components/DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js.map +1 -1
  76. package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js +1 -1
  77. package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js.map +1 -1
  78. package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/effects/useXProps.js.map +1 -1
  79. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  80. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  81. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  82. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  83. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  84. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  85. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  86. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  87. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  88. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  89. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  90. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  91. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  92. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  93. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  94. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  95. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  96. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  97. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  98. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  99. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  100. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  101. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  102. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  103. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  104. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  105. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  106. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  107. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  108. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  109. package/cjs-bundle/components/EmbeddedApp/EmbeddedApp.js +1 -1
  110. package/cjs-bundle/components/EmbeddedApp/EmbeddedApp.js.map +1 -1
  111. package/cjs-bundle/components/FeedItem/FeedItem.js +1 -1
  112. package/cjs-bundle/components/FeedItem/FeedItem.js.map +1 -1
  113. package/cjs-bundle/components/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js +1 -1
  114. package/cjs-bundle/components/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js.map +1 -1
  115. package/cjs-bundle/components/FeedItem/components/Content.js +1 -1
  116. package/cjs-bundle/components/FeedItem/components/Content.js.map +1 -1
  117. package/cjs-bundle/components/FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js +1 -1
  118. package/cjs-bundle/components/FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js.map +1 -1
  119. package/cjs-bundle/components/FeedItem/feedItemTypes/WellPlanFeedItem/index.js +1 -1
  120. package/cjs-bundle/components/FeedItem/feedItemTypes/WellPlanFeedItem/index.js.map +1 -1
  121. package/cjs-bundle/components/FilesLoaderV2/utils.js +1 -1
  122. package/cjs-bundle/components/FilesLoaderV2/utils.js.map +1 -1
  123. package/cjs-bundle/components/GradientManager/GradientManager.js +1 -1
  124. package/cjs-bundle/components/GradientManager/GradientManager.js.map +1 -1
  125. package/cjs-bundle/components/GradientManager/GradientSelect.js +1 -1
  126. package/cjs-bundle/components/GradientManager/GradientSelect.js.map +1 -1
  127. package/cjs-bundle/components/InfiniteList/index.js +1 -1
  128. package/cjs-bundle/components/InfiniteList/index.js.map +1 -1
  129. package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js +1 -1
  130. package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
  131. package/cjs-bundle/components/OffsetWellPickerV2/OffsetWellPickerDialog.js +1 -1
  132. package/cjs-bundle/components/OffsetWellPickerV2/OffsetWellPickerDialog.js.map +1 -1
  133. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  134. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  135. package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
  136. package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
  137. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  138. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  139. package/cjs-bundle/components/OffsetWellPickerV2/constants.js +1 -1
  140. package/cjs-bundle/components/OffsetWellPickerV2/constants.js.map +1 -1
  141. package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js +1 -1
  142. package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js.map +1 -1
  143. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js +1 -1
  144. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js.map +1 -1
  145. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  146. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  147. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/constants.js +1 -1
  148. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/constants.js.map +1 -1
  149. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js +1 -1
  150. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js.map +1 -1
  151. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  152. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  153. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  154. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  155. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  156. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  157. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  158. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  159. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  160. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  161. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  162. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  163. package/cjs-bundle/components/OffsetWellPickerV3/index.js +1 -1
  164. package/cjs-bundle/components/OffsetWellPickerV3/index.js.map +1 -1
  165. package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
  166. package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
  167. package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js +1 -1
  168. package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js.map +1 -1
  169. package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js +1 -1
  170. package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js.map +1 -1
  171. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
  172. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js.map +1 -1
  173. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  174. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  175. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js +1 -1
  176. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js.map +1 -1
  177. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js +1 -1
  178. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js.map +1 -1
  179. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +1 -1
  180. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -1
  181. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js +1 -1
  182. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js.map +1 -1
  183. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js +1 -1
  184. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js.map +1 -1
  185. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js +1 -1
  186. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js.map +1 -1
  187. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js +1 -1
  188. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js.map +1 -1
  189. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js +1 -1
  190. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js.map +1 -1
  191. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useOffsetWellMapState.js +1 -1
  192. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useOffsetWellMapState.js.map +1 -1
  193. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js +1 -1
  194. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js.map +1 -1
  195. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js +1 -1
  196. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js.map +1 -1
  197. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  198. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  199. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js +1 -1
  200. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js.map +1 -1
  201. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
  202. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
  203. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js +1 -1
  204. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js.map +1 -1
  205. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js +1 -1
  206. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js.map +1 -1
  207. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
  208. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js.map +1 -1
  209. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js +1 -1
  210. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js.map +1 -1
  211. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js +1 -1
  212. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js.map +1 -1
  213. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js +1 -1
  214. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js.map +1 -1
  215. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/MetricsCells/MetricsCells.js +1 -1
  216. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/MetricsCells/MetricsCells.js.map +1 -1
  217. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js +1 -1
  218. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js.map +1 -1
  219. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js +1 -1
  220. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js.map +1 -1
  221. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js +1 -1
  222. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js.map +1 -1
  223. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js +1 -1
  224. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js.map +1 -1
  225. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.module.css.js +1 -1
  226. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.js +1 -1
  227. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.js.map +1 -1
  228. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js +1 -1
  229. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js.map +1 -1
  230. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js +1 -1
  231. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js.map +1 -1
  232. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js +1 -1
  233. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js.map +1 -1
  234. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
  235. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js.map +1 -1
  236. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js +1 -1
  237. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js.map +1 -1
  238. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.js +1 -1
  239. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.js.map +1 -1
  240. package/cjs-bundle/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js +1 -1
  241. package/cjs-bundle/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js.map +1 -1
  242. package/cjs-bundle/components/OffsetWellPickerV5/constants.js +1 -1
  243. package/cjs-bundle/components/OffsetWellPickerV5/constants.js.map +1 -1
  244. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.js +1 -1
  245. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.js.map +1 -1
  246. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js +1 -1
  247. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js.map +1 -1
  248. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js +1 -1
  249. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map +1 -1
  250. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js +1 -1
  251. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js.map +1 -1
  252. package/cjs-bundle/components/OffsetWellPickerV5/hooks/useAutoSyncOffsetWells.js +1 -1
  253. package/cjs-bundle/components/OffsetWellPickerV5/hooks/useAutoSyncOffsetWells.js.map +1 -1
  254. package/cjs-bundle/components/OffsetWellPickerV5/hooks/useIsAdmin.js +1 -1
  255. package/cjs-bundle/components/OffsetWellPickerV5/hooks/useIsAdmin.js.map +1 -1
  256. package/cjs-bundle/components/OffsetWellPickerV5/hooks/useLimitNotification.js +1 -1
  257. package/cjs-bundle/components/OffsetWellPickerV5/hooks/useLimitNotification.js.map +1 -1
  258. package/cjs-bundle/components/OffsetWellPickerV5/stores/filter-store/types.js.map +1 -1
  259. package/cjs-bundle/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js +1 -1
  260. package/cjs-bundle/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js.map +1 -1
  261. package/cjs-bundle/components/OffsetWellPickerV5/utils/getCoordinatedWells.js +1 -1
  262. package/cjs-bundle/components/OffsetWellPickerV5/utils/getCoordinatedWells.js.map +1 -1
  263. package/cjs-bundle/components/OffsetWellPickerV5/utils/getTimestampByPeriod.js +1 -1
  264. package/cjs-bundle/components/OffsetWellPickerV5/utils/getTimestampByPeriod.js.map +1 -1
  265. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  266. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  267. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  268. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  269. package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
  270. package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js.map +1 -1
  271. package/cjs-bundle/components/Search/Search.js.map +1 -1
  272. package/cjs-bundle/componentsV2/AppFooter/DqPopover/DqPopover.js +1 -1
  273. package/cjs-bundle/componentsV2/AppFooter/DqPopover/DqPopover.js.map +1 -1
  274. package/cjs-bundle/componentsV2/AppHeader/AppAssets/utils.js +1 -1
  275. package/cjs-bundle/componentsV2/AppHeader/AppAssets/utils.js.map +1 -1
  276. package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
  277. package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
  278. package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
  279. package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
  280. package/cjs-bundle/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js +1 -1
  281. package/cjs-bundle/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js.map +1 -1
  282. package/cjs-bundle/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js +1 -1
  283. package/cjs-bundle/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js.map +1 -1
  284. package/cjs-bundle/componentsV2/AppPanel/AppPanelDisplay.js +1 -1
  285. package/cjs-bundle/componentsV2/AppPanel/AppPanelDisplay.js.map +1 -1
  286. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
  287. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
  288. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js +1 -1
  289. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js.map +1 -1
  290. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.scss.js +1 -1
  291. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js +1 -1
  292. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js.map +1 -1
  293. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/useNonActivePads.js +1 -1
  294. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/useNonActivePads.js.map +1 -1
  295. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js +1 -1
  296. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js.map +1 -1
  297. package/cjs-bundle/componentsV2/FilesDropzone/utils.js +1 -1
  298. package/cjs-bundle/componentsV2/FilesDropzone/utils.js.map +1 -1
  299. package/cjs-bundle/componentsV2/FilesLoader/utils.js +1 -1
  300. package/cjs-bundle/componentsV2/FilesLoader/utils.js.map +1 -1
  301. package/cjs-bundle/componentsV2/IndicatorLive/IndicatorLive.js.map +1 -1
  302. package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.js +1 -1
  303. package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.js.map +1 -1
  304. package/cjs-bundle/componentsV2/TemplatesControl/PublishModal/PublishModal.js +1 -1
  305. package/cjs-bundle/componentsV2/TemplatesControl/PublishModal/PublishModal.js.map +1 -1
  306. package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
  307. package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
  308. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useCopyTemplate.js +1 -1
  309. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useCopyTemplate.js.map +1 -1
  310. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useCreateTemplate.js +1 -1
  311. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useCreateTemplate.js.map +1 -1
  312. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useDeleteFolder.js +1 -1
  313. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useDeleteFolder.js.map +1 -1
  314. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useDeleteTemplate.js +1 -1
  315. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useDeleteTemplate.js.map +1 -1
  316. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useExportTemplate.js +1 -1
  317. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useExportTemplate.js.map +1 -1
  318. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useImportTemplate.js +1 -1
  319. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useImportTemplate.js.map +1 -1
  320. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useInitialize.js +1 -1
  321. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useInitialize.js.map +1 -1
  322. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useMoveToFolder.js +1 -1
  323. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useMoveToFolder.js.map +1 -1
  324. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js +1 -1
  325. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js.map +1 -1
  326. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useRevertToOriginal.js +1 -1
  327. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useRevertToOriginal.js.map +1 -1
  328. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useShareTemplate.js +1 -1
  329. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useShareTemplate.js.map +1 -1
  330. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUnfollowTemplate.js +1 -1
  331. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUnfollowTemplate.js.map +1 -1
  332. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUpdateFolderName.js +1 -1
  333. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUpdateFolderName.js.map +1 -1
  334. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUpdateTemplateName.js +1 -1
  335. package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUpdateTemplateName.js.map +1 -1
  336. package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.js +1 -1
  337. package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.js.map +1 -1
  338. package/cjs-bundle/componentsV2/TextInputBase/TextInputBase.js +1 -1
  339. package/cjs-bundle/componentsV2/TextInputBase/TextInputBase.js.map +1 -1
  340. package/cjs-bundle/componentsV2/TextInputNext/TextInputNext.js +1 -1
  341. package/cjs-bundle/componentsV2/TextInputNext/TextInputNext.js.map +1 -1
  342. package/cjs-bundle/componentsV2/WellArchivedMessage/WellArchivedMessage.js +1 -1
  343. package/cjs-bundle/componentsV2/WellArchivedMessage/WellArchivedMessage.js.map +1 -1
  344. package/cjs-bundle/constants/notifications.js +1 -1
  345. package/cjs-bundle/constants/notifications.js.map +1 -1
  346. package/cjs-bundle/effects/useGlobalOffsetWellsSync.js +1 -1
  347. package/cjs-bundle/effects/useGlobalOffsetWellsSync.js.map +1 -1
  348. package/cjs-bundle/effects/useSharedDCStore.js +1 -1
  349. package/cjs-bundle/effects/useSharedDCStore.js.map +1 -1
  350. package/cjs-bundle/hocs/withAssetEditorLockHOC.js +1 -1
  351. package/cjs-bundle/hocs/withAssetEditorLockHOC.js.map +1 -1
  352. package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js +1 -1
  353. package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js.map +1 -1
  354. package/cjs-bundle/utils/DrillstringUtils.js +1 -1
  355. package/cjs-bundle/utils/DrillstringUtils.js.map +1 -1
  356. package/cjs-bundle/utils/apps.js +1 -1
  357. package/cjs-bundle/utils/apps.js.map +1 -1
  358. package/cjs-bundle/utils/convert.js +1 -1
  359. package/cjs-bundle/utils/convert.js.map +1 -1
  360. package/cjs-bundle/utils/devcenter.js +1 -1
  361. package/cjs-bundle/utils/devcenter.js.map +1 -1
  362. package/cjs-bundle/utils/index.js +1 -1
  363. package/cjs-bundle/utils/index.js.map +1 -1
  364. package/cjs-bundle/utils/lasParser.js +1 -1
  365. package/cjs-bundle/utils/lasParser.js.map +1 -1
  366. package/cjs-bundle/utils/time.js.map +1 -1
  367. package/clients/jsonApi/index.js +1 -1
  368. package/clients/jsonApi/index.js.map +1 -1
  369. package/components/AddComment/Popover.js +1 -1
  370. package/components/AddComment/Popover.js.map +1 -1
  371. package/components/AddComment/components/Content.js +1 -1
  372. package/components/AddComment/components/Content.js.map +1 -1
  373. package/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js +1 -1
  374. package/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js.map +1 -1
  375. package/components/Annotations/components/AnnotationsList/index.js +1 -1
  376. package/components/Annotations/components/AnnotationsList/index.js.map +1 -1
  377. package/components/AssetEditorV2/__tests__/AssetEditorV2.test.d.ts +2 -0
  378. package/components/AssetEditorV2/__tests__/AssetEditorV2.test.d.ts.map +1 -0
  379. package/components/AssetEditorV2/__tests__/consumerTypes.test.d.ts +2 -0
  380. package/components/AssetEditorV2/__tests__/consumerTypes.test.d.ts.map +1 -0
  381. package/components/AssetEditorV2/components/MultipleAssetsToggle.d.ts +17 -6
  382. package/components/AssetEditorV2/components/MultipleAssetsToggle.d.ts.map +1 -1
  383. package/components/AssetEditorV2/components/MultipleAssetsToggle.js.map +1 -1
  384. package/components/AssetEditorV2/components/PrimaryAssetSelect.d.ts +30 -39
  385. package/components/AssetEditorV2/components/PrimaryAssetSelect.d.ts.map +1 -1
  386. package/components/AssetEditorV2/components/PrimaryAssetSelect.js +1 -1
  387. package/components/AssetEditorV2/components/PrimaryAssetSelect.js.map +1 -1
  388. package/components/AssetEditorV2/components/PrimaryAssetSelectV2.d.ts +4 -41
  389. package/components/AssetEditorV2/components/PrimaryAssetSelectV2.d.ts.map +1 -1
  390. package/components/AssetEditorV2/components/PrimaryAssetSelectV2.js +1 -1
  391. package/components/AssetEditorV2/components/PrimaryAssetSelectV2.js.map +1 -1
  392. package/components/AssetEditorV2/components/SecondaryAssetSelect.d.ts +22 -18
  393. package/components/AssetEditorV2/components/SecondaryAssetSelect.d.ts.map +1 -1
  394. package/components/AssetEditorV2/components/SecondaryAssetSelect.js +1 -1
  395. package/components/AssetEditorV2/components/SecondaryAssetSelect.js.map +1 -1
  396. package/components/AssetEditorV2/components/SelectItem.d.ts +10 -1
  397. package/components/AssetEditorV2/components/SelectItem.d.ts.map +1 -1
  398. package/components/AssetEditorV2/components/SelectItem.js +1 -1
  399. package/components/AssetEditorV2/components/SelectItem.js.map +1 -1
  400. package/components/AssetEditorV2/components/__tests__/AssetSelectors.test.d.ts +2 -0
  401. package/components/AssetEditorV2/components/__tests__/AssetSelectors.test.d.ts.map +1 -0
  402. package/components/AssetEditorV2/components/__tests__/MultipleAssetsToggle.test.d.ts.map +1 -1
  403. package/components/AssetEditorV2/components/__tests__/SelectItem.test.d.ts.map +1 -1
  404. package/components/AssetEditorV2/components/index.d.ts.map +1 -1
  405. package/components/AssetEditorV2/constants.d.ts +2 -9
  406. package/components/AssetEditorV2/constants.d.ts.map +1 -1
  407. package/components/AssetEditorV2/constants.js.map +1 -1
  408. package/components/AssetEditorV2/effects/__tests__/assetResponse.test.d.ts +2 -0
  409. package/components/AssetEditorV2/effects/__tests__/assetResponse.test.d.ts.map +1 -0
  410. package/components/AssetEditorV2/effects/__tests__/useLegacyPrimaryAssetSelectData.test.d.ts +2 -0
  411. package/components/AssetEditorV2/effects/__tests__/useLegacyPrimaryAssetSelectData.test.d.ts.map +1 -0
  412. package/components/AssetEditorV2/effects/__tests__/usePrimaryAssetSelectData.test.d.ts +2 -0
  413. package/components/AssetEditorV2/effects/__tests__/usePrimaryAssetSelectData.test.d.ts.map +1 -0
  414. package/components/AssetEditorV2/effects/assetResponse.d.ts +4 -0
  415. package/components/AssetEditorV2/effects/assetResponse.d.ts.map +1 -0
  416. package/components/AssetEditorV2/effects/assetResponse.js +2 -0
  417. package/components/AssetEditorV2/effects/assetResponse.js.map +1 -0
  418. package/components/AssetEditorV2/effects/index.d.ts +34 -28
  419. package/components/AssetEditorV2/effects/index.d.ts.map +1 -1
  420. package/components/AssetEditorV2/effects/index.js +1 -1
  421. package/components/AssetEditorV2/effects/index.js.map +1 -1
  422. package/components/AssetEditorV2/effects/usePrimaryAssetSelectData.d.ts +21 -17
  423. package/components/AssetEditorV2/effects/usePrimaryAssetSelectData.d.ts.map +1 -1
  424. package/components/AssetEditorV2/effects/usePrimaryAssetSelectData.js +1 -1
  425. package/components/AssetEditorV2/effects/usePrimaryAssetSelectData.js.map +1 -1
  426. package/components/AssetEditorV2/index.d.ts +36 -67
  427. package/components/AssetEditorV2/index.d.ts.map +1 -1
  428. package/components/AssetEditorV2/index.js +1 -1
  429. package/components/AssetEditorV2/index.js.map +1 -1
  430. package/components/AssetEditorV2/types.d.ts +82 -0
  431. package/components/AssetEditorV2/types.d.ts.map +1 -0
  432. package/components/AssetEditorV2/utils/__tests__/utils.test.d.ts.map +1 -1
  433. package/components/AssetEditorV2/utils/index.d.ts +23 -19
  434. package/components/AssetEditorV2/utils/index.d.ts.map +1 -1
  435. package/components/AssetEditorV2/utils/index.js +1 -1
  436. package/components/AssetEditorV2/utils/index.js.map +1 -1
  437. package/components/AssetsMultipleSelector/AssetsMultipleSelector.js +1 -1
  438. package/components/AssetsMultipleSelector/AssetsMultipleSelector.js.map +1 -1
  439. package/components/Attachment/index.js +1 -1
  440. package/components/Attachment/index.js.map +1 -1
  441. package/components/AttachmentLightbox/AttachmentDocument.d.ts.map +1 -1
  442. package/components/AttachmentLightbox/AttachmentDocument.js +1 -1
  443. package/components/AttachmentLightbox/AttachmentDocument.js.map +1 -1
  444. package/components/BICOffsetPickerDialog/components/Map/Map.js +1 -1
  445. package/components/BICOffsetPickerDialog/components/Map/Map.js.map +1 -1
  446. package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
  447. package/components/BICOffsetPickerDialog/components/WellSection/index.js.map +1 -1
  448. package/components/BICOffsetPickerDialog/index.js +1 -1
  449. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  450. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  451. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  452. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  453. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  454. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  455. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  456. package/components/CollapsableSidebar.js +1 -1
  457. package/components/CollapsableSidebar.js.map +1 -1
  458. package/components/CommentCard/CommentCard.d.ts.map +1 -1
  459. package/components/CommentCard/CommentCard.js +1 -1
  460. package/components/CommentCard/CommentCard.js.map +1 -1
  461. package/components/CommentCard/CommentCard.scss.js +1 -1
  462. package/components/CommentCard/CommentCard.types.d.ts +0 -1
  463. package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
  464. package/components/CommentComposer/__tests__/useAttachmentUpload.local.test.d.ts +2 -0
  465. package/components/CommentComposer/__tests__/useAttachmentUpload.local.test.d.ts.map +1 -0
  466. package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
  467. package/components/CommentComposer/useAttachmentUpload.js +1 -1
  468. package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  469. package/components/DevCenter/AppsDataProvider/effects/utils.d.ts.map +1 -1
  470. package/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
  471. package/components/DevCenter/AppsDataProvider/effects/utils.js.map +1 -1
  472. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  473. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  474. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.d.ts.map +1 -1
  475. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
  476. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
  477. package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
  478. package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js.map +1 -1
  479. package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
  480. package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
  481. package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js +1 -1
  482. package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js.map +1 -1
  483. package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js +1 -1
  484. package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js.map +1 -1
  485. package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
  486. package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js.map +1 -1
  487. package/components/DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.d.ts.map +1 -1
  488. package/components/DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js +1 -1
  489. package/components/DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js.map +1 -1
  490. package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.d.ts.map +1 -1
  491. package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js +1 -1
  492. package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js.map +1 -1
  493. package/components/DevCenter/IsolatedDevCenterAppContainer/effects/useXProps.d.ts.map +1 -1
  494. package/components/DevCenter/IsolatedDevCenterAppContainer/effects/useXProps.js.map +1 -1
  495. package/components/DocumentViewer/DocumentViewer.js +1 -1
  496. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  497. package/components/Drillstring/BHAComponentDetail/constants.d.ts +2 -2
  498. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  499. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  500. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  501. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  502. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  503. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  504. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  505. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  506. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  507. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  508. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  509. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  510. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  511. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  512. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  513. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  514. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  515. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  516. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  517. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  518. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  519. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  520. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  521. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  522. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  523. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  524. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  525. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  526. package/components/EmbeddedApp/EmbeddedApp.d.ts.map +1 -1
  527. package/components/EmbeddedApp/EmbeddedApp.js +1 -1
  528. package/components/EmbeddedApp/EmbeddedApp.js.map +1 -1
  529. package/components/FeedItem/FeedItem.js +1 -1
  530. package/components/FeedItem/FeedItem.js.map +1 -1
  531. package/components/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js +1 -1
  532. package/components/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js.map +1 -1
  533. package/components/FeedItem/components/Content.d.ts.map +1 -1
  534. package/components/FeedItem/components/Content.js +1 -1
  535. package/components/FeedItem/components/Content.js.map +1 -1
  536. package/components/FeedItem/feedItemTypes/AppAnnotationFeedItem/index.d.ts.map +1 -1
  537. package/components/FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js +1 -1
  538. package/components/FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js.map +1 -1
  539. package/components/FeedItem/feedItemTypes/WellPlanFeedItem/index.d.ts.map +1 -1
  540. package/components/FeedItem/feedItemTypes/WellPlanFeedItem/index.js +1 -1
  541. package/components/FeedItem/feedItemTypes/WellPlanFeedItem/index.js.map +1 -1
  542. package/components/FilesLoaderV2/utils.js +1 -1
  543. package/components/FilesLoaderV2/utils.js.map +1 -1
  544. package/components/GradientManager/GradientManager.js +1 -1
  545. package/components/GradientManager/GradientManager.js.map +1 -1
  546. package/components/GradientManager/GradientSelect.js +1 -1
  547. package/components/GradientManager/GradientSelect.js.map +1 -1
  548. package/components/InfiniteList/index.d.ts.map +1 -1
  549. package/components/InfiniteList/index.js +1 -1
  550. package/components/InfiniteList/index.js.map +1 -1
  551. package/components/OffsetWellMap/OffsetWellMap.js +1 -1
  552. package/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
  553. package/components/OffsetWellPickerV2/OffsetWellPickerDialog.js +1 -1
  554. package/components/OffsetWellPickerV2/OffsetWellPickerDialog.js.map +1 -1
  555. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  556. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  557. package/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
  558. package/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
  559. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  560. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  561. package/components/OffsetWellPickerV2/constants.js +1 -1
  562. package/components/OffsetWellPickerV2/constants.js.map +1 -1
  563. package/components/OffsetWellPickerV2/effects/index.js +1 -1
  564. package/components/OffsetWellPickerV2/effects/index.js.map +1 -1
  565. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js +1 -1
  566. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js.map +1 -1
  567. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  568. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  569. package/components/OffsetWellPickerV3/components/CustomSelectionView/constants.js +1 -1
  570. package/components/OffsetWellPickerV3/components/CustomSelectionView/constants.js.map +1 -1
  571. package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js +1 -1
  572. package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js.map +1 -1
  573. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  574. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  575. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  576. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  577. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  578. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  579. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  580. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  581. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  582. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  583. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  584. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  585. package/components/OffsetWellPickerV3/index.js +1 -1
  586. package/components/OffsetWellPickerV3/index.js.map +1 -1
  587. package/components/OffsetWellPickerV4/effects/__tests__/useCompanyMetricKey.test.d.ts +2 -0
  588. package/components/OffsetWellPickerV4/effects/__tests__/useCompanyMetricKey.test.d.ts.map +1 -0
  589. package/components/OffsetWellPickerV4/effects/useCompanyMetricKey.d.ts.map +1 -1
  590. package/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
  591. package/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
  592. package/components/OffsetWellPickerV5/__tests__/constants.test.d.ts +2 -0
  593. package/components/OffsetWellPickerV5/__tests__/constants.test.d.ts.map +1 -0
  594. package/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js +1 -1
  595. package/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js.map +1 -1
  596. package/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js +1 -1
  597. package/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js.map +1 -1
  598. package/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
  599. package/components/OffsetWellPickerV5/components/Filter/Filter.js.map +1 -1
  600. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  601. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  602. package/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js +1 -1
  603. package/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js.map +1 -1
  604. package/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js +1 -1
  605. package/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js.map +1 -1
  606. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +1 -1
  607. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -1
  608. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js +1 -1
  609. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js.map +1 -1
  610. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js +1 -1
  611. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js.map +1 -1
  612. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js +1 -1
  613. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js.map +1 -1
  614. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js +1 -1
  615. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js.map +1 -1
  616. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js +1 -1
  617. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js.map +1 -1
  618. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useOffsetWellMapState.js +1 -1
  619. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useOffsetWellMapState.js.map +1 -1
  620. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js +1 -1
  621. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js.map +1 -1
  622. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js +1 -1
  623. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js.map +1 -1
  624. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  625. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  626. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js +1 -1
  627. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js.map +1 -1
  628. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
  629. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
  630. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js +1 -1
  631. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js.map +1 -1
  632. package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js +1 -1
  633. package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js.map +1 -1
  634. package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
  635. package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js.map +1 -1
  636. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js +1 -1
  637. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js.map +1 -1
  638. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js +1 -1
  639. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js.map +1 -1
  640. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js +1 -1
  641. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js.map +1 -1
  642. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/MetricsCells/MetricsCells.d.ts +2 -1
  643. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/MetricsCells/MetricsCells.d.ts.map +1 -1
  644. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/MetricsCells/MetricsCells.js +1 -1
  645. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/MetricsCells/MetricsCells.js.map +1 -1
  646. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js +1 -1
  647. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js.map +1 -1
  648. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js +1 -1
  649. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js.map +1 -1
  650. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js +1 -1
  651. package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js.map +1 -1
  652. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.d.ts +3 -1
  653. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.d.ts.map +1 -1
  654. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js +1 -1
  655. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js.map +1 -1
  656. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.module.css.js +1 -1
  657. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/__tests__/MetricCell.test.d.ts +2 -0
  658. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/__tests__/MetricCell.test.d.ts.map +1 -0
  659. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.d.ts.map +1 -1
  660. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.js +1 -1
  661. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.js.map +1 -1
  662. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js +1 -1
  663. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js.map +1 -1
  664. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js +1 -1
  665. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js.map +1 -1
  666. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js +1 -1
  667. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js.map +1 -1
  668. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
  669. package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js.map +1 -1
  670. package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js +1 -1
  671. package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js.map +1 -1
  672. package/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.d.ts +0 -1
  673. package/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.d.ts.map +1 -1
  674. package/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.js +1 -1
  675. package/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.js.map +1 -1
  676. package/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js +1 -1
  677. package/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js.map +1 -1
  678. package/components/OffsetWellPickerV5/constants.d.ts +26 -3
  679. package/components/OffsetWellPickerV5/constants.d.ts.map +1 -1
  680. package/components/OffsetWellPickerV5/constants.js +1 -1
  681. package/components/OffsetWellPickerV5/constants.js.map +1 -1
  682. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/__tests__/useAdvancedWells.test.d.ts +2 -0
  683. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/__tests__/useAdvancedWells.test.d.ts.map +1 -0
  684. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/__tests__/useCompanyMetricKey.test.d.ts +2 -0
  685. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/__tests__/useCompanyMetricKey.test.d.ts.map +1 -0
  686. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.d.ts.map +1 -1
  687. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.js +1 -1
  688. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.js.map +1 -1
  689. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js +1 -1
  690. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js.map +1 -1
  691. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js +1 -1
  692. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map +1 -1
  693. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js +1 -1
  694. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js.map +1 -1
  695. package/components/OffsetWellPickerV5/hooks/useAutoSyncOffsetWells.js +1 -1
  696. package/components/OffsetWellPickerV5/hooks/useAutoSyncOffsetWells.js.map +1 -1
  697. package/components/OffsetWellPickerV5/hooks/useIsAdmin.js +1 -1
  698. package/components/OffsetWellPickerV5/hooks/useIsAdmin.js.map +1 -1
  699. package/components/OffsetWellPickerV5/hooks/useLimitNotification.js +1 -1
  700. package/components/OffsetWellPickerV5/hooks/useLimitNotification.js.map +1 -1
  701. package/components/OffsetWellPickerV5/stores/filter-store/types.d.ts +2 -1
  702. package/components/OffsetWellPickerV5/stores/filter-store/types.d.ts.map +1 -1
  703. package/components/OffsetWellPickerV5/stores/filter-store/types.js.map +1 -1
  704. package/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js +1 -1
  705. package/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js.map +1 -1
  706. package/components/OffsetWellPickerV5/utils/__tests__/getTimestampByPeriod.test.d.ts +2 -0
  707. package/components/OffsetWellPickerV5/utils/__tests__/getTimestampByPeriod.test.d.ts.map +1 -0
  708. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.d.ts.map +1 -1
  709. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.js +1 -1
  710. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.js.map +1 -1
  711. package/components/OffsetWellPickerV5/utils/getTimestampByPeriod.d.ts +4 -0
  712. package/components/OffsetWellPickerV5/utils/getTimestampByPeriod.d.ts.map +1 -1
  713. package/components/OffsetWellPickerV5/utils/getTimestampByPeriod.js +1 -1
  714. package/components/OffsetWellPickerV5/utils/getTimestampByPeriod.js.map +1 -1
  715. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  716. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  717. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  718. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  719. package/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
  720. package/components/RealTimeValuesSidebar/SidebarFooter.js.map +1 -1
  721. package/components/Search/Search.d.ts +6 -3
  722. package/components/Search/Search.d.ts.map +1 -1
  723. package/components/Search/Search.js.map +1 -1
  724. package/components/index.d.ts +1 -0
  725. package/components/index.d.ts.map +1 -1
  726. package/componentsV2/AppFooter/DqPopover/DqPopover.js +1 -1
  727. package/componentsV2/AppFooter/DqPopover/DqPopover.js.map +1 -1
  728. package/componentsV2/AppHeader/AppAssets/utils.js +1 -1
  729. package/componentsV2/AppHeader/AppAssets/utils.js.map +1 -1
  730. package/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
  731. package/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
  732. package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
  733. package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
  734. package/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js +1 -1
  735. package/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js.map +1 -1
  736. package/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js +1 -1
  737. package/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js.map +1 -1
  738. package/componentsV2/AppPanel/AppPanelDisplay.js +1 -1
  739. package/componentsV2/AppPanel/AppPanelDisplay.js.map +1 -1
  740. package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
  741. package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
  742. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js +1 -1
  743. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js.map +1 -1
  744. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.scss.js +1 -1
  745. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.d.ts.map +1 -1
  746. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js +1 -1
  747. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js.map +1 -1
  748. package/componentsV2/CompletionsOffsetWellPicker/hooks/useNonActivePads.js +1 -1
  749. package/componentsV2/CompletionsOffsetWellPicker/hooks/useNonActivePads.js.map +1 -1
  750. package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js +1 -1
  751. package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js.map +1 -1
  752. package/componentsV2/FilesDropzone/utils.js +1 -1
  753. package/componentsV2/FilesDropzone/utils.js.map +1 -1
  754. package/componentsV2/FilesLoader/utils.js +1 -1
  755. package/componentsV2/FilesLoader/utils.js.map +1 -1
  756. package/componentsV2/IndicatorLive/IndicatorLive.d.ts.map +1 -1
  757. package/componentsV2/IndicatorLive/IndicatorLive.js.map +1 -1
  758. package/componentsV2/PadModeSelect/PadModeSelect.js +1 -1
  759. package/componentsV2/PadModeSelect/PadModeSelect.js.map +1 -1
  760. package/componentsV2/TemplatesControl/PublishModal/PublishModal.js +1 -1
  761. package/componentsV2/TemplatesControl/PublishModal/PublishModal.js.map +1 -1
  762. package/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
  763. package/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
  764. package/componentsV2/TemplatesControl/Store/hooks/useCopyTemplate.js +1 -1
  765. package/componentsV2/TemplatesControl/Store/hooks/useCopyTemplate.js.map +1 -1
  766. package/componentsV2/TemplatesControl/Store/hooks/useCreateTemplate.js +1 -1
  767. package/componentsV2/TemplatesControl/Store/hooks/useCreateTemplate.js.map +1 -1
  768. package/componentsV2/TemplatesControl/Store/hooks/useDeleteFolder.js +1 -1
  769. package/componentsV2/TemplatesControl/Store/hooks/useDeleteFolder.js.map +1 -1
  770. package/componentsV2/TemplatesControl/Store/hooks/useDeleteTemplate.js +1 -1
  771. package/componentsV2/TemplatesControl/Store/hooks/useDeleteTemplate.js.map +1 -1
  772. package/componentsV2/TemplatesControl/Store/hooks/useExportTemplate.js +1 -1
  773. package/componentsV2/TemplatesControl/Store/hooks/useExportTemplate.js.map +1 -1
  774. package/componentsV2/TemplatesControl/Store/hooks/useImportTemplate.js +1 -1
  775. package/componentsV2/TemplatesControl/Store/hooks/useImportTemplate.js.map +1 -1
  776. package/componentsV2/TemplatesControl/Store/hooks/useInitialize.js +1 -1
  777. package/componentsV2/TemplatesControl/Store/hooks/useInitialize.js.map +1 -1
  778. package/componentsV2/TemplatesControl/Store/hooks/useMoveToFolder.js +1 -1
  779. package/componentsV2/TemplatesControl/Store/hooks/useMoveToFolder.js.map +1 -1
  780. package/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js +1 -1
  781. package/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js.map +1 -1
  782. package/componentsV2/TemplatesControl/Store/hooks/useRevertToOriginal.js +1 -1
  783. package/componentsV2/TemplatesControl/Store/hooks/useRevertToOriginal.js.map +1 -1
  784. package/componentsV2/TemplatesControl/Store/hooks/useShareTemplate.js +1 -1
  785. package/componentsV2/TemplatesControl/Store/hooks/useShareTemplate.js.map +1 -1
  786. package/componentsV2/TemplatesControl/Store/hooks/useUnfollowTemplate.js +1 -1
  787. package/componentsV2/TemplatesControl/Store/hooks/useUnfollowTemplate.js.map +1 -1
  788. package/componentsV2/TemplatesControl/Store/hooks/useUpdateFolderName.js +1 -1
  789. package/componentsV2/TemplatesControl/Store/hooks/useUpdateFolderName.js.map +1 -1
  790. package/componentsV2/TemplatesControl/Store/hooks/useUpdateTemplateName.js +1 -1
  791. package/componentsV2/TemplatesControl/Store/hooks/useUpdateTemplateName.js.map +1 -1
  792. package/componentsV2/TemplatesControl/Toggle/Toggle.js +1 -1
  793. package/componentsV2/TemplatesControl/Toggle/Toggle.js.map +1 -1
  794. package/componentsV2/TextInputBase/TextInputBase.js +1 -1
  795. package/componentsV2/TextInputBase/TextInputBase.js.map +1 -1
  796. package/componentsV2/TextInputNext/TextInputNext.js +1 -1
  797. package/componentsV2/TextInputNext/TextInputNext.js.map +1 -1
  798. package/componentsV2/WellArchivedMessage/WellArchivedMessage.js +1 -1
  799. package/componentsV2/WellArchivedMessage/WellArchivedMessage.js.map +1 -1
  800. package/constants/assets.d.ts +40 -1
  801. package/constants/assets.d.ts.map +1 -1
  802. package/constants/bha.d.ts +4 -4
  803. package/constants/notifications.d.ts +5 -2
  804. package/constants/notifications.d.ts.map +1 -1
  805. package/constants/notifications.js +1 -1
  806. package/constants/notifications.js.map +1 -1
  807. package/effects/useGlobalOffsetWellsSync.js +1 -1
  808. package/effects/useGlobalOffsetWellsSync.js.map +1 -1
  809. package/effects/useSharedDCStore.js +1 -1
  810. package/effects/useSharedDCStore.js.map +1 -1
  811. package/hocs/__tests__/withAssetEditorLockHOC.test.d.ts +2 -0
  812. package/hocs/__tests__/withAssetEditorLockHOC.test.d.ts.map +1 -0
  813. package/hocs/withAssetEditorLockHOC.d.ts +11 -1
  814. package/hocs/withAssetEditorLockHOC.d.ts.map +1 -1
  815. package/hocs/withAssetEditorLockHOC.js +1 -1
  816. package/hocs/withAssetEditorLockHOC.js.map +1 -1
  817. package/mcp-server/server.mjs +373 -163
  818. package/mcp-server/setup.mjs +129 -44
  819. package/package.json +3 -3
  820. package/testing/AppTestWrapper/AppTestWrapper.js +1 -1
  821. package/testing/AppTestWrapper/AppTestWrapper.js.map +1 -1
  822. package/tsconfig.tsbuildinfo +1 -1
  823. package/utils/DrillstringUtils.d.ts.map +1 -1
  824. package/utils/DrillstringUtils.js +1 -1
  825. package/utils/DrillstringUtils.js.map +1 -1
  826. package/utils/apps.js +1 -1
  827. package/utils/apps.js.map +1 -1
  828. package/utils/convert.d.ts +0 -19
  829. package/utils/convert.d.ts.map +1 -1
  830. package/utils/convert.js +1 -1
  831. package/utils/convert.js.map +1 -1
  832. package/utils/devcenter.d.ts.map +1 -1
  833. package/utils/devcenter.js +1 -1
  834. package/utils/devcenter.js.map +1 -1
  835. package/utils/index.d.ts +4 -4
  836. package/utils/index.d.ts.map +1 -1
  837. package/utils/index.js +1 -1
  838. package/utils/index.js.map +1 -1
  839. package/utils/lasParser.d.ts.map +1 -1
  840. package/utils/lasParser.js +1 -1
  841. package/utils/lasParser.js.map +1 -1
  842. package/utils/time.d.ts.map +1 -1
  843. package/utils/time.js.map +1 -1
  844. package/utils/HeatmapUtils.d.ts +0 -1
  845. package/utils/HeatmapUtils.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@babel/runtime/helpers/slicedToArray"),s=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("react"),n=require("prop-types"),t=require("react-player"),r=require("classnames"),c=require("@material-ui/core/styles"),a=require("@material-ui/core"),l=require("@material-ui/icons/Image"),u=require("@material-ui/icons/Fullscreen"),m=require("@material-ui/core/colors/grey"),d=require("../NewDocumentViewer/NewDocumentViewer.js"),p=require("../NewDocumentViewer/icons/UnavailableFileIcon.js"),j=require("../../componentsV2/ImageViewer/ImageViewer.js"),h=require("./styles.css.js"),q=require("../FileTypeIcon.js"),I=require("../IconButton/index.js"),g=require("../../utils/mobileDetect.js"),f=require("../../utils/fileExtension.js"),v=require("../../utils/filePreview.js"),b=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/DragOne.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/SearchOne.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/InfoRounded.js"),require("../../icons/customIcons/icons/FlameFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Global.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/PinOne.js"),require("../../icons/customIcons/icons/PinOneCrossed.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js"),require("../../icons/customIcons/icons/InterventionUnit.js"),require("../../icons/customIcons/icons/CloudDelete.js"),require("../../icons/customIcons/icons/Lasso.js"),require("../../icons/customIcons/icons/Radius.js"),require("../../icons/customIcons/icons/ErrorOps.js"),require("../../icons/customIcons/icons/DataTypeOps.js"),require("../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../icons/customIcons/icons/CalibrationOps.js"),require("../../icons/customIcons/icons/CriticalOps.js"),require("../../icons/customIcons/icons/Company.js"),require("../../icons/customIcons/icons/ArchiveOne.js"),require("../../icons/customIcons/icons/ParseBotFusion.js"),require("../../icons/customIcons/icons/Connect.js"),require("../../icons/customIcons/icons/PuzzleOne.js"),require("../../icons/customIcons/icons/Feed.js"),require("../../icons/customIcons/icons/Prompt.js"),require("../../icons/customIcons/icons/Companies.js"),require("../../icons/customIcons/icons/ClipboardAi.js"),require("../../icons/customIcons/icons/Key.js"),require("../../icons/customIcons/icons/AtSignCrossed.js"),require("../../icons/customIcons/icons/MappingManual.js"),require("../../icons/customIcons/icons/Mapping.js"),require("../../icons/customIcons/icons/Metrics.js"),require("../../icons/customIcons/icons/Drops.js"),require("../../icons/customIcons/icons/ClipboardSearch.js"),require("../../icons/customIcons/icons/Template.js"),require("../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../icons/customIcons/icons/UnitConversion.js"),require("../../icons/customIcons/icons/NPT.js"),require("../../icons/customIcons/icons/GuidedFrac.js"),require("../../clients/subscriptions/constants.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("querystring"),require("uuid/v1"),require("lodash"),require("../../clients/subscriptions.v1.js"),require("../../clients/jsonApi/index.js"),require("../../clients/subscriptions/subscriptions-client.factory.js"),require("immutable"),require("query-string"),require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/alerts.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/completion.js"),require("../../constants/appPackages.js"),require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js"),require("../../constants/corvaCompanyId.js"),require("../GradientManager/configuration/constants.js");var x=require("../../effects/useSignedURL.js");require("../../utils/index.js"),require("uuid"),require("jsona"),require("../../utils/env.js"),require("../StatusBadge/constants.js"),require("@babel/runtime/helpers/toConsumableArray"),require("lodash/set"),require("lodash/get"),require("lodash/unset"),require("moment"),require("../../clients/api/apiCore.js"),require("../../clients/constants.js"),require("../../clients/sso/auth0.js"),require("../../clients/sso/oauth2.js"),require("../../clients/api/rateLimiter.js"),require("lodash/isEmpty"),require("lodash/sortBy"),require("../../constants/streamSourceType.js"),require("../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js"),require("../../componentsV2/AppCommonsProvider/AppCommonsProvider.js"),require("../../componentsV2/AppCommonsProvider/AppCommonsContext.js"),require("../../componentsV2/AppPanel/AppPanelsContext.js");var C=require("../../utils/main.js"),w=require("react/jsx-runtime");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=y(e),P=y(s),F=y(i),O=y(n),A=y(t),D=y(r),S=y(l),z=y(u),k=y(m),W=["displayName","fileName","attachmentSize","size","small"];function U(e,s){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);s&&(o=o.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),i.push.apply(i,o)}return i}function R(e){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?U(Object(i),!0).forEach((function(s){P.default(e,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):U(Object(i)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))}))}return e}var L=k.default[200],E=k.default[400],T={label:"small",value:135},V={label:"medium",value:300},M={fileImage:function(e,s){return{maxWidth:"100%",borderRadius:4,overflow:"hidden",maxHeight:s===T.label?T.value:V.value,display:e?"initial":"none",cursor:"pointer"}},fileDownloadWrapper:{padding:"10px 10px 10px 5px",border:"1px solid #616161",borderRadius:3,maxWidth:500,width:"75%"},imagePlaceholder:{position:"relative",backgroundColor:L,borderRadius:3,marginTop:10,height:135,width:135}},B=function(e){var s,i,o=x(e.attachmentFileName)||e.attachmentUrl;return w.jsxs(w.Fragment,{children:[w.jsxs("div",{onClick:e.openLightbox,className:h.cAttachmentImg,children:[w.jsx("img",{"data-testid":"".concat("Attachment","_image"),src:o,style:M.fileImage(!!e.imageDimensions,e.size),alt:"Attachment",onLoad:e.onImageLoaded}),w.jsx("div",{"data-testid":"".concat("Attachment","_button"),className:h.cAttachmentImgPreviwBtn,children:w.jsx(z.default,{})})]}),!e.imageDimensions&&w.jsx("div",{style:M.imagePlaceholder,children:w.jsx(S.default,{"data-testid":"".concat("Attachment","_placeholder"),className:e.classes.imageIconRoot,htmlColor:E,fontSize:"large"})}),e.lightboxIsOpen&&w.jsx(j.ImageViewer,{src:o,onClose:e.handleLightboxClose,onOpen:e.handleLightboxOpen,width:null===(s=e.imageDimensions)||void 0===s?void 0:s.width,height:null===(i=e.imageDimensions)||void 0===i?void 0:i.height})]})},G=function(e){var s=C.default.getFileNameWithExtensionFromPath(e.displayName||e.attachmentUrl),i=x(e.attachmentFileName,"inline"),o=x(e.attachmentFileName,"attachment"),n=v.getIsPreviewUnavailable(s);return w.jsxs("div",{className:h.cAttachmentFileWrapper,children:[w.jsxs("div",{className:D.default(h.cAttachmentFileDownloadWrapper,n&&e.classes.disabledPreview),style:M.fileDownloadWrapper,onClick:function(){n||e.openPreview()},children:[n?w.jsx(p.UnavailableFileIcon,{className:e.classes.unavailableFileIcon}):w.jsx(q,{fileName:e.displayName||e.attachmentUrl,className:h.cAttachmentFileDownloadWrapperFileIcon,size:e.small?25:50}),w.jsxs("div",{className:e.classes.titleContainer,children:[n&&w.jsx("div",{className:e.classes.caption,children:"Preview unavailable"}),w.jsx("div",{"data-testid":"".concat("Attachment","_name"),className:D.default(h.cAttachmentFileDownloadWrapperFileName,n&&e.classes.fileName),children:w.jsx(a.Typography,{variant:"subtitle2",noWrap:!0,className:e.classes.unavailableFileName,children:s})})]}),w.jsx(d,{fileUrl:i,classes:{root:e.classes.dialogRoot,paper:g.isNativeDetected?e.classes.nativeDialog:e.classes.dialog},fileName:s,fileSize:e.attachmentSize,onClose:e.closePreview,open:e.previewIsOpen})]}),w.jsx("a",{download:e.displayName,href:o,className:h.cAttachmentFileDownloadWrapperForm,children:w.jsx(I,{"data-testid":"".concat("Attachment","_downloadButton"),className:e.classes.downloadIcon,type:"submit",children:w.jsx(b.DownloadIcon,{size:24,className:e.classes.downloadIcon})})})]})};function _(e){var s=e.displayName,i=void 0===s?null:s,n=e.fileName,t=void 0===n?null:n,r=e.attachmentSize,c=void 0===r?void 0:r,a=e.size,l=void 0===a?V.label:a,u=e.small,m=void 0!==u&&u,d=R(R({},F.default(e,W)),{},{displayName:i,fileName:t,attachmentSize:c,size:l,small:m}),p=o.useState(void 0),j=N.default(p,2),q=j[0],I=j[1],v=o.useState(!1),b=N.default(v,2),C=b[0],y=b[1],P=o.useState(!1),O=N.default(P,2),D=O[0],S=O[1],z=d.displayName||d.attachmentUrl||d.fileName,k=f.getIsImage(z),U=f.getIsVideo(z),L=x(!d.attachmentUrl&&d.fileName),E=d.attachmentUrl||L,M=o.useCallback((function(e){return e.preventDefault()}),[]),_=o.useCallback((function(){g.isNativeDetected&&document.documentElement.addEventListener("touchmove",M,{passive:!1})}),[M]),H=o.useCallback((function(){g.isNativeDetected&&document.documentElement.removeEventListener("touchmove",M),y(!1)}),[M]),K=o.useCallback((function(){return y(!0)}),[]),Z=o.useCallback((function(e){var s=e.currentTarget,i=s.naturalWidth,o=s.naturalHeight;I({width:i,height:o})}),[]),J=o.useCallback((function(){return S(!0)}),[]),Q=o.useCallback((function(e){e.stopPropagation(),S(!1)}),[]);return k?w.jsx("div",{className:h.cAttachment,children:w.jsx(B,{size:d.size,openLightbox:K,attachmentFileName:d.fileName,attachmentUrl:d.attachmentUrl,onImageLoaded:Z,imageDimensions:q,lightboxIsOpen:C,handleLightboxOpen:_,handleLightboxClose:H,classes:d.classes})}):U&&A.default.canPlay(E)?w.jsx("div",{className:h.cAttachment,children:w.jsx(A.default,{"data-testid":"".concat("Attachment","_player"),className:h.cAttachmentReactPlayer,url:E,config:{file:{attributes:{preload:"metadata"}}},controls:!0,height:d.size===T.label?T.value:V.value,width:null})}):w.jsx("div",{className:h.cAttachment,children:w.jsx(G,{attachmentUrl:E,attachmentFileName:d.fileName,attachmentSize:d.attachmentSize,displayName:d.displayName,openPreview:J,closePreview:Q,previewIsOpen:D,classes:d.classes,small:d.small})})}_.propTypes={attachmentUrl:O.default.string.isRequired,attachmentSize:O.default.number,displayName:O.default.string,fileName:O.default.string,size:O.default.oneOf([T.label,V.label]),classes:O.default.shape({}).isRequired,small:O.default.bool};var H=c.withStyles((function(e){return{imageIconRoot:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},dialog:{width:"95%",height:"95%",maxWidth:"100%",position:"relative"},nativeDialog:{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",margin:0},dialogRoot:{backgroundColor:"rgba(0, 0, 0, 0.85)"},fileName:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:400},downloadIcon:{color:e.palette.primary.text3},disabledPreview:{backgroundColor:e.palette.primary.text9},unavailableFileIcon:{marginRight:12,minWidth:32},titleContainer:{display:"flex",flexDirection:"column",width:"100%"},caption:{fontSize:12,fontWeight:400,width:"fit-content"},unavailableFileName:{fontSize:12,fontWeight:400}}}))(_);module.exports=H;
1
+ "use strict";var e=require("@babel/runtime/helpers/slicedToArray"),s=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("react"),r=require("prop-types"),n=require("react-player"),t=require("classnames"),c=require("@material-ui/core/styles"),a=require("@material-ui/core"),l=require("@material-ui/icons/Image"),u=require("@material-ui/icons/Fullscreen"),m=require("@material-ui/core/colors/grey"),d=require("../NewDocumentViewer/NewDocumentViewer.js"),p=require("../NewDocumentViewer/icons/UnavailableFileIcon.js"),j=require("../../componentsV2/ImageViewer/ImageViewer.js"),q=require("./styles.css.js"),h=require("../FileTypeIcon.js"),I=require("../IconButton/index.js"),g=require("../../utils/mobileDetect.js"),f=require("../../utils/fileExtension.js"),v=require("../../utils/filePreview.js"),b=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/DragOne.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/SearchOne.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/InfoRounded.js"),require("../../icons/customIcons/icons/FlameFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Global.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/PinOne.js"),require("../../icons/customIcons/icons/PinOneCrossed.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js"),require("../../icons/customIcons/icons/InterventionUnit.js"),require("../../icons/customIcons/icons/CloudDelete.js"),require("../../icons/customIcons/icons/Lasso.js"),require("../../icons/customIcons/icons/Radius.js"),require("../../icons/customIcons/icons/ErrorOps.js"),require("../../icons/customIcons/icons/DataTypeOps.js"),require("../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../icons/customIcons/icons/CalibrationOps.js"),require("../../icons/customIcons/icons/CriticalOps.js"),require("../../icons/customIcons/icons/Company.js"),require("../../icons/customIcons/icons/ArchiveOne.js"),require("../../icons/customIcons/icons/ParseBotFusion.js"),require("../../icons/customIcons/icons/Connect.js"),require("../../icons/customIcons/icons/PuzzleOne.js"),require("../../icons/customIcons/icons/Feed.js"),require("../../icons/customIcons/icons/Prompt.js"),require("../../icons/customIcons/icons/Companies.js"),require("../../icons/customIcons/icons/ClipboardAi.js"),require("../../icons/customIcons/icons/Key.js"),require("../../icons/customIcons/icons/AtSignCrossed.js"),require("../../icons/customIcons/icons/MappingManual.js"),require("../../icons/customIcons/icons/Mapping.js"),require("../../icons/customIcons/icons/Metrics.js"),require("../../icons/customIcons/icons/Drops.js"),require("../../icons/customIcons/icons/ClipboardSearch.js"),require("../../icons/customIcons/icons/Template.js"),require("../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../icons/customIcons/icons/UnitConversion.js"),require("../../icons/customIcons/icons/NPT.js"),require("../../icons/customIcons/icons/GuidedFrac.js"),require("../../clients/subscriptions/constants.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("querystring"),require("uuid/v1"),require("lodash"),require("../../clients/subscriptions.v1.js"),require("../../clients/jsonApi/index.js"),require("../../clients/subscriptions/subscriptions-client.factory.js"),require("query-string"),require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/alerts.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/completion.js"),require("../../constants/appPackages.js"),require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js"),require("../../constants/corvaCompanyId.js"),require("../GradientManager/configuration/constants.js");var x=require("../../effects/useSignedURL.js");require("../UserMention/utils/index.js"),require("../../utils/convert.js"),require("moment"),require("../../utils/casing/validation.js"),require("lodash/mean"),require("../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),require("../../utils/drillstring/conversion.js"),require("lodash/set"),require("lodash/cloneDeep"),require("@babel/runtime/helpers/toConsumableArray"),require("lodash/isNumber"),require("lodash/has"),require("../../utils/ga.js"),require("../../utils/goalsConfig/goalsConfig.js"),require("../../utils/lasParser.js");var C=require("../../utils/main.js");require("../../utils/metrics/metricsConfig.js"),require("../../utils/feed.js"),require("../../utils/reports.js"),require("moment-timezone"),require("@babel/runtime/helpers/typeof"),require("../../utils/dashboardReports.js"),require("../../utils/env.js"),require("../../utils/jsonaDataFormatter.js"),require("../../utils/bha.js"),require("jsona"),require("../../utils/charts/Styles.scss.js"),require("../../utils/getSingleAsset.js"),require("uuid"),require("../StatusBadge/constants.js"),require("lodash/unset"),require("../../clients/api/apiCore.js"),require("../../clients/constants.js"),require("../../clients/sso/auth0.js"),require("../../clients/sso/oauth2.js"),require("../../clients/api/rateLimiter.js"),require("lodash/isEmpty"),require("lodash/sortBy"),require("../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js"),require("../../componentsV2/AppCommonsProvider/AppCommonsProvider.js"),require("../../componentsV2/AppCommonsProvider/AppCommonsContext.js"),require("../../componentsV2/AppPanel/AppPanelsContext.js");var y=require("react/jsx-runtime");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=w(e),P=w(s),F=w(i),O=w(r),A=w(n),D=w(t),S=w(l),z=w(u),k=w(m),W=["displayName","fileName","attachmentSize","size","small"];function U(e,s){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);s&&(o=o.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),i.push.apply(i,o)}return i}function R(e){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?U(Object(i),!0).forEach((function(s){P.default(e,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):U(Object(i)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))}))}return e}var L=k.default[200],E=k.default[400],T={label:"small",value:135},V={label:"medium",value:300},M={fileImage:function(e,s){return{maxWidth:"100%",borderRadius:4,overflow:"hidden",maxHeight:s===T.label?T.value:V.value,display:e?"initial":"none",cursor:"pointer"}},fileDownloadWrapper:{padding:"10px 10px 10px 5px",border:"1px solid #616161",borderRadius:3,maxWidth:500,width:"75%"},imagePlaceholder:{position:"relative",backgroundColor:L,borderRadius:3,marginTop:10,height:135,width:135}},B=function(e){var s,i,o=x(e.attachmentFileName)||e.attachmentUrl;return y.jsxs(y.Fragment,{children:[y.jsxs("div",{onClick:e.openLightbox,className:q.cAttachmentImg,children:[y.jsx("img",{"data-testid":"".concat("Attachment","_image"),src:o,style:M.fileImage(!!e.imageDimensions,e.size),alt:"Attachment",onLoad:e.onImageLoaded}),y.jsx("div",{"data-testid":"".concat("Attachment","_button"),className:q.cAttachmentImgPreviwBtn,children:y.jsx(z.default,{})})]}),!e.imageDimensions&&y.jsx("div",{style:M.imagePlaceholder,children:y.jsx(S.default,{"data-testid":"".concat("Attachment","_placeholder"),className:e.classes.imageIconRoot,htmlColor:E,fontSize:"large"})}),e.lightboxIsOpen&&y.jsx(j.ImageViewer,{src:o,onClose:e.handleLightboxClose,onOpen:e.handleLightboxOpen,width:null===(s=e.imageDimensions)||void 0===s?void 0:s.width,height:null===(i=e.imageDimensions)||void 0===i?void 0:i.height})]})},G=function(e){var s=C.default.getFileNameWithExtensionFromPath(e.displayName||e.attachmentUrl),i=x(e.attachmentFileName,"inline"),o=x(e.attachmentFileName,"attachment"),r=v.getIsPreviewUnavailable(s);return y.jsxs("div",{className:q.cAttachmentFileWrapper,children:[y.jsxs("div",{className:D.default(q.cAttachmentFileDownloadWrapper,r&&e.classes.disabledPreview),style:M.fileDownloadWrapper,onClick:function(){r||e.openPreview()},children:[r?y.jsx(p.UnavailableFileIcon,{className:e.classes.unavailableFileIcon}):y.jsx(h,{fileName:e.displayName||e.attachmentUrl,className:q.cAttachmentFileDownloadWrapperFileIcon,size:e.small?25:50}),y.jsxs("div",{className:e.classes.titleContainer,children:[r&&y.jsx("div",{className:e.classes.caption,children:"Preview unavailable"}),y.jsx("div",{"data-testid":"".concat("Attachment","_name"),className:D.default(q.cAttachmentFileDownloadWrapperFileName,r&&e.classes.fileName),children:y.jsx(a.Typography,{variant:"subtitle2",noWrap:!0,className:e.classes.unavailableFileName,children:s})})]}),y.jsx(d,{fileUrl:i,classes:{root:e.classes.dialogRoot,paper:g.isNativeDetected?e.classes.nativeDialog:e.classes.dialog},fileName:s,fileSize:e.attachmentSize,onClose:e.closePreview,open:e.previewIsOpen})]}),y.jsx("a",{download:e.displayName,href:o,className:q.cAttachmentFileDownloadWrapperForm,children:y.jsx(I,{"data-testid":"".concat("Attachment","_downloadButton"),className:e.classes.downloadIcon,type:"submit",children:y.jsx(b.DownloadIcon,{size:24,className:e.classes.downloadIcon})})})]})};function _(e){var s=e.displayName,i=void 0===s?null:s,r=e.fileName,n=void 0===r?null:r,t=e.attachmentSize,c=void 0===t?void 0:t,a=e.size,l=void 0===a?V.label:a,u=e.small,m=void 0!==u&&u,d=R(R({},F.default(e,W)),{},{displayName:i,fileName:n,attachmentSize:c,size:l,small:m}),p=o.useState(void 0),j=N.default(p,2),h=j[0],I=j[1],v=o.useState(!1),b=N.default(v,2),C=b[0],w=b[1],P=o.useState(!1),O=N.default(P,2),D=O[0],S=O[1],z=d.displayName||d.attachmentUrl||d.fileName,k=f.getIsImage(z),U=f.getIsVideo(z),L=x(!d.attachmentUrl&&d.fileName),E=d.attachmentUrl||L,M=o.useCallback((function(e){return e.preventDefault()}),[]),_=o.useCallback((function(){g.isNativeDetected&&document.documentElement.addEventListener("touchmove",M,{passive:!1})}),[M]),H=o.useCallback((function(){g.isNativeDetected&&document.documentElement.removeEventListener("touchmove",M),w(!1)}),[M]),K=o.useCallback((function(){return w(!0)}),[]),Z=o.useCallback((function(e){var s=e.currentTarget,i=s.naturalWidth,o=s.naturalHeight;I({width:i,height:o})}),[]),J=o.useCallback((function(){return S(!0)}),[]),Q=o.useCallback((function(e){e.stopPropagation(),S(!1)}),[]);return k?y.jsx("div",{className:q.cAttachment,children:y.jsx(B,{size:d.size,openLightbox:K,attachmentFileName:d.fileName,attachmentUrl:d.attachmentUrl,onImageLoaded:Z,imageDimensions:h,lightboxIsOpen:C,handleLightboxOpen:_,handleLightboxClose:H,classes:d.classes})}):U&&A.default.canPlay(E)?y.jsx("div",{className:q.cAttachment,children:y.jsx(A.default,{"data-testid":"".concat("Attachment","_player"),className:q.cAttachmentReactPlayer,url:E,config:{file:{attributes:{preload:"metadata"}}},controls:!0,height:d.size===T.label?T.value:V.value,width:null})}):y.jsx("div",{className:q.cAttachment,children:y.jsx(G,{attachmentUrl:E,attachmentFileName:d.fileName,attachmentSize:d.attachmentSize,displayName:d.displayName,openPreview:J,closePreview:Q,previewIsOpen:D,classes:d.classes,small:d.small})})}_.propTypes={attachmentUrl:O.default.string.isRequired,attachmentSize:O.default.number,displayName:O.default.string,fileName:O.default.string,size:O.default.oneOf([T.label,V.label]),classes:O.default.shape({}).isRequired,small:O.default.bool};var H=c.withStyles((function(e){return{imageIconRoot:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},dialog:{width:"95%",height:"95%",maxWidth:"100%",position:"relative"},nativeDialog:{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",margin:0},dialogRoot:{backgroundColor:"rgba(0, 0, 0, 0.85)"},fileName:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:400},downloadIcon:{color:e.palette.primary.text3},disabledPreview:{backgroundColor:e.palette.primary.text9},unavailableFileIcon:{marginRight:12,minWidth:32},titleContainer:{display:"flex",flexDirection:"column",width:"100%"},caption:{fontSize:12,fontWeight:400,width:"fit-content"},unavailableFileName:{fontSize:12,fontWeight:400}}}))(_);module.exports=H;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Attachment/index.js"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactPlayer from 'react-player';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Typography } from '@material-ui/core';\nimport ImageIcon from '@material-ui/icons/Image';\nimport FullSizeIcon from '@material-ui/icons/Fullscreen';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { NewDocumentViewer } from '../NewDocumentViewer';\nimport { UnavailableFileIcon } from '../NewDocumentViewer/icons/UnavailableFileIcon';\nimport { ImageViewer } from '../../componentsV2/ImageViewer';\n\nimport styles from './styles.css';\n\nimport FileTypeIcon from '~components/FileTypeIcon';\nimport IconButton from '~components/IconButton';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport { getIsImage, getIsVideo } from '~/utils/fileExtension';\nimport { getIsPreviewUnavailable } from '~/utils/filePreview';\nimport { DownloadIcon } from '~/icons';\nimport { useSignedURL } from '~/effects';\nimport utils from '~utils/main';\n\nconst PAGE_NAME = 'Attachment';\n\nconst grey200 = grey[200];\nconst grey400 = grey[400];\n\nconst SIZES = {\n small: { label: 'small', value: 135 },\n medium: { label: 'medium', value: 300 },\n};\n\nconst style = {\n fileImage: (imageIsLoaded, size) => ({\n maxWidth: '100%',\n borderRadius: 4,\n overflow: 'hidden',\n // NOTE: Makes one-line comment with image fits into comments container. Equals to\n // imagePlaceholder height\n maxHeight: size === SIZES.small.label ? SIZES.small.value : SIZES.medium.value,\n display: imageIsLoaded ? 'initial' : 'none',\n cursor: 'pointer',\n }),\n fileDownloadWrapper: {\n padding: '10px 10px 10px 5px',\n border: `1px solid #616161`,\n borderRadius: 3,\n maxWidth: 500, // NOTE: Corresponds to react-player max width\n width: '75%',\n },\n imagePlaceholder: {\n position: 'relative',\n backgroundColor: grey200,\n borderRadius: 3,\n marginTop: 10,\n height: 135,\n width: 135,\n },\n};\n\nconst muiStyles = theme => ({\n imageIconRoot: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n },\n dialog: {\n width: '95%',\n height: '95%',\n maxWidth: '100%',\n position: 'relative',\n },\n nativeDialog: {\n width: '100%',\n height: '100%',\n maxWidth: '100%',\n maxHeight: '100%',\n margin: 0,\n },\n dialogRoot: {\n // NOTE: Make background color similar to lightbox\n backgroundColor: 'rgba(0, 0, 0, 0.85)',\n },\n fileName: {\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n fontWeight: 400,\n },\n downloadIcon: {\n color: theme.palette.primary.text3,\n },\n disabledPreview: {\n backgroundColor: theme.palette.primary.text9,\n },\n unavailableFileIcon: {\n marginRight: 12,\n minWidth: 32,\n },\n titleContainer: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n },\n caption: {\n fontSize: 12,\n fontWeight: 400,\n width: 'fit-content',\n },\n unavailableFileName: {\n fontSize: 12,\n fontWeight: 400,\n },\n});\n\n/* eslint-disable react/prop-types */\nconst ImageAttachment = props => {\n const downloadLink = useSignedURL(props.attachmentFileName) || props.attachmentUrl;\n\n return (\n <>\n <div onClick={props.openLightbox} className={styles.cAttachmentImg}>\n <img\n data-testid={`${PAGE_NAME}_image`}\n src={downloadLink}\n style={style.fileImage(!!props.imageDimensions, props.size)}\n alt=\"Attachment\"\n onLoad={props.onImageLoaded}\n />\n <div data-testid={`${PAGE_NAME}_button`} className={styles.cAttachmentImgPreviwBtn}>\n <FullSizeIcon />\n </div>\n </div>\n\n {!props.imageDimensions && (\n <div style={style.imagePlaceholder}>\n <ImageIcon\n data-testid={`${PAGE_NAME}_placeholder`}\n className={props.classes.imageIconRoot}\n htmlColor={grey400}\n fontSize=\"large\"\n />\n </div>\n )}\n\n {props.lightboxIsOpen && (\n <ImageViewer\n src={downloadLink}\n onClose={props.handleLightboxClose}\n onOpen={props.handleLightboxOpen}\n width={props.imageDimensions?.width}\n height={props.imageDimensions?.height}\n />\n )}\n </>\n );\n};\n\nconst FileAttachment = props => {\n const fileName = utils.getFileNameWithExtensionFromPath(props.displayName || props.attachmentUrl);\n\n const previewUrl = useSignedURL(props.attachmentFileName, 'inline');\n const downloadUrl = useSignedURL(props.attachmentFileName, 'attachment');\n\n const isPreviewUnavailable = getIsPreviewUnavailable(fileName);\n\n const handleFilePreviewOpen = () => {\n if (isPreviewUnavailable) return;\n props.openPreview();\n };\n\n return (\n <div className={styles.cAttachmentFileWrapper}>\n <div\n className={classNames(\n styles.cAttachmentFileDownloadWrapper,\n isPreviewUnavailable && props.classes.disabledPreview\n )}\n style={style.fileDownloadWrapper}\n onClick={handleFilePreviewOpen}\n >\n {isPreviewUnavailable ? (\n <UnavailableFileIcon className={props.classes.unavailableFileIcon} />\n ) : (\n <FileTypeIcon\n fileName={props.displayName || props.attachmentUrl}\n className={styles.cAttachmentFileDownloadWrapperFileIcon}\n size={props.small ? 25 : 50}\n />\n )}\n <div className={props.classes.titleContainer}>\n {isPreviewUnavailable && <div className={props.classes.caption}>Preview unavailable</div>}\n <div\n data-testid={`${PAGE_NAME}_name`}\n className={classNames(\n styles.cAttachmentFileDownloadWrapperFileName,\n isPreviewUnavailable && props.classes.fileName\n )}\n >\n <Typography variant=\"subtitle2\" noWrap className={props.classes.unavailableFileName}>\n {fileName}\n </Typography>\n </div>\n </div>\n <NewDocumentViewer\n fileUrl={previewUrl}\n classes={{\n root: props.classes.dialogRoot,\n paper: isNativeDetected ? props.classes.nativeDialog : props.classes.dialog,\n }}\n fileName={fileName}\n fileSize={props.attachmentSize}\n onClose={props.closePreview}\n open={props.previewIsOpen}\n />\n </div>\n <a\n download={props.displayName}\n href={downloadUrl}\n className={styles.cAttachmentFileDownloadWrapperForm}\n >\n <IconButton\n data-testid={`${PAGE_NAME}_downloadButton`}\n className={props.classes.downloadIcon}\n type=\"submit\"\n >\n <DownloadIcon size={24} className={props.classes.downloadIcon} />\n </IconButton>\n </a>\n </div>\n );\n};\n\n/* eslint-enable react/prop-types */\n\nfunction Attachment(rawProps) {\n const {\n displayName = null,\n fileName: attachmentFileName = null,\n attachmentSize = undefined,\n size = SIZES.medium.label,\n small = false,\n ...otherProps\n } = rawProps;\n const props = {\n ...otherProps,\n displayName,\n fileName: attachmentFileName,\n attachmentSize,\n size,\n small,\n };\n\n const [imageDimensions, setImageDimensions] = useState(undefined);\n const [isLightboxOpen, setIsLightboxOpen] = useState(false);\n const [isPreviewOpen, setIsPreviewOpen] = useState(false);\n\n const fileName = props.displayName || props.attachmentUrl || props.fileName;\n const isImage = getIsImage(fileName);\n const isVideo = getIsVideo(fileName);\n\n // Don't fetch download link if attachmentUrl is provided\n const downloadLink = useSignedURL(!props.attachmentUrl && props.fileName);\n const attachmentUrl = props.attachmentUrl || downloadLink;\n const preventIOSScroll = useCallback(e => e.preventDefault(), []);\n\n // NOTE: iOS WebView has a bug when background content of React Modal is scrollable\n // Source: https://github.com/reactjs/react-modal/issues/369\n const handleLightboxOpen = useCallback(() => {\n if (isNativeDetected) {\n // document.documentElement.style.overflowY = 'hidden';\n document.documentElement.addEventListener('touchmove', preventIOSScroll, {\n passive: false,\n });\n }\n }, [preventIOSScroll]);\n\n const handleLightboxClose = useCallback(() => {\n if (isNativeDetected) {\n // document.documentElement.style.overflowY = 'visible';\n document.documentElement.removeEventListener('touchmove', preventIOSScroll);\n }\n setIsLightboxOpen(false);\n }, [preventIOSScroll]);\n\n const openLightbox = useCallback(() => setIsLightboxOpen(true), []);\n const onImageLoaded = useCallback(e => {\n const { naturalWidth, naturalHeight } = e.currentTarget;\n setImageDimensions({ width: naturalWidth, height: naturalHeight });\n }, []);\n const openPreview = useCallback(() => setIsPreviewOpen(true), []);\n const closePreview = useCallback(e => {\n e.stopPropagation();\n setIsPreviewOpen(false);\n }, []);\n\n if (isImage)\n return (\n <div className={styles.cAttachment}>\n <ImageAttachment\n size={props.size}\n openLightbox={openLightbox}\n attachmentFileName={props.fileName}\n attachmentUrl={props.attachmentUrl}\n onImageLoaded={onImageLoaded}\n imageDimensions={imageDimensions}\n lightboxIsOpen={isLightboxOpen}\n handleLightboxOpen={handleLightboxOpen}\n handleLightboxClose={handleLightboxClose}\n classes={props.classes}\n />\n </div>\n );\n\n if (isVideo && ReactPlayer.canPlay(attachmentUrl))\n return (\n <div className={styles.cAttachment}>\n <ReactPlayer\n data-testid={`${PAGE_NAME}_player`}\n className={styles.cAttachmentReactPlayer}\n url={attachmentUrl}\n config={{ file: { attributes: { preload: 'metadata' } } }}\n controls\n height={props.size === SIZES.small.label ? SIZES.small.value : SIZES.medium.value}\n width={null}\n />\n </div>\n );\n\n return (\n <div className={styles.cAttachment}>\n <FileAttachment\n attachmentUrl={attachmentUrl}\n attachmentFileName={props.fileName}\n attachmentSize={props.attachmentSize}\n displayName={props.displayName}\n openPreview={openPreview}\n closePreview={closePreview}\n previewIsOpen={isPreviewOpen}\n classes={props.classes}\n small={props.small}\n />\n </div>\n );\n}\n\nAttachment.propTypes = {\n attachmentUrl: PropTypes.string.isRequired,\n attachmentSize: PropTypes.number,\n displayName: PropTypes.string,\n fileName: PropTypes.string,\n size: PropTypes.oneOf([SIZES.small.label, SIZES.medium.label]),\n classes: PropTypes.shape({}).isRequired,\n small: PropTypes.bool,\n};\n\nexport default withStyles(muiStyles)(Attachment);\n"],"names":["grey200","grey","grey400","SIZES","label","value","style","fileImage","imageIsLoaded","size","maxWidth","borderRadius","overflow","maxHeight","display","cursor","fileDownloadWrapper","padding","border","width","imagePlaceholder","position","backgroundColor","marginTop","height","ImageAttachment","props","_props$imageDimension","_props$imageDimension2","downloadLink","useSignedURL","attachmentFileName","attachmentUrl","_jsxs","_Fragment","children","jsxs","onClick","openLightbox","className","styles","cAttachmentImg","_jsx","jsx","concat","src","imageDimensions","alt","onLoad","onImageLoaded","cAttachmentImgPreviwBtn","FullSizeIcon","ImageIcon","classes","imageIconRoot","htmlColor","fontSize","lightboxIsOpen","ImageViewer","onClose","handleLightboxClose","onOpen","handleLightboxOpen","FileAttachment","fileName","utils","getFileNameWithExtensionFromPath","displayName","previewUrl","downloadUrl","isPreviewUnavailable","getIsPreviewUnavailable","cAttachmentFileWrapper","classNames","cAttachmentFileDownloadWrapper","disabledPreview","openPreview","UnavailableFileIcon","unavailableFileIcon","FileTypeIcon","cAttachmentFileDownloadWrapperFileIcon","small","titleContainer","caption","cAttachmentFileDownloadWrapperFileName","Typography","variant","noWrap","unavailableFileName","NewDocumentViewer","fileUrl","root","dialogRoot","paper","isNativeDetected","nativeDialog","dialog","fileSize","attachmentSize","closePreview","open","previewIsOpen","download","href","cAttachmentFileDownloadWrapperForm","IconButton","downloadIcon","type","DownloadIcon","Attachment","rawProps","_rawProps$displayName","_rawProps$fileName","_rawProps$attachmentS","undefined","_rawProps$size","_rawProps$small","_excluded","useState","_useState2","_slicedToArray","_useState","setImageDimensions","_useState4","_useState3","isLightboxOpen","setIsLightboxOpen","_useState6","_useState5","isPreviewOpen","setIsPreviewOpen","isImage","getIsImage","isVideo","getIsVideo","preventIOSScroll","useCallback","e","preventDefault","document","documentElement","addEventListener","passive","removeEventListener","currentTarget","naturalWidth","naturalHeight","stopPropagation","cAttachment","ReactPlayer","canPlay","cAttachmentReactPlayer","url","config","file","attributes","preload","controls","propTypes","PropTypes","string","isRequired","number","oneOf","shape","bool","Attachment$1","withStyles","theme","top","left","transform","margin","whiteSpace","textOverflow","fontWeight","color","palette","primary","text3","text9","marginRight","minWidth","flexDirection"],"mappings":"w+OAyBA,IAEMA,EAAUC,EAAAA,QAAK,KACfC,EAAUD,EAAAA,QAAK,KAEfE,EACG,CAAEC,MAAO,QAASC,MAAO,KAD5BF,EAEI,CAAEC,MAAO,SAAUC,MAAO,KAG9BC,EAAQ,CACZC,UAAW,SAACC,EAAeC,GAAI,MAAM,CACnCC,SAAU,OACVC,aAAc,EACdC,SAAU,SAGVC,UAAWJ,IAASN,EAAYC,MAAQD,EAAYE,MAAQF,EAAaE,MACzES,QAASN,EAAgB,UAAY,OACrCO,OAAQ,UACR,EACFC,oBAAqB,CACnBC,QAAS,qBACTC,OAA2B,oBAC3BP,aAAc,EACdD,SAAU,IACVS,MAAO,OAETC,iBAAkB,CAChBC,SAAU,WACVC,gBAAiBtB,EACjBW,aAAc,EACdY,UAAW,GACXC,OAAQ,IACRL,MAAO,MA6DLM,EAAkB,SAA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B,QACf4B,MAAOvD,EAAMuD,SAIrB,CAEA4B,EAAWiD,UAAY,CACrB9H,cAAe+H,EAAAA,QAAUC,OAAOC,WAChC/D,eAAgB6D,EAAS,QAACG,OAC1B/F,YAAa4F,EAAS,QAACC,OACvBhG,SAAU+F,EAAS,QAACC,OACpBvJ,KAAMsJ,EAAAA,QAAUI,MAAM,CAAChK,EAAYC,MAAOD,EAAaC,QACvDiD,QAAS0G,EAAS,QAACK,MAAM,CAAA,GAAIH,WAC7BhF,MAAO8E,EAAS,QAACM,MAGnB,IAAAC,EAAeC,cAzSG,SAAAC,GAAK,MAAK,CAC1BlH,cAAe,CACbjC,SAAU,WACVoJ,IAAK,MACLC,KAAM,MACNC,UAAW,yBAEb3E,OAAQ,CACN7E,MAAO,MACPK,OAAQ,MACRd,SAAU,OACVW,SAAU,YAEZ0E,aAAc,CACZ5E,MAAO,OACPK,OAAQ,OACRd,SAAU,OACVG,UAAW,OACX+J,OAAQ,GAEVhF,WAAY,CAEVtE,gBAAiB,uBAEnB0C,SAAU,CACRpD,SAAU,SACViK,WAAY,SACZC,aAAc,WACdC,WAAY,KAEdrE,aAAc,CACZsE,MAAOR,EAAMS,QAAQC,QAAQC,OAE/BxG,gBAAiB,CACfrD,gBAAiBkJ,EAAMS,QAAQC,QAAQE,OAEzCtG,oBAAqB,CACnBuG,YAAa,GACbC,SAAU,IAEZpG,eAAgB,CACdpE,QAAS,OACTyK,cAAe,SACfpK,MAAO,QAETgE,QAAS,CACP3B,SAAU,GACVuH,WAAY,IACZ5J,MAAO,eAETqE,oBAAqB,CACnBhC,SAAU,GACVuH,WAAY,KAEf,GAmPcR,CAAsB1D"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Attachment/index.js"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactPlayer from 'react-player';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Typography } from '@material-ui/core';\nimport ImageIcon from '@material-ui/icons/Image';\nimport FullSizeIcon from '@material-ui/icons/Fullscreen';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { NewDocumentViewer } from '../NewDocumentViewer';\nimport { UnavailableFileIcon } from '../NewDocumentViewer/icons/UnavailableFileIcon';\nimport { ImageViewer } from '../../componentsV2/ImageViewer';\n\nimport styles from './styles.css';\n\nimport FileTypeIcon from '~components/FileTypeIcon';\nimport IconButton from '~components/IconButton';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport { getIsImage, getIsVideo } from '~/utils/fileExtension';\nimport { getIsPreviewUnavailable } from '~/utils/filePreview';\nimport { DownloadIcon } from '~/icons';\nimport { useSignedURL } from '~/effects';\nimport utils from '~utils/main';\n\nconst PAGE_NAME = 'Attachment';\n\nconst grey200 = grey[200];\nconst grey400 = grey[400];\n\nconst SIZES = {\n small: { label: 'small', value: 135 },\n medium: { label: 'medium', value: 300 },\n};\n\nconst style = {\n fileImage: (imageIsLoaded, size) => ({\n maxWidth: '100%',\n borderRadius: 4,\n overflow: 'hidden',\n // NOTE: Makes one-line comment with image fits into comments container. Equals to\n // imagePlaceholder height\n maxHeight: size === SIZES.small.label ? SIZES.small.value : SIZES.medium.value,\n display: imageIsLoaded ? 'initial' : 'none',\n cursor: 'pointer',\n }),\n fileDownloadWrapper: {\n padding: '10px 10px 10px 5px',\n border: `1px solid #616161`,\n borderRadius: 3,\n maxWidth: 500, // NOTE: Corresponds to react-player max width\n width: '75%',\n },\n imagePlaceholder: {\n position: 'relative',\n backgroundColor: grey200,\n borderRadius: 3,\n marginTop: 10,\n height: 135,\n width: 135,\n },\n};\n\nconst muiStyles = theme => ({\n imageIconRoot: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n },\n dialog: {\n width: '95%',\n height: '95%',\n maxWidth: '100%',\n position: 'relative',\n },\n nativeDialog: {\n width: '100%',\n height: '100%',\n maxWidth: '100%',\n maxHeight: '100%',\n margin: 0,\n },\n dialogRoot: {\n // NOTE: Make background color similar to lightbox\n backgroundColor: 'rgba(0, 0, 0, 0.85)',\n },\n fileName: {\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n fontWeight: 400,\n },\n downloadIcon: {\n color: theme.palette.primary.text3,\n },\n disabledPreview: {\n backgroundColor: theme.palette.primary.text9,\n },\n unavailableFileIcon: {\n marginRight: 12,\n minWidth: 32,\n },\n titleContainer: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n },\n caption: {\n fontSize: 12,\n fontWeight: 400,\n width: 'fit-content',\n },\n unavailableFileName: {\n fontSize: 12,\n fontWeight: 400,\n },\n});\n\n/* eslint-disable react/prop-types */\nconst ImageAttachment = props => {\n const downloadLink = useSignedURL(props.attachmentFileName) || props.attachmentUrl;\n\n return (\n <>\n <div onClick={props.openLightbox} className={styles.cAttachmentImg}>\n <img\n data-testid={`${PAGE_NAME}_image`}\n src={downloadLink}\n style={style.fileImage(!!props.imageDimensions, props.size)}\n alt=\"Attachment\"\n onLoad={props.onImageLoaded}\n />\n <div data-testid={`${PAGE_NAME}_button`} className={styles.cAttachmentImgPreviwBtn}>\n <FullSizeIcon />\n </div>\n </div>\n\n {!props.imageDimensions && (\n <div style={style.imagePlaceholder}>\n <ImageIcon\n data-testid={`${PAGE_NAME}_placeholder`}\n className={props.classes.imageIconRoot}\n htmlColor={grey400}\n fontSize=\"large\"\n />\n </div>\n )}\n\n {props.lightboxIsOpen && (\n <ImageViewer\n src={downloadLink}\n onClose={props.handleLightboxClose}\n onOpen={props.handleLightboxOpen}\n width={props.imageDimensions?.width}\n height={props.imageDimensions?.height}\n />\n )}\n </>\n );\n};\n\nconst FileAttachment = props => {\n const fileName = utils.getFileNameWithExtensionFromPath(props.displayName || props.attachmentUrl);\n\n const previewUrl = useSignedURL(props.attachmentFileName, 'inline');\n const downloadUrl = useSignedURL(props.attachmentFileName, 'attachment');\n\n const isPreviewUnavailable = getIsPreviewUnavailable(fileName);\n\n const handleFilePreviewOpen = () => {\n if (isPreviewUnavailable) return;\n props.openPreview();\n };\n\n return (\n <div className={styles.cAttachmentFileWrapper}>\n <div\n className={classNames(\n styles.cAttachmentFileDownloadWrapper,\n isPreviewUnavailable && props.classes.disabledPreview\n )}\n style={style.fileDownloadWrapper}\n onClick={handleFilePreviewOpen}\n >\n {isPreviewUnavailable ? (\n <UnavailableFileIcon className={props.classes.unavailableFileIcon} />\n ) : (\n <FileTypeIcon\n fileName={props.displayName || props.attachmentUrl}\n className={styles.cAttachmentFileDownloadWrapperFileIcon}\n size={props.small ? 25 : 50}\n />\n )}\n <div className={props.classes.titleContainer}>\n {isPreviewUnavailable && <div className={props.classes.caption}>Preview unavailable</div>}\n <div\n data-testid={`${PAGE_NAME}_name`}\n className={classNames(\n styles.cAttachmentFileDownloadWrapperFileName,\n isPreviewUnavailable && props.classes.fileName\n )}\n >\n <Typography variant=\"subtitle2\" noWrap className={props.classes.unavailableFileName}>\n {fileName}\n </Typography>\n </div>\n </div>\n <NewDocumentViewer\n fileUrl={previewUrl}\n classes={{\n root: props.classes.dialogRoot,\n paper: isNativeDetected ? props.classes.nativeDialog : props.classes.dialog,\n }}\n fileName={fileName}\n fileSize={props.attachmentSize}\n onClose={props.closePreview}\n open={props.previewIsOpen}\n />\n </div>\n <a\n download={props.displayName}\n href={downloadUrl}\n className={styles.cAttachmentFileDownloadWrapperForm}\n >\n <IconButton\n data-testid={`${PAGE_NAME}_downloadButton`}\n className={props.classes.downloadIcon}\n type=\"submit\"\n >\n <DownloadIcon size={24} className={props.classes.downloadIcon} />\n </IconButton>\n </a>\n </div>\n );\n};\n\n/* eslint-enable react/prop-types */\n\nfunction Attachment(rawProps) {\n const {\n displayName = null,\n fileName: attachmentFileName = null,\n attachmentSize = undefined,\n size = SIZES.medium.label,\n small = false,\n ...otherProps\n } = rawProps;\n const props = {\n ...otherProps,\n displayName,\n fileName: attachmentFileName,\n attachmentSize,\n size,\n small,\n };\n\n const [imageDimensions, setImageDimensions] = useState(undefined);\n const [isLightboxOpen, setIsLightboxOpen] = useState(false);\n const [isPreviewOpen, setIsPreviewOpen] = useState(false);\n\n const fileName = props.displayName || props.attachmentUrl || props.fileName;\n const isImage = getIsImage(fileName);\n const isVideo = getIsVideo(fileName);\n\n // Don't fetch download link if attachmentUrl is provided\n const downloadLink = useSignedURL(!props.attachmentUrl && props.fileName);\n const attachmentUrl = props.attachmentUrl || downloadLink;\n const preventIOSScroll = useCallback(e => e.preventDefault(), []);\n\n // NOTE: iOS WebView has a bug when background content of React Modal is scrollable\n // Source: https://github.com/reactjs/react-modal/issues/369\n const handleLightboxOpen = useCallback(() => {\n if (isNativeDetected) {\n // document.documentElement.style.overflowY = 'hidden';\n document.documentElement.addEventListener('touchmove', preventIOSScroll, {\n passive: false,\n });\n }\n }, [preventIOSScroll]);\n\n const handleLightboxClose = useCallback(() => {\n if (isNativeDetected) {\n // document.documentElement.style.overflowY = 'visible';\n document.documentElement.removeEventListener('touchmove', preventIOSScroll);\n }\n setIsLightboxOpen(false);\n }, [preventIOSScroll]);\n\n const openLightbox = useCallback(() => setIsLightboxOpen(true), []);\n const onImageLoaded = useCallback(e => {\n const { naturalWidth, naturalHeight } = e.currentTarget;\n setImageDimensions({ width: naturalWidth, height: naturalHeight });\n }, []);\n const openPreview = useCallback(() => setIsPreviewOpen(true), []);\n const closePreview = useCallback(e => {\n e.stopPropagation();\n setIsPreviewOpen(false);\n }, []);\n\n if (isImage)\n return (\n <div className={styles.cAttachment}>\n <ImageAttachment\n size={props.size}\n openLightbox={openLightbox}\n attachmentFileName={props.fileName}\n attachmentUrl={props.attachmentUrl}\n onImageLoaded={onImageLoaded}\n imageDimensions={imageDimensions}\n lightboxIsOpen={isLightboxOpen}\n handleLightboxOpen={handleLightboxOpen}\n handleLightboxClose={handleLightboxClose}\n classes={props.classes}\n />\n </div>\n );\n\n if (isVideo && ReactPlayer.canPlay(attachmentUrl))\n return (\n <div className={styles.cAttachment}>\n <ReactPlayer\n data-testid={`${PAGE_NAME}_player`}\n className={styles.cAttachmentReactPlayer}\n url={attachmentUrl}\n config={{ file: { attributes: { preload: 'metadata' } } }}\n controls\n height={props.size === SIZES.small.label ? SIZES.small.value : SIZES.medium.value}\n width={null}\n />\n </div>\n );\n\n return (\n <div className={styles.cAttachment}>\n <FileAttachment\n attachmentUrl={attachmentUrl}\n attachmentFileName={props.fileName}\n attachmentSize={props.attachmentSize}\n displayName={props.displayName}\n openPreview={openPreview}\n closePreview={closePreview}\n previewIsOpen={isPreviewOpen}\n classes={props.classes}\n small={props.small}\n />\n </div>\n );\n}\n\nAttachment.propTypes = {\n attachmentUrl: PropTypes.string.isRequired,\n attachmentSize: PropTypes.number,\n displayName: PropTypes.string,\n fileName: PropTypes.string,\n size: PropTypes.oneOf([SIZES.small.label, SIZES.medium.label]),\n classes: PropTypes.shape({}).isRequired,\n small: PropTypes.bool,\n};\n\nexport default withStyles(muiStyles)(Attachment);\n"],"names":["grey200","grey","grey400","SIZES","label","value","style","fileImage","imageIsLoaded","size","maxWidth","borderRadius","overflow","maxHeight","display","cursor","fileDownloadWrapper","padding","border","width","imagePlaceholder","position","backgroundColor","marginTop","height","ImageAttachment","props","_props$imageDimension","_props$imageDimension2","downloadLink","useSignedURL","attachmentFileName","attachmentUrl","_jsxs","_Fragment","children","jsxs","onClick","openLightbox","className","styles","cAttachmentImg","_jsx","jsx","concat","src","imageDimensions","alt","onLoad","onImageLoaded","cAttachmentImgPreviwBtn","FullSizeIcon","ImageIcon","classes","imageIconRoot","htmlColor","fontSize","lightboxIsOpen","ImageViewer","onClose","handleLightboxClose","onOpen","handleLightboxOpen","FileAttachment","fileName","utils","getFileNameWithExtensionFromPath","displayName","previewUrl","downloadUrl","isPreviewUnavailable","getIsPreviewUnavailable","cAttachmentFileWrapper","classNames","cAttachmentFileDownloadWrapper","disabledPreview","openPreview","UnavailableFileIcon","unavailableFileIcon","FileTypeIcon","cAttachmentFileDownloadWrapperFileIcon","small","titleContainer","caption","cAttachmentFileDownloadWrapperFileName","Typography","variant","noWrap","unavailableFileName","NewDocumentViewer","fileUrl","root","dialogRoot","paper","isNativeDetected","nativeDialog","dialog","fileSize","attachmentSize","closePreview","open","previewIsOpen","download","href","cAttachmentFileDownloadWrapperForm","IconButton","downloadIcon","type","DownloadIcon","Attachment","rawProps","_rawProps$displayName","_rawProps$fileName","_rawProps$attachmentS","undefined","_rawProps$size","_rawProps$small","_excluded","useState","_useState2","_slicedToArray","_useState","setImageDimensions","_useState4","_useState3","isLightboxOpen","setIsLightboxOpen","_useState6","_useState5","isPreviewOpen","setIsPreviewOpen","isImage","getIsImage","isVideo","getIsVideo","preventIOSScroll","useCallback","e","preventDefault","document","documentElement","addEventListener","passive","removeEventListener","currentTarget","naturalWidth","naturalHeight","stopPropagation","cAttachment","ReactPlayer","canPlay","cAttachmentReactPlayer","url","config","file","attributes","preload","controls","propTypes","PropTypes","string","isRequired","number","oneOf","shape","bool","Attachment$1","withStyles","theme","top","left","transform","margin","whiteSpace","textOverflow","fontWeight","color","palette","primary","text3","text9","marginRight","minWidth","flexDirection"],"mappings":"6sQAyBA,IAEMA,EAAUC,EAAAA,QAAK,KACfC,EAAUD,EAAAA,QAAK,KAEfE,EACG,CAAEC,MAAO,QAASC,MAAO,KAD5BF,EAEI,CAAEC,MAAO,SAAUC,MAAO,KAG9BC,EAAQ,CACZC,UAAW,SAACC,EAAeC,GAAI,MAAM,CACnCC,SAAU,OACVC,aAAc,EACdC,SAAU,SAGVC,UAAWJ,IAASN,EAAYC,MAAQD,EAAYE,MAAQF,EAAaE,MACzES,QAASN,EAAgB,UAAY,OACrCO,OAAQ,UACR,EACFC,oBAAqB,CACnBC,QAAS,qBACTC,OAA2B,oBAC3BP,aAAc,EACdD,SAAU,IACVS,MAAO,OAETC,iBAAkB,CAChBC,SAAU,WACVC,gBAAiBtB,EACjBW,aAAc,EACdY,UAAW,GACXC,OAAQ,IACRL,MAAO,MA6DLM,EAAkB,SAAAC,GAAS,IAAAC,EAAAC,EACzBC,EAAeC,EAAaJ,EAA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UAAY,CACrB9H,cAAe+H,EAAAA,QAAUC,OAAOC,WAChC/D,eAAgB6D,EAAS,QAACG,OAC1B/F,YAAa4F,EAAS,QAACC,OACvBhG,SAAU+F,EAAS,QAACC,OACpBvJ,KAAMsJ,EAAAA,QAAUI,MAAM,CAAChK,EAAYC,MAAOD,EAAaC,QACvDiD,QAAS0G,EAAS,QAACK,MAAM,CAAA,GAAIH,WAC7BhF,MAAO8E,EAAS,QAACM,MAGnB,IAAAC,EAAeC,cAzSG,SAAAC,GAAK,MAAK,CAC1BlH,cAAe,CACbjC,SAAU,WACVoJ,IAAK,MACLC,KAAM,MACNC,UAAW,yBAEb3E,OAAQ,CACN7E,MAAO,MACPK,OAAQ,MACRd,SAAU,OACVW,SAAU,YAEZ0E,aAAc,CACZ5E,MAAO,OACPK,OAAQ,OACRd,SAAU,OACVG,UAAW,OACX+J,OAAQ,GAEVhF,WAAY,CAEVtE,gBAAiB,uBAEnB0C,SAAU,CACRpD,SAAU,SACViK,WAAY,SACZC,aAAc,WACdC,WAAY,KAEdrE,aAAc,CACZsE,MAAOR,EAAMS,QAAQC,QAAQC,OAE/BxG,gBAAiB,CACfrD,gBAAiBkJ,EAAMS,QAAQC,QAAQE,OAEzCtG,oBAAqB,CACnBuG,YAAa,GACbC,SAAU,IAEZpG,eAAgB,CACdpE,QAAS,OACTyK,cAAe,SACfpK,MAAO,QAETgE,QAAS,CACP3B,SAAU,GACVuH,WAAY,IACZ5J,MAAO,eAETqE,oBAAqB,CACnBhC,SAAU,GACVuH,WAAY,KAEf,GAmPcR,CAAsB1D"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/toArray"),a=require("@babel/runtime/regenerator"),n=require("react"),i=require("../../componentsV2/FileIcon/FileIcon.js"),s=require("../../componentsV2/Button/Button.js"),c=require("../../componentsV2/LoaderCircular/LoaderCircular.js"),o=require("../NewDocumentViewer/components/TextViewer.js"),u=require("../NewDocumentViewer/components/CsvViewer.js"),l=require("../NewDocumentViewer/components/PdfViewer.js"),d=require("../NewDocumentViewer/utils.js"),f=require("./downloadAttachment.js"),m=require("./AttachmentLightbox.scss.js"),p=require("../../utils/fetchAttachment.js"),x=require("../../utils/fileExtension.js"),h=require("../../utils/main.js"),b=require("react/jsx-runtime");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=v(e),j=v(t),k=v(r),q=v(a),N={pdf:"pdf",csv:"table",xlsx:"table",txt:"text",json:"text"},g=function(e){var t=k.default(e),r=t[0],a=void 0===r?[]:r,n=t.slice(1),i=function(e){var t=new Map;return e.map((function(e,r){var a,n=e||"Column ".concat(r+1),i=null!==(a=t.get(n))&&void 0!==a?a:0;return t.set(n,i+1),i?"".concat(n," (").concat(i+1,")"):n}))}(a);return n.map((function(e){return Object.fromEntries(i.map((function(t,r){var a;return[t,null!==(a=e[r])&&void 0!==a?a:""]})))}))},L=function(){var e=j.default(q.default.mark((function e(t,r){var a,n;return q.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("pdf"!==r){e.next=7;break}return e.next=3,p.fetchAttachment(t);case 3:return e.next=5,e.sent.blob();case 5:return n=e.sent,e.abrupt("return",URL.createObjectURL(n.type?n:new Blob([n],{type:"application/pdf"})));case 7:if("csv"!==r){e.next=9;break}return e.abrupt("return",d.getCsvData(t));case 9:if("xlsx"!==r){e.next=24;break}return e.t0=g,e.next=13,d.getXlsxData(t);case 13:if(e.t2=a=e.sent,e.t1=null!==e.t2,!e.t1){e.next=17;break}e.t1=void 0!==a;case 17:if(!e.t1){e.next=21;break}e.t3=a,e.next=22;break;case 21:e.t3=[];case 22:return e.t4=e.t3,e.abrupt("return",(0,e.t0)(e.t4));case 24:return e.abrupt("return",d.getTextData(t));case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),D=["pdf","text","table"];exports.AttachmentDocument=function(e){var t=e.item,r=h.default.getFileNameWithExtensionFromPath(t.name),a=x.getFileExtension(r),d=t.src||t.downloadUrl||"",p=N[a],v=function(e,t,r){var a=n.useState((function(){return{data:"",isLoading:!!e&&D.includes(r),hasFailed:!1}})),i=w.default(a,2),s=i[0],c=i[1];return n.useEffect((function(){if(e&&D.includes(r)){var a=!0;c({data:"",isLoading:!0,hasFailed:!1});var n="";return L(e,t).then((function(e){"pdf"===r&&(n=e),a?c({data:e,isLoading:!1,hasFailed:!1}):n&&URL.revokeObjectURL(n)})).catch((function(t){console.error('Failed to read attachment "'.concat(e,'"'),t),a&&c({data:"",isLoading:!1,hasFailed:!0})})),function(){a=!1,n&&URL.revokeObjectURL(n)}}c({data:"",isLoading:!1,hasFailed:!1})}),[e,t,r]),s}(d,a,p),k=v.data,g=v.isLoading,F=v.hasFailed;if(g)return b.jsx("div",{className:m.documentState,"data-testid":"attachment-preview-loading",children:b.jsx(c.LoaderCircular,{size:"medium"})});var V=!!d&&!F;if(V&&"pdf"===p)return b.jsx("div",{className:m.documentFrame,children:b.jsx(l.PdfViewer,{fileUrl:k,fileName:r})});if(V&&"table"===p)return b.jsx("div",{className:m.documentTable,children:b.jsx(u.CsvViewer,{fileData:k})});if(V&&"text"===p)return b.jsx("div",{className:m.documentText,children:b.jsx(o.TextViewer,{fileData:k})});var y=F||!d&&!!p;return b.jsxs("div",{className:m.documentState,"data-testid":"attachment-preview-fallback",children:[b.jsx(i.FileIcon,{name:r,size:48}),b.jsx("div",{className:m.fallbackName,children:r}),b.jsx("div",{className:m.fallbackHint,children:y?"This file could not be opened.":"No preview available for this file type."}),!(!t.downloadUrl&&!t.src)&&!t.hideDownload&&b.jsx("a",{href:t.downloadUrl||t.src,download:r,target:"_blank",rel:"noopener noreferrer",className:m.fallbackDownload,"data-testid":"attachment-preview-fallback-download",onClick:function(){var e=j.default(q.default.mark((function e(a){var n;return q.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.downloadUrl||t.src||"",a.preventDefault(),e.next=4,f.downloadAttachment(n,r);case 4:if(e.sent){e.next=6;break}f.openAttachmentInNewTab(n);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:b.jsx(s.Button,{type:"secondary",size:"medium",children:"Download"})})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/toArray"),a=require("@babel/runtime/regenerator"),n=require("react"),i=require("../../componentsV2/FileIcon/FileIcon.js"),s=require("../../componentsV2/Button/Button.js"),o=require("../../componentsV2/LoaderCircular/LoaderCircular.js"),c=require("../NewDocumentViewer/components/TextViewer.js"),u=require("../NewDocumentViewer/components/CsvViewer.js"),l=require("../NewDocumentViewer/components/PdfViewer.js"),d=require("../NewDocumentViewer/utils.js"),f=require("./downloadAttachment.js"),m=require("./AttachmentLightbox.scss.js"),p=require("../../utils/fetchAttachment.js"),x=require("../../utils/fileExtension.js"),h=require("../../utils/main.js"),b=require("react/jsx-runtime");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=v(e),j=v(t),k=v(r),q=v(a),N={pdf:"pdf",csv:"table",xlsx:"table",txt:"text",json:"text"},g=function(e){var t=k.default(e),r=t[0],a=void 0===r?[]:r,n=t.slice(1),i=function(e){var t=new Map;return e.map((function(e,r){var a,n=e||"Column ".concat(r+1),i=null!==(a=t.get(n))&&void 0!==a?a:0;return t.set(n,i+1),i?"".concat(n," (").concat(i+1,")"):n}))}(a);return n.map((function(e){return Object.fromEntries(i.map((function(t,r){var a;return[t,null!==(a=e[r])&&void 0!==a?a:""]})))}))},L=function(){var e=j.default(q.default.mark((function e(t,r){var a,n,i;return q.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("pdf"!==r){e.next=10;break}return e.next=3,p.fetchAttachment(t);case 3:if((n=e.sent).ok){e.next=6;break}throw new Error("Could not read the file (".concat(n.status,")"));case 6:return e.next=8,n.blob();case 8:return i=e.sent,e.abrupt("return",URL.createObjectURL("application/pdf"===i.type?i:new Blob([i],{type:"application/pdf"})));case 10:if("csv"!==r){e.next=12;break}return e.abrupt("return",d.getCsvData(t));case 12:if("xlsx"!==r){e.next=27;break}return e.t0=g,e.next=16,d.getXlsxData(t);case 16:if(e.t2=a=e.sent,e.t1=null!==e.t2,!e.t1){e.next=20;break}e.t1=void 0!==a;case 20:if(!e.t1){e.next=24;break}e.t3=a,e.next=25;break;case 24:e.t3=[];case 25:return e.t4=e.t3,e.abrupt("return",(0,e.t0)(e.t4));case 27:return e.abrupt("return",d.getTextData(t));case 28:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),D=["pdf","text","table"];exports.AttachmentDocument=function(e){var t=e.item,r=h.default.getFileNameWithExtensionFromPath(t.name),a=x.getFileExtension(r),d=t.src||t.downloadUrl||"",p=N[a],v=function(e,t,r){var a=n.useState((function(){return{data:"",isLoading:!!e&&D.includes(r),hasFailed:!1}})),i=w.default(a,2),s=i[0],o=i[1];return n.useEffect((function(){if(e&&D.includes(r)){var a=!0;o({data:"",isLoading:!0,hasFailed:!1});var n="";return L(e,t).then((function(e){"pdf"===r&&(n=e),a?o({data:e,isLoading:!1,hasFailed:!1}):n&&URL.revokeObjectURL(n)})).catch((function(t){console.error('Failed to read attachment "'.concat(e,'"'),t),a&&o({data:"",isLoading:!1,hasFailed:!0})})),function(){a=!1,n&&URL.revokeObjectURL(n)}}o({data:"",isLoading:!1,hasFailed:!1})}),[e,t,r]),s}(d,a,p),k=v.data,g=v.isLoading,F=v.hasFailed;if(g)return b.jsx("div",{className:m.documentState,"data-testid":"attachment-preview-loading",children:b.jsx(o.LoaderCircular,{size:"medium"})});var V=!!d&&!F;if(V&&"pdf"===p)return b.jsx("div",{className:m.documentFrame,children:b.jsx(l.PdfViewer,{fileUrl:k,fileName:r})});if(V&&"table"===p)return b.jsx("div",{className:m.documentTable,children:b.jsx(u.CsvViewer,{fileData:k})});if(V&&"text"===p)return b.jsx("div",{className:m.documentText,children:b.jsx(c.TextViewer,{fileData:k})});var y=F||!d&&!!p;return b.jsxs("div",{className:m.documentState,"data-testid":"attachment-preview-fallback",children:[b.jsx(i.FileIcon,{name:r,size:48}),b.jsx("div",{className:m.fallbackName,children:r}),b.jsx("div",{className:m.fallbackHint,children:y?"This file could not be opened.":"No preview available for this file type."}),!(!t.downloadUrl&&!t.src)&&!t.hideDownload&&b.jsx("a",{href:t.downloadUrl||t.src,download:r,target:"_blank",rel:"noopener noreferrer",className:m.fallbackDownload,"data-testid":"attachment-preview-fallback-download",onClick:function(){var e=j.default(q.default.mark((function e(a){var n;return q.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.downloadUrl||t.src||"",a.preventDefault(),e.next=4,f.downloadAttachment(n,r);case 4:if(e.sent){e.next=6;break}f.openAttachmentInNewTab(n);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:b.jsx(s.Button,{type:"secondary",size:"medium",children:"Download"})})]})};
2
2
  //# sourceMappingURL=AttachmentDocument.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentDocument.js","sources":["../../../../src/components/AttachmentLightbox/AttachmentDocument.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { FileIcon } from '../../componentsV2/FileIcon';\nimport { Button } from '../../componentsV2/Button';\nimport { LoaderCircular } from '../../componentsV2/LoaderCircular';\nimport { CsvViewer, PdfViewer, TextViewer } from '../NewDocumentViewer/components';\nimport { getCsvData, getTextData, getXlsxData } from '../NewDocumentViewer/utils';\nimport type { AttachmentPreviewItem } from '../AttachmentPreview/AttachmentPreview.types';\n\nimport { downloadAttachment, openAttachmentInNewTab } from './downloadAttachment';\n\nimport styles from './AttachmentLightbox.scss';\n\nimport { fetchAttachment } from '~/utils/fetchAttachment';\nimport { getFileExtension } from '~/utils/fileExtension';\nimport utils from '~/utils/main';\n\nconst RENDERERS = {\n pdf: 'pdf',\n csv: 'table',\n xlsx: 'table',\n txt: 'text',\n json: 'text',\n} as const;\n\ntype Renderer = typeof RENDERERS[keyof typeof RENDERERS];\n\ntype TableRow = Record<string, unknown>;\n\n/** The table viewer keys cells off the first row, so every column needs its own name. */\nconst toColumnNames = (header: string[]): string[] => {\n const seen = new Map<string, number>();\n\n return header.map((column, index) => {\n const name = column || `Column ${index + 1}`;\n const taken = seen.get(name) ?? 0;\n\n seen.set(name, taken + 1);\n\n return taken ? `${name} (${taken + 1})` : name;\n });\n};\n\nconst toTableRows = (rows: string[][]): TableRow[] => {\n const [header = [], ...body] = rows;\n const columns = toColumnNames(header);\n\n return body.map(row =>\n Object.fromEntries(columns.map((column, index) => [column, row[index] ?? '']))\n );\n};\n\nconst fetchData = async (src: string, extension: string) => {\n if (extension === 'pdf') {\n // The host serves this as a download, which navigates a frame to `about:blank` and shows\n // nothing. Holding the bytes ourselves lets the viewer render them whatever it was sent as.\n const blob = await (await fetchAttachment(src)).blob();\n\n return URL.createObjectURL(blob.type ? blob : new Blob([blob], { type: 'application/pdf' }));\n }\n if (extension === 'csv') return getCsvData(src);\n if (extension === 'xlsx') return toTableRows((await getXlsxData(src)) ?? []);\n\n return getTextData(src);\n};\n\nconst NEEDS_DATA: Renderer[] = ['pdf', 'text', 'table'];\nconst useDocumentData = (src: string, extension: string, renderer?: Renderer) => {\n const [state, setState] = useState<{\n data: string | TableRow[];\n isLoading: boolean;\n hasFailed: boolean;\n }>(() => ({\n data: '',\n isLoading: !!src && NEEDS_DATA.includes(renderer as Renderer),\n hasFailed: false,\n }));\n\n useEffect(() => {\n if (!src || !NEEDS_DATA.includes(renderer as Renderer)) {\n setState({ data: '', isLoading: false, hasFailed: false });\n\n return undefined;\n }\n\n let isActive = true;\n setState({ data: '', isLoading: true, hasFailed: false });\n\n let objectUrl = '';\n\n fetchData(src, extension)\n .then(data => {\n if (renderer === 'pdf') objectUrl = data as string;\n\n if (isActive) {\n setState({ data: data as string | TableRow[], isLoading: false, hasFailed: false });\n } else if (objectUrl) {\n URL.revokeObjectURL(objectUrl);\n }\n })\n .catch(error => {\n console.error(`Failed to read attachment \"${src}\"`, error);\n if (isActive) setState({ data: '', isLoading: false, hasFailed: true });\n });\n\n return () => {\n isActive = false;\n if (objectUrl) URL.revokeObjectURL(objectUrl);\n };\n }, [src, extension, renderer]);\n\n return state;\n};\n\nexport type AttachmentDocumentProps = {\n item: AttachmentPreviewItem;\n};\n\nexport const AttachmentDocument = ({ item }: AttachmentDocumentProps) => {\n const fileName = utils.getFileNameWithExtensionFromPath(item.name);\n const extension = getFileExtension(fileName);\n const src = item.src || item.downloadUrl || '';\n const renderer: Renderer | undefined = RENDERERS[extension as keyof typeof RENDERERS];\n\n const { data, isLoading, hasFailed } = useDocumentData(src, extension, renderer);\n\n if (isLoading) {\n return (\n <div className={styles.documentState} data-testid=\"attachment-preview-loading\">\n <LoaderCircular size=\"medium\" />\n </div>\n );\n }\n\n const isRenderable = !!src && !hasFailed;\n\n if (isRenderable && renderer === 'pdf') {\n return (\n <div className={styles.documentFrame}>\n <PdfViewer fileUrl={data as string} fileName={fileName} />\n </div>\n );\n }\n\n if (isRenderable && renderer === 'table') {\n return (\n <div className={styles.documentTable}>\n <CsvViewer fileData={data as TableRow[]} />\n </div>\n );\n }\n\n if (isRenderable && renderer === 'text') {\n return (\n <div className={styles.documentText}>\n <TextViewer fileData={data as string} />\n </div>\n );\n }\n\n const isUnopenable = hasFailed || (!src && !!renderer);\n\n return (\n <div className={styles.documentState} data-testid=\"attachment-preview-fallback\">\n <FileIcon name={fileName} size={48} />\n <div className={styles.fallbackName}>{fileName}</div>\n <div className={styles.fallbackHint}>\n {isUnopenable\n ? 'This file could not be opened.'\n : 'No preview available for this file type.'}\n </div>\n {!!(item.downloadUrl || item.src) && !item.hideDownload && (\n <a\n href={item.downloadUrl || item.src}\n download={fileName}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={styles.fallbackDownload}\n data-testid=\"attachment-preview-fallback-download\"\n onClick={async event => {\n const url = item.downloadUrl || item.src || '';\n event.preventDefault();\n\n if (!(await downloadAttachment(url, fileName))) openAttachmentInNewTab(url);\n }}\n >\n <Button type=\"secondary\" size=\"medium\">\n Download\n </Button>\n </a>\n )}\n </div>\n );\n};\n"],"names":["RENDERERS","pdf","csv","xlsx","txt","json","toTableRows","rows","_rows","_toArray","_rows$","header","body","slice","columns","seen","Map","map","column","index","_seen$get","name","taken","get","set","concat","toColumnNames","row","Object","fromEntries","_row$index","fetchData","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","src","extension","_yield$getXlsxData","blob","wrap","_context","prev","next","fetchAttachment","sent","abrupt","URL","createObjectURL","type","Blob","getCsvData","t0","getXlsxData","t2","t1","t3","t4","getTextData","stop","_x","_x2","apply","this","arguments","NEEDS_DATA","_ref2","item","fileName","utils","getFileNameWithExtensionFromPath","getFileExtension","downloadUrl","renderer","_useDocumentData","_useState","useState","data","isLoading","includes","hasFailed","_useState2","_slicedToArray","state","setState","useEffect","isActive","objectUrl","then","revokeObjectURL","catch","error","console","useDocumentData","_jsx","className","styles","documentState","children","LoaderCircular","size","isRenderable","documentFrame","PdfViewer","fileUrl","documentTable","CsvViewer","fileData","documentText","TextViewer","isUnopenable","_jsxs","FileIcon","jsx","fallbackName","fallbackHint","hideDownload","href","download","target","rel","fallbackDownload","onClick","_ref3","event","url","_context2","preventDefault","downloadAttachment","openAttachmentInNewTab","_callee2","_x3","Button"],"mappings":"o+BAiBMA,EAAY,CAChBC,IAAK,MACLC,IAAK,QACLC,KAAM,QACNC,IAAK,OACLC,KAAM,QAqBFC,EAAc,SAACC,GACnB,IAAAC,EAAAC,EAAA,QAA+BF,GAAIG,EAAAF,EAAA,GAA5BG,aAAS,GAAED,EAAKE,EAAIJ,EAAAK,MAAA,GACrBC,EAfc,SAACH,GACrB,IAAMI,EAAO,IAAIC,IAEjB,OAAOL,EAAOM,KAAI,SAACC,EAAQC,GAAU,IAAAC,EAC7BC,EAAOH,oBAAoBC,EAAQ,G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D,EAAUgC,KAAM,KAChCN,EAAAmB,IAAA,MAAA,CAAKlB,UAAWC,EAAOkB,aAAahB,SAAE9B,IACtC0B,EAAAmB,IAAA,MAAA,CAAKlB,UAAWC,EAAOmB,aAAajB,SACjCY,EACG,iCACA,gDAEF3C,EAAKK,cAAeL,EAAK/B,OAAS+B,EAAKiD,cACzCtB,EAAAA,IAAA,IAAA,CACEuB,KAAMlD,EAAKK,aAAeL,EAAK/B,IAC/BkF,SAAUlD,EACVmD,OAAO,SACPC,IAAI,sBACJzB,UAAWC,EAAOyB,iBAClB,cAAY,uCACZC,QAAO,WAAA,IAAAC,EAAA3F,EAAAA,QAAAC,EAAAA,QAAAC,MAAE,WAAM0F,GAAK,IAAAC,EAAA,OAAA5F,UAAAO,MAAA,SAAAsF,GAAA,OAAA,OAAAA,EAAApF,KAAAoF,EAAAnF,MAAA,KAAA,EAEK,OADjBkF,EAAM1D,EAAKK,aAAeL,EAAK/B,KAAO,GAC5CwF,EAAMG,iBAAiBD,EAAAnF,KAAA,EAEXqF,EAAkBA,mBAACH,EAAKzD,GAAS,KAAA,EAAA,GAAA0D,EAAAjF,KAAA,CAAAiF,EAAAnF,KAAA,EAAA,KAAA,CAAGsF,EAAsBA,uBAACJ,GAAK,KAAA,EAAA,IAAA,MAAA,OAAAC,EAAAnE,OAAA,GAAAuE,EAC7E,KAAA,OAAA,SAAAC,GAAA,OAAAR,EAAA7D,MAAAC,KAAAC,UAAA,EALM,GAKLkC,SAEFJ,MAACsC,SAAM,CAACnF,KAAK,YAAYmD,KAAK,SAAQF,SAAA,iBAOhD"}
1
+ {"version":3,"file":"AttachmentDocument.js","sources":["../../../../src/components/AttachmentLightbox/AttachmentDocument.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { FileIcon } from '../../componentsV2/FileIcon';\nimport { Button } from '../../componentsV2/Button';\nimport { LoaderCircular } from '../../componentsV2/LoaderCircular';\nimport { CsvViewer, PdfViewer, TextViewer } from '../NewDocumentViewer/components';\nimport { getCsvData, getTextData, getXlsxData } from '../NewDocumentViewer/utils';\nimport type { AttachmentPreviewItem } from '../AttachmentPreview/AttachmentPreview.types';\n\nimport { downloadAttachment, openAttachmentInNewTab } from './downloadAttachment';\n\nimport styles from './AttachmentLightbox.scss';\n\nimport { fetchAttachment } from '~/utils/fetchAttachment';\nimport { getFileExtension } from '~/utils/fileExtension';\nimport utils from '~/utils/main';\n\nconst RENDERERS = {\n pdf: 'pdf',\n csv: 'table',\n xlsx: 'table',\n txt: 'text',\n json: 'text',\n} as const;\n\ntype Renderer = typeof RENDERERS[keyof typeof RENDERERS];\n\ntype TableRow = Record<string, unknown>;\n\n/** The table viewer keys cells off the first row, so every column needs its own name. */\nconst toColumnNames = (header: string[]): string[] => {\n const seen = new Map<string, number>();\n\n return header.map((column, index) => {\n const name = column || `Column ${index + 1}`;\n const taken = seen.get(name) ?? 0;\n\n seen.set(name, taken + 1);\n\n return taken ? `${name} (${taken + 1})` : name;\n });\n};\n\nconst toTableRows = (rows: string[][]): TableRow[] => {\n const [header = [], ...body] = rows;\n const columns = toColumnNames(header);\n\n return body.map(row =>\n Object.fromEntries(columns.map((column, index) => [column, row[index] ?? '']))\n );\n};\n\nconst PDF_MIME_TYPE = 'application/pdf';\n\nconst fetchData = async (src: string, extension: string) => {\n if (extension === 'pdf') {\n // The host serves this as a download, which navigates a frame to `about:blank` and shows\n // nothing. Holding the bytes ourselves lets the viewer render them whatever it was sent as.\n const response = await fetchAttachment(src);\n\n // A refused read answers with an XML error page; retyped below it would reach the viewer as\n // a \"pdf\" instead of the failure fallback.\n if (!response.ok) throw new Error(`Could not read the file (${response.status})`);\n\n const blob = await response.blob();\n\n // The frame renders a blob by its type alone: pipeline uploads (stage reports, PJRs) sit in\n // S3 as `application/octet-stream`, which the frame downloads instead of showing — so the\n // extension decides, not the header.\n return URL.createObjectURL(\n blob.type === PDF_MIME_TYPE ? blob : new Blob([blob], { type: PDF_MIME_TYPE })\n );\n }\n if (extension === 'csv') return getCsvData(src);\n if (extension === 'xlsx') return toTableRows((await getXlsxData(src)) ?? []);\n\n return getTextData(src);\n};\n\nconst NEEDS_DATA: Renderer[] = ['pdf', 'text', 'table'];\nconst useDocumentData = (src: string, extension: string, renderer?: Renderer) => {\n const [state, setState] = useState<{\n data: string | TableRow[];\n isLoading: boolean;\n hasFailed: boolean;\n }>(() => ({\n data: '',\n isLoading: !!src && NEEDS_DATA.includes(renderer as Renderer),\n hasFailed: false,\n }));\n\n useEffect(() => {\n if (!src || !NEEDS_DATA.includes(renderer as Renderer)) {\n setState({ data: '', isLoading: false, hasFailed: false });\n\n return undefined;\n }\n\n let isActive = true;\n setState({ data: '', isLoading: true, hasFailed: false });\n\n let objectUrl = '';\n\n fetchData(src, extension)\n .then(data => {\n if (renderer === 'pdf') objectUrl = data as string;\n\n if (isActive) {\n setState({ data: data as string | TableRow[], isLoading: false, hasFailed: false });\n } else if (objectUrl) {\n URL.revokeObjectURL(objectUrl);\n }\n })\n .catch(error => {\n console.error(`Failed to read attachment \"${src}\"`, error);\n if (isActive) setState({ data: '', isLoading: false, hasFailed: true });\n });\n\n return () => {\n isActive = false;\n if (objectUrl) URL.revokeObjectURL(objectUrl);\n };\n }, [src, extension, renderer]);\n\n return state;\n};\n\nexport type AttachmentDocumentProps = {\n item: AttachmentPreviewItem;\n};\n\nexport const AttachmentDocument = ({ item }: AttachmentDocumentProps) => {\n const fileName = utils.getFileNameWithExtensionFromPath(item.name);\n const extension = getFileExtension(fileName);\n const src = item.src || item.downloadUrl || '';\n const renderer: Renderer | undefined = RENDERERS[extension as keyof typeof RENDERERS];\n\n const { data, isLoading, hasFailed } = useDocumentData(src, extension, renderer);\n\n if (isLoading) {\n return (\n <div className={styles.documentState} data-testid=\"attachment-preview-loading\">\n <LoaderCircular size=\"medium\" />\n </div>\n );\n }\n\n const isRenderable = !!src && !hasFailed;\n\n if (isRenderable && renderer === 'pdf') {\n return (\n <div className={styles.documentFrame}>\n <PdfViewer fileUrl={data as string} fileName={fileName} />\n </div>\n );\n }\n\n if (isRenderable && renderer === 'table') {\n return (\n <div className={styles.documentTable}>\n <CsvViewer fileData={data as TableRow[]} />\n </div>\n );\n }\n\n if (isRenderable && renderer === 'text') {\n return (\n <div className={styles.documentText}>\n <TextViewer fileData={data as string} />\n </div>\n );\n }\n\n const isUnopenable = hasFailed || (!src && !!renderer);\n\n return (\n <div className={styles.documentState} data-testid=\"attachment-preview-fallback\">\n <FileIcon name={fileName} size={48} />\n <div className={styles.fallbackName}>{fileName}</div>\n <div className={styles.fallbackHint}>\n {isUnopenable\n ? 'This file could not be opened.'\n : 'No preview available for this file type.'}\n </div>\n {!!(item.downloadUrl || item.src) && !item.hideDownload && (\n <a\n href={item.downloadUrl || item.src}\n download={fileName}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={styles.fallbackDownload}\n data-testid=\"attachment-preview-fallback-download\"\n onClick={async event => {\n const url = item.downloadUrl || item.src || '';\n event.preventDefault();\n\n if (!(await downloadAttachment(url, fileName))) openAttachmentInNewTab(url);\n }}\n >\n <Button type=\"secondary\" size=\"medium\">\n Download\n </Button>\n </a>\n )}\n </div>\n );\n};\n"],"names":["RENDERERS","pdf","csv","xlsx","txt","json","toTableRows","rows","_rows","_toArray","_rows$","header","body","slice","columns","seen","Map","map","column","index","_seen$get","name","taken","get","set","concat","toColumnNames","row","Object","fromEntries","_row$index","fetchData","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","src","extension","_yield$getXlsxData","response","blob","wrap","_context","prev","next","fetchAttachment","sent","ok","Error","status","abrupt","URL","createObjectURL","type","Blob","getCsvData","t0","getXlsxData","t2","t1","t3","t4","getTextData","stop","_x","_x2","apply","this","arguments","NEEDS_DATA","_ref2","item","fileName","utils","getFileNameWithExtensionFromPath","getFileExtension","downloadUrl","renderer","_useDocumentData","_useState","useState","data","isLoading","includes","hasFailed","_useState2","_slicedToArray","state","setState","useEffect","isActive","objectUrl","then","revokeObjectURL","catch","error","console","useDocumentData","_jsx","className","styles","documentState","children","LoaderCircular","size","isRenderable","documentFrame","PdfViewer","fileUrl","documentTable","CsvViewer","fileData","documentText","TextViewer","isUnopenable","_jsxs","FileIcon","jsx","fallbackName","fallbackHint","hideDownload","href","download","target","rel","fallbackDownload","onClick","_ref3","event","url","_context2","preventDefault","downloadAttachment","openAttachmentInNewTab","_callee2","_x3","Button"],"mappings":"o+BAiBMA,EAAY,CAChBC,IAAK,MACLC,IAAK,QACLC,KAAM,QACNC,IAAK,OACLC,KAAM,QAqBFC,EAAc,SAACC,GACnB,IAAAC,EAAAC,EAAA,QAA+BF,GAAIG,EAAAF,EAAA,GAA5BG,aAAS,GAAED,EAAKE,EAAIJ,EAAAK,MAAA,GACrBC,EAfc,SAACH,GACrB,IAAMI,EAAO,IAAIC,IAEjB,OAAOL,EAAOM,KAAI,SAACC,EAAQC,GAAU,IAAAC,EAC7BC,EAAOH,oBAAoBC,EAAQ,GACnCG,EAAsB,UAAdP,EAAKQ,IAAIF,UAAK,IAAAD,EAAAA,EAAI,EAIhC,OAFAL,EAAKS,IAAIH,EAAMC,EAAQ,GAEhBA,YAAWD,EAAI,MAAAI,OAAKH,EAAQ,OAAOD,CAC5C,GACF,CAIkBK,CAAcf,GAE9B,OAAOC,EAAKK,KAAI,SAAAU,GAAG,OACjBC,OAAOC,YAAYf,EAAQG,KAAI,SAACC,EAAQC,GAAK,IAAAW,EAAA,MAAK,CAACZ,EAAsB,QAAdS,EAAAA,EAAIR,UAAU,IAAAW,EAAAA,EAAA,GAAG,OAEhF,EAIMC,EAAS,WAAA,IAAGC,EAAAC,EAAAA,QAAAC,EAAA,QAAAC,MAAA,SAAAC,EAAOC,EAAaC,GAAiB,IAAAC,EAAAC,EAAAC,EAAA,OAAAP,UAAAQ,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,GACnC,QAAdP,EAAmB,CAAAK,EAAAE,KAAA,GAAA,KAAA,CAAA,OAAAF,EAAAE,KAAA,EAGE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AAAA,EAAAvF,KAAAuF,EAAAtF,MAAA,KAAA,EAEK,OADjBqF,EAAM1D,EAAKK,aAAeL,EAAKnC,KAAO,GAC5C4F,EAAMG,iBAAiBD,EAAAtF,KAAA,EAEXwF,EAAkBA,mBAACH,EAAKzD,GAAS,KAAA,EAAA,GAAA0D,EAAApF,KAAA,CAAAoF,EAAAtF,KAAA,EAAA,KAAA,CAAGyF,EAAsBA,uBAACJ,GAAK,KAAA,EAAA,IAAA,MAAA,OAAAC,EAAAnE,OAAA,GAAAuE,EAC7E,KAAA,OAAA,SAAAC,GAAA,OAAAR,EAAA7D,MAAAC,KAAAC,UAAA,EALM,GAKLkC,SAEFJ,MAACsC,SAAM,CAACnF,KAAK,YAAYmD,KAAK,SAAQF,SAAA,iBAOhD"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),t=require("prop-types"),u=require("lodash"),n=require("./Map.css.js"),a=require("../../../../utils/index.js"),l=require("../../../../utils/createAdaptiveRoot.js");require("../../../../config/mapboxGl/index.js");var o=require("../../../../config/mapbox/index.js");require("mapbox-gl/dist/mapbox-gl.css");var i=require("react/jsx-runtime"),c=require("mapbox-gl");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=s(e),f=s(t),p=s(c),v=[29.749907,-95.358421],m="wells-highlight",g={type:"FeatureCollection",features:[]},y=function(e){var r=d.default(e,2),t=r[0];return[r[1],t]};function h(e){var t=e.subjectWell,c=void 0===t?null:t,s=e.wells,f=e.offsetWells,h=void 0===f?null:f,x=e.radius,j=e.subjectWellMarkerSize,S=void 0===j?b:j,q=e.wellMarkerSize,M=void 0===q?w:q,C=e.coordsDataPath,R=void 0===C?"settings.top_hole.coordinates":C,D=r.useRef(null),F=r.useRef(null),P=r.useRef(null),E=r.useRef(null),L=r.useRef(null),W=r.useRef(null),k=r.useRef(),z=r.useState(!1),B=d.default(z,2),A=B[0],I=B[1],N=r.useMemo((function(){return c&&u.get(c,R)}),[c,R]);r.useEffect((function(){if(o.IS_MAPBOX_ENABLED){F.current=new p.default.Map({container:D.current,style:"mapbox://styles/mapbox/dark-v9",center:y(v),zoom:1,attributionControl:!1,scrollZoom:!1}),F.current.addControl(new p.default.NavigationControl({showCompass:!1}),"bottom-right"),F.current.on("load",(function(){F.current.addSource("radius-circle",{type:"geojson",data:g}),F.current.addLayer({id:"radius-circle",type:"fill",source:"radius-circle",paint:{"fill-color":"#03BCD4","fill-opacity":.2}}),F.current.addSource("wells",{type:"geojson",data:g}),F.current.addLayer({id:"wells",type:"circle",source:"wells",paint:{"circle-radius":["get","radius"],"circle-color":"#FFC107","circle-opacity":["get","opacity"]}}),F.current.addSource(m,{type:"geojson",data:g}),F.current.addLayer({id:m,type:"circle",source:m,paint:{"circle-radius":["get","radius"],"circle-color":"#FFC107","circle-opacity":.2}}),I(!0)}));var e=F.current;return function(){var r;null===(r=L.current)||void 0===r||r.unmount(),L.current=null,W.current=null,e.remove(),F.current=null,P.current=null}}}),[]),r.useEffect((function(){if(F.current&&A)if(N){var e=function(e,r){for(var t=d.default(e,2),u=t[0],n=t[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,l=[],o=r/(111320*Math.cos(u*Math.PI/180)),i=r/110574,c=0;c<=a;c+=1){var s=c/a*(2*Math.PI);l.push([n+o*Math.cos(s),u+i*Math.sin(s)])}return l}(N,1609.34*x);F.current.getSource("radius-circle").setData({type:"Feature",geometry:{type:"Polygon",coordinates:[e]}})}else F.current.getSource("radius-circle").setData(g)}),[x,N,A]);return r.useEffect((function(){var e;if(F.current&&A){var t=k.current;k.current=s,null===(e=E.current)||void 0===e||e.remove(),F.current.getSource(m).setData(g);var n=h.map((function(e){return e.id})),o=[],d={},f=new p.default.LngLatBounds;s.forEach((function(e){var r=u.get(e,R);if(r&&a.mapbox.isValidCoordinates(r)){var t=c&&c.id===e.id,l=n.includes(e.id),i=t?S:M,s=t||l?1:.3;d[e.id]=e,f.extend(y(r)),o.push({type:"Feature",geometry:{type:"Point",coordinates:y(r)},properties:{wellId:e.id,radius:i,opacity:s}})}})),F.current.getSource("wells").setData({type:"FeatureCollection",features:o}),P.current=o.length?f:null;var v=F.current,b=null,w=function(e){v.getCanvas().style.cursor="pointer";var t=d[e.features[0].properties.wellId];if(t&&t.id!==b){b=t.id;var n=u.get(t,R);W.current||(W.current=document.createElement("div"),L.current=l.createAdaptiveRoot(W.current)),L.current.render(r.createElement((function(e){var r=e.well;return i.jsx("div",{style:{color:"#fff",background:"##414141"},children:i.jsx("span",{style:{fontSize:"11px",lineHeight:"16px"},children:u.get(r,"name")})})}),{well:t})),E.current||(E.current=new p.default.Popup({closeButton:!1,maxWidth:"none"})),E.current.setLngLat(y(n)).setDOMContent(W.current).addTo(v),function(e,r){F.current.getSource(m).setData({type:"Feature",geometry:{type:"Point",coordinates:y(e)},properties:{radius:3*r}})}(n,e.features[0].properties.radius)}},x=function(){var e;b=null,v.getCanvas().style.cursor="",v.getSource(m).setData(g),null===(e=E.current)||void 0===e||e.remove()},j=function(e){null!=e&&e.point&&v.queryRenderedFeatures(e.point,{layers:[m]}).length||x()};return v.on("mousemove","wells",w),v.on("mouseleave","wells",j),v.on("mouseleave",m,x),setTimeout((function(){F.current&&P.current&&s!==t&&F.current.fitBounds(P.current)}),500),function(){v.off("mousemove","wells",w),v.off("mouseleave","wells",j),v.off("mouseleave",m,x)}}}),[c,s,h,A]),i.jsx("div",{className:n.map,children:i.jsx("div",{className:n.mapMain,ref:D})})}h.propTypes={subjectWell:f.default.shape({id:f.default.number,formation:f.default.string}),wells:f.default.arrayOf(f.default.shape({})).isRequired,offsetWells:f.default.arrayOf(f.default.shape({})),radius:f.default.number.isRequired,subjectWellMarkerSize:f.default.number,wellMarkerSize:f.default.number,coordsDataPath:f.default.string};var b=8,w=5,x=r.memo(h);module.exports=x;
1
+ "use strict";var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),t=require("prop-types"),u=require("lodash"),s=require("./Map.css.js");require("../../../UserMention/utils/index.js"),require("@babel/runtime/helpers/defineProperty"),require("../../../../utils/convert.js"),require("../../../../constants/completion.js"),require("moment"),require("../../../../constants/alerts.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../../../utils/casing/validation.js"),require("lodash/mean"),require("../../../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),require("query-string"),require("../../../../constants/goals.js"),require("../../../../constants/segment.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js"),require("../../../../constants/corvaCompanyId.js"),require("../../../GradientManager/configuration/constants.js"),require("../../../../utils/drillstring/conversion.js"),require("lodash/set"),require("lodash/cloneDeep"),require("@babel/runtime/helpers/toConsumableArray"),require("lodash/isNumber"),require("lodash/has"),require("../../../../utils/ga.js"),require("../../../../utils/goalsConfig/goalsConfig.js"),require("../../../../utils/lasParser.js"),require("../../../../utils/main.js");var i=require("../../../../utils/mapbox.js");require("../../../../utils/metrics/metricsConfig.js"),require("../../../../utils/mobileDetect.js"),require("../../../../utils/feed.js"),require("../../../../utils/reports.js"),require("moment-timezone"),require("@babel/runtime/helpers/typeof"),require("../../../../utils/dashboardReports.js"),require("../../../../utils/env.js"),require("file-extension"),require("image-extensions"),require("video-extensions"),require("../../../../utils/jsonaDataFormatter.js"),require("../../../../utils/bha.js"),require("jsona"),require("../../../../clients/jsonApi/index.js"),require("@babel/runtime/helpers/objectWithoutProperties"),require("classnames"),require("../../../../utils/charts/Styles.scss.js"),require("../../../../utils/getSingleAsset.js");var n=require("../../../../utils/createAdaptiveRoot.js");require("../../../../config/mapboxGl/index.js");var a=require("../../../../config/mapbox/index.js");require("mapbox-gl/dist/mapbox-gl.css");var o=require("react/jsx-runtime"),l=require("mapbox-gl");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(e),f=c(t),p=c(l),m=[29.749907,-95.358421],q="wells-highlight",g={type:"FeatureCollection",features:[]},v=function(e){var r=d.default(e,2),t=r[0];return[r[1],t]};function j(e){var t=e.subjectWell,l=void 0===t?null:t,c=e.wells,f=e.offsetWells,j=void 0===f?null:f,b=e.radius,x=e.subjectWellMarkerSize,w=void 0===x?y:x,S=e.wellMarkerSize,C=void 0===S?h:S,M=e.coordsDataPath,D=void 0===M?"settings.top_hole.coordinates":M,P=r.useRef(null),R=r.useRef(null),F=r.useRef(null),A=r.useRef(null),E=r.useRef(null),L=r.useRef(null),W=r.useRef(),k=r.useState(!1),z=d.default(k,2),B=z[0],I=z[1],T=r.useMemo((function(){return l&&u.get(l,D)}),[l,D]);r.useEffect((function(){if(a.IS_MAPBOX_ENABLED){R.current=new p.default.Map({container:P.current,style:"mapbox://styles/mapbox/dark-v9",center:v(m),zoom:1,attributionControl:!1,scrollZoom:!1}),R.current.addControl(new p.default.NavigationControl({showCompass:!1}),"bottom-right"),R.current.on("load",(function(){R.current.addSource("radius-circle",{type:"geojson",data:g}),R.current.addLayer({id:"radius-circle",type:"fill",source:"radius-circle",paint:{"fill-color":"#03BCD4","fill-opacity":.2}}),R.current.addSource("wells",{type:"geojson",data:g}),R.current.addLayer({id:"wells",type:"circle",source:"wells",paint:{"circle-radius":["get","radius"],"circle-color":"#FFC107","circle-opacity":["get","opacity"]}}),R.current.addSource(q,{type:"geojson",data:g}),R.current.addLayer({id:q,type:"circle",source:q,paint:{"circle-radius":["get","radius"],"circle-color":"#FFC107","circle-opacity":.2}}),I(!0)}));var e=R.current;return function(){var r;null===(r=E.current)||void 0===r||r.unmount(),E.current=null,L.current=null,e.remove(),R.current=null,F.current=null}}}),[]),r.useEffect((function(){if(R.current&&B)if(T){var e=function(e,r){for(var t=d.default(e,2),u=t[0],s=t[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,n=[],a=r/(111320*Math.cos(u*Math.PI/180)),o=r/110574,l=0;l<=i;l+=1){var c=l/i*(2*Math.PI);n.push([s+a*Math.cos(c),u+o*Math.sin(c)])}return n}(T,1609.34*b);R.current.getSource("radius-circle").setData({type:"Feature",geometry:{type:"Polygon",coordinates:[e]}})}else R.current.getSource("radius-circle").setData(g)}),[b,T,B]);return r.useEffect((function(){var e;if(R.current&&B){var t=W.current;W.current=c,null===(e=A.current)||void 0===e||e.remove(),R.current.getSource(q).setData(g);var s=j.map((function(e){return e.id})),a=[],d={},f=new p.default.LngLatBounds;c.forEach((function(e){var r=u.get(e,D);if(r&&i.isValidCoordinates(r)){var t=l&&l.id===e.id,n=s.includes(e.id),o=t?w:C,c=t||n?1:.3;d[e.id]=e,f.extend(v(r)),a.push({type:"Feature",geometry:{type:"Point",coordinates:v(r)},properties:{wellId:e.id,radius:o,opacity:c}})}})),R.current.getSource("wells").setData({type:"FeatureCollection",features:a}),F.current=a.length?f:null;var m=R.current,y=null,h=function(e){m.getCanvas().style.cursor="pointer";var t=d[e.features[0].properties.wellId];if(t&&t.id!==y){y=t.id;var s=u.get(t,D);L.current||(L.current=document.createElement("div"),E.current=n.createAdaptiveRoot(L.current)),E.current.render(r.createElement((function(e){var r=e.well;return o.jsx("div",{style:{color:"#fff",background:"##414141"},children:o.jsx("span",{style:{fontSize:"11px",lineHeight:"16px"},children:u.get(r,"name")})})}),{well:t})),A.current||(A.current=new p.default.Popup({closeButton:!1,maxWidth:"none"})),A.current.setLngLat(v(s)).setDOMContent(L.current).addTo(m),function(e,r){R.current.getSource(q).setData({type:"Feature",geometry:{type:"Point",coordinates:v(e)},properties:{radius:3*r}})}(s,e.features[0].properties.radius)}},b=function(){var e;y=null,m.getCanvas().style.cursor="",m.getSource(q).setData(g),null===(e=A.current)||void 0===e||e.remove()},x=function(e){null!=e&&e.point&&m.queryRenderedFeatures(e.point,{layers:[q]}).length||b()};return m.on("mousemove","wells",h),m.on("mouseleave","wells",x),m.on("mouseleave",q,b),setTimeout((function(){R.current&&F.current&&c!==t&&R.current.fitBounds(F.current)}),500),function(){m.off("mousemove","wells",h),m.off("mouseleave","wells",x),m.off("mouseleave",q,b)}}}),[l,c,j,B]),o.jsx("div",{className:s.map,children:o.jsx("div",{className:s.mapMain,ref:P})})}j.propTypes={subjectWell:f.default.shape({id:f.default.number,formation:f.default.string}),wells:f.default.arrayOf(f.default.shape({})).isRequired,offsetWells:f.default.arrayOf(f.default.shape({})),radius:f.default.number.isRequired,subjectWellMarkerSize:f.default.number,wellMarkerSize:f.default.number,coordsDataPath:f.default.string};var y=8,h=5,b=r.memo(j);module.exports=b;
2
2
  //# sourceMappingURL=Map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Map.js","sources":["../../../../../../src/components/BICOffsetPickerDialog/components/Map/Map.js"],"sourcesContent":["import { createElement, memo, useRef, useEffect, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { get } from 'lodash';\n\nimport styles from './Map.css';\n\nimport { mapbox } from '~/utils';\nimport { createAdaptiveRoot } from '~/utils/createAdaptiveRoot';\nimport mapboxgl from '~/config/mapboxGl';\nimport { IS_MAPBOX_ENABLED } from '~/config/mapbox';\nimport 'mapbox-gl/dist/mapbox-gl.css';\n\nconst RADIUS_CIRCLE_COLOR = '#03BCD4';\nconst METERS_IN_MILE = 1609.34;\nconst DEFAULT_SUBJECT_WELL_MARKER_SIZE = 8;\nconst DEFAULT_WELL_MARKER_SIZE = 5;\nconst OFFSET_WELL_COLOR = '#FFC107';\n\nconst DEFAULT_COORDS = [29.749907, -95.358421]; // TX coordinates\n\nconst RADIUS_CIRCLE_ID = 'radius-circle';\nconst WELLS_ID = 'wells';\nconst HIGHLIGHT_ID = 'wells-highlight';\nconst EMPTY_FEATURE_COLLECTION = { type: 'FeatureCollection', features: [] };\n\nconst toLngLat = ([lat, lng]) => [lng, lat];\n\n// NOTE: mapbox-gl has no geographic-radius circle primitive, so approximate it with a polygon\nconst makeCirclePolygon = ([lat, lng], radiusMeters, points = 64) => {\n const ring = [];\n const distanceX = radiusMeters / (111320 * Math.cos((lat * Math.PI) / 180));\n const distanceY = radiusMeters / 110574;\n for (let i = 0; i <= points; i += 1) {\n const theta = (i / points) * (2 * Math.PI);\n ring.push([lng + distanceX * Math.cos(theta), lat + distanceY * Math.sin(theta)]);\n }\n return ring;\n};\n\nconst toolTip =\n () =>\n // eslint-disable-next-line react/prop-types\n ({ well }) => {\n return (\n <div style={{ color: '#fff', background: '##414141' }}>\n <span style={{ fontSize: '11px', lineHeight: '16px' }}>{get(well, 'name')}</span>\n </div>\n );\n };\n\n// eslint-disable-next-line no-unused-vars\nfunction WellsMap({\n subjectWell = null,\n wells,\n offsetWells = null,\n radius,\n subjectWellMarkerSize = DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE,\n wellMarkerSize = DEFAULT_WELLS_MAP_WELL_MARKER_SIZE,\n coordsDataPath = 'settings.top_hole.coordinates',\n}) {\n const mapContainerRef = useRef(null);\n const mapRef = useRef(null);\n const markersBoundsRef = useRef(null);\n const popupRef = useRef(null);\n const tooltipRootRef = useRef(null);\n const tooltipContainerRef = useRef(null);\n const prevWellsRef = useRef();\n const [isMapReady, setIsMapReady] = useState(false);\n\n const subjectWellCoords = useMemo(() => {\n return subjectWell && get(subjectWell, coordsDataPath);\n }, [subjectWell, coordsDataPath]);\n\n // NOTE: Initialize map\n useEffect(() => {\n if (!IS_MAPBOX_ENABLED) return undefined;\n\n mapRef.current = new mapboxgl.Map({\n container: mapContainerRef.current,\n style: 'mapbox://styles/mapbox/dark-v9',\n center: toLngLat(DEFAULT_COORDS),\n zoom: 1,\n attributionControl: false,\n scrollZoom: false,\n });\n\n mapRef.current.addControl(\n new mapboxgl.NavigationControl({ showCompass: false }),\n 'bottom-right'\n );\n\n // NOTE: Sources/layers can only be added once the style has loaded.\n // The radius circle layer is added first so well markers render above it (was bringToBack),\n // and the hover highlight layer last so it renders on top of the markers\n mapRef.current.on('load', () => {\n mapRef.current.addSource(RADIUS_CIRCLE_ID, {\n type: 'geojson',\n data: EMPTY_FEATURE_COLLECTION,\n });\n mapRef.current.addLayer({\n id: RADIUS_CIRCLE_ID,\n type: 'fill',\n source: RADIUS_CIRCLE_ID,\n paint: {\n 'fill-color': RADIUS_CIRCLE_COLOR,\n 'fill-opacity': 0.2,\n },\n });\n\n mapRef.current.addSource(WELLS_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n mapRef.current.addLayer({\n id: WELLS_ID,\n type: 'circle',\n source: WELLS_ID,\n paint: {\n 'circle-radius': ['get', 'radius'],\n 'circle-color': OFFSET_WELL_COLOR,\n 'circle-opacity': ['get', 'opacity'],\n },\n });\n\n mapRef.current.addSource(HIGHLIGHT_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n mapRef.current.addLayer({\n id: HIGHLIGHT_ID,\n type: 'circle',\n source: HIGHLIGHT_ID,\n paint: {\n 'circle-radius': ['get', 'radius'],\n 'circle-color': OFFSET_WELL_COLOR,\n 'circle-opacity': 0.2,\n },\n });\n\n setIsMapReady(true);\n });\n\n const map = mapRef.current;\n return () => {\n tooltipRootRef.current?.unmount();\n tooltipRootRef.current = null;\n tooltipContainerRef.current = null;\n\n map.remove();\n mapRef.current = null;\n markersBoundsRef.current = null;\n };\n }, []);\n\n // NOTE: Radius circle\n useEffect(() => {\n if (!mapRef.current || !isMapReady) {\n return;\n }\n\n if (!subjectWellCoords) {\n mapRef.current.getSource(RADIUS_CIRCLE_ID).setData(EMPTY_FEATURE_COLLECTION);\n return;\n }\n\n const ring = makeCirclePolygon(subjectWellCoords, radius * METERS_IN_MILE);\n mapRef.current.getSource(RADIUS_CIRCLE_ID).setData({\n type: 'Feature',\n geometry: { type: 'Polygon', coordinates: [ring] },\n });\n }, [radius, subjectWellCoords, isMapReady]);\n\n const handleMouseOver = (coords, r) => {\n // Highlight the hovered well with a bigger translucent circle\n mapRef.current.getSource(HIGHLIGHT_ID).setData({\n type: 'Feature',\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: { radius: r * 3 },\n });\n };\n\n // NOTE: Well markers\n useEffect(() => {\n if (!mapRef.current || !isMapReady) {\n return undefined;\n }\n\n const prevWells = prevWellsRef.current;\n prevWellsRef.current = wells;\n\n popupRef.current?.remove();\n mapRef.current.getSource(HIGHLIGHT_ID).setData(EMPTY_FEATURE_COLLECTION);\n\n const offsetWellIds = offsetWells.map(well => well.id);\n\n const features = [];\n const wellsById = {};\n const bounds = new mapboxgl.LngLatBounds();\n wells.forEach(well => {\n const coords = get(well, coordsDataPath);\n\n if (coords && mapbox.isValidCoordinates(coords)) {\n const isWellSubject = subjectWell && subjectWell.id === well.id;\n const isWellOffset = offsetWellIds.includes(well.id);\n const r = isWellSubject ? subjectWellMarkerSize : wellMarkerSize;\n const opacity = isWellSubject || isWellOffset ? 1 : 0.3;\n\n wellsById[well.id] = well;\n bounds.extend(toLngLat(coords));\n features.push({\n type: 'Feature',\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: { wellId: well.id, radius: r, opacity },\n });\n }\n });\n\n mapRef.current.getSource(WELLS_ID).setData({ type: 'FeatureCollection', features });\n markersBoundsRef.current = features.length ? bounds : null;\n\n const map = mapRef.current;\n let hoveredWellId = null;\n\n const handleMouseMove = e => {\n map.getCanvas().style.cursor = 'pointer';\n\n const well = wellsById[e.features[0].properties.wellId];\n if (!well || well.id === hoveredWellId) {\n return;\n }\n hoveredWellId = well.id;\n\n const coords = get(well, coordsDataPath);\n\n // Tooltip\n if (!tooltipContainerRef.current) {\n tooltipContainerRef.current = document.createElement('div');\n tooltipRootRef.current = createAdaptiveRoot(tooltipContainerRef.current);\n }\n tooltipRootRef.current.render(createElement(toolTip(), { well }));\n\n if (!popupRef.current) {\n popupRef.current = new mapboxgl.Popup({ closeButton: false, maxWidth: 'none' });\n }\n popupRef.current\n .setLngLat(toLngLat(coords))\n .setDOMContent(tooltipContainerRef.current)\n .addTo(map);\n\n // Highlight\n handleMouseOver(coords, e.features[0].properties.radius);\n };\n\n // NOTE: was the mouseout handler of the Leaflet highlight marker\n const handleHighlightMouseLeave = () => {\n hoveredWellId = null;\n map.getCanvas().style.cursor = '';\n map.getSource(HIGHLIGHT_ID).setData(EMPTY_FEATURE_COLLECTION);\n popupRef.current?.remove();\n };\n\n // NOTE: If the pointer exits before the highlight renders under it, the highlight\n // layer never emits mouseleave — clear here unless the cursor is inside the highlight\n const handleWellsMouseLeave = e => {\n if (e?.point && map.queryRenderedFeatures(e.point, { layers: [HIGHLIGHT_ID] }).length) {\n return;\n }\n handleHighlightMouseLeave();\n };\n\n map.on('mousemove', WELLS_ID, handleMouseMove);\n map.on('mouseleave', WELLS_ID, handleWellsMouseLeave);\n map.on('mouseleave', HIGHLIGHT_ID, handleHighlightMouseLeave);\n\n setTimeout(() => {\n if (mapRef.current && markersBoundsRef.current && wells !== prevWells) {\n mapRef.current.fitBounds(markersBoundsRef.current);\n }\n }, 500);\n\n return () => {\n map.off('mousemove', WELLS_ID, handleMouseMove);\n map.off('mouseleave', WELLS_ID, handleWellsMouseLeave);\n map.off('mouseleave', HIGHLIGHT_ID, handleHighlightMouseLeave);\n };\n }, [subjectWell, wells, offsetWells, isMapReady]);\n\n return (\n <div className={styles.map}>\n <div className={styles.mapMain} ref={mapContainerRef} />\n </div>\n );\n}\n\nWellsMap.propTypes = {\n subjectWell: PropTypes.shape({\n id: PropTypes.number,\n formation: PropTypes.string,\n }),\n wells: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n offsetWells: PropTypes.arrayOf(PropTypes.shape({})),\n radius: PropTypes.number.isRequired,\n subjectWellMarkerSize: PropTypes.number,\n wellMarkerSize: PropTypes.number,\n coordsDataPath: PropTypes.string,\n};\n\nconst DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE = DEFAULT_SUBJECT_WELL_MARKER_SIZE;\nconst DEFAULT_WELLS_MAP_WELL_MARKER_SIZE = DEFAULT_WELL_MARKER_SIZE;\n\nexport default memo(WellsMap);\n"],"names":["DEFAULT_COORDS","HIGHLIGHT_ID","EMPTY_FEATURE_COLLECTION","type","features","toLngLat","_ref","_ref2","_slicedToArray","lat","WellsMap","_ref6","_ref6$subjectWell","subjectWell","wells","_ref6$offsetWells","offsetWells","radius","_ref6$subjectWellMark","subjectWellMarkerSize","DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE","_ref6$wellMarkerSize","wellMarkerSize","DEFAULT_WELLS_MAP_WELL_MARKER_SIZE","_ref6$coordsDataPath","coordsDataPath","mapContainerRef","useRef","mapRef","markersBoundsRef","popupRef","tooltipRootRef","tooltipContainerRef","prevWellsRef","useState","_useState2","_useState","isMapReady","setIsMapReady","subjectWellCoords","useMemo","get","useEffect","IS_MAPBOX_ENABLED","current","mapboxgl","Map","container","style","center","zoom","attributionControl","scrollZoom","addControl","NavigationControl","showCompass","on","addSource","data","addLayer","id","source","paint","map","_tooltipRootRef$curre","unmount","remove","ring","_ref3","radiusMeters","_ref4","lng","points","distanceX","Math","cos","PI","distanceY","i","theta","push","sin","makeCirclePolygon","getSource","setData","geometry","coordinates","_popupRef$current","prevWells","offsetWellIds","well","wellsById","bounds","LngLatBounds","forEach","coords","mapbox","isValidCoordinates","isWellSubject","isWellOffset","includes","r","opacity","extend","properties","wellId","length","hoveredWellId","handleMouseMove","e","getCanvas","cursor","document","createElement","createAdaptiveRoot","render","_ref5","_jsx","color","background","children","jsx","fontSize","lineHeight","Popup","closeButton","maxWidth","setLngLat","setDOMContent","addTo","handleMouseOver","handleHighlightMouseLeave","_popupRef$current2","handleWellsMouseLeave","point","queryRenderedFeatures","layers","setTimeout","fitBounds","off","className","styles","mapMain","ref","propTypes","PropTypes","shape","number","formation","string","arrayOf","isRequired","memo"],"mappings":"giBAkBMA,EAAiB,CAAC,WAAY,WAI9BC,EAAe,kBACfC,EAA2B,CAAEC,KAAM,oBAAqBC,SAAU,IAElEC,EAAW,SAAHC,GAAA,IAAAC,EAAAC,EAAAA,QAAAF,EAAA,GAAKG,EAAGF,EAAA,GAAK,MAAM,CAANA,EAAA,GAAYE,EAAI,EA0B3C,SAASC,EAQNC,GAAA,IAAAC,EAAAD,EAPDE,YAAAA,aAA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,EAAIwE,sBAAsB1B,EAAEyB,MAAO,CAAEE,OAAQ,CAACvI,KAAiByG,QAG/EyB,KAaF,OAVApE,EAAIP,GAAG,YAnPM,QAmPiBoD,GAC9B7C,EAAIP,GAAG,aApPM,QAoPkB6E,GAC/BtE,EAAIP,GAAG,aAAcvD,EAAckI,GAEnCM,YAAW,WACL7G,EAAOgB,SAAWf,EAAiBe,SAAW9B,IAAU0E,GAC1D5D,EAAOgB,QAAQ8F,UAAU7G,EAAiBe,QAE7C,GAAE,KAEI,WACLmB,EAAI4E,IAAI,YA9PG,QA8PoB/B,GAC/B7C,EAAI4E,IAAI,aA/PG,QA+PqBN,GAChCtE,EAAI4E,IAAI,aAAc1I,EAAckI,GAlGtC,CAoGD,GAAE,CAACtH,EAAaC,EAAOE,EAAaqB,IAGnCgF,EAAAA,IAAA,MAAA,CAAKuB,UAAWC,EAAO9E,IAAIyD,SACzBH,EAAAI,IAAA,MAAA,CAAKmB,UAAWC,EAAOC,QAASC,IAAKrH,KAG3C,CAEAhB,EAASsI,UAAY,CACnBnI,YAAaoI,EAAS,QAACC,MAAM,CAC3BtF,GAAIqF,EAAS,QAACE,OACdC,UAAWH,EAAS,QAACI,SAEvBvI,MAAOmI,EAAS,QAACK,QAAQL,EAAAA,QAAUC,MAAM,CAAA,IAAKK,WAC9CvI,YAAaiI,EAAS,QAACK,QAAQL,EAAS,QAACC,MAAM,CAAE,IACjDjI,OAAQgI,EAAAA,QAAUE,OAAOI,WACzBpI,sBAAuB8H,EAAS,QAACE,OACjC7H,eAAgB2H,EAAS,QAACE,OAC1B1H,eAAgBwH,EAAS,QAACI,QAG5B,IAAMjI,EA/RmC,EAgSnCG,EA/R2B,EAiSlBiI,EAAAA,EAAAA,KAAK9I"}
1
+ {"version":3,"file":"Map.js","sources":["../../../../../../src/components/BICOffsetPickerDialog/components/Map/Map.js"],"sourcesContent":["import { createElement, memo, useRef, useEffect, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { get } from 'lodash';\n\nimport styles from './Map.css';\n\nimport { mapbox } from '~/utils';\nimport { createAdaptiveRoot } from '~/utils/createAdaptiveRoot';\nimport mapboxgl from '~/config/mapboxGl';\nimport { IS_MAPBOX_ENABLED } from '~/config/mapbox';\nimport 'mapbox-gl/dist/mapbox-gl.css';\n\nconst RADIUS_CIRCLE_COLOR = '#03BCD4';\nconst METERS_IN_MILE = 1609.34;\nconst DEFAULT_SUBJECT_WELL_MARKER_SIZE = 8;\nconst DEFAULT_WELL_MARKER_SIZE = 5;\nconst OFFSET_WELL_COLOR = '#FFC107';\n\nconst DEFAULT_COORDS = [29.749907, -95.358421]; // TX coordinates\n\nconst RADIUS_CIRCLE_ID = 'radius-circle';\nconst WELLS_ID = 'wells';\nconst HIGHLIGHT_ID = 'wells-highlight';\nconst EMPTY_FEATURE_COLLECTION = { type: 'FeatureCollection', features: [] };\n\nconst toLngLat = ([lat, lng]) => [lng, lat];\n\n// NOTE: mapbox-gl has no geographic-radius circle primitive, so approximate it with a polygon\nconst makeCirclePolygon = ([lat, lng], radiusMeters, points = 64) => {\n const ring = [];\n const distanceX = radiusMeters / (111320 * Math.cos((lat * Math.PI) / 180));\n const distanceY = radiusMeters / 110574;\n for (let i = 0; i <= points; i += 1) {\n const theta = (i / points) * (2 * Math.PI);\n ring.push([lng + distanceX * Math.cos(theta), lat + distanceY * Math.sin(theta)]);\n }\n return ring;\n};\n\nconst toolTip =\n () =>\n // eslint-disable-next-line react/prop-types\n ({ well }) => {\n return (\n <div style={{ color: '#fff', background: '##414141' }}>\n <span style={{ fontSize: '11px', lineHeight: '16px' }}>{get(well, 'name')}</span>\n </div>\n );\n };\n\n// eslint-disable-next-line no-unused-vars\nfunction WellsMap({\n subjectWell = null,\n wells,\n offsetWells = null,\n radius,\n subjectWellMarkerSize = DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE,\n wellMarkerSize = DEFAULT_WELLS_MAP_WELL_MARKER_SIZE,\n coordsDataPath = 'settings.top_hole.coordinates',\n}) {\n const mapContainerRef = useRef(null);\n const mapRef = useRef(null);\n const markersBoundsRef = useRef(null);\n const popupRef = useRef(null);\n const tooltipRootRef = useRef(null);\n const tooltipContainerRef = useRef(null);\n const prevWellsRef = useRef();\n const [isMapReady, setIsMapReady] = useState(false);\n\n const subjectWellCoords = useMemo(() => {\n return subjectWell && get(subjectWell, coordsDataPath);\n }, [subjectWell, coordsDataPath]);\n\n // NOTE: Initialize map\n useEffect(() => {\n if (!IS_MAPBOX_ENABLED) return undefined;\n\n mapRef.current = new mapboxgl.Map({\n container: mapContainerRef.current,\n style: 'mapbox://styles/mapbox/dark-v9',\n center: toLngLat(DEFAULT_COORDS),\n zoom: 1,\n attributionControl: false,\n scrollZoom: false,\n });\n\n mapRef.current.addControl(\n new mapboxgl.NavigationControl({ showCompass: false }),\n 'bottom-right'\n );\n\n // NOTE: Sources/layers can only be added once the style has loaded.\n // The radius circle layer is added first so well markers render above it (was bringToBack),\n // and the hover highlight layer last so it renders on top of the markers\n mapRef.current.on('load', () => {\n mapRef.current.addSource(RADIUS_CIRCLE_ID, {\n type: 'geojson',\n data: EMPTY_FEATURE_COLLECTION,\n });\n mapRef.current.addLayer({\n id: RADIUS_CIRCLE_ID,\n type: 'fill',\n source: RADIUS_CIRCLE_ID,\n paint: {\n 'fill-color': RADIUS_CIRCLE_COLOR,\n 'fill-opacity': 0.2,\n },\n });\n\n mapRef.current.addSource(WELLS_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n mapRef.current.addLayer({\n id: WELLS_ID,\n type: 'circle',\n source: WELLS_ID,\n paint: {\n 'circle-radius': ['get', 'radius'],\n 'circle-color': OFFSET_WELL_COLOR,\n 'circle-opacity': ['get', 'opacity'],\n },\n });\n\n mapRef.current.addSource(HIGHLIGHT_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n mapRef.current.addLayer({\n id: HIGHLIGHT_ID,\n type: 'circle',\n source: HIGHLIGHT_ID,\n paint: {\n 'circle-radius': ['get', 'radius'],\n 'circle-color': OFFSET_WELL_COLOR,\n 'circle-opacity': 0.2,\n },\n });\n\n setIsMapReady(true);\n });\n\n const map = mapRef.current;\n return () => {\n tooltipRootRef.current?.unmount();\n tooltipRootRef.current = null;\n tooltipContainerRef.current = null;\n\n map.remove();\n mapRef.current = null;\n markersBoundsRef.current = null;\n };\n }, []);\n\n // NOTE: Radius circle\n useEffect(() => {\n if (!mapRef.current || !isMapReady) {\n return;\n }\n\n if (!subjectWellCoords) {\n mapRef.current.getSource(RADIUS_CIRCLE_ID).setData(EMPTY_FEATURE_COLLECTION);\n return;\n }\n\n const ring = makeCirclePolygon(subjectWellCoords, radius * METERS_IN_MILE);\n mapRef.current.getSource(RADIUS_CIRCLE_ID).setData({\n type: 'Feature',\n geometry: { type: 'Polygon', coordinates: [ring] },\n });\n }, [radius, subjectWellCoords, isMapReady]);\n\n const handleMouseOver = (coords, r) => {\n // Highlight the hovered well with a bigger translucent circle\n mapRef.current.getSource(HIGHLIGHT_ID).setData({\n type: 'Feature',\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: { radius: r * 3 },\n });\n };\n\n // NOTE: Well markers\n useEffect(() => {\n if (!mapRef.current || !isMapReady) {\n return undefined;\n }\n\n const prevWells = prevWellsRef.current;\n prevWellsRef.current = wells;\n\n popupRef.current?.remove();\n mapRef.current.getSource(HIGHLIGHT_ID).setData(EMPTY_FEATURE_COLLECTION);\n\n const offsetWellIds = offsetWells.map(well => well.id);\n\n const features = [];\n const wellsById = {};\n const bounds = new mapboxgl.LngLatBounds();\n wells.forEach(well => {\n const coords = get(well, coordsDataPath);\n\n if (coords && mapbox.isValidCoordinates(coords)) {\n const isWellSubject = subjectWell && subjectWell.id === well.id;\n const isWellOffset = offsetWellIds.includes(well.id);\n const r = isWellSubject ? subjectWellMarkerSize : wellMarkerSize;\n const opacity = isWellSubject || isWellOffset ? 1 : 0.3;\n\n wellsById[well.id] = well;\n bounds.extend(toLngLat(coords));\n features.push({\n type: 'Feature',\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: { wellId: well.id, radius: r, opacity },\n });\n }\n });\n\n mapRef.current.getSource(WELLS_ID).setData({ type: 'FeatureCollection', features });\n markersBoundsRef.current = features.length ? bounds : null;\n\n const map = mapRef.current;\n let hoveredWellId = null;\n\n const handleMouseMove = e => {\n map.getCanvas().style.cursor = 'pointer';\n\n const well = wellsById[e.features[0].properties.wellId];\n if (!well || well.id === hoveredWellId) {\n return;\n }\n hoveredWellId = well.id;\n\n const coords = get(well, coordsDataPath);\n\n // Tooltip\n if (!tooltipContainerRef.current) {\n tooltipContainerRef.current = document.createElement('div');\n tooltipRootRef.current = createAdaptiveRoot(tooltipContainerRef.current);\n }\n tooltipRootRef.current.render(createElement(toolTip(), { well }));\n\n if (!popupRef.current) {\n popupRef.current = new mapboxgl.Popup({ closeButton: false, maxWidth: 'none' });\n }\n popupRef.current\n .setLngLat(toLngLat(coords))\n .setDOMContent(tooltipContainerRef.current)\n .addTo(map);\n\n // Highlight\n handleMouseOver(coords, e.features[0].properties.radius);\n };\n\n // NOTE: was the mouseout handler of the Leaflet highlight marker\n const handleHighlightMouseLeave = () => {\n hoveredWellId = null;\n map.getCanvas().style.cursor = '';\n map.getSource(HIGHLIGHT_ID).setData(EMPTY_FEATURE_COLLECTION);\n popupRef.current?.remove();\n };\n\n // NOTE: If the pointer exits before the highlight renders under it, the highlight\n // layer never emits mouseleave — clear here unless the cursor is inside the highlight\n const handleWellsMouseLeave = e => {\n if (e?.point && map.queryRenderedFeatures(e.point, { layers: [HIGHLIGHT_ID] }).length) {\n return;\n }\n handleHighlightMouseLeave();\n };\n\n map.on('mousemove', WELLS_ID, handleMouseMove);\n map.on('mouseleave', WELLS_ID, handleWellsMouseLeave);\n map.on('mouseleave', HIGHLIGHT_ID, handleHighlightMouseLeave);\n\n setTimeout(() => {\n if (mapRef.current && markersBoundsRef.current && wells !== prevWells) {\n mapRef.current.fitBounds(markersBoundsRef.current);\n }\n }, 500);\n\n return () => {\n map.off('mousemove', WELLS_ID, handleMouseMove);\n map.off('mouseleave', WELLS_ID, handleWellsMouseLeave);\n map.off('mouseleave', HIGHLIGHT_ID, handleHighlightMouseLeave);\n };\n }, [subjectWell, wells, offsetWells, isMapReady]);\n\n return (\n <div className={styles.map}>\n <div className={styles.mapMain} ref={mapContainerRef} />\n </div>\n );\n}\n\nWellsMap.propTypes = {\n subjectWell: PropTypes.shape({\n id: PropTypes.number,\n formation: PropTypes.string,\n }),\n wells: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n offsetWells: PropTypes.arrayOf(PropTypes.shape({})),\n radius: PropTypes.number.isRequired,\n subjectWellMarkerSize: PropTypes.number,\n wellMarkerSize: PropTypes.number,\n coordsDataPath: PropTypes.string,\n};\n\nconst DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE = DEFAULT_SUBJECT_WELL_MARKER_SIZE;\nconst DEFAULT_WELLS_MAP_WELL_MARKER_SIZE = DEFAULT_WELL_MARKER_SIZE;\n\nexport default memo(WellsMap);\n"],"names":["DEFAULT_COORDS","HIGHLIGHT_ID","EMPTY_FEATURE_COLLECTION","type","features","toLngLat","_ref","_ref2","_slicedToArray","lat","WellsMap","_ref6","_ref6$subjectWell","subjectWell","wells","_ref6$offsetWells","offsetWells","radius","_ref6$subjectWellMark","subjectWellMarkerSize","DEFAULT_WELLS_MAP_SUBJECT_WELL_MARKER_SIZE","_ref6$wellMarkerSize","wellMarkerSize","DEFAULT_WELLS_MAP_WELL_MARKER_SIZE","_ref6$coordsDataPath","coordsDataPath","mapContainerRef","useRef","mapRef","markersBoundsRef","popupRef","tooltipRootRef","tooltipContainerRef","prevWellsRef","useState","_useState2","_useState","isMapReady","setIsMapReady","subjectWellCoords","useMemo","get","useEffect","IS_MAPBOX_ENABLED","current","mapboxgl","Map","container","style","center","zoom","attributionControl","scrollZoom","addControl","NavigationControl","showCompass","on","addSource","data","addLayer","id","source","paint","map","_tooltipRootRef$curre","unmount","remove","ring","_ref3","radiusMeters","_ref4","lng","points","distanceX","Math","cos","PI","distanceY","i","theta","push","sin","makeCirclePolygon","getSource","setData","geometry","coordinates","_popupRef$current","prevWells","offsetWellIds","well","wellsById","bounds","LngLatBounds","forEach","coords","mapbox","isWellSubject","isWellOffset","includes","r","opacity","extend","properties","wellId","length","hoveredWellId","handleMouseMove","e","getCanvas","cursor","document","createElement","createAdaptiveRoot","render","_ref5","_jsx","color","background","children","jsx","fontSize","lineHeight","Popup","closeButton","maxWidth","setLngLat","setDOMContent","addTo","handleMouseOver","handleHighlightMouseLeave","_popupRef$current2","handleWellsMouseLeave","point","queryRenderedFeatures","layers","setTimeout","fitBounds","off","className","styles","mapMain","ref","propTypes","PropTypes","shape","number","formation","string","arrayOf","isRequired","memo"],"mappings":"ymFAkBMA,EAAiB,CAAC,WAAY,WAI9BC,EAAe,kBACfC,EAA2B,CAAEC,KAAM,oBAAqBC,SAAU,IAElEC,EAAW,SAAHC,GAAA,IAAAC,EAAAC,EAAAA,QAAAF,EAAA,GAAKG,EAAGF,EAAA,GAAK,MAAM,CAANA,EAAA,GAAYE,EAAI,EA0B3C,SAASC,EAQNC,GAAA,IAAAC,EAAAD,EAPDE,YAAAA,aAAc,KAAID,EAClBE,IAAAA,MAAKC,EAAAJ,EACLK,YAAAA,aAAc,KAAID,EAClBE,IAAAA,OAAMC,EAAAP,EACNQ,sBAAAA,aAAwBC,EAA0CF,EAAAG,EAAAV,EAClEW,eAAAA,aAAiBC,EAAkCF,EAAAG,EAAAb,EACnDc,eAAAA,aAAiB,gCAA+BD,EAE1CE,EAAkBC,SAAO,MACzBC,EAASD,SAAO,MAChBE,EAAmBF,SAAO,MAC1BG,EAAWH,SAAO,MAClBI,EAAiBJ,SAAO,MACxBK,EAAsBL,SAAO,MAC7BM,EAAeN,EAAAA,SACeO,EAAAA,EAAQA,UAAC,GAAMC,EAAA3B,EAAAA,QAAA4B,EAAA,GAA5CC,EAAUF,EAAA,GAAEG,EAAaH,EAAA,GAE1BI,EAAoB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EAAAA,IAAA,MAAA,CAAKuB,UAAWC,EAAO7E,IAAIwD,SACzBH,EAAAI,IAAA,MAAA,CAAKmB,UAAWC,EAAOC,QAASC,IAAKpH,KAG3C,CAEAhB,EAASqI,UAAY,CACnBlI,YAAamI,EAAS,QAACC,MAAM,CAC3BrF,GAAIoF,EAAS,QAACE,OACdC,UAAWH,EAAS,QAACI,SAEvBtI,MAAOkI,EAAS,QAACK,QAAQL,EAAAA,QAAUC,MAAM,CAAA,IAAKK,WAC9CtI,YAAagI,EAAS,QAACK,QAAQL,EAAS,QAACC,MAAM,CAAE,IACjDhI,OAAQ+H,EAAAA,QAAUE,OAAOI,WACzBnI,sBAAuB6H,EAAS,QAACE,OACjC5H,eAAgB0H,EAAS,QAACE,OAC1BzH,eAAgBuH,EAAS,QAACI,QAG5B,IAAMhI,EA/RmC,EAgSnCG,EA/R2B,EAiSlBgI,EAAAA,EAAAA,KAAK7I"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),n=require("@babel/runtime/helpers/defineProperty"),t=require("react"),r=require("prop-types"),i=require("classnames"),a=require("@material-ui/core"),c=require("@material-ui/icons"),o=require("./AssetSearch.js"),l=require("./SectionItem.js"),s=require("./WellListItem.js");require("../../../../utils/index.js");var d=require("react/jsx-runtime"),u=require("../../../../utils/notificationToasts.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=p(e),f=p(n),h=p(i);function x(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?x(Object(t),!0).forEach((function(n){f.default(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):x(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var j=a.makeStyles((function(e){return{content:{width:"472px",marginTop:"24px"},sectionItem:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"8px",fontSize:"12px",fontWeight:"normal",color:e.palette.primary.text6,borderTop:"1px solid ".concat(e.palette.primary.text8),"&:last-child":{borderBottom:"1px solid ".concat(e.palette.primary.text8)}},disabledSectionItem:{color:e.palette.primary.text8},wellList:{width:"100%",margin:0,padding:0},searchContainer:{display:"flex",justifyContent:"space-between",marginBottom:"24px",alignItems:"center"},advancedSearch:{fontSize:"14px",fontWeight:500,color:"#03BCD4",cursor:"pointer","&:hover":{textDecoration:"underline"}}}}));function w(e){var n=e.company,t=e.wellSections,r=void 0===t?g:t,i=e.getWellName,p=e.onChangeWellSections,f=e.onExploreMode,x=j(),w=function(e,n){var t=r.find((function(n){return n.name===e.name})).wells.map((function(e){return e.id})),i=r.map((function(e){var r=e.wells.map((function(e){return t.includes(e.id)?y(y({},e),{},{checked:n}):y({},e)}));return y(y({},e),{},{wells:r})}));p(i)},b=function(e){var n=r.map((function(n){return n.name===e.name?y(y({},n),{},{expanded:!n.expanded}):n}));p(n)},v=function(e){var n=r.map((function(n){var t=n.wells.map((function(n){return n.id===e.id?y(y({},n),{},{checked:!n.checked}):n}));return y(y({},n),{},{wells:t})}));p(n)},S=function(e){w(e,!0)},O=function(e){w(e,!1)};return d.jsxs("div",{className:x.content,children:[d.jsxs("div",{className:x.searchContainer,children:[d.jsx(o,{company:+n,onClickAsset:function(e,n){var t=r.map((function(t){if("Search Results"===t.name){var r=m.default(t.wells);return t.wells.find((function(n){return n.id===e}))||r.push({id:e,checked:!0,name:n,kind:"manual"}),y(y({},t),{},{wells:r})}return y(y({},t),{},{wells:t.wells.map((function(n){return n.id===e?y(y({},n),{},{checked:!0}):n}))})}));p(t),u.showSuccessNotification("Offset well successfully added!")},onExploreMode:f}),d.jsx(a.Typography,{"data-testid":"".concat("WellSection","_advancedSearch"),className:x.advancedSearch,onClick:function(){f()},children:"Advanced Search"})]}),(r||[]).map((function(e){return 0===e.wells.length?d.jsx("div",{className:h.default(x.sectionItem,x.disabledSectionItem),children:d.jsx(l,{section:e,disabled:!0})},"empty-".concat(e.name)):d.jsx("div",{className:x.sectionItem,children:d.jsxs(a.Accordion,{expanded:e.expanded,onChange:function(){return b(e)},children:[d.jsx(a.AccordionSummary,{expandIcon:d.jsx(c.ExpandMore,{}),style:{width:"100%"},children:d.jsx(l,{section:e,onExpandCollapse:b,onSelectAll:S,onClearAll:O})}),d.jsx(a.AccordionDetails,{children:d.jsx(a.List,{dense:!0,className:x.wellList,children:e.wells.map((function(n){return d.jsx(s,{well:n,wellName:i(e.wells,n.id),rigName:n.rigName,onToggleWell:v},"well-".concat(e.name,"-").concat(n.id))}))})})]})},"section-".concat(e.name))}))]})}w.propTypes={company:r.string.isRequired,wellSections:r.arrayOf(r.shape({})),getWellName:r.func.isRequired,onChangeWellSections:r.func.isRequired,onExploreMode:r.func.isRequired};var g=[],b=t.memo(w);module.exports=b;
1
+ "use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),r=require("@babel/runtime/helpers/defineProperty"),t=require("react"),n=require("prop-types"),i=require("classnames"),s=require("@material-ui/core"),a=require("@material-ui/icons"),o=require("./AssetSearch.js"),l=require("./SectionItem.js"),c=require("./WellListItem.js");require("../../../UserMention/utils/index.js"),require("../../../../utils/convert.js"),require("../../../../constants/completion.js"),require("moment"),require("../../../../constants/alerts.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../../../utils/casing/validation.js"),require("@babel/runtime/helpers/slicedToArray"),require("lodash/mean"),require("lodash"),require("../../../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),require("query-string"),require("../../../../constants/goals.js"),require("../../../../constants/segment.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js"),require("../../../../constants/corvaCompanyId.js"),require("../../../GradientManager/configuration/constants.js"),require("../../../../utils/drillstring/conversion.js"),require("lodash/set"),require("lodash/cloneDeep"),require("lodash/isNumber"),require("lodash/has"),require("../../../../utils/ga.js"),require("../../../../utils/goalsConfig/goalsConfig.js"),require("../../../../utils/lasParser.js"),require("../../../../utils/main.js"),require("../../../../utils/metrics/metricsConfig.js"),require("../../../../utils/mobileDetect.js"),require("../../../../utils/feed.js"),require("../../../../utils/reports.js"),require("moment-timezone");var u=require("../../../../utils/notificationToasts.js");require("@babel/runtime/helpers/typeof"),require("../../../../utils/dashboardReports.js"),require("../../../../utils/env.js"),require("file-extension"),require("image-extensions"),require("video-extensions"),require("../../../../utils/jsonaDataFormatter.js"),require("../../../../utils/bha.js"),require("jsona"),require("../../../../clients/jsonApi/index.js"),require("@babel/runtime/helpers/objectWithoutProperties"),require("../../../../utils/charts/Styles.scss.js"),require("../../../../utils/getSingleAsset.js");var d=require("react/jsx-runtime");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=p(e),f=p(r),j=p(i);function q(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?q(Object(t),!0).forEach((function(r){f.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):q(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var g=s.makeStyles((function(e){return{content:{width:"472px",marginTop:"24px"},sectionItem:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"8px",fontSize:"12px",fontWeight:"normal",color:e.palette.primary.text6,borderTop:"1px solid ".concat(e.palette.primary.text8),"&:last-child":{borderBottom:"1px solid ".concat(e.palette.primary.text8)}},disabledSectionItem:{color:e.palette.primary.text8},wellList:{width:"100%",margin:0,padding:0},searchContainer:{display:"flex",justifyContent:"space-between",marginBottom:"24px",alignItems:"center"},advancedSearch:{fontSize:"14px",fontWeight:500,color:"#03BCD4",cursor:"pointer","&:hover":{textDecoration:"underline"}}}}));function x(e){var r=e.company,t=e.wellSections,n=void 0===t?b:t,i=e.getWellName,p=e.onChangeWellSections,f=e.onExploreMode,q=g(),x=function(e,r){var t=n.find((function(r){return r.name===e.name})).wells.map((function(e){return e.id})),i=n.map((function(e){var n=e.wells.map((function(e){return t.includes(e.id)?h(h({},e),{},{checked:r}):h({},e)}));return h(h({},e),{},{wells:n})}));p(i)},y=function(e){var r=n.map((function(r){return r.name===e.name?h(h({},r),{},{expanded:!r.expanded}):r}));p(r)},v=function(e){var r=n.map((function(r){var t=r.wells.map((function(r){return r.id===e.id?h(h({},r),{},{checked:!r.checked}):r}));return h(h({},r),{},{wells:t})}));p(r)},w=function(e){x(e,!0)},S=function(e){x(e,!1)};return d.jsxs("div",{className:q.content,children:[d.jsxs("div",{className:q.searchContainer,children:[d.jsx(o,{company:+r,onClickAsset:function(e,r){var t=n.map((function(t){if("Search Results"===t.name){var n=m.default(t.wells);return t.wells.find((function(r){return r.id===e}))||n.push({id:e,checked:!0,name:r,kind:"manual"}),h(h({},t),{},{wells:n})}return h(h({},t),{},{wells:t.wells.map((function(r){return r.id===e?h(h({},r),{},{checked:!0}):r}))})}));p(t),u.showSuccessNotification("Offset well successfully added!")},onExploreMode:f}),d.jsx(s.Typography,{"data-testid":"".concat("WellSection","_advancedSearch"),className:q.advancedSearch,onClick:function(){f()},children:"Advanced Search"})]}),(n||[]).map((function(e){return 0===e.wells.length?d.jsx("div",{className:j.default(q.sectionItem,q.disabledSectionItem),children:d.jsx(l,{section:e,disabled:!0})},"empty-".concat(e.name)):d.jsx("div",{className:q.sectionItem,children:d.jsxs(s.Accordion,{expanded:e.expanded,onChange:function(){return y(e)},children:[d.jsx(s.AccordionSummary,{expandIcon:d.jsx(a.ExpandMore,{}),style:{width:"100%"},children:d.jsx(l,{section:e,onExpandCollapse:y,onSelectAll:w,onClearAll:S})}),d.jsx(s.AccordionDetails,{children:d.jsx(s.List,{dense:!0,className:q.wellList,children:e.wells.map((function(r){return d.jsx(c,{well:r,wellName:i(e.wells,r.id),rigName:r.rigName,onToggleWell:v},"well-".concat(e.name,"-").concat(r.id))}))})})]})},"section-".concat(e.name))}))]})}x.propTypes={company:n.string.isRequired,wellSections:n.arrayOf(n.shape({})),getWellName:n.func.isRequired,onChangeWellSections:n.func.isRequired,onExploreMode:n.func.isRequired};var b=[],y=t.memo(x);module.exports=y;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/components/BICOffsetPickerDialog/components/WellSection/index.js"],"sourcesContent":["import { memo } from 'react';\nimport { string, shape, func, arrayOf } from 'prop-types';\nimport classNames from 'classnames';\nimport {\n makeStyles,\n List,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Typography,\n} from '@material-ui/core';\nimport { ExpandMore } from '@material-ui/icons';\n\nimport AssetSearch from './AssetSearch';\nimport SectionItem from './SectionItem';\nimport WellListItem from './WellListItem';\n\nimport { showSuccessNotification } from '~/utils';\n\nconst PAGE_NAME = 'WellSection';\n\nconst useStyles = makeStyles(theme => ({\n content: {\n width: '472px',\n marginTop: '24px',\n },\n sectionItem: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: '8px',\n fontSize: '12px',\n fontWeight: 'normal',\n color: theme.palette.primary.text6,\n borderTop: `1px solid ${theme.palette.primary.text8}`,\n '&:last-child': {\n borderBottom: `1px solid ${theme.palette.primary.text8}`,\n },\n },\n disabledSectionItem: {\n color: theme.palette.primary.text8,\n },\n wellList: {\n width: '100%',\n margin: 0,\n padding: 0,\n },\n searchContainer: {\n display: 'flex',\n justifyContent: 'space-between',\n marginBottom: '24px',\n alignItems: 'center',\n },\n advancedSearch: {\n fontSize: '14px',\n fontWeight: 500,\n color: '#03BCD4',\n cursor: 'pointer',\n '&:hover': {\n textDecoration: 'underline',\n },\n },\n}));\n\nfunction WellSection({\n company,\n wellSections = DEFAULT_WELL_SECTION_WELL_SECTIONS,\n getWellName,\n onChangeWellSections,\n onExploreMode,\n}) {\n const classes = useStyles();\n\n const selectAllWells = (targetSection, f) => {\n const selectedWellIds = wellSections\n .find(section => section.name === targetSection.name)\n .wells.map(item => item.id);\n\n const data = wellSections.map(section => {\n const sectionData = section.wells.map(well => {\n if (selectedWellIds.includes(well.id)) {\n return { ...well, checked: f };\n } else {\n return { ...well };\n }\n });\n return {\n ...section,\n wells: sectionData,\n };\n });\n onChangeWellSections(data);\n };\n\n const handleExpandCollapseSection = targetSection => {\n const data = wellSections.map(section => {\n if (section.name === targetSection.name) {\n return { ...section, expanded: !section.expanded };\n }\n return section;\n });\n onChangeWellSections(data);\n };\n\n const handleToggleWell = targetWell => {\n const data = wellSections.map(section => {\n const sectionData = section.wells.map(well => {\n if (well.id === targetWell.id) {\n return { ...well, checked: !well.checked };\n }\n return well;\n });\n return {\n ...section,\n wells: sectionData,\n };\n });\n onChangeWellSections(data);\n };\n\n const handleSelectAll = targetSection => {\n selectAllWells(targetSection, true);\n };\n\n const handleClearAll = targetSection => {\n selectAllWells(targetSection, false);\n };\n\n const handleClickAsset = (redirectAssetId, name) => {\n const data = wellSections.map(section => {\n if (section.name === 'Search Results') {\n const wells = [...section.wells];\n if (!section.wells.find(item => item.id === redirectAssetId)) {\n wells.push({ id: redirectAssetId, checked: true, name, kind: 'manual' });\n }\n return { ...section, wells };\n }\n return {\n ...section,\n wells: section.wells.map(well =>\n well.id === redirectAssetId ? { ...well, checked: true } : well\n ),\n };\n });\n onChangeWellSections(data);\n showSuccessNotification('Offset well successfully added!');\n };\n\n const handleOffsetPickerDialog = () => {\n onExploreMode();\n };\n\n return (\n <div className={classes.content}>\n <div className={classes.searchContainer}>\n <AssetSearch\n company={+company}\n onClickAsset={handleClickAsset}\n onExploreMode={onExploreMode}\n />\n <Typography\n data-testid={`${PAGE_NAME}_advancedSearch`}\n className={classes.advancedSearch}\n onClick={handleOffsetPickerDialog}\n >\n Advanced Search\n </Typography>\n </div>\n\n {(wellSections || []).map(section =>\n section.wells.length === 0 ? (\n <div\n key={`empty-${section.name}`}\n className={classNames(classes.sectionItem, classes.disabledSectionItem)}\n >\n <SectionItem section={section} disabled />\n </div>\n ) : (\n <div key={`section-${section.name}`} className={classes.sectionItem}>\n <Accordion\n expanded={section.expanded}\n onChange={() => handleExpandCollapseSection(section)}\n >\n <AccordionSummary expandIcon={<ExpandMore />} style={{ width: '100%' }}>\n <SectionItem\n section={section}\n onExpandCollapse={handleExpandCollapseSection}\n onSelectAll={handleSelectAll}\n onClearAll={handleClearAll}\n />\n </AccordionSummary>\n <AccordionDetails>\n <List dense className={classes.wellList}>\n {section.wells.map(well => (\n <WellListItem\n key={`well-${section.name}-${well.id}`}\n well={well}\n wellName={getWellName(section.wells, well.id)}\n rigName={well.rigName}\n onToggleWell={handleToggleWell}\n />\n ))}\n </List>\n </AccordionDetails>\n </Accordion>\n </div>\n )\n )}\n </div>\n );\n}\n\nWellSection.propTypes = {\n company: string.isRequired,\n wellSections: arrayOf(shape({})),\n getWellName: func.isRequired,\n onChangeWellSections: func.isRequired,\n onExploreMode: func.isRequired,\n};\n\nconst DEFAULT_WELL_SECTION_WELL_SECTIONS = [];\n\n// Important: Do not change root component default export (WellSection.js). Use it as container\n// for your WellSection. It's required to make build and zip scripts work as expected;\nexport default memo(WellSection);\n"],"names":["useStyles","makeStyles","theme","content","width","marginTop","sectionItem","display","flexDirection","justifyContent","alignItems","padding","fontSize","fontWeight","color","palette","primary","text6","borderTop","concat","text8","borderBottom","disabledSectionItem","wellList","margin","searchContainer","marginBottom","advancedSearch","cursor","textDecoration","WellSection","_ref","company","_ref$wellSections","wellSections","DEFAULT_WELL_SECTION_WELL_SECTIONS","getWellName","onChangeWellSections","onExploreMode","classes","selectAllWells","targetSection","f","selectedWellIds","find","section","name","wells","map","item","id","data","sectionData","well","includes","_objectSpread","checked","handleExpandCollapseSection","expanded","handleToggleWell","targetWell","handleSelectAll","handleClearAll","_jsxs","className","children","jsxs","_jsx","AssetSearch","onClickAsset","redirectAssetId","_toConsumableArray","push","kind","showSuccessNotification","Typography","onClick","length","classNames","SectionItem","disabled","jsx","Accordion","onChange","AccordionSummary","expandIcon","ExpandMore","style","onExpandCollapse","onSelectAll","onClearAll","AccordionDetails","List","dense","WellListItem","wellName","rigName","onToggleWell","propTypes","string","isRequired","arrayOf","shape","func","memo"],"mappings":"6nCAmBA,IAEMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,MAAO,QACPC,UAAW,QAEbC,YAAa,CACXC,QAAS,OACTC,cAAe,MACfC,eAAgB,gBAChBC,WAAY,SACZC,QAAS,MACTC,SAAU,OACVC,WAAY,SACZC,MAAOZ,EAAMa,QAAQC,QAAQC,MAC7BC,UAAS,aAAAC,OAAejB,EAAMa,QAAQC,QAAQI,OAC9C,eAAgB,CACdC,iCAA2BnB,EAAMa,QAAQC,QAAQI,SAGrDE,oBAAqB,CACnBR,MAAOZ,EAAMa,QAAQC,QAAQI,OAE/BG,SAAU,CACRnB,MAAO,OACPoB,OAAQ,EACRb,QAAS,GAEXc,gBAAiB,CACflB,QAAS,OACTE,eAAgB,gBAChBiB,aAAc,OACdhB,WAAY,UAEdiB,eAAgB,CACdf,SAAU,OACVC,WAAY,IACZC,MAAO,UACPc,OAAQ,UACR,UAAW,CACTC,eAAgB,cAGrB,IAED,SAASC,EAMNC,GAAA,IALDC,IAAAA,QAAOC,EAAAF,EACPG,aAAAA,aAAeC,EAAkCF,EACjDG,IAAAA,YACAC,IAAAA,qBACAC,IAAAA,cAEMC,EAAUvC,IAEVwC,EAAiB,SAACC,EAAeC,GACrC,IAAMC,EAAkBT,EACrBU,MAAK,SAAAC,GAAO,OAAIA,EAAQC,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BAAkB/B,EAClBgC,YAAa5B,EACb6B,WAAY5B,MAGhBK,MAACwB,mBAAgB,CAAA1B,SACfE,MAACyB,OAAI,CAACC,OAAK,EAAC7B,UAAWzB,EAAQhB,SAAS0C,SACrCpB,EAAQE,MAAMC,KAAI,SAAAK,GAAI,OACrBc,EAAAA,IAAC2B,EAAY,CAEXzC,KAAMA,EACN0C,SAAU3D,EAAYS,EAAQE,MAAOM,EAAKH,IAC1C8C,QAAS3C,EAAK2C,QACdC,aAActC,GAAiB,QAAAxC,OAJlB0B,EAAQC,iBAAQO,EAAKH,gBAjBzBL,WAAAA,OAAAA,EAAQC,YAgCvC,CAEAhB,EAAYoE,UAAY,CACtBlE,QAASmE,EAAMA,OAACC,WAChBlE,aAAcmE,EAAOA,QAACC,QAAM,CAAA,IAC5BlE,YAAamE,EAAIA,KAACH,WAClB/D,qBAAsBkE,EAAIA,KAACH,WAC3B9D,cAAeiE,EAAIA,KAACH,YAGtB,IAAMjE,EAAqC,GAI5BqE,EAAAA,EAAAA,KAAK1E"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/components/BICOffsetPickerDialog/components/WellSection/index.js"],"sourcesContent":["import { memo } from 'react';\nimport { string, shape, func, arrayOf } from 'prop-types';\nimport classNames from 'classnames';\nimport {\n makeStyles,\n List,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Typography,\n} from '@material-ui/core';\nimport { ExpandMore } from '@material-ui/icons';\n\nimport AssetSearch from './AssetSearch';\nimport SectionItem from './SectionItem';\nimport WellListItem from './WellListItem';\n\nimport { showSuccessNotification } from '~/utils';\n\nconst PAGE_NAME = 'WellSection';\n\nconst useStyles = makeStyles(theme => ({\n content: {\n width: '472px',\n marginTop: '24px',\n },\n sectionItem: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: '8px',\n fontSize: '12px',\n fontWeight: 'normal',\n color: theme.palette.primary.text6,\n borderTop: `1px solid ${theme.palette.primary.text8}`,\n '&:last-child': {\n borderBottom: `1px solid ${theme.palette.primary.text8}`,\n },\n },\n disabledSectionItem: {\n color: theme.palette.primary.text8,\n },\n wellList: {\n width: '100%',\n margin: 0,\n padding: 0,\n },\n searchContainer: {\n display: 'flex',\n justifyContent: 'space-between',\n marginBottom: '24px',\n alignItems: 'center',\n },\n advancedSearch: {\n fontSize: '14px',\n fontWeight: 500,\n color: '#03BCD4',\n cursor: 'pointer',\n '&:hover': {\n textDecoration: 'underline',\n },\n },\n}));\n\nfunction WellSection({\n company,\n wellSections = DEFAULT_WELL_SECTION_WELL_SECTIONS,\n getWellName,\n onChangeWellSections,\n onExploreMode,\n}) {\n const classes = useStyles();\n\n const selectAllWells = (targetSection, f) => {\n const selectedWellIds = wellSections\n .find(section => section.name === targetSection.name)\n .wells.map(item => item.id);\n\n const data = wellSections.map(section => {\n const sectionData = section.wells.map(well => {\n if (selectedWellIds.includes(well.id)) {\n return { ...well, checked: f };\n } else {\n return { ...well };\n }\n });\n return {\n ...section,\n wells: sectionData,\n };\n });\n onChangeWellSections(data);\n };\n\n const handleExpandCollapseSection = targetSection => {\n const data = wellSections.map(section => {\n if (section.name === targetSection.name) {\n return { ...section, expanded: !section.expanded };\n }\n return section;\n });\n onChangeWellSections(data);\n };\n\n const handleToggleWell = targetWell => {\n const data = wellSections.map(section => {\n const sectionData = section.wells.map(well => {\n if (well.id === targetWell.id) {\n return { ...well, checked: !well.checked };\n }\n return well;\n });\n return {\n ...section,\n wells: sectionData,\n };\n });\n onChangeWellSections(data);\n };\n\n const handleSelectAll = targetSection => {\n selectAllWells(targetSection, true);\n };\n\n const handleClearAll = targetSection => {\n selectAllWells(targetSection, false);\n };\n\n const handleClickAsset = (redirectAssetId, name) => {\n const data = wellSections.map(section => {\n if (section.name === 'Search Results') {\n const wells = [...section.wells];\n if (!section.wells.find(item => item.id === redirectAssetId)) {\n wells.push({ id: redirectAssetId, checked: true, name, kind: 'manual' });\n }\n return { ...section, wells };\n }\n return {\n ...section,\n wells: section.wells.map(well =>\n well.id === redirectAssetId ? { ...well, checked: true } : well\n ),\n };\n });\n onChangeWellSections(data);\n showSuccessNotification('Offset well successfully added!');\n };\n\n const handleOffsetPickerDialog = () => {\n onExploreMode();\n };\n\n return (\n <div className={classes.content}>\n <div className={classes.searchContainer}>\n <AssetSearch\n company={+company}\n onClickAsset={handleClickAsset}\n onExploreMode={onExploreMode}\n />\n <Typography\n data-testid={`${PAGE_NAME}_advancedSearch`}\n className={classes.advancedSearch}\n onClick={handleOffsetPickerDialog}\n >\n Advanced Search\n </Typography>\n </div>\n\n {(wellSections || []).map(section =>\n section.wells.length === 0 ? (\n <div\n key={`empty-${section.name}`}\n className={classNames(classes.sectionItem, classes.disabledSectionItem)}\n >\n <SectionItem section={section} disabled />\n </div>\n ) : (\n <div key={`section-${section.name}`} className={classes.sectionItem}>\n <Accordion\n expanded={section.expanded}\n onChange={() => handleExpandCollapseSection(section)}\n >\n <AccordionSummary expandIcon={<ExpandMore />} style={{ width: '100%' }}>\n <SectionItem\n section={section}\n onExpandCollapse={handleExpandCollapseSection}\n onSelectAll={handleSelectAll}\n onClearAll={handleClearAll}\n />\n </AccordionSummary>\n <AccordionDetails>\n <List dense className={classes.wellList}>\n {section.wells.map(well => (\n <WellListItem\n key={`well-${section.name}-${well.id}`}\n well={well}\n wellName={getWellName(section.wells, well.id)}\n rigName={well.rigName}\n onToggleWell={handleToggleWell}\n />\n ))}\n </List>\n </AccordionDetails>\n </Accordion>\n </div>\n )\n )}\n </div>\n );\n}\n\nWellSection.propTypes = {\n company: string.isRequired,\n wellSections: arrayOf(shape({})),\n getWellName: func.isRequired,\n onChangeWellSections: func.isRequired,\n onExploreMode: func.isRequired,\n};\n\nconst DEFAULT_WELL_SECTION_WELL_SECTIONS = [];\n\n// Important: Do not change root component default export (WellSection.js). Use it as container\n// for your WellSection. It's required to make build and zip scripts work as expected;\nexport default memo(WellSection);\n"],"names":["useStyles","makeStyles","theme","content","width","marginTop","sectionItem","display","flexDirection","justifyContent","alignItems","padding","fontSize","fontWeight","color","palette","primary","text6","borderTop","concat","text8","borderBottom","disabledSectionItem","wellList","margin","searchContainer","marginBottom","advancedSearch","cursor","textDecoration","WellSection","_ref","company","_ref$wellSections","wellSections","DEFAULT_WELL_SECTION_WELL_SECTIONS","getWellName","onChangeWellSections","onExploreMode","classes","selectAllWells","targetSection","f","selectedWellIds","find","section","name","wells","map","item","id","data","sectionData","well","includes","_objectSpread","checked","handleExpandCollapseSection","expanded","handleToggleWell","targetWell","handleSelectAll","handleClearAll","_jsxs","className","children","jsxs","_jsx","AssetSearch","onClickAsset","redirectAssetId","_toConsumableArray","push","kind","showSuccessNotification","Typography","onClick","length","classNames","SectionItem","disabled","jsx","Accordion","onChange","AccordionSummary","expandIcon","ExpandMore","style","onExpandCollapse","onSelectAll","onClearAll","AccordionDetails","List","dense","WellListItem","wellName","rigName","onToggleWell","propTypes","string","isRequired","arrayOf","shape","func","memo"],"mappings":"kmGAmBA,IAEMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,MAAO,QACPC,UAAW,QAEbC,YAAa,CACXC,QAAS,OACTC,cAAe,MACfC,eAAgB,gBAChBC,WAAY,SACZC,QAAS,MACTC,SAAU,OACVC,WAAY,SACZC,MAAOZ,EAAMa,QAAQC,QAAQC,MAC7BC,UAAS,aAAAC,OAAejB,EAAMa,QAAQC,QAAQI,OAC9C,eAAgB,CACdC,iCAA2BnB,EAAMa,QAAQC,QAAQI,SAGrDE,oBAAqB,CACnBR,MAAOZ,EAAMa,QAAQC,QAAQI,OAE/BG,SAAU,CACRnB,MAAO,OACPoB,OAAQ,EACRb,QAAS,GAEXc,gBAAiB,CACflB,QAAS,OACTE,eAAgB,gBAChBiB,aAAc,OACdhB,WAAY,UAEdiB,eAAgB,CACdf,SAAU,OACVC,WAAY,IACZC,MAAO,UACPc,OAAQ,UACR,UAAW,CACTC,eAAgB,cAGrB,IAED,SAASC,EAMNC,GAAA,IALDC,IAAAA,QAAO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