@esri/solutions-components 0.6.32 → 0.6.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +14 -2
  2. package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
  3. package/dist/cjs/card-manager_3.cjs.entry.js +19 -11
  4. package/dist/cjs/crowdsource-manager.cjs.entry.js +7 -7
  5. package/dist/cjs/{downloadUtils-84024878.js → downloadUtils-b37689dd.js} +22 -2
  6. package/dist/cjs/{index.es-eb7cf427.js → index.es-83e253dc.js} +2 -2
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
  9. package/dist/cjs/{mapViewUtils-786a219b.js → mapViewUtils-303bf42d.js} +1 -1
  10. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  11. package/dist/cjs/solutions-components.cjs.js +1 -1
  12. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +8 -0
  13. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +6 -6
  14. package/dist/collection/components/floor-filter/floor-filter.js +2 -1
  15. package/dist/collection/components/layer-table/layer-table.js +13 -7
  16. package/dist/collection/components/map-card/map-card.css +5 -1
  17. package/dist/collection/components/map-card/map-card.js +20 -1
  18. package/dist/collection/components/map-tools/map-tools.js +15 -1
  19. package/dist/collection/utils/downloadUtils.js +20 -0
  20. package/dist/collection/utils/downloadUtils.ts +20 -0
  21. package/dist/collection/utils/queryUtils.js +1 -1
  22. package/dist/collection/utils/queryUtils.ts +1 -1
  23. package/dist/collection/utils/test/downloadUtils.spec.js +79 -5
  24. package/dist/collection/utils/test/downloadUtils.spec.tsx +84 -5
  25. package/dist/components/crowdsource-manager.js +7 -7
  26. package/dist/components/downloadUtils.js +20 -0
  27. package/dist/components/floor-filter2.js +2 -1
  28. package/dist/components/layer-table2.js +13 -7
  29. package/dist/components/map-card2.js +5 -2
  30. package/dist/components/map-tools2.js +14 -1
  31. package/dist/components/queryUtils.js +1 -1
  32. package/dist/esm/basemap-gallery_7.entry.js +14 -2
  33. package/dist/esm/calcite-combobox_6.entry.js +1 -1
  34. package/dist/esm/card-manager_3.entry.js +19 -11
  35. package/dist/esm/crowdsource-manager.entry.js +7 -7
  36. package/dist/esm/{downloadUtils-fa2b3718.js → downloadUtils-ddd7eeb7.js} +22 -2
  37. package/dist/esm/{index.es-cc671fd2.js → index.es-a53707d1.js} +2 -2
  38. package/dist/esm/loader.js +1 -1
  39. package/dist/esm/map-select-tools_3.entry.js +2 -2
  40. package/dist/esm/{mapViewUtils-8bfabd80.js → mapViewUtils-43c930f1.js} +1 -1
  41. package/dist/esm/public-notification.entry.js +2 -2
  42. package/dist/esm/solutions-components.js +1 -1
  43. package/dist/solutions-components/{p-e94c7cf2.js → p-05ba41f9.js} +1 -1
  44. package/dist/solutions-components/{p-ce3b40ca.entry.js → p-4792005c.entry.js} +1 -1
  45. package/dist/solutions-components/{p-86893d46.entry.js → p-50a3a887.entry.js} +1 -1
  46. package/dist/solutions-components/p-65ade5af.entry.js +6 -0
  47. package/dist/solutions-components/p-7b61f856.entry.js +6 -0
  48. package/dist/solutions-components/{p-190c83b9.entry.js → p-978a26b3.entry.js} +1 -1
  49. package/dist/solutions-components/p-a5342c42.entry.js +6 -0
  50. package/dist/solutions-components/{p-37a58e04.js → p-b745143d.js} +3 -3
  51. package/dist/solutions-components/{p-53bc5fc1.js → p-f2194390.js} +1 -1
  52. package/dist/solutions-components/solutions-components.esm.js +1 -1
  53. package/dist/solutions-components/utils/downloadUtils.ts +20 -0
  54. package/dist/solutions-components/utils/queryUtils.ts +1 -1
  55. package/dist/solutions-components/utils/test/downloadUtils.spec.tsx +84 -5
  56. package/dist/types/components/map-card/map-card.d.ts +4 -0
  57. package/dist/types/components/map-tools/map-tools.d.ts +8 -0
  58. package/dist/types/components.d.ts +8 -0
  59. package/package.json +1 -1
  60. package/dist/solutions-components/p-792e171f.entry.js +0 -6
  61. package/dist/solutions-components/p-d44ad6c4.entry.js +0 -6
  62. package/dist/solutions-components/p-f2dcb05a.entry.js +0 -6
