@corva/ui 3.24.0-9 → 3.24.0

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 (211) hide show
  1. package/cjs-bundle/components/AddComment/Popover.js +1 -1
  2. package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
  3. package/cjs-bundle/components/AddComment/components/Content.js +1 -1
  4. package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
  5. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  6. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  7. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  8. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  9. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  10. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  11. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  12. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  13. package/cjs-bundle/components/CollapsableSidebar.js +1 -1
  14. package/cjs-bundle/components/CollapsableSidebar.js.map +1 -1
  15. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
  16. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/dataResolvers.js.map +1 -1
  17. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  18. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  19. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
  20. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js +1 -1
  21. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js +1 -1
  22. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js.map +1 -1
  23. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  24. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  25. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  26. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  27. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  28. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  29. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  30. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  31. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  32. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  33. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  34. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  35. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  36. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  37. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  38. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  39. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  40. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  41. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  42. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  43. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  44. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  45. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  46. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  47. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  48. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  49. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  50. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  51. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  52. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  53. package/cjs-bundle/components/FeedItem/FeedItem.js +1 -1
  54. package/cjs-bundle/components/FeedItem/FeedItem.js.map +1 -1
  55. package/cjs-bundle/components/FeedItem/components/FeedComments.js +1 -1
  56. package/cjs-bundle/components/FeedItem/components/FeedComments.js.map +1 -1
  57. package/cjs-bundle/components/ImageViewer/index.js +1 -1
  58. package/cjs-bundle/components/ImageViewer/index.js.map +1 -1
  59. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  60. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  61. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  62. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  63. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  64. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  65. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  66. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  67. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  68. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  69. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  70. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  71. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  72. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  73. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  74. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  75. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  76. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  77. package/cjs-bundle/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
  78. package/cjs-bundle/components/OffsetWellPickerV4/OffsetWellPickerV4.js.map +1 -1
  79. package/cjs-bundle/components/OffsetWellPickerV4/components/Filter/Filter.js +1 -1
  80. package/cjs-bundle/components/OffsetWellPickerV4/components/Filter/Filter.js.map +1 -1
  81. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/MetricsSettingMenu.js +1 -1
  82. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/MetricsSettingMenu.js.map +1 -1
  83. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js +1 -1
  84. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js.map +1 -1
  85. package/cjs-bundle/components/OffsetWellPickerV4/components/Toolbar/Toolbar.js +1 -1
  86. package/cjs-bundle/components/OffsetWellPickerV4/components/Toolbar/Toolbar.js.map +1 -1
  87. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  88. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  89. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  90. package/cjs-bundle/components/Popover/Popover.js +1 -1
  91. package/cjs-bundle/components/Popper/Popper.js +1 -1
  92. package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
  93. package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
  94. package/cjs-bundle/componentsV2/DragHandle/DragHandle.js +2 -0
  95. package/cjs-bundle/componentsV2/DragHandle/DragHandle.js.map +1 -0
  96. package/cjs-bundle/componentsV2/WellArchivedMessage/WellArchivedMessage.js +1 -1
  97. package/cjs-bundle/componentsV2/index.js +1 -1
  98. package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js +1 -1
  99. package/components/AddComment/Popover.js +1 -1
  100. package/components/AddComment/Popover.js.map +1 -1
  101. package/components/AddComment/components/Content.js +1 -1
  102. package/components/AddComment/components/Content.js.map +1 -1
  103. package/components/BICOffsetPickerDialog/index.js +1 -1
  104. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  105. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  106. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  107. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  108. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  109. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  110. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  111. package/components/CollapsableSidebar.js +1 -1
  112. package/components/CollapsableSidebar.js.map +1 -1
  113. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.d.ts.map +1 -1
  114. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
  115. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js.map +1 -1
  116. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  117. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  118. package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
  119. package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js +1 -1
  120. package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js +1 -1
  121. package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js.map +1 -1
  122. package/components/DocumentViewer/DocumentViewer.js +1 -1
  123. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  124. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  125. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  126. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  127. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  128. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  129. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  130. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  131. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  132. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  133. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  134. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  135. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  136. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  137. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  138. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  139. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  140. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  141. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  142. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  143. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  144. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  145. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  146. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  147. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  148. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  149. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  150. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  151. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  152. package/components/FeedItem/FeedItem.js +1 -1
  153. package/components/FeedItem/FeedItem.js.map +1 -1
  154. package/components/FeedItem/components/FeedComments.js +1 -1
  155. package/components/FeedItem/components/FeedComments.js.map +1 -1
  156. package/components/ImageViewer/index.js +1 -1
  157. package/components/ImageViewer/index.js.map +1 -1
  158. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  159. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  160. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  161. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  162. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  163. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  164. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  165. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  166. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  167. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  168. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  169. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  170. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  171. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  172. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  173. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  174. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  175. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  176. package/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
  177. package/components/OffsetWellPickerV4/OffsetWellPickerV4.js.map +1 -1
  178. package/components/OffsetWellPickerV4/components/Filter/Filter.js +1 -1
  179. package/components/OffsetWellPickerV4/components/Filter/Filter.js.map +1 -1
  180. package/components/OffsetWellPickerV4/components/OffsetWellsTable/MetricsSettingMenu.js +1 -1
  181. package/components/OffsetWellPickerV4/components/OffsetWellsTable/MetricsSettingMenu.js.map +1 -1
  182. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js +1 -1
  183. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js.map +1 -1
  184. package/components/OffsetWellPickerV4/components/Toolbar/Toolbar.js +1 -1
  185. package/components/OffsetWellPickerV4/components/Toolbar/Toolbar.js.map +1 -1
  186. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  187. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  188. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  189. package/components/Popover/Popover.js +1 -1
  190. package/components/Popper/Popper.js +1 -1
  191. package/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
  192. package/componentsV2/ButtonIcon/ButtonIcon.d.ts +3 -0
  193. package/componentsV2/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  194. package/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
  195. package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts.map +1 -1
  196. package/componentsV2/DragHandle/DragHandle.d.ts +12 -0
  197. package/componentsV2/DragHandle/DragHandle.d.ts.map +1 -0
  198. package/componentsV2/DragHandle/DragHandle.js +2 -0
  199. package/componentsV2/DragHandle/DragHandle.js.map +1 -0
  200. package/componentsV2/DragHandle/DragHandle.stories.d.ts +9 -0
  201. package/componentsV2/DragHandle/DragHandle.stories.d.ts.map +1 -0
  202. package/componentsV2/DragHandle/index.d.ts +2 -0
  203. package/componentsV2/DragHandle/index.d.ts.map +1 -0
  204. package/componentsV2/WellArchivedMessage/WellArchivedMessage.js +1 -1
  205. package/componentsV2/index.d.ts +1 -0
  206. package/componentsV2/index.d.ts.map +1 -1
  207. package/componentsV2/index.js +1 -1
  208. package/componentsV2/types.d.ts +3 -0
  209. package/componentsV2/types.d.ts.map +1 -0
  210. package/package.json +1 -1
  211. package/testing/AppTestWrapper/AppTestWrapper.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"OffsetWellPickerV4.js","sources":["../../../src/components/OffsetWellPickerV4/OffsetWellPickerV4.js"],"sourcesContent":["import { useState, useEffect, useRef, useCallback, useMemo } from 'react';\nimport classNames from 'classnames';\nimport { isEmpty, uniq, uniqBy, sortBy as sortArray } from 'lodash';\nimport { InfoOutlined, Replay as ReplayIcon } from '@material-ui/icons';\n\nimport {\n useAdvancedWells,\n useBicWells,\n useFilterOptions,\n useCompanyMetricKey,\n useFilteredWells,\n useSortedWells,\n useTableColumns,\n useCompanyProvider,\n} from './effects';\nimport { useFetchWells } from './effects/useFetchWells';\nimport { AppHeader } from './components/AppHeader';\nimport { Toolbar } from './components/Toolbar';\nimport { Filter } from './components/Filter';\nimport { WellsMap } from './components/Map';\nimport { OffsetWellsTable } from './components/OffsetWellsTable';\nimport {\n ALL_SECTION_KEY,\n ColumnType,\n COMPANY_PROVIDERS_FOR_IDAS,\n DEFAULT_BIC_OFFSET_SIZE,\n DEFAULT_LOCAL_OFFSET_SIZE,\n FilterType,\n IOS_DEVICE,\n LEAVE_TOUCH_DELAY,\n MAX_OFFSET_SIZE,\n ROWS_PER_PAGE,\n SMALL_SCREEN_HEIGHT,\n SMALL_SCREEN_WIDTH,\n TOP_GRADIENT_MAP,\n ViewType,\n RESYNC_STATUS,\n} from './constants';\nimport { SEARCH_CATEGORIES } from './components/OffsetWellsTable/AdvancedSearch/constants';\nimport { getCoordinatedWells, getMobileOperatingSystem } from './utils';\n\nimport styles from './OffsetWellPickerV4.module.css';\n\nimport { showInfoNotification } from '~/utils';\nimport { NotificationsContainer } from '~/components/Notifications';\nimport { isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { typography } from '~/styles';\nimport { Regular12, Regular14 } from '~/components/Typography';\nimport { Button, Modal, LoadingIndicator, Tooltip } from '~/components';\n\nconst PAGE_NAME = 'OffsetWellPickerV4';\n\n/**\n * @type {React.FC<import('./OffsetWellPickerV4.types').OffsetWellPickerV4Props>}\n */\nconst OffsetWellPickerV4 = ({\n open,\n isWDUser,\n defaultSubjectWell,\n currentUser,\n offsetSettings,\n addWellsUsabilityInfo,\n isViewOnly,\n onClose,\n onSave,\n maxOffsetSize: offsetSize = DEFAULT_BIC_OFFSET_SIZE,\n localMaxOffsetSize = DEFAULT_LOCAL_OFFSET_SIZE,\n syncAutoEnabled,\n isManualWellsEnabled = false,\n}) => {\n const [activeWellId, setActiveWellId] = useState(null);\n const maxOffsetSize = Math.min(offsetSize + 1, localMaxOffsetSize + 1, MAX_OFFSET_SIZE + 1);\n const maxOffsetWellNumber = Math.min(\n Math.max(maxOffsetSize, localMaxOffsetSize + 1),\n MAX_OFFSET_SIZE + 1\n );\n\n const [isFilterExpanded, setIsFilterExpanded] = useState(offsetSettings?.filterExpanded);\n const [isMapHidden, setIsMapHidden] = useState(offsetSettings?.mapHidden);\n const assetCompanyId = +defaultSubjectWell?.companyId || +currentUser?.company_id;\n const subjectWellId = defaultSubjectWell?.asset_id;\n const [filters, setFilters] = useState(offsetSettings?.filters || {});\n const [selectedWellSection, setSelectedWellSection] = useState(\n offsetSettings?.wellSection || ALL_SECTION_KEY\n );\n const initLoading = useRef(true);\n const [selectedWells, setSelectedWells] = useState([]);\n const [subjectWell, setSubjectWell] = useState(null);\n const [isTableLoading, setIsTableLoading] = useState(true);\n const [isWellNameExpand, setIsWellNameExpand] = useState(false);\n const [isAdvancedSearchHidden, setIsAdvancedSearchHidden] = useState(false);\n const contentRef = useRef();\n const offsetWellsContainerRef = useRef();\n /** @type {ReturnType<typeof useState<string>>} */\n const [viewType, setViewType] = useState(ViewType.none);\n\n /** @type {ReturnType<typeof useRef<string>>} */\n const prevViewType = useRef();\n const [isTopGradientShow, setIsTopGradientShow] = useState(false);\n const isLimitedOffsetWells = maxOffsetWellNumber <= selectedWells?.length;\n const topGradientTop = TOP_GRADIENT_MAP[viewType];\n\n /** @type {ReturnType<typeof useRef<number[]>>} */\n const prevSelectedWellIds = useRef();\n const [appLoading, setAppLoading] = useState(true);\n\n useEffect(() => {\n if (open && isLimitedOffsetWells) {\n showInfoNotification(\n `App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`\n );\n }\n // NOTE: Refresh when the offset well changes externally\n if (!open) {\n const isNotChanged =\n offsetSettings?.selectedWellIds?.length === prevSelectedWellIds.current?.length &&\n offsetSettings?.selectedWellIds?.every(id => prevSelectedWellIds.current?.includes(id));\n if (!isNotChanged) {\n initLoading.current = true;\n }\n prevSelectedWellIds.current = offsetSettings?.selectedWellIds;\n }\n }, [isLimitedOffsetWells, open, offsetSettings]);\n\n useEffect(() => {\n function handleResize() {\n if (window.innerWidth <= SMALL_SCREEN_WIDTH || isMobileDetected || isNativeDetected) {\n setViewType(ViewType.mobile);\n } else if (window.innerHeight <= SMALL_SCREEN_HEIGHT) {\n setViewType(ViewType.small);\n } else {\n setViewType(ViewType.normal);\n }\n }\n handleResize();\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [open]);\n\n useEffect(() => {\n if (prevViewType.current && viewType === prevViewType.current) return;\n prevViewType.current = viewType;\n if (viewType === ViewType.small || viewType === ViewType.mobile) {\n setIsMapHidden(true);\n setIsFilterExpanded(false);\n } else {\n setIsFilterExpanded(!isViewOnly && offsetSettings?.filterExpanded);\n setIsMapHidden(!isViewOnly && offsetSettings?.mapHidden);\n }\n setFilters(offsetSettings?.filters || {});\n setSelectedWellSection(offsetSettings?.wellSection || ALL_SECTION_KEY);\n }, [offsetSettings, isViewOnly, viewType]);\n\n // NOTE: Fetch all wells\n const [rawWells, areWellsLoading] = useFetchWells(assetCompanyId, addWellsUsabilityInfo);\n const [companyProvider] = useCompanyProvider(assetCompanyId);\n const [\n wellSections,\n setWellSections,\n bicWells,\n setBicWells,\n resyncStatus,\n setResyncStatus,\n taScores,\n ] = useBicWells(isWDUser, currentUser, subjectWellId, rawWells, isManualWellsEnabled);\n\n useEffect(() => {\n setAppLoading(true);\n setWellSections(null);\n setBicWells(null);\n }, [subjectWellId]);\n\n const [metricsKeys, setMetricsKeys] = useCompanyMetricKey(\n assetCompanyId,\n offsetSettings?.metricsKeys\n );\n\n // NOTE: Calculate wells with coordinates, metrics and well section name\n const wells = useAdvancedWells(\n assetCompanyId,\n rawWells,\n wellSections,\n bicWells,\n subjectWellId,\n metricsKeys,\n open\n );\n\n const isAllWellsLoaded = !areWellsLoading && wells?.length === rawWells?.length;\n\n useEffect(() => {\n if (!isAllWellsLoaded) return;\n const syncOffsetWells = async () => {\n const isSynced = typeof offsetSettings?.isSynced === 'undefined' || offsetSettings?.isSynced;\n let offsetWellsChanged = true;\n if (isSynced) {\n const bicWellIds = bicWells[ALL_SECTION_KEY] || [];\n const isMatched = (offsetSettings?.selectedWellIds || []).every(wellId =>\n bicWellIds.includes(wellId)\n );\n // if well hub or offset selection app be changed\n if (bicWellIds.length !== offsetSettings?.selectedWellIds?.length || !isMatched) {\n const wellsByDistance = await getCoordinatedWells(bicWellIds, subjectWellId);\n let selectedWellIds = wellsByDistance.slice(0, maxOffsetSize + 1).map(well => well.id);\n selectedWellIds = wellsByDistance.slice(0, localMaxOffsetSize + 1).map(well => well.id);\n const newOffsetSetting = {\n ...offsetSettings,\n subjectWellId,\n selectedWellIds,\n offsetWellsLimited: maxOffsetWellNumber <= selectedWellIds.length,\n };\n const offsetWells = wellsByDistance.filter(well => selectedWellIds.includes(well.id));\n onSave(newOffsetSetting, offsetWells);\n } else {\n offsetWellsChanged = false;\n }\n } else {\n offsetWellsChanged = false;\n }\n\n if (!offsetWellsChanged) {\n const offsetWells = await getCoordinatedWells(\n offsetSettings?.selectedWellIds || [],\n subjectWellId\n );\n onSave(offsetSettings, offsetWells);\n }\n };\n\n if (syncAutoEnabled && appLoading && offsetSettings && bicWells) {\n syncOffsetWells();\n setAppLoading(false);\n }\n }, [offsetSettings, bicWells, subjectWellId, maxOffsetWellNumber, syncAutoEnabled]);\n\n const filterOptions = useFilterOptions(wells);\n\n // NOTE: Subject well\n useEffect(() => {\n if (wells && wellSections) {\n const defaultSubjectWell = wells.find(well => well.id === subjectWellId);\n if (defaultSubjectWell) {\n const allSectionNames = wellSections\n .filter(item => item.value !== ALL_SECTION_KEY)\n .map(({ label }) => label);\n const subjectWellWithSection = {\n ...defaultSubjectWell,\n ...(allSectionNames.length > 0 && { [ColumnType.wellSection]: allSectionNames }),\n };\n setSubjectWell(subjectWellWithSection);\n } else {\n setSubjectWell(null);\n }\n }\n }, [wellSections, wells]);\n\n // NOTE: Table columns with metrics\n const columnsWithDict = useTableColumns(metricsKeys);\n\n // NOTE: Filter wells\n const filteredWells = useFilteredWells(wells, filters);\n\n useEffect(() => {\n if (!filteredWells || !isAllWellsLoaded) return;\n\n if (initLoading.current) {\n let data = wells.filter(well => (offsetSettings?.selectedWellIds || []).includes(well.id));\n if (subjectWell) data = data.concat(subjectWell);\n setSelectedWells(uniqBy(data, 'id'));\n initLoading.current = false;\n } else {\n setSelectedWells(prev => {\n let newSelectedWells = (filteredWells || []).filter(\n well => !!prev.find(({ id }) => well.id === id)\n );\n if (subjectWell) newSelectedWells = newSelectedWells.concat(subjectWell);\n return uniqBy(newSelectedWells, 'id');\n });\n }\n }, [wells, filteredWells, offsetSettings?.selectedWellIds, isAllWellsLoaded]);\n\n // NOTE: Sort wells\n const [sortBy, setSortBy, sortDirection, setSortDirection, sortedWells] = useSortedWells(\n subjectWell,\n filteredWells,\n selectedWells,\n setIsTableLoading\n );\n\n // NOTE: Add advanced wells\n const handleAddRemoveAssets = useCallback(\n (isAdding, newAssets, assetType) => {\n let addingWellIds;\n if (assetType === SEARCH_CATEGORIES.well.name) {\n addingWellIds = newAssets;\n } else {\n addingWellIds = newAssets.reduce((acc, assetId) => {\n const rigName = wells.find(well => well.id === assetId)?.rigName;\n const rigWellIds = wells.filter(well => well.rigName === rigName).map(well => well.id);\n return acc.concat(rigWellIds);\n }, []);\n }\n let addingWells = wells.filter(({ id }) => addingWellIds.includes(id));\n if (isAdding) {\n addingWells = addingWells.slice(\n 0,\n Math.min(addingWells.length, maxOffsetWellNumber - selectedWells.length)\n );\n setSelectedWells(selectedWells => uniqBy(selectedWells.concat(addingWells), 'id'));\n } else {\n setSelectedWells(selectedWells =>\n uniq(selectedWells.filter(({ id }) => !addingWells.find(well => well.id === id)))\n );\n }\n },\n [wells, selectedWells]\n );\n\n const handleHideAdvancedSearch = useCallback(() => {\n setIsAdvancedSearchHidden(true);\n }, []);\n\n // NOTE: Change metrics keys\n const handleChangeMetricsKeys = useCallback(newMetricsKeys => {\n setMetricsKeys(newMetricsKeys);\n }, []);\n\n // NOTE: Check and Uncheck one offset well\n const handleChangeOffsetWell = useCallback((well, checked) => {\n if (checked) {\n setSelectedWells(prevWells => [...prevWells, well]);\n } else {\n setSelectedWells(prevWells => prevWells.filter(item => item.id !== well.id));\n }\n }, []);\n\n // NOTE: Select and Unselect All wells\n const handleChangeAllOffsetWells = useCallback(\n checked => {\n if (checked) {\n const data = subjectWell ? filteredWells.concat(subjectWell) : filteredWells;\n const sortedData = sortArray(uniqBy(data, 'id'), 'distance');\n setSelectedWells(sortedData.slice(0, maxOffsetWellNumber));\n } else {\n setSelectedWells(subjectWell ? [subjectWell] : []);\n }\n },\n [filteredWells, subjectWell, maxOffsetWellNumber]\n );\n\n // NOTE: Well Section change filter\n const updateSelectedWellsBySection = section => {\n if (bicWells) {\n const sectionWells = wells?.filter(well => bicWells[section]?.includes(well.id)) || [];\n const limitedWells = sortArray(sectionWells, 'distance');\n setSelectedWells(limitedWells.slice(0, maxOffsetSize));\n } else {\n setSelectedWells(subjectWell ? [subjectWell] : []);\n }\n };\n\n const handleChangeWellSection = useCallback(\n section => {\n setSelectedWellSection(section);\n updateSelectedWellsBySection(section);\n },\n [updateSelectedWellsBySection]\n );\n\n // NOTE: Get Selected wells count\n const selectedWellsCount = useMemo(() => {\n if (selectedWells.find(well => well.id === subjectWellId)) {\n return selectedWells.length - 1;\n }\n return selectedWells.length;\n }, [selectedWells, subjectWellId]);\n\n // NOTE: Save offset setting\n const isSynced = useMemo(() => {\n if (!bicWells) return false;\n const selectedWellIds = selectedWells.map(({ id }) => id);\n let synced;\n const owsWellIds = bicWells[selectedWellSection] || [];\n const owsWellIdsLength = Math.min(owsWellIds.length, maxOffsetSize);\n\n if (owsWellIdsLength !== selectedWellIds.length) {\n synced = false;\n } else {\n synced = selectedWellIds.every(id => owsWellIds.includes(id));\n }\n return synced;\n }, [bicWells, selectedWells, selectedWellSection, maxOffsetSize]);\n\n const isXtoProvider = useMemo(() => {\n return companyProvider ? COMPANY_PROVIDERS_FOR_IDAS.includes(companyProvider) : false;\n }, [companyProvider]);\n\n const offsetLabel = useMemo(() => {\n if (isXtoProvider) {\n return 'IDAS generated offsets.';\n }\n\n return isWDUser ? 'Offset Selection App.' : 'WellHub.';\n }, [isXtoProvider, isWDUser]);\n\n const handleSave = () => {\n onClose();\n\n const newOffsetSetting = {\n ...offsetSettings,\n companyId: assetCompanyId,\n subjectWellId,\n selectedWellIds: selectedWells.map(({ id }) => id),\n filters,\n metricsKeys,\n wellSection: selectedWellSection,\n isSynced,\n mapHidden: isMapHidden,\n filterExpanded: isFilterExpanded,\n offsetWellsLimited: isLimitedOffsetWells,\n };\n onSave(newOffsetSetting, selectedWells);\n };\n\n const handleCancel = () => {\n let data = (wells || []).filter(well =>\n (offsetSettings?.selectedWellIds || []).includes(well.id)\n );\n if (subjectWell) data = data.concat(subjectWell);\n setSelectedWells(uniqBy(data, 'id'));\n\n const newOffsetSetting = {\n ...offsetSettings,\n mapHidden: isMapHidden,\n filterExpanded: isFilterExpanded,\n };\n onSave(newOffsetSetting);\n setFilters(offsetSettings?.filters || {});\n setSelectedWellSection(offsetSettings?.wellSection || ALL_SECTION_KEY);\n onClose();\n };\n\n const isTableFullLoading = isTableLoading || areWellsLoading;\n\n // NOTE: Reset processing\n const isResetVisible = useMemo(() => {\n if (isTableFullLoading) return false;\n if (!isSynced) return true;\n if (!isEmpty(filters) && filters[FilterType.sideTracks]) return true;\n if (selectedWellSection !== ALL_SECTION_KEY) return true;\n return false;\n }, [isSynced, filters, selectedWellSection, isTableFullLoading]);\n\n const handleReset = () => {\n setFilters({});\n setSelectedWellSection(ALL_SECTION_KEY);\n updateSelectedWellsBySection(ALL_SECTION_KEY);\n };\n\n const isLoading = !wells || !wellSections || !sortedWells || viewType === ViewType.none;\n\n // NOTE: Well Name shadow\n const [isHScrollMoved, setIsHScrollMoved] = useState(false);\n const [tableRowsCount, setTableRowsCount] = useState(ROWS_PER_PAGE);\n const [tableWells, setTableWells] = useState([]);\n\n useEffect(() => {\n if (!sortedWells) return;\n\n const wells = sortedWells.slice(0, tableRowsCount);\n setTableWells(wells);\n }, [sortedWells, tableRowsCount, subjectWell]);\n\n useEffect(() => {\n if (resyncStatus === RESYNC_STATUS.SUCCEEDED) {\n handleReset();\n }\n }, [bicWells]);\n\n const handleScroll = e => {\n if (!e.target) return;\n\n if (isAdvancedSearchHidden) {\n e.target.scrollLeft = 0;\n setIsAdvancedSearchHidden(false);\n }\n\n // Check if H-Scroll is visible\n if (e.target.scrollLeft <= 5 && isHScrollMoved) {\n setIsHScrollMoved(false);\n }\n if (e.target.scrollLeft > 5 && !isHScrollMoved) {\n setIsHScrollMoved(true);\n }\n\n if (e.target.scrollTop <= 5 && isTopGradientShow) {\n setIsTopGradientShow(false);\n }\n if (e.target.scrollTop > 5 && !isTopGradientShow) {\n setIsTopGradientShow(true);\n }\n\n // Check if scroll has reached top or bottom\n if (e.target.scrollHeight === e.target.offsetHeight) return;\n\n const currentScrollBottom = Math.round(e.target.scrollTop + e.target.offsetHeight + 2);\n\n if (currentScrollBottom >= e.target.scrollHeight && tableRowsCount < sortedWells.length) {\n setTableRowsCount(count => count + ROWS_PER_PAGE);\n }\n };\n\n const tooltipContainer = () => {\n return (\n <div>\n <span className={classNames(typography.regular12, typography.colors.t1)}>\n The offset list is being automatically populated by&nbsp;\n </span>\n <span className={classNames(typography.medium12, typography.colors.t1)}>{offsetLabel}</span>\n </div>\n );\n };\n\n return (\n <Modal\n open={open}\n onClose={handleCancel}\n title={\n <AppHeader\n isWDUser={isWDUser}\n viewType={viewType}\n totalCount={wells?.length ?? 0}\n selectedCount={selectedWellsCount}\n isViewOnly={isViewOnly}\n maxOffsetWellNumber={maxOffsetWellNumber}\n />\n }\n isMobile={viewType === ViewType.mobile}\n contentContainerClassName={classNames(styles.offsetWellDialog)}\n contentClassName={classNames(styles.contentContainer, {\n [styles.smallContainer]: viewType === ViewType.small,\n [styles.contentContainerMobile]: viewType === ViewType.mobile,\n })}\n actionsClassName={styles.modalActions}\n actions={\n !isViewOnly && (\n <div className={styles.actionsWrapper}>\n {!isLoading && isResetVisible ? (\n <Tooltip\n placement=\"bottom-start\"\n title={`Reset to Synced Offsets in ${isWDUser ? 'Offset App' : 'Wellhub'}`}\n >\n <div>\n <Button\n data-testid={`${PAGE_NAME}_reset`}\n onClick={handleReset}\n color=\"primary\"\n startIcon={viewType !== ViewType.mobile && <ReplayIcon />}\n classes={viewType === ViewType.mobile && { root: styles.resetButtonMobile }}\n >\n {viewType !== ViewType.mobile ? 'Reset' : <ReplayIcon />}\n </Button>\n </div>\n </Tooltip>\n ) : (\n <div className={viewType === ViewType.mobile && styles.infoIconContainer}>\n {viewType !== ViewType.mobile ? (\n <>\n <span className={classNames(typography.regular12, typography.colors.t6)}>\n The offset list is being automatically populated by&nbsp;\n </span>\n <span className={classNames(typography.medium12, typography.colors.t6)}>\n {offsetLabel}\n </span>\n </>\n ) : (\n <Tooltip\n title={tooltipContainer()}\n enterTouchDelay={0}\n leaveTouchDelay={LEAVE_TOUCH_DELAY}\n >\n <InfoOutlined className={styles.infoIcon} />\n </Tooltip>\n )}\n </div>\n )}\n <div className={styles.buttonGap}>\n <Button data-testid={`${PAGE_NAME}_cancel`} onClick={handleCancel} color=\"primary\">\n Cancel\n </Button>\n <Button\n data-testid={`${PAGE_NAME}_selectedWells`}\n variant=\"contained\"\n color=\"primary\"\n onClick={handleSave}\n >\n Select ({selectedWellsCount})\n </Button>\n </div>\n </div>\n )\n }\n >\n <NotificationsContainer />\n {!isLoading ? (\n <div\n className={classNames(styles.contentWrapper, {\n [styles.contentBlocked]: isTableFullLoading,\n })}\n ref={contentRef}\n >\n {viewType === ViewType.mobile && (\n <div\n className={classNames(styles.countContainer, {\n [styles.countContainerMobile]: viewType === ViewType.mobile,\n })}\n >\n <Regular14 className={styles.totalLabel}>Total:</Regular14>\n <Regular14 data-testid={`${PAGE_NAME}_totalWells`} className={styles.countValue}>\n {wells.length}\n </Regular14>\n <Regular14 className={styles.selectedLabel}>Selected:</Regular14>\n <Regular14 data-testid={`${PAGE_NAME}_selected`} className={styles.countValue}>\n {selectedWellsCount}\n </Regular14>\n <Tooltip\n title={`App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`}\n placement=\"right\"\n >\n <Regular12\n data-testid={`${PAGE_NAME}_maxOffsetSize`}\n className={styles.maxOffsetSize}\n >\n /{maxOffsetWellNumber - 1}\n </Regular12>\n </Tooltip>\n </div>\n )}\n\n {viewType === ViewType.normal && (\n <Toolbar\n isViewOnly={isViewOnly}\n isXtoProvider={isXtoProvider}\n viewType={viewType}\n filters={filters}\n setFilters={setFilters}\n isFilterExpanded={isFilterExpanded}\n setIsFilterExpanded={setIsFilterExpanded}\n isMapHidden={isMapHidden}\n setIsMapHidden={setIsMapHidden}\n resyncStatus={resyncStatus}\n setResyncStatus={setResyncStatus}\n />\n )}\n\n {isTopGradientShow && (\n <div className={styles.topGradient} style={{ top: topGradientTop }} />\n )}\n <div\n className={classNames(styles.content, {\n [styles.contentBlocked]: isTableFullLoading,\n [styles.contentMobile]: viewType === ViewType.mobile,\n [styles.contentiOSMobile]: getMobileOperatingSystem() === IOS_DEVICE,\n })}\n ref={offsetWellsContainerRef}\n onScroll={e => handleScroll(e)}\n >\n {viewType !== ViewType.normal && (\n <Toolbar\n isViewOnly={isViewOnly}\n isXtoProvider={isXtoProvider}\n viewType={viewType}\n filters={filters}\n setFilters={setFilters}\n isFilterExpanded={isFilterExpanded}\n setIsFilterExpanded={setIsFilterExpanded}\n isMapHidden={isMapHidden}\n setIsMapHidden={setIsMapHidden}\n resyncStatus={resyncStatus}\n setResyncStatus={setResyncStatus}\n />\n )}\n {!isMapHidden && open && (\n <WellsMap\n isViewOnly={isViewOnly}\n mapHidden={isMapHidden}\n subjectWell={subjectWell}\n offsetWellIds={selectedWells.map(({ id }) => id)}\n wells={filteredWells}\n radius={filters[FilterType.radius]}\n handleChangeOffsetWell={handleChangeOffsetWell}\n activeWellId={activeWellId}\n viewType={viewType}\n />\n )}\n <Filter\n isHidden={!isFilterExpanded}\n isWDUser={isWDUser}\n filterOptions={filterOptions}\n filters={filters}\n wellSections={wellSections}\n selectedWellSection={selectedWellSection}\n subjectWell={subjectWell}\n onChangeFilters={value => {\n setIsTableLoading(true);\n setTimeout(() => setFilters(value), 0);\n }}\n onChangeBicWells={handleChangeWellSection}\n />\n <OffsetWellsTable\n open={open}\n isTableLoading={isTableFullLoading}\n companyId={assetCompanyId}\n subjectWellId={subjectWellId}\n sortBy={sortBy}\n setSortBy={setSortBy}\n sortDirection={sortDirection}\n setSortDirection={setSortDirection}\n columnsWithDict={columnsWithDict}\n wells={tableWells}\n metricsKeys={metricsKeys}\n setMetricsKeys={handleChangeMetricsKeys}\n handleChangeOffsetWell={handleChangeOffsetWell}\n handleChangeAllOffsetWells={handleChangeAllOffsetWells}\n handleAddRemoveAssets={handleAddRemoveAssets}\n isWellNameExpand={isWellNameExpand}\n setIsWellNameExpand={setIsWellNameExpand}\n isHScrollMoved={isHScrollMoved}\n onHideAdvancedSearch={handleHideAdvancedSearch}\n isViewOnly={isViewOnly}\n isLastWell={sortedWells.length <= tableRowsCount}\n contentRef={contentRef}\n offsetWellsContainerRef={offsetWellsContainerRef}\n isLimitedOffsetWells={isLimitedOffsetWells}\n maxOffsetWellNumber={maxOffsetWellNumber}\n wellSections={wellSections}\n setActiveWellId={setActiveWellId}\n viewType={viewType}\n isWDUser={isWDUser}\n taScores={taScores}\n />\n </div>\n {isViewOnly && (\n <div className={styles.viewOnlyInfoContainer}>\n <span className={classNames(typography.regular12, typography.colors.t6)}>\n The offset list is being automatically populated by&nbsp;\n </span>\n <span className={classNames(typography.medium12, typography.colors.t6)}>\n {offsetLabel}\n </span>\n </div>\n )}\n </div>\n ) : (\n <LoadingIndicator fullscreen={false} />\n )}\n </Modal>\n );\n};\n\nexport default OffsetWellPickerV4;\n"],"names":["PAGE_NAME","OffsetWellPickerV4","_ref","_wells$length","_classNames","_classNames4","open","isWDUser","defaultSubjectWell","currentUser","offsetSettings","addWellsUsabilityInfo","isViewOnly","onClose","onSave","_ref$maxOffsetSize","maxOffsetSize","offsetSize","DEFAULT_BIC_OFFSET_SIZE","_ref$localMaxOffsetSi","localMaxOffsetSize","DEFAULT_LOCAL_OFFSET_SIZE","syncAutoEnabled","_ref$isManualWellsEna","isManualWellsEnabled","useState","_useState2","_slicedToArray","_useState","activeWellId","setActiveWellId","Math","min","MAX_OFFSET_SIZE","maxOffsetWellNumber","max","filterExpanded","_useState4","_useState3","isFilterExpanded","setIsFilterExpanded","mapHidden","_useState6","_useState5","isMapHidden","setIsMapHidden","assetCompanyId","companyId","company_id","subjectWellId","asset_id","_useState7","filters","_useState8","setFilters","_useState9","wellSection","ALL_SECTION_KEY","_useState10","selectedWellSection","setSelectedWellSection","initLoading","useRef","_useState12","_useState11","selectedWells","setSelectedWells","_useState14","_useState13","subjectWell","setSubjectWell","_useState16","_useState15","isTableLoading","setIsTableLoading","_useState18","_useState17","isWellNameExpand","setIsWellNameExpand","_useState20","_useState19","isAdvancedSearchHidden","setIsAdvancedSearchHidden","contentRef","offsetWellsContainerRef","_useState21","ViewType","none","_useState22","viewType","setViewType","prevViewType","_useState24","_useState23","isTopGradientShow","setIsTopGradientShow","isLimitedOffsetWells","length","topGradientTop","TOP_GRADIENT_MAP","prevSelectedWellIds","_useState26","_useState25","appLoading","setAppLoading","useEffect","_offsetSettings$selec","_prevSelectedWellIds$","_offsetSettings$selec2","showInfoNotification","selectedWellIds","current","every","id","_prevSelectedWellIds$2","includes","handleResize","window","innerWidth","SMALL_SCREEN_WIDTH","isMobileDetected","isNativeDetected","mobile","innerHeight","SMALL_SCREEN_HEIGHT","small","normal","addEventListener","removeEventListener","_useFetchWells","useFetchWells","_useFetchWells2","rawWells","areWellsLoading","useCompanyProvider","companyProvider","_useCompanyProvider","useBicWells","_useBicWells2","_useBicWells","wellSections","setWellSections","bicWells","setBicWells","resyncStatus","setResyncStatus","taScores","useCompanyMetricKey","metricsKeys","_useCompanyMetricKey2","_useCompanyMetricKey","setMetricsKeys","wells","useAdvancedWells","isAllWellsLoaded","_ref2","syncOffsetWells","_asyncToGenerator","_regeneratorRuntime","mark","_callee","isSynced","offsetWellsChanged","_offsetSettings$selec3","bicWellIds","isMatched","wellsByDistance","newOffsetSetting","offsetWells","_offsetWells","wrap","_context","prev","next","wellId","getCoordinatedWells","sent","slice","map","well","offsetWellsLimited","filter","stop","apply","this","arguments","filterOptions","useFilterOptions","find","allSectionNames","item","value","_ref3","label","subjectWellWithSection","_defineProperty","ColumnType","columnsWithDict","useTableColumns","filteredWells","useFilteredWells","data","concat","uniqBy","newSelectedWells","_ref5","useSortedWells","_useSortedWells2","_useSortedWells","sortBy","setSortBy","sortDirection","setSortDirection","sortedWells","handleAddRemoveAssets","useCallback","isAdding","newAssets","assetType","addingWellIds","SEARCH_CATEGORIES","name","reduce","acc","assetId","_wells$find","rigName","rigWellIds","addingWells","_ref6","uniq","_ref7","handleHideAdvancedSearch","handleChangeMetricsKeys","newMetricsKeys","handleChangeOffsetWell","checked","prevWells","handleChangeAllOffsetWells","sortedData","sortArray","updateSelectedWellsBySection","section","sectionWells","_bicWells$section","limitedWells","handleChangeWellSection","selectedWellsCount","useMemo","_ref8","owsWellIds","isXtoProvider","COMPANY_PROVIDERS_FOR_IDAS","offsetLabel","handleCancel","isTableFullLoading","isResetVisible","isEmpty","FilterType","sideTracks","handleReset","isLoading","_useState28","_useState27","isHScrollMoved","setIsHScrollMoved","ROWS_PER_PAGE","_useState30","_useState29","tableRowsCount","setTableRowsCount","_useState32","_useState31","tableWells","setTableWells","RESYNC_STATUS","SUCCEEDED","_jsxs","Modal","title","_jsx","AppHeader","totalCount","selectedCount","isMobile","contentContainerClassName","classNames","styles","offsetWellDialog","contentClassName","contentContainer","smallContainer","contentContainerMobile","actionsClassName","modalActions","actions","className","actionsWrapper","children","Tooltip","placement","Button","onClick","color","startIcon","ReplayIcon","classes","root","resetButtonMobile","infoIconContainer","_Fragment","typography","regular12","colors","t6","medium12","t1","enterTouchDelay","leaveTouchDelay","LEAVE_TOUCH_DELAY","InfoOutlined","infoIcon","buttonGap","variant","_ref9","NotificationsContainer","LoadingIndicator","fullscreen","contentWrapper","contentBlocked","ref","countContainer","countContainerMobile","Regular14","totalLabel","countValue","selectedLabel","Regular12","Toolbar","topGradient","style","top","content","contentMobile","contentiOSMobile","getMobileOperatingSystem","IOS_DEVICE","onScroll","e","target","scrollLeft","scrollTop","scrollHeight","offsetHeight","round","count","handleScroll","WellsMap","offsetWellIds","_ref10","radius","Filter","isHidden","onChangeFilters","setTimeout","onChangeBicWells","OffsetWellsTable","onHideAdvancedSearch","isLastWell","viewOnlyInfoContainer"],"mappings":"kotBAkDA,IAAMA,GAAY,qBAKZC,GAAqB,SAcrBC,IAAA,IAAAC,GAAAC,GAAAC,GAbJC,MAAAA,KACAC,MAAAA,SACAC,MAAAA,mBACAC,MAAAA,YACAC,MAAAA,eACAC,MAAAA,sBACAC,MAAAA,WACAC,MAAAA,QACAC,MAAAA,OAAMC,GAAAb,GACNc,cAAeC,eAAaC,EAAuBH,GAAAI,GAAAjB,GACnDkB,mBAAAA,eAAqBC,EAAyBF,GAC9CG,MAAAA,gBAAeC,GAAArB,GACfsB,qBAAAA,gBAA4BD,GAEYE,GAAAA,EAAS,MAAKC,GAAAC,EAAAC,GAAA,GAA/CC,GAAYH,GAAA,GAAEI,GAAeJ,GAAA,GAC9BV,GAAgBe,KAAKC,IAAIf,GAAa,EAAGG,GAAqB,EAAGa,EAAkB,GACnFC,GAAsBH,KAAKC,IAC/BD,KAAKI,IAAInB,GAAeI,GAAqB,GAC7Ca,EAAkB,GAG4BR,GAAAA,EAASf,cAAAA,EAAAA,GAAgB0B,gBAAeC,GAAAV,EAAAW,GAAA,GAAjFC,GAAgBF,GAAA,GAAEG,GAAmBH,GAAA,GACNZ,GAAAA,EAASf,cAAAA,EAAAA,GAAgB+B,WAAUC,GAAAf,EAAAgB,GAAA,GAAlEC,GAAWF,GAAA,GAAEG,GAAcH,GAAA,GAC5BI,KAAkBtC,gBAAAA,GAAoBuC,cAActC,cAAAA,EAAAA,GA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IAAkB,GAClBkS,YAAW,WAAA,OAAMtT,GAAWyI,EAAM,GAAE,EACpC,EACF8K,iBAAkBvH,KAEpBkC,EAACsF,EAAgB,CACfxW,KAAMA,GACNmE,eAAgBsL,GAChBhN,UAAWD,GACXG,cAAeA,GACfgK,OAAQA,GACRC,UAAWA,GACXC,cAAeA,GACfC,iBAAkBA,GAClBf,gBAAiBA,GACjB7C,MAAOyH,GACP7H,YAAaA,GACbG,eAAgBkF,GAChBE,uBAAwBA,GACxBG,2BAA4BA,GAC5BxB,sBAAuBA,GACvBzI,iBAAkBA,GAClBC,oBAAqBA,GACrB0L,eAAgBA,GAChBuG,qBAAsBvI,GACtB5N,WAAYA,GACZoW,WAAY3J,GAAYpH,QAAU4K,GAClC1L,WAAYA,GACZC,wBAAyBA,GACzBY,qBAAsBA,GACtB9D,oBAAqBA,GACrB0G,aAAcA,GACd9G,gBAAiBA,GACjB2D,SAAUA,GACVlF,SAAUA,GACV2I,SAAUA,QAGbtI,IACCyQ,EAAA,MAAA,CAAKmB,UAAWT,EAAOkF,sBAAsBvE,SAC3C,CAAAlB,EAAA,OAAA,CAAMgB,UAAWV,EAAWyB,GAAWC,UAAWD,GAAWE,OAAOC,IAAIhB,SAAA,yDAGxElB,EAAA,OAAA,CAAMgB,UAAWV,EAAWyB,GAAWI,SAAUJ,GAAWE,OAAOC,IAAIhB,SACpE7C,aAUjB"}
