@corva/ui 3.7.3 → 3.7.4

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 (39) hide show
  1. package/cjs-bundle/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
  2. package/cjs-bundle/components/OffsetWellPickerV4/OffsetWellPickerV4.module.css.js +1 -1
  3. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js +1 -1
  4. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js +1 -1
  5. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.module.css.js +1 -1
  6. package/cjs-bundle/components/OffsetWellPickerV4/effects/useAdvancedWells.js +1 -1
  7. package/cjs-bundle/components/OffsetWellPickerV4/effects/useFetchWells.js +1 -1
  8. package/cjs-bundle/components/OffsetWellPickerV4/effects/useFilterOptions.js +1 -1
  9. package/cjs-bundle/components/OffsetWellPickerV4/effects/useFilteredWells.js +1 -1
  10. package/cjs-bundle/components/OffsetWellPickerV4/effects/useSortedWells.js +1 -1
  11. package/cjs-bundle/components/OffsetWellPickerV4/effects/useTableColumns.js +1 -1
  12. package/cjs-bundle/components/OffsetWellPickerV4/utils/apiCalls.js +1 -1
  13. package/components/OffsetWellPickerV4/OffsetWellPickerV4.d.ts.map +1 -1
  14. package/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
  15. package/components/OffsetWellPickerV4/OffsetWellPickerV4.module.css.js +1 -1
  16. package/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js +1 -1
  17. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js +1 -1
  18. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.module.css.js +1 -1
  19. package/components/OffsetWellPickerV4/effects/useAdvancedWells.d.ts +1 -1
  20. package/components/OffsetWellPickerV4/effects/useAdvancedWells.d.ts.map +1 -1
  21. package/components/OffsetWellPickerV4/effects/useAdvancedWells.js +1 -1
  22. package/components/OffsetWellPickerV4/effects/useFetchWells.d.ts +2 -1
  23. package/components/OffsetWellPickerV4/effects/useFetchWells.d.ts.map +1 -1
  24. package/components/OffsetWellPickerV4/effects/useFetchWells.js +1 -1
  25. package/components/OffsetWellPickerV4/effects/useFilterOptions.d.ts +5 -1
  26. package/components/OffsetWellPickerV4/effects/useFilterOptions.d.ts.map +1 -1
  27. package/components/OffsetWellPickerV4/effects/useFilterOptions.js +1 -1
  28. package/components/OffsetWellPickerV4/effects/useFilteredWells.d.ts +97 -1
  29. package/components/OffsetWellPickerV4/effects/useFilteredWells.d.ts.map +1 -1
  30. package/components/OffsetWellPickerV4/effects/useFilteredWells.js +1 -1
  31. package/components/OffsetWellPickerV4/effects/useSortedWells.d.ts.map +1 -1
  32. package/components/OffsetWellPickerV4/effects/useSortedWells.js +1 -1
  33. package/components/OffsetWellPickerV4/effects/useTableColumns.d.ts +1 -1
  34. package/components/OffsetWellPickerV4/effects/useTableColumns.d.ts.map +1 -1
  35. package/components/OffsetWellPickerV4/effects/useTableColumns.js +1 -1
  36. package/components/OffsetWellPickerV4/utils/apiCalls.d.ts +9 -8
  37. package/components/OffsetWellPickerV4/utils/apiCalls.d.ts.map +1 -1
  38. package/components/OffsetWellPickerV4/utils/apiCalls.js +1 -1
  39. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/toConsumableArray"),r=require("@babel/runtime/helpers/asyncToGenerator"),a=require("@babel/runtime/regenerator"),n=require("jsona"),s=require("lodash"),u=require("../constants.js"),i=require("../../../clients/jsonApi/index.js"),c=require("../../../clients/jsonApi/postTaskAndWaitResult.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),p=l(t),f=l(r),d=l(a);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){o.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=new(l(n).default);function h(){return(h=f.default(d.default.mark((function e(){var t;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.getCompanies();case 3:t=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error(e.t0);case 9:return e.abrupt("return",t?s.sortBy(t,["name"]):[]);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function v(){return(v=f.default(d.default.mark((function e(t,r){var a,n;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null,n={provider:"xto",app_key:"xto.idas_offset_performance_distance_be_od",asset_id:r,app_version:16,properties:{asset_id:r,user_id:t.id,user_name:"".concat(t.first_name," ").concat(t.last_name)}},e.prev=2,e.next=5,c.postTaskAndWaitResult(n);case 5:a=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0);case 11:return e.abrupt("return",a);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function y(){return(y=f.default(d.default.mark((function e(t,r){var a,n,u;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null,e.prev=1,e.next=4,i.getAssets({types:["well"],company_id:t?+t:void 0,fields:["asset.name","asset.parent_asset_id","asset.parent_asset_name","asset.status","asset.stats","asset.target_formation","asset.string_design","asset.root_asset_name","asset.basin","asset.county","asset.area","asset.visibility","asset.top_hole","asset.settings","well.settings","asset.last_active_at"],per_page:1e4,sort:"name"});case 4:a=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),console.error(e.t0);case 10:if(n=a?a.data.map((function(e){return{id:Number(e.id),name:s.get(e,"attributes.name"),status:s.get(e,"attributes.status"),rigId:s.get(e,"attributes.parent_asset_id")||"Null",rigName:s.get(e,"attributes.parent_asset_name")||"Null",formation:s.get(e,"attributes.target_formation")||"Null",stringDesign:s.get(e,"attributes.string_design")||"Null",programName:s.get(e,"attributes.root_asset_name")||"Null",basin:s.get(e,"attributes.basin")||"Null",county:s.get(e,"attributes.county")||"Null",area:s.get(e,"attributes.area")||"Null",visibility:s.get(e,"attributes.visibility"),topHole:s.get(e,"attributes.top_hole"),rigReleaseDate:s.get(e,"attributes.stats.well_end"),totalDepth:s.get(e,"attributes.stats.total_depth"),is_usable:!0,apiNumber:s.get(e,"attributes.settings.api_number","-"),lastActive:new Date(s.get(e,"attributes.last_active_at")).getTime()/1e3}})).filter((function(e){return e.visibility.includes("visible")})):[],"function"!=typeof r){e.next=16;break}return e.next=14,r(n);case 14:return u=e.sent,e.abrupt("return",u);case 16:return e.abrupt("return",n);case 17:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}function _(){return(_=f.default(d.default.mark((function e(t){return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i.getAppStorage("corva","data.offset-wells.bic",t,{limit:1,sort:"{timestamp: -1}"}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(){return(x=f.default(d.default.mark((function e(t){var r;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,i.getAppStorage("corva","data.offset_wells",t,{limit:1});case 4:r=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),console.error(e.t0);case 10:return e.abrupt("return",r||[]);case 11:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}function w(){return(w=f.default(d.default.mark((function e(t){var r;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.getCompanyGoals(t);case 3:r=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error(e.t0);case 9:return e.abrupt("return",r&&s.get(r,"company_goals")||{});case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function k(){return k=f.default(d.default.mark((function e(t,r,a){var n,u,c;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==r.length){e.next=2;break}return e.abrupt("return",[]);case 2:return n=Math.floor(r.length/200)+1,e.next=5,Promise.all(s.range(n).map(function(){var e=f.default(d.default.mark((function e(n,s){var u,c,l,o;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u={company_id:t,"data.asset_id":{$in:r.slice(200*s,200*(s+1))},"data.key":{$in:a},"data.type":"asset"},c={_id:0,"data.key":1,"data.value":1,asset_id:"$data.asset_id"},l={aggregate:JSON.stringify([{$match:u},{$project:c}])},o=null,e.prev=4,e.next=7,i.getAppStorage("corva","metrics",null,l);case 7:o=e.sent,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),console.error(e.t0);case 13:return e.abrupt("return",o||[]);case 14:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t,r){return e.apply(this,arguments)}}()));case 5:return u=e.sent,c=[],u.forEach((function(e){return c.push.apply(c,p.default(e))})),e.abrupt("return",c);case 9:case"end":return e.stop()}}),e)}))),k.apply(this,arguments)}function O(e,t,r){return j.apply(this,arguments)}function j(){return(j=f.default(d.default.mark((function e(t,r,a){var n,s,c,l;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["well.name","well.asset_id","well.settings","well.status","well.rigName","well.visibility"],s={company:a,search:t,per_page:u.ROWS_PER_PAGE,page:r,fields:n,sort:"name"},e.prev=2,e.next=5,i.getWells(s);case 5:c=e.sent,e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0),c=[];case 12:return l=m.deserialize(c),e.abrupt("return",l.map((function(e){return{redirectAssetId:e.asset_id,apiNumber:e.settings.api_number,name:e.name,asset_id:e.asset_id,status:e.status,rigName:e.rigName,visibility:e.visibility,type:"well"}})));case 14:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function N(e,t,r){return A.apply(this,arguments)}function A(){return(A=f.default(d.default.mark((function e(t,r,a){var n,c,l,o;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["rig.name","rig.active_well","rig.asset_id"],c={company:a,search:t,per_page:u.ROWS_PER_PAGE,page:r,fields:n,sort:"name"},e.prev=2,e.next=5,i.getRigs(c);case 5:l=e.sent,e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0),l=[];case 12:return o=m.deserialize(l),e.abrupt("return",o.map((function(e){return g({redirectAssetId:s.get(e,["active_well","asset_id"])||null},e)})));case 14:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function P(){return P=f.default(d.default.mark((function e(t,r){var a,n,u,i,c,l=arguments;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=l.length>2&&void 0!==l[2]?l[2]:1,n=l.length>3?l[3]:void 0,"well"!==r){e.next=7;break}return e.next=5,O(t,a,n);case 5:return u=e.sent,e.abrupt("return",u);case 7:if("rig"!==r){e.next=12;break}return e.next=10,N(t,a,n);case 10:return i=e.sent,e.abrupt("return",i);case 12:return e.next=14,Promise.all([O(t,a,n),N(t,a,n)]);case 14:return c=e.sent,e.abrupt("return",s.concat.apply(void 0,p.default(c)));case 16:case"end":return e.stop()}}),e)}))),P.apply(this,arguments)}exports.fetchAllAssets=function(e,t){return P.apply(this,arguments)},exports.fetchCompanies=function(){return h.apply(this,arguments)},exports.fetchCompanyGoals=function(e){return w.apply(this,arguments)},exports.fetchMetricsData=function(e,t,r){return k.apply(this,arguments)},exports.fetchOffsetWellSelections=function(e){return _.apply(this,arguments)},exports.fetchWellhubWells=function(e){return x.apply(this,arguments)},exports.fetchWells=function(e,t){return y.apply(this,arguments)},exports.resyncIdasWells=function(e,t){return v.apply(this,arguments)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("jsona"),s=require("lodash"),r=require("../constants.js"),a=require("../../../clients/jsonApi/index.js"),n=require("../../../clients/jsonApi/postTaskAndWaitResult.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=new(i(t).default);function u(t){return e.__awaiter(this,arguments,void 0,(function(t,r){var n,i;return void 0===r&&(r=1),e.__generator(this,(function(e){switch(e.label){case 0:n=null,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getAssets({types:["well"],company_id:t?+t:void 0,fields:["asset.name","asset.parent_asset_id","asset.parent_asset_name","asset.status","asset.stats","asset.target_formation","asset.string_design","asset.root_asset_name","asset.basin","asset.county","asset.area","asset.visibility","asset.top_hole","asset.settings","well.settings","asset.last_active_at"],page:r,per_page:1e3,sort:"name"})];case 2:return n=e.sent(),[3,4];case 3:return i=e.sent(),console.error(i),[3,4];case 4:return[2,n?n.data.map((function(e){return{id:Number(e.id),name:s.get(e,"attributes.name"),status:s.get(e,"attributes.status"),rigId:s.get(e,"attributes.parent_asset_id")||"Null",rigName:s.get(e,"attributes.parent_asset_name")||"Null",formation:s.get(e,"attributes.target_formation")||"Null",stringDesign:s.get(e,"attributes.string_design")||"Null",programName:s.get(e,"attributes.root_asset_name")||"Null",basin:s.get(e,"attributes.basin")||"Null",county:s.get(e,"attributes.county")||"Null",area:s.get(e,"attributes.area")||"Null",visibility:s.get(e,"attributes.visibility"),topHole:s.get(e,"attributes.top_hole"),rigReleaseDate:s.get(e,"attributes.stats.well_end"),totalDepth:s.get(e,"attributes.stats.total_depth"),is_usable:!0,apiNumber:s.get(e,"attributes.settings.api_number","-"),lastActive:new Date(s.get(e,"attributes.last_active_at")).getTime()/1e3}})).filter((function(e){return e.visibility.includes("visible")})):[]]}}))}))}function l(t,s,n){return e.__awaiter(this,void 0,void 0,(function(){var i,u,l,c;return e.__generator(this,(function(e){switch(e.label){case 0:i=["well.name","well.asset_id","well.settings","well.status","well.rigName","well.visibility"],u={company:n,search:t,per_page:r.ROWS_PER_PAGE,page:s,fields:i,sort:"name"},e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getWells(u)];case 2:return l=e.sent(),[3,4];case 3:return c=e.sent(),console.error(c),l=[],[3,4];case 4:return[2,o.deserialize(l).map((function(e){return{redirectAssetId:e.asset_id,apiNumber:e.settings.api_number,name:e.name,asset_id:e.asset_id,status:e.status,rigName:e.rigName,visibility:e.visibility,type:"well"}}))]}}))}))}function c(t,n,i){return e.__awaiter(this,void 0,void 0,(function(){var u,l,c,_;return e.__generator(this,(function(d){switch(d.label){case 0:u=["rig.name","rig.active_well","rig.asset_id"],l={company:i,search:t,per_page:r.ROWS_PER_PAGE,page:n,fields:u,sort:"name"},d.label=1;case 1:return d.trys.push([1,3,,4]),[4,a.getRigs(l)];case 2:return c=d.sent(),[3,4];case 3:return _=d.sent(),console.error(_),c=[],[3,4];case 4:return[2,o.deserialize(c).map((function(t){return e.__assign({redirectAssetId:s.get(t,["active_well","asset_id"])||null},t)}))]}}))}))}exports.fetchAllAssets=function(t,r){return e.__awaiter(this,arguments,void 0,(function(t,r,a,n){var i;return void 0===a&&(a=1),e.__generator(this,(function(e){switch(e.label){case 0:return"well"!==r?[3,2]:[4,l(t,a,n)];case 1:case 3:return[2,e.sent()];case 2:return"rig"!==r?[3,4]:[4,c(t,a,n)];case 4:return[4,Promise.all([l(t,a,n),c(t,a,n)])];case 5:return i=e.sent(),[2,s.concat.apply(void 0,i)]}}))}))},exports.fetchCompanies=function(){return e.__awaiter(this,void 0,void 0,(function(){var t,r;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.getCompanies()];case 1:return t=e.sent(),[3,3];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2,t?s.sortBy(t,["name"]):[]]}}))}))},exports.fetchCompanyGoals=function(t){return e.__awaiter(this,void 0,void 0,(function(){var r,n;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.getCompanyGoals(t)];case 1:return r=e.sent(),[3,3];case 2:return n=e.sent(),console.error(n),[3,3];case 3:return[2,r&&s.get(r,"company_goals")||{}]}}))}))},exports.fetchMetricsData=function(t,r,n){return e.__awaiter(this,void 0,void 0,(function(){var i,o,u,l=this;return e.__generator(this,(function(c){switch(c.label){case 0:return 0===r.length?[2,[]]:(i=Math.floor(r.length/200)+1,[4,Promise.all(s.range(i).map((function(s,i){return e.__awaiter(l,void 0,void 0,(function(){var s,o,u,l,c;return e.__generator(this,(function(e){switch(e.label){case 0:s={company_id:t,"data.asset_id":{$in:r.slice(200*i,200*(i+1))},"data.key":{$in:n},"data.type":"asset"},o={_id:0,"data.key":1,"data.value":1,asset_id:"$data.asset_id"},u={aggregate:JSON.stringify([{$match:s},{$project:o}])},l=null,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getAppStorage("corva","metrics",null,u)];case 2:return l=e.sent(),[3,4];case 3:return c=e.sent(),console.error(c),[3,4];case 4:return[2,l||[]]}}))}))})))]);case 1:return o=c.sent(),u=[],o.forEach((function(e){return u.push.apply(u,e)})),[2,u]}}))}))},exports.fetchOffsetWellSelections=function(t){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(e){return[2,a.getAppStorage("corva","data.offset-wells.bic",t,{limit:1,sort:"{timestamp: -1}"})]}))}))},exports.fetchWellhubWells=function(t){return e.__awaiter(this,void 0,void 0,(function(){var s,r;return e.__generator(this,(function(e){switch(e.label){case 0:s=null,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getAppStorage("corva","data.offset_wells",t,{limit:1})];case 2:return s=e.sent(),[3,4];case 3:return r=e.sent(),console.error(r),[3,4];case 4:return[2,s||[]]}}))}))},exports.fetchWells=function(t,s,r){return e.__awaiter(this,void 0,void 0,(function(){var a,n;return e.__generator(this,(function(e){switch(e.label){case 0:a=1,e.label=1;case 1:return a<=20?[4,u(t,a)]:[3,4];case 2:if(n=e.sent(),r())return[2];if(n.length<1e3)return s(n,!0),[2];s(n,!1),e.label=3;case 3:return a++,[3,1];case 4:return[2]}}))}))},exports.resyncIdasWells=function(t,s){return e.__awaiter(this,void 0,void 0,(function(){var r,a,i;return e.__generator(this,(function(e){switch(e.label){case 0:r=null,a={provider:"xto",app_key:"xto.idas_offset_performance_distance_be_od",asset_id:s,app_version:16,properties:{asset_id:s,user_id:t.id,user_name:"".concat(t.first_name," ").concat(t.last_name)}},e.label=1;case 1:return e.trys.push([1,3,,4]),[4,n.postTaskAndWaitResult(a)];case 2:return r=e.sent(),[3,4];case 3:return i=e.sent(),console.error(i),[3,4];case 4:return[2,r]}}))}))};
@@ -1 +1 @@
1
- {"version":3,"file":"OffsetWellPickerV4.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellPickerV4/OffsetWellPickerV4.js"],"names":[],"mappings":";AAoDA;;GAEG;AACH,kCAFU,KAAK,CAAC,EAAE,CAAC,OAAO,4BAA4B,EAAE,uBAAuB,CAAC,CAqrB9E"}
1
+ {"version":3,"file":"OffsetWellPickerV4.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellPickerV4/OffsetWellPickerV4.js"],"names":[],"mappings":";AAoDA;;GAEG;AACH,kCAFU,KAAK,CAAC,EAAE,CAAC,OAAO,4BAA4B,EAAE,uBAAuB,CAAC,CAgsB9E"}
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as i,useRef as r,useEffect as p,useCallback as l,useMemo as a}from"react";import m from"classnames";import{uniqBy as c,uniq as d,sortBy as u,isEmpty as j}from"lodash";import{Replay as f,InfoOutlined as C}from"@material-ui/icons";import{useFetchWells as v}from"./effects/useFetchWells.js";import{useAdvancedWells as A}from"./effects/useAdvancedWells.js";import{useBicWells as h}from"./effects/useBicWells.js";import{useCompanyMetricKey as b}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as g}from"./effects/useFilterOptions.js";import{useFilteredWells as S}from"./effects/useFilteredWells.js";import{useSortedWells as I}from"./effects/useSortedWells.js";import"./effects/useAssetsData.js";import{useTableColumns as T}from"./effects/useTableColumns.js";import{useCompanyProvider as D}from"./effects/useCompanyProvider.js";import{AppHeader as y}from"./components/AppHeader/AppHeader.js";import{Toolbar as x}from"./components/Toolbar/Toolbar.js";import{Filter as V}from"./components/Filter/Filter.js";import{WellsMap as P}from"./components/Map/WellsMap.js";import W from"./components/OffsetWellsTable/OffsetWellsTable.js";import{ALL_SECTION_KEY as B,ViewType as E,TOP_GRADIENT_MAP as O,ColumnType as F,COMPANY_PROVIDERS_FOR_IDAS as w,FilterType as M,ROWS_PER_PAGE as L,RESYNC_STATUS as k,LEAVE_TOUCH_DELAY as H,IOS_DEVICE as N,DEFAULT_LOCAL_OFFSET_SIZE as R,MAX_OFFSET_SIZE as G,SMALL_SCREEN_WIDTH as z,SMALL_SCREEN_HEIGHT as U,DEFAULT_BIC_OFFSET_SIZE as _}from"./constants.js";import{SEARCH_CATEGORIES as K}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";import{getCoordinatedWells as Z,getMobileOperatingSystem as q}from"./utils/index.js";import X from"./OffsetWellPickerV4.module.css.js";import"../../utils/index.js";import{jsxs as J,jsx as Q,Fragment as Y}from"react/jsx-runtime";import"@material-ui/core/Snackbar";import"../Notifications/Toast.js";import{NotificationsContainer as $}from"../Notifications/NotificationsContainer.js";import{isMobileDetected as ee,isNativeDetected as te}from"../../utils/mobileDetect.js";import oe from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import{Regular14 as se,Regular12 as ne}from"../Typography.js";import ie from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../AppIcon/AppIcon.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/core";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../utils/env.js";import"../GradientManager/configuration/constants.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Grid.scss.js";import"../../componentsV2/Header/Header.scss.js";import"../../componentsV2/Button/Button.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"uuid";import"../../componentsV2/Tooltip/Tooltip.scss.js";import"../../componentsV2/Paper/Paper.js";import"../../componentsV2/Popover/Popover.scss.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/TextLink/TextLink.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../componentsV2/Avatar/Avatar.js";import"../../componentsV2/Avatar/constants.js";import"../../componentsV2/AvatarGroup/AvatarGroup.scss.js";import"@material-ui/lab";import"../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../componentsV2/Modal/Modal.scss.js";import"@icon-park/react/es/all";import"../../icons/IconParkProvider.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/Gap.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/Counter/Counter.js";import"../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/EmptyState/EmptyState.scss.js";import"../../componentsV2/FileIcon/FileIcon.js";import"react-dropzone";import"../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../componentsV2/Skeleton/Skeleton.scss.js";import"../../utils/main.js";import"../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../componentsV2/Stepper/Step/Step.scss.js";import"../../componentsV2/Stepper/Stepper.scss.js";import"../../componentsV2/ButtonLive/ButtonLive.js";import"../../componentsV2/LiveDotIndicator/LiveDotIndicator.scss.js";import"../../componentsV2/IndicatorLive/IndicatorLive.scss.js";import"../../componentsV2/Accordion/Accordion.scss.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/AppFooter/AppFooter.js";import"../DevCenter/DevCenterAppContainer/components/AppCommons/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../componentsV2/AppHeader/AppAssets/AppAssets.js";import"../PadModeSelect/PadModeSelect.js";import"../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../constants/streamSourceType.js";import"../../componentsV2/AppHeader/AppHeader.scss.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../Toaster/Toaster.js";import"querystring";import"uuid/v1";import"../../clients/subscriptions.js";import"../../clients/jsonApi/index.js";import"jsona";import"../StatusBadge/constants.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../clients/api/apiCore.js";import"../../clients/constants.js";import"../../clients/sso/auth0.js";import"../../clients/sso/oauth2.js";import"lodash/isEmpty";import"lodash/sortBy";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import re from"../LoadingIndicator/LoadingIndicator.js";import"../RealTimeValuesSidebar/RealTimeSidebar.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../EmptyState/EmptyState.js";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"react-color";import"../SettingEditors/ColorEditor/style.css.js";import"../SettingEditors/DropdownEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/ChartSelect.js";import"../Chart/components/buttons/DragToZoomButton.js";import"../Chart/components/buttons/ZoomInButton.js";import"../Chart/components/buttons/ZoomOutButton.js";import"../Chart/components/buttons/PanButton.js";import"../Chart/components/buttons/ResetZoomButton.js";import"../Chart/components/buttons/HideAxesButton.js";import"../Chart/components/buttons/ChartTypeButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../MiddleTruncatedText/MiddleTruncatedText.js";import"../RangeSlider/constants.js";import"../RangeSlider/Input.css.js";import"../RangeSlider/RangeSlider.css.js";import"../AdvancedSlider/AdvancedSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import pe from"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Select/SelectFilterBy.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../GradientPicker/GradientPicker.js";import"../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.styles.js";import"../GradientManager/GradientManager.styles.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../OffsetWellMap/OffsetWellMap.js";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/index.js";import"../MenuItem/index.js";import"../MiddleTruncate/MiddleTruncate.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import"../Table/TablePagination/TablePagination.js";import"../Table/TablePaginationActions/TablePaginationActions.js";import{Tooltip as le}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Stepper.js";import"../Stepper/Step/Step.js";import"../Stepper/StepsWrapper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/Groups.js";import"../Search/components/SelectAllListItem.js";import"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../AssetNameLabel/AssetStatusBadge.js";import"../AssetEditorV2/components/PrimaryAssetSelect.js";import"../AssetEditorV2/components/SecondaryAssetSelect.js";import"../AssetEditorV2/components/SelectItem.js";import"../AssetEditorV2/components/MultipleAssetsToggle.js";import"../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../EChartsWrapper/EChartsWrapper.js";import"../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../GoogleDocsViewer/index.js";import"../NewDocumentViewer/effects/useFileContent.js";import"../NewDocumentViewer/styles.js";import"../FilesLoaderV2/styles.js";import"../FilesDropzone/styles.js";import"../FilesProcessor/styles.js";import"../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../Formula/useFormulaStyles.js";import"../Formula/RootXIcon.js";import"../Formula/FormulaTextEditor.js";import"../Formula/CloseSuggestion.js";import"../Formula/SuggestionsMenu.js";import{showInfoNotification as ae}from"../../utils/notificationToasts.js";function me(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function ce(e){for(var o=1;o<arguments.length;o++){var s=null!=arguments[o]?arguments[o]:{};o%2?me(Object(s),!0).forEach((function(o){t(e,o,s[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):me(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var de="OffsetWellPickerV4",ue=function(me){var ue,je,fe,Ce=me.open,ve=me.isWDUser,Ae=me.defaultSubjectWell,he=me.currentUser,be=me.offsetSettings,ge=me.addWellsUsabilityInfo,Se=me.isViewOnly,Ie=me.onClose,Te=me.onSave,De=me.maxOffsetSize,ye=void 0===De?_:De,xe=me.localMaxOffsetSize,Ve=void 0===xe?R:xe,Pe=me.syncAutoEnabled,We=me.isManualWellsEnabled,Be=void 0!==We&&We,Ee=i(null),Oe=s(Ee,2),Fe=Oe[0],we=Oe[1],Me=Math.min(ye+1,Ve+1,G+1),Le=Math.min(Math.max(Me,Ve+1),G+1),ke=i(null==be?void 0:be.filterExpanded),He=s(ke,2),Ne=He[0],Re=He[1],Ge=i(null==be?void 0:be.mapHidden),ze=s(Ge,2),Ue=ze[0],_e=ze[1],Ke=+(null==Ae?void 0:Ae.companyId)||+(null==he?void 0:he.company_id),Ze=null==Ae?void 0:Ae.asset_id,qe=i((null==be?void 0:be.filters)||{}),Xe=s(qe,2),Je=Xe[0],Qe=Xe[1],Ye=i((null==be?void 0:be.wellSection)||B),$e=s(Ye,2),et=$e[0],tt=$e[1],ot=r(!0),st=i([]),nt=s(st,2),it=nt[0],rt=nt[1],pt=i(null),lt=s(pt,2),at=lt[0],mt=lt[1],ct=i(!0),dt=s(ct,2),ut=dt[0],jt=dt[1],ft=i(!1),Ct=s(ft,2),vt=Ct[0],At=Ct[1],ht=i(!1),bt=s(ht,2),gt=bt[0],St=bt[1],It=r(),Tt=i(E.none),Dt=s(Tt,2),yt=Dt[0],xt=Dt[1],Vt=r(),Pt=i(!1),Wt=s(Pt,2),Bt=Wt[0],Et=Wt[1],Ot=Le<=(null==it?void 0:it.length),Ft=O[yt],wt=r(),Mt=i(!0),Lt=s(Mt,2),kt=Lt[0],Ht=Lt[1];p((function(){var e,t,o;(Ce&&Ot&&ae("App can’t process more than (".concat(Le-1,") Offset Wells.")),Ce)||((null==be||null===(e=be.selectedWellIds)||void 0===e?void 0:e.length)===(null===(t=wt.current)||void 0===t?void 0:t.length)&&(null==be||null===(o=be.selectedWellIds)||void 0===o?void 0:o.every((function(e){var t;return null===(t=wt.current)||void 0===t?void 0:t.includes(e)})))||(ot.current=!0),wt.current=null==be?void 0:be.selectedWellIds)}),[Ot,Ce,be]),p((function(){function e(){window.innerWidth<=z||ee||te?xt(E.mobile):window.innerHeight<=U?xt(E.small):xt(E.normal)}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[Ce]),p((function(){Vt.current&&yt===Vt.current||(Vt.current=yt,yt===E.small||yt===E.mobile?(_e(!0),Re(!1)):(Re(!Se&&(null==be?void 0:be.filterExpanded)),_e(!Se&&(null==be?void 0:be.mapHidden))),Qe((null==be?void 0:be.filters)||{}),tt((null==be?void 0:be.wellSection)||B))}),[be,Se,yt]);var Nt=v(Ke,ge),Rt=s(Nt,1)[0],Gt=D(Ke),zt=s(Gt,1)[0],Ut=h(ve,he,Ze,Rt,Be),_t=s(Ut,7),Kt=_t[0],Zt=_t[1],qt=_t[2],Xt=_t[3],Jt=_t[4],Qt=_t[5],Yt=_t[6];p((function(){Ht(!0),Zt(null),Xt(null)}),[Ze]),p((function(){var e,t=(e=o(n.mark((function e(){var t,o,s,i,r,p,l,a,m,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=void 0===(null==be?void 0:be.isSynced)||(null==be?void 0:be.isSynced),o=!0,!t){e.next=19;break}if(i=qt[B]||[],r=((null==be?void 0:be.selectedWellIds)||[]).every((function(e){return i.includes(e)})),i.length===(null==be||null===(s=be.selectedWellIds)||void 0===s?void 0:s.length)&&r){e.next=16;break}return e.next=8,Z(i,Ze);case 8:p=e.sent,l=p.slice(0,Me+1).map((function(e){return e.id})),l=p.slice(0,Ve+1).map((function(e){return e.id})),a=ce(ce({},be),{},{subjectWellId:Ze,selectedWellIds:l,offsetWellsLimited:Le<=l.length}),m=p.filter((function(e){return l.includes(e.id)})),Te(a,m),e.next=17;break;case 16:o=!1;case 17:e.next=20;break;case 19:o=!1;case 20:if(o){e.next=25;break}return e.next=23,Z((null==be?void 0:be.selectedWellIds)||[],Ze);case 23:c=e.sent,Te(be,c);case 25:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)});Pe&&kt&&be&&qt&&(t(),Ht(!1))}),[be,qt,Ze,Le,Pe]);var $t=b(Ke,null==be?void 0:be.metricsKeys),eo=s($t,2),to=eo[0],oo=eo[1],so=A(Ke,Rt,Kt,qt,Ze,to),no=g(so);p((function(){if(so&&Kt){var e=so.find((function(e){return e.id===Ze}));if(e){var o=Kt.filter((function(e){return e.value!==B})).map((function(e){return e.label})),s=ce(ce({},e),o.length>0&&t({},F.wellSection,o));mt(s)}else mt(null)}}),[Kt,so]);var io=T(to),ro=S(so,Je);p((function(){if(ro)if(ot.current){var e=so.filter((function(e){return((null==be?void 0:be.selectedWellIds)||[]).includes(e.id)}));at&&(e=e.concat(at)),rt(c(e,"id")),ot.current=!1}else rt((function(e){var t=(ro||[]).filter((function(t){return!!e.find((function(e){var o=e.id;return t.id===o}))}));return at&&(t=t.concat(at)),c(t,"id")}))}),[so,ro,null==be?void 0:be.selectedWellIds]);var po=I(at,ro,it,jt,ot.current),lo=s(po,5),ao=lo[0],mo=lo[1],co=lo[2],uo=lo[3],jo=lo[4],fo=l((function(e,t,o){var s;s=o===K.well.name?t:t.reduce((function(e,t){var o,s=null===(o=so.find((function(e){return e.id===t})))||void 0===o?void 0:o.rigName,n=so.filter((function(e){return e.rigName===s})).map((function(e){return e.id}));return e.concat(n)}),[]);var n=so.filter((function(e){var t=e.id;return s.includes(t)}));e?(n=n.slice(0,Math.min(n.length,Le-it.length)),rt((function(e){return c(e.concat(n),"id")}))):rt((function(e){return d(e.filter((function(e){var t=e.id;return!n.find((function(e){return e.id===t}))})))}))}),[so,it]),Co=l((function(){St(!0)}),[]),vo=l((function(e){oo(e)}),[]),Ao=l((function(t,o){rt(o?function(o){return[].concat(e(o),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),ho=l((function(e){if(e){var t=at?ro.concat(at):ro,o=u(c(t,"id"),"distance");rt(o.slice(0,Le))}else rt(at?[at]:[])}),[ro,at,Le]),bo=function(e){if(qt){var t=(null==so?void 0:so.filter((function(t){var o;return null===(o=qt[e])||void 0===o?void 0:o.includes(t.id)})))||[],o=u(t,"distance");rt(o.slice(0,Me))}else rt(at?[at]:[])},go=l((function(e){tt(e),bo(e)}),[bo]),So=a((function(){return it.find((function(e){return e.id===Ze}))?it.length-1:it.length}),[it,Ze]),Io=a((function(){if(!qt)return!1;var e=it.map((function(e){return e.id})),t=qt[et]||[];return Math.min(t.length,Me)===e.length&&e.every((function(e){return t.includes(e)}))}),[qt,it,et,Me]),To=a((function(){return!!zt&&w.includes(zt)}),[zt]),Do=a((function(){return To?"IDAS generated offsets.":ve?"Offset Selection App.":"WellHub."}),[To,ve]),yo=function(){var e=(so||[]).filter((function(e){return((null==be?void 0:be.selectedWellIds)||[]).includes(e.id)}));at&&(e=e.concat(at)),rt(c(e,"id"));var t=ce(ce({},be),{},{mapHidden:Ue,filterExpanded:Ne});Te(t),Qe((null==be?void 0:be.filters)||{}),tt((null==be?void 0:be.wellSection)||B),Ie()},xo=a((function(){return!Io||(!(j(Je)||!Je[M.sideTracks])||et!==B)}),[Io,Je,et]),Vo=function(){Qe({}),tt(B),bo(B)},Po=!so||!Kt||!jo||yt===E.none,Wo=i(!1),Bo=s(Wo,2),Eo=Bo[0],Oo=Bo[1],Fo=i(L),wo=s(Fo,2),Mo=wo[0],Lo=wo[1],ko=i([]),Ho=s(ko,2),No=Ho[0],Ro=Ho[1];p((function(){if(jo){var e=jo.slice(0,Mo);Ro(e)}}),[jo,Mo,at]),p((function(){Jt===k.SUCCEEDED&&Vo()}),[qt]);return J(ie,{open:Ce,onClose:yo,title:Q(y,{isWDUser:ve,viewType:yt,totalCount:null!==(ue=null==so?void 0:so.length)&&void 0!==ue?ue:0,selectedCount:So,isViewOnly:Se,maxOffsetWellNumber:Le}),isMobile:yt===E.mobile,contentContainerClassName:m(X.offsetWellDialog),contentClassName:m(X.contentContainer,(je={},t(je,X.smallContainer,yt===E.small),t(je,X.contentContainerMobile,yt===E.mobile),je)),actionsClassName:X.modalActions,actions:!Se&&J("div",{className:X.actionsWrapper,children:[!Po&&xo?Q(le,{placement:"bottom-start",title:"Reset to Synced Offsets in ".concat(ve?"Offset App":"Wellhub"),children:Q("div",{children:Q(pe,{"data-testid":"".concat(de,"_reset"),onClick:Vo,color:"primary",startIcon:yt!==E.mobile&&Q(f,{}),classes:yt===E.mobile&&{root:X.resetButtonMobile},children:yt!==E.mobile?"Reset":Q(f,{})})})}):Q("div",{className:yt===E.mobile&&X.infoIconContainer,children:yt!==E.mobile?J(Y,{children:[Q("span",{className:m(oe.regular12,oe.colors.t6),children:"The offset list is being automatically populated by "}),Q("span",{className:m(oe.medium12,oe.colors.t6),children:Do})]}):Q(le,{title:J("div",{children:[Q("span",{className:m(oe.regular12,oe.colors.t1),children:"The offset list is being automatically populated by "}),Q("span",{className:m(oe.medium12,oe.colors.t1),children:Do})]}),enterTouchDelay:0,leaveTouchDelay:H,children:Q(C,{className:X.infoIcon})})}),J("div",{className:X.buttonGap,children:[Q(pe,{"data-testid":"".concat(de,"_cancel"),onClick:yo,color:"primary",children:"Cancel"}),J(pe,{"data-testid":"".concat(de,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){Ie();var e=ce(ce({},be),{},{companyId:Ke,subjectWellId:Ze,selectedWellIds:it.map((function(e){return e.id})),filters:Je,metricsKeys:to,wellSection:et,isSynced:Io,mapHidden:Ue,filterExpanded:Ne,offsetWellsLimited:Ot});Te(e,it)},children:["Select (",So,")"]})]})]}),children:[Q($,{}),Po?Q(re,{fullscreen:!1}):J("div",{className:m(X.contentWrapper),ref:It,children:[yt===E.mobile&&J("div",{className:m(X.countContainer,t({},X.countContainerMobile,yt===E.mobile)),children:[Q(se,{className:X.totalLabel,children:"Total:"}),Q(se,{"data-testid":"".concat(de,"_totalWells"),className:X.countValue,children:so.length}),Q(se,{className:X.selectedLabel,children:"Selected:"}),Q(se,{"data-testid":"".concat(de,"_selected"),className:X.countValue,children:So}),Q(le,{title:"App can’t process more than (".concat(Le-1,") Offset Wells."),placement:"right",children:J(ne,{"data-testid":"".concat(de,"_maxOffsetSize"),className:X.maxOffsetSize,children:["/",Le-1]})})]}),yt===E.normal&&Q(x,{isViewOnly:Se,isXtoProvider:To,viewType:yt,filters:Je,setFilters:Qe,isFilterExpanded:Ne,setIsFilterExpanded:Re,isMapHidden:Ue,setIsMapHidden:_e,resyncStatus:Jt,setResyncStatus:Qt}),Bt&&Q("div",{className:X.topGradient,style:{top:Ft}}),J("div",{className:m(X.content,(fe={},t(fe,X.contentMobile,yt===E.mobile),t(fe,X.contentiOSMobile,q()===N),fe)),onScroll:function(e){return function(e){e.target&&(gt&&(e.target.scrollLeft=0,St(!1)),e.target.scrollLeft<=5&&Eo&&Oo(!1),e.target.scrollLeft>5&&!Eo&&Oo(!0),e.target.scrollTop<=5&&Bt&&Et(!1),e.target.scrollTop>5&&!Bt&&Et(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight+2)>=e.target.scrollHeight&&Mo<jo.length&&Lo((function(e){return e+L})))}(e)},children:[yt!==E.normal&&Q(x,{isViewOnly:Se,isXtoProvider:To,viewType:yt,filters:Je,setFilters:Qe,isFilterExpanded:Ne,setIsFilterExpanded:Re,isMapHidden:Ue,setIsMapHidden:_e,resyncStatus:Jt,setResyncStatus:Qt}),!Ue&&Ce&&Q(P,{isViewOnly:Se,mapHidden:Ue,subjectWell:at,offsetWellIds:it.map((function(e){return e.id})),wells:ro,radius:Je[M.radius],handleChangeOffsetWell:Ao,activeWellId:Fe,viewType:yt}),Q(V,{isHidden:!Ne,isWDUser:ve,filterOptions:no,filters:Je,wellSections:Kt,selectedWellSection:et,subjectWell:at,onChangeFilters:function(e){jt(!0),setTimeout((function(){return Qe(e)}),0)},onChangeBicWells:go}),Q(W,{open:Ce,isTableLoading:ut,companyId:Ke,subjectWellId:Ze,sortBy:ao,setSortBy:mo,sortDirection:co,setSortDirection:uo,columnsWithDict:io,wells:No,metricsKeys:to,setMetricsKeys:vo,handleChangeOffsetWell:Ao,handleChangeAllOffsetWells:ho,handleAddRemoveAssets:fo,isWellNameExpand:vt,setIsWellNameExpand:At,isHScrollMoved:Eo,onHideAdvancedSearch:Co,isViewOnly:Se,isLastWell:jo.length<=Mo,contentRef:It,isLimitedOffsetWells:Ot,maxOffsetWellNumber:Le,wellSections:Kt,setActiveWellId:we,viewType:yt,isWDUser:ve,taScores:Yt})]}),Se&&J("div",{className:X.viewOnlyInfoContainer,children:[Q("span",{className:m(oe.regular12,oe.colors.t6),children:"The offset list is being automatically populated by "}),Q("span",{className:m(oe.medium12,oe.colors.t6),children:Do})]})]})]})};export{ue as default};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as i,useRef as r,useEffect as p,useCallback as l,useMemo as a}from"react";import m from"classnames";import{uniqBy as c,uniq as d,sortBy as u,isEmpty as j}from"lodash";import{Replay as f,InfoOutlined as C}from"@material-ui/icons";import{useFetchWells as v}from"./effects/useFetchWells.js";import{useAdvancedWells as A}from"./effects/useAdvancedWells.js";import{useBicWells as h}from"./effects/useBicWells.js";import{useCompanyMetricKey as b}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as g}from"./effects/useFilterOptions.js";import{useFilteredWells as S}from"./effects/useFilteredWells.js";import{useSortedWells as I}from"./effects/useSortedWells.js";import"./effects/useAssetsData.js";import{useTableColumns as T}from"./effects/useTableColumns.js";import{useCompanyProvider as D}from"./effects/useCompanyProvider.js";import{AppHeader as y}from"./components/AppHeader/AppHeader.js";import{Toolbar as x}from"./components/Toolbar/Toolbar.js";import{Filter as V}from"./components/Filter/Filter.js";import{WellsMap as P}from"./components/Map/WellsMap.js";import W from"./components/OffsetWellsTable/OffsetWellsTable.js";import{ALL_SECTION_KEY as B,ViewType as E,TOP_GRADIENT_MAP as O,ColumnType as F,COMPANY_PROVIDERS_FOR_IDAS as w,FilterType as M,ROWS_PER_PAGE as L,RESYNC_STATUS as k,LEAVE_TOUCH_DELAY as H,IOS_DEVICE as N,DEFAULT_LOCAL_OFFSET_SIZE as R,MAX_OFFSET_SIZE as G,SMALL_SCREEN_WIDTH as z,SMALL_SCREEN_HEIGHT as U,DEFAULT_BIC_OFFSET_SIZE as _}from"./constants.js";import{SEARCH_CATEGORIES as K}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";import{getCoordinatedWells as Z,getMobileOperatingSystem as q}from"./utils/index.js";import X from"./OffsetWellPickerV4.module.css.js";import"../../utils/index.js";import{jsxs as J,jsx as Q,Fragment as Y}from"react/jsx-runtime";import"@material-ui/core/Snackbar";import"../Notifications/Toast.js";import{NotificationsContainer as $}from"../Notifications/NotificationsContainer.js";import{isMobileDetected as ee,isNativeDetected as te}from"../../utils/mobileDetect.js";import oe from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import{Regular14 as se,Regular12 as ne}from"../Typography.js";import ie from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../AppIcon/AppIcon.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/core";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../utils/env.js";import"../GradientManager/configuration/constants.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Grid.scss.js";import"../../componentsV2/Header/Header.scss.js";import"../../componentsV2/Button/Button.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"uuid";import"../../componentsV2/Tooltip/Tooltip.scss.js";import"../../componentsV2/Paper/Paper.js";import"../../componentsV2/Popover/Popover.scss.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/TextLink/TextLink.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../componentsV2/Avatar/Avatar.js";import"../../componentsV2/Avatar/constants.js";import"../../componentsV2/AvatarGroup/AvatarGroup.scss.js";import"@material-ui/lab";import"../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../componentsV2/Modal/Modal.scss.js";import"@icon-park/react/es/all";import"../../icons/IconParkProvider.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/Gap.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/Counter/Counter.js";import"../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/EmptyState/EmptyState.scss.js";import"../../componentsV2/FileIcon/FileIcon.js";import"react-dropzone";import"../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../componentsV2/Skeleton/Skeleton.scss.js";import"../../utils/main.js";import"../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../componentsV2/Stepper/Step/Step.scss.js";import"../../componentsV2/Stepper/Stepper.scss.js";import"../../componentsV2/ButtonLive/ButtonLive.js";import"../../componentsV2/LiveDotIndicator/LiveDotIndicator.scss.js";import"../../componentsV2/IndicatorLive/IndicatorLive.scss.js";import"../../componentsV2/Accordion/Accordion.scss.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/AppFooter/AppFooter.js";import"../DevCenter/DevCenterAppContainer/components/AppCommons/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../componentsV2/AppHeader/AppAssets/AppAssets.js";import"../PadModeSelect/PadModeSelect.js";import"../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../constants/streamSourceType.js";import"../../componentsV2/AppHeader/AppHeader.scss.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../Toaster/Toaster.js";import"querystring";import"uuid/v1";import"../../clients/subscriptions.js";import"../../clients/jsonApi/index.js";import"jsona";import"../StatusBadge/constants.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../clients/api/apiCore.js";import"../../clients/constants.js";import"../../clients/sso/auth0.js";import"../../clients/sso/oauth2.js";import"lodash/isEmpty";import"lodash/sortBy";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import re from"../LoadingIndicator/LoadingIndicator.js";import"../RealTimeValuesSidebar/RealTimeSidebar.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../EmptyState/EmptyState.js";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"react-color";import"../SettingEditors/ColorEditor/style.css.js";import"../SettingEditors/DropdownEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/ChartSelect.js";import"../Chart/components/buttons/DragToZoomButton.js";import"../Chart/components/buttons/ZoomInButton.js";import"../Chart/components/buttons/ZoomOutButton.js";import"../Chart/components/buttons/PanButton.js";import"../Chart/components/buttons/ResetZoomButton.js";import"../Chart/components/buttons/HideAxesButton.js";import"../Chart/components/buttons/ChartTypeButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../MiddleTruncatedText/MiddleTruncatedText.js";import"../RangeSlider/constants.js";import"../RangeSlider/Input.css.js";import"../RangeSlider/RangeSlider.css.js";import"../AdvancedSlider/AdvancedSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import pe from"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Select/SelectFilterBy.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../GradientPicker/GradientPicker.js";import"../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.styles.js";import"../GradientManager/GradientManager.styles.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../OffsetWellMap/OffsetWellMap.js";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/index.js";import"../MenuItem/index.js";import"../MiddleTruncate/MiddleTruncate.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import"../Table/TablePagination/TablePagination.js";import"../Table/TablePaginationActions/TablePaginationActions.js";import{Tooltip as le}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Stepper.js";import"../Stepper/Step/Step.js";import"../Stepper/StepsWrapper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/Groups.js";import"../Search/components/SelectAllListItem.js";import"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../AssetNameLabel/AssetStatusBadge.js";import"../AssetEditorV2/components/PrimaryAssetSelect.js";import"../AssetEditorV2/components/SecondaryAssetSelect.js";import"../AssetEditorV2/components/SelectItem.js";import"../AssetEditorV2/components/MultipleAssetsToggle.js";import"../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../EChartsWrapper/EChartsWrapper.js";import"../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../GoogleDocsViewer/index.js";import"../NewDocumentViewer/effects/useFileContent.js";import"../NewDocumentViewer/styles.js";import"../FilesLoaderV2/styles.js";import"../FilesDropzone/styles.js";import"../FilesProcessor/styles.js";import"../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../Formula/useFormulaStyles.js";import"../Formula/RootXIcon.js";import"../Formula/FormulaTextEditor.js";import"../Formula/CloseSuggestion.js";import"../Formula/SuggestionsMenu.js";import{showInfoNotification as ae}from"../../utils/notificationToasts.js";function me(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function ce(e){for(var o=1;o<arguments.length;o++){var s=null!=arguments[o]?arguments[o]:{};o%2?me(Object(s),!0).forEach((function(o){t(e,o,s[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):me(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var de="OffsetWellPickerV4",ue=function(me){var ue,je,fe,Ce=me.open,ve=me.isWDUser,Ae=me.defaultSubjectWell,he=me.currentUser,be=me.offsetSettings,ge=me.addWellsUsabilityInfo,Se=me.isViewOnly,Ie=me.onClose,Te=me.onSave,De=me.maxOffsetSize,ye=void 0===De?_:De,xe=me.localMaxOffsetSize,Ve=void 0===xe?R:xe,Pe=me.syncAutoEnabled,We=me.isManualWellsEnabled,Be=void 0!==We&&We,Ee=i(null),Oe=s(Ee,2),Fe=Oe[0],we=Oe[1],Me=Math.min(ye+1,Ve+1,G+1),Le=Math.min(Math.max(Me,Ve+1),G+1),ke=i(null==be?void 0:be.filterExpanded),He=s(ke,2),Ne=He[0],Re=He[1],Ge=i(null==be?void 0:be.mapHidden),ze=s(Ge,2),Ue=ze[0],_e=ze[1],Ke=+(null==Ae?void 0:Ae.companyId)||+(null==he?void 0:he.company_id),Ze=null==Ae?void 0:Ae.asset_id,qe=i((null==be?void 0:be.filters)||{}),Xe=s(qe,2),Je=Xe[0],Qe=Xe[1],Ye=i((null==be?void 0:be.wellSection)||B),$e=s(Ye,2),et=$e[0],tt=$e[1],ot=r(!0),st=i([]),nt=s(st,2),it=nt[0],rt=nt[1],pt=i(null),lt=s(pt,2),at=lt[0],mt=lt[1],ct=i(!0),dt=s(ct,2),ut=dt[0],jt=dt[1],ft=i(!1),Ct=s(ft,2),vt=Ct[0],At=Ct[1],ht=i(!1),bt=s(ht,2),gt=bt[0],St=bt[1],It=r(),Tt=i(E.none),Dt=s(Tt,2),yt=Dt[0],xt=Dt[1],Vt=r(),Pt=i(!1),Wt=s(Pt,2),Bt=Wt[0],Et=Wt[1],Ot=Le<=(null==it?void 0:it.length),Ft=O[yt],wt=r(),Mt=i(!0),Lt=s(Mt,2),kt=Lt[0],Ht=Lt[1];p((function(){var e,t,o;(Ce&&Ot&&ae("App can’t process more than (".concat(Le-1,") Offset Wells.")),Ce)||((null==be||null===(e=be.selectedWellIds)||void 0===e?void 0:e.length)===(null===(t=wt.current)||void 0===t?void 0:t.length)&&(null==be||null===(o=be.selectedWellIds)||void 0===o?void 0:o.every((function(e){var t;return null===(t=wt.current)||void 0===t?void 0:t.includes(e)})))||(ot.current=!0),wt.current=null==be?void 0:be.selectedWellIds)}),[Ot,Ce,be]),p((function(){function e(){window.innerWidth<=z||ee||te?xt(E.mobile):window.innerHeight<=U?xt(E.small):xt(E.normal)}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[Ce]),p((function(){Vt.current&&yt===Vt.current||(Vt.current=yt,yt===E.small||yt===E.mobile?(_e(!0),Re(!1)):(Re(!Se&&(null==be?void 0:be.filterExpanded)),_e(!Se&&(null==be?void 0:be.mapHidden))),Qe((null==be?void 0:be.filters)||{}),tt((null==be?void 0:be.wellSection)||B))}),[be,Se,yt]);var Nt=v(Ke,ge),Rt=s(Nt,2),Gt=Rt[0],zt=Rt[1],Ut=D(Ke),_t=s(Ut,1)[0],Kt=h(ve,he,Ze,Gt,Be),Zt=s(Kt,7),qt=Zt[0],Xt=Zt[1],Jt=Zt[2],Qt=Zt[3],Yt=Zt[4],$t=Zt[5],eo=Zt[6];p((function(){Ht(!0),Xt(null),Qt(null)}),[Ze]),p((function(){var e,t=(e=o(n.mark((function e(){var t,o,s,i,r,p,l,a,m,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=void 0===(null==be?void 0:be.isSynced)||(null==be?void 0:be.isSynced),o=!0,!t){e.next=19;break}if(i=Jt[B]||[],r=((null==be?void 0:be.selectedWellIds)||[]).every((function(e){return i.includes(e)})),i.length===(null==be||null===(s=be.selectedWellIds)||void 0===s?void 0:s.length)&&r){e.next=16;break}return e.next=8,Z(i,Ze);case 8:p=e.sent,l=p.slice(0,Me+1).map((function(e){return e.id})),l=p.slice(0,Ve+1).map((function(e){return e.id})),a=ce(ce({},be),{},{subjectWellId:Ze,selectedWellIds:l,offsetWellsLimited:Le<=l.length}),m=p.filter((function(e){return l.includes(e.id)})),Te(a,m),e.next=17;break;case 16:o=!1;case 17:e.next=20;break;case 19:o=!1;case 20:if(o){e.next=25;break}return e.next=23,Z((null==be?void 0:be.selectedWellIds)||[],Ze);case 23:c=e.sent,Te(be,c);case 25:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)});Pe&&kt&&be&&Jt&&(t(),Ht(!1))}),[be,Jt,Ze,Le,Pe]);var to=b(Ke,null==be?void 0:be.metricsKeys),oo=s(to,2),so=oo[0],no=oo[1],io=A(Ke,Gt,qt,Jt,Ze,so,Ce),ro=g(io);p((function(){if(io&&qt){var e=io.find((function(e){return e.id===Ze}));if(e){var o=qt.filter((function(e){return e.value!==B})).map((function(e){return e.label})),s=ce(ce({},e),o.length>0&&t({},F.wellSection,o));mt(s)}else mt(null)}}),[qt,io]);var po=T(so),lo=S(io,Je);p((function(){if(lo)if(ot.current||zt){var e=io.filter((function(e){return((null==be?void 0:be.selectedWellIds)||[]).includes(e.id)}));at&&(e=e.concat(at)),rt(c(e,"id")),ot.current=!1}else rt((function(e){var t=(lo||[]).filter((function(t){return!!e.find((function(e){var o=e.id;return t.id===o}))}));return at&&(t=t.concat(at)),c(t,"id")}))}),[io,lo,null==be?void 0:be.selectedWellIds]);var ao=I(at,lo,it,jt,ot.current),mo=s(ao,5),co=mo[0],uo=mo[1],jo=mo[2],fo=mo[3],Co=mo[4],vo=l((function(e,t,o){var s;s=o===K.well.name?t:t.reduce((function(e,t){var o,s=null===(o=io.find((function(e){return e.id===t})))||void 0===o?void 0:o.rigName,n=io.filter((function(e){return e.rigName===s})).map((function(e){return e.id}));return e.concat(n)}),[]);var n=io.filter((function(e){var t=e.id;return s.includes(t)}));e?(n=n.slice(0,Math.min(n.length,Le-it.length)),rt((function(e){return c(e.concat(n),"id")}))):rt((function(e){return d(e.filter((function(e){var t=e.id;return!n.find((function(e){return e.id===t}))})))}))}),[io,it]),Ao=l((function(){St(!0)}),[]),ho=l((function(e){no(e)}),[]),bo=l((function(t,o){rt(o?function(o){return[].concat(e(o),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),go=l((function(e){if(e){var t=at?lo.concat(at):lo,o=u(c(t,"id"),"distance");rt(o.slice(0,Le))}else rt(at?[at]:[])}),[lo,at,Le]),So=function(e){if(Jt){var t=(null==io?void 0:io.filter((function(t){var o;return null===(o=Jt[e])||void 0===o?void 0:o.includes(t.id)})))||[],o=u(t,"distance");rt(o.slice(0,Me))}else rt(at?[at]:[])},Io=l((function(e){tt(e),So(e)}),[So]),To=a((function(){return it.find((function(e){return e.id===Ze}))?it.length-1:it.length}),[it,Ze]),Do=a((function(){if(!Jt)return!1;var e=it.map((function(e){return e.id})),t=Jt[et]||[];return Math.min(t.length,Me)===e.length&&e.every((function(e){return t.includes(e)}))}),[Jt,it,et,Me]),yo=a((function(){return!!_t&&w.includes(_t)}),[_t]),xo=a((function(){return yo?"IDAS generated offsets.":ve?"Offset Selection App.":"WellHub."}),[yo,ve]),Vo=function(){var e=(io||[]).filter((function(e){return((null==be?void 0:be.selectedWellIds)||[]).includes(e.id)}));at&&(e=e.concat(at)),rt(c(e,"id"));var t=ce(ce({},be),{},{mapHidden:Ue,filterExpanded:Ne});Te(t),Qe((null==be?void 0:be.filters)||{}),tt((null==be?void 0:be.wellSection)||B),Ie()},Po=!zt&&(null==io?void 0:io.length)===(null==Gt?void 0:Gt.length),Wo=ut||!Po,Bo=a((function(){return!Wo&&(!Do||(!(j(Je)||!Je[M.sideTracks])||et!==B))}),[Do,Je,et,Wo]),Eo=function(){Qe({}),tt(B),So(B)},Oo=!io||!qt||!Co||yt===E.none,Fo=i(!1),wo=s(Fo,2),Mo=wo[0],Lo=wo[1],ko=i(L),Ho=s(ko,2),No=Ho[0],Ro=Ho[1],Go=i([]),zo=s(Go,2),Uo=zo[0],_o=zo[1];p((function(){if(Co){var e=Co.slice(0,No);_o(e)}}),[Co,No,at]),p((function(){Yt===k.SUCCEEDED&&Eo()}),[Jt]);return J(ie,{open:Ce,onClose:Vo,title:Q(y,{isWDUser:ve,viewType:yt,totalCount:null!==(ue=null==io?void 0:io.length)&&void 0!==ue?ue:0,selectedCount:To,isViewOnly:Se,maxOffsetWellNumber:Le}),isMobile:yt===E.mobile,contentContainerClassName:m(X.offsetWellDialog),contentClassName:m(X.contentContainer,(je={},t(je,X.smallContainer,yt===E.small),t(je,X.contentContainerMobile,yt===E.mobile),je)),actionsClassName:X.modalActions,actions:!Se&&J("div",{className:X.actionsWrapper,children:[!Oo&&Bo?Q(le,{placement:"bottom-start",title:"Reset to Synced Offsets in ".concat(ve?"Offset App":"Wellhub"),children:Q("div",{children:Q(pe,{"data-testid":"".concat(de,"_reset"),onClick:Eo,color:"primary",startIcon:yt!==E.mobile&&Q(f,{}),classes:yt===E.mobile&&{root:X.resetButtonMobile},children:yt!==E.mobile?"Reset":Q(f,{})})})}):Q("div",{className:yt===E.mobile&&X.infoIconContainer,children:yt!==E.mobile?J(Y,{children:[Q("span",{className:m(oe.regular12,oe.colors.t6),children:"The offset list is being automatically populated by "}),Q("span",{className:m(oe.medium12,oe.colors.t6),children:xo})]}):Q(le,{title:J("div",{children:[Q("span",{className:m(oe.regular12,oe.colors.t1),children:"The offset list is being automatically populated by "}),Q("span",{className:m(oe.medium12,oe.colors.t1),children:xo})]}),enterTouchDelay:0,leaveTouchDelay:H,children:Q(C,{className:X.infoIcon})})}),J("div",{className:X.buttonGap,children:[Q(pe,{"data-testid":"".concat(de,"_cancel"),onClick:Vo,color:"primary",children:"Cancel"}),J(pe,{"data-testid":"".concat(de,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){Ie();var e=ce(ce({},be),{},{companyId:Ke,subjectWellId:Ze,selectedWellIds:it.map((function(e){return e.id})),filters:Je,metricsKeys:so,wellSection:et,isSynced:Do,mapHidden:Ue,filterExpanded:Ne,offsetWellsLimited:Ot});Te(e,it)},children:["Select (",To,")"]})]})]}),children:[Q($,{}),Oo?Q(re,{fullscreen:!1}):J("div",{className:m(X.contentWrapper,t({},X.contentBlocked,Wo)),ref:It,children:[yt===E.mobile&&J("div",{className:m(X.countContainer,t({},X.countContainerMobile,yt===E.mobile)),children:[Q(se,{className:X.totalLabel,children:"Total:"}),Q(se,{"data-testid":"".concat(de,"_totalWells"),className:X.countValue,children:io.length}),Q(se,{className:X.selectedLabel,children:"Selected:"}),Q(se,{"data-testid":"".concat(de,"_selected"),className:X.countValue,children:To}),Q(le,{title:"App can’t process more than (".concat(Le-1,") Offset Wells."),placement:"right",children:J(ne,{"data-testid":"".concat(de,"_maxOffsetSize"),className:X.maxOffsetSize,children:["/",Le-1]})})]}),yt===E.normal&&Q(x,{isViewOnly:Se,isXtoProvider:yo,viewType:yt,filters:Je,setFilters:Qe,isFilterExpanded:Ne,setIsFilterExpanded:Re,isMapHidden:Ue,setIsMapHidden:_e,resyncStatus:Yt,setResyncStatus:$t}),Bt&&Q("div",{className:X.topGradient,style:{top:Ft}}),J("div",{className:m(X.content,(fe={},t(fe,X.contentBlocked,Wo),t(fe,X.contentMobile,yt===E.mobile),t(fe,X.contentiOSMobile,q()===N),fe)),onScroll:function(e){return function(e){e.target&&(gt&&(e.target.scrollLeft=0,St(!1)),e.target.scrollLeft<=5&&Mo&&Lo(!1),e.target.scrollLeft>5&&!Mo&&Lo(!0),e.target.scrollTop<=5&&Bt&&Et(!1),e.target.scrollTop>5&&!Bt&&Et(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight+2)>=e.target.scrollHeight&&No<Co.length&&Ro((function(e){return e+L})))}(e)},children:[yt!==E.normal&&Q(x,{isViewOnly:Se,isXtoProvider:yo,viewType:yt,filters:Je,setFilters:Qe,isFilterExpanded:Ne,setIsFilterExpanded:Re,isMapHidden:Ue,setIsMapHidden:_e,resyncStatus:Yt,setResyncStatus:$t}),!Ue&&Ce&&Q(P,{isViewOnly:Se,mapHidden:Ue,subjectWell:at,offsetWellIds:it.map((function(e){return e.id})),wells:lo,radius:Je[M.radius],handleChangeOffsetWell:bo,activeWellId:Fe,viewType:yt}),Q(V,{isHidden:!Ne,isWDUser:ve,filterOptions:ro,filters:Je,wellSections:qt,selectedWellSection:et,subjectWell:at,onChangeFilters:function(e){jt(!0),setTimeout((function(){return Qe(e)}),0)},onChangeBicWells:Io}),Q(W,{open:Ce,isTableLoading:Wo,companyId:Ke,subjectWellId:Ze,sortBy:co,setSortBy:uo,sortDirection:jo,setSortDirection:fo,columnsWithDict:po,wells:Uo,metricsKeys:so,setMetricsKeys:ho,handleChangeOffsetWell:bo,handleChangeAllOffsetWells:go,handleAddRemoveAssets:vo,isWellNameExpand:vt,setIsWellNameExpand:At,isHScrollMoved:Mo,onHideAdvancedSearch:Ao,isViewOnly:Se,isLastWell:Co.length<=No,contentRef:It,isLimitedOffsetWells:Ot,maxOffsetWellNumber:Le,wellSections:qt,setActiveWellId:we,viewType:yt,isWDUser:ve,taScores:eo})]}),Se&&J("div",{className:X.viewOnlyInfoContainer,children:[Q("span",{className:m(oe.regular12,oe.colors.t6),children:"The offset list is being automatically populated by "}),Q("span",{className:m(oe.medium12,oe.colors.t6),children:xo})]})]})]})};export{ue as default};
@@ -1 +1 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var l={offsetWellDialog:"OffsetWellPickerV4-module_offsetWellDialog__EkSjl",viewOnlyTitleLabel:"OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c",contentWrapper:"OffsetWellPickerV4-module_contentWrapper__gVGQ-",contentContainer:"OffsetWellPickerV4-module_contentContainer__Eb9sk",smallContainer:"OffsetWellPickerV4-module_smallContainer__ngDTM",contentContainerMobile:"OffsetWellPickerV4-module_contentContainerMobile__0VZNE",content:"OffsetWellPickerV4-module_content__mEQWD",contentMobile:"OffsetWellPickerV4-module_contentMobile__jM5ou",contentiOSMobile:"OffsetWellPickerV4-module_contentiOSMobile__e4Coq",modalActions:"OffsetWellPickerV4-module_modalActions__cShAH",actionsWrapper:"OffsetWellPickerV4-module_actionsWrapper__C0Ciz",buttonGap:"OffsetWellPickerV4-module_buttonGap__fjFT6",viewOnlyLabel:"OffsetWellPickerV4-module_viewOnlyLabel__GP44N",countContainer:"OffsetWellPickerV4-module_countContainer__p8V5A",countContainerMobile:"OffsetWellPickerV4-module_countContainerMobile__HPiI2",totalLabel:"OffsetWellPickerV4-module_totalLabel__3n5bD",selectedLabel:"OffsetWellPickerV4-module_selectedLabel__BzClE",countValue:"OffsetWellPickerV4-module_countValue__dLG-K",maxOffsetSize:"OffsetWellPickerV4-module_maxOffsetSize__MBfqm",resetButtonMobile:"OffsetWellPickerV4-module_resetButtonMobile__dCDdg",infoIconContainer:"OffsetWellPickerV4-module_infoIconContainer__olAOe",viewOnlyInfoContainer:"OffsetWellPickerV4-module_viewOnlyInfoContainer__Fr4nL",infoIcon:"OffsetWellPickerV4-module_infoIcon__8tuGL",topGradient:"OffsetWellPickerV4-module_topGradient__fAc7W"};e(".OffsetWellPickerV4-module_offsetWellDialog__EkSjl{overflow-y:hidden;width:1100px}.OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c{color:var(--palette-primary-text-6);font-size:16px!important;line-height:140.6%!important;margin-bottom:16px!important;margin-left:40px!important}.OffsetWellPickerV4-module_contentWrapper__gVGQ-{display:flex;flex-direction:column;overflow:hidden auto;position:relative}.OffsetWellPickerV4-module_contentContainer__Eb9sk{display:flex;flex-direction:column;overflow-y:hidden;padding:16px 0 0;position:relative}.OffsetWellPickerV4-module_smallContainer__ngDTM{margin-top:4px}.OffsetWellPickerV4-module_contentContainerMobile__0VZNE{padding-top:0}.OffsetWellPickerV4-module_content__mEQWD{flex:1;margin:0 24px 0 40px;overflow:auto;position:relative}.OffsetWellPickerV4-module_contentMobile__jM5ou{margin:0 0 0 16px}.OffsetWellPickerV4-module_contentiOSMobile__e4Coq{margin:0 16px}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar-corner{background-color:transparent}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar{width:16px}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:hsla(240,2%,65%,.722);border:5px solid rgba(0,0,0,.01);border-radius:10px}.OffsetWellPickerV4-module_modalActions__cShAH{box-shadow:none;justify-content:flex-end}.OffsetWellPickerV4-module_actionsWrapper__C0Ciz{align-items:center;display:flex;flex:1;justify-content:space-between}.OffsetWellPickerV4-module_buttonGap__fjFT6{display:flex;gap:16px}.OffsetWellPickerV4-module_viewOnlyLabel__GP44N{color:var(--palette-primary-text-6);padding-bottom:16px;padding-left:40px}.OffsetWellPickerV4-module_countContainer__p8V5A{align-items:center;display:flex;height:24px;margin:0 0 16px 40px;z-index:9}.OffsetWellPickerV4-module_countContainerMobile__HPiI2{margin-left:16px;margin-top:14px}.OffsetWellPickerV4-module_totalLabel__3n5bD{color:var(--palette-primary-text-6)}.OffsetWellPickerV4-module_selectedLabel__BzClE{color:var(--palette-primary-text-6);padding-left:16px}.OffsetWellPickerV4-module_countValue__dLG-K{color:var(--palette-primary-text-1);padding-left:8px}.OffsetWellPickerV4-module_maxOffsetSize__MBfqm{color:var(--palette-primary-text-6);cursor:default;padding-left:4px}.OffsetWellPickerV4-module_resetButtonMobile__dCDdg{max-height:40px;max-width:40px;min-height:40px;min-width:40px!important}.OffsetWellPickerV4-module_infoIconContainer__olAOe{height:40px}.OffsetWellPickerV4-module_viewOnlyInfoContainer__Fr4nL{padding:24px 40px 0}.OffsetWellPickerV4-module_infoIcon__8tuGL{color:#dadada;height:40px!important;padding:10px;width:40px!important}.OffsetWellPickerV4-module_topGradient__fAc7W{background-image:linear-gradient(0deg,rgba(51,51,51,0),#333);border-bottom:none!important;height:16px!important;padding:0!important;position:absolute;top:120px;width:100%;z-index:3}");export{l as default};
1
+ import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var l={offsetWellDialog:"OffsetWellPickerV4-module_offsetWellDialog__EkSjl",viewOnlyTitleLabel:"OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c",contentWrapper:"OffsetWellPickerV4-module_contentWrapper__gVGQ-",contentContainer:"OffsetWellPickerV4-module_contentContainer__Eb9sk",smallContainer:"OffsetWellPickerV4-module_smallContainer__ngDTM",contentContainerMobile:"OffsetWellPickerV4-module_contentContainerMobile__0VZNE",content:"OffsetWellPickerV4-module_content__mEQWD",contentBlocked:"OffsetWellPickerV4-module_contentBlocked__irOrK",contentMobile:"OffsetWellPickerV4-module_contentMobile__jM5ou",contentiOSMobile:"OffsetWellPickerV4-module_contentiOSMobile__e4Coq",modalActions:"OffsetWellPickerV4-module_modalActions__cShAH",actionsWrapper:"OffsetWellPickerV4-module_actionsWrapper__C0Ciz",buttonGap:"OffsetWellPickerV4-module_buttonGap__fjFT6",viewOnlyLabel:"OffsetWellPickerV4-module_viewOnlyLabel__GP44N",countContainer:"OffsetWellPickerV4-module_countContainer__p8V5A",countContainerMobile:"OffsetWellPickerV4-module_countContainerMobile__HPiI2",totalLabel:"OffsetWellPickerV4-module_totalLabel__3n5bD",selectedLabel:"OffsetWellPickerV4-module_selectedLabel__BzClE",countValue:"OffsetWellPickerV4-module_countValue__dLG-K",maxOffsetSize:"OffsetWellPickerV4-module_maxOffsetSize__MBfqm",resetButtonMobile:"OffsetWellPickerV4-module_resetButtonMobile__dCDdg",infoIconContainer:"OffsetWellPickerV4-module_infoIconContainer__olAOe",viewOnlyInfoContainer:"OffsetWellPickerV4-module_viewOnlyInfoContainer__Fr4nL",infoIcon:"OffsetWellPickerV4-module_infoIcon__8tuGL",topGradient:"OffsetWellPickerV4-module_topGradient__fAc7W"};e(".OffsetWellPickerV4-module_offsetWellDialog__EkSjl{overflow-y:hidden;width:1100px}.OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c{color:var(--palette-primary-text-6);font-size:16px!important;line-height:140.6%!important;margin-bottom:16px!important;margin-left:40px!important}.OffsetWellPickerV4-module_contentWrapper__gVGQ-{display:flex;flex-direction:column;overflow:hidden auto;position:relative}.OffsetWellPickerV4-module_contentContainer__Eb9sk{display:flex;flex-direction:column;overflow-y:hidden;padding:16px 0 0;position:relative}.OffsetWellPickerV4-module_smallContainer__ngDTM{margin-top:4px}.OffsetWellPickerV4-module_contentContainerMobile__0VZNE{padding-top:0}.OffsetWellPickerV4-module_content__mEQWD{flex:1;margin:0 24px 0 40px;overflow:auto;position:relative}.OffsetWellPickerV4-module_contentBlocked__irOrK{overflow:hidden}.OffsetWellPickerV4-module_contentMobile__jM5ou{margin:0 0 0 16px}.OffsetWellPickerV4-module_contentiOSMobile__e4Coq{margin:0 16px}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar-corner{background-color:transparent}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar{width:16px}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:hsla(240,2%,65%,.722);border:5px solid rgba(0,0,0,.01);border-radius:10px}.OffsetWellPickerV4-module_modalActions__cShAH{box-shadow:none;justify-content:flex-end}.OffsetWellPickerV4-module_actionsWrapper__C0Ciz{align-items:center;display:flex;flex:1;justify-content:space-between}.OffsetWellPickerV4-module_buttonGap__fjFT6{display:flex;gap:16px}.OffsetWellPickerV4-module_viewOnlyLabel__GP44N{color:var(--palette-primary-text-6);padding-bottom:16px;padding-left:40px}.OffsetWellPickerV4-module_countContainer__p8V5A{align-items:center;display:flex;height:24px;margin:0 0 16px 40px;z-index:9}.OffsetWellPickerV4-module_countContainerMobile__HPiI2{margin-left:16px;margin-top:14px}.OffsetWellPickerV4-module_totalLabel__3n5bD{color:var(--palette-primary-text-6)}.OffsetWellPickerV4-module_selectedLabel__BzClE{color:var(--palette-primary-text-6);padding-left:16px}.OffsetWellPickerV4-module_countValue__dLG-K{color:var(--palette-primary-text-1);padding-left:8px}.OffsetWellPickerV4-module_maxOffsetSize__MBfqm{color:var(--palette-primary-text-6);cursor:default;padding-left:4px}.OffsetWellPickerV4-module_resetButtonMobile__dCDdg{max-height:40px;max-width:40px;min-height:40px;min-width:40px!important}.OffsetWellPickerV4-module_infoIconContainer__olAOe{height:40px}.OffsetWellPickerV4-module_viewOnlyInfoContainer__Fr4nL{padding:24px 40px 0}.OffsetWellPickerV4-module_infoIcon__8tuGL{color:#dadada;height:40px!important;padding:10px;width:40px!important}.OffsetWellPickerV4-module_topGradient__fAc7W{background-image:linear-gradient(0deg,rgba(51,51,51,0),#333);border-bottom:none!important;height:16px!important;padding:0!important;position:absolute;top:120px;width:100%;z-index:3}");export{l as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import{useState as t,useMemo as r,useRef as n,useEffect as o}from"react";import i from"prop-types";import{get as s}from"lodash";import{withStyles as a,Tooltip as l,makeStyles as p,Chip as c,Input as u}from"@material-ui/core";import d from"@material-ui/icons/Close";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../utils/apiCalls.js";import"../../../effects/useAdvancedWells.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"../../../constants.js";import"../../../../../utils/index.js";import"../../../../../constants/goals.js";import"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import"../../../../../constants/apps.js";import"../../../../../constants/drillstring.js";import"../../../../../constants/completion.js";import"../../../../../constants/appPackages.js";import"../../../../../constants/notifications.js";import"../../../../../constants/feed.js";import"../../../../../constants/bha.js";import"../../../../../utils/env.js";import"../../../../GradientManager/configuration/constants.js";import"@babel/runtime/helpers/typeof";import"moment";import"react-virtualized";import{useAssetsData as m}from"../../../effects/useAssetsData.js";import f from"./AssetTypesSection.js";import h from"./AssetResultSection.js";import{SEARCH_CATEGORIES as x,CATEGORY_KEY_VALUES as g}from"./constants.js";import{jsxs as b,jsx as y,Fragment as j}from"react/jsx-runtime";var C=a((function(){return{tooltip:{backgroundColor:"#414141",color:"#ffffff",fontSize:"11px",lineHeight:"16px",borderRadius:"4px",boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.12)",padding:"4px"}}}))(l),I=p((function(e){return{wrapper:{width:function(e){return e.searchWidth},maxWidth:"996px",display:"flex",flexDirection:"column",padding:16},inputWrapper:{display:"flex",width:"auto",margin:"0 8px 8px",alignItems:"center",flexWrap:"nowrap",justifyContent:"space-between"},selectedChip:{height:"24px",margin:"4px"},selectedChipDeleteIcon:{width:"16px",height:"16px",color:e.palette.primary.text6,"&:hover":{color:e.palette.primary.text1}},selectedLabel:{fontWeight:400,fontSize:"16px",lineHeight:"22px",color:e.palette.primary.text1,whiteSpace:"nowrap",paddingLeft:"4px",paddingRight:"8px"},disabledIcon:{width:"16px",height:"16px",color:e.palette.primary.text6,opacity:.4},closeIconButton:{padding:0,"&:hover $closeIcon":{color:e.palette.primary.text1}},searchInput:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"2px solid #03BCD4"},closeIcon:{color:e.palette.primary.text6,fontSize:"18px"}}})),v=function(i){var a=i.company,l=i.subjectWellId,p=i.value,v=i.selectedWellIds,w=i.onChange,A=t(null),W=e(A,2),R=W[0],S=W[1],k=t(null),D=e(k,2),T=D[0],q=D[1],z=t(1),N=e(z,2),L=N[0],B=N[1],P=r((function(){return window.innerWidth-32}),[]),G=I({searchWidth:P}),H=n();o((function(){q(p)}),[p]);var K=m(T,R,L,a,v),O=e(K,2),U=O[0],F=O[1],M=r((function(){return R&&F&&0!==F.length?F[0][1].filter((function(e){return e.checked})).length:0}),[R,F]);return b("div",{className:G.wrapper,children:[y("div",{className:G.inputWrapper,children:b("div",{className:G.searchInput,children:[R&&b(j,{children:[y(c,{"data-not-migrated-muichip":!0,classes:{root:G.selectedChip,deleteIcon:G.selectedChipDeleteIcon},label:s(x,[R,"labelPlural"],"Assets"),deleteIcon:y(d,{}),onDelete:function(){S(null)}}),M>0&&b("span",{className:G.selectedLabel,children:[M," Selected"]})]}),y(u,{"data-testid":"".concat("AutoCompleteAssetSearch","_searchInput"),inputRef:H,autoFocus:!0,disableUnderline:!0,fullWidth:!0,value:T||"",placeholder:"Add Offset ...",onChange:function(e){var t=e.target.value;H.current.focus(),q(t),B(1)},onKeyUp:function(t){var r=t.target.value,n=t.keyCode,o=g.find((function(t){var n=e(t,2);return n[0],n[1].autoCategorizedKey===r.trim().toLowerCase()}));if(o&&(13===n||32===n))return q(""),S(o[0]),void B(1);""===r&&8===n&&(S(null),B(1))}}),y(C,{title:"Clear",children:y(d,{className:R||T?G.selectedChipDeleteIcon:G.disabledIcon,onClick:function(){H.current.focus(),q(""),S(null),B(1)}})})]})}),!R&&!T&&y(f,{onClickAssetType:function(e){H.current.focus(),S(e),B(1)}}),(R||T)&&y(h,{subjectWellId:l,page:L,assetType:R,loading:U,groupedAssets:F,onClickAsset:function(e,t){w(!e.checked,[e.redirectAssetId],t)},onClickAllAsset:function(e,t){var r=F[0][1];w(e,r.map((function(e){return e.redirectAssetId})),t)},onScrollReached:function(e){"top"===e&&L>1&&B((function(e){return e-1})),"bottom"===e&&B((function(e){return e+1}))}})]})};v.propTypes={subjectWellId:i.number.isRequired,company:i.number.isRequired,value:i.string.isRequired,selectedWellIds:i.arrayOf(i.number).isRequired,onChange:i.func.isRequired};export{v as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import{useState as t,useMemo as r,useRef as n,useEffect as o}from"react";import i from"prop-types";import{get as s}from"lodash";import{withStyles as a,Tooltip as l,makeStyles as p,Chip as c,Input as u}from"@material-ui/core";import d from"@material-ui/icons/Close";import"../../../utils/apiCalls.js";import"../../../effects/useAdvancedWells.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../constants.js";import"../../../../../utils/index.js";import"../../../../../constants/goals.js";import"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import"../../../../../constants/apps.js";import"../../../../../constants/drillstring.js";import"../../../../../constants/completion.js";import"../../../../../constants/appPackages.js";import"../../../../../constants/notifications.js";import"../../../../../constants/feed.js";import"../../../../../constants/bha.js";import"../../../../../utils/env.js";import"../../../../GradientManager/configuration/constants.js";import"@babel/runtime/helpers/typeof";import"moment";import"react-virtualized";import{useAssetsData as m}from"../../../effects/useAssetsData.js";import f from"./AssetTypesSection.js";import h from"./AssetResultSection.js";import{SEARCH_CATEGORIES as x,CATEGORY_KEY_VALUES as g}from"./constants.js";import{jsxs as b,jsx as y,Fragment as j}from"react/jsx-runtime";var C=a((function(){return{tooltip:{backgroundColor:"#414141",color:"#ffffff",fontSize:"11px",lineHeight:"16px",borderRadius:"4px",boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.12)",padding:"4px"}}}))(l),I=p((function(e){return{wrapper:{width:function(e){return e.searchWidth},maxWidth:"996px",display:"flex",flexDirection:"column",padding:16},inputWrapper:{display:"flex",width:"auto",margin:"0 8px 8px",alignItems:"center",flexWrap:"nowrap",justifyContent:"space-between"},selectedChip:{height:"24px",margin:"4px"},selectedChipDeleteIcon:{width:"16px",height:"16px",color:e.palette.primary.text6,"&:hover":{color:e.palette.primary.text1}},selectedLabel:{fontWeight:400,fontSize:"16px",lineHeight:"22px",color:e.palette.primary.text1,whiteSpace:"nowrap",paddingLeft:"4px",paddingRight:"8px"},disabledIcon:{width:"16px",height:"16px",color:e.palette.primary.text6,opacity:.4},closeIconButton:{padding:0,"&:hover $closeIcon":{color:e.palette.primary.text1}},searchInput:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"2px solid #03BCD4"},closeIcon:{color:e.palette.primary.text6,fontSize:"18px"}}})),v=function(i){var a=i.company,l=i.subjectWellId,p=i.value,v=i.selectedWellIds,w=i.onChange,A=t(null),W=e(A,2),R=W[0],S=W[1],k=t(null),D=e(k,2),T=D[0],q=D[1],z=t(1),N=e(z,2),L=N[0],B=N[1],P=r((function(){return window.innerWidth-32}),[]),G=I({searchWidth:P}),H=n();o((function(){q(p)}),[p]);var K=m(T,R,L,a,v),O=e(K,2),U=O[0],F=O[1],M=r((function(){return R&&F&&0!==F.length?F[0][1].filter((function(e){return e.checked})).length:0}),[R,F]);return b("div",{className:G.wrapper,children:[y("div",{className:G.inputWrapper,children:b("div",{className:G.searchInput,children:[R&&b(j,{children:[y(c,{"data-not-migrated-muichip":!0,classes:{root:G.selectedChip,deleteIcon:G.selectedChipDeleteIcon},label:s(x,[R,"labelPlural"],"Assets"),deleteIcon:y(d,{}),onDelete:function(){S(null)}}),M>0&&b("span",{className:G.selectedLabel,children:[M," Selected"]})]}),y(u,{"data-testid":"".concat("AutoCompleteAssetSearch","_searchInput"),inputRef:H,autoFocus:!0,disableUnderline:!0,fullWidth:!0,value:T||"",placeholder:"Add Offset ...",onChange:function(e){var t=e.target.value;H.current.focus(),q(t),B(1)},onKeyUp:function(t){var r=t.target.value,n=t.keyCode,o=g.find((function(t){var n=e(t,2);return n[0],n[1].autoCategorizedKey===r.trim().toLowerCase()}));if(o&&(13===n||32===n))return q(""),S(o[0]),void B(1);""===r&&8===n&&(S(null),B(1))}}),y(C,{title:"Clear",children:y(d,{className:R||T?G.selectedChipDeleteIcon:G.disabledIcon,onClick:function(){H.current.focus(),q(""),S(null),B(1)}})})]})}),!R&&!T&&y(f,{onClickAssetType:function(e){H.current.focus(),S(e),B(1)}}),(R||T)&&y(h,{subjectWellId:l,page:L,assetType:R,loading:U,groupedAssets:F,onClickAsset:function(e,t){w(!e.checked,[e.redirectAssetId],t)},onClickAllAsset:function(e,t){var r=F[0][1];w(e,r.map((function(e){return e.redirectAssetId})),t)},onScrollReached:function(e){"top"===e&&L>1&&B((function(e){return e-1})),"bottom"===e&&B((function(e){return e+1}))}})]})};v.propTypes={subjectWellId:i.number.isRequired,company:i.number.isRequired,value:i.string.isRequired,selectedWellIds:i.arrayOf(i.number).isRequired,onChange:i.func.isRequired};export{v as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as o,useState as s,useRef as r,useEffect as i,useMemo as n,useCallback as p,Fragment as m}from"react";import a from"classnames";import c from"prop-types";import{Table as l,TableHead as d,TableBody as u,TableRow as j,TableCell as C}from"@material-ui/core";import{METRICS_LIST as h,EXPANDED_WELL_NAME_WIDTH as A,TableColumns as f,ViewType as b,ROW_HEIGHT as v,SEARCH_CELL_EXPAND_WIDTH as g,SEARCH_CELL_DEFAULT_WIDTH as S,ColumnType as D}from"../../constants.js";import{getIsImperial as T}from"../../utils/unitSystem.js";import{AdvancedSearch as y}from"./AdvancedSearch/AdvancedSearch.js";import I from"./OffsetWellsTableHead.js";import x from"./OffsetWellsTableRow.js";import V from"./OffsetWellsTable.module.css.js";import{jsxs as P,jsx as B}from"react/jsx-runtime";import"../../../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"lodash";import"@icon-park/react/es/all";import"../../../../icons/IconParkProvider.js";import"../../../../icons/customIcons/icons/AddMessage.js";import"../../../../icons/customIcons/icons/Attention.js";import"../../../../icons/customIcons/icons/Collapse.js";import"../../../../icons/customIcons/icons/Dashboard.js";import"../../../../icons/customIcons/icons/Expand.js";import"../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../icons/customIcons/icons/Search.js";import"../../../../icons/customIcons/icons/Wellhub.js";import"../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../icons/customIcons/icons/Checkbox.js";import"../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../icons/customIcons/icons/Radio.js";import"../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../icons/customIcons/icons/MoreApp.js";import"../../../../icons/customIcons/icons/Pad.js";import"../../../../icons/customIcons/icons/Gap.js";import"../../../../utils/mobileDetect.js";import"../../../IconButton/index.js";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import"../../../../utils/env.js";import"../../../GradientManager/configuration/constants.js";import"../../../Modal/CorvaModal.css.js";import"uuid";import"../../../IconMenu/index.js";import"../../../StyledMenuItem/index.js";import"../../../AppIcon/AppIcon.js";import"../../../DevCenter/AppHeader/AppHeader.js";import"../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/icons";import"../../../DevCenter/AppContext.js";import"../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../utils/index.js";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../../../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../../../componentsV2/Text/Text.js";import"../../../../componentsV2/Grid/Grid.js";import"../../../../componentsV2/Grid/Grid.scss.js";import"../../../../componentsV2/Header/Header.scss.js";import"../../../../componentsV2/Button/Button.js";import"../../../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../../../componentsV2/Tooltip/Tooltip.scss.js";import"../../../../componentsV2/Paper/Paper.js";import"../../../../componentsV2/Popover/Popover.scss.js";import"../../../../componentsV2/Radio/Radio.js";import"../../../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../../../componentsV2/Checkbox/Checkbox.js";import"../../../../componentsV2/TextInput/TextInput.js";import"../../../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../../../componentsV2/TextLink/TextLink.js";import"../../../../componentsV2/Chip/Chip.js";import"../../../../componentsV2/ChipAlert/ChipAlert.js";import"../../../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../../../componentsV2/Avatar/Avatar.js";import"../../../../componentsV2/Avatar/constants.js";import"../../../../componentsV2/AvatarGroup/AvatarGroup.scss.js";import"@material-ui/lab";import"../../../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../../../componentsV2/Modal/Modal.scss.js";import"../../../../componentsV2/Menu/Menu.js";import"../../../../componentsV2/Counter/Counter.js";import"../../../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../../../componentsV2/Switch/Switch.js";import"../../../../componentsV2/Tabs/Tabs.js";import"../../../../componentsV2/EmptyState/EmptyState.scss.js";import"../../../../componentsV2/FileIcon/FileIcon.js";import"react-dropzone";import"../../../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../../../componentsV2/Skeleton/Skeleton.scss.js";import"../../../../utils/main.js";import"../../../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../../../componentsV2/Stepper/Step/Step.scss.js";import"../../../../componentsV2/Stepper/Stepper.scss.js";import"../../../../componentsV2/ButtonLive/ButtonLive.js";import"../../../../componentsV2/LiveDotIndicator/LiveDotIndicator.scss.js";import"../../../../componentsV2/IndicatorLive/IndicatorLive.scss.js";import"../../../../componentsV2/Accordion/Accordion.scss.js";import"../../../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../../../componentsV2/BadgeComment/BadgeComment.js";import"../../../../componentsV2/AppContainer/AppContainer.js";import"../../../../componentsV2/AppContainer/AppContainer.constants.js";import"../../../../componentsV2/AppFooter/AppFooter.js";import"../../../DevCenter/DevCenterAppContainer/components/AppCommons/AppCommonsContext.js";import"../../../../componentsV2/AppHeader/AppHeader.constants.js";import"../../../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../../../componentsV2/AppHeader/AppAssets/AppAssets.js";import"../../../PadModeSelect/PadModeSelect.js";import"../../../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../../../constants/streamSourceType.js";import"../../../../componentsV2/AppHeader/AppHeader.scss.js";import"../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../../../Icons/AnnotationIcon.js";import"../../../Annotations/components/AnnotationsList/index.js";import"../../../Annotations/components/LastAnnotation/index.js";import"../../../Annotations/AnnotationsContext.js";import"../../../Toaster/Toaster.js";import"querystring";import"uuid/v1";import"../../../../clients/subscriptions.js";import"../../../../clients/jsonApi/index.js";import"jsona";import"../../../StatusBadge/constants.js";import"@babel/runtime/helpers/toConsumableArray";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../../clients/api/apiCore.js";import"../../../../clients/constants.js";import"../../../../clients/sso/auth0.js";import"../../../../clients/sso/oauth2.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../HelpCenter/HelpCenterIcon.js";import"../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../DevCenter/SideBar/SideBar.js";import"../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../AssetEditor/index.js";import"../../../AssetEditorV2/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import W from"../../../LoadingIndicator/LoadingIndicator.js";import"../../../Typography.js";import"../../../RealTimeValuesSidebar/RealTimeSidebar.js";import"../../../CollapsableSidebar.js";import"../../../DateTimePicker/index.js";import"../../../DatePicker/index.js";import"../../../ErrorBoundary/ErrorBoundary.js";import"../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../SlateFormattedText/SlateFormattedText.js";import"../../../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../../../EmptyState/EmptyState.js";import"../../../ParameterCharts/ParameterCharts.js";import"../../../ParameterCharts/AddEditTrack.js";import"../../../ChartActionsList/ChartActionsList.js";import"../../../CopyToClipboard/CopyToClipboard.js";import"../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../AssetEditor/SingleAssetEditor.js";import"react-color";import"../../../SettingEditors/ColorEditor/style.css.js";import"../../../SettingEditors/DropdownEditor/index.js";import"../../../SwitchControl/index.js";import"../../../ColorPicker/ColorPicker.js";import"../../../Chart/components/ChartButton.js";import"../../../Chart/components/ChartButtons.js";import"../../../Chart/components/ChartWrapper.js";import"../../../Chart/components/AxisDropdown.js";import"../../../Chart/components/ChartSelect.js";import"../../../Chart/components/buttons/DragToZoomButton.js";import"../../../Chart/components/buttons/ZoomInButton.js";import"../../../Chart/components/buttons/ZoomOutButton.js";import"../../../Chart/components/buttons/PanButton.js";import"../../../Chart/components/buttons/ResetZoomButton.js";import"../../../Chart/components/buttons/HideAxesButton.js";import"../../../Chart/components/buttons/ChartTypeButton.js";import"../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../TruncatedText/index.js";import"../../../MiddleTruncatedText/MiddleTruncatedText.js";import"../../../RangeSlider/constants.js";import"../../../RangeSlider/Input.css.js";import"../../../RangeSlider/RangeSlider.css.js";import"../../../AdvancedSlider/AdvancedSlider.js";import"../../../Breadcrumbs/index.js";import"../../../VirtualizedTable/index.js";import"../../../EmptyView/EmptyView.js";import"../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../Button/components/Button/index.js";import"moment-timezone";import"../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../../../Button/components/LiveButton/styles.js";import"../../../ContextMenuItem/index.js";import"../../../FolderMenuItem/index.js";import"../../../EditableItem/EditableItem/index.js";import"../../../EditableItem/EditableItemWithBadge/index.js";import"../../../Checkbox/index.js";import"../../../FolderMenuItemWithLinks/index.js";import"../../../TextField/index.js";import"../../../Chip/index.js";import"../../../Counter/index.js";import"../../../AnchorsList/AnchorsList.js";import"../../../Select/index.js";import"../../../Select/SelectFilterBy.js";import"../../../CustomSelect/index.js";import"../../../Tabs/Tabs.js";import"../../../Tabs/Tab.js";import"../../../ResizableTable/ResizableTable.js";import"../../../GradientPicker/GradientPicker.js";import"../../../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../../../GradientManager/GradientPreview/GradientPreview.js";import"../../../GradientManager/GradientSelect.styles.js";import"../../../GradientManager/GradientManager.styles.js";import"../../../Drillstring/BHASchematic.js";import"../../../Drillstring/BHATable/index.js";import"../../../Drillstring/BHAComponentIcon.js";import"../../../Drillstring/BHAComponentDetail/index.js";import"../../../Drillstring/BHATileIcon.js";import"../../../Drillstring/BHATile/BHATile.js";import"../../../Drillstring/BHAList/BHAList.js";import"../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../Casing/CasingTable/index.js";import"../../../Casing/CasingComponentIcon.js";import"../../../Casing/CasingTileIcon.js";import"../../../Casing/CasingTableV2/CasingTableV2.js";import"../../../Casing/CasingTile/CasingTile.js";import"../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../WellSummary/WellSummaryItemLabel.js";import"../../../WellSummary/WellSummaryItemTitle.js";import"../../../WellSummary/WellSummaryItemValue.js";import"../../../WellSummary/ActivitySummaryChart.js";import"../../../WellSummary/FracWirelineTimeChart.js";import"../../../BICOffsetPickerDialog/index.js";import"../../../OffsetWellButton/OffsetWellButton.js";import"../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../OffsetWellPickerV3/index.js";import"../../../OffsetWellChips/Chip.js";import"../../../OffsetWellChips/ChipsContainer.js";import"../../utils/apiCalls.js";import"../../effects/useAdvancedWells.js";import"react-virtualized";import"../../effects/useAssetsData.js";import"../AppHeader/AppHeader.js";import"../Toolbar/Toolbar.js";import"../Filter/Filter.js";import"../Map/WellsMap.js";import"./AdvancedSearch/constants.js";import"../../utils/index.js";import"../../OffsetWellPickerV4.module.css.js";import"@material-ui/core/Snackbar";import"../../../Notifications/Toast.js";import"../../../../styles/typography/index.js";import"../../../../styles/counter/counter.module.scss.js";import"../../../OffsetWellMap/OffsetWellMap.js";import"../../../ConfirmationDialog.js";import"../../../TextLink/index.js";import"../../../Avatar/index.js";import"../../../Template/TemplatePopover/index.js";import"../../../Template/TemplateSharingDialog/index.js";import"../../../MenuItem/index.js";import"../../../MiddleTruncate/MiddleTruncate.js";import"../../../PinnableFilters/PinnableFilters.js";import"../../../HeaderLayout/HeaderLayout.js";import"../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../PadOffsetsPicker/StagesSelector.js";import"../../../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../../../Table/TableToolbar/TableToolbar.js";import"../../../Table/TableContainer/TableContainer.js";import"../../../Table/TableCell/TableCell.js";import"../../../Table/TablePagination/TablePagination.js";import"../../../Table/TablePaginationActions/TablePaginationActions.js";import"../../../Tooltip/ScrollableTooltip.js";import"../../../PriceInput/PriceInput.js";import"../../../LabelsCounter/LabelsCounter.js";import"../../../Stepper/Stepper.js";import"../../../Stepper/Step/Step.js";import"../../../Stepper/StepsWrapper.js";import"../../../Comment/CommentIcon/index.js";import"../../../FilesLoader/FilesLoader.js";import"../../../SearchInput/index.js";import"../../../FeedItem/FeedItem.js";import"../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../PostInput/PostInput.js";import"../../../KeyboardDateTimePicker.js";import"../../../AddComment/Popover.js";import"../../../AddComment/Popup.js";import"../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../StageDesignVActual/ComparisonHeader.js";import"../../../StageDesignVActual/ComparisonRow.js";import"../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../EmbeddedApp/EmbeddedApp.js";import"../../../Autocomplete/Autocomplete.js";import"../../../DocumentViewer/DocumentViewer.js";import"../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../Search/Search.js";import"../../../Search/components/Listbox.js";import"../../../Search/components/Paper.js";import"../../../Search/components/RecentSearches.js";import"../../../Search/components/Groups.js";import"../../../Search/components/SelectAllListItem.js";import"../../../StatusBadge/index.js";import"../../../Attachment/index.js";import"../../../EmojiIconButton.js";import"../../../FileUploadIconButton.js";import"../../../FilePreview/index.js";import"../../../FailedFileUploading.js";import"../../../UserMention/index.js";import"../../../CommentsInfo/index.js";import"../../../CommentInput/index.js";import"../../../Comment/index.js";import"../../../CommentLoader.js";import"../../../AssetNameLabel/AssetStatusBadge.js";import"../../../AssetEditorV2/components/PrimaryAssetSelect.js";import"../../../AssetEditorV2/components/SecondaryAssetSelect.js";import"../../../AssetEditorV2/components/SelectItem.js";import"../../../AssetEditorV2/components/MultipleAssetsToggle.js";import"../../../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../../../EChartsWrapper/EChartsWrapper.js";import"../../../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../../../GoogleDocsViewer/index.js";import"../../../NewDocumentViewer/effects/useFileContent.js";import"../../../NewDocumentViewer/styles.js";import"../../../FilesLoaderV2/styles.js";import"../../../FilesDropzone/styles.js";import"../../../FilesProcessor/styles.js";import"../../../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../../../Formula/useFormulaStyles.js";import"../../../Formula/RootXIcon.js";import"../../../Formula/FormulaTextEditor.js";import"../../../Formula/CloseSuggestion.js";import"../../../Formula/SuggestionsMenu.js";function w(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function E(e){for(var o=1;o<arguments.length;o++){var s=null!=arguments[o]?arguments[o]:{};o%2?w(Object(s),!0).forEach((function(o){t(e,o,s[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):w(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var O=function(o){var c=o.open,w=o.isTableLoading,O=o.companyId,L=o.subjectWellId,F=o.sortBy,R=o.setSortBy,M=o.sortDirection,k=o.setSortDirection,H=o.columnsWithDict,q=o.wells,N=o.metricsKeys,G=o.setMetricsKeys,z=o.handleChangeOffsetWell,K=o.handleChangeAllOffsetWells,U=o.handleAddRemoveAssets,Z=o.isWellNameExpand,X=o.setIsWellNameExpand,J=o.isHScrollMoved,Q=o.onHideAdvancedSearch,Y=o.isViewOnly,$=o.isLastWell,_=o.contentRef,ee=o.isLimitedOffsetWells,te=o.maxOffsetWellNumber,oe=o.wellSections,se=o.setActiveWellId,re=o.viewType,ie=o.isWDUser,ne=o.taScores,pe=s([]),me=e(pe,2),ae=me[0],ce=me[1],le=s(null),de=e(le,2),ue=de[0],je=de[1],Ce=s(0),he=e(Ce,2),Ae=he[0],fe=he[1],be=s(0),ve=e(be,2),ge=ve[0],Se=ve[1],De=r(),Te=r(),ye=r();i((function(){if(!ue)return ce(q),void Se(0);var t=function(e,t,o,s){var r,i=e.findIndex((function(e){return t===e.id})),n=o.findIndex((function(e){return t===e.id}));-1===n&&(n=o.length);var p=Math.round(((null===(r=s.current)||void 0===r?void 0:r.clientHeight)-145)/v+1),m=n-i;Math.abs(m)>p&&(n=i+p*Math.sign(m));var a=n-i;return[i,n,a,200*(.4*Math.abs(a)+2),Math.min(i,n),(Math.abs(a)+1)*v]}(ae,ue,q,_),o=e(t,6),s=o[0],r=o[1],i=o[2],n=o[3],p=o[4],m=o[5];if(ye.current=n,r===s)ce(q);else{fe(p),Se(m);var a=function(e,t,o,s){return e.map((function(e,r){var i=o<r&&r<=s||s<=r&&r<o;return r===o?E(E({},e),{},{moveTo:t}):i?E(E({},e),{},{moveTo:o<s?-1:1,delayTime:Math.abs(r-o)}):e}))}(ae,i,s,r);ce(a),setTimeout((function(){ce(q),Se(0),je(null)}),n)}}),[q]);var Ie=n((function(){var e=ae.filter((function(e){return e.checked}));return[e,ae.length!==e.length&&e.length&&!ee,e.length===ae.length||ee]}),[ae,ee]),xe=e(Ie,3),Ve=xe[0],Pe=xe[1],Be=xe[2],We=n((function(){return T()}),[]),we=n((function(){return(N||[]).reduce((function(e,t){return e.concat(h.filter((function(e){return e.key===t})))}),[])}),[N]),Ee=n((function(){return Z?A-58:f[0].width[N.length]-58}),[Z,null==N?void 0:N.length]),Oe=n((function(){var e=Z?g:S;return ne.length&&(e+=function(e,t){var o=e.find((function(e){return e.key===t}));return(null==o?void 0:o.width)||0}(H,D.taScore)),"".concat(e,"px")}),[Z,ne]);i((function(){if(re!==b.mobile&&De.current&&Te.current){var e=De.current.querySelector(".".concat(V.wellNameFixed));J?e.classList.remove(V.noShadow):e.classList.add(V.noShadow);var t=Te.current.querySelectorAll(".".concat(V.wellNameFixed));J?t.forEach((function(e){return e.classList.remove(V.noShadow)})):t.forEach((function(e){return e.classList.add(V.noShadow)}))}}),[J,Te.current,De.current,ae]);var Le=p((function(e,t){R(e),k(t)}),[]),Fe=p((function(e){G(e)}),[]),Re=p((function(e,t){G((function(o){return o.map((function(o){return o===e?t:o}))}))}),[]);return H&&ae?P("div",{className:V.offsetWellsTable,children:[B("div",{className:V.stickyTable,children:B(l,{"aria-label":"ows table head",innerRef:De,children:B(d,{children:B(I,{open:c,columnsWithDict:H,metricsKeys:N,sortBy:F,sortDirection:M,indeterminate:Pe,isAllWellsSelected:Be,onChangeSort:Le,onChangeMetricsKeys:Fe,onUpdateMetricsKey:Re,isWellNameExpand:Z,setIsWellNameExpand:X,handleChangeAllOffsetWells:K,wellNameStyle:V.wellNameFixed,isViewOnly:Y,isImperial:We,contentRef:_,viewType:re,isTaColumnVisible:!!ne.length})})})}),!Y&&P("div",{className:a(V.searchCellWrapper,t({},V.searchCellWrapperExpanded,Z)),style:{"--dynamic-search-wrapper-width":Oe},children:[B("div",{className:V.searchCell,children:B(y,{companyId:O,subjectWellId:L,onChange:U,selectedWellIds:Ve.map((function(e){return e.id})),onHideAdvancedSearch:Q})}),!!Z&&B("div",{className:V.searchCellEmpty})]}),B(l,{"aria-label":"ows table body",innerRef:Te,className:V.bodyTable,children:P(u,{children:[B(j,{children:B(C,{className:a(V.topShadow,t({},V.viewOnlyShadow,Y))})}),ae.map((function(e,t){return P(m,{children:[B(j,{children:ue&&ge>0&&t===Ae&&B(C,{style:{height:ge}})}),B(x,{columnsWithDict:H,subjectWellId:L,data:e,metricsKeys:N,metricsColumns:we,handleChangeOffsetWell:z,isWellNameExpand:Z,wellNameStyle:V.wellNameFixed,wellNameWidth:Ee,isViewOnly:Y,isImperial:We,isLimitedOffsetWells:ee,maxOffsetWellNumber:te,wellSections:oe,setActiveWellId:se,viewType:re,newCheckedWellId:null!=e&&e.moveTo?ue:0,setNewCheckedWellId:je,index:null!=e&&e.moveTo?t:0,flyDuration:null!=e&&e.moveTo?ye.current:0,isWDUser:ie,taScores:ne})]},e.id)})),!$&&B(j,{children:B(C,{className:V.loadingCell,children:B("span",{children:"Loading..."})})}),B(j,{children:B(C,{className:V.bottomShadow})})]})}),w&&B(W,{fullscreen:!1,className:V.loadingContainer})]}):null};O.propTypes={open:c.bool.isRequired,isTableLoading:c.bool.isRequired,companyId:c.number.isRequired,subjectWellId:c.number.isRequired,sortBy:c.string.isRequired,setSortBy:c.func.isRequired,sortDirection:c.string.isRequired,setSortDirection:c.func.isRequired,columnsWithDict:c.arrayOf(c.shape({})).isRequired,wells:c.arrayOf(c.shape({})).isRequired,metricsKeys:c.arrayOf(c.string).isRequired,setMetricsKeys:c.func.isRequired,handleChangeOffsetWell:c.func.isRequired,handleChangeAllOffsetWells:c.func.isRequired,handleAddRemoveAssets:c.func.isRequired,setIsWellNameExpand:c.func.isRequired,isWellNameExpand:c.bool.isRequired,isHScrollMoved:c.bool.isRequired,onHideAdvancedSearch:c.func.isRequired,isViewOnly:c.bool.isRequired,isLastWell:c.bool.isRequired,isLimitedOffsetWells:c.bool.isRequired,maxOffsetWellNumber:c.number.isRequired,contentRef:c.shape({}).isRequired,wellSections:c.arrayOf(c.shape({})).isRequired,setActiveWellId:c.func.isRequired,viewType:c.string.isRequired,isWDUser:c.bool.isRequired,taScores:c.arrayOf(c.shape({})).isRequired};var L=o(O);export{L as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as o,useState as s,useRef as r,useEffect as i,useMemo as n,useCallback as p,Fragment as m}from"react";import a from"classnames";import c from"prop-types";import{Table as l,TableHead as d,TableBody as u,TableRow as j,TableCell as C}from"@material-ui/core";import{METRICS_LIST as h,EXPANDED_WELL_NAME_WIDTH as A,TableColumns as f,ViewType as b,ROW_HEIGHT as v,SEARCH_CELL_EXPAND_WIDTH as g,SEARCH_CELL_DEFAULT_WIDTH as S,ColumnType as D}from"../../constants.js";import{getIsImperial as T}from"../../utils/unitSystem.js";import{AdvancedSearch as y}from"./AdvancedSearch/AdvancedSearch.js";import I from"./OffsetWellsTableHead.js";import x from"./OffsetWellsTableRow.js";import V from"./OffsetWellsTable.module.css.js";import{jsxs as P,jsx as B}from"react/jsx-runtime";import"../../../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"lodash";import"@icon-park/react/es/all";import"../../../../icons/IconParkProvider.js";import"../../../../icons/customIcons/icons/AddMessage.js";import"../../../../icons/customIcons/icons/Attention.js";import"../../../../icons/customIcons/icons/Collapse.js";import"../../../../icons/customIcons/icons/Dashboard.js";import"../../../../icons/customIcons/icons/Expand.js";import"../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../icons/customIcons/icons/Search.js";import"../../../../icons/customIcons/icons/Wellhub.js";import"../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../icons/customIcons/icons/Checkbox.js";import"../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../icons/customIcons/icons/Radio.js";import"../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../icons/customIcons/icons/MoreApp.js";import"../../../../icons/customIcons/icons/Pad.js";import"../../../../icons/customIcons/icons/Gap.js";import"../../../../utils/mobileDetect.js";import"../../../IconButton/index.js";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import"../../../../utils/env.js";import"../../../GradientManager/configuration/constants.js";import"../../../Modal/CorvaModal.css.js";import"uuid";import"../../../IconMenu/index.js";import"../../../StyledMenuItem/index.js";import"../../../AppIcon/AppIcon.js";import"../../../DevCenter/AppHeader/AppHeader.js";import"../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/icons";import"../../../DevCenter/AppContext.js";import"../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../utils/index.js";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../../../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../../../componentsV2/Text/Text.js";import"../../../../componentsV2/Grid/Grid.js";import"../../../../componentsV2/Grid/Grid.scss.js";import"../../../../componentsV2/Header/Header.scss.js";import"../../../../componentsV2/Button/Button.js";import"../../../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../../../componentsV2/Tooltip/Tooltip.scss.js";import"../../../../componentsV2/Paper/Paper.js";import"../../../../componentsV2/Popover/Popover.scss.js";import"../../../../componentsV2/Radio/Radio.js";import"../../../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../../../componentsV2/Checkbox/Checkbox.js";import"../../../../componentsV2/TextInput/TextInput.js";import"../../../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../../../componentsV2/TextLink/TextLink.js";import"../../../../componentsV2/Chip/Chip.js";import"../../../../componentsV2/ChipAlert/ChipAlert.js";import"../../../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../../../componentsV2/Avatar/Avatar.js";import"../../../../componentsV2/Avatar/constants.js";import"../../../../componentsV2/AvatarGroup/AvatarGroup.scss.js";import"@material-ui/lab";import"../../../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../../../componentsV2/Modal/Modal.scss.js";import"../../../../componentsV2/Menu/Menu.js";import"../../../../componentsV2/Counter/Counter.js";import"../../../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../../../componentsV2/Switch/Switch.js";import"../../../../componentsV2/Tabs/Tabs.js";import"../../../../componentsV2/EmptyState/EmptyState.scss.js";import"../../../../componentsV2/FileIcon/FileIcon.js";import"react-dropzone";import"../../../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../../../componentsV2/Skeleton/Skeleton.scss.js";import"../../../../utils/main.js";import"../../../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../../../componentsV2/Stepper/Step/Step.scss.js";import"../../../../componentsV2/Stepper/Stepper.scss.js";import"../../../../componentsV2/ButtonLive/ButtonLive.js";import"../../../../componentsV2/LiveDotIndicator/LiveDotIndicator.scss.js";import"../../../../componentsV2/IndicatorLive/IndicatorLive.scss.js";import"../../../../componentsV2/Accordion/Accordion.scss.js";import"../../../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../../../componentsV2/BadgeComment/BadgeComment.js";import"../../../../componentsV2/AppContainer/AppContainer.js";import"../../../../componentsV2/AppContainer/AppContainer.constants.js";import"../../../../componentsV2/AppFooter/AppFooter.js";import"../../../DevCenter/DevCenterAppContainer/components/AppCommons/AppCommonsContext.js";import"../../../../componentsV2/AppHeader/AppHeader.constants.js";import"../../../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../../../componentsV2/AppHeader/AppAssets/AppAssets.js";import"../../../PadModeSelect/PadModeSelect.js";import"../../../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../../../constants/streamSourceType.js";import"../../../../componentsV2/AppHeader/AppHeader.scss.js";import"../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../../../Icons/AnnotationIcon.js";import"../../../Annotations/components/AnnotationsList/index.js";import"../../../Annotations/components/LastAnnotation/index.js";import"../../../Annotations/AnnotationsContext.js";import"../../../Toaster/Toaster.js";import"querystring";import"uuid/v1";import"../../../../clients/subscriptions.js";import"../../../../clients/jsonApi/index.js";import"jsona";import"../../../StatusBadge/constants.js";import"@babel/runtime/helpers/toConsumableArray";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../../clients/api/apiCore.js";import"../../../../clients/constants.js";import"../../../../clients/sso/auth0.js";import"../../../../clients/sso/oauth2.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../HelpCenter/HelpCenterIcon.js";import"../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../DevCenter/SideBar/SideBar.js";import"../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../AssetEditor/index.js";import"../../../AssetEditorV2/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import W from"../../../LoadingIndicator/LoadingIndicator.js";import"../../../Typography.js";import"../../../RealTimeValuesSidebar/RealTimeSidebar.js";import"../../../CollapsableSidebar.js";import"../../../DateTimePicker/index.js";import"../../../DatePicker/index.js";import"../../../ErrorBoundary/ErrorBoundary.js";import"../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../SlateFormattedText/SlateFormattedText.js";import"../../../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../../../EmptyState/EmptyState.js";import"../../../ParameterCharts/ParameterCharts.js";import"../../../ParameterCharts/AddEditTrack.js";import"../../../ChartActionsList/ChartActionsList.js";import"../../../CopyToClipboard/CopyToClipboard.js";import"../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../AssetEditor/SingleAssetEditor.js";import"react-color";import"../../../SettingEditors/ColorEditor/style.css.js";import"../../../SettingEditors/DropdownEditor/index.js";import"../../../SwitchControl/index.js";import"../../../ColorPicker/ColorPicker.js";import"../../../Chart/components/ChartButton.js";import"../../../Chart/components/ChartButtons.js";import"../../../Chart/components/ChartWrapper.js";import"../../../Chart/components/AxisDropdown.js";import"../../../Chart/components/ChartSelect.js";import"../../../Chart/components/buttons/DragToZoomButton.js";import"../../../Chart/components/buttons/ZoomInButton.js";import"../../../Chart/components/buttons/ZoomOutButton.js";import"../../../Chart/components/buttons/PanButton.js";import"../../../Chart/components/buttons/ResetZoomButton.js";import"../../../Chart/components/buttons/HideAxesButton.js";import"../../../Chart/components/buttons/ChartTypeButton.js";import"../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../TruncatedText/index.js";import"../../../MiddleTruncatedText/MiddleTruncatedText.js";import"../../../RangeSlider/constants.js";import"../../../RangeSlider/Input.css.js";import"../../../RangeSlider/RangeSlider.css.js";import"../../../AdvancedSlider/AdvancedSlider.js";import"../../../Breadcrumbs/index.js";import"../../../VirtualizedTable/index.js";import"../../../EmptyView/EmptyView.js";import"../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../Button/components/Button/index.js";import"moment-timezone";import"../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../../../Button/components/LiveButton/styles.js";import"../../../ContextMenuItem/index.js";import"../../../FolderMenuItem/index.js";import"../../../EditableItem/EditableItem/index.js";import"../../../EditableItem/EditableItemWithBadge/index.js";import"../../../Checkbox/index.js";import"../../../FolderMenuItemWithLinks/index.js";import"../../../TextField/index.js";import"../../../Chip/index.js";import"../../../Counter/index.js";import"../../../AnchorsList/AnchorsList.js";import"../../../Select/index.js";import"../../../Select/SelectFilterBy.js";import"../../../CustomSelect/index.js";import"../../../Tabs/Tabs.js";import"../../../Tabs/Tab.js";import"../../../ResizableTable/ResizableTable.js";import"../../../GradientPicker/GradientPicker.js";import"../../../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../../../GradientManager/GradientPreview/GradientPreview.js";import"../../../GradientManager/GradientSelect.styles.js";import"../../../GradientManager/GradientManager.styles.js";import"../../../Drillstring/BHASchematic.js";import"../../../Drillstring/BHATable/index.js";import"../../../Drillstring/BHAComponentIcon.js";import"../../../Drillstring/BHAComponentDetail/index.js";import"../../../Drillstring/BHATileIcon.js";import"../../../Drillstring/BHATile/BHATile.js";import"../../../Drillstring/BHAList/BHAList.js";import"../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../Casing/CasingTable/index.js";import"../../../Casing/CasingComponentIcon.js";import"../../../Casing/CasingTileIcon.js";import"../../../Casing/CasingTableV2/CasingTableV2.js";import"../../../Casing/CasingTile/CasingTile.js";import"../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../WellSummary/WellSummaryItemLabel.js";import"../../../WellSummary/WellSummaryItemTitle.js";import"../../../WellSummary/WellSummaryItemValue.js";import"../../../WellSummary/ActivitySummaryChart.js";import"../../../WellSummary/FracWirelineTimeChart.js";import"../../../BICOffsetPickerDialog/index.js";import"../../../OffsetWellButton/OffsetWellButton.js";import"../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../OffsetWellPickerV3/index.js";import"../../../OffsetWellChips/Chip.js";import"../../../OffsetWellChips/ChipsContainer.js";import"../../utils/apiCalls.js";import"../../effects/useAdvancedWells.js";import"react-virtualized";import"../../effects/useAssetsData.js";import"../AppHeader/AppHeader.js";import"../Toolbar/Toolbar.js";import"../Filter/Filter.js";import"../Map/WellsMap.js";import"./AdvancedSearch/constants.js";import"../../utils/index.js";import"../../OffsetWellPickerV4.module.css.js";import"@material-ui/core/Snackbar";import"../../../Notifications/Toast.js";import"../../../../styles/typography/index.js";import"../../../../styles/counter/counter.module.scss.js";import"../../../OffsetWellMap/OffsetWellMap.js";import"../../../ConfirmationDialog.js";import"../../../TextLink/index.js";import"../../../Avatar/index.js";import"../../../Template/TemplatePopover/index.js";import"../../../Template/TemplateSharingDialog/index.js";import"../../../MenuItem/index.js";import"../../../MiddleTruncate/MiddleTruncate.js";import"../../../PinnableFilters/PinnableFilters.js";import"../../../HeaderLayout/HeaderLayout.js";import"../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../PadOffsetsPicker/StagesSelector.js";import"../../../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../../../Table/TableToolbar/TableToolbar.js";import"../../../Table/TableContainer/TableContainer.js";import"../../../Table/TableCell/TableCell.js";import"../../../Table/TablePagination/TablePagination.js";import"../../../Table/TablePaginationActions/TablePaginationActions.js";import"../../../Tooltip/ScrollableTooltip.js";import"../../../PriceInput/PriceInput.js";import"../../../LabelsCounter/LabelsCounter.js";import"../../../Stepper/Stepper.js";import"../../../Stepper/Step/Step.js";import"../../../Stepper/StepsWrapper.js";import"../../../Comment/CommentIcon/index.js";import"../../../FilesLoader/FilesLoader.js";import"../../../SearchInput/index.js";import"../../../FeedItem/FeedItem.js";import"../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../PostInput/PostInput.js";import"../../../KeyboardDateTimePicker.js";import"../../../AddComment/Popover.js";import"../../../AddComment/Popup.js";import"../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../StageDesignVActual/ComparisonHeader.js";import"../../../StageDesignVActual/ComparisonRow.js";import"../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../EmbeddedApp/EmbeddedApp.js";import"../../../Autocomplete/Autocomplete.js";import"../../../DocumentViewer/DocumentViewer.js";import"../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../Search/Search.js";import"../../../Search/components/Listbox.js";import"../../../Search/components/Paper.js";import"../../../Search/components/RecentSearches.js";import"../../../Search/components/Groups.js";import"../../../Search/components/SelectAllListItem.js";import"../../../StatusBadge/index.js";import"../../../Attachment/index.js";import"../../../EmojiIconButton.js";import"../../../FileUploadIconButton.js";import"../../../FilePreview/index.js";import"../../../FailedFileUploading.js";import"../../../UserMention/index.js";import"../../../CommentsInfo/index.js";import"../../../CommentInput/index.js";import"../../../Comment/index.js";import"../../../CommentLoader.js";import"../../../AssetNameLabel/AssetStatusBadge.js";import"../../../AssetEditorV2/components/PrimaryAssetSelect.js";import"../../../AssetEditorV2/components/SecondaryAssetSelect.js";import"../../../AssetEditorV2/components/SelectItem.js";import"../../../AssetEditorV2/components/MultipleAssetsToggle.js";import"../../../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../../../EChartsWrapper/EChartsWrapper.js";import"../../../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../../../GoogleDocsViewer/index.js";import"../../../NewDocumentViewer/effects/useFileContent.js";import"../../../NewDocumentViewer/styles.js";import"../../../FilesLoaderV2/styles.js";import"../../../FilesDropzone/styles.js";import"../../../FilesProcessor/styles.js";import"../../../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../../../Formula/useFormulaStyles.js";import"../../../Formula/RootXIcon.js";import"../../../Formula/FormulaTextEditor.js";import"../../../Formula/CloseSuggestion.js";import"../../../Formula/SuggestionsMenu.js";function w(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function E(e){for(var o=1;o<arguments.length;o++){var s=null!=arguments[o]?arguments[o]:{};o%2?w(Object(s),!0).forEach((function(o){t(e,o,s[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):w(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var O=function(o){var c=o.open,w=o.isTableLoading,O=o.companyId,L=o.subjectWellId,F=o.sortBy,R=o.setSortBy,M=o.sortDirection,k=o.setSortDirection,H=o.columnsWithDict,N=o.wells,q=o.metricsKeys,G=o.setMetricsKeys,z=o.handleChangeOffsetWell,K=o.handleChangeAllOffsetWells,U=o.handleAddRemoveAssets,Z=o.isWellNameExpand,X=o.setIsWellNameExpand,J=o.isHScrollMoved,Q=o.onHideAdvancedSearch,Y=o.isViewOnly,$=o.isLastWell,_=o.contentRef,ee=o.isLimitedOffsetWells,te=o.maxOffsetWellNumber,oe=o.wellSections,se=o.setActiveWellId,re=o.viewType,ie=o.isWDUser,ne=o.taScores,pe=s([]),me=e(pe,2),ae=me[0],ce=me[1],le=s(null),de=e(le,2),ue=de[0],je=de[1],Ce=s(0),he=e(Ce,2),Ae=he[0],fe=he[1],be=s(0),ve=e(be,2),ge=ve[0],Se=ve[1],De=r(),Te=r(),ye=r();i((function(){if(!ue)return ce(N),void Se(0);var t=function(e,t,o,s){var r,i=e.findIndex((function(e){return t===e.id})),n=o.findIndex((function(e){return t===e.id}));-1===n&&(n=o.length);var p=Math.round(((null===(r=s.current)||void 0===r?void 0:r.clientHeight)-145)/v+1),m=n-i;Math.abs(m)>p&&(n=i+p*Math.sign(m));var a=n-i;return[i,n,a,200*(.4*Math.abs(a)+2),Math.min(i,n),(Math.abs(a)+1)*v]}(ae,ue,N,_),o=e(t,6),s=o[0],r=o[1],i=o[2],n=o[3],p=o[4],m=o[5];if(ye.current=n,r===s)ce(N);else{fe(p),Se(m);var a=function(e,t,o,s){return e.map((function(e,r){var i=o<r&&r<=s||s<=r&&r<o;return r===o?E(E({},e),{},{moveTo:t}):i?E(E({},e),{},{moveTo:o<s?-1:1,delayTime:Math.abs(r-o)}):e}))}(ae,i,s,r);ce(a),setTimeout((function(){ce(N),Se(0),je(null)}),n)}}),[N,N.length]);var Ie=n((function(){var e=ae.filter((function(e){return e.checked}));return[e,ae.length!==e.length&&e.length&&!ee,e.length===ae.length||ee]}),[ae,ee]),xe=e(Ie,3),Ve=xe[0],Pe=xe[1],Be=xe[2],We=n((function(){return T()}),[]),we=n((function(){return(q||[]).reduce((function(e,t){return e.concat(h.filter((function(e){return e.key===t})))}),[])}),[q]),Ee=n((function(){return Z?A-58:f[0].width[q.length]-58}),[Z,null==q?void 0:q.length]),Oe=n((function(){var e=Z?g:S;return ne.length&&(e+=function(e,t){var o=e.find((function(e){return e.key===t}));return(null==o?void 0:o.width)||0}(H,D.taScore)),"".concat(e,"px")}),[Z,ne]);i((function(){if(re!==b.mobile&&De.current&&Te.current){var e=De.current.querySelector(".".concat(V.wellNameFixed));J?e.classList.remove(V.noShadow):e.classList.add(V.noShadow);var t=Te.current.querySelectorAll(".".concat(V.wellNameFixed));J?t.forEach((function(e){return e.classList.remove(V.noShadow)})):t.forEach((function(e){return e.classList.add(V.noShadow)}))}}),[J,Te.current,De.current,ae]);var Le=p((function(e,t){R(e),k(t)}),[]),Fe=p((function(e){G(e)}),[]),Re=p((function(e,t){G((function(o){return o.map((function(o){return o===e?t:o}))}))}),[]);return H&&ae?P("div",{className:V.offsetWellsTable,children:[B("div",{className:V.stickyTable,children:B(l,{"aria-label":"ows table head",innerRef:De,children:B(d,{children:B(I,{open:c,columnsWithDict:H,metricsKeys:q,sortBy:F,sortDirection:M,indeterminate:Pe,isAllWellsSelected:Be,onChangeSort:Le,onChangeMetricsKeys:Fe,onUpdateMetricsKey:Re,isWellNameExpand:Z,setIsWellNameExpand:X,handleChangeAllOffsetWells:K,wellNameStyle:V.wellNameFixed,isViewOnly:Y,isImperial:We,contentRef:_,viewType:re,isTaColumnVisible:!!ne.length})})})}),!Y&&P("div",{className:a(V.searchCellWrapper,t({},V.searchCellWrapperExpanded,Z)),style:{"--dynamic-search-wrapper-width":Oe},children:[B("div",{className:V.searchCell,children:B(y,{companyId:O,subjectWellId:L,onChange:U,selectedWellIds:Ve.map((function(e){return e.id})),onHideAdvancedSearch:Q})}),!!Z&&B("div",{className:V.searchCellEmpty})]}),B(l,{"aria-label":"ows table body",innerRef:Te,className:V.bodyTable,children:P(u,{children:[B(j,{children:B(C,{className:a(V.topShadow,t({},V.viewOnlyShadow,Y))})}),ae.map((function(e,t){return P(m,{children:[B(j,{children:ue&&ge>0&&t===Ae&&B(C,{style:{height:ge}})}),B(x,{columnsWithDict:H,subjectWellId:L,data:e,metricsKeys:q,metricsColumns:we,handleChangeOffsetWell:z,isWellNameExpand:Z,wellNameStyle:V.wellNameFixed,wellNameWidth:Ee,isViewOnly:Y,isImperial:We,isLimitedOffsetWells:ee,maxOffsetWellNumber:te,wellSections:oe,setActiveWellId:se,viewType:re,newCheckedWellId:null!=e&&e.moveTo?ue:0,setNewCheckedWellId:je,index:null!=e&&e.moveTo?t:0,flyDuration:null!=e&&e.moveTo?ye.current:0,isWDUser:ie,taScores:ne})]},e.id)})),!$&&B(j,{children:B(C,{className:V.loadingCell,children:B("span",{children:"Loading..."})})}),B(j,{children:B(C,{className:V.bottomShadow})})]})}),w&&B("div",{className:V.loadingContainer,children:B(W,{fullscreen:!1,className:V.loadingIndicator})})]}):null};O.propTypes={open:c.bool.isRequired,isTableLoading:c.bool.isRequired,companyId:c.number.isRequired,subjectWellId:c.number.isRequired,sortBy:c.string.isRequired,setSortBy:c.func.isRequired,sortDirection:c.string.isRequired,setSortDirection:c.func.isRequired,columnsWithDict:c.arrayOf(c.shape({})).isRequired,wells:c.arrayOf(c.shape({})).isRequired,metricsKeys:c.arrayOf(c.string).isRequired,setMetricsKeys:c.func.isRequired,handleChangeOffsetWell:c.func.isRequired,handleChangeAllOffsetWells:c.func.isRequired,handleAddRemoveAssets:c.func.isRequired,setIsWellNameExpand:c.func.isRequired,isWellNameExpand:c.bool.isRequired,isHScrollMoved:c.bool.isRequired,onHideAdvancedSearch:c.func.isRequired,isViewOnly:c.bool.isRequired,isLastWell:c.bool.isRequired,isLimitedOffsetWells:c.bool.isRequired,maxOffsetWellNumber:c.number.isRequired,contentRef:c.shape({}).isRequired,wellSections:c.arrayOf(c.shape({})).isRequired,setActiveWellId:c.func.isRequired,viewType:c.string.isRequired,isWDUser:c.bool.isRequired,taScores:c.arrayOf(c.shape({})).isRequired};var L=o(O);export{L as default};
@@ -1 +1 @@
1
- import e from'./../../../../ext-esm/style-inject/dist/style-inject.es.js';var l={offsetWellsTable:"OffsetWellsTable-module_offsetWellsTable__pGL-8",loadingContainer:"OffsetWellsTable-module_loadingContainer__lA0IJ",stickyTable:"OffsetWellsTable-module_stickyTable__LZCzy",searchCellWrapper:"OffsetWellsTable-module_searchCellWrapper__n8cod",searchCellWrapperExpanded:"OffsetWellsTable-module_searchCellWrapperExpanded__pWrzU",searchCell:"OffsetWellsTable-module_searchCell__3IW23",searchCellEmpty:"OffsetWellsTable-module_searchCellEmpty__1sB-v",bodyTable:"OffsetWellsTable-module_bodyTable__djKsG",bodyGrid:"OffsetWellsTable-module_bodyGrid__Ss17M",loadingCell:"OffsetWellsTable-module_loadingCell__rBu7-",topShadow:"OffsetWellsTable-module_topShadow__MPc8N",viewOnlyShadow:"OffsetWellsTable-module_viewOnlyShadow__DOW-4",bottomShadow:"OffsetWellsTable-module_bottomShadow__jxM6E",wellNameFixed:"OffsetWellsTable-module_wellNameFixed__tKtuD",noShadow:"OffsetWellsTable-module_noShadow__Ssp7E"};e('.OffsetWellsTable-module_offsetWellsTable__pGL-8{display:flex;flex-direction:column;position:relative}.OffsetWellsTable-module_loadingContainer__lA0IJ{bottom:0;left:0;position:absolute;right:0;top:0;z-index:1500}.OffsetWellsTable-module_stickyTable__LZCzy{background-color:var(--palette-background-b-7);padding-right:16px;position:sticky;top:0;z-index:9}.OffsetWellsTable-module_searchCellWrapper__n8cod{background-color:var(--palette-background-b-7);display:inline-flex;left:0;position:sticky;top:49px;width:var(--dynamic-search-wrapper-width,1020px);z-index:9}.OffsetWellsTable-module_searchCellWrapperExpanded__pWrzU{width:var(--dynamic-search-wrapper-width,1270px)}.OffsetWellsTable-module_searchCell__3IW23{left:0;position:sticky;top:0;width:1020px;z-index:9}.OffsetWellsTable-module_searchCellEmpty__1sB-v{position:relative;width:250px}.OffsetWellsTable-module_bodyTable__djKsG{position:relative}.OffsetWellsTable-module_bodyGrid__Ss17M{margin-top:12px!important;overflow:hidden!important}.OffsetWellsTable-module_bodyGrid__Ss17M::-webkit-scrollbar-corner{background:transparent}.OffsetWellsTable-module_loadingCell__rBu7-{border-bottom:none!important;color:var(--palette-primary-text-8)!important;font-size:12px!important;height:16px!important;padding:0!important;position:absolute;text-align:center!important;width:100%;z-index:1000}.OffsetWellsTable-module_topShadow__MPc8N{background-image:linear-gradient(0deg,rgba(51,51,51,0),#333);border-bottom:none!important;height:16px!important;padding:0!important;position:sticky;top:93px;width:100%;z-index:999}.OffsetWellsTable-module_viewOnlyShadow__DOW-4{top:49px}.OffsetWellsTable-module_bottomShadow__jxM6E{border-bottom:none!important;bottom:0;height:16px!important;padding:0!important;position:sticky;width:100%;z-index:999}.OffsetWellsTable-module_bottomShadow__jxM6E:after{background-image:linear-gradient(180deg,rgba(51,51,51,0),#333);bottom:-1px;content:" ";height:16px!important;position:absolute;width:100%}.OffsetWellsTable-module_wellNameFixed__tKtuD{box-shadow:4px 0 6px -3px #191919!important}.OffsetWellsTable-module_noShadow__Ssp7E{box-shadow:none!important}');export{l as default};
1
+ import e from'./../../../../ext-esm/style-inject/dist/style-inject.es.js';var l={offsetWellsTable:"OffsetWellsTable-module_offsetWellsTable__pGL-8",loadingContainer:"OffsetWellsTable-module_loadingContainer__lA0IJ",loadingIndicator:"OffsetWellsTable-module_loadingIndicator__j5pye",stickyTable:"OffsetWellsTable-module_stickyTable__LZCzy",searchCellWrapper:"OffsetWellsTable-module_searchCellWrapper__n8cod",searchCellWrapperExpanded:"OffsetWellsTable-module_searchCellWrapperExpanded__pWrzU",searchCell:"OffsetWellsTable-module_searchCell__3IW23",searchCellEmpty:"OffsetWellsTable-module_searchCellEmpty__1sB-v",bodyTable:"OffsetWellsTable-module_bodyTable__djKsG",bodyGrid:"OffsetWellsTable-module_bodyGrid__Ss17M",loadingCell:"OffsetWellsTable-module_loadingCell__rBu7-",topShadow:"OffsetWellsTable-module_topShadow__MPc8N",viewOnlyShadow:"OffsetWellsTable-module_viewOnlyShadow__DOW-4",bottomShadow:"OffsetWellsTable-module_bottomShadow__jxM6E",wellNameFixed:"OffsetWellsTable-module_wellNameFixed__tKtuD",noShadow:"OffsetWellsTable-module_noShadow__Ssp7E"};e('.OffsetWellsTable-module_offsetWellsTable__pGL-8{display:flex;flex-direction:column;height:100%;position:relative}.OffsetWellsTable-module_loadingContainer__lA0IJ{align-items:center;backdrop-filter:blur(1px);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:1500}.OffsetWellsTable-module_loadingIndicator__j5pye{position:absolute;top:0}.OffsetWellsTable-module_stickyTable__LZCzy{background-color:var(--palette-background-b-7);padding-right:16px;position:sticky;top:0;z-index:9}.OffsetWellsTable-module_searchCellWrapper__n8cod{background-color:var(--palette-background-b-7);display:inline-flex;left:0;position:sticky;top:49px;width:var(--dynamic-search-wrapper-width,1020px);z-index:9}.OffsetWellsTable-module_searchCellWrapperExpanded__pWrzU{width:var(--dynamic-search-wrapper-width,1270px)}.OffsetWellsTable-module_searchCell__3IW23{left:0;position:sticky;top:0;width:1020px;z-index:9}.OffsetWellsTable-module_searchCellEmpty__1sB-v{position:relative;width:250px}.OffsetWellsTable-module_bodyTable__djKsG{position:relative}.OffsetWellsTable-module_bodyGrid__Ss17M{margin-top:12px!important;overflow:hidden!important}.OffsetWellsTable-module_bodyGrid__Ss17M::-webkit-scrollbar-corner{background:transparent}.OffsetWellsTable-module_loadingCell__rBu7-{border-bottom:none!important;color:var(--palette-primary-text-8)!important;font-size:12px!important;height:16px!important;padding:0!important;position:absolute;text-align:center!important;width:100%;z-index:1000}.OffsetWellsTable-module_topShadow__MPc8N{background-image:linear-gradient(0deg,rgba(51,51,51,0),#333);border-bottom:none!important;height:16px!important;padding:0!important;position:sticky;top:93px;width:100%;z-index:999}.OffsetWellsTable-module_viewOnlyShadow__DOW-4{top:49px}.OffsetWellsTable-module_bottomShadow__jxM6E{border-bottom:none!important;bottom:0;height:16px!important;padding:0!important;position:sticky;width:100%;z-index:999}.OffsetWellsTable-module_bottomShadow__jxM6E:after{background-image:linear-gradient(180deg,rgba(51,51,51,0),#333);bottom:-1px;content:" ";height:16px!important;position:absolute;width:100%}.OffsetWellsTable-module_wellNameFixed__tKtuD{box-shadow:4px 0 6px -3px #191919!important}.OffsetWellsTable-module_noShadow__Ssp7E{box-shadow:none!important}');export{l as default};
@@ -1,2 +1,2 @@
1
- export function useAdvancedWells(companyId: any, rawWells: any, wellSections: any, offsetWellsBySection: any, subjectWellId: any, metricsKeys: any): any;
1
+ export function useAdvancedWells(companyId: any, rawWells: any, wellSections: any, offsetWellsBySection: any, subjectWellId: any, metricsKeys: any, open: any): any;
2
2
  //# sourceMappingURL=useAdvancedWells.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAdvancedWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useAdvancedWells.js"],"names":[],"mappings":"AAYA,yJAwHC"}
1
+ {"version":3,"file":"useAdvancedWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useAdvancedWells.js"],"names":[],"mappings":"AAYA,oKAwHC"}
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useRef as u,useEffect as i}from"react";import{groupBy as a,get as c}from"lodash";import{fetchMetricsData as s}from"../utils/apiCalls.js";import{ALL_SECTION_KEY as p,ColumnType as f}from"../constants.js";import{mapbox as l}from"../../../utils/index.js";function m(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var d=l.getAssetV2Coordinates,v=l.getDistanceByCoordinates,h=function(r){return Number.isFinite(r)?parseFloat(r.toFixed(2)):null};function y(l,m,y,O,j,w){var x=o(null),g=e(x,2),P=g[0],k=g[1],F=o(null),D=e(F,2),E=D[0],C=D[1],S=o(null),A=e(S,2),H=A[0],T=A[1],B=u({});function G(){return G=t(n.mark((function r(){var e,o,u;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e=m.find((function(r){return r.id===j})),(o=e&&d(e,"topHole"))||C(m),r.next=5,Promise.all(m.map(function(){var r=t(n.mark((function r(t){var e,u;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,d(t,"topHole");case 3:if(!(e=r.sent)){r.next=13;break}return r.t0=parseFloat,r.next=8,v(o,e);case 8:return r.t1=r.sent,u=(0,r.t0)(r.t1),r.abrupt("return",b(b({},t),{},{distance:parseFloat(u.toFixed(2))}));case 13:return r.abrupt("return",t);case 14:r.next=19;break;case 16:return r.prev=16,r.t2=r.catch(0),r.abrupt("return",t);case 19:case"end":return r.stop()}}),r,null,[[0,16]])})));return function(t){return r.apply(this,arguments)}}()));case 5:u=r.sent,C(u);case 7:case"end":return r.stop()}}),r)}))),G.apply(this,arguments)}function N(r){return V.apply(this,arguments)}function V(){return(V=t(n.mark((function t(e){var o,u,i,p;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s(l,e,w);case 2:o=t.sent,u={},i=a(o,"asset_id"),e.forEach((function(t){var e,n=null===(e=i[t])||void 0===e?void 0:e.reduce((function(t,e){var n=c(e,"data.value"),o=c(e,"data.key");return b(b({},t),{},r({},o,h(n)))}),{});u[t]=n})),B.current=b(b({},B.current),u),p=[],H.forEach((function(r){p.push(b(b({},r),B.current[r.id]))})),k(p);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return i((function(){m&&function(){G.apply(this,arguments)}()}),[m,j]),i((function(){var t,e;E&&y&&O&&(t=y.filter((function(r){return r.value!==p})),e=E.map((function(e){var n=t.filter((function(r){return(O[r.value]||[]).includes(e.id)})).map((function(r){return r.label}));return n.length>0?b(b({},e),{},r({},f.wellSection,n)):e})),T(e))}),[E,y,O]),i((function(){if(H){var r=[];H.forEach((function(t){B.current[t.id]||r.push(t.id)})),N(r)}}),[H]),i((function(){P&&N(P.map((function(r){return r.id})))}),[w]),P}export{y as useAdvancedWells};
1
+ import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useRef as i,useEffect as u}from"react";import{groupBy as a,get as c}from"lodash";import{fetchMetricsData as f}from"../utils/apiCalls.js";import{ALL_SECTION_KEY as l,ColumnType as s}from"../constants.js";import{mapbox as p}from"../../../utils/index.js";function m(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function d(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}var b=p.getAssetV2Coordinates,v=p.getDistanceByCoordinates,y=function(r){return Number.isFinite(r)?parseFloat(r.toFixed(2)):null};function h(p,m,h,O,j,g,w){var P=o(null),x=e(P,2),F=x[0],D=x[1],E=o(null),k=e(E,2),C=k[0],S=k[1],A=o(null),H=e(A,2),T=H[0],B=H[1],G=i({});function N(r){return V.apply(this,arguments)}function V(){return(V=r(n.mark((function r(e){var o,i,u,l;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,f(p,e,g);case 2:o=r.sent,i={},u=a(o,"asset_id"),e.forEach((function(r){var e,n=null===(e=u[r])||void 0===e?void 0:e.reduce((function(r,e){var n=c(e,"data.value"),o=c(e,"data.key");return d(d({},r),{},t({},o,y(n)))}),{});i[r]=n})),G.current=d(d({},G.current),i),l=[],T.forEach((function(r){l.push(d(d({},r),G.current[r.id]))})),D(l);case 10:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return u((function(){m&&w&&function(){var r=m.find((function(r){return r.id===j})),t=r&&b(r,"topHole");if(t){var e=m.map((function(r){try{var e=b(r,"topHole");if(e){var n=parseFloat(v(t,e));return d(d({},r),{},{distance:parseFloat(n.toFixed(2))})}return r}catch(t){return r}}));S(e)}else S(m)}()}),[m,j,w]),u((function(){var r,e;C&&h&&O&&w&&(r=h.filter((function(r){return r.value!==l})),e=C.map((function(e){var n=r.filter((function(r){return(O[r.value]||[]).includes(e.id)})).map((function(r){return r.label}));return n.length>0?d(d({},e),{},t({},s.wellSection,n)):e})),B(e))}),[C,h,O,w]),u((function(){if(T&&w){var r=[];T.forEach((function(t){G.current[t.id]||r.push(t.id)})),N(r)}}),[T,w]),u((function(){F&&N(F.map((function(r){return r.id})))}),[g]),F}export{h as useAdvancedWells};
@@ -1,2 +1,3 @@
1
- export function useFetchWells(companyId: any, addWellsUsabilityInfo: any): any[];
1
+ import { Well } from '~/types';
2
+ export declare function useFetchWells(companyId?: number, addWellsUsabilityInfo?: (wells: Well[]) => Promise<Well[]> | Well[]): (boolean | Well[])[];
2
3
  //# sourceMappingURL=useFetchWells.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useFetchWells.js"],"names":[],"mappings":"AAIA,iFAcC"}
1
+ {"version":3,"file":"useFetchWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useFetchWells.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAY/B,wBAAgB,aAAa,CAC3B,SAAS,CAAC,EAAE,MAAM,EAClB,qBAAqB,GAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAa,wBAkE9E"}
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/regenerator";import{useState as n,useEffect as a}from"react";import{fetchWells as o}from"../utils/apiCalls.js";function i(i,s){var u=n(null),l=e(u,2),c=l[0],p=l[1];return a((function(){function e(){return(e=r(t.mark((function r(){var e;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!i){r.next=6;break}return r.next=3,o(i,s);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=null;case 7:e=r.t0,p(e);case 9:case"end":return r.stop()}}),r)})))).apply(this,arguments)}p(null),function(){e.apply(this,arguments)}()}),[i]),[c]}export{i as useFetchWells};
1
+ import{__awaiter as t,__generator as e,__spreadArray as n}from'./../../../ext-esm/tslib/tslib.es6.js';import{useState as r,useEffect as o}from"react";import{identity as i}from"lodash";import{fetchWells as s}from"../utils/apiCalls.js";function a(a,u){if(void 0===u&&(u=i),"function"!=typeof u)throw new Error("addWellsUsabilityInfo must be a function");var l=r([]),c=l[0],f=l[1],m=r(!0),p=m[0],d=m[1];return o((function(){var r=!1;return f([]),d(!0),function(){t(this,void 0,void 0,(function(){var o,i,l,c,m=this;return e(this,(function(p){switch(p.label){case 0:return a?(o=sessionStorage.getItem("corva-offset-well-picker-wells"),i=o?JSON.parse(o):void 0,l=Date.now(),i&&i.companyId===a&&l-i.timestamp<3e5?(f(i.wells),d(!1),[2]):(c=[],[4,s(a,(function(o,i){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[2]:[4,u(o)];case 1:return t=e.sent(),c.push.apply(c,t),f((function(e){return n(n([],e,!0),t,!0)})),i&&!r&&(sessionStorage.setItem("corva-offset-well-picker-wells",JSON.stringify({wells:c,timestamp:Date.now(),companyId:a})),d(!1)),[2]}}))}))}),(function(){return r}))])):[2];case 1:return p.sent(),[2]}}))}))}(),function(){r=!0}}),[a]),[c,p]}export{a as useFetchWells};