├── .gitignore ├── LICENSE.md ├── README.md ├── admin └── src │ ├── components │ ├── Initializer │ │ └── index.js │ ├── LocationInput.js │ └── PluginIcon │ │ └── index.js │ ├── index.js │ ├── pages │ ├── App │ │ └── index.js │ └── HomePage │ │ └── index.js │ ├── pluginId.js │ ├── translations │ ├── en.json │ └── fr.json │ └── utils │ ├── axiosInstance.js │ └── getTrad.js ├── node_modules ├── .package-lock.json ├── @googlemaps │ └── js-api-loader │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dist │ │ ├── index.d.ts │ │ ├── index.dev.js │ │ ├── index.esm.js │ │ ├── index.esm.js.map │ │ ├── index.min.js │ │ ├── index.test.d.ts │ │ ├── index.umd.js │ │ └── index.umd.js.map │ │ ├── package.json │ │ └── src │ │ ├── index.test.ts │ │ └── index.ts └── fast-deep-equal │ ├── LICENSE │ ├── README.md │ ├── es6 │ ├── index.d.ts │ ├── index.js │ ├── react.d.ts │ └── react.js │ ├── index.d.ts │ ├── index.js │ ├── package.json │ ├── react.d.ts │ └── react.js ├── package-lock.json ├── package.json ├── server ├── bootstrap.js ├── config │ └── index.js ├── content-types │ └── index.js ├── controllers │ ├── getConfig.js │ └── index.js ├── destroy.js ├── index.js ├── middlewares │ └── index.js ├── policies │ └── index.js ├── register.js ├── routes │ └── index.js └── services │ └── index.js ├── strapi-admin.js └── strapi-server.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Ray Keating 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Strapi Location Field Plugin 2 | 3 | This is a plugin for [Strapi](https://strapi.io/) that adds a custom location field. Simply type in a location and select it from an autocomplete dropdown list. The autocomplete functionality is powered by the Google Places API, which requires an API key. 4 | 5 | Strapi Interface 6 | 7 | ![image](https://user-images.githubusercontent.com/29098307/228688554-9b1f3f01-cad6-4770-9f55-8879322be90c.png) 8 | 9 | API Response 10 | 11 | ![image](https://user-images.githubusercontent.com/29098307/228693688-919181b2-83f6-47c1-9a80-77910bec4969.png) 12 | 13 | ## Installation 14 | 15 | To install this package, run the following command in an existing strapi project: 16 | 17 | ```sh 18 | npm install strapi-location-field-plugin 19 | ``` 20 | 21 | ## Usage 22 | 23 | To enable the plugin, you'll need to include the following code in your Strapi project, in the `/config/plugins.js` file: 24 | 25 | ```javascript 26 | module.exports = ({ env }) => ({ 27 | "location-field": { 28 | enabled: true, 29 | config: { 30 | fields: ["photo", "rating"], // optional 31 | // You need to enable "Autocomplete API" and "Places API" in your Google Cloud Console 32 | googleMapsApiKey: env("GOOGLE_MAPS_API_KEY"), 33 | // See https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest 34 | autocompletionRequestOptions: {}, 35 | }, 36 | }, 37 | // .. your other plugin configurations 38 | }); 39 | ``` 40 | 41 | Make sure to add a line to your .env with your Google Maps API Key. You must have the Places API enabled. 42 | ```env 43 | GOOGLE_MAPS_API_KEY=your-api-key 44 | ``` 45 | 46 | Note: the `config.fields` value can be set to an array of options (strings) containing any fields you'd like to be returned. The options that Google allows can be found [here](https://developers.google.com/maps/documentation/places/web-service/details) or in the screenshot below. When set, the information relevant to those specific fields will be accessible in the API response under the "details" key. The `geometry` field is always enabled. 47 | 48 | ![image](https://user-images.githubusercontent.com/29098307/228680235-992c95c5-5b22-4ce1-9128-188825831e51.png) 49 | 50 | > ℹ️ Please note: some fields may not return the expected response. Currently only the `photo`, `rating`, and `geometry` fields have been tested. 51 | 52 | `autocompletionRequestOptions` allows you to customize the search behavior by overriding the options used when autocompletion requests are made. The [Autocomplete API documentation](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest) lists all the available options. For example, this configuration returns autocomplete results in Spanish and biases the search closer to the caller's IP address: 53 | 54 | ```javascript 55 | { 56 | config: { 57 | googleMapsApiKey: env("GOOGLE_MAPS_API_KEY"), 58 | autocompletionRequestOptions: { 59 | language: 'es', 60 | locationBias: 'IP_BIAS', 61 | }, 62 | }, 63 | } 64 | ``` 65 | 66 | 67 | You'll also need to modify the `/config/middlewares.js` file 68 | 69 | ```javascript 70 | module.exports = [ 71 | "strapi::errors", 72 | { 73 | name: "strapi::security", 74 | config: { 75 | contentSecurityPolicy: { 76 | directives: { "script-src": ["'self'", "'unsafe-inline'", "maps.googleapis.com"] }, 77 | }, 78 | }, 79 | }, 80 | "strapi::cors", 81 | "strapi::poweredBy", 82 | "strapi::logger", 83 | "strapi::query", 84 | "strapi::body", 85 | "strapi::session", 86 | "strapi::favicon", 87 | "strapi::public", 88 | ]; 89 | ``` 90 | After installation and configuration, build the project with `npm run build` or `yarn build` 91 | 92 | 93 | ### Additional Information 94 | - This plugin is not affiliated with Google in any way. 95 | 96 | To support, go to [https://www.buymeacoffee.com/raykeating](https://www.buymeacoffee.com/raykeating) 💜 97 | -------------------------------------------------------------------------------- /admin/src/components/Initializer/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Initializer 4 | * 5 | */ 6 | 7 | import { useEffect, useRef } from 'react'; 8 | import PropTypes from 'prop-types'; 9 | import pluginId from '../../pluginId'; 10 | 11 | const Initializer = ({ setPlugin }) => { 12 | const ref = useRef(); 13 | ref.current = setPlugin; 14 | 15 | useEffect(() => { 16 | ref.current(pluginId); 17 | }, []); 18 | 19 | return null; 20 | }; 21 | 22 | Initializer.propTypes = { 23 | setPlugin: PropTypes.func.isRequired, 24 | }; 25 | 26 | export default Initializer; 27 | -------------------------------------------------------------------------------- /admin/src/components/LocationInput.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Loader } from "@googlemaps/js-api-loader"; 3 | 4 | import { NumberInput, Flex, Box } from "@strapi/design-system"; 5 | 6 | import { Combobox } from "@strapi/design-system"; 7 | import { ComboboxOption } from "@strapi/design-system"; 8 | 9 | import { request } from "@strapi/helper-plugin"; 10 | 11 | // https://www.google.com/maps/search/?api=1&query=Google&query_place_id= 12 | 13 | export default function Input({ 14 | onChange, 15 | value, 16 | disabled, 17 | name, 18 | attribute, 19 | error, 20 | required, 21 | }) { 22 | const [apiKey, setApiKey] = useState(null); 23 | const [fields, setFields] = useState(null); 24 | const [loader, setLoader] = useState(null); 25 | const [autocompletionRequestOptions, setAutocompletionRequestOptions] = 26 | useState(null); 27 | const [textValue, setTextValue] = useState( 28 | "" || (value !== "null" ? JSON.parse(value).description : "") 29 | ); 30 | 31 | const getConfigDetails = async () => { 32 | const { signal } = new AbortController(); 33 | const { fields, autocompletionRequestOptions, googleMapsApiKey } = 34 | await request("/location-field/config", { 35 | method: "GET", 36 | signal, 37 | }); 38 | return { fields, autocompletionRequestOptions, googleMapsApiKey }; 39 | }; 40 | 41 | React.useEffect(() => { 42 | getConfigDetails().then((config) => { 43 | setApiKey(config.googleMapsApiKey); 44 | config.fields = config.fields || []; 45 | if (!config.fields.includes("geometry")) { 46 | config.fields.push("geometry"); 47 | } 48 | setFields(config.fields); 49 | setAutocompletionRequestOptions(config.autocompletionRequestOptions); 50 | }); 51 | }, []); 52 | 53 | React.useEffect(() => { 54 | if (apiKey) { 55 | const loader = new Loader({ 56 | apiKey, 57 | version: "weekly", 58 | libraries: ["places"], 59 | }); 60 | setLoader(loader); 61 | } 62 | }, [apiKey]); 63 | 64 | // if "geometry" is not in the fields array, add it 65 | React.useEffect(() => { 66 | if (fields && !fields.includes("geometry")) { 67 | fields.push("geometry"); 68 | } 69 | }, [fields]); 70 | 71 | const [predictions, setPredictions] = useState([]); 72 | 73 | const handleInputChange = (e) => { 74 | setTextValue(e.target.value); 75 | if (!e.target.value) { 76 | setLocationValue( 77 | "" 78 | ); 79 | setPredictions([]); 80 | return; 81 | } 82 | const getSuggestions = async () => { 83 | loader.load().then((google) => { 84 | let sessionToken = new google.maps.places.AutocompleteSessionToken(); 85 | let service = new google.maps.places.AutocompleteService(); 86 | service.getPlacePredictions( 87 | { 88 | ...autocompletionRequestOptions, 89 | input: e.target.value, 90 | sessionToken: sessionToken, 91 | }, 92 | (predictions, status) => { 93 | if (status !== google.maps.places.PlacesServiceStatus.OK) { 94 | console.error(status); 95 | return; 96 | } 97 | if (predictions.length > 0) { 98 | setPredictions(predictions); 99 | } 100 | } 101 | ); 102 | }); 103 | }; 104 | getSuggestions(); 105 | }; 106 | 107 | const setLocationValue = (val) => { 108 | if (!val) { 109 | setTextValue(""); 110 | onChange({ 111 | target: { 112 | name, 113 | value: null, 114 | type: attribute.type, 115 | }, 116 | }); 117 | return; 118 | } 119 | 120 | let targetValue = null; // the value that will be sent to the server and saved in the database 121 | 122 | let selectedPrediction = predictions.find( 123 | (prediction) => prediction.place_id === val 124 | ); 125 | 126 | if (selectedPrediction && selectedPrediction.place_id) { 127 | setTextValue(selectedPrediction.description); 128 | loader.load().then((google) => { 129 | let service = new google.maps.places.PlacesService( 130 | document.createElement("div") 131 | ); 132 | service.getDetails( 133 | { placeId: selectedPrediction.place_id, fields }, 134 | (place, status) => { 135 | if (status !== google.maps.places.PlacesServiceStatus.OK) { 136 | console.error(status); 137 | return; 138 | } 139 | // if "photo" is in the fields array, call "getUrl()" for each photo in the response 140 | if (fields.includes("photo") && place?.photos) { 141 | place.photos.forEach((photo) => { 142 | photo.url = photo.getUrl(); 143 | }); 144 | } 145 | 146 | selectedPrediction.details = place; 147 | 148 | targetValue = JSON.stringify({ 149 | description: selectedPrediction.description, 150 | place_id: selectedPrediction.place_id, 151 | lat: selectedPrediction.details.geometry.location.lat(), 152 | lng: selectedPrediction.details.geometry.location.lng(), 153 | details: selectedPrediction.details, 154 | }); 155 | onChange({ 156 | target: { 157 | name, 158 | value: targetValue, 159 | type: attribute.type, 160 | }, 161 | }); 162 | } 163 | ); 164 | }); 165 | } else { 166 | // if the user is creating a new location, we don't need to call the Google Maps API 167 | targetValue = JSON.stringify({ 168 | description: val, 169 | place_id: "custom_location", 170 | lat: null, 171 | lng: null, 172 | }); 173 | 174 | onChange({ 175 | target: { 176 | name, 177 | value: targetValue, 178 | type: attribute.type, 179 | }, 180 | }); 181 | } 182 | }; 183 | 184 | const setCoordinates = (val, type) => { 185 | let targetValue = null; 186 | if (value !== "null") { 187 | targetValue = JSON.parse(value); 188 | } 189 | 190 | if (type === "lat") { 191 | targetValue.lat = val || null; 192 | } else { 193 | targetValue.lng = val || null; 194 | } 195 | 196 | onChange({ 197 | target: { 198 | name, 199 | value: JSON.stringify(targetValue), 200 | type: attribute.type, 201 | }, 202 | }); 203 | }; 204 | 205 | return ( 206 | 207 | 208 | {loader && apiKey && fields && ( 209 | { 217 | setLocationValue(selection); 218 | }} 219 | onInputChange={(e) => handleInputChange(e)} 220 | value={ 221 | value !== "null" && value 222 | ? JSON.parse(value).place_id 223 | : "" 224 | } 225 | textValue={textValue} 226 | onClear={() => { 227 | setLocationValue( 228 | "" 229 | ); 230 | }} 231 | creatable 232 | createMessage={(e) => `Create Location: "${e}"`} 233 | > 234 | {predictions 235 | .map((prediction) => ( 236 | 240 | {prediction.description} 241 | 242 | )) 243 | // the following lines are required to add the "custom location" options 244 | // without it, the combobox breaks 245 | .concat([ 246 |
251 | {value !== "null" && 252 | JSON.parse(value).place_id === "custom_location" 253 | ? JSON.parse(value).description 254 | : "Custom Location"} 255 |
, 256 | ]) 257 | .concat([ 258 |
263 | {value !== "null" ? JSON.parse(value).description : ""} 264 |
, 265 | ])} 266 |
267 | )} 268 |
269 | {value !== "null" && JSON.parse(value).place_id === "custom_location" && ( 270 | 271 | setCoordinates(e, "lat")} 277 | value={value !== "null" ? JSON.parse(value).lat : null} 278 | /> 279 | 280 | setCoordinates(e, "lng")} 286 | value={value !== "null" ? JSON.parse(value).lng : null} 287 | /> 288 | 289 | )} 290 |
291 | ); 292 | } 293 | 294 | Input.defaultProps = { 295 | value: "null", 296 | }; 297 | -------------------------------------------------------------------------------- /admin/src/components/PluginIcon/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "styled-components"; 3 | import { Icon } from "@strapi/design-system/Icon"; 4 | import { Flex } from "@strapi/design-system/Flex"; 5 | import { PinMap } from "@strapi/icons"; 6 | 7 | const IconBox = styled(Flex)` 8 | background-color: #f0f0ff; 9 | border: 1px solid #d9d8ff; 10 | svg > path { 11 | fill: #4285f4; 12 | } 13 | `; 14 | 15 | const MapPickerIcon = () => { 16 | return ( 17 | 18 | 19 | 20 | ); 21 | }; 22 | 23 | export default MapPickerIcon; 24 | -------------------------------------------------------------------------------- /admin/src/index.js: -------------------------------------------------------------------------------- 1 | import { prefixPluginTranslations } from '@strapi/helper-plugin'; 2 | import pluginPkg from '../../package.json'; 3 | import pluginId from './pluginId'; 4 | import Initializer from './components/Initializer'; 5 | import PluginIcon from './components/PluginIcon'; 6 | 7 | const name = pluginPkg.strapi.name; 8 | 9 | export default { 10 | register(app) { 11 | app.registerPlugin({ 12 | id: pluginId, 13 | initializer: Initializer, 14 | isReady: false, 15 | name, 16 | }); 17 | app.customFields.register({ 18 | name: 'location', 19 | pluginId: "location-field", 20 | type: 'json', 21 | intlLabel: { 22 | id: "location-field.location.label", 23 | defaultMessage: "Location" 24 | }, 25 | intlDescription: { 26 | id: "location-field.location.description", 27 | defaultMessage: "Select a location", 28 | }, 29 | icon: PluginIcon, 30 | components: { 31 | Input: async () => import(/* webpackChunkName: "input-component" */ "./components/LocationInput"), 32 | }, 33 | }) 34 | }, 35 | 36 | bootstrap(app) {}, 37 | async registerTrads({ locales }) { 38 | const importedTrads = await Promise.all( 39 | locales.map((locale) => { 40 | return import( 41 | /* webpackChunkName: "translation-[request]" */ `./translations/${locale}.json` 42 | ) 43 | .then(({ default: data }) => { 44 | return { 45 | data: prefixPluginTranslations(data, pluginId), 46 | locale, 47 | }; 48 | }) 49 | .catch(() => { 50 | return { 51 | data: {}, 52 | locale, 53 | }; 54 | }); 55 | }) 56 | ); 57 | 58 | return Promise.resolve(importedTrads); 59 | }, 60 | }; 61 | -------------------------------------------------------------------------------- /admin/src/pages/App/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * This component is the skeleton around the actual pages, and should only 4 | * contain code that should be seen on all pages. (e.g. navigation bar) 5 | * 6 | */ 7 | 8 | import React from 'react'; 9 | import { Switch, Route } from 'react-router-dom'; 10 | import { NotFound } from '@strapi/helper-plugin'; 11 | import pluginId from '../../pluginId'; 12 | import HomePage from '../HomePage'; 13 | 14 | const App = () => { 15 | return ( 16 |
17 | 18 | 19 | 20 | 21 |
22 | ); 23 | }; 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /admin/src/pages/HomePage/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * HomePage 4 | * 5 | */ 6 | 7 | import React from 'react'; 8 | // import PropTypes from 'prop-types'; 9 | import pluginId from '../../pluginId'; 10 | 11 | const HomePage = () => { 12 | return ( 13 |
14 |

{pluginId}'s HomePage

15 |

Happy coding

