@esri/solutions-components 5.0.6 → 5.0.7

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.
Files changed (94) hide show
  1. package/dist/cdn/{GARIVREH.js → 22U34PQB.js} +1 -1
  2. package/dist/cdn/{NGJIRF7M.js → 3RZXRWAP.js} +1 -1
  3. package/dist/cdn/{2DPJZTGZ.js → 3YFIPADZ.js} +1 -1
  4. package/dist/cdn/{3UZ6LMZQ.js → 43CYPIMQ.js} +1 -1
  5. package/dist/cdn/{T3XWY77W.js → 43IA3DL4.js} +1 -1
  6. package/dist/cdn/{N2WO3YVL.js → 4EPDGSS3.js} +1 -1
  7. package/dist/cdn/{LWBJ45OR.js → 4MCRCBXP.js} +1 -1
  8. package/dist/cdn/{CBXXTXHF.js → 4S6JHZXI.js} +1 -1
  9. package/dist/cdn/{52LTQZ5L.js → 5D5V3CBT.js} +1 -1
  10. package/dist/cdn/{NHPGVRRO.js → 5KFPWHQK.js} +1 -1
  11. package/dist/cdn/{NC6JL2EV.js → 5U76VYOV.js} +1 -1
  12. package/dist/cdn/{AOU46BFO.js → 5Z4JZB7T.js} +1 -1
  13. package/dist/cdn/{7UQHQGGR.js → 675G5KQQ.js} +1 -1
  14. package/dist/cdn/{D3Q2BMGC.js → 6ERK6VPZ.js} +1 -1
  15. package/dist/cdn/{YQSES45Q.js → 6XUVGEDV.js} +1 -1
  16. package/dist/cdn/{QKSAGMHC.js → 73QBDSXH.js} +1 -1
  17. package/dist/cdn/{N2JDDZHC.js → 74ZSZVS6.js} +1 -1
  18. package/dist/cdn/{5KUZRJBN.js → 7JYPKH72.js} +2 -2
  19. package/dist/cdn/{KS76NDW7.js → 7REPJ4XS.js} +1 -1
  20. package/dist/cdn/{UYIFEFZO.js → 7ZBCFESJ.js} +1 -1
  21. package/dist/cdn/{VMF3426Z.js → A26I5EAX.js} +1 -1
  22. package/dist/cdn/B2DK4LWH.js +2 -0
  23. package/dist/cdn/{LIARPICS.js → BNNZ2ZGX.js} +1 -1
  24. package/dist/cdn/{UZTK5BFT.js → BRG4WNOI.js} +1 -1
  25. package/dist/cdn/{BXXSHO4P.js → C3QDGTJR.js} +1 -1
  26. package/dist/cdn/{UIJUUMOH.js → CEYUKUGR.js} +1 -1
  27. package/dist/cdn/DKFXHHUI.js +2 -0
  28. package/dist/cdn/{OOSW7Q2C.js → DTI2O2YX.js} +1 -1
  29. package/dist/cdn/{ALXBMM22.js → EBQJE5IR.js} +1 -1
  30. package/dist/cdn/EEGVKRAE.js +2 -0
  31. package/dist/cdn/{4E2QV2RF.js → ENQQNV7P.js} +1 -1
  32. package/dist/cdn/{L6L2P3QS.js → ERCXFIQA.js} +1 -1
  33. package/dist/cdn/{KT2ORA3Q.js → EYM3QUBY.js} +1 -1
  34. package/dist/cdn/{JHAGL5UZ.js → FJ6NF35F.js} +1 -1
  35. package/dist/cdn/{IEY5UTNT.js → G7HBG2UF.js} +1 -1
  36. package/dist/cdn/{4KYIM4XN.js → HNRSOVZ3.js} +1 -1
  37. package/dist/cdn/{Z73DPA3J.js → HYX7BODW.js} +1 -1
  38. package/dist/cdn/{QD2Q6HPQ.js → ICP6A2TW.js} +1 -1
  39. package/dist/cdn/{6HDTGG3L.js → IRTMH4CU.js} +1 -1
  40. package/dist/cdn/{MS6GCUUL.js → JAP5VDRT.js} +1 -1
  41. package/dist/cdn/{654SAJ5M.js → JVBVZ7SO.js} +1 -1
  42. package/dist/cdn/{DXYCRHKW.js → KMVYKYBM.js} +1 -1
  43. package/dist/cdn/{3GLO7PZY.js → KZHT2SRK.js} +1 -1
  44. package/dist/cdn/{62H3JCSO.js → LFAWVGKM.js} +1 -1
  45. package/dist/cdn/{X43QJBP2.js → MDAQ5K75.js} +1 -1
  46. package/dist/cdn/{5J4YGZZD.js → NFXWBAXX.js} +1 -1
  47. package/dist/cdn/{MJ4LI4IV.js → NG4ZFNHE.js} +1 -1
  48. package/dist/cdn/{3ZEFAZQJ.js → NPR6G5AX.js} +1 -1
  49. package/dist/cdn/{5CJ5TY42.js → NWSKMX7S.js} +1 -1
  50. package/dist/cdn/{OI3ISQWM.js → OM6BG2BU.js} +1 -1
  51. package/dist/cdn/{I5KQH3I2.js → OX5ZGUUP.js} +1 -1
  52. package/dist/cdn/{XCS33CLJ.js → PGDVHQVF.js} +1 -1
  53. package/dist/cdn/{HSSQBD3H.js → PNJZAUGF.js} +1 -1
  54. package/dist/cdn/{W4AUM6QU.js → PTKWOS3W.js} +1 -1
  55. package/dist/cdn/{HHBYWWW3.js → QHBHKUDJ.js} +1 -1
  56. package/dist/cdn/{QPBV4Y7M.js → QJFN3RCP.js} +1 -1
  57. package/dist/cdn/{3MHFKNRH.js → QLZRRDLM.js} +1 -1
  58. package/dist/cdn/{RJVZG4T4.js → QMZKZWSS.js} +1 -1
  59. package/dist/cdn/{CYEOUBT7.js → RBNSS2LC.js} +1 -1
  60. package/dist/cdn/{EUJEN75Q.js → RJEWER4Y.js} +1 -1
  61. package/dist/cdn/{AC6MJOAB.js → RJJJCTWH.js} +1 -1
  62. package/dist/cdn/{L7WRG2G5.js → RVY7I3GY.js} +1 -1
  63. package/dist/cdn/{KD2OVMZO.js → S2O7THHA.js} +1 -1
  64. package/dist/cdn/{E3FUDTEG.js → S36FP6V3.js} +1 -1
  65. package/dist/cdn/{2ZHFKBQO.js → SA6VZSQH.js} +1 -1
  66. package/dist/cdn/{SRAAWOU6.js → SKRTPLGN.js} +1 -1
  67. package/dist/cdn/{QP3QUOVI.js → SL4JGIFV.js} +1 -1
  68. package/dist/cdn/{H7MJ7IGV.js → SZGK2TKC.js} +1 -1
  69. package/dist/cdn/{BR4TZZCB.js → THFNJ23N.js} +1 -1
  70. package/dist/cdn/{WCF7EVUQ.js → UHIWQ5QU.js} +1 -1
  71. package/dist/cdn/{F2JNLC5K.js → UKPIHN6B.js} +1 -1
  72. package/dist/cdn/{HTXFCOPI.js → UQ7NCQ5J.js} +1 -1
  73. package/dist/cdn/{OLFZ5ET5.js → UZR3P2OU.js} +1 -1
  74. package/dist/cdn/{EUODHGXF.js → WFL6AMNM.js} +1 -1
  75. package/dist/cdn/{PEBFXPSL.js → XBVKGREH.js} +1 -1
  76. package/dist/cdn/{SEH4C4BM.js → XFYS4DBD.js} +1 -1
  77. package/dist/cdn/{7WBAW4FI.js → XXUIQTGS.js} +1 -1
  78. package/dist/cdn/{WJK27OTO.js → Y4ZKMRDR.js} +1 -1
  79. package/dist/cdn/{XJTGQUMI.js → Y6MSFH7B.js} +1 -1
  80. package/dist/cdn/{GSTBH4J5.js → YKT6FAYV.js} +1 -1
  81. package/dist/cdn/{6PZREC7X.js → YTSRCWM5.js} +1 -1
  82. package/dist/cdn/{V3B323D4.js → ZW6PR32J.js} +1 -1
  83. package/dist/cdn/{ZSYY5MLI.js → ZWZFY2XW.js} +1 -1
  84. package/dist/cdn/index.js +1 -1
  85. package/dist/chunks/runtime.js +2 -2
  86. package/dist/components/create-feature/customElement.js +1 -1
  87. package/dist/docs/api.json +1 -1
  88. package/dist/docs/docs.json +1 -1
  89. package/dist/docs/web-types.json +1 -1
  90. package/dist/solutions-components_commit.txt +6 -6
  91. package/package.json +1 -1
  92. package/dist/cdn/6PZ6PVTG.js +0 -2
  93. package/dist/cdn/6RFIB2J7.js +0 -2
  94. package/dist/cdn/7JVIFSRF.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as b}from"./Z73DPA3J.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as _}from"./7JVIFSRF.js";import{H as p,J as w,h as m,i as h,r,u}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([g,n])=>{var y=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)}}`,c=class extends p{constructor(){super(...arguments),this.customizeSubmit=!1,this.enableSnapping=!1,this.showGuidingMsg=!0,this._editorLoading=!1,this._translations=b({name:"create-related-feature",blocking:!0}),this._addingAttachment=!1,this._isSubmitBtnClicked=!1,this.success=r(),this.fail=r(),this.isActionPending=r(),this.formReady=r()}static{this.properties={customizeSubmit:5,enableSnapping:5,mapView:0,selectedFeature:0,showGuidingMsg:5,table:0,_editorLoading:16,_translations:16}}static{this.styles=y}static{this.shadowRootOptions=u}willUpdate(t){t.has("mapView")&&this.mapViewWatchHandler(),t.has("_editorLoading")&&(this.hasUpdated||this._editorLoading!==!1)&&this._editorLoadingWatchHandler(this._editorLoading)}async mapViewWatchHandler(){await this.mapView?.when(async()=>{await this.init()})}async _editorLoadingWatchHandler(t){t&&(this._container?.classList.add("display-none"),await this.startCreate(),this._container?.classList.remove("display-none"),this._editorLoading=!1)}async submit(){this._editor?.viewModel?.featureFormViewModel&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async init(){this.mapView&&await this.createEditorWidget()}render(){let t=this._editorLoading?"":"display-none";return h`${this.showGuidingMsg&&h`<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 scale=s></calcite-loader>`}loaded(){this.init()}disconnectedCallback(){super.disconnectedCallback(),this._editor&&this._editor.destroy()}async createEditorWidget(){this._editor&&this._editor.destroy(),this._container=document.createElement("div"),this._container?.classList.add("display-none"),this.enableSnapping||this._container.classList.add("hide-editor-toolbar"),this._editor=new g({view:this.mapView,visibleElements:{flow:!0,settingsMenu:this.enableSnapping,sketch:!1,snappingControls:this.enableSnapping},container:this._container}),this.el.appendChild(this._container);let t=n.watch(()=>this._editor?.viewModel.featureTemplatesViewModel.state,i=>{i==="ready"&&(this._editorLoading=!0)});this._editor?.viewModel.addHandles(t);let e=n.watch(()=>this._editor?.viewModel.state,i=>{i==="adding-attachment"||i==="editing-attachment"?(this._addingAttachment=!0,this.isActionPending.emit(!0)):this._addingAttachment&&(this.isActionPending.emit(!1),this._addingAttachment=!1)});this._editor?.viewModel.addHandles(e);let o=n.watch(()=>this._editor?.viewModel.featureFormViewModel?.state,i=>{i==="ready"&&this.formReady.emit()});this._editor?.viewModel.addHandles(o)}async startCreate(){let t=this.selectedFeature?.layer,e=this.table;if(t?.relationships&&e?.relationships&&this.selectedFeature&&e.templates){let o=t.relationships[0],i=e.relationships.find(a=>t.layerId===a.relatedTableId),s=Number(this.selectedFeature.getObjectId());if(!Number.isNaN(s)&&i){let a=(await t.queryFeatures({objectIds:[s],outFields:[t.objectIdField,o.keyField]})).features[0],d=e.templates[0],l={attributeOverrides:this.makeAttributesForRelatedFeature(a,o,i),layer:e,template:d};await this._editor?.startCreateFeaturesWorkflowAtFeatureCreation(l),await this.hideEditorsElements(),this._editor?.viewModel?.featureFormViewModel?.addHandles(this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.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,o){let i=e.keyField,s;t.attributes.hasOwnProperty(i)?s=t.getAttribute(i):t.attributes.hasOwnProperty(i.toLowerCase())?s=t.getAttribute(i.toLowerCase()):t.attributes.hasOwnProperty(i.toUpperCase())&&(s=t.getAttribute(i.toUpperCase()));let a=o.keyField,d=this.table?.fields.find(l=>l.name.toLocaleLowerCase()===a.toLocaleLowerCase());if(d)return a=d.name,{[a]:s}}async submitted(t){if(t.invalid.length){this._isSubmitBtnClicked=!1;return}if(t.valid.length&&this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{this._editor?.activeWorkflow&&(await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some(e=>{if(e.error)throw e.error}))}catch(e){this.fail.emit(e);return}this.success.emit()}}async timeout(t){return new Promise(e=>setTimeout(e,t))}};_("create-related-feature",c);return c},"widgets/Editor","core/reactiveUtils")
