@esri/solutions-components 0.10.36 → 0.10.38
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-action-pad_2.cjs.entry.js +2 -2
- package/dist/cjs/calcite-block_5.cjs.entry.js +2 -2
- package/dist/cjs/{constants-0a4fc296.js → constants-51cf394f.js} +57 -1
- package/dist/cjs/{helpers-415179ad.js → helpers-afcac967.js} +1 -1
- package/dist/cjs/instant-apps-app-guide.cjs.entry.js +26 -13
- package/dist/cjs/instant-apps-export.cjs.entry.js +1086 -59
- package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +8 -4
- package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +10 -5
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +52 -12
- package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +9 -3
- package/dist/cjs/instant-apps-landing-page.cjs.entry.js +19 -13
- package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +3 -2
- package/dist/cjs/instant-apps-language-translator.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-measurement.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-popover.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-sign-in.cjs.entry.js +13 -9
- package/dist/cjs/instant-apps-splash.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-time-filter.cjs.entry.js +11 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solution-item-accordion.cjs.entry.js +15 -6
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +15 -6
- package/dist/collection/demos/solution-item-accordion.html +32 -0
- package/dist/components/instant-apps-app-guide.js +28 -14
- package/dist/components/instant-apps-export.js +1119 -76
- package/dist/components/instant-apps-interactive-legend-classic2.js +8 -4
- package/dist/components/instant-apps-interactive-legend-count2.js +6 -3
- package/dist/components/instant-apps-interactive-legend-layer-element-caption2.js +5 -2
- package/dist/components/instant-apps-interactive-legend-legend-element-caption2.js +52 -12
- package/dist/components/instant-apps-interactive-legend.js +13 -4
- package/dist/components/instant-apps-landing-page.js +19 -13
- package/dist/components/instant-apps-language-switcher.js +3 -1
- package/dist/components/instant-apps-language-translator2.js +57 -1
- package/dist/components/instant-apps-measurement-tool2.js +2 -2
- package/dist/components/instant-apps-measurement.js +2 -2
- package/dist/components/instant-apps-popover.js +1 -1
- package/dist/components/instant-apps-scoreboard.js +1 -1
- package/dist/components/instant-apps-sign-in2.js +14 -9
- package/dist/components/instant-apps-social-share2.js +2 -2
- package/dist/components/instant-apps-splash.js +1 -1
- package/dist/components/instant-apps-time-filter.js +11 -9
- package/dist/components/solution-item-accordion.js +15 -6
- package/dist/components/store.js +1 -1
- package/dist/esm/calcite-action-pad_2.entry.js +2 -2
- package/dist/esm/calcite-block_5.entry.js +2 -2
- package/dist/esm/{constants-045d6a1b.js → constants-886c7c2c.js} +57 -1
- package/dist/esm/{helpers-f9bf9c0b.js → helpers-91087955.js} +1 -1
- package/dist/esm/instant-apps-app-guide.entry.js +26 -13
- package/dist/esm/instant-apps-export.entry.js +1086 -59
- package/dist/esm/instant-apps-interactive-legend-classic.entry.js +8 -4
- package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +10 -5
- package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +1 -1
- package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +52 -12
- package/dist/esm/instant-apps-interactive-legend.entry.js +9 -3
- package/dist/esm/instant-apps-landing-page.entry.js +19 -13
- package/dist/esm/instant-apps-language-switcher.entry.js +3 -2
- package/dist/esm/instant-apps-language-translator.entry.js +1 -1
- package/dist/esm/instant-apps-measurement.entry.js +2 -2
- package/dist/esm/instant-apps-popover.entry.js +1 -1
- package/dist/esm/instant-apps-scoreboard.entry.js +1 -1
- package/dist/esm/instant-apps-sign-in.entry.js +13 -9
- package/dist/esm/instant-apps-splash.entry.js +1 -1
- package/dist/esm/instant-apps-time-filter.entry.js +11 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/solution-item-accordion.entry.js +15 -6
- package/dist/esm/solutions-components.js +1 -1
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-app-guide/instant-apps-app-guide.css +0 -5
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-export/instant-apps-export.css +4 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-classic/instant-apps-interactive-legend-classic.css +14 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-count/instant-apps-interactive-legend-count.css +9 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-layer-element-caption/instant-apps-interactive-legend-layer-element-caption.css +5 -3
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-legend-element-caption/instant-apps-interactive-legend-legend-element-caption.css +29 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-landing-page/instant-apps-landing-page.css +8 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-sign-in/instant-apps-sign-in.css +22 -0
- package/dist/solutions-components/demos/solution-item-accordion.html +32 -0
- package/dist/solutions-components/p-1e14b3d0.entry.js +6 -0
- package/dist/solutions-components/p-2542d5c9.entry.js +6 -0
- package/dist/solutions-components/{p-70ecc979.entry.js → p-374ddead.entry.js} +1 -1
- package/dist/solutions-components/{p-146acd9a.entry.js → p-3fc18283.entry.js} +1 -1
- package/dist/solutions-components/p-43699470.entry.js +6 -0
- package/dist/solutions-components/p-5585dcd3.entry.js +6 -0
- package/dist/solutions-components/{p-3a513c67.entry.js → p-5b3c0418.entry.js} +1 -1
- package/dist/solutions-components/{p-f7e7b830.entry.js → p-6438d1ea.entry.js} +1 -1
- package/dist/solutions-components/p-750b3277.entry.js +6 -0
- package/dist/solutions-components/p-8779ee41.entry.js +6 -0
- package/dist/solutions-components/p-90fc786f.entry.js +6 -0
- package/dist/solutions-components/{p-43165ebd.entry.js → p-9c170b30.entry.js} +1 -1
- package/dist/solutions-components/p-a5b751e2.entry.js +6 -0
- package/dist/solutions-components/p-af573e0d.js +6 -0
- package/dist/solutions-components/p-bb8b1ee2.entry.js +6 -0
- package/dist/solutions-components/{p-b79f296d.entry.js → p-c48be45f.entry.js} +2 -2
- package/dist/solutions-components/p-ca3cbd29.entry.js +6 -0
- package/dist/solutions-components/p-ceb1030b.js +6 -0
- package/dist/solutions-components/{p-29047e77.entry.js → p-e1391389.entry.js} +1 -1
- package/dist/solutions-components/{p-759d0beb.entry.js → p-f728af86.entry.js} +1 -1
- package/dist/solutions-components/p-ff3858c6.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/package.json +7 -7
- package/dist/solutions-components/p-07a194e6.entry.js +0 -6
- package/dist/solutions-components/p-14d78748.entry.js +0 -6
- package/dist/solutions-components/p-24e3f09f.entry.js +0 -6
- package/dist/solutions-components/p-3a33ef72.entry.js +0 -6
- package/dist/solutions-components/p-402301cb.js +0 -6
- package/dist/solutions-components/p-41a6f03d.entry.js +0 -6
- package/dist/solutions-components/p-4db86c5e.entry.js +0 -6
- package/dist/solutions-components/p-750f234e.entry.js +0 -6
- package/dist/solutions-components/p-7e97d4d6.entry.js +0 -6
- package/dist/solutions-components/p-7eb5d31a.js +0 -6
- package/dist/solutions-components/p-90d2aadc.entry.js +0 -6
- package/dist/solutions-components/p-b78a4ce7.entry.js +0 -6
- package/dist/solutions-components/p-efb4cb43.entry.js +0 -6
@@ -22,12 +22,7 @@
|
|
22
22
|
display: flex;
|
23
23
|
gap: var(--calcite-spacing-sm);
|
24
24
|
padding-inline-start: 0.25rem;
|
25
|
-
}
|
26
|
-
:host .content-heading {
|
27
25
|
font-weight: var(--calcite-font-weight-bold);
|
28
|
-
display: flex;
|
29
|
-
gap: var(--calcite-spacing-sm);
|
30
|
-
line-height: var(--calcite-font-line-height-fixed-lg);
|
31
26
|
}
|
32
27
|
:host calcite-carousel-item {
|
33
28
|
flex-grow: 1;
|
@@ -50,6 +50,10 @@
|
|
50
50
|
.instant-apps-export .instant-apps-export-print {
|
51
51
|
display: none;
|
52
52
|
}
|
53
|
+
.instant-apps-export .instant-apps-export-print_img {
|
54
|
+
display: flex;
|
55
|
+
flex-flow: row wrap;
|
56
|
+
}
|
53
57
|
.instant-apps-export__visually-hidden {
|
54
58
|
position: absolute;
|
55
59
|
top: 0;
|
@@ -105,6 +105,20 @@
|
|
105
105
|
display: none;
|
106
106
|
}
|
107
107
|
|
108
|
+
.instant-apps-interactive-legend__compact .esri-legend__layer-row {
|
109
|
+
--instant-apps-interactive-legend-ui-padding: 10px 5px;
|
110
|
+
}
|
111
|
+
.instant-apps-interactive-legend__compact .esri-legend__layer-row .esri-legend__layer-cell--info {
|
112
|
+
display: -webkit-box;
|
113
|
+
-webkit-box-orient: vertical;
|
114
|
+
-webkit-line-clamp: 2;
|
115
|
+
overflow: hidden;
|
116
|
+
text-overflow: ellipsis;
|
117
|
+
line-clamp: 2;
|
118
|
+
line-height: 1.3125rem;
|
119
|
+
max-height: 2.625rem;
|
120
|
+
}
|
121
|
+
|
108
122
|
@media (min-width: 992px) {
|
109
123
|
:host .instant-apps-interactive-legend__layer-row--interactive {
|
110
124
|
cursor: pointer;
|
@@ -3,6 +3,11 @@
|
|
3
3
|
align-items: center;
|
4
4
|
}
|
5
5
|
|
6
|
+
.instant-apps-interactive-legend__total-feature-count {
|
7
|
+
font-weight: var(--calcite-font-weight-medium);
|
8
|
+
font-size: var(--calcite-font-size-0);
|
9
|
+
}
|
10
|
+
|
6
11
|
.instant-apps-interactive-legend__info-count-text {
|
7
12
|
font-size: var(--instant-apps-interactive-legend-info-font-size);
|
8
13
|
color: var(--instant-apps-interactive-legend-secondary-color);
|
@@ -12,6 +17,10 @@
|
|
12
17
|
color: var(--calcite-color-text-inverse);
|
13
18
|
}
|
14
19
|
|
20
|
+
.instant-apps-interactive-legend-count--compact .instant-apps-interactive-legend__total-feature-count {
|
21
|
+
font-size: 0.75rem;
|
22
|
+
}
|
23
|
+
|
15
24
|
html[dir=rtl] :host {
|
16
25
|
margin-left: 0;
|
17
26
|
margin-right: auto;
|
@@ -1,16 +1,18 @@
|
|
1
1
|
:host {
|
2
2
|
display: block;
|
3
3
|
--instant-apps-interactive-legend-heading-font-size: 1rem;
|
4
|
-
--instant-apps-interactive-legend-heading-font-weight:
|
4
|
+
--instant-apps-interactive-legend-heading-font-weight: 500;
|
5
5
|
--instant-apps-interactive-legend-secondary-color: var(--calcite-color-text-1);
|
6
6
|
--instant-apps-interactive-legend-ui-padding: 15px 10px;
|
7
7
|
}
|
8
|
+
:host .instant-apps-interactive-legend__header--compact .esri-widget__heading {
|
9
|
+
font-size: 0.9rem;
|
10
|
+
}
|
8
11
|
:host .esri-widget__heading {
|
9
12
|
overflow: hidden;
|
10
13
|
margin: 0;
|
11
|
-
overflow-x: hidden;
|
12
14
|
display: inline-block;
|
13
|
-
font-size: var(--
|
15
|
+
font-size: var(--calcite-font-size-1);
|
14
16
|
font-weight: var(--instant-apps-interactive-legend-heading-font-weight);
|
15
17
|
}
|
16
18
|
:host .esri-widget__heading header {
|
@@ -22,6 +22,35 @@
|
|
22
22
|
:host .esri-legend__layer-caption calcite-action {
|
23
23
|
margin-left: 20px;
|
24
24
|
}
|
25
|
+
:host .instant-apps-interactive-legend__layer-caption--compact {
|
26
|
+
--instant-apps-interactive-legend-ui-padding: 5px;
|
27
|
+
}
|
28
|
+
:host .instant-apps-interactive-legend__layer-caption--compact .instant-apps-interactive-legend__layer-caption-btn-container {
|
29
|
+
display: flex;
|
30
|
+
justify-content: flex-end;
|
31
|
+
width: 100%;
|
32
|
+
}
|
33
|
+
:host .instant-apps-interactive-legend__layer-caption--compact .instant-apps-interactive-legend__layer-caption-btn-container .instant-apps-interactive-legend__show-all-btn {
|
34
|
+
border: none;
|
35
|
+
background-color: transparent;
|
36
|
+
cursor: pointer;
|
37
|
+
color: var(--calcite-ui-brand);
|
38
|
+
font-weight: var(--calcite-font-weight-medium);
|
39
|
+
font-size: 0.75rem;
|
40
|
+
padding-inline-start: 20px;
|
41
|
+
}
|
42
|
+
:host .instant-apps-interactive-legend__layer-caption--compact .instant-apps-interactive-legend__zoom-to-btn {
|
43
|
+
--calcite-icon-color: var(--calcite-ui-brand);
|
44
|
+
--calcite-color-transparent-hover: transparent;
|
45
|
+
}
|
46
|
+
:host .instant-apps-interactive-legend__layer-caption--compact .instant-apps-interactive-legend__legend-layer-caption-text {
|
47
|
+
display: inline-block;
|
48
|
+
font-size: 0.75rem;
|
49
|
+
white-space: nowrap;
|
50
|
+
width: 100%;
|
51
|
+
overflow: hidden;
|
52
|
+
text-overflow: ellipsis;
|
53
|
+
}
|
25
54
|
:host .instant-apps-interactive-legend__legend-layer-caption-text {
|
26
55
|
display: inline-block;
|
27
56
|
margin-left: 5px;
|
@@ -188,6 +188,11 @@
|
|
188
188
|
:host instant-apps-sign-in {
|
189
189
|
width: 50%;
|
190
190
|
}
|
191
|
+
@media screen and (max-width: 500px) {
|
192
|
+
:host instant-apps-sign-in {
|
193
|
+
width: 100%;
|
194
|
+
}
|
195
|
+
}
|
191
196
|
|
192
197
|
@media only screen and (max-width: 768px) {
|
193
198
|
:host .instant-apps-landing-page__icon-image {
|
@@ -220,6 +225,9 @@
|
|
220
225
|
margin-right: unset;
|
221
226
|
margin-bottom: 10px;
|
222
227
|
}
|
228
|
+
:host .instant-apps-landing-page instant-apps-sign-in {
|
229
|
+
margin-bottom: auto;
|
230
|
+
}
|
223
231
|
}
|
224
232
|
@media only screen and (max-width: 896px) and (orientation: landscape) {
|
225
233
|
:host .instant-apps-landing-page__icon-image {
|
@@ -1,4 +1,8 @@
|
|
1
1
|
:host {
|
2
|
+
/**
|
3
|
+
* @prop --instant-apps-sign-in-indicator-color: Color of the indicator that shows in a signed in user's avatar.
|
4
|
+
*/
|
5
|
+
--instant-apps-sign-in-indicator-color: #007ac2;
|
2
6
|
display: block;
|
3
7
|
box-shadow: none !important;
|
4
8
|
}
|
@@ -15,6 +19,18 @@
|
|
15
19
|
--calcite-color-foreground-2: rgba(0, 0, 0, 0.04);
|
16
20
|
--calcite-color-foreground-3: rgba(0, 0, 0, 0.04);
|
17
21
|
}
|
22
|
+
:host .instant-apps-sign-in__container .instant-apps-sign-in__indicator::after {
|
23
|
+
content: "";
|
24
|
+
position: absolute;
|
25
|
+
block-size: 0.5rem;
|
26
|
+
inline-size: 0.5rem;
|
27
|
+
border-radius: 9999px;
|
28
|
+
inset-block-end: -0.275rem;
|
29
|
+
inset-inline-end: -0.275rem;
|
30
|
+
background-color: var(--instant-apps-sign-in-indicator-color);
|
31
|
+
bottom: calc(50% - 15px);
|
32
|
+
right: calc(50% - 15px);
|
33
|
+
}
|
18
34
|
:host .instant-apps-sign-in__container .instant-apps-sign-in__sign-in-btn {
|
19
35
|
margin: 10px;
|
20
36
|
}
|
@@ -70,10 +86,16 @@
|
|
70
86
|
font-size: 16px;
|
71
87
|
margin: 0;
|
72
88
|
}
|
89
|
+
:host .instant-apps-sign-in__entry-button-container {
|
90
|
+
display: flex;
|
91
|
+
justify-content: center;
|
92
|
+
gap: 8px;
|
93
|
+
}
|
73
94
|
:host .instant-apps-sign-in__entry-button {
|
74
95
|
--calcite-color-brand: var(--instant-apps-landing-page-entry-button-color);
|
75
96
|
--calcite-color-brand-hover: var(--instant-apps-landing-page-entry-button-color);
|
76
97
|
--calcite-color-brand-press: var(--instant-apps-landing-page-entry-button-color);
|
98
|
+
min-width: 165px;
|
77
99
|
}
|
78
100
|
@media screen and (max-width: 767px) {
|
79
101
|
:host {
|
@@ -135,6 +135,38 @@
|
|
135
135
|
],
|
136
136
|
"snippet": "A feature layer view used to share volunteers and clearing activities with the Adopt-A-Catch Basin site."
|
137
137
|
},
|
138
|
+
{
|
139
|
+
"id": "aa2a7f901eb9492a829ab918cd38318d",
|
140
|
+
"type": "Feature Service",
|
141
|
+
"title": "CatchBasinVolunteers_public_table",
|
142
|
+
"typeKeywords": [
|
143
|
+
"ArcGIS Server",
|
144
|
+
"Data",
|
145
|
+
"Feature Access",
|
146
|
+
"Feature Service",
|
147
|
+
"Multilayer",
|
148
|
+
"Service",
|
149
|
+
"Hosted Service",
|
150
|
+
"View Service",
|
151
|
+
"Table"
|
152
|
+
],
|
153
|
+
"snippet": "A feature table view"
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"id": "bb2a7f901eb9492a829ab918cd38318d",
|
157
|
+
"type": "Feature Service",
|
158
|
+
"title": "CatchBasinVolunteers_table",
|
159
|
+
"typeKeywords": [
|
160
|
+
"ArcGIS Server",
|
161
|
+
"Data",
|
162
|
+
"Feature Access",
|
163
|
+
"Feature Service",
|
164
|
+
"Multilayer",
|
165
|
+
"Service",
|
166
|
+
"Table"
|
167
|
+
],
|
168
|
+
"snippet": "A feature table"
|
169
|
+
},
|
138
170
|
{
|
139
171
|
"id": "cb7f74af39c64abfbe7c7fc5b69587b1",
|
140
172
|
"type": "Feature Service",
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as o,h as e,H as i,g as a}from"./p-4e6eb06e.js";import{g as l}from"./p-5ff711ee.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const s=class{constructor(e){t(this,e),this.measureActive=o(this,"measureActive",7),this.messages=void 0,this.view=void 0,this.areaUnit=void 0,this.linearUnit=void 0,this.coordinateFormat=void 0,this.activeToolType=void 0,this.closable=!1}async componentWillLoad(){l(this)}componentDidLoad(){}render(){var t;return e(i,{key:"843dd716e3f9b125044afd9a2919a60b937ae8b0"},e("calcite-panel",{key:"45dd9e43decdcdc0526139938751d727bd73b3e0",heading:null===(t=null==this?void 0:this.messages)||void 0===t?void 0:t.label,closable:this.closable},e("div",{key:"953365a04fd1f977b08d4b9309fdb52d44363b67",slot:"content-top"},this.renderActionPad()),e("div",{key:"57ce5b75a8aff0d796073bbf2a2f36ea71f65b3c"},this.renderMeasureToolPanel())))}renderMeasureToolPanel(){const{view:t,coordinateFormat:o,areaUnit:i,linearUnit:a,activeToolType:l}=this;return e("calcite-panel",{class:"instant-apps-measurement__content"},e("instant-apps-measurement-tool",{ref:t=>{this.measureTool=t},view:t,measureConfiguration:{coordinateFormat:o,areaUnit:i,linearUnit:a,activeToolType:l}}))}renderActionPad(){const{messages:t,activeToolType:o}=this;return e("calcite-action-pad",{"expand-disabled":!0,layout:"horizontal",position:"end"},e("calcite-action",{class:"distance"===o?"active-tool":"",text:null==t?void 0:t.line,icon:"measure",scale:"m","data-value":"distance",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.line)),e("calcite-action",{class:"area"===o?"active-tool":"",text:null==t?void 0:t.area,scale:"m",icon:"measure-area","data-value":"area",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.area)),e("calcite-action",{class:"point"===o?"active-tool":"",text:null==t?void 0:t.point,scale:"m",icon:"pin-plus","data-value":"point",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.point)),e("calcite-action",{text:null==t?void 0:t.clear,scale:"m",icon:"trash","data-value":"clear",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.clear)))}_handleToolClick(t){var o,e,i,a;if(!(null==this?void 0:this.measureTool))return;const l=null===(o=null==t?void 0:t.target)||void 0===o?void 0:o.dataset.value;this.measureTool.activeTool=l;const s=document.getElementsByClassName("active-tool");for(let t=0;t<(null==s?void 0:s.length);t++)null===(i=null===(e=s[t])||void 0===e?void 0:e.classList)||void 0===i||i.remove("active-tool");null===(a=null==t?void 0:t.target)||void 0===a||a.classList.add("active-tool"),this.measureActive.emit(void 0!==l&&"clear"!==l)}get el(){return a(this)}};s.style=".sc-instant-apps-measurement-h .sc-instant-apps-measurement.sc-instant-apps-measurement{background:var(--calcite-color-foreground-1)}.sc-instant-apps-measurement-h .active-tool.sc-instant-apps-measurement{--calcite-color-foreground-1:#c7eaff}";export{s as instant_apps_measurement}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as i,f as e,h as t,g as s}from"./p-4e6eb06e.js";import{l as n}from"./p-4cd4cb85.js";import{g as a}from"./p-5ff711ee.js";import{s as r,g as o}from"./p-af573e0d.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";import"./p-dc9d4be3.js";const c={base:"esri-legend",widget:"esri-widget",widgetPanel:"esri-widget--panel",component:"esri-component",iconLayerList:"esri-icon-layer-list"},d=class{constructor(e){i(this,e),this.handles=void 0,this.reactiveUtils=void 0,this.legendvm=void 0,this.widget=void 0,this.view=void 0,this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:"filter"},this.compact=!1,this.messages=void 0}async componentWillLoad(){this.compactHandler(),new MutationObserver((()=>{e(this.el)})).observe(this.el,{attributes:!0}),await this.initializeModules()}async componentDidLoad(){a(this)}async initializeModules(){const[i,e,t,s]=await n(["esri/core/Handles","esri/core/reactiveUtils","esri/widgets/Widget","esri/widgets/Legend"]);this.handles=new i,this.reactiveUtils=e,this.widget=new t;const a=new s;return await e.whenOnce((()=>null==a?void 0:a.messages)),this.messages=Object.assign(Object.assign({},this.messages),a.messages),Promise.resolve()}async init(){if(this.reactiveUtils&&this.view&&this.handles)try{const{on:i}=this.reactiveUtils,[e]=await n(["esri/widgets/Legend/LegendViewModel"]),t=new e({view:this.view,respectLayerDefinitionExpression:!0});this.legendvm=t,this.handles.add([i((()=>{var i;return null===(i=this.legendvm)||void 0===i?void 0:i.activeLayerInfos}),"change",(()=>{var i;return this._refreshActiveLayerInfos(null===(i=null==this?void 0:this.legendvm)||void 0===i?void 0:i.activeLayerInfos,this.reactiveUtils)}))])}catch(i){console.error('Failed at "init": ',i)}}compactHandler(){r.set("compact",this.compact)}render(){var i;const{base:e,component:s,widget:n,widgetPanel:a}=c;return t("div",{key:"interactive-legend",class:null===(i=this.widget)||void 0===i?void 0:i.classes(e,s,n,a)},t("instant-apps-interactive-legend-classic",{key:"interactive-legend-classic",ref:i=>this.ref=i,class:o(this.el),legendvm:this.legendvm,"zoom-to":this.zoomTo,filterMode:this.filterMode,"feature-count":this.featureCount,messages:this.messages}))}_refreshActiveLayerInfos(i,e){i&&(this.handles.removeAll(),i.forEach((i=>this._renderOnActiveLayerInfoChange(i,e))))}_renderOnActiveLayerInfoChange(i,e){var t;const{on:s}=this.reactiveUtils,n=s((()=>i.children),"change",(()=>i.children.forEach((i=>this._renderOnActiveLayerInfoChange(i,e)))));this.handles.add(n,`children_${null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.uid}`),i.children.forEach((i=>{var t,s;this._renderOnActiveLayerInfoChange(i,e),(null===(t=null==i?void 0:i.children)||void 0===t?void 0:t.length)>0&&(null===(s=null==i?void 0:i.children)||void 0===s||s.forEach((i=>this._renderOnActiveLayerInfoChange(i,e))))}))}get el(){return s(this)}static get watchers(){return{handles:["init"],reactiveUtils:["init"],view:["init"],compact:["compactHandler"]}}};d.style=".sc-instant-apps-interactive-legend-h{display:block;height:100%}.sc-instant-apps-interactive-legend-h .esri-legend.sc-instant-apps-interactive-legend{height:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1)}.sc-instant-apps-interactive-legend-h .esri-legend.esri-component.esri-widget.esri-widget--panel.sc-instant-apps-interactive-legend{margin:0}";export{d as instant_apps_interactive_legend}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as i,h as s,H as o,g as e}from"./p-4e6eb06e.js";import{l as n}from"./p-4cd4cb85.js";import{b as a}from"./p-5ff711ee.js";import{w as r}from"./p-04674a1e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const l="instant-apps-scoreboard",d=`${l}--`,c=`${l}__`,p=r.medium[1],h={BASE:l,itemsContainer:`${c}items-container`,items:`${c}items`,item:`${c}item`,label:`${c}item-label`,value:`${c}item-value`,valuePlaceholder:`${c}item-value-placeholder`,position:{bottom:`${c}position--bottom`,side:`${c}position--side`,left:`${c}position--left`,right:`${c}position--right`},mode:{floating:`${c}mode--floating`,pinned:`${c}mode--pinned`}},b=class{constructor(s){t(this,s),this.scoreboardItemsUpdated=i(this,"scoreboardItemsUpdated",7),this.view=void 0,this.items=void 0,this.position="bottom",this.mode="floating",this.itemLimit=6,this.autoDockEnabled=!0,this.geometry=null,this.state="loading",this.messages=void 0,this.itemIndex=0,this.layers=void 0,this.layerViews=void 0,this.isMobile=!1}scoreboardItemsUpdatedHandler(){this.scoreboardItemsUpdated.emit(this.items)}generateUIDs(){this.itemIndex=0,this.items.forEach(this.generateUID())}async storeLayers(){this.state="calculating",await this.view.map.loadAll();const t=this.items.map((t=>{var i;return null===(i=null==t?void 0:t.layer)||void 0===i?void 0:i.id}));this.layers=this.view.map.allLayers.filter((i=>(i=>(t=>!t.isTable)(i)&&(t=>"feature"===t.type||"scene"===t.type)(i)&&(i=>t.indexOf(i.id)>-1)(i))(i))),this.watchLayerVisibility()}async storeLayerViews(){if(this.layers&&this.layers.length>0){this.layers.forEach((t=>t.outFields=["*"]));const t=[];this.layers.forEach((i=>{const s=this.view.whenLayerView(i);t.push(s)}));const i=(await Promise.allSettled(t)).filter((t=>"fulfilled"==t.status&&t.value)).map((t=>t.value)),s=[];i.forEach((t=>{var i;return s.push(null===(i=this.reactiveUtils)||void 0===i?void 0:i.whenOnce((()=>!t.updating)))})),await Promise.all(s),this.layerViews=new this.Collection([...i])}}calculateScoreboardItemValuesFromGeometry(){this.calculateScoreboardItemValues()}async calculateScoreboardItemValues(){if(this.layers&&0===this.layers.length||this.layerViews&&0===this.layerViews.length)return;this.state="calculating";const t=[...this.items],i=[];this.queryStatDefinitions(t,i);const s=await Promise.all(i);this.handleQueryFeaturesResponses(s,t),this.items.length=0,t.forEach((t=>this.items.push(t))),this.state="complete",this.scoreboardItemsUpdatedHandler(),this.initStationaryWatcher()}async componentWillLoad(){var t;new ResizeObserver((()=>{this.itemIndex=0,this.autoDockEnabled&&(this.isMobile=!!this.checkMobile)})).observe(null===(t=this.el)||void 0===t?void 0:t.parentElement);try{this.state="loading",await this.initMessages()}catch(t){return this.state="disabled",Promise.reject()}finally{if(!this.view||!this.items)return this.state="disabled",Promise.reject();try{return await this.initModules(),Promise.resolve()}catch(t){return this.state="disabled",Promise.reject()}}}async componentDidLoad(){var t;if("disabled"!==this.state)try{await(null===(t=this.reactiveUtils)||void 0===t?void 0:t.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready}))),this.generateUIDs(),await this.loadMapResources(),this.storeLayers(),this.initViewUpdateWatcher()}catch(t){this.state="disabled",console.error(`${l}: FAILED TO LOAD MAP RESOURCES`)}}disconnectedCallback(){var t,i,s,o,e,n;this.state="disabled",this.itemIndex=0,null===(t=this.layers)||void 0===t||t.removeAll(),null===(i=this.layers)||void 0===i||i.destroy(),this.layers=null,null===(s=this.layerViews)||void 0===s||s.removeAll(),null===(o=this.layerViews)||void 0===o||o.destroy(),this.layerViews=null,null===(e=this.handles)||void 0===e||e.removeAll(),null===(n=this.handles)||void 0===n||n.destroy(),this.handles=null}async initMessages(){let t;try{return t=(await a(this.el))[0],this.messages=Object.assign(Object.assign({},this.messages),t),Promise.resolve()}catch(t){console.error("FAILED TO LOAD MESSAGES"),Promise.reject()}}async initModules(){try{const[t,i,s,o]=await n(["esri/core/Handles","esri/core/reactiveUtils","esri/core/Collection","esri/intl"]);return this.reactiveUtils=i,this.Collection=s,this.intl=o,this.handles=new t,this.layers=new s,this.layerViews=new s,Promise.resolve()}catch(t){return console.error(t),this.state="disabled",Promise.reject()}}async loadMapResources(){const{map:t}=this.view,i=t;try{return await i.loadAll(),Promise.resolve()}catch(t){return console.error(t),this.state="disabled",Promise.reject()}}generateUID(){return t=>{const i=Math.random(),s=Math.floor(10*Math.random())+11,o=i.toString(s).replace("0.","");t.uid=o}}render(){var t,i;const{state:e}=this,n="disabled"===e,a="loading"===e||"calculating"===e||(null===(t=this.view)||void 0===t?void 0:t.updating)?this.renderProgress():null;return s(o,{key:"44beef3ec01847c89e09afa6469f05dd5caf9e9d",class:`${this.getPositionClass} ${this.getStyleClass}`},n?null:[a,(null===(i=this.items)||void 0===i?void 0:i.length)>0?this.renderBase():null])}renderBase(){return s("div",{key:"instant-apps-scoreboard-base",class:l},this.renderContent())}renderContent(){const{state:t}=this;return"loading"===t?this.renderLoader():"calculating"===t||"complete"===t?this.renderItemsContainer():null}renderItemsContainer(){const[t,i]=this.renderPreviousNextButtons();return s("div",{class:h.itemsContainer},t,this.renderItems(),i)}renderPreviousNextButtons(){var t,i,o;const e=this.getItemLimit(),n=(null===(t=this.items.filter((t=>t.visible)))||void 0===t?void 0:t.length)<=e,a=0===this.itemIndex,r=this.isEnd,l=!!this.isMobile||"bottom"===this.position,d=l?"start":"center",c={previous:l?"chevron-left":"chevron-up",next:l?"chevron-right":"chevron-down"},p=a||n?"blank":c.previous,h=r||n?"blank":c.next,b={previous:a||n,next:r||n},u="transparent",m=this.isMobile?"s":"l",v={previous:null===(i=this.messages)||void 0===i?void 0:i.previous,next:null===(o=this.messages)||void 0===o?void 0:o.next};return[s("calcite-action",{onClick:this.previousItem.bind(this),icon:p,disabled:b.previous,alignment:d,scale:m,appearance:u,text:v.previous,label:v.previous}),s("calcite-action",{onClick:this.nextItem.bind(this),icon:h,disabled:b.next,alignment:d,scale:m,appearance:u,text:v.next,label:v.next})]}renderItems(){const{items:t}=h,i=this.getItemsToDisplay.map((t=>this.renderItem(t)));return s("ul",{class:t},i)}renderItem(t){const{label:i}=t;return s("li",{class:h.item},s("span",{class:h.label,title:i},i),this.renderValue(t))}renderValue(t){var i,o,e;const{displayValue:n}=t,a="disabled"===this.state,r=void 0===n&&"calculating"===this.state,l=n||(null===(i=this.messages)||void 0===i?void 0:i.NA),d=null===(o=this.layers)||void 0===o?void 0:o.find((i=>{var s;return(null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.id)===i.id})),c=!(null==d?void 0:d.visible),p=r?this.renderValuePlaceholder():a?"":c?s("calcite-icon",{icon:"view-hide",scale:"l",title:null===(e=this.messages)||void 0===e?void 0:e.layerVisibilityOff}):l;return s("span",{class:h.value},p)}renderValuePlaceholder(){return s("span",{class:h.valuePlaceholder})}renderProgress(){return s("calcite-progress",{key:`${d}calcite-progress`,type:"indeterminate"})}renderLoader(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.loading;return s("calcite-loader",{key:`${d}calcite-loader`,label:i,text:i,scale:"m"})}get getPositionClass(){const{bottom:t,left:i,right:s,side:o}=h.position;return this.isMobile||"bottom"===this.position?t:`${"left"===this.position?i:s} ${o}`}get getStyleClass(){const{floating:t,pinned:i}=h.mode;return this.isMobile?i:"floating"===this.mode?t:i}get checkMobile(){var t,i;const s=null===(i=null===(t=this.el)||void 0===t?void 0:t.parentElement)||void 0===i?void 0:i.offsetWidth;return!isNaN(s)&&s>0&&s<p}get getItemsToDisplay(){const t=this.getItemLimit();return this.items.filter((t=>t.visible)).slice(this.itemIndex,t+this.itemIndex)}get isEnd(){const t=this.getItemLimit(),i=this.items.slice(this.items.length-t).map((t=>t.uid)),s=this.items.slice(this.itemIndex,this.itemIndex+t).map((t=>t.uid));return i.every(((t,i)=>t===s[i]))}previousItem(){this.itemIndex=this.itemIndex-1}nextItem(){this.itemIndex=this.itemIndex+1}queryStatDefinitions(t,i){const s=(t,i)=>{var s,o,e,n,a;const r=t.createQuery(),l=this.geometry?this.geometry:this.view.extent;r.outStatistics=[i],r.geometry=l;const d=null!==(a=null!==(o=null===(s=null==t?void 0:t.filter)||void 0===s?void 0:s.timeExtent)&&void 0!==o?o:null===(n=null===(e=null==t?void 0:t.featureEffect)||void 0===e?void 0:e.filter)||void 0===n?void 0:n.timeExtent)&&void 0!==a?a:null;return d&&(r.timeExtent=d),r};t.forEach((()=>async t=>{var o;const e=null===(o=this.layerViews)||void 0===o?void 0:o.find((i=>{var s;return i.layer.id===(null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.id)}));if(!e)return;const n=(t=>{const{field:i,operation:s}=t;return{onStatisticField:i,outStatisticFieldName:`${i}_${s}`,statisticType:s}})(t),a=s(e,n),r=e.queryFeatures(a);i.push(r)})())}handleQueryFeaturesResponses(t,i){t.forEach((()=>(t,s)=>{const o=(t=>{const i=t.features[0],{attributes:s}=i;return Object.values(s)[0]})(t),e=null!==o,n=e?this.intl.formatNumber(o,{notation:"compact",compactDisplay:"short"}):null;i[s].displayValue=e?`${n}`:"",i[s].value=o})())}initStationaryWatcher(){var t,i;const s={once:!0,initial:!0},o=()=>{var t;return null===(t=this.reactiveUtils)||void 0===t?void 0:t.when((()=>{var t;return!(null===(t=this.view)||void 0===t?void 0:t.interacting)}),(()=>this.calculateScoreboardItemValues()),s)},e="stationary-watcher-key";(null===(t=this.handles)||void 0===t?void 0:t.has(e))&&this.handles.remove(e),null===(i=this.handles)||void 0===i||i.add((()=>{var t;return null===(t=this.reactiveUtils)||void 0===t?void 0:t.when((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.stationary}),(()=>o()))})(),e)}initViewUpdateWatcher(){return this.reactiveUtils.watch((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.updating}),(()=>{this.reactiveUtils.when((()=>{var t;return!(null===(t=this.view)||void 0===t?void 0:t.updating)}),(()=>this.calculateScoreboardItemValues()),{once:!0,initial:!0})}),{initial:!0})}watchLayerVisibility(){var t,i;if(!this.layers)return;const s="visbilityWatcherKey";null===(t=this.handles)||void 0===t||t.remove(s);const o=[];this.layers.forEach((t=>{const i=async()=>{const i=await this.view.whenLayerView(t);await this.reactiveUtils.whenOnce((()=>!1===(null==i?void 0:i.updating))),this.calculateScoreboardItemValues()},s=this.reactiveUtils.watch((()=>null==t?void 0:t.visible),(async()=>i()));o.push(s)})),null===(i=this.handles)||void 0===i||i.add([...o],s)}getItemLimit(){return this.itemLimit<2||this.itemLimit>6?6:this.itemLimit}get el(){return e(this)}static get watchers(){return{items:["generateUIDs","storeLayers"],layers:["storeLayerViews"],geometry:["calculateScoreboardItemValuesFromGeometry"],layerViews:["calculateScoreboardItemValues"]}}};b.style=":host{display:block;--instant-apps-scoreboard-background-color:var(--calcite-color-foreground-1);--instant-apps-scoreboard-text-color:var(--calcite-color-text-1);--instant-apps-scoreboard-mobile-position-bottom:0;background-color:var(--instant-apps-scoreboard-background-color);color:var(--instant-apps-scoreboard-text-color)}:host .instant-apps-scoreboard{box-sizing:border-box;border:1px solid var(--calcite-color-border-1);box-shadow:0px 3px 15px rgba(0, 0, 0, 0.2);border-radius:3px}:host .instant-apps-scoreboard calcite-loader{--calcite-loader-padding:1rem}:host .instant-apps-scoreboard__items-container{display:flex}:host .instant-apps-scoreboard__items-container calcite-action{height:100%}:host .instant-apps-scoreboard__items,:host .instant-apps-scoreboard__item{box-sizing:border-box;display:flex}:host .instant-apps-scoreboard__items{list-style-type:none;padding-left:0;margin:0;padding-top:1.75%;padding-bottom:1.75%;width:100%}:host .instant-apps-scoreboard__item{flex-direction:column;justify-content:flex-end;align-items:center;padding:1%}:host .instant-apps-scoreboard__item-label{box-sizing:border-box;line-height:24px;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;word-break:break-word;font-size:1rem;font-weight:400;text-align:center}:host .instant-apps-scoreboard__item-value{display:flex;justify-content:center;align-items:center;min-width:32px;min-height:32px;margin-top:5px;font-size:1.5rem;font-weight:900}:host .instant-apps-scoreboard__item-value-placeholder{display:inline-block;width:32px;height:32px;background-color:var(--calcite-color-foreground-3);border-radius:4px}:host(.instant-apps-scoreboard__position--bottom){bottom:0}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__items{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__item{min-width:10vw;vertical-align:top}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating){left:50%;max-width:calc(100% - 30px);transform:translate(-50%, -15px)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:25vw}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){left:unset;bottom:0;transform:unset;width:100%}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{min-width:unset}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{width:100%;justify-content:space-between}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard{display:flex;justify-content:center;align-items:center;width:10vw;overflow-y:auto}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container{flex-direction:column;height:100%;box-sizing:border-box}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container calcite-action{height:unset;width:100%}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items{flex-direction:column;padding:10px}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__item{padding-top:0.5vh;padding-bottom:0.5vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating){top:15px;left:15px;max-height:calc(100% - 30px)}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:10vw;min-height:35vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned){top:unset;left:unset;transform:unset;height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{justify-content:space-between}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--floating){left:15px}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--floating){left:unset;right:15px}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--pinned){left:0}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--pinned){left:unset;right:0}@media only screen and (min-width: 992px){:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){bottom:var(--instant-apps-scoreboard-mobile-position-bottom)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__item{justify-content:center;min-width:unset;flex-grow:1}}";export{b as instant_apps_scoreboard}
|
6
|
+
import{r as t,c as i,h as s,H as o,g as e}from"./p-4e6eb06e.js";import{l as n}from"./p-4cd4cb85.js";import{b as a}from"./p-5ff711ee.js";import{w as r}from"./p-04674a1e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const l="instant-apps-scoreboard",d=`${l}--`,c=`${l}__`,p=r.medium[1],h={BASE:l,itemsContainer:`${c}items-container`,items:`${c}items`,item:`${c}item`,label:`${c}item-label`,value:`${c}item-value`,valuePlaceholder:`${c}item-value-placeholder`,position:{bottom:`${c}position--bottom`,side:`${c}position--side`,left:`${c}position--left`,right:`${c}position--right`},mode:{floating:`${c}mode--floating`,pinned:`${c}mode--pinned`}},b=class{constructor(s){t(this,s),this.scoreboardItemsUpdated=i(this,"scoreboardItemsUpdated",7),this.view=void 0,this.items=void 0,this.position="bottom",this.mode="floating",this.itemLimit=6,this.autoDockEnabled=!0,this.geometry=null,this.state="loading",this.messages=void 0,this.itemIndex=0,this.layers=void 0,this.layerViews=void 0,this.isMobile=!1}scoreboardItemsUpdatedHandler(){this.scoreboardItemsUpdated.emit(this.items)}generateUIDs(){this.itemIndex=0,this.items.forEach(this.generateUID())}async storeLayers(){this.state="calculating",await this.view.map.loadAll();const t=this.items.map((t=>{var i;return null===(i=null==t?void 0:t.layer)||void 0===i?void 0:i.id}));this.layers=this.view.map.allLayers.filter((i=>(i=>(t=>!t.isTable)(i)&&(t=>"feature"===t.type||"scene"===t.type)(i)&&(i=>t.indexOf(i.id)>-1)(i))(i))),this.watchLayerVisibility()}async storeLayerViews(){if(this.layers&&this.layers.length>0){this.layers.forEach((t=>t.outFields=["*"]));const t=[];this.layers.forEach((i=>{const s=this.view.whenLayerView(i);t.push(s)}));const i=(await Promise.allSettled(t)).filter((t=>"fulfilled"==t.status&&t.value)).map((t=>t.value)),s=[];i.forEach((t=>{var i;return s.push(null===(i=this.reactiveUtils)||void 0===i?void 0:i.whenOnce((()=>!t.updating)))})),await Promise.all(s),this.layerViews=new this.Collection([...i])}}calculateScoreboardItemValuesFromGeometry(){this.calculateScoreboardItemValues()}async calculateScoreboardItemValues(){if(this.layers&&0===this.layers.length||this.layerViews&&0===this.layerViews.length)return;this.state="calculating";const t=[...this.items],i=[];this.queryStatDefinitions(t,i);const s=await Promise.all(i);this.handleQueryFeaturesResponses(s,t),this.items.length=0,t.forEach((t=>this.items.push(t))),this.state="complete",this.scoreboardItemsUpdatedHandler(),this.initStationaryWatcher()}async componentWillLoad(){var t;new ResizeObserver((()=>{this.itemIndex=0,this.autoDockEnabled&&(this.isMobile=!!this.checkMobile)})).observe(null===(t=this.el)||void 0===t?void 0:t.parentElement);try{this.state="loading",await this.initMessages()}catch(t){return this.state="disabled",Promise.reject()}finally{if(!this.view||!this.items)return this.state="disabled",Promise.reject();try{return await this.initModules(),Promise.resolve()}catch(t){return this.state="disabled",Promise.reject()}}}async componentDidLoad(){var t;if("disabled"!==this.state)try{await(null===(t=this.reactiveUtils)||void 0===t?void 0:t.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready}))),this.generateUIDs(),await this.loadMapResources(),this.storeLayers(),this.initViewUpdateWatcher()}catch(t){this.state="disabled",console.error(`${l}: FAILED TO LOAD MAP RESOURCES`)}}disconnectedCallback(){var t,i,s,o,e,n;this.state="disabled",this.itemIndex=0,null===(t=this.layers)||void 0===t||t.removeAll(),null===(i=this.layers)||void 0===i||i.destroy(),this.layers=null,null===(s=this.layerViews)||void 0===s||s.removeAll(),null===(o=this.layerViews)||void 0===o||o.destroy(),this.layerViews=null,null===(e=this.handles)||void 0===e||e.removeAll(),null===(n=this.handles)||void 0===n||n.destroy(),this.handles=null}async initMessages(){let t;try{return t=(await a(this.el))[0],this.messages=Object.assign(Object.assign({},this.messages),t),Promise.resolve()}catch(t){console.error("FAILED TO LOAD MESSAGES"),Promise.reject()}}async initModules(){try{const[t,i,s,o]=await n(["esri/core/Handles","esri/core/reactiveUtils","esri/core/Collection","esri/intl"]);return this.reactiveUtils=i,this.Collection=s,this.intl=o,this.handles=new t,this.layers=new s,this.layerViews=new s,Promise.resolve()}catch(t){return console.error(t),this.state="disabled",Promise.reject()}}async loadMapResources(){const{map:t}=this.view,i=t;try{return await i.loadAll(),Promise.resolve()}catch(t){return console.error(t),this.state="disabled",Promise.reject()}}generateUID(){return t=>{const i=Math.random(),s=Math.floor(10*Math.random())+11,o=i.toString(s).replace("0.","");t.uid=o}}render(){var t,i;const{state:e}=this,n="disabled"===e,a="loading"===e||"calculating"===e||(null===(t=this.view)||void 0===t?void 0:t.updating)?this.renderProgress():null;return s(o,{key:"5fed5010f728e5d8c4866af3bc38b41ac9b5424f",class:`${this.getPositionClass} ${this.getStyleClass}`},n?null:[a,(null===(i=this.items)||void 0===i?void 0:i.length)>0?this.renderBase():null])}renderBase(){return s("div",{key:"instant-apps-scoreboard-base",class:l},this.renderContent())}renderContent(){const{state:t}=this;return"loading"===t?this.renderLoader():"calculating"===t||"complete"===t?this.renderItemsContainer():null}renderItemsContainer(){const[t,i]=this.renderPreviousNextButtons();return s("div",{class:h.itemsContainer},t,this.renderItems(),i)}renderPreviousNextButtons(){var t,i,o;const e=this.getItemLimit(),n=(null===(t=this.items.filter((t=>t.visible)))||void 0===t?void 0:t.length)<=e,a=0===this.itemIndex,r=this.isEnd,l=!!this.isMobile||"bottom"===this.position,d=l?"start":"center",c={previous:l?"chevron-left":"chevron-up",next:l?"chevron-right":"chevron-down"},p=a||n?"blank":c.previous,h=r||n?"blank":c.next,b={previous:a||n,next:r||n},u="transparent",m=this.isMobile?"s":"l",v={previous:null===(i=this.messages)||void 0===i?void 0:i.previous,next:null===(o=this.messages)||void 0===o?void 0:o.next};return[s("calcite-action",{onClick:this.previousItem.bind(this),icon:p,disabled:b.previous,alignment:d,scale:m,appearance:u,text:v.previous,label:v.previous}),s("calcite-action",{onClick:this.nextItem.bind(this),icon:h,disabled:b.next,alignment:d,scale:m,appearance:u,text:v.next,label:v.next})]}renderItems(){const{items:t}=h,i=this.getItemsToDisplay.map((t=>this.renderItem(t)));return s("ul",{class:t},i)}renderItem(t){const{label:i}=t;return s("li",{class:h.item},s("span",{class:h.label,title:i},i),this.renderValue(t))}renderValue(t){var i,o,e;const{displayValue:n}=t,a="disabled"===this.state,r=void 0===n&&"calculating"===this.state,l=n||(null===(i=this.messages)||void 0===i?void 0:i.NA),d=null===(o=this.layers)||void 0===o?void 0:o.find((i=>{var s;return(null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.id)===i.id})),c=!(null==d?void 0:d.visible),p=r?this.renderValuePlaceholder():a?"":c?s("calcite-icon",{icon:"view-hide",scale:"l",title:null===(e=this.messages)||void 0===e?void 0:e.layerVisibilityOff}):l;return s("span",{class:h.value},p)}renderValuePlaceholder(){return s("span",{class:h.valuePlaceholder})}renderProgress(){return s("calcite-progress",{key:`${d}calcite-progress`,type:"indeterminate"})}renderLoader(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.loading;return s("calcite-loader",{key:`${d}calcite-loader`,label:i,text:i,scale:"m"})}get getPositionClass(){const{bottom:t,left:i,right:s,side:o}=h.position;return this.isMobile||"bottom"===this.position?t:`${"left"===this.position?i:s} ${o}`}get getStyleClass(){const{floating:t,pinned:i}=h.mode;return this.isMobile?i:"floating"===this.mode?t:i}get checkMobile(){var t,i;const s=null===(i=null===(t=this.el)||void 0===t?void 0:t.parentElement)||void 0===i?void 0:i.offsetWidth;return!isNaN(s)&&s>0&&s<p}get getItemsToDisplay(){const t=this.getItemLimit();return this.items.filter((t=>t.visible)).slice(this.itemIndex,t+this.itemIndex)}get isEnd(){const t=this.getItemLimit(),i=this.items.slice(this.items.length-t).map((t=>t.uid)),s=this.items.slice(this.itemIndex,this.itemIndex+t).map((t=>t.uid));return i.every(((t,i)=>t===s[i]))}previousItem(){this.itemIndex=this.itemIndex-1}nextItem(){this.itemIndex=this.itemIndex+1}queryStatDefinitions(t,i){const s=(t,i)=>{var s,o,e,n,a;const r=t.createQuery(),l=this.geometry?this.geometry:this.view.extent;r.outStatistics=[i],r.geometry=l;const d=null!==(a=null!==(o=null===(s=null==t?void 0:t.filter)||void 0===s?void 0:s.timeExtent)&&void 0!==o?o:null===(n=null===(e=null==t?void 0:t.featureEffect)||void 0===e?void 0:e.filter)||void 0===n?void 0:n.timeExtent)&&void 0!==a?a:null;return d&&(r.timeExtent=d),r};t.forEach((()=>async t=>{var o;const e=null===(o=this.layerViews)||void 0===o?void 0:o.find((i=>{var s;return i.layer.id===(null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.id)}));if(!e)return;const n=(t=>{const{field:i,operation:s}=t;return{onStatisticField:i,outStatisticFieldName:`${i}_${s}`,statisticType:s}})(t),a=s(e,n),r=e.queryFeatures(a);i.push(r)})())}handleQueryFeaturesResponses(t,i){t.forEach((()=>(t,s)=>{const o=(t=>{const i=t.features[0],{attributes:s}=i;return Object.values(s)[0]})(t),e=null!==o,n=e?this.intl.formatNumber(o,{notation:"compact",compactDisplay:"short"}):null;i[s].displayValue=e?`${n}`:"",i[s].value=o})())}initStationaryWatcher(){var t,i;const s={once:!0,initial:!0},o=()=>{var t;return null===(t=this.reactiveUtils)||void 0===t?void 0:t.when((()=>{var t;return!(null===(t=this.view)||void 0===t?void 0:t.interacting)}),(()=>this.calculateScoreboardItemValues()),s)},e="stationary-watcher-key";(null===(t=this.handles)||void 0===t?void 0:t.has(e))&&this.handles.remove(e),null===(i=this.handles)||void 0===i||i.add((()=>{var t;return null===(t=this.reactiveUtils)||void 0===t?void 0:t.when((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.stationary}),(()=>o()))})(),e)}initViewUpdateWatcher(){return this.reactiveUtils.watch((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.updating}),(()=>{this.reactiveUtils.when((()=>{var t;return!(null===(t=this.view)||void 0===t?void 0:t.updating)}),(()=>this.calculateScoreboardItemValues()),{once:!0,initial:!0})}),{initial:!0})}watchLayerVisibility(){var t,i;if(!this.layers)return;const s="visbilityWatcherKey";null===(t=this.handles)||void 0===t||t.remove(s);const o=[];this.layers.forEach((t=>{const i=async()=>{const i=await this.view.whenLayerView(t);await this.reactiveUtils.whenOnce((()=>!1===(null==i?void 0:i.updating))),this.calculateScoreboardItemValues()},s=this.reactiveUtils.watch((()=>null==t?void 0:t.visible),(async()=>i()));o.push(s)})),null===(i=this.handles)||void 0===i||i.add([...o],s)}getItemLimit(){return this.itemLimit<2||this.itemLimit>6?6:this.itemLimit}get el(){return e(this)}static get watchers(){return{items:["generateUIDs","storeLayers"],layers:["storeLayerViews"],geometry:["calculateScoreboardItemValuesFromGeometry"],layerViews:["calculateScoreboardItemValues"]}}};b.style=":host{display:block;--instant-apps-scoreboard-background-color:var(--calcite-color-foreground-1);--instant-apps-scoreboard-text-color:var(--calcite-color-text-1);--instant-apps-scoreboard-mobile-position-bottom:0;background-color:var(--instant-apps-scoreboard-background-color);color:var(--instant-apps-scoreboard-text-color)}:host .instant-apps-scoreboard{box-sizing:border-box;border:1px solid var(--calcite-color-border-1);box-shadow:0px 3px 15px rgba(0, 0, 0, 0.2);border-radius:3px}:host .instant-apps-scoreboard calcite-loader{--calcite-loader-padding:1rem}:host .instant-apps-scoreboard__items-container{display:flex}:host .instant-apps-scoreboard__items-container calcite-action{height:100%}:host .instant-apps-scoreboard__items,:host .instant-apps-scoreboard__item{box-sizing:border-box;display:flex}:host .instant-apps-scoreboard__items{list-style-type:none;padding-left:0;margin:0;padding-top:1.75%;padding-bottom:1.75%;width:100%}:host .instant-apps-scoreboard__item{flex-direction:column;justify-content:flex-end;align-items:center;padding:1%}:host .instant-apps-scoreboard__item-label{box-sizing:border-box;line-height:24px;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;word-break:break-word;font-size:1rem;font-weight:400;text-align:center}:host .instant-apps-scoreboard__item-value{display:flex;justify-content:center;align-items:center;min-width:32px;min-height:32px;margin-top:5px;font-size:1.5rem;font-weight:900}:host .instant-apps-scoreboard__item-value-placeholder{display:inline-block;width:32px;height:32px;background-color:var(--calcite-color-foreground-3);border-radius:4px}:host(.instant-apps-scoreboard__position--bottom){bottom:0}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__items{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__item{min-width:10vw;vertical-align:top}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating){left:50%;max-width:calc(100% - 30px);transform:translate(-50%, -15px)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:25vw}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){left:unset;bottom:0;transform:unset;width:100%}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{min-width:unset}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{width:100%;justify-content:space-between}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard{display:flex;justify-content:center;align-items:center;width:10vw;overflow-y:auto}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container{flex-direction:column;height:100%;box-sizing:border-box}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container calcite-action{height:unset;width:100%}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items{flex-direction:column;padding:10px}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__item{padding-top:0.5vh;padding-bottom:0.5vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating){top:15px;left:15px;max-height:calc(100% - 30px)}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:10vw;min-height:35vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned){top:unset;left:unset;transform:unset;height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{justify-content:space-between}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--floating){left:15px}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--floating){left:unset;right:15px}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--pinned){left:0}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--pinned){left:unset;right:0}@media only screen and (min-width: 992px){:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){bottom:var(--instant-apps-scoreboard-mobile-position-bottom)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__item{justify-content:center;min-width:unset;flex-grow:1}}";export{b as instant_apps_scoreboard}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as s,h as i,g as e}from"./p-4e6eb06e.js";import{S as o}from"./p-7530a02f.js";import{g as n}from"./p-5ff711ee.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";function l(t){var s;return!!(null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s?void 0:s.getItem(t))}const a=class{constructor(i){var e;t(this,i),this.splashClose=s(this,"splashClose",7),this._sanitizer=null==(e=o)||"function"!=typeof e?null:new e({whiteList:{h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],img:["style","src","width","height"],pre:["style"],p:["id","class","style"],div:["id","class","style","role"],span:["id","class","style","role"],figure:["class","style"]}},!0),this.localStorageKey=void 0,this.titleText="",this.content="",this.primaryButtonText="",this.open=!0,this.closeButtonDisabled=!1,this.outsideCloseDisabled=!1,this.secondaryButton=!1,this.secondaryButtonText=void 0,this.secondaryButtonIcon=void 0,this.secondaryButtonCallback=void 0,this.messages=void 0}sanitizeContent(){this.content=this._sanitizer.sanitize(this.content)}componentWillLoad(){let t;const{localStorageKey:s}=this;t=s?this.open&&!l(this.localStorageKey):this.open,this.el.open=t,this.content&&this._sanitizer&&this.sanitizeContent()}componentDidLoad(){n(this)}render(){return i("calcite-modal",{key:"
|
6
|
+
import{r as t,c as s,h as i,g as e}from"./p-4e6eb06e.js";import{S as o}from"./p-7530a02f.js";import{g as n}from"./p-5ff711ee.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";function l(t){var s;return!!(null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s?void 0:s.getItem(t))}const a=class{constructor(i){var e;t(this,i),this.splashClose=s(this,"splashClose",7),this._sanitizer=null==(e=o)||"function"!=typeof e?null:new e({whiteList:{h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],img:["style","src","width","height"],pre:["style"],p:["id","class","style"],div:["id","class","style","role"],span:["id","class","style","role"],figure:["class","style"]}},!0),this.localStorageKey=void 0,this.titleText="",this.content="",this.primaryButtonText="",this.open=!0,this.closeButtonDisabled=!1,this.outsideCloseDisabled=!1,this.secondaryButton=!1,this.secondaryButtonText=void 0,this.secondaryButtonIcon=void 0,this.secondaryButtonCallback=void 0,this.messages=void 0}sanitizeContent(){this.content=this._sanitizer.sanitize(this.content)}componentWillLoad(){let t;const{localStorageKey:s}=this;t=s?this.open&&!l(this.localStorageKey):this.open,this.el.open=t,this.content&&this._sanitizer&&this.sanitizeContent()}componentDidLoad(){n(this)}render(){return i("calcite-modal",{key:"1ab8d4142fe5c3ac087c2146af6f8510183af8a8",onCalciteModalClose:this.close.bind(this),open:this.open,closeButtonDisabled:this.closeButtonDisabled,outsideCloseDisabled:this.outsideCloseDisabled},this.renderHeader(),this.renderContent(),this.localStorageKey?this.renderDontShowThisAgainCheckbox():null,this.renderPrimaryButton(),this.secondaryButton?this.renderSecondaryButton():null)}renderHeader(){const{titleText:t}=this;return i("header",{slot:"header"},t)}renderContent(){const{content:t}=this;return i("div",{slot:"content",innerHTML:t},i("slot",{name:"custom-action"}))}renderDontShowThisAgainCheckbox(){const{localStorageKey:t,messages:s}=this,e=!!l(t)||null;return i("div",{class:"instant-apps-splash__back-content",slot:"back"},i("calcite-label",{layout:"inline"},i("calcite-checkbox",{onCalciteCheckboxChange:this.handleDontShowThisAgain.bind(this),checked:null!=e?e:void 0}),null==s?void 0:s.dontShowThisAgain))}renderPrimaryButton(){const{primaryButtonText:t}=this;return i("calcite-button",{onClick:this.close.bind(this),slot:"primary"},t||"Enter")}renderSecondaryButton(){var t;return i("calcite-button",{onClick:null===(t=this.secondaryButtonCallback)||void 0===t?void 0:t.bind(this),slot:"secondary","icon-start":this.secondaryButtonIcon,appearance:"outline"},this.secondaryButtonText)}close(){this.open=!1,this.splashClose.emit()}handleDontShowThisAgain(t){const{localStorageKey:s}=this;if(!s)return;const i=t.target,{checked:e}=i;e?null===window||void 0===window||window.localStorage.setItem(s,"false"):function(t){var s;null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s||s.removeItem(t)}(s)}get el(){return e(this)}static get watchers(){return{content:["sanitizeContent"]}}};a.style=":host{display:block}:host .image.image_resized img{width:100%}:host .instant-apps-splash__back-content{display:flex;align-items:center}:host .instant-apps-splash__back-content calcite-label{--calcite-label-margin-bottom:0}";export{a as instant_apps_splash}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{h as e,r as i,f as t,g as n}from"./p-4e6eb06e.js";import{h as a,s,g as l,v as r,a as c,i as o,b as d,c as v,d as p,e as u,f as g,j as h,u as f,k as m,l as y}from"./p-af573e0d.js";import{c as _}from"./p-d4056c1c.js";import{l as b}from"./p-4cd4cb85.js";import"./p-dc9d4be3.js";import"./p-0a24ad5f.js";const w=96;function k(e){return e?e/72*w:0}var x={exports:{}};!function(e){var i,t="http://www.w3.org/",n="".concat(t,"2000/svg"),a="".concat(t,"1999/xlink"),s=[],l=function(e,i){var t={};return Object.keys(e).forEach((function(i){t[i]=e[i]})),i&&Object.keys(i).forEach((function(e){t[e]=i[e]})),t},r=function(e,i){return e.vnodeSelector===i.vnodeSelector&&(e.properties&&i.properties?e.properties.key===i.properties.key&&e.properties.bind===i.properties.bind:!e.properties&&!i.properties)},c=function(e){if("string"!=typeof e)throw new Error("Style values must be strings")},o=function(e,i,t){if(""!==i.vnodeSelector)for(var n=t;n<e.length;n++)if(r(e[n],i))return n;return-1},d=function(e,i,t,n){var a=e[i];if(""!==a.vnodeSelector){var s=a.properties;if(!(s?void 0===s.key?s.bind:s.key:void 0))for(var l=0;l<e.length;l++)if(l!==i&&r(e[l],a))throw{error:new Error("".concat(t.vnodeSelector," had a ").concat(a.vnodeSelector," child ").concat("added"===n?n:"removed",", but there is now more than one. You must add unique key properties to make them distinguishable.")),parentNode:t,childNode:a}}},v=function(e){if(e.properties){var i=e.properties.enterAnimation;i&&i(e.domNode,e.properties)}},p=[],u=!1,g=function(e){(e.children||[]).forEach(g),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},h=function(){u=!1,p.forEach(g),p.length=0},f=function(e){p.push(e),u||(u=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(h,{timeout:16}):setTimeout(h,16))},m=function(e){var i=e.domNode;if(e.properties){var t=e.properties.exitAnimation;if(t){i.style.pointerEvents="none";return void t(i,(function(){i.parentNode&&(i.parentNode.removeChild(i),f(e))}),e.properties)}}i.parentNode&&(i.parentNode.removeChild(i),f(e))},y=function(e,i,t){(function(e,i,t){if(i)for(var n=0,a=i;n<a.length;n++)_(a[n],e,void 0,t)})(e,i.children,t),i.text&&(e.textContent=i.text),function(e,i,t){if(i)for(var s=t.eventHandlerInterceptor,l=Object.keys(i),r=l.length,o=function(r){var o,d=l[r],v=i[d];if("className"===d)throw new Error('Property "className" is not supported, use "class".');if("class"===d)b(e,v,!0);else if("classes"===d)for(var p=Object.keys(v),u=p.length,g=0;g<u;g++){var h=p[g];v[h]&&e.classList.add(h)}else if("styles"===d){var f=Object.keys(v),m=f.length;for(g=0;g<m;g++){var y=f[g],_=v[y];_&&(c(_),t.styleApplyer(e,y,_))}}else if("key"!==d&&null!=v){var w=typeof v;"function"===w?(0===d.lastIndexOf("on",0)&&(s&&(v=s(d,v,e,i)),"oninput"===d&&(o=v,v=function(e){o.apply(this,[e]),e.target["oninput-value"]=e.target.value})),e[d]=v):t.namespace===n?"href"===d?e.setAttributeNS(a,d,v):e.setAttribute(d,v):"string"===w&&"value"!==d&&"innerHTML"!==d?e.setAttribute(d,v):e[d]=v}},d=0;d<r;d++)o(d)}(e,i.properties,t),i.properties&&i.properties.afterCreate&&i.properties.afterCreate.apply(i.properties.bind||i.properties,[e,t,i.vnodeSelector,i.properties,i.children])},_=function(e,i,t,a){var s,r,c=0,o=e.vnodeSelector,d=i.ownerDocument;if(""===o)e.domNode?e.domNode.nodeValue=e.text:(r=e.domNode=d.createTextNode(e.text),void 0!==t?i.insertBefore(r,t):i.appendChild(r));else{for(var v=0;v<=o.length;++v){var p=o.charAt(v);if(v===o.length||"."===p||"#"===p){var u=o.charAt(c-1),g=o.slice(c,v);"."===u?r.classList.add(g):"#"===u?r.id=g:("svg"===g&&(a=l(a,{namespace:n})),void 0!==a.namespace?r=e.domNode=d.createElementNS(a.namespace,g):(r=e.domNode=e.domNode||((null===(s=e.properties)||void 0===s?void 0:s.is)?d.createElement(g,{is:e.properties.is}):d.createElement(g)),"input"===g&&e.properties&&void 0!==e.properties.type&&r.setAttribute("type",e.properties.type)),void 0!==t?i.insertBefore(r,t):r.parentNode!==i&&i.appendChild(r)),c=v+1}}y(r,e,a)}},b=function(e,i,t){i&&i.split(" ").forEach((function(i){i&&e.classList.toggle(i,t)}))};i=function(e,t,p){var u=e.domNode,g=!1;if(e===t)return!1;var h=!1;if(""===t.vnodeSelector){if(t.text!==e.text){var f=u.ownerDocument.createTextNode(t.text);return u.parentNode.replaceChild(f,u),t.domNode=f,!0}t.domNode=u}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(p=l(p,{namespace:n})),e.text!==t.text&&(h=!0,void 0===t.text?u.removeChild(u.firstChild):u.textContent=t.text),t.domNode=u,h=function(e,t,n,a,l){if(n===a)return!1;for(var c,p=(n=n||s).length,u=(a=a||s).length,g=0,h=0,f=!1;h<u;){var y=g<p?n[g]:void 0,b=a[h];if(void 0!==y&&r(y,b))f=i(y,b,l)||f,g++;else{var w=o(n,b,g+1);if(w>=0){for(c=g;c<w;c++)m(n[c]),d(n,c,e,"removed");f=i(n[w],b,l)||f,g=w+1}else _(b,t,g<p?n[g].domNode:void 0,l),v(b),d(a,h,e,"added")}h++}if(p>g)for(c=g;c<p;c++)m(n[c]),d(n,c,e,"removed");return f}(t,u,e.children,t.children,p)||h,h=function(e,i,t,s){if(t){for(var l=!1,r=Object.keys(t),o=r.length,d=0;d<o;d++){var v=r[d],p=t[v],u=i[v];if("class"===v)u!==p&&(b(e,u,!1),b(e,p,!0));else if("classes"===v)for(var g=e.classList,h=Object.keys(p),f=h.length,m=0;m<f;m++){var y=h[m],_=!!p[y];_!==!!u[y]&&(l=!0,_?g.add(y):g.remove(y))}else if("styles"===v){var w=Object.keys(p),k=w.length;for(m=0;m<k;m++){var x=w[m],$=p[x];$!==u[x]&&(l=!0,$?(c($),s.styleApplyer(e,x,$)):s.styleApplyer(e,x,""))}}else if(p||"string"!=typeof u||(p=""),"value"===v){var L=e[v];L!==p&&(e["oninput-value"]?L===e["oninput-value"]:p!==u)&&(e[v]=p,e["oninput-value"]=void 0),p!==u&&(l=!0)}else if(p!==u){var j=typeof p;"function"===j&&s.eventHandlerInterceptor||(s.namespace===n?"href"===v?e.setAttributeNS(a,v,p):e.setAttribute(v,p):"string"===j&&"innerHTML"!==v?"role"===v&&""===p?e.removeAttribute(v):e.setAttribute(v,p):e[v]!==p&&(e[v]=p),l=!0)}}return l}}(u,e.properties,t.properties,p)||h,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[u,p,t.vnodeSelector,t.properties,t.children]);return h&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(u,t.properties,e.properties),g};var w=function(e,t){return{getLastRender:function(){return e},update:function(n){if(e.vnodeSelector!==n.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");var a=e;e=n,i(a,n,t)},domNode:e.domNode}},k={namespace:void 0,performanceLogger:function(){},eventHandlerInterceptor:void 0,styleApplyer:function(e,i,t){"-"===i.charAt(0)?e.style.setProperty(i,t):e.style[i]=t}},x=function(e){return l(k,e)},$={create:function(e,i){return i=x(i),_(e,document.createElement("div"),void 0,i),w(e,i)},append:function(e,i,t){return t=x(t),_(i,e,void 0,t),w(i,t)},insertBefore:function(e,i,t){return t=x(t),_(i,e.parentNode,e,t),w(i,t)},merge:function(e,i,t){return t=x(t),i.domNode=e,y(e,i,t),w(i,t)},replace:function(e,i,t){return t=x(t),_(i,e.parentNode,e,t),e.parentNode.removeChild(e),w(i,t)}},L=function(e,i,t){for(var n=0,a=i.length;n<a;n++){var s=i[n];Array.isArray(s)?L(e,s,t):null!=s&&!1!==s&&("string"==typeof s&&(s={vnodeSelector:"",properties:void 0,children:void 0,text:s.toString(),domNode:null}),t.push(s))}};var j;j=Array.prototype.find?function(e,i){return e.find(i)}:function(e,i){return e.filter(i)[0]};var O=function(e,i,t){return function(){return n};function n(n){t("domEvent",n);var a=i(),s=function(e,i){for(var t=[];e&&e!==i;)t.push(e),e=e.parentNode;return t}(n.currentTarget,a.domNode);s.reverse();var l,r=function(e,i){var t=e;return i.forEach((function(e){t=t&&t.children?j(t.children,(function(i){return i.domNode===e})):void 0})),t}(a.getLastRender(),s);return e.scheduleRender(),r&&(l=r.properties["on".concat(n.type)].apply(r.properties.bind||this,arguments)),t("domEventProcessed",n),l}};e.createCache=function(){var e,i;return{invalidate:function(){i=void 0,e=void 0},result:function(t,n){if(e)for(var a=0;a<t.length;a++)e[a]!==t[a]&&(i=void 0);return i||(i=n(),e=t),i}}},e.createMapping=function(e,i,t){var n=[],a=[];return{results:a,map:function(s){for(var l=s.map(e),r=a.slice(),c=0,o=0;o<s.length;o++){var d=s[o],v=l[o];if(v===n[c])a[o]=r[c],t(d,r[c],o),c++;else{for(var p=!1,u=1;u<n.length+1;u++){var g=(c+u)%n.length;if(n[g]===v){a[o]=r[g],t(s[o],r[g],o),c=g+1,p=!0;break}}p||(a[o]=i(d,o))}}a.length=s.length,n=l}}},e.createProjector=function(e){var i,t,n=x(e),a=n.performanceLogger,s=!0,l=!1,r=[],c=[],o=function(e,t,s){var l;n.eventHandlerInterceptor=O(i,(function(){return l}),a),l=e(t,s(),n),r.push(l),c.push(s)},d=function(){if(t=void 0,s){s=!1,a("renderStart",void 0);for(var e=0;e<r.length;e++){var i=c[e]();a("rendered",void 0),r[e].update(i),a("patched",void 0)}a("renderDone",void 0),s=!0}};return i={renderNow:d,scheduleRender:function(){t||l||(t=requestAnimationFrame(d))},stop:function(){t&&(cancelAnimationFrame(t),t=void 0),l=!0},resume:function(){l=!1,s=!0,i.scheduleRender()},append:function(e,i){o($.append,e,i)},insertBefore:function(e,i){o($.insertBefore,e,i)},merge:function(e,i){o($.merge,e,i)},replace:function(e,i){o($.replace,e,i)},detach:function(e){for(var i=0;i<c.length;i++)if(c[i]===e)return c.splice(i,1),r.splice(i,1)[0];throw new Error("renderFunction was not found")}}},e.dom=$,e.h=function(e,i,t){if(Array.isArray(i))t=i,i=void 0;else if(i&&("string"==typeof i||i.vnodeSelector)||t&&("string"==typeof t||t.vnodeSelector))throw new Error("h called with invalid arguments");var n,a;return t&&1===t.length&&"string"==typeof t[0]?n=t[0]:t&&(L(e,t,a=[]),0===a.length&&(a=void 0)),{vnodeSelector:e,properties:i,children:a,text:""===n?void 0:n,domNode:null}}}(x.exports);const $=x.exports.createProjector(),L=20,j={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function O(i="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===i?e("svg",{height:"4",width:"10"},e("line",{x1:"0",y1:"2",x2:"10",y2:"2",style:t})):e("svg",{height:"10",width:"10"},e("line",{x1:"5",y1:"0",x2:"5",y2:"10",style:t}))}function z(e,i="vertical"){const t=document.createElement("div");return t.style.height=`${L}px`,t.className=j.univariateAboveAndBelowSymbol,null!=e&&(t.style.opacity=e.toString()),$.append(t,O.bind(null,i)),t}function R(e,i,t="vertical",n){e.infos.forEach(((e,a)=>{if(n&&2===a)e.preview=z(i,t);else{const{size:i}=e,n=k(i)+("horizontal"===t?20:10),a="div"===e.preview.tagName.toLowerCase(),s=a?e.preview:document.createElement("div");s&&(s.className=j.univariateAboveAndBelowSymbol),"horizontal"===t?s&&(s.style.width=`${n}px`):s&&(s.style.height=`${n}px`),a||s&&s.appendChild(e.preview),e.preview=s}}))}function E(e,i="classic"){const t=e.infos,n=t[0].size,a=t[t.length-1].size;return"classic"===i?(k(n)+10)/2:(k(n)-k(a))/2}async function A(e,i){if(!e)return Promise.resolve(null);const t=e.infos.map((e=>e.color)),[n]=await b(["esri/symbols/support/symbolUtils"]),a=n.renderColorRampPreviewHTML("full"===i.type?t:"above"===i.type?t.slice(0,3):t.slice(2,5),{width:i.width,height:i.height,align:i.rampAlignment,effectList:i.effectList});return a.className=j.colorRamp,null!=i.opacity&&(a.style.opacity=i.opacity.toString()),Promise.resolve(a)}function F(e,i,t,n="vertical"){const a=function(e,i,t,n="vertical"){let a=0;const s=e.infos,l=Math.floor(s.length/2),r="full"===i||"below"===i?s.length-1:l;for(let e="full"===i||"above"===i?0:l;e<=r;e++)a+=t&&e===l?"horizontal"===n?10:L:k(s[e].size)+("horizontal"===n?20:10);return Math.round(a)}(e,i,t,n),s=e.infos,l=Math.floor(s.length/2),r="full"===i||"above"===i?0:l,c="full"===i||"below"===i?s.length-1:l,o=t?"vertical"===n?L:10:0,d="vertical"===n?10*("full"===i?2:1):20*("full"===i?2:1);return Math.round(a-(k("full"===i?s[r].size+s[c].size:"above"===i?s[r].size:s[c].size)/2+o/2+d/2))}const M="esri-legend__layer-body",C="esri-legend__layer-row",I="esri-legend__layer-cell esri-legend__layer-cell--info",T="esri-legend__layer-cell esri-legend__layer-cell--symbols",N="esri-legend__symbol",S="esri-legend__ramps",P="esri-legend__size-ramp",H="esri-legend__ramp-labels",D="esri-legend__ramp-label",q="esri-univariate-above-and-below-ramp__label",B={display:"flex",alignItems:"flex-start"},U={marginLeft:"3px"},V={display:"table-cell",verticalAlign:"middle"},W=class{constructor(e){i(this,e),this.calculatingFeatureCount=!1,this.legendvm=void 0,this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:"filter"},this.messages=void 0,this.isLoading=!0,this.intLegendId=void 0}handleFilterModeChange(){a(this.filterMode,this.legendvm.view)}async connectedCallback(){if(this.handles)return;const[e]=await b(["esri/core/Handles"]);this.handles=new e}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0});const[e,i]=await b(["esri/intl","esri/core/reactiveUtils"]);this.reactiveUtils=i,this.intl=e}async componentDidLoad(){this.initLegend()}async initLegend(){try{await this.reactiveUtils.whenOnce((()=>{var e;return null===(e=this.legendvm)||void 0===e?void 0:e.view}));const e=async()=>{var e,i,t,n;try{const a=await(null===(t=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===t?void 0:t.load());await(null===(n=null==a?void 0:a.basemap)||void 0===n?void 0:n.load());const l=null==a?void 0:a.allLayers,r=null==l?void 0:l.map((e=>e.load())),c=(await Promise.allSettled(r)).map((e=>"fulfilled"===(null==e?void 0:e.status)&&(null==e?void 0:e.value)?e.value:null)).filter((e=>!!e)),d=[];c.forEach((e=>{var i;(null===(i=this.legendvm)||void 0===i?void 0:i.view)&&d.push(this.legendvm.view.whenLayerView(e))})),await Promise.allSettled(d);const v=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),v)),this.isLoading=!1,this.setupWatchersAndListeners()}catch(e){console.error(e),this.isLoading=!1}};this.legendvm.view.when(e),this.legendvm.view.map.layers.on("after-changes",e)}catch(e){this.isLoading=!1}}disconnectedCallback(){var e,i;null===(e=this.handles)||void 0===e||e.removeAll(),null===(i=this.handles)||void 0===i||i.destroy(),this.handles=null}render(){var i,t,n;const a=this.renderFilteredLayers(),r=s.get("compact")?" instant-apps-interactive-legend__compact":"";return this.isLoading?e("calcite-loader",{key:"interactive-legend-loader",scale:"m",label:null===(i=this.messages)||void 0===i?void 0:i.loading,text:null===(t=this.messages)||void 0===t?void 0:t.loading}):e("div",{key:"interactive-legend-classic-container",class:`${l(this.el)}${r}`},(null==a?void 0:a.length)>0?a:e("div",{class:"esri-legend__message"},null===(n=this.messages)||void 0===n?void 0:n.noLegend))}renderFilteredLayers(){var e,i;return(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.activeLayerInfos)||void 0===i?void 0:i.toArray()).map((e=>this.renderLegendForLayer(e))).filter((e=>!!e))}renderLegendForLayer(i,t){var n,a;if(!i.ready)return null;if(i.children.length){const a=i.children.map((e=>this.renderLegendForLayer(e,!0))).toArray();return e("instant-apps-interactive-legend-group-legend-element",{class:l(this.el),legendvm:this.legendvm,featureCount:this.featureCount,activeLayerInfo:i,isChild:t},e("div",{style:{paddingLeft:"20px"},id:`${null===(n=null==i?void 0:i.layer)||void 0===n?void 0:n.id}-legend-layer`,slot:"content"},a))}const s=i.legendElements;if(s&&!s.length)return null;const r=s.map(((e,t)=>this.renderLegendForElement(e,i.layer,i.effectList,i,t))).filter((e=>!!e));return r.length?e("instant-apps-interactive-legend-layer-element",{class:l(this.el),legendvm:this.legendvm,featureCount:this.featureCount,activeLayerInfo:i,messages:this.messages,isChild:t},e("div",{slot:"content",id:`${null===(a=null==i?void 0:i.layer)||void 0===a?void 0:a.id}-legend-layer`,class:"esri-legend__layer"},r)):null}renderLegendForElement(i,t,n,a,s,c,o){const d="color-ramp"===i.type,v="opacity-ramp"===i.type,p="size-ramp"===i.type;let u=null;const g=r(a,i,s),h="relationship-ramp"===(null==i?void 0:i.type);if("symbol-table"===i.type||p){const l=i.infos.map(((e,l)=>this.renderLegendForElementInfo(e,t,n,p,i,a,s,l,g,o||null))).filter((e=>!!e));l.length&&(u=e("div",{class:M},l))}else"color-ramp"===i.type||"opacity-ramp"===i.type||"heatmap-ramp"===i.type||"stretch-ramp"===i.type?u=this.renderLegendForRamp(i,t.opacity):"relationship-ramp"===i.type?u=e("instant-apps-interactive-legend-relationship",{class:l(this.el),key:"relationship-ramp",filterMode:this.filterMode,activeLayerInfo:a,legendElement:i,messages:this.messages}):"pie-chart-ramp"===i.type?u=this.renderPieChartRamp(i):"univariate-above-and-below-ramp"===i.type?u=this.renderUnivariateAboveAndBelowRamp(i,t.opacity,n):"univariate-color-size-ramp"===i.type&&(u=this.renderUnivariateColorSizeRamp(i,t.opacity,n));if(!u)return null;const f=i.title;let m=null;if("string"==typeof f)m=f;else if(f){const e=this.getTitle(this.messages,f,d||v);m=this.isRendererTitle(f,d||v)&&f.title?`${f.title} (${e})`:e}return e("instant-apps-interactive-legend-legend-element",{class:l(this.el),activeLayerInfo:a,isSizeRamp:p,isChild:c,isColorRamp:d,isRelationshipRamp:h,isInteractive:g,zoomTo:this.zoomTo,legendElement:i,titleText:m,legendvm:this.legendvm,legendElementIndex:s,messages:this.messages},e("div",{slot:"content"},u))}renderPieChartRamp(i){var t;return e("div",{innerHTML:`${null===(t=i.preview)||void 0===t?void 0:t.outerHTML}`})}async renderUnivariateAboveAndBelowRamp(i,t,n){const{sizeRampElement:a,colorRampElement:s}=function(e,i,t="vertical"){const n=e.infos;let a=n.find((({type:e})=>"size-ramp"===e)),s=n.find((({type:e})=>"color-ramp"===e));return a&&(a=Object.assign({},a),a.infos=[...a.infos],R(a,i,t,!0)),s&&(s=Object.assign({},s),s.infos=[...s.infos]),"horizontal"===t&&(null==a||a.infos.reverse(),null==s||s.infos.reverse()),{sizeRampElement:a,colorRampElement:s}}(i,t);if(!a)return null;const l=F(a,"above",!0),r=F(a,"below",!0),c=await A(s,{width:12,height:l,rampAlignment:"vertical",opacity:t,type:"above",effectList:n}),o=await A(s,{width:12,height:r,rampAlignment:"vertical",opacity:t,type:"below",effectList:n}),d=E(a),v=a.infos.map((e=>e.label)),p=v.map(((i,t)=>{const n=2===t;return 0===t?e("div",{class:i?c?q:D:""},i):n?e("div",null):null})),u=v.length-1,g=Math.floor(v.length/2),h=v.map(((i,t)=>t===g||t===u?e("div",{class:i?c?q:D:""},i):null)),f={display:"table-cell",verticalAlign:"middle"},m={marginTop:`${d}px`},y={height:`${l}px`},_={height:`${r}px`};return e("div",{key:"univariate-above-and-below-ramp-preview",style:B},e("div",{class:M},a.infos.map(((i,t)=>e("div",{class:`${C} ${P}`},e("div",{class:N,style:f,innerHTML:`${i.preview.outerHTML}`}),c||t%2!=0?null:e("div",{class:I},v[t]))))),c?e("div",{style:m,key:"color-ramp-preview"},e("div",{style:U},e("div",{style:V},e("div",{class:S},c)),e("div",{style:V},e("div",{class:H,style:y},p))),e("div",{style:U},e("div",{style:V},e("div",{class:S},o)),e("div",{style:V},e("div",{class:H,style:_},h)))):null)}renderUnivariateColorSizeRamp(i,t,n){const{sizeRampElement:a,colorRampElement:s}=function(e,i="vertical"){const t=e.infos;let n=t.find((({type:e})=>"size-ramp"===e)),a=t.find((({type:e})=>"color-ramp"===e));return n&&(n=Object.assign({},n),n.infos=[...n.infos],R(n,null,i,!1)),a&&(a=Object.assign({},a),a.infos=[...a.infos]),"horizontal"===i&&(null==n||n.infos.reverse(),null==a||a.infos.reverse()),{sizeRampElement:n,colorRampElement:a}}(i);if(!a)return null;const l=E(a),r=F(a,"full",!1),c=A(s,{width:12,height:r,rampAlignment:"vertical",opacity:t,type:"full",effectList:n}),o=a.infos.length-1,d=a.infos.map(((i,t)=>0===t||t===o?e("div",{class:i.label?s?q:D:""},i.label):null)),v={display:"table-cell",verticalAlign:"middle"},p={marginTop:`${l}px`},u={height:`${r}px`};return e("div",{key:"univariate-above-and-below-ramp-preview",style:B},e("div",{class:M},a.infos.map((i=>e("div",{class:`${C} ${P}`},e("div",{class:N,style:v,innerHTML:`${i.preview.outerHTML}`}))))),e("div",{style:p,key:"color-ramp-preview"},e("div",{style:U},e("div",{style:V},e("div",{class:S},c)),e("div",{style:V},e("div",{class:H,style:u},d)))))}renderLegendForRamp(i,t){var n;const a=i.infos,s="heatmap-ramp"===i.type,l="stretch-ramp"===i.type,r=i.preview,c="opacity-ramp"===i.type?"esri-legend__opacity-ramp":"";r&&(r.classList.add("esri-legend__color-ramp"),c&&r.classList.add(c)),null!=t&&r&&(r.style.opacity=t.toString());const o=a.map((i=>e("div",{class:i.label?D:""},s?this.messages[i.label]||i.label:l?this.getStretchStopLabel(i):i.label))),d={height:null===(n=null==r?void 0:r.style)||void 0===n?void 0:n.height};return e("div",{class:C},e("div",{class:T,style:Object.assign({},{width:"24px"})},e("div",{ref:e=>{var i;(null==e?void 0:e.firstChild)&&(null===(i=null==e?void 0:e.firstChild)||void 0===i||i.remove()),null==e||e.appendChild(r)},class:S})),e("div",{class:I},e("div",{class:H,style:Object.assign({},d)},o)))}getStretchStopLabel(e){return e.label?this.messages[e.label]+": "+("string"==typeof e.value?e.value:this.intl.formatNumber(e.value,{style:"decimal",notation:e.value.toString().includes("e")?"scientific":"standard"})):""}renderLegendForElementInfo(i,t,n,a,r,p,u,g,h,f){var m,_;if(i.type)return this.renderLegendForElement(i,t,n,p,u,!0,i);let b;if(i.preview?b=e("div",{class:N,innerHTML:`${i.preview.outerHTML}`}):i.src&&(b=this.renderImage(i,t,!1)),!b)return null;const w=a?` ${P}`:"";let k;const x=y(t),$=c(x,f);if(o.data){const e=d(x,t,i,$,g),n=v($?null==$?void 0:$.nestedInfos:x);k=1===(null===(m=null==x?void 0:x.categories)||void 0===m?void 0:m.size)?!(null==e?void 0:e.selected):n||(null==e?void 0:e.selected)}const L=!($&&!(null==i?void 0:i.value))&&h,j=s.get("compact"),O=this.getTitle(this.messages,i.label,!1)||"";return L?e("button",{onClick:this.applyFilter(i,t,g,f),class:`${C} instant-apps-interactive-legend__layer-row--interactive${k?" instant-apps-interactive-legend-element-info--selected":""}`,title:j?`${O}`:void 0},e("div",{class:`${T}${w}`},b),e("div",{class:`${I}`},this.getTitle(this.messages,i.label,!1)||""),this.featureCount&&!j?e("instant-apps-interactive-legend-count",{class:l(this.el),categoryId:$?r.title:null!==(_=i.label)&&void 0!==_?_:null==t?void 0:t.id,activeLayerInfo:p,legendvm:this.legendvm,messages:this.messages,selected:k,legendElement:r,infoIndex:g}):null):e("div",{class:C},e("div",{class:`${T}${w}`},b),e("div",{class:`${I}`},O))}renderImage(i,t,n){const{label:a,src:s,opacity:l}=i,r=n?" esri-legend__imagery-layer-image--stretched":"",c=n?"":` ${N}`,o={opacity:`${null!=l?l:t.opacity}`};return e("img",{alt:this.getTitle(this.messages,a,!1),src:s,width:i.width,height:i.height,class:`$${r}${c}`,style:o})}getTitle(e,i,t){var n,a;if(!i)return;if("string"==typeof i||"number"==typeof i)return i;if("value"in i||"unit"in i)return this.intl.substitute(null!==(n=null==e?void 0:e.dotValue)&&void 0!==n?n:"",i);if("colorName"in i||"bandName"in i)return e[i.colorName]+": "+(e[i.bandName]||i.bandName);if("showCount"in i)return i.showCount?e.clusterCountTitle:null;let s=null;return this.isRampTitle(i,t)?s=i.ratioPercentTotal?"showRatioPercentTotal":i.ratioPercent?"showRatioPercent":i.ratio?"showRatio":i.normField?"showNormField":i.field?"showField":null:this.isRendererTitle(i,t)&&(s=i.normField?"showNormField":i.normByPct?"showNormPct":i.field?"showField":null),s?null===(a=this.intl)||void 0===a?void 0:a.substitute("showField"===s?"{field}":e[s],{field:i.field,normField:i.normField}):""}isRampTitle(e,i){return i}isRendererTitle(e,i){return!i}setupWatchersAndListeners(){var e,i,n,a,l,r,c;const d=null===(a=null===(n=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===n?void 0:n.allLayers)||void 0===a?void 0:a.filter((e=>"feature"===(null==e?void 0:e.type)));d.forEach((async e=>{var i,t,n,a;try{const s=await(null===(t=null===(i=this.legendvm)||void 0===i?void 0:i.view)||void 0===t?void 0:t.whenLayerView(e)),l=`fLayerViewScale-${null==e?void 0:e.id}`;(null===(n=this.handles)||void 0===n?void 0:n.has(l))||null===(a=this.handles)||void 0===a||a.add(s.watch("visibleAtCurrentScale",(async()=>this.createDataForLayer(e))),l)}catch(e){}})),null==d||d.forEach((e=>{var i,t,n;const a=`fLayer-${null==e?void 0:e.id}`;(null===(i=this.handles)||void 0===i?void 0:i.has(a))||null===(t=this.handles)||void 0===t||t.add(null===(n=this.reactiveUtils)||void 0===n?void 0:n.watch((()=>null==e?void 0:e.visible),(async()=>this.createDataForLayer(e))),a)})),null===(l=this.handles)||void 0===l||l.add(this.reactiveUtils.when((()=>this.legendvm),(()=>{this.reactiveUtils.watch((()=>{var e,i;return null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating}),(()=>{var e,i;this.calculatingFeatureCount||(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating)&&(this.calculatingFeatureCount=!0,this.reactiveUtils.when((()=>{var e,i;return!(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating)}),(async()=>{const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e)),this.calculatingFeatureCount=!1}),{once:!0,initial:!0}))}),{initial:!0})}),{initial:!0,once:!0})),null===(r=this.handles)||void 0===r||r.add(this.reactiveUtils.on((()=>{var e;return null===(e=this.legendvm)||void 0===e?void 0:e.activeLayerInfos}),"change",(async e=>{var i;const n=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),n)),t(this.el),null===(i=this.handles)||void 0===i||i.add(this.reactiveUtils.on((()=>e.children),"change",(async()=>{const e=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),e)),t(this.el)})))}))),null===(c=this.handles)||void 0===c||c.add(this.reactiveUtils.on((()=>{var e,i,t;return null===(t=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===t?void 0:t.layers}),"after-changes",(async()=>{const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e)),this.calculatingFeatureCount=!1})))}async createDataForLayer(e){var i;const t=s.get("data"),n=null==t?void 0:t[null==e?void 0:e.id],a=g(null===(i=this.legendvm)||void 0===i?void 0:i.activeLayerInfos),l=null==a?void 0:a.find((i=>{var t;return(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.id)===(null==e?void 0:e.id)}));if(!n&&l){const i=await h(this.legendvm,l,this.reactiveUtils);if(f({intLegendLayerData:i,layerId:null==e?void 0:e.id}),this.featureCount){const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e))}}}applyFilter(e,i,t,n){return async()=>{var a;const s=Object.assign({},null===(a=o.data)||void 0===a?void 0:a[null==i?void 0:i.id]);n?await m(s,e,t,this.filterMode,n):await m(s,e,t,this.filterMode),f({intLegendLayerData:s,layerId:null==i?void 0:i.id})}}get el(){return n(this)}static get watchers(){return{filterMode:["handleFilterModeChange"]}}};W.style=".sc-instant-apps-interactive-legend-classic-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-caption-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-field-name-font-size:1rem;--instant-apps-interactive-legend-total-feature-count-font-size:0.875rem;--instant-apps-interactive-legend-info-font-size:0.875rem;--instant-apps-interactive-legend-info-item-background--selected:#c7ebff;--instant-apps-interactive-legend-info-item-background--selected--dark:#009af2;--instant-apps-interactive-legend-info-item-background--hover:#e9e9e9;--instant-apps-interactive-legend-info-item-background--hover--dark:#4a4a4a;--instant-apps-interactive-legend-info-item-color--selected:var(--calcite-color-text-2);--instant-apps-interactive-legend-secondary-background-color:var(--calcite-color-background);--instant-apps-interactive-legend-ui-margin:20px 15px;--instant-apps-interactive-legend-ui-padding:20px 15px}.sc-instant-apps-interactive-legend-classic-h .esri-legend__service.sc-instant-apps-interactive-legend-classic{padding:0}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-body.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__group-layer-child.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-child-table.sc-instant-apps-interactive-legend-classic{margin:0;overflow:hidden}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic calcite-action.sc-instant-apps-interactive-legend-classic{margin-right:5px}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-classic{white-space:nowrap}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-classic calcite-button.sc-instant-apps-interactive-legend-classic{margin:2px}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{font-weight:var(--instant-apps-interactive-legend-caption-font-weight)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell.esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{font-size:var(--instant-apps-interactive-legend-info-font-size);text-align:left}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{display:flex;align-items:center}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-body.sc-instant-apps-interactive-legend-classic{display:block;margin:var(--instant-apps-interactive-legend-ui-margin)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.instant-apps-interactive-legend__nested-unique-symbol.sc-instant-apps-interactive-legend-classic>.esri-legend__layer-body.sc-instant-apps-interactive-legend-classic{margin:0}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{display:table-row}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell.sc-instant-apps-interactive-legend-classic{display:table-cell}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--symbols.sc-instant-apps-interactive-legend-classic{justify-content:center;width:20%}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{width:65%}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{margin:1px;background:transparent;border:none;width:100%}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{position:relative}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic{background-color:var(--instant-apps-interactive-legend-info-item-background--selected)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic{cursor:pointer;background-color:var(--instant-apps-interactive-legend-info-item-background--selected--dark)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{color:var(--calcite-color-text-inverse)}.sc-instant-apps-interactive-legend-classic-h .hide.sc-instant-apps-interactive-legend-classic{display:none}.instant-apps-interactive-legend__compact.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{--instant-apps-interactive-legend-ui-padding:10px 5px}.instant-apps-interactive-legend__compact.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;line-clamp:2;line-height:1.3125rem;max-height:2.625rem}@media (min-width: 992px){.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{cursor:pointer}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover.instant-apps-interactive-legend-element-info--selected{background-color:#e2f2fe}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover--dark)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover.instant-apps-interactive-legend-element-info--selected{background-color:#26a9f4}}";export{W as instant_apps_interactive_legend_classic}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as i,h as o,g as e}from"./p-4e6eb06e.js";import{g as s}from"./p-50fb7f47.js";import{l}from"./p-4cd4cb85.js";import{a as n}from"./p-5ff711ee.js";import{g as a,f as r,L as d}from"./p-ceb1030b.js";import"./p-dc9d4be3.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const c=class{constructor(o){t(this,o),this.selectedLanguageUpdated=i(this,"selectedLanguageUpdated",7),this.icon="language",this.portalItem=void 0,this.view=void 0,this.locales=[],this.defaultLocale=void 0,this.selectedLanguage=null,this.calciteDropdownOverlayPositioning="absolute",this.messages=void 0,this.t9nData=null}async componentWillLoad(){var t,i,o,e,d,c,h,u,v,p,w,m;const[f,g,b]=await l(["esri/intl","esri/WebMap","esri/request"]);this.intl=f,this.request=b,this.messages=await s(document.createElement("instant-apps-language-translator"));try{this.portalItemResource=await a(this.portalItem);const t=await r(b,this.portalItemResource);this.t9nData=null!=t?t:{}}catch(t){this.t9nData={},console.error("NO PORTAL ITEM RESOURCE AVAILABLE.")}finally{this.userLocale=this.defaultLocale;const s=new URLSearchParams(window.location.search).get("locale"),l=(null===(o=null===(i=null===(t=this.locales)||void 0===t?void 0:t.map((t=>null==t?void 0:t.locale)))||void 0===i?void 0:i.filter((t=>t===s)))||void 0===o?void 0:o.length)>0,a=n(f,this.portalItem.portal),r=(null===(c=null===(d=null===(e=this.locales)||void 0===e?void 0:e.map((t=>null==t?void 0:t.locale)))||void 0===d?void 0:d.filter((t=>t===a)))||void 0===c?void 0:c.length)>0;this.selectedLanguage=l?s:r?a:this.userLocale;const b=this.selectedLanguage;if(b!==this.userLocale&&(this.calciteDropdownItemSelectCallback(b)(),this.selectedLanguageUpdated.emit({locale:b,data:null!==(u=null===(h=this.t9nData)||void 0===h?void 0:h[b])&&void 0!==u?u:null})),this.view){const t=this.view.map;this.defaultWebMapId=null===(v=null==t?void 0:t.portalItem)||void 0===v?void 0:v.id;const i=null===(m=null===(w=null===(p=this.locales)||void 0===p?void 0:p.filter((t=>(null==t?void 0:t.webmap)&&(null==t?void 0:t.webmap)!==this.defaultWebMapId&&(null==t?void 0:t.locale)===this.selectedLanguage)))||void 0===w?void 0:w[0])||void 0===m?void 0:m.webmap;i&&(this.view.map=new g({portalItem:{id:i}}))}}}render(){const t=this.renderTrigger(),i=this.renderDropdownItems(),e=this.renderDefaultLocale();return o("calcite-dropdown",{key:"ce2effa615127d96ffa5995e09e6b92256d1e549",onCalciteDropdownBeforeOpen:()=>this.trigger.iconEnd="chevron-up",onCalciteDropdownBeforeClose:()=>this.trigger.iconEnd="chevron-down","overlay-positioning":this.calciteDropdownOverlayPositioning,"width-scale":"m"},t,e,i)}renderDefaultLocale(){const{userLocale:t}=this;return o("calcite-dropdown-item",{key:`default-${t}`,onCalciteDropdownItemSelect:this.calciteDropdownItemSelectCallback(t),selected:this.selectedLanguage===this.userLocale},this.getSelectedLanguageText(t))}renderTrigger(){return o("calcite-button",{ref:t=>this.trigger=t,slot:"trigger","icon-start":this.icon,"icon-end":"chevron-down",width:"full",appearance:"outline"},this.getSelectedLanguageText(this.selectedLanguage))}renderDropdownItems(){var t,i;return null===(i=null===(t=this.locales)||void 0===t?void 0:t.map((t=>t.locale)))||void 0===i?void 0:i.map((t=>this.renderDropdownItem(t)))}renderDropdownItem(t){const i=this.getSelectedLanguageText(t);return o("calcite-dropdown-item",{key:t,selected:t===this.selectedLanguage,onCalciteDropdownItemSelect:this.calciteDropdownItemSelectCallback(t)},i)}calciteDropdownItemSelectCallback(t){return async()=>{var i,o,e,s,n;this.selectedLanguage=t;const{intl:a,selectedLanguage:r,t9nData:d,userLocale:c}=this,h=this.locales.filter((t=>t.locale===r))[0];r!==c&&(h.data=d[t]);const u=new URLSearchParams(window.location.search);if(r!==c?u.set("locale",this.selectedLanguage):u.delete("locale"),a.setLocale(r),this.view){const[t]=await l(["esri/WebMap"]),a=null===(o=null===(i=this.locales.filter((t=>t.locale===r)))||void 0===i?void 0:i[0])||void 0===o?void 0:o.webmap;if(a)this.view.map=new t({portalItem:{id:a}});else{const i=null===(n=null===(s=null===(e=this.view)||void 0===e?void 0:e.map)||void 0===s?void 0:s.portalItem)||void 0===n?void 0:n.id;i&&this.defaultWebMapId!==i&&(this.view.map=new t({portalItem:{id:this.defaultWebMapId}}))}}document.documentElement.setAttribute("lang",this.selectedLanguage),this.intl.prefersRTL()?document.documentElement.setAttribute("dir","rtl"):document.documentElement.setAttribute("dir","ltr"),window.history.replaceState({},"",decodeURIComponent(`${window.location.pathname}?${u}`)),this.selectedLanguageUpdated.emit(h)}}getSelectedLanguageText(t){const i=-1!==Object.keys(d.partial).indexOf(t),o=d[i?"partial":"full"],{language:e,translated:s}=o[t];return`${e} - ${s}`}async refresh(){try{const t=await a(this.portalItem),i=await r(this.request,t);this.t9nData=i,this.selectedLanguageUpdated.emit({locale:this.selectedLanguage,data:i[this.selectedLanguage]})}catch(t){}}get el(){return e(this)}};c.style=":host{display:block;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);min-width:200px}:host calcite-dropdown{width:100%}:host calcite-button{--calcite-color-brand:var(--calcite-color-text-3);--calcite-color-brand-hover:var(--calcite-color-text-3)}";export{c as instant_apps_language_switcher}
|