@geotrekce/geotrek-rando-widget 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{css-shim-6f592941.js → css-shim-06c204c1.js} +1 -1
- package/dist/cjs/{dom-d5e52c7e.js → dom-874a1e39.js} +1 -1
- package/dist/cjs/geotrek-rando-widget.cjs.js +4 -4
- package/dist/cjs/grw-app.cjs.entry.js +4 -3
- package/dist/cjs/grw-filter_6.cjs.entry.js +14447 -14156
- package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +2 -2
- package/dist/cjs/grw-trek-card.cjs.entry.js +15 -7
- package/dist/cjs/{index-66d58516.js → index-c3fb4999.js} +219 -66
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{shadow-css-cf936b02.js → shadow-css-a33dc836.js} +1 -1
- package/dist/cjs/{store-d301af22.js → store-5183d8f8.js} +4 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/grw-app/grw-app.js +432 -450
- package/dist/collection/components/grw-filter/grw-filter.js +65 -61
- package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +35 -44
- package/dist/collection/components/grw-map/grw-map.css +5 -4
- package/dist/collection/components/grw-map/grw-map.js +251 -217
- package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +33 -32
- package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +42 -47
- package/dist/collection/components/grw-trek-card/grw-trek-card.js +142 -129
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +135 -208
- package/dist/collection/components/grw-treks-list/grw-treks-list.js +95 -65
- package/dist/collection/store/grw-trek-provider.js +61 -55
- package/dist/collection/store/grw-treks-provider.js +181 -177
- package/dist/collection/store/store.js +3 -2
- package/dist/components/grw-app.js +3 -2
- package/dist/components/grw-map2.js +14405 -14129
- package/dist/components/grw-trek-card2.js +17 -7
- package/dist/components/grw-trek-detail2.js +10 -3
- package/dist/components/grw-trek-provider2.js +6 -2
- package/dist/components/grw-treks-list2.js +7 -2
- package/dist/components/grw-treks-provider2.js +5 -3
- package/dist/components/store.js +3 -2
- package/dist/esm/{css-shim-2d0a698c.js → css-shim-bfa379cd.js} +1 -1
- package/dist/esm/{dom-9794f747.js → dom-104fb833.js} +1 -1
- package/dist/esm/geotrek-rando-widget.js +4 -4
- package/dist/esm/grw-app.entry.js +4 -3
- package/dist/esm/grw-filter_6.entry.js +14427 -14136
- package/dist/esm/grw-information-desk-detail_3.entry.js +2 -2
- package/dist/esm/grw-trek-card.entry.js +15 -7
- package/dist/esm/{index-899307bb.js → index-e834943f.js} +219 -66
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{shadow-css-4cd4480f.js → shadow-css-4261c637.js} +1 -1
- package/dist/esm/{store-70461a28.js → store-c6ccb3db.js} +4 -3
- package/dist/esm-es5/{css-shim-2d0a698c.js → css-shim-bfa379cd.js} +0 -0
- package/dist/esm-es5/{dom-9794f747.js → dom-104fb833.js} +0 -0
- package/dist/esm-es5/geotrek-rando-widget.js +1 -1
- package/dist/esm-es5/grw-app.entry.js +1 -1
- package/dist/esm-es5/grw-filter_6.entry.js +4 -5
- package/dist/esm-es5/grw-information-desk-detail_3.entry.js +1 -1
- package/dist/esm-es5/grw-trek-card.entry.js +1 -1
- package/dist/esm-es5/{index-899307bb.js → index-e834943f.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{shadow-css-4cd4480f.js → shadow-css-4261c637.js} +0 -0
- package/dist/esm-es5/{store-70461a28.js → store-c6ccb3db.js} +1 -1
- package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
- package/dist/geotrek-rando-widget/geotrek-rando-widget.js +1 -1
- package/dist/geotrek-rando-widget/p-392538a1.system.entry.js +1 -0
- package/dist/geotrek-rando-widget/{p-d1582cff.js → p-4c61dcad.js} +0 -0
- package/dist/geotrek-rando-widget/p-4e0fcbe6.js +1 -0
- package/dist/geotrek-rando-widget/p-6469fc8a.system.js +1 -0
- package/dist/geotrek-rando-widget/{p-c8c96517.system.js → p-6523a23b.system.js} +0 -0
- package/dist/geotrek-rando-widget/{p-32d97a4f.system.js → p-70ecdd1b.system.js} +0 -0
- package/dist/geotrek-rando-widget/{p-0c5b047c.js → p-88046639.js} +0 -0
- package/dist/geotrek-rando-widget/p-88e55e13.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-93d51eaa.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-95932d69.system.entry.js +5 -0
- package/dist/geotrek-rando-widget/{p-4690907e.js → p-9c0d229f.js} +1 -1
- package/dist/geotrek-rando-widget/{p-b1530d9c.system.js → p-a8de6293.system.js} +0 -0
- package/dist/geotrek-rando-widget/p-d56c1888.system.entry.js +1 -0
- package/dist/geotrek-rando-widget/{p-533fc2bb.entry.js → p-dce99cef.entry.js} +1 -1
- package/dist/geotrek-rando-widget/{p-8f9914f4.system.js → p-e2d589f8.system.js} +1 -1
- package/dist/geotrek-rando-widget/{p-82ca029f.system.js → p-e3c13365.system.js} +1 -1
- package/dist/geotrek-rando-widget/{p-2bd0278f.system.entry.js → p-e9f13f25.system.entry.js} +1 -1
- package/dist/geotrek-rando-widget/{p-4eaf20b7.js → p-ef5d4167.js} +0 -0
- package/dist/geotrek-rando-widget/p-fce69064.entry.js +1 -0
- package/dist/types/components/grw-map/grw-map.d.ts +3 -1
- package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +4 -1
- package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +3 -1
- package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +1 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/store/store.d.ts +5 -3
- package/dist/types/types/types.d.ts +6 -0
- package/loader/package.json +1 -0
- package/package.json +12 -12
- package/readme.md +4 -6
- package/dist/geotrek-rando-widget/p-067c02c4.system.js +0 -1
- package/dist/geotrek-rando-widget/p-18038011.js +0 -1
- package/dist/geotrek-rando-widget/p-2712caa8.system.entry.js +0 -6
- package/dist/geotrek-rando-widget/p-3ed52659.entry.js +0 -1
- package/dist/geotrek-rando-widget/p-48d5dde7.entry.js +0 -1
- package/dist/geotrek-rando-widget/p-e1431f36.system.entry.js +0 -1
- package/dist/geotrek-rando-widget/p-e38f4ff4.system.entry.js +0 -1
- package/dist/geotrek-rando-widget/p-f5d98aae.entry.js +0 -1
|
@@ -49,6 +49,7 @@ export namespace Components {
|
|
|
49
49
|
"colorPrimaryTint": string;
|
|
50
50
|
"colorSensitiveArea": string;
|
|
51
51
|
"colorTrekLine": string;
|
|
52
|
+
"resetStoreOnDisconnected": boolean;
|
|
52
53
|
"urlLayer": string;
|
|
53
54
|
"zoom": number;
|
|
54
55
|
}
|
|
@@ -62,12 +63,14 @@ export namespace Components {
|
|
|
62
63
|
"colorPrimary": string;
|
|
63
64
|
"colorPrimaryTint": string;
|
|
64
65
|
"isLargeView": boolean;
|
|
66
|
+
"resetStoreOnDisconnected": boolean;
|
|
65
67
|
"trek": Trek;
|
|
66
68
|
}
|
|
67
69
|
interface GrwTrekDetail {
|
|
68
70
|
"colorPrimary": string;
|
|
69
71
|
"colorPrimaryShade": string;
|
|
70
72
|
"colorPrimaryTint": string;
|
|
73
|
+
"resetStoreOnDisconnected": boolean;
|
|
71
74
|
"trek": Trek;
|
|
72
75
|
}
|
|
73
76
|
interface GrwTrekProvider {
|
|
@@ -79,6 +82,7 @@ export namespace Components {
|
|
|
79
82
|
"colorPrimary": string;
|
|
80
83
|
"colorPrimaryTint": string;
|
|
81
84
|
"isLargeView": boolean;
|
|
85
|
+
"resetStoreOnDisconnected": boolean;
|
|
82
86
|
}
|
|
83
87
|
interface GrwTreksProvider {
|
|
84
88
|
"api": string;
|
|
@@ -226,6 +230,7 @@ declare namespace LocalJSX {
|
|
|
226
230
|
"colorSensitiveArea"?: string;
|
|
227
231
|
"colorTrekLine"?: string;
|
|
228
232
|
"onTrekCardPress"?: (event: GrwMapCustomEvent<number>) => void;
|
|
233
|
+
"resetStoreOnDisconnected"?: boolean;
|
|
229
234
|
"urlLayer"?: string;
|
|
230
235
|
"zoom"?: number;
|
|
231
236
|
}
|
|
@@ -240,12 +245,14 @@ declare namespace LocalJSX {
|
|
|
240
245
|
"colorPrimaryTint"?: string;
|
|
241
246
|
"isLargeView"?: boolean;
|
|
242
247
|
"onTrekCardPress"?: (event: GrwTrekCardCustomEvent<number>) => void;
|
|
248
|
+
"resetStoreOnDisconnected"?: boolean;
|
|
243
249
|
"trek"?: Trek;
|
|
244
250
|
}
|
|
245
251
|
interface GrwTrekDetail {
|
|
246
252
|
"colorPrimary"?: string;
|
|
247
253
|
"colorPrimaryShade"?: string;
|
|
248
254
|
"colorPrimaryTint"?: string;
|
|
255
|
+
"resetStoreOnDisconnected"?: boolean;
|
|
249
256
|
"trek"?: Trek;
|
|
250
257
|
}
|
|
251
258
|
interface GrwTrekProvider {
|
|
@@ -257,6 +264,7 @@ declare namespace LocalJSX {
|
|
|
257
264
|
"colorPrimary"?: string;
|
|
258
265
|
"colorPrimaryTint"?: string;
|
|
259
266
|
"isLargeView"?: boolean;
|
|
267
|
+
"resetStoreOnDisconnected"?: boolean;
|
|
260
268
|
}
|
|
261
269
|
interface GrwTreksProvider {
|
|
262
270
|
"api"?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LatLngBounds } from 'leaflet';
|
|
2
|
-
import { Accessibilities, accessibilitiesLevel, Difficulties, Durations, InformationDesks, Labels, Pois, PoiTypes, Practices, Routes, SensitiveAreas, Sources, Themes, Trek, Treks } from 'types/types';
|
|
2
|
+
import { Accessibilities, accessibilitiesLevel, Difficulties, Durations, InformationDesks, Labels, Pois, PoiTypes, Practices, Routes, SensitiveAreas, Sources, Themes, Cities, Trek, Treks } from 'types/types';
|
|
3
3
|
declare const state: {
|
|
4
4
|
api: string;
|
|
5
5
|
treks: Treks;
|
|
@@ -10,6 +10,7 @@ declare const state: {
|
|
|
10
10
|
routes: Routes;
|
|
11
11
|
practices: Practices;
|
|
12
12
|
themes: Themes;
|
|
13
|
+
cities: Cities;
|
|
13
14
|
durations: Durations;
|
|
14
15
|
labels: Labels;
|
|
15
16
|
sources: Sources;
|
|
@@ -32,6 +33,7 @@ declare const state: {
|
|
|
32
33
|
routes: Routes;
|
|
33
34
|
practices: Practices;
|
|
34
35
|
themes: Themes;
|
|
36
|
+
cities: Cities;
|
|
35
37
|
durations: Durations;
|
|
36
38
|
labels: Labels;
|
|
37
39
|
sources: Sources;
|
|
@@ -44,6 +46,6 @@ declare const state: {
|
|
|
44
46
|
currentInformationDesks: InformationDesks;
|
|
45
47
|
treksNetworkError: boolean;
|
|
46
48
|
trekNetworkError: boolean;
|
|
47
|
-
}
|
|
48
|
-
export { onChange };
|
|
49
|
+
}>, reset: () => void;
|
|
50
|
+
export { onChange, reset };
|
|
49
51
|
export default state;
|
|
@@ -14,6 +14,7 @@ export declare type Trek = {
|
|
|
14
14
|
length_2d: number;
|
|
15
15
|
ascent: number;
|
|
16
16
|
departure: string;
|
|
17
|
+
departure_city: string;
|
|
17
18
|
arrival?: string;
|
|
18
19
|
altimetric_profile?: string;
|
|
19
20
|
geometry?: LineString;
|
|
@@ -78,6 +79,11 @@ export declare type Theme = {
|
|
|
78
79
|
label: string;
|
|
79
80
|
pictogram: string;
|
|
80
81
|
};
|
|
82
|
+
export declare type Cities = City[];
|
|
83
|
+
export declare type City = {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
};
|
|
81
87
|
export declare type Labels = Label[];
|
|
82
88
|
export declare type Label = {
|
|
83
89
|
id: number;
|
package/loader/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geotrekce/geotrek-rando-widget",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Geotrek Rando Widget",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"prepare": "npm run build"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@stencil/core": "^2.
|
|
31
|
-
"leaflet": "^1.
|
|
30
|
+
"@stencil/core": "^2.18.0",
|
|
31
|
+
"leaflet": "^1.9.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@babel/core": "^7.
|
|
35
|
-
"@stencil/sass": "^
|
|
36
|
-
"@stencil/store": "^2.0.
|
|
37
|
-
"@storybook/addon-controls": "^6.5.
|
|
38
|
-
"@storybook/addon-docs": "^6.5.
|
|
39
|
-
"@storybook/builder-webpack4": "^6.5.
|
|
40
|
-
"@storybook/html": "^6.5.
|
|
41
|
-
"@storybook/manager-webpack4": "^6.5.
|
|
34
|
+
"@babel/core": "^7.19.1",
|
|
35
|
+
"@stencil/sass": "^2.0.0",
|
|
36
|
+
"@stencil/store": "^2.0.1",
|
|
37
|
+
"@storybook/addon-controls": "^6.5.12",
|
|
38
|
+
"@storybook/addon-docs": "^6.5.12",
|
|
39
|
+
"@storybook/builder-webpack4": "^6.5.12",
|
|
40
|
+
"@storybook/html": "^6.5.12",
|
|
41
|
+
"@storybook/manager-webpack4": "^6.5.12",
|
|
42
42
|
"@storybook/storybook-deployer": "^2.8.12",
|
|
43
43
|
"@storybook/testing-library": "^0.0.13",
|
|
44
44
|
"@types/geojson": "^7946.0.10",
|
|
45
45
|
"@types/jest": "^27.0.3",
|
|
46
|
-
"@types/leaflet": "^1.
|
|
46
|
+
"@types/leaflet": "^1.8.0",
|
|
47
47
|
"babel-loader": "^8.2.5",
|
|
48
48
|
"jest": "^27.4.5",
|
|
49
49
|
"jest-cli": "^27.4.5",
|
package/readme.md
CHANGED
|
@@ -7,16 +7,14 @@ You can use a complete app or each component independantly.
|
|
|
7
7
|
|
|
8
8
|
**The api you want to use had to authorize your domain.**
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Copy-paste this inside `<head></head>`
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
<link rel="stylesheet" href="https://unpkg.com/@geotrekce/geotrek-rando-widget@
|
|
14
|
-
<script type="module" src="https://unpkg.com/@geotrekce/geotrek-rando-widget@
|
|
15
|
-
<script nomodule src="https://unpkg.com/@geotrekce/geotrek-rando-widget@
|
|
13
|
+
<link rel="stylesheet" href="https://unpkg.com/@geotrekce/geotrek-rando-widget@0.0.14/dist/geotrek-rando-widget/geotrek-rando-widget.css" />
|
|
14
|
+
<script type="module" src="https://unpkg.com/@geotrekce/geotrek-rando-widget@0.0.14/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js"></script>
|
|
15
|
+
<script nomodule src="https://unpkg.com/@geotrekce/geotrek-rando-widget@0.0.14/dist/geotrek-rando-widget/geotrek-rando-widget.js"></script>
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
You can replace _latest_ with a specific version.
|
|
19
|
-
|
|
20
18
|
## Explore
|
|
21
19
|
|
|
22
20
|
**The api you want to use had to authorize geotrekce.github.io.**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-8f9914f4.system.js"],(function(r,e){"use strict";var o,t,i,a,c,n;return{setters:[function(r){o=r.p;t=r.w;i=r.d;a=r.N;c=r.a;n=r.b}],execute:function(){var r=function(r){return"__sc_import_".concat(r.replace(/\s|-/g,"_"))};var s=function(){{o.$cssShim$=t.__cssshim}var r=Array.from(i.querySelectorAll("script")).find((function(r){return new RegExp("/".concat(a,"(\\.esm)?\\.js($|\\?|#)")).test(r.src)||r.getAttribute("data-stencil-namespace")===a}));var n=r["data-opts"]||{};if("onbeforeload"in r&&!history.scrollRestoration){return{then:function(){}}}{n.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,t.location.href)).href;{l(n.resourcesUrl,r)}if(!t.customElements){return e.import("./p-c8c96517.system.js").then((function(){return n}))}}return c(n)};var l=function(e,o){var c=r(a);try{t[c]=new Function("w","return import(w);//".concat(Math.random()))}catch(s){var n=new Map;t[c]=function(r){var a=new URL(r,e).href;var s=n.get(a);if(!s){var l=i.createElement("script");l.type="module";l.crossOrigin=o.crossOrigin;l.src=URL.createObjectURL(new Blob(["import * as m from '".concat(a,"'; window.").concat(c,".m = m;")],{type:"application/javascript"}));s=new Promise((function(r){l.onload=function(){r(t[c].m);l.remove()}}));n.set(a,s);i.head.appendChild(l)}return s}}};s().then((function(r){return n([["p-e1431f36.system",[[1,"grw-trek-card",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],isLargeView:[4,"is-large-view"],currentTrek:[32],difficulty:[32],route:[32],practice:[32],themes:[32]}]]],["p-2bd0278f.system",[[1,"grw-information-desk-detail",{informationDesk:[16]}],[1,"grw-poi-detail",{poi:[16]}],[1,"grw-sensitive-area-detail",{sensitiveArea:[16]}]]],["p-2712caa8.system",[[1,"grw-trek-detail",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryShade:[1,"color-primary-shade"],colorPrimaryTint:[1,"color-primary-tint"],difficulty:[32],route:[32],practice:[32],themes:[32],labels:[32],sources:[32],accessibilities:[32],accessibilityLevel:[32],currentTrek:[32]}],[1,"grw-treks-list",{colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],isLargeView:[4,"is-large-view"],treksToDisplay:[32]}],[1,"grw-filter",{filterType:[1,"filter-type"],filterName:[1,"filter-name"],filterNameProperty:[1,"filter-name-property"]}],[0,"grw-map",{urlLayer:[1,"url-layer"],attribution:[1],center:[1],zoom:[2],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],colorTrekLine:[1,"color-trek-line"],colorDepartureIcon:[1,"color-departure-icon"],colorArrivalIcon:[1,"color-arrival-icon"],colorSensitiveArea:[1,"color-sensitive-area"],colorPoiIcon:[1,"color-poi-icon"],mapIsReady:[32]}],[1,"grw-trek-provider",{language:[1],api:[1],trekId:[1,"trek-id"]}],[1,"grw-treks-provider",{language:[1],api:[1],inBbox:[1,"in-bbox"],cities:[1],districts:[1],structures:[1],themes:[1],portals:[1],routes:[1],practices:[1]}]]],["p-e38f4ff4.system",[[1,"grw-app",{api:[1],language:[1],inBbox:[1,"in-bbox"],cities:[1],districts:[1],structures:[1],themes:[1],portals:[1],routes:[1],practices:[1],urlLayer:[1,"url-layer"],center:[1],zoom:[2],attribution:[1],colorPrimary:[1,"color-primary"],colorPrimaryShade:[1,"color-primary-shade"],colorPrimaryTint:[1,"color-primary-tint"],colorTrekLine:[1,"color-trek-line"],colorDepartureIcon:[1,"color-departure-icon"],colorArrivalIcon:[1,"color-arrival-icon"],colorSensitiveArea:[1,"color-sensitive-area"],colorPoiIcon:[1,"color-poi-icon"],showTrek:[32],showTreksMap:[32],showTrekMap:[32],showFilters:[32],isLargeView:[32],currentTrekId:[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]]]]],r)}))}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,f as t}from"./p-4690907e.js";const s=e=>!("isConnected"in e)||e.isConnected,n=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(s))})(...t)}),2e3)}})(),r=e=>"function"==typeof e?e():e,{state:o,onChange:l}=(()=>{const s=((e,t=((e,t)=>e!==t))=>{const s=r(e);let n=new Map(Object.entries(null!=s?s:{}));const o={dispose:[],get:[],set:[],reset:[]},l=()=>{var t;n=new Map(Object.entries(null!==(t=r(e))&&void 0!==t?t:{})),o.reset.forEach((e=>e()))},u=e=>(o.get.forEach((t=>t(e))),n.get(e)),i=(e,s)=>{const r=n.get(e);t(s,r,e)&&(n.set(e,s),o.set.forEach((t=>t(e,s,r))))},c="undefined"==typeof Proxy?{}:new Proxy(s,{get:(e,t)=>u(t),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>n.has(t),set:(e,t,s)=>(i(t,s),!0)}),a=(e,t)=>(o[e].push(t),()=>{((e,t)=>{const s=e.indexOf(t);s>=0&&(e[s]=e[e.length-1],e.length--)})(o[e],t)});return{state:c,get:u,set:i,on:a,onChange:(t,s)=>{const n=a("set",((e,n)=>{e===t&&s(n)})),o=a("reset",(()=>s(r(e)[t])));return()=>{n(),o()}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(a("set",t.set)),t.get&&e.push(a("get",t.get)),t.reset&&e.push(a("reset",t.reset)),t.dispose&&e.push(a("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{o.dispose.forEach((e=>e())),l()},reset:l,forceUpdate:e=>{const t=n.get(e);o.set.forEach((s=>s(e,t,t)))}}})({api:"",treks:null,currentTreks:null,treksWithinBounds:null,currentMapTreksBounds:null,difficulties:[],routes:[],practices:[],themes:[],durations:[],currentSensitiveAreas:null,labels:null,sources:null,accessibilities:null,accessibilitiesLevel:null,poiTypes:null,currentTrek:null,currentPois:null,currentInformationDesks:null,treksNetworkError:!1,trekNetworkError:!1},void 0);return s.use((()=>{if("function"!=typeof e)return{};const s=new Map;return{dispose:()=>s.clear(),get:t=>{const n=e();n&&((e,t,s)=>{const n=e.get(t);n?n.includes(s)||n.push(s):e.set(t,[s])})(s,t,n)},set:e=>{const r=s.get(e);r&&s.set(e,r.filter(t)),n(s)},reset:()=>{s.forEach((e=>e.forEach(t))),n(s)}}})()),s})();export{l as o,o as s}
|