You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1861 lines
58 KiB

  1. (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".mapdiv[data-v-174b771e]{width:100%;height:100%}.info-window-wrapper[data-v-90174664]{display:none}.mapdiv .info-window-wrapper[data-v-90174664]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
  2. var qe = Object.defineProperty;
  3. var Be = (n, e, t) => e in n ? qe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
  4. var se = (n, e, t) => (Be(n, typeof e != "symbol" ? e + "" : e, t), t);
  5. import { defineComponent as P, ref as y, provide as G, watch as O, onMounted as Me, onBeforeUnmount as B, markRaw as I, toRef as N, openBlock as Y, createElementBlock as X, createElementVNode as ae, renderSlot as Q, normalizeProps as Ne, guardReactiveProps as Ze, inject as C, computed as J, withDirectives as De, vShow as Ue, Comment as Ee, mergeProps as Pe, createCommentVNode as Oe } from "vue";
  6. const Z = Symbol("map"), D = Symbol("api"), xe = Symbol("marker"), Le = Symbol("markerCluster"), ee = Symbol("CustomMarker"), Se = Symbol("mapTilesLoaded"), q = [
  7. "click",
  8. "dblclick",
  9. "drag",
  10. "dragend",
  11. "dragstart",
  12. "mousedown",
  13. "mousemove",
  14. "mouseout",
  15. "mouseover",
  16. "mouseup",
  17. "rightclick"
  18. ];
  19. /*! *****************************************************************************
  20. Copyright (c) Microsoft Corporation.
  21. Permission to use, copy, modify, and/or distribute this software for any
  22. purpose with or without fee is hereby granted.
  23. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  24. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  25. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  26. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  27. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  28. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  29. PERFORMANCE OF THIS SOFTWARE.
  30. ***************************************************************************** */
  31. function Fe(n, e, t, s) {
  32. function r(o) {
  33. return o instanceof t ? o : new t(function(a) {
  34. a(o);
  35. });
  36. }
  37. return new (t || (t = Promise))(function(o, a) {
  38. function l(u) {
  39. try {
  40. d(s.next(u));
  41. } catch (c) {
  42. a(c);
  43. }
  44. }
  45. function i(u) {
  46. try {
  47. d(s.throw(u));
  48. } catch (c) {
  49. a(c);
  50. }
  51. }
  52. function d(u) {
  53. u.done ? o(u.value) : r(u.value).then(l, i);
  54. }
  55. d((s = s.apply(n, e || [])).next());
  56. });
  57. }
  58. var Ve = function n(e, t) {
  59. if (e === t)
  60. return !0;
  61. if (e && t && typeof e == "object" && typeof t == "object") {
  62. if (e.constructor !== t.constructor)
  63. return !1;
  64. var s, r, o;
  65. if (Array.isArray(e)) {
  66. if (s = e.length, s != t.length)
  67. return !1;
  68. for (r = s; r-- !== 0; )
  69. if (!n(e[r], t[r]))
  70. return !1;
  71. return !0;
  72. }
  73. if (e.constructor === RegExp)
  74. return e.source === t.source && e.flags === t.flags;
  75. if (e.valueOf !== Object.prototype.valueOf)
  76. return e.valueOf() === t.valueOf();
  77. if (e.toString !== Object.prototype.toString)
  78. return e.toString() === t.toString();
  79. if (o = Object.keys(e), s = o.length, s !== Object.keys(t).length)
  80. return !1;
  81. for (r = s; r-- !== 0; )
  82. if (!Object.prototype.hasOwnProperty.call(t, o[r]))
  83. return !1;
  84. for (r = s; r-- !== 0; ) {
  85. var a = o[r];
  86. if (!n(e[a], t[a]))
  87. return !1;
  88. }
  89. return !0;
  90. }
  91. return e !== e && t !== t;
  92. };
  93. const de = "__googleMapsScriptId";
  94. var R;
  95. (function(n) {
  96. n[n.INITIALIZED = 0] = "INITIALIZED", n[n.LOADING = 1] = "LOADING", n[n.SUCCESS = 2] = "SUCCESS", n[n.FAILURE = 3] = "FAILURE";
  97. })(R || (R = {}));
  98. class T {
  99. /**
  100. * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
  101. * using this library, instead the defaults are set by the Google Maps
  102. * JavaScript API server.
  103. *
  104. * ```
  105. * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
  106. * ```
  107. */
  108. constructor({ apiKey: e, authReferrerPolicy: t, channel: s, client: r, id: o = de, language: a, libraries: l = [], mapIds: i, nonce: d, region: u, retries: c = 3, url: h = "https://maps.googleapis.com/maps/api/js", version: p }) {
  109. if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = s, this.client = r, this.id = o || de, this.language = a, this.libraries = l, this.mapIds = i, this.nonce = d, this.region = u, this.retries = c, this.url = h, this.version = p, T.instance) {
  110. if (!Ve(this.options, T.instance.options))
  111. throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(T.instance.options)}`);
  112. return T.instance;
  113. }
  114. T.instance = this;
  115. }
  116. get options() {
  117. return {
  118. version: this.version,
  119. apiKey: this.apiKey,
  120. channel: this.channel,
  121. client: this.client,
  122. id: this.id,
  123. libraries: this.libraries,
  124. language: this.language,
  125. region: this.region,
  126. mapIds: this.mapIds,
  127. nonce: this.nonce,
  128. url: this.url,
  129. authReferrerPolicy: this.authReferrerPolicy
  130. };
  131. }
  132. get status() {
  133. return this.errors.length ? R.FAILURE : this.done ? R.SUCCESS : this.loading ? R.LOADING : R.INITIALIZED;
  134. }
  135. get failed() {
  136. return this.done && !this.loading && this.errors.length >= this.retries + 1;
  137. }
  138. /**
  139. * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
  140. *
  141. * @ignore
  142. * @deprecated
  143. */
  144. createUrl() {
  145. let e = this.url;
  146. return e += "?callback=__googleMapsCallback", this.apiKey && (e += `&key=${this.apiKey}`), this.channel && (e += `&channel=${this.channel}`), this.client && (e += `&client=${this.client}`), this.libraries.length > 0 && (e += `&libraries=${this.libraries.join(",")}`), this.language && (e += `&language=${this.language}`), this.region && (e += `&region=${this.region}`), this.version && (e += `&v=${this.version}`), this.mapIds && (e += `&map_ids=${this.mapIds.join(",")}`), this.authReferrerPolicy && (e += `&auth_referrer_policy=${this.authReferrerPolicy}`), e;
  147. }
  148. deleteScript() {
  149. const e = document.getElementById(this.id);
  150. e && e.remove();
  151. }
  152. /**
  153. * Load the Google Maps JavaScript API script and return a Promise.
  154. * @deprecated, use importLibrary() instead.
  155. */
  156. load() {
  157. return this.loadPromise();
  158. }
  159. /**
  160. * Load the Google Maps JavaScript API script and return a Promise.
  161. *
  162. * @ignore
  163. * @deprecated, use importLibrary() instead.
  164. */
  165. loadPromise() {
  166. return new Promise((e, t) => {
  167. this.loadCallback((s) => {
  168. s ? t(s.error) : e(window.google);
  169. });
  170. });
  171. }
  172. importLibrary(e) {
  173. return this.execute(), google.maps.importLibrary(e);
  174. }
  175. /**
  176. * Load the Google Maps JavaScript API script with a callback.
  177. * @deprecated, use importLibrary() instead.
  178. */
  179. loadCallback(e) {
  180. this.callbacks.push(e), this.execute();
  181. }
  182. /**
  183. * Set the script on document.
  184. */
  185. setScript() {
  186. var e, t;
  187. if (document.getElementById(this.id)) {
  188. this.callback();
  189. return;
  190. }
  191. const s = {
  192. key: this.apiKey,
  193. channel: this.channel,
  194. client: this.client,
  195. libraries: this.libraries.length && this.libraries,
  196. v: this.version,
  197. mapIds: this.mapIds,
  198. language: this.language,
  199. region: this.region,
  200. authReferrerPolicy: this.authReferrerPolicy
  201. };
  202. Object.keys(s).forEach(
  203. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  204. (o) => !s[o] && delete s[o]
  205. ), !((t = (e = window == null ? void 0 : window.google) === null || e === void 0 ? void 0 : e.maps) === null || t === void 0) && t.importLibrary || ((o) => {
  206. let a, l, i, d = "The Google Maps JavaScript API", u = "google", c = "importLibrary", h = "__ib__", p = document, m = window;
  207. m = m[u] || (m[u] = {});
  208. const f = m.maps || (m.maps = {}), g = /* @__PURE__ */ new Set(), v = new URLSearchParams(), w = () => (
  209. // @ts-ignore
  210. a || (a = new Promise((_, E) => Fe(this, void 0, void 0, function* () {
  211. var b;
  212. yield l = p.createElement("script"), l.id = this.id, v.set("libraries", [...g] + "");
  213. for (i in o)
  214. v.set(i.replace(/[A-Z]/g, (x) => "_" + x[0].toLowerCase()), o[i]);
  215. v.set("callback", u + ".maps." + h), l.src = this.url + "?" + v, f[h] = _, l.onerror = () => a = E(Error(d + " could not load.")), l.nonce = this.nonce || ((b = p.querySelector("script[nonce]")) === null || b === void 0 ? void 0 : b.nonce) || "", p.head.append(l);
  216. })))
  217. );
  218. f[c] ? console.warn(d + " only loads once. Ignoring:", o) : f[c] = (_, ...E) => g.add(_) && w().then(() => f[c](_, ...E));
  219. })(s);
  220. const r = this.libraries.map((o) => this.importLibrary(o));
  221. r.length || r.push(this.importLibrary("core")), Promise.all(r).then(() => this.callback(), (o) => {
  222. const a = new ErrorEvent("error", { error: o });
  223. this.loadErrorCallback(a);
  224. });
  225. }
  226. /**
  227. * Reset the loader state.
  228. */
  229. reset() {
  230. this.deleteScript(), this.done = !1, this.loading = !1, this.errors = [], this.onerrorEvent = null;
  231. }
  232. resetIfRetryingFailed() {
  233. this.failed && this.reset();
  234. }
  235. loadErrorCallback(e) {
  236. if (this.errors.push(e), this.errors.length <= this.retries) {
  237. const t = this.errors.length * Math.pow(2, this.errors.length);
  238. console.error(`Failed to load Google Maps script, retrying in ${t} ms.`), setTimeout(() => {
  239. this.deleteScript(), this.setScript();
  240. }, t);
  241. } else
  242. this.onerrorEvent = e, this.callback();
  243. }
  244. callback() {
  245. this.done = !0, this.loading = !1, this.callbacks.forEach((e) => {
  246. e(this.onerrorEvent);
  247. }), this.callbacks = [];
  248. }
  249. execute() {
  250. if (this.resetIfRetryingFailed(), this.done)
  251. this.callback();
  252. else {
  253. if (window.google && window.google.maps && window.google.maps.version) {
  254. console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."), this.callback();
  255. return;
  256. }
  257. this.loading || (this.loading = !0, this.setScript());
  258. }
  259. }
  260. }
  261. function ze(n) {
  262. return class extends n.OverlayView {
  263. constructor(s) {
  264. super();
  265. se(this, "element");
  266. se(this, "opts");
  267. const { element: r, ...o } = s;
  268. this.element = r, this.opts = o, this.opts.map && this.setMap(this.opts.map);
  269. }
  270. getPosition() {
  271. return this.opts.position ? this.opts.position instanceof n.LatLng ? this.opts.position : new n.LatLng(this.opts.position) : null;
  272. }
  273. getVisible() {
  274. if (!this.element)
  275. return !1;
  276. const s = this.element;
  277. return s.style.display !== "none" && s.style.visibility !== "hidden" && (s.style.opacity === "" || Number(s.style.opacity) > 0.01);
  278. }
  279. onAdd() {
  280. if (!this.element)
  281. return;
  282. const s = this.getPanes();
  283. s && s.overlayMouseTarget.appendChild(this.element);
  284. }
  285. draw() {
  286. if (!this.element)
  287. return;
  288. const s = this.getProjection(), r = s == null ? void 0 : s.fromLatLngToDivPixel(this.getPosition());
  289. if (r) {
  290. this.element.style.position = "absolute";
  291. const o = this.element.offsetHeight, a = this.element.offsetWidth;
  292. let l, i;
  293. switch (this.opts.anchorPoint) {
  294. case "TOP_CENTER":
  295. l = r.x - a / 2, i = r.y;
  296. break;
  297. case "BOTTOM_CENTER":
  298. l = r.x - a / 2, i = r.y - o;
  299. break;
  300. case "LEFT_CENTER":
  301. l = r.x, i = r.y - o / 2;
  302. break;
  303. case "RIGHT_CENTER":
  304. l = r.x - a, i = r.y - o / 2;
  305. break;
  306. case "TOP_LEFT":
  307. l = r.x, i = r.y;
  308. break;
  309. case "TOP_RIGHT":
  310. l = r.x - a, i = r.y;
  311. break;
  312. case "BOTTOM_LEFT":
  313. l = r.x, i = r.y - o;
  314. break;
  315. case "BOTTOM_RIGHT":
  316. l = r.x - a, i = r.y - o;
  317. break;
  318. default:
  319. l = r.x - a / 2, i = r.y - o / 2;
  320. }
  321. this.element.style.left = l + "px", this.element.style.top = i + "px", this.element.style.transform = `translateX(${this.opts.offsetX || 0}px) translateY(${this.opts.offsetY || 0}px)`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString());
  322. }
  323. }
  324. onRemove() {
  325. this.element && this.element.remove();
  326. }
  327. setOptions(s) {
  328. const { element: r, ...o } = s;
  329. this.element = r, this.opts = o, this.draw();
  330. }
  331. };
  332. }
  333. let he;
  334. const pe = [
  335. "bounds_changed",
  336. "center_changed",
  337. "click",
  338. "dblclick",
  339. "drag",
  340. "dragend",
  341. "dragstart",
  342. "heading_changed",
  343. "idle",
  344. "maptypeid_changed",
  345. "mousemove",
  346. "mouseout",
  347. "mouseover",
  348. "projection_changed",
  349. "resize",
  350. "rightclick",
  351. "tilesloaded",
  352. "tilt_changed",
  353. "zoom_changed"
  354. ], Ge = P({
  355. props: {
  356. apiPromise: {
  357. type: Promise
  358. },
  359. apiKey: {
  360. type: String,
  361. default: ""
  362. },
  363. version: {
  364. type: String,
  365. default: "weekly"
  366. },
  367. libraries: {
  368. type: Array,
  369. default: () => ["places"]
  370. },
  371. region: {
  372. type: String,
  373. required: !1
  374. },
  375. language: {
  376. type: String,
  377. required: !1
  378. },
  379. backgroundColor: {
  380. type: String,
  381. required: !1
  382. },
  383. center: {
  384. type: Object,
  385. default: () => ({ lat: 0, lng: 0 })
  386. },
  387. clickableIcons: {
  388. type: Boolean,
  389. required: !1,
  390. default: void 0
  391. },
  392. controlSize: {
  393. type: Number,
  394. required: !1
  395. },
  396. disableDefaultUi: {
  397. type: Boolean,
  398. required: !1,
  399. default: void 0
  400. },
  401. disableDoubleClickZoom: {
  402. type: Boolean,
  403. required: !1,
  404. default: void 0
  405. },
  406. draggable: {
  407. type: Boolean,
  408. required: !1,
  409. default: void 0
  410. },
  411. draggableCursor: {
  412. type: String,
  413. required: !1
  414. },
  415. draggingCursor: {
  416. type: String,
  417. required: !1
  418. },
  419. fullscreenControl: {
  420. type: Boolean,
  421. required: !1,
  422. default: void 0
  423. },
  424. fullscreenControlPosition: {
  425. type: String,
  426. required: !1
  427. },
  428. gestureHandling: {
  429. type: String,
  430. required: !1
  431. },
  432. heading: {
  433. type: Number,
  434. required: !1
  435. },
  436. keyboardShortcuts: {
  437. type: Boolean,
  438. required: !1,
  439. default: void 0
  440. },
  441. mapTypeControl: {
  442. type: Boolean,
  443. required: !1,
  444. default: void 0
  445. },
  446. mapTypeControlOptions: {
  447. type: Object,
  448. required: !1
  449. },
  450. mapTypeId: {
  451. type: [Number, String],
  452. required: !1
  453. },
  454. mapId: {
  455. type: String,
  456. required: !1
  457. },
  458. maxZoom: {
  459. type: Number,
  460. required: !1
  461. },
  462. minZoom: {
  463. type: Number,
  464. required: !1
  465. },
  466. noClear: {
  467. type: Boolean,
  468. required: !1,
  469. default: void 0
  470. },
  471. panControl: {
  472. type: Boolean,
  473. required: !1,
  474. default: void 0
  475. },
  476. panControlPosition: {
  477. type: String,
  478. required: !1
  479. },
  480. restriction: {
  481. type: Object,
  482. required: !1
  483. },
  484. rotateControl: {
  485. type: Boolean,
  486. required: !1,
  487. default: void 0
  488. },
  489. rotateControlPosition: {
  490. type: String,
  491. required: !1
  492. },
  493. scaleControl: {
  494. type: Boolean,
  495. required: !1,
  496. default: void 0
  497. },
  498. scaleControlStyle: {
  499. type: Number,
  500. required: !1
  501. },
  502. scrollwheel: {
  503. type: Boolean,
  504. required: !1,
  505. default: void 0
  506. },
  507. streetView: {
  508. type: Object,
  509. required: !1
  510. },
  511. streetViewControl: {
  512. type: Boolean,
  513. required: !1,
  514. default: void 0
  515. },
  516. streetViewControlPosition: {
  517. type: String,
  518. required: !1
  519. },
  520. styles: {
  521. type: Array,
  522. required: !1
  523. },
  524. tilt: {
  525. type: Number,
  526. required: !1
  527. },
  528. zoom: {
  529. type: Number,
  530. required: !1
  531. },
  532. zoomControl: {
  533. type: Boolean,
  534. required: !1,
  535. default: void 0
  536. },
  537. zoomControlPosition: {
  538. type: String,
  539. required: !1
  540. }
  541. },
  542. emits: pe,
  543. setup(n, { emit: e }) {
  544. const t = y(), s = y(!1), r = y(), o = y(), a = y(!1);
  545. G(Z, r), G(D, o), G(Se, a);
  546. const l = () => {
  547. const c = { ...n };
  548. Object.keys(c).forEach((f) => {
  549. c[f] === void 0 && delete c[f];
  550. });
  551. const p = (f) => {
  552. var g;
  553. return f ? { position: (g = o.value) == null ? void 0 : g.ControlPosition[f] } : {};
  554. }, m = {
  555. scaleControlOptions: n.scaleControlStyle ? { style: n.scaleControlStyle } : {},
  556. panControlOptions: p(n.panControlPosition),
  557. zoomControlOptions: p(n.zoomControlPosition),
  558. rotateControlOptions: p(n.rotateControlPosition),
  559. streetViewControlOptions: p(n.streetViewControlPosition),
  560. fullscreenControlOptions: p(n.fullscreenControlPosition),
  561. disableDefaultUI: n.disableDefaultUi
  562. };
  563. return { ...c, ...m };
  564. }, i = O(
  565. [o, r],
  566. ([c, h]) => {
  567. const p = c, m = h;
  568. p && m && (p.event.addListenerOnce(m, "tilesloaded", () => {
  569. a.value = !0;
  570. }), setTimeout(i, 0));
  571. },
  572. { immediate: !0 }
  573. ), d = () => {
  574. try {
  575. const { apiKey: c, region: h, version: p, language: m, libraries: f } = n;
  576. he = new T({ apiKey: c, region: h, version: p, language: m, libraries: f });
  577. } catch (c) {
  578. console.error(c);
  579. }
  580. }, u = (c) => {
  581. o.value = I(c.maps), r.value = I(new c.maps.Map(t.value, l()));
  582. const h = ze(o.value);
  583. o.value[ee] = h, pe.forEach((m) => {
  584. var f;
  585. (f = r.value) == null || f.addListener(m, (g) => e(m, g));
  586. }), s.value = !0;
  587. const p = Object.keys(n).filter(
  588. (m) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom"].includes(m)
  589. ).map((m) => N(n, m));
  590. O(
  591. [() => n.center, () => n.zoom, ...p],
  592. ([m, f], [g, v]) => {
  593. var x, M, F;
  594. const { center: w, zoom: _, ...E } = l();
  595. (x = r.value) == null || x.setOptions(E), f !== void 0 && f !== v && ((M = r.value) == null || M.setZoom(f));
  596. const b = !g || m.lng !== g.lng || m.lat !== g.lat;
  597. m && b && ((F = r.value) == null || F.panTo(m));
  598. }
  599. );
  600. };
  601. return Me(() => {
  602. n.apiPromise && n.apiPromise instanceof Promise ? n.apiPromise.then(u) : (d(), he.load().then(u));
  603. }), B(() => {
  604. var c;
  605. a.value = !1, r.value && ((c = o.value) == null || c.event.clearInstanceListeners(r.value));
  606. }), { mapRef: t, ready: s, map: r, api: o, mapTilesLoaded: a };
  607. }
  608. });
  609. const te = (n, e) => {
  610. const t = n.__vccOpts || n;
  611. for (const [s, r] of e)
  612. t[s] = r;
  613. return t;
  614. }, He = {
  615. ref: "mapRef",
  616. class: "mapdiv"
  617. };
  618. function We(n, e, t, s, r, o) {
  619. return Y(), X("div", null, [
  620. ae("div", He, null, 512),
  621. Q(n.$slots, "default", Ne(Ze({ ready: n.ready, map: n.map, api: n.api, mapTilesLoaded: n.mapTilesLoaded })), void 0, !0)
  622. ]);
  623. }
  624. const Ot = /* @__PURE__ */ te(Ge, [["render", We], ["__scopeId", "data-v-174b771e"]]);
  625. function Ke(n) {
  626. return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
  627. }
  628. var Je = function n(e, t) {
  629. if (e === t)
  630. return !0;
  631. if (e && t && typeof e == "object" && typeof t == "object") {
  632. if (e.constructor !== t.constructor)
  633. return !1;
  634. var s, r, o;
  635. if (Array.isArray(e)) {
  636. if (s = e.length, s != t.length)
  637. return !1;
  638. for (r = s; r-- !== 0; )
  639. if (!n(e[r], t[r]))
  640. return !1;
  641. return !0;
  642. }
  643. if (e.constructor === RegExp)
  644. return e.source === t.source && e.flags === t.flags;
  645. if (e.valueOf !== Object.prototype.valueOf)
  646. return e.valueOf() === t.valueOf();
  647. if (e.toString !== Object.prototype.toString)
  648. return e.toString() === t.toString();
  649. if (o = Object.keys(e), s = o.length, s !== Object.keys(t).length)
  650. return !1;
  651. for (r = s; r-- !== 0; )
  652. if (!Object.prototype.hasOwnProperty.call(t, o[r]))
  653. return !1;
  654. for (r = s; r-- !== 0; ) {
  655. var a = o[r];
  656. if (!n(e[a], t[a]))
  657. return !1;
  658. }
  659. return !0;
  660. }
  661. return e !== e && t !== t;
  662. };
  663. const $ = /* @__PURE__ */ Ke(Je), Ye = (n) => n === "Marker", Xe = (n) => n === ee, U = (n, e, t, s) => {
  664. const r = y(), o = C(Z, y()), a = C(D, y()), l = C(Le, y()), i = J(
  665. () => !!(l.value && a.value && (r.value instanceof a.value.Marker || r.value instanceof a.value[ee]))
  666. );
  667. return O(
  668. [o, t],
  669. (d, [u, c]) => {
  670. var p, m, f;
  671. const h = !$(t.value, c) || o.value !== u;
  672. !o.value || !a.value || !h || (r.value ? (r.value.setOptions(t.value), i.value && ((p = l.value) == null || p.removeMarker(r.value), (m = l.value) == null || m.addMarker(r.value))) : (Ye(n) ? r.value = I(
  673. new a.value[n](t.value)
  674. ) : Xe(n) ? r.value = I(
  675. new a.value[n](t.value)
  676. ) : r.value = I(
  677. new a.value[n]({
  678. ...t.value,
  679. map: o.value
  680. })
  681. ), i.value ? (f = l.value) == null || f.addMarker(r.value) : r.value.setMap(o.value), e.forEach((g) => {
  682. var v;
  683. (v = r.value) == null || v.addListener(g, (w) => s(g, w));
  684. })));
  685. },
  686. {
  687. immediate: !0
  688. }
  689. ), B(() => {
  690. var d, u;
  691. r.value && ((d = a.value) == null || d.event.clearInstanceListeners(r.value), i.value ? (u = l.value) == null || u.removeMarker(r.value) : r.value.setMap(null));
  692. }), r;
  693. }, fe = [
  694. "animation_changed",
  695. "click",
  696. "dblclick",
  697. "rightclick",
  698. "dragstart",
  699. "dragend",
  700. "drag",
  701. "mouseover",
  702. "mousedown",
  703. "mouseout",
  704. "mouseup",
  705. "draggable_changed",
  706. "clickable_changed",
  707. "contextmenu",
  708. "cursor_changed",
  709. "flat_changed",
  710. "rightclick",
  711. "zindex_changed",
  712. "icon_changed",
  713. "position_changed",
  714. "shape_changed",
  715. "title_changed",
  716. "visible_changed"
  717. ], xt = P({
  718. name: "Marker",
  719. props: {
  720. options: {
  721. type: Object,
  722. required: !0
  723. }
  724. },
  725. emits: fe,
  726. setup(n, { emit: e, expose: t, slots: s }) {
  727. const r = N(n, "options"), o = U("Marker", fe, r, e);
  728. return G(xe, o), t({ marker: o }), () => {
  729. var a;
  730. return (a = s.default) == null ? void 0 : a.call(s);
  731. };
  732. }
  733. }), Lt = P({
  734. name: "Polyline",
  735. props: {
  736. options: {
  737. type: Object,
  738. required: !0
  739. }
  740. },
  741. emits: q,
  742. setup(n, { emit: e }) {
  743. const t = N(n, "options");
  744. return { polyline: U("Polyline", q, t, e) };
  745. },
  746. render: () => null
  747. }), St = P({
  748. name: "Polygon",
  749. props: {
  750. options: {
  751. type: Object,
  752. required: !0
  753. }
  754. },
  755. emits: q,
  756. setup(n, { emit: e }) {
  757. const t = N(n, "options");
  758. return { polygon: U("Polygon", q, t, e) };
  759. },
  760. render: () => null
  761. }), me = q.concat(["bounds_changed"]), It = P({
  762. name: "Rectangle",
  763. props: {
  764. options: {
  765. type: Object,
  766. required: !0
  767. }
  768. },
  769. emits: me,
  770. setup(n, { emit: e }) {
  771. const t = N(n, "options");
  772. return { rectangle: U("Rectangle", me, t, e) };
  773. },
  774. render: () => null
  775. }), ge = q.concat(["center_changed", "radius_changed"]), At = P({
  776. name: "Circle",
  777. props: {
  778. options: {
  779. type: Object,
  780. required: !0
  781. }
  782. },
  783. emits: ge,
  784. setup(n, { emit: e }) {
  785. const t = N(n, "options");
  786. return { circle: U("Circle", ge, t, e) };
  787. },
  788. render: () => null
  789. }), Qe = P({
  790. props: {
  791. position: {
  792. type: String,
  793. required: !0
  794. },
  795. index: {
  796. type: Number,
  797. default: 1
  798. }
  799. },
  800. emits: ["content:loaded"],
  801. setup(n, { emit: e }) {
  802. const t = y(null), s = C(Z, y()), r = C(D, y()), o = C(Se, y(!1)), a = y(!1), l = O(
  803. [o, r, t],
  804. ([u, c, h]) => {
  805. c && u && h && (i(n.position), a.value = !0, e("content:loaded"), setTimeout(l, 0));
  806. },
  807. { immediate: !0 }
  808. ), i = (u) => {
  809. if (s.value && r.value && t.value) {
  810. const c = r.value.ControlPosition[u];
  811. s.value.controls[c].push(t.value);
  812. }
  813. }, d = (u) => {
  814. if (s.value && r.value) {
  815. let c = null;
  816. const h = r.value.ControlPosition[u];
  817. s.value.controls[h].forEach((p, m) => {
  818. p === t.value && (c = m);
  819. }), c !== null && s.value.controls[h].removeAt(c);
  820. }
  821. };
  822. return B(() => d(n.position)), O(
  823. () => n.position,
  824. (u, c) => {
  825. d(c), i(u);
  826. }
  827. ), O(
  828. () => n.index,
  829. (u) => {
  830. u && t.value && (t.value.index = n.index);
  831. }
  832. ), { controlRef: t, showContent: a };
  833. }
  834. }), et = { ref: "controlRef" };
  835. function tt(n, e, t, s, r, o) {
  836. return De((Y(), X("div", et, [
  837. Q(n.$slots, "default")
  838. ], 512)), [
  839. [Ue, n.showContent]
  840. ]);
  841. }
  842. const Tt = /* @__PURE__ */ te(Qe, [["render", tt]]), ve = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"], st = P({
  843. inheritAttrs: !1,
  844. props: {
  845. options: {
  846. type: Object,
  847. default: () => ({})
  848. },
  849. modelValue: {
  850. type: Boolean
  851. }
  852. },
  853. emits: [...ve, "update:modelValue"],
  854. setup(n, { slots: e, emit: t, expose: s }) {
  855. const r = y(), o = y(), a = C(Z, y()), l = C(D, y()), i = C(xe, y());
  856. let d, u = n.modelValue;
  857. const c = J(() => {
  858. var f;
  859. return (f = e.default) == null ? void 0 : f.call(e).some((g) => g.type !== Ee);
  860. }), h = (f) => {
  861. u = f, t("update:modelValue", f);
  862. }, p = (f) => {
  863. r.value && (r.value.open({ map: a.value, anchor: i.value, ...f }), h(!0));
  864. }, m = () => {
  865. r.value && (r.value.close(), h(!1));
  866. };
  867. return Me(() => {
  868. O(
  869. [a, () => n.options],
  870. ([f, g], [v, w]) => {
  871. var E;
  872. const _ = !$(g, w) || a.value !== v;
  873. a.value && l.value && _ && (r.value ? (r.value.setOptions({
  874. ...g,
  875. content: c.value ? o.value : g.content
  876. }), i.value || p()) : (r.value = I(
  877. new l.value.InfoWindow({
  878. ...g,
  879. content: c.value ? o.value : g.content
  880. })
  881. ), i.value && (d = i.value.addListener("click", () => {
  882. p();
  883. })), (!i.value || u) && p(), ve.forEach((b) => {
  884. var x;
  885. (x = r.value) == null || x.addListener(b, (M) => t(b, M));
  886. }), (E = r.value) == null || E.addListener("closeclick", () => h(!1))));
  887. },
  888. {
  889. immediate: !0
  890. }
  891. ), O(() => n.modelValue, (f) => {
  892. f !== u && (f ? p() : m());
  893. });
  894. }), B(() => {
  895. var f;
  896. d && d.remove(), r.value && ((f = l.value) == null || f.event.clearInstanceListeners(r.value), m());
  897. }), s({ infoWindow: r, open: p, close: m }), { infoWindow: r, infoWindowRef: o, hasSlotContent: c, open: p, close: m };
  898. }
  899. });
  900. const rt = {
  901. key: 0,
  902. class: "info-window-wrapper"
  903. };
  904. function nt(n, e, t, s, r, o) {
  905. return n.hasSlotContent ? (Y(), X("div", rt, [
  906. ae("div", Pe({ ref: "infoWindowRef" }, n.$attrs), [
  907. Q(n.$slots, "default", {}, void 0, !0)
  908. ], 16)
  909. ])) : Oe("", !0);
  910. }
  911. const $t = /* @__PURE__ */ te(st, [["render", nt], ["__scopeId", "data-v-90174664"]]), ye = [
  912. Int8Array,
  913. Uint8Array,
  914. Uint8ClampedArray,
  915. Int16Array,
  916. Uint16Array,
  917. Int32Array,
  918. Uint32Array,
  919. Float32Array,
  920. Float64Array
  921. ], re = 1, V = 8;
  922. class le {
  923. /**
  924. * Creates an index from raw `ArrayBuffer` data.
  925. * @param {ArrayBuffer} data
  926. */
  927. static from(e) {
  928. if (!(e instanceof ArrayBuffer))
  929. throw new Error("Data must be an instance of ArrayBuffer.");
  930. const [t, s] = new Uint8Array(e, 0, 2);
  931. if (t !== 219)
  932. throw new Error("Data does not appear to be in a KDBush format.");
  933. const r = s >> 4;
  934. if (r !== re)
  935. throw new Error(`Got v${r} data when expected v${re}.`);
  936. const o = ye[s & 15];
  937. if (!o)
  938. throw new Error("Unrecognized array type.");
  939. const [a] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
  940. return new le(l, a, o, e);
  941. }
  942. /**
  943. * Creates an index that will hold a given number of items.
  944. * @param {number} numItems
  945. * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).
  946. * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
  947. * @param {ArrayBuffer} [data] (For internal use only)
  948. */
  949. constructor(e, t = 64, s = Float64Array, r) {
  950. if (isNaN(e) || e < 0)
  951. throw new Error(`Unpexpected numItems value: ${e}.`);
  952. this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = s, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
  953. const o = ye.indexOf(this.ArrayType), a = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, l = e * this.IndexArrayType.BYTES_PER_ELEMENT, i = (8 - l % 8) % 8;
  954. if (o < 0)
  955. throw new Error(`Unexpected typed array class: ${s}.`);
  956. r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data, V, e), this.coords = new this.ArrayType(this.data, V + l + i, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(V + a + l + i), this.ids = new this.IndexArrayType(this.data, V, e), this.coords = new this.ArrayType(this.data, V + l + i, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (re << 4) + o]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e);
  957. }
  958. /**
  959. * Add a point to the index.
  960. * @param {number} x
  961. * @param {number} y
  962. * @returns {number} An incremental index associated with the added item (starting from `0`).
  963. */
  964. add(e, t) {
  965. const s = this._pos >> 1;
  966. return this.ids[s] = s, this.coords[this._pos++] = e, this.coords[this._pos++] = t, s;
  967. }
  968. /**
  969. * Perform indexing of the added points.
  970. */
  971. finish() {
  972. const e = this._pos >> 1;
  973. if (e !== this.numItems)
  974. throw new Error(`Added ${e} items when expected ${this.numItems}.`);
  975. return ie(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
  976. }
  977. /**
  978. * Search the index for items within a given bounding box.
  979. * @param {number} minX
  980. * @param {number} minY
  981. * @param {number} maxX
  982. * @param {number} maxY
  983. * @returns {number[]} An array of indices correponding to the found items.
  984. */
  985. range(e, t, s, r) {
  986. if (!this._finished)
  987. throw new Error("Data not yet indexed - call index.finish().");
  988. const { ids: o, coords: a, nodeSize: l } = this, i = [0, o.length - 1, 0], d = [];
  989. for (; i.length; ) {
  990. const u = i.pop() || 0, c = i.pop() || 0, h = i.pop() || 0;
  991. if (c - h <= l) {
  992. for (let g = h; g <= c; g++) {
  993. const v = a[2 * g], w = a[2 * g + 1];
  994. v >= e && v <= s && w >= t && w <= r && d.push(o[g]);
  995. }
  996. continue;
  997. }
  998. const p = h + c >> 1, m = a[2 * p], f = a[2 * p + 1];
  999. m >= e && m <= s && f >= t && f <= r && d.push(o[p]), (u === 0 ? e <= m : t <= f) && (i.push(h), i.push(p - 1), i.push(1 - u)), (u === 0 ? s >= m : r >= f) && (i.push(p + 1), i.push(c), i.push(1 - u));
  1000. }
  1001. return d;
  1002. }
  1003. /**
  1004. * Search the index for items within a given radius.
  1005. * @param {number} qx
  1006. * @param {number} qy
  1007. * @param {number} r Query radius.
  1008. * @returns {number[]} An array of indices correponding to the found items.
  1009. */
  1010. within(e, t, s) {
  1011. if (!this._finished)
  1012. throw new Error("Data not yet indexed - call index.finish().");
  1013. const { ids: r, coords: o, nodeSize: a } = this, l = [0, r.length - 1, 0], i = [], d = s * s;
  1014. for (; l.length; ) {
  1015. const u = l.pop() || 0, c = l.pop() || 0, h = l.pop() || 0;
  1016. if (c - h <= a) {
  1017. for (let g = h; g <= c; g++)
  1018. we(o[2 * g], o[2 * g + 1], e, t) <= d && i.push(r[g]);
  1019. continue;
  1020. }
  1021. const p = h + c >> 1, m = o[2 * p], f = o[2 * p + 1];
  1022. we(m, f, e, t) <= d && i.push(r[p]), (u === 0 ? e - s <= m : t - s <= f) && (l.push(h), l.push(p - 1), l.push(1 - u)), (u === 0 ? e + s >= m : t + s >= f) && (l.push(p + 1), l.push(c), l.push(1 - u));
  1023. }
  1024. return i;
  1025. }
  1026. }
  1027. function ie(n, e, t, s, r, o) {
  1028. if (r - s <= t)
  1029. return;
  1030. const a = s + r >> 1;
  1031. Ie(n, e, a, s, r, o), ie(n, e, t, s, a - 1, 1 - o), ie(n, e, t, a + 1, r, 1 - o);
  1032. }
  1033. function Ie(n, e, t, s, r, o) {
  1034. for (; r > s; ) {
  1035. if (r - s > 600) {
  1036. const d = r - s + 1, u = t - s + 1, c = Math.log(d), h = 0.5 * Math.exp(2 * c / 3), p = 0.5 * Math.sqrt(c * h * (d - h) / d) * (u - d / 2 < 0 ? -1 : 1), m = Math.max(s, Math.floor(t - u * h / d + p)), f = Math.min(r, Math.floor(t + (d - u) * h / d + p));
  1037. Ie(n, e, t, m, f, o);
  1038. }
  1039. const a = e[2 * t + o];
  1040. let l = s, i = r;
  1041. for (z(n, e, s, t), e[2 * r + o] > a && z(n, e, s, r); l < i; ) {
  1042. for (z(n, e, l, i), l++, i--; e[2 * l + o] < a; )
  1043. l++;
  1044. for (; e[2 * i + o] > a; )
  1045. i--;
  1046. }
  1047. e[2 * s + o] === a ? z(n, e, s, i) : (i++, z(n, e, i, r)), i <= t && (s = i + 1), t <= i && (r = i - 1);
  1048. }
  1049. }
  1050. function z(n, e, t, s) {
  1051. ne(n, t, s), ne(e, 2 * t, 2 * s), ne(e, 2 * t + 1, 2 * s + 1);
  1052. }
  1053. function ne(n, e, t) {
  1054. const s = n[e];
  1055. n[e] = n[t], n[t] = s;
  1056. }
  1057. function we(n, e, t, s) {
  1058. const r = n - t, o = e - s;
  1059. return r * r + o * o;
  1060. }
  1061. const ot = {
  1062. minZoom: 0,
  1063. // min zoom to generate clusters on
  1064. maxZoom: 16,
  1065. // max zoom level to cluster the points on
  1066. minPoints: 2,
  1067. // minimum points to form a cluster
  1068. radius: 40,
  1069. // cluster radius in pixels
  1070. extent: 512,
  1071. // tile extent (radius is calculated relative to it)
  1072. nodeSize: 64,
  1073. // size of the KD-tree leaf node, affects performance
  1074. log: !1,
  1075. // whether to log timing info
  1076. // whether to generate numeric ids for input features (in vector tiles)
  1077. generateId: !1,
  1078. // a reduce function for calculating custom cluster properties
  1079. reduce: null,
  1080. // (accumulated, props) => { accumulated.sum += props.sum; }
  1081. // properties to use for individual points when running the reducer
  1082. map: (n) => n
  1083. // props => ({sum: props.my_value})
  1084. }, _e = Math.fround || ((n) => (e) => (n[0] = +e, n[0]))(new Float32Array(1)), A = 2, S = 3, oe = 4, L = 5, Ae = 6;
  1085. class Te {
  1086. constructor(e) {
  1087. this.options = Object.assign(Object.create(ot), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
  1088. }
  1089. load(e) {
  1090. const { log: t, minZoom: s, maxZoom: r } = this.options;
  1091. t && console.time("total time");
  1092. const o = `prepare ${e.length} points`;
  1093. t && console.time(o), this.points = e;
  1094. const a = [];
  1095. for (let i = 0; i < e.length; i++) {
  1096. const d = e[i];
  1097. if (!d.geometry)
  1098. continue;
  1099. const [u, c] = d.geometry.coordinates, h = _e(W(u)), p = _e(K(c));
  1100. a.push(
  1101. h,
  1102. p,
  1103. // projected point coordinates
  1104. 1 / 0,
  1105. // the last zoom the point was processed at
  1106. i,
  1107. // index of the source feature in the original input array
  1108. -1,
  1109. // parent cluster id
  1110. 1
  1111. // number of points in a cluster
  1112. ), this.options.reduce && a.push(0);
  1113. }
  1114. let l = this.trees[r + 1] = this._createTree(a);
  1115. t && console.timeEnd(o);
  1116. for (let i = r; i >= s; i--) {
  1117. const d = +Date.now();
  1118. l = this.trees[i] = this._createTree(this._cluster(l, i)), t && console.log("z%d: %d clusters in %dms", i, l.numItems, +Date.now() - d);
  1119. }
  1120. return t && console.timeEnd("total time"), this;
  1121. }
  1122. getClusters(e, t) {
  1123. let s = ((e[0] + 180) % 360 + 360) % 360 - 180;
  1124. const r = Math.max(-90, Math.min(90, e[1]));
  1125. let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
  1126. const a = Math.max(-90, Math.min(90, e[3]));
  1127. if (e[2] - e[0] >= 360)
  1128. s = -180, o = 180;
  1129. else if (s > o) {
  1130. const c = this.getClusters([s, r, 180, a], t), h = this.getClusters([-180, r, o, a], t);
  1131. return c.concat(h);
  1132. }
  1133. const l = this.trees[this._limitZoom(t)], i = l.range(W(s), K(a), W(o), K(r)), d = l.data, u = [];
  1134. for (const c of i) {
  1135. const h = this.stride * c;
  1136. u.push(d[h + L] > 1 ? ke(d, h, this.clusterProps) : this.points[d[h + S]]);
  1137. }
  1138. return u;
  1139. }
  1140. getChildren(e) {
  1141. const t = this._getOriginId(e), s = this._getOriginZoom(e), r = "No cluster with the specified id.", o = this.trees[s];
  1142. if (!o)
  1143. throw new Error(r);
  1144. const a = o.data;
  1145. if (t * this.stride >= a.length)
  1146. throw new Error(r);
  1147. const l = this.options.radius / (this.options.extent * Math.pow(2, s - 1)), i = a[t * this.stride], d = a[t * this.stride + 1], u = o.within(i, d, l), c = [];
  1148. for (const h of u) {
  1149. const p = h * this.stride;
  1150. a[p + oe] === e && c.push(a[p + L] > 1 ? ke(a, p, this.clusterProps) : this.points[a[p + S]]);
  1151. }
  1152. if (c.length === 0)
  1153. throw new Error(r);
  1154. return c;
  1155. }
  1156. getLeaves(e, t, s) {
  1157. t = t || 10, s = s || 0;
  1158. const r = [];
  1159. return this._appendLeaves(r, e, t, s, 0), r;
  1160. }
  1161. getTile(e, t, s) {
  1162. const r = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: a, radius: l } = this.options, i = l / a, d = (s - i) / o, u = (s + 1 + i) / o, c = {
  1163. features: []
  1164. };
  1165. return this._addTileFeatures(
  1166. r.range((t - i) / o, d, (t + 1 + i) / o, u),
  1167. r.data,
  1168. t,
  1169. s,
  1170. o,
  1171. c
  1172. ), t === 0 && this._addTileFeatures(
  1173. r.range(1 - i / o, d, 1, u),
  1174. r.data,
  1175. o,
  1176. s,
  1177. o,
  1178. c
  1179. ), t === o - 1 && this._addTileFeatures(
  1180. r.range(0, d, i / o, u),
  1181. r.data,
  1182. -1,
  1183. s,
  1184. o,
  1185. c
  1186. ), c.features.length ? c : null;
  1187. }
  1188. getClusterExpansionZoom(e) {
  1189. let t = this._getOriginZoom(e) - 1;
  1190. for (; t <= this.options.maxZoom; ) {
  1191. const s = this.getChildren(e);
  1192. if (t++, s.length !== 1)
  1193. break;
  1194. e = s[0].properties.cluster_id;
  1195. }
  1196. return t;
  1197. }
  1198. _appendLeaves(e, t, s, r, o) {
  1199. const a = this.getChildren(t);
  1200. for (const l of a) {
  1201. const i = l.properties;
  1202. if (i && i.cluster ? o + i.point_count <= r ? o += i.point_count : o = this._appendLeaves(e, i.cluster_id, s, r, o) : o < r ? o++ : e.push(l), e.length === s)
  1203. break;
  1204. }
  1205. return o;
  1206. }
  1207. _createTree(e) {
  1208. const t = new le(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
  1209. for (let s = 0; s < e.length; s += this.stride)
  1210. t.add(e[s], e[s + 1]);
  1211. return t.finish(), t.data = e, t;
  1212. }
  1213. _addTileFeatures(e, t, s, r, o, a) {
  1214. for (const l of e) {
  1215. const i = l * this.stride, d = t[i + L] > 1;
  1216. let u, c, h;
  1217. if (d)
  1218. u = $e(t, i, this.clusterProps), c = t[i], h = t[i + 1];
  1219. else {
  1220. const f = this.points[t[i + S]];
  1221. u = f.properties;
  1222. const [g, v] = f.geometry.coordinates;
  1223. c = W(g), h = K(v);
  1224. }
  1225. const p = {
  1226. type: 1,
  1227. geometry: [[
  1228. Math.round(this.options.extent * (c * o - s)),
  1229. Math.round(this.options.extent * (h * o - r))
  1230. ]],
  1231. tags: u
  1232. };
  1233. let m;
  1234. d || this.options.generateId ? m = t[i + S] : m = this.points[t[i + S]].id, m !== void 0 && (p.id = m), a.features.push(p);
  1235. }
  1236. }
  1237. _limitZoom(e) {
  1238. return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
  1239. }
  1240. _cluster(e, t) {
  1241. const { radius: s, extent: r, reduce: o, minPoints: a } = this.options, l = s / (r * Math.pow(2, t)), i = e.data, d = [], u = this.stride;
  1242. for (let c = 0; c < i.length; c += u) {
  1243. if (i[c + A] <= t)
  1244. continue;
  1245. i[c + A] = t;
  1246. const h = i[c], p = i[c + 1], m = e.within(i[c], i[c + 1], l), f = i[c + L];
  1247. let g = f;
  1248. for (const v of m) {
  1249. const w = v * u;
  1250. i[w + A] > t && (g += i[w + L]);
  1251. }
  1252. if (g > f && g >= a) {
  1253. let v = h * f, w = p * f, _, E = -1;
  1254. const b = ((c / u | 0) << 5) + (t + 1) + this.points.length;
  1255. for (const x of m) {
  1256. const M = x * u;
  1257. if (i[M + A] <= t)
  1258. continue;
  1259. i[M + A] = t;
  1260. const F = i[M + L];
  1261. v += i[M] * F, w += i[M + 1] * F, i[M + oe] = b, o && (_ || (_ = this._map(i, c, !0), E = this.clusterProps.length, this.clusterProps.push(_)), o(_, this._map(i, M)));
  1262. }
  1263. i[c + oe] = b, d.push(v / g, w / g, 1 / 0, b, -1, g), o && d.push(E);
  1264. } else {
  1265. for (let v = 0; v < u; v++)
  1266. d.push(i[c + v]);
  1267. if (g > 1)
  1268. for (const v of m) {
  1269. const w = v * u;
  1270. if (!(i[w + A] <= t)) {
  1271. i[w + A] = t;
  1272. for (let _ = 0; _ < u; _++)
  1273. d.push(i[w + _]);
  1274. }
  1275. }
  1276. }
  1277. }
  1278. return d;
  1279. }
  1280. // get index of the point from which the cluster originated
  1281. _getOriginId(e) {
  1282. return e - this.points.length >> 5;
  1283. }
  1284. // get zoom of the point from which the cluster originated
  1285. _getOriginZoom(e) {
  1286. return (e - this.points.length) % 32;
  1287. }
  1288. _map(e, t, s) {
  1289. if (e[t + L] > 1) {
  1290. const a = this.clusterProps[e[t + Ae]];
  1291. return s ? Object.assign({}, a) : a;
  1292. }
  1293. const r = this.points[e[t + S]].properties, o = this.options.map(r);
  1294. return s && o === r ? Object.assign({}, o) : o;
  1295. }
  1296. }
  1297. function ke(n, e, t) {
  1298. return {
  1299. type: "Feature",
  1300. id: n[e + S],
  1301. properties: $e(n, e, t),
  1302. geometry: {
  1303. type: "Point",
  1304. coordinates: [it(n[e]), at(n[e + 1])]
  1305. }
  1306. };
  1307. }
  1308. function $e(n, e, t) {
  1309. const s = n[e + L], r = s >= 1e4 ? `${Math.round(s / 1e3)}k` : s >= 1e3 ? `${Math.round(s / 100) / 10}k` : s, o = n[e + Ae], a = o === -1 ? {} : Object.assign({}, t[o]);
  1310. return Object.assign(a, {
  1311. cluster: !0,
  1312. cluster_id: n[e + S],
  1313. point_count: s,
  1314. point_count_abbreviated: r
  1315. });
  1316. }
  1317. function W(n) {
  1318. return n / 360 + 0.5;
  1319. }
  1320. function K(n) {
  1321. const e = Math.sin(n * Math.PI / 180), t = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
  1322. return t < 0 ? 0 : t > 1 ? 1 : t;
  1323. }
  1324. function it(n) {
  1325. return (n - 0.5) * 360;
  1326. }
  1327. function at(n) {
  1328. const e = (180 - n * 360) * Math.PI / 180;
  1329. return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
  1330. }
  1331. /*! *****************************************************************************
  1332. Copyright (c) Microsoft Corporation.
  1333. Permission to use, copy, modify, and/or distribute this software for any
  1334. purpose with or without fee is hereby granted.
  1335. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1336. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1337. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1338. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1339. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1340. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1341. PERFORMANCE OF THIS SOFTWARE.
  1342. ***************************************************************************** */
  1343. function ce(n, e) {
  1344. var t = {};
  1345. for (var s in n)
  1346. Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
  1347. if (n != null && typeof Object.getOwnPropertySymbols == "function")
  1348. for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
  1349. e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
  1350. return t;
  1351. }
  1352. class k {
  1353. static isAdvancedMarkerAvailable(e) {
  1354. return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
  1355. }
  1356. static isAdvancedMarker(e) {
  1357. return google.maps.marker && e instanceof google.maps.marker.AdvancedMarkerElement;
  1358. }
  1359. static setMap(e, t) {
  1360. this.isAdvancedMarker(e) ? e.map = t : e.setMap(t);
  1361. }
  1362. static getPosition(e) {
  1363. if (this.isAdvancedMarker(e)) {
  1364. if (e.position) {
  1365. if (e.position instanceof google.maps.LatLng)
  1366. return e.position;
  1367. if (e.position.lat && e.position.lng)
  1368. return new google.maps.LatLng(e.position.lat, e.position.lng);
  1369. }
  1370. return new google.maps.LatLng(null);
  1371. }
  1372. return e.getPosition();
  1373. }
  1374. static getVisible(e) {
  1375. return this.isAdvancedMarker(e) ? !0 : e.getVisible();
  1376. }
  1377. }
  1378. class H {
  1379. constructor({ markers: e, position: t }) {
  1380. this.markers = e, t && (t instanceof google.maps.LatLng ? this._position = t : this._position = new google.maps.LatLng(t));
  1381. }
  1382. get bounds() {
  1383. if (this.markers.length === 0 && !this._position)
  1384. return;
  1385. const e = new google.maps.LatLngBounds(this._position, this._position);
  1386. for (const t of this.markers)
  1387. e.extend(k.getPosition(t));
  1388. return e;
  1389. }
  1390. get position() {
  1391. return this._position || this.bounds.getCenter();
  1392. }
  1393. /**
  1394. * Get the count of **visible** markers.
  1395. */
  1396. get count() {
  1397. return this.markers.filter((e) => k.getVisible(e)).length;
  1398. }
  1399. /**
  1400. * Add a marker to the cluster.
  1401. */
  1402. push(e) {
  1403. this.markers.push(e);
  1404. }
  1405. /**
  1406. * Cleanup references and remove marker from map.
  1407. */
  1408. delete() {
  1409. this.marker && (k.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
  1410. }
  1411. }
  1412. const lt = (n, e, t, s) => {
  1413. const r = Re(n.getBounds(), e, s);
  1414. return t.filter((o) => r.contains(k.getPosition(o)));
  1415. }, Re = (n, e, t) => {
  1416. const { northEast: s, southWest: r } = ct(n, e), o = ut({ northEast: s, southWest: r }, t);
  1417. return dt(o, e);
  1418. }, Ce = (n, e, t) => {
  1419. const s = Re(n, e, t), r = s.getNorthEast(), o = s.getSouthWest();
  1420. return [o.lng(), o.lat(), r.lng(), r.lat()];
  1421. }, ct = (n, e) => ({
  1422. northEast: e.fromLatLngToDivPixel(n.getNorthEast()),
  1423. southWest: e.fromLatLngToDivPixel(n.getSouthWest())
  1424. }), ut = ({ northEast: n, southWest: e }, t) => (n.x += t, n.y -= t, e.x -= t, e.y += t, { northEast: n, southWest: e }), dt = ({ northEast: n, southWest: e }, t) => {
  1425. const s = t.fromDivPixelToLatLng(e), r = t.fromDivPixelToLatLng(n);
  1426. return new google.maps.LatLngBounds(s, r);
  1427. };
  1428. class je {
  1429. constructor({ maxZoom: e = 16 }) {
  1430. this.maxZoom = e;
  1431. }
  1432. /**
  1433. * Helper function to bypass clustering based upon some map state such as
  1434. * zoom, number of markers, etc.
  1435. *
  1436. * ```typescript
  1437. * cluster({markers, map}: AlgorithmInput): Cluster[] {
  1438. * if (shouldBypassClustering(map)) {
  1439. * return this.noop({markers})
  1440. * }
  1441. * }
  1442. * ```
  1443. */
  1444. noop({ markers: e }) {
  1445. return pt(e);
  1446. }
  1447. }
  1448. class ht extends je {
  1449. constructor(e) {
  1450. var { viewportPadding: t = 60 } = e, s = ce(e, ["viewportPadding"]);
  1451. super(s), this.viewportPadding = 60, this.viewportPadding = t;
  1452. }
  1453. calculate({ markers: e, map: t, mapCanvasProjection: s }) {
  1454. return t.getZoom() >= this.maxZoom ? {
  1455. clusters: this.noop({
  1456. markers: e
  1457. }),
  1458. changed: !1
  1459. } : {
  1460. clusters: this.cluster({
  1461. markers: lt(t, s, e, this.viewportPadding),
  1462. map: t,
  1463. mapCanvasProjection: s
  1464. })
  1465. };
  1466. }
  1467. }
  1468. const pt = (n) => n.map((t) => new H({
  1469. position: k.getPosition(t),
  1470. markers: [t]
  1471. }));
  1472. class ft extends je {
  1473. constructor(e) {
  1474. var { maxZoom: t, radius: s = 60 } = e, r = ce(e, ["maxZoom", "radius"]);
  1475. super({ maxZoom: t }), this.state = { zoom: -1 }, this.superCluster = new Te(Object.assign({ maxZoom: this.maxZoom, radius: s }, r));
  1476. }
  1477. calculate(e) {
  1478. let t = !1;
  1479. const s = { zoom: e.map.getZoom() };
  1480. if (!$(e.markers, this.markers)) {
  1481. t = !0, this.markers = [...e.markers];
  1482. const r = this.markers.map((o) => {
  1483. const a = k.getPosition(o);
  1484. return {
  1485. type: "Feature",
  1486. geometry: {
  1487. type: "Point",
  1488. coordinates: [a.lng(), a.lat()]
  1489. },
  1490. properties: { marker: o }
  1491. };
  1492. });
  1493. this.superCluster.load(r);
  1494. }
  1495. return t || (this.state.zoom <= this.maxZoom || s.zoom <= this.maxZoom) && (t = !$(this.state, s)), this.state = s, t && (this.clusters = this.cluster(e)), { clusters: this.clusters, changed: t };
  1496. }
  1497. cluster({ map: e }) {
  1498. return this.superCluster.getClusters([-180, -90, 180, 90], Math.round(e.getZoom())).map((t) => this.transformCluster(t));
  1499. }
  1500. transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
  1501. if (s.cluster)
  1502. return new H({
  1503. markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((o) => o.properties.marker),
  1504. position: { lat: t, lng: e }
  1505. });
  1506. const r = s.marker;
  1507. return new H({
  1508. markers: [r],
  1509. position: k.getPosition(r)
  1510. });
  1511. }
  1512. }
  1513. class mt extends ht {
  1514. constructor(e) {
  1515. var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, o = ce(e, ["maxZoom", "radius", "viewportPadding"]);
  1516. super({ maxZoom: t, viewportPadding: r }), this.superCluster = new Te(Object.assign({ maxZoom: this.maxZoom, radius: s }, o)), this.state = { zoom: -1, view: [0, 0, 0, 0] };
  1517. }
  1518. calculate(e) {
  1519. const t = {
  1520. zoom: Math.round(e.map.getZoom()),
  1521. view: Ce(e.map.getBounds(), e.mapCanvasProjection, this.viewportPadding)
  1522. };
  1523. let s = !$(this.state, t);
  1524. if (!$(e.markers, this.markers)) {
  1525. s = !0, this.markers = [...e.markers];
  1526. const r = this.markers.map((o) => {
  1527. const a = k.getPosition(o);
  1528. return {
  1529. type: "Feature",
  1530. geometry: {
  1531. type: "Point",
  1532. coordinates: [a.lng(), a.lat()]
  1533. },
  1534. properties: { marker: o }
  1535. };
  1536. });
  1537. this.superCluster.load(r);
  1538. }
  1539. return s && (this.clusters = this.cluster(e), this.state = t), { clusters: this.clusters, changed: s };
  1540. }
  1541. cluster({ map: e, mapCanvasProjection: t }) {
  1542. const s = {
  1543. zoom: Math.round(e.getZoom()),
  1544. view: Ce(e.getBounds(), t, this.viewportPadding)
  1545. };
  1546. return this.superCluster.getClusters(s.view, s.zoom).map((r) => this.transformCluster(r));
  1547. }
  1548. transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
  1549. if (s.cluster)
  1550. return new H({
  1551. markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((o) => o.properties.marker),
  1552. position: { lat: t, lng: e }
  1553. });
  1554. const r = s.marker;
  1555. return new H({
  1556. markers: [r],
  1557. position: k.getPosition(r)
  1558. });
  1559. }
  1560. }
  1561. class gt {
  1562. constructor(e, t) {
  1563. this.markers = { sum: e.length };
  1564. const s = t.map((o) => o.count), r = s.reduce((o, a) => o + a, 0);
  1565. this.clusters = {
  1566. count: t.length,
  1567. markers: {
  1568. mean: r / t.length,
  1569. sum: r,
  1570. min: Math.min(...s),
  1571. max: Math.max(...s)
  1572. }
  1573. };
  1574. }
  1575. }
  1576. class vt {
  1577. /**
  1578. * The default render function for the library used by {@link MarkerClusterer}.
  1579. *
  1580. * Currently set to use the following:
  1581. *
  1582. * ```typescript
  1583. * // change color if this cluster has more markers than the mean cluster
  1584. * const color =
  1585. * count > Math.max(10, stats.clusters.markers.mean)
  1586. * ? "#ff0000"
  1587. * : "#0000ff";
  1588. *
  1589. * // create svg url with fill color
  1590. * const svg = window.btoa(`
  1591. * <svg fill="${color}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
  1592. * <circle cx="120" cy="120" opacity=".6" r="70" />
  1593. * <circle cx="120" cy="120" opacity=".3" r="90" />
  1594. * <circle cx="120" cy="120" opacity=".2" r="110" />
  1595. * <circle cx="120" cy="120" opacity=".1" r="130" />
  1596. * </svg>`);
  1597. *
  1598. * // create marker using svg icon
  1599. * return new google.maps.Marker({
  1600. * position,
  1601. * icon: {
  1602. * url: `data:image/svg+xml;base64,${svg}`,
  1603. * scaledSize: new google.maps.Size(45, 45),
  1604. * },
  1605. * label: {
  1606. * text: String(count),
  1607. * color: "rgba(255,255,255,0.9)",
  1608. * fontSize: "12px",
  1609. * },
  1610. * // adjust zIndex to be above other markers
  1611. * zIndex: 1000 + count,
  1612. * });
  1613. * ```
  1614. */
  1615. render({ count: e, position: t }, s, r) {
  1616. const a = `<svg fill="${e > Math.max(10, s.clusters.markers.mean) ? "#ff0000" : "#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
  1617. <circle cx="120" cy="120" opacity=".6" r="70" />
  1618. <circle cx="120" cy="120" opacity=".3" r="90" />
  1619. <circle cx="120" cy="120" opacity=".2" r="110" />
  1620. <text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
  1621. </svg>`, l = `Cluster of ${e} markers`, i = Number(google.maps.Marker.MAX_ZINDEX) + e;
  1622. if (k.isAdvancedMarkerAvailable(r)) {
  1623. const u = document.createElement("div");
  1624. u.innerHTML = a;
  1625. const c = u.firstElementChild;
  1626. c.setAttribute("transform", "translate(0 25)");
  1627. const h = {
  1628. map: r,
  1629. position: t,
  1630. zIndex: i,
  1631. title: l,
  1632. content: c
  1633. };
  1634. return new google.maps.marker.AdvancedMarkerElement(h);
  1635. }
  1636. const d = {
  1637. position: t,
  1638. zIndex: i,
  1639. title: l,
  1640. icon: {
  1641. url: `data:image/svg+xml;base64,${btoa(a)}`,
  1642. anchor: new google.maps.Point(25, 25)
  1643. }
  1644. };
  1645. return new google.maps.Marker(d);
  1646. }
  1647. }
  1648. function yt(n, e) {
  1649. for (let t in e.prototype)
  1650. n.prototype[t] = e.prototype[t];
  1651. }
  1652. class ue {
  1653. constructor() {
  1654. yt(ue, google.maps.OverlayView);
  1655. }
  1656. }
  1657. var j;
  1658. (function(n) {
  1659. n.CLUSTERING_BEGIN = "clusteringbegin", n.CLUSTERING_END = "clusteringend", n.CLUSTER_CLICK = "click";
  1660. })(j || (j = {}));
  1661. const wt = (n, e, t) => {
  1662. t.fitBounds(e.bounds);
  1663. };
  1664. class _t extends ue {
  1665. constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new ft(s), renderer: o = new vt(), onClusterClick: a = wt }) {
  1666. super(), this.markers = [...t], this.clusters = [], this.algorithm = r, this.renderer = o, this.onClusterClick = a, e && this.setMap(e);
  1667. }
  1668. addMarker(e, t) {
  1669. this.markers.includes(e) || (this.markers.push(e), t || this.render());
  1670. }
  1671. addMarkers(e, t) {
  1672. e.forEach((s) => {
  1673. this.addMarker(s, !0);
  1674. }), t || this.render();
  1675. }
  1676. removeMarker(e, t) {
  1677. const s = this.markers.indexOf(e);
  1678. return s === -1 ? !1 : (k.setMap(e, null), this.markers.splice(s, 1), t || this.render(), !0);
  1679. }
  1680. removeMarkers(e, t) {
  1681. let s = !1;
  1682. return e.forEach((r) => {
  1683. s = this.removeMarker(r, !0) || s;
  1684. }), s && !t && this.render(), s;
  1685. }
  1686. clearMarkers(e) {
  1687. this.markers.length = 0, e || this.render();
  1688. }
  1689. /**
  1690. * Recalculates and draws all the marker clusters.
  1691. */
  1692. render() {
  1693. const e = this.getMap();
  1694. if (e instanceof google.maps.Map && e.getProjection()) {
  1695. google.maps.event.trigger(this, j.CLUSTERING_BEGIN, this);
  1696. const { clusters: t, changed: s } = this.algorithm.calculate({
  1697. markers: this.markers,
  1698. map: e,
  1699. mapCanvasProjection: this.getProjection()
  1700. });
  1701. if (s || s == null) {
  1702. const r = /* @__PURE__ */ new Set();
  1703. for (const a of t)
  1704. a.markers.length == 1 && r.add(a.markers[0]);
  1705. const o = [];
  1706. for (const a of this.clusters)
  1707. a.marker != null && (a.markers.length == 1 ? r.has(a.marker) || k.setMap(a.marker, null) : o.push(a.marker));
  1708. this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((a) => k.setMap(a, null)));
  1709. }
  1710. google.maps.event.trigger(this, j.CLUSTERING_END, this);
  1711. }
  1712. }
  1713. onAdd() {
  1714. this.idleListener = this.getMap().addListener("idle", this.render.bind(this)), this.render();
  1715. }
  1716. onRemove() {
  1717. google.maps.event.removeListener(this.idleListener), this.reset();
  1718. }
  1719. reset() {
  1720. this.markers.forEach((e) => k.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
  1721. }
  1722. renderClusters() {
  1723. const e = new gt(this.markers, this.clusters), t = this.getMap();
  1724. this.clusters.forEach((s) => {
  1725. s.markers.length === 1 ? s.marker = s.markers[0] : (s.marker = this.renderer.render(s, e, t), s.markers.forEach((r) => k.setMap(r, null)), this.onClusterClick && s.marker.addListener(
  1726. "click",
  1727. /* istanbul ignore next */
  1728. (r) => {
  1729. google.maps.event.trigger(this, j.CLUSTER_CLICK, s), this.onClusterClick(r, s, t);
  1730. }
  1731. )), k.setMap(s.marker, t);
  1732. });
  1733. }
  1734. }
  1735. const be = Object.values(j), Rt = P({
  1736. name: "MarkerCluster",
  1737. props: {
  1738. options: {
  1739. type: Object,
  1740. default: () => ({})
  1741. }
  1742. },
  1743. emits: be,
  1744. setup(n, { emit: e, expose: t, slots: s }) {
  1745. const r = y(), o = C(Z, y()), a = C(D, y());
  1746. return G(Le, r), O(
  1747. o,
  1748. () => {
  1749. o.value && (r.value = I(
  1750. new _t({
  1751. map: o.value,
  1752. // Better perf than the default `SuperClusterAlgorithm`. See:
  1753. // https://github.com/googlemaps/js-markerclusterer/pull/640
  1754. algorithm: new mt(n.options.algorithmOptions ?? {}),
  1755. ...n.options
  1756. })
  1757. ), be.forEach((l) => {
  1758. var i;
  1759. (i = r.value) == null || i.addListener(l, (d) => e(l, d));
  1760. }));
  1761. },
  1762. {
  1763. immediate: !0
  1764. }
  1765. ), B(() => {
  1766. var l;
  1767. r.value && ((l = a.value) == null || l.event.clearInstanceListeners(r.value), r.value.clearMarkers(), r.value.setMap(null));
  1768. }), t({ markerCluster: r }), () => {
  1769. var l;
  1770. return (l = s.default) == null ? void 0 : l.call(s);
  1771. };
  1772. }
  1773. }), kt = P({
  1774. inheritAttrs: !1,
  1775. props: {
  1776. options: {
  1777. type: Object,
  1778. required: !0
  1779. }
  1780. },
  1781. setup(n, { slots: e, emit: t, expose: s }) {
  1782. const r = y(), o = J(() => {
  1783. var i;
  1784. return (i = e.default) == null ? void 0 : i.call(e).some((d) => d.type !== Ee);
  1785. }), a = J(() => ({
  1786. ...n.options,
  1787. element: r.value
  1788. })), l = U(ee, [], a, t);
  1789. return s({
  1790. customMarker: l
  1791. }), { customMarkerRef: r, customMarker: l, hasSlotContent: o };
  1792. }
  1793. });
  1794. const Ct = {
  1795. key: 0,
  1796. class: "custom-marker-wrapper"
  1797. };
  1798. function bt(n, e, t, s, r, o) {
  1799. return n.hasSlotContent ? (Y(), X("div", Ct, [
  1800. ae("div", Pe({
  1801. ref: "customMarkerRef",
  1802. style: { cursor: n.$attrs.onClick ? "pointer" : void 0 }
  1803. }, n.$attrs), [
  1804. Q(n.$slots, "default", {}, void 0, !0)
  1805. ], 16)
  1806. ])) : Oe("", !0);
  1807. }
  1808. const jt = /* @__PURE__ */ te(kt, [["render", bt], ["__scopeId", "data-v-2d2d343a"]]), qt = P({
  1809. name: "HeatmapLayer",
  1810. props: {
  1811. options: {
  1812. type: Object,
  1813. default: () => ({})
  1814. }
  1815. },
  1816. setup(n) {
  1817. const e = y(), t = C(Z, y()), s = C(D, y());
  1818. return O(
  1819. [t, () => n.options],
  1820. ([r, o], [a, l]) => {
  1821. var d;
  1822. const i = !$(o, l) || t.value !== a;
  1823. if (t.value && s.value && i) {
  1824. const u = structuredClone(o);
  1825. if (u.data && !(u.data instanceof s.value.MVCArray)) {
  1826. const c = s.value.LatLng;
  1827. u.data = (d = u.data) == null ? void 0 : d.map((h) => h instanceof c || "location" in h && (h.location instanceof c || h.location === null) ? h : "location" in h ? { ...h, location: new c(h.location) } : new c(h));
  1828. }
  1829. e.value ? e.value.setOptions(u) : e.value = I(
  1830. new s.value.visualization.HeatmapLayer({
  1831. ...u,
  1832. map: t.value
  1833. })
  1834. );
  1835. }
  1836. },
  1837. { immediate: !0 }
  1838. ), B(() => {
  1839. e.value && e.value.setMap(null);
  1840. }), { heatmapLayer: e };
  1841. },
  1842. render: () => null
  1843. });
  1844. export {
  1845. At as Circle,
  1846. Tt as CustomControl,
  1847. jt as CustomMarker,
  1848. Ot as GoogleMap,
  1849. qt as HeatmapLayer,
  1850. $t as InfoWindow,
  1851. xt as Marker,
  1852. Rt as MarkerCluster,
  1853. St as Polygon,
  1854. Lt as Polyline,
  1855. It as Rectangle
  1856. };