2
+ import{a as b}from"./HYX7BODW.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as _}from"./B2DK4LWH.js";import{H as p,J as w,h as m,i as h,r,u}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([g,n])=>{var y=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)}}`,c=class extends p{constructor(){super(...arguments),this.customizeSubmit=!1,this.enableSnapping=!1,this.showGuidingMsg=!0,this._editorLoading=!1,this._translations=b({name:"create-related-feature",blocking:!0}),this._addingAttachment=!1,this._isSubmitBtnClicked=!1,this.success=r(),this.fail=r(),this.isActionPending=r(),this.formReady=r()}static{this.properties={customizeSubmit:5,enableSnapping:5,mapView:0,selectedFeature:0,showGuidingMsg:5,table:0,_editorLoading:16,_translations:16}}static{this.styles=y}static{this.shadowRootOptions=u}willUpdate(t){t.has("mapView")&&this.mapViewWatchHandler(),t.has("_editorLoading")&&(this.hasUpdated||this._editorLoading!==!1)&&this._editorLoadingWatchHandler(this._editorLoading)}async mapViewWatchHandler(){await this.mapView?.when(async()=>{await this.init()})}async _editorLoadingWatchHandler(t){t&&(this._container?.classList.add("display-none"),await this.startCreate(),this._container?.classList.remove("display-none"),this._editorLoading=!1)}async submit(){this._editor?.viewModel?.featureFormViewModel&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async init(){this.mapView&&await this.createEditorWidget()}render(){let t=this._editorLoading?"":"display-none";return h`${this.showGuidingMsg&&h`<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 scale=s></calcite-loader>`}loaded(){this.init()}disconnectedCallback(){super.disconnectedCallback(),this._editor&&this._editor.destroy()}async createEditorWidget(){this._editor&&this._editor.destroy(),this._container=document.createElement("div"),this._container?.classList.add("display-none"),this.enableSnapping||this._container.classList.add("hide-editor-toolbar"),this._editor=new g({view:this.mapView,visibleElements:{flow:!0,settingsMenu:this.enableSnapping,sketch:!1,snappingControls:this.enableSnapping},container:this._container}),this.el.appendChild(this._container);let t=n.watch(()=>this._editor?.viewModel.featureTemplatesViewModel.state,i=>{i==="ready"&&(this._editorLoading=!0)});this._editor?.viewModel.addHandles(t);let e=n.watch(()=>this._editor?.viewModel.state,i=>{i==="adding-attachment"||i==="editing-attachment"?(this._addingAttachment=!0,this.isActionPending.emit(!0)):this._addingAttachment&&(this.isActionPending.emit(!1),this._addingAttachment=!1)});this._editor?.viewModel.addHandles(e);let o=n.watch(()=>this._editor?.viewModel.featureFormViewModel?.state,i=>{i==="ready"&&this.formReady.emit()});this._editor?.viewModel.addHandles(o)}async startCreate(){let t=this.selectedFeature?.layer,e=this.table;if(t?.relationships&&e?.relationships&&this.selectedFeature&&e.templates){let o=t.relationships[0],i=e.relationships.find(a=>t.layerId===a.relatedTableId),s=Number(this.selectedFeature.getObjectId());if(!Number.isNaN(s)&&i){let a=(await t.queryFeatures({objectIds:[s],outFields:[t.objectIdField,o.keyField]})).features[0],d=e.templates[0],l={attributeOverrides:this.makeAttributesForRelatedFeature(a,o,i),layer:e,template:d};await this._editor?.startCreateFeaturesWorkflowAtFeatureCreation(l),await this.hideEditorsElements(),this._editor?.viewModel?.featureFormViewModel?.addHandles(this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.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,o){let i=e.keyField,s;t.attributes.hasOwnProperty(i)?s=t.getAttribute(i):t.attributes.hasOwnProperty(i.toLowerCase())?s=t.getAttribute(i.toLowerCase()):t.attributes.hasOwnProperty(i.toUpperCase())&&(s=t.getAttribute(i.toUpperCase()));let a=o.keyField,d=this.table?.fields.find(l=>l.name.toLocaleLowerCase()===a.toLocaleLowerCase());if(d)return a=d.name,{[a]:s}}async submitted(t){if(t.invalid.length){this._isSubmitBtnClicked=!1;return}if(t.valid.length&&this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{this._editor?.activeWorkflow&&(await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some(e=>{if(e.error)throw e.error}))}catch(e){this.fail.emit(e);return}this.success.emit()}}async timeout(t){return new Promise(e=>setTimeout(e,t))}};_("create-related-feature",c);return c},"widgets/Editor","core/reactiveUtils")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{b as y}from"./PZ4L77M5.js";import{ka as C,nb as R,nc as M,oa as x,qa as N,sa as $}from"./JE7L7M3J.js";import{a as I}from"./Z73DPA3J.js";import{u as k}from"./2IHQU2FX.js";import{b as O}from"./7JVIFSRF.js";import{F as b,G as w,H as S,J as A,L as h,h as T,i as r,j as _,r as D}from"./46DQNAMV.js";export default $arcgis.t(([])=>{var V="isMobile";var K="config",H=T`calcite-card{height:100%;padding-bottom:var(--calcite-spacing-base)}@media(max-width:400px){calcite-card{width:100%}}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover .hover-text{opacity:1;color:#fff}calcite-card:hover{outline:var(--calcite-spacing-base) solid var(--calcite-color-brand);box-sizing:content-box;cursor:pointer}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:var(--calcite-spacing-xl)}.card-image-wrap{flex:0 0 auto}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip}.width-full{width:100%}.deployed-label-override{--calcite-label-text-color: var(--calcite-color-text-3);--calcite-label-margin-bottom: var(--calcite-spacing-none)}.svg-color{fill:var(--calcite-color-text-3)}.padding-end-1-2{padding-inline-end:var(--calcite-spacing-sm)}.padding-bottom-1-2{padding-bottom:var(--calcite-spacing-sm)}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}.align-items-center{align-items:center}.font-weight-400,.font-weight-normal{font-weight:400}.font-color-text-2{--calcite-label-text-color: var(--calcite-color-text-2)}.font-line-height{line-height:1.4}.font-size-size--1{font-size:var(--calcite-font-size--1)}.icon-brand-color{--calcite-icon-color: var(--calcite-color-brand)}.header-line-height{--calcite-label-margin-bottom: 0;margin-top:var(--calcite-spacing-sm);margin-bottom:.7rem}.dialog-y-size{--calcite-dialog-size-y: 90% }.dialog-x-size{--calcite-dialog-size-x: 90% }.justify-content-space-between{justify-content:space-between}.panel-bg-color{--calcite-panel-header-background-color: var(--calcite-color-foreground-1);--calcite-panel-background-color: var(--calcite-color-foreground-1)}.cursor-default{cursor:default}`;async function z(e,t){let i=await $(e,t);if(!i)throw new Error(`Solution ${e} was not found`);let a=t?.portal.replace("/sharing/rest","")??"https://www.arcgis.com",s=[];if(i.templates[0].item)s=i.templates.map(n=>({id:n.itemId,title:n.item.title,type:n.item.type,typeKeywords:n.item.typeKeywords,dependencies:n.dependencies,snippet:n.item.snippet}));else{let n=i.templates.map(o=>o.type==="Group"?x(o.itemId,t):N(o.itemId,t));s=(await Promise.allSettled(n)).filter(o=>o.status==="fulfilled").map(o=>o.value).map((o,d)=>{let u=typeof o.type>"u"?"group":"item";return{id:o.id,title:o.title,type:o.type??"Group",typeKeywords:o.typeKeywords,dependencies:i.templates[d].dependencies,snippet:o.snippet,url:`${a}/home/${u}.html?id=${o.id}`}})}return s}function $e(e,t,i){let a=e.templates.map(c=>c.type),s=[];s.push(ee),a.indexOf("Group")>=0&&(s.push(P),s.push(U)),a.indexOf("Feature Service")>=0&&s.push(L);let n=a.indexOf("Feed")>-1;n&&s.push(ie);let o=a.indexOf("Big Data Analytic")>-1;o&&s.push(te);let d=a.indexOf("Real Time Analytic")>-1;d&&s.push(se),(n||o||d)&&s.push(de),a.indexOf("Workflow")>-1&&(s.push(P),s.push(L),s.push(U),s.push(ue)),a.indexOf("Geoprocessing Service")>-1&&(s.push(ae),i.IsEnterprisePortal&&s.push(ne));let u=e.templates.reduce((c,f)=>c.concat(f.item.typeKeywords||[]),[]);return q(s,u,i),J(s,t),Y(s,e),s}function Y(e,t){t.templates.some(i=>i.type==="Group"&&i.item?.membershipAccess==="collaboration")&&e.push(Z)}function q(e,t,i){let a=G(i),s=j(i);["Location Tracking View"].some(n=>t.indexOf(n)>-1)&&(!a&&!s?e.push(re):a&&!s?e.push(le):!a&&s&&e.push(ce))}function J(e,t){["HubPremium"].some(i=>t.indexOf(i)>-1)&&e.push(oe)}function G(e){return e.PortalUserSubset?.role==="org_admin"&&!e.PortalUserSubset?.roleId}function j(e){return e.PortalSubset?.locationTrackingEnabled||!1}function Re(e,t){let i={leadingMessages:[],bulletedMessages:[],trailingMessages:[]},a=[l.NOTEBOOK,l.VELOCITY,l.HUBPREMIUM,l.WORKFLOW,l.TRACKINGBASE],s=g(e,t,l.VELOCITY);s&&i.leadingMessages.push(s);let n=g(e,t,l.NOTEBOOK);n&&i.leadingMessages.push(n);let o=g(e,t,l.HUBPREMIUM);o&&i.leadingMessages.push(o);let d=g(e,t,l.WORKFLOW);d&&i.leadingMessages.push(d),t=t.filter(c=>a.indexOf(c)<0),t.forEach(c=>{i.bulletedMessages.push(B(e,c))});let u=g(e,t,l.TRACKINGBASE);return u&&i.trailingMessages.push(u),(i.leadingMessages.length>0||i.trailingMessages.length>0||i.bulletedMessages.length>0)&&i.trailingMessages.push(e.missingPrivilegesPopup.suggestedProblemRemedyMessage),i}function g(e,t,i){return t.filter(a=>a.includes(i)).length>0?B(e,i):""}function B(e,t){let i=e.missingPrivilegesPopup.requiredPrivilegesList,a="";switch(t){case"portal:user:createItem":a=i.createItem;break;case"portal:publisher:publishFeatures":a=i.publishFeatures;break;case"portal:user:createGroup":a=i.createGroup;break;case"portal:user:shareToGroup":a=i.shareToGroup;break;case"portal:user:addExternalMembersToGroup":a=i.addMembers;break;case"portal:publisher:publishFeeds":a=i.publishFeeds;break;case"portal:publisher:publishBigDataAnalytics":a=i.publishBigDataAnalytics;break;case"portal:publisher:publishRealTimeAnalytics":a=i.publishRealTimeAnalytics;break;case"solutions:locationtracking:admin:tracking":a=i.requiresLocationTrackingAndAdmin;break;case"solutions:locationtracking:tracking":a=i.requiresLocationTracking;break;case"solutions:locationtracking:admin":a=i.requiresAdmin;break;case"solutions:hubPremium":a=i.hubPremium;break;case"solutions:workflowManager":a=i.workflowManager;break;case"solutions:velocity":a=i.velocity;break;case"solutions:notebook":a=i.requiresNotebookServer;break;case"portal:publisher:publishServerGPServices":a=i.publishGPServices;break;case"writable:Enterprise":a=i.writableEnterprise;break;case"writable:Online":a=i.writableOnline.replace("{{url}}","https://status.arcgis.com");break}return a}function Me(e,t){let i=W(t),a=he([{k:"id",v:e}])||"";return i?`${i}/home/item.html${a}`:""}function Pe(e,t,i,a){let s=a||W(i);return s?`${s}/sharing/rest/content/items/${e}/resources/${t}`:""}function W(e){return e?.PortalSubset?.orgUrl||e?.PortalUrl||""}function Q(e,t){let i=new URL(e);return i.searchParams.set("token",t),i.toString()}var v=class extends S{constructor(){super(),this.deployedDate="",this.description="",this.diagramKey="",this.heading="",this.itemId="",this.owner="",this.thumbnail="",this.updateAvailable=!1,this.templateInfos=[],this._isDeleteOpen=!1,this._isDiagramOpen=!1,this.isMobile=!1,this.templateInfoGraph=[],this._configureTitlesOpen=!1,this._thumbnailUrl="",this._translations=I({name:"solution-deployed-card",blocking:!0}),this._configContextConsumer=y({context:K,subscribe:!0,callback:async t=>{t&&(this._isOrgAdmin=G(t.authentication),this._thumbnailUrl=`${this.thumbnail}&token=${t.userSession?.token}`)}}),this._deleteDialogRef=b(),this._diagramDialogRef=b(),this._isOrgAdmin=!1,this._isMobileContextConsumer=y({context:V,subscribe:!0,callback:t=>this.isMobile=t}),this.deployedCardSelected=D(),this.listenOn(window,"sessionRefreshed",t=>{this._updateThumbnailToken(t.detail)})}static{this.properties={card:0,deployedDate:1,description:1,diagramKey:1,heading:1,itemId:1,owner:1,thumbnail:1,updateAvailable:5,templateInfos:0,_isDeleteOpen:16,_isDiagramOpen:16,isMobile:16,templateInfoGraph:16,_configureTitlesOpen:16,_thumbnailUrl:16,_translations:16}}static{this.styles=H}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async renderDeleteDialog(){return this._isDeleteOpen=!0,this._renderDeleteDialog(),this._deleteDialogRef.value}async renderDiagramDialog(t){return await this._viewDiagram(t),await this._renderDiagramDialog(),this._diagramDialogRef.value}async getTemplates(){return this._processTemplates(this.card)}async load(){this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value)}render(){return r`<calcite-card .label=${this.description} @click=${this._cardSelected} @keydown=${t=>m(t,()=>this._cardSelected())}>${this._getImage()}${this._getHeader()}<p class="font-color-text-2 font-line-height font-size-size--1" slot=description>${this.description}</p><div class="width-full display-flex flex-direction-column" slot=footer-start><div class="padding-bottom-1-2">${this.owner!==""&&this._getOwnerLabel()||""}${this._getDeployedDate()}</div>${this._getConfigureButton()}</div></calcite-card>${this._renderDeleteDialog()}${this._renderDiagramDialog()}${this._renderConfigureTitlesDialog()}`}_getImage(){return r`<div class="card-image-wrap" slot=thumbnail><img alt=${this.heading??h} class="thumbnail card-image" src=${this._thumbnailUrl??h}><div class="hover-text">${this._translations.openSolution}</div></div>`}_getHeader(){return r`<div class="display-flex justify-content-space-between header-line-height" slot=heading><calcite-label layout=inline-space-between scale=l>${this.heading}</calcite-label></div>`}_getOwnerLabel(){return r`<calcite-label class="font-weight-400 padding-end-1-2" layout=inline scale=s>${`${this._translations.owner}:`}<calcite-link class="font-weight-normal" @click=${this._openUserProfile} @keydown=${t=>m(t,()=>this._openUserProfile(t))}>${this.owner}</calcite-link></calcite-label>`}_getDeployedDate(){return r`<div class="display-flex align-items-center"><div class="padding-end-1-2"><svg height=16px viewBox="0 0 32 32" width=16px xmlns=http://www.w3.org/2000/svg>${_`<path class="svg-color" d="M29.963 7.672a1.586 1.586 0 0 0-1.584-1.585h-5.274a.187.187 0 0 1-.188-.187V3.977A2 2 0 0 0 20.825 2h-9.672A2.095 2.095 0 0 0 9.06 4.093V5.9a.187.187 0 0 1-.187.187H3.598a1.586 1.586 0 0 0-1.584 1.585v4.016a.281.281 0 0 0 .281.28H4.9l.014-.013V9.153a.177.177 0 0 1 .177-.177h21.46a.456.456 0 0 1 .449.45v13.742A1.832 1.832 0 0 1 25.168 25h-8.892a.568.568 0 0 1-.534-.373 3.98 3.98 0 0 0-7.6.373H5.657a.757.757 0 0 1-.757-.757v-3.055A.188.188 0 0 0 4.714 21H2.028l-.014.014v4.58a2.35 2.35 0 0 0 2.347 2.346h4.161a3.963 3.963 0 0 0 6.8.256.569.569 0 0 1 .475-.256h12.065a2.102 2.102 0 0 0 2.101-2.101zM21 5.625a.375.375 0 0 1-.375.375h-9.25A.375.375 0 0 1 11 5.625V4.45a.456.456 0 0 1 .45-.45h9.1a.456.456 0 0 1 .45.45zM12 28a2 2 0 1 1 2-2 2 2 0 0 1-2 2z" /><path class="svg-color" d="M13.273 17.994a.57.57 0 0 1 .479.262A3.73 3.73 0 0 0 17 20a3.74 3.74 0 0 0 3.403-2.006h3.41a.188.188 0 0 0 .187-.188v-2.589a.187.187 0 0 0-.188-.188H20.8A3.8 3.8 0 0 0 17 12a4.058 4.058 0 0 0-3.69 2.647.568.568 0 0 1-.537.383H1.093a.094.094 0 0 0-.093.093V17.9a.094.094 0 0 0 .094.094zM17 13.9a2.1 2.1 0 1 1-2.1 2.1 2.1 2.1 0 0 1 2.1-2.1z" />`}</svg></div><calcite-label class="deployed-label-override" scale=s>${this._translations.deployedDate.replace("{{date}}",this.deployedDate)}</calcite-label></div>`}_getConfigureButton(){let t=this._configContextConsumer.value?.userSession?.username,i=this._configContextConsumer.value?.authentication?.CanUpdateSolution,a=this.card?.owner===t||this._isOrgAdmin||i,s=this.card?.owner===t||this._isOrgAdmin,n=a?"display-none":"";return r`<calcite-split-button appearance=outline aria-label=${this._translations.openSolution??h} dropdown-label=${this._translations.moreActions??h} kind=neutral @calciteSplitButtonPrimaryClick=${this._cardSelected} @click=${o=>o.stopPropagation()} @keydown=${o=>o.stopPropagation()} overlay-positioning=fixed primary-text=${this._translations.openSolution??h} width=full><calcite-dropdown-group selection-mode=none>${!this.isMobile&&r`<calcite-dropdown-item icon-start=model @click=${this._viewDiagram} @keydown=${o=>m(o,()=>this._viewDiagram(o))}>${this._translations.viewDiagram}</calcite-dropdown-item>`||""}<calcite-dropdown-item icon-start=file-text @click=${this._viewDocumentation} @keydown=${o=>m(o,()=>this._viewDocumentation(o))}>${this._translations.documentation}</calcite-dropdown-item><calcite-dropdown-item icon-start=information @click=${this._viewItemDetails} @keydown=${o=>m(o,()=>this._viewItemDetails(o))}>${this._translations.viewItemDetails}</calcite-dropdown-item>${!this.isMobile&&a&&r`<calcite-dropdown-item icon-start=edit-attributes id=solution-configure-titles-dropdown @click=${async()=>{this.templateInfos=await this._processTemplates(this.card),this._configureTitlesOpen=!0}} @keydown=${o=>m(o,async()=>{this.templateInfos=await this._processTemplates(this.card),this._configureTitlesOpen=!0})}>${this._translations.renameItems}</calcite-dropdown-item>`||""}${!this.isMobile&&s&&r`<calcite-dropdown-item icon-start=trash @click=${this._deleteSolution} @keydown=${o=>m(o,()=>this._deleteSolution(o))}>${this._translations.deleteSolution}</calcite-dropdown-item>`||""}</calcite-dropdown-group><calcite-tooltip class=${A(n)} overlay-positioning=fixed reference-element=solution-configure-titles-dropdown><span>${this._translations.mustOwnSolution}</span></calcite-tooltip></calcite-split-button>`}_renderDeleteDialog(){return this._isDeleteOpen?r`<solution-delete-dialog .card=${this.card} @solutionDeleteDialogOpen=${t=>{this._isDeleteOpen=t.detail}} .open=${this._isDeleteOpen} source="Card Dropdown" ${w(this._deleteDialogRef)}></solution-delete-dialog>`:""}_renderDiagramDialog(){return this._isDiagramOpen?r`<calcite-dialog class="dialog-y-size dialog-x-size panel-bg-color" .heading=${this._translations.diagramTitle.replace("{{solution}}",this.card?.title??"")} id=${this._translations.diagramTitle.replace("{{solution}}",this.card?.title??"")??h} modal .open=${this._isDiagramOpen} @calciteDialogClose=${()=>{this._isDiagramOpen=!1}} outside-close-disabled scale=m width=l ${w(this._diagramDialogRef)}><solution-item-diagram .diagramKey=${this.diagramKey} .templateInfoGraph=${this.templateInfoGraph} .typeKeywords=${this.card?.typeKeywords}></solution-item-diagram></calcite-dialog>`:""}_renderConfigureTitlesDialog(){return this._configureTitlesOpen?r`<solution-configure-titles .card=${this.card} @solutionConfigureTitlesBeforeClose=${async()=>{this._processTemplates(this.card).then(t=>{this.templateInfos=t}),this._configureTitlesOpen=!1}} @solutionItemsTitlesChanged=${async()=>{this._processTemplates(this.card).then(t=>{this.templateInfos=t})}} .open=${this._configureTitlesOpen} source="Card Dropdown" .templateInfos=${this.templateInfos}></solution-configure-titles>`:""}_cardSelected(){this.deployedCardSelected.emit({card:this.card,cardRef:this.el})}async _viewDiagram(t){t.stopPropagation(),this.card&&(this._telemetry?.logEvent({category:E.DEPLOYMENTS,action:"View Diagram",dimensions:[this.card.title||"",this.card.deployCommonId||"",this.card.deployVersion||"","Card Dropdown"]}),this.templateInfoGraph=await this._processTemplates(this.card),this._isDiagramOpen=!0)}_viewDocumentation(t){t.stopPropagation(),this._telemetry?.logEvent({category:E.DEPLOYMENTS,action:"Open Help",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Card Dropdown"]}),window.open(this.card.learnMoreUrl,"_blank")}_viewItemDetails(t){t.stopPropagation(),this._telemetry?.logEvent({category:E.DEPLOYMENTS,action:"Open Item Details",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Card Dropdown"]}),window.open(this.card.itemUrl,"_blank")}_deleteSolution(t){t.stopPropagation(),this._isDeleteOpen=!0}_openUserProfile(t){t.stopPropagation();let i=this._configContextConsumer.value?.authentication?.PortalSubset?.orgUrl;i&&window.open(`${i}/home/user.html?user=${this.owner}`,"_blank")}async _processTemplates(t){return await z(t.id,this._configContextConsumer.value.userSession)}_updateThumbnailToken(t){this._thumbnailUrl!==""&&(this._thumbnailUrl=Q(this._thumbnailUrl,t))}};O("solution-deployed-card",v);var Le=500,Ue={AEC:"Architecture, Engineering, and Construction (AEC)",AIRPORTPORTRAIL:"Airports, Ports, and Rails",BUSINESS:"Business",CONSERVATION:"Conservation",DEFENSE:"Defense",FACILITIES:"Facilities",HEALTHANDHUMANSERVICES:"Health and Human Services",PIPELINE:"Pipeline",PUBLICSAFETY:"Public Safety",RENEWABLES:"Renewables",STATEANDLOCALGOVERNMENT:"State and Local Government",TELECOMMUNICATIONS:"Telecommunications",UTILITIES:"Utilities"},Ge={AIRPORT:"Airports",AGRICULTURE:"Agriculture",ASSESSMENTANDTAXATION:"Assessment and Taxation",DISTRICTENERGY:"District Energy",ELECTIONS:"Elections",ELECTRIC:"Electric",EMERGENCYMANAGEMENT:"Emergency Management",ENVIRONMENTANDNATURALRESOURCES:"Environment and Natural Resources",FIRESERVICE:"Fire Service",FISHANDWILDLIFE:"Fish and Wildlife",GAS:"Gas",HEALTHANDHUMANSERVICES:"Health and Human Services",LAWENFORCEMENT:"Law Enforcement",NATURALRESOURCES:"Natural Resources",PARKS:"Parks",PLANNINGANDDEVELOPMENT:"Planning and Development",PROTECTEDAREAS:"Protected Areas",PUBLICWORKS:"Public Works",SEWER:"Sewer",STORMWATER:"Stormwater",TELECOMMUNICATIONS:"Telecommunications",TRANSPORTATION:"Transportation",WATER:"Water Distribution"},l=(e=>(e.HUBPREMIUM="solutions:hubPremium",e.NOTEBOOK="solutions:notebook",e.TRACKINGBASE="solutions:locationtracking",e.TRACKING="solutions:locationtracking:tracking",e.TRACKINGADMIN="solutions:locationtracking:admin",e.TRACKINGADMINANDTRACKING="solutions:locationtracking:admin:tracking",e.VELOCITY="solutions:velocity",e.WORKFLOW="solutions:workflowManager",e))(l||{}),X=(e=>(e.VELOCITYBIGDATA="portal:publisher:publishBigDataAnalytics",e.VELOCITYFEEDS="portal:publisher:publishFeeds",e.VELOCITYREALTIME="portal:publisher:publishRealTimeAnalytics",e))(X||{}),Be='((typekeywords:Solution,Deployed,"ArcGIS Solution") OR ((typekeywords:Solution,Deployed) AND (created:[1577862000000 TO 1622576880000])))',We="(typekeywords:Solution,Template)",Z="portal:user:addExternalMembersToGroup",ee="portal:user:createItem",P="portal:user:createGroup",te="portal:publisher:publishBigDataAnalytics",L="portal:publisher:publishFeatures",ie="portal:publisher:publishFeeds",ae="portal:publisher:publishServerGPServices",se="portal:publisher:publishRealTimeAnalytics",U="portal:user:shareToGroup",oe="solutions:hubPremium",ne="solutions:notebook",re="solutions:locationtracking:admin:tracking",le="solutions:locationtracking:tracking",ce="solutions:locationtracking:admin",de="solutions:velocity",ue="solutions:workflowManager",pe=250,E={SOLUTION_DETAILS:"Solution Details",GLOBAL_NAVIGATION:"Global Nav",ALL_SOLUTIONS:"Solutions",DEPLOYMENTS:"Deployments",ASSISTANT:"Assistant",RESOURCES:"Resources"},Fe={MINE:"My deployments",ORG:"Organization"};function he(e){let t="",i="?";return e.forEach(a=>{a.k&&a.v&&(t+=i+a.k+"="+a.v,i="&")}),t}function Ve(e){return e?M(e,{}).then(t=>Promise.resolve(!!t)):Promise.resolve(!1)}async function me(e,t){let i=t,a=await i.getUsername(),s={q:new k().match(e).in("title").and().match(a).in("owner"),filter:"type:Solution",authentication:i},n=(await R(s)).results.map(p=>p.title),{folders:o}=await C(i),d=o.map(p=>p.title),u=[...n,...d].map(p=>p.trim().toLowerCase()),c=e.toLowerCase(),f=u.filter(p=>p===c),F=u.filter(p=>p.startsWith(c));return{conflictingNames:f,similiarNames:F}}async function Ke(e,t){return ge(e)?{status:!1,type:"empty"}:fe(e)?{status:!1,type:"exceed length"}:be(e,"folder")?{status:!1,type:"special character"}:(await me(e.trim(),t)).conflictingNames.length>0?{status:!1,type:"not unique"}:{status:!0,type:""}}function ge(e){return e.length<=0}function fe(e){return e.length>pe}function be(e,t){return(t==="item"?/[><~`$^+=|]/u:/[/<>]/u).test(e)}function He(e){if(e){let t=e.trim();return t?"<div>"+t+"</div>":""}else return""}function we(e){let t="",i="?";return e.forEach(a=>{a.k&&a.v&&(t+=i+a.k+"="+a.v,i="&")}),t}function ze(e,t,i,a){let s="";return t?s=a+"/sharing/rest/content/items/"+e+"/info/"+t+we([{k:"w",v:"400"}]):s=i,s}function Ye(e){let t=e?e.replace("https://","").replace("www.",""):"";return t.endsWith("devext.arcgis.com")||t.endsWith("mapsqa.arcgis.com")||t.endsWith("qaext.arcgis.com")?e??"https://www.arcgis.com":"https://www.arcgis.com"}function qe(e,t,i){return t.some(a=>a.wkid===e?(i=a.defaultExtent,!0):!1),i}function Je(e,t){return ye(t||e)}function je(e,t="en"){return new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"numeric"}).format(e)}function Qe(e,t){let i="";return e.some(a=>a.startsWith(t)?(i=a.substring(t.length),!0):!1),i}function ye(e){let t=e.replace("www.","");return t.endsWith("devext.arcgis.com")?"dev":t.endsWith("mapsqa.arcgis.com")||t.endsWith("qaext.arcgis.com")?"qa":t==="arcgis.com"||t.endsWith(".arcgis.com")?"prod":"dev"}function Xe(e,t){let i=e?.reduce((a,s)=>(a.indexOf(s.id)<0&&a.push(s.id),a),[])||[];return t?i.sort((a,s)=>t.indexOf(a)-t.indexOf(s)):i}function Ze(e){return e.charAt(0).toUpperCase()+e.slice(1)}function et(e){return{relevance:"Relevance",title:"Title",new:"New",created:"Date deployed",updated:"Updated",suggested:"Suggested for you"}[e]||e}function tt(e){if(!e)return"Unknown error";if(e.message)return e.message;try{let t=JSON.stringify(e);return t&&t!=="{}"?t:e.toString()}catch{return e.toString()}}function it(e){return e?parseFloat(((Date.now()-e)/1e3).toFixed(2)):0}function m(e,t){(e.key==="Enter"||e.code==="NumpadEnter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),t())}return{a:V,b:K,c:z,d:$e,e:G,f:Re,g:Me,h:Pe,i:Q,j:v,k:Le,l:Ue,m:Ge,n:l,o:X,p:Be,q:We,r:pe,s:E,t:Fe,u:Ve,v:me,w:Ke,x:be,y:He,z:we,A:ze,B:Ye,C:qe,D:Je,E:je,F:Qe,G:Xe,H:Ze,I:et,J:tt,K:it,L:m}},"intl","identity/IdentityManager","identity/OAuthInfo","portal/Portal")
2
+ import{b as y}from"./PZ4L77M5.js";import{ka as C,nb as R,nc as M,oa as x,qa as N,sa as $}from"./JE7L7M3J.js";import{a as I}from"./HYX7BODW.js";import{u as k}from"./2IHQU2FX.js";import{b as O}from"./B2DK4LWH.js";import{F as b,G as w,H as S,J as A,L as h,h as T,i as r,j as _,r as D}from"./46DQNAMV.js";export default $arcgis.t(([])=>{var V="isMobile";var K="config",H=T`calcite-card{height:100%;padding-bottom:var(--calcite-spacing-base)}@media(max-width:400px){calcite-card{width:100%}}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover .hover-text{opacity:1;color:#fff}calcite-card:hover{outline:var(--calcite-spacing-base) solid var(--calcite-color-brand);box-sizing:content-box;cursor:pointer}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:var(--calcite-spacing-xl)}.card-image-wrap{flex:0 0 auto}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip}.width-full{width:100%}.deployed-label-override{--calcite-label-text-color: var(--calcite-color-text-3);--calcite-label-margin-bottom: var(--calcite-spacing-none)}.svg-color{fill:var(--calcite-color-text-3)}.padding-end-1-2{padding-inline-end:var(--calcite-spacing-sm)}.padding-bottom-1-2{padding-bottom:var(--calcite-spacing-sm)}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}.align-items-center{align-items:center}.font-weight-400,.font-weight-normal{font-weight:400}.font-color-text-2{--calcite-label-text-color: var(--calcite-color-text-2)}.font-line-height{line-height:1.4}.font-size-size--1{font-size:var(--calcite-font-size--1)}.icon-brand-color{--calcite-icon-color: var(--calcite-color-brand)}.header-line-height{--calcite-label-margin-bottom: 0;margin-top:var(--calcite-spacing-sm);margin-bottom:.7rem}.dialog-y-size{--calcite-dialog-size-y: 90% }.dialog-x-size{--calcite-dialog-size-x: 90% }.justify-content-space-between{justify-content:space-between}.panel-bg-color{--calcite-panel-header-background-color: var(--calcite-color-foreground-1);--calcite-panel-background-color: var(--calcite-color-foreground-1)}.cursor-default{cursor:default}`;async function z(e,t){let i=await $(e,t);if(!i)throw new Error(`Solution ${e} was not found`);let a=t?.portal.replace("/sharing/rest","")??"https://www.arcgis.com",s=[];if(i.templates[0].item)s=i.templates.map(n=>({id:n.itemId,title:n.item.title,type:n.item.type,typeKeywords:n.item.typeKeywords,dependencies:n.dependencies,snippet:n.item.snippet}));else{let n=i.templates.map(o=>o.type==="Group"?x(o.itemId,t):N(o.itemId,t));s=(await Promise.allSettled(n)).filter(o=>o.status==="fulfilled").map(o=>o.value).map((o,d)=>{let u=typeof o.type>"u"?"group":"item";return{id:o.id,title:o.title,type:o.type??"Group",typeKeywords:o.typeKeywords,dependencies:i.templates[d].dependencies,snippet:o.snippet,url:`${a}/home/${u}.html?id=${o.id}`}})}return s}function $e(e,t,i){let a=e.templates.map(c=>c.type),s=[];s.push(ee),a.indexOf("Group")>=0&&(s.push(P),s.push(U)),a.indexOf("Feature Service")>=0&&s.push(L);let n=a.indexOf("Feed")>-1;n&&s.push(ie);let o=a.indexOf("Big Data Analytic")>-1;o&&s.push(te);let d=a.indexOf("Real Time Analytic")>-1;d&&s.push(se),(n||o||d)&&s.push(de),a.indexOf("Workflow")>-1&&(s.push(P),s.push(L),s.push(U),s.push(ue)),a.indexOf("Geoprocessing Service")>-1&&(s.push(ae),i.IsEnterprisePortal&&s.push(ne));let u=e.templates.reduce((c,f)=>c.concat(f.item.typeKeywords||[]),[]);return q(s,u,i),J(s,t),Y(s,e),s}function Y(e,t){t.templates.some(i=>i.type==="Group"&&i.item?.membershipAccess==="collaboration")&&e.push(Z)}function q(e,t,i){let a=G(i),s=j(i);["Location Tracking View"].some(n=>t.indexOf(n)>-1)&&(!a&&!s?e.push(re):a&&!s?e.push(le):!a&&s&&e.push(ce))}function J(e,t){["HubPremium"].some(i=>t.indexOf(i)>-1)&&e.push(oe)}function G(e){return e.PortalUserSubset?.role==="org_admin"&&!e.PortalUserSubset?.roleId}function j(e){return e.PortalSubset?.locationTrackingEnabled||!1}function Re(e,t){let i={leadingMessages:[],bulletedMessages:[],trailingMessages:[]},a=[l.NOTEBOOK,l.VELOCITY,l.HUBPREMIUM,l.WORKFLOW,l.TRACKINGBASE],s=g(e,t,l.VELOCITY);s&&i.leadingMessages.push(s);let n=g(e,t,l.NOTEBOOK);n&&i.leadingMessages.push(n);let o=g(e,t,l.HUBPREMIUM);o&&i.leadingMessages.push(o);let d=g(e,t,l.WORKFLOW);d&&i.leadingMessages.push(d),t=t.filter(c=>a.indexOf(c)<0),t.forEach(c=>{i.bulletedMessages.push(B(e,c))});let u=g(e,t,l.TRACKINGBASE);return u&&i.trailingMessages.push(u),(i.leadingMessages.length>0||i.trailingMessages.length>0||i.bulletedMessages.length>0)&&i.trailingMessages.push(e.missingPrivilegesPopup.suggestedProblemRemedyMessage),i}function g(e,t,i){return t.filter(a=>a.includes(i)).length>0?B(e,i):""}function B(e,t){let i=e.missingPrivilegesPopup.requiredPrivilegesList,a="";switch(t){case"portal:user:createItem":a=i.createItem;break;case"portal:publisher:publishFeatures":a=i.publishFeatures;break;case"portal:user:createGroup":a=i.createGroup;break;case"portal:user:shareToGroup":a=i.shareToGroup;break;case"portal:user:addExternalMembersToGroup":a=i.addMembers;break;case"portal:publisher:publishFeeds":a=i.publishFeeds;break;case"portal:publisher:publishBigDataAnalytics":a=i.publishBigDataAnalytics;break;case"portal:publisher:publishRealTimeAnalytics":a=i.publishRealTimeAnalytics;break;case"solutions:locationtracking:admin:tracking":a=i.requiresLocationTrackingAndAdmin;break;case"solutions:locationtracking:tracking":a=i.requiresLocationTracking;break;case"solutions:locationtracking:admin":a=i.requiresAdmin;break;case"solutions:hubPremium":a=i.hubPremium;break;case"solutions:workflowManager":a=i.workflowManager;break;case"solutions:velocity":a=i.velocity;break;case"solutions:notebook":a=i.requiresNotebookServer;break;case"portal:publisher:publishServerGPServices":a=i.publishGPServices;break;case"writable:Enterprise":a=i.writableEnterprise;break;case"writable:Online":a=i.writableOnline.replace("{{url}}","https://status.arcgis.com");break}return a}function Me(e,t){let i=W(t),a=he([{k:"id",v:e}])||"";return i?`${i}/home/item.html${a}`:""}function Pe(e,t,i,a){let s=a||W(i);return s?`${s}/sharing/rest/content/items/${e}/resources/${t}`:""}function W(e){return e?.PortalSubset?.orgUrl||e?.PortalUrl||""}function Q(e,t){let i=new URL(e);return i.searchParams.set("token",t),i.toString()}var v=class extends S{constructor(){super(),this.deployedDate="",this.description="",this.diagramKey="",this.heading="",this.itemId="",this.owner="",this.thumbnail="",this.updateAvailable=!1,this.templateInfos=[],this._isDeleteOpen=!1,this._isDiagramOpen=!1,this.isMobile=!1,this.templateInfoGraph=[],this._configureTitlesOpen=!1,this._thumbnailUrl="",this._translations=I({name:"solution-deployed-card",blocking:!0}),this._configContextConsumer=y({context:K,subscribe:!0,callback:async t=>{t&&(this._isOrgAdmin=G(t.authentication),this._thumbnailUrl=`${this.thumbnail}&token=${t.userSession?.token}`)}}),this._deleteDialogRef=b(),this._diagramDialogRef=b(),this._isOrgAdmin=!1,this._isMobileContextConsumer=y({context:V,subscribe:!0,callback:t=>this.isMobile=t}),this.deployedCardSelected=D(),this.listenOn(window,"sessionRefreshed",t=>{this._updateThumbnailToken(t.detail)})}static{this.properties={card:0,deployedDate:1,description:1,diagramKey:1,heading:1,itemId:1,owner:1,thumbnail:1,updateAvailable:5,templateInfos:0,_isDeleteOpen:16,_isDiagramOpen:16,isMobile:16,templateInfoGraph:16,_configureTitlesOpen:16,_thumbnailUrl:16,_translations:16}}static{this.styles=H}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async renderDeleteDialog(){return this._isDeleteOpen=!0,this._renderDeleteDialog(),this._deleteDialogRef.value}async renderDiagramDialog(t){return await this._viewDiagram(t),await this._renderDiagramDialog(),this._diagramDialogRef.value}async getTemplates(){return this._processTemplates(this.card)}async load(){this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value)}render(){return r`<calcite-card .label=${this.description} @click=${this._cardSelected} @keydown=${t=>m(t,()=>this._cardSelected())}>${this._getImage()}${this._getHeader()}<p class="font-color-text-2 font-line-height font-size-size--1" slot=description>${this.description}</p><div class="width-full display-flex flex-direction-column" slot=footer-start><div class="padding-bottom-1-2">${this.owner!==""&&this._getOwnerLabel()||""}${this._getDeployedDate()}</div>${this._getConfigureButton()}</div></calcite-card>${this._renderDeleteDialog()}${this._renderDiagramDialog()}${this._renderConfigureTitlesDialog()}`}_getImage(){return r`<div class="card-image-wrap" slot=thumbnail><img alt=${this.heading??h} class="thumbnail card-image" src=${this._thumbnailUrl??h}><div class="hover-text">${this._translations.openSolution}</div></div>`}_getHeader(){return r`<div class="display-flex justify-content-space-between header-line-height" slot=heading><calcite-label layout=inline-space-between scale=l>${this.heading}</calcite-label></div>`}_getOwnerLabel(){return r`<calcite-label class="font-weight-400 padding-end-1-2" layout=inline scale=s>${`${this._translations.owner}:`}<calcite-link class="font-weight-normal" @click=${this._openUserProfile} @keydown=${t=>m(t,()=>this._openUserProfile(t))}>${this.owner}</calcite-link></calcite-label>`}_getDeployedDate(){return r`<div class="display-flex align-items-center"><div class="padding-end-1-2"><svg height=16px viewBox="0 0 32 32" width=16px xmlns=http://www.w3.org/2000/svg>${_`<path class="svg-color" d="M29.963 7.672a1.586 1.586 0 0 0-1.584-1.585h-5.274a.187.187 0 0 1-.188-.187V3.977A2 2 0 0 0 20.825 2h-9.672A2.095 2.095 0 0 0 9.06 4.093V5.9a.187.187 0 0 1-.187.187H3.598a1.586 1.586 0 0 0-1.584 1.585v4.016a.281.281 0 0 0 .281.28H4.9l.014-.013V9.153a.177.177 0 0 1 .177-.177h21.46a.456.456 0 0 1 .449.45v13.742A1.832 1.832 0 0 1 25.168 25h-8.892a.568.568 0 0 1-.534-.373 3.98 3.98 0 0 0-7.6.373H5.657a.757.757 0 0 1-.757-.757v-3.055A.188.188 0 0 0 4.714 21H2.028l-.014.014v4.58a2.35 2.35 0 0 0 2.347 2.346h4.161a3.963 3.963 0 0 0 6.8.256.569.569 0 0 1 .475-.256h12.065a2.102 2.102 0 0 0 2.101-2.101zM21 5.625a.375.375 0 0 1-.375.375h-9.25A.375.375 0 0 1 11 5.625V4.45a.456.456 0 0 1 .45-.45h9.1a.456.456 0 0 1 .45.45zM12 28a2 2 0 1 1 2-2 2 2 0 0 1-2 2z" /><path class="svg-color" d="M13.273 17.994a.57.57 0 0 1 .479.262A3.73 3.73 0 0 0 17 20a3.74 3.74 0 0 0 3.403-2.006h3.41a.188.188 0 0 0 .187-.188v-2.589a.187.187 0 0 0-.188-.188H20.8A3.8 3.8 0 0 0 17 12a4.058 4.058 0 0 0-3.69 2.647.568.568 0 0 1-.537.383H1.093a.094.094 0 0 0-.093.093V17.9a.094.094 0 0 0 .094.094zM17 13.9a2.1 2.1 0 1 1-2.1 2.1 2.1 2.1 0 0 1 2.1-2.1z" />`}</svg></div><calcite-label class="deployed-label-override" scale=s>${this._translations.deployedDate.replace("{{date}}",this.deployedDate)}</calcite-label></div>`}_getConfigureButton(){let t=this._configContextConsumer.value?.userSession?.username,i=this._configContextConsumer.value?.authentication?.CanUpdateSolution,a=this.card?.owner===t||this._isOrgAdmin||i,s=this.card?.owner===t||this._isOrgAdmin,n=a?"display-none":"";return r`<calcite-split-button appearance=outline aria-label=${this._translations.openSolution??h} dropdown-label=${this._translations.moreActions??h} kind=neutral @calciteSplitButtonPrimaryClick=${this._cardSelected} @click=${o=>o.stopPropagation()} @keydown=${o=>o.stopPropagation()} overlay-positioning=fixed primary-text=${this._translations.openSolution??h} width=full><calcite-dropdown-group selection-mode=none>${!this.isMobile&&r`<calcite-dropdown-item icon-start=model @click=${this._viewDiagram} @keydown=${o=>m(o,()=>this._viewDiagram(o))}>${this._translations.viewDiagram}</calcite-dropdown-item>`||""}<calcite-dropdown-item icon-start=file-text @click=${this._viewDocumentation} @keydown=${o=>m(o,()=>this._viewDocumentation(o))}>${this._translations.documentation}</calcite-dropdown-item><calcite-dropdown-item icon-start=information @click=${this._viewItemDetails} @keydown=${o=>m(o,()=>this._viewItemDetails(o))}>${this._translations.viewItemDetails}</calcite-dropdown-item>${!this.isMobile&&a&&r`<calcite-dropdown-item icon-start=edit-attributes id=solution-configure-titles-dropdown @click=${async()=>{this.templateInfos=await this._processTemplates(this.card),this._configureTitlesOpen=!0}} @keydown=${o=>m(o,async()=>{this.templateInfos=await this._processTemplates(this.card),this._configureTitlesOpen=!0})}>${this._translations.renameItems}</calcite-dropdown-item>`||""}${!this.isMobile&&s&&r`<calcite-dropdown-item icon-start=trash @click=${this._deleteSolution} @keydown=${o=>m(o,()=>this._deleteSolution(o))}>${this._translations.deleteSolution}</calcite-dropdown-item>`||""}</calcite-dropdown-group><calcite-tooltip class=${A(n)} overlay-positioning=fixed reference-element=solution-configure-titles-dropdown><span>${this._translations.mustOwnSolution}</span></calcite-tooltip></calcite-split-button>`}_renderDeleteDialog(){return this._isDeleteOpen?r`<solution-delete-dialog .card=${this.card} @solutionDeleteDialogOpen=${t=>{this._isDeleteOpen=t.detail}} .open=${this._isDeleteOpen} source="Card Dropdown" ${w(this._deleteDialogRef)}></solution-delete-dialog>`:""}_renderDiagramDialog(){return this._isDiagramOpen?r`<calcite-dialog class="dialog-y-size dialog-x-size panel-bg-color" .heading=${this._translations.diagramTitle.replace("{{solution}}",this.card?.title??"")} id=${this._translations.diagramTitle.replace("{{solution}}",this.card?.title??"")??h} modal .open=${this._isDiagramOpen} @calciteDialogClose=${()=>{this._isDiagramOpen=!1}} outside-close-disabled scale=m width=l ${w(this._diagramDialogRef)}><solution-item-diagram .diagramKey=${this.diagramKey} .templateInfoGraph=${this.templateInfoGraph} .typeKeywords=${this.card?.typeKeywords}></solution-item-diagram></calcite-dialog>`:""}_renderConfigureTitlesDialog(){return this._configureTitlesOpen?r`<solution-configure-titles .card=${this.card} @solutionConfigureTitlesBeforeClose=${async()=>{this._processTemplates(this.card).then(t=>{this.templateInfos=t}),this._configureTitlesOpen=!1}} @solutionItemsTitlesChanged=${async()=>{this._processTemplates(this.card).then(t=>{this.templateInfos=t})}} .open=${this._configureTitlesOpen} source="Card Dropdown" .templateInfos=${this.templateInfos}></solution-configure-titles>`:""}_cardSelected(){this.deployedCardSelected.emit({card:this.card,cardRef:this.el})}async _viewDiagram(t){t.stopPropagation(),this.card&&(this._telemetry?.logEvent({category:E.DEPLOYMENTS,action:"View Diagram",dimensions:[this.card.title||"",this.card.deployCommonId||"",this.card.deployVersion||"","Card Dropdown"]}),this.templateInfoGraph=await this._processTemplates(this.card),this._isDiagramOpen=!0)}_viewDocumentation(t){t.stopPropagation(),this._telemetry?.logEvent({category:E.DEPLOYMENTS,action:"Open Help",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Card Dropdown"]}),window.open(this.card.learnMoreUrl,"_blank")}_viewItemDetails(t){t.stopPropagation(),this._telemetry?.logEvent({category:E.DEPLOYMENTS,action:"Open Item Details",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Card Dropdown"]}),window.open(this.card.itemUrl,"_blank")}_deleteSolution(t){t.stopPropagation(),this._isDeleteOpen=!0}_openUserProfile(t){t.stopPropagation();let i=this._configContextConsumer.value?.authentication?.PortalSubset?.orgUrl;i&&window.open(`${i}/home/user.html?user=${this.owner}`,"_blank")}async _processTemplates(t){return await z(t.id,this._configContextConsumer.value.userSession)}_updateThumbnailToken(t){this._thumbnailUrl!==""&&(this._thumbnailUrl=Q(this._thumbnailUrl,t))}};O("solution-deployed-card",v);var Le=500,Ue={AEC:"Architecture, Engineering, and Construction (AEC)",AIRPORTPORTRAIL:"Airports, Ports, and Rails",BUSINESS:"Business",CONSERVATION:"Conservation",DEFENSE:"Defense",FACILITIES:"Facilities",HEALTHANDHUMANSERVICES:"Health and Human Services",PIPELINE:"Pipeline",PUBLICSAFETY:"Public Safety",RENEWABLES:"Renewables",STATEANDLOCALGOVERNMENT:"State and Local Government",TELECOMMUNICATIONS:"Telecommunications",UTILITIES:"Utilities"},Ge={AIRPORT:"Airports",AGRICULTURE:"Agriculture",ASSESSMENTANDTAXATION:"Assessment and Taxation",DISTRICTENERGY:"District Energy",ELECTIONS:"Elections",ELECTRIC:"Electric",EMERGENCYMANAGEMENT:"Emergency Management",ENVIRONMENTANDNATURALRESOURCES:"Environment and Natural Resources",FIRESERVICE:"Fire Service",FISHANDWILDLIFE:"Fish and Wildlife",GAS:"Gas",HEALTHANDHUMANSERVICES:"Health and Human Services",LAWENFORCEMENT:"Law Enforcement",NATURALRESOURCES:"Natural Resources",PARKS:"Parks",PLANNINGANDDEVELOPMENT:"Planning and Development",PROTECTEDAREAS:"Protected Areas",PUBLICWORKS:"Public Works",SEWER:"Sewer",STORMWATER:"Stormwater",TELECOMMUNICATIONS:"Telecommunications",TRANSPORTATION:"Transportation",WATER:"Water Distribution"},l=(e=>(e.HUBPREMIUM="solutions:hubPremium",e.NOTEBOOK="solutions:notebook",e.TRACKINGBASE="solutions:locationtracking",e.TRACKING="solutions:locationtracking:tracking",e.TRACKINGADMIN="solutions:locationtracking:admin",e.TRACKINGADMINANDTRACKING="solutions:locationtracking:admin:tracking",e.VELOCITY="solutions:velocity",e.WORKFLOW="solutions:workflowManager",e))(l||{}),X=(e=>(e.VELOCITYBIGDATA="portal:publisher:publishBigDataAnalytics",e.VELOCITYFEEDS="portal:publisher:publishFeeds",e.VELOCITYREALTIME="portal:publisher:publishRealTimeAnalytics",e))(X||{}),Be='((typekeywords:Solution,Deployed,"ArcGIS Solution") OR ((typekeywords:Solution,Deployed) AND (created:[1577862000000 TO 1622576880000])))',We="(typekeywords:Solution,Template)",Z="portal:user:addExternalMembersToGroup",ee="portal:user:createItem",P="portal:user:createGroup",te="portal:publisher:publishBigDataAnalytics",L="portal:publisher:publishFeatures",ie="portal:publisher:publishFeeds",ae="portal:publisher:publishServerGPServices",se="portal:publisher:publishRealTimeAnalytics",U="portal:user:shareToGroup",oe="solutions:hubPremium",ne="solutions:notebook",re="solutions:locationtracking:admin:tracking",le="solutions:locationtracking:tracking",ce="solutions:locationtracking:admin",de="solutions:velocity",ue="solutions:workflowManager",pe=250,E={SOLUTION_DETAILS:"Solution Details",GLOBAL_NAVIGATION:"Global Nav",ALL_SOLUTIONS:"Solutions",DEPLOYMENTS:"Deployments",ASSISTANT:"Assistant",RESOURCES:"Resources"},Fe={MINE:"My deployments",ORG:"Organization"};function he(e){let t="",i="?";return e.forEach(a=>{a.k&&a.v&&(t+=i+a.k+"="+a.v,i="&")}),t}function Ve(e){return e?M(e,{}).then(t=>Promise.resolve(!!t)):Promise.resolve(!1)}async function me(e,t){let i=t,a=await i.getUsername(),s={q:new k().match(e).in("title").and().match(a).in("owner"),filter:"type:Solution",authentication:i},n=(await R(s)).results.map(p=>p.title),{folders:o}=await C(i),d=o.map(p=>p.title),u=[...n,...d].map(p=>p.trim().toLowerCase()),c=e.toLowerCase(),f=u.filter(p=>p===c),F=u.filter(p=>p.startsWith(c));return{conflictingNames:f,similiarNames:F}}async function Ke(e,t){return ge(e)?{status:!1,type:"empty"}:fe(e)?{status:!1,type:"exceed length"}:be(e,"folder")?{status:!1,type:"special character"}:(await me(e.trim(),t)).conflictingNames.length>0?{status:!1,type:"not unique"}:{status:!0,type:""}}function ge(e){return e.length<=0}function fe(e){return e.length>pe}function be(e,t){return(t==="item"?/[><~`$^+=|]/u:/[/<>]/u).test(e)}function He(e){if(e){let t=e.trim();return t?"<div>"+t+"</div>":""}else return""}function we(e){let t="",i="?";return e.forEach(a=>{a.k&&a.v&&(t+=i+a.k+"="+a.v,i="&")}),t}function ze(e,t,i,a){let s="";return t?s=a+"/sharing/rest/content/items/"+e+"/info/"+t+we([{k:"w",v:"400"}]):s=i,s}function Ye(e){let t=e?e.replace("https://","").replace("www.",""):"";return t.endsWith("devext.arcgis.com")||t.endsWith("mapsqa.arcgis.com")||t.endsWith("qaext.arcgis.com")?e??"https://www.arcgis.com":"https://www.arcgis.com"}function qe(e,t,i){return t.some(a=>a.wkid===e?(i=a.defaultExtent,!0):!1),i}function Je(e,t){return ye(t||e)}function je(e,t="en"){return new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"numeric"}).format(e)}function Qe(e,t){let i="";return e.some(a=>a.startsWith(t)?(i=a.substring(t.length),!0):!1),i}function ye(e){let t=e.replace("www.","");return t.endsWith("devext.arcgis.com")?"dev":t.endsWith("mapsqa.arcgis.com")||t.endsWith("qaext.arcgis.com")?"qa":t==="arcgis.com"||t.endsWith(".arcgis.com")?"prod":"dev"}function Xe(e,t){let i=e?.reduce((a,s)=>(a.indexOf(s.id)<0&&a.push(s.id),a),[])||[];return t?i.sort((a,s)=>t.indexOf(a)-t.indexOf(s)):i}function Ze(e){return e.charAt(0).toUpperCase()+e.slice(1)}function et(e){return{relevance:"Relevance",title:"Title",new:"New",created:"Date deployed",updated:"Updated",suggested:"Suggested for you"}[e]||e}function tt(e){if(!e)return"Unknown error";if(e.message)return e.message;try{let t=JSON.stringify(e);return t&&t!=="{}"?t:e.toString()}catch{return e.toString()}}function it(e){return e?parseFloat(((Date.now()-e)/1e3).toFixed(2)):0}function m(e,t){(e.key==="Enter"||e.code==="NumpadEnter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),t())}return{a:V,b:K,c:z,d:$e,e:G,f:Re,g:Me,h:Pe,i:Q,j:v,k:Le,l:Ue,m:Ge,n:l,o:X,p:Be,q:We,r:pe,s:E,t:Fe,u:Ve,v:me,w:Ke,x:be,y:He,z:we,A:ze,B:Ye,C:qe,D:Je,E:je,F:Qe,G:Xe,H:Ze,I:et,J:tt,K:it,L:m}},"intl","identity/IdentityManager","identity/OAuthInfo","portal/Portal")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as u}from"./Z73DPA3J.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as f}from"./7JVIFSRF.js";import{F as l,G as n,H as m,J as d,K as b,h as c,i as a,r as p}from"./46DQNAMV.js";import"./OR4HXHSY.js";var _=c`:host{display:block;--solutions-theme-foreground-color: var(--calcite-color-foreground-1);width:100%}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-bottom-width:1px!important;border-width:0px}.border-bottom-2{border-bottom-width:2px!important;border-width:0px}.border-solid{border-style:solid;border-color:var(--calcite-color-border-3)}.border-left-right{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{display:flex;flex-direction:column;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000}.display-none{display:none}.adjusted-height{max-height:calc(100% - 68px);overflow-y:auto}.position-absolute{position:absolute}.position-relative{position:relative}.popover-map-list{overflow:auto;width:250px}.max-width-200{max-width:200px}.min-width-150{min-width:150px}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}`,h=class extends m{constructor(){super(),this.mapInfos=[],this.isMapLayout=!1,this.showMapListInPopover=!1,this.referenceElement="",this.selectedWebMapId="",this._mapListExpanded=!1,this._isValidWebMap=!0,this._translations=u({name:"map-picker",blocking:!0}),this._list=l(),this._loadedId="",this._skipEditCheck=!1,this._popover=l(),this._mapPickerButton=l(),this.beforeMapInfoChange=p(),this.mapInfoChange=p(),this.listenOn(window,"mapChanged",this.mapChanged)}static{this.properties={mapInfos:0,isMapLayout:5,height:9,showMapListInPopover:5,referenceElement:1,selectedWebMapId:1,_mapListExpanded:16,_isValidWebMap:16,_translations:16}}static{this.styles=_}willUpdate(t){t.has("mapInfos")&&this.hasUpdated&&this.mapInfosWatchHandler(this.mapInfos,t.get("mapInfos")),t.has("selectedWebMapId")&&this.hasUpdated&&this.selectedWebMapIdWatchHandler(this.selectedWebMapId)}_webMapInfoWatchHandler(t,e){t&&JSON.stringify(t)!==JSON.stringify(e)&&(this._loadedId=t?.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,e){if(t&&JSON.stringify(t)!==JSON.stringify(e)){let i=this._getWebMapInfo();this._webMapSelected(i)}}async selectedWebMapIdWatchHandler(t){this._loadedId=t}async setMapByID(t,e=!1){this._skipEditCheck=e;let i=this.mapInfos?.filter(s=>s.id===t);t&&i?.length>0&&this._webMapSelected(i[0]),this._skipEditCheck=!1}async close(){this._mapListExpanded&&(this._mapListExpanded=!1)}async toggle(t){this._mapListExpanded=t}async mapChanged(t){let e=t.detail.isValid;this._isValidWebMap=e}render(){return a`${!this.showMapListInPopover&&this._getToolbar()||""}${this.showMapListInPopover?this._getMapListPopover():this._getMapNameList(this._mapListExpanded)}`}loaded(){let t=this._getWebMapInfo();t&&this._webMapSelected(t)}_getMapPicker(){let t="map-picker-expand-toggle",e=this._mapListExpanded?"chevron-up":"chevron-down",i=this.isMapLayout?"":"position-absolute",s=this.isMapLayout?"max-width-200":"width-full",r=this._isValidWebMap?"map":"exclamation-mark-triangle";return a`<div class=${d(s)}><calcite-button alignment=icon-end-space-between appearance=transparent class=${`width-full height-full ${i}`} .iconEnd=${e} .iconStart=${r} id=${t} kind=neutral @click=${()=>this._chooseMap()} width=full ${n(this._mapPickerButton)}>${this._getWebMapInfo().name}</calcite-button><calcite-tooltip placement=bottom .referenceElement=${t}><span>${this._translations.switchMap}</span></calcite-tooltip></div>`}_getToolbar(){let t=this.isMapLayout?"border-bottom-1":"border-bottom-2",e=this.isMapLayout?"":"position-relative";return a`<div class=${`display-flex border-left-right ${e}`}><calcite-action-bar class=${`border-solid action-bar-size overflow-hidden ${t}`} expand-disabled layout=horizontal slot=header>${this._getMapPicker()}${this._updateMapPickerIconColor()}</calcite-action-bar></div>`}_updateMapPickerIconColor(){this._mapPickerButton.value?.componentOnReady().then(()=>{let t=this._mapPickerButton.value?.shadowRoot?.lastChild,e=null;if(t&&t instanceof HTMLElement){let i=t.getElementsByClassName("icon icon--start");i.length>0&&(e=i[0])}e&&(this._isValidWebMap?e.style.setProperty("color","var(--calcite-color-text-1)"):e.style.setProperty("color","var(--calcite-color-status-danger)"))})}_getMapNameList(t){let e=this.showMapListInPopover?"position-relative":"position-absolute",i=this.isMapLayout?"max-width-200 min-width-150":"width-full",s=this.isMapLayout?"border-bottom-1":"border-bottom-2",r=t?`map-list border-solid ${s} adjusted-height ${i} ${e}`:"display-none";return a`<div class=${d(r)}><calcite-list id=mapList label selection-appearance=border selection-mode=single-persist ${n(this._list)}>${this.mapInfos.map(o=>a`<calcite-list-item .label=${o.name} @click=${()=>this._webMapSelected(o)} .selected=${o.id===this._loadedId} .value=${o.id}></calcite-list-item>`)}</calcite-list></div>`}_getMapListPopover(){let t=this.height&&this.height>0&&this.showMapListInPopover?{"max-height":`${this.height.toString()}px`}:{};return a`<calcite-popover auto-close focus-trap-disabled .label=${this.referenceElement} placement=left .referenceElement=${this.referenceElement} ${n(this._popover)}><div style=${b(t)} class=popover-map-list>${this._getMapNameList(!0)}</div></calcite-popover>`}_getWebMapInfo(){let t=this.mapInfos.find(e=>this.selectedWebMapId===e.id);if(!t&&this.mapInfos.length>0&&(t=this.mapInfos[0]),!t)throw new Error("No valid web map info available");return t}_webMapSelected(t){let e=this._loadedId;this._loadedId=t.id;let i=!1;this._skipEditCheck?i=!0:this.beforeMapInfoChange.emit({currentId:e,mapInfo:t,ref:this.el}).defaultPrevented||(i=!0),i&&(this._webMapInfoWatchHandler(t,this._webMapInfo),this._webMapInfo=t),this._popover.value&&(this._popover.value.open=!1),this._mapListExpanded=!1}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}};f("map-picker",h);export{h as MapPicker};
2
+ import{a as u}from"./HYX7BODW.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as f}from"./B2DK4LWH.js";import{F as l,G as n,H as m,J as d,K as b,h as c,i as a,r as p}from"./46DQNAMV.js";import"./OR4HXHSY.js";var _=c`:host{display:block;--solutions-theme-foreground-color: var(--calcite-color-foreground-1);width:100%}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-bottom-width:1px!important;border-width:0px}.border-bottom-2{border-bottom-width:2px!important;border-width:0px}.border-solid{border-style:solid;border-color:var(--calcite-color-border-3)}.border-left-right{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{display:flex;flex-direction:column;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000}.display-none{display:none}.adjusted-height{max-height:calc(100% - 68px);overflow-y:auto}.position-absolute{position:absolute}.position-relative{position:relative}.popover-map-list{overflow:auto;width:250px}.max-width-200{max-width:200px}.min-width-150{min-width:150px}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}`,h=class extends m{constructor(){super(),this.mapInfos=[],this.isMapLayout=!1,this.showMapListInPopover=!1,this.referenceElement="",this.selectedWebMapId="",this._mapListExpanded=!1,this._isValidWebMap=!0,this._translations=u({name:"map-picker",blocking:!0}),this._list=l(),this._loadedId="",this._skipEditCheck=!1,this._popover=l(),this._mapPickerButton=l(),this.beforeMapInfoChange=p(),this.mapInfoChange=p(),this.listenOn(window,"mapChanged",this.mapChanged)}static{this.properties={mapInfos:0,isMapLayout:5,height:9,showMapListInPopover:5,referenceElement:1,selectedWebMapId:1,_mapListExpanded:16,_isValidWebMap:16,_translations:16}}static{this.styles=_}willUpdate(t){t.has("mapInfos")&&this.hasUpdated&&this.mapInfosWatchHandler(this.mapInfos,t.get("mapInfos")),t.has("selectedWebMapId")&&this.hasUpdated&&this.selectedWebMapIdWatchHandler(this.selectedWebMapId)}_webMapInfoWatchHandler(t,e){t&&JSON.stringify(t)!==JSON.stringify(e)&&(this._loadedId=t?.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,e){if(t&&JSON.stringify(t)!==JSON.stringify(e)){let i=this._getWebMapInfo();this._webMapSelected(i)}}async selectedWebMapIdWatchHandler(t){this._loadedId=t}async setMapByID(t,e=!1){this._skipEditCheck=e;let i=this.mapInfos?.filter(s=>s.id===t);t&&i?.length>0&&this._webMapSelected(i[0]),this._skipEditCheck=!1}async close(){this._mapListExpanded&&(this._mapListExpanded=!1)}async toggle(t){this._mapListExpanded=t}async mapChanged(t){let e=t.detail.isValid;this._isValidWebMap=e}render(){return a`${!this.showMapListInPopover&&this._getToolbar()||""}${this.showMapListInPopover?this._getMapListPopover():this._getMapNameList(this._mapListExpanded)}`}loaded(){let t=this._getWebMapInfo();t&&this._webMapSelected(t)}_getMapPicker(){let t="map-picker-expand-toggle",e=this._mapListExpanded?"chevron-up":"chevron-down",i=this.isMapLayout?"":"position-absolute",s=this.isMapLayout?"max-width-200":"width-full",r=this._isValidWebMap?"map":"exclamation-mark-triangle";return a`<div class=${d(s)}><calcite-button alignment=icon-end-space-between appearance=transparent class=${`width-full height-full ${i}`} .iconEnd=${e} .iconStart=${r} id=${t} kind=neutral @click=${()=>this._chooseMap()} width=full ${n(this._mapPickerButton)}>${this._getWebMapInfo().name}</calcite-button><calcite-tooltip placement=bottom .referenceElement=${t}><span>${this._translations.switchMap}</span></calcite-tooltip></div>`}_getToolbar(){let t=this.isMapLayout?"border-bottom-1":"border-bottom-2",e=this.isMapLayout?"":"position-relative";return a`<div class=${`display-flex border-left-right ${e}`}><calcite-action-bar class=${`border-solid action-bar-size overflow-hidden ${t}`} expand-disabled layout=horizontal slot=header>${this._getMapPicker()}${this._updateMapPickerIconColor()}</calcite-action-bar></div>`}_updateMapPickerIconColor(){this._mapPickerButton.value?.componentOnReady().then(()=>{let t=this._mapPickerButton.value?.shadowRoot?.lastChild,e=null;if(t&&t instanceof HTMLElement){let i=t.getElementsByClassName("icon icon--start");i.length>0&&(e=i[0])}e&&(this._isValidWebMap?e.style.setProperty("color","var(--calcite-color-text-1)"):e.style.setProperty("color","var(--calcite-color-status-danger)"))})}_getMapNameList(t){let e=this.showMapListInPopover?"position-relative":"position-absolute",i=this.isMapLayout?"max-width-200 min-width-150":"width-full",s=this.isMapLayout?"border-bottom-1":"border-bottom-2",r=t?`map-list border-solid ${s} adjusted-height ${i} ${e}`:"display-none";return a`<div class=${d(r)}><calcite-list id=mapList label selection-appearance=border selection-mode=single-persist ${n(this._list)}>${this.mapInfos.map(o=>a`<calcite-list-item .label=${o.name} @click=${()=>this._webMapSelected(o)} .selected=${o.id===this._loadedId} .value=${o.id}></calcite-list-item>`)}</calcite-list></div>`}_getMapListPopover(){let t=this.height&&this.height>0&&this.showMapListInPopover?{"max-height":`${this.height.toString()}px`}:{};return a`<calcite-popover auto-close focus-trap-disabled .label=${this.referenceElement} placement=left .referenceElement=${this.referenceElement} ${n(this._popover)}><div style=${b(t)} class=popover-map-list>${this._getMapNameList(!0)}</div></calcite-popover>`}_getWebMapInfo(){let t=this.mapInfos.find(e=>this.selectedWebMapId===e.id);if(!t&&this.mapInfos.length>0&&(t=this.mapInfos[0]),!t)throw new Error("No valid web map info available");return t}_webMapSelected(t){let e=this._loadedId;this._loadedId=t.id;let i=!1;this._skipEditCheck?i=!0:this.beforeMapInfoChange.emit({currentId:e,mapInfo:t,ref:this.el}).defaultPrevented||(i=!0),i&&(this._webMapInfoWatchHandler(t,this._webMapInfo),this._webMapInfo=t),this._popover.value&&(this._popover.value.open=!1),this._mapListExpanded=!1}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}};f("map-picker",h);export{h as MapPicker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as k}from"./LLYTIOG4.js";import{b as y}from"./PZ4L77M5.js";import{a as _}from"./Z73DPA3J.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as m}from"./7JVIFSRF.js";import{F as d,G as p,H as g,J as h,h as c,i as l,r as a,u as n}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([w,b,u])=>{var v=c`@layer{:host{display:block}.border{outline:1px solid var(--calcite-color-border-input)}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=rtl]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:Avenir Next,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v: 12px;--esri-widget-padding-h: 15px;--esri-widget-padding: var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0;justify-content:flex-start!important}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-responsive-toolbar__bar--horizontal{--calcite-action-group-border-color: var(--calcite-color-border-3) !important}}`,r=class extends g{constructor(){super(...arguments),this.active=!1,this.drawMode="SKETCH",this.editGraphicsEnabled=!0,this.graphics=[],this.redoEnabled=!1,this.undoEnabled=!1,this._translations=_({name:"map-draw-tools",blocking:!0}),this._pnContextConsumer=y({context:k,subscribe:!0}),this._sketchElement=d(),this.selectionLoadingChange=a(),this.sketchGraphicsChange=a(),this.drawUndo=a(),this.drawRedo=a()}static{this.properties={active:5,drawMode:1,editGraphicsEnabled:5,graphics:0,mapView:0,pointSymbol:0,polylineSymbol:0,polygonSymbol:0,redoEnabled:5,undoEnabled:5,_translations:16,_selectionMode:16}}static{this.styles=v}static{this.shadowRootOptions=n}willUpdate(e){e.has("graphics")&&this.graphicsWatchHandler(this.graphics,e.get("graphics")),e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView,e.get("mapView"))}graphicsWatchHandler(e,i){e&&e.length>0&&JSON.stringify(e)!==JSON.stringify(i)&&this._sketchGraphicsLayer&&(this._updateGraphicsSymbols(e),this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(e))}mapViewWatchHandler(e,i){e&&e!==i&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}loaded(){this._init()}disconnectedCallback(){super.disconnectedCallback(),this._sketchWidget?.cancel(),this._clearSketch()}render(){let e=this.drawMode==="SKETCH"?"border":"border esri-widget esri-sketch__panel",i=this.drawMode==="SKETCH"?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return l`<div class=${h(e)}><div ${p(this._sketchElement)}></div><div class=${h(i)}><calcite-action appearance=solid .disabled=${!this.undoEnabled} icon=undo @click=${()=>this._undo()} scale=s .text=${this._translations.undo}></calcite-action><calcite-action appearance=solid .disabled=${!this.redoEnabled} icon=redo @click=${()=>this._redo()} scale=s .text=${this._translations.redo}></calcite-action></div></div>`}_init(){this.mapView&&this._sketchElement.value&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){let e=this._pnContextConsumer.value,i=this._translations.sketchLayer;if(this.mapView){let s=this.mapView.map.layers.findIndex(t=>t.title===i);s>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(s):(this._sketchGraphicsLayer=new w({title:i,listMode:"hide"}),this._sketchGraphicsLayer&&(e.managedLayers[i]="sketch",this.mapView.map.layers.add(this._sketchGraphicsLayer))),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer&&this._sketchGraphicsLayer.addMany(this.graphics)}}_initSketch(){let e={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};if(this._sketchWidget=new u({...e,container:this._sketchElement.value,creationMode:"single",toolbarKind:"docked",useLegacyCreateTools:!0,visibleElements:{duplicateButton:!1,selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode==="SKETCH"}}),this._sketchWidget&&this._sketchWidget.viewModel){this._sketchViewModel=new b({...e}),this.polylineSymbol&&(this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol),this.pointSymbol&&(this._sketchWidget.viewModel.pointSymbol=this.pointSymbol),this.polygonSymbol&&(this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol),this._sketchWidget?.when(async()=>{await new Promise(t=>setTimeout(t,50)),this._sketchElement.value?.getElementsByTagName("calcite-popover")[0]?.setAttribute("placement","auto")});let i=!1;this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("create",t=>{t.state==="complete"&&(this.graphics=t.graphic?[t.graphic]:[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}),this.drawMode==="REFINE"&&(i=!0,this._sketchWidget?.viewModel.create(t.tool))),t.state==="cancel"&&this.drawMode==="REFINE"&&i&&(i=!i,this._sketchWidget?.viewModel.create(t.tool))}));let s;this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("update",t=>{if(!this.editGraphicsEnabled)this._sketchWidget?.viewModel.cancel(),this._sketchViewModel?.cancel();else{let o=t?.toolEventInfo?.type;(o==="move"||o==="reshape-stop"||o==="move-stop")&&(clearTimeout(s),s=window.setTimeout(async()=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})},1e3))}})),this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("delete",()=>{this.graphics=[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("undo",t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("redo",t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})}))}}_clearSketch(){this._sketchWidget?.viewModel.cancel(),this.graphics=[],this._sketchGraphicsLayer?.removeAll()}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout(()=>{this.graphics.length===1&&this._sketchWidget&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})},100)}_updateGraphicsSymbols(e){let i=e[0]?.geometry?.type,s=i==="point"?this.pointSymbol:i==="polyline"?this.polylineSymbol:i==="polygon"?this.polygonSymbol:void 0;s&&e.forEach(t=>t.symbol=s)}};m("map-draw-tools",r);return r},"layers/GraphicsLayer","widgets/Sketch/SketchViewModel","widgets/Sketch")
2
+ import{a as k}from"./LLYTIOG4.js";import{b as y}from"./PZ4L77M5.js";import{a as _}from"./HYX7BODW.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as m}from"./B2DK4LWH.js";import{F as d,G as p,H as g,J as h,h as c,i as l,r as a,u as n}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([w,b,u])=>{var v=c`@layer{:host{display:block}.border{outline:1px solid var(--calcite-color-border-input)}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=rtl]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:Avenir Next,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v: 12px;--esri-widget-padding-h: 15px;--esri-widget-padding: var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0;justify-content:flex-start!important}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-responsive-toolbar__bar--horizontal{--calcite-action-group-border-color: var(--calcite-color-border-3) !important}}`,r=class extends g{constructor(){super(...arguments),this.active=!1,this.drawMode="SKETCH",this.editGraphicsEnabled=!0,this.graphics=[],this.redoEnabled=!1,this.undoEnabled=!1,this._translations=_({name:"map-draw-tools",blocking:!0}),this._pnContextConsumer=y({context:k,subscribe:!0}),this._sketchElement=d(),this.selectionLoadingChange=a(),this.sketchGraphicsChange=a(),this.drawUndo=a(),this.drawRedo=a()}static{this.properties={active:5,drawMode:1,editGraphicsEnabled:5,graphics:0,mapView:0,pointSymbol:0,polylineSymbol:0,polygonSymbol:0,redoEnabled:5,undoEnabled:5,_translations:16,_selectionMode:16}}static{this.styles=v}static{this.shadowRootOptions=n}willUpdate(e){e.has("graphics")&&this.graphicsWatchHandler(this.graphics,e.get("graphics")),e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView,e.get("mapView"))}graphicsWatchHandler(e,i){e&&e.length>0&&JSON.stringify(e)!==JSON.stringify(i)&&this._sketchGraphicsLayer&&(this._updateGraphicsSymbols(e),this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(e))}mapViewWatchHandler(e,i){e&&e!==i&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}loaded(){this._init()}disconnectedCallback(){super.disconnectedCallback(),this._sketchWidget?.cancel(),this._clearSketch()}render(){let e=this.drawMode==="SKETCH"?"border":"border esri-widget esri-sketch__panel",i=this.drawMode==="SKETCH"?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return l`<div class=${h(e)}><div ${p(this._sketchElement)}></div><div class=${h(i)}><calcite-action appearance=solid .disabled=${!this.undoEnabled} icon=undo @click=${()=>this._undo()} scale=s .text=${this._translations.undo}></calcite-action><calcite-action appearance=solid .disabled=${!this.redoEnabled} icon=redo @click=${()=>this._redo()} scale=s .text=${this._translations.redo}></calcite-action></div></div>`}_init(){this.mapView&&this._sketchElement.value&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){let e=this._pnContextConsumer.value,i=this._translations.sketchLayer;if(this.mapView){let s=this.mapView.map.layers.findIndex(t=>t.title===i);s>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(s):(this._sketchGraphicsLayer=new w({title:i,listMode:"hide"}),this._sketchGraphicsLayer&&(e.managedLayers[i]="sketch",this.mapView.map.layers.add(this._sketchGraphicsLayer))),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer&&this._sketchGraphicsLayer.addMany(this.graphics)}}_initSketch(){let e={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};if(this._sketchWidget=new u({...e,container:this._sketchElement.value,creationMode:"single",toolbarKind:"docked",useLegacyCreateTools:!0,visibleElements:{duplicateButton:!1,selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode==="SKETCH"}}),this._sketchWidget&&this._sketchWidget.viewModel){this._sketchViewModel=new b({...e}),this.polylineSymbol&&(this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol),this.pointSymbol&&(this._sketchWidget.viewModel.pointSymbol=this.pointSymbol),this.polygonSymbol&&(this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol),this._sketchWidget?.when(async()=>{await new Promise(t=>setTimeout(t,50)),this._sketchElement.value?.getElementsByTagName("calcite-popover")[0]?.setAttribute("placement","auto")});let i=!1;this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("create",t=>{t.state==="complete"&&(this.graphics=t.graphic?[t.graphic]:[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}),this.drawMode==="REFINE"&&(i=!0,this._sketchWidget?.viewModel.create(t.tool))),t.state==="cancel"&&this.drawMode==="REFINE"&&i&&(i=!i,this._sketchWidget?.viewModel.create(t.tool))}));let s;this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("update",t=>{if(!this.editGraphicsEnabled)this._sketchWidget?.viewModel.cancel(),this._sketchViewModel?.cancel();else{let o=t?.toolEventInfo?.type;(o==="move"||o==="reshape-stop"||o==="move-stop")&&(clearTimeout(s),s=window.setTimeout(async()=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})},1e3))}})),this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("delete",()=>{this.graphics=[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("undo",t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("redo",t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})}))}}_clearSketch(){this._sketchWidget?.viewModel.cancel(),this.graphics=[],this._sketchGraphicsLayer?.removeAll()}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout(()=>{this.graphics.length===1&&this._sketchWidget&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})},100)}_updateGraphicsSymbols(e){let i=e[0]?.geometry?.type,s=i==="point"?this.pointSymbol:i==="polyline"?this.polylineSymbol:i==="polygon"?this.polygonSymbol:void 0;s&&e.forEach(t=>t.symbol=s)}};m("map-draw-tools",r);return r},"layers/GraphicsLayer","widgets/Sketch/SketchViewModel","widgets/Sketch")