@esri/solutions-components 0.11.19 → 0.11.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{asyncToGenerator-f169429a.js → asyncToGenerator-c7fc3ee4.js} +1 -1
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +2 -2
- package/dist/cjs/buffer-tools_2.cjs.entry.js +4 -3
- package/dist/cjs/card-manager_3.cjs.entry.js +4 -4
- package/dist/cjs/consent-manager.cjs.entry.js +4 -4
- package/dist/cjs/create-feature_4.cjs.entry.js +45 -44
- package/dist/cjs/create-related-feature_3.cjs.entry.js +2 -2
- package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -5
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +5 -4
- package/dist/cjs/delete-dialog.cjs.entry.js +2 -2
- package/dist/cjs/{downloadUtils-b269c7a1.js → downloadUtils-fcae8eb1.js} +3 -3
- package/dist/cjs/{effects-2f75069e.js → effects-3607d1ba.js} +1 -1
- package/dist/cjs/feature-list.cjs.entry.js +5 -5
- package/dist/cjs/{helpers-69e520bd.js → helpers-8d452256.js} +2 -2
- package/dist/cjs/{index.es-644259ff.js → index.es-3c2404c3.js} +2 -2
- package/dist/cjs/instant-apps-app-guide.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +5 -5
- package/dist/cjs/instant-apps-control-panel.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-create.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-export-views.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-export.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-filter-list_2.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-header.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-language-translator.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-measurement-tool.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-measurement.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-popover.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-sign-in.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-splash.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-time-filter.cjs.entry.js +5 -5
- package/dist/cjs/json-editor_7.cjs.entry.js +2 -2
- package/dist/cjs/{languageSwitcher-c8e62594.js → languageSwitcher-19a22439.js} +1 -1
- package/dist/cjs/{languageUtil-bd49af69.js → languageUtil-a3e1eafd.js} +1 -1
- package/dist/cjs/{loadModules-3b29fa24.js → loadModules-e9d8977c.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{locale-905e6063.js → locale-1c60be9c.js} +1 -1
- package/dist/cjs/{locale-c923d7b6.js → locale-da41a06f.js} +2 -2
- package/dist/cjs/map-layer-picker.cjs.entry.js +2 -2
- package/dist/cjs/map-select-tools_3.cjs.entry.js +4 -4
- package/dist/cjs/{popupUtils-5378e04a.js → popupUtils-87b006a6.js} +2 -2
- package/dist/cjs/public-notification.cjs.entry.js +4 -4
- package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/solution-item-accordion.cjs.entry.js +2 -2
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +2 -2
- package/dist/cjs/{utils-3739960f.js → utils-3e512114.js} +1 -1
- package/dist/collection/assets/t9n/create-feature/resources.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_en.json +1 -1
- package/dist/collection/components/create-feature/create-feature.js +130 -110
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +2 -3
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +22 -2
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +2 -1
- package/dist/components/create-feature2.js +48 -46
- package/dist/components/crowdsource-manager.js +2 -3
- package/dist/components/crowdsource-reporter.js +4 -2
- package/dist/components/map-draw-tools2.js +2 -1
- package/dist/esm/{asyncToGenerator-e51717ed.js → asyncToGenerator-96b2368d.js} +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +2 -2
- package/dist/esm/buffer-tools_2.entry.js +4 -3
- package/dist/esm/card-manager_3.entry.js +4 -4
- package/dist/esm/consent-manager.entry.js +4 -4
- package/dist/esm/create-feature_4.entry.js +45 -44
- package/dist/esm/create-related-feature_3.entry.js +2 -2
- package/dist/esm/crowdsource-manager.entry.js +4 -5
- package/dist/esm/crowdsource-reporter.entry.js +5 -4
- package/dist/esm/delete-dialog.entry.js +2 -2
- package/dist/esm/{downloadUtils-d04d4095.js → downloadUtils-078cd709.js} +3 -3
- package/dist/esm/{effects-602e7b51.js → effects-38bc1195.js} +1 -1
- package/dist/esm/feature-list.entry.js +5 -5
- package/dist/esm/{helpers-520f100c.js → helpers-15d5cd56.js} +2 -2
- package/dist/esm/{index.es-ca80d0c5.js → index.es-87662946.js} +2 -2
- package/dist/esm/instant-apps-app-guide.entry.js +4 -4
- package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +5 -5
- package/dist/esm/instant-apps-control-panel.entry.js +2 -2
- package/dist/esm/instant-apps-create.entry.js +4 -4
- package/dist/esm/instant-apps-export-views.entry.js +4 -4
- package/dist/esm/instant-apps-export.entry.js +4 -4
- package/dist/esm/instant-apps-filter-list_2.entry.js +4 -4
- package/dist/esm/instant-apps-header.entry.js +2 -2
- package/dist/esm/instant-apps-interactive-legend-classic.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend.entry.js +6 -6
- package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +4 -4
- package/dist/esm/instant-apps-language-switcher.entry.js +6 -6
- package/dist/esm/instant-apps-language-translator.entry.js +6 -6
- package/dist/esm/instant-apps-measurement-tool.entry.js +2 -2
- package/dist/esm/instant-apps-measurement.entry.js +4 -4
- package/dist/esm/instant-apps-popover.entry.js +4 -4
- package/dist/esm/instant-apps-scoreboard.entry.js +4 -4
- package/dist/esm/instant-apps-sign-in.entry.js +4 -4
- package/dist/esm/instant-apps-splash.entry.js +4 -4
- package/dist/esm/instant-apps-time-filter.entry.js +5 -5
- package/dist/esm/json-editor_7.entry.js +2 -2
- package/dist/esm/{languageSwitcher-ccdf79d4.js → languageSwitcher-49bad3f4.js} +1 -1
- package/dist/esm/{languageUtil-2bac3910.js → languageUtil-2b6e191a.js} +1 -1
- package/dist/esm/{loadModules-1b0b108c.js → loadModules-947ccfd4.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{locale-15e42305.js → locale-7874c756.js} +1 -1
- package/dist/esm/{locale-29d08ded.js → locale-e02b0e14.js} +2 -2
- package/dist/esm/map-layer-picker.entry.js +2 -2
- package/dist/esm/map-select-tools_3.entry.js +4 -4
- package/dist/esm/{popupUtils-b71abb01.js → popupUtils-6a965512.js} +2 -2
- package/dist/esm/public-notification.entry.js +4 -4
- package/dist/esm/solution-configuration.entry.js +2 -2
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/solution-item-accordion.entry.js +2 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +2 -2
- package/dist/esm/{utils-89be1743.js → utils-6fe5b5fa.js} +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_en.json +1 -1
- package/dist/solutions-components/{p-d885880a.entry.js → p-00ec642f.entry.js} +1 -1
- package/dist/solutions-components/p-02c4e6fc.entry.js +6 -0
- package/dist/solutions-components/{p-0132213f.entry.js → p-0326f1f4.entry.js} +1 -1
- package/dist/solutions-components/{p-438fdc33.js → p-08ad0b7a.js} +1 -1
- package/dist/solutions-components/{p-0607044f.js → p-174fa218.js} +1 -1
- package/dist/solutions-components/{p-7bf7d67b.js → p-1e1dfef6.js} +1 -1
- package/dist/solutions-components/{p-2d8300ba.entry.js → p-244316dd.entry.js} +1 -1
- package/dist/solutions-components/p-2460cf10.entry.js +6 -0
- package/dist/solutions-components/{p-8f973b3d.js → p-2884ca49.js} +1 -1
- package/dist/solutions-components/{p-3f8b1062.entry.js → p-3ce5c7fd.entry.js} +1 -1
- package/dist/solutions-components/{p-a397e773.js → p-404cbf48.js} +1 -1
- package/dist/solutions-components/{p-f292f56e.entry.js → p-41a3b49a.entry.js} +1 -1
- package/dist/solutions-components/{p-f457e8be.entry.js → p-443168f0.entry.js} +1 -1
- package/dist/solutions-components/{p-86b6f918.entry.js → p-4ced7b11.entry.js} +1 -1
- package/dist/solutions-components/{p-2a1ed83a.entry.js → p-4d5dd39e.entry.js} +1 -1
- package/dist/solutions-components/{p-e79b69e6.entry.js → p-4e7514a3.entry.js} +1 -1
- package/dist/solutions-components/{p-34338938.entry.js → p-4f7fb338.entry.js} +1 -1
- package/dist/solutions-components/{p-edfcce2c.entry.js → p-5786b9da.entry.js} +1 -1
- package/dist/solutions-components/{p-b8f29a99.entry.js → p-5a202f3f.entry.js} +1 -1
- package/dist/solutions-components/{p-fdf0d66f.entry.js → p-65105504.entry.js} +1 -1
- package/dist/solutions-components/{p-532ed572.entry.js → p-698656b8.entry.js} +1 -1
- package/dist/solutions-components/{p-dbf2c455.entry.js → p-7251848d.entry.js} +1 -1
- package/dist/solutions-components/{p-b6a6fdcf.entry.js → p-72d04c7a.entry.js} +1 -1
- package/dist/solutions-components/{p-099379e6.entry.js → p-832707fd.entry.js} +1 -1
- package/dist/solutions-components/{p-8db12ee9.entry.js → p-837e0939.entry.js} +1 -1
- package/dist/solutions-components/{p-cd38fc53.js → p-84bb6925.js} +1 -1
- package/dist/solutions-components/{p-436b869c.entry.js → p-8859b622.entry.js} +1 -1
- package/dist/solutions-components/p-89fbc318.js +6 -0
- package/dist/solutions-components/{p-0b1c830a.entry.js → p-8a010f9e.entry.js} +1 -1
- package/dist/solutions-components/{p-6ac03d17.entry.js → p-8dd677dd.entry.js} +1 -1
- package/dist/solutions-components/{p-37cc79c6.entry.js → p-9927342d.entry.js} +1 -1
- package/dist/solutions-components/{p-c3aac15b.entry.js → p-a277d08c.entry.js} +1 -1
- package/dist/solutions-components/{p-2d3b8412.entry.js → p-a5eaf7fe.entry.js} +1 -1
- package/dist/solutions-components/{p-da1e4ff1.entry.js → p-aad84d69.entry.js} +1 -1
- package/dist/solutions-components/{p-3423b5ef.js → p-ac122d9e.js} +1 -1
- package/dist/solutions-components/{p-59a1c5a9.entry.js → p-b394f504.entry.js} +1 -1
- package/dist/solutions-components/{p-97abbf8f.entry.js → p-ba4e219a.entry.js} +1 -1
- package/dist/solutions-components/{p-258aa58e.js → p-bf04c6f4.js} +2 -2
- package/dist/solutions-components/{p-4454af38.entry.js → p-c6c697e5.entry.js} +1 -1
- package/dist/solutions-components/{p-dda0aa41.entry.js → p-d324196d.entry.js} +1 -1
- package/dist/solutions-components/{p-f93a9d92.js → p-d65f8b73.js} +1 -1
- package/dist/solutions-components/{p-36e3b39c.js → p-db3391b9.js} +2 -2
- package/dist/solutions-components/{p-039ab075.js → p-dc188d13.js} +1 -1
- package/dist/solutions-components/{p-04277d48.entry.js → p-de42e8b2.entry.js} +1 -1
- package/dist/solutions-components/p-ea566af0.entry.js +6 -0
- package/dist/solutions-components/{p-29baf8a2.entry.js → p-eb3c867f.entry.js} +1 -1
- package/dist/solutions-components/{p-d45b0400.entry.js → p-ed1ecb5b.entry.js} +1 -1
- package/dist/solutions-components/{p-1054e10a.entry.js → p-ee3bb943.entry.js} +1 -1
- package/dist/solutions-components/{p-0ea99464.entry.js → p-f165921f.entry.js} +1 -1
- package/dist/solutions-components/{p-f36b4778.entry.js → p-f75786a8.entry.js} +1 -1
- package/dist/solutions-components/{p-2a7f23fc.entry.js → p-f956c598.entry.js} +1 -1
- package/dist/solutions-components/{p-2cb8c175.entry.js → p-fa663804.entry.js} +1 -1
- package/dist/solutions-components/{p-6e879de9.entry.js → p-ff317687.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components_commit.txt +7 -7
- package/dist/types/components/create-feature/create-feature.d.ts +54 -50
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +4 -0
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-04546ef6.js +0 -6
- package/dist/solutions-components/p-1adc6874.entry.js +0 -6
- package/dist/solutions-components/p-ba472e45.entry.js +0 -6
- package/dist/solutions-components/p-f99a78f1.entry.js +0 -6
- /package/dist/cjs/{esri-loader-1e8cc247.js → esri-loader-08dc41bd.js} +0 -0
- /package/dist/cjs/{typeof-eba0a941.js → typeof-2a7e2dec.js} +0 -0
- /package/dist/esm/{esri-loader-d10d860d.js → esri-loader-c6842c6b.js} +0 -0
- /package/dist/esm/{typeof-a3e780e1.js → typeof-ef2a007d.js} +0 -0
- /package/dist/solutions-components/{p-3b3f77bc.js → p-0a24ad5f.js} +0 -0
- /package/dist/solutions-components/{p-19bce2cc.js → p-4fe489cf.js} +0 -0
@@ -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{b as n}from"./p-
|
6
|
+
import{b as n}from"./p-2884ca49.js";import{c as t}from"./p-8717729a.js";var e,l,a,o;!function(n){n.User="user",n.Translation="translation"}(e||(e={})),function(n){n.String="string",n.TextEditor="textEditor"}(l||(l={})),function(n){n.ExpandCollapse="list-merge",n.SettingIndicator="list-button",n.Popover="information",n.Expanded="chevron-down",n.Collapsed="chevron-right",n.Copy="copy-to-clipboard",n.Breadcrumb="chevron-right",n.DefaultIcon="language",n.Title="title",n.Subtitle="subheading",n.Text="text",n.Description="description",n.Button="button",n.String="string"}(a||(a={})),function(n){n.Light="calcite-mode-light",n.Dark="calcite-mode-dark"}(o||(o={}));const u=t({uiData:null,currentLanguage:null,lastSave:null,saving:!1,currentLocaleSettingItem:null,portalItemResource:null,portalItemResourceT9n:null}),c=u.state,i=u;function r(n,t){var e;if(!n)return;const l=i.get("uiData"),a=new Map;a.set("locales",t),a.set("translatedLanguageLabels",Object.assign({},n.translatedLanguageLabels)),n.content.forEach((n=>{var t,e;const{type:o,label:u,value:c,uiLocation:i}=n,r=null==l?void 0:l.get(n.id);a.set(n.id,{userLocaleData:{type:null!=o?o:null,label:null!=u?u:null,value:null!=c?c:null},expanded:!0,selected:null!==(t=null==r?void 0:r.selected)&&void 0!==t&&t,uiLocation:i,tip:null!==(e=null==n?void 0:n.tip)&&void 0!==e?e:null})}));const o=n.content.map((n=>n.id)),u=o.every((n=>!a.get(n).selected)),c=a.get(o[0]);if(u&&c){const n=null==l?void 0:l.get(o[0]);c.selected=null===(e=null==n?void 0:n.selected)||void 0===e||e}return a}async function s(t){return(await n(t))[0]}function d(){var n;const t=[];return null===(n=c.uiData)||void 0===n||n.forEach(((n,e)=>{"locales"!==e&&"translatedLanguageLabels"!==e&&t.push(e)})),t}function v(n,t){const e=i.get("portalItemResourceT9n");let l;return(null==e?void 0:e[n])||(e[n]={}),l=Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},e[n]),t)}),l}function p(n){var t;return null!==(t=null==n?void 0:n.map((n=>n.locale)))&&void 0!==t?t:[]}function g(){return document.body.classList.contains(o.Dark)}function f(){const n=document.createElement("style");n.innerHTML="\n .instant-apps-language-translator-item__nested-input .ck.ck-reset.ck-editor.ck-rounded-corners {\n margin-left: 30px !important;\n }\n",document.head.appendChild(n)}async function m(n){const t=i.get("portalItemResourceT9n"),e=Date.now();i.set("lastSave",e);const l=JSON.stringify(Object.assign(Object.assign({},t),{lastSave:e})),a=new Blob([l],{type:"application/json"});n.update(a)}export{a as E,r as a,p as b,d as c,l as d,g as e,o as f,s as g,e as h,f as i,v as j,c as l,i as s,m as u}
|
@@ -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 e,c as t,g as i,h as s,H as o}from"./p-e996c38f.js";import{g as a}from"./p-
|
6
|
+
import{r as e,c as t,g as i,h as s,H as o}from"./p-e996c38f.js";import{g as a}from"./p-404cbf48.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const n=class{constructor(i){e(this,i),this.solutionItemHover=t(this,"solutionItemHover",7),this.solutionItemSelect=t(this,"solutionItemSelect",7),this.solutionTypeHover=t(this,"solutionTypeHover",7),this.locale=void 0,this.listSelectionMode="none",this.templateInfos=[],this._sortedTemplateInfos=[],this._translations=void 0}get el(){return i(this)}_sortOrder=["Hub Site Application","Hub Page","Web Experience","Instant App","Web Mapping Application","Dashboard","StoryMap","Form","QuickCapture Project","Workflow","Big Data Analytic (hosted)","Real Time Analytic (hosted)","Feed (hosted)","Tool","Notebook","Data Pipeline","Project Package","Desktop Application Template","TypeNotFound","Web Map","Web Scene","Feature Layer (hosted, view)","Feature Layer (hosted)","Table (hosted, view)","Table (hosted)","Tile Layer","CSV","Microsoft Excel","Microsoft Word","Report Template","Rule Package","Group"];async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async templateInfosWatchHandler(){this._sortedTemplateInfos=this._sortTemplates()}async deselectAll(){"single"!==this.listSelectionMode&&"single-persist"!==this.listSelectionMode||this.el.shadowRoot.querySelectorAll("calcite-list-item").forEach((e=>{e.selected&&(e.selected=!1,e.parentElement.parentElement.expanded=!1)}))}async selectItem(e){"single"!==this.listSelectionMode&&"single-persist"!==this.listSelectionMode||this.el.shadowRoot.querySelectorAll("calcite-list-item").forEach((t=>{t.id===e&&(t.selected=!0,t.parentElement.parentElement.expanded=!0)}))}solutionItemHover;solutionItemSelect;solutionTypeHover;async componentWillLoad(){this._sortedTemplateInfos=this._sortTemplates(),await this._getTranslations()}render(){return s(o,{key:"23845e68bd1920f17f27b1679df20915230f99c3"},this._getAccordion())}_deselectOthers(e){"single"!==this.listSelectionMode&&"single-persist"!==this.listSelectionMode||this.el.shadowRoot.querySelectorAll("calcite-list-item").forEach((t=>{t.id!==e&&(t.selected=!1)}))}_getAccordion(){const e=[],t=this._sortedTemplateInfos.reduce(((t,i)=>{const s=this._getTypeForDisplay(i.type,i.typeKeywords);return e.indexOf(s)<0&&(e.push(s),t.push(this._getAccordionItem(i))),t}),[]);return s("calcite-accordion",{class:"border-override",selectionMode:"single"},t)}_getAccordionItem(e){const t=this._getTypeForDisplay(e.type,e.typeKeywords),i=this._sortedTemplateInfos.filter((e=>this._getTypeForDisplay(e.type,e.typeKeywords)===t));return s("calcite-accordion-item",{description:`${t} (${i.length})`,onMouseEnter:()=>this.solutionTypeHover.emit({itemType:t,entering:!0}),onMouseLeave:()=>this.solutionTypeHover.emit({itemType:t,entering:!1})},s("solution-item-icon",{class:"padding-start-1 display-flex align-center",slot:"actions-start",type:e.type,typeKeywords:e.typeKeywords}),this._getList(i))}_getList(e){const t=this._sortTemplatesByTitle(e);return s("calcite-list",{label:"",selectionAppearance:"border",selectionMode:this.listSelectionMode},t.map((e=>this._getListItem(e))))}_getListItem(e){return s("calcite-list-item",{description:e.snippet,id:e.id,label:e.title,onCalciteListItemSelect:()=>{this._deselectOthers(e.id),this.solutionItemSelect.emit({itemId:e.id,selected:!0})},onMouseEnter:()=>this.solutionItemHover.emit({itemId:e.id,entering:!0}),onMouseLeave:()=>this.solutionItemHover.emit({itemId:e.id,entering:!1}),value:e.id},e.url?s("div",{slot:"actions-end"},s("calcite-action",{icon:"launch",id:e.id+"-launch",onClick:()=>window.open(e.url,"_blank"),text:""}),s("calcite-tooltip",{"overlay-positioning":"fixed","reference-element":e.id+"-launch"},s("span",null,this._translations?.openDetails))):null)}_sortTemplatesByTitle(e){return e.sort(((e,t)=>e.title<t.title?-1:e.title>t.title?1:0))}_sortTemplates(){return this.templateInfos.sort(((e,t)=>{const i=this._getTypeForSort(e),s=this._getTypeForSort(t);return this._sortOrder.indexOf(i)-this._sortOrder.indexOf(s)}))}_getTypeForSort(e){let t=this._getTypeForDisplay(e.type,e.typeKeywords);return this._sortOrder.indexOf(t)<0&&(t="TypeNotFound"),t}_getTypeForDisplay(e,t){let i=e;if("Feature Service"===e){const e=t.indexOf("View Service")>-1,s=t.indexOf("Table")>-1;i=e&&s?"Table (hosted, view)":s?"Table (hosted)":e?"Feature Layer (hosted, view)":"Feature Layer (hosted)"}return"Web Mapping Application"===e&&(i=t.indexOf("configurableApp")>-1?"Instant App":i),i="Geoprocessing Service"===e?"Tool":i,i="Feed"===e?"Feed (hosted)":i,i="Real Time Analytic"===e?"Real Time Analytic (hosted)":i,i="Big Data Analytic"===e?"Big Data Analytic (hosted)":i,i="Vector Tile Service"===e?"Tile Layer":i,i}async _getTranslations(){const e=await a(this.el);this._translations=e[0]}static get watchers(){return{locale:["localeWatchHandler"],templateInfos:["templateInfosWatchHandler"]}}};n.style=":host{display:block}.padding-start-1{padding-inline-start:1rem}.border-override{--calcite-accordion-border-color:var(--calcite-color-border-1) !important}.display-flex{display:flex}.align-center{align-items:center}";export{n as solution_item_accordion}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as i,g as e,h as s,F as a,H as h}from"./p-e996c38f.js";import{l as o,g as n}from"./p-404cbf48.js";import{a as d,g as c}from"./p-dcd2f00b.js";import{P as r}from"./p-bf04c6f4.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-db3391b9.js";import"./p-4fe489cf.js";import"./p-2bc98cb0.js";import"./p-4f236b5d.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const l=class{constructor(e){t(this,e),this.success=i(this,"success",7),this.fail=i(this,"fail",7),this.drawComplete=i(this,"drawComplete",7),this.editingAttachment=i(this,"editingAttachment",7),this.progressStatus=i(this,"progressStatus",7),this.modeChanged=i(this,"modeChanged",7),this.customizeSubmit=!1,this.enableSearch=!1,this.floorLevel=void 0,this.formElements=void 0,this.isMobile=void 0,this.locale=void 0,this.mapView=void 0,this.searchConfiguration=void 0,this.selectedLayerId=void 0,this.showGuidingMsg=!0,this.showGuidingMsgWhileDrawing=!0,this.submitNewReportsMessage=void 0,this._currentPage="templatePicker",this._editorLoading=!1,this._translations=void 0}get el(){return e(this)}Editor;ExpressionInfo;FeatureLayer;FieldElement;FormTemplate;MapView;Search;_addingAttachment;_calciteNotice;_container;_editor;_isSubmitBtnClicked=!1;_mapViewContainer;reactiveUtils;_search;_searchDiv;_selectedLayer;_updatedMapView;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async isMobileHandler(){this.modeChanged.emit()}async _editorLoadingWatchHandler(t){if(t){if(this._container?.classList.add("display-none"),this._selectedLayer?.isTable){const t={layer:this._selectedLayer,template:this._selectedLayer.templates[0]};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(t),await this.hideEditorsElements()}else await this.startCreate();this._container?.classList.remove("display-none"),this._editorLoading=!1}}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async refresh(t){this._editor&&this._setFloorLevel(t)}success;fail;drawComplete;editingAttachment;progressStatus;modeChanged;async componentWillLoad(){await this._getTranslations(),await this.initModules()}async componentDidLoad(){await this.init()}componentDidRender(){this.isMobile&&(this._mapViewContainer.style.top=`${this._calciteNotice.offsetHeight+this._searchDiv.offsetHeight+80}px`)}disconnectedCallback(){this._editor&&this._editor.destroy()}render(){const t="drawing"===this._currentPage?"":"display-none",i=this._editorLoading?"":"display-none",e=this._editorLoading?"display-none":"",h=this.isMobile?"show-map":"display-none";let o=this._translations.chooseCategoryMsg;return"drawing"===this._currentPage?o=this._translations.provideLocationMsg:"featureForm"===this._currentPage&&(o=this._translations.provideDetailsMsg),s(a,{key:"cb3462a70e0097e9b4ac9dac3f910fce6d30f8b5"},this.showGuidingMsg&&(this.showGuidingMsgWhileDrawing||"drawing"!==this._currentPage)&&s("calcite-notice",{key:"ddd908ac4b31f60d07de064ec1decae06b3d93bd",class:"notice-msg",icon:"lightbulb",kind:"success",open:!0,ref:t=>this._calciteNotice=t},s("div",{key:"3cee10085fa29190d88d3d03d35f726d1b51651b",slot:"message"},o)),s("calcite-loader",{key:"cf714d63a011712fa03c148c17a8811356e14859",class:i,label:"",scale:"s"}),s("div",{key:"e20cb740a1d22795b397af191a26339d709aba0d",class:e,id:"feature-form"}),this.enableSearch&&s("div",{key:"d2b439d3845b69527fdea2414c7b22078b0af4ea",class:`search-widget ${t} ${e}`,id:"search-widget-ref",ref:t=>this._searchDiv=t}),s("div",{key:"1f4e39aaaa93f4e2102767c04c5ad256e4f129e2",class:`${h}`,ref:t=>{this._mapViewContainer=t}}))}async init(){this.mapView&&this.selectedLayerId&&(this._updatedMapView=this.mapView,await(this.isMobile?this.createMobileMapView():this._loadWidgets()))}async initModules(){const[t,i,e,s,a,h,n]=await o(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search","esri/form/ExpressionInfo","esri/form/elements/FieldElement","esri/form/FormTemplate","esri/views/MapView"]);this.Editor=t,this.reactiveUtils=i,this.Search=e,this.ExpressionInfo=s,this.FieldElement=a,this.FormTemplate=h,this.MapView=n}async createMobileMapView(){this._mapViewContainer.classList.add("hide-map"),await new this.MapView({map:this.mapView.map,container:this._mapViewContainer,zoom:this.mapView.zoom}).when((t=>{this._updatedMapView=t,this._loadWidgets()}),(t=>{console.log(t)}))}async _loadWidgets(){await this.createEditorWidget(),this.enableSearch&&await this.createSearchWidget()}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[];this._container=document.createElement("div"),this._container?.classList.add("display-none");const i=await d(this._updatedMapView);this._selectedLayer=await c(this.mapView,this.selectedLayerId),this._selectedLayer?.isTable||i.forEach((async i=>{t.push({layer:i,enabled:"feature"===i?.type&&i?.id===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({view:this._updatedMapView,layerInfos:t,visibleElements:{snappingControls:!1,createFeaturesSection:!0,editFeaturesSection:!1},container:this._container}),this._mapViewContainer?this.el.insertBefore(this._container,this._mapViewContainer):this.el.appendChild(this._container);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(e);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&"create-features"!==this._editor.viewModel?.activeWorkflow?.type&&(this.progressStatus.emit(50),this._editorLoading=!0)}));this._editor.viewModel.addHandles(s);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&(this._mapViewContainer?.classList?.replace("show-map","hide-map"),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),setTimeout((()=>{this._setFloorLevel(this.floorLevel)}),50),this._currentPage="featureForm",this.progressStatus.emit(100),this.drawComplete.emit())}));this._editor.viewModel.addHandles(a);const h=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&"disabled"===this._editor.viewModel.featureFormViewModel.state&&(this._mapViewContainer?.classList?.replace("hide-map","show-map"),this._selectedLayer&&!this._selectedLayer.isTable&&(this._currentPage="drawing"))}));this._editor.viewModel.addHandles(h)}async startCreate(){return await this.hideEditorsElements(),new Promise(((t,i)=>{if(this._editor.viewModel.featureTemplatesViewModel.items?.length){const e=this._editor.viewModel.featureTemplatesViewModel.items[0].items;this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(75),setTimeout((()=>{this.hideEditorsElements().then((()=>{t({})}),(t=>i(t)))}),700)})),1===e.length&&this._editor.viewModel.featureTemplatesViewModel.select(e[0]);const s=e.length>1;this.hideEditorsElements().then((()=>{s&&t({})}),(t=>s&&i(t)))}}))}async createSearchWidget(){let t={view:this._updatedMapView};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this._updatedMapView)}),this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;let i=null;this._search.on("search-complete",(t=>{this._updatedMapView.goTo(t.results[0].results[0].extent),"point"===this._selectedLayer.geometryType&&(i=t.results[0].results[0]?.feature.geometry)}));const e=this.reactiveUtils.watch((()=>this._search.viewModel.state),(t=>{"ready"===t&&setTimeout((()=>{this._editor.viewModel.sketchViewModel.createGraphic&&i&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",i),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(e)}_getSearchConfig(t,i){const e=t.sources;return e?.length>0?(t.includeDefaultSources=!1,e.forEach((t=>{if(t.hasOwnProperty("layer")){const e=t,s=e.layer?.id,a=s?i.map.findLayerById(s):null,h=e?.layer?.url;a?e.layer=a:h&&(e.layer=new this.FeatureLayer(h))}})),e?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}async _setFloorLevel(t){if(!t)return;const i=this._selectedLayer;if(i?.floorInfo?.floorField){const e=i.fields.find((t=>t.name===i.floorInfo.floorField));if(e&&!i?.formTemplate)this._editor.viewModel.featureFormViewModel.setValue(e.name,t),e.editable=!1;else if(i.formTemplate&&this.formElements){const e=new this.ExpressionInfo({expression:`"${t}"`,name:"floor-info-test",title:"Floor Info",returnType:"string"}),s=new this.FieldElement({label:i.floorInfo.floorField,editableExpression:"false",fieldName:i.floorInfo.floorField,input:{type:"text-box",maxLength:50,minLength:0},valueExpression:e.name});this._updatedMapView.map.editableLayers.forEach((t=>{const i=this.formElements.orgExpressionInfos,a=[...this.formElements.orgElements];a.push(s);const h=new this.FormTemplate({title:t.formTemplate.title,description:t.formTemplate.description,elements:a,expressionInfos:[e].concat(i)});t.formTemplate=h}))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.querySelectorAll("calcite-flow-item")?.forEach((t=>{const i=t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");i?.querySelector("header")?.setAttribute("style","display: none"),i?.querySelector("footer")?.setAttribute("style","display: none")})))}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}timeout(t){return new Promise((i=>setTimeout(i,t)))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],isMobile:["isMobileHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};l.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 14px 20px 14px}.display-none{display:none !important}.hide-map{height:1%;visibility:hidden}.show-map{padding:10px !important;position:absolute !important;bottom:0;height:auto !important;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.esri-editor__panel-content{padding-block:10px !important}@media only screen and (max-width: 600px){.esri-editor__panel-content{padding-block:0 !important;min-height:0 !important}}";const p=class{constructor(e){t(this,e),this.editsComplete=i(this,"editsComplete",7),this.deleteDialog=void 0,this.buttonType="button",this.disabled=!1,this.icon=void 0,this.ids=[],this.layer=void 0,this.locale=void 0,this._confirmDelete=!1,this._deleteEndabled=!1,this._supportsDelete=void 0,this._translations=void 0}get el(){return e(this)}async idsWatchHandler(){this._setDeleteEnabled()}async layerWatchHandler(){this._setDeleteEnabled()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;async componentWillLoad(){await this._getTranslations()}render(){return s(h,{key:"73d07f24703df76fdacc1b3a1ec80cfdd7bbee30"},"button"===this.buttonType?s("calcite-button",{appearance:"outline",disabled:!this._deleteEndabled,id:"solutions-delete",kind:"danger",onClick:()=>this._delete(),width:"full"},this._translations.deleteCount.replace("{{n}}",this.ids.length.toString())):s("calcite-action",{appearance:"solid",disabled:!this._deleteEndabled,id:this.icon,onClick:()=>this._delete(),scale:"s",text:this._translations.delete},s("calcite-button",{appearance:"transparent",iconStart:this.icon,kind:"danger"},this._translations.delete)),this._deleteMessage(),s("calcite-tooltip",{key:"803898895029bd098264b9144ff5ccee102d4ae8",placement:"bottom","reference-element":"button"===this.buttonType?"solutions-delete":this.icon},s("span",{key:"a920ffea1849667cd58812a2c1813d2e066f0064"},this._translations.delete)))}async componentDidLoad(){this._setDeleteEnabled()}_setDeleteEnabled(){this._supportsDelete=this.layer?.editingEnabled&&this.layer?.capabilities?.operations?.supportsDelete,this._deleteEndabled=!this.disabled||this._supportsDelete&&this.ids.length>0}_delete(){this._confirmDelete=!0}_deleteMessage(){return this.deleteDialog?this.deleteDialog:s("delete-dialog",{id:"solution-delete-dialog",ids:this.ids,layer:this.layer,locale:this.locale,onDeleteDialogClose:()=>this._confirmDelete=!1,open:this._confirmDelete})}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{ids:["idsWatchHandler"],layer:["layerWatchHandler"],locale:["localeWatchHandler"]}}};p.style=":host{display:block}.delete-modal{position:fixed}";const f=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editorInitialized=i(this,"editorInitialized",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7),this.enableEditGeometry=!1,this.graphics=void 0,this.locale=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}get el(){return e(this)}_activeWorkflowHandle;_addRelatedRecordHandle;_attachmentHandle;_editHandle;_layerEditHandle;Editor;_editor;_layer;_editContainer;_editControlElements;_editingDisabled;_shouldClose=!1;reactiveUtils;async graphicsWatchHandler(){0===this.graphics.length&&this.open&&await this._closeEdit(!0)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async openWatchHandler(t){t&&this.graphics?.length>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit(!0)}closeEdit;editorInitialized;editsComplete;refreshGraphics;async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){this.graphics?.length>0&&this.graphics[0]?.layer&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=("subtype-sublayer"===this._layer.type?this._layer.parent:this._layer).on("edits",(()=>{this.editsComplete.emit()})))}render(){const t=this._editorLoading?"display-none":"position-absolute",i=this._editorLoading?"":"display-none";return s(h,{key:"e181f65e7218ce0350de5dcab9049ff63a5d39c1"},s("div",{key:"44bf2b5cf31c5acc7f65fb7ec50fd84e77c95470",class:"position-absolute"},this.graphics?.length>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled?void 0:s("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},s("div",{slot:"message"},this._translations.enableEditing)),s("div",{key:"97119476aa2a992ccadc1d61119f2640d195e7b1",class:"position-absolute"},s("div",{key:"f429decea684a6a22db89de89da3755bdbff19cc",class:t,id:"feature-form",ref:t=>this._editContainer=t}),s("calcite-loader",{key:"3ea908ef8dadd2f1c85bfac1b344f8b4441b8706",class:i,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await o(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=(await d(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:this.enableEditGeometry})));this._editor=new this.Editor({view:this.mapView,layerInfos:i,visibleElements:{snappingControls:!1},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>this._editor.viewModel.activeWorkflow?.activeWorkflow),(t=>{"update-table-record"!==t?.type&&"create-features"!==t?.type||(this._shouldClose=!1),(t?.type||t?.hasPendingEdits||this._editor.activeWorkflow)&&this._editor?.activeWorkflow?.started||(this.open=!1)})),this._editContainer.appendChild(t),this.editorInitialized.emit(this._editor)}}async _closeEdit(t){this._shouldClose=!0,t&&this._editor?.activeWorkflow?(this._editor.activeWorkflow?.activeWorkflow?.hasPendingEdits&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&this.graphics?.length>0&&this.refreshGraphics.emit(this.graphics),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],locale:["localeWatchHandler"],open:["openWatchHandler"]}}};f.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-color-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-editor__panel-content{padding-block:10px !important}";const b=class{constructor(e){t(this,e),this.popupClosed=i(this,"popupClosed",7),this.clearSelection=i(this,"clearSelection",7),this.selectionChanged=i(this,"selectionChanged",7),this.enableEditGeometry=!1,this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.allowEditing=!0,this.highlightEnabled=!0,this.locale=void 0,this.paginationEnabled=!0,this.position="absolute",this.showCloseBtn=!1,this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0,this._navigatedToRelatedFeature=void 0}get el(){return e(this)}Features;_editEnabled;_features;_layer;_popupUtils;_featuresNodeId="features-node"+(new Date).getMilliseconds().toString();reactiveUtils;_relatedFeature;async graphicsWatchHandler(){this._navigatedToRelatedFeature&&this._features&&(this._features.clear(),this._features.close(),this._count="",this._navigatedToRelatedFeature=!1),await this.setGraphics()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async localeWatchHandler(){if(this.el.lang=this.locale,await this._getTranslations(),this._features){const t=[...this.graphics];this.graphics=[],this.graphics=t}}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async refresh(){await this.setGraphics()}async back(){this._features.previous(),this._count=this._getCount()}async next(){this._features.next(),this._count=this._getCount()}async toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async updateCurrentGraphic(t){this._features.selectedFeatureWidget.graphic=t}popupClosed;clearSelection;selectionChanged;async closeEdit(){this._editRecordOpen=!1}async layerSelectionChange(){this._showListView=!1,this._features?.viewModel&&(this._features.viewModel.featureMenuOpen=!1,this._features.close())}async refreshGraphics(t){this._navigatedToRelatedFeature||(this.graphics=[...t.detail])}async componentWillLoad(){await this._initModules(),await this._getTranslations(),this._popupUtils=new r}async componentDidLoad(){this.graphics?.length>0&&await this.setGraphics()}render(){const t=this.isLoading?"":"display-none",i=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",e=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",a=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",o=this._features?.features?.length<2||this._navigatedToRelatedFeature,n=this.isMobile?"display-none":"",d=this._features?.selectedFeature?.getObjectId(),c=parseInt(d?.toString(),10)>-1?[d]:[],r=this._layer?.editingEnabled&&this._layer?.capabilities?.operations?.supportsDelete,l=this._relatedFeature?[this._relatedFeature]:this.graphics,p=this._navigatedToRelatedFeature?0:this._features?.selectedFeatureIndex;return s(h,{key:"9f75eb2e7aba944474e85c34b2abe23982629558"},s("calcite-shell",{key:"748f9e50cd3aa7a52dd7910b171c0d7f54d09203",style:{position:this.position}},this._getHeader(),s("calcite-loader",{key:"feced4d4a66df36958644436acaa53ddabdfc02a",class:t,label:this._translations.fetchingData}),s("div",{key:"3bb912c80d610a21a5e283c6bd19ab0c63023c45",class:"esri-widget feature-node "+i,id:this._featuresNodeId}),s("div",{key:"479dcbda08f837b32bd19ed7f40856f081e92a6e",class:`${a} width-100`,slot:"footer"},this.allowEditing&&s("div",{key:"dd78b02ba8506c391aada6c5233691ec9babcfbe",class:"display-flex top-border padding-1-2"},s("calcite-button",{key:"c5a807609c60151a433fa9c0055fbfdf20b2935f",appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile&&r?s("delete-button",{class:"padding-inline-start-1 width-100",id:"solutions-delete",ids:c,layer:this._layer,locale:this.locale,onEditsComplete:()=>this._closePopup()}):void 0,s("calcite-tooltip",{key:"a4cd4c77e982e23675ec9eaf08e2135de6c83b65",placement:"bottom","reference-element":"solutions-edit"},s("span",{key:"22533608996d1c87b9b04e339506ec01176379b0"},this._translations.edit)),this.isMobile&&r?s("calcite-tooltip",{placement:"bottom","reference-element":"solutions-delete"},s("span",null,this._translations.delete)):void 0),this.paginationEnabled&&!o&&s("div",{key:"183ff7da57a06de8f5419edf5973f18b41c46097",class:`display-flex padding-1-2 button-container top-border ${n}`},s("div",{key:"77e59229d1d516ccdc8f7c5be2f89a5ad9d5004b"},s("calcite-button",{key:"4b6a6f1f85e9199e14d626ba66b6b319283d0c32",appearance:"transparent",disabled:o,iconFlipRtl:"both",iconStart:"chevron-left",id:"solutions-back",onClick:()=>this._back(),width:"full"}),s("calcite-tooltip",{key:"7056c5cb3c790c804194f09f2586864a28dce5e1",placement:"top","reference-element":"solutions-back"},s("span",{key:"923fc5425a9faced6952a1b9acff9b7d0f3da286"},this._translations.back))),s("calcite-action",{key:"a34bfb4ae71a91373fd476e7b704a6a2f8f23157",class:"pagination-action",iconFlipRtl:!0,onClick:()=>this._toggleListView(),scale:"s",text:"",textEnabled:!0},s("span",{key:"101a0fa592af65b540123c835e9031a18671ad8b",class:"pagination-count"},this._count)),s("div",{key:"c4f88f464a3091dfc77578470de4f42d05b9f5c7"},s("calcite-button",{key:"e4e35e539f0c7e01a31e0047db545d4d334ef2d8",appearance:"transparent",disabled:o,iconFlipRtl:"both",iconStart:"chevron-right",id:"solutions-next",onClick:()=>this._next(),width:"full"}),s("calcite-tooltip",{key:"40244ecf5566fde448b311272d2ee00d70bc531a",placement:"top","reference-element":"solutions-next"},s("span",{key:"db01e2a2b9da9a80f9a25caf49bf8beb872e6ad9"},this._translations.next))))),s("edit-card",{key:"cfa193b01b67f7709ea6a491caa0c647c536e9e3",class:e,enableEditGeometry:this.enableEditGeometry,graphicIndex:p,graphics:l,locale:this.locale,mapView:this.mapView,open:this._editRecordOpen}),s("calcite-alert",{key:"709fd6d681d32a03fcf5fba959e81a0153676e26",icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},s("div",{key:"bbdd9cc98fcda8ffba294a4322f08468072f6aef",slot:"title"},this._translations.editDisabled),s("div",{key:"d07e32e9cd54cc82ff005e7e696e13e1b8bdaa4e",slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await o(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async setGraphics(){this._features||await this._initFeaturesWidget(),this.graphics.length>0?(this._layer=this.graphics[0]?.layer,this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._mobileTitle=await this._popupUtils.getPopupTitle(this.graphics[0],this.mapView.map),this._features.open({features:this.graphics})):(this._features.clear(),this._features.close()),this._count=this._getCount()}async _initFeaturesWidget(){return void 0!==this.isMobile?await(this.mapView?.when((()=>{this._features?(this._features.view=this.mapView,this._features.visibleElements.actionBar=!1,this._features.visibleElements.closeButton=this.showCloseBtn,this._features.visibleElements.heading=!this.isMobile):(this._features=new this.Features({view:this.mapView,container:this._featuresNodeId,visibleElements:{actionBar:!1,closeButton:this.showCloseBtn,heading:!this.isMobile}}),this._features.viewModel.highlightEnabled=this.highlightEnabled,this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{this._count=this._getCount(),t||(this._showListView=t)})),this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit({selectedFeature:[this._features.selectedFeature],selectedFeatureIndex:this._features.selectedFeatureIndex})})),this.reactiveUtils.watch((()=>this._features.selectedDrillInFeature),(t=>{t?(this._relatedFeature=t,this._navigatedToRelatedFeature=!0):(this._relatedFeature=null,this._navigatedToRelatedFeature=!1)})),this.el.querySelector("#"+this._featuresNodeId).addEventListener("calciteFlowItemClose",(()=>{this.clearSelection.emit()})))}))):Promise.resolve()}_getHeader(){return this.isMobile&&!this._editRecordOpen?s("calcite-panel",{class:"border-width-0",slot:"header"},s("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),s("span",{class:"font-bold",slot:"header-content"},this._mobileTitle)):void 0}_closePopup(){this.popupClosed.emit()}_alertClosed(){this._alertOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){const t=(this._features?.viewModel.selectedFeatureIndex+1).toString(),i=this._features?.features?.length.toString();return this._translations.indexOfTotal.replace("{{index}}",t).replace("{{total}}",i)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"]}}};b.style=":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node{position:relative !important}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:center;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}.pagination-action{position:relative;left:3px}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}";export{l as create_feature,p as delete_button,f as edit_card,b as info_card}
|
@@ -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{a}from"./p-e996c38f.js";import{l as t}from"./p-438fdc33.js";import{l as n}from"./p-3423b5ef.js";const e={full:{ar:{language:"Arabic",translated:"عربي"},bg:{language:"Bulgarian",translated:"Български"},bs:{language:"Bosnian",translated:"Bosanski"},ca:{language:"Catalan",translated:"Català"},cs:{language:"Czech",translated:"čeština"},da:{language:"Danish",translated:"Dansk"},de:{language:"German",translated:"Deutsch"},el:{language:"Greek",translated:"Ελλάδα"},en:{language:"English",translated:"English"},es:{language:"Spanish",translated:"Español"},et:{language:"Estonian",translated:"Eesti"},fi:{language:"Finnish",translated:"Suomi"},fr:{language:"French",translated:"Français"},he:{language:"Hebrew",translated:"עברית"},hr:{language:"Croatian",translated:"Hrvatski"},hu:{language:"Hungarian",translated:"Magyar"},id:{language:"Indonesian",translated:"Bahasa Indonesia",supportsAutoTranslate:!0},it:{language:"Italian",translated:"Italiano"},ja:{language:"Japanese",translated:"日本語"},ko:{language:"Korean",translated:"한국어"},lt:{language:"Lithuanian",translated:"Lietuvių"},lv:{language:"Latvian",translated:"Latviešu"},nb:{language:"Norwegian",translated:"Norsk"},nl:{language:"Dutch",translated:"Nederlands"},pl:{language:"Polish",translated:"Polski"},"pt-BR":{language:"Portuguese (Brazil)",translated:"Português (Brasil)"},"pt-PT":{language:"Portuguese (Portugal)",translated:"Português (Portugal)"},ro:{language:"Romanian",translated:"Română"},ru:{language:"Russian",translated:"Русский"},sk:{language:"Slovak",translated:"Slovenčina"},sl:{language:"Slovenian",translated:"Slovenščina"},sr:{language:"Serbian",translated:"Srpski"},sv:{language:"Swedish",translated:"Svenska"},th:{language:"Thai",translated:"ไทย"},tr:{language:"Turkish",translated:"Türkiye"},uk:{language:"Ukrainian",translated:"Україна"},vi:{language:"Vietnamese",translated:"Tiếng Việt"},"zh-CN":{language:"Simplified Chinese",translated:"简体中文"},"zh-HK":{language:"Traditional Chinese (Hong Kong)",translated:"繁體中文(香港)"},"zh-TW":{language:"Traditional Chinese (Taiwan)",translated:"繁體中文(台灣)"}},partial:{ab:{language:"Abkhaz",translated:"Аҧсуа"},aa:{language:"Afar",translated:"Afar"},af:{language:"Afrikaans",translated:"Afrikaans",supportsAutoTranslate:!0},ak:{language:"Akan",translated:"Akan"},sq:{language:"Albanian",translated:"Shqip",supportsAutoTranslate:!0},am:{language:"Amharic",translated:"አማርኛ",supportsAutoTranslate:!0},an:{language:"Aragonese",translated:"Aragonés"},hy:{language:"Armenian",translated:"Հայերեն",supportsAutoTranslate:!0},as:{language:"Assamese",translated:"অসমীয়া",supportsAutoTranslate:!0},av:{language:"Avaric",translated:"авар мацӀ"},ae:{language:"Avestan",translated:"Avesta"},ay:{language:"Aymara",translated:"aymar aru"},az:{language:"Azerbaijani",translated:"azərbaycan dili"},bm:{language:"Bambara",translated:"bamanankan"},ba:{language:"Bashkir",translated:"Башҡорт теле",supportsAutoTranslate:!0},eu:{language:"Basque",translated:"euskara",supportsAutoTranslate:!0},be:{language:"Belarusian",translated:"Беларуская"},bn:{language:"Bengali",translated:"বাংলা"},bh:{language:"Bihari",translated:"भोजपुरी"},bi:{language:"Bislama",translated:"Bislama"},br:{language:"Breton",translated:"Brezhoneg"},my:{language:"Burmese",translated:"ဗမာစာ"},ch:{language:"Chamorro",translated:"Chamoru"},ce:{language:"Chechen",translated:"нохчийн мотт"},ny:{language:"Chichewa",translated:"chiCheŵa"},cu:{language:"Church Slavic",translated:"ѩзыкъ словѣньскъ"},cv:{language:"Chuvash",translated:"чӑваш чӗлхи"},kw:{language:"Cornish",translated:"Kernewek"},co:{language:"Corsican",translated:"corsu"},cr:{language:"Cree",translated:"ᓀᐦᐃᔭᐍᐏᐣ"},dv:{language:"Divehi",translated:"ދިވެހި",supportsAutoTranslate:!0},eo:{language:"Esperanto",translated:"Esperanto"},ee:{language:"Ewe",translated:"Ɛʋɛgbɛ"},fo:{language:"Faroese",translated:"føroyskt",supportsAutoTranslate:!0},fj:{language:"Fijian",translated:"Vosa Vakaviti"},ff:{language:"Fulah",translated:"Fulfulde"},gl:{language:"Galician",translated:"galego",supportsAutoTranslate:!0},ka:{language:"Georgian",translated:"ქართული",supportsAutoTranslate:!0},gn:{language:"Guarani",translated:"Avañe'ẽ"},gu:{language:"Gujarati",translated:"ગુજરાતી",supportsAutoTranslate:!0},ht:{language:"Haitian Creole",translated:"Kreyòl Ayisyen",supportsAutoTranslate:!0},ha:{language:"Hausa",translated:"هَوُسَ",supportsAutoTranslate:!0},hz:{language:"Herero",translated:"Otjiherero"},hi:{language:"Hindi",translated:"हिन्दी"},ho:{language:"Hiri Motu",translated:"Hiri Motu"},is:{language:"Icelandic",translated:"Íslenska",supportsAutoTranslate:!0},io:{language:"Ido",translated:"Ido"},ig:{language:"Igbo",translated:"Asụsụ Igbo",supportsAutoTranslate:!0},ia:{language:"Interlingua",translated:"Interlingua"},ie:{language:"Interlingue",translated:"Interlingue"},iu:{language:"Inuktitut",translated:"ᐃᓄᒃᑎᑐᑦ",supportsAutoTranslate:!0},ip:{language:"Inupiaq",translated:"Iñupiaq"},ga:{language:"Irish",translated:"Gaeilge",supportsAutoTranslate:!0},jv:{language:"Javanese",translated:"ꦧꦱꦗꦮ"},kl:{language:"Kalaallisut",translated:"kalaallisut"},kn:{language:"Kannada",translated:"ಕನ್ನಡ",supportsAutoTranslate:!0},kr:{language:"Kanuri",translated:"Kanuri"},ks:{language:"Kashmiri",translated:"कश्मीरी",supportsAutoTranslate:!0},kk:{language:"Kazakh",translated:"қазақ тілі",supportsAutoTranslate:!0},km:{language:"Khmer",translated:"ខ្មែរ",supportsAutoTranslate:!0},ki:{language:"Kikuyu",translated:"Gĩkũyũ"},rw:{language:"Kinyarwanda",translated:"Kinyarwanda",supportsAutoTranslate:!0},rn:{language:"Kirundi",translated:"Ikirundi"},kv:{language:"Komi",translated:"коми кыв"},kg:{language:"Kongo",translated:"Kikongo"},ku:{language:"Kurdish",translated:"Kurdî",supportsAutoTranslate:!0},kj:{language:"Kwanyama",translated:"Kuanyama"},ky:{language:"Kyrgyz",translated:"Кыргызча"},lo:{language:"Lao",translated:"ພາສາລາວ",supportsAutoTranslate:!0},la:{language:"Latin",translated:"latine"},li:{language:"Limburgish",translated:"Limburgs"},ln:{language:"Lingala",translated:"Lingála"},lu:{language:"Luba-Katanga",translated:"Kiluba"},lg:{language:"Luganda",translated:"Luganda"},lb:{language:"Luxembourgish",translated:"Lëtzebuergesch"},mk:{language:"Macedonian",translated:"македонски јазик",supportsAutoTranslate:!0},mg:{language:"Malagasy",translated:"fiteny malagasy",supportsAutoTranslate:!0},ms:{language:"Malay",translated:"Bahasa Melayu",supportsAutoTranslate:!0},ml:{language:"Malayalam",translated:"മലയാളം",supportsAutoTranslate:!0},mt:{language:"Maltese",translated:"Malti",supportsAutoTranslate:!0},gv:{language:"Manx",translated:"Gailck"},mi:{language:"Maori",translated:"te reo Māori",supportsAutoTranslate:!0},mr:{language:"Marathi",translated:"मराठी",supportsAutoTranslate:!0},mh:{language:"Marshallese",translated:"Kajin M̧ajeļ"},mn:{language:"Mongolian",translated:"Монгол хэл"},na:{language:"Nauru",translated:"Ekakairũ Naoero"},nv:{language:"Navajo",translated:"Diné bizaad"},ng:{language:"Ndonga",translated:"Owambo"},ne:{language:"Nepali",translated:"नेपाली",supportsAutoTranslate:!0},nd:{language:"North Ndebele",translated:"isiNdebele"},se:{language:"Northern Sami",translated:"Davvisámegiella"},no:{language:"Norwegian",translated:"Norsk"},nn:{language:"Norwegian Nynorsk",translated:"Norsk nynorsk"},ii:{language:"Nuosu",translated:"ꆈꌠ꒿ Nuosuhxop"},oc:{language:"Occitan",translated:"occitan"},oj:{language:"Ojibwe",translated:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},or:{language:"Oriya",translated:"ଓଡ଼ିଆ",supportsAutoTranslate:!0},om:{language:"Oromo",translated:"Afaan Oromoo"},os:{language:"Ossetian",translated:"ирон æвзаг"},pi:{language:"Pali",translated:"पाऴि"},pa:{language:"Panjabi",translated:"ਪੰਜਾਬੀ"},ps:{language:"Pashto",translated:"پښتو",supportsAutoTranslate:!0},fa:{language:"Persian",translated:"فارسی",supportsAutoTranslate:!0},qu:{language:"Quechua",translated:"Runa Simi"},rm:{language:"Romansh",translated:"rumantsch grischun"},sm:{language:"Samoan",translated:"gagana fa'a Samoa",supportsAutoTranslate:!0},sg:{language:"Sango",translated:"yângâ tî sängö"},sa:{language:"Sanskrit",translated:"संस्कृतम्"},sc:{language:"Sardinian",translated:"sardu"},gd:{language:"Scottish Gaelic",translated:"Gàidhlig"},sn:{language:"Shona",translated:"chiShona"},sd:{language:"Sindhi",translated:"सिन्धी",supportsAutoTranslate:!0},si:{language:"Sinhala",translated:"සිංහල",supportsAutoTranslate:!0},so:{language:"Somali",translated:"Soomaaliga",supportsAutoTranslate:!0},nr:{language:"South Ndebele",translated:"isiNdebele"},st:{language:"Southern Sotho",translated:"Sesotho"},su:{language:"Sundanese",translated:"Basa Sunda"},sw:{language:"Swahili",translated:"Kiswahili",supportsAutoTranslate:!0},ss:{language:"Swati",translated:"SiSwati"},tl:{language:"Tagalog",translated:"Wikang Tagalog"},ty:{language:"Tahitian",translated:"Reo Tahiti",supportsAutoTranslate:!0},tg:{language:"Tajik",translated:"тоҷикӣ"},ta:{language:"Tamil",translated:"தமிழ்",supportsAutoTranslate:!0},tt:{language:"Tatar",translated:"татар теле",supportsAutoTranslate:!0},te:{language:"Telugu",translated:"తెలుగు",supportsAutoTranslate:!0},bo:{language:"Tibetan",translated:"བོད་ཡིག",supportsAutoTranslate:!0},ti:{language:"Tigrinya",translated:"ትግርኛ",supportsAutoTranslate:!0},to:{language:"Tonga",translated:"faka Tonga",supportsAutoTranslate:!0},ts:{language:"Tsonga",translated:"Xitsonga"},tn:{language:"Tswana",translated:"Setswana"},tk:{language:"Turkmen",translated:"Türkmen",supportsAutoTranslate:!0},tw:{language:"Twi",translated:"Twi"},ug:{language:"Uighur",translated:"Uyƣurqə"},ur:{language:"Urdu",translated:"اردو",supportsAutoTranslate:!0},uz:{language:"Uzbek",translated:"O'zbek",supportsAutoTranslate:!0},ve:{language:"Venda",translated:"Tshivenḓa"},vo:{language:"Volapük",translated:"Volapük"},wa:{language:"Walloon",translated:"walon"},cy:{language:"Welsh",translated:"Cymraeg",supportsAutoTranslate:!0},fy:{language:"Western Frisian",translated:"Frysk"},wo:{language:"Wolof",translated:"Wollof"},xh:{language:"Xhosa",translated:"isiXhosa",supportsAutoTranslate:!0},yi:{language:"Yiddish",translated:"ייִדיש"},yo:{language:"Yoruba",translated:"Yorùbá",supportsAutoTranslate:!0},za:{language:"Zhuang",translated:"Saɯ cueŋƅ"},zu:{language:"Zulu",translated:"isiZulu",supportsAutoTranslate:!0}}},l=new URL(window.location.href).origin.includes("localhost:4444");function s(){const a=(document.documentElement.lang||(null===navigator||void 0===navigator?void 0:navigator.language)||"en").toLowerCase();return n.has(a)?n.get(a):n.has(a.slice(0,2))?n.get(a.slice(0,2)):"en"}async function r(t,n){const e=`assets/t9n/${t}/resources_${n}.json`,s=`${new URL(window.location.href).origin}/dist/${e}`;async function r(a){const t=await fetch(a);if(!t.ok)throw new Error(`Fetch failed with status ${t.status}: ${t.statusText}`);const n=t.headers.get("content-type");if(!n||!n.includes("application/json")){const a=await t.text();throw console.error(`Expected JSON, but received (${n}): ${a}`),new Error("Fetched content is not JSON")}return await t.json()}try{return await r(l?s:a(e))}catch(a){console.error(`Primary fetch error: ${a}`);try{return await r(s)}catch(a){throw console.error(`Fallback fetch error: ${a}`),new Error("Both primary and fallback fetches failed")}}}function g(a,t){var n,e;const l=null===(n=null==t?void 0:t.user)||void 0===n?void 0:n.culture,s=null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.language,r=a.getLocale(),g=a.normalizeMessageBundleLocale(l||s||r||"en");return null==g?"en":g}async function u(a,t){const n=a.tagName.toLowerCase(),e=null!=t?t:s();let l;try{l=await r(n,e)}catch(a){console.warn(`no locale for ${n} (${e}) loading default locale en.`),l=await r(n,"en")}return[l,e]}async function o(a,n){try{i(a,await u(a.el),n)}catch(a){}finally{try{const[l]=await t(["esri/intl"]);l.onLocaleChange(function(a,n){return async l=>{const s=await async function(a){var n;if(!a)return"en";if(!!(null===(n=null==e?void 0:e.partial)||void 0===n?void 0:n[a]))return a;{const[n]=await t(["esri/intl"]),e=n.normalizeMessageBundleLocale(a);return null==e?"en":e}}(l),r=await u(a.el,s);i(a,r,n)}}(a,n))}catch(a){}}}function i(a,t,n){a.messages=t[0],n&&(a.messages=Object.assign(Object.assign({},a.messages),n))}export{g as a,u as b,s as c,o as g}
|
6
|
+
import{a}from"./p-e996c38f.js";import{l as t}from"./p-08ad0b7a.js";import{l as n}from"./p-ac122d9e.js";const e={full:{ar:{language:"Arabic",translated:"عربي"},bg:{language:"Bulgarian",translated:"Български"},bs:{language:"Bosnian",translated:"Bosanski"},ca:{language:"Catalan",translated:"Català"},cs:{language:"Czech",translated:"čeština"},da:{language:"Danish",translated:"Dansk"},de:{language:"German",translated:"Deutsch"},el:{language:"Greek",translated:"Ελλάδα"},en:{language:"English",translated:"English"},es:{language:"Spanish",translated:"Español"},et:{language:"Estonian",translated:"Eesti"},fi:{language:"Finnish",translated:"Suomi"},fr:{language:"French",translated:"Français"},he:{language:"Hebrew",translated:"עברית"},hr:{language:"Croatian",translated:"Hrvatski"},hu:{language:"Hungarian",translated:"Magyar"},id:{language:"Indonesian",translated:"Bahasa Indonesia",supportsAutoTranslate:!0},it:{language:"Italian",translated:"Italiano"},ja:{language:"Japanese",translated:"日本語"},ko:{language:"Korean",translated:"한국어"},lt:{language:"Lithuanian",translated:"Lietuvių"},lv:{language:"Latvian",translated:"Latviešu"},nb:{language:"Norwegian",translated:"Norsk"},nl:{language:"Dutch",translated:"Nederlands"},pl:{language:"Polish",translated:"Polski"},"pt-BR":{language:"Portuguese (Brazil)",translated:"Português (Brasil)"},"pt-PT":{language:"Portuguese (Portugal)",translated:"Português (Portugal)"},ro:{language:"Romanian",translated:"Română"},ru:{language:"Russian",translated:"Русский"},sk:{language:"Slovak",translated:"Slovenčina"},sl:{language:"Slovenian",translated:"Slovenščina"},sr:{language:"Serbian",translated:"Srpski"},sv:{language:"Swedish",translated:"Svenska"},th:{language:"Thai",translated:"ไทย"},tr:{language:"Turkish",translated:"Türkiye"},uk:{language:"Ukrainian",translated:"Україна"},vi:{language:"Vietnamese",translated:"Tiếng Việt"},"zh-CN":{language:"Simplified Chinese",translated:"简体中文"},"zh-HK":{language:"Traditional Chinese (Hong Kong)",translated:"繁體中文(香港)"},"zh-TW":{language:"Traditional Chinese (Taiwan)",translated:"繁體中文(台灣)"}},partial:{ab:{language:"Abkhaz",translated:"Аҧсуа"},aa:{language:"Afar",translated:"Afar"},af:{language:"Afrikaans",translated:"Afrikaans",supportsAutoTranslate:!0},ak:{language:"Akan",translated:"Akan"},sq:{language:"Albanian",translated:"Shqip",supportsAutoTranslate:!0},am:{language:"Amharic",translated:"አማርኛ",supportsAutoTranslate:!0},an:{language:"Aragonese",translated:"Aragonés"},hy:{language:"Armenian",translated:"Հայերեն",supportsAutoTranslate:!0},as:{language:"Assamese",translated:"অসমীয়া",supportsAutoTranslate:!0},av:{language:"Avaric",translated:"авар мацӀ"},ae:{language:"Avestan",translated:"Avesta"},ay:{language:"Aymara",translated:"aymar aru"},az:{language:"Azerbaijani",translated:"azərbaycan dili"},bm:{language:"Bambara",translated:"bamanankan"},ba:{language:"Bashkir",translated:"Башҡорт теле",supportsAutoTranslate:!0},eu:{language:"Basque",translated:"euskara",supportsAutoTranslate:!0},be:{language:"Belarusian",translated:"Беларуская"},bn:{language:"Bengali",translated:"বাংলা"},bh:{language:"Bihari",translated:"भोजपुरी"},bi:{language:"Bislama",translated:"Bislama"},br:{language:"Breton",translated:"Brezhoneg"},my:{language:"Burmese",translated:"ဗမာစာ"},ch:{language:"Chamorro",translated:"Chamoru"},ce:{language:"Chechen",translated:"нохчийн мотт"},ny:{language:"Chichewa",translated:"chiCheŵa"},cu:{language:"Church Slavic",translated:"ѩзыкъ словѣньскъ"},cv:{language:"Chuvash",translated:"чӑваш чӗлхи"},kw:{language:"Cornish",translated:"Kernewek"},co:{language:"Corsican",translated:"corsu"},cr:{language:"Cree",translated:"ᓀᐦᐃᔭᐍᐏᐣ"},dv:{language:"Divehi",translated:"ދިވެހި",supportsAutoTranslate:!0},eo:{language:"Esperanto",translated:"Esperanto"},ee:{language:"Ewe",translated:"Ɛʋɛgbɛ"},fo:{language:"Faroese",translated:"føroyskt",supportsAutoTranslate:!0},fj:{language:"Fijian",translated:"Vosa Vakaviti"},ff:{language:"Fulah",translated:"Fulfulde"},gl:{language:"Galician",translated:"galego",supportsAutoTranslate:!0},ka:{language:"Georgian",translated:"ქართული",supportsAutoTranslate:!0},gn:{language:"Guarani",translated:"Avañe'ẽ"},gu:{language:"Gujarati",translated:"ગુજરાતી",supportsAutoTranslate:!0},ht:{language:"Haitian Creole",translated:"Kreyòl Ayisyen",supportsAutoTranslate:!0},ha:{language:"Hausa",translated:"هَوُسَ",supportsAutoTranslate:!0},hz:{language:"Herero",translated:"Otjiherero"},hi:{language:"Hindi",translated:"हिन्दी"},ho:{language:"Hiri Motu",translated:"Hiri Motu"},is:{language:"Icelandic",translated:"Íslenska",supportsAutoTranslate:!0},io:{language:"Ido",translated:"Ido"},ig:{language:"Igbo",translated:"Asụsụ Igbo",supportsAutoTranslate:!0},ia:{language:"Interlingua",translated:"Interlingua"},ie:{language:"Interlingue",translated:"Interlingue"},iu:{language:"Inuktitut",translated:"ᐃᓄᒃᑎᑐᑦ",supportsAutoTranslate:!0},ip:{language:"Inupiaq",translated:"Iñupiaq"},ga:{language:"Irish",translated:"Gaeilge",supportsAutoTranslate:!0},jv:{language:"Javanese",translated:"ꦧꦱꦗꦮ"},kl:{language:"Kalaallisut",translated:"kalaallisut"},kn:{language:"Kannada",translated:"ಕನ್ನಡ",supportsAutoTranslate:!0},kr:{language:"Kanuri",translated:"Kanuri"},ks:{language:"Kashmiri",translated:"कश्मीरी",supportsAutoTranslate:!0},kk:{language:"Kazakh",translated:"қазақ тілі",supportsAutoTranslate:!0},km:{language:"Khmer",translated:"ខ្មែរ",supportsAutoTranslate:!0},ki:{language:"Kikuyu",translated:"Gĩkũyũ"},rw:{language:"Kinyarwanda",translated:"Kinyarwanda",supportsAutoTranslate:!0},rn:{language:"Kirundi",translated:"Ikirundi"},kv:{language:"Komi",translated:"коми кыв"},kg:{language:"Kongo",translated:"Kikongo"},ku:{language:"Kurdish",translated:"Kurdî",supportsAutoTranslate:!0},kj:{language:"Kwanyama",translated:"Kuanyama"},ky:{language:"Kyrgyz",translated:"Кыргызча"},lo:{language:"Lao",translated:"ພາສາລາວ",supportsAutoTranslate:!0},la:{language:"Latin",translated:"latine"},li:{language:"Limburgish",translated:"Limburgs"},ln:{language:"Lingala",translated:"Lingála"},lu:{language:"Luba-Katanga",translated:"Kiluba"},lg:{language:"Luganda",translated:"Luganda"},lb:{language:"Luxembourgish",translated:"Lëtzebuergesch"},mk:{language:"Macedonian",translated:"македонски јазик",supportsAutoTranslate:!0},mg:{language:"Malagasy",translated:"fiteny malagasy",supportsAutoTranslate:!0},ms:{language:"Malay",translated:"Bahasa Melayu",supportsAutoTranslate:!0},ml:{language:"Malayalam",translated:"മലയാളം",supportsAutoTranslate:!0},mt:{language:"Maltese",translated:"Malti",supportsAutoTranslate:!0},gv:{language:"Manx",translated:"Gailck"},mi:{language:"Maori",translated:"te reo Māori",supportsAutoTranslate:!0},mr:{language:"Marathi",translated:"मराठी",supportsAutoTranslate:!0},mh:{language:"Marshallese",translated:"Kajin M̧ajeļ"},mn:{language:"Mongolian",translated:"Монгол хэл"},na:{language:"Nauru",translated:"Ekakairũ Naoero"},nv:{language:"Navajo",translated:"Diné bizaad"},ng:{language:"Ndonga",translated:"Owambo"},ne:{language:"Nepali",translated:"नेपाली",supportsAutoTranslate:!0},nd:{language:"North Ndebele",translated:"isiNdebele"},se:{language:"Northern Sami",translated:"Davvisámegiella"},no:{language:"Norwegian",translated:"Norsk"},nn:{language:"Norwegian Nynorsk",translated:"Norsk nynorsk"},ii:{language:"Nuosu",translated:"ꆈꌠ꒿ Nuosuhxop"},oc:{language:"Occitan",translated:"occitan"},oj:{language:"Ojibwe",translated:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},or:{language:"Oriya",translated:"ଓଡ଼ିଆ",supportsAutoTranslate:!0},om:{language:"Oromo",translated:"Afaan Oromoo"},os:{language:"Ossetian",translated:"ирон æвзаг"},pi:{language:"Pali",translated:"पाऴि"},pa:{language:"Panjabi",translated:"ਪੰਜਾਬੀ"},ps:{language:"Pashto",translated:"پښتو",supportsAutoTranslate:!0},fa:{language:"Persian",translated:"فارسی",supportsAutoTranslate:!0},qu:{language:"Quechua",translated:"Runa Simi"},rm:{language:"Romansh",translated:"rumantsch grischun"},sm:{language:"Samoan",translated:"gagana fa'a Samoa",supportsAutoTranslate:!0},sg:{language:"Sango",translated:"yângâ tî sängö"},sa:{language:"Sanskrit",translated:"संस्कृतम्"},sc:{language:"Sardinian",translated:"sardu"},gd:{language:"Scottish Gaelic",translated:"Gàidhlig"},sn:{language:"Shona",translated:"chiShona"},sd:{language:"Sindhi",translated:"सिन्धी",supportsAutoTranslate:!0},si:{language:"Sinhala",translated:"සිංහල",supportsAutoTranslate:!0},so:{language:"Somali",translated:"Soomaaliga",supportsAutoTranslate:!0},nr:{language:"South Ndebele",translated:"isiNdebele"},st:{language:"Southern Sotho",translated:"Sesotho"},su:{language:"Sundanese",translated:"Basa Sunda"},sw:{language:"Swahili",translated:"Kiswahili",supportsAutoTranslate:!0},ss:{language:"Swati",translated:"SiSwati"},tl:{language:"Tagalog",translated:"Wikang Tagalog"},ty:{language:"Tahitian",translated:"Reo Tahiti",supportsAutoTranslate:!0},tg:{language:"Tajik",translated:"тоҷикӣ"},ta:{language:"Tamil",translated:"தமிழ்",supportsAutoTranslate:!0},tt:{language:"Tatar",translated:"татар теле",supportsAutoTranslate:!0},te:{language:"Telugu",translated:"తెలుగు",supportsAutoTranslate:!0},bo:{language:"Tibetan",translated:"བོད་ཡིག",supportsAutoTranslate:!0},ti:{language:"Tigrinya",translated:"ትግርኛ",supportsAutoTranslate:!0},to:{language:"Tonga",translated:"faka Tonga",supportsAutoTranslate:!0},ts:{language:"Tsonga",translated:"Xitsonga"},tn:{language:"Tswana",translated:"Setswana"},tk:{language:"Turkmen",translated:"Türkmen",supportsAutoTranslate:!0},tw:{language:"Twi",translated:"Twi"},ug:{language:"Uighur",translated:"Uyƣurqə"},ur:{language:"Urdu",translated:"اردو",supportsAutoTranslate:!0},uz:{language:"Uzbek",translated:"O'zbek",supportsAutoTranslate:!0},ve:{language:"Venda",translated:"Tshivenḓa"},vo:{language:"Volapük",translated:"Volapük"},wa:{language:"Walloon",translated:"walon"},cy:{language:"Welsh",translated:"Cymraeg",supportsAutoTranslate:!0},fy:{language:"Western Frisian",translated:"Frysk"},wo:{language:"Wolof",translated:"Wollof"},xh:{language:"Xhosa",translated:"isiXhosa",supportsAutoTranslate:!0},yi:{language:"Yiddish",translated:"ייִדיש"},yo:{language:"Yoruba",translated:"Yorùbá",supportsAutoTranslate:!0},za:{language:"Zhuang",translated:"Saɯ cueŋƅ"},zu:{language:"Zulu",translated:"isiZulu",supportsAutoTranslate:!0}}},l=new URL(window.location.href).origin.includes("localhost:4444");function s(){const a=(document.documentElement.lang||(null===navigator||void 0===navigator?void 0:navigator.language)||"en").toLowerCase();return n.has(a)?n.get(a):n.has(a.slice(0,2))?n.get(a.slice(0,2)):"en"}async function r(t,n){const e=`assets/t9n/${t}/resources_${n}.json`,s=`${new URL(window.location.href).origin}/dist/${e}`;async function r(a){const t=await fetch(a);if(!t.ok)throw new Error(`Fetch failed with status ${t.status}: ${t.statusText}`);const n=t.headers.get("content-type");if(!n||!n.includes("application/json")){const a=await t.text();throw console.error(`Expected JSON, but received (${n}): ${a}`),new Error("Fetched content is not JSON")}return await t.json()}try{return await r(l?s:a(e))}catch(a){console.error(`Primary fetch error: ${a}`);try{return await r(s)}catch(a){throw console.error(`Fallback fetch error: ${a}`),new Error("Both primary and fallback fetches failed")}}}function g(a,t){var n,e;const l=null===(n=null==t?void 0:t.user)||void 0===n?void 0:n.culture,s=null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.language,r=a.getLocale(),g=a.normalizeMessageBundleLocale(l||s||r||"en");return null==g?"en":g}async function u(a,t){const n=a.tagName.toLowerCase(),e=null!=t?t:s();let l;try{l=await r(n,e)}catch(a){console.warn(`no locale for ${n} (${e}) loading default locale en.`),l=await r(n,"en")}return[l,e]}async function o(a,n){try{i(a,await u(a.el),n)}catch(a){}finally{try{const[l]=await t(["esri/intl"]);l.onLocaleChange(function(a,n){return async l=>{const s=await async function(a){var n;if(!a)return"en";if(!!(null===(n=null==e?void 0:e.partial)||void 0===n?void 0:n[a]))return a;{const[n]=await t(["esri/intl"]),e=n.normalizeMessageBundleLocale(a);return null==e?"en":e}}(l),r=await u(a.el,s);i(a,r,n)}}(a,n))}catch(a){}}}function i(a,t,n){a.messages=t[0],n&&(a.messages=Object.assign(Object.assign({},a.messages),n))}export{g as a,u as b,s as c,o as g}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as i,h as s,H as e,g as n}from"./p-e996c38f.js";import{l as o}from"./p-438fdc33.js";import{g as a}from"./p-8f973b3d.js";import{g as l}from"./p-a9a72626.js";import"./p-3b3f77bc.js";import"./p-d4056c1c.js";import"./p-3423b5ef.js";const r="instant-apps-filter-list calcite-mode-light",c=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function d(t){return t.replaceAll("'","''")}function h(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 p(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 u="instant-apps-filter-list__item-container--user-input",v=class{constructor(s){t(this,s),this.filterListReset=i(this,"filterListReset",7),this.filterUpdate=i(this,"filterUpdate",7),this.isLayerExpUpdated=!1,this.layerExpressions=void 0,this.autoUpdateUrl=!1,this.closeBtn=!1,this.closeBtnOnClick=void 0,this.comboboxOverlayPositioning="absolute",this.closeBtnText=void 0,this.openFilters=!1,this.extentSelector=!1,this.extentSelectorConfig=void 0,this.urlParams=void 0,this.filterCount=0,this.view=void 0,this.zoomBtn=!0,this.resetBtn=!0,this.resetFiltersOnDisconnect=!0,this.loading=void 0,this.filterLayerExpressions=void 0,this.messages=void 0,this.baseClass=r,this.initDefExpressions=void 0,this.initMapImageExpressions=void 0,this.initPointCloudFilters=void 0}watchViewHandler(){this.handleWhenView()}watchLayerExpressions(){this.resetAllFilters(),this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleLayerExpressionsUpdate()}getFilterInitState(){return Promise.resolve({initDefExpressions:this.initDefExpressions,initMapImageExpressions:this.initMapImageExpressions,initPointCloudFilters:this.initPointCloudFilters})}forceReset(){return this.resetExpressions(),Promise.resolve()}updateInitDefExpressions(t){return this.initDefExpressions=t.initDefExpressions,this.initMapImageExpressions=t.initMapImageExpressions,this.initPointCloudFilters=t.initPointCloudFilters,Promise.resolve()}getCurrentLayerExpressions(){const t=structuredClone(this.filterLayerExpressions);return Promise.resolve(t)}handleUpdatingT9nData(t){var i;return null==t||null===(i=this.filterLayerExpressions)||void 0===i||i.forEach((i=>{var s;const e=null==t?void 0:t.find((t=>t.id===i.id));null!=e&&(i.title=e.title,null===(s=i.expressions)||void 0===s||s.forEach((t=>{var i;const s=null===(i=e.expressions)||void 0===i?void 0:i.find((i=>i.id===t.id));null!=s&&(t.name=s.name)})))})),Promise.resolve()}connectedCallback(){null==this.layerExpressions&&null==this.view||(this.isLayerExpUpdated=!0,this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleLayerExpressionsUpdate())}async componentWillLoad(){this.baseClass="dark"===l(this.el)?"instant-apps-filter-list calcite-mode-dark":r,await this.initializeModules(),a(this),this.isLayerExpUpdated||(this.isLayerExpUpdated=!0,this.filterLayerExpressions=null!=this.layerExpressions?structuredClone(this.layerExpressions):[],null!=this.view&&this.handleLayerExpressionsUpdate())}componentDidRender(){var t;null!=this.resetBtnEl&&(this.resetBtnEl.disabled=!((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0))}disconnectedCallback(){this.resetFiltersOnDisconnect&&(this.isLayerExpUpdated=!1,this.filterLayerExpressions=structuredClone(this.layerExpressions),this.resetAllFilters())}async initializeModules(){const[t,i]=await o(["esri/intl","esri/geometry/support/jsonUtils"]);this.geometryJsonUtils=i,this.locale=t.getLocale(),this.intl=t}render(){const t=this.loading?this.renderLoading():this.initFilterConfig(),i=this.renderFooter();return s(e,{key:"b3949fb2efa7587520eee01619be306a936b2f05"},s("calcite-panel",{key:"2336ee3cd209346516ebb12780f7158fc88aa35c",class:this.baseClass,ref:t=>this.panelEl=t},s("slot",{key:"d7400f3192055b45d9f75d19fcac85138f2958f8",slot:"header-content",name:"filter-header-content"}),s("slot",{key:"fb684d06b51fd62fcc56129851444fad10beafc4",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,o="OR"===(null==n?void 0:n.trim())?"orOperator":"andOperator",a=this.renderZoomTo(t);return s("calcite-block",{key:t.id,heading:t.title,description:null===(i=this.messages)||void 0===i?void 0:i[o],open:!!this.openFilters||void 0,collapsible:!0},a,e)}renderCombobox(t,i){var e;return s("label",{key:"combo-select",class:u},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",scale:"s",overlayPositioning:this.comboboxOverlayPositioning},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 o=this.createLabel(t,i),a=null==t?void 0:t.selectedFields,l=null!==(n=null==a?void 0:a.includes(i))&&void 0!==n&&n;return s("calcite-combobox-item",{key:`${o}-${e}`,value:i,heading:`${o}`,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,o,a,l,r,c,d;const h=null==i?void 0:i.min,p=null==i?void 0:i.max,v=(null==i?void 0:i.step)?i.step:1,m=null!==(e=null==i?void 0:i.field)&&void 0!==e?e:"",f=[null!=(null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.min)?i.range.min:h,null!=(null===(o=null==i?void 0:i.range)||void 0===o?void 0:o.max)?i.range.max:p];return null!=h&&null!=p?s("label",{key:null==i?void 0:i.id.toString(),class:u},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:h,max:p,minValue:h,maxValue:p,"min-label":null===(l=null===(a=this.messages)||void 0===a?void 0:a.minSlider)||void 0===l?void 0:l.replace("{field}",m),"max-label":null===(c=null===(r=this.messages)||void 0===r?void 0:r.maxSlider)||void 0===c?void 0:c.replace("{field}",m),step:v,labelHandles:!0,snap:!0,value:f,"group-separator":null===(d=null==i?void 0:i.format)||void 0===d?void 0:d.digitSeparator}))):void 0}renderDatePicker(t,i){var e,n,o,a;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:u},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!==(o=this.locale)&&void 0!==o?o:"en",layout:"vertical",value:c,range:!0}),s("calcite-action",{onClick:this.handleResetDatePicker.bind(this,i,t),icon:"reset",text:null===(a=this.messages)||void 0===a?void 0:a.resetDatePicker,scale:"s"}))):null}renderFooter(){var t,i,e;const n=null!=this.closeBtnText?this.closeBtnText:null===(t=this.messages)||void 0===t?void 0:t.close,o=this.closeBtn&&this.resetBtn?"half":"full";return s("div",{class:"instant-apps-filter-list__footer",slot:"footer"},this.resetBtn?s("calcite-button",{appearance:"outline",width:o,ref:t=>this.resetBtnEl=t,onClick:this.handleResetFilter.bind(this)},null===(i=this.messages)||void 0===i?void 0:i.resetFilter):void 0,this.closeBtn?s("calcite-button",{appearance:"solid",width:o,kind:"brand",onClick:null===(e=this.closeBtnOnClick)||void 0===e?void 0:e.bind(this)},n):void 0)}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){p(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,numDisplayOption:e,displayOption:n}=i;return"string"!==s&&"coded-value"!==s&&("number"!==s&&"range"!==s&&"date"!==s||"drop-down"!==e&&"drop-down"!==n)?"number"===s||"range"===s?this.renderNumberSlider(t,i):"date"===s?this.renderDatePicker(t,i):void 0:this.renderCombobox(t,i)}async initExpressions(){this.loading=!0,null!=this.filterLayerExpressions&&null!=this.view?(await this.processExpressions(),this.loading=!1):this.loading=!1}async processExpressions(){if(this.filterLayerExpressions)for(const t of this.filterLayerExpressions)for(const i of t.expressions||[])await this.setInitExpression(t,i)}handleResetFilter(){this.resetExpressions(),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetExpressions(){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,numDisplayOption:s,displayOption:e}=t;let n="";"string"!==i&&"coded-value"!==i&&("date"!==i||"drop-down"!==s&&"drop-down"!==e)&&("number"!==i&&"range"!==i||"drop-down"!==s&&"drop-down"!==e)?"date"===i?n="datePicker":"number"!==i&&"range"!==i||(n="numberRange"):n="combobox",n?this.resetExpressionUI(n,t):this.resetCheckbox(t),t.active=!1}))}))}resetExpressionUI(t,i){const{id:s}=i;switch(t){case"combobox":i.selectedFields=void 0;const t=this.panelEl.querySelector(`[id='${s}']`);t&&Array.from(t.children).forEach((t=>{t.selected=!1}));break;case"datePicker":i.range=void 0,p(this.panelEl.querySelector(`[id='${s}']`));break;case"numberRange":i.range=void 0;const e=this.panelEl.querySelector(`[id='${s}']`);e&&(e.minValue=i.min,e.maxValue=i.max)}}resetCheckbox(t){const{id:i}=t,s=this.panelEl.querySelector(`[id='${i}']`);null!=s&&(s.checked=!1)}resetAllFilters(){var t,i,s,e,n;if(null==this.initDefExpressions)return;const o=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==o||o.forEach((t=>{var i,s;if(!c.includes(t.type))return;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 s=this.findFilterLayer(t);return await this.getFeatureAttributes(s,i),this.handleDateField(s,i),!!(null==i?void 0:i.selectedFields)&&(i.definitionExpression=this.createDefinitionExpression(i),!0)}handleDateField(t,i){if("date"===i.type){const s=t.fields.find((({name:t})=>t===i.field));"date-only"===(null==s?void 0:s.type)&&(i.dateOnly=!0)}}createDefinitionExpression(t){var i;if(!(null===(i=t.selectedFields)||void 0===i?void 0:i.length))return"";const s=t.selectedFields.map((t=>"number"==typeof t?t:`'${d(t)}'`));return`${t.field} IN (${s.join(",")})`}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:o}=i;if(null!=o)if(this.setExpressionFormat(n,i,o),"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption))await this.getFeatureAttributes(n,i);else{const t=await this.calculateMinMaxStatistics(n,o),a=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(a[`min${o}`],i.format.places),i.max=this.roundMaxNumberUp(a[`max${o}`],i.format.places)):(i.min=a[`min${o}`],i.max=a[`max${o}`]),(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,o=this.findFilterLayer(t),a=await this.calculateMinMaxStatistics(o,e),l=null===(s=null==a?void 0:a[0])||void 0===s?void 0:s.attributes;if(i.min=h(l[`min${e}`]),i.max=h(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}async updateCodedValueExpression(t,i,s){var e,n;if(!(null==s?void 0:s.domain)||"coded-value"!==(null===(e=null==s?void 0:s.domain)||void 0===e?void 0:e.type))return!1;const o=this.findFilterLayer(t);await this.getFeatureAttributes(o,i);const a=s.domain.codedValues.reduce(((t,{code:i,name:s})=>(t[i]=s,t)),{});if(i.codedValues=a,null===(n=i.selectedFields)||void 0===n?void 0:n.length){const t=i.selectedFields.map((t=>"number"==typeof t?t:`'${d(t)}'`)).join(",");return i.definitionExpression=`${i.field} IN (${t})`,!0}return!1}updateRangeExpression(t,i){var s;if(!(null==i?void 0:i.domain)||"range"!==(null===(s=null==i?void 0:i.domain)||void 0===s?void 0:s.type))return!1;const{field:e,range:n}=t;return t.min=i.domain.minValue,t.max=i.domain.maxValue,!(!n||!Object.keys(n).length||(t.definitionExpression=`${e} BETWEEN ${n.min} AND ${n.max}`,0))}async getFeatureAttributes(t,i){if(!this.isLayerSupported(t))return void(i.fields=[]);const s=await this.getQueryLayer(t),{maxRecordCount:e,supportsMaxRecordCountFactor:n}=this.extractQueryCapabilities(t),o=await s.queryFeatureCount(),a=this.createQuery(s,i);await this.queryDistinctFeatures(s,a,i),this.shouldPaginate(e,o,n)&&this.handlePagination(s,a,e,n,o,i)}isLayerSupported(t){return t&&c.includes(t.type)}extractQueryCapabilities(t){var i,s,e,n,o,a;return{maxRecordCount:null!==(e=null===(s=null===(i=t.capabilities)||void 0===i?void 0:i.query)||void 0===s?void 0:s.maxRecordCount)&&void 0!==e?e:null===(n=t.sourceJSON)||void 0===n?void 0:n.maxRecordCount,supportsMaxRecordCountFactor:null===(a=null===(o=t.capabilities)||void 0===o?void 0:o.query)||void 0===a?void 0:a.supportsMaxRecordCountFactor}}createQuery(t,i){const s=t.createQuery();this.applyCacheHint(t,s);const e=null==i?void 0:i.field;if(e){const i=this.getInitDefExprFromLayer(t);s.where=i||"1=1",s.outFields=[e],s.orderByFields=[`${e} ASC`],s.returnDistinctValues=!0,s.returnGeometry=!1,s.maxRecordCountFactor=5,this.applyQueryGeometryFromExtentSelector(s)}return s}async queryDistinctFeatures(t,i,s){if(!i.outFields)return;const e=await this.queryForFeatures(t,i,i.outFields[0]);(null==e?void 0:e.length)&&(s.fields=[...new Set(e)],"string"===s.type?s.fields=s.fields.sort(((t,i)=>t.localeCompare(i))):"number"===s.type&&(s.fields=s.fields.sort(((t,i)=>t-i))))}getQueryCount(t,i){return i?5*t:t}shouldPaginate(t,i,s){const e=this.getQueryCount(t,s);return null!=t&&i>e}async handlePagination(t,i,s,e,n,o){const a=this.getQueryCount(s,e),l=[];for(let e=a;e<n;e+=a){const n=i.clone();n.num=s,n.start=e,l.push(this.queryForFeatures(t,n,i.outFields[0]))}Promise.all(l).then((t=>{t.forEach((t=>{(null==t?void 0:t.length)&&o.fields&&o.fields.push(...t)})),o.fields="string"===o.type?[...new Set(o.fields)].sort(((t,i)=>t.localeCompare(i))):"number"===o.type?[...new Set(o.fields)].sort(((t,i)=>t-i)):[...new Set(o.fields)].sort()}))}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){if(!t||!c.includes(t.type)||!i)return[];const s=this.createStatisticsQuery(t,i),e=await t.queryFeatures(s);return(null==e?void 0:e.features)||[]}createStatisticsQuery(t,i){const s=t.createQuery();return s.where=this.getInitDefExprFromLayer(t)||"1=1",this.applyCacheHint(t,s),s.outStatistics=[{onStatisticField:i,outStatisticFieldName:`max${i}`,statisticType:"max"},{onStatisticField:i,outStatisticFieldName:`min${i}`,statisticType:"min"}],this.applyQueryGeometryFromExtentSelector(s),s}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="extent"in e?e:this.geometryJsonUtils.fromJSON(e);if("extent"===(null==t?void 0:t.type)||"polygon"===(null==t?void 0:t.type))return t}}}async setInitExpression(t,i){if(!i.field||!i.type)return void await this.updateExpression(t,i,void 0);const s=this.findFilterLayer(t);s&&("not-loaded"!==s.loadStatus&&"failed"!==s.loadStatus||await s.load(),await s.when((async()=>{var e,n;const o=null===(e=s.fields)||void 0===e?void 0:e.find((({name:t})=>t===i.field)),a=null===(n=null==o?void 0:o.domain)||void 0===n?void 0:n.type;i.type="coded-value"===a||"range"===a?a:i.type,await this.updateExpression(t,i,o)})))}async updateExpression(t,i,s){await this.handleExpressionType(t,i,s)&&this.generateOutput(t)}async handleExpressionType(t,i,s){var e;switch(i.type){case"string":return await this.updateStringExpression(t,i);case"number":return await this.updateNumberExpression(t,i);case"date":return await this.updateDateExpressionBasedOnDisplayOption(t,i);case"coded-value":return await this.updateCodedValueExpression(t,i,s);case"range":return await this.updateRangeExpressionBasedOnDisplayOption(t,i,s);case"checkbox":case null:case void 0:return null!==(e=i.active)&&void 0!==e&&e;default:return!1}}async updateDateExpressionBasedOnDisplayOption(t,i){return"drop-down"===i.displayOption?await this.updateStringExpression(t,i):await this.updateDateExpression(t,i)}async updateRangeExpressionBasedOnDisplayOption(t,i,s){return"drop-down"===i.displayOption?await this.updateStringExpression(t,i):this.updateRangeExpression(i,s)}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:o}=t;if(t.selectedFields=e.map((({value:t})=>t)),e.length){const i=e.map((({value:t})=>"number"==typeof t?t:`'${d(t)}'`));t.definitionExpression="date"===o?i.map((t=>this.buildDateExpression(t,n))).join(" OR "):`${n} IN (${i.join(",")})`,t.active=!0}else t.definitionExpression=void 0,t.active=!1;this.generateOutput(i)}handleDatePickerRangeChange(t,i,s){const e=s.target,[n,o]=e.valueAsDate,a=n?h(Math.floor(n.getTime()),!0):void 0,l=o?h(Math.floor(o.getTime()),!0):void 0;(a||l)&&(t.definitionExpression=this.constructDefinitionExpression(t.field,a,l),t.range={min:a,max:l},t.active=!0,this.generateOutput(i))}constructDefinitionExpression(t,i,s){return i?s?`${t} BETWEEN '${i}' AND '${s}'`:`${t} > '${i}'`:`${t} < '${s}'`}handleURLParams(){if(!("URLSearchParams"in window))return;const t=new URLSearchParams(document.location.search).get("filter");if(!t)return void(this.filterCount=0);const i=t.split(";").map((t=>JSON.parse(t)));this.filterCount=this.applyFilters(i)}applyFilters(t){let i=0;return t.forEach((t=>{var s,e;const n=null===(s=this.filterLayerExpressions)||void 0===s?void 0:s.find((i=>i.id===t.layerId));n&&(null===(e=n.expressions)||void 0===e||e.forEach((s=>{var e,n;(null===(e=s.id)||void 0===e?void 0:e.toString())===(null===(n=t.expressionId)||void 0===n?void 0:n.toString())&&(this.activateExpression(s,t),i++)})))})),i}activateExpression(t,i){t.active=!0,"range"===i.type?t.range=i.range:"select"===i.type&&(t.selectedFields=i.selectedFields)}createURLParamExpression(t,i){const{id:s,range:e,selectedFields:n,type:o}=i;return"string"===o||"coded-value"===o||"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"===o||"range"===o||"date"===o?{type:"range",layerId:t.id,expressionId:s.toString(),range:e}:{layerId:t.id,expressionId:s.toString()}}autoUpdateURLCheck(t){if(this.autoUpdateUrl){const i=t.toString()?`${window.location.pathname}?${t}`.trim():window.location.pathname;window.history.replaceState({},"",i)}}generateURLParams(){var t;if(!("URLSearchParams"in window))return;const i=new URLSearchParams(window.location.search),s=(null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.flatMap((t=>{var i;return(null===(i=null==t?void 0:t.expressions)||void 0===i?void 0:i.filter((t=>t.active)).map((i=>JSON.stringify(this.createURLParamExpression(t,i)))))||[]})))||[];this.filterCount=s.length,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 o=(null==i?void 0:i.length)>0&&null!=n?`(${i.join(e)}) AND (${n})`:i.length>0?i.join(e):n;t.definitionExpression=o}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(){this.updateInitExpressions(),this.handleURLParams(),this.initExpressions()}async handleZoomTo(t){const i=this.panelEl.querySelector((null==t?void 0:t.sublayerId)?`#zoom-to-${t.id}-${t.sublayerId}`:`#zoom-to-${t.id}`),s=(t,s)=>{i&&(i.loading=t,i.disabled=s)};s(!0,!0),await this.getZoomToExtent(t);const e="point"===this.zoomToExtent.type&&1===this.zoomToExtent.count?{target:this.zoomToExtent.extent,zoom:10}:this.zoomToExtent.extent;await this.view.goTo(e),s(!1,!1)}async getZoomToExtent(t){var i;const s=this.view.allLayerViews.find((({layer:i})=>i.id===t.id)),e=s.layer,n="map-image"===e.type?e.findSublayerById(t.sublayerId):e;if("point-cloud"!==n.type&&c.includes(null==n?void 0:n.type)){const t=await this.getQueryLayer(n),s=t.createQuery();s.where=null!==(i=t.definitionExpression)&&void 0!==i?i:"1=1";const e=await t.queryExtent(s);this.zoomToExtent=Object.assign(Object.assign({},e),{type:t.geometryType})}}applyFilterToQuery(t,i){var s,e;const n=this.view.allLayerViews.find((({layer:t})=>t.id===i.id)),o=null!==(e=null===(s=null==n?void 0:n.featureEffect)||void 0===s?void 0:s.filter)&&void 0!==e?e:n.filter;o&&["objectIds","distance","geometry","spatialRelationship","units","where","timeExtent"].forEach((i=>{null!=o[i]&&(t[i]=o[i])}))}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:o}=e;t&&n&&i.push(`(${n})`),t&&null!=o&&o.length>0&&(s=s.concat(o))}this.updateFilter(t,i,s),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(t){return t.toLocaleString("en-US",{maximumFractionDigits:20})}scientificRounding(t,i,s){if(null==t)return;let e;if(String(t).includes("e")){const[n,o]=String(t).split("e").map((t=>Number(t)));e=Math[s](+`${n}e${o+i}`)*Math.pow(10,-i)}else e=Math[s](t*Math.pow(10,i))/Math.pow(10,i);return+e.toFixed(i)}roundMinNumberDown(t,i){return this.scientificRounding(t,i,"floor")}roundMaxNumberUp(t,i){return this.scientificRounding(t,i,"ceil")}roundNumber(t,i){var s;return null!==(s=this.scientificRounding(t,i,"round"))&&void 0!==s?s:t}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,e,n;if("coded-value"===t.type)return null===(s=t.codedValues)||void 0===s?void 0:s[i];if("number"===t.type&&"number"==typeof i){let s=i;return null!=(null===(e=t.format)||void 0===e?void 0:e.places)&&(s=this.roundNumber(i,t.format.places)),(null===(n=t.format)||void 0===n?void 0:n.digitSeparator)?this.numberWithCommas(s):s}if("date"===t.type&&!t.dateOnly){const t=this.intl.convertDateFormatToIntlOptions("short-date-long-time");return this.intl.formatDate(i,t)}return i}buildDateExpression(t,i){if(t){const s=new Date(t),e=new Date(t),n=new Date(e.setDate(s.getDate()+1)),o=`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`,a=`${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}`,l=`${n.getHours()}:${n.getMinutes()}:${n.getSeconds()}`;return`${i} BETWEEN '${o} ${a}' AND '${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()} ${l}'`}}async getQueryLayer(t){return"sublayer"===t.type?await t.createFeatureLayer():t}applyCacheHint(t,i){var s,e;(null===(e=null===(s=null==t?void 0:t.capabilities)||void 0===s?void 0:s.query)||void 0===e?void 0:e.supportsCacheHint)&&(i.cacheHint=!0)}applyQueryGeometryFromExtentSelector(t){if(!this.extentSelector||!this.extentSelectorConfig)return;const i=this.getExtent(this.extentSelector,this.extentSelectorConfig);i&&(t.geometry=i,t.spatialRelationship="intersects")}updateInitExpressions(){if(null==this.view)return;const t=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={},t.allLayers.concat(t.allTables).forEach((t=>{if(!c.includes(t.type))return;const i=t;"point-cloud"===i.type?this.initPointCloudFilters[i.id]=i.filters:"map-image"===i.type?this.initMapImageExpressions[i.id]=i.allSublayers.reduce(((t,i)=>(t[i.id]=i.definitionExpression,t)),{}):this.initDefExpressions[i.id]=i.definitionExpression}))}get el(){return n(this)}static get watchers(){return{view:["watchViewHandler"],layerExpressions:["watchLayerExpressions"]}}};v.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%;font-size:16px;--calcite-combobox-input-height:24px}.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 m="instant-apps-social-share",f=".calcite-mode-dark",_={base:m,dialog:`${m}__dialog`,dialogEmbed:`${m}__dialog-embed`,dialogContent:`${m}__dialog-content`,options:`${m}__options`,tipContainer:`${m}__tip`,tipHeader:`${m}__tip-header`,tipContent:`${m}__tip-content`,icon:`${m}__icon`,iconContainer:`${m}__icon-container`,optionText:`${m}__option-text`,popoverButton:`${m}__popover-button`,layout:{vertical:`${m}__layout--vertical`,horizontal:`${m}__layout--horizontal`},xLogo:{light:`${m}__x-logo--light`,dark:`${m}__x-logo--dark`},success:{container:`${m}__success`,header:`${m}__success-header`,message:`${m}__success-message`,icon:`${m}__success-icon`},embed:{container:`${m}__embed`,header:`${m}__embed-header`,embedCode:{container:`${m}__embed-code`,textArea:`${m}__embed-code-text-area`,copyButton:`${m}__embed-code-copy-button`},textAreaText:`${m}__embed-text-area-text`,dimensions:{container:`${m}__embed-dimensions`,input:`${m}__embed-dimensions-input`}},rtl:{optionText:`${m}__option-text--rtl`,textArea:`${m}__text-area--rtl`}},b={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",x:"https://x.com/intent/post?url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}"},g=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.popoverPositioning="absolute",this.removePopoverOffset=!1,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;a(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,o,a,l;const r=this.copied&&"popover"===this.mode?this.renderSuccess():s("div",{class:_.dialogContent},this.renderOptions(),this.displayTipText?this.renderTip():null,this.embed?this.renderEmbed():null),c="vertical"===this.shareIconsLayout?` ${_.layout.vertical}`:` ${_.layout.horizontal}`,d=" calcite-mode-"+(this.el.closest(f)?"dark":"light"),h=s("div",{key:"6fa27d9de3fff34dde6702cdbeac00b799355651",ref:t=>this.dialogContentRef=t,class:`${_.dialog}${c}${d}`},r);return s(e,{key:"d35d755dc0d1a827e7859a86366b4f03a6c02a28"},"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,"overlay-positioning":this.popoverPositioning,"offset-distance":this.removePopoverOffset?0:6,"pointer-disabled":this.removePopoverOffset},h),this.renderButton()]:[h,s("calcite-popover",{ref:t=>this.copyLinkPopoverRef=t,label:null===(o=null===(n=this.messages)||void 0===n?void 0:n.share)||void 0===o?void 0:o.label,referenceElement:"copyToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderSuccess()),s("calcite-popover",{ref:t=>this.copyEmbedPopoverRef=t,label:null===(l=null===(a=this.messages)||void 0===a?void 0:a.share)||void 0===l?void 0:l.label,referenceElement:"copyEmbedToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderEmbedSuccess())])}renderButton(){var t,i,e,n,o,a,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:_.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:_.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:_.popoverButton,appearance:"transparent",label:null===(a=null===(o=this.messages)||void 0===o?void 0:o.share)||void 0===a?void 0:a.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:"",alignment:"center"},s("div",{class:_.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:_.success.container},s("span",{class:_.success.header},s("span",{class:_.success.icon},s("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),s("span",{class:_.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:_.success.container},s("span",{class:_.success.header},s("span",{class:_.success.icon},s("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),s("span",{class:_.success.message},null==i?void 0:i.embed))}renderOptions(){var t,i,e,n;const o=null===(t=this.messages)||void 0===t?void 0:t.options,a="rtl"===document.dir?` ${_.rtl.optionText}`:"";return s("ul",{ref:t=>this.shareListRef=t,class:_.options,role:"menu"},s("li",{id:"copyToClipboard",onClick:this.handleShareItem.bind(this,"link"),onKeyDown:this.handleOptionKeyDown("link"),role:"menuitem",tabindex:"0"},s("span",{class:_.icon},s("calcite-icon",{icon:"link",scale:this.scale})),s("span",{class:`${_.optionText}${a}`},null===(i=null==o?void 0:o.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:_.icon},this.renderFacebookIcon()),s("span",{class:`${_.optionText}${a}`},null===(e=null==o?void 0:o.facebook)||void 0===e?void 0:e.label)),s("li",{onClick:this.handleShareItem.bind(this,"x"),onKeyDown:this.handleOptionKeyDown("x"),role:"menuitem",tabindex:"0"},s("span",{class:_.icon},this.renderXIcon()),s("span",{class:`${_.optionText}${a}`},"X")),s("li",{onClick:this.handleShareItem.bind(this,"linkedIn"),onKeyDown:this.handleOptionKeyDown("linkedIn"),role:"menuitem",tabindex:"0"},s("span",{class:_.icon},this.renderLinkedInIcon()),s("span",{class:`${_.optionText}${a}`},null===(n=null==o?void 0:o.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"}})))}renderXIcon(){const t=!!this.el.closest(f);return s("svg",{class:t?_.xLogo.dark:_.xLogo.light,viewBox:"0 0 1200 1227",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s("rect",{height:"400",style:{fill:"none"},width:"400",x:"56",y:"56"}),s("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",fill:t?"white":"black"}))}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:_.tipContainer},s("span",{class:_.tipHeader},s("calcite-icon",{icon:"lightbulb",scale:this.scale}),s("span",null,null==i?void 0:i.label)),s("p",{class:_.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,o="rtl"===document.dir?` ${_.rtl.textArea}`:"";return s("div",{class:_.embed.container},s("span",{class:_.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:_.embed.embedCode.container},s("div",{class:_.embed.embedCode.textArea},s("textarea",{ref:t=>this.embedCodeRef=t,cols:30,rows:5,readonly:!0,class:o,value:this.getEmbedCode()}),s("button",{id:"copyEmbedToClipboard",onClick:this.copyEmbedCode.bind(this),class:_.embed.embedCode.copyButton},s("calcite-icon",{icon:"copy",scale:this.scale}),s("span",null,null==n?void 0:n.copy))),s("span",{class:_.embed.textAreaText},s("slot",{name:"text-area-text"})),s("div",{class:_.embed.dimensions.container},s("label",{class:_.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:_.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 l=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,r=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&&!l;!r&&this.shortenShareUrl&&(a=await this.shortenUrl(this.shareUrl));let c=a||this.shareUrl;switch(t){case"link":return navigator.clipboard.writeText(c),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"x":case"linkedIn":let i;r&&(i=window.open("","_blank"),this.shortenShareUrl&&(c=await this.shortenUrl(this.shareUrl)||c));const s={url:encodeURI(c)},e="x"===t?Object.assign(Object.assign({},s),{text:this.shareText}):s,[n]=await o(["esri/intl"]),a=n.substitute(b[t],e);return"popover"===this.mode&&this.closePopover(),void(r&&i?(i.location=a,i.focus()):window.open(encodeURI(a),"_blank"))}}async shortenUrl(t){var i,s;const[e]=await o(["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 o(["esri/geometry/Point","esri/geometry/SpatialReference"]),l=new n({x:i,y:s,spatialReference:new a(Object.assign({},e.toJSON()))}),r=await this.processPoint(l),{isWGS84:c,isWebMercator:d}=r.spatialReference;return this.generateShareUrlParams(r,c||d)}async processPoint(t){const{isWGS84:i,isWebMercator:s}=t.spatialReference;if(i||s)return t;const[e,n]=await o(["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,o,a;const{longitude:l,latitude:r,x:c,y:d}=t;if(void 0===l||void 0===r)return this.shareUrl;const h=this.roundValue(i?l:c),p=this.roundValue(i?r:d),{zoom:u}=this.view,v=this.roundValue(u),m=null===(e=null===(s=this.view)||void 0===s?void 0:s.popup)||void 0===e?void 0:e.selectedFeature,f=null===(o=null===(n=this.view)||void 0===n?void 0:n.popup)||void 0===o?void 0:o.visible;let _,b,g;if(m&&f&&"feature"===(null===(a=null==m?void 0:m.layer)||void 0===a?void 0:a.type)){const t=null==m?void 0:m.layer;_=null==t?void 0:t.id,b=m.attributes[t.objectIdField]}g=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";");const{type:x}=this.view,{defaultUrlParams:w}=this,y=new URL(this.shareUrl),{searchParams:$}=y;if($.get("center")&&$.delete("center"),$.get("level")&&$.delete("level"),$.get("selectedFeature")&&$.delete("selectedFeature"),$.get("hiddenLayers")&&$.delete("hiddenLayers"),$.get("viewpoint")&&$.delete("viewpoint"),"3d"===x){const{camera:t}=this.view,{heading:i,position:s,tilt:e}=t,{longitude:n,latitude:o,z:a}=s,l={longitude:this.roundValue(n,8),latitude:this.roundValue(o,8),z:this.roundValue(a,3),heading:this.roundValue(i,3),tilt:this.roundValue(e,3)};return!1!==(null==w?void 0:w.viewpoint)&&y.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),_&&b&&!1!==(null==w?void 0:w.selectedFeature)&&y.searchParams.set("selectedFeature",`${_};${b}`),g&&!1!==(null==w?void 0:w.hiddenLayers)&&y.searchParams.set("hiddenLayers",g),y.search=decodeURIComponent(y.search),y.href}return!1!==(null==w?void 0:w.center)&&y.searchParams.set("center",`${h};${p}`),!1!==(null==w?void 0:w.level)&&y.searchParams.set("level",`${v}`),_&&b&&!1!==(null==w?void 0:w.selectedFeature)&&y.searchParams.set("selectedFeature",`${_};${b}`),g&&!1!==(null==w?void 0:w.hiddenLayers)&&y.searchParams.set("hiddenLayers",g),y.search=decodeURIComponent(y.search),y.href}roundValue(t,i=4){return parseFloat(t.toFixed(i))}get el(){return n(this)}};g.style=":host{display:block;--instant-apps-social-share-action-width:initial;--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;color:var(--calcite-color-text-1)}: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__options__x-logo--light path{fill:#000000}:host .instant-apps-social-share__options__x-logo--dark path{fill:#ffffff}: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;direction:ltr}: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 calcite-action{width:var(--instant-apps-social-share-action-width)}: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{v as instant_apps_filter_list,g as instant_apps_social_share}
|
6
|
+
import{r as t,c as i,h as s,H as e,g as n}from"./p-e996c38f.js";import{l as o}from"./p-08ad0b7a.js";import{g as a}from"./p-2884ca49.js";import{g as l}from"./p-a9a72626.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const r="instant-apps-filter-list calcite-mode-light",c=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function d(t){return t.replaceAll("'","''")}function h(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 p(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 u="instant-apps-filter-list__item-container--user-input",v=class{constructor(s){t(this,s),this.filterListReset=i(this,"filterListReset",7),this.filterUpdate=i(this,"filterUpdate",7),this.isLayerExpUpdated=!1,this.layerExpressions=void 0,this.autoUpdateUrl=!1,this.closeBtn=!1,this.closeBtnOnClick=void 0,this.comboboxOverlayPositioning="absolute",this.closeBtnText=void 0,this.openFilters=!1,this.extentSelector=!1,this.extentSelectorConfig=void 0,this.urlParams=void 0,this.filterCount=0,this.view=void 0,this.zoomBtn=!0,this.resetBtn=!0,this.resetFiltersOnDisconnect=!0,this.loading=void 0,this.filterLayerExpressions=void 0,this.messages=void 0,this.baseClass=r,this.initDefExpressions=void 0,this.initMapImageExpressions=void 0,this.initPointCloudFilters=void 0}watchViewHandler(){this.handleWhenView()}watchLayerExpressions(){this.resetAllFilters(),this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleLayerExpressionsUpdate()}getFilterInitState(){return Promise.resolve({initDefExpressions:this.initDefExpressions,initMapImageExpressions:this.initMapImageExpressions,initPointCloudFilters:this.initPointCloudFilters})}forceReset(){return this.resetExpressions(),Promise.resolve()}updateInitDefExpressions(t){return this.initDefExpressions=t.initDefExpressions,this.initMapImageExpressions=t.initMapImageExpressions,this.initPointCloudFilters=t.initPointCloudFilters,Promise.resolve()}getCurrentLayerExpressions(){const t=structuredClone(this.filterLayerExpressions);return Promise.resolve(t)}handleUpdatingT9nData(t){var i;return null==t||null===(i=this.filterLayerExpressions)||void 0===i||i.forEach((i=>{var s;const e=null==t?void 0:t.find((t=>t.id===i.id));null!=e&&(i.title=e.title,null===(s=i.expressions)||void 0===s||s.forEach((t=>{var i;const s=null===(i=e.expressions)||void 0===i?void 0:i.find((i=>i.id===t.id));null!=s&&(t.name=s.name)})))})),Promise.resolve()}connectedCallback(){null==this.layerExpressions&&null==this.view||(this.isLayerExpUpdated=!0,this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleLayerExpressionsUpdate())}async componentWillLoad(){this.baseClass="dark"===l(this.el)?"instant-apps-filter-list calcite-mode-dark":r,await this.initializeModules(),a(this),this.isLayerExpUpdated||(this.isLayerExpUpdated=!0,this.filterLayerExpressions=null!=this.layerExpressions?structuredClone(this.layerExpressions):[],null!=this.view&&this.handleLayerExpressionsUpdate())}componentDidRender(){var t;null!=this.resetBtnEl&&(this.resetBtnEl.disabled=!((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0))}disconnectedCallback(){this.resetFiltersOnDisconnect&&(this.isLayerExpUpdated=!1,this.filterLayerExpressions=structuredClone(this.layerExpressions),this.resetAllFilters())}async initializeModules(){const[t,i]=await o(["esri/intl","esri/geometry/support/jsonUtils"]);this.geometryJsonUtils=i,this.locale=t.getLocale(),this.intl=t}render(){const t=this.loading?this.renderLoading():this.initFilterConfig(),i=this.renderFooter();return s(e,{key:"b3949fb2efa7587520eee01619be306a936b2f05"},s("calcite-panel",{key:"2336ee3cd209346516ebb12780f7158fc88aa35c",class:this.baseClass,ref:t=>this.panelEl=t},s("slot",{key:"d7400f3192055b45d9f75d19fcac85138f2958f8",slot:"header-content",name:"filter-header-content"}),s("slot",{key:"fb684d06b51fd62fcc56129851444fad10beafc4",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,o="OR"===(null==n?void 0:n.trim())?"orOperator":"andOperator",a=this.renderZoomTo(t);return s("calcite-block",{key:t.id,heading:t.title,description:null===(i=this.messages)||void 0===i?void 0:i[o],open:!!this.openFilters||void 0,collapsible:!0},a,e)}renderCombobox(t,i){var e;return s("label",{key:"combo-select",class:u},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",scale:"s",overlayPositioning:this.comboboxOverlayPositioning},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 o=this.createLabel(t,i),a=null==t?void 0:t.selectedFields,l=null!==(n=null==a?void 0:a.includes(i))&&void 0!==n&&n;return s("calcite-combobox-item",{key:`${o}-${e}`,value:i,heading:`${o}`,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,o,a,l,r,c,d;const h=null==i?void 0:i.min,p=null==i?void 0:i.max,v=(null==i?void 0:i.step)?i.step:1,m=null!==(e=null==i?void 0:i.field)&&void 0!==e?e:"",f=[null!=(null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.min)?i.range.min:h,null!=(null===(o=null==i?void 0:i.range)||void 0===o?void 0:o.max)?i.range.max:p];return null!=h&&null!=p?s("label",{key:null==i?void 0:i.id.toString(),class:u},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:h,max:p,minValue:h,maxValue:p,"min-label":null===(l=null===(a=this.messages)||void 0===a?void 0:a.minSlider)||void 0===l?void 0:l.replace("{field}",m),"max-label":null===(c=null===(r=this.messages)||void 0===r?void 0:r.maxSlider)||void 0===c?void 0:c.replace("{field}",m),step:v,labelHandles:!0,snap:!0,value:f,"group-separator":null===(d=null==i?void 0:i.format)||void 0===d?void 0:d.digitSeparator}))):void 0}renderDatePicker(t,i){var e,n,o,a;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:u},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!==(o=this.locale)&&void 0!==o?o:"en",layout:"vertical",value:c,range:!0}),s("calcite-action",{onClick:this.handleResetDatePicker.bind(this,i,t),icon:"reset",text:null===(a=this.messages)||void 0===a?void 0:a.resetDatePicker,scale:"s"}))):null}renderFooter(){var t,i,e;const n=null!=this.closeBtnText?this.closeBtnText:null===(t=this.messages)||void 0===t?void 0:t.close,o=this.closeBtn&&this.resetBtn?"half":"full";return s("div",{class:"instant-apps-filter-list__footer",slot:"footer"},this.resetBtn?s("calcite-button",{appearance:"outline",width:o,ref:t=>this.resetBtnEl=t,onClick:this.handleResetFilter.bind(this)},null===(i=this.messages)||void 0===i?void 0:i.resetFilter):void 0,this.closeBtn?s("calcite-button",{appearance:"solid",width:o,kind:"brand",onClick:null===(e=this.closeBtnOnClick)||void 0===e?void 0:e.bind(this)},n):void 0)}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){p(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,numDisplayOption:e,displayOption:n}=i;return"string"!==s&&"coded-value"!==s&&("number"!==s&&"range"!==s&&"date"!==s||"drop-down"!==e&&"drop-down"!==n)?"number"===s||"range"===s?this.renderNumberSlider(t,i):"date"===s?this.renderDatePicker(t,i):void 0:this.renderCombobox(t,i)}async initExpressions(){this.loading=!0,null!=this.filterLayerExpressions&&null!=this.view?(await this.processExpressions(),this.loading=!1):this.loading=!1}async processExpressions(){if(this.filterLayerExpressions)for(const t of this.filterLayerExpressions)for(const i of t.expressions||[])await this.setInitExpression(t,i)}handleResetFilter(){this.resetExpressions(),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetExpressions(){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,numDisplayOption:s,displayOption:e}=t;let n="";"string"!==i&&"coded-value"!==i&&("date"!==i||"drop-down"!==s&&"drop-down"!==e)&&("number"!==i&&"range"!==i||"drop-down"!==s&&"drop-down"!==e)?"date"===i?n="datePicker":"number"!==i&&"range"!==i||(n="numberRange"):n="combobox",n?this.resetExpressionUI(n,t):this.resetCheckbox(t),t.active=!1}))}))}resetExpressionUI(t,i){const{id:s}=i;switch(t){case"combobox":i.selectedFields=void 0;const t=this.panelEl.querySelector(`[id='${s}']`);t&&Array.from(t.children).forEach((t=>{t.selected=!1}));break;case"datePicker":i.range=void 0,p(this.panelEl.querySelector(`[id='${s}']`));break;case"numberRange":i.range=void 0;const e=this.panelEl.querySelector(`[id='${s}']`);e&&(e.minValue=i.min,e.maxValue=i.max)}}resetCheckbox(t){const{id:i}=t,s=this.panelEl.querySelector(`[id='${i}']`);null!=s&&(s.checked=!1)}resetAllFilters(){var t,i,s,e,n;if(null==this.initDefExpressions)return;const o=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==o||o.forEach((t=>{var i,s;if(!c.includes(t.type))return;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 s=this.findFilterLayer(t);return await this.getFeatureAttributes(s,i),this.handleDateField(s,i),!!(null==i?void 0:i.selectedFields)&&(i.definitionExpression=this.createDefinitionExpression(i),!0)}handleDateField(t,i){if("date"===i.type){const s=t.fields.find((({name:t})=>t===i.field));"date-only"===(null==s?void 0:s.type)&&(i.dateOnly=!0)}}createDefinitionExpression(t){var i;if(!(null===(i=t.selectedFields)||void 0===i?void 0:i.length))return"";const s=t.selectedFields.map((t=>"number"==typeof t?t:`'${d(t)}'`));return`${t.field} IN (${s.join(",")})`}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:o}=i;if(null!=o)if(this.setExpressionFormat(n,i,o),"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption))await this.getFeatureAttributes(n,i);else{const t=await this.calculateMinMaxStatistics(n,o),a=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(a[`min${o}`],i.format.places),i.max=this.roundMaxNumberUp(a[`max${o}`],i.format.places)):(i.min=a[`min${o}`],i.max=a[`max${o}`]),(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,o=this.findFilterLayer(t),a=await this.calculateMinMaxStatistics(o,e),l=null===(s=null==a?void 0:a[0])||void 0===s?void 0:s.attributes;if(i.min=h(l[`min${e}`]),i.max=h(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}async updateCodedValueExpression(t,i,s){var e,n;if(!(null==s?void 0:s.domain)||"coded-value"!==(null===(e=null==s?void 0:s.domain)||void 0===e?void 0:e.type))return!1;const o=this.findFilterLayer(t);await this.getFeatureAttributes(o,i);const a=s.domain.codedValues.reduce(((t,{code:i,name:s})=>(t[i]=s,t)),{});if(i.codedValues=a,null===(n=i.selectedFields)||void 0===n?void 0:n.length){const t=i.selectedFields.map((t=>"number"==typeof t?t:`'${d(t)}'`)).join(",");return i.definitionExpression=`${i.field} IN (${t})`,!0}return!1}updateRangeExpression(t,i){var s;if(!(null==i?void 0:i.domain)||"range"!==(null===(s=null==i?void 0:i.domain)||void 0===s?void 0:s.type))return!1;const{field:e,range:n}=t;return t.min=i.domain.minValue,t.max=i.domain.maxValue,!(!n||!Object.keys(n).length||(t.definitionExpression=`${e} BETWEEN ${n.min} AND ${n.max}`,0))}async getFeatureAttributes(t,i){if(!this.isLayerSupported(t))return void(i.fields=[]);const s=await this.getQueryLayer(t),{maxRecordCount:e,supportsMaxRecordCountFactor:n}=this.extractQueryCapabilities(t),o=await s.queryFeatureCount(),a=this.createQuery(s,i);await this.queryDistinctFeatures(s,a,i),this.shouldPaginate(e,o,n)&&this.handlePagination(s,a,e,n,o,i)}isLayerSupported(t){return t&&c.includes(t.type)}extractQueryCapabilities(t){var i,s,e,n,o,a;return{maxRecordCount:null!==(e=null===(s=null===(i=t.capabilities)||void 0===i?void 0:i.query)||void 0===s?void 0:s.maxRecordCount)&&void 0!==e?e:null===(n=t.sourceJSON)||void 0===n?void 0:n.maxRecordCount,supportsMaxRecordCountFactor:null===(a=null===(o=t.capabilities)||void 0===o?void 0:o.query)||void 0===a?void 0:a.supportsMaxRecordCountFactor}}createQuery(t,i){const s=t.createQuery();this.applyCacheHint(t,s);const e=null==i?void 0:i.field;if(e){const i=this.getInitDefExprFromLayer(t);s.where=i||"1=1",s.outFields=[e],s.orderByFields=[`${e} ASC`],s.returnDistinctValues=!0,s.returnGeometry=!1,s.maxRecordCountFactor=5,this.applyQueryGeometryFromExtentSelector(s)}return s}async queryDistinctFeatures(t,i,s){if(!i.outFields)return;const e=await this.queryForFeatures(t,i,i.outFields[0]);(null==e?void 0:e.length)&&(s.fields=[...new Set(e)],"string"===s.type?s.fields=s.fields.sort(((t,i)=>t.localeCompare(i))):"number"===s.type&&(s.fields=s.fields.sort(((t,i)=>t-i))))}getQueryCount(t,i){return i?5*t:t}shouldPaginate(t,i,s){const e=this.getQueryCount(t,s);return null!=t&&i>e}async handlePagination(t,i,s,e,n,o){const a=this.getQueryCount(s,e),l=[];for(let e=a;e<n;e+=a){const n=i.clone();n.num=s,n.start=e,l.push(this.queryForFeatures(t,n,i.outFields[0]))}Promise.all(l).then((t=>{t.forEach((t=>{(null==t?void 0:t.length)&&o.fields&&o.fields.push(...t)})),o.fields="string"===o.type?[...new Set(o.fields)].sort(((t,i)=>t.localeCompare(i))):"number"===o.type?[...new Set(o.fields)].sort(((t,i)=>t-i)):[...new Set(o.fields)].sort()}))}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){if(!t||!c.includes(t.type)||!i)return[];const s=this.createStatisticsQuery(t,i),e=await t.queryFeatures(s);return(null==e?void 0:e.features)||[]}createStatisticsQuery(t,i){const s=t.createQuery();return s.where=this.getInitDefExprFromLayer(t)||"1=1",this.applyCacheHint(t,s),s.outStatistics=[{onStatisticField:i,outStatisticFieldName:`max${i}`,statisticType:"max"},{onStatisticField:i,outStatisticFieldName:`min${i}`,statisticType:"min"}],this.applyQueryGeometryFromExtentSelector(s),s}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="extent"in e?e:this.geometryJsonUtils.fromJSON(e);if("extent"===(null==t?void 0:t.type)||"polygon"===(null==t?void 0:t.type))return t}}}async setInitExpression(t,i){if(!i.field||!i.type)return void await this.updateExpression(t,i,void 0);const s=this.findFilterLayer(t);s&&("not-loaded"!==s.loadStatus&&"failed"!==s.loadStatus||await s.load(),await s.when((async()=>{var e,n;const o=null===(e=s.fields)||void 0===e?void 0:e.find((({name:t})=>t===i.field)),a=null===(n=null==o?void 0:o.domain)||void 0===n?void 0:n.type;i.type="coded-value"===a||"range"===a?a:i.type,await this.updateExpression(t,i,o)})))}async updateExpression(t,i,s){await this.handleExpressionType(t,i,s)&&this.generateOutput(t)}async handleExpressionType(t,i,s){var e;switch(i.type){case"string":return await this.updateStringExpression(t,i);case"number":return await this.updateNumberExpression(t,i);case"date":return await this.updateDateExpressionBasedOnDisplayOption(t,i);case"coded-value":return await this.updateCodedValueExpression(t,i,s);case"range":return await this.updateRangeExpressionBasedOnDisplayOption(t,i,s);case"checkbox":case null:case void 0:return null!==(e=i.active)&&void 0!==e&&e;default:return!1}}async updateDateExpressionBasedOnDisplayOption(t,i){return"drop-down"===i.displayOption?await this.updateStringExpression(t,i):await this.updateDateExpression(t,i)}async updateRangeExpressionBasedOnDisplayOption(t,i,s){return"drop-down"===i.displayOption?await this.updateStringExpression(t,i):this.updateRangeExpression(i,s)}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:o}=t;if(t.selectedFields=e.map((({value:t})=>t)),e.length){const i=e.map((({value:t})=>"number"==typeof t?t:`'${d(t)}'`));t.definitionExpression="date"===o?i.map((t=>this.buildDateExpression(t,n))).join(" OR "):`${n} IN (${i.join(",")})`,t.active=!0}else t.definitionExpression=void 0,t.active=!1;this.generateOutput(i)}handleDatePickerRangeChange(t,i,s){const e=s.target,[n,o]=e.valueAsDate,a=n?h(Math.floor(n.getTime()),!0):void 0,l=o?h(Math.floor(o.getTime()),!0):void 0;(a||l)&&(t.definitionExpression=this.constructDefinitionExpression(t.field,a,l),t.range={min:a,max:l},t.active=!0,this.generateOutput(i))}constructDefinitionExpression(t,i,s){return i?s?`${t} BETWEEN '${i}' AND '${s}'`:`${t} > '${i}'`:`${t} < '${s}'`}handleURLParams(){if(!("URLSearchParams"in window))return;const t=new URLSearchParams(document.location.search).get("filter");if(!t)return void(this.filterCount=0);const i=t.split(";").map((t=>JSON.parse(t)));this.filterCount=this.applyFilters(i)}applyFilters(t){let i=0;return t.forEach((t=>{var s,e;const n=null===(s=this.filterLayerExpressions)||void 0===s?void 0:s.find((i=>i.id===t.layerId));n&&(null===(e=n.expressions)||void 0===e||e.forEach((s=>{var e,n;(null===(e=s.id)||void 0===e?void 0:e.toString())===(null===(n=t.expressionId)||void 0===n?void 0:n.toString())&&(this.activateExpression(s,t),i++)})))})),i}activateExpression(t,i){t.active=!0,"range"===i.type?t.range=i.range:"select"===i.type&&(t.selectedFields=i.selectedFields)}createURLParamExpression(t,i){const{id:s,range:e,selectedFields:n,type:o}=i;return"string"===o||"coded-value"===o||"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"===o||"range"===o||"date"===o?{type:"range",layerId:t.id,expressionId:s.toString(),range:e}:{layerId:t.id,expressionId:s.toString()}}autoUpdateURLCheck(t){if(this.autoUpdateUrl){const i=t.toString()?`${window.location.pathname}?${t}`.trim():window.location.pathname;window.history.replaceState({},"",i)}}generateURLParams(){var t;if(!("URLSearchParams"in window))return;const i=new URLSearchParams(window.location.search),s=(null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.flatMap((t=>{var i;return(null===(i=null==t?void 0:t.expressions)||void 0===i?void 0:i.filter((t=>t.active)).map((i=>JSON.stringify(this.createURLParamExpression(t,i)))))||[]})))||[];this.filterCount=s.length,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 o=(null==i?void 0:i.length)>0&&null!=n?`(${i.join(e)}) AND (${n})`:i.length>0?i.join(e):n;t.definitionExpression=o}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(){this.updateInitExpressions(),this.handleURLParams(),this.initExpressions()}async handleZoomTo(t){const i=this.panelEl.querySelector((null==t?void 0:t.sublayerId)?`#zoom-to-${t.id}-${t.sublayerId}`:`#zoom-to-${t.id}`),s=(t,s)=>{i&&(i.loading=t,i.disabled=s)};s(!0,!0),await this.getZoomToExtent(t);const e="point"===this.zoomToExtent.type&&1===this.zoomToExtent.count?{target:this.zoomToExtent.extent,zoom:10}:this.zoomToExtent.extent;await this.view.goTo(e),s(!1,!1)}async getZoomToExtent(t){var i;const s=this.view.allLayerViews.find((({layer:i})=>i.id===t.id)),e=s.layer,n="map-image"===e.type?e.findSublayerById(t.sublayerId):e;if("point-cloud"!==n.type&&c.includes(null==n?void 0:n.type)){const t=await this.getQueryLayer(n),s=t.createQuery();s.where=null!==(i=t.definitionExpression)&&void 0!==i?i:"1=1";const e=await t.queryExtent(s);this.zoomToExtent=Object.assign(Object.assign({},e),{type:t.geometryType})}}applyFilterToQuery(t,i){var s,e;const n=this.view.allLayerViews.find((({layer:t})=>t.id===i.id)),o=null!==(e=null===(s=null==n?void 0:n.featureEffect)||void 0===s?void 0:s.filter)&&void 0!==e?e:n.filter;o&&["objectIds","distance","geometry","spatialRelationship","units","where","timeExtent"].forEach((i=>{null!=o[i]&&(t[i]=o[i])}))}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:o}=e;t&&n&&i.push(`(${n})`),t&&null!=o&&o.length>0&&(s=s.concat(o))}this.updateFilter(t,i,s),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(t){return t.toLocaleString("en-US",{maximumFractionDigits:20})}scientificRounding(t,i,s){if(null==t)return;let e;if(String(t).includes("e")){const[n,o]=String(t).split("e").map((t=>Number(t)));e=Math[s](+`${n}e${o+i}`)*Math.pow(10,-i)}else e=Math[s](t*Math.pow(10,i))/Math.pow(10,i);return+e.toFixed(i)}roundMinNumberDown(t,i){return this.scientificRounding(t,i,"floor")}roundMaxNumberUp(t,i){return this.scientificRounding(t,i,"ceil")}roundNumber(t,i){var s;return null!==(s=this.scientificRounding(t,i,"round"))&&void 0!==s?s:t}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,e,n;if("coded-value"===t.type)return null===(s=t.codedValues)||void 0===s?void 0:s[i];if("number"===t.type&&"number"==typeof i){let s=i;return null!=(null===(e=t.format)||void 0===e?void 0:e.places)&&(s=this.roundNumber(i,t.format.places)),(null===(n=t.format)||void 0===n?void 0:n.digitSeparator)?this.numberWithCommas(s):s}if("date"===t.type&&!t.dateOnly){const t=this.intl.convertDateFormatToIntlOptions("short-date-long-time");return this.intl.formatDate(i,t)}return i}buildDateExpression(t,i){if(t){const s=new Date(t),e=new Date(t),n=new Date(e.setDate(s.getDate()+1)),o=`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`,a=`${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}`,l=`${n.getHours()}:${n.getMinutes()}:${n.getSeconds()}`;return`${i} BETWEEN '${o} ${a}' AND '${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()} ${l}'`}}async getQueryLayer(t){return"sublayer"===t.type?await t.createFeatureLayer():t}applyCacheHint(t,i){var s,e;(null===(e=null===(s=null==t?void 0:t.capabilities)||void 0===s?void 0:s.query)||void 0===e?void 0:e.supportsCacheHint)&&(i.cacheHint=!0)}applyQueryGeometryFromExtentSelector(t){if(!this.extentSelector||!this.extentSelectorConfig)return;const i=this.getExtent(this.extentSelector,this.extentSelectorConfig);i&&(t.geometry=i,t.spatialRelationship="intersects")}updateInitExpressions(){if(null==this.view)return;const t=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={},t.allLayers.concat(t.allTables).forEach((t=>{if(!c.includes(t.type))return;const i=t;"point-cloud"===i.type?this.initPointCloudFilters[i.id]=i.filters:"map-image"===i.type?this.initMapImageExpressions[i.id]=i.allSublayers.reduce(((t,i)=>(t[i.id]=i.definitionExpression,t)),{}):this.initDefExpressions[i.id]=i.definitionExpression}))}get el(){return n(this)}static get watchers(){return{view:["watchViewHandler"],layerExpressions:["watchLayerExpressions"]}}};v.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%;font-size:16px;--calcite-combobox-input-height:24px}.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 m="instant-apps-social-share",f=".calcite-mode-dark",_={base:m,dialog:`${m}__dialog`,dialogEmbed:`${m}__dialog-embed`,dialogContent:`${m}__dialog-content`,options:`${m}__options`,tipContainer:`${m}__tip`,tipHeader:`${m}__tip-header`,tipContent:`${m}__tip-content`,icon:`${m}__icon`,iconContainer:`${m}__icon-container`,optionText:`${m}__option-text`,popoverButton:`${m}__popover-button`,layout:{vertical:`${m}__layout--vertical`,horizontal:`${m}__layout--horizontal`},xLogo:{light:`${m}__x-logo--light`,dark:`${m}__x-logo--dark`},success:{container:`${m}__success`,header:`${m}__success-header`,message:`${m}__success-message`,icon:`${m}__success-icon`},embed:{container:`${m}__embed`,header:`${m}__embed-header`,embedCode:{container:`${m}__embed-code`,textArea:`${m}__embed-code-text-area`,copyButton:`${m}__embed-code-copy-button`},textAreaText:`${m}__embed-text-area-text`,dimensions:{container:`${m}__embed-dimensions`,input:`${m}__embed-dimensions-input`}},rtl:{optionText:`${m}__option-text--rtl`,textArea:`${m}__text-area--rtl`}},b={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",x:"https://x.com/intent/post?url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}"},g=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.popoverPositioning="absolute",this.removePopoverOffset=!1,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;a(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,o,a,l;const r=this.copied&&"popover"===this.mode?this.renderSuccess():s("div",{class:_.dialogContent},this.renderOptions(),this.displayTipText?this.renderTip():null,this.embed?this.renderEmbed():null),c="vertical"===this.shareIconsLayout?` ${_.layout.vertical}`:` ${_.layout.horizontal}`,d=" calcite-mode-"+(this.el.closest(f)?"dark":"light"),h=s("div",{key:"6fa27d9de3fff34dde6702cdbeac00b799355651",ref:t=>this.dialogContentRef=t,class:`${_.dialog}${c}${d}`},r);return s(e,{key:"d35d755dc0d1a827e7859a86366b4f03a6c02a28"},"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,"overlay-positioning":this.popoverPositioning,"offset-distance":this.removePopoverOffset?0:6,"pointer-disabled":this.removePopoverOffset},h),this.renderButton()]:[h,s("calcite-popover",{ref:t=>this.copyLinkPopoverRef=t,label:null===(o=null===(n=this.messages)||void 0===n?void 0:n.share)||void 0===o?void 0:o.label,referenceElement:"copyToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderSuccess()),s("calcite-popover",{ref:t=>this.copyEmbedPopoverRef=t,label:null===(l=null===(a=this.messages)||void 0===a?void 0:a.share)||void 0===l?void 0:l.label,referenceElement:"copyEmbedToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderEmbedSuccess())])}renderButton(){var t,i,e,n,o,a,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:_.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:_.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:_.popoverButton,appearance:"transparent",label:null===(a=null===(o=this.messages)||void 0===o?void 0:o.share)||void 0===a?void 0:a.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:"",alignment:"center"},s("div",{class:_.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:_.success.container},s("span",{class:_.success.header},s("span",{class:_.success.icon},s("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),s("span",{class:_.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:_.success.container},s("span",{class:_.success.header},s("span",{class:_.success.icon},s("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),s("span",{class:_.success.message},null==i?void 0:i.embed))}renderOptions(){var t,i,e,n;const o=null===(t=this.messages)||void 0===t?void 0:t.options,a="rtl"===document.dir?` ${_.rtl.optionText}`:"";return s("ul",{ref:t=>this.shareListRef=t,class:_.options,role:"menu"},s("li",{id:"copyToClipboard",onClick:this.handleShareItem.bind(this,"link"),onKeyDown:this.handleOptionKeyDown("link"),role:"menuitem",tabindex:"0"},s("span",{class:_.icon},s("calcite-icon",{icon:"link",scale:this.scale})),s("span",{class:`${_.optionText}${a}`},null===(i=null==o?void 0:o.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:_.icon},this.renderFacebookIcon()),s("span",{class:`${_.optionText}${a}`},null===(e=null==o?void 0:o.facebook)||void 0===e?void 0:e.label)),s("li",{onClick:this.handleShareItem.bind(this,"x"),onKeyDown:this.handleOptionKeyDown("x"),role:"menuitem",tabindex:"0"},s("span",{class:_.icon},this.renderXIcon()),s("span",{class:`${_.optionText}${a}`},"X")),s("li",{onClick:this.handleShareItem.bind(this,"linkedIn"),onKeyDown:this.handleOptionKeyDown("linkedIn"),role:"menuitem",tabindex:"0"},s("span",{class:_.icon},this.renderLinkedInIcon()),s("span",{class:`${_.optionText}${a}`},null===(n=null==o?void 0:o.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"}})))}renderXIcon(){const t=!!this.el.closest(f);return s("svg",{class:t?_.xLogo.dark:_.xLogo.light,viewBox:"0 0 1200 1227",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s("rect",{height:"400",style:{fill:"none"},width:"400",x:"56",y:"56"}),s("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",fill:t?"white":"black"}))}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:_.tipContainer},s("span",{class:_.tipHeader},s("calcite-icon",{icon:"lightbulb",scale:this.scale}),s("span",null,null==i?void 0:i.label)),s("p",{class:_.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,o="rtl"===document.dir?` ${_.rtl.textArea}`:"";return s("div",{class:_.embed.container},s("span",{class:_.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:_.embed.embedCode.container},s("div",{class:_.embed.embedCode.textArea},s("textarea",{ref:t=>this.embedCodeRef=t,cols:30,rows:5,readonly:!0,class:o,value:this.getEmbedCode()}),s("button",{id:"copyEmbedToClipboard",onClick:this.copyEmbedCode.bind(this),class:_.embed.embedCode.copyButton},s("calcite-icon",{icon:"copy",scale:this.scale}),s("span",null,null==n?void 0:n.copy))),s("span",{class:_.embed.textAreaText},s("slot",{name:"text-area-text"})),s("div",{class:_.embed.dimensions.container},s("label",{class:_.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:_.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 l=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,r=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&&!l;!r&&this.shortenShareUrl&&(a=await this.shortenUrl(this.shareUrl));let c=a||this.shareUrl;switch(t){case"link":return navigator.clipboard.writeText(c),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"x":case"linkedIn":let i;r&&(i=window.open("","_blank"),this.shortenShareUrl&&(c=await this.shortenUrl(this.shareUrl)||c));const s={url:encodeURI(c)},e="x"===t?Object.assign(Object.assign({},s),{text:this.shareText}):s,[n]=await o(["esri/intl"]),a=n.substitute(b[t],e);return"popover"===this.mode&&this.closePopover(),void(r&&i?(i.location=a,i.focus()):window.open(encodeURI(a),"_blank"))}}async shortenUrl(t){var i,s;const[e]=await o(["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 o(["esri/geometry/Point","esri/geometry/SpatialReference"]),l=new n({x:i,y:s,spatialReference:new a(Object.assign({},e.toJSON()))}),r=await this.processPoint(l),{isWGS84:c,isWebMercator:d}=r.spatialReference;return this.generateShareUrlParams(r,c||d)}async processPoint(t){const{isWGS84:i,isWebMercator:s}=t.spatialReference;if(i||s)return t;const[e,n]=await o(["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,o,a;const{longitude:l,latitude:r,x:c,y:d}=t;if(void 0===l||void 0===r)return this.shareUrl;const h=this.roundValue(i?l:c),p=this.roundValue(i?r:d),{zoom:u}=this.view,v=this.roundValue(u),m=null===(e=null===(s=this.view)||void 0===s?void 0:s.popup)||void 0===e?void 0:e.selectedFeature,f=null===(o=null===(n=this.view)||void 0===n?void 0:n.popup)||void 0===o?void 0:o.visible;let _,b,g;if(m&&f&&"feature"===(null===(a=null==m?void 0:m.layer)||void 0===a?void 0:a.type)){const t=null==m?void 0:m.layer;_=null==t?void 0:t.id,b=m.attributes[t.objectIdField]}g=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";");const{type:x}=this.view,{defaultUrlParams:w}=this,y=new URL(this.shareUrl),{searchParams:$}=y;if($.get("center")&&$.delete("center"),$.get("level")&&$.delete("level"),$.get("selectedFeature")&&$.delete("selectedFeature"),$.get("hiddenLayers")&&$.delete("hiddenLayers"),$.get("viewpoint")&&$.delete("viewpoint"),"3d"===x){const{camera:t}=this.view,{heading:i,position:s,tilt:e}=t,{longitude:n,latitude:o,z:a}=s,l={longitude:this.roundValue(n,8),latitude:this.roundValue(o,8),z:this.roundValue(a,3),heading:this.roundValue(i,3),tilt:this.roundValue(e,3)};return!1!==(null==w?void 0:w.viewpoint)&&y.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),_&&b&&!1!==(null==w?void 0:w.selectedFeature)&&y.searchParams.set("selectedFeature",`${_};${b}`),g&&!1!==(null==w?void 0:w.hiddenLayers)&&y.searchParams.set("hiddenLayers",g),y.search=decodeURIComponent(y.search),y.href}return!1!==(null==w?void 0:w.center)&&y.searchParams.set("center",`${h};${p}`),!1!==(null==w?void 0:w.level)&&y.searchParams.set("level",`${v}`),_&&b&&!1!==(null==w?void 0:w.selectedFeature)&&y.searchParams.set("selectedFeature",`${_};${b}`),g&&!1!==(null==w?void 0:w.hiddenLayers)&&y.searchParams.set("hiddenLayers",g),y.search=decodeURIComponent(y.search),y.href}roundValue(t,i=4){return parseFloat(t.toFixed(i))}get el(){return n(this)}};g.style=":host{display:block;--instant-apps-social-share-action-width:initial;--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;color:var(--calcite-color-text-1)}: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__options__x-logo--light path{fill:#000000}:host .instant-apps-social-share__options__x-logo--dark path{fill:#ffffff}: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;direction:ltr}: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 calcite-action{width:var(--instant-apps-social-share-action-width)}: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{v as instant_apps_filter_list,g 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{e as t}from"./p-
|
6
|
+
import{e as t}from"./p-0a24ad5f.js";import{a}from"./p-e996c38f.js";
|
7
7
|
/** @license
|
8
8
|
* Copyright 2022 Esri
|
9
9
|
*
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as i,h as o,H as e,g as a}from"./p-e996c38f.js";import{g as l}from"./p-
|
6
|
+
import{r as t,c as i,h as o,H as e,g as a}from"./p-e996c38f.js";import{g as l}from"./p-2884ca49.js";import"./p-08ad0b7a.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const n=class{constructor(o){t(this,o),this.measureActive=i(this,"measureActive",7),this.messages=void 0,this.view=void 0,this.areaUnit=void 0,this.linearUnit=void 0,this.coordinateFormat=void 0,this.activeToolType=void 0,this.closable=!1}async componentWillLoad(){l(this)}componentDidLoad(){}render(){var t;return o(e,{key:"843dd716e3f9b125044afd9a2919a60b937ae8b0"},o("calcite-panel",{key:"45dd9e43decdcdc0526139938751d727bd73b3e0",heading:null===(t=null==this?void 0:this.messages)||void 0===t?void 0:t.label,closable:this.closable},o("div",{key:"953365a04fd1f977b08d4b9309fdb52d44363b67",slot:"content-top"},this.renderActionPad()),o("div",{key:"57ce5b75a8aff0d796073bbf2a2f36ea71f65b3c"},this.renderMeasureToolPanel())))}renderMeasureToolPanel(){const{view:t,coordinateFormat:i,areaUnit:e,linearUnit:a,activeToolType:l}=this;return o("calcite-panel",{class:"instant-apps-measurement__content"},o("instant-apps-measurement-tool",{ref:t=>{this.measureTool=t},view:t,measureConfiguration:{coordinateFormat:i,areaUnit:e,linearUnit:a,activeToolType:l}}))}renderActionPad(){const{messages:t,activeToolType:i}=this;return o("calcite-action-pad",{"expand-disabled":!0,layout:"horizontal",position:"end"},o("calcite-action",{class:"distance"===i?"active-tool":"",text:null==t?void 0:t.line,icon:"measure",scale:"m","data-value":"distance",onClick:this._handleToolClick.bind(this)},o("calcite-tooltip",{overlayPositioning:"fixed","close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.line)),o("calcite-action",{class:"area"===i?"active-tool":"",text:null==t?void 0:t.area,scale:"m",icon:"measure-area","data-value":"area",onClick:this._handleToolClick.bind(this)},o("calcite-tooltip",{overlayPositioning:"fixed","close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.area)),o("calcite-action",{class:"point"===i?"active-tool":"",text:null==t?void 0:t.point,scale:"m",icon:"pin-plus","data-value":"point",onClick:this._handleToolClick.bind(this)},o("calcite-tooltip",{overlayPositioning:"fixed","close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.point)),o("calcite-action",{text:null==t?void 0:t.clear,scale:"m",icon:"trash","data-value":"clear",onClick:this._handleToolClick.bind(this)},o("calcite-tooltip",{overlayPositioning:"fixed","close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.clear)))}_handleToolClick(t){var i,o,e,a;if(!(null==this?void 0:this.measureTool))return;const l=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.dataset.value;this.measureTool.activeTool=l;const n=document.getElementsByClassName("active-tool");for(let t=0;t<(null==n?void 0:n.length);t++)null===(e=null===(o=n[t])||void 0===o?void 0:o.classList)||void 0===e||e.remove("active-tool");null===(a=null==t?void 0:t.target)||void 0===a||a.classList.add("active-tool"),this.measureActive.emit(void 0!==l&&"clear"!==l)}get el(){return a(this)}};n.style=".sc-instant-apps-measurement-h .sc-instant-apps-measurement.sc-instant-apps-measurement{background:var(--calcite-color-foreground-1)}.sc-instant-apps-measurement-h .active-tool.sc-instant-apps-measurement{--calcite-color-foreground-1:#c7eaff}";export{n as instant_apps_measurement}
|
@@ -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 s,g as o}from"./p-e996c38f.js";import{g as l}from"./p-
|
6
|
+
import{r as t,h as i,H as s,g as o}from"./p-e996c38f.js";import{g as l}from"./p-2884ca49.js";import"./p-08ad0b7a.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const a=class{constructor(i){t(this,i),this.messages=void 0,this.view=void 0}render(){var t,o,l,a,n,e,d;const h="2d"!==(null===(t=null==this?void 0:this.view)||void 0===t?void 0:t.type)&&(null==this?void 0:this.view)?this._getSceneViewCommands():this._getMapViewCommands(),r=this._isMacLike()?"Option":"Alt";return i(s,{key:"d84c8955b37d88dd1fd13c37330769378a596c67"},i("calcite-block",{key:"d647d6282973ad8bc6ad784692a76dc7481fd192",open:!0,class:"instant-apps-keyboard-shortcuts__content",heading:null===(l=null===(o=null==this?void 0:this.messages)||void 0===o?void 0:o.generalShortcuts)||void 0===l?void 0:l.label},i("table",{key:"d78bb063964ace1a26539313c20557e57c5b0e7f"},this.renderTableHeader(),i("tr",{key:"5a7361aee44808045f1b5adb1cb07e9d74c395bb"},i("td",{key:"e91dc6fb5e3c0ac2964717c618b66d387224dc75"},`${r} + M`),i("td",{key:"159e6b873b599ceaf3e381062f305f452d7e2c95"},null===(n=null===(a=null==this?void 0:this.messages)||void 0===a?void 0:a.generalShortcuts)||void 0===n?void 0:n.title))),i("calcite-label",{key:"a5a6eaf74f20fd364132f6a08af57eb4cc341dac"},null===(d=null===(e=null==this?void 0:this.messages)||void 0===e?void 0:e.generalShortcuts)||void 0===d?void 0:d.title),i("table",{key:"cac31048d7d7fc3869d1454e391d40ca79a7d304"},this.renderTableHeader(),h.map((t=>i("tr",null,i("td",null,t.alias),i("td",null,t.title)))))))}componentDidLoad(){l(this)}renderTableHeader(){var t,s;return(null==this?void 0:this.messages)?i("tr",null,i("th",null,null===(t=null==this?void 0:this.messages)||void 0===t?void 0:t.generalShortcuts.shortcut),i("th",null,null===(s=null==this?void 0:this.messages)||void 0===s?void 0:s.generalShortcuts.action)):null}_getMapViewCommands(){var t;const i="2d"===(null===(t=this.view)||void 0===t?void 0:t.type)&&this.view.constraints.rotationEnabled,s=(null==this?void 0:this.messages)?[{alias:null==this?void 0:this.messages.mapShortcuts.arrowKeys,title:null==this?void 0:this.messages.mapShortcuts.nudge,show:!0},{alias:"N",title:null==this?void 0:this.messages.mapShortcuts.N,show:i},{alias:"A",title:null==this?void 0:this.messages.mapShortcuts.A,show:i},{alias:"D",title:null==this?void 0:this.messages.mapShortcuts.D,show:i},{alias:"+",title:null==this?void 0:this.messages.mapShortcuts.plus,show:!0},{alias:"-",title:null==this?void 0:this.messages.mapShortcuts.minus,show:!0}]:[];return(null==this?void 0:this.messages)?null==s?void 0:s.filter((t=>t.show)):[]}_getSceneViewCommands(){var t;const i="3d"===(null===(t=this.view)||void 0===t?void 0:t.type)&&"global"===this.view.viewingMode,s=(null==this?void 0:this.messages)?[{alias:null==this?void 0:this.messages.mapShortcuts.arrowKeys,title:null==this?void 0:this.messages.mapShortcuts.nudge,show:!!i},{alias:"P",title:null==this?void 0:this.messages.sceneShortcuts.P,show:!0},{alias:"N",title:null==this?void 0:this.messages.sceneShortcuts.N,show:!0},{alias:"W",title:null==this?void 0:this.messages.sceneShortcuts.W,show:!0},{alias:"A",title:null==this?void 0:this.messages.sceneShortcuts.A,show:!0},{alias:"D",title:null==this?void 0:this.messages.sceneShortcuts.D,show:!0},{alias:"S",title:null==this?void 0:this.messages.sceneShortcuts.S,show:!0},{alias:"J",title:null==this?void 0:this.messages.sceneShortcuts.globalCommands.J,show:!!i},{alias:"U",title:null==this?void 0:this.messages.sceneShortcuts.globalCommands.U,show:!!i}]:[];return(null==this?void 0:this.messages)?null==s?void 0:s.filter((t=>t.show)):[]}_isMacLike(){return/(Mac)/iu.test(navigator.platform)}get el(){return o(this)}};a.style=":host .instant-apps-keyboard-shortcuts__content{display:flex;flex-direction:column;font-family:var(--calcite-sans-family);font-size:0.875rem;background-color:var(--calcite-color-background);color:var(--calcite-color-text-1);width:auto;padding:0.5em;margin-bottom:0;overflow:auto}:host .instant-apps-keyboard-shortcuts__content table{border:none;border-collapse:collapse;width:100%;margin-bottom:1em}:host .instant-apps-keyboard-shortcuts__content table td,:host .instant-apps-keyboard-shortcuts__content table th{border:solid 1px var(--calcite-color-border-1);padding:0.5rem 0.75rem 0.5rem 0.75rem;white-space:normal}:host .instant-apps-keyboard-shortcuts__content table td:lang(ja),:host .instant-apps-keyboard-shortcuts__content table td:lang(ja-JP),:host .instant-apps-keyboard-shortcuts__content table th:lang(ja-JP),:host .instant-apps-keyboard-shortcuts__content table th:lang(ja){white-space:nowrap}:host .instant-apps-keyboard-shortcuts__content tr:nth-child(even){background-color:var(--calcite-color-foreground-2)}:host .instant-apps-keyboard-shortcuts__content tr th{padding:0.5em 0.7em;font-weight:400}";export{a as instant_apps_keyboard_shortcuts}
|