UNPKG

@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.

31 lines (27 loc) 301 kB
(function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.MeyerSquaredUI={},b.Vue))})(this,function(b,e){"use strict";const p=(o,t)=>{const r=o.__vccOpts||o;for(const[l,s]of t)r[l]=s;return r},Ye={name:"BaseText",props:{tag:{type:String,default:"p",validator:o=>["h1","h2","h3","h4","h5","h6","p","span","div","label"].includes(o)},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:o=>["thin","light","normal","medium","semibold","bold"].includes(o)},font:{type:String,default:"raleway"}},computed:{textClasses(){const o={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"},t={thin:"font-thin",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},r=this.smallSize&&o[this.smallSize]?o[this.smallSize]:o[this.size]||"",l=this.smallSize&&o[this.size]?`md:${o[this.size]}`:"",s=this.hoverColor?`hover:text-${this.hoverColor}`:"";return`${r} ${l} ${t[this.weight]} text-${this.color} ${s} font-${this.font}`}}};function Ge(o,t,r,l,s,a){return e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.tag),{class:e.normalizeClass(a.textClasses)},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"])}const u=p(Ye,[["render",Ge]]),Ze={name:"Icon",props:{icon:{type:String,required:!0},color:{type:String,default:"primary",validator:o=>["primary","secondary","accent","lineGrey"].includes(o)},size:{type:String,default:"md",validator:o=>["xs","sm","md","lg","xl","2xl","3xl","4xl","5xl"].includes(o)},type:{type:String,default:"fa-solid",validator:o=>["fa-thin","fa-sharp","fa-kit","fa-brands","fa-solid","fa-regular"].includes(o)}},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 Xe(o,t,r,l,s,a){return e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass([r.type,r.icon,a.colorClasses,a.sizeClasses]),onClick:t[0]||(t[0]=n=>o.$emit("click"))},null,2)}const N=p(Ze,[["render",Xe]]),$e={name:"BaseButton",components:{BaseText:u,Icon:N},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:o=>["primary","secondary","accent","white"].includes(o)},hoverColor:{type:String,default:null,validator:o=>o===null||["primary","secondary","accent"].includes(o)},backgroundColor:{type:String,default:"primary",validator:o=>["primary","secondary","accent"].includes(o)},border:{type:String,default:"none",validator:o=>["none","primary","secondary","accent","gradient1","gradient2"].includes(o)},padding:{type:String,default:"px-4 py-2"},iconName:{type:String,default:""},iconColor:{type:String,default:"primary",validator:o=>["primary","secondary","accent"].includes(o)},iconSize:{control:{type:"select",options:["xs","sm","md","lg","xl","2xl","3xl"]},description:"Icon size"},iconType:{type:String,default:"fa-solid",validator:o=>["fa-brands","fa-solid","fa-thin","fa-sharp"].includes(o)},align:{type:String,default:"center",validator:o=>["left","center","right","between"].includes(o)}},data(){return{hoverTextColor:this.hoverColor||"secondary",buttonTextColor:this.color||"primary"}},computed:{paddingClass(){return this.padding},backgroundClass(){return{primary:"bg-primary hover:bg-accent text-secondary hover:text-primary",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"}},methods:{setHoverTextColor(){this.buttonTextColor=this.hoverColor||"secondary"},setTextColor(){this.buttonTextColor=this.color||"primary"}}},ve=["title","aria-label"];function et(o,t,r,l,s,a){const n=e.resolveComponent("BaseText"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["group","rounded-md transition duration-300 ease-in-out",a.paddingClass,a.backgroundClass,a.borderClass]),title:r.altText||r.label,"aria-label":r.altText||r.label,onClick:t[0]||(t[0]=i=>o.$emit("buttonClick")),onMouseenter:t[1]||(t[1]=(...i)=>a.setHoverTextColor&&a.setHoverTextColor(...i)),onMouseleave:t[2]||(t[2]=(...i)=>a.setTextColor&&a.setTextColor(...i))},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center",a.alignmentClass,"space-x-2"])},[e.createVNode(n,{tag:"span",color:s.buttonTextColor,hoverColor:s.hoverTextColor,size:r.size,weight:r.weight},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.label),1)]),_:1},8,["color","hoverColor","size","weight"]),e.createVNode(c,{icon:r.iconName,color:r.iconColor,size:r.iconSize,type:r.iconType},null,8,["icon","color","size","type"])],2)],42,ve)}const V=p($e,[["render",et]]),tt={name:"InputField",props:{type:{type:String,default:"text"},placeholder:{type:String,default:"Search"},modelValue:{type:String,default:""},color:{type:String,default:"primary",validator:o=>["primary","secondary"].includes(o)},textSize:{type:String,default:"text-md",validator:o=>["text-sm","text-md","text-lg","text-xl","text-2xl"].includes(o)}},computed:{inputClass(){const o="w-full border-b-2 focus:outline-none focus:border-accent px-2 hover:border-accent duration-300 ease-in-out",t=this.color==="primary"?"bg-primary text-secondary border-secondary placeholder-secondary":"bg-white text-primary border-secondary placeholder-primary",r=this.textSize;return`${o} ${t} ${r}`}}},rt=["type","placeholder","value"];function ot(o,t,r,l,s,a){return e.openBlock(),e.createElementBlock("input",{type:r.type,placeholder:r.placeholder,value:r.modelValue,class:e.normalizeClass([a.inputClass]),onInput:t[0]||(t[0]=n=>o.$emit("update:modelValue",n.target.value))},null,42,rt)}const Q=p(tt,[["render",ot]]),at={name:"SearchBox",components:{InputField:Q,Icon:N},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)}}},nt={class:"relative flex items-center w-full max-w-md"};function st(o,t,r,l,s,a){const n=e.resolveComponent("InputField"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(n,{modelValue:s.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=i=>s.searchQuery=i),"text-size":r.textSize,placeholder:"Search",color:r.inputColor},null,8,["modelValue","text-size","color"]),e.createVNode(c,{icon:"fa-search",color:r.iconColor,size:r.iconSize,class:"absolute right-2",onClick:a.onSearch},null,8,["color","size","onClick"])])}const v=p(at,[["render",st]]),lt={name:"BasicDropDown",emits:["item-select"],components:{BaseText:u,Icon:N},props:{items:{type:Array,default:()=>["All Weapons","Longsword","Saber","Rapier","Smallsword","Sword and Buckler"]},defaultSelectedItem:{type:String,default:""},width:{type:String,default:"w-48"},boldText:{type:Boolean,default:!1}},data(){return{selectedItem:this.defaultSelectedItem,dropdownOpen:!1}},mounted(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown(){if(this.dropdownOpen=!this.dropdownOpen,window.innerWidth<768&&this.dropdownOpen){document.body.style.overflow="hidden";return}document.body.style.overflow=""},selectWeapon(o){this.$emit("item-select",o),this.selectedItem=o,this.dropdownOpen=!1,document.body.style.overflow=""},handleClickOutside(o){this.dropdownOpen&&!this.$refs.dropdownContainer.contains(o.target)&&(this.dropdownOpen=!1,document.body.style.overflow="")}}},it={key:0,class:"absolute top-full mt-1 w-full bg-secondary border rounded-lg border-lineGrey shadow-xl z-50 hidden md:block"},ct=["onClick"],dt={key:1,class:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 md:hidden"},mt={class:"bg-secondary border rounded-lg border-lineGrey shadow-xl z-50 w-3/4 max-w-lg p-6"},ht=["onClick"];function gt(o,t,r,l,s,a){const n=e.resolveComponent("BaseText"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`relative ${r.width}`),ref:"dropdownContainer"},[e.createElementVNode("div",{onClick:t[0]||(t[0]=(...i)=>a.toggleDropdown&&a.toggleDropdown(...i)),class:"flex items-center cursor-pointer"},[e.createVNode(n,{class:"border-b-2 border-transparent hover:border-accent pb-1 duration-300 ease-in-out",color:"primary",size:"xs md",tag:"p",weight:r.boldText?"bold":"normal"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.selectedItem),1)]),_:1},8,["weight"]),e.createVNode(c,{icon:"fa-chevron-down",size:"sm",color:"primary",class:"ml-4"})]),s.dropdownOpen?(e.openBlock(),e.createElementBlock("div",it,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.items,(i,d)=>(e.openBlock(),e.createElementBlock("li",{key:i,onClick:m=>a.selectWeapon(i),class:e.normalizeClass(["px-4 py-2 cursor-pointer hover:bg-hoverColor",d===0?"rounded-t-lg":"",d===r.items.length-1?"rounded-b-lg":""])},[e.createVNode(n,{color:"primary",size:"xs sm",tag:"p",weight:"bold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i),1)]),_:2},1024)],10,ct))),128))])])):e.createCommentVNode("",!0),s.dropdownOpen?(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",mt,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.items,i=>(e.openBlock(),e.createElementBlock("li",{key:i,onClick:d=>a.selectWeapon(i),class:"px-4 py-2 cursor-pointer hover:bg-hoverColor"},[e.createVNode(n,{color:"primary",size:"xs sm",tag:"p",weight:"bold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i),1)]),_:2},1024)],8,ht))),128))])])])):e.createCommentVNode("",!0)],2)}const Y=p(lt,[["render",gt]]),pt={name:"Calendar",components:{BaseText:u},props:{tournaments:{type:Array,default:()=>[]}},data(){return{currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]}},computed:{daysInMonth(){const o=new Date(this.currentYear,this.currentMonth+1,0).getDate();return Array.from({length:o},(t,r)=>r+1)},startDay(){const o=new Date(this.currentYear,this.currentMonth,1).getDay();return o===0?6:o-1},monthYear(){return new Date(this.currentYear,this.currentMonth).toLocaleString("default",{month:"long",year:"numeric"})}},methods:{hasTournament(o){const t=`${this.currentYear}-${String(this.currentMonth+1).padStart(2,"0")}-${String(o).padStart(2,"0")}`;return this.tournaments.some(r=>r.date===t)},dayClicked(o){if(this.hasTournament(o)){const t=`${this.currentYear}-${String(this.currentMonth+1).padStart(2,"0")}-${String(o).padStart(2,"0")}`;this.$emit("date-select",t)}},prevMonth(){this.currentMonth===0?(this.currentMonth=11,this.currentYear--):this.currentMonth--},nextMonth(){this.currentMonth===11?(this.currentMonth=0,this.currentYear++):this.currentMonth++}}},ft={class:"w-80 h-80 p-6 bg-primary rounded-lg shadow-md"},bt={class:"flex justify-between items-center mb-4"},ut={class:"grid grid-cols-7 gap-1 text-center font-bold text-sm text-gray-600 mb-2"},xt={class:"grid grid-cols-7 gap-1 text-center"},yt=["onClick"];function Ct(o,t,r,l,s,a){const n=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",bt,[e.createVNode(n,{tag:"h2",size:"sm",weight:"normal",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.monthYear),1)]),_:1}),e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:t[0]||(t[0]=(...c)=>a.prevMonth&&a.prevMonth(...c)),class:"text-secondary hover:text-accent mr-4"}," < "),e.createElementVNode("button",{onClick:t[1]||(t[1]=(...c)=>a.nextMonth&&a.nextMonth(...c)),class:"text-secondary hover:text-accent"}," > ")])]),e.createElementVNode("div",ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.weekdays,c=>(e.openBlock(),e.createElementBlock("div",{key:c},[e.createVNode(n,{tag:"p",size:"xs",weight:"bold",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c),1)]),_:2},1024)]))),128))]),e.createElementVNode("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.startDay,c=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+c}))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.daysInMonth,(c,i)=>(e.openBlock(),e.createElementBlock("div",{key:"day-"+c,onClick:d=>a.dayClicked(c),class:e.normalizeClass(["flex justify-center items-center cursor-pointer p-2 rounded-full",{"bg-accent text-white":a.hasTournament(c),"hover:bg-gray-200":a.hasTournament(c),"text-gray-400":!a.hasTournament(c)}])},[e.createVNode(n,{tag:"p",size:"xs",weight:"thin",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c),1)]),_:2},1024)],10,yt))),128))])])}const wt=p(pt,[["render",Ct]]);(function(){try{if(typeof document<"u"){var o=document.createElement("style");o.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(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();var Nt=Object.defineProperty,kt=(o,t,r)=>t in o?Nt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,pe=(o,t,r)=>(kt(o,typeof t!="symbol"?t+"":t,r),r);const P=Symbol("map"),j=Symbol("api"),ee=Symbol("marker"),te=Symbol("markerCluster"),G=Symbol("CustomMarker"),fe=Symbol("mapTilesLoaded"),F=["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 St(o,t,r,l){function s(a){return a instanceof r?a:new r(function(n){n(a)})}return new(r||(r=Promise))(function(a,n){function c(m){try{d(l.next(m))}catch(h){n(h)}}function i(m){try{d(l.throw(m))}catch(h){n(h)}}function d(m){m.done?a(m.value):s(m.value).then(c,i)}d((l=l.apply(o,[])).next())})}var Vt=function o(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var l,s,a;if(Array.isArray(t)){if(l=t.length,l!=r.length)return!1;for(s=l;s--!==0;)if(!o(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),l=a.length,l!==Object.keys(r).length)return!1;for(s=l;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=l;s--!==0;){var n=a[s];if(!o(t[n],r[n]))return!1}return!0}return t!==t&&r!==r};const be="__googleMapsScriptId";var q;(function(o){o[o.INITIALIZED=0]="INITIALIZED",o[o.LOADING=1]="LOADING",o[o.SUCCESS=2]="SUCCESS",o[o.FAILURE=3]="FAILURE"})(q||(q={}));class M{constructor({apiKey:t,authReferrerPolicy:r,channel:l,client:s,id:a=be,language:n,libraries:c=[],mapIds:i,nonce:d,region:m,retries:h=3,url:g="https://maps.googleapis.com/maps/api/js",version:x}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=t,this.authReferrerPolicy=r,this.channel=l,this.client=s,this.id=a||be,this.language=n,this.libraries=c,this.mapIds=i,this.nonce=d,this.region=m,this.retries=h,this.url=g,this.version=x,M.instance){if(!Vt(this.options,M.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(M.instance.options)}`);return M.instance}M.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?q.FAILURE:this.done?q.SUCCESS:this.loading?q.LOADING:q.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let t=this.url;return t+="?callback=__googleMapsCallback",this.apiKey&&(t+=`&key=${this.apiKey}`),this.channel&&(t+=`&channel=${this.channel}`),this.client&&(t+=`&client=${this.client}`),this.libraries.length>0&&(t+=`&libraries=${this.libraries.join(",")}`),this.language&&(t+=`&language=${this.language}`),this.region&&(t+=`&region=${this.region}`),this.version&&(t+=`&v=${this.version}`),this.mapIds&&(t+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(t+=`&auth_referrer_policy=${this.authReferrerPolicy}`),t}deleteScript(){const t=document.getElementById(this.id);t&&t.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((t,r)=>{this.loadCallback(l=>{l?r(l.error):t(window.google)})})}importLibrary(t){return this.execute(),google.maps.importLibrary(t)}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){var t,r;if(document.getElementById(this.id)){this.callback();return}const l={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(l).forEach(a=>!l[a]&&delete l[a]),!((r=(t=window==null?void 0:window.google)===null||t===void 0?void 0:t.maps)===null||r===void 0)&&r.importLibrary||(a=>{let n,c,i,d="The Google Maps JavaScript API",m="google",h="importLibrary",g="__ib__",x=document,f=window;f=f[m]||(f[m]={});const y=f.maps||(f.maps={}),C=new Set,w=new URLSearchParams,k=()=>n||(n=new Promise((S,T)=>St(this,void 0,void 0,function*(){var B;yield c=x.createElement("script"),c.id=this.id,w.set("libraries",[...C]+"");for(i in a)w.set(i.replace(/[A-Z]/g,_=>"_"+_[0].toLowerCase()),a[i]);w.set("callback",m+".maps."+g),c.src=this.url+"?"+w,y[g]=S,c.onerror=()=>n=T(Error(d+" could not load.")),c.nonce=this.nonce||((B=x.querySelector("script[nonce]"))===null||B===void 0?void 0:B.nonce)||"",x.head.append(c)})));y[h]?console.warn(d+" only loads once. Ignoring:",a):y[h]=(S,...T)=>C.add(S)&&k().then(()=>y[h](S,...T))})(l);const s=this.libraries.map(a=>this.importLibrary(a));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),a=>{const n=new ErrorEvent("error",{error:a});this.loadErrorCallback(n)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(t){if(this.errors.push(t),this.errors.length<=this.retries){const r=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${r} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},r)}else this.onerrorEvent=t,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(t=>{t(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 Et(o){return class extends o.OverlayView{constructor(t){super(),pe(this,"element"),pe(this,"opts");const{element:r,...l}=t;this.element=r,this.opts=l,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof o.LatLng?this.opts.position:new o.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const t=this.element;return t.style.display!=="none"&&t.style.visibility!=="hidden"&&(t.style.opacity===""||Number(t.style.opacity)>.01)}onAdd(){if(!this.element)return;const t=this.getPanes();t&&t.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const t=this.getProjection(),r=t==null?void 0:t.fromLatLngToDivPixel(this.getPosition());if(r){this.element.style.position="absolute";let l,s;switch(this.opts.anchorPoint){case"TOP_CENTER":l="-50%",s="-100%";break;case"BOTTOM_CENTER":l="-50%",s="0";break;case"LEFT_CENTER":l="-100%",s="-50%";break;case"RIGHT_CENTER":l="0",s="-50%";break;case"TOP_LEFT":l="-100%",s="-100%";break;case"TOP_RIGHT":l="0",s="-100%";break;case"BOTTOM_LEFT":l="-100%",s="0";break;case"BOTTOM_RIGHT":l="0",s="0";break;default:l="-50%",s="-50%"}const a=r.x+(this.opts.offsetX||0)+"px",n=r.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${l}) translateX(${a}) translateY(${s}) translateY(${n})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(t){const{element:r,...l}=t;this.element=r,this.opts=l,this.draw()}}}let ue;const xe=["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"],Bt=e.defineComponent({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:xe,setup(o,{emit:t}){const r=e.ref(),l=e.ref(!1),s=e.ref(),a=e.ref(),n=e.ref(!1);e.provide(P,s),e.provide(j,a),e.provide(fe,n);const c=()=>{const h={...o};Object.keys(h).forEach(f=>{h[f]===void 0&&delete h[f]});const g=f=>{var y;return f?{position:(y=a.value)==null?void 0:y.ControlPosition[f]}:{}},x={scaleControlOptions:o.scaleControlStyle?{style:o.scaleControlStyle}:{},panControlOptions:g(o.panControlPosition),zoomControlOptions:g(o.zoomControlPosition),rotateControlOptions:g(o.rotateControlPosition),streetViewControlOptions:g(o.streetViewControlPosition),fullscreenControlOptions:g(o.fullscreenControlPosition),disableDefaultUI:o.disableDefaultUi};return{...h,...x}},i=e.watch([a,s],([h,g])=>{const x=h,f=g;x&&f&&(x.event.addListenerOnce(f,"tilesloaded",()=>{n.value=!0}),setTimeout(i,0))},{immediate:!0}),d=()=>{try{const{apiKey:h,region:g,version:x,language:f,libraries:y,nonce:C}=o;ue=new M({apiKey:h,region:g,version:x,language:f,libraries:y,nonce:C})}catch(h){console.error(h)}},m=h=>{a.value=e.markRaw(h.maps),s.value=e.markRaw(new h.maps.Map(r.value,c()));const g=Et(a.value);a.value[G]=g,xe.forEach(f=>{var y;(y=s.value)==null||y.addListener(f,C=>t(f,C))}),l.value=!0;const x=Object.keys(o).filter(f=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(f)).map(f=>e.toRef(o,f));e.watch([()=>o.center,()=>o.zoom,...x],([f,y],[C,w])=>{var k,S,T;const{center:B,zoom:_,...A}=c();(k=s.value)==null||k.setOptions(A),y!==void 0&&y!==w&&((S=s.value)==null||S.setZoom(y));const $=!C||f.lng!==C.lng||f.lat!==C.lat;f&&$&&((T=s.value)==null||T.panTo(f))})};return e.onMounted(()=>{o.apiPromise&&o.apiPromise instanceof Promise?o.apiPromise.then(m):(d(),ue.load().then(m))}),e.onBeforeUnmount(()=>{var h;n.value=!1,s.value&&((h=a.value)==null||h.event.clearInstanceListeners(s.value))}),{mapRef:r,ready:l,map:s,api:a,mapTilesLoaded:n}}}),At=(o,t)=>{const r=o.__vccOpts||o;for(const[l,s]of t)r[l]=s;return r},Tt={ref:"mapRef",class:"mapdiv"};function _t(o,t,r,l,s,a){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Tt,null,512),e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({ready:o.ready,map:o.map,api:o.api,mapTilesLoaded:o.mapTilesLoaded})),void 0,!0)])}const It=At(Bt,[["render",_t],["__scopeId","data-v-d05fc6bc"]]);function zt(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Lt=function o(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var l,s,a;if(Array.isArray(t)){if(l=t.length,l!=r.length)return!1;for(s=l;s--!==0;)if(!o(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),l=a.length,l!==Object.keys(r).length)return!1;for(s=l;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=l;s--!==0;){var n=a[s];if(!o(t[n],r[n]))return!1}return!0}return t!==t&&r!==r};const z=zt(Lt),ye=["click","drag","dragend","dragstart","gmp-click"],Dt=e.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ye,setup(o,{emit:t,expose:r,slots:l}){const s=e.toRef(o,"options"),a=e.toRef(o,"pinOptions"),n=e.ref(),c=e.inject(P,e.ref()),i=e.inject(j,e.ref()),d=e.inject(te,e.ref()),m=e.computed(()=>!!(d.value&&i.value&&n.value instanceof google.maps.marker.AdvancedMarkerElement));return e.watch([c,s,a],async(h,[g,x,f])=>{var y,C,w;const k=!z(s.value,x)||!z(a.value,f)||c.value!==g;if(!c.value||!i.value||!k)return;const{AdvancedMarkerElement:S,PinElement:T}=i.value.marker;if(n.value){const{map:B,content:_,...A}=s.value;Object.assign(n.value,{content:a.value?new T(a.value).element:_,...A}),m.value&&((y=d.value)==null||y.removeMarker(n.value),(C=d.value)==null||C.addMarker(n.value))}else a.value&&(s.value.content=new T(a.value).element),n.value=e.markRaw(new S(s.value)),m.value?(w=d.value)==null||w.addMarker(n.value):n.value.map=c.value,ye.forEach(B=>{var _;(_=n.value)==null||_.addListener(B,A=>t(B,A))})},{immediate:!0}),e.onBeforeUnmount(()=>{var h,g;n.value&&((h=i.value)==null||h.event.clearInstanceListeners(n.value),m.value?(g=d.value)==null||g.removeMarker(n.value):n.value.map=null)}),e.provide(ee,n),r({marker:n}),()=>{var h;return(h=l.default)==null?void 0:h.call(l)}}}),Pt=o=>o==="Marker",jt=o=>o===G,U=(o,t,r,l)=>{const s=e.ref(),a=e.inject(P,e.ref()),n=e.inject(j,e.ref()),c=e.inject(te,e.ref()),i=e.computed(()=>!!(c.value&&n.value&&(s.value instanceof n.value.Marker||s.value instanceof n.value[G])));return e.watch([a,r],(d,[m,h])=>{var g,x,f;const y=!z(r.value,h)||a.value!==m;!a.value||!n.value||!y||(s.value?(s.value.setOptions(r.value),i.value&&((g=c.value)==null||g.removeMarker(s.value),(x=c.value)==null||x.addMarker(s.value))):(Pt(o)?s.value=e.markRaw(new n.value[o](r.value)):jt(o)?s.value=e.markRaw(new n.value[o](r.value)):s.value=e.markRaw(new n.value[o]({...r.value,map:a.value})),i.value?(f=c.value)==null||f.addMarker(s.value):s.value.setMap(a.value),t.forEach(C=>{var w;(w=s.value)==null||w.addListener(C,k=>l(C,k))})))},{immediate:!0}),e.onBeforeUnmount(()=>{var d,m;s.value&&((d=n.value)==null||d.event.clearInstanceListeners(s.value),i.value?(m=c.value)==null||m.removeMarker(s.value):s.value.setMap(null))}),s},Ce=["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"];e.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:Ce,setup(o,{emit:t,expose:r,slots:l}){const s=e.toRef(o,"options"),a=U("Marker",Ce,s,t);return e.provide(ee,a),r({marker:a}),()=>{var n;return(n=l.default)==null?void 0:n.call(l)}}}),e.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:F,setup(o,{emit:t}){const r=e.toRef(o,"options");return{polyline:U("Polyline",F,r,t)}},render:()=>null}),e.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:F,setup(o,{emit:t}){const r=e.toRef(o,"options");return{polygon:U("Polygon",F,r,t)}},render:()=>null});const we=F.concat(["bounds_changed"]);e.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:we,setup(o,{emit:t}){const r=e.toRef(o,"options");return{rectangle:U("Rectangle",we,r,t)}},render:()=>null});const Ne=F.concat(["center_changed","radius_changed"]);e.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:Ne,setup(o,{emit:t}){const r=e.toRef(o,"options");return{circle:U("Circle",Ne,r,t)}},render:()=>null}),e.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(o,{emit:t}){const r=e.ref(null),l=e.inject(P,e.ref()),s=e.inject(j,e.ref()),a=e.inject(fe,e.ref(!1)),n=e.watch([a,s,r],([d,m,h])=>{m&&d&&h&&(c(o.position),t("content:loaded"),setTimeout(n,0))},{immediate:!0}),c=d=>{if(l.value&&s.value&&r.value){const m=s.value.ControlPosition[d];l.value.controls[m].push(r.value)}},i=d=>{if(l.value&&s.value){let m=null;const h=s.value.ControlPosition[d];l.value.controls[h].forEach((g,x)=>{g===r.value&&(m=x)}),m!==null&&l.value.controls[h].removeAt(m)}};return e.onBeforeUnmount(()=>i(o.position)),e.watch(()=>o.position,(d,m)=>{i(m),c(d)}),e.watch(()=>o.index,d=>{d&&r.value&&(r.value.index=o.index)}),{controlRef:r}}});const ke=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"];e.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...ke,"update:modelValue"],setup(o,{slots:t,emit:r,expose:l}){const s=e.ref(),a=e.ref(),n=e.inject(P,e.ref()),c=e.inject(j,e.ref()),i=e.inject(ee,e.ref());let d,m=o.modelValue;const h=e.computed(()=>{var y;return(y=t.default)==null?void 0:y.call(t).some(C=>C.type!==e.Comment)}),g=y=>{m=y,r("update:modelValue",y)},x=y=>{s.value&&(s.value.open({map:n.value,anchor:i.value,...y}),g(!0))},f=()=>{s.value&&(s.value.close(),g(!1))};return e.onMounted(()=>{e.watch([n,()=>o.options],([y,C],[w,k])=>{var S;const T=!z(C,k)||n.value!==w;n.value&&c.value&&T&&(s.value?(s.value.setOptions({...C,content:h.value?a.value:C.content}),i.value||x()):(s.value=e.markRaw(new c.value.InfoWindow({...C,content:h.value?a.value:C.content})),i.value&&(d=i.value.addListener("click",()=>{x()})),(!i.value||m)&&x(),ke.forEach(B=>{var _;(_=s.value)==null||_.addListener(B,A=>r(B,A))}),(S=s.value)==null||S.addListener("closeclick",()=>g(!1))))},{immediate:!0}),e.watch(()=>o.modelValue,y=>{y!==m&&(y?x():f())})}),e.onBeforeUnmount(()=>{var y;d&&d.remove(),s.value&&((y=c.value)==null||y.event.clearInstanceListeners(s.value),f())}),l({infoWindow:s,open:x,close:f}),{infoWindow:s,infoWindowRef:a,hasSlotContent:h,open:x,close:f}}});const Se=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],re=1,J=8;class oe{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,l]=new Uint8Array(t,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=l>>4;if(s!==re)throw new Error(`Got v${s} data when expected v${re}.`);const a=Se[l&15];if(!a)throw new Error("Unrecognized array type.");const[n]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new oe(c,n,a,t)}constructor(t,r=64,l=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=l,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const a=Se.indexOf(this.ArrayType),n=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,i=(8-c%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${l}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,J,t),this.coords=new this.ArrayType(this.data,J+c+i,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(J+n+c+i),this.ids=new this.IndexArrayType(this.data,J,t),this.coords=new this.ArrayType(this.data,J+c+i,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(re<<4)+a]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const l=this._pos>>1;return this.ids[l]=l,this.coords[this._pos++]=t,this.coords[this._pos++]=r,l}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return ae(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,l,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:n,nodeSize:c}=this,i=[0,a.length-1,0],d=[];for(;i.length;){const m=i.pop()||0,h=i.pop()||0,g=i.pop()||0;if(h-g<=c){for(let C=g;C<=h;C++){const w=n[2*C],k=n[2*C+1];w>=t&&w<=l&&k>=r&&k<=s&&d.push(a[C])}continue}const x=g+h>>1,f=n[2*x],y=n[2*x+1];f>=t&&f<=l&&y>=r&&y<=s&&d.push(a[x]),(m===0?t<=f:r<=y)&&(i.push(g),i.push(x-1),i.push(1-m)),(m===0?l>=f:s>=y)&&(i.push(x+1),i.push(h),i.push(1-m))}return d}within(t,r,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:a,nodeSize:n}=this,c=[0,s.length-1,0],i=[],d=l*l;for(;c.length;){const m=c.pop()||0,h=c.pop()||0,g=c.pop()||0;if(h-g<=n){for(let C=g;C<=h;C++)Ee(a[2*C],a[2*C+1],t,r)<=d&&i.push(s[C]);continue}const x=g+h>>1,f=a[2*x],y=a[2*x+1];Ee(f,y,t,r)<=d&&i.push(s[x]),(m===0?t-l<=f:r-l<=y)&&(c.push(g),c.push(x-1),c.push(1-m)),(m===0?t+l>=f:r+l>=y)&&(c.push(x+1),c.push(h),c.push(1-m))}return i}}function ae(o,t,r,l,s,a){if(s-l<=r)return;const n=l+s>>1;Ve(o,t,n,l,s,a),ae(o,t,r,l,n-1,1-a),ae(o,t,r,n+1,s,1-a)}function Ve(o,t,r,l,s,a){for(;s>l;){if(s-l>600){const d=s-l+1,m=r-l+1,h=Math.log(d),g=.5*Math.exp(2*h/3),x=.5*Math.sqrt(h*g*(d-g)/d)*(m-d/2<0?-1:1),f=Math.max(l,Math.floor(r-m*g/d+x)),y=Math.min(s,Math.floor(r+(d-m)*g/d+x));Ve(o,t,r,f,y,a)}const n=t[2*r+a];let c=l,i=s;for(W(o,t,l,r),t[2*s+a]>n&&W(o,t,l,s);c<i;){for(W(o,t,c,i),c++,i--;t[2*c+a]<n;)c++;for(;t[2*i+a]>n;)i--}t[2*l+a]===n?W(o,t,l,i):(i++,W(o,t,i,s)),i<=r&&(l=i+1),r<=i&&(s=i-1)}}function W(o,t,r,l){ne(o,r,l),ne(t,2*r,2*l),ne(t,2*r+1,2*l+1)}function ne(o,t,r){const l=o[t];o[t]=o[r],o[r]=l}function Ee(o,t,r,l){const s=o-r,a=t-l;return s*s+a*a}const Mt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:o=>o},Be=Math.fround||(o=>t=>(o[0]=+t,o[0]))(new Float32Array(1)),O=2,L=3,se=4,D=5,Ae=6;class Te{constructor(t){this.options=Object.assign(Object.create(Mt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:r,minZoom:l,maxZoom:s}=this.options;r&&console.time("total time");const a=`prepare ${t.length} points`;r&&console.time(a),this.points=t;const n=[];for(let i=0;i<t.length;i++){const d=t[i];if(!d.geometry)continue;const[m,h]=d.geometry.coordinates,g=Be(Z(m)),x=Be(X(h));n.push(g,x,1/0,i,-1,1),this.options.reduce&&n.push(0)}let c=this.trees[s+1]=this._createTree(n);r&&console.timeEnd(a);for(let i=s;i>=l;i--){const d=+Date.now();c=this.trees[i]=this._createTree(this._cluster(c,i)),r&&console.log("z%d: %d clusters in %dms",i,c.numItems,+Date.now()-d)}return r&&console.timeEnd("total time"),this}getClusters(t,r){let l=((t[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,t[1]));let a=t[2]===180?180:((t[2]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)l=-180,a=180;else if(l>a){const h=this.getClusters([l,s,180,n],r),g=this.getClusters([-180,s,a,n],r);return h.concat(g)}const c=this.trees[this._limitZoom(r)],i=c.range(Z(l),X(n),Z(a),X(s)),d=c.data,m=[];for(const h of i){const g=this.stride*h;m.push(d[g+D]>1?_e(d,g,this.clusterProps):this.points[d[g+L]])}return m}getChildren(t){const r=this._getOriginId(t),l=this._getOriginZoom(t),s="No cluster with the specified id.",a=this.trees[l];if(!a)throw new Error(s);const n=a.data;if(r*this.stride>=n.length)throw new Error(s);const c=this.options.radius/(this.options.extent*Math.pow(2,l-1)),i=n[r*this.stride],d=n[r*this.stride+1],m=a.within(i,d,c),h=[];for(const g of m){const x=g*this.stride;n[x+se]===t&&h.push(n[x+D]>1?_e(n,x,this.clusterProps):this.points[n[x+L]])}if(h.length===0)throw new Error(s);return h}getLeaves(t,r,l){r=r||10,l=l||0;const s=[];return this._appendLeaves(s,t,r,l,0),s}getTile(t,r,l){const s=this.trees[this._limitZoom(t)],a=Math.pow(2,t),{extent:n,radius:c}=this.options,i=c/n,d=(l-i)/a,m=(l+1+i)/a,h={features:[]};return this._addTileFeatures(s.range((r-i)/a,d,(r+1+i)/a,m),s.data,r,l,a,h),r===0&&this._addTileFeatures(s.range(1-i/a,d,1,m),s.data,a,l,a,h),r===a-1&&this._addTileFeatures(s.range(0,d,i/a,m),s.data,-1,l,a,h),h.features.length?h:null}getClusterExpansionZoom(t){let r=this._getOriginZoom(t)-1;for(;r<=this.options.maxZoom;){const l=this.getChildren(t);if(r++,l.length!==1)break;t=l[0].properties.cluster_id}return r}_appendLeaves(t,r,l,s,a){const n=this.getChildren(r);for(const c of n){const i=c.properties;if(i&&i.cluster?a+i.point_count<=s?a+=i.point_count:a=this._appendLeaves(t,i.cluster_id,l,s,a):a<s?a++:t.push(c),t.length===l)break}return a}_createTree(t){const r=new oe(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let l=0;l<t.length;l+=this.stride)r.add(t[l],t[l+1]);return r.finish(),r.data=t,r}_addTileFeatures(t,r,l,s,a,n){for(const c of t){const i=c*this.stride,d=r[i+D]>1;let m,h,g;if(d)m=Ie(r,i,this.clusterProps),h=r[i],g=r[i+1];else{const y=this.points[r[i+L]];m=y.properties;const[C,w]=y.geometry.coordinates;h=Z(C),g=X(w)}const x={type:1,geometry:[[Math.round(this.options.extent*(h*a-l)),Math.round(this.options.extent*(g*a-s))]],tags:m};let f;d||this.options.generateId?f=r[i+L]:f=this.points[r[i+L]].id,f!==void 0&&(x.id=f),n.features.push(x)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,r){const{radius:l,extent:s,reduce:a,minPoints:n}=this.options,c=l/(s*Math.pow(2,r)),i=t.data,d=[],m=this.stride;for(let h=0;h<i.length;h+=m){if(i[h+O]<=r)continue;i[h+O]=r;const g=i[h],x=i[h+1],f=t.within(i[h],i[h+1],c),y=i[h+D];let C=y;for(const w of f){const k=w*m;i[k+O]>r&&(C+=i[k+D])}if(C>y&&C>=n){let w=g*y,k=x*y,S,T=-1;const B=((h/m|0)<<5)+(r+1)+this.points.length;for(const _ of f){const A=_*m;if(i[A+O]<=r)continue;i[A+O]=r;const $=i[A+D];w+=i[A]*$,k+=i[A+1]*$,i[A+se]=B,a&&(S||(S=this._map(i,h,!0),T=this.clusterProps.length,this.clusterProps.push(S)),a(S,this._map(i,A)))}i[h+se]=B,d.push(w/C,k/C,1/0,B,-1,C),a&&d.push(T)}else{for(let w=0;w<m;w++)d.push(i[h+w]);if(C>1)for(const w of f){const k=w*m;if(!(i[k+O]<=r)){i[k+O]=r;for(let S=0;S<m;S++)d.push(i[k+S])}}}}return d}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,r,l){if(t[r+D]>1){const n=this.clusterProps[t[r+Ae]];return l?Object.assign({},n):n}const s=this.points[t[r+L]].properties,a=this.options.map(s);return l&&a===s?Object.assign({},a):a}}function _e(o,t,r){return{type:"Feature",id:o[t+L],properties:Ie(o,t,r),geometry:{type:"Point",coordinates:[Ot(o[t]),Rt(o[t+1])]}}}function Ie(o,t,r){const l=o[t+D],s=l>=1e4?`${Math.round(l/1e3)}k`:l>=1e3?`${Math.round(l/100)/10}k`:l,a=o[t+Ae],n=a===-1?{}:Object.assign({},r[a]);return Object.assign(n,{cluster:!0,cluster_id:o[t+L],point_count:l,point_count_abbreviated:s})}function Z(o){return o/360+.5}function X(o){const t=Math.sin(o*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Ot(o){return(o-.5)*360}function Rt(o){const t=(180-o*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}/*! ***************************************************************************** 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 le(o,t){var r={};for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&t.indexOf(l)<0&&(r[l]=o[l]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,l=Object.getOwnPropertySymbols(o);s<l.length;s++)t.indexOf(l[s])<0&&Object.prototype.propertyIsEnumerable.call(o,l[s])&&(r[l[s]]=o[l[s]]);return r}class E{static isAdvancedMarkerAvailable(t){return google.maps.marker&&t.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,r){this.isAdvancedMarker(t)?t.map=r:t.setMap(r)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(t.position.lat&&t.position.lng)return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return this.isAdvancedMarker(t)?!0:t.getVisible()}}class K{constructor({markers:t,position:r}){this.markers=t,r&&(r instanceof google.maps.LatLng?this._position=r:this._position=new google.maps.LatLng(r))}get bounds(){if(this.markers.length===0&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const r of this.markers)t.extend(E.getPosition(r));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>E.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(E.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const Ft=(o,t,r,l)=>{const s=ze(o.getBounds(),t,l);return r.filter(a=>s.contains(E.getPosition(a)))},ze=(o,t,r)=>{const{northEast:l,southWest:s}=qt(o,t),a=Ut({northEast:l,southWest:s},r);return Ht(a,t)},Le=(o,t,r)=>{const l=ze(o,t,r),s=l.getNorthEast(),a=l.getSouthWest();return[a.lng(),a.lat(),s.lng(),s.lat()]},qt=(o,t)=>({northEast:t.fromLatLngToDivPixel(o.getNorthEast()),southWest:t.fromLatLngToDivPixel(o.getSouthWest())}),Ut=({northEast:o,southWest:t},r)=>(o.x+=r,o.y-=r,t.x-=r,t.y+=r,{northEast:o,southWest:t}),Ht=({northEast:o,southWest:t},r)=>{const l=r.fromDivPixelToLatLng(t),s=r.fromDivPixelToLatLng(o);return new google.maps.LatLngBounds(l,s)};class De{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return Jt(t)}}class Qt extends De{constructor(t){var{viewportPadding:r=60}=t,l=le(t,["viewportPadding"]);super(l),this.viewportPadding=60,this.viewportPadding=r}calculate({markers:t,map:r,mapCanvasProjection:l}){return r.getZoom()>=this.maxZoom?{clusters:this.noop({markers:t}),changed:!1}:{clusters:this.cluster({markers:Ft(r,l,t,this.viewportPadding),map:r,mapCanvasProjection:l})}}}const Jt=o=>o.map(t=>new K({position:E.getPosition(t),markers:[t]}));class Wt extends De{constructor(t){var{maxZoom:r,radius:l=60}=t,s=le(t,["maxZoom","radius"]);super({maxZoom:r}),this.state={zoom:-1},this.superCluster=new Te(Object.assign({maxZoom:this.maxZoom,radius:l},s))}calculate(t){let r=!1;const l={zoom:t.map.getZoom()};if(!z(t.markers,this.markers)){r=!0,this.markers=[...t.markers];const s=this.markers.map(a=>{const n=E.getPosition(a);return{type:"Feature",geometry:{type:"Point",coordinates:[n.lng(),n.lat()]},properties:{marker:a}}});this.superCluster.load(s)}return r||(this.state.zoom<=this.maxZoom||l.zoom<=this.maxZoom)&&(r=!z(this.state,l)),this.state=l,r&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:r}}cluster({map:t}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(t.getZoom())).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[t,r]},properties:l}){if(l.cluster)return new K({markers:this.superCluster.getLeaves(l.cluster_id,1/0).map(a=>a.properties.marker),position:{lat:r,lng:t}});const s=l.marker;return new K({markers:[s],position:E.getPosition(s)})}}class Kt extends Qt{constructor(t){var{maxZoom:r,radius:l=60,viewportPadding:s=60}=t,a=le(t,["maxZoom","radius","viewportPadding"]);super({maxZoom:r,viewportPadding:s}),this.superCluster=new Te(Object.assign({maxZoom:this.maxZoom,radius:l},a)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(t){const r={zoom:Math.round(t.map.getZoom()),view:Le(t.map.getBounds(),t.mapCanvasProjection,this.viewportPadding)};let l=!z(this.state,r);if(!z(t.markers,this.markers)){l=!0,this.markers=[...t.markers];const s=this.markers.map(a=>{const n=E.getPosition(a);return{type:"Feature",geometry:{type:"Point",coordinates:[n.lng(),n.lat()]},properties:{marker:a}}});this.superCluster.load(s)}return l&&(this.clusters=this.cluster(t),this.state=r),{clusters:this.clusters,changed:l}}cluster({map:t,mapCanvasProjection:r}){const l={zoom:Math.round(t.getZoom()),view:Le(t.getBounds(),r,this.viewportPadding)};return this.superCluster.getClusters(l.view,l.zoom).map(s=>this.transformCluster(s))}transformCluster({geometry:{coordinates:[t,r]},properties:l}){if(l.cluster)return new K({markers:this.superCluster.getLeaves(l.cluster_id,1/0).map(a=>a.properties.marker),position:{lat:r,lng:t}});const s=l.marker;return new K({markers:[s],position:E.getPosition(s)})}}class Yt{constructor(t,r){this.markers={sum:t.length};const l=r.map(a=>a.count),s=l.reduce((a,n)=>a+n,0);this.clusters={count:r.length,markers:{mean:s/r.length,sum:s,min:Math.min(...l),max:Math.max(...l)}}}}class Gt{render({count:t,position:r},l,s){const a=`<svg fill="${t>Math.max(10,l.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50"> <circle cx="120" cy="120" opacity=".6" r="70" /> <circle cx="120" cy="120" opacity=".3" r="90" /> <circle cx="120" cy="120" opacity=".2" r="110" /> <text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-fami