@geotrekce/geotrek-rando-widget 0.0.4 → 0.0.7

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.
Files changed (61) hide show
  1. package/dist/cjs/geotrek-rando-widget.cjs.js +1 -1
  2. package/dist/cjs/grw-app.cjs.entry.js +111 -0
  3. package/dist/cjs/{grw-app_11.cjs.entry.js → grw-filter_6.cjs.entry.js} +197 -455
  4. package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +52 -0
  5. package/dist/cjs/grw-trek-card.cjs.entry.js +47 -0
  6. package/dist/cjs/length-d315d156.js +34 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/store-fd04a216.js +211 -0
  9. package/dist/collection/components/grw-app/grw-app.js +54 -25
  10. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css +5 -4
  11. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +1 -1
  12. package/dist/collection/components/grw-map/grw-map.css +19 -1
  13. package/dist/collection/components/grw-map/grw-map.js +65 -10
  14. package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +5 -4
  15. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +1 -1
  16. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +27 -3
  17. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +17 -3
  18. package/dist/collection/components/grw-trek-card/grw-trek-card.js +1 -1
  19. package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +134 -4
  20. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +101 -6
  21. package/dist/collection/components/grw-treks-list/grw-treks-list.js +8 -3
  22. package/dist/collection/store/grw-trek-provider.js +24 -9
  23. package/dist/collection/store/grw-treks-provider.js +12 -6
  24. package/dist/collection/store/store.js +7 -1
  25. package/dist/components/grw-app.js +52 -6
  26. package/dist/components/grw-information-desk-detail2.js +2 -2
  27. package/dist/components/grw-map2.js +66 -11
  28. package/dist/components/grw-poi-detail2.js +2 -2
  29. package/dist/components/grw-sensitive-area-detail2.js +7 -2
  30. package/dist/components/grw-trek-detail2.js +31 -4
  31. package/dist/components/grw-trek-provider2.js +24 -9
  32. package/dist/components/grw-treks-list2.js +8 -3
  33. package/dist/components/grw-treks-provider2.js +12 -6
  34. package/dist/components/store.js +7 -1
  35. package/dist/esm/geotrek-rando-widget.js +2 -2
  36. package/dist/esm/grw-app.entry.js +107 -0
  37. package/dist/esm/{grw-app_11.entry.js → grw-filter_6.entry.js} +138 -391
  38. package/dist/esm/grw-information-desk-detail_3.entry.js +46 -0
  39. package/dist/esm/grw-trek-card.entry.js +43 -0
  40. package/dist/esm/{index-fe16e7b6.js → index-192d910f.js} +1 -1
  41. package/dist/esm/length-d82189db.js +27 -0
  42. package/dist/esm/loader.js +2 -2
  43. package/dist/esm/store-b2c76c0c.js +208 -0
  44. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  45. package/dist/geotrek-rando-widget/p-1b2ba86d.entry.js +1 -0
  46. package/dist/geotrek-rando-widget/p-4361afd2.entry.js +1 -0
  47. package/dist/geotrek-rando-widget/p-5f17d340.entry.js +1 -0
  48. package/dist/geotrek-rando-widget/{p-8c206aec.js → p-6dce5e6c.js} +1 -1
  49. package/dist/geotrek-rando-widget/p-7715153d.entry.js +1 -0
  50. package/dist/geotrek-rando-widget/p-e6710c64.js +1 -0
  51. package/dist/geotrek-rando-widget/p-f3f7d6be.js +1 -0
  52. package/dist/types/components/grw-app/grw-app.d.ts +7 -2
  53. package/dist/types/components/grw-map/grw-map.d.ts +3 -1
  54. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +9 -4
  55. package/dist/types/components.d.ts +0 -2
  56. package/dist/types/store/grw-trek-provider.d.ts +2 -0
  57. package/dist/types/store/grw-treks-provider.d.ts +3 -0
  58. package/dist/types/store/store.d.ts +16 -3
  59. package/dist/types/types/types.d.ts +51 -1
  60. package/package.json +5 -4
  61. package/dist/geotrek-rando-widget/p-ed8706fb.entry.js +0 -1