@@ -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,h as i,H as s,g as e,c as a}from"./p-91c78d98.js";import{g as h}from"./p-99d8a839.js";import{q as o,a as l,g as n,b as d}from"./p-f2194390.js";import{l as r}from"./p-05948b48.js";import{d as c}from"./p-b745143d.js";import"./p-e1a4994d.js";import"./p-2a58e378.js";import"./p-ecc95259.js";const p=class{constructor(i){t(this,i),this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(t){const i=t.detail;this._cardLoading=!0;const s=i.length>0?await o(i,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s.sort(((t,s)=>i.indexOf(t.getObjectId())-i.indexOf(s.getObjectId()))),this._cardLoading=!1}async layerSelectionChange(t){const i=t.detail[0];this.layer=await l(this.mapView,i)}async componentWillLoad(){await this._getTranslations()}render(){var t,e;const a=(null===(t=this._graphics)||void 0===t?void 0:t.length)>0?"":"display-none",h=(null===(e=this._graphics)||void 0===e?void 0:e.length)>0?"display-none":"";return i(s,null,i("div",{class:"overflow-auto height-full"},i("calcite-shell",{class:"position-relative "+a},i("div",null,i("info-card",{graphics:this._graphics,isLoading:this._cardLoading,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),i("calcite-shell",{class:"position-relative "+h},i("div",{class:"padding-1"},i("calcite-notice",{icon:"table",open:!0},i("div",{slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}};p.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";const u=class{constructor(i){t(this,i),this.featureSelectionChange=a(this,"featureSelectionChange",7),this.openFilterOptions=a(this,"openFilterOptions",7),this._allIds=[],this._tableSorting=!1,this.onTableNodeCreate=t=>{this._tableNode=t},this.enableAutoRefresh=void 0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this._confirmDelete=!1,this._controlsThatFit=void 0,this._fetchingData=!1,this._isDeleting=!1,this._layer=void 0,this._selectedIndexes=[],this._showOnlySelected=!1,this._sortActive=!1,this._translations=void 0}_controlsThatFitWatchHandler(){const t=this._controlsThatFit?this._controlsThatFit.reduce(((t,i)=>(t.push(i.id),t)),[]):[];this._toolInfos=this._toolInfos.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})))}async _layerWatchHandler(){this._fetchingData=!0,await this._resetTable(),this._fetchingData=!1}async _selectedIndexesWatchHandler(){this._validateEnabledActions()}async _sortActiveWatchHandler(){this._sortActive||await this._sortTable()}async selectionChanged(t){if(this.zoomAndScrollToSelected){const i=t.detail,s=i.getObjectId(),e=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(e);const a=i.layer;let h;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===a.title&&"feature"===t.layer.type)return h=t,!0})),h&&await n([s],h,this.mapView,!0)}}async editsComplete(){await this._refresh()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){const t=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",a=this._allIds.length.toString(),h=this._selectedIndexes.length.toString();return i(s,null,i("calcite-shell",null,this._getTableControlRow("header"),i("div",{class:"height-full-adjusted width-full"},i("calcite-panel",{class:"height-full width-full"},i("calcite-loader",{class:e,label:this._translations.fetchingData,scale:"l"}),i("div",{class:t,ref:this.onTableNodeCreate})),i("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",a).replace("{{selected}}",h)))),this._deleteMessage())}async componentDidLoad(){this._resizeObserver.observe(this._toolbar)}componentDidRender(){this._updateToolbar()}async _initModules(){const[t,i]=await r(["esri/widgets/FeatureTable","esri/core/reactiveUtils"]);this.FeatureTable=t,this.reactiveUtils=i}_onResize(){this._updateToolbar()}_getTableControlRow(t){const s="more-table-options";return i("div",{class:"display-flex border-bottom height-51",ref:t=>this._toolbar=t,slot:t},this._getActionBar(),this._getDropdown(s),this._getToolTip("","bottom",s,this._translations.moreOptions))}_getActionBar(){return i("calcite-action-bar",{expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},i("div",{class:"border-end",id:"solutions-map-layer-picker-container"},i("map-layer-picker",{appearance:"transparent",mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showTables:!0,type:"dropdown"})),this._getActions())}_getActions(){return this._getActionItems().reduce(((t,i)=>(i&&!i.isOverflow&&t.push(i.isDanger?this._getDangerAction(i.icon,i.label,i.func,i.disabled):this._getAction(i.icon,i.label,i.func,i.disabled)),t)),[])}_validateEnabledActions(){const t=this._selectedIndexes.length>0,i=["zoom-to-object","trash","erase","selected-items-filter"];this._toolInfos.forEach((s=>{s&&i.indexOf(s.icon)>-1&&(s.disabled=!t)}))}_initToolInfos(){var t;const i=this._selectedIndexes.length>0;this._toolInfos=[{icon:"zoom-to-object",label:this._translations.zoom,func:()=>this._zoom(),disabled:!i,isOverflow:!1},(null===(t=this.mapInfo)||void 0===t?void 0:t.filters)?{icon:"filter",label:this._translations.filters,func:()=>this._filter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{icon:"trash",label:this._translations.delete,func:()=>this._delete(),disabled:!i,isDanger:!0,isOverflow:!1}:void 0,{icon:"erase",label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!i,isOverflow:!1},{icon:"selected-items-filter",label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!i,isOverflow:!1},{icon:"list-check-all",func:()=>this._selectAll(),label:this._translations.selectAll,disabled:!1,isOverflow:!1},{icon:"compare",func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:!1,isOverflow:!1},{icon:"refresh",func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{icon:"export",func:()=>{this._exportToCSV()},label:this._translations.exportCSV,disabled:!1,isOverflow:!1}:void 0],this._defaultVisibleToolSizeInfos=void 0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const t=this._toolbar.offsetWidth;let i=this._toolbarSizeInfos.reduce(((t,i)=>t+i.width),0);const s=["solutions-more","solutions-map-layer-picker-container"];if(i>t){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,a)=>(s.indexOf(a.id)<0&&(i>t?i-=a.width:e.push(a)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((t,i)=>(t.push(i.id),t)),[]);let a=!1;const h=[...this._defaultVisibleToolSizeInfos].reduce(((h,o)=>(!a&&s.indexOf(o.id)<0&&(e.indexOf(o.id)>-1||i+o.width<=t)?(e.indexOf(o.id)<0&&(i+=o.width),h.push(o)):s.indexOf(o.id)<0&&i+o.width>t&&(a=!0),h)),[]);this._setControlsThatFit(h,s)}}),5)}_setControlsThatFit(t,i){let s=JSON.stringify(t)!==JSON.stringify(this._controlsThatFit);document.getElementById("solutions-action-bar").childNodes.forEach((t=>{i.indexOf(t.id)<0&&!s&&(s=this._controlsThatFit.map((t=>t.id)).indexOf(t.id)<0)})),s&&(this._controlsThatFit=[...t])}_setToolbarSizeInfos(){let t=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((i,s)=>{0===s?i.childNodes.forEach((i=>{this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0)})):i.referenceElement||(this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0))})),t&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){return this._toolInfos.filter((t=>t&&!t.isOverflow))}_getDropdown(t){const s=this._getDropdownItems();return s.length>0?i("calcite-dropdown",{disabled:void 0===this._layer,id:"solutions-more"},i("calcite-action",{appearance:"solid",id:t,label:"",slot:"trigger",text:""},i("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),i("calcite-dropdown-group",{"selection-mode":"none"},s.map((t=>i("calcite-dropdown-item",{iconStart:t.icon,onClick:t.func},t.label))))):void 0}_getDropdownItems(){return this._toolInfos.filter((t=>t&&t.isOverflow))}_getAction(t,s,e,a){const h=void 0===this._layer||a;return i("div",{class:"display-flex",id:this._getId(t)},i("calcite-action",{appearance:"solid",disabled:h,icon:t,id:t,label:s,onClick:e,text:s,textEnabled:!0}),this._getToolTip("","bottom",t,s))}_getToolTip(t,s,e,a){return i("calcite-tooltip",{label:t,placement:s,"reference-element":e},i("span",null,a))}_getId(t){return`solutions-action-${t}`}_getDangerAction(t,s,e,a){const h=void 0===this._layer||a;return i("div",{class:"display-flex",id:this._getId(t)},i("calcite-action",{appearance:"solid",disabled:h,id:t,onClick:e,text:""},i("calcite-button",{appearance:"transparent",iconStart:t,kind:"danger"},s)),this._getToolTip("","bottom",t,s))}async _getTable(t,i){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:i},container:t})})),this._checkEditEnabled(),await this._table.when((()=>{this._table.highlightIds.on("change",(()=>{this._selectedIndexes=this._table.highlightIds.toArray().reverse(),this._showOnlySelected&&(this._selectedIndexes.length>0?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this._selectedIndexes)})),this.reactiveUtils.watch((()=>this._table.activeSortOrders),(t=>{var i,s,e,a;this._sortActive=!!this._layer&&(t.length>0&&"asc"===(null===(i=t[0])||void 0===i?void 0:i.direction)||"desc"===(null===(s=t[0])||void 0===s?void 0:s.direction)||null===(null===(e=t[0])||void 0===e?void 0:e.direction)&&(null===(a=t[0])||void 0===a?void 0:a.fieldName)===this._layer.objectIdField)}))})))}async _resetTable(){var t,i;this._clearSelection(),this._allIds=[],this.featureSelectionChange.emit(this._selectedIndexes);const s=this._getColumnTemplates(this._layer.id,null===(i=null===(t=this._layer)||void 0===t?void 0:t.popupTemplate)||void 0===i?void 0:i.fieldInfos);this._allIds=await d(this._layer),this._table?s&&(this._table.tableTemplate.columnTemplates=s):await this._getTable(this._tableNode,s),this._table.layer=this._layer,this._table.view=this.mapView,this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,this._initToolInfos(),await this._table.when((()=>{this._table.highlightIds.removeAll(),this._table.clearSelectionFilter()})),this._showOnlySelected=!1,this._sortActive=!1,await this._sortTable()}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){this._table&&this._layer&&!this._sortActive&&!this._tableSorting&&this.showNewestFirst&&(this._tableSorting=!0,await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(this._layer.objectIdField,"desc"),this._tableSorting=!1})))}_deleteMessage(){return i("calcite-modal",{"aria-labelledby":"modal-title",kind:"danger",onCalciteModalClose:()=>this._deleteClosed(),open:this._confirmDelete},i("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations.deleteFeature),i("div",{slot:"content"},this._translations.confirm),i("calcite-button",{appearance:"outline",kind:"danger",onClick:()=>this._deleteClosed(),slot:"secondary",width:"full"},this._translations.cancel),i("calcite-button",{kind:"danger",loading:this._isDeleting,onClick:()=>{this._deleteFeatures()},slot:"primary",width:"full"},this._translations.delete))}async _deleteFeatures(){this._isDeleting=!0;const t=this._table.highlightIds.toArray().map((t=>({objectId:t})));await this._layer.applyEdits({deleteFeatures:t}),await this._table.refresh(),this._allIds=await d(this._layer),this._isDeleting=!1,this._deleteClosed()}async _mapClicked(t){const i={include:this._layer},s=await this.mapView.hitTest(t.screenPoint,i);s.results.length>0&&(s.results.forEach((t=>{this._clearSelection();const i=t.graphic.getObjectId(),s=this._table.highlightIds.indexOf(i);s>-1?this._table.highlightIds.removeAt(s):this._table.highlightIds.add(i)})),this._showOnlySelected&&this._table.filterBySelection())}_deleteClosed(){this._confirmDelete=!1}_selectAll(){const t=this._allIds;this._table.highlightIds.addMany(t),this._selectedIndexes=t}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){var t;this._selectedIndexes=[],null===(t=this._table)||void 0===t||t.highlightIds.removeAll()}_filter(){this.openFilterOptions.emit()}_switchSelected(){const t=[...this._selectedIndexes];this._table.highlightIds.removeAll();const i=this._allIds.reduce(((i,s)=>(t.indexOf(s)<0&&i.push(s),i)),[]).sort(((t,i)=>t-i));this._table.highlightIds.addMany(i),this._selectedIndexes=i}async _exportToCSV(){const t={},i=this._table.highlightIds.toArray();t[this._layer.id]={selectionSetNames:[this._layer.title],ids:i,layer:this._layer},c(null,t,!1,!1,!0)}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this._selectedIndexes)}_zoom(){this._table.zoomToSelection()}_delete(){this._confirmDelete=!0}async _layerSelectionChanged(t){var i;const s=t.detail[0];if(s!==(null===(i=this._layer)||void 0===i?void 0:i.id)||0===this._allIds.length){this._fetchingData=!0;const t=await l(this.mapView,s);await t.when((()=>{this._layer=t}))}this._fetchingData=!1}_getColumnTemplates(t,i){var s;let e;null===(s=this.mapInfo.layerInfos)||void 0===s||s.some((i=>{if(i.id===t)return e=i,!0}));let a=null==e?void 0:e.columnTemplates;return i&&(a=a?a.map((t=>(i.some((i=>{if(i.fieldName===t.fieldName)return t.label=i.label,!0})),t))):i.map((t=>({type:"field",fieldName:t.fieldName,label:t.label})))),a}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{_controlsThatFit:["_controlsThatFitWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],_selectedIndexes:["_selectedIndexesWatchHandler"],_sortActive:["_sortActiveWatchHandler"]}}};u.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{border-inline-end:1px solid var(--calcite-ui-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-ui-background)}.text-color{color:var(--calcite-ui-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-ui-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{padding:var(--lumo-space-xs) var(--lumo-space-m) !important;font-size:14px !important}';const v=class{constructor(i){t(this,i),this.mapChanged=a(this,"mapChanged",7),this.beforeMapChanged=a(this,"beforeMapChanged",7),this._loadedId="",this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.mapInfos=[],this.mapView=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}async mapInfoChange(t){await this._loadMap(t.detail)}async componentWillLoad(){await this._initModules()}render(){const t=this.hidden?"visibility-hidden":"";return i(s,null,i("map-picker",{mapInfos:this.mapInfos}),i("div",{class:`map-height ${t}`,ref:t=>this._mapDiv=t}),i("map-tools",{basemapConfig:this.basemapConfig,class:"box-shadow",enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableLegend:this.enableLegend,enableSearch:this.enableSearch,mapView:this.mapView,ref:t=>this._mapTools=t,searchConfiguration:this._searchConfiguration}))}async _initModules(){const[t,i,s]=await r(["esri/WebMap","esri/views/MapView","esri/widgets/Home"]);this.WebMap=t,this.MapView=i,this.Home=s}async _loadMap(t){let i=null==t?void 0:t.id;if(this._webMapInfo=(""===i||!i)&&this.mapInfos.length>0?this.mapInfos[0]:t,i=this._webMapInfo.id,this._loadedId!==i){const t=new this.WebMap({portalItem:{id:i}});this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"top-left"}),this._loadedId=i,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{const t=new this.Home({view:this.mapView});this.mapView.ui.add(t,{position:"top-left",index:3}),this.mapView.ui.add(this._mapTools,{position:"top-right",index:0}),this.mapChanged.emit({id:i,mapView:this.mapView})}))}}get el(){return e(this)}};v.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.box-shadow{box-shadow:none !important}.visibility-hidden{visibility:hidden}";export{p as card_manager,u as layer_table,v as map_card}
@@ -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{c as t,g as n}from"./p-e1a4994d.js";import{a as i}from"./p-91c78d98.js";import{l as r}from"./p-05948b48.js";import{q as e}from"./p-53bc5fc1.js";import{_ as s,r as o,c as a}from"./p-ecc95259.js";
6
+ import{c as t,g as n}from"./p-e1a4994d.js";import{a as i}from"./p-91c78d98.js";import{l as r}from"./p-05948b48.js";import{q as e}from"./p-f2194390.js";import{_ as s,r as o,c as a}from"./p-ecc95259.js";
7
7
  /* @preserve
8
8
  * arcgis-pdf-creator v0.0.1
9
9
  * Thu Apr 27 2023 17:20:32 GMT-0700 (Pacific Daylight Time)
@@ -310,7 +310,7 @@ function(t){var n=function(t){for(var n=t.length,i=new Uint8Array(n),r=0;r<n;r++
310
310
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
311
311
  * ====================================================================
312
312
  */
313
- function(){function t(){return($.canvg?Promise.resolve($.canvg):import("./p-e94c7cf2.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}Et.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw Q.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw Q.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=e,f.height=s;var c=f.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,f.width,f.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(c,n,h)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(h)})).then((function(){l.addImage(f.toDataURL("image/jpeg",1),i,r,e,s,a,u)}))}}(),Et.API.putTotalPages=function(t){var n,i=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(t,"g"),i=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),i=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var e=0;e<this.internal.pages[r].length;e++)this.internal.pages[r][e]=this.internal.pages[r][e].replace(n,i);return this},Et.API.viewerPreferences=function(t,n){var i;t=t||{},n=n||!1;var r,e,s,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),u=[],f=0,c=0,l=0;function v(t,n){var i,r=!1;for(i=0;i<t.length;i+=1)t[i]===n&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),i=this.internal.viewerpreferences.configuration,"reset"===t||!0===n){var d=a.length;for(l=0;l<d;l+=1)i[a[l]].value=i[a[l]].defaultValue,i[a[l]].explicitSet=!1}if("object"===h(t))for(e in t)if(s=t[e],v(a,e)&&void 0!==s){if("boolean"===i[e].type&&"boolean"==typeof s)i[e].value=s;else if("name"===i[e].type&&v(i[e].valueSet,s))i[e].value=s;else if("integer"===i[e].type&&Number.isInteger(s))i[e].value=s;else if("array"===i[e].type){for(f=0;f<s.length;f+=1)if(r=!0,1===s[f].length&&"number"==typeof s[f][0])u.push(String(s[f]-1));else if(s[f].length>1){for(c=0;c<s[f].length;c+=1)"number"!=typeof s[f][c]&&(r=!1);!0===r&&u.push([s[f][0]-1,s[f][1]-1].join(" "))}i[e].value="["+u.join(" ")+"]"}else i[e].value=i[e].defaultValue;i[e].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in i)!0===i[t].explicitSet&&n.push("name"===i[t].type?"/"+t+" /"+i[t].value:"/"+t+" "+i[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=i,this
313
+ function(){function t(){return($.canvg?Promise.resolve($.canvg):import("./p-05ba41f9.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}Et.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw Q.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw Q.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=e,f.height=s;var c=f.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,f.width,f.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(c,n,h)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(h)})).then((function(){l.addImage(f.toDataURL("image/jpeg",1),i,r,e,s,a,u)}))}}(),Et.API.putTotalPages=function(t){var n,i=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(t,"g"),i=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),i=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var e=0;e<this.internal.pages[r].length;e++)this.internal.pages[r][e]=this.internal.pages[r][e].replace(n,i);return this},Et.API.viewerPreferences=function(t,n){var i;t=t||{},n=n||!1;var r,e,s,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),u=[],f=0,c=0,l=0;function v(t,n){var i,r=!1;for(i=0;i<t.length;i+=1)t[i]===n&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),i=this.internal.viewerpreferences.configuration,"reset"===t||!0===n){var d=a.length;for(l=0;l<d;l+=1)i[a[l]].value=i[a[l]].defaultValue,i[a[l]].explicitSet=!1}if("object"===h(t))for(e in t)if(s=t[e],v(a,e)&&void 0!==s){if("boolean"===i[e].type&&"boolean"==typeof s)i[e].value=s;else if("name"===i[e].type&&v(i[e].valueSet,s))i[e].value=s;else if("integer"===i[e].type&&Number.isInteger(s))i[e].value=s;else if("array"===i[e].type){for(f=0;f<s.length;f+=1)if(r=!0,1===s[f].length&&"number"==typeof s[f][0])u.push(String(s[f]-1));else if(s[f].length>1){for(c=0;c<s[f].length;c+=1)"number"!=typeof s[f][c]&&(r=!1);!0===r&&u.push([s[f][0]-1,s[f][1]-1].join(" "))}i[e].value="["+u.join(" ")+"]"}else i[e].value=i[e].defaultValue;i[e].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in i)!0===i[t].explicitSet&&n.push("name"===i[t].type?"/"+t+" /"+i[t].value:"/"+t+" "+i[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=i,this
314
314
  /** ====================================================================
315
315
  * @license
316
316
  * jsPDF XMP metadata plugin
@@ -486,4 +486,4 @@ function(t,n){const i=n.map((t=>Object.values(t).map((t=>`"${t}"`)).join(",")+"\
486
486
  * See the License for the specific language governing permissions and
487
487
  * limitations under the License.
488
488
  */
489
- function(t,n){const i=document.createElement("a");void 0!==i.download&&(i.href=URL.createObjectURL(new Blob(n,{type:"text/csv;charset=utf-8;"})),i.download=`${t}.csv`||"export.csv",i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i))}(t,i)}(xi(ji(n,new RegExp(`\\b${i}\\b`))),a),a=[])})),Promise.resolve()}async function Ai(t,n,r,e=!1,s="",o=""){let a=await Li(t,n);const u=ji(n);return a=a.map((t=>t.filter((t=>t.length>0)))).filter((t=>t.length>0)),a=e?yi(a):a,function(t,n,r,e="",s=""){!function(t,n,r,e="",s=""){const o=new mi;o.initialize({pageType:"ANSI_A"},i("../assets/arcgis-pdf-creator/"),"en",t).then((()=>{const t=new bi;t.initialize(o).then((async()=>{const i=r.labelSpec;let a=1;if(s){const n=i.pageProperties,r=f.getPageSize(n.pageType);o.drawImage(s,{x:n.leftMargin,y:n.topMargin,width:r.width-n.leftMargin-n.rightMargin,height:r.height-n.topMargin-n.bottomMargin}),e&&t.drawSupplementalText(e,0,-.1),o.addPage(),++a}await t.addLabelsToDoc(n,i,a,e),o.save()}))}))}(t,n,r,e,s)}(s||xi(u),a,r,s,o),Promise.resolve()}function yi(t){const n=t.map((t=>JSON.stringify(t))),i=new Set(n);return Array.from(i,(t=>JSON.parse(t)))}function ki(t){for(t=(t=(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,Ni)).replace(/<p[^>]*>/gi,Ni).trim().replace(/^\|/,"")).replace(/<\/p>/gi,"")).replace(/\n/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&nbsp;/gi," ")).replace(/\s*\|\s*/g,"|");t.match(/\|\|/);)t=t.replace(/\|\|/,"|");return(t=t.replace(/^\|/,"")).replace(/\|$/,"")}function Si(t,n=!1){const i=[];return t.forEach((t=>{(t.visible||n)&&i.push(`{${t.fieldName}}`)})),{type:"pattern",format:i.join(Ni)}}function xi(t){return t.length>0?t.join(", "):"download"}async function qi(t,n,i){var e,s;let o={layer:n,attributeFormats:{},relationshipId:void 0,labelFormat:{type:"unsupported",format:void 0}};if(n.popupEnabled&&(n.popupTemplate.fieldInfos.forEach((t=>{t.format&&(o.attributeFormats[t.fieldName.toLowerCase()]=t.format)})),i)){const a=null===(s=null===(e=n.popupTemplate)||void 0===e?void 0:e.content[0])||void 0===s?void 0:s.type;if("relationship"===a){const r=n.popupTemplate.content[0].relationshipId,e=t.layers.toArray().concat(t.tables.toArray()).filter((t=>"feature"===t.type&&t.id!==n.id&&t.relationships&&t.relationships.some((t=>t.id===r))));o=await qi(t,e[0],i),o.relationshipId=r}else"fields"===a?(o.labelFormat=Si(n.popupTemplate.fieldInfos),0===o.labelFormat.format.length&&(o.labelFormat=n.popupTemplate.title&&"string"==typeof n.popupTemplate.title?{type:"pattern",format:n.popupTemplate.title}:Si(n.popupTemplate.fieldInfos,!0))):o.labelFormat="text"===a?{type:"pattern",format:ki(n.popupTemplate.content[0].text)}:"expression"===a?await async function(t){const[n]=await r(["esri/arcade"]),i=await n.createArcadeExecutor(t.expression,{variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]});return Promise.resolve({type:"executor",format:i})}(n.popupTemplate.content[0].expressionInfo):Si(n.popupTemplate.fieldInfos)}return Promise.resolve(o)}function ji(t,n=/.+/){let i=[];return Object.keys(t).forEach((r=>{const e=t[r];n.test(r)&&(i=i.concat(e.selectionSetNames))})),i}function Mi(t,n,i,r,e){if(null==t)return"";if(i&&"coded-value"===i.type)return i.getName(t).toString();{let i=t;switch(n){case"date":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDate(i,t)}else i=e.formatDate(i);i=i.replace(/\xe2\x80\xaf/g,"");break;case"double":case"integer":case"long":case"small-integer":if(r){const t=e.convertNumberFormatToIntlOptions(r);i=e.formatNumber(i,t)}else i=e.formatNumber(i)}return i}}export{c as _,Ai as a,Li as c,gi as d,yi as r}
489
+ function(t,n){const i=document.createElement("a");void 0!==i.download&&(i.href=URL.createObjectURL(new Blob(n,{type:"text/csv;charset=utf-8;"})),i.download=`${t}.csv`||"export.csv",i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i))}(t,i)}(xi(ji(n,new RegExp(`\\b${i}\\b`))),a),a=[])})),Promise.resolve()}async function Ai(t,n,r,e=!1,s="",o=""){let a=await Li(t,n);const u=ji(n);return a=a.map((t=>t.filter((t=>t.length>0)))).filter((t=>t.length>0)),a=e?yi(a):a,function(t,n,r,e="",s=""){!function(t,n,r,e="",s=""){const o=new mi;o.initialize({pageType:"ANSI_A"},i("../assets/arcgis-pdf-creator/"),"en",t).then((()=>{const t=new bi;t.initialize(o).then((async()=>{const i=r.labelSpec;let a=1;if(s){const n=i.pageProperties,r=f.getPageSize(n.pageType);o.drawImage(s,{x:n.leftMargin,y:n.topMargin,width:r.width-n.leftMargin-n.rightMargin,height:r.height-n.topMargin-n.bottomMargin}),e&&t.drawSupplementalText(e,0,-.1),o.addPage(),++a}await t.addLabelsToDoc(n,i,a,e),o.save()}))}))}(t,n,r,e,s)}(s||xi(u),a,r,s,o),Promise.resolve()}function yi(t){const n=t.map((t=>JSON.stringify(t))),i=new Set(n);return Array.from(i,(t=>JSON.parse(t)))}function ki(t){for(t=(t=(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,Ni)).replace(/<p[^>]*>/gi,Ni).trim().replace(/^\|/,"")).replace(/<\/p>/gi,"")).replace(/\n/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&nbsp;/gi," ")).replace(/\s*\|\s*/g,"|");t.match(/\|\|/);)t=t.replace(/\|\|/,"|");return(t=t.replace(/^\|/,"")).replace(/\|$/,"")}function Si(t,n=!1){const i=[];return t.forEach((t=>{(t.visible||n)&&i.push(`{${t.fieldName}}`)})),{type:"pattern",format:i.join(Ni)}}function xi(t){return t.length>0?t.join(", "):"download"}async function qi(t,n,i){var e,s;let o={layer:n,attributeFormats:{},relationshipId:void 0,labelFormat:{type:"unsupported",format:void 0}};if(n.popupEnabled&&(n.popupTemplate.fieldInfos.forEach((t=>{t.format&&(o.attributeFormats[t.fieldName.toLowerCase()]=t.format)})),i)){const a=null===(s=null===(e=n.popupTemplate)||void 0===e?void 0:e.content[0])||void 0===s?void 0:s.type;if("relationship"===a){const r=n.popupTemplate.content[0].relationshipId,e=t.layers.toArray().concat(t.tables.toArray()).filter((t=>"feature"===t.type&&t.id!==n.id&&t.relationships&&t.relationships.some((t=>t.id===r))));o=await qi(t,e[0],i),o.relationshipId=r}else"fields"===a?(o.labelFormat=Si(n.popupTemplate.fieldInfos),0===o.labelFormat.format.length&&(o.labelFormat=n.popupTemplate.title&&"string"==typeof n.popupTemplate.title?{type:"pattern",format:n.popupTemplate.title}:Si(n.popupTemplate.fieldInfos,!0))):o.labelFormat="text"===a?{type:"pattern",format:ki(n.popupTemplate.content[0].text)}:"expression"===a?await async function(t){const[n]=await r(["esri/arcade"]),i=await n.createArcadeExecutor(t.expression,{variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]});return Promise.resolve({type:"executor",format:i})}(n.popupTemplate.content[0].expressionInfo):Si(n.popupTemplate.fieldInfos)}return Promise.resolve(o)}function ji(t,n=/.+/){let i=[];return Object.keys(t).forEach((r=>{const e=t[r];n.test(r)&&(i=i.concat(e.selectionSetNames))})),i}function Mi(t,n,i,r,e){if(null==t)return"";if(i&&"coded-value"===i.type)return i.getName(t).toString();{let i=t;switch(n){case"date":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDate(i,t)}else i=e.formatDate(i);i=i.replace(/\xe2\x80\xaf/g,"");break;case"date-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDateOnly(i,t)}else i=e.formatDateOnly(i);break;case"time-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatTimeOnly(i,t)}else i=e.formatTimeOnly(i);break;case"double":case"integer":case"long":case"small-integer":if(r){const t=e.convertNumberFormatToIntlOptions(r);i=e.formatNumber(i,t)}else i=e.formatNumber(i)}return i}}export{c as _,Ai as a,Li as c,gi as d,yi as r}
@@ -18,7 +18,7 @@ import{c as t}from"./p-2a58e378.js";
18
18
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
- */async function n(t){const n=t.createQuery();return n.where="1=1",await t.queryObjectIds(n)}async function a(t,n){let a=[];const s=t?t.map((t=>async function(t,n){const a=n.createQuery();return a.spatialRelationship="intersects",a.geometry=t,n.queryObjectIds(a)}
21
+ */async function n(t){const n=t.createQuery();return n.where=t.definitionExpression||"1=1",await t.queryObjectIds(n)}async function a(t,n){let a=[];const s=t?t.map((t=>async function(t,n){const a=n.createQuery();return a.spatialRelationship="intersects",a.geometry=t,n.queryObjectIds(a)}
22
22
  /** @license
23
23
  * Copyright 2022 Esri
24
24
  *