@corva/ui 0.32.0-2 → 0.32.0-22

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 (128) hide show
  1. package/CLI/components/App/App.js +1 -1
  2. package/CLI/components/App/components/AppBar/AppBar.js +1 -1
  3. package/CLI/hocs/withAppDataProviderHOC.js +1 -1
  4. package/CLI/hocs/withCorvaMagicHOC.js +1 -1
  5. package/CLI/hocs/withGridLayoutHOC/withGridLayoutHOC.js +1 -1
  6. package/CLI/hocs/withReactRouterHOC.js +1 -1
  7. package/CLI/screens/OAuthCallbackScreen/index.js +1 -1
  8. package/cjs/devcenter/webpack/DevServerEntryPoint.js +1 -17
  9. package/cjs/devcenter/webpack/DevServerIsolatedAppEntryPoint.js +1 -0
  10. package/cjs/devcenter/webpack/public/DevCenterIsolatedAppPage.html +28 -0
  11. package/cjs/devcenter/webpack/webpack.config.dev.js +1 -1
  12. package/clients/clientStorage/index.js +1 -1
  13. package/clients/jsonApi/index.js +1 -1
  14. package/components/AddComment/Popover.js +1 -1
  15. package/components/AddComment/components/Content.js +1 -1
  16. package/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js +1 -1
  17. package/components/Annotations/components/AnnotationsList/components/Annotation/index.js +1 -1
  18. package/components/AppVersionsSelect/AppVersionsSelect.js +1 -1
  19. package/components/AssetEditor/effects/index.js +1 -1
  20. package/components/AssetNameLabel/index.js +1 -1
  21. package/components/AssetNameLabel/styles.css.js +1 -1
  22. package/components/Attachment/index.js +1 -1
  23. package/components/BICOffsetPickerDialog/components/Map/index.css.js +1 -1
  24. package/components/BICOffsetPickerDialog/components/WellSection/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
  25. package/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js +1 -1
  26. package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
  27. package/components/BICOffsetPickerDialog/index.js +1 -1
  28. package/components/Breadcrumbs/index.js +1 -1
  29. package/components/CollapsableSidebar.js +1 -1
  30. package/components/Comment/index.js +1 -1
  31. package/components/DevCenter/AppHeader/AppHeader.js +1 -1
  32. package/components/DevCenter/AppHeader/AppHeaderNew.css.js +1 -0
  33. package/components/DevCenter/AppHeader/AppHeaderNew.js +1 -0
  34. package/components/DevCenter/AppHeader/PadMode.js +1 -1
  35. package/components/DevCenter/AppHeader/utils.js +1 -0
  36. package/components/DevCenter/AppSettingsPopover/AppSettingsPopover.js +1 -1
  37. package/components/DevCenter/AppSideBar/AppSideBar.js +1 -1
  38. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
  39. package/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
  40. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  41. package/components/DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js +1 -1
  42. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
  43. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/RemoveAppButton.js +1 -1
  44. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js +1 -1
  45. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js +1 -0
  46. package/components/DevCenter/DevCenterAppContainer/components/HelpCenterDialog/HelpCenterDialog.js +1 -1
  47. package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js +1 -1
  48. package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
  49. package/components/DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js +1 -0
  50. package/components/DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.scss.js +1 -0
  51. package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterAppZoidComponent.js +1 -0
  52. package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js +1 -0
  53. package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.module.css.js +1 -0
  54. package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js +1 -0
  55. package/components/DevCenter/IsolatedDevCenterAppContainer/constants.js +1 -0
  56. package/components/DevCenter/IsolatedDevCenterAppContainer/effects/useXProps.js +1 -0
  57. package/components/DevCenter/IsolatedDevCenterAppContainer/utils/replaceUndefinedValuesWithNull.js +1 -0
  58. package/components/FeedItem/components/Content.js +1 -1
  59. package/components/FeedItem/components/Reactions.js +1 -1
  60. package/components/FeedItem/feedItemTypes/CompletionNptFeedItem.js +1 -1
  61. package/components/FeedItem/feedItemTypes/NptFeedItem.js +1 -1
  62. package/components/FeedItem/feedItemTypes/StageOverviewFeedItem/api.js +1 -0
  63. package/components/FeedItem/feedItemTypes/StageOverviewFeedItem/components/NoData.js +1 -0
  64. package/components/FeedItem/feedItemTypes/StageOverviewFeedItem/components/Predictions.js +1 -0
  65. package/components/FeedItem/feedItemTypes/StageOverviewFeedItem/components/PredictionsItem.js +1 -0
  66. package/components/FeedItem/feedItemTypes/StageOverviewFeedItem/components/Stages/Stages.js +1 -0
  67. package/components/FeedItem/feedItemTypes/StageOverviewFeedItem/components/Stages/utils.js +1 -0
  68. package/components/FeedItem/feedItemTypes/StageOverviewFeedItem/index.js +1 -0
  69. package/components/InfiniteList/index.js +1 -1
  70. package/components/Notifications/NotificationsContainer.js +1 -1
  71. package/components/Notifications/components/Toast.js +1 -1
  72. package/components/Notifications/components/styles.js +1 -1
  73. package/components/OffsetWellPickerV2/OffsetWellPickerDialog.js +1 -1
  74. package/components/OffsetWellPickerV2/components/Filter/ClearFiltersButton.js +1 -1
  75. package/components/OffsetWellPickerV2/components/Filter/SidetrackSwitch.js +1 -0
  76. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  77. package/components/OffsetWellPickerV2/components/Filter/index.js +1 -1
  78. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  79. package/components/OffsetWellPickerV2/components/Table/index.js +1 -1
  80. package/components/OffsetWellPickerV2/constants.js +1 -1
  81. package/components/OffsetWellPickerV2/effects/index.js +1 -1
  82. package/components/OffsetWellPickerV2/utils/apiCalls.js +1 -1
  83. package/components/PadModeSelect/PadModeSelect.js +1 -1
  84. package/components/PadOffsetsPicker/PadOffsetsPicker.js +1 -1
  85. package/components/ParameterCharts/components/Track.js +1 -1
  86. package/components/PinnableFilters/effects/index.js +1 -1
  87. package/components/ResizableTable/ResizableTable.js +1 -0
  88. package/components/ResizableTable/ResizableTableCell.js +1 -0
  89. package/components/ResizableTable/ResizableTableHeaderCell.js +1 -0
  90. package/components/SlateFormattedText/SlateFormattedText.js +1 -1
  91. package/components/StageDesignVActual/ComparisonBar/ComparisonBar.js +1 -0
  92. package/components/StageDesignVActual/ComparisonBar/utils.js +1 -0
  93. package/components/StageDesignVActual/ComparisonHeader.js +1 -0
  94. package/components/StageDesignVActual/ComparisonRow.js +1 -0
  95. package/components/StageDesignVActual/ComparisonTable.css.js +1 -0
  96. package/components/StageDesignVActual/ElementsComparison/ElementsComparison.js +1 -0
  97. package/components/StageDesignVActual/ElementsComparison/utils.js +1 -0
  98. package/components/Tooltip/MuiTooltipDcWrapper.js +1 -1
  99. package/components/Tooltip/Tooltip.js +1 -1
  100. package/components/VirtualizedTable/DraggableList.js +1 -1
  101. package/components/VirtualizedTable/VirtualizedTable.js +1 -1
  102. package/components/WellSummary/WellSummaryItemValue.js +1 -1
  103. package/components/WellSummary/effects/useWellSummaryData.js +1 -1
  104. package/components/index.js +1 -1
  105. package/config/initGlobalDependencies.js +1 -0
  106. package/index.js +1 -1
  107. package/package.json +4 -2
  108. package/permissions/PermissionsContext.js +1 -0
  109. package/permissions/ProvidePermissions.js +1 -0
  110. package/permissions/constants/abilities.js +1 -0
  111. package/permissions/constants/appsPermissions.js +1 -0
  112. package/permissions/constants/index.js +1 -0
  113. package/permissions/constants/settingsApps.js +1 -0
  114. package/permissions/index.js +1 -0
  115. package/permissions/usePermissions.js +1 -0
  116. package/permissions/useProvidePermissions.js +1 -0
  117. package/permissions/utils.js +1 -0
  118. package/permissions/withPermissionsHOC.js +1 -0
  119. package/styles/globalStyles.js +1 -0
  120. package/utils/DrillstringUtils.js +1 -1
  121. package/utils/FluidCheckUtils.js +1 -1
  122. package/utils/StageDesignVActualUtils.js +1 -1
  123. package/utils/casing/conversion.js +1 -1
  124. package/utils/casing/validation.js +1 -1
  125. package/utils/completion.js +1 -1
  126. package/utils/devcenter.js +1 -1
  127. package/utils/drillstring/validation.js +1 -1
  128. package/utils/index.js +1 -1
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import"../../constants/completion.js";import a from"moment";import"../../constants/alerts.js";import{upperFirst as t}from"lodash";import{convertValue as r,getUnitDisplay as n}from"../../utils/convert.js";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/notifications.js";import"../../constants/feed.js";import{DRILLING_WELL_SUMMARY as i,COMPLETION_WELL_SUMMARY as s,DRILLOUT_WELL_SUMMARY as l}from"../../constants/wellSummary.js";import"../../utils/drillstring/conversion.js";import{getBHASchematic as c}from"../../utils/drillstring/schematic.js";import{orDash as o}from"../../utils/formatting.js";import m from"../../utils/main.js";import{jsxs as d,jsx as p,Fragment as u}from"react/jsx-runtime";import{makeStyles as h,Typography as f}from"@material-ui/core";import g from"prop-types";import y from"classnames";import v from"../Drillstring/BHASchematic.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentDetail/index.js";var N="/static/media/6684df900ff63f28b07f9c505fb7a66e.svg",k=h({value:{fontSize:"14px",fontWeight:500},valueSuffix:{color:"#9E9E9E"},hasLeftMargin:{marginLeft:4},bhaRoot:{display:"flex",alignItems:"center"},bhaIdRoot:{backgroundColor:"#2196F3",borderRadius:"50%",marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},realBhaRoot:{width:"16px",height:"16px"},bhaIdLabel:{fontWeight:500,fontSize:"12px"},dummyBhaIdLabel:{paddingLeft:"4px",paddingRight:"4px"},bhaActiveIndicator:{fontSize:"12px",padding:"4px",fontWeight:500},nptRoot:{display:"flex",alignItems:"center"},rectIndicator:{width:"8px",height:"8px",backgroundColor:"#D32F2F",borderRadius:"2px",marginRight:"8px"},stageActual:{fontSize:"16px"},stagePercent:{color:"#9E9E9E",marginLeft:"4px"},fluidProppantType:{color:"#9E9E9E"},valueWrapper:{display:"flex",alignItems:"center"},rightImg:{marginRight:"4px"},centerImg:{marginLeft:"4px",marginRight:"4px"},rotate:{transform:"rotate(180deg)"},profileRoot:{display:"flex",alignItems:"flex-start"},profile:{width:"20px",height:"20px",borderRadius:"50%",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px",backgroundSize:"20px 20px",backgroundRepeat:"no-repeat",backgroundPosition:"center"},plugsIcon:{marginLeft:-8}});function b(h){var g=h.item,b=h.summaryData,I=k();if(!b)return null;if(g.key===i.HOLE_DEPTH.key){var x=g.dataGetter(b).holeDepth;return Number.isFinite(x)?d("div",{className:I.valueWrapper,children:[p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:y(I.value,I.hasLeftMargin),children:[Math.floor(x),"’"]})]}):"-"}if(g.key===i.BIT_HOLE_DEPTH.key){var T=g.dataGetter(b),R=T.bitDepth,A=T.holeDepth;return[R,A].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/fa2667bad3591deb178e99b521571578.svg",alt:"bit_depth",className:I.rightImg}),d("span",{className:I.value,children:[Math.floor(R),"’ / "]}),p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:I.value,children:[Math.floor(A),"’"]})]}):"-"}if(g.key===i.DIVERGENCE.key){var E=g.dataGetter(b),S=E.distance,D=E.ahead,G=E.right;return[S,D,G].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("span",{className:I.value,children:"".concat(r(S,"length","ft")," ").concat(n("length"))}),p("img",{src:"/static/media/53cecdbd86f03352bda956fca25b537d.svg",alt:"up_arrow",className:y(I.centerImg,e({},I.rotate,D<0))}),p("span",{className:I.value,children:"".concat(Math.abs(r(D,"length","ft"))," ").concat(n("length")," ").concat(D>0?"Ahead":"Behind")}),p("img",{src:"/static/media/d32edb0ff9a69145d2c7917855263251.svg",alt:"left_arrow",className:y(I.centerImg,e({},I.rotate,G>0))}),p("span",{className:I.value,children:"".concat(Math.abs(r(G,"length","ft"))," ").concat(n("length")," ").concat(G>0?"Right":"Left")})]}):"-"}if(g.key===i.LAST_ACTIVE.key||g.key===s.LAST_ACTIVE.key){var L=g.dataGetter(b).timestamp;return p(f,{className:I.value,children:L?a.unix(L).format("MM/DD/YYYY HH:mm"):"-"})}if(g.key===i.CURRENT_ACTIVITY.key||g.key===s.CURRENT_ACTIVITY.key){var _=g.dataGetter(b).activityName;return p(f,{className:I.value,children:o(t(_||"-"))})}if(g.key===i.PHASE.key){var j=g.dataGetter(b).phaseName;return p(f,{className:I.value,children:o(j)})}if(g.key===i.HOLE_SECTION.key){var C=g.dataGetter(b).sectionName;return p(f,{className:I.value,children:o(C)})}if([i.MUD.key,l.MUD.key].includes(g.key)){var P=g.dataGetter(b),H=P.mudType,M=P.mudDensity;return p(f,{className:I.value,children:H||M?d(u,{children:[H&&"".concat(H,", "),M&&"".concat(r(M,"density","ppg")," ").concat(n("density"))]}):"-"})}if(g.key===i.NPT.key||g.key===s.NPT.key){var O=g.dataGetter(b),B=O.nptType,Y=O.startTime,F=O.endTime;return B&&Y&&F?d("div",{className:I.nptRoot,children:[p("div",{className:I.rectIndicator}),d(f,{className:I.value,children:[t(B),": ",((F-Y)/3600).fixFloat(1)," hr"]})]}):"-"}if(g.key===i.OPERATIONS_SUMMARY.key||g.key===s.OPERATIONS_SUMMARY.key){var U=g.dataGetter(b),W=U.dateTime,w=U.summary;return d(f,{className:I.value,children:[W?a.unix(W).format("MM/DD/YYYY HH:mm"):"-",p("br",{}),w]})}if(g.key===s.STAGE.key){var V=g.dataGetter(b),z=V.planned,q=V.actual;return q&&z?d(f,{className:I.value,children:[p("span",{className:I.stageActual,children:q}),p("span",{children:"/"}),p("span",{children:z}),d("span",{className:I.stagePercent,children:["Stg ",Math.floor(q/z*100)," %"]})]}):"-"}if(g.key===s.FLUIDS.key){var J=g.dataGetter(b).fluids;return p("div",{children:0===J.length?"-":J.map((function(e){var a=e.type,t=e.amount,i=e.unit;return d(f,{className:I.value,children:[d("span",{className:I.fluidProppantType,children:[a," - "]}),p("span",{children:"".concat(r(t,"oil",i)," ").concat(n("oil"))})]},"".concat(a,"_").concat(t))}))})}if(g.key===s.PROPPANTS.key){var K=g.dataGetter(b).proppants;return p("div",{children:0===K.length?"-":K.map((function(e){var a=e.type,t=e.amount,i=e.unit;return d(f,{className:I.value,children:[d("span",{className:I.fluidProppantType,children:[a," - "]}),p("span",{children:"".concat(r(t,"mass",i)," ").concat(n("mass"))})]},"".concat(a,"_").concat(t))}))})}if(g.key===i.ALERT.key||g.key===s.ALERT.key){var Q=g.dataGetter(b).decisionPath;return p(f,{className:I.value,children:o(Q)})}if(g.key===i.ANNOTATION.key||g.key===s.ANNOTATION.key){var X=g.dataGetter(b),Z=X.firstName,$=X.lastName,ee=X.profilePhoto,ae=X.content,te="".concat(Z," ").concat($),re="".concat((Z||"").charAt(0)).concat(($||"").charAt(0));return ae?d("div",{className:I.profileRoot,children:[p("div",{className:I.profile,style:{backgroundColor:"#".concat(m.getColorFromString(te)),backgroundImage:"url(".concat(ee,")")},children:ee?null:re}),p(f,{className:I.value,children:ae})]}):"-"}if([i.BHA.key,l.BHA.key].includes(g.key)){var ne=l.BHA.key===g.key,ie=g.dataGetter(b),se=ie.bhaId,le=ie.components,ce=se&&String(se)||"-",oe=se&&c(le||[],ne)||[];return d("div",{className:I.bhaRoot,children:[p("div",{className:y(I.bhaIdRoot,e({},I.realBhaRoot,!ce.includes("."))),children:p(f,{className:y(I.bhaIdLabel,e({},I.dummyBhaIdLabel,ce.includes("."))),children:ce})}),p(v,{schematic:oe,containerHeight:20,containerWidth:120})]})}if(g.key===i.CASING.key){var me=g.dataGetter(b).outerDiameter;return me?p(f,{className:I.value,children:"".concat(r(me,"shortLength")," ").concat(n("shortLength"))}):null}if(g.key===i.BHA_COUNT.key){var de=g.dataGetter(b).count;return p(f,{className:I.value,children:o(de)})}if(g.key===s.STAGES_DESIGN.key){var pe=g.dataGetter(b).totalNumberOfStages;return Number.isFinite(pe)?d(f,{className:I.value,children:["-/",pe," ",p("span",{className:I.valueSuffix,children:"Stg"})]}):"-"}if(g.key===s.PLUGS_DRILLED_COUNT.key){var ue=g.dataGetter(b).plugsDrilledCount;return Number.isFinite(ue)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/b0c8b3ba66c35ef3128cc93c5c538060.svg",alt:"drillout",className:I.plugsIcon}),p("span",{className:y(I.value,I.hasLeftMargin),children:ue})]}):"-"}if("development"===process.env.NODE_ENV)throw new Error("".concat(g.key," wasn't handled in WellSummaryItemValue. Returning null"));return null}b.propTypes={item:g.shape({key:g.string,label:g.string,icon:g.node,dataGetter:g.func}).isRequired,summaryData:g.shape({}).isRequired};export default b;
1
+ import e from"@babel/runtime/helpers/defineProperty";import{upperFirst as a}from"lodash";import{convertValue as t,getUnitDisplay as r}from"../../utils/convert.js";import"../../constants/completion.js";import n from"moment";import"../../constants/alerts.js";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/notifications.js";import"../../constants/feed.js";import{DRILLING_WELL_SUMMARY as i,COMPLETION_WELL_SUMMARY as s,DRILLOUT_WELL_SUMMARY as l}from"../../constants/wellSummary.js";import"../../utils/drillstring/conversion.js";import{getBHASchematic as c}from"../../utils/drillstring/schematic.js";import{orDash as o}from"../../utils/formatting.js";import m from"../../utils/main.js";import{jsxs as d,jsx as p,Fragment as u}from"react/jsx-runtime";import{makeStyles as h,Typography as f}from"@material-ui/core";import g from"prop-types";import y from"classnames";import v from"../Drillstring/BHASchematic.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentDetail/index.js";var N="/static/media/6684df900ff63f28b07f9c505fb7a66e.svg",k=h({value:{fontSize:"14px",fontWeight:500},valueSuffix:{color:"#9E9E9E"},hasLeftMargin:{marginLeft:4},bhaRoot:{display:"flex",alignItems:"center"},bhaIdRoot:{backgroundColor:"#2196F3",borderRadius:"50%",marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},realBhaRoot:{width:"16px",height:"16px"},bhaIdLabel:{fontWeight:500,fontSize:"12px"},dummyBhaIdLabel:{paddingLeft:"4px",paddingRight:"4px"},bhaActiveIndicator:{fontSize:"12px",padding:"4px",fontWeight:500},nptRoot:{display:"flex",alignItems:"center"},rectIndicator:{width:"8px",height:"8px",backgroundColor:"#D32F2F",borderRadius:"2px",marginRight:"8px"},stageActual:{fontSize:"16px"},stagePercent:{color:"#9E9E9E",marginLeft:"4px"},fluidProppantType:{color:"#9E9E9E"},valueWrapper:{display:"flex",alignItems:"center"},rightImg:{marginRight:"4px"},centerImg:{marginLeft:"4px",marginRight:"4px"},rotate:{transform:"rotate(180deg)"},profileRoot:{display:"flex",alignItems:"flex-start"},profile:{width:"20px",height:"20px",borderRadius:"50%",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px",backgroundSize:"20px 20px",backgroundRepeat:"no-repeat",backgroundPosition:"center"},plugsIcon:{marginLeft:-8}});function b(h){var g=h.item,b=h.summaryData,I=k();if(!b)return null;if(g.key===i.HOLE_DEPTH.key){var x=g.dataGetter(b).holeDepth;return Number.isFinite(x)?d("div",{className:I.valueWrapper,children:[p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:y(I.value,I.hasLeftMargin),children:[Math.floor(x),"’"]})]}):"-"}if(g.key===i.BIT_HOLE_DEPTH.key){var T=g.dataGetter(b),R=T.bitDepth,A=T.holeDepth;return[R,A].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/fa2667bad3591deb178e99b521571578.svg",alt:"bit_depth",className:I.rightImg}),d("span",{className:I.value,children:[Math.floor(R),"’ / "]}),p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:I.value,children:[Math.floor(A),"’"]})]}):"-"}if(g.key===i.DIVERGENCE.key){var E=g.dataGetter(b),S=E.distance,D=E.ahead,G=E.right;return[S,D,G].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("span",{className:I.value,children:"".concat(t(S,"length","ft")," ").concat(r("length"))}),p("img",{src:"/static/media/53cecdbd86f03352bda956fca25b537d.svg",alt:"up_arrow",className:y(I.centerImg,e({},I.rotate,D<0))}),p("span",{className:I.value,children:"".concat(Math.abs(t(D,"length","ft"))," ").concat(r("length")," ").concat(D>0?"Ahead":"Behind")}),p("img",{src:"/static/media/d32edb0ff9a69145d2c7917855263251.svg",alt:"left_arrow",className:y(I.centerImg,e({},I.rotate,G>0))}),p("span",{className:I.value,children:"".concat(Math.abs(t(G,"length","ft"))," ").concat(r("length")," ").concat(G>0?"Right":"Left")})]}):"-"}if(g.key===i.LAST_ACTIVE.key||g.key===s.LAST_ACTIVE.key){var L=g.dataGetter(b).timestamp;return p(f,{className:I.value,children:L?n.unix(L).format("MM/DD/YYYY HH:mm"):"-"})}if(g.key===i.CURRENT_ACTIVITY.key||g.key===s.CURRENT_ACTIVITY.key){var _=g.dataGetter(b).activityName;return p(f,{className:I.value,children:o(a(_||"-"))})}if(g.key===i.PHASE.key){var j=g.dataGetter(b).phaseName;return p(f,{className:I.value,children:o(j)})}if(g.key===i.HOLE_SECTION.key){var C=g.dataGetter(b).sectionName;return p(f,{className:I.value,children:o(C)})}if([i.MUD.key,l.MUD.key].includes(g.key)){var P=g.dataGetter(b),H=P.mudType,M=P.mudDensity;return p(f,{className:I.value,children:H||M?d(u,{children:[H&&"".concat(H,", "),M&&"".concat(t(M,"density","ppg")," ").concat(r("density"))]}):"-"})}if(g.key===i.NPT.key||g.key===s.NPT.key){var O=g.dataGetter(b),B=O.nptType,Y=O.startTime,F=O.endTime;return B&&Y&&F?d("div",{className:I.nptRoot,children:[p("div",{className:I.rectIndicator}),d(f,{className:I.value,children:[a(B),": ",((F-Y)/3600).fixFloat(1)," hr"]})]}):"-"}if(g.key===i.OPERATIONS_SUMMARY.key||g.key===s.OPERATIONS_SUMMARY.key){var U=g.dataGetter(b),W=U.dateTime,w=U.summary;return d(f,{className:I.value,children:[W?n.unix(W).format("MM/DD/YYYY HH:mm"):"-",p("br",{}),w]})}if(g.key===s.STAGE.key){var V=g.dataGetter(b),z=V.planned,q=V.actual;return q&&z?d(f,{className:I.value,children:[p("span",{className:I.stageActual,children:q}),p("span",{children:"/"}),p("span",{children:z}),d("span",{className:I.stagePercent,children:["Stg ",Math.floor(q/z*100)," %"]})]}):"-"}if(g.key===s.FLUIDS.key){var J=g.dataGetter(b).fluids;return p("div",{children:0===J.length?"-":J.map((function(e){var a=e.type,n=e.amount,i=e.unit;return d(f,{className:I.value,children:[d("span",{className:I.fluidProppantType,children:[a," - "]}),p("span",{children:"".concat(t(n,"oil",i)," ").concat(r("oil"))})]},"".concat(a,"_").concat(n))}))})}if(g.key===s.PROPPANTS.key){var K=g.dataGetter(b).proppants;return p("div",{children:0===K.length?"-":K.map((function(e){var a=e.type,n=e.amount,i=e.unit;return d(f,{className:I.value,children:[d("span",{className:I.fluidProppantType,children:[a," - "]}),p("span",{children:"".concat(t(n,"mass",i)," ").concat(r("mass"))})]},"".concat(a,"_").concat(n))}))})}if(g.key===i.ALERT.key||g.key===s.ALERT.key){var Q=g.dataGetter(b).decisionPath;return p(f,{className:I.value,children:o(Q)})}if(g.key===i.ANNOTATION.key||g.key===s.ANNOTATION.key){var X=g.dataGetter(b),Z=X.firstName,$=X.lastName,ee=X.profilePhoto,ae=X.content,te="".concat(Z," ").concat($),re="".concat((Z||"").charAt(0)).concat(($||"").charAt(0));return ae?d("div",{className:I.profileRoot,children:[p("div",{className:I.profile,style:{backgroundColor:"#".concat(m.getColorFromString(te)),backgroundImage:"url(".concat(ee,")")},children:ee?null:re}),p(f,{className:I.value,children:ae})]}):"-"}if([i.BHA.key,l.BHA.key].includes(g.key)){var ne=l.BHA.key===g.key,ie=g.dataGetter(b),se=ie.bhaId,le=ie.components,ce=se&&String(se)||"-",oe=se&&c(le||[],ne)||[];return d("div",{className:I.bhaRoot,children:[p("div",{className:y(I.bhaIdRoot,e({},I.realBhaRoot,!ce.includes("."))),children:p(f,{className:y(I.bhaIdLabel,e({},I.dummyBhaIdLabel,ce.includes("."))),children:ce})}),p(v,{schematic:oe,containerHeight:20,containerWidth:120})]})}if(g.key===i.CASING.key){var me=g.dataGetter(b).outerDiameter;return me?p(f,{className:I.value,children:"".concat(t(me,"shortLength")," ").concat(r("shortLength"))}):null}if(g.key===i.BHA_COUNT.key){var de=g.dataGetter(b).count;return p(f,{className:I.value,children:o(de)})}if(g.key===s.STAGES_DESIGN.key){var pe=g.dataGetter(b).totalNumberOfStages;return Number.isFinite(pe)?d(f,{className:I.value,children:["-/",pe," ",p("span",{className:I.valueSuffix,children:"Stg"})]}):"-"}if(g.key===s.PLUGS_DRILLED_COUNT.key){var ue=g.dataGetter(b).plugsDrilledCount;return Number.isFinite(ue)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/b0c8b3ba66c35ef3128cc93c5c538060.svg",alt:"drillout",className:I.plugsIcon}),p("span",{className:y(I.value,I.hasLeftMargin),children:ue})]}):"-"}if("development"===process.env.NODE_ENV)throw new Error("".concat(g.key," wasn't handled in WellSummaryItemValue. Returning null"));return null}b.propTypes={item:g.shape({key:g.string,label:g.string,icon:g.node,dataGetter:g.func}).isRequired,summaryData:g.shape({}).isRequired};export default b;
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import"../../../constants/completion.js";import"../../../constants/alerts.js";import{get as r,sortBy as e,omit as n}from"lodash";import a from"@babel/runtime/helpers/slicedToArray";import"../../../constants/goals.js";import"../../../constants/segment.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import{DRILLING_WELL_SUMMARY as s,COMPLETION_WELL_SUMMARY as c,DRILLOUT_WELL_SUMMARY as i}from"../../../constants/wellSummary.js";import{RIG_ACTIVITY_COLORS as o}from"../../../constants/rigActivity.js";import u from"@babel/runtime/regenerator";import p from"@babel/runtime/helpers/asyncToGenerator";import{useState as l,useEffect as f}from"react";import{getAppStorage as m}from"../../../clients/jsonApi/index.js";function d(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function h(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}function v(t){return b.apply(this,arguments)}function b(){return(b=p(u.mark((function t(e){var n,a;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e.map(function(){var t=p(u.mark((function t(e){var n;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m("corva","activities.summary-continuous",e,{fields:["data.activities","data.start_timestamp","data.end_timestamp"].join(","),limit:1,query:"{timestamp#lte#".concat(Math.floor(Date.now()/1e3),"}"),sort:"{timestamp:-1}"});case 3:return n=t.sent,t.abrupt("return",(r(n,"0.data.activities")||[]).map((function(t){return h(h({},t),{},{duration:(t.day||0)+(t.night||0),color:o[t.name]})})));case 7:t.prev=7,t.t0=t.catch(0),console.error(t.t0);case 10:return t.abrupt("return",[]);case 11:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(r){return t.apply(this,arguments)}}()));case 2:return n=t.sent,a={},n.forEach((function(t,r){a[e[r]]=t})),t.abrupt("return",a);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function y(t,r,e,n){return g.apply(this,arguments)}function g(){return(g=p(u.mark((function t(a,s,c,i){var o,p;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m("corva",s,a,{aggregate:JSON.stringify([{$match:{asset_id:a,timestamp:{$lte:c,$gte:c-86400}}},{$project:{_id:-1,stage_number:1,data:1,timestamp:1}},{$group:{_id:"$stage_number",timestamp:{$first:"$timestamp"},stage_number:{$last:"$stage_number"},first_data:{$first:"$data"},last_data:{$last:"$data"}}}])});case 3:return o=t.sent,p=0,e(o,"timestamp").forEach((function(t,e){if(0===e){var a=n(r(t,"first_data"),i),s=n(r(t,"last_data"),i);Object.keys(s).forEach((function(t){p+=s[t]-(a[t]||0)}))}else{var c=n(r(t,"last_data"),i);Object.keys(c).forEach((function(t){p+=c[t]}))}})),t.abrupt("return",p);case 9:t.prev=9,t.t0=t.catch(0),console.error(t.t0);case 12:return t.abrupt("return",0);case 13:case"end":return t.stop()}}),t,null,[[0,9]])})))).apply(this,arguments)}function j(t){return w.apply(this,arguments)}function w(){return(w=p(u.mark((function t(e){var n,s;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e.map(function(){var t=p(u.mark((function t(e){var n,s,c,i,o,p,l,f,d,h,v;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=Promise,t.next=4,m("corva","completion.wits",e,{limit:1,fields:"timestamp"});case 4:return t.t1=t.sent,t.next=7,m("corva","wireline.wits",e,{limit:1,fields:"timestamp"});case 7:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=11,t.t0.all.call(t.t0,t.t3);case 11:if(n=t.sent,s=a(n,2),c=s[0],i=s[1],o=r(c,"0.timestamp"),p=r(i,"0.timestamp"),l=null,o&&p?l=o>p?o:p:o?l=o:p&&(l=p),l){t.next=21;break}return t.abrupt("return",[]);case 21:return t.next=23,Promise.all([y(e,"completion.activity.summary-stage",l,["activities"]),y(e,"wireline.activity.summary-stage",l,["durations"])]);case 23:return f=t.sent,d=a(f,2),h=d[0],v=d[1],t.abrupt("return",[{name:"frac",duration:h,color:"#7177FF"},{name:"wireline",duration:v,color:"#FF9C00"}]);case 30:t.prev=30,t.t4=t.catch(0),console.error(t.t4);case 33:return t.abrupt("return",[]);case 34:case"end":return t.stop()}}),t,null,[[0,30]])})));return function(r){return t.apply(this,arguments)}}()));case 2:return n=t.sent,s={},n.forEach((function(t,r){s[e[r]]=t})),t.abrupt("return",s);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=l(!0),o=a(n,2),d=o[0],b=o[1],y=l({}),g=a(y,2),w=g[0],x=g[1],O=l(!0),_=a(O,2),$=_[0],k=_[1],P=l({}),E=a(P,2),S=E[0],D=E[1],F="drilling"===r;return f((function(){function n(){return(n=p(u.mark((function r(){var n,a,o,p,l,f,d;return u.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=(e||Object.values(F?s:h(h({},c),i))).filter((function(t){return t.dataSource&&t.dataSource.length})),a=[],n.forEach((function(t){t.dataSource.forEach((function(t){var r=t.provider,e=t.collection,n=t.fields;r&&e&&n&&n.length?n.forEach((function(t){return a.push("".concat(r,"#").concat(e,".").concat(t))})):e&&a.push(e)}))})),a.push("well_id"),r.prev=4,o={asset_id:{$in:t}},p=a.reduce((function(t,r){return t[r]=1,t}),{asset_id:1}),l={aggregate:JSON.stringify([{$match:o},{$project:p}])},r.next=10,m("corva","well_cache",null,l);case 10:f=r.sent,d={},f.forEach((function(t){var r=t.asset_id;d[r]=t})),x(d),r.next=19;break;case 16:r.prev=16,r.t0=r.catch(4),console.error(r.t0);case 19:b(!1);case 20:case"end":return r.stop()}}),r,null,[[4,16]])})))).apply(this,arguments)}function a(){return(a=p(u.mark((function e(){var n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"drilling"!==r){e.next=7;break}return e.next=4,v(t);case 4:e.t0=e.sent,e.next=10;break;case 7:return e.next=9,j(t);case 9:e.t0=e.sent;case 10:n=e.t0,D(n),e.next=17;break;case 14:e.prev=14,e.t1=e.catch(0),console.error(e.t1);case 17:k(!1);case 18:case"end":return e.stop()}}),e,null,[[0,14]])})))).apply(this,arguments)}b(!0),k(!0),function(){n.apply(this,arguments)}(),function(){a.apply(this,arguments)}()}),[]),[d||$,w,S]}export{x as useWellSummaryData};
1
+ import t from"@babel/runtime/helpers/defineProperty";import{get as r,sortBy as e,omit as n}from"lodash";import"../../../constants/completion.js";import"../../../constants/alerts.js";import a from"@babel/runtime/helpers/slicedToArray";import"../../../constants/goals.js";import"../../../constants/segment.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import{DRILLING_WELL_SUMMARY as s,COMPLETION_WELL_SUMMARY as c,DRILLOUT_WELL_SUMMARY as i}from"../../../constants/wellSummary.js";import{RIG_ACTIVITY_COLORS as o}from"../../../constants/rigActivity.js";import u from"@babel/runtime/regenerator";import p from"@babel/runtime/helpers/asyncToGenerator";import{useState as l,useEffect as f}from"react";import{getAppStorage as m}from"../../../clients/jsonApi/index.js";function d(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function h(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}function v(t){return b.apply(this,arguments)}function b(){return(b=p(u.mark((function t(e){var n,a;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e.map(function(){var t=p(u.mark((function t(e){var n;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m("corva","activities.summary-continuous",e,{fields:["data.activities","data.start_timestamp","data.end_timestamp"].join(","),limit:1,query:"{timestamp#lte#".concat(Math.floor(Date.now()/1e3),"}"),sort:"{timestamp:-1}"});case 3:return n=t.sent,t.abrupt("return",(r(n,"0.data.activities")||[]).map((function(t){return h(h({},t),{},{duration:(t.day||0)+(t.night||0),color:o[t.name]})})));case 7:t.prev=7,t.t0=t.catch(0),console.error(t.t0);case 10:return t.abrupt("return",[]);case 11:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(r){return t.apply(this,arguments)}}()));case 2:return n=t.sent,a={},n.forEach((function(t,r){a[e[r]]=t})),t.abrupt("return",a);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function y(t,r,e,n){return g.apply(this,arguments)}function g(){return(g=p(u.mark((function t(a,s,c,i){var o,p;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m("corva",s,a,{aggregate:JSON.stringify([{$match:{asset_id:a,timestamp:{$lte:c,$gte:c-86400}}},{$project:{_id:-1,stage_number:1,data:1,timestamp:1}},{$group:{_id:"$stage_number",timestamp:{$first:"$timestamp"},stage_number:{$last:"$stage_number"},first_data:{$first:"$data"},last_data:{$last:"$data"}}}])});case 3:return o=t.sent,p=0,e(o,"timestamp").forEach((function(t,e){if(0===e){var a=n(r(t,"first_data"),i),s=n(r(t,"last_data"),i);Object.keys(s).forEach((function(t){p+=s[t]-(a[t]||0)}))}else{var c=n(r(t,"last_data"),i);Object.keys(c).forEach((function(t){p+=c[t]}))}})),t.abrupt("return",p);case 9:t.prev=9,t.t0=t.catch(0),console.error(t.t0);case 12:return t.abrupt("return",0);case 13:case"end":return t.stop()}}),t,null,[[0,9]])})))).apply(this,arguments)}function j(t){return w.apply(this,arguments)}function w(){return(w=p(u.mark((function t(e){var n,s;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e.map(function(){var t=p(u.mark((function t(e){var n,s,c,i,o,p,l,f,d,h,v;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=Promise,t.next=4,m("corva","completion.wits",e,{limit:1,fields:"timestamp"});case 4:return t.t1=t.sent,t.next=7,m("corva","wireline.wits",e,{limit:1,fields:"timestamp"});case 7:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=11,t.t0.all.call(t.t0,t.t3);case 11:if(n=t.sent,s=a(n,2),c=s[0],i=s[1],o=r(c,"0.timestamp"),p=r(i,"0.timestamp"),l=null,o&&p?l=o>p?o:p:o?l=o:p&&(l=p),l){t.next=21;break}return t.abrupt("return",[]);case 21:return t.next=23,Promise.all([y(e,"completion.activity.summary-stage",l,["activities"]),y(e,"wireline.activity.summary-stage",l,["durations"])]);case 23:return f=t.sent,d=a(f,2),h=d[0],v=d[1],t.abrupt("return",[{name:"frac",duration:h,color:"#7177FF"},{name:"wireline",duration:v,color:"#FF9C00"}]);case 30:t.prev=30,t.t4=t.catch(0),console.error(t.t4);case 33:return t.abrupt("return",[]);case 34:case"end":return t.stop()}}),t,null,[[0,30]])})));return function(r){return t.apply(this,arguments)}}()));case 2:return n=t.sent,s={},n.forEach((function(t,r){s[e[r]]=t})),t.abrupt("return",s);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=l(!0),o=a(n,2),d=o[0],b=o[1],y=l({}),g=a(y,2),w=g[0],x=g[1],O=l(!0),_=a(O,2),$=_[0],k=_[1],P=l({}),E=a(P,2),S=E[0],D=E[1],F="drilling"===r;return f((function(){function n(){return(n=p(u.mark((function r(){var n,a,o,p,l,f,d;return u.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=(e||Object.values(F?s:h(h({},c),i))).filter((function(t){return t.dataSource&&t.dataSource.length})),a=[],n.forEach((function(t){t.dataSource.forEach((function(t){var r=t.provider,e=t.collection,n=t.fields;r&&e&&n&&n.length?n.forEach((function(t){return a.push("".concat(r,"#").concat(e,".").concat(t))})):e&&a.push(e)}))})),a.push("well_id"),r.prev=4,o={asset_id:{$in:t}},p=a.reduce((function(t,r){return t[r]=1,t}),{asset_id:1}),l={aggregate:JSON.stringify([{$match:o},{$project:p}])},r.next=10,m("corva","well_cache",null,l);case 10:f=r.sent,d={},f.forEach((function(t){var r=t.asset_id;d[r]=t})),x(d),r.next=19;break;case 16:r.prev=16,r.t0=r.catch(4),console.error(r.t0);case 19:b(!1);case 20:case"end":return r.stop()}}),r,null,[[4,16]])})))).apply(this,arguments)}function a(){return(a=p(u.mark((function e(){var n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"drilling"!==r){e.next=7;break}return e.next=4,v(t);case 4:e.t0=e.sent,e.next=10;break;case 7:return e.next=9,j(t);case 9:e.t0=e.sent;case 10:n=e.t0,D(n),e.next=17;break;case 14:e.prev=14,e.t1=e.catch(0),console.error(e.t1);case 17:k(!1);case 18:case"end":return e.stop()}}),e,null,[[0,14]])})))).apply(this,arguments)}b(!0),k(!0),function(){n.apply(this,arguments)}(),function(){a.apply(this,arguments)}()}),[]),[d||$,w,S]}export{x as useWellSummaryData};
@@ -1 +1 @@
1
- import"react/jsx-runtime";import"react";export{default as Modal}from"./Modal/index.js";export{default as IconMenu}from"./IconMenu/index.js";export{default as StyledMenuItem}from"./StyledMenuItem/index.js";export{default as LoadingIndicator}from"./LoadingIndicator/LoadingIndicator.js";import"./DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";export{default as EmptyAppView}from"./EmptyView/EmptyAppView/EmptyAppView.js";export{default as ErrorBoundary}from"./ErrorBoundary/ErrorBoundary.js";import*as e from"./Typography.js";export{e as Typography};import"./ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";export{default as ConfirmationDialog}from"./ConfirmationDialog.js";export{default as DisabledSettingsMessage}from"./DevCenter/DevCenterAppContainer/components/DisabledSettingsMessage/DisabledSettingsMessage.js";export{Element,Leaf}from"./SlateFormattedText/RenderElements.js";export{slateFormattingTextUtils}from"./SlateFormattedText/utils.js";export{default as SlateFormattedText}from"./SlateFormattedText/SlateFormattedText.js";export{default as AppSettingsDialog}from"./DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"./DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"./DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"./DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"./DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"./DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"./DevCenter/DevCenterAppContainer/components/HelpCenterDialog/HelpCenterDialog.js";import"./DevCenter/DevCenterAppContainer/components/DcTooltipsCoordinatorProvider/DcTooltipsCoordinatorProvider.js";import"./DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";export{Tooltip}from"./Tooltip/Tooltip.js";export{default as Avatar}from"./Avatar/index.js";export{AnnotationsProvider,useAnnotationsDispatch,useAnnotationsState}from"./Annotations/AnnotationsContext.js";import"./DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";export{UniversalLink}from"./DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";export{withUniversalLocationHOC}from"./DevCenter/DevCenterRouterContext/hocs/withUniversalLocationHOC.js";export{default as IconButton}from"./IconButton/index.js";export{default as AnnotationsList}from"./Annotations/components/AnnotationsList/index.js";export{default as LastAnnotation}from"./Annotations/components/LastAnnotation/index.js";export{default as PadModeSelect}from"./PadModeSelect/PadModeSelect.js";export{default as AppHeader}from"./DevCenter/AppHeader/AppHeader.js";export{default as AppSideBar}from"./DevCenter/AppSideBar/AppSideBar.js";export{default as AppContext}from"./DevCenter/AppContext.js";export{default as AppsDataProvider}from"./DevCenter/AppsDataProvider/AppsDataProvider.js";export{default as DevCenterAppContainer}from"./DevCenter/DevCenterAppContainer/DevCenterAppContainer.js";export{default as NavigationBar}from"./DevCenter/NavigationBar/NavigationBar.js";export{default as SideBar}from"./DevCenter/SideBar/SideBar.js";export{default as AppSettingsPopover}from"./DevCenter/AppSettingsPopover/AppSettingsPopover.js";export{default as TruncatedText}from"./TruncatedText/index.js";export{default as SingleAssetEditor}from"./AssetEditor/SingleAssetEditor.js";export{default as AssetEditorAutocomplete,default as SingleAssetEditorAutocomplete}from"./AssetEditor/AssetEditorAutocomplete.js";export{default as AppSettingsAssetEditor}from"./AssetEditor/index.js";export{default as AppVersionsSelect}from"./AppVersionsSelect/AppVersionsSelect.js";export{default as CollapsableSidebar}from"./CollapsableSidebar.js";export{default as DateTimePicker}from"./DateTimePicker/index.js";export{default as DatePicker}from"./DatePicker/index.js";export{default as PaletteChromePicker}from"./ColorPicker/PaletteChromePicker/PaletteChromePicker.js";export{default as ColorPicker}from"./ColorPicker/ColorPicker.js";export{default as AddEditTrack}from"./ParameterCharts/AddEditTrack.js";export{default as ParameterCharts}from"./ParameterCharts/ParameterCharts.js";export{default as ChartActionsList}from"./ChartActionsList/ChartActionsList.js";export{default as ColorEditor}from"./SettingEditors/ColorEditor/index.js";export{default as StyledDropdownEditor}from"./SettingEditors/DropdownEditor/index.js";export{default as RadioEditor}from"./SettingEditors/RadioEditor/index.js";export{default as SwitchControl}from"./SwitchControl/index.js";export{default as RangeSlider}from"./RangeSlider/RangeSlider.js";import*as t from"./Login/index.js";export{t as Login};export{default as Breadcrumbs}from"./Breadcrumbs/index.js";export{default as VirtualizedTable}from"./VirtualizedTable/index.js";export{default as EmptyView}from"./EmptyView/EmptyView.js";export{default as Button}from"./Button/index.js";export{default as MenuItem}from"./MenuItem/index.js";export{default as ContextMenuItem}from"./ContextMenuItem/index.js";export{default as FolderMenuItem}from"./FolderMenuItem/index.js";export{default as EditableItem}from"./EditableItem/EditableItem/index.js";export{default as EditableItemWithBadge}from"./EditableItem/EditableItemWithBadge/index.js";export{default as Checkbox}from"./Checkbox/index.js";export{default as FolderMenuItemWithLinks}from"./FolderMenuItemWithLinks/index.js";export{default as TextField}from"./TextField/index.js";export{default as Chip}from"./Chip/index.js";export{default as Counter}from"./Counter/index.js";export{default as AnchorsList}from"./AnchorsList/AnchorsList.js";export{default as Select}from"./Select/index.js";export{default as Tabs}from"./Tabs/Tabs.js";export{default as Tab}from"./Tabs/Tab.js";export{default as BHASchematic}from"./Drillstring/BHASchematic.js";export{default as BHAComponentIcon}from"./Drillstring/BHAComponentIcon.js";export{default as BHATable}from"./Drillstring/BHATable/index.js";export{default as BHAComponentDetail}from"./Drillstring/BHAComponentDetail/index.js";export{default as CasingComponentIcon}from"./Casing/CasingComponentIcon.js";export{default as CasingTable}from"./Casing/CasingTable/index.js";import*as o from"./WellSummary/index.js";export{o as WellSummary};export{default as BICOffsetPickerDialog}from"./BICOffsetPickerDialog/index.js";export{default as OffsetWellPickerV2}from"./OffsetWellPickerV2/OffsetWellPickerDialog.js";export{default as Notifications}from"./Notifications/Notifications.js";export{default as NotificationsContainer}from"./Notifications/NotificationsContainer.js";export{default as TextLink}from"./TextLink/index.js";export{default as TemplatePopover}from"./Template/TemplatePopover/index.js";export{default as PinnableFilters}from"./PinnableFilters/PinnableFilters.js";export{default as HeaderLayout}from"./HeaderLayout/HeaderLayout.js";import*as r from"./PadOffsetsPicker/index.js";export{r as PadOffsetsPicker};export{default as TableSortLabel}from"./Table/TableSortLabel/TableSortLabel.js";export{default as TableToolbar}from"./Table/TableToolbar/TableToolbar.js";export{default as PriceInput}from"./PriceInput/PriceInput.js";export{default as LabelsCounter}from"./LabelsCounter/LabelsCounter.js";export{default as Step}from"./Stepper/Step.js";export{default as StepsWrapper}from"./Stepper/StepsWrapper.js";export{default as Stepper}from"./Stepper/Stepper.js";export{default as CommentIcon}from"./Comment/CommentIcon/index.js";export{default as FilesLoader}from"./FilesLoader/FilesLoader.js";export{default as SearchInput}from"./SearchInput/index.js";export{default as FeedItem}from"./FeedItem/FeedItem.js";export{default as KeyboardDateTimePicker}from"./KeyboardDateTimePicker.js";export{default as PostInput}from"./PostInput/PostInput.js";export{FeedItemEditProvider,useFeedItemEditProvider}from"./FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";export{default as AddCommentPopover}from"./AddComment/Popover.js";export{default as AddCommentPopup}from"./AddComment/Popup.js";
1
+ import"@babel/runtime/helpers/defineProperty";import"../constants/segment.js";import"react/jsx-runtime";import"react";export{default as Modal}from"./Modal/index.js";export{default as IconMenu}from"./IconMenu/index.js";export{default as StyledMenuItem}from"./StyledMenuItem/index.js";export{default as LoadingIndicator}from"./LoadingIndicator/LoadingIndicator.js";import"./DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";export{default as EmptyAppView}from"./EmptyView/EmptyAppView/EmptyAppView.js";export{default as ErrorBoundary}from"./ErrorBoundary/ErrorBoundary.js";import*as e from"./Typography.js";export{e as Typography};import"./ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";export{default as ConfirmationDialog}from"./ConfirmationDialog.js";export{default as DisabledSettingsMessage}from"./DevCenter/DevCenterAppContainer/components/DisabledSettingsMessage/DisabledSettingsMessage.js";export{Element,Leaf}from"./SlateFormattedText/RenderElements.js";export{slateFormattingTextUtils}from"./SlateFormattedText/utils.js";export{default as SlateFormattedText}from"./SlateFormattedText/SlateFormattedText.js";export{default as AppSettingsDialog}from"./DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"./DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"./DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"./DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"./DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"./EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"./DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"./DevCenter/DevCenterAppContainer/components/HelpCenterDialog/HelpCenterDialog.js";import"./DevCenter/DevCenterAppContainer/components/DcTooltipsCoordinatorProvider/DcTooltipsCoordinatorProvider.js";import"./DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";export{Tooltip}from"./Tooltip/Tooltip.js";export{default as Avatar}from"./Avatar/index.js";export{AnnotationsProvider,useAnnotationsDispatch,useAnnotationsState}from"./Annotations/AnnotationsContext.js";import"./DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";export{UniversalLink}from"./DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";export{withUniversalLocationHOC}from"./DevCenter/DevCenterRouterContext/hocs/withUniversalLocationHOC.js";export{default as IconButton}from"./IconButton/index.js";export{default as AnnotationsList}from"./Annotations/components/AnnotationsList/index.js";export{default as LastAnnotation}from"./Annotations/components/LastAnnotation/index.js";export{default as PadModeSelect}from"./PadModeSelect/PadModeSelect.js";export{default as AppHeaderNew}from"./DevCenter/AppHeader/AppHeaderNew.js";export{default as AppHeader}from"./DevCenter/AppHeader/AppHeader.js";export{default as AppSideBar}from"./DevCenter/AppSideBar/AppSideBar.js";export{default as AppContext}from"./DevCenter/AppContext.js";export{default as AppsDataProvider}from"./DevCenter/AppsDataProvider/AppsDataProvider.js";export{default as DevCenterAppContainer}from"./DevCenter/DevCenterAppContainer/DevCenterAppContainer.js";export{default as NavigationBar}from"./DevCenter/NavigationBar/NavigationBar.js";export{default as SideBar}from"./DevCenter/SideBar/SideBar.js";export{default as AppSettingsPopover}from"./DevCenter/AppSettingsPopover/AppSettingsPopover.js";export{DevCenterIsolatedAppPage}from"./DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";export{DevCenterIsolatedApp}from"./DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";export{AppsGridDragHandle}from"./DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js";export{default as TruncatedText}from"./TruncatedText/index.js";export{default as SingleAssetEditor}from"./AssetEditor/SingleAssetEditor.js";export{default as AssetEditorAutocomplete,default as SingleAssetEditorAutocomplete}from"./AssetEditor/AssetEditorAutocomplete.js";export{default as AppSettingsAssetEditor}from"./AssetEditor/index.js";export{default as AppVersionsSelect}from"./AppVersionsSelect/AppVersionsSelect.js";export{default as CollapsableSidebar}from"./CollapsableSidebar.js";export{default as DateTimePicker}from"./DateTimePicker/index.js";export{default as DatePicker}from"./DatePicker/index.js";export{default as PaletteChromePicker}from"./ColorPicker/PaletteChromePicker/PaletteChromePicker.js";export{default as ColorPicker}from"./ColorPicker/ColorPicker.js";export{default as AddEditTrack}from"./ParameterCharts/AddEditTrack.js";export{default as ParameterCharts}from"./ParameterCharts/ParameterCharts.js";export{default as ChartActionsList}from"./ChartActionsList/ChartActionsList.js";export{default as ColorEditor}from"./SettingEditors/ColorEditor/index.js";export{default as StyledDropdownEditor}from"./SettingEditors/DropdownEditor/index.js";export{default as RadioEditor}from"./SettingEditors/RadioEditor/index.js";export{default as SwitchControl}from"./SwitchControl/index.js";export{default as RangeSlider}from"./RangeSlider/RangeSlider.js";import*as t from"./Login/index.js";export{t as Login};export{default as Breadcrumbs}from"./Breadcrumbs/index.js";export{default as VirtualizedTable}from"./VirtualizedTable/index.js";export{default as EmptyView}from"./EmptyView/EmptyView.js";export{default as Button}from"./Button/index.js";export{default as MenuItem}from"./MenuItem/index.js";export{default as ContextMenuItem}from"./ContextMenuItem/index.js";export{default as FolderMenuItem}from"./FolderMenuItem/index.js";export{default as EditableItem}from"./EditableItem/EditableItem/index.js";export{default as EditableItemWithBadge}from"./EditableItem/EditableItemWithBadge/index.js";export{default as Checkbox}from"./Checkbox/index.js";export{default as FolderMenuItemWithLinks}from"./FolderMenuItemWithLinks/index.js";export{default as TextField}from"./TextField/index.js";export{default as Chip}from"./Chip/index.js";export{default as Counter}from"./Counter/index.js";export{default as AnchorsList}from"./AnchorsList/AnchorsList.js";export{default as Select}from"./Select/index.js";export{default as Tabs}from"./Tabs/Tabs.js";export{default as Tab}from"./Tabs/Tab.js";export{default as ResizableTable}from"./ResizableTable/ResizableTable.js";export{default as BHASchematic}from"./Drillstring/BHASchematic.js";export{default as BHAComponentIcon}from"./Drillstring/BHAComponentIcon.js";export{default as BHATable}from"./Drillstring/BHATable/index.js";export{default as BHAComponentDetail}from"./Drillstring/BHAComponentDetail/index.js";export{default as CasingComponentIcon}from"./Casing/CasingComponentIcon.js";export{default as CasingTable}from"./Casing/CasingTable/index.js";import*as o from"./WellSummary/index.js";export{o as WellSummary};export{default as BICOffsetPickerDialog}from"./BICOffsetPickerDialog/index.js";export{default as OffsetWellPickerV2}from"./OffsetWellPickerV2/OffsetWellPickerDialog.js";export{default as Notifications}from"./Notifications/Notifications.js";export{default as NotificationsContainer}from"./Notifications/NotificationsContainer.js";export{default as TextLink}from"./TextLink/index.js";export{default as TemplatePopover}from"./Template/TemplatePopover/index.js";export{default as PinnableFilters}from"./PinnableFilters/PinnableFilters.js";export{default as HeaderLayout}from"./HeaderLayout/HeaderLayout.js";import*as r from"./PadOffsetsPicker/index.js";export{r as PadOffsetsPicker};export{default as TableSortLabel}from"./Table/TableSortLabel/TableSortLabel.js";export{default as TableToolbar}from"./Table/TableToolbar/TableToolbar.js";export{default as PriceInput}from"./PriceInput/PriceInput.js";export{default as LabelsCounter}from"./LabelsCounter/LabelsCounter.js";export{default as Step}from"./Stepper/Step.js";export{default as StepsWrapper}from"./Stepper/StepsWrapper.js";export{default as Stepper}from"./Stepper/Stepper.js";export{default as CommentIcon}from"./Comment/CommentIcon/index.js";export{default as FilesLoader}from"./FilesLoader/FilesLoader.js";export{default as SearchInput}from"./SearchInput/index.js";export{default as ComparisonHeader}from"./StageDesignVActual/ComparisonHeader.js";export{default as ComparisonBar}from"./StageDesignVActual/ComparisonBar/ComparisonBar.js";export{default as ComparisonRow}from"./StageDesignVActual/ComparisonRow.js";export{default as ElementsComparison}from"./StageDesignVActual/ElementsComparison/ElementsComparison.js";export{default as FeedItem}from"./FeedItem/FeedItem.js";export{default as KeyboardDateTimePicker}from"./KeyboardDateTimePicker.js";export{default as PostInput}from"./PostInput/PostInput.js";export{FeedItemEditProvider,useFeedItemEditProvider}from"./FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";export{default as AddCommentPopover}from"./AddComment/Popover.js";export{default as AddCommentPopup}from"./AddComment/Popup.js";
@@ -0,0 +1 @@
1
+ import{initHighcharts as s}from"./highcharts/highcharts.js";import{initializeSocketClient as i}from"../clients/subscriptions.js";s(),i();
package/index.js CHANGED
@@ -1 +1 @@
1
- import*as s from"./constants/index.js";export{s as constants};import*as o from"./utils/index.js";export{o as utils};import*as e from"./config/index.js";export{e as theme};import*as t from"./effects/index.js";export{t as effects};import*as r from"./clients/index.js";export{r as clients};import*as a from"./components/index.js";export{a as components};import*as i from"./hocs/index.js";export{i as hocs};import*as m from"./styles/index.js";export{m as styles};import"./styles/mapbox.global.css.js";import"./styles/generatedThemesVariables.global.css.js";
1
+ import*as s from"./constants/index.js";export{s as constants};import*as o from"./utils/index.js";export{o as utils};import*as e from"./config/index.js";export{e as theme};import*as t from"./effects/index.js";export{t as effects};import*as r from"./clients/index.js";export{r as clients};import*as i from"./hocs/index.js";export{i as hocs};import"./styles/mapbox.global.css.js";import"./styles/generatedThemesVariables.global.css.js";import*as m from"./permissions/index.js";export{m as permissions};import*as a from"./components/index.js";export{a as components};import*as p from"./styles/index.js";export{p as styles};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.32.0-2",
3
+ "version": "0.32.0-22",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"
@@ -135,6 +135,7 @@
135
135
  "react": "17.0.1",
136
136
  "react-color": "2.18.1",
137
137
  "react-dom": "17.0.1",
138
+ "react-draggable": "4.2.0",
138
139
  "react-grid-layout": "0.18.3",
139
140
  "react-image-lightbox": "5.1.0",
140
141
  "react-infinite-scroller": "1.2.4",
@@ -164,7 +165,8 @@
164
165
  "webpack-cli": "3.3.6",
165
166
  "webpack-dev-server": "3.10.2",
166
167
  "webpack-manifest-plugin": "2.2.0",
167
- "webpack-merge": "5.7.2"
168
+ "webpack-merge": "5.7.2",
169
+ "zoid": "^9.0.86"
168
170
  },
169
171
  "devDependencies": {
170
172
  "@rollup/plugin-babel": "^5.2.1",
@@ -0,0 +1 @@
1
+ import{createContext as r,useContext as t}from"react";var e=r();export default function(){return t(e)}export{e as PermissionsContext};
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import e from"prop-types";import{PermissionsContext as o}from"./PermissionsContext.js";import i from"./useProvidePermissions.js";function s(e){var s=e.children;return r(o.Provider,{value:i(),children:s})}s.propTypes={children:e.node.isRequired};export default s;
@@ -0,0 +1 @@
1
+ var e={view:"view",edit:"edit",read:"read",update:"update",create:"create",destroy:"destroy",impersonate:"impersonate",access:"access"};export{e as ABILITIES};
@@ -0,0 +1 @@
1
+ import{stringifyPermission as s}from"../utils.js";import{ABILITIES as t}from"./abilities.js";var a={canViewCorvaAssetStatus:s({ability:t.view,resource_class:"corva.asset-status"}),canViewCorvaDrilloutAssetStatus:s({ability:t.view,resource_class:"corva.drillout.asset-status-ui"}),canViewCorvaMultiAssetStatus:s({ability:t.view,resource_class:"corva.multi-asset-status"})};export default a;
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/defineProperty";import{stringifyPermission as r}from"../utils.js";import{ABILITIES as s}from"./abilities.js";export{ABILITIES}from"./abilities.js";import t from"./settingsApps.js";import i from"./appsPermissions.js";function a(e,r){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),s.push.apply(s,t)}return s}function c(r){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{};s%2?a(Object(t),!0).forEach((function(s){e(r,s,t[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var o=c(c({companySelectorView:r({resource_class:"company_selector",ability:s.view}),userCreate:r({resource_class:"User",ability:s.create}),getUserUpdate:function(e){return r({resource_class:"User",ability:s.update,resource_id:e})},canViewCorvaAppVersion:r({resource_class:"corva_app_version",ability:s.view}),documentationEdit:r({resource_class:"Document",ability:s.edit}),documentationCreate:r({resource_class:"Document",ability:s.create}),documentationDestroy:r({resource_class:"Document",ability:s.destroy}),canUpdateWellQC:r({resource_class:"well_qc",ability:s.update}),getFeedItemDestroy:function(e){return r({resource_class:"Activity",ability:s.destroy,resource_id:e})},getCommentDestroy:function(e){return r({resource_class:"Comment",ability:s.destroy,resource_id:e})},getAlertUpdate:function(e){return r({resource_class:"Alert",ability:s.update,resource_id:e})},getAlertDestroy:function(e){return r({resource_class:"Alert",ability:s.destroy,resource_id:e})},streamVisibilityEdit:r({resource_class:"stream",ability:s.edit}),userImpersonate:r({resource_class:"user",ability:s.impersonate}),getDashboardUpdate:function(e){return r({resource_class:"Dashboard",ability:s.update,resource_id:e})},canUpdateTiers:r({resource_class:"Tier",ability:s.update}),canReadTiers:r({resource_class:"Tier",ability:s.read}),canCreateTiers:r({resource_class:"Tier",ability:s.create}),canDestroyTiers:r({resource_class:"Tier",ability:s.destroy}),canUpdateProductSubscriptions:r({resource_class:"ProductSubscription",ability:s.update}),canReadProductSubscriptions:r({resource_class:"ProductSubscription",ability:s.read}),canCreateProductSubscriptions:r({resource_class:"ProductSubscription",ability:s.create}),canDestroyProductSubscriptions:r({resource_class:"ProductSubscription",ability:s.destroy}),canViewPurchasesPage:r({resource_class:"company_purchase",ability:s.access}),canReadPermissions:r({resource_class:"Permission",ability:s.read}),canViewUserPermissions:r({resource_class:"mng_permissions_user_btn",ability:s.view}),canViewGroupPermissions:r({resource_class:"mng_permissions_group_btn",ability:s.view}),getAppStreamUpdate:function(e){return r({resource_class:"AppStream",ability:s.update,resource_id:e})},canViewAlertValidationFilters:r({resource_class:"alert_validation_filters",ability:s.view}),canViewAlertSubscriptionFilters:r({resource_class:"alert_subscription_filters",ability:s.view}),getCanDestroyAlertDefinition:function(e){return r({resource_class:"AlertDefinition",ability:s.destroy,resource_id:e})},getCanUpdateAlertDefinition:function(e){return r({resource_class:"AlertDefinition",ability:s.update,resource_id:e})},canCreateAlertDashboard:r({resource_class:"alert_dashboard",ability:s.create}),canUpdateAlertDashboard:r({resource_class:"alert_dashboard",ability:s.edit}),canViewAlertCompanyField:r({resource_class:"alert_company_field",ability:s.view}),canViewDashboardSharingCompany:r({resource_class:"dashboard_sharing_company",ability:s.view}),canViewDashboardSharingSharedWith:r({resource_class:"dashboard_sharing_shared_with",ability:s.view}),canViewConfigPage:r({resource_class:"config_page",ability:s.access}),canAccessRequestApp:r({resource_class:"request_app",ability:s.access}),canAccessUserSettingsWidgets:r({resource_class:"user_settings_widgets",ability:s.access}),canViewDevCenter:r({resource_class:"dev_center",ability:s.access}),getCanViewAppVersion:function(e){return r({resource_class:"App",ability:"read_packages",resource_id:e})},canAccessProvisioning:r({resource_class:"provisioning",ability:s.access}),getCanUpdateAsset:function(e){return r({resource_class:"Asset",ability:s.update,resource_id:e})},getCanUpdateParentAssetAsset:function(e){return r({resource_class:"Asset",ability:"update_parent_asset",resource_id:e})},rigCreate:r({ability:s.create,resource_class:"Rig"}),wellCreate:r({ability:s.create,resource_class:"Well"}),programCreate:r({ability:s.create,resource_class:"Program"}),padCreate:r({ability:s.create,resource_class:"Pad"}),padUpdate:r({ability:s.update,resource_class:"Pad"}),fracFleetCreate:r({ability:s.create,resource_class:"FracFleet"}),drilloutUnitCreate:r({ability:s.create,resource_class:"DrilloutUnit"}),canQCDrillstring:r({ability:s.update,resource_class:"drillstring_qc"}),canCalibrateDrillstring:r({ability:s.update,resource_class:"drillstring_calibration"}),canViewAppOwnersFilter:r({ability:s.view,resource_class:"app_owners_filter"})},t),i);export{o as PERMISSIONS};
@@ -0,0 +1 @@
1
+ import{stringifyPermission as t}from"../utils.js";import{ABILITIES as s}from"./abilities.js";var e={canUpdateDrillingAFEApp:t({ability:s.update,resource_class:"settings-AFE_settings_app"}),canUpdateCompletionAFEApp:t({ability:s.update,resource_class:"corva.completion.settings-AFE_settings_app"}),canUpdateDrillingSurfaceEquipmentApp:t({ability:s.update,resource_class:"corva.completion.settings-surfaceEquipment_settings_app"}),canUpdateCompletionSurfaceEquipmentApp:t({ability:s.update,resource_class:"corva.completion.settings-surfaceEquipment_settings_app"}),canUpdateCasingApp:t({ability:s.update,resource_class:"settings-casing_settings_app"}),canUpdateDrillingCostsApp:t({ability:s.update,resource_class:"settings-costs_settings_app"}),canUpdateCompletionCostsApp:t({ability:s.update,resource_class:"corva.completion.settings-costs_settings_app"}),canUpdateDrillingCrewsContactApp:t({ability:s.update,resource_class:"settings-crewsContact_settings_app"}),canUpdateCompletionCrewsContactApp:t({ability:s.update,resource_class:"corva.completion.settings-crewsContact_settings_app"}),canUpdateWHOApp:t({ability:s.update,resource_class:"corva.completion.settings-generalInfo_settings_app"}),canUpdateJobSettingsApp:t({ability:s.update,resource_class:"corva.completion.settings-jobSettings_settings_app"}),canUpdateDrillingDrillstringsApp:t({ability:s.update,resource_class:"settings-drillstrings_settings_app"}),canUpdateCompletionDrillstringsApp:t({ability:s.update,resource_class:"corva.completion.settings-drillstrings_settings_app"}),canUpdateWellSectionsApp:t({ability:s.update,resource_class:"settings-offsetWells_settings_app"}),canUpdateFormationsApp:t({ability:s.update,resource_class:"settings-formations_settings_app"}),canUpdateMapApp:t({ability:s.update,resource_class:"settings-map_settings_app"}),canUpdateDrillingFluidChecksApp:t({ability:s.update,resource_class:"settings-fluidChecks_settings_app"}),canUpdateCompletionFluidChecksApp:t({ability:s.update,resource_class:"corva.completion.settings-fluidChecks_settings_app"}),canUpdateOffsetWellsApp:t({ability:s.update,resource_class:"settings-offsetWells_settings_app"}),canUpdateOperationDiariesApp:t({ability:s.update,resource_class:"settings-operationDiaries_settings_app"}),canUpdateDrillingOperationSummariesApp:t({ability:s.update,resource_class:"settings-operationSummaries_settings_app"}),canUpdateCompletionOperationSummariesApp:t({ability:s.update,resource_class:"corva.completion.settings-operationSummaries_settings_app"}),canUpdatePlugDepthsApp:t({ability:s.update,resource_class:"corva.completion.settings-plugs_settings_app"}),canUpdatePlugSheetApp:t({ability:s.update,resource_class:"corva.completion.settings-plugs_settings_app"}),canUpdatePressureGradientApp:t({ability:s.update,resource_class:"settings-pressureGradient_settings_app"}),canUpdateStageActualApp:t({ability:s.update,resource_class:"corva.completion.settings-stageActual_settings_app"}),canUpdateStageDesignApp:t({ability:s.update,resource_class:"corva.completion.settings-stageDesign_settings_app"}),canUpdateActualSurveysApp:t({ability:s.update,resource_class:"settings-actualSurveys_settings_app"}),canUpdatePlanSurveysApp:t({ability:s.update,resource_class:"settings-actualSurveys_settings_app"}),canUpdateTimeLogApp:t({ability:s.update,resource_class:"corva.completion.settings-timeLog_settings_app"}),canUpdateWellGoalsApp:t({ability:s.update,resource_class:"corva.completion.settings-well-goals-ui_settings_app"})};export default e;
@@ -0,0 +1 @@
1
+ export{default as usePermissionsContext}from"./PermissionsContext.js";export{default as usePermissions}from"./usePermissions.js";export{parsePermission,stringifyPermission}from"./utils.js";export{ABILITIES}from"./constants/abilities.js";export{PERMISSIONS}from"./constants/index.js";export{withPermissionsHOC}from"./withPermissionsHOC.js";export{default as useProvidePermissions}from"./useProvidePermissions.js";export{default as ProvidePermissions}from"./ProvidePermissions.js";
@@ -0,0 +1 @@
1
+ import{useEffect as t}from"react";import n from"./PermissionsContext.js";function o(o){var r=n(),i=r.permissions,e=r.fetchPermissions;return t((function(){e(o)}),["".concat(o)]),o.map((function(t){return i[t]||{active:!1,loading:!0}}))}export default o;
@@ -0,0 +1 @@
1
+ import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/regenerator";import n from"@babel/runtime/helpers/asyncToGenerator";import{useState as o,useRef as i}from"react";import{getPermissionCheck as c}from"../clients/jsonApi/index.js";import{parsePermission as u}from"./utils.js";function s(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function p(r){return f.apply(this,arguments)}function f(){return(f=n(t.mark((function r(e){return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,c(e);case 3:return r.abrupt("return",r.sent);case 6:return r.prev=6,r.t0=r.catch(0),console.error(r.t0),r.abrupt("return",{active:!1});case 10:case"end":return r.stop()}}),r,null,[[0,6]])})))).apply(this,arguments)}function l(){var r=o({}),c=e(r,2),s=c[0],f=c[1],l=i(new Set);function m(){return(m=n(t.mark((function r(e){var n,o;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=e.filter((function(r){return!(r in s)&&!l.current.has(r)}))).length){r.next=3;break}return r.abrupt("return");case 3:return r.next=5,Promise.all(n.map((function(r){return l.current.add(r),p(u(r))})));case 5:o=r.sent,f((function(r){var e=a({},r);return n.forEach((function(r,t){l.current.delete(r),e[r]=a({loading:!1},o[t])})),e}));case 7:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return window[Symbol.for("resetPermissionsCache")]=function(){return f({})},{permissions:s,fetchPermissions:function(r){return m.apply(this,arguments)}}}export default l;
@@ -0,0 +1 @@
1
+ import r from"@babel/runtime/helpers/slicedToArray";var e=function(r){var e=r.ability,c=r.resource_class,o=r.resource_id,i=void 0===o?"":o;return"".concat(e,"#").concat(c,"#").concat(i)},c=function(e){var c=e.split("#"),o=r(c,3);return{ability:o[0],resource_class:o[1],resource_id:o[2]}};export{c as parsePermission,e as stringifyPermission};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/defineProperty";import{some as o}from"lodash";import"@babel/runtime/helpers/toConsumableArray";import"../constants/completion.js";import"../constants/alerts.js";import"@babel/runtime/helpers/slicedToArray";import"../constants/goals.js";import"../constants/segment.js";import"../constants/apps.js";import"../constants/drillstring.js";import"../constants/notifications.js";import"../constants/feed.js";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/asyncToGenerator";import"../utils/mobileDetect.js";import"@babel/runtime/helpers/typeof";import"../utils/index.js";import{jsx as t}from"react/jsx-runtime";import"@material-ui/core";import"react";import"querystring";import"uuid/v1";import"../clients/jsonApi/index.js";import"../clients/subscriptions.js";import"uuid";import"@babel/runtime/helpers/objectWithoutProperties";import"classnames";import"../components/Modal/index.js";import"../components/IconMenu/index.js";import"../components/StyledMenuItem/index.js";import n from"../components/LoadingIndicator/LoadingIndicator.js";import"../components/DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../components/EmptyView/EmptyAppView/EmptyAppView.js";import"../components/ErrorBoundary/ErrorBoundary.js";import"../components/Typography.js";import"../components/ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../components/ConfirmationDialog.js";import"../components/DevCenter/DevCenterAppContainer/components/DisabledSettingsMessage/DisabledSettingsMessage.js";import"slate";import"../components/SlateFormattedText/RenderElements.js";import"../components/SlateFormattedText/SlateFormattedText.js";import"../components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../components/DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../components/DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../components/EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../components/DevCenter/DevCenterAppContainer/components/HelpCenterDialog/HelpCenterDialog.js";import"../components/DevCenter/DevCenterAppContainer/components/DcTooltipsCoordinatorProvider/DcTooltipsCoordinatorProvider.js";import"../components/DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../components/Tooltip/MuiTooltipDcWrapper.js";import"../components/Avatar/index.js";import"../components/Annotations/AnnotationsContext.js";import"../components/DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"react-router";import"../components/DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"../components/IconButton/index.js";import"../components/Annotations/components/AnnotationsList/index.js";import"../components/Annotations/components/LastAnnotation/index.js";import"../components/PadModeSelect/PadModeSelect.js";import"../components/DevCenter/AppHeader/AppHeaderNew.js";import"../components/DevCenter/AppHeader/AppHeader.js";import"../components/DevCenter/AppSideBar/AppSideBar.js";import"../components/DevCenter/AppContext.js";import"../components/DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/icons/Help";import"../components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../components/DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../components/DevCenter/NavigationBar/NavigationBar.js";import"../components/DevCenter/SideBar/SideBar.js";import"../components/DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import r from"./usePermissions.js";import"../components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../components/DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js";import"../components/TruncatedText/index.js";import"../components/AssetEditor/SingleAssetEditor.js";import"../components/AssetEditor/AssetEditorAutocomplete.js";import"../components/AssetEditor/index.js";import"../components/AppVersionsSelect/AppVersionsSelect.js";import"../components/CollapsableSidebar.js";import"../components/DateTimePicker/index.js";import"../components/DatePicker/index.js";import"../components/ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../components/ColorPicker/ColorPicker.js";import"../components/ParameterCharts/AddEditTrack.js";import"../components/ParameterCharts/ParameterCharts.js";import"../components/ChartActionsList/ChartActionsList.js";import"../components/SettingEditors/ColorEditor/index.js";import"../components/SettingEditors/DropdownEditor/index.js";import"../components/SettingEditors/RadioEditor/index.js";import"../components/SwitchControl/index.js";import"../components/RangeSlider/RangeSlider.js";import"../components/Login/components/Login.js";import"../components/Login/components/PasswordField.js";import"../components/Login/components/Chip.js";import"../components/Login/components/StepFooter.js";import"../components/Login/components/StepContent.js";import"../components/Login/components/StepHeader.js";import"../components/Login/components/Step.js";import"../components/Login/components/OrDivider.js";import"../components/Login/components/HiddenEmailField.js";import"../components/Login/components/EmailField.js";import"../components/Breadcrumbs/index.js";import"../components/VirtualizedTable/index.js";import"../components/EmptyView/EmptyView.js";import"../components/Button/index.js";import"../components/MenuItem/index.js";import"../components/ContextMenuItem/index.js";import"../components/FolderMenuItem/index.js";import"../components/EditableItem/EditableItem/index.js";import"../components/EditableItem/EditableItemWithBadge/index.js";import"../components/Checkbox/index.js";import"../components/FolderMenuItemWithLinks/index.js";import"../components/TextField/index.js";import"../components/Chip/index.js";import"../components/Counter/index.js";import"../components/AnchorsList/AnchorsList.js";import"../components/Select/index.js";import"../components/Tabs/Tabs.js";import"../components/Tabs/Tab.js";import"../components/ResizableTable/ResizableTable.js";import"../components/Drillstring/BHASchematic.js";import"../components/Drillstring/BHAComponentIcon.js";import"../components/Drillstring/BHATable/index.js";import"../components/Drillstring/BHAComponentDetail/index.js";import"../components/Casing/CasingComponentIcon.js";import"../components/Casing/CasingTable/index.js";import"../components/WellSummary/WellSummaryItemLabel.js";import"../components/WellSummary/WellSummaryItemTitle.js";import"../components/WellSummary/WellSummaryItemValue.js";import"../components/WellSummary/ActivitySummaryChart.js";import"../components/WellSummary/FracWirelineTimeChart.js";import"../components/BICOffsetPickerDialog/index.js";import"../components/OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../components/Notifications/Notifications.js";import"../components/TextLink/index.js";import"../components/Template/TemplatePopover/index.js";import"../components/PinnableFilters/PinnableFilters.js";import"../components/HeaderLayout/HeaderLayout.js";import"../components/PadOffsetsPicker/PadOffsetsPicker.js";import"../components/PadOffsetsPicker/OffsetAssetChip.js";import"../components/PadOffsetsPicker/OffsetAssetsListExpander.js";import"../components/PadOffsetsPicker/StagesSelector.js";import"../components/Table/TableToolbar/TableToolbar.js";import"../components/PriceInput/PriceInput.js";import"../components/LabelsCounter/LabelsCounter.js";import"../components/Stepper/Step.js";import"../components/Stepper/StepsWrapper.js";import"../components/Stepper/Stepper.js";import"../components/Comment/CommentIcon/index.js";import"../components/FilesLoader/FilesLoader.js";import"../components/SearchInput/index.js";import"../components/StageDesignVActual/ComparisonHeader.js";import"../components/StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../components/StageDesignVActual/ComparisonRow.js";import"../components/StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../components/FeedItem/FeedItem.js";import"../components/KeyboardDateTimePicker.js";import"../components/PostInput/PostInput.js";import"../components/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../components/AddComment/Popover.js";import"../components/AddComment/Popup.js";function s(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}function p(o){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){e(o,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(n,e))}))}return o}var i=t(n,{}),m=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(s){return function(m){var c=n.loader,a=void 0===c?i:c,l=n.skipLoading,d=void 0!==l&&l,j=Object.keys(e),C=r(j.map((function(o){var t=e[o];return"function"==typeof t?t(m):t})));if(!d&&o(C,"loading"))return a;var u=j.reduce((function(e,o,t){return e[o]=C[t].active,e}),{});return t(s,p(p({},m),u))}}};export{m as withPermissionsHOC};
@@ -0,0 +1 @@
1
+ import"./index.global.css.js";import"./reactVirtualized.global.css.js";import"./emojiMart.global.css.js";import"./mapbox.global.css.js";import"./generatedThemesVariables.global.css.js";navigator.platform.indexOf("Mac")>-1||import("./customScrollbars.global.css.js");
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"moment";import{getUnitPreference as r,convertValue as i,getUnitDisplay as s}from"./convert.js";import o from"lodash/get";import n from"lodash/set";function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function l(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?a(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function _(e){return null==e||""===e}function h(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=i.isMinInclusive,o=void 0===s||s,n=parseFloat(e);return!Number.isNaN(n)&&(!(o&&n<t||!o&&n<=t)&&!(r&&n>r))}function g(e,t,s){var o=r("shortLength"),n=e,a=t;"in"!==o&&(n=i(e,"shortLength",o,"in"),a=i(t,"shortLength",o,"in"));var l=2.673*(a*a-n*n),_="in"!==o?i(l,"massPerLength","lb-ft"):l;return s>=.5*_&&s<=1.5*_}function d(e){var r=e.toJS().data,o=r.id,n=r.start_timestamp_str,a=r.start_depth,l=r.components,_=s("shortLength"),d=s("length"),m={general:{},components:{},specificErrors:{}},u=l.filter((function(e){return"bit"===e.family})),f=u.length>0?u[0].size:null,b=l.filter((function(e){return"mwd"===e.family&&e.has_gamma_sensor})),p=!1;if(isValueEmpty(o)&&(m.id="It should not be empty.",p=!0),n&&!t(new Date(n)).isValid()&&(p=!0,m.start_timestamp="Invalid Date."),Number.isFinite(a)){var v=i(0,"length","ft"),z=i(55e3,"length","ft"),w=i(1,"length","ft");(a<=v||a>z)&&(p=!0,m.start_depth="Should be a positive number ".concat(v.toFixed(2),"~").concat(z.toFixed(2)," (").concat(d,")")),a===w&&(p=!0,m.start_depth="Should not be equal to ".concat(w," (").concat(d,")"))}else p=!0,m.start_depth="It should not be empty.";for(var L=0;L<l.length;L+=1){var y=void 0,x=void 0,F=void 0,j=void 0,I=void 0,O=void 0,V=void 0,E=void 0,q=void 0,k=void 0,D=void 0,P=void 0,S=void 0,N=void 0,R=void 0,T=l[L],B={};switch(T.family){case"ct":y=i(0,"shortLength","in"),F=i(100,"shortLength","in"),x=i(1,"shortLength","in"),j=i(100,"shortLength","in"),N=i(0,"shortLength","in"),R=i(500,"shortLength","in"),V=i(0,"length","ft");break;case"dp":case"hwdp":y=i(1,"shortLength","in"),F=i(7,"shortLength","in"),x=i(2,"shortLength","in"),j=i(8,"shortLength","in"),E=i(1,"shortLength","in"),q=i(7,"shortLength","in"),k=i(2,"shortLength","in"),D=i(10,"shortLength","in"),V=i(0,"length","ft");break;case"dc":y=i(.5,"shortLength","in"),F=i(7,"shortLength","in"),x=i(2,"shortLength","in"),j=i(13,"shortLength","in"),V=i(0,"length","ft");break;case"stabilizer":y=i(0,"shortLength","in"),F=i(100,"shortLength","in"),x=i(1,"shortLength","in"),j=i(100,"shortLength","in"),V=i(0,"length","ft");break;case"pdm":x=i(2,"shortLength","in"),j=i(15,"shortLength","in"),y=i(0,"shortLength","in"),F=i(12,"shortLength","in"),V=i(4,"length","ft"),S=0;break;case"mwd":case"agitator":case"rss":x=i(2,"shortLength","in"),j=i(13,"shortLength","in"),y=i(0,"shortLength","in"),F=i(12,"shortLength","in"),V=i(1,"length","ft"),P=0;break;case"ur":y=i(0,"shortLength","in"),F=i(50,"shortLength","in"),x=i(1,"shortLength","in"),j=i(50,"shortLength","in"),I=i(1,"shortLength","in"),O=i(50,"shortLength","in");break;case"bit":break;default:y=i(0,"shortLength","in"),F=i(100,"shortLength","in"),x=i(1,"shortLength","in"),j=i(100,"shortLength","in"),V=i(0,"length","ft")}if(isValueEmpty(y)||isValueEmpty(x)||(h(T.inner_diameter,y,F)||(B.inner_diameter="".concat(y.toFixed(1),"~").concat(F.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter,x,j)||(B.outer_diameter="".concat(x.toFixed(1),"~").concat(j.toFixed(1)," (").concat(_,")"),p=!0),h(T.inner_diameter,y,F)&&h(T.outer_diameter,x,j)&&!h(T.inner_diameter,y,T.outer_diameter)&&(B.outer_diameter="O.D > I.D",p=!0),!B.outer_diameter&&f&&+T.outer_diameter+i(.1,"shortLength","in")>f&&(B.outer_diameter=" O.D + 0.1 < Bit Size",p=!0),h(T.linear_weight,0)||(B.linear_weight="Invalid value",p=!0),"dp"!==T.family&&"hwdp"!==T.family&&"dc"!==T.family&&"ct"!==T.family&&"ur"!==T.family||B.inner_diameter||B.outer_diameter||B.linear_weight||g(T.inner_diameter,T.outer_diameter,T.linear_weight)||(B.linear_weight="Invalid range",p=!0)),"ur"===T.family&&(h(T.ur_opened_od,I,O)?T.ur_opened_od<f&&(B.ur_opened_od="Max O.D (Opened) >= Bit Size",p=!0):(B.ur_opened_od="".concat(I.toFixed(1),"~").concat(O.toFixed(1)," (").concat(_,")"),p=!0)),isValueEmpty(E)||isValueEmpty(k)||(h(T.inner_diameter_tooljoint,E,q)||(B.inner_diameter_tooljoint="".concat(E.toFixed(1),"~").concat(q.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter_tooljoint,k,D)||(B.outer_diameter_tooljoint="".concat(k.toFixed(1),"~").concat(D.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter_tooljoint,T.outer_diameter,D)||(B.outer_diameter_tooljoint="Tool Joint O.D >= O.D",p=!0)),isValueEmpty(V)||h(T.length,V)||(B.length="Invalid value",p=!0),isValueEmpty(T.length_tooljoint)||isValueEmpty(T.component_length)||+T.length_tooljoint>+T.component_length&&(B.length_tooljoint="Tool Joint Length < Component Length",p=!0),T.off_bottom_pressure_loss&&T.off_bottom_pressure_loss.length>0){B.off_bottom_pressure_loss={};for(var J=0;J<T.off_bottom_pressure_loss.length;J+=1){var M=T.off_bottom_pressure_loss[J];B.off_bottom_pressure_loss[J]={},isValueEmpty(M.flow_rate)&&(B.off_bottom_pressure_loss[J].flow_rate="flow rate is required.",p=!0),isValueEmpty(M.pressure_loss)&&(B.off_bottom_pressure_loss[J].pressure_loss="pressure loss is required.",p=!0),isValueEmpty(S)||h(M.pressure_loss,S,null,{isMinInclusive:!1})||(B.off_bottom_pressure_loss[J].pressure_loss="Invalid range",p=!0)}}if(T.pressure_loss&&T.pressure_loss.length>0){B.pressure_loss={};for(var C=0;C<T.pressure_loss.length;C+=1){var A=T.pressure_loss[C];B.pressure_loss[C]={},isValueEmpty(A.flow_rate)&&(B.pressure_loss[C].flow_rate="flow rate is required.",p=!0),isValueEmpty(A.pressure_loss)&&(B.pressure_loss[C].pressure_loss="pressure loss is required.",p=!0),isValueEmpty(P)||h(A.pressure_loss,P,null,{isMinInclusive:!1})||(B.pressure_loss[C].pressure_loss="Invalid range",p=!0)}}if(T.has_stabilizer&&T.stabilizer){var G=i(0,"shortLength","in"),H=i(100,"shortLength","in"),K=i(1,"shortLength","in"),Q=i(100,"shortLength","in"),U=i(0,"length","ft");h(T.stabilizer.inner_diameter,G,H)&&h(T.stabilizer.outer_diameter,K,Q)&&!h(T.stabilizer.inner_diameter,y,T.stabilizer.outer_diameter)&&(B.stabilizer_outer_diameter="O.D > I.D",p=!0),h(T.stabilizer.inner_diameter,G,H)||(B.stabilizer_inner_diameter="".concat(G.toFixed(1),"~").concat(H.toFixed(1)," (").concat(_,")"),p=!0),h(T.stabilizer.outer_diameter,K,Q)||(B.stabilizer_outer_diameter="".concat(K.toFixed(1),"~").concat(Q.toFixed(1)," (").concat(_,")"),p=!0),isValueEmpty(U)||h(T.stabilizer.length,U)||(B.stabilizer_length="Invalid value",p=!0),isValueEmpty(T.stabilizer.linear_weight)&&(B.stabilizer_linear_weight="Invalid value",p=!0),!B.stabilizer_outer_diameter&&f&&+T.stabilizer.outer_diameter+i(.1,"shortLength","in")>f&&(B.stabilizer_outer_diameter=" O.D + 0.1 < Bit Size",p=!0)}if("ct"===T.family&&(h(T.reel_diameter,N,R)||(B.reel_diameter="".concat(N.toFixed(1),"~").concat(R.toFixed(1)," (").concat(_,")"),p=!0)),"bit"===T.family){var W=c(1,"shortLength","in"),X=W*W*0,Y=W*W*20;h(T.tfa,X,Y)||(B.tfa="TFA must be ".concat(X.toFixed(2),"~").concat(20..toFixed(2)),p=!0)}if("rss"===T.family&&(h(T.flow_loss_percentage,0,10)||(B.flow_loss_percentage="It must be ".concat(0,"~").concat(10),p=!0)),"mwd"===T.family&&(b.length>1?(B.gamma_sensor_to_bit_distance="Only 1 gamma sensor allowed. Currently ".concat(b.length),p=!0):T.has_gamma_sensor&&!Number.isFinite(T.gamma_sensor_to_bit_distance)&&(B.gamma_sensor_to_bit_distance="This field is required.",p=!0),T.has_survey_sensor&&!Number.isFinite(T.bit_to_survey_distance)?(B.bit_to_survey_distance="This field is required.",p=!0):T.has_survey_sensor&&T.bit_to_survey_distance<=0?(B.bit_to_survey_distance="Should be a positive number.",p=!0):T.has_survey_sensor&&T.bit_to_survey_distance>150&&(B.bit_to_survey_distance="Should be less then 150.",p=!0),T.has_directional_sensor&&!Number.isFinite(T.directional_sensor_to_bit_distance)?(B.directional_sensor_to_bit_distance="This field is required.",p=!0):T.has_directional_sensor&&T.directional_sensor_to_bit_distance<=0?(B.directional_sensor_to_bit_distance="Should be a positive number.",p=!0):T.has_directional_sensor&&T.directional_sensor_to_bit_distance>150&&(B.directional_sensor_to_bit_distance="Should be less then 150.",p=!0)),"pdm"===T.family){var Z=void 0,$=void 0;h(T.number_rotor_lobes,1,10)||(B.number_rotor_lobes="It must be ".concat(1,"~").concat(10),p=!0),h(T.number_stator_lobes,2,10)||(B.number_stator_lobes="It must be ".concat(2,"~").concat(10),p=!0),h(T.rpg,0,10)||(B.rpg="It must be ".concat(0,"~").concat(10),p=!0),Z=i(0,"force","klbf"),$=i(200,"force","klbf"),isValueEmpty(T.max_weight_on_bit)||h(T.max_weight_on_bit,Z,$)||(B.max_weight_on_bit="It must be ".concat($.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=i(0,"volumeFlowRate","gal/min"),$=i(2500,"volumeFlowRate","gal/min"),h(T.min_standard_flowrate,Z,$)||(B.min_standard_flowrate="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),h(T.max_standard_flowrate,Z,$)||(B.max_standard_flowrate="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=i(0,"pressure","psi"),$=i(3e3,"pressure","psi"),h(T.max_operating_differential_pressure,Z,$)||(B.max_operating_differential_pressure="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=i(0,"torque","ft-klbf"),$=i(40,"torque","ft-klbf"),h(T.torque_at_max_operating_differential_pressure,Z,$)||(B.torque_at_max_operating_differential_pressure="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),h(T.flow_loss_percentage,0,20)||(B.flow_loss_percentage="It must be ".concat(0,"~").concat(20),p=!0)}m.components[T.id]=B}return 1!==u.length&&(m.general.bit_count='Number of "BIT" components is invalid.',p=!0),1===u.length&&"bit"!==l[l.length-1].family&&"bit"!==l[0].family&&(m.general.bit_position='"BIT" category should be on the bottom of the list.',p=!0),p?m:null}function m(e){var r=o(e,["data","components"]);"bit"===o(r,[0,"family"])&&(r=r.reverse().map((function(e,t){return l(l({},e),{},{order:t})})),e=n(e,["data","components"],r));var i=e.toJS().data,s=i.start_timestamp_str&&t(new Date(i.start_timestamp_str));return s&&s.isValid()&&(i.start_timestamp=s.unix()),delete i.start_timestamp_str,i.start_depth=u(i.start_depth,"length","ft"),i.components=i.components.map((function(e){var t=Object.assign({},e);if(t.inner_diameter=u(t.inner_diameter,"shortLength","in"),t.outer_diameter=u(t.outer_diameter,"shortLength","in",4),t.linear_weight=u(t.linear_weight,"massPerLength","lb-ft"),t.weight=u(t.weight,"mass","lb"),t.length=u(t.length,"length","ft"),t.component_length=u(t.component_length,"length","ft"),t.outer_diameter_tooljoint=u(t.outer_diameter_tooljoint,"shortLength","in"),t.inner_diameter_tooljoint=u(t.inner_diameter_tooljoint,"shortLength","in"),t.length_tooljoint=u(t.length_tooljoint,"length","ft"),"bit"===t.family||"ur"===t.family){var r=u(1,"shortLength","in");if(t.size=u(t.size,"shortLength","in",3),t.nozzle_sizes&&t.nozzle_sizes.length>0)for(var i=0;i<t.nozzle_sizes.length;i+=1){var s=t.nozzle_sizes[i];s.size=1!==r?32*u(s.size,"shortLength","in"):s.size}t.tfa=1!==r?t.tfa*(r*r):t.tfa}if("pdm"===t.family){if(t.max_weight_on_bit=u(t.max_weight_on_bit,"force","klbf"),t.min_standard_flowrate=u(t.min_standard_flowrate,"volumeFlowRate","gal/min"),t.max_standard_flowrate=u(t.max_standard_flowrate,"volumeFlowRate","gal/min"),t.max_operating_differential_pressure=u(t.max_operating_differential_pressure,"pressure","psi"),t.torque_at_max_operating_differential_pressure=u(t.torque_at_max_operating_differential_pressure,"torque","ft-klbf",3),t.rpg=u(t.rpg,"revolutionPerVolume","rpg"),t.off_bottom_pressure_loss&&t.off_bottom_pressure_loss.length>0)for(var o=0;o<t.off_bottom_pressure_loss.length;o+=1){var n=t.off_bottom_pressure_loss[o];n.flow_rate=u(n.flow_rate,"volumeFlowRate","gal/min"),n.pressure_loss=u(n.pressure_loss,"pressure","psi")}t.has_stabilizer||delete t.stabilizer,t.stabilizer&&(t.stabilizer.inner_diameter=t.stabilizer.inner_diameter&&u(t.stabilizer.inner_diameter,"shortLength","in"),t.stabilizer.outer_diameter=t.stabilizer.outer_diameter&&u(t.stabilizer.outer_diameter,"shortLength","in"),t.stabilizer.linear_weight=t.stabilizer.linear_weight&&u(t.stabilizer.linear_weight,"massPerLength","lb-ft"),t.stabilizer.weight=t.stabilizer.weight&&u(t.stabilizer.weight,"mass","lb"),t.stabilizer.length=t.length&&u(t.stabilizer.length,"length","ft"),t.stabilizer.gauge_od=t.stabilizer.gauge_od&&u(t.stabilizer.gauge_od,"shortLength","in"),t.stabilizer.gauge_length=t.stabilizer.gauge_length&&u(t.stabilizer.gauge_length,"shortLength","in"),t.stabilizer.blade_width=t.stabilizer.blade_width&&u(t.stabilizer.blade_width,"shortLength","in"),t.stabilizer.stab_centerpoint_to_bit=t.stabilizer.stab_centerpoint_to_bit&&u(t.stabilizer.stab_centerpoint_to_bit,"length","ft"))}if("stabilizer"===t.family&&(t.gauge_od=u(t.gauge_od,"shortLength","in"),t.gauge_length=u(t.gauge_length,"shortLength","in"),t.blade_width=u(t.blade_width,"shortLength","in")),("mwd"===t.family||"rss"===t.family||"agitator"===t.family)&&t.pressure_loss&&t.pressure_loss.length>0)for(var a=0;a<t.pressure_loss.length;a+=1){var l=t.pressure_loss[a];l.flow_rate=u(l.flow_rate,"volumeFlowRate","gal/min"),l.pressure_loss=u(l.pressure_loss,"pressure","psi")}return"bit"!==t.family&&delete t.bit_type,!t.has_gamma_sensor&&Number.isFinite(t.gamma_sensor_to_bit_distance)&&delete t.gamma_sensor_to_bit_distance,!t.has_survey_sensor&&Number.isFinite(t.bit_to_survey_distance)&&delete t.bit_to_survey_distance,!t.has_directional_sensor&&Number.isFinite(t.directional_sensor_to_bit_distance)&&delete t.directional_sensor_to_bit_distance,delete t.c_length,t})),l(l({},e),{},{data:i})}function u(e,t,s){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return null==e?null:t&&s?parseFloat(i(e,t,r(t),s,o)):parseFloat(e)}function f(e){var t=e.toJS().data,r=t.components;if(t.start_depth=c(t.start_depth,"length","ft"),r.length>0)if("bit"===r[0].family){r[0].c_length=r[0].length||0;for(var i=1;i<r.length;i+=1)r[i].c_length=parseFloat(r[i-1].c_length)+parseFloat(r[i].length||0)}else{var s=r.length-1;r[s].c_length=r[s].length||0;for(var o=s-1;o>=0;o-=1)r[o].c_length=parseFloat(r[o+1].c_length)+parseFloat(r[o].length||0)}for(var n=0;n<r.length;n+=1){var a=r[n];if(a.inner_diameter=c(a.inner_diameter,"shortLength","in"),a.outer_diameter=c(a.outer_diameter,"shortLength","in",4),a.linear_weight=c(a.linear_weight,"massPerLength","lb-ft"),a.weight=c(a.weight,"mass","lb"),a.length=c(a.length,"length","ft"),a.component_length=c(a.component_length,"length","ft"),a.outer_diameter_tooljoint=c(a.outer_diameter_tooljoint,"shortLength","in"),a.inner_diameter_tooljoint=c(a.inner_diameter_tooljoint,"shortLength","in"),a.length_tooljoint=c(a.length_tooljoint,"length","ft"),a.c_length=c(a.c_length,"length","ft"),a.gamma_sensor_to_bit_distance=c(a.gamma_sensor_to_bit_distance,"length","ft"),"bit"===a.family||"ur"===a.family){var _=c(1,"shortLength","in");if(a.size=c(a.size,"shortLength","in"),a.nozzle_sizes&&a.nozzle_sizes.length>0)for(var h=0;h<a.nozzle_sizes.length;h+=1){var g=a.nozzle_sizes[h];g.size=1!==_?c(g.size,"shortLength","in")/32:g.size}a.tfa=1!==_?a.tfa*(_*_):a.tfa}if("pdm"===a.family){if(a.max_weight_on_bit=c(a.max_weight_on_bit,"force","klbf"),a.min_standard_flowrate=c(a.min_standard_flowrate,"volumeFlowRate","gal/min"),a.max_standard_flowrate=c(a.max_standard_flowrate,"volumeFlowRate","gal/min"),a.max_operating_differential_pressure=c(a.max_operating_differential_pressure,"pressure","psi"),a.torque_at_max_operating_differential_pressure=c(a.torque_at_max_operating_differential_pressure,"torque","ft-klbf",3),a.off_bottom_pressure_loss&&a.off_bottom_pressure_loss.length>0)for(var d=0;d<a.off_bottom_pressure_loss.length;d+=1){var m=a.off_bottom_pressure_loss[d];m.flow_rate=c(m.flow_rate,"volumeFlowRate","gal/min"),m.pressure_loss=c(m.pressure_loss,"pressure","psi")}a.rpg=c(a.rpg,"revolutionPerVolume","rpg"),a.has_stabilizer&&a.stabilizer&&(a.stabilizer.inner_diameter=c(a.stabilizer.inner_diameter,"shortLength","in"),a.stabilizer.outer_diameter=c(a.stabilizer.outer_diameter,"shortLength","in"),a.stabilizer.linear_weight=c(a.stabilizer.linear_weight,"massPerLength","lb-ft"),a.stabilizer.weight=c(a.stabilizer.weight,"mass","lb"),a.stabilizer.length=c(a.stabilizer.length,"length","ft"),a.stabilizer.gauge_od=c(a.stabilizer.gauge_od,"shortLength","in"),a.stabilizer.gauge_length=c(a.stabilizer.gauge_length,"shortLength","in"),a.stabilizer.blade_width=c(a.stabilizer.blade_width,"shortLength","in"),a.stabilizer.stab_centerpoint_to_bit=c(a.stabilizer.stab_centerpoint_to_bit,"length","ft"))}if("stabilizer"===a.family&&(a.gauge_od=c(a.gauge_od,"shortLength","in"),a.gauge_length=c(a.gauge_length,"shortLength","in"),a.blade_width=c(a.blade_width,"shortLength","in")),("mwd"===a.family||"rss"===a.family||"agitator"===a.family)&&a.pressure_loss&&a.pressure_loss.length>0)for(var u=0;u<a.pressure_loss.length;u+=1){var f=a.pressure_loss[u];f.flow_rate=c(f.flow_rate,"volumeFlowRate","gal/min"),f.pressure_loss=c(f.pressure_loss,"pressure","psi")}}return l(l({},e),{},{data:t})}function c(e,t,r){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return 0===e||e?t&&r?i(e,t,r,null,s):e:null}export{m as convertRecordBackToImperialUnit,f as convertRecordtoPrefUnit,u as ctoi,c as ctop,g as isValidLinearWeight,h as isValidNumber,_ as sValueEmpty,d as validate};
1
+ import e from"@babel/runtime/helpers/defineProperty";import{getUnitPreference as t,convertValue as r,getUnitDisplay as i}from"./convert.js";import s from"moment";import o from"lodash/get";import n from"lodash/set";function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function l(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?a(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function _(e){return null==e||""===e}function h(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=i.isMinInclusive,o=void 0===s||s,n=parseFloat(e);return!Number.isNaN(n)&&(!(o&&n<t||!o&&n<=t)&&!(r&&n>r))}function g(e,i,s){var o=t("shortLength"),n=e,a=i;"in"!==o&&(n=r(e,"shortLength",o,"in"),a=r(i,"shortLength",o,"in"));var l=2.673*(a*a-n*n),_="in"!==o?r(l,"massPerLength","lb-ft"):l;return s>=.5*_&&s<=1.5*_}function d(e){var t=e.toJS().data,o=t.id,n=t.start_timestamp_str,a=t.start_depth,l=t.components,_=i("shortLength"),d=i("length"),m={general:{},components:{},specificErrors:{}},u=l.filter((function(e){return"bit"===e.family})),f=u.length>0?u[0].size:null,b=l.filter((function(e){return"mwd"===e.family&&e.has_gamma_sensor})),p=!1;if(isValueEmpty(o)&&(m.id="It should not be empty.",p=!0),n&&!s(new Date(n)).isValid()&&(p=!0,m.start_timestamp="Invalid Date."),Number.isFinite(a)){var v=r(0,"length","ft"),z=r(55e3,"length","ft"),w=r(1,"length","ft");(a<=v||a>z)&&(p=!0,m.start_depth="Should be a positive number ".concat(v.toFixed(2),"~").concat(z.toFixed(2)," (").concat(d,")")),a===w&&(p=!0,m.start_depth="Should not be equal to ".concat(w," (").concat(d,")"))}else p=!0,m.start_depth="It should not be empty.";for(var L=0;L<l.length;L+=1){var y=void 0,x=void 0,F=void 0,j=void 0,I=void 0,O=void 0,V=void 0,E=void 0,q=void 0,k=void 0,D=void 0,P=void 0,S=void 0,N=void 0,R=void 0,T=l[L],B={};switch(T.family){case"ct":y=r(0,"shortLength","in"),F=r(100,"shortLength","in"),x=r(1,"shortLength","in"),j=r(100,"shortLength","in"),N=r(0,"shortLength","in"),R=r(500,"shortLength","in"),V=r(0,"length","ft");break;case"dp":case"hwdp":y=r(1,"shortLength","in"),F=r(7,"shortLength","in"),x=r(2,"shortLength","in"),j=r(8,"shortLength","in"),E=r(1,"shortLength","in"),q=r(7,"shortLength","in"),k=r(2,"shortLength","in"),D=r(10,"shortLength","in"),V=r(0,"length","ft");break;case"dc":y=r(.5,"shortLength","in"),F=r(7,"shortLength","in"),x=r(2,"shortLength","in"),j=r(13,"shortLength","in"),V=r(0,"length","ft");break;case"stabilizer":y=r(0,"shortLength","in"),F=r(100,"shortLength","in"),x=r(1,"shortLength","in"),j=r(100,"shortLength","in"),V=r(0,"length","ft");break;case"pdm":x=r(2,"shortLength","in"),j=r(15,"shortLength","in"),y=r(0,"shortLength","in"),F=r(12,"shortLength","in"),V=r(4,"length","ft"),S=0;break;case"mwd":case"agitator":case"rss":x=r(2,"shortLength","in"),j=r(13,"shortLength","in"),y=r(0,"shortLength","in"),F=r(12,"shortLength","in"),V=r(1,"length","ft"),P=0;break;case"ur":y=r(0,"shortLength","in"),F=r(50,"shortLength","in"),x=r(1,"shortLength","in"),j=r(50,"shortLength","in"),I=r(1,"shortLength","in"),O=r(50,"shortLength","in");break;case"bit":break;default:y=r(0,"shortLength","in"),F=r(100,"shortLength","in"),x=r(1,"shortLength","in"),j=r(100,"shortLength","in"),V=r(0,"length","ft")}if(isValueEmpty(y)||isValueEmpty(x)||(h(T.inner_diameter,y,F)||(B.inner_diameter="".concat(y.toFixed(1),"~").concat(F.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter,x,j)||(B.outer_diameter="".concat(x.toFixed(1),"~").concat(j.toFixed(1)," (").concat(_,")"),p=!0),h(T.inner_diameter,y,F)&&h(T.outer_diameter,x,j)&&!h(T.inner_diameter,y,T.outer_diameter)&&(B.outer_diameter="O.D > I.D",p=!0),!B.outer_diameter&&f&&+T.outer_diameter+r(.1,"shortLength","in")>f&&(B.outer_diameter=" O.D + 0.1 < Bit Size",p=!0),h(T.linear_weight,0)||(B.linear_weight="Invalid value",p=!0),"dp"!==T.family&&"hwdp"!==T.family&&"dc"!==T.family&&"ct"!==T.family&&"ur"!==T.family||B.inner_diameter||B.outer_diameter||B.linear_weight||g(T.inner_diameter,T.outer_diameter,T.linear_weight)||(B.linear_weight="Invalid range",p=!0)),"ur"===T.family&&(h(T.ur_opened_od,I,O)?T.ur_opened_od<f&&(B.ur_opened_od="Max O.D (Opened) >= Bit Size",p=!0):(B.ur_opened_od="".concat(I.toFixed(1),"~").concat(O.toFixed(1)," (").concat(_,")"),p=!0)),isValueEmpty(E)||isValueEmpty(k)||(h(T.inner_diameter_tooljoint,E,q)||(B.inner_diameter_tooljoint="".concat(E.toFixed(1),"~").concat(q.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter_tooljoint,k,D)||(B.outer_diameter_tooljoint="".concat(k.toFixed(1),"~").concat(D.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter_tooljoint,T.outer_diameter,D)||(B.outer_diameter_tooljoint="Tool Joint O.D >= O.D",p=!0)),isValueEmpty(V)||h(T.length,V)||(B.length="Invalid value",p=!0),isValueEmpty(T.length_tooljoint)||isValueEmpty(T.component_length)||+T.length_tooljoint>+T.component_length&&(B.length_tooljoint="Tool Joint Length < Component Length",p=!0),T.off_bottom_pressure_loss&&T.off_bottom_pressure_loss.length>0){B.off_bottom_pressure_loss={};for(var J=0;J<T.off_bottom_pressure_loss.length;J+=1){var M=T.off_bottom_pressure_loss[J];B.off_bottom_pressure_loss[J]={},isValueEmpty(M.flow_rate)&&(B.off_bottom_pressure_loss[J].flow_rate="flow rate is required.",p=!0),isValueEmpty(M.pressure_loss)&&(B.off_bottom_pressure_loss[J].pressure_loss="pressure loss is required.",p=!0),isValueEmpty(S)||h(M.pressure_loss,S,null,{isMinInclusive:!1})||(B.off_bottom_pressure_loss[J].pressure_loss="Invalid range",p=!0)}}if(T.pressure_loss&&T.pressure_loss.length>0){B.pressure_loss={};for(var C=0;C<T.pressure_loss.length;C+=1){var A=T.pressure_loss[C];B.pressure_loss[C]={},isValueEmpty(A.flow_rate)&&(B.pressure_loss[C].flow_rate="flow rate is required.",p=!0),isValueEmpty(A.pressure_loss)&&(B.pressure_loss[C].pressure_loss="pressure loss is required.",p=!0),isValueEmpty(P)||h(A.pressure_loss,P,null,{isMinInclusive:!1})||(B.pressure_loss[C].pressure_loss="Invalid range",p=!0)}}if(T.has_stabilizer&&T.stabilizer){var G=r(0,"shortLength","in"),H=r(100,"shortLength","in"),K=r(1,"shortLength","in"),Q=r(100,"shortLength","in"),U=r(0,"length","ft");h(T.stabilizer.inner_diameter,G,H)&&h(T.stabilizer.outer_diameter,K,Q)&&!h(T.stabilizer.inner_diameter,y,T.stabilizer.outer_diameter)&&(B.stabilizer_outer_diameter="O.D > I.D",p=!0),h(T.stabilizer.inner_diameter,G,H)||(B.stabilizer_inner_diameter="".concat(G.toFixed(1),"~").concat(H.toFixed(1)," (").concat(_,")"),p=!0),h(T.stabilizer.outer_diameter,K,Q)||(B.stabilizer_outer_diameter="".concat(K.toFixed(1),"~").concat(Q.toFixed(1)," (").concat(_,")"),p=!0),isValueEmpty(U)||h(T.stabilizer.length,U)||(B.stabilizer_length="Invalid value",p=!0),isValueEmpty(T.stabilizer.linear_weight)&&(B.stabilizer_linear_weight="Invalid value",p=!0),!B.stabilizer_outer_diameter&&f&&+T.stabilizer.outer_diameter+r(.1,"shortLength","in")>f&&(B.stabilizer_outer_diameter=" O.D + 0.1 < Bit Size",p=!0)}if("ct"===T.family&&(h(T.reel_diameter,N,R)||(B.reel_diameter="".concat(N.toFixed(1),"~").concat(R.toFixed(1)," (").concat(_,")"),p=!0)),"bit"===T.family){var W=c(1,"shortLength","in"),X=W*W*0,Y=W*W*20;h(T.tfa,X,Y)||(B.tfa="TFA must be ".concat(X.toFixed(2),"~").concat(20..toFixed(2)),p=!0)}if("rss"===T.family&&(h(T.flow_loss_percentage,0,10)||(B.flow_loss_percentage="It must be ".concat(0,"~").concat(10),p=!0)),"mwd"===T.family&&(b.length>1?(B.gamma_sensor_to_bit_distance="Only 1 gamma sensor allowed. Currently ".concat(b.length),p=!0):T.has_gamma_sensor&&!Number.isFinite(T.gamma_sensor_to_bit_distance)&&(B.gamma_sensor_to_bit_distance="This field is required.",p=!0),T.has_survey_sensor&&!Number.isFinite(T.bit_to_survey_distance)?(B.bit_to_survey_distance="This field is required.",p=!0):T.has_survey_sensor&&T.bit_to_survey_distance<=0?(B.bit_to_survey_distance="Should be a positive number.",p=!0):T.has_survey_sensor&&T.bit_to_survey_distance>150&&(B.bit_to_survey_distance="Should be less then 150.",p=!0),T.has_directional_sensor&&!Number.isFinite(T.directional_sensor_to_bit_distance)?(B.directional_sensor_to_bit_distance="This field is required.",p=!0):T.has_directional_sensor&&T.directional_sensor_to_bit_distance<=0?(B.directional_sensor_to_bit_distance="Should be a positive number.",p=!0):T.has_directional_sensor&&T.directional_sensor_to_bit_distance>150&&(B.directional_sensor_to_bit_distance="Should be less then 150.",p=!0)),"pdm"===T.family){var Z=void 0,$=void 0;h(T.number_rotor_lobes,1,10)||(B.number_rotor_lobes="It must be ".concat(1,"~").concat(10),p=!0),h(T.number_stator_lobes,2,10)||(B.number_stator_lobes="It must be ".concat(2,"~").concat(10),p=!0),h(T.rpg,0,10)||(B.rpg="It must be ".concat(0,"~").concat(10),p=!0),Z=r(0,"force","klbf"),$=r(200,"force","klbf"),isValueEmpty(T.max_weight_on_bit)||h(T.max_weight_on_bit,Z,$)||(B.max_weight_on_bit="It must be ".concat($.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=r(0,"volumeFlowRate","gal/min"),$=r(2500,"volumeFlowRate","gal/min"),h(T.min_standard_flowrate,Z,$)||(B.min_standard_flowrate="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),h(T.max_standard_flowrate,Z,$)||(B.max_standard_flowrate="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=r(0,"pressure","psi"),$=r(3e3,"pressure","psi"),h(T.max_operating_differential_pressure,Z,$)||(B.max_operating_differential_pressure="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=r(0,"torque","ft-klbf"),$=r(40,"torque","ft-klbf"),h(T.torque_at_max_operating_differential_pressure,Z,$)||(B.torque_at_max_operating_differential_pressure="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),h(T.flow_loss_percentage,0,20)||(B.flow_loss_percentage="It must be ".concat(0,"~").concat(20),p=!0)}m.components[T.id]=B}return 1!==u.length&&(m.general.bit_count='Number of "BIT" components is invalid.',p=!0),1===u.length&&"bit"!==l[l.length-1].family&&"bit"!==l[0].family&&(m.general.bit_position='"BIT" category should be on the bottom of the list.',p=!0),p?m:null}function m(e){var t=o(e,["data","components"]);"bit"===o(t,[0,"family"])&&(t=t.reverse().map((function(e,t){return l(l({},e),{},{order:t})})),e=n(e,["data","components"],t));var r=e.toJS().data,i=r.start_timestamp_str&&s(new Date(r.start_timestamp_str));return i&&i.isValid()&&(r.start_timestamp=i.unix()),delete r.start_timestamp_str,r.start_depth=u(r.start_depth,"length","ft"),r.components=r.components.map((function(e){var t=Object.assign({},e);if(t.inner_diameter=u(t.inner_diameter,"shortLength","in"),t.outer_diameter=u(t.outer_diameter,"shortLength","in",4),t.linear_weight=u(t.linear_weight,"massPerLength","lb-ft"),t.weight=u(t.weight,"mass","lb"),t.length=u(t.length,"length","ft"),t.component_length=u(t.component_length,"length","ft"),t.outer_diameter_tooljoint=u(t.outer_diameter_tooljoint,"shortLength","in"),t.inner_diameter_tooljoint=u(t.inner_diameter_tooljoint,"shortLength","in"),t.length_tooljoint=u(t.length_tooljoint,"length","ft"),"bit"===t.family||"ur"===t.family){var r=u(1,"shortLength","in");if(t.size=u(t.size,"shortLength","in",3),t.nozzle_sizes&&t.nozzle_sizes.length>0)for(var i=0;i<t.nozzle_sizes.length;i+=1){var s=t.nozzle_sizes[i];s.size=1!==r?32*u(s.size,"shortLength","in"):s.size}t.tfa=1!==r?t.tfa*(r*r):t.tfa}if("pdm"===t.family){if(t.max_weight_on_bit=u(t.max_weight_on_bit,"force","klbf"),t.min_standard_flowrate=u(t.min_standard_flowrate,"volumeFlowRate","gal/min"),t.max_standard_flowrate=u(t.max_standard_flowrate,"volumeFlowRate","gal/min"),t.max_operating_differential_pressure=u(t.max_operating_differential_pressure,"pressure","psi"),t.torque_at_max_operating_differential_pressure=u(t.torque_at_max_operating_differential_pressure,"torque","ft-klbf",3),t.rpg=u(t.rpg,"revolutionPerVolume","rpg"),t.off_bottom_pressure_loss&&t.off_bottom_pressure_loss.length>0)for(var o=0;o<t.off_bottom_pressure_loss.length;o+=1){var n=t.off_bottom_pressure_loss[o];n.flow_rate=u(n.flow_rate,"volumeFlowRate","gal/min"),n.pressure_loss=u(n.pressure_loss,"pressure","psi")}t.has_stabilizer||delete t.stabilizer,t.stabilizer&&(t.stabilizer.inner_diameter=t.stabilizer.inner_diameter&&u(t.stabilizer.inner_diameter,"shortLength","in"),t.stabilizer.outer_diameter=t.stabilizer.outer_diameter&&u(t.stabilizer.outer_diameter,"shortLength","in"),t.stabilizer.linear_weight=t.stabilizer.linear_weight&&u(t.stabilizer.linear_weight,"massPerLength","lb-ft"),t.stabilizer.weight=t.stabilizer.weight&&u(t.stabilizer.weight,"mass","lb"),t.stabilizer.length=t.length&&u(t.stabilizer.length,"length","ft"),t.stabilizer.gauge_od=t.stabilizer.gauge_od&&u(t.stabilizer.gauge_od,"shortLength","in"),t.stabilizer.gauge_length=t.stabilizer.gauge_length&&u(t.stabilizer.gauge_length,"shortLength","in"),t.stabilizer.blade_width=t.stabilizer.blade_width&&u(t.stabilizer.blade_width,"shortLength","in"),t.stabilizer.stab_centerpoint_to_bit=t.stabilizer.stab_centerpoint_to_bit&&u(t.stabilizer.stab_centerpoint_to_bit,"length","ft"))}if("stabilizer"===t.family&&(t.gauge_od=u(t.gauge_od,"shortLength","in"),t.gauge_length=u(t.gauge_length,"shortLength","in"),t.blade_width=u(t.blade_width,"shortLength","in")),("mwd"===t.family||"rss"===t.family||"agitator"===t.family)&&t.pressure_loss&&t.pressure_loss.length>0)for(var a=0;a<t.pressure_loss.length;a+=1){var l=t.pressure_loss[a];l.flow_rate=u(l.flow_rate,"volumeFlowRate","gal/min"),l.pressure_loss=u(l.pressure_loss,"pressure","psi")}return"bit"!==t.family&&delete t.bit_type,!t.has_gamma_sensor&&Number.isFinite(t.gamma_sensor_to_bit_distance)&&delete t.gamma_sensor_to_bit_distance,!t.has_survey_sensor&&Number.isFinite(t.bit_to_survey_distance)&&delete t.bit_to_survey_distance,!t.has_directional_sensor&&Number.isFinite(t.directional_sensor_to_bit_distance)&&delete t.directional_sensor_to_bit_distance,delete t.c_length,t})),l(l({},e),{},{data:r})}function u(e,i,s){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return null==e?null:i&&s?parseFloat(r(e,i,t(i),s,o)):parseFloat(e)}function f(e){var t=e.toJS().data,r=t.components;if(t.start_depth=c(t.start_depth,"length","ft"),r.length>0)if("bit"===r[0].family){r[0].c_length=r[0].length||0;for(var i=1;i<r.length;i+=1)r[i].c_length=parseFloat(r[i-1].c_length)+parseFloat(r[i].length||0)}else{var s=r.length-1;r[s].c_length=r[s].length||0;for(var o=s-1;o>=0;o-=1)r[o].c_length=parseFloat(r[o+1].c_length)+parseFloat(r[o].length||0)}for(var n=0;n<r.length;n+=1){var a=r[n];if(a.inner_diameter=c(a.inner_diameter,"shortLength","in"),a.outer_diameter=c(a.outer_diameter,"shortLength","in",4),a.linear_weight=c(a.linear_weight,"massPerLength","lb-ft"),a.weight=c(a.weight,"mass","lb"),a.length=c(a.length,"length","ft"),a.component_length=c(a.component_length,"length","ft"),a.outer_diameter_tooljoint=c(a.outer_diameter_tooljoint,"shortLength","in"),a.inner_diameter_tooljoint=c(a.inner_diameter_tooljoint,"shortLength","in"),a.length_tooljoint=c(a.length_tooljoint,"length","ft"),a.c_length=c(a.c_length,"length","ft"),a.gamma_sensor_to_bit_distance=c(a.gamma_sensor_to_bit_distance,"length","ft"),"bit"===a.family||"ur"===a.family){var _=c(1,"shortLength","in");if(a.size=c(a.size,"shortLength","in"),a.nozzle_sizes&&a.nozzle_sizes.length>0)for(var h=0;h<a.nozzle_sizes.length;h+=1){var g=a.nozzle_sizes[h];g.size=1!==_?c(g.size,"shortLength","in")/32:g.size}a.tfa=1!==_?a.tfa*(_*_):a.tfa}if("pdm"===a.family){if(a.max_weight_on_bit=c(a.max_weight_on_bit,"force","klbf"),a.min_standard_flowrate=c(a.min_standard_flowrate,"volumeFlowRate","gal/min"),a.max_standard_flowrate=c(a.max_standard_flowrate,"volumeFlowRate","gal/min"),a.max_operating_differential_pressure=c(a.max_operating_differential_pressure,"pressure","psi"),a.torque_at_max_operating_differential_pressure=c(a.torque_at_max_operating_differential_pressure,"torque","ft-klbf",3),a.off_bottom_pressure_loss&&a.off_bottom_pressure_loss.length>0)for(var d=0;d<a.off_bottom_pressure_loss.length;d+=1){var m=a.off_bottom_pressure_loss[d];m.flow_rate=c(m.flow_rate,"volumeFlowRate","gal/min"),m.pressure_loss=c(m.pressure_loss,"pressure","psi")}a.rpg=c(a.rpg,"revolutionPerVolume","rpg"),a.has_stabilizer&&a.stabilizer&&(a.stabilizer.inner_diameter=c(a.stabilizer.inner_diameter,"shortLength","in"),a.stabilizer.outer_diameter=c(a.stabilizer.outer_diameter,"shortLength","in"),a.stabilizer.linear_weight=c(a.stabilizer.linear_weight,"massPerLength","lb-ft"),a.stabilizer.weight=c(a.stabilizer.weight,"mass","lb"),a.stabilizer.length=c(a.stabilizer.length,"length","ft"),a.stabilizer.gauge_od=c(a.stabilizer.gauge_od,"shortLength","in"),a.stabilizer.gauge_length=c(a.stabilizer.gauge_length,"shortLength","in"),a.stabilizer.blade_width=c(a.stabilizer.blade_width,"shortLength","in"),a.stabilizer.stab_centerpoint_to_bit=c(a.stabilizer.stab_centerpoint_to_bit,"length","ft"))}if("stabilizer"===a.family&&(a.gauge_od=c(a.gauge_od,"shortLength","in"),a.gauge_length=c(a.gauge_length,"shortLength","in"),a.blade_width=c(a.blade_width,"shortLength","in")),("mwd"===a.family||"rss"===a.family||"agitator"===a.family)&&a.pressure_loss&&a.pressure_loss.length>0)for(var u=0;u<a.pressure_loss.length;u+=1){var f=a.pressure_loss[u];f.flow_rate=c(f.flow_rate,"volumeFlowRate","gal/min"),f.pressure_loss=c(f.pressure_loss,"pressure","psi")}}return l(l({},e),{},{data:t})}function c(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return 0===e||e?t&&i?r(e,t,i,null,s):e:null}export{m as convertRecordBackToImperialUnit,f as convertRecordtoPrefUnit,u as ctoi,c as ctop,g as isValidLinearWeight,h as isValidNumber,_ as sValueEmpty,d as validate};
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import i from"moment";import{convertValue as r,getUnitPreference as e}from"./convert.js";import s from"lodash/get";import a from"lodash/isNumber";function n(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);i&&(e=e.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,e)}return r}function o(i){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach((function(r){t(i,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach((function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(e,t))}))}return i}function d(t){return 0!==t&&!t}function p(t,i,r,e){return this.isValueEmpty(t)?!!e:a(t)&&t>i&&t<r}function c(t,i,e){return a(t)?i&&e?parseFloat(r(t,i,e)):parseFloat(t):null}function u(t,i,s){return a(t)?i&&s?r(t,i,e(i),s):parseFloat(t):null}function l(t){var i=this.ctop(s(t,["data","mud_density"]),"density","ppg"),r=this.ctop(s(t,["data","depth"]),"length","ft"),e=this.ctop(s(t,["data","viscosity","yp"]),"yp","hsf");return o(o({},t),{},{data:o(o({},t.data),{},{mud_density:i,depth:r,viscosity:o(o({},t.data.viscosity),{},{yp:e})})})}function y(t){var i=this.ctoi(s(t,["data","mud_density"]),"density","ppg"),r=this.ctoi(s(t,["data","depth"]),"length","ft"),e=this.ctoi(s(t,["data","viscosity","yp"]),"yp","hsf");return o(o({},t),{},{data:o(o({},t.data),{},{mud_density:i,depth:r,viscosity:o(o({},t.data.viscosity),{},{yp:e}),date_str:null})})}function h(t){var r=t.data,e=r.date_str,s=r.mud_density,a=r.viscosity,n=a.pv,o=a.yp,d=a.rpm_readings,p=!1,c={viscosity:{rpm_readings:[]}};e&&!i(new Date(e)).isValid()&&(p=!0,c.date="Invalid Date.");var u=this.ctop(5,"density","ppg"),l=this.ctop(20,"density","ppg");this.isValueValid(s,u,l,!1)||(p=!0,c.mud_density="It should be ".concat(u," ~ ").concat(l)),(this.isValueEmpty(n)||this.isValueEmpty(o))&&d.length<2&&(p=!0,c.viscosity.rpm_readings_required="At least 2 paris of rpm and dial_reading required."),this.isValueValid(n,0,200,!c.viscosity.rpm_readings_required)||(p=!0,c.viscosity.pv="It should be 0~200"),this.isValueValid(o,0,200,!c.viscosity.rpm_readings_required)||(p=!0,c.viscosity.yp="It should be 0~200");for(var y=[],h=0;h<d.length;h+=1){c.viscosity.rpm_readings[h]={};var m=c.viscosity.rpm_readings[h];this.isValueValid(d[h].rpm,0,1e3)||(p=!0,m.rpm="It should be 0~1000"),this.isValueValid(d[h].dial_reading,0,300)||(p=!0,m.dial_reading="It should be 0~300"),-1!==y.indexOf(d[h].rpm)&&(p=!0,m.rpm="Duplicated RPM value"),y.push(d[h].rpm),d[h].originalIndex=h}var f=d.sort((function(t,i){return t.rpm-i.rpm}));return f.forEach((function(t,i){var r=c.viscosity.rpm_readings[t.originalIndex];f[i-1]&&t.dial_reading<f[i-1].dial_reading&&(p=!0,r.dial_reading="Dial Readings should be in increasing order")})),{hasErrors:p,errors:c}}export{y as convertToImperialUnit,l as convertToPrefUnit,u as ctoi,c as ctop,d as isValueEmpty,p as isValueValid,h as validate};
1
+ import t from"@babel/runtime/helpers/defineProperty";import{convertValue as i,getUnitPreference as r}from"./convert.js";import e from"moment";import s from"lodash/get";import a from"lodash/isNumber";function n(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);i&&(e=e.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,e)}return r}function o(i){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach((function(r){t(i,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach((function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(e,t))}))}return i}function d(t){return 0!==t&&!t}function p(t,i,r,e){return this.isValueEmpty(t)?!!e:a(t)&&t>i&&t<r}function c(t,r,e){return a(t)?r&&e?parseFloat(i(t,r,e)):parseFloat(t):null}function u(t,e,s){return a(t)?e&&s?i(t,e,r(e),s):parseFloat(t):null}function l(t){var i=this.ctop(s(t,["data","mud_density"]),"density","ppg"),r=this.ctop(s(t,["data","depth"]),"length","ft"),e=this.ctop(s(t,["data","viscosity","yp"]),"yp","hsf");return o(o({},t),{},{data:o(o({},t.data),{},{mud_density:i,depth:r,viscosity:o(o({},t.data.viscosity),{},{yp:e})})})}function y(t){var i=this.ctoi(s(t,["data","mud_density"]),"density","ppg"),r=this.ctoi(s(t,["data","depth"]),"length","ft"),e=this.ctoi(s(t,["data","viscosity","yp"]),"yp","hsf");return o(o({},t),{},{data:o(o({},t.data),{},{mud_density:i,depth:r,viscosity:o(o({},t.data.viscosity),{},{yp:e}),date_str:null})})}function h(t){var i=t.data,r=i.date_str,s=i.mud_density,a=i.viscosity,n=a.pv,o=a.yp,d=a.rpm_readings,p=!1,c={viscosity:{rpm_readings:[]}};r&&!e(new Date(r)).isValid()&&(p=!0,c.date="Invalid Date.");var u=this.ctop(5,"density","ppg"),l=this.ctop(20,"density","ppg");this.isValueValid(s,u,l,!1)||(p=!0,c.mud_density="It should be ".concat(u," ~ ").concat(l)),(this.isValueEmpty(n)||this.isValueEmpty(o))&&d.length<2&&(p=!0,c.viscosity.rpm_readings_required="At least 2 paris of rpm and dial_reading required."),this.isValueValid(n,0,200,!c.viscosity.rpm_readings_required)||(p=!0,c.viscosity.pv="It should be 0~200"),this.isValueValid(o,0,200,!c.viscosity.rpm_readings_required)||(p=!0,c.viscosity.yp="It should be 0~200");for(var y=[],h=0;h<d.length;h+=1){c.viscosity.rpm_readings[h]={};var m=c.viscosity.rpm_readings[h];this.isValueValid(d[h].rpm,0,1e3)||(p=!0,m.rpm="It should be 0~1000"),this.isValueValid(d[h].dial_reading,0,300)||(p=!0,m.dial_reading="It should be 0~300"),-1!==y.indexOf(d[h].rpm)&&(p=!0,m.rpm="Duplicated RPM value"),y.push(d[h].rpm),d[h].originalIndex=h}var f=d.sort((function(t,i){return t.rpm-i.rpm}));return f.forEach((function(t,i){var r=c.viscosity.rpm_readings[t.originalIndex];f[i-1]&&t.dial_reading<f[i-1].dial_reading&&(p=!0,r.dial_reading="Dial Readings should be in increasing order")})),{hasErrors:p,errors:c}}export{y as convertToImperialUnit,l as convertToPrefUnit,u as ctoi,c as ctop,d as isValueEmpty,p as isValueValid,h as validate};
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import{STAGE_ACTUAL_PARAM_COLORS as e,PROPPANTS_TYPES as r,FLUIDS_TYPES as o,CHEMICALS_TYPES as n}from"../constants/completion.js";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function a(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?i(Object(o),!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var u=function(e,r){return e.reduce((function(e,r){var o=r.type,n=r.amount?parseFloat(r.amount):0,i=e[o]?e[o].amount+n:n;return a(a({},e),{},t({},o,{amount:i,unit_type:r.unit_type,unit:r.unit}))}),r)},p=function(t,e){return Number.isFinite(t)&&t?Number.isFinite(e)?Math.round(e/t*1e3)/10:0:"-"},f=function(t,i){var a;if("proppants"===t?a=r:"fluids"===t?a=o:"volumeChemicals"!==t&&"massChemicals"!==t||(a=n),a){var u=a.find((function(t){return t.name===i}));return u&&u.color}return e[t]},s=function(t,e,r){var o=e.data||{},n=o.fluids||[],i=o.chemicals||[],a=o.proppants||[],p=r.convertValue,f=p(Math.min(o.top_perforation,t.top_perforation),"length","ft"),s=p(Math.max(o.bottom_perforation,t.bottom_perforation),"length","ft"),l=p(t.perforated_length+o.perforated_length,"length","ft"),c=p(t.flush_volume+o.flush_volume,"oil","bbl");return{top_perforation:f,bottom_perforation:s,perforated_length:l,total_shots:t.total_shots+o.total_shots,flush_volume:c,chemicals:u(i,t.chemicals),proppants:u(a,t.proppants),fluids:u(n,t.fluids)}},l=function(t){return Number.isFinite(t)?Math.floor(t)===t?t.formatNumeral("0,0"):t.formatNumeral("0,0.0"):""},c=function(t){return!Number.isFinite(t)||Math.abs(t-100)>=10};export{u as getAggreElems,p as getDifference,f as getElemActualColor,l as getFormattedValue,s as getStageSummary,c as isGreaterThanTenPercent};
1
+ import t from"@babel/runtime/helpers/defineProperty";import{convertValue as r}from"./convert.js";import{STAGE_ACTUAL_PARAM_COLORS as e,PROPPANTS_TYPES as o,FLUIDS_TYPES as n,CHEMICALS_TYPES as i}from"../constants/completion.js";function a(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,o)}return e}function u(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?a(Object(o),!0).forEach((function(e){t(r,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(o,t))}))}return r}var p=function(r,e){return r.reduce((function(r,e){var o=e.type,n=e.amount?parseFloat(e.amount):0,i=r[o]?r[o].amount+n:n;return u(u({},r),{},t({},o,{amount:i,unit_type:e.unit_type,unit:e.unit}))}),e)},f=function(t,r){return Number.isFinite(t)&&t?Number.isFinite(r)?Math.round(r/t*1e3)/10:0:"-"},s=function(t,r){var a;if("proppants"===t?a=o:"fluids"===t?a=n:"volumeChemicals"!==t&&"massChemicals"!==t||(a=i),a){var u=a.find((function(t){return t.name===r}));return u&&u.color}return e[t]},c=function(t,e){var o=e.data||{},n=o.fluids||[],i=o.chemicals||[],a=o.proppants||[],u=r(Math.min(o.top_perforation,t.top_perforation),"length","ft"),f=r(Math.max(o.bottom_perforation,t.bottom_perforation),"length","ft"),s=r(t.perforated_length+o.perforated_length,"length","ft"),c=r(t.flush_volume+o.flush_volume,"oil","bbl");return{top_perforation:u,bottom_perforation:f,perforated_length:s,total_shots:t.total_shots+o.total_shots,flush_volume:c,chemicals:p(i,t.chemicals),proppants:p(a,t.proppants),fluids:p(n,t.fluids)}},l=function(t){return Number.isFinite(t)?Math.floor(t)===t?t.formatNumeral("0,0"):t.formatNumeral("0,0.0"):""},m=function(t){return!Number.isFinite(t)||Math.abs(t-100)>=10};export{p as getAggreElems,f as getDifference,s as getElemActualColor,l as getFormattedValue,m as getIsGreaterThanTenPercent,c as getStageSummary};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{COMPONENT_FAMILIES as t}from"../../constants/casing.js";import{convertValue as r}from"../convert.js";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(e){var r=t.find((function(t){return t.type===e}));return r?r.name:""}function c(e){for(var t=[],n=0,c=0;c<e.length;c+=1){var a=e[c],f=i(i({},a),{},{family_name:o(a.family),inner_diameter:r(a.inner_diameter,"shortLength","in"),outer_diameter:r(a.outer_diameter,"shortLength","in"),linear_weight:r(a.linear_weight,"massPerLength","lb-ft"),weight:r(a.linear_weight,"mass","lb"),length:r(a.linear_weight,"length","ft")});n+=f.length,f.cum_length=n,t.push(f)}return t}export{c as convertComponents,o as getFamilyName};
1
+ import e from"@babel/runtime/helpers/defineProperty";import{convertValue as t}from"../convert.js";import{COMPONENT_FAMILIES as r}from"../../constants/casing.js";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(e){var t=r.find((function(t){return t.type===e}));return t?t.name:""}function c(e){for(var r=[],n=0,c=0;c<e.length;c+=1){var a=e[c],f=i(i({},a),{},{family_name:o(a.family),inner_diameter:t(a.inner_diameter,"shortLength","in"),outer_diameter:t(a.outer_diameter,"shortLength","in"),linear_weight:t(a.linear_weight,"massPerLength","lb-ft"),weight:t(a.linear_weight,"mass","lb"),length:t(a.linear_weight,"length","ft")});n+=f.length,f.cum_length=n,r.push(f)}return r}export{c as convertComponents,o as getFamilyName};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"moment";import{MIN_ID as r,MAX_ID as n,MIN_OD as i,MAX_OD as o,MIN_TOP_DEPTH as a,MAX_TOP_DEPTH as h,MIN_BOTTOM_DEPTH as l,MAX_BOTTOM_DEPTH as m,DP_MIN_ID as s,DP_MIN_OD as u,DP_MAX_ID as _,DP_MAX_OD as d,DP_MIN_TJ_ID as g,DP_MIN_TJ_OD as p,DP_MAX_TJ_ID as f,DP_MAX_TJ_OD as c,DP_MIN_LENGTH as b,DP_MAX_LENGTH as j,HWDP_MIN_ID as O,HWDP_MIN_OD as F,HWDP_MAX_ID as w,HWDP_MAX_OD as y,HWDP_MIN_TJ_ID as L,HWDP_MIN_TJ_OD as v,HWDP_MAX_TJ_ID as D,HWDP_MAX_TJ_OD as I,HWDP_MIN_LENGTH as N,HWDP_MAX_LENGTH as P}from"../../constants/casing.js";import{getUnitDisplay as V,getUnitPreference as q,convertValue as k}from"../convert.js";function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?x(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S=V("shortLength"),T=V("length");function E(e,t,r,n){var i=r?e.toFixed(r):e,o=r?t.toFixed(r):t;return"".concat(i,"~").concat(o).concat(n?" (".concat(n,")"):"")}function J(e,t,r){return!(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(r))||(e<t||e>r)}function B(e,t){var r=q("shortLength"),n="in"!==r?k(e,"shortLength",r,"in"):e,i="in"!==r?k(t,"shortLength",r,"in"):t,o=2.673*(n*n-i*i);return"in"!==r?k(o,"massPerLength","lb-ft"):o}function C(e,t,r){var n=B(e,t);return r>=.5*n&&r<=1.5*n}function W(e){var t=function(e){return A(A({},e),{},{inner_diameter:parseFloat(e.inner_diameter),outer_diameter:parseFloat(e.outer_diameter),linear_weight:parseFloat(e.linear_weight),number_of_joints:parseFloat(e.number_of_joints),component_length:parseFloat(e.component_length),length:parseFloat(e.length),weight:parseFloat(e.weight),outer_diameter_tooljoint:parseFloat(e.outer_diameter_tooljoint),inner_diameter_tooljoint:parseFloat(e.inner_diameter_tooljoint),length_tooljoint:parseFloat(e.length_tooljoint)})}(e),r=A(A({},function(e){var t={};return Number.isFinite(e.inner_diameter)||(t.inner_diameter="It must be a number."),Number.isFinite(e.outer_diameter)||(t.outer_diameter="It must be a number."),Number.isFinite(e.linear_weight)||(t.linear_weight="It must be a number."),t.inner_diameter||t.outer_diameter||(e.outer_diameter<e.inner_diameter?t.outer_diameter="O.D > I.D":t.linear_weight||C(e.outer_diameter,e.inner_diameter,e.linear_weight)||(t.linear_weight="Invalid linear weight")),Number.isFinite(e.number_of_joints)||(t.number_of_joints="It must be a number."),Number.isFinite(e.component_length)||(t.component_length="It must be a number."),Number.isFinite(e.length)||(t.length="It must be a number."),Number.isFinite(e.weight)||(t.weight="It must be a number."),t}(t)),function(e){var t,r,n,i,o,a,h,l,m,V,q=e.family,x={};return"dp"!==q&&"hwdp"!==q||("dp"===q?(t=s,r=u,n=_,i=d,o=g,a=p,h=f,l=c,m=b,V=j):(t=O,r=F,n=w,i=y,o=L,a=v,h=D,l=I,m=N,V=P),t=k(t,"shortLength","in"),r=k(r,"shortLength","in"),n=k(n,"shortLength","in"),i=k(i,"shortLength","in"),o=k(o,"shortLength","in"),a=k(a,"shortLength","in"),h=k(h,"shortLength","in"),l=k(l,"shortLength","in"),m=k(m,"length","ft"),V=k(V,"length","ft"),J(e.inner_diameter,t,n)&&(x.inner_diameter=E(t,n,2,S)),J(e.outer_diameter,r,i)&&(x.outer_diameter=E(r,i,2,S)),J(e.inner_diameter_tooljoint,o,h)&&(x.inner_diameter_tooljoint=E(o,h,2,S)),J(e.outer_diameter_tooljoint,a,l)&&(x.outer_diameter_tooljoint=E(a,l,2,S)),J(e.length,m,V)&&(x.length=E(m,V,2,T)),!x.outer_diameter_tooljoint&&e.outer_diameter_tooljoint<e.outer_diameter&&(x.outer_diameter_tooljoint="Tool Joint O.D >= O.D"),e.length_tooljoint>e.component_length&&(x.length_tooljoint="Tool Joint Length < Component Length")),x}(t));return Object.keys(r).length>0?{isValid:!1,errors:r}:{isValid:!0}}function z(e,t){var r=[];if(t.length&&!e){var n=t.filter((function(e){return"casing_joints"===e.family})),i=t.filter((function(e){return"float_shoe"===e.family})),o=t[t.length-1],a=t[0];n.length<1&&r.push("At least one casing joints required."),0===i.length?r.push("At least one float shoe required."):i.length>1?r.push("Only one float shoe required."):"float_shoe"!==a.family&&"float_shoe"!==o.family&&r.push("Float Shoe should be on the bottom of the list")}if(e){var h=t.filter((function(e){return"riser"===e.family}));0===h.length?r.push("At least one riser required."):h.length>1&&r.push("Only one riser required.")}return r.length>0?{isValid:!1,errors:r}:{isValid:!0}}function G(e){var s=e.data,u={},_=k(r,"shortLength","in"),d=k(n,"shortLength","in"),g=k(i,"shortLength","in"),p=k(o,"shortLength","in"),f=k(a,"length","ft"),c=k(h,"length","ft"),b=k(l,"length","ft"),j=k(m,"length","ft");return s.start_timestamp&&!t(new Date(s.start_timestamp)).isValid()&&(u.start_timestamp="Invalid Date."),J(s.inner_diameter,_,d)&&(u.inner_diameter=E(_,d,2,S)),J(s.outer_diameter,g,p)&&(u.outer_diameter=E(g,p,2,S)),!u.inner_diameter&&!u.outer_diamter&&s.inner_diamter>s.outer_diameter&&(u.outer_diameter="O.D > I.D"),J(s.top_depth,f,c)&&(u.top_depth=E(f,c,2,T)),J(s.bottom_depth,b,j)&&(u.bottom_depth=E(b,j,2,T)),!u.top_depth&&!u.bottom_depth&&s.top_depth>s.bottom_depth&&(u.bottom_depth="Bottom Depth > Top Depth"),u.inner_diameter||u.outer_diameter||!C(s.outer_diameter,s.inner_diameter,s.linear_weight)||(u.linear_weight="Invalid Linear Weight"),Object.keys(u).length>0?{isValid:!1,errors:u}:{isValid:!0}}export{B as calculateLinearWeight,C as isValidLinearWeight,W as validateComponent,z as validateInterComponents,G as validateMainFields};
1
+ import e from"@babel/runtime/helpers/defineProperty";import{getUnitDisplay as t,getUnitPreference as r,convertValue as n}from"../convert.js";import i from"moment";import{MIN_ID as o,MAX_ID as a,MIN_OD as h,MAX_OD as l,MIN_TOP_DEPTH as m,MAX_TOP_DEPTH as s,MIN_BOTTOM_DEPTH as u,MAX_BOTTOM_DEPTH as _,DP_MIN_ID as d,DP_MIN_OD as g,DP_MAX_ID as p,DP_MAX_OD as f,DP_MIN_TJ_ID as c,DP_MIN_TJ_OD as b,DP_MAX_TJ_ID as j,DP_MAX_TJ_OD as O,DP_MIN_LENGTH as F,DP_MAX_LENGTH as w,HWDP_MIN_ID as y,HWDP_MIN_OD as L,HWDP_MAX_ID as v,HWDP_MAX_OD as D,HWDP_MIN_TJ_ID as I,HWDP_MIN_TJ_OD as N,HWDP_MAX_TJ_ID as P,HWDP_MAX_TJ_OD as V,HWDP_MIN_LENGTH as q,HWDP_MAX_LENGTH as k}from"../../constants/casing.js";function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?x(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S=t("shortLength"),T=t("length");function E(e,t,r,n){var i=r?e.toFixed(r):e,o=r?t.toFixed(r):t;return"".concat(i,"~").concat(o).concat(n?" (".concat(n,")"):"")}function J(e,t,r){return!(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(r))||(e<t||e>r)}function B(e,t){var i=r("shortLength"),o="in"!==i?n(e,"shortLength",i,"in"):e,a="in"!==i?n(t,"shortLength",i,"in"):t,h=2.673*(o*o-a*a);return"in"!==i?n(h,"massPerLength","lb-ft"):h}function C(e,t,r){var n=B(e,t);return r>=.5*n&&r<=1.5*n}function W(e){var t=function(e){return A(A({},e),{},{inner_diameter:parseFloat(e.inner_diameter),outer_diameter:parseFloat(e.outer_diameter),linear_weight:parseFloat(e.linear_weight),number_of_joints:parseFloat(e.number_of_joints),component_length:parseFloat(e.component_length),length:parseFloat(e.length),weight:parseFloat(e.weight),outer_diameter_tooljoint:parseFloat(e.outer_diameter_tooljoint),inner_diameter_tooljoint:parseFloat(e.inner_diameter_tooljoint),length_tooljoint:parseFloat(e.length_tooljoint)})}(e),r=A(A({},function(e){var t={};return Number.isFinite(e.inner_diameter)||(t.inner_diameter="It must be a number."),Number.isFinite(e.outer_diameter)||(t.outer_diameter="It must be a number."),Number.isFinite(e.linear_weight)||(t.linear_weight="It must be a number."),t.inner_diameter||t.outer_diameter||(e.outer_diameter<e.inner_diameter?t.outer_diameter="O.D > I.D":t.linear_weight||C(e.outer_diameter,e.inner_diameter,e.linear_weight)||(t.linear_weight="Invalid linear weight")),Number.isFinite(e.number_of_joints)||(t.number_of_joints="It must be a number."),Number.isFinite(e.component_length)||(t.component_length="It must be a number."),Number.isFinite(e.length)||(t.length="It must be a number."),Number.isFinite(e.weight)||(t.weight="It must be a number."),t}(t)),function(e){var t,r,i,o,a,h,l,m,s,u,_=e.family,x={};return"dp"!==_&&"hwdp"!==_||("dp"===_?(t=d,r=g,i=p,o=f,a=c,h=b,l=j,m=O,s=F,u=w):(t=y,r=L,i=v,o=D,a=I,h=N,l=P,m=V,s=q,u=k),t=n(t,"shortLength","in"),r=n(r,"shortLength","in"),i=n(i,"shortLength","in"),o=n(o,"shortLength","in"),a=n(a,"shortLength","in"),h=n(h,"shortLength","in"),l=n(l,"shortLength","in"),m=n(m,"shortLength","in"),s=n(s,"length","ft"),u=n(u,"length","ft"),J(e.inner_diameter,t,i)&&(x.inner_diameter=E(t,i,2,S)),J(e.outer_diameter,r,o)&&(x.outer_diameter=E(r,o,2,S)),J(e.inner_diameter_tooljoint,a,l)&&(x.inner_diameter_tooljoint=E(a,l,2,S)),J(e.outer_diameter_tooljoint,h,m)&&(x.outer_diameter_tooljoint=E(h,m,2,S)),J(e.length,s,u)&&(x.length=E(s,u,2,T)),!x.outer_diameter_tooljoint&&e.outer_diameter_tooljoint<e.outer_diameter&&(x.outer_diameter_tooljoint="Tool Joint O.D >= O.D"),e.length_tooljoint>e.component_length&&(x.length_tooljoint="Tool Joint Length < Component Length")),x}(t));return Object.keys(r).length>0?{isValid:!1,errors:r}:{isValid:!0}}function z(e,t){var r=[];if(t.length&&!e){var n=t.filter((function(e){return"casing_joints"===e.family})),i=t.filter((function(e){return"float_shoe"===e.family})),o=t[t.length-1],a=t[0];n.length<1&&r.push("At least one casing joints required."),0===i.length?r.push("At least one float shoe required."):i.length>1?r.push("Only one float shoe required."):"float_shoe"!==a.family&&"float_shoe"!==o.family&&r.push("Float Shoe should be on the bottom of the list")}if(e){var h=t.filter((function(e){return"riser"===e.family}));0===h.length?r.push("At least one riser required."):h.length>1&&r.push("Only one riser required.")}return r.length>0?{isValid:!1,errors:r}:{isValid:!0}}function G(e){var t=e.data,r={},d=n(o,"shortLength","in"),g=n(a,"shortLength","in"),p=n(h,"shortLength","in"),f=n(l,"shortLength","in"),c=n(m,"length","ft"),b=n(s,"length","ft"),j=n(u,"length","ft"),O=n(_,"length","ft");return t.start_timestamp&&!i(new Date(t.start_timestamp)).isValid()&&(r.start_timestamp="Invalid Date."),J(t.inner_diameter,d,g)&&(r.inner_diameter=E(d,g,2,S)),J(t.outer_diameter,p,f)&&(r.outer_diameter=E(p,f,2,S)),!r.inner_diameter&&!r.outer_diamter&&t.inner_diamter>t.outer_diameter&&(r.outer_diameter="O.D > I.D"),J(t.top_depth,c,b)&&(r.top_depth=E(c,b,2,T)),J(t.bottom_depth,j,O)&&(r.bottom_depth=E(j,O,2,T)),!r.top_depth&&!r.bottom_depth&&t.top_depth>t.bottom_depth&&(r.bottom_depth="Bottom Depth > Top Depth"),r.inner_diameter||r.outer_diameter||!C(t.outer_diameter,t.inner_diameter,t.linear_weight)||(r.linear_weight="Invalid Linear Weight"),Object.keys(r).length>0?{isValid:!1,errors:r}:{isValid:!0}}export{B as calculateLinearWeight,C as isValidLinearWeight,W as validateComponent,z as validateInterComponents,G as validateMainFields};
@@ -1 +1 @@
1
- import{COMPLETION_APPTYPE_MODES_DICT as t,COMPLETION_APP_TYPES as a}from"../constants/completion.js";import{set as e}from"lodash";var n=function(t,a,e){return t?"pad--".concat(t.current_pad_id||e):a?"well--".concat(a.id):"common"},r=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.fracMultiWellApp,c={};return e?c={mode:t[r][0]}:n&&(c={mode:"custom",selectedAssets:[n.id]}),c},c=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.reduce((function(t,n){var r=(n.app_streams||[]).find((function(t){return"frac"===t.source_type&&(a||"active"===t.status)}));return!r||t&&t.last_frac_at>r.last_active_at?t:e(n,"last_frac_at",r.last_active_at)}),null)},i=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.reduce((function(t,n){var r=(n.app_streams||[]).find((function(t){return"wireline"===t.source_type&&(a||"active"===t.status)}));return!r||t&&t.last_wireline_at>r.last_active_at?t:e(n,"last_wireline_at",r.last_active_at)}),null)},u=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.reduce((function(t,n){var r=(n.app_streams||[]).find((function(t){return"pumpdown"===t.source_type&&(a||"active"===t.status)}));return!r||t&&t.last_pumpdown_at>r.last_active_at?t:e(n,"last_pumpdown_at",r.last_active_at)}),null)};export{n as getAssetKey,r as getDefaultPadModeSetting,c as resolveActiveFracAsset,u as resolveActivePumpdownAsset,i as resolveActiveWirelineAsset};
1
+ import{set as t}from"lodash";import{COMPLETION_APPTYPE_MODES_DICT as a,COMPLETION_APP_TYPES as e}from"../constants/completion.js";var n=function(t,a,e){return t?"pad--".concat(t.current_pad_id||e):a?"well--".concat(a.id):"common"},r=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.fracMultiWellApp,c={};return t?c={mode:a[r][0]}:n&&(c={mode:"custom",selectedAssets:[n.id]}),c},c=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,n){var r=(n.app_streams||[]).find((function(t){return"frac"===t.source_type&&(e||"active"===t.status)}));return!r||a&&a.last_frac_at>r.last_active_at?a:t(n,"last_frac_at",r.last_active_at)}),null)},i=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,n){var r=(n.app_streams||[]).find((function(t){return"wireline"===t.source_type&&(e||"active"===t.status)}));return!r||a&&a.last_wireline_at>r.last_active_at?a:t(n,"last_wireline_at",r.last_active_at)}),null)},u=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,n){var r=(n.app_streams||[]).find((function(t){return"pumpdown"===t.source_type&&(e||"active"===t.status)}));return!r||a&&a.last_pumpdown_at>r.last_active_at?a:t(n,"last_pumpdown_at",r.last_active_at)}),null)};export{n as getAssetKey,r as getDefaultPadModeSetting,c as resolveActiveFracAsset,u as resolveActivePumpdownAsset,i as resolveActiveWirelineAsset};
@@ -1 +1 @@
1
- import"../constants/completion.js";import"../constants/alerts.js";import"lodash";import{DEV_CENTER_CLI_APP_ID as n}from"../constants/devcenter.js";import"../constants/goals.js";import"../constants/segment.js";import"../constants/apps.js";import"../constants/drillstring.js";import"../constants/notifications.js";import"../constants/feed.js";var t=function(n,t){return n?"".concat(n.replace(/\./g,"_"),"-").concat(t):""},o=function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;return o===+(null==t?void 0:t.maximizeDC)};function a(n){return{push:function(t){"string"==typeof t?n.push(t):n.push({pathname:t.pathname,query:t.query})},location:{pathname:n.location.pathname,query:n.location.query}}}var r=function(n){return n?+(n.split("#")[2]||"").replace("}",""):void 0},i=function(n){var t,o;return null!==(t=null==n||null===(o=n.package)||void 0===o?void 0:o.manifest.application.name)&&void 0!==t?t:n.name},s=function(n){var t;return"dev_center"===((null==n?void 0:n.platform)||(null==n||null===(t=n.app)||void 0===t?void 0:t.platform))};export{a as createDevCenterRouter,t as getAppIdentifier,i as getAppName,r as getTimestampFromQuery,o as isAppMaximized,s as isDevCenterApp};
1
+ import"lodash";import"../constants/completion.js";import"../constants/alerts.js";import{DEV_CENTER_CLI_APP_ID as n}from"../constants/devcenter.js";import"../constants/goals.js";import{SEGMENTS as t}from"../constants/segment.js";import"../constants/apps.js";import"../constants/drillstring.js";import"../constants/notifications.js";import"../constants/feed.js";var o=function(n,t){return n?"".concat(n.replace(/\./g,"_"),"-").concat(t):""},i=function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;return o===+(null==t?void 0:t.maximizeDC)};function a(n){return{push:function(t){"string"==typeof t?n.push(t):n.push({pathname:t.pathname,query:t.query})},location:{pathname:n.location.pathname,query:n.location.query}}}var r=function(n){return n?+(n.split("#")[2]||"").replace("}",""):void 0},e=function(n){var t,o;return null!==(t=null==n||null===(o=n.package)||void 0===o?void 0:o.manifest.application.name)&&void 0!==t?t:n.name},l=function(n){var t;return"dev_center"===((null==n?void 0:n.platform)||(null==n||null===(t=n.app)||void 0===t?void 0:t.platform))},s=function(n){var o,i,a,r,e;return null!==(o=null==n||null===(i=n.package)||void 0===i||null===(a=i.manifest)||void 0===a||null===(r=a.application)||void 0===r||null===(e=r.segments)||void 0===e?void 0:e[0])&&void 0!==o?o:t.DRILLING};export{a as createDevCenterRouter,o as getAppIdentifier,e as getAppName,s as getAppSegment,r as getTimestampFromQuery,i as isAppMaximized,l as isDevCenterApp};