"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("zustand");require("lodash"),require("../../stores/picker-props-store/PickerPropsStoreContext.js"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/objectWithoutProperties"),require("react/jsx-runtime"),require("../../viewport/ViewportProvider.js"),require("../../viewport/ViewportContext.js");var s=require("../../stores/picker-props-store/usePickerPropsStore.js");require("../../stores/company-safeguard/CompanySafeguardContext.js");var t=require("../../stores/company-safeguard/useCompanySafeguard.js"),u=require("./useLoadAllWellsCallback.js"),o=require("./useCompanyIdChangeEffect.js"),l=require("./useDrillingFilterChangeEffect.js");exports.useAllWells=function(){var a=s.usePickerPropsStore((function(e){return e.open})),i=s.usePickerPropsStore((function(e){return e.setAllWellsLoadProgress})),n=s.usePickerPropsStore((function(e){return e.setShouldRecenter})),c=t.useCompanySafeguard().isSafeguardReady,f=e.useRef(null),p=e.useRef(!1),d=u.useLoadAllWellsCallback(f,p),C=d.loadAllWells,q=d.store,P=d.clearCache,h=r.useStore(q,(function(e){return e.clearTiles}));e.useEffect((function(){return h(),function(){var e;null===(e=f.current)||void 0===e||e.abort(),h(),i(null),n(!0)}}),[h,i,n]),e.useEffect((function(){a?c&&!p.current&&C():p.current=!1}),[a,c,C]),o.useCompanyIdChangeEffect({clearCache:P,clearTiles:h,loadAllWells:C,hasLoadedRef:p}),l.useDrillingFilterChangeEffect({clearCache:P,clearTiles:h,loadAllWells:C,hasLoadedRef:p})};
//# sourceMappingURL=useAllWells.js.map
