@corva/ui 3.83.0-5 → 3.83.0-7

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 (165) 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/CommentComposer/CommentComposer.js +1 -1
  14. package/cjs-bundle/components/CommentComposer/CommentComposer.js.map +1 -1
  15. package/cjs-bundle/components/CommentComposer/CommentComposer.scss.js +1 -1
  16. package/cjs-bundle/components/CommentComposer/CommentMentionField.js +2 -0
  17. package/cjs-bundle/components/CommentComposer/CommentMentionField.js.map +1 -0
  18. package/cjs-bundle/components/CommentComposer/CommentMentionField.scss.js +2 -0
  19. package/cjs-bundle/components/CommentComposer/CommentMentionField.scss.js.map +1 -0
  20. package/cjs-bundle/components/CommentComposer/CommentReplyInput.js +1 -1
  21. package/cjs-bundle/components/CommentComposer/CommentReplyInput.js.map +1 -1
  22. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  23. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  24. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  25. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  26. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  27. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  28. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  29. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  30. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  31. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  32. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  33. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  34. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  35. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  36. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  37. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  38. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  39. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  40. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  41. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  42. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  43. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  44. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  45. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  46. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  47. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  48. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  49. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  50. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  51. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  52. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  53. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  54. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  55. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  56. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  57. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  58. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  59. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  60. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  61. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  62. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  63. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  64. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  65. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  66. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  67. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  68. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  69. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  70. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  71. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  72. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  73. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  74. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  75. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  76. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  77. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  78. package/components/AddComment/Popover.js +1 -1
  79. package/components/AddComment/Popover.js.map +1 -1
  80. package/components/AddComment/components/Content.js +1 -1
  81. package/components/AddComment/components/Content.js.map +1 -1
  82. package/components/BICOffsetPickerDialog/index.js +1 -1
  83. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  84. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  85. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  86. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  87. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  88. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  89. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  90. package/components/CommentComposer/CommentComposer.d.ts.map +1 -1
  91. package/components/CommentComposer/CommentComposer.js +1 -1
  92. package/components/CommentComposer/CommentComposer.js.map +1 -1
  93. package/components/CommentComposer/CommentComposer.scss.js +1 -1
  94. package/components/CommentComposer/CommentMentionField.d.ts +18 -0
  95. package/components/CommentComposer/CommentMentionField.d.ts.map +1 -0
  96. package/components/CommentComposer/CommentMentionField.js +2 -0
  97. package/components/CommentComposer/CommentMentionField.js.map +1 -0
  98. package/components/CommentComposer/CommentMentionField.scss.js +2 -0
  99. package/components/CommentComposer/CommentMentionField.scss.js.map +1 -0
  100. package/components/CommentComposer/CommentReplyInput.d.ts.map +1 -1
  101. package/components/CommentComposer/CommentReplyInput.js +1 -1
  102. package/components/CommentComposer/CommentReplyInput.js.map +1 -1
  103. package/components/CommentComposer/__tests__/CommentReplyInput.mention.test.d.ts +2 -0
  104. package/components/CommentComposer/__tests__/CommentReplyInput.mention.test.d.ts.map +1 -0
  105. package/components/DocumentViewer/DocumentViewer.js +1 -1
  106. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  107. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  108. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  109. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  110. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  111. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  112. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  113. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  114. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  115. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  116. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  117. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  118. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  119. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  120. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  121. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  122. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  123. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  124. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  125. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  126. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  127. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  128. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  129. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  130. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  131. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  132. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  133. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  134. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  135. package/components/InfiniteList/__tests__/InfiniteList.integration.test.d.ts +2 -0
  136. package/components/InfiniteList/__tests__/InfiniteList.integration.test.d.ts.map +1 -0
  137. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  138. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  139. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  140. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  141. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  142. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  143. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  144. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  145. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  146. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  147. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  148. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  149. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  150. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  151. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  152. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  153. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  154. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  155. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  156. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  157. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  158. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  159. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  160. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  161. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  162. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  163. package/mcp-server/server.mjs +1 -1
  164. package/package.json +2 -2
  165. package/tsconfig.tsbuildinfo +1 -1
