@arenarium/maps 1.2.2 → 1.2.4

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/package.json CHANGED
@@ -1,86 +1,88 @@
1
1
  {
2
- "name": "@arenarium/maps",
3
- "version": "1.2.2",
4
- "license": "MIT",
5
- "author": "arenarium.dev",
6
- "description": "Visualize complex map markers clearly. A JavaScript lib for effective display of map markers, compatible with MapLibre, Mapbox, and Google Maps.",
7
- "homepage": "https://arenarium.dev",
8
- "keywords": [
9
- "arenarium",
10
- "maps",
11
- "svelte"
12
- ],
13
- "type": "module",
14
- "main": "./dist/main.cjs.js",
15
- "module": "./dist/main.es.js",
16
- "svelte": "./dist/main.es.js",
17
- "types": "./dist/main.d.ts",
18
- "unpkg": "./dist/main.js",
19
- "jsdelivr": "./dist/main.js",
20
- "exports": {
21
- ".": {
22
- "types": "./dist/main.d.ts",
23
- "svelte": "./dist/main.es.js",
24
- "import": "./dist/main.es.js",
25
- "require": "./dist/main.cjs.js"
26
- },
27
- "./dist/style.css": {
28
- "import": "./dist/style.css",
29
- "require": "./dist/style.css"
30
- }
31
- },
32
- "files": [
33
- "dist",
34
- "!dist/**/*.test.*",
35
- "!dist/**/*.spec.*"
36
- ],
37
- "sideEffects": [
38
- "**/*.css"
39
- ],
40
- "devDependencies": {
41
- "@googlemaps/js-api-loader": "^1.16.10",
42
- "@rollup/plugin-typescript": "^12.1.4",
43
- "@sveltejs/adapter-auto": "^6.1.0",
44
- "@sveltejs/kit": "^2.43.4",
45
- "@sveltejs/package": "^2.5.4",
46
- "@sveltejs/vite-plugin-svelte": "^6.2.1",
47
- "@types/google.maps": "^3.58.1",
48
- "@types/node": "^24.5.2",
49
- "dts-bundle-generator": "^9.5.1",
50
- "eslint": "^9.36.0",
51
- "eslint-config-prettier": "^10.1.8",
52
- "eslint-plugin-svelte": "^3.12.4",
53
- "globals": "^16.4.0",
54
- "less": "^4.4.1",
55
- "mapbox-gl": "^3.15.0",
56
- "maplibre-gl": "^5.7.3",
57
- "prettier": "^3.6.2",
58
- "prettier-plugin-svelte": "^3.4.0",
59
- "publint": "^0.3.13",
60
- "svelte": "^5.39.6",
61
- "svelte-check": "^4.3.2",
62
- "typescript": "^5.9.2",
63
- "typescript-eslint": "^8.44.1",
64
- "vite": "^7.1.7",
65
- "vite-plugin-dts": "^4.5.4",
66
- "@arenarium/maps-integration-google": "1.0.1",
67
- "@arenarium/maps-integration-mapbox": "1.0.1",
68
- "@arenarium/maps-shared": "1.0.0",
69
- "@arenarium/maps-integration-maplibre": "1.0.1"
70
- },
71
- "dependencies": {
72
- "valibot": "^1.1.0"
73
- },
74
- "scripts": {
75
- "lib_dev": "vite dev --host",
76
- "lib_dev_browser": "vite dev --mode browser --host",
77
- "lib_check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
78
- "lib_check_watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
79
- "lib_build": "vite build -c ./vite/vite.config.ts",
80
- "lib_build_dev": "vite build -c ./vite/vite.config.ts --mode development",
81
- "lib_patch": "pnpm version patch --no-git-tag-version",
82
- "lib_publish_public": "pnpm publish --access public",
83
- "lib_build_patch_commit_publish": "pnpm run build && pnpm run lib_patch_push && pnpm run lib_publish_public",
84
- "lib_preview": "vite preview"
85
- }
86
- }
2
+ "name": "@arenarium/maps",
3
+ "version": "1.2.4",
4
+ "license": "MIT",
5
+ "author": "arenarium",
6
+ "description": "Visualize complex map markers clearly. A JavaScript library for effective display of map markers, compatible with MapLibre, Mapbox, and Google Maps.",
7
+ "homepage": "https://arenarium.dev",
8
+ "keywords": [
9
+ "arenarium",
10
+ "maps",
11
+ "svelte"
12
+ ],
13
+ "type": "module",
14
+ "main": "./dist/main.js",
15
+ "module": "./dist/main.js",
16
+ "svelte": "./dist/main.js",
17
+ "types": "./dist/main.d.ts",
18
+ "unpkg": "./dist/main.js",
19
+ "jsdelivr": "./dist/main.js",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/main.d.ts",
23
+ "svelte": "./dist/main.js",
24
+ "import": "./dist/main.js",
25
+ "require": "./dist/main.js"
26
+ },
27
+ "./style.css": {
28
+ "import": "./dist/main.css",
29
+ "require": "./dist/main.css"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "!dist/**/*.test.*",
35
+ "!dist/**/*.spec.*"
36
+ ],
37
+ "sideEffects": [
38
+ "**/*.css"
39
+ ],
40
+ "devDependencies": {
41
+ "@arenarium/maps-compute": "1.0.0",
42
+ "@arenarium/maps-integration-google": "1.0.2",
43
+ "@arenarium/maps-integration-mapbox": "1.0.2",
44
+ "@arenarium/maps-integration-maplibre": "1.0.2",
45
+ "@googlemaps/js-api-loader": "^2.0.2",
46
+ "@sveltejs/adapter-auto": "^7.0.0",
47
+ "@sveltejs/kit": "^2.49.1",
48
+ "@sveltejs/vite-plugin-svelte": "^6.2.1",
49
+ "@types/bun": "^1.3.3",
50
+ "@types/google.maps": "^3.58.1",
51
+ "@types/node": "^24.10.1",
52
+ "bun-plugin-svelte": "^0.0.6",
53
+ "bunup": "^0.16.10",
54
+ "clean-package": "^2.2.0",
55
+ "eslint": "^9.39.1",
56
+ "eslint-config-prettier": "^10.1.8",
57
+ "eslint-plugin-svelte": "^3.13.1",
58
+ "mapbox-gl": "^3.17.0",
59
+ "maplibre-gl": "^5.14.0",
60
+ "prettier": "^3.7.4",
61
+ "prettier-plugin-svelte": "^3.4.0",
62
+ "publint": "^0.3.15",
63
+ "svelte-check": "^4.3.4",
64
+ "svelte-preprocess": "^6.0.3",
65
+ "typescript": "latest",
66
+ "typescript-eslint": "^8.48.1",
67
+ "vite": "^7.2.6"
68
+ },
69
+ "dependencies": {
70
+ "@arenarium/maps-core": "1.0.2",
71
+ "valibot": "^1.2.0",
72
+ "svelte": "^5.45.5"
73
+ },
74
+ "scripts": {
75
+ "prepack": "clean-package",
76
+ "postpack": "clean-package restore",
77
+ "lib_dev": "vite dev --host",
78
+ "lib_dev_browser": "vite dev --mode browser --host",
79
+ "lib_check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
80
+ "lib_check_watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
81
+ "lib_build": "NODE_ENV=production VITE_API_URL=https://maps.api.arenarium.dev bunup",
82
+ "lib_build_dev": "NODE_ENV=development VITE_API_URL=http://127.0.0.1:8787 bunup",
83
+ "lib_patch": "bun pm version patch --no-git-tag-version",
84
+ "lib_publish_public": "bun publish --access public",
85
+ "lib_build_patch_commit_publish": "bun run build && bun run lib_patch_push && bun run lib_publish_public",
86
+ "lib_preview": "vite preview"
87
+ }
88
+ }
package/dist/main.cjs.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const kr=!1;var br=Array.isArray,xn=Array.prototype.indexOf,Pn=Array.from,xt=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,Sn=Object.prototype,An=Array.prototype,Cn=Object.getPrototypeOf,or=Object.isExtensible;function Tn(t){for(var e=0;e<t.length;e++)t[e]()}function Ln(){var t,e,r=new Promise((n,i)=>{t=n,e=i});return{promise:r,resolve:t,reject:e}}const R=2,Dt=4,Mr=8,Ie=16,fe=32,ge=64,Ft=128,q=256,ot=512,I=1024,K=2048,ce=4096,Ae=8192,Oe=16384,Rt=32768,xr=65536,ar=1<<17,In=1<<18,De=1<<19,On=1<<20,Pt=1<<21,Nt=1<<22,ve=1<<23,nt=Symbol("$state"),jt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Dn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Fn(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Rn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Nn(t){throw new Error("https://svelte.dev/e/effect_orphan")}function jn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function zn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Bn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Un(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Zn(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const qn=2,x=Symbol();function Hn(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Pr(t){return t===this.v}let Yn=!1,Y=null;function Ce(t){Y=t}function zt(t,e=!1,r){Y={p:Y,c:null,e:null,s:t,x:null,l:null}}function Bt(t){var e=Y,r=e.e;if(r!==null){e.e=null;for(var n of r)zr(n)}return t!==void 0&&(e.x=t),Y=e.p,t??{}}function Sr(){return!0}let Me=[];function Vn(){var t=Me;Me=[],Tn(t)}function ft(t){if(Me.length===0){var e=Me;queueMicrotask(()=>{e===Me&&Vn()})}Me.push(t)}const Xn=new WeakMap;function Ar(t){var e=m;if(e===null)return v.f|=ve,t;if((e.f&Rt)===0){if((e.f&Ft)===0)throw!e.parent&&t instanceof Error&&Cr(t),t;e.b.error(t)}else Te(t,e)}function Te(t,e){for(;e!==null;){if((e.f&Ft)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t instanceof Error&&Cr(t),t}function Cr(t){const e=Xn.get(t);e&&(xt(t,"message",{value:e.message}),xt(t,"stack",{value:e.stack}))}const Et=new Set;let A=null,St=new Set,Xe=[],Ut=null,At=!1;class ie{current=new Map;#e=new Map;#t=new Set;#a=0;#n=null;#c=!1;#o=[];#i=[];#r=[];#s=[];#l=[];#p=[];#f=[];skipped_effects=new Set;process(e){Xe=[];for(const i of e)this.#h(i);if(this.#o.length===0&&this.#a===0){this.#d();var r=this.#r,n=this.#s;this.#r=[],this.#s=[],this.#l=[],A=null,lr(r),lr(n),A===null?A=this:Et.delete(this),this.#n?.resolve()}else this.#u(this.#r),this.#u(this.#s),this.#u(this.#l);for(const i of this.#o)Se(i);for(const i of this.#i)Se(i);this.#o=[],this.#i=[]}#h(e){e.f^=I;for(var r=e.first;r!==null;){var n=r.f,i=(n&(fe|ge))!==0,s=i&&(n&I)!==0,o=s||(n&Ae)!==0||this.skipped_effects.has(r);if(!o&&r.fn!==null){if(i)r.f^=I;else if((n&Dt)!==0)this.#s.push(r);else if((n&I)===0)if((n&Nt)!==0){var l=r.b?.is_pending()?this.#i:this.#o;l.push(r)}else pt(r)&&((r.f&Ie)!==0&&this.#l.push(r),Se(r));var a=r.first;if(a!==null){r=a;continue}}var u=r.parent;for(r=r.next;r===null&&u!==null;)r=u.next,u=u.parent}}#u(e){for(const r of e)((r.f&K)!==0?this.#p:this.#f).push(r),H(r,I);e.length=0}capture(e,r){this.#e.has(e)||this.#e.set(e,r),this.current.set(e,e.v)}activate(){A=this}deactivate(){A=null;for(const e of St)if(St.delete(e),e(),A!==null)break}neuter(){this.#c=!0}flush(){Xe.length>0?Wn():this.#d(),A===this&&(this.#a===0&&Et.delete(this),this.deactivate())}#d(){if(!this.#c)for(const e of this.#t)e();this.#t.clear()}increment(){this.#a+=1}decrement(){if(this.#a-=1,this.#a===0){for(const e of this.#p)H(e,K),We(e);for(const e of this.#f)H(e,ce),We(e);this.#r=[],this.#s=[],this.flush()}else this.deactivate()}add_callback(e){this.#t.add(e)}settled(){return(this.#n??=Ln()).promise}static ensure(){if(A===null){const e=A=new ie;Et.add(A),ie.enqueue(()=>{A===e&&e.flush()})}return A}static enqueue(e){ft(e)}}function Wn(){var t=Pe;At=!0;try{var e=0;for(cr(!0);Xe.length>0;){var r=ie.ensure();if(e++>1e3){var n,i;Gn()}r.process(Xe),ue.clear()}}finally{At=!1,cr(t),Ut=null}}function Gn(){try{jn()}catch(t){Te(t,Ut)}}let de=null;function lr(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(Oe|Ae))===0&&pt(n)&&(de=[],Se(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?qr(n):n.fn=null),de?.length>0)){ue.clear();for(const i of de)Se(i);de=[]}}de=null}}function We(t){for(var e=Ut=t;e.parent!==null;){e=e.parent;var r=e.f;if(At&&e===m&&(r&Ie)!==0)return;if((r&(ge|fe))!==0){if((r&I)===0)return;e.f^=I}}Xe.push(e)}function Kn(t){let e=0,r=ct(0),n;return()=>{ci()&&(g(r),Ht(()=>(e===0&&(n=Kr(()=>t(()=>Ze(r)))),e+=1,()=>{ft(()=>{e-=1,e===0&&(n?.(),n=void 0,Ze(r))})})))}}var Jn=xr|De|Ft;function Qn(t,e,r){new $n(t,e,r)}class $n{parent;#e=!1;#t;#a=null;#n;#c;#o;#i=null;#r=null;#s=null;#l=null;#p=0;#f=0;#h=!1;#u=null;#d=()=>{this.#u&&at(this.#u,this.#p)};#g=Kn(()=>(this.#u=ct(this.#p),()=>{this.#u=null}));constructor(e,r,n){this.#t=e,this.#n=r,this.#c=n,this.parent=m.b,this.#e=!!this.#n.pending,this.#o=vi(()=>{m.b=this;{try{this.#i=he(()=>n(this.#t))}catch(i){this.error(i)}this.#f>0?this.#m():this.#e=!1}},Jn)}#_(){try{this.#i=he(()=>this.#c(this.#t))}catch(e){this.error(e)}this.#e=!1}#w(){const e=this.#n.pending;e&&(this.#r=he(()=>e(this.#t)),ie.enqueue(()=>{this.#i=this.#v(()=>(ie.ensure(),he(()=>this.#c(this.#t)))),this.#f>0?this.#m():(it(this.#r,()=>{this.#r=null}),this.#e=!1)}))}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#n.pending}#v(e){var r=m,n=v,i=Y;ne(this.#o),O(this.#o),Ce(this.#o.ctx);try{return e()}catch(s){return Ar(s),null}finally{ne(r),O(n),Ce(i)}}#m(){const e=this.#n.pending;this.#i!==null&&(this.#l=document.createDocumentFragment(),ei(this.#i,this.#l)),this.#r===null&&(this.#r=he(()=>e(this.#t)))}#y(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e);return}this.#f+=e,this.#f===0&&(this.#e=!1,this.#r&&it(this.#r,()=>{this.#r=null}),this.#l&&(this.#t.before(this.#l),this.#l=null))}update_pending_count(e){this.#y(e),this.#p+=e,St.add(this.#d)}get_effect_pending(){return this.#g(),g(this.#u)}error(e){var r=this.#n.onerror;let n=this.#n.failed;if(this.#h||!r&&!n)throw e;this.#i&&(te(this.#i),this.#i=null),this.#r&&(te(this.#r),this.#r=null),this.#s&&(te(this.#s),this.#s=null);var i=!1,s=!1;const o=()=>{if(i){Hn();return}i=!0,s&&Zn(),ie.ensure(),this.#p=0,this.#s!==null&&it(this.#s,()=>{this.#s=null}),this.#e=this.has_pending_snippet(),this.#i=this.#v(()=>(this.#h=!1,he(()=>this.#c(this.#t)))),this.#f>0?this.#m():this.#e=!1};var l=v;try{O(null),s=!0,r?.(e,o),s=!1}catch(a){Te(a,this.#o&&this.#o.parent)}finally{O(l)}n&&ft(()=>{this.#s=this.#v(()=>{this.#h=!0;try{return he(()=>{n(this.#t,()=>e,()=>o)})}catch(a){return Te(a,this.#o.parent),null}finally{this.#h=!1}})})}}function ei(t,e){for(var r=t.nodes_start,n=t.nodes_end;r!==null;){var i=r===n?null:qt(r);e.append(r),r=i}}function ti(t,e,r){const n=ni;if(e.length===0){r(t.map(n));return}var i=A,s=m,o=ri();Promise.all(e.map(l=>ii(l))).then(l=>{i?.activate(),o();try{r([...t.map(n),...l])}catch(a){(s.f&Oe)===0&&Te(a,s)}i?.deactivate(),Tr()}).catch(l=>{Te(l,s)})}function ri(){var t=m,e=v,r=Y,n=A;return function(){ne(t),O(e),Ce(r),n?.activate()}}function Tr(){ne(null),O(null),Ce(null)}function ni(t){var e=R|K,r=v!==null&&(v.f&R)!==0?v:null;return m===null||r!==null&&(r.f&q)!==0?e|=q:m.f|=De,{ctx:Y,deps:null,effects:null,equals:Pr,f:e,fn:t,reactions:null,rv:0,v:x,wv:0,parent:r??m,ac:null}}function ii(t,e){let r=m;r===null&&Dn();var n=r.b,i=void 0,s=ct(x),o=null,l=!v;return di(()=>{try{var a=t();o&&Promise.resolve(a).catch(()=>{})}catch(c){a=Promise.reject(c)}var u=()=>a;i=o?.then(u,u)??Promise.resolve(a),o=i;var f=A,h=n.is_pending();l&&(n.update_pending_count(1),h||f.increment());const p=(c,d=void 0)=>{o=null,h||f.activate(),d?d!==jt&&(s.f|=ve,at(s,d)):((s.f&ve)!==0&&(s.f^=ve),at(s,c)),l&&(n.update_pending_count(-1),h||f.decrement()),Tr()};if(i.then(p,c=>p(null,c||"unknown")),f)return()=>{queueMicrotask(()=>f.neuter())}}),new Promise(a=>{function u(f){function h(){f===i?a(s):u(i)}f.then(h,h)}u(i)})}function Lr(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)te(e[r])}}function si(t){for(var e=t.parent;e!==null;){if((e.f&R)===0)return e;e=e.parent}return null}function Zt(t){var e,r=m;ne(si(t));try{Lr(t),e=Wr(t)}finally{ne(r)}return e}function Ir(t){var e=Zt(t);if(t.equals(e)||(t.v=e,t.wv=Vr()),!Fe){var r=(le||(t.f&q)!==0)&&t.deps!==null?ce:I;H(t,r)}}const ue=new Map;function ct(t,e){var r={f:0,v:t,reactions:null,equals:Pr,rv:0,wv:0};return r}function C(t,e){const r=ct(t);return _i(r),r}function P(t,e,r=!1){v!==null&&(!G||(v.f&ar)!==0)&&Sr()&&(v.f&(R|Ie|Nt|ar))!==0&&!se?.includes(t)&&Un();let n=r?je(e):e;return at(t,n)}function at(t,e){if(!t.equals(e)){var r=t.v;Fe?ue.set(t,e):ue.set(t,r),t.v=e;var n=ie.ensure();n.capture(t,r),(t.f&R)!==0&&((t.f&K)!==0&&Zt(t),H(t,(t.f&q)===0?I:ce)),t.wv=Vr(),Or(t,K),m!==null&&(m.f&I)!==0&&(m.f&(fe|ge))===0&&(j===null?wi([t]):j.push(t))}return e}function Ze(t){P(t,t.v+1)}function Or(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i],o=s.f,l=(o&K)===0;l&&H(s,e),(o&R)!==0?Or(s,ce):l&&((o&Ie)!==0&&de!==null&&de.push(s),We(s))}}function je(t){if(typeof t!="object"||t===null||nt in t)return t;const e=Cn(t);if(e!==Sn&&e!==An)return t;var r=new Map,n=br(t),i=C(0),s=me,o=l=>{if(me===s)return l();var a=v,u=me;O(null),hr(s);var f=l();return O(a),hr(u),f};return n&&r.set("length",C(t.length)),new Proxy(t,{defineProperty(l,a,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&zn();var f=r.get(a);return f===void 0?f=o(()=>{var h=C(u.value);return r.set(a,h),h}):P(f,u.value,!0),!0},deleteProperty(l,a){var u=r.get(a);if(u===void 0){if(a in l){const f=o(()=>C(x));r.set(a,f),Ze(i)}}else P(u,x),Ze(i);return!0},get(l,a,u){if(a===nt)return t;var f=r.get(a),h=a in l;if(f===void 0&&(!h||Ue(l,a)?.writable)&&(f=o(()=>{var c=je(h?l[a]:x),d=C(c);return d}),r.set(a,f)),f!==void 0){var p=g(f);return p===x?void 0:p}return Reflect.get(l,a,u)},getOwnPropertyDescriptor(l,a){var u=Reflect.getOwnPropertyDescriptor(l,a);if(u&&"value"in u){var f=r.get(a);f&&(u.value=g(f))}else if(u===void 0){var h=r.get(a),p=h?.v;if(h!==void 0&&p!==x)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(l,a){if(a===nt)return!0;var u=r.get(a),f=u!==void 0&&u.v!==x||Reflect.has(l,a);if(u!==void 0||m!==null&&(!f||Ue(l,a)?.writable)){u===void 0&&(u=o(()=>{var p=f?je(l[a]):x,c=C(p);return c}),r.set(a,u));var h=g(u);if(h===x)return!1}return f},set(l,a,u,f){var h=r.get(a),p=a in l;if(n&&a==="length")for(var c=u;c<h.v;c+=1){var d=r.get(c+"");d!==void 0?P(d,x):c in l&&(d=o(()=>C(x)),r.set(c+"",d))}if(h===void 0)(!p||Ue(l,a)?.writable)&&(h=o(()=>C(void 0)),P(h,je(u)),r.set(a,h));else{p=h.v!==x;var w=o(()=>je(u));P(h,w)}var D=Reflect.getOwnPropertyDescriptor(l,a);if(D?.set&&D.set.call(f,u),!p){if(n&&typeof a=="string"){var J=r.get("length"),b=Number(a);Number.isInteger(b)&&b>=J.v&&P(J,b+1)}Ze(i)}return!0},ownKeys(l){g(i);var a=Reflect.ownKeys(l).filter(h=>{var p=r.get(h);return p===void 0||p.v!==x});for(var[u,f]of r)f.v!==x&&!(u in l)&&a.push(u);return a},setPrototypeOf(){Bn()}})}var ur,Dr,Fr,Rr;function oi(){if(ur===void 0){ur=window,Dr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Fr=Ue(e,"firstChild").get,Rr=Ue(e,"nextSibling").get,or(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),or(r)&&(r.__t=void 0)}}function ai(t=""){return document.createTextNode(t)}function Nr(t){return Fr.call(t)}function qt(t){return Rr.call(t)}function fr(t,e){return Nr(t)}function li(t,e=1,r=!1){let n=t;for(;e--;)n=qt(n);return n}function jr(t){var e=v,r=m;O(null),ne(null);try{return t()}finally{O(e),ne(r)}}function ui(t){m===null&&v===null&&Nn(),v!==null&&(v.f&q)!==0&&m===null&&Rn(),Fe&&Fn()}function fi(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function pe(t,e,r,n=!0){var i=m;i!==null&&(i.f&Ae)!==0&&(t|=Ae);var s={ctx:Y,deps:null,nodes_start:null,nodes_end:null,f:t|K,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{Se(s),s.f|=Rt}catch(a){throw te(s),a}else e!==null&&We(s);if(n){var o=s;if(r&&o.deps===null&&o.teardown===null&&o.nodes_start===null&&o.first===o.last&&(o.f&De)===0&&(o=o.first),o!==null&&(o.parent=i,i!==null&&fi(o,i),v!==null&&(v.f&R)!==0&&(t&ge)===0)){var l=v;(l.effects??=[]).push(o)}}return s}function ci(){return v!==null&&!G}function Q(t){ui();var e=m.f,r=!v&&(e&fe)!==0&&(e&Rt)===0;if(r){var n=Y;(n.e??=[]).push(t)}else return zr(t)}function zr(t){return pe(Dt|On,t,!1)}function pi(t){ie.ensure();const e=pe(ge|De,t,!0);return(r={})=>new Promise(n=>{r.outro?it(e,()=>{te(e),n(void 0)}):(te(e),n(void 0))})}function hi(t){return pe(Dt,t,!1)}function di(t){return pe(Nt|De,t,!0)}function Ht(t,e=0){return pe(Mr|e,t,!0)}function Br(t,e=[],r=[]){ti(e,r,n=>{pe(Mr,()=>t(...n.map(g)),!0)})}function vi(t,e=0){var r=pe(Ie|e,t,!0);return r}function he(t,e=!0){return pe(fe|De,t,!0,e)}function Ur(t){var e=t.teardown;if(e!==null){const r=Fe,n=v;pr(!0),O(null);try{e.call(null)}finally{pr(r),O(n)}}}function Zr(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&jr(()=>{i.abort(jt)});var n=r.next;(r.f&ge)!==0?r.parent=null:te(r,e),r=n}}function mi(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&fe)===0&&te(e),e=r}}function te(t,e=!0){var r=!1;(e||(t.f&In)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(yi(t.nodes_start,t.nodes_end),r=!0),Zr(t,e&&!r),lt(t,0),H(t,Oe);var n=t.transitions;if(n!==null)for(const s of n)s.stop();Ur(t);var i=t.parent;i!==null&&i.first!==null&&qr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function yi(t,e){for(;t!==null;){var r=t===e?null:qt(t);t.remove(),t=r}}function qr(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function it(t,e){var r=[];Hr(t,r,!0),gi(r,()=>{te(t),e&&e()})}function gi(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var i of t)i.out(n)}else e()}function Hr(t,e,r){if((t.f&Ae)===0){if(t.f^=Ae,t.transitions!==null)for(const o of t.transitions)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var i=n.next,s=(n.f&xr)!==0||(n.f&fe)!==0;Hr(n,e,s?r:!1),n=i}}}let Pe=!1;function cr(t){Pe=t}let Fe=!1;function pr(t){Fe=t}let v=null,G=!1;function O(t){v=t}let m=null;function ne(t){m=t}let se=null;function _i(t){v!==null&&(se===null?se=[t]:se.push(t))}let T=null,F=0,j=null;function wi(t){j=t}let Yr=1,Ge=0,me=Ge;function hr(t){me=t}let le=!1;function Vr(){return++Yr}function pt(t){var e=t.f;if((e&K)!==0)return!0;if((e&ce)!==0){var r=t.deps,n=(e&q)!==0;if(r!==null){var i,s,o=(e&ot)!==0,l=n&&m!==null&&!le,a=r.length;if((o||l)&&(m===null||(m.f&Oe)===0)){var u=t,f=u.parent;for(i=0;i<a;i++)s=r[i],(o||!s?.reactions?.includes(u))&&(s.reactions??=[]).push(u);o&&(u.f^=ot),l&&f!==null&&(f.f&q)===0&&(u.f^=q)}for(i=0;i<a;i++)if(s=r[i],pt(s)&&Ir(s),s.wv>t.wv)return!0}(!n||m!==null&&!le)&&H(t,I)}return!1}function Xr(t,e,r=!0){var n=t.reactions;if(n!==null&&!se?.includes(t))for(var i=0;i<n.length;i++){var s=n[i];(s.f&R)!==0?Xr(s,e,!1):e===s&&(r?H(s,K):(s.f&I)!==0&&H(s,ce),We(s))}}function Wr(t){var e=T,r=F,n=j,i=v,s=le,o=se,l=Y,a=G,u=me,f=t.f;T=null,F=0,j=null,le=(f&q)!==0&&(G||!Pe||v===null),v=(f&(fe|ge))===0?t:null,se=null,Ce(t.ctx),G=!1,me=++Ge,t.ac!==null&&(jr(()=>{t.ac.abort(jt)}),t.ac=null);try{t.f|=Pt;var h=t.fn,p=h(),c=t.deps;if(T!==null){var d;if(lt(t,F),c!==null&&F>0)for(c.length=F+T.length,d=0;d<T.length;d++)c[F+d]=T[d];else t.deps=c=T;if(!le||(f&R)!==0&&t.reactions!==null)for(d=F;d<c.length;d++)(c[d].reactions??=[]).push(t)}else c!==null&&F<c.length&&(lt(t,F),c.length=F);if(Sr()&&j!==null&&!G&&c!==null&&(t.f&(R|ce|K))===0)for(d=0;d<j.length;d++)Xr(j[d],t);return i!==null&&i!==t&&(Ge++,j!==null&&(n===null?n=j:n.push(...j))),(t.f&ve)!==0&&(t.f^=ve),p}catch(w){return Ar(w)}finally{t.f^=Pt,T=e,F=r,j=n,v=i,le=s,se=o,Ce(l),G=a,me=u}}function Ei(t,e){let r=e.reactions;if(r!==null){var n=xn.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(e.f&R)!==0&&(T===null||!T.includes(e))&&(H(e,ce),(e.f&(q|ot))===0&&(e.f^=ot),Lr(e),lt(e,0))}function lt(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Ei(t,r[n])}function Se(t){var e=t.f;if((e&Oe)===0){H(t,I);var r=m,n=Pe;m=t,Pe=!0;try{(e&Ie)!==0?mi(t):Zr(t),Ur(t);var i=Wr(t);t.teardown=typeof i=="function"?i:null,t.wv=Yr;var s;kr&&Yn&&(t.f&K)!==0&&t.deps}finally{Pe=n,m=r}}}function g(t){var e=t.f,r=(e&R)!==0;if(v!==null&&!G){var n=m!==null&&(m.f&Oe)!==0;if(!n&&!se?.includes(t)){var i=v.deps;if((v.f&Pt)!==0)t.rv<Ge&&(t.rv=Ge,T===null&&i!==null&&i[F]===t?F++:T===null?T=[t]:(!le||!T.includes(t))&&T.push(t));else{(v.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[v]:s.includes(v)||s.push(v)}}}else if(r&&t.deps===null&&t.effects===null){var o=t,l=o.parent;l!==null&&(l.f&q)===0&&(o.f^=q)}if(Fe){if(ue.has(t))return ue.get(t);if(r){o=t;var a=o.v;return((o.f&I)===0&&o.reactions!==null||Gr(o))&&(a=Zt(o)),ue.set(o,a),a}}else r&&(o=t,pt(o)&&Ir(o));if((t.f&ve)!==0)throw t.v;return t.v}function Gr(t){if(t.v===x)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(ue.has(e)||(e.f&R)!==0&&Gr(e))return!0;return!1}function Kr(t){var e=G;try{return G=!0,t()}finally{G=e}}const ki=-7169;function H(t,e){t.f=t.f&ki|e}const bi=["touchstart","touchmove"];function Mi(t){return bi.includes(t)}const xi=new Set,dr=new Set;let vr=null;function tt(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;vr=t;var o=0,l=vr===t&&t.__root;if(l){var a=i.indexOf(l);if(a!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;a<=u&&(o=a)}if(s=i[o]||t.target,s!==e){xt(t,"currentTarget",{configurable:!0,get(){return s||r}});var f=v,h=m;O(null),ne(null);try{for(var p,c=[];s!==null;){var d=s.assignedSlot||s.parentNode||s.host||null;try{var w=s["__"+n];if(w!=null&&(!s.disabled||t.target===s))if(br(w)){var[D,...J]=w;D.apply(s,[t,...J])}else w.call(s,t)}catch(b){p?c.push(b):p=b}if(t.cancelBubble||d===e||d===null)break;s=d}if(p){for(let b of c)queueMicrotask(()=>{throw b});throw p}}finally{t.__root=e,delete t.currentTarget,O(f),ne(h)}}}function Pi(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Si(t,e){var r=m;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function Jr(t,e){var r=(e&qn)!==0,n,i=!t.startsWith("<!>");return()=>{n===void 0&&(n=Pi(i?t:"<!>"+t),n=Nr(n));var s=r||Dr?document.importNode(n,!0):n.cloneNode(!0);return Si(s,s),s}}function Qr(t,e){t!==null&&t.before(e)}function Yt(t,e){return Ai(t,e)}const be=new Map;function Ai(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:o=!0}){oi();var l=new Set,a=h=>{for(var p=0;p<h.length;p++){var c=h[p];if(!l.has(c)){l.add(c);var d=Mi(c);e.addEventListener(c,tt,{passive:d});var w=be.get(c);w===void 0?(document.addEventListener(c,tt,{passive:d}),be.set(c,1)):be.set(c,w+1)}}};a(Pn(xi)),dr.add(a);var u=void 0,f=pi(()=>{var h=r??e.appendChild(ai());return Qn(h,{pending:()=>{}},p=>{if(s){zt({});var c=Y;c.c=s}i&&(n.$$events=i),u=t(p,n)||{},s&&Bt()}),()=>{for(var p of l){e.removeEventListener(p,tt);var c=be.get(p);--c===0?(document.removeEventListener(p,tt),be.delete(p)):be.set(p,c)}dr.delete(a),h!==r&&h.parentNode?.removeChild(h)}});return Ci.set(u,f),u}let Ci=new WeakMap;function $r(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=$r(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Ti(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=$r(t))&&(n&&(n+=" "),n+=e);return n}function en(t){return typeof t=="object"?Ti(t):t??""}function Li(t,e,r){var n=t==null?"":""+t;return e&&(n=n?n+" "+e:e),n===""?null:n}function mr(t,e=!1){var r=e?" !important;":";",n="";for(var i in t){var s=t[i];s!=null&&s!==""&&(n+=" "+i+": "+s+r)}return n}function Ii(t,e){if(e){var r="",n,i;return Array.isArray(e)?(n=e[0],i=e[1]):n=e,n&&(r+=mr(n)),i&&(r+=mr(i,!0)),r=r.trim(),r===""?null:r}return String(t)}function tn(t,e,r,n,i,s){var o=t.__className;if(o!==r||o===void 0){var l=Li(r,n);l==null?t.removeAttribute("class"):t.className=l,t.__className=r}return s}function kt(t,e={},r,n){for(var i in r){var s=r[i];e[i]!==s&&(r[i]==null?t.style.removeProperty(i):t.style.setProperty(i,s,n))}}function ze(t,e,r,n){var i=t.__style;if(i!==e){var s=Ii(e,n);s==null?t.removeAttribute("style"):t.style.cssText=s,t.__style=e}else n&&(Array.isArray(n)?(kt(t,r?.[0],n[0]),kt(t,r?.[1],n[1],"important")):kt(t,r,n));return n}const Oi=()=>performance.now(),$={tick:t=>requestAnimationFrame(t),now:()=>Oi(),tasks:new Set};function rn(){const t=$.now();$.tasks.forEach(e=>{e.c(t)||($.tasks.delete(e),e.f())}),$.tasks.size!==0&&$.tick(rn)}function Di(t){let e;return $.tasks.size===0&&$.tick(rn),{promise:new Promise(r=>{$.tasks.add(e={c:t,f:r})}),abort(){$.tasks.delete(e)}}}function yr(t,e){return t===e||t?.[nt]===e}function Be(t={},e,r,n){return hi(()=>{var i,s;return Ht(()=>{i=s,s=[],Kr(()=>{t!==r(...s)&&(e(t,...s),i&&yr(r(...i),t)&&e(null,...i))})}),()=>{ft(()=>{s&&yr(r(...s),t)&&e(null,...s)})}}),t}const Fi="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Fi);function Ri(t){return t}function Ct(t){return-.5*(Math.cos(Math.PI*t)-1)}function Ni(t){const e=Math.cos(t*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function ji(t){return Math.sin(t*Math.PI/2)}const zi=128,Bi=0,Ui=1,Zi=2;class qi{animationsStarted=!1;animationsCount=0;animationsLimit=zi;layers=new Array;start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const r=this.layers[e];if(r==null)continue;const n=r.animations;if(n!=null)for(let i=0;i<n.length;i++){const s=n[i];if(s!=null){for(const o of s.values())if(!o.executed&&(o.executed=!0,o.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,r,n,i){let s=this.layers[e];s==null&&(s=this.layers[e]={animations:new Array});let o=s.animations[r];o==null&&(o=s.animations[r]=new Map);let l={id:n,priority:r,executed:!1,function:i};o.set(n,l),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,r){for(let n=0;n<this.layers.length;n++){let i=this.layers[n];if(i==null)continue;let s=i.animations[e];if(s==null)return;let o=s.get(r);if(o==null||o.executed==!1)return;s.delete(r)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const ae=new qi;function gr(t){return Object.prototype.toString.call(t)==="[object Date]"}function Tt(t,e){if(t===e||t!==t)return()=>t;const r=typeof t;if(r!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map((i,s)=>Tt(t[s],i));return i=>n.map(s=>s(i))}if(r==="object"){if(!t||!e)throw new Error("Object cannot be null");if(gr(t)&&gr(e)){const s=t.getTime(),l=e.getTime()-s;return a=>new Date(s+a*l)}const n=Object.keys(e),i={};return n.forEach(s=>{i[s]=Tt(t[s],e[s])}),s=>{const o={};return n.forEach(l=>{o[l]=i[l](s)}),o}}if(r==="number"){const n=e-t;return i=>t+i*n}return()=>e}class Vt{#e;#t;#a;#n=null;constructor(e,r={}){this.#e=C(e),this.#t=C(e),this.#a=r}static of(e,r){const n=new Vt(e(),r);return Ht(()=>{n.set(e())}),n}set(e,r){P(this.#t,e);let{delay:n=0,duration:i=400,easing:s=Ri,interpolate:o=Tt}={...this.#a,...r};if(i===0)return this.#n?.abort(),P(this.#e,e),Promise.resolve();const l=$.now()+n;let a,u=!1,f=this.#n;return this.#n=Di(h=>{if(h<l)return!0;if(!u){u=!0;const c=this.#e.v;a=o(c,e),typeof i=="function"&&(i=i(c,e)),f?.abort()}const p=h-l;return p>i?(P(this.#e,e),!1):(P(this.#e,a(s(p/i))),!0)}),this.#n.promise}get current(){return g(this.#e)}get target(){return g(this.#t)}set target(e){this.set(e)}}class st{value;motion;constructor(e,r){this.value=e,this.motion=new Vt(e,r)}set(e,r){this.value=e,this.motion.set(e,r)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Hi=Jr("<div></div>");function Yi(t,e){zt(e,!0);let r=e.style.width,n=e.style.height,i=e.style.radius,s=e.colors?.background??"darkgreen",o=e.colors?.border??"white",l=e.colors?.shadow??"0px 2px 2px rgba(0, 0, 0, 0.5)",a;function u(){return a}let f=C(!1);function h(E){P(f,E,!0)}function p(){return g(f)}let c=C(!0),d=0,w=150;function D(E){E!=g(c)&&(P(c,E,!0),d=performance.now())}function J(){return performance.now()-d<w?V.motion.current==0:V.value==0}let b=0,V=new st(0,{easing:Ct});Q(()=>{g(f)==!1&&(V.snap(),ae.clear(e.priority,e.id))}),Q(()=>{V.set(g(c)?0:b,{duration:75})}),Q(()=>{Qe(V.motion.current)});function Qe(E){a&&ae.equeue(e.layer,e.priority,e.id,()=>{a.style.scale=E.toString(),a.style.filter=`brightness(${.25+.75*E})`})}function dt(E){E!=b&&(b=E,V.set(E,{duration:75}))}function vt(){return V.value}var mt={getBody:u,setDisplayed:h,getDisplayed:p,setCollapsed:D,getCollapsed:J,setScale:dt,getScale:vt},M=Hi();let $e;return Be(M,E=>a=E,()=>a),Br(E=>{tn(M,1,en(["pin",g(f)&&"displayed"]),"svelte-zz3jrb"),$e=ze(M,"",$e,E)},[()=>({width:`${r}px`,height:`${n}px`,"border-radius":`${i}px`,"border-color":o,"background-color":s,"box-shadow":l})]),Qr(t,M),Bt(mt)}class Je{provider;providerMarker;id;lat;lng;shown;element;component;constructor(e,r){if(new.target===Je)throw new Error("Cannot instantiate an abstract class directly.");this.provider=e,this.id=r.id,this.lat=r.lat,this.lng=r.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.setZIndex()}remove(){this.removeMarker()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.providerMarker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateMarker(e){if(this.providerMarker==null)throw new Error("Failed to update provider marker map");e?this.providerMarker.inserted()==!1&&this.providerMarker.insert():this.providerMarker.inserted()==!0&&this.providerMarker.remove()}removeMarker(){this.providerMarker?.remove()}setZIndex(){if(this.providerMarker==null)throw new Error("Failed to update provider marker z-index");this.providerMarker.update(this.getZindex())}getZindex(){throw new Error("Get z-index not implemented")}}var bt;function nn(t){return{lang:t?.lang??bt?.lang,message:t?.message,abortEarly:t?.abortEarly??bt?.abortEarly,abortPipeEarly:t?.abortPipeEarly??bt?.abortPipeEarly}}var Vi;function Xi(t){return Vi?.get(t)}var Wi;function Gi(t){return Wi?.get(t)}var Ki;function Ji(t,e){return Ki?.get(t)?.get(e)}function Ke(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function S(t,e,r,n,i){const s=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,l=i?.received??Ke(s),a={kind:t.kind,type:t.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},u=t.kind==="schema",f=i?.message??t.message??Ji(t.reference,a.lang)??(u?Gi(a.lang):null)??n.message??Xi(a.lang);f!==void 0&&(a.message=typeof f=="function"?f(a):f),u&&(r.typed=!1),r.issues?r.issues.push(a):r.issues=[a]}function N(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},nn())}}}var ht=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function z(t){return{kind:"transformation",type:"args",reference:z,async:!1,schema:t,"~run"(e,r){const n=e.value;return e.value=(...i)=>{const s=this.schema["~run"]({value:i},r);if(s.issues)throw new ht(s.issues);return n(...s.value)},e}}}function sn(){return{kind:"transformation",type:"await",reference:sn,async:!0,async"~run"(t){return t.value=await t.value,t}}}function on(t,e){return{kind:"validation",type:"check",reference:on,async:!1,expects:null,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement(r.value)&&S(this,"input",r,n),r}}}function an(t,e){return{kind:"validation",type:"length",reference:an,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length!==this.requirement&&S(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Le(t,e){return{kind:"validation",type:"max_value",reference:Le,async:!1,expects:`<=${t instanceof Date?t.toJSON():Ke(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value<=this.requirement)&&S(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():Ke(r.value)}),r}}}function Xt(t,e){return{kind:"validation",type:"min_length",reference:Xt,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&S(this,"length",r,n,{received:`${r.value.length}`}),r}}}function ee(t,e){return{kind:"validation",type:"min_value",reference:ee,async:!1,expects:`>=${t instanceof Date?t.toJSON():Ke(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value>=this.requirement)&&S(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():Ke(r.value)}),r}}}function W(t){return{kind:"transformation",type:"returns",reference:W,async:!1,schema:t,"~run"(e,r){const n=e.value;return e.value=(...i)=>{const s=this.schema["~run"]({value:n(...i)},r);if(s.issues)throw new ht(s.issues);return s.value},e}}}function ln(t){return{kind:"transformation",type:"returns",reference:ln,async:!1,schema:t,"~run"(e,r){const n=e.value;return e.value=async(...i)=>{const s=await this.schema["~run"]({value:await n(...i)},r);if(s.issues)throw new ht(s.issues);return s.value},e}}}function Qi(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function un(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function fn(t,e){return{kind:"schema",type:"array",reference:fn,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return N(this)},"~run"(r,n){const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){const o=i[s],l=this.item["~run"]({value:o},n);if(l.issues){const a={type:"array",origin:"value",input:i,key:s,value:o};for(const u of l.issues)u.path?u.path.unshift(a):u.path=[a],r.issues?.push(u);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else S(this,"type",r,n);return r}}}function cn(t){return{kind:"schema",type:"boolean",reference:cn,expects:"boolean",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:S(this,"type",e,r),e}}}function pn(t,e){return{kind:"schema",type:"custom",reference:pn,expects:"unknown",async:!1,check:t,message:e,get"~standard"(){return N(this)},"~run"(r,n){return this.check(r.value)?r.typed=!0:S(this,"type",r,n),r}}}function B(t){return{kind:"schema",type:"function",reference:B,expects:"Function",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return typeof e.value=="function"?e.typed=!0:S(this,"type",e,r),e}}}function k(t){return{kind:"schema",type:"number",reference:k,expects:"number",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:S(this,"type",e,r),e}}}function L(t,e){return{kind:"schema",type:"object",reference:L,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return N(this)},"~run"(r,n){const i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(const s in this.entries){const o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const l=s in i?i[s]:un(o),a=o["~run"]({value:l},n);if(a.issues){const u={type:"object",origin:"value",input:i,key:s,value:l};for(const f of a.issues)f.path?f.path.unshift(u):f.path=[u],r.issues?.push(f);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value[s]=a.value}else if(o.fallback!==void 0)r.value[s]=Qi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(S(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else S(this,"type",r,n);return r}}}function U(t,e){return{kind:"schema",type:"optional",reference:U,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return N(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=un(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function hn(t){return{kind:"schema",type:"promise",reference:hn,expects:"Promise",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return e.value instanceof Promise?e.typed=!0:S(this,"type",e,r),e}}}function re(t){return{kind:"schema",type:"string",reference:re,expects:"string",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:S(this,"type",e,r),e}}}function Z(t,e){return{kind:"schema",type:"tuple",reference:Z,expects:"Array",async:!1,items:t,message:e,get"~standard"(){return N(this)},"~run"(r,n){const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<this.items.length;s++){const o=i[s],l=this.items[s]["~run"]({value:o},n);if(l.issues){const a={type:"array",origin:"value",input:i,key:s,value:o};for(const u of l.issues)u.path?u.path.unshift(a):u.path=[a],r.issues?.push(u);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else S(this,"type",r,n);return r}}}function qe(t){return{kind:"schema",type:"void",reference:qe,expects:"void",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return e.value===void 0?e.typed=!0:S(this,"type",e,r),e}}}function rt(t,e,r){const n=t["~run"]({value:e},nn(r));if(n.issues)throw new ht(n.issues);return n.value}function _(...t){return{...t[0],pipe:t,get"~standard"(){return N(this)},"~run"(e,r){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function $i(...t){return{...t[0],pipe:t,async:!0,get"~standard"(){return N(this)},async"~run"(e,r){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=await n["~run"](e,r))}return e}}}const Lt=_(k(),ee(-90),Le(90)),It=_(k(),ee(-180),Le(180)),es=L({sw:L({lat:Lt,lng:It}),ne:L({lat:Lt,lng:It})}),Ot=pn(t=>t instanceof HTMLElement,"Must be an HTMLElement"),ts=L({mapSize:_(k(),ee(1)),zoomMin:_(k(),ee(0)),zoomMax:_(k(),ee(0)),zoomScale:_(k(),ee(1),Le(10))}),rs=L({inserted:_(B(),z(Z([])),W(cn())),insert:_(B(),z(Z([])),W(qe())),remove:_(B(),z(Z([])),W(qe())),update:_(B(),z(Z([k()])),W(qe()))}),ns=L({getParameters:_(B(),z(Z([])),W(ts)),getContainer:_(B(),z(Z([])),W(Ot)),getZoom:_(B(),z(Z([])),W(k())),getBounds:_(B(),z(Z([])),W(es)),panBy:_(B(),z(Z([k(),k()])),W(qe())),createMarker:_(B(),z(Z([Ot,Lt,It,k()])),W(rs))}),Mt=_(B(),z(Z([re()])),ln($i(hn(),sn(),Ot))),is=L({background:U(re()),border:U(re()),shadow:U(re())}),ss=L({width:k(),height:k(),radius:k()}),_r=L({background:U(re()),shadow:U(re())}),wr=_(L({width:k(),height:k(),margin:k(),radius:k()}),on(t=>Math.min(t.width,t.height)/t.margin>=6,"Minimum of width or height must be greater than or equal to 6 * margin")),os=L({id:_(re(),Xt(1)),rank:_(k(),ee(0)),lat:_(k(),ee(-90),Le(90)),lng:_(k(),ee(-180),Le(180)),tooltip:L({body:Mt,style:wr,colors:U(_r)}),pin:U(L({body:Mt,style:U(ss),colors:U(is)})),popup:U(L({body:Mt,style:wr,colors:U(_r)}))}),as=fn(os);class He extends Je{static DEFAULT_SIZE=16;style;colors;zoom;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,r,n){super(e,r),this.style=r.pin?.style??{width:He.DEFAULT_SIZE,height:He.DEFAULT_SIZE,radius:He.DEFAULT_SIZE},this.colors=r.pin?.colors,this.zoom=n,this.bodyCallback=r.pin?.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=Yt(Yi,{target:this.element,props:{id:this.id+"_pin",layer:Zi,priority:this.zoom*this.provider.getParameters().zoomScale,style:this.style,colors:this.colors}})}update(e){this.zoom=e[0],this.setZIndex()}updateMarker(e){super.updateMarker(e),this.component?.setDisplayed(e)}updateBody(){if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(r=>{r instanceof HTMLElement?e.appendChild(r):console.error("Failed to load pin body")}).catch(r=>console.error(r)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(e){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setCollapsed(e)}setScale(e){if(this.component==null)throw new Error("Failed to set pin scale");this.component.setScale(e)}getScaleFromZoomDistance(e){return this.zoom<e?1:Math.max(0,1-(this.zoom-e)*.125)}getZindex(){const e=this.provider.getParameters();return Math.round((e.zoomMax-this.zoom)*e.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}}var Ye;(t=>{function e(r,n,i){const s=r/2,o=n/2,l=Math.sqrt(s*s+o*o),a=Math.atan(o/s)*(180/Math.PI),u=i*(Math.PI/180);return i<180?i<90?i<a?{x:0,y:l*Math.sin(u)-o}:{x:l*Math.cos(u)-s,y:0}:i<180-a?{x:l*Math.cos(u)-s,y:0}:{x:-r,y:l*Math.sin(u)-o}:i<270?i<180+a?{x:-r,y:l*Math.sin(u)-o}:{x:l*Math.cos(u)-s,y:-n}:i<360-a?{x:l*Math.cos(u)-s,y:-n}:{x:0,y:l*Math.sin(u)-o}}t.getOffsets=e})(Ye||(Ye={}));var ls=Jr('<div><div class="pointer svelte-11extwn"></div> <div class="bubble svelte-11extwn"><div class="body svelte-11extwn"></div></div></div>');function dn(t,e){zt(e,!0);let r=e.style.width,n=e.style.height,i=e.style.margin,s=e.style.radius,o=e.colors?.background??"white",l=e.colors?.shadow??"0px 2px 2px rgba(0, 0, 0, 0.5)",a,u,f,h;const p=r+2*i,c=n+2*i,d=()=>h;Q(()=>{f.style.width=`${i*4}px`,f.style.height=`${i*4}px`});let w=C(!0);function D(y){P(w,y,!0)}function J(){return g(w)}let b=C(!0),V=0,Qe=300;function dt(y){y!=g(b)&&(P(b,y,!0),V=performance.now())}function vt(){return performance.now()-V<Qe?M.motion.current==0:M.value==0}function mt(){return performance.now()-V<Qe?M.motion.current==1:M.value==1}let M=new st(0);Q(()=>{g(w)==!1&&(M.snap(),ae.clear(e.priority,e.id+"_scale"))}),Q(()=>{g(b)==!0&&M.value!=0&&(ae.stacked()?M.set(0,{duration:0}):M.set(0,{duration:150,easing:Ni})),g(b)==!1&&M.value!=1&&M.set(1,{duration:150,easing:ji})}),Q(()=>{$e(M.motion.current)});function $e(y){!a||!u||!f||ae.equeue(g(b)?0:e.layer,e.priority,e.id+"_scale",()=>{a.style.opacity=`${y}`,u.style.scale=`${y}`,f.style.scale=`${y}`})}let E=NaN,yt=C(!1),oe=new st(-p/2,{easing:Ct}),et=new st(-c/2,{easing:Ct});Q(()=>{g(w)==!1&&(oe.snap(),oe.snap(),ae.clear(e.priority,e.id+"_angle"))}),Q(()=>{g(b)==!0&&g(yt)&&(oe.update({duration:75}),oe.update({duration:75}))}),Q(()=>{Qt(oe.motion.current,et.motion.current)});function Qt(y,_e){if(!a||!u||!f)return;const X=y+p/2,we=_e+c/2,Ee=c<p?X*c/p:X,ke=c>p?we*p/c:we,wn=Math.atan2(ke,Ee)/Math.PI*180-45,ir=0,En=30,wt=Math.sqrt(Ee*Ee+ke*ke),Ne=Math.min(p,c)/2,kn=Ne*Math.SQRT2,bn=(wt-Ne)/(kn-Ne),sr=ir+bn*(En-ir),Mn=wt<Ne?wt/Ne:1;ae.equeue(e.layer,e.priority,e.id+"_angle",()=>{u.style.transform=`translate(${Math.round(y)}px, ${Math.round(_e)}px)`,f.style.transform=`scale(${Mn}) rotate(${wn}deg) skew(${sr}deg, ${sr}deg)`})}function yn(y,_e){if(g(yt)==!1||_e==!0){let X=Ye.getOffsets(p,c,y);oe.set(Math.round(X.x),{duration:0}),et.set(Math.round(X.y),{duration:0}),Qt(oe.value,et.value),E=y,P(yt,!0)}else if(y!=E){let X=Math.abs(y-E),we=X<180?X:360-X,Ee=Math.log(we)*75,ke=Ye.getOffsets(p,c,y);oe.set(Math.round(ke.x),{duration:Ee}),et.set(Math.round(ke.y),{duration:Ee}),E=y}}function gn(){return Ye.getOffsets(p,c,E)}var _n={getBody:d,setDisplayed:D,getDisplayed:J,setCollapsed:dt,getCollapsed:vt,getExpanded:mt,setAngle:yn,getOffsets:gn},Re=ls();let $t;var gt=fr(Re);let er;Be(gt,y=>f=y,()=>f);var _t=li(gt,2);let tr;var rr=fr(_t);let nr;return Be(rr,y=>h=y,()=>h),Be(_t,y=>u=y,()=>u),Be(Re,y=>a=y,()=>a),Br((y,_e,X,we)=>{tn(Re,1,en(["anchor",g(w)&&"displayed"]),"svelte-11extwn"),$t=ze(Re,"",$t,y),er=ze(gt,"",er,_e),tr=ze(_t,"",tr,X),nr=ze(rr,"",nr,we)},[()=>({filter:`drop-shadow(${l})`}),()=>({"background-color":o}),()=>({margin:`${i}px;`}),()=>({width:`${r}px`,height:`${n}px`,"border-radius":`${s}px;`,"background-color":o})]),Qr(t,Re),Bt(_n)}class Wt extends Je{static Z_INDEX_OFFSET=2e6;style;colors;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,r){if(r.popup==null)throw new Error("Failed to create popup");super(e,r),this.shown=!1,this.style=r.popup.style,this.colors=r.popup.colors,this.bodyCallback=r.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=Yt(dn,{target:this.element,props:{id:this.id+"_popup",layer:Bi,priority:0,style:this.style,colors:this.colors}})}updateMarker(e){super.updateMarker(e),this.component?.setDisplayed(e)}updateBody(){if(this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(r=>{r instanceof HTMLElement?e.appendChild(r):console.error("Failed to load popup body")}).catch(r=>console.error(r)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Wt.Z_INDEX_OFFSET}setCollapsed(e){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(e)}setAngle(e){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(e,!0)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}}var ye;(t=>{t.COUNT=12,t.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],t.DEGREES_DEFAULT=270})(ye||(ye={}));class Gt extends Je{static Z_INDEX_OFFSET=1e6;style;colors;zoom;angle;states;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,r,n){super(e,r),this.style=r.tooltip.style,this.colors=r.tooltip.colors,this.zoom=n[0],this.angle=ye.DEGREES_DEFAULT,this.states=n[1].map(i=>[i[0],ye.DEGREES[i[1]]]),this.bodyCallback=r.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=Yt(dn,{target:this.element,props:{id:this.id+"_tooltip",layer:Ui,priority:this.zoom*this.provider.getParameters().zoomScale,style:this.style,colors:this.colors}})}update(e){this.zoom=e[0],this.states=e[1].map(r=>[r[0],ye.DEGREES[r[1]]]),this.setZIndex()}updateMarker(e){super.updateMarker(e),this.component?.setDisplayed(e)}updateState(e){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(e),this.component.setAngle(this.angle)}updateBody(){if(this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(r=>{r instanceof HTMLElement?e.appendChild(r):console.error("Failed to load tooltip body")}).catch(r=>console.error(r)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(e){const r=this.states.findLast(n=>n[0]<=e);if(!r)throw new Error("Angle not found");return r[1]}getZindex(){const e=this.provider.getParameters();return Math.round((e.zoomMax-this.zoom)*e.zoomScale)+Gt.Z_INDEX_OFFSET}setCollapsed(e){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(e)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}}class us{marker;zoom;pin;tooltip;popup;constructor(e,r,n){this.marker=r,this.zoom=n[0],this.pin=new He(e,r,n[0]),this.tooltip=new Gt(e,r,n),this.popup=r.popup?new Wt(e,r):void 0}create(){this.pin.create(),this.tooltip.create(),this.popup?.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove(),this.popup?.remove()}}var xe;(t=>{function e(l,a,u){return{x:n(a)*u,y:i(l)*u}}t.project=e;function r(l,a,u){return{lat:o(a/u),lng:s(l/u)}}t.unproject=r;function n(l){return(180+l)/360}function i(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function s(l){return l*360-180}function o(l){return 360/Math.PI*Math.atan(Math.exp((180-l*360)*Math.PI/180))-90}})(xe||(xe={}));class vn{swLat;swLng;neLat;neLng;constructor(e,r,n,i,s){const o=n*Math.pow(2,r),l=xe.project(e.sw.lat,e.sw.lng,o),a=xe.project(e.ne.lat,e.ne.lng,o),u=l.x-i,f=l.y+s,h=a.x+i,p=a.y-s,c=xe.unproject(u,f,o),d=xe.unproject(h,p,o);this.swLat=c.lat,this.swLng=c.lng,this.neLat=d.lat,this.neLng=d.lng}contains(e,r){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=r&&r<=this.neLng:r<=this.neLng||this.swLng<=r:!1}}class ut{static MAP_PINS_MAX_ZOOM=2;static MAP_PINS_MAX_COUNT=128;provider;pinElements=new Array;pinMaxWidth=0;pinMaxHeight=0;pinFade=!1;pinMaxCount=0;pinMaxZoomDelta=0;constructor(e){this.provider=e}setConfiguration(e){this.pinFade=e?.pin?.fade??!0,this.pinMaxCount=e?.pin?.maxCount??Math.max(ut.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=e?.pin?.maxZoom??ut.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((r,n)=>Math.max(r,n.style.width),0),this.pinMaxHeight=e.reduce((r,n)=>Math.max(r,n.style.height),0)}removeElements(){this.pinElements.forEach(e=>e.removeMarker()),this.pinElements.length=0}process(e,r){const n=this.provider.getParameters().mapSize,i=new vn(e,r,n,this.pinMaxWidth*2,this.pinMaxHeight*2);let s=0;for(const o of this.pinElements)i.contains(o.lat,o.lng)?o.shown&&r<o.zoom&&o.zoom<r+this.pinMaxZoomDelta?(s<this.pinMaxCount&&(o.setCollapsed(!1),o.setScale(this.pinFade?o.getScaleFromZoomDistance(r):1),o.updateMarker(!0),o.isBodyLoaded()==!1&&o.updateBody()),s++):(o.setCollapsed(!0),o.isCollapsed()&&o.updateMarker(!1)):o.updateMarker(!1)}}class fs{provider;tooltipElements=new Array;tooltipMaxWidth=0;tooltipMaxHeight=0;constructor(e){this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((r,n)=>Math.max(r,n.style.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((r,n)=>Math.max(r,n.style.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.removeMarker()),this.tooltipElements.length=0}process(e,r){const n=this.provider.getParameters().mapSize,i=new vn(e,r,n,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const s of this.tooltipElements)i.contains(s.lat,s.lng)?s.shown&&s.zoom<=r?(s.updateState(r),s.setCollapsed(!1),s.updateMarker(!0),s.isCollapsed()==!1&&s.isBodyLoaded()==!1&&s.updateBody()):(s.setCollapsed(!0),s.isCollapsed()&&s.updateMarker(!1)):s.updateMarker(!1)}}class cs{provider;popupElements=new Array;popupPositioned=new Map;constructor(e){this.provider=e}show(e){e.popup&&(e.pin.shown=!1,e.tooltip.shown=!1,this.popupPositioned.set(e.marker.id,!1),e.popup.setAngle(e.tooltip.angle),e.popup.shown=!0)}hide(e){e.popup&&(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}updateElements(e){this.popupElements=e,this.popupPositioned=new Map(e.map(r=>[r.id,!1]))}removeElements(){this.popupElements.forEach(e=>e.removeMarker()),this.popupElements.length=0,this.popupPositioned.clear()}process(){for(const e of this.popupElements)if(e.shown){if(e.setCollapsed(!1),e.updateMarker(!0),e.isExpanded()&&e.isBodyLoaded()==!1&&e.updateBody(),e.isCollapsed()==!1&&this.popupPositioned.get(e.id)==!1){const r=e.component?.getBody();if(r==null)continue;const n=e.component?.getOffsets();if(n==null)continue;const i=r.getBoundingClientRect();if(i.x==0&&i.y==0&&i.width==0&&i.height==0)continue;const s=i.x+i.width/2,o=i.y+i.height/2,l=s+n.x,a=o+n.y,u=l+e.style.width,f=a+e.style.height,h=this.provider.getContainer().getBoundingClientRect(),p=l-h.left,c=h.right-u,d=a-h.top,w=h.bottom-f,D=Math.min(e.style.width,e.style.height)/4,J=p<0?p-D:c<0?-c+D:0,b=d<0?d-D:w<0?-w+D:0;this.provider.panBy(J,b),this.popupPositioned.set(e.id,!0)}}else e.setCollapsed(!0),e.isCollapsed()&&e.updateMarker(!1)}}class ps{markerPinProcessor;markerTooltipProcessor;markerPopupProcessor;constructor(e){this.markerPinProcessor=new ut(e),this.markerTooltipProcessor=new fs(e),this.markerPopupProcessor=new cs(e)}setConfiguration(e){this.markerPinProcessor.setConfiguration(e)}updateElements(e){this.markerPinProcessor.updateElements(e.map(r=>r.pin)),this.markerTooltipProcessor.updateElements(e.map(r=>r.tooltip)),this.markerPopupProcessor.updateElements(e.map(r=>r.popup).filter(r=>r!=null))}removeElements(){this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.removeElements()}processElements(e,r){this.markerPinProcessor.process(e,r),this.markerTooltipProcessor.process(e,r),this.markerPopupProcessor.process()}showPopup(e){this.markerPopupProcessor.show(e)}hidePopup(e){this.markerPopupProcessor.hide(e)}}var Ve;(t=>{async function e(n,i){const s=await fetch(n,i);if(!s.ok)throw new Error(s.statusText);return s.json()}t.get=e;async function r(n,i,s){const o=await fetch(n,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json",...s?.headers},...s});if(!o.ok)throw new Error(o.statusText);return o.json()}t.post=r})(Ve||(Ve={}));const hs=_(re(),an(32)),ds=_(re(),Xt(1)),Er="1.2.1",Kt="https://maps.api.arenarium.dev",vs=`${Kt}/auth`,ms=`${Kt}/states`,ys=`${Kt}/log`;class Jt{apiKey;apiToken;apiDevEnvironment;mapProvider;mapMarkerProcessor;mapMarkerElementArray=new Array;mapMarkerElementMap=new Map;mapMarkerElementsUpdating=!1;constructor(e,r,n,i){rt(hs,e),rt(ds,r),rt(ns,n),this.apiKey=e,this.apiToken=r,this.apiDevEnvironment=window?.location.host.startsWith("localhost")||window?.location.host.startsWith("127.0.0.1"),this.mapProvider=n,this.mapMarkerProcessor=new ps(n),this.setConfiguration(i)}static async create(e,r,n){const i={key:e,version:Er};let o=(await Ve.post(vs,i)).token;if(!o)throw new Error("Failed to get api token");return new Jt(e,o,r,n)}setConfiguration(e){ae.setLimit(e?.animation?.queue?.limit??8*navigator.hardwareConcurrency),this.mapMarkerProcessor.setConfiguration(e)}async updateMarkers(e){rt(as,e);try{await this.updateMarkerElements(e),this.processMarkerElementsCallback()}catch(r){throw this.removeMarkerElements(),this.log("error","Failed to update markers",r),r}}removeMarkers(){try{this.removeMarkerElements()}catch(e){throw this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const r of this.mapMarkerElementArray)r.marker.id==e?this.mapMarkerProcessor.showPopup(r):this.mapMarkerProcessor.hidePopup(r)}catch(r){for(const n of this.mapMarkerElementArray)this.mapMarkerProcessor.hidePopup(n);throw this.log("error","Failed to show popup",r),r}}hidePopup(e){try{if(e){const r=this.mapMarkerElementMap.get(e);if(r==null)return;this.mapMarkerProcessor.hidePopup(r)}else for(const r of this.mapMarkerElementArray)this.mapMarkerProcessor.hidePopup(r)}catch(r){for(const n of this.mapMarkerElementArray)this.mapMarkerProcessor.hidePopup(n);throw this.log("error","Failed to hide popup",r),r}}async updateMarkerElements(e){try{let r=this.mapMarkerElementArray.map(i=>i.marker);for(let i=0;i<e.length;i++){const s=e[i];this.mapMarkerElementMap.get(s.id)||r.push(s)}const n=await this.getMarkerStates(r);try{this.mapMarkerElementsUpdating=!0;for(let i=0;i<r.length;i++){const s=r[i],o=n[i],l=this.mapMarkerElementMap.get(s.id);if(l)l.update(o);else{const a=new us(this.mapProvider,s,o);a.create(),this.mapMarkerElementMap.set(s.id,a),this.mapMarkerElementArray.push(a)}}this.mapMarkerElementArray.sort((i,s)=>i.zoom-s.zoom),this.mapMarkerProcessor.updateElements(this.mapMarkerElementArray)}finally{this.mapMarkerElementsUpdating=!1}}catch(r){throw this.mapMarkerProcessor.removeElements(),this.mapMarkerElementArray.length=0,this.mapMarkerElementMap.clear(),r}finally{this.mapMarkerElementsUpdating=!1}}removeMarkerElements(){try{this.mapMarkerElementsUpdating=!0,this.mapMarkerProcessor.removeElements(),this.mapMarkerElementArray.length=0,this.mapMarkerElementMap.clear()}finally{this.mapMarkerElementsUpdating=!1}}async getMarkerStates(e){if(e.length==0)return[];if(e.length==1)return[[0,[[0,ye.DEGREES.indexOf(ye.DEGREES_DEFAULT)]]]];const r=e.map(s=>({id:s.id,rank:s.rank,lat:s.lat,lng:s.lng,width:s.tooltip.style.width,height:s.tooltip.style.height,margin:s.tooltip.style.margin})),n={key:this.apiKey,token:this.apiToken,parameters:this.mapProvider.getParameters(),input:r},i=await Ve.post(ms,n,{headers:{"Cache-Control":this.apiDevEnvironment?"no-cache":""}});return i.token&&(this.apiToken=i.token),i.states}processMarkerElementsCallback(){if(this.mapProvider.getContainer().parentElement!=null&&this.mapMarkerElementArray.length!=0)try{this.processMarkerElements(),window.setTimeout(this.processMarkerElementsCallback.bind(this),25)}catch(e){this.log("error","Failed to process marker elements",e)}}processMarkerElements(){if(this.mapMarkerElementsUpdating)return;const e=this.mapProvider.getBounds(),r=this.mapProvider.getZoom();this.mapMarkerProcessor.processElements(e,r)}async log(e,r,n){switch(e){case"info":console.info(n);break;case"warn":console.warn(n);break;case"error":console.error(n);break}if(n instanceof Error&&!this.apiDevEnvironment)try{const i={key:this.apiKey,title:r,level:e,content:{version:Er,...n}};await Ve.post(ys,i)}catch(i){console.error(i)}}}const mn=()=>'<img src="https://arenarium.dev/favicon.svg" alt="Arenarium Maps" style="height: 1.25em; vertical-align: middle;" />',gs=()=>`<a href="https://arenarium.dev" target="_blank" style="color: inherit;">${mn()}<span>&nbsp;@arenarium/maps</span></a>`;exports.MapManager=Jt;exports.getAttributionHtml=gs;exports.getImageHtml=mn;