@maptiler/geocoding-control 0.0.36 → 0.0.38
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/README.md +6 -2
- package/dist/leaflet.js +2076 -690
- package/dist/leaflet.umd.js +22 -0
- package/dist/lib/LeafletGeocodingControl.d.ts +5 -1
- package/dist/lib/MaplibreglGeocodingControl.d.ts +9 -2
- package/dist/lib/leafletMapController.d.ts +1 -1
- package/dist/lib/maplibreglMapController.d.ts +5 -2
- package/dist/lib/types.d.ts +20 -2
- package/dist/maplibregl.js +801 -774
- package/dist/maplibregl.umd.js +22 -0
- package/package.json +4 -4
- package/src/lib/GeocodingControl.svelte +31 -13
- package/src/lib/LeafletGeocodingControl.ts +22 -4
- package/src/lib/MaplibreglGeocodingControl.ts +29 -6
- package/src/lib/ReverseGeocodingIcon.svelte +12 -0
- package/src/lib/leafletMapController.ts +119 -20
- package/src/lib/maplibreglMapController.ts +66 -57
- package/src/lib/types.ts +23 -2
- package/dist/leaflet.umd.cjs +0 -1
- package/dist/lib/maplibreMapController.d.ts +0 -4
- package/dist/maplibregl.umd.cjs +0 -22
- package/src/lib/BullseyeIcon.svelte +0 -12
|
@@ -7,6 +7,8 @@ import type {
|
|
|
7
7
|
Marker,
|
|
8
8
|
FlyToOptions,
|
|
9
9
|
GeoJSONSource,
|
|
10
|
+
FillLayerSpecification,
|
|
11
|
+
LineLayerSpecification,
|
|
10
12
|
} from "maplibre-gl";
|
|
11
13
|
import MarkerIcon from "./MarkerIcon.svelte";
|
|
12
14
|
import type { Feature, MapController, Proximity } from "./types";
|
|
@@ -30,7 +32,29 @@ export function createMaplibreglMapController(
|
|
|
30
32
|
marker: boolean | maplibregl.MarkerOptions = true,
|
|
31
33
|
showResultMarkers: boolean | maplibregl.MarkerOptions = true,
|
|
32
34
|
flyToOptions: FlyToOptions = {},
|
|
33
|
-
fitBoundsOptions: FitBoundsOptions = {}
|
|
35
|
+
fitBoundsOptions: FitBoundsOptions = {},
|
|
36
|
+
fullGeometryStyle: {
|
|
37
|
+
fill: Pick<FillLayerSpecification, "layout" | "paint" | "filter">;
|
|
38
|
+
line: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
|
|
39
|
+
} = {
|
|
40
|
+
fill: {
|
|
41
|
+
layout: {},
|
|
42
|
+
paint: {
|
|
43
|
+
"fill-color": "#000",
|
|
44
|
+
"fill-opacity": 0.1,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
line: {
|
|
48
|
+
layout: {
|
|
49
|
+
"line-cap": "square",
|
|
50
|
+
},
|
|
51
|
+
paint: {
|
|
52
|
+
"line-width": ["case", ["==", ["geometry-type"], "Polygon"], 2, 3],
|
|
53
|
+
"line-dasharray": [1, 1],
|
|
54
|
+
"line-color": "#3170fe",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
}
|
|
34
58
|
) {
|
|
35
59
|
let proximityChangeHandler: ((proximity: Proximity) => void) | undefined;
|
|
36
60
|
|
|
@@ -42,44 +66,33 @@ export function createMaplibreglMapController(
|
|
|
42
66
|
|
|
43
67
|
let selectedMarker: maplibregl.Marker | undefined;
|
|
44
68
|
|
|
45
|
-
function
|
|
46
|
-
map.addSource("
|
|
69
|
+
function addFullGeometryLayer() {
|
|
70
|
+
map.addSource("full-geom", {
|
|
47
71
|
type: "geojson",
|
|
48
72
|
data: emptyGeojson,
|
|
49
73
|
});
|
|
50
74
|
|
|
51
75
|
map.addLayer({
|
|
52
|
-
|
|
76
|
+
...fullGeometryStyle.fill,
|
|
77
|
+
id: "full-geom-fill",
|
|
53
78
|
type: "fill",
|
|
54
|
-
source: "
|
|
55
|
-
layout: {},
|
|
56
|
-
paint: {
|
|
57
|
-
"fill-color": "#000",
|
|
58
|
-
"fill-opacity": 0.1,
|
|
59
|
-
},
|
|
79
|
+
source: "full-geom",
|
|
60
80
|
filter: ["==", ["geometry-type"], "Polygon"],
|
|
61
81
|
});
|
|
62
82
|
|
|
63
83
|
map.addLayer({
|
|
64
|
-
|
|
84
|
+
...fullGeometryStyle.line,
|
|
85
|
+
id: "full-geom-line",
|
|
65
86
|
type: "line",
|
|
66
|
-
source: "
|
|
67
|
-
layout: {
|
|
68
|
-
"line-cap": "square",
|
|
69
|
-
},
|
|
70
|
-
paint: {
|
|
71
|
-
"line-width": ["case", ["==", ["geometry-type"], "Polygon"], 2, 3],
|
|
72
|
-
"line-dasharray": [1, 1],
|
|
73
|
-
"line-color": "#3170fe",
|
|
74
|
-
},
|
|
87
|
+
source: "full-geom",
|
|
75
88
|
});
|
|
76
89
|
}
|
|
77
90
|
|
|
78
91
|
if (map.loaded()) {
|
|
79
|
-
|
|
92
|
+
addFullGeometryLayer();
|
|
80
93
|
} else {
|
|
81
94
|
map.once("load", () => {
|
|
82
|
-
|
|
95
|
+
addFullGeometryLayer();
|
|
83
96
|
});
|
|
84
97
|
}
|
|
85
98
|
|
|
@@ -156,21 +169,32 @@ export function createMaplibreglMapController(
|
|
|
156
169
|
picked: Feature | undefined
|
|
157
170
|
): void {
|
|
158
171
|
function setData(data: GeoJSON.GeoJSON) {
|
|
159
|
-
(map.getSource("
|
|
172
|
+
(map.getSource("full-geom") as GeoJSONSource)?.setData(data);
|
|
160
173
|
}
|
|
161
174
|
|
|
162
175
|
for (const marker of markers) {
|
|
163
176
|
marker.remove();
|
|
164
177
|
}
|
|
165
178
|
|
|
166
|
-
setData(emptyGeojson);
|
|
167
|
-
|
|
168
179
|
markers.length = 0;
|
|
169
180
|
|
|
181
|
+
setData(emptyGeojson);
|
|
182
|
+
|
|
170
183
|
if (!maplibregl) {
|
|
171
184
|
return;
|
|
172
185
|
}
|
|
173
186
|
|
|
187
|
+
const createMarker = () => {
|
|
188
|
+
const element = document.createElement("div");
|
|
189
|
+
|
|
190
|
+
new MarkerIcon({
|
|
191
|
+
props: { displayIn: "maplibre" },
|
|
192
|
+
target: element,
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
return new maplibregl.Marker({ element });
|
|
196
|
+
};
|
|
197
|
+
|
|
174
198
|
if (picked) {
|
|
175
199
|
let handled = false;
|
|
176
200
|
|
|
@@ -210,8 +234,6 @@ export function createMaplibreglMapController(
|
|
|
210
234
|
}
|
|
211
235
|
}
|
|
212
236
|
|
|
213
|
-
let m: Marker | undefined = undefined;
|
|
214
|
-
|
|
215
237
|
if (handled) {
|
|
216
238
|
// nothing
|
|
217
239
|
} else if (
|
|
@@ -225,25 +247,17 @@ export function createMaplibreglMapController(
|
|
|
225
247
|
) {
|
|
226
248
|
setData(picked as any);
|
|
227
249
|
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (typeof marker === "object") {
|
|
232
|
-
m = new maplibregl.Marker(marker);
|
|
233
|
-
} else {
|
|
234
|
-
const element = document.createElement("div");
|
|
235
|
-
|
|
236
|
-
new MarkerIcon({
|
|
237
|
-
props: { displayIn: "maplibre" },
|
|
238
|
-
target: element,
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
m = new maplibregl.Marker({ element });
|
|
250
|
+
return; // no pin for (multi)linestrings
|
|
242
251
|
}
|
|
243
252
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
253
|
+
markers.push(
|
|
254
|
+
(typeof marker === "object"
|
|
255
|
+
? new maplibregl.Marker(marker)
|
|
256
|
+
: createMarker()
|
|
257
|
+
)
|
|
258
|
+
.setLngLat(picked.center)
|
|
259
|
+
.addTo(map)
|
|
260
|
+
);
|
|
247
261
|
}
|
|
248
262
|
|
|
249
263
|
for (const feature of markedFeatures ?? []) {
|
|
@@ -251,19 +265,14 @@ export function createMaplibreglMapController(
|
|
|
251
265
|
continue;
|
|
252
266
|
}
|
|
253
267
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
m = new maplibregl.Marker({ element });
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
markers.push(m.setLngLat(feature.center).addTo(map));
|
|
268
|
+
markers.push(
|
|
269
|
+
(typeof showResultMarkers === "object"
|
|
270
|
+
? new maplibregl.Marker(showResultMarkers)
|
|
271
|
+
: createMarker()
|
|
272
|
+
)
|
|
273
|
+
.setLngLat(feature.center)
|
|
274
|
+
.addTo(map)
|
|
275
|
+
);
|
|
267
276
|
}
|
|
268
277
|
},
|
|
269
278
|
|
package/src/lib/types.ts
CHANGED
|
@@ -179,11 +179,25 @@ export type ControlOptions = {
|
|
|
179
179
|
class?: string;
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
* Set to `true` to enable reverse geocoding button with title
|
|
182
|
+
* Set to `true` to enable reverse geocoding button with title. Set to `"always"` to reverse geocoding be always active.
|
|
183
183
|
*
|
|
184
184
|
* @default false
|
|
185
185
|
*/
|
|
186
|
-
enableReverse?: boolean |
|
|
186
|
+
enableReverse?: boolean | "always";
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Reverse toggle button title.
|
|
190
|
+
*
|
|
191
|
+
* @default "toggle reverse geocoding"
|
|
192
|
+
*/
|
|
193
|
+
reverseButtonTitle?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Clear button title.
|
|
197
|
+
*
|
|
198
|
+
* @default "clear"
|
|
199
|
+
*/
|
|
200
|
+
clearButtonTitle?: string;
|
|
187
201
|
|
|
188
202
|
/**
|
|
189
203
|
* Set to `true` to show place type.
|
|
@@ -192,6 +206,13 @@ export type ControlOptions = {
|
|
|
192
206
|
*/
|
|
193
207
|
showPlaceType?: boolean;
|
|
194
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Set to `true` to show full feature geometry of the chosen result. Otherwise only marker will be shown.
|
|
211
|
+
*
|
|
212
|
+
* @default true
|
|
213
|
+
*/
|
|
214
|
+
showFullGeometry?: boolean;
|
|
215
|
+
|
|
195
216
|
// TODO - missing but useful from maplibre-gl-geocoder
|
|
196
217
|
// popup // If true, a Popup will be added to the map when clicking on a marker using a default set of popup options. If the value is an object, the popup will be constructed using these options. If false, no popup will be added to the map. Requires that options.maplibregl also be set. (optional, default true)
|
|
197
218
|
// render // A function that specifies how the results should be rendered in the dropdown menu. This function should accepts a single Carmen GeoJSON object as input and return a string. Any HTML in the returned string will be rendered.
|
package/dist/leaflet.umd.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var ft=(C,R,W)=>{if(!R.has(C))throw TypeError("Cannot "+W)};var F=(C,R,W)=>(ft(C,R,"read from private field"),W?W.call(C):R.get(C)),Ke=(C,R,W)=>{if(R.has(C))throw TypeError("Cannot add the same private member more than once");R instanceof WeakSet?R.add(C):R.set(C,W)},je=(C,R,W,J)=>(ft(C,R,"write to private field"),J?J.call(C,W):R.set(C,W),W);(function(C,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],R):(C=typeof globalThis<"u"?globalThis:C||self,R(C.leafletMaptilerGeocoder={},C.leaflet))})(this,function(C,R){var Z,fe;"use strict";function W(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,l.get?l:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const J=W(R);function k(){}function ut(t,e){for(const n in e)t[n]=e[n];return t}function Qe(t){return t()}function Ve(){return Object.create(null)}function te(t){t.forEach(Qe)}function Ue(t){return typeof t=="function"}function he(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function at(t){return Object.keys(t).length===0}function dt(t,e,n,l){if(t){const r=We(t,e,n,l);return t[0](r)}}function We(t,e,n,l){return t[1]&&l?ut(n.ctx.slice(),t[1](l(e))):n.ctx}function ht(t,e,n,l){if(t[2]&&l){const r=t[2](l(n));if(e.dirty===void 0)return r;if(typeof r=="object"){const c=[],s=Math.max(e.dirty.length,r.length);for(let i=0;i<s;i+=1)c[i]=e.dirty[i]|r[i];return c}return e.dirty|r}return e.dirty}function _t(t,e,n,l,r,c){if(r){const s=We(e,n,l,c);t.p(s,r)}}function mt(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let l=0;l<n;l++)e[l]=-1;return e}return-1}function Ze(t){return t==null?"":t}function y(t,e){t.appendChild(e)}function Q(t,e,n){t.insertBefore(e,n||null)}function q(t){t.parentNode.removeChild(t)}function gt(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function P(t){return document.createElement(t)}function ne(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ie(t){return document.createTextNode(t)}function X(){return ie(" ")}function V(t,e,n,l){return t.addEventListener(e,n,l),()=>t.removeEventListener(e,n,l)}function yt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function f(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function bt(t){return Array.from(t.childNodes)}function ve(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function xe(t,e){t.value=e==null?"":e}function D(t,e,n){t.classList[n?"add":"remove"](e)}function pt(t,e,{bubbles:n=!1,cancelable:l=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,l,e),r}let ke;function Me(t){ke=t}function Je(){if(!ke)throw new Error("Function called outside component initialization");return ke}function wt(t){Je().$$.on_destroy.push(t)}function vt(){const t=Je();return(e,n,{cancelable:l=!1}={})=>{const r=t.$$.callbacks[e];if(r){const c=pt(e,n,{cancelable:l});return r.slice().forEach(s=>{s.call(t,c)}),!c.defaultPrevented}return!0}}const Ce=[],Oe=[],Le=[],Xe=[],kt=Promise.resolve();let Be=!1;function Mt(){Be||(Be=!0,kt.then(Ye))}function Ae(t){Le.push(t)}const De=new Set;let Ee=0;function Ye(){const t=ke;do{for(;Ee<Ce.length;){const e=Ce[Ee];Ee++,Me(e),Ct(e.$$)}for(Me(null),Ce.length=0,Ee=0;Oe.length;)Oe.pop()();for(let e=0;e<Le.length;e+=1){const n=Le[e];De.has(n)||(De.add(n),n())}Le.length=0}while(Ce.length);for(;Xe.length;)Xe.pop()();Be=!1,De.clear(),Me(t)}function Ct(t){if(t.fragment!==null){t.update(),te(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Ae)}}const Se=new Set;let ce;function Re(){ce={r:0,c:[],p:ce}}function Pe(){ce.r||te(ce.c),ce=ce.p}function I(t,e){t&&t.i&&(Se.delete(t),t.i(e))}function G(t,e,n,l){if(t&&t.o){if(Se.has(t))return;Se.add(t),ce.c.push(()=>{Se.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function Te(t){t&&t.c()}function _e(t,e,n,l){const{fragment:r,after_update:c}=t.$$;r&&r.m(e,n),l||Ae(()=>{const s=t.$$.on_mount.map(Qe).filter(Ue);t.$$.on_destroy?t.$$.on_destroy.push(...s):te(s),t.$$.on_mount=[]}),c.forEach(Ae)}function me(t,e){const n=t.$$;n.fragment!==null&&(te(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Tt(t,e){t.$$.dirty[0]===-1&&(Ce.push(t),Mt(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ge(t,e,n,l,r,c,s,i=[-1]){const u=ke;Me(t);const a=t.$$={fragment:null,ctx:[],props:c,update:k,not_equal:r,bound:Ve(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:Ve(),dirty:i,skip_bound:!1,root:e.target||u.$$.root};s&&s(a.root);let h=!1;if(a.ctx=n?n(t,e.props||{},(p,H,...d)=>{const g=d.length?d[0]:H;return a.ctx&&r(a.ctx[p],a.ctx[p]=g)&&(!a.skip_bound&&a.bound[p]&&a.bound[p](g),h&&Tt(t,p)),H}):[],a.update(),h=!0,te(a.before_update),a.fragment=l?l(a.ctx):!1,e.target){if(e.hydrate){const p=bt(e.target);a.fragment&&a.fragment.l(p),p.forEach(q)}else a.fragment&&a.fragment.c();e.intro&&I(t.$$.fragment),_e(t,e.target,e.anchor,e.customElement),Ye()}Me(u)}class ye{$destroy(){me(this,1),this.$destroy=k}$on(e,n){if(!Ue(n))return k;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const r=l.indexOf(n);r!==-1&&l.splice(r,1)}}$set(e){this.$$set&&!at(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const on="";function zt(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M500 115.1c212.2 0 384.9 172.6 384.9 384.9 0 212.2-172.7 384.9-384.9 384.9S115.1 712.2 115.1 500c0-212.4 172.5-384.9 384.9-384.9M500 10C229.4 10 10 229.4 10 500s219.4 490 490 490 490-219.4 490-490c-.2-270.6-219.5-490-490-490zm0 315c96.5 0 175 78.4 175 175 0 96.5-78.4 175-175 175-96.5 0-175-78.4-175-175 0-96.5 78.4-175 175-175m0-105c-154.7 0-279.9 125.4-279.9 279.9 0 154.7 125.4 279.9 279.9 279.9 154.5 0 279.9-125.4 279.9-279.9C779.9 345.3 654.5 220 500 220zm70 280c0 38.7-31.3 70-70 70s-70-31.3-70-70 31.3-70 70-70 70 31.3 70 70z"),f(e,"viewBox","0 0 1000 1000"),f(e,"width","18px"),f(e,"height","18px"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:k,i:k,o:k,d(l){l&&q(e)}}}class Lt extends ye{constructor(e){super(),ge(this,e,null,zt,he,{})}}const sn="";function Et(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),f(e,"viewBox","0 0 18 18"),f(e,"width","16"),f(e,"height","16"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:k,i:k,o:k,d(l){l&&q(e)}}}class St extends ye{constructor(e){super(),ge(this,e,null,Et,he,{})}}const cn="";function Rt(t){let e;return{c(){e=P("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',f(e,"class","svelte-7cmwmc")},m(n,l){Q(n,e,l)},p:k,i:k,o:k,d(n){n&&q(e)}}}class Pt extends ye{constructor(e){super(),ge(this,e,null,Rt,he,{})}}const fn="";function It(t){let e,n,l;return{c(){e=ne("svg"),n=ne("path"),f(n,"stroke-width","4"),f(n,"fill-rule","evenodd"),f(n,"clip-rule","evenodd"),f(n,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),f(n,"class","svelte-656hh2"),f(e,"width",l=t[0]!=="list"?void 0:"20"),f(e,"viewBox","0 0 70 85"),f(e,"fill","none"),f(e,"class","svelte-656hh2"),D(e,"in-map",t[0]!=="list"),D(e,"for-maplibre",t[0]==="maplibre"),D(e,"for-leaflet",t[0]==="leaflet"),D(e,"list-icon",t[0]==="list")},m(r,c){Q(r,e,c),y(e,n)},p(r,[c]){c&1&&l!==(l=r[0]!=="list"?void 0:"20")&&f(e,"width",l),c&1&&D(e,"in-map",r[0]!=="list"),c&1&&D(e,"for-maplibre",r[0]==="maplibre"),c&1&&D(e,"for-leaflet",r[0]==="leaflet"),c&1&&D(e,"list-icon",r[0]==="list")},i:k,o:k,d(r){r&&q(e)}}}function jt(t,e,n){let{displayIn:l}=e;return t.$$set=r=>{"displayIn"in r&&n(0,l=r.displayIn)},[l]}class Fe extends ye{constructor(e){super(),ge(this,e,jt,It,he,{displayIn:0})}}const un="";function Ot(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),f(e,"viewBox","0 0 18 18"),f(e,"xml:space","preserve"),f(e,"width","20"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:k,i:k,o:k,d(l){l&&q(e)}}}class Bt extends ye{constructor(e){super(),ge(this,e,null,Ot,he,{})}}const an="";function $e(t,e,n){const l=t.slice();return l[59]=e[n],l[61]=n,l}function et(t){let e,n;return e=new Pt({}),{c(){Te(e.$$.fragment)},m(l,r){_e(e,l,r),n=!0},i(l){n||(I(e.$$.fragment,l),n=!0)},o(l){G(e.$$.fragment,l),n=!1},d(l){me(e,l)}}}function tt(t){let e,n,l,r,c,s;return n=new Lt({}),{c(){e=P("button"),Te(n.$$.fragment),f(e,"type","button"),f(e,"title",l=t[7]===!0?"toggle reverse geocoding":t[7]),f(e,"class","svelte-1h1zm6d"),D(e,"active",t[1])},m(i,u){Q(i,e,u),_e(n,e,null),r=!0,c||(s=V(e,"click",t[47]),c=!0)},p(i,u){(!r||u[0]&128&&l!==(l=i[7]===!0?"toggle reverse geocoding":i[7]))&&f(e,"title",l),(!r||u[0]&2)&&D(e,"active",i[1])},i(i){r||(I(n.$$.fragment,i),r=!0)},o(i){G(n.$$.fragment,i),r=!1},d(i){i&&q(e),me(n),c=!1,s()}}}function At(t){let e,n,l,r,c=t[10],s=[];for(let u=0;u<c.length;u+=1)s[u]=lt($e(t,c,u));const i=u=>G(s[u],1,1,()=>{s[u]=null});return{c(){e=P("ul");for(let u=0;u<s.length;u+=1)s[u].c();f(e,"class","svelte-1h1zm6d")},m(u,a){Q(u,e,a);for(let h=0;h<s.length;h+=1)s[h].m(e,null);n=!0,l||(r=[V(e,"mouseout",t[50]),V(e,"blur",t[51])],l=!0)},p(u,a){if(a[0]&7425){c=u[10];let h;for(h=0;h<c.length;h+=1){const p=$e(u,c,h);s[h]?(s[h].p(p,a),I(s[h],1)):(s[h]=lt(p),s[h].c(),I(s[h],1),s[h].m(e,null))}for(Re(),h=c.length;h<s.length;h+=1)i(h);Pe()}},i(u){if(!n){for(let a=0;a<c.length;a+=1)I(s[a]);n=!0}},o(u){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)G(s[a]);n=!1},d(u){u&&q(e),gt(s,u),l=!1,te(r)}}}function Dt(t){let e,n;return{c(){e=P("div"),n=ie(t[5]),f(e,"class","no-results svelte-1h1zm6d")},m(l,r){Q(l,e,r),y(e,n)},p(l,r){r[0]&32&&ve(n,l[5])},i:k,o:k,d(l){l&&q(e)}}}function Nt(t){let e,n;return{c(){e=P("div"),n=ie(t[4]),f(e,"class","error svelte-1h1zm6d")},m(l,r){Q(l,e,r),y(e,n)},p(l,r){r[0]&16&&ve(n,l[4])},i:k,o:k,d(l){l&&q(e)}}}function qt(t){let e="",n;return{c(){n=ie(e)},m(l,r){Q(l,n,r)},p:k,i:k,o:k,d(l){l&&q(n)}}}function nt(t){let e,n=t[59].place_type+"",l;return{c(){e=P("span"),l=ie(n),f(e,"class","svelte-1h1zm6d")},m(r,c){Q(r,e,c),y(e,l)},p(r,c){c[0]&1024&&n!==(n=r[59].place_type+"")&&ve(l,n)},d(r){r&&q(e)}}}function lt(t){let e,n,l,r,c,s,i=t[59].place_name.replace(/,.*/,"")+"",u,a,h,p,H,d=t[59].place_name.replace(/[^,]*,?\s*/,"")+"",g,m,b,T,z,x;n=new Fe({props:{displayIn:"list"}});let L=t[8]&&nt(t);function E(){return t[48](t[61])}function w(){return t[49](t[59])}return{c(){e=P("li"),Te(n.$$.fragment),l=X(),r=P("span"),c=P("span"),s=P("span"),u=ie(i),a=X(),L&&L.c(),h=X(),p=P("span"),H=P("span"),g=ie(d),m=X(),f(s,"class","svelte-1h1zm6d"),f(c,"class","svelte-1h1zm6d"),f(r,"class","svelte-1h1zm6d"),f(H,"class","svelte-1h1zm6d"),f(p,"class","svelte-1h1zm6d"),f(e,"tabindex","0"),f(e,"data-selected",b=t[12]===t[61]),f(e,"class","svelte-1h1zm6d"),D(e,"selected",t[12]===t[61])},m(N,M){Q(N,e,M),_e(n,e,null),y(e,l),y(e,r),y(r,c),y(c,s),y(s,u),y(c,a),L&&L.m(c,null),y(e,h),y(e,p),y(p,H),y(H,g),y(e,m),T=!0,z||(x=[V(e,"mouseover",E),V(e,"focus",w)],z=!0)},p(N,M){t=N,(!T||M[0]&1024)&&i!==(i=t[59].place_name.replace(/,.*/,"")+"")&&ve(u,i),t[8]?L?L.p(t,M):(L=nt(t),L.c(),L.m(c,null)):L&&(L.d(1),L=null),(!T||M[0]&1024)&&d!==(d=t[59].place_name.replace(/[^,]*,?\s*/,"")+"")&&ve(g,d),(!T||M[0]&4096&&b!==(b=t[12]===t[61]))&&f(e,"data-selected",b),(!T||M[0]&4096)&&D(e,"selected",t[12]===t[61])},i(N){T||(I(n.$$.fragment,N),T=!0)},o(N){G(n.$$.fragment,N),T=!1},d(N){N&&q(e),me(n),L&&L.d(),z=!1,te(x)}}}function Gt(t){let e,n,l,r,c,s,i,u,a,h,p,H,d,g,m,b,T,z,x,L;r=new Bt({}),h=new St({});let E=t[16]&&et(),w=t[7]&&tt(t);const N=t[39].default,M=dt(N,t,t[38],null),j=[qt,Nt,Dt,At],A=[];function ze(_,O){var $,ee;return _[13]?_[15]?1:(($=_[10])==null?void 0:$.length)===0?2:_[13]&&((ee=_[10])==null?void 0:ee.length)?3:-1:0}return~(m=ze(t))&&(b=A[m]=j[m](t)),{c(){e=P("form"),n=P("div"),l=P("button"),Te(r.$$.fragment),c=X(),s=P("input"),i=X(),u=P("div"),a=P("button"),Te(h.$$.fragment),p=X(),E&&E.c(),H=X(),w&&w.c(),d=X(),M&&M.c(),g=X(),b&&b.c(),f(l,"type","button"),f(l,"class","svelte-1h1zm6d"),f(s,"placeholder",t[3]),f(s,"aria-label",t[3]),f(s,"class","svelte-1h1zm6d"),f(a,"type","button"),f(a,"class","svelte-1h1zm6d"),D(a,"displayable",t[0]!==""),f(u,"class","clear-button-container svelte-1h1zm6d"),f(n,"class","input-group svelte-1h1zm6d"),f(e,"tabindex","0"),f(e,"class",T=Ze(t[2])+" svelte-1h1zm6d"),D(e,"can-collapse",t[6]&&t[0]==="")},m(_,O){Q(_,e,O),y(e,n),y(n,l),_e(r,l,null),y(n,c),y(n,s),t[41](s),xe(s,t[0]),y(n,i),y(n,u),y(u,a),_e(h,a,null),y(u,p),E&&E.m(u,null),y(n,H),w&&w.m(n,null),y(n,d),M&&M.m(n,null),y(e,g),~m&&A[m].m(e,null),z=!0,x||(L=[V(l,"click",t[40]),V(s,"input",t[42]),V(s,"focus",t[43]),V(s,"blur",t[44]),V(s,"keydown",t[18]),V(s,"input",t[45]),V(a,"click",t[46]),V(e,"submit",yt(t[17]))],x=!0)},p(_,O){(!z||O[0]&8)&&f(s,"placeholder",_[3]),(!z||O[0]&8)&&f(s,"aria-label",_[3]),O[0]&1&&s.value!==_[0]&&xe(s,_[0]),(!z||O[0]&1)&&D(a,"displayable",_[0]!==""),_[16]?E?O[0]&65536&&I(E,1):(E=et(),E.c(),I(E,1),E.m(u,null)):E&&(Re(),G(E,1,1,()=>{E=null}),Pe()),_[7]?w?(w.p(_,O),O[0]&128&&I(w,1)):(w=tt(_),w.c(),I(w,1),w.m(n,d)):w&&(Re(),G(w,1,1,()=>{w=null}),Pe()),M&&M.p&&(!z||O[1]&128)&&_t(M,N,_,_[38],z?ht(N,_[38],O,null):mt(_[38]),null);let $=m;m=ze(_),m===$?~m&&A[m].p(_,O):(b&&(Re(),G(A[$],1,1,()=>{A[$]=null}),Pe()),~m?(b=A[m],b?b.p(_,O):(b=A[m]=j[m](_),b.c()),I(b,1),b.m(e,null)):b=null),(!z||O[0]&4&&T!==(T=Ze(_[2])+" svelte-1h1zm6d"))&&f(e,"class",T),(!z||O[0]&69)&&D(e,"can-collapse",_[6]&&_[0]==="")},i(_){z||(I(r.$$.fragment,_),I(h.$$.fragment,_),I(E),I(w),I(M,_),I(b),z=!0)},o(_){G(r.$$.fragment,_),G(h.$$.fragment,_),G(E),G(w),G(M,_),G(b),z=!1},d(_){_&&q(e),me(r),t[41](null),me(h),E&&E.d(),w&&w.d(),M&&M.d(_),~m&&A[m].d(),x=!1,te(L)}}}function Ht(t,e,n){let l,{$$slots:r={},$$scope:c}=e,{class:s=void 0}=e,{mapController:i=void 0}=e,{apiKey:u}=e,{debounceSearch:a=200}=e,{placeholder:h="Search"}=e,{errorMessage:p="Searching failed"}=e,{noResultsMessage:H="No results found"}=e,{proximity:d=void 0}=e,{bbox:g=void 0}=e,{trackProximity:m=!0}=e,{minLength:b=2}=e,{language:T=void 0}=e,{showResultsWhileTyping:z=!0}=e,{zoom:x=16}=e,{flyTo:L=!0}=e,{collapsed:E=!1}=e,{clearOnBlur:w=!1}=e,{enableReverse:N=!1}=e,{filter:M=()=>!0}=e,{searchValue:j=""}=e,{reverseActive:A=!1}=e,{showPlaceType:ze=!1}=e;function _(){Y.focus()}function O(){Y.blur()}function $(o,U=!0){n(0,j=o),U?(n(12,B=-1),it()):(He(),setTimeout(()=>{Y.focus(),Y.select()}))}let ee=!1,S,K,v,st="",Y,B=-1,le,Ie=[],ue,Ne,qe;const re=vt();wt(()=>{i&&(i.setProximityChangeHandler(void 0),i.setMapClickHandler(void 0),i.indicateReverse(!1),i.setSelectedMarker(-1),i.setMarkers(void 0,void 0))});function it(){B>-1&&S?(n(11,v=S[B]),n(0,j=v.place_name.replace(/,.*/,"")),n(15,le=void 0),n(36,K=void 0),n(12,B=-1)):j&&Ge(j).then(()=>{n(36,K=S),n(11,v=void 0),Vt()}).catch(o=>n(15,le=o))}async function Ge(o,U=!1){n(15,le=void 0);const ae=/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(o),oe=new URLSearchParams;oe.set("key",u),T&&oe.set("language",String(T)),ae||(g&&oe.set("bbox",g.join(",")),d&&oe.set("proximity",d.join(",")));const de="https://api.maptiler.com/geocoding/"+encodeURIComponent(o)+".json?"+oe.toString();if(de===st){U?(n(10,S=void 0),n(11,v=Ie[0])):n(10,S=Ie);return}st=de,ue==null||ue.abort(),n(16,ue=new AbortController);let be;try{be=await fetch(de,{signal:ue.signal}).finally(()=>{n(16,ue=void 0)})}catch(we){if(we&&typeof we=="object"&&we.name==="AbortError")return;throw new Error}if(!be.ok)throw new Error;const pe=await be.json();re("response",{url:de,featureCollection:pe}),U?(n(10,S=void 0),n(11,v=pe.features[0]),Ie=[v]):(n(10,S=pe.features.filter(M)),Ie=S,ae&&Y.focus())}function Vt(){var U,ae,oe,de,be,pe,we,ct;if(!(K!=null&&K.length)||!L)return;const o=[180,90,-180,-90];for(const se of K)o[0]=Math.min(o[0],(ae=(U=se.bbox)==null?void 0:U[0])!=null?ae:se.center[0]),o[1]=Math.min(o[1],(de=(oe=se.bbox)==null?void 0:oe[1])!=null?de:se.center[1]),o[2]=Math.max(o[2],(pe=(be=se.bbox)==null?void 0:be[2])!=null?pe:se.center[0]),o[3]=Math.max(o[3],(ct=(we=se.bbox)==null?void 0:we[3])!=null?ct:se.center[1]);i&&K.length>0&&(v&&o[0]===o[2]&&o[1]===o[3]?i.flyTo(v.center,x):i.fitBounds(o,50))}function Ut(o){n(1,A=!1),$(o[0].toFixed(6)+","+o[1].toFixed(6))}function Wt(o){if(!S)return;let U=o.key==="ArrowDown"?1:o.key==="ArrowUp"?-1:0;U?(B===-1&&U===-1&&n(12,B=S.length),n(12,B+=U),B>=S.length&&n(12,B=-1),o.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(o.key)&&n(12,B=-1)}function He(o=!0){if(z&&j.length>b){Ne&&clearTimeout(Ne);const U=j;Ne=window.setTimeout(()=>{Ge(U).catch(ae=>n(15,le=ae))},o?a:0)}else n(10,S=void 0),n(15,le=void 0)}const Zt=()=>Y.focus();function xt(o){Oe[o?"unshift":"push"](()=>{Y=o,n(14,Y)})}function Jt(){j=this.value,n(0,j),n(9,ee),n(31,w)}const Xt=()=>n(9,ee=!0),Yt=()=>n(9,ee=!1),Ft=()=>He(),$t=()=>{n(0,j=""),Y.focus()},en=()=>n(1,A=!A),tn=o=>n(12,B=o),nn=o=>{n(11,v=o),n(0,j=o.place_name.replace(/,.*/,"")),n(12,B=-1)},ln=()=>n(12,B=-1),rn=()=>{};return t.$$set=o=>{"class"in o&&n(2,s=o.class),"mapController"in o&&n(21,i=o.mapController),"apiKey"in o&&n(22,u=o.apiKey),"debounceSearch"in o&&n(23,a=o.debounceSearch),"placeholder"in o&&n(3,h=o.placeholder),"errorMessage"in o&&n(4,p=o.errorMessage),"noResultsMessage"in o&&n(5,H=o.noResultsMessage),"proximity"in o&&n(20,d=o.proximity),"bbox"in o&&n(24,g=o.bbox),"trackProximity"in o&&n(25,m=o.trackProximity),"minLength"in o&&n(26,b=o.minLength),"language"in o&&n(27,T=o.language),"showResultsWhileTyping"in o&&n(28,z=o.showResultsWhileTyping),"zoom"in o&&n(29,x=o.zoom),"flyTo"in o&&n(30,L=o.flyTo),"collapsed"in o&&n(6,E=o.collapsed),"clearOnBlur"in o&&n(31,w=o.clearOnBlur),"enableReverse"in o&&n(7,N=o.enableReverse),"filter"in o&&n(32,M=o.filter),"searchValue"in o&&n(0,j=o.searchValue),"reverseActive"in o&&n(1,A=o.reverseActive),"showPlaceType"in o&&n(8,ze=o.showPlaceType),"$$scope"in o&&n(38,c=o.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&35651584&&i&&i.setProximityChangeHandler(m?o=>{n(20,d=o)}:void 0),t.$$.dirty[0]&33554432&&(m||n(20,d=void 0)),t.$$.dirty[0]&512|t.$$.dirty[1]&1&&setTimeout(()=>{n(13,qe=ee),w&&!ee&&n(0,j="")}),t.$$.dirty[0]&1025&&(j||(n(11,v=void 0),n(10,S=void 0),n(15,le=void 0),n(36,K=S))),t.$$.dirty[0]&2048&&v&&!v.address&&v.geometry.type==="Point"&&Ge(v.id,!0).catch(o=>n(15,le=o)),t.$$.dirty[0]&1612711936&&i&&v&&L&&(!v.bbox||v.bbox[0]===v.bbox[2]&&v.bbox[1]===v.bbox[3]?i.flyTo(v.center,x):i.fitBounds(v.bbox,50),n(10,S=void 0),n(36,K=void 0),n(12,B=-1)),t.$$.dirty[0]&1024|t.$$.dirty[1]&32&&K!==S&&n(36,K=void 0),t.$$.dirty[0]&2099200|t.$$.dirty[1]&32&&i&&i.setMarkers(K,v),t.$$.dirty[0]&1&&n(12,B=-1),t.$$.dirty[0]&2101248&&(i==null||i.setSelectedMarker(B)),t.$$.dirty[0]&5120&&n(37,l=S==null?void 0:S[B]),t.$$.dirty[1]&64&&re("select",l),t.$$.dirty[0]&2048&&re("pick",v),t.$$.dirty[0]&9216&&re("optionsVisibilityChange",qe&&!!S),t.$$.dirty[0]&1024&&re("featuresListed",S),t.$$.dirty[1]&32&&re("featuresMarked",K),t.$$.dirty[0]&2&&re("reverseToggle",A),t.$$.dirty[0]&1&&re("queryChange",j),t.$$.dirty[0]&2097154&&i&&i.indicateReverse(A),t.$$.dirty[0]&2097154&&i&&i.setMapClickHandler(A?Ut:void 0)},[j,A,s,h,p,H,E,N,ze,ee,S,v,B,qe,Y,le,ue,it,Wt,He,d,i,u,a,g,m,b,T,z,x,L,w,M,_,O,$,K,l,c,r,Zt,xt,Jt,Xt,Yt,Ft,$t,en,tn,nn,ln,rn]}class Kt extends ye{constructor(e){super(),ge(this,e,Ht,Gt,he,{class:2,mapController:21,apiKey:22,debounceSearch:23,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:20,bbox:24,trackProximity:25,minLength:26,language:27,showResultsWhileTyping:28,zoom:29,flyTo:30,collapsed:6,clearOnBlur:31,enableReverse:7,filter:32,searchValue:0,reverseActive:1,showPlaceType:8,focus:33,blur:34,setQuery:35},null,[-1,-1])}get focus(){return this.$$.ctx[33]}get blur(){return this.$$.ctx[34]}get setQuery(){return this.$$.ctx[35]}}function rt(t,e=!0,n=!0,l={},r={}){let c,s,i,u=[],a;const h=()=>{if(!c){i=void 0;return}let d;const g=t.getZoom()>10?[(d=t.getCenter().wrap()).lng,d.lat]:void 0;i!==g&&(i=g,c(g))},p=d=>{s==null||s([d.latlng.lng,d.latlng.lat])};return{setProximityChangeHandler(d){d?(c=d,t.on("moveend",h),h()):(t.off("moveend",h),c==null||c(void 0),c=void 0)},setMapClickHandler(d){s=d,s?t.on("click",p):t.off("click",p)},flyTo(d,g){t.flyTo(d,g,l)},fitBounds(d,g){t.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{...r,padding:[g,g]})},indicateReverse(d){t.getContainer().style.cursor=d?"crosshair":""},setMarkers(d,g){for(const m of u)m.remove();u.length=0;for(const m of g?[...d!=null?d:[],g]:d!=null?d:[]){let b;const T=[m.center[1],m.center[0]];if(m===g&&typeof e=="object")b=new J.Marker(T,e);else if(m!==g&&typeof n=="object")b=new J.Marker(T,n);else{const z=document.createElement("div");new Fe({props:{displayIn:"leaflet"},target:z}),b=new J.Marker(T,{icon:new J.DivIcon({html:z,className:""})})}u.push(b.addTo(t))}},setSelectedMarker(d){var g,m;a&&((g=a.getElement())==null||g.classList.toggle("marker-selected",!1)),a=d>-1?u[d]:void 0,(m=a==null?void 0:a.getElement())==null||m.classList.toggle("marker-selected",!0)}}}class ot extends J.Control{constructor(n){super();Ke(this,Z,void 0);Ke(this,fe,void 0);je(this,fe,n)}onAdd(n){const l=document.createElement("div");l.className="leaflet-ctrl-geocoder",J.DomEvent.disableClickPropagation(l),J.DomEvent.disableScrollPropagation(l);const{marker:r,showResultMarkers:c,flyTo:s,...i}=F(this,fe),u=typeof s=="boolean"?{}:s,a=rt(n,r,c,u,u);je(this,Z,new Kt({target:l,props:{mapController:a,flyTo:s===void 0?!0:!!s,...i}}));for(const h of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])F(this,Z).$on(h,p=>n.fire(h.toLowerCase(),p.detail));return l}setOptions(n){var i;je(this,fe,n);const{marker:l,showResultMarkers:r,flyTo:c,...s}=F(this,fe);(i=F(this,Z))==null||i.$set(s)}setQuery(n,l=!0){var r;(r=F(this,Z))==null||r.setQuery(n,l)}setReverseMode(n){var l;(l=F(this,Z))==null||l.$set({reverseActive:n})}focus(){var n;(n=F(this,Z))==null||n.focus()}blur(){var n;(n=F(this,Z))==null||n.blur()}onRemove(){var n;(n=F(this,Z))==null||n.$destroy()}}Z=new WeakMap,fe=new WeakMap;function Qt(...t){return new ot(...t)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Qt),C.GeocodingControl=ot,C.createLeafletMapController=rt,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type MapLibreGL from "maplibre-gl";
|
|
2
|
-
import type { FitBoundsOptions, Map, FlyToOptions } from "maplibre-gl";
|
|
3
|
-
import type { MapController } from "./types";
|
|
4
|
-
export declare function createMaplibreMapController(map: Map, maplibregl?: typeof MapLibreGL | undefined, marker?: boolean | maplibregl.MarkerOptions, showResultMarkers?: boolean | maplibregl.MarkerOptions, flyToOptions?: FlyToOptions, fitBoundsOptions?: FitBoundsOptions): MapController;
|
package/dist/maplibregl.umd.cjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var Xt=(T,N,P)=>{if(!N.has(T))throw TypeError("Cannot "+P)};var ne=(T,N,P)=>(Xt(T,N,"read from private field"),P?P.call(T):N.get(T)),ft=(T,N,P)=>{if(N.has(T))throw TypeError("Cannot add the same private member more than once");N instanceof WeakSet?N.add(T):N.set(T,P)},Ye=(T,N,P,Ne)=>(Xt(T,N,"write to private field"),Ne?Ne.call(T,P):N.set(T,P),P);(function(T,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],N):(T=typeof globalThis<"u"?globalThis:T||self,N(T.maplibreglMaptilerGeocoder={},T.maplibregl))})(this,function(T,N){var $,ye;"use strict";function P(){}function Ne(n,t){for(const e in t)n[e]=t[e];return n}function at(n){return n()}function ct(){return Object.create(null)}function ie(n){n.forEach(at)}function ht(n){return typeof n=="function"}function _e(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}function Wt(n){return Object.keys(n).length===0}function jt(n,t,e,r){if(n){const i=gt(n,t,e,r);return n[0](i)}}function gt(n,t,e,r){return n[1]&&r?Ne(e.ctx.slice(),n[1](r(t))):e.ctx}function Zt(n,t,e,r){if(n[2]&&r){const i=n[2](r(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],l=Math.max(t.dirty.length,i.length);for(let s=0;s<l;s+=1)o[s]=t.dirty[s]|i[s];return o}return t.dirty|i}return t.dirty}function Ht(n,t,e,r,i,o){if(i){const l=gt(t,e,r,o);n.p(l,i)}}function Kt(n){if(n.ctx.length>32){const t=[],e=n.ctx.length/32;for(let r=0;r<e;r++)t[r]=-1;return t}return-1}function vt(n){return n==null?"":n}function M(n,t){n.appendChild(t)}function X(n,t,e){n.insertBefore(t,e||null)}function F(n){n.parentNode.removeChild(n)}function Jt(n,t){for(let e=0;e<n.length;e+=1)n[e]&&n[e].d(t)}function B(n){return document.createElement(n)}function oe(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function ge(n){return document.createTextNode(n)}function ee(){return ge(" ")}function W(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function $t(n){return function(t){return t.preventDefault(),n.call(this,t)}}function d(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function er(n){return Array.from(n.childNodes)}function Ie(n,t){t=""+t,n.wholeText!==t&&(n.data=t)}function yt(n,t){n.value=t==null?"":t}function D(n,t,e){n.classList[e?"add":"remove"](t)}function tr(n,t,{bubbles:e=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(n,e,r,t),i}let Re;function Me(n){Re=n}function dt(){if(!Re)throw new Error("Function called outside component initialization");return Re}function rr(n){dt().$$.on_destroy.push(n)}function nr(){const n=dt();return(t,e,{cancelable:r=!1}={})=>{const i=n.$$.callbacks[t];if(i){const o=tr(t,e,{cancelable:r});return i.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}const Le=[],Xe=[],Be=[],pt=[],ir=Promise.resolve();let We=!1;function or(){We||(We=!0,ir.then(mt))}function je(n){Be.push(n)}const Ze=new Set;let Ge=0;function mt(){const n=Re;do{for(;Ge<Le.length;){const t=Le[Ge];Ge++,Me(t),lr(t.$$)}for(Me(null),Le.length=0,Ge=0;Xe.length;)Xe.pop()();for(let t=0;t<Be.length;t+=1){const e=Be[t];Ze.has(e)||(Ze.add(e),e())}Be.length=0}while(Le.length);for(;pt.length;)pt.pop()();We=!1,Ze.clear(),Me(n)}function lr(n){if(n.fragment!==null){n.update(),ie(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(je)}}const qe=new Set;let ve;function De(){ve={r:0,c:[],p:ve}}function Qe(){ve.r||ie(ve.c),ve=ve.p}function G(n,t){n&&n.i&&(qe.delete(n),n.i(t))}function V(n,t,e,r){if(n&&n.o){if(qe.has(n))return;qe.add(n),ve.c.push(()=>{qe.delete(n),r&&(e&&n.d(1),r())}),n.o(t)}else r&&r()}function Oe(n){n&&n.c()}function be(n,t,e,r){const{fragment:i,after_update:o}=n.$$;i&&i.m(t,e),r||je(()=>{const l=n.$$.on_mount.map(at).filter(ht);n.$$.on_destroy?n.$$.on_destroy.push(...l):ie(l),n.$$.on_mount=[]}),o.forEach(je)}function xe(n,t){const e=n.$$;e.fragment!==null&&(ie(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function sr(n,t){n.$$.dirty[0]===-1&&(Le.push(n),or(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function we(n,t,e,r,i,o,l,s=[-1]){const u=Re;Me(n);const f=n.$$={fragment:null,ctx:[],props:o,update:P,not_equal:i,bound:ct(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ct(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};l&&l(f.root);let a=!1;if(f.ctx=e?e(n,t.props||{},(v,p,...y)=>{const E=y.length?y[0]:p;return f.ctx&&i(f.ctx[v],f.ctx[v]=E)&&(!f.skip_bound&&f.bound[v]&&f.bound[v](E),a&&sr(n,v)),p}):[],f.update(),a=!0,ie(f.before_update),f.fragment=r?r(f.ctx):!1,t.target){if(t.hydrate){const v=er(t.target);f.fragment&&f.fragment.l(v),v.forEach(F)}else f.fragment&&f.fragment.c();t.intro&&G(n.$$.fragment),be(n,t.target,t.anchor,t.customElement),mt()}Me(u)}class Ee{$destroy(){xe(this,1),this.$destroy=P}$on(t,e){if(!ht(e))return P;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Wt(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const gn="";function ur(n){let t,e;return{c(){t=oe("svg"),e=oe("path"),d(e,"d","M500 115.1c212.2 0 384.9 172.6 384.9 384.9 0 212.2-172.7 384.9-384.9 384.9S115.1 712.2 115.1 500c0-212.4 172.5-384.9 384.9-384.9M500 10C229.4 10 10 229.4 10 500s219.4 490 490 490 490-219.4 490-490c-.2-270.6-219.5-490-490-490zm0 315c96.5 0 175 78.4 175 175 0 96.5-78.4 175-175 175-96.5 0-175-78.4-175-175 0-96.5 78.4-175 175-175m0-105c-154.7 0-279.9 125.4-279.9 279.9 0 154.7 125.4 279.9 279.9 279.9 154.5 0 279.9-125.4 279.9-279.9C779.9 345.3 654.5 220 500 220zm70 280c0 38.7-31.3 70-70 70s-70-31.3-70-70 31.3-70 70-70 70 31.3 70 70z"),d(t,"viewBox","0 0 1000 1000"),d(t,"width","18px"),d(t,"height","18px"),d(t,"class","svelte-en2qvf")},m(r,i){X(r,t,i),M(t,e)},p:P,i:P,o:P,d(r){r&&F(t)}}}class fr extends Ee{constructor(t){super(),we(this,t,null,ur,_e,{})}}const vn="";function ar(n){let t,e;return{c(){t=oe("svg"),e=oe("path"),d(e,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),d(t,"viewBox","0 0 18 18"),d(t,"width","16"),d(t,"height","16"),d(t,"class","svelte-en2qvf")},m(r,i){X(r,t,i),M(t,e)},p:P,i:P,o:P,d(r){r&&F(t)}}}class cr extends Ee{constructor(t){super(),we(this,t,null,ar,_e,{})}}const yn="";function hr(n){let t;return{c(){t=B("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',d(t,"class","svelte-7cmwmc")},m(e,r){X(e,t,r)},p:P,i:P,o:P,d(e){e&&F(t)}}}class gr extends Ee{constructor(t){super(),we(this,t,null,hr,_e,{})}}const dn="";function vr(n){let t,e,r;return{c(){t=oe("svg"),e=oe("path"),d(e,"stroke-width","4"),d(e,"fill-rule","evenodd"),d(e,"clip-rule","evenodd"),d(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),d(e,"class","svelte-656hh2"),d(t,"width",r=n[0]!=="list"?void 0:"20"),d(t,"viewBox","0 0 70 85"),d(t,"fill","none"),d(t,"class","svelte-656hh2"),D(t,"in-map",n[0]!=="list"),D(t,"for-maplibre",n[0]==="maplibre"),D(t,"for-leaflet",n[0]==="leaflet"),D(t,"list-icon",n[0]==="list")},m(i,o){X(i,t,o),M(t,e)},p(i,[o]){o&1&&r!==(r=i[0]!=="list"?void 0:"20")&&d(t,"width",r),o&1&&D(t,"in-map",i[0]!=="list"),o&1&&D(t,"for-maplibre",i[0]==="maplibre"),o&1&&D(t,"for-leaflet",i[0]==="leaflet"),o&1&&D(t,"list-icon",i[0]==="list")},i:P,o:P,d(i){i&&F(t)}}}function yr(n,t,e){let{displayIn:r}=t;return n.$$set=i=>{"displayIn"in i&&e(0,r=i.displayIn)},[r]}class He extends Ee{constructor(t){super(),we(this,t,yr,vr,_e,{displayIn:0})}}const pn="";function dr(n){let t,e;return{c(){t=oe("svg"),e=oe("path"),d(e,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),d(t,"viewBox","0 0 18 18"),d(t,"xml:space","preserve"),d(t,"width","20"),d(t,"class","svelte-en2qvf")},m(r,i){X(r,t,i),M(t,e)},p:P,i:P,o:P,d(r){r&&F(t)}}}class pr extends Ee{constructor(t){super(),we(this,t,null,dr,_e,{})}}const mn="";function _t(n,t,e){const r=n.slice();return r[59]=t[e],r[61]=e,r}function bt(n){let t,e;return t=new gr({}),{c(){Oe(t.$$.fragment)},m(r,i){be(t,r,i),e=!0},i(r){e||(G(t.$$.fragment,r),e=!0)},o(r){V(t.$$.fragment,r),e=!1},d(r){xe(t,r)}}}function xt(n){let t,e,r,i,o,l;return e=new fr({}),{c(){t=B("button"),Oe(e.$$.fragment),d(t,"type","button"),d(t,"title",r=n[7]===!0?"toggle reverse geocoding":n[7]),d(t,"class","svelte-1h1zm6d"),D(t,"active",n[1])},m(s,u){X(s,t,u),be(e,t,null),i=!0,o||(l=W(t,"click",n[47]),o=!0)},p(s,u){(!i||u[0]&128&&r!==(r=s[7]===!0?"toggle reverse geocoding":s[7]))&&d(t,"title",r),(!i||u[0]&2)&&D(t,"active",s[1])},i(s){i||(G(e.$$.fragment,s),i=!0)},o(s){V(e.$$.fragment,s),i=!1},d(s){s&&F(t),xe(e),o=!1,l()}}}function mr(n){let t,e,r,i,o=n[10],l=[];for(let u=0;u<o.length;u+=1)l[u]=Et(_t(n,o,u));const s=u=>V(l[u],1,1,()=>{l[u]=null});return{c(){t=B("ul");for(let u=0;u<l.length;u+=1)l[u].c();d(t,"class","svelte-1h1zm6d")},m(u,f){X(u,t,f);for(let a=0;a<l.length;a+=1)l[a].m(t,null);e=!0,r||(i=[W(t,"mouseout",n[50]),W(t,"blur",n[51])],r=!0)},p(u,f){if(f[0]&7425){o=u[10];let a;for(a=0;a<o.length;a+=1){const v=_t(u,o,a);l[a]?(l[a].p(v,f),G(l[a],1)):(l[a]=Et(v),l[a].c(),G(l[a],1),l[a].m(t,null))}for(De(),a=o.length;a<l.length;a+=1)s(a);Qe()}},i(u){if(!e){for(let f=0;f<o.length;f+=1)G(l[f]);e=!0}},o(u){l=l.filter(Boolean);for(let f=0;f<l.length;f+=1)V(l[f]);e=!1},d(u){u&&F(t),Jt(l,u),r=!1,ie(i)}}}function _r(n){let t,e;return{c(){t=B("div"),e=ge(n[5]),d(t,"class","no-results svelte-1h1zm6d")},m(r,i){X(r,t,i),M(t,e)},p(r,i){i[0]&32&&Ie(e,r[5])},i:P,o:P,d(r){r&&F(t)}}}function br(n){let t,e;return{c(){t=B("div"),e=ge(n[4]),d(t,"class","error svelte-1h1zm6d")},m(r,i){X(r,t,i),M(t,e)},p(r,i){i[0]&16&&Ie(e,r[4])},i:P,o:P,d(r){r&&F(t)}}}function xr(n){let t="",e;return{c(){e=ge(t)},m(r,i){X(r,e,i)},p:P,i:P,o:P,d(r){r&&F(e)}}}function wt(n){let t,e=n[59].place_type+"",r;return{c(){t=B("span"),r=ge(e),d(t,"class","svelte-1h1zm6d")},m(i,o){X(i,t,o),M(t,r)},p(i,o){o[0]&1024&&e!==(e=i[59].place_type+"")&&Ie(r,e)},d(i){i&&F(t)}}}function Et(n){let t,e,r,i,o,l,s=n[59].place_name.replace(/,.*/,"")+"",u,f,a,v,p,y=n[59].place_name.replace(/[^,]*,?\s*/,"")+"",E,h,g,w,_,S;e=new He({props:{displayIn:"list"}});let m=n[8]&&wt(n);function x(){return n[48](n[61])}function k(){return n[49](n[59])}return{c(){t=B("li"),Oe(e.$$.fragment),r=ee(),i=B("span"),o=B("span"),l=B("span"),u=ge(s),f=ee(),m&&m.c(),a=ee(),v=B("span"),p=B("span"),E=ge(y),h=ee(),d(l,"class","svelte-1h1zm6d"),d(o,"class","svelte-1h1zm6d"),d(i,"class","svelte-1h1zm6d"),d(p,"class","svelte-1h1zm6d"),d(v,"class","svelte-1h1zm6d"),d(t,"tabindex","0"),d(t,"data-selected",g=n[12]===n[61]),d(t,"class","svelte-1h1zm6d"),D(t,"selected",n[12]===n[61])},m(O,I){X(O,t,I),be(e,t,null),M(t,r),M(t,i),M(i,o),M(o,l),M(l,u),M(o,f),m&&m.m(o,null),M(t,a),M(t,v),M(v,p),M(p,E),M(t,h),w=!0,_||(S=[W(t,"mouseover",x),W(t,"focus",k)],_=!0)},p(O,I){n=O,(!w||I[0]&1024)&&s!==(s=n[59].place_name.replace(/,.*/,"")+"")&&Ie(u,s),n[8]?m?m.p(n,I):(m=wt(n),m.c(),m.m(o,null)):m&&(m.d(1),m=null),(!w||I[0]&1024)&&y!==(y=n[59].place_name.replace(/[^,]*,?\s*/,"")+"")&&Ie(E,y),(!w||I[0]&4096&&g!==(g=n[12]===n[61]))&&d(t,"data-selected",g),(!w||I[0]&4096)&&D(t,"selected",n[12]===n[61])},i(O){w||(G(e.$$.fragment,O),w=!0)},o(O){V(e.$$.fragment,O),w=!1},d(O){O&&F(t),xe(e),m&&m.d(),_=!1,ie(S)}}}function wr(n){let t,e,r,i,o,l,s,u,f,a,v,p,y,E,h,g,w,_,S,m;i=new pr({}),a=new cr({});let x=n[16]&&bt(),k=n[7]&&xt(n);const O=n[39].default,I=jt(O,n,n[38],null),R=[xr,br,_r,mr],z=[];function j(b,C){var U,Z;return b[13]?b[15]?1:((U=b[10])==null?void 0:U.length)===0?2:b[13]&&((Z=b[10])==null?void 0:Z.length)?3:-1:0}return~(h=j(n))&&(g=z[h]=R[h](n)),{c(){t=B("form"),e=B("div"),r=B("button"),Oe(i.$$.fragment),o=ee(),l=B("input"),s=ee(),u=B("div"),f=B("button"),Oe(a.$$.fragment),v=ee(),x&&x.c(),p=ee(),k&&k.c(),y=ee(),I&&I.c(),E=ee(),g&&g.c(),d(r,"type","button"),d(r,"class","svelte-1h1zm6d"),d(l,"placeholder",n[3]),d(l,"aria-label",n[3]),d(l,"class","svelte-1h1zm6d"),d(f,"type","button"),d(f,"class","svelte-1h1zm6d"),D(f,"displayable",n[0]!==""),d(u,"class","clear-button-container svelte-1h1zm6d"),d(e,"class","input-group svelte-1h1zm6d"),d(t,"tabindex","0"),d(t,"class",w=vt(n[2])+" svelte-1h1zm6d"),D(t,"can-collapse",n[6]&&n[0]==="")},m(b,C){X(b,t,C),M(t,e),M(e,r),be(i,r,null),M(e,o),M(e,l),n[41](l),yt(l,n[0]),M(e,s),M(e,u),M(u,f),be(a,f,null),M(u,v),x&&x.m(u,null),M(e,p),k&&k.m(e,null),M(e,y),I&&I.m(e,null),M(t,E),~h&&z[h].m(t,null),_=!0,S||(m=[W(r,"click",n[40]),W(l,"input",n[42]),W(l,"focus",n[43]),W(l,"blur",n[44]),W(l,"keydown",n[18]),W(l,"input",n[45]),W(f,"click",n[46]),W(t,"submit",$t(n[17]))],S=!0)},p(b,C){(!_||C[0]&8)&&d(l,"placeholder",b[3]),(!_||C[0]&8)&&d(l,"aria-label",b[3]),C[0]&1&&l.value!==b[0]&&yt(l,b[0]),(!_||C[0]&1)&&D(f,"displayable",b[0]!==""),b[16]?x?C[0]&65536&&G(x,1):(x=bt(),x.c(),G(x,1),x.m(u,null)):x&&(De(),V(x,1,1,()=>{x=null}),Qe()),b[7]?k?(k.p(b,C),C[0]&128&&G(k,1)):(k=xt(b),k.c(),G(k,1),k.m(e,y)):k&&(De(),V(k,1,1,()=>{k=null}),Qe()),I&&I.p&&(!_||C[1]&128)&&Ht(I,O,b,b[38],_?Zt(O,b[38],C,null):Kt(b[38]),null);let U=h;h=j(b),h===U?~h&&z[h].p(b,C):(g&&(De(),V(z[U],1,1,()=>{z[U]=null}),Qe()),~h?(g=z[h],g?g.p(b,C):(g=z[h]=R[h](b),g.c()),G(g,1),g.m(t,null)):g=null),(!_||C[0]&4&&w!==(w=vt(b[2])+" svelte-1h1zm6d"))&&d(t,"class",w),(!_||C[0]&69)&&D(t,"can-collapse",b[6]&&b[0]==="")},i(b){_||(G(i.$$.fragment,b),G(a.$$.fragment,b),G(x),G(k),G(I,b),G(g),_=!0)},o(b){V(i.$$.fragment,b),V(a.$$.fragment,b),V(x),V(k),V(I,b),V(g),_=!1},d(b){b&&F(t),xe(i),n[41](null),xe(a),x&&x.d(),k&&k.d(),I&&I.d(b),~h&&z[h].d(),S=!1,ie(m)}}}function Er(n,t,e){let r,{$$slots:i={},$$scope:o}=t,{class:l=void 0}=t,{mapController:s=void 0}=t,{apiKey:u}=t,{debounceSearch:f=200}=t,{placeholder:a="Search"}=t,{errorMessage:v="Searching failed"}=t,{noResultsMessage:p="No results found"}=t,{proximity:y=void 0}=t,{bbox:E=void 0}=t,{trackProximity:h=!0}=t,{minLength:g=2}=t,{language:w=void 0}=t,{showResultsWhileTyping:_=!0}=t,{zoom:S=16}=t,{flyTo:m=!0}=t,{collapsed:x=!1}=t,{clearOnBlur:k=!1}=t,{enableReverse:O=!1}=t,{filter:I=()=>!0}=t,{searchValue:R=""}=t,{reverseActive:z=!1}=t,{showPlaceType:j=!1}=t;function b(){re.focus()}function C(){re.blur()}function U(c,H=!0){e(0,R=c),H?(e(12,q=-1),Vt()):(ut(),setTimeout(()=>{re.focus(),re.select()}))}let Z=!1,A,Y,L,Ft="",re,q=-1,fe,Ve=[],de,ot,lt;const ae=nr();rr(()=>{s&&(s.setProximityChangeHandler(void 0),s.setMapClickHandler(void 0),s.indicateReverse(!1),s.setSelectedMarker(-1),s.setMarkers(void 0,void 0))});function Vt(){q>-1&&A?(e(11,L=A[q]),e(0,R=L.place_name.replace(/,.*/,"")),e(15,fe=void 0),e(36,Y=void 0),e(12,q=-1)):R&&st(R).then(()=>{e(36,Y=A),e(11,L=void 0),Kr()}).catch(c=>e(15,fe=c))}async function st(c,H=!1){e(15,fe=void 0);const pe=/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(c),ce=new URLSearchParams;ce.set("key",u),w&&ce.set("language",String(w)),pe||(E&&ce.set("bbox",E.join(",")),y&&ce.set("proximity",y.join(",")));const me="https://api.maptiler.com/geocoding/"+encodeURIComponent(c)+".json?"+ce.toString();if(me===Ft){H?(e(10,A=void 0),e(11,L=Ve[0])):e(10,A=Ve);return}Ft=me,de==null||de.abort(),e(16,de=new AbortController);let Se;try{Se=await fetch(me,{signal:de.signal}).finally(()=>{e(16,de=void 0)})}catch(Pe){if(Pe&&typeof Pe=="object"&&Pe.name==="AbortError")return;throw new Error}if(!Se.ok)throw new Error;const ke=await Se.json();ae("response",{url:me,featureCollection:ke}),H?(e(10,A=void 0),e(11,L=ke.features[0]),Ve=[L]):(e(10,A=ke.features.filter(I)),Ve=A,pe&&re.focus())}function Kr(){var H,pe,ce,me,Se,ke,Pe,Yt;if(!(Y!=null&&Y.length)||!m)return;const c=[180,90,-180,-90];for(const he of Y)c[0]=Math.min(c[0],(pe=(H=he.bbox)==null?void 0:H[0])!=null?pe:he.center[0]),c[1]=Math.min(c[1],(me=(ce=he.bbox)==null?void 0:ce[1])!=null?me:he.center[1]),c[2]=Math.max(c[2],(ke=(Se=he.bbox)==null?void 0:Se[2])!=null?ke:he.center[0]),c[3]=Math.max(c[3],(Yt=(Pe=he.bbox)==null?void 0:Pe[3])!=null?Yt:he.center[1]);s&&Y.length>0&&(L&&c[0]===c[2]&&c[1]===c[3]?s.flyTo(L.center,S):s.fitBounds(c,50))}function Jr(c){e(1,z=!1),U(c[0].toFixed(6)+","+c[1].toFixed(6))}function $r(c){if(!A)return;let H=c.key==="ArrowDown"?1:c.key==="ArrowUp"?-1:0;H?(q===-1&&H===-1&&e(12,q=A.length),e(12,q+=H),q>=A.length&&e(12,q=-1),c.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(c.key)&&e(12,q=-1)}function ut(c=!0){if(_&&R.length>g){ot&&clearTimeout(ot);const H=R;ot=window.setTimeout(()=>{st(H).catch(pe=>e(15,fe=pe))},c?f:0)}else e(10,A=void 0),e(15,fe=void 0)}const en=()=>re.focus();function tn(c){Xe[c?"unshift":"push"](()=>{re=c,e(14,re)})}function rn(){R=this.value,e(0,R),e(9,Z),e(31,k)}const nn=()=>e(9,Z=!0),on=()=>e(9,Z=!1),ln=()=>ut(),sn=()=>{e(0,R=""),re.focus()},un=()=>e(1,z=!z),fn=c=>e(12,q=c),an=c=>{e(11,L=c),e(0,R=c.place_name.replace(/,.*/,"")),e(12,q=-1)},cn=()=>e(12,q=-1),hn=()=>{};return n.$$set=c=>{"class"in c&&e(2,l=c.class),"mapController"in c&&e(21,s=c.mapController),"apiKey"in c&&e(22,u=c.apiKey),"debounceSearch"in c&&e(23,f=c.debounceSearch),"placeholder"in c&&e(3,a=c.placeholder),"errorMessage"in c&&e(4,v=c.errorMessage),"noResultsMessage"in c&&e(5,p=c.noResultsMessage),"proximity"in c&&e(20,y=c.proximity),"bbox"in c&&e(24,E=c.bbox),"trackProximity"in c&&e(25,h=c.trackProximity),"minLength"in c&&e(26,g=c.minLength),"language"in c&&e(27,w=c.language),"showResultsWhileTyping"in c&&e(28,_=c.showResultsWhileTyping),"zoom"in c&&e(29,S=c.zoom),"flyTo"in c&&e(30,m=c.flyTo),"collapsed"in c&&e(6,x=c.collapsed),"clearOnBlur"in c&&e(31,k=c.clearOnBlur),"enableReverse"in c&&e(7,O=c.enableReverse),"filter"in c&&e(32,I=c.filter),"searchValue"in c&&e(0,R=c.searchValue),"reverseActive"in c&&e(1,z=c.reverseActive),"showPlaceType"in c&&e(8,j=c.showPlaceType),"$$scope"in c&&e(38,o=c.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&35651584&&s&&s.setProximityChangeHandler(h?c=>{e(20,y=c)}:void 0),n.$$.dirty[0]&33554432&&(h||e(20,y=void 0)),n.$$.dirty[0]&512|n.$$.dirty[1]&1&&setTimeout(()=>{e(13,lt=Z),k&&!Z&&e(0,R="")}),n.$$.dirty[0]&1025&&(R||(e(11,L=void 0),e(10,A=void 0),e(15,fe=void 0),e(36,Y=A))),n.$$.dirty[0]&2048&&L&&!L.address&&L.geometry.type==="Point"&&st(L.id,!0).catch(c=>e(15,fe=c)),n.$$.dirty[0]&1612711936&&s&&L&&m&&(!L.bbox||L.bbox[0]===L.bbox[2]&&L.bbox[1]===L.bbox[3]?s.flyTo(L.center,S):s.fitBounds(L.bbox,50),e(10,A=void 0),e(36,Y=void 0),e(12,q=-1)),n.$$.dirty[0]&1024|n.$$.dirty[1]&32&&Y!==A&&e(36,Y=void 0),n.$$.dirty[0]&2099200|n.$$.dirty[1]&32&&s&&s.setMarkers(Y,L),n.$$.dirty[0]&1&&e(12,q=-1),n.$$.dirty[0]&2101248&&(s==null||s.setSelectedMarker(q)),n.$$.dirty[0]&5120&&e(37,r=A==null?void 0:A[q]),n.$$.dirty[1]&64&&ae("select",r),n.$$.dirty[0]&2048&&ae("pick",L),n.$$.dirty[0]&9216&&ae("optionsVisibilityChange",lt&&!!A),n.$$.dirty[0]&1024&&ae("featuresListed",A),n.$$.dirty[1]&32&&ae("featuresMarked",Y),n.$$.dirty[0]&2&&ae("reverseToggle",z),n.$$.dirty[0]&1&&ae("queryChange",R),n.$$.dirty[0]&2097154&&s&&s.indicateReverse(z),n.$$.dirty[0]&2097154&&s&&s.setMapClickHandler(z?Jr:void 0)},[R,z,l,a,v,p,x,O,j,Z,A,L,q,lt,re,fe,de,Vt,$r,ut,y,s,u,f,E,h,g,w,_,S,m,k,I,b,C,U,Y,r,o,i,en,tn,rn,nn,on,ln,sn,un,fn,an,cn,hn]}class Sr extends Ee{constructor(t){super(),we(this,t,Er,wr,_e,{class:2,mapController:21,apiKey:22,debounceSearch:23,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:20,bbox:24,trackProximity:25,minLength:26,language:27,showResultsWhileTyping:28,zoom:29,flyTo:30,collapsed:6,clearOnBlur:31,enableReverse:7,filter:32,searchValue:0,reverseActive:1,showPlaceType:8,focus:33,blur:34,setQuery:35},null,[-1,-1])}get focus(){return this.$$.ctx[33]}get blur(){return this.$$.ctx[34]}get setQuery(){return this.$$.ctx[35]}}function St(n,t,e){e===void 0&&(e={});var r={type:"Feature"};return(e.id===0||e.id)&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.properties=t||{},r.geometry=n,r}function kt(n,t,e){e===void 0&&(e={});for(var r=0,i=n;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<o[o.length-1].length;l++)if(o[o.length-1][l]!==o[0][l])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:n};return St(s,t,e)}function Pt(n,t,e){e===void 0&&(e={});var r={type:"MultiPolygon",coordinates:n};return St(r,t,e)}/**
|
|
2
|
-
* splaytree v3.1.1
|
|
3
|
-
* Fast Splay tree for Node and browser
|
|
4
|
-
*
|
|
5
|
-
* @author Alexander Milevski <info@w8r.name>
|
|
6
|
-
* @license MIT
|
|
7
|
-
* @preserve
|
|
8
|
-
*//*! *****************************************************************************
|
|
9
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
11
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
12
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
|
|
14
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
16
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
17
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
18
|
-
|
|
19
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
20
|
-
and limitations under the License.
|
|
21
|
-
***************************************************************************** */function kr(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(f){return function(a){return u([f,a])}}function u(f){if(r)throw new TypeError("Generator is already executing.");for(;e;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){e.label=f[1];break}if(f[0]===6&&e.label<o[1]){e.label=o[1],o=f;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(f);break}o[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(n,e)}catch(a){f=[6,a],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var le=function(){function n(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return n}();function Pr(n,t){return n>t?1:n<t?-1:0}function se(n,t,e){for(var r=new le(null,null),i=r,o=r;;){var l=e(n,t.key);if(l<0){if(t.left===null)break;if(e(n,t.left.key)<0){var s=t.left;if(t.left=s.right,s.right=t,t=s,t.left===null)break}o.left=t,o=t,t=t.left}else if(l>0){if(t.right===null)break;if(e(n,t.right.key)>0){var s=t.right;if(t.right=s.left,s.left=t,t=s,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=r.right,t.right=r.left,t}function Ke(n,t,e,r){var i=new le(n,t);if(e===null)return i.left=i.right=null,i;e=se(n,e,r);var o=r(n,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function It(n,t,e){var r=null,i=null;if(t){t=se(n,t,e);var o=e(t.key,n);o===0?(r=t.left,i=t.right):o<0?(i=t.right,t.right=null,r=t):(r=t.left,t.left=null,i=t)}return{left:r,right:i}}function Ir(n,t,e){return t===null?n:(n===null||(t=se(n.key,t,e),t.left=n),t)}function Je(n,t,e,r,i){if(n){r(""+t+(e?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+i(n)+`
|
|
22
|
-
`);var o=t+(e?" ":"\u2502 ");n.left&&Je(n.left,o,!1,r,i),n.right&&Je(n.right,o,!0,r,i)}}var $e=function(){function n(t){t===void 0&&(t=Pr),this._root=null,this._size=0,this._comparator=t}return n.prototype.insert=function(t,e){return this._size++,this._root=Ke(t,e,this._root,this._comparator)},n.prototype.add=function(t,e){var r=new le(t,e);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,o=se(t,this._root,i),l=i(t,o.key);return l===0?this._root=o:(l<0?(r.left=o.left,r.right=o,o.left=null):l>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root},n.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},n.prototype._remove=function(t,e,r){var i;if(e===null)return null;e=se(t,e,r);var o=r(t,e.key);return o===0?(e.left===null?i=e.right:(i=se(t,e.left,r),i.right=e.right),this._size--,i):e},n.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=se(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},n.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},n.prototype.find=function(t){return this._root&&(this._root=se(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},n.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},n.prototype.forEach=function(t,e){for(var r=this._root,i=[],o=!1;!o;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),t.call(e,r),r=r.right):o=!0;return this},n.prototype.range=function(t,e,r,i){for(var o=[],l=this._comparator,s=this._root,u;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),u=l(s.key,e),u>0)break;if(l(s.key,t)>=0&&r.call(i,s))return this;s=s.right}return this},n.prototype.keys=function(){var t=[];return this.forEach(function(e){var r=e.key;return t.push(r)}),t},n.prototype.values=function(){var t=[];return this.forEach(function(e){var r=e.data;return t.push(r)}),t},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},n.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},n.prototype.at=function(t){for(var e=this._root,r=!1,i=0,o=[];!r;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else r=!0;return null},n.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(r=e,e=e.left):e=e.right}return r},n.prototype.prev=function(t){var e=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(r=e,e=e.right)}return r},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return Mr(this._root)},n.prototype.load=function(t,e,r){e===void 0&&(e=[]),r===void 0&&(r=!1);var i=t.length,o=this._comparator;if(r&&rt(t,e,0,i-1,o),this._root===null)this._root=et(t,e,0,i),this._size=i;else{var l=Lr(this.toList(),Rr(t,e),o);i=this._size+i,this._root=tt({head:l},0,i)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(t){t===void 0&&(t=function(r){return String(r.key)});var e=[];return Je(this._root,"",!0,function(r){return e.push(r)},t),e.join("")},n.prototype.update=function(t,e,r){var i=this._comparator,o=It(t,this._root,i),l=o.left,s=o.right;i(t,e)<0?s=Ke(e,r,s,i):l=Ke(e,r,l,i),this._root=Ir(l,s,i)},n.prototype.split=function(t){return It(t,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var t;return kr(this,function(e){switch(e.label){case 0:t=this.minNode(),e.label=1;case 1:return t?[4,t]:[3,3];case 2:return e.sent(),t=this.next(t),[3,1];case 3:return[2]}})},n}();function et(n,t,e,r){var i=r-e;if(i>0){var o=e+Math.floor(i/2),l=n[o],s=t[o],u=new le(l,s);return u.left=et(n,t,e,o),u.right=et(n,t,o+1,r),u}return null}function Rr(n,t){for(var e=new le(null,null),r=e,i=0;i<n.length;i++)r=r.next=new le(n[i],t[i]);return r.next=null,e.next}function Mr(n){for(var t=n,e=[],r=!1,i=new le(null,null),o=i;!r;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):r=!0;return o.next=null,i.next}function tt(n,t,e){var r=e-t;if(r>0){var i=t+Math.floor(r/2),o=tt(n,t,i),l=n.head;return l.left=o,n.head=n.head.next,l.right=tt(n,i+1,e),l}return null}function Lr(n,t,e){for(var r=new le(null,null),i=r,o=n,l=t;o!==null&&l!==null;)e(o.key,l.key)<0?(i.next=o,o=o.next):(i.next=l,l=l.next),i=i.next;return o!==null?i.next=o:l!==null&&(i.next=l),r.next}function rt(n,t,e,r,i){if(!(e>=r)){for(var o=n[e+r>>1],l=e-1,s=r+1;;){do l++;while(i(n[l],o)<0);do s--;while(i(n[s],o)>0);if(l>=s)break;var u=n[l];n[l]=n[s],n[s]=u,u=t[l],t[l]=t[s],t[s]=u}rt(n,t,e,s,i),rt(n,t,s+1,r,i)}}function K(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Rt(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function Q(n,t,e){return t&&Rt(n.prototype,t),e&&Rt(n,e),n}var Ce=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},nt=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var r=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,l=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:r,y:o},ur:{x:i,y:l}}},ue=Number.EPSILON;ue===void 0&&(ue=Math.pow(2,-52));var Or=ue*ue,it=function(t,e){if(-ue<t&&t<ue&&-ue<e&&e<ue)return 0;var r=t-e;return r*r<Or*t*e?0:t<e?-1:1},Cr=function(){function n(){K(this,n),this.reset()}return Q(n,[{key:"reset",value:function(){this.xRounder=new Mt,this.yRounder=new Mt}},{key:"round",value:function(e,r){return{x:this.xRounder.round(e),y:this.yRounder.round(r)}}}]),n}(),Mt=function(){function n(){K(this,n),this.tree=new $e,this.round(0)}return Q(n,[{key:"round",value:function(e){var r=this.tree.add(e),i=this.tree.prev(r);if(i!==null&&it(r.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(r);return o!==null&&it(r.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),n}(),ze=new Cr,Te=function(t,e){return t.x*e.y-t.y*e.x},Lt=function(t,e){return t.x*e.x+t.y*e.y},Ot=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y},l=Te(i,o);return it(l,0)},Ue=function(t){return Math.sqrt(Lt(t,t))},zr=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return Te(o,i)/Ue(o)/Ue(i)},Tr=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return Lt(o,i)/Ue(o)/Ue(i)},Ct=function(t,e,r){return e.y===0?null:{x:t.x+e.x/e.y*(r-t.y),y:r}},zt=function(t,e,r){return e.x===0?null:{x:r,y:t.y+e.y/e.x*(r-t.x)}},Ar=function(t,e,r,i){if(e.x===0)return zt(r,i,t.x);if(i.x===0)return zt(t,e,r.x);if(e.y===0)return Ct(r,i,t.y);if(i.y===0)return Ct(t,e,r.y);var o=Te(e,i);if(o==0)return null;var l={x:r.x-t.x,y:r.y-t.y},s=Te(l,e)/o,u=Te(l,i)/o,f=t.x+u*e.x,a=r.x+s*i.x,v=t.y+u*e.y,p=r.y+s*i.y,y=(f+a)/2,E=(v+p)/2;return{x:y,y:E}},te=function(){Q(n,null,[{key:"compare",value:function(e,r){var i=n.comparePoints(e.point,r.point);return i!==0?i:(e.point!==r.point&&e.link(r),e.isLeft!==r.isLeft?e.isLeft?1:-1:Fe.compare(e.segment,r.segment))}},{key:"comparePoints",value:function(e,r){return e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0}}]);function n(t,e){K(this,n),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return Q(n,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var r=e.point.events,i=0,o=r.length;i<o;i++){var l=r[i];this.point.events.push(l),l.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,r=0;r<e;r++){var i=this.point.events[r];if(i.segment.consumedBy===void 0)for(var o=r+1;o<e;o++){var l=this.point.events[o];l.consumedBy===void 0&&i.otherSE.point.events===l.otherSE.point.events&&i.segment.consume(l.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],r=0,i=this.point.events.length;r<i;r++){var o=this.point.events[r];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var r=this,i=new Map,o=function(s){var u=s.otherSE;i.set(s,{sine:zr(r.point,e.point,u.point),cosine:Tr(r.point,e.point,u.point)})};return function(l,s){i.has(l)||o(l),i.has(s)||o(s);var u=i.get(l),f=u.sine,a=u.cosine,v=i.get(s),p=v.sine,y=v.cosine;return f>=0&&p>=0?a<y?1:a>y?-1:0:f<0&&p<0?a<y?-1:a>y?1:0:p<f?-1:p>f?1:0}}}]),n}(),Nr=0,Fe=function(){Q(n,null,[{key:"compare",value:function(e,r){var i=e.leftSE.point.x,o=r.leftSE.point.x,l=e.rightSE.point.x,s=r.rightSE.point.x;if(s<i)return 1;if(l<o)return-1;var u=e.leftSE.point.y,f=r.leftSE.point.y,a=e.rightSE.point.y,v=r.rightSE.point.y;if(i<o){if(f<u&&f<a)return 1;if(f>u&&f>a)return-1;var p=e.comparePoint(r.leftSE.point);if(p<0)return 1;if(p>0)return-1;var y=r.comparePoint(e.rightSE.point);return y!==0?y:-1}if(i>o){if(u<f&&u<v)return-1;if(u>f&&u>v)return 1;var E=r.comparePoint(e.leftSE.point);if(E!==0)return E;var h=e.comparePoint(r.rightSE.point);return h<0?1:h>0?-1:1}if(u<f)return-1;if(u>f)return 1;if(l<s){var g=r.comparePoint(e.rightSE.point);if(g!==0)return g}if(l>s){var w=e.comparePoint(r.rightSE.point);if(w<0)return 1;if(w>0)return-1}if(l!==s){var _=a-u,S=l-i,m=v-f,x=s-o;if(_>S&&m<x)return 1;if(_<S&&m>x)return-1}return l>s?1:l<s||a<v?-1:a>v?1:e.id<r.id?-1:e.id>r.id?1:0}}]);function n(t,e,r,i){K(this,n),this.id=++Nr,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=r,this.windings=i}return Q(n,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<r?e:r},ur:{x:this.rightSE.point.x,y:e>r?e:r}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var r=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(r.x===i.x)return e.x===r.x?0:e.x<r.x?1:-1;var l=(e.y-r.y)/o.y,s=r.x+l*o.x;if(e.x===s)return 0;var u=(e.x-r.x)/o.x,f=r.y+u*o.y;return e.y===f?0:e.y<f?-1:1}},{key:"getIntersection",value:function(e){var r=this.bbox(),i=e.bbox(),o=nt(r,i);if(o===null)return null;var l=this.leftSE.point,s=this.rightSE.point,u=e.leftSE.point,f=e.rightSE.point,a=Ce(r,u)&&this.comparePoint(u)===0,v=Ce(i,l)&&e.comparePoint(l)===0,p=Ce(r,f)&&this.comparePoint(f)===0,y=Ce(i,s)&&e.comparePoint(s)===0;if(v&&a)return y&&!p?s:!y&&p?f:null;if(v)return p&&l.x===f.x&&l.y===f.y?null:l;if(a)return y&&s.x===u.x&&s.y===u.y?null:u;if(y&&p)return null;if(y)return s;if(p)return f;var E=Ar(l,this.vector(),u,e.vector());return E===null||!Ce(o,E)?null:ze.round(E.x,E.y)}},{key:"split",value:function(e){var r=[],i=e.events!==void 0,o=new te(e,!0),l=new te(e,!1),s=this.rightSE;this.replaceRightSE(l),r.push(l),r.push(o);var u=new n(o,s,this.rings.slice(),this.windings.slice());return te.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),te.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),l.checkForConsuming()),r}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var r=0,i=this.windings.length;r<i;r++)this.windings[r]*=-1}},{key:"consume",value:function(e){for(var r=this,i=e;r.consumedBy;)r=r.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=n.compare(r,i);if(o!==0){if(o>0){var l=r;r=i,i=l}if(r.prev===i){var s=r;r=i,i=s}for(var u=0,f=i.rings.length;u<f;u++){var a=i.rings[u],v=i.windings[u],p=r.rings.indexOf(a);p===-1?(r.rings.push(a),r.windings.push(v)):r.windings[p]+=v}i.rings=null,i.windings=null,i.consumedBy=r,i.leftSE.consumedBy=r.leftSE,i.rightSE.consumedBy=r.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var r=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,l=0,s=this.rings.length;l<s;l++){var u=this.rings[l],f=this.windings[l],a=r.indexOf(u);a===-1?(r.push(u),i.push(f)):i[a]+=f}for(var v=[],p=[],y=0,E=r.length;y<E;y++)if(i[y]!==0){var h=r[y],g=h.poly;if(p.indexOf(g)===-1)if(h.isExterior)v.push(g);else{p.indexOf(g)===-1&&p.push(g);var w=v.indexOf(h.poly);w!==-1&&v.splice(w,1)}}for(var _=0,S=v.length;_<S;_++){var m=v[_].multiPoly;o.indexOf(m)===-1&&o.push(m)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(J.type){case"union":{var i=e.length===0,o=r.length===0;this._isInResult=i!==o;break}case"intersection":{var l,s;e.length<r.length?(l=e.length,s=r.length):(l=r.length,s=e.length),this._isInResult=s===J.numMultiPolys&&l<s;break}case"xor":{var u=Math.abs(e.length-r.length);this._isInResult=u%2===1;break}case"difference":{var f=function(v){return v.length===1&&v[0].isSubject};this._isInResult=f(e)!==f(r);break}default:throw new Error("Unrecognized operation type found ".concat(J.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,r,i){var o,l,s,u=te.comparePoints(e,r);if(u<0)o=e,l=r,s=1;else if(u>0)o=r,l=e,s=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var f=new te(o,!0),a=new te(l,!1);return new n(f,a,[i],[s])}}]),n}(),Tt=function(){function n(t,e,r){if(K(this,n),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=ze.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,l=1,s=t.length;l<s;l++){if(typeof t[l][0]!="number"||typeof t[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=ze.round(t[l][0],t[l][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Fe.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(Fe.fromRing(o,i,this))}return Q(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.segments.length;r<i;r++){var o=this.segments[r];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),n}(),Br=function(){function n(t,e){if(K(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Tt(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var r=1,i=t.length;r<i;r++){var o=new Tt(t[r],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}return Q(n,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),r=0,i=this.interiorRings.length;r<i;r++)for(var o=this.interiorRings[r].getSweepEvents(),l=0,s=o.length;l<s;l++)e.push(o[l]);return e}}]),n}(),At=function(){function n(t,e){if(K(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,i=t.length;r<i;r++){var o=new Br(t[r],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}return Q(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++)for(var o=this.polys[r].getSweepEvents(),l=0,s=o.length;l<s;l++)e.push(o[l]);return e}}]),n}(),Gr=function(){Q(n,null,[{key:"factory",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var l=e[i];if(!(!l.isInResult()||l.ringOut)){for(var s=null,u=l.leftSE,f=l.rightSE,a=[u],v=u.point,p=[];s=u,u=f,a.push(u),u.point!==v;)for(;;){var y=u.getAvailableLinkedEvents();if(y.length===0){var E=a[0].point,h=a[a.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(E.x,",")+" ".concat(E.y,"]. Last matching segment found ends at")+" [".concat(h.x,", ").concat(h.y,"]."))}if(y.length===1){f=y[0].otherSE;break}for(var g=null,w=0,_=p.length;w<_;w++)if(p[w].point===u.point){g=w;break}if(g!==null){var S=p.splice(g)[0],m=a.splice(S.index);m.unshift(m[0].otherSE),r.push(new n(m.reverse()));continue}p.push({index:a.length,point:u.point});var x=u.getLeftmostComparator(s);f=y.sort(x)[0].otherSE;break}r.push(new n(a))}}return r}}]);function n(t){K(this,n),this.events=t;for(var e=0,r=t.length;e<r;e++)t[e].segment.ringOut=this;this.poly=null}return Q(n,[{key:"getGeom",value:function(){for(var e=this.events[0].point,r=[e],i=1,o=this.events.length-1;i<o;i++){var l=this.events[i].point,s=this.events[i+1].point;Ot(l,e,s)!==0&&(r.push(l),e=l)}if(r.length===1)return null;var u=r[0],f=r[1];Ot(u,e,f)===0&&r.shift(),r.push(r[0]);for(var a=this.isExteriorRing()?1:-1,v=this.isExteriorRing()?0:r.length-1,p=this.isExteriorRing()?r.length:-1,y=[],E=v;E!=p;E+=a)y.push([r[E].x,r[E].y]);return y}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],r=1,i=this.events.length;r<i;r++){var o=this.events[r];te.compare(e,o)>0&&(e=o)}for(var l=e.segment.prevInResult(),s=l?l.prevInResult():null;;){if(!l)return null;if(!s)return l.ringOut;if(s.ringOut!==l.ringOut)return s.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=s.prevInResult(),s=l?l.prevInResult():null}}}]),n}(),Nt=function(){function n(t){K(this,n),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Q(n,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var r=0,i=this.interiorRings.length;r<i;r++){var o=this.interiorRings[r].getGeom();o!==null&&e.push(o)}return e}}]),n}(),qr=function(){function n(t){K(this,n),this.rings=t,this.polys=this._composePolys(t)}return Q(n,[{key:"getGeom",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++){var o=this.polys[r].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var l=e[i];if(!l.poly)if(l.isExteriorRing())r.push(new Nt(l));else{var s=l.enclosingRing();s.poly||r.push(new Nt(s)),s.poly.addInterior(l)}}return r}}]),n}(),Dr=function(){function n(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fe.compare;K(this,n),this.queue=t,this.tree=new $e(e),this.segments=[]}return Q(n,[{key:"process",value:function(e){var r=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(r),i;var o=e.isLeft?this.tree.insert(r):this.tree.find(r);if(!o)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var l=o,s=o,u=void 0,f=void 0;u===void 0;)l=this.tree.prev(l),l===null?u=null:l.key.consumedBy===void 0&&(u=l.key);for(;f===void 0;)s=this.tree.next(s),s===null?f=null:s.key.consumedBy===void 0&&(f=s.key);if(e.isLeft){var a=null;if(u){var v=u.getIntersection(r);if(v!==null&&(r.isAnEndpoint(v)||(a=v),!u.isAnEndpoint(v)))for(var p=this._splitSafely(u,v),y=0,E=p.length;y<E;y++)i.push(p[y])}var h=null;if(f){var g=f.getIntersection(r);if(g!==null&&(r.isAnEndpoint(g)||(h=g),!f.isAnEndpoint(g)))for(var w=this._splitSafely(f,g),_=0,S=w.length;_<S;_++)i.push(w[_])}if(a!==null||h!==null){var m=null;if(a===null)m=h;else if(h===null)m=a;else{var x=te.comparePoints(a,h);m=x<=0?a:h}this.queue.remove(r.rightSE),i.push(r.rightSE);for(var k=r.split(m),O=0,I=k.length;O<I;O++)i.push(k[O])}i.length>0?(this.tree.remove(r),i.push(e)):(this.segments.push(r),r.prev=u)}else{if(u&&f){var R=u.getIntersection(f);if(R!==null){if(!u.isAnEndpoint(R))for(var z=this._splitSafely(u,R),j=0,b=z.length;j<b;j++)i.push(z[j]);if(!f.isAnEndpoint(R))for(var C=this._splitSafely(f,R),U=0,Z=C.length;U<Z;U++)i.push(C[U])}}this.tree.remove(r)}return i}},{key:"_splitSafely",value:function(e,r){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(r);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),n}(),Bt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Qr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Ur=function(){function n(){K(this,n)}return Q(n,[{key:"run",value:function(e,r,i){J.type=e,ze.reset();for(var o=[new At(r,!0)],l=0,s=i.length;l<s;l++)o.push(new At(i[l],!1));if(J.numMultiPolys=o.length,J.type==="difference")for(var u=o[0],f=1;f<o.length;)nt(o[f].bbox,u.bbox)!==null?f++:o.splice(f,1);if(J.type==="intersection"){for(var a=0,v=o.length;a<v;a++)for(var p=o[a],y=a+1,E=o.length;y<E;y++)if(nt(p.bbox,o[y].bbox)===null)return[]}for(var h=new $e(te.compare),g=0,w=o.length;g<w;g++)for(var _=o[g].getSweepEvents(),S=0,m=_.length;S<m;S++)if(h.insert(_[S]),h.size>Bt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var x=new Dr(h),k=h.size,O=h.pop();O;){var I=O.key;if(h.size===k){var R=I.segment;throw new Error("Unable to pop() ".concat(I.isLeft?"left":"right"," SweepEvent ")+"[".concat(I.point.x,", ").concat(I.point.y,"] from segment #").concat(R.id," ")+"[".concat(R.leftSE.point.x,", ").concat(R.leftSE.point.y,"] -> ")+"[".concat(R.rightSE.point.x,", ").concat(R.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(h.size>Bt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(x.segments.length>Qr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var z=x.process(I),j=0,b=z.length;j<b;j++){var C=z[j];C.consumedBy===void 0&&h.insert(C)}k=h.size,O=h.pop()}ze.reset();var U=Gr.factory(x.segments),Z=new qr(U);return Z.getGeom()}}]),n}(),J=new Ur,Fr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return J.run("union",t,r)},Vr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return J.run("intersection",t,r)},Yr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return J.run("xor",t,r)},Xr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return J.run("difference",t,r)},Ae={union:Fr,intersection:Vr,xor:Yr,difference:Xr};function Gt(n,t){var e=jr(t),r=null;return n.type==="FeatureCollection"?r=Wr(n):r=qt(Ae.union(n.geometry.coordinates)),r.geometry.coordinates.forEach(function(i){e.geometry.coordinates.push(i[0])}),e}function Wr(n){var t=n.features.length===2?Ae.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):Ae.union.apply(Ae,n.features.map(function(e){return e.geometry.coordinates}));return qt(t)}function qt(n){return Pt(n)}function jr(n){var t=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],e=n&&n.geometry.coordinates||t;return kt(e)}function Dt(n){return n.type==="Feature"?n.geometry:n}function Zr(n,t,e){e===void 0&&(e={});var r=Dt(n),i=Dt(t),o=Ae.union(r.coordinates,i.coordinates);return o.length===0?null:o.length===1?kt(o[0],e.properties):Pt(o,e.properties)}let Qt={type:"FeatureCollection",features:[]};function Ut(n,t,e=!0,r=!0,i={},o={}){let l,s,u,f=[],a;function v(){n.addSource("preview",{type:"geojson",data:Qt}),n.addLayer({id:"preview-fill",type:"fill",source:"preview",layout:{},paint:{"fill-color":"#000","fill-opacity":.1},filter:["==",["geometry-type"],"Polygon"]}),n.addLayer({id:"preview-line",type:"line",source:"preview",layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"}})}n.loaded()?v():n.once("load",()=>{v()});const p=h=>{s==null||s([h.lngLat.lng,h.lngLat.lat])},y=()=>{let h;const g=n.getZoom()>9?[(h=n.getCenter().wrap()).lng,h.lat]:void 0;u!==g&&(u=g,l==null||l(g))};return{setProximityChangeHandler(h){h?(l=h,n.on("moveend",y),y()):(n.off("moveend",y),l==null||l(void 0),l=void 0)},setMapClickHandler(h){s=h,s?n.on("click",p):n.off("click",p)},flyTo(h,g){n.flyTo({center:h,zoom:g,...i})},fitBounds(h,g){n.fitBounds([[h[0],h[1]],[h[2],h[3]]],{padding:g,...o})},indicateReverse(h){n.getCanvas().style.cursor=h?"crosshair":""},setMarkers(h,g){function w(_){var S;(S=n.getSource("preview"))==null||S.setData(_)}for(const _ of f)_.remove();if(w(Qt),f.length=0,!!t){if(g){let _=!1;if(g.geometry.type==="GeometryCollection"){const m=g.geometry.geometries.filter(x=>x.type==="Polygon"||x.type==="MultiPolygon");if(m.length>0){let x=m.pop();for(const k of m)x=Zr(x,k);w(Gt({...g,geometry:x})),_=!0}else{const x=g.geometry.geometries.filter(k=>k.type==="LineString"||k.type==="MultiLineString");x.length>0&&(w({...g,geometry:{type:"GeometryCollection",geometries:x}}),_=!0)}}let S;if(!_){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")w(Gt(g));else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){w(g);return}}if(typeof e=="object")S=new t.Marker(e);else{const m=document.createElement("div");new He({props:{displayIn:"maplibre"},target:m}),S=new t.Marker({element:m})}S&&f.push(S.setLngLat(g.center).addTo(n))}for(const _ of h!=null?h:[]){if(_===g)continue;let S;if(typeof r=="object")S=new t.Marker(r);else{const m=document.createElement("div");new He({props:{displayIn:"maplibre"},target:m}),S=new t.Marker({element:m})}f.push(S.setLngLat(_.center).addTo(n))}}},setSelectedMarker(h){a&&a.getElement().classList.toggle("marker-selected",!1),a=h>-1?f[h]:void 0,a==null||a.getElement().classList.toggle("marker-selected",!0)}}}class Hr extends N.Evented{constructor(e){super();ft(this,$,void 0);ft(this,ye,void 0);Ye(this,ye,e)}onAdd(e){const r=document.createElement("div");r.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl";const{maplibregl:i,marker:o,showResultMarkers:l,flyTo:s,...u}=ne(this,ye),f=typeof s=="boolean"?{}:s,a=Ut(e,i,o,l,f,f);Ye(this,$,new Sr({target:r,props:{mapController:a,flyTo:s===void 0?!0:!!s,...u}}));for(const v of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])ne(this,$).$on(v,p=>this.fire(v.toLowerCase(),p.detail));return r}setOptions(e){var u;Ye(this,ye,e);const{maplibregl:r,marker:i,showResultMarkers:o,flyTo:l,...s}=ne(this,ye);(u=ne(this,$))==null||u.$set(s)}setQuery(e,r=!0){var i;(i=ne(this,$))==null||i.setQuery(e,r)}setReverseMode(e){var r;(r=ne(this,$))==null||r.$set({reverseActive:e})}focus(){var e;(e=ne(this,$))==null||e.focus()}blur(){var e;(e=ne(this,$))==null||e.blur()}onRemove(){var e;(e=ne(this,$))==null||e.$destroy()}}$=new WeakMap,ye=new WeakMap,T.GeocodingControl=Hr,T.createMaplibreglMapController=Ut,Object.defineProperties(T,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 1000 1000" width="18px" height="18px">
|
|
2
|
-
<path
|
|
3
|
-
d="M500 115.1c212.2 0 384.9 172.6 384.9 384.9 0 212.2-172.7 384.9-384.9 384.9S115.1 712.2 115.1 500c0-212.4 172.5-384.9 384.9-384.9M500 10C229.4 10 10 229.4 10 500s219.4 490 490 490 490-219.4 490-490c-.2-270.6-219.5-490-490-490zm0 315c96.5 0 175 78.4 175 175 0 96.5-78.4 175-175 175-96.5 0-175-78.4-175-175 0-96.5 78.4-175 175-175m0-105c-154.7 0-279.9 125.4-279.9 279.9 0 154.7 125.4 279.9 279.9 279.9 154.5 0 279.9-125.4 279.9-279.9C779.9 345.3 654.5 220 500 220zm70 280c0 38.7-31.3 70-70 70s-70-31.3-70-70 31.3-70 70-70 70 31.3 70 70z"
|
|
4
|
-
/>
|
|
5
|
-
</svg>
|
|
6
|
-
|
|
7
|
-
<style>
|
|
8
|
-
svg {
|
|
9
|
-
display: block;
|
|
10
|
-
fill: var(--color-icon-button);
|
|
11
|
-
}
|
|
12
|
-
</style>
|