@arenarium/maps 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.css +1 -81
- package/dist/main.d.ts +3 -230
- package/dist/main.js +1 -13
- package/package.json +95 -86
package/dist/main.css
CHANGED
|
@@ -1,81 +1 @@
|
|
|
1
|
-
.pin.svelte-
|
|
2
|
-
position: absolute;
|
|
3
|
-
border-style: solid;
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
transform-origin: 0% 0%;
|
|
6
|
-
transform: translate(-50%, -50%);
|
|
7
|
-
backface-visibility: hidden;
|
|
8
|
-
will-change: scale;
|
|
9
|
-
}
|
|
10
|
-
.pin.svelte-10kxbrm {
|
|
11
|
-
display: none;
|
|
12
|
-
content-visibility: hidden;
|
|
13
|
-
}
|
|
14
|
-
.pin.displayed.svelte-10kxbrm {
|
|
15
|
-
display: initial;
|
|
16
|
-
content-visibility: initial;
|
|
17
|
-
}
|
|
18
|
-
.pin.svelte-10kxbrm {
|
|
19
|
-
opacity: 1;
|
|
20
|
-
}
|
|
21
|
-
.pin.suppressed.svelte-10kxbrm {
|
|
22
|
-
opacity: 0.5;
|
|
23
|
-
box-shadow: none !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.element.svelte-1no6o2a {
|
|
27
|
-
box-sizing: border-box;
|
|
28
|
-
}
|
|
29
|
-
.anchor.svelte-1no6o2a {
|
|
30
|
-
display: block;
|
|
31
|
-
position: absolute;
|
|
32
|
-
width: 0px;
|
|
33
|
-
height: 0px;
|
|
34
|
-
transition: filter ease-in-out 125ms;
|
|
35
|
-
}
|
|
36
|
-
.anchor.svelte-1no6o2a .pointer:where(.svelte-1no6o2a) {
|
|
37
|
-
position: absolute;
|
|
38
|
-
left: 0px;
|
|
39
|
-
top: 0px;
|
|
40
|
-
border-radius: 1px;
|
|
41
|
-
transform-origin: 0% 0%;
|
|
42
|
-
}
|
|
43
|
-
.anchor.svelte-1no6o2a .tooltip:where(.svelte-1no6o2a) {
|
|
44
|
-
position: absolute;
|
|
45
|
-
left: 0px;
|
|
46
|
-
top: 0px;
|
|
47
|
-
}
|
|
48
|
-
.anchor.svelte-1no6o2a .tooltip:where(.svelte-1no6o2a) .body:where(.svelte-1no6o2a) {
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
}
|
|
51
|
-
.anchor.svelte-1no6o2a {
|
|
52
|
-
opacity: 0;
|
|
53
|
-
will-change: opacity;
|
|
54
|
-
}
|
|
55
|
-
.anchor.svelte-1no6o2a .pointer:where(.svelte-1no6o2a) {
|
|
56
|
-
scale: 0;
|
|
57
|
-
transform-origin: 0% 0%;
|
|
58
|
-
will-change: transform, scale;
|
|
59
|
-
}
|
|
60
|
-
.anchor.svelte-1no6o2a .tooltip:where(.svelte-1no6o2a) {
|
|
61
|
-
scale: 0;
|
|
62
|
-
transform-origin: 0% 0%;
|
|
63
|
-
will-change: transform, scale;
|
|
64
|
-
}
|
|
65
|
-
.anchor.svelte-1no6o2a {
|
|
66
|
-
display: none;
|
|
67
|
-
content-visibility: hidden;
|
|
68
|
-
}
|
|
69
|
-
.anchor.displayed.svelte-1no6o2a {
|
|
70
|
-
display: initial;
|
|
71
|
-
content-visibility: initial;
|
|
72
|
-
}
|
|
73
|
-
.body.svelte-1no6o2a {
|
|
74
|
-
backface-visibility: initial;
|
|
75
|
-
transform-style: initial;
|
|
76
|
-
}
|
|
77
|
-
.body.svelte-1no6o2a:hover {
|
|
78
|
-
backface-visibility: hidden;
|
|
79
|
-
transform-style: preserve-3d;
|
|
80
|
-
}
|
|
81
|
-
|
|
1
|
+
.pin.svelte-e30vfn4rttu1{position:absolute;box-sizing:border-box;transform-origin:0% 0%;backface-visibility:hidden;will-change:scale;border-style:solid;transform:translate(-50%,-50%)}.pin.svelte-e30vfn4rttu1{display:none;content-visibility:hidden}.pin.displayed.svelte-e30vfn4rttu1{display:initial;content-visibility:initial}.pin.svelte-e30vfn4rttu1{opacity:1}.pin.suppressed.svelte-e30vfn4rttu1{opacity:.5;box-shadow:none!important}.element.svelte-vkqe2rkto2oe{box-sizing:border-box}.anchor.svelte-vkqe2rkto2oe{display:block;position:absolute;width:0;height:0;transition:filter .125s ease-in-out}.anchor.svelte-vkqe2rkto2oe>.pointer:where(.svelte-vkqe2rkto2oe){position:absolute;transform-origin:0% 0%;border-radius:1px;top:0;left:0}.anchor.svelte-vkqe2rkto2oe>.tooltip:where(.svelte-vkqe2rkto2oe){position:absolute;top:0;left:0}.anchor.svelte-vkqe2rkto2oe>.tooltip:where(.svelte-vkqe2rkto2oe)>.body:where(.svelte-vkqe2rkto2oe){cursor:pointer}.anchor.svelte-vkqe2rkto2oe{opacity:0;will-change:opacity}.anchor.svelte-vkqe2rkto2oe>.pointer:where(.svelte-vkqe2rkto2oe){transform-origin:0% 0%;will-change:transform,scale;scale:0}.anchor.svelte-vkqe2rkto2oe>.tooltip:where(.svelte-vkqe2rkto2oe){transform-origin:0% 0%;will-change:transform,scale;scale:0}.anchor.svelte-vkqe2rkto2oe{display:none;content-visibility:hidden}.anchor.displayed.svelte-vkqe2rkto2oe{display:initial;content-visibility:initial}.body.svelte-vkqe2rkto2oe{backface-visibility:initial;transform-style:initial}.body.svelte-vkqe2rkto2oe:hover{backface-visibility:hidden;transform-style:preserve-3d}
|
package/dist/main.d.ts
CHANGED
|
@@ -1,230 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const mapConfigurationSchema: v.ObjectSchema<{
|
|
6
|
-
readonly pin: v.OptionalSchema<v.ObjectSchema<{
|
|
7
|
-
readonly fade: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
8
|
-
readonly maxZoom: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
9
|
-
}, undefined>, undefined>;
|
|
10
|
-
readonly popup: v.OptionalSchema<v.ObjectSchema<{
|
|
11
|
-
readonly pan: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
12
|
-
}, undefined>, undefined>;
|
|
13
|
-
readonly process: v.OptionalSchema<v.ObjectSchema<{
|
|
14
|
-
readonly visibility: v.OptionalSchema<v.ObjectSchema<{
|
|
15
|
-
readonly limit: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
16
|
-
readonly cell: v.OptionalSchema<v.ObjectSchema<{
|
|
17
|
-
readonly size: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
18
|
-
readonly capacity: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
19
|
-
readonly depth: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
20
|
-
}, undefined>, undefined>;
|
|
21
|
-
}, undefined>, undefined>;
|
|
22
|
-
readonly states: v.OptionalSchema<v.ObjectSchema<{
|
|
23
|
-
readonly delay: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
24
|
-
}, undefined>, undefined>;
|
|
25
|
-
}, undefined>, undefined>;
|
|
26
|
-
readonly events: v.OptionalSchema<v.ObjectSchema<{
|
|
27
|
-
readonly error: v.OptionalSchema<v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>, v.UnknownSchema], undefined>>, v.ReturnsAction<(args_0: string, args_1: unknown) => unknown, v.VoidSchema<undefined>>]>, undefined>;
|
|
28
|
-
}, undefined>, undefined>;
|
|
29
|
-
}, undefined>;
|
|
30
|
-
type MapConfiguration = v.InferOutput<typeof mapConfigurationSchema>;
|
|
31
|
-
declare const mapCoordinatesSchema: v.ObjectSchema<{
|
|
32
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
33
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
34
|
-
}, undefined>;
|
|
35
|
-
declare const mapBoundsSchema: v.ObjectSchema<{
|
|
36
|
-
readonly sw: v.ObjectSchema<{
|
|
37
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
38
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
39
|
-
}, undefined>;
|
|
40
|
-
readonly ne: v.ObjectSchema<{
|
|
41
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
42
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
43
|
-
}, undefined>;
|
|
44
|
-
}, undefined>;
|
|
45
|
-
declare const mapViewportSchema: v.ObjectSchema<{
|
|
46
|
-
readonly bounds: v.ObjectSchema<{
|
|
47
|
-
readonly sw: v.ObjectSchema<{
|
|
48
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
49
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
50
|
-
}, undefined>;
|
|
51
|
-
readonly ne: v.ObjectSchema<{
|
|
52
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
53
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
54
|
-
}, undefined>;
|
|
55
|
-
}, undefined>;
|
|
56
|
-
readonly center: v.ObjectSchema<{
|
|
57
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
58
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
59
|
-
}, undefined>;
|
|
60
|
-
readonly zoom: v.NumberSchema<undefined>;
|
|
61
|
-
}, undefined>;
|
|
62
|
-
declare const mapProviderParametersSchema: v.ObjectSchema<{
|
|
63
|
-
readonly mapSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
64
|
-
readonly zoomMin: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
65
|
-
readonly zoomMax: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
66
|
-
readonly zoomScale: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10, undefined>]>;
|
|
67
|
-
}, undefined>;
|
|
68
|
-
declare const mapProviderMarkerSchema: v.ObjectSchema<{
|
|
69
|
-
readonly inserted: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.BooleanSchema<undefined>>]>;
|
|
70
|
-
readonly insert: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.VoidSchema<undefined>>]>;
|
|
71
|
-
readonly remove: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.VoidSchema<undefined>>]>;
|
|
72
|
-
readonly update: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.NumberSchema<undefined>], undefined>>, v.ReturnsAction<(args_0: number) => unknown, v.VoidSchema<undefined>>]>;
|
|
73
|
-
}, undefined>;
|
|
74
|
-
declare const mapProviderEventSchema: v.UnionSchema<[v.LiteralSchema<"idle", undefined>, v.LiteralSchema<"move", undefined>, v.LiteralSchema<"click", undefined>], undefined>;
|
|
75
|
-
declare const mapProviderSchema: v.ObjectSchema<{
|
|
76
|
-
readonly getParameters: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.ObjectSchema<{
|
|
77
|
-
readonly mapSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
78
|
-
readonly zoomMin: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
79
|
-
readonly zoomMax: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
80
|
-
readonly zoomScale: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10, undefined>]>;
|
|
81
|
-
}, undefined>>]>;
|
|
82
|
-
readonly getContainer: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>>]>;
|
|
83
|
-
readonly getZoom: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.NumberSchema<undefined>>]>;
|
|
84
|
-
readonly getBounds: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.ObjectSchema<{
|
|
85
|
-
readonly sw: v.ObjectSchema<{
|
|
86
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
87
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
88
|
-
}, undefined>;
|
|
89
|
-
readonly ne: v.ObjectSchema<{
|
|
90
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
91
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
92
|
-
}, undefined>;
|
|
93
|
-
}, undefined>>]>;
|
|
94
|
-
readonly getCenter: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.ObjectSchema<{
|
|
95
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
96
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
97
|
-
}, undefined>>]>;
|
|
98
|
-
readonly getViewport: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.ObjectSchema<{
|
|
99
|
-
readonly bounds: v.ObjectSchema<{
|
|
100
|
-
readonly sw: v.ObjectSchema<{
|
|
101
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
102
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
103
|
-
}, undefined>;
|
|
104
|
-
readonly ne: v.ObjectSchema<{
|
|
105
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
106
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
107
|
-
}, undefined>;
|
|
108
|
-
}, undefined>;
|
|
109
|
-
readonly center: v.ObjectSchema<{
|
|
110
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
111
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
112
|
-
}, undefined>;
|
|
113
|
-
readonly zoom: v.NumberSchema<undefined>;
|
|
114
|
-
}, undefined>>]>;
|
|
115
|
-
readonly panBy: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.NumberSchema<undefined>, v.NumberSchema<undefined>], undefined>>, v.ReturnsAction<(args_0: number, args_1: number) => unknown, v.VoidSchema<undefined>>]>;
|
|
116
|
-
readonly createMarker: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>, v.NumberSchema<undefined>], undefined>>, v.ReturnsAction<(args_0: HTMLElement, args_1: number, args_2: number, args_3: number) => unknown, v.ObjectSchema<{
|
|
117
|
-
readonly inserted: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.BooleanSchema<undefined>>]>;
|
|
118
|
-
readonly insert: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.VoidSchema<undefined>>]>;
|
|
119
|
-
readonly remove: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[], undefined>>, v.ReturnsAction<() => unknown, v.VoidSchema<undefined>>]>;
|
|
120
|
-
readonly update: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.NumberSchema<undefined>], undefined>>, v.ReturnsAction<(args_0: number) => unknown, v.VoidSchema<undefined>>]>;
|
|
121
|
-
}, undefined>>]>;
|
|
122
|
-
readonly subscribe: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.UnionSchema<[v.LiteralSchema<"idle", undefined>, v.LiteralSchema<"move", undefined>, v.LiteralSchema<"click", undefined>], undefined>, v.FunctionSchema<undefined>], undefined>>, v.ReturnsAction<(args_0: "idle" | "move" | "click", args_1: (...args: unknown[]) => unknown) => unknown, v.VoidSchema<undefined>>]>;
|
|
123
|
-
readonly unsubscribe: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.UnionSchema<[v.LiteralSchema<"idle", undefined>, v.LiteralSchema<"move", undefined>, v.LiteralSchema<"click", undefined>], undefined>, v.FunctionSchema<undefined>], undefined>>, v.ReturnsAction<(args_0: "idle" | "move" | "click", args_1: (...args: unknown[]) => unknown) => unknown, v.VoidSchema<undefined>>]>;
|
|
124
|
-
}, undefined>;
|
|
125
|
-
type MapCoordinates = v.InferOutput<typeof mapCoordinatesSchema>;
|
|
126
|
-
type MapBounds = v.InferOutput<typeof mapBoundsSchema>;
|
|
127
|
-
type MapViewport = v.InferOutput<typeof mapViewportSchema>;
|
|
128
|
-
type MapProviderParameters = v.InferOutput<typeof mapProviderParametersSchema>;
|
|
129
|
-
type MapProviderMarker = v.InferOutput<typeof mapProviderMarkerSchema>;
|
|
130
|
-
type MapProviderEvent = v.InferOutput<typeof mapProviderEventSchema>;
|
|
131
|
-
type MapProvider = v.InferOutput<typeof mapProviderSchema>;
|
|
132
|
-
declare const mapMarkerDataSchema: v.ObjectSchema<{
|
|
133
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
134
|
-
readonly rank: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
135
|
-
readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
136
|
-
readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
|
|
137
|
-
readonly tooltip: v.ObjectSchema<{
|
|
138
|
-
readonly style: v.ObjectSchema<{
|
|
139
|
-
readonly dimensions: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
140
|
-
readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
141
|
-
readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
142
|
-
readonly margin: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
143
|
-
readonly radius: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
144
|
-
}, undefined>, v.CheckAction<{
|
|
145
|
-
width: number;
|
|
146
|
-
height: number;
|
|
147
|
-
margin: number;
|
|
148
|
-
radius: number;
|
|
149
|
-
}, "Minimum of width or height must be greater than or equal to 4 * margin">]>;
|
|
150
|
-
readonly colors: v.OptionalSchema<v.ObjectSchema<{
|
|
151
|
-
readonly background: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
152
|
-
readonly shadow: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
153
|
-
}, undefined>, undefined>;
|
|
154
|
-
}, undefined>;
|
|
155
|
-
readonly body: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>;
|
|
156
|
-
}, undefined>;
|
|
157
|
-
readonly pin: v.OptionalSchema<v.ObjectSchema<{
|
|
158
|
-
readonly style: v.ObjectSchema<{
|
|
159
|
-
readonly dimensions: v.ObjectSchema<{
|
|
160
|
-
readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
161
|
-
readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
162
|
-
readonly padding: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
163
|
-
readonly radius: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
164
|
-
}, undefined>;
|
|
165
|
-
readonly colors: v.OptionalSchema<v.ObjectSchema<{
|
|
166
|
-
readonly background: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
167
|
-
readonly border: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
168
|
-
readonly shadow: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
169
|
-
}, undefined>, undefined>;
|
|
170
|
-
}, undefined>;
|
|
171
|
-
readonly body: v.OptionalSchema<v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>, undefined>;
|
|
172
|
-
}, undefined>, undefined>;
|
|
173
|
-
readonly popup: v.OptionalSchema<v.ObjectSchema<{
|
|
174
|
-
readonly style: v.ObjectSchema<{
|
|
175
|
-
readonly dimensions: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
176
|
-
readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
177
|
-
readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
178
|
-
readonly margin: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
179
|
-
readonly radius: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
180
|
-
}, undefined>, v.CheckAction<{
|
|
181
|
-
width: number;
|
|
182
|
-
height: number;
|
|
183
|
-
margin: number;
|
|
184
|
-
radius: number;
|
|
185
|
-
}, "Minimum of width or height must be greater than or equal to 4 * margin">]>;
|
|
186
|
-
readonly colors: v.OptionalSchema<v.ObjectSchema<{
|
|
187
|
-
readonly background: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
188
|
-
readonly shadow: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
189
|
-
}, undefined>, undefined>;
|
|
190
|
-
}, undefined>;
|
|
191
|
-
readonly body: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>;
|
|
192
|
-
}, undefined>, undefined>;
|
|
193
|
-
}, undefined>;
|
|
194
|
-
type MapMarkerData = v.InferOutput<typeof mapMarkerDataSchema>;
|
|
195
|
-
//#endregion
|
|
196
|
-
//#region src/lib/map/manager.d.ts
|
|
197
|
-
declare class MapManager {
|
|
198
|
-
private apiKey;
|
|
199
|
-
private mapProvider;
|
|
200
|
-
private mapMarkers;
|
|
201
|
-
private mapMarkersVisibilityManager;
|
|
202
|
-
private mapMarkerElementsManager;
|
|
203
|
-
private mapMarkerStatesManager;
|
|
204
|
-
private mapMarkerRenderProcessor;
|
|
205
|
-
private mapMarkerVisibilityProcessor;
|
|
206
|
-
private mapMarkerStateProcessor;
|
|
207
|
-
private mapMarkerStatesProcessDelay;
|
|
208
|
-
private mapMarkerStatesProcessTimeout;
|
|
209
|
-
private mapStateManager;
|
|
210
|
-
private constructor();
|
|
211
|
-
static create(apiKey: string, mapProvider: MapProvider, mapConfiguration?: MapConfiguration): Promise<MapManager>;
|
|
212
|
-
set configuration(configuration: MapConfiguration | undefined);
|
|
213
|
-
private clear;
|
|
214
|
-
private dettached;
|
|
215
|
-
private error;
|
|
216
|
-
private log;
|
|
217
|
-
private onMapClick;
|
|
218
|
-
private onMapMarkerClick;
|
|
219
|
-
private onMapMove;
|
|
220
|
-
private onMapIdle;
|
|
221
|
-
private onMapMarkerVisiblityProcess;
|
|
222
|
-
private onMapMarkerStateProcess;
|
|
223
|
-
private onMapMarkerRenderProcess;
|
|
224
|
-
updateMarkers(markerData: MapMarkerData[]): void;
|
|
225
|
-
removeMarkers(): void;
|
|
226
|
-
showPopup(id: string): void;
|
|
227
|
-
hidePopup(): void;
|
|
228
|
-
}
|
|
229
|
-
//#endregion
|
|
230
|
-
export { type MapBounds, type MapConfiguration, type MapCoordinates, MapManager, type MapMarkerData, type MapProvider, type MapProviderEvent, type MapProviderMarker, type MapProviderParameters, type MapViewport };
|
|
1
|
+
import { MapManager } from "$lib/map/manager";
|
|
2
|
+
import { MapConfiguration, MapProvider, MapProviderParameters, MapProviderMarker, MapProviderEvent, MapMarkerData, MapCoordinates, MapBounds, MapViewport } from "@arenarium/maps-core/schemas";
|
|
3
|
+
export { MapViewport, MapProviderParameters, MapProviderMarker, MapProviderEvent, MapProvider, MapMarkerData, MapManager, MapCoordinates, MapConfiguration, MapBounds };
|
package/dist/main.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import*as e from"valibot";async function t(e){return new Promise(t=>setTimeout(t,e))}async function n(e,n){let r=0,i=Math.max(1,n?.retry??1);for(;r<i;)try{return await e()}catch(e){if(console.log(`[HTTP RETRY] ${r} of ${i}`),console.log(e),r++,r==i)throw e;n?.delay&&await t(n.delay[r-1]??0)}throw Error(`Unreachable code`)}async function r(e,t){let r=await n(async()=>await fetch(e,t));if(!r.ok)throw Error(r.statusText);return r.json()}async function i(e,t,n){let r=await fetch(e,{method:`POST`,body:JSON.stringify(t),headers:{"Content-Type":`application/json`,...n?.headers},...n});if(!r.ok)throw Error(r.statusText);return r.json()}async function a(e,t,n){let r=await fetch(e,{method:`PUT`,body:JSON.stringify(t),headers:{"Content-Type":`application/json`,...n?.headers},...n});if(!r.ok)throw Error(r.statusText)}var o={delay:t,retry:n,get:r,post:i,put:a},s=class{endtime=0;lifespan;paused=!1;enqueued=!1;interval;timeout;callback;constructor(e,t,n){if((t??0)<0)throw Error(`Lifespan must be greater than 0`);if((n??0)<0)throw Error(`Interval must be greater than 0`);this.interval=n??(navigator?.hardwareConcurrency?100:200/navigator.hardwareConcurrency),this.lifespan=t??this.interval,this.callback=e}async run(){let e=performance.now();if(this.enqueued&&=(this.endtime=e+this.lifespan,!1),this.endtime<e){this.stop();return}if(this.paused==0&&await this.callback()&&!this.enqueued){this.stop();return}this.timeout=window.setTimeout(this.run.bind(this),this.interval)}start(){this.enqueued=!0,this.timeout||this.run()}stop(){this.timeout&&window.clearTimeout(this.timeout),this.timeout=void 0}pause(){this.paused=!0}resume(){this.paused=!1}},c=class{callback;timeout;id;constructor(e,t){if(t<=0)throw Error(`Timeout must be greater than 0`);this.callback=e,this.timeout=t}start(){this.id??=window.setInterval(this.callback,this.timeout)}stop(){this.id!=null&&(window.clearInterval(this.id),this.id=void 0)}},l=class{data;state;constructor(e){this.data=e,this.state=void 0}get input(){return{id:this.data.id,rank:this.data.rank,lat:this.data.lat,lng:this.data.lng,width:this.data.tooltip.style.dimensions.width,height:this.data.tooltip.style.dimensions.height,margin:this.data.tooltip.style.dimensions.margin}}},u=class{viewport=void 0;state=`idle`;provider;interval;onCancel;onError;onMove;onIdle;constructor(e,t,n,r,i,a){this.provider=e,this.interval=new c(this.onInterval.bind(this),t),this.onCancel=n,this.onError=r,this.onMove=i,this.onIdle=a}start(){this.interval.start()}stop(){this.interval.stop()}onInterval(){try{if(this.onCancel()){this.interval.stop();return}let e=this.provider.getViewport(),t=this.state,n=JSON.stringify(e)===JSON.stringify(this.viewport)?`idle`:`move`;n==`move`&&this.onMove(),n==`idle`&&t==`move`&&this.onIdle(),this.state=n,this.viewport=e}catch(e){this.onError(`Failed to process map state interval`,e)}}};const d=25e-5,f=3e6,p=.5,m=`white`,ee=`0px 2px 2px rgba(0, 0, 0, 0.5)`;function h(e,t,n){return{x:_(t)*n,y:te(e)*n}}function g(e,t,n){return{lat:ne(t/n),lng:v(e/n)}}function _(e){return(180+e)/360}function te(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function v(e){return e*360-180}function ne(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}var re={project:h,unproject:g},y=class{sw;ne;constructor(e,t,n,r){if(n<e||r<t)throw Error(`Invalid bounds: ${e}, ${t}, ${n}, ${r}`);this.sw={lat:e,lng:t},this.ne={lat:n,lng:r}}contains(e,t){return!(e<this.sw.lat||this.ne.lat<e||t<this.sw.lng||this.ne.lng<t)}intersects(e){return!(e.ne.lat<this.sw.lat||this.ne.lat<e.sw.lat||e.ne.lng<this.sw.lng||this.ne.lng<e.sw.lng)}},b=class e{blockL;blockR;sw;ne;constructor(e,t,n,r){if(n<e)throw Error(`Invalid bounds: ${e}, ${t}, ${n}, ${r}`);this.sw={lat:e,lng:t},this.ne={lat:n,lng:r},t<r?(this.blockL=new y(e,t,n,r),this.blockR=new y(0,0,0,0)):(this.blockL=new y(e,-180,n,r),this.blockR=new y(e,t,n,180))}static normalize(e){let t=e.bounds,n=e.center;if(Math.abs(t.ne.lng-n.lng)+Math.abs(t.sw.lng-n.lng)>360&&(t.sw.lng=-180,t.ne.lng=180),t.ne.lng-t.sw.lng>360){t.sw.lng=-180,t.ne.lng=180;return}t.sw.lng<-180&&(t.sw.lng+=360),t.sw.lng>180&&(t.sw.lng-=360),t.ne.lng<-180&&(t.ne.lng+=360),t.ne.lng>180&&(t.ne.lng-=360)}static bounds(t){this.normalize(t);let n=t.bounds,r=n.sw,i=n.ne;return new e(r.lat,r.lng,i.lat,i.lng)}static offset(t,n,r){this.normalize(t);let i=t.bounds,a=n*2**t.zoom,o=re.project(i.sw.lat,i.sw.lng,a),s=re.project(i.ne.lat,i.ne.lng,a),c=Math.max(o.x-r.left,0),l=Math.min(o.y+r.bottom,a),u=Math.min(s.x+r.right,a),d=Math.max(s.y-r.top,0),f=re.unproject(c,l,a),p=re.unproject(u,d,a);return new e(f.lat,f.lng,p.lat,p.lng)}contains(e,t){return this.blockL.contains(e,t)||this.blockR.contains(e,t)}intersects(e){return this.blockL.intersects(e)||this.blockR.intersects(e)}},x=class{id;bounds;markers;constructor(e,t){this.id=e,this.bounds=t,this.markers=[]}belongs(e){let t=this.bounds.sw;if(e.lat<t.lat||e.lng<t.lng)return!1;let n=this.bounds.ne;return!(n.lat<e.lat||n.lng<e.lng)}neighbours(e,t){let n=Math.abs(e.id.length-this.id.length);if(n>t)return!1;let r=Math.min(this.id.length,e.id.length)-t+n;for(let t=0;t<r;t++)if(this.id[t]!=e.id[t])return!1;return!0}},ie=class e{tree;zoom;cell;branches;constructor(e,t,n,r){this.tree=e,this.zoom=n,this.cell=new x(t,r),this.branches=[]}split(){let t=this.cell.bounds,n=2**this.tree.depth,r=(t.ne.lat-t.sw.lat)/n,i=(t.ne.lng-t.sw.lng)/n;for(let a=0;a<n;a++)for(let o=0;o<n;o++){let n=t.sw.lat+a*r,s=t.sw.lng+o*i,c=n+r,l=s+i;this.branches.push(new e(this.tree,`${this.cell.id}${a*2+o}`,this.zoom+this.tree.depth,{sw:{lat:n,lng:s},ne:{lat:c,lng:l}}))}}add(e){if(this.cell.belongs(e.data)==0)return!1;if(this.cell.markers.length<this.tree.capacity)return this.cell.markers.push(e),!0;this.branches.length==0&&this.split();for(let t=0;t<this.branches.length;t++)if(this.branches[t].add(e))return!0;throw Error(`Failed to add marker to branch`)}compact(){if(this.branches.length==0)return;for(let e=0;e<this.branches.length;e++)this.branches[e].compact();let t=[],n=[];for(let e=0;e<this.branches.length;e++){let r=this.branches[e];t.push(...r.branches),n.push(...r.cell.markers)}let r=new e(this.tree,this.cell.id,this.zoom+this.tree.depth,this.cell.bounds);r.branches=t,r.cell.markers=n,this.branches=[r]}cells(e,t,n){if(e<this.zoom||t.intersects(this.cell.bounds)==0)return n;n.push(this.cell);for(let r=0;r<this.branches.length;r++)this.branches[r].cells(e,t,n);return n}print(e){console.log(`${`---`.repeat(e)}|${this.cell.id} zoom=[${this.zoom}] markers=[${this.cell.markers.length}]`);for(let t=0;t<this.branches.length;t++)this.branches[t].print(e+1)}count(){return this.cell.markers.length+this.branches.reduce((e,t)=>e+t.count(),0)}},ae=class{capacity;depth;root;constructor(e,t,n){this.capacity=n,this.depth=t,this.root=new ie(this,`R`,e,{sw:{lat:-90,lng:-180},ne:{lat:90,lng:180}})}add(e){return this.root.add(e)}compact(){this.root.compact()}cells(e,t){let n=[];return this.root.cells(e,t,n),n}print(){this.root.print(0)}};const oe=1024;var se=class{mapProvider;mapMarkersVisibilityTree;mapMarkersVisible;mapMarkerTreeCellCapacity=2;mapMarkerTreeCellZoomDelta=1;mapMarkerTreeCellSize=64;mapMarkerTreeLimit=oe;constructor(e){this.mapProvider=e}set configuration(e){this.mapMarkerTreeCellCapacity=e?.process?.visibility?.cell?.capacity??2,this.mapMarkerTreeCellZoomDelta=e?.process?.visibility?.cell?.depth??1,this.mapMarkerTreeCellSize=e?.process?.visibility?.cell?.size??64,this.mapMarkerTreeLimit=e?.process?.visibility?.limit??oe}get markers(){return Array.from(this.mapMarkersVisible??[])}insertMarkers(e){this.mapMarkersVisibilityTree=this.createVisibilityTree(e)}clearMarkers(){this.mapMarkersVisibilityTree=void 0,this.mapMarkersVisible=void 0}updateVisibleMarkers(e,t){if(this.mapMarkersVisibilityTree==null)return;let n=b.bounds(e),r=[],i=e.zoom;for(;i<t.zoomMax&&r.length<this.mapMarkerTreeLimit;)r=this.mapMarkersVisibilityTree.cells(i,n).flatMap(e=>e.markers),i++;this.mapMarkersVisible=r}createVisibilityTree(e){if(e.length<this.mapMarkerTreeLimit){let t=new ae(0,0,e.length);for(let n=0;n<e.length;n++){let r=e[n];if(!t.add(r))throw Error(`Failed to add marker to fill tree`)}return t}else{let t=-Math.floor(Math.log2(this.mapProvider.getParameters().mapSize/this.mapMarkerTreeCellSize)),n=new ae(t,this.mapMarkerTreeCellZoomDelta,this.mapMarkerTreeCellCapacity);for(let t=0;t<e.length;t++){let r=e[t];if(!n.add(r))throw Error(`Failed to add marker to fill tree`)}let r=-t;for(let e=0;e<r;e++)n.compact();return n}}};const ce=globalThis.process?.env?.NODE_ENV;var S=ce&&!ce.toLowerCase().startsWith(`prod`),le=Array.isArray,ue=Array.prototype.indexOf,C=Array.from;Object.keys;var w=Object.defineProperty,T=Object.getOwnPropertyDescriptor,de=Object.prototype,fe=Array.prototype,pe=Object.getPrototypeOf,me=Object.isExtensible;function he(e){for(var t=0;t<e.length;t++)e[t]()}function ge(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const E=1024,D=2048,O=4096,k=8192,A=16384,_e=32768,ve=65536,ye=1<<17,be=1<<18,xe=1<<19,j=32768,Se=1<<21,Ce=1<<22,we=1<<23,Te=Symbol(`$state`),Ee=Symbol(`proxy path`),De=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Oe(){if(S){let e=Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/async_derived_orphan`)}function ke(){if(S){let e=Error(`derived_references_self
|
|
2
|
-
A derived value cannot reference itself recursively
|
|
3
|
-
https://svelte.dev/e/derived_references_self`);throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/derived_references_self`)}function Ae(){if(S){let e=Error(`effect_update_depth_exceeded
|
|
4
|
-
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
5
|
-
https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function je(e){if(S){let t=Error(`rune_outside_svelte\nThe \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files\nhttps://svelte.dev/e/rune_outside_svelte`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/rune_outside_svelte`)}function Me(){if(S){let e=Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ne(){if(S){let e=Error(`state_prototype_fixed
|
|
6
|
-
Cannot set prototype of \`$state\` object
|
|
7
|
-
https://svelte.dev/e/state_prototype_fixed`);throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Pe(){if(S){let e=Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Fe(){if(S){let e=Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}const M=Symbol(),Ie=Symbol(`filename`);var Le=`font-weight: bold`,Re=`font-weight: normal`;function ze(e,t){S?console.warn(`%c[svelte] await_waterfall\n%cAn async derived, \`${e}\` (${t}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\nhttps://svelte.dev/e/await_waterfall`,Le,Re):console.warn(`https://svelte.dev/e/await_waterfall`)}function Be(e){S?console.warn(`%c[svelte] state_proxy_equality_mismatch\n%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results\nhttps://svelte.dev/e/state_proxy_equality_mismatch`,Le,Re):console.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`)}function Ve(){S?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Le,Re):console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}function He(e){return e===this.v}function Ue(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function We(e){return!Ue(e,this.v)}function N(e,t){return e.label=t,Ge(e.v,t),e}function Ge(e,t){return e?.[Ee]?.(t),e}function Ke(e){let t=Error(),n=qe();return n.length===0?null:(n.unshift(`
|
|
8
|
-
`),w(t,`stack`,{value:n.join(`
|
|
9
|
-
`)}),w(t,`name`,{value:e}),t)}function qe(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=Error().stack;if(Error.stackTraceLimit=e,!t)return[];let n=t.split(`
|
|
10
|
-
`),r=[];for(let e=0;e<n.length;e++){let t=n[e],i=t.replaceAll(`\\`,`/`);if(t.trim()!==`Error`){if(t.includes(`validate_each_keys`))return[];i.includes(`svelte/src/internal`)||i.includes(`node_modules/.vite`)||r.push(t)}}return r}let P=null;function Je(e){P=e}let Ye=null;function Xe(e){Ye=e}let Ze=null;function Qe(e){Ze=e}function $e(e,t=!1,n){P={p:P,i:!1,c:null,e:null,s:e,x:null,l:null},S&&(P.function=n,Ze=n)}function et(e){var t=P,n=t.e;if(n!==null){t.e=null;for(var r of n)hn(r)}return e!==void 0&&(t.x=e),t.i=!0,P=t.p,S&&(Ze=P?.function??null),e??{}}function tt(){return!0}let nt=[];function rt(){var e=nt;nt=[],he(e)}function it(e){if(nt.length===0&&!pt){var t=nt;queueMicrotask(()=>{t===nt&&rt()})}nt.push(e)}const at=new WeakMap;function ot(e){var t=K;if(t===null)return U.f|=we,e;if(S&&e instanceof Error&&!at.has(e)&&at.set(e,ct(e,t)),(t.f&_e)===0){if(!(t.f&128))throw S&&!t.parent&&e instanceof Error&<(e),e;t.b.error(e)}else st(e,t)}function st(e,t){for(;t!==null;){if(t.f&128)try{t.b.error(e);return}catch(t){e=t}t=t.parent}throw S&&e instanceof Error&<(e),e}function ct(e,t){let n=T(e,`message`);if(!(n&&!n.configurable)){for(var r=tn?` `:` `,i=`\n${r}in ${t.fn?.name||`<unknown>`}`,a=t.ctx;a!==null;)i+=`\n${r}in ${a.function?.[Ie].split(`/`).pop()}`,a=a.p;return{message:e.message+`\n${i}\n`,stack:e.stack?.split(`
|
|
11
|
-
`).filter(e=>!e.includes(`svelte/src/internal`)).join(`
|
|
12
|
-
`)}}}function lt(e){let t=at.get(e);t&&(w(e,`message`,{value:t.message}),w(e,`stack`,{value:t.stack}))}const ut=new Set;let F=null,I=null,L=[],dt=null,ft=!1,pt=!1;var mt=class e{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=0;#i=null;#a=[];#o=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#r>0}process(e){L=[],this.apply();var t={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(let n of e)this.#s(n,t);this.is_fork||this.#u(),this.is_deferred()?(this.#c(t.effects),this.#c(t.render_effects),this.#c(t.block_effects)):(F=null,_t(t.render_effects),_t(t.effects),this.#i?.resolve()),I=null}#s(e,t){e.f^=E;for(var n=e.first;n!==null;){var r=n.f,i=(r&96)!=0,a=i&&(r&E)!==0||(r&k)!==0||this.skipped_effects.has(n);if(n.f&128&&n.b?.is_pending()&&(t={parent:t,effect:n,effects:[],render_effects:[],block_effects:[]}),!a&&n.fn!==null){i?n.f^=E:r&4?t.effects.push(n):Hn(n)&&(n.f&16&&t.block_effects.push(n),qn(n));var o=n.first;if(o!==null){n=o;continue}}var s=n.parent;for(n=n.next;n===null&&s!==null;)s===t.effect&&(this.#c(t.effects),this.#c(t.render_effects),this.#c(t.block_effects),t=t.parent),n=s.next,s=s.parent}}#c(e){for(let t of e)((t.f&D)===0?this.#o:this.#a).push(t),this.#l(t.deps),$(t,E)}#l(e){if(e!==null)for(let t of e)!(t.f&2)||(t.f&j)===0||(t.f^=j,this.#l(t.deps))}capture(e,t){this.previous.has(e)||this.previous.set(e,t),(e.f&we)===0&&(this.current.set(e,e.v),I?.set(e,e.v))}activate(){F=this,this.apply()}deactivate(){F===this&&(F=null,I=null)}flush(){if(this.activate(),L.length>0){if(ht(),F!==null&&F!==this)return}else this.#n===0&&this.process([]);this.deactivate()}discard(){for(let e of this.#t)e(this);this.#t.clear()}#u(){if(this.#r===0){for(let e of this.#e)e();this.#e.clear()}this.#n===0&&this.#d()}#d(){if(ut.size>1){this.previous.clear();var e=I,t=!0,n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(let e of ut){if(e===this){t=!1;continue}let i=[];for(let[n,r]of this.current){if(e.current.has(n))if(t&&r!==e.current.get(n))e.current.set(n,r);else continue;i.push(n)}if(i.length===0)continue;let a=[...e.current.keys()].filter(e=>!this.current.has(e));if(a.length>0){var r=L;L=[];let t=new Set,o=new Map;for(let e of i)vt(e,a,t,o);if(L.length>0){F=e,e.apply();for(let t of L)e.#s(t,n);e.deactivate()}L=r}}F=null,I=e}this.committed=!0,ut.delete(this)}increment(e){this.#n+=1,e&&(this.#r+=1)}decrement(e){--this.#n,e&&--this.#r,this.revive()}revive(){for(let e of this.#a)$(e,D),bt(e);for(let e of this.#o)$(e,O),bt(e);this.#a=[],this.#o=[],this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=ge()).promise}static ensure(){if(F===null){let t=F=new e;ut.add(F),e.enqueue(()=>{F===t&&t.flush()})}return F}static enqueue(e){it(e)}apply(){}};function ht(){var e=jn;ft=!0;var t=S?new Set:null;try{var n=0;for(Mn(!0);L.length>0;){var r=mt.ensure();if(n++>1e3){if(S){var i=new Map;for(let e of r.current.keys())for(let[t,n]of e.updated??[]){var a=i.get(t);a||(a={error:n.error,count:0},i.set(t,a)),a.count+=n.count}for(let e of i.values())e.error&&console.error(e.error)}gt()}if(r.process(L),Rt.clear(),S)for(let e of r.current.keys())t.add(e)}}finally{if(ft=!1,Mn(e),dt=null,S)for(let e of t)e.updated=null}}function gt(){try{Ae()}catch(e){S&&w(e,`stack`,{value:``}),st(e,dt)}}let R=null;function _t(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(A|k))===0&&Hn(r)&&(R=new Set,qn(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?Dn(r):r.fn=null),R?.size>0)){Rt.clear();for(let e of R){if((e.f&(A|k))!==0)continue;let t=[e],n=e.parent;for(;n!==null;)R.has(n)&&(R.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];(n.f&(A|k))===0&&qn(n)}}R.clear()}}R=null}}function vt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?vt(i,t,n,r):e&(Ce|16)&&(e&D)===0&&yt(i,t,r)&&($(i,D),bt(i))}}function yt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(t.includes(r))return!0;if(r.f&2&&yt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function bt(e){for(var t=dt=e;t.parent!==null;){t=t.parent;var n=t.f;if(ft&&t===K&&n&16&&(n&be)===0)return;if(n&96){if((n&E)===0)return;t.f^=E}}L.push(t)}function xt(e){let t=0,n=Ht(0),r;return S&&N(n,`createSubscriber version`),()=>{pn()&&(Q(n),yn(()=>(t===0&&(r=Xn(()=>e(()=>Gt(n)))),t+=1,()=>{it(()=>{--t,t===0&&(r?.(),r=void 0,Gt(n))})})))}}var St=xe|65664;function Ct(e,t,n){new wt(e,t,n)}var wt=class{parent;#e=!1;#t;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=null;#u=0;#d=0;#f=!1;#p=null;#m=xt(()=>(this.#p=Ht(this.#u),S&&N(this.#p,`$effect.pending()`),()=>{this.#p=null}));constructor(e,t,n){this.#t=e,this.#n=t,this.#r=n,this.parent=K.b,this.#e=!!this.#n.pending,this.#i=xn(()=>{if(K.b=this,!0){var e=this.#h();try{this.#a=Sn(()=>n(e))}catch(e){this.error(e)}this.#d>0?this.#_():this.#e=!1}return()=>{this.#l?.remove()}},St)}#h(){var e=this.#t;return this.#e&&(this.#l=on(),this.#t.before(this.#l),e=this.#l),e}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#n.pending}#g(e){var t=K,n=U,r=P;q(this.#i),G(this.#i),Je(this.#i.ctx);try{return e()}catch(e){return ot(e),null}finally{q(t),G(n),Je(r)}}#_(){let e=this.#n.pending;this.#a!==null&&(this.#c=document.createDocumentFragment(),this.#c.append(this.#l),An(this.#a,this.#c)),this.#o===null&&(this.#o=Sn(()=>e(this.#t)))}#v(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#v(e);return}this.#d+=e,this.#d===0&&(this.#e=!1,this.#o&&On(this.#o,()=>{this.#o=null}),this.#c&&=(this.#t.before(this.#c),null))}update_pending_count(e){this.#v(e),this.#u+=e,this.#p&&Ut(this.#p,this.#u)}get_effect_pending(){return this.#m(),Q(this.#p)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(this.#f||!t&&!n)throw e;this.#a&&=(H(this.#a),null),this.#o&&=(H(this.#o),null),this.#s&&=(H(this.#s),null);var r=!1,i=!1;let a=()=>{if(r){Ve();return}r=!0,i&&Fe(),mt.ensure(),this.#u=0,this.#s!==null&&On(this.#s,()=>{this.#s=null}),this.#e=this.has_pending_snippet(),this.#a=this.#g(()=>(this.#f=!1,Sn(()=>this.#r(this.#t)))),this.#d>0?this.#_():this.#e=!1};var o=U;try{G(null),i=!0,t?.(e,a),i=!1}catch(e){st(e,this.#i&&this.#i.parent)}finally{G(o)}n&&it(()=>{this.#s=this.#g(()=>{mt.ensure(),this.#f=!0;try{return Sn(()=>{n(this.#t,()=>e,()=>a)})}catch(e){return st(e,this.#i.parent),null}finally{this.#f=!1}})})}};function Tt(e,t,n,r){let i=tt()?kt:jt;if(n.length===0&&e.length===0){r(t.map(i));return}var a=F,o=K,s=Et();function c(){Promise.all(n.map(e=>At(e))).then(e=>{s();try{r([...t.map(i),...e])}catch(e){(o.f&A)===0&&st(e,o)}a?.deactivate(),Dt()}).catch(e=>{st(e,o)})}e.length>0?Promise.all(e).then(()=>{s();try{return c()}finally{a?.deactivate(),Dt()}}):c()}function Et(){var e=K,t=U,n=P,r=F;if(S)var i=Ye;return function(a=!0){q(e),G(t),Je(n),a&&r?.activate(),S&&Xe(i)}}function Dt(){q(null),G(null),Je(null),S&&Xe(null)}const Ot=new Set;function kt(e){var t=2|D,n=U!==null&&U.f&2?U:null;return K!==null&&(K.f|=xe),{ctx:P,deps:null,effects:null,equals:He,f:t,fn:e,reactions:null,rv:0,v:M,wv:0,parent:n??K,ac:null}}function At(e,t){let n=K;n===null&&Oe();var r=n.b,i=void 0,a=Ht(M),o=!U,s=new Map;return vn(()=>{var n=ge();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).then(()=>{c===F&&c.committed&&c.deactivate(),Dt()})}catch(e){n.reject(e),Dt()}var c=F;if(o){var l=!r.is_pending();r.update_pending_count(1),c.increment(l),s.get(c)?.reject(De),s.delete(c),s.set(c,n)}let u=(e,n=void 0)=>{if(c.activate(),n)n!==De&&(a.f|=we,Ut(a,n));else{(a.f&we)!==0&&(a.f^=we),Ut(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(De)}S&&t!==void 0&&(Ot.add(a),setTimeout(()=>{Ot.has(a)&&(ze(a.label,t),Ot.delete(a))}))}o&&(r.update_pending_count(-1),c.decrement(l))};n.promise.then(u,e=>u(null,e||`unknown`))}),mn(()=>{for(let e of s.values())e.reject(De)}),S&&(a.f|=Ce),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function jt(e){let t=kt(e);return t.equals=We,t}function Mt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)H(t[n])}}let Nt=[];function Pt(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return(t.f&A)===0?t:null;t=t.parent}return null}function Ft(e){var t,n=K;if(q(Pt(e)),S){let r=Lt;zt(new Set);try{Nt.includes(e)&&ke(),Nt.push(e),e.f&=~j,Mt(e),t=Wn(e)}finally{q(n),zt(r),Nt.pop()}}else try{e.f&=~j,Mt(e),t=Wn(e)}finally{q(n)}return t}function It(e){var t=Ft(e);e.equals(t)||(F?.is_fork||(e.v=t),e.wv=Vn()),!Nn&&(I===null?$(e,e.f&512?E:O):(pn()||F?.is_fork)&&I.set(e,t))}let Lt=new Set;const Rt=new Map;function zt(e){Lt=e}let Bt=!1;function Vt(){Bt=!0}function Ht(e,t){return{f:0,v:e,reactions:null,equals:He,rv:0,wv:0}}function z(e,t){let n=Ht(e,t);return Fn(n),n}function B(e,t,n=!1){U!==null&&(!W||(U.f&ye)!==0)&&tt()&&U.f&(Ce|131090)&&!J?.includes(e)&&Pe();let r=n?Jt(t):t;return S&&Ge(r,e.label),Ut(e,r)}function Ut(e,t){if(!e.equals(t)){var n=e.v;Nn?Rt.set(e,t):Rt.set(e,n),e.v=t;var r=mt.ensure();if(r.capture(e,n),S){if(K!==null){e.updated??=new Map;let t=(e.updated.get(``)?.count??0)+1;if(e.updated.set(``,{error:null,count:t}),t>5){let t=Ke(`updated at`);if(t!==null){let n=e.updated.get(t.stack);n||(n={error:t,count:0},e.updated.set(t.stack,n)),n.count++}}}K!==null&&(e.set_during_effect=!0)}e.f&2&&((e.f&D)!==0&&Ft(e),$(e,e.f&512?E:O)),e.wv=Vn(),Kt(e,D),tt()&&K!==null&&(K.f&E)!==0&&!(K.f&96)&&(Z===null?In([e]):Z.push(e)),!r.is_fork&&Lt.size>0&&!Bt&&Wt()}return t}function Wt(){Bt=!1;var e=jn;Mn(!0);let t=Array.from(Lt);try{for(let e of t)(e.f&E)!==0&&$(e,O),Hn(e)&&qn(e)}finally{Mn(e)}Lt.clear()}function Gt(e){B(e,e.v+1)}function Kt(e,t){var n=e.reactions;if(n!==null)for(var r=tt(),i=n.length,a=0;a<i;a++){var o=n[a],s=o.f;if(!(!r&&o===K)){if(S&&(s&ye)!==0){Lt.add(o);continue}var c=(s&D)===0;if(c&&$(o,t),s&2){var l=o;I?.delete(l),(s&j)===0&&(s&512&&(o.f|=j),Kt(l,O))}else c&&(s&16&&R!==null&&R.add(o),bt(o))}}}const qt=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function Jt(e){if(typeof e!=`object`||!e||Te in e)return e;let t=pe(e);if(t!==de&&t!==fe)return e;var n=new Map,r=le(e),i=z(0),a=null,o=zn,s=e=>{if(zn===o)return e();var t=U,n=zn;G(null),Bn(o);var r=e();return G(t),Bn(n),r};r&&(n.set(`length`,z(e.length,a)),S&&(e=Qt(e)));var c=``;let l=!1;function u(e){if(!l){l=!0,c=e,N(i,`${c} version`);for(let[e,t]of n)N(t,Yt(c,e));l=!1}}return new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&Me();var i=n.get(t);return i===void 0?i=s(()=>{var e=z(r.value,a);return n.set(t,e),S&&typeof t==`string`&&N(e,Yt(c,t)),e}):B(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>z(M,a));n.set(t,e),Gt(i),S&&N(e,Yt(c,t))}}else B(r,M),Gt(i);return!0},get(t,r,i){if(r===Te)return e;if(S&&r===Ee)return u;var o=n.get(r),l=r in t;if(o===void 0&&(!l||T(t,r)?.writable)&&(o=s(()=>{var e=z(Jt(l?t[r]:M),a);return S&&N(e,Yt(c,r)),e}),n.set(r,o)),o!==void 0){var d=Q(o);return d===M?void 0:d}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=Q(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==M)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===Te)return!0;var r=n.get(t),i=r!==void 0&&r.v!==M||Reflect.has(e,t);return(r!==void 0||K!==null&&(!i||T(e,t)?.writable))&&(r===void 0&&(r=s(()=>{var n=z(i?Jt(e[t]):M,a);return S&&N(n,Yt(c,t)),n}),n.set(t,r)),Q(r)===M)?!1:i},set(e,t,o,l){var u=n.get(t),d=t in e;if(r&&t===`length`)for(var f=o;f<u.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=s(()=>z(M,a)),n.set(f+``,p),S&&N(p,Yt(c,f))):B(p,M)}if(u===void 0)(!d||T(e,t)?.writable)&&(u=s(()=>z(void 0,a)),S&&N(u,Yt(c,t)),B(u,Jt(o)),n.set(t,u));else{d=u.v!==M;var m=s(()=>Jt(o));B(u,m)}var ee=Reflect.getOwnPropertyDescriptor(e,t);if(ee?.set&&ee.set.call(l,o),!d){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&B(h,g+1)}Gt(i)}return!0},ownKeys(e){Q(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==M});for(var[r,a]of n)a.v!==M&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Ne()}})}function Yt(e,t){return typeof t==`symbol`?`${e}[Symbol(${t.description??``})]`:qt.test(t)?`${e}.${t}`:/^\d+$/.test(t)?`${e}[${t}]`:`${e}['${t}']`}function Xt(e){try{if(typeof e==`object`&&e&&Te in e)return e[Te]}catch{}return e}const Zt=new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);function Qt(e){return new Proxy(e,{get(e,t,n){var r=Reflect.get(e,t,n);return Zt.has(t)?function(...e){Vt();var t=r.apply(this,e);return Wt(),t}:r}})}function $t(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:n,lastIndexOf:r,includes:i}=e;e.indexOf=function(e,t){let r=n.call(this,e,t);if(r===-1){for(let n=t??0;n<this.length;n+=1)if(Xt(this[n])===e){Be(`array.indexOf(...)`);break}}return r},e.lastIndexOf=function(e,t){let n=r.call(this,e,t??this.length-1);if(n===-1){for(let n=0;n<=(t??this.length-1);n+=1)if(Xt(this[n])===e){Be(`array.lastIndexOf(...)`);break}}return n},e.includes=function(e,t){let n=i.call(this,e,t);if(!n){for(let t=0;t<this.length;t+=1)if(Xt(this[t])===e){Be(`array.includes(...)`);break}}return n},Array.__svelte_cleanup=()=>{e.indexOf=n,e.lastIndexOf=r,e.includes=i}}var en,tn,nn,rn;function an(){if(en===void 0){en=window,document,tn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;nn=T(t,`firstChild`).get,rn=T(t,`nextSibling`).get,me(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),me(n)&&(n.__t=void 0),S&&(e.__svelte_meta=null,$t())}}function on(e=``){return document.createTextNode(e)}function sn(e){return nn.call(e)}function cn(e){return rn.call(e)}function ln(e,t){return sn(e)}function un(e,t=1,n=!1){let r=e;for(;t--;)r=cn(r);return r}function dn(e){var t=U,n=K;G(null),q(null);try{return e()}finally{G(t),q(n)}}function fn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function V(e,t,n){var r=K;if(S)for(;r!==null&&(r.f&ye)!==0;)r=r.parent;r!==null&&(r.f&k)!==0&&(e|=k);var i={ctx:P,deps:null,nodes:null,f:e|2560,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(S&&(i.component_function=Ze),n)try{qn(i),i.f|=_e}catch(e){throw H(i),e}else t!==null&&bt(i);var a=i;if(n&&a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&xe)===0&&(a=a.first,e&16&&(e&ve)!==0&&a!==null&&(a.f|=ve)),a!==null&&(a.parent=r,r!==null&&fn(a,r),U!==null&&U.f&2&&!(e&64))){var o=U;(o.effects??=[]).push(a)}return i}function pn(){return U!==null&&!W}function mn(e){let t=V(8,null,!1);return $(t,E),t.teardown=e,t}function hn(e){return V(1048580,e,!1)}function gn(e){mt.ensure();let t=V(64|xe,e,!0);return(e={})=>new Promise(n=>{e.outro?On(t,()=>{H(t),n(void 0)}):(H(t),n(void 0))})}function _n(e){return V(4,e,!1)}function vn(e){return V(Ce|xe,e,!0)}function yn(e,t=0){return V(8|t,e,!0)}function bn(e,t=[],n=[],r=[]){Tt(r,t,n,t=>{V(8,()=>e(...t.map(Q)),!0)})}function xn(e,t=0){var n=V(16|t,e,!0);return S&&(n.dev_stack=Ye),n}function Sn(e){return V(32|xe,e,!0)}function Cn(e){var t=e.teardown;if(t!==null){let e=Nn,n=U;Pn(!0),G(null);try{t.call(null)}finally{Pn(e),G(n)}}}function wn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&dn(()=>{e.abort(De)});var r=n.next;n.f&64?n.parent=null:H(n,t),n=r}}function Tn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||H(t),t=n}}function H(e,t=!0){var n=!1;(t||(e.f&be)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(En(e.nodes.start,e.nodes.end),n=!0),wn(e,t&&!n),Kn(e,0),$(e,A);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Cn(e);var i=e.parent;i!==null&&i.first!==null&&Dn(e),S&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function En(e,t){for(;e!==null;){var n=e===t?null:cn(e);e.remove(),e=n}}function Dn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function On(e,t,n=!0){var r=[];kn(e,r,!0);var i=()=>{n&&H(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function kn(e,t,n){if((e.f&k)===0){e.f^=k;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&ve)!==0||(i.f&32)!=0&&(e.f&16)!=0;kn(i,t,o?n:!1),i=a}}}function An(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:cn(n);t.append(n),n=i}}let jn=!1;function Mn(e){jn=e}let Nn=!1;function Pn(e){Nn=e}let U=null,W=!1;function G(e){U=e}let K=null;function q(e){K=e}let J=null;function Fn(e){U!==null&&(J===null?J=[e]:J.push(e))}let Y=null,X=0,Z=null;function In(e){Z=e}let Ln=1,Rn=0,zn=Rn;function Bn(e){zn=e}function Vn(){return++Ln}function Hn(e){var t=e.f;if((t&D)!==0)return!0;if(t&2&&(e.f&=~j),(t&O)!==0){var n=e.deps;if(n!==null)for(var r=n.length,i=0;i<r;i++){var a=n[i];if(Hn(a)&&It(a),a.wv>e.wv)return!0}t&512&&I===null&&$(e,E)}return!1}function Un(e,t,n=!0){var r=e.reactions;if(r!==null&&!J?.includes(e))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Un(a,t,!1):t===a&&(n?$(a,D):(a.f&E)!==0&&$(a,O),bt(a))}}function Wn(e){var t=Y,n=X,r=Z,i=U,a=J,o=P,s=W,c=zn,l=e.f;Y=null,X=0,Z=null,U=l&96?null:e,J=null,Je(e.ctx),W=!1,zn=++Rn,e.ac!==null&&(dn(()=>{e.ac.abort(De)}),e.ac=null);try{e.f|=Se;var u=e.fn,d=u(),f=e.deps;if(Y!==null){var p;if(Kn(e,X),f!==null&&X>0)for(f.length=X+Y.length,p=0;p<Y.length;p++)f[X+p]=Y[p];else e.deps=f=Y;if(pn()&&e.f&512)for(p=X;p<f.length;p++)(f[p].reactions??=[]).push(e)}else f!==null&&X<f.length&&(Kn(e,X),f.length=X);if(tt()&&Z!==null&&!W&&f!==null&&!(e.f&(O|2050)))for(p=0;p<Z.length;p++)Un(Z[p],e);return i!==null&&i!==e&&(Rn++,Z!==null&&(r===null?r=Z:r.push(...Z))),(e.f&we)!==0&&(e.f^=we),d}catch(e){return ot(e)}finally{e.f^=Se,Y=t,X=n,Z=r,U=i,J=a,Je(o),W=s,zn=c}}function Gn(e,t){let n=t.reactions;if(n!==null){var r=ue.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}n===null&&t.f&2&&(Y===null||!Y.includes(t))&&($(t,O),t.f&512&&(t.f^=512,t.f&=~j),Mt(t),Kn(t,0))}function Kn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Gn(e,n[r])}function qn(e){var t=e.f;if((t&A)===0){$(e,E);var n=K,r=jn;if(K=e,jn=!0,S){var i=Ze;Qe(e.component_function);var a=Ye;Xe(e.dev_stack??Ye)}try{t&16777232?Tn(e):wn(e),Cn(e);var o=Wn(e);e.teardown=typeof o==`function`?o:null,e.wv=Ln}finally{jn=r,K=n,S&&(Qe(i),Xe(a))}}}function Q(e){var t=(e.f&2)!=0;if(null?.add(e),U!==null&&!W&&!(K!==null&&(K.f&A)!==0)&&!J?.includes(e)){var n=U.deps;if((U.f&Se)!==0)e.rv<Rn&&(e.rv=Rn,Y===null&&n!==null&&n[X]===e?X++:Y===null?Y=[e]:Y.includes(e)||Y.push(e));else{(U.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[U]:r.includes(U)||r.push(U)}}if(S&&Ot.delete(e),Nn){if(Rt.has(e))return Rt.get(e);if(t){var i=e,a=i.v;return((i.f&E)===0&&i.reactions!==null||Yn(i))&&(a=Ft(i)),Rt.set(i,a),a}}else t&&(!I?.has(e)||F?.is_fork&&!pn())&&(i=e,Hn(i)&&It(i),jn&&pn()&&!(i.f&512)&&Jn(i));if(I?.has(e))return I.get(e);if((e.f&we)!==0)throw e.v;return e.v}function Jn(e){if(e.deps!==null){e.f^=512;for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&Jn(t)}}function Yn(e){if(e.v===M)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Rt.has(t)||t.f&2&&Yn(t))return!0;return!1}function Xn(e){var t=W;try{return W=!0,e()}finally{W=t}}~(O|3072);function $(e,t){e.f=e.f&-7169|t}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];const Zn=[`touchstart`,`touchmove`];function Qn(e){return Zn.includes(e)}const $n=new Set,er=new Set;let tr=null;function nr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;tr=e;var o=0,s=tr===e&&e.__root;if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){w(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=U,d=K;G(null),q(null);try{for(var f,p=[];a!==null;){var m=a.assignedSlot||a.parentNode||a.host||null;try{var ee=a[`__`+r];ee!=null&&(!a.disabled||e.target===a)&&ee.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble||m===t||m===null)break;a=m}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e.__root=t,delete e.currentTarget,G(u),q(d)}}}function rr(e){var t=document.createElement(`template`);return t.innerHTML=e.replaceAll(`<!>`,`<!---->`),t.content}function ir(e,t){var n=K;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function ar(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{i===void 0&&(i=rr(a?e:`<!>`+e),n||(i=sn(i)));var t=r||tn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=sn(t),s=t.lastChild;ir(o,s)}else ir(t,t);return t}}function or(e,t){e!==null&&e.before(t)}function sr(e,t){return lr(e,t)}const cr=new Map;function lr(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0}){an();var s=new Set,c=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!s.has(r)){s.add(r);var i=Qn(r);t.addEventListener(r,nr,{passive:i});var a=cr.get(r);a===void 0?(document.addEventListener(r,nr,{passive:i}),cr.set(r,1)):cr.set(r,a+1)}}};c(C($n)),er.add(c);var l=void 0,u=gn(()=>{var o=n??t.appendChild(on());return Ct(o,{pending:()=>{}},t=>{if(a){$e({});var n=P;n.c=a}i&&(r.$$events=i),l=e(t,r)||{},a&&et()}),()=>{for(var e of s){t.removeEventListener(e,nr);var r=cr.get(e);--r===0?(document.removeEventListener(e,nr),cr.delete(e)):cr.set(e,r)}er.delete(c),o!==n&&o.parentNode?.removeChild(o)}});return ur.set(l,u),l}let ur=new WeakMap;function dr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=dr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function fr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=dr(e))&&(r&&(r+=` `),r+=t);return r}function pr(e){return typeof e==`object`?fr(e):e??``}const mr=[...`
|
|
13
|
-
\r\f\xA0\v`];function hr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i in n)if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||mr.includes(r[o-1]))&&(s===r.length||mr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function gr(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i in e){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function _r(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function vr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(_r)),i&&c.push(...Object.keys(i).map(_r));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=_r(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=gr(r)),i&&(n+=gr(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function yr(e,t,n,r,i,a){var o=e.__className;if(o!==n||o===void 0){var s=hr(n,r,a);s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function br(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function xr(e,t,n,r){if(e.__style!==t){var i=vr(t,r);i==null?e.removeAttribute(`style`):e.style.cssText=i,e.__style=t}else r&&(Array.isArray(r)?(br(e,n?.[0],r[0]),br(e,n?.[1],r[1],`important`)):br(e,n,r));return r}function Sr(e,t){return e===t||e?.[Te]===t}function Cr(e={},t,n,r){return _n(()=>{var i,a;return yn(()=>{i=a,a=r?.()||[],Xn(()=>{e!==n(...a)&&(t(e,...a),i&&Sr(n(...i),e)&&t(null,...i))})}),()=>{it(()=>{a&&Sr(n(...a),e)&&t(null,...a)})}}),e}if(S){function e(e){if(!(e in globalThis)){let t;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(t!==void 0)return t;je(e)},set:e=>{t=e}})}}e(`$state`),e(`$effect`),e(`$derived`),e(`$inspect`),e(`$props`),e(`$bindable`)}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);function wr(e){return-.5*(Math.cos(Math.PI*e)-1)}var Tr=class{animationEasing;animationRun;animating;value;time;constructor(e){if(e.max<=e.min)throw Error(`Min must be less than max`);if(e.value<e.min||e.max<e.value)throw Error(`Value must be between min and max`);this.animationEasing=e.easing,this.animationRun=e.callback,this.animating=!1,this.value={current:e.value,start:e.value,end:e.value,min:e.min,max:e.max},this.time={start:0,end:0,span:e.timespan}}animationFrame(){let e=performance.now();if(e>this.time.end)this.value.current=this.value.end;else{let t=(e-this.time.start)/(this.time.end-this.time.start),n=this.animationEasing(t);this.value.current=this.value.start+(this.value.end-this.value.start)*n}if(this.animationRun(this.value.current),this.value.current===this.value.end){this.animating=!1;return}window.requestAnimationFrame(this.animationFrame.bind(this))}target(e){if(e===this.value.end)return;this.value.start=this.value.current,this.value.end=e;let t=performance.now(),n=Math.abs(this.value.start-this.value.end),r=this.value.max-this.value.min;this.time.start=t,this.time.end=t+this.time.span*Math.sqrt(n/r),!this.animating&&(this.animating=!0,window.requestAnimationFrame(this.animationFrame.bind(this)))}set(e){if(e===this.value.end)return;this.value.current=e,this.value.start=e,this.value.end=e;let t=performance.now();this.time.start=t,this.time.end=t,window.requestAnimationFrame(this.animationRun.bind(this,e))}end(){this.set(this.value.end)}expired(){return performance.now()>this.time.end}},Er=ar(`<div></div>`);function Dr(e,t){$e(t,!0);let n=t.id,r=t.style,i=t.content,a={setDisplayed:ne,getDisplayed:re,setSuppressed:b,setCollapsed:ie,getCollapsed:ae,setScale:ce};function o(){return a}let s,c=r.dimensions.width,l=r.dimensions.height,u=r.dimensions.radius,d=r.dimensions.padding??2,f=r.colors?.border??m,h=r.colors?.background??`darkgreen`,g=r.colors?.shadow??ee,_=z(!1),te=!1,v=!1;function ne(e){if(e!=Q(_)){if(B(_,e,!0),e==1){if(i==null||v||te)return;te=!0,i(n).then(e=>{e instanceof HTMLElement?s.appendChild(e):console.error(`Failed to load pin content`)}).catch(e=>console.error(e)).finally(()=>{v=!0,te=!1})}e==0&&se.end()}}function re(){return Q(_)}let y=z(!0);function b(e){e!=Q(y)&&(B(y,e,!0),e&&(oe=p,se.set(p)))}let x=z(!0);function ie(e){e!=Q(x)&&(B(x,e,!0),se.target(Q(x)?0:oe))}function ae(){return Q(_)?se.expired():!0}let oe=p,se=new Tr({value:p,min:0,max:1,timespan:75,easing:wr,callback:S});function ce(e){oe=e,se.target(e)}function S(e){s.style.scale=e.toString(),s.style.filter=`brightness(${le(e)})`}function le(e){return .25+.75*e}var ue={invoke:o},C=Er();let w;return Cr(C,e=>s=e,()=>s),bn(e=>{yr(C,1,pr([`pin`,Q(_)&&`displayed`,Q(y)&&`suppressed`]),`svelte-10kxbrm`),w=xr(C,``,w,e)},[()=>({width:`${c}px`,height:`${l}px`,"border-radius":`${u}px`,"border-color":f,"background-color":h,"border-width":`${d}px`,"box-shadow":g,scale:p,filter:`brightness(${le(p)})`})]),or(e,C),et(ue)}var Or=class{div;marker;constructor(e,t,n,r){this.div=document.createElement(`div`),this.marker=e.createMarker(this.div,t,n,r)}insert(){this.marker.inserted()!=1&&this.marker.insert()}remove(){this.marker.inserted()!=0&&this.marker.remove()}update(e){this.marker.update(e)}},kr=class e{shown;id;lat;lng;rank;marker;constructor(t,n){if(new.target===e)throw Error(`Cannot instantiate an abstract class directly.`);this.shown=!0,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.rank=t.rank,this.marker=n}},Ar=class extends kr{width;height;zoom;component;constructor(e,t){super(e,new Or(t,e.lat,e.lng,e.rank));let n=e.pin?.style.dimensions.width??16,r=e.pin?.style.dimensions.height??16,i=e.pin?.style.dimensions.padding??2,a=e.pin?.style.dimensions.radius??16/2;this.width=n,this.height=r,this.zoom=NaN,this.component=sr(Dr,{target:this.marker.div,props:{id:this.id,style:{dimensions:{width:n,height:r,padding:i,radius:a},colors:e.pin?.style.colors},content:e.pin?.body}})}get zIndex(){return Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*10)+1e6}},jr=class{animating;animationTimestamp;animationEnd;animationCallback;speed;value;constructor(e){this.animating=!1,this.animationTimestamp=0,this.animationEnd=0,this.animationCallback=e.callback,this.speed={current:0,spring:{stiffness:e.stiffness,damping:2*Math.sqrt(e.stiffness)}},this.value={current:e.value,target:e.value,precision:e.precision,min:e.min,max:e.max}}animationFrame(){try{let e=performance.now(),t=e-this.animationTimestamp;if(this.animationTimestamp=e,e>=this.animationEnd){this.speed.current=0,this.value.current=this.value.target;return}let n=this.value.target-this.value.current;if(Math.abs(n)<this.value.precision){this.speed.current=0,this.value.current=this.value.target;return}let r=n*this.speed.spring.stiffness-this.speed.spring.damping*this.speed.current;if(this.speed.current+=r*t,this.value.current+=this.speed.current*t,this.value.current<this.value.min){this.value.current=this.value.target,this.speed.current=0;return}if(this.value.current>this.value.max){this.value.current=this.value.target,this.speed.current=0;return}}finally{if(this.animationCallback(this.value.current),this.value.current===this.value.target){this.animating=!1;return}window.requestAnimationFrame(this.animationFrame.bind(this))}}target(e){if(e===this.value.target)return;let t=Math.sqrt(2*Math.abs(e-this.value.current)/this.speed.spring.stiffness);this.animationEnd=performance.now()+t,this.value.target=e,!this.animating&&(this.animating=!0,this.animationTimestamp=performance.now(),window.requestAnimationFrame(this.animationFrame.bind(this)))}set(e){e!==this.value.target&&(this.animationEnd=performance.now(),this.value.current=e,this.value.target=e,this.speed.current=0,window.requestAnimationFrame(this.animationCallback.bind(this,e)))}end(){this.set(this.value.target)}expired(){return performance.now()>this.animationEnd}};function Mr(e,t,n){let r=e/2,i=t/2,a=Math.sqrt(r*r+i*i),o=Math.atan(i/r)*(180/Math.PI),s=n*(Math.PI/180);return n<180?n<90?n<o?{x:0,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:0}:n<180-o?{x:a*Math.cos(s)-r,y:0}:{x:-e,y:a*Math.sin(s)-i}:n<270?n<180+o?{x:-e,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:-t}:n<360-o?{x:a*Math.cos(s)-r,y:-t}:{x:0,y:a*Math.sin(s)-i}}var Nr={getOffsets:Mr},Pr=ar(`<div><div class="element pointer svelte-1no6o2a"></div> <div class="element tooltip svelte-1no6o2a"><div class="element body svelte-1no6o2a"></div></div></div>`);function Fr(e,t){$e(t,!0);let n=t.id,r=t.style,i=t.content,a={setDisplayed:oe,getDisplayed:se,setCollapsed:S,getCollapsed:le,getExpanded:ue,setAngle:ge};function o(){return a}let s,c=r.colors?.shadow??ee,l,u=Math.min(r.dimensions.width,r.dimensions.height)/Math.SQRT2,f=Math.min(r.dimensions.width,r.dimensions.height)/Math.SQRT2,p=r.colors?.background??m,h,g=r.dimensions.width+2*r.dimensions.margin,_=r.dimensions.height+2*r.dimensions.margin,te=r.dimensions.margin,v,ne=r.dimensions.width,re=r.dimensions.height,y=r.dimensions.radius,b=r.colors?.background??m,x=z(!1),ie=!1,ae=!1;function oe(e){if(e!=Q(x)){if(B(x,e,!0),e){if(i==null||ae||ie)return;ie=!0,i(n).then(e=>{e instanceof HTMLElement?v.appendChild(e):console.error(`Failed to load tooltip content`)}).catch(e=>console.error(e)).finally(()=>{ae=!0,ie=!1})}e==0&&(C.end(),pe.end(),he.end())}}function se(){return Q(x)}let ce=z(!0);function S(e){e!=Q(ce)&&(B(ce,e,!0),C.target(Q(ce)?0:1))}function le(){return Q(x)?C.expired():!0}function ue(){return Q(x)?C.expired():!1}let C=new Tr({value:0,min:0,max:1,timespan:150,easing:wr,callback:w});function w(e){s.style.opacity=`${e}`,h.style.scale=`${e}`,l.style.scale=`${e}`}let T=NaN,de=z(!1),fe=-g/2,pe=new jr({value:-g/2,min:-g,max:0,precision:1,stiffness:d,callback:E}),me=-_/2,he=new jr({value:-_/2,min:-_,max:0,precision:1,stiffness:d,callback:D});function ge(e,t){if(Number.isNaN(e)){T=NaN,B(de,!1);return}if(Q(de)==0||t==1){B(de,!0),T=e;let t=Nr.getOffsets(g,_,e);pe.set(Math.round(t.x)),he.set(Math.round(t.y));return}if(T!=e){T=e;let t=Nr.getOffsets(g,_,e);pe.target(Math.round(t.x)),he.target(Math.round(t.y));return}}function E(e){fe=e,O()}function D(e){me=e,O()}function O(){let e=fe,t=me,n=e+g/2,r=t+_/2,i=_<g?n*_/g:n,a=_>g?r*g/_:r,o=Math.atan2(a,i),s=Math.sqrt(i*i+a*a),c=Math.min(g,_)/2,u=c*Math.SQRT2,d=(s-c)/(u-c),f=o/Math.PI*180-45,p=0+d*30,m=s<c?s/c:1;h.style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`,l.style.transform=`scale(${m}) rotate(${f}deg) skew(${p}deg, ${p}deg)`}var k={invoke:o},A=Pr();let _e;var ve=ln(A);let ye;Cr(ve,e=>l=e,()=>l);var be=un(ve,2);let xe;var j=ln(be);let Se;return Cr(j,e=>v=e,()=>v),Cr(be,e=>h=e,()=>h),Cr(A,e=>s=e,()=>s),bn(()=>{yr(A,1,pr([`element anchor`,Q(x)&&`displayed`]),`svelte-1no6o2a`),_e=xr(A,``,_e,{filter:`drop-shadow(${c})`}),ye=xr(ve,``,ye,{width:`${u}px`,height:`${f}px`,"background-color":p}),xe=xr(be,``,xe,{width:`${g}px`,height:`${_}px`,padding:`${te}px;`}),Se=xr(j,``,Se,{width:`${ne}px`,height:`${re}px`,"border-radius":`${y}px;`,"background-color":b})}),or(e,A),et(k)}var Ir=class extends kr{width;height;zoom;angle;states;component;constructor(e,t){super(e,new Or(t,e.lat,e.lng,e.rank)),this.width=e.tooltip.style.dimensions.width+e.tooltip.style.dimensions.margin*2,this.height=e.tooltip.style.dimensions.height+e.tooltip.style.dimensions.margin*2,this.zoom=NaN,this.angle=NaN,this.states=[],this.component=sr(Fr,{target:this.marker.div,props:{id:this.id,style:e.tooltip.style,content:e.tooltip.body}})}get zIndex(){return Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*10)+2e6}},Lr=class extends kr{width;height;margin;angle;component;constructor(e,t){if(e.popup==null)throw Error(`Failed to create popup`);super(e,new Or(t,e.lat,e.lng,f)),this.width=e.popup.style.dimensions.width,this.height=e.popup.style.dimensions.height,this.margin=e.popup.style.dimensions.margin,this.angle=NaN,this.shown=!1,this.component=sr(Fr,{target:this.marker.div,props:{id:this.id,style:e.popup.style,content:e.popup.body}})}get zIndex(){return f}},Rr=class{id;state=void 0;pin;tooltip;popup;constructor(e,t){this.id=e.id,this.pin=new Ar(e,t),this.tooltip=new Ir(e,t),e.popup!=null&&(this.popup=new Lr(e,t))}},zr=class{pins=new Set;pinMaxWidth=0;pinMaxHeight=0;pinFade=!1;pinZoomMax=4;pinZoomDelta=4;set configuration(e){this.pinFade=e?.pin?.fade??!0,this.pinZoomMax=e?.pin?.maxZoom??4,this.pinZoomDelta=this.pinZoomMax}insert(e,t){this.update(e,t),this.pins.add(e)}update(e,t){e.zoom=t?t[0]:NaN,e.marker.update(e.zIndex)}remove(e){e.shown=!0,e.zoom=NaN,e.component.invoke().setCollapsed(!1),e.component.invoke().setSuppressed(!0),e.component.invoke().setDisplayed(!1),e.marker.update(e.zIndex),e.marker.remove(),this.pins.delete(e)}clear(){this.pins.forEach(e=>e.marker.remove()),this.pins.clear()}refresh(){let e=Array.from(this.pins);this.pinMaxWidth=e.reduce((e,t)=>Math.max(e,t.width),0),this.pinMaxHeight=e.reduce((e,t)=>Math.max(e,t.height),0),this.pinZoomDelta=Math.max(1,this.pinZoomMax-Math.log10(e.length))}render(e,t){let n=e.zoom,r=t.mapSize,i=b.offset(e,r,{top:this.pinMaxHeight,bottom:this.pinMaxHeight,right:this.pinMaxWidth,left:this.pinMaxWidth});for(let e of this.pins)i.contains(e.lat,e.lng)?Number.isNaN(e.zoom)?(e.component.invoke().setDisplayed(!0),e.component.invoke().setSuppressed(!0),e.component.invoke().setCollapsed(!1),e.marker.insert()):(e.component.invoke().setSuppressed(!1),e.shown&&n<e.zoom&&e.zoom<n+this.pinZoomDelta?(e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setScale(this.pinFade?Math.max(0,1-(e.zoom-n)*.2):1),e.marker.insert()):(e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove()))):(e.component.invoke().setDisplayed(!1),e.marker.remove())}},Br={COUNT:12,DEGREES:[0,30,60,90,120,150,180,210,240,270,300,330],DEGREES_DEFAULT:270},Vr=class{tooltips=new Set;tooltipMaxWidth=0;tooltipMaxHeight=0;insert(e,t){this.update(e,t),this.tooltips.add(e)}update(e,t){t?(e.zoom=t[0],e.states=t[1].map(e=>[e[0],Br.DEGREES[e[1]]])):(e.zoom=NaN,e.states=[]),e.marker.update(e.zIndex)}remove(e){e.shown=!0,e.zoom=NaN,e.angle=NaN,e.states=[],e.component.invoke().setAngle(NaN),e.component.invoke().setCollapsed(!0),e.component.invoke().setDisplayed(!1),e.marker.update(e.zIndex),e.marker.remove(),this.tooltips.delete(e)}clear(){this.tooltips.forEach(e=>e.marker.remove()),this.tooltips.clear()}refresh(){let e=Array.from(this.tooltips);this.tooltipMaxWidth=e.reduce((e,t)=>Math.max(e,t.width),0),this.tooltipMaxHeight=e.reduce((e,t)=>Math.max(e,t.height),0)}render(e,t){let n=e.zoom,r=t.mapSize,i=b.offset(e,r,{top:this.tooltipMaxHeight,bottom:this.tooltipMaxHeight,right:this.tooltipMaxWidth,left:this.tooltipMaxWidth});for(let e of this.tooltips)if(i.contains(e.lat,e.lng))if(Number.isNaN(e.zoom)==0&&e.shown&&e.zoom<=n){let t=e.states.findLast(e=>e[0]<=n)?.[1];if(t==null)throw Error(`Angle not found`);e.angle=t,e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setAngle(t),e.marker.insert()}else e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove());else e.component.invoke().setDisplayed(!1),e.marker.remove()}},Hr=class{popups=new Set;pan=!0;set configuration(e){this.pan=e?.popup?.pan??!0}insert(e){this.popups.add(e)}remove(e){e.angle=NaN,e.shown=!1,e.marker.remove(),e.component.invoke().setAngle(NaN),e.component.invoke().setCollapsed(!0),e.component.invoke().setDisplayed(!1),this.popups.delete(e)}clear(){this.popups.forEach(e=>e.marker.remove()),this.popups.clear()}show(e,t){if(!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!1,e.tooltip.shown=!1,e.popup.angle=e.tooltip.angle,e.popup.shown=!0,this.pan==0))return;let n=e.popup,r=t.getViewport(),i=r.bounds,a=r.zoom,o=t.getParameters().mapSize*2**a,s=re.project(i.ne.lat,i.sw.lng,o),c=re.project(i.sw.lat,i.ne.lng,o),l=c.x-s.x,u=c.y-s.y,d=n.width+n.margin*8,f=n.height+n.margin*8,p=re.project(n.lat,n.lng,o),m=Nr.getOffsets(d,f,e.tooltip.angle),ee=p.x+m.x,h=ee+d,g=p.y+m.y,_=g+f,te=ee-s.x,v=c.x-h,ne=g-s.y,y=c.y-_,b=0;l<d?b=(te-v)/2:(te<0&&(b=te),v<0&&(b=-v));let x=0;u<f?x=(ne-y)/2:(ne<0&&(x=ne),y<0&&(x=-y)),(b!=0||x!=0)&&t.panBy(b,x)}hide(e){!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}render(){for(let e of this.popups)e.shown?(e.component.invoke().setDisplayed(!0),e.component.invoke().setCollapsed(!1),e.component.invoke().setAngle(e.angle,!0),e.marker.insert()):(e.component.invoke().setCollapsed(!0),e.component.invoke().getCollapsed()&&(e.component.invoke().setDisplayed(!1),e.marker.remove()))}},Ur=class{mapProvider;mapPinManager;mapTooltipManager;mapPopupManager;mapElements;constructor(e){this.mapProvider=e,this.mapPinManager=new zr,this.mapTooltipManager=new Vr,this.mapPopupManager=new Hr,this.mapElements=new Map}set configuration(e){this.mapPinManager.configuration=e,this.mapPopupManager.configuration=e}clearElements(){this.mapElements.clear(),this.mapPinManager.clear(),this.mapTooltipManager.clear(),this.mapPopupManager.clear()}removeElements(e){for(let t of e){let e=this.mapElements.get(t.data.id);e!=null&&(this.mapPinManager.remove(e.pin),this.mapTooltipManager.remove(e.tooltip),e.popup!=null&&this.mapPopupManager.remove(e.popup))}this.mapPinManager.refresh(),this.mapTooltipManager.refresh()}updateElements(e){for(let t of e){let e=this.mapElements.get(t.data.id);e!=null&&(this.mapPinManager.update(e.pin,t.state),this.mapTooltipManager.update(e.tooltip,t.state))}}insertElements(e,t){for(let n of e){let e=this.mapElements.get(n.data.id);e??(e=new Rr(n.data,this.mapProvider),e.tooltip.marker.div.addEventListener(`click`,e=>t(e,n.data.id)),this.mapElements.set(n.data.id,e)),this.mapPinManager.insert(e.pin,n.state),this.mapTooltipManager.insert(e.tooltip,n.state),e.popup!=null&&this.mapPopupManager.insert(e.popup)}this.mapPinManager.refresh(),this.mapTooltipManager.refresh()}async renderElements(e,t){this.mapPopupManager.render(),this.mapTooltipManager.render(e,t),this.mapPinManager.render(e,t)}showPopup(e){let t=this.mapElements.values();for(let n of t)n.id==e?this.mapPopupManager.show(n,this.mapProvider):this.mapPopupManager.hide(n)}hidePopup(e){let t=this.mapElements.get(e);t!=null&&this.mapPopupManager.hide(t)}hidePopups(){let e=this.mapElements.values();for(let t of e)this.mapPopupManager.hide(t)}};async function Wr(e){let t=JSON.stringify(e),n=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var Gr={object:Wr};const Kr=e.pipe(e.string(),e.length(32)),qr=e.pipe(e.string(),e.minLength(1));e.object({key:Kr,version:e.string()}),e.object({token:qr});const Jr=e.union([e.literal(`error`),e.literal(`warn`),e.literal(`info`)]);e.object({level:Jr,key:e.string(),title:e.string(),content:e.any()}),e.object({pin:e.optional(e.object({fade:e.optional(e.boolean()),maxZoom:e.optional(e.number())})),popup:e.optional(e.object({pan:e.optional(e.boolean())})),process:e.optional(e.object({visibility:e.optional(e.object({limit:e.optional(e.number()),cell:e.optional(e.object({size:e.optional(e.number()),capacity:e.optional(e.number()),depth:e.optional(e.number())}))})),states:e.optional(e.object({delay:e.optional(e.number())}))})),events:e.optional(e.object({error:e.optional(e.pipe(e.function(),e.args(e.tuple([e.string(),e.unknown()])),e.returns(e.void())))}))});const Yr=e.pipe(e.number(),e.minValue(-90),e.maxValue(90)),Xr=e.pipe(e.number(),e.minValue(-180),e.maxValue(180)),Zr=e.object({lat:Yr,lng:Xr}),Qr=e.object({sw:Zr,ne:Zr}),$r=e.object({bounds:Qr,center:Zr,zoom:e.number()}),ei=e.custom(e=>e instanceof HTMLElement,`Must be an HTMLElement`),ti=e.object({mapSize:e.pipe(e.number(),e.minValue(1)),zoomMin:e.pipe(e.number(),e.minValue(0)),zoomMax:e.pipe(e.number(),e.minValue(0)),zoomScale:e.pipe(e.number(),e.minValue(1),e.maxValue(10))}),ni=e.object({inserted:e.pipe(e.function(),e.args(e.tuple([])),e.returns(e.boolean())),insert:e.pipe(e.function(),e.args(e.tuple([])),e.returns(e.void())),remove:e.pipe(e.function(),e.args(e.tuple([])),e.returns(e.void())),update:e.pipe(e.function(),e.args(e.tuple([e.number()])),e.returns(e.void()))}),ri=e.union([e.literal(`idle`),e.literal(`move`),e.literal(`click`)]),ii=e.object({getParameters:e.pipe(e.function(),e.args(e.tuple([])),e.returns(ti)),getContainer:e.pipe(e.function(),e.args(e.tuple([])),e.returns(ei)),getZoom:e.pipe(e.function(),e.args(e.tuple([])),e.returns(e.number())),getBounds:e.pipe(e.function(),e.args(e.tuple([])),e.returns(Qr)),getCenter:e.pipe(e.function(),e.args(e.tuple([])),e.returns(Zr)),getViewport:e.pipe(e.function(),e.args(e.tuple([])),e.returns($r)),panBy:e.pipe(e.function(),e.args(e.tuple([e.number(),e.number()])),e.returns(e.void())),createMarker:e.pipe(e.function(),e.args(e.tuple([ei,Yr,Xr,e.number()])),e.returns(ni)),subscribe:e.pipe(e.function(),e.args(e.tuple([ri,e.function()])),e.returns(e.void())),unsubscribe:e.pipe(e.function(),e.args(e.tuple([ri,e.function()])),e.returns(e.void()))}),ai=e.pipe(e.function(),e.args(e.tuple([e.string()])),e.returnsAsync(e.pipeAsync(e.promise(),e.awaitAsync(),ei))),oi=e.object({dimensions:e.object({width:e.pipe(e.number(),e.minValue(0)),height:e.pipe(e.number(),e.minValue(0)),padding:e.pipe(e.number(),e.minValue(0)),radius:e.pipe(e.number(),e.minValue(0))}),colors:e.optional(e.object({background:e.optional(e.string()),border:e.optional(e.string()),shadow:e.optional(e.string())}))}),si=e.object({dimensions:e.pipe(e.object({width:e.pipe(e.number(),e.minValue(0)),height:e.pipe(e.number(),e.minValue(0)),margin:e.pipe(e.number(),e.minValue(0)),radius:e.pipe(e.number(),e.minValue(0))}),e.check(e=>Math.min(e.width,e.height)/e.margin>=4,`Minimum of width or height must be greater than or equal to 4 * margin`)),colors:e.optional(e.object({background:e.optional(e.string()),shadow:e.optional(e.string())}))}),ci=e.object({id:e.pipe(e.string(),e.minLength(1)),rank:e.pipe(e.number(),e.minValue(0)),lat:e.pipe(e.number(),e.minValue(-90),e.maxValue(90)),lng:e.pipe(e.number(),e.minValue(-180),e.maxValue(180)),tooltip:e.object({style:si,body:ai}),pin:e.optional(e.object({style:oi,body:e.optional(ai)})),popup:e.optional(e.object({style:si,body:ai}))}),li=e.tuple([e.number(),e.array(e.tuple([e.number(),e.number()]))]),ui=e.object({mapSize:e.pipe(e.number(),e.minValue(1)),zoomMin:e.pipe(e.number(),e.minValue(0),e.maxValue(24)),zoomMax:e.pipe(e.number(),e.minValue(0),e.maxValue(24)),zoomScale:e.pipe(e.number(),e.minValue(1),e.maxValue(10))}),di=e.object({id:e.string(),rank:e.number(),lat:e.number(),lng:e.number(),width:e.number(),height:e.number(),margin:e.number()});e.object({key:Kr,parameters:ui,input:e.array(di),token:e.string()}),e.object({token:e.optional(e.string()),states:e.array(li)});const fi=[500,1e3,2e3];var pi=class{apiKey;apiToken;apiDevEnvironment;mapMarkerStatesStore;constructor(e,t){this.apiKey=e,this.apiToken=t,this.apiDevEnvironment=window?.location.host.startsWith(`localhost`)||window?.location.host.startsWith(`127.0.0.1`),this.mapMarkerStatesStore=new Map}clearStates(){this.mapMarkerStatesStore.clear()}resetStates(e){for(let t=0;t<e.length;t++){let n=e[t];n.state=void 0}}async updateStates(e,t){if(e.length==0)return;e.sort((e,t)=>e.data.id.localeCompare(t.data.id));let n=e.map(e=>e.input),r=await Gr.object(n),i=this.mapMarkerStatesStore.get(r);i??(i=await this.fetchStates(n,t),this.mapMarkerStatesStore.set(r,i));for(let t=0;t<e.length;t++){let n=e[t];n.state=i[t]}}async fetchStates(e,t){if(e.length==0)return[];if(e.length==1)return[[0,[[0,Br.DEGREES.indexOf(Br.DEGREES_DEFAULT)]]]];let n={key:this.apiKey,token:this.apiToken,input:e,parameters:t},r=await o.retry(async()=>await o.post(`https://maps.api.arenarium.dev/states`,n,{headers:{"Cache-Control":this.apiDevEnvironment?`no-cache`:``},retry:3,delay:fi}));return r.token&&(this.apiToken=r.token),r.states}};const mi=`1.2.3`;var hi=class t{apiKey;mapProvider;mapMarkers;mapMarkersVisibilityManager;mapMarkerElementsManager;mapMarkerStatesManager;mapMarkerRenderProcessor;mapMarkerVisibilityProcessor;mapMarkerStateProcessor;mapMarkerStatesProcessDelay=500;mapMarkerStatesProcessTimeout=void 0;mapStateManager;constructor(t,n,r,i){e.parse(Kr,t),e.parse(qr,n),e.parse(ii,r),this.apiKey=t,this.mapProvider=r,this.mapProvider.getContainer().addEventListener(`click`,this.onMapClick.bind(this)),this.mapMarkers=new Map,this.mapMarkersVisibilityManager=new se(this.mapProvider),this.mapMarkerElementsManager=new Ur(this.mapProvider),this.mapMarkerStatesManager=new pi(t,n),this.mapMarkerRenderProcessor=new s(this.onMapMarkerRenderProcess.bind(this),500),this.mapMarkerVisibilityProcessor=new s(this.onMapMarkerVisiblityProcess.bind(this),500),this.mapMarkerStateProcessor=new s(this.onMapMarkerStateProcess.bind(this)),this.mapStateManager=new u(this.mapProvider,100/(navigator?.hardwareConcurrency??1),this.dettached.bind(this),this.error.bind(this),this.onMapMove.bind(this),this.onMapIdle.bind(this)),this.configuration=i}static async create(e,n,r){let i={key:e,version:mi},a=(await o.post(`https://maps.api.arenarium.dev/auth`,i)).token;if(!a)throw Error(`Failed to get api token`);return new t(e,a,n,r)}set configuration(e){this.mapMarkerStatesProcessDelay=e?.process?.states?.delay??500,this.mapMarkersVisibilityManager.configuration=e,this.mapMarkerElementsManager.configuration=e}clear(){this.mapMarkers.clear(),this.mapMarkersVisibilityManager.clearMarkers(),this.mapMarkerStatesManager.clearStates(),this.mapMarkerElementsManager.clearElements(),this.mapStateManager.stop(),this.mapMarkerVisibilityProcessor.stop(),this.mapMarkerStateProcessor.stop(),this.mapMarkerRenderProcessor.stop()}dettached(){return this.mapProvider.getContainer().parentElement==null}error(e,t){this.log(`error`,e,t),this.configuration?.events?.error?.(e,t)}async log(e,t,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!=0)try{let r={key:this.apiKey,title:t,level:e,content:{version:mi,...n}};await o.put(`https://maps.api.arenarium.dev/log`,r)}catch(e){console.error(e)}}onMapClick(){this.hidePopup()}onMapMarkerClick(e,t){e.stopPropagation(),this.showPopup(t)}onMapMove(){this.mapMarkerVisibilityProcessor.start()}onMapIdle(){this.mapMarkerStatesProcessTimeout&&window.clearTimeout(this.mapMarkerStatesProcessTimeout),this.mapMarkerStatesProcessTimeout=window.setTimeout(()=>{this.mapMarkerStateProcessor.start()},this.mapMarkerStatesProcessDelay)}async onMapMarkerVisiblityProcess(){try{if(this.dettached())return!0;let e=this.mapProvider.getViewport(),t=this.mapProvider.getParameters(),n=new Set(this.mapMarkersVisibilityManager.markers);this.mapMarkersVisibilityManager.updateVisibleMarkers(e,t);let r=new Set(this.mapMarkersVisibilityManager.markers),i=Array.from(n.difference(r)),a=Array.from(r.difference(n));return this.mapMarkerStatesManager.resetStates(i),this.mapMarkerElementsManager.removeElements(i),this.mapMarkerElementsManager.insertElements(a,this.onMapMarkerClick.bind(this)),this.mapMarkerRenderProcessor.start(),!1}catch(e){return this.clear(),this.error(`Failed to process map move`,e),!0}}async onMapMarkerStateProcess(){try{if(this.dettached())return!0;let e=this.mapMarkersVisibilityManager.markers,t=this.mapProvider.getParameters();return await this.mapMarkerStatesManager.updateStates(e,t),this.mapMarkerElementsManager.updateElements(e),this.mapMarkerRenderProcessor.start(),!1}catch(e){return this.clear(),this.error(`Failed to process map idle`,e),!0}}async onMapMarkerRenderProcess(){try{if(this.dettached())return!0;let e=this.mapProvider.getViewport(),t=this.mapProvider.getParameters();return this.mapMarkerElementsManager.renderElements(e,t),!1}catch(e){return this.clear(),this.error(`Failed to process map render`,e),!0}}updateMarkers(t){e.parse(e.array(ci),t);try{for(let e of t)this.mapMarkers.has(e.id)==0&&this.mapMarkers.set(e.id,new l(e));let e=Array.from(this.mapMarkers.values());e.sort((e,t)=>t.data.rank-e.data.rank),this.mapMarkersVisibilityManager.insertMarkers(e),this.mapStateManager.start(),this.mapMarkerVisibilityProcessor.start(),this.mapMarkerStateProcessor.start(),this.mapMarkerRenderProcessor.start()}catch(e){throw this.clear(),this.error(`Failed to update markers`,e),e}}removeMarkers(){try{this.clear()}catch(e){throw this.error(`Failed to remove markers`,e),e}}showPopup(e){try{this.mapMarkerElementsManager.showPopup(e)}catch(e){throw this.mapMarkerElementsManager.hidePopups(),this.error(`Failed to show popup`,e),e}finally{this.mapMarkerRenderProcessor.start()}}hidePopup(){try{this.mapMarkerElementsManager.hidePopups()}catch(e){throw this.error(`Failed to hide popup`,e),e}finally{this.mapMarkerRenderProcessor.start()}}};export{hi as MapManager};
|
|
1
|
+
async function s0(x){return new Promise((q)=>setTimeout(q,x))}async function r0(x,q){let J=0,Q=Math.max(1,q?.retry??1);while(J<Q)try{return await x()}catch(F){if(console.log(`[HTTP RETRY] ${J} of ${Q}`),console.log(F),J++,J==Q)throw F;if(q?.delay)await s0(q.delay[J-1]??0)}throw Error("Unreachable code")}async function H2(x,q){let J=await r0(async()=>await fetch(x,q));if(!J.ok)throw Error(J.statusText);return await J.json()}async function O2(x,q,J){let Q=await fetch(x,{method:"POST",body:JSON.stringify(q),headers:{"Content-Type":"application/json",...J?.headers},...J});if(!Q.ok)throw Error(Q.statusText);return await Q.json()}async function z2(x,q,J){let Q=await fetch(x,{method:"PUT",body:JSON.stringify(q),headers:{"Content-Type":"application/json",...J?.headers},...J});if(!Q.ok)throw Error(Q.statusText)}var L={delay:s0,retry:r0,get:H2,post:O2,put:z2};class d{endtime=0;lifespan;paused=!1;enqueued=!1;interval;timeout;callback;constructor(x,q,J){if((q??0)<0)throw Error("Lifespan must be greater than 0");if((J??0)<0)throw Error("Interval must be greater than 0");this.interval=J??(navigator?.hardwareConcurrency?100:200/navigator.hardwareConcurrency),this.lifespan=q??this.interval,this.callback=x}async run(){let x=performance.now();if(this.enqueued)this.endtime=x+this.lifespan,this.enqueued=!1;if(this.endtime<x){this.stop();return}if(this.paused==!1){if(await this.callback()&&!this.enqueued){this.stop();return}}this.timeout=window.setTimeout(this.run.bind(this),this.interval)}start(){if(this.enqueued=!0,!this.timeout)this.run()}stop(){if(this.timeout)window.clearTimeout(this.timeout);this.timeout=void 0}pause(){this.paused=!0}resume(){this.paused=!1}}class J0{data;state;constructor(x){this.data=x,this.state=void 0}get input(){return{id:this.data.id,rank:this.data.rank,lat:this.data.lat,lng:this.data.lng,width:this.data.tooltip.style.dimensions.width,height:this.data.tooltip.style.dimensions.height,margin:this.data.tooltip.style.dimensions.margin}}}class Q0{callback;timeout;id;constructor(x,q){if(q<=0)throw Error("Timeout must be greater than 0");this.callback=x,this.timeout=q}start(){if(this.id!=null)return;this.id=window.setInterval(this.callback,this.timeout)}stop(){if(this.id==null)return;window.clearInterval(this.id),this.id=void 0}}class G0{viewport=void 0;state="idle";provider;interval;onCancel;onError;onMove;onIdle;constructor(x,q,J,Q,F,G){this.provider=x,this.interval=new Q0(this.onInterval.bind(this),q),this.onCancel=J,this.onError=Q,this.onMove=F,this.onIdle=G}start(){this.interval.start()}stop(){this.interval.stop()}onInterval(){try{if(this.onCancel()){this.interval.stop();return}let x=this.provider.getViewport(),q=this.state,J=JSON.stringify(x)!==JSON.stringify(this.viewport)?"move":"idle";if(J=="move")this.onMove();if(J=="idle"&&q=="move")this.onIdle();this.state=J,this.viewport=x}catch(x){this.onError("Failed to process map state interval",x)}}}var i0=75,n0=150,R0=0.00025,p0=1e6,o0=2000000,k0=3000000,F0=10,g=16,h0=2,$=0.5,n="white",t0="darkgreen",K0="0px 2px 2px rgba(0, 0, 0, 0.5)";import W0 from"@arenarium/maps-core/mercator";class p{sw;ne;constructor(x,q,J,Q){if(J<x)throw Error(`Invalid bounds: ${x}, ${q}, ${J}, ${Q}`);if(Q<q)throw Error(`Invalid bounds: ${x}, ${q}, ${J}, ${Q}`);this.sw={lat:x,lng:q},this.ne={lat:J,lng:Q}}contains(x,q){if(x<this.sw.lat||this.ne.lat<x)return!1;if(q<this.sw.lng||this.ne.lng<q)return!1;return!0}intersects(x){if(x.ne.lat<this.sw.lat||this.ne.lat<x.sw.lat)return!1;if(x.ne.lng<this.sw.lng||this.ne.lng<x.sw.lng)return!1;return!0}}class b{blockL;blockR;sw;ne;constructor(x,q,J,Q){if(J<x)throw Error(`Invalid bounds: ${x}, ${q}, ${J}, ${Q}`);if(this.sw={lat:x,lng:q},this.ne={lat:J,lng:Q},q<Q)this.blockL=new p(x,q,J,Q),this.blockR=new p(0,0,0,0);else this.blockL=new p(x,-180,J,Q),this.blockR=new p(x,q,J,180)}static normalize(x){let{bounds:q,center:J}=x;if(Math.abs(q.ne.lng-J.lng)+Math.abs(q.sw.lng-J.lng)>360)q.sw.lng=-180,q.ne.lng=180;if(q.ne.lng-q.sw.lng>360){q.sw.lng=-180,q.ne.lng=180;return}if(q.sw.lng<-180)q.sw.lng+=360;if(q.sw.lng>180)q.sw.lng-=360;if(q.ne.lng<-180)q.ne.lng+=360;if(q.ne.lng>180)q.ne.lng-=360}static bounds(x){this.normalize(x);let q=x.bounds,J=q.sw,Q=q.ne;return new b(J.lat,J.lng,Q.lat,Q.lng)}static offset(x,q,J){this.normalize(x);let{bounds:Q,zoom:F}=x,G=q*Math.pow(2,F),j=W0.project(Q.sw.lat,Q.sw.lng,G),U=W0.project(Q.ne.lat,Q.ne.lng,G),V=Math.max(j.x-J.left,0),O=Math.min(j.y+J.bottom,G),B=Math.min(U.x+J.right,G),S=Math.max(U.y-J.top,0),N=W0.unproject(V,O,G),I=W0.unproject(B,S,G);return new b(N.lat,N.lng,I.lat,I.lng)}contains(x,q){return this.blockL.contains(x,q)||this.blockR.contains(x,q)}intersects(x){return this.blockL.intersects(x)||this.blockR.intersects(x)}}class Y0{id;bounds;markers;constructor(x,q){this.id=x,this.bounds=q,this.markers=[]}belongs(x){let q=this.bounds.sw;if(x.lat<q.lat)return!1;if(x.lng<q.lng)return!1;let J=this.bounds.ne;if(J.lat<x.lat)return!1;if(J.lng<x.lng)return!1;return!0}neighbours(x,q){let J=Math.abs(x.id.length-this.id.length);if(J>q)return!1;let Q=Math.min(this.id.length,x.id.length)-q+J;for(let F=0;F<Q;F++)if(this.id[F]!=x.id[F])return!1;return!0}}class Z0{tree;zoom;cell;branches;constructor(x,q,J,Q){this.tree=x,this.zoom=J,this.cell=new Y0(q,Q),this.branches=[]}split(){let x=this.cell.bounds,q=Math.pow(2,this.tree.depth),J=(x.ne.lat-x.sw.lat)/q,Q=(x.ne.lng-x.sw.lng)/q;for(let F=0;F<q;F++)for(let G=0;G<q;G++){let j=x.sw.lat+F*J,U=x.sw.lng+G*Q,V=j+J,O=U+Q;this.branches.push(new Z0(this.tree,`${this.cell.id}${F*2+G}`,this.zoom+this.tree.depth,{sw:{lat:j,lng:U},ne:{lat:V,lng:O}}))}}add(x){if(this.cell.belongs(x.data)==!1)return!1;if(this.cell.markers.length<this.tree.capacity)return this.cell.markers.push(x),!0;if(this.branches.length==0)this.split();for(let q=0;q<this.branches.length;q++)if(this.branches[q].add(x))return!0;throw Error("Failed to add marker to branch")}compact(){if(this.branches.length==0)return;for(let Q=0;Q<this.branches.length;Q++)this.branches[Q].compact();let x=[],q=[];for(let Q=0;Q<this.branches.length;Q++){let F=this.branches[Q];x.push(...F.branches),q.push(...F.cell.markers)}let J=new Z0(this.tree,this.cell.id,this.zoom+this.tree.depth,this.cell.bounds);J.branches=x,J.cell.markers=q,this.branches=[J]}cells(x,q,J){if(x<this.zoom)return J;if(q.intersects(this.cell.bounds)==!1)return J;J.push(this.cell);for(let Q=0;Q<this.branches.length;Q++)this.branches[Q].cells(x,q,J);return J}print(x){console.log(`${"---".repeat(x)}|${this.cell.id} zoom=[${this.zoom}] markers=[${this.cell.markers.length}]`);for(let q=0;q<this.branches.length;q++)this.branches[q].print(x+1)}count(){return this.cell.markers.length+this.branches.reduce((x,q)=>x+q.count(),0)}}class o{capacity;depth;root;constructor(x,q,J){this.capacity=J,this.depth=q,this.root=new Z0(this,"R",x,{sw:{lat:-90,lng:-180},ne:{lat:90,lng:180}})}add(x){return this.root.add(x)}compact(){this.root.compact()}cells(x,q){let J=[];return this.root.cells(x,q,J),J}print(){this.root.print(0)}}var a0=2,e0=1,x2=g*4,q2=1024;class j0{mapProvider;mapMarkersVisibilityTree;mapMarkersVisible;mapMarkerTreeCellCapacity=a0;mapMarkerTreeCellZoomDelta=e0;mapMarkerTreeCellSize=x2;mapMarkerTreeLimit=q2;constructor(x){this.mapProvider=x}set configuration(x){this.mapMarkerTreeCellCapacity=x?.process?.visibility?.cell?.capacity??a0,this.mapMarkerTreeCellZoomDelta=x?.process?.visibility?.cell?.depth??e0,this.mapMarkerTreeCellSize=x?.process?.visibility?.cell?.size??x2,this.mapMarkerTreeLimit=x?.process?.visibility?.limit??q2}get markers(){return Array.from(this.mapMarkersVisible??[])}insertMarkers(x){this.mapMarkersVisibilityTree=this.createVisibilityTree(x)}clearMarkers(){this.mapMarkersVisibilityTree=void 0,this.mapMarkersVisible=void 0}updateVisibleMarkers(x,q){if(this.mapMarkersVisibilityTree==null)return;let J=b.bounds(x),Q=[],F=x.zoom;while(F<q.zoomMax&&Q.length<this.mapMarkerTreeLimit)Q=this.mapMarkersVisibilityTree.cells(F,J).flatMap((G)=>G.markers),F++;this.mapMarkersVisible=Q}createVisibilityTree(x){if(x.length<this.mapMarkerTreeLimit){let q=new o(0,0,x.length);for(let J=0;J<x.length;J++){let Q=x[J];if(!q.add(Q))throw Error("Failed to add marker to fill tree")}return q}else{let q=-Math.floor(Math.log2(this.mapProvider.getParameters().mapSize/this.mapMarkerTreeCellSize)),J=new o(q,this.mapMarkerTreeCellZoomDelta,this.mapMarkerTreeCellCapacity);for(let F=0;F<x.length;F++){let G=x[F];if(!J.add(G))throw Error("Failed to add marker to fill tree")}let Q=-q;for(let F=0;F<Q;F++)J.compact();return J}}}import{mount as I2}from"svelte";import"svelte/internal/disclose-version";import*as K from"svelte/internal/client";import{sineInOut as B2}from"svelte/easing";class m{animationEasing;animationRun;animating;value;time;constructor(x){if(x.max<=x.min)throw Error("Min must be less than max");if(x.value<x.min||x.max<x.value)throw Error("Value must be between min and max");this.animationEasing=x.easing,this.animationRun=x.callback,this.animating=!1,this.value={current:x.value,start:x.value,end:x.value,min:x.min,max:x.max},this.time={start:0,end:0,span:x.timespan}}animationFrame(){let x=performance.now();if(x>this.time.end)this.value.current=this.value.end;else{let q=(x-this.time.start)/(this.time.end-this.time.start),J=this.animationEasing(q);this.value.current=this.value.start+(this.value.end-this.value.start)*J}if(this.animationRun(this.value.current),this.value.current===this.value.end){this.animating=!1;return}window.requestAnimationFrame(this.animationFrame.bind(this))}target(x){if(x===this.value.end)return;this.value.start=this.value.current,this.value.end=x;let q=performance.now(),J=Math.abs(this.value.start-this.value.end),Q=this.value.max-this.value.min;if(this.time.start=q,this.time.end=q+this.time.span*Math.sqrt(J/Q),this.animating)return;this.animating=!0,window.requestAnimationFrame(this.animationFrame.bind(this))}set(x){if(x===this.value.end)return;this.value.current=x,this.value.start=x,this.value.end=x;let q=performance.now();this.time.start=q,this.time.end=q,window.requestAnimationFrame(this.animationRun.bind(this,x))}end(){this.set(this.value.end)}expired(){return performance.now()>this.time.end}}var N2=K.from_html("<div></div>");function S0(x,q){K.push(q,!0);let J=K.rest_props(q,["$$slots","$$events","$$legacy"]),Q=q.id,F=q.style,G=q.content,j={setDisplayed:l,getDisplayed:A,setSuppressed:P,setCollapsed:z,getCollapsed:y,setScale:r};function U(){return j}let V,O=F.dimensions.width,B=F.dimensions.height,S=F.dimensions.radius,N=F.dimensions.padding??h0,I=F.colors?.border??n,D=F.colors?.background??t0,X=F.colors?.shadow??K0,Z=K.state(!1),M=!1,v=!1;function l(Y){if(Y==K.get(Z))return;if(K.set(Z,Y,!0),Y==!0){if(G==null)return;if(v)return;if(M)return;M=!0,G(Q).then((w)=>{if(w instanceof HTMLElement)V.appendChild(w);else console.error("Failed to load pin content")}).catch((w)=>console.error(w)).finally(()=>{v=!0,M=!1})}if(Y==!1)_.end()}function A(){return K.get(Z)}let C=K.state(!0);function P(Y){if(Y==K.get(C))return;if(K.set(C,Y,!0),Y)s=$,_.set($)}let H=K.state(!0);function z(Y){if(Y==K.get(H))return;K.set(H,Y,!0),_.target(K.get(H)?0:s)}function y(){if(!K.get(Z))return!0;return _.expired()}let s=$,_=new m({value:$,min:0,max:1,timespan:i0,easing:B2,callback:y0});function r(Y){s=Y,_.target(Y)}function y0(Y){V.style.scale=Y.toString(),V.style.filter=`brightness(${e(Y)})`}function e(Y){return 0.25+0.75*Y}var b0={invoke:U},T=N2();let x0;return K.bind_this(T,(Y)=>V=Y,()=>V),K.template_effect((Y)=>{K.set_class(T,1,K.clsx(["pin",K.get(Z)&&"displayed",K.get(C)&&"suppressed"]),"svelte-e30vfn4rttu1"),x0=K.set_style(T,"",x0,Y)},[()=>({width:`${O}px`,height:`${B}px`,"border-radius":`${S}px`,"border-color":I,"background-color":D,"border-width":`${N}px`,"box-shadow":X,scale:$,filter:`brightness(${e($)})`})]),K.append(x,T),K.pop(b0)}class E{div;marker;constructor(x,q,J,Q){this.div=document.createElement("div"),this.marker=x.createMarker(this.div,q,J,Q)}insert(){if(this.marker.inserted()==!0)return;this.marker.insert()}remove(){if(this.marker.inserted()==!1)return;this.marker.remove()}update(x){this.marker.update(x)}}class k{shown;id;lat;lng;rank;marker;constructor(x,q){if(new.target===k)throw Error("Cannot instantiate an abstract class directly.");this.shown=!0,this.id=x.id,this.lat=x.lat,this.lng=x.lng,this.rank=x.rank,this.marker=q}}class V0 extends k{width;height;zoom;component;constructor(x,q){super(x,new E(q,x.lat,x.lng,x.rank));let J=x.pin?.style.dimensions.width??g,Q=x.pin?.style.dimensions.height??g,F=x.pin?.style.dimensions.padding??h0,G=x.pin?.style.dimensions.radius??g/2;this.width=J,this.height=Q,this.zoom=NaN,this.component=I2(S0,{target:this.marker.div,props:{id:this.id,style:{dimensions:{width:J,height:Q,padding:F,radius:G},colors:x.pin?.style.colors},content:x.pin?.body}})}get zIndex(){if(Number.isNaN(this.zoom))return this.rank;return Math.round(-this.zoom*F0)+p0}}import{mount as D2}from"svelte";import"svelte/internal/disclose-version";import*as h from"svelte/internal/client";import{sineInOut as y2}from"svelte/easing";class t{animating;animationTimestamp;animationEnd;animationCallback;speed;value;constructor(x){this.animating=!1,this.animationTimestamp=0,this.animationEnd=0,this.animationCallback=x.callback,this.speed={current:0,spring:{stiffness:x.stiffness,damping:2*Math.sqrt(x.stiffness)}},this.value={current:x.value,target:x.value,precision:x.precision,min:x.min,max:x.max}}animationFrame(){try{let x=performance.now(),q=x-this.animationTimestamp;if(this.animationTimestamp=x,x>=this.animationEnd){this.speed.current=0,this.value.current=this.value.target;return}let J=this.value.target-this.value.current;if(Math.abs(J)<this.value.precision){this.speed.current=0,this.value.current=this.value.target;return}let Q=J*this.speed.spring.stiffness-this.speed.spring.damping*this.speed.current;if(this.speed.current+=Q*q,this.value.current+=this.speed.current*q,this.value.current<this.value.min){this.value.current=this.value.target,this.speed.current=0;return}if(this.value.current>this.value.max){this.value.current=this.value.target,this.speed.current=0;return}}finally{if(this.animationCallback(this.value.current),this.value.current===this.value.target){this.animating=!1;return}window.requestAnimationFrame(this.animationFrame.bind(this))}}target(x){if(x===this.value.target)return;let q=Math.sqrt(2*Math.abs(x-this.value.current)/this.speed.spring.stiffness);if(this.animationEnd=performance.now()+q,this.value.target=x,this.animating)return;this.animating=!0,this.animationTimestamp=performance.now(),window.requestAnimationFrame(this.animationFrame.bind(this))}set(x){if(x===this.value.target)return;this.animationEnd=performance.now(),this.value.current=x,this.value.target=x,this.speed.current=0,window.requestAnimationFrame(this.animationCallback.bind(this,x))}end(){this.set(this.value.target)}expired(){return performance.now()>this.animationEnd}}import J2 from"@arenarium/maps-core/rectangle";var b2=h.from_html('<div><div class="element pointer svelte-vkqe2rkto2oe"></div> <div class="element tooltip svelte-vkqe2rkto2oe"><div class="element body svelte-vkqe2rkto2oe"></div></div></div>');function a(x,q){h.push(q,!0);let J=h.rest_props(q,["$$slots","$$events","$$legacy"]),Q=q.id,F=q.style,G=q.content,j={setDisplayed:s,getDisplayed:_,setCollapsed:y0,getCollapsed:e,getExpanded:b0,setAngle:h2};function U(){return j}let V,O=F.colors?.shadow??K0,B,S=Math.min(F.dimensions.width,F.dimensions.height)/Math.SQRT2,N=Math.min(F.dimensions.width,F.dimensions.height)/Math.SQRT2,I=F.colors?.background??n,D,X=F.dimensions.width+2*F.dimensions.margin,Z=F.dimensions.height+2*F.dimensions.margin,M=F.dimensions.margin,v,l=F.dimensions.width,A=F.dimensions.height,C=F.dimensions.radius,P=F.colors?.background??n,H=h.state(!1),z=!1,y=!1;function s(W){if(W==h.get(H))return;if(h.set(H,W,!0),W){if(G==null)return;if(y)return;if(z)return;z=!0,G(Q).then((f)=>{if(f instanceof HTMLElement)v.appendChild(f);else console.error("Failed to load tooltip content")}).catch((f)=>console.error(f)).finally(()=>{y=!0,z=!1})}if(W==!1)T.end(),D0.end(),v0.end()}function _(){return h.get(H)}let r=h.state(!0);function y0(W){if(W==h.get(r))return;h.set(r,W,!0),T.target(h.get(r)?0:1)}function e(){if(!h.get(H))return!0;return T.expired()}function b0(){if(!h.get(H))return!1;return T.expired()}let T=new m({value:0,min:0,max:1,timespan:n0,easing:y2,callback:x0});function x0(W){V.style.opacity=`${W}`,D.style.scale=`${W}`,B.style.scale=`${W}`}let Y=NaN,w=h.state(!1),_0=-X/2,D0=new t({value:-X/2,min:-X,max:0,precision:1,stiffness:R0,callback:K2}),$0=-Z/2,v0=new t({value:-Z/2,min:-Z,max:0,precision:1,stiffness:R0,callback:W2});function h2(W,f){if(Number.isNaN(W)){Y=NaN,h.set(w,!1);return}if(h.get(w)==!1||f==!0){h.set(w,!0),Y=W;let R=J2.getOffsets(X,Z,W);D0.set(Math.round(R.x)),v0.set(Math.round(R.y));return}if(Y!=W){Y=W;let R=J2.getOffsets(X,Z,W);D0.target(Math.round(R.x)),v0.target(Math.round(R.y));return}}function K2(W){_0=W,E0()}function W2(W){$0=W,E0()}function E0(){let W=_0,f=$0,R=W+X/2,m0=f+Z/2,T0=Z<X?R*Z/X:R,f0=Z>X?m0*X/Z:m0,Z2=Math.atan2(f0,T0),u2=0,L2=30,w0=Math.sqrt(T0*T0+f0*f0),i=Math.min(X,Z)/2,j2=i*Math.SQRT2,V2=(w0-i)/(j2-i),X2=Z2/Math.PI*180-45,l0=0+V2*30,U2=w0<i?w0/i:1;D.style.transform=`translate(${Math.round(W)}px, ${Math.round(f)}px)`,B.style.transform=`scale(${U2}) rotate(${X2}deg) skew(${l0}deg, ${l0}deg)`}var Y2={invoke:U},u=b2();let c0;var C0=h.child(u);let u0;h.bind_this(C0,(W)=>B=W,()=>B);var q0=h.sibling(C0,2);let L0;var d0=h.child(q0);let g0;return h.bind_this(d0,(W)=>v=W,()=>v),h.reset(q0),h.bind_this(q0,(W)=>D=W,()=>D),h.reset(u),h.bind_this(u,(W)=>V=W,()=>V),h.template_effect(()=>{h.set_class(u,1,h.clsx(["element anchor",h.get(H)&&"displayed"]),"svelte-vkqe2rkto2oe"),c0=h.set_style(u,"",c0,{filter:`drop-shadow(${O})`}),u0=h.set_style(C0,"",u0,{width:`${S}px`,height:`${N}px`,"background-color":I}),L0=h.set_style(q0,"",L0,{width:`${X}px`,height:`${Z}px`,padding:`${M}px;`}),g0=h.set_style(d0,"",g0,{width:`${l}px`,height:`${A}px`,"border-radius":`${C}px;`,"background-color":P})}),h.append(x,u),h.pop(Y2)}class X0 extends k{width;height;zoom;angle;states;component;constructor(x,q){super(x,new E(q,x.lat,x.lng,x.rank));this.width=x.tooltip.style.dimensions.width+x.tooltip.style.dimensions.margin*2,this.height=x.tooltip.style.dimensions.height+x.tooltip.style.dimensions.margin*2,this.zoom=NaN,this.angle=NaN,this.states=[],this.component=D2(a,{target:this.marker.div,props:{id:this.id,style:x.tooltip.style,content:x.tooltip.body}})}get zIndex(){if(Number.isNaN(this.zoom))return this.rank;return Math.round(-this.zoom*F0)+o0}}import{mount as v2}from"svelte";class U0 extends k{width;height;margin;angle;component;constructor(x,q){if(x.popup==null)throw Error("Failed to create popup");super(x,new E(q,x.lat,x.lng,k0));this.width=x.popup.style.dimensions.width,this.height=x.popup.style.dimensions.height,this.margin=x.popup.style.dimensions.margin,this.angle=NaN,this.shown=!1,this.component=v2(a,{target:this.marker.div,props:{id:this.id,style:x.popup.style,content:x.popup.body}})}get zIndex(){return k0}}class H0{id;state=void 0;pin;tooltip;popup;constructor(x,q){if(this.id=x.id,this.pin=new V0(x,q),this.tooltip=new X0(x,q),x.popup!=null)this.popup=new U0(x,q)}}var M0=4;class O0{pins=new Set;pinMaxWidth=0;pinMaxHeight=0;pinFade=!1;pinZoomMax=M0;pinZoomDelta=M0;set configuration(x){this.pinFade=x?.pin?.fade??!0,this.pinZoomMax=x?.pin?.maxZoom??M0,this.pinZoomDelta=this.pinZoomMax}insert(x,q){this.update(x,q),this.pins.add(x)}update(x,q){x.zoom=q?q[0]:NaN,x.marker.update(x.zIndex)}remove(x){x.shown=!0,x.zoom=NaN,x.component.invoke().setCollapsed(!1),x.component.invoke().setSuppressed(!0),x.component.invoke().setDisplayed(!1),x.marker.update(x.zIndex),x.marker.remove(),this.pins.delete(x)}clear(){this.pins.forEach((x)=>x.marker.remove()),this.pins.clear()}refresh(){let x=Array.from(this.pins);this.pinMaxWidth=x.reduce((q,J)=>Math.max(q,J.width),0),this.pinMaxHeight=x.reduce((q,J)=>Math.max(q,J.height),0),this.pinZoomDelta=Math.max(1,this.pinZoomMax-Math.log10(x.length))}render(x,q){let J=x.zoom,Q=q.mapSize,F=b.offset(x,Q,{top:this.pinMaxHeight,bottom:this.pinMaxHeight,right:this.pinMaxWidth,left:this.pinMaxWidth});for(let G of this.pins)if(F.contains(G.lat,G.lng)){if(Number.isNaN(G.zoom))G.component.invoke().setDisplayed(!0),G.component.invoke().setSuppressed(!0),G.component.invoke().setCollapsed(!1),G.marker.insert();else if(G.component.invoke().setSuppressed(!1),G.shown&&J<G.zoom&&G.zoom<J+this.pinZoomDelta)G.component.invoke().setDisplayed(!0),G.component.invoke().setCollapsed(!1),G.component.invoke().setScale(this.pinFade?Math.max(0,1-(G.zoom-J)*0.2):1),G.marker.insert();else if(G.component.invoke().setCollapsed(!0),G.component.invoke().getCollapsed())G.component.invoke().setDisplayed(!1),G.marker.remove()}else G.component.invoke().setDisplayed(!1),G.marker.remove()}}import C2 from"@arenarium/maps-core/angles";class z0{tooltips=new Set;tooltipMaxWidth=0;tooltipMaxHeight=0;insert(x,q){this.update(x,q),this.tooltips.add(x)}update(x,q){if(q)x.zoom=q[0],x.states=q[1].map((J)=>[J[0],C2.DEGREES[J[1]]]);else x.zoom=NaN,x.states=[];x.marker.update(x.zIndex)}remove(x){x.shown=!0,x.zoom=NaN,x.angle=NaN,x.states=[],x.component.invoke().setAngle(NaN),x.component.invoke().setCollapsed(!0),x.component.invoke().setDisplayed(!1),x.marker.update(x.zIndex),x.marker.remove(),this.tooltips.delete(x)}clear(){this.tooltips.forEach((x)=>x.marker.remove()),this.tooltips.clear()}refresh(){let x=Array.from(this.tooltips);this.tooltipMaxWidth=x.reduce((q,J)=>Math.max(q,J.width),0),this.tooltipMaxHeight=x.reduce((q,J)=>Math.max(q,J.height),0)}render(x,q){let J=x.zoom,Q=q.mapSize,F=b.offset(x,Q,{top:this.tooltipMaxHeight,bottom:this.tooltipMaxHeight,right:this.tooltipMaxWidth,left:this.tooltipMaxWidth});for(let G of this.tooltips)if(F.contains(G.lat,G.lng)){if(Number.isNaN(G.zoom)==!1&&G.shown&&G.zoom<=J){let j=G.states.findLast((U)=>U[0]<=J)?.[1];if(j==null)throw Error("Angle not found");G.angle=j,G.component.invoke().setDisplayed(!0),G.component.invoke().setCollapsed(!1),G.component.invoke().setAngle(j),G.marker.insert()}else if(G.component.invoke().setCollapsed(!0),G.component.invoke().getCollapsed())G.component.invoke().setDisplayed(!1),G.marker.remove()}else G.component.invoke().setDisplayed(!1),G.marker.remove()}}import A0 from"@arenarium/maps-core/mercator";import T2 from"@arenarium/maps-core/rectangle";class B0{popups=new Set;pan=!0;set configuration(x){this.pan=x?.popup?.pan??!0}insert(x){this.popups.add(x)}remove(x){x.angle=NaN,x.shown=!1,x.marker.remove(),x.component.invoke().setAngle(NaN),x.component.invoke().setCollapsed(!0),x.component.invoke().setDisplayed(!1),this.popups.delete(x)}clear(){this.popups.forEach((x)=>x.marker.remove()),this.popups.clear()}show(x,q){if(!x.popup||!x.tooltip||!x.pin)return;if(x.pin.shown=!1,x.tooltip.shown=!1,x.popup.angle=x.tooltip.angle,x.popup.shown=!0,this.pan==!1)return;let J=x.popup,Q=q.getViewport(),F=Q.bounds,G=Q.zoom,U=q.getParameters().mapSize*Math.pow(2,G),V=A0.project(F.ne.lat,F.sw.lng,U),O=A0.project(F.sw.lat,F.ne.lng,U),B=O.x-V.x,S=O.y-V.y,N=J.width+J.margin*8,I=J.height+J.margin*8,D=A0.project(J.lat,J.lng,U),X=T2.getOffsets(N,I,x.tooltip.angle),Z=D.x+X.x,M=Z+N,v=D.y+X.y,l=v+I,A=Z-V.x,C=O.x-M,P=v-V.y,H=O.y-l,z=0;if(B<N)z=(A-C)/2;else{if(A<0)z=A;if(C<0)z=-C}let y=0;if(S<I)y=(P-H)/2;else{if(P<0)y=P;if(H<0)y=-H}if(z!=0||y!=0)q.panBy(z,y)}hide(x){if(!x.popup||!x.tooltip||!x.pin)return;x.pin.shown=!0,x.tooltip.shown=!0,x.popup.shown=!1}render(){for(let x of this.popups)if(x.shown)x.component.invoke().setDisplayed(!0),x.component.invoke().setCollapsed(!1),x.component.invoke().setAngle(x.angle,!0),x.marker.insert();else if(x.component.invoke().setCollapsed(!0),x.component.invoke().getCollapsed())x.component.invoke().setDisplayed(!1),x.marker.remove()}}class N0{mapProvider;mapPinManager;mapTooltipManager;mapPopupManager;mapElements;constructor(x){this.mapProvider=x,this.mapPinManager=new O0,this.mapTooltipManager=new z0,this.mapPopupManager=new B0,this.mapElements=new Map}set configuration(x){this.mapPinManager.configuration=x,this.mapPopupManager.configuration=x}clearElements(){this.mapElements.clear(),this.mapPinManager.clear(),this.mapTooltipManager.clear(),this.mapPopupManager.clear()}removeElements(x){for(let q of x){let J=this.mapElements.get(q.data.id);if(J==null)continue;if(this.mapPinManager.remove(J.pin),this.mapTooltipManager.remove(J.tooltip),J.popup!=null)this.mapPopupManager.remove(J.popup)}this.mapPinManager.refresh(),this.mapTooltipManager.refresh()}updateElements(x){for(let q of x){let J=this.mapElements.get(q.data.id);if(J==null)continue;this.mapPinManager.update(J.pin,q.state),this.mapTooltipManager.update(J.tooltip,q.state)}}insertElements(x,q){for(let J of x){let Q=this.mapElements.get(J.data.id);if(Q==null)Q=new H0(J.data,this.mapProvider),Q.tooltip.marker.div.addEventListener("click",(F)=>q(F,J.data.id)),this.mapElements.set(J.data.id,Q);if(this.mapPinManager.insert(Q.pin,J.state),this.mapTooltipManager.insert(Q.tooltip,J.state),Q.popup!=null)this.mapPopupManager.insert(Q.popup)}this.mapPinManager.refresh(),this.mapTooltipManager.refresh()}renderElements(x,q){this.mapPopupManager.render(),this.mapTooltipManager.render(x,q),this.mapPinManager.render(x,q)}showPopup(x){let q=this.mapElements.values();for(let J of q)if(J.id==x)this.mapPopupManager.show(J,this.mapProvider);else this.mapPopupManager.hide(J)}hidePopup(x){let q=this.mapElements.get(x);if(q==null)return;this.mapPopupManager.hide(q)}hidePopups(){let x=this.mapElements.values();for(let q of x)this.mapPopupManager.hide(q)}}import f2 from"@arenarium/maps-core/hash";import Q2 from"@arenarium/maps-core/angles";var w2="https://maps.api.arenarium.dev/states",R2=3,k2=[500,1000,2000];class I0{apiKey;apiToken;apiDevEnvironment;mapMarkerStatesStore;constructor(x,q){this.apiKey=x,this.apiToken=q,this.apiDevEnvironment=window?.location.host.startsWith("localhost")||window?.location.host.startsWith("127.0.0.1"),this.mapMarkerStatesStore=new Map}clearStates(){this.mapMarkerStatesStore.clear()}resetStates(x){for(let q=0;q<x.length;q++){let J=x[q];J.state=void 0}}async updateStates(x,q){if(x.length==0)return;x.sort((G,j)=>G.data.id.localeCompare(j.data.id));let J=x.map((G)=>G.input),Q=await f2.object(J),F=this.mapMarkerStatesStore.get(Q);if(F==null)F=await this.fetchStates(J,q),this.mapMarkerStatesStore.set(Q,F);for(let G=0;G<x.length;G++){let j=x[G];j.state=F[G]}}async fetchStates(x,q){if(x.length==0)return[];if(x.length==1)return[[0,[[0,Q2.DEGREES.indexOf(Q2.DEGREES_DEFAULT)]]]];let J={key:this.apiKey,token:this.apiToken,input:x,parameters:q},Q=await L.retry(async()=>await L.post(w2,J,{headers:{"Cache-Control":this.apiDevEnvironment?"no-cache":""},retry:R2,delay:k2}));if(Q.token)this.apiToken=Q.token;return Q.states}}import{apiKeySchema as S2,apiTokenSchema as M2,mapMarkerDataSchema as A2,mapProviderSchema as P2}from"@arenarium/maps-core/schemas";import*as c from"valibot";var G2="1.2.4",_2="https://maps.api.arenarium.dev/auth",$2="https://maps.api.arenarium.dev/log",E2=100,F2=500,c2=500;class P0{apiKey;mapProvider;mapMarkers;mapMarkersVisibilityManager;mapMarkerElementsManager;mapMarkerStatesManager;mapMarkerRenderProcessor;mapMarkerVisibilityProcessor;mapMarkerStateProcessor;mapMarkerStatesProcessDelay=500;mapMarkerStatesProcessTimeout=void 0;mapStateManager;constructor(x,q,J,Q){c.parse(S2,x),c.parse(M2,q),c.parse(P2,J),this.apiKey=x,this.mapProvider=J,this.mapProvider.getContainer().addEventListener("click",this.onMapClick.bind(this)),this.mapMarkers=new Map,this.mapMarkersVisibilityManager=new j0(this.mapProvider),this.mapMarkerElementsManager=new N0(this.mapProvider),this.mapMarkerStatesManager=new I0(x,q),this.mapMarkerRenderProcessor=new d(this.onMapMarkerRenderProcess.bind(this),F2),this.mapMarkerVisibilityProcessor=new d(this.onMapMarkerVisiblityProcess.bind(this),F2),this.mapMarkerStateProcessor=new d(this.onMapMarkerStateProcess.bind(this)),this.mapStateManager=new G0(this.mapProvider,E2/(navigator?.hardwareConcurrency??1),this.dettached.bind(this),this.error.bind(this),this.onMapMove.bind(this),this.onMapIdle.bind(this)),this.configuration=Q}static async create(x,q,J){let Q={key:x,version:G2},G=(await L.post(_2,Q)).token;if(!G)throw Error("Failed to get api token");return new P0(x,G,q,J)}set configuration(x){this.mapMarkerStatesProcessDelay=x?.process?.states?.delay??c2,this.mapMarkersVisibilityManager.configuration=x,this.mapMarkerElementsManager.configuration=x}clear(){this.mapMarkers.clear(),this.mapMarkersVisibilityManager.clearMarkers(),this.mapMarkerStatesManager.clearStates(),this.mapMarkerElementsManager.clearElements(),this.mapStateManager.stop(),this.mapMarkerVisibilityProcessor.stop(),this.mapMarkerStateProcessor.stop(),this.mapMarkerRenderProcessor.stop()}dettached(){return this.mapProvider.getContainer().parentElement==null}error(x,q){this.log("error",x,q),this.configuration?.events?.error?.(x,q)}async log(x,q,J){switch(x){case"info":console.info(J);break;case"warning":console.warn(J);break;case"error":console.error(J);break}if(J instanceof Error==!1)return;try{let Q={key:this.apiKey,title:q,level:x,content:{version:G2,...J}};await L.put($2,Q)}catch(Q){console.error(Q)}}onMapClick(){this.hidePopup()}onMapMarkerClick(x,q){x.stopPropagation(),this.showPopup(q)}onMapMove(){this.mapMarkerVisibilityProcessor.start()}onMapIdle(){if(this.mapMarkerStatesProcessTimeout)window.clearTimeout(this.mapMarkerStatesProcessTimeout);this.mapMarkerStatesProcessTimeout=window.setTimeout(()=>{this.mapMarkerStateProcessor.start()},this.mapMarkerStatesProcessDelay)}async onMapMarkerVisiblityProcess(){try{if(this.dettached())return!0;let x=this.mapProvider.getViewport(),q=this.mapProvider.getParameters(),J=new Set(this.mapMarkersVisibilityManager.markers);this.mapMarkersVisibilityManager.updateVisibleMarkers(x,q);let Q=new Set(this.mapMarkersVisibilityManager.markers),F=Array.from(J.difference(Q)),G=Array.from(Q.difference(J));return this.mapMarkerStatesManager.resetStates(F),this.mapMarkerElementsManager.removeElements(F),this.mapMarkerElementsManager.insertElements(G,this.onMapMarkerClick.bind(this)),this.mapMarkerRenderProcessor.start(),!1}catch(x){return this.clear(),this.error("Failed to process map move",x),!0}}async onMapMarkerStateProcess(){try{if(this.dettached())return!0;let x=this.mapMarkersVisibilityManager.markers,q=this.mapProvider.getParameters();return await this.mapMarkerStatesManager.updateStates(x,q),this.mapMarkerElementsManager.updateElements(x),this.mapMarkerRenderProcessor.start(),!1}catch(x){return this.clear(),this.error("Failed to process map idle",x),!0}}async onMapMarkerRenderProcess(){try{if(this.dettached())return!0;let x=this.mapProvider.getViewport(),q=this.mapProvider.getParameters();return this.mapMarkerElementsManager.renderElements(x,q),!1}catch(x){return this.clear(),this.error("Failed to process map render",x),!0}}updateMarkers(x){c.parse(c.array(A2),x);try{for(let J of x)if(this.mapMarkers.has(J.id)==!1)this.mapMarkers.set(J.id,new J0(J));let q=Array.from(this.mapMarkers.values());q.sort((J,Q)=>Q.data.rank-J.data.rank),this.mapMarkersVisibilityManager.insertMarkers(q),this.mapStateManager.start(),this.mapMarkerVisibilityProcessor.start(),this.mapMarkerStateProcessor.start(),this.mapMarkerRenderProcessor.start()}catch(q){throw this.clear(),this.error("Failed to update markers",q),q}}removeMarkers(){try{this.clear()}catch(x){throw this.error("Failed to remove markers",x),x}}showPopup(x){try{this.mapMarkerElementsManager.showPopup(x)}catch(q){throw this.mapMarkerElementsManager.hidePopups(),this.error("Failed to show popup",q),q}finally{this.mapMarkerRenderProcessor.start()}}hidePopup(){try{this.mapMarkerElementsManager.hidePopups()}catch(x){throw this.error("Failed to hide popup",x),x}finally{this.mapMarkerRenderProcessor.start()}}}export{P0 as MapManager};
|
package/package.json
CHANGED
|
@@ -1,87 +1,96 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
2
|
+
"name": "@arenarium/maps",
|
|
3
|
+
"version": "1.2.5",
|
|
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
|
+
"clean-package": {
|
|
89
|
+
"indent": 2,
|
|
90
|
+
"remove": [
|
|
91
|
+
"scripts",
|
|
92
|
+
"devDependencies",
|
|
93
|
+
"private"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|