const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Alert-1.0.74-i5fZ05RU.js","./tanstack-1.0.74-aU0azVkW.js","./redux-1.0.74-D8bIc6ki.js","./vendor-1.0.74-CN03Eozo.js","./index-1.0.74-C9JunOsO.js","./iconBase-1.0.74-Cs0vntJu.js","./CircularProgress-1.0.74-QfwfRJ7i.js","./lib-1.0.74-B5IEqfHg.js","./utils-1.0.74-7xWhx9mc.js","./ButtonBase-1.0.74-W6tAH7AI.js","./Typography-1.0.74-B4mhsevh.js","./useEnhancedEffect-1.0.74-B56M26dS.js","./AlertTitle-1.0.74-BmkdSyE6.js","./createSvgIcon-1.0.74-Cw_ZFbxi.js","./Close-1.0.74-Ce0z5IFm.js","./MapContainer-1.0.74-CeT8YC4j.js","./RestApiError-1.0.74-Bb1un17k.js","./hooks-1.0.74-NYCTWeI9.js","./AdminTheme-1.0.74-BtTaJUu_.js","./RestApi-1.0.74-5XKxNzpR.js","./useMetadata-1.0.74--jxfVI7W.js","./useRemoveAppFromStore-1.0.74-CJatuZ_l.js","./Languages-1.0.74-DaJcF5OJ.js","./index-1.0.74-DxwH6OqZ.js","./ThemeProvider-1.0.74-4uzbYYLM.js","./Portal-1.0.74-BrUPeMX9.js","./Box-1.0.74-DEbuVvGV.js","./FallbackSpinner-1.0.74-7h-h2HIM.js","./Spinner-1.0.74-B63QTBL9.js","./useTheme-1.0.74-CW3awVDs.js","./index-1.0.74-iJ_9eGZx.js","./getThemeProps-1.0.74-DOfDN6_V.js","./index-1.0.74-BHnoCJVT.js","./Select-1.0.74-DHOnlEEH.js","./Menu-1.0.74-CdjCBJ4R.js","./isHostComponent-1.0.74-DVu5iVWx.js","./Modal-1.0.74-BfLid1bk.js","./MenuItem-1.0.74-D9LDbFUb.js","./ToggleButtonGroup-1.0.74-DMigw7sg.js"])))=>i.map(i=>d[i]);
import{_ as j}from"./RestApiError-1.0.74-Bb1un17k.js";import{j as r}from"./tanstack-1.0.74-aU0azVkW.js";import{r as s}from"./redux-1.0.74-D8bIc6ki.js";import{u as A}from"./useMetadata-1.0.74--jxfVI7W.js";import{e as K}from"./utils-1.0.74-7xWhx9mc.js";import{s as h}from"./lib-1.0.74-B5IEqfHg.js";import{F as k}from"./FallbackSpinner-1.0.74-7h-h2HIM.js";const M=s.lazy(()=>j(()=>import("./Alert-1.0.74-i5fZ05RU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),O=s.lazy(()=>j(()=>import("./MapContainer-1.0.74-CeT8YC4j.js"),__vite__mapDeps([15,16,3,1,2,8,7,17,18,6,19,20,21,22,23,9,10,11,24,25,5,26,27,28,29,30,31,32,33,34,35,36,13,37,38]),import.meta.url)),T=({appId:t,tableStore:i,shortcodeArgs:E,showSpinner:v})=>{var c,m;const p=s.useRef(!0);p.current&&h(t,500),s.useEffect(()=>{p.current=!1},[]);const o=A(t),u=i==null?void 0:i.table,a=s.useMemo(()=>{var l,d,f,_,g,x,L,y;const n={apiKey:"",columnLatitude:"",columnLongitude:""};if(u===void 0)try{const e=JSON.parse((d=(l=o==null?void 0:o.app)==null?void 0:l.app[0])==null?void 0:d.app_settings);n.apiKey=(_=(f=e==null?void 0:e.settings)==null?void 0:f.app_map)==null?void 0:_.api_key,n.columnLatitude=(x=(g=e==null?void 0:e.settings)==null?void 0:g.app_map)==null?void 0:x.column_latitude,n.columnLongitude=(y=(L=e==null?void 0:e.settings)==null?void 0:L.app_map)==null?void 0:y.column_longitude}catch(e){console.error("Invalid JSON - app settings"),console.error(e),K("Invalid JSON, check console",{variant:"error"})}else n.apiKey=u.maps.apiKey,n.columnLatitude=u.maps.columnLatitude,n.columnLongitude=u.maps.columnLongitude;return n},[t,(m=(c=o==null?void 0:o.app)==null?void 0:c.app[0])==null?void 0:m.app_settings]);return a.columnLatitude==""||a.columnLongitude==""?r.jsx(s.Suspense,{children:r.jsx(M,{severity:"error",message:"Latitude and/or longitude column not defined - use App Manager to fix issue",close:!1})}):a.apiKey===""?r.jsx(s.Suspense,{children:r.jsx(M,{severity:"error",message:"Missing Google Maps API Key - use App Manager to fix issue",close:!1})}):r.jsx(s.Suspense,{fallback:v?r.jsx(k,{}):void 0,children:r.jsx(O,{appId:t,mapSetup:a,tableStore:i,shortcodeArgs:E})})};export{T as M};
