@esri/solutions-components 0.7.39 → 0.7.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-combobox_5.cjs.entry.js +1 -1
  3. package/dist/cjs/calcite-flow_5.cjs.entry.js +1 -1
  4. package/dist/cjs/calcite-input-date-picker_3.cjs.entry.js +70 -31
  5. package/dist/cjs/card-manager_3.cjs.entry.js +29 -13
  6. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  7. package/dist/cjs/crowdsource-reporter.cjs.entry.js +3 -1
  8. package/dist/cjs/{downloadUtils-c22a71da.js → downloadUtils-b10e3b8c.js} +2 -2
  9. package/dist/cjs/{index.es-8d317f5e.js → index.es-b9d6eff6.js} +2 -2
  10. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +5 -4
  11. package/dist/cjs/instant-apps-export.cjs.entry.js +20 -21
  12. package/dist/cjs/instant-apps-header.cjs.entry.js +1 -1
  13. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +3 -3
  14. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +1 -1
  15. package/dist/cjs/instant-apps-splash.cjs.entry.js +2 -6
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
  18. package/dist/cjs/{mapViewUtils-cd29b129.js → mapViewUtils-290dbc9e.js} +4 -0
  19. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  20. package/dist/cjs/solutions-components.cjs.js +1 -1
  21. package/dist/collection/components/basemap-gallery/basemap-gallery.css +19 -19
  22. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +36 -0
  23. package/dist/collection/components/layer-table/layer-table.js +28 -11
  24. package/dist/collection/components/map-fullscreen/map-fullscreen.css +19 -19
  25. package/dist/collection/components/map-legend/map-legend.css +3 -3
  26. package/dist/collection/utils/interfaces.ts +1 -0
  27. package/dist/collection/utils/queryUtils.js +4 -0
  28. package/dist/collection/utils/queryUtils.ts +5 -0
  29. package/dist/components/crowdsource-reporter.js +4 -0
  30. package/dist/components/instant-apps-export.js +20 -21
  31. package/dist/components/instant-apps-filter-list2.js +70 -31
  32. package/dist/components/instant-apps-header2.js +1 -1
  33. package/dist/components/instant-apps-language-switcher.js +3 -3
  34. package/dist/components/instant-apps-language-translator-item2.js +5 -4
  35. package/dist/components/instant-apps-language-translator2.js +1 -1
  36. package/dist/components/instant-apps-splash.js +3 -7
  37. package/dist/components/layer-table2.js +28 -11
  38. package/dist/components/queryUtils.js +4 -0
  39. package/dist/esm/calcite-alert_4.entry.js +1 -1
  40. package/dist/esm/calcite-combobox_5.entry.js +1 -1
  41. package/dist/esm/calcite-flow_5.entry.js +1 -1
  42. package/dist/esm/calcite-input-date-picker_3.entry.js +70 -31
  43. package/dist/esm/card-manager_3.entry.js +29 -13
  44. package/dist/esm/crowdsource-manager.entry.js +1 -1
  45. package/dist/esm/crowdsource-reporter.entry.js +3 -1
  46. package/dist/esm/{downloadUtils-985dcd1c.js → downloadUtils-20d22198.js} +2 -2
  47. package/dist/esm/{index.es-03d8386e.js → index.es-8b85f68d.js} +2 -2
  48. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +5 -4
  49. package/dist/esm/instant-apps-export.entry.js +20 -21
  50. package/dist/esm/instant-apps-header.entry.js +1 -1
  51. package/dist/esm/instant-apps-language-switcher.entry.js +3 -3
  52. package/dist/esm/instant-apps-language-translator.entry.js +1 -1
  53. package/dist/esm/instant-apps-splash.entry.js +3 -7
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/esm/map-select-tools_3.entry.js +2 -2
  56. package/dist/esm/{mapViewUtils-257bc9b3.js → mapViewUtils-a177d4f9.js} +4 -0
  57. package/dist/esm/public-notification.entry.js +2 -2
  58. package/dist/esm/solutions-components.js +1 -1
  59. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-filter-list/instant-apps-filter-list.css +8 -1
  60. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-header/instant-apps-header.css +3 -0
  61. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-splash/instant-apps-splash.css +3 -0
  62. package/dist/solutions-components/{p-8571c89f.entry.js → p-044cd52c.entry.js} +1 -1
  63. package/dist/solutions-components/{p-df048b47.js → p-17e328bb.js} +1 -1
  64. package/dist/solutions-components/p-207fd378.entry.js +6 -0
  65. package/dist/solutions-components/{p-12492469.entry.js → p-2283ae14.entry.js} +1 -1
  66. package/dist/solutions-components/p-2f017ad2.entry.js +6 -0
  67. package/dist/solutions-components/{p-20b206f3.entry.js → p-32adb2cc.entry.js} +1 -1
  68. package/dist/solutions-components/p-3eedaead.js +36 -0
  69. package/dist/solutions-components/{p-2f840f08.entry.js → p-42233edc.entry.js} +1 -1
  70. package/dist/solutions-components/p-4742efa8.entry.js +6 -0
  71. package/dist/solutions-components/p-57087d57.entry.js +17 -0
  72. package/dist/solutions-components/{p-23e58d7c.entry.js → p-59c6f63f.entry.js} +1 -1
  73. package/dist/solutions-components/{p-34eaca46.entry.js → p-69a1df0f.entry.js} +1 -1
  74. package/dist/solutions-components/{p-6419f8d7.entry.js → p-6fe5e1d5.entry.js} +1 -1
  75. package/dist/solutions-components/p-7480ac64.entry.js +6 -0
  76. package/dist/solutions-components/p-aecf92f4.entry.js +6 -0
  77. package/dist/solutions-components/p-cacd0307.entry.js +6 -0
  78. package/dist/solutions-components/p-e2b0b3fa.entry.js +6 -0
  79. package/dist/solutions-components/{p-00ba5a2a.js → p-f6536eae.js} +2 -2
  80. package/dist/solutions-components/solutions-components.esm.js +1 -1
  81. package/dist/solutions-components/utils/interfaces.ts +1 -0
  82. package/dist/solutions-components/utils/queryUtils.ts +5 -0
  83. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +8 -0
  84. package/dist/types/components/layer-table/layer-table.d.ts +9 -1
  85. package/dist/types/components.d.ts +16 -0
  86. package/dist/types/utils/interfaces.d.ts +1 -0
  87. package/dist/types/utils/queryUtils.d.ts +1 -0
  88. package/package.json +2 -2
  89. package/dist/solutions-components/p-09b48b1b.entry.js +0 -6
  90. package/dist/solutions-components/p-32fed23c.entry.js +0 -17
  91. package/dist/solutions-components/p-6a61c742.entry.js +0 -6
  92. package/dist/solutions-components/p-9161dca9.entry.js +0 -6
  93. package/dist/solutions-components/p-93369c9f.entry.js +0 -6
  94. package/dist/solutions-components/p-96f5be25.js +0 -36
  95. package/dist/solutions-components/p-97425481.entry.js +0 -6
  96. package/dist/solutions-components/p-ae4c8b8c.entry.js +0 -6
  97. package/dist/solutions-components/p-eb0f4ede.entry.js +0 -6
