@esri/solutions-components 5.1.3 → 5.1.5
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/cdn/{QEITYICZ.js → 2ANPUNLB.js} +1 -1
- package/dist/cdn/{KU2QSXAD.js → 2J5XFLVO.js} +1 -1
- package/dist/cdn/{7IKNLW73.js → 2K2JHJHI.js} +1 -1
- package/dist/cdn/{BOQUQFNT.js → 36A4OXYY.js} +1 -1
- package/dist/cdn/{UEC5OGAS.js → 3LOSUHD7.js} +1 -1
- package/dist/cdn/{45JNINYV.js → 3TC2XGQ5.js} +1 -1
- package/dist/cdn/{PLELSLAV.js → 42ZGLRJV.js} +1 -1
- package/dist/cdn/{AULN2QXN.js → 47DJRQSO.js} +1 -1
- package/dist/cdn/{DDUV67TU.js → 4ADGXO3L.js} +1 -1
- package/dist/cdn/4ER7R6OS.js +2 -0
- package/dist/cdn/{UCHXRVI7.js → 4FT4GFHD.js} +1 -1
- package/dist/cdn/{BACWGZE4.js → 4T4PIFVM.js} +1 -1
- package/dist/cdn/{EJK7PYN5.js → 4VBJISFZ.js} +1 -1
- package/dist/cdn/{MWTTZLRQ.js → 52UQZUF4.js} +1 -1
- package/dist/cdn/{KGXEY5HR.js → 57K3VUDO.js} +1 -1
- package/dist/cdn/{KGL266WS.js → 5BJ6II4F.js} +1 -1
- package/dist/cdn/{6SHN7V3N.js → 66G3UOA2.js} +1 -1
- package/dist/cdn/{DRZ2MEHM.js → 6GPU4R2K.js} +1 -1
- package/dist/cdn/{2EUQOQY3.js → 6M63XHZE.js} +1 -1
- package/dist/cdn/{X7GGOH2R.js → 6SJAVXVB.js} +1 -1
- package/dist/cdn/{KN5XFC7O.js → 6VBM5CYH.js} +1 -1
- package/dist/cdn/{2GHTA5PV.js → 72W4TG3N.js} +1 -1
- package/dist/cdn/{BDAY2SRY.js → 743CCX7N.js} +1 -1
- package/dist/cdn/{IKA3ESQ5.js → 7MGKE5QL.js} +1 -1
- package/dist/cdn/{AKXVDLK3.js → 7RAJU536.js} +1 -1
- package/dist/cdn/{MXNYBLUV.js → 7SROO3BB.js} +1 -1
- package/dist/cdn/{2CCKYJSY.js → A6FQF2BM.js} +1 -1
- package/dist/cdn/{GVREVCUB.js → AMCU6DVH.js} +1 -1
- package/dist/cdn/{UNKENPV5.js → AVTCXUIQ.js} +1 -1
- package/dist/cdn/{FPBZRT3J.js → BEX2VQAI.js} +1 -1
- package/dist/cdn/{WXFKH5GM.js → BFWIGZO7.js} +1 -1
- package/dist/cdn/{ENJC4SNG.js → BM2YLVYU.js} +1 -1
- package/dist/cdn/{TFWTXEN7.js → BQTGHHZB.js} +1 -1
- package/dist/cdn/{WEADUP3Y.js → BRO7CVUL.js} +1 -1
- package/dist/cdn/{LABCYKSC.js → C7NYB4E3.js} +1 -1
- package/dist/cdn/{VBZL2GZD.js → C7PGMJUI.js} +1 -1
- package/dist/cdn/{KZBPVSUW.js → CGWXSQMR.js} +1 -1
- package/dist/cdn/{IK3L2OC3.js → CPE5LQ77.js} +1 -1
- package/dist/cdn/{FKQHOE2A.js → CQO3LS4F.js} +1 -1
- package/dist/cdn/{3DFMPPUD.js → D4HLNASK.js} +1 -1
- package/dist/cdn/{HCY3VGST.js → D5KRZ7AK.js} +1 -1
- package/dist/cdn/{56PIVLPU.js → DBUXZOL2.js} +1 -1
- package/dist/cdn/{4PDKVX4T.js → DFCRABYS.js} +1 -1
- package/dist/cdn/{YWO5HXXP.js → DHCQHZGS.js} +1 -1
- package/dist/cdn/{BWFET22E.js → DPGJWY5W.js} +1 -1
- package/dist/cdn/{MIKSQTTI.js → DQVYSRKV.js} +1 -1
- package/dist/cdn/{ESH7SFXX.js → DW7BVW5R.js} +1 -1
- package/dist/cdn/{S3CBTGXW.js → EP5UH274.js} +1 -1
- package/dist/cdn/{6AWTIASQ.js → EX3OQDJQ.js} +1 -1
- package/dist/cdn/{Y2DDFGCN.js → FAUIMAPE.js} +1 -1
- package/dist/cdn/{B57TWGXS.js → FCFYBIFG.js} +1 -1
- package/dist/cdn/{X52CK3FZ.js → FGRROW6V.js} +1 -1
- package/dist/cdn/{J6PFJWXU.js → FRTR7R27.js} +1 -1
- package/dist/cdn/{GCLCH6NX.js → FXGBFLFM.js} +1 -1
- package/dist/cdn/{RKVNFHFD.js → FZY7OS66.js} +1 -1
- package/dist/cdn/{QWUJHEPY.js → GGW5J7IJ.js} +1 -1
- package/dist/cdn/{MZ63UWGX.js → GJVOUQQH.js} +1 -1
- package/dist/cdn/{NAZXHTIH.js → GLMXH46Y.js} +1 -1
- package/dist/cdn/{JBBUAR3W.js → GT3APK5P.js} +1 -1
- package/dist/cdn/{JCPQ7OOS.js → H6NFDCMH.js} +1 -1
- package/dist/cdn/{2XTZLJ5F.js → HE4XVC7T.js} +1 -1
- package/dist/cdn/{AX2U2PGS.js → HK7AVDFS.js} +1 -1
- package/dist/cdn/{37XAYW3Z.js → HPJTDALL.js} +1 -1
- package/dist/cdn/{5LM5R34X.js → HW2PNVBR.js} +1 -1
- package/dist/cdn/{JX7BWUKD.js → HZDK3K4L.js} +1 -1
- package/dist/cdn/{FL4YRGDB.js → IJ3HJGCR.js} +1 -1
- package/dist/cdn/{F6H43GFC.js → IUDZCTI5.js} +1 -1
- package/dist/cdn/{5EYRW6FE.js → IUNQVV4E.js} +1 -1
- package/dist/cdn/{B7YYMYZB.js → IVNAWTJU.js} +1 -1
- package/dist/cdn/{QVDDWNQD.js → IXEH43JO.js} +1 -1
- package/dist/cdn/{2GJEHDZJ.js → IXSXSPVY.js} +1 -1
- package/dist/cdn/{SY3D5J7W.js → J2R6S5NB.js} +1 -1
- package/dist/cdn/{KX4F4INQ.js → J7DVVXDE.js} +1 -1
- package/dist/cdn/{V4OFLP6D.js → JIQTQNV2.js} +1 -1
- package/dist/cdn/{CAXEJ55N.js → JP3PBXBQ.js} +1 -1
- package/dist/cdn/{XN5455P6.js → JUS454AQ.js} +1 -1
- package/dist/cdn/{PWGCOGC7.js → JUYUL4XS.js} +1 -1
- package/dist/cdn/{F46RK2J3.js → K2EL2UZ6.js} +1 -1
- package/dist/cdn/{HSZJX2Q4.js → KJEGIFW3.js} +1 -1
- package/dist/cdn/{RM6HYEWM.js → KWKPWZBG.js} +1 -1
- package/dist/cdn/{ZIIHIUUV.js → KXMDUV5P.js} +1 -1
- package/dist/cdn/{FWRNU7AK.js → LC3EY5AV.js} +1 -1
- package/dist/cdn/{5L7HZJBG.js → LJ4YWFDV.js} +1 -1
- package/dist/cdn/{FAHLQLKD.js → LJSV3N24.js} +1 -1
- package/dist/cdn/{NGAS7OCN.js → LNEAPSZB.js} +1 -1
- package/dist/cdn/{O7LSXSBD.js → LYGGTOTA.js} +1 -1
- package/dist/cdn/{AHC3CH4P.js → MFAEDW75.js} +1 -1
- package/dist/cdn/MHBADLXW.js +2 -0
- package/dist/cdn/{CYKO5XJY.js → MRYP6TKM.js} +1 -1
- package/dist/cdn/{VZY472CH.js → NG3F6PTV.js} +1 -1
- package/dist/cdn/{SI2EHJJ5.js → OIKSXWIN.js} +1 -1
- package/dist/cdn/{VLP6VQEG.js → OKJQRXDF.js} +1 -1
- package/dist/cdn/{PIRHBQVO.js → PM6MGL6S.js} +59 -59
- package/dist/cdn/{LI3GKZ35.js → POGUZ34D.js} +1 -1
- package/dist/cdn/{RNMVOUE3.js → PS3JQUTJ.js} +1 -1
- package/dist/cdn/{C7YLT2V6.js → PS72QAM2.js} +1 -1
- package/dist/cdn/{2DCSGUOX.js → PSEXPNM3.js} +1 -1
- package/dist/cdn/{J5Q7IGCO.js → PTTNVFTG.js} +1 -1
- package/dist/cdn/{G63VTGNV.js → QFIGUV2M.js} +1 -1
- package/dist/cdn/{RQQWTDQG.js → QTKE7MA4.js} +1 -1
- package/dist/cdn/{3N2AUH5S.js → QTVE3UQ6.js} +1 -1
- package/dist/cdn/{MOHSZVTU.js → QX4VD677.js} +1 -1
- package/dist/cdn/{ZOGD4MGP.js → R4DDGIC2.js} +1 -1
- package/dist/cdn/{HXCNKN3S.js → R4HQIY3D.js} +1 -1
- package/dist/cdn/{6AVCTQ6J.js → R4SSUAM5.js} +1 -1
- package/dist/cdn/{GLD7SDA5.js → S2WAKXLP.js} +1 -1
- package/dist/cdn/{TBXAQ6YS.js → SHDZVK22.js} +1 -1
- package/dist/cdn/{6FPVZV4K.js → SSCZIVLF.js} +1 -1
- package/dist/cdn/{3XOKCST3.js → SVSOXKWN.js} +1 -1
- package/dist/cdn/TIYKWS6T.js +2 -0
- package/dist/cdn/{37CMWBMW.js → TN3H35H5.js} +1 -1
- package/dist/cdn/{IXSDSBUI.js → TV64L24Q.js} +1 -1
- package/dist/cdn/{5BJO5ABV.js → U4HGOXNJ.js} +1 -1
- package/dist/cdn/{HKURBCD6.js → UVVHDNLG.js} +1 -1
- package/dist/cdn/{3MN7XFQ2.js → VCGIHOOS.js} +1 -1
- package/dist/cdn/{OLN76PG4.js → VMJ4RMTW.js} +1 -1
- package/dist/cdn/{TSLAML4I.js → VO5GTLFZ.js} +1 -1
- package/dist/cdn/{XEON6B7Z.js → VQR63FZS.js} +1 -1
- package/dist/cdn/{XOCNSPTC.js → W75AYE63.js} +1 -1
- package/dist/cdn/{6UVMG6O6.js → WFZAADG6.js} +1 -1
- package/dist/cdn/{BTOTDVAS.js → WUIPWLKY.js} +1 -1
- package/dist/cdn/{3TO6KC3G.js → WV6SP7G6.js} +1 -1
- package/dist/cdn/{43MZA66W.js → X5OAASE3.js} +1 -1
- package/dist/cdn/{TKIL55TV.js → XFQFC2MM.js} +1 -1
- package/dist/cdn/{N4MCHYQT.js → XVC34MKM.js} +1 -1
- package/dist/cdn/{NBWMZOGE.js → XZMAMFEG.js} +1 -1
- package/dist/cdn/{UE2HAEBW.js → YY2HNKAV.js} +1 -1
- package/dist/cdn/{PPLHKHZ3.js → YYX3TPSP.js} +1 -1
- package/dist/cdn/{SGWJLKO4.js → Z25PSY3U.js} +1 -1
- package/dist/cdn/{WKTMPKVR.js → ZO6UNZTG.js} +1 -1
- package/dist/cdn/{XR3PT7FP.js → ZS54T3U7.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/components/card-manager/customElement.js +1 -1
- package/dist/components/crowdsource-manager/customElement.js +7 -9
- package/dist/components/layer-table/customElement.js +75 -65
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +4 -4
- package/package.json +1 -1
- package/dist/cdn/DTTQLI5W.js +0 -2
- package/dist/cdn/R437P4KQ.js +0 -2
- package/dist/cdn/UKAP3ALW.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"./SHQFXQEI.js";import{c as C,e as k}from"./C5KDPY7R.js";import{f as g}from"./YM4U4HSN.js";import{b as z,c as E,d as A}from"./IADXB53D.js";import d from"./QZ2ZMWIH.js";import c from"./CS5N3DOL.js";import{a as l}from"./YUWXPLTE.js";import{a as $}from"./
|
|
2
|
+
import e from"./SHQFXQEI.js";import{c as C,e as k}from"./C5KDPY7R.js";import{f as g}from"./YM4U4HSN.js";import{b as z,c as E,d as A}from"./IADXB53D.js";import d from"./QZ2ZMWIH.js";import c from"./CS5N3DOL.js";import{a as l}from"./YUWXPLTE.js";import{a as $}from"./UVVHDNLG.js";import{b as w}from"./57K3VUDO.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{H as x,J as s,L as b,h as u,i as a,q as h}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([,{a:r,b:c,c:T,d:m},{f:p}])=>{var I=u`:host{display:block;--instant-apps-interactive-legend-heading-font-size: 1rem;--instant-apps-interactive-legend-heading-font-weight: normal;--instant-apps-interactive-legend-caption-font-weight: normal;--instant-apps-interactive-legend-secondary-color: var( --calcite-color-text-1 );--instant-apps-interactive-legend-field-name-font-size: 1rem;--instant-apps-interactive-legend-total-feature-count-font-size: .875rem;--instant-apps-interactive-legend-info-font-size: .875rem;--instant-apps-interactive-legend-info-item-background--selected: #c7ebff;--instant-apps-interactive-legend-info-item-color--selected: var( --calcite-color-text-2 );--instant-apps-interactive-legend-secondary-background-color: var( --calcite-color-background );--instant-apps-interactive-legend-ui-padding: 15px 10px}:host .esri-legend__layer-caption calcite-action{margin-left:20px}:host .esri-legend__layer-caption{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}:host .instant-apps-interactive-legend__layer-caption--compact{--instant-apps-interactive-legend-ui-padding: 5px}:host .instant-apps-interactive-legend__layer-caption--compact .instant-apps-interactive-legend__layer-caption-btn-container{display:flex;justify-content:flex-end;width:100%}:host .instant-apps-interactive-legend__layer-caption--compact .instant-apps-interactive-legend__layer-caption-btn-container .instant-apps-interactive-legend__show-all-btn{border:none;background-color:transparent;cursor:pointer;color:var(--calcite-color-brand);font-weight:var(--calcite-font-weight-medium);font-size:.75rem;padding-inline-start:20px}:host .instant-apps-interactive-legend__layer-caption--compact .instant-apps-interactive-legend__zoom-to-btn{--calcite-icon-color: var(--calcite-color-brand);--calcite-color-transparent-hover: transparent}:host .instant-apps-interactive-legend__layer-caption--compact .instant-apps-interactive-legend__legend-layer-caption-text{display:inline-block;font-size:.75rem;white-space:nowrap;width:100%;overflow:hidden;text-overflow:ellipsis}:host .instant-apps-interactive-legend__legend-layer-caption-text{display:inline-block;margin-left:5px;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal}:host .instant-apps-interactive-legend__layer-caption-btn-container{display:flex;white-space:nowrap}:host .instant-apps-interactive-legend__layer-caption-btn-container calcite-button{margin:2px}:host .esri-legend__layer-caption{font-weight:var(--instant-apps-interactive-legend-caption-font-weight)}:host .esri-legend__layer-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}:host:dir(rtl) .esri-legend__layer-caption calcite-action{margin-left:unset;margin-right:20px}`,v={ZoomTo:"magnifying-glass-plus",ShowAll:"list-check-all"},o={layerCaption:"esri-legend__layer-caption",layerCaptionBtnContainer:"instant-apps-interactive-legend__layer-caption-btn-container",layerCaptionBtnContainerNoText:"instant-apps-interactive-legend__layer-caption-btn-container--no-text",layerCaptionText:"instant-apps-interactive-legend__legend-layer-caption-text",compact:"instant-apps-interactive-legend__layer-caption--compact",showAll:"instant-apps-interactive-legend__show-all-btn",zoomTo:"instant-apps-interactive-legend__zoom-to-btn"},y=class extends x{constructor(){super(...arguments),this._messages=$({name:"instant-apps-interactive-legend",blocking:!0}),this.expanded=!0,this.legendLayerExpandUpdated=h(),this.showAllSelected=h()}static{this.properties={legendvm:0,activeLayerInfo:0,layer:0,titleText:1,legendElementIndex:9,zoomTo:5,isInteractive:5,legendElement:0,expanded:5}}static{this.styles=I}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.legendLayerExpandUpdated.emit(),(this.activeLayerInfo?.legendElements?.filter(e=>g(e))).length>0&&c.set("relationshipRampExpandStates",{...r.relationshipRampExpandStates,[this.activeLayerInfo.layer.id]:this.expanded})}}handleZoomTo(){return()=>{let e=T(this.layer),t=p(e,this.legendElement);A(e,this.legendvm.view,t)}}handleShowAll(){return()=>{let e=()=>{let i=E(n,this.legendElement.title);m({intLegendLayerData:i,layerId:this.layer.id})},t=()=>{let i=z(n);m({intLegendLayerData:i,layerId:this.layer.id})},n=r.data?.[this.layer?.id];if(p(n,this.legendElement)){e();return}t(),this.showAllSelected.emit()}}shouldDisplayShowAll(){let e=r.data?.[this.layer?.id],t=p(e,this.legendElement);return(e?.categories?.size??0)>1||Array.isArray(t?.nestedInfos)&&t.nestedInfos.length>1}render(){let e=C(this.activeLayerInfo),t=k(this.activeLayerInfo)&&(g(this.legendElement)||!this.legendElement?.type?.includes("-ramp")),{expanded:n}=this,i=c.get("compact"),d=i?` ${o.compact}`:"";if(e&&!this.titleText)return null;let _=this.titleText?a`<span class=${s(o.layerCaptionText)} title=${this.titleText??b}>${this.titleText}</span>`:null,f=this.isInteractive||t?this.renderLegendElementCaptionControls():"";return a`<div class=${`${o.layerCaption}${d}`}><calcite-action @click=${this.toggleExpanded()} .icon=${n?"chevron-down":"chevron-up"} appearance=transparent .text=${n?this._messages.collapse:this._messages.expand} .label=${n?this._messages.collapse:this._messages.expand} scale=s></calcite-action>${i?[_,f]:[f,_]}</div>`}renderLegendElementCaptionControls(){let e=this.titleText?"":` ${o.layerCaptionBtnContainerNoText}`;return l("layer-caption-btn-container",a`<div class=${`${o.layerCaptionBtnContainer}${e}`}>${this.renderShowAllZoomToButtons()}</div>`)}renderShowAllZoomToButtons(){return c.get("compact")?this.renderCompactButtonUI():this.renderButtonUI()}renderCompactButtonUI(){let e=this.shouldDisplayShowAll(),t="zoomToCompact",n=this.zoomTo&&[a`<calcite-action id=${t} class=${s(o.zoomTo)} @click=${this.handleZoomTo()} .icon=${v.ZoomTo} appearance=transparent scale=s .text=${this._messages.zoomTo}></calcite-action>`,a`<calcite-tooltip .referenceElement=${t} placement=top .label=${this._messages.zoomTo}>${this._messages.zoomTo}</calcite-tooltip>`]||"",i=e?a`<button @click=${this.handleShowAll()} class=${s(o.showAll)}>${this._messages.showAll}</button>`:null;return[n,i]}renderButtonUI(){let e=this.shouldDisplayShowAll(),t="showAll",n="zoomTo",i=e&&[l("show-all-button",a`<calcite-button id=${t} .label=${this._messages.showAll} @click=${this.handleShowAll()} .iconStart=${v.ShowAll} appearance=outline round></calcite-button>`),a`<calcite-tooltip .referenceElement=${t} placement=top .label=${this._messages.showAll}>${this._messages.showAll}</calcite-tooltip>`]||"",d=this.zoomTo&&[l("zoom-to-button",a`<calcite-button id=${n} .label=${this._messages.zoomTo} @click=${this.handleZoomTo()} .iconStart=${v.ZoomTo} appearance=outline round></calcite-button>`),a`<calcite-tooltip .referenceElement=${n} placement=top .label=${this._messages.zoomTo}>${this._messages.zoomTo}</calcite-tooltip>`]||"";return[i,d]}};w("instant-apps-interactive-legend-legend-element-caption",y);return y},c,d,e)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as M}from"./2L62YUIH.js";import{a as w}from"./YUWXPLTE.js";import{a as C}from"./HKURBCD6.js";import{b as S}from"./KGXEY5HR.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{H as D,J as y,h as E,i as p,l as x,q as k}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([m,P,$,B])=>{var o={Loading:"loading",Disabled:"disabled",Complete:"complete",Calculating:"calculating",Bottom:"bottom",Left:"left",Floating:"floating"},g={Up:"chevron-up",Down:"chevron-down",Left:"chevron-left",Right:"chevron-right",Blank:"blank"},U={Small:"s",Large:"l"},A={Transparent:"transparent"},F={Start:"start",Center:"center"},N=E`:host{display:block;--instant-apps-scoreboard-background-color: var(--calcite-color-foreground-1);--instant-apps-scoreboard-text-color: var(--calcite-color-text-1);--instant-apps-scoreboard-mobile-position-bottom: 0;background-color:var(--instant-apps-scoreboard-background-color);color:var(--instant-apps-scoreboard-text-color)}:host .instant-apps-scoreboard{box-sizing:border-box;border:1px solid var(--calcite-color-border-1);box-shadow:0 3px 15px #0003;border-radius:3px}:host .instant-apps-scoreboard calcite-loader{--calcite-loader-padding: 1rem}:host .instant-apps-scoreboard__items-container{display:flex}:host .instant-apps-scoreboard__items-container calcite-action{height:100%}:host .instant-apps-scoreboard__items,:host .instant-apps-scoreboard__item{box-sizing:border-box;display:flex}:host .instant-apps-scoreboard__items{list-style-type:none;padding-left:0;margin:0;padding-top:1.75%;padding-bottom:1.75%;width:100%}:host .instant-apps-scoreboard__item{flex-direction:column;justify-content:flex-end;align-items:center;padding:1%}:host .instant-apps-scoreboard__item-label{box-sizing:border-box;line-height:24px;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;word-break:break-word}:host .instant-apps-scoreboard__item-label{font-size:1rem;font-weight:400;text-align:center}:host .instant-apps-scoreboard__item-value{display:flex;justify-content:center;align-items:center;min-width:32px;min-height:32px;margin-top:5px;font-size:1.5rem;font-weight:900}:host .instant-apps-scoreboard__item-value-placeholder{display:inline-block;width:32px;height:32px;background-color:var(--calcite-color-foreground-3);border-radius:4px}:host(.instant-apps-scoreboard__position--bottom){bottom:0}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__items{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__item{min-width:10vw;vertical-align:top}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating){left:50%;max-width:calc(100% - 30px);transform:translate(-50%,-15px)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:25vw}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){left:unset;bottom:0;transform:unset;width:100%}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{min-width:unset}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{width:100%;justify-content:space-between}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard{display:flex;justify-content:center;align-items:center;width:10vw;overflow-y:auto}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container{flex-direction:column;height:100%;box-sizing:border-box}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container calcite-action{height:unset;width:100%}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items{flex-direction:column;padding:10px}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__item{padding-top:.5vh;padding-bottom:.5vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating){top:15px;left:15px;max-height:calc(100% - 30px)}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:10vw;min-height:35vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned){top:unset;left:unset;transform:unset;height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{justify-content:space-between}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--floating){left:15px}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--floating){left:unset;right:15px}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--pinned){left:0}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--pinned){left:unset;right:0}@media only screen and (min-width:992px){:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){bottom:var(--instant-apps-scoreboard-mobile-position-bottom)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__item{justify-content:center;min-width:unset;flex-grow:1}}`,v="instant-apps-scoreboard",O=6,T=`${v}--`,h=`${v}__`,j=M.medium[1],n={itemsContainer:`${h}items-container`,items:`${h}items`,item:`${h}item`,label:`${h}item-label`,value:`${h}item-value`,valuePlaceholder:`${h}item-value-placeholder`,position:{bottom:`${h}position--bottom`,side:`${h}position--side`,left:`${h}position--left`,right:`${h}position--right`},mode:{floating:`${h}mode--floating`,pinned:`${h}mode--pinned`}},I=class extends D{constructor(){super(...arguments),this._messages=C({name:"instant-apps-scoreboard"}),this.state=o.Loading,this.itemIndex=0,this.isMobile=!1,this.position=o.Bottom,this.mode=o.Floating,this.itemLimit=6,this.autoDockEnabled=!0,this.geometry=null,this.queryType="layerView",this.scoreboardItemsUpdated=k()}static{this.properties={state:16,itemIndex:16,layers:16,layerViews:16,isMobile:16,view:0,items:0,position:1,mode:1,itemLimit:9,autoDockEnabled:5,geometry:0,queryType:1}}static{this.styles=N}get checkMobile(){let t=this.el?.parentElement?.offsetWidth;return t&&!Number.isNaN(t)&&t>0?t<j:!1}get getItemsToDisplay(){let t=this.getItemLimit();return this.items.filter(e=>e.visible).slice(this.itemIndex,t+this.itemIndex)}get isEnd(){let t=this.getItemLimit(),e=this.items.slice(this.items.length-t).map(s=>s.uid),a=this.items.slice(this.itemIndex,this.itemIndex+t).map(s=>s.uid);return e.every((s,l)=>s===a[l])}async load(){let t=new ResizeObserver(()=>{this.itemIndex=0,this.autoDockEnabled&&(this.isMobile=!!this.checkMobile)});if(this.el?.parentElement&&t.observe(this.el.parentElement),!this.view||!this.items)this.state=o.Disabled;else try{await this.initModules()}catch{this.state=o.Disabled}}willUpdate(t){t.has("items")&&this.generateUIDs(),t.has("items")&&this.storeLayers(),t.has("layers")&&this.storeLayerViews(),t.has("geometry")&&(this.hasUpdated||this.geometry!==null)&&this.calculateScoreboardItemValuesFromGeometry(),t.has("layerViews")&&this.calculateScoreboardItemValues()}async loaded(){if(this.state!==o.Disabled)try{await m?.whenOnce(()=>this.view?.ready),this.generateUIDs(),await this.loadMapResources(),this.storeLayers(),this.initViewUpdateWatcher()}catch{this.state=o.Disabled,console.error(`${v}: FAILED TO LOAD MAP RESOURCES`)}}disconnectedCallback(){super.disconnectedCallback(),this.state=o.Disabled,this.itemIndex=0,this.layers?.removeAll(),this.layers?.destroy(),this.layers=null,this.layerViews?.removeAll(),this.layerViews?.destroy(),this.layerViews=null,this.handles?.removeAll(),this.handles?.destroy(),this.handles=null}scoreboardItemsUpdatedHandler(){this.scoreboardItemsUpdated.emit(this.items)}generateUIDs(){this.itemIndex=0,this.items.forEach(this.generateUID())}async storeLayers(){this.state=o.Calculating,await(this.view?.map).loadAll();let t=this.items.map(i=>i?.layer?.id),e=i=>i.type!=="feature"||!i.isTable,a=i=>i.type==="feature"||i.type==="scene",s=i=>t.includes(i.id),l=i=>e(i)&&a(i)&&s(i);this.layers=this.view?.map?.allLayers?.filter(i=>l(i)),this.watchLayerVisibility()}async storeLayerViews(){if(this.layers&&this.layers.length>0){this.layers.forEach(s=>s.outFields=["*"]);let t=[];this.layers.forEach(s=>{let l=s,i=this.view?.whenLayerView(l);t.push(i)});let e=(await Promise.allSettled(t)).filter(s=>s.status==="fulfilled"&&s.value).map(s=>s.value),a=[];e.forEach(s=>a.push(m.whenOnce(()=>!s.updating))),await Promise.all(a),this.layerViews=new $([...e])}}calculateScoreboardItemValuesFromGeometry(){this.calculateScoreboardItemValues()}async calculateScoreboardItemValues(){if(this.layers&&this.layers.length===0||this.layerViews&&this.layerViews.length===0)return;this.state=o.Calculating;let t=[...this.items],e=[];this.queryStatDefinitions(t,e);let a=await Promise.all(e);this.handleQueryFeaturesResponses(a,t),this.items.length=0,t.forEach(s=>this.items.push(s)),this.state=o.Complete,this.scoreboardItemsUpdatedHandler(),this.initStationaryWatcher()}async initModules(){try{this.handles=new B,this.layers=new $([]),this.layerViews=new $([])}catch(t){throw console.error(t),this.state=o.Disabled,new Error("Failed to initialize modules")}}async loadMapResources(){if(this.view){let{map:t}=this.view,e=t;try{await e.loadAll()}catch(a){throw console.error(a),this.state=o.Disabled,new Error("Failed to load map resources")}}}generateUID(){return t=>{let e=Math.random(),a=Math.floor(Math.random()*10)+11,s=e.toString(a).replace("0.","");t.uid=s}}previousItem(){this.itemIndex=this.itemIndex-1}nextItem(){this.itemIndex=this.itemIndex+1}queryStatDefinitions(t,e){let a=i=>{let{field:r,operation:d}=i,c=r,b=`${r}_${d}`;return{onStatisticField:c,outStatisticFieldName:b,statisticType:d}},s=(i,r)=>{let d=this.queryType==="layer"?i.layer.createQuery():i.createQuery(),c=[r],b=this.geometry??this.view?.extent;d.outStatistics=c,d.geometry=b;let u=i?.filter?.timeExtent??i?.featureEffect?.filter?.timeExtent??null;return u&&(d.timeExtent=u),d},l=()=>async i=>{let r=this.layerViews?.find(u=>u.layer.id===i?.layer?.id);if(!r)return;let d=a(i),c=s(r,d),b=this.queryType==="layer"?r.layer.queryFeatures(c):r.queryFeatures(c);e.push(b)};t.forEach(l())}handleQueryFeaturesResponses(t,e){let a=i=>{let r=i.features[0],{attributes:d}=r;return Object.values(d)[0]},s=()=>({notation:"compact",compactDisplay:"short"}),l=()=>(i,r)=>{let d=a(i),c=s(),b=d!==null,u=b?P.formatNumber(d,c):null,_=b?`${u}`:"";e[r].displayValue=_,e[r].value=d};t.forEach(l())}initStationaryWatcher(){let t={once:!0,initial:!0},e=()=>m.when(()=>!this.view?.interacting,()=>{this.queryType==="layerView"&&this.calculateScoreboardItemValues()},t),a=()=>m.when(()=>this.view?.stationary,()=>e()),s="stationary-watcher-key";this.handles?.has(s)&&this.handles.remove(s),this.handles?.add(a(),s)}initViewUpdateWatcher(){return m.watch(()=>this.view?.updating,()=>{m.when(()=>!this.view?.updating,()=>{this.queryType==="layerView"&&this.calculateScoreboardItemValues()},{once:!0,initial:!0})},{initial:!0})}watchLayerVisibility(){if(!this.layers)return;let t="visbilityWatcherKey";this.handles?.remove(t);let e=[],a=s=>{let l=async()=>{let r=await this.view?.whenLayerView(s);await m.whenOnce(()=>!r?.updating),this.calculateScoreboardItemValues()},i=m.watch(()=>s?.visible,async()=>await l());e.push(i)};this.layers.forEach(a),this.handles?.add([...e],t)}getItemLimit(){return this.itemLimit<2||this.itemLimit>6?O:this.itemLimit}setHostClassNames(){this.isMobile||this.position===o.Bottom?(this.el.classList.remove(n.position.side,n.position.left,n.position.right),this.el.classList.add(n.position.bottom)):(this.el.classList.remove(n.position.bottom),this.el.classList.add(n.position.side),this.position===o.Left?(this.el.classList.remove(n.position.right),this.el.classList.add(n.position.left)):(this.el.classList.remove(n.position.left),this.el.classList.add(n.position.right))),this.isMobile?(this.el.classList.remove(n.mode.floating),this.el.classList.add(n.mode.pinned)):this.mode===o.Floating?(this.el.classList.remove(n.mode.pinned),this.el.classList.add(n.mode.floating)):this.el.classList.add(n.mode.pinned)}render(){let{state:t}=this,e=t===o.Loading,a=t===o.Calculating,s=t===o.Disabled,l=e||a||this.queryType==="layerView"&&this.view?.updating?this.renderProgress():null;return this.setHostClassNames(),s?null:[l,this.items?.length>0?this.renderBase():null]}renderBase(){return w("instant-apps-scoreboard-base",p`<div class=${y(v)}>${this.renderContent()}</div>`)}renderContent(){let{state:t}=this;return t===o.Loading?this.renderLoader():t===o.Calculating||t===o.Complete?this.renderItemsContainer():null}renderItemsContainer(){let[t,e]=this.renderPreviousNextButtons();return p`<div class=${y(n.itemsContainer)}>${t}${this.renderItems()}${e}</div>`}renderPreviousNextButtons(){let t=this.getItemLimit(),e=this.items.filter(q=>q.visible)?.length<=t,a=this.itemIndex===0,s=this.isEnd,l=this.isMobile?!0:this.position===o.Bottom,i=l?F.Start:F.Center,r=l?g.Left:g.Up,d=l?g.Right:g.Down,c={previous:r,next:d},b=a||e?g.Blank:c.previous,u=s||e?g.Blank:c.next,_={previous:a||e,next:s||e},L=A.Transparent,V=this.isMobile?U.Small:U.Large,f={previous:this._messages.previous,next:this._messages.next};return[p`<calcite-action @click=${this.previousItem} .icon=${b} .disabled=${_.previous} .alignment=${i} .scale=${V} .appearance=${L} .text=${f.previous??""} .label=${f.previous}></calcite-action>`,p`<calcite-action @click=${this.nextItem} .icon=${u} .disabled=${_.next} .alignment=${i} .scale=${V} .appearance=${L} .text=${f.next??""} .label=${f.next}></calcite-action>`]}renderItems(){let{items:t}=n,e=this.getItemsToDisplay.map(a=>this.renderItem(a));return p`<ul class=${y(t)}>${e}</ul>`}renderItem(t){let{label:e}=t;return p`<li class=${y(n.item)}><span class=${y(n.label)} title=${e??x}>${e}</span>${this.renderValue(t)}</li>`}renderValue(t){let{displayValue:e}=t,a=this.state===o.Calculating,s=this.state===o.Disabled,l=e===void 0&&a,i=e||this._messages.NA,r=!this.layers?.find(c=>t?.layer?.id===c.id)?.visible,d=l?this.renderValuePlaceholder():s?"":r?p`<calcite-icon icon=view-hide scale=l title=${this._messages.layerVisibilityOff??x}></calcite-icon>`:i;return p`<span class=${y(n.value)}>${d}</span>`}renderValuePlaceholder(){return p`<span class=${y(n.valuePlaceholder)}></span>`}renderProgress(){let t=`${T}calcite-`;return w(`${t}progress`,p`<calcite-progress type=indeterminate></calcite-progress>`)}renderLoader(){let t=`${T}calcite-`,e=this._messages.loading;return w(`${t}loader`,p`<calcite-loader .label=${e??""} .text=${e} scale=m></calcite-loader>`)}};S("instant-apps-scoreboard",I);return I},"core/reactiveUtils","intl","core/Collection","core/Handles")
|
|
2
|
+
import{a as M}from"./2L62YUIH.js";import{a as w}from"./YUWXPLTE.js";import{a as C}from"./UVVHDNLG.js";import{b as S}from"./57K3VUDO.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{H as D,J as y,h as E,i as p,l as x,q as k}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([m,P,$,B])=>{var o={Loading:"loading",Disabled:"disabled",Complete:"complete",Calculating:"calculating",Bottom:"bottom",Left:"left",Floating:"floating"},g={Up:"chevron-up",Down:"chevron-down",Left:"chevron-left",Right:"chevron-right",Blank:"blank"},U={Small:"s",Large:"l"},A={Transparent:"transparent"},F={Start:"start",Center:"center"},N=E`:host{display:block;--instant-apps-scoreboard-background-color: var(--calcite-color-foreground-1);--instant-apps-scoreboard-text-color: var(--calcite-color-text-1);--instant-apps-scoreboard-mobile-position-bottom: 0;background-color:var(--instant-apps-scoreboard-background-color);color:var(--instant-apps-scoreboard-text-color)}:host .instant-apps-scoreboard{box-sizing:border-box;border:1px solid var(--calcite-color-border-1);box-shadow:0 3px 15px #0003;border-radius:3px}:host .instant-apps-scoreboard calcite-loader{--calcite-loader-padding: 1rem}:host .instant-apps-scoreboard__items-container{display:flex}:host .instant-apps-scoreboard__items-container calcite-action{height:100%}:host .instant-apps-scoreboard__items,:host .instant-apps-scoreboard__item{box-sizing:border-box;display:flex}:host .instant-apps-scoreboard__items{list-style-type:none;padding-left:0;margin:0;padding-top:1.75%;padding-bottom:1.75%;width:100%}:host .instant-apps-scoreboard__item{flex-direction:column;justify-content:flex-end;align-items:center;padding:1%}:host .instant-apps-scoreboard__item-label{box-sizing:border-box;line-height:24px;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;word-break:break-word}:host .instant-apps-scoreboard__item-label{font-size:1rem;font-weight:400;text-align:center}:host .instant-apps-scoreboard__item-value{display:flex;justify-content:center;align-items:center;min-width:32px;min-height:32px;margin-top:5px;font-size:1.5rem;font-weight:900}:host .instant-apps-scoreboard__item-value-placeholder{display:inline-block;width:32px;height:32px;background-color:var(--calcite-color-foreground-3);border-radius:4px}:host(.instant-apps-scoreboard__position--bottom){bottom:0}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__items{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__item{min-width:10vw;vertical-align:top}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating){left:50%;max-width:calc(100% - 30px);transform:translate(-50%,-15px)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:25vw}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){left:unset;bottom:0;transform:unset;width:100%}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{min-width:unset}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{width:100%;justify-content:space-between}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard{display:flex;justify-content:center;align-items:center;width:10vw;overflow-y:auto}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container{flex-direction:column;height:100%;box-sizing:border-box}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container calcite-action{height:unset;width:100%}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items{flex-direction:column;padding:10px}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__item{padding-top:.5vh;padding-bottom:.5vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating){top:15px;left:15px;max-height:calc(100% - 30px)}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:10vw;min-height:35vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned){top:unset;left:unset;transform:unset;height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{justify-content:space-between}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--floating){left:15px}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--floating){left:unset;right:15px}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--pinned){left:0}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--pinned){left:unset;right:0}@media only screen and (min-width:992px){:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){bottom:var(--instant-apps-scoreboard-mobile-position-bottom)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__item{justify-content:center;min-width:unset;flex-grow:1}}`,v="instant-apps-scoreboard",O=6,T=`${v}--`,h=`${v}__`,j=M.medium[1],n={itemsContainer:`${h}items-container`,items:`${h}items`,item:`${h}item`,label:`${h}item-label`,value:`${h}item-value`,valuePlaceholder:`${h}item-value-placeholder`,position:{bottom:`${h}position--bottom`,side:`${h}position--side`,left:`${h}position--left`,right:`${h}position--right`},mode:{floating:`${h}mode--floating`,pinned:`${h}mode--pinned`}},I=class extends D{constructor(){super(...arguments),this._messages=C({name:"instant-apps-scoreboard"}),this.state=o.Loading,this.itemIndex=0,this.isMobile=!1,this.position=o.Bottom,this.mode=o.Floating,this.itemLimit=6,this.autoDockEnabled=!0,this.geometry=null,this.queryType="layerView",this.scoreboardItemsUpdated=k()}static{this.properties={state:16,itemIndex:16,layers:16,layerViews:16,isMobile:16,view:0,items:0,position:1,mode:1,itemLimit:9,autoDockEnabled:5,geometry:0,queryType:1}}static{this.styles=N}get checkMobile(){let t=this.el?.parentElement?.offsetWidth;return t&&!Number.isNaN(t)&&t>0?t<j:!1}get getItemsToDisplay(){let t=this.getItemLimit();return this.items.filter(e=>e.visible).slice(this.itemIndex,t+this.itemIndex)}get isEnd(){let t=this.getItemLimit(),e=this.items.slice(this.items.length-t).map(s=>s.uid),a=this.items.slice(this.itemIndex,this.itemIndex+t).map(s=>s.uid);return e.every((s,l)=>s===a[l])}async load(){let t=new ResizeObserver(()=>{this.itemIndex=0,this.autoDockEnabled&&(this.isMobile=!!this.checkMobile)});if(this.el?.parentElement&&t.observe(this.el.parentElement),!this.view||!this.items)this.state=o.Disabled;else try{await this.initModules()}catch{this.state=o.Disabled}}willUpdate(t){t.has("items")&&this.generateUIDs(),t.has("items")&&this.storeLayers(),t.has("layers")&&this.storeLayerViews(),t.has("geometry")&&(this.hasUpdated||this.geometry!==null)&&this.calculateScoreboardItemValuesFromGeometry(),t.has("layerViews")&&this.calculateScoreboardItemValues()}async loaded(){if(this.state!==o.Disabled)try{await m?.whenOnce(()=>this.view?.ready),this.generateUIDs(),await this.loadMapResources(),this.storeLayers(),this.initViewUpdateWatcher()}catch{this.state=o.Disabled,console.error(`${v}: FAILED TO LOAD MAP RESOURCES`)}}disconnectedCallback(){super.disconnectedCallback(),this.state=o.Disabled,this.itemIndex=0,this.layers?.removeAll(),this.layers?.destroy(),this.layers=null,this.layerViews?.removeAll(),this.layerViews?.destroy(),this.layerViews=null,this.handles?.removeAll(),this.handles?.destroy(),this.handles=null}scoreboardItemsUpdatedHandler(){this.scoreboardItemsUpdated.emit(this.items)}generateUIDs(){this.itemIndex=0,this.items.forEach(this.generateUID())}async storeLayers(){this.state=o.Calculating,await(this.view?.map).loadAll();let t=this.items.map(i=>i?.layer?.id),e=i=>i.type!=="feature"||!i.isTable,a=i=>i.type==="feature"||i.type==="scene",s=i=>t.includes(i.id),l=i=>e(i)&&a(i)&&s(i);this.layers=this.view?.map?.allLayers?.filter(i=>l(i)),this.watchLayerVisibility()}async storeLayerViews(){if(this.layers&&this.layers.length>0){this.layers.forEach(s=>s.outFields=["*"]);let t=[];this.layers.forEach(s=>{let l=s,i=this.view?.whenLayerView(l);t.push(i)});let e=(await Promise.allSettled(t)).filter(s=>s.status==="fulfilled"&&s.value).map(s=>s.value),a=[];e.forEach(s=>a.push(m.whenOnce(()=>!s.updating))),await Promise.all(a),this.layerViews=new $([...e])}}calculateScoreboardItemValuesFromGeometry(){this.calculateScoreboardItemValues()}async calculateScoreboardItemValues(){if(this.layers&&this.layers.length===0||this.layerViews&&this.layerViews.length===0)return;this.state=o.Calculating;let t=[...this.items],e=[];this.queryStatDefinitions(t,e);let a=await Promise.all(e);this.handleQueryFeaturesResponses(a,t),this.items.length=0,t.forEach(s=>this.items.push(s)),this.state=o.Complete,this.scoreboardItemsUpdatedHandler(),this.initStationaryWatcher()}async initModules(){try{this.handles=new B,this.layers=new $([]),this.layerViews=new $([])}catch(t){throw console.error(t),this.state=o.Disabled,new Error("Failed to initialize modules")}}async loadMapResources(){if(this.view){let{map:t}=this.view,e=t;try{await e.loadAll()}catch(a){throw console.error(a),this.state=o.Disabled,new Error("Failed to load map resources")}}}generateUID(){return t=>{let e=Math.random(),a=Math.floor(Math.random()*10)+11,s=e.toString(a).replace("0.","");t.uid=s}}previousItem(){this.itemIndex=this.itemIndex-1}nextItem(){this.itemIndex=this.itemIndex+1}queryStatDefinitions(t,e){let a=i=>{let{field:r,operation:d}=i,c=r,b=`${r}_${d}`;return{onStatisticField:c,outStatisticFieldName:b,statisticType:d}},s=(i,r)=>{let d=this.queryType==="layer"?i.layer.createQuery():i.createQuery(),c=[r],b=this.geometry??this.view?.extent;d.outStatistics=c,d.geometry=b;let u=i?.filter?.timeExtent??i?.featureEffect?.filter?.timeExtent??null;return u&&(d.timeExtent=u),d},l=()=>async i=>{let r=this.layerViews?.find(u=>u.layer.id===i?.layer?.id);if(!r)return;let d=a(i),c=s(r,d),b=this.queryType==="layer"?r.layer.queryFeatures(c):r.queryFeatures(c);e.push(b)};t.forEach(l())}handleQueryFeaturesResponses(t,e){let a=i=>{let r=i.features[0],{attributes:d}=r;return Object.values(d)[0]},s=()=>({notation:"compact",compactDisplay:"short"}),l=()=>(i,r)=>{let d=a(i),c=s(),b=d!==null,u=b?P.formatNumber(d,c):null,_=b?`${u}`:"";e[r].displayValue=_,e[r].value=d};t.forEach(l())}initStationaryWatcher(){let t={once:!0,initial:!0},e=()=>m.when(()=>!this.view?.interacting,()=>{this.queryType==="layerView"&&this.calculateScoreboardItemValues()},t),a=()=>m.when(()=>this.view?.stationary,()=>e()),s="stationary-watcher-key";this.handles?.has(s)&&this.handles.remove(s),this.handles?.add(a(),s)}initViewUpdateWatcher(){return m.watch(()=>this.view?.updating,()=>{m.when(()=>!this.view?.updating,()=>{this.queryType==="layerView"&&this.calculateScoreboardItemValues()},{once:!0,initial:!0})},{initial:!0})}watchLayerVisibility(){if(!this.layers)return;let t="visbilityWatcherKey";this.handles?.remove(t);let e=[],a=s=>{let l=async()=>{let r=await this.view?.whenLayerView(s);await m.whenOnce(()=>!r?.updating),this.calculateScoreboardItemValues()},i=m.watch(()=>s?.visible,async()=>await l());e.push(i)};this.layers.forEach(a),this.handles?.add([...e],t)}getItemLimit(){return this.itemLimit<2||this.itemLimit>6?O:this.itemLimit}setHostClassNames(){this.isMobile||this.position===o.Bottom?(this.el.classList.remove(n.position.side,n.position.left,n.position.right),this.el.classList.add(n.position.bottom)):(this.el.classList.remove(n.position.bottom),this.el.classList.add(n.position.side),this.position===o.Left?(this.el.classList.remove(n.position.right),this.el.classList.add(n.position.left)):(this.el.classList.remove(n.position.left),this.el.classList.add(n.position.right))),this.isMobile?(this.el.classList.remove(n.mode.floating),this.el.classList.add(n.mode.pinned)):this.mode===o.Floating?(this.el.classList.remove(n.mode.pinned),this.el.classList.add(n.mode.floating)):this.el.classList.add(n.mode.pinned)}render(){let{state:t}=this,e=t===o.Loading,a=t===o.Calculating,s=t===o.Disabled,l=e||a||this.queryType==="layerView"&&this.view?.updating?this.renderProgress():null;return this.setHostClassNames(),s?null:[l,this.items?.length>0?this.renderBase():null]}renderBase(){return w("instant-apps-scoreboard-base",p`<div class=${y(v)}>${this.renderContent()}</div>`)}renderContent(){let{state:t}=this;return t===o.Loading?this.renderLoader():t===o.Calculating||t===o.Complete?this.renderItemsContainer():null}renderItemsContainer(){let[t,e]=this.renderPreviousNextButtons();return p`<div class=${y(n.itemsContainer)}>${t}${this.renderItems()}${e}</div>`}renderPreviousNextButtons(){let t=this.getItemLimit(),e=this.items.filter(q=>q.visible)?.length<=t,a=this.itemIndex===0,s=this.isEnd,l=this.isMobile?!0:this.position===o.Bottom,i=l?F.Start:F.Center,r=l?g.Left:g.Up,d=l?g.Right:g.Down,c={previous:r,next:d},b=a||e?g.Blank:c.previous,u=s||e?g.Blank:c.next,_={previous:a||e,next:s||e},L=A.Transparent,V=this.isMobile?U.Small:U.Large,f={previous:this._messages.previous,next:this._messages.next};return[p`<calcite-action @click=${this.previousItem} .icon=${b} .disabled=${_.previous} .alignment=${i} .scale=${V} .appearance=${L} .text=${f.previous??""} .label=${f.previous}></calcite-action>`,p`<calcite-action @click=${this.nextItem} .icon=${u} .disabled=${_.next} .alignment=${i} .scale=${V} .appearance=${L} .text=${f.next??""} .label=${f.next}></calcite-action>`]}renderItems(){let{items:t}=n,e=this.getItemsToDisplay.map(a=>this.renderItem(a));return p`<ul class=${y(t)}>${e}</ul>`}renderItem(t){let{label:e}=t;return p`<li class=${y(n.item)}><span class=${y(n.label)} title=${e??x}>${e}</span>${this.renderValue(t)}</li>`}renderValue(t){let{displayValue:e}=t,a=this.state===o.Calculating,s=this.state===o.Disabled,l=e===void 0&&a,i=e||this._messages.NA,r=!this.layers?.find(c=>t?.layer?.id===c.id)?.visible,d=l?this.renderValuePlaceholder():s?"":r?p`<calcite-icon icon=view-hide scale=l title=${this._messages.layerVisibilityOff??x}></calcite-icon>`:i;return p`<span class=${y(n.value)}>${d}</span>`}renderValuePlaceholder(){return p`<span class=${y(n.valuePlaceholder)}></span>`}renderProgress(){let t=`${T}calcite-`;return w(`${t}progress`,p`<calcite-progress type=indeterminate></calcite-progress>`)}renderLoader(){let t=`${T}calcite-`,e=this._messages.loading;return w(`${t}loader`,p`<calcite-loader .label=${e??""} .text=${e} scale=m></calcite-loader>`)}};S("instant-apps-scoreboard",I);return I},"core/reactiveUtils","intl","core/Collection","core/Handles")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{c as y}from"./C5KDPY7R.js";import"./YM4U4HSN.js";import b from"./QZ2ZMWIH.js";import a from"./CS5N3DOL.js";import{a as m}from"./YUWXPLTE.js";import{b as h}from"./
|
|
2
|
+
import{c as y}from"./C5KDPY7R.js";import"./YM4U4HSN.js";import b from"./QZ2ZMWIH.js";import a from"./CS5N3DOL.js";import{a as m}from"./YUWXPLTE.js";import{b as h}from"./57K3VUDO.js";import"./Y2AUIXNK.js";import{F as r,G as o,H as p,J as i,h as d,i as t}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([,{b:c}])=>{var f=d`:host{display:block}:host .esri-legend__layer-table,:host .instant-apps-interactive-legend__nested-unique-symbol{margin:0}:host .hide{display:none}`,e={layerTableSizeRamp:"esri-legend__layer-table--size-ramp",layerChildTable:"esri-legend__layer-child-table",layerTable:"esri-legend__layer-table",nestedUniqueSymbol:"instant-apps-interactive-legend__nested-unique-symbol",nonInteractive:"instant-apps-interactive-legend__non-interactive"},n=class extends p{constructor(){super(),this.legendLayerCaption=r(),this.expanded=!0,this.titleText="",this.listenOn(window,"legendLayerExpandUpdated",this.legendLayerExpandUpdatedEmitted)}static{this.properties={expanded:16,activeLayerInfo:0,isSizeRamp:5,isChild:5,isColorRamp:5,isRelationshipRamp:5,isInteractive:5,zoomTo:5,legendElement:0,titleText:1,legendvm:0,legendElementIndex:9}}static{this.styles=f}legendLayerExpandUpdatedEmitted(){this.legendLayerCaption.value&&(this.expanded=this.legendLayerCaption.value.expanded)}render(){let g=this.isChild?e.layerChildTable:e.layerTable,a=this.legendElement?.infos?.length===1&&!this.activeLayerInfo?.layer?.renderer?.field,v=(this.isSizeRamp||!this.isChild)&&!this.isColorRamp?` ${e.layerTableSizeRamp}`:"",$=this.isInteractive?"":` ${e.nonInteractive}`,x=y(this.activeLayerInfo)?` ${e.nestedUniqueSymbol}`:"",s=a&&!this.expanded&&!this.zoomTo?!0:this.expanded;if(this.isRelationshipRamp){let l=c.get("relationshipRampExpandStates")[this.activeLayerInfo.layer.id];s=l===void 0?!0:l}return t`<div class=${`${g}${v}${$}${x}`}><div .id=${`${this.activeLayerInfo?.layer?.id}-legend-element-caption`} class=${i(this.isRelationshipRamp||!this.titleText&&!this.zoomTo&&a?"hide":"show")}><instant-apps-interactive-legend-legend-element-caption .legendvm=${this.legendvm} .activeLayerInfo=${this.activeLayerInfo} .layer=${this.activeLayerInfo.layer} .titleText=${this.titleText} .legendElement=${this.legendElement} .legendElementIndex=${this.legendElementIndex} .zoomTo=${this.zoomTo} .isInteractive=${this.isInteractive} ${o(this.legendLayerCaption)}></instant-apps-interactive-legend-legend-element-caption></div>${m("content",t`<div .id=${`${this.activeLayerInfo?.layer?.id}-legend-element-content-${this.legendElementIndex}`} class=${i(s?"show":"hide")}><slot name=content></slot></div>`)}</div>`}};h("instant-apps-interactive-legend-legend-element",n);return n},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import c from"./DQ47P6ES.js";import a from"./CS5N3DOL.js";import{b as $}from"./
|
|
2
|
+
import c from"./DQ47P6ES.js";import a from"./CS5N3DOL.js";import{b as $}from"./57K3VUDO.js";import"./Y2AUIXNK.js";import{F as S,G as L,H as b,J as o,L as _,h as m,i as n,q as I,u as f}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([,{f:l,h:v}])=>{var y=m`@layer{:host{display:block;position:relative}:host .instant-apps-language-translator-search__input{width:235.5px}:host .instant-apps-language-translator-search__suggestion-list{position:absolute;margin:0;padding:0;width:100%;max-height:30vh;overflow:auto;border-left:none;background-color:var(--calcite-color-foreground-1);border:1px solid #c0c0c0;z-index:702}:host .instant-apps-language-translator-search__suggestion-list-item:first-child{border:none}:host .instant-apps-language-translator-search__suggestion-list-item{margin-top:0;padding:.8em 1em;border-top:solid 1px rgba(110,110,110,.3);display:flex;flex-direction:column;cursor:pointer;word-break:break-word}:host .instant-apps-language-translator-search__suggestion-list-item:hover{background-color:var(--calcite-color-foreground-2)}}`,h="instant-apps-language-translator-search",p={input:`${h}__input`,suggestionList:`${h}__suggestion-list`,suggestionListItem:`${h}__suggestion-list-item`},d=class extends b{constructor(){super(...arguments),this.searchInput=S(),this.results=[],this.suggestionSelected=I()}static{this.properties={results:16,t9nPlaceholder:1}}static{this.styles=y}static{this.shadowRootOptions=f}handleSearch(t){let e=t.target.value?.toLowerCase()?.trim(),s=l.get("uiData"),u=v(),a=l.get("portalItemResourceT9n"),r=l.get("currentLanguage"),g=a?.[r]??{},c=this.getSettingDataItems(u).filter(this.matchedResultsCallback(s,g,e,r));this.results=[...c.map(i=>({fieldName:i,...s.get(i)}))]}matchedResultsCallback(t,e,s,u){return a=>{let r=t.get(a),{label:g}=r.userLocaleData,{value:c}=r.userLocaleData,i=t.get("translatedLanguageLabels")?.[u]?.[a],w=e?.[a],x=this.testUserInput(g,s),k=this.testUserInput(c,s),D=this.testUserInput(i,s),R=this.testUserInput(w,s);return x||k||D||R}}getSettingDataItems(t){return t.filter(e=>e!=="locales"&&e!=="translatedLanguageLabels")}testUserInput(t,e){return!!t?.trim()&&!!e?.trim()&&t?.toLowerCase()?.search(e)!==-1}selectSuggestion(t){let e=t.target.getAttribute("data-field-name");this.suggestionSelected.emit(e),this.resetSearchInput()}resetSearchInput(){this.searchInput.value&&(this.searchInput.value.value=""),this.results=[]}render(){return n`${this.renderSearchInput()}${this.renderSuggestions()}`}renderSearchInput(){return n`<calcite-input class=${o(p.input)} @calciteInputInput=${this.handleSearch} type=search .placeholder=${this.t9nPlaceholder} icon=search ${L(this.searchInput)}></calcite-input>`}renderSuggestions(){return this.results.length>0?this.renderSuggestionList():null}renderSuggestionList(){return n`<ul class=${o(p.suggestionList)}>${this.results.map(t=>this.renderSuggestionListItem(t))}</ul>`}renderSuggestionListItem(t){return n`<li @click=${this.selectSuggestion} class=${o(p.suggestionListItem)} data-field-name=${t.fieldName??_}>${t.userLocaleData.label}</li>`}};$("instant-apps-language-translator-search",d);return d},a,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as y}from"./
|
|
2
|
+
import{a as y}from"./C7NYB4E3.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{b as _}from"./U4HGOXNJ.js";import{F as g,G as f,H as b,J as w,h as m,i as n,q as o,u as p}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([d])=>{var v=m`@layer{:host{display:block}.hide-editor-toolbar .esri-editor__panel-toolbar,.display-none{display:none!important}.esri-editor__panel-content{padding-block:10px!important}.notice-msg{padding:10px;width:calc(100% - 20px)}}`,h=class extends b{constructor(){super(...arguments),this.customizeSubmit=!1,this.enableSnapping=!1,this.showGuidingMsg=!0,this._editorLoading=!1,this._translations=y({name:"create-related-feature",blocking:!0}),this._addingAttachment=!1,this._editor=g(),this._isSubmitBtnClicked=!1,this.success=o(),this.fail=o(),this.isActionPending=o(),this.formReady=o(),this._onEditorPropertyChange=()=>{let t=this._editor.value;if(t){d.watch(()=>t.state,i=>{i==="adding-attachment"||i==="editing-attachment"?(this._addingAttachment=!0,this.isActionPending.emit(!0)):this._addingAttachment&&(this.isActionPending.emit(!1),this._addingAttachment=!1)});let e=t.activeWorkflow?.formViewModel;e.state?d.watch(()=>e.state,i=>{i==="ready"&&this.formReady.emit()}):e.status&&d.watch(()=>e.status,i=>{i==="loaded"&&this.formReady.emit()})}}}static{this.properties={customizeSubmit:5,enableSnapping:5,mapView:0,selectedFeature:0,showGuidingMsg:5,table:0,_editorLoading:16,_translations:16}}static{this.styles=v}static{this.shadowRootOptions=p}async submit(){this._editor.value?.activeWorkflow&&(this._isSubmitBtnClicked=!0,this._editor.value.activeWorkflow?.formViewModel?.submit())}render(){let t=this._editorLoading?"":"display-none";return n`${this.showGuidingMsg&&n`<calcite-notice class="notice-msg" icon=lightbulb kind=success open><div slot=message>${this._translations.provideDetailsMsg}</div></calcite-notice>`||""}<calcite-loader class=${w(t)} .label=${this._translations.loading} scale=s></calcite-loader>${this.mapView&&this._getEditor()||""}`}disconnectedCallback(){super.disconnectedCallback(),this._editor.value&&this._editor.value.destroy()}_getEditor(){return n`<arcgis-editor .view=${this.mapView} hide-edit-features-section .hideSettingsMenu=${!this.enableSnapping} hide-sketch .hideSnappingControlsElementsEnabledToggle=${!this.enableSnapping} @arcgisReady=${this._startCreate} @arcgisPropertyChange=${this._onEditorPropertyChange} ${f(this._editor)}></arcgis-editor>`}async _startCreate(){let t=this.selectedFeature?.layer,e=this.table;if(t.relationships&&e?.relationships&&this.selectedFeature&&e.templates){let i=t.relationships[0],s=e.relationships.find(r=>t.layerId===r.relatedTableId),a=Number(this.selectedFeature.getObjectId());if(!Number.isNaN(a)&&s){let r=(await t.queryFeatures({objectIds:[a],outFields:[t.objectIdField,i.keyField]})).features[0],l=e.templates[0],c={attributeOverrides:this.makeAttributesForRelatedFeature(r,i,s),layer:e,template:l};await this._editor.value?.startCreateFeaturesWorkflowAtFeatureCreation(c),await this.hideEditorsElements();let u=this._editor.value?.activeWorkflow?.formViewModel;u&&this._editor.value?.activeWorkflow?.formViewModel?.addHandles(u.on("submit",this.submitted.bind(this)))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector("arcgis-editor")?.shadowRoot?.querySelectorAll("calcite-flow-item")?.forEach(t=>{let e=t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");e?.querySelector("header")?.setAttribute("style","display: none"),e?.querySelector("footer")?.setAttribute("style","display: none")}))}makeAttributesForRelatedFeature(t,e,i){let s=e.keyField,a;t.attributes.hasOwnProperty(s)?a=t.getAttribute(s):t.attributes.hasOwnProperty(s.toLowerCase())?a=t.getAttribute(s.toLowerCase()):t.attributes.hasOwnProperty(s.toUpperCase())&&(a=t.getAttribute(s.toUpperCase()));let r=i.keyField,l=this.table?.fields.find(c=>c.name.toLocaleLowerCase()===r.toLocaleLowerCase());if(l)return r=l.name,{[r]:a}}async submitted(t){if(t?.invalid?.length||t?.results?.[0]?.invalidFields?.length||t?.results?.[0]?.invalidAttachmentElementIds?.length){this._isSubmitBtnClicked=!1;return}if(t?.valid?.length?t.valid.length&&this._isSubmitBtnClicked:this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{if(this._editor.value?.activeWorkflow){await this._editor.value.activeWorkflow.commit();let e=this._editor.value.activeWorkflow?.failures?.length?this._editor.value.activeWorkflow.failures:this._editor.value.activeWorkflow?.data?.viewModel?.failures;if(e?.length){e.some(i=>{if(i.error)throw i.error});return}}}catch(e){this.fail.emit(e);return}this.success.emit()}}async timeout(t){return await new Promise(e=>setTimeout(e,t))}};_("create-related-feature",h);return h},"core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import b from"./XSJOQTEM.js";import a from"./
|
|
2
|
+
import b from"./XSJOQTEM.js";import a from"./W75AYE63.js";export default $arcgis.t(([{n:d},{c:u}])=>{async function O(r,n,t,o,e=d,a="created",s="desc",i=!1,l=[],m=[],f,g,p){if(!r?.IsSignedIn)return;let c={q:e,filter:"type:Solution",sortField:a,sortOrder:s,delay:i,categories:l,num:100};return c.q+=y(r,g),await S(n,c,o,m,p,f)}function y(r,n){let t="",o=r.PortalUserOrg,e=r.PortalUserName;return o&&(t+=" orgid:"+o),n!=="My organization's solutions"&&e&&(t+=" owner:"+e),t}async function S(r,n,t,o,e="",a){let s=await t.requestDeployedSolutionCards(n,r,e,a),i=u(s.cards,o);return{cards:s.cards,relatedSolutions:i}}return O},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"./
|
|
2
|
+
import e from"./SSCZIVLF.js";import d from"./XSJOQTEM.js";import c from"./QTVE3UQ6.js";import b from"./W75AYE63.js";import a from"./XOPNEAS5.js";import"./2B4SGB3I.js";import"./RLSY4VUQ.js";import"./AO7XKW2U.js";import"./C7NYB4E3.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import"./TEHBW75B.js";import"./RSPNBIIE.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./YKB6256M.js";import"./36LRAUE4.js";import"./JMY4B4WQ.js";import"./VQ5ZAQUF.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./6ERMTA3J.js";import"./GF4QELNV.js";import"./3TAQSXLA.js";import"./PY6RTQDR.js";import"./DKD2EGQP.js";import"./5O53T3SW.js";import"./AJZDBHB6.js";import"./FES7B3SJ.js";import"./U4HGOXNJ.js";import"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([,,,,a])=>{return a},a,b,c,d,e)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{c as s}from"./
|
|
2
|
+
import{c as s}from"./U4HGOXNJ.js";function p(t){let a=n(t),r=s("assets/item-icons/");return a==="group"?`${r}/${a}16.png`:`${r}/${a}16.svg`}function n(t){let a=t.toLowerCase().trim();return a.includes("feature layer")?a.includes("hosted")?"featureshosted":"features":a.includes("table")?"table":a.includes("web map")?"maps":a.includes("instant app")?"instantapps":a.includes("dashboard")?"dashboard":a.includes("experience")?"experiencebuilder":a.includes("survey")||a.includes("form")?"form":a.includes("notebook")?"notebook":a.includes("story map")||a==="storymap"?"storymap":a.includes("hub page")?"hubpage":a.includes("hub initiative")?"hubinitiative":a.includes("hub event")?"hubevent":a.includes("hub project")?"hubproject":a.includes("hub site")||a.includes("site")?"hubsite":a.includes("quickcapture")?"quickcaptureproject":a.includes("data pipeline")?"datapipeline":a.includes("desktop application template")?"datafilesgray":a==="group"?"group":a==="csv"?"csv":a.includes("web app")||a.includes("web mapping application")?"apps":"maps"}function u(t,a){let r=o(t,a),e=s("assets/item-icons/");return r==="group"?`${e}/${r}16.png`:`${e}/${r}16.svg`}function o(t,a){let r=t.toLowerCase(),e=a||[],c=e.includes("Hosted Service");switch(r.trim()){case"360 vr experience":return"360vr";case"3dtiles package":return"3dtileslayerpackage";case"3dtiles service":return e.includes("3DObject")?"3dobjecttileslayer":e.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dobjecttileslayer";case"feature service":case"feature collection":case"kml":case"wfs":if(e.includes("IndoorPositioningDataService"))return"indoorpositioningdataservice";let i=e.includes("Spatiotemporal");return e.includes("Table")?i?"spatiotemporaltable":"table":e.includes("Route Layer")?"routelayer":e.includes("Markup")?"markup":i?"spatiotemporal":e.includes("UtilityNetwork")?"utilitynetwork":c?"featureshosted":"features";case"group":return"group";case"group layer":return e.includes("Map")?"layergroup2d":e.includes("Scene")?"layergroup3d":"layergroup";case"wmts":return"maptiles";case"map service":case"wms":return c||e.includes("Tiled")?"maptiles":"mapimages";case"scene service":return e.includes("Line")?"sceneweblayerline":e.includes("3DObject")?"sceneweblayermultipatch":e.includes("Point")?"sceneweblayerpoint":e.includes("IntegratedMesh")?"sceneweblayermesh":e.includes("PointCloud")?"sceneweblayerpointcloud":e.includes("Polygon")?"sceneweblayerpolygon":e.includes("Building")?"sceneweblayerbuilding":e.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer";case"image service":return e.includes("Elevation 3D Layer")?"elevationlayer":e.includes("Tiled Imagery")?"tiledimagerylayer":"imagery";case"stream service":return"streamlayer";case"video service":return e.includes("Live Stream")?"livestreamvideolayer":"mediaservice";case"vector tile service":return"vectortile";case"datastore catalog service":return"datastorecollection";case"geocoding service":return"geocodeservice";case"geoprocessing service":return e.includes("Web Tool")?"tool":"layers";case"geodata service":return"geodataservice";case"web map":case"cityengine web scene":return"maps";case"web scene":return e.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal";case"application":case"web mapping application":case"mobile application":case"operation view":case"desktop application":return e.includes("configurableApp")?"instantapps":"apps";case"map document":case"map package":case"published map":case"scene document":case"globe document":case"basemap package":case"mobile basemap package":case"mobile map package":case"project package":case"project template":case"pro map":case"layout":return"mapsgray";case"layer":return e.includes("ArcGIS Pro")?"mapsgray":"layersgray";case"explorer map":return e.indexOf("Explorer Document")?"mapsgray":e.includes("Explorer Mapping Application")?"datafilesgray":"mapsgray";case"pro presentation":return"propresentation";case"api key":return"key";case"csv":return"csv";case"shapefile":return"shapefile";case"csv collection":return"csvcollection";case"media layer":return"medialayer";case"microsoft excel":return"excel";case"microsoft powerpoint":return"powerpoint";case"microsoft word":return"word";case"pdf":return"pdf";case"sqlite geodatabase":return"sqlite";case"administrative report":return"report";case"image":return"image";case"cad drawing":return"cad";case"service definition":case"geojson":case"netcdf":return"data";case"explorer add in":case"desktop add in":case"windows viewer add in":case"windows viewer configuration":return"appsgray";case"arcgis pro add in":case"arcgis pro configuration":return"addindesktop";case"rule package":case"file geodatabase":case"kml collection":case"windows mobile package":case"map template":case"desktop application template":case"gml":case"arcpad package":case"code sample":case"document link":case"earth configuration":case"operations dashboard add in":case"rules package":case"workflow manager package":return"datafilesgray";case"form":return e.includes("Survey123")?"survey":"datafilesgray";case"network analysis service":case"geometry service":case"geoprocessing package":case"locator package":case"geoprocessing sample":case"workflow manager service":return"toolsgray";case"layer package":case"explorer layer":return"layersgray";case"scene package":return"scenepackage";case"mobile scene package":return"mobilescenepackage";case"tile package":case"compact tile package":return"tilepackage";case"task file":return"taskfile";case"report template":return"reporttemplate";case"statistical data collection":return"statisticaldatacollection";case"analysis model":return"geoprocessingmodel";case"insights workbook":return"workbook";case"insights model":return"insightsmodel";case"insights page":return"insightspage";case"insights theme":return"insightstheme";case"hub initiative":return"hubinitiative";case"hub page":return"hubpage";case"hub event":return"hubevent";case"hub site application":return"hubsite";case"hub project":return"hubproject";case"relational database connection":return"relationaldatabaseconnection";case"image collection":return"imagecollection";case"style":return e.includes("Dictionary")?"dictionarystyle":"style";case"desktop style":return"desktopstyle";case"dashboard":return"dashboard";case"raster function template":return"rasterprocessingtemplate";case"vector tile package":return"vectortilepackage";case"ortho mapping project":return"orthomappingproject";case"ortho mapping template":return"orthomappingtemplate";case"solution":return"solutions";case"geopackage":return"geopackage";case"deep learning package":return"deeplearningpackage";case"real time analytic":return"realtimeanalytics";case"big data analytic":return"bigdataanalytics";case"feed":return"feed";case"excalibur imagery project":return"excaliburimageryproject";case"notebook":return"notebook";case"reality mapping project":return"realitymappingproject";case"storymap":return e.includes("storymaptemplate")?"storymapstemplate":e.includes("storymapcollection")?"storymapcollection":e.includes("storymapbriefing")?"storymapbriefing":"storymap";case"survey123 add in":return"survey123addin";case"mission":return"mission";case"mission report":return"missionreport";case"quickcapture project":return"quickcaptureproject";case"pro report":return"proreport";case"urban model":return"urbanmodel";case"urban project":return"urbanproject";case"web experience":return"experiencebuilder";case"web experience template":return"webexperiencetemplate";case"experience builder widget":return"experiencebuilderwidget";case"experience builder widget package":return"experiencebuilderwidgetpackage";case"workflow":return"workflow";case"insights script":return"insightsscript";case"kernel gateway connection":return"kernelgatewayconnection";case"hub initiative template":return"hubinitiativetemplate";case"storymap theme":return"storymaptheme";case"knowledge graph":return"knowledgegraph";case"knowledge studio project":return"knowledgestudio";case"knowledge graph layer":return"knowledgegraphlayer";case"native application":return"nativeapp";case"native application installer":return"nativeappinstaller";case"web link chart":return"linkchart";case"knowledge graph web investigation":return"investigation";case"ogcfeatureserver":return"features";case"pro project":return"proproject";case"insights workbook package":return"insightsworkbookpackage";case"apache parquet":return"apacheparquet";case"notebook code snippets":case"notebook code snippet library":return"notebookcodesnippets";case"suitability model":return"suitabilitymodel";case"esri classifier definition":return"classifierdefinition";case"esri classification schema":return"classificationschema";case"insights data engineering workbook":return"dataengineeringworkbook";case"insights data engineering model":return"dataengineeringmodel";case"deep learning studio project":return"deeplearningproject";case"data store":return"datastore";case"data pipeline":return"datapipeline";default:return e.includes("Document")?"datafilesgray":r.includes("service")?"layers":"maps"}}export{p as a,u as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{b as h}from"./
|
|
2
|
+
import{b as h}from"./57K3VUDO.js";import{F as o,G as a,H as m,J as n,h as d,i as c,u as l}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([v,p,g])=>{var f=d`@layer{.esri-measurement,.esri-coordinate-conversion{width:300px}.instant-apps-measurement-tool__hide{display:none}}`,u="instant-apps-measurement-tool",s={base:u,hide:`${u}__hide`},r=class extends m{constructor(){super(...arguments),this._measureElement=o(),this._coordinateElement=o()}static{this.properties={view:0,measureConfiguration:0,activeTool:1}}static{this.styles=f}static{this.shadowRootOptions=l}willUpdate(e){e.has("activeTool")&&this._setActiveTool(this.activeTool)}loaded(){this._init()}disconnectedCallback(){super.disconnectedCallback(),this._measureWidget?.destroy(),this._coordinateWidget?.destroy()}async _init(){await this._initMeasurementWidget(),await this._initCoordinateWidget()}async _initMeasurementWidget(){this.view&&this._measureElement&&!this._measureWidget&&(this._measureWidget=new v({view:this.view,container:this._measureElement.value,...this.measureConfiguration}),this.measureConfiguration.activeToolType&&this._setActiveTool(this.measureConfiguration.activeToolType))}_setActiveTool(e){let t=this.view.type;this._measureWidget?.clear(),this._coordinateElement.value?.classList.add(s.hide),e==="distance"&&this._measureWidget?this._measureWidget.activeTool=t==="2d"?"distance":"direct-line":e==="area"&&this._measureWidget?this._measureWidget.activeTool="area":e==="point"&&this._coordinateElement.value?.classList?.remove(s.hide);let i=this.el.getRootNode().querySelector(`calcite-action[data-value="${e}"]`);i&&i.setFocus()}async _initCoordinateWidget(){let{activeToolType:e,coordinateFormat:t}=this.measureConfiguration;if(this?.view&&this._coordinateElement&&!this._coordinateWidget&&(this._coordinateWidget=new p({view:this.view,storageEnabled:!1,container:this._coordinateElement.value}),t!=null)){let i=this._coordinateWidget.formats.find(_=>_.name===t);this._coordinateWidget?.conversions?.splice(0,0,new g({format:i}))}e!=null&&this._setActiveTool(e)}render(){return c`<div class=${n(s.base)}><div ${a(this._measureElement)}></div><div class=${n(s.hide)} ${a(this._coordinateElement)}></div></div>`}};h("instant-apps-measurement-tool",r);return r},"widgets/Measurement","widgets/CoordinateConversion","widgets/CoordinateConversion/support/Conversion")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from"./FGRROW6V.js";import"./BM666UZR.js";import"./RLSY4VUQ.js";import b from"./2C4DK6YC.js";import a from"./WV7QX3ED.js";import"./C7NYB4E3.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import"./U4HGOXNJ.js";import"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as y}from"./TCUNTTNI.js";import{a as _}from"./IADXB53D.js";import b from"./QZ2ZMWIH.js";import a from"./CS5N3DOL.js";import{a as l}from"./YUWXPLTE.js";import{a as w}from"./
|
|
2
|
+
import{a as y}from"./TCUNTTNI.js";import{a as _}from"./IADXB53D.js";import b from"./QZ2ZMWIH.js";import a from"./CS5N3DOL.js";import{a as l}from"./YUWXPLTE.js";import{a as w}from"./UVVHDNLG.js";import{b as v}from"./57K3VUDO.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{F as p,G as g,H as f,J as c,h,i as o,u as m}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([n,L,b,I,,{b:u}])=>{var C=h`@layer{instant-apps-interactive-legend{display:block;height:100%}instant-apps-interactive-legend .esri-legend{height:100%;background-color:var(--calcite-color-foreground-1)!important;color:var(--calcite-color-text-1)!important}instant-apps-interactive-legend .esri-legend.esri-component.esri-widget.esri-widget--panel{margin:0}instant-apps-interactive-legend .esri-legend__layer,instant-apps-interactive-legend .esri-legend__layer-body{margin-left:0!important}instant-apps-interactive-legend .esri-legend__layer-row{box-sizing:border-box!important}}`,$={esri:{base:"esri-legend",widget:"esri-widget",widgetPanel:"esri-widget--panel",component:"esri-component"}},d=class extends f{constructor(){super(...arguments),this._messages=w({name:"instant-apps-interactive-legend"}),this.ref=p(),this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:y.FILTER},this.compact=!1}static{this.properties={handles:16,legendvm:16,view:0,zoomTo:5,featureCount:5,filterMode:0,compact:5}}static{this.styles=C}static{this.shadowRootOptions=m}async load(){this.compactHandler(),new MutationObserver(()=>{this.requestUpdate()}).observe(this.el,{attributes:!0}),await this.initializeModules()}willUpdate(e){(e.has("handles")||e.has("view"))&&this.init(),e.has("compact")&&(this.hasUpdated||this.compact)&&this.compactHandler()}async initializeModules(){this.handles=new L;let e=new b({});return await n.whenOnce(()=>e?.messages),this._messages={...this._messages,...e.messages},await Promise.resolve()}async init(){if(!(!this.view||!this.handles))try{let{on:e,whenOnce:i}=n,s=this.view?.map?.allLayers?.map(async r=>await r.load());await Promise.allSettled(s),await i(()=>this.view?.ready);let t={view:this.view,respectLayerDefinitionExpression:!0},a=new I(t);this.legendvm=a,this.handles.add([e(()=>this.legendvm?.activeLayerInfos,"change",()=>this._refreshActiveLayerInfos(this?.legendvm?.activeLayerInfos))])}catch(e){console.error('Failed at "init": ',e)}}compactHandler(){u.set("compact",this.compact)}_refreshActiveLayerInfos(e){e&&(this.handles.removeAll(),e.forEach(i=>this._renderOnActiveLayerInfoChange(i)))}render(){let{base:e,component:i,widget:s,widgetPanel:t}=$.esri,a=[e,i,s,t].filter(Boolean).map(r=>r).join(" ");return l("interactive-legend",o`<div class=${c(a)}>${this.legendvm?l("interactive-legend-classic",o`<instant-apps-interactive-legend-classic class=${c(_(this.el))} .legendvm=${this.legendvm} .zoomTo=${this.zoomTo} .filterMode=${this.filterMode} .featureCount=${this.featureCount} .messages=${this._messages} ${g(this.ref)}></instant-apps-interactive-legend-classic>`):null}</div>`)}_renderOnActiveLayerInfoChange(e){let{on:i}=n,s=i(()=>e.children,"change",()=>e.children.forEach(t=>this._renderOnActiveLayerInfoChange(t)));this.handles.add(s,`children_${e?.layer?.uid}`),e.children.forEach(t=>{this._renderOnActiveLayerInfoChange(t),t?.children?.length>0&&t?.children?.forEach(a=>this._renderOnActiveLayerInfoChange(a))})}};v("instant-apps-interactive-legend",d);return d},"core/reactiveUtils","core/Handles","widgets/Legend","widgets/Legend/LegendViewModel",a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as T}from"./LABCYKSC.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{b}from"./5BJO5ABV.js";import{F as h,G as r,H as u,J as n,h as w,i as a,l as g,q as y}from"./T3EPRHTT.js";import"./EXBEKVP5.js";var F=w`:host{display:block}.display-none{display:none}.display-flex{display:flex}.margin-top-1-2{margin-top:.5rem}.margin-left-1-2{margin-left:.5rem}.margin-right-1-2{margin-right:.5rem}.square-32{width:32px;height:32px}.square-40{width:40px;height:40px}.square-48{width:48px;height:48px}.height-fit-content{height:fit-content!important}.height-0{height:0!important}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px #0000004d}.margin-bottom-1-2{margin-bottom:.5rem}.danger-icon-color{--calcite-icon-color: var(--calcite-color-status-danger)}.map-actions{--calcite-action-background-color: var(--calcite-color-foreground-1);--calcite-action-background-color-hover: var(--calcite-color-foreground-3);--calcite-color-transparent-press: var(--calcite-color-foreground-2)}`,m=class extends u{constructor(){super(),this.enabledLayerIds=[],this.enableLegend=!1,this.enableLayerList=!1,this.enableFloorFilter=!1,this.enableFullscreen=!1,this.enableSearch=!1,this.enableBasemap=!1,this.enableHome=!1,this.enableSingleExpand=!1,this.zoomToolsSize="m",this.layout="vertical",this.mapWidgetsSize="m",this.enableMapPicker=!1,this.enableMapLayerPicker=!1,this.position="top-leading",this.stackTools=!0,this.enableSelectionTool=!1,this.toolOrder=["home","legend","search","fullscreen","floorfilter","layers-list","selectiontool","map-picker","map-layer-picker"],this.selectionTools=["rectangle-select","lasso-select","clear-selection"],this.mapInfos=[],this.defaultLayerId="",this.isMobile=!1,this.selectedFeaturesIds=[],this.selectedWebMapId="",this.showOnlyUpdatableLayers=!1,this.visibilityIcon="eyeball",this.configLayerOrderDefined=!1,this._hasFloorInfo=!1,this._translations=T({name:"map-tools",blocking:!0}),this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showLegendWidget=!1,this._showSearchWidget=!1,this._showLayersListWidget=!1,this._rectangleSelectionToolActive=!1,this._lassoSelectionToolActive=!1,this._showEllipsisTools=!0,this._ellipsisTools=[],this._isValidWebMap=!0,this._showSelectionTools=!1,this._basemapElement=h(),this._floorFilterElement=h(),this._fullscreenElement=h(),this._layerListWidgetElement=h(),this._legendElement=h(),this._searchElement=h(),this._widgets=[],this._selectionToolElement=h(),this._mapTools=[],this._mapTool=h(),this.clearSelection=y(),this.listenOn(window,"mapChanged",this.mapChanged),this.listenOn(window,"layerSelectionChange",this._layerSelectionChange)}static{this.properties={basemapConfig:0,enabledLayerIds:0,enableLegend:5,enableLayerList:5,enableFloorFilter:5,enableFullscreen:5,enableSearch:5,enableBasemap:5,enableHome:5,enableSingleExpand:5,zoomToolsSize:1,layout:1,mapView:0,mapWidgetsSize:1,enableMapPicker:5,enableMapLayerPicker:5,position:1,searchConfiguration:0,stackTools:5,enableSelectionTool:5,toolOrder:0,selectionTools:0,selectedLayer:0,mapInfos:0,defaultLayerId:1,isMobile:5,parentComponentHeight:9,parentComponentWidth:9,selectedFeaturesIds:0,selectedWebMapId:1,showOnlyUpdatableLayers:5,mapInfo:0,visibilityIcon:1,configLayerOrderDefined:5,_hasFloorInfo:16,_translations:16,_showTools:16,_showBasemapWidget:16,_showFloorFilter:16,_showLegendWidget:16,_showSearchWidget:16,_showLayersListWidget:16,_rectangleSelectionToolActive:16,_lassoSelectionToolActive:16,_showEllipsisTools:16,_ellipsisTools:16,_isValidWebMap:16,_showSelectionTools:16}}static{this.styles=F}willUpdate(e){e.has("mapView")&&this.mapViewWatchHandler(),e.has("parentComponentWidth")&&this.parentComponentWidth&&this.parentComponentWidthWatchHandler(this.parentComponentWidth),e.has("_showBasemapWidget")&&(this.hasUpdated||this._showBasemapWidget!==!1)&&this._showBasemapWidgetWatchHandler(this._showBasemapWidget),e.has("_showLayersListWidget")&&(this.hasUpdated||this._showLayersListWidget!==!1)&&this._showLayersListWidgetWatchHandler(this._showLayersListWidget),e.has("_showFloorFilter")&&(this.hasUpdated||this._showFloorFilter!==!1)&&this._showFloorFilterWatchHandler(this._showFloorFilter),e.has("_showLegendWidget")&&(this.hasUpdated||this._showLegendWidget!==!1)&&this._showLegendWidgetWatchHandler(this._showLegendWidget),e.has("_showSearchWidget")&&(this.hasUpdated||this._showSearchWidget!==!1)&&this._showSearchWidgetWatchHandler(this._showSearchWidget)}async mapViewWatchHandler(){await this.mapView?.when(()=>{this.parentComponentWidth&&this._updateTools(this.parentComponentWidth)})}async parentComponentWidthWatchHandler(e){this._updateTools(e)}async _showBasemapWidgetWatchHandler(e){let t=this._basemapElement.value?this._basemapElement.value.basemapGalleryRef.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async _showLayersListWidgetWatchHandler(e){let t=this._layerListWidgetElement.value?this._layerListWidgetElement.value.layerListRef.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async _showFloorFilterWatchHandler(e){let t=this._floorFilterElement.value?this._floorFilterElement.value.floorFilterRef.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async _showLegendWidgetWatchHandler(e){let t=this._legendElement.value?this._legendElement.value.legendRef.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async _showSearchWidgetWatchHandler(e){let t=this._searchElement.value?this._searchElement.value.searchComponent.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async mapChanged(e){let t=e.detail.isValid;this._isValidWebMap=t,this._showTools||this._toggleTools()}async _layerSelectionChange(e){this._showTools||this._toggleTools()}async load(){this._mapTools=[...this.toolOrder]}render(){this._setZoomToolsSize();let e=this.layout==="horizontal"?"display-flex":"",t=this._getToggleIcon(),s=!this._showTools&&!this._showSelectionTools?"display-none":e,i=this._showEllipsisTools?"":"display-none",o=this._showSearchWidget?"":"display-none",l=this._showBasemapWidget?"":"display-none",d=this._showLegendWidget?"":"display-none",c=this._showFloorFilter?"":"display-none",p=this._showLayersListWidget?"":"display-none",v=this._showTools?this._translations.collapse:this._translations.expand,f=!this.enableBasemap&&!this.enableFullscreen&&!this.enableLegend&&!this.enableLayerList&&!this.enableSearch&&!this.enableMapPicker&&!this.enableMapLayerPicker?"display-none":"",W=document.dir==="rtl"?"margin-right-1-2":"margin-left-1-2",L=this.enableSingleExpand?this.layout==="horizontal"?W:"margin-top-1-2":"",S=this._ellipsisTools.length>0&&this._showTools?"":"display-none",_=this.stackTools&&this._ellipsisTools.length===0?"box-shadow":"",$=this._showSelectionTools?this.selectionTools:this._mapTools;return a`<div class=${`${f} ${e} height-0`}>${this.enableSingleExpand?a`<div class=${n(_)}>${this._getActionGroup(t,!1,v||"",()=>this._toggleTools())}</div>`:void 0}<div class=${`${L} ${_} ${s}`}>${this._getMapWidgets($)}</div><div><div class=${n(S)}>${this._getActionGroup("ellipsis",!1,"",()=>this._toggleEllipsisTools())}<div class=${n(i)}>${this._getMapWidgets(this._ellipsisTools)}</div></div></div></div><map-basemap-gallery .basemapConfig=${this.basemapConfig} class=${n(l)} .mapView=${this.mapView} ${r(this._basemapElement)}></map-basemap-gallery><map-search class=${n(o)} .mapView=${this.mapView} result-graphic-enabled .searchConfiguration=${this.searchConfiguration} ${r(this._searchElement)}></map-search><map-legend class=${n(d)} .mapView=${this.mapView} ${r(this._legendElement)}></map-legend><layer-list-widget class=${n(p)} .mapView=${this.mapView} .visibilityIcon=${this.visibilityIcon} ${r(this._layerListWidgetElement)}></layer-list-widget><map-floor-filter class=${n(c)} .enabled=${this.enableFloorFilter&&this._hasFloorInfo} .mapView=${this.mapView} ${r(this._floorFilterElement)}></map-floor-filter><selection-tool .mapView=${this.mapView} @drawingComplete=${()=>{this._rectangleSelectionToolActive=!1,this._lassoSelectionToolActive=!1}} .selectedLayerId=${this.selectedLayer?.id} ${r(this._selectionToolElement)}></selection-tool>${this.enableMapPicker&&a`<map-picker class=mapPickerClass .height=${(this.parentComponentHeight??0)-25} id=map-picker .mapInfos=${this.mapInfos} reference-element=map .selectedWebMapId=${this.selectedWebMapId} show-map-list-in-popover></map-picker>`||""}${this.enableMapLayerPicker&&this.selectedLayer&&a`<map-layer-picker appearance=transparent .configLayerOrderDefined=${this.configLayerOrderDefined} .defaultLayerId=${this.defaultLayerId} .enabledLayerIds=${this.enabledLayerIds} .height=${(this.parentComponentHeight??0)-25} .isMobile=${this.isMobile} .mapView=${this.mapView} .showOnlyUpdatableLayers=${this.showOnlyUpdatableLayers} reference-element=layers scale=s .selectedIds=${this.selectedLayer?[this.selectedLayer.id]:[]} show-layers-list-in-popover show-tables type=dropdown></map-layer-picker>`||""}`}_setZoomToolsSize(){let e=document.getElementById("arcgis-map")?.shadowRoot;if(!e)return;let t=e.querySelector(".esri-zoom"),s=e.querySelectorAll(".esri-widget--button")[0],i=e.querySelectorAll(".esri-widget--button")[1];if(s&&i){let o=this.zoomToolsSize==="s"?"32px":this.zoomToolsSize==="m"?"40px":"48px";s.style.width=o,s.style.height=o,i.style.width=o,i.style.height=o}if(this.layout==="horizontal"){let o=document.dir||"ltr",l=o==="ltr"?".esri-ui-top-left":".esri-ui-top-right",d=o==="ltr"?0:this.parentComponentWidth-62,c=o==="ltr"?this._showTools?"ltr":"rtl":this._showTools?"rtl":"ltr";e.querySelector(l)?.firstElementChild?.tagName==="MAP-TOOLS"&&!this._showTools&&(c=o),t&&t.setAttribute("style",`position: absolute; top: 50px; left: ${d}px`),this._showSelectionTools||e.querySelector(l)?.setAttribute("style",`flex-direction: row; gap: 5px; align-items: flex-start; direction: ${c} !important; z-index: 1;`)}}_getToggleIcon(){let e=document.dir||"ltr";return this.layout==="horizontal"?e==="ltr"?this._showTools?"chevrons-left":"chevrons-right":this._showTools?"chevrons-right":"chevrons-left":this._showTools?"chevrons-up":"chevrons-down"}_updateTools(e){let t=this._showSelectionTools?JSON.parse(JSON.stringify(this.selectionTools)):JSON.parse(JSON.stringify(this.toolOrder));this._hasFloorInfo=this.mapView?.map?.floorInfo;let s=t.indexOf("floorfilter");s>-1&&!this._hasFloorInfo&&t.splice(s,1);let i=this.mapWidgetsSize==="s"?32:this.mapWidgetsSize==="m"?40:48,o=110;this.isMobile&&(this.enableMapPicker||this.enableMapLayerPicker)&&(o=160);let l=Math.ceil((e-o)/i)-1;l&&l!==t.length-1?(this._mapTools=t.slice(0,l),this._ellipsisTools=t.slice(l,t.length)):(this._mapTools=t,this._ellipsisTools=[])}_getMapWidgets(e){let t=this._isValidWebMap?"map":"exclamation-mark-triangle",s=this.selectedLayer===void 0?"exclamation-mark-triangle":"layers";return e.map(i=>{switch(i){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,()=>this._showLegend()):this.enableLegend?this._getWidget(i,this._legendElement.value?.legendRef.value,!0):void 0;case"search":return this.enableSearch&&this.enableSingleExpand?this._getActionGroup("magnifying-glass",!1,this._translations.search,()=>this._search()):this.enableSearch?this._getWidget(i,this._searchElement.value?.searchComponent.value,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getFullScreenComponent():this.enableFullscreen?this._getWidget(i,this._fullscreenElement.value?.fullscreenRef.value,!1):void 0;case"basemap":return this.enableBasemap&&this.enableSingleExpand?this._getActionGroup("basemap",!1,this._translations.basemap,()=>this._toggleBasemapPicker()):this.enableBasemap?this._getWidget(i,this._basemapElement.value?.basemapGalleryRef.value,!0):void 0;case"layers-list":return this.enableLayerList&&this.enableSingleExpand?this._getActionGroup("layers",!1,this._translations.layers||"",()=>this._toggleLayerListWidget()):this.enableLayerList?this._getWidget(i,this._layerListWidgetElement.value?.layerListRef.value,!0):void 0;case"floorfilter":return this.enableFloorFilter&&this._hasFloorInfo&&this.enableSingleExpand?this._getActionGroup("urban-model",!1,this._translations.floorFilter,()=>this._toggleFloorFilter()):this.enableFloorFilter&&this._hasFloorInfo?this._getWidget(i,this._floorFilterElement.value?.floorFilterRef.value,!0):void 0;case"selectiontool":return this.enableSelectionTool&&this.selectedLayer?this._getActionGroup("cursor-selection",!1,this._translations.selectionTools,this._onSelectionToolClick,!1):void 0;case"rectangle-select":return this.enableSelectionTool&&this.selectedLayer?this._getActionGroup("cursor-marquee",!1,this._translations.selectByRectangle,()=>this._toggleSelectionTool("rectangle"),!1,this._rectangleSelectionToolActive):void 0;case"lasso-select":return this.enableSelectionTool&&this.selectedLayer?this._getActionGroup("lasso-select",!1,this._translations.selectByLasso,()=>this._toggleSelectionTool("freehandPolygon"),!1,this._lassoSelectionToolActive):void 0;case"clear-selection":return this.selectedLayer&&this.selectedFeaturesIds.length>0?this._getActionGroup("erase",!1,this._translations.clearSelection,()=>this.clearSelection.emit()):void 0;case"home":return this.enableHome&&this.mapView?this._getHomeComponent():void 0;case"map-picker":return this.enableMapPicker?this._getActionGroup(t,!1,"",()=>{},!this._isValidWebMap):void 0;case"map-layer-picker":return this.enableMapLayerPicker&&this._isValidWebMap?this._getActionGroup(s,!1,"",()=>{},this.selectedLayer===void 0):void 0;default:return""}})}_getFullScreenComponent(){return a`<map-fullscreen .mapView=${this.mapView}></map-fullscreen>`}_getHomeComponent(){let e=(this.mapView?.map).initialViewProperties?.viewpoint?.clone();return a`<arcgis-home .view=${this.mapView} .viewpoint=${e}></arcgis-home>`}_getActionGroup(e,t,s,i,o,l){let d=this.mapWidgetsSize==="s"?"square-32":this.mapWidgetsSize==="m"?"square-40":"square-48",c=this.stackTools?"":"margin-bottom-1-2",p=this.stackTools?"":"box-shadow";return a`<div class="height-fit-content"><calcite-action alignment=center .indicator=${l} class=${`map-actions ${d} ${c} border-bottom ${p} ${o?"danger-icon-color":""}`} .disabled=${t} .icon=${e} id=${e??g} @click=${i} scale=m .text=${s} ${r(this._mapTool)}><calcite-icon aria-hidden=true icon=chevron-up scale=s slot=icon></calcite-icon></calcite-action>${!this.isMobile&&s&&a`<calcite-tooltip .placement=${this.layout==="vertical"?"auto":"bottom"} reference-element=${e??g}><span>${s}</span></calcite-tooltip>`||""}</div>`}_getWidget(e,t,s){if(this._widgets.indexOf(e)<0&&this.mapView&&t){let i=this.toolOrder.indexOf(e),o=document.createElement("arcgis-expand");o.view=this.mapView,o.appendChild(t);let l=this.enableHome?2:1;this.mapView.ui.add(s?o:t,{position:this.position,index:i>-1?i+l:1}),this._widgets.push(e)}}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1,this._toggleEllipsisTools()}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1,this._toggleEllipsisTools()}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1,this._toggleEllipsisTools()}_toggleLayerListWidget(){this._showLayersListWidget=!this._showLayersListWidget,this._showTools=!1,this._toggleEllipsisTools()}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1,this._toggleEllipsisTools()}_onSelectionToolClick(){this._showSelectionTools=!this._showSelectionTools,this._showTools=!1,this._toggleEllipsisTools()}_toggleSelectionTool(e){e==="rectangle"?(this._lassoSelectionToolActive=!1,this._rectangleSelectionToolActive=!this._rectangleSelectionToolActive):e==="freehandPolygon"&&(this._rectangleSelectionToolActive=!1,this._lassoSelectionToolActive=!this._lassoSelectionToolActive),this._selectionToolElement.value?.toggleSelectionTool(e,this._rectangleSelectionToolActive||this._lassoSelectionToolActive)}_toggleTools(){this._showTools||(this._showSelectionTools=!1,this._showBasemapWidget=!1,this._showLayersListWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._rectangleSelectionToolActive?this._toggleSelectionTool("rectangle"):this._lassoSelectionToolActive&&this._toggleSelectionTool("freehandPolygon"),this._showTools=!this._showTools,this._toggleEllipsisTools(),this._updateTools(this.parentComponentWidth)}_toggleEllipsisTools(){this._showEllipsisTools=!this._showEllipsisTools}};b("map-tools",m);export{m as MapTools};
|
|
2
|
+
import{a as T}from"./C7NYB4E3.js";import"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{b}from"./U4HGOXNJ.js";import{F as h,G as r,H as u,J as n,h as w,i as a,l as g,q as y}from"./T3EPRHTT.js";import"./EXBEKVP5.js";var F=w`:host{display:block}.display-none{display:none}.display-flex{display:flex}.margin-top-1-2{margin-top:.5rem}.margin-left-1-2{margin-left:.5rem}.margin-right-1-2{margin-right:.5rem}.square-32{width:32px;height:32px}.square-40{width:40px;height:40px}.square-48{width:48px;height:48px}.height-fit-content{height:fit-content!important}.height-0{height:0!important}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px #0000004d}.margin-bottom-1-2{margin-bottom:.5rem}.danger-icon-color{--calcite-icon-color: var(--calcite-color-status-danger)}.map-actions{--calcite-action-background-color: var(--calcite-color-foreground-1);--calcite-action-background-color-hover: var(--calcite-color-foreground-3);--calcite-color-transparent-press: var(--calcite-color-foreground-2)}`,m=class extends u{constructor(){super(),this.enabledLayerIds=[],this.enableLegend=!1,this.enableLayerList=!1,this.enableFloorFilter=!1,this.enableFullscreen=!1,this.enableSearch=!1,this.enableBasemap=!1,this.enableHome=!1,this.enableSingleExpand=!1,this.zoomToolsSize="m",this.layout="vertical",this.mapWidgetsSize="m",this.enableMapPicker=!1,this.enableMapLayerPicker=!1,this.position="top-leading",this.stackTools=!0,this.enableSelectionTool=!1,this.toolOrder=["home","legend","search","fullscreen","floorfilter","layers-list","selectiontool","map-picker","map-layer-picker"],this.selectionTools=["rectangle-select","lasso-select","clear-selection"],this.mapInfos=[],this.defaultLayerId="",this.isMobile=!1,this.selectedFeaturesIds=[],this.selectedWebMapId="",this.showOnlyUpdatableLayers=!1,this.visibilityIcon="eyeball",this.configLayerOrderDefined=!1,this._hasFloorInfo=!1,this._translations=T({name:"map-tools",blocking:!0}),this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showLegendWidget=!1,this._showSearchWidget=!1,this._showLayersListWidget=!1,this._rectangleSelectionToolActive=!1,this._lassoSelectionToolActive=!1,this._showEllipsisTools=!0,this._ellipsisTools=[],this._isValidWebMap=!0,this._showSelectionTools=!1,this._basemapElement=h(),this._floorFilterElement=h(),this._fullscreenElement=h(),this._layerListWidgetElement=h(),this._legendElement=h(),this._searchElement=h(),this._widgets=[],this._selectionToolElement=h(),this._mapTools=[],this._mapTool=h(),this.clearSelection=y(),this.listenOn(window,"mapChanged",this.mapChanged),this.listenOn(window,"layerSelectionChange",this._layerSelectionChange)}static{this.properties={basemapConfig:0,enabledLayerIds:0,enableLegend:5,enableLayerList:5,enableFloorFilter:5,enableFullscreen:5,enableSearch:5,enableBasemap:5,enableHome:5,enableSingleExpand:5,zoomToolsSize:1,layout:1,mapView:0,mapWidgetsSize:1,enableMapPicker:5,enableMapLayerPicker:5,position:1,searchConfiguration:0,stackTools:5,enableSelectionTool:5,toolOrder:0,selectionTools:0,selectedLayer:0,mapInfos:0,defaultLayerId:1,isMobile:5,parentComponentHeight:9,parentComponentWidth:9,selectedFeaturesIds:0,selectedWebMapId:1,showOnlyUpdatableLayers:5,mapInfo:0,visibilityIcon:1,configLayerOrderDefined:5,_hasFloorInfo:16,_translations:16,_showTools:16,_showBasemapWidget:16,_showFloorFilter:16,_showLegendWidget:16,_showSearchWidget:16,_showLayersListWidget:16,_rectangleSelectionToolActive:16,_lassoSelectionToolActive:16,_showEllipsisTools:16,_ellipsisTools:16,_isValidWebMap:16,_showSelectionTools:16}}static{this.styles=F}willUpdate(e){e.has("mapView")&&this.mapViewWatchHandler(),e.has("parentComponentWidth")&&this.parentComponentWidth&&this.parentComponentWidthWatchHandler(this.parentComponentWidth),e.has("_showBasemapWidget")&&(this.hasUpdated||this._showBasemapWidget!==!1)&&this._showBasemapWidgetWatchHandler(this._showBasemapWidget),e.has("_showLayersListWidget")&&(this.hasUpdated||this._showLayersListWidget!==!1)&&this._showLayersListWidgetWatchHandler(this._showLayersListWidget),e.has("_showFloorFilter")&&(this.hasUpdated||this._showFloorFilter!==!1)&&this._showFloorFilterWatchHandler(this._showFloorFilter),e.has("_showLegendWidget")&&(this.hasUpdated||this._showLegendWidget!==!1)&&this._showLegendWidgetWatchHandler(this._showLegendWidget),e.has("_showSearchWidget")&&(this.hasUpdated||this._showSearchWidget!==!1)&&this._showSearchWidgetWatchHandler(this._showSearchWidget)}async mapViewWatchHandler(){await this.mapView?.when(()=>{this.parentComponentWidth&&this._updateTools(this.parentComponentWidth)})}async parentComponentWidthWatchHandler(e){this._updateTools(e)}async _showBasemapWidgetWatchHandler(e){let t=this._basemapElement.value?this._basemapElement.value.basemapGalleryRef.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async _showLayersListWidgetWatchHandler(e){let t=this._layerListWidgetElement.value?this._layerListWidgetElement.value.layerListRef.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async _showFloorFilterWatchHandler(e){let t=this._floorFilterElement.value?this._floorFilterElement.value.floorFilterRef.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async _showLegendWidgetWatchHandler(e){let t=this._legendElement.value?this._legendElement.value.legendRef.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async _showSearchWidgetWatchHandler(e){let t=this._searchElement.value?this._searchElement.value.searchComponent.value:void 0,s=document.dir==="rtl"?"rtl":"ltr";t&&(e?(this.mapView?.ui.add(t,{position:this.position,index:1}),t.style.setProperty("direction",s),t.style.setProperty("max-height","240px")):this.mapView?.ui.remove(t))}async mapChanged(e){let t=e.detail.isValid;this._isValidWebMap=t,this._showTools||this._toggleTools()}async _layerSelectionChange(e){this._showTools||this._toggleTools()}async load(){this._mapTools=[...this.toolOrder]}render(){this._setZoomToolsSize();let e=this.layout==="horizontal"?"display-flex":"",t=this._getToggleIcon(),s=!this._showTools&&!this._showSelectionTools?"display-none":e,i=this._showEllipsisTools?"":"display-none",o=this._showSearchWidget?"":"display-none",l=this._showBasemapWidget?"":"display-none",d=this._showLegendWidget?"":"display-none",c=this._showFloorFilter?"":"display-none",p=this._showLayersListWidget?"":"display-none",v=this._showTools?this._translations.collapse:this._translations.expand,f=!this.enableBasemap&&!this.enableFullscreen&&!this.enableLegend&&!this.enableLayerList&&!this.enableSearch&&!this.enableMapPicker&&!this.enableMapLayerPicker?"display-none":"",W=document.dir==="rtl"?"margin-right-1-2":"margin-left-1-2",L=this.enableSingleExpand?this.layout==="horizontal"?W:"margin-top-1-2":"",S=this._ellipsisTools.length>0&&this._showTools?"":"display-none",_=this.stackTools&&this._ellipsisTools.length===0?"box-shadow":"",$=this._showSelectionTools?this.selectionTools:this._mapTools;return a`<div class=${`${f} ${e} height-0`}>${this.enableSingleExpand?a`<div class=${n(_)}>${this._getActionGroup(t,!1,v||"",()=>this._toggleTools())}</div>`:void 0}<div class=${`${L} ${_} ${s}`}>${this._getMapWidgets($)}</div><div><div class=${n(S)}>${this._getActionGroup("ellipsis",!1,"",()=>this._toggleEllipsisTools())}<div class=${n(i)}>${this._getMapWidgets(this._ellipsisTools)}</div></div></div></div><map-basemap-gallery .basemapConfig=${this.basemapConfig} class=${n(l)} .mapView=${this.mapView} ${r(this._basemapElement)}></map-basemap-gallery><map-search class=${n(o)} .mapView=${this.mapView} result-graphic-enabled .searchConfiguration=${this.searchConfiguration} ${r(this._searchElement)}></map-search><map-legend class=${n(d)} .mapView=${this.mapView} ${r(this._legendElement)}></map-legend><layer-list-widget class=${n(p)} .mapView=${this.mapView} .visibilityIcon=${this.visibilityIcon} ${r(this._layerListWidgetElement)}></layer-list-widget><map-floor-filter class=${n(c)} .enabled=${this.enableFloorFilter&&this._hasFloorInfo} .mapView=${this.mapView} ${r(this._floorFilterElement)}></map-floor-filter><selection-tool .mapView=${this.mapView} @drawingComplete=${()=>{this._rectangleSelectionToolActive=!1,this._lassoSelectionToolActive=!1}} .selectedLayerId=${this.selectedLayer?.id} ${r(this._selectionToolElement)}></selection-tool>${this.enableMapPicker&&a`<map-picker class=mapPickerClass .height=${(this.parentComponentHeight??0)-25} id=map-picker .mapInfos=${this.mapInfos} reference-element=map .selectedWebMapId=${this.selectedWebMapId} show-map-list-in-popover></map-picker>`||""}${this.enableMapLayerPicker&&this.selectedLayer&&a`<map-layer-picker appearance=transparent .configLayerOrderDefined=${this.configLayerOrderDefined} .defaultLayerId=${this.defaultLayerId} .enabledLayerIds=${this.enabledLayerIds} .height=${(this.parentComponentHeight??0)-25} .isMobile=${this.isMobile} .mapView=${this.mapView} .showOnlyUpdatableLayers=${this.showOnlyUpdatableLayers} reference-element=layers scale=s .selectedIds=${this.selectedLayer?[this.selectedLayer.id]:[]} show-layers-list-in-popover show-tables type=dropdown></map-layer-picker>`||""}`}_setZoomToolsSize(){let e=document.getElementById("arcgis-map")?.shadowRoot;if(!e)return;let t=e.querySelector(".esri-zoom"),s=e.querySelectorAll(".esri-widget--button")[0],i=e.querySelectorAll(".esri-widget--button")[1];if(s&&i){let o=this.zoomToolsSize==="s"?"32px":this.zoomToolsSize==="m"?"40px":"48px";s.style.width=o,s.style.height=o,i.style.width=o,i.style.height=o}if(this.layout==="horizontal"){let o=document.dir||"ltr",l=o==="ltr"?".esri-ui-top-left":".esri-ui-top-right",d=o==="ltr"?0:this.parentComponentWidth-62,c=o==="ltr"?this._showTools?"ltr":"rtl":this._showTools?"rtl":"ltr";e.querySelector(l)?.firstElementChild?.tagName==="MAP-TOOLS"&&!this._showTools&&(c=o),t&&t.setAttribute("style",`position: absolute; top: 50px; left: ${d}px`),this._showSelectionTools||e.querySelector(l)?.setAttribute("style",`flex-direction: row; gap: 5px; align-items: flex-start; direction: ${c} !important; z-index: 1;`)}}_getToggleIcon(){let e=document.dir||"ltr";return this.layout==="horizontal"?e==="ltr"?this._showTools?"chevrons-left":"chevrons-right":this._showTools?"chevrons-right":"chevrons-left":this._showTools?"chevrons-up":"chevrons-down"}_updateTools(e){let t=this._showSelectionTools?JSON.parse(JSON.stringify(this.selectionTools)):JSON.parse(JSON.stringify(this.toolOrder));this._hasFloorInfo=this.mapView?.map?.floorInfo;let s=t.indexOf("floorfilter");s>-1&&!this._hasFloorInfo&&t.splice(s,1);let i=this.mapWidgetsSize==="s"?32:this.mapWidgetsSize==="m"?40:48,o=110;this.isMobile&&(this.enableMapPicker||this.enableMapLayerPicker)&&(o=160);let l=Math.ceil((e-o)/i)-1;l&&l!==t.length-1?(this._mapTools=t.slice(0,l),this._ellipsisTools=t.slice(l,t.length)):(this._mapTools=t,this._ellipsisTools=[])}_getMapWidgets(e){let t=this._isValidWebMap?"map":"exclamation-mark-triangle",s=this.selectedLayer===void 0?"exclamation-mark-triangle":"layers";return e.map(i=>{switch(i){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,()=>this._showLegend()):this.enableLegend?this._getWidget(i,this._legendElement.value?.legendRef.value,!0):void 0;case"search":return this.enableSearch&&this.enableSingleExpand?this._getActionGroup("magnifying-glass",!1,this._translations.search,()=>this._search()):this.enableSearch?this._getWidget(i,this._searchElement.value?.searchComponent.value,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getFullScreenComponent():this.enableFullscreen?this._getWidget(i,this._fullscreenElement.value?.fullscreenRef.value,!1):void 0;case"basemap":return this.enableBasemap&&this.enableSingleExpand?this._getActionGroup("basemap",!1,this._translations.basemap,()=>this._toggleBasemapPicker()):this.enableBasemap?this._getWidget(i,this._basemapElement.value?.basemapGalleryRef.value,!0):void 0;case"layers-list":return this.enableLayerList&&this.enableSingleExpand?this._getActionGroup("layers",!1,this._translations.layers||"",()=>this._toggleLayerListWidget()):this.enableLayerList?this._getWidget(i,this._layerListWidgetElement.value?.layerListRef.value,!0):void 0;case"floorfilter":return this.enableFloorFilter&&this._hasFloorInfo&&this.enableSingleExpand?this._getActionGroup("urban-model",!1,this._translations.floorFilter,()=>this._toggleFloorFilter()):this.enableFloorFilter&&this._hasFloorInfo?this._getWidget(i,this._floorFilterElement.value?.floorFilterRef.value,!0):void 0;case"selectiontool":return this.enableSelectionTool&&this.selectedLayer?this._getActionGroup("cursor-selection",!1,this._translations.selectionTools,this._onSelectionToolClick,!1):void 0;case"rectangle-select":return this.enableSelectionTool&&this.selectedLayer?this._getActionGroup("cursor-marquee",!1,this._translations.selectByRectangle,()=>this._toggleSelectionTool("rectangle"),!1,this._rectangleSelectionToolActive):void 0;case"lasso-select":return this.enableSelectionTool&&this.selectedLayer?this._getActionGroup("lasso-select",!1,this._translations.selectByLasso,()=>this._toggleSelectionTool("freehandPolygon"),!1,this._lassoSelectionToolActive):void 0;case"clear-selection":return this.selectedLayer&&this.selectedFeaturesIds.length>0?this._getActionGroup("erase",!1,this._translations.clearSelection,()=>this.clearSelection.emit()):void 0;case"home":return this.enableHome&&this.mapView?this._getHomeComponent():void 0;case"map-picker":return this.enableMapPicker?this._getActionGroup(t,!1,"",()=>{},!this._isValidWebMap):void 0;case"map-layer-picker":return this.enableMapLayerPicker&&this._isValidWebMap?this._getActionGroup(s,!1,"",()=>{},this.selectedLayer===void 0):void 0;default:return""}})}_getFullScreenComponent(){return a`<map-fullscreen .mapView=${this.mapView}></map-fullscreen>`}_getHomeComponent(){let e=(this.mapView?.map).initialViewProperties?.viewpoint?.clone();return a`<arcgis-home .view=${this.mapView} .viewpoint=${e}></arcgis-home>`}_getActionGroup(e,t,s,i,o,l){let d=this.mapWidgetsSize==="s"?"square-32":this.mapWidgetsSize==="m"?"square-40":"square-48",c=this.stackTools?"":"margin-bottom-1-2",p=this.stackTools?"":"box-shadow";return a`<div class="height-fit-content"><calcite-action alignment=center .indicator=${l} class=${`map-actions ${d} ${c} border-bottom ${p} ${o?"danger-icon-color":""}`} .disabled=${t} .icon=${e} id=${e??g} @click=${i} scale=m .text=${s} ${r(this._mapTool)}><calcite-icon aria-hidden=true icon=chevron-up scale=s slot=icon></calcite-icon></calcite-action>${!this.isMobile&&s&&a`<calcite-tooltip .placement=${this.layout==="vertical"?"auto":"bottom"} reference-element=${e??g}><span>${s}</span></calcite-tooltip>`||""}</div>`}_getWidget(e,t,s){if(this._widgets.indexOf(e)<0&&this.mapView&&t){let i=this.toolOrder.indexOf(e),o=document.createElement("arcgis-expand");o.view=this.mapView,o.appendChild(t);let l=this.enableHome?2:1;this.mapView.ui.add(s?o:t,{position:this.position,index:i>-1?i+l:1}),this._widgets.push(e)}}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1,this._toggleEllipsisTools()}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1,this._toggleEllipsisTools()}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1,this._toggleEllipsisTools()}_toggleLayerListWidget(){this._showLayersListWidget=!this._showLayersListWidget,this._showTools=!1,this._toggleEllipsisTools()}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1,this._toggleEllipsisTools()}_onSelectionToolClick(){this._showSelectionTools=!this._showSelectionTools,this._showTools=!1,this._toggleEllipsisTools()}_toggleSelectionTool(e){e==="rectangle"?(this._lassoSelectionToolActive=!1,this._rectangleSelectionToolActive=!this._rectangleSelectionToolActive):e==="freehandPolygon"&&(this._rectangleSelectionToolActive=!1,this._lassoSelectionToolActive=!this._lassoSelectionToolActive),this._selectionToolElement.value?.toggleSelectionTool(e,this._rectangleSelectionToolActive||this._lassoSelectionToolActive)}_toggleTools(){this._showTools||(this._showSelectionTools=!1,this._showBasemapWidget=!1,this._showLayersListWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._rectangleSelectionToolActive?this._toggleSelectionTool("rectangle"):this._lassoSelectionToolActive&&this._toggleSelectionTool("freehandPolygon"),this._showTools=!this._showTools,this._toggleEllipsisTools(),this._updateTools(this.parentComponentWidth)}_toggleEllipsisTools(){this._showEllipsisTools=!this._showEllipsisTools}};b("map-tools",m);export{m as MapTools};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as S}from"./PPFEO3UH.js";import{a as _}from"./HKURBCD6.js";import{b as L}from"./KGXEY5HR.js";import{d as w}from"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{F as l,G as o,H as v,h as y,i as c,q as p}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([b,B,V,k,{execute:A},{formatNumber:D,prefersRTL:x,getLocale:I,convertNumberFormatToIntlOptions:O},E,R,u,U,z,C])=>{var F=y`:host{--default-width: 375px;--width: var(--default-width);--padding: 10px;--border-style: 1px solid var(--calcite-color-border-1);--calcite-icon-color: var(--calcite-color-text-3);display:block;background:var(--background-color, var(--calcite-color-foreground-1));color:var(--calcite-color-text-1);font-size:var(--calcite-font-size--1);box-sizing:border-box}::slotted(arcgis-sketch),::slotted(arcgis-search){display:flex;justify-content:center;align-items:center}::slotted(arcgis-sketch){--calcite-action-bar-shadow: none;--calcite-action-bar-corner-radius: none;--calcite-action-group-border-color: var(--calcite-color-border-1)}::slotted(arcgis-search){width:100%;padding:var(--padding)}[hidden]{display:none}[role=dialog]{width:var(--width);>*{padding-inline:var(--padding)}}header calcite-input-message{margin-block-end:var(--calcite-spacing-lg)}h2{color:inherit;font-size:inherit;font-weight:var(--calcite-font-weight-medium);line-height:1;margin-block:var(--padding);padding-block-end:var(--calcite-spacing-md);border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-1)}.border-bottom{height:1px;border-bottom:var(--border-style)}calcite-label:first-of-type span{padding-block-start:var(--padding)}.buffer-labels-label{margin-block:var(--padding);>span{display:flex;justify-content:space-between;width:100%}}.main-buttons-wrapper{display:flex;flex-direction:column;gap:var(--padding);padding-block:var(--padding)}`,T=O({places:1,digitSeparator:!0});function P({bufferDistance:s,bufferGraphic:e,bufferUnit:t,unitsAbbrLookup:i,view:a}){try{let n=W(s,t,i),r=j(n,a.type==="3d"),h=q(e.geometry);return new k({symbol:r,geometry:h})}catch(n){console.error(String(n))}}function W(s,e,t){let i=t[e],a=D(s,T);return x(I())?`${i} ${a}`:`${a} ${i}`}function j(s,e){return e?new R({verticalOffset:{screenLength:40,maxWorldLength:60,minWorldLength:20},symbolLayers:[new E({font:{size:12,family:"sans-serif"},text:s,halo:{color:[0,0,0],size:1},material:{color:"white"},size:12})]}):new V({color:"white",haloColor:"black",haloSize:"1px",text:s,xoffset:0,yoffset:30,font:{size:12,family:"sans-serif"}})}function q(s){try{return A(s)}catch(e){console.error(String(e))}}var d={style:"solid",color:[100,100,100,.5],outline:{color:[255,255,255,255],width:1.5}};function M(s,e){return new z({geometry:s,symbol:e})}async function $({graphic:s,distance:e,unit:t,isGeodesic:i}){i&&!u.isLoaded()&&await u.load();let a=i?u:U;try{let n={unit:t},r=a.execute(s.geometry,e,n);if(!r)throw new Error("buffer failed");return r}catch(n){console.error(String(n))}}async function N({graphic:s,unit:e,isGeodesic:t,distanceValues:i}){let a=0,n=s,r=[];for(;a<i.length;){let h=i[a],f=await $({graphic:s,distance:h,unit:e,isGeodesic:t});if(!f)continue;let m=C.execute(f,n.geometry);m&&r.push(m),n=M(f,s.symbol),a++}return r}function G(s){let e=s?.assignedElements?.({flatten:!0});if(e?.length)return e.at(0)}var J=["meters","kilometers","miles","yards","feet","us-feet"],g=class extends v{constructor(){super(),this._messages=_({name:"instant-apps-buffer",blocking:!0}),this.#t=l(),this.#e=l(),this.#s=l(),this.#a=l(),this.#r=l(),this.inputMethod="select-feature",this.bufferLabelsVisible=!1,this.inputGraphics=[],this.bufferUnit="miles",this.bufferInputStep=1,this.bufferDistance=1,this.bufferMinDistance=.1,this.bufferMaxDistance=1e6,this.geodesicBufferEnabled=!1,this.bufferColor=d.color,this.bufferStyle=d.style,this.bufferOutlineColor=d.outline.color,this.bufferOutlineWidth=d.outline.width,this.elevationInfoMode="on-the-ground",this.arcgisPropertyChange=w()("inputMethod","inputGraphics"),this.arcgisBufferCreate=p(),this.arcgisBufferClear=p(),this.bufferLayer=new b({title:"buffer-graphics",listMode:"hide"}),this.bufferLabelsLayer=new b({title:"buffer-graphics-labels",visible:this.bufferLabelsVisible,listMode:"hide"}),this.miscGraphicsLayer=new b({title:"misc-graphics",listMode:"hide"}),this.listen("calciteRadioButtonGroupChange",this._handleBufferInputChange),this.listen("arcgisCreate",this._handleArcgisSketchEventCreate),this.listen("arcgisDelete",this._handleArcgisSketchEventDelete),this.listen("arcgisSearchClear",this._handleArcgisSearchClear),this.listen("arcgisSelectResult",this._handleArcgisSearchSelect),this.listen("arcgisPropertyChange",this._onArcgisPropertyChange)}static{this.properties={inputMethod:131,bufferLayer:0,bufferLabelsLayer:0,miscGraphicsLayer:0,bufferLabelsVisible:135,inputGraphics:0,view:0,sources:0,bufferUnit:131,bufferInputStep:139,bufferDistance:139,distanceValuesSorted:32,bufferMinDistance:139,bufferMaxDistance:139,geodesicBufferEnabled:135,readyToBuffer:32,bufferColor:0,bufferStyle:1,bufferOutlineColor:0,bufferOutlineWidth:9,bufferGraphicSymbol:32,elevationInfoMode:1}}static{this.styles=F}#t;#e;#s;#a;#r;get#i(){let e=this.#a.value;return G(e)}get#n(){let e=this.#r.value;return G(e)}get distanceValuesSorted(){return this.#s.value?.distanceValuesSorted||[]}get readyToBuffer(){return!!this.view&&!!this.bufferLayer&&!!this.inputGraphics?.length&&!!this.distanceValuesSorted?.length}get bufferGraphicSymbol(){let e=typeof this.bufferOutlineWidth=="number"&&this.bufferOutlineWidth>0,t=typeof this.bufferOutlineColor<"u"&&e;return new B({color:this.bufferColor,style:this.bufferStyle,outline:t?{color:this.bufferOutlineColor,width:this.bufferOutlineWidth}:null})}async clearBufferLayer(){this._clearBufferLayer()}async setFocus(){this.#t.value&&await this.#t.value.setFocus()}async setSelectionInput(e){let t=e.clone();this.inputMethod="select-feature",await this.updateComplete,await this.#e.value?.componentOnReady(),this.miscGraphicsLayer?.add(t),this.#e.value?.selectionManager?.add(this.miscGraphicsLayer,[t]),await this.updateComplete,await new Promise(i=>window.requestAnimationFrame(i)),this.inputGraphics=[t]}async setAddedBufferDistance(){let e=this.#s.value;await e.componentOnReady(),e.clearDistanceValues(),await e.updateComplete,e.bufferDistance=this.bufferDistance,e.maybeAddDistanceValue()}async cancelActiveSelection(){let e=this.#e.value;e&&e.toolbarState==="active"&&(await e.componentOnReady(),e.selectionToolbarViewModel?.cancel(),e.enabledTool=null)}async cancelSketchAction(){let e=this.#i;e&&e.state==="active"&&(await e.componentOnReady(),await e.cancel())}willUpdate(e){this.view&&this.view.type==="3d"&&(e.has("view")||e.has("elevationInfoMode"))&&(this.bufferLayer.elevationInfo={mode:this.elevationInfoMode}),e.has("bufferLabelsVisible")&&this.bufferLabelsLayer&&(this.bufferLabelsLayer.visible=this.bufferLabelsVisible),e.has("view")&&this.view&&this.view!==e.get("view")&&this.view.when().then(()=>{this.view.map&&!this.view.map.layers.includes(this.miscGraphicsLayer)&&this.view.map.add(this.miscGraphicsLayer)}),e.has("sources")&&this.sources&&(this.sources?.includes(this.miscGraphicsLayer)||this.sources.add(this.miscGraphicsLayer))}_handleBufferInputChange(){let e=(this.#t.value.shadowRoot?.querySelector("calcite-radio-button-group")).selectedItem.value;this.inputMethod=e}_handleArcgisSketchEventCreate(e){e.detail.state==="complete"&&this._assignInputGraphicsFromArcgisSketch()}_handleArcgisSketchEventDelete(e){this._assignInputGraphicsFromArcgisSketch()}_assignInputGraphicsFromArcgisSketch(){this.#i&&(this.inputGraphics=[...this.#i?.layer?.graphics?.toArray()??[]])}async _handleArcgisSearchSelect(){let e=this.#n.resultGraphic;e&&(this.inputGraphics=[e.clone()])}_handleArcgisSearchClear(){this.inputGraphics=[]}async _handleSelectionChange(e){this._getSelectedGraphics(),this._maybeClearMiscGraphicsOnDeselect(e)}async _getSelectedGraphics(){let e=await this.#e.value.getSelectedFeatures(),t=[];for(let i of e)t=[...t,...i.data.features];this.inputGraphics=t}_maybeClearMiscGraphicsOnDeselect(e){if(!e.detail?.changes?.length)return;let{changes:t}=e.detail;t.some(({removed:i,layer:a})=>i?.length&&a===this.miscGraphicsLayer)&&this._clearMiscGraphicsLayer()}_clearMiscGraphicsLayer(){this.miscGraphicsLayer?.graphics?.removeAll()}_onLabelsSwitchChange(e){this.bufferLabelsVisible=e.target.checked}_clearBufferLayer(){this.bufferLayer?.removeAll()}_clearBufferLabelsLayer(){this.bufferLabelsLayer?.removeAll()}async _onCreateBufferClick(){this._handleBufferValidation(),await this._bufferInputGraphics()}_handleBufferValidation(){this._handleBufferInputValidation(),this._handleBufferDistanceValidation()}_handleBufferInputValidation(){let e=this.#t.value;e&&(this.inputGraphics.length?e.showErrorMessage=!1:e.showErrorMessage=!0)}_handleBufferDistanceValidation(){let e=this.#s.value;e&&(this.distanceValuesSorted.length?e.showMissingDistanceValueErrorMessage=!1:e.showMissingDistanceValueErrorMessage=!0)}_clearAllGraphics(){this.inputGraphics=[],this._clearBufferLayer(),this._clearBufferLabelsLayer(),this._clearMiscGraphicsLayer(),this.#e?.value?.clearSelection?.(),this.#n?.clear?.(),this.#i?.cancel?.(),this.#i?.delete?.(),this.#i?.layer?.removeAll?.(),this.arcgisBufferClear.emit()}_onArcgisPropertyChange(e){e.detail.name==="inputGraphics"&&this.inputGraphics.length&&this._handleBufferInputValidation()}_onBufferUnitChange(e){let t=e.target.value;this.bufferUnit=t}async _bufferInputGraphics(){if(!this.readyToBuffer)return;this.view.map?.layers.includes(this.bufferLayer)?this.bufferLayer.removeAll():this.view.map.add(this.bufferLayer),this.view.map?.layers.includes(this.bufferLabelsLayer)?this.bufferLabelsLayer.removeAll():this.view.map.add(this.bufferLabelsLayer);let e=[];for(let a of this.inputGraphics){let n={graphic:a,unit:this.bufferUnit,isGeodesic:this.geodesicBufferEnabled},r;this.distanceValuesSorted.length>1&&(r=N({...n,distanceValues:this.distanceValuesSorted})),this.distanceValuesSorted?.length===1&&(r=$({...n,distance:this.distanceValuesSorted[0]})),e.push(r)}let t=this.bufferGraphicSymbol,i=await Promise.all(e).catch(a=>console.error(String(a)));if(i&&i?.length){let a=i.flat().filter(r=>!!r).map(r=>M(r,t)),n=a.map((r,h)=>{let f=this.distanceValuesSorted[h%this.distanceValuesSorted.length];return P({bufferGraphic:r,bufferDistance:f,bufferUnit:this.bufferUnit,view:this.view,unitsAbbrLookup:this._messages.unitsAbbr})});this.bufferLayer.addMany(a),this.bufferLabelsLayer.addMany(n),this.arcgisBufferCreate.emit()}}_renderInputMethod(){return this.inputMethod==="select-feature"?c`<instant-apps-selection-toolbar .view=${this.view} .sources=${this.sources} @selectionChange=${this._handleSelectionChange} continuous-selection-enabled selection-operation-type=add ${o(this.#e)}></instant-apps-selection-toolbar>`:this.inputMethod==="draw-graphic"?c`<slot name=arcgis-sketch ${o(this.#a)}></slot>`:this.inputMethod==="search-location"?c`<slot name=arcgis-search ${o(this.#r)}></slot>`:null}render(){return c`<div role=dialog aria-labelledby=buffer-title><header><h2 id=buffer-title>${this._messages.title}</h2><calcite-input-message icon=information>${this._messages.labels.helpText}</calcite-input-message></header><instant-apps-buffer-input-radiogroup .labels=${this._messages.inputRadioButtonLabels} .selectedValue=${this.inputMethod} ${o(this.#t)}></instant-apps-buffer-input-radiogroup>${this._renderInputMethod()}<instant-apps-buffer-distance-manager .bufferDistance=${this.bufferDistance} .bufferInputStep=${this.bufferInputStep} .bufferMinDistance=${this.bufferMinDistance} .bufferMaxDistance=${this.bufferMaxDistance} .labels=${this._messages.labels} ${o(this.#s)}></instant-apps-buffer-distance-manager><calcite-label><span>${this._messages.labels.unit}</span><calcite-select .label=${this._messages.labels.unit} @calciteSelectChange=${this._onBufferUnitChange}>${S(J,e=>e,e=>c`<calcite-option .value=${e} .selected=${this.bufferUnit===e}>${this._messages.units[e]}</calcite-option>`)}</calcite-select></calcite-label><calcite-label class="buffer-labels-label" layout=inline><span><span>${this._messages.labels.showDistanceLabel}</span><calcite-switch .checked=${this.bufferLabelsVisible} @calciteSwitchChange=${this._onLabelsSwitchChange}></calcite-switch></span></calcite-label><div class="main-buttons-wrapper"><calcite-button @click=${this._onCreateBufferClick}>${this._messages.labels.draw}</calcite-button><calcite-button appearance=outline @click=${this._clearAllGraphics}>${this._messages.labels.clear}</calcite-button></div></div>`}};L("instant-apps-buffer",g);return g},"layers/GraphicsLayer","symbols/SimpleFillSymbol","symbols/TextSymbol","Graphic","geometry/operators/labelPointOperator","intl","symbols/TextSymbol3DLayer","symbols/PointSymbol3D","geometry/operators/geodesicBufferOperator","geometry/operators/bufferOperator","Graphic","geometry/operators/differenceOperator")
|
|
2
|
+
import{a as S}from"./PPFEO3UH.js";import{a as _}from"./UVVHDNLG.js";import{b as L}from"./57K3VUDO.js";import{d as w}from"./QMAV4UTN.js";import"./Y2AUIXNK.js";import{F as l,G as o,H as v,h as y,i as c,q as p}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([b,B,V,k,{execute:A},{formatNumber:D,prefersRTL:x,getLocale:I,convertNumberFormatToIntlOptions:O},E,R,u,U,z,C])=>{var F=y`:host{--default-width: 375px;--width: var(--default-width);--padding: 10px;--border-style: 1px solid var(--calcite-color-border-1);--calcite-icon-color: var(--calcite-color-text-3);display:block;background:var(--background-color, var(--calcite-color-foreground-1));color:var(--calcite-color-text-1);font-size:var(--calcite-font-size--1);box-sizing:border-box}::slotted(arcgis-sketch),::slotted(arcgis-search){display:flex;justify-content:center;align-items:center}::slotted(arcgis-sketch){--calcite-action-bar-shadow: none;--calcite-action-bar-corner-radius: none;--calcite-action-group-border-color: var(--calcite-color-border-1)}::slotted(arcgis-search){width:100%;padding:var(--padding)}[hidden]{display:none}[role=dialog]{width:var(--width);>*{padding-inline:var(--padding)}}header calcite-input-message{margin-block-end:var(--calcite-spacing-lg)}h2{color:inherit;font-size:inherit;font-weight:var(--calcite-font-weight-medium);line-height:1;margin-block:var(--padding);padding-block-end:var(--calcite-spacing-md);border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-1)}.border-bottom{height:1px;border-bottom:var(--border-style)}calcite-label:first-of-type span{padding-block-start:var(--padding)}.buffer-labels-label{margin-block:var(--padding);>span{display:flex;justify-content:space-between;width:100%}}.main-buttons-wrapper{display:flex;flex-direction:column;gap:var(--padding);padding-block:var(--padding)}`,T=O({places:1,digitSeparator:!0});function P({bufferDistance:s,bufferGraphic:e,bufferUnit:t,unitsAbbrLookup:i,view:a}){try{let n=W(s,t,i),r=j(n,a.type==="3d"),h=q(e.geometry);return new k({symbol:r,geometry:h})}catch(n){console.error(String(n))}}function W(s,e,t){let i=t[e],a=D(s,T);return x(I())?`${i} ${a}`:`${a} ${i}`}function j(s,e){return e?new R({verticalOffset:{screenLength:40,maxWorldLength:60,minWorldLength:20},symbolLayers:[new E({font:{size:12,family:"sans-serif"},text:s,halo:{color:[0,0,0],size:1},material:{color:"white"},size:12})]}):new V({color:"white",haloColor:"black",haloSize:"1px",text:s,xoffset:0,yoffset:30,font:{size:12,family:"sans-serif"}})}function q(s){try{return A(s)}catch(e){console.error(String(e))}}var d={style:"solid",color:[100,100,100,.5],outline:{color:[255,255,255,255],width:1.5}};function M(s,e){return new z({geometry:s,symbol:e})}async function $({graphic:s,distance:e,unit:t,isGeodesic:i}){i&&!u.isLoaded()&&await u.load();let a=i?u:U;try{let n={unit:t},r=a.execute(s.geometry,e,n);if(!r)throw new Error("buffer failed");return r}catch(n){console.error(String(n))}}async function N({graphic:s,unit:e,isGeodesic:t,distanceValues:i}){let a=0,n=s,r=[];for(;a<i.length;){let h=i[a],f=await $({graphic:s,distance:h,unit:e,isGeodesic:t});if(!f)continue;let m=C.execute(f,n.geometry);m&&r.push(m),n=M(f,s.symbol),a++}return r}function G(s){let e=s?.assignedElements?.({flatten:!0});if(e?.length)return e.at(0)}var J=["meters","kilometers","miles","yards","feet","us-feet"],g=class extends v{constructor(){super(),this._messages=_({name:"instant-apps-buffer",blocking:!0}),this.#t=l(),this.#e=l(),this.#s=l(),this.#a=l(),this.#r=l(),this.inputMethod="select-feature",this.bufferLabelsVisible=!1,this.inputGraphics=[],this.bufferUnit="miles",this.bufferInputStep=1,this.bufferDistance=1,this.bufferMinDistance=.1,this.bufferMaxDistance=1e6,this.geodesicBufferEnabled=!1,this.bufferColor=d.color,this.bufferStyle=d.style,this.bufferOutlineColor=d.outline.color,this.bufferOutlineWidth=d.outline.width,this.elevationInfoMode="on-the-ground",this.arcgisPropertyChange=w()("inputMethod","inputGraphics"),this.arcgisBufferCreate=p(),this.arcgisBufferClear=p(),this.bufferLayer=new b({title:"buffer-graphics",listMode:"hide"}),this.bufferLabelsLayer=new b({title:"buffer-graphics-labels",visible:this.bufferLabelsVisible,listMode:"hide"}),this.miscGraphicsLayer=new b({title:"misc-graphics",listMode:"hide"}),this.listen("calciteRadioButtonGroupChange",this._handleBufferInputChange),this.listen("arcgisCreate",this._handleArcgisSketchEventCreate),this.listen("arcgisDelete",this._handleArcgisSketchEventDelete),this.listen("arcgisSearchClear",this._handleArcgisSearchClear),this.listen("arcgisSelectResult",this._handleArcgisSearchSelect),this.listen("arcgisPropertyChange",this._onArcgisPropertyChange)}static{this.properties={inputMethod:131,bufferLayer:0,bufferLabelsLayer:0,miscGraphicsLayer:0,bufferLabelsVisible:135,inputGraphics:0,view:0,sources:0,bufferUnit:131,bufferInputStep:139,bufferDistance:139,distanceValuesSorted:32,bufferMinDistance:139,bufferMaxDistance:139,geodesicBufferEnabled:135,readyToBuffer:32,bufferColor:0,bufferStyle:1,bufferOutlineColor:0,bufferOutlineWidth:9,bufferGraphicSymbol:32,elevationInfoMode:1}}static{this.styles=F}#t;#e;#s;#a;#r;get#i(){let e=this.#a.value;return G(e)}get#n(){let e=this.#r.value;return G(e)}get distanceValuesSorted(){return this.#s.value?.distanceValuesSorted||[]}get readyToBuffer(){return!!this.view&&!!this.bufferLayer&&!!this.inputGraphics?.length&&!!this.distanceValuesSorted?.length}get bufferGraphicSymbol(){let e=typeof this.bufferOutlineWidth=="number"&&this.bufferOutlineWidth>0,t=typeof this.bufferOutlineColor<"u"&&e;return new B({color:this.bufferColor,style:this.bufferStyle,outline:t?{color:this.bufferOutlineColor,width:this.bufferOutlineWidth}:null})}async clearBufferLayer(){this._clearBufferLayer()}async setFocus(){this.#t.value&&await this.#t.value.setFocus()}async setSelectionInput(e){let t=e.clone();this.inputMethod="select-feature",await this.updateComplete,await this.#e.value?.componentOnReady(),this.miscGraphicsLayer?.add(t),this.#e.value?.selectionManager?.add(this.miscGraphicsLayer,[t]),await this.updateComplete,await new Promise(i=>window.requestAnimationFrame(i)),this.inputGraphics=[t]}async setAddedBufferDistance(){let e=this.#s.value;await e.componentOnReady(),e.clearDistanceValues(),await e.updateComplete,e.bufferDistance=this.bufferDistance,e.maybeAddDistanceValue()}async cancelActiveSelection(){let e=this.#e.value;e&&e.toolbarState==="active"&&(await e.componentOnReady(),e.selectionToolbarViewModel?.cancel(),e.enabledTool=null)}async cancelSketchAction(){let e=this.#i;e&&e.state==="active"&&(await e.componentOnReady(),await e.cancel())}willUpdate(e){this.view&&this.view.type==="3d"&&(e.has("view")||e.has("elevationInfoMode"))&&(this.bufferLayer.elevationInfo={mode:this.elevationInfoMode}),e.has("bufferLabelsVisible")&&this.bufferLabelsLayer&&(this.bufferLabelsLayer.visible=this.bufferLabelsVisible),e.has("view")&&this.view&&this.view!==e.get("view")&&this.view.when().then(()=>{this.view.map&&!this.view.map.layers.includes(this.miscGraphicsLayer)&&this.view.map.add(this.miscGraphicsLayer)}),e.has("sources")&&this.sources&&(this.sources?.includes(this.miscGraphicsLayer)||this.sources.add(this.miscGraphicsLayer))}_handleBufferInputChange(){let e=(this.#t.value.shadowRoot?.querySelector("calcite-radio-button-group")).selectedItem.value;this.inputMethod=e}_handleArcgisSketchEventCreate(e){e.detail.state==="complete"&&this._assignInputGraphicsFromArcgisSketch()}_handleArcgisSketchEventDelete(e){this._assignInputGraphicsFromArcgisSketch()}_assignInputGraphicsFromArcgisSketch(){this.#i&&(this.inputGraphics=[...this.#i?.layer?.graphics?.toArray()??[]])}async _handleArcgisSearchSelect(){let e=this.#n.resultGraphic;e&&(this.inputGraphics=[e.clone()])}_handleArcgisSearchClear(){this.inputGraphics=[]}async _handleSelectionChange(e){this._getSelectedGraphics(),this._maybeClearMiscGraphicsOnDeselect(e)}async _getSelectedGraphics(){let e=await this.#e.value.getSelectedFeatures(),t=[];for(let i of e)t=[...t,...i.data.features];this.inputGraphics=t}_maybeClearMiscGraphicsOnDeselect(e){if(!e.detail?.changes?.length)return;let{changes:t}=e.detail;t.some(({removed:i,layer:a})=>i?.length&&a===this.miscGraphicsLayer)&&this._clearMiscGraphicsLayer()}_clearMiscGraphicsLayer(){this.miscGraphicsLayer?.graphics?.removeAll()}_onLabelsSwitchChange(e){this.bufferLabelsVisible=e.target.checked}_clearBufferLayer(){this.bufferLayer?.removeAll()}_clearBufferLabelsLayer(){this.bufferLabelsLayer?.removeAll()}async _onCreateBufferClick(){this._handleBufferValidation(),await this._bufferInputGraphics()}_handleBufferValidation(){this._handleBufferInputValidation(),this._handleBufferDistanceValidation()}_handleBufferInputValidation(){let e=this.#t.value;e&&(this.inputGraphics.length?e.showErrorMessage=!1:e.showErrorMessage=!0)}_handleBufferDistanceValidation(){let e=this.#s.value;e&&(this.distanceValuesSorted.length?e.showMissingDistanceValueErrorMessage=!1:e.showMissingDistanceValueErrorMessage=!0)}_clearAllGraphics(){this.inputGraphics=[],this._clearBufferLayer(),this._clearBufferLabelsLayer(),this._clearMiscGraphicsLayer(),this.#e?.value?.clearSelection?.(),this.#n?.clear?.(),this.#i?.cancel?.(),this.#i?.delete?.(),this.#i?.layer?.removeAll?.(),this.arcgisBufferClear.emit()}_onArcgisPropertyChange(e){e.detail.name==="inputGraphics"&&this.inputGraphics.length&&this._handleBufferInputValidation()}_onBufferUnitChange(e){let t=e.target.value;this.bufferUnit=t}async _bufferInputGraphics(){if(!this.readyToBuffer)return;this.view.map?.layers.includes(this.bufferLayer)?this.bufferLayer.removeAll():this.view.map.add(this.bufferLayer),this.view.map?.layers.includes(this.bufferLabelsLayer)?this.bufferLabelsLayer.removeAll():this.view.map.add(this.bufferLabelsLayer);let e=[];for(let a of this.inputGraphics){let n={graphic:a,unit:this.bufferUnit,isGeodesic:this.geodesicBufferEnabled},r;this.distanceValuesSorted.length>1&&(r=N({...n,distanceValues:this.distanceValuesSorted})),this.distanceValuesSorted?.length===1&&(r=$({...n,distance:this.distanceValuesSorted[0]})),e.push(r)}let t=this.bufferGraphicSymbol,i=await Promise.all(e).catch(a=>console.error(String(a)));if(i&&i?.length){let a=i.flat().filter(r=>!!r).map(r=>M(r,t)),n=a.map((r,h)=>{let f=this.distanceValuesSorted[h%this.distanceValuesSorted.length];return P({bufferGraphic:r,bufferDistance:f,bufferUnit:this.bufferUnit,view:this.view,unitsAbbrLookup:this._messages.unitsAbbr})});this.bufferLayer.addMany(a),this.bufferLabelsLayer.addMany(n),this.arcgisBufferCreate.emit()}}_renderInputMethod(){return this.inputMethod==="select-feature"?c`<instant-apps-selection-toolbar .view=${this.view} .sources=${this.sources} @selectionChange=${this._handleSelectionChange} continuous-selection-enabled selection-operation-type=add ${o(this.#e)}></instant-apps-selection-toolbar>`:this.inputMethod==="draw-graphic"?c`<slot name=arcgis-sketch ${o(this.#a)}></slot>`:this.inputMethod==="search-location"?c`<slot name=arcgis-search ${o(this.#r)}></slot>`:null}render(){return c`<div role=dialog aria-labelledby=buffer-title><header><h2 id=buffer-title>${this._messages.title}</h2><calcite-input-message icon=information>${this._messages.labels.helpText}</calcite-input-message></header><instant-apps-buffer-input-radiogroup .labels=${this._messages.inputRadioButtonLabels} .selectedValue=${this.inputMethod} ${o(this.#t)}></instant-apps-buffer-input-radiogroup>${this._renderInputMethod()}<instant-apps-buffer-distance-manager .bufferDistance=${this.bufferDistance} .bufferInputStep=${this.bufferInputStep} .bufferMinDistance=${this.bufferMinDistance} .bufferMaxDistance=${this.bufferMaxDistance} .labels=${this._messages.labels} ${o(this.#s)}></instant-apps-buffer-distance-manager><calcite-label><span>${this._messages.labels.unit}</span><calcite-select .label=${this._messages.labels.unit} @calciteSelectChange=${this._onBufferUnitChange}>${S(J,e=>e,e=>c`<calcite-option .value=${e} .selected=${this.bufferUnit===e}>${this._messages.units[e]}</calcite-option>`)}</calcite-select></calcite-label><calcite-label class="buffer-labels-label" layout=inline><span><span>${this._messages.labels.showDistanceLabel}</span><calcite-switch .checked=${this.bufferLabelsVisible} @calciteSwitchChange=${this._onLabelsSwitchChange}></calcite-switch></span></calcite-label><div class="main-buttons-wrapper"><calcite-button @click=${this._onCreateBufferClick}>${this._messages.labels.draw}</calcite-button><calcite-button appearance=outline @click=${this._clearAllGraphics}>${this._messages.labels.clear}</calcite-button></div></div>`}};L("instant-apps-buffer",g);return g},"layers/GraphicsLayer","symbols/SimpleFillSymbol","symbols/TextSymbol","Graphic","geometry/operators/labelPointOperator","intl","symbols/TextSymbol3DLayer","symbols/PointSymbol3D","geometry/operators/geodesicBufferOperator","geometry/operators/bufferOperator","Graphic","geometry/operators/differenceOperator")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{b as n}from"./
|
|
2
|
+
import{b as n}from"./U4HGOXNJ.js";import{F as l,G as i,H as c,h as t,i as r,q as a}from"./T3EPRHTT.js";import"./EXBEKVP5.js";export default $arcgis.t(([f])=>{var m=t`:host{display:block}`,e=class extends c{constructor(){super(...arguments),this.fullscreenRef=l(),this.fullscreenStateChange=a(),this._fullscreenReady=()=>{f.watch(()=>this.fullscreenRef.value?.state,s=>s&&this.fullscreenStateChange.emit(s))}}static{this.properties={mapView:0,fullscreenRef:0}}static{this.styles=m}render(){return this.mapView&&r`<arcgis-fullscreen visual-scale=m .view=${this.mapView} @arcgisReady=${this._fullscreenReady} ${i(this.fullscreenRef)}></arcgis-fullscreen>`||""}};n("map-fullscreen",e);return e},"core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{I as s}from"./T3EPRHTT.js";var t=s({defaultAssetPath:"https://js.arcgis.com/5.1.
|
|
2
|
+
import{I as s}from"./T3EPRHTT.js";var t=s({defaultAssetPath:"https://js.arcgis.com/5.1.5/instant-apps-components/",hydratedAttribute:"hydrated"}),{customElement:n,getAssetPath:i,setAssetPath:p}=t;t.t=void 0;t.o=void 0;t.c=void 0;t.r=void 0;export{t as a,n as b,i as c};
|