16 |
17 | ); 18 | }; 19 | 20 | export default HomePage; 21 | -------------------------------------------------------------------------------- /admin/src/pluginId.js: -------------------------------------------------------------------------------- 1 | import pluginPkg from '../../package.json'; 2 | 3 | const pluginId = pluginPkg.name.replace(/^(@[^-,.][\w,-]+\/|strapi-)plugin-/i, ''); 4 | 5 | export default pluginId; 6 | -------------------------------------------------------------------------------- /admin/src/translations/en.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /admin/src/translations/fr.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /admin/src/utils/axiosInstance.js: -------------------------------------------------------------------------------- 1 | /** 2 | * axios with a custom config. 3 | */ 4 | 5 | import axios from 'axios'; 6 | import { auth, wrapAxiosInstance } from '@strapi/helper-plugin'; 7 | 8 | const instance = axios.create({ 9 | baseURL: process.env.STRAPI_ADMIN_BACKEND_URL, 10 | }); 11 | 12 | instance.interceptors.request.use( 13 | async (config) => { 14 | config.headers = { 15 | Authorization: `Bearer ${auth.getToken()}`, 16 | Accept: 'application/json', 17 | 'Content-Type': 'application/json', 18 | }; 19 | 20 | return config; 21 | }, 22 | (error) => { 23 | Promise.reject(error); 24 | } 25 | ); 26 | 27 | instance.interceptors.response.use( 28 | (response) => response, 29 | (error) => { 30 | // whatever you want to do with the error 31 | if (error.response?.status === 401) { 32 | auth.clearAppStorage(); 33 | window.location.reload(); 34 | } 35 | 36 | throw error; 37 | } 38 | ); 39 | 40 | const wrapper = wrapAxiosInstance(instance); 41 | 42 | export default wrapper; 43 | -------------------------------------------------------------------------------- /admin/src/utils/getTrad.js: -------------------------------------------------------------------------------- 1 | import pluginId from '../pluginId'; 2 | 3 | const getTrad = (id) => `${pluginId}.${id}`; 4 | 5 | export default getTrad; 6 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/README.md: -------------------------------------------------------------------------------- 1 | # Google Maps JavaScript API Loader 2 | 3 | [![npm](https://img.shields.io/npm/v/@googlemaps/js-api-loader)](https://www.npmjs.com/package/@googlemaps/js-api-loader) 4 | ![Build](https://github.com/googlemaps/js-api-loader/workflows/Test/badge.svg) 5 | ![Release](https://github.com/googlemaps/js-api-loader/workflows/Release/badge.svg) 6 | [![codecov](https://codecov.io/gh/googlemaps/js-api-loader/branch/main/graph/badge.svg)](https://codecov.io/gh/googlemaps/js-api-loader) 7 | ![GitHub contributors](https://img.shields.io/github/contributors/googlemaps/js-api-loader?color=green) 8 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) 9 | [![Discord](https://img.shields.io/discord/676948200904589322?color=6A7EC2&logo=discord&logoColor=ffffff)](https://discord.gg/jRteCzP) 10 | 11 | ## Description 12 | Load the Google Maps JavaScript API script dynamically. This takes inspiration from the [google-maps](https://www.npmjs.com/package/google-maps) npm package but updates it with ES6, Promises, and TypeScript. 13 | 14 | ## Install 15 | 16 | Available via npm as the package [@googlemaps/js-api-loader](https://www.npmjs.com/package/@googlemaps/js-api-loader). 17 | 18 | ```sh 19 | npm i @googlemaps/js-api-loader 20 | ``` 21 | 22 | Alternatively you may add the umd package directly to the html document using the unpkg link. 23 | 24 | ```html 25 | 26 | ``` 27 | 28 | When adding via unpkg, the loader can be accessed at `google.maps.plugins.loader.Loader`. 29 | 30 | ### TypeScript 31 | 32 | TypeScript users need to install the following types package. 33 | 34 | ```sh 35 | npm i -D @types/google.maps 36 | ``` 37 | 38 | ## Documentation 39 | 40 | The reference documentation can be found at this [link](https://googlemaps.github.io/js-api-loader/index.html). The Google Maps JavaScript API [documentation](https://developers.google.com/maps/documentation/javascript/tutorial) is the authoritative source for the loader options. 41 | 42 | 43 | ## Example 44 | 45 | ```javascript 46 | import { Loader } from '@googlemaps/js-api-loader'; 47 | 48 | const loader = new Loader({ 49 | apiKey: "", 50 | version: "weekly", 51 | libraries: ["places"] 52 | }); 53 | 54 | const mapOptions = { 55 | center: { 56 | lat: 0, 57 | lng: 0 58 | }, 59 | zoom: 4 60 | }; 61 | 62 | ``` 63 | 64 | Using a promise for when the script has loaded. 65 | 66 | ```javascript 67 | // Promise 68 | loader 69 | .load() 70 | .then((google) => { 71 | new google.maps.Map(document.getElementById("map"), mapOptions); 72 | }) 73 | .catch(e => { 74 | // do something 75 | }); 76 | ``` 77 | 78 | Alternatively, if you want to use a callback. 79 | 80 | ```javascript 81 | // Callback 82 | loader.loadCallback(e => { 83 | if (e) { 84 | console.log(e); 85 | } else { 86 | new google.maps.Map(document.getElementById("map"), mapOptions); 87 | } 88 | }); 89 | ``` 90 | 91 | View the package in action [here](https://googlemaps.github.io/js-api-loader/examples/index.html). 92 | 93 | 94 | ## Support 95 | 96 | This library is community supported. We're comfortable enough with the stability and features of 97 | the library that we want you to build real production applications on it. 98 | 99 | If you find a bug, or have a feature suggestion, please [log an issue][issues]. If you'd like to 100 | contribute, please read [How to Contribute][contrib]. 101 | 102 | [issues]: https://github.com/googlemaps/js-api-loader/issues 103 | [contrib]: https://github.com/googlemaps/js-api-loader/blob/main/CONTRIBUTING.md 104 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/dist/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google LLC. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at. 7 | * 8 | * Http://www.apache.org/licenses/LICENSE-2.0. 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /// 17 | /** 18 | * @ignore 19 | */ 20 | declare global { 21 | interface Window { 22 | __googleMapsCallback: (e: Event) => void; 23 | } 24 | } 25 | export declare const DEFAULT_ID = "__googleMapsScriptId"; 26 | export declare type Libraries = ("drawing" | "geometry" | "localContext" | "marker" | "places" | "visualization")[]; 27 | /** 28 | * The Google Maps JavaScript API 29 | * [documentation](https://developers.google.com/maps/documentation/javascript/tutorial) 30 | * is the authoritative source for [[LoaderOptions]]. 31 | /** 32 | * Loader options 33 | */ 34 | export interface LoaderOptions { 35 | /** 36 | * See https://developers.google.com/maps/documentation/javascript/get-api-key. 37 | */ 38 | apiKey: string; 39 | /** 40 | * @deprecated See https://developers.google.com/maps/premium/overview. 41 | */ 42 | channel?: string; 43 | /** 44 | * @deprecated See https://developers.google.com/maps/premium/overview, use `apiKey` instead. 45 | */ 46 | client?: string; 47 | /** 48 | * In your application you can specify release channels or version numbers: 49 | * 50 | * The weekly version is specified with `version=weekly`. This version is 51 | * updated once per week, and is the most current. 52 | * 53 | * ``` 54 | * const loader = Loader({apiKey, version: 'weekly'}); 55 | * ``` 56 | * 57 | * The quarterly version is specified with `version=quarterly`. This version 58 | * is updated once per quarter, and is the most predictable. 59 | * 60 | * ``` 61 | * const loader = Loader({apiKey, version: 'quarterly'}); 62 | * ``` 63 | * 64 | * The version number is specified with `version=n.nn`. You can choose 65 | * `version=3.40`, `version=3.39`, or `version=3.38`. Version numbers are 66 | * updated once per quarter. 67 | * 68 | * ``` 69 | * const loader = Loader({apiKey, version: '3.40'}); 70 | * ``` 71 | * 72 | * If you do not explicitly specify a version, you will receive the 73 | * weekly version by default. 74 | */ 75 | version?: string; 76 | /** 77 | * The id of the script tag. Before adding a new script, the Loader will check for an existing one. 78 | */ 79 | id?: string; 80 | /** 81 | * When loading the Maps JavaScript API via the URL you may optionally load 82 | * additional libraries through use of the libraries URL parameter. Libraries 83 | * are modules of code that provide additional functionality to the main Maps 84 | * JavaScript API but are not loaded unless you specifically request them. 85 | * 86 | * ``` 87 | * const loader = Loader({ 88 | * apiKey, 89 | * libraries: ['drawing', 'geometry', 'places', 'visualization'], 90 | * }); 91 | * ``` 92 | * 93 | * Set the [list of libraries](https://developers.google.com/maps/documentation/javascript/libraries) for more options. 94 | */ 95 | libraries?: Libraries; 96 | /** 97 | * By default, the Maps JavaScript API uses the user's preferred language 98 | * setting as specified in the browser, when displaying textual information 99 | * such as the names for controls, copyright notices, driving directions and 100 | * labels on maps. In most cases, it's preferable to respect the browser 101 | * setting. However, if you want the Maps JavaScript API to ignore the 102 | * browser's language setting, you can force it to display information in a 103 | * particular language when loading the Maps JavaScript API code. 104 | * 105 | * For example, the following example localizes the language to Japan: 106 | * 107 | * ``` 108 | * const loader = Loader({apiKey, language: 'ja', region: 'JP'}); 109 | * ``` 110 | * 111 | * See the [list of supported 112 | * languages](https://developers.google.com/maps/faq#languagesupport). Note 113 | * that new languages are added often, so this list may not be exhaustive. 114 | * 115 | */ 116 | language?: string; 117 | /** 118 | * When you load the Maps JavaScript API from maps.googleapis.com it applies a 119 | * default bias for application behavior towards the United States. If you 120 | * want to alter your application to serve different map tiles or bias the 121 | * application (such as biasing geocoding results towards the region), you can 122 | * override this default behavior by adding a region parameter when loading 123 | * the Maps JavaScript API code. 124 | * 125 | * The region parameter accepts Unicode region subtag identifiers which 126 | * (generally) have a one-to-one mapping to country code Top-Level Domains 127 | * (ccTLDs). Most Unicode region identifiers are identical to ISO 3166-1 128 | * codes, with some notable exceptions. For example, Great Britain's ccTLD is 129 | * "uk" (corresponding to the domain .co.uk) while its region identifier is 130 | * "GB." 131 | * 132 | * For example, the following example localizes the map to the United Kingdom: 133 | * 134 | * ``` 135 | * const loader = Loader({apiKey, region: 'GB'}); 136 | * ``` 137 | */ 138 | region?: string; 139 | /** 140 | * @deprecated Passing `mapIds` is no longer required in the script tag. 141 | */ 142 | mapIds?: string[]; 143 | /** 144 | * Use a custom url and path to load the Google Maps API script. 145 | */ 146 | url?: string; 147 | /** 148 | * Use a cryptographic nonce attribute. 149 | */ 150 | nonce?: string; 151 | /** 152 | * The number of script load retries. 153 | */ 154 | retries?: number; 155 | /** 156 | * Maps JS customers can configure HTTP Referrer Restrictions in the Cloud 157 | * Console to limit which URLs are allowed to use a particular API Key. By 158 | * default, these restrictions can be configured to allow only certain paths 159 | * to use an API Key. If any URL on the same domain or origin may use the API 160 | * Key, you can set `auth_referrer_policy=origin` to limit the amount of data 161 | * sent when authorizing requests from the Maps JavaScript API. This is 162 | * available starting in version 3.46. When this parameter is specified and 163 | * HTTP Referrer Restrictions are enabled on Cloud Console, Maps JavaScript 164 | * API will only be able to load if there is an HTTP Referrer Restriction that 165 | * matches the current website's domain without a path specified. 166 | */ 167 | authReferrerPolicy?: "origin"; 168 | } 169 | /** 170 | * The status of the [[Loader]]. 171 | */ 172 | export declare enum LoaderStatus { 173 | INITIALIZED = 0, 174 | LOADING = 1, 175 | SUCCESS = 2, 176 | FAILURE = 3 177 | } 178 | /** 179 | * [[Loader]] makes it easier to add Google Maps JavaScript API to your application 180 | * dynamically using 181 | * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). 182 | * It works by dynamically creating and appending a script node to the the 183 | * document head and wrapping the callback function so as to return a promise. 184 | * 185 | * ``` 186 | * const loader = new Loader({ 187 | * apiKey: "", 188 | * version: "weekly", 189 | * libraries: ["places"] 190 | * }); 191 | * 192 | * loader.load().then((google) => { 193 | * const map = new google.maps.Map(...) 194 | * }) 195 | * ``` 196 | */ 197 | export declare class Loader { 198 | private static instance; 199 | /** 200 | * See [[LoaderOptions.version]] 201 | */ 202 | readonly version: string; 203 | /** 204 | * See [[LoaderOptions.apiKey]] 205 | */ 206 | readonly apiKey: string; 207 | /** 208 | * See [[LoaderOptions.channel]] 209 | */ 210 | readonly channel: string; 211 | /** 212 | * See [[LoaderOptions.client]] 213 | */ 214 | readonly client: string; 215 | /** 216 | * See [[LoaderOptions.id]] 217 | */ 218 | readonly id: string; 219 | /** 220 | * See [[LoaderOptions.libraries]] 221 | */ 222 | readonly libraries: Libraries; 223 | /** 224 | * See [[LoaderOptions.language]] 225 | */ 226 | readonly language: string; 227 | /** 228 | * See [[LoaderOptions.region]] 229 | */ 230 | readonly region: string; 231 | /** 232 | * See [[LoaderOptions.mapIds]] 233 | */ 234 | readonly mapIds: string[]; 235 | /** 236 | * See [[LoaderOptions.nonce]] 237 | */ 238 | readonly nonce: string | null; 239 | /** 240 | * See [[LoaderOptions.retries]] 241 | */ 242 | readonly retries: number; 243 | /** 244 | * See [[LoaderOptions.url]] 245 | */ 246 | readonly url: string; 247 | /** 248 | * See [[LoaderOptions.authReferrerPolicy]] 249 | */ 250 | readonly authReferrerPolicy: "origin"; 251 | private CALLBACK; 252 | private callbacks; 253 | private done; 254 | private loading; 255 | private onerrorEvent; 256 | private errors; 257 | /** 258 | * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set 259 | * using this library, instead the defaults are set by the Google Maps 260 | * JavaScript API server. 261 | * 262 | * ``` 263 | * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']}); 264 | * ``` 265 | */ 266 | constructor({ apiKey, authReferrerPolicy, channel, client, id, language, libraries, mapIds, nonce, region, retries, url, version, }: LoaderOptions); 267 | get options(): LoaderOptions; 268 | get status(): LoaderStatus; 269 | private get failed(); 270 | /** 271 | * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]]. 272 | * 273 | * @ignore 274 | */ 275 | createUrl(): string; 276 | deleteScript(): void; 277 | /** 278 | * Load the Google Maps JavaScript API script and return a Promise. 279 | */ 280 | load(): Promise; 281 | /** 282 | * Load the Google Maps JavaScript API script and return a Promise. 283 | * 284 | * @ignore 285 | */ 286 | loadPromise(): Promise; 287 | /** 288 | * Load the Google Maps JavaScript API script with a callback. 289 | */ 290 | loadCallback(fn: (e: ErrorEvent) => void): void; 291 | /** 292 | * Set the script on document. 293 | */ 294 | private setScript; 295 | /** 296 | * Reset the loader state. 297 | */ 298 | private reset; 299 | private resetIfRetryingFailed; 300 | private loadErrorCallback; 301 | private setCallback; 302 | private callback; 303 | private execute; 304 | } 305 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/dist/index.esm.js: -------------------------------------------------------------------------------- 1 | // do not edit .js files directly - edit src/index.jst 2 | 3 | 4 | 5 | var fastDeepEqual = function equal(a, b) { 6 | if (a === b) return true; 7 | 8 | if (a && b && typeof a == 'object' && typeof b == 'object') { 9 | if (a.constructor !== b.constructor) return false; 10 | 11 | var length, i, keys; 12 | if (Array.isArray(a)) { 13 | length = a.length; 14 | if (length != b.length) return false; 15 | for (i = length; i-- !== 0;) 16 | if (!equal(a[i], b[i])) return false; 17 | return true; 18 | } 19 | 20 | 21 | 22 | if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 23 | if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 24 | if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 25 | 26 | keys = Object.keys(a); 27 | length = keys.length; 28 | if (length !== Object.keys(b).length) return false; 29 | 30 | for (i = length; i-- !== 0;) 31 | if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 32 | 33 | for (i = length; i-- !== 0;) { 34 | var key = keys[i]; 35 | 36 | if (!equal(a[key], b[key])) return false; 37 | } 38 | 39 | return true; 40 | } 41 | 42 | // true if both NaN, false otherwise 43 | return a!==a && b!==b; 44 | }; 45 | 46 | /** 47 | * Copyright 2019 Google LLC. All Rights Reserved. 48 | * 49 | * Licensed under the Apache License, Version 2.0 (the "License"); 50 | * you may not use this file except in compliance with the License. 51 | * You may obtain a copy of the License at. 52 | * 53 | * Http://www.apache.org/licenses/LICENSE-2.0. 54 | * 55 | * Unless required by applicable law or agreed to in writing, software 56 | * distributed under the License is distributed on an "AS IS" BASIS, 57 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 58 | * See the License for the specific language governing permissions and 59 | * limitations under the License. 60 | */ 61 | const DEFAULT_ID = "__googleMapsScriptId"; 62 | /** 63 | * The status of the [[Loader]]. 64 | */ 65 | var LoaderStatus; 66 | (function (LoaderStatus) { 67 | LoaderStatus[LoaderStatus["INITIALIZED"] = 0] = "INITIALIZED"; 68 | LoaderStatus[LoaderStatus["LOADING"] = 1] = "LOADING"; 69 | LoaderStatus[LoaderStatus["SUCCESS"] = 2] = "SUCCESS"; 70 | LoaderStatus[LoaderStatus["FAILURE"] = 3] = "FAILURE"; 71 | })(LoaderStatus || (LoaderStatus = {})); 72 | /** 73 | * [[Loader]] makes it easier to add Google Maps JavaScript API to your application 74 | * dynamically using 75 | * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). 76 | * It works by dynamically creating and appending a script node to the the 77 | * document head and wrapping the callback function so as to return a promise. 78 | * 79 | * ``` 80 | * const loader = new Loader({ 81 | * apiKey: "", 82 | * version: "weekly", 83 | * libraries: ["places"] 84 | * }); 85 | * 86 | * loader.load().then((google) => { 87 | * const map = new google.maps.Map(...) 88 | * }) 89 | * ``` 90 | */ 91 | class Loader { 92 | /** 93 | * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set 94 | * using this library, instead the defaults are set by the Google Maps 95 | * JavaScript API server. 96 | * 97 | * ``` 98 | * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']}); 99 | * ``` 100 | */ 101 | constructor({ apiKey, authReferrerPolicy, channel, client, id = DEFAULT_ID, language, libraries = [], mapIds, nonce, region, retries = 3, url = "https://maps.googleapis.com/maps/api/js", version, }) { 102 | this.CALLBACK = "__googleMapsCallback"; 103 | this.callbacks = []; 104 | this.done = false; 105 | this.loading = false; 106 | this.errors = []; 107 | this.apiKey = apiKey; 108 | this.authReferrerPolicy = authReferrerPolicy; 109 | this.channel = channel; 110 | this.client = client; 111 | this.id = id || DEFAULT_ID; // Do not allow empty string 112 | this.language = language; 113 | this.libraries = libraries; 114 | this.mapIds = mapIds; 115 | this.nonce = nonce; 116 | this.region = region; 117 | this.retries = retries; 118 | this.url = url; 119 | this.version = version; 120 | if (Loader.instance) { 121 | if (!fastDeepEqual(this.options, Loader.instance.options)) { 122 | throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`); 123 | } 124 | return Loader.instance; 125 | } 126 | Loader.instance = this; 127 | } 128 | get options() { 129 | return { 130 | version: this.version, 131 | apiKey: this.apiKey, 132 | channel: this.channel, 133 | client: this.client, 134 | id: this.id, 135 | libraries: this.libraries, 136 | language: this.language, 137 | region: this.region, 138 | mapIds: this.mapIds, 139 | nonce: this.nonce, 140 | url: this.url, 141 | authReferrerPolicy: this.authReferrerPolicy, 142 | }; 143 | } 144 | get status() { 145 | if (this.errors.length) { 146 | return LoaderStatus.FAILURE; 147 | } 148 | if (this.done) { 149 | return LoaderStatus.SUCCESS; 150 | } 151 | if (this.loading) { 152 | return LoaderStatus.LOADING; 153 | } 154 | return LoaderStatus.INITIALIZED; 155 | } 156 | get failed() { 157 | return this.done && !this.loading && this.errors.length >= this.retries + 1; 158 | } 159 | /** 160 | * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]]. 161 | * 162 | * @ignore 163 | */ 164 | createUrl() { 165 | let url = this.url; 166 | url += `?callback=${this.CALLBACK}`; 167 | if (this.apiKey) { 168 | url += `&key=${this.apiKey}`; 169 | } 170 | if (this.channel) { 171 | url += `&channel=${this.channel}`; 172 | } 173 | if (this.client) { 174 | url += `&client=${this.client}`; 175 | } 176 | if (this.libraries.length > 0) { 177 | url += `&libraries=${this.libraries.join(",")}`; 178 | } 179 | if (this.language) { 180 | url += `&language=${this.language}`; 181 | } 182 | if (this.region) { 183 | url += `®ion=${this.region}`; 184 | } 185 | if (this.version) { 186 | url += `&v=${this.version}`; 187 | } 188 | if (this.mapIds) { 189 | url += `&map_ids=${this.mapIds.join(",")}`; 190 | } 191 | if (this.authReferrerPolicy) { 192 | url += `&auth_referrer_policy=${this.authReferrerPolicy}`; 193 | } 194 | return url; 195 | } 196 | deleteScript() { 197 | const script = document.getElementById(this.id); 198 | if (script) { 199 | script.remove(); 200 | } 201 | } 202 | /** 203 | * Load the Google Maps JavaScript API script and return a Promise. 204 | */ 205 | load() { 206 | return this.loadPromise(); 207 | } 208 | /** 209 | * Load the Google Maps JavaScript API script and return a Promise. 210 | * 211 | * @ignore 212 | */ 213 | loadPromise() { 214 | return new Promise((resolve, reject) => { 215 | this.loadCallback((err) => { 216 | if (!err) { 217 | resolve(window.google); 218 | } 219 | else { 220 | reject(err.error); 221 | } 222 | }); 223 | }); 224 | } 225 | /** 226 | * Load the Google Maps JavaScript API script with a callback. 227 | */ 228 | loadCallback(fn) { 229 | this.callbacks.push(fn); 230 | this.execute(); 231 | } 232 | /** 233 | * Set the script on document. 234 | */ 235 | setScript() { 236 | if (document.getElementById(this.id)) { 237 | // TODO wrap onerror callback for cases where the script was loaded elsewhere 238 | this.callback(); 239 | return; 240 | } 241 | const url = this.createUrl(); 242 | const script = document.createElement("script"); 243 | script.id = this.id; 244 | script.type = "text/javascript"; 245 | script.src = url; 246 | script.onerror = this.loadErrorCallback.bind(this); 247 | script.defer = true; 248 | script.async = true; 249 | if (this.nonce) { 250 | script.nonce = this.nonce; 251 | } 252 | document.head.appendChild(script); 253 | } 254 | /** 255 | * Reset the loader state. 256 | */ 257 | reset() { 258 | this.deleteScript(); 259 | this.done = false; 260 | this.loading = false; 261 | this.errors = []; 262 | this.onerrorEvent = null; 263 | } 264 | resetIfRetryingFailed() { 265 | if (this.failed) { 266 | this.reset(); 267 | } 268 | } 269 | loadErrorCallback(e) { 270 | this.errors.push(e); 271 | if (this.errors.length <= this.retries) { 272 | const delay = this.errors.length * Math.pow(2, this.errors.length); 273 | console.log(`Failed to load Google Maps script, retrying in ${delay} ms.`); 274 | setTimeout(() => { 275 | this.deleteScript(); 276 | this.setScript(); 277 | }, delay); 278 | } 279 | else { 280 | this.onerrorEvent = e; 281 | this.callback(); 282 | } 283 | } 284 | setCallback() { 285 | window.__googleMapsCallback = this.callback.bind(this); 286 | } 287 | callback() { 288 | this.done = true; 289 | this.loading = false; 290 | this.callbacks.forEach((cb) => { 291 | cb(this.onerrorEvent); 292 | }); 293 | this.callbacks = []; 294 | } 295 | execute() { 296 | this.resetIfRetryingFailed(); 297 | if (this.done) { 298 | this.callback(); 299 | } 300 | else { 301 | // short circuit and warn if google.maps is already loaded 302 | if (window.google && window.google.maps && window.google.maps.version) { 303 | console.warn("Google Maps already loaded outside @googlemaps/js-api-loader." + 304 | "This may result in undesirable behavior as options and script parameters may not match."); 305 | this.callback(); 306 | return; 307 | } 308 | if (this.loading) ; 309 | else { 310 | this.loading = true; 311 | this.setCallback(); 312 | this.setScript(); 313 | } 314 | } 315 | } 316 | } 317 | 318 | export { DEFAULT_ID, Loader, LoaderStatus }; 319 | //# sourceMappingURL=index.esm.js.map 320 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/dist/index.esm.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.esm.js","sources":["../node_modules/fast-deep-equal/index.js","../src/index.ts"],"sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n",null],"names":["isEqual"],"mappings":"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"} -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/dist/index.min.js: -------------------------------------------------------------------------------- 1 | this.google=this.google||{},this.google.maps=this.google.maps||{},this.google.maps.plugins=this.google.maps.plugins||{},this.google.maps.plugins.loader=function(t){"use strict";function e(t,e){for(var r=0;r0&&g[0]<4?1:+(g[0]+g[1])),!y&&$&&(!(g=$.match(/Edge\/(\d+)/))||g[1]>=74)&&(g=$.match(/Chrome\/(\d+)/))&&(y=+g[1]);var et=y,rt=et,nt=a,ot=!!Object.getOwnPropertySymbols&&!nt((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),it=ot&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,at=H,ct=G,ut=q,st=it,ft=o.Object,lt=st?function(t){return"symbol"==typeof t}:function(t){var e=at("Symbol");return ct(e)&&ut(e.prototype,ft(t))},ht=o.String,pt=function(t){try{return ht(t)}catch(t){return"Object"}},dt=G,vt=pt,gt=o.TypeError,yt=function(t){if(dt(t))return t;throw gt(vt(t)+" is not a function")},bt=yt,mt=function(t,e){var r=t[e];return null==r?void 0:bt(r)},St=l,wt=G,Ot=K,jt=o.TypeError,Et={exports:{}},Tt=o,Lt=Object.defineProperty,Pt=function(t,e){try{Lt(Tt,t,{value:e,configurable:!0,writable:!0})}catch(r){Tt[t]=e}return e},Ct=Pt,kt="__core-js_shared__",It=o[kt]||Ct(kt,{}),Rt=It;(Et.exports=function(t,e){return Rt[t]||(Rt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE",source:"https://github.com/zloirock/core-js"});var At=_,xt=o.Object,Nt=function(t){return xt(At(t))},Mt=Nt,_t=E({}.hasOwnProperty),Ft=Object.hasOwn||function(t,e){return _t(Mt(t),e)},Dt=E,Ut=0,Gt=Math.random(),Bt=Dt(1..toString),Kt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Bt(++Ut+Gt,36)},Vt=o,zt=Et.exports,Jt=Ft,Ht=Kt,qt=ot,Wt=it,Zt=zt("wks"),$t=Vt.Symbol,Xt=$t&&$t.for,Yt=Wt?$t:$t&&$t.withoutSetter||Ht,Qt=function(t){if(!Jt(Zt,t)||!qt&&"string"!=typeof Zt[t]){var e="Symbol."+t;qt&&Jt($t,t)?Zt[t]=$t[t]:Zt[t]=Wt&&Xt?Xt(e):Yt(e)}return Zt[t]},te=l,ee=K,re=lt,ne=mt,oe=function(t,e){var r,n;if("string"===e&&wt(r=t.toString)&&!Ot(n=St(r,t)))return n;if(wt(r=t.valueOf)&&!Ot(n=St(r,t)))return n;if("string"!==e&&wt(r=t.toString)&&!Ot(n=St(r,t)))return n;throw jt("Can't convert object to primitive value")},ie=Qt,ae=o.TypeError,ce=ie("toPrimitive"),ue=function(t,e){if(!ee(t)||re(t))return t;var r,n=ne(t,ce);if(n){if(void 0===e&&(e="default"),r=te(n,t,e),!ee(r)||re(r))return r;throw ae("Can't convert object to primitive value")}return void 0===e&&(e="number"),oe(t,e)},se=lt,fe=function(t){var e=ue(t,"string");return se(e)?e:e+""},le=K,he=o.document,pe=le(he)&&le(he.createElement),de=function(t){return pe?he.createElement(t):{}},ve=de,ge=!c&&!a((function(){return 7!=Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),ye=c,be=l,me=h,Se=b,we=U,Oe=fe,je=Ft,Ee=ge,Te=Object.getOwnPropertyDescriptor;i.f=ye?Te:function(t,e){if(t=we(t),e=Oe(e),Ee)try{return Te(t,e)}catch(t){}if(je(t,e))return Se(!be(me.f,t,e),t[e])};var Le={},Pe=c&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ce=o,ke=K,Ie=Ce.String,Re=Ce.TypeError,Ae=function(t){if(ke(t))return t;throw Re(Ie(t)+" is not an object")},xe=c,Ne=ge,Me=Pe,_e=Ae,Fe=fe,De=o.TypeError,Ue=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,Be="enumerable",Ke="configurable",Ve="writable";Le.f=xe?Me?function(t,e,r){if(_e(t),e=Fe(e),_e(r),"function"==typeof t&&"prototype"===e&&"value"in r&&Ve in r&&!r.writable){var n=Ge(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:Ke in r?r.configurable:n.configurable,enumerable:Be in r?r.enumerable:n.enumerable,writable:!1})}return Ue(t,e,r)}:Ue:function(t,e,r){if(_e(t),e=Fe(e),_e(r),Ne)try{return Ue(t,e,r)}catch(t){}if("get"in r||"set"in r)throw De("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var ze=Le,Je=b,He=c?function(t,e,r){return ze.f(t,e,Je(1,r))}:function(t,e,r){return t[e]=r,t},qe={exports:{}},We=c,Ze=Ft,$e=Function.prototype,Xe=We&&Object.getOwnPropertyDescriptor,Ye=Ze($e,"name"),Qe={EXISTS:Ye,PROPER:Ye&&"something"===function(){}.name,CONFIGURABLE:Ye&&(!We||We&&Xe($e,"name").configurable)},tr=G,er=It,rr=E(Function.toString);tr(er.inspectSource)||(er.inspectSource=function(t){return rr(t)});var nr,or,ir,ar=er.inspectSource,cr=G,ur=ar,sr=o.WeakMap,fr=cr(sr)&&/native code/.test(ur(sr)),lr=Et.exports,hr=Kt,pr=lr("keys"),dr={},vr=fr,gr=o,yr=E,br=K,mr=He,Sr=Ft,wr=It,Or=function(t){return pr[t]||(pr[t]=hr(t))},jr=dr,Er="Object already initialized",Tr=gr.TypeError,Lr=gr.WeakMap;if(vr||wr.state){var Pr=wr.state||(wr.state=new Lr),Cr=yr(Pr.get),kr=yr(Pr.has),Ir=yr(Pr.set);nr=function(t,e){if(kr(Pr,t))throw new Tr(Er);return e.facade=t,Ir(Pr,t,e),e},or=function(t){return Cr(Pr,t)||{}},ir=function(t){return kr(Pr,t)}}else{var Rr=Or("state");jr[Rr]=!0,nr=function(t,e){if(Sr(t,Rr))throw new Tr(Er);return e.facade=t,mr(t,Rr,e),e},or=function(t){return Sr(t,Rr)?t[Rr]:{}},ir=function(t){return Sr(t,Rr)}}var Ar={set:nr,get:or,has:ir,enforce:function(t){return ir(t)?or(t):nr(t,{})},getterFor:function(t){return function(e){var r;if(!br(e)||(r=or(e)).type!==t)throw Tr("Incompatible receiver, "+t+" required");return r}}},xr=a,Nr=G,Mr=Ft,_r=Le.f,Fr=Qe.CONFIGURABLE,Dr=ar,Ur=Ar.enforce,Gr=Ar.get,Br=!xr((function(){return 8!==_r((function(){}),"length",{value:8}).length})),Kr=String(String).split("String"),Vr=qe.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Mr(t,"name")||Fr&&t.name!==e)&&_r(t,"name",{value:e,configurable:!0}),Br&&r&&Mr(r,"arity")&&t.length!==r.arity&&_r(t,"length",{value:r.arity});var n=Ur(t);return Mr(n,"source")||(n.source=Kr.join("string"==typeof e?e:"")),t};Function.prototype.toString=Vr((function(){return Nr(this)&&Gr(this).source||Dr(this)}),"toString");var zr=o,Jr=G,Hr=He,qr=qe.exports,Wr=Pt,Zr=function(t,e,r,n){var o=!!n&&!!n.unsafe,i=!!n&&!!n.enumerable,a=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:e;return Jr(r)&&qr(r,c,n),t===zr?(i?t[e]=r:Wr(e,r),t):(o?!a&&t[e]&&(i=!0):delete t[e],i?t[e]=r:Hr(t,e,r),t)},$r={},Xr=Math.ceil,Yr=Math.floor,Qr=function(t){var e=+t;return e!=e||0===e?0:(e>0?Yr:Xr)(e)},tn=Qr,en=Math.max,rn=Math.min,nn=Qr,on=Math.min,an=function(t){return t>0?on(nn(t),9007199254740991):0},cn=function(t){return an(t.length)},un=U,sn=function(t,e){var r=tn(t);return r<0?en(r+e,0):rn(r,e)},fn=cn,ln=function(t){return function(e,r,n){var o,i=un(e),a=fn(i),c=sn(n,a);if(t&&r!=r){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},hn={includes:ln(!0),indexOf:ln(!1)},pn=Ft,dn=U,vn=hn.indexOf,gn=dr,yn=E([].push),bn=function(t,e){var r,n=dn(t),o=0,i=[];for(r in n)!pn(gn,r)&&pn(n,r)&&yn(i,r);for(;e.length>o;)pn(n,r=e[o++])&&(~vn(i,r)||yn(i,r));return i},mn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");$r.f=Object.getOwnPropertyNames||function(t){return bn(t,mn)};var Sn={};Sn.f=Object.getOwnPropertySymbols;var wn=H,On=$r,jn=Sn,En=Ae,Tn=E([].concat),Ln=wn("Reflect","ownKeys")||function(t){var e=On.f(En(t)),r=jn.f;return r?Tn(e,r(t)):e},Pn=Ft,Cn=Ln,kn=i,In=Le,Rn=a,An=G,xn=/#|\.prototype\./,Nn=function(t,e){var r=_n[Mn(t)];return r==Dn||r!=Fn&&(An(e)?Rn(e):!!e)},Mn=Nn.normalize=function(t){return String(t).replace(xn,".").toLowerCase()},_n=Nn.data={},Fn=Nn.NATIVE="N",Dn=Nn.POLYFILL="P",Un=Nn,Gn=o,Bn=i.f,Kn=He,Vn=Zr,zn=Pt,Jn=function(t,e,r){for(var n=Cn(e),o=In.f,i=kn.f,a=0;a=51||!Ao((function(){var e=[];return(e.constructor={})[No]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Jo=et,Ho=Qt("isConcatSpreadable"),qo=9007199254740991,Wo="Maximum allowed index exceeded",Zo=_o.TypeError,$o=Jo>=51||!Fo((function(){var t=[];return t[Ho]=!1,t.concat()[0]!==t})),Xo=zo("concat"),Yo=function(t){if(!Uo(t))return!1;var e=t[Ho];return void 0!==e?!!e:Do(t)};Mo({target:"Array",proto:!0,arity:1,forced:!$o||!Xo},{concat:function(t){var e,r,n,o,i,a=Go(this),c=Vo(a,0),u=0;for(e=-1,n=arguments.length;eqo)throw Zo(Wo);for(r=0;r=qo)throw Zo(Wo);Ko(c,u++,i)}return c.length=u,c}});var Qo=u,ti=Function.prototype,ei=ti.apply,ri=ti.call,ni="object"==typeof Reflect&&Reflect.apply||(Qo?ri.bind(ei):function(){return ri.apply(ei,arguments)}),oi=E([].slice),ii=qn,ai=H,ci=ni,ui=l,si=E,fi=a,li=Zn,hi=G,pi=K,di=lt,vi=oi,gi=ot,yi=ai("JSON","stringify"),bi=si(/./.exec),mi=si("".charAt),Si=si("".charCodeAt),wi=si("".replace),Oi=si(1..toString),ji=/[\uD800-\uDFFF]/g,Ei=/^[\uD800-\uDBFF]$/,Ti=/^[\uDC00-\uDFFF]$/,Li=!gi||fi((function(){var t=ai("Symbol")();return"[null]"!=yi([t])||"{}"!=yi({a:t})||"{}"!=yi(Object(t))})),Pi=fi((function(){return'"\\udf06\\ud834"'!==yi("\udf06\ud834")||'"\\udead"'!==yi("\udead")})),Ci=function(t,e){var r=vi(arguments),n=e;if((pi(e)||void 0!==t)&&!di(t))return li(e)||(e=function(t,e){if(hi(n)&&(e=ui(n,this,t,e)),!di(e))return e}),r[1]=e,ci(yi,null,r)},ki=function(t,e,r){var n=mi(r,e-1),o=mi(r,e+1);return bi(Ei,t)&&!bi(Ti,o)||bi(Ti,t)&&!bi(Ei,n)?"\\u"+Oi(Si(t,0),16):t};yi&&ii({target:"JSON",stat:!0,arity:3,forced:Li||Pi},{stringify:function(t,e,r){var n=vi(arguments),o=ci(Li?Ci:yi,null,n);return Pi&&"string"==typeof o?wi(o,ji,ki):o}});var Ii=a,Ri=function(t,e){var r=[][t];return!!r&&Ii((function(){r.call(null,e||function(){return 1},1)}))},Ai=qn,xi=N,Ni=U,Mi=Ri,_i=E([].join),Fi=xi!=Object,Di=Mi("join",",");Ai({target:"Array",proto:!0,forced:Fi||!Di},{join:function(t){return _i(Ni(this),void 0===t?",":t)}});var Ui=uo,Gi=to?{}.toString:function(){return"[object "+Ui(this)+"]"};to||Zr(Object.prototype,"toString",Gi,{unsafe:!0});var Bi,Ki,Vi,zi,Ji="process"==C(o.process),Hi=o,qi=G,Wi=Hi.String,Zi=Hi.TypeError,$i=E,Xi=Ae,Yi=function(t){if("object"==typeof t||qi(t))return t;throw Zi("Can't set "+Wi(t)+" as a prototype")},Qi=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=$i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Xi(r),Yi(n),e?t(r,n):r.__proto__=n,r}}():void 0),ta=Le.f,ea=Ft,ra=Qt("toStringTag"),na=H,oa=Le,ia=c,aa=Qt("species"),ca=q,ua=o.TypeError,sa=jo,fa=pt,la=o.TypeError,ha=Ae,pa=function(t){if(sa(t))return t;throw la(fa(t)+" is not a constructor")},da=Qt("species"),va=yt,ga=u,ya=E(E.bind),ba=function(t,e){return va(t),void 0===e?t:ga?ya(t,e):function(){return t.apply(e,arguments)}},ma=H("document","documentElement"),Sa=o.TypeError,wa=/(?:ipad|iphone|ipod).*applewebkit/i.test(W),Oa=o,ja=ni,Ea=ba,Ta=G,La=Ft,Pa=a,Ca=ma,ka=oi,Ia=de,Ra=function(t,e){if(t=51&&/native code/.test(t))return!1;var r=new Cc((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(r.constructor={})[Mc]=n,!(_c=r.then((function(){}))instanceof n)||!e&&xc&&!Fc})),REJECTION_EVENT:Fc,SUBCLASSING:_c},Uc={},Gc=yt,Bc=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=Gc(e),this.reject=Gc(r)};Uc.f=function(t){return new Bc(t)};var Kc,Vc,zc,Jc=qn,Hc=Ji,qc=o,Wc=l,Zc=Zr,$c=Qi,Xc=function(t,e,r){t&&!r&&(t=t.prototype),t&&!ea(t,ra)&&ta(t,ra,{configurable:!0,value:e})},Yc=function(t){var e=na(t),r=oa.f;ia&&e&&!e[aa]&&r(e,aa,{configurable:!0,get:function(){return this}})},Qc=yt,tu=G,eu=K,ru=function(t,e){if(ca(e,t))return t;throw ua("Incorrect invocation")},nu=function(t,e){var r,n=ha(t).constructor;return void 0===n||null==(r=ha(n)[da])?e:pa(r)},ou=rc.set,iu=Sc,au=function(t,e){var r=wc.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))},cu=Oc,uu=Ec,su=Ar,fu=Tc,lu=Uc,hu="Promise",pu=Dc.CONSTRUCTOR,du=Dc.REJECTION_EVENT,vu=Dc.SUBCLASSING,gu=su.getterFor(hu),yu=su.set,bu=fu&&fu.prototype,mu=fu,Su=bu,wu=qc.TypeError,Ou=qc.document,ju=qc.process,Eu=lu.f,Tu=Eu,Lu=!!(Ou&&Ou.createEvent&&qc.dispatchEvent),Pu="unhandledrejection",Cu=function(t){var e;return!(!eu(t)||!tu(e=t.then))&&e},ku=function(t,e){var r,n,o,i=e.value,a=1==e.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,f=t.domain;try{c?(a||(2===e.rejection&&Nu(e),e.rejection=1),!0===c?r=i:(f&&f.enter(),r=c(i),f&&(f.exit(),o=!0)),r===t.promise?s(wu("Promise-chain cycle")):(n=Cu(r))?Wc(n,r,u,s):u(r)):s(i)}catch(t){f&&!o&&f.exit(),s(t)}},Iu=function(t,e){t.notified||(t.notified=!0,iu((function(){for(var r,n=t.reactions;r=n.get();)ku(r,t);t.notified=!1,e&&!t.rejection&&Au(t)})))},Ru=function(t,e,r){var n,o;Lu?((n=Ou.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),qc.dispatchEvent(n)):n={promise:e,reason:r},!du&&(o=qc["on"+t])?o(n):t===Pu&&au("Unhandled promise rejection",r)},Au=function(t){Wc(ou,qc,(function(){var e,r=t.facade,n=t.value;if(xu(t)&&(e=cu((function(){Hc?ju.emit("unhandledRejection",n,r):Ru(Pu,r,n)})),t.rejection=Hc||xu(t)?2:1,e.error))throw e.value}))},xu=function(t){return 1!==t.rejection&&!t.parent},Nu=function(t){Wc(ou,qc,(function(){var e=t.facade;Hc?ju.emit("rejectionHandled",e):Ru("rejectionhandled",e,t.value)}))},Mu=function(t,e,r){return function(n){t(e,n,r)}},_u=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Iu(t,!0))},Fu=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw wu("Promise can't be resolved itself");var n=Cu(e);n?iu((function(){var r={done:!1};try{Wc(n,e,Mu(Fu,r,t),Mu(_u,r,t))}catch(e){_u(r,e,t)}})):(t.value=e,t.state=1,Iu(t,!1))}catch(e){_u({done:!1},e,t)}}};if(pu&&(Su=(mu=function(t){ru(this,Su),Qc(t),Wc(Kc,this);var e=gu(this);try{t(Mu(Fu,e),Mu(_u,e))}catch(t){_u(e,t)}}).prototype,(Kc=function(t){yu(this,{type:hu,done:!1,notified:!1,parent:!1,reactions:new uu,rejection:!1,state:0,value:void 0})}).prototype=Zc(Su,"then",(function(t,e){var r=gu(this),n=Eu(nu(this,mu));return r.parent=!0,n.ok=!tu(t)||t,n.fail=tu(e)&&e,n.domain=Hc?ju.domain:void 0,0==r.state?r.reactions.add(n):iu((function(){ku(n,r)})),n.promise})),Vc=function(){var t=new Kc,e=gu(t);this.promise=t,this.resolve=Mu(Fu,e),this.reject=Mu(_u,e)},lu.f=Eu=function(t){return t===mu||undefined===t?new Vc(t):Tu(t)},tu(fu)&&bu!==Object.prototype)){zc=bu.then,vu||Zc(bu,"then",(function(t,e){var r=this;return new mu((function(t,e){Wc(zc,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete bu.constructor}catch(t){}$c&&$c(bu,Su)}Jc({global:!0,wrap:!0,forced:pu},{Promise:mu}),Xc(mu,hu,!1),Yc(hu);var Du={},Uu=Du,Gu=Qt("iterator"),Bu=Array.prototype,Ku=uo,Vu=mt,zu=Du,Ju=Qt("iterator"),Hu=function(t){if(null!=t)return Vu(t,Ju)||Vu(t,"@@iterator")||zu[Ku(t)]},qu=l,Wu=yt,Zu=Ae,$u=pt,Xu=Hu,Yu=o.TypeError,Qu=l,ts=Ae,es=mt,rs=ba,ns=l,os=Ae,is=pt,as=function(t){return void 0!==t&&(Uu.Array===t||Bu[Gu]===t)},cs=cn,us=q,ss=function(t,e){var r=arguments.length<2?Xu(t):e;if(Wu(r))return Zu(qu(r,t));throw Yu($u(t)+" is not iterable")},fs=Hu,ls=function(t,e,r){var n,o;ts(t);try{if(!(n=es(t,"return"))){if("throw"===e)throw r;return r}n=Qu(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return ts(n),r},hs=o.TypeError,ps=function(t,e){this.stopped=t,this.result=e},ds=ps.prototype,vs=function(t,e,r){var n,o,i,a,c,u,s,f=r&&r.that,l=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),d=rs(e,f),v=function(t){return n&&ls(n,"normal",t),new ps(!0,t)},g=function(t){return l?(os(t),p?d(t[0],t[1],v):d(t[0],t[1])):p?d(t,v):d(t)};if(h)n=t;else{if(!(o=fs(t)))throw hs(is(t)+" is not iterable");if(as(o)){for(i=0,a=cs(t);a>i;i++)if((c=g(t[i]))&&us(ds,c))return c;return new ps(!1)}n=ss(t,o)}for(u=n.next;!(s=ns(u,n)).done;){try{c=g(s.value)}catch(t){ls(n,"throw",t)}if("object"==typeof c&&c&&us(ds,c))return c}return new ps(!1)},gs=Qt("iterator"),ys=!1;try{var bs=0,ms={next:function(){return{done:!!bs++}},return:function(){ys=!0}};ms[gs]=function(){return this},Array.from(ms,(function(){throw 2}))}catch(t){}var Ss=Tc,ws=Dc.CONSTRUCTOR||!function(t,e){if(!e&&!ys)return!1;var r=!1;try{var n={};n[gs]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r}((function(t){Ss.all(t).then(void 0,(function(){}))})),Os=l,js=yt,Es=Uc,Ts=Oc,Ls=vs;qn({target:"Promise",stat:!0,forced:ws},{all:function(t){var e=this,r=Es.f(e),n=r.resolve,o=r.reject,i=Ts((function(){var r=js(e.resolve),i=[],a=0,c=1;Ls(t,(function(t){var u=a++,s=!1;c++,Os(r,e,t).then((function(t){s||(s=!0,i[u]=t,--c||n(i))}),o)})),--c||n(i)}));return i.error&&o(i.value),r.promise}});var Ps=qn,Cs=Dc.CONSTRUCTOR,ks=Tc,Is=H,Rs=G,As=Zr,xs=ks&&ks.prototype;if(Ps({target:"Promise",proto:!0,forced:Cs,real:!0},{catch:function(t){return this.then(void 0,t)}}),Rs(ks)){var Ns=Is("Promise").prototype.catch;xs.catch!==Ns&&As(xs,"catch",Ns,{unsafe:!0})}var Ms=l,_s=yt,Fs=Uc,Ds=Oc,Us=vs;qn({target:"Promise",stat:!0,forced:ws},{race:function(t){var e=this,r=Fs.f(e),n=r.reject,o=Ds((function(){var o=_s(e.resolve);Us(t,(function(t){Ms(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var Gs=l,Bs=Uc;qn({target:"Promise",stat:!0,forced:Dc.CONSTRUCTOR},{reject:function(t){var e=Bs.f(this);return Gs(e.reject,void 0,t),e.promise}});var Ks=Ae,Vs=K,zs=Uc,Js=qn,Hs=Dc.CONSTRUCTOR,qs=function(t,e){if(Ks(t),Vs(e)&&e.constructor===t)return e;var r=zs.f(t);return(0,r.resolve)(e),r.promise};H("Promise"),Js({target:"Promise",stat:!0,forced:Hs},{resolve:function(t){return qs(this,t)}});var Ws=de("span").classList,Zs=Ws&&Ws.constructor&&Ws.constructor.prototype,$s=Zs===Object.prototype?void 0:Zs,Xs=ba,Ys=N,Qs=Nt,tf=cn,ef=Ro,rf=E([].push),nf=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,a=7==t,c=5==t||i;return function(u,s,f,l){for(var h,p,d=Qs(u),v=Ys(d),g=Xs(s,f),y=tf(v),b=0,m=l||ef,S=e?m(u,y):r||a?m(u,0):void 0;y>b;b++)if((c||b in v)&&(p=g(h=v[b],b,d),t))if(e)S[b]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return b;case 2:rf(S,h)}else switch(t){case 4:return!1;case 7:rf(S,h)}return i?-1:n||o?o:S}},of={forEach:nf(0),map:nf(1),filter:nf(2),some:nf(3),every:nf(4),find:nf(5),findIndex:nf(6),filterReject:nf(7)}.forEach,af=o,cf={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},uf=$s,sf=Ri("forEach")?[].forEach:function(t){return of(this,t,arguments.length>1?arguments[1]:void 0)},ff=He,lf=function(t){if(t&&t.forEach!==sf)try{ff(t,"forEach",sf)}catch(e){t.forEach=sf}};for(var hf in cf)cf[hf]&&lf(af[hf]&&af[hf].prototype);lf(uf);var pf,df="__googleMapsScriptId";t.LoaderStatus=void 0,(pf=t.LoaderStatus||(t.LoaderStatus={}))[pf.INITIALIZED=0]="INITIALIZED",pf[pf.LOADING=1]="LOADING",pf[pf.SUCCESS=2]="SUCCESS",pf[pf.FAILURE=3]="FAILURE";var vf=function(){function r(t){var e=t.apiKey,n=t.authReferrerPolicy,o=t.channel,i=t.client,a=t.id,c=void 0===a?df:a,u=t.language,s=t.libraries,f=void 0===s?[]:s,l=t.mapIds,h=t.nonce,p=t.region,d=t.retries,v=void 0===d?3:d,g=t.url,y=void 0===g?"https://maps.googleapis.com/maps/api/js":g,b=t.version;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=n,this.channel=o,this.client=i,this.id=c||df,this.language=u,this.libraries=f,this.mapIds=l,this.nonce=h,this.region=p,this.retries=v,this.url=y,this.version=b,r.instance){if(!function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var a=i[o];if(!t(e[a],r[a]))return!1}return!0}return e!=e&&r!=r}(this.options,r.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(r.instance.options)));return r.instance}r.instance=this}var n,o,i;return n=r,(o=[{key:"options",get:function(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}},{key:"status",get:function(){return this.errors.length?t.LoaderStatus.FAILURE:this.done?t.LoaderStatus.SUCCESS:this.loading?t.LoaderStatus.LOADING:t.LoaderStatus.INITIALIZED}},{key:"failed",get:function(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}},{key:"createUrl",value:function(){var t=this.url;return t+="?callback=".concat(this.CALLBACK),this.apiKey&&(t+="&key=".concat(this.apiKey)),this.channel&&(t+="&channel=".concat(this.channel)),this.client&&(t+="&client=".concat(this.client)),this.libraries.length>0&&(t+="&libraries=".concat(this.libraries.join(","))),this.language&&(t+="&language=".concat(this.language)),this.region&&(t+="®ion=".concat(this.region)),this.version&&(t+="&v=".concat(this.version)),this.mapIds&&(t+="&map_ids=".concat(this.mapIds.join(","))),this.authReferrerPolicy&&(t+="&auth_referrer_policy=".concat(this.authReferrerPolicy)),t}},{key:"deleteScript",value:function(){var t=document.getElementById(this.id);t&&t.remove()}},{key:"load",value:function(){return this.loadPromise()}},{key:"loadPromise",value:function(){var t=this;return new Promise((function(e,r){t.loadCallback((function(t){t?r(t.error):e(window.google)}))}))}},{key:"loadCallback",value:function(t){this.callbacks.push(t),this.execute()}},{key:"setScript",value:function(){if(document.getElementById(this.id))this.callback();else{var t=this.createUrl(),e=document.createElement("script");e.id=this.id,e.type="text/javascript",e.src=t,e.onerror=this.loadErrorCallback.bind(this),e.defer=!0,e.async=!0,this.nonce&&(e.nonce=this.nonce),document.head.appendChild(e)}}},{key:"reset",value:function(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}},{key:"resetIfRetryingFailed",value:function(){this.failed&&this.reset()}},{key:"loadErrorCallback",value:function(t){var e=this;if(this.errors.push(t),this.errors.length<=this.retries){var r=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in ".concat(r," ms.")),setTimeout((function(){e.deleteScript(),e.setScript()}),r)}else this.onerrorEvent=t,this.callback()}},{key:"setCallback",value:function(){window.__googleMapsCallback=this.callback.bind(this)}},{key:"callback",value:function(){var t=this;this.done=!0,this.loading=!1,this.callbacks.forEach((function(e){e(t.onerrorEvent)})),this.callbacks=[]}},{key:"execute",value:function(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}])&&e(n.prototype,o),i&&e(n,i),r}();return t.DEFAULT_ID=df,t.Loader=vf,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); 2 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/dist/index.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/dist/index.umd.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).google=t.google||{},t.google.maps=t.google.maps||{},t.google.maps.plugins=t.google.maps.plugins||{},t.google.maps.plugins.loader={}))}(this,(function(t){"use strict";function e(t,e){for(var r=0;r0&&y[0]<4?1:+(y[0]+y[1])),!g&&$&&(!(y=$.match(/Edge\/(\d+)/))||y[1]>=74)&&(y=$.match(/Chrome\/(\d+)/))&&(g=+y[1]);var et=g,rt=et,nt=a,ot=!!Object.getOwnPropertySymbols&&!nt((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),it=ot&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,at=H,ct=G,ut=q,st=it,ft=o.Object,lt=st?function(t){return"symbol"==typeof t}:function(t){var e=at("Symbol");return ct(e)&&ut(e.prototype,ft(t))},ht=o.String,pt=function(t){try{return ht(t)}catch(t){return"Object"}},dt=G,vt=pt,yt=o.TypeError,gt=function(t){if(dt(t))return t;throw yt(vt(t)+" is not a function")},bt=gt,mt=function(t,e){var r=t[e];return null==r?void 0:bt(r)},St=l,wt=G,Ot=K,jt=o.TypeError,Et={exports:{}},Tt=o,Lt=Object.defineProperty,Pt=function(t,e){try{Lt(Tt,t,{value:e,configurable:!0,writable:!0})}catch(r){Tt[t]=e}return e},Ct=Pt,kt="__core-js_shared__",It=o[kt]||Ct(kt,{}),Rt=It;(Et.exports=function(t,e){return Rt[t]||(Rt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE",source:"https://github.com/zloirock/core-js"});var At=_,xt=o.Object,Nt=function(t){return xt(At(t))},Mt=Nt,_t=E({}.hasOwnProperty),Ft=Object.hasOwn||function(t,e){return _t(Mt(t),e)},Dt=E,Ut=0,Gt=Math.random(),Bt=Dt(1..toString),Kt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Bt(++Ut+Gt,36)},Vt=o,zt=Et.exports,Jt=Ft,Ht=Kt,qt=ot,Wt=it,Zt=zt("wks"),$t=Vt.Symbol,Xt=$t&&$t.for,Yt=Wt?$t:$t&&$t.withoutSetter||Ht,Qt=function(t){if(!Jt(Zt,t)||!qt&&"string"!=typeof Zt[t]){var e="Symbol."+t;qt&&Jt($t,t)?Zt[t]=$t[t]:Zt[t]=Wt&&Xt?Xt(e):Yt(e)}return Zt[t]},te=l,ee=K,re=lt,ne=mt,oe=function(t,e){var r,n;if("string"===e&&wt(r=t.toString)&&!Ot(n=St(r,t)))return n;if(wt(r=t.valueOf)&&!Ot(n=St(r,t)))return n;if("string"!==e&&wt(r=t.toString)&&!Ot(n=St(r,t)))return n;throw jt("Can't convert object to primitive value")},ie=Qt,ae=o.TypeError,ce=ie("toPrimitive"),ue=function(t,e){if(!ee(t)||re(t))return t;var r,n=ne(t,ce);if(n){if(void 0===e&&(e="default"),r=te(n,t,e),!ee(r)||re(r))return r;throw ae("Can't convert object to primitive value")}return void 0===e&&(e="number"),oe(t,e)},se=lt,fe=function(t){var e=ue(t,"string");return se(e)?e:e+""},le=K,he=o.document,pe=le(he)&&le(he.createElement),de=function(t){return pe?he.createElement(t):{}},ve=de,ye=!c&&!a((function(){return 7!=Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),ge=c,be=l,me=h,Se=b,we=U,Oe=fe,je=Ft,Ee=ye,Te=Object.getOwnPropertyDescriptor;i.f=ge?Te:function(t,e){if(t=we(t),e=Oe(e),Ee)try{return Te(t,e)}catch(t){}if(je(t,e))return Se(!be(me.f,t,e),t[e])};var Le={},Pe=c&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ce=o,ke=K,Ie=Ce.String,Re=Ce.TypeError,Ae=function(t){if(ke(t))return t;throw Re(Ie(t)+" is not an object")},xe=c,Ne=ye,Me=Pe,_e=Ae,Fe=fe,De=o.TypeError,Ue=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,Be="enumerable",Ke="configurable",Ve="writable";Le.f=xe?Me?function(t,e,r){if(_e(t),e=Fe(e),_e(r),"function"==typeof t&&"prototype"===e&&"value"in r&&Ve in r&&!r.writable){var n=Ge(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:Ke in r?r.configurable:n.configurable,enumerable:Be in r?r.enumerable:n.enumerable,writable:!1})}return Ue(t,e,r)}:Ue:function(t,e,r){if(_e(t),e=Fe(e),_e(r),Ne)try{return Ue(t,e,r)}catch(t){}if("get"in r||"set"in r)throw De("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var ze=Le,Je=b,He=c?function(t,e,r){return ze.f(t,e,Je(1,r))}:function(t,e,r){return t[e]=r,t},qe={exports:{}},We=c,Ze=Ft,$e=Function.prototype,Xe=We&&Object.getOwnPropertyDescriptor,Ye=Ze($e,"name"),Qe={EXISTS:Ye,PROPER:Ye&&"something"===function(){}.name,CONFIGURABLE:Ye&&(!We||We&&Xe($e,"name").configurable)},tr=G,er=It,rr=E(Function.toString);tr(er.inspectSource)||(er.inspectSource=function(t){return rr(t)});var nr,or,ir,ar=er.inspectSource,cr=G,ur=ar,sr=o.WeakMap,fr=cr(sr)&&/native code/.test(ur(sr)),lr=Et.exports,hr=Kt,pr=lr("keys"),dr={},vr=fr,yr=o,gr=E,br=K,mr=He,Sr=Ft,wr=It,Or=function(t){return pr[t]||(pr[t]=hr(t))},jr=dr,Er="Object already initialized",Tr=yr.TypeError,Lr=yr.WeakMap;if(vr||wr.state){var Pr=wr.state||(wr.state=new Lr),Cr=gr(Pr.get),kr=gr(Pr.has),Ir=gr(Pr.set);nr=function(t,e){if(kr(Pr,t))throw new Tr(Er);return e.facade=t,Ir(Pr,t,e),e},or=function(t){return Cr(Pr,t)||{}},ir=function(t){return kr(Pr,t)}}else{var Rr=Or("state");jr[Rr]=!0,nr=function(t,e){if(Sr(t,Rr))throw new Tr(Er);return e.facade=t,mr(t,Rr,e),e},or=function(t){return Sr(t,Rr)?t[Rr]:{}},ir=function(t){return Sr(t,Rr)}}var Ar={set:nr,get:or,has:ir,enforce:function(t){return ir(t)?or(t):nr(t,{})},getterFor:function(t){return function(e){var r;if(!br(e)||(r=or(e)).type!==t)throw Tr("Incompatible receiver, "+t+" required");return r}}},xr=a,Nr=G,Mr=Ft,_r=Le.f,Fr=Qe.CONFIGURABLE,Dr=ar,Ur=Ar.enforce,Gr=Ar.get,Br=!xr((function(){return 8!==_r((function(){}),"length",{value:8}).length})),Kr=String(String).split("String"),Vr=qe.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Mr(t,"name")||Fr&&t.name!==e)&&_r(t,"name",{value:e,configurable:!0}),Br&&r&&Mr(r,"arity")&&t.length!==r.arity&&_r(t,"length",{value:r.arity});var n=Ur(t);return Mr(n,"source")||(n.source=Kr.join("string"==typeof e?e:"")),t};Function.prototype.toString=Vr((function(){return Nr(this)&&Gr(this).source||Dr(this)}),"toString");var zr=o,Jr=G,Hr=He,qr=qe.exports,Wr=Pt,Zr=function(t,e,r,n){var o=!!n&&!!n.unsafe,i=!!n&&!!n.enumerable,a=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:e;return Jr(r)&&qr(r,c,n),t===zr?(i?t[e]=r:Wr(e,r),t):(o?!a&&t[e]&&(i=!0):delete t[e],i?t[e]=r:Hr(t,e,r),t)},$r={},Xr=Math.ceil,Yr=Math.floor,Qr=function(t){var e=+t;return e!=e||0===e?0:(e>0?Yr:Xr)(e)},tn=Qr,en=Math.max,rn=Math.min,nn=Qr,on=Math.min,an=function(t){return t>0?on(nn(t),9007199254740991):0},cn=function(t){return an(t.length)},un=U,sn=function(t,e){var r=tn(t);return r<0?en(r+e,0):rn(r,e)},fn=cn,ln=function(t){return function(e,r,n){var o,i=un(e),a=fn(i),c=sn(n,a);if(t&&r!=r){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},hn={includes:ln(!0),indexOf:ln(!1)},pn=Ft,dn=U,vn=hn.indexOf,yn=dr,gn=E([].push),bn=function(t,e){var r,n=dn(t),o=0,i=[];for(r in n)!pn(yn,r)&&pn(n,r)&&gn(i,r);for(;e.length>o;)pn(n,r=e[o++])&&(~vn(i,r)||gn(i,r));return i},mn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");$r.f=Object.getOwnPropertyNames||function(t){return bn(t,mn)};var Sn={};Sn.f=Object.getOwnPropertySymbols;var wn=H,On=$r,jn=Sn,En=Ae,Tn=E([].concat),Ln=wn("Reflect","ownKeys")||function(t){var e=On.f(En(t)),r=jn.f;return r?Tn(e,r(t)):e},Pn=Ft,Cn=Ln,kn=i,In=Le,Rn=a,An=G,xn=/#|\.prototype\./,Nn=function(t,e){var r=_n[Mn(t)];return r==Dn||r!=Fn&&(An(e)?Rn(e):!!e)},Mn=Nn.normalize=function(t){return String(t).replace(xn,".").toLowerCase()},_n=Nn.data={},Fn=Nn.NATIVE="N",Dn=Nn.POLYFILL="P",Un=Nn,Gn=o,Bn=i.f,Kn=He,Vn=Zr,zn=Pt,Jn=function(t,e,r){for(var n=Cn(e),o=In.f,i=kn.f,a=0;a=51||!Ao((function(){var e=[];return(e.constructor={})[No]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Jo=et,Ho=Qt("isConcatSpreadable"),qo=9007199254740991,Wo="Maximum allowed index exceeded",Zo=_o.TypeError,$o=Jo>=51||!Fo((function(){var t=[];return t[Ho]=!1,t.concat()[0]!==t})),Xo=zo("concat"),Yo=function(t){if(!Uo(t))return!1;var e=t[Ho];return void 0!==e?!!e:Do(t)};Mo({target:"Array",proto:!0,arity:1,forced:!$o||!Xo},{concat:function(t){var e,r,n,o,i,a=Go(this),c=Vo(a,0),u=0;for(e=-1,n=arguments.length;eqo)throw Zo(Wo);for(r=0;r=qo)throw Zo(Wo);Ko(c,u++,i)}return c.length=u,c}});var Qo=u,ti=Function.prototype,ei=ti.apply,ri=ti.call,ni="object"==typeof Reflect&&Reflect.apply||(Qo?ri.bind(ei):function(){return ri.apply(ei,arguments)}),oi=E([].slice),ii=qn,ai=H,ci=ni,ui=l,si=E,fi=a,li=Zn,hi=G,pi=K,di=lt,vi=oi,yi=ot,gi=ai("JSON","stringify"),bi=si(/./.exec),mi=si("".charAt),Si=si("".charCodeAt),wi=si("".replace),Oi=si(1..toString),ji=/[\uD800-\uDFFF]/g,Ei=/^[\uD800-\uDBFF]$/,Ti=/^[\uDC00-\uDFFF]$/,Li=!yi||fi((function(){var t=ai("Symbol")();return"[null]"!=gi([t])||"{}"!=gi({a:t})||"{}"!=gi(Object(t))})),Pi=fi((function(){return'"\\udf06\\ud834"'!==gi("\udf06\ud834")||'"\\udead"'!==gi("\udead")})),Ci=function(t,e){var r=vi(arguments),n=e;if((pi(e)||void 0!==t)&&!di(t))return li(e)||(e=function(t,e){if(hi(n)&&(e=ui(n,this,t,e)),!di(e))return e}),r[1]=e,ci(gi,null,r)},ki=function(t,e,r){var n=mi(r,e-1),o=mi(r,e+1);return bi(Ei,t)&&!bi(Ti,o)||bi(Ti,t)&&!bi(Ei,n)?"\\u"+Oi(Si(t,0),16):t};gi&&ii({target:"JSON",stat:!0,arity:3,forced:Li||Pi},{stringify:function(t,e,r){var n=vi(arguments),o=ci(Li?Ci:gi,null,n);return Pi&&"string"==typeof o?wi(o,ji,ki):o}});var Ii=a,Ri=function(t,e){var r=[][t];return!!r&&Ii((function(){r.call(null,e||function(){return 1},1)}))},Ai=qn,xi=N,Ni=U,Mi=Ri,_i=E([].join),Fi=xi!=Object,Di=Mi("join",",");Ai({target:"Array",proto:!0,forced:Fi||!Di},{join:function(t){return _i(Ni(this),void 0===t?",":t)}});var Ui=uo,Gi=to?{}.toString:function(){return"[object "+Ui(this)+"]"};to||Zr(Object.prototype,"toString",Gi,{unsafe:!0});var Bi,Ki,Vi,zi,Ji="process"==C(o.process),Hi=o,qi=G,Wi=Hi.String,Zi=Hi.TypeError,$i=E,Xi=Ae,Yi=function(t){if("object"==typeof t||qi(t))return t;throw Zi("Can't set "+Wi(t)+" as a prototype")},Qi=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=$i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Xi(r),Yi(n),e?t(r,n):r.__proto__=n,r}}():void 0),ta=Le.f,ea=Ft,ra=Qt("toStringTag"),na=H,oa=Le,ia=c,aa=Qt("species"),ca=q,ua=o.TypeError,sa=jo,fa=pt,la=o.TypeError,ha=Ae,pa=function(t){if(sa(t))return t;throw la(fa(t)+" is not a constructor")},da=Qt("species"),va=gt,ya=u,ga=E(E.bind),ba=function(t,e){return va(t),void 0===e?t:ya?ga(t,e):function(){return t.apply(e,arguments)}},ma=H("document","documentElement"),Sa=o.TypeError,wa=/(?:ipad|iphone|ipod).*applewebkit/i.test(W),Oa=o,ja=ni,Ea=ba,Ta=G,La=Ft,Pa=a,Ca=ma,ka=oi,Ia=de,Ra=function(t,e){if(t=51&&/native code/.test(t))return!1;var r=new Cc((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(r.constructor={})[Mc]=n,!(_c=r.then((function(){}))instanceof n)||!e&&xc&&!Fc})),REJECTION_EVENT:Fc,SUBCLASSING:_c},Uc={},Gc=gt,Bc=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=Gc(e),this.reject=Gc(r)};Uc.f=function(t){return new Bc(t)};var Kc,Vc,zc,Jc=qn,Hc=Ji,qc=o,Wc=l,Zc=Zr,$c=Qi,Xc=function(t,e,r){t&&!r&&(t=t.prototype),t&&!ea(t,ra)&&ta(t,ra,{configurable:!0,value:e})},Yc=function(t){var e=na(t),r=oa.f;ia&&e&&!e[aa]&&r(e,aa,{configurable:!0,get:function(){return this}})},Qc=gt,tu=G,eu=K,ru=function(t,e){if(ca(e,t))return t;throw ua("Incorrect invocation")},nu=function(t,e){var r,n=ha(t).constructor;return void 0===n||null==(r=ha(n)[da])?e:pa(r)},ou=rc.set,iu=Sc,au=function(t,e){var r=wc.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))},cu=Oc,uu=Ec,su=Ar,fu=Tc,lu=Uc,hu="Promise",pu=Dc.CONSTRUCTOR,du=Dc.REJECTION_EVENT,vu=Dc.SUBCLASSING,yu=su.getterFor(hu),gu=su.set,bu=fu&&fu.prototype,mu=fu,Su=bu,wu=qc.TypeError,Ou=qc.document,ju=qc.process,Eu=lu.f,Tu=Eu,Lu=!!(Ou&&Ou.createEvent&&qc.dispatchEvent),Pu="unhandledrejection",Cu=function(t){var e;return!(!eu(t)||!tu(e=t.then))&&e},ku=function(t,e){var r,n,o,i=e.value,a=1==e.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,f=t.domain;try{c?(a||(2===e.rejection&&Nu(e),e.rejection=1),!0===c?r=i:(f&&f.enter(),r=c(i),f&&(f.exit(),o=!0)),r===t.promise?s(wu("Promise-chain cycle")):(n=Cu(r))?Wc(n,r,u,s):u(r)):s(i)}catch(t){f&&!o&&f.exit(),s(t)}},Iu=function(t,e){t.notified||(t.notified=!0,iu((function(){for(var r,n=t.reactions;r=n.get();)ku(r,t);t.notified=!1,e&&!t.rejection&&Au(t)})))},Ru=function(t,e,r){var n,o;Lu?((n=Ou.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),qc.dispatchEvent(n)):n={promise:e,reason:r},!du&&(o=qc["on"+t])?o(n):t===Pu&&au("Unhandled promise rejection",r)},Au=function(t){Wc(ou,qc,(function(){var e,r=t.facade,n=t.value;if(xu(t)&&(e=cu((function(){Hc?ju.emit("unhandledRejection",n,r):Ru(Pu,r,n)})),t.rejection=Hc||xu(t)?2:1,e.error))throw e.value}))},xu=function(t){return 1!==t.rejection&&!t.parent},Nu=function(t){Wc(ou,qc,(function(){var e=t.facade;Hc?ju.emit("rejectionHandled",e):Ru("rejectionhandled",e,t.value)}))},Mu=function(t,e,r){return function(n){t(e,n,r)}},_u=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Iu(t,!0))},Fu=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw wu("Promise can't be resolved itself");var n=Cu(e);n?iu((function(){var r={done:!1};try{Wc(n,e,Mu(Fu,r,t),Mu(_u,r,t))}catch(e){_u(r,e,t)}})):(t.value=e,t.state=1,Iu(t,!1))}catch(e){_u({done:!1},e,t)}}};if(pu&&(Su=(mu=function(t){ru(this,Su),Qc(t),Wc(Kc,this);var e=yu(this);try{t(Mu(Fu,e),Mu(_u,e))}catch(t){_u(e,t)}}).prototype,(Kc=function(t){gu(this,{type:hu,done:!1,notified:!1,parent:!1,reactions:new uu,rejection:!1,state:0,value:void 0})}).prototype=Zc(Su,"then",(function(t,e){var r=yu(this),n=Eu(nu(this,mu));return r.parent=!0,n.ok=!tu(t)||t,n.fail=tu(e)&&e,n.domain=Hc?ju.domain:void 0,0==r.state?r.reactions.add(n):iu((function(){ku(n,r)})),n.promise})),Vc=function(){var t=new Kc,e=yu(t);this.promise=t,this.resolve=Mu(Fu,e),this.reject=Mu(_u,e)},lu.f=Eu=function(t){return t===mu||undefined===t?new Vc(t):Tu(t)},tu(fu)&&bu!==Object.prototype)){zc=bu.then,vu||Zc(bu,"then",(function(t,e){var r=this;return new mu((function(t,e){Wc(zc,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete bu.constructor}catch(t){}$c&&$c(bu,Su)}Jc({global:!0,wrap:!0,forced:pu},{Promise:mu}),Xc(mu,hu,!1),Yc(hu);var Du={},Uu=Du,Gu=Qt("iterator"),Bu=Array.prototype,Ku=uo,Vu=mt,zu=Du,Ju=Qt("iterator"),Hu=function(t){if(null!=t)return Vu(t,Ju)||Vu(t,"@@iterator")||zu[Ku(t)]},qu=l,Wu=gt,Zu=Ae,$u=pt,Xu=Hu,Yu=o.TypeError,Qu=l,ts=Ae,es=mt,rs=ba,ns=l,os=Ae,is=pt,as=function(t){return void 0!==t&&(Uu.Array===t||Bu[Gu]===t)},cs=cn,us=q,ss=function(t,e){var r=arguments.length<2?Xu(t):e;if(Wu(r))return Zu(qu(r,t));throw Yu($u(t)+" is not iterable")},fs=Hu,ls=function(t,e,r){var n,o;ts(t);try{if(!(n=es(t,"return"))){if("throw"===e)throw r;return r}n=Qu(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return ts(n),r},hs=o.TypeError,ps=function(t,e){this.stopped=t,this.result=e},ds=ps.prototype,vs=function(t,e,r){var n,o,i,a,c,u,s,f=r&&r.that,l=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),d=rs(e,f),v=function(t){return n&&ls(n,"normal",t),new ps(!0,t)},y=function(t){return l?(os(t),p?d(t[0],t[1],v):d(t[0],t[1])):p?d(t,v):d(t)};if(h)n=t;else{if(!(o=fs(t)))throw hs(is(t)+" is not iterable");if(as(o)){for(i=0,a=cs(t);a>i;i++)if((c=y(t[i]))&&us(ds,c))return c;return new ps(!1)}n=ss(t,o)}for(u=n.next;!(s=ns(u,n)).done;){try{c=y(s.value)}catch(t){ls(n,"throw",t)}if("object"==typeof c&&c&&us(ds,c))return c}return new ps(!1)},ys=Qt("iterator"),gs=!1;try{var bs=0,ms={next:function(){return{done:!!bs++}},return:function(){gs=!0}};ms[ys]=function(){return this},Array.from(ms,(function(){throw 2}))}catch(t){}var Ss=Tc,ws=Dc.CONSTRUCTOR||!function(t,e){if(!e&&!gs)return!1;var r=!1;try{var n={};n[ys]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r}((function(t){Ss.all(t).then(void 0,(function(){}))})),Os=l,js=gt,Es=Uc,Ts=Oc,Ls=vs;qn({target:"Promise",stat:!0,forced:ws},{all:function(t){var e=this,r=Es.f(e),n=r.resolve,o=r.reject,i=Ts((function(){var r=js(e.resolve),i=[],a=0,c=1;Ls(t,(function(t){var u=a++,s=!1;c++,Os(r,e,t).then((function(t){s||(s=!0,i[u]=t,--c||n(i))}),o)})),--c||n(i)}));return i.error&&o(i.value),r.promise}});var Ps=qn,Cs=Dc.CONSTRUCTOR,ks=Tc,Is=H,Rs=G,As=Zr,xs=ks&&ks.prototype;if(Ps({target:"Promise",proto:!0,forced:Cs,real:!0},{catch:function(t){return this.then(void 0,t)}}),Rs(ks)){var Ns=Is("Promise").prototype.catch;xs.catch!==Ns&&As(xs,"catch",Ns,{unsafe:!0})}var Ms=l,_s=gt,Fs=Uc,Ds=Oc,Us=vs;qn({target:"Promise",stat:!0,forced:ws},{race:function(t){var e=this,r=Fs.f(e),n=r.reject,o=Ds((function(){var o=_s(e.resolve);Us(t,(function(t){Ms(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var Gs=l,Bs=Uc;qn({target:"Promise",stat:!0,forced:Dc.CONSTRUCTOR},{reject:function(t){var e=Bs.f(this);return Gs(e.reject,void 0,t),e.promise}});var Ks=Ae,Vs=K,zs=Uc,Js=qn,Hs=Dc.CONSTRUCTOR,qs=function(t,e){if(Ks(t),Vs(e)&&e.constructor===t)return e;var r=zs.f(t);return(0,r.resolve)(e),r.promise};H("Promise"),Js({target:"Promise",stat:!0,forced:Hs},{resolve:function(t){return qs(this,t)}});var Ws=de("span").classList,Zs=Ws&&Ws.constructor&&Ws.constructor.prototype,$s=Zs===Object.prototype?void 0:Zs,Xs=ba,Ys=N,Qs=Nt,tf=cn,ef=Ro,rf=E([].push),nf=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,a=7==t,c=5==t||i;return function(u,s,f,l){for(var h,p,d=Qs(u),v=Ys(d),y=Xs(s,f),g=tf(v),b=0,m=l||ef,S=e?m(u,g):r||a?m(u,0):void 0;g>b;b++)if((c||b in v)&&(p=y(h=v[b],b,d),t))if(e)S[b]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return b;case 2:rf(S,h)}else switch(t){case 4:return!1;case 7:rf(S,h)}return i?-1:n||o?o:S}},of={forEach:nf(0),map:nf(1),filter:nf(2),some:nf(3),every:nf(4),find:nf(5),findIndex:nf(6),filterReject:nf(7)}.forEach,af=o,cf={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},uf=$s,sf=Ri("forEach")?[].forEach:function(t){return of(this,t,arguments.length>1?arguments[1]:void 0)},ff=He,lf=function(t){if(t&&t.forEach!==sf)try{ff(t,"forEach",sf)}catch(e){t.forEach=sf}};for(var hf in cf)cf[hf]&&lf(af[hf]&&af[hf].prototype);lf(uf);var pf,df="__googleMapsScriptId";t.LoaderStatus=void 0,(pf=t.LoaderStatus||(t.LoaderStatus={}))[pf.INITIALIZED=0]="INITIALIZED",pf[pf.LOADING=1]="LOADING",pf[pf.SUCCESS=2]="SUCCESS",pf[pf.FAILURE=3]="FAILURE";var vf=function(){function r(t){var e=t.apiKey,n=t.authReferrerPolicy,o=t.channel,i=t.client,a=t.id,c=void 0===a?df:a,u=t.language,s=t.libraries,f=void 0===s?[]:s,l=t.mapIds,h=t.nonce,p=t.region,d=t.retries,v=void 0===d?3:d,y=t.url,g=void 0===y?"https://maps.googleapis.com/maps/api/js":y,b=t.version;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=n,this.channel=o,this.client=i,this.id=c||df,this.language=u,this.libraries=f,this.mapIds=l,this.nonce=h,this.region=p,this.retries=v,this.url=g,this.version=b,r.instance){if(!function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var a=i[o];if(!t(e[a],r[a]))return!1}return!0}return e!=e&&r!=r}(this.options,r.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(r.instance.options)));return r.instance}r.instance=this}var n,o,i;return n=r,(o=[{key:"options",get:function(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}},{key:"status",get:function(){return this.errors.length?t.LoaderStatus.FAILURE:this.done?t.LoaderStatus.SUCCESS:this.loading?t.LoaderStatus.LOADING:t.LoaderStatus.INITIALIZED}},{key:"failed",get:function(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}},{key:"createUrl",value:function(){var t=this.url;return t+="?callback=".concat(this.CALLBACK),this.apiKey&&(t+="&key=".concat(this.apiKey)),this.channel&&(t+="&channel=".concat(this.channel)),this.client&&(t+="&client=".concat(this.client)),this.libraries.length>0&&(t+="&libraries=".concat(this.libraries.join(","))),this.language&&(t+="&language=".concat(this.language)),this.region&&(t+="®ion=".concat(this.region)),this.version&&(t+="&v=".concat(this.version)),this.mapIds&&(t+="&map_ids=".concat(this.mapIds.join(","))),this.authReferrerPolicy&&(t+="&auth_referrer_policy=".concat(this.authReferrerPolicy)),t}},{key:"deleteScript",value:function(){var t=document.getElementById(this.id);t&&t.remove()}},{key:"load",value:function(){return this.loadPromise()}},{key:"loadPromise",value:function(){var t=this;return new Promise((function(e,r){t.loadCallback((function(t){t?r(t.error):e(window.google)}))}))}},{key:"loadCallback",value:function(t){this.callbacks.push(t),this.execute()}},{key:"setScript",value:function(){if(document.getElementById(this.id))this.callback();else{var t=this.createUrl(),e=document.createElement("script");e.id=this.id,e.type="text/javascript",e.src=t,e.onerror=this.loadErrorCallback.bind(this),e.defer=!0,e.async=!0,this.nonce&&(e.nonce=this.nonce),document.head.appendChild(e)}}},{key:"reset",value:function(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}},{key:"resetIfRetryingFailed",value:function(){this.failed&&this.reset()}},{key:"loadErrorCallback",value:function(t){var e=this;if(this.errors.push(t),this.errors.length<=this.retries){var r=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in ".concat(r," ms.")),setTimeout((function(){e.deleteScript(),e.setScript()}),r)}else this.onerrorEvent=t,this.callback()}},{key:"setCallback",value:function(){window.__googleMapsCallback=this.callback.bind(this)}},{key:"callback",value:function(){var t=this;this.done=!0,this.loading=!1,this.callbacks.forEach((function(e){e(t.onerrorEvent)})),this.callbacks=[]}},{key:"execute",value:function(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}])&&e(n.prototype,o),i&&e(n,i),r}();t.DEFAULT_ID=df,t.Loader=vf,Object.defineProperty(t,"__esModule",{value:!0})})); 2 | //# sourceMappingURL=index.umd.js.map 3 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@googlemaps/js-api-loader", 3 | "version": "1.15.1", 4 | "description": "Wrapper for the loading of Google Maps JavaScript API script in the browser", 5 | "keywords": [ 6 | "google", 7 | "maps" 8 | ], 9 | "homepage": "https://github.com/googlemaps/js-api-loader", 10 | "bugs": { 11 | "url": "https://github.com/googlemaps/js-api-loader/issues" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/googlemaps/js-api-loader.git" 16 | }, 17 | "license": "Apache-2.0", 18 | "author": "Justin Poehnelt", 19 | "main": "dist/index.umd.js", 20 | "unpkg": "dist/index.min.js", 21 | "module": "dist/index.esm.js", 22 | "types": "dist/index.d.ts", 23 | "files": [ 24 | "dist/", 25 | "src/" 26 | ], 27 | "scripts": { 28 | "docs": "typedoc src/index.ts && cp -r dist docs/dist && cp -r examples docs/examples", 29 | "format": "eslint . --fix", 30 | "lint": "eslint .", 31 | "prepare": "rm -rf dist && rollup -c", 32 | "test": "jest src/*", 33 | "test:e2e": "jest e2e/*" 34 | }, 35 | "dependencies": { 36 | "fast-deep-equal": "^3.1.3" 37 | }, 38 | "devDependencies": { 39 | "@babel/preset-env": "^7.9.5", 40 | "@babel/runtime-corejs3": "^7.9.2", 41 | "@rollup/plugin-babel": "^5.3.0", 42 | "@rollup/plugin-commonjs": "^22.0.0", 43 | "@rollup/plugin-node-resolve": "^13.0.0", 44 | "@rollup/plugin-typescript": "^8.3.0", 45 | "@types/google.maps": "^3.43.0", 46 | "@types/jest": "^27.0.1", 47 | "@types/selenium-webdriver": "^4.0.9", 48 | "@typescript-eslint/eslint-plugin": "^5.18.0", 49 | "@typescript-eslint/parser": "^5.18.0", 50 | "chromedriver": "^101.0.0", 51 | "core-js": "^3.6.4", 52 | "eslint": "^8.12.0", 53 | "eslint-config-prettier": "^8.5.0", 54 | "eslint-plugin-jest": "^26.1.3", 55 | "eslint-plugin-prettier": "^4.0.0", 56 | "geckodriver": "^3.0.1", 57 | "jest": "^26.6.3", 58 | "prettier": "^2.6.2", 59 | "rollup": "^2.4.0", 60 | "rollup-plugin-terser": "^7.0.0", 61 | "selenium-webdriver": "^4.0.0-alpha.7", 62 | "ts-jest": "^26.5.2", 63 | "typedoc": "^0.22.4", 64 | "typescript": "^4.2.2" 65 | }, 66 | "publishConfig": { 67 | "access": "public", 68 | "registry": "https://wombat-dressing-room.appspot.com" 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/src/index.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google LLC. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at. 7 | * 8 | * Http://www.apache.org/licenses/LICENSE-2.0. 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* eslint @typescript-eslint/no-explicit-any: 0 */ 17 | import { DEFAULT_ID, Loader, LoaderOptions, LoaderStatus } from "."; 18 | 19 | jest.useFakeTimers(); 20 | 21 | afterEach(() => { 22 | document.getElementsByTagName("html")[0].innerHTML = ""; 23 | delete Loader["instance"]; 24 | }); 25 | 26 | test.each([ 27 | [{}, "https://maps.googleapis.com/maps/api/js?callback=__googleMapsCallback"], 28 | [ 29 | { apiKey: "foo" }, 30 | "https://maps.googleapis.com/maps/api/js?callback=__googleMapsCallback&key=foo", 31 | ], 32 | [ 33 | { 34 | apiKey: "foo", 35 | version: "weekly", 36 | libraries: ["marker", "places"], 37 | language: "language", 38 | region: "region", 39 | }, 40 | "https://maps.googleapis.com/maps/api/js?callback=__googleMapsCallback&key=foo&libraries=marker,places&language=language®ion=region&v=weekly", 41 | ], 42 | [ 43 | { mapIds: ["foo", "bar"] }, 44 | "https://maps.googleapis.com/maps/api/js?callback=__googleMapsCallback&map_ids=foo,bar", 45 | ], 46 | [ 47 | { url: "https://example.com/js" }, 48 | "https://example.com/js?callback=__googleMapsCallback", 49 | ], 50 | [ 51 | { client: "bar", channel: "foo" }, 52 | "https://maps.googleapis.com/maps/api/js?callback=__googleMapsCallback&channel=foo&client=bar", 53 | ], 54 | [ 55 | { authReferrerPolicy: "origin" }, 56 | "https://maps.googleapis.com/maps/api/js?callback=__googleMapsCallback&auth_referrer_policy=origin", 57 | ], 58 | ])("createUrl is correct", (options: LoaderOptions, expected: string) => { 59 | const loader = new Loader(options); 60 | expect(loader.createUrl()).toEqual(expected); 61 | expect(loader.status).toBe(LoaderStatus.INITIALIZED); 62 | }); 63 | 64 | test("uses default id if empty string", () => { 65 | expect(new Loader({ apiKey: "foo", id: "" }).id).toBe(DEFAULT_ID); 66 | }); 67 | 68 | test("setScript adds a script to head with correct attributes", () => { 69 | const loader = new Loader({ apiKey: "foo" }); 70 | 71 | loader["setScript"](); 72 | 73 | const script = document.head.childNodes[0] as HTMLScriptElement; 74 | 75 | expect(script.id).toEqual(loader.id); 76 | expect(script.src).toEqual(loader.createUrl()); 77 | expect(script.defer).toBeTruthy(); 78 | expect(script.async).toBeTruthy(); 79 | expect(script.onerror).toBeTruthy(); 80 | expect(script.type).toEqual("text/javascript"); 81 | }); 82 | 83 | test("setScript does not add second script with same id", () => { 84 | new Loader({ apiKey: "foo", id: "bar" })["setScript"](); 85 | new Loader({ apiKey: "foo", id: "bar" })["setScript"](); 86 | 87 | expect(document.head.childNodes.length).toBe(1); 88 | }); 89 | 90 | test("setScript adds a script with id", () => { 91 | const loader = new Loader({ apiKey: "foo", id: "bar" }); 92 | loader["setScript"](); 93 | 94 | const script = document.head.childNodes[0] as HTMLScriptElement; 95 | expect(script.id).toEqual(loader.id); 96 | }); 97 | 98 | test("load should return a promise that resolves even if called twice", () => { 99 | const loader = new Loader({ apiKey: "foo" }); 100 | 101 | expect.assertions(1); 102 | const promise = Promise.all([loader.load(), loader.load()]).then(() => { 103 | expect(loader["done"]).toBeTruthy(); 104 | }); 105 | 106 | window.__googleMapsCallback(null); 107 | 108 | return promise; 109 | }); 110 | 111 | test("loadCallback callback should fire", () => { 112 | const loader = new Loader({ apiKey: "foo" }); 113 | 114 | expect.assertions(2); 115 | loader.loadCallback((e: Event) => { 116 | expect(loader["done"]).toBeTruthy(); 117 | expect(e).toBeUndefined(); 118 | }); 119 | 120 | window.__googleMapsCallback(null); 121 | }); 122 | 123 | test("script onerror should reject promise", async () => { 124 | const loader = new Loader({ apiKey: "foo", retries: 0 }); 125 | 126 | const rejection = expect(loader.load()).rejects.toBeInstanceOf(Error); 127 | 128 | loader["loadErrorCallback"]( 129 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 130 | ); 131 | 132 | await rejection; 133 | expect(loader["done"]).toBeTruthy(); 134 | expect(loader["loading"]).toBeFalsy(); 135 | expect(loader["errors"].length).toBe(1); 136 | expect(loader.status).toBe(LoaderStatus.FAILURE); 137 | }); 138 | 139 | test("script onerror should reject promise with multiple loaders", async () => { 140 | const loader = new Loader({ apiKey: "foo", retries: 0 }); 141 | const extraLoader = new Loader({ apiKey: "foo", retries: 0 }); 142 | 143 | let rejection = expect(loader.load()).rejects.toBeInstanceOf(Error); 144 | loader["loadErrorCallback"]( 145 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 146 | ); 147 | 148 | await rejection; 149 | expect(loader["done"]).toBeTruthy(); 150 | expect(loader["loading"]).toBeFalsy(); 151 | expect(loader["onerrorEvent"]).toBeInstanceOf(ErrorEvent); 152 | 153 | rejection = expect(extraLoader.load()).rejects.toBeInstanceOf(Error); 154 | loader["loadErrorCallback"]( 155 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 156 | ); 157 | 158 | await rejection; 159 | expect(extraLoader["done"]).toBeTruthy(); 160 | expect(extraLoader["loading"]).toBeFalsy(); 161 | }); 162 | 163 | test("script onerror should retry", async () => { 164 | const loader = new Loader({ apiKey: "foo", retries: 1 }); 165 | const deleteScript = jest.spyOn(loader, "deleteScript"); 166 | const rejection = expect(loader.load()).rejects.toBeInstanceOf(Error); 167 | // eslint-disable-next-line @typescript-eslint/no-empty-function 168 | console.log = jest.fn(); 169 | 170 | loader["loadErrorCallback"]( 171 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 172 | ); 173 | loader["loadErrorCallback"]( 174 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 175 | ); 176 | jest.runAllTimers(); 177 | 178 | await rejection; 179 | expect(loader["done"]).toBeTruthy(); 180 | expect(loader["loading"]).toBeFalsy(); 181 | expect(loader["errors"].length).toBe(2); 182 | expect(deleteScript).toHaveBeenCalledTimes(1); 183 | expect(console.log).toHaveBeenCalledTimes(loader.retries); 184 | }); 185 | 186 | test("script onerror should reset retry mechanism with next loader", async () => { 187 | const loader = new Loader({ apiKey: "foo", retries: 1 }); 188 | const deleteScript = jest.spyOn(loader, "deleteScript"); 189 | // eslint-disable-next-line @typescript-eslint/no-empty-function 190 | console.log = jest.fn(); 191 | 192 | let rejection = expect(loader.load()).rejects.toBeInstanceOf(Error); 193 | loader["loadErrorCallback"]( 194 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 195 | ); 196 | loader["loadErrorCallback"]( 197 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 198 | ); 199 | jest.runAllTimers(); 200 | await rejection; 201 | 202 | rejection = expect(loader.load()).rejects.toBeInstanceOf(Error); 203 | expect(loader["done"]).toBeFalsy(); 204 | expect(loader["loading"]).toBeTruthy(); 205 | expect(loader["errors"].length).toBe(0); 206 | 207 | loader["loadErrorCallback"]( 208 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 209 | ); 210 | loader["loadErrorCallback"]( 211 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 212 | ); 213 | jest.runAllTimers(); 214 | 215 | await rejection; 216 | expect(deleteScript).toHaveBeenCalledTimes(3); 217 | expect(console.log).toHaveBeenCalledTimes(loader.retries * 2); 218 | }); 219 | 220 | test("script onerror should not reset retry mechanism with parallel loaders", async () => { 221 | const loader = new Loader({ apiKey: "foo", retries: 1 }); 222 | const deleteScript = jest.spyOn(loader, "deleteScript"); 223 | // eslint-disable-next-line @typescript-eslint/no-empty-function 224 | console.log = jest.fn(); 225 | 226 | const rejection1 = expect(loader.load()).rejects.toBeInstanceOf(Error); 227 | const rejection2 = expect(loader.load()).rejects.toBeInstanceOf(Error); 228 | loader["loadErrorCallback"]( 229 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 230 | ); 231 | loader["loadErrorCallback"]( 232 | new ErrorEvent("ErrorEvent(", { error: new Error("") }) 233 | ); 234 | jest.runAllTimers(); 235 | 236 | await Promise.all([rejection1, rejection2]); 237 | expect(loader["done"]).toBeTruthy(); 238 | expect(loader["loading"]).toBeFalsy(); 239 | expect(loader["errors"].length).toBe(2); 240 | expect(deleteScript).toHaveBeenCalledTimes(1); 241 | expect(console.log).toHaveBeenCalledTimes(loader.retries); 242 | }); 243 | 244 | test("reset should clear state", () => { 245 | const loader = new Loader({ apiKey: "foo", retries: 0 }); 246 | const deleteScript = jest.spyOn(loader, "deleteScript"); 247 | 248 | loader["done"] = true; 249 | loader["loading"] = false; 250 | loader["errors"] = [new ErrorEvent("foo")]; 251 | 252 | loader["reset"](); 253 | 254 | expect(loader["done"]).toBeFalsy(); 255 | expect(loader["loading"]).toBeFalsy(); 256 | expect(loader["onerrorEvent"]).toBe(null); 257 | expect(deleteScript).toHaveBeenCalledTimes(1); 258 | }); 259 | 260 | test("failed getter should be correct", () => { 261 | const loader = new Loader({ apiKey: "foo", retries: 0 }); 262 | 263 | // initial 264 | expect(loader["failed"]).toBeFalsy(); 265 | 266 | // not done 267 | loader["done"] = false; 268 | loader["loading"] = false; 269 | loader["errors"] = [new ErrorEvent("foo")]; 270 | expect(loader["failed"]).toBeFalsy(); 271 | 272 | // still loading 273 | loader["done"] = false; 274 | loader["loading"] = true; 275 | loader["errors"] = [new ErrorEvent("foo")]; 276 | expect(loader["failed"]).toBeFalsy(); 277 | 278 | // no errors 279 | loader["done"] = true; 280 | loader["loading"] = false; 281 | loader["errors"] = []; 282 | expect(loader["failed"]).toBeFalsy(); 283 | 284 | // done with errors 285 | loader["done"] = true; 286 | loader["loading"] = false; 287 | loader["errors"] = [new ErrorEvent("foo")]; 288 | expect(loader["failed"]).toBeTruthy(); 289 | }); 290 | 291 | test("loader should not reset retry mechanism if successfully loaded", () => { 292 | const loader = new Loader({ apiKey: "foo", retries: 0 }); 293 | const deleteScript = jest.spyOn(loader, "deleteScript"); 294 | 295 | loader["done"] = true; 296 | expect(loader.load()).resolves.toBeUndefined(); 297 | 298 | expect(loader["done"]).toBeTruthy(); 299 | expect(loader["loading"]).toBeFalsy(); 300 | expect(deleteScript).toHaveBeenCalledTimes(0); 301 | }); 302 | 303 | test("singleton should be used", () => { 304 | const loader = new Loader({ apiKey: "foo" }); 305 | const extraLoader = new Loader({ apiKey: "foo" }); 306 | expect(extraLoader).toBe(loader); 307 | 308 | loader["done"] = true; 309 | expect(extraLoader["done"]).toBe(loader["done"]); 310 | expect(loader.status).toBe(LoaderStatus.SUCCESS); 311 | }); 312 | 313 | test("singleton should throw with different options", () => { 314 | new Loader({ apiKey: "foo" }); 315 | expect(() => { 316 | new Loader({ apiKey: "bar" }); 317 | }).toThrowError(); 318 | }); 319 | 320 | test("loader should resolve immediately when successfully loaded", async () => { 321 | // use await/async pattern since the promise resolves without trigger 322 | const loader = new Loader({ apiKey: "foo", retries: 0 }); 323 | loader["done"] = true; 324 | // TODO causes warning 325 | window.google = { maps: { version: "3.*.*" } as any }; 326 | await expect(loader.loadPromise()).resolves.toBeDefined(); 327 | }); 328 | 329 | test("loader should resolve immediately when failed loading", async () => { 330 | // use await/async pattern since the promise rejects without trigger 331 | const loader = new Loader({ apiKey: "foo", retries: 0 }); 332 | loader["done"] = true; 333 | loader["onerrorEvent"] = new ErrorEvent("ErrorEvent(", { 334 | error: new Error(""), 335 | }); 336 | 337 | await expect(loader.loadPromise()).rejects.toBeDefined(); 338 | }); 339 | 340 | test("loader should wait if already loading", () => { 341 | const loader = new Loader({ apiKey: "foo", retries: 0 }); 342 | loader["loading"] = true; 343 | expect(loader.status).toBe(LoaderStatus.LOADING); 344 | loader.load(); 345 | }); 346 | 347 | test("setScript adds a nonce", () => { 348 | const nonce = "bar"; 349 | const loader = new Loader({ apiKey: "foo", nonce }); 350 | loader["setScript"](); 351 | const script = document.head.childNodes[0] as HTMLScriptElement; 352 | expect(script.nonce).toBe(nonce); 353 | }); 354 | 355 | test("loader should resolve immediately when google.maps defined", async () => { 356 | const loader = new Loader({ apiKey: "foo" }); 357 | window.google = { maps: { version: "3.*.*" } as any }; 358 | console.warn = jest.fn(); 359 | await expect(loader.loadPromise()).resolves.toBeDefined(); 360 | delete window.google; 361 | expect(console.warn).toHaveBeenCalledTimes(1); 362 | }); 363 | 364 | test("loader should not warn if done and google.maps is defined", async () => { 365 | const loader = new Loader({ apiKey: "foo" }); 366 | loader["done"] = true; 367 | window.google = { maps: { version: "3.*.*" } as any }; 368 | console.warn = jest.fn(); 369 | await expect(loader.loadPromise()).resolves.toBeDefined(); 370 | delete window.google; 371 | expect(console.warn).toHaveBeenCalledTimes(0); 372 | }); 373 | 374 | test("deleteScript removes script tag from head", () => { 375 | const loader = new Loader({ apiKey: "foo" }); 376 | loader["setScript"](); 377 | expect(document.head.childNodes.length).toBe(1); 378 | loader.deleteScript(); 379 | expect(document.head.childNodes.length).toBe(0); 380 | // should work without script existing 381 | loader.deleteScript(); 382 | expect(document.head.childNodes.length).toBe(0); 383 | }); 384 | -------------------------------------------------------------------------------- /node_modules/@googlemaps/js-api-loader/src/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google LLC. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at. 7 | * 8 | * Http://www.apache.org/licenses/LICENSE-2.0. 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import isEqual from "fast-deep-equal"; 18 | 19 | /** 20 | * @ignore 21 | */ 22 | declare global { 23 | interface Window { 24 | __googleMapsCallback: (e: Event) => void; 25 | } 26 | } 27 | 28 | export const DEFAULT_ID = "__googleMapsScriptId"; 29 | 30 | export type Libraries = ( 31 | | "drawing" 32 | | "geometry" 33 | | "localContext" 34 | | "marker" 35 | | "places" 36 | | "visualization" 37 | )[]; 38 | 39 | /** 40 | * The Google Maps JavaScript API 41 | * [documentation](https://developers.google.com/maps/documentation/javascript/tutorial) 42 | * is the authoritative source for [[LoaderOptions]]. 43 | /** 44 | * Loader options 45 | */ 46 | export interface LoaderOptions { 47 | /** 48 | * See https://developers.google.com/maps/documentation/javascript/get-api-key. 49 | */ 50 | apiKey: string; 51 | /** 52 | * @deprecated See https://developers.google.com/maps/premium/overview. 53 | */ 54 | channel?: string; 55 | /** 56 | * @deprecated See https://developers.google.com/maps/premium/overview, use `apiKey` instead. 57 | */ 58 | client?: string; 59 | /** 60 | * In your application you can specify release channels or version numbers: 61 | * 62 | * The weekly version is specified with `version=weekly`. This version is 63 | * updated once per week, and is the most current. 64 | * 65 | * ``` 66 | * const loader = Loader({apiKey, version: 'weekly'}); 67 | * ``` 68 | * 69 | * The quarterly version is specified with `version=quarterly`. This version 70 | * is updated once per quarter, and is the most predictable. 71 | * 72 | * ``` 73 | * const loader = Loader({apiKey, version: 'quarterly'}); 74 | * ``` 75 | * 76 | * The version number is specified with `version=n.nn`. You can choose 77 | * `version=3.40`, `version=3.39`, or `version=3.38`. Version numbers are 78 | * updated once per quarter. 79 | * 80 | * ``` 81 | * const loader = Loader({apiKey, version: '3.40'}); 82 | * ``` 83 | * 84 | * If you do not explicitly specify a version, you will receive the 85 | * weekly version by default. 86 | */ 87 | version?: string; 88 | /** 89 | * The id of the script tag. Before adding a new script, the Loader will check for an existing one. 90 | */ 91 | id?: string; 92 | /** 93 | * When loading the Maps JavaScript API via the URL you may optionally load 94 | * additional libraries through use of the libraries URL parameter. Libraries 95 | * are modules of code that provide additional functionality to the main Maps 96 | * JavaScript API but are not loaded unless you specifically request them. 97 | * 98 | * ``` 99 | * const loader = Loader({ 100 | * apiKey, 101 | * libraries: ['drawing', 'geometry', 'places', 'visualization'], 102 | * }); 103 | * ``` 104 | * 105 | * Set the [list of libraries](https://developers.google.com/maps/documentation/javascript/libraries) for more options. 106 | */ 107 | libraries?: Libraries; 108 | /** 109 | * By default, the Maps JavaScript API uses the user's preferred language 110 | * setting as specified in the browser, when displaying textual information 111 | * such as the names for controls, copyright notices, driving directions and 112 | * labels on maps. In most cases, it's preferable to respect the browser 113 | * setting. However, if you want the Maps JavaScript API to ignore the 114 | * browser's language setting, you can force it to display information in a 115 | * particular language when loading the Maps JavaScript API code. 116 | * 117 | * For example, the following example localizes the language to Japan: 118 | * 119 | * ``` 120 | * const loader = Loader({apiKey, language: 'ja', region: 'JP'}); 121 | * ``` 122 | * 123 | * See the [list of supported 124 | * languages](https://developers.google.com/maps/faq#languagesupport). Note 125 | * that new languages are added often, so this list may not be exhaustive. 126 | * 127 | */ 128 | language?: string; 129 | /** 130 | * When you load the Maps JavaScript API from maps.googleapis.com it applies a 131 | * default bias for application behavior towards the United States. If you 132 | * want to alter your application to serve different map tiles or bias the 133 | * application (such as biasing geocoding results towards the region), you can 134 | * override this default behavior by adding a region parameter when loading 135 | * the Maps JavaScript API code. 136 | * 137 | * The region parameter accepts Unicode region subtag identifiers which 138 | * (generally) have a one-to-one mapping to country code Top-Level Domains 139 | * (ccTLDs). Most Unicode region identifiers are identical to ISO 3166-1 140 | * codes, with some notable exceptions. For example, Great Britain's ccTLD is 141 | * "uk" (corresponding to the domain .co.uk) while its region identifier is 142 | * "GB." 143 | * 144 | * For example, the following example localizes the map to the United Kingdom: 145 | * 146 | * ``` 147 | * const loader = Loader({apiKey, region: 'GB'}); 148 | * ``` 149 | */ 150 | region?: string; 151 | /** 152 | * @deprecated Passing `mapIds` is no longer required in the script tag. 153 | */ 154 | mapIds?: string[]; 155 | /** 156 | * Use a custom url and path to load the Google Maps API script. 157 | */ 158 | url?: string; 159 | /** 160 | * Use a cryptographic nonce attribute. 161 | */ 162 | nonce?: string; 163 | /** 164 | * The number of script load retries. 165 | */ 166 | retries?: number; 167 | /** 168 | * Maps JS customers can configure HTTP Referrer Restrictions in the Cloud 169 | * Console to limit which URLs are allowed to use a particular API Key. By 170 | * default, these restrictions can be configured to allow only certain paths 171 | * to use an API Key. If any URL on the same domain or origin may use the API 172 | * Key, you can set `auth_referrer_policy=origin` to limit the amount of data 173 | * sent when authorizing requests from the Maps JavaScript API. This is 174 | * available starting in version 3.46. When this parameter is specified and 175 | * HTTP Referrer Restrictions are enabled on Cloud Console, Maps JavaScript 176 | * API will only be able to load if there is an HTTP Referrer Restriction that 177 | * matches the current website's domain without a path specified. 178 | */ 179 | authReferrerPolicy?: "origin"; 180 | } 181 | 182 | /** 183 | * The status of the [[Loader]]. 184 | */ 185 | export enum LoaderStatus { 186 | INITIALIZED, 187 | LOADING, 188 | SUCCESS, 189 | FAILURE, 190 | } 191 | 192 | /** 193 | * [[Loader]] makes it easier to add Google Maps JavaScript API to your application 194 | * dynamically using 195 | * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). 196 | * It works by dynamically creating and appending a script node to the the 197 | * document head and wrapping the callback function so as to return a promise. 198 | * 199 | * ``` 200 | * const loader = new Loader({ 201 | * apiKey: "", 202 | * version: "weekly", 203 | * libraries: ["places"] 204 | * }); 205 | * 206 | * loader.load().then((google) => { 207 | * const map = new google.maps.Map(...) 208 | * }) 209 | * ``` 210 | */ 211 | export class Loader { 212 | private static instance: Loader; 213 | /** 214 | * See [[LoaderOptions.version]] 215 | */ 216 | public readonly version: string; 217 | /** 218 | * See [[LoaderOptions.apiKey]] 219 | */ 220 | public readonly apiKey: string; 221 | /** 222 | * See [[LoaderOptions.channel]] 223 | */ 224 | public readonly channel: string; 225 | /** 226 | * See [[LoaderOptions.client]] 227 | */ 228 | public readonly client: string; 229 | /** 230 | * See [[LoaderOptions.id]] 231 | */ 232 | public readonly id: string; 233 | /** 234 | * See [[LoaderOptions.libraries]] 235 | */ 236 | public readonly libraries: Libraries; 237 | /** 238 | * See [[LoaderOptions.language]] 239 | */ 240 | public readonly language: string; 241 | 242 | /** 243 | * See [[LoaderOptions.region]] 244 | */ 245 | public readonly region: string; 246 | 247 | /** 248 | * See [[LoaderOptions.mapIds]] 249 | */ 250 | public readonly mapIds: string[]; 251 | 252 | /** 253 | * See [[LoaderOptions.nonce]] 254 | */ 255 | public readonly nonce: string | null; 256 | 257 | /** 258 | * See [[LoaderOptions.retries]] 259 | */ 260 | public readonly retries: number; 261 | 262 | /** 263 | * See [[LoaderOptions.url]] 264 | */ 265 | public readonly url: string; 266 | /** 267 | * See [[LoaderOptions.authReferrerPolicy]] 268 | */ 269 | public readonly authReferrerPolicy: "origin"; 270 | 271 | private CALLBACK = "__googleMapsCallback"; 272 | private callbacks: ((e: ErrorEvent) => void)[] = []; 273 | private done = false; 274 | private loading = false; 275 | private onerrorEvent: ErrorEvent; 276 | private errors: ErrorEvent[] = []; 277 | 278 | /** 279 | * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set 280 | * using this library, instead the defaults are set by the Google Maps 281 | * JavaScript API server. 282 | * 283 | * ``` 284 | * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']}); 285 | * ``` 286 | */ 287 | constructor({ 288 | apiKey, 289 | authReferrerPolicy, 290 | channel, 291 | client, 292 | id = DEFAULT_ID, 293 | language, 294 | libraries = [], 295 | mapIds, 296 | nonce, 297 | region, 298 | retries = 3, 299 | url = "https://maps.googleapis.com/maps/api/js", 300 | version, 301 | }: LoaderOptions) { 302 | this.apiKey = apiKey; 303 | this.authReferrerPolicy = authReferrerPolicy; 304 | this.channel = channel; 305 | this.client = client; 306 | this.id = id || DEFAULT_ID; // Do not allow empty string 307 | this.language = language; 308 | this.libraries = libraries; 309 | this.mapIds = mapIds; 310 | this.nonce = nonce; 311 | this.region = region; 312 | this.retries = retries; 313 | this.url = url; 314 | this.version = version; 315 | 316 | if (Loader.instance) { 317 | if (!isEqual(this.options, Loader.instance.options)) { 318 | throw new Error( 319 | `Loader must not be called again with different options. ${JSON.stringify( 320 | this.options 321 | )} !== ${JSON.stringify(Loader.instance.options)}` 322 | ); 323 | } 324 | 325 | return Loader.instance; 326 | } 327 | 328 | Loader.instance = this; 329 | } 330 | 331 | public get options(): LoaderOptions { 332 | return { 333 | version: this.version, 334 | apiKey: this.apiKey, 335 | channel: this.channel, 336 | client: this.client, 337 | id: this.id, 338 | libraries: this.libraries, 339 | language: this.language, 340 | region: this.region, 341 | mapIds: this.mapIds, 342 | nonce: this.nonce, 343 | url: this.url, 344 | authReferrerPolicy: this.authReferrerPolicy, 345 | }; 346 | } 347 | 348 | public get status(): LoaderStatus { 349 | if (this.errors.length) { 350 | return LoaderStatus.FAILURE; 351 | } 352 | if (this.done) { 353 | return LoaderStatus.SUCCESS; 354 | } 355 | if (this.loading) { 356 | return LoaderStatus.LOADING; 357 | } 358 | return LoaderStatus.INITIALIZED; 359 | } 360 | 361 | private get failed(): boolean { 362 | return this.done && !this.loading && this.errors.length >= this.retries + 1; 363 | } 364 | 365 | /** 366 | * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]]. 367 | * 368 | * @ignore 369 | */ 370 | public createUrl(): string { 371 | let url = this.url; 372 | 373 | url += `?callback=${this.CALLBACK}`; 374 | 375 | if (this.apiKey) { 376 | url += `&key=${this.apiKey}`; 377 | } 378 | 379 | if (this.channel) { 380 | url += `&channel=${this.channel}`; 381 | } 382 | 383 | if (this.client) { 384 | url += `&client=${this.client}`; 385 | } 386 | 387 | if (this.libraries.length > 0) { 388 | url += `&libraries=${this.libraries.join(",")}`; 389 | } 390 | 391 | if (this.language) { 392 | url += `&language=${this.language}`; 393 | } 394 | 395 | if (this.region) { 396 | url += `®ion=${this.region}`; 397 | } 398 | 399 | if (this.version) { 400 | url += `&v=${this.version}`; 401 | } 402 | 403 | if (this.mapIds) { 404 | url += `&map_ids=${this.mapIds.join(",")}`; 405 | } 406 | 407 | if (this.authReferrerPolicy) { 408 | url += `&auth_referrer_policy=${this.authReferrerPolicy}`; 409 | } 410 | 411 | return url; 412 | } 413 | 414 | public deleteScript(): void { 415 | const script = document.getElementById(this.id); 416 | if (script) { 417 | script.remove(); 418 | } 419 | } 420 | 421 | /** 422 | * Load the Google Maps JavaScript API script and return a Promise. 423 | */ 424 | public load(): Promise { 425 | return this.loadPromise(); 426 | } 427 | 428 | /** 429 | * Load the Google Maps JavaScript API script and return a Promise. 430 | * 431 | * @ignore 432 | */ 433 | public loadPromise(): Promise { 434 | return new Promise((resolve, reject) => { 435 | this.loadCallback((err: ErrorEvent) => { 436 | if (!err) { 437 | resolve(window.google); 438 | } else { 439 | reject(err.error); 440 | } 441 | }); 442 | }); 443 | } 444 | 445 | /** 446 | * Load the Google Maps JavaScript API script with a callback. 447 | */ 448 | public loadCallback(fn: (e: ErrorEvent) => void): void { 449 | this.callbacks.push(fn); 450 | this.execute(); 451 | } 452 | 453 | /** 454 | * Set the script on document. 455 | */ 456 | private setScript(): void { 457 | if (document.getElementById(this.id)) { 458 | // TODO wrap onerror callback for cases where the script was loaded elsewhere 459 | this.callback(); 460 | return; 461 | } 462 | 463 | const url = this.createUrl(); 464 | const script = document.createElement("script"); 465 | script.id = this.id; 466 | script.type = "text/javascript"; 467 | script.src = url; 468 | script.onerror = this.loadErrorCallback.bind(this); 469 | script.defer = true; 470 | script.async = true; 471 | 472 | if (this.nonce) { 473 | script.nonce = this.nonce; 474 | } 475 | 476 | document.head.appendChild(script); 477 | } 478 | 479 | /** 480 | * Reset the loader state. 481 | */ 482 | private reset(): void { 483 | this.deleteScript(); 484 | this.done = false; 485 | this.loading = false; 486 | this.errors = []; 487 | this.onerrorEvent = null; 488 | } 489 | 490 | private resetIfRetryingFailed(): void { 491 | if (this.failed) { 492 | this.reset(); 493 | } 494 | } 495 | 496 | private loadErrorCallback(e: ErrorEvent): void { 497 | this.errors.push(e); 498 | 499 | if (this.errors.length <= this.retries) { 500 | const delay = this.errors.length * 2 ** this.errors.length; 501 | 502 | console.log( 503 | `Failed to load Google Maps script, retrying in ${delay} ms.` 504 | ); 505 | 506 | setTimeout(() => { 507 | this.deleteScript(); 508 | this.setScript(); 509 | }, delay); 510 | } else { 511 | this.onerrorEvent = e; 512 | this.callback(); 513 | } 514 | } 515 | 516 | private setCallback(): void { 517 | window.__googleMapsCallback = this.callback.bind(this); 518 | } 519 | 520 | private callback(): void { 521 | this.done = true; 522 | this.loading = false; 523 | 524 | this.callbacks.forEach((cb) => { 525 | cb(this.onerrorEvent); 526 | }); 527 | 528 | this.callbacks = []; 529 | } 530 | 531 | private execute(): void { 532 | this.resetIfRetryingFailed(); 533 | 534 | if (this.done) { 535 | this.callback(); 536 | } else { 537 | // short circuit and warn if google.maps is already loaded 538 | if (window.google && window.google.maps && window.google.maps.version) { 539 | console.warn( 540 | "Google Maps already loaded outside @googlemaps/js-api-loader." + 541 | "This may result in undesirable behavior as options and script parameters may not match." 542 | ); 543 | this.callback(); 544 | return; 545 | } 546 | 547 | if (this.loading) { 548 | // do nothing but wait 549 | } else { 550 | this.loading = true; 551 | this.setCallback(); 552 | this.setScript(); 553 | } 554 | } 555 | } 556 | } 557 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Evgeny Poberezkin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/README.md: -------------------------------------------------------------------------------- 1 | # fast-deep-equal 2 | The fastest deep equal with ES6 Map, Set and Typed arrays support. 3 | 4 | [![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal) 5 | [![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal) 6 | [![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master) 7 | 8 | 9 | ## Install 10 | 11 | ```bash 12 | npm install fast-deep-equal 13 | ``` 14 | 15 | 16 | ## Features 17 | 18 | - ES5 compatible 19 | - works in node.js (8+) and browsers (IE9+) 20 | - checks equality of Date and RegExp objects by value. 21 | 22 | ES6 equal (`require('fast-deep-equal/es6')`) also supports: 23 | - Maps 24 | - Sets 25 | - Typed arrays 26 | 27 | 28 | ## Usage 29 | 30 | ```javascript 31 | var equal = require('fast-deep-equal'); 32 | console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true 33 | ``` 34 | 35 | To support ES6 Maps, Sets and Typed arrays equality use: 36 | 37 | ```javascript 38 | var equal = require('fast-deep-equal/es6'); 39 | console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true 40 | ``` 41 | 42 | To use with React (avoiding the traversal of React elements' _owner 43 | property that contains circular references and is not needed when 44 | comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)): 45 | 46 | ```javascript 47 | var equal = require('fast-deep-equal/react'); 48 | var equal = require('fast-deep-equal/es6/react'); 49 | ``` 50 | 51 | 52 | ## Performance benchmark 53 | 54 | Node.js v12.6.0: 55 | 56 | ``` 57 | fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled) 58 | fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled) 59 | fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled) 60 | nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled) 61 | shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled) 62 | underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled) 63 | lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled) 64 | deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled) 65 | deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled) 66 | ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled) 67 | util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled) 68 | assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled) 69 | 70 | The fastest is fast-deep-equal 71 | ``` 72 | 73 | To run benchmark (requires node.js 6+): 74 | 75 | ```bash 76 | npm run benchmark 77 | ``` 78 | 79 | __Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application. 80 | 81 | 82 | ## Enterprise support 83 | 84 | fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. 85 | 86 | 87 | ## Security contact 88 | 89 | To report a security vulnerability, please use the 90 | [Tidelift security contact](https://tidelift.com/security). 91 | Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. 92 | 93 | 94 | ## License 95 | 96 | [MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE) 97 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/es6/index.d.ts: -------------------------------------------------------------------------------- 1 | declare const equal: (a: any, b: any) => boolean; 2 | export = equal; 3 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/es6/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // do not edit .js files directly - edit src/index.jst 4 | 5 | 6 | var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; 7 | 8 | 9 | module.exports = function equal(a, b) { 10 | if (a === b) return true; 11 | 12 | if (a && b && typeof a == 'object' && typeof b == 'object') { 13 | if (a.constructor !== b.constructor) return false; 14 | 15 | var length, i, keys; 16 | if (Array.isArray(a)) { 17 | length = a.length; 18 | if (length != b.length) return false; 19 | for (i = length; i-- !== 0;) 20 | if (!equal(a[i], b[i])) return false; 21 | return true; 22 | } 23 | 24 | 25 | if ((a instanceof Map) && (b instanceof Map)) { 26 | if (a.size !== b.size) return false; 27 | for (i of a.entries()) 28 | if (!b.has(i[0])) return false; 29 | for (i of a.entries()) 30 | if (!equal(i[1], b.get(i[0]))) return false; 31 | return true; 32 | } 33 | 34 | if ((a instanceof Set) && (b instanceof Set)) { 35 | if (a.size !== b.size) return false; 36 | for (i of a.entries()) 37 | if (!b.has(i[0])) return false; 38 | return true; 39 | } 40 | 41 | if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { 42 | length = a.length; 43 | if (length != b.length) return false; 44 | for (i = length; i-- !== 0;) 45 | if (a[i] !== b[i]) return false; 46 | return true; 47 | } 48 | 49 | 50 | if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 51 | if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 52 | if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 53 | 54 | keys = Object.keys(a); 55 | length = keys.length; 56 | if (length !== Object.keys(b).length) return false; 57 | 58 | for (i = length; i-- !== 0;) 59 | if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 60 | 61 | for (i = length; i-- !== 0;) { 62 | var key = keys[i]; 63 | 64 | if (!equal(a[key], b[key])) return false; 65 | } 66 | 67 | return true; 68 | } 69 | 70 | // true if both NaN, false otherwise 71 | return a!==a && b!==b; 72 | }; 73 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/es6/react.d.ts: -------------------------------------------------------------------------------- 1 | declare const equal: (a: any, b: any) => boolean; 2 | export = equal; 3 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/es6/react.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // do not edit .js files directly - edit src/index.jst 4 | 5 | 6 | var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; 7 | 8 | 9 | module.exports = function equal(a, b) { 10 | if (a === b) return true; 11 | 12 | if (a && b && typeof a == 'object' && typeof b == 'object') { 13 | if (a.constructor !== b.constructor) return false; 14 | 15 | var length, i, keys; 16 | if (Array.isArray(a)) { 17 | length = a.length; 18 | if (length != b.length) return false; 19 | for (i = length; i-- !== 0;) 20 | if (!equal(a[i], b[i])) return false; 21 | return true; 22 | } 23 | 24 | 25 | if ((a instanceof Map) && (b instanceof Map)) { 26 | if (a.size !== b.size) return false; 27 | for (i of a.entries()) 28 | if (!b.has(i[0])) return false; 29 | for (i of a.entries()) 30 | if (!equal(i[1], b.get(i[0]))) return false; 31 | return true; 32 | } 33 | 34 | if ((a instanceof Set) && (b instanceof Set)) { 35 | if (a.size !== b.size) return false; 36 | for (i of a.entries()) 37 | if (!b.has(i[0])) return false; 38 | return true; 39 | } 40 | 41 | if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { 42 | length = a.length; 43 | if (length != b.length) return false; 44 | for (i = length; i-- !== 0;) 45 | if (a[i] !== b[i]) return false; 46 | return true; 47 | } 48 | 49 | 50 | if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 51 | if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 52 | if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 53 | 54 | keys = Object.keys(a); 55 | length = keys.length; 56 | if (length !== Object.keys(b).length) return false; 57 | 58 | for (i = length; i-- !== 0;) 59 | if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 60 | 61 | for (i = length; i-- !== 0;) { 62 | var key = keys[i]; 63 | 64 | if (key === '_owner' && a.$$typeof) { 65 | // React-specific: avoid traversing React elements' _owner. 66 | // _owner contains circular references 67 | // and is not needed when comparing the actual elements (and not their owners) 68 | continue; 69 | } 70 | 71 | if (!equal(a[key], b[key])) return false; 72 | } 73 | 74 | return true; 75 | } 76 | 77 | // true if both NaN, false otherwise 78 | return a!==a && b!==b; 79 | }; 80 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'fast-deep-equal' { 2 | const equal: (a: any, b: any) => boolean; 3 | export = equal; 4 | } 5 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // do not edit .js files directly - edit src/index.jst 4 | 5 | 6 | 7 | module.exports = function equal(a, b) { 8 | if (a === b) return true; 9 | 10 | if (a && b && typeof a == 'object' && typeof b == 'object') { 11 | if (a.constructor !== b.constructor) return false; 12 | 13 | var length, i, keys; 14 | if (Array.isArray(a)) { 15 | length = a.length; 16 | if (length != b.length) return false; 17 | for (i = length; i-- !== 0;) 18 | if (!equal(a[i], b[i])) return false; 19 | return true; 20 | } 21 | 22 | 23 | 24 | if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 25 | if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 26 | if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 27 | 28 | keys = Object.keys(a); 29 | length = keys.length; 30 | if (length !== Object.keys(b).length) return false; 31 | 32 | for (i = length; i-- !== 0;) 33 | if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 34 | 35 | for (i = length; i-- !== 0;) { 36 | var key = keys[i]; 37 | 38 | if (!equal(a[key], b[key])) return false; 39 | } 40 | 41 | return true; 42 | } 43 | 44 | // true if both NaN, false otherwise 45 | return a!==a && b!==b; 46 | }; 47 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fast-deep-equal", 3 | "version": "3.1.3", 4 | "description": "Fast deep equal", 5 | "main": "index.js", 6 | "scripts": { 7 | "eslint": "eslint *.js benchmark/*.js spec/*.js", 8 | "build": "node build", 9 | "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./", 10 | "test-spec": "mocha spec/*.spec.js -R spec", 11 | "test-cov": "nyc npm run test-spec", 12 | "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts", 13 | "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov", 14 | "prepublish": "npm run build" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" 19 | }, 20 | "keywords": [ 21 | "fast", 22 | "equal", 23 | "deep-equal" 24 | ], 25 | "author": "Evgeny Poberezkin", 26 | "license": "MIT", 27 | "bugs": { 28 | "url": "https://github.com/epoberezkin/fast-deep-equal/issues" 29 | }, 30 | "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", 31 | "devDependencies": { 32 | "coveralls": "^3.1.0", 33 | "dot": "^1.1.2", 34 | "eslint": "^7.2.0", 35 | "mocha": "^7.2.0", 36 | "nyc": "^15.1.0", 37 | "pre-commit": "^1.2.2", 38 | "react": "^16.12.0", 39 | "react-test-renderer": "^16.12.0", 40 | "sinon": "^9.0.2", 41 | "typescript": "^3.9.5" 42 | }, 43 | "nyc": { 44 | "exclude": [ 45 | "**/spec/**", 46 | "node_modules" 47 | ], 48 | "reporter": [ 49 | "lcov", 50 | "text-summary" 51 | ] 52 | }, 53 | "files": [ 54 | "index.js", 55 | "index.d.ts", 56 | "react.js", 57 | "react.d.ts", 58 | "es6/" 59 | ], 60 | "types": "index.d.ts" 61 | } 62 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/react.d.ts: -------------------------------------------------------------------------------- 1 | declare const equal: (a: any, b: any) => boolean; 2 | export = equal; 3 | -------------------------------------------------------------------------------- /node_modules/fast-deep-equal/react.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // do not edit .js files directly - edit src/index.jst 4 | 5 | 6 | 7 | module.exports = function equal(a, b) { 8 | if (a === b) return true; 9 | 10 | if (a && b && typeof a == 'object' && typeof b == 'object') { 11 | if (a.constructor !== b.constructor) return false; 12 | 13 | var length, i, keys; 14 | if (Array.isArray(a)) { 15 | length = a.length; 16 | if (length != b.length) return false; 17 | for (i = length; i-- !== 0;) 18 | if (!equal(a[i], b[i])) return false; 19 | return true; 20 | } 21 | 22 | 23 | 24 | if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 25 | if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 26 | if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 27 | 28 | keys = Object.keys(a); 29 | length = keys.length; 30 | if (length !== Object.keys(b).length) return false; 31 | 32 | for (i = length; i-- !== 0;) 33 | if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 34 | 35 | for (i = length; i-- !== 0;) { 36 | var key = keys[i]; 37 | 38 | if (key === '_owner' && a.$$typeof) { 39 | // React-specific: avoid traversing React elements' _owner. 40 | // _owner contains circular references 41 | // and is not needed when comparing the actual elements (and not their owners) 42 | continue; 43 | } 44 | 45 | if (!equal(a[key], b[key])) return false; 46 | } 47 | 48 | return true; 49 | } 50 | 51 | // true if both NaN, false otherwise 52 | return a!==a && b!==b; 53 | }; 54 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "strapi-location-field-plugin", 3 | "version": "1.2.2", 4 | "description": "A plugin to add a location field to Strapi", 5 | "strapi": { 6 | "name": "location-field", 7 | "description": "A plugin to add a location field to Strapi", 8 | "kind": "plugin", 9 | "displayName": "Location Field" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/raykeating/strapi-location-field-plugin.git" 14 | }, 15 | "dependencies": { 16 | "@googlemaps/js-api-loader": "^1.15.1" 17 | }, 18 | "peerDependencies": { 19 | "@strapi/strapi": "^4.0.0" 20 | }, 21 | "author": { 22 | "name": "Ray Keating", 23 | "email": "raykeating13@gmail.com" 24 | }, 25 | "maintainers": [ 26 | { 27 | "name": "Ray Keating" 28 | } 29 | ], 30 | "engines": { 31 | "node": ">=14.19.1 <=20.x.x", 32 | "npm": ">=6.0.0" 33 | }, 34 | "license": "MIT", 35 | "homepage": "https://github.com/raykeating/strapi-location-field-plugin#readme" 36 | } 37 | -------------------------------------------------------------------------------- /server/bootstrap.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = ({ strapi }) => { 4 | // bootstrap phase 5 | }; 6 | -------------------------------------------------------------------------------- /server/config/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | default: {}, 3 | validator: () => {} 4 | } -------------------------------------------------------------------------------- /server/content-types/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; 4 | -------------------------------------------------------------------------------- /server/controllers/getConfig.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | configController: async (ctx) => { 3 | const config = strapi.config.get("plugin.location-field"); 4 | ctx.send(config); 5 | }, 6 | }; -------------------------------------------------------------------------------- /server/controllers/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const configController = require('./getConfig'); 4 | 5 | module.exports = { 6 | "location-field": configController, 7 | }; 8 | -------------------------------------------------------------------------------- /server/destroy.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = ({ strapi }) => { 4 | // destroy phase 5 | }; 6 | -------------------------------------------------------------------------------- /server/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const register = require('./register'); 4 | const bootstrap = require('./bootstrap'); 5 | const destroy = require('./destroy'); 6 | const config = require('./config'); 7 | const contentTypes = require('./content-types'); 8 | const controllers = require('./controllers'); 9 | const routes = require('./routes'); 10 | const middlewares = require('./middlewares'); 11 | const policies = require('./policies'); 12 | const services = require('./services'); 13 | 14 | module.exports = { 15 | register, 16 | bootstrap, 17 | destroy, 18 | config, 19 | controllers, 20 | routes, 21 | services, 22 | contentTypes, 23 | policies, 24 | middlewares, 25 | }; 26 | -------------------------------------------------------------------------------- /server/middlewares/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; 4 | -------------------------------------------------------------------------------- /server/policies/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | module.exports = {}; 4 | -------------------------------------------------------------------------------- /server/register.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = ({ strapi }) => { 4 | // registeration phase 5 | strapi.customFields.register({ 6 | name: 'location', 7 | plugin: 'location-field', 8 | type: 'json' 9 | }); 10 | }; 11 | -------------------------------------------------------------------------------- /server/routes/index.js: -------------------------------------------------------------------------------- 1 | // custom route to expose the values in config/plugins.js to the front end 2 | module.exports = { 3 | "admin": { 4 | type: "admin", 5 | routes: [ 6 | { 7 | method: "GET", 8 | path: "/config", 9 | handler: "plugin::location-field.location-field.configController", 10 | config: { 11 | policies: ["admin::isAuthenticatedAdmin"], 12 | }, 13 | }, 14 | ], 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /server/services/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | getConfig: async (ctx) => { 5 | const config = strapi.config.get("plugin.location-field"); 6 | ctx.send(config); 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /strapi-admin.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./admin/src').default; 4 | -------------------------------------------------------------------------------- /strapi-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./server'); 4 | --------------------------------------------------------------------------------