"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),s=require("../../../../stores/picker-props-store/usePickerPropsStore.js"),t=require("../../../../hooks/useTileLoading.js"),o=require("../../../../stores/view-store/useViewStore.js"),i=require("../../../../stores/filter-store/useFilterStore.js"),l=require("../../../../constants.js"),u=require("../utils/toCoordinates.js"),n=require("./useRadiusCircle.js"),a=require("./useSelectionToast.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(e);exports.useMapStoreSelectors=function(e){var c,S,p=s.usePickerPropsStore((function(e){return e.isViewOnly})),f=null!==(c=i.useFilterStore((function(e){var r;return null===(r=e.filters)||void 0===r?void 0:r.radius})))&&void 0!==c?c:l.DEFAULT_RADIUS_MILES,v=null!==(S=i.useFilterStore((function(e){var r;return null===(r=e.filters)||void 0===r?void 0:r.selectionMode})))&&void 0!==S?S:"radius",j=o.useViewStore((function(e){return e.mapStyle})),M=o.useViewStore((function(e){return e.setMapStyle})),q="satellite"===j,y=r.useRef(null),L=t.useTileLoading(),P=s.usePickerPropsStore((function(e){return e.isLoadAllWells})),w=s.usePickerPropsStore((function(e){return e.allWellsLoadProgress})),C=P&&w&&!w.isComplete,R=r.useState(!1),b=d.default(R,2),k=b[0],T=b[1],m=a.useSelectionToast(),A=m.toast,W=m.showSelectionResult,g=r.useCallback((function(){return T(!0)}),[]),h=r.useMemo((function(){var r;return null!=e&&null!==(r=e.topHole)&&void 0!==r&&r.coordinates?u.toCoordinates(e.topHole.coordinates):null}),[e]);return{isViewOnly:p,radius:f,selectionMode:v,mapStyle:j,setMapStyle:M,isSatellite:q,mapRef:y,isTileLoading:L,isLoadAllWells:P,isAllWellsLoading:C,isMapReady:k,toast:A,showSelectionResult:W,handleMapLoad:g,subjectWellCoords:h,circleGeoJSON:n.useRadiusCircle({subjectWellCoords:h,radiusMiles:f}).circleGeoJSON}};
//# sourceMappingURL=useMapStoreSelectors.js.map