@@ -1,2 +1,2 @@
1
- import{memo as e,useMemo as o}from"react";import{isEmpty as t}from"lodash";import s from"prop-types";import{Grid as i}from"@material-ui/core";import{OD_ID_DEP_COLUMNS as n,CONTAINER_XS as r}from"../constants.js";import{isMobileDetected as p}from"../../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/defineProperty";import"../../../../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import"../../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@babel/runtime/helpers/objectWithoutProperties";import"classnames";import"../../../../Modal/CorvaModal.scss.js";import"@icon-park/react/es/all";import{jsxs as m,jsx as c}from"react/jsx-runtime";import"../../../../../icons/IconParkProvider.js";import"../../../../../icons/customIcons/icons/AddMessage.js";import"../../../../../icons/customIcons/icons/DragOne.js";import"../../../../../icons/customIcons/icons/Attention.js";import"../../../../../icons/customIcons/icons/Collapse.js";import"../../../../../icons/customIcons/icons/Dashboard.js";import"../../../../../icons/customIcons/icons/Expand.js";import"../../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../../icons/customIcons/icons/Search.js";import"../../../../../icons/customIcons/icons/SearchOne.js";import"../../../../../icons/customIcons/icons/Wellhub.js";import"../../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../../icons/customIcons/icons/Checkbox.js";import"../../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../../icons/customIcons/icons/Radio.js";import"../../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../../icons/customIcons/icons/InfoRounded.js";import"../../../../../icons/customIcons/icons/FlameFilled.js";import"../../../../../icons/customIcons/icons/MoreApp.js";import"../../../../../icons/customIcons/icons/Pad.js";import"../../../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../../../icons/customIcons/icons/FracFleet.js";import"../../../../../icons/customIcons/icons/Global.js";import"../../../../../icons/customIcons/icons/Program.js";import"../../../../../icons/customIcons/icons/Rig.js";import"../../../../../icons/customIcons/icons/Well.js";import"../../../../../icons/customIcons/icons/Gap.js";import"../../../../../icons/customIcons/icons/Pin.js";import"../../../../../icons/customIcons/icons/PinOne.js";import"../../../../../icons/customIcons/icons/PinOneCrossed.js";import"../../../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../../../icons/customIcons/icons/AttentionFilled.js";import"../../../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../../../icons/customIcons/icons/Archive.js";import"../../../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../../../icons/customIcons/icons/Unarchive.js";import"../../../../../icons/customIcons/icons/Archived.js";import"../../../../../icons/customIcons/icons/InterventionUnit.js";import"../../../../../icons/customIcons/icons/CloudDelete.js";import"../../../../../icons/customIcons/icons/Lasso.js";import"../../../../../icons/customIcons/icons/Radius.js";import"../../../../../icons/customIcons/icons/ErrorOps.js";import"../../../../../icons/customIcons/icons/DataTypeOps.js";import"../../../../../icons/customIcons/icons/FalsePositiveOps.js";import"../../../../../icons/customIcons/icons/CalibrationOps.js";import"../../../../../icons/customIcons/icons/CriticalOps.js";import"../../../../../icons/customIcons/icons/Company.js";import"../../../../../icons/customIcons/icons/ArchiveOne.js";import"../../../../../icons/customIcons/icons/ParseBotFusion.js";import"../../../../../icons/customIcons/icons/Connect.js";import"../../../../../icons/customIcons/icons/PuzzleOne.js";import"../../../../../icons/customIcons/icons/Feed.js";import"../../../../../icons/customIcons/icons/Prompt.js";import"../../../../../icons/customIcons/icons/Companies.js";import"../../../../../icons/customIcons/icons/ClipboardAi.js";import"../../../../../icons/customIcons/icons/Key.js";import"../../../../../icons/customIcons/icons/AtSignCrossed.js";import"../../../../../icons/customIcons/icons/MappingManual.js";import"../../../../../icons/customIcons/icons/Mapping.js";import"../../../../../icons/customIcons/icons/Metrics.js";import"../../../../../icons/customIcons/icons/Drops.js";import"../../../../../icons/customIcons/icons/ClipboardSearch.js";import"../../../../../icons/customIcons/icons/Template.js";import"../../../../../icons/customIcons/icons/ClipboardMetrics.js";import"../../../../../icons/customIcons/icons/ClipboardBuilder.js";import"../../../../../icons/customIcons/icons/UnitConversion.js";import"../../../../../icons/customIcons/icons/NPT.js";import"../../../../../icons/customIcons/icons/GuidedFrac.js";import"../../../../IconButton/index.js";import"../../../../../constants/goals.js";import"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import"../../../../../constants/apps.js";import{OD_ID_DEP_LIST as a,COMPONENT_GRADES as l,COMPONENT_CLASSES as d,COMPONENT_MATERIALS as j}from"../../../../../constants/casing.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"@babel/runtime/helpers/slicedToArray";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/AppContext.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../DevCenter/AppsDataProvider/effects/utils.js";import"@babel/runtime/helpers/toConsumableArray";import"query-string";import"../../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router-dom";import"../../../../UserMention/utils/index.js";import"../../../../../utils/convert.js";import"moment";import"../../../../../utils/casing/validation.js";import"lodash/mean";import"../../../../../constants/streamSourceType.js";import"lodash/get";import"file-saver";import"../../../../../utils/drillstring/conversion.js";import"lodash/set";import"lodash/cloneDeep";import"lodash/isNumber";import"lodash/has";import"../../../../../utils/ga.js";import"../../../../../utils/goalsConfig/goalsConfig.js";import"../../../../../utils/lasParser.js";import"../../../../../utils/main.js";import"../../../../../utils/metrics/metricsConfig.js";import"../../../../../utils/feed.js";import"../../../../../utils/reports.js";import"moment-timezone";import"@babel/runtime/helpers/typeof";import"../../../../../utils/dashboardReports.js";import"../../../../../utils/env.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../../../../utils/jsonaDataFormatter.js";import"../../../../../utils/bha.js";import"jsona";import"../../../../../clients/jsonApi/index.js";import"../../../../../utils/shareRecentRequest.js";import"../../../../../utils/charts/Styles.scss.js";import"../../../../../utils/getSingleAsset.js";import"@material-ui/icons/ArrowForward";import"../../../../EmptyState/EmptyState.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/styles.js";import"@material-ui/pickers";import"@date-io/moment";import"../../../../../config/theme/index.js";import"../../../../../hocs/withAssetEditorLockHOC.js";import"../../../../ErrorBoundary/ErrorBoundary.js";import"../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../../Button/components/Button/index.js";import"../../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../../../../Button/components/LiveButton/styles.js";import"../../../../AssetEditorV2/index.js";import"../../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../../ConfirmationDialog.js";import"../../../../../permissions/PermissionsContext.js";import"../../../../../permissions/constants/index.js";import"../../../../../permissions/withPermissionsHOC.js";import"../../../../../permissions/ProvidePermissions.js";import"../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants.js";import"../../../../Annotations/components/AnnotationsList/index.js";import"../../../../Annotations/components/LastAnnotation/index.js";import"../../../../Annotations/AnnotationsContext.js";import"../../../../../componentsV2/AppContainer/AppContainer.js";import"../../../../../componentsV2/AppContainer/AppContainer.constants.js";import"../../../../../componentsV2/Text/Text.js";import"../../../../../componentsV2/Header/Header.scss.js";import"../../../../../componentsV2/Tooltip/Tooltip.scss.js";import"../../../../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../../../../componentsV2/AppHeader/AppHeader.constants.js";import"../../../../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../../../../componentsV2/Chip/Chip.js";import"../../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../../../../componentsV2/AppHeader/AppAssets/utils.js";import"../../../../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../../../../PadModeSelect/PadModeSelect.js";import"../../../../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../../../../componentsV2/PadModeSelect/PadModeSelect.js";import"../../../../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsProvider.js";import"../../../../../componentsV2/utils.js";import"../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../../../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../../../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../../../../componentsV2/Button/Button.js";import"../../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../../../../componentsV2/Popover/Popover.js";import"../../../../../componentsV2/Accordion/Accordion.scss.js";import"../../../../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../../../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../../../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../../../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../../../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../../../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../../../../componentsV2/Menu/Menu.js";import"../../../../../componentsV2/ModalWindow/ModalWindow.js";import"../../../../../componentsV2/Modal/Modal.scss.js";import"../../../../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../../../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../../../../componentsV2/TextInput/TextInput.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../../../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"querystring";import"../../../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../../StatusBadge/constants.js";import"lodash/unset";import"../../../../../clients/api/apiCore.js";import"../../../../../clients/constants.js";import"../../../../../clients/sso/auth0.js";import"../../../../../clients/sso/oauth2.js";import"../../../../../clients/api/rateLimiter.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../../../componentsV2/AppPanel/AppPanelsContext.js";import"../../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../../../../componentsV2/AppHeader/V3/constants.scss.js";import"../../../../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.constants.js";import"../../../../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../../../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../../../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../../../../componentsV2/AppHeader/AppHeader.scss.js";import"../../../../../componentsV2/EmptyState/EmptyState.scss.js";import"../../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton.js";import"../../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.scss.js";import"@material-ui/icons/BugReport";import"../../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../../../../componentsV2/Grid/Grid.js";import"../../../../../componentsV2/Grid/Cell.js";import"../../../../../componentsV2/PopoverPanel/PopoverPanel.js";import"../../../../../componentsV2/Radio/Radio.js";import"../../../../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../../../../componentsV2/Checkbox/Checkbox.js";import"../../../../../componentsV2/TextInputNext/TextInputNext.js";import"../../../../../componentsV2/TextArea/TextArea.js";import"../../../../../componentsV2/Label/Label.js";import"../../../../../componentsV2/TextLink/TextLink.js";import"../../../../../componentsV2/ChipAlert/ChipAlert.js";import"../../../../../componentsV2/Avatar/Avatar.js";import"../../../../../componentsV2/AvatarGroup/AvatarGroup.js";import"@material-ui/lab";import"../../../../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../../../../componentsV2/Paper/Paper.js";import"../../../../../componentsV2/Hint/Hint.scss.js";import"../../../../../componentsV2/Counter/Counter.js";import"../../../../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../../../../componentsV2/TemplatesControl/TemplatesControl.js";import"zustand";import"../../../../../componentsV2/TemplatesControl/utils.js";import"../../../../../componentsV2/TemplatesControl/icons/folder/index.js";import"../../../../../componentsV2/TemplatesControl/Store/utils.js";import"../../../../../componentsV2/TemplatesControl/types.js";import"../../../../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../../../../componentsV2/LoaderLinear/LoaderLinear.js";import"../../../../../componentsV2/Switch/Switch.js";import"../../../../../componentsV2/Tabs/Tabs.js";import"../../../../../componentsV2/FileIcon/FileIcon.js";import"../../../../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../../../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../../../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../../../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../../../../componentsV2/Skeleton/Skeleton.scss.js";import"../../../../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../../../../componentsV2/Stepper/Step/Step.scss.js";import"../../../../../componentsV2/Stepper/Stepper.scss.js";import"../../../../../componentsV2/ButtonLive/ButtonLive.js";import"../../../../../componentsV2/ButtonText/ButtonText.js";import"../../../../../componentsV2/IndicatorLive/IndicatorLive.js";import"../../../../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../../../../componentsV2/BadgeComment/BadgeComment.js";import"../../../../../componentsV2/AppFooter/AppFooter.js";import"../../../../../componentsV2/OffsetWellsButton/OffsetWellsButton.js";import"../../../../../componentsV2/ChartAxisExtreme/ChartAxisExtreme.scss.js";import"highcharts";import"../../../../../componentsV2/ChartAxisExtreme/ChartAxisExtremeDragTracker.js";import"../../../../../componentsV2/Autocomplete/Autocomplete.js";import"../../../../../componentsV2/Select/Select.js";import"../../../../../componentsV2/AppPanel/AppPanel.js";import"../../../../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../../../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../../../../componentsV2/DatePicker/DatePicker.js";import"../../../../../componentsV2/DragHandle/DragHandle.js";import"../../../../../componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js";import"../../../../../componentsV2/Slider/constants.js";import"../../../../../componentsV2/Slider/components/SliderThumb.js";import"../../../../../componentsV2/Slider/Slider.scss.js";import"../../../../../componentsV2/SliderAdvanced/SliderAdvanced.js";import"react-color";import"../../../../../componentsV2/ColorPicker/ColorPicker.constants.js";import"../../../../../componentsV2/ColorPicker/Swatches/Swatches.scss.js";import"../../../../../componentsV2/ColorPicker/OpacityDragtracker/OpacityDragTracker.scss.js";import"../../../../../componentsV2/ColorPicker/ColorPicker.scss.js";import"../../../../../componentsV2/ChartHelper/ChartHelper.scss.js";import"../../../../../componentsV2/Hotkey/Hotkey.js";import"@tanstack/react-query";import"../../../../../componentsV2/InterventionEventSelector/useInterventionUnitEvents.js";import"../../../../../componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js";import"@material-ui/icons/Launch";import"../../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.css.js";import"../../../../Icons/AnnotationIcon.js";import"../../../../HelpCenter/HelpCenterIcon.js";import"../../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/RestoreAppSizeButton.css.js";import"../../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.scss.js";import"../../../../Toaster/Toaster.js";import"../../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../../DevCenter/SideBar/SideBar.js";import"../../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../../AssetEditor/index.js";import"../../../../LoadingIndicator/LoadingIndicator.js";import"../../../../Typography.js";import"../../../../RealTimeValuesSidebar/RealTimeSidebar.js";import"../../../../CollapsableSidebar.js";import"../../../../DateTimePicker/index.js";import"../../../../DatePicker/index.js";import"../../../../SlateFormattedText/SlateFormattedText.js";import"../../../../SlateFormattedText/RenderElements.js";import"slate";import"../../../../ParameterCharts/ParameterCharts.js";import"../../../../ParameterCharts/AddEditTrack.js";import"../../../../ChartActionsList/ChartActionsList.js";import"../../../../CopyToClipboard/CopyToClipboard.js";import"../../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../../AssetEditor/SingleAssetEditor.js";import"../../../../SettingEditors/ColorEditor/style.css.js";import"../../../../SettingEditors/DropdownEditor/index.js";import"../../../../SwitchControl/index.js";import"../../../../ColorPicker/ColorPicker.js";import"../../../../Chart/components/ChartButton.js";import"../../../../Chart/components/ChartButtons.js";import"../../../../Chart/components/ChartWrapper.js";import"../../../../Chart/components/AxisDropdown.js";import"../../../../Chart/components/ChartSelect.js";import"../../../../Chart/ChartWrapperContext.js";import"../../../../Chart/effects/useChartModifier.js";import"../../../../Chart/components/buttons/HideAxesButton.js";import"../../../../Chart/components/buttons/ChartTypeButton.js";import"../../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../../TruncatedText/index.js";import"../../../../MiddleTruncatedText/MiddleTruncatedText.js";import"../../../../RangeSlider/constants.js";import"../../../../RangeSlider/Input.css.js";import"../../../../RangeSlider/RangeSlider.css.js";import"../../../../AdvancedSlider/AdvancedSlider.js";import"../../../../Breadcrumbs/index.js";import"../../../../VirtualizedTable/index.js";import"../../../../EmptyView/EmptyView.js";import"../../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../../ContextMenuItem/index.js";import"../../../../FolderMenuItem/index.js";import"../../../../EditableItem/EditableItem/index.js";import"../../../../EditableItem/EditableItemWithBadge/index.js";import"../../../../Checkbox/index.js";import"../../../../FolderMenuItemWithLinks/index.js";import"../../../../TextField/index.js";import"../../../../Chip/index.js";import"../../../../Counter/index.js";import"../../../../AnchorsList/AnchorsList.js";import"../../../../Select/index.js";import"../../../../Select/SelectFilterBy.js";import"../../../../CustomSelect/index.js";import"../../../../Tabs/Tabs.js";import"../../../../Tabs/Tab.js";import"../../../../ResizableTable/ResizableTable.js";import"../../../../GradientPicker/GradientPicker.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"../../../../GradientManager/GradientPreview/GradientPreview.js";import"../../../../GradientManager/GradientSelect.scss.js";import"../../../../GradientManager/GradientManager.styles.js";import"../../../../Drillstring/BHASchematic.js";import"../../../../Drillstring/BHATable/index.js";import"../../../../Drillstring/BHAComponentIcon.js";import"../../../../Drillstring/BHAComponentDetail/index.js";import"../../../../Drillstring/BHATileIcon.js";import"../../../../Drillstring/BHATile/BHATile.js";import"../../../../Drillstring/BHAList/BHAList.js";import"../../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../CasingTable/index.js";import u from"../../../CasingComponentIcon.js";import"../../../CasingTileIcon.js";import"../../CasingTableV2.js";import"../../../CasingTile/CasingTile.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"../../../../OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js";import"@material-ui/icons/Add";import"@material-ui/icons/Remove";import"mapbox-gl/dist/mapbox-gl.css";import"@material-ui/icons/Info";import"@material-ui/icons/Block";import"../../../../OffsetWellMap/WellTooltip.module.css.js";import"../../../../OffsetWellMap/OffsetWellMap.module.css.js";import"../../../../../config/mapboxGl/index.js";import"../../../../../config/mapbox/index.js";import"react-dom";import"@material-ui/core/Snackbar";import"../../../../Notifications/Toast.js";import"../../../../Notifications/Notifications.scss.js";import"../../../../TextLink/index.js";import"../../../../Avatar/index.js";import"../../../../Template/TemplatePopover/index.js";import"../../../../Template/TemplateSharingDialog/index.js";import"../../../../MenuItem/index.js";import"../../../../MiddleTruncate/MiddleTruncate.js";import"../../../../PinnableFilters/PinnableFilters.js";import"../../../../HeaderLayout/HeaderLayout.js";import"../../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../../PadOffsetsPicker/StagesSelector.js";import"../../../../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../../../../Table/TableToolbar/TableToolbar.js";import"../../../../Table/TableContainer/TableContainer.js";import"../../../../Table/TableCell/TableCell.js";import"../../../../Table/TablePagination/TablePagination.js";import"../../../../Table/TablePaginationActions/TablePaginationActions.js";import"../../../../Tooltip/ScrollableTooltip.js";import"../../../../PriceInput/PriceInput.js";import"../../../../LabelsCounter/LabelsCounter.js";import"../../../../Stepper/Stepper.js";import"../../../../Stepper/Step/Step.js";import"../../../../Stepper/StepsWrapper.js";import"../../../../Comment/CommentIcon/index.js";import"../../../../FilesLoader/FilesLoader.js";import"../../../../../componentsV2/FileIcon/icons/ArchiveFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/CSVFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/DocFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/EDMFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/ExcelFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/HtmlFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/ImageFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/JsonFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/LasFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/MarkdownFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/OtherFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/PdfFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/PowerPointFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/TxtFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/UnknownFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/VideoFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/XmlFileIcon.js";import"../../../../SearchInput/index.js";import"../../../../FeedItem/FeedItem.js";import"../../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../../PostInput/PostInput.js";import"../../../../KeyboardDateTimePicker.js";import"../../../../AddComment/Popover.js";import"../../../../AddComment/Popup.js";import"../../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../../StageDesignVActual/ComparisonHeader.js";import"../../../../StageDesignVActual/ComparisonRow.js";import"../../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../../EmbeddedApp/EmbeddedApp.js";import"../../../../Autocomplete/Autocomplete.js";import"../../../../DocumentViewer/DocumentViewer.js";import"../../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../../Search/Search.js";import"../../../../Search/components/Listbox.js";import"../../../../Search/components/Paper.js";import"../../../../Search/components/RecentSearches.js";import"../../../../Search/components/Groups.js";import"../../../../Search/components/SelectAllListItem.js";import"../../../../StatusBadge/index.js";import"../../../../Attachment/index.js";import"../../../../EmojiIconButton.js";import"../../../../FileUploadIconButton.js";import"../../../../FilePreview/index.js";import"../../../../FailedFileUploading.js";import"../../../../UserMention/index.js";import"../../../../CommentsInfo/index.js";import"../../../../CommentInput/index.js";import"../../../../Comment/index.js";import"../../../../CommentLoader.js";import"../../../../AssetNameLabel/AssetStatusBadge.js";import"../../../../AssetEditorV2/components/PrimaryAssetSelect.js";import"../../../../AssetEditorV2/components/SecondaryAssetSelect.js";import"../../../../AssetEditorV2/components/SelectItem.js";import"../../../../AssetEditorV2/components/MultipleAssetsToggle.js";import"../../../../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../../../../EChartsWrapper/EChartsWrapper.js";import"../../../../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../../../../GoogleDocsViewer/index.js";import"../../../../NewDocumentViewer/effects/useFileContent.js";import"../../../../NewDocumentViewer/styles.js";import"../../../../FilesLoaderV2/styles.js";import"../../../../FilesDropzone/styles.js";import"../../../../FilesProcessor/styles.js";import"../../../../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../../../../Formula/useFormulaStyles.js";import"../../../../Formula/RootXIcon.js";import"../../../../Formula/FormulaTextEditor.js";import"../../../../Formula/CloseSuggestion.js";import"../../../../Formula/SuggestionsMenu.js";import"../../../../CommentCard/CommentCard.js";import"@material-ui/icons/AlternateEmail";import"../../../../AttachFileButton/AttachFileButton.scss.js";import"../../../../CommentInputNext/CommentInputNext.js";import"../../../../WellhubFilePicker/components/WellhubFileCard/WellhubFileCard.scss.js";import"../../../../WellhubFilePicker/components/WellhubFilePickerView/WellhubFilePickerView.scss.js";import"react-s3-uploader/s3upload";import"../../../../CommentComposer/CommentMetaLine.scss.js";import"../../../../CommentComposer/ChatChannelSelector.scss.js";import"../../../../CommentComposer/ShareToChatRow.scss.js";import"../../../../CommentComposer/CommentComposer.scss.js";import"../../../../AttachmentPreview/AttachmentPreview.js";import"../../../../AttachmentPreview/AttachmentImage.js";import"../../../../AttachmentPreview/AttachmentPreview.scss.js";import"../../../../CommentPin/CommentPin.js";import"../../../../FeedCard/FeedCard.js";import"../../../../FeedItemCard/FeedItemCard.js";import"../../../../NewCommentCursor/NewCommentCursor.js";import"../../../../LinkedText/LinkedText.js";import"../../../../FeedItem/feedItemTypes/AlertFeedItem.js";import"../../../../FeedItem/feedItemTypes/PostFeedItem.js";import"../../../../FeedItem/feedItemTypes/GeosteeringFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingOperationalNoteFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingOperationSummaryFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingDailyCostFeedItem.js";import"../../../../FeedItem/feedItemTypes/DocumentFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillerMemoFeedItem.js";import"../../../../FeedItem/feedItemTypes/NptFeedItem.js";import"../../../../FeedItem/feedItemTypes/SurveyStationFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/LessonsLearnedFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/TracesMemoFeedItem.js";import"../../../../FeedItem/feedItemTypes/DepthCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionOperationalNoteFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionOperationSummaryFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionDailyCostFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionDocumentFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionNptFeedItem.js";import"../../../../FeedItem/feedItemTypes/StageOverviewFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/WellPlanFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/FluidReportFeedItem.js";import"../../../../FeedItem/feedItemTypes/BhaFeedItem/BhaFeedItem.js";import"../../../../FeedItem/feedItemTypes/DvDCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/PCCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/HookloadCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/NptLessonsCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/GenericDataCommentFeedItem.js";import{CancelButton as C}from"../../../../Drillstring/BHAComponentsTable/components/shared/CancelButton.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/FormatedNumber.js";import{InputText as I}from"../../../../Drillstring/BHAComponentsTable/components/shared/InputText.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/MoreButton.js";import{SaveButton as A}from"../../../../Drillstring/BHAComponentsTable/components/shared/SaveButton.js";import{SelectField as h}from"../../../../Drillstring/BHAComponentsTable/components/shared/SelectField.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/StaticField.js";import{SharedEditorElements as g}from"../../../../Drillstring/BHAComponentsTable/components/shared/SharedEditorElements.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js";import V from"../../../../Drillstring/BHAComponentsTable/components/Suggestions/Suggestions.js";import{useStyles as F}from"../../../../Drillstring/BHAComponentsTable/components/sharedStyles.js";function S(e){var s=e.component,S=e.error,T=void 0===S?null:S,v=e.onChange,b=e.onCancel,D=e.onSave,P=e.onUseSuggestion,x=e.columns,f=F({isMobile:p}),y=p?r/2:r/x,B=function(e){return T&&T[e]},k=o((function(){var e=a;return s.outer_diameter?e.filter((function(e){return e.outer_diameter===parseFloat(s.outer_diameter)})):[]}),[s.outer_diameter]);return m(i,{container:!0,spacing:0,className:f.editorContainer,children:[!p&&c(i,{item:!0,className:f.editorComponentSize,children:c(u,{component:s})}),c(i,{item:!0,className:f.eidtorContentContainer,children:m(i,{container:!0,spacing:2,children:[c(g,{component:s,getError:B,onChange:v,isCasing:!0}),k.length>0&&c(V,{data:k,allData:a,columns:n,displayKeys:["outer_diameter","inner_diameter"],descriptionKeys:["outer_diameter","inner_diameter","linear_weight","number_of_joints","component_length"],onSelect:P,isCasing:!0}),c(I,{type:"name",label:"Name",value:s.name,error:B("name"),xs:y,onChangeField:v}),c(I,{type:"number_of_joints",label:"# of Joints",value:s.number_of_joints,error:B("number_of_joints"),xs:y,onChangeField:v}),c(I,{type:"component_length",label:"Component Length",unit:"length",value:s.component_length,error:B("component_length"),xs:y,onChangeField:v}),c(I,{type:"weight",label:"T.Weight",unit:"mass",value:s.weight,error:B("weight"),disabled:!0,xs:y,onChangeField:v}),c(h,{type:"grade",options:l,label:"Grade",value:s.grade,error:B("grade"),xs:y,onChangeField:v}),c(I,{type:"outer_diameter_tooljoint",label:"TJ OD",unit:"shortLength",value:s.outer_diameter_tooljoint,error:B("outer_diameter_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"inner_diameter_tooljoint",label:"TJ ID",unit:"shortLength",value:s.inner_diameter_tooljoint,error:B("inner_diameter_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"length_tooljoint",label:"TJ Length Per Joint",unit:"length",value:s.length_tooljoint,error:B("length_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"connection_type",label:"Connection Type",value:s.connection_type,error:B("connection_type"),xs:y,onChangeField:v}),c(h,{type:"class",options:d,label:"Class",value:s.class,error:B("class"),xs:y,onChangeField:v}),c(h,{type:"material",options:j,label:"Material",value:s.material,error:B("material"),xs:y,onChangeField:v})]})}),!p&&m(i,{item:!0,className:f.eidtorActionGroup,children:[c(C,{handleCancel:b}),c(A,{handleSave:D,disabled:!t(T)})]})]})}S.propTypes={component:s.shape({outer_diameter:s.number,component_length:s.number,name:s.string,number_of_joints:s.number,weight:s.number,connection_type:s.string,grade:s.string,class:s.string,material:s.string,outer_diameter_tooljoint:s.number,inner_diameter_tooljoint:s.number,length_tooljoint:s.number}).isRequired,error:s.shape({}),onChange:s.func.isRequired,onCancel:s.func.isRequired,onSave:s.func.isRequired,onUseSuggestion:s.func.isRequired,columns:s.number.isRequired};var T=e(S);export{T as default};
1
+ import{memo as e,useMemo as o}from"react";import{isEmpty as t}from"lodash";import s from"prop-types";import{Grid as i}from"@material-ui/core";import{OD_ID_DEP_COLUMNS as n,CONTAINER_XS as r}from"../constants.js";import{isMobileDetected as m}from"../../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/defineProperty";import"../../../../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import"../../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@babel/runtime/helpers/objectWithoutProperties";import"classnames";import"../../../../Modal/CorvaModal.scss.js";import"@icon-park/react/es/all";import{jsxs as p,jsx as c}from"react/jsx-runtime";import"../../../../../icons/IconParkProvider.js";import"../../../../../icons/customIcons/icons/AddMessage.js";import"../../../../../icons/customIcons/icons/DragOne.js";import"../../../../../icons/customIcons/icons/Attention.js";import"../../../../../icons/customIcons/icons/Collapse.js";import"../../../../../icons/customIcons/icons/Dashboard.js";import"../../../../../icons/customIcons/icons/Expand.js";import"../../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../../icons/customIcons/icons/Search.js";import"../../../../../icons/customIcons/icons/SearchOne.js";import"../../../../../icons/customIcons/icons/Wellhub.js";import"../../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../../icons/customIcons/icons/Checkbox.js";import"../../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../../icons/customIcons/icons/Radio.js";import"../../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../../icons/customIcons/icons/InfoRounded.js";import"../../../../../icons/customIcons/icons/FlameFilled.js";import"../../../../../icons/customIcons/icons/MoreApp.js";import"../../../../../icons/customIcons/icons/Pad.js";import"../../../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../../../icons/customIcons/icons/FracFleet.js";import"../../../../../icons/customIcons/icons/Global.js";import"../../../../../icons/customIcons/icons/Program.js";import"../../../../../icons/customIcons/icons/Rig.js";import"../../../../../icons/customIcons/icons/Well.js";import"../../../../../icons/customIcons/icons/Gap.js";import"../../../../../icons/customIcons/icons/Pin.js";import"../../../../../icons/customIcons/icons/PinOne.js";import"../../../../../icons/customIcons/icons/PinOneCrossed.js";import"../../../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../../../icons/customIcons/icons/AttentionFilled.js";import"../../../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../../../icons/customIcons/icons/Archive.js";import"../../../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../../../icons/customIcons/icons/Unarchive.js";import"../../../../../icons/customIcons/icons/Archived.js";import"../../../../../icons/customIcons/icons/InterventionUnit.js";import"../../../../../icons/customIcons/icons/CloudDelete.js";import"../../../../../icons/customIcons/icons/Lasso.js";import"../../../../../icons/customIcons/icons/Radius.js";import"../../../../../icons/customIcons/icons/ErrorOps.js";import"../../../../../icons/customIcons/icons/DataTypeOps.js";import"../../../../../icons/customIcons/icons/FalsePositiveOps.js";import"../../../../../icons/customIcons/icons/CalibrationOps.js";import"../../../../../icons/customIcons/icons/CriticalOps.js";import"../../../../../icons/customIcons/icons/Company.js";import"../../../../../icons/customIcons/icons/ArchiveOne.js";import"../../../../../icons/customIcons/icons/ParseBotFusion.js";import"../../../../../icons/customIcons/icons/Connect.js";import"../../../../../icons/customIcons/icons/PuzzleOne.js";import"../../../../../icons/customIcons/icons/Feed.js";import"../../../../../icons/customIcons/icons/Prompt.js";import"../../../../../icons/customIcons/icons/Companies.js";import"../../../../../icons/customIcons/icons/ClipboardAi.js";import"../../../../../icons/customIcons/icons/Key.js";import"../../../../../icons/customIcons/icons/AtSignCrossed.js";import"../../../../../icons/customIcons/icons/MappingManual.js";import"../../../../../icons/customIcons/icons/Mapping.js";import"../../../../../icons/customIcons/icons/Metrics.js";import"../../../../../icons/customIcons/icons/Drops.js";import"../../../../../icons/customIcons/icons/ClipboardSearch.js";import"../../../../../icons/customIcons/icons/Template.js";import"../../../../../icons/customIcons/icons/ClipboardMetrics.js";import"../../../../../icons/customIcons/icons/ClipboardBuilder.js";import"../../../../../icons/customIcons/icons/UnitConversion.js";import"../../../../../icons/customIcons/icons/NPT.js";import"../../../../../icons/customIcons/icons/GuidedFrac.js";import"../../../../IconButton/index.js";import"../../../../../constants/goals.js";import"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import"../../../../../constants/apps.js";import{OD_ID_DEP_LIST as a,COMPONENT_GRADES as l,COMPONENT_CLASSES as d,COMPONENT_MATERIALS as j}from"../../../../../constants/casing.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"@babel/runtime/helpers/slicedToArray";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/AppContext.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../DevCenter/AppsDataProvider/effects/utils.js";import"@babel/runtime/helpers/toConsumableArray";import"query-string";import"../../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router-dom";import"../../../../UserMention/utils/index.js";import"../../../../../utils/convert.js";import"moment";import"../../../../../utils/casing/validation.js";import"lodash/mean";import"../../../../../constants/streamSourceType.js";import"lodash/get";import"file-saver";import"../../../../../utils/drillstring/conversion.js";import"lodash/set";import"lodash/cloneDeep";import"lodash/isNumber";import"lodash/has";import"../../../../../utils/ga.js";import"../../../../../utils/goalsConfig/goalsConfig.js";import"../../../../../utils/lasParser.js";import"../../../../../utils/main.js";import"../../../../../utils/metrics/metricsConfig.js";import"../../../../../utils/feed.js";import"../../../../../utils/reports.js";import"moment-timezone";import"@babel/runtime/helpers/typeof";import"../../../../../utils/dashboardReports.js";import"../../../../../utils/env.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../../../../utils/jsonaDataFormatter.js";import"../../../../../utils/bha.js";import"jsona";import"../../../../../clients/jsonApi/index.js";import"../../../../../utils/shareRecentRequest.js";import"../../../../../utils/charts/Styles.scss.js";import"../../../../../utils/getSingleAsset.js";import"@material-ui/icons/ArrowForward";import"../../../../EmptyState/EmptyState.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/styles.js";import"@material-ui/pickers";import"@date-io/moment";import"../../../../../config/theme/index.js";import"../../../../../hocs/withAssetEditorLockHOC.js";import"../../../../ErrorBoundary/ErrorBoundary.js";import"../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../../Button/components/Button/index.js";import"../../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../../../../Button/components/LiveButton/styles.js";import"../../../../AssetEditorV2/index.js";import"../../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../../ConfirmationDialog.js";import"../../../../../permissions/PermissionsContext.js";import"../../../../../permissions/constants/index.js";import"../../../../../permissions/withPermissionsHOC.js";import"../../../../../permissions/ProvidePermissions.js";import"../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants.js";import"../../../../Annotations/components/AnnotationsList/index.js";import"../../../../Annotations/components/LastAnnotation/index.js";import"../../../../Annotations/AnnotationsContext.js";import"../../../../../componentsV2/AppContainer/AppContainer.js";import"../../../../../componentsV2/AppContainer/AppContainer.constants.js";import"../../../../../componentsV2/Text/Text.js";import"../../../../../componentsV2/Header/Header.scss.js";import"../../../../../componentsV2/Tooltip/Tooltip.scss.js";import"../../../../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../../../../componentsV2/AppHeader/AppHeader.constants.js";import"../../../../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../../../../componentsV2/Chip/Chip.js";import"../../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../../../../componentsV2/AppHeader/AppAssets/utils.js";import"../../../../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../../../../PadModeSelect/PadModeSelect.js";import"../../../../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../../../../componentsV2/PadModeSelect/PadModeSelect.js";import"../../../../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsProvider.js";import"../../../../../componentsV2/utils.js";import"../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../../../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../../../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../../../../componentsV2/Button/Button.js";import"../../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../../../../componentsV2/Popover/Popover.js";import"../../../../../componentsV2/Accordion/Accordion.scss.js";import"../../../../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../../../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../../../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../../../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../../../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../../../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../../../../componentsV2/Menu/Menu.js";import"../../../../../componentsV2/ModalWindow/ModalWindow.js";import"../../../../../componentsV2/Modal/Modal.scss.js";import"../../../../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../../../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../../../../componentsV2/TextInput/TextInput.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../../../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"querystring";import"../../../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../../StatusBadge/constants.js";import"lodash/unset";import"../../../../../clients/api/apiCore.js";import"../../../../../clients/constants.js";import"../../../../../clients/sso/auth0.js";import"../../../../../clients/sso/oauth2.js";import"../../../../../clients/api/rateLimiter.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../../../componentsV2/AppPanel/AppPanelsContext.js";import"../../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../../../../componentsV2/AppHeader/V3/constants.scss.js";import"../../../../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.constants.js";import"../../../../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../../../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../../../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../../../../componentsV2/AppHeader/AppHeader.scss.js";import"../../../../../componentsV2/EmptyState/EmptyState.scss.js";import"../../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton.js";import"../../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.scss.js";import"@material-ui/icons/BugReport";import"../../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../../../../componentsV2/Grid/Grid.js";import"../../../../../componentsV2/Grid/Cell.js";import"../../../../../componentsV2/PopoverPanel/PopoverPanel.js";import"../../../../../componentsV2/Radio/Radio.js";import"../../../../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../../../../componentsV2/Checkbox/Checkbox.js";import"../../../../../componentsV2/TextInputNext/TextInputNext.js";import"../../../../../componentsV2/TextArea/TextArea.js";import"../../../../../componentsV2/Label/Label.js";import"../../../../../componentsV2/TextLink/TextLink.js";import"../../../../../componentsV2/ChipAlert/ChipAlert.js";import"../../../../../componentsV2/Avatar/Avatar.js";import"../../../../../componentsV2/AvatarGroup/AvatarGroup.js";import"@material-ui/lab";import"../../../../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../../../../componentsV2/Paper/Paper.js";import"../../../../../componentsV2/Hint/Hint.scss.js";import"../../../../../componentsV2/Counter/Counter.js";import"../../../../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../../../../componentsV2/TemplatesControl/TemplatesControl.js";import"zustand";import"../../../../../componentsV2/TemplatesControl/utils.js";import"../../../../../componentsV2/TemplatesControl/icons/folder/index.js";import"../../../../../componentsV2/TemplatesControl/Store/utils.js";import"../../../../../componentsV2/TemplatesControl/types.js";import"../../../../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../../../../componentsV2/LoaderLinear/LoaderLinear.js";import"../../../../../componentsV2/Switch/Switch.js";import"../../../../../componentsV2/Tabs/Tabs.js";import"../../../../../componentsV2/FileIcon/FileIcon.js";import"../../../../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../../../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../../../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../../../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../../../../componentsV2/Skeleton/Skeleton.scss.js";import"../../../../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../../../../componentsV2/Stepper/Step/Step.scss.js";import"../../../../../componentsV2/Stepper/Stepper.scss.js";import"../../../../../componentsV2/ButtonLive/ButtonLive.js";import"../../../../../componentsV2/ButtonText/ButtonText.js";import"../../../../../componentsV2/IndicatorLive/IndicatorLive.js";import"../../../../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../../../../componentsV2/BadgeComment/BadgeComment.js";import"../../../../../componentsV2/AppFooter/AppFooter.js";import"../../../../../componentsV2/OffsetWellsButton/OffsetWellsButton.js";import"../../../../../componentsV2/ChartAxisExtreme/ChartAxisExtreme.scss.js";import"highcharts";import"../../../../../componentsV2/ChartAxisExtreme/ChartAxisExtremeDragTracker.js";import"../../../../../componentsV2/Autocomplete/Autocomplete.js";import"../../../../../componentsV2/Select/Select.js";import"../../../../../componentsV2/AppPanel/AppPanel.js";import"../../../../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../../../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../../../../componentsV2/DatePicker/DatePicker.js";import"../../../../../componentsV2/DragHandle/DragHandle.js";import"../../../../../componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js";import"../../../../../componentsV2/Slider/constants.js";import"../../../../../componentsV2/Slider/components/SliderThumb.js";import"../../../../../componentsV2/Slider/Slider.scss.js";import"../../../../../componentsV2/SliderAdvanced/SliderAdvanced.js";import"react-color";import"../../../../../componentsV2/ColorPicker/ColorPicker.constants.js";import"../../../../../componentsV2/ColorPicker/Swatches/Swatches.scss.js";import"../../../../../componentsV2/ColorPicker/OpacityDragtracker/OpacityDragTracker.scss.js";import"../../../../../componentsV2/ColorPicker/ColorPicker.scss.js";import"../../../../../componentsV2/ChartHelper/ChartHelper.scss.js";import"../../../../../componentsV2/Hotkey/Hotkey.js";import"@tanstack/react-query";import"../../../../../componentsV2/InterventionEventSelector/useInterventionUnitEvents.js";import"../../../../../componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js";import"@material-ui/icons/Launch";import"../../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.css.js";import"../../../../Icons/AnnotationIcon.js";import"../../../../HelpCenter/HelpCenterIcon.js";import"../../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/RestoreAppSizeButton.css.js";import"../../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.scss.js";import"../../../../Toaster/Toaster.js";import"../../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../../DevCenter/SideBar/SideBar.js";import"../../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../../AssetEditor/index.js";import"../../../../LoadingIndicator/LoadingIndicator.js";import"../../../../Typography.js";import"../../../../RealTimeValuesSidebar/RealTimeSidebar.js";import"../../../../CollapsableSidebar.js";import"../../../../DateTimePicker/index.js";import"../../../../DatePicker/index.js";import"../../../../SlateFormattedText/SlateFormattedText.js";import"../../../../SlateFormattedText/RenderElements.js";import"slate";import"../../../../ParameterCharts/ParameterCharts.js";import"../../../../ParameterCharts/AddEditTrack.js";import"../../../../ChartActionsList/ChartActionsList.js";import"../../../../CopyToClipboard/CopyToClipboard.js";import"../../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../../AssetEditor/SingleAssetEditor.js";import"../../../../SettingEditors/ColorEditor/style.css.js";import"../../../../SettingEditors/DropdownEditor/index.js";import"../../../../SwitchControl/index.js";import"../../../../ColorPicker/ColorPicker.js";import"../../../../Chart/components/ChartButton.js";import"../../../../Chart/components/ChartButtons.js";import"../../../../Chart/components/ChartWrapper.js";import"../../../../Chart/components/AxisDropdown.js";import"../../../../Chart/components/ChartSelect.js";import"../../../../Chart/ChartWrapperContext.js";import"../../../../Chart/effects/useChartModifier.js";import"../../../../Chart/components/buttons/HideAxesButton.js";import"../../../../Chart/components/buttons/ChartTypeButton.js";import"../../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../../TruncatedText/index.js";import"../../../../MiddleTruncatedText/MiddleTruncatedText.js";import"../../../../RangeSlider/constants.js";import"../../../../RangeSlider/Input.css.js";import"../../../../RangeSlider/RangeSlider.css.js";import"../../../../AdvancedSlider/AdvancedSlider.js";import"../../../../Breadcrumbs/index.js";import"../../../../VirtualizedTable/index.js";import"../../../../EmptyView/EmptyView.js";import"../../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../../ContextMenuItem/index.js";import"../../../../FolderMenuItem/index.js";import"../../../../EditableItem/EditableItem/index.js";import"../../../../EditableItem/EditableItemWithBadge/index.js";import"../../../../Checkbox/index.js";import"../../../../FolderMenuItemWithLinks/index.js";import"../../../../TextField/index.js";import"../../../../Chip/index.js";import"../../../../Counter/index.js";import"../../../../AnchorsList/AnchorsList.js";import"../../../../Select/index.js";import"../../../../Select/SelectFilterBy.js";import"../../../../CustomSelect/index.js";import"../../../../Tabs/Tabs.js";import"../../../../Tabs/Tab.js";import"../../../../ResizableTable/ResizableTable.js";import"../../../../GradientPicker/GradientPicker.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"../../../../GradientManager/GradientPreview/GradientPreview.js";import"../../../../GradientManager/GradientSelect.scss.js";import"../../../../GradientManager/GradientManager.styles.js";import"../../../../Drillstring/BHASchematic.js";import"../../../../Drillstring/BHATable/index.js";import"../../../../Drillstring/BHAComponentIcon.js";import"../../../../Drillstring/BHAComponentDetail/index.js";import"../../../../Drillstring/BHATileIcon.js";import"../../../../Drillstring/BHATile/BHATile.js";import"../../../../Drillstring/BHAList/BHAList.js";import"../../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../CasingTable/index.js";import u from"../../../CasingComponentIcon.js";import"../../../CasingTileIcon.js";import"../../CasingTableV2.js";import"../../../CasingTile/CasingTile.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"../../../../OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js";import"@material-ui/icons/Add";import"@material-ui/icons/Remove";import"mapbox-gl/dist/mapbox-gl.css";import"@material-ui/icons/Info";import"@material-ui/icons/Block";import"../../../../OffsetWellMap/WellTooltip.module.css.js";import"../../../../OffsetWellMap/OffsetWellMap.module.css.js";import"../../../../../config/mapboxGl/index.js";import"../../../../../config/mapbox/index.js";import"react-dom";import"@material-ui/core/Snackbar";import"../../../../Notifications/Toast.js";import"../../../../Notifications/Notifications.scss.js";import"../../../../TextLink/index.js";import"../../../../Avatar/index.js";import"../../../../Template/TemplatePopover/index.js";import"../../../../Template/TemplateSharingDialog/index.js";import"../../../../MenuItem/index.js";import"../../../../MiddleTruncate/MiddleTruncate.js";import"../../../../PinnableFilters/PinnableFilters.js";import"../../../../HeaderLayout/HeaderLayout.js";import"../../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../../PadOffsetsPicker/StagesSelector.js";import"../../../../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../../../../Table/TableToolbar/TableToolbar.js";import"../../../../Table/TableContainer/TableContainer.js";import"../../../../Table/TableCell/TableCell.js";import"../../../../Table/TablePagination/TablePagination.js";import"../../../../Table/TablePaginationActions/TablePaginationActions.js";import"../../../../Tooltip/ScrollableTooltip.js";import"../../../../PriceInput/PriceInput.js";import"../../../../LabelsCounter/LabelsCounter.js";import"../../../../Stepper/Stepper.js";import"../../../../Stepper/Step/Step.js";import"../../../../Stepper/StepsWrapper.js";import"../../../../Comment/CommentIcon/index.js";import"../../../../FilesLoader/FilesLoader.js";import"../../../../../componentsV2/FileIcon/icons/ArchiveFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/CSVFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/DocFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/EDMFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/ExcelFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/HtmlFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/ImageFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/JsonFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/LasFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/MarkdownFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/OtherFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/PdfFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/PowerPointFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/TxtFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/UnknownFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/VideoFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/XmlFileIcon.js";import"../../../../SearchInput/index.js";import"../../../../FeedItem/FeedItem.js";import"../../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../../PostInput/PostInput.js";import"../../../../KeyboardDateTimePicker.js";import"../../../../AddComment/Popover.js";import"../../../../AddComment/Popup.js";import"../../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../../StageDesignVActual/ComparisonHeader.js";import"../../../../StageDesignVActual/ComparisonRow.js";import"../../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../../EmbeddedApp/EmbeddedApp.js";import"../../../../Autocomplete/Autocomplete.js";import"../../../../DocumentViewer/DocumentViewer.js";import"../../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../../Search/Search.js";import"../../../../Search/components/Listbox.js";import"../../../../Search/components/Paper.js";import"../../../../Search/components/RecentSearches.js";import"../../../../Search/components/Groups.js";import"../../../../Search/components/SelectAllListItem.js";import"../../../../StatusBadge/index.js";import"../../../../Attachment/index.js";import"../../../../EmojiIconButton.js";import"../../../../FileUploadIconButton.js";import"../../../../FilePreview/index.js";import"../../../../FailedFileUploading.js";import"../../../../UserMention/index.js";import"../../../../CommentsInfo/index.js";import"../../../../CommentInput/index.js";import"../../../../Comment/index.js";import"../../../../CommentLoader.js";import"../../../../AssetNameLabel/AssetStatusBadge.js";import"../../../../AssetEditorV2/components/PrimaryAssetSelect.js";import"../../../../AssetEditorV2/components/SecondaryAssetSelect.js";import"../../../../AssetEditorV2/components/SelectItem.js";import"../../../../AssetEditorV2/components/MultipleAssetsToggle.js";import"../../../../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../../../../EChartsWrapper/EChartsWrapper.js";import"../../../../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../../../../GoogleDocsViewer/index.js";import"../../../../NewDocumentViewer/effects/useFileContent.js";import"../../../../NewDocumentViewer/styles.js";import"../../../../FilesLoaderV2/styles.js";import"../../../../FilesDropzone/styles.js";import"../../../../FilesProcessor/styles.js";import"../../../../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../../../../Formula/useFormulaStyles.js";import"../../../../Formula/RootXIcon.js";import"../../../../Formula/FormulaTextEditor.js";import"../../../../Formula/CloseSuggestion.js";import"../../../../Formula/SuggestionsMenu.js";import"../../../../CommentCard/CommentCard.js";import"@material-ui/icons/AlternateEmail";import"../../../../AttachFileButton/AttachFileButton.scss.js";import"../../../../CommentInputNext/CommentInputNext.js";import"../../../../WellhubFilePicker/components/WellhubFileCard/WellhubFileCard.scss.js";import"../../../../WellhubFilePicker/components/WellhubFilePickerView/WellhubFilePickerView.scss.js";import"react-s3-uploader/s3upload";import"../../../../CommentComposer/CommentMentionField.scss.js";import"../../../../CommentComposer/CommentMetaLine.scss.js";import"../../../../CommentComposer/ChatChannelSelector.scss.js";import"../../../../CommentComposer/ShareToChatRow.scss.js";import"../../../../CommentComposer/CommentComposer.scss.js";import"../../../../AttachmentPreview/AttachmentPreview.js";import"../../../../AttachmentPreview/AttachmentImage.js";import"../../../../AttachmentPreview/AttachmentPreview.scss.js";import"../../../../CommentPin/CommentPin.js";import"../../../../FeedCard/FeedCard.js";import"../../../../FeedItemCard/FeedItemCard.js";import"../../../../NewCommentCursor/NewCommentCursor.js";import"../../../../LinkedText/LinkedText.js";import"../../../../FeedItem/feedItemTypes/AlertFeedItem.js";import"../../../../FeedItem/feedItemTypes/PostFeedItem.js";import"../../../../FeedItem/feedItemTypes/GeosteeringFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingOperationalNoteFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingOperationSummaryFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingDailyCostFeedItem.js";import"../../../../FeedItem/feedItemTypes/DocumentFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillerMemoFeedItem.js";import"../../../../FeedItem/feedItemTypes/NptFeedItem.js";import"../../../../FeedItem/feedItemTypes/SurveyStationFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/LessonsLearnedFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/TracesMemoFeedItem.js";import"../../../../FeedItem/feedItemTypes/DepthCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionOperationalNoteFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionOperationSummaryFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionDailyCostFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionDocumentFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionNptFeedItem.js";import"../../../../FeedItem/feedItemTypes/StageOverviewFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/WellPlanFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/FluidReportFeedItem.js";import"../../../../FeedItem/feedItemTypes/BhaFeedItem/BhaFeedItem.js";import"../../../../FeedItem/feedItemTypes/DvDCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/PCCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/HookloadCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/NptLessonsCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/GenericDataCommentFeedItem.js";import{CancelButton as C}from"../../../../Drillstring/BHAComponentsTable/components/shared/CancelButton.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/FormatedNumber.js";import{InputText as I}from"../../../../Drillstring/BHAComponentsTable/components/shared/InputText.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/MoreButton.js";import{SaveButton as A}from"../../../../Drillstring/BHAComponentsTable/components/shared/SaveButton.js";import{SelectField as h}from"../../../../Drillstring/BHAComponentsTable/components/shared/SelectField.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/StaticField.js";import{SharedEditorElements as g}from"../../../../Drillstring/BHAComponentsTable/components/shared/SharedEditorElements.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js";import V from"../../../../Drillstring/BHAComponentsTable/components/Suggestions/Suggestions.js";import{useStyles as F}from"../../../../Drillstring/BHAComponentsTable/components/sharedStyles.js";function S(e){var s=e.component,S=e.error,T=void 0===S?null:S,v=e.onChange,b=e.onCancel,D=e.onSave,P=e.onUseSuggestion,x=e.columns,f=F({isMobile:m}),y=m?r/2:r/x,B=function(e){return T&&T[e]},k=o((function(){var e=a;return s.outer_diameter?e.filter((function(e){return e.outer_diameter===parseFloat(s.outer_diameter)})):[]}),[s.outer_diameter]);return p(i,{container:!0,spacing:0,className:f.editorContainer,children:[!m&&c(i,{item:!0,className:f.editorComponentSize,children:c(u,{component:s})}),c(i,{item:!0,className:f.eidtorContentContainer,children:p(i,{container:!0,spacing:2,children:[c(g,{component:s,getError:B,onChange:v,isCasing:!0}),k.length>0&&c(V,{data:k,allData:a,columns:n,displayKeys:["outer_diameter","inner_diameter"],descriptionKeys:["outer_diameter","inner_diameter","linear_weight","number_of_joints","component_length"],onSelect:P,isCasing:!0}),c(I,{type:"name",label:"Name",value:s.name,error:B("name"),xs:y,onChangeField:v}),c(I,{type:"number_of_joints",label:"# of Joints",value:s.number_of_joints,error:B("number_of_joints"),xs:y,onChangeField:v}),c(I,{type:"component_length",label:"Component Length",unit:"length",value:s.component_length,error:B("component_length"),xs:y,onChangeField:v}),c(I,{type:"weight",label:"T.Weight",unit:"mass",value:s.weight,error:B("weight"),disabled:!0,xs:y,onChangeField:v}),c(h,{type:"grade",options:l,label:"Grade",value:s.grade,error:B("grade"),xs:y,onChangeField:v}),c(I,{type:"outer_diameter_tooljoint",label:"TJ OD",unit:"shortLength",value:s.outer_diameter_tooljoint,error:B("outer_diameter_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"inner_diameter_tooljoint",label:"TJ ID",unit:"shortLength",value:s.inner_diameter_tooljoint,error:B("inner_diameter_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"length_tooljoint",label:"TJ Length Per Joint",unit:"length",value:s.length_tooljoint,error:B("length_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"connection_type",label:"Connection Type",value:s.connection_type,error:B("connection_type"),xs:y,onChangeField:v}),c(h,{type:"class",options:d,label:"Class",value:s.class,error:B("class"),xs:y,onChangeField:v}),c(h,{type:"material",options:j,label:"Material",value:s.material,error:B("material"),xs:y,onChangeField:v})]})}),!m&&p(i,{item:!0,className:f.eidtorActionGroup,children:[c(C,{handleCancel:b}),c(A,{handleSave:D,disabled:!t(T)})]})]})}S.propTypes={component:s.shape({outer_diameter:s.number,component_length:s.number,name:s.string,number_of_joints:s.number,weight:s.number,connection_type:s.string,grade:s.string,class:s.string,material:s.string,outer_diameter_tooljoint:s.number,inner_diameter_tooljoint:s.number,length_tooljoint:s.number}).isRequired,error:s.shape({}),onChange:s.func.isRequired,onCancel:s.func.isRequired,onSave:s.func.isRequired,onUseSuggestion:s.func.isRequired,columns:s.number.isRequired};var T=e(S);export{T as default};
2
2
  //# sourceMappingURL=Editor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.js","sources":["../../../../../../src/components/Casing/CasingTableV2/components/DrillPipe/Editor.js"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport { isEmpty } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { Grid } from '@material-ui/core';\n\nimport { CONTAINER_XS, OD_ID_DEP_COLUMNS } from '../constants';\n\nimport { isMobileDetected } from '~/utils/mobileDetect';\nimport { CasingComponentIcon as ComponentIcon } from '~/components';\nimport {\n COMPONENT_GRADES,\n COMPONENT_CLASSES,\n COMPONENT_MATERIALS,\n OD_ID_DEP_LIST,\n} from '~/constants/casing';\nimport {\n InputText,\n SelectField,\n CancelButton,\n SaveButton,\n SharedEditorElements,\n} from '~/components/Drillstring/BHAComponentsTable/components/shared';\nimport { Suggestions } from '~/components/Drillstring/BHAComponentsTable/components/Suggestions';\nimport { useStyles } from '~/components/Drillstring/BHAComponentsTable/components/sharedStyles';\n\nfunction DrillPipe({\n component,\n error = null,\n onChange,\n onCancel,\n onSave,\n onUseSuggestion,\n columns,\n}) {\n const classes = useStyles({ isMobile: isMobileDetected });\n const xs = isMobileDetected ? CONTAINER_XS / 2 : CONTAINER_XS / columns;\n\n const getError = key => error && error[key];\n\n const filteredSuggestions = useMemo(() => {\n const suggestionsToUse = OD_ID_DEP_LIST;\n return !component.outer_diameter\n ? []\n : suggestionsToUse.filter(\n item => item.outer_diameter === parseFloat(component.outer_diameter)\n );\n }, [component.outer_diameter]);\n\n return (\n <Grid container spacing={0} className={classes.editorContainer}>\n {!isMobileDetected && (\n <Grid item className={classes.editorComponentSize}>\n <ComponentIcon component={component} />\n </Grid>\n )}\n <Grid item className={classes.eidtorContentContainer}>\n <Grid container spacing={2}>\n <SharedEditorElements\n component={component}\n getError={getError}\n onChange={onChange}\n isCasing\n />\n\n {filteredSuggestions.length > 0 && (\n <Suggestions\n data={filteredSuggestions}\n allData={OD_ID_DEP_LIST}\n columns={OD_ID_DEP_COLUMNS}\n displayKeys={['outer_diameter', 'inner_diameter']}\n descriptionKeys={[\n 'outer_diameter',\n 'inner_diameter',\n 'linear_weight',\n 'number_of_joints',\n 'component_length',\n ]}\n onSelect={onUseSuggestion}\n isCasing\n />\n )}\n\n <InputText\n type=\"name\"\n label=\"Name\"\n value={component.name}\n error={getError('name')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"number_of_joints\"\n label=\"# of Joints\"\n value={component.number_of_joints}\n error={getError('number_of_joints')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"component_length\"\n label=\"Component Length\"\n unit=\"length\"\n value={component.component_length}\n error={getError('component_length')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"weight\"\n label=\"T.Weight\"\n unit=\"mass\"\n value={component.weight}\n error={getError('weight')}\n disabled\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"grade\"\n options={COMPONENT_GRADES}\n label=\"Grade\"\n value={component.grade}\n error={getError('grade')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"outer_diameter_tooljoint\"\n label=\"TJ OD\"\n unit=\"shortLength\"\n value={component.outer_diameter_tooljoint}\n error={getError('outer_diameter_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"inner_diameter_tooljoint\"\n label=\"TJ ID\"\n unit=\"shortLength\"\n value={component.inner_diameter_tooljoint}\n error={getError('inner_diameter_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"length_tooljoint\"\n label=\"TJ Length Per Joint\"\n unit=\"length\"\n value={component.length_tooljoint}\n error={getError('length_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"connection_type\"\n label=\"Connection Type\"\n value={component.connection_type}\n error={getError('connection_type')}\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"class\"\n options={COMPONENT_CLASSES}\n label=\"Class\"\n value={component.class}\n error={getError('class')}\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"material\"\n options={COMPONENT_MATERIALS}\n label=\"Material\"\n value={component.material}\n error={getError('material')}\n xs={xs}\n onChangeField={onChange}\n />\n </Grid>\n </Grid>\n {!isMobileDetected && (\n <Grid item className={classes.eidtorActionGroup}>\n <CancelButton handleCancel={onCancel} />\n <SaveButton handleSave={onSave} disabled={!isEmpty(error)} />\n </Grid>\n )}\n </Grid>\n );\n}\n\nDrillPipe.propTypes = {\n component: PropTypes.shape({\n outer_diameter: PropTypes.number,\n component_length: PropTypes.number,\n name: PropTypes.string,\n number_of_joints: PropTypes.number,\n weight: PropTypes.number,\n connection_type: PropTypes.string,\n grade: PropTypes.string,\n class: PropTypes.string,\n material: PropTypes.string,\n outer_diameter_tooljoint: PropTypes.number,\n inner_diameter_tooljoint: PropTypes.number,\n length_tooljoint: PropTypes.number,\n }).isRequired,\n error: PropTypes.shape({}),\n onChange: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n onUseSuggestion: PropTypes.func.isRequired,\n columns: PropTypes.number.isRequired,\n};\n\nexport default memo(DrillPipe);\n"],"names":["DrillPipe","_ref","component","_ref$error","error","onChange","onCancel","onSave","onUseSuggestion","columns","classes","useStyles","isMobile","isMobileDetected","xs","CONTAINER_XS","getError","key","filteredSuggestions","useMemo","suggestionsToUse","OD_ID_DEP_LIST","outer_diameter","filter","item","parseFloat","_jsxs","Grid","container","spacing","className","editorContainer","children","_jsx","editorComponentSize","ComponentIcon","eidtorContentContainer","SharedEditorElements","isCasing","length","Suggestions","data","allData","OD_ID_DEP_COLUMNS","displayKeys","descriptionKeys","onSelect","InputText","type","label","value","name","onChangeField","number_of_joints","unit","component_length","weight","disabled","SelectField","options","COMPONENT_GRADES","grade","outer_diameter_tooljoint","inner_diameter_tooljoint","length_tooljoint","connection_type","COMPONENT_CLASSES","class","COMPONENT_MATERIALS","material","eidtorActionGroup","CancelButton","handleCancel","SaveButton","handleSave","isEmpty","propTypes","PropTypes","shape","number","string","isRequired","func","memo"],"mappings":"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"}
