@blaze-cms/plugin-google-maps-fe 0.125.0-core-styles.0 → 0.125.0-core-styles.1

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 (86) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/GoogleMaps/GoogleMaps.js +24 -71
  3. package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
  4. package/lib/GoogleMaps/GoogleMapsFactory.js +8 -24
  5. package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
  6. package/lib/GoogleMaps/GoogleMapsHtml.js +0 -6
  7. package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -1
  8. package/lib/GoogleMaps/GoogleMapsRender.js +12 -33
  9. package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
  10. package/lib/GoogleMaps/helpers/add-zoom-listener.js +0 -6
  11. package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
  12. package/lib/GoogleMaps/helpers/build-map-shapes.js +7 -33
  13. package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
  14. package/lib/GoogleMaps/helpers/build-map-type-ids.js +0 -4
  15. package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
  16. package/lib/GoogleMaps/helpers/build-query.js +5 -17
  17. package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
  18. package/lib/GoogleMaps/helpers/build-shapes-configs.js +25 -70
  19. package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
  20. package/lib/GoogleMaps/helpers/get-center-coordinates.js +2 -11
  21. package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
  22. package/lib/GoogleMaps/helpers/get-image-ids.js +1 -13
  23. package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
  24. package/lib/GoogleMaps/helpers/get-path.js +1 -6
  25. package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
  26. package/lib/GoogleMaps/helpers/index.js +0 -9
  27. package/lib/GoogleMaps/helpers/index.js.map +1 -1
  28. package/lib/GoogleMaps/helpers/set-map-options.js +21 -33
  29. package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
  30. package/lib/GoogleMaps/helpers/set-shapes.js +30 -112
  31. package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
  32. package/lib/GoogleMaps/hooks/index.js +0 -4
  33. package/lib/GoogleMaps/hooks/index.js.map +1 -1
  34. package/lib/GoogleMaps/hooks/use-get-entity-schemas.js +8 -19
  35. package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
  36. package/lib/GoogleMaps/hooks/use-get-images.js +12 -19
  37. package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
  38. package/lib/GoogleMaps/index.js +0 -4
  39. package/lib/GoogleMaps/index.js.map +1 -1
  40. package/lib/GoogleMaps/queries.js +0 -17
  41. package/lib/GoogleMaps/queries.js.map +1 -1
  42. package/lib/constants.js +0 -1
  43. package/lib/constants.js.map +1 -1
  44. package/lib/index.js +1 -22
  45. package/lib/index.js.map +1 -1
  46. package/lib-es/GoogleMaps/GoogleMaps.js +14 -25
  47. package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
  48. package/lib-es/GoogleMaps/GoogleMapsFactory.js +4 -7
  49. package/lib-es/GoogleMaps/GoogleMapsFactory.js.map +1 -1
  50. package/lib-es/GoogleMaps/GoogleMapsHtml.js +0 -2
  51. package/lib-es/GoogleMaps/GoogleMapsHtml.js.map +1 -1
  52. package/lib-es/GoogleMaps/GoogleMapsRender.js +5 -8
  53. package/lib-es/GoogleMaps/GoogleMapsRender.js.map +1 -1
  54. package/lib-es/GoogleMaps/helpers/add-zoom-listener.js +0 -2
  55. package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
  56. package/lib-es/GoogleMaps/helpers/build-map-shapes.js +0 -8
  57. package/lib-es/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
  58. package/lib-es/GoogleMaps/helpers/build-map-type-ids.js +0 -2
  59. package/lib-es/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
  60. package/lib-es/GoogleMaps/helpers/build-query.js +0 -2
  61. package/lib-es/GoogleMaps/helpers/build-query.js.map +1 -1
  62. package/lib-es/GoogleMaps/helpers/build-shapes-configs.js +0 -14
  63. package/lib-es/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
  64. package/lib-es/GoogleMaps/helpers/get-center-coordinates.js +0 -2
  65. package/lib-es/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
  66. package/lib-es/GoogleMaps/helpers/get-image-ids.js +0 -1
  67. package/lib-es/GoogleMaps/helpers/get-image-ids.js.map +1 -1
  68. package/lib-es/GoogleMaps/helpers/get-path.js +0 -1
  69. package/lib-es/GoogleMaps/helpers/get-path.js.map +1 -1
  70. package/lib-es/GoogleMaps/helpers/index.js.map +1 -1
  71. package/lib-es/GoogleMaps/helpers/set-map-options.js +2 -8
  72. package/lib-es/GoogleMaps/helpers/set-map-options.js.map +1 -1
  73. package/lib-es/GoogleMaps/helpers/set-shapes.js +5 -41
  74. package/lib-es/GoogleMaps/helpers/set-shapes.js.map +1 -1
  75. package/lib-es/GoogleMaps/hooks/index.js.map +1 -1
  76. package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js +0 -2
  77. package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
  78. package/lib-es/GoogleMaps/hooks/use-get-images.js +0 -2
  79. package/lib-es/GoogleMaps/hooks/use-get-images.js.map +1 -1
  80. package/lib-es/GoogleMaps/index.js.map +1 -1
  81. package/lib-es/GoogleMaps/queries.js +0 -6
  82. package/lib-es/GoogleMaps/queries.js.map +1 -1
  83. package/lib-es/constants.js.map +1 -1
  84. package/lib-es/index.js +1 -3
  85. package/lib-es/index.js.map +1 -1
  86. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMaps.js","names":["React","useEffect","useState","PropTypes","useRouter","withTitle","useInView","functions","isEqual","omit","setMapOptions","addZoomListener","GOOGLE_MAPS_SCRIPT","LOAD","SCRIPT","IN_VIEW_CONFIG","GoogleMapsHtml","shouldNotUpdate","props","nextProps","funcs","nextFuncs","noPropChange","noFuncChange","length","every","fn","toString","GoogleMaps","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","router","isIntersecting","mapRef","map","setMap","options","onLoad","initialMap","window","google","maps","Map","current","latitude","lat","longitude","lng","setCenter","bounds","LatLngBounds","forEach","extend","LatLng","fitBounds","script","document","createElement","src","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","propTypes","array","string","func","object","defaultProps","memo"],"sources":["../../src/GoogleMaps/GoogleMaps.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { withTitle } from '@blaze-cms/react-page-builder';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport { functions, isEqual, omit } from 'lodash';\nimport { setMapOptions, addZoomListener } from './helpers';\nimport { GOOGLE_MAPS_SCRIPT, LOAD, SCRIPT, IN_VIEW_CONFIG } from '../constants';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst shouldNotUpdate = (props, nextProps) => {\n const [funcs, nextFuncs] = [functions(props), functions(nextProps)];\n const noPropChange = isEqual(omit(props, funcs), omit(nextProps, nextFuncs));\n const noFuncChange =\n funcs.length === nextFuncs.length &&\n funcs.every(fn => props[fn].toString() === nextProps[fn].toString());\n return noPropChange && noFuncChange;\n};\n\nconst GoogleMaps = ({\n type,\n name,\n modifier,\n elementTitle,\n imageData,\n onMount,\n onMountProps,\n parent,\n mapShapes,\n centerCoordinates,\n ...otherProps\n}) => {\n const router = useRouter();\n const [isIntersecting, mapRef] = useInView(IN_VIEW_CONFIG);\n const [map, setMap] = useState();\n\n useEffect(() => {\n const options = setMapOptions(otherProps);\n const onLoad = () => {\n const initialMap = new window.google.maps.Map(mapRef.current, options);\n if (centerCoordinates.length === 1) {\n const [{ latitude: lat, longitude: lng }] = centerCoordinates;\n initialMap.setCenter({ lat, lng });\n } else {\n const bounds = new window.google.maps.LatLngBounds();\n centerCoordinates.forEach(({ latitude, longitude }) => {\n bounds.extend(new window.google.maps.LatLng(latitude, longitude));\n });\n initialMap.fitBounds(bounds);\n }\n setMap(initialMap);\n };\n\n if (!window.google) {\n const script = document.createElement(SCRIPT);\n script.src = `${GOOGLE_MAPS_SCRIPT}${process.env.GOOGLE_MAPS_API_KEY}`;\n document.head.append(script);\n script.addEventListener(LOAD, onLoad);\n return () => script.removeEventListener(LOAD, onLoad);\n }\n\n onLoad();\n\n if (map) {\n map.setOptions(options);\n const { enableGeolocation } = otherProps;\n const shouldActivateGeolocation = enableGeolocation && navigator.geolocation;\n if (shouldActivateGeolocation) {\n navigator.geolocation.getCurrentPosition(\n position => {\n const center = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n map.setCenter(center);\n },\n () => {}\n );\n }\n }\n\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (map && typeof onMount === `function`) onMount(map, onMountProps);\n if (isIntersecting) addZoomListener(map, router, mapShapes, imageData);\n\n return <GoogleMapsHtml mapRef={mapRef} />;\n};\n\nGoogleMaps.propTypes = {\n mapShapes: PropTypes.array,\n imageData: PropTypes.array,\n type: PropTypes.string,\n name: PropTypes.string,\n modifier: PropTypes.string,\n elementTitle: PropTypes.string,\n onMount: PropTypes.func,\n onMountProps: PropTypes.object,\n parent: PropTypes.object,\n centerCoordinates: PropTypes.array\n};\n\nGoogleMaps.defaultProps = {\n mapShapes: [],\n imageData: [],\n centerCoordinates: [],\n type: '',\n name: '',\n modifier: '',\n elementTitle: '',\n onMount: null,\n onMountProps: null,\n parent: {}\n};\n\nexport default React.memo(withTitle(GoogleMaps), shouldNotUpdate);\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAA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5B,SAAS,CAACmF,MALC;EAMrBtD,YAAY,EAAE7B,SAAS,CAACmF,MANH;EAOrBpD,OAAO,EAAE/B,SAAS,CAACoF,IAPE;EAQrBpD,YAAY,EAAEhC,SAAS,CAACqF,MARH;EASrBpD,MAAM,EAAEjC,SAAS,CAACqF,MATG;EAUrBlD,iBAAiB,EAAEnC,SAAS,CAACkF;AAVR,CAAvB;AAaAzD,UAAU,CAAC6D,YAAX,GAA0B;EACxBpD,SAAS,EAAE,EADa;EAExBJ,SAAS,EAAE,EAFa;EAGxBK,iBAAiB,EAAE,EAHK;EAIxBT,IAAI,EAAE,EAJkB;EAKxBC,IAAI,EAAE,EALkB;EAMxBC,QAAQ,EAAE,EANc;EAOxBC,YAAY,EAAE,EAPU;EAQxBE,OAAO,EAAE,IARe;EASxBC,YAAY,EAAE,IATU;EAUxBC,MAAM,EAAE;AAVgB,CAA1B;AAaA,eAAepC,KAAK,CAAC0F,IAAN,CAAWrF,SAAS,CAACuB,UAAD,CAApB,EAAkCX,eAAlC,CAAf"}
1
+ {"version":3,"file":"GoogleMaps.js","names":["React","useEffect","useState","PropTypes","useRouter","withTitle","useInView","functions","isEqual","omit","setMapOptions","addZoomListener","GOOGLE_MAPS_SCRIPT","LOAD","SCRIPT","IN_VIEW_CONFIG","GoogleMapsHtml","shouldNotUpdate","props","nextProps","funcs","nextFuncs","noPropChange","noFuncChange","length","every","fn","toString","GoogleMaps","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","router","isIntersecting","mapRef","map","setMap","options","onLoad","initialMap","window","google","maps","Map","current","latitude","lat","longitude","lng","setCenter","bounds","LatLngBounds","forEach","extend","LatLng","fitBounds","script","document","createElement","src","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","propTypes","array","string","func","object","defaultProps","memo"],"sources":["../../src/GoogleMaps/GoogleMaps.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { withTitle } from '@blaze-cms/react-page-builder';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport { functions, isEqual, omit } from 'lodash';\nimport { setMapOptions, addZoomListener } from './helpers';\nimport { GOOGLE_MAPS_SCRIPT, LOAD, SCRIPT, IN_VIEW_CONFIG } from '../constants';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst shouldNotUpdate = (props, nextProps) => {\n const [funcs, nextFuncs] = [functions(props), functions(nextProps)];\n const noPropChange = isEqual(omit(props, funcs), omit(nextProps, nextFuncs));\n const noFuncChange =\n funcs.length === nextFuncs.length &&\n funcs.every(fn => props[fn].toString() === nextProps[fn].toString());\n return noPropChange && noFuncChange;\n};\n\nconst GoogleMaps = ({\n type,\n name,\n modifier,\n elementTitle,\n imageData,\n onMount,\n onMountProps,\n parent,\n mapShapes,\n centerCoordinates,\n ...otherProps\n}) => {\n const router = useRouter();\n const [isIntersecting, mapRef] = useInView(IN_VIEW_CONFIG);\n const [map, setMap] = useState();\n\n useEffect(() => {\n const options = setMapOptions(otherProps);\n const onLoad = () => {\n const initialMap = new window.google.maps.Map(mapRef.current, options);\n if (centerCoordinates.length === 1) {\n const [{ latitude: lat, longitude: lng }] = centerCoordinates;\n initialMap.setCenter({ lat, lng });\n } else {\n const bounds = new window.google.maps.LatLngBounds();\n centerCoordinates.forEach(({ latitude, longitude }) => {\n bounds.extend(new window.google.maps.LatLng(latitude, longitude));\n });\n initialMap.fitBounds(bounds);\n }\n setMap(initialMap);\n };\n\n if (!window.google) {\n const script = document.createElement(SCRIPT);\n script.src = `${GOOGLE_MAPS_SCRIPT}${process.env.GOOGLE_MAPS_API_KEY}`;\n document.head.append(script);\n script.addEventListener(LOAD, onLoad);\n return () => script.removeEventListener(LOAD, onLoad);\n }\n\n onLoad();\n\n if (map) {\n map.setOptions(options);\n const { enableGeolocation } = otherProps;\n const shouldActivateGeolocation = enableGeolocation && navigator.geolocation;\n if (shouldActivateGeolocation) {\n navigator.geolocation.getCurrentPosition(\n position => {\n const center = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n map.setCenter(center);\n },\n () => {}\n );\n }\n }\n\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (map && typeof onMount === `function`) onMount(map, onMountProps);\n if (isIntersecting) addZoomListener(map, router, mapShapes, imageData);\n\n return <GoogleMapsHtml mapRef={mapRef} />;\n};\n\nGoogleMaps.propTypes = {\n mapShapes: PropTypes.array,\n imageData: PropTypes.array,\n type: PropTypes.string,\n name: PropTypes.string,\n modifier: PropTypes.string,\n elementTitle: PropTypes.string,\n onMount: PropTypes.func,\n onMountProps: PropTypes.object,\n parent: PropTypes.object,\n centerCoordinates: PropTypes.array\n};\n\nGoogleMaps.defaultProps = {\n mapShapes: [],\n imageData: [],\n centerCoordinates: [],\n type: '',\n name: '',\n modifier: '',\n elementTitle: '',\n onMount: null,\n onMountProps: null,\n parent: {}\n};\n\nexport default React.memo(withTitle(GoogleMaps), shouldNotUpdate);\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,SAAS,QAAQ,oCAAoC;AAC9D,SAASC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AACjD,SAASC,aAAa,EAAEC,eAAe,QAAQ,WAAW;AAC1D,SAASC,kBAAkB,EAAEC,IAAI,EAAEC,MAAM,EAAEC,cAAc,QAAQ,cAAc;AAC/E,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,eAAe,GAAG,CAACC,KAAK,EAAEC,SAAS,KAAK;EAC5C,MAAM,CAACC,KAAK,EAAEC,SAAS,CAAC,GAAG,CAACd,SAAS,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AC;AAED,eAAepC,KAAK,CAAC0F,IAAI,CAACrF,SAAS,CAACuB,UAAU,CAAC,EAAEX,eAAe,CAAC"}
@@ -7,14 +7,12 @@ import { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';
7
7
  import { buildShapesConfig } from './helpers';
8
8
  import GoogleMapsRender from './GoogleMapsRender';
9
9
  import GoogleMapsHtml from './GoogleMapsHtml';
10
-
11
10
  const GoogleMapsFactory = _ref => {
12
11
  let {
13
- entityGroups,
14
- parent
15
- } = _ref,
16
- otherProps = _objectWithoutProperties(_ref, _excluded);
17
-
12
+ entityGroups,
13
+ parent
14
+ } = _ref,
15
+ otherProps = _objectWithoutProperties(_ref, _excluded);
18
16
  const {
19
17
  data,
20
18
  loading,
@@ -31,7 +29,6 @@ const GoogleMapsFactory = _ref => {
31
29
  parent: parent
32
30
  }, otherProps));
33
31
  };
34
-
35
32
  GoogleMapsFactory.propTypes = {
36
33
  parent: PropTypes.object,
37
34
  entityGroups: PropTypes.array
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsFactory.js","names":["React","PropTypes","useGetEntitySchemasAsObj","buildShapesConfig","GoogleMapsRender","GoogleMapsHtml","GoogleMapsFactory","entityGroups","parent","otherProps","data","loading","error","map","entity","message","shapeConfigs","propTypes","object","array","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsFactory.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';\nimport { buildShapesConfig } from './helpers';\nimport GoogleMapsRender from './GoogleMapsRender';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst GoogleMapsFactory = ({ entityGroups, parent, ...otherProps }) => {\n const { data, loading, error } = useGetEntitySchemasAsObj(\n entityGroups.map(({ entity }) => entity)\n );\n\n if (loading) return <GoogleMapsHtml />;\n if (error) return error.message;\n\n const shapeConfigs = buildShapesConfig(data, entityGroups, parent);\n\n return (\n <GoogleMapsRender\n shapeConfigs={shapeConfigs}\n entityGroups={entityGroups}\n parent={parent}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsFactory.propTypes = {\n parent: PropTypes.object,\n entityGroups: PropTypes.array\n};\n\nGoogleMapsFactory.defaultProps = {\n parent: {},\n entityGroups: []\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,wBAAT,QAAyC,+BAAzC;AACA,SAASC,iBAAT,QAAkC,WAAlC;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OAAOC,cAAP,MAA2B,kBAA3B;;AAEA,MAAMC,iBAAiB,GAAG,QAA6C;EAAA,IAA5C;IAAEC,YAAF;IAAgBC;EAAhB,CAA4C;EAAA,IAAjBC,UAAiB;;EACrE,MAAM;IAAEC,IAAF;IAAQC,OAAR;IAAiBC;EAAjB,IAA2BV,wBAAwB,CACvDK,YAAY,CAACM,GAAb,CAAiB,CAAC;IAAEC;EAAF,CAAD,KAAgBA,MAAjC,CADuD,CAAzD;EAIA,IAAIH,OAAJ,EAAa,oBAAO,oBAAC,cAAD,OAAP;EACb,IAAIC,KAAJ,EAAW,OAAOA,KAAK,CAACG,OAAb;EAEX,MAAMC,YAAY,GAAGb,iBAAiB,CAACO,IAAD,EAAOH,YAAP,EAAqBC,MAArB,CAAtC;EAEA,oBACE,oBAAC,gBAAD;IACE,YAAY,EAAEQ,YADhB;IAEE,YAAY,EAAET,YAFhB;IAGE,MAAM,EAAEC;EAHV,GAIMC,UAJN,EADF;AAQD,CAlBD;;AAoBAH,iBAAiB,CAACW,SAAlB,GAA8B;EAC5BT,MAAM,EAAEP,SAAS,CAACiB,MADU;EAE5BX,YAAY,EAAEN,SAAS,CAACkB;AAFI,CAA9B;AAKAb,iBAAiB,CAACc,YAAlB,GAAiC;EAC/BZ,MAAM,EAAE,EADuB;EAE/BD,YAAY,EAAE;AAFiB,CAAjC;AAKA,eAAeD,iBAAf"}
1
+ {"version":3,"file":"GoogleMapsFactory.js","names":["React","PropTypes","useGetEntitySchemasAsObj","buildShapesConfig","GoogleMapsRender","GoogleMapsHtml","GoogleMapsFactory","entityGroups","parent","otherProps","data","loading","error","map","entity","message","shapeConfigs","propTypes","object","array","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsFactory.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';\nimport { buildShapesConfig } from './helpers';\nimport GoogleMapsRender from './GoogleMapsRender';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst GoogleMapsFactory = ({ entityGroups, parent, ...otherProps }) => {\n const { data, loading, error } = useGetEntitySchemasAsObj(\n entityGroups.map(({ entity }) => entity)\n );\n\n if (loading) return <GoogleMapsHtml />;\n if (error) return error.message;\n\n const shapeConfigs = buildShapesConfig(data, entityGroups, parent);\n\n return (\n <GoogleMapsRender\n shapeConfigs={shapeConfigs}\n entityGroups={entityGroups}\n parent={parent}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsFactory.propTypes = {\n parent: PropTypes.object,\n entityGroups: PropTypes.array\n};\n\nGoogleMapsFactory.defaultProps = {\n parent: {},\n entityGroups: []\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,SAASC,iBAAiB,QAAQ,WAAW;AAC7C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,iBAAiB,GAAG,QAA6C;EAAA,IAA5C;MAAEC,YAAY;MAAEC;IAAsB,CAAC;IAAZC,UAAU;EAC9D,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGV,wBAAwB,CACvDK,YAAY,CAACM,GAAG,CAAC,CAAC;IAAEC;EAAO,CAAC,KAAKA,MAAM,CAAC,CACzC;EAED,IAAIH,OAAO,EAAE,oBAAO,oBAAC,cAAc,OAAG;EACtC,IAAIC,KAAK,EAAE,OAAOA,KAAK,CAACG,OAAO;EAE/B,MAAMC,YAAY,GAAGb,iBAAiB,CAACO,IAAI,EAAEH,YAAY,EAAEC,MAAM,CAAC;EAElE,oBACE,oBAAC,gBAAgB;IACf,YAAY,EAAEQ,YAAa;IAC3B,YAAY,EAAET,YAAa;IAC3B,MAAM,EAAEC;EAAO,GACXC,UAAU,EACd;AAEN,CAAC;AAEDH,iBAAiB,CAACW,SAAS,GAAG;EAC5BT,MAAM,EAAEP,SAAS,CAACiB,MAAM;EACxBX,YAAY,EAAEN,SAAS,CAACkB;AAC1B,CAAC;AAEDb,iBAAiB,CAACc,YAAY,GAAG;EAC/BZ,MAAM,EAAE,CAAC,CAAC;EACVD,YAAY,EAAE;AAChB,CAAC;AAED,eAAeD,iBAAiB"}
@@ -1,13 +1,11 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
-
4
3
  const GoogleMapsFactory = ({
5
4
  mapRef
6
5
  }) => /*#__PURE__*/React.createElement("div", {
7
6
  className: `google-maps ${!mapRef ? 'loading' : ''}`,
8
7
  ref: mapRef
9
8
  });
10
-
11
9
  GoogleMapsFactory.propTypes = {
12
10
  mapRef: PropTypes.object
13
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsHtml.js","names":["React","PropTypes","GoogleMapsFactory","mapRef","propTypes","object","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsHtml.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst GoogleMapsFactory = ({ mapRef }) => (\n <div className={`google-maps ${!mapRef ? 'loading' : ''}`} ref={mapRef} />\n);\n\nGoogleMapsFactory.propTypes = {\n mapRef: PropTypes.object\n};\n\nGoogleMapsFactory.defaultProps = {\n mapRef: null\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;;AAEA,MAAMC,iBAAiB,GAAG,CAAC;EAAEC;AAAF,CAAD,kBACxB;EAAK,SAAS,EAAG,eAAc,CAACA,MAAD,GAAU,SAAV,GAAsB,EAAG,EAAxD;EAA2D,GAAG,EAAEA;AAAhE,EADF;;AAIAD,iBAAiB,CAACE,SAAlB,GAA8B;EAC5BD,MAAM,EAAEF,SAAS,CAACI;AADU,CAA9B;AAIAH,iBAAiB,CAACI,YAAlB,GAAiC;EAC/BH,MAAM,EAAE;AADuB,CAAjC;AAIA,eAAeD,iBAAf"}
1
+ {"version":3,"file":"GoogleMapsHtml.js","names":["React","PropTypes","GoogleMapsFactory","mapRef","propTypes","object","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsHtml.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst GoogleMapsFactory = ({ mapRef }) => (\n <div className={`google-maps ${!mapRef ? 'loading' : ''}`} ref={mapRef} />\n);\n\nGoogleMapsFactory.propTypes = {\n mapRef: PropTypes.object\n};\n\nGoogleMapsFactory.defaultProps = {\n mapRef: null\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,iBAAiB,GAAG,CAAC;EAAEC;AAAO,CAAC,kBACnC;EAAK,SAAS,EAAG,eAAc,CAACA,MAAM,GAAG,SAAS,GAAG,EAAG,EAAE;EAAC,GAAG,EAAEA;AAAO,EACxE;AAEDD,iBAAiB,CAACE,SAAS,GAAG;EAC5BD,MAAM,EAAEF,SAAS,CAACI;AACpB,CAAC;AAEDH,iBAAiB,CAACI,YAAY,GAAG;EAC/BH,MAAM,EAAE;AACV,CAAC;AAED,eAAeD,iBAAiB"}
@@ -11,15 +11,13 @@ import { buildQuery, getImageIds, getCenterCoordinates, buildMapShapes } from '.
11
11
  import GoogleMaps from './GoogleMaps';
12
12
  import GoogleMapsHtml from './GoogleMapsHtml';
13
13
  const defaultQuery = getAction('getPublishedPages', 'id');
14
-
15
14
  const GoogleMapsRender = _ref => {
16
15
  let {
17
- shapeConfigs,
18
- entityGroups,
19
- id
20
- } = _ref,
21
- otherProps = _objectWithoutProperties(_ref, _excluded);
22
-
16
+ shapeConfigs,
17
+ entityGroups,
18
+ id
19
+ } = _ref,
20
+ otherProps = _objectWithoutProperties(_ref, _excluded);
23
21
  const {
24
22
  defaultZoom
25
23
  } = otherProps;
@@ -54,7 +52,6 @@ const GoogleMapsRender = _ref => {
54
52
  imageData: imageData
55
53
  }, otherProps));
56
54
  };
57
-
58
55
  GoogleMapsRender.propTypes = {
59
56
  entityGroups: PropTypes.array,
60
57
  id: PropTypes.string,
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsRender.js","names":["React","PropTypes","isNumber","useQuery","getAction","useGetImages","buildQuery","getImageIds","getCenterCoordinates","buildMapShapes","GoogleMaps","GoogleMapsHtml","defaultQuery","GoogleMapsRender","shapeConfigs","entityGroups","id","otherProps","defaultZoom","query","data","loading","error","skip","mapShapes","imageIds","getFiles","imageData","imagesLoading","imagesError","centerCoordinates","shouldDisplayMap","length","slug","propTypes","array","string","centerLatitude","number","centerLongitude","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isNumber from 'lodash.isnumber';\nimport { useQuery } from '@apollo/client';\nimport { getAction } from '@blaze-cms/react-page-builder';\nimport { useGetImages } from './hooks';\nimport { buildQuery, getImageIds, getCenterCoordinates, buildMapShapes } from './helpers';\nimport GoogleMaps from './GoogleMaps';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst defaultQuery = getAction('getPublishedPages', 'id');\n\nconst GoogleMapsRender = ({ shapeConfigs, entityGroups, id, ...otherProps }) => {\n const { defaultZoom } = otherProps;\n const { query } = buildQuery(shapeConfigs);\n const { data, loading, error } = useQuery(query || defaultQuery, {\n skip: !query\n });\n const mapShapes = buildMapShapes(shapeConfigs, data);\n const imageIds = getImageIds(mapShapes);\n const {\n data: { getFiles: imageData } = {},\n loading: imagesLoading,\n error: imagesError\n } = useGetImages(imageIds);\n if (loading || imagesLoading) return <GoogleMapsHtml />;\n if (error || imagesError) return null;\n\n const centerCoordinates = getCenterCoordinates(mapShapes, otherProps);\n const shouldDisplayMap = isNumber(defaultZoom) && !!centerCoordinates.length;\n\n if (!shouldDisplayMap) return null;\n\n return (\n <GoogleMaps\n key={otherProps.slug}\n centerCoordinates={centerCoordinates}\n mapShapes={mapShapes}\n imageData={imageData}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsRender.propTypes = {\n entityGroups: PropTypes.array,\n id: PropTypes.string,\n shapeConfigs: PropTypes.array,\n centerLatitude: PropTypes.number,\n centerLongitude: PropTypes.number,\n defaultZoom: PropTypes.number\n};\n\nGoogleMapsRender.defaultProps = {\n entityGroups: [],\n shapeConfigs: [],\n id: '',\n centerLatitude: null,\n centerLongitude: null,\n defaultZoom: null\n};\n\nexport default GoogleMapsRender;\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,iBAArB;AACA,SAASC,QAAT,QAAyB,gBAAzB;AACA,SAASC,SAAT,QAA0B,+BAA1B;AACA,SAASC,YAAT,QAA6B,SAA7B;AACA,SAASC,UAAT,EAAqBC,WAArB,EAAkCC,oBAAlC,EAAwDC,cAAxD,QAA8E,WAA9E;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AAEA,MAAMC,YAAY,GAAGR,SAAS,CAAC,mBAAD,EAAsB,IAAtB,CAA9B;;AAEA,MAAMS,gBAAgB,GAAG,QAAuD;EAAA,IAAtD;IAAEC,YAAF;IAAgBC,YAAhB;IAA8BC;EAA9B,CAAsD;EAAA,IAAjBC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AAEpC,SAAS,CAACqC,MAJC;EAK3BC,eAAe,EAAEtC,SAAS,CAACqC,MALA;EAM3BpB,WAAW,EAAEjB,SAAS,CAACqC;AANI,CAA7B;AASAzB,gBAAgB,CAAC2B,YAAjB,GAAgC;EAC9BzB,YAAY,EAAE,EADgB;EAE9BD,YAAY,EAAE,EAFgB;EAG9BE,EAAE,EAAE,EAH0B;EAI9BqB,cAAc,EAAE,IAJc;EAK9BE,eAAe,EAAE,IALa;EAM9BrB,WAAW,EAAE;AANiB,CAAhC;AASA,eAAeL,gBAAf"}
1
+ {"version":3,"file":"GoogleMapsRender.js","names":["React","PropTypes","isNumber","useQuery","getAction","useGetImages","buildQuery","getImageIds","getCenterCoordinates","buildMapShapes","GoogleMaps","GoogleMapsHtml","defaultQuery","GoogleMapsRender","shapeConfigs","entityGroups","id","otherProps","defaultZoom","query","data","loading","error","skip","mapShapes","imageIds","getFiles","imageData","imagesLoading","imagesError","centerCoordinates","shouldDisplayMap","length","slug","propTypes","array","string","centerLatitude","number","centerLongitude","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isNumber from 'lodash.isnumber';\nimport { useQuery } from '@apollo/client';\nimport { getAction } from '@blaze-cms/react-page-builder';\nimport { useGetImages } from './hooks';\nimport { buildQuery, getImageIds, getCenterCoordinates, buildMapShapes } from './helpers';\nimport GoogleMaps from './GoogleMaps';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst defaultQuery = getAction('getPublishedPages', 'id');\n\nconst GoogleMapsRender = ({ shapeConfigs, entityGroups, id, ...otherProps }) => {\n const { defaultZoom } = otherProps;\n const { query } = buildQuery(shapeConfigs);\n const { data, loading, error } = useQuery(query || defaultQuery, {\n skip: !query\n });\n const mapShapes = buildMapShapes(shapeConfigs, data);\n const imageIds = getImageIds(mapShapes);\n const {\n data: { getFiles: imageData } = {},\n loading: imagesLoading,\n error: imagesError\n } = useGetImages(imageIds);\n if (loading || imagesLoading) return <GoogleMapsHtml />;\n if (error || imagesError) return null;\n\n const centerCoordinates = getCenterCoordinates(mapShapes, otherProps);\n const shouldDisplayMap = isNumber(defaultZoom) && !!centerCoordinates.length;\n\n if (!shouldDisplayMap) return null;\n\n return (\n <GoogleMaps\n key={otherProps.slug}\n centerCoordinates={centerCoordinates}\n mapShapes={mapShapes}\n imageData={imageData}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsRender.propTypes = {\n entityGroups: PropTypes.array,\n id: PropTypes.string,\n shapeConfigs: PropTypes.array,\n centerLatitude: PropTypes.number,\n centerLongitude: PropTypes.number,\n defaultZoom: PropTypes.number\n};\n\nGoogleMapsRender.defaultProps = {\n entityGroups: [],\n shapeConfigs: [],\n id: '',\n centerLatitude: null,\n centerLongitude: null,\n defaultZoom: null\n};\n\nexport default GoogleMapsRender;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,YAAY,QAAQ,SAAS;AACtC,SAASC,UAAU,EAAEC,WAAW,EAAEC,oBAAoB,EAAEC,cAAc,QAAQ,WAAW;AACzF,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,YAAY,GAAGR,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC;AAEzD,MAAMS,gBAAgB,GAAG,QAAuD;EAAA,IAAtD;MAAEC,YAAY;MAAEC,YAAY;MAAEC;IAAkB,CAAC;IAAZC,UAAU;EACvE,MAAM;IAAEC;EAAY,CAAC,GAAGD,UAAU;EAClC,MAAM;IAAEE;EAAM,CAAC,GAAGb,UAAU,CAACQ,YAAY,CAAC;EAC1C,MAAM;IAAEM,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGn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,EAAE;EAChBD,YAAY,EAAE,EAAE;EAChBE,EAAE,EAAE,EAAE;EACNqB,cAAc,EAAE,IAAI;EACpBE,eAAe,EAAE,IAAI;EACrBrB,WAAW,EAAE;AACf,CAAC;AAED,eAAeL,gBAAgB"}
@@ -1,11 +1,9 @@
1
1
  import { ZOOM_CHANGED } from '../../constants';
2
2
  import setShapes from './set-shapes';
3
-
4
3
  const addZoomListener = (map, router, shapes, imageData) => {
5
4
  if (!map) return;
6
5
  setShapes(map, router, shapes, imageData);
7
6
  map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData));
8
7
  };
9
-
10
8
  export default addZoomListener;
11
9
  //# sourceMappingURL=add-zoom-listener.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-zoom-listener.js","names":["ZOOM_CHANGED","setShapes","addZoomListener","map","router","shapes","imageData","addListener"],"sources":["../../../src/GoogleMaps/helpers/add-zoom-listener.js"],"sourcesContent":["import { ZOOM_CHANGED } from '../../constants';\nimport setShapes from './set-shapes';\n\nconst addZoomListener = (map, router, shapes, imageData) => {\n if (!map) return;\n setShapes(map, router, shapes, imageData);\n map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData));\n};\n\nexport default addZoomListener;\n"],"mappings":"AAAA,SAASA,YAAT,QAA6B,iBAA7B;AACA,OAAOC,SAAP,MAAsB,cAAtB;;AAEA,MAAMC,eAAe,GAAG,CAACC,GAAD,EAAMC,MAAN,EAAcC,MAAd,EAAsBC,SAAtB,KAAoC;EAC1D,IAAI,CAACH,GAAL,EAAU;EACVF,SAAS,CAACE,GAAD,EAAMC,MAAN,EAAcC,MAAd,EAAsBC,SAAtB,CAAT;EACAH,GAAG,CAACI,WAAJ,CAAgBP,YAAhB,EAA8B,MAAMC,SAAS,CAACE,GAAD,EAAMC,MAAN,EAAcC,MAAd,EAAsBC,SAAtB,CAA7C;AACD,CAJD;;AAMA,eAAeJ,eAAf"}
1
+ {"version":3,"file":"add-zoom-listener.js","names":["ZOOM_CHANGED","setShapes","addZoomListener","map","router","shapes","imageData","addListener"],"sources":["../../../src/GoogleMaps/helpers/add-zoom-listener.js"],"sourcesContent":["import { ZOOM_CHANGED } from '../../constants';\nimport setShapes from './set-shapes';\n\nconst addZoomListener = (map, router, shapes, imageData) => {\n if (!map) return;\n setShapes(map, router, shapes, imageData);\n map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData));\n};\n\nexport default addZoomListener;\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,OAAOC,SAAS,MAAM,cAAc;AAEpC,MAAMC,eAAe,GAAG,CAACC,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,KAAK;EAC1D,IAAI,CAACH,GAAG,EAAE;EACVF,SAAS,CAACE,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC;EACzCH,GAAG,CAACI,WAAW,CAACP,YAAY,EAAE,MAAMC,SAAS,CAACE,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC,CAAC;AAChF,CAAC;AAED,eAAeJ,eAAe"}
@@ -1,15 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
-
5
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
-
7
4
  const getLatLonValues = (keys, data) => {
8
5
  if (keys.length === 1) return data[keys];
9
6
  const key = keys.shift();
10
7
  return getLatLonValues(keys, data[key]);
11
8
  };
12
-
13
9
  const getLatLong = (latProp, lonProp, shape, data) => {
14
10
  const {
15
11
  latitude,
@@ -28,7 +24,6 @@ const getLatLong = (latProp, lonProp, shape, data) => {
28
24
  longitude: lon
29
25
  };
30
26
  };
31
-
32
27
  const buildMapShapes = (shapesOptions, shapesData) => {
33
28
  if (!shapesData) return [];
34
29
  const mapShapes = [];
@@ -56,7 +51,6 @@ const buildMapShapes = (shapesOptions, shapesData) => {
56
51
  latitude,
57
52
  longitude
58
53
  } = getLatLong(latProp, lonProp, shapeOptions, data);
59
-
60
54
  const formatedShape = _objectSpread(_objectSpread({}, shapeOptions), {}, {
61
55
  latitude,
62
56
  longitude,
@@ -65,12 +59,10 @@ const buildMapShapes = (shapesOptions, shapesData) => {
65
59
  url,
66
60
  shapeData: data
67
61
  });
68
-
69
62
  mapShapes.push(formatedShape);
70
63
  });
71
64
  });
72
65
  return mapShapes;
73
66
  };
74
-
75
67
  export default buildMapShapes;
76
68
  //# sourceMappingURL=build-map-shapes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-map-shapes.js","names":["getLatLonValues","keys","data","length","key","shift","getLatLong","latProp","lonProp","shape","latitude","longitude","latKeys","split","lonKeys","lat","lon","buildMapShapes","shapesOptions","shapesData","mapShapes","forEach","shapeKey","entityOptions","shapeOptions","dataSummaries","enableInfoPane","shapeData","Array","isArray","results","url","formatedShape","push"],"sources":["../../../src/GoogleMaps/helpers/build-map-shapes.js"],"sourcesContent":["const getLatLonValues = (keys, data) => {\n if (keys.length === 1) return data[keys];\n const key = keys.shift();\n return getLatLonValues(keys, data[key]);\n};\n\nconst getLatLong = (latProp, lonProp, shape, data) => {\n const { latitude, longitude } = shape;\n\n if (!latProp || !lonProp) return { latitude, longitude };\n const latKeys = latProp.split('.');\n const lonKeys = lonProp.split('.');\n const lat = getLatLonValues(latKeys, data);\n const lon = getLatLonValues(lonKeys, data);\n\n return { latitude: lat, longitude: lon };\n};\n\nconst buildMapShapes = (shapesOptions, shapesData) => {\n if (!shapesData) return [];\n const mapShapes = [];\n shapesOptions.forEach(shape => {\n const { shapeKey, entityOptions, shapeOptions } = shape;\n const { dataSummaries, enableInfoPane } = entityOptions;\n\n const shapeData = Array.isArray(shapesData[shapeKey])\n ? shapesData[shapeKey]\n : shapesData[shapeKey].results;\n if (!shapeData) return;\n const { latProp, lonProp } = entityOptions;\n\n shapeData.forEach(data => {\n const { url } = data;\n const { latitude, longitude } = getLatLong(latProp, lonProp, shapeOptions, data);\n\n const formatedShape = {\n ...shapeOptions,\n latitude,\n longitude,\n dataSummaries,\n enableInfoPane,\n url,\n shapeData: data\n };\n\n mapShapes.push(formatedShape);\n });\n });\n\n return mapShapes;\n};\n\nexport default buildMapShapes;\n"],"mappings":";;;;;;AAAA,MAAMA,eAAe,GAAG,CAACC,IAAD,EAAOC,IAAP,KAAgB;EACtC,IAAID,IAAI,CAACE,MAAL,KAAgB,CAApB,EAAuB,OAAOD,IAAI,CAACD,IAAD,CAAX;EACvB,MAAMG,GAAG,GAAGH,IAAI,CAACI,KAAL,EAAZ;EACA,OAAOL,eAAe,CAACC,IAAD,EAAOC,IAAI,CAACE,GAAD,CAAX,CAAtB;AACD,CAJD;;AAMA,MAAME,UAAU,GAAG,CAACC,OAAD,EAAUC,OAAV,EAAmBC,KAAnB,EAA0BP,IAA1B,KAAmC;EACpD,MAAM;IAAEQ,QAAF;IAAYC;EAAZ,IAA0BF,KAAhC;EAEA,IAAI,CAACF,OAAD,IAAY,CAACC,OAAjB,EAA0B,OAAO;IAAEE,QAAF;IAAYC;EAAZ,CAAP;EAC1B,MAAMC,OAAO,GAAGL,OAAO,CAACM,KAAR,CAAc,GAAd,CAAhB;EACA,MAAMC,OAAO,GAAGN,OAAO,CAACK,KAAR,CAAc,GAAd,CAAhB;EACA,MAAME,GAAG,GAAGf,eAAe,CAACY,OAAD,EAAUV,I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["getLatLonValues","keys","data","length","key","shift","getLatLong","latProp","lonProp","shape","latitude","longitude","latKeys","split","lonKeys","lat","lon","buildMapShapes","shapesOptions","shapesData","mapShapes","forEach","shapeKey","entityOptions","shapeOptions","dataSummaries","enableInfoPane","shapeData","Array","isArray","results","url","formatedShape","push"],"sources":["../../../src/GoogleMaps/helpers/build-map-shapes.js"],"sourcesContent":["const getLatLonValues = (keys, data) => {\n if (keys.length === 1) return data[keys];\n const key = keys.shift();\n return getLatLonValues(keys, data[key]);\n};\n\nconst getLatLong = (latProp, lonProp, shape, data) => {\n const { latitude, longitude } = shape;\n\n if (!latProp || !lonProp) return { latitude, longitude };\n const latKeys = latProp.split('.');\n const lonKeys = lonProp.split('.');\n const lat = getLatLonValues(latKeys, data);\n const lon = getLatLonValues(lonKeys, data);\n\n return { latitude: lat, longitude: lon };\n};\n\nconst buildMapShapes = (shapesOptions, shapesData) => {\n if (!shapesData) return [];\n const mapShapes = [];\n shapesOptions.forEach(shape => {\n const { shapeKey, entityOptions, shapeOptions } = shape;\n const { dataSummaries, enableInfoPane } = entityOptions;\n\n const shapeData = Array.isArray(shapesData[shapeKey])\n ? shapesData[shapeKey]\n : shapesData[shapeKey].results;\n if (!shapeData) return;\n const { latProp, lonProp } = entityOptions;\n\n shapeData.forEach(data => {\n const { url } = data;\n const { latitude, longitude } = getLatLong(latProp, lonProp, shapeOptions, data);\n\n const formatedShape = {\n ...shapeOptions,\n latitude,\n longitude,\n dataSummaries,\n enableInfoPane,\n url,\n shapeData: data\n };\n\n mapShapes.push(formatedShape);\n });\n });\n\n return mapShapes;\n};\n\nexport default buildMapShapes;\n"],"mappings":";;;AAAA,MAAMA,eAAe,GAAG,CAACC,IAAI,EAAEC,IAAI,KAAK;EACtC,IAAID,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE,OAAOD,IAAI,CAACD,IAAI,CAAC;EACxC,MAAMG,GAAG,GAAGH,IAAI,CAACI,KAAK,EAAE;EACxB,OAAOL,eAAe,CAACC,I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ACxB,MAAM;QAAE6B;MAAI,CAAC,GAAG7B,IAAI;MACpB,MAAM;QAAEQ,QAAQ;QAAEC;MAAU,CAAC,GAAGL,UAAU,CAACC,OAAO,EAAEC,OAAO,EAAEgB,YAAY,EAAEtB,IAAI,CAAC;MAEhF,MAAM8B,aAAa,mCACdR,YAAY;QACfd,QAAQ;QACRC,SAAS;QACTc,aAAa;QACbC,cAAc;QACdK,GAAG;QACHJ,SAAS,EAAEzB;MAAI,EAChB;MAEDkB,SAAS,CAACa,IAAI,CAACD,aAAa,CAAC;IAC/B,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOZ,SAAS;AAClB,CAAC;AAED,eAAeH,cAAc"}
@@ -1,11 +1,9 @@
1
1
  import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';
2
-
3
2
  const buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {
4
3
  const mapTypeIds = [ROADMAP];
5
4
  if (enableSatelliteView) mapTypeIds.push(SATELLITE);
6
5
  if (enableTerrainScreen) mapTypeIds.push(TERRAIN);
7
6
  return mapTypeIds;
8
7
  };
9
-
10
8
  export default buildMapTypeIds;
11
9
  //# sourceMappingURL=build-map-type-ids.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-map-type-ids.js","names":["ROADMAP","SATELLITE","TERRAIN","buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","push"],"sources":["../../../src/GoogleMaps/helpers/build-map-type-ids.js"],"sourcesContent":["import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';\n\nconst buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {\n const mapTypeIds = [ROADMAP];\n if (enableSatelliteView) mapTypeIds.push(SATELLITE);\n if (enableTerrainScreen) mapTypeIds.push(TERRAIN);\n return mapTypeIds;\n};\n\nexport default buildMapTypeIds;\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,SAAlB,EAA6BC,OAA7B,QAA4C,iBAA5C;;AAEA,MAAMC,eAAe,GAAG,CAACC,mBAAD,EAAsBC,mBAAtB,KAA8C;EACpE,MAAMC,UAAU,GAAG,CAACN,OAAD,CAAnB;EACA,IAAII,mBAAJ,EAAyBE,UAAU,CAACC,IAAX,CAAgBN,SAAhB;EACzB,IAAII,mBAAJ,EAAyBC,UAAU,CAACC,IAAX,CAAgBL,OAAhB;EACzB,OAAOI,UAAP;AACD,CALD;;AAOA,eAAeH,eAAf"}
1
+ {"version":3,"file":"build-map-type-ids.js","names":["ROADMAP","SATELLITE","TERRAIN","buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","push"],"sources":["../../../src/GoogleMaps/helpers/build-map-type-ids.js"],"sourcesContent":["import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';\n\nconst buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {\n const mapTypeIds = [ROADMAP];\n if (enableSatelliteView) mapTypeIds.push(SATELLITE);\n if (enableTerrainScreen) mapTypeIds.push(TERRAIN);\n return mapTypeIds;\n};\n\nexport default buildMapTypeIds;\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,SAAS,EAAEC,OAAO,QAAQ,iBAAiB;AAE7D,MAAMC,eAAe,GAAG,CAACC,mBAAmB,EAAEC,mBAAmB,KAAK;EACpE,MAAMC,UAAU,GAAG,CAACN,OAAO,CAAC;EAC5B,IAAII,mBAAmB,EAAEE,UAAU,CAACC,IAAI,CAACN,SAAS,CAAC;EACnD,IAAII,mBAAmB,EAAEC,UAAU,CAACC,IAAI,CAACL,OAAO,CAAC;EACjD,OAAOI,UAAU;AACnB,CAAC;AAED,eAAeH,eAAe"}
@@ -1,5 +1,4 @@
1
1
  import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';
2
-
3
2
  const buildQuery = entityConfigs => {
4
3
  const entityIds = [];
5
4
  const rawQueryStringified = '';
@@ -26,6 +25,5 @@ const buildQuery = entityConfigs => {
26
25
  rawQueryStringified
27
26
  };
28
27
  };
29
-
30
28
  export default buildQuery;
31
29
  //# sourceMappingURL=build-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-query.js","names":["generateQuery","generateIdsQuery","generateFiltersQuery","buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","toUpperCase","slice","filterQueryKey","indexOf","push","props","trim","singleItemQuery","JSON","stringify","join","query"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;\n"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,gBAAxB,EAA0CC,oBAA1C,QAAsE,YAAtE;;AAEA,MAAMC,UAAU,GAAGC,aAAa,IAAI;EAClC,MAAMC,SAAS,GAAG,EAAlB;EACA,MAAMC,mBAAmB,GAAG,EAA5B;EACA,MAAMC,WAAW,GAAGH,aAAa,CAC9BI,GADiB,CACbC,YAAY,IAAI;IACnB,MAAM;MAAEC,MAAF;MAAUC,GAAV;MAAeC,MAAf;MAAuBC,UAAvB;MAAmCC,QAAnC;MAA6CC;IAA7C,IAA+DN,YAArE;IACA,IAAI,CAACC,MAAL,EAAa,OAAO,EAAP;IACb,MAAMM,cAAc,GAAI,GAAEJ,MAAM,CAAC,CAAD,CAAN,CAAUK,WAAV,EAAwB,GAAEL,MAAM,CAACM,KAAP,CAAa,CAAb,CAAgB,EAApE;IACA,MAAMC,cAAc,GAClBT,MAAM,CAACU,OAAP,CAAe,WAAf,MAAgC,CAAC,CAAjC,GAAsC,YAAWJ,cAAe,EAAhE,GAAoEA,cADtE;IAGAX,SAAS,CAACgB,IAAV,CAAe,GAAGV,GAAlB;IACA,MAAMW,KAAK,GAAGT,UAAU,CAACU,IAAX,MAAqB,IAAnC;IACA,MAAMC,eAAe,GAAGT,aAAa,GACjCb,oBAAoB,CAACY,QAAD,EAAWQ,KAAX,EAAkBG,IAAI,CAACC,SAAL,CAAeX,aAAf,CAAlB,EAAiDI,cAAjD,CADa,GAEjClB,gBAAgB,CAACa,QAAD,EAAWQ,KAAX,EAAkBZ,MAAlB,EAA0BC,GAA1B,CAFpB;IAIA,OAAOa,eAAP;EACD,CAfiB,EAgBjBG,IAhBiB,CAgBZ,GAhBY,CAApB;EAkBA,OAAO;IACLC,KAAK,EAAErB,WAAW,GAAGP,aAAa,CAACO,WAAD,CAAhB,GAAgC,EAD7C;IAELI,GAAG,EAAEN,SAFA;IAGLC;EAHK,CAAP;AAKD,CA1BD;;AA4BA,eAAeH,UAAf"}
1
+ {"version":3,"file":"build-query.js","names":["generateQuery","generateIdsQuery","generateFiltersQuery","buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","toUpperCase","slice","filterQueryKey","indexOf","push","props","trim","singleItemQuery","JSON","stringify","join","query"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,gBAAgB,EAAEC,oBAAoB,QAAQ,YAAY;AAElF,MAAMC,UAAU,GAAGC,aAAa,IAAI;EAClC,MAAMC,SAAS,GAAG,EAAE;EACpB,MAAMC,mBAAmB,GAAG,EAAE;EAC9B,MAAMC,WAAW,GAAGH,aAAa,CAC9BI,GAAG,CAACC,YAAY,IAAI;IACnB,MAAM;MAAEC,MAAM;MAAEC,GAAG;MAAEC,MAAM;MAAEC,UAAU;MAAEC,QAAQ;MAAEC;IAAc,CAAC,GAAGN,YAAY;IACjF,IAAI,CAACC,MAAM,EAAE,OAAO,EAAE;IACtB,MAAMM,cAAc,GAAI,GAAEJ,MAAM,CAAC,CAAC,CAAC,CAACK,WAAW,EAAG,GAAEL,MAAM,CAACM,KAAK,CAAC,CAAC,CAAE,EAAC;IACrE,MAAMC,cAAc,GAClBT,MAAM,CAACU,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAAI,YAAWJ,cAAe,EAAC,GAAGA,cAAc;IAEpFX,SAAS,CAACgB,IAAI,CAAC,GAAGV,GAAG,CAAC;IACtB,MAAMW,KAAK,GAAGT,UAAU,CAACU,IAAI,EAAE,IAAI,IAAI;IACvC,MAAMC,eAAe,GAAGT,aAAa,GACjCb,oBAAoB,CAACY,QAAQ,EAAEQ,KAAK,EAAEG,IAAI,CAACC,SAAS,CAACX,aAAa,CAAC,EAAEI,cAAc,CAAC,GACpFlB,gBAAgB,CAACa,QAAQ,EAAEQ,KAAK,EAAEZ,MAAM,EAAEC,GAAG,CAAC;IAElD,OAAOa,eAAe;EACxB,CAAC,CAAC,CACDG,IAAI,CAAC,GAAG,CAAC;EAEZ,OAAO;IACLC,KAAK,EAAErB,WAAW,GAAGP,aAAa,CAACO,WAAW,CAAC,GAAG,EAAE;IACpDI,GAAG,EAAEN,SAAS;IACdC;EACF,CAAC;AACH,CAAC;AAED,eAAeH,UAAU"}
@@ -1,21 +1,15 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
-
5
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
-
7
4
  import flatten from 'lodash.flatten';
8
5
  import { IMAGE_ID, URL, ID } from '../../constants';
9
-
10
6
  const getPropValues = properties => properties.reduce((acc, property) => {
11
7
  if (property.includes('.')) {
12
8
  const [relationName, relationProp] = property.split('.');
13
9
  return `${acc} ${relationName} { ${relationProp} }`;
14
10
  }
15
-
16
11
  return `${acc} ${property}`;
17
12
  }, '').trim();
18
-
19
13
  const getUpdatedPropsQuery = (propsQuery, entityData) => {
20
14
  const {
21
15
  properties = {},
@@ -27,7 +21,6 @@ const getUpdatedPropsQuery = (propsQuery, entityData) => {
27
21
  updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;
28
22
  return updatedPropsQuery;
29
23
  };
30
-
31
24
  const buildFilterQueryString = filter => {
32
25
  const [filterKey, filterValue] = filter.split('/');
33
26
  const filterKeyword = `${filterKey}.keyword`;
@@ -41,7 +34,6 @@ const buildFilterQueryString = filter => {
41
34
  }
42
35
  };
43
36
  };
44
-
45
37
  const buildFilters = filters => {
46
38
  if (!filters || !filters.length) return null;
47
39
  const filterQueryProps = filters.map(buildFilterQueryString);
@@ -51,7 +43,6 @@ const buildFilters = filters => {
51
43
  }
52
44
  };
53
45
  };
54
-
55
46
  const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {
56
47
  const {
57
48
  displayItems = [],
@@ -81,11 +72,9 @@ const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData,
81
72
  const filtersObject = buildFilters(filterBy);
82
73
  let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';
83
74
  propsQuery = getUpdatedPropsQuery(propsQuery, entityData);
84
-
85
75
  if (latProp && lonProp) {
86
76
  propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(lonProp, relations)}`;
87
77
  }
88
-
89
78
  if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;
90
79
  return {
91
80
  shapeKey,
@@ -96,7 +85,6 @@ const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData,
96
85
  filtersObject
97
86
  };
98
87
  };
99
-
100
88
  const formatProp = (prop, relations = []) => {
101
89
  if (!prop.includes('.')) return prop;
102
90
  const [mainProp, nestedProp] = prop.split('.');
@@ -105,7 +93,6 @@ const formatProp = (prop, relations = []) => {
105
93
  }) => localField === mainProp) ? 'id ' : '';
106
94
  return `${mainProp}{${idProp}${nestedProp}}`;
107
95
  };
108
-
109
96
  const buildShapesConfig = (schemas, entityGroups, parent) => {
110
97
  if (!schemas || !entityGroups) return [];
111
98
  const {
@@ -133,6 +120,5 @@ const buildShapesConfig = (schemas, entityGroups, parent) => {
133
120
  });
134
121
  return shapeGroups;
135
122
  };
136
-
137
123
  export default buildShapesConfig;
138
124
  //# sourceMappingURL=build-shapes-configs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-shapes-configs.js","names":["flatten","IMAGE_ID","URL","ID","getPropValues","properties","reduce","acc","property","includes","relationName","relationProp","split","trim","getUpdatedPropsQuery","propsQuery","entityData","dynamicProperties","url","Object","keys","filter","prop","hasImage","length","updatedPropsQuery","buildFilterQueryString","filterKey","filterValue","filterKeyword","bool","should","match","buildFilters","filters","filterQueryProps","map","buiildShapeProps","shape","shapeKey","dataSummaries","parentId","entityGroup","displayItems","filterBy","latProp","lonProp","entity","actions","relations","action","getAllPublished","getAll","dataSummaryProps","propsToDisplay","propsToDisplayValues","propertiesToDisplay","propsToDisplayString","ids","push","filtersObject","formatProp","mainProp","nestedProp","idProp","find","localField","buildShapesConfig","schemas","entityGroups","parent","itemId","itemEntity","shapeGroups","forEach","i","shapes","Boolean","shapeIndex","shapeValues","shapeOptions","entityOptions"],"sources":["../../../src/GoogleMaps/helpers/build-shapes-configs.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { IMAGE_ID, URL, ID } from '../../constants';\n\nconst getPropValues = properties =>\n properties\n .reduce((acc, property) => {\n if (property.includes('.')) {\n const [relationName, relationProp] = property.split('.');\n return `${acc} ${relationName} { ${relationProp} }`;\n }\n return `${acc} ${property}`;\n }, '')\n .trim();\n\nconst getUpdatedPropsQuery = (propsQuery, entityData) => {\n const { properties = {}, dynamicProperties = {} } = entityData;\n\n const [url] = Object.keys(dynamicProperties).filter(prop => prop === URL);\n const hasImage = !!Object.keys(properties).filter(prop => prop === IMAGE_ID).length;\n\n let updatedPropsQuery = hasImage ? `${propsQuery} ${IMAGE_ID}` : propsQuery;\n updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;\n\n return updatedPropsQuery;\n};\n\nconst buildFilterQueryString = filter => {\n const [filterKey, filterValue] = filter.split('/');\n const filterKeyword = `${filterKey}.keyword`;\n return { bool: { should: [{ match: { [filterKeyword]: filterValue } }] } };\n};\n\nconst buildFilters = filters => {\n if (!filters || !filters.length) return null;\n const filterQueryProps = filters.map(buildFilterQueryString);\n return { bool: { should: filterQueryProps } };\n};\n\nconst buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {\n const { displayItems = [], filterBy } = shape;\n const { latProp, lonProp, entity } = entityGroup;\n const { actions, relations } = entityData;\n const action = actions ? actions.getAllPublished || actions.getAll : '';\n\n const dataSummaryProps = dataSummaries\n .reduce((acc, { propsToDisplay }) => {\n const propsToDisplayValues = flatten(\n propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay)\n );\n const propsToDisplayString = getPropValues(propsToDisplayValues);\n\n return `${acc} ${propsToDisplayString}`;\n }, '')\n .trim();\n const ids = [];\n displayItems.length ? ids.push(displayItems[0]) : ids.push(parentId);\n\n const filtersObject = buildFilters(filterBy);\n let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';\n propsQuery = getUpdatedPropsQuery(propsQuery, entityData);\n if (latProp && lonProp) {\n propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(\n lonProp,\n relations\n )}`;\n }\n if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;\n\n return {\n shapeKey,\n entity,\n propsQuery,\n ids,\n action,\n filtersObject\n };\n};\n\nconst formatProp = (prop, relations = []) => {\n if (!prop.includes('.')) return prop;\n\n const [mainProp, nestedProp] = prop.split('.');\n const idProp = relations.find(({ localField }) => localField === mainProp) ? 'id ' : '';\n return `${mainProp}{${idProp}${nestedProp}}`;\n};\n\nconst buildShapesConfig = (schemas, entityGroups, parent) => {\n if (!schemas || !entityGroups) return [];\n const { itemId, itemEntity } = parent;\n const shapeGroups = [];\n entityGroups.forEach((entityGroup, i) => {\n const { entity, shapes, dataSummaries = [] } = entityGroup;\n const parentId = entity === itemEntity && itemId;\n if (!entity) return null;\n const entityData = schemas[entity] || {};\n\n shapes.filter(Boolean).forEach((shape, shapeIndex) => {\n const shapeKey = `shape${i}${shapeIndex}`;\n const shapeValues = buiildShapeProps(\n shape,\n shapeKey,\n dataSummaries,\n parentId,\n entityData,\n entityGroup\n );\n shapeGroups.push({ ...shapeValues, shapeOptions: shape, entityOptions: entityGroup });\n });\n });\n\n return shapeGroups;\n};\n\nexport default buildShapesConfig;\n"],"mappings":";;;;;;AAAA,OAAOA,OAAP,MAAoB,gBAApB;AACA,SAASC,QAAT,EAAmBC,GAAnB,EAAwBC,EAAxB,QAAkC,iBAAlC;;AAEA,MAAMC,aAAa,GAAGC,UAAU,IAC9BA,UAAU,CACPC,MADH,CACU,CAACC,GAAD,EAAMC,QAAN,KAAmB;EACzB,IAAIA,QAAQ,CAACC,QAAT,CAAkB,GAAlB,CAAJ,EAA4B;IAC1B,MAAM,CAACC,YAAD,EAAeC,YAAf,IAA+BH,QAAQ,CAACI,KAAT,CAAe,GAAf,CAArC;IACA,OAAQ,GAAEL,GAAI,IAAGG,YAAa,MAAKC,YAAa,IAAhD;EACD;;EACD,OAAQ,GAAEJ,GAAI,IAAGC,QAAS,EAA1B;AACD,CAPH,EAOK,EAPL,EAQGK,IARH,EADF;;AAWA,MAAMC,oBAAoB,GAAG,CAACC,UAAD,EAAaC,UAAb,KAA4B;EACvD,MAAM;IAAEX,UAAU,GAAG,EAAf;IAAmBY,iBAAiB,GAAG;EAAvC,IAA8CD,UAApD;EAEA,MAAM,CAACE,GAAD,IAAQC,MAAM,CAACC,IAAP,CAAYH,iBAAZ,EAA+BI,MAA/B,CAAsCC,IAAI,IAAIA,IAAI,KAAKpB,GAAvD,CAAd;EACA,MAAMqB,QAAQ,GAAG,CAAC,CAACJ,MAAM,CAACC,IAAP,CAAYf,UAAZ,EAAwBgB,MAAxB,CAA+BC,IAAI,IAAIA,IAAI,KAAKrB,QAAhD,EAA0DuB,MAA7E;EAEA,IAAIC,iBAAiB,GAA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Z,iCAAsBoB,WAAtB;QAAmCC,YAAY,EAAE1C,KAAjD;QAAwD2C,aAAa,EAAEvC;MAAvE;IACD,CAXD;EAYD,CAlBD;EAoBA,OAAO+B,WAAP;AACD,CAzBD;;AA2BA,eAAeN,iBAAf"}
1
+ {"version":3,"file":"build-shapes-configs.js","names":["flatten","IMAGE_ID","URL","ID","getPropValues","properties","reduce","acc","property","includes","relationName","relationProp","split","trim","getUpdatedPropsQuery","propsQuery","entityData","dynamicProperties","url","Object","keys","filter","prop","hasImage","length","updatedPropsQuery","buildFilterQueryString","filterKey","filterValue","filterKeyword","bool","should","match","buildFilters","filters","filterQueryProps","map","buiildShapeProps","shape","shapeKey","dataSummaries","parentId","entityGroup","displayItems","filterBy","latProp","lonProp","entity","actions","relations","action","getAllPublished","getAll","dataSummaryProps","propsToDisplay","propsToDisplayValues","propertiesToDisplay","propsToDisplayString","ids","push","filtersObject","formatProp","mainProp","nestedProp","idProp","find","localField","buildShapesConfig","schemas","entityGroups","parent","itemId","itemEntity","shapeGroups","forEach","i","shapes","Boolean","shapeIndex","shapeValues","shapeOptions","entityOptions"],"sources":["../../../src/GoogleMaps/helpers/build-shapes-configs.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { IMAGE_ID, URL, ID } from '../../constants';\n\nconst getPropValues = properties =>\n properties\n .reduce((acc, property) => {\n if (property.includes('.')) {\n const [relationName, relationProp] = property.split('.');\n return `${acc} ${relationName} { ${relationProp} }`;\n }\n return `${acc} ${property}`;\n }, '')\n .trim();\n\nconst getUpdatedPropsQuery = (propsQuery, entityData) => {\n const { properties = {}, dynamicProperties = {} } = entityData;\n\n const [url] = Object.keys(dynamicProperties).filter(prop => prop === URL);\n const hasImage = !!Object.keys(properties).filter(prop => prop === IMAGE_ID).length;\n\n let updatedPropsQuery = hasImage ? `${propsQuery} ${IMAGE_ID}` : propsQuery;\n updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;\n\n return updatedPropsQuery;\n};\n\nconst buildFilterQueryString = filter => {\n const [filterKey, filterValue] = filter.split('/');\n const filterKeyword = `${filterKey}.keyword`;\n return { bool: { should: [{ match: { [filterKeyword]: filterValue } }] } };\n};\n\nconst buildFilters = filters => {\n if (!filters || !filters.length) return null;\n const filterQueryProps = filters.map(buildFilterQueryString);\n return { bool: { should: filterQueryProps } };\n};\n\nconst buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {\n const { displayItems = [], filterBy } = shape;\n const { latProp, lonProp, entity } = entityGroup;\n const { actions, relations } = entityData;\n const action = actions ? actions.getAllPublished || actions.getAll : '';\n\n const dataSummaryProps = dataSummaries\n .reduce((acc, { propsToDisplay }) => {\n const propsToDisplayValues = flatten(\n propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay)\n );\n const propsToDisplayString = getPropValues(propsToDisplayValues);\n\n return `${acc} ${propsToDisplayString}`;\n }, '')\n .trim();\n const ids = [];\n displayItems.length ? ids.push(displayItems[0]) : ids.push(parentId);\n\n const filtersObject = buildFilters(filterBy);\n let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';\n propsQuery = getUpdatedPropsQuery(propsQuery, entityData);\n if (latProp && lonProp) {\n propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(\n lonProp,\n relations\n )}`;\n }\n if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;\n\n return {\n shapeKey,\n entity,\n propsQuery,\n ids,\n action,\n filtersObject\n };\n};\n\nconst formatProp = (prop, relations = []) => {\n if (!prop.includes('.')) return prop;\n\n const [mainProp, nestedProp] = prop.split('.');\n const idProp = relations.find(({ localField }) => localField === mainProp) ? 'id ' : '';\n return `${mainProp}{${idProp}${nestedProp}}`;\n};\n\nconst buildShapesConfig = (schemas, entityGroups, parent) => {\n if (!schemas || !entityGroups) return [];\n const { itemId, itemEntity } = parent;\n const shapeGroups = [];\n entityGroups.forEach((entityGroup, i) => {\n const { entity, shapes, dataSummaries = [] } = entityGroup;\n const parentId = entity === itemEntity && itemId;\n if (!entity) return null;\n const entityData = schemas[entity] || {};\n\n shapes.filter(Boolean).forEach((shape, shapeIndex) => {\n const shapeKey = `shape${i}${shapeIndex}`;\n const shapeValues = buiildShapeProps(\n shape,\n shapeKey,\n dataSummaries,\n parentId,\n entityData,\n entityGroup\n );\n shapeGroups.push({ ...shapeValues, shapeOptions: shape, entityOptions: entityGroup });\n });\n });\n\n return shapeGroups;\n};\n\nexport default buildShapesConfig;\n"],"mappings":";;;AAAA,OAAOA,OAAO,MAAM,gBAAgB;AACpC,SAASC,QAAQ,EAAEC,GAAG,EAAEC,EAAE,QAAQ,iBAAiB;AAEnD,MAAMC,aAAa,GAAGC,UAAU,IAC9BA,UAAU,CACPC,MAAM,CAAC,CAACC,GAAG,EAAEC,QAAQ,KAAK;EACzB,IAAIA,QAAQ,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;IAC1B,MAAM,CAACC,YAAY,EAAEC,YAAY,CAAC,GAAGH,QAAQ,CAACI,KAAK,CAAC,GAAG,CAAC;IACxD,OAAQ,GAAEL,GAAI,IAAGG,YAAa,MAAKC,YAAa,IAAG;EACrD;EACA,OAAQ,GAAEJ,GAAI,IAAGC,QAAS,EAAC;AAC7B,CAAC,EAAE,EAAE,CAAC,CACLK,IAAI,EAAE;AAEX,MAAMC,oBAAoB,GAAG,CAACC,UAAU,EAAEC,UAAU,KAAK;EACvD,MAAM;IAAEX,UAAU,GAAG,CAAC,CAAC;IAAEY,iBAAiB,GAAG,CAAC;EAAE,CAAC,GAAGD,UAAU;EAE9D,MAAM,CAACE,GAAG,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACH,iBAAiB,CAAC,CAACI,MAAM,CAACC,IAAI,IAAIA,IAAI,KAAKpB,GAAG,CAAC;EACzE,MAAMqB,QAAQ,GAAG,CAAC,CAACJ,MAAM,CAACC,IAAI,CAACf,UAAU,CAAC,CAACgB,MAAM,CAACC,IAAI,IAAIA,IAAI,KAA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ACZ;MACD+B,WAAW,CAACd,IAAI,iCAAMoB,WAAW;QAAEC,YAAY,EAAE1C,KAAK;QAAE2C,aAAa,EAAEvC;MAAW,GAAG;IACvF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO+B,WAAW;AACpB,CAAC;AAED,eAAeN,iBAAiB"}
@@ -1,5 +1,4 @@
1
1
  import isNumber from 'lodash.isnumber';
2
-
3
2
  const getCenterCoordinates = (mapShapes, otherProps) => {
4
3
  const centerCoordinates = [];
5
4
  const {
@@ -26,6 +25,5 @@ const getCenterCoordinates = (mapShapes, otherProps) => {
26
25
  });
27
26
  return centerCoordinates;
28
27
  };
29
-
30
28
  export default getCenterCoordinates;
31
29
  //# sourceMappingURL=get-center-coordinates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-center-coordinates.js","names":["isNumber","getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","latitude","longitude","useAsCenterShapes","filter","useAsCenter","shapesForCenter","length","forEach","push"],"sources":["../../../src/GoogleMaps/helpers/get-center-coordinates.js"],"sourcesContent":["import isNumber from 'lodash.isnumber';\n\nconst getCenterCoordinates = (mapShapes, otherProps) => {\n const centerCoordinates = [];\n\n const { centerLatitude, centerLongitude } = otherProps;\n const useDefaultCenter =\n centerLatitude !== 0 &&\n centerLongitude !== 0 &&\n isNumber(centerLatitude) &&\n isNumber(centerLongitude);\n\n if (useDefaultCenter) return [{ latitude: centerLatitude, longitude: centerLongitude }];\n\n const useAsCenterShapes = mapShapes.filter(({ useAsCenter }) => useAsCenter);\n const shapesForCenter = useAsCenterShapes.length ? useAsCenterShapes : mapShapes;\n shapesForCenter.forEach(({ latitude, longitude }) => {\n if (isNumber(latitude) && isNumber(longitude)) centerCoordinates.push({ latitude, longitude });\n });\n\n return centerCoordinates;\n};\n\nexport default getCenterCoordinates;\n"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,iBAArB;;AAEA,MAAMC,oBAAoB,GAAG,CAACC,SAAD,EAAYC,UAAZ,KAA2B;EACtD,MAAMC,iBAAiB,GAAG,EAA1B;EAEA,MAAM;IAAEC,cAAF;IAAkBC;EAAlB,IAAsCH,UAA5C;EACA,MAAMI,gBAAgB,GACpBF,cAAc,KAAK,CAAnB,IACAC,eAAe,KAAK,CADpB,IAEAN,QAAQ,CAACK,cAAD,CAFR,IAGAL,QAAQ,CAACM,eAAD,CAJV;EAMA,IAAIC,gBAAJ,EAAsB,OAAO,CAAC;IAAEC,QAAQ,EAAEH,cAAZ;IAA4BI,SAAS,EAAEH;EAAvC,CAAD,CAAP;EAEtB,MAAMI,iBAAiB,GAAGR,SAAS,CAACS,MAAV,CAAiB,CAAC;IAAEC;EAAF,CAAD,KAAqBA,WAAtC,CAA1B;EACA,MAAMC,eAAe,GAAGH,iBAAiB,CAACI,MAAlB,GAA2BJ,iBAA3B,GAA+CR,SAAvE;EACAW,eAAe,CAACE,OAAhB,CAAwB,CAAC;IAAEP,QAAF;IAAYC;EAAZ,CAAD,KAA6B;IACnD,IAAIT,QAAQ,CAACQ,QAAD,CAAR,IAAsBR,QAAQ,CAACS,SAAD,CAAlC,EAA+CL,iBAAiB,CAACY,IAAlB,CAAuB;MAAER,QAAF;MAAYC;IAAZ,CAAvB;EAChD,CAFD;EAIA,OAAOL,iBAAP;AACD,CAnBD;;AAqBA,eAAeH,oBAAf"}
1
+ {"version":3,"file":"get-center-coordinates.js","names":["isNumber","getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","latitude","longitude","useAsCenterShapes","filter","useAsCenter","shapesForCenter","length","forEach","push"],"sources":["../../../src/GoogleMaps/helpers/get-center-coordinates.js"],"sourcesContent":["import isNumber from 'lodash.isnumber';\n\nconst getCenterCoordinates = (mapShapes, otherProps) => {\n const centerCoordinates = [];\n\n const { centerLatitude, centerLongitude } = otherProps;\n const useDefaultCenter =\n centerLatitude !== 0 &&\n centerLongitude !== 0 &&\n isNumber(centerLatitude) &&\n isNumber(centerLongitude);\n\n if (useDefaultCenter) return [{ latitude: centerLatitude, longitude: centerLongitude }];\n\n const useAsCenterShapes = mapShapes.filter(({ useAsCenter }) => useAsCenter);\n const shapesForCenter = useAsCenterShapes.length ? useAsCenterShapes : mapShapes;\n shapesForCenter.forEach(({ latitude, longitude }) => {\n if (isNumber(latitude) && isNumber(longitude)) centerCoordinates.push({ latitude, longitude });\n });\n\n return centerCoordinates;\n};\n\nexport default getCenterCoordinates;\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,iBAAiB;AAEtC,MAAMC,oBAAoB,GAAG,CAACC,SAAS,EAAEC,UAAU,KAAK;EACtD,MAAMC,iBAAiB,GAAG,EAAE;EAE5B,MAAM;IAAEC,cAAc;IAAEC;EAAgB,CAAC,GAAGH,UAAU;EACtD,MAAMI,gBAAgB,GACpBF,cAAc,KAAK,CAAC,IACpBC,eAAe,KAAK,CAAC,IACrBN,QAAQ,CAACK,cAAc,CAAC,IACxBL,QAAQ,CAACM,eAAe,CAAC;EAE3B,IAAIC,gBAAgB,EAAE,OAAO,CAAC;IAAEC,QAAQ,EAAEH,cAAc;IAAEI,SAAS,EAAEH;EAAgB,CAAC,CAAC;EAEvF,MAAMI,iBAAiB,GAAGR,SAAS,CAACS,MAAM,CAAC,CAAC;IAAEC;EAAY,CAAC,KAAKA,WAAW,CAAC;EAC5E,MAAMC,eAAe,GAAGH,iBAAiB,CAACI,MAAM,GAAGJ,iBAAiB,GAAGR,SAAS;EAChFW,eAAe,CAACE,OAAO,CAAC,CAAC;IAAEP,QAAQ;IAAEC;EAAU,CAAC,KAAK;IACnD,IAAIT,QAAQ,CAACQ,QAAQ,CAAC,IAAIR,QAAQ,CAACS,SAAS,CAAC,EAAEL,iBAAiB,CAACY,IAAI,CAAC;MAAER,QAAQ;MAAEC;IAAU,CAAC,CAAC;EAChG,CAAC,CAAC;EAEF,OAAOL,iBAAiB;AAC1B,CAAC;AAED,eAAeH,oBAAoB"}
@@ -9,6 +9,5 @@ const getImageIds = mapShapes => {
9
9
  });
10
10
  return [...new Set(ids)];
11
11
  };
12
-
13
12
  export default getImageIds;
14
13
  //# sourceMappingURL=get-image-ids.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","shapeData","imageId","push","Set"],"sources":["../../../src/GoogleMaps/helpers/get-image-ids.js"],"sourcesContent":["const getImageIds = mapShapes => {\n const ids = [];\n mapShapes.forEach(({ shapeData, imageId }) => {\n if (imageId) ids.push(imageId);\n if (shapeData.imageId) ids.push(shapeData.imageId);\n });\n return [...new Set(ids)];\n};\n\nexport default getImageIds;\n"],"mappings":"AAAA,MAAMA,WAAW,GAAGC,SAAS,IAAI;EAC/B,MAAMC,GAAG,GAAG,EAAZ;EACAD,SAAS,CAACE,OAAV,CAAkB,CAAC;IAAEC,SAAF;IAAaC;EAAb,CAAD,KAA4B;IAC5C,IAAIA,OAAJ,EAAaH,GAAG,CAACI,IAAJ,CAASD,OAAT;IACb,IAAID,SAAS,CAACC,OAAd,EAAuBH,GAAG,CAACI,IAAJ,CAASF,SAAS,CAACC,OAAnB;EACxB,CAHD;EAIA,OAAO,CAAC,GAAG,IAAIE,GAAJ,CAAQL,GAAR,CAAJ,CAAP;AACD,CAPD;;AASA,eAAeF,WAAf"}
1
+ {"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","shapeData","imageId","push","Set"],"sources":["../../../src/GoogleMaps/helpers/get-image-ids.js"],"sourcesContent":["const getImageIds = mapShapes => {\n const ids = [];\n mapShapes.forEach(({ shapeData, imageId }) => {\n if (imageId) ids.push(imageId);\n if (shapeData.imageId) ids.push(shapeData.imageId);\n });\n return [...new Set(ids)];\n};\n\nexport default getImageIds;\n"],"mappings":"AAAA,MAAMA,WAAW,GAAGC,SAAS,IAAI;EAC/B,MAAMC,GAAG,GAAG,EAAE;EACdD,SAAS,CAACE,OAAO,CAAC,CAAC;IAAEC,SAAS;IAAEC;EAAQ,CAAC,KAAK;IAC5C,IAAIA,OAAO,EAAEH,GAAG,CAACI,IAAI,CAACD,OAAO,CAAC;IAC9B,IAAID,SAAS,CAACC,OAAO,EAAEH,GAAG,CAACI,IAAI,CAACF,SAAS,CAACC,OAAO,CAAC;EACpD,CAAC,CAAC;EACF,OAAO,CAAC,GAAG,IAAIE,GAAG,CAACL,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,eAAeF,WAAW"}
@@ -9,6 +9,5 @@ const getPath = paths => paths.reduce((acc, path) => {
9
9
  });
10
10
  return acc;
11
11
  }, []);
12
-
13
12
  export default getPath;
14
13
  //# sourceMappingURL=get-path.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","latitude","lat","longitude","lng","push"],"sources":["../../../src/GoogleMaps/helpers/get-path.js"],"sourcesContent":["const getPath = paths =>\n paths.reduce((acc, path) => {\n const { latitude: lat, longitude: lng } = path;\n acc.push({ lat, lng });\n return acc;\n }, []);\n\nexport default getPath;\n"],"mappings":"AAAA,MAAMA,OAAO,GAAGC,KAAK,IACnBA,KAAK,CAACC,MAAN,CAAa,CAACC,GAAD,EAAMC,IAAN,KAAe;EAC1B,MAAM;IAAEC,QAAQ,EAAEC,GAAZ;IAAiBC,SAAS,EAAEC;EAA5B,IAAoCJ,IAA1C;EACAD,GAAG,CAACM,IAAJ,CAAS;IAAEH,GAAF;IAAOE;EAAP,CAAT;EACA,OAAOL,GAAP;AACD,CAJD,EAIG,EAJH,CADF;;AAOA,eAAeH,OAAf"}
1
+ {"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","latitude","lat","longitude","lng","push"],"sources":["../../../src/GoogleMaps/helpers/get-path.js"],"sourcesContent":["const getPath = paths =>\n paths.reduce((acc, path) => {\n const { latitude: lat, longitude: lng } = path;\n acc.push({ lat, lng });\n return acc;\n }, []);\n\nexport default getPath;\n"],"mappings":"AAAA,MAAMA,OAAO,GAAGC,KAAK,IACnBA,KAAK,CAACC,MAAM,CAAC,CAACC,GAAG,EAAEC,IAAI,KAAK;EAC1B,MAAM;IAAEC,QAAQ,EAAEC,GAAG;IAAEC,SAAS,EAAEC;EAAI,CAAC,GAAGJ,IAAI;EAC9CD,GAAG,CAACM,IAAI,CAAC;IAAEH,GAAG;IAAEE;EAAI,CAAC,CAAC;EACtB,OAAOL,GAAG;AACZ,CAAC,EAAE,EAAE,CAAC;AAER,eAAeH,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["addZoomListener","buildQuery","getImageIds","buildShapesConfig","setMapOptions","getCenterCoordinates","buildMapShapes"],"sources":["../../../src/GoogleMaps/helpers/index.js"],"sourcesContent":["import addZoomListener from './add-zoom-listener';\nimport buildQuery from './build-query';\nimport getImageIds from './get-image-ids';\nimport buildShapesConfig from './build-shapes-configs';\nimport setMapOptions from './set-map-options';\nimport getCenterCoordinates from './get-center-coordinates';\nimport buildMapShapes from './build-map-shapes';\n\nexport {\n addZoomListener,\n buildQuery,\n getImageIds,\n buildShapesConfig,\n setMapOptions,\n getCenterCoordinates,\n buildMapShapes\n};\n"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,qBAA5B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEA,SACEN,eADF,EAEEC,UAFF,EAGEC,WAHF,EAIEC,iBAJF,EAKEC,aALF,EAMEC,oBANF,EAOEC,cAPF"}
1
+ {"version":3,"file":"index.js","names":["addZoomListener","buildQuery","getImageIds","buildShapesConfig","setMapOptions","getCenterCoordinates","buildMapShapes"],"sources":["../../../src/GoogleMaps/helpers/index.js"],"sourcesContent":["import addZoomListener from './add-zoom-listener';\nimport buildQuery from './build-query';\nimport getImageIds from './get-image-ids';\nimport buildShapesConfig from './build-shapes-configs';\nimport setMapOptions from './set-map-options';\nimport getCenterCoordinates from './get-center-coordinates';\nimport buildMapShapes from './build-map-shapes';\n\nexport {\n addZoomListener,\n buildQuery,\n getImageIds,\n buildShapesConfig,\n setMapOptions,\n getCenterCoordinates,\n buildMapShapes\n};\n"],"mappings":"AAAA,OAAOA,eAAe,MAAM,qBAAqB;AACjD,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,cAAc,MAAM,oBAAoB;AAE/C,SACEN,eAAe,EACfC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,oBAAoB,EACpBC,cAAc"}