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lB,OAAOC,KAAKwF,MAQxB,OAPIoQ,GAASoP,EAAI3e,YAAY/P,EAAG,QAASsf,GACrCG,GAAQiP,EAAI3e,YAAY/P,EAAG,OAAQyf,GACnCyK,GAAawE,EAAI3e,YAAY/P,EAAG,YAAakqB,GAC7CC,GAAWuE,EAAI3e,YAAY/P,EAAG,UAAWmqB,GACzCoE,GAAaG,EAAI3e,YAAY/P,EAAG,YAAauuB,GAC7CC,GAAYE,EAAI3e,YAAY/P,EAAG,WAAYwuB,GAC/C7kB,EAAOglB,aAAa5D,QAAQT,IACrB,KACLoE,EAAI7J,uBAAuB7kB,EAAE,CAC9B,GACA,CAAC2J,EAAQ2gB,EAAWhL,EAASG,EAAQyK,EAAaC,EAAWoE,EAAaC,KAI7E,IAAApR,YAAU,KACHzT,GACD8kB,GAAe9kB,EAAO0a,WAAWoK,EAAc,GAClD,CAAC9kB,EAAQ8kB,KAEZ,IAAArR,YAAU,MAEJkN,GAAcpgB,GAAaP,GAC/BA,EAAOilB,YAAY1kB,EAAS,GAC3B,CAACogB,EAAWpgB,EAAUP,IAClBA,CACT,CAKiBklB,CAAUxsB,GAEzB,OADA,IAAAopB,qBAAoB5U,GAAK,IAAMlN,GAAQ,CAACA,IACpB,gBAAoB,WAAgB,KAAK,wDCh2D/D,SAASmlB,EAASnuB,GAChB,KAAM,CACAouB,UAAW,UACXC,GAAIruB,EACJzD,MAAO,IAAIA,MAEnB","sources":["webpack://datacenters/./node_modules/kdbush/index.js","webpack://datacenters/./node_modules/supercluster/index.js","webpack://datacenters/./node_modules/@googlemaps/markerclusterer/dist/index.esm.js","webpack://datacenters/./node_modules/date-fns/esm/constants/index.js","webpack://datacenters/./node_modules/date-fns/esm/parseISO/index.js","webpack://datacenters/./node_modules/fast-deep-equal/index.js","webpack://datacenters/./node_modules/@heroicons/react/24/solid/esm/CheckBadgeIcon.js","webpack://datacenters/./node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs","webpack://datacenters/./node_modules/rescript/lib/es6/pervasivesU.js"],"sourcesContent":["\nconst ARRAY_TYPES = [\n Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array,\n Int32Array, Uint32Array, Float32Array, Float64Array\n];\n\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n\nconst VERSION = 1; // serialized format version\nconst HEADER_SIZE = 8;\n\nexport default class KDBush {\n\n /**\n * Creates an index from raw `ArrayBuffer` data.\n * @param {ArrayBuffer} data\n */\n static from(data) {\n if (!(data instanceof ArrayBuffer)) {\n throw new Error('Data must be an instance of ArrayBuffer.');\n }\n const [magic, versionAndType] = new Uint8Array(data, 0, 2);\n if (magic !== 0xdb) {\n throw new Error('Data does not appear to be in a KDBush format.');\n }\n const version = versionAndType >> 4;\n if (version !== VERSION) {\n throw new Error(`Got v${version} data when expected v${VERSION}.`);\n }\n const ArrayType = ARRAY_TYPES[versionAndType & 0x0f];\n if (!ArrayType) {\n throw new Error('Unrecognized array type.');\n }\n const [nodeSize] = new Uint16Array(data, 2, 1);\n const [numItems] = new Uint32Array(data, 4, 1);\n\n return new KDBush(numItems, nodeSize, ArrayType, data);\n }\n\n /**\n * Creates an index that will hold a given number of items.\n * @param {number} numItems\n * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).\n * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n * @param {ArrayBuffer} [data] (For internal use only)\n */\n constructor(numItems, nodeSize = 64, ArrayType = Float64Array, data) {\n if (isNaN(numItems) || numItems < 0) throw new Error(`Unpexpected numItems value: ${numItems}.`);\n\n this.numItems = +numItems;\n this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n this.ArrayType = ArrayType;\n this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;\n\n const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n const coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;\n const idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;\n const padCoords = (8 - idsByteSize % 8) % 8;\n\n if (arrayTypeIndex < 0) {\n throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n }\n\n if (data && (data instanceof ArrayBuffer)) { // reconstruct an index from a buffer\n this.data = data;\n this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n this._pos = numItems * 2;\n this._finished = true;\n } else { // initialize a new index\n this.data = new ArrayBuffer(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords);\n this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n this._pos = 0;\n this._finished = false;\n\n // set header\n new Uint8Array(this.data, 0, 2).set([0xdb, (VERSION << 4) + arrayTypeIndex]);\n new Uint16Array(this.data, 2, 1)[0] = nodeSize;\n new Uint32Array(this.data, 4, 1)[0] = numItems;\n }\n }\n\n /**\n * Add a point to the index.\n * @param {number} x\n * @param {number} y\n * @returns {number} An incremental index associated with the added item (starting from `0`).\n */\n add(x, y) {\n const index = this._pos >> 1;\n this.ids[index] = index;\n this.coords[this._pos++] = x;\n this.coords[this._pos++] = y;\n return index;\n }\n\n /**\n * Perform indexing of the added points.\n */\n finish() {\n const numAdded = this._pos >> 1;\n if (numAdded !== this.numItems) {\n throw new Error(`Added ${numAdded} items when expected ${this.numItems}.`);\n }\n // kd-sort both arrays for efficient search\n sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);\n\n this._finished = true;\n return this;\n }\n\n /**\n * Search the index for items within a given bounding box.\n * @param {number} minX\n * @param {number} minY\n * @param {number} maxX\n * @param {number} maxY\n * @returns {number[]} An array of indices correponding to the found items.\n */\n range(minX, minY, maxX, maxY) {\n if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n const {ids, coords, nodeSize} = this;\n const stack = [0, ids.length - 1, 0];\n const result = [];\n\n // recursively search for items in range in the kd-sorted arrays\n while (stack.length) {\n const axis = stack.pop() || 0;\n const right = stack.pop() || 0;\n const left = stack.pop() || 0;\n\n // if we reached \"tree node\", search linearly\n if (right - left <= nodeSize) {\n for (let i = left; i <= right; i++) {\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]);\n }\n continue;\n }\n\n // otherwise find the middle index\n const m = (left + right) >> 1;\n\n // include the middle item if it's in range\n const x = coords[2 * m];\n const y = coords[2 * m + 1];\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);\n\n // queue search in halves that intersect the query\n if (axis === 0 ? minX <= x : minY <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(1 - axis);\n }\n if (axis === 0 ? maxX >= x : maxY >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(1 - axis);\n }\n }\n\n return result;\n }\n\n /**\n * Search the index for items within a given radius.\n * @param {number} qx\n * @param {number} qy\n * @param {number} r Query radius.\n * @returns {number[]} An array of indices correponding to the found items.\n */\n within(qx, qy, r) {\n if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n const {ids, coords, nodeSize} = this;\n const stack = [0, ids.length - 1, 0];\n const result = [];\n const r2 = r * r;\n\n // recursively search for items within radius in the kd-sorted arrays\n while (stack.length) {\n const axis = stack.pop() || 0;\n const right = stack.pop() || 0;\n const left = stack.pop() || 0;\n\n // if we reached \"tree node\", search linearly\n if (right - left <= nodeSize) {\n for (let i = left; i <= right; i++) {\n if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]);\n }\n continue;\n }\n\n // otherwise find the middle index\n const m = (left + right) >> 1;\n\n // include the middle item if it's in range\n const x = coords[2 * m];\n const y = coords[2 * m + 1];\n if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);\n\n // queue search in halves that intersect the query\n if (axis === 0 ? qx - r <= x : qy - r <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(1 - axis);\n }\n if (axis === 0 ? qx + r >= x : qy + r >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(1 - axis);\n }\n }\n\n return result;\n }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} nodeSize\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction sort(ids, coords, nodeSize, left, right, axis) {\n if (right - left <= nodeSize) return;\n\n const m = (left + right) >> 1; // middle index\n\n // sort ids and coords around the middle index so that the halves lie\n // either left/right or top/bottom correspondingly (taking turns)\n select(ids, coords, m, left, right, axis);\n\n // recursively kd-sort first half and second half on the opposite axis\n sort(ids, coords, nodeSize, left, m - 1, 1 - axis);\n sort(ids, coords, nodeSize, m + 1, right, 1 - axis);\n}\n\n/**\n * Custom Floyd-Rivest selection algorithm: sort ids and coords so that\n * [left..k-1] items are smaller than k-th item (on either x or y axis)\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} k\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction select(ids, coords, k, left, right, axis) {\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n select(ids, coords, k, newLeft, newRight, axis);\n }\n\n const t = coords[2 * k + axis];\n let i = left;\n let j = right;\n\n swapItem(ids, coords, left, k);\n if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);\n\n while (i < j) {\n swapItem(ids, coords, i, j);\n i++;\n j--;\n while (coords[2 * i + axis] < t) i++;\n while (coords[2 * j + axis] > t) j--;\n }\n\n if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);\n else {\n j++;\n swapItem(ids, coords, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} i\n * @param {number} j\n */\nfunction swapItem(ids, coords, i, j) {\n swap(ids, i, j);\n swap(coords, 2 * i, 2 * j);\n swap(coords, 2 * i + 1, 2 * j + 1);\n}\n\n/**\n * @param {InstanceType<TypedArrayConstructor>} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\n/**\n * @param {number} ax\n * @param {number} ay\n * @param {number} bx\n * @param {number} by\n */\nfunction sqDist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n","\nimport KDBush from 'kdbush';\n\nconst defaultOptions = {\n minZoom: 0, // min zoom to generate clusters on\n maxZoom: 16, // max zoom level to cluster the points on\n minPoints: 2, // minimum points to form a cluster\n radius: 40, // cluster radius in pixels\n extent: 512, // tile extent (radius is calculated relative to it)\n nodeSize: 64, // size of the KD-tree leaf node, affects performance\n log: false, // whether to log timing info\n\n // whether to generate numeric ids for input features (in vector tiles)\n generateId: false,\n\n // a reduce function for calculating custom cluster properties\n reduce: null, // (accumulated, props) => { accumulated.sum += props.sum; }\n\n // properties to use for individual points when running the reducer\n map: props => props // props => ({sum: props.my_value})\n};\n\nconst fround = Math.fround || (tmp => ((x) => { tmp[0] = +x; return tmp[0]; }))(new Float32Array(1));\n\nconst OFFSET_ZOOM = 2;\nconst OFFSET_ID = 3;\nconst OFFSET_PARENT = 4;\nconst OFFSET_NUM = 5;\nconst OFFSET_PROP = 6;\n\nexport default class Supercluster {\n constructor(options) {\n this.options = Object.assign(Object.create(defaultOptions), options);\n this.trees = new Array(this.options.maxZoom + 1);\n this.stride = this.options.reduce ? 7 : 6;\n this.clusterProps = [];\n }\n\n load(points) {\n const {log, minZoom, maxZoom} = this.options;\n\n if (log) console.time('total time');\n\n const timerId = `prepare ${ points.length } points`;\n if (log) console.time(timerId);\n\n this.points = points;\n\n // generate a cluster object for each point and index input points into a KD-tree\n const data = [];\n\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n if (!p.geometry) continue;\n\n const [lng, lat] = p.geometry.coordinates;\n const x = fround(lngX(lng));\n const y = fround(latY(lat));\n // store internal point/cluster data in flat numeric arrays for performance\n data.push(\n x, y, // projected point coordinates\n Infinity, // the last zoom the point was processed at\n i, // index of the source feature in the original input array\n -1, // parent cluster id\n 1 // number of points in a cluster\n );\n if (this.options.reduce) data.push(0); // noop\n }\n let tree = this.trees[maxZoom + 1] = this._createTree(data);\n\n if (log) console.timeEnd(timerId);\n\n // cluster points on max zoom, then cluster the results on previous zoom, etc.;\n // results in a cluster hierarchy across zoom levels\n for (let z = maxZoom; z >= minZoom; z--) {\n const now = +Date.now();\n\n // create a new set of clusters for the zoom and index them with a KD-tree\n tree = this.trees[z] = this._createTree(this._cluster(tree, z));\n\n if (log) console.log('z%d: %d clusters in %dms', z, tree.numItems, +Date.now() - now);\n }\n\n if (log) console.timeEnd('total time');\n\n return this;\n }\n\n getClusters(bbox, zoom) {\n let minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;\n const minLat = Math.max(-90, Math.min(90, bbox[1]));\n let maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;\n const maxLat = Math.max(-90, Math.min(90, bbox[3]));\n\n if (bbox[2] - bbox[0] >= 360) {\n minLng = -180;\n maxLng = 180;\n } else if (minLng > maxLng) {\n const easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);\n const westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);\n return easternHem.concat(westernHem);\n }\n\n const tree = this.trees[this._limitZoom(zoom)];\n const ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));\n const data = tree.data;\n const clusters = [];\n for (const id of ids) {\n const k = this.stride * id;\n clusters.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n }\n return clusters;\n }\n\n getChildren(clusterId) {\n const originId = this._getOriginId(clusterId);\n const originZoom = this._getOriginZoom(clusterId);\n const errorMsg = 'No cluster with the specified id.';\n\n const tree = this.trees[originZoom];\n if (!tree) throw new Error(errorMsg);\n\n const data = tree.data;\n if (originId * this.stride >= data.length) throw new Error(errorMsg);\n\n const r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));\n const x = data[originId * this.stride];\n const y = data[originId * this.stride + 1];\n const ids = tree.within(x, y, r);\n const children = [];\n for (const id of ids) {\n const k = id * this.stride;\n if (data[k + OFFSET_PARENT] === clusterId) {\n children.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n }\n }\n\n if (children.length === 0) throw new Error(errorMsg);\n\n return children;\n }\n\n getLeaves(clusterId, limit, offset) {\n limit = limit || 10;\n offset = offset || 0;\n\n const leaves = [];\n this._appendLeaves(leaves, clusterId, limit, offset, 0);\n\n return leaves;\n }\n\n getTile(z, x, y) {\n const tree = this.trees[this._limitZoom(z)];\n const z2 = Math.pow(2, z);\n const {extent, radius} = this.options;\n const p = radius / extent;\n const top = (y - p) / z2;\n const bottom = (y + 1 + p) / z2;\n\n const tile = {\n features: []\n };\n\n this._addTileFeatures(\n tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom),\n tree.data, x, y, z2, tile);\n\n if (x === 0) {\n this._addTileFeatures(\n tree.range(1 - p / z2, top, 1, bottom),\n tree.data, z2, y, z2, tile);\n }\n if (x === z2 - 1) {\n this._addTileFeatures(\n tree.range(0, top, p / z2, bottom),\n tree.data, -1, y, z2, tile);\n }\n\n return tile.features.length ? tile : null;\n }\n\n getClusterExpansionZoom(clusterId) {\n let expansionZoom = this._getOriginZoom(clusterId) - 1;\n while (expansionZoom <= this.options.maxZoom) {\n const children = this.getChildren(clusterId);\n expansionZoom++;\n if (children.length !== 1) break;\n clusterId = children[0].properties.cluster_id;\n }\n return expansionZoom;\n }\n\n _appendLeaves(result, clusterId, limit, offset, skipped) {\n const children = this.getChildren(clusterId);\n\n for (const child of children) {\n const props = child.properties;\n\n if (props && props.cluster) {\n if (skipped + props.point_count <= offset) {\n // skip the whole cluster\n skipped += props.point_count;\n } else {\n // enter the cluster\n skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped);\n // exit the cluster\n }\n } else if (skipped < offset) {\n // skip a single point\n skipped++;\n } else {\n // add a single point\n result.push(child);\n }\n if (result.length === limit) break;\n }\n\n return skipped;\n }\n\n _createTree(data) {\n const tree = new KDBush(data.length / this.stride | 0, this.options.nodeSize, Float32Array);\n for (let i = 0; i < data.length; i += this.stride) tree.add(data[i], data[i + 1]);\n tree.finish();\n tree.data = data;\n return tree;\n }\n\n _addTileFeatures(ids, data, x, y, z2, tile) {\n for (const i of ids) {\n const k = i * this.stride;\n const isCluster = data[k + OFFSET_NUM] > 1;\n\n let tags, px, py;\n if (isCluster) {\n tags = getClusterProperties(data, k, this.clusterProps);\n px = data[k];\n py = data[k + 1];\n } else {\n const p = this.points[data[k + OFFSET_ID]];\n tags = p.properties;\n const [lng, lat] = p.geometry.coordinates;\n px = lngX(lng);\n py = latY(lat);\n }\n\n const f = {\n type: 1,\n geometry: [[\n Math.round(this.options.extent * (px * z2 - x)),\n Math.round(this.options.extent * (py * z2 - y))\n ]],\n tags\n };\n\n // assign id\n let id;\n if (isCluster || this.options.generateId) {\n // optionally generate id for points\n id = data[k + OFFSET_ID];\n } else {\n // keep id if already assigned\n id = this.points[data[k + OFFSET_ID]].id;\n }\n\n if (id !== undefined) f.id = id;\n\n tile.features.push(f);\n }\n }\n\n _limitZoom(z) {\n return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));\n }\n\n _cluster(tree, zoom) {\n const {radius, extent, reduce, minPoints} = this.options;\n const r = radius / (extent * Math.pow(2, zoom));\n const data = tree.data;\n const nextData = [];\n const stride = this.stride;\n\n // loop through each point\n for (let i = 0; i < data.length; i += stride) {\n // if we've already visited the point at this zoom level, skip it\n if (data[i + OFFSET_ZOOM] <= zoom) continue;\n data[i + OFFSET_ZOOM] = zoom;\n\n // find all nearby points\n const x = data[i];\n const y = data[i + 1];\n const neighborIds = tree.within(data[i], data[i + 1], r);\n\n const numPointsOrigin = data[i + OFFSET_NUM];\n let numPoints = numPointsOrigin;\n\n // count the number of points in a potential cluster\n for (const neighborId of neighborIds) {\n const k = neighborId * stride;\n // filter out neighbors that are already processed\n if (data[k + OFFSET_ZOOM] > zoom) numPoints += data[k + OFFSET_NUM];\n }\n\n // if there were neighbors to merge, and there are enough points to form a cluster\n if (numPoints > numPointsOrigin && numPoints >= minPoints) {\n let wx = x * numPointsOrigin;\n let wy = y * numPointsOrigin;\n\n let clusterProperties;\n let clusterPropIndex = -1;\n\n // encode both zoom and point index on which the cluster originated -- offset by total length of features\n const id = ((i / stride | 0) << 5) + (zoom + 1) + this.points.length;\n\n for (const neighborId of neighborIds) {\n const k = neighborId * stride;\n\n if (data[k + OFFSET_ZOOM] <= zoom) continue;\n data[k + OFFSET_ZOOM] = zoom; // save the zoom (so it doesn't get processed twice)\n\n const numPoints2 = data[k + OFFSET_NUM];\n wx += data[k] * numPoints2; // accumulate coordinates for calculating weighted center\n wy += data[k + 1] * numPoints2;\n\n data[k + OFFSET_PARENT] = id;\n\n if (reduce) {\n if (!clusterProperties) {\n clusterProperties = this._map(data, i, true);\n clusterPropIndex = this.clusterProps.length;\n this.clusterProps.push(clusterProperties);\n }\n reduce(clusterProperties, this._map(data, k));\n }\n }\n\n data[i + OFFSET_PARENT] = id;\n nextData.push(wx / numPoints, wy / numPoints, Infinity, id, -1, numPoints);\n if (reduce) nextData.push(clusterPropIndex);\n\n } else { // left points as unclustered\n for (let j = 0; j < stride; j++) nextData.push(data[i + j]);\n\n if (numPoints > 1) {\n for (const neighborId of neighborIds) {\n const k = neighborId * stride;\n if (data[k + OFFSET_ZOOM] <= zoom) continue;\n data[k + OFFSET_ZOOM] = zoom;\n for (let j = 0; j < stride; j++) nextData.push(data[k + j]);\n }\n }\n }\n }\n\n return nextData;\n }\n\n // get index of the point from which the cluster originated\n _getOriginId(clusterId) {\n return (clusterId - this.points.length) >> 5;\n }\n\n // get zoom of the point from which the cluster originated\n _getOriginZoom(clusterId) {\n return (clusterId - this.points.length) % 32;\n }\n\n _map(data, i, clone) {\n if (data[i + OFFSET_NUM] > 1) {\n const props = this.clusterProps[data[i + OFFSET_PROP]];\n return clone ? Object.assign({}, props) : props;\n }\n const original = this.points[data[i + OFFSET_ID]].properties;\n const result = this.options.map(original);\n return clone && result === original ? Object.assign({}, result) : result;\n }\n}\n\nfunction getClusterJSON(data, i, clusterProps) {\n return {\n type: 'Feature',\n id: data[i + OFFSET_ID],\n properties: getClusterProperties(data, i, clusterProps),\n geometry: {\n type: 'Point',\n coordinates: [xLng(data[i]), yLat(data[i + 1])]\n }\n };\n}\n\nfunction getClusterProperties(data, i, clusterProps) {\n const count = data[i + OFFSET_NUM];\n const abbrev =\n count >= 10000 ? `${Math.round(count / 1000) }k` :\n count >= 1000 ? `${Math.round(count / 100) / 10 }k` : count;\n const propIndex = data[i + OFFSET_PROP];\n const properties = propIndex === -1 ? {} : Object.assign({}, clusterProps[propIndex]);\n return Object.assign(properties, {\n cluster: true,\n cluster_id: data[i + OFFSET_ID],\n point_count: count,\n point_count_abbreviated: abbrev\n });\n}\n\n// longitude/latitude to spherical mercator in [0..1] range\nfunction lngX(lng) {\n return lng / 360 + 0.5;\n}\nfunction latY(lat) {\n const sin = Math.sin(lat * Math.PI / 180);\n const y = (0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI);\n return y < 0 ? 0 : y > 1 ? 1 : y;\n}\n\n// spherical mercator to longitude/latitude\nfunction xLng(x) {\n return (x - 0.5) * 360;\n}\nfunction yLat(y) {\n const y2 = (180 - y * 360) * Math.PI / 180;\n return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n","import equal from 'fast-deep-equal';\nimport SuperCluster from 'supercluster';\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\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}\n\n/**\n * Copyright 2023 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 */\n/**\n * util class that creates a common set of convenience functions to wrap\n * shared behavior of Advanced Markers and Markers.\n */\nclass MarkerUtils {\n static isAdvancedMarkerAvailable(map) {\n return (google.maps.marker &&\n map.getMapCapabilities().isAdvancedMarkersAvailable === true);\n }\n static isAdvancedMarker(marker) {\n return (google.maps.marker &&\n marker instanceof google.maps.marker.AdvancedMarkerElement);\n }\n static setMap(marker, map) {\n if (this.isAdvancedMarker(marker)) {\n marker.map = map;\n }\n else {\n marker.setMap(map);\n }\n }\n static getPosition(marker) {\n // SuperClusterAlgorithm.calculate expects a LatLng instance so we fake it for Adv Markers\n if (this.isAdvancedMarker(marker)) {\n if (marker.position) {\n if (marker.position instanceof google.maps.LatLng) {\n return marker.position;\n }\n // since we can't cast to LatLngLiteral for reasons =(\n if (marker.position.lat && marker.position.lng) {\n return new google.maps.LatLng(marker.position.lat, marker.position.lng);\n }\n }\n return new google.maps.LatLng(null);\n }\n return marker.getPosition();\n }\n static getVisible(marker) {\n if (this.isAdvancedMarker(marker)) {\n /**\n * Always return true for Advanced Markers because the clusterer\n * uses getVisible as a way to count legacy markers not as an actual\n * indicator of visibility for some reason. Even when markers are hidden\n * Marker.getVisible returns `true` and this is used to set the marker count\n * on the cluster. See the behavior of Cluster.count\n */\n return true;\n }\n return marker.getVisible();\n }\n}\n\n/**\n * Copyright 2021 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 */\nclass Cluster {\n constructor({ markers, position }) {\n this.markers = markers;\n if (position) {\n if (position instanceof google.maps.LatLng) {\n this._position = position;\n }\n else {\n this._position = new google.maps.LatLng(position);\n }\n }\n }\n get bounds() {\n if (this.markers.length === 0 && !this._position) {\n return;\n }\n const bounds = new google.maps.LatLngBounds(this._position, this._position);\n for (const marker of this.markers) {\n bounds.extend(MarkerUtils.getPosition(marker));\n }\n return bounds;\n }\n get position() {\n return this._position || this.bounds.getCenter();\n }\n /**\n * Get the count of **visible** markers.\n */\n get count() {\n return this.markers.filter((m) => MarkerUtils.getVisible(m)).length;\n }\n /**\n * Add a marker to the cluster.\n */\n push(marker) {\n this.markers.push(marker);\n }\n /**\n * Cleanup references and remove marker from map.\n */\n delete() {\n if (this.marker) {\n MarkerUtils.setMap(this.marker, null);\n this.marker = undefined;\n }\n this.markers.length = 0;\n }\n}\n\n/**\n * Copyright 2021 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 */\n/**\n * Returns the markers visible in a padded map viewport\n *\n * @param map\n * @param mapCanvasProjection\n * @param markers The list of marker to filter\n * @param viewportPaddingPixels The padding in pixel\n * @returns The list of markers in the padded viewport\n */\nconst filterMarkersToPaddedViewport = (map, mapCanvasProjection, markers, viewportPaddingPixels) => {\n const extendedMapBounds = extendBoundsToPaddedViewport(map.getBounds(), mapCanvasProjection, viewportPaddingPixels);\n return markers.filter((marker) => extendedMapBounds.contains(MarkerUtils.getPosition(marker)));\n};\n/**\n * Extends a bounds by a number of pixels in each direction\n */\nconst extendBoundsToPaddedViewport = (bounds, projection, numPixels) => {\n const { northEast, southWest } = latLngBoundsToPixelBounds(bounds, projection);\n const extendedPixelBounds = extendPixelBounds({ northEast, southWest }, numPixels);\n return pixelBoundsToLatLngBounds(extendedPixelBounds, projection);\n};\n/**\n * Gets the extended bounds as a bbox [westLng, southLat, eastLng, northLat]\n */\nconst getPaddedViewport = (bounds, projection, pixels) => {\n const extended = extendBoundsToPaddedViewport(bounds, projection, pixels);\n const ne = extended.getNorthEast();\n const sw = extended.getSouthWest();\n return [sw.lng(), sw.lat(), ne.lng(), ne.lat()];\n};\n/**\n * Returns the distance between 2 positions.\n *\n * @hidden\n */\nconst distanceBetweenPoints = (p1, p2) => {\n const R = 6371; // Radius of the Earth in km\n const dLat = ((p2.lat - p1.lat) * Math.PI) / 180;\n const dLon = ((p2.lng - p1.lng) * Math.PI) / 180;\n const sinDLat = Math.sin(dLat / 2);\n const sinDLon = Math.sin(dLon / 2);\n const a = sinDLat * sinDLat +\n Math.cos((p1.lat * Math.PI) / 180) *\n Math.cos((p2.lat * Math.PI) / 180) *\n sinDLon *\n sinDLon;\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n};\n/**\n * Converts a LatLng bound to pixels.\n *\n * @hidden\n */\nconst latLngBoundsToPixelBounds = (bounds, projection) => {\n return {\n northEast: projection.fromLatLngToDivPixel(bounds.getNorthEast()),\n southWest: projection.fromLatLngToDivPixel(bounds.getSouthWest()),\n };\n};\n/**\n * Extends a pixel bounds by numPixels in all directions.\n *\n * @hidden\n */\nconst extendPixelBounds = ({ northEast, southWest }, numPixels) => {\n northEast.x += numPixels;\n northEast.y -= numPixels;\n southWest.x -= numPixels;\n southWest.y += numPixels;\n return { northEast, southWest };\n};\n/**\n * @hidden\n */\nconst pixelBoundsToLatLngBounds = ({ northEast, southWest }, projection) => {\n const sw = projection.fromDivPixelToLatLng(southWest);\n const ne = projection.fromDivPixelToLatLng(northEast);\n return new google.maps.LatLngBounds(sw, ne);\n};\n\n/**\n * Copyright 2021 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 */\n/**\n * @hidden\n */\nclass AbstractAlgorithm {\n constructor({ maxZoom = 16 }) {\n this.maxZoom = maxZoom;\n }\n /**\n * Helper function to bypass clustering based upon some map state such as\n * zoom, number of markers, etc.\n *\n * ```typescript\n * cluster({markers, map}: AlgorithmInput): Cluster[] {\n * if (shouldBypassClustering(map)) {\n * return this.noop({markers})\n * }\n * }\n * ```\n */\n noop({ markers, }) {\n return noop(markers);\n }\n}\n/**\n * Abstract viewport algorithm proves a class to filter markers by a padded\n * viewport. This is a common optimization.\n *\n * @hidden\n */\nclass AbstractViewportAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var { viewportPadding = 60 } = _a, options = __rest(_a, [\"viewportPadding\"]);\n super(options);\n this.viewportPadding = 60;\n this.viewportPadding = viewportPadding;\n }\n calculate({ markers, map, mapCanvasProjection, }) {\n if (map.getZoom() >= this.maxZoom) {\n return {\n clusters: this.noop({\n markers,\n }),\n changed: false,\n };\n }\n return {\n clusters: this.cluster({\n markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),\n map,\n mapCanvasProjection,\n }),\n };\n }\n}\n/**\n * @hidden\n */\nconst noop = (markers) => {\n const clusters = markers.map((marker) => new Cluster({\n position: MarkerUtils.getPosition(marker),\n markers: [marker],\n }));\n return clusters;\n};\n\n/**\n * Copyright 2021 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 */\n/**\n * The default Grid algorithm historically used in Google Maps marker\n * clustering.\n *\n * The Grid algorithm does not implement caching and markers may flash as the\n * viewport changes. Instead use {@link SuperClusterAlgorithm}.\n */\nclass GridAlgorithm extends AbstractViewportAlgorithm {\n constructor(_a) {\n var { maxDistance = 40000, gridSize = 40 } = _a, options = __rest(_a, [\"maxDistance\", \"gridSize\"]);\n super(options);\n this.clusters = [];\n this.state = { zoom: -1 };\n this.maxDistance = maxDistance;\n this.gridSize = gridSize;\n }\n calculate({ markers, map, mapCanvasProjection, }) {\n const state = { zoom: map.getZoom() };\n let changed = false;\n if (this.state.zoom >= this.maxZoom && state.zoom >= this.maxZoom) ;\n else {\n changed = !equal(this.state, state);\n }\n this.state = state;\n if (map.getZoom() >= this.maxZoom) {\n return {\n clusters: this.noop({\n markers,\n }),\n changed,\n };\n }\n return {\n clusters: this.cluster({\n markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),\n map,\n mapCanvasProjection,\n }),\n };\n }\n cluster({ markers, map, mapCanvasProjection, }) {\n this.clusters = [];\n markers.forEach((marker) => {\n this.addToClosestCluster(marker, map, mapCanvasProjection);\n });\n return this.clusters;\n }\n addToClosestCluster(marker, map, projection) {\n let maxDistance = this.maxDistance; // Some large number\n let cluster = null;\n for (let i = 0; i < this.clusters.length; i++) {\n const candidate = this.clusters[i];\n const distance = distanceBetweenPoints(candidate.bounds.getCenter().toJSON(), MarkerUtils.getPosition(marker).toJSON());\n if (distance < maxDistance) {\n maxDistance = distance;\n cluster = candidate;\n }\n }\n if (cluster &&\n extendBoundsToPaddedViewport(cluster.bounds, projection, this.gridSize).contains(MarkerUtils.getPosition(marker))) {\n cluster.push(marker);\n }\n else {\n const cluster = new Cluster({ markers: [marker] });\n this.clusters.push(cluster);\n }\n }\n}\n\n/**\n * Copyright 2021 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 */\n/**\n * Noop algorithm does not generate any clusters or filter markers by the an extended viewport.\n */\nclass NoopAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var options = __rest(_a, []);\n super(options);\n }\n calculate({ markers, map, mapCanvasProjection, }) {\n return {\n clusters: this.cluster({ markers, map, mapCanvasProjection }),\n changed: false,\n };\n }\n cluster(input) {\n return this.noop(input);\n }\n}\n\n/**\n * Copyright 2021 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 */\n/**\n * A very fast JavaScript algorithm for geospatial point clustering using KD trees.\n *\n * @see https://www.npmjs.com/package/supercluster for more information on options.\n */\nclass SuperClusterAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var { maxZoom, radius = 60 } = _a, options = __rest(_a, [\"maxZoom\", \"radius\"]);\n super({ maxZoom });\n this.state = { zoom: -1 };\n this.superCluster = new SuperCluster(Object.assign({ maxZoom: this.maxZoom, radius }, options));\n }\n calculate(input) {\n let changed = false;\n const state = { zoom: input.map.getZoom() };\n if (!equal(input.markers, this.markers)) {\n changed = true;\n // TODO use proxy to avoid copy?\n this.markers = [...input.markers];\n const points = this.markers.map((marker) => {\n const position = MarkerUtils.getPosition(marker);\n const coordinates = [position.lng(), position.lat()];\n return {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates,\n },\n properties: { marker },\n };\n });\n this.superCluster.load(points);\n }\n if (!changed) {\n if (this.state.zoom <= this.maxZoom || state.zoom <= this.maxZoom) {\n changed = !equal(this.state, state);\n }\n }\n this.state = state;\n if (changed) {\n this.clusters = this.cluster(input);\n }\n return { clusters: this.clusters, changed };\n }\n cluster({ map }) {\n return this.superCluster\n .getClusters([-180, -90, 180, 90], Math.round(map.getZoom()))\n .map((feature) => this.transformCluster(feature));\n }\n transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }) {\n if (properties.cluster) {\n return new Cluster({\n markers: this.superCluster\n .getLeaves(properties.cluster_id, Infinity)\n .map((leaf) => leaf.properties.marker),\n position: { lat, lng },\n });\n }\n const marker = properties.marker;\n return new Cluster({\n markers: [marker],\n position: MarkerUtils.getPosition(marker),\n });\n }\n}\n\n/**\n * Copyright 2021 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 */\n/**\n * A very fast JavaScript algorithm for geospatial point clustering using KD trees.\n *\n * @see https://www.npmjs.com/package/supercluster for more information on options.\n */\nclass SuperClusterViewportAlgorithm extends AbstractViewportAlgorithm {\n constructor(_a) {\n var { maxZoom, radius = 60, viewportPadding = 60 } = _a, options = __rest(_a, [\"maxZoom\", \"radius\", \"viewportPadding\"]);\n super({ maxZoom, viewportPadding });\n this.superCluster = new SuperCluster(Object.assign({ maxZoom: this.maxZoom, radius }, options));\n this.state = { zoom: -1, view: [0, 0, 0, 0] };\n }\n calculate(input) {\n const state = {\n zoom: Math.round(input.map.getZoom()),\n view: getPaddedViewport(input.map.getBounds(), input.mapCanvasProjection, this.viewportPadding),\n };\n let changed = !equal(this.state, state);\n if (!equal(input.markers, this.markers)) {\n changed = true;\n // TODO use proxy to avoid copy?\n this.markers = [...input.markers];\n const points = this.markers.map((marker) => {\n const position = MarkerUtils.getPosition(marker);\n const coordinates = [position.lng(), position.lat()];\n return {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates,\n },\n properties: { marker },\n };\n });\n this.superCluster.load(points);\n }\n if (changed) {\n this.clusters = this.cluster(input);\n this.state = state;\n }\n return { clusters: this.clusters, changed };\n }\n cluster({ map, mapCanvasProjection }) {\n /* recalculate new state because we can't use the cached version. */\n const state = {\n zoom: Math.round(map.getZoom()),\n view: getPaddedViewport(map.getBounds(), mapCanvasProjection, this.viewportPadding),\n };\n return this.superCluster\n .getClusters(state.view, state.zoom)\n .map((feature) => this.transformCluster(feature));\n }\n transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }) {\n if (properties.cluster) {\n return new Cluster({\n markers: this.superCluster\n .getLeaves(properties.cluster_id, Infinity)\n .map((leaf) => leaf.properties.marker),\n position: { lat, lng },\n });\n }\n const marker = properties.marker;\n return new Cluster({\n markers: [marker],\n position: MarkerUtils.getPosition(marker),\n });\n }\n}\n\n/**\n * Copyright 2021 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 */\n/**\n * Provides statistics on all clusters in the current render cycle for use in {@link Renderer.render}.\n */\nclass ClusterStats {\n constructor(markers, clusters) {\n this.markers = { sum: markers.length };\n const clusterMarkerCounts = clusters.map((a) => a.count);\n const clusterMarkerSum = clusterMarkerCounts.reduce((a, b) => a + b, 0);\n this.clusters = {\n count: clusters.length,\n markers: {\n mean: clusterMarkerSum / clusters.length,\n sum: clusterMarkerSum,\n min: Math.min(...clusterMarkerCounts),\n max: Math.max(...clusterMarkerCounts),\n },\n };\n }\n}\nclass DefaultRenderer {\n /**\n * The default render function for the library used by {@link MarkerClusterer}.\n *\n * Currently set to use the following:\n *\n * ```typescript\n * // change color if this cluster has more markers than the mean cluster\n * const color =\n * count > Math.max(10, stats.clusters.markers.mean)\n * ? \"#ff0000\"\n * : \"#0000ff\";\n *\n * // create svg url with fill color\n * const svg = window.btoa(`\n * <svg fill=\"${color}\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 240 240\">\n * <circle cx=\"120\" cy=\"120\" opacity=\".6\" r=\"70\" />\n * <circle cx=\"120\" cy=\"120\" opacity=\".3\" r=\"90\" />\n * <circle cx=\"120\" cy=\"120\" opacity=\".2\" r=\"110\" />\n * <circle cx=\"120\" cy=\"120\" opacity=\".1\" r=\"130\" />\n * </svg>`);\n *\n * // create marker using svg icon\n * return new google.maps.Marker({\n * position,\n * icon: {\n * url: `data:image/svg+xml;base64,${svg}`,\n * scaledSize: new google.maps.Size(45, 45),\n * },\n * label: {\n * text: String(count),\n * color: \"rgba(255,255,255,0.9)\",\n * fontSize: \"12px\",\n * },\n * // adjust zIndex to be above other markers\n * zIndex: 1000 + count,\n * });\n * ```\n */\n render({ count, position }, stats, map) {\n // change color if this cluster has more markers than the mean cluster\n const color = count > Math.max(10, stats.clusters.markers.mean) ? \"#ff0000\" : \"#0000ff\";\n // create svg literal with fill color\n const svg = `<svg fill=\"${color}\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 240 240\" width=\"50\" height=\"50\">\n<circle cx=\"120\" cy=\"120\" opacity=\".6\" r=\"70\" />\n<circle cx=\"120\" cy=\"120\" opacity=\".3\" r=\"90\" />\n<circle cx=\"120\" cy=\"120\" opacity=\".2\" r=\"110\" />\n<text x=\"50%\" y=\"50%\" style=\"fill:#fff\" text-anchor=\"middle\" font-size=\"50\" dominant-baseline=\"middle\" font-family=\"roboto,arial,sans-serif\">${count}</text>\n</svg>`;\n const title = `Cluster of ${count} markers`, \n // adjust zIndex to be above other markers\n zIndex = Number(google.maps.Marker.MAX_ZINDEX) + count;\n if (MarkerUtils.isAdvancedMarkerAvailable(map)) {\n // create cluster SVG element\n const parser = new DOMParser();\n const svgEl = parser.parseFromString(svg, \"image/svg+xml\").documentElement;\n svgEl.setAttribute(\"transform\", \"translate(0 25)\");\n const clusterOptions = {\n map,\n position,\n zIndex,\n title,\n content: svgEl,\n };\n return new google.maps.marker.AdvancedMarkerElement(clusterOptions);\n }\n const clusterOptions = {\n position,\n zIndex,\n title,\n icon: {\n url: `data:image/svg+xml;base64,${btoa(svg)}`,\n anchor: new google.maps.Point(25, 25),\n },\n };\n return new google.maps.Marker(clusterOptions);\n }\n}\n\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\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 */\n/**\n * Extends an object's prototype by another's.\n *\n * @param type1 The Type to be extended.\n * @param type2 The Type to extend with.\n * @ignore\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction extend(type1, type2) {\n /* istanbul ignore next */\n // eslint-disable-next-line prefer-const\n for (let property in type2.prototype) {\n type1.prototype[property] = type2.prototype[property];\n }\n}\n/**\n * @ignore\n */\nclass OverlayViewSafe {\n constructor() {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n extend(OverlayViewSafe, google.maps.OverlayView);\n }\n}\n\n/**\n * Copyright 2021 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 */\nvar MarkerClustererEvents;\n(function (MarkerClustererEvents) {\n MarkerClustererEvents[\"CLUSTERING_BEGIN\"] = \"clusteringbegin\";\n MarkerClustererEvents[\"CLUSTERING_END\"] = \"clusteringend\";\n MarkerClustererEvents[\"CLUSTER_CLICK\"] = \"click\";\n})(MarkerClustererEvents || (MarkerClustererEvents = {}));\nconst defaultOnClusterClickHandler = (_, cluster, map) => {\n map.fitBounds(cluster.bounds);\n};\n/**\n * MarkerClusterer creates and manages per-zoom-level clusters for large amounts\n * of markers. See {@link MarkerClustererOptions} for more details.\n *\n */\nclass MarkerClusterer extends OverlayViewSafe {\n constructor({ map, markers = [], algorithmOptions = {}, algorithm = new SuperClusterAlgorithm(algorithmOptions), renderer = new DefaultRenderer(), onClusterClick = defaultOnClusterClickHandler, }) {\n super();\n this.markers = [...markers];\n this.clusters = [];\n this.algorithm = algorithm;\n this.renderer = renderer;\n this.onClusterClick = onClusterClick;\n if (map) {\n this.setMap(map);\n }\n }\n addMarker(marker, noDraw) {\n if (this.markers.includes(marker)) {\n return;\n }\n this.markers.push(marker);\n if (!noDraw) {\n this.render();\n }\n }\n addMarkers(markers, noDraw) {\n markers.forEach((marker) => {\n this.addMarker(marker, true);\n });\n if (!noDraw) {\n this.render();\n }\n }\n removeMarker(marker, noDraw) {\n const index = this.markers.indexOf(marker);\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n MarkerUtils.setMap(marker, null);\n this.markers.splice(index, 1); // Remove the marker from the list of managed markers\n if (!noDraw) {\n this.render();\n }\n return true;\n }\n removeMarkers(markers, noDraw) {\n let removed = false;\n markers.forEach((marker) => {\n removed = this.removeMarker(marker, true) || removed;\n });\n if (removed && !noDraw) {\n this.render();\n }\n return removed;\n }\n clearMarkers(noDraw) {\n this.markers.length = 0;\n if (!noDraw) {\n this.render();\n }\n }\n /**\n * Recalculates and draws all the marker clusters.\n */\n render() {\n const map = this.getMap();\n if (map instanceof google.maps.Map && map.getProjection()) {\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this);\n const { clusters, changed } = this.algorithm.calculate({\n markers: this.markers,\n map,\n mapCanvasProjection: this.getProjection(),\n });\n // Allow algorithms to return flag on whether the clusters/markers have changed.\n if (changed || changed == undefined) {\n // Accumulate the markers of the clusters composed of a single marker.\n // Those clusters directly use the marker.\n // Clusters with more than one markers use a group marker generated by a renderer.\n const singleMarker = new Set();\n for (const cluster of clusters) {\n if (cluster.markers.length == 1) {\n singleMarker.add(cluster.markers[0]);\n }\n }\n const groupMarkers = [];\n // Iterate the clusters that are currently rendered.\n for (const cluster of this.clusters) {\n if (cluster.marker == null) {\n continue;\n }\n if (cluster.markers.length == 1) {\n if (!singleMarker.has(cluster.marker)) {\n // The marker:\n // - was previously rendered because it is from a cluster with 1 marker,\n // - should no more be rendered as it is not in singleMarker.\n MarkerUtils.setMap(cluster.marker, null);\n }\n }\n else {\n // Delay the removal of old group markers to avoid flickering.\n groupMarkers.push(cluster.marker);\n }\n }\n this.clusters = clusters;\n this.renderClusters();\n // Delayed removal of the markers of the former groups.\n requestAnimationFrame(() => groupMarkers.forEach((marker) => MarkerUtils.setMap(marker, null)));\n }\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this);\n }\n }\n onAdd() {\n this.idleListener = this.getMap().addListener(\"idle\", this.render.bind(this));\n this.render();\n }\n onRemove() {\n google.maps.event.removeListener(this.idleListener);\n this.reset();\n }\n reset() {\n this.markers.forEach((marker) => MarkerUtils.setMap(marker, null));\n this.clusters.forEach((cluster) => cluster.delete());\n this.clusters = [];\n }\n renderClusters() {\n // Generate stats to pass to renderers.\n const stats = new ClusterStats(this.markers, this.clusters);\n const map = this.getMap();\n this.clusters.forEach((cluster) => {\n if (cluster.markers.length === 1) {\n cluster.marker = cluster.markers[0];\n }\n else {\n // Generate the marker to represent the group.\n cluster.marker = this.renderer.render(cluster, stats, map);\n // Make sure all individual markers are removed from the map.\n cluster.markers.forEach((marker) => MarkerUtils.setMap(marker, null));\n if (this.onClusterClick) {\n cluster.marker.addListener(\"click\", \n /* istanbul ignore next */\n (event) => {\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTER_CLICK, cluster);\n this.onClusterClick(event, cluster, map);\n });\n }\n }\n MarkerUtils.setMap(cluster.marker, map);\n });\n }\n}\n\nexport { AbstractAlgorithm, AbstractViewportAlgorithm, Cluster, ClusterStats, DefaultRenderer, GridAlgorithm, MarkerClusterer, MarkerClustererEvents, MarkerUtils, NoopAlgorithm, SuperClusterAlgorithm, SuperClusterViewportAlgorithm, defaultOnClusterClickHandler, distanceBetweenPoints, extendBoundsToPaddedViewport, extendPixelBounds, filterMarkersToPaddedViewport, getPaddedViewport, noop, pixelBoundsToLatLngBounds };\n//# sourceMappingURL=index.esm.js.map\n","/**\n * Days in 1 week.\n *\n * @name daysInWeek\n * @constant\n * @type {number}\n * @default\n */\nexport var daysInWeek = 7;\n/**\n * Maximum allowed time.\n *\n * @name maxTime\n * @constant\n * @type {number}\n * @default\n */\n\nexport var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n/**\n * Milliseconds in 1 minute\n *\n * @name millisecondsInMinute\n * @constant\n * @type {number}\n * @default\n */\n\nexport var millisecondsInMinute = 60000;\n/**\n * Milliseconds in 1 hour\n *\n * @name millisecondsInHour\n * @constant\n * @type {number}\n * @default\n */\n\nexport var millisecondsInHour = 3600000;\n/**\n * Milliseconds in 1 second\n *\n * @name millisecondsInSecond\n * @constant\n * @type {number}\n * @default\n */\n\nexport var millisecondsInSecond = 1000;\n/**\n * Minimum allowed time.\n *\n * @name minTime\n * @constant\n * @type {number}\n * @default\n */\n\nexport var minTime = -maxTime;\n/**\n * Minutes in 1 hour\n *\n * @name minutesInHour\n * @constant\n * @type {number}\n * @default\n */\n\nexport var minutesInHour = 60;\n/**\n * Months in 1 quarter\n *\n * @name monthsInQuarter\n * @constant\n * @type {number}\n * @default\n */\n\nexport var monthsInQuarter = 3;\n/**\n * Months in 1 year\n *\n * @name monthsInYear\n * @constant\n * @type {number}\n * @default\n */\n\nexport var monthsInYear = 12;\n/**\n * Quarters in 1 year\n *\n * @name quartersInYear\n * @constant\n * @type {number}\n * @default\n */\n\nexport var quartersInYear = 4;\n/**\n * Seconds in 1 hour\n *\n * @name secondsInHour\n * @constant\n * @type {number}\n * @default\n */\n\nexport var secondsInHour = 3600;\n/**\n * Seconds in 1 minute\n *\n * @name secondsInMinute\n * @constant\n * @type {number}\n * @default\n */\n\nexport var secondsInMinute = 60;","import { millisecondsInHour, millisecondsInMinute } from \"../constants/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name parseISO\n * @category Common Helpers\n * @summary Parse ISO string\n *\n * @description\n * Parse the given string in ISO 8601 format and return an instance of Date.\n *\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If the argument isn't a string, the function cannot parse the string or\n * the values are invalid, it returns Invalid Date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The previous `parse` implementation was renamed to `parseISO`.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward\n * parseISO('2016-01-01')\n * ```\n *\n * - `parseISO` now validates separate date and time values in ISO-8601 strings\n * and returns `Invalid Date` if the date is invalid.\n *\n * ```javascript\n * parseISO('2018-13-32')\n * //=> Invalid Date\n * ```\n *\n * - `parseISO` now doesn't fall back to `new Date` constructor\n * if it fails to parse a string argument. Instead, it returns `Invalid Date`.\n *\n * @param {String} argument - the value to convert\n * @param {Object} [options] - an object with options.\n * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * const result = parseISO('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * const result = parseISO('+02014101', { additionalDigits: 1 })\n * //=> Fri Apr 11 2014 00:00:00\n */\n\nexport default function parseISO(argument, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var additionalDigits = options.additionalDigits == null ? 2 : toInteger(options.additionalDigits);\n\n if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {\n throw new RangeError('additionalDigits must be 0, 1 or 2');\n }\n\n if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {\n return new Date(NaN);\n }\n\n var dateStrings = splitDateString(argument);\n var date;\n\n if (dateStrings.date) {\n var parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n\n if (!date || isNaN(date.getTime())) {\n return new Date(NaN);\n }\n\n var timestamp = date.getTime();\n var time = 0;\n var offset;\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n\n if (isNaN(time)) {\n return new Date(NaN);\n }\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n\n if (isNaN(offset)) {\n return new Date(NaN);\n }\n } else {\n var dirtyDate = new Date(timestamp + time); // js parsed string assuming it's in UTC timezone\n // but we need it to be parsed in our timezone\n // so we use utc values to build date in our timezone.\n // Year values from 0 to 99 map to the years 1900 to 1999\n // so set year explicitly with setFullYear.\n\n var result = new Date(0);\n result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());\n result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());\n return result;\n }\n\n return new Date(timestamp + time + offset);\n}\nvar patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/\n};\nvar dateRegex = /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nvar timeRegex = /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nvar timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n\nfunction splitDateString(dateString) {\n var dateStrings = {};\n var array = dateString.split(patterns.dateTimeDelimiter);\n var timeString; // The regex match should only return at maximum two array elements.\n // [date], [time], or [date, time].\n\n if (array.length > 2) {\n return dateStrings;\n }\n\n if (/:/.test(array[0])) {\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(dateStrings.date.length, dateString.length);\n }\n }\n\n if (timeString) {\n var token = patterns.timezone.exec(timeString);\n\n if (token) {\n dateStrings.time = timeString.replace(token[1], '');\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n\n return dateStrings;\n}\n\nfunction parseYear(dateString, additionalDigits) {\n var regex = new RegExp('^(?:(\\\\d{4}|[+-]\\\\d{' + (4 + additionalDigits) + '})|(\\\\d{2}|[+-]\\\\d{' + (2 + additionalDigits) + '})$)');\n var captures = dateString.match(regex); // Invalid ISO-formatted year\n\n if (!captures) return {\n year: NaN,\n restDateString: ''\n };\n var year = captures[1] ? parseInt(captures[1]) : null;\n var century = captures[2] ? parseInt(captures[2]) : null; // either year or century is null, not both\n\n return {\n year: century === null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length)\n };\n}\n\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) return new Date(NaN);\n var captures = dateString.match(dateRegex); // Invalid ISO-formatted string\n\n if (!captures) return new Date(NaN);\n var isWeekDate = !!captures[4];\n var dayOfYear = parseDateUnit(captures[1]);\n var month = parseDateUnit(captures[2]) - 1;\n var day = parseDateUnit(captures[3]);\n var week = parseDateUnit(captures[4]);\n var dayOfWeek = parseDateUnit(captures[5]) - 1;\n\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n var date = new Date(0);\n\n if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {\n return new Date(NaN);\n }\n\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\n\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\n\nfunction parseTime(timeString) {\n var captures = timeString.match(timeRegex);\n if (!captures) return NaN; // Invalid ISO-formatted time\n\n var hours = parseTimeUnit(captures[1]);\n var minutes = parseTimeUnit(captures[2]);\n var seconds = parseTimeUnit(captures[3]);\n\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n\n return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;\n}\n\nfunction parseTimeUnit(value) {\n return value && parseFloat(value.replace(',', '.')) || 0;\n}\n\nfunction parseTimezone(timezoneString) {\n if (timezoneString === 'Z') return 0;\n var captures = timezoneString.match(timezoneRegex);\n if (!captures) return 0;\n var sign = captures[1] === '+' ? -1 : 1;\n var hours = parseInt(captures[2]);\n var minutes = captures[3] && parseInt(captures[3]) || 0;\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);\n}\n\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n var date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n var fourthOfJanuaryDay = date.getUTCDay() || 7;\n var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n} // Validation functions\n// February is null to handle the leap year (using ||)\n\n\nvar daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n\nfunction validateDate(year, month, date) {\n return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));\n}\n\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\n}\n\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\n\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n\n return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;\n}\n\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}","'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\";\nfunction CheckBadgeIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(CheckBadgeIcon);\nexport default ForwardRef;","import React, { useMemo, useState, useReducer, useCallback, useEffect, useRef, useContext, useLayoutEffect, forwardRef, useImperativeHandle, Children } from 'react';\nimport { createPortal } from 'react-dom';\nimport isDeepEqual from 'fast-deep-equal';\n\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nfunction _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\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 MAPS_API_BASE_URL = 'https://maps.googleapis.com/maps/api/js';\n/**\n * A GoogleMapsApiLoader to reliably load and unload the Google Maps JavaScript API.\n *\n * The actual loading and unloading is delayed into the microtask queue, to\n * allow using the API in an useEffect hook, without worrying about multiple API loads.\n */\nclass GoogleMapsApiLoader {\n /**\n * Loads the Maps JavaScript API with the specified parameters.\n * Since the Maps library can only be loaded once per page, this will\n * produce a warning when called multiple times with different\n * parameters.\n *\n * The returned promise resolves when loading completes\n * and rejects in case of an error or when the loading was aborted.\n */\n static async load(params, onLoadingStatusChange) {\n var _window$google;\n const libraries = params.libraries ? params.libraries.split(',') : [];\n const serializedParams = this.serializeParams(params);\n this.listeners.push(onLoadingStatusChange);\n // Note: if `google.maps.importLibrary` has been defined externally, we\n // assume that loading is complete and successful.\n // If it was defined by a previous call to this method, a warning\n // message is logged if there are differences in api-parameters used\n // for both calls.\n if ((_window$google = window.google) != null && (_window$google = _window$google.maps) != null && _window$google.importLibrary) {\n // no serialized parameters means it was loaded externally\n if (!this.serializedApiParams) {\n this.loadingStatus = APILoadingStatus.LOADED;\n }\n this.notifyLoadingStatusListeners();\n } else {\n this.serializedApiParams = serializedParams;\n this.initImportLibrary(params);\n }\n if (this.serializedApiParams && this.serializedApiParams !== serializedParams) {\n console.warn(`[google-maps-api-loader] The maps API has already been loaded ` + `with different parameters and will not be loaded again. Refresh the ` + `page for new values to have effect.`);\n }\n const librariesToLoad = ['maps', ...libraries];\n await Promise.all(librariesToLoad.map(name => google.maps.importLibrary(name)));\n }\n /**\n * Serialize the paramters used to load the library for easier comparison.\n */\n static serializeParams(params) {\n return [params.v, params.key, params.language, params.region, params.authReferrerPolicy, params.solutionChannel].join('/');\n }\n /**\n * Creates the global `google.maps.importLibrary` function for bootstrapping.\n * This is essentially a formatted version of the dynamic loading script\n * from the official documentation with some minor adjustments.\n *\n * The created importLibrary function will load the Google Maps JavaScript API,\n * which will then replace the `google.maps.importLibrary` function with the full\n * implementation.\n *\n * @see https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import\n */\n static initImportLibrary(params) {\n if (!window.google) window.google = {};\n if (!window.google.maps) window.google.maps = {};\n if (window.google.maps['importLibrary']) {\n console.error('[google-maps-api-loader-internal]: initImportLibrary must only be called once');\n return;\n }\n let apiPromise = null;\n const loadApi = () => {\n if (apiPromise) return apiPromise;\n apiPromise = new Promise((resolve, reject) => {\n var _document$querySelect;\n const scriptElement = document.createElement('script');\n const urlParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n const urlParamName = key.replace(/[A-Z]/g, t => '_' + t[0].toLowerCase());\n urlParams.set(urlParamName, String(value));\n }\n urlParams.set('loading', 'async');\n urlParams.set('callback', '__googleMapsCallback__');\n scriptElement.async = true;\n scriptElement.src = MAPS_API_BASE_URL + `?` + urlParams.toString();\n scriptElement.nonce = ((_document$querySelect = document.querySelector('script[nonce]')) == null ? void 0 : _document$querySelect.nonce) || '';\n scriptElement.onerror = () => {\n this.loadingStatus = APILoadingStatus.FAILED;\n this.notifyLoadingStatusListeners();\n reject(new Error('The Google Maps JavaScript API could not load.'));\n };\n window.__googleMapsCallback__ = () => {\n this.loadingStatus = APILoadingStatus.LOADED;\n this.notifyLoadingStatusListeners();\n resolve();\n };\n window.gm_authFailure = () => {\n this.loadingStatus = APILoadingStatus.AUTH_FAILURE;\n this.notifyLoadingStatusListeners();\n };\n this.loadingStatus = APILoadingStatus.LOADING;\n this.notifyLoadingStatusListeners();\n document.head.append(scriptElement);\n });\n return apiPromise;\n };\n // for the first load, we declare an importLibrary function that will\n // be overwritten once the api is loaded.\n google.maps.importLibrary = libraryName => loadApi().then(() => google.maps.importLibrary(libraryName));\n }\n /**\n * Calls all registered loadingStatusListeners after a status update.\n */\n static notifyLoadingStatusListeners() {\n for (const fn of this.listeners) {\n fn(this.loadingStatus);\n }\n }\n}\n/**\n * The current loadingStatus of the API.\n */\nGoogleMapsApiLoader.loadingStatus = APILoadingStatus.NOT_LOADED;\n/**\n * The parameters used for first loading the API.\n */\nGoogleMapsApiLoader.serializedApiParams = void 0;\n/**\n * A list of functions to be notified when the loading status changes.\n */\nGoogleMapsApiLoader.listeners = [];\n\nconst _excluded$3 = [\"onLoad\", \"onError\", \"apiKey\", \"version\", \"libraries\"],\n _excluded2$1 = [\"children\"];\nconst DEFAULT_SOLUTION_CHANNEL = 'GMP_visgl_rgmlibrary_v1_default';\nconst APIProviderContext = React.createContext(null);\n/**\n * local hook to set up the map-instance management context.\n */\nfunction useMapInstances() {\n const [mapInstances, setMapInstances] = useState({});\n const addMapInstance = (mapInstance, id = 'default') => {\n setMapInstances(instances => _extends({}, instances, {\n [id]: mapInstance\n }));\n };\n const removeMapInstance = (id = 'default') => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setMapInstances(_ref => {\n let remaining = _objectWithoutPropertiesLoose(_ref, [id].map(_toPropertyKey));\n return remaining;\n });\n };\n const clearMapInstances = () => {\n setMapInstances({});\n };\n return {\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances\n };\n}\n/**\n * local hook to handle the loading of the maps API, returns the current loading status\n * @param props\n */\nfunction useGoogleMapsApiLoader(props) {\n const {\n onLoad,\n onError,\n apiKey,\n version,\n libraries = []\n } = props,\n otherApiParams = _objectWithoutPropertiesLoose(props, _excluded$3);\n const [status, setStatus] = useState(GoogleMapsApiLoader.loadingStatus);\n const [loadedLibraries, addLoadedLibrary] = useReducer((loadedLibraries, action) => {\n return loadedLibraries[action.name] ? loadedLibraries : _extends({}, loadedLibraries, {\n [action.name]: action.value\n });\n }, {});\n const librariesString = useMemo(() => libraries == null ? void 0 : libraries.join(','), [libraries]);\n const serializedParams = useMemo(() => JSON.stringify(_extends({\n apiKey,\n version\n }, otherApiParams)), [apiKey, version, otherApiParams]);\n const importLibrary = useCallback(async name => {\n var _google;\n if (loadedLibraries[name]) {\n return loadedLibraries[name];\n }\n if (!((_google = google) != null && (_google = _google.maps) != null && _google.importLibrary)) {\n throw new Error('[api-provider-internal] importLibrary was called before ' + 'google.maps.importLibrary was defined.');\n }\n const res = await window.google.maps.importLibrary(name);\n addLoadedLibrary({\n name,\n value: res\n });\n return res;\n }, [loadedLibraries]);\n useEffect(() => {\n (async () => {\n try {\n const params = _extends({\n key: apiKey\n }, otherApiParams);\n if (version) params.v = version;\n if ((librariesString == null ? void 0 : librariesString.length) > 0) params.libraries = librariesString;\n if (params.channel === undefined || params.channel < 0 || params.channel > 999) delete params.channel;\n if (params.solutionChannel === undefined) params.solutionChannel = DEFAULT_SOLUTION_CHANNEL;else if (params.solutionChannel === '') delete params.solutionChannel;\n await GoogleMapsApiLoader.load(params, status => setStatus(status));\n for (const name of ['core', 'maps', ...libraries]) {\n await importLibrary(name);\n }\n if (onLoad) {\n onLoad();\n }\n } catch (error) {\n if (onError) {\n onError(error);\n } else {\n console.error('<ApiProvider> failed to load the Google Maps JavaScript API', error);\n }\n }\n })();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [apiKey, librariesString, serializedParams]);\n return {\n status,\n loadedLibraries,\n importLibrary\n };\n}\n/**\n * Component to wrap the components from this library and load the Google Maps JavaScript API\n */\nconst APIProvider = props => {\n const {\n children\n } = props,\n loaderProps = _objectWithoutPropertiesLoose(props, _excluded2$1);\n const {\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances\n } = useMapInstances();\n const {\n status,\n loadedLibraries,\n importLibrary\n } = useGoogleMapsApiLoader(loaderProps);\n const contextValue = useMemo(() => ({\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances,\n status,\n loadedLibraries,\n importLibrary\n }), [mapInstances, addMapInstance, removeMapInstance, clearMapInstances, status, loadedLibraries, importLibrary]);\n return /*#__PURE__*/React.createElement(APIProviderContext.Provider, {\n value: contextValue\n }, children);\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) return;\n if (!handler) 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 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 ' + 'returned undefined. This is not expected to happen. Please ' + 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n camEvent.detail = {\n center: (center == null ? void 0 : center.toJSON()) || {\n lat: 0,\n lng: 0\n },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt,\n bounds: (bounds == null ? void 0 : bounds.toJSON()) || {\n north: 90,\n east: 180,\n south: -90,\n west: -180\n }\n };\n return camEvent;\n } else if (mouseEventTypes.includes(type)) {\n var _srcEvent$latLng;\n if (!srcEvent) 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: ((_srcEvent$latLng = srcEvent.latLng) == null ? void 0 : _srcEvent$latLng.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 = ['bounds_changed', 'center_changed', 'heading_changed', 'tilt_changed', 'zoom_changed'];\nconst mouseEventTypes = ['click', 'contextmenu', 'dblclick', 'mousemove', 'mouseout', 'mouseover'];\nconst eventPropNames = Object.keys(propNameToEventType);\n\nfunction useDeepCompareEffect(effect, deps) {\n const ref = useRef(undefined);\n if (!ref.current || !isDeepEqual(deps, ref.current)) {\n ref.current = deps;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(effect, ref.current);\n}\n\nconst mapOptionKeys = new Set(['backgroundColor', 'clickableIcons', 'controlSize', 'disableDefaultUI', 'disableDoubleClickZoom', 'draggable', 'draggableCursor', 'draggingCursor', 'fullscreenControl', 'fullscreenControlOptions', 'gestureHandling', 'headingInteractionEnabled', 'isFractionalZoomEnabled', 'keyboardShortcuts', 'mapTypeControl', 'mapTypeControlOptions', 'mapTypeId', 'maxZoom', 'minZoom', 'noClear', 'panControl', 'panControlOptions', 'restriction', 'rotateControl', 'rotateControlOptions', 'scaleControl', 'scaleControlOptions', 'scrollwheel', 'streetView', 'streetViewControl', 'streetViewControlOptions', 'styles', 'tiltInteractionEnabled', 'zoomControl', 'zoomControlOptions']);\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)) 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) return;\n map.setOptions(mapOptions);\n }, [mapOptions]);\n /* eslint-enable react-hooks/exhaustive-deps */\n}\n\nfunction useApiLoadingStatus() {\n var _useContext;\n return ((_useContext = useContext(APIProviderContext)) == null ? void 0 : _useContext.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 {\n viewport,\n viewState\n } = props;\n const isDeckGlControlled = !!viewport;\n useLayoutEffect(() => {\n if (!map || !viewState) return;\n const {\n latitude,\n longitude,\n bearing: heading,\n pitch: tilt,\n zoom\n } = viewState;\n map.moveCamera({\n center: {\n lat: latitude,\n lng: longitude\n },\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') return false;\n if (!('lat' in obj && 'lng' in obj)) return false;\n return Number.isFinite(obj.lat) && Number.isFinite(obj.lng);\n}\nfunction latLngEquals(a, b) {\n if (!a || !b) return false;\n const A = toLatLngLiteral(a);\n const B = toLatLngLiteral(b);\n if (A.lat !== B.lat || A.lng !== B.lng) return false;\n return true;\n}\nfunction toLatLngLiteral(obj) {\n if (isLatLngLiteral(obj)) return obj;\n return obj.toJSON();\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) ? mapProps.zoom : null;\n const heading = Number.isFinite(mapProps.heading) ? mapProps.heading : null;\n const tilt = Number.isFinite(mapProps.tilt) ? mapProps.tilt : 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(() => {\n if (!map) return;\n const nextCamera = {};\n let needsUpdate = false;\n if (lat !== null && lng !== null && (cameraStateRef.current.center.lat !== lat || cameraStateRef.current.center.lng !== lng)) {\n nextCamera.center = {\n lat,\n lng\n };\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 /*#__PURE__*/React.createElement(\"div\", {\n style: style\n }, /*#__PURE__*/React.createElement(\"h2\", null, \"Error: AuthFailure\"), /*#__PURE__*/React.createElement(\"p\", null, \"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the \", /*#__PURE__*/React.createElement(\"code\", null, \"APIProvider.apiKey\"), \" 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 ' + 'returned undefined. This is not expected to happen. Please ' + '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 ? void 0 : center.toJSON()) || {\n lat: 0,\n lng: 0\n },\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({\n center: {\n lat: 0,\n lng: 0\n },\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) 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\nconst _excluded$2 = [\"id\", \"defaultBounds\", \"defaultCenter\", \"defaultZoom\", \"defaultHeading\", \"defaultTilt\", \"reuseMaps\", \"renderingType\", \"colorScheme\"],\n _excluded2 = [\"padding\"];\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 the mapId (as all other parameters can be changed at\n * 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]) return null;\n return this.entries[key].pop() || null;\n }\n static push(key, value) {\n if (!this.entries[key]) this.entries[key] = [];\n this.entries[key].push(value);\n }\n}\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 */\nCachedMapStack.entries = {};\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 {\n id,\n defaultBounds,\n defaultCenter,\n defaultZoom,\n defaultHeading,\n defaultTilt,\n reuseMaps,\n renderingType,\n colorScheme\n } = props,\n mapOptions = _objectWithoutPropertiesLoose(props, _excluded$2);\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. ' + 'You have to provide zoom and center (via the `zoom`/`defaultZoom` and ' + '`center`/`defaultCenter` props) or specify the region to show using ' + '`defaultBounds`. See ' + '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) mapOptions.center = defaultCenter;\n if (!mapOptions.zoom && Number.isFinite(defaultZoom)) mapOptions.zoom = defaultZoom;\n if (!mapOptions.heading && Number.isFinite(defaultHeading)) mapOptions.heading = defaultHeading;\n if (!mapOptions.tilt && Number.isFinite(defaultTilt)) mapOptions.tilt = defaultTilt;\n for (const key of Object.keys(mapOptions)) if (mapOptions[key] === undefined) delete mapOptions[key];\n const savedMapStateRef = useRef(undefined);\n // create the map instance and register it in the context\n useEffect(() => {\n if (!container || !apiIsLoaded) return;\n const {\n addMapInstance,\n removeMapInstance\n } = context;\n // note: colorScheme (upcoming feature) isn't yet in the typings, remove once that is fixed:\n const {\n mapId\n } = 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 lets the map fall back to its default\n // size, setting the center will trigger reloading the map.\n setTimeout(() => map.setCenter(map.getCenter()), 0);\n } else {\n mapDiv = document.createElement('div');\n mapDiv.style.height = '100%';\n container.appendChild(mapDiv);\n map = new google.maps.Map(mapDiv, _extends({}, mapOptions, renderingType ? {\n renderingType: renderingType\n } : {}, colorScheme ? {\n colorScheme: colorScheme\n } : {}));\n }\n setMap(map);\n addMapInstance(map, id);\n if (defaultBounds) {\n const {\n padding\n } = defaultBounds,\n defBounds = _objectWithoutPropertiesLoose(defaultBounds, _excluded2);\n map.fitBounds(defBounds, padding);\n }\n // prevent map not rendering due to missing configuration\n else if (!hasZoom || !hasCenter) {\n map.fitBounds({\n east: 180,\n west: -180,\n south: -90,\n north: 90\n });\n }\n // the savedMapState is used to restore the camera parameters when the mapId is changed\n if (savedMapStateRef.current) {\n const {\n mapId: savedMapId,\n cameraState: savedCameraState\n } = savedMapStateRef.current;\n if (savedMapId !== mapId) {\n map.setOptions(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 } 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 [container, apiIsLoaded, id,\n // these props can't be changed after initialization and require a new\n // instance to be created\n props.mapId, props.renderingType, props.colorScheme]);\n return [map, containerRef, cameraStateRef];\n}\n\nconst GoogleMapsContext = React.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 {\n children,\n id,\n className,\n style\n } = 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) 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({\n disableDefaultUI: true\n });\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 }, [map, isDeckGlControlled, isControlledExternally, props.gestureHandling, props.keyboardShortcuts]);\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 _lat, _lng, _props$zoom, _props$heading, _props$tilt;\n return {\n center: {\n lat: (_lat = lat) != null ? _lat : 0,\n lng: (_lng = lng) != null ? _lng : 0\n },\n zoom: (_props$zoom = props.zoom) != null ? _props$zoom : 0,\n heading: (_props$heading = props.heading) != null ? _props$heading : 0,\n tilt: (_props$tilt = props.tilt) != null ? _props$tilt : 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(() => {\n if (!map || !isControlledExternally) 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(() => _extends({\n width: '100%',\n height: '100%',\n position: 'relative',\n // when using deckgl, the map should be sent to the back\n zIndex: isDeckGlControlled ? -1 : 0\n }, style), [style, isDeckGlControlled]);\n const contextValue = useMemo(() => ({\n map\n }), [map]);\n if (loadingStatus === APILoadingStatus.AUTH_FAILURE) {\n return /*#__PURE__*/React.createElement(\"div\", {\n style: _extends({\n position: 'relative'\n }, className ? {} : combinedStyle),\n className: className\n }, /*#__PURE__*/React.createElement(AuthFailureMessage, null));\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: mapRef,\n \"data-testid\": 'map',\n style: className ? undefined : combinedStyle,\n className: className\n }, id ? {\n id\n } : {}), map ? /*#__PURE__*/React.createElement(GoogleMapsContext.Provider, {\n value: contextValue\n }, 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 {\n map\n } = useContext(GoogleMapsContext) || {};\n if (ctx === null) {\n logErrorOnce('useMap(): failed to retrieve APIProviderContext. ' + 'Make sure that the <APIProvider> component exists and that the ' + 'component you are calling `useMap()` from is a sibling of the ' + '<APIProvider>.');\n return null;\n }\n const {\n mapInstances\n } = ctx;\n // if an id is specified, the corresponding map or null is returned\n if (id !== null) return mapInstances[id] || null;\n // otherwise, return the closest ancestor\n if (map) 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) 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 ? void 0 : ctx.loadedLibraries[name]) || null;\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Internally used to bind events to Maps JavaScript API objects.\n * @internal\n */\nfunction useMapsEventListener(target, name, callback) {\n useEffect(() => {\n if (!target || !name || !callback) return;\n const listener = google.maps.event.addListener(target, name, callback);\n return () => listener.remove();\n }, [target, name, callback]);\n}\n\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) return;\n object[prop] = value;\n }, [object, prop, value]);\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Internally used to bind events to DOM nodes.\n * @internal\n */\nfunction useDomEventListener(target, name, callback) {\n useEffect(() => {\n if (!target || !name || !callback) return;\n target.addEventListener(name, callback);\n return () => target.removeEventListener(name, callback);\n }, [target, name, callback]);\n}\n\n/* eslint-disable complexity */\nfunction isAdvancedMarker(marker) {\n return marker.content !== undefined;\n}\nfunction isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE;\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.createContext(null);\n// [xPosition, yPosition] when the top left corner is [0, 0]\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 MarkerContent = ({\n children,\n styles,\n className,\n anchorPoint\n}) => {\n const [xTranslation, yTranslation] = anchorPoint != null ? anchorPoint : AdvancedMarkerAnchorPoint['BOTTOM'];\n // The \"translate(50%, 100%)\" is here to counter and reset the default anchoring of the advanced marker element\n // that comes from the api\n const transformStyle = `translate(50%, 100%) translate(-${xTranslation}, -${yTranslation})`;\n return (\n /*#__PURE__*/\n // anchoring container\n React.createElement(\"div\", {\n style: {\n transform: transformStyle\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: styles\n }, children))\n );\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 {\n children,\n onClick,\n className,\n onMouseEnter,\n onMouseLeave,\n onDrag,\n onDragStart,\n onDragEnd,\n collisionBehavior,\n clickable,\n draggable,\n position,\n title,\n zIndex\n } = 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) 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 // We need some kind of flag to identify the custom marker content\n // in the infowindow component. Choosing a custom property instead of a className\n // to not encourage users to style the marker content directly.\n contentElement.isCustomMarker = true;\n newMarker.content = contentElement;\n setContentContainer(contentElement);\n }\n return () => {\n var _contentElement;\n newMarker.map = null;\n (_contentElement = contentElement) == null || _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 || !marker.content || numChildren > 0) return;\n marker.content.className = className || '';\n }, [marker, className, numChildren]);\n // copy other props\n usePropBinding(marker, 'position', position);\n usePropBinding(marker, 'title', title != null ? 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) return;\n if (draggable !== undefined) marker.gmpDraggable = draggable;else if (onDrag || onDragStart || onDragEnd) marker.gmpDraggable = true;else 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) return;\n const gmpClickable = clickable !== undefined || 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.content && isElementNode(marker.content)) {\n marker.content.style.pointerEvents = 'none';\n if (marker.content.firstElementChild) {\n marker.content.firstElementChild.style.pointerEvents = 'all';\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 ? void 0 : marker.element, 'mouseenter', onMouseEnter);\n useDomEventListener(marker == null ? void 0 : marker.element, 'mouseleave', onMouseLeave);\n return [marker, contentContainer];\n}\nconst AdvancedMarker = forwardRef((props, ref) => {\n const {\n children,\n style,\n className,\n anchorPoint\n } = props;\n const [marker, contentContainer] = useAdvancedMarker(props);\n const advancedMarkerContextValue = useMemo(() => marker ? {\n marker\n } : null, [marker]);\n useImperativeHandle(ref, () => marker, [marker]);\n if (!contentContainer) return null;\n return /*#__PURE__*/React.createElement(AdvancedMarkerContext.Provider, {\n value: advancedMarkerContextValue\n }, createPortal(/*#__PURE__*/React.createElement(MarkerContent, {\n anchorPoint: anchorPoint,\n styles: style,\n className: className\n }, children), contentContainer));\n});\nfunction useAdvancedMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback(m => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\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, ' + \"not a string. For example, style={{marginRight: spacing + 'em'}} when \" + 'using JSX.');\n }\n const elementStyle = element.style;\n // without `prevStyles`, just set all values\n if (prevStyles == null) {\n if (styles == null) return;\n for (const styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) 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) && (styles == null || !styles.hasOwnProperty(styleName))) {\n // Clear style\n const isCustomProperty = styleName.indexOf('--') === 0;\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n } else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n } else {\n elementStyle[styleName] = '';\n }\n }\n }\n // only assign values from `styles` that are different from `prevStyles`\n if (styles == null) return;\n for (const styleName in styles) {\n const value = styles[styleName];\n if (styles.hasOwnProperty(styleName) && 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 } else if (styleName === 'float') {\n elementStyle.cssFloat = '';\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' && value !== 0 && !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 } 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(['animationIterationCount', 'aspectRatio', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'columns', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'gridArea', 'gridRow', 'gridRowEnd', 'gridRowSpan', 'gridRowStart', 'gridColumn', 'gridColumnEnd', 'gridColumnSpan', 'gridColumnStart', 'fontWeight', 'lineClamp', 'lineHeight', 'opacity', 'order', 'orphans', 'scale', 'tabSize', 'widows', 'zIndex', 'zoom', 'fillOpacity',\n// SVG-related properties\n'floodOpacity', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth']);\nfunction isUnitlessNumber(name) {\n return unitlessNumbers.has(name);\n}\n\nconst _excluded$1 = [\"children\", \"headerContent\", \"style\", \"className\", \"pixelOffset\", \"anchor\", \"shouldFocus\", \"onClose\", \"onCloseClick\"];\n/**\n * Component to render an Info Window with the Maps JavaScript API\n */\nconst InfoWindow = props => {\n const {\n // content options\n children,\n headerContent,\n style,\n className,\n pixelOffset,\n // open options\n anchor,\n shouldFocus,\n // events\n onClose,\n onCloseClick\n // other options\n } = props,\n infoWindowOptions = _objectWithoutPropertiesLoose(props, _excluded$1);\n // ## create infowindow instance once the mapsLibrary is available.\n const mapsLibrary = useMapsLibrary('maps');\n const [infoWindow, setInfoWindow] = useState(null);\n const contentContainerRef = useRef(null);\n const headerContainerRef = useRef(null);\n useEffect(() => {\n if (!mapsLibrary) return;\n contentContainerRef.current = document.createElement('div');\n headerContainerRef.current = document.createElement('div');\n const opts = 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 = typeof headerContent === 'string' ? headerContent : headerContainerRef.current;\n }\n // intentionally shadowing the state variables here\n const infoWindow = new google.maps.InfoWindow(infoWindowOptions);\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 _contentContainerRef$, _headerContainerRef$c;\n infoWindow.setContent(null);\n (_contentContainerRef$ = contentContainerRef.current) == null || _contentContainerRef$.remove();\n (_headerContainerRef$c = headerContainerRef.current) == null || _headerContainerRef$c.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 // stores previously applied style properties, so they can be removed when unset\n const prevStyleRef = useRef(null);\n useEffect(() => {\n if (!infoWindow || !contentContainerRef.current) return;\n setValueForStyles(contentContainerRef.current, style || null, prevStyleRef.current);\n prevStyleRef.current = style || null;\n if (className !== contentContainerRef.current.className) contentContainerRef.current.className = className || '';\n }, [infoWindow, className, style]);\n // ## update options\n useDeepCompareEffect(() => {\n if (!infoWindow) return;\n const opts = infoWindowOptions;\n if (!pixelOffset) {\n opts.pixelOffset = null;\n } else {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (!headerContent) {\n opts.headerContent = null;\n } else {\n opts.headerContent = typeof headerContent === 'string' ? headerContent : headerContainerRef.current;\n }\n infoWindow.setOptions(infoWindowOptions);\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 useDeepCompareEffect(() => {\n // `anchor === null` means an anchor is defined but not ready yet.\n if (!map || !infoWindow || anchor === null) return;\n const isOpenedWithAnchor = !!anchor;\n const openOptions = {\n map\n };\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 wrapper = anchor.content;\n const wrapperBcr = wrapper == null ? void 0 : wrapper.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 any children.\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 (wrapperBcr && wrapper != null && wrapper.isCustomMarker) {\n var _anchor$content$first;\n // We can safely typecast here since we control that element and we know that\n // it is a div\n const anchorDomContent = (_anchor$content$first = anchor.content.firstElementChild) == null ? void 0 : _anchor$content$first.firstElementChild;\n const contentBcr = anchorDomContent == null ? void 0 : anchorDomContent.getBoundingClientRect();\n // center infowindow above marker\n const anchorOffsetX = contentBcr.x - wrapperBcr.x + (contentBcr.width - wrapperBcr.width) / 2;\n const anchorOffsetY = contentBcr.y - wrapperBcr.y;\n const opts = 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) infoWindow.set('anchor', null);\n infoWindow.close();\n };\n }, [infoWindow, anchor, map, shouldFocus, infoWindowOptions, pixelOffset]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, contentContainerRef.current && createPortal(children, contentContainerRef.current), headerContainerRef.current !== null && createPortal(headerContent, headerContainerRef.current));\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' ? location : `${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 ? void 0 : markers.reduce((styles, marker) => {\n const {\n color = 'red',\n label,\n size,\n scale,\n icon,\n anchor\n } = 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 : {}).forEach(markers => {\n let markerParam = '';\n const {\n icon\n } = 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 ? ['icon', 'anchor', 'scale'] : ['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' ? marker.location : `${marker.location.lat},${marker.location.lng}`;\n markerParam += `|${location}`;\n }\n markerParams.push(markerParam);\n });\n return markerParams.map(formatParam);\n}\n\n/**\n * Assembles path parameters for the Static Maps Api from an array of paths.\n *\n * This function groups paths by their style properties (color, weight, fillcolor, geodesic)\n * and then constructs a string of path parameters for each group. 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 * 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: [\n * 'color:red|weight:5|40.714728,-73.998672|40.718217,-73.998284'\n * ]\n */\nfunction assemblePathParams(paths = []) {\n const pathParams = [];\n // Group paths by their style properties (color, weight, fillcolor, geodesic)\n // to combine paths with identical styles into single parameter strings\n const pathsByStyle = paths == null ? void 0 : paths.reduce((styles, path) => {\n const {\n color = 'default',\n weight,\n fillcolor,\n geodesic\n } = path;\n // Create unique key for this style combination\n const key = [color, weight, fillcolor, geodesic].filter(Boolean).join('-');\n styles[key] = styles[key] || [];\n styles[key].push(path);\n return styles;\n }, {});\n // Process each group of paths with identical styles\n Object.values(pathsByStyle != null ? pathsByStyle : {}).forEach(paths => {\n let pathParam = '';\n // Build style parameter string using properties from first path in group\n // since all paths in this group share the same style\n Object.entries(paths[0]).forEach(([key, value]) => {\n if (['color', 'weight', 'fillcolor', 'geodesic'].includes(key)) {\n pathParam += `|${key}:${value}`;\n }\n });\n // Add location for all marker in style group\n for (const path of paths) {\n if (typeof path.coordinates === 'string') {\n pathParam += `|${decodeURIComponent(path.coordinates)}`;\n } else {\n for (const location of path.coordinates) {\n pathParam += `|${formatLocation(location)}`;\n }\n }\n }\n pathParams.push(pathParam);\n });\n return pathParams.map(formatParam);\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.map(mapTypeStyle => {\n const {\n featureType,\n elementType,\n stylers = []\n } = 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 }).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({\n apiKey,\n width,\n height,\n center,\n zoom,\n scale,\n format,\n mapType,\n language,\n region,\n mapId,\n markers = [],\n paths = [],\n visible = [],\n style = []\n}) {\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 = _extends({\n key: apiKey,\n size: `${width}x${height}`\n }, center && {\n center: formatLocation(center)\n }, zoom && {\n zoom\n }, scale && {\n scale\n }, format && {\n format\n }, mapType && {\n maptype: mapType\n }, language && {\n language\n }, region && {\n region\n }, mapId && {\n map_id: mapId\n });\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 {\n url,\n className\n } = props;\n if (!url) throw new Error('URL is required');\n return /*#__PURE__*/React.createElement(\"img\", {\n className: className,\n src: url,\n width: \"100%\"\n });\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 = ({\n children,\n position\n}) => {\n const controlContainer = useMemo(() => document.createElement('div'), []);\n const map = useMap();\n useEffect(() => {\n if (!map) 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) return;\n const index = controlsArray.indexOf(controlContainer);\n controls.removeAt(index);\n };\n }, [controlContainer, map, position]);\n return createPortal(children, controlContainer);\n};\n\nconst _excluded = [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\"];\nfunction useMarker(props) {\n const [marker, setMarker] = useState(null);\n const map = useMap();\n const {\n onClick,\n onDrag,\n onDragStart,\n onDragEnd,\n onMouseOver,\n onMouseOut\n } = props,\n markerOptions = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n position,\n draggable\n } = markerOptions;\n // create marker instance and add to the map once the map is available\n useEffect(() => {\n if (!map) {\n if (map === undefined) 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) return;\n const m = marker;\n // Add event listeners\n const gme = google.maps.event;\n if (onClick) gme.addListener(m, 'click', onClick);\n if (onDrag) gme.addListener(m, 'drag', onDrag);\n if (onDragStart) gme.addListener(m, 'dragstart', onDragStart);\n if (onDragEnd) gme.addListener(m, 'dragend', onDragEnd);\n if (onMouseOver) gme.addListener(m, 'mouseover', onMouseOver);\n if (onMouseOut) gme.addListener(m, 'mouseout', onMouseOut);\n marker.setDraggable(Boolean(draggable));\n return () => {\n gme.clearInstanceListeners(m);\n };\n }, [marker, draggable, onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut]);\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) return;\n if (markerOptions) 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) 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 /*#__PURE__*/React.createElement(React.Fragment, null);\n});\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 * Component to configure the appearance of an AdvancedMarker\n */\nconst Pin = props => {\n var _useContext;\n const advancedMarker = (_useContext = useContext(AdvancedMarkerContext)) == null ? void 0 : _useContext.marker;\n const glyphContainer = useMemo(() => document.createElement('div'), []);\n // Create Pin View instance\n useEffect(() => {\n var _advancedMarker$conte;\n if (!advancedMarker) {\n if (advancedMarker === undefined) {\n console.error('The <Pin> component can only be used inside <AdvancedMarker>.');\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 = _extends({}, 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) -> \"pointer events reset div\" -> \"anchor container\"\n const markerContent = (_advancedMarker$conte = advancedMarker.content) == null || (_advancedMarker$conte = _advancedMarker$conte.firstChild) == null ? void 0 : _advancedMarker$conte.firstChild;\n while (markerContent != null && markerContent.firstChild) {\n markerContent.removeChild(markerContent.firstChild);\n }\n if (markerContent) {\n markerContent.appendChild(pinElement.element);\n }\n }, [advancedMarker, glyphContainer, props]);\n return createPortal(props.children, glyphContainer);\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 = ({\n viewState\n}) => {\n const pitch = viewState.pitch;\n const gmZoom = viewState.zoom + 1;\n const maxTilt = getMapMaxTilt(gmZoom);\n return _extends({}, viewState, {\n fovy: 25,\n pitch: Math.min(maxTilt, pitch)\n });\n};\n\nexport { APILoadingStatus, APIProvider, APIProviderContext, AdvancedMarker, AdvancedMarkerAnchorPoint, AdvancedMarkerContext, CollisionBehavior, ColorScheme, ControlPosition, GoogleMapsContext, InfoWindow, Map, MapControl, Marker, Pin, RenderingType, StaticMap, createStaticMapsUrl, isAdvancedMarker, isLatLngLiteral, latLngEquals, limitTiltRange, toLatLngLiteral, useAdvancedMarkerRef, useApiIsLoaded, useApiLoadingStatus, useMap, useMapsLibrary, useMarkerRef };\n//# sourceMappingURL=index.modern.mjs.map\n","\n\nimport * as Caml_sys from \"./caml_sys.js\";\nimport * as Caml_format from \"./caml_format.js\";\nimport * as Caml_string from \"./caml_string.js\";\nimport * as Caml_exceptions from \"./caml_exceptions.js\";\nimport * as Caml_js_exceptions from \"./caml_js_exceptions.js\";\n\nvar JsxModules = {\n Jsx: undefined,\n JsxEvent: undefined,\n JsxDOM: undefined\n};\n\nfunction failwith(s) {\n throw {\n RE_EXN_ID: \"Failure\",\n _1: s,\n Error: new Error()\n };\n}\n\nfunction invalid_arg(s) {\n throw {\n RE_EXN_ID: \"Invalid_argument\",\n _1: s,\n Error: new Error()\n };\n}\n\nvar Exit = /* @__PURE__ */Caml_exceptions.create(\"PervasivesU.Exit\");\n\nfunction abs(x) {\n if (x >= 0) {\n return x;\n } else {\n return -x | 0;\n }\n}\n\nfunction lnot(x) {\n return x ^ -1;\n}\n\nvar min_int = -2147483648;\n\nfunction classify_float(x) {\n if (isFinite(x)) {\n if (Math.abs(x) >= 2.22507385850720138e-308) {\n return \"FP_normal\";\n } else if (x !== 0) {\n return \"FP_subnormal\";\n } else {\n return \"FP_zero\";\n }\n } else if (isNaN(x)) {\n return \"FP_nan\";\n } else {\n return \"FP_infinite\";\n }\n}\n\nfunction char_of_int(n) {\n if (n < 0 || n > 255) {\n throw {\n RE_EXN_ID: \"Invalid_argument\",\n _1: \"char_of_int\",\n Error: new Error()\n };\n }\n return n;\n}\n\nfunction string_of_bool(b) {\n if (b) {\n return \"true\";\n } else {\n return \"false\";\n }\n}\n\nfunction bool_of_string(param) {\n switch (param) {\n case \"false\" :\n return false;\n case \"true\" :\n return true;\n default:\n throw {\n RE_EXN_ID: \"Invalid_argument\",\n _1: \"bool_of_string\",\n Error: new Error()\n };\n }\n}\n\nfunction bool_of_string_opt(param) {\n switch (param) {\n case \"false\" :\n return false;\n case \"true\" :\n return true;\n default:\n return ;\n }\n}\n\nfunction int_of_string_opt(s) {\n try {\n return Caml_format.int_of_string(s);\n }\n catch (raw_exn){\n var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);\n if (exn.RE_EXN_ID === \"Failure\") {\n return ;\n }\n throw exn;\n }\n}\n\nfunction valid_float_lexem(s) {\n var l = s.length;\n var _i = 0;\n while(true) {\n var i = _i;\n if (i >= l) {\n return s + \".\";\n }\n var match = Caml_string.get(s, i);\n if (match >= 48) {\n if (match >= 58) {\n return s;\n }\n _i = i + 1 | 0;\n continue ;\n }\n if (match !== 45) {\n return s;\n }\n _i = i + 1 | 0;\n continue ;\n };\n}\n\nfunction string_of_float(f) {\n return valid_float_lexem(Caml_format.format_float(\"%.12g\", f));\n}\n\nfunction float_of_string_opt(s) {\n try {\n return Caml_format.float_of_string(s);\n }\n catch (raw_exn){\n var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);\n if (exn.RE_EXN_ID === \"Failure\") {\n return ;\n }\n throw exn;\n }\n}\n\nfunction $at(l1, l2) {\n if (l1) {\n return {\n hd: l1.hd,\n tl: $at(l1.tl, l2)\n };\n } else {\n return l2;\n }\n}\n\nfunction print_newline() {\n console.log(\"\");\n}\n\nfunction prerr_newline() {\n console.error(\"\");\n}\n\nfunction print_int(i) {\n console.log(String(i));\n}\n\nfunction print_float(i) {\n console.log(string_of_float(i));\n}\n\nfunction print_string(prim) {\n console.log(prim);\n}\n\nvar exit_function = {\n contents: (function (prim) {\n \n })\n};\n\nfunction at_exit(f) {\n var g = exit_function.contents;\n exit_function.contents = (function () {\n f();\n g();\n });\n}\n\nfunction exit(retcode) {\n exit_function.contents();\n return Caml_sys.sys_exit(retcode);\n}\n\nvar Jsx;\n\nvar JsxEvent;\n\nvar JsxDOM;\n\nvar JsxPPXReactSupport;\n\nvar max_int = 2147483647;\n\nvar infinity = Infinity;\n\nvar neg_infinity = -Infinity;\n\nvar max_float = 1.79769313486231571e+308;\n\nvar min_float = 2.22507385850720138e-308;\n\nvar epsilon_float = 2.22044604925031308e-16;\n\nexport {\n Jsx ,\n JsxEvent ,\n JsxDOM ,\n JsxPPXReactSupport ,\n JsxModules ,\n invalid_arg ,\n failwith ,\n Exit ,\n abs ,\n max_int ,\n min_int ,\n lnot ,\n infinity ,\n neg_infinity ,\n max_float ,\n min_float ,\n epsilon_float ,\n classify_float ,\n char_of_int ,\n string_of_bool ,\n bool_of_string ,\n bool_of_string_opt ,\n int_of_string_opt ,\n string_of_float ,\n float_of_string_opt ,\n $at ,\n print_string ,\n print_int ,\n print_float ,\n print_newline ,\n prerr_newline ,\n exit ,\n at_exit ,\n valid_float_lexem ,\n}\n/* No side effect */\n"],"names":["ARRAY_TYPES","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","KDBush","from","data","ArrayBuffer","Error","magic","versionAndType","version","ArrayType","nodeSize","numItems","constructor","isNaN","this","Math","min","max","IndexArrayType","arrayTypeIndex","indexOf","coordsByteSize","BYTES_PER_ELEMENT","idsByteSize","padCoords","ids","coords","_pos","_finished","set","add","x","y","index","finish","numAdded","sort","range","minX","minY","maxX","maxY","stack","length","result","axis","pop","right","left","i","push","m","within","qx","qy","r","r2","sqDist","k","n","z","log","s","exp","sd","sqrt","floor","t","j","swapItem","swap","arr","tmp","ax","ay","bx","by","dx","dy","defaultOptions","minZoom","maxZoom","minPoints","radius","extent","generateId","reduce","map","props","fround","OFFSET_ID","OFFSET_NUM","OFFSET_PROP","Supercluster","options","Object","assign","create","trees","Array","stride","clusterProps","load","points","console","time","timerId","p","geometry","lng","lat","coordinates","lngX","latY","Infinity","tree","_createTree","timeEnd","now","Date","_cluster","getClusters","bbox","zoom","minLng","minLat","maxLng","maxLat","easternHem","westernHem","concat","_limitZoom","clusters","id","getClusterJSON","getChildren","clusterId","originId","_getOriginId","originZoom","_getOriginZoom","errorMsg","pow","children","getLeaves","limit","offset","leaves","_appendLeaves","getTile","z2","top","bottom","tile","features","_addTileFeatures","getClusterExpansionZoom","expansionZoom","properties","cluster_id","skipped","child","cluster","point_count","isCluster","tags","px","py","getClusterProperties","f","type","round","undefined","nextData","neighborIds","numPointsOrigin","numPoints","neighborId","clusterProperties","wx","wy","clusterPropIndex","numPoints2","_map","clone","original","yLat","count","abbrev","propIndex","point_count_abbreviated","sin","PI","y2","atan","__rest","e","prototype","hasOwnProperty","call","getOwnPropertySymbols","propertyIsEnumerable","MarkerUtils","isAdvancedMarkerAvailable","google","maps","marker","getMapCapabilities","isAdvancedMarkersAvailable","isAdvancedMarker","AdvancedMarkerElement","setMap","getPosition","position","LatLng","getVisible","Cluster","markers","_position","bounds","LatLngBounds","extend","getCenter","filter","AbstractAlgorithm","noop","SuperClusterAlgorithm","_a","super","state","superCluster","calculate","input","changed","getZoom","feature","transformCluster","leaf","ClusterStats","sum","clusterMarkerCounts","a","clusterMarkerSum","b","mean","DefaultRenderer","render","stats","svg","title","zIndex","Number","Marker","MAX_ZINDEX","svgEl","DOMParser","parseFromString","documentElement","setAttribute","clusterOptions","content","icon","url","btoa","anchor","Point","OverlayViewSafe","type1","type2","property","OverlayView","MarkerClustererEvents","defaultOnClusterClickHandler","_","fitBounds","MarkerClusterer","algorithmOptions","algorithm","renderer","onClusterClick","addMarker","noDraw","includes","addMarkers","forEach","removeMarker","splice","removeMarkers","removed","clearMarkers","getMap","Map","getProjection","event","trigger","CLUSTERING_BEGIN","mapCanvasProjection","singleMarker","Set","groupMarkers","has","renderClusters","requestAnimationFrame","CLUSTERING_END","onAdd","idleListener","addListener","bind","onRemove","removeListener","reset","delete","CLUSTER_CLICK","millisecondsInMinute","millisecondsInHour","parseISO","argument","dirtyOptions","requiredArgs","arguments","additionalDigits","toInteger","RangeError","toString","NaN","date","dateStrings","dateString","timeString","array","split","patterns","dateTimeDelimiter","test","timeZoneDelimiter","substr","token","timezone","exec","replace","splitDateString","parseYearResult","regex","RegExp","captures","match","year","restDateString","parseInt","century","slice","parseYear","dateRegex","isWeekDate","dayOfYear","parseDateUnit","month","day","week","dayOfWeek","_year","validateWeekDate","isoWeekYear","setUTCFullYear","fourthOfJanuaryDay","getUTCDay","diff","setUTCDate","getUTCDate","dayOfISOWeekYear","daysInMonths","isLeapYearIndex","validateDate","validateDayOfYearDate","parseDate","getTime","timestamp","timeRegex","hours","parseTimeUnit","minutes","seconds","validateTime","parseTime","dirtyDate","setFullYear","getUTCFullYear","getUTCMonth","setHours","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","timezoneString","timezoneRegex","sign","_hours","validateTimezone","parseTimezone","value","parseFloat","module","exports","equal","keys","isArray","source","flags","valueOf","key","CheckBadgeIcon","titleId","svgRef","xmlns","viewBox","fill","ref","fillRule","d","clipRule","_extends","apply","_objectWithoutPropertiesLoose","_toPropertyKey","Symbol","toPrimitive","TypeError","String","_toPrimitive","APILoadingStatus","NOT_LOADED","LOADING","LOADED","FAILED","AUTH_FAILURE","GoogleMapsApiLoader","params","onLoadingStatusChange","_window$google","libraries","serializedParams","serializeParams","listeners","window","importLibrary","serializedApiParams","loadingStatus","notifyLoadingStatusListeners","initImportLibrary","warn","librariesToLoad","Promise","all","name","v","language","region","authReferrerPolicy","solutionChannel","join","error","apiPromise","loadApi","resolve","reject","_document$querySelect","scriptElement","document","createElement","urlParams","URLSearchParams","entries","urlParamName","toLowerCase","async","src","MAPS_API_BASE_URL","nonce","querySelector","onerror","__googleMapsCallback__","gm_authFailure","head","append","libraryName","then","fn","_excluded$3","_excluded2$1","APIProviderContext","APIProvider","loaderProps","mapInstances","addMapInstance","removeMapInstance","clearMapInstances","setMapInstances","useState","mapInstance","instances","_ref","useMapInstances","status","loadedLibraries","onLoad","onError","apiKey","otherApiParams","setStatus","addLoadedLibrary","useReducer","action","librariesString","useMemo","JSON","stringify","useCallback","_google","res","useEffect","channel","useGoogleMapsApiLoader","contextValue","Provider","createMapEvent","srcEvent","ev","detail","stoppable","stop","cameraEventTypes","camEvent","center","heading","getHeading","tilt","getTilt","getBounds","isFinite","toJSON","north","east","south","west","mouseEventTypes","_srcEvent$latLng","mouseEvent","domEvent","latLng","placeId","propNameToEventType","onBoundsChanged","onCenterChanged","onClick","onContextmenu","onDblclick","onDrag","onDragend","onDragstart","onHeadingChanged","onIdle","onIsFractionalZoomEnabledChanged","onMapCapabilitiesChanged","onMapTypeIdChanged","onMousemove","onMouseout","onMouseover","onProjectionChanged","onRenderingTypeChanged","onTilesLoaded","onTiltChanged","onZoomChanged","onCameraChanged","eventPropNames","useDeepCompareEffect","effect","deps","useRef","current","mapOptionKeys","useApiLoadingStatus","_useContext","useContext","toLatLngLiteral","obj","isLatLngLiteral","AuthFailureMessage","style","display","flexFlow","textAlign","justifyContent","fontSize","color","background","padding","useApiIsLoaded","useTrackedCameraStateRef","forceUpdate","useForceUpdate","listener","handleBoundsChange","remove","_excluded$2","_excluded2","CachedMapStack","useMapInstance","context","apiIsLoaded","container","containerRef","el","setEl","useCallbackRef","cameraStateRef","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme","mapOptions","hasZoom","hasCenter","savedMapStateRef","mapId","cacheKey","mapDiv","getDiv","appendChild","setOptions","setTimeout","setCenter","height","defBounds","savedMapId","cameraState","savedCameraState","clearInstanceListeners","GoogleMapsContext","className","mapRef","mapProps","useLayoutEffect","nextCamera","needsUpdate","moveCamera","useMapCameraParams","propName","handler","eventType","useMapEvents","useMapOptions","isDeckGlControlled","viewport","viewState","latitude","longitude","bearing","pitch","useDeckGLCameraUpdate","isControlledExternally","controlled","disableDefaultUI","gestureHandling","keyboardShortcuts","cameraOptions","_lat","_lng","_props$zoom","_props$heading","_props$tilt","combinedStyle","width","deckGLViewProps","shownMessages","logErrorOnce","args","useMap","ctx","useMapsLibrary","useMapsEventListener","target","callback","usePropBinding","object","prop","useDomEventListener","addEventListener","removeEventListener","AdvancedMarkerContext","AdvancedMarkerAnchorPoint","TOP_LEFT","TOP_CENTER","TOP","TOP_RIGHT","LEFT_CENTER","LEFT_TOP","LEFT","LEFT_BOTTOM","RIGHT_TOP","RIGHT","RIGHT_CENTER","RIGHT_BOTTOM","BOTTOM_LEFT","BOTTOM_CENTER","BOTTOM","BOTTOM_RIGHT","CENTER","MarkerContent","styles","anchorPoint","xTranslation","yTranslation","transformStyle","transform","useAdvancedMarker","setMarker","contentContainer","setContentContainer","markerLibrary","onMouseEnter","onMouseLeave","onDragStart","onDragEnd","collisionBehavior","clickable","draggable","numChildren","Children","newMarker","contentElement","isCustomMarker","_contentElement","gmpDraggable","gmpClickable","Boolean","nodeType","Node","ELEMENT_NODE","pointerEvents","firstElementChild","element","AdvancedMarker","forwardRef","advancedMarkerContextValue","useImperativeHandle","createPortal","useAdvancedMarkerRef","setValueForStyle","elementStyle","styleName","isCustomProperty","setProperty","cssFloat","unitlessNumbers","trim","_excluded$1","InfoWindow","headerContent","pixelOffset","shouldFocus","onClose","onCloseClick","infoWindowOptions","mapsLibrary","infoWindow","setInfoWindow","contentContainerRef","headerContainerRef","opts","Size","setContent","_contentContainerRef$","_headerContainerRef$c","prevStyleRef","prevStyles","setValueForStyles","isOpenedWithAnchor","openOptions","Element","wrapper","wrapperBcr","getBoundingClientRect","_anchor$content$first","anchorDomContent","contentBcr","anchorOffsetX","anchorOffsetY","open","close","_excluded","onMouseOver","onMouseOut","markerOptions","gme","setDraggable","setPosition","useMarker","failwith","RE_EXN_ID","_1"],"sourceRoot":""}