@alfadocs/ui-kit-debug 0.33.3 → 0.33.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{contact-profile-card-Ce-LIDU8.js → contact-profile-card-C2mTxAlN.js} +53 -52
- package/dist/_chunks/contact-profile-card-C2mTxAlN.js.map +1 -0
- package/dist/_chunks/{map-view-ZgbhfRqy.js → map-view-vD5pvWs9.js} +488 -612
- package/dist/_chunks/map-view-vD5pvWs9.js.map +1 -0
- package/dist/_chunks/{practice-results-YD4dvqje.js → practice-results-Bv2RhAmD.js} +2 -2
- package/dist/_chunks/{practice-results-YD4dvqje.js.map → practice-results-Bv2RhAmD.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts +21 -0
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/_chunks/contact-profile-card-Ce-LIDU8.js.map +0 -1
- package/dist/_chunks/map-view-ZgbhfRqy.js.map +0 -1
- package/dist/tokens/google-maps-theme.d.ts +0 -15
- package/dist/tokens/google-maps-theme.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-view-vD5pvWs9.js","sources":["../../node_modules/fast-deep-equal/index.js","../../node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs","../../src/components/map-view/map-view.agent.ts","../../src/components/map-view/map-view.tsx"],"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","import * as React from 'react';\nimport React__default, { useMemo, useState, useReducer, useCallback, useEffect, useRef as useRef$1, useContext, useLayoutEffect as useLayoutEffect$1, forwardRef, useImperativeHandle, Children, createContext } from 'react';\nimport { createPortal } from 'react-dom';\nimport isDeepEqual from 'fast-deep-equal';\n\n// This file is automatically updated by the build process.\nconst VERSION = '1.8.3';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\n/*\n * Copyright 2025 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nfunction setScriptSrc(script, src) {\n script.src = src;\n}\n\n/*\n * Copyright 2025 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n\nconst bootstrap = bootstrapParams => {\n var bootstrapPromise;\n var script;\n var bootstrapParamsKey;\n var PRODUCT_NAME = \"The Google Maps JavaScript API\";\n var GOOGLE = \"google\";\n var IMPORT_API_NAME = \"importLibrary\";\n var PENDING_BOOTSTRAP_KEY = \"__ib__\";\n var doc = document;\n var global_ = window;\n var google_ = global_[GOOGLE] || (global_[GOOGLE] = {});\n var namespace = google_.maps || (google_.maps = {});\n var libraries = new Set();\n var searchParams = new URLSearchParams();\n var triggerBootstrap = () => bootstrapPromise || (bootstrapPromise = new Promise(async(resolve, reject) => {\n await (script = doc.createElement(\"script\"));\n searchParams.set(\"libraries\", [...libraries] + \"\");\n for (bootstrapParamsKey in bootstrapParams) {\n searchParams.set(bootstrapParamsKey.replace(/[A-Z]/g, g => \"_\" + g[0].toLowerCase()), bootstrapParams[bootstrapParamsKey]);\n }\n searchParams.set(\"callback\", GOOGLE + \".maps.\" + PENDING_BOOTSTRAP_KEY);\n setScriptSrc(script, \"https://maps.googleapis.com/maps/api/js?\" + searchParams);\n namespace[PENDING_BOOTSTRAP_KEY] = resolve;\n script.onerror = () => bootstrapPromise = reject(Error(PRODUCT_NAME + \" could not load.\"));\n script.nonce = doc.querySelector(\"script[nonce]\")?.nonce || \"\";\n doc.head.append(script);\n }));\n namespace[IMPORT_API_NAME] ? console.warn(PRODUCT_NAME + \" only loads once. Ignoring:\", bootstrapParams) : namespace[IMPORT_API_NAME] = (libraryName, ...args) => libraries.add(libraryName) && triggerBootstrap().then(() => namespace[IMPORT_API_NAME](libraryName, ...args));\n};\nconst MSG_REPEATED_SET_OPTIONS = (options) => `The setOptions() function should only be called once. The options passed ` +\n `to the additional call (${JSON.stringify(options)}) will be ignored.`;\nconst MSG_IMPORT_LIBRARY_EXISTS = (options) => `The google.maps.importLibrary() function is already defined, and ` +\n `@googlemaps/js-api-loader will use the existing function instead of ` +\n `overwriting it. The options passed to setOptions ` +\n `(${JSON.stringify(options)}) will be ignored.`;\nconst MSG_SET_OPTIONS_NOT_CALLED = \"No options were set before calling importLibrary. Make sure to configure \" +\n \"the loader using setOptions().\";\nconst MSG_SCRIPT_ELEMENT_EXISTS = \"There already is a script loading the Google Maps JavaScript \" +\n \"API, and no google.maps.importLibrary function is defined. \" +\n \"@googlemaps/js-api-loader will proceed to bootstrap the API \" +\n \"with the specified options, but the existing script might cause \" +\n \"problems using the API. Make sure to remove the script \" +\n \"loading the API.\";\nconst __DEV__$1 = process.env.NODE_ENV !== 'production';\nconst logDevWarning = __DEV__$1\n ? (message) => {\n console.warn(`[@googlemaps/js-api-loader] ${message}`);\n }\n : () => { };\nconst logDevNotice = __DEV__$1\n ? (message) => {\n console.info(`[@googlemaps/js-api-loader] ${message}`);\n }\n : () => { };\n\n/*\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst __DEV__ = process.env.NODE_ENV !== 'production';\nlet setOptionsWasCalled_ = false;\n/**\n * Sets the options for the Maps JavaScript API.\n *\n * Has to be called before any library is loaded.\n *\n * See https://developers.google.com/maps/documentation/javascript/load-maps-js-api#required_parameters\n * for the full documentation of available options.\n *\n * @param options The options to set.\n */\nfunction setOptions(options) {\n if (setOptionsWasCalled_) {\n logDevWarning(MSG_REPEATED_SET_OPTIONS(options));\n return;\n }\n installImportLibrary_(options);\n setOptionsWasCalled_ = true;\n}\nasync function importLibrary(libraryName) {\n if (!setOptionsWasCalled_) {\n logDevWarning(MSG_SET_OPTIONS_NOT_CALLED);\n }\n if (!window?.google?.maps?.importLibrary) {\n throw new Error(\"google.maps.importLibrary is not installed.\");\n }\n return (await google.maps.importLibrary(libraryName));\n}\n/**\n * The installImportLibrary_ function makes sure that a usable version of the\n * `google.maps.importLibrary` function exists.\n */\nfunction installImportLibrary_(options) {\n const importLibraryExists = Boolean(window.google?.maps?.importLibrary);\n if (importLibraryExists) {\n logDevNotice(MSG_IMPORT_LIBRARY_EXISTS(options));\n }\n else if (__DEV__) {\n const scriptEl = document.querySelector('script[src*=\"maps.googleapis.com/maps/api/js\"]');\n if (scriptEl) {\n logDevWarning(MSG_SCRIPT_ELEMENT_EXISTS);\n }\n }\n // If the google.maps.importLibrary function already exists, bootstrap()\n // won't do anything, so we won't call it\n if (!importLibraryExists) {\n bootstrap(options);\n }\n}\n\nconst APILoadingStatus = {\n NOT_LOADED: 'NOT_LOADED',\n LOADING: 'LOADING',\n LOADED: 'LOADED',\n FAILED: 'FAILED',\n AUTH_FAILURE: 'AUTH_FAILURE'\n};\n\nconst DEFAULT_SOLUTION_CHANNEL = 'GMP_visgl_rgmlibrary_v1_default';\nconst DEFAULT_INTERNAL_USAGE_ATTRIBUTION_IDS = [\n `gmp_visgl_reactgooglemaps_v${VERSION}`\n];\nconst APIProviderContext = React__default.createContext(null);\n// loading the Maps JavaScript API can only happen once in the runtime, so these\n// variables are kept at the module level.\nlet loadingStatus = APILoadingStatus.NOT_LOADED;\nlet serializedApiParams;\nconst listeners = new Set();\n/**\n * Called to update the local status and notify the listeners for any mounted\n * components.\n * @internal\n */\nfunction updateLoadingStatus(status) {\n if (status === loadingStatus) {\n return;\n }\n loadingStatus = status;\n listeners.forEach(listener => listener(loadingStatus));\n}\n/**\n * Local hook to set up the map-instance management context.\n * @internal\n */\nfunction useMapInstances() {\n const [mapInstances, setMapInstances] = useState({});\n const addMapInstance = (mapInstance, id = 'default') => {\n setMapInstances(instances => (Object.assign(Object.assign({}, instances), { [id]: mapInstance })));\n };\n const removeMapInstance = (id = 'default') => {\n setMapInstances((_a) => {\n var _b = id; _a[_b]; var remaining = __rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\n return remaining;\n });\n };\n const clearMapInstances = () => {\n setMapInstances({});\n };\n return { mapInstances, addMapInstance, removeMapInstance, clearMapInstances };\n}\n/**\n * local hook to set up the 3D map-instance management context.\n */\nfunction useMap3DInstances() {\n const [map3dInstances, setMap3DInstances] = useState({});\n const addMap3DInstance = (map3dInstance, id = 'default') => {\n setMap3DInstances(instances => (Object.assign(Object.assign({}, instances), { [id]: map3dInstance })));\n };\n const removeMap3DInstance = (id = 'default') => {\n setMap3DInstances((_a) => {\n var _b = id; _a[_b]; var remaining = __rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\n return remaining;\n });\n };\n const clearMap3DInstances = () => {\n setMap3DInstances({});\n };\n return {\n map3dInstances,\n addMap3DInstance,\n removeMap3DInstance,\n clearMap3DInstances\n };\n}\n/**\n * Local hook to handle the loading of the maps API.\n * @internal\n */\nfunction useGoogleMapsApiLoader(props) {\n const { onLoad, onError, apiKey, version, libraries = [], region, language, authReferrerPolicy, channel, solutionChannel, fetchAppCheckToken } = props;\n const [status, setStatus] = useState(loadingStatus);\n const [loadedLibraries, addLoadedLibrary] = useReducer((loadedLibraries, action) => {\n return loadedLibraries[action.name]\n ? loadedLibraries\n : Object.assign(Object.assign({}, loadedLibraries), { [action.name]: action.value });\n }, {});\n const currentSerializedParams = useMemo(() => {\n const params = {\n apiKey,\n version,\n libraries: libraries.join(','),\n region,\n language,\n authReferrerPolicy,\n channel,\n solutionChannel\n };\n return JSON.stringify(params);\n }, [\n apiKey,\n version,\n libraries,\n region,\n language,\n authReferrerPolicy,\n channel,\n solutionChannel\n ]);\n const importLibraryCallback = useCallback((name) => __awaiter(this, void 0, void 0, function* () {\n if (loadedLibraries[name]) {\n return loadedLibraries[name];\n }\n const res = yield importLibrary(name);\n addLoadedLibrary({ name, value: res });\n return res;\n }), [loadedLibraries]);\n // effect: we want to get notified of global loading-status changes\n useEffect(() => {\n listeners.add(setStatus);\n // sync component state on mount (shouldn't be different from the initial state)\n setStatus(loadingStatus);\n return () => {\n listeners.delete(setStatus);\n };\n }, []);\n // effect: set and store options\n useEffect(() => {\n (() => __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n try {\n // This indicates that the API has been loaded with a different set of parameters.\n // While this is not blocking, it's not recommended and we should warn the user.\n if (serializedApiParams &&\n serializedApiParams !== currentSerializedParams) {\n console.warn(`The Google Maps JavaScript API has already been loaded with different parameters. ` +\n `The new parameters will be ignored. If you need to use different parameters, ` +\n `please refresh the page.`);\n }\n const librariesToLoad = ['core', 'maps', ...libraries];\n // If the google.maps namespace is already available, the API has been loaded externally.\n if ((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.importLibrary) {\n if (!serializedApiParams) {\n updateLoadingStatus(APILoadingStatus.LOADED);\n }\n yield Promise.all(librariesToLoad.map(name => importLibraryCallback(name)));\n if (onLoad)\n onLoad();\n return;\n }\n // Abort if the API is already loading or has been loaded.\n if (loadingStatus === APILoadingStatus.LOADING ||\n loadingStatus === APILoadingStatus.LOADED) {\n if (loadingStatus === APILoadingStatus.LOADED && onLoad)\n onLoad();\n return;\n }\n serializedApiParams = currentSerializedParams;\n updateLoadingStatus(APILoadingStatus.LOADING);\n const options = Object.fromEntries(Object.entries({\n key: apiKey,\n v: version,\n libraries,\n region,\n language,\n authReferrerPolicy\n }).filter(([, value]) => value !== undefined));\n if (channel !== undefined && channel >= 0 && channel <= 999) {\n options.channel = String(channel);\n }\n // solution-channel: when undefined, use the default; otherwise use\n // an explicit value.\n if (solutionChannel === undefined) {\n options.solutionChannel = DEFAULT_SOLUTION_CHANNEL;\n }\n else if (solutionChannel !== '') {\n options.solutionChannel = solutionChannel;\n }\n // this will actually trigger loading the maps API\n setOptions(options);\n // wait for all requested libraries (inluding 'core' and 'maps') to\n // finish loading\n yield Promise.all(librariesToLoad.map(name => importLibraryCallback(name)));\n updateLoadingStatus(APILoadingStatus.LOADED);\n if (onLoad) {\n onLoad();\n }\n }\n catch (error) {\n updateLoadingStatus(APILoadingStatus.FAILED);\n if (onError) {\n onError(error);\n }\n else {\n console.error('The Google Maps JavaScript API failed to load.', error);\n }\n }\n }))();\n }, \n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentSerializedParams, onLoad, onError, importLibraryCallback, libraries]);\n // set the fetchAppCheckToken if provided\n useEffect(() => {\n if (status !== APILoadingStatus.LOADED)\n return;\n const settings = google.maps.Settings.getInstance();\n if (fetchAppCheckToken) {\n settings.fetchAppCheckToken = fetchAppCheckToken;\n }\n else if (settings.fetchAppCheckToken) {\n settings.fetchAppCheckToken = null;\n }\n }, [status, fetchAppCheckToken]);\n return {\n status,\n loadedLibraries,\n importLibrary: importLibraryCallback\n };\n}\nfunction useInternalUsageAttributionIds(props) {\n return useMemo(() => props.disableUsageAttribution\n ? null\n : DEFAULT_INTERNAL_USAGE_ATTRIBUTION_IDS, [props.disableUsageAttribution]);\n}\n/**\n * Component to wrap the components from this library and load the Google Maps JavaScript API\n */\nconst APIProvider = props => {\n const { children } = props, loaderProps = __rest(props, [\"children\"]);\n const { mapInstances, addMapInstance, removeMapInstance, clearMapInstances } = useMapInstances();\n const { map3dInstances, addMap3DInstance, removeMap3DInstance, clearMap3DInstances } = useMap3DInstances();\n const { status, loadedLibraries, importLibrary } = useGoogleMapsApiLoader(loaderProps);\n const internalUsageAttributionIds = useInternalUsageAttributionIds(loaderProps);\n const contextValue = useMemo(() => ({\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances,\n map3dInstances,\n addMap3DInstance,\n removeMap3DInstance,\n clearMap3DInstances,\n status,\n loadedLibraries,\n importLibrary,\n internalUsageAttributionIds\n }), [\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances,\n map3dInstances,\n addMap3DInstance,\n removeMap3DInstance,\n clearMap3DInstances,\n status,\n loadedLibraries,\n importLibrary,\n internalUsageAttributionIds\n ]);\n return (React__default.createElement(APIProviderContext.Provider, { value: contextValue }, children));\n};\n/**\n * @internal\n * Resets module-level state for testing purposes only.\n * This should never be used in production code.\n */\nfunction __resetModuleState() {\n loadingStatus = APILoadingStatus.NOT_LOADED;\n serializedApiParams = undefined;\n listeners.clear();\n}\n\n/**\n * Sets up effects to bind event-handlers for all event-props in MapEventProps.\n * @internal\n */\nfunction useMapEvents(map, props) {\n // note: calling a useEffect hook from within a loop is prohibited by the\n // rules of hooks, but it's ok here since it's unconditional and the number\n // and order of iterations is always strictly the same.\n // (see https://legacy.reactjs.org/docs/hooks-rules.html)\n for (const propName of eventPropNames) {\n // fixme: this cast is essentially a 'trust me, bro' for typescript, but\n // a proper solution seems way too complicated right now\n const handler = props[propName];\n const eventType = propNameToEventType[propName];\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!map)\n return;\n if (!handler)\n return;\n const listener = google.maps.event.addListener(map, eventType, (ev) => {\n handler(createMapEvent(eventType, map, ev));\n });\n return () => listener.remove();\n }, [map, eventType, handler]);\n }\n}\n/**\n * Create the wrapped map-events used for the event-props.\n * @param type the event type as it is specified to the maps api\n * @param map the map instance the event originates from\n * @param srcEvent the source-event if there is one.\n */\nfunction createMapEvent(type, map, srcEvent) {\n var _a;\n const ev = {\n type,\n map,\n detail: {},\n stoppable: false,\n stop: () => { }\n };\n if (cameraEventTypes.includes(type)) {\n const camEvent = ev;\n const center = map.getCenter();\n const zoom = map.getZoom();\n const heading = map.getHeading() || 0;\n const tilt = map.getTilt() || 0;\n const bounds = map.getBounds();\n if (!center || !bounds || !Number.isFinite(zoom)) {\n console.warn('[createEvent] at least one of the values from the map ' +\n 'returned undefined. This is not expected to happen. Please ' +\n 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n camEvent.detail = {\n center: (center === null || center === void 0 ? void 0 : center.toJSON()) || { lat: 0, lng: 0 },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt,\n bounds: (bounds === null || bounds === void 0 ? void 0 : bounds.toJSON()) || {\n north: 90,\n east: 180,\n south: -90,\n west: -180\n }\n };\n return camEvent;\n }\n else if (mouseEventTypes.includes(type)) {\n if (!srcEvent)\n throw new Error('[createEvent] mouse events must provide a srcEvent');\n const mouseEvent = ev;\n mouseEvent.domEvent = srcEvent.domEvent;\n mouseEvent.stoppable = true;\n mouseEvent.stop = () => srcEvent.stop();\n mouseEvent.detail = {\n latLng: ((_a = srcEvent.latLng) === null || _a === void 0 ? void 0 : _a.toJSON()) || null,\n placeId: srcEvent.placeId\n };\n return mouseEvent;\n }\n return ev;\n}\n/**\n * maps the camelCased names of event-props to the corresponding event-types\n * used in the maps API.\n */\nconst propNameToEventType = {\n onBoundsChanged: 'bounds_changed',\n onCenterChanged: 'center_changed',\n onClick: 'click',\n onContextmenu: 'contextmenu',\n onDblclick: 'dblclick',\n onDrag: 'drag',\n onDragend: 'dragend',\n onDragstart: 'dragstart',\n onHeadingChanged: 'heading_changed',\n onIdle: 'idle',\n onIsFractionalZoomEnabledChanged: 'isfractionalzoomenabled_changed',\n onMapCapabilitiesChanged: 'mapcapabilities_changed',\n onMapTypeIdChanged: 'maptypeid_changed',\n onMousemove: 'mousemove',\n onMouseout: 'mouseout',\n onMouseover: 'mouseover',\n onProjectionChanged: 'projection_changed',\n onRenderingTypeChanged: 'renderingtype_changed',\n onTilesLoaded: 'tilesloaded',\n onTiltChanged: 'tilt_changed',\n onZoomChanged: 'zoom_changed',\n // note: onCameraChanged is an alias for the bounds_changed event,\n // since that is going to be fired in every situation where the camera is\n // updated.\n onCameraChanged: 'bounds_changed'\n};\nconst cameraEventTypes = [\n 'bounds_changed',\n 'center_changed',\n 'heading_changed',\n 'tilt_changed',\n 'zoom_changed'\n];\nconst mouseEventTypes = [\n 'click',\n 'contextmenu',\n 'dblclick',\n 'mousemove',\n 'mouseout',\n 'mouseover'\n];\nconst eventPropNames = Object.keys(propNameToEventType);\n\n/* eslint-disable react-hooks/refs */\n// refs should not be used in render because changes to refs won't\n// trigger a re-render, making them unreliable for holding state.\n// In this case though, that is exactly what we want.\nfunction useMemoized(value, isEqual) {\n const ref = useRef$1(value);\n if (!isEqual(value, ref.current)) {\n ref.current = value;\n }\n return ref.current;\n}\n\nfunction useCustomCompareEffect(effect, dependencies, isEqual) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(effect, [useMemoized(dependencies, isEqual)]);\n}\n\nfunction useDeepCompareEffect(effect, dependencies) {\n useCustomCompareEffect(effect, dependencies, isDeepEqual);\n}\n\nconst mapOptionKeys = new Set([\n 'backgroundColor',\n 'clickableIcons',\n 'controlSize',\n 'disableDefaultUI',\n 'disableDoubleClickZoom',\n 'draggable',\n 'draggableCursor',\n 'draggingCursor',\n 'fullscreenControl',\n 'fullscreenControlOptions',\n 'gestureHandling',\n 'headingInteractionEnabled',\n 'isFractionalZoomEnabled',\n 'keyboardShortcuts',\n 'mapTypeControl',\n 'mapTypeControlOptions',\n 'mapTypeId',\n 'maxZoom',\n 'minZoom',\n 'noClear',\n 'panControl',\n 'panControlOptions',\n 'restriction',\n 'rotateControl',\n 'rotateControlOptions',\n 'scaleControl',\n 'scaleControlOptions',\n 'scrollwheel',\n 'streetView',\n 'streetViewControl',\n 'streetViewControlOptions',\n 'styles',\n 'tiltInteractionEnabled',\n 'zoomControl',\n 'zoomControlOptions'\n]);\n/**\n * Internal hook to update the map-options when props are changed.\n *\n * @param map the map instance\n * @param mapProps the props to update the map-instance with\n * @internal\n */\nfunction useMapOptions(map, mapProps) {\n /* eslint-disable react-hooks/exhaustive-deps --\n *\n * The following effects aren't triggered when the map is changed.\n * In that case, the values will be or have been passed to the map\n * constructor via mapOptions.\n */\n const mapOptions = {};\n const keys = Object.keys(mapProps);\n for (const key of keys) {\n if (!mapOptionKeys.has(key))\n continue;\n mapOptions[key] = mapProps[key];\n }\n // update the map options when mapOptions is changed\n // Note: due to the destructuring above, mapOptions will be seen as changed\n // with every re-render, so we're assuming the maps-api will properly\n // deal with unchanged option-values passed into setOptions.\n useDeepCompareEffect(() => {\n if (!map)\n return;\n map.setOptions(mapOptions);\n }, [mapOptions]);\n /* eslint-enable react-hooks/exhaustive-deps */\n}\n\nfunction useApiLoadingStatus() {\n var _a;\n return ((_a = useContext(APIProviderContext)) === null || _a === void 0 ? void 0 : _a.status) || APILoadingStatus.NOT_LOADED;\n}\n\n/**\n * Internal hook that updates the camera when deck.gl viewState changes.\n * @internal\n */\nfunction useDeckGLCameraUpdate(map, props) {\n const { viewport, viewState } = props;\n const isDeckGlControlled = !!viewport;\n useLayoutEffect$1(() => {\n if (!map || !viewState)\n return;\n const { latitude, longitude, bearing: heading, pitch: tilt, zoom } = viewState;\n map.moveCamera({\n center: { lat: latitude, lng: longitude },\n heading,\n tilt,\n zoom: zoom + 1\n });\n }, [map, viewState]);\n return isDeckGlControlled;\n}\n\nfunction isLatLngLiteral(obj) {\n if (!obj || typeof obj !== 'object')\n return false;\n if (!('lat' in obj && 'lng' in obj))\n return false;\n return Number.isFinite(obj.lat) && Number.isFinite(obj.lng);\n}\nfunction latLngEquals(a, b) {\n if (!a || !b)\n return false;\n const A = toLatLngLiteral(a);\n const B = toLatLngLiteral(b);\n if (A.lat !== B.lat || A.lng !== B.lng)\n return false;\n return true;\n}\nfunction toLatLngLiteral(obj) {\n if (isLatLngLiteral(obj))\n return obj;\n return obj.toJSON();\n}\nfunction toLatLngBoundsLiteral(obj) {\n if ('north' in obj && 'south' in obj && 'east' in obj && 'west' in obj) {\n return obj;\n }\n const ne = obj.getNorthEast().toJSON();\n const sw = obj.getSouthWest().toJSON();\n return {\n north: ne.lat,\n east: ne.lng,\n south: sw.lat,\n west: sw.lng\n };\n}\nfunction boundsEquals(a, b) {\n if (!a || !b)\n return false;\n const A = toLatLngBoundsLiteral(a);\n const B = toLatLngBoundsLiteral(b);\n return (A.north === B.north &&\n A.south === B.south &&\n A.east === B.east &&\n A.west === B.west);\n}\n/**\n * Compares two paths (arrays of LatLng points) for equality.\n */\nfunction pathEquals(a, b) {\n if (!a || !b)\n return a === b;\n const arrayB = 'getArray' in b ? b.getArray() : b;\n if (a.length !== arrayB.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n if (!latLngEquals(a[i], arrayB[i]))\n return false;\n }\n return true;\n}\n/**\n * Compares two arrays of paths (for Polygon) for equality.\n */\nfunction pathsEquals(a, b) {\n if (!a || !b)\n return a === b;\n const arrayB = 'getArray' in b ? b.getArray().map(inner => inner.getArray()) : b;\n if (a.length !== arrayB.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n if (!pathEquals(a[i], arrayB[i]))\n return false;\n }\n return true;\n}\n\nfunction useMapCameraParams(map, cameraStateRef, mapProps) {\n const center = mapProps.center ? toLatLngLiteral(mapProps.center) : null;\n let lat = null;\n let lng = null;\n if (center && Number.isFinite(center.lat) && Number.isFinite(center.lng)) {\n lat = center.lat;\n lng = center.lng;\n }\n const zoom = Number.isFinite(mapProps.zoom)\n ? mapProps.zoom\n : null;\n const heading = Number.isFinite(mapProps.heading)\n ? mapProps.heading\n : null;\n const tilt = Number.isFinite(mapProps.tilt)\n ? mapProps.tilt\n : null;\n // the following effect runs for every render of the map component and checks\n // if there are differences between the known state of the map instance\n // (cameraStateRef, which is updated by all bounds_changed events) and the\n // desired state in the props.\n useLayoutEffect$1(() => {\n if (!map)\n return;\n const nextCamera = {};\n let needsUpdate = false;\n if (lat !== null &&\n lng !== null &&\n (cameraStateRef.current.center.lat !== lat ||\n cameraStateRef.current.center.lng !== lng)) {\n nextCamera.center = { lat, lng };\n needsUpdate = true;\n }\n if (zoom !== null && cameraStateRef.current.zoom !== zoom) {\n nextCamera.zoom = zoom;\n needsUpdate = true;\n }\n if (heading !== null && cameraStateRef.current.heading !== heading) {\n nextCamera.heading = heading;\n needsUpdate = true;\n }\n if (tilt !== null && cameraStateRef.current.tilt !== tilt) {\n nextCamera.tilt = tilt;\n needsUpdate = true;\n }\n if (needsUpdate) {\n map.moveCamera(nextCamera);\n }\n });\n}\n\nconst AuthFailureMessage = () => {\n const style = {\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: 999,\n display: 'flex',\n flexFlow: 'column nowrap',\n textAlign: 'center',\n justifyContent: 'center',\n fontSize: '.8rem',\n color: 'rgba(0,0,0,0.6)',\n background: '#dddddd',\n padding: '1rem 1.5rem'\n };\n return (React__default.createElement(\"div\", { style: style },\n React__default.createElement(\"h2\", null, \"Error: AuthFailure\"),\n React__default.createElement(\"p\", null,\n \"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the \",\n React__default.createElement(\"code\", null, \"APIProvider.apiKey\"),\n \" prop is correct. Check the error-message in the console for further details.\")));\n};\n\nfunction useCallbackRef() {\n const [el, setEl] = useState(null);\n const ref = useCallback((value) => setEl(value), [setEl]);\n return [el, ref];\n}\n\n/**\n * Hook to check if the Maps JavaScript API is loaded\n */\nfunction useApiIsLoaded() {\n const status = useApiLoadingStatus();\n return status === APILoadingStatus.LOADED;\n}\n\nfunction useForceUpdate() {\n const [, forceUpdate] = useReducer(x => x + 1, 0);\n return forceUpdate;\n}\n\nfunction handleBoundsChange(map, ref) {\n const center = map.getCenter();\n const zoom = map.getZoom();\n const heading = map.getHeading() || 0;\n const tilt = map.getTilt() || 0;\n const bounds = map.getBounds();\n if (!center || !bounds || !Number.isFinite(zoom)) {\n console.warn('[useTrackedCameraState] at least one of the values from the map ' +\n 'returned undefined. This is not expected to happen. Please ' +\n 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n // fixme: do we need the `undefined` cases for the camera-params? When are they used in the maps API?\n Object.assign(ref.current, {\n center: (center === null || center === void 0 ? void 0 : center.toJSON()) || { lat: 0, lng: 0 },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt\n });\n}\n/**\n * Creates a mutable ref object to track the last known state of the map camera.\n * This is used in `useMapCameraParams` to reduce stuttering in normal operation\n * by avoiding updates of the map camera with values that have already been processed.\n */\nfunction useTrackedCameraStateRef(map) {\n const forceUpdate = useForceUpdate();\n const ref = useRef$1({\n center: { lat: 0, lng: 0 },\n heading: 0,\n tilt: 0,\n zoom: 0\n });\n // Record camera state with every bounds_changed event dispatched by the map.\n // This data is used to prevent feeding these values back to the\n // map-instance when a typical \"controlled component\" setup (state variable is\n // fed into and updated by the map).\n useEffect(() => {\n if (!map)\n return;\n const listener = google.maps.event.addListener(map, 'bounds_changed', () => {\n handleBoundsChange(map, ref);\n // When an event is occured, we have to update during the next cycle.\n // The application could decide to ignore the event and not update any\n // camera props of the map, meaning that in that case we will have to\n // 'undo' the change to the camera.\n forceUpdate();\n });\n return () => listener.remove();\n }, [map, forceUpdate]);\n return ref;\n}\n\n/**\n * Stores a stack of map-instances for each mapId. Whenever an\n * instance is used, it is removed from the stack while in use,\n * and returned to the stack when the component unmounts.\n * This allows us to correctly implement caching for multiple\n * maps om the same page, while reusing as much as possible.\n *\n * FIXME: while it should in theory be possible to reuse maps solely\n * based on mapId/renderingType/colorScheme (as all other parameters can be\n * changed at runtime), we don't yet have good enough tracking of options to\n * reliably unset all the options that have been set.\n */\nclass CachedMapStack {\n static has(key) {\n return this.entries[key] && this.entries[key].length > 0;\n }\n static pop(key) {\n if (!this.entries[key])\n return null;\n return this.entries[key].pop() || null;\n }\n static push(key, value) {\n if (!this.entries[key])\n this.entries[key] = [];\n this.entries[key].push(value);\n }\n}\nCachedMapStack.entries = {};\n/**\n * The main hook takes care of creating map-instances and registering them in\n * the api-provider context.\n * @return a tuple of the map-instance created (or null) and the callback\n * ref that will be used to pass the map-container into this hook.\n * @internal\n */\nfunction useMapInstance(props, context) {\n const apiIsLoaded = useApiIsLoaded();\n const [map, setMap] = useState(null);\n const [container, containerRef] = useCallbackRef();\n const cameraStateRef = useTrackedCameraStateRef(map);\n const { id, defaultBounds, defaultCenter, defaultZoom, defaultHeading, defaultTilt, reuseMaps, renderingType, colorScheme } = props, mapOptions = __rest(props, [\"id\", \"defaultBounds\", \"defaultCenter\", \"defaultZoom\", \"defaultHeading\", \"defaultTilt\", \"reuseMaps\", \"renderingType\", \"colorScheme\"]);\n const hasZoom = props.zoom !== undefined || props.defaultZoom !== undefined;\n const hasCenter = props.center !== undefined || props.defaultCenter !== undefined;\n if (!defaultBounds && (!hasZoom || !hasCenter)) {\n console.warn('<Map> component is missing configuration. ' +\n 'You have to provide zoom and center (via the `zoom`/`defaultZoom` and ' +\n '`center`/`defaultCenter` props) or specify the region to show using ' +\n '`defaultBounds`. See ' +\n 'https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required');\n }\n // apply default camera props if available and not overwritten by controlled props\n if (!mapOptions.center && defaultCenter)\n mapOptions.center = defaultCenter;\n if (!mapOptions.zoom && Number.isFinite(defaultZoom))\n mapOptions.zoom = defaultZoom;\n if (!mapOptions.heading && Number.isFinite(defaultHeading))\n mapOptions.heading = defaultHeading;\n if (!mapOptions.tilt && Number.isFinite(defaultTilt))\n mapOptions.tilt = defaultTilt;\n // Handle internalUsageAttributionIds\n const customIds = mapOptions.internalUsageAttributionIds;\n if (customIds == null) {\n // Not specified - use context default (which may be null if disabled)\n mapOptions.internalUsageAttributionIds =\n context.internalUsageAttributionIds;\n }\n else {\n // Merge context defaults with custom IDs\n mapOptions.internalUsageAttributionIds = [\n ...(context.internalUsageAttributionIds || []),\n ...customIds\n ];\n }\n for (const key of Object.keys(mapOptions))\n if (mapOptions[key] === undefined)\n delete mapOptions[key];\n const savedMapStateRef = useRef$1(undefined);\n // create the map instance and register it in the context\n useEffect(() => {\n if (!container || !apiIsLoaded)\n return;\n const { addMapInstance, removeMapInstance } = context;\n // note: colorScheme (upcoming feature) isn't yet in the typings, remove once that is fixed:\n const { mapId } = props;\n const cacheKey = `${mapId || 'default'}:${renderingType || 'default'}:${colorScheme || 'LIGHT'}`;\n let mapDiv;\n let map;\n if (reuseMaps && CachedMapStack.has(cacheKey)) {\n map = CachedMapStack.pop(cacheKey);\n mapDiv = map.getDiv();\n container.appendChild(mapDiv);\n map.setOptions(mapOptions);\n // detaching the element from the DOM sometimes causes the map to collapse\n // and no longer render tiles that should be in view after re-attaching it.\n // Triggering moveCamera after remounting should trigger a re-layout of\n // the map.\n setTimeout(() => map.moveCamera({}), 0);\n }\n else {\n mapDiv = document.createElement('div');\n mapDiv.style.height = '100%';\n container.appendChild(mapDiv);\n map = new google.maps.Map(mapDiv, Object.assign(Object.assign(Object.assign({}, mapOptions), (renderingType\n ? { renderingType: renderingType }\n : {})), (colorScheme\n ? { colorScheme: colorScheme }\n : {})));\n }\n setMap(map);\n addMapInstance(map, id);\n if (defaultBounds) {\n const { padding } = defaultBounds, defBounds = __rest(defaultBounds, [\"padding\"]);\n map.fitBounds(defBounds, padding);\n }\n // prevent map not rendering due to missing configuration\n else if (!hasZoom || !hasCenter) {\n map.fitBounds({ east: 180, west: -180, south: -90, north: 90 });\n }\n // the savedMapState is used to restore the camera parameters when the mapId is changed\n if (savedMapStateRef.current) {\n const { mapId: savedMapId, cameraState: savedCameraState } = savedMapStateRef.current;\n if (savedMapId !== mapId) {\n map.moveCamera(savedCameraState);\n }\n }\n return () => {\n savedMapStateRef.current = {\n mapId,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n cameraState: cameraStateRef.current\n };\n // detach the map-div from the dom\n mapDiv.remove();\n if (reuseMaps) {\n // push back on the stack\n CachedMapStack.push(cacheKey, map);\n }\n else {\n // remove all event-listeners to minimize the possibility of memory-leaks\n google.maps.event.clearInstanceListeners(map);\n }\n setMap(null);\n removeMapInstance(id);\n };\n }, \n // some dependencies are ignored in the list below:\n // - defaultBounds and the default* camera props will only be used once, and\n // changes should be ignored\n // - mapOptions has special hooks that take care of updating the options\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n container,\n apiIsLoaded,\n id,\n // these props can't be changed after initialization and require a new\n // instance to be created\n props.mapId,\n props.renderingType,\n props.colorScheme\n ]);\n return [map, containerRef, cameraStateRef];\n}\n\nconst GoogleMapsContext = React__default.createContext(null);\n// ColorScheme and RenderingType are redefined here to make them usable before the\n// maps API has been fully loaded.\nconst ColorScheme = {\n DARK: 'DARK',\n LIGHT: 'LIGHT',\n FOLLOW_SYSTEM: 'FOLLOW_SYSTEM'\n};\nconst RenderingType = {\n VECTOR: 'VECTOR',\n RASTER: 'RASTER',\n UNINITIALIZED: 'UNINITIALIZED'\n};\nconst Map = (props) => {\n const { children, id, className, style } = props;\n const context = useContext(APIProviderContext);\n const loadingStatus = useApiLoadingStatus();\n if (!context) {\n throw new Error('<Map> can only be used inside an <ApiProvider> component.');\n }\n const [map, mapRef, cameraStateRef] = useMapInstance(props, context);\n useMapCameraParams(map, cameraStateRef, props);\n useMapEvents(map, props);\n useMapOptions(map, props);\n const isDeckGlControlled = useDeckGLCameraUpdate(map, props);\n const isControlledExternally = !!props.controlled;\n // disable interactions with the map for externally controlled maps\n useEffect(() => {\n if (!map)\n return;\n // fixme: this doesn't seem to belong here (and it's mostly there for convenience anyway).\n // The reasoning is that a deck.gl canvas will be put on top of the map, rendering\n // any default map controls pretty much useless\n if (isDeckGlControlled) {\n map.setOptions({ disableDefaultUI: true });\n }\n // disable all control-inputs when the map is controlled externally\n if (isDeckGlControlled || isControlledExternally) {\n map.setOptions({\n gestureHandling: 'none',\n keyboardShortcuts: false\n });\n }\n return () => {\n map.setOptions({\n gestureHandling: props.gestureHandling,\n keyboardShortcuts: props.keyboardShortcuts\n });\n };\n }, [\n map,\n isDeckGlControlled,\n isControlledExternally,\n props.gestureHandling,\n props.keyboardShortcuts\n ]);\n // setup a stable cameraOptions object that can be used as dependency\n const center = props.center ? toLatLngLiteral(props.center) : null;\n let lat = null;\n let lng = null;\n if (center && Number.isFinite(center.lat) && Number.isFinite(center.lng)) {\n lat = center.lat;\n lng = center.lng;\n }\n const cameraOptions = useMemo(() => {\n var _a, _b, _c;\n return {\n center: { lat: lat !== null && lat !== void 0 ? lat : 0, lng: lng !== null && lng !== void 0 ? lng : 0 },\n zoom: (_a = props.zoom) !== null && _a !== void 0 ? _a : 0,\n heading: (_b = props.heading) !== null && _b !== void 0 ? _b : 0,\n tilt: (_c = props.tilt) !== null && _c !== void 0 ? _c : 0\n };\n }, [lat, lng, props.zoom, props.heading, props.tilt]);\n // externally controlled mode: reject all camera changes that don't correspond to changes in props\n useLayoutEffect$1(() => {\n if (!map || !isControlledExternally)\n return;\n map.moveCamera(cameraOptions);\n const listener = map.addListener('bounds_changed', () => {\n map.moveCamera(cameraOptions);\n });\n return () => listener.remove();\n }, [map, isControlledExternally, cameraOptions]);\n const combinedStyle = useMemo(() => (Object.assign({ width: '100%', height: '100%', position: 'relative', \n // when using deckgl, the map should be sent to the back\n zIndex: isDeckGlControlled ? -1 : 0 }, style)), [style, isDeckGlControlled]);\n const contextValue = useMemo(() => ({ map }), [map]);\n if (loadingStatus === APILoadingStatus.AUTH_FAILURE) {\n return (React__default.createElement(\"div\", { style: Object.assign({ position: 'relative' }, (className ? {} : combinedStyle)), className: className },\n React__default.createElement(AuthFailureMessage, null)));\n }\n return (React__default.createElement(\"div\", Object.assign({ ref: mapRef, \"data-testid\": 'map', style: className ? undefined : combinedStyle, className: className }, (id ? { id } : {})), map ? (React__default.createElement(GoogleMapsContext.Provider, { value: contextValue }, children)) : null));\n};\n// The deckGLViewProps flag here indicates to deck.gl that the Map component is\n// able to handle viewProps from deck.gl when deck.gl is used to control the map.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nMap.deckGLViewProps = true;\n\nconst shownMessages = new Set();\nfunction logErrorOnce(...args) {\n const key = JSON.stringify(args);\n if (!shownMessages.has(key)) {\n shownMessages.add(key);\n console.error(...args);\n }\n}\n\n/**\n * Retrieves a map-instance from the context. This is either an instance\n * identified by id or the parent map instance if no id is specified.\n * Returns null if neither can be found.\n */\nconst useMap = (id = null) => {\n const ctx = useContext(APIProviderContext);\n const { map } = useContext(GoogleMapsContext) || {};\n if (ctx === null) {\n logErrorOnce('useMap(): failed to retrieve APIProviderContext. ' +\n 'Make sure that the <APIProvider> component exists and that the ' +\n 'component you are calling `useMap()` from is a sibling of the ' +\n '<APIProvider>.');\n return null;\n }\n const { mapInstances } = ctx;\n // if an id is specified, the corresponding map or null is returned\n if (id !== null)\n return mapInstances[id] || null;\n // otherwise, return the closest ancestor\n if (map)\n return map;\n // finally, return the default map instance\n return mapInstances['default'] || null;\n};\n\nfunction useMapsLibrary(name) {\n const apiIsLoaded = useApiIsLoaded();\n const ctx = useContext(APIProviderContext);\n useEffect(() => {\n if (!apiIsLoaded || !ctx)\n return;\n // Trigger loading the libraries via our proxy-method.\n // The returned promise is ignored, since importLibrary will update loadedLibraries\n // list in the context, triggering a re-render.\n void ctx.importLibrary(name);\n }, [apiIsLoaded, ctx, name]);\n return (ctx === null || ctx === void 0 ? void 0 : ctx.loadedLibraries[name]) || null;\n}\n\n// Copyright (c) 2025 Sanity\n// This file is derived from sanity-io/use-effect-event (MIT Licensed)\n//\n// https://github.com/sanity-io/use-effect-event\nvar _a;\nconst { useLayoutEffect, useRef } = React;\n// useInsertionEffect was added in React 18; fall back to useLayoutEffect for\n// React 16/17. Both run before useEffect, so ref.current is always up-to-date\n// by the time any passive effect (or real event) reads it.\nconst useBeforeEffect = (_a = React.useInsertionEffect) !== null && _a !== void 0 ? _a : useLayoutEffect;\nfunction forbiddenInRender() {\n throw new Error('useEffectEvent: invalid call during rendering.');\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction useEffectEventPolyfill(fn) {\n /**\n * Initialize the ref with `forbiddenInRender`, to catch illegal calls during\n * rendering. After the insertion effect ran, the ref will contain the actual\n * function, so all effects can see the actual value.\n */\n const ref = useRef(forbiddenInRender);\n useBeforeEffect(() => {\n ref.current = fn;\n }, [fn]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return ((...args) => ref.current(...args));\n}\n/**\n * Uses a polyfill implementation of `useEffectEvent`. The native useEffectEvent\n * implementation was causing issues that we do not fully understand yet.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst useEffectEvent = useEffectEventPolyfill;\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst noop$1 = () => { };\n/**\n * Internally used to bind events to Maps JavaScript API objects.\n * @internal\n */\nfunction useMapsEventListener(target, name, callback) {\n const eventFn = useEffectEvent(callback !== null && callback !== void 0 ? callback : noop$1);\n const isCallbackDefined = Boolean(callback);\n useEffect(() => {\n if (!target || !name || !isCallbackDefined)\n return;\n const listener = google.maps.event.addListener(target, name, eventFn);\n return () => listener.remove();\n }, [target, name, isCallbackDefined]);\n}\n\n/* eslint-disable react-hooks/immutability -- Google Maps API objects are designed to be mutated */\n/**\n * Internally used to copy values from props into API-Objects\n * whenever they change.\n *\n * @example\n * usePropBinding(marker, 'position', position);\n *\n * @internal\n */\nfunction usePropBinding(object, prop, value) {\n useEffect(() => {\n if (!object)\n return;\n object[prop] = value;\n }, [object, prop, value]);\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst noop = () => { };\n/**\n * Internally used to bind events to DOM nodes.\n * @internal\n */\nfunction useDomEventListener(target, name, callback) {\n const eventFn = useEffectEvent(callback !== null && callback !== void 0 ? callback : noop);\n const isCallbackDefined = Boolean(callback);\n useEffect(() => {\n if (!target || !name || !isCallbackDefined)\n return;\n // Note: eventFn is not guaranteed to be stable across renders, so we need\n // to use a local variable to be sure to remove the very same listener\n // function that has been added\n const listenerCallback = eventFn;\n target.addEventListener(name, listenerCallback);\n return () => target.removeEventListener(name, listenerCallback);\n }, [target, name, isCallbackDefined]);\n}\n\n// Global style manager to track rendered styles and avoid duplicates\nclass GlobalStyleManager {\n constructor() {\n this.renderedStyles = new Set();\n this.styleElement = null;\n }\n getStyleElement() {\n if (!this.styleElement) {\n this.styleElement = document.createElement('style');\n this.styleElement.setAttribute('data-rgm-anchor-styles', '');\n document.head.appendChild(this.styleElement);\n }\n return this.styleElement;\n }\n addAdvancedMarkerPointerEventsOverwrite() {\n if (this.renderedStyles.has('marker-pointer-events')) {\n return;\n }\n const styleElement = this.getStyleElement();\n styleElement.textContent += `\n gmp-advanced-marker[data-origin='rgm'] {\n pointer-events: none !important;\n }\n `;\n this.renderedStyles.add('marker-pointer-events');\n }\n cleanup() {\n if (this.styleElement) {\n this.styleElement.remove();\n this.styleElement = null;\n this.renderedStyles.clear();\n }\n }\n}\nconst globalStyleManager = new GlobalStyleManager();\n\nfunction isVersionGreaterEqual(major, minor) {\n var _a;\n if (!((_a = google === null || google === void 0 ? void 0 : google.maps) === null || _a === void 0 ? void 0 : _a.version))\n return undefined;\n const version = google.maps.version.split('.');\n const currentMajor = parseInt(version[0], 10);\n const currentMinor = parseInt(version[1], 10);\n return (currentMajor > major || (currentMajor === major && currentMinor >= minor));\n}\n\n/**\n * Copy of the `google.maps.CollisionBehavior` constants.\n * They have to be duplicated here since we can't wait for the maps API to load to be able to use them.\n */\nconst CollisionBehavior = {\n REQUIRED: 'REQUIRED',\n REQUIRED_AND_HIDES_OPTIONAL: 'REQUIRED_AND_HIDES_OPTIONAL',\n OPTIONAL_AND_HIDES_LOWER_PRIORITY: 'OPTIONAL_AND_HIDES_LOWER_PRIORITY'\n};\nconst AdvancedMarkerContext = React__default.createContext(null);\n// [xPosition, yPosition] when the top left corner is [0, 0]\n/**\n * @deprecated Using `anchorPosition` is deprecated.\n * Use `anchorLeft` and `anchorTop` instead.\n */\nconst AdvancedMarkerAnchorPoint = {\n TOP_LEFT: ['0%', '0%'],\n TOP_CENTER: ['50%', '0%'],\n TOP: ['50%', '0%'],\n TOP_RIGHT: ['100%', '0%'],\n LEFT_CENTER: ['0%', '50%'],\n LEFT_TOP: ['0%', '0%'],\n LEFT: ['0%', '50%'],\n LEFT_BOTTOM: ['0%', '100%'],\n RIGHT_TOP: ['100%', '0%'],\n RIGHT: ['100%', '50%'],\n RIGHT_CENTER: ['100%', '50%'],\n RIGHT_BOTTOM: ['100%', '100%'],\n BOTTOM_LEFT: ['0%', '100%'],\n BOTTOM_CENTER: ['50%', '100%'],\n BOTTOM: ['50%', '100%'],\n BOTTOM_RIGHT: ['100%', '100%'],\n CENTER: ['50%', '50%']\n};\nconst AdvancedMarker = forwardRef((props, ref) => {\n const { children, style, className, anchorPoint } = props;\n const [marker, contentContainer] = useAdvancedMarker(props);\n const advancedMarkerContextValue = useMemo(() => (marker ? { marker } : null), [marker]);\n useImperativeHandle(ref, () => marker, [marker]);\n if (!contentContainer)\n return null;\n return (React__default.createElement(AdvancedMarkerContext.Provider, { value: advancedMarkerContextValue }, createPortal(React__default.createElement(MarkerContent, { anchorPoint: anchorPoint, styles: style, className: className }, children), contentContainer)));\n});\nAdvancedMarker.displayName = 'AdvancedMarker';\nfunction useAdvancedMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback((m) => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\nfunction isAdvancedMarker(marker) {\n return (marker.content !== undefined);\n}\nfunction isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\nconst MarkerContent = ({ children, styles, className }) => {\n /* AdvancedMarker div that user can give styles and classes */\n return (React__default.createElement(\"div\", { className: className, style: styles }, children));\n};\nfunction useAdvancedMarker(props) {\n const [marker, setMarker] = useState(null);\n const [contentContainer, setContentContainer] = useState(null);\n const map = useMap();\n const markerLibrary = useMapsLibrary('marker');\n const { children, onClick, className, onMouseEnter, onMouseLeave, onDrag, onDragStart, onDragEnd, collisionBehavior, clickable, draggable, position, title, zIndex, anchorPoint, anchorLeft, anchorTop } = props;\n const numChildren = Children.count(children);\n // create an AdvancedMarkerElement instance and add it to the map once available\n useEffect(() => {\n if (!map || !markerLibrary)\n return;\n const newMarker = new markerLibrary.AdvancedMarkerElement();\n newMarker.map = map;\n setMarker(newMarker);\n // create the container for marker content if there are children\n let contentElement = null;\n if (numChildren > 0) {\n contentElement = document.createElement('div');\n newMarker.content = contentElement;\n setContentContainer(contentElement);\n }\n return () => {\n newMarker.map = null;\n contentElement === null || contentElement === void 0 ? void 0 : contentElement.remove();\n setMarker(null);\n setContentContainer(null);\n };\n }, [map, markerLibrary, numChildren]);\n // When no children are present we don't have our own wrapper div\n // which usually gets the user provided className. In this case\n // we set the className directly on the marker.content element that comes\n // with the AdvancedMarker.\n useEffect(() => {\n if (!(marker === null || marker === void 0 ? void 0 : marker.content) || !isElementNode(marker.content) || numChildren > 0)\n return;\n marker.content.className = className !== null && className !== void 0 ? className : '';\n }, [marker, className, numChildren]);\n useAdvancedMarkerAnchoring(marker, anchorPoint, anchorLeft, anchorTop, numChildren > 0);\n // copy other props\n usePropBinding(marker, 'position', position);\n usePropBinding(marker, 'title', title !== null && title !== void 0 ? title : '');\n usePropBinding(marker, 'zIndex', zIndex);\n usePropBinding(marker, 'collisionBehavior', collisionBehavior);\n // set gmpDraggable from props (when unspecified, it's true if any drag-event\n // callbacks are specified)\n useEffect(() => {\n if (!marker)\n return;\n if (draggable !== undefined)\n marker.gmpDraggable = draggable;\n else if (onDrag || onDragStart || onDragEnd)\n marker.gmpDraggable = true;\n else\n marker.gmpDraggable = false;\n }, [marker, draggable, onDrag, onDragEnd, onDragStart]);\n // set gmpClickable from props (when unspecified, it's true if the onClick or one of\n // the hover events callbacks are specified)\n useEffect(() => {\n if (!marker)\n return;\n // when clickable is defined, we will always use its value for gmpClickable.\n // otherwise we auto-detect based on existing event-handlers.\n const gmpClickable = clickable !== undefined\n ? clickable\n : Boolean(onClick) || Boolean(onMouseEnter) || Boolean(onMouseLeave);\n // gmpClickable is only available in beta version of the\n // maps api (as of 2024-10-10)\n marker.gmpClickable = gmpClickable;\n // enable pointer events for the markers with custom content\n if (gmpClickable && (marker === null || marker === void 0 ? void 0 : marker.content) && isElementNode(marker.content)) {\n marker.content.style.pointerEvents = 'all';\n if (onClick) {\n marker.content.style.cursor = 'pointer';\n }\n }\n }, [marker, clickable, onClick, onMouseEnter, onMouseLeave]);\n useMapsEventListener(marker, 'click', onClick);\n useMapsEventListener(marker, 'drag', onDrag);\n useMapsEventListener(marker, 'dragstart', onDragStart);\n useMapsEventListener(marker, 'dragend', onDragEnd);\n useDomEventListener(marker === null || marker === void 0 ? void 0 : marker.element, 'mouseenter', onMouseEnter);\n useDomEventListener(marker === null || marker === void 0 ? void 0 : marker.element, 'mouseleave', onMouseLeave);\n return [marker, contentContainer];\n}\nfunction useAdvancedMarkerAnchoring(marker, anchorPoint, anchorLeft, anchorTop, hasChildren) {\n useEffect(() => {\n if (!marker || !hasChildren)\n return;\n // The anchorLeft and anchorTop options are available since version 3.62.9c\n // With the release of 3.65 (~May 2026) there will no longer be a version\n // that doesn't support it.\n const anchorOptionsSupported = isVersionGreaterEqual(3, 62);\n const contentElement = marker.content;\n if (!contentElement || !isElementNode(contentElement))\n return;\n if (anchorLeft !== undefined || anchorTop !== undefined) {\n if (!anchorOptionsSupported) {\n console.warn('AdvancedMarker: The anchorLeft and anchorTop props are only supported ' +\n 'in Google Maps API version 3.62 and above. ' +\n `The current version is ${google.maps.version}.`);\n }\n marker.anchorLeft = anchorLeft;\n marker.anchorTop = anchorTop;\n // when anchorLeft and/or anchorTop are set, we'll ignore the anchorPoint\n if (anchorPoint !== undefined) {\n console.warn('AdvancedMarker: the anchorPoint prop is ignored when anchorLeft ' +\n 'and/or anchorTop are set.');\n }\n return;\n }\n if (anchorPoint !== undefined) {\n // TODO: add console.warn in a future version to inform about deprecation\n const [x, y] = anchorPoint !== null && anchorPoint !== void 0 ? anchorPoint : AdvancedMarkerAnchorPoint['BOTTOM'];\n // NOTE: since x and y can be any valid CSS length-percentage\n // value, we need to use calc() to negate them.\n const translateX = `calc(-1 * ${x})`;\n const translateY = `calc(-1 * ${y})`;\n if (anchorOptionsSupported) {\n // implement anchorPoint using the new anchorLeft and anchorTop options\n marker.anchorLeft = translateX;\n marker.anchorTop = translateY;\n // reset transform from legacy implementation\n contentElement.style.transform = '';\n }\n else {\n // The \"translate(50%, 100%)\" counters and resets the default\n // anchoring of the advanced marker element from the api\n contentElement.style.transform = `translate(50%, 100%) translate(${translateX}, ${translateY})`;\n // data-origin is needed to identify the custom marker content in the\n // InfoWindow component as well as in the global CSS used to disable\n // the pointer event when anchor points are used in older Google Maps\n // versions.\n marker.dataset.origin = 'rgm';\n globalStyleManager.addAdvancedMarkerPointerEventsOverwrite();\n }\n }\n }, [marker, anchorPoint, anchorLeft, anchorTop, hasChildren]);\n}\n\nfunction useCircle(props) {\n var _a, _b, _c;\n const { onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut, onRadiusChanged, onCenterChanged, center, defaultCenter, radius, defaultRadius } = props, destructuredOptions = __rest(props, [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\", \"onRadiusChanged\", \"onCenterChanged\", \"center\", \"defaultCenter\", \"radius\", \"defaultRadius\"]);\n const [circle, setCircle] = useState(null);\n const map = useMap();\n // Memoize options with automatic inference of clickable/draggable/editable\n const circleOptions = useMemoized(Object.assign(Object.assign({}, destructuredOptions), { clickable: (_a = destructuredOptions.clickable) !== null && _a !== void 0 ? _a : Boolean(onClick), draggable: (_b = destructuredOptions.draggable) !== null && _b !== void 0 ? _b : Boolean(onDrag || onDragStart || onDragEnd || onCenterChanged), editable: (_c = destructuredOptions.editable) !== null && _c !== void 0 ? _c : Boolean(onRadiusChanged) }), isDeepEqual);\n useEffect(() => {\n if (!map) {\n if (map === undefined)\n console.error('<Circle> has to be inside a Map component.');\n return;\n }\n const newCircle = new google.maps.Circle(Object.assign(Object.assign({}, circleOptions), { center: center !== null && center !== void 0 ? center : defaultCenter, radius: radius !== null && radius !== void 0 ? radius : defaultRadius }));\n newCircle.setMap(map);\n setCircle(newCircle);\n return () => {\n newCircle.setMap(null);\n setCircle(null);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- circle options are handled separately to avoid recreating the instance\n }, [map]);\n useMapsEventListener(circle, 'click', onClick);\n useMapsEventListener(circle, 'drag', onDrag);\n useMapsEventListener(circle, 'dragstart', onDragStart);\n useMapsEventListener(circle, 'dragend', onDragEnd);\n useMapsEventListener(circle, 'mouseover', onMouseOver);\n useMapsEventListener(circle, 'mouseout', onMouseOut);\n useMapsEventListener(circle, 'radius_changed', onRadiusChanged\n ? () => {\n const newRadius = circle === null || circle === void 0 ? void 0 : circle.getRadius();\n if (newRadius !== undefined)\n onRadiusChanged(newRadius);\n }\n : null);\n useMapsEventListener(circle, 'center_changed', onCenterChanged\n ? () => {\n onCenterChanged(circle === null || circle === void 0 ? void 0 : circle.getCenter());\n }\n : null);\n useEffect(() => {\n if (!circle)\n return;\n circle.setOptions(circleOptions);\n }, [circle, circleOptions]);\n // Sync controlled center prop with the circle instance\n useEffect(() => {\n if (!circle || !center)\n return;\n if (!latLngEquals(center, circle.getCenter())) {\n circle.setCenter(center);\n }\n }, [circle, center]);\n // Sync controlled radius prop with the circle instance\n useEffect(() => {\n if (!circle || radius === undefined)\n return;\n if (radius !== circle.getRadius()) {\n circle.setRadius(radius);\n }\n }, [circle, radius]);\n return circle;\n}\nconst Circle = forwardRef((props, ref) => {\n const circle = useCircle(props);\n useImperativeHandle(ref, () => circle, [circle]);\n return React__default.createElement(React__default.Fragment, null);\n});\nCircle.displayName = 'Circle';\n\nfunction setValueForStyles(element, styles, prevStyles) {\n if (styles != null && typeof styles !== 'object') {\n throw new Error('The `style` prop expects a mapping from style properties to values, ' +\n \"not a string. For example, style={{marginRight: spacing + 'em'}} when \" +\n 'using JSX.');\n }\n const elementStyle = element.style;\n // without `prevStyles`, just set all values\n if (prevStyles == null) {\n if (styles == null)\n return;\n for (const styleName in styles) {\n if (!styles.hasOwnProperty(styleName))\n continue;\n setValueForStyle(elementStyle, styleName, styles[styleName]);\n }\n return;\n }\n // unset all styles in `prevStyles` that aren't in `styles`\n for (const styleName in prevStyles) {\n if (prevStyles.hasOwnProperty(styleName) &&\n (styles == null || !styles.hasOwnProperty(styleName))) {\n // Clear style\n const isCustomProperty = styleName.indexOf('--') === 0;\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n }\n else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n }\n else {\n elementStyle[styleName] = '';\n }\n }\n }\n // only assign values from `styles` that are different from `prevStyles`\n if (styles == null)\n return;\n for (const styleName in styles) {\n const value = styles[styleName];\n if (styles.hasOwnProperty(styleName) &&\n prevStyles[styleName] !== value) {\n setValueForStyle(elementStyle, styleName, value);\n }\n }\n}\nfunction setValueForStyle(elementStyle, styleName, value) {\n const isCustomProperty = styleName.indexOf('--') === 0;\n // falsy values will unset the style property\n if (value == null || typeof value === 'boolean' || value === '') {\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n }\n else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n }\n else {\n elementStyle[styleName] = '';\n }\n }\n // custom properties can't be directly assigned\n else if (isCustomProperty) {\n elementStyle.setProperty(styleName, value);\n }\n // numeric values are treated as 'px' unless the style property expects unitless numbers\n else if (typeof value === 'number' &&\n value !== 0 &&\n !isUnitlessNumber(styleName)) {\n elementStyle[styleName] = value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n // everything else can just be assigned\n else {\n if (styleName === 'float') {\n elementStyle.cssFloat = value;\n }\n else {\n elementStyle[styleName] = ('' + value).trim();\n }\n }\n}\n// CSS properties which accept numbers but are not in units of \"px\".\nconst unitlessNumbers = new Set([\n 'animationIterationCount',\n 'aspectRatio',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'flex',\n 'flexGrow',\n 'flexPositive',\n 'flexShrink',\n 'flexNegative',\n 'flexOrder',\n 'gridArea',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowSpan',\n 'gridRowStart',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnSpan',\n 'gridColumnStart',\n 'fontWeight',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'scale',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n 'fillOpacity', // SVG-related properties\n 'floodOpacity',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth'\n]);\nfunction isUnitlessNumber(name) {\n return unitlessNumbers.has(name);\n}\n\n/**\n * Component to render an Info Window with the Maps JavaScript API\n */\nconst InfoWindow = props => {\n const { \n // content options\n children, headerContent, style, className, pixelOffset, \n // open options\n anchor, shouldFocus, \n // events\n onClose, onCloseClick } = props, \n // other options\n volatileInfoWindowOptions = __rest(props, [\"children\", \"headerContent\", \"style\", \"className\", \"pixelOffset\", \"anchor\", \"shouldFocus\", \"onClose\", \"onCloseClick\"]);\n // ## create infowindow instance once the mapsLibrary is available.\n const mapsLibrary = useMapsLibrary('maps');\n const [infoWindow, setInfoWindow] = useState(null);\n const contentContainerRef = useRef$1(null);\n const headerContainerRef = useRef$1(null);\n const infoWindowOptions = useMemoized(volatileInfoWindowOptions, isDeepEqual);\n // ---- initial mount: create content- and header container, create and\n // configure the InfoWindow instance\n useEffect(() => {\n if (!mapsLibrary)\n return;\n contentContainerRef.current = document.createElement('div');\n headerContainerRef.current = document.createElement('div');\n const opts = Object.assign({}, infoWindowOptions);\n if (pixelOffset) {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (headerContent) {\n // if headerContent is specified as string we can directly forward it,\n // otherwise we'll pass the element the portal will render into\n opts.headerContent =\n typeof headerContent === 'string'\n ? headerContent\n : headerContainerRef.current;\n }\n // intentionally shadowing the state variables here\n const infoWindow = new google.maps.InfoWindow(opts);\n infoWindow.setContent(contentContainerRef.current);\n setInfoWindow(infoWindow);\n // unmount: remove infoWindow and content elements (note: close is called in a different effect-cleanup)\n return () => {\n var _a, _b;\n infoWindow.setContent(null);\n (_a = contentContainerRef.current) === null || _a === void 0 ? void 0 : _a.remove();\n (_b = headerContainerRef.current) === null || _b === void 0 ? void 0 : _b.remove();\n contentContainerRef.current = null;\n headerContainerRef.current = null;\n setInfoWindow(null);\n };\n }, \n // `infoWindowOptions` and other props are missing from dependencies:\n //\n // We don't want to re-create the infowindow instance\n // when the options change.\n // Updating the options is handled in the useEffect below.\n //\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [mapsLibrary]);\n // ---- update className and styles for `contentContainer`\n // prevStyleRef stores previously applied style properties, so they can be\n // removed when unset\n const prevStyleRef = useRef$1(null);\n useLayoutEffect$1(() => {\n if (!infoWindow || !contentContainerRef.current)\n return;\n setValueForStyles(contentContainerRef.current, style || null, prevStyleRef.current);\n prevStyleRef.current = style || null;\n if (className !== contentContainerRef.current.className)\n contentContainerRef.current.className = className || '';\n }, [infoWindow, className, style]);\n // ---- update options\n useEffect(() => {\n if (!infoWindow)\n return;\n const opts = Object.assign({}, infoWindowOptions);\n if (!pixelOffset) {\n opts.pixelOffset = null;\n }\n else {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (!headerContent) {\n opts.headerContent = null;\n }\n else {\n opts.headerContent =\n typeof headerContent === 'string'\n ? headerContent\n : headerContainerRef.current;\n }\n infoWindow.setOptions(opts);\n }, \n // dependency `infoWindow` isn't needed since options are also passed\n // to the constructor when a new infoWindow is created.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [infoWindowOptions, pixelOffset, headerContent]);\n // ---- bind event handlers\n useMapsEventListener(infoWindow, 'close', onClose);\n useMapsEventListener(infoWindow, 'closeclick', onCloseClick);\n // ---- open info window when content and map are available\n const map = useMap();\n useEffect(() => {\n var _a;\n // `anchor === null` means an anchor is defined but not ready yet.\n if (!map || !infoWindow || anchor === null)\n return;\n const isOpenedWithAnchor = !!anchor;\n const openOptions = { map };\n if (anchor) {\n openOptions.anchor = anchor;\n // Only do the infowindow adjusting when dealing with an AdvancedMarker\n if (isAdvancedMarker(anchor) && anchor.content instanceof Element) {\n const anchorBcr = anchor === null || anchor === void 0 ? void 0 : anchor.getBoundingClientRect();\n // This checks whether or not the anchor has custom content with our own\n // div wrapper. If not, that means we have a regular AdvancedMarker without\n // children, or an AdvancedMarker that uses the anchorLeft/anchorTop props.\n // In that case we do not want to adjust the infowindow since it is all handled correctly\n // by the Google Maps API.\n if (anchorBcr && anchor.dataset.origin === 'rgm') {\n // We can safely typecast here since we control that element and we know that\n // it is a div\n const anchorDomContent = (_a = anchor.content.firstElementChild) === null || _a === void 0 ? void 0 : _a.firstElementChild;\n const contentBcr = anchorDomContent === null || anchorDomContent === void 0 ? void 0 : anchorDomContent.getBoundingClientRect();\n // center infowindow above marker\n const anchorOffsetX = contentBcr.x -\n anchorBcr.x +\n (contentBcr.width - anchorBcr.width) / 2;\n const anchorOffsetY = contentBcr.y - anchorBcr.y;\n const opts = Object.assign({}, infoWindowOptions);\n opts.pixelOffset = new google.maps.Size(pixelOffset ? pixelOffset[0] + anchorOffsetX : anchorOffsetX, pixelOffset ? pixelOffset[1] + anchorOffsetY : anchorOffsetY);\n infoWindow.setOptions(opts);\n }\n }\n }\n if (shouldFocus !== undefined) {\n openOptions.shouldFocus = shouldFocus;\n }\n infoWindow.open(openOptions);\n return () => {\n // Note: when the infowindow has an anchor, it will automatically show up again when the\n // anchor was removed from the map before infoWindow.close() is called but the it gets\n // added back to the map after that.\n // More information here: https://issuetracker.google.com/issues/343750849\n if (isOpenedWithAnchor)\n infoWindow.set('anchor', null);\n infoWindow.close();\n };\n }, [infoWindow, anchor, map, shouldFocus, infoWindowOptions, pixelOffset]);\n return (React__default.createElement(React__default.Fragment, null,\n contentContainerRef.current &&\n createPortal(children, contentContainerRef.current),\n headerContainerRef.current !== null &&\n createPortal(headerContent, headerContainerRef.current)));\n};\n\n/**\n * Extracts paths as a nested array from a Polygon instance.\n */\nfunction getPathsArray(polygon) {\n const mvcPaths = polygon.getPaths();\n const result = [];\n for (let i = 0; i < mvcPaths.getLength(); i++) {\n result.push(mvcPaths.getAt(i).getArray());\n }\n return result;\n}\nfunction usePolygon(props) {\n var _a, _b, _c;\n const { onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut, onPathsChanged, polygon: externalPolygon, encodedPaths, paths, defaultPaths } = props, destructuredOptions = __rest(props, [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\", \"onPathsChanged\", \"polygon\", \"encodedPaths\", \"paths\", \"defaultPaths\"]);\n const [polygon, setPolygon] = useState(null);\n const map = useMap();\n const geometryLibrary = useMapsLibrary('geometry');\n // Track if we're programmatically updating to avoid firing onPathsChanged\n const isUpdatingRef = useRef$1(false);\n // Memoize options with automatic inference of clickable/draggable/editable\n const polygonOptions = useMemoized(Object.assign(Object.assign({}, destructuredOptions), { clickable: (_a = destructuredOptions.clickable) !== null && _a !== void 0 ? _a : Boolean(onClick), draggable: (_b = destructuredOptions.draggable) !== null && _b !== void 0 ? _b : Boolean(onDrag || onDragStart || onDragEnd || onPathsChanged), editable: (_c = destructuredOptions.editable) !== null && _c !== void 0 ? _c : Boolean(onPathsChanged) }), isDeepEqual);\n useEffect(() => {\n if (!map) {\n if (map === undefined)\n console.error('<Polygon> has to be inside a Map component.');\n return;\n }\n // Use provided instance or create a new one\n let instance;\n if (externalPolygon) {\n instance = externalPolygon;\n // Apply initial paths and options to the existing instance\n const initialPaths = paths !== null && paths !== void 0 ? paths : defaultPaths;\n if (initialPaths && Array.isArray(initialPaths)) {\n instance.setPaths(initialPaths);\n }\n instance.setOptions(polygonOptions);\n }\n else {\n const initialPaths = paths !== null && paths !== void 0 ? paths : defaultPaths;\n const polygonOptionsWithPaths = Object.assign({}, polygonOptions);\n // Google Maps throws \"not an Array\" error if paths is undefined\n if (initialPaths && Array.isArray(initialPaths)) {\n polygonOptionsWithPaths.paths = initialPaths;\n }\n instance = new google.maps.Polygon(polygonOptionsWithPaths);\n }\n instance.setMap(map);\n setPolygon(instance);\n return () => {\n instance.setMap(null);\n setPolygon(null);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- options are handled separately to avoid recreating the instance\n }, [map, externalPolygon]);\n useMapsEventListener(polygon, 'click', onClick);\n useMapsEventListener(polygon, 'drag', onDrag);\n useMapsEventListener(polygon, 'dragstart', onDragStart);\n useMapsEventListener(polygon, 'mouseover', onMouseOver);\n useMapsEventListener(polygon, 'mouseout', onMouseOut);\n // Fire onPathsChanged on dragend (when whole polygon is dragged)\n useMapsEventListener(polygon, 'dragend', (e) => {\n onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(e);\n if (onPathsChanged && polygon && !isUpdatingRef.current) {\n onPathsChanged(getPathsArray(polygon));\n }\n });\n // Subscribe to MVCArray events for vertex-level edits\n useEffect(() => {\n if (!polygon || !onPathsChanged)\n return;\n const listeners = [];\n const mvcPaths = polygon.getPaths();\n if (typeof mvcPaths.getLength !==\n 'function' ||\n typeof mvcPaths.getAt !== 'function') {\n return;\n }\n const handlePathsChange = () => {\n if (!isUpdatingRef.current) {\n onPathsChanged(getPathsArray(polygon));\n }\n };\n // Subscribe to each inner path's events\n const subscribeToInnerPath = (innerPath) => {\n listeners.push(google.maps.event.addListener(innerPath, 'insert_at', handlePathsChange));\n listeners.push(google.maps.event.addListener(innerPath, 'remove_at', handlePathsChange));\n listeners.push(google.maps.event.addListener(innerPath, 'set_at', handlePathsChange));\n };\n // Subscribe to existing inner paths\n for (let i = 0; i < mvcPaths.getLength(); i++) {\n subscribeToInnerPath(mvcPaths.getAt(i));\n }\n // Subscribe to outer array changes (paths added/removed)\n listeners.push(google.maps.event.addListener(mvcPaths, 'insert_at', (index) => {\n subscribeToInnerPath(mvcPaths.getAt(index));\n handlePathsChange();\n }));\n listeners.push(google.maps.event.addListener(mvcPaths, 'set_at', (index) => {\n subscribeToInnerPath(mvcPaths.getAt(index));\n handlePathsChange();\n }));\n listeners.push(google.maps.event.addListener(mvcPaths, 'remove_at', handlePathsChange));\n return () => {\n listeners.forEach(listener => listener.remove());\n };\n }, [\n polygon,\n onPathsChanged,\n paths,\n encodedPaths,\n polygonOptions.editable,\n polygonOptions.draggable\n ]);\n useEffect(() => {\n if (!polygon)\n return;\n polygon.setOptions(polygonOptions);\n }, [polygon, polygonOptions]);\n // Sync controlled paths prop with the polygon instance\n useEffect(() => {\n if (!polygon || !paths)\n return;\n if (!Array.isArray(paths))\n return;\n // Normalize to nested array for comparison\n const firstPath = paths[0];\n const normalizedPaths = Array.isArray(firstPath) ? paths : [paths];\n const currentPaths = polygon.getPaths();\n if (!pathsEquals(normalizedPaths, currentPaths)) {\n isUpdatingRef.current = true;\n polygon.setPaths(paths);\n isUpdatingRef.current = false;\n }\n }, [polygon, paths]);\n // Handle encoded paths\n useEffect(() => {\n if (!polygon || !encodedPaths || !geometryLibrary)\n return;\n isUpdatingRef.current = true;\n const decodedPaths = encodedPaths.map(encodedPath => geometryLibrary.encoding.decodePath(encodedPath));\n polygon.setPaths(decodedPaths);\n isUpdatingRef.current = false;\n }, [polygon, encodedPaths, geometryLibrary]);\n return polygon;\n}\nconst Polygon = forwardRef((props, ref) => {\n const polygon = usePolygon(props);\n useImperativeHandle(ref, () => polygon, [polygon]);\n return React__default.createElement(React__default.Fragment, null);\n});\nPolygon.displayName = 'Polygon';\n\nfunction usePolyline(props) {\n var _a, _b, _c;\n const { onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut, onPathChanged, polyline: externalPolyline, encodedPath, path, defaultPath } = props, destructuredOptions = __rest(props, [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\", \"onPathChanged\", \"polyline\", \"encodedPath\", \"path\", \"defaultPath\"]);\n const [polyline, setPolyline] = useState(null);\n const map = useMap();\n const geometryLibrary = useMapsLibrary('geometry');\n // Track if we're programmatically updating to avoid firing onPathChanged\n const isUpdatingRef = useRef$1(false);\n // Memoize options with automatic inference of clickable/draggable/editable\n const polylineOptions = useMemoized(Object.assign(Object.assign({}, destructuredOptions), { clickable: (_a = destructuredOptions.clickable) !== null && _a !== void 0 ? _a : Boolean(onClick), draggable: (_b = destructuredOptions.draggable) !== null && _b !== void 0 ? _b : Boolean(onDrag || onDragStart || onDragEnd || onPathChanged), editable: (_c = destructuredOptions.editable) !== null && _c !== void 0 ? _c : Boolean(onPathChanged) }), isDeepEqual);\n useEffect(() => {\n if (!map) {\n if (map === undefined)\n console.error('<Polyline> has to be inside a Map component.');\n return;\n }\n // Use provided instance or create a new one\n let instance;\n if (externalPolyline) {\n instance = externalPolyline;\n // Apply initial path and options to the existing instance\n const initialPath = path !== null && path !== void 0 ? path : defaultPath;\n if (initialPath && Array.isArray(initialPath)) {\n instance.setPath(initialPath);\n }\n instance.setOptions(polylineOptions);\n }\n else {\n const initialPath = path !== null && path !== void 0 ? path : defaultPath;\n const polylineOptionsWithPath = Object.assign({}, polylineOptions);\n // Google Maps throws \"not an Array\" error if path is undefined\n if (initialPath && Array.isArray(initialPath)) {\n polylineOptionsWithPath.path = initialPath;\n }\n instance = new google.maps.Polyline(polylineOptionsWithPath);\n }\n instance.setMap(map);\n setPolyline(instance);\n return () => {\n instance.setMap(null);\n setPolyline(null);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- options are handled separately to avoid recreating the instance\n }, [map, externalPolyline]);\n useMapsEventListener(polyline, 'click', onClick);\n useMapsEventListener(polyline, 'drag', onDrag);\n useMapsEventListener(polyline, 'dragstart', onDragStart);\n useMapsEventListener(polyline, 'mouseover', onMouseOver);\n useMapsEventListener(polyline, 'mouseout', onMouseOut);\n // Fire onPathChanged on dragend (when whole polyline is dragged)\n useMapsEventListener(polyline, 'dragend', (e) => {\n onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(e);\n if (onPathChanged && polyline && !isUpdatingRef.current) {\n onPathChanged(polyline.getPath().getArray());\n }\n });\n // Subscribe to MVCArray events for vertex-level edits\n useEffect(() => {\n if (!polyline || !onPathChanged)\n return;\n const mvcPath = polyline.getPath();\n if (!mvcPath)\n return;\n const handlePathChange = () => {\n if (!isUpdatingRef.current) {\n onPathChanged(mvcPath.getArray());\n }\n };\n const listeners = [\n google.maps.event.addListener(mvcPath, 'insert_at', handlePathChange),\n google.maps.event.addListener(mvcPath, 'remove_at', handlePathChange),\n google.maps.event.addListener(mvcPath, 'set_at', handlePathChange)\n ];\n return () => {\n listeners.forEach(listener => listener.remove());\n };\n }, [\n polyline,\n onPathChanged,\n path,\n encodedPath,\n polylineOptions.editable,\n polylineOptions.draggable\n ]);\n useEffect(() => {\n if (!polyline)\n return;\n polyline.setOptions(polylineOptions);\n }, [polyline, polylineOptions]);\n // Sync controlled path prop with the polyline instance\n useEffect(() => {\n if (!polyline || !path)\n return;\n const currentPath = polyline.getPath();\n if (!pathEquals(path, currentPath)) {\n isUpdatingRef.current = true;\n polyline.setPath(path);\n isUpdatingRef.current = false;\n }\n }, [polyline, path]);\n // Handle encoded path\n useEffect(() => {\n if (!polyline || !encodedPath || !geometryLibrary)\n return;\n isUpdatingRef.current = true;\n const decodedPath = geometryLibrary.encoding.decodePath(encodedPath);\n polyline.setPath(decodedPath);\n isUpdatingRef.current = false;\n }, [polyline, encodedPath, geometryLibrary]);\n return polyline;\n}\nconst Polyline = forwardRef((props, ref) => {\n const polyline = usePolyline(props);\n useImperativeHandle(ref, () => polyline, [polyline]);\n return React__default.createElement(React__default.Fragment, null);\n});\nPolyline.displayName = 'Polyline';\n\nconst DEFAULT_CAMERA_STATE = {\n center: { lat: 0, lng: 0, altitude: 0 },\n range: 0,\n heading: 0,\n tilt: 0,\n roll: 0\n};\n/**\n * Camera property names that correspond to gmp-*change events.\n */\nconst CAMERA_PROPS = ['center', 'range', 'heading', 'tilt', 'roll'];\n/**\n * Updates the camera state ref with values from the map element.\n */\nfunction updateCameraState(map3d, ref, prop) {\n const value = map3d[prop];\n if (value == null)\n return;\n if (prop === 'center') {\n // The center property returns a LatLngAltitude object, convert to literal\n const center = value;\n ref.current.center = center.toJSON\n ? center.toJSON()\n : center;\n }\n else {\n ref.current[prop] = value;\n }\n}\n/**\n * Creates a mutable ref object to track the last known state of the 3D map camera.\n * This is used in `useMap3DCameraParams` to reduce stuttering by avoiding updates\n * of the map camera with values that have already been processed.\n *\n * @internal\n */\nfunction useTrackedCameraStateRef3D(map3d) {\n const forceUpdate = useForceUpdate();\n const ref = useRef$1(Object.assign({}, DEFAULT_CAMERA_STATE));\n useEffect(() => {\n if (!map3d)\n return;\n const listeners = [];\n for (const prop of CAMERA_PROPS) {\n const eventName = `gmp-${prop}change`;\n const handler = () => {\n updateCameraState(map3d, ref, prop);\n forceUpdate();\n };\n map3d.addEventListener(eventName, handler);\n listeners.push(() => map3d.removeEventListener(eventName, handler));\n }\n return () => {\n for (const removeListener of listeners) {\n removeListener();\n }\n };\n }, [map3d, forceUpdate]);\n return ref;\n}\n\n/**\n * Hook to manage the Map3DElement instance lifecycle.\n *\n * Handles:\n * - Waiting for the 'maps3d' library to load\n * - Waiting for the 'gmp-map-3d' custom element to be defined\n * - Creating a callback ref for the element\n * - Applying initial options when the element is ready\n * - Tracking camera state\n *\n * @internal\n */\nfunction useMap3DInstance(props) {\n const maps3dLib = useMapsLibrary('maps3d');\n const [customElementReady, setCustomElementReady] = useState(false);\n const [, containerRef] = useCallbackRef();\n const [map3d, map3dRef] = useCallbackRef();\n const cameraStateRef = useTrackedCameraStateRef3D(map3d);\n useEffect(() => {\n customElements.whenDefined('gmp-map-3d').then(() => {\n setCustomElementReady(true);\n });\n }, []);\n // Apply initial options once when the element is first available\n useEffect(() => {\n if (!map3d)\n return;\n const { center, heading, tilt, range, roll, defaultCenter, defaultHeading, defaultTilt, defaultRange, defaultRoll, \n // Non-element props to exclude\n id, style, className, children, onCenterChanged, onHeadingChanged, onTiltChanged, onRangeChanged, onRollChanged, onCameraChanged, onClick, onSteadyChange, onAnimationEnd, onError, mode, gestureHandling } = props, elementOptions = __rest(props, [\"center\", \"heading\", \"tilt\", \"range\", \"roll\", \"defaultCenter\", \"defaultHeading\", \"defaultTilt\", \"defaultRange\", \"defaultRoll\", \"id\", \"style\", \"className\", \"children\", \"onCenterChanged\", \"onHeadingChanged\", \"onTiltChanged\", \"onRangeChanged\", \"onRollChanged\", \"onCameraChanged\", \"onClick\", \"onSteadyChange\", \"onAnimationEnd\", \"onError\", \"mode\", \"gestureHandling\"]);\n const initialCenter = center !== null && center !== void 0 ? center : defaultCenter;\n const initialHeading = heading !== null && heading !== void 0 ? heading : defaultHeading;\n const initialTilt = tilt !== null && tilt !== void 0 ? tilt : defaultTilt;\n const initialRange = range !== null && range !== void 0 ? range : defaultRange;\n const initialRoll = roll !== null && roll !== void 0 ? roll : defaultRoll;\n const initialOptions = Object.assign({}, elementOptions);\n if (initialCenter)\n initialOptions.center = initialCenter;\n if (initialHeading !== undefined)\n initialOptions.heading = initialHeading;\n if (initialTilt !== undefined)\n initialOptions.tilt = initialTilt;\n if (initialRange !== undefined)\n initialOptions.range = initialRange;\n if (initialRoll !== undefined)\n initialOptions.roll = initialRoll;\n Object.assign(map3d, initialOptions);\n }, \n // this effect should only run when the map3d element first becomes\n // available, so we skip re-running it when other props change.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [map3d]);\n const isReady = !!maps3dLib && customElementReady;\n return [map3d, containerRef, map3dRef, cameraStateRef, isReady];\n}\n\n/* eslint-disable react-hooks/immutability -- Google Maps API objects are designed to be mutated */\n/**\n * Converts a LatLngAltitude or LatLngAltitudeLiteral to a literal object.\n */\nfunction toLatLngAltitudeLiteral(value) {\n if (!value)\n return null;\n // Check if it's a LatLngAltitude object with toJSON method\n if ('toJSON' in value && typeof value.toJSON === 'function') {\n return value.toJSON();\n }\n return value;\n}\n/**\n * Hook to update Map3D camera parameters when props change.\n * Compares the current camera state with props and updates only when there are differences.\n *\n * @internal\n */\nfunction useMap3DCameraParams(map3d, cameraStateRef, props) {\n var _a, _b, _c, _d, _e, _f, _g;\n const centerLiteral = toLatLngAltitudeLiteral(props.center);\n const lat = (_a = centerLiteral === null || centerLiteral === void 0 ? void 0 : centerLiteral.lat) !== null && _a !== void 0 ? _a : null;\n const lng = (_b = centerLiteral === null || centerLiteral === void 0 ? void 0 : centerLiteral.lng) !== null && _b !== void 0 ? _b : null;\n const altitude = (_c = centerLiteral === null || centerLiteral === void 0 ? void 0 : centerLiteral.altitude) !== null && _c !== void 0 ? _c : null;\n const range = (_d = props.range) !== null && _d !== void 0 ? _d : null;\n const heading = (_e = props.heading) !== null && _e !== void 0 ? _e : null;\n const tilt = (_f = props.tilt) !== null && _f !== void 0 ? _f : null;\n const roll = (_g = props.roll) !== null && _g !== void 0 ? _g : null;\n // Runs on every render to sync controlled camera props with the map element\n useLayoutEffect$1(() => {\n var _a;\n if (!map3d)\n return;\n const currentState = cameraStateRef.current;\n if (lat !== null &&\n lng !== null &&\n (currentState.center.lat !== lat ||\n currentState.center.lng !== lng ||\n (altitude !== null && currentState.center.altitude !== altitude))) {\n map3d.center = {\n lat,\n lng,\n altitude: (_a = altitude !== null && altitude !== void 0 ? altitude : currentState.center.altitude) !== null && _a !== void 0 ? _a : 0\n };\n }\n if (range !== null && currentState.range !== range) {\n map3d.range = range;\n }\n if (heading !== null && currentState.heading !== heading) {\n map3d.heading = heading;\n }\n if (tilt !== null && currentState.tilt !== tilt) {\n map3d.tilt = tilt;\n }\n if (roll !== null && currentState.roll !== roll) {\n map3d.roll = roll;\n }\n });\n}\n\n/**\n * Camera-related event types for the aggregated onCameraChanged handler.\n */\nconst CAMERA_EVENTS = [\n 'gmp-centerchange',\n 'gmp-headingchange',\n 'gmp-tiltchange',\n 'gmp-rangechange',\n 'gmp-rollchange'\n];\n/**\n * Creates a camera changed event with current camera state.\n */\nfunction createCameraEvent(map3d, type) {\n const center = map3d.center;\n // Normalize center to LatLngAltitudeLiteral\n // If center is a LatLngAltitude class instance, it has a toJSON method\n // Otherwise it's already a literal object\n let centerLiteral;\n if (center && 'toJSON' in center && typeof center.toJSON === 'function') {\n centerLiteral = center.toJSON();\n }\n else if (center) {\n centerLiteral = center;\n }\n else {\n centerLiteral = { lat: 0, lng: 0, altitude: 0 };\n }\n return {\n type,\n map3d,\n detail: {\n center: centerLiteral,\n range: map3d.range || 0,\n heading: map3d.heading || 0,\n tilt: map3d.tilt || 0,\n roll: map3d.roll || 0\n }\n };\n}\n/**\n * Creates a click event from a LocationClickEvent or PlaceClickEvent.\n */\nfunction createClickEvent(map3d, srcEvent) {\n const placeClickEvent = srcEvent;\n return {\n type: 'gmp-click',\n map3d,\n detail: {\n position: srcEvent.position || null,\n placeId: placeClickEvent.placeId\n }\n };\n}\n/**\n * Creates a steady change event.\n */\nfunction createSteadyChangeEvent(map3d, srcEvent) {\n return {\n type: 'gmp-steadychange',\n map3d,\n detail: {\n isSteady: srcEvent.isSteady\n }\n };\n}\n/**\n * Hook to set up event handlers for Map3D events.\n *\n * @internal\n */\nfunction useMap3DEvents(map3d, props) {\n const { onCenterChanged, onHeadingChanged, onTiltChanged, onRangeChanged, onRollChanged, onCameraChanged, onClick, onSteadyChange, onAnimationEnd, onError } = props;\n useMap3DEvent(map3d, 'gmp-centerchange', onCenterChanged, createCameraEvent);\n useMap3DEvent(map3d, 'gmp-headingchange', onHeadingChanged, createCameraEvent);\n useMap3DEvent(map3d, 'gmp-tiltchange', onTiltChanged, createCameraEvent);\n useMap3DEvent(map3d, 'gmp-rangechange', onRangeChanged, createCameraEvent);\n useMap3DEvent(map3d, 'gmp-rollchange', onRollChanged, createCameraEvent);\n // onCameraChanged aggregates all camera property change events into one handler\n useEffect(() => {\n if (!map3d || !onCameraChanged)\n return;\n const handler = () => {\n onCameraChanged(createCameraEvent(map3d, 'camerachange'));\n };\n for (const eventName of CAMERA_EVENTS) {\n map3d.addEventListener(eventName, handler);\n }\n return () => {\n for (const eventName of CAMERA_EVENTS) {\n map3d.removeEventListener(eventName, handler);\n }\n };\n }, [map3d, onCameraChanged]);\n useEffect(() => {\n if (!map3d || !onClick)\n return;\n const handler = (ev) => {\n onClick(createClickEvent(map3d, ev));\n };\n map3d.addEventListener('gmp-click', handler);\n return () => map3d.removeEventListener('gmp-click', handler);\n }, [map3d, onClick]);\n useEffect(() => {\n if (!map3d || !onSteadyChange)\n return;\n const handler = (ev) => {\n onSteadyChange(createSteadyChangeEvent(map3d, ev));\n };\n map3d.addEventListener('gmp-steadychange', handler);\n return () => map3d.removeEventListener('gmp-steadychange', handler);\n }, [map3d, onSteadyChange]);\n useMap3DEvent(map3d, 'gmp-animationend', onAnimationEnd, (map3d, type) => ({\n type,\n map3d\n }));\n useMap3DEvent(map3d, 'gmp-error', onError, (map3d, type) => ({\n type,\n map3d\n }));\n}\n/**\n * Helper hook for individual events.\n */\nfunction useMap3DEvent(map3d, eventName, handler, createEvent) {\n useEffect(() => {\n if (!map3d || !handler)\n return;\n const listener = () => {\n handler(createEvent(map3d, eventName));\n };\n map3d.addEventListener(eventName, listener);\n return () => map3d.removeEventListener(eventName, listener);\n }, [map3d, eventName, handler, createEvent]);\n}\n\n/**\n * Set of option keys that can be updated on Map3DElement.\n * Camera props (center, heading, tilt, range, roll) are handled separately.\n */\nconst MAP_3D_OPTION_KEYS = new Set([\n 'bounds',\n 'defaultUIHidden',\n 'gestureHandling',\n 'internalUsageAttributionIds',\n 'maxAltitude',\n 'maxHeading',\n 'maxTilt',\n 'minAltitude',\n 'minHeading',\n 'minTilt',\n 'mode'\n]);\n/**\n * Hook to update Map3D options when props change.\n *\n * @internal\n */\nfunction useMap3DOptions(map3d, props) {\n // Filter props to only include valid option keys, memoized to avoid\n // creating a new object on every render\n const options = useMemo(() => {\n const result = {};\n const keys = Object.keys(props);\n for (const key of keys) {\n if (!MAP_3D_OPTION_KEYS.has(key))\n continue;\n const value = props[key];\n if (value === undefined)\n continue;\n result[key] = value;\n }\n return result;\n }, [props]);\n useDeepCompareEffect(() => {\n if (!map3d)\n return;\n Object.assign(map3d, options);\n }, [map3d, options]);\n}\n\n/**\n * MapMode for specifying how the 3D map should be rendered.\n * This mirrors google.maps.maps3d.MapMode but is available without waiting for the API to load.\n */\nconst MapMode = {\n /** This map mode displays a transparent layer of major streets on satellite imagery. */\n HYBRID: 'HYBRID',\n /** This map mode displays satellite or photorealistic imagery. */\n SATELLITE: 'SATELLITE'\n};\n/**\n * GestureHandling for specifying how gesture events should be handled on the map.\n * This mirrors google.maps.maps3d.GestureHandling but is available without waiting for the API to load.\n */\nconst GestureHandling = {\n /**\n * This lets the map choose whether to use cooperative or greedy gesture handling.\n * This is the default behavior if not specified.\n */\n AUTO: 'AUTO',\n /**\n * This forces cooperative mode, where modifier keys or two-finger gestures\n * are required to scroll the map.\n */\n COOPERATIVE: 'COOPERATIVE',\n /**\n * This forces greedy mode, where the host page cannot be scrolled from user\n * events on the map element.\n */\n GREEDY: 'GREEDY'\n};\n/**\n * React context for accessing the Map3D instance from child components.\n */\nconst GoogleMaps3DContext = React__default.createContext(null);\n/**\n * Default styles for the map container.\n */\nconst DEFAULT_CONTAINER_STYLE = {\n width: '100%',\n height: '100%',\n position: 'relative'\n};\n/**\n * A React component that renders a 3D map using the Google Maps JavaScript API.\n *\n * @example\n * ```tsx\n * <APIProvider apiKey={API_KEY}>\n * <Map3D\n * defaultCenter={{ lat: 37.7749, lng: -122.4194, altitude: 1000 }}\n * defaultRange={5000}\n * defaultHeading={0}\n * defaultTilt={45}\n * />\n * </APIProvider>\n * ```\n */\nconst Map3D = forwardRef((props, ref) => {\n const { children, id, className, style } = props;\n // Verify we're inside an APIProvider\n const context = useContext(APIProviderContext);\n if (!context) {\n throw new Error('<Map3D> can only be used inside an <APIProvider> component.');\n }\n const { addMap3DInstance, removeMap3DInstance } = context;\n const [map3d, containerRef, map3dRef, cameraStateRef, isReady] = useMap3DInstance(props);\n useMap3DCameraParams(map3d, cameraStateRef, props);\n useMap3DEvents(map3d, props);\n useMap3DOptions(map3d, props);\n useEffect(() => {\n if (!map3d)\n return;\n const instanceId = id !== null && id !== void 0 ? id : 'default';\n addMap3DInstance(map3d, instanceId);\n return () => {\n removeMap3DInstance(instanceId);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [map3d, id]);\n useImperativeHandle(ref, () => ({\n map3d,\n flyCameraAround: (options) => {\n map3d === null || map3d === void 0 ? void 0 : map3d.flyCameraAround(options);\n },\n flyCameraTo: (options) => {\n map3d === null || map3d === void 0 ? void 0 : map3d.flyCameraTo(options);\n },\n stopCameraAnimation: () => {\n map3d === null || map3d === void 0 ? void 0 : map3d.stopCameraAnimation();\n }\n }), [map3d]);\n const combinedStyle = useMemo(() => (Object.assign(Object.assign({}, DEFAULT_CONTAINER_STYLE), style)), [style]);\n const contextValue = useMemo(() => ({ map3d }), [map3d]);\n if (!isReady) {\n return (React__default.createElement(\"div\", Object.assign({ ref: containerRef, \"data-testid\": \"map-3d\", style: className ? undefined : combinedStyle, className: className }, (id ? { id } : {}))));\n }\n return (React__default.createElement(\"div\", Object.assign({ ref: containerRef, \"data-testid\": \"map-3d\", style: className ? undefined : combinedStyle, className: className }, (id ? { id } : {})),\n React__default.createElement(\"gmp-map-3d\", { ref: map3dRef, style: { width: '100%', height: '100%' } }, map3d && (React__default.createElement(GoogleMaps3DContext.Provider, { value: contextValue }, children)))));\n});\nMap3D.displayName = 'Map3D';\n\nconst Marker3DContext = createContext(null);\n/**\n * Hook to access the Marker3D context.\n */\nfunction useMarker3D() {\n return useContext(Marker3DContext);\n}\n/**\n * AltitudeMode for specifying how altitude is interpreted for 3D elements.\n * This mirrors google.maps.maps3d.AltitudeMode but is available without waiting for the API to load.\n */\nconst AltitudeMode = {\n /** Allows to express objects relative to the average mean sea level. */\n ABSOLUTE: 'ABSOLUTE',\n /** Allows to express objects placed on the ground. */\n CLAMP_TO_GROUND: 'CLAMP_TO_GROUND',\n /** Allows to express objects relative to the ground surface. */\n RELATIVE_TO_GROUND: 'RELATIVE_TO_GROUND',\n /** Allows to express objects relative to the highest of ground+building+water surface. */\n RELATIVE_TO_MESH: 'RELATIVE_TO_MESH'\n};\n/**\n * Marker3D component for displaying markers on a Map3D.\n *\n * Automatically uses Marker3DInteractiveElement when onClick is provided,\n * otherwise uses Marker3DElement.\n *\n * Children can include:\n * - `<img>` elements (automatically wrapped in <template>)\n * - `<svg>` elements (automatically wrapped in <template>)\n * - PinElement instances (passed through directly)\n *\n * @example\n * ```tsx\n * // Basic marker\n * <Marker3D position={{ lat: 37.7749, lng: -122.4194 }} label=\"SF\" />\n *\n * // Interactive marker\n * <Marker3D\n * position={{ lat: 37.7749, lng: -122.4194 }}\n * onClick={() => console.log('clicked')}\n * title=\"Click me\"\n * />\n *\n * // Custom marker with image\n * <Marker3D position={{ lat: 37.7749, lng: -122.4194 }}>\n * <img src=\"/icon.png\" width={32} height={32} />\n * </Marker3D>\n * ```\n */\nconst Marker3D = forwardRef(function Marker3D(props, ref) {\n const { children, onClick, position, altitudeMode, collisionBehavior, drawsWhenOccluded, extruded, label, sizePreserved, zIndex, title } = props;\n const isInteractive = Boolean(onClick);\n const [marker, setMarker] = useState(null);\n // Track if a child component (like Pin) is handling its own content\n const [contentHandledExternally, setContentHandledExternally] = useState(false);\n // Create a container for rendering React children to be wrapped and relocated\n // into the parent gmp-marker-3d element.\n const contentContainer = useMemo(() => {\n const container = document.createElement('div');\n container.style.display = 'none';\n document.body.appendChild(container);\n return container;\n }, []);\n // Remove the container on unmount\n useEffect(() => {\n return () => contentContainer.remove();\n }, [contentContainer]);\n // Callback ref that sets both internal state and forwards the ref\n const markerRef = useCallback((node) => {\n setMarker(node);\n if (typeof ref === 'function') {\n ref(node);\n }\n else if (ref) {\n ref.current = node;\n }\n }, [ref]);\n useDomEventListener(marker, 'gmp-click', onClick);\n // Move React children to marker's slot, wrapping img/svg in <template> as required by the API\n useLayoutEffect$1(() => {\n if (contentHandledExternally)\n return;\n if (!marker || !contentContainer)\n return;\n while (marker.firstChild) {\n marker.removeChild(marker.firstChild);\n }\n const childNodes = Array.from(contentContainer.childNodes);\n for (const node of childNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n const element = node;\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'img' || tagName === 'svg') {\n const template = document.createElement('template');\n template.content.appendChild(element.cloneNode(true));\n marker.appendChild(template);\n }\n else {\n marker.appendChild(element.cloneNode(true));\n }\n }\n }, [marker, contentContainer, children, contentHandledExternally]);\n const contextValue = useMemo(() => ({ marker, setContentHandledExternally }), [marker]);\n usePropBinding(marker, 'position', position);\n usePropBinding(marker, 'altitudeMode', altitudeMode);\n usePropBinding(marker, 'collisionBehavior', collisionBehavior);\n usePropBinding(marker, 'drawsWhenOccluded', drawsWhenOccluded);\n usePropBinding(marker, 'extruded', extruded);\n usePropBinding(marker, 'label', label);\n usePropBinding(marker, 'sizePreserved', sizePreserved);\n usePropBinding(marker, 'zIndex', zIndex);\n usePropBinding(marker, 'title', title !== null && title !== void 0 ? title : '');\n return (React__default.createElement(Marker3DContext.Provider, { value: contextValue },\n isInteractive ? (React__default.createElement(\"gmp-marker-3d-interactive\", { ref: markerRef })) : (React__default.createElement(\"gmp-marker-3d\", { ref: markerRef })),\n createPortal(children, contentContainer)));\n});\nMarker3D.displayName = 'Marker3D';\n\n/**\n * Popover component for displaying info windows on a Map3D.\n *\n * Similar to InfoWindow for 2D maps, Popover provides a way to show\n * contextual information at a specific location or attached to a marker\n * on a 3D map.\n *\n * @example\n * ```tsx\n * // Basic popover at position\n * <Popover\n * position={{ lat: 37.7749, lng: -122.4194 }}\n * open={isOpen}\n * >\n * <div>Hello from San Francisco!</div>\n * </Popover>\n *\n * // Popover anchored to a marker (place as sibling, use anchor prop)\n * <Marker3D\n * ref={markerRef}\n * position={{ lat: 37.7749, lng: -122.4194 }}\n * onClick={() => setOpen(true)}\n * />\n * <Popover\n * anchor={markerRef.current}\n * open={isOpen}\n * onClose={() => setOpen(false)}\n * >\n * <div>Marker info</div>\n * </Popover>\n * ```\n */\nconst Popover = forwardRef(function Popover(props, ref) {\n var _a;\n const { children, headerContent, style, className, open = true, position, anchor, anchorId, altitudeMode, lightDismissDisabled, autoPanDisabled, onClose } = props;\n const [popover, setPopover] = useState(null);\n const prevStyleRef = useRef$1(null);\n // Forward the ref to the parent\n useImperativeHandle(ref, () => popover, [popover]);\n // Observe the open attribute and call onClose when popover is automatically\n // closed by the Maps API (light dismiss)\n usePopoverCloseObserver(popover, open, onClose);\n // Set properties on the popover element\n usePropBinding(popover, 'open', open !== null && open !== void 0 ? open : false);\n usePropBinding(popover, 'altitudeMode', altitudeMode);\n usePropBinding(popover, 'lightDismissDisabled', lightDismissDisabled);\n usePropBinding(popover, 'autoPanDisabled', autoPanDisabled);\n // positionAnchor accepts a position, marker element, or marker ID string\n const positionAnchor = (_a = anchor !== null && anchor !== void 0 ? anchor : anchorId) !== null && _a !== void 0 ? _a : position;\n usePropBinding(popover, 'positionAnchor', positionAnchor);\n // Set styles via ref for compatibility with older React versions\n useLayoutEffect$1(() => {\n if (!popover)\n return;\n setValueForStyles(popover, style || null, prevStyleRef.current);\n prevStyleRef.current = style || null;\n }, [popover, style]);\n return (React__default.createElement(\"gmp-popover\", { ref: setPopover, className: className },\n headerContent && React__default.createElement(\"div\", { slot: \"header\" }, headerContent),\n children));\n});\nPopover.displayName = 'Popover';\n/**\n * Custom hook to observe the open attribute of a popover element\n * and call onClose when it transitions from open to closed due to light dismiss.\n * Does not call onClose when the open prop changes programmatically.\n */\nfunction usePopoverCloseObserver(popover, open, onClose) {\n const previousOpenState = useRef$1(undefined);\n const openPropRef = useRef$1(open);\n // Track the open prop value\n useEffect(() => {\n openPropRef.current = open;\n }, [open]);\n useEffect(() => {\n if (!popover || !onClose)\n return;\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' &&\n mutation.attributeName === 'open') {\n const isOpen = popover.hasAttribute('open');\n // Only call onClose when:\n // 1. Transitioning from open to closed\n // 2. The prop hasn't changed to false (meaning this was light dismiss, not programmatic)\n if (previousOpenState.current === true &&\n !isOpen &&\n openPropRef.current !== false) {\n onClose();\n }\n previousOpenState.current = isOpen;\n }\n }\n });\n observer.observe(popover, {\n attributes: true,\n attributeFilter: ['open']\n });\n // Initialize the previous state\n previousOpenState.current = popover.hasAttribute('open');\n return () => {\n observer.disconnect();\n };\n }, [popover, onClose]);\n}\n\n/**\n * Formats a location into a string representation suitable for Google Static Maps API.\n *\n * @param location - The location to format, can be either a string or an object with lat/lng properties\n * @returns A string representation of the location in the format \"lat,lng\" or the original string\n *\n * @example\n * // Returns \"40.714728,-73.998672\"\n * formatLocation({ lat: 40.714728, lng: -73.998672 })\n *\n * @example\n * // Returns \"New York, NY\"\n * formatLocation(\"New York, NY\")\n */\nfunction formatLocation(location) {\n return typeof location === 'string'\n ? location\n : `${location.lat},${location.lng}`;\n}\n// Used for removing the leading pipe from the param string\nfunction formatParam(string) {\n return string.slice(1);\n}\n\n/**\n * Assembles marker parameters for static maps.\n *\n * This function takes an array of markers and groups them by their style properties.\n * It then creates a string representation of these markers, including their styles and locations,\n * which can be used as parameters for static map APIs.\n *\n * @param {StaticMapsMarker[]} [markers=[]] - An array of markers to be processed. Each marker can have properties such as color, label, size, scale, icon, anchor, and location.\n * @returns {string[]} An array of strings, each representing a group of markers with their styles and locations.\n *\n * @example\n * const markers = [\n * { color: 'blue', label: 'A', size: 'mid', location: '40.714728,-73.998672' },\n * { color: 'blue', label: 'B', size: 'mid', location: '40.714728,-73.998672' },\n * { icon: 'http://example.com/icon.png', location: { lat: 40.714728, lng: -73.998672 } }\n * ];\n * const params = assembleMarkerParams(markers);\n * // Params will be an array of strings representing the marker parameters\n * Example output: [\n * \"color:blue|label:A|size:mid|40.714728,-73.998672|40.714728,-73.998672\",\n * \"color:blue|label:B|size:mid|40.714728,-73.998672|40.714728,-73.998672\",\n * \"icon:http://example.com/icon.png|40.714728,-73.998672\"\n * ]\n */\nfunction assembleMarkerParams(markers = []) {\n const markerParams = [];\n // Group markers by style\n const markersByStyle = markers === null || markers === void 0 ? void 0 : markers.reduce((styles, marker) => {\n const { color = 'red', label, size, scale, icon, anchor } = marker;\n // Create a unique style key based on either icon properties or standard marker properties\n const relevantProps = icon ? [icon, anchor, scale] : [color, label, size];\n const key = relevantProps.filter(Boolean).join('-');\n styles[key] = styles[key] || [];\n styles[key].push(marker);\n return styles;\n }, {});\n Object.values(markersByStyle !== null && markersByStyle !== void 0 ? markersByStyle : {}).forEach(markers => {\n let markerParam = '';\n const { icon } = markers[0];\n // Create marker style from first marker in group since all markers share the same style.\n Object.entries(markers[0]).forEach(([key, value]) => {\n // Determine which properties to include based on whether marker uses custom icon\n const relevantKeys = icon\n ? ['icon', 'anchor', 'scale']\n : ['color', 'label', 'size'];\n if (relevantKeys.includes(key)) {\n markerParam += `|${key}:${value}`;\n }\n });\n // Add location coordinates for each marker in the style group\n // Handles both string locations and lat/lng object formats.\n for (const marker of markers) {\n const location = typeof marker.location === 'string'\n ? marker.location\n : `${marker.location.lat},${marker.location.lng}`;\n markerParam += `|${location}`;\n }\n markerParams.push(markerParam);\n });\n return markerParams.map(formatParam);\n}\n\n// Style properties that can be applied to paths in the Static Maps API\nconst PATH_STYLE_KEYS = ['color', 'weight', 'fillcolor', 'geodesic'];\n/**\n * Builds the style portion of a path parameter string.\n * @param path - The path object containing style properties\n * @returns A string with style parameters in the format \"|key:value\"\n */\nfunction buildStyleParams(path) {\n let styleParams = '';\n PATH_STYLE_KEYS.forEach(key => {\n if (path[key] !== undefined) {\n styleParams += `|${key}:${path[key]}`;\n }\n });\n return styleParams;\n}\n/**\n * Builds the coordinates portion of a path parameter string.\n * @param coordinates - Either a string or array of location objects\n * @returns A string with coordinates in the format \"|lat,lng|lat,lng\"\n */\nfunction buildCoordinateParams(coordinates) {\n if (typeof coordinates === 'string') {\n return `|${decodeURIComponent(coordinates)}`;\n }\n return coordinates.map(location => `|${formatLocation(location)}`).join('');\n}\n/**\n * Assembles path parameters for the Static Maps API from an array of paths.\n *\n * This function constructs a string of path parameters for each path. Each path parameter string\n * includes the style properties and the coordinates of the paths.\n *\n * @param {Array<StaticMapsPath>} [paths=[]] - An array of paths to be assembled into path parameters.\n * @returns {Array<string>} An array of path parameter strings.\n *\n * @example\n * ```typescript\n * const paths = [\n * {\n * color: 'red',\n * weight: 5,\n * coordinates: [\n * { lat: 40.714728, lng: -73.998672 },\n * { lat: 40.718217, lng: -73.998284 }\n * ]\n * }\n * ];\n *\n * const pathParams = assemblePathParams(paths);\n * // Output: ['color:red|weight:5|40.714728,-73.998672|40.718217,-73.998284']\n * ```\n */\nfunction assemblePathParams(paths = []) {\n return paths.map(path => {\n const styleParams = buildStyleParams(path);\n const coordinateParams = buildCoordinateParams(path.coordinates);\n const pathParam = styleParams + coordinateParams;\n return formatParam(pathParam);\n });\n}\n\n/**\n * Converts an array of Google Maps style objects into an array of style strings\n * compatible with the Google Static Maps API.\n *\n * @param styles - An array of Google Maps MapTypeStyle objects that define the styling rules\n * @returns An array of formatted style strings ready to be used with the Static Maps API\n *\n * @example\n * const styles = [{\n * featureType: \"road\",\n * elementType: \"geometry\",\n * stylers: [{color: \"#ff0000\"}, {weight: 1}]\n * }];\n *\n * const styleStrings = assembleMapTypeStyles(styles);\n * // Returns: [\"|feature:road|element:geometry|color:0xff0000|weight:1\"]\n *\n * Each style string follows the format:\n * \"feature:{featureType}|element:{elementType}|{stylerName}:{stylerValue}\"\n *\n * Note: Color values with hexadecimal notation (#) are automatically converted\n * to the required 0x format for the Static Maps API.\n */\nfunction assembleMapTypeStyles(styles) {\n return styles\n .map((mapTypeStyle) => {\n const { featureType, elementType, stylers = [] } = mapTypeStyle;\n let styleString = '';\n if (featureType) {\n styleString += `|feature:${featureType}`;\n }\n if (elementType) {\n styleString += `|element:${elementType}`;\n }\n for (const styler of stylers) {\n Object.entries(styler).forEach(([name, value]) => {\n styleString += `|${name}:${String(value).replace('#', '0x')}`;\n });\n }\n return styleString;\n })\n .map(formatParam);\n}\n\nconst STATIC_MAPS_BASE = 'https://maps.googleapis.com/maps/api/staticmap';\n/**\n * Creates a URL for the Google Static Maps API with the specified parameters.\n *\n * @param {Object} options - The configuration options for the static map\n * @param {string} options.apiKey - Your Google Maps API key (required)\n * @param {number} options.width - The width of the map image in pixels (required)\n * @param {number} options.height - The height of the map image in pixels (required)\n * @param {StaticMapsLocation} [options.center] - The center point of the map (lat/lng or address).\n * Required if no markers or paths or \"visible locations\" are provided.\n * @param {number} [options.zoom] - The zoom level of the map. Required if no markers or paths or \"visible locations\" are provided.\n * @param {1|2|4} [options.scale] - The resolution of the map (1, 2, or 4)\n * @param {string} [options.format] - The image format (png, png8, png32, gif, jpg, jpg-baseline)\n * @param {string} [options.mapType] - The type of map (roadmap, satellite, terrain, hybrid)\n * @param {string} [options.language] - The language of the map labels\n * @param {string} [options.region] - The region code for the map\n * @param {string} [options.map_id] - The Cloud-based map style ID\n * @param {StaticMapsMarker[]} [options.markers=[]] - Array of markers to display on the map\n * @param {StaticMapsPath[]} [options.paths=[]] - Array of paths to display on the map\n * @param {StaticMapsLocation[]} [options.visible=[]] - Array of locations that should be visible on the map\n * @param {MapTypeStyle[]} [options.style=[]] - Array of style objects to customize the map appearance\n *\n * @returns {string} The complete Google Static Maps API URL\n *\n * @throws {Error} If API key is not provided\n * @throws {Error} If width or height is not provided\n *\n * @example\n * const url = createStaticMapsUrl({\n * apiKey: 'YOUR_API_KEY',\n * width: 600,\n * height: 400,\n * center: { lat: 40.714728, lng: -73.998672 },\n * zoom: 12,\n * markers: [\n * {\n * location: { lat: 40.714728, lng: -73.998672 },\n * color: 'red',\n * label: 'A'\n * }\n * ],\n * paths: [\n * {\n * coordinates: [\n * { lat: 40.714728, lng: -73.998672 },\n * { lat: 40.719728, lng: -73.991672 }\n * ],\n * color: '0x0000ff',\n * weight: 5\n * }\n * ],\n * style: [\n * {\n * featureType: 'road',\n * elementType: 'geometry',\n * stylers: [{color: '#00ff00'}]\n * }\n * ]\n * });\n *\n * // Results in URL similar to:\n * // https://maps.googleapis.com/maps/api/staticmap?key=YOUR_API_KEY\n * // &size=600x400\n * // ¢er=40.714728,-73.998672&zoom=12\n * // &markers=color:red|label:A|40.714728,-73.998672\n * // &path=color:0x0000ff|weight:5|40.714728,-73.998672|40.719728,-73.991672\n * // &style=feature:road|element:geometry|color:0x00ff00\n */\nfunction createStaticMapsUrl({ apiKey, width, height, center, zoom, scale, format, mapType, language, region, mapId, markers = [], paths = [], visible = [], style = [] }) {\n if (!apiKey) {\n console.warn('API key is required');\n }\n if (!width || !height) {\n console.warn('Width and height are required');\n }\n const params = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ key: apiKey, size: `${width}x${height}` }, (center && { center: formatLocation(center) })), (zoom && { zoom })), (scale && { scale })), (format && { format })), (mapType && { maptype: mapType })), (language && { language })), (region && { region })), (mapId && { map_id: mapId }));\n const url = new URL(STATIC_MAPS_BASE);\n // Params that don't need special handling\n Object.entries(params).forEach(([key, value]) => {\n url.searchParams.append(key, String(value));\n });\n // Assemble Markers\n for (const markerParam of assembleMarkerParams(markers)) {\n url.searchParams.append('markers', markerParam);\n }\n // Assemble Paths\n for (const pathParam of assemblePathParams(paths)) {\n url.searchParams.append('path', pathParam);\n }\n // Assemble visible locations\n if (visible.length) {\n url.searchParams.append('visible', visible.map(location => formatLocation(location)).join('|'));\n }\n // Assemble Map Type Styles\n for (const styleString of assembleMapTypeStyles(style)) {\n url.searchParams.append('style', styleString);\n }\n return url.toString();\n}\n\nconst StaticMap = (props) => {\n const { url, className } = props;\n if (!url)\n throw new Error('URL is required');\n return React__default.createElement(\"img\", { className: className, src: url, width: \"100%\" });\n};\n\n/**\n * Copy of the `google.maps.ControlPosition` constants.\n * They have to be duplicated here since we can't wait for the maps API to load to be able to use them.\n */\nconst ControlPosition = {\n TOP_LEFT: 1,\n TOP_CENTER: 2,\n TOP: 2,\n TOP_RIGHT: 3,\n LEFT_CENTER: 4,\n LEFT_TOP: 5,\n LEFT: 5,\n LEFT_BOTTOM: 6,\n RIGHT_TOP: 7,\n RIGHT: 7,\n RIGHT_CENTER: 8,\n RIGHT_BOTTOM: 9,\n BOTTOM_LEFT: 10,\n BOTTOM_CENTER: 11,\n BOTTOM: 11,\n BOTTOM_RIGHT: 12,\n CENTER: 13,\n BLOCK_START_INLINE_START: 14,\n BLOCK_START_INLINE_CENTER: 15,\n BLOCK_START_INLINE_END: 16,\n INLINE_START_BLOCK_CENTER: 17,\n INLINE_START_BLOCK_START: 18,\n INLINE_START_BLOCK_END: 19,\n INLINE_END_BLOCK_START: 20,\n INLINE_END_BLOCK_CENTER: 21,\n INLINE_END_BLOCK_END: 22,\n BLOCK_END_INLINE_START: 23,\n BLOCK_END_INLINE_CENTER: 24,\n BLOCK_END_INLINE_END: 25\n};\nconst MapControl = ({ children, position }) => {\n const controlContainer = useMemo(() => document.createElement('div'), []);\n const map = useMap();\n useEffect(() => {\n if (!map)\n return;\n const controls = map.controls[position];\n controls.push(controlContainer);\n return () => {\n const controlsArray = controls.getArray();\n // controlsArray could be undefined if the map is in an undefined state (e.g. invalid API-key, see #276\n if (!controlsArray)\n return;\n const index = controlsArray.indexOf(controlContainer);\n controls.removeAt(index);\n };\n }, [controlContainer, map, position]);\n return createPortal(children, controlContainer);\n};\n\nfunction useMarker(props) {\n const [marker, setMarker] = useState(null);\n const map = useMap();\n const { onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut } = props, markerOptions = __rest(props, [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\"]);\n const { position, draggable } = markerOptions;\n // create marker instance and add to the map once the map is available\n useEffect(() => {\n if (!map) {\n if (map === undefined)\n console.error('<Marker> has to be inside a Map component.');\n return;\n }\n const newMarker = new google.maps.Marker(markerOptions);\n newMarker.setMap(map);\n setMarker(newMarker);\n return () => {\n newMarker.setMap(null);\n setMarker(null);\n };\n // We do not want to re-render the whole marker when the options change.\n // Marker options update is handled in a useEffect below.\n // Excluding markerOptions from dependency array on purpose here.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [map]);\n // attach and re-attach event-handlers when any of the properties change\n useEffect(() => {\n if (!marker)\n return;\n const m = marker;\n // Add event listeners\n const gme = google.maps.event;\n if (onClick)\n gme.addListener(m, 'click', onClick);\n if (onDrag)\n gme.addListener(m, 'drag', onDrag);\n if (onDragStart)\n gme.addListener(m, 'dragstart', onDragStart);\n if (onDragEnd)\n gme.addListener(m, 'dragend', onDragEnd);\n if (onMouseOver)\n gme.addListener(m, 'mouseover', onMouseOver);\n if (onMouseOut)\n gme.addListener(m, 'mouseout', onMouseOut);\n marker.setDraggable(Boolean(draggable));\n return () => {\n gme.clearInstanceListeners(m);\n };\n }, [\n marker,\n draggable,\n onClick,\n onDrag,\n onDragStart,\n onDragEnd,\n onMouseOver,\n onMouseOut\n ]);\n // update markerOptions (note the dependencies aren't properly checked\n // here, we just assume that setOptions is smart enough to not waste a\n // lot of time updating values that didn't change)\n useEffect(() => {\n if (!marker)\n return;\n if (markerOptions)\n marker.setOptions(markerOptions);\n }, [marker, markerOptions]);\n // update position when changed\n useEffect(() => {\n // Should not update position when draggable\n if (draggable || !position || !marker)\n return;\n marker.setPosition(position);\n }, [draggable, position, marker]);\n return marker;\n}\n/**\n * Component to render a marker on a map\n */\nconst Marker = forwardRef((props, ref) => {\n const marker = useMarker(props);\n useImperativeHandle(ref, () => marker, [marker]);\n return React__default.createElement(React__default.Fragment, null);\n});\nMarker.displayName = 'Marker';\nfunction useMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback((m) => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\n\n/**\n * Legacy implementation of Pin component for Maps API < 3.62\n * Component to configure the appearance of an AdvancedMarker or Marker3D\n */\nconst PinLegacy = props => {\n const advancedMarkerContext = useContext(AdvancedMarkerContext);\n const marker3dContext = useContext(Marker3DContext);\n const advancedMarker = advancedMarkerContext === null || advancedMarkerContext === void 0 ? void 0 : advancedMarkerContext.marker;\n const marker3d = marker3dContext === null || marker3dContext === void 0 ? void 0 : marker3dContext.marker;\n const setContentHandledExternally = marker3dContext === null || marker3dContext === void 0 ? void 0 : marker3dContext.setContentHandledExternally;\n const glyphContainer = useMemo(() => document.createElement('div'), []);\n // Load marker library for Marker3D case (AdvancedMarker already has it loaded)\n const markerLibrary = useMapsLibrary('marker');\n // Signal to Marker3D that we're handling content\n useEffect(() => {\n if (marker3d && setContentHandledExternally) {\n setContentHandledExternally(true);\n return () => setContentHandledExternally(false);\n }\n }, [marker3d, setContentHandledExternally]);\n // Handle Marker3D case - append PinElement directly\n useEffect(() => {\n if (!marker3d || !markerLibrary)\n return;\n const pinViewOptions = Object.assign({}, props);\n const pinElement = new markerLibrary.PinElement(pinViewOptions);\n // Set glyph to glyph container if children are present\n if (props.children) {\n pinElement.glyph = glyphContainer;\n }\n // Append PinElement directly to Marker3D (not in a template)\n // PinElement is a special element that Marker3D can handle natively\n while (marker3d.firstChild) {\n marker3d.removeChild(marker3d.firstChild);\n }\n marker3d.append(pinElement);\n return () => {\n // Cleanup handled by marker3d removal\n };\n }, [marker3d, markerLibrary, glyphContainer, props]);\n // Create Pin View instance for AdvancedMarker\n useEffect(() => {\n var _a;\n // Skip if we're in Marker3D context\n if (marker3d)\n return;\n if (!advancedMarker) {\n if (advancedMarker === undefined && marker3d === undefined) {\n console.error('The <Pin> component can only be used inside <AdvancedMarker> or <Marker3D>.');\n }\n return;\n }\n if (props.glyph && props.children) {\n logErrorOnce('The <Pin> component only uses children to render the glyph if both the glyph property and children are present.');\n }\n if (Children.count(props.children) > 1) {\n logErrorOnce('Passing multiple children to the <Pin> component might lead to unexpected results.');\n }\n const pinViewOptions = Object.assign({}, props);\n const pinElement = new google.maps.marker.PinElement(pinViewOptions);\n // Set glyph to glyph container if children are present (rendered via portal).\n // If both props.glyph and props.children are present, props.children takes priority.\n if (props.children) {\n pinElement.glyph = glyphContainer;\n }\n // Set content of Advanced Marker View to the Pin View element\n // Here we are selecting the anchor container.\n // The hierarchy is as follows:\n // \"advancedMarker.content\" (from google) -> \"anchor container\"\n const markerContent = (_a = advancedMarker.content) === null || _a === void 0 ? void 0 : _a.firstChild;\n while (markerContent === null || markerContent === void 0 ? void 0 : markerContent.firstChild) {\n markerContent.removeChild(markerContent.firstChild);\n }\n if (markerContent) {\n markerContent.appendChild(pinElement.element);\n }\n }, [advancedMarker, glyphContainer, marker3d, props]);\n return createPortal(props.children, glyphContainer);\n};\n\n/**\n * Modern implementation of Pin component for Maps API >= 3.62\n * Uses the new custom element API with glyphSrc/glyphText properties\n * Component to configure the appearance of an AdvancedMarker or Marker3D\n */\nconst PinModern = props => {\n const { children } = props;\n const advancedMarkerContext = useContext(AdvancedMarkerContext);\n const marker3dContext = useContext(Marker3DContext);\n const advancedMarker = advancedMarkerContext === null || advancedMarkerContext === void 0 ? void 0 : advancedMarkerContext.marker;\n const marker3d = marker3dContext === null || marker3dContext === void 0 ? void 0 : marker3dContext.marker;\n const setContentHandledExternally = marker3dContext === null || marker3dContext === void 0 ? void 0 : marker3dContext.setContentHandledExternally;\n const glyphContainer = useMemo(() => document.createElement('div'), []);\n const markerLibrary = useMapsLibrary('marker');\n // Signal to Marker3D that we're handling content\n useEffect(() => {\n if (marker3d && setContentHandledExternally) {\n setContentHandledExternally(true);\n return () => setContentHandledExternally(false);\n }\n }, [marker3d, setContentHandledExternally]);\n // Handle Marker3D case\n useEffect(() => {\n if (!marker3d || !markerLibrary)\n return;\n const pinOptions = Object.assign({}, props);\n const pinElement = new markerLibrary.PinElement(pinOptions);\n // Children still rendered via portal into a container\n if (children) {\n // In modern API, DOM children of PinElement serve as glyph\n pinElement.appendChild(glyphContainer);\n }\n // Append PinElement directly (not .element - that's deprecated)\n while (marker3d.firstChild) {\n marker3d.removeChild(marker3d.firstChild);\n }\n marker3d.appendChild(pinElement);\n return () => {\n // Cleanup handled by marker3d removal\n };\n }, [marker3d, markerLibrary, glyphContainer, children, props]);\n // Handle AdvancedMarker case\n useEffect(() => {\n var _a;\n if (marker3d)\n return; // Skip if in Marker3D context\n if (!advancedMarker || !markerLibrary) {\n if (advancedMarker === undefined && marker3d === undefined) {\n console.error('The <Pin> component can only be used inside <AdvancedMarker> or <Marker3D>.');\n }\n return;\n }\n if ((props.glyphSrc || props.glyphText) && children) {\n logErrorOnce('The <Pin> component only uses children to render the glyph if both glyphSrc/glyphText and children are present.');\n }\n if (Children.count(children) > 1) {\n logErrorOnce('Passing multiple children to the <Pin> component might lead to unexpected results.');\n }\n const pinOptions = Object.assign({}, props);\n const pinElement = new markerLibrary.PinElement(pinOptions);\n // Children rendered via portal into container\n if (children) {\n pinElement.appendChild(glyphContainer);\n }\n const markerContent = (_a = advancedMarker.content) === null || _a === void 0 ? void 0 : _a.firstChild;\n while (markerContent === null || markerContent === void 0 ? void 0 : markerContent.firstChild) {\n markerContent.removeChild(markerContent.firstChild);\n }\n if (markerContent) {\n // In modern API, append PinElement directly (not .element)\n markerContent.appendChild(pinElement);\n }\n }, [\n advancedMarker,\n markerLibrary,\n glyphContainer,\n marker3d,\n children,\n props\n ]);\n return createPortal(children, glyphContainer);\n};\n\n/**\n * Component to configure the appearance of an AdvancedMarker or Marker3D.\n *\n * Automatically detects the Maps API version and uses the appropriate implementation:\n * - Legacy implementation (< 3.62): Uses the original PinElement API with glyph property\n * - Modern implementation (≥ 3.62): Uses the new custom element API with glyphSrc/glyphText\n *\n * @example\n * ```tsx\n * // Basic usage\n * <AdvancedMarker position={{lat: 0, lng: 0}}>\n * <Pin background=\"#FF0000\" glyphColor=\"#FFFFFF\" />\n * </AdvancedMarker>\n *\n * // With custom glyph (legacy)\n * <Pin glyph=\"📍\" />\n *\n * // With custom glyph (modern, recommended for Maps API 3.62+)\n * <Pin glyphText=\"📍\" />\n * <Pin glyphSrc=\"https://example.com/icon.png\" />\n *\n * // With React children as glyph\n * <Pin>\n * <CustomIcon />\n * </Pin>\n * ```\n */\nconst Pin = props => {\n var _a;\n const markerLibrary = useMapsLibrary('marker');\n // Detect capability after the marker library is loaded\n const isModern = useMemo(() => {\n if (!markerLibrary)\n return false;\n // Check if <gmp-pin> custom element exists\n // This happens while loading the marker library in Maps API 3.62+\n return (typeof customElements !== 'undefined' &&\n customElements.get('gmp-pin') !== undefined);\n }, [markerLibrary]);\n // Wait for marker library to load before rendering\n if (!markerLibrary)\n return null;\n // Map props based on which implementation we're using\n if (isModern) {\n // Modern: map old glyph prop to new glyphSrc/glyphText\n const { glyph, glyphSrc, glyphText } = props, restProps = __rest(props, [\"glyph\", \"glyphSrc\", \"glyphText\"]);\n const isUrl = glyph instanceof URL ||\n (typeof glyph === 'string' && glyph.startsWith('http'));\n const finalGlyphText = glyphText !== null && glyphText !== void 0 ? glyphText : (typeof glyph === 'string' && !isUrl ? glyph : undefined);\n const finalGlyphSrc = glyphSrc !== null && glyphSrc !== void 0 ? glyphSrc : (isUrl ? String(glyph) : undefined);\n return (React__default.createElement(PinModern, Object.assign({}, restProps, { glyphText: finalGlyphText, glyphSrc: finalGlyphSrc })));\n }\n else {\n // Legacy: map new glyphSrc/glyphText to old glyph prop\n const { glyph, glyphSrc, glyphText } = props, restProps = __rest(props, [\"glyph\", \"glyphSrc\", \"glyphText\"]);\n const finalGlyph = (_a = glyph !== null && glyph !== void 0 ? glyph : glyphSrc) !== null && _a !== void 0 ? _a : glyphText;\n return React__default.createElement(PinLegacy, Object.assign({}, restProps, { glyph: finalGlyph }));\n }\n};\n\nfunction useRectangle(props) {\n var _a, _b, _c;\n const { onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut, onBoundsChanged, bounds, defaultBounds } = props, destructuredOptions = __rest(props, [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\", \"onBoundsChanged\", \"bounds\", \"defaultBounds\"]);\n const [rectangle, setRectangle] = useState(null);\n const map = useMap();\n // Memoize options with automatic inference of clickable/draggable/editable\n const rectangleOptions = useMemoized(Object.assign(Object.assign({}, destructuredOptions), { clickable: (_a = destructuredOptions.clickable) !== null && _a !== void 0 ? _a : Boolean(onClick), draggable: (_b = destructuredOptions.draggable) !== null && _b !== void 0 ? _b : Boolean(onDrag || onDragStart || onDragEnd || onBoundsChanged), editable: (_c = destructuredOptions.editable) !== null && _c !== void 0 ? _c : Boolean(onBoundsChanged) }), isDeepEqual);\n useEffect(() => {\n if (!map) {\n if (map === undefined)\n console.error('<Rectangle> has to be inside a Map component.');\n return;\n }\n const newRectangle = new google.maps.Rectangle(Object.assign(Object.assign({}, rectangleOptions), { bounds: bounds !== null && bounds !== void 0 ? bounds : defaultBounds }));\n newRectangle.setMap(map);\n setRectangle(newRectangle);\n return () => {\n newRectangle.setMap(null);\n setRectangle(null);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- rectangle options are handled separately to avoid recreating the instance\n }, [map]);\n useMapsEventListener(rectangle, 'click', onClick);\n useMapsEventListener(rectangle, 'drag', onDrag);\n useMapsEventListener(rectangle, 'dragstart', onDragStart);\n useMapsEventListener(rectangle, 'dragend', onDragEnd);\n useMapsEventListener(rectangle, 'mouseover', onMouseOver);\n useMapsEventListener(rectangle, 'mouseout', onMouseOut);\n useMapsEventListener(rectangle, 'bounds_changed', onBoundsChanged\n ? () => {\n onBoundsChanged(rectangle === null || rectangle === void 0 ? void 0 : rectangle.getBounds());\n }\n : null);\n useEffect(() => {\n if (!rectangle)\n return;\n rectangle.setOptions(rectangleOptions);\n }, [rectangle, rectangleOptions]);\n // Sync controlled bounds prop with the rectangle instance\n useEffect(() => {\n if (!rectangle || !bounds)\n return;\n if (!boundsEquals(bounds, rectangle.getBounds())) {\n rectangle.setBounds(bounds);\n }\n }, [rectangle, bounds]);\n return rectangle;\n}\nconst Rectangle = forwardRef((props, ref) => {\n const rectangle = useRectangle(props);\n useImperativeHandle(ref, () => rectangle, [\n rectangle\n ]);\n return React__default.createElement(React__default.Fragment, null);\n});\nRectangle.displayName = 'Rectangle';\n\n/**\n * Hook to retrieve a Map3DElement instance from context.\n *\n * When called without an id, it returns the map from the nearest parent Map3D\n * component. When called with an id, it retrieves the map with that id from\n * the APIProvider context.\n *\n * @param id - Optional id of the map to retrieve. If not specified, returns\n * the parent map instance or the default map instance.\n *\n * @example\n * ```tsx\n * // Get the parent Map3D instance\n * function MyComponent() {\n * const map3d = useMap3D();\n * // ...\n * }\n *\n * // Get a specific Map3D instance by id\n * function ControlPanel() {\n * const mainMap = useMap3D('main-map');\n * const miniMap = useMap3D('mini-map');\n * // ...\n * }\n * ```\n */\nfunction useMap3D(id = null) {\n const apiContext = useContext(APIProviderContext);\n const map3dContext = useContext(GoogleMaps3DContext);\n if (apiContext === null) {\n logErrorOnce('useMap3D(): failed to retrieve APIProviderContext. ' +\n 'Make sure that the <APIProvider> component exists and that the ' +\n 'component you are calling `useMap3D()` from is a child of the ' +\n '<APIProvider>.');\n return null;\n }\n const { map3dInstances } = apiContext;\n // Lookup priority: explicit id > parent context > default instance\n if (id !== null)\n return map3dInstances[id] || null;\n if (map3dContext === null || map3dContext === void 0 ? void 0 : map3dContext.map3d)\n return map3dContext.map3d;\n return map3dInstances['default'] || null;\n}\n\nconst mapLinear = (x, a1, a2, b1, b2) => b1 + ((x - a1) * (b2 - b1)) / (a2 - a1);\nconst getMapMaxTilt = (zoom) => {\n if (zoom <= 10) {\n return 30;\n }\n if (zoom >= 15.5) {\n return 67.5;\n }\n // range [10...14]\n if (zoom <= 14) {\n return mapLinear(zoom, 10, 14, 30, 45);\n }\n // range [14...15.5]\n return mapLinear(zoom, 14, 15.5, 45, 67.5);\n};\n/**\n * Function to limit the tilt range of the Google map when updating the view state\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst limitTiltRange = ({ viewState }) => {\n const pitch = viewState.pitch;\n const gmZoom = viewState.zoom + 1;\n const maxTilt = getMapMaxTilt(gmZoom);\n return Object.assign(Object.assign({}, viewState), { fovy: 25, pitch: Math.min(maxTilt, pitch) });\n};\n\nexport { APILoadingStatus, APIProvider, APIProviderContext, AdvancedMarker, AdvancedMarkerAnchorPoint, AdvancedMarkerContext, AltitudeMode, Circle, CollisionBehavior, ColorScheme, ControlPosition, GestureHandling, GoogleMaps3DContext, GoogleMapsContext, InfoWindow, Map, Map3D, MapControl, MapMode, Marker, Marker3D, Marker3DContext, Pin, Polygon, Polyline, Popover, Rectangle, RenderingType, StaticMap, VERSION, __resetModuleState, boundsEquals, createStaticMapsUrl, isAdvancedMarker, isLatLngLiteral, latLngEquals, limitTiltRange, pathEquals, pathsEquals, toLatLngBoundsLiteral, toLatLngLiteral, useAdvancedMarkerRef, useApiIsLoaded, useApiLoadingStatus, useMap, useMap3D, useMapsLibrary, useMarker3D, useMarkerRef };\n//# sourceMappingURL=index.modern.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — MapView. */\n/* */\n/* Read-safety actions on the kit's Google Maps wrapper. State is the */\n/* current centre / zoom / selected marker; actions pan, zoom, and */\n/* select markers programmatically. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { MapViewHandle, MapLatLng } from './map-view';\n\nexport const mapViewAgent: AgentAdapter<MapViewHandle> = {\n id: 'map-view',\n capabilities: [],\n state: {},\n actions: {\n pan_to: {\n safety: 'read',\n argsType: '{ position: { lat: number; lng: number } }',\n description: 'Pan the map to a new centre without changing zoom.',\n invoke: (handle, args: { position: MapLatLng }) => {\n handle.panTo(args.position);\n },\n },\n set_zoom: {\n safety: 'read',\n argsType: '{ zoom: number }',\n description: 'Set the map zoom level (typical range 1–20).',\n invoke: (handle, args: { zoom: number }) => {\n handle.setZoom(args.zoom);\n },\n },\n select_marker: {\n safety: 'read',\n argsType: '{ id: string | null }',\n description:\n 'Select a marker by id, or pass null to clear the selection.',\n invoke: (handle, args: { id: string | null }) => {\n handle.selectMarker(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'map-view',\n description: 'Marks the element as a kit MapView.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* MapView — kit wrapper over @vis.gl/react-google-maps. */\n/* */\n/* - Loads the Google Maps JS API on demand via the library's */\n/* `APIProvider`; consumer supplies the key (no kit-side cache). */\n/* - Defaults to a CONSENT-GATED placeholder (`consentGranted={false}`) */\n/* so the third-party load never happens before the consumer flips */\n/* the opt-in. GDPR-safe by default. */\n/* - Theme-reactive: the Google Maps `styles` JSON re-resolves on every */\n/* `documentElement.class` mutation (same pattern as Sparkline). */\n/* Consumers may pass `mapId` to switch to a cloud-styled map */\n/* instead, in which case `styles` is ignored. */\n/* - `data-component=\"map-view\"` lives on the outer span; the inner */\n/* `<Map>` mounts inside it. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { MapPin, ExternalLink } from 'lucide-react';\nimport {\n APIProvider,\n Map as GoogleMap,\n AdvancedMarker,\n Marker,\n Pin,\n useMap,\n} from '@vis.gl/react-google-maps';\nimport { Button } from '../button';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { mapViewAgent } from './map-view.agent';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface MapLatLng {\n lat: number;\n lng: number;\n}\n\nexport interface MapMarker {\n /** Stable id — used for keyed re-rendering and `onMarkerClick`. */\n id: string;\n /** Position in lat/lng. */\n position: MapLatLng;\n /** Optional accessible label — falls back to the id. */\n label?: string;\n}\n\nexport interface MapViewHandle {\n /** Pan the map to a new centre without changing zoom. */\n panTo: (position: MapLatLng) => void;\n /** Set zoom (typical range 1–20). */\n setZoom: (zoom: number) => void;\n /** Programmatically select a marker (fires `onMarkerClick`). */\n selectMarker: (id: string | null) => void;\n}\n\nexport interface MapViewProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>,\n VariantProps<typeof mapViewVariants> {\n /** Opaque instance id — emitted as `data-component-id`. */\n id?: string;\n /** Google Maps JS API key. Consumer-owned; never cached by the kit. */\n apiKey: string;\n /** Map centre (lat/lng). Required so the consent placeholder can also use it. */\n center: MapLatLng;\n /** Initial zoom. Default 15 (city-block detail, matches booking site). */\n zoom?: number;\n /**\n * Markers to render. The first marker auto-selects when no\n * `selectedMarkerId` is given.\n */\n markers?: MapMarker[];\n /** Controlled selection — fires `onMarkerClick` with the new id (or null on map click). */\n selectedMarkerId?: string | null;\n /** Fires when a marker is clicked, or `null` when the map background is clicked. */\n onMarkerClick?: (id: string | null) => void;\n /**\n * GDPR consent gate. When `false` (default) the component renders a\n * placeholder with a translated CTA — the Maps JS API is **not**\n * loaded. Flip to `true` once the consumer has captured opt-in.\n */\n consentGranted?: boolean;\n /** Fires when the consumer clicks the \"Load map\" CTA in the placeholder. */\n onConsentRequest?: () => void;\n /**\n * Optional address string shown in the consent placeholder so the\n * surface is useful before the map loads. Also used to build the\n * fallback \"Open in Google Maps\" link target.\n */\n address?: string;\n /**\n * Cloud-styled-map id. When set, takes precedence over the JSON\n * `styles` array and disables the theme-bridge re-fire. Use when\n * you've provisioned a styled map in Google Cloud Console.\n */\n mapId?: string;\n /**\n * Override the consent-placeholder description text. The default\n * (`t('mapView.consentDescription')`) is a generic IP-disclosure\n * line. Consumers operating under specific GDPR / ePrivacy\n * disclosures (jurisdiction, named controller, policy link) should\n * supply their own text via this prop. Pass any `ReactNode` — a\n * paragraph, a localised `<Trans>` instance, etc.\n */\n consentDescription?: ReactNode;\n /**\n * Replace the kit-rendered \"Load map\" button with custom CTA chrome.\n * Use when the consent dialog needs a policy link, a specific\n * jurisdiction phrasing, or a different surface (Tooltip-wrapped\n * button, link to a settings page, etc.). When omitted the kit\n * renders its own `<Button>` — that button calls `onConsentRequest`\n * if provided, otherwise flips MapView's internal opt-in state so\n * the map loads inline.\n */\n consentCta?: ReactNode;\n /**\n * Visual surface. Default `bordered` (current behaviour: 1px\n * `--border` outline + `--radius-md`). `elevated` replaces the\n * border with `--shadow-card`, matching `<Card variant=\"elevated\">`.\n * `bare` drops both — map is flush against the page canvas.\n */\n surface?: 'bordered' | 'elevated' | 'bare';\n /** Accessible label for the map region. Falls back to `t('mapView.label')`. */\n ariaLabel?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst mapViewVariants = cva(\n ['ds:relative ds:overflow-hidden ds:block', 'ds:bg-[var(--muted)]'].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:[--map-block-size:14rem]',\n md: 'ds:[--map-block-size:20rem]',\n lg: 'ds:[--map-block-size:28rem]',\n // `fill` defers sizing to the parent. The outer takes\n // `block-size: 100%` so the inner (also 100%) has something\n // to inherit from. Use inside a viewport-locked column —\n // `<PracticeResults variant=\"map-first\">` wires this through\n // automatically; standalone consumers must give the parent\n // a constrained block-size or the map collapses to 0.\n fill: 'ds:[block-size:100%]',\n },\n surface: {\n bordered:\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]',\n elevated:\n 'ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)]',\n bare: 'ds:rounded-none ds:border-0',\n },\n },\n defaultVariants: { size: 'md', surface: 'bordered' },\n },\n);\n\n// Inner block-size: percentage when `size=\"fill\"`, rem-token otherwise.\n// Splitting this out (instead of compound-variants) keeps the size\n// switch readable and avoids enumerating every (size × surface) pair.\nconst innerSurfaceVariants = cva('ds:block ds:inline-size-full', {\n variants: {\n size: {\n sm: 'ds:[block-size:var(--map-block-size)]',\n md: 'ds:[block-size:var(--map-block-size)]',\n lg: 'ds:[block-size:var(--map-block-size)]',\n fill: 'ds:[block-size:100%]',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nconst consentChromeVariants = cva(\n [\n 'ds:absolute ds:inset-0',\n 'ds:flex ds:flex-col ds:items-center ds:justify-center',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:bg-[var(--muted)] ds:text-[var(--foreground)]',\n 'ds:text-center',\n ].join(' '),\n);\n\nconst consentTitleVariants = cva('type-heading-3 ds:m-0');\n\nconst consentDescriptionVariants = cva(\n 'type-body-sm ds:text-[var(--muted-foreground)] ds:max-inline-size-[28rem] ds:m-0',\n);\n\n/* ------------------------------------------------------------------ */\n/* Inner imperative bridge */\n/* */\n/* `useMap()` only resolves inside the APIProvider tree, so the */\n/* imperative actions live in a tiny inner component that the outer */\n/* `MapView` mounts conditionally. It exposes the `panTo` / `setZoom` */\n/* etc. to the forwardRef via a `useImperativeHandle` callback prop. */\n/* ------------------------------------------------------------------ */\n\ninterface MapImperativeBridgeProps {\n onHandleReady: (handle: MapViewHandle) => void;\n onMarkerSelect: (id: string | null) => void;\n}\n\nfunction MapImperativeBridge({\n onHandleReady,\n onMarkerSelect,\n}: MapImperativeBridgeProps): null {\n const map = useMap();\n useEffect(() => {\n if (!map) return;\n onHandleReady({\n panTo: (position) => map.panTo(position),\n setZoom: (zoom) => map.setZoom(zoom),\n selectMarker: (id) => onMarkerSelect(id),\n });\n }, [map, onHandleReady, onMarkerSelect]);\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Consent placeholder */\n/* ------------------------------------------------------------------ */\n\ninterface ConsentPlaceholderProps {\n address: string | undefined;\n description: ReactNode;\n /**\n * Click handler for the \"Load map\" button. Always rendered. When the\n * consumer provides `onConsentRequest` it owns the state transition\n * (typically: open a GDPR dialog, then flip `consentGranted` to true\n * after acceptance). When omitted, the kit's `MapView` falls back to\n * its own internal opt-in toggle — clicking grants consent for this\n * MapView instance only, no consumer plumbing required. This default\n * fixes a regression where the button was conditionally rendered and\n * any consumer omitting `onConsentRequest` left the patient with no\n * way to load the map (booking-website 0.31.0 hit this).\n */\n onLoadMap: () => void;\n openInGoogleMapsHref: string;\n /**\n * Custom CTA — replaces the kit-rendered `<Button>` when the consumer\n * needs a different surface (e.g. a Tooltip-wrapped button with a\n * policy link). The kit's button is still the recommended path; this\n * slot exists for consumers operating under specific compliance UX\n * requirements (jurisdiction, named controller, policy link). Pass\n * any `ReactNode`.\n */\n consentCta: ReactNode | undefined;\n}\n\nfunction ConsentPlaceholder({\n address,\n description,\n onLoadMap,\n openInGoogleMapsHref,\n consentCta,\n}: ConsentPlaceholderProps): ReactNode {\n const { t } = useTranslation();\n return (\n <div className={consentChromeVariants()} data-testid=\"map-view-consent\">\n <MapPin\n aria-hidden=\"true\"\n className=\"ds:size-6 ds:text-[var(--muted-foreground)]\"\n />\n <p className={consentTitleVariants()}>{t('mapView.consentTitle')}</p>\n {address ? (\n <p\n className={consentDescriptionVariants()}\n data-testid=\"map-view-address\"\n >\n {address}\n </p>\n ) : null}\n <p className={consentDescriptionVariants()}>{description}</p>\n <div className=\"ds:flex ds:gap-[var(--spacing-sm)] ds:flex-wrap ds:items-center ds:justify-center\">\n {consentCta ?? (\n <Button\n type=\"button\"\n intent=\"primary\"\n size=\"sm\"\n onClick={onLoadMap}\n data-testid=\"map-view-load-cta\"\n >\n {t('mapView.consentCta')}\n </Button>\n )}\n <a\n href={openInGoogleMapsHref}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:text-[var(--primary)] ds:underline ds:underline-offset-2\"\n >\n {t('mapView.openInGoogleMaps')}\n <ExternalLink aria-hidden=\"true\" className=\"ds:size-3\" />\n </a>\n </div>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* MapView */\n/* ------------------------------------------------------------------ */\n\nexport const MapView = forwardRef<MapViewHandle, MapViewProps>(\n (\n {\n id,\n apiKey,\n center,\n zoom = 15,\n markers,\n selectedMarkerId,\n onMarkerClick,\n consentGranted = false,\n onConsentRequest,\n address,\n consentDescription,\n consentCta,\n mapId,\n size,\n surface,\n ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const rawId = useId();\n const instanceId = useMemo(\n () => `map-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n\n // Reduced-motion gating. Google's own pan / zoom animations\n // happen inside the Maps JS API and the kit can't reach into\n // those — but the kit's own programmatic `panTo` calls (triggered\n // by prop changes via the controlled-sync effect below) can be\n // suppressed. When `prefers-reduced-motion: reduce` is set, we\n // skip the synthetic `panTo` so the consumer's prop change\n // results in a hard recenter rather than an animated glide.\n const [reducedMotion, setReducedMotion] = useState(false);\n useEffect(() => {\n if (typeof window === 'undefined') return undefined;\n const mql = window.matchMedia('(prefers-reduced-motion: reduce)');\n const sync = (): void => setReducedMotion(mql.matches);\n sync();\n mql.addEventListener('change', sync);\n return () => mql.removeEventListener('change', sync);\n }, []);\n\n // The \"Open in Google Maps\" fallback link — works without any\n // third-party script load. Uses the modern `?api=1&query=…` form\n // which the booking site already employs.\n const openInGoogleMapsHref = useMemo(() => {\n const query = address\n ? encodeURIComponent(address)\n : `${center.lat},${center.lng}`;\n return `https://www.google.com/maps/search/?api=1&query=${query}`;\n }, [address, center.lat, center.lng]);\n\n // 0.33.5: removed the kit's `getGoogleMapsTheme()` JSON-styles\n // override. Previously, when `mapId` was absent the kit painted\n // water / roads / landscape with kit tokens — a calm muted-grey\n // palette that diverged from the standard Google Maps appearance\n // users expect in every other maps surface they touch. Google's\n // default (blue water, beige land, named-road colours) is more\n // familiar and reads as a \"real map\" rather than a stylised one.\n //\n // Consumers wanting brand-themed colours opt in via `mapId` and\n // configure the palette in Google Cloud Console — that's the\n // Google-recommended path. The `getGoogleMapsTheme` export stays\n // in `src/tokens/google-maps-theme.ts` so consumers wanting the\n // old behaviour can apply the styles themselves, but the kit\n // does NOT install them by default any more.\n //\n // Side benefit: dropped the MutationObserver that previously\n // watched documentElement.class for theme switches — no more\n // observer churn on every theme toggle.\n\n // Imperative handle plumbing — populated by the inner bridge once\n // the APIProvider tree resolves a `Map` instance.\n const handleRef = useRef<MapViewHandle | null>(null);\n const onHandleReady = useCallback((handle: MapViewHandle) => {\n handleRef.current = handle;\n }, []);\n useImperativeHandle(\n ref,\n (): MapViewHandle => ({\n panTo: (position) => handleRef.current?.panTo(position),\n setZoom: (z) => handleRef.current?.setZoom(z),\n selectMarker: (markerId) => handleRef.current?.selectMarker(markerId),\n }),\n [],\n );\n\n const agentHandle = useMemo<MapViewHandle>(\n () => ({\n panTo: (position) => handleRef.current?.panTo(position),\n setZoom: (z) => handleRef.current?.setZoom(z),\n selectMarker: (markerId) => handleRef.current?.selectMarker(markerId),\n }),\n [],\n );\n useAgentRegistration(mapViewAgent, agentHandle, id);\n\n // Controlled-feeling propagation: vis.gl's `<Map>` reads `center`\n // and `zoom` as initial values only (via `defaultCenter` /\n // `defaultZoom`). To honour the documented \"live prop\" contract\n // we shim post-mount sync through the imperative bridge — a\n // parent that swaps offices by changing `center` re-centres the\n // map. User drag does NOT trigger this because the prop doesn't\n // change on user gesture, so the effect doesn't fire and the\n // map stays where the user left it.\n useEffect(() => {\n // Skip the animated pan under reduced-motion preference; the\n // map will still recentre on the next render via the agent\n // handle's `panTo`, but Google's own glide animation runs\n // either way (kit can't reach inside it). At least the kit's\n // own initiated pan is gated.\n if (reducedMotion) return;\n handleRef.current?.panTo(center);\n // Including `center` (the object reference) instead of\n // `center.lat`/`center.lng` would fire on every parent render\n // even when the coordinates are identical, fighting user drag.\n // The destructured deps are intentional.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [center.lat, center.lng, reducedMotion]);\n useEffect(() => {\n handleRef.current?.setZoom(zoom);\n }, [zoom]);\n\n // Internal opt-in fallback. The `consentGranted` prop is the\n // controlled path — consumer flips it after capturing GDPR\n // acceptance through their own dialog and re-renders. When the\n // consumer omits `onConsentRequest` they're opting out of that\n // workflow, so the kit needs a sensible default click handler on\n // the placeholder's button. `internalConsent` tracks that opt-in\n // for this instance only; the map renders when either signal is\n // truthy. The 0.31.0 regression was conditionally rendering the\n // button on `onConsentRequest` — patients of consumers without the\n // hook saw the placeholder with no way to proceed.\n const [internalConsent, setInternalConsent] = useState(false);\n const effectiveConsent = consentGranted || internalConsent;\n const handleLoadMap = useCallback(() => {\n if (onConsentRequest) {\n onConsentRequest();\n // The consumer typically flips `consentGranted` to true on the\n // next render. Flip the internal state too so the map still\n // loads if the consumer forgets to update its prop (the\n // common-case footgun this fallback exists to defuse).\n setInternalConsent(true);\n return;\n }\n setInternalConsent(true);\n }, [onConsentRequest]);\n\n return (\n <div\n className={mapViewVariants({ size, surface, className })}\n data-component=\"map-view\"\n data-component-id={id ?? instanceId}\n role=\"region\"\n aria-label={ariaLabel ?? t('mapView.label')}\n {...rest}\n >\n <div className={innerSurfaceVariants({ size })}>\n {effectiveConsent ? (\n <APIProvider\n apiKey={apiKey}\n // Pull the active i18next locale through so map UI text\n // (zoom controls, attribution) localises to match the\n // surrounding kit chrome.\n language={i18n.language}\n >\n <GoogleMap\n defaultCenter={center}\n defaultZoom={zoom}\n mapId={mapId}\n gestureHandling=\"cooperative\"\n disableDefaultUI={false}\n onClick={() => onMarkerClick?.(null)}\n // `<Map>` reads its own bounding rect for tile sizing.\n // Without explicit dimensions it collapses to 0×0, so\n // we pass kit-class sizing through `className` — vis.gl\n // forwards `className` straight to the rendered root.\n className=\"ds:[inline-size:100%] ds:[block-size:100%]\"\n >\n <MapImperativeBridge\n onHandleReady={onHandleReady}\n onMarkerSelect={(markerId) => onMarkerClick?.(markerId)}\n />\n {(markers ?? []).map((marker) => {\n // Selection state is exposed to the consumer via\n // `data-selected` on the marker root so consumers can\n // style their own InfoWindow / sidebar highlight from\n // it. The kit does NOT swap the Pin's fill colour on\n // selection — `--accent` (magenta-500 in light theme)\n // fails AA on white per 05-accessibility.mdx, and the\n // alternative tokens that pass (`--info`, `--success`)\n // carry semantic baggage. Visual selection state is\n // the consumer's call.\n const isSelected =\n selectedMarkerId != null && selectedMarkerId === marker.id;\n const accessibleLabel = t('mapView.markerLabel', {\n label: marker.label ?? marker.id,\n });\n // Pin implementation switches on whether the\n // consumer supplied `mapId`. Google's\n // AdvancedMarkerElement requires the Map instance to\n // be initialised with a valid Map ID — without one\n // the API logs an error (\"La mappa è stata\n // inizializzata senza un ID mappa valido\") and any\n // AdvancedMarker rendered against that map fails to\n // appear. Cloud Map IDs are an opt-in feature; many\n // consumers (booking-website env without\n // GOOGLE_MAPS_MAP_ID, the OSS demo, etc.) legitimately\n // omit it.\n //\n // Fall back to the classic <Marker> (a thin wrapper\n // around google.maps.Marker) when mapId is absent.\n // Google has formally deprecated google.maps.Marker\n // but it still renders cleanly and produces no\n // console errors; the only loss is the brand-tinted\n // <Pin> chrome (which Marker doesn't accept as a\n // child). When a consumer wants the styled pin they\n // can opt back in by supplying `mapId`.\n if (mapId) {\n return (\n <AdvancedMarker\n key={marker.id}\n position={marker.position}\n // `title` becomes the HTML `title` attribute on\n // Google's marker wrapper — that's a tooltip, not\n // a reliable accessible name. The wrapper also\n // receives `aria-label` which Google honours as\n // the SR-announced name. Both are set so sighted\n // hover tooltips and SR labels stay aligned.\n title={accessibleLabel}\n aria-label={accessibleLabel}\n data-selected={isSelected ? 'true' : 'false'}\n onClick={() => onMarkerClick?.(marker.id)}\n >\n <Pin\n background={'var(--primary)'}\n borderColor={'var(--primary)'}\n glyphColor={'var(--primary-foreground)'}\n />\n </AdvancedMarker>\n );\n }\n return (\n <Marker\n key={marker.id}\n position={marker.position}\n title={accessibleLabel}\n onClick={() => onMarkerClick?.(marker.id)}\n />\n );\n })}\n </GoogleMap>\n </APIProvider>\n ) : (\n <ConsentPlaceholder\n address={address}\n description={\n consentDescription ?? t('mapView.consentDescription')\n }\n onLoadMap={handleLoadMap}\n consentCta={consentCta}\n openInGoogleMapsHref={openInGoogleMapsHref}\n />\n )}\n </div>\n </div>\n );\n },\n);\nMapView.displayName = 'MapView';\n"],"names":["fastDeepEqual","equal","a","b","length","i","keys","key","VERSION","__rest","s","e","p","__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","reject","fulfilled","step","rejected","result","setScriptSrc","script","src","bootstrap","bootstrapParams","bootstrapPromise","bootstrapParamsKey","PRODUCT_NAME","GOOGLE","IMPORT_API_NAME","PENDING_BOOTSTRAP_KEY","doc","global_","google_","namespace","libraries","searchParams","triggerBootstrap","g","_a","libraryName","args","MSG_REPEATED_SET_OPTIONS","options","MSG_IMPORT_LIBRARY_EXISTS","MSG_SET_OPTIONS_NOT_CALLED","MSG_SCRIPT_ELEMENT_EXISTS","__DEV__$1","logDevWarning","message","logDevNotice","__DEV__","setOptionsWasCalled_","setOptions","installImportLibrary_","importLibrary","_b","importLibraryExists","APILoadingStatus","DEFAULT_SOLUTION_CHANNEL","DEFAULT_INTERNAL_USAGE_ATTRIBUTION_IDS","APIProviderContext","React__default","loadingStatus","serializedApiParams","listeners","updateLoadingStatus","status","listener","useMapInstances","mapInstances","setMapInstances","useState","mapInstance","id","instances","remaining","useMap3DInstances","map3dInstances","setMap3DInstances","map3dInstance","useGoogleMapsApiLoader","props","onLoad","onError","apiKey","version","region","language","authReferrerPolicy","channel","solutionChannel","fetchAppCheckToken","setStatus","loadedLibraries","addLoadedLibrary","useReducer","action","currentSerializedParams","useMemo","params","importLibraryCallback","useCallback","name","res","useEffect","librariesToLoad","error","settings","useInternalUsageAttributionIds","APIProvider","children","loaderProps","addMapInstance","removeMapInstance","clearMapInstances","addMap3DInstance","removeMap3DInstance","clearMap3DInstances","internalUsageAttributionIds","contextValue","useMapEvents","map","propName","eventPropNames","handler","eventType","propNameToEventType","ev","createMapEvent","type","srcEvent","cameraEventTypes","camEvent","center","zoom","heading","tilt","bounds","mouseEventTypes","mouseEvent","useMemoized","isEqual","ref","useRef$1","useCustomCompareEffect","effect","dependencies","useDeepCompareEffect","isDeepEqual","mapOptionKeys","useMapOptions","mapProps","mapOptions","useApiLoadingStatus","useContext","useDeckGLCameraUpdate","viewport","viewState","isDeckGlControlled","useLayoutEffect$1","latitude","longitude","isLatLngLiteral","obj","latLngEquals","A","toLatLngLiteral","B","toLatLngBoundsLiteral","ne","sw","boundsEquals","pathEquals","arrayB","pathsEquals","inner","useMapCameraParams","cameraStateRef","lat","lng","nextCamera","needsUpdate","AuthFailureMessage","style","useCallbackRef","el","setEl","useApiIsLoaded","useForceUpdate","forceUpdate","x","handleBoundsChange","useTrackedCameraStateRef","CachedMapStack","useMapInstance","context","apiIsLoaded","setMap","container","containerRef","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme","hasZoom","hasCenter","customIds","savedMapStateRef","mapId","cacheKey","mapDiv","padding","defBounds","savedMapId","savedCameraState","GoogleMapsContext","Map","className","mapRef","isControlledExternally","cameraOptions","_c","combinedStyle","shownMessages","logErrorOnce","useMap","ctx","useMapsLibrary","useLayoutEffect","useRef","React","useBeforeEffect","forbiddenInRender","useEffectEventPolyfill","fn","useEffectEvent","noop$1","useMapsEventListener","target","callback","eventFn","isCallbackDefined","usePropBinding","object","prop","noop","useDomEventListener","listenerCallback","GlobalStyleManager","styleElement","globalStyleManager","isVersionGreaterEqual","major","minor","currentMajor","currentMinor","AdvancedMarkerContext","AdvancedMarkerAnchorPoint","AdvancedMarker","forwardRef","anchorPoint","marker","contentContainer","useAdvancedMarker","advancedMarkerContextValue","useImperativeHandle","createPortal","MarkerContent","isElementNode","node","styles","setMarker","setContentContainer","markerLibrary","onClick","onMouseEnter","onMouseLeave","onDrag","onDragStart","onDragEnd","collisionBehavior","clickable","draggable","position","title","zIndex","anchorLeft","anchorTop","numChildren","Children","newMarker","contentElement","useAdvancedMarkerAnchoring","gmpClickable","hasChildren","anchorOptionsSupported","y","translateX","translateY","useCircle","onMouseOver","onMouseOut","onRadiusChanged","onCenterChanged","radius","defaultRadius","destructuredOptions","circle","setCircle","circleOptions","newCircle","newRadius","Circle","setValueForStyles","element","prevStyles","elementStyle","styleName","setValueForStyle","isCustomProperty","isUnitlessNumber","unitlessNumbers","getPathsArray","polygon","mvcPaths","usePolygon","onPathsChanged","externalPolygon","encodedPaths","paths","defaultPaths","setPolygon","geometryLibrary","isUpdatingRef","polygonOptions","instance","initialPaths","polygonOptionsWithPaths","handlePathsChange","subscribeToInnerPath","innerPath","index","firstPath","normalizedPaths","currentPaths","decodedPaths","encodedPath","Polygon","usePolyline","onPathChanged","externalPolyline","path","defaultPath","polyline","setPolyline","polylineOptions","initialPath","polylineOptionsWithPath","mvcPath","handlePathChange","currentPath","decodedPath","Polyline","DEFAULT_CAMERA_STATE","CAMERA_PROPS","updateCameraState","map3d","useTrackedCameraStateRef3D","eventName","removeListener","useMap3DInstance","maps3dLib","customElementReady","setCustomElementReady","map3dRef","range","roll","defaultRange","defaultRoll","onHeadingChanged","onTiltChanged","onRangeChanged","onRollChanged","onCameraChanged","onSteadyChange","onAnimationEnd","mode","gestureHandling","elementOptions","initialCenter","initialHeading","initialTilt","initialRange","initialRoll","initialOptions","toLatLngAltitudeLiteral","useMap3DCameraParams","_d","_e","_f","_g","centerLiteral","altitude","currentState","CAMERA_EVENTS","createCameraEvent","createClickEvent","placeClickEvent","createSteadyChangeEvent","useMap3DEvents","useMap3DEvent","createEvent","MAP_3D_OPTION_KEYS","useMap3DOptions","GoogleMaps3DContext","DEFAULT_CONTAINER_STYLE","Map3D","isReady","instanceId","Marker3DContext","createContext","Marker3D","altitudeMode","drawsWhenOccluded","extruded","label","sizePreserved","isInteractive","contentHandledExternally","setContentHandledExternally","markerRef","childNodes","tagName","template","Popover","headerContent","open","anchor","anchorId","lightDismissDisabled","autoPanDisabled","onClose","popover","setPopover","prevStyleRef","usePopoverCloseObserver","positionAnchor","previousOpenState","openPropRef","observer","mutations","mutation","isOpen","useMarker","markerOptions","m","gme","Marker","PinLegacy","advancedMarkerContext","marker3dContext","advancedMarker","marker3d","glyphContainer","pinViewOptions","pinElement","markerContent","PinModern","pinOptions","Pin","isModern","glyph","glyphSrc","glyphText","restProps","isUrl","finalGlyphText","finalGlyphSrc","finalGlyph","useRectangle","onBoundsChanged","rectangle","setRectangle","rectangleOptions","newRectangle","Rectangle","mapViewAgent","handle","mapViewVariants","cva","innerSurfaceVariants","consentChromeVariants","consentTitleVariants","consentDescriptionVariants","MapImperativeBridge","onHandleReady","onMarkerSelect","ConsentPlaceholder","address","description","onLoadMap","openInGoogleMapsHref","consentCta","t","useTranslation","jsx","MapPin","jsxs","Button","ExternalLink","MapView","markers","selectedMarkerId","onMarkerClick","consentGranted","onConsentRequest","consentDescription","size","surface","ariaLabel","rest","i18n","rawId","useId","reducedMotion","setReducedMotion","mql","sync","handleRef","z","markerId","agentHandle","useAgentRegistration","internalConsent","setInternalConsent","effectiveConsent","handleLoadMap","GoogleMap","isSelected","accessibleLabel"],"mappings":";;;;;;;;;;;;;wBAMAA,KAAiB,SAASC,EAAMC,GAAGC,GAAG;AACpC,QAAID,MAAMC,EAAG,QAAO;AAEpB,QAAID,KAAKC,KAAK,OAAOD,KAAK,YAAY,OAAOC,KAAK,UAAU;AAC1D,UAAID,EAAE,gBAAgBC,EAAE,YAAa,QAAO;AAE5C,UAAIC,GAAQC,GAAGC;AACf,UAAI,MAAM,QAAQJ,CAAC,GAAG;AAEpB,YADAE,IAASF,EAAE,QACPE,KAAUD,EAAE,OAAQ,QAAO;AAC/B,aAAKE,IAAID,GAAQC,QAAQ;AACvB,cAAI,CAACJ,EAAMC,EAAEG,CAAC,GAAGF,EAAEE,CAAC,CAAC,EAAG,QAAO;AAC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