1
+ {"version":3,"file":"OffsetWellPickerV4.js","sources":["../../../src/components/OffsetWellPickerV4/OffsetWellPickerV4.js"],"sourcesContent":["import { useState, useEffect, useRef, useCallback, useMemo } from 'react';\nimport classNames from 'classnames';\nimport { isEmpty, uniq, uniqBy, sortBy as sortArray } from 'lodash';\nimport { InfoOutlined, Replay as ReplayIcon } from '@material-ui/icons';\n\nimport {\n useAdvancedWells,\n useBicWells,\n useFilterOptions,\n useCompanyMetricKey,\n useFilteredWells,\n useSortedWells,\n useTableColumns,\n useCompanyProvider,\n} from './effects';\nimport { useFetchWells } from './effects/useFetchWells';\nimport { AppHeader } from './components/AppHeader';\nimport { Toolbar } from './components/Toolbar';\nimport { Filter } from './components/Filter';\nimport { WellsMap } from './components/Map';\nimport { OffsetWellsTable } from './components/OffsetWellsTable';\nimport {\n ALL_SECTION_KEY,\n ColumnType,\n COMPANY_PROVIDERS_FOR_IDAS,\n DEFAULT_BIC_OFFSET_SIZE,\n DEFAULT_LOCAL_OFFSET_SIZE,\n FilterType,\n IOS_DEVICE,\n LEAVE_TOUCH_DELAY,\n MAX_OFFSET_SIZE,\n ROWS_PER_PAGE,\n SMALL_SCREEN_HEIGHT,\n SMALL_SCREEN_WIDTH,\n TOP_GRADIENT_MAP,\n ViewType,\n RESYNC_STATUS,\n} from './constants';\nimport { SEARCH_CATEGORIES } from './components/OffsetWellsTable/AdvancedSearch/constants';\nimport { getCoordinatedWells, getMobileOperatingSystem } from './utils';\n\nimport styles from './OffsetWellPickerV4.module.css';\n\nimport { showInfoNotification } from '~/utils';\nimport { NotificationsContainer } from '~/components/Notifications';\nimport { isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { typography } from '~/styles';\nimport { Regular12, Regular14 } from '~/components/Typography';\nimport { Button, Modal, LoadingIndicator, Tooltip } from '~/components';\n\nconst PAGE_NAME = 'OffsetWellPickerV4';\n\n/**\n * @type {React.FC<import('./OffsetWellPickerV4.types').OffsetWellPickerV4Props>}\n */\nconst OffsetWellPickerV4 = ({\n open,\n isWDUser,\n defaultSubjectWell,\n currentUser,\n offsetSettings,\n addWellsUsabilityInfo,\n isViewOnly,\n onClose,\n onSave,\n maxOffsetSize: offsetSize = DEFAULT_BIC_OFFSET_SIZE,\n localMaxOffsetSize = DEFAULT_LOCAL_OFFSET_SIZE,\n syncAutoEnabled,\n isManualWellsEnabled = false,\n}) => {\n const [activeWellId, setActiveWellId] = useState(null);\n const maxOffsetSize = Math.min(offsetSize + 1, localMaxOffsetSize + 1, MAX_OFFSET_SIZE + 1);\n const maxOffsetWellNumber = Math.min(\n Math.max(maxOffsetSize, localMaxOffsetSize + 1),\n MAX_OFFSET_SIZE + 1\n );\n\n const [isFilterExpanded, setIsFilterExpanded] = useState(offsetSettings?.filterExpanded);\n const [isMapHidden, setIsMapHidden] = useState(offsetSettings?.mapHidden);\n const assetCompanyId = +defaultSubjectWell?.companyId || +currentUser?.company_id;\n const subjectWellId = defaultSubjectWell?.asset_id;\n const [filters, setFilters] = useState(offsetSettings?.filters || {});\n const [selectedWellSection, setSelectedWellSection] = useState(\n offsetSettings?.wellSection || ALL_SECTION_KEY\n );\n const initLoading = useRef(true);\n const [selectedWells, setSelectedWells] = useState([]);\n const [subjectWell, setSubjectWell] = useState(null);\n const [isTableLoading, setIsTableLoading] = useState(true);\n const [isWellNameExpand, setIsWellNameExpand] = useState(false);\n const [isAdvancedSearchHidden, setIsAdvancedSearchHidden] = useState(false);\n const contentRef = useRef();\n const offsetWellsContainerRef = useRef();\n /** @type {ReturnType<typeof useState<string>>} */\n const [viewType, setViewType] = useState(ViewType.none);\n\n /** @type {ReturnType<typeof useRef<string>>} */\n const prevViewType = useRef();\n const [isTopGradientShow, setIsTopGradientShow] = useState(false);\n const isLimitedOffsetWells = maxOffsetWellNumber <= selectedWells?.length;\n const topGradientTop = TOP_GRADIENT_MAP[viewType];\n\n /** @type {ReturnType<typeof useRef<number[]>>} */\n const prevSelectedWellIds = useRef();\n const [appLoading, setAppLoading] = useState(true);\n\n useEffect(() => {\n if (open && isLimitedOffsetWells) {\n showInfoNotification(\n `App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`\n );\n }\n // NOTE: Refresh when the offset well changes externally\n if (!open) {\n const isNotChanged =\n offsetSettings?.selectedWellIds?.length === prevSelectedWellIds.current?.length &&\n offsetSettings?.selectedWellIds?.every(id => prevSelectedWellIds.current?.includes(id));\n if (!isNotChanged) {\n initLoading.current = true;\n }\n prevSelectedWellIds.current = offsetSettings?.selectedWellIds;\n }\n }, [isLimitedOffsetWells, open, offsetSettings]);\n\n useEffect(() => {\n function handleResize() {\n if (window.innerWidth <= SMALL_SCREEN_WIDTH || isMobileDetected || isNativeDetected) {\n setViewType(ViewType.mobile);\n } else if (window.innerHeight <= SMALL_SCREEN_HEIGHT) {\n setViewType(ViewType.small);\n } else {\n setViewType(ViewType.normal);\n }\n }\n handleResize();\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [open]);\n\n useEffect(() => {\n if (prevViewType.current && viewType === prevViewType.current) return;\n prevViewType.current = viewType;\n if (viewType === ViewType.small || viewType === ViewType.mobile) {\n setIsMapHidden(true);\n setIsFilterExpanded(false);\n } else {\n setIsFilterExpanded(!isViewOnly && offsetSettings?.filterExpanded);\n setIsMapHidden(!isViewOnly && offsetSettings?.mapHidden);\n }\n setFilters(offsetSettings?.filters || {});\n setSelectedWellSection(offsetSettings?.wellSection || ALL_SECTION_KEY);\n }, [offsetSettings, isViewOnly, viewType]);\n\n // NOTE: Fetch all wells\n const [rawWells, areWellsLoading] = useFetchWells(assetCompanyId, addWellsUsabilityInfo);\n const [companyProvider] = useCompanyProvider(assetCompanyId);\n const [\n wellSections,\n setWellSections,\n bicWells,\n setBicWells,\n resyncStatus,\n setResyncStatus,\n taScores,\n ] = useBicWells(isWDUser, currentUser, subjectWellId, rawWells, isManualWellsEnabled);\n\n useEffect(() => {\n setAppLoading(true);\n setWellSections(null);\n setBicWells(null);\n }, [subjectWellId]);\n\n const [metricsKeys, setMetricsKeys] = useCompanyMetricKey(\n assetCompanyId,\n offsetSettings?.metricsKeys\n );\n\n // NOTE: Calculate wells with coordinates, metrics and well section name\n const wells = useAdvancedWells(\n assetCompanyId,\n rawWells,\n wellSections,\n bicWells,\n subjectWellId,\n metricsKeys,\n open\n );\n\n const isAllWellsLoaded = !areWellsLoading && wells?.length === rawWells?.length;\n\n useEffect(() => {\n if (!isAllWellsLoaded) return;\n const syncOffsetWells = async () => {\n const isSynced = typeof offsetSettings?.isSynced === 'undefined' || offsetSettings?.isSynced;\n let offsetWellsChanged = true;\n if (isSynced) {\n const bicWellIds = bicWells[ALL_SECTION_KEY] || [];\n const isMatched = (offsetSettings?.selectedWellIds || []).every(wellId =>\n bicWellIds.includes(wellId)\n );\n // if well hub or offset selection app be changed\n if (bicWellIds.length !== offsetSettings?.selectedWellIds?.length || !isMatched) {\n const wellsByDistance = await getCoordinatedWells(bicWellIds, subjectWellId);\n let selectedWellIds = wellsByDistance.slice(0, maxOffsetSize + 1).map(well => well.id);\n selectedWellIds = wellsByDistance.slice(0, localMaxOffsetSize + 1).map(well => well.id);\n const newOffsetSetting = {\n ...offsetSettings,\n subjectWellId,\n selectedWellIds,\n offsetWellsLimited: maxOffsetWellNumber <= selectedWellIds.length,\n };\n const offsetWells = wellsByDistance.filter(well => selectedWellIds.includes(well.id));\n onSave(newOffsetSetting, offsetWells);\n } else {\n offsetWellsChanged = false;\n }\n } else {\n offsetWellsChanged = false;\n }\n\n if (!offsetWellsChanged) {\n const offsetWells = await getCoordinatedWells(\n offsetSettings?.selectedWellIds || [],\n subjectWellId\n );\n onSave(offsetSettings, offsetWells);\n }\n };\n\n if (syncAutoEnabled && appLoading && offsetSettings && bicWells) {\n syncOffsetWells();\n setAppLoading(false);\n }\n }, [offsetSettings, bicWells, subjectWellId, maxOffsetWellNumber, syncAutoEnabled]);\n\n const filterOptions = useFilterOptions(wells);\n\n // NOTE: Subject well\n useEffect(() => {\n if (wells && wellSections) {\n const defaultSubjectWell = wells.find(well => well.id === subjectWellId);\n if (defaultSubjectWell) {\n const allSectionNames = wellSections\n .filter(item => item.value !== ALL_SECTION_KEY)\n .map(({ label }) => label);\n const subjectWellWithSection = {\n ...defaultSubjectWell,\n ...(allSectionNames.length > 0 && { [ColumnType.wellSection]: allSectionNames }),\n };\n setSubjectWell(subjectWellWithSection);\n } else {\n setSubjectWell(null);\n }\n }\n }, [wellSections, wells]);\n\n // NOTE: Table columns with metrics\n const columnsWithDict = useTableColumns(metricsKeys);\n\n // NOTE: Filter wells\n const filteredWells = useFilteredWells(wells, filters);\n\n useEffect(() => {\n if (!filteredWells || !isAllWellsLoaded) return;\n\n if (initLoading.current) {\n let data = wells.filter(well => (offsetSettings?.selectedWellIds || []).includes(well.id));\n if (subjectWell) data = data.concat(subjectWell);\n setSelectedWells(uniqBy(data, 'id'));\n initLoading.current = false;\n } else {\n setSelectedWells(prev => {\n let newSelectedWells = (filteredWells || []).filter(\n well => !!prev.find(({ id }) => well.id === id)\n );\n if (subjectWell) newSelectedWells = newSelectedWells.concat(subjectWell);\n return uniqBy(newSelectedWells, 'id');\n });\n }\n }, [wells, filteredWells, offsetSettings?.selectedWellIds, isAllWellsLoaded]);\n\n // NOTE: Sort wells\n const [sortBy, setSortBy, sortDirection, setSortDirection, sortedWells] = useSortedWells(\n subjectWell,\n filteredWells,\n selectedWells,\n setIsTableLoading\n );\n\n // NOTE: Add advanced wells\n const handleAddRemoveAssets = useCallback(\n (isAdding, newAssets, assetType) => {\n let addingWellIds;\n if (assetType === SEARCH_CATEGORIES.well.name) {\n addingWellIds = newAssets;\n } else {\n addingWellIds = newAssets.reduce((acc, assetId) => {\n const rigName = wells.find(well => well.id === assetId)?.rigName;\n const rigWellIds = wells.filter(well => well.rigName === rigName).map(well => well.id);\n return acc.concat(rigWellIds);\n }, []);\n }\n let addingWells = wells.filter(({ id }) => addingWellIds.includes(id));\n if (isAdding) {\n addingWells = addingWells.slice(\n 0,\n Math.min(addingWells.length, maxOffsetWellNumber - selectedWells.length)\n );\n setSelectedWells(selectedWells => uniqBy(selectedWells.concat(addingWells), 'id'));\n } else {\n setSelectedWells(selectedWells =>\n uniq(selectedWells.filter(({ id }) => !addingWells.find(well => well.id === id)))\n );\n }\n },\n [wells, selectedWells]\n );\n\n const handleHideAdvancedSearch = useCallback(() => {\n setIsAdvancedSearchHidden(true);\n }, []);\n\n // NOTE: Change metrics keys\n const handleChangeMetricsKeys = useCallback(newMetricsKeys => {\n setMetricsKeys(newMetricsKeys);\n }, []);\n\n // NOTE: Check and Uncheck one offset well\n const handleChangeOffsetWell = useCallback((well, checked) => {\n if (checked) {\n setSelectedWells(prevWells => [...prevWells, well]);\n } else {\n setSelectedWells(prevWells => prevWells.filter(item => item.id !== well.id));\n }\n }, []);\n\n // NOTE: Select and Unselect All wells\n const handleChangeAllOffsetWells = useCallback(\n checked => {\n if (checked) {\n const data = subjectWell ? filteredWells.concat(subjectWell) : filteredWells;\n const sortedData = sortArray(uniqBy(data, 'id'), 'distance');\n setSelectedWells(sortedData.slice(0, maxOffsetWellNumber));\n } else {\n setSelectedWells(subjectWell ? [subjectWell] : []);\n }\n },\n [filteredWells, subjectWell, maxOffsetWellNumber]\n );\n\n // NOTE: Well Section change filter\n const updateSelectedWellsBySection = section => {\n if (bicWells) {\n const sectionWells = wells?.filter(well => bicWells[section]?.includes(well.id)) || [];\n const limitedWells = sortArray(sectionWells, 'distance');\n setSelectedWells(limitedWells.slice(0, maxOffsetSize));\n } else {\n setSelectedWells(subjectWell ? [subjectWell] : []);\n }\n };\n\n const handleChangeWellSection = useCallback(\n section => {\n setSelectedWellSection(section);\n updateSelectedWellsBySection(section);\n },\n [updateSelectedWellsBySection]\n );\n\n // NOTE: Get Selected wells count\n const selectedWellsCount = useMemo(() => {\n if (selectedWells.find(well => well.id === subjectWellId)) {\n return selectedWells.length - 1;\n }\n return selectedWells.length;\n }, [selectedWells, subjectWellId]);\n\n // NOTE: Save offset setting\n const isSynced = useMemo(() => {\n if (!bicWells) return false;\n const selectedWellIds = selectedWells.map(({ id }) => id);\n let synced;\n const owsWellIds = bicWells[selectedWellSection] || [];\n const owsWellIdsLength = Math.min(owsWellIds.length, maxOffsetSize);\n\n if (owsWellIdsLength !== selectedWellIds.length) {\n synced = false;\n } else {\n synced = selectedWellIds.every(id => owsWellIds.includes(id));\n }\n return synced;\n }, [bicWells, selectedWells, selectedWellSection, maxOffsetSize]);\n\n const isXtoProvider = useMemo(() => {\n return companyProvider ? COMPANY_PROVIDERS_FOR_IDAS.includes(companyProvider) : false;\n }, [companyProvider]);\n\n const offsetLabel = useMemo(() => {\n if (isXtoProvider) {\n return 'IDAS generated offsets.';\n }\n\n return isWDUser ? 'Offset Selection App.' : 'WellHub.';\n }, [isXtoProvider, isWDUser]);\n\n const handleSave = () => {\n onClose();\n\n const newOffsetSetting = {\n ...offsetSettings,\n companyId: assetCompanyId,\n subjectWellId,\n selectedWellIds: selectedWells.map(({ id }) => id),\n filters,\n metricsKeys,\n wellSection: selectedWellSection,\n isSynced,\n mapHidden: isMapHidden,\n filterExpanded: isFilterExpanded,\n offsetWellsLimited: isLimitedOffsetWells,\n };\n onSave(newOffsetSetting, selectedWells);\n };\n\n const handleCancel = () => {\n let data = (wells || []).filter(well =>\n (offsetSettings?.selectedWellIds || []).includes(well.id)\n );\n if (subjectWell) data = data.concat(subjectWell);\n setSelectedWells(uniqBy(data, 'id'));\n\n const newOffsetSetting = {\n ...offsetSettings,\n mapHidden: isMapHidden,\n filterExpanded: isFilterExpanded,\n };\n onSave(newOffsetSetting);\n setFilters(offsetSettings?.filters || {});\n setSelectedWellSection(offsetSettings?.wellSection || ALL_SECTION_KEY);\n onClose();\n };\n\n const isTableFullLoading = isTableLoading || areWellsLoading;\n\n // NOTE: Reset processing\n const isResetVisible = useMemo(() => {\n if (isTableFullLoading) return false;\n if (!isSynced) return true;\n if (!isEmpty(filters) && filters[FilterType.sideTracks]) return true;\n if (selectedWellSection !== ALL_SECTION_KEY) return true;\n return false;\n }, [isSynced, filters, selectedWellSection, isTableFullLoading]);\n\n const handleReset = () => {\n setFilters({});\n setSelectedWellSection(ALL_SECTION_KEY);\n updateSelectedWellsBySection(ALL_SECTION_KEY);\n };\n\n const isLoading = !wells || !wellSections || !sortedWells || viewType === ViewType.none;\n\n // NOTE: Well Name shadow\n const [isHScrollMoved, setIsHScrollMoved] = useState(false);\n const [tableRowsCount, setTableRowsCount] = useState(ROWS_PER_PAGE);\n const [tableWells, setTableWells] = useState([]);\n\n useEffect(() => {\n if (!sortedWells) return;\n\n const wells = sortedWells.slice(0, tableRowsCount);\n setTableWells(wells);\n }, [sortedWells, tableRowsCount, subjectWell]);\n\n useEffect(() => {\n if (resyncStatus === RESYNC_STATUS.SUCCEEDED) {\n handleReset();\n }\n }, [bicWells]);\n\n const handleScroll = e => {\n if (!e.target) return;\n\n if (isAdvancedSearchHidden) {\n e.target.scrollLeft = 0;\n setIsAdvancedSearchHidden(false);\n }\n\n // Check if H-Scroll is visible\n if (e.target.scrollLeft <= 5 && isHScrollMoved) {\n setIsHScrollMoved(false);\n }\n if (e.target.scrollLeft > 5 && !isHScrollMoved) {\n setIsHScrollMoved(true);\n }\n\n if (e.target.scrollTop <= 5 && isTopGradientShow) {\n setIsTopGradientShow(false);\n }\n if (e.target.scrollTop > 5 && !isTopGradientShow) {\n setIsTopGradientShow(true);\n }\n\n // Check if scroll has reached top or bottom\n if (e.target.scrollHeight === e.target.offsetHeight) return;\n\n const currentScrollBottom = Math.round(e.target.scrollTop + e.target.offsetHeight + 2);\n\n if (currentScrollBottom >= e.target.scrollHeight && tableRowsCount < sortedWells.length) {\n setTableRowsCount(count => count + ROWS_PER_PAGE);\n }\n };\n\n const tooltipContainer = () => {\n return (\n <div>\n <span className={classNames(typography.regular12, typography.colors.t1)}>\n The offset list is being automatically populated by&nbsp;\n </span>\n <span className={classNames(typography.medium12, typography.colors.t1)}>{offsetLabel}</span>\n </div>\n );\n };\n\n return (\n <Modal\n open={open}\n onClose={handleCancel}\n title={\n <AppHeader\n isWDUser={isWDUser}\n viewType={viewType}\n totalCount={wells?.length ?? 0}\n selectedCount={selectedWellsCount}\n isViewOnly={isViewOnly}\n maxOffsetWellNumber={maxOffsetWellNumber}\n />\n }\n isMobile={viewType === ViewType.mobile}\n contentContainerClassName={classNames(styles.offsetWellDialog)}\n contentClassName={classNames(styles.contentContainer, {\n [styles.smallContainer]: viewType === ViewType.small,\n [styles.contentContainerMobile]: viewType === ViewType.mobile,\n })}\n actionsClassName={styles.modalActions}\n actions={\n !isViewOnly && (\n <div className={styles.actionsWrapper}>\n {!isLoading && isResetVisible ? (\n <Tooltip\n placement=\"bottom-start\"\n title={`Reset to Synced Offsets in ${isWDUser ? 'Offset App' : 'Wellhub'}`}\n >\n <div>\n <Button\n data-testid={`${PAGE_NAME}_reset`}\n onClick={handleReset}\n color=\"primary\"\n startIcon={viewType !== ViewType.mobile && <ReplayIcon />}\n classes={viewType === ViewType.mobile && { root: styles.resetButtonMobile }}\n >\n {viewType !== ViewType.mobile ? 'Reset' : <ReplayIcon />}\n </Button>\n </div>\n </Tooltip>\n ) : (\n <div className={viewType === ViewType.mobile && styles.infoIconContainer}>\n {viewType !== ViewType.mobile ? (\n <>\n <span className={classNames(typography.regular12, typography.colors.t6)}>\n The offset list is being automatically populated by&nbsp;\n </span>\n <span className={classNames(typography.medium12, typography.colors.t6)}>\n {offsetLabel}\n </span>\n </>\n ) : (\n <Tooltip\n title={tooltipContainer()}\n enterTouchDelay={0}\n leaveTouchDelay={LEAVE_TOUCH_DELAY}\n >\n <InfoOutlined className={styles.infoIcon} />\n </Tooltip>\n )}\n </div>\n )}\n <div className={styles.buttonGap}>\n <Button data-testid={`${PAGE_NAME}_cancel`} onClick={handleCancel} color=\"primary\">\n Cancel\n </Button>\n <Button\n data-testid={`${PAGE_NAME}_selectedWells`}\n variant=\"contained\"\n color=\"primary\"\n onClick={handleSave}\n >\n Select ({selectedWellsCount})\n </Button>\n </div>\n </div>\n )\n }\n >\n <NotificationsContainer />\n {!isLoading ? (\n <div\n className={classNames(styles.contentWrapper, {\n [styles.contentBlocked]: isTableFullLoading,\n })}\n ref={contentRef}\n >\n {viewType === ViewType.mobile && (\n <div\n className={classNames(styles.countContainer, {\n [styles.countContainerMobile]: viewType === ViewType.mobile,\n })}\n >\n <Regular14 className={styles.totalLabel}>Total:</Regular14>\n <Regular14 data-testid={`${PAGE_NAME}_totalWells`} className={styles.countValue}>\n {wells.length}\n </Regular14>\n <Regular14 className={styles.selectedLabel}>Selected:</Regular14>\n <Regular14 data-testid={`${PAGE_NAME}_selected`} className={styles.countValue}>\n {selectedWellsCount}\n </Regular14>\n <Tooltip\n title={`App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`}\n placement=\"right\"\n >\n <Regular12\n data-testid={`${PAGE_NAME}_maxOffsetSize`}\n className={styles.maxOffsetSize}\n >\n /{maxOffsetWellNumber - 1}\n </Regular12>\n </Tooltip>\n </div>\n )}\n\n {viewType === ViewType.normal && (\n <Toolbar\n isViewOnly={isViewOnly}\n isXtoProvider={isXtoProvider}\n viewType={viewType}\n filters={filters}\n setFilters={setFilters}\n isFilterExpanded={isFilterExpanded}\n setIsFilterExpanded={setIsFilterExpanded}\n isMapHidden={isMapHidden}\n setIsMapHidden={setIsMapHidden}\n resyncStatus={resyncStatus}\n setResyncStatus={setResyncStatus}\n />\n )}\n\n {isTopGradientShow && (\n <div className={styles.topGradient} style={{ top: topGradientTop }} />\n )}\n <div\n className={classNames(styles.content, {\n [styles.contentBlocked]: isTableFullLoading,\n [styles.contentMobile]: viewType === ViewType.mobile,\n [styles.contentiOSMobile]: getMobileOperatingSystem() === IOS_DEVICE,\n })}\n ref={offsetWellsContainerRef}\n onScroll={e => handleScroll(e)}\n >\n {viewType !== ViewType.normal && (\n <Toolbar\n isViewOnly={isViewOnly}\n isXtoProvider={isXtoProvider}\n viewType={viewType}\n filters={filters}\n setFilters={setFilters}\n isFilterExpanded={isFilterExpanded}\n setIsFilterExpanded={setIsFilterExpanded}\n isMapHidden={isMapHidden}\n setIsMapHidden={setIsMapHidden}\n resyncStatus={resyncStatus}\n setResyncStatus={setResyncStatus}\n />\n )}\n {!isMapHidden && open && (\n <WellsMap\n isViewOnly={isViewOnly}\n mapHidden={isMapHidden}\n subjectWell={subjectWell}\n offsetWellIds={selectedWells.map(({ id }) => id)}\n wells={filteredWells}\n radius={filters[FilterType.radius]}\n handleChangeOffsetWell={handleChangeOffsetWell}\n activeWellId={activeWellId}\n viewType={viewType}\n />\n )}\n <Filter\n isHidden={!isFilterExpanded}\n isWDUser={isWDUser}\n filterOptions={filterOptions}\n filters={filters}\n wellSections={wellSections}\n selectedWellSection={selectedWellSection}\n subjectWell={subjectWell}\n onChangeFilters={value => {\n setIsTableLoading(true);\n setTimeout(() => setFilters(value), 0);\n }}\n onChangeBicWells={handleChangeWellSection}\n />\n <OffsetWellsTable\n open={open}\n isTableLoading={isTableFullLoading}\n companyId={assetCompanyId}\n subjectWellId={subjectWellId}\n sortBy={sortBy}\n setSortBy={setSortBy}\n sortDirection={sortDirection}\n setSortDirection={setSortDirection}\n columnsWithDict={columnsWithDict}\n wells={tableWells}\n metricsKeys={metricsKeys}\n setMetricsKeys={handleChangeMetricsKeys}\n handleChangeOffsetWell={handleChangeOffsetWell}\n handleChangeAllOffsetWells={handleChangeAllOffsetWells}\n handleAddRemoveAssets={handleAddRemoveAssets}\n isWellNameExpand={isWellNameExpand}\n setIsWellNameExpand={setIsWellNameExpand}\n isHScrollMoved={isHScrollMoved}\n onHideAdvancedSearch={handleHideAdvancedSearch}\n isViewOnly={isViewOnly}\n isLastWell={sortedWells.length <= tableRowsCount}\n contentRef={contentRef}\n offsetWellsContainerRef={offsetWellsContainerRef}\n isLimitedOffsetWells={isLimitedOffsetWells}\n maxOffsetWellNumber={maxOffsetWellNumber}\n wellSections={wellSections}\n setActiveWellId={setActiveWellId}\n viewType={viewType}\n isWDUser={isWDUser}\n taScores={taScores}\n />\n </div>\n {isViewOnly && (\n <div className={styles.viewOnlyInfoContainer}>\n <span className={classNames(typography.regular12, typography.colors.t6)}>\n The offset list is being automatically populated by&nbsp;\n </span>\n <span className={classNames(typography.medium12, typography.colors.t6)}>\n {offsetLabel}\n </span>\n </div>\n )}\n </div>\n ) : (\n <LoadingIndicator fullscreen={false} />\n )}\n </Modal>\n );\n};\n\nexport default OffsetWellPickerV4;\n"],"names":["PAGE_NAME","OffsetWellPickerV4","_ref","_wells$length","_classNames","_classNames4","open","isWDUser","defaultSubjectWell","currentUser","offsetSettings","addWellsUsabilityInfo","isViewOnly","onClose","onSave","_ref$maxOffsetSize","maxOffsetSize","offsetSize","DEFAULT_BIC_OFFSET_SIZE","_ref$localMaxOffsetSi","localMaxOffsetSize","DEFAULT_LOCAL_OFFSET_SIZE","syncAutoEnabled","_ref$isManualWellsEna","isManualWellsEnabled","useState","_useState2","_slicedToArray","_useState","activeWellId","setActiveWellId","Math","min","MAX_OFFSET_SIZE","maxOffsetWellNumber","max","filterExpanded","_useState4","_useState3","isFilterExpanded","setIsFilterExpanded","mapHidden","_useState6","_useState5","isMapHidden","setIsMapHidden","assetCompanyId","companyId","company_id","subjectWellId","asset_id","_useState7","filters","_useState8","setFilters","_useState9","wellSection","ALL_SECTION_KEY","_useState10","selectedWellSection","setSelectedWellSection","initLoading","useRef","_useState12","_useState11","selectedWells","setSelectedWells","_useState14","_useState13","subjectWell","setSubjectWell","_useState16","_useState15","isTableLoading","setIsTableLoading","_useState18","_useState17","isWellNameExpand","setIsWellNameExpand","_useState20","_useState19","isAdvancedSearchHidden","setIsAdvancedSearchHidden","contentRef","offsetWellsContainerRef","_useState21","ViewType","none","_useState22","viewType","setViewType","prevViewType","_useState24","_useState23","isTopGradientShow","setIsTopGradientShow","isLimitedOffsetWells","length","topGradientTop","TOP_GRADIENT_MAP","prevSelectedWellIds","_useState26","_useState25","appLoading","setAppLoading","useEffect","_offsetSettings$selec","_prevSelectedWellIds$","_offsetSettings$selec2","showInfoNotification","selectedWellIds","current","every","id","_prevSelectedWellIds$2","includes","handleResize","window","innerWidth","SMALL_SCREEN_WIDTH","isMobileDetected","isNativeDetected","mobile","innerHeight","SMALL_SCREEN_HEIGHT","small","normal","addEventListener","removeEventListener","_useFetchWells","useFetchWells","_useFetchWells2","rawWells","areWellsLoading","useCompanyProvider","companyProvider","_useCompanyProvider","useBicWells","_useBicWells2","_useBicWells","wellSections","setWellSections","bicWells","setBicWells","resyncStatus","setResyncStatus","taScores","useCompanyMetricKey","metricsKeys","_useCompanyMetricKey2","_useCompanyMetricKey","setMetricsKeys","wells","useAdvancedWells","isAllWellsLoaded","_ref2","syncOffsetWells","_asyncToGenerator","_regeneratorRuntime","mark","_callee","isSynced","offsetWellsChanged","_offsetSettings$selec3","bicWellIds","isMatched","wellsByDistance","newOffsetSetting","offsetWells","_offsetWells","wrap","_context","prev","next","wellId","getCoordinatedWells","sent","slice","map","well","offsetWellsLimited","filter","stop","apply","this","arguments","filterOptions","useFilterOptions","find","allSectionNames","item","value","_ref3","label","subjectWellWithSection","_defineProperty","ColumnType","columnsWithDict","useTableColumns","filteredWells","useFilteredWells","data","concat","uniqBy","newSelectedWells","_ref5","useSortedWells","_useSortedWells2","_useSortedWells","sortBy","setSortBy","sortDirection","setSortDirection","sortedWells","handleAddRemoveAssets","useCallback","isAdding","newAssets","assetType","addingWellIds","SEARCH_CATEGORIES","name","reduce","acc","assetId","_wells$find","rigName","rigWellIds","addingWells","_ref6","uniq","_ref7","handleHideAdvancedSearch","handleChangeMetricsKeys","newMetricsKeys","handleChangeOffsetWell","checked","prevWells","handleChangeAllOffsetWells","sortedData","sortArray","updateSelectedWellsBySection","section","sectionWells","_bicWells$section","limitedWells","handleChangeWellSection","selectedWellsCount","useMemo","_ref8","owsWellIds","isXtoProvider","COMPANY_PROVIDERS_FOR_IDAS","offsetLabel","handleCancel","isTableFullLoading","isResetVisible","isEmpty","FilterType","sideTracks","handleReset","isLoading","_useState28","_useState27","isHScrollMoved","setIsHScrollMoved","ROWS_PER_PAGE","_useState30","_useState29","tableRowsCount","setTableRowsCount","_useState32","_useState31","tableWells","setTableWells","RESYNC_STATUS","SUCCEEDED","_jsxs","Modal","title","_jsx","AppHeader","totalCount","selectedCount","isMobile","contentContainerClassName","classNames","styles","offsetWellDialog","contentClassName","contentContainer","smallContainer","contentContainerMobile","actionsClassName","modalActions","actions","className","actionsWrapper","children","Tooltip","placement","Button","onClick","color","startIcon","ReplayIcon","classes","root","resetButtonMobile","infoIconContainer","_Fragment","typography","regular12","colors","t6","medium12","t1","enterTouchDelay","leaveTouchDelay","LEAVE_TOUCH_DELAY","InfoOutlined","infoIcon","buttonGap","variant","_ref9","NotificationsContainer","LoadingIndicator","fullscreen","contentWrapper","contentBlocked","ref","countContainer","countContainerMobile","Regular14","totalLabel","countValue","selectedLabel","Regular12","Toolbar","topGradient","style","top","content","contentMobile","contentiOSMobile","getMobileOperatingSystem","IOS_DEVICE","onScroll","e","target","scrollLeft","scrollTop","scrollHeight","offsetHeight","round","count","handleScroll","WellsMap","offsetWellIds","_ref10","radius","Filter","isHidden","onChangeFilters","setTimeout","onChangeBicWells","OffsetWellsTable","onHideAdvancedSearch","isLastWell","viewOnlyInfoContainer"],"mappings":"srtBAkDA,IAAMA,GAAY,qBAKZC,GAAqB,SAcrBC,IAAA,IAAAC,GAAAC,GAAAC,GAbJC,MAAAA,KACAC,MAAAA,SACAC,MAAAA,mBACAC,MAAAA,YACAC,MAAAA,eACAC,MAAAA,sBACAC,MAAAA,WACAC,MAAAA,QACAC,MAAAA,OAAMC,GAAAb,GACNc,cAAeC,eAAaC,EAAuBH,GAAAI,GAAAjB,GACnDkB,mBAAAA,eAAqBC,EAAyBF,GAC9CG,MAAAA,gBAAeC,GAAArB,GACfsB,qBAAAA,gBAA4BD,GAEYE,GAAAA,EAAS,MAAKC,GAAAC,EAAAC,GAAA,GAA/CC,GAAYH,GAAA,GAAEI,GAAeJ,GAAA,GAC9BV,GAAgBe,KAAKC,IAAIf,GAAa,EAAGG,GAAqB,EAAGa,EAAkB,GACnFC,GAAsBH,KAAKC,IAC/BD,KAAKI,IAAInB,GAAeI,GAAqB,GAC7Ca,EAAkB,GAG4BR,GAAAA,EAASf,cAAAA,EAAAA,GAAgB0B,gBAAeC,GAAAV,EAAAW,GAAA,GAAjFC,GAAgBF,GAAA,GAAEG,GAAmBH,GAAA,GACNZ,GAAAA,EAASf,cAAAA,EAAAA,GAAgB+B,WAAUC,GAAAf,EAAAgB,GAAA,GAAlEC,GAAWF,GAAA,GAAEG,GAAcH,GAAA,GAC5BI,KAAkBtC,gBAAAA,GAAoBuC,cAActC,cAAAA,EAAA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frH,IAAkB,GAClBkS,YAAW,WAAA,OAAMtT,GAAWyI,EAAM,GAAE,EACpC,EACF8K,iBAAkBvH,KAEpBkC,EAACsF,EAAgB,CACfxW,KAAMA,GACNmE,eAAgBsL,GAChBhN,UAAWD,GACXG,cAAeA,GACfgK,OAAQA,GACRC,UAAWA,GACXC,cAAeA,GACfC,iBAAkBA,GAClBf,gBAAiBA,GACjB7C,MAAOyH,GACP7H,YAAaA,GACbG,eAAgBkF,GAChBE,uBAAwBA,GACxBG,2BAA4BA,GAC5BxB,sBAAuBA,GACvBzI,iBAAkBA,GAClBC,oBAAqBA,GACrB0L,eAAgBA,GAChBuG,qBAAsBvI,GACtB5N,WAAYA,GACZoW,WAAY3J,GAAYpH,QAAU4K,GAClC1L,WAAYA,GACZC,wBAAyBA,GACzBY,qBAAsBA,GACtB9D,oBAAqBA,GACrB0G,aAAcA,GACd9G,gBAAiBA,GACjB2D,SAAUA,GACVlF,SAAUA,GACV2I,SAAUA,QAGbtI,IACCyQ,EAAA,MAAA,CAAKmB,UAAWT,EAAOkF,sBAAsBvE,SAC3C,CAAAlB,EAAA,OAAA,CAAMgB,UAAWV,EAAWyB,GAAWC,UAAWD,GAAWE,OAAOC,IAAIhB,SAAA,yDAGxElB,EAAA,OAAA,CAAMgB,UAAWV,EAAWyB,GAAWI,SAAUJ,GAAWE,OAAOC,IAAIhB,SACpE7C,aAUjB"}
@@ -1,2 +1,2 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as o}from"react";import s from"prop-types";import{startCase as r,isEmpty as i,omit as n}from"lodash";import p from"moment";import m from"classnames";import{Divider as a,ListItemText as c}from"@material-ui/core";import{StatusOptions as l,FilterType as d,OBJECTIVE_PERIOD_LIST as j}from"../../constants.js";import{RadiusInput as u}from"./RadiusInput.js";import{MultiSelect as A}from"./MultiSelect.js";import{WellSection as C}from"./WellSection.js";import{PeriodSelect as S}from"./PeriodSelect.js";import v from"./Filter.module.css.js";import{jsxs as g,jsx as V,Fragment as b}from"react/jsx-runtime";import"../../../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@icon-park/react/es/all";import"../../../../icons/IconParkProvider.js";import"../../../../icons/customIcons/icons/AddMessage.js";import"../../../../icons/customIcons/icons/Attention.js";import"../../../../icons/customIcons/icons/Collapse.js";import"../../../../icons/customIcons/icons/Dashboard.js";import"../../../../icons/customIcons/icons/Expand.js";import"../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../icons/customIcons/icons/Search.js";import"../../../../icons/customIcons/icons/Wellhub.js";import"../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../icons/customIcons/icons/Checkbox.js";import"../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../icons/customIcons/icons/Radio.js";import"../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../icons/customIcons/icons/MoreApp.js";import"../../../../icons/customIcons/icons/Pad.js";import"../../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../../icons/customIcons/icons/FracFleet.js";import"../../../../icons/customIcons/icons/Program.js";import"../../../../icons/customIcons/icons/Rig.js";import"../../../../icons/customIcons/icons/Well.js";import"../../../../icons/customIcons/icons/Gap.js";import"../../../../icons/customIcons/icons/Pin.js";import"../../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../../icons/customIcons/icons/AttentionFilled.js";import"../../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../../icons/customIcons/icons/Archive.js";import"../../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../../icons/customIcons/icons/Unarchive.js";import"../../../../icons/customIcons/icons/Archived.js";import"../../../../utils/mobileDetect.js";import"../../../IconButton/index.js";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import"../../../../constants/corvaCompanyId.js";import"../../../GradientManager/configuration/constants.js";import"../../../Modal/CorvaModal.css.js";import"uuid";import"../../../IconMenu/index.js";import"../../../StyledMenuItem/index.js";import"../../../AppIcon/AppIcon.js";import"../../../DevCenter/AppHeader/AppHeader.js";import"../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/icons";import"../../../DevCenter/AppContext.js";import"../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../utils/index.js";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../../../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../../../componentsV2/Text/Text.js";import"../../../../componentsV2/Grid/Grid.js";import"../../../../componentsV2/Grid/Grid.scss.js";import"../../../../componentsV2/Header/Header.scss.js";import"../../../../componentsV2/Button/Button.js";import"../../../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../../../componentsV2/Tooltip/Tooltip.scss.js";import"../../../../componentsV2/Paper/Paper.js";import"../../../../componentsV2/Popover/Popover.scss.js";import"../../../../componentsV2/Radio/Radio.js";import"../../../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../../../componentsV2/Checkbox/Checkbox.js";import"../../../../componentsV2/TextInput/TextInput.js";import"../../../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../../../componentsV2/TextLink/TextLink.js";import"../../../../componentsV2/Chip/Chip.js";import"../../../../componentsV2/ChipAlert/ChipAlert.js";import"../../../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../../../componentsV2/Avatar/Avatar.js";import"../../../../componentsV2/Avatar/constants.js";import"../../../../componentsV2/AvatarGroup/AvatarGroup.scss.js";import"@material-ui/lab";import"../../../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../../../componentsV2/ModalWindow/ModalWindow.scss.js";import"../../../../componentsV2/Modal/Modal.scss.js";import"../../../../componentsV2/Menu/Menu.js";import"../../../../componentsV2/Counter/Counter.js";import"../../../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import{Switch as h}from"../../../../componentsV2/Switch/Switch.js";import"../../../../componentsV2/Tabs/Tabs.js";import"../../../../componentsV2/EmptyState/EmptyState.scss.js";import"../../../../componentsV2/FileIcon/FileIcon.js";import"react-dropzone";import"../../../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../../../componentsV2/Skeleton/Skeleton.scss.js";import"../../../../utils/main.js";import"../../../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../../../componentsV2/Stepper/Step/Step.scss.js";import"../../../../componentsV2/Stepper/Stepper.scss.js";import"../../../../componentsV2/ButtonLive/ButtonLive.js";import"../../../../componentsV2/ButtonText/ButtonText.js";import"../../../../componentsV2/LiveDotIndicator/LiveDotIndicator.scss.js";import"../../../../componentsV2/IndicatorLive/IndicatorLive.scss.js";import"../../../../componentsV2/Accordion/Accordion.scss.js";import"../../../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../../../componentsV2/BadgeComment/BadgeComment.js";import"../../../../componentsV2/AppContainer/AppContainer.js";import"../../../../componentsV2/AppContainer/AppContainer.constants.js";import"../../../../componentsV2/AppFooter/AppFooter.js";import"../../../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../../../componentsV2/AppHeader/AppHeader.constants.js";import"../../../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../../../componentsV2/AppHeader/AppAssets/utils.js";import"../../../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../../../PadModeSelect/PadModeSelect.js";import"../../../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../../../constants/streamSourceType.js";import"../../../../types/shared/Completions.js";import"../../../PadModeSelect/types.js";import"lodash/flatten";import"lodash/partition";import"../../../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.js";import"../../../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.constants.js";import"../../../../clients/jsonApi/index.js";import"@babel/runtime/helpers/toConsumableArray";import"lodash/set";import"lodash/get";import"lodash/unset";import"../../../../clients/subscriptions/constants.js";import"../../../../clients/subscriptions.v1.js";import"../../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../../clients/api/apiCore.js";import"../../../../clients/constants.js";import"../../../../clients/sso/auth0.js";import"../../../../clients/sso/oauth2.js";import"../../../../componentsV2/PadModeSelect/WellStreamActivityStatus/WellStreamActivityStatus.scss.js";import"../../../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../../../componentsV2/PadModeSelect/PadModeSelect.scss.js";import"querystring";import"uuid/v1";import"jsona";import"../../../../utils/env.js";import"../../../StatusBadge/constants.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../../../utils/getSingleAsset.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../../../componentsV2/AppContainer/headerCommon.scss.js";import"../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../../../componentsV2/AppHeader/V3/constants.scss.js";import"@babel/runtime/helpers/typeof";import"../../../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../../../componentsV2/AppSettings/AppSettings.js";import"../../../../componentsV2/AppSettings/AppSettings.constants.js";import"../../../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../../../componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.constants.js";import"../../../../componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.scss.js";import"../../../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../../../componentsV2/AppHeader/AppHeader.scss.js";import"../../../../componentsV2/OffsetWellsButton/OffsetWellsButton.scss.js";import"../../../../componentsV2/Autocomplete/Autocomplete.scss.js";import"../../../../componentsV2/Menu/MenuItem/MenuItem.scss.js";import"../../../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../../../Icons/AnnotationIcon.js";import"../../../Annotations/components/AnnotationsList/index.js";import"../../../Annotations/components/LastAnnotation/index.js";import"../../../Annotations/AnnotationsContext.js";import"../../../Toaster/Toaster.js";import"../../../HelpCenter/HelpCenterIcon.js";import"../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../DevCenter/SideBar/SideBar.js";import"../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../AssetEditor/index.js";import"../../../AssetEditorV2/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../LoadingIndicator/LoadingIndicator.js";import"../../../Typography.js";import"../../../RealTimeValuesSidebar/RealTimeSidebar.js";import"../../../CollapsableSidebar.js";import D from"../../../DateTimePicker/index.js";import"../../../DatePicker/index.js";import"../../../ErrorBoundary/ErrorBoundary.js";import"../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../SlateFormattedText/SlateFormattedText.js";import"../../../SlateFormattedText/RenderElements.js";import"slate";import"../../../EmptyState/EmptyState.js";import"../../../ParameterCharts/ParameterCharts.js";import"../../../ParameterCharts/AddEditTrack.js";import"../../../ChartActionsList/ChartActionsList.js";import"../../../CopyToClipboard/CopyToClipboard.js";import"../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../AssetEditor/SingleAssetEditor.js";import"react-color";import"../../../SettingEditors/ColorEditor/style.css.js";import"../../../SettingEditors/DropdownEditor/index.js";import"../../../SwitchControl/index.js";import"../../../ColorPicker/ColorPicker.js";import"../../../Chart/components/ChartButton.js";import"../../../Chart/components/ChartButtons.js";import"../../../Chart/components/ChartWrapper.js";import"../../../Chart/components/AxisDropdown.js";import"../../../Chart/components/ChartSelect.js";import"../../../Chart/components/buttons/DragToZoomButton.js";import"../../../Chart/components/buttons/ZoomInButton.js";import"../../../Chart/components/buttons/ZoomOutButton.js";import"../../../Chart/components/buttons/PanButton.js";import"../../../Chart/components/buttons/ResetZoomButton.js";import"../../../Chart/components/buttons/HideAxesButton.js";import"../../../Chart/components/buttons/ChartTypeButton.js";import"../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../TruncatedText/index.js";import"../../../MiddleTruncatedText/MiddleTruncatedText.js";import"../../../RangeSlider/constants.js";import"../../../RangeSlider/Input.css.js";import"../../../RangeSlider/RangeSlider.css.js";import"../../../AdvancedSlider/AdvancedSlider.js";import"../../../Breadcrumbs/index.js";import"../../../VirtualizedTable/index.js";import"../../../EmptyView/EmptyView.js";import"../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../Button/components/Button/index.js";import"moment-timezone";import"../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../../../Button/components/LiveButton/styles.js";import"../../../ContextMenuItem/index.js";import"../../../FolderMenuItem/index.js";import"../../../EditableItem/EditableItem/index.js";import"../../../EditableItem/EditableItemWithBadge/index.js";import"../../../Checkbox/index.js";import"../../../FolderMenuItemWithLinks/index.js";import"../../../TextField/index.js";import"../../../Chip/index.js";import"../../../Counter/index.js";import"../../../AnchorsList/AnchorsList.js";import"../../../Select/index.js";import"../../../Select/SelectFilterBy.js";import"../../../CustomSelect/index.js";import"../../../Tabs/Tabs.js";import"../../../Tabs/Tab.js";import"../../../ResizableTable/ResizableTable.js";import"../../../GradientPicker/GradientPicker.js";import"../../../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../../../GradientManager/GradientPreview/GradientPreview.js";import"../../../GradientManager/GradientSelect.styles.js";import"../../../GradientManager/GradientManager.styles.js";import"../../../Drillstring/BHASchematic.js";import"../../../Drillstring/BHATable/index.js";import"../../../Drillstring/BHAComponentIcon.js";import"../../../Drillstring/BHAComponentDetail/index.js";import"../../../Drillstring/BHATileIcon.js";import"../../../Drillstring/BHATile/BHATile.js";import"../../../Drillstring/BHAList/BHAList.js";import"../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../Casing/CasingTable/index.js";import"../../../Casing/CasingComponentIcon.js";import"../../../Casing/CasingTileIcon.js";import"../../../Casing/CasingTableV2/CasingTableV2.js";import"../../../Casing/CasingTile/CasingTile.js";import"../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../WellSummary/WellSummaryItemLabel.js";import"../../../WellSummary/WellSummaryItemTitle.js";import"../../../WellSummary/WellSummaryItemValue.js";import"../../../WellSummary/ActivitySummaryChart.js";import"../../../WellSummary/FracWirelineTimeChart.js";import"../../../BICOffsetPickerDialog/index.js";import"../../../OffsetWellButton/OffsetWellButton.js";import"../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../OffsetWellPickerV3/index.js";import"../../../OffsetWellChips/Chip.js";import"../../../OffsetWellChips/ChipsContainer.js";import"../../utils/apiCalls.js";import"../../effects/useAdvancedWells.js";import"react-virtualized";import"../../effects/useAssetsData.js";import"../AppHeader/AppHeader.js";import"../Toolbar/Toolbar.js";import"../Map/WellsMap.js";import"../OffsetWellsTable/OffsetWellsTable.js";import"../OffsetWellsTable/AdvancedSearch/constants.js";import"../../utils/index.js";import"../../OffsetWellPickerV4.module.css.js";import"@material-ui/core/Snackbar";import"../../../Notifications/Toast.js";import"../../../../styles/typography/index.js";import"../../../../styles/counter/counter.module.scss.js";import"../../../OffsetWellMap/OffsetWellMap.js";import"../../../ConfirmationDialog.js";import"../../../TextLink/index.js";import"../../../Avatar/index.js";import"../../../Template/TemplatePopover/index.js";import"../../../Template/TemplateSharingDialog/index.js";import"../../../MenuItem/index.js";import"../../../MiddleTruncate/MiddleTruncate.js";import"../../../PinnableFilters/PinnableFilters.js";import"../../../HeaderLayout/HeaderLayout.js";import"../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../PadOffsetsPicker/StagesSelector.js";import"../../../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../../../Table/TableToolbar/TableToolbar.js";import"../../../Table/TableContainer/TableContainer.js";import"../../../Table/TableCell/TableCell.js";import"../../../Table/TablePagination/TablePagination.js";import"../../../Table/TablePaginationActions/TablePaginationActions.js";import"../../../Tooltip/ScrollableTooltip.js";import"../../../PriceInput/PriceInput.js";import"../../../LabelsCounter/LabelsCounter.js";import"../../../Stepper/Stepper.js";import"../../../Stepper/Step/Step.js";import"../../../Stepper/StepsWrapper.js";import"../../../Comment/CommentIcon/index.js";import"../../../FilesLoader/FilesLoader.js";import"../../../SearchInput/index.js";import"../../../FeedItem/FeedItem.js";import"../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../PostInput/PostInput.js";import"../../../KeyboardDateTimePicker.js";import"../../../AddComment/Popover.js";import"../../../AddComment/Popup.js";import"../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../StageDesignVActual/ComparisonHeader.js";import"../../../StageDesignVActual/ComparisonRow.js";import"../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../EmbeddedApp/EmbeddedApp.js";import"../../../Autocomplete/Autocomplete.js";import"../../../DocumentViewer/DocumentViewer.js";import"../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../Search/Search.js";import"../../../Search/components/Listbox.js";import"../../../Search/components/Paper.js";import"../../../Search/components/RecentSearches.js";import"../../../Search/components/Groups.js";import"../../../Search/components/SelectAllListItem.js";import"../../../StatusBadge/index.js";import"../../../Attachment/index.js";import"../../../EmojiIconButton.js";import"../../../FileUploadIconButton.js";import"../../../FilePreview/index.js";import"../../../FailedFileUploading.js";import"../../../UserMention/index.js";import"../../../CommentsInfo/index.js";import"../../../CommentInput/index.js";import"../../../Comment/index.js";import"../../../CommentLoader.js";import"../../../AssetNameLabel/AssetStatusBadge.js";import"../../../AssetEditorV2/components/PrimaryAssetSelect.js";import"../../../AssetEditorV2/components/SecondaryAssetSelect.js";import"../../../AssetEditorV2/components/SelectItem.js";import"../../../AssetEditorV2/components/MultipleAssetsToggle.js";import"../../../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../../../EChartsWrapper/EChartsWrapper.js";import"../../../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../../../GoogleDocsViewer/index.js";import"../../../NewDocumentViewer/effects/useFileContent.js";import"../../../NewDocumentViewer/styles.js";import"../../../FilesLoaderV2/styles.js";import"../../../FilesDropzone/styles.js";import"../../../FilesProcessor/styles.js";import"../../../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../../../Formula/useFormulaStyles.js";import"../../../Formula/RootXIcon.js";import"../../../Formula/FormulaTextEditor.js";import"../../../Formula/CloseSuggestion.js";import"../../../Formula/SuggestionsMenu.js";function I(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function f(e){for(var o=1;o<arguments.length;o++){var s=null!=arguments[o]?arguments[o]:{};o%2?I(Object(s),!0).forEach((function(o){t(e,o,s[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):I(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var T=function(s){var I=s.isHidden,T=s.isWDUser,P=s.filterOptions,x=s.wellSections,y=s.filters,B=s.selectedWellSection,F=s.subjectWell,M=s.onChangeFilters,L=s.onChangeBicWells,E=o({}),k=e(E,2),H=k[0],O=k[1],W=function(e,o){e===d.sideTracks?M(f(f({},y),{},t({},d.sideTracks,o))):M(o?f(f({},y),{},t({},e,o)):n(f({},y),[e]))},R=function(e){return function(o){var s=p(o);if(s.isValid()){var r=s.unix(),i=!1;"timeRangeFrom"===e?i=r>=y[d.timeRangeTo]:"timeRangeTo"===e&&(i=r<=y[d.timeRangeFrom]),O(i?t({},e,!0):{}),M(f(f({},y),{},t({},e,r)))}}};return g("div",{className:m(v.filterContainer,t({},v.hidden,I)),children:[V(a,{className:v.divideLine}),g("div",{className:v.filterGroup,children:[V(A,{label:"Status",options:l.map((function(t){return t.value})),currentValues:y[d.status],ValueComponent:function(t){var e,o=t.value;return g("div",{className:v.statusItem,children:[V("div",{className:v.statusIcon,style:{background:null===(e=l.find((function(t){return t.value===o})))||void 0===e?void 0:e.color}}),r(o)]})},ListMenuItem:function(t){var e,o=t.value;return g("div",{className:v.statusItem,children:[V("div",{className:v.statusIcon,style:{background:null===(e=l.find((function(t){return t.value===o})))||void 0===e?void 0:e.color}}),V(c,{primary:r(o)})]})},onChange:function(t){return W(d.status,t)}}),P.map((function(t,e){var o=t.value,s=t.label,r=t.options;return V(A,{label:s,options:r,currentValues:y[o],ListMenuItem:function(t){var e=t.value;return V(c,{primary:e})},onChange:function(t){return W(o,t)}},e)})),V(u,{"data-testid":"".concat("Filter","_radiusInput"),radius:y[d.radius],editable:!!F,onChange:function(t){return W(d.radius,t)}}),V(S,{label:"Last Active",currentValue:y[d.period]||"all",options:j,className:v.companySelect,onChange:function(t){return W(d.period,t)}}),"custom"===y[d.period]&&g(b,{children:[V("div",{className:v.filterItem,children:V(D,{variant:"inline",label:"Date From",format:"MM/DD/YY HH:mm",value:1e3*y[d.timeRangeFrom]||null,onChange:R("timeRangeFrom"),error:H.timeRangeFrom})}),V("div",{className:v.filterItem,children:V(D,{variant:"inline",label:"Date To",format:"MM/DD/YY HH:mm",value:1e3*y[d.timeRangeTo]||null,onChange:R("timeRangeTo"),error:H.timeRangeTo})})]}),V(h,{testId:"".concat("Filter","_ExcludeSidetracks"),size:"small",checked:y[d.sideTracks]||!1,onChange:function(t){return W(d.sideTracks,t)},onLabel:"Exclude Sidetracks"}),T&&!i(x)&&V(C,{selectedValue:B,wellSections:x,onChange:L})]})]})};T.propTypes={isHidden:s.bool.isRequired,isWDUser:s.bool.isRequired,filterOptions:s.arrayOf(s.shape({})).isRequired,wellSections:s.arrayOf(s.shape({})).isRequired,filters:s.shape({}).isRequired,selectedWellSection:s.string.isRequired,subjectWell:s.shape({}).isRequired,onChangeFilters:s.func.isRequired,onChangeBicWells:s.func.isRequired};export{T as Filter};
1
+ import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as o}from"react";import s from"prop-types";import{startCase as r,isEmpty as i,omit as n}from"lodash";import p from"moment";import m from"classnames";import{Divider as a,ListItemText as c}from"@material-ui/core";import{StatusOptions as l,FilterType as d,OBJECTIVE_PERIOD_LIST as j}from"../../constants.js";import{RadiusInput as u}from"./RadiusInput.js";import{MultiSelect as A}from"./MultiSelect.js";import{WellSection as C}from"./WellSection.js";import{PeriodSelect as S}from"./PeriodSelect.js";import g from"./Filter.module.css.js";import{jsxs as v,jsx as V,Fragment as b}from"react/jsx-runtime";import"../../../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@icon-park/react/es/all";import"../../../../icons/IconParkProvider.js";import"../../../../icons/customIcons/icons/AddMessage.js";import"../../../../icons/customIcons/icons/Attention.js";import"../../../../icons/customIcons/icons/Collapse.js";import"../../../../icons/customIcons/icons/Dashboard.js";import"../../../../icons/customIcons/icons/Expand.js";import"../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../icons/customIcons/icons/Search.js";import"../../../../icons/customIcons/icons/Wellhub.js";import"../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../icons/customIcons/icons/Checkbox.js";import"../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../icons/customIcons/icons/Radio.js";import"../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../icons/customIcons/icons/MoreApp.js";import"../../../../icons/customIcons/icons/Pad.js";import"../../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../../icons/customIcons/icons/FracFleet.js";import"../../../../icons/customIcons/icons/Program.js";import"../../../../icons/customIcons/icons/Rig.js";import"../../../../icons/customIcons/icons/Well.js";import"../../../../icons/customIcons/icons/Gap.js";import"../../../../icons/customIcons/icons/Pin.js";import"../../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../../icons/customIcons/icons/AttentionFilled.js";import"../../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../../icons/customIcons/icons/Archive.js";import"../../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../../icons/customIcons/icons/Unarchive.js";import"../../../../icons/customIcons/icons/Archived.js";import"../../../../utils/mobileDetect.js";import"../../../IconButton/index.js";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import"../../../../constants/corvaCompanyId.js";import"../../../GradientManager/configuration/constants.js";import"../../../Modal/CorvaModal.css.js";import"uuid";import"../../../IconMenu/index.js";import"../../../StyledMenuItem/index.js";import"../../../AppIcon/AppIcon.js";import"../../../DevCenter/AppHeader/AppHeader.js";import"../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/icons";import"../../../DevCenter/AppContext.js";import"../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../utils/index.js";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../../../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../../../componentsV2/Text/Text.js";import"../../../../componentsV2/Grid/Grid.js";import"../../../../componentsV2/Grid/Grid.scss.js";import"../../../../componentsV2/Header/Header.scss.js";import"../../../../componentsV2/Button/Button.js";import"../../../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../../../componentsV2/Tooltip/Tooltip.scss.js";import"../../../../componentsV2/Paper/Paper.js";import"../../../../componentsV2/Popover/Popover.scss.js";import"../../../../componentsV2/Radio/Radio.js";import"../../../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../../../componentsV2/Checkbox/Checkbox.js";import"../../../../componentsV2/TextInput/TextInput.js";import"../../../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../../../componentsV2/TextLink/TextLink.js";import"../../../../componentsV2/Chip/Chip.js";import"../../../../componentsV2/ChipAlert/ChipAlert.js";import"../../../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../../../componentsV2/Avatar/Avatar.js";import"../../../../componentsV2/Avatar/constants.js";import"../../../../componentsV2/AvatarGroup/AvatarGroup.scss.js";import"@material-ui/lab";import"../../../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../../../componentsV2/ModalWindow/ModalWindow.scss.js";import"../../../../componentsV2/Modal/Modal.scss.js";import"../../../../componentsV2/Menu/Menu.js";import"../../../../componentsV2/Counter/Counter.js";import"../../../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import{Switch as D}from"../../../../componentsV2/Switch/Switch.js";import"../../../../componentsV2/Tabs/Tabs.js";import"../../../../componentsV2/EmptyState/EmptyState.scss.js";import"../../../../componentsV2/FileIcon/FileIcon.js";import"react-dropzone";import"../../../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../../../componentsV2/Skeleton/Skeleton.scss.js";import"../../../../utils/main.js";import"../../../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../../../componentsV2/Stepper/Step/Step.scss.js";import"../../../../componentsV2/Stepper/Stepper.scss.js";import"../../../../componentsV2/ButtonLive/ButtonLive.js";import"../../../../componentsV2/ButtonText/ButtonText.js";import"../../../../componentsV2/LiveDotIndicator/LiveDotIndicator.scss.js";import"../../../../componentsV2/IndicatorLive/IndicatorLive.scss.js";import"../../../../componentsV2/Accordion/Accordion.scss.js";import"../../../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../../../componentsV2/BadgeComment/BadgeComment.js";import"../../../../componentsV2/AppContainer/AppContainer.js";import"../../../../componentsV2/AppContainer/AppContainer.constants.js";import"../../../../componentsV2/AppFooter/AppFooter.js";import"../../../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../../../componentsV2/AppHeader/AppHeader.constants.js";import"../../../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../../../componentsV2/AppHeader/AppAssets/utils.js";import"../../../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../../../PadModeSelect/PadModeSelect.js";import"../../../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../../../constants/streamSourceType.js";import"../../../../types/shared/Completions.js";import"../../../PadModeSelect/types.js";import"lodash/flatten";import"lodash/partition";import"../../../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.js";import"../../../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.constants.js";import"../../../../clients/jsonApi/index.js";import"@babel/runtime/helpers/toConsumableArray";import"lodash/set";import"lodash/get";import"lodash/unset";import"../../../../clients/subscriptions/constants.js";import"../../../../clients/subscriptions.v1.js";import"../../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../../clients/api/apiCore.js";import"../../../../clients/constants.js";import"../../../../clients/sso/auth0.js";import"../../../../clients/sso/oauth2.js";import"../../../../componentsV2/PadModeSelect/WellStreamActivityStatus/WellStreamActivityStatus.scss.js";import"../../../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../../../componentsV2/PadModeSelect/PadModeSelect.scss.js";import"querystring";import"uuid/v1";import"jsona";import"../../../../utils/env.js";import"../../../StatusBadge/constants.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../../../utils/getSingleAsset.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../../../componentsV2/AppContainer/headerCommon.scss.js";import"../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../../../componentsV2/AppHeader/V3/constants.scss.js";import"@babel/runtime/helpers/typeof";import"../../../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../../../componentsV2/AppSettings/AppSettings.js";import"../../../../componentsV2/AppSettings/AppSettings.constants.js";import"../../../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../../../componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.constants.js";import"../../../../componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.scss.js";import"../../../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../../../componentsV2/AppHeader/AppHeader.scss.js";import"../../../../componentsV2/OffsetWellsButton/OffsetWellsButton.scss.js";import"../../../../componentsV2/Autocomplete/Autocomplete.scss.js";import"../../../../componentsV2/Menu/MenuItem/MenuItem.scss.js";import"../../../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../../../componentsV2/DragHandle/DragHandle.js";import"../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../../../Icons/AnnotationIcon.js";import"../../../Annotations/components/AnnotationsList/index.js";import"../../../Annotations/components/LastAnnotation/index.js";import"../../../Annotations/AnnotationsContext.js";import"../../../Toaster/Toaster.js";import"../../../HelpCenter/HelpCenterIcon.js";import"../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../DevCenter/SideBar/SideBar.js";import"../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../AssetEditor/index.js";import"../../../AssetEditorV2/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../LoadingIndicator/LoadingIndicator.js";import"../../../Typography.js";import"../../../RealTimeValuesSidebar/RealTimeSidebar.js";import"../../../CollapsableSidebar.js";import h from"../../../DateTimePicker/index.js";import"../../../DatePicker/index.js";import"../../../ErrorBoundary/ErrorBoundary.js";import"../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../SlateFormattedText/SlateFormattedText.js";import"../../../SlateFormattedText/RenderElements.js";import"slate";import"../../../EmptyState/EmptyState.js";import"../../../ParameterCharts/ParameterCharts.js";import"../../../ParameterCharts/AddEditTrack.js";import"../../../ChartActionsList/ChartActionsList.js";import"../../../CopyToClipboard/CopyToClipboard.js";import"../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../AssetEditor/SingleAssetEditor.js";import"react-color";import"../../../SettingEditors/ColorEditor/style.css.js";import"../../../SettingEditors/DropdownEditor/index.js";import"../../../SwitchControl/index.js";import"../../../ColorPicker/ColorPicker.js";import"../../../Chart/components/ChartButton.js";import"../../../Chart/components/ChartButtons.js";import"../../../Chart/components/ChartWrapper.js";import"../../../Chart/components/AxisDropdown.js";import"../../../Chart/components/ChartSelect.js";import"../../../Chart/components/buttons/DragToZoomButton.js";import"../../../Chart/components/buttons/ZoomInButton.js";import"../../../Chart/components/buttons/ZoomOutButton.js";import"../../../Chart/components/buttons/PanButton.js";import"../../../Chart/components/buttons/ResetZoomButton.js";import"../../../Chart/components/buttons/HideAxesButton.js";import"../../../Chart/components/buttons/ChartTypeButton.js";import"../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../TruncatedText/index.js";import"../../../MiddleTruncatedText/MiddleTruncatedText.js";import"../../../RangeSlider/constants.js";import"../../../RangeSlider/Input.css.js";import"../../../RangeSlider/RangeSlider.css.js";import"../../../AdvancedSlider/AdvancedSlider.js";import"../../../Breadcrumbs/index.js";import"../../../VirtualizedTable/index.js";import"../../../EmptyView/EmptyView.js";import"../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../Button/components/Button/index.js";import"moment-timezone";import"../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../../../Button/components/LiveButton/styles.js";import"../../../ContextMenuItem/index.js";import"../../../FolderMenuItem/index.js";import"../../../EditableItem/EditableItem/index.js";import"../../../EditableItem/EditableItemWithBadge/index.js";import"../../../Checkbox/index.js";import"../../../FolderMenuItemWithLinks/index.js";import"../../../TextField/index.js";import"../../../Chip/index.js";import"../../../Counter/index.js";import"../../../AnchorsList/AnchorsList.js";import"../../../Select/index.js";import"../../../Select/SelectFilterBy.js";import"../../../CustomSelect/index.js";import"../../../Tabs/Tabs.js";import"../../../Tabs/Tab.js";import"../../../ResizableTable/ResizableTable.js";import"../../../GradientPicker/GradientPicker.js";import"../../../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../../../GradientManager/GradientPreview/GradientPreview.js";import"../../../GradientManager/GradientSelect.styles.js";import"../../../GradientManager/GradientManager.styles.js";import"../../../Drillstring/BHASchematic.js";import"../../../Drillstring/BHATable/index.js";import"../../../Drillstring/BHAComponentIcon.js";import"../../../Drillstring/BHAComponentDetail/index.js";import"../../../Drillstring/BHATileIcon.js";import"../../../Drillstring/BHATile/BHATile.js";import"../../../Drillstring/BHAList/BHAList.js";import"../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../Casing/CasingTable/index.js";import"../../../Casing/CasingComponentIcon.js";import"../../../Casing/CasingTileIcon.js";import"../../../Casing/CasingTableV2/CasingTableV2.js";import"../../../Casing/CasingTile/CasingTile.js";import"../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../WellSummary/WellSummaryItemLabel.js";import"../../../WellSummary/WellSummaryItemTitle.js";import"../../../WellSummary/WellSummaryItemValue.js";import"../../../WellSummary/ActivitySummaryChart.js";import"../../../WellSummary/FracWirelineTimeChart.js";import"../../../BICOffsetPickerDialog/index.js";import"../../../OffsetWellButton/OffsetWellButton.js";import"../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../OffsetWellPickerV3/index.js";import"../../../OffsetWellChips/Chip.js";import"../../../OffsetWellChips/ChipsContainer.js";import"../../utils/apiCalls.js";import"../../effects/useAdvancedWells.js";import"react-virtualized";import"../../effects/useAssetsData.js";import"../AppHeader/AppHeader.js";import"../Toolbar/Toolbar.js";import"../Map/WellsMap.js";import"../OffsetWellsTable/OffsetWellsTable.js";import"../OffsetWellsTable/AdvancedSearch/constants.js";import"../../utils/index.js";import"../../OffsetWellPickerV4.module.css.js";import"@material-ui/core/Snackbar";import"../../../Notifications/Toast.js";import"../../../../styles/typography/index.js";import"../../../../styles/counter/counter.module.scss.js";import"../../../OffsetWellMap/OffsetWellMap.js";import"../../../ConfirmationDialog.js";import"../../../TextLink/index.js";import"../../../Avatar/index.js";import"../../../Template/TemplatePopover/index.js";import"../../../Template/TemplateSharingDialog/index.js";import"../../../MenuItem/index.js";import"../../../MiddleTruncate/MiddleTruncate.js";import"../../../PinnableFilters/PinnableFilters.js";import"../../../HeaderLayout/HeaderLayout.js";import"../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../PadOffsetsPicker/StagesSelector.js";import"../../../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../../../Table/TableToolbar/TableToolbar.js";import"../../../Table/TableContainer/TableContainer.js";import"../../../Table/TableCell/TableCell.js";import"../../../Table/TablePagination/TablePagination.js";import"../../../Table/TablePaginationActions/TablePaginationActions.js";import"../../../Tooltip/ScrollableTooltip.js";import"../../../PriceInput/PriceInput.js";import"../../../LabelsCounter/LabelsCounter.js";import"../../../Stepper/Stepper.js";import"../../../Stepper/Step/Step.js";import"../../../Stepper/StepsWrapper.js";import"../../../Comment/CommentIcon/index.js";import"../../../FilesLoader/FilesLoader.js";import"../../../SearchInput/index.js";import"../../../FeedItem/FeedItem.js";import"../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../PostInput/PostInput.js";import"../../../KeyboardDateTimePicker.js";import"../../../AddComment/Popover.js";import"../../../AddComment/Popup.js";import"../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../StageDesignVActual/ComparisonHeader.js";import"../../../StageDesignVActual/ComparisonRow.js";import"../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../EmbeddedApp/EmbeddedApp.js";import"../../../Autocomplete/Autocomplete.js";import"../../../DocumentViewer/DocumentViewer.js";import"../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../Search/Search.js";import"../../../Search/components/Listbox.js";import"../../../Search/components/Paper.js";import"../../../Search/components/RecentSearches.js";import"../../../Search/components/Groups.js";import"../../../Search/components/SelectAllListItem.js";import"../../../StatusBadge/index.js";import"../../../Attachment/index.js";import"../../../EmojiIconButton.js";import"../../../FileUploadIconButton.js";import"../../../FilePreview/index.js";import"../../../FailedFileUploading.js";import"../../../UserMention/index.js";import"../../../CommentsInfo/index.js";import"../../../CommentInput/index.js";import"../../../Comment/index.js";import"../../../CommentLoader.js";import"../../../AssetNameLabel/AssetStatusBadge.js";import"../../../AssetEditorV2/components/PrimaryAssetSelect.js";import"../../../AssetEditorV2/components/SecondaryAssetSelect.js";import"../../../AssetEditorV2/components/SelectItem.js";import"../../../AssetEditorV2/components/MultipleAssetsToggle.js";import"../../../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../../../EChartsWrapper/EChartsWrapper.js";import"../../../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../../../GoogleDocsViewer/index.js";import"../../../NewDocumentViewer/effects/useFileContent.js";import"../../../NewDocumentViewer/styles.js";import"../../../FilesLoaderV2/styles.js";import"../../../FilesDropzone/styles.js";import"../../../FilesProcessor/styles.js";import"../../../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../../../Formula/useFormulaStyles.js";import"../../../Formula/RootXIcon.js";import"../../../Formula/FormulaTextEditor.js";import"../../../Formula/CloseSuggestion.js";import"../../../Formula/SuggestionsMenu.js";function I(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function f(e){for(var o=1;o<arguments.length;o++){var s=null!=arguments[o]?arguments[o]:{};o%2?I(Object(s),!0).forEach((function(o){t(e,o,s[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):I(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var T=function(s){var I=s.isHidden,T=s.isWDUser,P=s.filterOptions,x=s.wellSections,y=s.filters,B=s.selectedWellSection,F=s.subjectWell,M=s.onChangeFilters,L=s.onChangeBicWells,E=o({}),k=e(E,2),H=k[0],O=k[1],W=function(e,o){e===d.sideTracks?M(f(f({},y),{},t({},d.sideTracks,o))):M(o?f(f({},y),{},t({},e,o)):n(f({},y),[e]))},R=function(e){return function(o){var s=p(o);if(s.isValid()){var r=s.unix(),i=!1;"timeRangeFrom"===e?i=r>=y[d.timeRangeTo]:"timeRangeTo"===e&&(i=r<=y[d.timeRangeFrom]),O(i?t({},e,!0):{}),M(f(f({},y),{},t({},e,r)))}}};return v("div",{className:m(g.filterContainer,t({},g.hidden,I)),children:[V(a,{className:g.divideLine}),v("div",{className:g.filterGroup,children:[V(A,{label:"Status",options:l.map((function(t){return t.value})),currentValues:y[d.status],ValueComponent:function(t){var e,o=t.value;return v("div",{className:g.statusItem,children:[V("div",{className:g.statusIcon,style:{background:null===(e=l.find((function(t){return t.value===o})))||void 0===e?void 0:e.color}}),r(o)]})},ListMenuItem:function(t){var e,o=t.value;return v("div",{className:g.statusItem,children:[V("div",{className:g.statusIcon,style:{background:null===(e=l.find((function(t){return t.value===o})))||void 0===e?void 0:e.color}}),V(c,{primary:r(o)})]})},onChange:function(t){return W(d.status,t)}}),P.map((function(t,e){var o=t.value,s=t.label,r=t.options;return V(A,{label:s,options:r,currentValues:y[o],ListMenuItem:function(t){var e=t.value;return V(c,{primary:e})},onChange:function(t){return W(o,t)}},e)})),V(u,{"data-testid":"".concat("Filter","_radiusInput"),radius:y[d.radius],editable:!!F,onChange:function(t){return W(d.radius,t)}}),V(S,{label:"Last Active",currentValue:y[d.period]||"all",options:j,className:g.companySelect,onChange:function(t){return W(d.period,t)}}),"custom"===y[d.period]&&v(b,{children:[V("div",{className:g.filterItem,children:V(h,{variant:"inline",label:"Date From",format:"MM/DD/YY HH:mm",value:1e3*y[d.timeRangeFrom]||null,onChange:R("timeRangeFrom"),error:H.timeRangeFrom})}),V("div",{className:g.filterItem,children:V(h,{variant:"inline",label:"Date To",format:"MM/DD/YY HH:mm",value:1e3*y[d.timeRangeTo]||null,onChange:R("timeRangeTo"),error:H.timeRangeTo})})]}),V(D,{testId:"".concat("Filter","_ExcludeSidetracks"),size:"small",checked:y[d.sideTracks]||!1,onChange:function(t){return W(d.sideTracks,t)},onLabel:"Exclude Sidetracks"}),T&&!i(x)&&V(C,{selectedValue:B,wellSections:x,onChange:L})]})]})};T.propTypes={isHidden:s.bool.isRequired,isWDUser:s.bool.isRequired,filterOptions:s.arrayOf(s.shape({})).isRequired,wellSections:s.arrayOf(s.shape({})).isRequired,filters:s.shape({}).isRequired,selectedWellSection:s.string.isRequired,subjectWell:s.shape({}).isRequired,onChangeFilters:s.func.isRequired,onChangeBicWells:s.func.isRequired};export{T as Filter};
2
2
  //# sourceMappingURL=Filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Filter.js","sources":["../../../../../src/components/OffsetWellPickerV4/components/Filter/Filter.js"],"sourcesContent":["import { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty, omit, startCase } from 'lodash';\nimport moment from 'moment';\nimport classNames from 'classnames';\nimport { Divider, ListItemText } from '@material-ui/core';\n\nimport { FilterType, OBJECTIVE_PERIOD_LIST, StatusOptions } from '../../constants';\n\nimport { RadiusInput } from './RadiusInput';\nimport { MultiSelect } from './MultiSelect';\nimport { WellSection } from './WellSection';\nimport { PeriodSelect } from './PeriodSelect';\n\nimport styles from './Filter.module.css';\n\nimport { DateTimePicker } from '~/components';\nimport { Switch } from '~/componentsV2/Switch';\n\nconst PAGE_NAME = 'Filter';\n\nexport const Filter = ({\n isHidden,\n isWDUser,\n filterOptions,\n wellSections,\n filters,\n selectedWellSection,\n subjectWell,\n onChangeFilters,\n onChangeBicWells,\n}) => {\n const [errors, setErrors] = useState({});\n\n const handleChangeFilter = (type, value) => {\n if (type === FilterType.sideTracks) {\n onChangeFilters({ ...filters, [FilterType.sideTracks]: value });\n } else {\n onChangeFilters(value ? { ...filters, [type]: value } : omit({ ...filters }, [type]));\n }\n };\n const handleCustomDateChange = key => dateString => {\n const newDate = moment(dateString);\n if (!newDate.isValid()) {\n return;\n }\n const timestamp = newDate.unix();\n\n let isInvalidDate = false;\n if (key === 'timeRangeFrom') {\n isInvalidDate = timestamp >= filters[FilterType.timeRangeTo];\n } else if (key === 'timeRangeTo') {\n isInvalidDate = timestamp <= filters[FilterType.timeRangeFrom];\n }\n\n if (isInvalidDate) {\n setErrors({\n [key]: true,\n });\n } else {\n setErrors({});\n }\n\n onChangeFilters({ ...filters, [key]: timestamp });\n };\n\n return (\n <div className={classNames(styles.filterContainer, { [styles.hidden]: isHidden })}>\n <Divider className={styles.divideLine} />\n <div className={styles.filterGroup}>\n <MultiSelect\n label=\"Status\"\n options={StatusOptions.map(item => item.value)}\n currentValues={filters[FilterType.status]}\n ValueComponent={({ value }) => (\n <div className={styles.statusItem}>\n <div\n className={styles.statusIcon}\n style={{ background: StatusOptions.find(item => item.value === value)?.color }}\n />\n {startCase(value)}\n </div>\n )}\n ListMenuItem={({ value }) => (\n <div className={styles.statusItem}>\n <div\n className={styles.statusIcon}\n style={{ background: StatusOptions.find(item => item.value === value)?.color }}\n />\n <ListItemText primary={startCase(value)} />\n </div>\n )}\n onChange={value => handleChangeFilter(FilterType.status, value)}\n />\n {filterOptions.map(({ value, label, options }, index) => (\n <MultiSelect\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n label={label}\n options={options}\n currentValues={filters[value]}\n ListMenuItem={({ value }) => <ListItemText primary={value} />}\n onChange={filterValue => handleChangeFilter(value, filterValue)}\n />\n ))}\n <RadiusInput\n data-testid={`${PAGE_NAME}_radiusInput`}\n radius={filters[FilterType.radius]}\n editable={!!subjectWell}\n onChange={value => handleChangeFilter(FilterType.radius, value)}\n />\n <PeriodSelect\n label=\"Last Active\"\n currentValue={filters[FilterType.period] || 'all'}\n options={OBJECTIVE_PERIOD_LIST}\n className={styles.companySelect}\n onChange={value => handleChangeFilter(FilterType.period, value)}\n />\n {filters[FilterType.period] === 'custom' && (\n <>\n <div className={styles.filterItem}>\n <DateTimePicker\n variant=\"inline\"\n label=\"Date From\"\n format=\"MM/DD/YY HH:mm\"\n value={filters[FilterType.timeRangeFrom] * 1000 || null}\n onChange={handleCustomDateChange('timeRangeFrom')}\n error={errors.timeRangeFrom}\n />\n </div>\n <div className={styles.filterItem}>\n <DateTimePicker\n variant=\"inline\"\n label=\"Date To\"\n format=\"MM/DD/YY HH:mm\"\n value={filters[FilterType.timeRangeTo] * 1000 || null}\n onChange={handleCustomDateChange('timeRangeTo')}\n error={errors.timeRangeTo}\n />\n </div>\n </>\n )}\n <Switch\n testId={`${PAGE_NAME}_ExcludeSidetracks`}\n size=\"small\"\n checked={filters[FilterType.sideTracks] || false}\n onChange={checked => handleChangeFilter(FilterType.sideTracks, checked)}\n onLabel=\"Exclude Sidetracks\"\n />\n {isWDUser && !isEmpty(wellSections) && (\n <WellSection\n selectedValue={selectedWellSection}\n wellSections={wellSections}\n onChange={onChangeBicWells}\n />\n )}\n </div>\n </div>\n );\n};\n\nFilter.propTypes = {\n isHidden: PropTypes.bool.isRequired,\n isWDUser: PropTypes.bool.isRequired,\n filterOptions: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n wellSections: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n filters: PropTypes.shape({}).isRequired,\n selectedWellSection: PropTypes.string.isRequired,\n subjectWell: PropTypes.shape({}).isRequired,\n onChangeFilters: PropTypes.func.isRequired,\n onChangeBicWells: PropTypes.func.isRequired,\n};\n"],"names":["Filter","_ref","isHidden","isWDUser","filterOptions","wellSections","filters","selectedWellSection","subjectWell","onChangeFilters","onChangeBicWells","_useState","useState","_useState2","_slicedToArray","errors","setErrors","handleChangeFilter","type","value","FilterType","sideTracks","_objectSpread","_defineProperty","omit","handleCustomDateChange","key","dateString","newDate","moment","isValid","timestamp","unix","isInvalidDate","timeRangeTo","timeRangeFrom","_jsxs","className","classNames","styles","filterContainer","hidden","children","_jsx","Divider","divideLine","filterGroup","MultiSelect","label","options","StatusOptions","map","item","currentValues","status","ValueComponent","_ref2","_StatusOptions$find","statusItem","statusIcon","style","background","find","color","startCase","ListMenuItem","_ref3","_StatusOptions$find2","ListItemText","primary","onChange","index","_ref5","filterValue","RadiusInput","concat","radius","editable","PeriodSelect","currentValue","period","OBJECTIVE_PERIOD_LIST","companySelect","_Fragment","filterItem","DateTimePicker","variant","format","error","Switch","testId","size","checked","onLabel","isEmpty","WellSection","selectedValue","propTypes","PropTypes","bool","isRequired","arrayOf","shape","string","func"],"mappings":"kzvBAmBA,IAEaA,EAAS,SAUhBC,GAAA,IATJC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,cACAC,IAAAA,aACAC,IAAAA,QACAC,IAAAA,oBACAC,IAAAA,YACAC,IAAAA,gBACAC,IAAAA,iBAEAC,EAA4BC,EAAS,IAAGC,EAAAC,EAAAH,EAAA,GAAjCI,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAElBI,EAAqB,SAACC,EAAMC,GAC5BD,IAASE,EAAWC,WACtBZ,EAAea,EAAAA,EAAA,CAAA,EAAMhB,GAAUc,CAAAA,EAAAA,EAAAA,CAAAA,EAAAA,EAAWC,WAAaF,KAEvDV,EAAgBU,EAAKG,EAAAA,EAAA,CAAA,EAAQhB,GAAO,GAAAiB,EAAA,CAAA,EAAGL,EAAOC,IAAUK,OAAUlB,GAAW,CAACY,MAG5EO,EAAyB,SAAAC,GAAG,OAAI,SAAAC,GACpC,IAAMC,EAAUC,EAAOF,GACvB,GAAKC,EAAQE,UAAb,CAGA,IAAMC,EAAYH,EAAQI,OAEtBC,GAAgB,EACR,kBAARP,EACFO,EAAgBF,GAAazB,EAAQc,EAAWc,aAC/B,gBAARR,IACTO,EAAgBF,GAAazB,EAAQc,EAAWe,gBAIhDnB,EADEiB,EAECP,EAAAA,CAAAA,EAAAA,GAAM,GAGC,CAAE,GAGdjB,SAAqBH,GAAO,GAAAiB,EAAA,CAAA,EAAGG,EAAMK,IAlBrC,EAmBD,EAED,OACEK,EAAA,MAAA,CAAKC,UAAWC,EAAWC,EAAOC,gBAAoBD,EAAAA,CAAAA,EAAAA,EAAOE,OAASvC,IAAYwC,SAAA,CAChFC,EAACC,EAAO,CAACP,UAAWE,EAAOM,aAC3BT,EAAA,MAAA,CAAKC,UAAWE,EAAOO,YAAYJ,SAAA,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AC7B7F,oBAAqB2F,EAAUK,OAAOH,WACtC5F,YAAa0F,EAAUI,MAAM,CAAA,GAAIF,WACjC3F,gBAAiByF,EAAUM,KAAKJ,WAChC1F,iBAAkBwF,EAAUM,KAAKJ"}
1
+ {"version":3,"file":"Filter.js","sources":["../../../../../src/components/OffsetWellPickerV4/components/Filter/Filter.js"],"sourcesContent":["import { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty, omit, startCase } from 'lodash';\nimport moment from 'moment';\nimport classNames from 'classnames';\nimport { Divider, ListItemText } from '@material-ui/core';\n\nimport { FilterType, OBJECTIVE_PERIOD_LIST, StatusOptions } from '../../constants';\n\nimport { RadiusInput } from './RadiusInput';\nimport { MultiSelect } from './MultiSelect';\nimport { WellSection } from './WellSection';\nimport { PeriodSelect } from './PeriodSelect';\n\nimport styles from './Filter.module.css';\n\nimport { DateTimePicker } from '~/components';\nimport { Switch } from '~/componentsV2/Switch';\n\nconst PAGE_NAME = 'Filter';\n\nexport const Filter = ({\n isHidden,\n isWDUser,\n filterOptions,\n wellSections,\n filters,\n selectedWellSection,\n subjectWell,\n onChangeFilters,\n onChangeBicWells,\n}) => {\n const [errors, setErrors] = useState({});\n\n const handleChangeFilter = (type, value) => {\n if (type === FilterType.sideTracks) {\n onChangeFilters({ ...filters, [FilterType.sideTracks]: value });\n } else {\n onChangeFilters(value ? { ...filters, [type]: value } : omit({ ...filters }, [type]));\n }\n };\n const handleCustomDateChange = key => dateString => {\n const newDate = moment(dateString);\n if (!newDate.isValid()) {\n return;\n }\n const timestamp = newDate.unix();\n\n let isInvalidDate = false;\n if (key === 'timeRangeFrom') {\n isInvalidDate = timestamp >= filters[FilterType.timeRangeTo];\n } else if (key === 'timeRangeTo') {\n isInvalidDate = timestamp <= filters[FilterType.timeRangeFrom];\n }\n\n if (isInvalidDate) {\n setErrors({\n [key]: true,\n });\n } else {\n setErrors({});\n }\n\n onChangeFilters({ ...filters, [key]: timestamp });\n };\n\n return (\n <div className={classNames(styles.filterContainer, { [styles.hidden]: isHidden })}>\n <Divider className={styles.divideLine} />\n <div className={styles.filterGroup}>\n <MultiSelect\n label=\"Status\"\n options={StatusOptions.map(item => item.value)}\n currentValues={filters[FilterType.status]}\n ValueComponent={({ value }) => (\n <div className={styles.statusItem}>\n <div\n className={styles.statusIcon}\n style={{ background: StatusOptions.find(item => item.value === value)?.color }}\n />\n {startCase(value)}\n </div>\n )}\n ListMenuItem={({ value }) => (\n <div className={styles.statusItem}>\n <div\n className={styles.statusIcon}\n style={{ background: StatusOptions.find(item => item.value === value)?.color }}\n />\n <ListItemText primary={startCase(value)} />\n </div>\n )}\n onChange={value => handleChangeFilter(FilterType.status, value)}\n />\n {filterOptions.map(({ value, label, options }, index) => (\n <MultiSelect\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n label={label}\n options={options}\n currentValues={filters[value]}\n ListMenuItem={({ value }) => <ListItemText primary={value} />}\n onChange={filterValue => handleChangeFilter(value, filterValue)}\n />\n ))}\n <RadiusInput\n data-testid={`${PAGE_NAME}_radiusInput`}\n radius={filters[FilterType.radius]}\n editable={!!subjectWell}\n onChange={value => handleChangeFilter(FilterType.radius, value)}\n />\n <PeriodSelect\n label=\"Last Active\"\n currentValue={filters[FilterType.period] || 'all'}\n options={OBJECTIVE_PERIOD_LIST}\n className={styles.companySelect}\n onChange={value => handleChangeFilter(FilterType.period, value)}\n />\n {filters[FilterType.period] === 'custom' && (\n <>\n <div className={styles.filterItem}>\n <DateTimePicker\n variant=\"inline\"\n label=\"Date From\"\n format=\"MM/DD/YY HH:mm\"\n value={filters[FilterType.timeRangeFrom] * 1000 || null}\n onChange={handleCustomDateChange('timeRangeFrom')}\n error={errors.timeRangeFrom}\n />\n </div>\n <div className={styles.filterItem}>\n <DateTimePicker\n variant=\"inline\"\n label=\"Date To\"\n format=\"MM/DD/YY HH:mm\"\n value={filters[FilterType.timeRangeTo] * 1000 || null}\n onChange={handleCustomDateChange('timeRangeTo')}\n error={errors.timeRangeTo}\n />\n </div>\n </>\n )}\n <Switch\n testId={`${PAGE_NAME}_ExcludeSidetracks`}\n size=\"small\"\n checked={filters[FilterType.sideTracks] || false}\n onChange={checked => handleChangeFilter(FilterType.sideTracks, checked)}\n onLabel=\"Exclude Sidetracks\"\n />\n {isWDUser && !isEmpty(wellSections) && (\n <WellSection\n selectedValue={selectedWellSection}\n wellSections={wellSections}\n onChange={onChangeBicWells}\n />\n )}\n </div>\n </div>\n );\n};\n\nFilter.propTypes = {\n isHidden: PropTypes.bool.isRequired,\n isWDUser: PropTypes.bool.isRequired,\n filterOptions: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n wellSections: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n filters: PropTypes.shape({}).isRequired,\n selectedWellSection: PropTypes.string.isRequired,\n subjectWell: PropTypes.shape({}).isRequired,\n onChangeFilters: PropTypes.func.isRequired,\n onChangeBicWells: PropTypes.func.isRequired,\n};\n"],"names":["Filter","_ref","isHidden","isWDUser","filterOptions","wellSections","filters","selectedWellSection","subjectWell","onChangeFilters","onChangeBicWells","_useState","useState","_useState2","_slicedToArray","errors","setErrors","handleChangeFilter","type","value","FilterType","sideTracks","_objectSpread","_defineProperty","omit","handleCustomDateChange","key","dateString","newDate","moment","isValid","timestamp","unix","isInvalidDate","timeRangeTo","timeRangeFrom","_jsxs","className","classNames","styles","filterContainer","hidden","children","_jsx","Divider","divideLine","filterGroup","MultiSelect","label","options","StatusOptions","map","item","currentValues","status","ValueComponent","_ref2","_StatusOptions$find","statusItem","statusIcon","style","background","find","color","startCase","ListMenuItem","_ref3","_StatusOptions$find2","ListItemText","primary","onChange","index","_ref5","filterValue","RadiusInput","concat","radius","editable","PeriodSelect","currentValue","period","OBJECTIVE_PERIOD_LIST","companySelect","_Fragment","filterItem","DateTimePicker","variant","format","error","Switch","testId","size","checked","onLabel","isEmpty","WellSection","selectedValue","propTypes","PropTypes","bool","isRequired","arrayOf","shape","string","func"],"mappings":"42vBAmBA,IAEaA,EAAS,SAUh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