@arenarium/maps 1.4.13 → 1.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.css +1 -1
- package/dist/main.js +2 -2
- package/package.json +1 -1
package/dist/main.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.pin.svelte-10kxbrm{box-sizing:border-box;transform-origin:0 0;backface-visibility:hidden;will-change:scale, opacity;content-visibility:hidden;border-style:solid;justify-content:center;align-items:center;display:none;position:absolute;transform:translate(-50%,-50%)}.pin.displayed.svelte-10kxbrm{content-visibility:initial;display:flex}.element.svelte-1no6o2a{box-sizing:border-box;transform-style:flat;transform-origin:0 0;width:0;height:0;position:absolute}.body.svelte-1no6o2a{cursor:pointer;width:max-content}.anchor.svelte-1no6o2a{opacity:0;will-change:opacity, scale;scale:0}.pointer.svelte-1no6o2a,.bubble.svelte-1no6o2a{will-change:transform}.body.svelte-1no6o2a{opacity:0;will-change:opacity}.anchor.svelte-1no6o2a{content-visibility:hidden;display:none}.anchor.displayed.svelte-1no6o2a{display:initial;content-visibility:initial}.body.svelte-1no6o2a{display:initial}.body.svelte-1no6o2a:hover{display:
|
|
1
|
+
.pin.svelte-10kxbrm{box-sizing:border-box;transform-origin:0 0;backface-visibility:hidden;will-change:scale, opacity;content-visibility:hidden;border-style:solid;justify-content:center;align-items:center;display:none;position:absolute;transform:translate(-50%,-50%)}.pin.displayed.svelte-10kxbrm{content-visibility:initial;display:flex}.element.svelte-1no6o2a{box-sizing:border-box;transform-style:flat;transform-origin:0 0;width:0;height:0;position:absolute}.body.svelte-1no6o2a{cursor:pointer;width:max-content}.anchor.svelte-1no6o2a{opacity:0;will-change:opacity, scale;scale:0}.pointer.svelte-1no6o2a,.bubble.svelte-1no6o2a{will-change:transform}.body.svelte-1no6o2a{opacity:0;will-change:opacity}.anchor.svelte-1no6o2a{content-visibility:hidden;display:none}.anchor.displayed.svelte-1no6o2a{display:initial;content-visibility:initial}.body.svelte-1no6o2a{display:initial}.body.svelte-1no6o2a:hover{display:contents}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=100,t=class{invoked=!1;running=!1;interval;timeout;callback;constructor(t,n){if((n??0)<0)throw Error(`Invalid interval`);this.interval=n??e/Math.max(4,navigator?.hardwareConcurrency??1),this.callback=t}async process(){this.invoked=!1,this.callback()||!this.invoked?this.stop():this.timeout=window.setTimeout(this.process.bind(this),this.interval)}run(){this.invoked=!0,this.running||(this.running=!0,this.timeout=window.setTimeout(this.process.bind(this),0))}stop(){this.invoked=!1,this.running=!1,this.timeout&&window.clearTimeout(this.timeout),this.timeout=void 0}},n=class{properties;state;constructor(e,t,n,r,i,a,o){this.properties={id:e,lat:t,lng:n,rank:r,pin:i,tooltip:a,popup:o},this.state=void 0}},r=class{callback;timeout;id;constructor(e,t){if(t<=0)throw Error(`Invalid timeout`);this.callback=e,this.timeout=t}start(){this.id===void 0&&(this.id=window.setInterval(this.callback,this.timeout))}stop(){this.id!==void 0&&(window.clearInterval(this.id),this.id=void 0)}running(){return this.id!==void 0}},i=100,a=class{viewport=void 0;state=`idle`;provider;interval;onCancel;onError;onMove;onIdle;onClick;constructor(e,t,n,a,o,s){this.provider=e,this.interval=new r(this.onInterval.bind(this),i/Math.max(4,navigator?.hardwareConcurrency??1)),this.onCancel=t,this.onError=n,this.onMove=a,this.onIdle=o,this.onClick=s}start(){this.interval.running()===!1&&(this.interval.start(),this.provider.getContainer().addEventListener(`click`,this.onClick))}stop(){this.interval.running()===!0&&(this.interval.stop(),this.provider.getContainer().removeEventListener(`click`,this.onClick))}idle(){return this.state===`idle`}onInterval(){try{if(this.onCancel()){this.interval.stop();return}let e=this.provider.getViewport(),t=this.state,n=JSON.stringify(e)===JSON.stringify(this.viewport)?`idle`:`move`;n===`move`&&this.onMove(),n===`idle`&&t===`move`&&this.onIdle(),this.state=n,this.viewport=e}catch(e){this.onError(`Failed to process map state interval`,e)}}},o=Array.isArray,s=Array.prototype.indexOf,c=Array.prototype.includes,l=Array.from,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.prototype,p=Array.prototype,m=Object.getPrototypeOf,h=Object.isExtensible,g=()=>{};function ee(e){for(var t=0;t<e.length;t++)e[t]()}function te(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var _=1024,v=2048,y=4096,b=8192,x=16384,S=32768,ne=1<<25,re=65536,ie=1<<19,ae=1<<20,oe=65536,se=1<<21,ce=1<<22,le=1<<23,ue=Symbol(`$state`),C=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"};globalThis.document?.contentType;function de(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function fe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function pe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function me(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function he(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ge(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var _e={},w=Symbol();function ve(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ye(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var T=!1,E;function be(e){if(e===null)throw ve(),_e;return E=e}function xe(){return be(Rt(E))}function Se(e){if(T){if(Rt(E)!==null)throw ve(),_e;E=e}}function Ce(e=1){if(T){for(var t=e,n=E;t--;)n=Rt(n);E=n}}function we(e=!0){for(var t=0,n=E;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Rt(n);e&&n.remove(),n=i}}function Te(e){return e===this.v}function Ee(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function De(e){return!Ee(e,this.v)}var Oe=!1,ke=!1,D=null;function Ae(e){D=e}function je(e,t=!1,n){D={p:D,i:!1,c:null,e:null,s:e,x:null,r:z,l:ke&&!t?{s:null,u:null,$:[]}:null}}function Me(e){var t=D,n=t.e;if(n!==null){t.e=null;for(var r of n)Jt(r)}return e!==void 0&&(t.x=e),t.i=!0,D=t.p,e??{}}function Ne(){return!ke||D!==null&&D.l===null}var O=[];function Pe(){var e=O;O=[],ee(e)}function Fe(e){if(O.length===0&&!We){var t=O;queueMicrotask(()=>{t===O&&Pe()})}O.push(e)}function Ie(e){var t=z;if(t===null)return I.f|=le,e;if(!(t.f&32768)&&!(t.f&4))throw e;Le(e,t)}function Le(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var Re=~(v|y|_);function k(e,t){e.f=e.f&Re|t}function ze(e){e.f&512||e.deps===null?k(e,_):k(e,y)}function Be(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=oe,Be(t.deps))}function Ve(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Be(e.deps),k(e,_)}var He=!1,A=new Set,j=null,M=null,Ue=null,We=!1,Ge=!1,Ke=null,qe=null,Je=0,Ye=1,Xe=class e{id=Ye++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=[];#s=new Set;#c=new Set;#l=new Map;#u=new Set;is_fork=!1;#d=!1;#f=new Set;#p(){return this.is_fork||this.#r.size>0}#m(){for(let n of this.#f)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#l.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]}),this.#u.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#l.get(e);if(n){this.#l.delete(e);for(var r of n.d)k(r,v),t(r);for(r of n.m)k(r,y),t(r)}this.#u.add(e)}#h(){if(Je++>1e3&&(A.delete(this),Ze()),!this.#p()){for(let e of this.#s)this.#c.delete(e),k(e,v),this.schedule(e);for(let e of this.#c)k(e,y),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=Ke=[],r=[],i=qe=[];for(let e of t)try{this.#g(e,n,r)}catch(t){throw it(e),t}if(j=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Ke=null,qe=null,this.#p()||this.#m()){this.#_(r),this.#_(n);for(let[e,t]of this.#l)rt(e,t)}else{this.#n.size===0&&A.delete(this),this.#s.clear(),this.#c.clear();for(let e of this.#e)e(this);this.#e.clear(),$e(r),$e(n),this.#i?.resolve()}var o=j;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(A.add(o),o.#h()),Oe&&!A.has(this)&&this.#v()}#g(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#l.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):Oe&&i&16777224?n.push(r):Cn(r)&&(i&16&&this.#c.add(r),On(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#_(e){for(var t=0;t<e.length;t+=1)Ve(e[t],this.#s,this.#c)}capture(e,t,n=!1){e.v!==w&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),M?.set(e,t)),this.is_fork||(e.v=t)}activate(){j=this}deactivate(){j=null,M=null}flush(){try{Ge=!0,j=this,this.#h()}finally{Je=0,Ue=null,Ke=null,qe=null,Ge=!1,j=null,M=null,Ct.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),A.delete(this)}register_created_effect(e){this.#o.push(e)}#v(){for(let l of A){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}var r=[...l.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){if(e)for(let e of this.#u)l.unskip_effect(e,e=>{e.f&4194320?l.schedule(e):l.#_([e])});l.activate();var i=new Set,a=new Map;for(var o of t)et(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#o)!(e.f&155648)&&tt(e,s,a)&&(e.f&4194320?(k(e,v),l.schedule(e)):l.#s.add(e));if(l.#a.length>0){l.apply();for(var c of l.#a)l.#g(c,[],[]);l.#a=[]}l.deactivate()}}for(let e of A)e.#f.has(this)&&(e.#f.delete(this),e.#f.size===0&&!e.#p()&&(e.activate(),e.#h()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#d||n||(this.#d=!0,Fe(()=>{this.#d=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#s.add(t);for(let e of t)this.#c.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=te()).promise}static ensure(){if(j===null){let t=j=new e;Ge||(A.add(j),We||Fe(()=>{j===t&&t.flush()}))}return j}apply(){if(!Oe||!this.is_fork&&A.size===1){M=null;return}M=new Map;for(let[e,[t]]of this.current)M.set(e,t);for(let n of A)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#f.add(n);else for(let[e,t]of n.previous)M.has(e)||M.set(e,t)}}schedule(e){if(Ue=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Ke!==null&&t===z&&(Oe||(I===null||!(I.f&2))&&!He))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#a.push(t)}};function Ze(){try{fe()}catch(e){Le(e,Ue)}}var Qe=null;function $e(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Cn(r)&&(Qe=new Set,On(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&sn(r),Qe?.size>0)){Ct.clear();for(let e of Qe){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Qe.has(n)&&(Qe.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||On(n)}}Qe.clear()}}Qe=null}}function et(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?et(i,t,n,r):e&4194320&&!(e&2048)&&tt(i,t,r)&&(k(i,v),nt(i))}}function tt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(c.call(t,r))return!0;if(r.f&2&&tt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function nt(e){j.schedule(e)}function rt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),k(e,_);for(var n=e.first;n!==null;)rt(n,t),n=n.next}}function it(e){k(e,_);for(var t=e.first;t!==null;)it(t),t=t.next}function at(e){let t=0,n=Tt(0),r;return()=>{Kt()&&(W(n),Qt(()=>(t===0&&(r=G(()=>e(()=>Ot(n)))),t+=1,()=>{Fe(()=>{--t,t===0&&(r?.(),r=void 0,Ot(n))})})))}}var ot=re|ie;function st(e,t,n,r){new ct(e,t,n,r)}var ct=class{parent;is_pending=!1;transform_error;#e;#t=T?E:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=at(()=>(this.#m=Tt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=z;t.b=this,t.f|=128,n(e)},this.parent=z.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=en(()=>{if(T){let e=this.#t;xe();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},ot),T&&(this.#e=E)}#g(){try{this.#a=tn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=tn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=tn(()=>e(this.#e)),Fe(()=>{var e=this.#c=document.createDocumentFragment(),t=It();e.append(t),this.#a=this.#x(()=>tn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,cn(this.#o,()=>{this.#o=null}),this.#b(j))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=tn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();un(this.#a,e);let t=this.#n.pending;this.#o=tn(()=>t(this.#e))}else this.#b(j)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Ve(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=z,n=I,r=D;hn(this.#i),R(this.#i),Ae(this.#i.ctx);try{return Xe.ensure(),e()}catch(e){return Ie(e),null}finally{hn(t),R(n),Ae(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&cn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Fe(()=>{this.#d=!1,this.#m&&Et(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),W(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(F(this.#a),null),this.#o&&=(F(this.#o),null),this.#s&&=(F(this.#s),null),T&&(be(this.#t),Ce(),be(we()));var r=!1,i=!1;let a=()=>{if(r){ye();return}r=!0,i&&ge(),this.#s!==null&&cn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){Le(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return tn(()=>{var t=z;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return Le(e,this.#i.parent),null}}))};Fe(()=>{var t;try{t=this.transform_error(e)}catch(e){Le(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>Le(e,this.#i&&this.#i.parent)):o(t)})}};function lt(e,t,n,r){let i=Ne()?pt:ht;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=z,s=ut(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||Le(e,o)}dt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=ft();function d(){Promise.all(n.map(e=>mt(e))).then(e=>l([...t.map(i),...e])).catch(e=>Le(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),dt()}):d()}function ut(){var e=z,t=I,n=D,r=j;return function(i=!0){hn(e),R(t),Ae(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function dt(e=!0){hn(null),R(null),Ae(null),e&&j?.deactivate()}function ft(){var e=z,t=e.b,n=j,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function pt(e){var t=2|v,n=I!==null&&I.f&2?I:null;return z!==null&&(z.f|=ie),{ctx:D,deps:null,effects:null,equals:Te,f:t,fn:e,reactions:null,rv:0,v:w,wv:0,parent:n??z,ac:null}}function mt(e,t,n){let r=z;r===null&&de();var i=void 0,a=Tt(w),o=!I,s=new Map;return Zt(()=>{var t=z,n=te();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(dt)}catch(e){n.reject(e),dt()}var c=j;if(o){if(t.f&32768)var l=ft();if(r.b.is_rendered())s.get(c)?.reject(C),s.delete(c);else{for(let e of s.values())e.reject(C);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===C),!(n===C||t.f&16384)){if(c.activate(),n)a.f|=le,Et(a,n);else{a.f&8388608&&(a.f^=le),Et(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(C)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),qt(()=>{for(let e of s.values())e.reject(C)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function ht(e){let t=pt(e);return t.equals=De,t}function gt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)F(t[n])}}function _t(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function vt(e){var t,n=z;hn(_t(e));try{e.f&=~oe,gt(e),t=Tn(e)}finally{hn(n)}return t}function yt(e){var t=vt(e);if(!e.equals(t)&&(e.wv=Sn(),(!j?.is_fork||e.deps===null)&&(j===null?e.v=t:j.capture(e,t,!0),e.deps===null))){k(e,_);return}pn||(M===null?ze(e):(Kt()||j?.is_fork)&&M.set(e,t))}function bt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(C),t.teardown=g,t.ac=null,Dn(t,0),rn(t))}function xt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&On(t)}var St=new Set,Ct=new Map,wt=!1;function Tt(e,t){return{f:0,v:e,reactions:null,equals:Te,rv:0,wv:0}}function N(e,t){let n=Tt(e,t);return gn(n),n}function P(e,t,n=!1){return I!==null&&(!L||I.f&131072)&&Ne()&&I.f&4325394&&(B===null||!c.call(B,e))&&he(),Et(e,n?At(t):t,qe)}function Et(e,t,n=null){if(!e.equals(t)){Ct.set(e,pn?t:e.v);var r=Xe.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&vt(t),M===null&&ze(t)}e.wv=Sn(),kt(e,v,n),Ne()&&z!==null&&z.f&1024&&!(z.f&96)&&(U===null?_n([e]):U.push(e)),!r.is_fork&&St.size>0&&!wt&&Dt()}return t}function Dt(){wt=!1;for(let e of St)e.f&1024&&k(e,y),Cn(e)&&On(e);St.clear()}function Ot(e){P(e,e.v+1)}function kt(e,t,n){var r=e.reactions;if(r!==null)for(var i=Ne(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===z)){var l=(c&v)===0;if(l&&k(s,t),c&2){var u=s;M?.delete(u),c&65536||(c&512&&(s.f|=oe),kt(u,y,n))}else if(l){var d=s;c&16&&Qe!==null&&Qe.add(d),n===null?nt(d):n.push(d)}}}}function At(e){if(typeof e!=`object`||!e||ue in e)return e;let t=m(e);if(t!==f&&t!==p)return e;var n=new Map,r=o(e),i=N(0),a=null,s=bn,c=e=>{if(bn===s)return e();var t=I,n=bn;R(null),xn(s);var r=e();return R(t),xn(n),r};return r&&n.set(`length`,N(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&pe();var i=n.get(t);return i===void 0?c(()=>{var e=N(r.value,a);return n.set(t,e),e}):P(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=c(()=>N(w,a));n.set(t,e),Ot(i)}}else P(r,w),Ot(i);return!0},get(t,r,i){if(r===ue)return e;var o=n.get(r),s=r in t;if(o===void 0&&(!s||d(t,r)?.writable)&&(o=c(()=>N(At(s?t[r]:w),a)),n.set(r,o)),o!==void 0){var l=W(o);return l===w?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=W(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==w)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===ue)return!0;var r=n.get(t),i=r!==void 0&&r.v!==w||Reflect.has(e,t);return(r!==void 0||z!==null&&(!i||d(e,t)?.writable))&&(r===void 0&&(r=c(()=>N(i?At(e[t]):w,a)),n.set(t,r)),W(r)===w)?!1:i},set(e,t,o,s){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var f=o;f<l.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=c(()=>N(w,a)),n.set(f+``,p)):P(p,w)}if(l===void 0)(!u||d(e,t)?.writable)&&(l=c(()=>N(void 0,a)),P(l,At(o)),n.set(t,l));else{u=l.v!==w;var m=c(()=>At(o));P(l,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,o),!u){if(r&&typeof t==`string`){var g=n.get(`length`),ee=Number(t);Number.isInteger(ee)&&ee>=g.v&&P(g,ee+1)}Ot(i)}return!0},ownKeys(e){W(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==w});for(var[r,a]of n)a.v!==w&&!(r in e)&&t.push(r);return t},setPrototypeOf(){me()}})}var jt,Mt,Nt,Pt;function Ft(){if(jt===void 0){jt=window,Mt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Nt=d(t,`firstChild`).get,Pt=d(t,`nextSibling`).get,h(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),h(n)&&(n.__t=void 0)}}function It(e=``){return document.createTextNode(e)}function Lt(e){return Nt.call(e)}function Rt(e){return Pt.call(e)}function zt(e,t){if(!T)return Lt(e);var n=Lt(E);if(n===null)n=E.appendChild(It());else if(t&&n.nodeType!==3){var r=It();return n?.before(r),be(r),r}return t&&Ht(n),be(n),n}function Bt(e,t=1,n=!1){let r=T?E:e;for(var i;t--;)i=r,r=Rt(r);if(!T)return r;if(n){if(r?.nodeType!==3){var a=It();return r===null?i?.after(a):r.before(a),be(a),a}Ht(r)}return be(r),r}function Vt(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function Ht(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Ut(e){var t=I,n=z;R(null),hn(null);try{return e()}finally{R(t),hn(n)}}function Wt(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Gt(e,t){var n=z;n!==null&&n.f&8192&&(e|=b);var r={ctx:D,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};j?.register_created_effect(r);var i=r;if(e&4)Ke===null?Xe.ensure().schedule(r):Ke.push(r);else if(t!==null){try{On(r)}catch(e){throw F(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=re))}if(i!==null&&(i.parent=n,n!==null&&Wt(i,n),I!==null&&I.f&2&&!(e&64))){var a=I;(a.effects??=[]).push(i)}return r}function Kt(){return I!==null&&!L}function qt(e){let t=Gt(8,null);return k(t,_),t.teardown=e,t}function Jt(e){return Gt(4|ae,e)}function Yt(e){Xe.ensure();let t=Gt(64|ie,e);return(e={})=>new Promise(n=>{e.outro?cn(t,()=>{F(t),n(void 0)}):(F(t),n(void 0))})}function Xt(e){return Gt(4,e)}function Zt(e){return Gt(ce|ie,e)}function Qt(e,t=0){return Gt(8|t,e)}function $t(e,t=[],n=[],r=[]){lt(r,t,n,t=>{Gt(8,()=>e(...t.map(W)))})}function en(e,t=0){return Gt(16|t,e)}function tn(e){return Gt(32|ie,e)}function nn(e){var t=e.teardown;if(t!==null){let e=pn,n=I;mn(!0),R(null);try{t.call(null)}finally{mn(e),R(n)}}}function rn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Ut(()=>{e.abort(C)});var r=n.next;n.f&64?n.parent=null:F(n,t),n=r}}function an(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||F(t),t=n}}function F(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(on(e.nodes.start,e.nodes.end),n=!0),k(e,ne),rn(e,t&&!n),Dn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();nn(e),e.f^=ne,e.f|=x;var i=e.parent;i!==null&&i.first!==null&&sn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function on(e,t){for(;e!==null;){var n=e===t?null:Rt(e);e.remove(),e=n}}function sn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function cn(e,t,n=!0){var r=[];ln(e,r,!0);var i=()=>{n&&F(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function ln(e,t,n){if(!(e.f&8192)){e.f^=b;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;ln(i,t,o?n:!1),i=a}}}function un(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Rt(n);t.append(n),n=i}}var dn=null,fn=!1,pn=!1;function mn(e){pn=e}var I=null,L=!1;function R(e){I=e}var z=null;function hn(e){z=e}var B=null;function gn(e){I!==null&&(!Oe||I.f&2)&&(B===null?B=[e]:B.push(e))}var V=null,H=0,U=null;function _n(e){U=e}var vn=1,yn=0,bn=yn;function xn(e){bn=e}function Sn(){return++vn}function Cn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~oe),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Cn(a)&&yt(a),a.wv>e.wv)return!0}t&512&&M===null&&k(e,_)}return!1}function wn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Oe&&B!==null&&c.call(B,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?wn(a,t,!1):t===a&&(n?k(a,v):a.f&1024&&k(a,y),nt(a))}}function Tn(e){var t=V,n=H,r=U,i=I,a=B,o=D,s=L,c=bn,l=e.f;V=null,H=0,U=null,I=l&96?null:e,B=null,Ae(e.ctx),L=!1,bn=++yn,e.ac!==null&&(Ut(()=>{e.ac.abort(C)}),e.ac=null);try{e.f|=se;var u=e.fn,d=u();e.f|=S;var f=e.deps,p=j?.is_fork;if(V!==null){var m;if(p||Dn(e,H),f!==null&&H>0)for(f.length=H+V.length,m=0;m<V.length;m++)f[H+m]=V[m];else e.deps=f=V;if(Kt()&&e.f&512)for(m=H;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&H<f.length&&(Dn(e,H),f.length=H);if(Ne()&&U!==null&&!L&&f!==null&&!(e.f&6146))for(m=0;m<U.length;m++)wn(U[m],e);if(i!==null&&i!==e){if(yn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=yn;if(t!==null)for(let e of t)e.rv=yn;U!==null&&(r===null?r=U:r.push(...U))}return e.f&8388608&&(e.f^=le),d}catch(e){return Ie(e)}finally{e.f^=se,V=t,H=n,U=r,I=i,B=a,Ae(o),L=s,bn=c}}function En(e,t){let n=t.reactions;if(n!==null){var r=s.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(V===null||!c.call(V,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~oe),a.v!==w&&ze(a),bt(a),Dn(a,0)}}function Dn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)En(e,n[r])}function On(e){var t=e.f;if(!(t&16384)){k(e,_);var n=z,r=fn;z=e,fn=!0;try{t&16777232?an(e):rn(e),nn(e);var i=Tn(e);e.teardown=typeof i==`function`?i:null,e.wv=vn}finally{fn=r,z=n}}}function W(e){var t=(e.f&2)!=0;if(dn?.add(e),I!==null&&!L&&!(z!==null&&z.f&16384)&&(B===null||!c.call(B,e))){var n=I.deps;if(I.f&2097152)e.rv<yn&&(e.rv=yn,V===null&&n!==null&&n[H]===e?H++:V===null?V=[e]:V.push(e));else{(I.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[I]:c.call(r,I)||r.push(I)}}if(pn&&Ct.has(e))return Ct.get(e);if(t){var i=e;if(pn){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||An(i))&&(a=vt(i)),Ct.set(i,a),a}var o=(i.f&512)==0&&!L&&I!==null&&(fn||(I.f&512)!=0),s=(i.f&S)===0;Cn(i)&&(o&&(i.f|=512),yt(i)),o&&!s&&(xt(i),kn(i))}if(M?.has(e))return M.get(e);if(e.f&8388608)throw e.v;return e.v}function kn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(xt(t),kn(t))}function An(e){if(e.v===w)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ct.has(t)||t.f&2&&An(t))return!0;return!1}function G(e){var t=L;try{return L=!0,e()}finally{L=t}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var jn=[`touchstart`,`touchmove`];function Mn(e){return jn.includes(e)}var Nn=Symbol(`events`),Pn=new Set,Fn=new Set,In=null;function Ln(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;In=e;var o=0,s=In===e&&e[Nn];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Nn]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){u(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=I,f=z;R(null),hn(null);try{for(var p,m=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[Nn]?.[r];g!=null&&(!a.disabled||e.target===a)&&g.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Nn]=t,delete e.currentTarget,R(d),hn(f)}}}var Rn=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function zn(e){return Rn?.createHTML(e)??e}function Bn(e){var t=Vt(`template`);return t.innerHTML=zn(e.replaceAll(`<!>`,`<!---->`)),t.content}function Vn(e,t){var n=z;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Hn(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(T)return Vn(E,null),E;i===void 0&&(i=Bn(a?e:`<!>`+e),n||(i=Lt(i)));var t=r||Mt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Lt(t),s=t.lastChild;Vn(o,s)}else Vn(t,t);return t}}function Un(e,t){if(T){var n=z;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=E),xe();return}e!==null&&e.before(t)}function Wn(e,t){return Kn(e,t)}var Gn=new Map;function Kn(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){Ft();var c=void 0,u=Yt(()=>{var o=n??t.appendChild(It());st(o,{pending:()=>{}},t=>{je({});var n=D;if(a&&(n.c=a),i&&(r.$$events=i),T&&Vn(t,null),c=e(t,r)||{},T&&(z.nodes.end=E,E===null||E.nodeType!==8||E.data!==`]`))throw ve(),_e;Me()},s);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Mn(r);for(let e of[t,document]){var a=Gn.get(e);a===void 0&&(a=new Map,Gn.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Ln,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(l(Pn)),Fn.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=Gn.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Ln),r.delete(e),r.size===0&&Gn.delete(n)):r.set(e,i)}Fn.delete(d),o!==n&&o.parentNode?.removeChild(o)}});return qn.set(c,u),c}var qn=new WeakMap;function Jn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Jn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Yn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Jn(e))&&(r&&(r+=` `),r+=t);return r}function Xn(e){return typeof e==`object`?Yn(e):e??``}var Zn=[...`
|
|
2
|
-
\r\f\xA0\v`];function Qn(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Zn.includes(r[o-1]))&&(s===r.length||Zn.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function $n(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function er(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function tr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(er)),i&&c.push(...Object.keys(i).map(er));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=er(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=$n(r)),i&&(n+=$n(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function nr(e,t,n,r,i,a){var o=e.__className;if(T||o!==n||o===void 0){var s=Qn(n,r,a);(!T||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function rr(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function ir(e,t,n,r){var i=e.__style;if(T||i!==t){var a=tr(t,r);(!T||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(rr(e,n?.[0],r[0]),rr(e,n?.[1],r[1],`important`)):rr(e,n,r));return r}function ar(e,t){return e===t||e?.[ue]===t}function or(e={},t,n,r){var i=D.r,a=z;return Xt(()=>{var o,s;return Qt(()=>{o=s,s=r?.()||[],G(()=>{e!==n(...s)&&(t(e,...s),o&&ar(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ar(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var sr=25e-5,cr=.1,lr=.2,ur=1e6,dr=2e6,fr=3e6,pr=class{div;marker;inserted;constructor(e,t,n,r){this.div=document.createElement(`div`),this.marker=e.createMarker({element:this.div,lat:t,lng:n,z:r}),this.inserted=!1}insert(){this.inserted!==!0&&(this.marker.insert(),this.inserted=!0)}remove(){this.inserted!==!1&&(this.marker.remove(),this.inserted=!1)}update(e){this.marker.update(e)}},mr=class e{shown;id;lat;lng;rank;marker;constructor(t,n,r,i,a){if(new.target===e)throw Error(`Unsupported code`);this.shown=!0,this.id=t,this.lat=n,this.lng=r,this.rank=i,this.marker=a}};typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);function hr(e){return-.5*(Math.cos(Math.PI*e)-1)}var gr=class{animating;animationEasing;animationCallback;value;time;constructor(e){if(e.max<=e.min)throw Error(`Invalid min or max`);if(e.value<e.min||e.max<e.value)throw Error(`Invalid value`);this.animationEasing=e.easing,this.animationCallback=e.callback,this.animating=!1,this.value={current:e.value,start:e.value,end:e.value,min:e.min,max:e.max},this.time={start:0,end:0,span:e.timespan}}animationFrame(){let e=performance.now();if(e>this.time.end)this.value.current=this.value.end;else{let t=(e-this.time.start)/(this.time.end-this.time.start),n=this.animationEasing(t);this.value.current=this.value.start+(this.value.end-this.value.start)*n}if(this.animationCallback(this.value.current),this.value.current===this.value.end){this.animating=!1;return}window.requestAnimationFrame(this.animationFrame.bind(this))}target(e){if(e===this.value.end)return;this.value.start=this.value.current,this.value.end=e;let t=performance.now(),n=Math.abs(this.value.start-this.value.end),r=this.value.max-this.value.min;this.time.start=t,this.time.end=t+this.time.span*Math.sqrt(n/r),!this.animating&&(this.animating=!0,window.requestAnimationFrame(this.animationFrame.bind(this)))}set(e){if(e===this.value.end)return;this.value.current=e,this.value.start=e,this.value.end=e;let t=performance.now();this.time.start=t,this.time.end=t,window.requestAnimationFrame(this.animationCallback.bind(this,e))}end(){this.set(this.value.end)}expired(){return performance.now()>this.time.end}},_r=Hn(`<div></div>`);function vr(e,t){je(t,!0);let n=G(()=>t.id),r=G(()=>t.element),i=G(()=>t.style),a=G(()=>t.dimensions),o=G(()=>t.initialize),s={setDisplayed:ee,getDisplayed:te,setCollapsed:v,getCollapsed:y,setScale:ne};function c(){return s}let l,u=a.radius*2,d=a.stroke,f=i?.background??`#008800`,p=i?.stroke??`#ffffff`,m=i?.shadow??`0px 2px 2px rgba(0, 0, 0, 0.5)`,h=N(!1),g=!1;function ee(e){e===!0&&(l&&r&&r.parentElement!==l&&l.appendChild(r),g===!1&&o&&r&&(g=!0,setTimeout(async()=>await o(n,r),0))),e!==W(h)&&(P(h,e,!0),e===!1&&S.end())}function te(){return W(h)}let _=N(!0);function v(e){e!==W(_)&&(P(_,e,!0),S.target(W(_)?0:b))}function y(){return W(h)?S.expired():!0}let b=0,x=1,S=new gr({value:0,min:0,max:1,timespan:75,easing:hr,callback:re});function ne(e,t){b=e,x=t,S.target(e)}function re(e){l.style.scale=e.toString(),l.style.opacity=e.toString(),l.style.filter=`brightness(${ie(e)})`}function ie(e){return 1-x*(1-e)}var ae={invoke:c},oe=_r();let se;return or(oe,e=>l=e,()=>l),$t(e=>{nr(oe,1,Xn([`pin`,W(h)&&`displayed`]),`svelte-10kxbrm`),se=ir(oe,``,se,e)},[()=>({width:`${u}px`,height:`${u}px`,"border-radius":`${u/2}px`,"border-color":p,"border-width":`${d}px`,"background-color":`rgb(from ${f} r g b / 1)`,"box-shadow":m,scale:0,filter:`brightness(${ie(0)})`})]),Un(e,oe),Me(ae)}var yr=1e6,br=class extends mr{properties;zoom;component;constructor(e,t,n,r,i,a){super(t,n,r,i,new pr(e,n,r,i)),this.properties=a,this.zoom=NaN,this.component=Wn(vr,{target:this.marker.div,props:a})}get zIndex(){return Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*5)+ur}},xr=class{animating;animationTimestamp;animationEnd;animationCallback;speed;value;constructor(e){this.animating=!1,this.animationTimestamp=0,this.animationEnd=0,this.animationCallback=e.callback,this.speed={current:0,spring:{stiffness:e.stiffness,damping:2*Math.sqrt(e.stiffness)}},this.value={current:e.value,target:e.value,precision:e.precision,min:e.min,max:e.max}}animationFrame(){try{let e=performance.now(),t=e-this.animationTimestamp;if(this.animationTimestamp=e,e>=this.animationEnd){this.speed.current=0,this.value.current=this.value.target;return}let n=this.value.target-this.value.current;if(Math.abs(n)<this.value.precision){this.speed.current=0,this.value.current=this.value.target;return}let r=n*this.speed.spring.stiffness-this.speed.spring.damping*this.speed.current;if(this.speed.current+=r*t,this.value.current+=this.speed.current*t,this.value.current<this.value.min){this.value.current=this.value.target,this.speed.current=0;return}if(this.value.current>this.value.max){this.value.current=this.value.target,this.speed.current=0;return}}finally{if(this.animationCallback(this.value.current),this.value.current===this.value.target){this.animating=!1;return}window.requestAnimationFrame(this.animationFrame.bind(this))}}target(e){if(e===this.value.target)return;this.value.target=e;let t=performance.now();this.animationEnd=t+Math.sqrt(2*Math.abs(e-this.value.current)/this.speed.spring.stiffness),this.animating===!1&&(this.animating=!0,this.animationTimestamp=t,window.requestAnimationFrame(this.animationFrame.bind(this)))}set(e){e!==this.value.target&&(this.value.current=e,this.value.target=e,this.speed.current=0,this.animating=!1,this.animationTimestamp=performance.now(),this.animationEnd=performance.now(),window.requestAnimationFrame(this.animationCallback.bind(this,e)))}end(){this.set(this.value.target)}expired(){return performance.now()>this.animationEnd}};function Sr(e,t,n){if(e<=0||t<=0)return{x:0,y:0};let r=e/2,i=t/2,a=Math.sqrt(r*r+i*i),o=Math.atan(i/r)*(180/Math.PI),s=Math.PI/180*n;return n<180?n<90?n<o?{x:0,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:0}:n<180-o?{x:a*Math.cos(s)-r,y:0}:{x:-e,y:a*Math.sin(s)-i}:n<270?n<180+o?{x:-e,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:-t}:n<360-o?{x:a*Math.cos(s)-r,y:-t}:{x:0,y:a*Math.sin(s)-i}}var Cr=Hn(`<div><div class="element pointer svelte-1no6o2a"></div> <div class="element bubble svelte-1no6o2a"><div class="element body svelte-1no6o2a"></div></div></div>`);function wr(e,t){je(t,!0);let n=G(()=>t.id),r=G(()=>t.element),i=G(()=>t.style),a=G(()=>t.dimensions),o=G(()=>t.initialize),s={setDisplayed:fe,getDisplayed:pe,setCollapsed:he,getCollapsed:ge,getExpanded:_e,setAngle:we};function c(){return s}let l,u,d,f,p=Math.min(4,1+3*(a.width*a.height)/65536),m=i?.filter??`drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.5))`,h=a.width+2*a.padding,g=a.height+2*a.padding,ee=a.padding,te=a.width,_=a.height,v=i?.radius??0,y=a.width,b=a.height,x=Math.min(i?.radius??8,Math.min(y,b)/2),S=Math.min(1,2*x/Math.min(b,y)),ne=i?.background??`#ffffff`,re=a.padding*2,ie=Math.min(3,.5*x),ae=i?.background??`#ffffff`,oe=g<h?g/h:1,se=h<g?h/g:1,ce=Math.min(h,g)/2,le=ce*Math.SQRT2,ue=15*Math.SQRT2,C=!1,de=N(!1);function fe(e){e!==W(de)&&(P(de,e,!0),e===!0&&(r&&r.parentElement!==u&&u.appendChild(r),C===!1&&o&&r&&(C=!0,setTimeout(async()=>await o(n,r),0))),e===!1&&(w.end(),be.end(),Ce.end()))}function pe(){return W(de)}let me=N(!0);function he(e){e!==W(me)&&(P(me,e,!0),w.target(+!W(me)))}function ge(){return W(de)?w.expired():!0}function _e(){return W(de)?w.expired():!1}let w=new gr({value:0,min:0,max:1,timespan:125*Math.cbrt(p),easing:hr,callback:ve});function ve(e){l.style.opacity=`${e}`,l.style.scale=`${e}`,u.style.opacity=`${e}`}let ye=NaN,T=N(!1),E=-h/2,be=new xr({value:-h/2,min:-h-h*cr,max:h*cr,precision:1,stiffness:sr/p,callback:Te}),xe=-g/2,Ce=new xr({value:-g/2,min:-g-g*cr,max:g*cr,precision:1,stiffness:sr/p,callback:Ee});function we(e,t){if(Number.isNaN(e)){ye=NaN,P(T,!1);return}if(W(T)===!1||t===!0){P(T,!0),ye=e;let t=Sr(h,g,e);be.set(Math.round(t.x)),Ce.set(Math.round(t.y));return}if(ye!==e){ye=e;let t=Sr(h,g,e);be.target(Math.round(t.x)),Ce.target(Math.round(t.y));return}}function Te(e){E=e,De(E,xe)}function Ee(e){xe=e,De(E,xe)}function De(e,t){let n=e+h/2,r=t+g/2,i=n*oe,a=r*se,o=Math.sqrt(i*i+a*a),s=(o-ce)/(le-ce),c=Math.atan2(a,i)/Math.PI*180-45,l=15+s*(ue-15),u=o<ce?o/ce:1,p=.5*((1+.5*S)*s),m=e+ee*(1-i/ce*p),te=t+ee*(1-a/ce*p);f.style.transform=`scale(${u}) rotate(${c}deg) skew(${l}deg, ${l}deg)`,d.style.transform=`translate(${Math.round(m)}px, ${Math.round(te)}px)`}var Oe={invoke:c},ke=Cr();let D;var Ae=zt(ke);let Ne;or(Ae,e=>f=e,()=>f);var O=Bt(Ae,2);let Pe;var Fe=zt(O);let Ie;return or(Fe,e=>u=e,()=>u),Se(O),or(O,e=>d=e,()=>d),Se(ke),or(ke,e=>l=e,()=>l),$t(()=>{nr(ke,1,Xn([`element anchor`,W(de)&&`displayed`]),`svelte-1no6o2a`),D=ir(ke,``,D,{filter:m}),Ne=ir(Ae,``,Ne,{width:`${re}px`,height:`${re}px`,"border-radius":`${ie}px`,"background-color":`rgb(from ${ae} r g b / 1)`}),Pe=ir(O,``,Pe,{width:`${y}px`,height:`${b}px`,"border-radius":`${x}px`,"background-color":`rgb(from ${ne} r g b / 1)`}),Ie=ir(Fe,``,Ie,{width:`${te}px`,height:`${_}px`,"border-radius":`${v}px`})}),Un(e,ke),Me(Oe)}var Tr=class extends mr{width;height;zoom;angle;directions;component;constructor(e,t,n,r,i,a){super(t,n,r,i,new pr(e,n,r,i)),this.width=a.dimensions.width+a.dimensions.padding*2,this.height=a.dimensions.height+a.dimensions.padding*2,this.zoom=NaN,this.angle=NaN,this.directions=[],this.component=Wn(wr,{target:this.marker.div,props:a})}get zIndex(){return Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*5)+dr}},Er=class extends mr{width;height;padding;angle;component;constructor(e,t,n,r,i,a){super(t,n,r,i,new pr(e,n,r,fr)),this.width=a.dimensions.width,this.height=a.dimensions.height,this.padding=a.dimensions.padding,this.angle=NaN,this.shown=!1,this.component=Wn(wr,{target:this.marker.div,props:a})}get zIndex(){return fr}},Dr=class{id;state=void 0;pin;tooltip;popup;constructor(e,t){let n=t.properties.id,r=t.properties.lat,i=t.properties.lng,a=t.properties.rank,o=t.properties.pin,s=t.properties.tooltip,c=t.properties.popup;this.id=n,this.pin=new br(e,n,r,i,a,o),this.tooltip=new Tr(e,n,r,i,a,s),this.popup=c?new Er(e,n,r,i,a,c):void 0}};function Or(e,t,n){return{x:Ar(t)*n,y:jr(e)*n}}function kr(e,t,n){return{lat:Nr(t/n),lng:Mr(e/n)}}function Ar(e){return(180+e)/360}function jr(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Mr(e){return e*360-180}function Nr(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}var Pr=class{sw;ne;constructor(e,t,n,r){if(n<e||r<t)throw Error(`Invalid bounds: ${e}, ${t}, ${n}, ${r}`);this.sw={lat:e,lng:t},this.ne={lat:n,lng:r}}contains(e,t){return!(e<this.sw.lat||this.ne.lat<e||t<this.sw.lng||this.ne.lng<t)}intersects(e){return!(e.ne.lat<this.sw.lat||this.ne.lat<e.sw.lat||e.ne.lng<this.sw.lng||this.ne.lng<e.sw.lng)}},Fr=class e{blockL;blockR;sw;ne;constructor(e,t,n,r){if(n<e)throw Error(`Invalid bounds: ${e}, ${t}, ${n}, ${r}`);this.sw={lat:e,lng:t},this.ne={lat:n,lng:r},t<r?(this.blockL=new Pr(e,t,n,r),this.blockR=new Pr(0,0,0,0)):(this.blockL=new Pr(e,-180,n,r),this.blockR=new Pr(e,t,n,180))}static bounds(e){let t=e.bounds,n=e.center;return t.sw.lng<=n.lng&&t.ne.lng<=n.lng||t.sw.lng>=n.lng&&t.ne.lng>=n.lng||Math.abs(t.ne.lng-n.lng)+Math.abs(t.sw.lng-n.lng)>360||t.ne.lng-t.sw.lng>360?{sw:{lat:t.sw.lat,lng:-180},ne:{lat:t.ne.lat,lng:180}}:e.bounds}static create(t){let n=this.bounds(t),r=n.sw,i=n.ne;return new e(r.lat,r.lng,i.lat,i.lng)}static offset(t,n,r){let i=this.bounds(t),a=n*2**t.zoom,o=Or(i.sw.lat,i.sw.lng,a),s=Or(i.ne.lat,i.ne.lng,a),c=Math.max(o.x-r.left,0),l=Math.min(o.y+r.bottom,a),u=Math.min(s.x+r.right,a),d=Math.max(s.y-r.top,0),f=kr(c,l,a),p=kr(u,d,a);return new e(f.lat,f.lng,p.lat,p.lng)}contains(e,t){return this.blockL.contains(e,t)||this.blockR.contains(e,t)}intersects(e){return this.blockL.intersects(e)||this.blockR.intersects(e)}};function Ir(e,t,n){let r=e.replace(/^#/,``),i,a,o,s;if(r.length!==6&&r.length!==8)throw Error(`Invalid hex color: must be 6 or 8 characters`);return r.length===8?(i=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16),s=parseInt(r.substring(6,8),16)):(i=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16),s=255),i=Math.round(i*(1-t)),a=Math.round(a*(1-t)),o=Math.round(o*(1-t)),s=s*n/255,i=Math.max(0,Math.min(255,i)),a=Math.max(0,Math.min(255,a)),o=Math.max(0,Math.min(255,o)),s=Math.max(0,Math.min(1,s)),`rgba(${i}, ${a}, ${o}, ${s.toFixed(2)})`}var Lr=class{provider;pinMaxSize=0;pinFadeoutColor=lr;pinFadeoutScale=lr;pinFadeoutOpacity=1;pinFadeoutModifier=1;pinMaxDepth=3;pinDepth=3;pins=new Set;constructor(e,t){this.provider=e,this.pinFadeoutColor=t?.pin?.fadeout?.color??.2,this.pinFadeoutScale=t?.pin?.fadeout?.scale??.2,this.pinFadeoutOpacity=t?.pin?.fadeout?.opacity??1,this.pinFadeoutModifier=this.pinFadeoutColor<this.pinFadeoutScale?this.pinFadeoutColor/this.pinFadeoutScale:1,this.pinMaxDepth=t?.pin?.depth??3,this.pinDepth=this.pinMaxDepth}insert(e,t){this.update(e,t),this.pins.add(e)}update(e,t){e.zoom=t?.zoom??NaN,e.marker.update(e.zIndex)}remove(e){e.shown=!0,e.zoom=NaN,e.component.invoke().setCollapsed(!1),e.component.invoke().setDisplayed(!1),e.marker.update(e.zIndex),e.marker.remove(),this.pins.delete(e)}clear(){this.pins.forEach(e=>e.marker.remove()),this.pins.clear(),this.provider.updateCircles([],this.pinMaxDepth)}refresh(){let e=Array.from(this.pins);this.pinMaxSize=e.reduce((e,t)=>Math.max(e,t.properties.dimensions.radius*2),0),this.pinDepth=Math.max(1,this.pinMaxDepth-Math.log10(e.length))}draw(){let e=Array.from(this.pins),t=[];for(let n=0;n<e.length;n++){let r=e[n],i=Math.max(0,Math.min(1,this.pinFadeoutColor*this.pinMaxDepth)),a=Math.max(0,Math.min(1,this.pinFadeoutScale*this.pinMaxDepth)),o=Math.max(0,Math.min(1,this.pinFadeoutOpacity*this.pinMaxDepth)),s=r.properties.style?.background??`#008800`,c=Ir(s,0,1),l=Ir(s,i,o),u=r.properties.dimensions.radius-r.properties.dimensions.stroke,d=u*(1-a),f=r.properties.style?.stroke??`#ffffff`,p=Ir(f,0,1),m=Ir(f,i,o),h=r.properties.dimensions.stroke,g=h*(1-a),ee={color:{min:l,max:c},radius:{min:d,max:u},stroke:{color:{min:m,max:p},width:{min:g,max:h}},lat:r.lat,lng:r.lng,rank:r.rank,zoom:r.zoom};t.push(ee)}this.provider.updateCircles(t,this.pinMaxDepth)}render(e,t){let n=e.zoom,r=Fr.offset(e,t.size,{top:this.pinMaxSize,bottom:this.pinMaxSize,right:this.pinMaxSize,left:this.pinMaxSize});for(let e of this.pins)if(r.contains(e.lat,e.lng))if(Number.isNaN(e.zoom)===!1&&e.shown&&n<e.zoom&&e.zoom<n+this.pinDepth){let t=(e.zoom-n)/this.pinDepth;e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setScale(Math.max(0,1-t*this.pinFadeoutScale),this.pinFadeoutModifier),e.marker.insert()}else e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove());else e.component.invoke().setDisplayed(!1),e.marker.remove()}},Rr=class{tooltipMaxWidth=0;tooltipMaxHeight=0;tooltips=new Set;constructor(e,t){}insert(e,t){this.update(e,t),this.tooltips.add(e)}update(e,t){t?(e.zoom=t.zoom,e.directions=t.directions):(e.zoom=NaN,e.directions=[]),e.marker.update(e.zIndex)}remove(e){e.shown=!0,e.zoom=NaN,e.angle=NaN,e.directions=[],e.component.invoke().setAngle(NaN),e.component.invoke().setCollapsed(!0),e.component.invoke().setDisplayed(!1),e.marker.update(e.zIndex),e.marker.remove(),this.tooltips.delete(e)}clear(){this.tooltips.forEach(e=>e.marker.remove()),this.tooltips.clear()}refresh(){let e=Array.from(this.tooltips);this.tooltipMaxWidth=e.reduce((e,t)=>Math.max(e,t.width),0),this.tooltipMaxHeight=e.reduce((e,t)=>Math.max(e,t.height),0)}render(e,t){let n=e.zoom,r=Fr.offset(e,t.size,{top:this.tooltipMaxHeight,bottom:this.tooltipMaxHeight,right:this.tooltipMaxWidth,left:this.tooltipMaxWidth});for(let e of this.tooltips)if(r.contains(e.lat,e.lng))if(Number.isNaN(e.zoom)===!1&&e.shown&&e.zoom<=n){let t=e.directions.findLast(e=>e.zoom<=n)?.angle;if(t===void 0)throw Error(`Failed to find angle`);e.angle=t,e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setAngle(t),e.marker.insert()}else e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove());else e.component.invoke().setDisplayed(!1),e.marker.remove()}},zr=class{provider;pan=!0;popups=new Set;constructor(e,t){this.provider=e,this.pan=t?.popup?.pan??!0}insert(e){this.popups.add(e)}remove(e){e.angle=NaN,e.shown=!1,e.marker.remove(),e.component.invoke().setAngle(NaN),e.component.invoke().setCollapsed(!0),e.component.invoke().setDisplayed(!1),this.popups.delete(e)}clear(){this.popups.forEach(e=>e.marker.remove()),this.popups.clear()}show(e){if(!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!1,e.tooltip.shown=!1,e.popup.angle=e.tooltip.angle,e.popup.shown=!0,this.pan===!1))return;let t=this.provider.getViewport(),n=this.provider.getParameters().size,r=t.bounds,i=t.zoom,a=e.popup,o=n*2**i,s=Or(r.ne.lat,r.sw.lng,o),c=Or(r.sw.lat,r.ne.lng,o),l=c.x-s.x,u=c.y-s.y,d=a.width+a.padding*8,f=a.height+a.padding*8,p=Or(a.lat,a.lng,o),m=Sr(d,f,e.tooltip.angle),h=p.x+m.x,g=h+d,ee=p.y+m.y,te=ee+f,_=h-s.x,v=c.x-g,y=ee-s.y,b=c.y-te,x=0;l<d?x=(_-v)/2:(_<0&&(x=_),v<0&&(x=-v));let S=0;u<f?S=(y-b)/2:(y<0&&(S=y),b<0&&(S=-b)),(x!==0||S!==0)&&this.provider.panBy(x,S)}hide(e){!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}render(){for(let e of this.popups)e.shown?(e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setAngle(e.angle,!0),e.marker.insert()):(e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove()))}},Br=class{provider;pinManager;tooltipManager;popupManager;elementsStore;constructor(e,t){this.provider=e,this.pinManager=new Lr(e,t),this.tooltipManager=new Rr(e,t),this.popupManager=new zr(e,t),this.elementsStore=new Map}clearElements(){this.elementsStore.clear(),this.pinManager.clear(),this.tooltipManager.clear(),this.popupManager.clear()}removeElements(e){if(e.length!==0){for(let t of e){let e=this.elementsStore.get(t.properties.id);e!==void 0&&(this.pinManager.remove(e.pin),this.tooltipManager.remove(e.tooltip),e.popup!==void 0&&this.popupManager.remove(e.popup))}this.pinManager.refresh(),this.tooltipManager.refresh(),this.pinManager.draw()}}updateElements(e){if(e.length!==0){for(let t of e){let e=this.elementsStore.get(t.properties.id);e!==void 0&&(this.pinManager.update(e.pin,t.state),this.tooltipManager.update(e.tooltip,t.state))}this.pinManager.draw()}}insertElements(e,t){if(e.length!==0){for(let n of e){let e=this.elementsStore.get(n.properties.id);e===void 0&&(e=new Dr(this.provider,n),e.tooltip.marker.div.addEventListener(`click`,e=>t(e,n.properties.id)),this.elementsStore.set(n.properties.id,e)),this.pinManager.insert(e.pin,n.state),this.tooltipManager.insert(e.tooltip,n.state),e.popup!==void 0&&this.popupManager.insert(e.popup)}this.pinManager.refresh(),this.tooltipManager.refresh(),this.pinManager.draw()}}renderElements(e,t){this.popupManager.render(),this.tooltipManager.render(e,t),this.pinManager.render(e,t)}showPopup(e){let t=this.elementsStore.values();for(let n of t)n.id===e?this.popupManager.show(n):this.popupManager.hide(n)}hidePopup(e){let t=this.elementsStore.get(e);t!==void 0&&this.popupManager.hide(t)}hidePopups(){let e=this.elementsStore.values();for(let t of e)this.popupManager.hide(t)}},Vr=14097894508562428199n,Hr=13011662864482103923n,Ur=11160318154034397263n,Wr=14504361325974414679n,K=18446744073709551615n;function q(e){return e&K}function J(e,t){return t===0?e&K:(e&=K,(e>>BigInt(t)|e<<BigInt(64-t))&K)}function Gr(e,t){return e&=K,(e>>BigInt(t)|e<<BigInt(64-t))&K}function Kr(e){return q(e^e>>47n)}function Y(e,t=0){let n=0n;for(let r=0;r<8;r++)t+r<e.length&&(n|=BigInt(e[t+r])<<BigInt(r*8));return n&K}function qr(e,t=0){let n=0n;for(let r=0;r<4;r++)t+r<e.length&&(n|=BigInt(e[t+r])<<BigInt(r*8));return n&4294967295n}function Jr(e){let t=11376068507788127593n,n=(e.first^e.second)*t&K;n^=n>>47n,n&=K;let r=(e.second^n)*t&K;return r^=r>>47n,r=r*t&K,r}function Yr(e,t){return Jr({first:e,second:t})}function Xr(e){let t=e.length;if(t>8){let n=Y(e),r=Y(e,t-8);return(Yr(n,Gr(r+BigInt(t)&K,t))^r)&K}if(t>=4){let n=qr(e);return Yr(BigInt(t)+(n<<3n)&K,qr(e,t-4))}if(t>0){let n=BigInt(e[0]),r=BigInt(e[t>>1]),i=BigInt(e[t-1]),a=q(n+(r<<8n)),o=q(BigInt(t)+(i<<2n));return q(Kr(q(a*Ur)^q(o*Wr))*Ur)}return Ur}function Zr(e){let t=e.length,n=q(Y(e)*Hr),r=Y(e,8),i=q(Y(e,t-8)*Ur),a=q(Y(e,t-16)*Vr);return Yr(q(J(q(n-r),43)+J(i,30)+a),q(n+J(r^Wr,20)-i+BigInt(t)))}function Qr(e,t,n,r,i,a){i=q(i+e),a=J(q(a+i+r),21);let o=i;return i=q(i+t),i=q(i+n),a=q(a+J(i,44)),{first:q(i+r),second:q(a+o)}}function $r(e,t,n,r){return Qr(Y(e,t),Y(e,t+8),Y(e,t+16),Y(e,t+24),n,r)}function ei(e){let t=e.length,n=Y(e,24),r=q(Y(e)+q((BigInt(t)+Y(e,t-16))*Vr)),i=J(q(r+n),52),a=J(r,37);r=q(r+Y(e,8)),a=q(a+J(r,7)),r=q(r+Y(e,16));let o=q(r+n),s=q(i+J(r,31)+a);r=q(Y(e,16)+Y(e,t-32));let c=Y(e,t-8);i=J(q(r+c),52),a=J(r,37),r=q(r+Y(e,t-24)),a=q(a+J(r,7)),r=q(r+Y(e,t-16));let l=q(r+c);return q(Kr(q(Kr(q(q(o+q(i+J(r,31)+a))*Ur+q(l+s)*Vr))*Vr+s))*Ur)}function ti(e){let t;t=typeof e==`string`?new TextEncoder().encode(e):e;let n=t.length;if(n<=32)return n<=16?Xr(t):Zr(t);if(n<=64)return ei(t);let r=Y(t),i=q(Y(t,n-16)^Hr),a=q(Y(t,n-56)^Vr),o=$r(t,n-64,BigInt(n),i),s=$r(t,n-32,q(BigInt(n)*Hr),Vr);a=q(a+Kr(o.second)*Hr),r=q(J(q(a+r),39)*Hr),i=q(J(i,33)*Hr);let c=n-1&-64,l=0;for(;c>0;)r=q(J(q(r+i+o.first+Y(t,l+16)),37)*Hr),i=q(J(q(i+o.second+Y(t,l+48)),42)*Hr),r^=s.second,i^=o.first,a=J(a^s.first,33),o=$r(t,l,q(o.second*Hr),q(r+s.first)),s=$r(t,l+32,q(a+s.second),i),[a,r]=[r,a],l+=64,c-=64;return Yr(Yr(o.first,s.first)+q(Kr(i)*Hr)+a,Yr(o.second,s.second)+r)}function ni(e){return ti(e).toString()}var ri=[0,30,60,90,120,150,180,210,240,270,300,330],ii=e=>e<180?e<90?e<30?0:e===30?1:2:e<120?3:e===120?4:5:e<270?e<210?6:e===210?7:8:e<300?9:e===300?10:11,ai=e=>new Promise(t=>setTimeout(t,e));async function oi(e,t){let n=0,r=Math.max(1,t?.retry?.times??1);for(;n<r;)try{return{data:await e(),error:null}}catch(e){if(n++,n===r){if(e instanceof Error)return(!t?.exceptions||t.exceptions.some(t=>e instanceof t)===!1)&&t?.catch?.(e),{data:null,error:e};throw t?.catch?.(e),e}else t?.retry?.delay&&await ai(t.retry.delay)}throw Error(`Unreachable code`)}function si(e){let t=new ArrayBuffer(4+e.items.length*16),n=new DataView(t);n.setUint8(0,e.parameters.size/256),n.setUint8(1,e.parameters.zoom.min),n.setUint8(2,e.parameters.zoom.max),n.setUint8(3,e.parameters.zoom.scale);let r=e.items.length,i=e.items,a=4;for(let e=0;e<r;e++){let t=i[e];n.setUint32(a+0,t.rank,!0),n.setInt32(a+4,Math.round(t.lat*yr),!0),n.setInt32(a+8,Math.round(t.lng*yr),!0),n.setUint16(a+12,Math.round(t.width*100),!0),n.setUint16(a+14,Math.round(t.height*100),!0),a+=16}return t}function ci(e){let t=new DataView(e),n=t.getUint32(0,!0),r=0;r+=4;let i=Array(n);for(let e=0;e<n;e++){let n=t.getUint8(r)/5,a=t.getUint8(r+1),o=Array(a);r+=2;for(let e=0;e<a;e++){let n=t.getUint8(r)/5,i=t.getUint8(r+1);r+=2,o[e]={zoom:n,angle:ri[i]}}i[e]={zoom:n,directions:o}}return i}var li=`X-Key`,ui=`X-Token`,di=`X-Version`,fi=`Cache-Control`,pi=`Content-Type`,mi;function hi(e){return{lang:e?.lang??mi?.lang,message:e?.message,abortEarly:e?.abortEarly??mi?.abortEarly,abortPipeEarly:e?.abortPipeEarly??mi?.abortPipeEarly}}var gi;function _i(e){return gi?.get(e)}var vi;function yi(e){return vi?.get(e)}var bi;function xi(e,t){return bi?.get(e)?.get(t)}function Si(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function X(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??Si(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},l=e.kind===`schema`,u=i?.message??e.message??xi(e.reference,c.lang)??(l?yi(c.lang):null)??r.message??_i(c.lang);u!==void 0&&(c.message=typeof u==`function`?u(c):u),l&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}function Z(e){return{version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},hi())}}}function Ci(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}var wi=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function Ti(e){return{kind:`transformation`,type:`args`,reference:Ti,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=(...e)=>{let r=this.schema[`~run`]({value:e},t);if(r.issues)throw new wi(r.issues);return n(...r.value)},e}}}var Ei=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u;function Di(e,t){return{kind:`validation`,type:`check`,reference:Di,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&X(this,`input`,e,t),e}}}function Oi(e){return{kind:`validation`,type:`hex_color`,reference:Oi,async:!1,expects:null,requirement:Ei,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&X(this,`hex color`,e,t),e}}}function ki(e,t){return{kind:`validation`,type:`length`,reference:ki,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length!==this.requirement&&X(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function Ai(e,t){return{kind:`validation`,type:`max_value`,reference:Ai,async:!1,expects:`<=${e instanceof Date?e.toJSON():Si(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value<=this.requirement)&&X(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():Si(e.value)}),e}}}function ji(e,t){return{kind:`validation`,type:`min_length`,reference:ji,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&X(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function Mi(e,t){return{kind:`validation`,type:`min_value`,reference:Mi,async:!1,expects:`>=${e instanceof Date?e.toJSON():Si(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>=this.requirement)&&X(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():Si(e.value)}),e}}}function Ni(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function Pi(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function Fi(){return{kind:`schema`,type:`any`,reference:Fi,expects:`any`,async:!1,get"~standard"(){return Z(this)},"~run"(e){return e.typed=!0,e}}}function Ii(e){return{kind:`schema`,type:`boolean`,reference:Ii,expects:`boolean`,async:!1,message:e,get"~standard"(){return Z(this)},"~run"(e,t){return typeof e.value==`boolean`?e.typed=!0:X(this,`type`,e,t),e}}}function Li(e,t){return{kind:`schema`,type:`custom`,reference:Li,expects:`unknown`,async:!1,check:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:X(this,`type`,e,t),e}}}function Ri(e){return{kind:`schema`,type:`function`,reference:Ri,expects:`Function`,async:!1,message:e,get"~standard"(){return Z(this)},"~run"(e,t){return typeof e.value==`function`?e.typed=!0:X(this,`type`,e,t),e}}}function zi(e,t){return{kind:`schema`,type:`literal`,reference:zi,expects:Si(e),async:!1,literal:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){return e.value===this.literal?e.typed=!0:X(this,`type`,e,t),e}}}function Bi(e){return{kind:`schema`,type:`number`,reference:Bi,expects:`number`,async:!1,message:e,get"~standard"(){return Z(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:X(this,`type`,e,t),e}}}function Vi(e,t){return{kind:`schema`,type:`object`,reference:Vi,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:Pi(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=Ni(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(X(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else X(this,`type`,e,t);return e}}}function Q(e,t){return{kind:`schema`,type:`optional`,reference:Q,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Z(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=Pi(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function Hi(e){return{kind:`schema`,type:`string`,reference:Hi,expects:`string`,async:!1,message:e,get"~standard"(){return Z(this)},"~run"(e,t){return typeof e.value==`string`?e.typed=!0:X(this,`type`,e,t),e}}}function Ui(e,t){return{kind:`schema`,type:`tuple`,reference:Ui,expects:`Array`,async:!1,items:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<this.items.length;r++){let i=n[r],a=this.items[r][`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else X(this,`type`,e,t);return e}}}function Wi(e){let t;if(e)for(let n of e)t?t.push(...n.issues):t=n.issues;return t}function Gi(e,t){return{kind:`schema`,type:`union`,reference:Gi,expects:Ci(e.map(e=>e.expects),`|`),async:!1,options:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){let n,r,i;for(let a of this.options){let o=a[`~run`]({value:e.value},t);if(o.typed)if(o.issues)r?r.push(o):r=[o];else{n=o;break}else i?i.push(o):i=[o]}if(n)return n;if(r){if(r.length===1)return r[0];X(this,`type`,e,t,{issues:Wi(r)}),e.typed=!0}else if(i?.length===1)return i[0];else X(this,`type`,e,t,{issues:Wi(i)});return e}}}function $(...e){return{...e[0],pipe:e,get"~standard"(){return Z(this)},"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}}}var Ki=$(Hi(),ki(32)),qi=$(Hi(),ji(1)),Ji=Li(e=>e instanceof HTMLElement,`Must be an HTMLElement`),Yi=$(Ri(),Ti(Ui([Hi(),Ji]))),Xi=$(Vi({radius:$(Bi(),Mi(0),Ai(128)),stroke:$(Bi(),Mi(0),Ai(128))}),Di(e=>e.stroke<=e.radius,`Stroke must be less than or equal to radius`)),Zi=Vi({background:Q($(Hi(),Oi())),stroke:Q($(Hi(),Oi())),shadow:Q(Hi())}),Qi=$(Vi({width:$(Bi(),Mi(1),Ai(655.36)),height:$(Bi(),Mi(1),Ai(655.36)),padding:$(Bi(),Mi(1))}),Di(e=>Math.min(e.width,e.height)/e.padding>=4,`Padding must not exceed 25% of the minimum dimension (width or height)`)),$i=Vi({background:Q($(Hi(),Oi())),radius:Q($(Bi(),Mi(0))),filter:Q(Hi())}),ea=Vi({id:$(Hi(),ji(1)),rank:$(Bi(),Mi(0),Ai(4294967295)),lat:$(Bi(),Mi(-90),Ai(90)),lng:$(Bi(),Mi(-180),Ai(180)),tooltip:Vi({element:Ji,style:Q($i),dimensions:Q(Qi),initialize:Q(Yi)}),pin:Q(Vi({element:Q(Ji),style:Q(Zi),dimensions:Q(Xi),initialize:Q(Yi)})),popup:Q(Vi({element:Ji,style:Q($i),dimensions:Q(Qi),initialize:Q(Yi)}))}),ta=`1.4.12`,na=`https://4.1.api.maps.arenarium.dev/states`,ra=3,ia=500,aa=class{apiKey;apiJwt;apiCache;constructor(e,t){this.apiKey=e,this.apiJwt=t,this.apiCache=new Map}clearStates(){this.apiCache.clear()}async updateStates(e,t){if(t.length===0)return;if(t.length===1){t[0].state={zoom:0,directions:[{zoom:0,angle:ii(270)}]};return}t.sort((e,t)=>e.properties.id.localeCompare(t.properties.id));let n=t.map(e=>{let t=e.properties,n=t.tooltip.dimensions;return{lat:t.lat,lng:t.lng,rank:t.rank,width:n.width+1.5*n.padding,height:n.height+1.5*n.padding}}),r=ni(JSON.stringify(n)),i=this.apiCache.get(r);if(i===void 0){let t=si({parameters:e,items:n}),a=window.location.host.startsWith(`localhost`)||window.location.host.startsWith(`127.0.0.1`),o=await oi(async()=>await fetch(na,{method:`POST`,headers:{[di]:ta,[li]:this.apiKey,[ui]:this.apiJwt,[fi]:a?`no-cache`:``,[pi]:`application/octet-stream`},body:t}),{retry:{times:ra,delay:ia}});if(o.error)throw o.error;let s=o.data;if(!s.ok)throw Error(await s.text());i=ci(await s.arrayBuffer()),this.apiJwt=s.headers.get(ui)??``,this.apiCache.set(r,i)}for(let e=0;e<t.length;e++){let n=t[e];n.state=i[e]}}};async function oa(e,t,n,r,i){let a=await oi(async()=>await fetch(e,{...n,headers:{"Content-Type":`application/json`,...n?.headers},method:`POST`,body:t?JSON.stringify(t):void 0}),{retry:{times:r,delay:i}});if(a.error)throw a.error;let o=a.data;if(!o.ok)throw Error(await o.text());return await o.json()}async function sa(e,t,n,r,i){let a=await oi(async()=>await fetch(e,{...n,headers:{"Content-Type":`application/json`,...n?.headers},method:`PUT`,body:t?JSON.stringify(t):void 0}),{retry:{times:r,delay:i}});if(a.error)throw a.error;let o=a.data;if(!o.ok)throw Error(await o.text())}var ca=class{static create(e,t,n){throw Error(`Must override static create method!`)}};function la(e){return Math.round(e*yr)/yr}function ua(e){return Math.round(e*100)/100}var da;function fa(e){return{lang:e?.lang??da?.lang,message:e?.message,abortEarly:e?.abortEarly??da?.abortEarly,abortPipeEarly:e?.abortPipeEarly??da?.abortPipeEarly}}var pa;function ma(e){return pa?.get(e)}var ha;function ga(e){return ha?.get(e)}var _a;function va(e,t){return _a?.get(e)?.get(t)}function ya(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function ba(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??ya(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},l=e.kind===`schema`,u=i?.message??e.message??va(e.reference,c.lang)??(l?ga(c.lang):null)??r.message??ma(c.lang);u!==void 0&&(c.message=typeof u==`function`?u(c):u),l&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}function xa(e){return{version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},fa())}}}var Sa=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function Ca(e,t){return{kind:`schema`,type:`array`,reference:Ca,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return xa(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else ba(this,`type`,e,t);return e}}}function wa(e,t,n){let r=e[`~run`]({value:t},fa(n));if(r.issues)throw new Sa(r.issues);return r.value}var Ta=`1.4.12`,Ea=`https://4.1.api.maps.arenarium.dev/auth`,Da=`https://4.1.api.maps.arenarium.dev/log`,Oa=class e extends ca{apiKey;mapProvider;mapStateProvider;markers;markersElementRenderer;markersElementManager;markersStateManager;constructor(e,n,r,i){super(),wa(Ki,e),wa(qi,n),this.apiKey=e,this.mapProvider=r,this.mapStateProvider=new a(this.mapProvider,this.detached.bind(this),this.error.bind(this),this.onMapMove.bind(this),this.onMapIdle.bind(this),this.onMapClick.bind(this)),this.markers=new Map,this.markersElementRenderer=new t(this.renderMarkers.bind(this)),this.markersElementManager=new Br(r,i),this.markersStateManager=new aa(e,n)}static async create(t,n,r){let i=await oa(Ea,{key:t},{headers:{[di]:Ta}});this.deprecated(Ta,i.version)&&console.warn(`This version of @arenarium/maps is deprecated and may not work correctly. Please upgrade to the latest version.`);let a=i.jwt;if(!a)throw Error(`Failed to get api jwt`);return new e(t,a,n,r)}static deprecated(e,t){if(!t)return!1;let n=t.split(`.`),r=e.split(`.`);if(n.length!==r.length)return!0;let i=Number.parseInt(n.join(``)),a=Number.parseInt(r.join(``));return Number.isNaN(i)||Number.isNaN(a)?!1:a<i}clear(){this.mapStateProvider.stop(),this.markersElementRenderer.stop(),this.markers.clear(),this.markersStateManager.clearStates(),this.markersElementManager.clearElements()}detached(){return this.mapProvider.getContainer().parentElement===null}error(e,t){this.log(`error`,e,t)}async log(e,t,n){switch(e){case`info`:console.info(n);break;case`warning`:console.warn(n);break;case`error`:console.error(n);break}if(n instanceof Error)try{await sa(Da,{title:t,level:e,content:{version:Ta,key:this.apiKey,name:n.name,message:n.message,cause:n.cause,stack:n.stack}},{headers:{[di]:Ta}})}catch(e){console.error(e)}}onMapMove(){this.markersElementRenderer.run()}onMapIdle(){this.markersElementRenderer.run()}onMapClick(){this.hidePopup()}onMarkerClick(e,t){e.stopPropagation(),this.showPopup(t)}createMarkers(e){let t=[],r=this.mapProvider.getContainer(),i=e=>{let t=document.createElement(`div`);t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.width=`max-content`,t.style.zIndex=`-1`;try{return t.appendChild(e),r.appendChild(t),t.getBoundingClientRect()}finally{r.removeChild(t)}},a=(e,t)=>{if(t)return t;if(e){let t=i(e),n=t.width,r=t.height;return{radius:Math.max(n,r)/2,stroke:2}}else return{radius:8,stroke:2}},o=(e,t)=>{if(t)return t;let n=i(e),r=ua(n.width),a=ua(n.height);return{width:r,height:a,padding:Math.min(Math.round(Math.min(r,a)/4),8)}};for(let r of e){let e=r.id,i=r.rank,s=la(r.lat),c=la(r.lng),l={id:e,initialize:r.pin?.initialize,element:r.pin?.element,style:r.pin?.style,dimensions:a(r.pin?.element,r.pin?.dimensions)},u={id:e,initialize:r.tooltip.initialize,element:r.tooltip.element,style:r.tooltip.style,dimensions:o(r.tooltip.element,r.tooltip.dimensions)},d;r.popup&&(d={id:e,initialize:r.popup.initialize,element:r.popup.element,style:r.popup.style,dimensions:o(r.popup.element,r.popup.dimensions)});let f=new n(e,s,c,i,l,u,d);t.push(f)}return t}renderMarkers(){try{if(this.detached())return!0;let e=this.mapProvider.getParameters(),t=this.mapProvider.getViewport();return this.markersElementManager.renderElements(t,e),!1}catch(e){return this.clear(),this.error(`Process markers render error`,e),!0}}async updateMarkers(e){wa(Ca(ea),e);let t=new Set;for(let n of e){let e=`${la(n.lat)},${la(n.lng)}`;if(t.has(e))throw Error(`Two or more markers have the same coordinates`)}try{let t=[];for(let n of e)this.markers.has(n.id)||t.push(n);let n=this.createMarkers(t);for(let e of n)this.markers.set(e.properties.id,e);this.markersElementManager.insertElements(n,this.onMarkerClick.bind(this)),this.markersElementRenderer.run();let r=this.mapProvider.getParameters(),i=Array.from(this.markers.values());await this.markersStateManager.updateStates(r,i),this.markersElementManager.updateElements(i),this.markersElementRenderer.run(),this.mapStateProvider.start()}catch(e){throw this.clear(),this.error(`Failed to update markers`,e),e}}async removeMarkers(){try{this.clear()}catch(e){throw this.error(`Failed to remove markers`,e),e}}showTooltip(e){if(!this.detached())try{let t=this.markers.get(e);if(!t)return;let n=t.properties.lat,r=t.properties.lng,i=t.state?.zoom;if(!i)return;this.mapProvider.moveTo(n,r,i)}catch(e){throw this.error(`Failed to show tooltip`,e),e}}showPopup(e){if(!this.detached())try{this.markersElementManager.showPopup(e)}catch(e){throw this.markersElementManager.hidePopups(),this.error(`Failed to show popup`,e),e}finally{this.markersElementRenderer.run()}}hidePopup(){if(!this.detached())try{this.markersElementManager.hidePopups()}catch(e){throw this.error(`Failed to hide popup`,e),e}finally{this.markersElementRenderer.run()}}};export{Oa as MapManager};
|
|
1
|
+
var e=100,t=class{invoked=!1;running=!1;interval;timeout;callback;constructor(t,n){if((n??0)<0)throw Error(`Invalid interval`);this.interval=n??e/Math.max(4,navigator?.hardwareConcurrency??1),this.callback=t}async process(){this.invoked=!1,this.callback()||!this.invoked?this.stop():this.timeout=window.setTimeout(this.process.bind(this),this.interval)}run(){this.invoked=!0,this.running||(this.running=!0,this.timeout=window.setTimeout(this.process.bind(this),0))}stop(){this.invoked=!1,this.running=!1,this.timeout&&window.clearTimeout(this.timeout),this.timeout=void 0}},n=class{properties;state;constructor(e,t,n,r,i,a,o){this.properties={id:e,lat:t,lng:n,rank:r,pin:i,tooltip:a,popup:o},this.state=void 0}},r=class{callback;timeout;id;constructor(e,t){if(t<=0)throw Error(`Invalid timeout`);this.callback=e,this.timeout=t}start(){this.id===void 0&&(this.id=window.setInterval(this.callback,this.timeout))}stop(){this.id!==void 0&&(window.clearInterval(this.id),this.id=void 0)}running(){return this.id!==void 0}},i=100,a=class{viewport=void 0;state=`idle`;provider;interval;onCancel;onError;onMove;onIdle;onClick;constructor(e,t,n,a,o,s){this.provider=e,this.interval=new r(this.onInterval.bind(this),i/Math.max(4,navigator?.hardwareConcurrency??1)),this.onCancel=t,this.onError=n,this.onMove=a,this.onIdle=o,this.onClick=s}start(){this.interval.running()===!1&&(this.interval.start(),this.provider.getContainer().addEventListener(`click`,this.onClick))}stop(){this.interval.running()===!0&&(this.interval.stop(),this.provider.getContainer().removeEventListener(`click`,this.onClick))}idle(){return this.state===`idle`}onInterval(){try{if(this.onCancel()){this.interval.stop();return}let e=this.provider.getViewport(),t=this.state,n=JSON.stringify(e)===JSON.stringify(this.viewport)?`idle`:`move`;n===`move`&&this.onMove(),n===`idle`&&t===`move`&&this.onIdle(),this.state=n,this.viewport=e}catch(e){this.onError(`Failed to process map state interval`,e)}}},o=Array.isArray,s=Array.prototype.indexOf,c=Array.prototype.includes,l=Array.from,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.prototype,p=Array.prototype,m=Object.getPrototypeOf,h=Object.isExtensible,g=()=>{};function _(e){for(var t=0;t<e.length;t++)e[t]()}function ee(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var v=1024,y=2048,b=4096,te=8192,x=16384,S=32768,ne=1<<25,re=65536,ie=1<<19,ae=1<<20,C=65536,oe=1<<21,se=1<<22,ce=1<<23,le=Symbol(`$state`),w=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"};globalThis.document?.contentType;function ue(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function de(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function fe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function pe(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function me(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function he(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var ge={},T=Symbol();function _e(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ve(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var E=!1,D;function ye(e){if(e===null)throw _e(),ge;return D=e}function be(){return ye(zt(D))}function xe(e){if(E){if(zt(D)!==null)throw _e(),ge;D=e}}function Se(e=1){if(E){for(var t=e,n=D;t--;)n=zt(n);D=n}}function Ce(e=!0){for(var t=0,n=D;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=zt(n);e&&n.remove(),n=i}}function we(e){return e===this.v}function Te(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ee(e){return!Te(e,this.v)}var De=!1,Oe=!1,O=null;function ke(e){O=e}function Ae(e,t=!1,n){O={p:O,i:!1,c:null,e:null,s:e,x:null,r:R,l:Oe&&!t?{s:null,u:null,$:[]}:null}}function je(e){var t=O,n=t.e;if(n!==null){t.e=null;for(var r of n)Yt(r)}return e!==void 0&&(t.x=e),t.i=!0,O=t.p,e??{}}function Me(){return!Oe||O!==null&&O.l===null}var Ne=[];function Pe(){var e=Ne;Ne=[],_(e)}function Fe(e){if(Ne.length===0&&!Ge){var t=Ne;queueMicrotask(()=>{t===Ne&&Pe()})}Ne.push(e)}function Ie(e){var t=R;if(t===null)return F.f|=ce,e;if(!(t.f&32768)&&!(t.f&4))throw e;Le(e,t)}function Le(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var Re=~(y|b|v);function k(e,t){e.f=e.f&Re|t}function ze(e){e.f&512||e.deps===null?k(e,v):k(e,b)}function Be(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=C,Be(t.deps))}function Ve(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Be(e.deps),k(e,v)}var He=!1,Ue=new Set,A=null,j=null,We=null,Ge=!1,Ke=!1,qe=null,Je=null,Ye=0,Xe=1,Ze=class e{id=Xe++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=[];#s=new Set;#c=new Set;#l=new Map;#u=new Set;is_fork=!1;#d=!1;#f=new Set;#p(){return this.is_fork||this.#r.size>0}#m(){for(let n of this.#f)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#l.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]}),this.#u.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#l.get(e);if(n){this.#l.delete(e);for(var r of n.d)k(r,y),t(r);for(r of n.m)k(r,b),t(r)}this.#u.add(e)}#h(){if(Ye++>1e3&&(Ue.delete(this),Qe()),!this.#p()){for(let e of this.#s)this.#c.delete(e),k(e,y),this.schedule(e);for(let e of this.#c)k(e,b),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=qe=[],r=[],i=Je=[];for(let e of t)try{this.#g(e,n,r)}catch(t){throw at(e),t}if(A=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(qe=null,Je=null,this.#p()||this.#m()){this.#_(r),this.#_(n);for(let[e,t]of this.#l)it(e,t)}else{this.#n.size===0&&Ue.delete(this),this.#s.clear(),this.#c.clear();for(let e of this.#e)e(this);this.#e.clear(),et(r),et(n),this.#i?.resolve()}var o=A;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(Ue.add(o),o.#h()),De&&!Ue.has(this)&&this.#v()}#g(e,t,n){e.f^=v;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#l.has(r))&&r.fn!==null){a?r.f^=v:i&4?t.push(r):De&&i&16777224?n.push(r):wn(r)&&(i&16&&this.#c.add(r),kn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#_(e){for(var t=0;t<e.length;t+=1)Ve(e[t],this.#s,this.#c)}capture(e,t,n=!1){e.v!==T&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),j?.set(e,t)),this.is_fork||(e.v=t)}activate(){A=this}deactivate(){A=null,j=null}flush(){try{Ke=!0,A=this,this.#h()}finally{Ye=0,We=null,qe=null,Je=null,Ke=!1,A=null,j=null,wt.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),Ue.delete(this)}register_created_effect(e){this.#o.push(e)}#v(){for(let l of Ue){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}var r=[...l.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){if(e)for(let e of this.#u)l.unskip_effect(e,e=>{e.f&4194320?l.schedule(e):l.#_([e])});l.activate();var i=new Set,a=new Map;for(var o of t)tt(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#o)!(e.f&155648)&&nt(e,s,a)&&(e.f&4194320?(k(e,y),l.schedule(e)):l.#s.add(e));if(l.#a.length>0){l.apply();for(var c of l.#a)l.#g(c,[],[]);l.#a=[]}l.deactivate()}}for(let e of Ue)e.#f.has(this)&&(e.#f.delete(this),e.#f.size===0&&!e.#p()&&(e.activate(),e.#h()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#d||n||(this.#d=!0,Fe(()=>{this.#d=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#s.add(t);for(let e of t)this.#c.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=ee()).promise}static ensure(){if(A===null){let t=A=new e;Ke||(Ue.add(A),Ge||Fe(()=>{A===t&&t.flush()}))}return A}apply(){if(!De||!this.is_fork&&Ue.size===1){j=null;return}j=new Map;for(let[e,[t]]of this.current)j.set(e,t);for(let n of Ue)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#f.add(n);else for(let[e,t]of n.previous)j.has(e)||j.set(e,t)}}schedule(e){if(We=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(qe!==null&&t===R&&(De||(F===null||!(F.f&2))&&!He))return;if(n&96){if(!(n&1024))return;t.f^=v}}this.#a.push(t)}};function Qe(){try{de()}catch(e){Le(e,We)}}var $e=null;function et(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&wn(r)&&($e=new Set,kn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&cn(r),$e?.size>0)){wt.clear();for(let e of $e){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)$e.has(n)&&($e.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||kn(n)}}$e.clear()}}$e=null}}function tt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?tt(i,t,n,r):e&4194320&&!(e&2048)&&nt(i,t,r)&&(k(i,y),rt(i))}}function nt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(c.call(t,r))return!0;if(r.f&2&&nt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function rt(e){A.schedule(e)}function it(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),k(e,v);for(var n=e.first;n!==null;)it(n,t),n=n.next}}function at(e){k(e,v);for(var t=e.first;t!==null;)at(t),t=t.next}function ot(e){let t=0,n=Et(0),r;return()=>{qt()&&(U(n),$t(()=>(t===0&&(r=W(()=>e(()=>kt(n)))),t+=1,()=>{Fe(()=>{--t,t===0&&(r?.(),r=void 0,kt(n))})})))}}var st=re|ie;function ct(e,t,n,r){new lt(e,t,n,r)}var lt=class{parent;is_pending=!1;transform_error;#e;#t=E?D:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=ot(()=>(this.#m=Et(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=R;t.b=this,t.f|=128,n(e)},this.parent=R.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=tn(()=>{if(E){let e=this.#t;be();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},st),E&&(this.#e=D)}#g(){try{this.#a=nn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=nn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=nn(()=>e(this.#e)),Fe(()=>{var e=this.#c=document.createDocumentFragment(),t=Lt();e.append(t),this.#a=this.#x(()=>nn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,ln(this.#o,()=>{this.#o=null}),this.#b(A))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=nn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();dn(this.#a,e);let t=this.#n.pending;this.#o=nn(()=>t(this.#e))}else this.#b(A)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Ve(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=R,n=F,r=O;gn(this.#i),L(this.#i),ke(this.#i.ctx);try{return Ze.ensure(),e()}catch(e){return Ie(e),null}finally{gn(t),L(n),ke(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&ln(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Fe(()=>{this.#d=!1,this.#m&&Dt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),U(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(P(this.#a),null),this.#o&&=(P(this.#o),null),this.#s&&=(P(this.#s),null),E&&(ye(this.#t),Se(),ye(Ce()));var r=!1,i=!1;let a=()=>{if(r){ve();return}r=!0,i&&he(),this.#s!==null&&ln(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){Le(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return nn(()=>{var t=R;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return Le(e,this.#i.parent),null}}))};Fe(()=>{var t;try{t=this.transform_error(e)}catch(e){Le(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>Le(e,this.#i&&this.#i.parent)):o(t)})}};function ut(e,t,n,r){let i=Me()?mt:gt;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=R,s=dt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||Le(e,o)}ft()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=pt();function d(){Promise.all(n.map(e=>ht(e))).then(e=>l([...t.map(i),...e])).catch(e=>Le(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),ft()}):d()}function dt(){var e=R,t=F,n=O,r=A;return function(i=!0){gn(e),L(t),ke(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function ft(e=!0){gn(null),L(null),ke(null),e&&A?.deactivate()}function pt(){var e=R,t=e.b,n=A,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function mt(e){var t=2|y,n=F!==null&&F.f&2?F:null;return R!==null&&(R.f|=ie),{ctx:O,deps:null,effects:null,equals:we,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:n??R,ac:null}}function ht(e,t,n){let r=R;r===null&&ue();var i=void 0,a=Et(T),o=!F,s=new Map;return Qt(()=>{var t=R,n=ee();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(ft)}catch(e){n.reject(e),ft()}var c=A;if(o){if(t.f&32768)var l=pt();if(r.b.is_rendered())s.get(c)?.reject(w),s.delete(c);else{for(let e of s.values())e.reject(w);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===w),!(n===w||t.f&16384)){if(c.activate(),n)a.f|=ce,Dt(a,n);else{a.f&8388608&&(a.f^=ce),Dt(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(w)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),Jt(()=>{for(let e of s.values())e.reject(w)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function gt(e){let t=mt(e);return t.equals=Ee,t}function _t(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)P(t[n])}}function vt(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function yt(e){var t,n=R;gn(vt(e));try{e.f&=~C,_t(e),t=En(e)}finally{gn(n)}return t}function bt(e){var t=yt(e);if(!e.equals(t)&&(e.wv=Cn(),(!A?.is_fork||e.deps===null)&&(A===null?e.v=t:A.capture(e,t,!0),e.deps===null))){k(e,v);return}mn||(j===null?ze(e):(qt()||A?.is_fork)&&j.set(e,t))}function xt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(w),t.teardown=g,t.ac=null,On(t,0),an(t))}function St(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&kn(t)}var Ct=new Set,wt=new Map,Tt=!1;function Et(e,t){return{f:0,v:e,reactions:null,equals:we,rv:0,wv:0}}function M(e,t){let n=Et(e,t);return _n(n),n}function N(e,t,n=!1){return F!==null&&(!I||F.f&131072)&&Me()&&F.f&4325394&&(z===null||!c.call(z,e))&&me(),Dt(e,n?jt(t):t,Je)}function Dt(e,t,n=null){if(!e.equals(t)){wt.set(e,mn?t:e.v);var r=Ze.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&yt(t),j===null&&ze(t)}e.wv=Cn(),At(e,y,n),Me()&&R!==null&&R.f&1024&&!(R.f&96)&&(H===null?vn([e]):H.push(e)),!r.is_fork&&Ct.size>0&&!Tt&&Ot()}return t}function Ot(){Tt=!1;for(let e of Ct)e.f&1024&&k(e,b),wn(e)&&kn(e);Ct.clear()}function kt(e){N(e,e.v+1)}function At(e,t,n){var r=e.reactions;if(r!==null)for(var i=Me(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===R)){var l=(c&y)===0;if(l&&k(s,t),c&2){var u=s;j?.delete(u),c&65536||(c&512&&(s.f|=C),At(u,b,n))}else if(l){var d=s;c&16&&$e!==null&&$e.add(d),n===null?rt(d):n.push(d)}}}}function jt(e){if(typeof e!=`object`||!e||le in e)return e;let t=m(e);if(t!==f&&t!==p)return e;var n=new Map,r=o(e),i=M(0),a=null,s=xn,c=e=>{if(xn===s)return e();var t=F,n=xn;L(null),Sn(s);var r=e();return L(t),Sn(n),r};return r&&n.set(`length`,M(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&fe();var i=n.get(t);return i===void 0?c(()=>{var e=M(r.value,a);return n.set(t,e),e}):N(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=c(()=>M(T,a));n.set(t,e),kt(i)}}else N(r,T),kt(i);return!0},get(t,r,i){if(r===le)return e;var o=n.get(r),s=r in t;if(o===void 0&&(!s||d(t,r)?.writable)&&(o=c(()=>M(jt(s?t[r]:T),a)),n.set(r,o)),o!==void 0){var l=U(o);return l===T?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=U(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==T)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===le)return!0;var r=n.get(t),i=r!==void 0&&r.v!==T||Reflect.has(e,t);return(r!==void 0||R!==null&&(!i||d(e,t)?.writable))&&(r===void 0&&(r=c(()=>M(i?jt(e[t]):T,a)),n.set(t,r)),U(r)===T)?!1:i},set(e,t,o,s){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var f=o;f<l.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=c(()=>M(T,a)),n.set(f+``,p)):N(p,T)}if(l===void 0)(!u||d(e,t)?.writable)&&(l=c(()=>M(void 0,a)),N(l,jt(o)),n.set(t,l));else{u=l.v!==T;var m=c(()=>jt(o));N(l,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,o),!u){if(r&&typeof t==`string`){var g=n.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&N(g,_+1)}kt(i)}return!0},ownKeys(e){U(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==T});for(var[r,a]of n)a.v!==T&&!(r in e)&&t.push(r);return t},setPrototypeOf(){pe()}})}var Mt,Nt,Pt,Ft;function It(){if(Mt===void 0){Mt=window,Nt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Pt=d(t,`firstChild`).get,Ft=d(t,`nextSibling`).get,h(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),h(n)&&(n.__t=void 0)}}function Lt(e=``){return document.createTextNode(e)}function Rt(e){return Pt.call(e)}function zt(e){return Ft.call(e)}function Bt(e,t){if(!E)return Rt(e);var n=Rt(D);if(n===null)n=D.appendChild(Lt());else if(t&&n.nodeType!==3){var r=Lt();return n?.before(r),ye(r),r}return t&&Ut(n),ye(n),n}function Vt(e,t=1,n=!1){let r=E?D:e;for(var i;t--;)i=r,r=zt(r);if(!E)return r;if(n){if(r?.nodeType!==3){var a=Lt();return r===null?i?.after(a):r.before(a),ye(a),a}Ut(r)}return ye(r),r}function Ht(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function Ut(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Wt(e){var t=F,n=R;L(null),gn(null);try{return e()}finally{L(t),gn(n)}}function Gt(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Kt(e,t){var n=R;n!==null&&n.f&8192&&(e|=te);var r={ctx:O,deps:null,nodes:null,f:e|y|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};A?.register_created_effect(r);var i=r;if(e&4)qe===null?Ze.ensure().schedule(r):qe.push(r);else if(t!==null){try{kn(r)}catch(e){throw P(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=re))}if(i!==null&&(i.parent=n,n!==null&&Gt(i,n),F!==null&&F.f&2&&!(e&64))){var a=F;(a.effects??=[]).push(i)}return r}function qt(){return F!==null&&!I}function Jt(e){let t=Kt(8,null);return k(t,v),t.teardown=e,t}function Yt(e){return Kt(4|ae,e)}function Xt(e){Ze.ensure();let t=Kt(64|ie,e);return(e={})=>new Promise(n=>{e.outro?ln(t,()=>{P(t),n(void 0)}):(P(t),n(void 0))})}function Zt(e){return Kt(4,e)}function Qt(e){return Kt(se|ie,e)}function $t(e,t=0){return Kt(8|t,e)}function en(e,t=[],n=[],r=[]){ut(r,t,n,t=>{Kt(8,()=>e(...t.map(U)))})}function tn(e,t=0){return Kt(16|t,e)}function nn(e){return Kt(32|ie,e)}function rn(e){var t=e.teardown;if(t!==null){let e=mn,n=F;hn(!0),L(null);try{t.call(null)}finally{hn(e),L(n)}}}function an(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Wt(()=>{e.abort(w)});var r=n.next;n.f&64?n.parent=null:P(n,t),n=r}}function on(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||P(t),t=n}}function P(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(sn(e.nodes.start,e.nodes.end),n=!0),k(e,ne),an(e,t&&!n),On(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();rn(e),e.f^=ne,e.f|=x;var i=e.parent;i!==null&&i.first!==null&&cn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function sn(e,t){for(;e!==null;){var n=e===t?null:zt(e);e.remove(),e=n}}function cn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function ln(e,t,n=!0){var r=[];un(e,r,!0);var i=()=>{n&&P(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function un(e,t,n){if(!(e.f&8192)){e.f^=te;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;un(i,t,o?n:!1),i=a}}}function dn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:zt(n);t.append(n),n=i}}var fn=null,pn=!1,mn=!1;function hn(e){mn=e}var F=null,I=!1;function L(e){F=e}var R=null;function gn(e){R=e}var z=null;function _n(e){F!==null&&(!De||F.f&2)&&(z===null?z=[e]:z.push(e))}var B=null,V=0,H=null;function vn(e){H=e}var yn=1,bn=0,xn=bn;function Sn(e){xn=e}function Cn(){return++yn}function wn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~C),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(wn(a)&&bt(a),a.wv>e.wv)return!0}t&512&&j===null&&k(e,v)}return!1}function Tn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!De&&z!==null&&c.call(z,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Tn(a,t,!1):t===a&&(n?k(a,y):a.f&1024&&k(a,b),rt(a))}}function En(e){var t=B,n=V,r=H,i=F,a=z,o=O,s=I,c=xn,l=e.f;B=null,V=0,H=null,F=l&96?null:e,z=null,ke(e.ctx),I=!1,xn=++bn,e.ac!==null&&(Wt(()=>{e.ac.abort(w)}),e.ac=null);try{e.f|=oe;var u=e.fn,d=u();e.f|=S;var f=e.deps,p=A?.is_fork;if(B!==null){var m;if(p||On(e,V),f!==null&&V>0)for(f.length=V+B.length,m=0;m<B.length;m++)f[V+m]=B[m];else e.deps=f=B;if(qt()&&e.f&512)for(m=V;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&V<f.length&&(On(e,V),f.length=V);if(Me()&&H!==null&&!I&&f!==null&&!(e.f&6146))for(m=0;m<H.length;m++)Tn(H[m],e);if(i!==null&&i!==e){if(bn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=bn;if(t!==null)for(let e of t)e.rv=bn;H!==null&&(r===null?r=H:r.push(...H))}return e.f&8388608&&(e.f^=ce),d}catch(e){return Ie(e)}finally{e.f^=oe,B=t,V=n,H=r,F=i,z=a,ke(o),I=s,xn=c}}function Dn(e,t){let n=t.reactions;if(n!==null){var r=s.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(B===null||!c.call(B,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~C),a.v!==T&&ze(a),xt(a),On(a,0)}}function On(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Dn(e,n[r])}function kn(e){var t=e.f;if(!(t&16384)){k(e,v);var n=R,r=pn;R=e,pn=!0;try{t&16777232?on(e):an(e),rn(e);var i=En(e);e.teardown=typeof i==`function`?i:null,e.wv=yn}finally{pn=r,R=n}}}function U(e){var t=(e.f&2)!=0;if(fn?.add(e),F!==null&&!I&&!(R!==null&&R.f&16384)&&(z===null||!c.call(z,e))){var n=F.deps;if(F.f&2097152)e.rv<bn&&(e.rv=bn,B===null&&n!==null&&n[V]===e?V++:B===null?B=[e]:B.push(e));else{(F.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[F]:c.call(r,F)||r.push(F)}}if(mn&&wt.has(e))return wt.get(e);if(t){var i=e;if(mn){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||jn(i))&&(a=yt(i)),wt.set(i,a),a}var o=(i.f&512)==0&&!I&&F!==null&&(pn||(F.f&512)!=0),s=(i.f&S)===0;wn(i)&&(o&&(i.f|=512),bt(i)),o&&!s&&(St(i),An(i))}if(j?.has(e))return j.get(e);if(e.f&8388608)throw e.v;return e.v}function An(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(St(t),An(t))}function jn(e){if(e.v===T)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(wt.has(t)||t.f&2&&jn(t))return!0;return!1}function W(e){var t=I;try{return I=!0,e()}finally{I=t}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var Mn=[`touchstart`,`touchmove`];function Nn(e){return Mn.includes(e)}var Pn=Symbol(`events`),Fn=new Set,In=new Set,Ln=null;function Rn(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Ln=e;var o=0,s=Ln===e&&e[Pn];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Pn]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){u(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=F,f=R;L(null),gn(null);try{for(var p,m=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[Pn]?.[r];g!=null&&(!a.disabled||e.target===a)&&g.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Pn]=t,delete e.currentTarget,L(d),gn(f)}}}var zn=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Bn(e){return zn?.createHTML(e)??e}function Vn(e){var t=Ht(`template`);return t.innerHTML=Bn(e.replaceAll(`<!>`,`<!---->`)),t.content}function Hn(e,t){var n=R;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Un(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(E)return Hn(D,null),D;i===void 0&&(i=Vn(a?e:`<!>`+e),n||(i=Rt(i)));var t=r||Nt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Rt(t),s=t.lastChild;Hn(o,s)}else Hn(t,t);return t}}function Wn(e,t){if(E){var n=R;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=D),be();return}e!==null&&e.before(t)}function Gn(e,t){return qn(e,t)}var Kn=new Map;function qn(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){It();var c=void 0,u=Xt(()=>{var o=n??t.appendChild(Lt());ct(o,{pending:()=>{}},t=>{Ae({});var n=O;if(a&&(n.c=a),i&&(r.$$events=i),E&&Hn(t,null),c=e(t,r)||{},E&&(R.nodes.end=D,D===null||D.nodeType!==8||D.data!==`]`))throw _e(),ge;je()},s);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Nn(r);for(let e of[t,document]){var a=Kn.get(e);a===void 0&&(a=new Map,Kn.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Rn,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(l(Fn)),In.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=Kn.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Rn),r.delete(e),r.size===0&&Kn.delete(n)):r.set(e,i)}In.delete(d),o!==n&&o.parentNode?.removeChild(o)}});return Jn.set(c,u),c}var Jn=new WeakMap;function Yn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Yn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Xn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Yn(e))&&(r&&(r+=` `),r+=t);return r}function Zn(e){return typeof e==`object`?Xn(e):e??``}var Qn=[...`
|
|
2
|
+
\r\f\xA0\v`];function $n(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Qn.includes(r[o-1]))&&(s===r.length||Qn.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function er(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function tr(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function nr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(tr)),i&&c.push(...Object.keys(i).map(tr));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=tr(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=er(r)),i&&(n+=er(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function rr(e,t,n,r,i,a){var o=e.__className;if(E||o!==n||o===void 0){var s=$n(n,r,a);(!E||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function ir(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function ar(e,t,n,r){var i=e.__style;if(E||i!==t){var a=nr(t,r);(!E||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(ir(e,n?.[0],r[0]),ir(e,n?.[1],r[1],`important`)):ir(e,n,r));return r}function or(e,t){return e===t||e?.[le]===t}function sr(e={},t,n,r){var i=O.r,a=R;return Zt(()=>{var o,s;return $t(()=>{o=s,s=r?.()||[],W(()=>{e!==n(...s)&&(t(e,...s),o&&or(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&or(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var cr=25e-5,lr=.1,ur=.2,dr=1e6,fr=2e6,pr=3e6,mr=class{div;marker;inserted;constructor(e,t,n,r){this.div=document.createElement(`div`),this.marker=e.createMarker({element:this.div,lat:t,lng:n,z:r}),this.inserted=!1}insert(){this.inserted!==!0&&(this.marker.insert(),this.inserted=!0)}remove(){this.inserted!==!1&&(this.marker.remove(),this.inserted=!1)}update(e){this.marker.update(e)}},hr=class e{shown;id;lat;lng;rank;marker;constructor(t,n,r,i,a){if(new.target===e)throw Error(`Unsupported code`);this.shown=!0,this.id=t,this.lat=n,this.lng=r,this.rank=i,this.marker=a}};typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);function gr(e){return-.5*(Math.cos(Math.PI*e)-1)}var _r=class{animating;animationEasing;animationCallback;value;time;constructor(e){if(e.max<=e.min)throw Error(`Invalid min or max`);if(e.value<e.min||e.max<e.value)throw Error(`Invalid value`);this.animationEasing=e.easing,this.animationCallback=e.callback,this.animating=!1,this.value={current:e.value,start:e.value,end:e.value,min:e.min,max:e.max},this.time={start:0,end:0,span:e.timespan}}animationFrame(){let e=performance.now();if(e>this.time.end)this.value.current=this.value.end;else{let t=(e-this.time.start)/(this.time.end-this.time.start),n=this.animationEasing(t);this.value.current=this.value.start+(this.value.end-this.value.start)*n}if(this.animationCallback(this.value.current),this.value.current===this.value.end){this.animating=!1;return}window.requestAnimationFrame(this.animationFrame.bind(this))}target(e){if(e===this.value.end)return;this.value.start=this.value.current,this.value.end=e;let t=performance.now(),n=Math.abs(this.value.start-this.value.end),r=this.value.max-this.value.min;this.time.start=t,this.time.end=t+this.time.span*Math.sqrt(n/r),!this.animating&&(this.animating=!0,window.requestAnimationFrame(this.animationFrame.bind(this)))}set(e){if(e===this.value.end)return;this.value.current=e,this.value.start=e,this.value.end=e;let t=performance.now();this.time.start=t,this.time.end=t,window.requestAnimationFrame(this.animationCallback.bind(this,e))}end(){this.set(this.value.end)}expired(){return performance.now()>this.time.end}},vr=Un(`<div></div>`);function yr(e,t){Ae(t,!0);let n=W(()=>t.id),r=W(()=>t.element),i=W(()=>t.style),a=W(()=>t.dimensions),o=W(()=>t.initialize),s={setDisplayed:_,getDisplayed:ee,setCollapsed:y,getCollapsed:b,setScale:ne};function c(){return s}let l,u=a.radius*2,d=a.stroke,f=i?.background??`#008800`,p=i?.stroke??`#ffffff`,m=i?.shadow??`0px 2px 2px rgba(0, 0, 0, 0.5)`,h=M(!1),g=!1;function _(e){e===!0&&(l&&r&&r.parentElement!==l&&l.appendChild(r),g===!1&&o&&r&&(g=!0,setTimeout(async()=>await o(n,r),0))),e!==U(h)&&(N(h,e,!0),e===!1&&S.end())}function ee(){return U(h)}let v=M(!0);function y(e){e!==U(v)&&(N(v,e,!0),S.target(U(v)?0:te))}function b(){return U(h)?S.expired():!0}let te=0,x=1,S=new _r({value:0,min:0,max:1,timespan:75,easing:gr,callback:re});function ne(e,t){te=e,x=t,S.target(e)}function re(e){l.style.scale=e.toString(),l.style.opacity=e.toString(),l.style.filter=`brightness(${ie(e)})`}function ie(e){return 1-x*(1-e)}var ae={invoke:c},C=vr();let oe;return sr(C,e=>l=e,()=>l),en(e=>{rr(C,1,Zn([`pin`,U(h)&&`displayed`]),`svelte-10kxbrm`),oe=ar(C,``,oe,e)},[()=>({width:`${u}px`,height:`${u}px`,"border-radius":`${u/2}px`,"border-color":p,"border-width":`${d}px`,"background-color":`rgb(from ${f} r g b / 1)`,"box-shadow":m,scale:0,filter:`brightness(${ie(0)})`})]),Wn(e,C),je(ae)}var br=1e6,xr=class extends hr{properties;zoom;component;constructor(e,t,n,r,i,a){super(t,n,r,i,new mr(e,n,r,i)),this.properties=a,this.zoom=NaN,this.component=Gn(yr,{target:this.marker.div,props:a})}get zIndex(){return Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*5)+dr}},Sr=class{animating;animationTimestamp;animationEnd;animationCallback;speed;value;constructor(e){this.animating=!1,this.animationTimestamp=0,this.animationEnd=0,this.animationCallback=e.callback,this.speed={current:0,spring:{stiffness:e.stiffness,damping:2*Math.sqrt(e.stiffness)}},this.value={current:e.value,target:e.value,precision:e.precision,min:e.min,max:e.max}}animationFrame(){try{let e=performance.now(),t=e-this.animationTimestamp;if(this.animationTimestamp=e,e>=this.animationEnd){this.speed.current=0,this.value.current=this.value.target;return}let n=this.value.target-this.value.current;if(Math.abs(n)<this.value.precision){this.speed.current=0,this.value.current=this.value.target;return}let r=n*this.speed.spring.stiffness-this.speed.spring.damping*this.speed.current;if(this.speed.current+=r*t,this.value.current+=this.speed.current*t,this.value.current<this.value.min){this.value.current=this.value.target,this.speed.current=0;return}if(this.value.current>this.value.max){this.value.current=this.value.target,this.speed.current=0;return}}finally{if(this.animationCallback(this.value.current),this.value.current===this.value.target){this.animating=!1;return}window.requestAnimationFrame(this.animationFrame.bind(this))}}target(e){if(e===this.value.target)return;this.value.target=e;let t=performance.now();this.animationEnd=t+Math.sqrt(2*Math.abs(e-this.value.current)/this.speed.spring.stiffness),this.animating===!1&&(this.animating=!0,this.animationTimestamp=t,window.requestAnimationFrame(this.animationFrame.bind(this)))}set(e){e!==this.value.target&&(this.value.current=e,this.value.target=e,this.speed.current=0,this.animating=!1,this.animationTimestamp=performance.now(),this.animationEnd=performance.now(),window.requestAnimationFrame(this.animationCallback.bind(this,e)))}end(){this.set(this.value.target)}expired(){return performance.now()>this.animationEnd}};function Cr(e,t,n){if(e<=0||t<=0)return{x:0,y:0};let r=e/2,i=t/2,a=Math.sqrt(r*r+i*i),o=Math.atan(i/r)*(180/Math.PI),s=Math.PI/180*n;return n<180?n<90?n<o?{x:0,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:0}:n<180-o?{x:a*Math.cos(s)-r,y:0}:{x:-e,y:a*Math.sin(s)-i}:n<270?n<180+o?{x:-e,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:-t}:n<360-o?{x:a*Math.cos(s)-r,y:-t}:{x:0,y:a*Math.sin(s)-i}}var wr=Un(`<div><div class="element pointer svelte-1no6o2a"></div> <div class="element bubble svelte-1no6o2a"><div class="element body svelte-1no6o2a"></div></div></div>`);function Tr(e,t){Ae(t,!0);let n=W(()=>t.id),r=W(()=>t.element),i=W(()=>t.style),a=W(()=>t.dimensions),o=W(()=>t.initialize),s={setDisplayed:de,getDisplayed:fe,setCollapsed:me,getCollapsed:he,getExpanded:ge,setAngle:Ce};function c(){return s}let l,u,d,f,p=Math.min(4,1+3*(a.width*a.height)/65536),m=i?.filter??`drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.5))`,h=a.width+2*a.padding,g=a.height+2*a.padding,_=a.padding,ee=a.width,v=a.height,y=i?.radius??0,b=a.width,te=a.height,x=Math.min(i?.radius??8,Math.min(b,te)/2),S=Math.min(1,2*x/Math.min(te,b)),ne=i?.background??`#ffffff`,re=a.padding*2,ie=Math.min(3,.5*x),ae=i?.background??`#ffffff`,C=g<h?g/h:1,oe=h<g?h/g:1,se=Math.min(h,g)/2,ce=se*Math.SQRT2,le=15*Math.SQRT2,w=!1,ue=M(!1);function de(e){e!==U(ue)&&(N(ue,e,!0),e===!0&&(r&&r.parentElement!==u&&u.appendChild(r),w===!1&&o&&r&&(w=!0,setTimeout(async()=>await o(n,r),0))),e===!1&&(T.end(),ye.end(),Se.end()))}function fe(){return U(ue)}let pe=M(!0);function me(e){e!==U(pe)&&(N(pe,e,!0),T.target(+!U(pe)))}function he(){return U(ue)?T.expired():!0}function ge(){return U(ue)?T.expired():!1}let T=new _r({value:0,min:0,max:1,timespan:125*Math.cbrt(p),easing:gr,callback:_e});function _e(e){l.style.opacity=`${e}`,l.style.scale=`${e}`,u.style.opacity=`${e}`}let ve=NaN,E=M(!1),D=-h/2,ye=new Sr({value:-h/2,min:-h-h*lr,max:h*lr,precision:1,stiffness:cr/p,callback:we}),be=-g/2,Se=new Sr({value:-g/2,min:-g-g*lr,max:g*lr,precision:1,stiffness:cr/p,callback:Te});function Ce(e,t){if(Number.isNaN(e)){ve=NaN,N(E,!1);return}if(U(E)===!1||t===!0){N(E,!0),ve=e;let t=Cr(h,g,e);ye.set(Math.round(t.x)),Se.set(Math.round(t.y));return}if(ve!==e){ve=e;let t=Cr(h,g,e);ye.target(Math.round(t.x)),Se.target(Math.round(t.y));return}}function we(e){D=e,Ee(D,be)}function Te(e){be=e,Ee(D,be)}function Ee(e,t){let n=e+h/2,r=t+g/2,i=n*C,a=r*oe,o=Math.sqrt(i*i+a*a),s=(o-se)/(ce-se),c=Math.atan2(a,i)/Math.PI*180-45,l=15+s*(le-15),u=o<se?o/se:1,p=.5*((1+.5*S)*s),m=e+_*(1-i/se*p),ee=t+_*(1-a/se*p);f.style.transform=`scale(${u}) rotate(${c}deg) skew(${l}deg, ${l}deg)`,d.style.transform=`translate(${Math.round(m)}px, ${Math.round(ee)}px)`}var De={invoke:c},Oe=wr();let O;var ke=Bt(Oe);let Me;sr(ke,e=>f=e,()=>f);var Ne=Vt(ke,2);let Pe;var Fe=Bt(Ne);let Ie;return sr(Fe,e=>u=e,()=>u),xe(Ne),sr(Ne,e=>d=e,()=>d),xe(Oe),sr(Oe,e=>l=e,()=>l),en(()=>{rr(Oe,1,Zn([`element anchor`,U(ue)&&`displayed`]),`svelte-1no6o2a`),O=ar(Oe,``,O,{filter:m}),Me=ar(ke,``,Me,{width:`${re}px`,height:`${re}px`,"border-radius":`${ie}px`,"background-color":`rgb(from ${ae} r g b / 1)`}),Pe=ar(Ne,``,Pe,{width:`${b}px`,height:`${te}px`,"border-radius":`${x}px`,"background-color":`rgb(from ${ne} r g b / 1)`}),Ie=ar(Fe,``,Ie,{width:`${ee}px`,height:`${v}px`,"border-radius":`${y}px`})}),Wn(e,Oe),je(De)}var Er=class extends hr{width;height;zoom;angle;directions;component;constructor(e,t,n,r,i,a){super(t,n,r,i,new mr(e,n,r,i)),this.width=a.dimensions.width+a.dimensions.padding*2,this.height=a.dimensions.height+a.dimensions.padding*2,this.zoom=NaN,this.angle=NaN,this.directions=[],this.component=Gn(Tr,{target:this.marker.div,props:a})}get zIndex(){return Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*5)+fr}},Dr=class extends hr{width;height;padding;angle;component;constructor(e,t,n,r,i,a){super(t,n,r,i,new mr(e,n,r,pr)),this.width=a.dimensions.width,this.height=a.dimensions.height,this.padding=a.dimensions.padding,this.angle=NaN,this.shown=!1,this.component=Gn(Tr,{target:this.marker.div,props:a})}get zIndex(){return pr}},Or=class{id;state=void 0;pin;tooltip;popup;constructor(e,t){let n=t.properties.id,r=t.properties.lat,i=t.properties.lng,a=t.properties.rank,o=t.properties.pin,s=t.properties.tooltip,c=t.properties.popup;this.id=n,this.pin=new xr(e,n,r,i,a,o),this.tooltip=new Er(e,n,r,i,a,s),this.popup=c?new Dr(e,n,r,i,a,c):void 0}};function kr(e,t,n){return{x:jr(t)*n,y:Mr(e)*n}}function Ar(e,t,n){return{lat:Pr(t/n),lng:Nr(e/n)}}function jr(e){return(180+e)/360}function Mr(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Nr(e){return e*360-180}function Pr(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}var Fr=class{sw;ne;constructor(e,t,n,r){if(n<e||r<t)throw Error(`Invalid bounds: ${e}, ${t}, ${n}, ${r}`);this.sw={lat:e,lng:t},this.ne={lat:n,lng:r}}contains(e,t){return!(e<this.sw.lat||this.ne.lat<e||t<this.sw.lng||this.ne.lng<t)}intersects(e){return!(e.ne.lat<this.sw.lat||this.ne.lat<e.sw.lat||e.ne.lng<this.sw.lng||this.ne.lng<e.sw.lng)}},Ir=class e{blockL;blockR;sw;ne;constructor(e,t,n,r){if(n<e)throw Error(`Invalid bounds: ${e}, ${t}, ${n}, ${r}`);this.sw={lat:e,lng:t},this.ne={lat:n,lng:r},t<r?(this.blockL=new Fr(e,t,n,r),this.blockR=new Fr(0,0,0,0)):(this.blockL=new Fr(e,-180,n,r),this.blockR=new Fr(e,t,n,180))}static bounds(e){let t=e.bounds,n=e.center;return t.sw.lng<=n.lng&&t.ne.lng<=n.lng||t.sw.lng>=n.lng&&t.ne.lng>=n.lng||Math.abs(t.ne.lng-n.lng)+Math.abs(t.sw.lng-n.lng)>360||t.ne.lng-t.sw.lng>360?{sw:{lat:t.sw.lat,lng:-180},ne:{lat:t.ne.lat,lng:180}}:e.bounds}static create(t){let n=this.bounds(t),r=n.sw,i=n.ne;return new e(r.lat,r.lng,i.lat,i.lng)}static offset(t,n,r){let i=this.bounds(t),a=n*2**t.zoom,o=kr(i.sw.lat,i.sw.lng,a),s=kr(i.ne.lat,i.ne.lng,a),c=Math.max(o.x-r.left,0),l=Math.min(o.y+r.bottom,a),u=Math.min(s.x+r.right,a),d=Math.max(s.y-r.top,0),f=Ar(c,l,a),p=Ar(u,d,a);return new e(f.lat,f.lng,p.lat,p.lng)}contains(e,t){return this.blockL.contains(e,t)||this.blockR.contains(e,t)}intersects(e){return this.blockL.intersects(e)||this.blockR.intersects(e)}};function Lr(e,t,n){let r=e.replace(/^#/,``),i,a,o,s;if(r.length!==6&&r.length!==8)throw Error(`Invalid hex color: must be 6 or 8 characters`);return r.length===8?(i=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16),s=parseInt(r.substring(6,8),16)):(i=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16),s=255),i=Math.round(i*(1-t)),a=Math.round(a*(1-t)),o=Math.round(o*(1-t)),s=s*n/255,i=Math.max(0,Math.min(255,i)),a=Math.max(0,Math.min(255,a)),o=Math.max(0,Math.min(255,o)),s=Math.max(0,Math.min(1,s)),`rgba(${i}, ${a}, ${o}, ${s.toFixed(2)})`}var Rr=class{provider;pinMaxSize=0;pinFadeoutColor=ur;pinFadeoutScale=ur;pinFadeoutOpacity=1;pinFadeoutModifier=1;pinMaxDepth=3;pinDepth=3;pins=new Set;constructor(e,t){this.provider=e,this.pinFadeoutColor=t?.pin?.fadeout?.color??.2,this.pinFadeoutScale=t?.pin?.fadeout?.scale??.2,this.pinFadeoutOpacity=t?.pin?.fadeout?.opacity??1,this.pinFadeoutModifier=this.pinFadeoutColor<this.pinFadeoutScale?this.pinFadeoutColor/this.pinFadeoutScale:1,this.pinMaxDepth=t?.pin?.depth??3,this.pinDepth=this.pinMaxDepth}insert(e,t){this.update(e,t),this.pins.add(e)}update(e,t){e.zoom=t?.zoom??NaN,e.marker.update(e.zIndex)}remove(e){e.shown=!0,e.zoom=NaN,e.component.invoke().setCollapsed(!1),e.component.invoke().setDisplayed(!1),e.marker.update(e.zIndex),e.marker.remove(),this.pins.delete(e)}clear(){this.pins.forEach(e=>e.marker.remove()),this.pins.clear(),this.provider.updateCircles([],this.pinMaxDepth)}refresh(){let e=Array.from(this.pins);this.pinMaxSize=e.reduce((e,t)=>Math.max(e,t.properties.dimensions.radius*2),0),this.pinDepth=Math.max(1,this.pinMaxDepth-Math.log10(e.length))}draw(){let e=Array.from(this.pins),t=[];for(let n=0;n<e.length;n++){let r=e[n],i=Math.max(0,Math.min(1,this.pinFadeoutColor*this.pinMaxDepth)),a=Math.max(0,Math.min(1,this.pinFadeoutScale*this.pinMaxDepth)),o=Math.max(0,Math.min(1,this.pinFadeoutOpacity*this.pinMaxDepth)),s=r.properties.style?.background??`#008800`,c=Lr(s,0,1),l=Lr(s,i,o),u=r.properties.dimensions.radius-r.properties.dimensions.stroke,d=u*(1-a),f=r.properties.style?.stroke??`#ffffff`,p=Lr(f,0,1),m=Lr(f,i,o),h=r.properties.dimensions.stroke,g=h*(1-a),_={color:{min:l,max:c},radius:{min:d,max:u},stroke:{color:{min:m,max:p},width:{min:g,max:h}},lat:r.lat,lng:r.lng,rank:r.rank,zoom:r.zoom};t.push(_)}this.provider.updateCircles(t,this.pinMaxDepth)}render(e,t){let n=e.zoom,r=Ir.offset(e,t.size,{top:this.pinMaxSize,bottom:this.pinMaxSize,right:this.pinMaxSize,left:this.pinMaxSize});for(let e of this.pins)if(r.contains(e.lat,e.lng))if(Number.isNaN(e.zoom)===!1&&e.shown&&n<e.zoom&&e.zoom<n+this.pinDepth){let t=(e.zoom-n)/this.pinDepth;e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setScale(Math.max(0,1-t*this.pinFadeoutScale),this.pinFadeoutModifier),e.marker.insert()}else e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove());else e.component.invoke().setDisplayed(!1),e.marker.remove()}},zr=class{tooltipMaxWidth=0;tooltipMaxHeight=0;tooltips=new Set;constructor(e,t){}insert(e,t){this.update(e,t),this.tooltips.add(e)}update(e,t){t?(e.zoom=t.zoom,e.directions=t.directions):(e.zoom=NaN,e.directions=[]),e.marker.update(e.zIndex)}remove(e){e.shown=!0,e.zoom=NaN,e.angle=NaN,e.directions=[],e.component.invoke().setAngle(NaN),e.component.invoke().setCollapsed(!0),e.component.invoke().setDisplayed(!1),e.marker.update(e.zIndex),e.marker.remove(),this.tooltips.delete(e)}clear(){this.tooltips.forEach(e=>e.marker.remove()),this.tooltips.clear()}refresh(){let e=Array.from(this.tooltips);this.tooltipMaxWidth=e.reduce((e,t)=>Math.max(e,t.width),0),this.tooltipMaxHeight=e.reduce((e,t)=>Math.max(e,t.height),0)}render(e,t){let n=e.zoom,r=Ir.offset(e,t.size,{top:this.tooltipMaxHeight,bottom:this.tooltipMaxHeight,right:this.tooltipMaxWidth,left:this.tooltipMaxWidth});for(let e of this.tooltips)if(r.contains(e.lat,e.lng))if(Number.isNaN(e.zoom)===!1&&e.shown&&e.zoom<=n){let t=e.directions.findLast(e=>e.zoom<=n)?.angle;if(t===void 0)throw Error(`Failed to find angle`);e.angle=t,e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setAngle(t),e.marker.insert()}else e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove());else e.component.invoke().setDisplayed(!1),e.marker.remove()}},Br=class{provider;pan=!0;popups=new Set;constructor(e,t){this.provider=e,this.pan=t?.popup?.pan??!0}insert(e){this.popups.add(e)}remove(e){e.angle=NaN,e.shown=!1,e.marker.remove(),e.component.invoke().setAngle(NaN),e.component.invoke().setCollapsed(!0),e.component.invoke().setDisplayed(!1),this.popups.delete(e)}clear(){this.popups.forEach(e=>e.marker.remove()),this.popups.clear()}show(e){if(!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!1,e.tooltip.shown=!1,e.popup.angle=e.tooltip.angle,e.popup.shown=!0,this.pan===!1))return;let t=this.provider.getViewport(),n=this.provider.getParameters().size,r=t.bounds,i=t.zoom,a=e.popup,o=n*2**i,s=kr(r.ne.lat,r.sw.lng,o),c=kr(r.sw.lat,r.ne.lng,o),l=c.x-s.x,u=c.y-s.y,d=a.width+a.padding*8,f=a.height+a.padding*8,p=kr(a.lat,a.lng,o),m=Cr(d,f,e.tooltip.angle),h=p.x+m.x,g=h+d,_=p.y+m.y,ee=_+f,v=h-s.x,y=c.x-g,b=_-s.y,te=c.y-ee,x=0;l<d?x=(v-y)/2:(v<0&&(x=v),y<0&&(x=-y));let S=0;u<f?S=(b-te)/2:(b<0&&(S=b),te<0&&(S=-te)),(x!==0||S!==0)&&this.provider.panBy(x,S)}hide(e){!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}render(){for(let e of this.popups)e.shown?(e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setAngle(e.angle,!0),e.marker.insert()):(e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove()))}},Vr=class{provider;pinManager;tooltipManager;popupManager;elementsStore;constructor(e,t){this.provider=e,this.pinManager=new Rr(e,t),this.tooltipManager=new zr(e,t),this.popupManager=new Br(e,t),this.elementsStore=new Map}clearElements(){this.elementsStore.clear(),this.pinManager.clear(),this.tooltipManager.clear(),this.popupManager.clear()}removeElements(e){if(e.length!==0){for(let t of e){let e=this.elementsStore.get(t.properties.id);e!==void 0&&(this.pinManager.remove(e.pin),this.tooltipManager.remove(e.tooltip),e.popup!==void 0&&this.popupManager.remove(e.popup))}this.pinManager.refresh(),this.tooltipManager.refresh(),this.pinManager.draw()}}updateElements(e){if(e.length!==0){for(let t of e){let e=this.elementsStore.get(t.properties.id);e!==void 0&&(this.pinManager.update(e.pin,t.state),this.tooltipManager.update(e.tooltip,t.state))}this.pinManager.draw()}}insertElements(e,t){if(e.length!==0){for(let n of e){let e=this.elementsStore.get(n.properties.id);e===void 0&&(e=new Or(this.provider,n),e.tooltip.marker.div.addEventListener(`click`,e=>t(e,n.properties.id)),this.elementsStore.set(n.properties.id,e)),this.pinManager.insert(e.pin,n.state),this.tooltipManager.insert(e.tooltip,n.state),e.popup!==void 0&&this.popupManager.insert(e.popup)}this.pinManager.refresh(),this.tooltipManager.refresh(),this.pinManager.draw()}}renderElements(e,t){this.popupManager.render(),this.tooltipManager.render(e,t),this.pinManager.render(e,t)}showPopup(e){let t=this.elementsStore.values();for(let n of t)n.id===e?this.popupManager.show(n):this.popupManager.hide(n)}hidePopup(e){let t=this.elementsStore.get(e);t!==void 0&&this.popupManager.hide(t)}hidePopups(){let e=this.elementsStore.values();for(let t of e)this.popupManager.hide(t)}},Hr=14097894508562428199n,G=13011662864482103923n,Ur=11160318154034397263n,Wr=14504361325974414679n,K=18446744073709551615n;function q(e){return e&K}function J(e,t){return t===0?e&K:(e&=K,(e>>BigInt(t)|e<<BigInt(64-t))&K)}function Gr(e,t){return e&=K,(e>>BigInt(t)|e<<BigInt(64-t))&K}function Kr(e){return q(e^e>>47n)}function Y(e,t=0){let n=0n;for(let r=0;r<8;r++)t+r<e.length&&(n|=BigInt(e[t+r])<<BigInt(r*8));return n&K}function qr(e,t=0){let n=0n;for(let r=0;r<4;r++)t+r<e.length&&(n|=BigInt(e[t+r])<<BigInt(r*8));return n&4294967295n}function Jr(e){let t=11376068507788127593n,n=(e.first^e.second)*t&K;n^=n>>47n,n&=K;let r=(e.second^n)*t&K;return r^=r>>47n,r=r*t&K,r}function Yr(e,t){return Jr({first:e,second:t})}function Xr(e){let t=e.length;if(t>8){let n=Y(e),r=Y(e,t-8);return(Yr(n,Gr(r+BigInt(t)&K,t))^r)&K}if(t>=4){let n=qr(e);return Yr(BigInt(t)+(n<<3n)&K,qr(e,t-4))}if(t>0){let n=BigInt(e[0]),r=BigInt(e[t>>1]),i=BigInt(e[t-1]),a=q(n+(r<<8n)),o=q(BigInt(t)+(i<<2n));return q(Kr(q(a*Ur)^q(o*Wr))*Ur)}return Ur}function Zr(e){let t=e.length,n=q(Y(e)*G),r=Y(e,8),i=q(Y(e,t-8)*Ur),a=q(Y(e,t-16)*Hr);return Yr(q(J(q(n-r),43)+J(i,30)+a),q(n+J(r^Wr,20)-i+BigInt(t)))}function Qr(e,t,n,r,i,a){i=q(i+e),a=J(q(a+i+r),21);let o=i;return i=q(i+t),i=q(i+n),a=q(a+J(i,44)),{first:q(i+r),second:q(a+o)}}function $r(e,t,n,r){return Qr(Y(e,t),Y(e,t+8),Y(e,t+16),Y(e,t+24),n,r)}function ei(e){let t=e.length,n=Y(e,24),r=q(Y(e)+q((BigInt(t)+Y(e,t-16))*Hr)),i=J(q(r+n),52),a=J(r,37);r=q(r+Y(e,8)),a=q(a+J(r,7)),r=q(r+Y(e,16));let o=q(r+n),s=q(i+J(r,31)+a);r=q(Y(e,16)+Y(e,t-32));let c=Y(e,t-8);i=J(q(r+c),52),a=J(r,37),r=q(r+Y(e,t-24)),a=q(a+J(r,7)),r=q(r+Y(e,t-16));let l=q(r+c);return q(Kr(q(Kr(q(q(o+q(i+J(r,31)+a))*Ur+q(l+s)*Hr))*Hr+s))*Ur)}function ti(e){let t;t=typeof e==`string`?new TextEncoder().encode(e):e;let n=t.length;if(n<=32)return n<=16?Xr(t):Zr(t);if(n<=64)return ei(t);let r=Y(t),i=q(Y(t,n-16)^G),a=q(Y(t,n-56)^Hr),o=$r(t,n-64,BigInt(n),i),s=$r(t,n-32,q(BigInt(n)*G),Hr);a=q(a+Kr(o.second)*G),r=q(J(q(a+r),39)*G),i=q(J(i,33)*G);let c=n-1&-64,l=0;for(;c>0;)r=q(J(q(r+i+o.first+Y(t,l+16)),37)*G),i=q(J(q(i+o.second+Y(t,l+48)),42)*G),r^=s.second,i^=o.first,a=J(a^s.first,33),o=$r(t,l,q(o.second*G),q(r+s.first)),s=$r(t,l+32,q(a+s.second),i),[a,r]=[r,a],l+=64,c-=64;return Yr(Yr(o.first,s.first)+q(Kr(i)*G)+a,Yr(o.second,s.second)+r)}function ni(e){return ti(e).toString()}var ri=e=>e<180?e<90?e<30?0:e===30?1:2:e<120?3:e===120?4:5:e<270?e<210?6:e===210?7:8:e<300?9:e===300?10:11,ii=e=>new Promise(t=>setTimeout(t,e));async function ai(e,t){let n=0,r=Math.max(1,t?.retry?.times??1);for(;n<r;)try{return{data:await e(),error:null}}catch(e){if(n++,n===r){if(e instanceof Error)return(!t?.exceptions||t.exceptions.some(t=>e instanceof t)===!1)&&t?.catch?.(e),{data:null,error:e};throw t?.catch?.(e),e}else t?.retry?.delay&&await ii(t.retry.delay)}throw Error(`Unreachable code`)}var oi=class{worker;workerInvocations;workerInvocationCounter=0;constructor(e){this.worker=e,this.workerInvocations=new Map,this.worker.onmessage=this.onmessage.bind(this),this.worker.onerror=this.onerror.bind(this)}onmessage(e){let t=this.workerInvocations.get(e.data.id);if(!t)throw Error(`Unknown invocation: ${e.data.id}`);e.data.error?t.reject(Error(e.data.error)):t.resolve(e.data.result),this.workerInvocations.delete(e.data.id)}onerror(e){this.workerInvocations.forEach(t=>t.reject(Error(e.message))),this.workerInvocations.clear()}invoke(e,...t){return new Promise((n,r)=>{let i=`${e.toString()}_${this.workerInvocationCounter++}_${performance.now()}`,a={id:i,method:e.toString(),args:t};this.workerInvocations.set(i,{resolve:n,reject:r}),this.worker.postMessage(a)})}terminate(){this.workerInvocations.forEach(e=>e.reject(Error(`Terminated`))),this.workerInvocations.clear(),this.worker.terminate()}},si='(function(){var e=class{methods;constructor(e){this.methods=e}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(e){let{id:t,method:n,args:r}=e.data;try{let e=this.methods[n];if(typeof e!=`function`)throw Error(`Unknown method: ${n}`);let i={id:t,result:await e(...r)};self.postMessage(i)}catch(e){let n={id:t,error:e instanceof Error?e.message:String(e)};self.postMessage(n)}}};let t=e=>new Promise(t=>setTimeout(t,e));async function n(e,n){let r=0,i=Math.max(1,n?.retry?.times??1);for(;r<i;)try{return{data:await e(),error:null}}catch(e){if(r++,r===i){if(e instanceof Error)return(!n?.exceptions||n.exceptions.some(t=>e instanceof t)===!1)&&n?.catch?.(e),{data:null,error:e};throw n?.catch?.(e),e}else n?.retry?.delay&&await t(n.retry.delay)}throw Error(`Unreachable code`)}let r=[0,30,60,90,120,150,180,210,240,270,300,330],i=1e6;function a(e){let t=new ArrayBuffer(4+e.items.length*16),n=new DataView(t);n.setUint8(0,e.parameters.size/256),n.setUint8(1,e.parameters.zoom.min),n.setUint8(2,e.parameters.zoom.max),n.setUint8(3,e.parameters.zoom.scale);let r=e.items.length,a=e.items,o=4;for(let e=0;e<r;e++){let t=a[e];n.setUint32(o+0,t.rank,!0),n.setInt32(o+4,Math.round(t.lat*i),!0),n.setInt32(o+8,Math.round(t.lng*i),!0),n.setUint16(o+12,Math.round(t.width*100),!0),n.setUint16(o+14,Math.round(t.height*100),!0),o+=16}return t}function o(e){let t=new DataView(e),n=t.getUint32(0,!0),i=0;i+=4;let a=Array(n);for(let e=0;e<n;e++){let n=t.getUint8(i)/5,o=t.getUint8(i+1),s=Array(o);i+=2;for(let e=0;e<o;e++){let n=t.getUint8(i)/5,a=t.getUint8(i+1);i+=2,s[e]={zoom:n,angle:r[a]}}a[e]={zoom:n,directions:s}}return a}let s=`X-Token`;new e({async fetch(e){let t=a(e.input),r=self.location.host.startsWith(`localhost`)||self.location.host.startsWith(`127.0.0.1`),i=await n(async()=>await fetch(`https://4.1.api.maps.arenarium.dev/states`,{method:`POST`,headers:{"X-Version":`1.4.13`,"X-Key":e.key,[s]:e.jwt,"Cache-Control":r?`no-cache`:``,"Content-Type":`application/octet-stream`},body:t}),{retry:{times:3,delay:500}});if(i.error)throw i.error;let c=i.data;if(!c.ok)throw Error(await c.text());return{jwt:c.headers.get(s)??``,output:o(await c.arrayBuffer())}}}).listen()})();',ci=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,si],{type:`text/javascript;charset=utf-8`});function li(e){let t;try{if(t=ci&&(self.URL||self.webkitURL).createObjectURL(ci),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(si),{name:e?.name})}}var ui=`X-Version`,di;function fi(e){return{lang:e?.lang??di?.lang,message:e?.message,abortEarly:e?.abortEarly??di?.abortEarly,abortPipeEarly:e?.abortPipeEarly??di?.abortPipeEarly}}var pi;function mi(e){return pi?.get(e)}var hi;function gi(e){return hi?.get(e)}var _i;function vi(e,t){return _i?.get(e)?.get(t)}function yi(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function X(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??yi(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},l=e.kind===`schema`,u=i?.message??e.message??vi(e.reference,c.lang)??(l?gi(c.lang):null)??r.message??mi(c.lang);u!==void 0&&(c.message=typeof u==`function`?u(c):u),l&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}function Z(e){return{version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},fi())}}}function bi(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}var xi=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function Si(e){return{kind:`transformation`,type:`args`,reference:Si,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=(...e)=>{let r=this.schema[`~run`]({value:e},t);if(r.issues)throw new xi(r.issues);return n(...r.value)},e}}}var Ci=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u;function wi(e,t){return{kind:`validation`,type:`check`,reference:wi,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&X(this,`input`,e,t),e}}}function Ti(e){return{kind:`validation`,type:`hex_color`,reference:Ti,async:!1,expects:null,requirement:Ci,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&X(this,`hex color`,e,t),e}}}function Ei(e,t){return{kind:`validation`,type:`length`,reference:Ei,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length!==this.requirement&&X(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function Di(e,t){return{kind:`validation`,type:`max_value`,reference:Di,async:!1,expects:`<=${e instanceof Date?e.toJSON():yi(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value<=this.requirement)&&X(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():yi(e.value)}),e}}}function Oi(e,t){return{kind:`validation`,type:`min_length`,reference:Oi,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&X(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function ki(e,t){return{kind:`validation`,type:`min_value`,reference:ki,async:!1,expects:`>=${e instanceof Date?e.toJSON():yi(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>=this.requirement)&&X(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():yi(e.value)}),e}}}function Ai(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function ji(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function Mi(){return{kind:`schema`,type:`any`,reference:Mi,expects:`any`,async:!1,get"~standard"(){return Z(this)},"~run"(e){return e.typed=!0,e}}}function Ni(e){return{kind:`schema`,type:`boolean`,reference:Ni,expects:`boolean`,async:!1,message:e,get"~standard"(){return Z(this)},"~run"(e,t){return typeof e.value==`boolean`?e.typed=!0:X(this,`type`,e,t),e}}}function Pi(e,t){return{kind:`schema`,type:`custom`,reference:Pi,expects:`unknown`,async:!1,check:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:X(this,`type`,e,t),e}}}function Fi(e){return{kind:`schema`,type:`function`,reference:Fi,expects:`Function`,async:!1,message:e,get"~standard"(){return Z(this)},"~run"(e,t){return typeof e.value==`function`?e.typed=!0:X(this,`type`,e,t),e}}}function Ii(e,t){return{kind:`schema`,type:`literal`,reference:Ii,expects:yi(e),async:!1,literal:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){return e.value===this.literal?e.typed=!0:X(this,`type`,e,t),e}}}function Li(e){return{kind:`schema`,type:`number`,reference:Li,expects:`number`,async:!1,message:e,get"~standard"(){return Z(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:X(this,`type`,e,t),e}}}function Ri(e,t){return{kind:`schema`,type:`object`,reference:Ri,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:ji(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=Ai(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(X(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else X(this,`type`,e,t);return e}}}function Q(e,t){return{kind:`schema`,type:`optional`,reference:Q,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Z(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=ji(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function zi(e){return{kind:`schema`,type:`string`,reference:zi,expects:`string`,async:!1,message:e,get"~standard"(){return Z(this)},"~run"(e,t){return typeof e.value==`string`?e.typed=!0:X(this,`type`,e,t),e}}}function Bi(e,t){return{kind:`schema`,type:`tuple`,reference:Bi,expects:`Array`,async:!1,items:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<this.items.length;r++){let i=n[r],a=this.items[r][`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else X(this,`type`,e,t);return e}}}function Vi(e){let t;if(e)for(let n of e)t?t.push(...n.issues):t=n.issues;return t}function Hi(e,t){return{kind:`schema`,type:`union`,reference:Hi,expects:bi(e.map(e=>e.expects),`|`),async:!1,options:e,message:t,get"~standard"(){return Z(this)},"~run"(e,t){let n,r,i;for(let a of this.options){let o=a[`~run`]({value:e.value},t);if(o.typed)if(o.issues)r?r.push(o):r=[o];else{n=o;break}else i?i.push(o):i=[o]}if(n)return n;if(r){if(r.length===1)return r[0];X(this,`type`,e,t,{issues:Vi(r)}),e.typed=!0}else if(i?.length===1)return i[0];else X(this,`type`,e,t,{issues:Vi(i)});return e}}}function $(...e){return{...e[0],pipe:e,get"~standard"(){return Z(this)},"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}}}var Ui=$(zi(),Ei(32)),Wi=$(zi(),Oi(1)),Gi=Pi(e=>e instanceof HTMLElement,`Must be an HTMLElement`),Ki=$(Fi(),Si(Bi([zi(),Gi]))),qi=$(Ri({radius:$(Li(),ki(0),Di(128)),stroke:$(Li(),ki(0),Di(128))}),wi(e=>e.stroke<=e.radius,`Stroke must be less than or equal to radius`)),Ji=Ri({background:Q($(zi(),Ti())),stroke:Q($(zi(),Ti())),shadow:Q(zi())}),Yi=$(Ri({width:$(Li(),ki(1),Di(655.36)),height:$(Li(),ki(1),Di(655.36)),padding:$(Li(),ki(1))}),wi(e=>Math.min(e.width,e.height)/e.padding>=4,`Padding must not exceed 25% of the minimum dimension (width or height)`)),Xi=Ri({background:Q($(zi(),Ti())),radius:Q($(Li(),ki(0))),filter:Q(zi())}),Zi=Ri({id:$(zi(),Oi(1)),rank:$(Li(),ki(0),Di(4294967295)),lat:$(Li(),ki(-90),Di(90)),lng:$(Li(),ki(-180),Di(180)),tooltip:Ri({element:Gi,style:Q(Xi),dimensions:Q(Yi),initialize:Q(Ki)}),pin:Q(Ri({element:Q(Gi),style:Q(Ji),dimensions:Q(qi),initialize:Q(Ki)})),popup:Q(Ri({element:Gi,style:Q(Xi),dimensions:Q(Yi),initialize:Q(Ki)}))}),Qi=class{apiKey;apiJwt;apiCache;worker;workerClient;constructor(e,t){this.apiKey=e,this.apiJwt=t,this.apiCache=new Map,this.worker=new li,this.workerClient=new oi(this.worker)}clearStates(){this.apiCache.clear()}async updateStates(e,t){if(t.length===0)return;if(t.length===1){t[0].state={zoom:0,directions:[{zoom:0,angle:ri(270)}]};return}t.sort((e,t)=>e.properties.id.localeCompare(t.properties.id));let n=t.map(e=>{let t=e.properties,n=t.tooltip.dimensions;return{lat:t.lat,lng:t.lng,rank:t.rank,width:n.width+1.5*n.padding,height:n.height+1.5*n.padding}}),r=ni(JSON.stringify(n)),i=this.apiCache.get(r);if(i===void 0){let t={key:this.apiKey,jwt:this.apiJwt,input:{parameters:e,items:n}},a=await this.workerClient.invoke(`fetch`,t);a.jwt&&(this.apiJwt=a.jwt),i=a.output,this.apiCache.set(r,i)}for(let e=0;e<t.length;e++){let n=t[e];n.state=i[e]}}};async function $i(e,t,n,r,i){let a=await ai(async()=>await fetch(e,{...n,headers:{"Content-Type":`application/json`,...n?.headers},method:`POST`,body:t?JSON.stringify(t):void 0}),{retry:{times:r,delay:i}});if(a.error)throw a.error;let o=a.data;if(!o.ok)throw Error(await o.text());return await o.json()}async function ea(e,t,n,r,i){let a=await ai(async()=>await fetch(e,{...n,headers:{"Content-Type":`application/json`,...n?.headers},method:`PUT`,body:t?JSON.stringify(t):void 0}),{retry:{times:r,delay:i}});if(a.error)throw a.error;let o=a.data;if(!o.ok)throw Error(await o.text())}var ta=class{static create(e,t,n){throw Error(`Must override static create method!`)}};function na(e){return Math.round(e*br)/br}function ra(e){return Math.round(e*100)/100}var ia;function aa(e){return{lang:e?.lang??ia?.lang,message:e?.message,abortEarly:e?.abortEarly??ia?.abortEarly,abortPipeEarly:e?.abortPipeEarly??ia?.abortPipeEarly}}var oa;function sa(e){return oa?.get(e)}var ca;function la(e){return ca?.get(e)}var ua;function da(e,t){return ua?.get(e)?.get(t)}function fa(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function pa(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??fa(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},l=e.kind===`schema`,u=i?.message??e.message??da(e.reference,c.lang)??(l?la(c.lang):null)??r.message??sa(c.lang);u!==void 0&&(c.message=typeof u==`function`?u(c):u),l&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}function ma(e){return{version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},aa())}}}var ha=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function ga(e,t){return{kind:`schema`,type:`array`,reference:ga,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return ma(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else pa(this,`type`,e,t);return e}}}function _a(e,t,n){let r=e[`~run`]({value:t},aa(n));if(r.issues)throw new ha(r.issues);return r.value}var va=`1.4.13`,ya=`https://4.1.api.maps.arenarium.dev/auth`,ba=`https://4.1.api.maps.arenarium.dev/log`,xa=class e extends ta{apiKey;mapProvider;mapStateProvider;markers;markersElementRenderer;markersElementManager;markersStateManager;constructor(e,n,r,i){super(),_a(Ui,e),_a(Wi,n),this.apiKey=e,this.mapProvider=r,this.mapStateProvider=new a(this.mapProvider,this.detached.bind(this),this.error.bind(this),this.onMapMove.bind(this),this.onMapIdle.bind(this),this.onMapClick.bind(this)),this.markers=new Map,this.markersElementRenderer=new t(this.renderMarkers.bind(this)),this.markersElementManager=new Vr(r,i),this.markersStateManager=new Qi(e,n)}static async create(t,n,r){let i=await $i(ya,{key:t},{headers:{[ui]:va}});this.deprecated(va,i.version)&&console.warn(`This version of @arenarium/maps is deprecated and may not work correctly. Please upgrade to the latest version.`);let a=i.jwt;if(!a)throw Error(`Failed to get api jwt`);return new e(t,a,n,r)}static deprecated(e,t){if(!t)return!1;let n=t.split(`.`),r=e.split(`.`);if(n.length!==r.length)return!0;let i=Number.parseInt(n.join(``)),a=Number.parseInt(r.join(``));return Number.isNaN(i)||Number.isNaN(a)?!1:a<i}clear(){this.mapStateProvider.stop(),this.markersElementRenderer.stop(),this.markers.clear(),this.markersStateManager.clearStates(),this.markersElementManager.clearElements()}detached(){return this.mapProvider.getContainer().parentElement===null}error(e,t){this.log(`error`,e,t)}async log(e,t,n){switch(e){case`info`:console.info(n);break;case`warning`:console.warn(n);break;case`error`:console.error(n);break}if(n instanceof Error)try{await ea(ba,{title:t,level:e,content:{version:va,key:this.apiKey,name:n.name,message:n.message,cause:n.cause,stack:n.stack}},{headers:{[ui]:va}})}catch(e){console.error(e)}}onMapMove(){this.markersElementRenderer.run()}onMapIdle(){this.markersElementRenderer.run()}onMapClick(){this.hidePopup()}onMarkerClick(e,t){e.stopPropagation(),this.showPopup(t)}createMarkers(e){let t=[],r=this.mapProvider.getContainer(),i=e=>{let t=document.createElement(`div`);t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.width=`max-content`,t.style.zIndex=`-1`;try{return t.appendChild(e),r.appendChild(t),t.getBoundingClientRect()}finally{r.removeChild(t)}},a=(e,t)=>{if(t)return t;if(e){let t=i(e),n=t.width,r=t.height;return{radius:Math.max(n,r)/2,stroke:2}}else return{radius:8,stroke:2}},o=(e,t)=>{if(t)return t;let n=i(e),r=ra(n.width),a=ra(n.height);return{width:r,height:a,padding:Math.min(Math.round(Math.min(r,a)/4),8)}};for(let r of e){let e=r.id,i=r.rank,s=na(r.lat),c=na(r.lng),l={id:e,initialize:r.pin?.initialize,element:r.pin?.element,style:r.pin?.style,dimensions:a(r.pin?.element,r.pin?.dimensions)},u={id:e,initialize:r.tooltip.initialize,element:r.tooltip.element,style:r.tooltip.style,dimensions:o(r.tooltip.element,r.tooltip.dimensions)},d;r.popup&&(d={id:e,initialize:r.popup.initialize,element:r.popup.element,style:r.popup.style,dimensions:o(r.popup.element,r.popup.dimensions)});let f=new n(e,s,c,i,l,u,d);t.push(f)}return t}renderMarkers(){try{if(this.detached())return!0;let e=this.mapProvider.getParameters(),t=this.mapProvider.getViewport();return this.markersElementManager.renderElements(t,e),!1}catch(e){return this.clear(),this.error(`Process markers render error`,e),!0}}async updateMarkers(e){_a(ga(Zi),e);let t=new Set;for(let n of e){let e=`${na(n.lat)},${na(n.lng)}`;if(t.has(e))throw Error(`Two or more markers have the same coordinates`)}try{let t=[];for(let n of e)this.markers.has(n.id)||t.push(n);let n=this.createMarkers(t);for(let e of n)this.markers.set(e.properties.id,e);this.markersElementManager.insertElements(n,this.onMarkerClick.bind(this)),this.markersElementRenderer.run();let r=this.mapProvider.getParameters(),i=Array.from(this.markers.values());await this.markersStateManager.updateStates(r,i),this.markersElementManager.updateElements(i),this.markersElementRenderer.run(),this.mapStateProvider.start()}catch(e){throw this.clear(),this.error(`Failed to update markers`,e),e}}async removeMarkers(){try{this.clear()}catch(e){throw this.error(`Failed to remove markers`,e),e}}showTooltip(e){if(!this.detached())try{let t=this.markers.get(e);if(!t)return;let n=t.properties.lat,r=t.properties.lng,i=t.state?.zoom;if(!i)return;this.mapProvider.moveTo(n,r,i)}catch(e){throw this.error(`Failed to show tooltip`,e),e}}showPopup(e){if(!this.detached())try{this.markersElementManager.showPopup(e)}catch(e){throw this.markersElementManager.hidePopups(),this.error(`Failed to show popup`,e),e}finally{this.markersElementRenderer.run()}}hidePopup(){if(!this.detached())try{this.markersElementManager.hidePopups()}catch(e){throw this.error(`Failed to hide popup`,e),e}finally{this.markersElementRenderer.run()}}};export{xa as MapManager};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arenarium/maps",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "arenarium",
|
|
6
6
|
"description": "Visualize complex map markers clearly. A JavaScript library for effective display of map markers, compatible with MapLibre, Mapbox, and Google Maps.",
|