@@ -0,0 +1,36 @@
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{a as t}from"./p-c1cf3ebc.js";
7
+ /** @license
8
+ * Copyright 2022 Esri
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */async function n(t){const n=t.createQuery();return n.where=t.definitionExpression||"1=1",await t.queryObjectIds(n)}async function a(t,n){let a=[];const s=t?t.map((t=>async function(t,n){const a=n.createQuery();return a.spatialRelationship="intersects",a.geometry=t,n.queryObjectIds(a)}
22
+ /** @license
23
+ * Copyright 2022 Esri
24
+ *
25
+ * Licensed under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License.
27
+ * You may obtain a copy of the License at
28
+ *
29
+ * http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software
32
+ * distributed under the License is distributed on an "AS IS" BASIS,
33
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ * See the License for the specific language governing permissions and
35
+ * limitations under the License.
36
+ */(t,n))):[Promise.resolve()];return(await Promise.all(s)).forEach((t=>{a=[...a,...t||[]]})),a}async function s(t,n,a,c,o,e){var i;const r=null===(i=n.capabilities)||void 0===i?void 0:i.query.maxRecordCount,u=n.createQuery();u.start=0,u.returnGeometry=c,u.objectIds=t.slice(0,r),r&&(u.num=r),o&&(u.outSpatialReference=o),e&&(u.outFields=e),0===t.length&&(t=await n.queryObjectIds());const f=await n.queryFeatures(u);a=a.concat(f.features);const w=t.slice(r,t.length);return w.length>0?s(w,n,a,c,o):Promise.resolve(a)}async function c(t,n){const a=n.globalIdField;if(!a)return[];const s=n.createQuery();return s.returnGeometry=!1,s.outFields=[n.objectIdField],s.where=t.map((t=>`${a} = '${t}'`)).join(" or "),(await n.queryFeatures(s)).features}async function o(t,n,a,s){const c=n.capabilities.query.maxRecordCount,e=n.createQuery();e.start=t,e.num=c,e.geometry=a;const i=await n.queryFeatures(e);return s[n.id]=s[n.id].concat(i.features),i.exceededTransferLimit?o(t+=c,n,a,s):Promise.resolve(s)}async function e(t,n,a){const s=t.createQuery();return s.where=n||"1=1",s.orderByFields=a,await t.queryObjectIds(s)}function i(t,n){return[...r(t,"polygon",n),...r(t,"polyline",n),...r(t,"point",n)]}function r(t,n,a){const s=(null==t?void 0:t.filter((t=>t.type===n)))||[];return s.length<=1?s:[a.union(s)]}async function u(t,n){let a;return await t.when((()=>{a=t.map.allLayers.toArray().reduce(((t,n)=>("feature"===n.type&&(t[n.id]={name:n.title,supportsUpdate:void 0}),t)),{})})),w(n,a,t)}async function f(t,n){let a;return await t.when((()=>{a=t.map.allTables.toArray().reduce(((t,n)=>(t[n.id]={name:n.title,supportsUpdate:void 0},t)),{})})),w(n,a,t)}async function w(t,n,a){if(t){const t={},s=Object.keys(n);for(let c=0;c<s.length;c++){const o=s[c],e=await l(a,o);await e.load(),await e.when(),t[o]={name:n[o].name,supportsUpdate:e.editingEnabled&&e.capabilities.operations.supportsUpdate}}return t}return n}async function y(t,n){const a=await l(t,n);return a?await t.whenLayerView(a):void 0}async function l(t,n){let a=[];return await t.when((()=>{a=[...t.map.allLayers.toArray(),...t.map.allTables.toArray()].filter((t=>t.id===n))})),a.length>0?a[0]:void 0}async function d(t){const n=t.map.allLayers.toArray();let a;return await t.when((()=>{a=n.map((n=>t.whenLayerView(n)))})),await Promise.allSettled(a),n}async function p(t,n,a,s=!1){return s&&(await j(t,n,a,!1),await new Promise((t=>setTimeout(t,1e3)))),n.highlight(t)}async function m(t){const n=b(t);return Object.keys(n).reduce(((t,a)=>{const s=n[a];return t.push(s.layerView.highlight(s.ids)),t}),[])}function b(n){return n.reduce(((n,a)=>{const s=a.layerView,c=null==s?void 0:s.layer.id;return c&&Object.keys(n).indexOf(c)>-1?n[c].ids=[...new Set([...a.selectedIds,...n[c].ids])]:c&&(n[c]={layerView:s,ids:a.selectedIds}),a.workflowType===t.REFINE&&Object.keys(a.refineInfos).forEach((t=>{const s=a.refineInfos[t];Object.keys(n).indexOf(t)>-1&&(n[t].ids=[...new Set([...s.addIds,...n[t].ids])],n[t].ids=n[t].ids.filter((t=>s.removeIds.indexOf(t)<0)))})),n}),{})}async function j(t,n,a,s=!0,c){const o=await async function(t,n){const a=n.createQuery();return a.objectIds=t,n.queryExtent(a)}(t,n.layer);await a.goTo(o.extent),s&&await async function(t,n,a){const s={objectIds:t};n.featureEffect=Object.assign(Object.assign({},a),{filter:s}),setTimeout((()=>{n.featureEffect=void 0}),1300)}(t,n,c)}export{d as a,y as b,j as c,u as d,n as e,e as f,l as g,p as h,c as i,a as j,i as k,o as l,b as m,m as n,f as o,s as q}
@@ -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,h as i,H as e,g as s}from"./p-7d280d8a.js";import{g as h}from"./p-b04c9dc3.js";import{E as l}from"./p-c1cf3ebc.js";import{g as o}from"./p-96f5be25.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.defaultCenter="",this.defaultFilter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._hideFooter=!1,this._hideTable=!1,this._isMobile=void 0,this._translations=void 0,this._layer=void 0,this._layoutMode=l.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._tableOnly=!1}defaultCenterWatchHandler(){this._defaultCenter=this.defaultCenter?this.defaultCenter.split(";").map((t=>parseFloat(t))):void 0}defaultFilterWatchHandler(){this._defaultFilter=JSON.parse(this.defaultFilter)}defaultGlobalIdWatchHandler(){this._defaultGlobalId=this.defaultGlobalId?this.defaultGlobalId.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0}defaultOidWatchHandler(){this._defaultOid=this.defaultOid?this.defaultOid.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0}defaultLevelWatchHandler(){this._defaultLevel=this.defaultLevel?parseInt(this.defaultLevel,10):void 0}enableZoomWatchHandler(){this._initMapZoom()}async featureSelectionChange(t){var i;this._numSelected=null===(i=t.detail)||void 0===i?void 0:i.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async idsFound(t){const i=t.detail;this._tableOnly=i.tableIds.length>0&&0===i.layerIds.length,this._tableOnly&&(this._expandPopup=!0)}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async layerSelectionChange(t){const i=t.detail[0],e=await o(this._mapView,i);await e.when((()=>{this._layer=e}))}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return i(e,null,i("calcite-shell",{class:"position-relative"},i("calcite-panel",{class:"width-full height-full "+(this._isMobile&&this._hideTable?"border-width-0":this._isMobile?"border-bottom-width-0":"")},this._getBody(this._layoutMode,this._panelOpen,this._hideTable)),this._getFooter()))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el)}_getFooter(){var t,e,s,h;const l=(null===(t=this._layer)||void 0===t?void 0:t.editingEnabled)&&(null===(h=null===(s=null===(e=this._layer)||void 0===e?void 0:e.capabilities)||void 0===s?void 0:s.operations)||void 0===h?void 0:h.supportsDelete);return this._isMobile&&this._numSelected>0&&!this._hideFooter?i("div",{class:"width-100",slot:"footer"},i("div",{class:"display-flex padding-1-2"},i("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),l?i("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer}):void 0)):void 0}_getDividerIcon(t,i){let e="";switch(t){case l.HORIZONTAL:e=i?"chevrons-up":"chevrons-down";break;case l.VERTICAL:case l.GRID:e=i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i,e){let s="";switch(t){case l.HORIZONTAL:s=(i&&!e?"height-1-2 display-grid":i&&e?"height-full":"height-0")+" width-full position-relative";break;case l.GRID:s="height-full position-relative "+(i?"width-1-3":"width-0");break;case l.VERTICAL:s="height-full position-relative "+(i?"width-1-2":"width-0")}return s}_getTableSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=(i?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,e,s){return i("calcite-panel",{class:"width-full height-full"},i("div",{class:"width-full height-full overflow-hidden "+(t===l.HORIZONTAL?"":"display-flex")},this._getMapAndCard(t,e,s),this._getTable(t,e,s)))}_getMapAndCard(t,e,s){const h=this._getMapSizeClass(t,e,s);return i("div",{class:`${h} overflow-hidden`},this._getMapNode(e),this._getPopupExpandNode())}_getMapNode(t){var e;return i("div",{class:(this._layoutMode!==l.HORIZONTAL||this._isMobile&&!t?"adjusted-height-50":"")+" overflow-hidden"},i("map-card",{basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:!0,hidden:this._expandPopup&&!this._isMobile,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",mapInfos:null===(e=this.mapInfos)||void 0===e?void 0:e.filter((t=>!1!==t.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"]}))}_getPopupExpandNode(){var t;const e=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",h=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,l="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",o=this._expandPopup?1===(null===(t=this.mapInfos)||void 0===t?void 0:t.length)||this._isMobile?"position-absolute-0":"position-absolute-50":"height-full",a=this._isMobile?"display-none height-0":"";return i("div",{class:`${this._isMobile?"calcite-mode-light":"calcite-mode-dark"} ${o} ${this._isMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isMobile?"display-none height-0":""}`},i("calcite-panel",null,this._isMobile?void 0:i("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},i("calcite-icon",{icon:"information",scale:"s"}),i("div",{class:"padding-inline-start-75"},this._translations.information)),i("calcite-action",{class:a,disabled:this._tableOnly,icon:e,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:i("calcite-tooltip",{class:l,label:"",placement:"bottom","reference-element":s},i("span",null,h)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return i("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},i("card-manager",{class:(this._expandPopup||this._isMobile?"height-full":"height-50")+" width-full",isMobile:this._isMobile,mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e,s){const h=s&&this._isMobile?"visibility-hidden":"",o=this._getTableSizeClass(t,e),a=this._getDividerIcon(t,e),d=e?this._translations.close:this._translations.open,n="toggle-layout",r=this.defaultWebmap&&this.defaultLayer;return i("calcite-shell",{class:`${o} ${h} border-bottom`},this._isMobile?void 0:i("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:t===l.HORIZONTAL?"horizontal":"vertical",slot:t===l.HORIZONTAL?"header":"panel-start"},i("calcite-action",{class:"toggle-node",icon:a,id:n,onClick:()=>this._toggleLayout(),text:""}),i("calcite-tooltip",{label:d,placement:"bottom","reference-element":n},i("span",null,d))),i("div",{class:"width-full height-full position-relative"},i("layer-table",{defaultFilter:r?this._defaultFilter:void 0,defaultGlobalId:r?this._defaultGlobalId:void 0,defaultLayerId:r?this.defaultLayer:"",defaultOid:r&&!this.defaultGlobalId?this._defaultOid:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isMobile,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:t=>this._layerTable=t,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_onResize(){const t=this.el.offsetWidth<1024,i=!this._isMobile&&t;this._isMobile=t,this._layoutMode=this._isMobile?l.HORIZONTAL:l.GRID,i&&(this._panelOpen=!0)}_toggleLayout(){this._panelOpen=!this._panelOpen}showHideMapPopupAndTable(t){this._expandPopup=!1,this._hideTable=t,this._hideFooter=t}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),Object.assign({},i)}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this._mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{defaultCenter:["defaultCenterWatchHandler"],defaultFilter:["defaultFilterWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultLevel:["defaultLevelWatchHandler"],enableZoom:["enableZoomWatchHandler"]}}};a.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}";export{a as crowdsource_manager}
6
+ import{r as t,h as i,H as e,g as s}from"./p-7d280d8a.js";import{g as h}from"./p-b04c9dc3.js";import{E as l}from"./p-c1cf3ebc.js";import{g as o}from"./p-3eedaead.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.defaultCenter="",this.defaultFilter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._hideFooter=!1,this._hideTable=!1,this._isMobile=void 0,this._translations=void 0,this._layer=void 0,this._layoutMode=l.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._tableOnly=!1}defaultCenterWatchHandler(){this._defaultCenter=this.defaultCenter?this.defaultCenter.split(";").map((t=>parseFloat(t))):void 0}defaultFilterWatchHandler(){this._defaultFilter=JSON.parse(this.defaultFilter)}defaultGlobalIdWatchHandler(){this._defaultGlobalId=this.defaultGlobalId?this.defaultGlobalId.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0}defaultOidWatchHandler(){this._defaultOid=this.defaultOid?this.defaultOid.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0}defaultLevelWatchHandler(){this._defaultLevel=this.defaultLevel?parseInt(this.defaultLevel,10):void 0}enableZoomWatchHandler(){this._initMapZoom()}async featureSelectionChange(t){var i;this._numSelected=null===(i=t.detail)||void 0===i?void 0:i.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async idsFound(t){const i=t.detail;this._tableOnly=i.tableIds.length>0&&0===i.layerIds.length,this._tableOnly&&(this._expandPopup=!0)}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async layerSelectionChange(t){const i=t.detail[0],e=await o(this._mapView,i);await e.when((()=>{this._layer=e}))}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return i(e,null,i("calcite-shell",{class:"position-relative"},i("calcite-panel",{class:"width-full height-full "+(this._isMobile&&this._hideTable?"border-width-0":this._isMobile?"border-bottom-width-0":"")},this._getBody(this._layoutMode,this._panelOpen,this._hideTable)),this._getFooter()))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el)}_getFooter(){var t,e,s,h;const l=(null===(t=this._layer)||void 0===t?void 0:t.editingEnabled)&&(null===(h=null===(s=null===(e=this._layer)||void 0===e?void 0:e.capabilities)||void 0===s?void 0:s.operations)||void 0===h?void 0:h.supportsDelete);return this._isMobile&&this._numSelected>0&&!this._hideFooter?i("div",{class:"width-100",slot:"footer"},i("div",{class:"display-flex padding-1-2"},i("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),l?i("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer}):void 0)):void 0}_getDividerIcon(t,i){let e="";switch(t){case l.HORIZONTAL:e=i?"chevrons-up":"chevrons-down";break;case l.VERTICAL:case l.GRID:e=i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i,e){let s="";switch(t){case l.HORIZONTAL:s=(i&&!e?"height-1-2 display-grid":i&&e?"height-full":"height-0")+" width-full position-relative";break;case l.GRID:s="height-full position-relative "+(i?"width-1-3":"width-0");break;case l.VERTICAL:s="height-full position-relative "+(i?"width-1-2":"width-0")}return s}_getTableSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=(i?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,e,s){return i("calcite-panel",{class:"width-full height-full"},i("div",{class:"width-full height-full overflow-hidden "+(t===l.HORIZONTAL?"":"display-flex")},this._getMapAndCard(t,e,s),this._getTable(t,e,s)))}_getMapAndCard(t,e,s){const h=this._getMapSizeClass(t,e,s);return i("div",{class:`${h} overflow-hidden`},this._getMapNode(e),this._getPopupExpandNode())}_getMapNode(t){var e;return i("div",{class:(this._layoutMode!==l.HORIZONTAL||this._isMobile&&!t?"adjusted-height-50":"")+" overflow-hidden"},i("map-card",{basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:!0,hidden:this._expandPopup&&!this._isMobile,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",mapInfos:null===(e=this.mapInfos)||void 0===e?void 0:e.filter((t=>!1!==t.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"]}))}_getPopupExpandNode(){var t;const e=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",h=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,l="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",o=this._expandPopup?1===(null===(t=this.mapInfos)||void 0===t?void 0:t.length)||this._isMobile?"position-absolute-0":"position-absolute-50":"height-full",a=this._isMobile?"display-none height-0":"";return i("div",{class:`${this._isMobile?"calcite-mode-light":"calcite-mode-dark"} ${o} ${this._isMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isMobile?"display-none height-0":""}`},i("calcite-panel",null,this._isMobile?void 0:i("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},i("calcite-icon",{icon:"information",scale:"s"}),i("div",{class:"padding-inline-start-75"},this._translations.information)),i("calcite-action",{class:a,disabled:this._tableOnly,icon:e,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:i("calcite-tooltip",{class:l,label:"",placement:"bottom","reference-element":s},i("span",null,h)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return i("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},i("card-manager",{class:(this._expandPopup||this._isMobile?"height-full":"height-50")+" width-full",isMobile:this._isMobile,mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e,s){const h=s&&this._isMobile?"visibility-hidden":"",o=this._getTableSizeClass(t,e),a=this._getDividerIcon(t,e),d=e?this._translations.close:this._translations.open,n="toggle-layout",r=this.defaultWebmap&&this.defaultLayer;return i("calcite-shell",{class:`${o} ${h} border-bottom`},this._isMobile?void 0:i("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:t===l.HORIZONTAL?"horizontal":"vertical",slot:t===l.HORIZONTAL?"header":"panel-start"},i("calcite-action",{class:"toggle-node",icon:a,id:n,onClick:()=>this._toggleLayout(),text:""}),i("calcite-tooltip",{label:d,placement:"bottom","reference-element":n},i("span",null,d))),i("div",{class:"width-full height-full position-relative"},i("layer-table",{defaultFilter:r?this._defaultFilter:void 0,defaultGlobalId:r?this._defaultGlobalId:void 0,defaultLayerId:r?this.defaultLayer:"",defaultOid:r&&!this.defaultGlobalId?this._defaultOid:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isMobile,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:t=>this._layerTable=t,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_onResize(){const t=this.el.offsetWidth<1024,i=!this._isMobile&&t;this._isMobile=t,this._layoutMode=this._isMobile?l.HORIZONTAL:l.GRID,i&&(this._panelOpen=!0)}_toggleLayout(){this._panelOpen=!this._panelOpen}showHideMapPopupAndTable(t){this._expandPopup=!1,this._hideTable=t,this._hideFooter=t}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),Object.assign({},i)}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this._mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{defaultCenter:["defaultCenterWatchHandler"],defaultFilter:["defaultFilterWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultLevel:["defaultLevelWatchHandler"],enableZoom:["enableZoomWatchHandler"]}}};a.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}";export{a as crowdsource_manager}
@@ -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 a,h as n,H as s,g as e,F as i}from"./p-7d280d8a.js";import{d as r,i as o,e as l,s as c,f as p,E as u,l as g,h as d,c as h}from"./p-701ed205.js";import"./p-86b21da1.js";import"./p-a8a0187d.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-14a48b14.js";import"./p-18f1e8b5.js";const m="instant-apps-components__ckeditor-wrapper",v=class{constructor(n){t(this,n),this.isFocused=a(this,"isFocused",7),this.dataChanged=a(this,"dataChanged",7),this.value=void 0,this.editorInstance=void 0,this.config=void 0}updateValue(){this.value&&this.editorInstance.setData(this.value)}async componentDidLoad(){this.init()}componentDidUpdate(){this.editorInstance.setData(this.value)}render(){return n(s,null,n("div",null))}init(){this.applyStyles(),this.initEditor()}applyStyles(){if(document.getElementById(m))return;const t=document.createElement("style");t.id=m,t.innerHTML="\n .ck.ck-reset.ck-editor.ck-rounded-corners {\n margin-top: 10px !important;\n margin-left: 55px !important;\n }\n .ck-editor__editable {\n height: 70px !important;\n font-size: 0.875rem !important;\n line-height: \t1.375 !important;\n color: var(--calcite-color-text-1) !important;\n }\n\n .ck.ck-editor__editable_inline>:first-child,\n .ck.ck-editor__editable_inline>:last-child {\n --ck-spacing-large: 0.5rem !important;\n }\n\n .ck.ck-balloon-panel.ck-powered-by-balloon {\n --ck-z-modal: 700;\n z-index: 700;\n }\n\n .calcite-mode-dark .ck-editor__editable {\n color: var(--calcite-color-text-inverse) !important;\n }\n",document.head.prepend(t)}async initEditor(){const t=await this.createEditor();t&&(this.editorInstance=t,(this.value||""===this.value)&&t.setData(this.value),t.editing.view.document.on("change:isFocused",this.getEditorFocusedCallback(t)))}async createEditor(){try{let t;return t=this.config?await ClassicEditor.create(this.el,this.config):await ClassicEditor.create(this.el),this.editorInstance=t,Promise.resolve(t)}catch(t){return console.error(t),Promise.reject(null)}}getEditorFocusedCallback(t){return(a,n,s)=>{if(s)this.isFocused.emit();else{const a=t.getData();this.value!==a&&(this.value=a,this.dataChanged.emit(a))}}}get el(){return e(this)}static get watchers(){return{value:["updateValue"]}}};v.style=":host{display:block}";const _="instant-apps-language-translator-item",b={section:`${_}__section`,selected:`${_}__section--selected`,collapsed:`${_}__section--collapsed`,topRow:`${_}__top-row`,labelContainer:`${_}__label-container`,label:`${_}__label`,uiLocationPopoverContent:`${_}__ui-location-popover-content`,uiLocationItems:`${_}__ui-location-items`,uiLocationItem:`${_}__ui-location-item`,infoIcon:`${_}__info-icon`,infoButton:`${_}__info-button`,tip:`${_}__tip`,nestedInput:`${_}__nested-input`},f=class{constructor(n){t(this,n),this.translatorItemDataUpdated=a(this,"translatorItemDataUpdated",7),this.userInputs={},this.translatedInputs={},this.fieldName=void 0,this.translatedLanguageLabels=void 0,this.setting=void 0,this.userLocaleInputOnChangeCallback=void 0,this.translatedLocaleInputOnChangeCallback=void 0}get isTextEditor(){return this.setting.type===r.TextEditor}get calciteMode(){return o()?l.Dark:l.Light}get hasNestedContent(){var t;return!!(null===(t=this.setting)||void 0===t?void 0:t.content)}get tipID(){return`${this.fieldName}goTo`}componentDidLoad(){this.isTextEditor&&c.onChange("uiData",(()=>this.handleEditorCollapse()))}render(){var t;return"content"in this.setting&&(null===(t=this.setting.content)||void 0===t?void 0:t.every((t=>{var a;return 0===(null===(a=null==t?void 0:t.content)||void 0===a?void 0:a.length)})))?n(i,null):n(s,{class:this.calciteMode},this.renderBase(),this.renderPopover())}renderBase(){return n("div",{class:_},this.renderUserLocaleSection(),this.renderTranslatedLanguageSection())}renderPopover(){const t=this.getTip();return n("calcite-popover",{referenceElement:this.tipID,label:"","auto-close":"true",placement:"trailing",closable:!0},n("span",{class:b.uiLocationPopoverContent},n("span",{class:b.uiLocationItems},this.getUILocation()),t?n("span",{class:b.tip},t):null))}renderUserLocaleSection(){const t=this.getUIDataItem(),a=null==t?void 0:t.userLocaleData,s=null==a?void 0:a.value,e=this.setting.id;return n("div",{class:`${b.section}${(null==t?void 0:t.selected)?` ${b.selected}`:""}`},this.renderItemHeader(p.User,null==a?void 0:a.label,e),this.handleInputRender(p.User,s,e))}renderTranslatedLanguageSection(){var t,a;const s=this.getUIDataItem(),e=this.setting.id,i=c.get("currentLanguage"),r=c.get("portalItemResourceT9n"),o=null===(t=this.translatedLanguageLabels)||void 0===t?void 0:t[this.fieldName],l=null===(a=null==r?void 0:r[i])||void 0===a?void 0:a[e];return n("div",{class:`${b.section}${(null==s?void 0:s.selected)?` ${b.selected}`:""}`},this.renderItemHeader(p.Translation,o,e),this.handleInputRender(p.Translation,l,e))}handleInputRender(t,a,n){const s=this.getUIDataItem();return(null==s?void 0:s.expanded)?this.hasNestedContent?this.renderNestedInputs(t):this.renderInput(t,a,n):null}renderNestedInputs(t,a){const n=null!=a?a:this.setting,{content:s}=n;return null==s?void 0:s.map((a=>a.hasOwnProperty("content")?this.renderNestedInputs(t,a):this.renderNestedInput(t,a)))}renderNestedInput(t,a){var s;const e=c.get("currentLanguage"),i=c.get("portalItemResourceT9n"),r=null==a?void 0:a.id,o=null==i?void 0:i[e],l=null==o?void 0:o[r],{label:u,value:g,id:d}=a,h=t===p.Translation?null===(s=this.translatedLanguageLabels)||void 0===s?void 0:s[d]:u,m=t===p.User?g:l;return n("div",{class:b.nestedInput},this.renderItemHeader(t,h,r,a),this.renderInput(t,m,r,a))}renderItemHeader(t,a,s,e){const i=!this.hasNestedContent||!!e;return n("div",{class:b.topRow},this.renderItemHeaderLabel(t,a,e),i?this.renderCopyButton(t,s):null)}renderItemHeaderLabel(t,a,s){const e=t===p.User&&!s;return n("div",{class:b.labelContainer},s?null:this.renderExpandCollapseButton(),n("calcite-icon",{icon:this.getIcon(s),scale:"s"}),n("span",{class:b.label},a),e?this.renderInfoButton():null)}renderExpandCollapseButton(){const t=this.getUIDataItem(),a=(null==t?void 0:t.expanded)?u.Expanded:u.Collapsed;return n("calcite-action",{onClick:this.handleExpand.bind(this,t),icon:a,scale:"s",appearance:"transparent",text:""})}renderInfoButton(){return n("button",{id:this.tipID,class:b.infoButton},n("calcite-icon",{class:b.infoIcon,icon:u.Popover,scale:"s"}))}renderCopyButton(t,a){return n("calcite-action",{class:this.calciteMode,onClick:this.copySelection.bind(this,t,a),slot:"action",icon:u.Copy,appearance:"transparent",text:""})}renderInput(t,a,n,s){const e=null!=s?s:this.setting;return"string"===e.type||"textarea"===e.type?t===p.User?this.renderUserLocaleInput(a,n):this.renderTranslatedLanguageInput(a,n):this.renderTextEditor(a,t,n)}renderUserLocaleInput(t,a){return n("calcite-input",{ref:t=>this.userInputs[a]=t,key:a,id:a,class:l.Light,"data-field-name":this.fieldName,value:t,onFocus:this.handleSelection,onCalciteInputChange:this.handleUserInputChange.bind(this)})}renderTranslatedLanguageInput(t,a){return n("calcite-input",{ref:t=>this.translatedInputs[a]=t,key:a,id:a,class:l.Light,"data-field-name":this.fieldName,value:t,onFocus:this.handleSelection,onCalciteInputChange:this.handleTranslatedInputChange.bind(this)})}renderTextEditor(t,a,s){return n("instant-apps-ckeditor-wrapper",{id:s,ref:this.setEditor.bind(this,a),onDataChanged:this.handleTextEditorDataChange.bind(this,a),onIsFocused:this.handleSelection,value:null!=t?t:"","data-field-name":this.fieldName,config:{toolbar:[]}})}getUIDataItem(){if(g.uiData)return g.uiData.get(this.fieldName)}updateT9nStore(t,a){const n=c.get("currentLanguage"),s=d(n,{[t]:a});c.set("portalItemResourceT9n",s)}handleExpand(){const t=this.getUIDataItem();t.expanded=!t.expanded;const a=new Map(g.uiData);a.set(this.fieldName,t),c.set("uiData",a)}handleEditorCollapse(){var t,a;const n=c.get("uiData"),s=null==n?void 0:n.get(this.fieldName);if(!(null==s?void 0:s.expanded)&&(null===(t=this.userEditorWrapper)||void 0===t?void 0:t.editorInstance)&&(null===(a=this.translatedEditorWrapper)||void 0===a?void 0:a.editorInstance)){const{userEditorWrapper:t,translatedEditorWrapper:a}=this,n=t.editorInstance.getData();t.value=n;const s=a.editorInstance.getData();a.value=s,t.editorInstance.destroy(),a.editorInstance.destroy()}}handleSelection(t){const a=new Map(g.uiData),n=h();n.forEach((t=>{(null==a?void 0:a.get(t)).selected=!1})),n.forEach((n=>{const s=null==t?void 0:t.target;n===(null==s?void 0:s.getAttribute("data-field-name"))&&((null==a?void 0:a.get(n)).selected=!0)})),c.set("uiData",a)}getUILocation(){const t=this.getUIDataItem(),{uiLocation:a,userLocaleData:s}=t,{section:e,subsection:i}=a,r=[e.label,i.label,s.label].filter((t=>!!t));return r.map(((t,a)=>n("span",{class:b.uiLocationItem},n("span",null,t),a!==r.length-1?n("calcite-icon",{icon:"chevron-right",scale:"s"}):null)))}getTip(){const t=this.getUIDataItem(),{tip:a}=t;return a}copySelection(t,a){this.setting.type===r.TextEditor?this.copyTextEditorContent(t):this.copyCalciteInputContent(a,t)}copyTextEditorContent(t){var a,n;const s=t===p.User?null===(a=this.userEditorWrapper)||void 0===a?void 0:a.editorInstance:null===(n=this.translatedEditorWrapper)||void 0===n?void 0:n.editorInstance;setTimeout((()=>{this.selectContent(s),setTimeout((()=>this.selectContent(s)),50)}),50),this.copyContent(s)}selectContent(t){t.editing.view.focus();const{model:a}=t,n=a.createRangeIn(a.document.getRoot());a.change((t=>t.setSelection(n)))}copyContent(t){const a=t.getData(),n=document.createElement("div");n.contentEditable="true",n.innerHTML=a,document.body.appendChild(n);const s=document.createRange();s.selectNodeContents(n);const e=window.getSelection();null==e||e.removeAllRanges(),null==e||e.addRange(s),document.execCommand("copy"),document.body.removeChild(n)}copyCalciteInputContent(t,a){const n=a===p.User?this.userInputs[t]:this.translatedInputs[t];n&&(n.selectText(),navigator.clipboard.writeText(n.value))}setEditor(t,a){t===p.User?this.userEditorWrapper=a:this.translatedEditorWrapper=a}async handleUserInputChange(t){c.set("saving",!0);try{const a=t.target,n=a.id,s=a.value;this.getUIDataItem().userLocaleData.value=s,await this.userLocaleInputOnChangeCallback(n,s),c.set("saving",!1)}catch(t){c.set("saving",!1)}}async handleUserTextEditorChange(t){c.set("saving",!0);try{const a=t.detail;this.getUIDataItem().userLocaleData.value=a,await this.userLocaleInputOnChangeCallback(this.fieldName,a),c.set("saving",!1)}catch(t){c.set("saving",!1)}}async handleTranslatedInputChange(t){c.set("saving",!0);try{const a=t.composedPath()[0],n=a.id;this.updateT9nStore(n,a.value);const{locale:s,resource:e}=this.getTranslatedLocaleCallbackData(),i=t.target.value;await this.translatedLocaleInputOnChangeCallback(n,i,s,e),setTimeout((()=>c.set("saving",!1)),1500),this.translatorItemDataUpdated.emit()}catch(t){console.error("Error writing to portal item resource: ",t),c.set("saving",!1)}}async handleTranslatedTextEditorChange(t){c.set("saving",!0);try{const a=t.target.id;this.updateT9nStore(a,t.detail);const{locale:n,resource:s}=this.getTranslatedLocaleCallbackData(),e=t.detail;await this.translatedLocaleInputOnChangeCallback(a,e,n,s),setTimeout((()=>c.set("saving",!1)),1500),this.translatorItemDataUpdated.emit()}catch(t){console.error("Error writing to portal item resource: ",t),c.set("saving",!1)}}handleTextEditorDataChange(t,a){t===p.User?this.handleUserTextEditorChange(a):this.handleTranslatedTextEditorChange(a)}getTranslatedLocaleCallbackData(){return{locale:c.get("currentLanguage"),resource:c.get("portalItemResource")}}getIcon(t){switch((null!=t?t:this.setting).stringType){case"title":return u.Title;case"subtitle":return u.Subtitle;case"text":return u.Text;case"button":return u.Button;case"string":return u.String;default:return u.SettingIndicator}}};f.style=".sc-instant-apps-language-translator-item-h{display:block}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item.sc-instant-apps-language-translator-item{display:flex}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item{padding:10px;border-bottom:1px solid var(--calcite-color-border-1);background-color:var(--calcite-color-foreground-2);width:49%}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__top-row.sc-instant-apps-language-translator-item{display:flex;align-items:center;justify-content:space-between}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__label-container.sc-instant-apps-language-translator-item{display:flex;align-items:center}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__label.sc-instant-apps-language-translator-item{display:inline-block;margin-left:10px;font-size:14px;font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item calcite-input.sc-instant-apps-language-translator-item{margin-top:10px;margin-left:55px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--last-item.sc-instant-apps-language-translator-item{border-bottom:none}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item{background-color:#f1faff}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item:first-child{margin-right:1%}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-popover-content.sc-instant-apps-language-translator-item{display:inline-block;padding:10px;max-width:400px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-items.sc-instant-apps-language-translator-item{display:flex}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-item.sc-instant-apps-language-translator-item{display:flex;align-items:center;font-weight:var(--calcite-font-weight-medium);font-size:14px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__tip.sc-instant-apps-language-translator-item{display:inline-block;font-size:14px;line-height:22px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__info-icon.sc-instant-apps-language-translator-item{color:var(--calcite-color-brand)}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__info-button.sc-instant-apps-language-translator-item{border:0;background-color:transparent;cursor:pointer}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__nested-input.sc-instant-apps-language-translator-item{margin-left:60px;margin-top:8px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__nested-input.sc-instant-apps-language-translator-item calcite-input.sc-instant-apps-language-translator-item{margin-left:30px}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item{background-color:#f1faff;background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item calcite-action.sc-instant-apps-language-translator-item{--calcite-ui-icon-color:var(--calcite-color-text-inverse)}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item calcite-icon.sc-instant-apps-language-translator-item{color:var(--calcite-color-text-inverse)}.instant-apps-language-translator--last-item.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item{border-bottom:none}";const x="instant-apps-language-translator-search",k={base:x,input:`${x}__input`,suggestionList:`${x}__suggestion-list`,suggestionListItem:`${x}__suggestion-list-item`},y=class{constructor(n){t(this,n),this.suggestionSelected=a(this,"suggestionSelected",7),this.t9nPlaceholder=void 0,this.results=[]}render(){return n(s,null,this.renderSearchInput(),this.renderSuggestions())}renderSearchInput(){return n("calcite-input",{ref:t=>this.searchInput=t,class:k.input,onCalciteInputInput:this.handleSearch.bind(this),type:"search",placeholder:this.t9nPlaceholder,icon:"search"})}renderSuggestions(){return this.results.length>0?this.renderSuggestionList():null}renderSuggestionList(){return n("ul",{class:k.suggestionList},this.results.map((t=>this.renderSuggestionListItem(t))))}renderSuggestionListItem(t){return n("li",{onClick:this.selectSuggestion.bind(this),class:k.suggestionListItem,"data-field-name":t.fieldName},t.userLocaleData.label)}handleSearch(t){var a,n;const s=null===(n=null===(a=t.target.value)||void 0===a?void 0:a.toLowerCase())||void 0===n?void 0:n.trim(),e=c.get("uiData"),i=h(),r=c.get("portalItemResourceT9n"),o=c.get("currentLanguage"),l=r[o],p=this.getSettingDataItems(i).filter(this.matchedResultsCallback(e,l,s,o));this.results=[...p.map((t=>Object.assign({fieldName:t},e.get(t))))]}matchedResultsCallback(t,a,n,s){return e=>{var i;const r=t.get(e),{label:o}=r.userLocaleData,{value:l}=r.userLocaleData,c=t.get("translatedLanguageLabels"),p=null===(i=null==c?void 0:c[s])||void 0===i?void 0:i[e],u=null==a?void 0:a[e],g=this.testUserInput(o,n),d=this.testUserInput(l,n),h=this.testUserInput(p,n),m=this.testUserInput(u,n);return g||d||h||m}}getSettingDataItems(t){return t.filter((t=>"locales"!==t&&"translatedLanguageLabels"!==t))}testUserInput(t,a){var n;return!!(null==t?void 0:t.trim())&&!!(null==a?void 0:a.trim())&&-1!==(null===(n=null==t?void 0:t.toLowerCase())||void 0===n?void 0:n.search(a))}selectSuggestion(t){const a=t.target.getAttribute("data-field-name");this.suggestionSelected.emit(a),this.resetSearchInput()}resetSearchInput(){this.searchInput.value="",this.results=[]}};y.style=".sc-instant-apps-language-translator-search-h{display:block;position:relative}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__input.sc-instant-apps-language-translator-search{width:235.5px}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list.sc-instant-apps-language-translator-search{position:absolute;margin:0;padding:0;width:100%;max-height:30vh;overflow:auto;border-left:none;background-color:var(--calcite-color-foreground-1);border:1px solid #c0c0c0;z-index:702}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search:first-child{border:none}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search{margin-top:0;padding:0.8em 1em;border-top:solid 1px rgba(110, 110, 110, 0.3);display:flex;flex-direction:column;cursor:pointer;word-break:break-word}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search:hover{background-color:var(--calcite-color-foreground-2)}";export{v as instant_apps_ckeditor_wrapper,f as instant_apps_language_translator_item,y as instant_apps_language_translator_search}
@@ -0,0 +1,17 @@
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 s,H as e,g as n}from"./p-7d280d8a.js";import{d as a,a as o,b as l,i as r,c,e as h,f as d}from"./p-94de9279.js";import{t as p}from"./p-3dd92f0d.js";import{f as u,c as v,d as m,r as f,a as g,F as b}from"./p-db53bde3.js";import{s as _,c as x,d as w,H as y}from"./p-1f33a29d.js";import{c as $,d as k,u as C,I as z}from"./p-6d520a58.js";import{n as D}from"./p-e7afc0a8.js";import{c as E,d as I}from"./p-9d53e0f2.js";import{c as P,s as R,a as F}from"./p-a4149333.js";import{n as S,c as j,d as L,b as N}from"./p-13f2d901.js";import{o as O}from"./p-2b0454a0.js";import{g as T,a as A}from"./p-bfdf89c2.js";import{c as M,s as U,d as B}from"./p-05cb50f9.js";import{c as W,d as H,a as V}from"./p-d7b02d3a.js";import{g as J}from"./p-5a9a971a.js";import{g as K}from"./p-495e7b9d.js";import{V as q}from"./p-c94d2cec.js";import{l as Y}from"./p-a8a0187d.js";import{g as Z}from"./p-86b21da1.js";import{g as G}from"./p-c96eb2db.js";import"./p-7c2be8cc.js";import"./p-a82f35c9.js";import"./p-ba7d55ea.js";import"./p-1f65ab1e.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-14a48b14.js";
7
+ /*!
8
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
+ * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
10
+ * v2.4.0
11
+ */const X="input-wrapper",Q="input",tt="toggle-icon",it=class{constructor(s){t(this,s),this.calciteInputDatePickerChange=i(this,"calciteInputDatePickerChange",6),this.calciteInputDatePickerBeforeClose=i(this,"calciteInputDatePickerBeforeClose",6),this.calciteInputDatePickerClose=i(this,"calciteInputDatePickerClose",6),this.calciteInputDatePickerBeforeOpen=i(this,"calciteInputDatePickerBeforeOpen",6),this.calciteInputDatePickerOpen=i(this,"calciteInputDatePickerOpen",6),this.calciteInternalInputInputHandler=t=>{const i=t.target,s=i.value,e=this.parseNumerals(s),n=this.formatNumerals(e);i.value=n;const{year:a}=o(s,this.localeData);if(a&&a.length<4)return;const c=l(s,this.localeData);r(c,this.min,this.max)&&(this.datePickerActiveDate=c)},this.calciteInternalInputBlurHandler=()=>{this.commitValue()},this.dialogId=`date-picker-dialog--${J()}`,this.focusOnOpen=!1,this.userChangedValue=!1,this.openTransitionProp="opacity",this.valueAsDateChangedExternally=!1,this.placeholderTextId=`calcite-input-date-picker-placeholder-${J()}`,this.onInputWrapperPointerDown=()=>{this.currentOpenInput=this.focusedInput},this.onInputWrapperClick=t=>{const{range:i,endInput:s,startInput:e,currentOpenInput:n}=this,a=t.currentTarget.getAttribute("data-position");t.composedPath().find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains(tt)}))&&("start"===a?e:s).setFocus(),i&&this.open&&n!==a||(this.open=!this.open)},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:i}=this;this.filteredFlipPlacements=i?u(i,t):null},this.setTransitionEl=t=>{this.transitionEl=t},this.setStartInput=t=>{this.startInput=t},this.setEndInput=t=>{this.endInput=t},this.blurHandler=()=>{this.open=!1},this.keyDownHandler=t=>{var i,s;const{defaultPrevented:e,key:n}=t;e||("Enter"===n?(this.commitValue(),this.shouldFocusRangeEnd()?null===(i=this.endInput)||void 0===i||i.setFocus():this.shouldFocusRangeStart()&&(null===(s=this.startInput)||void 0===s||s.setFocus()),_(this)&&(t.preventDefault(),this.restoreInputFocus())):"ArrowDown"===n?(this.open=!0,this.focusOnOpen=!0,t.preventDefault()):"Escape"===n&&(this.open=!1,t.preventDefault(),this.restoreInputFocus()))},this.startInputFocus=()=>{this.focusedInput="start"},this.endInputFocus=()=>{this.focusedInput="end"},this.setFloatingEl=t=>{this.floatingEl=t,v(this,this.referenceEl,this.floatingEl)},this.setStartWrapper=t=>{this.startWrapper=t,this.setReferenceEl()},this.setEndWrapper=t=>{this.endWrapper=t,this.setReferenceEl()},this.setDatePickerRef=t=>{this.datePickerEl=t,W(this,{focusTrapEl:t,focusTrapOptions:{initialFocus:!1,setReturnFocus:!1}})},this.handleDateChange=t=>{this.range||(t.stopPropagation(),this.setValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.handleDateRangeChange=t=>{this.range&&(t.stopPropagation(),this.setRangeValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.setInputValue=(t,i="start")=>{const s=this[`${i}Input`];s&&(s.value=t)},this.setRangeValue=t=>{if(!this.range)return;const{value:i}=this,s=Array.isArray(i),e=Array.isArray(t);let n=e?c(e?t[0]:null):"";n&&(n=this.getNormalizedDate(n));let a=e?c(e?t[1]:null):"";a&&(a=this.getNormalizedDate(a));const o=n||a?[n,a]:"";if(o===i)return;this.userChangedValue=!0,this.value=o,this.valueAsDate=o?T(o):void 0;const l=this.calciteInputDatePickerChange.emit();l&&l.defaultPrevented&&(this.value=i,s?(this.setInputValue(i[0],"start"),this.setInputValue(i[1],"end")):(this.value=i,this.setInputValue(i)))},this.setValue=t=>{if(this.range)return;const i=this.value;let s=c(t);s=this.getNormalizedDate(s),s!==i&&(this.userChangedValue=!0,this.valueAsDate=s?h(s):void 0,this.value=s||"",this.calciteInputDatePickerChange.emit().defaultPrevented&&(this.value=i,this.setInputValue(i)))},this.commonDateSeparators=[".","-","/"],this.formatNumerals=t=>t?t.split("").map((t=>{var i,s,e;return(null===(i=this.commonDateSeparators)||void 0===i?void 0:i.includes(t))?null===(s=this.localeData)||void 0===s?void 0:s.separator:(null==D?void 0:D.includes(t))?null===(e=null==S?void 0:S.numberFormatter)||void 0===e?void 0:e.format(Number(t)):t})).join(""):"",this.parseNumerals=t=>t?t.split("").map((t=>D.includes(t)?S.delocalize(t):t)).join(""):"",this.disabled=!1,this.focusTrapDisabled=!1,this.form=void 0,this.readOnly=!1,this.value="",this.flipPlacements=void 0,this.headingLevel=void 0,this.valueAsDate=void 0,this.messageOverrides=void 0,this.messages=void 0,this.minAsDate=void 0,this.maxAsDate=void 0,this.min=void 0,this.max=void 0,this.open=!1,this.validationMessage=void 0,this.validationIcon=void 0,this.name=void 0,this.numberingSystem=void 0,this.scale="m",this.status="idle",this.placement=m,this.range=!1,this.required=!1,this.overlayPositioning="absolute",this.proximitySelectionDisabled=!1,this.layout="horizontal",this.datePickerActiveDate=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.focusedInput="start",this.localeData=void 0}handleFocusTrapDisabled(t){this.open&&(t?H(this):V(this))}handleDisabledAndReadOnlyChange(t){t||(this.open=!1)}valueWatcher(t){if(!this.userChangedValue){let i;i=Array.isArray(t)?T(t):t?h(t):void 0,this.valueAsDateChangedExternally||i===this.valueAsDate||(this.valueAsDate=i),this.localizeInputValues()}this.userChangedValue=!1}valueAsDateWatcher(t){this.datePickerActiveDate=t;const i=this.range&&Array.isArray(t)?[c(t[0]),c(t[1])]:c(t);this.value!==i&&(this.valueAsDateChangedExternally=!0,this.value=i,this.valueAsDateChangedExternally=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}onMinChanged(t){t&&(this.minAsDate=h(t))}onMaxChanged(t){t&&(this.maxAsDate=h(t))}openHandler(){O(this),this.disabled||this.readOnly?this.open=!1:this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}calciteDaySelectHandler(){this.shouldFocusRangeStart()||this.shouldFocusRangeEnd()||(this.open=!1)}async setFocus(){await P(this),this.el.focus()}async reposition(t=!1){const{floatingEl:i,referenceEl:s,placement:e,overlayPositioning:n,filteredFlipPlacements:a}=this;return f(this,{floatingEl:i,referenceEl:s,overlayPositioning:n,placement:e,flipPlacements:a,type:"menu"},t)}connectedCallback(){$(this),j(this);const{open:t}=this;if(t&&this.openHandler(),Array.isArray(this.value))this.valueAsDate=T(this.value);else if(this.value)try{this.valueAsDate=h(this.value)}catch(t){this.warnAboutInvalidValue(this.value),this.value=""}else this.valueAsDate&&(this.range?this.setRangeValue(this.valueAsDate):Array.isArray(this.valueAsDate)||(this.value=c(this.valueAsDate)));this.min&&(this.minAsDate=h(this.min)),this.max&&(this.maxAsDate=h(this.max)),E(this),x(this),M(this),this.setFilteredPlacements(),this.reposition(!0),S.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.open&&O(this),v(this,this.referenceEl,this.floatingEl)}async componentWillLoad(){R(this),await Promise.all([this.loadLocaleData(),U(this)]),this.onMinChanged(this.min),this.onMaxChanged(this.max)}componentDidLoad(){F(this),this.localizeInputValues(),this.reposition(!0)}disconnectedCallback(){H(this),k(this),I(this),w(this),g(this,this.referenceEl,this.floatingEl),L(this),B(this)}componentDidRender(){C(this)}render(){var t,i,n;const{disabled:a,effectiveLocale:o,messages:l,numberingSystem:r,readOnly:c}=this;return S.numberFormatOptions={numberingSystem:r,locale:o,useGrouping:!1},s(e,{onBlur:this.blurHandler,onKeyDown:this.keyDownHandler},s(z,{disabled:this.disabled},this.localeData&&s("div",{class:"input-container"},s("div",{class:X,"data-position":"start",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setStartWrapper},s("calcite-input-text",{"aria-autocomplete":"none","aria-controls":this.dialogId,"aria-describedby":this.placeholderTextId,"aria-expanded":p(this.open),"aria-haspopup":"dialog",class:{[Q]:!0,"no-bottom-border":"vertical"===this.layout&&this.range},disabled:a,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.startInputFocus,placeholder:null===(t=this.localeData)||void 0===t?void 0:t.placeholder,readOnly:c,role:"combobox",scale:this.scale,status:this.status,ref:this.setStartInput}),!this.readOnly&&this.renderToggleIcon(this.open&&"start"===this.focusedInput),s("span",{"aria-hidden":"true",class:"assistive-text",id:this.placeholderTextId},"Date Format: ",null===(i=this.localeData)||void 0===i?void 0:i.placeholder)),s("div",{"aria-hidden":p(!this.open),"aria-label":l.chooseDate,"aria-live":"polite","aria-modal":"true",class:{"menu-container":!0,"menu-container--active":this.open},id:this.dialogId,role:"dialog",ref:this.setFloatingEl},s("div",{class:{"calendar-wrapper":!0,"calendar-wrapper--end":"end"===this.focusedInput,[b.animation]:!0,[b.animationActive]:this.open},ref:this.setTransitionEl},s("calcite-date-picker",{activeDate:this.datePickerActiveDate,activeRange:this.focusedInput,headingLevel:this.headingLevel,max:this.max,maxAsDate:this.maxAsDate,messageOverrides:this.messageOverrides,min:this.min,minAsDate:this.minAsDate,numberingSystem:r,onCalciteDatePickerChange:this.handleDateChange,onCalciteDatePickerRangeChange:this.handleDateRangeChange,proximitySelectionDisabled:this.proximitySelectionDisabled,range:this.range,scale:this.scale,tabIndex:this.open?void 0:-1,valueAsDate:this.valueAsDate,ref:this.setDatePickerRef}))),this.range&&"horizontal"===this.layout&&s("div",{class:"horizontal-arrow-container"},s("calcite-icon",{flipRtl:!0,icon:"arrow-right",scale:K(this.scale)})),this.range&&"vertical"===this.layout&&"s"!==this.scale&&s("div",{class:"vertical-arrow-container"},s("calcite-icon",{icon:"arrow-down",scale:K(this.scale)})),this.range&&s("div",{class:X,"data-position":"end",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setEndWrapper},s("calcite-input-text",{"aria-autocomplete":"none","aria-controls":this.dialogId,"aria-expanded":p(this.open),"aria-haspopup":"dialog",class:{[Q]:!0,"border-top-color-one":"vertical"===this.layout&&this.range},disabled:a,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.endInputFocus,placeholder:null===(n=this.localeData)||void 0===n?void 0:n.placeholder,readOnly:c,role:"combobox",scale:this.scale,status:this.status,ref:this.setEndInput}),!this.readOnly&&this.renderToggleIcon(this.open&&"end"===this.focusedInput))),s(y,{component:this}),this.validationMessage?s(q,{icon:this.validationIcon,message:this.validationMessage,scale:this.scale,status:this.status}):null))}renderToggleIcon(t){return s("span",{class:tt,tabIndex:-1},s("calcite-icon",{icon:t?"chevron-up":"chevron-down",scale:K(this.scale)}))}setReferenceEl(){const{focusedInput:t,layout:i,endWrapper:s,startWrapper:e}=this;this.referenceEl="end"===t||"vertical"===i?s||e:e||s,requestAnimationFrame((()=>v(this,this.referenceEl,this.floatingEl)))}onLabelClick(){this.setFocus()}onBeforeOpen(){this.calciteInputDatePickerBeforeOpen.emit()}onOpen(){V(this,{onActivate:()=>{this.focusOnOpen&&(this.datePickerEl.setFocus(),this.focusOnOpen=!1)}}),this.calciteInputDatePickerOpen.emit()}onBeforeClose(){this.calciteInputDatePickerBeforeClose.emit()}onClose(){this.calciteInputDatePickerClose.emit(),H(this),this.restoreInputFocus(),this.focusOnOpen=!1,this.datePickerEl.reset()}commitValue(){const{focusedInput:t,value:i}=this,s=l(this[`${t}Input`].value,this.localeData),e=c(s),n=Array.isArray(i);if(this.range)if(n){if(e===i["start"===t?0:1])return;s?(this.setRangeValue(["start"===t?s:h(i[0]),"end"===t?s:h(i[1])]),this.localizeInputValues()):this.setRangeValue(["end"===t&&h(i[0]),"start"===t&&h(i[1])])}else s&&(this.setRangeValue(["start"===t?s:h(i[0]),"end"===t?s:h(i[1])]),this.localizeInputValues());else{if(e===i)return;this.setValue(s),this.localizeInputValues()}}async loadLocaleData(){S.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.localeData=await A(this.effectiveLocale),this.localizeInputValues()}shouldFocusRangeStart(){return!(!this.value[1]||this.value[0]||"end"!==this.focusedInput||!this.startInput)}shouldFocusRangeEnd(){return!(!this.value[0]||this.value[1]||"start"!==this.focusedInput||!this.endInput)}restoreInputFocus(){this.range?("start"===this.focusedInput?this.startInput:this.endInput).setFocus():this.startInput.setFocus()}localizeInputValues(){var t;const i=d(this.range?Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0:this.valueAsDate,this.minAsDate,this.maxAsDate),s=this.range?d(Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0,this.minAsDate,this.maxAsDate):null,e={numberingSystem:N(this.numberingSystem)},n=i&&i.toLocaleDateString(this.effectiveLocale,e),a=s&&s.toLocaleDateString(this.effectiveLocale,e);this.setInputValue(null!=n?n:"","start"),this.setInputValue(null!==(t=this.range&&a)&&void 0!==t?t:"","end")}warnAboutInvalidValue(t){console.warn(`The specified value "${t}" does not conform to the required format, "YYYY-MM-DD".`)}getNormalizedDate(t){if(!t)return"";if(!
12
+ /*!
13
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
+ * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
15
+ * v2.4.0
16
+ */
17
+ function(t){if(!t)return!1;const{year:i}=a(t);return Number(i)<100}(t))return t;const{day:i,month:s,year:e}=a(t);return`${function(t){const i=(new Date).getFullYear();return 100*Math.floor(i/100)+t}(Number(e))}-${s}-${i}`}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return n(this)}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],disabled:["handleDisabledAndReadOnlyChange"],readOnly:["handleDisabledAndReadOnlyChange"],value:["valueWatcher"],valueAsDate:["valueAsDateWatcher"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],min:["onMinChanged"],max:["onMaxChanged"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],layout:["setReferenceEl"],focusedInput:["setReferenceEl"],effectiveLocale:["loadLocaleData"]}}};it.style=":host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:inline-block;inline-size:100%;overflow:visible;vertical-align:top;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host .menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host .menu-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}:host .menu-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}:host .menu-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}:host .menu-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([scale=s]){--calcite-toggle-spacing:0.5rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1rem)}:host([scale=m]){--calcite-toggle-spacing:0.75rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1.5rem)}:host([scale=l]){--calcite-toggle-spacing:1rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 2rem)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.calendar-wrapper{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:translate3d(0, 0, 0)}.input-wrapper{position:relative}.toggle-icon{position:absolute;display:flex;cursor:pointer;align-items:center;inset-inline-end:0;inset-block:0;padding-inline:var(--calcite-toggle-spacing)}:host([range]) .input-container{display:flex}:host([range]) .input-wrapper{flex:1 1 auto}:host([range]) .horizontal-arrow-container{display:flex;align-items:center;border-width:1px;border-inline-start-width:0px;border-inline-end-width:0px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);padding-block:0px;padding-inline:0.25rem}:host([range][layout=vertical]) .input-wrapper{inline-size:100%}:host([range][layout=vertical]) .input-container{flex-direction:column;align-items:flex-start}:host([range][layout=vertical]) .calendar-wrapper--end{transform:translate3d(0, 0, 0)}:host([range][layout=vertical]) .vertical-arrow-container{inset-block-start:1.5rem;position:absolute;z-index:var(--calcite-z-index);margin-inline:1px;background-color:var(--calcite-color-foreground-1);padding-inline:0.625rem;inset-inline-start:0}.menu-container{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.menu-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.menu-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.menu-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.menu-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .menu-container{visibility:visible}.menu-container--active{visibility:visible}.input .calcite-input__wrapper{margin-block-start:0px}:host([range][layout=vertical][scale=m]) .vertical-arrow-container{inset-block-start:1.5rem;padding-inline-start:0.75rem}:host([range][layout=vertical][scale=m]) .vertical-arrow-container calcite-icon{block-size:0.75rem;inline-size:0.75rem;min-inline-size:0px}:host([range][layout=vertical][scale=l]) .vertical-arrow-container{inset-block-start:2.25rem;padding-inline:0.875rem}:host([range][layout=vertical][open]) .vertical-arrow-container{display:none}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}";const st="instant-apps-filter-list calcite-mode-light",et=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function nt(t){return t.replaceAll("'","''")}function at(t,i=!1){if(t){const s=new Date(t),e=`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`;return i?`${e} ${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}`:e}}function ot(t){var i;if(null!=t){t.value=["",""];const s=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll("calcite-input");if(null!=s)for(const t of s)t.value=""}}const lt="instant-apps-filter-list__footer",rt="instant-apps-filter-list__item-container--user-input",ct=class{constructor(s){t(this,s),this.filterListReset=i(this,"filterListReset",7),this.filterUpdate=i(this,"filterUpdate",7),this.layerExpressions=void 0,this.autoUpdateUrl=!1,this.closeBtn=!1,this.closeBtnOnClick=void 0,this.closeBtnText=void 0,this.openFilters=!1,this.extentSelector=!1,this.extentSelectorConfig=void 0,this.urlParams=void 0,this.view=void 0,this.zoomBtn=!0,this.loading=void 0,this.filterLayerExpressions=void 0,this.messages=void 0,this.baseClass=st,this.disabled=!0,this.hasLayerExpression=!1,this.initDefExpressions=void 0,this.initMapImageExpressions=void 0,this.initPointCloudFilters=void 0}watchViewHandler(){this.handleWhenView()}watchLayerExpressions(){this.hasLayerExpression||(this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}async componentWillLoad(){var t;this.baseClass="dark"===G(this.el)?"instant-apps-filter-list calcite-mode-dark":st,await this.initializeModules(),Z(this),this.hasLayerExpression=null!=this.layerExpressions,this.filterLayerExpressions=null!=this.layerExpressions?JSON.parse(JSON.stringify(this.layerExpressions)):void 0,this.disabled=!(null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)||void 0,this.reactiveUtils.whenOnce((()=>this.view)).then((()=>this.handleLayerExpressionsUpdate()))}componentShouldUpdate(t,i,s){"view"===s&&null!=t?this.handleWhenView():"layerExpressions"===s&&(this.hasLayerExpression&&this.resetAllFilters(),this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}componentWillRender(){var t;this.disabled=!((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0)||void 0}disconnectedCallback(){this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.resetAllFilters()}async initializeModules(){const[t,i,s]=await Y(["esri/intl","esri/geometry/support/jsonUtils","esri/core/reactiveUtils"]);return this.geometryJsonUtils=i,this.reactiveUtils=s,this.locale=t.getLocale(),this.intl=t,Promise.resolve()}render(){const t=this.loading?this.renderLoading():this.initFilterConfig(),i=this.closeBtn?this.renderFullFooter():this.renderFooter();return s(e,null,s("calcite-panel",{class:this.baseClass,ref:t=>this.panelEl=t},s("slot",{slot:"header-content",name:"filter-header-content"}),s("slot",{slot:"header-actions-end",name:"filter-header-actions-end"}),s("div",{key:"filter-container",class:"instant-apps-filter-list__container"},t,i)))}renderLoading(){return s("calcite-loader",{label:"Loading filters..."})}renderFilter(t){const{id:i}=t;return t.expressions.map(((e,n)=>"checkbox"==e.type||null==e.type?s("div",{key:`${i}-${n}`,class:"instant-apps-filter-list__item-container"},s("div",{class:"instant-apps-filter-list__title"},s("p",null,e.name)),s("div",{class:"instant-apps-filter-list__checkbox-container"},s("calcite-checkbox",{id:e.id.toString(),scale:"l",checked:null==e?void 0:e.active,onCalciteCheckboxChange:this.handleCheckboxChange.bind(this,t,e)}))):this.initInput(t,e)))}renderLayerBlock(){return this.filterLayerExpressions.map((t=>this.renderFilterBlocks(t)))}renderFilterBlocks(t){var i;const e=this.renderFilter(t),{operator:n}=t,a="OR"===(null==n?void 0:n.trim())?"orOperator":"andOperator",o=this.renderZoomTo(t);return s("calcite-block",{key:t.id,heading:t.title,description:null===(i=this.messages)||void 0===i?void 0:i[a],open:!!this.openFilters||void 0,collapsible:!0},o,e)}renderCombobox(t,i){var e;return s("label",{key:"combo-select",class:rt},s("span",null,i.name),s("calcite-combobox",{id:i.id.toString(),onCalciteComboboxChange:this.handleComboSelect.bind(this,i,t),label:i.name,placeholder:i.placeholder,selectionMode:"multiple","max-items":"6"},null===(e=i.fields)||void 0===e?void 0:e.map(((t,s)=>this.renderComboboxItem(i,t,s)))))}renderComboboxItem(t,i,e){var n;const a=this.createLabel(t,i),o=null==t?void 0:t.selectedFields,l=null!==(n=null==o?void 0:o.includes(i))&&void 0!==n&&n;return s("calcite-combobox-item",{key:`${a}-${e}`,value:i,textLabel:`${a}`,selected:l})}initFilterConfig(){var t,i;if((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0){if(1===this.filterLayerExpressions.length){const{operator:t}=this.filterLayerExpressions[0],e="OR"===(null==t?void 0:t.trim())?"orOperator":"andOperator",n=this.renderZoomTo(this.filterLayerExpressions[0]);return s("calcite-block",{class:"instant-apps-filter-list__operator-description",heading:null===(i=this.messages)||void 0===i?void 0:i[e],open:!0},n,this.renderFilter(this.filterLayerExpressions[0]))}if(this.filterLayerExpressions.length>1)return this.renderLayerBlock()}}renderNumberSlider(t,i){var e,n,a,o,l,r,c,h;const d=null==i?void 0:i.min,p=null==i?void 0:i.max,u=(null==i?void 0:i.step)?i.step:1,v=null!==(e=null==i?void 0:i.field)&&void 0!==e?e:"",m=[null!=(null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.min)?i.range.min:d,null!=(null===(a=null==i?void 0:i.range)||void 0===a?void 0:a.max)?i.range.max:p];return null!=d&&null!=p?s("label",{key:null==i?void 0:i.id.toString(),class:rt},s("span",null,null==i?void 0:i.name),s("div",{class:"instant-apps-filter-list__number-input-container"},s("calcite-slider",{id:null==i?void 0:i.id.toString(),onCalciteSliderChange:this.handleSliderChange.bind(this,i,t),min:d,max:p,minValue:d,maxValue:p,"min-label":null===(l=null===(o=this.messages)||void 0===o?void 0:o.minSlider)||void 0===l?void 0:l.replace("{field}",v),"max-label":null===(c=null===(r=this.messages)||void 0===r?void 0:r.maxSlider)||void 0===c?void 0:c.replace("{field}",v),step:u,labelHandles:!0,snap:!0,value:m,"group-separator":null===(h=null==i?void 0:i.format)||void 0===h?void 0:h.digitSeparator}))):void 0}renderDatePicker(t,i){var e,n,a,o;const{min:l,max:r}=i,c=[null===(e=null==i?void 0:i.range)||void 0===e?void 0:e.min,null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.max];return null!=l&&null!=r?s("label",{class:rt},s("span",null,null==i?void 0:i.name),s("div",{class:"instant-apps-filter-list__date-picker-input-container"},s("calcite-input-date-picker",{id:null==i?void 0:i.id.toString(),onCalciteInputDatePickerChange:this.handleDatePickerRangeChange.bind(this,i,t),min:l,max:r,"overlay-positioning":"fixed",lang:null!==(a=this.locale)&&void 0!==a?a:"en",layout:"vertical",value:c,range:!0}),s("calcite-action",{onClick:this.handleResetDatePicker.bind(this,i,t),icon:"reset",text:null===(o=this.messages)||void 0===o?void 0:o.resetDatePicker,scale:"s"}))):null}renderFooter(){var t;return s("div",{class:lt,slot:"footer"},s("calcite-button",{appearance:"outline",width:"full",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(t=this.messages)||void 0===t?void 0:t.resetFilter))}renderFullFooter(){var t,i,e;const n=null!=this.closeBtnText?this.closeBtnText:null===(t=this.messages)||void 0===t?void 0:t.close;return s("div",{class:lt,slot:"footer"},s("calcite-button",{appearance:"outline",width:"half",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(i=this.messages)||void 0===i?void 0:i.resetFilter),s("calcite-button",{appearance:"solid",width:"half",kind:"brand",onClick:null===(e=this.closeBtnOnClick)||void 0===e?void 0:e.bind(this)},n))}renderZoomTo(t){var i;return this.zoomBtn?s("div",{class:"instant-apps-filter-list__zoom-to"},s("calcite-button",{id:(null==t?void 0:t.sublayerId)?`zoom-to-${t.id}-${t.sublayerId}`:`zoom-to-${t.id}`,appearance:"transparent",kind:"neutral",scale:"s",iconStart:"magnifying-glass-plus",onClick:this.handleZoomTo.bind(this,t)},null===(i=this.messages)||void 0===i?void 0:i.zoomTo)):void 0}handleResetDatePicker(t,i){ot(this.panelEl.querySelector(`[id='${t.id}']`)),t.active=!1,t.definitionExpression=void 0,t.range=void 0,this.generateOutput(i)}initInput(t,i){const{type:s}=i;return"string"===s||"coded-value"==s?this.renderCombobox(t,i):"number"===s||"range"==s?"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?this.renderCombobox(t,i):this.renderNumberSlider(t,i):"date"===s?"drop-down"===(null==i?void 0:i.displayOption)?this.renderCombobox(t,i):this.renderDatePicker(t,i):void 0}async initExpressions(){if(this.loading=!0,null==this.filterLayerExpressions)return;const t=this.filterLayerExpressions;for(let i=0;i<(null==t?void 0:t.length);i++){const s=t[i].expressions;for(let e=0;e<(null==s?void 0:s.length);e++)null==s[e].active&&null!=s[e].definitionExpression&&(s[e].active=!1),await this.setInitExpression(t[i],s[e])}this.loading=!1,this.filterLayerExpressions=[...t]}handleResetFilter(){var t;null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=t.expressions)||void 0===i||i.forEach((t=>{const{type:i}=t;"string"===i||"coded-value"===i?this.resetCombobox(t):"date"===i?"drop-down"===(null==t?void 0:t.numDisplayOption)||"drop-down"===(null==t?void 0:t.displayOption)?this.resetCombobox(t):this.resetDatePicker(t):"number"===i||"range"===i?"drop-down"===(null==t?void 0:t.numDisplayOption)||"drop-down"===(null==t?void 0:t.displayOption)?this.resetCombobox(t):this.resetNumberRange(t):this.resetCheckbox(t),t.active=!1}))})),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetCombobox(t){const{id:i}=t;t.selectedFields=void 0;const s=this.panelEl.querySelector(`[id='${i}']`);if(null!=s)for(let t=0;t<s.children.length;t++)s.children[t].selected=!1}resetDatePicker(t){const{id:i}=t;t.range=void 0,ot(this.panelEl.querySelector(`[id='${i}']`))}resetNumberRange(t){t.range=void 0;const{id:i,max:s,min:e}=t,n=this.panelEl.querySelector(`[id='${i}']`);null!=n&&(n.minValue=e,n.maxValue=s)}resetCheckbox(t){const{id:i}=t,s=this.panelEl.querySelector(`[id='${i}']`);null!=s&&(s.checked=!1)}resetAllFilters(){var t,i,s,e,n;const a=null===(s=null===(i=null===(t=this.view)||void 0===t?void 0:t.map)||void 0===i?void 0:i.allLayers)||void 0===s?void 0:s.concat(null===(n=null===(e=this.view)||void 0===e?void 0:e.map)||void 0===n?void 0:n.allTables);null==a||a.forEach((t=>{var i,s;if(et.includes(t.type)){const e=t;"point-cloud"===e.type?e.filters=null===(i=this.initPointCloudFilters)||void 0===i?void 0:i[e.id]:"map-image"===e.type?e.allSublayers.forEach((t=>{var i,s;t.definitionExpression=null===(s=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[e.id])||void 0===s?void 0:s[t.id]})):e.definitionExpression=null===(s=this.initDefExpressions)||void 0===s?void 0:s[e.id]}}))}async updateStringExpression(t,i){const{field:s,type:e}=i,n=this.findFilterLayer(t);if(i.fields=await this.getFeatureAttributes(n,s),"date"===e){const t=n.fields.find((({name:t})=>t===s));"date-only"===(null==t?void 0:t.type)&&(i.dateOnly=!0)}if(null==i?void 0:i.selectedFields){const t=i.selectedFields.map((t=>"number"==typeof t?t:`'${nt(t)}'`));return i.definitionExpression=`${s} IN (${t.join(",")})`,Promise.resolve(!0)}return Promise.resolve(!1)}async updateNumberExpression(t,i){var s,e;if(!(null==i?void 0:i.min)&&0!==(null==i?void 0:i.min)||!(null==i?void 0:i.max)&&0!==(null==i?void 0:i.max)){const n=this.findFilterLayer(t),{field:a}=i;if(null!=a)if(this.setExpressionFormat(n,i,a),"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)){const t=await this.getFeatureAttributes(n,a);t.sort(((t,i)=>t-i)),i.fields=t}else{const t=await this.calculateMinMaxStatistics(n,a),o=null===(s=null==t?void 0:t[0])||void 0===s?void 0:s.attributes;if(null!=(null===(e=i.format)||void 0===e?void 0:e.places)?(i.min=this.roundMinNumberDown(o[`min${a}`],i.format.places),i.max=this.roundMaxNumberUp(o[`max${a}`],i.format.places)):(i.min=o[`min${a}`],i.max=o[`max${a}`]),(null==i?void 0:i.range)&&Object.keys(i.range).length){const{min:t,max:s}=i.range;return i.definitionExpression=`${i.field} BETWEEN ${t} AND ${s}`,!0}}}return!1}async updateDateExpression(t,i){var s;const{field:e,range:n}=i,a=this.findFilterLayer(t),o=await this.calculateMinMaxStatistics(a,e),l=null===(s=null==o?void 0:o[0])||void 0===s?void 0:s.attributes;if(i.min=at(l[`min${e}`]),i.max=at(l[`max${e}`]),null!=n&&(null!=(null==n?void 0:n.max)||null!=(null==n?void 0:n.min))){let{min:t,max:s}=n;if(t=null==t?void 0:t.replace("+"," "),s=null==s?void 0:s.replace("+"," "),t||s){const n=s&&!t?"<":!s&&t?">":null;return i.definitionExpression=n?`${e} ${n} '${null!=t?t:s}'`:`${e} BETWEEN '${t}' AND '${s}'`,!0}}return!1}updateCodedValueExpression(t,i){var s;const{field:e}=t,n=[];t.codedValues={};const a=null==i?void 0:i.domain;if(null===(s=null==a?void 0:a.codedValues)||void 0===s||s.forEach((i=>{const{code:s,name:e}=i;n.push(s),null!=t.codedValues&&(t.codedValues[s]=e)})),t.fields=n,null==t?void 0:t.selectedFields){const i=t.selectedFields.map((t=>"number"==typeof t?t:`'${nt(t)}'`)),s=`${e} IN (${i.join(",")})`;return t.definitionExpression=s,!0}return!1}updateRangeExpression(t,i){const{field:s,range:e}=t,n=null==i?void 0:i.domain;if(t.min=null==n?void 0:n.minValue,t.max=null==n?void 0:n.maxValue,e&&Object.keys(e).length){const{min:i,max:n}=e;return t.definitionExpression=`${s} BETWEEN ${i} AND ${n}`,!0}return!1}async getFeatureAttributes(t,i){var s,e,n;if(t&&et.includes(t.type)){const a=t.createQuery();if((null===(e=null===(s=null==t?void 0:t.capabilities)||void 0===s?void 0:s.query)||void 0===e?void 0:e.supportsCacheHint)&&(a.cacheHint=!0),i){const s=this.getInitDefExprFromLayer(t);if(a.where=s||"1=1",a.outFields=[i],a.orderByFields=[`${i} DESC`],a.returnDistinctValues=!0,a.returnGeometry=!1,a.maxRecordCountFactor=3,this.extentSelector&&this.extentSelectorConfig){const t=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=t&&(a.geometry=t),a.spatialRelationship="intersects"}return null===(n=await this.queryForFeatures(t,a,i))||void 0===n?void 0:n.sort()}}return[]}async queryForFeatures(t,i,s){const e=await t.queryFeatures(i),n=null==e?void 0:e.features.filter((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[s]}));return null==n?void 0:n.map((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[s]}))}async calculateMinMaxStatistics(t,i){var s,e;if(t&&et.includes(t.type)){const n=t.createQuery();let a=this.getInitDefExprFromLayer(t);if(n.where=a||"1=1",(null===(e=null===(s=null==t?void 0:t.capabilities)||void 0===s?void 0:s.query)||void 0===e?void 0:e.supportsCacheHint)&&(n.cacheHint=!0),i){if(n.outStatistics=[{onStatisticField:i,outStatisticFieldName:`max${i}`,statisticType:"max"},{onStatisticField:i,outStatisticFieldName:`min${i}`,statisticType:"min"}],this.extentSelector&&this.extentSelectorConfig){const t=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=t&&(n.geometry=t),n.spatialRelationship="intersects"}const s=await t.queryFeatures(n);return null==s?void 0:s.features}}return[]}getExtent(t,i){if(t&&i){const{constraints:t}=i;let s=Object.assign({},t);const e=null==s?void 0:s.geometry;if(e){const t=this.geometryJsonUtils.fromJSON(e);if(t&&("extent"===(null==t?void 0:t.type)||"polygon"===(null==t?void 0:t.type)))return t}}}setInitExpression(t,i){if(i.field&&i.type){const s=this.findFilterLayer(t);return null==s?Promise.resolve():("not-loaded"!==s.loadStatus&&"failed"!==s.loadStatus||s.load(),s.when((async()=>{var e,n;const a=null===(e=s.fields)||void 0===e?void 0:e.find((({name:t})=>t===i.field)),o=null===(n=null==a?void 0:a.domain)||void 0===n?void 0:n.type;i.type="coded-value"===o||"range"===o?o:i.type,await this.updateExpression(t,i,a)})))}return this.updateExpression(t,i,void 0),Promise.resolve()}async updateExpression(t,i,s){let e=!1;const{type:n}=i;"string"===n?e=await this.updateStringExpression(t,i):"number"===n?e=await this.updateNumberExpression(t,i):"date"===n?e="drop-down"===i.displayOption?await this.updateStringExpression(t,i):await this.updateDateExpression(t,i):"coded-value"===n?e=this.updateCodedValueExpression(i,s):"range"===n?e=this.updateRangeExpression(i,s):!i.active||"checkbox"!==n&&null!=n||(e=!0),e&&this.generateOutput(t)}updateRangeExpressions(t,i,s,e){const n=this.getInitDefExprFromLayerExpression(i);!e&&0!==e||!s&&0!==s||(e===(null==t?void 0:t.min)&&s===(null==t?void 0:t.max)?(t.definitionExpression=void 0,t.active=!1):(t.definitionExpression=n?`(${n}) AND ${null==t?void 0:t.field} BETWEEN ${e} AND ${s}`:`${null==t?void 0:t.field} BETWEEN ${e} AND ${s}`,t.active=!0)),t.range={min:e,max:s}}handleCheckboxChange(t,i,s){i.active=s.target.checked,this.generateOutput(t)}handleSliderChange(t,i,s){const{maxValue:e,minValue:n}=s.target;this.updateRangeExpressions(t,i,e,n),this.generateOutput(i)}handleComboSelect(t,i,s){const e=s.target.selectedItems,{field:n,type:a}=t;if(e&&e.length){const i=e.map((({value:t})=>"number"==typeof t?t:`'${nt(t)}'`));if("date"===a)t.selectedFields=e.map((({value:t})=>t)),t.definitionExpression=i.map((t=>this.buildDateExpression(t,n))).join(" OR ");else{t.selectedFields=e.map((({value:t})=>t));const s=`${n} IN (${i.join(",")})`;t.definitionExpression=s}t.active=!0}else t.definitionExpression=void 0,t.active=!1;this.generateOutput(i)}handleDatePickerRangeChange(t,i,s){const e=s.target,[n,a]=e.valueAsDate,o=null!=n?at(Math.floor(n.getTime()),!0):void 0,l=null!=a?at(Math.floor(a.getTime()),!0):void 0;if(null!=o||null!=l){const s=l&&null==o?"<":null==l&&o?">":null;t.definitionExpression=s?`${t.field} ${s} '${null!=o?o:l}'`:`${t.field} BETWEEN '${o}' AND '${l}'`,t.range={min:o,max:l},t.active=!0,this.generateOutput(i)}}handleURLParams(){var t;if("URLSearchParams"in window){const i=null===(t=new URLSearchParams(document.location.search).get("filter"))||void 0===t?void 0:t.split(";");null==i||i.forEach((t=>{var i;const s=JSON.parse(t);null===(i=this.filterLayerExpressions)||void 0===i||i.forEach((t=>{var i;(null==s?void 0:s.layerId)===t.id&&(null===(i=t.expressions)||void 0===i||i.forEach((t=>{var i,e;(null===(i=t.id)||void 0===i?void 0:i.toString())===(null===(e=null==s?void 0:s.expressionId)||void 0===e?void 0:e.toString())&&(t.active=!0,"range"===s.type?t.range=s.range:"select"===s.type&&(t.selectedFields=s.selectedFields))})))}))}))}}createURLParamExpression(t,i){const{id:s,range:e,selectedFields:n,type:a}=i;return"string"===a||"coded-value"===a||"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?{type:"select",layerId:t.id,expressionId:s.toString(),selectedFields:n}:"number"===a||"range"===a||"date"===a?{type:"range",layerId:t.id,expressionId:s.toString(),range:e}:{layerId:t.id,expressionId:s.toString()}}autoUpdateURLCheck(t){this.autoUpdateUrl&&(t.toString()?window.history.replaceState({},"",`${window.location.pathname}?${t} `):window.history.replaceState({},"",window.location.pathname))}generateURLParams(){var t;if("URLSearchParams"in window){const i=new URLSearchParams(window.location.search),s=[];null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=null==t?void 0:t.expressions)||void 0===i||i.forEach((i=>{if(i.active){const e=this.createURLParamExpression(t,i);s.push(JSON.stringify(e))}}))})),s.length>0?i.set("filter",s.join(";")):i.delete("filter"),this.autoUpdateURLCheck(i),this.urlParams=i}}updateFilter(t,i,s){const{id:e}=t,n=this.view.map.findLayerById(e)||this.view.map.findTableById(e);if(null!=n)if("point-cloud"===n.type)this.updateFilterLayerPCLFilter(n,s);else if("map-image"===n.type){const s=n.findSublayerById(null==t?void 0:t.sublayerId);null!=s&&this.updateFilterLayerDefExpression(s,i,t)}else this.updateFilterLayerDefExpression(n,i,t)}updateFilterLayerDefExpression(t,i,s){const{operator:e}=s;let n=this.getInitDefExprFromLayer(t);const a=(null==i?void 0:i.length)>0&&null!=n?`(${i.join(e)}) AND (${n})`:i.length>0?i.join(e):n;t.definitionExpression=a}updateFilterLayerPCLFilter(t,i){t.filters=i}async handleWhenView(){if(null==this.view)return;const t=this.view.map;await t.loadAll(),this.handleLayerExpressionsUpdate()}async handleLayerExpressionsUpdate(){if(null==this.view)return;const t=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={};const i=t.allLayers.concat(t.allTables);for(let t=0;t<i.length;t++){const s=i.getItemAt(t);if(et.includes(s.type)){const t=s;"point-cloud"===t.type?this.initPointCloudFilters[t.id]=t.filters:"map-image"===t.type?(this.initMapImageExpressions[t.id]={},t.allSublayers.forEach((i=>{this.initMapImageExpressions[t.id][i.id]=i.definitionExpression}))):this.initDefExpressions[t.id]=t.definitionExpression}}this.initExpressions(),this.handleURLParams()}async handleZoomTo(t){const i=this.panelEl.querySelector((null==t?void 0:t.sublayerId)?`#zoom-to-${t.id}-${t.sublayerId}`:`#zoom-to-${t.id}`);null!=i&&(i.loading=!0,i.disabled=!0),this.zoomToGraphics=[];let s=0,e=!1;const n=setInterval((()=>{s>=1e3&&e&&(this.view.goTo(this.zoomToGraphics),null!=i&&(i.loading=!1,i.disabled=!1),clearInterval(n)),s+=500}),500);await this.getZoomToGraphics(t),e=!0}async getZoomToGraphics(t){var i,s,e,n,a;const o=this.view.allLayerViews.find((({layer:i})=>i.id===t.id)),l=o.layer,r="map-image"===l.type?l.findSublayerById(t.sublayerId):l;if("point-cloud"!==r.type&&et.includes(null==r?void 0:r.type)){const t=r.createQuery();if((null===(s=null===(i=null==l?void 0:l.capabilities)||void 0===i?void 0:i.query)||void 0===s?void 0:s.supportsCacheHint)&&(t.cacheHint=!0),t.where=null!==(e=r.definitionExpression)&&void 0!==e?e:"1=1",t.returnGeometry=!0,t.returnDistinctValues=!0,t.maxRecordCountFactor=3,t.returnExceededLimitFeatures=!0,t.outFields=[],this.extentSelector&&this.extentSelectorConfig){const i=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=i&&(t.geometry=i),t.spatialRelationship="intersects"}const c=null!=(null===(n=null==o?void 0:o.featureEffect)||void 0===n?void 0:n.filter)?o.featureEffect.filter:o.filter;null!=c&&(null!=c.objectIds&&(t.objectIds=c.objectIds),null!=c.distance&&(t.distance=c.distance),null!=c.geometry&&(t.geometry=c.geometry),null!=c.distance&&(t.distance=c.distance),null!=c.spatialRelationship&&(t.spatialRelationship=c.spatialRelationship),null!=c.units&&(t.units=c.units),null!=c.where&&(t.where=c.where),null!=c.timeExtent&&(t.timeExtent=c.timeExtent));try{const i=await r.queryFeatures(t);this.zoomToGraphics.push(...i.features)}catch(i){if(null===(a=null==i?void 0:i.message)||void 0===a?void 0:a.toLowerCase().includes("distinct"))try{t.returnDistinctValues=!1;const i=await r.queryFeatures(t);this.zoomToGraphics.push(...i.features)}catch(t){}}}return Promise.resolve()}generateOutput(t){if(null==this.view)return;const i=[];let s=[];if(t){for(const e of t.expressions){const{active:t,definitionExpression:n,pointCloudFilters:a}=e;t&&n&&i.push(`(${n})`),t&&null!=a&&a.length>0&&(s=s.concat(a))}this.updateFilter(t,i,s),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(t){return t.toLocaleString("en-US",{maximumFractionDigits:20})}roundMinNumberDown(t,i){if(null!=t){if((""+t).includes("e")){var s=(""+t).split("e"),e="";return+s[1]+i>0&&(e="+"),+(Math.floor(+s[0]+"e"+e+(+s[1]+i))+"e-"+i)}return+(Math.floor(t+"e+"+i)+"e-"+i)}}roundMaxNumberUp(t,i){if(null!=t){if((""+t).includes("e")){var s=(""+t).split("e"),e="";return+s[1]+i>0&&(e="+"),+(Math.ceil(+s[0]+"e"+e+(+s[1]+i))+"e-"+i)}return+(Math.ceil(t+"e+"+i)+"e-"+i)}}roundNumber(t,i){if(null!=t){if((""+t).includes("e")){var s=(""+t).split("e"),e="";return+s[1]+i>0&&(e="+"),+(Math.round(+s[0]+"e"+e+(+s[1]+i))+"e-"+i)}return+(Math.round(t+"e+"+i)+"e-"+i)}}setExpressionFormat(t,i,s){if(null!=(null==t?void 0:t.popupTemplate)){const e=t.popupTemplate.fieldInfos.find((({fieldName:t})=>t===s));i.format=null==e?void 0:e.format}}getInitDefExprFromLayer(t){var i,s,e;return"sublayer"===t.type?null===(s=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.layer.id])||void 0===s?void 0:s[t.id]:null===(e=this.initDefExpressions)||void 0===e?void 0:e[t.id]}getInitDefExprFromLayerExpression(t){var i,s,e;return null!=(null==t?void 0:t.sublayerId)?null===(s=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.id])||void 0===s?void 0:s[t.sublayerId]:null===(e=this.initDefExpressions)||void 0===e?void 0:e[t.id]}findFilterLayer(t){const i=this.view.map.allLayers.concat(this.view.map.allTables).find((({id:i})=>i===t.id));return"map-image"===i.type?null==i?void 0:i.findSublayerById(t.sublayerId):i}createLabel(t,i){var s;let e=i;if("coded-value"===t.type)e=null===(s=t.codedValues)||void 0===s?void 0:s[i];else if("number"===t.type&&"number"==typeof i&&null!=t.format)null!=t.format.places&&(e=this.roundNumber(i,t.format.places)),t.format.digitSeparator&&(e=this.numberWithCommas(e));else if("date"===t.type&&!t.dateOnly){const s=t.dateOnly?this.intl.convertDateFormatToIntlOptions("short-date-long-time"):void 0;e=this.intl.formatDate(i,s)}return e}buildDateExpression(t,i){if(t){const s=new Date(t),e=new Date(t),n=new Date(e.setDate(s.getDate()+1)),a=`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`,o=`${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}`,l=`${n.getHours()}:${n.getMinutes()}:${n.getSeconds()}`;return`${i} BETWEEN '${a} ${o}' AND '${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()} ${l}'`}}get el(){return n(this)}static get watchers(){return{view:["watchViewHandler"],layerExpressions:["watchLayerExpressions"]}}};ct.style=":host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:normal}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;--calcite-font-size--1:16px}.instant-apps-filter-list__item-container--user-input calcite-combobox-item{--calcite-font-size--1:12px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:64px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:normal;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1:12px}.instant-apps-filter-list__zoom-to{display:flex;justify-content:flex-end;margin:8px 0 20px}.instant-apps-filter-list__zoom-to calcite-action{width:-moz-min-content;width:min-content}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1:16px}@media (prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor:2;--calcite-internal-animation-timing-slow:calc(300ms * 2)}}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}";const ht="instant-apps-social-share",dt={base:ht,dialog:`${ht}__dialog`,dialogEmbed:`${ht}__dialog-embed`,dialogContent:`${ht}__dialog-content`,options:`${ht}__options`,tipContainer:`${ht}__tip`,tipHeader:`${ht}__tip-header`,tipContent:`${ht}__tip-content`,icon:`${ht}__icon`,iconContainer:`${ht}__icon-container`,optionText:`${ht}__option-text`,popoverButton:`${ht}__popover-button`,layout:{vertical:`${ht}__layout--vertical`,horizontal:`${ht}__layout--horizontal`},success:{container:`${ht}__success`,header:`${ht}__success-header`,message:`${ht}__success-message`,icon:`${ht}__success-icon`},embed:{container:`${ht}__embed`,header:`${ht}__embed-header`,embedCode:{container:`${ht}__embed-code`,textArea:`${ht}__embed-code-text-area`,copyButton:`${ht}__embed-code-copy-button`},textAreaText:`${ht}__embed-text-area-text`,dimensions:{container:`${ht}__embed-dimensions`,input:`${ht}__embed-dimensions-input`}},rtl:{optionText:`${ht}__option-text--rtl`,textArea:`${ht}__text-area--rtl`}},pt={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",twitter:"https://twitter.com/intent/tweet?text={text}&url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}"},ut=class{constructor(i){t(this,i),this.mode="popover",this.shareUrl=window.location.href,this.autoUpdateShareUrl=!0,this.shareText="",this.embed=!1,this.shareButtonColor="neutral",this.shareButtonType="button",this.shareButtonScale=void 0,this.iframeInnerText="",this.popoverButtonIconScale="m",this.view=void 0,this.displayTipText=!0,this.shortenShareUrl=!0,this.socialMedia=!0,this.shareIconsLayout="vertical",this.scale="m",this.successMessage="",this.defaultUrlParams=null,this.inlineSuccessPopoverPlacement="trailing",this.messages=void 0,this.opened=!1,this.copied=!1,this.inlineCopyLinkOpened=!1,this.inlineCopyEmbedOpened=!1,this.embedWidth=400,this.embedHeight=600}componentDidLoad(){var t,i;Z(this),this.setupAutoCloseListeners(),"popover"===this.mode&&(this.opened&&(this.popoverRef.open=!0),this.popoverRef.addEventListener("calcitePopoverOpen",(()=>{this.shareListRef&&this.shareListRef.children[0].focus()})),this.popoverRef.addEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))),this.embed&&(null===(t=this.embedWidthRef)||void 0===t||t.addEventListener("change",this.updateDimensions.bind(this,"width")),null===(i=this.embedHeightRef)||void 0===i||i.addEventListener("change",this.updateDimensions.bind(this,"height")))}disconnectedCallback(){var t,i,s;document.documentElement.removeEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?null!=this.popoverRef&&(this.popoverRef.removeEventListener("click",this.stopPropagationCallback.bind(this)),this.popoverRef.removeEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this)),this.popoverRef.removeEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))):(null===(t=this.embedWidthRef)||void 0===t||t.removeEventListener("change",this.updateDimensions.bind(this)),null===(i=this.embedHeightRef)||void 0===i||i.removeEventListener("change",this.updateDimensions.bind(this)),null===(s=this.dialogContentRef)||void 0===s||s.removeEventListener("click",this.stopPropagationCallback.bind(this)))}setupAutoCloseListeners(){var t,i,s;document.documentElement.addEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?(null===(t=this.popoverRef)||void 0===t||t.addEventListener("click",this.stopPropagationCallback.bind(this)),null===(i=this.popoverRef)||void 0===i||i.addEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this))):null===(s=this.dialogContentRef)||void 0===s||s.addEventListener("click",this.stopPropagationCallback.bind(this))}handlePopoverRefKeyDown(t){var i,s;if("Tab"===t.code){if(!this.shareListRef)return;const s=t.target,e=this.shareListRef.children[0],n=this.shareListRef.children[(null===(i=this.shareListRef)||void 0===i?void 0:i.children.length)-1];t.shiftKey&&s===e?(t.preventDefault(),n.focus()):t.shiftKey||s!==n||(t.preventDefault(),e.focus())}else"Escape"===t.code&&(this.closePopover(),null===(s=this.popoverButtonRef)||void 0===s||s.setFocus())}autoCloseCallback(){"popover"===this.mode?(this.opened=!1,this.popoverRef.open=this.opened):(this.copyLinkPopoverRef&&(this.copyLinkPopoverRef.open=!1),this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef&&(this.copyEmbedPopoverRef.open=!1),this.inlineCopyEmbedOpened=!1)}stopPropagationCallback(t){t.stopPropagation()}resetPopoverCopyState(){var t;null===(t=this.popoverButtonRef)||void 0===t||t.setFocus(),setTimeout((()=>{this.copied=!1}),200)}updateDimensions(t){var i,s;if("width"===t){const t=null===(i=this.embedWidthRef)||void 0===i?void 0:i.value;this.embedWidth=parseInt(t)}else{const t=null===(s=this.embedHeightRef)||void 0===s?void 0:s.value;this.embedHeight=parseInt(t)}}render(){var t,i,n,a,o,l;const r=this.copied&&"popover"===this.mode?this.renderSuccess():s("div",{class:dt.dialogContent},this.renderOptions(),this.displayTipText?this.renderTip():null,this.embed?this.renderEmbed():null),c=s("div",{ref:t=>this.dialogContentRef=t,class:`${dt.dialog}${"vertical"===this.shareIconsLayout?` ${dt.layout.vertical}`:` ${dt.layout.horizontal}`}`},r);return s(e,null,"popover"===this.mode?[s("calcite-popover",{ref:t=>this.popoverRef=t,label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,referenceElement:"shareButton",placement:"bottom-start",scale:this.scale},c),this.renderButton()]:[c,s("calcite-popover",{ref:t=>this.copyLinkPopoverRef=t,label:null===(a=null===(n=this.messages)||void 0===n?void 0:n.share)||void 0===a?void 0:a.label,referenceElement:"copyToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderSuccess()),s("calcite-popover",{ref:t=>this.copyEmbedPopoverRef=t,label:null===(l=null===(o=this.messages)||void 0===o?void 0:o.share)||void 0===l?void 0:l.label,referenceElement:"copyEmbedToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderEmbedSuccess())])}renderButton(){var t,i,e,n,a,o,l,r;const c=null!=this.shareButtonScale?this.shareButtonScale:this.scale;return"button"===this.shareButtonType?s("calcite-button",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:dt.popoverButton,kind:this.shareButtonColor,appearance:"transparent",label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,title:null===(n=null===(e=this.messages)||void 0===e?void 0:e.share)||void 0===n?void 0:n.label,scale:c},s("div",{class:dt.iconContainer},s("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale}))):s("calcite-action",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:dt.popoverButton,appearance:"transparent",label:null===(o=null===(a=this.messages)||void 0===a?void 0:a.share)||void 0===o?void 0:o.label,title:null===(r=null===(l=this.messages)||void 0===l?void 0:l.share)||void 0===r?void 0:r.label,scale:c,text:""},s("div",{class:dt.iconContainer},s("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale})))}renderSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return s("div",{class:dt.success.container},s("span",{class:dt.success.header},s("span",{class:dt.success.icon},s("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),s("span",{class:dt.success.message},this.successMessage||(null==i?void 0:i.url)))}renderEmbedSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return s("div",{class:dt.success.container},s("span",{class:dt.success.header},s("span",{class:dt.success.icon},s("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),s("span",{class:dt.success.message},null==i?void 0:i.embed))}renderOptions(){var t,i,e,n;const a=null===(t=this.messages)||void 0===t?void 0:t.options,o="rtl"===document.dir?` ${dt.rtl.optionText}`:"";return s("ul",{ref:t=>this.shareListRef=t,class:dt.options,role:"menu"},s("li",{id:"copyToClipboard",onClick:this.handleShareItem.bind(this,"link"),onKeyDown:this.handleOptionKeyDown("link"),role:"menuitem",tabindex:"0"},s("span",{class:dt.icon},s("calcite-icon",{icon:"link",scale:this.scale})),s("span",{class:`${dt.optionText}${o}`},null===(i=null==a?void 0:a.link)||void 0===i?void 0:i.label)),this.socialMedia?[s("li",{onClick:this.handleShareItem.bind(this,"facebook"),onKeyDown:this.handleOptionKeyDown("facebook"),role:"menuitem",tabindex:"0"},s("span",{class:dt.icon},this.renderFacebookIcon()),s("span",{class:`${dt.optionText}${o}`},null===(e=null==a?void 0:a.facebook)||void 0===e?void 0:e.label)),s("li",{onClick:this.handleShareItem.bind(this,"twitter"),onKeyDown:this.handleOptionKeyDown("twitter"),role:"menuitem",tabindex:"0"},s("span",{class:dt.icon},this.renderTwitterIcon()),s("span",{class:`${dt.optionText}${o}`},"Twitter")),s("li",{onClick:this.handleShareItem.bind(this,"linkedIn"),onKeyDown:this.handleOptionKeyDown("linkedIn"),role:"menuitem",tabindex:"0"},s("span",{class:dt.icon},this.renderLinkedInIcon()),s("span",{class:`${dt.optionText}${o}`},null===(n=null==a?void 0:a.linkedIn)||void 0===n?void 0:n.label))]:null)}handleOptionKeyDown(t){return i=>{const s=i.code;("Space"===s||"Enter"===s)&&this.handleShareItem(t)}}renderFacebookIcon(){return s("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},s("g",null,s("path",{d:"M512,256c0,-141.385 -114.615,-256 -256,-256c-141.385,0 -256,114.615 -256,256c0,127.777 93.616,233.685 216,252.89l0,-178.89l-65,0l0,-74l65,0l0,-56.4c0,-64.16 38.219,-99.6 96.695,-99.6c28.009,0 57.305,5 57.305,5l0,63l-32.281,0c-31.801,0 -41.719,19.733 -41.719,39.978l0,48.022l71,0l-11.35,74l-59.65,0l0,178.89c122.385,-19.205 216,-125.113 216,-252.89Z",style:{fill:"#1877f2",fillRule:"nonzero"}}),s("path",{d:"M355.65,330l11.35,-74l-71,0l0,-48.022c0,-20.245 9.917,-39.978 41.719,-39.978l32.281,0l0,-63c0,0 -29.297,-5 -57.305,-5c-58.476,0 -96.695,35.44 -96.695,99.6l0,56.4l-65,0l0,74l65,0l0,178.89c13.033,2.045 26.392,3.11 40,3.11c13.608,0 26.966,-1.065 40,-3.11l0,-178.89l59.65,0Z",style:{fill:"#fff",fillRule:"nonzero"}})))}renderTwitterIcon(){return s("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},s("rect",{height:"400",style:{fill:"none"},width:"400",x:"56",y:"56"}),s("path",{d:"M161.014,464.013c193.208,0 298.885,-160.071 298.885,-298.885c0,-4.546 0,-9.072 -0.307,-13.578c20.558,-14.871 38.305,-33.282 52.408,-54.374c-19.171,8.495 -39.51,14.065 -60.334,16.527c21.924,-13.124 38.343,-33.782 46.182,-58.102c-20.619,12.235 -43.18,20.859 -66.703,25.498c-19.862,-21.121 -47.602,-33.112 -76.593,-33.112c-57.682,0 -105.145,47.464 -105.145,105.144c0,8.002 0.914,15.979 2.722,23.773c-84.418,-4.231 -163.18,-44.161 -216.494,-109.752c-27.724,47.726 -13.379,109.576 32.522,140.226c-16.715,-0.495 -33.071,-5.005 -47.677,-13.148l0,1.331c0.014,49.814 35.447,93.111 84.275,102.974c-15.464,4.217 -31.693,4.833 -47.431,1.802c13.727,42.685 53.311,72.108 98.14,72.95c-37.19,29.227 -83.157,45.103 -130.458,45.056c-8.358,-0.016 -16.708,-0.522 -25.006,-1.516c48.034,30.825 103.94,47.18 161.014,47.104",style:{fill:"#1da1f2",fillRule:"nonzero"}}))}renderLinkedInIcon(){return s("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},s("g",{id:"g5891"},s("path",{d:"M512,64c0,-35.323 -28.677,-64 -64,-64l-384,0c-35.323,0 -64,28.677 -64,64l0,384c0,35.323 28.677,64 64,64l384,0c35.323,0 64,-28.677 64,-64l0,-384Z",id:"background",style:{fill:"#2867b2"}}),s("g",{id:"shapes"},s("rect",{height:"257.962",id:"rect11",style:{fill:"#fff"},width:"85.76",x:"61.053",y:"178.667"}),s("path",{d:"M104.512,54.28c-29.341,0 -48.512,19.29 -48.512,44.573c0,24.752 18.588,44.574 47.377,44.574l0.554,0c29.903,0 48.516,-19.822 48.516,-44.574c-0.555,-25.283 -18.611,-44.573 -47.935,-44.573Z",id:"path13-0",style:{fill:"#fff",fillRule:"nonzero"}}),s("path",{d:"M357.278,172.601c-45.49,0 -65.866,25.017 -77.276,42.589l0,-36.523l-85.738,0c1.137,24.197 0,257.961 0,257.961l85.737,0l0,-144.064c0,-7.711 0.554,-15.42 2.827,-20.931c6.188,-15.4 20.305,-31.352 43.993,-31.352c31.012,0 43.436,23.664 43.436,58.327l0,138.02l85.741,0l0,-147.93c0,-79.237 -42.305,-116.097 -98.72,-116.097Z",id:"path15",style:{fill:"#fff",fillRule:"nonzero"}}))))}renderTip(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.info;return s("div",{class:dt.tipContainer},s("span",{class:dt.tipHeader},s("calcite-icon",{icon:"lightbulb",scale:this.scale}),s("span",null,null==i?void 0:i.label)),s("p",{class:dt.tipContent},null==i?void 0:i.tooltip))}renderEmbed(){var t,i,e;const n=null===(t=this.messages)||void 0===t?void 0:t.embed,a="rtl"===document.dir?` ${dt.rtl.textArea}`:"";return s("div",{class:dt.embed.container},s("span",{class:dt.embed.header},s("calcite-icon",{icon:"code",scale:this.scale}),s("span",null,null===(e=null===(i=this.messages)||void 0===i?void 0:i.embed)||void 0===e?void 0:e.label)),s("div",{class:dt.embed.embedCode.container},s("div",{class:dt.embed.embedCode.textArea},s("textarea",{ref:t=>this.embedCodeRef=t,cols:30,rows:5,readonly:!0,class:a,value:this.getEmbedCode()}),s("button",{id:"copyEmbedToClipboard",onClick:this.copyEmbedCode.bind(this),class:dt.embed.embedCode.copyButton},s("calcite-icon",{icon:"copy",scale:this.scale}),s("span",null,null==n?void 0:n.copy))),s("span",{class:dt.embed.textAreaText},s("slot",{name:"text-area-text"})),s("div",{class:dt.embed.dimensions.container},s("label",{class:dt.embed.dimensions.input},s("span",null,null==n?void 0:n.width),s("input",{ref:t=>this.embedWidthRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("width"),value:this.embedWidth,min:"1"})),s("label",{class:dt.embed.dimensions.input},s("span",null,null==n?void 0:n.height),s("input",{ref:t=>this.embedHeightRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("height"),value:this.embedHeight,min:"1"})))))}handleNumberInputOnChange(t){const i="width"===t?this.embedWidthRef:this.embedHeightRef,s="width"===t?"embedWidth":"embedHeight";return()=>{i&&parseFloat(i.value)<=0&&(this[s]=parseInt("1"),i.value="1")}}togglePopover(t){t.stopPropagation(),this.opened=!this.opened,this.popoverRef.open=this.opened}closePopover(){this.opened=!1,this.popoverRef.open=this.opened}async handleShareItem(t){var i,s,e,n;this.shareUrl=await this.generateShareUrl();let a=null;const o=null!==(s=null===(i=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===i?void 0:i.includes("Chrome"))&&void 0!==s&&s,l=null!==(n=null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.includes("Safari"))&&void 0!==n&&n&&!o;!l&&this.shortenShareUrl&&(a=await this.shortenUrl(this.shareUrl));let r=a||this.shareUrl;switch(t){case"link":return navigator.clipboard.writeText(r),this.embed&&(this.copyEmbedPopoverRef.open=!1,this.inlineCopyEmbedOpened=!1),"inline"===this.mode&&(this.copyLinkPopoverRef.open=!0,setTimeout((()=>this.copyLinkPopoverRef.open=!1),3e3)),this.inlineCopyLinkOpened=!0,this.copied=!0,void("popover"===this.mode&&setTimeout((()=>this.closePopover()),2e3));case"facebook":case"twitter":case"linkedIn":let i;l&&(i=window.open("","_blank"),this.shortenShareUrl&&(r=await this.shortenUrl(this.shareUrl)||r));const s={url:encodeURI(r)},e="twitter"===t?Object.assign(Object.assign({},s),{text:this.shareText}):s,[n]=await Y(["esri/intl"]),a=n.substitute(pt[t],e);return"popover"===this.mode&&this.closePopover(),void(l&&i?(i.location=a,i.focus()):window.open(encodeURI(a),"_blank"))}}async shortenUrl(t){var i,s;const[e]=await Y(["esri/request"]),n=await e("https://arcg.is/prod/shorten",{query:{longUrl:t,f:"json"}}),a=null===(s=null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data)||void 0===s?void 0:s.url;if(a)return a.replace("http://","https://")}getEmbedCode(){return`<iframe src="${this.shareUrl}" width="${this.embedWidth}" height="${this.embedHeight}" frameborder="0" style="border:0" allowfullscreen>${this.iframeInnerText}</iframe>`}copyEmbedCode(){navigator.clipboard.writeText(this.getEmbedCode()),this.copyLinkPopoverRef.open=!1,this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef.open=!0,setTimeout((()=>this.copyEmbedPopoverRef.open=!1),3e3),this.inlineCopyEmbedOpened=!0}async generateShareUrl(){var t;if(this.autoUpdateShareUrl&&(this.shareUrl=window.location.href),!this.view||!(null===(t=this.view)||void 0===t?void 0:t.ready))return this.shareUrl;const{x:i,y:s}=this.view.center,{spatialReference:e}=this.view,[n,a]=await Y(["esri/geometry/Point","esri/geometry/SpatialReference"]),o=new n({x:i,y:s,spatialReference:new a(Object.assign({},e.toJSON()))}),l=await this.processPoint(o),{isWGS84:r,isWebMercator:c}=l.spatialReference;return this.generateShareUrlParams(l,r||c)}async processPoint(t){const{isWGS84:i,isWebMercator:s}=t.spatialReference;if(i||s)return t;const[e,n]=await Y(["esri/geometry/SpatialReference","esri/geometry/projection"]),a=new e({wkid:4326});try{await n.load();const i=n.project(t,a);return Promise.resolve(i)}catch(t){return console.error("Failed to project point",t),Promise.reject(null)}}generateShareUrlParams(t,i){var s,e,n,a;const{longitude:o,latitude:l,x:r,y:c}=t;if(void 0===o||void 0===l)return this.shareUrl;const h=this.roundValue(i?o:r),d=this.roundValue(i?l:c),{zoom:p}=this.view,u=this.roundValue(p),v=null===(e=null===(s=this.view)||void 0===s?void 0:s.popup)||void 0===e?void 0:e.selectedFeature,m=null===(a=null===(n=this.view)||void 0===n?void 0:n.popup)||void 0===a?void 0:a.visible;let f,g;if(v&&m){const t=null==v?void 0:v.layer;f=t.id,g=v.attributes[t.objectIdField]}const b=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";"),{type:_}=this.view,{defaultUrlParams:x}=this,w=new URL(this.shareUrl),{searchParams:y}=w;if(y.get("center")&&y.delete("center"),y.get("level")&&y.delete("level"),y.get("selectedFeature")&&y.delete("selectedFeature"),y.get("hiddenLayers")&&y.delete("hiddenLayers"),y.get("viewpoint")&&y.delete("viewpoint"),"3d"===_){const{camera:t}=this.view,{heading:i,position:s,tilt:e}=t,{longitude:n,latitude:a,z:o}=s,l={longitude:this.roundValue(n,8),latitude:this.roundValue(a,8),z:this.roundValue(o,3),heading:this.roundValue(i,3),tilt:this.roundValue(e,3)};return!1!==(null==x?void 0:x.viewpoint)&&w.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),f&&g&&!1!==(null==x?void 0:x.selectedFeature)&&w.searchParams.set("selectedFeature",`${f};${g}`),b&&!1!==(null==x?void 0:x.hiddenLayers)&&w.searchParams.set("hiddenLayers",b),w.search=decodeURIComponent(w.search),w.href}return!1!==(null==x?void 0:x.center)&&w.searchParams.set("center",`${h};${d}`),!1!==(null==x?void 0:x.level)&&w.searchParams.set("level",`${u}`),f&&g&&!1!==(null==x?void 0:x.selectedFeature)&&w.searchParams.set("selectedFeature",`${f};${g}`),b&&!1!==(null==x?void 0:x.hiddenLayers)&&w.searchParams.set("hiddenLayers",b),w.search=decodeURIComponent(w.search),w.href}roundValue(t,i=4){return parseFloat(t.toFixed(i))}get el(){return n(this)}};ut.style=":host{display:block;--instant-apps-social-share-width--s:200px;--instant-apps-social-share-width--m:280px;--instant-apps-social-share-width--l:320px;--instant-apps-social-share-width-horizontal--s:300px;--instant-apps-social-share-width-horizontal--m:380px;--instant-apps-social-share-width-horizontal--l:420px;--instant-apps-social-share-background-color:var(--calcite-color-foreground-1);--instant-apps-social-share-popover-button-background-color:transparent;--instant-apps-social-share-popover-button-icon-color:var(--calcite-ui-icon-color);--instant-apps-social-share-embed-border:1px solid $border;--instant-apps-social-share-embed-text-area-text:#468540}:host .instant-apps-social-share__popover-button{background-color:var(--instant-apps-social-share-popover-button-background-color)}:host .instant-apps-social-share__popover-button calcite-icon{color:var(--instant-apps-social-share-popover-button-icon-color)}:host .instant-apps-social-share__dialog,:host .instant-apps-social-share__dialog-embed{background-color:var(--instant-apps-social-share-background-color);border:var(--instant-apps-social-share-embed-border)}:host .instant-apps-social-share__dialog{box-sizing:border-box;height:auto;padding:10px 0;border-radius:5px}:host .instant-apps-social-share__options{margin:0;padding:1% 0 0 0;list-style-type:none}:host .instant-apps-social-share__options li{box-sizing:border-box;display:flex;align-items:center;width:100%;padding:5%;transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__options li .instant-apps-social-share__icon,:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{display:inline-block}:host .instant-apps-social-share__options li .instant-apps-social-share__icon{display:flex;align-items:center}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{width:85%;margin-left:10px;word-break:break-word}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text--rtl{margin-left:0;margin-right:10px}:host .instant-apps-social-share__options li:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}:host .instant-apps-social-share__tip{box-sizing:border-box;padding:0 5% 1% 5%}:host .instant-apps-social-share__tip-header{display:flex;align-items:center;color:#007ac2;margin:8px 0 5px 0}:host .instant-apps-social-share__tip-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__tip-content{line-height:17px;margin:0;padding-top:2%}:host .instant-apps-social-share__success{display:flex;flex-direction:column;padding:15px}:host .instant-apps-social-share__success-header{display:flex;align-items:center;font-weight:bold;margin-bottom:10px}:host .instant-apps-social-share__success-icon{display:flex;align-items:center;margin-right:5px}:host .instant-apps-social-share__success-icon calcite-icon{color:var(--calcite-color-status-success)}:host .instant-apps-social-share__success-message{line-height:16px}:host .instant-apps-social-share__embed{box-sizing:border-box;width:100%;padding:5%;margin-bottom:10px;border-top:1px solid #d3d3d3}:host .instant-apps-social-share__embed-header{display:flex;align-items:center;margin-bottom:5px}:host .instant-apps-social-share__embed-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__embed-code-text-area{border:1px solid #d3d3d3}:host .instant-apps-social-share__embed-code-text-area textarea{box-sizing:border-box;padding:4%;border:none;resize:none;background:transparent;width:100%;font-family:var(--calcite-sans-family);color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button{display:flex;align-items:center;text-align:start;width:100%;border:none;border-top:1px solid #d3d3d3;background-color:transparent;line-height:16px;font-weight:400;padding:3%;color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button calcite-icon{color:#007ac2;margin-right:3px}:host .instant-apps-social-share__embed-code-text-area button:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2);transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__embed-text-area-text{font-weight:600;color:var(--instant-apps-social-share-embed-text-area-text)}:host .instant-apps-social-share__embed .instant-apps-social-share__text-area--rtl{text-align:left}:host .instant-apps-social-share__embed-dimensions{display:flex;justify-content:space-between;margin-top:10px}:host .instant-apps-social-share__embed-dimensions-input{width:47%;box-sizing:border-box}:host .instant-apps-social-share__embed-dimensions-input input{border:1px solid #d3d3d3;width:100%;height:25px;font-family:var(--calcite-sans-family)}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options{display:flex;justify-content:space-around;margin-bottom:8%}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li{flex-direction:column;padding:0}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li .instant-apps-social-share__option-text{word-break:break-word;margin-left:0;margin-top:10px;text-align:center}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li:hover{background-color:unset}:host .instant-apps-social-share__icon-container{display:flex;align-items:center}:host([scale=s]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--s)}:host([scale=s]) .instant-apps-social-share__icon{width:16px;height:16px}:host([scale=s]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size--1)}:host([scale=s]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--s)}:host([scale=s]) .instant-apps-social-share__tip-header,:host([scale=s]) .instant-apps-social-share__tip-content,:host([scale=s]) .instant-apps-social-share__embed-header,:host([scale=s]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--2)}:host([scale=m]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--m)}:host([scale=m]) .instant-apps-social-share__icon{width:24px;height:24px}:host([scale=m]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-0)}:host([scale=m]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--m)}:host([scale=m]) .instant-apps-social-share__tip-header,:host([scale=m]) .instant-apps-social-share__tip-content,:host([scale=m]) .instant-apps-social-share__embed-header,:host([scale=m]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--1)}:host([scale=l]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--l)}:host([scale=l]) .instant-apps-social-share__icon{width:32px;height:32px}:host([scale=l]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-1)}:host([scale=l]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--l)}:host([scale=l]) .instant-apps-social-share__tip-header,:host([scale=l]) .instant-apps-social-share__tip-content,:host([scale=l]) .instant-apps-social-share__embed-header,:host([scale=l]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size-0)}";export{it as calcite_input_date_picker,ct as instant_apps_filter_list,ut as instant_apps_social_share}
@@ -3,7 +3,7 @@
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,h as i,g as s,c as e,H as a,F as o}from"./p-7d280d8a.js";import{c as n}from"./p-1f65ab1e.js";import{c as l,s as c,a as r}from"./p-a4149333.js";import{a as h}from"./p-3dd92f0d.js";import{c as d,u as p,d as m,I as u}from"./p-6d520a58.js";import{c as f,d as v}from"./p-13f2d901.js";import{c as g,s as y,d as b,u as w}from"./p-05cb50f9.js";import{S as x}from"./p-7d04ff20.js";import{l as k,g as L,f as C}from"./p-b04c9dc3.js";import{a as _,g as j,b as I,h as z,d as D}from"./p-96f5be25.js";import{P as E}from"./p-f23e6499.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-ba7d55ea.js";import"./p-e7afc0a8.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-c1cf3ebc.js";
6
+ import{r as t,h as i,g as s,c as e,H as a,F as o}from"./p-7d280d8a.js";import{c as n}from"./p-1f65ab1e.js";import{c as l,s as c,a as r}from"./p-a4149333.js";import{a as h}from"./p-3dd92f0d.js";import{c as d,u as p,d as m,I as u}from"./p-6d520a58.js";import{c as f,d as v}from"./p-13f2d901.js";import{c as g,s as y,d as b,u as w}from"./p-05cb50f9.js";import{S as x}from"./p-7d04ff20.js";import{l as k,g as L,f as C}from"./p-b04c9dc3.js";import{a as _,g as j,b as I,h as z,d as D}from"./p-3eedaead.js";import{P as E}from"./p-f23e6499.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-ba7d55ea.js";import"./p-e7afc0a8.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-c1cf3ebc.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
@@ -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,a as s,h as e,H as a,g as l}from"./p-7d280d8a.js";import{b as o,c as n,a as c}from"./p-c1cf3ebc.js";import{l as h,g as d}from"./p-b04c9dc3.js";import{c as r,h as p}from"./p-96f5be25.js";import{s as g}from"./p-cc280aa1.js";import{c as b,r as m}from"./p-00ba5a2a.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-18f1e8b5.js";import"./p-d89fff3a.js";import"./p-a230b270.js";import"./p-220ec0d1.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._titleValue=void 0,this._numSelected=0,this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}async mapViewWatchHandler(t){(null==t?void 0:t.popup)&&(this._popupsEnabled=null==t?void 0:t.popup.autoOpenEnabled)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);s!==JSON.stringify(i)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){var s;if(this._checkPopups(),(null===(s=this.mapView)||void 0===s?void 0:s.popup)&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,null,e("calcite-shell",null,e("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i]=await h(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils"]);this._geometryEngine=t,this._jsonUtils=i}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return e("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},e("div",{class:"background-override"},e("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},e("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},e("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",src:this._onboardingImageUrl}))}_getSelectionSetList(){return e("div",{class:"padding-top-1-2 padding-bottom-1-2"},e("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{var a;const l=this._getSelectionSetIds(i);let o=!0;return i.workflowType===c.REFINE&&(o=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),o&&t.push(e("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(a=null==i?void 0:i.layerView)||void 0===a?void 0:a.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",l.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==c.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===c.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==c.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return e("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),e("div",null,e("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return e("calcite-panel",null,e("div",null,this._getLabel(this._translations.export,!1),t?e("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),e("div",{class:"padding-sides-1 "+i},e("div",{class:"display-flex"},e("calcite-label",{layout:"inline"},e("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),e("div",{class:"display-flex"},this._translations.removeDuplicate,e("div",{class:"info-message padding-start-1-2"},e("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"remove-duplicates-icon",scale:"s"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},e("span",{class:"tooltip-message"},this._translations.duplicatesTip))),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},e("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},e("span",{class:"font-weight-500"},this._translations.pdf)),e("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},e("span",{class:"font-weight-500"},this._translations.csv)))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},e("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",s=this._addResults?"":"display-none";return e("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),e("div",{class:`padding-top-sides-1 ${s}`},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:`padding-sides-1 ${s}`},e("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:i})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._addMap=!this._addMap}),this._translations.includeMap)))}_getRefinePage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?e("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),e("refine-selection",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,a,l,o){return e("div",{class:"padding-bottom-1"},e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},e("span",{class:"font-weight-500"},t))),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},e("span",{class:"font-weight-500"},a))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{var s;const a=this._getSelectionSetIds(i),l=i.workflowType!==c.REFINE||a.length>0;return!this._downloadActive&&i.download&&l&&(this._downloadActive=!0),l&&t.push(e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),e("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},e("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",a.length.toString()))))))),t}),[])||e("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=null==t?void 0:t.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===c.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const e=null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.id;t=this._updateExportInfos(t,e,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,a,l=!1,o=""){return e("calcite-action",{disabled:!t,icon:i,indicator:l,onClick:a,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){var t,i;const s=await(null===(t=this._selectTools)||void 0===t?void 0:t.getSelection()),e=null===(i=this._selectTools)||void 0===i?void 0:i.isUpdate;return this._selectionSets=e?this._selectionSets.map((t=>t.id===s.id?s:t)):[...this._selectionSets,s],this._home()}async _clearSelection(){var t;await(null===(t=this._selectTools)||void 0===t?void 0:t.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){r(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===c.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(e.ids,e.layerView,this.mapView))}}_checkPopups(){var t;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(t=this.mapView)||void 0===t?void 0:t.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await d(this.el);this._translations=t[0]}get el(){return l(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
6
+ import{r as t,c as i,a as s,h as e,H as a,g as l}from"./p-7d280d8a.js";import{b as o,c as n,a as c}from"./p-c1cf3ebc.js";import{l as h,g as d}from"./p-b04c9dc3.js";import{c as r,h as p}from"./p-3eedaead.js";import{s as g}from"./p-cc280aa1.js";import{c as b,r as m}from"./p-f6536eae.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-18f1e8b5.js";import"./p-d89fff3a.js";import"./p-a230b270.js";import"./p-220ec0d1.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._titleValue=void 0,this._numSelected=0,this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}async mapViewWatchHandler(t){(null==t?void 0:t.popup)&&(this._popupsEnabled=null==t?void 0:t.popup.autoOpenEnabled)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);s!==JSON.stringify(i)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){var s;if(this._checkPopups(),(null===(s=this.mapView)||void 0===s?void 0:s.popup)&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,null,e("calcite-shell",null,e("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i]=await h(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils"]);this._geometryEngine=t,this._jsonUtils=i}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return e("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},e("div",{class:"background-override"},e("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},e("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},e("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",src:this._onboardingImageUrl}))}_getSelectionSetList(){return e("div",{class:"padding-top-1-2 padding-bottom-1-2"},e("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{var a;const l=this._getSelectionSetIds(i);let o=!0;return i.workflowType===c.REFINE&&(o=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),o&&t.push(e("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(a=null==i?void 0:i.layerView)||void 0===a?void 0:a.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",l.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==c.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===c.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==c.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return e("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),e("div",null,e("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return e("calcite-panel",null,e("div",null,this._getLabel(this._translations.export,!1),t?e("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),e("div",{class:"padding-sides-1 "+i},e("div",{class:"display-flex"},e("calcite-label",{layout:"inline"},e("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),e("div",{class:"display-flex"},this._translations.removeDuplicate,e("div",{class:"info-message padding-start-1-2"},e("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"remove-duplicates-icon",scale:"s"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},e("span",{class:"tooltip-message"},this._translations.duplicatesTip))),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},e("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},e("span",{class:"font-weight-500"},this._translations.pdf)),e("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},e("span",{class:"font-weight-500"},this._translations.csv)))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},e("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",s=this._addResults?"":"display-none";return e("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),e("div",{class:`padding-top-sides-1 ${s}`},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:`padding-sides-1 ${s}`},e("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:i})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._addMap=!this._addMap}),this._translations.includeMap)))}_getRefinePage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?e("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),e("refine-selection",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,a,l,o){return e("div",{class:"padding-bottom-1"},e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},e("span",{class:"font-weight-500"},t))),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},e("span",{class:"font-weight-500"},a))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{var s;const a=this._getSelectionSetIds(i),l=i.workflowType!==c.REFINE||a.length>0;return!this._downloadActive&&i.download&&l&&(this._downloadActive=!0),l&&t.push(e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),e("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},e("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",a.length.toString()))))))),t}),[])||e("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=null==t?void 0:t.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===c.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const e=null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.id;t=this._updateExportInfos(t,e,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,a,l=!1,o=""){return e("calcite-action",{disabled:!t,icon:i,indicator:l,onClick:a,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){var t,i;const s=await(null===(t=this._selectTools)||void 0===t?void 0:t.getSelection()),e=null===(i=this._selectTools)||void 0===i?void 0:i.isUpdate;return this._selectionSets=e?this._selectionSets.map((t=>t.id===s.id?s:t)):[...this._selectionSets,s],this._home()}async _clearSelection(){var t;await(null===(t=this._selectTools)||void 0===t?void 0:t.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){r(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===c.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(e.ids,e.layerView,this.mapView))}}_checkPopups(){var t;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(t=this.mapView)||void 0===t?void 0:t.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await d(this.el);this._translations=t[0]}get el(){return l(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
@@ -3,7 +3,7 @@
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 e,H as s,g as a}from"./p-7d280d8a.js";import{u as o,t as n,g as l,x as r}from"./p-3dd92f0d.js";import{g as c}from"./p-495e7b9d.js";import{s as h,a as d,c as p}from"./p-a4149333.js";import{N as u,c as m,d as v}from"./p-13f2d901.js";import{o as g}from"./p-2b0454a0.js";import{c as f,s as b,d as w,u as y}from"./p-05cb50f9.js";import{K as k}from"./p-9d3b46e2.js";import{g as x,l as z}from"./p-b04c9dc3.js";import{a as C}from"./p-96f5be25.js";import{P as _}from"./p-f23e6499.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-e7afc0a8.js";import"./p-1f65ab1e.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-c1cf3ebc.js";
6
+ import{r as t,c as i,h as e,H as s,g as a}from"./p-7d280d8a.js";import{u as o,t as n,g as l,x as r}from"./p-3dd92f0d.js";import{g as c}from"./p-495e7b9d.js";import{s as h,a as d,c as p}from"./p-a4149333.js";import{N as u,c as m,d as v}from"./p-13f2d901.js";import{o as g}from"./p-2b0454a0.js";import{c as f,s as b,d as w,u as y}from"./p-05cb50f9.js";import{K as k}from"./p-9d3b46e2.js";import{g as x,l as z}from"./p-b04c9dc3.js";import{a as C}from"./p-3eedaead.js";import{P as _}from"./p-f23e6499.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-e7afc0a8.js";import"./p-1f65ab1e.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-c1cf3ebc.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
@@ -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 n,h as i,H as s,g as e}from"./p-7d280d8a.js";import{g as o}from"./p-86b21da1.js";import{l as a}from"./p-a8a0187d.js";import{g as r}from"./p-c96eb2db.js";import"./p-14a48b14.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const p="instant-apps-export calcite-mode-light",l="instant-apps-export-print",h="instant-apps-export-print__content-container",c="instant-apps-export-print__extra-container",d="instant-apps-export-print__legend-container",u="instant-apps-export-print__compass-container",v="instant-apps-export-print__scale-bar-container",x="instant-apps-export-print__popup-container",b="instant-apps-export-print__popup-content",_="instant-apps-export-print__popup-title",g="instant-apps-export-print__view",m="instant-apps-export-print__view-container",f="instant-apps-export-print__view-wrapper",w="instant-app-export-drag",k=class{constructor(i){t(this,i),this.exportOutputUpdated=n(this,"exportOutputUpdated",7),this.output=void 0,this.beforeExport=()=>Promise.resolve(),this.popoverIcon="export",this.extraContent=void 0,this.extraContentLabel=void 0,this.headerTitle="",this.includeExtraContent=!0,this.includeLegend=!0,this.includeMap=!0,this.includePopup=!1,this.mode="popover",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.scale="m",this.showHeaderTitle=!0,this.showIncludeLegend=!0,this.showIncludeMap=!1,this.showIncludePopup=!0,this.showScaleBar=!0,this.view=void 0,this.maskBackground="rgba(255, 51, 0, 0.1)",this.maskBorder="2px dashed rgb(255, 51, 0)",this.baseClass=p,this.exportIsLoading=void 0,this.messages=void 0}watchIncludeMap(t){t&&this.updateLegend()}componentWillLoad(){this.baseClass="dark"===r(this.el)?"instant-apps-export calcite-mode-dark":p,o(this),this.initializeModules()}componentDidLoad(){this.printContainerEl.prepend(this.printEl)}disconnectedCallback(){var t,n;null===(t=this.handles)||void 0===t||t.removeAll(),null===(n=this.handles)||void 0===n||n.destroy(),this.handles=null}async initializeModules(){const[t]=await a(["esri/core/Handles"]);return this.handles=new t,Promise.resolve()}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel(),n=this.renderCompass();return i(s,null,i("div",{class:this.baseClass,onMouseEnter:this.handleWidgetCreation.bind(this),onFocusin:this.handleWidgetCreation.bind(this)},t,i("div",{class:"instant-apps-export__visually-hidden"},n)))}renderPopover(){var t,n,s;const e=this.renderPanel();return[i("calcite-popover",{referenceElement:"export-popover-btn",label:null===(t=this.messages)||void 0===t?void 0:t.exportPopover,overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t},e),i("calcite-action",{id:"export-popover-btn",alignment:"center",icon:this.popoverIcon,scale:this.scale,title:null===(n=this.messages)||void 0===n?void 0:n.exportBtn,text:null===(s=this.messages)||void 0===s?void 0:s.exportBtn})]}renderPanel(){var t,n;const s=this.showHeaderTitle?this.renderTitle():null,e=null!=this.extraContent?this.renderSwitch("includeExtraContent",this.extraContentLabel):null,o=this.showIncludeMap?this.renderSwitch("includeMap"):null,a=this.includeMap?this.renderMapOptions():null,r=this.renderPrint();return i("div",{class:"inline"===this.mode?"instant-apps-export__inline-container":"instant-apps-export__popover-container"},s,e,o,a,this.includeMap?i("calcite-button",{appearance:"transparent",width:"full",onClick:this.setMapAreaOnClick.bind(this),disabled:this.exportIsLoading},null===(t=this.messages)||void 0===t?void 0:t.setMapArea):null,i("calcite-button",{width:"full",onClick:this.exportOnClick.bind(this),disabled:this.exportIsLoading},null===(n=this.messages)||void 0===n?void 0:n.export),r)}renderTitle(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.title,i("calcite-input",{value:this.headerTitle,onCalciteInputInput:this.updateHeaderTitle.bind(this)}))}renderSwitch(t,n){var s;const e=null!=n?n:null===(s=this.messages)||void 0===s?void 0:s[t];return i("calcite-label",{layout:"inline-space-between"},e,i("calcite-switch",{checked:this[t],value:t,onCalciteSwitchChange:this.optionOnChange.bind(this)}))}renderMapOptions(){const t=this.showIncludeLegend?this.renderSwitch("includeLegend"):null,n=this.showIncludePopup?this.renderSwitch("includePopup"):null;return i("div",null,t,n)}renderPrint(){const t=this.includeMap?this.renderPrintMap():null,n=this.renderExtraContent(),s=this.includeMap&&this.showIncludeLegend?this.renderLegend():null,e=this.includeMap&&this.showIncludePopup?this.renderPopup():null;return i("div",{ref:t=>this.printContainerEl=t},i("div",{class:l,ref:t=>this.printEl=t},t,s,i("div",{class:h},e,n)))}renderPrintMap(){return i("div",{class:m,ref:t=>this.viewContainerEl=t},i("div",{class:f,ref:t=>this.viewWrapperEl=t},this.headerTitle?i("instant-apps-header",{titleText:this.headerTitle,backgroundColor:"#fff",textColor:"#323232"}):null,i("img",{class:g,ref:t=>this.viewEl=t}),i("div",{class:v,ref:this.handleScaleBarContainerEl.bind(this)})))}renderLegend(){return i("div",{class:d,ref:t=>this.legendContainerEl=t})}renderCompass(){return i("div",{class:u,ref:t=>this.compassContainerEl=t})}renderPopup(){return i("div",{class:x,ref:t=>this.popupContainerEl=t},i("div",{ref:t=>this.popupTitleEl=t,class:_}),i("div",{ref:t=>this.popupContentEl=t,class:b}))}renderExtraContent(){return i("div",{class:c,id:"export-content",ref:t=>this.extraContainerEl=t})}optionOnChange(t){const{checked:n,value:i}=t.target;this[i]=n,this.updateExportOutput()}updateHeaderTitle(t){this.headerTitle=t.target.value,this.updateExportOutput()}async exportOnClick(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}async handleViewExportOnClick(){null!=this.view?(this.addPrintStyling(),document.body.prepend(this.printEl),this.handleExtraContent(),this.includeMap?(this.updatePopupToPrint(),this.viewScreenshot(),this.handleImgLoaded()):this.handleImgLoaded()):null!=this.popoverEl&&(this.popoverEl.open=!1)}addPrintStyling(){null==this.printStyleEl&&(this.printStyleEl=document.createElement("style"),this.printStyleEl.innerHTML='\n @media print {\n @page {\n size: Portrait;\n margin: .25in;\n }\n\n html, body {\n padding: 0;\n margin: 0;\n height: 100%;\n width: 100%;\n }\n\n body > *:not(.instant-apps-export-print) { display: none; }\n }\n\n * {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n }\n\n\n .instant-apps-export-print {\n height: 100%;\n width: 100%;\n position: absolute;\n z-index: -999;\n color: #323232 !important;\n display: grid;\n gap: 24px;\n grid-auto-flow: row;\n --esri-calcite-mode-name: "light";\n }\n\n .instant-apps-export-print, .instant-apps-export-print * {\n box-sizing: border-box;\n }\n\n .instant-apps-export-print__view-section {\n height: 100%;\n }\n\n .instant-apps-export-print__view-container {\n height: 100%;\n width: 100%;\n display: flex;\n justify-content: center;\n }\n\n .instant-apps-export-print__view-wrapper {\n height: fit-content;\n width: fit-content;\n position: relative;\n display: flex;\n flex-direction: column;\n border: 2pt solid #323232;\n overflow: hidden;\n }\n\n .instant-apps-export-print__view {\n object-fit: contain;\n }\n\n .instant-apps-export-print__popup-container {\n height: min-content;\n max-width: 350px;\n display: none;\n color: #323232;\n background: #fff;\n border: 1pt solid #323232;\n break-inside: avoid;\n }\n\n .instant-apps-export-print__popup-title {\n border-bottom: 1pt solid #323232;\n }\n\n .instant-apps-export-print__popup-content {\n background: #fff;\n padding-top: 8pt;\n }\n\n .instant-apps-export-print__popup-content .esri-feature-media__chart {\n background: #fff;\n }\n\n .instant-apps-export-print__legend-container {\n height: min-content;\n background: #fff;\n overflow: unset;\n }\n\n .esri-legend--card, .esri-legend--card__service-content {\n flex-flow: row wrap;\n }\n\n .instant-apps-export-print .esri-widget > *:not(.esri-scale-bar.esri-widget > *) {\n background: #fff;\n color: #323232;\n }\n\n .instant-apps-export-print__popup-content * {\n color: #323232;\n }\n\n .instant-apps-export-print .esri-widget__heading {\n margin: 2pt 7pt;\n padding: 0;\n color: #323232;\n }\n\n .instant-apps-export-print .esri-legend__ramp-label:before {\n border-color: rgba(0,0,0,0) rgba(50,50,50,.8) rgba(0,0,0,0) rgba(0,0,0,0);\n }\n\n .instant-apps-export-print .esri-legend--card__section {\n padding: 4pt 0 4pt;\n min-width: unset;\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__section:first-child {\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service {\n border: none;\n flex: 0 1 auto;\n break-inside: avoid;\n }\n\n .instant-apps-export-print .esri-legend--card {\n border: none;\n gap: 6pt 12pt;\n }\n\n .instant-apps-export-print .esri-legend--card:not(:first-child),\n .instant-apps-export-print .esri-compass.esri-widget:not(:first-child) {\n display: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-container {\n height: unset;\n padding: 0;\n border-bottom: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-text {\n padding-bottom: 0;\n }\n\n .instant-apps-export-print__compass-container {\n position: absolute;\n top: 65px;\n left: 15px;\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n --calcite-ui-icon-color: #000;\n border-radius: 50%;\n height: fit-content;\n }\n\n .instant-apps-export-print__compass-container .esri-compass {\n background: #fff;\n }\n\n .instant-apps-export-print__compass-container .esri-compass__icon.esri-icon-compass {\n color: #000;\n }\n\n .instant-apps-export-print__compass-container.esri-compass.esri-widget--button {\n background: #fff;\n }\n\n .instant-apps-export-print__scale-bar-container {\n width: 100%;\n position: absolute;\n bottom: 15px;\n left: 15px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {\n font-size: 10px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__bar-container:nth-child(1n+3) {\n display: none;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line {\n background-color: rgba(255, 255, 255, 0.66);\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top {\n width: var(--instant-apps-scale-bar-top) !important;\n border-bottom: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom {\n width: var(--instant-apps-scale-bar-bottom) !important;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {\n color: #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:after,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:after {\n background-color: #323232;\n border-right: 2px solid #323232;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__item-navigation {\n display: none;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__chart.esri-feature-media__chart--rendered * {\n width: 100%!important;\n }\n\n .instant-apps-export-print__popup-content .esri-popup__content {\n margin: 0;\n }\n\n .instant-apps-export-print__content-container {\n display: flex;\n gap: 24px;\n break-inside: avoid;\n break-before: auto;\n }',document.body.prepend(this.printStyleEl))}handleImgLoaded(){this.exportIsLoading=!0,setTimeout((()=>{this.exportIsLoading=void 0,this.setupViewPrintElements()}),1500)}handleExtraContent(){const t=this.printEl.querySelector("#export-content");null!=t&&(t.innerHTML="",null!=this.extraContent&&this.includeExtraContent?(t.style.display="block",t.append(this.extraContent.cloneNode(!0))):t.style.display="none")}resetPrintContent(){var t,n;if(null!=this.view){this.screenshot=null,null===(t=this.printContainerEl)||void 0===t||t.prepend(this.printEl),null===(n=this.printStyleEl)||void 0===n||n.remove(),this.printStyleEl=void 0;const i=this.printEl.querySelector("#export-content");i&&(i.innerHTML="")}}async updatePopupToPrint(){var t,n;if(null!=this.view&&(null!=this.popupContainerEl&&(this.popupContainerEl.style.display=this.includePopup&&this.view.popup.visible?"block":"none",this.checkPopupOpen()),this.view.popup.visible&&null!=this.view.popup.selectedFeature)){const i=document.createElement(`h${null!==(t=this.view.popup.headingLevel)&&void 0!==t?t:2}`);i.innerHTML=null!==(n=this.view.popup.title)&&void 0!==n?n:"",i.className="esri-widget__heading esri-popup__header-title",null!=this.popupTitleEl&&(this.popupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupTitleEl.innerHTML="",this.popupTitleEl.prepend(i))}}updateExportOutput(){this.output={},this.showHeaderTitle&&(this.output.headerTitle=this.headerTitle),this.showIncludeLegend&&(this.output.includeLegend=this.includeLegend),this.showIncludeMap&&(this.output.includeMap=this.includeMap),this.showIncludePopup&&(this.output.includePopup=this.includePopup),this.exportOutputUpdated.emit()}setupViewPrintElements(){if(null!=this.view){this.handleLegendSetup();const t=document.title;this.showHeaderTitle&&this.headerTitle&&(document.title=this.headerTitle),window.print(),document.title=t,setTimeout((()=>{this.resetPrintContent()}),1e3)}}handleLegendSetup(){this.showIncludeLegend&&null!=this.view&&this.includeMap&&null!=this.legendContainerEl&&(this.legendContainerEl.style.display=this.includeLegend?"block":"none")}handleWidgetCreation(){this.handleLegendCreation(),this.handleCompassCreation()}handleLegendCreation(){var t,n;if(this.includeMap&&null!=this.view&&this.showIncludeLegend&&null!=this.legendContainerEl){const i=this.view.map,s=null===(n=null===(t=this.legend)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null==i?void 0:i.portalItem.id)===(null==s?void 0:s.portalItem.id)||this.updateLegend()}}updateLegend(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;if(null===(n=this.legend)||void 0===n||n.destroy(),null!=this.legendContainerEl){this.legendContainerEl.innerHTML="";const[n]=await a(["esri/widgets/Legend"]);this.legend=new n({container:this.legendContainerEl,view:t,style:{type:"card",layout:"side-by-side"}})}}))}handleCompassCreation(){var t,n;if(this.includeMap&&null!=this.view&&null!=this.compassContainerEl){const i=this.view.map,s=null===(n=null===(t=this.compass)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null==i?void 0:i.portalItem.id)===(null==s?void 0:s.portalItem.id)||this.updateCompass()}}updateCompass(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.compass)||void 0===n||n.destroy(),this.compass=null;const i=document.createElement("div");this.compassContainerEl.append(i);const[s]=await a(["esri/widgets/Compass"]);this.compass=new s({container:i,view:t})}))}updateScaleBar(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.scaleBar)||void 0===n||n.destroy(),this.scaleBar=null;const[i]=await a(["esri/widgets/ScaleBar"]);this.scaleBar=new i({container:this.scaleBarContainerEl,unit:"dual",view:t})}))}async viewScreenshot(){if(null!=this.view&&this.includeMap&&(null==this.screenshot&&(this.screenshot=await this.view.takeScreenshot({width:2*this.view.width,height:2*this.view.height})),this.handleScaleBarSize(),null!=this.viewEl&&null!=this.viewWrapperEl)){const{height:t,width:n}=this.screenshot.data;t>n?this.setMaxRowHeightOnViewContainer():this.setMaxWidthOnViewContainer(),this.viewEl.src=this.screenshot.dataUrl}}setMaxRowHeightOnViewContainer(){this.printEl.style.gridTemplateRows="minmax(auto, 70%)",this.viewEl.style.height="100%",this.viewEl.style.width="",this.viewWrapperEl.style.height="100%",this.viewWrapperEl.style.width="fit-content"}setMaxWidthOnViewContainer(){this.printEl.style.gridTemplateRows="",this.viewEl.style.width="100%",this.viewEl.style.height="",this.viewWrapperEl.style.height="fit-content",this.viewWrapperEl.style.width="100%"}checkPopupOpen(){if(null!=this.view){const t=this.view.popup.container,n=null==t?void 0:t.querySelector(".esri-popup .esri-feature__main-container");if(null!=n){const t=n.querySelectorAll("canvas");this.popupContentEl.innerHTML="",this.popupContentEl.append(n.cloneNode(!0));const i=this.popupContentEl.querySelectorAll("canvas");t.forEach(((t,n)=>{var s;const e=t.toDataURL(),o=document.createElement("img");o.src=e;const a=t.getAttribute("style");a&&o.setAttribute("style",a);const r=i[n];null!=r&&(r.replaceWith(o),document.querySelector("link[href*='esri/themes/dark/main.css']")&&null!=(null===(s=o.parentElement)||void 0===s?void 0:s.parentElement)&&(o.parentElement.style.background="#242424",o.parentElement.parentElement.style.background="#242424"))}))}}}createScreenshot(){var t,n;if(null!=this.view){this.screenshotPreview=document.createElement("div"),this.screenshotPreview.className="screenshot-preview hide",this.screenshotImgContainer=document.createElement("div"),this.screenshotImgContainer.className="screenshot-img-container",this.screenshotImg=document.createElement("img");const i=document.createElement("div"),s=document.createElement("calcite-button"),e=document.createElement("calcite-button");s.innerHTML=null===(t=this.messages)||void 0===t?void 0:t.export,e.innerHTML=null===(n=this.messages)||void 0===n?void 0:n.returnToMap,e.appearance="outline-fill",s.onclick=this.exportOnClick.bind(this),e.onclick=this.screenshotReturn.bind(this),i.append(e,s),this.screenshotImgContainer.append(this.screenshotImg,i),this.screenshotPreview.append(this.screenshotImgContainer),this.view.container.append(this.screenshotPreview)}}createMaskDiv(){null!=this.view&&(this.maskDivEl=document.createElement("div"),this.maskDivEl.id="screenshot-mask",this.maskDivEl.className="hide screenshot-cursor",this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-background",this.maskBackground),this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-border",this.maskBorder),this.screenshotStyle=document.createElement("style"),this.screenshotStyle.innerHTML="\n.screenshot-preview.hide, .hide {\n display: none;\n}\n\n.screenshot-cursor {\n cursor: crosshair;\n}\n\n.relative {\n position: relative;\n}\n\n#screenshot-mask {\n position: absolute;\n background: var(--instant-apps-screenshot-mask-background);\n border: var(--instant-apps-screenshot-mask-border);\n}\n\n.screenshot-preview {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n text-align: center;\n background-color: rgba(0, 0, 0, 0.75);\n}\n\n.screenshot-preview * {\n box-sizing: border-box;\n}\n\n.screenshot-img-container img {\n max-height: 75%;\n max-width: 75%;\n object-fit: contain;\n border: 10px solid white;\n box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.5);\n margin-bottom: 0.5em;\n}\n\n.screenshot-img-container {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n margin-bottom: 8px;\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n}\n\n.screenshot-img-container calcite-button {\n margin: 5px;\n}\n",this.view.container.append(this.screenshotStyle),this.view.container.append(this.maskDivEl))}screenshotReturn(){this.removeScreenshotElements(),this.exportIsLoading=!1,this.screenshot=null}setMapAreaOnClick(){null!=this.view&&(this.exportIsLoading=!0,this.createMaskDiv(),this.createScreenshot(),this.view.container.classList.add("screenshot-cursor","relative"),this.view.addHandles(this.view.on("drag",(async t=>{null!=this.view&&(t.stopPropagation(),"end"!==t.action?this.updateMaskSize(t):this.maskScreenshot())})),w))}updateMaskSize(t){if(null!=this.view){const n=this.clamp(Math.min(t.origin.x,t.x),0,this.view.width),i=this.clamp(Math.max(t.origin.x,t.x),0,this.view.width),s=this.clamp(Math.min(t.origin.y,t.y),0,this.view.height),e=this.clamp(Math.max(t.origin.y,t.y),0,this.view.height);this.area={x:n,y:s,width:i-n,height:e-s},this.setMaskPosition(this.area)}}maskScreenshot(){null!=this.view&&null!=this.area&&(this.view.removeHandles(w),this.view.takeScreenshot({area:this.area,width:2*this.area.width,height:2*this.area.height,format:"jpg"}).then((t=>{var n;this.screenshot=t,this.showPreview(),null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null)})))}setMaskPosition(t){null!=t?(this.maskDivEl.classList.remove("hide"),this.maskDivEl.style.left=`${t.x}px`,this.maskDivEl.style.top=`${t.y}px`,this.maskDivEl.style.width=`${t.width}px`,this.maskDivEl.style.height=`${t.height}px`):this.maskDivEl.remove()}clamp(t,n,i){return t<n?n:t>i?i:t}showPreview(){this.screenshotPreview.classList.remove("hide"),null!=this.screenshotImg&&null!=this.screenshot&&(this.screenshotImg.src=this.screenshot.dataUrl)}handleScaleBarSize(){var t;if(this.showScaleBar&&"2d"===(null===(t=this.view)||void 0===t?void 0:t.type)&&null!=this.scaleBarContainerEl){const t=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--top"),n=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--bottom");this.setScalebarWidth(t,"top"),this.setScalebarWidth(n,"bottom")}}setScalebarWidth(t,n){if(null!=t&&null!=this.screenshot){const i=this.screenshot.data.width/2,s=Number(t.style.width.replace("px",""));t.style.setProperty(`--instant-apps-scale-bar-${n}`,s/i*100+"%")}}removeScreenshotElements(){var t,n;null===(t=this.screenshotPreview)||void 0===t||t.remove(),null===(n=this.screenshotStyle)||void 0===n||n.remove()}handleScaleBarContainerEl(t){var n,i,s;if(this.showScaleBar&&"2d"===(null===(n=this.view)||void 0===n?void 0:n.type)){const n=this.view.map,e=null===(s=null===(i=this.scaleBar)||void 0===i?void 0:i.view)||void 0===s?void 0:s.map;this.scaleBarContainerEl=t,(null==n?void 0:n.portalItem.id)===(null==e?void 0:e.portalItem.id)||this.updateScaleBar()}}get el(){return e(this)}static get watchers(){return{includeMap:["watchIncludeMap"]}}};k.style=":host{display:block;--instant-apps-export-action-background:var(--calcite-color-foreground-1);--instant-apps-export-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-export-action-background-press:var(--calcite-color-foreground-3);--instant-apps-export-action-height:100%;--instant-apps-export-action-width:fit-content;--instant-apps-export-action-icon-color:var(--calcite-color-text-3);--instant-apps-export-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-export-background:var(--calcite-color-foreground-1);--instant-apps-export-text-color:var(--calcite-color-text-1);--instant-apps-export-popover-width:250px}.instant-apps-export{height:100%}.instant-apps-export *{box-sizing:border-box}.instant-apps-export__popover-container,.instant-apps-export__inline-container{padding:12px;background:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export__popover-container{width:var(--instant-apps-export-popover-width)}.instant-apps-export calcite-action{height:var(--instant-apps-export-action-height);width:var(--instant-apps-export-action-width);--calcite-color-foreground-1:var(--instant-apps-export-action-background);--calcite-color-foreground-2:var(--instant-apps-export-action-background-hover);--calcite-color-foreground-3:var(--instant-apps-export-action-background-press);--calcite-color-text-3:var(--instant-apps-export-action-icon-color);--calcite-color-text-1:var(--instant-apps-export-action-icon-hover-color)}.instant-apps-export .instant-apps-export-print{display:none}.instant-apps-export__visually-hidden{position:absolute;top:0;z-index:-1;visibility:hidden}.instant-apps-export calcite-input{--calcite-color-foreground-1:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export calcite-popover{--calcite-color-foreground-1:var(--instant-apps-export-background)}.instant-apps-export calcite-switch{--calcite-color-foreground-1:#fff;--calcite-color-foreground-2:#f3f3f3}.instant-apps-export calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-export .calcite-mode-dark calcite-switch{--calcite-color-foreground-1:#2b2b2b;--calcite-color-foreground-2:#202020}.instant-apps-export__compass-container.esri-widget{background:#fff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.instant-apps-export__compass-container.esri-widget .esri-compass__icon.esri-icon-compass{color:#6e6e6e}.hide{display:none}.screenshotCursor{cursor:crosshair}";export{k as instant_apps_export}