@@ -0,0 +1,46 @@
1
+ import { r as registerInstance, h, H as Host } from './index-192d910f.js';
2
+ import { s as state } from './store-b2c76c0c.js';
3
+
4
+ const grwInformationDeskDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.information-desk-img{width:180px}.information-desk-img img{width:180px;border-radius:8px}.information-desk-sub-container{display:flex;flex-direction:column}.information-desk-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.information-desk-description{font-size:16px}";
5
+
6
+ const GrwInformationDeskDetail = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ }
10
+ render() {
11
+ return (h(Host, null, this.informationDesk.photo_url && (h("div", { class: "information-desk-img" }, h("img", { src: this.informationDesk.photo_url, loading: "lazy" }))), h("div", { class: "information-desk-sub-container" }, this.informationDesk.name && h("div", { class: "information-desk-name" }, this.informationDesk.name), this.informationDesk.description && h("div", { class: "information-desk-description", innerHTML: this.informationDesk.description }), this.informationDesk.postal_code ||
12
+ this.informationDesk.municipality ||
13
+ (this.informationDesk.street && (h("div", null, this.informationDesk.postal_code, ` ${this.informationDesk.municipality}`, ` ${this.informationDesk.street}`))), this.informationDesk.phone && (h("div", null, h("a", { href: `tel:${this.informationDesk.phone}` }, this.informationDesk.phone))), this.informationDesk.email && (h("div", null, h("a", { href: `mailto:${this.informationDesk.email}` }, this.informationDesk.email))), this.informationDesk.website && (h("div", null, h("a", { href: `${this.informationDesk.website}` }, this.informationDesk.website))))));
14
+ }
15
+ };
16
+ GrwInformationDeskDetail.style = grwInformationDeskDetailCss;
17
+
18
+ const grwPoiDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.poi-img{width:180px}.poi-img img{width:180px;border-radius:8px}.poi-sub-container{display:flex;flex-direction:column}.poi-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.poi-description{font-size:16px}";
19
+
20
+ const GrwPoiDetail = class {
21
+ constructor(hostRef) {
22
+ registerInstance(this, hostRef);
23
+ }
24
+ render() {
25
+ return (h(Host, null, this.poi.attachments && this.poi.attachments[0] && this.poi.attachments[0].thumbnail && (h("div", { class: "poi-img" }, h("img", { src: this.poi.attachments[0].thumbnail, loading: "lazy" }))), h("div", { class: "poi-sub-container" }, h("div", { class: "poi-name" }, this.poi.name), h("div", { class: "poi-description", innerHTML: this.poi.description }))));
26
+ }
27
+ };
28
+ GrwPoiDetail.style = grwPoiDetailCss;
29
+
30
+ const grwSensitiveAreaDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.sensitive-area-title{color:var(--color-primary);font-size:24px;padding:12px 0px;font-weight:bold}.sensitive-area-description{font-size:16px}.sensitive-area-period-container .sensitive-area-period-title,.sensitive-area-period-container .sensitive-area-practice-title,.sensitive-area-period-container .sensitive-area-contact-title,.sensitive-area-practice-container .sensitive-area-period-title,.sensitive-area-practice-container .sensitive-area-practice-title,.sensitive-area-practice-container .sensitive-area-contact-title,.sensitive-area-contact-container .sensitive-area-period-title,.sensitive-area-contact-container .sensitive-area-practice-title,.sensitive-area-contact-container .sensitive-area-contact-title{color:var(--color-primary);font-size:24px;padding:12px 0px}.sensitive-area-period-container .sensitive-area-period-values,.sensitive-area-period-container .sensitive-area-practice-values,.sensitive-area-practice-container .sensitive-area-period-values,.sensitive-area-practice-container .sensitive-area-practice-values,.sensitive-area-contact-container .sensitive-area-period-values,.sensitive-area-contact-container .sensitive-area-practice-values{display:flex}";
31
+
32
+ const GrwSensitiveAreaDetail = class {
33
+ constructor(hostRef) {
34
+ registerInstance(this, hostRef);
35
+ }
36
+ render() {
37
+ return (h(Host, null, h("div", { class: "sensitive-area-title" }, this.sensitiveArea.name), h("div", { class: "sensitive-area-description", innerHTML: this.sensitiveArea.description }), this.sensitiveArea.practices && this.sensitiveArea.practices.length > 0 && (h("div", { class: "sensitive-area-practice-container" }, h("div", { class: "sensitive-area-practice-title" }, "Domaines d'activit\u00E9s concern\u00E9s :"), h("div", { class: "sensitive-area-practice-values" }, this.sensitiveArea.practices.map((practice, index) => (h("div", { innerHTML: `${state.practices.find(statePractice => statePractice.id === practice).name.toUpperCase()}${index + 1 !== this.sensitiveArea.practices.length ? ' - ' : ''}` })))))), this.sensitiveArea.period && this.sensitiveArea.period.length > 0 && (h("div", { class: "sensitive-area-period-container" }, h("div", { class: "sensitive-area-period-title" }, "P\u00E9riodes de sensibilit\u00E9"), h("div", { class: "sensitive-area-period-values" }, this.sensitiveArea.period.map((month, index) => {
38
+ if (month) {
39
+ return (h("div", { innerHTML: `${new Date(0, index + 1, 0).toLocaleDateString('fr', { month: 'long' }).toUpperCase()}${this.sensitiveArea.period.slice(index + 1).find(month => month) ? ' - ' : ''}` }));
40
+ }
41
+ })))), h("div", { class: "sensitive-area-contact-container" }, h("div", { class: "sensitive-area-contact-title" }, "Contact"), h("div", { innerHTML: this.sensitiveArea.contact, class: "sensitive-area-contact-value" }))));
42
+ }
43
+ };
44
+ GrwSensitiveAreaDetail.style = grwSensitiveAreaDetailCss;
45
+
46
+ export { GrwInformationDeskDetail as grw_information_desk_detail, GrwPoiDetail as grw_poi_detail, GrwSensitiveAreaDetail as grw_sensitive_area_detail };
@@ -0,0 +1,43 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-192d910f.js';
2
+ import { s as state, o as onChange } from './store-b2c76c0c.js';
3
+ import { d as durationImage, f as formatDuration, l as lengthImage, a as formatLength, b as ascentImage, c as formatAscent } from './length-d82189db.js';
4
+
5
+ const grwTrekCardCss = ".trek-card-container,.trek-card-large-view-container{font-family:\"Roboto\";border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:flex;flex-direction:column;justify-content:center;padding:12px}.trek-card-container .sub-container .name,.trek-card-large-view-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:8px}.trek-card-container .sub-container .departure,.trek-card-large-view-container .sub-container .departure{color:rgba(0, 0, 0, 0.7);font-size:16px;margin:4px 0px}.trek-card-container .sub-container .themes-container,.trek-card-large-view-container .sub-container .themes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .themes-container .theme,.trek-card-large-view-container .sub-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-card-container .sub-container .icons-labels-container,.trek-card-large-view-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row,.trek-card-large-view-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child),.trek-card-large-view-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label{display:flex;align-items:center;width:50%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2),.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:8px}.trek-card-container .sub-container .icons-labels-container .row .practice img,.trek-card-large-view-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-card-container{width:350px;height:auto}.trek-card-container .image{width:100%}.trek-card-large-view-container{height:auto;display:flex;flex-direction:row}.trek-card-large-view-container .image{width:250px}";
6
+
7
+ const GrwTrekCard = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.trekCardPress = createEvent(this, "trekCardPress", 7);
11
+ this.colorPrimary = '#6b0030';
12
+ this.colorPrimaryTint = '#974c6e';
13
+ this.isLargeView = false;
14
+ }
15
+ componentWillLoad() {
16
+ this.currentTrek = this.trek ? this.trek : state.currentTrek;
17
+ if (this.currentTrek) {
18
+ this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
19
+ this.route = state.routes.find(route => route.id === this.currentTrek.route);
20
+ this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
21
+ this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
22
+ }
23
+ onChange('currentTrek', () => {
24
+ this.currentTrek = this.trek ? this.trek : state.currentTrek;
25
+ if (this.currentTrek) {
26
+ this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
27
+ this.route = state.routes.find(route => route.id === this.currentTrek.route);
28
+ this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
29
+ this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
30
+ }
31
+ });
32
+ }
33
+ render() {
34
+ var _a, _b, _c, _d, _e, _f, _g, _h;
35
+ return (h(Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id), style: { 'width': this.isLargeView ? '100%' : 'auto', '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: this.isLargeView ? 'trek-card-large-view-container' : 'trek-card-container' }, this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].thumbnail && (h("img", { class: "image", src: `${this.currentTrek.attachments[0].thumbnail}`, loading: "lazy" })), h("div", { class: "sub-container" }, h("div", { class: "departure" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.departure), h("div", { class: "name" }, (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.name), h("div", { class: "themes-container" }, this.themes.map(theme => (h("div", { class: "theme" }, theme.label)))), h("div", { class: "icons-labels-container" }, h("div", { class: "row" }, h("div", { class: "icon-label difficulty" }, ((_c = this.difficulty) === null || _c === void 0 ? void 0 : _c.pictogram) && h("img", { src: this.difficulty.pictogram }), (_d = this.difficulty) === null || _d === void 0 ? void 0 :
36
+ _d.label), h("div", { class: "icon-label duration" }, h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration(this.currentTrek.duration))), h("div", { class: "row" }, h("div", { class: "icon-label length" }, h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), h("div", { class: "icon-label ascent" }, h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent))), h("div", { class: "row" }, h("div", { class: "icon-label route" }, ((_e = this.route) === null || _e === void 0 ? void 0 : _e.pictogram) && h("img", { src: this.route.pictogram }), (_f = this.route) === null || _f === void 0 ? void 0 :
37
+ _f.route), h("div", { class: "icon-label practice" }, ((_g = this.practice) === null || _g === void 0 ? void 0 : _g.pictogram) && h("img", { src: this.practice.pictogram }), (_h = this.practice) === null || _h === void 0 ? void 0 :
38
+ _h.name))))))));
39
+ }
40
+ };
41
+ GrwTrekCard.style = grwTrekCardCss;
42
+
43
+ export { GrwTrekCard as grw_trek_card };
@@ -1310,4 +1310,4 @@ const flush = () => {
1310
1310
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1311
1311
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1312
1312
 
1313
- export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getRenderingRef as g, h, promiseResolve as p, registerInstance as r };
1313
+ export { Host as H, getRenderingRef as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r };
@@ -0,0 +1,27 @@
1
+ function formatDuration(duration) {
2
+ let formattedDuration;
3
+ if (duration < 24) {
4
+ formattedDuration = `${Math.floor(duration)}h`;
5
+ if (duration % 1 > 0) {
6
+ formattedDuration += `${Math.round(60 * (duration % 1))}min`;
7
+ }
8
+ }
9
+ else {
10
+ formattedDuration = `${duration / 24}j`;
11
+ }
12
+ return formattedDuration;
13
+ }
14
+ function formatLength(length) {
15
+ return `${Math.round(length / 1000)}km`;
16
+ }
17
+ function formatAscent(ascent) {
18
+ return `${ascent}m`;
19
+ }
20
+
21
+ const ascentImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="352 144 464 144 464 256" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M48,368,169.37,246.63a32,32,0,0,1,45.26,0l50.74,50.74a32,32,0,0,0,45.26,0L448,160" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`;
22
+
23
+ const durationImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M145.61,464H366.39c19.8,0,35.55-16.29,33.42-35.06C386.06,308,304,310,304,256s83.11-51,95.8-172.94c2-18.78-13.61-35.06-33.41-35.06H145.61c-19.8,0-35.37,16.28-33.41,35.06C124.89,205,208,201,208,256s-82.06,52-95.8,172.94C110.06,447.71,125.81,464,145.61,464Z" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M343.3,432H169.13c-15.6,0-20-18-9.06-29.16C186.55,376,240,356.78,240,326V224c0-19.85-38-35-61.51-67.2-3.88-5.31-3.49-12.8,6.37-12.8H327.59c8.41,0,10.23,7.43,6.4,12.75C310.82,189,272,204.05,272,224V326c0,30.53,55.71,47,80.4,76.87C362.35,414.91,358.87,432,343.3,432Z"/></svg>`;
24
+
25
+ const lengthImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="304 96 416 96 416 208" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="405.77" y1="106.2" x2="111.98" y2="400.02" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><polyline points="208 416 96 416 96 304" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`;
26
+
27
+ export { formatLength as a, ascentImage as b, formatAscent as c, durationImage as d, formatDuration as f, lengthImage as l };
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-fe16e7b6.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-192d910f.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["grw-app_11",[[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],"appName":[1,"app-name"],"urlLayer":[1,"url-layer"],"center":[1],"zoom":[8],"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],"showMap":[32],"showFilters":[32],"isLargeView":[32],"currentTrekId":[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]],[1,"grw-trek-detail",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryShade":[1,"color-primary-shade"],"colorPrimaryTint":[1,"color-primary-tint"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[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]}],[1,"grw-information-desk-detail",{"informationDesk":[16]}],[1,"grw-poi-detail",{"poi":[16]}],[1,"grw-sensitive-area-detail",{"sensitiveArea":[16]}],[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]}]]]], options);
13
+ return bootstrapLazy([["grw-trek-card",[[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]}]]],["grw-information-desk-detail_3",[[1,"grw-information-desk-detail",{"informationDesk":[16]}],[1,"grw-poi-detail",{"poi":[16]}],[1,"grw-sensitive-area-detail",{"sensitiveArea":[16]}]]],["grw-filter_6",[[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]}]]],["grw-app",[[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":[8],"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"]]]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -0,0 +1,208 @@
1
+ import { a as getRenderingRef, f as forceUpdate } from './index-192d910f.js';
2
+
3
+ const appendToMap = (map, propName, value) => {
4
+ const items = map.get(propName);
5
+ if (!items) {
6
+ map.set(propName, [value]);
7
+ }
8
+ else if (!items.includes(value)) {
9
+ items.push(value);
10
+ }
11
+ };
12
+ const debounce = (fn, ms) => {
13
+ let timeoutId;
14
+ return (...args) => {
15
+ if (timeoutId) {
16
+ clearTimeout(timeoutId);
17
+ }
18
+ timeoutId = setTimeout(() => {
19
+ timeoutId = 0;
20
+ fn(...args);
21
+ }, ms);
22
+ };
23
+ };
24
+
25
+ /**
26
+ * Check if a possible element isConnected.
27
+ * The property might not be there, so we check for it.
28
+ *
29
+ * We want it to return true if isConnected is not a property,
30
+ * otherwise we would remove these elements and would not update.
31
+ *
32
+ * Better leak in Edge than to be useless.
33
+ */
34
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
35
+ const cleanupElements = debounce((map) => {
36
+ for (let key of map.keys()) {
37
+ map.set(key, map.get(key).filter(isConnected));
38
+ }
39
+ }, 2000);
40
+ const stencilSubscription = () => {
41
+ if (typeof getRenderingRef !== 'function') {
42
+ // If we are not in a stencil project, we do nothing.
43
+ // This function is not really exported by @stencil/core.
44
+ return {};
45
+ }
46
+ const elmsToUpdate = new Map();
47
+ return {
48
+ dispose: () => elmsToUpdate.clear(),
49
+ get: (propName) => {
50
+ const elm = getRenderingRef();
51
+ if (elm) {
52
+ appendToMap(elmsToUpdate, propName, elm);
53
+ }
54
+ },
55
+ set: (propName) => {
56
+ const elements = elmsToUpdate.get(propName);
57
+ if (elements) {
58
+ elmsToUpdate.set(propName, elements.filter(forceUpdate));
59
+ }
60
+ cleanupElements(elmsToUpdate);
61
+ },
62
+ reset: () => {
63
+ elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
64
+ cleanupElements(elmsToUpdate);
65
+ },
66
+ };
67
+ };
68
+
69
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
70
+ let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
71
+ const handlers = {
72
+ dispose: [],
73
+ get: [],
74
+ set: [],
75
+ reset: [],
76
+ };
77
+ const reset = () => {
78
+ states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
79
+ handlers.reset.forEach((cb) => cb());
80
+ };
81
+ const dispose = () => {
82
+ // Call first dispose as resetting the state would
83
+ // cause less updates ;)
84
+ handlers.dispose.forEach((cb) => cb());
85
+ reset();
86
+ };
87
+ const get = (propName) => {
88
+ handlers.get.forEach((cb) => cb(propName));
89
+ return states.get(propName);
90
+ };
91
+ const set = (propName, value) => {
92
+ const oldValue = states.get(propName);
93
+ if (shouldUpdate(value, oldValue, propName)) {
94
+ states.set(propName, value);
95
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
96
+ }
97
+ };
98
+ const state = (typeof Proxy === 'undefined'
99
+ ? {}
100
+ : new Proxy(defaultState, {
101
+ get(_, propName) {
102
+ return get(propName);
103
+ },
104
+ ownKeys(_) {
105
+ return Array.from(states.keys());
106
+ },
107
+ getOwnPropertyDescriptor() {
108
+ return {
109
+ enumerable: true,
110
+ configurable: true,
111
+ };
112
+ },
113
+ has(_, propName) {
114
+ return states.has(propName);
115
+ },
116
+ set(_, propName, value) {
117
+ set(propName, value);
118
+ return true;
119
+ },
120
+ }));
121
+ const on = (eventName, callback) => {
122
+ handlers[eventName].push(callback);
123
+ return () => {
124
+ removeFromArray(handlers[eventName], callback);
125
+ };
126
+ };
127
+ const onChange = (propName, cb) => {
128
+ const unSet = on('set', (key, newValue) => {
129
+ if (key === propName) {
130
+ cb(newValue);
131
+ }
132
+ });
133
+ const unReset = on('reset', () => cb(defaultState[propName]));
134
+ return () => {
135
+ unSet();
136
+ unReset();
137
+ };
138
+ };
139
+ const use = (...subscriptions) => {
140
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
141
+ if (subscription.set) {
142
+ unsubs.push(on('set', subscription.set));
143
+ }
144
+ if (subscription.get) {
145
+ unsubs.push(on('get', subscription.get));
146
+ }
147
+ if (subscription.reset) {
148
+ unsubs.push(on('reset', subscription.reset));
149
+ }
150
+ if (subscription.dispose) {
151
+ unsubs.push(on('dispose', subscription.dispose));
152
+ }
153
+ return unsubs;
154
+ }, []);
155
+ return () => unsubs.forEach((unsub) => unsub());
156
+ };
157
+ const forceUpdate = (key) => {
158
+ const oldValue = states.get(key);
159
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
160
+ };
161
+ return {
162
+ state,
163
+ get,
164
+ set,
165
+ on,
166
+ onChange,
167
+ use,
168
+ dispose,
169
+ reset,
170
+ forceUpdate,
171
+ };
172
+ };
173
+ const removeFromArray = (array, item) => {
174
+ const index = array.indexOf(item);
175
+ if (index >= 0) {
176
+ array[index] = array[array.length - 1];
177
+ array.length--;
178
+ }
179
+ };
180
+
181
+ const createStore = (defaultState, shouldUpdate) => {
182
+ const map = createObservableMap(defaultState, shouldUpdate);
183
+ map.use(stencilSubscription());
184
+ return map;
185
+ };
186
+
187
+ const { state, onChange } = createStore({
188
+ api: '',
189
+ treks: [],
190
+ currentTreks: [],
191
+ treksWithinBounds: [],
192
+ currentMapTreksBounds: null,
193
+ difficulties: [],
194
+ routes: [],
195
+ practices: [],
196
+ themes: [],
197
+ durations: [],
198
+ currentSensitiveAreas: null,
199
+ labels: null,
200
+ sources: null,
201
+ accessibilities: null,
202
+ accessibilitiesLevel: null,
203
+ currentTrek: null,
204
+ currentPois: null,
205
+ currentInformationDesks: null,
206
+ });
207
+
208
+ export { onChange as o, state as s };
@@ -1 +1 @@
1
- import{p as r,b as o}from"./p-8c206aec.js";(()=>{const o=import.meta.url,e={};return""!==o&&(e.resourcesUrl=new URL(".",o).href),r(e)})().then((r=>o([["p-ed8706fb",[[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],appName:[1,"app-name"],urlLayer:[1,"url-layer"],center:[1],zoom:[8],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],showMap:[32],showFilters:[32],isLargeView:[32],currentTrekId:[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]],[1,"grw-trek-detail",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryShade:[1,"color-primary-shade"],colorPrimaryTint:[1,"color-primary-tint"],currentTrek:[32],difficulty:[32],route:[32],practice:[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]}],[1,"grw-information-desk-detail",{informationDesk:[16]}],[1,"grw-poi-detail",{poi:[16]}],[1,"grw-sensitive-area-detail",{sensitiveArea:[16]}],[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]}]]]],r)));
1
+ import{p as r,b as o}from"./p-6dce5e6c.js";(()=>{const o=import.meta.url,e={};return""!==o&&(e.resourcesUrl=new URL(".",o).href),r(e)})().then((r=>o([["p-1b2ba86d",[[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-7715153d",[[1,"grw-information-desk-detail",{informationDesk:[16]}],[1,"grw-poi-detail",{poi:[16]}],[1,"grw-sensitive-area-detail",{sensitiveArea:[16]}]]],["p-4361afd2",[[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-5f17d340",[[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:[8],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)));
@@ -0,0 +1 @@
1
+ import{r as i,c as r,h as e,H as n}from"./p-6dce5e6c.js";import{s as t,o as a}from"./p-e6710c64.js";import{d as c,f as o,l as s,a as l,b as d,c as h}from"./p-f3f7d6be.js";const b=class{constructor(e){i(this,e),this.trekCardPress=r(this,"trekCardPress",7),this.colorPrimary="#6b0030",this.colorPrimaryTint="#974c6e",this.isLargeView=!1}componentWillLoad(){this.currentTrek=this.trek?this.trek:t.currentTrek,this.currentTrek&&(this.difficulty=t.difficulties.find((i=>i.id===this.currentTrek.difficulty)),this.route=t.routes.find((i=>i.id===this.currentTrek.route)),this.practice=t.practices.find((i=>i.id===this.currentTrek.practice)),this.themes=t.themes.filter((i=>this.currentTrek.themes.includes(i.id)))),a("currentTrek",(()=>{this.currentTrek=this.trek?this.trek:t.currentTrek,this.currentTrek&&(this.difficulty=t.difficulties.find((i=>i.id===this.currentTrek.difficulty)),this.route=t.routes.find((i=>i.id===this.currentTrek.route)),this.practice=t.practices.find((i=>i.id===this.currentTrek.practice)),this.themes=t.themes.filter((i=>this.currentTrek.themes.includes(i.id))))}))}render(){var i,r,t,a,b,v,g,u;return e(n,{onClick:()=>this.trekCardPress.emit(this.currentTrek.id),style:{width:this.isLargeView?"100%":"auto","--color-primary":this.colorPrimary,"--color-primary-tint":this.colorPrimaryTint}},this.currentTrek&&e("div",{class:this.isLargeView?"trek-card-large-view-container":"trek-card-container"},this.currentTrek.attachments&&this.currentTrek.attachments[0]&&this.currentTrek.attachments[0].thumbnail&&e("img",{class:"image",src:`${this.currentTrek.attachments[0].thumbnail}`,loading:"lazy"}),e("div",{class:"sub-container"},e("div",{class:"departure"},null===(i=this.currentTrek)||void 0===i?void 0:i.departure),e("div",{class:"name"},null===(r=this.currentTrek)||void 0===r?void 0:r.name),e("div",{class:"themes-container"},this.themes.map((i=>e("div",{class:"theme"},i.label)))),e("div",{class:"icons-labels-container"},e("div",{class:"row"},e("div",{class:"icon-label difficulty"},(null===(t=this.difficulty)||void 0===t?void 0:t.pictogram)&&e("img",{src:this.difficulty.pictogram}),null===(a=this.difficulty)||void 0===a?void 0:a.label),e("div",{class:"icon-label duration"},e("div",{class:"svg-icon",innerHTML:c}),o(this.currentTrek.duration))),e("div",{class:"row"},e("div",{class:"icon-label length"},e("div",{class:"svg-icon",innerHTML:s}),l(this.currentTrek.length_2d)),e("div",{class:"icon-label ascent"},e("div",{class:"svg-icon",innerHTML:d}),h(this.currentTrek.ascent))),e("div",{class:"row"},e("div",{class:"icon-label route"},(null===(b=this.route)||void 0===b?void 0:b.pictogram)&&e("img",{src:this.route.pictogram}),null===(v=this.route)||void 0===v?void 0:v.route),e("div",{class:"icon-label practice"},(null===(g=this.practice)||void 0===g?void 0:g.pictogram)&&e("img",{src:this.practice.pictogram}),null===(u=this.practice)||void 0===u?void 0:u.name))))))}};b.style='.trek-card-container,.trek-card-large-view-container{font-family:"Roboto";border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:flex;flex-direction:column;justify-content:center;padding:12px}.trek-card-container .sub-container .name,.trek-card-large-view-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:8px}.trek-card-container .sub-container .departure,.trek-card-large-view-container .sub-container .departure{color:rgba(0, 0, 0, 0.7);font-size:16px;margin:4px 0px}.trek-card-container .sub-container .themes-container,.trek-card-large-view-container .sub-container .themes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .themes-container .theme,.trek-card-large-view-container .sub-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-card-container .sub-container .icons-labels-container,.trek-card-large-view-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row,.trek-card-large-view-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child),.trek-card-large-view-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label{display:flex;align-items:center;width:50%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2),.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:8px}.trek-card-container .sub-container .icons-labels-container .row .practice img,.trek-card-large-view-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-card-container{width:350px;height:auto}.trek-card-container .image{width:100%}.trek-card-large-view-container{height:auto;display:flex;flex-direction:row}.trek-card-large-view-container .image{width:250px}';export{b as grw_trek_card}