1
+ {"version":3,"file":"Editor.js","sources":["../../../../../../src/components/Casing/CasingTableV2/components/DrillPipe/Editor.js"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport { isEmpty } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { Grid } from '@material-ui/core';\n\nimport { CONTAINER_XS, OD_ID_DEP_COLUMNS } from '../constants';\n\nimport { isMobileDetected } from '~/utils/mobileDetect';\nimport { CasingComponentIcon as ComponentIcon } from '~/components';\nimport {\n COMPONENT_GRADES,\n COMPONENT_CLASSES,\n COMPONENT_MATERIALS,\n OD_ID_DEP_LIST,\n} from '~/constants/casing';\nimport {\n InputText,\n SelectField,\n CancelButton,\n SaveButton,\n SharedEditorElements,\n} from '~/components/Drillstring/BHAComponentsTable/components/shared';\nimport { Suggestions } from '~/components/Drillstring/BHAComponentsTable/components/Suggestions';\nimport { useStyles } from '~/components/Drillstring/BHAComponentsTable/components/sharedStyles';\n\nfunction DrillPipe({\n component,\n error = null,\n onChange,\n onCancel,\n onSave,\n onUseSuggestion,\n columns,\n}) {\n const classes = useStyles({ isMobile: isMobileDetected });\n const xs = isMobileDetected ? CONTAINER_XS / 2 : CONTAINER_XS / columns;\n\n const getError = key => error && error[key];\n\n const filteredSuggestions = useMemo(() => {\n const suggestionsToUse = OD_ID_DEP_LIST;\n return !component.outer_diameter\n ? []\n : suggestionsToUse.filter(\n item => item.outer_diameter === parseFloat(component.outer_diameter)\n );\n }, [component.outer_diameter]);\n\n return (\n <Grid container spacing={0} className={classes.editorContainer}>\n {!isMobileDetected && (\n <Grid item className={classes.editorComponentSize}>\n <ComponentIcon component={component} />\n </Grid>\n )}\n <Grid item className={classes.eidtorContentContainer}>\n <Grid container spacing={2}>\n <SharedEditorElements\n component={component}\n getError={getError}\n onChange={onChange}\n isCasing\n />\n\n {filteredSuggestions.length > 0 && (\n <Suggestions\n data={filteredSuggestions}\n allData={OD_ID_DEP_LIST}\n columns={OD_ID_DEP_COLUMNS}\n displayKeys={['outer_diameter', 'inner_diameter']}\n descriptionKeys={[\n 'outer_diameter',\n 'inner_diameter',\n 'linear_weight',\n 'number_of_joints',\n 'component_length',\n ]}\n onSelect={onUseSuggestion}\n isCasing\n />\n )}\n\n <InputText\n type=\"name\"\n label=\"Name\"\n value={component.name}\n error={getError('name')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"number_of_joints\"\n label=\"# of Joints\"\n value={component.number_of_joints}\n error={getError('number_of_joints')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"component_length\"\n label=\"Component Length\"\n unit=\"length\"\n value={component.component_length}\n error={getError('component_length')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"weight\"\n label=\"T.Weight\"\n unit=\"mass\"\n value={component.weight}\n error={getError('weight')}\n disabled\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"grade\"\n options={COMPONENT_GRADES}\n label=\"Grade\"\n value={component.grade}\n error={getError('grade')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"outer_diameter_tooljoint\"\n label=\"TJ OD\"\n unit=\"shortLength\"\n value={component.outer_diameter_tooljoint}\n error={getError('outer_diameter_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"inner_diameter_tooljoint\"\n label=\"TJ ID\"\n unit=\"shortLength\"\n value={component.inner_diameter_tooljoint}\n error={getError('inner_diameter_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"length_tooljoint\"\n label=\"TJ Length Per Joint\"\n unit=\"length\"\n value={component.length_tooljoint}\n error={getError('length_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"connection_type\"\n label=\"Connection Type\"\n value={component.connection_type}\n error={getError('connection_type')}\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"class\"\n options={COMPONENT_CLASSES}\n label=\"Class\"\n value={component.class}\n error={getError('class')}\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"material\"\n options={COMPONENT_MATERIALS}\n label=\"Material\"\n value={component.material}\n error={getError('material')}\n xs={xs}\n onChangeField={onChange}\n />\n </Grid>\n </Grid>\n {!isMobileDetected && (\n <Grid item className={classes.eidtorActionGroup}>\n <CancelButton handleCancel={onCancel} />\n <SaveButton handleSave={onSave} disabled={!isEmpty(error)} />\n </Grid>\n )}\n </Grid>\n );\n}\n\nDrillPipe.propTypes = {\n component: PropTypes.shape({\n outer_diameter: PropTypes.number,\n component_length: PropTypes.number,\n name: PropTypes.string,\n number_of_joints: PropTypes.number,\n weight: PropTypes.number,\n connection_type: PropTypes.string,\n grade: PropTypes.string,\n class: PropTypes.string,\n material: PropTypes.string,\n outer_diameter_tooljoint: PropTypes.number,\n inner_diameter_tooljoint: PropTypes.number,\n length_tooljoint: PropTypes.number,\n }).isRequired,\n error: PropTypes.shape({}),\n onChange: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n onUseSuggestion: PropTypes.func.isRequired,\n columns: PropTypes.number.isRequired,\n};\n\nexport default memo(DrillPipe);\n"],"names":["DrillPipe","_ref","component","_ref$error","error","onChange","onCancel","onSave","onUseSuggestion","columns","classes","useStyles","isMobile","isMobileDetected","xs","CONTAINER_XS","getError","key","filteredSuggestions","useMemo","suggestionsToUse","OD_ID_DEP_LIST","outer_diameter","filter","item","parseFloat","_jsxs","Grid","container","spacing","className","editorContainer","children","_jsx","editorComponentSize","ComponentIcon","eidtorContentContainer","SharedEditorElements","isCasing","length","Suggestions","data","allData","OD_ID_DEP_COLUMNS","displayKeys","descriptionKeys","onSelect","InputText","type","label","value","name","onChangeField","number_of_joints","unit","component_length","weight","disabled","SelectField","options","COMPONENT_GRADES","grade","outer_diameter_tooljoint","inner_diameter_tooljoint","length_tooljoint","connection_type","COMPONENT_CLASSES","class","COMPONENT_MATERIALS","material","eidtorActionGroup","CancelButton","handleCancel","SaveButton","handleSave","isEmpty","propTypes","PropTypes","shape","number","string","isRequired","func","memo"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommentComposer.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAMV,MAAM,OAAO,CAAC;AAef,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAEL,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,mBAAmB,CAAC;IAEjC,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sFAAsF;IACtF,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IAClD,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mFAAmF;IACnF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,SAAS,CAAC;IACpE,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAyBF,eAAO,MAAM,eAAe,8VA0BzB,oBAAoB,4CAoLtB,CAAC"}
1
+ {"version":3,"file":"CommentComposer.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0C,MAAM,OAAO,CAAC;AAW1E,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAEL,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,mBAAmB,CAAC;IAEjC,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sFAAsF;IACtF,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IAClD,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mFAAmF;IACnF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,SAAS,CAAC;IACpE,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,eAAe,8VA0BzB,oBAAoB,4CAqJtB,CAAC"}
@@ -1,2 +1,2 @@
1
- import o from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/helpers/slicedToArray";import{useMemo as n,useCallback as t,useState as i,useRef as c,useEffect as e}from"react";import{Input as r}from"@material-ui/core";import m from"@material-ui/icons/AlternateEmail";import{ButtonIcon as a}from"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as l}from"../../componentsV2/Tooltip/Tooltip.js";import{SmilingFaceIcon as p}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/InfoRounded.js";import"../../icons/customIcons/icons/FlameFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/PinOne.js";import"../../icons/customIcons/icons/PinOneCrossed.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{AvatarComponent as u}from"../Avatar/index.js";import{AttachFileButton as d}from"../AttachFileButton/AttachFileButton.js";import{CommentInput as j}from"../CommentInputNext/CommentInputNext.js";import h from"../EmojiIconButton.js";import I from"../FailedFileUploading.js";import b from"../UserMention/index.js";import{isSuggestionsListOpened as f}from"../UserMention/utils/index.js";import{WellhubFilePicker as g}from"../WellhubFilePicker/WellhubFilePicker.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../clients/jsonApi/index.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"../../clients/api/rateLimiter.js";import"uuid";import{useAttachmentUpload as v,DEFAULT_MAX_ATTACHMENTS as C}from"./useAttachmentUpload.js";import{CommentMetaLine as y}from"./CommentMetaLine.js";import{ShareToChatRow as F}from"./ShareToChatRow.js";import O from"./CommentComposer.scss.js";import{jsxs as A,Fragment as S,jsx as P}from"react/jsx-runtime";function x(o,s){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);s&&(t=t.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),n.push.apply(n,t)}return n}function k(s){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?x(Object(t),!0).forEach((function(n){o(s,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):x(Object(t)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(t,o))}))}return s}var E={fontSize:14,lineHeight:"20px",suggestions:{backgroundColor:"var(--palette-background-b-9)",list:{backgroundColor:"var(--palette-background-b-9)"},item:{color:"var(--palette-primary-text-1)","&focused":{backgroundColor:"rgb(from var(--palette-primary-text-1) r g b / 0.08)"}}}},w=function(o){return A("div",{className:O.suggestion,children:[P(u,{size:26,alt:o.display,imgSrc:o.photo,displayName:o.display}),P("span",{children:o.display})]})},D=function(o){var u=o.body,x=o.onBodyChange,D=o.onSubmit,R=o.canSubmit,M=o.currentUser,U=o.attachments,N=o.onAttachmentsChange,B=o.maxAttachments,L=void 0===B?C:B,T=o.attachment,z=o.onAttachmentChange,W=o.attachmentError,G=o.onAttachmentError,q=o.maxAttachmentSizeBytes,K=o.wellhubContext,H=o.disabled,V=o.autoFocus,Q=o.placeholder,Z=void 0===Q?"Add a comment...":Q,$=o.metaRows,J=o.isMetaSingleLine,X=o.shareToChat,Y=o.trailing,_=o.renderTrailing,oo=o.embedded,so=o.className,no=o.testId,to=!!N,io=n((function(){return to?null!=U?U:[]:[T].filter(Boolean)}),[to,U,T]),co=t((function(o){var s;N?N(o):null==z||z(null!==(s=o[0])&&void 0!==s?s:null)}),[N,z]),eo=v({value:io,onChange:co,onError:G,maxSizeBytes:q,maxFiles:to?L:1}),ro=R&&!eo.isUploading,mo=function(){ro&&!H&&D()},ao=i(!1),lo=s(ao,2),po=lo[0],uo=lo[1],jo=n((function(){return io.map((function(o){return o.name}))}),[io]),ho=c(null);e((function(){var o=ho.current;V&&o&&o.setSelectionRange(o.value.length,o.value.length)}),[V]);return A(S,{children:[P(j,{value:u,canSubmit:ro,disabled:H,onSubmit:D,trailing:_?_({canSend:ro&&!H,submit:mo}):Y,embedded:oo,className:so,testId:no,field:P(r,{inputComponent:b,inputProps:{onChange:x,currentUser:M,allowEmptyQuery:!0,suggestionsPortalHost:document.querySelector("body"),withLightTheme:!1,mentionProps:{renderSuggestion:w},highlightLinks:!0,style:E},value:u,placeholder:Z,inputRef:ho,className:O.mentionField,onKeyDown:function(o){"Enter"!==o.key||o.shiftKey||ro&&!H&&(f()||(o.preventDefault(),mo()))},disableUnderline:!0,rows:1,fullWidth:!0,multiline:!0,autoFocus:V}),attachments:eo.items,onAttachmentRemove:eo.removeAttachment,onAttachmentRetry:eo.handleRetry,onAttachmentReorder:to?eo.reorderAttachments:void 0,onFilesDrop:eo.addFiles,onImageLinkPaste:eo.addLinkedImage,dropLabel:1===eo.maxFiles?"Drop a file here":"Drop files here",attachmentSlot:W?P(I,{errorMessage:W}):void 0,toolbar:A(S,{children:[P(d,{inputRef:eo.fileInputRef,onClick:eo.openFileDialog,onFileSelect:eo.handleFileSelect,onWellhubSelect:K?function(){return uo(!0)}:void 0,multiple:to,disabled:eo.isFull,tooltip:eo.isFull?"Up to ".concat(eo.maxFiles," ").concat(1===eo.maxFiles?"file":"files"," can be attached"):"Attach ".concat(to?"files":"file")}),P(l,{title:"Mention someone",children:P(a,{size:"xs",type:"tertiary",onClick:function(){var o,s=ho.current;if(s){s.focus();var n=!!s.value&&!/\s$/.test(s.value),t="".concat(s.value).concat(n?" @":"@"),i=null===(o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),"value"))||void 0===o?void 0:o.set;null==i||i.call(s,t),s.setSelectionRange(t.length,t.length),s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("keyup",{bubbles:!0}))}},children:P(m,{fontSize:"inherit"})})}),P("span",{className:O.iconSlot,children:P(h,{icon:P(p,{size:16}),handleSelectEmoji:function(o){return x("".concat(u).concat(o.native))}})})]}),footer:(!(null==$||!$.length)||!!X)&&A(S,{children:[P(y,{rows:null!=$?$:[],singleLine:J}),X&&P(F,k({},X))]})}),K&&P(g,k(k({},K),{},{open:po,maxSelectable:eo.maxFiles-eo.count,attachedFileNames:jo,onAdd:function(o){uo(!1),eo.addStoredFiles(o.map((function(o){return{fileName:o.fileName}})))},onClose:function(){return uo(!1)}}))]})};export{D as CommentComposer};
1
+ import o from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/helpers/slicedToArray";import{useMemo as n,useCallback as t,useState as i,useRef as c}from"react";import e from"@material-ui/icons/AlternateEmail";import{ButtonIcon as r}from"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as m}from"../../componentsV2/Tooltip/Tooltip.js";import{SmilingFaceIcon as a}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/InfoRounded.js";import"../../icons/customIcons/icons/FlameFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/PinOne.js";import"../../icons/customIcons/icons/PinOneCrossed.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{AttachFileButton as l}from"../AttachFileButton/AttachFileButton.js";import{CommentInput as p}from"../CommentInputNext/CommentInputNext.js";import u from"../EmojiIconButton.js";import j from"../FailedFileUploading.js";import{WellhubFilePicker as d}from"../WellhubFilePicker/WellhubFilePicker.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../clients/jsonApi/index.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"../../clients/api/rateLimiter.js";import"uuid";import{useAttachmentUpload as I,DEFAULT_MAX_ATTACHMENTS as h}from"./useAttachmentUpload.js";import{CommentMentionField as b}from"./CommentMentionField.js";import{CommentMetaLine as f}from"./CommentMetaLine.js";import{ShareToChatRow as C}from"./ShareToChatRow.js";import F from"./CommentComposer.scss.js";import{jsxs as v,Fragment as g,jsx as O}from"react/jsx-runtime";function y(o,s){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);s&&(t=t.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),n.push.apply(n,t)}return n}function A(s){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?y(Object(t),!0).forEach((function(n){o(s,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(t,o))}))}return s}var S=function(o){var y=o.body,S=o.onBodyChange,P=o.onSubmit,x=o.canSubmit,E=o.currentUser,R=o.attachments,k=o.onAttachmentsChange,D=o.maxAttachments,w=void 0===D?h:D,M=o.attachment,B=o.onAttachmentChange,T=o.attachmentError,U=o.onAttachmentError,L=o.maxAttachmentSizeBytes,N=o.wellhubContext,z=o.disabled,G=o.autoFocus,W=o.placeholder,q=void 0===W?"Add a comment...":W,V=o.metaRows,K=o.isMetaSingleLine,Z=o.shareToChat,$=o.trailing,H=o.renderTrailing,J=o.embedded,Q=o.className,X=o.testId,Y=!!k,_=n((function(){return Y?null!=R?R:[]:[M].filter(Boolean)}),[Y,R,M]),oo=t((function(o){var s;k?k(o):null==B||B(null!==(s=o[0])&&void 0!==s?s:null)}),[k,B]),so=I({value:_,onChange:oo,onError:U,maxSizeBytes:L,maxFiles:Y?w:1}),no=x&&!so.isUploading,to=function(){no&&!z&&P()},io=i(!1),co=s(io,2),eo=co[0],ro=co[1],mo=n((function(){return _.map((function(o){return o.name}))}),[_]),ao=c(null);return v(g,{children:[O(p,{value:y,canSubmit:no,disabled:z,onSubmit:P,trailing:H?H({canSend:no&&!z,submit:to}):$,embedded:J,className:Q,testId:X,field:O(b,{value:y,onChange:S,onEnter:to,placeholder:q,autoFocus:G,disabled:z,currentUser:E,inputRef:ao}),attachments:so.items,onAttachmentRemove:so.removeAttachment,onAttachmentRetry:so.handleRetry,onAttachmentReorder:Y?so.reorderAttachments:void 0,onFilesDrop:so.addFiles,onImageLinkPaste:so.addLinkedImage,dropLabel:1===so.maxFiles?"Drop a file here":"Drop files here",attachmentSlot:T?O(j,{errorMessage:T}):void 0,toolbar:v(g,{children:[O(l,{inputRef:so.fileInputRef,onClick:so.openFileDialog,onFileSelect:so.handleFileSelect,onWellhubSelect:N?function(){return ro(!0)}:void 0,multiple:Y,disabled:so.isFull,tooltip:so.isFull?"Up to ".concat(so.maxFiles," ").concat(1===so.maxFiles?"file":"files"," can be attached"):"Attach ".concat(Y?"files":"file")}),O(m,{title:"Mention someone",children:O(r,{size:"xs",type:"tertiary",onClick:function(){var o,s=ao.current;if(s){s.focus();var n=!!s.value&&!/\s$/.test(s.value),t="".concat(s.value).concat(n?" @":"@"),i=null===(o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),"value"))||void 0===o?void 0:o.set;null==i||i.call(s,t),s.setSelectionRange(t.length,t.length),s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("keyup",{bubbles:!0}))}},children:O(e,{fontSize:"inherit"})})}),O("span",{className:F.iconSlot,children:O(u,{icon:O(a,{size:16}),handleSelectEmoji:function(o){return S("".concat(y).concat(o.native))}})})]}),footer:(!(null==V||!V.length)||!!Z)&&v(g,{children:[O(f,{rows:null!=V?V:[],singleLine:K}),Z&&O(C,A({},Z))]})}),N&&O(d,A(A({},N),{},{open:eo,maxSelectable:so.maxFiles-so.count,attachedFileNames:mo,onAdd:function(o){ro(!1),so.addStoredFiles(o.map((function(o){return{fileName:o.fileName}})))},onClose:function(){return ro(!1)}}))]})};export{S as CommentComposer};
2
2
  //# sourceMappingURL=CommentComposer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommentComposer.js","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"sourcesContent":["import {\n CSSProperties,\n FormEventHandler,\n KeyboardEvent,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Input } from '@material-ui/core';\nimport AlternateEmailIcon from '@material-ui/icons/AlternateEmail';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { SmilingFaceIcon } from '../../icons';\nimport Avatar from '../Avatar';\nimport { AttachFileButton } from '../AttachFileButton';\nimport { CommentInput } from '../CommentInputNext/CommentInputNext';\nimport EmojiIconButton from '../EmojiIconButton';\nimport FailedFileUploading from '../FailedFileUploading';\nimport UserMention from '../UserMention';\nimport { isSuggestionsListOpened } from '../UserMention/utils';\nimport { WellhubFilePicker } from '../WellhubFilePicker';\nimport type { WellhubContext, WellhubFile } from '../WellhubFilePicker';\n\nimport {\n useAttachmentUpload,\n UploadedAttachment,\n DEFAULT_MAX_ATTACHMENTS,\n} from './useAttachmentUpload';\nimport { CommentMetaLine, CommentMetaRow } from './CommentMetaLine';\nimport { ShareToChatRow, ShareToChatRowProps } from './ShareToChatRow';\n\nimport styles from './CommentComposer.scss';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case user payload. */\nexport type CommentComposerUser = {\n id?: number;\n company_id?: number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n [key: string]: unknown;\n};\n/* eslint-enable camelcase */\n\nexport type CommentComposerTrailingState = {\n canSend: boolean;\n submit: () => void;\n};\n\nexport type CommentComposerProps = {\n body: string;\n onBodyChange: (value: string) => void;\n onSubmit: () => void;\n canSubmit: boolean;\n currentUser: CommentComposerUser;\n\n attachments?: UploadedAttachment[];\n onAttachmentsChange?: (attachments: UploadedAttachment[]) => void;\n maxAttachments?: number;\n /** @deprecated Use `attachments` — kept so single-attachment callers keep working. */\n attachment?: UploadedAttachment | null;\n /** @deprecated Use `onAttachmentsChange`. */\n onAttachmentChange?: (attachment: UploadedAttachment | null) => void;\n attachmentError?: string | null;\n onAttachmentError?: (message: string | null) => void;\n maxAttachmentSizeBytes?: number;\n wellhubContext?: WellhubContext;\n\n disabled?: boolean;\n autoFocus?: boolean;\n placeholder?: string;\n metaRows?: CommentMetaRow[];\n isMetaSingleLine?: boolean;\n shareToChat?: Omit<ShareToChatRowProps, 'testId'>;\n /** Replaces the default send button, e.g. the edit form's Cancel/Save. */\n trailing?: ReactNode;\n /** Like `trailing`, but receives the upload-aware send state for a custom Save. */\n renderTrailing?: (state: CommentComposerTrailingState) => ReactNode;\n /** Render flush inside a host card instead of as its own surface. */\n embedded?: boolean;\n className?: string;\n testId?: string;\n};\n\nconst SUGGESTIONS_BACKGROUND = 'var(--palette-background-b-9)';\n\n// Module-level so react-mentions isn't re-rendered on every keystroke.\nconst MENTION_INPUT_STYLE = {\n fontSize: 14,\n lineHeight: '20px',\n suggestions: {\n backgroundColor: SUGGESTIONS_BACKGROUND,\n list: { backgroundColor: SUGGESTIONS_BACKGROUND },\n item: {\n color: 'var(--palette-primary-text-1)',\n '&focused': { backgroundColor: 'rgb(from var(--palette-primary-text-1) r g b / 0.08)' },\n },\n },\n} as unknown as CSSProperties;\n\nconst renderSuggestion = (entry: { display: string; photo?: string }) => (\n <div className={styles.suggestion}>\n <Avatar size={26} alt={entry.display} imgSrc={entry.photo} displayName={entry.display} />\n <span>{entry.display}</span>\n </div>\n);\n\nexport const CommentComposer = ({\n body,\n onBodyChange,\n onSubmit,\n canSubmit,\n currentUser,\n attachments,\n onAttachmentsChange,\n maxAttachments = DEFAULT_MAX_ATTACHMENTS,\n attachment,\n onAttachmentChange,\n attachmentError,\n onAttachmentError,\n maxAttachmentSizeBytes,\n wellhubContext,\n disabled,\n autoFocus,\n placeholder = 'Add a comment...',\n metaRows,\n isMetaSingleLine,\n shareToChat,\n trailing,\n renderTrailing,\n embedded,\n className,\n testId,\n}: CommentComposerProps) => {\n // Callers still on the singular props get the old one-file behaviour, unchanged.\n const isMulti = !!onAttachmentsChange;\n const value = useMemo(\n () => (isMulti ? attachments ?? [] : ([attachment].filter(Boolean) as UploadedAttachment[])),\n [isMulti, attachments, attachment]\n );\n\n const handleAttachmentsChange = useCallback(\n (next: UploadedAttachment[]) => {\n if (onAttachmentsChange) onAttachmentsChange(next);\n else onAttachmentChange?.(next[0] ?? null);\n },\n [onAttachmentsChange, onAttachmentChange]\n );\n\n const upload = useAttachmentUpload({\n value,\n onChange: handleAttachmentsChange,\n onError: onAttachmentError,\n maxSizeBytes: maxAttachmentSizeBytes,\n maxFiles: isMulti ? maxAttachments : 1,\n });\n\n // An attachment only lands once S3 confirms, so posting mid-upload would drop it.\n const canSend = canSubmit && !upload.isUploading;\n\n const submit = () => {\n if (!canSend || disabled) return;\n\n onSubmit();\n };\n\n const [isWellhubOpen, setIsWellhubOpen] = useState(false);\n const attachedKeys = useMemo(() => value.map(item => item.name), [value]);\n\n const addWellhubFiles = (files: WellhubFile[]) => {\n setIsWellhubOpen(false);\n upload.addStoredFiles(files.map(file => ({ fileName: file.fileName })));\n };\n\n const fieldRef = useRef<HTMLTextAreaElement | null>(null);\n\n // An autofocused edit form lands the caret at the start; editing usually continues from the end.\n useEffect(() => {\n const field = fieldRef.current;\n if (!autoFocus || !field) return;\n\n field.setSelectionRange(field.value.length, field.value.length);\n }, [autoFocus]);\n\n // react-mentions opens suggestions from textarea events, so type \"@\" instead of setting state.\n const mentionSomeone = () => {\n const field = fieldRef.current;\n if (!field) return;\n\n field.focus();\n\n const needsSpace = !!field.value && !/\\s$/.test(field.value);\n const nextValue = `${field.value}${needsSpace ? ' @' : '@'}`;\n const setValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(field), 'value')?.set;\n\n setValue?.call(field, nextValue);\n field.setSelectionRange(nextValue.length, nextValue.length);\n field.dispatchEvent(new Event('input', { bubbles: true }));\n field.dispatchEvent(new Event('keyup', { bubbles: true }));\n };\n\n const handleEnterKey = (event: KeyboardEvent) => {\n if (event.key !== 'Enter' || event.shiftKey) return;\n if (!canSend || disabled) return;\n if (isSuggestionsListOpened()) return;\n\n event.preventDefault();\n submit();\n };\n\n return (\n <>\n <CommentInput\n value={body}\n canSubmit={canSend}\n disabled={disabled}\n onSubmit={onSubmit}\n trailing={\n renderTrailing ? renderTrailing({ canSend: canSend && !disabled, submit }) : trailing\n }\n embedded={embedded}\n className={className}\n testId={testId}\n field={\n <Input\n inputComponent={UserMention}\n inputProps={{\n // UserMention calls onChange with the text string, not a DOM event.\n onChange: onBodyChange as unknown as FormEventHandler<HTMLInputElement>,\n currentUser,\n allowEmptyQuery: true,\n suggestionsPortalHost: document.querySelector('body'),\n withLightTheme: false,\n mentionProps: { renderSuggestion },\n highlightLinks: true,\n style: MENTION_INPUT_STYLE,\n }}\n value={body}\n placeholder={placeholder}\n inputRef={fieldRef}\n className={styles.mentionField}\n onKeyDown={handleEnterKey}\n disableUnderline\n rows={1}\n fullWidth\n multiline\n autoFocus={autoFocus}\n />\n }\n attachments={upload.items}\n onAttachmentRemove={upload.removeAttachment}\n onAttachmentRetry={upload.handleRetry}\n onAttachmentReorder={isMulti ? upload.reorderAttachments : undefined}\n onFilesDrop={upload.addFiles}\n onImageLinkPaste={upload.addLinkedImage}\n dropLabel={upload.maxFiles === 1 ? 'Drop a file here' : 'Drop files here'}\n attachmentSlot={\n attachmentError ? <FailedFileUploading errorMessage={attachmentError} /> : undefined\n }\n toolbar={\n <>\n <AttachFileButton\n inputRef={upload.fileInputRef}\n onClick={upload.openFileDialog}\n onFileSelect={upload.handleFileSelect}\n onWellhubSelect={wellhubContext ? () => setIsWellhubOpen(true) : undefined}\n multiple={isMulti}\n disabled={upload.isFull}\n tooltip={\n upload.isFull\n ? `Up to ${upload.maxFiles} ${\n upload.maxFiles === 1 ? 'file' : 'files'\n } can be attached`\n : `Attach ${isMulti ? 'files' : 'file'}`\n }\n />\n <Tooltip title=\"Mention someone\">\n <ButtonIcon size=\"xs\" type=\"tertiary\" onClick={mentionSomeone}>\n <AlternateEmailIcon fontSize=\"inherit\" />\n </ButtonIcon>\n </Tooltip>\n <span className={styles.iconSlot}>\n <EmojiIconButton\n icon={<SmilingFaceIcon size={16} />}\n handleSelectEmoji={(emoji: { native: string }) =>\n onBodyChange(`${body}${emoji.native}`)\n }\n />\n </span>\n </>\n }\n footer={\n (!!metaRows?.length || !!shareToChat) && (\n <>\n <CommentMetaLine rows={metaRows ?? []} singleLine={isMetaSingleLine} />\n {shareToChat && <ShareToChatRow {...shareToChat} />}\n </>\n )\n }\n />\n\n {wellhubContext && (\n <WellhubFilePicker\n {...wellhubContext}\n open={isWellhubOpen}\n maxSelectable={upload.maxFiles - upload.count}\n attachedFileNames={attachedKeys}\n onAdd={addWellhubFiles}\n onClose={() => setIsWellhubOpen(false)}\n />\n )}\n </>\n );\n};\n"],"names":["MENTION_INPUT_STYLE","fontSize","lineHeight","suggestions","backgroundColor","list","item","color","renderSuggestion","entry","_jsxs","className","styles","suggestion","children","_jsx","Avatar","size","alt","display","imgSrc","photo","displayName","CommentComposer","_ref","body","onBodyChange","onSubmit","canSubmit","currentUser","attachments","onAttachmentsChange","_ref$maxAttachments","maxAttachments","DEFAULT_MAX_ATTACHMENTS","attachment","onAttachmentChange","attachmentError","onAttachmentError","maxAttachmentSizeBytes","wellhubContext","disabled","autoFocus","_ref$placeholder","placeholder","metaRows","isMetaSingleLine","shareToChat","trailing","renderTrailing","embedded","testId","isMulti","value","useMemo","filter","Boolean","handleAttachmentsChange","useCallback","next","_next$","upload","useAttachmentUpload","onChange","onError","maxSizeBytes","maxFiles","canSend","isUploading","submit","useState","_useState2","_slicedToArray","_useState","isWellhubOpen","setIsWellhubOpen","attachedKeys","map","name","fieldRef","useRef","useEffect","field","current","setSelectionRange","length","_Fragment","CommentInput","Input","inputComponent","UserMention","inputProps","allowEmptyQuery","suggestionsPortalHost","document","querySelector","withLightTheme","mentionProps","highlightLinks","style","inputRef","mentionField","onKeyDown","event","key","shiftKey","isSuggestionsListOpened","preventDefault","disableUnderline","rows","fullWidth","multiline","items","onAttachmentRemove","removeAttachment","onAttachmentRetry","handleRetry","onAttachmentReorder","reorderAttachments","undefined","onFilesDrop","addFiles","onImageLinkPaste","addLinkedImage","dropLabel","attachmentSlot","FailedFileUploading","errorMessage","toolbar","AttachFileButton","fileInputRef","onClick","openFileDialog","onFileSelect","handleFileSelect","onWellhubSelect","multiple","isFull","tooltip","concat","Tooltip","title","ButtonIcon","type","_Object$getOwnPropert","focus","needsSpace","test","nextValue","setValue","Object","getOwnPropertyDescriptor","getPrototypeOf","set","call","dispatchEvent","Event","bubbles","AlternateEmailIcon","iconSlot","EmojiIconButton","icon","SmilingFaceIcon","handleSelectEmoji","emoji","native","footer","CommentMetaLine","singleLine","ShareToChatRow","_objectSpread","WellhubFilePicker","open","maxSelectable","count","attachedFileNames","onAdd","files","addStoredFiles","file","fileName","onClose"],"mappings":"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"}
1
+ {"version":3,"file":"CommentComposer.js","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"sourcesContent":["import { ReactNode, useCallback, useMemo, useRef, useState } from 'react';\nimport AlternateEmailIcon from '@material-ui/icons/AlternateEmail';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { SmilingFaceIcon } from '../../icons';\nimport { AttachFileButton } from '../AttachFileButton';\nimport { CommentInput } from '../CommentInputNext/CommentInputNext';\nimport EmojiIconButton from '../EmojiIconButton';\nimport FailedFileUploading from '../FailedFileUploading';\nimport { WellhubFilePicker } from '../WellhubFilePicker';\nimport type { WellhubContext, WellhubFile } from '../WellhubFilePicker';\n\nimport {\n useAttachmentUpload,\n UploadedAttachment,\n DEFAULT_MAX_ATTACHMENTS,\n} from './useAttachmentUpload';\nimport { CommentMentionField } from './CommentMentionField';\nimport { CommentMetaLine, CommentMetaRow } from './CommentMetaLine';\nimport { ShareToChatRow, ShareToChatRowProps } from './ShareToChatRow';\n\nimport styles from './CommentComposer.scss';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case user payload. */\nexport type CommentComposerUser = {\n id?: number;\n company_id?: number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n [key: string]: unknown;\n};\n/* eslint-enable camelcase */\n\nexport type CommentComposerTrailingState = {\n canSend: boolean;\n submit: () => void;\n};\n\nexport type CommentComposerProps = {\n body: string;\n onBodyChange: (value: string) => void;\n onSubmit: () => void;\n canSubmit: boolean;\n currentUser: CommentComposerUser;\n\n attachments?: UploadedAttachment[];\n onAttachmentsChange?: (attachments: UploadedAttachment[]) => void;\n maxAttachments?: number;\n /** @deprecated Use `attachments` — kept so single-attachment callers keep working. */\n attachment?: UploadedAttachment | null;\n /** @deprecated Use `onAttachmentsChange`. */\n onAttachmentChange?: (attachment: UploadedAttachment | null) => void;\n attachmentError?: string | null;\n onAttachmentError?: (message: string | null) => void;\n maxAttachmentSizeBytes?: number;\n wellhubContext?: WellhubContext;\n\n disabled?: boolean;\n autoFocus?: boolean;\n placeholder?: string;\n metaRows?: CommentMetaRow[];\n isMetaSingleLine?: boolean;\n shareToChat?: Omit<ShareToChatRowProps, 'testId'>;\n /** Replaces the default send button, e.g. the edit form's Cancel/Save. */\n trailing?: ReactNode;\n /** Like `trailing`, but receives the upload-aware send state for a custom Save. */\n renderTrailing?: (state: CommentComposerTrailingState) => ReactNode;\n /** Render flush inside a host card instead of as its own surface. */\n embedded?: boolean;\n className?: string;\n testId?: string;\n};\n\nexport const CommentComposer = ({\n body,\n onBodyChange,\n onSubmit,\n canSubmit,\n currentUser,\n attachments,\n onAttachmentsChange,\n maxAttachments = DEFAULT_MAX_ATTACHMENTS,\n attachment,\n onAttachmentChange,\n attachmentError,\n onAttachmentError,\n maxAttachmentSizeBytes,\n wellhubContext,\n disabled,\n autoFocus,\n placeholder = 'Add a comment...',\n metaRows,\n isMetaSingleLine,\n shareToChat,\n trailing,\n renderTrailing,\n embedded,\n className,\n testId,\n}: CommentComposerProps) => {\n // Callers still on the singular props get the old one-file behaviour, unchanged.\n const isMulti = !!onAttachmentsChange;\n const value = useMemo(\n () => (isMulti ? attachments ?? [] : ([attachment].filter(Boolean) as UploadedAttachment[])),\n [isMulti, attachments, attachment]\n );\n\n const handleAttachmentsChange = useCallback(\n (next: UploadedAttachment[]) => {\n if (onAttachmentsChange) onAttachmentsChange(next);\n else onAttachmentChange?.(next[0] ?? null);\n },\n [onAttachmentsChange, onAttachmentChange]\n );\n\n const upload = useAttachmentUpload({\n value,\n onChange: handleAttachmentsChange,\n onError: onAttachmentError,\n maxSizeBytes: maxAttachmentSizeBytes,\n maxFiles: isMulti ? maxAttachments : 1,\n });\n\n // An attachment only lands once S3 confirms, so posting mid-upload would drop it.\n const canSend = canSubmit && !upload.isUploading;\n\n const submit = () => {\n if (!canSend || disabled) return;\n\n onSubmit();\n };\n\n const [isWellhubOpen, setIsWellhubOpen] = useState(false);\n const attachedKeys = useMemo(() => value.map(item => item.name), [value]);\n\n const addWellhubFiles = (files: WellhubFile[]) => {\n setIsWellhubOpen(false);\n upload.addStoredFiles(files.map(file => ({ fileName: file.fileName })));\n };\n\n const fieldRef = useRef<HTMLTextAreaElement | null>(null);\n\n // react-mentions opens suggestions from textarea events, so type \"@\" instead of setting state.\n const mentionSomeone = () => {\n const field = fieldRef.current;\n if (!field) return;\n\n field.focus();\n\n const needsSpace = !!field.value && !/\\s$/.test(field.value);\n const nextValue = `${field.value}${needsSpace ? ' @' : '@'}`;\n const setValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(field), 'value')?.set;\n\n setValue?.call(field, nextValue);\n field.setSelectionRange(nextValue.length, nextValue.length);\n field.dispatchEvent(new Event('input', { bubbles: true }));\n field.dispatchEvent(new Event('keyup', { bubbles: true }));\n };\n\n return (\n <>\n <CommentInput\n value={body}\n canSubmit={canSend}\n disabled={disabled}\n onSubmit={onSubmit}\n trailing={\n renderTrailing ? renderTrailing({ canSend: canSend && !disabled, submit }) : trailing\n }\n embedded={embedded}\n className={className}\n testId={testId}\n field={\n <CommentMentionField\n value={body}\n onChange={onBodyChange}\n onEnter={submit}\n placeholder={placeholder}\n autoFocus={autoFocus}\n disabled={disabled}\n currentUser={currentUser}\n inputRef={fieldRef}\n />\n }\n attachments={upload.items}\n onAttachmentRemove={upload.removeAttachment}\n onAttachmentRetry={upload.handleRetry}\n onAttachmentReorder={isMulti ? upload.reorderAttachments : undefined}\n onFilesDrop={upload.addFiles}\n onImageLinkPaste={upload.addLinkedImage}\n dropLabel={upload.maxFiles === 1 ? 'Drop a file here' : 'Drop files here'}\n attachmentSlot={\n attachmentError ? <FailedFileUploading errorMessage={attachmentError} /> : undefined\n }\n toolbar={\n <>\n <AttachFileButton\n inputRef={upload.fileInputRef}\n onClick={upload.openFileDialog}\n onFileSelect={upload.handleFileSelect}\n onWellhubSelect={wellhubContext ? () => setIsWellhubOpen(true) : undefined}\n multiple={isMulti}\n disabled={upload.isFull}\n tooltip={\n upload.isFull\n ? `Up to ${upload.maxFiles} ${\n upload.maxFiles === 1 ? 'file' : 'files'\n } can be attached`\n : `Attach ${isMulti ? 'files' : 'file'}`\n }\n />\n <Tooltip title=\"Mention someone\">\n <ButtonIcon size=\"xs\" type=\"tertiary\" onClick={mentionSomeone}>\n <AlternateEmailIcon fontSize=\"inherit\" />\n </ButtonIcon>\n </Tooltip>\n <span className={styles.iconSlot}>\n <EmojiIconButton\n icon={<SmilingFaceIcon size={16} />}\n handleSelectEmoji={(emoji: { native: string }) =>\n onBodyChange(`${body}${emoji.native}`)\n }\n />\n </span>\n </>\n }\n footer={\n (!!metaRows?.length || !!shareToChat) && (\n <>\n <CommentMetaLine rows={metaRows ?? []} singleLine={isMetaSingleLine} />\n {shareToChat && <ShareToChatRow {...shareToChat} />}\n </>\n )\n }\n />\n\n {wellhubContext && (\n <WellhubFilePicker\n {...wellhubContext}\n open={isWellhubOpen}\n maxSelectable={upload.maxFiles - upload.count}\n attachedFileNames={attachedKeys}\n onAdd={addWellhubFiles}\n onClose={() => setIsWellhubOpen(false)}\n />\n )}\n </>\n );\n};\n"],"names":["CommentComposer","_ref","body","onBodyChange","onSubmit","canSubmit","currentUser","attachments","onAttachmentsChange","_ref$maxAttachments","maxAttachments","DEFAULT_MAX_ATTACHMENTS","attachment","onAttachmentChange","attachmentError","onAttachmentError","maxAttachmentSizeBytes","wellhubContext","disabled","autoFocus","_ref$placeholder","placeholder","metaRows","isMetaSingleLine","shareToChat","trailing","renderTrailing","embedded","className","testId","isMulti","value","useMemo","filter","Boolean","handleAttachmentsChange","useCallback","next","_next$","upload","useAttachmentUpload","onChange","onError","maxSizeBytes","maxFiles","canSend","isUploading","submit","useState","_useState2","_slicedToArray","_useState","isWellhubOpen","setIsWellhubOpen","attachedKeys","map","item","name","fieldRef","useRef","_jsxs","_Fragment","children","_jsx","CommentInput","field","CommentMentionField","onEnter","inputRef","items","onAttachmentRemove","removeAttachment","onAttachmentRetry","handleRetry","onAttachmentReorder","reorderAttachments","undefined","onFilesDrop","addFiles","onImageLinkPaste","addLinkedImage","dropLabel","attachmentSlot","FailedFileUploading","errorMessage","toolbar","AttachFileButton","fileInputRef","onClick","openFileDialog","onFileSelect","handleFileSelect","onWellhubSelect","multiple","isFull","tooltip","concat","Tooltip","title","ButtonIcon","size","type","_Object$getOwnPropert","current","focus","needsSpace","test","nextValue","setValue","Object","getOwnPropertyDescriptor","getPrototypeOf","set","call","setSelectionRange","length","dispatchEvent","Event","bubbles","AlternateEmailIcon","fontSize","styles","iconSlot","EmojiIconButton","icon","SmilingFaceIcon","handleSelectEmoji","emoji","native","footer","CommentMetaLine","rows","singleLine","ShareToChatRow","_objectSpread","WellhubFilePicker","open","maxSelectable","count","attachedFileNames","onAdd","files","addStoredFiles","file","fileName","onClose"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import o from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={spacing:"8",mentionField:"CommentComposer_mentionField__CcogW",suggestion:"CommentComposer_suggestion__q5GXD",iconSlot:"CommentComposer_iconSlot__shxGe"};o(".CommentComposer_mentionField__CcogW{color:var(--palette-primary-text-1);font-size:14px!important;line-height:20px!important;padding:0!important;width:100%}.CommentComposer_mentionField__CcogW [class*=mention__control]{height:auto!important;max-height:160px;min-height:20px}.CommentComposer_mentionField__CcogW [class*=mention__highlighter]{box-sizing:border-box;max-height:160px}.CommentComposer_mentionField__CcogW textarea{letter-spacing:normal!important;max-height:160px;overflow-y:auto!important;padding:0!important}.CommentComposer_suggestion__q5GXD{align-items:center;display:flex;gap:16px}.CommentComposer_iconSlot__shxGe{color:var(--palette-primary-text-6);display:inline-flex}.CommentComposer_iconSlot__shxGe .MuiIconButton-root{border-radius:6px;padding:4px}.CommentComposer_iconSlot__shxGe .MuiSvgIcon-root{font-size:16px}div[class*=mention__suggestions]{z-index:1500!important}");export{e as default};
1
+ import o from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={spacing:"8",iconSlot:"CommentComposer_iconSlot__shxGe"};o(".CommentComposer_iconSlot__shxGe{color:var(--palette-primary-text-6);display:inline-flex}.CommentComposer_iconSlot__shxGe .MuiIconButton-root{border-radius:6px;padding:4px}.CommentComposer_iconSlot__shxGe .MuiSvgIcon-root{font-size:16px}");export{e as default};
2
2
  //# sourceMappingURL=CommentComposer.scss.js.map
@@ -0,0 +1,18 @@
1
+ import { MutableRefObject } from 'react';
2
+ export type CommentMentionFieldProps = {
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ /** Enter without Shift, unless the mention suggestions have it. */
6
+ onEnter: () => void;
7
+ onEscape?: () => void;
8
+ placeholder?: string;
9
+ autoFocus?: boolean;
10
+ disabled?: boolean;
11
+ currentUser?: {
12
+ company_id?: number;
13
+ };
14
+ inputRef?: MutableRefObject<HTMLTextAreaElement | null>;
15
+ };
16
+ /** The comment text field with "@" user mentions, shared by the composer and replies. */
17
+ export declare const CommentMentionField: ({ value, onChange, onEnter, onEscape, placeholder, autoFocus, disabled, currentUser, inputRef, }: CommentMentionFieldProps) => import("react/jsx-runtime").JSX.Element;
18
+ //# sourceMappingURL=CommentMentionField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentMentionField.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentMentionField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,gBAAgB,EAGjB,MAAM,OAAO,CAAC;AAgCf,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,mEAAmE;IACnE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,QAAQ,CAAC,EAAE,gBAAgB,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;CACzD,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,mBAAmB,qGAU7B,wBAAwB,4CAsD1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{useRef as e,useEffect as t}from"react";import{Input as r}from"@material-ui/core";import{AvatarComponent as o}from"../Avatar/index.js";import n from"../UserMention/index.js";import{isSuggestionsListOpened as i}from"../UserMention/utils/index.js";import a from"./CommentMentionField.scss.js";import{jsx as l,jsxs as s}from"react/jsx-runtime";var u={fontSize:14,lineHeight:"20px",suggestions:{backgroundColor:"var(--palette-background-b-9)",list:{backgroundColor:"var(--palette-background-b-9)"},item:{color:"var(--palette-primary-text-1)","&focused":{backgroundColor:"rgb(from var(--palette-primary-text-1) r g b / 0.08)"}}}},p=function(e){return s("div",{className:a.suggestion,children:[l(o,{size:26,alt:e.display,imgSrc:e.photo,displayName:e.display}),l("span",{children:e.display})]})},m=function(o){var s=o.value,m=o.onChange,c=o.onEnter,d=o.onEscape,g=o.placeholder,f=o.autoFocus,h=o.disabled,v=o.currentUser,y=o.inputRef,b=e(null),k=null!=y?y:b;t((function(){var e=k.current;f&&e&&e.setSelectionRange(e.value.length,e.value.length)}),[f,k]);return l(r,{inputComponent:n,inputProps:{onChange:m,currentUser:v,allowEmptyQuery:!0,suggestionsPortalHost:document.querySelector("body"),withLightTheme:!1,mentionProps:{renderSuggestion:p},highlightLinks:!0,style:u},value:s,placeholder:g,inputRef:k,className:a.mentionField,onKeyDown:function(e){if(!i())return"Escape"===e.key&&d?(e.preventDefault(),void d()):void("Enter"!==e.key||e.shiftKey||(e.preventDefault(),c()))},disableUnderline:!0,rows:1,fullWidth:!0,multiline:!0,autoFocus:f,disabled:h})};export{m as CommentMentionField};
2
+ //# sourceMappingURL=CommentMentionField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentMentionField.js","sources":["../../../src/components/CommentComposer/CommentMentionField.tsx"],"sourcesContent":["import {\n CSSProperties,\n FormEventHandler,\n KeyboardEvent,\n MutableRefObject,\n useEffect,\n useRef,\n} from 'react';\nimport { Input } from '@material-ui/core';\n\nimport Avatar from '../Avatar';\nimport UserMention from '../UserMention';\nimport { isSuggestionsListOpened } from '../UserMention/utils';\n\nimport styles from './CommentMentionField.scss';\n\nconst SUGGESTIONS_BACKGROUND = 'var(--palette-background-b-9)';\n\n// Module-level so react-mentions isn't re-rendered on every keystroke.\nconst MENTION_INPUT_STYLE = {\n fontSize: 14,\n lineHeight: '20px',\n suggestions: {\n backgroundColor: SUGGESTIONS_BACKGROUND,\n list: { backgroundColor: SUGGESTIONS_BACKGROUND },\n item: {\n color: 'var(--palette-primary-text-1)',\n '&focused': { backgroundColor: 'rgb(from var(--palette-primary-text-1) r g b / 0.08)' },\n },\n },\n} as unknown as CSSProperties;\n\nconst renderSuggestion = (entry: { display: string; photo?: string }) => (\n <div className={styles.suggestion}>\n <Avatar size={26} alt={entry.display} imgSrc={entry.photo} displayName={entry.display} />\n <span>{entry.display}</span>\n </div>\n);\n\nexport type CommentMentionFieldProps = {\n value: string;\n onChange: (value: string) => void;\n /** Enter without Shift, unless the mention suggestions have it. */\n onEnter: () => void;\n onEscape?: () => void;\n placeholder?: string;\n autoFocus?: boolean;\n disabled?: boolean;\n currentUser?: { company_id?: number };\n inputRef?: MutableRefObject<HTMLTextAreaElement | null>;\n};\n\n/** The comment text field with \"@\" user mentions, shared by the composer and replies. */\nexport const CommentMentionField = ({\n value,\n onChange,\n onEnter,\n onEscape,\n placeholder,\n autoFocus,\n disabled,\n currentUser,\n inputRef,\n}: CommentMentionFieldProps) => {\n const ownRef = useRef<HTMLTextAreaElement | null>(null);\n const fieldRef = inputRef ?? ownRef;\n\n // An autofocused edit form lands the caret at the start; editing usually continues from the end.\n useEffect(() => {\n const field = fieldRef.current;\n if (!autoFocus || !field) return;\n\n field.setSelectionRange(field.value.length, field.value.length);\n }, [autoFocus, fieldRef]);\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (isSuggestionsListOpened()) return;\n\n if (event.key === 'Escape' && onEscape) {\n event.preventDefault();\n onEscape();\n return;\n }\n\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n onEnter();\n }\n };\n\n return (\n <Input\n inputComponent={UserMention}\n inputProps={{\n // UserMention calls onChange with the text string, not a DOM event.\n onChange: onChange as unknown as FormEventHandler<HTMLInputElement>,\n currentUser,\n allowEmptyQuery: true,\n suggestionsPortalHost: document.querySelector('body'),\n withLightTheme: false,\n mentionProps: { renderSuggestion },\n highlightLinks: true,\n style: MENTION_INPUT_STYLE,\n }}\n value={value}\n placeholder={placeholder}\n inputRef={fieldRef}\n className={styles.mentionField}\n onKeyDown={handleKeyDown}\n disableUnderline\n rows={1}\n fullWidth\n multiline\n autoFocus={autoFocus}\n disabled={disabled}\n />\n );\n};\n"],"names":["MENTION_INPUT_STYLE","fontSize","lineHeight","suggestions","backgroundColor","list","item","color","renderSuggestion","entry","_jsxs","className","styles","suggestion","children","_jsx","Avatar","size","alt","display","imgSrc","photo","displayName","CommentMentionField","_ref","value","onChange","onEnter","onEscape","placeholder","autoFocus","disabled","currentUser","inputRef","ownRef","useRef","fieldRef","useEffect","field","current","setSelectionRange","length","Input","inputComponent","UserMention","inputProps","allowEmptyQuery","suggestionsPortalHost","document","querySelector","withLightTheme","mentionProps","highlightLinks","style","mentionField","onKeyDown","event","isSuggestionsListOpened","key","preventDefault","shiftKey","disableUnderline","rows","fullWidth","multiline"],"mappings":"2VAgBA,IAGMA,EAAsB,CAC1BC,SAAU,GACVC,WAAY,OACZC,YAAa,CACXC,gBAP2B,gCAQ3BC,KAAM,CAAED,gBARmB,iCAS3BE,KAAM,CACJC,MAAO,gCACP,WAAY,CAAEH,gBAAiB,2DAK/BI,EAAmB,SAACC,GAA0C,OAClEC,EAAA,MAAA,CAAKC,UAAWC,EAAOC,WAAWC,SAAA,CAChCC,EAACC,EAAM,CAACC,KAAM,GAAIC,IAAKT,EAAMU,QAASC,OAAQX,EAAMY,MAAOC,YAAab,EAAMU,UAC9EJ,EAAA,OAAA,CAAAD,SAAOL,EAAMU,YACT,EAiBKI,EAAsB,SAUHC,GAAA,IAT9BC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,QACAC,IAAAA,SACAC,IAAAA,YACAC,IAAAA,UACAC,IAAAA,SACAC,IAAAA,YACAC,IAAAA,SAEMC,EAASC,EAAmC,MAC5CC,EAAWH,QAAAA,EAAYC,EAG7BG,GAAU,WACR,IAAMC,EAAQF,EAASG,QAClBT,GAAcQ,GAEnBA,EAAME,kBAAkBF,EAAMb,MAAMgB,OAAQH,EAAMb,MAAMgB,OAC1D,GAAG,CAACX,EAAWM,IAiBf,OACErB,EAAC2B,EAAK,CACJC,eAAgBC,EAChBC,WAAY,CAEVnB,SAAUA,EACVM,YAAAA,EACAc,iBAAiB,EACjBC,sBAAuBC,SAASC,cAAc,QAC9CC,gBAAgB,EAChBC,aAAc,CAAE3C,iBAAAA,GAChB4C,gBAAgB,EAChBC,MAAOrD,GAETyB,MAAOA,EACPI,YAAaA,EACbI,SAAUG,EACVzB,UAAWC,EAAO0C,aAClBC,UAjCkB,SAACC,GACrB,IAAIC,IAEJ,MAAkB,WAAdD,EAAME,KAAoB9B,GAC5B4B,EAAMG,sBACN/B,UAIgB,UAAd4B,EAAME,KAAoBF,EAAMI,WAClCJ,EAAMG,iBACNhC,OAuBAkC,kBAAgB,EAChBC,KAAM,EACNC,WAAS,EACTC,WAAS,EACTlC,UAAWA,EACXC,SAAUA,GAGhB"}
@@ -0,0 +1,2 @@
1
+ import t from'./../../ext-esm/style-inject/dist/style-inject.es.js';var i={spacing:"8",mentionField:"CommentMentionField_mentionField__TVint",suggestion:"CommentMentionField_suggestion__i0SUX"};t(".CommentMentionField_mentionField__TVint{color:var(--palette-primary-text-1);font-size:14px!important;line-height:20px!important;padding:0!important;width:100%}.CommentMentionField_mentionField__TVint [class*=mention__control]{height:auto!important;max-height:160px;min-height:20px}.CommentMentionField_mentionField__TVint [class*=mention__highlighter]{box-sizing:border-box;line-height:20px!important;max-height:160px}.CommentMentionField_mentionField__TVint textarea{letter-spacing:normal!important;line-height:20px!important;max-height:160px;overflow-y:auto!important;padding:0!important}.CommentMentionField_suggestion__i0SUX{align-items:center;display:flex;gap:16px}div[class*=mention__suggestions]{z-index:1500!important}");export{i as default};
2
+ //# sourceMappingURL=CommentMentionField.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,aAAa,sDAAyD;"}