@dcrackel/meyersquaredui
Version:
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
1,636 lines (1,634 loc) • 369 kB
JavaScript
import { openBlock as u, createBlock as E, resolveDynamicComponent as Ae, normalizeClass as C, withCtx as h, renderSlot as Te, createElementBlock as g, resolveComponent as y, createElementVNode as a, createVNode as d, createTextVNode as m, toDisplayString as f, Fragment as I, renderList as L, defineComponent as V, ref as N, provide as ie, watch as J, onMounted as Ge, onBeforeUnmount as se, toRef as $, inject as R, computed as he, markRaw as W, Comment as Xe, normalizeProps as mt, guardReactiveProps as ht, createCommentVNode as w, withModifiers as F, withDirectives as $e, vShow as gt, normalizeStyle as Y, vModelText as pt, createStaticVNode as pe, Transition as ft } from "vue";
const S = (r, e) => {
const t = r.__vccOpts || r;
for (const [i, n] of e)
t[i] = n;
return t;
}, bt = {
name: "BaseText",
props: {
tag: {
type: String,
default: "p",
validator: (r) => ["h1", "h2", "h3", "h4", "h5", "h6", "p", "span", "div", "label"].includes(r)
},
smallSize: {
type: String,
default: null
},
size: {
type: String,
default: "md"
},
color: {
type: String,
default: "primary"
},
hoverColor: {
type: String,
default: null
},
weight: {
type: String,
default: "normal",
validator: (r) => ["thin", "light", "normal", "medium", "semibold", "bold"].includes(r)
},
font: {
type: String,
default: "raleway"
}
},
computed: {
textClasses() {
const r = {
xs: "text-xs",
sm: "text-sm",
md: "text-base",
lg: "text-lg",
xl: "text-xl",
"2xl": "text-2xl",
"3xl": "text-3xl",
"4xl": "text-4xl",
"5xl": "text-5xl",
"6xl": "text-6xl",
"7xl": "text-7xl",
"8xl": "text-8xl",
"9xl": "text-9xl",
"10xl": "text-10xl",
"11xl": "text-11xl",
"12xl": "text-12xl"
}, e = {
thin: "font-thin",
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold"
}, t = this.smallSize && r[this.smallSize] ? r[this.smallSize] : r[this.size] || "", i = this.smallSize && r[this.size] ? `md:${r[this.size]}` : "", n = this.hoverColor ? `hover:text-${this.hoverColor}` : "";
return `${t} ${i} ${e[this.weight]} text-${this.color} ${n} font-${this.font}`;
}
}
};
function yt(r, e, t, i, n, s) {
return u(), E(Ae(t.tag), {
class: C(s.textClasses)
}, {
default: h(() => [
Te(r.$slots, "default")
]),
_: 3
}, 8, ["class"]);
}
const B = /* @__PURE__ */ S(bt, [["render", yt]]), xt = {
name: "Icon",
props: {
icon: {
type: String,
required: !0
},
color: {
type: String,
default: "primary",
validator: (r) => ["primary", "secondary", "accent", "lineGrey"].includes(r)
},
size: {
type: String,
default: "md",
validator: (r) => ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl"].includes(r)
},
type: {
type: String,
default: "fa-solid",
validator: (r) => ["fa-thin", "fa-sharp", "fa-kit", "fa-brands", "fa-solid", "fa-regular"].includes(r)
}
},
computed: {
colorClasses() {
return {
primary: "text-primary",
secondary: "text-secondary",
accent: "text-accent",
lineGrey: "text-lineGrey"
}[this.color] || "text-primary";
},
sizeClasses() {
return {
xs: "text-xs",
sm: "text-sm",
md: "text-base",
lg: "text-lg",
xl: "text-xl",
"2xl": "text-2xl",
"3xl": "text-3xl",
"4xl": "text-4xl",
"5xl": "text-5xl"
}[this.size] || "text-base";
}
}
};
function wt(r, e, t, i, n, s) {
return u(), g("i", {
class: C([t.type, t.icon, s.colorClasses, s.sizeClasses]),
onClick: e[0] || (e[0] = (o) => r.$emit("click"))
}, null, 2);
}
const M = /* @__PURE__ */ S(xt, [["render", wt]]), vt = {
name: "BaseButton",
components: {
BaseText: B,
Icon: M
},
props: {
label: {
type: String,
required: !0
},
altText: {
type: String,
default: null
},
size: {
type: String,
default: "sm"
},
weight: {
type: String,
default: "normal"
},
color: {
type: String,
default: "primary",
validator: (r) => ["primary", "secondary", "accent", "white"].includes(r)
},
hoverColor: {
type: String,
default: null,
validator: (r) => r === null || ["primary", "secondary", "accent"].includes(r)
},
backgroundColor: {
type: String,
default: "primary",
validator: (r) => ["primary", "secondary", "accent"].includes(r)
},
border: {
type: String,
default: "none",
validator: (r) => ["none", "primary", "secondary", "accent", "gradient1", "gradient2"].includes(r)
},
padding: {
type: String,
default: "px-4 py-2"
},
iconName: {
type: String,
default: ""
},
iconColor: {
type: String,
default: "primary",
validator: (r) => ["primary", "secondary", "accent"].includes(r)
},
iconSize: {
control: { type: "select", options: ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"] },
description: "Icon size"
},
iconType: {
type: String,
default: "fa-solid",
validator: (r) => ["fa-brands", "fa-solid", "fa-thin", "fa-sharp"].includes(r)
},
align: {
type: String,
default: "center",
validator: (r) => ["left", "center", "right", "between"].includes(r)
}
},
computed: {
paddingClass() {
return this.padding;
},
backgroundClass() {
return {
primary: "bg-primary hover:bg-accent text-secondary hover:text-secondary",
secondary: "bg-secondary hover:bg-primary text-primary hover:text-secondary",
accent: "bg-accent hover:bg-accent hover:text-secondary",
white: "bg-white hover:bg-accent text-primary hover:text-secondary"
}[this.backgroundColor] || "bg-primary";
},
borderClass() {
return {
none: "",
primary: "border border-primary",
secondary: "border border-secondary",
accent: "border border-accent",
gradient1: "border-gradient-rounded-1",
gradient2: "border-gradient-rounded-2"
}[this.border] || "";
},
alignmentClass() {
return {
left: "justify-start",
center: "justify-center",
right: "justify-end",
between: "justify-between"
}[this.align] || "justify-center";
}
}
}, Ct = ["title", "aria-label"];
function St(r, e, t, i, n, s) {
const o = y("BaseText"), c = y("Icon");
return u(), g("button", {
class: C([
"rounded-md transition duration-300 ease-in-out",
s.paddingClass,
s.backgroundClass,
s.borderClass
]),
title: t.altText || t.label,
"aria-label": t.altText || t.label,
onClick: e[0] || (e[0] = (l) => r.$emit("buttonClick"))
}, [
a("div", {
class: C(["flex items-center", s.alignmentClass, "space-x-2"])
}, [
d(o, {
tag: "span",
color: "",
size: t.size,
weight: t.weight
}, {
default: h(() => [
m(f(t.label), 1)
]),
_: 1
}, 8, ["size", "weight"]),
d(c, {
icon: t.iconName,
color: t.iconColor,
size: t.iconSize,
type: t.iconType
}, null, 8, ["icon", "color", "size", "type"])
], 2)
], 10, Ct);
}
const H = /* @__PURE__ */ S(vt, [["render", St]]), At = {
name: "InputField",
props: {
type: {
type: String,
default: "text"
},
placeholder: {
type: String,
default: "Search"
},
modelValue: {
type: String,
default: ""
},
color: {
type: String,
default: "primary",
validator: (r) => ["primary", "secondary"].includes(r)
},
textSize: {
type: String,
default: "text-md",
validator: (r) => ["text-sm", "text-md", "text-lg", "text-xl", "text-2xl"].includes(r)
}
},
computed: {
inputClass() {
const r = "w-full border-b-2 focus:outline-none focus:border-accent px-2 hover:border-accent duration-300 ease-in-out", e = this.color === "primary" ? "bg-primary text-secondary border-secondary placeholder-secondary" : "bg-white text-primary border-secondary placeholder-primary", t = this.textSize;
return `${r} ${e} ${t}`;
}
}
}, kt = ["type", "placeholder", "value"];
function Tt(r, e, t, i, n, s) {
return u(), g("input", {
type: t.type,
placeholder: t.placeholder,
value: t.modelValue,
class: C([s.inputClass]),
onInput: e[0] || (e[0] = (o) => r.$emit("update:modelValue", o.target.value))
}, null, 42, kt);
}
const xe = /* @__PURE__ */ S(At, [["render", Tt]]), Bt = {
name: "SearchBox",
components: {
InputField: xe,
Icon: M
},
props: {
textSize: {
type: String,
default: "text-md"
},
iconSize: {
type: String,
default: "md"
},
inputColor: {
type: String,
default: "primary"
},
iconColor: {
type: String,
default: "secondary"
}
},
data() {
return {
searchQuery: ""
};
},
methods: {
onSearch() {
this.$emit("search", this.searchQuery);
}
}
}, _t = { class: "relative flex items-center w-full max-w-md" };
function It(r, e, t, i, n, s) {
const o = y("InputField"), c = y("Icon");
return u(), g("div", _t, [
d(o, {
modelValue: n.searchQuery,
"onUpdate:modelValue": e[0] || (e[0] = (l) => n.searchQuery = l),
"text-size": t.textSize,
placeholder: "Search",
color: t.inputColor
}, null, 8, ["modelValue", "text-size", "color"]),
d(c, {
icon: "fa-search",
color: t.iconColor,
size: t.iconSize,
class: "absolute right-2",
onClick: s.onSearch
}, null, 8, ["color", "size", "onClick"])
]);
}
const et = /* @__PURE__ */ S(Bt, [["render", It]]), Et = {
name: "Calendar",
components: { BaseText: B },
props: {
tournaments: {
type: Array,
default: () => []
}
},
data() {
return {
currentMonth: (/* @__PURE__ */ new Date()).getMonth(),
currentYear: (/* @__PURE__ */ new Date()).getFullYear(),
weekdays: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
};
},
computed: {
daysInMonth() {
const r = new Date(this.currentYear, this.currentMonth + 1, 0).getDate();
return Array.from({ length: r }, (e, t) => t + 1);
},
startDay() {
const r = new Date(this.currentYear, this.currentMonth, 1).getDay();
return r === 0 ? 6 : r - 1;
},
monthYear() {
return new Date(this.currentYear, this.currentMonth).toLocaleString("default", { month: "long", year: "numeric" });
}
},
methods: {
hasTournament(r) {
const e = `${this.currentYear}-${String(this.currentMonth + 1).padStart(2, "0")}-${String(r).padStart(2, "0")}`;
return this.tournaments.some((t) => t.date === e);
},
dayClicked(r) {
if (this.hasTournament(r)) {
const e = `${this.currentYear}-${String(this.currentMonth + 1).padStart(2, "0")}-${String(r).padStart(2, "0")}`;
this.$emit("date-select", e);
}
},
prevMonth() {
this.currentMonth === 0 ? (this.currentMonth = 11, this.currentYear--) : this.currentMonth--;
},
nextMonth() {
this.currentMonth === 11 ? (this.currentMonth = 0, this.currentYear++) : this.currentMonth++;
}
}
}, zt = { class: "w-80 h-80 p-6 bg-primary rounded-lg shadow-md" }, Lt = { class: "flex justify-between items-center mb-4" }, Nt = { class: "grid grid-cols-7 gap-1 text-center font-bold text-sm text-gray-600 mb-2" }, Pt = { class: "grid grid-cols-7 gap-1 text-center" }, jt = ["onClick"];
function Mt(r, e, t, i, n, s) {
const o = y("BaseText");
return u(), g("div", zt, [
a("div", Lt, [
d(o, {
tag: "h2",
size: "sm",
weight: "normal",
color: "secondary"
}, {
default: h(() => [
m(f(s.monthYear), 1)
]),
_: 1
}),
a("div", null, [
a("button", {
onClick: e[0] || (e[0] = (...c) => s.prevMonth && s.prevMonth(...c)),
class: "text-secondary hover:text-accent mr-4"
}, " < "),
a("button", {
onClick: e[1] || (e[1] = (...c) => s.nextMonth && s.nextMonth(...c)),
class: "text-secondary hover:text-accent"
}, " > ")
])
]),
a("div", Nt, [
(u(!0), g(I, null, L(n.weekdays, (c) => (u(), g("div", { key: c }, [
d(o, {
tag: "p",
size: "xs",
weight: "bold",
color: "secondary"
}, {
default: h(() => [
m(f(c), 1)
]),
_: 2
}, 1024)
]))), 128))
]),
a("div", Pt, [
(u(!0), g(I, null, L(s.startDay, (c) => (u(), g("div", {
key: "empty-" + c
}))), 128)),
(u(!0), g(I, null, L(s.daysInMonth, (c, l) => (u(), g("div", {
key: "day-" + c,
onClick: (p) => s.dayClicked(c),
class: C(["flex justify-center items-center cursor-pointer p-2 rounded-full", {
"bg-accent text-white": s.hasTournament(c),
"hover:bg-gray-200": s.hasTournament(c),
"text-gray-400": !s.hasTournament(c)
}])
}, [
d(o, {
tag: "p",
size: "xs",
weight: "thin",
color: "secondary"
}, {
default: h(() => [
m(f(c), 1)
]),
_: 2
}, 1024)
], 10, jt))), 128))
])
]);
}
const Ku = /* @__PURE__ */ S(Et, [["render", Mt]]);
(function() {
try {
if (typeof document < "u") {
var r = document.createElement("style");
r.appendChild(document.createTextNode(".mapdiv[data-v-d05fc6bc]{width:100%;height:100%}.custom-control-wrapper[data-v-d099a3a6]{display:none}.mapdiv .custom-control-wrapper[data-v-d099a3a6]{display:inline-block}.info-window-wrapper[data-v-cbe1707b]{display:none}.mapdiv .info-window-wrapper[data-v-cbe1707b]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")), document.head.appendChild(r);
}
} catch (e) {
console.error("vite-plugin-css-injected-by-js", e);
}
})();
var Ot = Object.defineProperty, Rt = (r, e, t) => e in r ? Ot(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Ne = (r, e, t) => (Rt(r, typeof e != "symbol" ? e + "" : e, t), t);
const oe = Symbol("map"), ne = Symbol("api"), Be = Symbol("marker"), _e = Symbol("markerCluster"), we = Symbol("CustomMarker"), tt = Symbol("mapTilesLoaded"), de = [
"click",
"dblclick",
"drag",
"dragend",
"dragstart",
"mousedown",
"mousemove",
"mouseout",
"mouseover",
"mouseup",
"rightclick"
];
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function Dt(r, e, t, i) {
function n(s) {
return s instanceof t ? s : new t(function(o) {
o(s);
});
}
return new (t || (t = Promise))(function(s, o) {
function c(b) {
try {
p(i.next(b));
} catch (x) {
o(x);
}
}
function l(b) {
try {
p(i.throw(b));
} catch (x) {
o(x);
}
}
function p(b) {
b.done ? s(b.value) : n(b.value).then(c, l);
}
p((i = i.apply(r, [])).next());
});
}
var qt = function r(e, t) {
if (e === t)
return !0;
if (e && t && typeof e == "object" && typeof t == "object") {
if (e.constructor !== t.constructor)
return !1;
var i, n, s;
if (Array.isArray(e)) {
if (i = e.length, i != t.length)
return !1;
for (n = i; n-- !== 0; )
if (!r(e[n], t[n]))
return !1;
return !0;
}
if (e.constructor === RegExp)
return e.source === t.source && e.flags === t.flags;
if (e.valueOf !== Object.prototype.valueOf)
return e.valueOf() === t.valueOf();
if (e.toString !== Object.prototype.toString)
return e.toString() === t.toString();
if (s = Object.keys(e), i = s.length, i !== Object.keys(t).length)
return !1;
for (n = i; n-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(t, s[n]))
return !1;
for (n = i; n-- !== 0; ) {
var o = s[n];
if (!r(e[o], t[o]))
return !1;
}
return !0;
}
return e !== e && t !== t;
};
const Pe = "__googleMapsScriptId";
var ae;
(function(r) {
r[r.INITIALIZED = 0] = "INITIALIZED", r[r.LOADING = 1] = "LOADING", r[r.SUCCESS = 2] = "SUCCESS", r[r.FAILURE = 3] = "FAILURE";
})(ae || (ae = {}));
class te {
/**
* Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
* using this library, instead the defaults are set by the Google Maps
* JavaScript API server.
*
* ```
* const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
* ```
*/
constructor({ apiKey: e, authReferrerPolicy: t, channel: i, client: n, id: s = Pe, language: o, libraries: c = [], mapIds: l, nonce: p, region: b, retries: x = 3, url: v = "https://maps.googleapis.com/maps/api/js", version: k }) {
if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = i, this.client = n, this.id = s || Pe, this.language = o, this.libraries = c, this.mapIds = l, this.nonce = p, this.region = b, this.retries = x, this.url = v, this.version = k, te.instance) {
if (!qt(this.options, te.instance.options))
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(te.instance.options)}`);
return te.instance;
}
te.instance = this;
}
get options() {
return {
version: this.version,
apiKey: this.apiKey,
channel: this.channel,
client: this.client,
id: this.id,
libraries: this.libraries,
language: this.language,
region: this.region,
mapIds: this.mapIds,
nonce: this.nonce,
url: this.url,
authReferrerPolicy: this.authReferrerPolicy
};
}
get status() {
return this.errors.length ? ae.FAILURE : this.done ? ae.SUCCESS : this.loading ? ae.LOADING : ae.INITIALIZED;
}
get failed() {
return this.done && !this.loading && this.errors.length >= this.retries + 1;
}
/**
* CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
*
* @ignore
* @deprecated
*/
createUrl() {
let e = this.url;
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 += `®ion=${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;
}
deleteScript() {
const e = document.getElementById(this.id);
e && e.remove();
}
/**
* Load the Google Maps JavaScript API script and return a Promise.
* @deprecated, use importLibrary() instead.
*/
load() {
return this.loadPromise();
}
/**
* Load the Google Maps JavaScript API script and return a Promise.
*
* @ignore
* @deprecated, use importLibrary() instead.
*/
loadPromise() {
return new Promise((e, t) => {
this.loadCallback((i) => {
i ? t(i.error) : e(window.google);
});
});
}
importLibrary(e) {
return this.execute(), google.maps.importLibrary(e);
}
/**
* Load the Google Maps JavaScript API script with a callback.
* @deprecated, use importLibrary() instead.
*/
loadCallback(e) {
this.callbacks.push(e), this.execute();
}
/**
* Set the script on document.
*/
setScript() {
var e, t;
if (document.getElementById(this.id)) {
this.callback();
return;
}
const i = {
key: this.apiKey,
channel: this.channel,
client: this.client,
libraries: this.libraries.length && this.libraries,
v: this.version,
mapIds: this.mapIds,
language: this.language,
region: this.region,
authReferrerPolicy: this.authReferrerPolicy
};
Object.keys(i).forEach(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(s) => !i[s] && delete i[s]
), !((t = (e = window == null ? void 0 : window.google) === null || e === void 0 ? void 0 : e.maps) === null || t === void 0) && t.importLibrary || ((s) => {
let o, c, l, p = "The Google Maps JavaScript API", b = "google", x = "importLibrary", v = "__ib__", k = document, A = window;
A = A[b] || (A[b] = {});
const T = A.maps || (A.maps = {}), _ = /* @__PURE__ */ new Set(), z = new URLSearchParams(), P = () => (
// @ts-ignore
o || (o = new Promise((j, U) => Dt(this, void 0, void 0, function* () {
var D;
yield c = k.createElement("script"), c.id = this.id, z.set("libraries", [..._] + "");
for (l in s)
z.set(l.replace(/[A-Z]/g, (Q) => "_" + Q[0].toLowerCase()), s[l]);
z.set("callback", b + ".maps." + v), c.src = this.url + "?" + z, T[v] = j, c.onerror = () => o = U(Error(p + " could not load.")), c.nonce = this.nonce || ((D = k.querySelector("script[nonce]")) === null || D === void 0 ? void 0 : D.nonce) || "", k.head.append(c);
})))
);
T[x] ? console.warn(p + " only loads once. Ignoring:", s) : T[x] = (j, ...U) => _.add(j) && P().then(() => T[x](j, ...U));
})(i);
const n = this.libraries.map((s) => this.importLibrary(s));
n.length || n.push(this.importLibrary("core")), Promise.all(n).then(() => this.callback(), (s) => {
const o = new ErrorEvent("error", { error: s });
this.loadErrorCallback(o);
});
}
/**
* Reset the loader state.
*/
reset() {
this.deleteScript(), this.done = !1, this.loading = !1, this.errors = [], this.onerrorEvent = null;
}
resetIfRetryingFailed() {
this.failed && this.reset();
}
loadErrorCallback(e) {
if (this.errors.push(e), this.errors.length <= this.retries) {
const t = this.errors.length * Math.pow(2, this.errors.length);
console.error(`Failed to load Google Maps script, retrying in ${t} ms.`), setTimeout(() => {
this.deleteScript(), this.setScript();
}, t);
} else
this.onerrorEvent = e, this.callback();
}
callback() {
this.done = !0, this.loading = !1, this.callbacks.forEach((e) => {
e(this.onerrorEvent);
}), this.callbacks = [];
}
execute() {
if (this.resetIfRetryingFailed(), this.done)
this.callback();
else {
if (window.google && window.google.maps && window.google.maps.version) {
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();
return;
}
this.loading || (this.loading = !0, this.setScript());
}
}
}
function Ft(r) {
return class extends r.OverlayView {
constructor(e) {
super(), Ne(this, "element"), Ne(this, "opts");
const { element: t, ...i } = e;
this.element = t, this.opts = i, this.opts.map && this.setMap(this.opts.map);
}
getPosition() {
return this.opts.position ? this.opts.position instanceof r.LatLng ? this.opts.position : new r.LatLng(this.opts.position) : null;
}
getVisible() {
if (!this.element)
return !1;
const e = this.element;
return e.style.display !== "none" && e.style.visibility !== "hidden" && (e.style.opacity === "" || Number(e.style.opacity) > 0.01);
}
onAdd() {
if (!this.element)
return;
const e = this.getPanes();
e && e.overlayMouseTarget.appendChild(this.element);
}
draw() {
if (!this.element)
return;
const e = this.getProjection(), t = e == null ? void 0 : e.fromLatLngToDivPixel(this.getPosition());
if (t) {
this.element.style.position = "absolute";
const i = this.element.offsetHeight, n = this.element.offsetWidth;
let s, o;
switch (this.opts.anchorPoint) {
case "TOP_CENTER":
s = t.x - n / 2, o = t.y;
break;
case "BOTTOM_CENTER":
s = t.x - n / 2, o = t.y - i;
break;
case "LEFT_CENTER":
s = t.x, o = t.y - i / 2;
break;
case "RIGHT_CENTER":
s = t.x - n, o = t.y - i / 2;
break;
case "TOP_LEFT":
s = t.x, o = t.y;
break;
case "TOP_RIGHT":
s = t.x - n, o = t.y;
break;
case "BOTTOM_LEFT":
s = t.x, o = t.y - i;
break;
case "BOTTOM_RIGHT":
s = t.x - n, o = t.y - i;
break;
default:
s = t.x - n / 2, o = t.y - i / 2;
}
this.element.style.left = s + "px", this.element.style.top = o + "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());
}
}
onRemove() {
this.element && this.element.remove();
}
setOptions(e) {
const { element: t, ...i } = e;
this.element = t, this.opts = i, this.draw();
}
};
}
let je;
const Me = [
"bounds_changed",
"center_changed",
"click",
"contextmenu",
"dblclick",
"drag",
"dragend",
"dragstart",
"heading_changed",
"idle",
"isfractionalzoomenabled_changed",
"mapcapabilities_changed",
"maptypeid_changed",
"mousemove",
"mouseout",
"mouseover",
"projection_changed",
"renderingtype_changed",
"rightclick",
"tilesloaded",
"tilt_changed",
"zoom_changed"
], Ut = V({
props: {
apiPromise: {
type: Promise
},
apiKey: {
type: String,
default: ""
},
version: {
type: String,
default: "weekly"
},
libraries: {
type: Array,
default: () => ["places", "marker"]
},
region: {
type: String,
required: !1
},
language: {
type: String,
required: !1
},
backgroundColor: {
type: String,
required: !1
},
center: {
type: Object,
default: () => ({ lat: 0, lng: 0 })
},
clickableIcons: {
type: Boolean,
required: !1,
default: void 0
},
controlSize: {
type: Number,
required: !1
},
disableDefaultUi: {
type: Boolean,
required: !1,
default: void 0
},
disableDoubleClickZoom: {
type: Boolean,
required: !1,
default: void 0
},
draggable: {
type: Boolean,
required: !1,
default: void 0
},
draggableCursor: {
type: String,
required: !1
},
draggingCursor: {
type: String,
required: !1
},
fullscreenControl: {
type: Boolean,
required: !1,
default: void 0
},
fullscreenControlPosition: {
type: String,
required: !1
},
gestureHandling: {
type: String,
required: !1
},
heading: {
type: Number,
required: !1
},
isFractionalZoomEnabled: {
type: Boolean,
required: !1,
default: void 0
},
keyboardShortcuts: {
type: Boolean,
required: !1,
default: void 0
},
mapTypeControl: {
type: Boolean,
required: !1,
default: void 0
},
mapTypeControlOptions: {
type: Object,
required: !1
},
mapTypeId: {
type: [Number, String],
required: !1
},
mapId: {
type: String,
required: !1
},
maxZoom: {
type: Number,
required: !1
},
minZoom: {
type: Number,
required: !1
},
noClear: {
type: Boolean,
required: !1,
default: void 0
},
panControl: {
type: Boolean,
required: !1,
default: void 0
},
panControlPosition: {
type: String,
required: !1
},
restriction: {
type: Object,
required: !1
},
rotateControl: {
type: Boolean,
required: !1,
default: void 0
},
rotateControlPosition: {
type: String,
required: !1
},
scaleControl: {
type: Boolean,
required: !1,
default: void 0
},
scaleControlStyle: {
type: Number,
required: !1
},
scrollwheel: {
type: Boolean,
required: !1,
default: void 0
},
streetView: {
type: Object,
required: !1
},
streetViewControl: {
type: Boolean,
required: !1,
default: void 0
},
streetViewControlPosition: {
type: String,
required: !1
},
styles: {
type: Array,
required: !1
},
tilt: {
type: Number,
required: !1
},
zoom: {
type: Number,
required: !1
},
zoomControl: {
type: Boolean,
required: !1,
default: void 0
},
zoomControlPosition: {
type: String,
required: !1
},
nonce: {
type: String,
default: ""
}
},
emits: Me,
setup(r, { emit: e }) {
const t = N(), i = N(!1), n = N(), s = N(), o = N(!1);
ie(oe, n), ie(ne, s), ie(tt, o);
const c = () => {
const x = { ...r };
Object.keys(x).forEach((A) => {
x[A] === void 0 && delete x[A];
});
const v = (A) => {
var T;
return A ? { position: (T = s.value) == null ? void 0 : T.ControlPosition[A] } : {};
}, k = {
scaleControlOptions: r.scaleControlStyle ? { style: r.scaleControlStyle } : {},
panControlOptions: v(r.panControlPosition),
zoomControlOptions: v(r.zoomControlPosition),
rotateControlOptions: v(r.rotateControlPosition),
streetViewControlOptions: v(r.streetViewControlPosition),
fullscreenControlOptions: v(r.fullscreenControlPosition),
disableDefaultUI: r.disableDefaultUi
};
return { ...x, ...k };
}, l = J(
[s, n],
([x, v]) => {
const k = x, A = v;
k && A && (k.event.addListenerOnce(A, "tilesloaded", () => {
o.value = !0;
}), setTimeout(l, 0));
},
{ immediate: !0 }
), p = () => {
try {
const { apiKey: x, region: v, version: k, language: A, libraries: T, nonce: _ } = r;
je = new te({ apiKey: x, region: v, version: k, language: A, libraries: T, nonce: _ });
} catch (x) {
console.error(x);
}
}, b = (x) => {
s.value = W(x.maps), n.value = W(new x.maps.Map(t.value, c()));
const v = Ft(s.value);
s.value[we] = v, Me.forEach((A) => {
var T;
(T = n.value) == null || T.addListener(A, (_) => e(A, _));
}), i.value = !0;
const k = Object.keys(r).filter(
(A) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom", "nonce"].includes(A)
).map((A) => $(r, A));
J(
[() => r.center, () => r.zoom, ...k],
([A, T], [_, z]) => {
var P, j, U;
const { center: D, zoom: Q, ...q } = c();
(P = n.value) == null || P.setOptions(q), T !== void 0 && T !== z && ((j = n.value) == null || j.setZoom(T));
const fe = !_ || A.lng !== _.lng || A.lat !== _.lat;
A && fe && ((U = n.value) == null || U.panTo(A));
}
);
};
return Ge(() => {
r.apiPromise && r.apiPromise instanceof Promise ? r.apiPromise.then(b) : (p(), je.load().then(b));
}), se(() => {
var x;
o.value = !1, n.value && ((x = s.value) == null || x.event.clearInstanceListeners(n.value));
}), { mapRef: t, ready: i, map: n, api: s, mapTilesLoaded: o };
}
}), Qt = (r, e) => {
const t = r.__vccOpts || r;
for (const [i, n] of e)
t[i] = n;
return t;
}, Vt = {
ref: "mapRef",
class: "mapdiv"
};
function Ht(r, e, t, i, n, s) {
return u(), g("div", null, [
a("div", Vt, null, 512),
Te(r.$slots, "default", mt(ht({ ready: r.ready, map: r.map, api: r.api, mapTilesLoaded: r.mapTilesLoaded })), void 0, !0)
]);
}
const Jt = /* @__PURE__ */ Qt(Ut, [["render", Ht], ["__scopeId", "data-v-d05fc6bc"]]);
function Wt(r) {
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
}
var Kt = function r(e, t) {
if (e === t)
return !0;
if (e && t && typeof e == "object" && typeof t == "object") {
if (e.constructor !== t.constructor)
return !1;
var i, n, s;
if (Array.isArray(e)) {
if (i = e.length, i != t.length)
return !1;
for (n = i; n-- !== 0; )
if (!r(e[n], t[n]))
return !1;
return !0;
}
if (e.constructor === RegExp)
return e.source === t.source && e.flags === t.flags;
if (e.valueOf !== Object.prototype.valueOf)
return e.valueOf() === t.valueOf();
if (e.toString !== Object.prototype.toString)
return e.toString() === t.toString();
if (s = Object.keys(e), i = s.length, i !== Object.keys(t).length)
return !1;
for (n = i; n-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(t, s[n]))
return !1;
for (n = i; n-- !== 0; ) {
var o = s[n];
if (!r(e[o], t[o]))
return !1;
}
return !0;
}
return e !== e && t !== t;
};
const Z = /* @__PURE__ */ Wt(Kt), Oe = ["click", "drag", "dragend", "dragstart", "gmp-click"], Yt = V({
name: "AdvancedMarker",
props: {
options: {
type: Object,
required: !0
},
pinOptions: {
type: Object,
required: !1
}
},
emits: Oe,
setup(r, { emit: e, expose: t, slots: i }) {
const n = $(r, "options"), s = $(r, "pinOptions"), o = N(), c = R(oe, N()), l = R(ne, N()), p = R(_e, N()), b = he(
() => !!(p.value && l.value && o.value instanceof google.maps.marker.AdvancedMarkerElement)
);
return J(
[c, n, s],
async (x, [v, k, A]) => {
var T, _, z;
const P = !Z(n.value, k) || !Z(s.value, A) || c.value !== v;
if (!c.value || !l.value || !P)
return;
const { AdvancedMarkerElement: j, PinElement: U } = l.value.marker;
if (o.value) {
const { map: D, content: Q, ...q } = n.value;
Object.assign(o.value, {
content: s.value ? new U(s.value).element : Q,
...q
}), b.value && ((T = p.value) == null || T.removeMarker(o.value), (_ = p.value) == null || _.addMarker(o.value));
} else
s.value && (n.value.content = new U(s.value).element), o.value = W(new j(n.value)), b.value ? (z = p.value) == null || z.addMarker(o.value) : o.value.map = c.value, Oe.forEach((D) => {
var Q;
(Q = o.value) == null || Q.addListener(D, (q) => e(D, q));
});
},
{
immediate: !0
}
), se(() => {
var x, v;
o.value && ((x = l.value) == null || x.event.clearInstanceListeners(o.value), b.value ? (v = p.value) == null || v.removeMarker(o.value) : o.value.map = null);
}), ie(Be, o), t({ marker: o }), () => {
var x;
return (x = i.default) == null ? void 0 : x.call(i);
};
}
}), Zt = (r) => r === "Marker", Gt = (r) => r === we, ce = (r, e, t, i) => {
const n = N(), s = R(oe, N()), o = R(ne, N()), c = R(_e, N()), l = he(
() => !!(c.value && o.value && (n.value instanceof o.value.Marker || n.value instanceof o.value[we]))
);
return J(
[s, t],
(p, [b, x]) => {
var v, k, A;
const T = !Z(t.value, x) || s.value !== b;
!s.value || !o.value || !T || (n.value ? (n.value.setOptions(t.value), l.value && ((v = c.value) == null || v.removeMarker(n.value), (k = c.value) == null || k.addMarker(n.value))) : (Zt(r) ? n.value = W(
new o.value[r](t.value)
) : Gt(r) ? n.value = W(
new o.value[r](t.value)
) : n.value = W(
new o.value[r]({
...t.value,
map: s.value
})
), l.value ? (A = c.value) == null || A.addMarker(n.value) : n.value.setMap(s.value), e.forEach((_) => {
var z;
(z = n.value) == null || z.addListener(_, (P) => i(_, P));
})));
},
{
immediate: !0
}
), se(() => {
var p, b;
n.value && ((p = o.value) == null || p.event.clearInstanceListeners(n.value), l.value ? (b = c.value) == null || b.removeMarker(n.value) : n.value.setMap(null));
}), n;
}, Re = [
"animation_changed",
"click",
"dblclick",
"rightclick",
"dragstart",
"dragend",
"drag",
"mouseover",
"mousedown",
"mouseout",
"mouseup",
"draggable_changed",
"clickable_changed",
"contextmenu",
"cursor_changed",
"flat_changed",
"rightclick",
"zindex_changed",
"icon_changed",
"position_changed",
"shape_changed",
"title_changed",
"visible_changed"
];
V({
name: "Marker",
props: {
options: {
type: Object,
required: !0
}
},
emits: Re,
setup(r, { emit: e, expose: t, slots: i }) {
const n = $(r, "options"), s = ce("Marker", Re, n, e);
return ie(Be, s), t({ marker: s }), () => {
var o;
return (o = i.default) == null ? void 0 : o.call(i);
};
}
});
V({
name: "Polyline",
props: {
options: {
type: Object,
required: !0
}
},
emits: de,
setup(r, { emit: e }) {
const t = $(r, "options");
return { polyline: ce("Polyline", de, t, e) };
},
render: () => null
});
V({
name: "Polygon",
props: {
options: {
type: Object,
required: !0
}
},
emits: de,
setup(r, { emit: e }) {
const t = $(r, "options");
return { polygon: ce("Polygon", de, t, e) };
},
render: () => null
});
const De = de.concat(["bounds_changed"]);
V({
name: "Rectangle",
props: {
options: {
type: Object,
required: !0
}
},
emits: De,
setup(r, { emit: e }) {
const t = $(r, "options");
return { rectangle: ce("Rectangle", De, t, e) };
},
render: () => null
});
const qe = de.concat(["center_changed", "radius_changed"]);
V({
name: "Circle",
props: {
options: {
type: Object,
required: !0
}
},
emits: qe,
setup(r, { emit: e }) {
const t = $(r, "options");
return { circle: ce("Circle", qe, t, e) };
},
render: () => null
});
V({
props: {
position: {
type: String,
required: !0
},
index: {
type: Number,
default: 1
}
},
emits: ["content:loaded"],
setup(r, { emit: e }) {
const t = N(null), i = R(oe, N()), n = R(ne, N()), s = R(tt, N(!1)), o = J(
[s, n, t],
([p, b, x]) => {
b && p && x && (c(r.position), e("content:loaded"), setTimeout(o, 0));
},
{ immediate: !0 }
), c = (p) => {
if (i.value && n.value && t.value) {
const b = n.value.ControlPosition[p];
i.value.controls[b].push(t.value);
}
}, l = (p) => {
if (i.value && n.value) {
let b = null;
const x = n.value.ControlPosition[p];
i.value.controls[x].forEach((v, k) => {
v === t.value && (b = k);
}), b !== null && i.value.controls[x].removeAt(b);
}
};
return se(() => l(r.position)), J(
() => r.position,
(p, b) => {
l(b), c(p);
}
), J(
() => r.index,
(p) => {
p && t.value && (t.value.index = r.index);
}
), { controlRef: t };
}
});
const Fe = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"];
V({
inheritAttrs: !1,
props: {
options: {
type: Object,
default: () => ({})
},
modelValue: {
type: Boolean
}
},
emits: [...Fe, "update:modelValue"],
setup(r, { slots: e, emit: t, expose: i }) {
const n = N(), s = N(), o = R(oe, N()), c = R(ne, N()), l = R(Be, N());
let p, b = r.modelValue;
const x = he(() => {
var T;
return (T = e.default) == null ? void 0 : T.call(e).some((_) => _.type !== Xe);
}), v = (T) => {
b = T, t("update:modelValue", T);
}, k = (T) => {
n.value && (n.value.open({ map: o.value, anchor: l.value, ...T }), v(!0));
}, A = () => {
n.value && (n.value.close(), v(!1));
};
return Ge(() => {
J(
[o, () => r.options],
([T, _], [z, P]) => {
var j;
const U = !Z(_, P) || o.value !== z;
o.value && c.value && U && (n.value ? (n.value.setOptions({
..._,
content: x.value ? s.value : _.content
}), l.value || k()) : (n.value = W(
new c.value.InfoWindow({
..._,
content: x.value ? s.value : _.content
})
), l.value && (p = l.value.addListener("click", () => {
k();
})), (!l.value || b) && k(), Fe.forEach((D) => {
var Q;
(Q = n.value) == null || Q.addListener(D, (q) => t(D, q));
}), (j = n.value) == null || j.addListener("closeclick", () => v(!1))));
},
{
immediate: !0
}
), J(
() => r.modelValue,
(T) => {
T !== b && (T ? k() : A());
}
);
}), se(() => {
var T;
p && p.remove(), n.value && ((T = c.value) == null || T.event.clearInstanceListeners(n.value), A());
}), i({ infoWindow: n, open: k, close: A }), { infoWindow: n, infoWindowRef: s, hasSlotContent: x, open: k, close: A };
}
});
const Ue = [
Int8Array,
Uint8Array,
Uint8ClampedArray,
Int16Array,
Uint16Array,
Int32Array,
Uint32Array,
Float32Array,
Float64Array
], ve = 1, ue = 8;
class Ie {
/**
* Creates an index from raw `ArrayBuffer` data.
* @param {ArrayBuffer} data
*/
static from(e) {
if (!(e instanceof ArrayBuffer))
throw new Error("Data must be an instance of ArrayBuffer.");
const [t, i] = new Uint8Array(e, 0, 2);
if (t !== 219)
throw new Error("Data does not appear to be in a KDBush format.");
const n = i >> 4;
if (n !== ve)
throw new Error(`Got v${n} data when expected v${ve}.`);
const s = Ue[i & 15];
if (!s)
throw new Error("Unrecognized array type.");
const [o] = new Uint16Array(e, 2, 1), [c] = new Uint32Array(e, 4, 1);
return new Ie(c, o, s, e);
}
/**
* Creates an index that will hold a given number of items.
* @param {number} numItems
* @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).
* @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
* @param {ArrayBuffer} [data] (For internal use only)
*/
constructor(e, t = 64, i = Float64Array, n) {
if (isNaN(e) || e < 0)
throw new Error(`Unpexpected numItems value: ${e}.`);
this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = i, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
const s = Ue.indexOf(this.ArrayType), o = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, c = e * this.IndexArrayType.BYTES_PER_ELEMENT, l = (8 - c % 8) % 8;
if (s < 0)
throw new Error(`Unexpected typed array class: ${i}.`);
n && n instanceof ArrayBuffer ? (this.data = n, this.ids = new this.IndexArrayType(this.data, ue, e), this.coords = new this.ArrayType(this.data, ue + c + l, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(ue + o + c + l), this.ids = new this.IndexArrayType(this.data, ue, e), this.coords = new this.ArrayType(this.data, ue + c + l, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (ve << 4) + s]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e);
}
/**
* Add a point to the index.
* @param {number} x
* @param {number} y
* @returns {number} An incremental index associated with the added item (starting from `0`).
*/
add(e, t) {
const i = this._pos >> 1;
return this.ids[i] = i, this.coords[this._pos++] = e, this.coords[this._pos++] = t, i;
}
/**
* Perform indexing of the added points.
*/
finish() {
const e = this._pos >> 1;
if (e !== this.numItems)
throw new Error(`Added ${e} items when expected ${this.numItems}.`);
return ke(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
}
/**
* Search the index for items within a given bounding box.
* @param {number} minX
* @param {number} minY
* @param {number} maxX
* @param {number} maxY
* @returns {number[]} An array of indices correponding to the found items.
*/
range(e, t, i, n) {
if (!this._finished)
throw new Error("Data not yet indexed - call index.finish().");
const { ids: s, coords: o, nodeSize: c } = this, l = [0, s.length - 1, 0], p = [];
for (; l.length; ) {
const b = l.pop() || 0, x = l.pop() || 0, v = l.pop() || 0;
if (x - v <= c) {
for (let _ = v; _ <= x; _++) {
const z = o[2 * _], P = o[2 * _ + 1];
z >= e && z <= i && P >= t && P <= n && p.push(s[_]);
}
continue;
}
const k = v + x >> 1, A = o[2 * k], T = o[2 * k + 1];
A >= e && A <= i && T >= t && T <= n && p.push(s[k]), (b === 0 ? e <= A : t <= T) && (l.push(v), l.push(k - 1), l.push(1 - b)), (b === 0 ? i >= A : n >= T) && (l.push(k + 1), l.push(x), l.push(1 - b));
}
return p;
}
/**
* Search the index for items within a given radius.
* @param {number} qx
* @param {number} qy
* @param {number} r Query radius.
* @returns {number[]} An array of indices correponding to the found items.
*/
within(e, t, i) {
if (!this._finished)
throw new Error("Data not yet indexed - call index.finish().");
const { ids: n, coords: s, nodeSize: o } = this, c = [0, n.length - 1, 0], l = [], p = i * i;
for (; c.length; ) {
const b = c.pop() || 0, x = c.pop() || 0, v = c.pop() || 0;
if (x - v <= o) {
for (let _ = v; _ <= x; _++)
Qe(s[2 * _], s[2 * _ + 1], e, t) <= p && l.push(n[_]);
continue;
}
const k = v + x >> 1, A = s[2 * k], T = s[2 * k + 1];
Qe(A, T, e, t) <= p && l.push(n[k]), (b === 0 ? e - i <= A : t - i <= T) && (c.push(v), c.push(k - 1), c.push(1 - b)), (b === 0 ? e + i >= A : t + i >= T) && (c.push(k + 1), c.push(x), c.push(1 - b));
}
return l;
}
}
function ke(r, e, t, i, n, s) {
if (n - i <= t)
return;
const o = i + n >> 1;
rt(r, e, o, i, n, s), ke(r, e, t, i, o - 1, 1 - s), ke(r, e, t, o + 1, n, 1 - s);
}
function rt(r, e, t, i, n, s) {
for (; n > i; ) {
if (n - i > 600) {
const p = n - i + 1, b = t - i + 1, x = Math.log(p), v = 0.5 * Math.exp(2 * x / 3), k = 0.5 * Math.sqrt(x * v * (p - v) / p) * (b - p / 2 < 0 ? -1 : 1), A = Math.max(i, Math.floor(t - b * v / p + k)), T = Math.min(n, Math.floor(t + (p - b) * v / p + k));
rt(r, e, t, A, T, s);
}
const o = e[2 * t + s];
let c = i, l = n;
for (me(r, e, i, t), e[2 * n + s] > o && me(r, e, i, n); c < l; ) {
for (me(r, e, c, l), c++, l--; e[2 * c + s] < o; )
c++;
for (; e[2 * l + s] > o; )
l--;
}
e[2 * i + s] === o ? me(r, e, i, l) : (l++, me(r, e, l, n)), l <= t && (i = l + 1), t <= l && (n = l - 1);
}
}
function me(r, e, t, i) {
Ce(r, t, i), Ce(e, 2 * t, 2 * i), Ce(e, 2 * t + 1, 2 * i + 1);
}
function Ce(r, e, t) {
const i = r[e];
r[e] = r[t], r[t] = i;
}
function Qe(r, e, t, i) {
const n = r - t, s = e - i;
return n * n + s * s;
}
const Xt = {
minZoom: 0,
// min zoom to generate clusters on
maxZoom: 16,
// max zoom level to cluster the points on
minPoints: 2,
// minimum points to form a cluster
radius: 40,
// cluster radius in pixels
extent: 512,
// tile extent (radius is calculated relative to it)
nodeSize: 64,
// size of the KD-tree leaf node, affects performance
log: !1,
// whether to log timing info
// whether to generate numeric ids for input features (in vector tiles)
generateId: !1,
// a reduce function for calculating custom cluster properties
reduce: null,
// (accumulated, props) => { accumulated.sum += props.sum; }
// properties to use for individual points when running the reducer
map: (r) => r
// props => ({sum: props.my_value})
}, Ve = Math.fround || /* @__PURE__ */ ((r) => (e) => (r[0] = +e, r[0]))(new Float32Array(1)), ee = 2, X = 3, Se = 4, G = 5, st = 6;
class ot {
constructor(e) {
this.options = Object.assign(Object.create(Xt), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
}
load(e) {
const { log: t,