@esri/solutions-components 0.7.18 → 0.7.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-alert_3.cjs.entry.js +93 -6
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +1 -1
- package/dist/cjs/card-manager_3.cjs.entry.js +12 -5
- package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -3
- package/dist/cjs/{downloadUtils-8f50633d.js → downloadUtils-9a13c6ac.js} +19 -14
- package/dist/cjs/{index.es-140aa937.js → index.es-284a020c.js} +2 -2
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/{mapViewUtils-569e9644.js → mapViewUtils-8aa325de.js} +4 -1
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solution-contents_3.cjs.entry.js +4 -4
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +4 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +3 -2
- package/dist/collection/components/edit-card/edit-card.js +1 -2
- package/dist/collection/components/info-card/info-card.js +3 -3
- package/dist/collection/components/layer-table/layer-table.css +4 -0
- package/dist/collection/components/layer-table/layer-table.js +9 -2
- package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +4 -4
- package/dist/collection/utils/downloadUtils.js +17 -12
- package/dist/collection/utils/downloadUtils.ts +20 -12
- package/dist/collection/utils/interfaces.ts +5 -0
- package/dist/collection/utils/popupUtils.js +94 -0
- package/dist/collection/utils/popupUtils.ts +104 -0
- package/dist/collection/utils/queryUtils.js +4 -1
- package/dist/collection/utils/queryUtils.ts +5 -1
- package/dist/components/crowdsource-manager.js +4 -3
- package/dist/components/downloadUtils.js +17 -12
- package/dist/components/edit-card2.js +1 -2
- package/dist/components/info-card2.js +91 -3
- package/dist/components/layer-table2.js +10 -3
- package/dist/components/queryUtils.js +4 -1
- package/dist/components/solution-item-sharing2.js +1 -1
- package/dist/components/solution-spatial-ref2.js +4 -4
- package/dist/esm/calcite-alert_3.entry.js +93 -6
- package/dist/esm/calcite-combobox_6.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +1 -1
- package/dist/esm/card-manager_3.entry.js +12 -5
- package/dist/esm/crowdsource-manager.entry.js +4 -3
- package/dist/esm/{downloadUtils-9dee8bc0.js → downloadUtils-a4bbdb1d.js} +19 -14
- package/dist/esm/{index.es-54e86c8e.js → index.es-48fdb288.js} +2 -2
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/{mapViewUtils-066602d5.js → mapViewUtils-8fe70944.js} +4 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solution-contents_3.entry.js +4 -4
- package/dist/solutions-components/{p-d0c4572d.entry.js → p-1d56804c.entry.js} +18 -2
- package/dist/solutions-components/p-24b3ad7d.entry.js +6 -0
- package/dist/solutions-components/{p-6656c53e.entry.js → p-2abc02a1.entry.js} +1 -1
- package/dist/solutions-components/{p-825c045a.entry.js → p-2ddd9cf8.entry.js} +1 -1
- package/dist/solutions-components/{p-e8011829.entry.js → p-48a5ae32.entry.js} +1 -1
- package/dist/solutions-components/{p-dfdb8411.js → p-72dbfa77.js} +1 -1
- package/dist/solutions-components/{p-683cded6.entry.js → p-b1422b00.entry.js} +1 -1
- package/dist/solutions-components/p-b5d1b979.js +36 -0
- package/dist/solutions-components/{p-e405f393.entry.js → p-cf24ce53.entry.js} +1 -1
- package/dist/solutions-components/{p-1bdd64a0.js → p-d4afcf86.js} +4 -4
- package/dist/solutions-components/{p-f486c86d.entry.js → p-fdb1ace8.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.css +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +20 -12
- package/dist/solutions-components/utils/interfaces.ts +5 -0
- package/dist/solutions-components/utils/popupUtils.ts +104 -0
- package/dist/solutions-components/utils/queryUtils.ts +5 -1
- package/dist/types/components/info-card/info-card.d.ts +5 -0
- package/dist/types/utils/downloadUtils.d.ts +3 -3
- package/dist/types/utils/interfaces.d.ts +4 -0
- package/dist/types/utils/popupUtils.d.ts +46 -0
- package/dist/types/utils/queryUtils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/solutions-components/p-531d91d6.js +0 -36
- package/dist/solutions-components/p-8ca5d651.entry.js +0 -6
@@ -3,9 +3,25 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as i,h as e,H as s,g as o}from"./p-78780f63.js";import{u as a,t as n,g as l,x as r}from"./p-ca97465b.js";import{g as c}from"./p-0c07ad8a.js";import{s as h,a as d,c as p}from"./p-f10944e6.js";import{c as u,d as m,n as g}from"./p-ede84883.js";import{o as v}from"./p-653af7e0.js";import{c as f,s as b,d as w,u as y}from"./p-79ba73cb.js";import{K as k}from"./p-568822d4.js";import{l as x}from"./p-48ff9cea.js";import{g as z}from"./p-6b943f52.js";import{m as C}from"./p-
|
6
|
+
import{r as t,c as i,h as e,H as s,g as o}from"./p-78780f63.js";import{u as a,t as n,g as l,x as r}from"./p-ca97465b.js";import{g as c}from"./p-0c07ad8a.js";import{s as h,a as d,c as p}from"./p-f10944e6.js";import{c as u,d as m,n as g}from"./p-ede84883.js";import{o as v}from"./p-653af7e0.js";import{c as f,s as b,d as w,u as y}from"./p-79ba73cb.js";import{K as k}from"./p-568822d4.js";import{l as x}from"./p-48ff9cea.js";import{g as z}from"./p-6b943f52.js";import{m as C}from"./p-b5d1b979.js";import"./p-fcefdfff.js";import"./p-29d68474.js";import"./p-1e2ffee3.js";import"./p-5b566d55.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-4af32c75.js";
|
7
7
|
/*!
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
10
10
|
* v2.0.0
|
11
|
-
*/const _={slow:14e3,medium:1e4,fast:6e3},j="container",q=class{constructor(e){t(this,e),this.calciteAlertBeforeClose=i(this,"calciteAlertBeforeClose",6),this.calciteAlertClose=i(this,"calciteAlertClose",6),this.calciteAlertBeforeOpen=i(this,"calciteAlertBeforeOpen",6),this.calciteAlertOpen=i(this,"calciteAlertOpen",6),this.calciteInternalAlertSync=i(this,"calciteInternalAlertSync",6),this.calciteInternalAlertRegister=i(this,"calciteInternalAlertRegister",6),this.autoCloseTimeoutId=null,this.totalOpenTime=0,this.totalHoverTime=0,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t},this.closeAlert=()=>{this.autoCloseTimeoutId=null,this.queued=!1,this.open=!1,this.queue=this.queue.filter((t=>t!==this.el)),this.determineActiveAlert(),this.calciteInternalAlertSync.emit({queue:this.queue})},this.actionsEndSlotChangeHandler=t=>{this.hasEndActions=a(t)},this.handleMouseOver=()=>{window.clearTimeout(this.autoCloseTimeoutId),this.totalOpenTime=Date.now()-this.initialOpenTime,this.lastMouseOverBegin=Date.now()},this.handleMouseLeave=()=>{const t=Date.now()-this.lastMouseOverBegin,i=_[this.autoCloseDuration]-this.totalOpenTime+this.totalHoverTime;this.totalHoverTime=this.totalHoverTime?t+this.totalHoverTime:t,this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),i)},this.open=!1,this.autoClose=!1,this.autoCloseDuration="medium",this.kind="brand",this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.numberingSystem=void 0,this.placement="bottom",this.scale="m",this.messages=void 0,this.messageOverrides=void 0,this.slottedInShell=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.hasEndActions=!1,this.queue=[],this.queueLength=0,this.queued=!1}openHandler(){v(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.open||(this.queue=this.queue.filter((t=>t!==this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}))}onMessagesChange(){}updateDuration(){this.autoClose&&this.autoCloseTimeoutId&&(window.clearTimeout(this.autoCloseTimeoutId),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),_[this.autoCloseDuration]))}connectedCallback(){u(this),f(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit()}async componentWillLoad(){h(this),await b(this),this.open&&v(this)}componentDidLoad(){d(this)}disconnectedCallback(){window.dispatchEvent(new CustomEvent("calciteInternalAlertUnregister",{detail:{alert:this.el}})),window.clearTimeout(this.autoCloseTimeoutId),window.clearTimeout(this.queueTimeout),m(this),w(this),this.slottedInShell=!1}render(){g.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"};const{open:t,autoClose:i,label:o,placement:a,queued:l}=this,c=i?"alert":"alertdialog",h=!t,d=r(k,this.icon,this.kind),p=this.queueLength>1;return e(s,{"aria-hidden":n(h),"aria-label":o,"calcite-hydrated-hidden":h,role:c},e("div",{class:{[j]:!0,"container--queued":l,[`${j}--${a}`]:!0,"container--slotted-in-shell":this.slottedInShell},onPointerEnter:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseOver:null,onPointerLeave:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseLeave:null,ref:this.setTransitionEl},d&&this.renderIcon(d),e("div",{class:"text-container"},e("slot",{name:"title"}),e("slot",{name:"message"}),e("slot",{name:"link"})),this.renderActionsEnd(),p?this.renderQueueCount():null,this.renderCloseButton(),t&&!l&&i?e("div",{class:"dismiss-progress"}):null))}renderCloseButton(){return e("button",{"aria-label":this.messages.close,class:"close",key:"close",onClick:this.closeAlert,type:"button",ref:t=>this.closeButton=t},e("calcite-icon",{icon:"x",scale:c(this.scale)}))}renderQueueCount(){const t=g.numberFormatter.format(this.queueLength>2?this.queueLength-1:1);return e("div",{class:{"queue-count":!0,"queue-count--active":this.queueLength>1},key:"queue-count"},e("calcite-chip",{scale:this.scale,value:t},t))}renderActionsEnd(){return e("div",{class:"actions-end"},e("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderIcon(t){return e("div",{class:"icon"},e("calcite-icon",{flipRtl:this.iconFlipRtl,icon:t,scale:c(this.scale)}))}alertSync(t){this.queue!==t.detail.queue&&(this.queue=t.detail.queue),this.queueLength=this.queue.length,this.determineActiveAlert(),t.stopPropagation()}alertRegister(){this.open&&!this.queue.includes(this.el)&&(this.queued=!0,this.queue.push(this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}),this.determineActiveAlert()}alertUnregister(t){const i=this.queue.filter((i=>i!==t.detail.alert));this.queue=i,window.dispatchEvent(new CustomEvent("calciteInternalAlertSync",{detail:{queue:i}}))}async setFocus(){await p(this);const t=l(this.el,{selector:"calcite-link"});if(this.closeButton||t)return t?t.setFocus():void(this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){y(this,this.effectiveLocale)}determineActiveAlert(){var t;(null===(t=this.queue)||void 0===t?void 0:t[0])===this.el&&(this.openAlert(),this.autoClose&&!this.autoCloseTimeoutId&&(this.initialOpenTime=Date.now(),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),_[this.autoCloseDuration])))}onBeforeOpen(){this.calciteAlertBeforeOpen.emit()}onOpen(){this.calciteAlertOpen.emit()}onBeforeClose(){this.calciteAlertBeforeClose.emit()}onClose(){this.calciteAlertClose.emit()}openAlert(){window.clearTimeout(this.queueTimeout),this.queueTimeout=window.setTimeout((()=>this.queued=!1),300)}static get assetsDirs(){return["assets"]}get el(){return o(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],autoCloseDuration:["updateDuration"],effectiveLocale:["effectiveLocaleChange"]}}};q.style=':host{--calcite-alert-edge-distance:2rem;--calcite-alert-dismiss-progress-background:var(--calcite-color-transparent-tint);display:block}.container{pointer-events:none;position:fixed;z-index:var(--calcite-z-index-toast);margin-inline:auto;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:-moz-min-content;min-inline-size:min-content;align-items:center;justify-content:center;background-color:var(--calcite-color-foreground-1);text-align:start;opacity:0;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-radius:var(--calcite-border-radius);border-block-start:0 solid transparent;border-inline:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3);inline-size:var(--calcite-alert-width);max-inline-size:calc(100% - var(--calcite-alert-edge-distance) * 2);transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out}.container--bottom,.container--top{inset-inline-end:0;inset-inline-start:0}.container[class*=bottom]{transform:translate3d(0, var(--calcite-alert-edge-distance), 0);inset-block-end:var(--calcite-alert-edge-distance)}.container[class*=top]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);inset-block-start:var(--calcite-alert-edge-distance)}.container[class*=start]{inset-inline-start:var(--calcite-alert-edge-distance);inset-inline-end:auto}.container[class*=end]{inset-inline-end:var(--calcite-alert-edge-distance);inset-inline-start:auto}.icon{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0px;margin-block:auto;margin-inline-end:auto;padding-inline-start:var(--calcite-alert-spacing-token-large)}.close{display:flex;cursor:pointer;align-items:center;justify-content:flex-end;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-color-text-3);outline:2px solid transparent;outline-offset:2px;-webkit-appearance:none;padding:var(--calcite-alert-spacing-token-large);outline-color:transparent}.close:focus{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.close:hover,.close:focus{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.close:active{background-color:var(--calcite-color-foreground-3)}.queue-count{visibility:hidden;display:flex;min-inline-size:-moz-min-content;min-inline-size:min-content;cursor:default;align-items:center;justify-content:space-around;align-self:stretch;overflow:hidden;background-color:var(--calcite-color-foreground-1);text-align:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline:0 solid transparent;border-start-end-radius:0}.queue-count--active{visibility:visible;opacity:1}.dismiss-progress{position:absolute;display:block;inline-size:100%;overflow:hidden;inset-inline:0;inset-block-start:-2px;block-size:2px;border-radius:var(--calcite-border-radius) var(--calcite-border-radius) 0 0}.dismiss-progress:after{position:absolute;inset-block-start:0px;display:block;block-size:2px;content:"";background-color:var(--calcite-alert-dismiss-progress-background);inset-inline-end:0}.actions-end{display:flex;align-self:stretch}.text-container{box-sizing:border-box;display:flex;min-inline-size:0px;flex:1 1 auto;flex-direction:column;overflow-wrap:break-word;padding-block:var(--calcite-alert-spacing-token-small);padding-inline:var(--calcite-alert-spacing-token-large) var(--calcite-alert-spacing-token-small)}.footer{position:relative;display:flex;inline-size:auto;justify-content:flex-end;align-self:stretch;padding-block-start:1px;block-size:inherit}:host([scale=s]){--calcite-alert-width:40em;--calcite-alert-spacing-token-small:0.5rem;--calcite-alert-spacing-token-large:0.75rem;--calcite-alert-footer-height:2rem;--calcite-alert-footer-divider-gap:0.125rem}:host([scale=s]) slot[name=title]::slotted(*),:host([scale=s]) *::slotted([slot=title]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) slot[name=message]::slotted(*),:host([scale=s]) *::slotted([slot=message]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) slot[name=link]::slotted(*),:host([scale=s]) *::slotted([slot=link]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .queue-count{margin-inline:0.5rem}:host([scale=s]) .container{--calcite-alert-min-height:3.5rem}:host([scale=m]){--calcite-alert-width:50em;--calcite-alert-spacing-token-small:0.75rem;--calcite-alert-spacing-token-large:1rem;--calcite-alert-footer-height:3rem;--calcite-alert-footer-divider-gap:0.25rem}:host([scale=m]) slot[name=title]::slotted(*),:host([scale=m]) *::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) slot[name=message]::slotted(*),:host([scale=m]) *::slotted([slot=message]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) slot[name=link]::slotted(*),:host([scale=m]) *::slotted([slot=link]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .queue-count{margin-inline:0.75rem}:host([scale=m]) .container{--calcite-alert-min-height:4.1875rem}:host([scale=l]){--calcite-alert-width:60em;--calcite-alert-spacing-token-small:1rem;--calcite-alert-spacing-token-large:1.25rem;--calcite-alert-footer-height:4rem;--calcite-alert-footer-divider-gap:0.5rem}:host([scale=l]) slot[name=title]::slotted(*),:host([scale=l]) *::slotted([slot=title]){margin-block-end:0.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) slot[name=message]::slotted(*),:host([scale=l]) *::slotted([slot=message]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) slot[name=link]::slotted(*),:host([scale=l]) *::slotted([slot=link]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .queue-count{margin-inline:1rem}:host([scale=l]) .container{--calcite-alert-min-height:5.625rem}:host([open]) .container:not(.container--queued){border-block-start-width:2px;opacity:1;pointer-events:initial}:host([open]) .container:not(.container--queued)[class*=bottom]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit)}:host([open]) .container:not(.container--queued)[class*=top]{transform:translate3d(0, var(--calcite-alert-edge-distance), inherit)}:host([auto-close])>.queue-count{border-inline-end:0 solid transparent}slot[name=title]::slotted(*),*::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}slot[name=message]::slotted(*),*::slotted([slot=message]){margin:0px;display:inline;font-size:var(--calcite-font-size--1);line-height:1.375;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);margin-inline-end:0.5rem}slot[name=link]::slotted(*),*::slotted([slot=link]){display:inline-flex;color:var(--calcite-color-text-link)}:host([kind=brand]) .container{border-block-start-color:var(--calcite-color-brand)}:host([kind=brand]) .container .icon{color:var(--calcite-color-brand)}:host([kind=info]) .container{border-block-start-color:var(--calcite-color-status-info)}:host([kind=info]) .container .icon{color:var(--calcite-color-status-info)}:host([kind=danger]) .container{border-block-start-color:var(--calcite-color-status-danger)}:host([kind=danger]) .container .icon{color:var(--calcite-color-status-danger)}:host([kind=success]) .container{border-block-start-color:var(--calcite-color-status-success)}:host([kind=success]) .container .icon{color:var(--calcite-color-status-success)}:host([kind=warning]) .container{border-block-start-color:var(--calcite-color-status-warning)}:host([kind=warning]) .container .icon{color:var(--calcite-color-status-warning)}:host([auto-close-duration=fast]) .dismiss-progress:after{animation:dismissProgress 6000ms ease-out}:host(:hover[auto-close-duration=fast]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=medium]) .dismiss-progress:after{animation:dismissProgress 10000ms ease-out}:host(:hover[auto-close-duration=medium]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=slow]) .dismiss-progress:after{animation:dismissProgress 14000ms ease-out}:host(:hover[auto-close-duration=slow]) .dismiss-progress:after{animation-play-state:paused}@keyframes dismissProgress{0%{inline-size:0px;opacity:0.75}100%{inline-size:100%;opacity:1}}.container--slotted-in-shell{position:absolute}:host([hidden]){display:none}[hidden]{display:none}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}';const W=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7),this._shouldClose=!1,this.graphics=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}async graphicsWatchHandler(){0===this.graphics.length&&await this._closeEdit()}async openWatchHandler(t){var i;t&&(null===(i=this.graphics)||void 0===i?void 0:i.length)>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit()}async featureSelectionChange(){await this._closeEdit()}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){var t,i;(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&(null===(i=this.graphics[0])||void 0===i?void 0:i.layer)&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=this._layer.on("edits",(()=>{this.editsComplete.emit(),this.open=!1})))}render(){var t;const i=!((null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled),o=this._editorLoading?"display-none":"position-absolute",a=this._editorLoading?"":"display-none";return e(s,null,e("div",{class:"position-absolute"},i?e("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},e("div",{slot:"message"},this._translations.enableEditing)):void 0,e("div",{class:"position-absolute",slot:"content"},e("div",{class:o,id:"feature-form",ref:t=>this._editContainer=t}),e("calcite-loader",{class:a,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await x(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=(await C(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:!1})));this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,layerInfos:i,visibleElements:{snappingControls:!1,sketchTooltipControls:!1},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.activeWorkflow)||void 0===t?void 0:t.activeWorkflow}),(t=>{"update-table-record"!==(null==t?void 0:t.type)&&"create-features"!==(null==t?void 0:t.type)||(this._shouldClose=!1),(null==t?void 0:t.type)||(null==t?void 0:t.hasPendingEdits)||(this.open=!1)})),this._editContainer.appendChild(t)}}async _closeEdit(){var t,i,e,s;this._shouldClose=!0,(null===(t=this._editor)||void 0===t?void 0:t.activeWorkflow)&&await(null===(i=this._editor)||void 0===i?void 0:i.cancelWorkflow()),this.graphicIndex>-1&&(null===(e=this.graphics)||void 0===e?void 0:e.length)>0&&this.refreshGraphics.emit(this.graphics),null===(s=this._editor)||void 0===s||s.destroy(),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await z(this.el);this._translations=t[0]}get el(){return o(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],open:["openWatchHandler"]}}};W.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-color-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-color-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}";const E=class{constructor(e){t(this,e),this.popupClosed=i(this,"popupClosed",7),this.selectionChanged=i(this,"selectionChanged",7),this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0}async graphicsWatchHandler(){var t;if(this._features||await this._initFeaturesWidget(),this.graphics.length>0){const i=null===(t=this.graphics[0])||void 0===t?void 0:t.layer;this._editEnabled=i.editingEnabled&&i.capabilities.operations.supportsUpdate,this._features.open({features:this.graphics})}else this._features.clear(),this._features.close()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async closeEdit(){this._editRecordOpen=!1}async refreshGraphics(t){this.graphics=[...t.detail]}async componentWillLoad(){await this._initModules(),await this._getTranslations()}render(){var t,i,o;const a=this.isLoading?"":"display-none",n=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",l=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",r=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",c=(null===(i=null===(t=this._features)||void 0===t?void 0:t.features)||void 0===i?void 0:i.length)<2,h=this.isMobile?"display-none":"",d=this.isMobile&&!this._editRecordOpen?"padding-top-46":"";return e(s,null,this.isMobile&&!this._editRecordOpen?e("calcite-panel",null,e("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),e("span",{class:"font-bold",slot:"header-content"},this._mobileTitle)):void 0,e("calcite-shell",{class:d},e("calcite-loader",{class:a,label:this._translations.fetchingData}),e("div",{class:"esri-widget "+n,id:"features-node"}),e("div",{class:`${r} width-100`,slot:"footer"},e("div",{class:"display-flex top-border padding-1-2"},e("calcite-button",{appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile?e("calcite-button",{appearance:"outline",class:"padding-inline-start-1",id:"solutions-cancel",onClick:()=>this._closePopup(),width:"full"},this._translations.cancel):void 0,e("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-edit"},e("span",null,this._translations.edit)),this.isMobile?e("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-cancel"},e("span",null,this._translations.cancel)):void 0),e("div",{class:`display-flex padding-1-2 button-container top-border ${h}`},e("div",{class:"min-width-100"},e("calcite-button",{appearance:"outline",disabled:c,id:"solutions-back",onClick:()=>this._back(),width:"full"},this._translations.back),e("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-back"},e("span",null,this._translations.back))),e("div",null,e("calcite-action",{icon:"list",onClick:()=>this._toggleListView(),scale:"s",text:this._getCount(),textEnabled:!0})),e("div",{class:"min-width-100"},e("calcite-button",{appearance:"outline",disabled:c,id:"solutions-next",onClick:()=>this._next(),width:"full"},this._translations.next),e("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-next"},e("span",null,this._translations.next))))),e("edit-card",{class:l,graphicIndex:null===(o=this._features)||void 0===o?void 0:o.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),e("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},e("div",{slot:"title"},this._translations.editDisabled),e("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await x(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async _initFeaturesWidget(){var t;return void 0!==this.isMobile?await(null===(t=this.mapView)||void 0===t?void 0:t.when((()=>{this._features?(this._features.view=this.mapView,this._features.visibleElements.actionBar=!1,this._features.visibleElements.closeButton=!1,this._features.visibleElements.heading=!this.isMobile):(this._features=new this.Features({view:this.mapView,container:"features-node",visibleElements:{actionBar:!1,closeButton:!1,heading:!this.isMobile}}),this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{t||(this._showListView=t)})),this.reactiveUtils.watch((()=>this._features.viewModel.title),(t=>{this._mobileTitle=t})),this.zoomAndScrollToSelected&&this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit([this._features.selectedFeature])})))}))):Promise.resolve()}_closePopup(){this.popupClosed.emit()}_alertClosed(){this._alertOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){var t,i,e;const s=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),o=null===(e=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===e?void 0:e.length.toString();return this._translations.indexOfTotal.replace("{{index}}",s).replace("{{total}}",o)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await z(this.el);this._translations=t[0]}get el(){return o(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],mapView:["mapViewWatchHandler"]}}};E.style=":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.padding-top-46{padding-top:46px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}";export{q as calcite_alert,W as edit_card,E as info_card}
|
11
|
+
*/const _={slow:14e3,medium:1e4,fast:6e3},j="container",q=class{constructor(e){t(this,e),this.calciteAlertBeforeClose=i(this,"calciteAlertBeforeClose",6),this.calciteAlertClose=i(this,"calciteAlertClose",6),this.calciteAlertBeforeOpen=i(this,"calciteAlertBeforeOpen",6),this.calciteAlertOpen=i(this,"calciteAlertOpen",6),this.calciteInternalAlertSync=i(this,"calciteInternalAlertSync",6),this.calciteInternalAlertRegister=i(this,"calciteInternalAlertRegister",6),this.autoCloseTimeoutId=null,this.totalOpenTime=0,this.totalHoverTime=0,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t},this.closeAlert=()=>{this.autoCloseTimeoutId=null,this.queued=!1,this.open=!1,this.queue=this.queue.filter((t=>t!==this.el)),this.determineActiveAlert(),this.calciteInternalAlertSync.emit({queue:this.queue})},this.actionsEndSlotChangeHandler=t=>{this.hasEndActions=a(t)},this.handleMouseOver=()=>{window.clearTimeout(this.autoCloseTimeoutId),this.totalOpenTime=Date.now()-this.initialOpenTime,this.lastMouseOverBegin=Date.now()},this.handleMouseLeave=()=>{const t=Date.now()-this.lastMouseOverBegin,i=_[this.autoCloseDuration]-this.totalOpenTime+this.totalHoverTime;this.totalHoverTime=this.totalHoverTime?t+this.totalHoverTime:t,this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),i)},this.open=!1,this.autoClose=!1,this.autoCloseDuration="medium",this.kind="brand",this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.numberingSystem=void 0,this.placement="bottom",this.scale="m",this.messages=void 0,this.messageOverrides=void 0,this.slottedInShell=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.hasEndActions=!1,this.queue=[],this.queueLength=0,this.queued=!1}openHandler(){v(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.open||(this.queue=this.queue.filter((t=>t!==this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}))}onMessagesChange(){}updateDuration(){this.autoClose&&this.autoCloseTimeoutId&&(window.clearTimeout(this.autoCloseTimeoutId),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),_[this.autoCloseDuration]))}connectedCallback(){u(this),f(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit()}async componentWillLoad(){h(this),await b(this),this.open&&v(this)}componentDidLoad(){d(this)}disconnectedCallback(){window.dispatchEvent(new CustomEvent("calciteInternalAlertUnregister",{detail:{alert:this.el}})),window.clearTimeout(this.autoCloseTimeoutId),window.clearTimeout(this.queueTimeout),m(this),w(this),this.slottedInShell=!1}render(){g.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"};const{open:t,autoClose:i,label:o,placement:a,queued:l}=this,c=i?"alert":"alertdialog",h=!t,d=r(k,this.icon,this.kind),p=this.queueLength>1;return e(s,{"aria-hidden":n(h),"aria-label":o,"calcite-hydrated-hidden":h,role:c},e("div",{class:{[j]:!0,"container--queued":l,[`${j}--${a}`]:!0,"container--slotted-in-shell":this.slottedInShell},onPointerEnter:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseOver:null,onPointerLeave:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseLeave:null,ref:this.setTransitionEl},d&&this.renderIcon(d),e("div",{class:"text-container"},e("slot",{name:"title"}),e("slot",{name:"message"}),e("slot",{name:"link"})),this.renderActionsEnd(),p?this.renderQueueCount():null,this.renderCloseButton(),t&&!l&&i?e("div",{class:"dismiss-progress"}):null))}renderCloseButton(){return e("button",{"aria-label":this.messages.close,class:"close",key:"close",onClick:this.closeAlert,type:"button",ref:t=>this.closeButton=t},e("calcite-icon",{icon:"x",scale:c(this.scale)}))}renderQueueCount(){const t=g.numberFormatter.format(this.queueLength>2?this.queueLength-1:1);return e("div",{class:{"queue-count":!0,"queue-count--active":this.queueLength>1},key:"queue-count"},e("calcite-chip",{scale:this.scale,value:t},t))}renderActionsEnd(){return e("div",{class:"actions-end"},e("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderIcon(t){return e("div",{class:"icon"},e("calcite-icon",{flipRtl:this.iconFlipRtl,icon:t,scale:c(this.scale)}))}alertSync(t){this.queue!==t.detail.queue&&(this.queue=t.detail.queue),this.queueLength=this.queue.length,this.determineActiveAlert(),t.stopPropagation()}alertRegister(){this.open&&!this.queue.includes(this.el)&&(this.queued=!0,this.queue.push(this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}),this.determineActiveAlert()}alertUnregister(t){const i=this.queue.filter((i=>i!==t.detail.alert));this.queue=i,window.dispatchEvent(new CustomEvent("calciteInternalAlertSync",{detail:{queue:i}}))}async setFocus(){await p(this);const t=l(this.el,{selector:"calcite-link"});if(this.closeButton||t)return t?t.setFocus():void(this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){y(this,this.effectiveLocale)}determineActiveAlert(){var t;(null===(t=this.queue)||void 0===t?void 0:t[0])===this.el&&(this.openAlert(),this.autoClose&&!this.autoCloseTimeoutId&&(this.initialOpenTime=Date.now(),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),_[this.autoCloseDuration])))}onBeforeOpen(){this.calciteAlertBeforeOpen.emit()}onOpen(){this.calciteAlertOpen.emit()}onBeforeClose(){this.calciteAlertBeforeClose.emit()}onClose(){this.calciteAlertClose.emit()}openAlert(){window.clearTimeout(this.queueTimeout),this.queueTimeout=window.setTimeout((()=>this.queued=!1),300)}static get assetsDirs(){return["assets"]}get el(){return o(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],autoCloseDuration:["updateDuration"],effectiveLocale:["effectiveLocaleChange"]}}};q.style=':host{--calcite-alert-edge-distance:2rem;--calcite-alert-dismiss-progress-background:var(--calcite-color-transparent-tint);display:block}.container{pointer-events:none;position:fixed;z-index:var(--calcite-z-index-toast);margin-inline:auto;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:-moz-min-content;min-inline-size:min-content;align-items:center;justify-content:center;background-color:var(--calcite-color-foreground-1);text-align:start;opacity:0;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-radius:var(--calcite-border-radius);border-block-start:0 solid transparent;border-inline:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3);inline-size:var(--calcite-alert-width);max-inline-size:calc(100% - var(--calcite-alert-edge-distance) * 2);transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out}.container--bottom,.container--top{inset-inline-end:0;inset-inline-start:0}.container[class*=bottom]{transform:translate3d(0, var(--calcite-alert-edge-distance), 0);inset-block-end:var(--calcite-alert-edge-distance)}.container[class*=top]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);inset-block-start:var(--calcite-alert-edge-distance)}.container[class*=start]{inset-inline-start:var(--calcite-alert-edge-distance);inset-inline-end:auto}.container[class*=end]{inset-inline-end:var(--calcite-alert-edge-distance);inset-inline-start:auto}.icon{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0px;margin-block:auto;margin-inline-end:auto;padding-inline-start:var(--calcite-alert-spacing-token-large)}.close{display:flex;cursor:pointer;align-items:center;justify-content:flex-end;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-color-text-3);outline:2px solid transparent;outline-offset:2px;-webkit-appearance:none;padding:var(--calcite-alert-spacing-token-large);outline-color:transparent}.close:focus{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.close:hover,.close:focus{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.close:active{background-color:var(--calcite-color-foreground-3)}.queue-count{visibility:hidden;display:flex;min-inline-size:-moz-min-content;min-inline-size:min-content;cursor:default;align-items:center;justify-content:space-around;align-self:stretch;overflow:hidden;background-color:var(--calcite-color-foreground-1);text-align:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline:0 solid transparent;border-start-end-radius:0}.queue-count--active{visibility:visible;opacity:1}.dismiss-progress{position:absolute;display:block;inline-size:100%;overflow:hidden;inset-inline:0;inset-block-start:-2px;block-size:2px;border-radius:var(--calcite-border-radius) var(--calcite-border-radius) 0 0}.dismiss-progress:after{position:absolute;inset-block-start:0px;display:block;block-size:2px;content:"";background-color:var(--calcite-alert-dismiss-progress-background);inset-inline-end:0}.actions-end{display:flex;align-self:stretch}.text-container{box-sizing:border-box;display:flex;min-inline-size:0px;flex:1 1 auto;flex-direction:column;overflow-wrap:break-word;padding-block:var(--calcite-alert-spacing-token-small);padding-inline:var(--calcite-alert-spacing-token-large) var(--calcite-alert-spacing-token-small)}.footer{position:relative;display:flex;inline-size:auto;justify-content:flex-end;align-self:stretch;padding-block-start:1px;block-size:inherit}:host([scale=s]){--calcite-alert-width:40em;--calcite-alert-spacing-token-small:0.5rem;--calcite-alert-spacing-token-large:0.75rem;--calcite-alert-footer-height:2rem;--calcite-alert-footer-divider-gap:0.125rem}:host([scale=s]) slot[name=title]::slotted(*),:host([scale=s]) *::slotted([slot=title]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) slot[name=message]::slotted(*),:host([scale=s]) *::slotted([slot=message]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) slot[name=link]::slotted(*),:host([scale=s]) *::slotted([slot=link]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .queue-count{margin-inline:0.5rem}:host([scale=s]) .container{--calcite-alert-min-height:3.5rem}:host([scale=m]){--calcite-alert-width:50em;--calcite-alert-spacing-token-small:0.75rem;--calcite-alert-spacing-token-large:1rem;--calcite-alert-footer-height:3rem;--calcite-alert-footer-divider-gap:0.25rem}:host([scale=m]) slot[name=title]::slotted(*),:host([scale=m]) *::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) slot[name=message]::slotted(*),:host([scale=m]) *::slotted([slot=message]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) slot[name=link]::slotted(*),:host([scale=m]) *::slotted([slot=link]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .queue-count{margin-inline:0.75rem}:host([scale=m]) .container{--calcite-alert-min-height:4.1875rem}:host([scale=l]){--calcite-alert-width:60em;--calcite-alert-spacing-token-small:1rem;--calcite-alert-spacing-token-large:1.25rem;--calcite-alert-footer-height:4rem;--calcite-alert-footer-divider-gap:0.5rem}:host([scale=l]) slot[name=title]::slotted(*),:host([scale=l]) *::slotted([slot=title]){margin-block-end:0.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) slot[name=message]::slotted(*),:host([scale=l]) *::slotted([slot=message]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) slot[name=link]::slotted(*),:host([scale=l]) *::slotted([slot=link]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .queue-count{margin-inline:1rem}:host([scale=l]) .container{--calcite-alert-min-height:5.625rem}:host([open]) .container:not(.container--queued){border-block-start-width:2px;opacity:1;pointer-events:initial}:host([open]) .container:not(.container--queued)[class*=bottom]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit)}:host([open]) .container:not(.container--queued)[class*=top]{transform:translate3d(0, var(--calcite-alert-edge-distance), inherit)}:host([auto-close])>.queue-count{border-inline-end:0 solid transparent}slot[name=title]::slotted(*),*::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}slot[name=message]::slotted(*),*::slotted([slot=message]){margin:0px;display:inline;font-size:var(--calcite-font-size--1);line-height:1.375;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);margin-inline-end:0.5rem}slot[name=link]::slotted(*),*::slotted([slot=link]){display:inline-flex;color:var(--calcite-color-text-link)}:host([kind=brand]) .container{border-block-start-color:var(--calcite-color-brand)}:host([kind=brand]) .container .icon{color:var(--calcite-color-brand)}:host([kind=info]) .container{border-block-start-color:var(--calcite-color-status-info)}:host([kind=info]) .container .icon{color:var(--calcite-color-status-info)}:host([kind=danger]) .container{border-block-start-color:var(--calcite-color-status-danger)}:host([kind=danger]) .container .icon{color:var(--calcite-color-status-danger)}:host([kind=success]) .container{border-block-start-color:var(--calcite-color-status-success)}:host([kind=success]) .container .icon{color:var(--calcite-color-status-success)}:host([kind=warning]) .container{border-block-start-color:var(--calcite-color-status-warning)}:host([kind=warning]) .container .icon{color:var(--calcite-color-status-warning)}:host([auto-close-duration=fast]) .dismiss-progress:after{animation:dismissProgress 6000ms ease-out}:host(:hover[auto-close-duration=fast]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=medium]) .dismiss-progress:after{animation:dismissProgress 10000ms ease-out}:host(:hover[auto-close-duration=medium]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=slow]) .dismiss-progress:after{animation:dismissProgress 14000ms ease-out}:host(:hover[auto-close-duration=slow]) .dismiss-progress:after{animation-play-state:paused}@keyframes dismissProgress{0%{inline-size:0px;opacity:0.75}100%{inline-size:100%;opacity:1}}.container--slotted-in-shell{position:absolute}:host([hidden]){display:none}[hidden]{display:none}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}';const W=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7),this._shouldClose=!1,this.graphics=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}async graphicsWatchHandler(){0===this.graphics.length&&await this._closeEdit()}async openWatchHandler(t){var i;t&&(null===(i=this.graphics)||void 0===i?void 0:i.length)>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit()}async featureSelectionChange(){await this._closeEdit()}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){var t,i;(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&(null===(i=this.graphics[0])||void 0===i?void 0:i.layer)&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=this._layer.on("edits",(()=>{this.editsComplete.emit(),this.open=!1})))}render(){var t;const i=!((null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled),o=this._editorLoading?"display-none":"position-absolute",a=this._editorLoading?"":"display-none";return e(s,null,e("div",{class:"position-absolute"},i?e("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},e("div",{slot:"message"},this._translations.enableEditing)):void 0,e("div",{class:"position-absolute",slot:"content"},e("div",{class:o,id:"feature-form",ref:t=>this._editContainer=t}),e("calcite-loader",{class:a,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await x(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=(await C(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:!1})));this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,layerInfos:i,visibleElements:{snappingControls:!1},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.activeWorkflow)||void 0===t?void 0:t.activeWorkflow}),(t=>{"update-table-record"!==(null==t?void 0:t.type)&&"create-features"!==(null==t?void 0:t.type)||(this._shouldClose=!1),(null==t?void 0:t.type)||(null==t?void 0:t.hasPendingEdits)||(this.open=!1)})),this._editContainer.appendChild(t)}}async _closeEdit(){var t,i,e,s;this._shouldClose=!0,(null===(t=this._editor)||void 0===t?void 0:t.activeWorkflow)&&await(null===(i=this._editor)||void 0===i?void 0:i.cancelWorkflow()),this.graphicIndex>-1&&(null===(e=this.graphics)||void 0===e?void 0:e.length)>0&&this.refreshGraphics.emit(this.graphics),null===(s=this._editor)||void 0===s||s.destroy(),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await z(this.el);this._translations=t[0]}get el(){return o(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],open:["openWatchHandler"]}}};W.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-color-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-color-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}";
|
12
|
+
/** @license
|
13
|
+
* Copyright 2022 Esri
|
14
|
+
*
|
15
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
16
|
+
* you may not use this file except in compliance with the License.
|
17
|
+
* You may obtain a copy of the License at
|
18
|
+
*
|
19
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
20
|
+
*
|
21
|
+
* Unless required by applicable law or agreed to in writing, software
|
22
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
23
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
24
|
+
* See the License for the specific language governing permissions and
|
25
|
+
* limitations under the License.
|
26
|
+
*/
|
27
|
+
class E{async getPopupTitle(t){var i,e,s;this.arcade||await this._initModules();let o={};for(const[i,e]of Object.entries(t.attributes))o=Object.assign(Object.assign({},o),{[`{${i.toUpperCase()}}`]:e});const a=t.layer,n=this._removeTags(null===(i=null==a?void 0:a.popupTemplate)||void 0===i?void 0:i.title);if(n.includes("{expression/expr")&&null!=(null===(e=null==a?void 0:a.popupTemplate)||void 0===e?void 0:e.expressionInfos))for(let i=0;i<(null===(s=a.popupTemplate)||void 0===s?void 0:s.expressionInfos.length);i++){const e=a.popupTemplate.expressionInfos[i],s={variables:[{name:"$feature",type:"feature"}]};try{const i=(await this.arcade.createArcadeExecutor(e.expression,s)).execute({$feature:t});null==i&&""===i||(o[`{expression/${e.name}}`.toUpperCase()]=i)}catch(t){continue}}return null==n?void 0:n.replace(/{.*?}/g,(t=>null!=o[t.toUpperCase()]?o[t.toUpperCase()]:""))}_removeTags(t){return null==t||""===t?"":t.toString().replace(/(<([^>]+)>)/gi,"")}async _initModules(){const[t]=await x(["esri/arcade"]);this.arcade=t}}const A=class{constructor(e){t(this,e),this.popupClosed=i(this,"popupClosed",7),this.selectionChanged=i(this,"selectionChanged",7),this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0}async graphicsWatchHandler(){var t;if(this._features||await this._initFeaturesWidget(),this.graphics.length>0){const i=null===(t=this.graphics[0])||void 0===t?void 0:t.layer;this._editEnabled=i.editingEnabled&&i.capabilities.operations.supportsUpdate,this._mobileTitle=await this._popupUtils.getPopupTitle(this.graphics[0]),this._features.open({features:this.graphics})}else this._features.clear(),this._features.close()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async closeEdit(){this._editRecordOpen=!1}async refreshGraphics(t){this.graphics=[...t.detail]}async componentWillLoad(){await this._initModules(),await this._getTranslations(),this._popupUtils=new E}render(){var t,i,o;const a=this.isLoading?"":"display-none",n=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",l=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",r=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",c=(null===(i=null===(t=this._features)||void 0===t?void 0:t.features)||void 0===i?void 0:i.length)<2,h=this.isMobile?"display-none":"",d=this.isMobile&&!this._editRecordOpen?"padding-top-46":"";return e(s,null,this.isMobile&&!this._editRecordOpen?e("calcite-panel",null,e("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),e("span",{class:"font-bold",slot:"header-content"},this._mobileTitle)):void 0,e("calcite-shell",{class:d},e("calcite-loader",{class:a,label:this._translations.fetchingData}),e("div",{class:"esri-widget "+n,id:"features-node"}),e("div",{class:`${r} width-100`,slot:"footer"},e("div",{class:"display-flex top-border padding-1-2"},e("calcite-button",{appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile?e("calcite-button",{appearance:"outline",class:"padding-inline-start-1",id:"solutions-cancel",onClick:()=>this._closePopup(),width:"full"},this._translations.cancel):void 0,e("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-edit"},e("span",null,this._translations.edit)),this.isMobile?e("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-cancel"},e("span",null,this._translations.cancel)):void 0),e("div",{class:`display-flex padding-1-2 button-container top-border ${h}`},e("div",{class:"min-width-100"},e("calcite-button",{appearance:"outline",disabled:c,id:"solutions-back",onClick:()=>this._back(),width:"full"},this._translations.back),e("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-back"},e("span",null,this._translations.back))),e("div",null,e("calcite-action",{icon:"list",onClick:()=>this._toggleListView(),scale:"s",text:this._getCount(),textEnabled:!0})),e("div",{class:"min-width-100"},e("calcite-button",{appearance:"outline",disabled:c,id:"solutions-next",onClick:()=>this._next(),width:"full"},this._translations.next),e("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-next"},e("span",null,this._translations.next))))),e("edit-card",{class:l,graphicIndex:null===(o=this._features)||void 0===o?void 0:o.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),e("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},e("div",{slot:"title"},this._translations.editDisabled),e("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await x(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async _initFeaturesWidget(){var t;return void 0!==this.isMobile?await(null===(t=this.mapView)||void 0===t?void 0:t.when((()=>{this._features?(this._features.view=this.mapView,this._features.visibleElements.actionBar=!1,this._features.visibleElements.closeButton=!1,this._features.visibleElements.heading=!this.isMobile):(this._features=new this.Features({view:this.mapView,container:"features-node",visibleElements:{actionBar:!1,closeButton:!1,heading:!this.isMobile}}),this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{t||(this._showListView=t)})),this.zoomAndScrollToSelected&&this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit([this._features.selectedFeature])})))}))):Promise.resolve()}_closePopup(){this.popupClosed.emit()}_alertClosed(){this._alertOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){var t,i,e;const s=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),o=null===(e=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===e?void 0:e.length.toString();return this._translations.indexOfTotal.replace("{{index}}",s).replace("{{total}}",o)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await z(this.el);this._translations=t[0]}get el(){return o(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],mapView:["mapViewWatchHandler"]}}};A.style=":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.padding-top-46{padding-top:46px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}";export{q as calcite_alert,W as edit_card,A as info_card}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as i,h as t,H as e,g as s}from"./p-78780f63.js";import{g as h}from"./p-6b943f52.js";import{E as l}from"./p-4af32c75.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const o=class{constructor(t){i(this,t),this._shouldSetMapView=!1,this.classicGrid=!1,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.hideMap=!1,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._hideFooter=!1,this._hideTable=!1,this._isMobile=void 0,this._translations=void 0,this._layoutMode=l.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._tableOnly=!1}defaultCenterWatchHandler(){this._defaultCenter=this.defaultCenter?this.defaultCenter.split(";").map((i=>parseFloat(i))):void 0}defaultGlobalIdWatchHandler(){this._defaultGlobalId=this.defaultGlobalId?this.defaultGlobalId.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0}defaultOidWatchHandler(){this._defaultOid=this.defaultOid?this.defaultOid.indexOf(",")>-1?this.defaultOid.split(",").map((i=>parseInt(i,10))):[parseInt(this.defaultOid,10)]:void 0}defaultLevelWatchHandler(){this._defaultLevel=this.defaultLevel?parseInt(this.defaultLevel,10):void 0}enableZoomWatchHandler(){this._initMapZoom()}async _isMobileWatchHandler(){this.showHideMapPopupAndTable(!!this._isMobile&&this._numSelected>0)}async featureSelectionChange(i){var t;this._numSelected=null===(t=i.detail)||void 0===t?void 0:t.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async idsFound(i){const t=i.detail;this._tableOnly=t.tableIds.length>0&&0===t.layerIds.length,this._tableOnly&&(this._expandPopup=!0)}async layoutChanged(i){this._layoutMode=i.detail}async mapChanged(i){this._mapChange=i.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return t(e,null,t("calcite-shell",{class:"position-relative"},t("calcite-panel",{class:"width-full height-full"},this._getBody(this._layoutMode,this._panelOpen,this.hideMap,this._hideTable)),this._getFooter()))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el)}_getFooter(){return this._isMobile&&this._numSelected>0&&!this._hideFooter?t("div",{class:"width-100",slot:"footer"},t("div",{class:"display-flex padding-1-2"},t("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),t("calcite-button",{appearance:"outline",class:"padding-inline-start-1",id:"solutions-delete",kind:"danger",onClick:()=>this._layerTable.deleteFeatures(),width:"full"},this._translations.delete.replace("{{n}}",this._numSelected.toString())))):void 0}_getDividerIcon(i,t){let e="";switch(i){case l.HORIZONTAL:e=this.classicGrid?t?"chevrons-down":"chevrons-up":t?"chevrons-up":"chevrons-down";break;case l.VERTICAL:e=this.classicGrid?t?"chevrons-right":"chevrons-left":t?"chevrons-left":"chevrons-right";break;case l.GRID:e=this.classicGrid?t?"chevrons-up":"chevrons-down":t?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(i,t){let e="";switch(i){case l.HORIZONTAL:e=(this._isMobile&&this.hideMap?"height-0 ":t?"height-1-2 display-grid":"height-0")+" width-full position-relative";break;case l.GRID:e=this.classicGrid?(t?"position-relative":"position-absolute-53")+" height-full width-full display-flex":"height-full position-relative "+(t?"width-1-3":"width-0");break;case l.VERTICAL:e="height-full position-relative "+(t?"width-1-2":"width-0")}return e}_getTableSizeClass(i,t){let e="";switch(i){case l.HORIZONTAL:e=(t?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=this.classicGrid?(t?"height-full":"height-53")+" position-relative width-full display-flex":(t?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(t?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(i,e,s,h){const o=this.classicGrid&&i===l.GRID&&e?"display-grid":i===l.HORIZONTAL?"":"display-flex";return t("calcite-panel",{class:"width-full height-full"},this.classicGrid?t("div",{class:`width-full height-full overflow-hidden ${o}`},this._getTable(i,e,h),this._getMapAndCard(i,e,s)):t("div",{class:`width-full height-full overflow-hidden ${o}`},this._getMapAndCard(i,e,s),this._getTable(i,e,h)))}_getMapAndCard(i,e,s){const h=this._getMapSizeClass(i,e);return this.classicGrid?t("div",{class:`${h} overflow-hidden`},this._getCardNode(),this._getMapNode(i,s)):t("div",{class:`${h} overflow-hidden`},this._getMapNode(i,s),this._getPopupExpandNode())}_getMapNode(i,e){var s;return t("div",{class:`${this.classicGrid&&i===l.GRID?"width-full":this._layoutMode!==l.HORIZONTAL||e?this._layoutMode===l.HORIZONTAL&&this._isMobile&&this.hideMap?"height-0":"adjusted-height-50":""} overflow-hidden ${this.classicGrid&&i===l.GRID?"display-flex height-full width-1-2":i===l.HORIZONTAL&&!e||i===l.GRID&&!e?"":"visibility-hidden"}`},t("map-card",{basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableMapToolsExpand:!0,enableSearch:this.enableSearch,hidden:this._expandPopup,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",mapInfos:null===(s=this.mapInfos)||void 0===s?void 0:s.filter((i=>!1!==i.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"]}))}_getPopupExpandNode(){var i;const e=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",h=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,l="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",o=this._expandPopup?1===(null===(i=this.mapInfos)||void 0===i?void 0:i.length)||this._isMobile?"position-absolute-0":"position-absolute-50":"height-full",a=this._isMobile?"display-none height-0":"";return t("div",{class:`${this._isMobile?"calcite-mode-light":"calcite-mode-dark"} ${o} ${this._isMobile&&this._hideTable&&this.hideMap?"position-fixed width-full height-full":this._isMobile?"display-none height-0":""}`},t("calcite-panel",null,this._isMobile?void 0:t("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},t("calcite-icon",{icon:"information",scale:"s"}),t("div",{class:"padding-inline-start-75"},this._translations.information)),t("calcite-action",{class:a,disabled:this._tableOnly,icon:e,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:t("calcite-tooltip",{class:l,label:"",placement:"bottom","reference-element":s},t("span",null,h)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return t("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},t("card-manager",{class:(this._expandPopup||this._isMobile?"height-full":"height-50")+" width-full",isMobile:this._isMobile,mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(i,e,s){const h=s?"visibility-hidden":"",o=this._getTableSizeClass(i,e),a=this._getDividerIcon(i,e),d=e?this._translations.close:this._translations.open,n="toggle-layout",r=this.defaultWebmap&&this.defaultLayer;return t("calcite-shell",{class:`${o} ${h} border-bottom`},this._isMobile?void 0:t("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:i===l.HORIZONTAL||this.classicGrid?"horizontal":"vertical",slot:this.classicGrid&&i!==l.VERTICAL?"footer":this.classicGrid&&i===l.VERTICAL?"panel-end":i===l.HORIZONTAL?"header":"panel-start"},t("calcite-action",{class:"toggle-node",icon:a,id:n,onClick:()=>this._toggleLayout(),text:""}),t("calcite-tooltip",{label:d,placement:"bottom","reference-element":n},t("span",null,d))),t("div",{class:"width-full height-full position-relative"},t("layer-table",{defaultGlobalId:r?this._defaultGlobalId:void 0,defaultLayerId:r?this.defaultLayer:"",defaultOid:r&&!this.defaultGlobalId?this._defaultOid:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isMobile,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:i=>this._layerTable=i,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_onResize(){this._isMobile=this.el.offsetWidth<1024,this._layoutMode=this._isMobile?l.HORIZONTAL:l.GRID,this._panelOpen=!0}_toggleLayout(){this._panelOpen=!this._panelOpen}showHideMapPopupAndTable(i){this.hideMap=i,this._expandPopup=!1,this._hideTable=i,this._hideFooter=i}_getMapInfo(i){let t;return this.mapInfos.some((e=>{if(e.id===i)return t=e,!0})),Object.assign({},t)}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this._mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const i=await h(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{defaultCenter:["defaultCenterWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultLevel:["defaultLevelWatchHandler"],enableZoom:["enableZoomWatchHandler"],_isMobile:["_isMobileWatchHandler"]}}};o.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}";export{o as crowdsource_manager}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as i,a as s,h as e,H as a,g as l}from"./p-78780f63.js";import{a as o,b as n,c}from"./p-4af32c75.js";import{l as h}from"./p-48ff9cea.js";import{g as d,h as r}from"./p-531d91d6.js";import{s as p}from"./p-8684a905.js";import{g}from"./p-6b943f52.js";import{c as b,r as m}from"./p-1bdd64a0.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-225c4ca4.js";import"./p-d89fff3a.js";import"./p-a230b270.js";import"./p-220ec0d1.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._titleValue=void 0,this._numSelected=0,this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._addMap=!1,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}async mapViewWatchHandler(t){(null==t?void 0:t.popup)&&(this._popupsEnabled=null==t?void 0:t.popup.autoOpenEnabled)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);s!==JSON.stringify(i)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){var s;if(this._checkPopups(),(null===(s=this.mapView)||void 0===s?void 0:s.popup)&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,null,e("calcite-shell",null,e("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i]=await h(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils"]);this._geometryEngine=t,this._jsonUtils=i}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return e("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},e("div",{class:"background-override"},e("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},e("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},e("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",src:this._onboardingImageUrl}))}_getSelectionSetList(){return e("div",{class:"padding-top-1-2 padding-bottom-1-2"},e("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{var a;const l=this._getSelectionSetIds(i);let o=!0;return i.workflowType===c.REFINE&&(o=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),o&&t.push(e("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(a=null==i?void 0:i.layerView)||void 0===a?void 0:a.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",l.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==c.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===c.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==c.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return e("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),e("div",null,e("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return e("calcite-panel",null,e("div",null,this._getLabel(this._translations.export,!1),t?e("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),e("div",{class:"padding-sides-1 "+i},e("div",{class:"display-flex"},e("calcite-label",{layout:"inline"},e("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),e("div",{class:"display-flex"},this._translations.removeDuplicate,e("div",{class:"info-message padding-start-1-2"},e("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"remove-duplicates-icon",scale:"s"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},e("span",{class:"tooltip-message"},this._translations.duplicatesTip))),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t)},e("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},e("span",{class:"font-weight-500"},this._translations.pdf)),e("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},e("span",{class:"font-weight-500"},this._translations.csv)))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive||this._fetchingData,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},e("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"";return e("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:"padding-sides-1"},e("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.addTitle)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:i})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._addMap=!this._addMap}),this._translations.includeMap)))}_getRefinePage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?e("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),e("refine-selection",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,a,l,o){return e("div",{class:"padding-bottom-1"},e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},e("span",{class:"font-weight-500"},t))),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},e("span",{class:"font-weight-500"},a))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{var s;const a=this._getSelectionSetIds(i),l=i.workflowType!==c.REFINE||a.length>0;return!this._downloadActive&&i.download&&l&&(this._downloadActive=!0),l&&t.push(e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),e("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},e("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",a.length.toString()))))))),t}),[])||e("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._getSelectionIdsAndViews(this._selectionSets,!0);if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=null==t?void 0:t.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===c.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const e=null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.id;t=this._updateExportInfos(t,e,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,a,l=!1,o=""){return e("calcite-action",{disabled:!t,icon:i,indicator:l,onClick:a,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){var t,i;const s=await(null===(t=this._selectTools)||void 0===t?void 0:t.getSelection()),e=null===(i=this._selectTools)||void 0===i?void 0:i.isUpdate;return this._selectionSets=e?this._selectionSets.map((t=>t.id===s.id?s:t)):[...this._selectionSets,s],this._home()}async _clearSelection(){var t;await(null===(t=this._selectTools)||void 0===t?void 0:t.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){d(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===c.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];p.highlightHandles.push(await r(e.ids,e.layerView,this.mapView))}}_checkPopups(){var t;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(t=this.mapView)||void 0===t?void 0:t.popupEnabled)}_clearHighlight(){p&&p.highlightHandles&&p.removeHandles()}async _getTranslations(){const t=await g(this.el);this._translations=t[0]}get el(){return l(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
|
6
|
+
import{r as t,c as i,a as s,h as e,H as a,g as l}from"./p-78780f63.js";import{a as o,b as n,c}from"./p-4af32c75.js";import{l as h}from"./p-48ff9cea.js";import{g as d,h as r}from"./p-b5d1b979.js";import{s as p}from"./p-8684a905.js";import{g}from"./p-6b943f52.js";import{c as b,r as m}from"./p-d4afcf86.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-225c4ca4.js";import"./p-d89fff3a.js";import"./p-a230b270.js";import"./p-220ec0d1.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._titleValue=void 0,this._numSelected=0,this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._addMap=!1,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}async mapViewWatchHandler(t){(null==t?void 0:t.popup)&&(this._popupsEnabled=null==t?void 0:t.popup.autoOpenEnabled)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);s!==JSON.stringify(i)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){var s;if(this._checkPopups(),(null===(s=this.mapView)||void 0===s?void 0:s.popup)&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,null,e("calcite-shell",null,e("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i]=await h(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils"]);this._geometryEngine=t,this._jsonUtils=i}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return e("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},e("div",{class:"background-override"},e("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},e("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},e("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",src:this._onboardingImageUrl}))}_getSelectionSetList(){return e("div",{class:"padding-top-1-2 padding-bottom-1-2"},e("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{var a;const l=this._getSelectionSetIds(i);let o=!0;return i.workflowType===c.REFINE&&(o=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),o&&t.push(e("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(a=null==i?void 0:i.layerView)||void 0===a?void 0:a.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",l.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==c.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===c.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==c.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return e("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),e("div",null,e("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return e("calcite-panel",null,e("div",null,this._getLabel(this._translations.export,!1),t?e("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),e("div",{class:"padding-sides-1 "+i},e("div",{class:"display-flex"},e("calcite-label",{layout:"inline"},e("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),e("div",{class:"display-flex"},this._translations.removeDuplicate,e("div",{class:"info-message padding-start-1-2"},e("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"remove-duplicates-icon",scale:"s"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},e("span",{class:"tooltip-message"},this._translations.duplicatesTip))),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t)},e("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},e("span",{class:"font-weight-500"},this._translations.pdf)),e("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},e("span",{class:"font-weight-500"},this._translations.csv)))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive||this._fetchingData,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},e("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"";return e("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:"padding-sides-1"},e("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.addTitle)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:i})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._addMap=!this._addMap}),this._translations.includeMap)))}_getRefinePage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?e("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),e("refine-selection",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,a,l,o){return e("div",{class:"padding-bottom-1"},e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},e("span",{class:"font-weight-500"},t))),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},e("span",{class:"font-weight-500"},a))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{var s;const a=this._getSelectionSetIds(i),l=i.workflowType!==c.REFINE||a.length>0;return!this._downloadActive&&i.download&&l&&(this._downloadActive=!0),l&&t.push(e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),e("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},e("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",a.length.toString()))))))),t}),[])||e("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._getSelectionIdsAndViews(this._selectionSets,!0);if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=null==t?void 0:t.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===c.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const e=null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.id;t=this._updateExportInfos(t,e,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,a,l=!1,o=""){return e("calcite-action",{disabled:!t,icon:i,indicator:l,onClick:a,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){var t,i;const s=await(null===(t=this._selectTools)||void 0===t?void 0:t.getSelection()),e=null===(i=this._selectTools)||void 0===i?void 0:i.isUpdate;return this._selectionSets=e?this._selectionSets.map((t=>t.id===s.id?s:t)):[...this._selectionSets,s],this._home()}async _clearSelection(){var t;await(null===(t=this._selectTools)||void 0===t?void 0:t.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){d(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===c.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];p.highlightHandles.push(await r(e.ids,e.layerView,this.mapView))}}_checkPopups(){var t;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(t=this.mapView)||void 0===t?void 0:t.popupEnabled)}_clearHighlight(){p&&p.highlightHandles&&p.removeHandles()}async _getTranslations(){const t=await g(this.el);this._translations=t[0]}get el(){return l(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as i,h as e,H as s,g as a}from"./p-78780f63.js";import{s as l}from"./p-36eb8399.js";import{g as c}from"./p-6b943f52.js";import{n}from"./p-9bcbc1cc.js";import"./p-225c4ca4.js";import"./p-4af32c75.js";import"./p-d89fff3a.js";import"./p-e1a4994d.js";import"./p-a230b270.js";import"./p-220ec0d1.js";import"./p-d918ec36.js";const r=class{constructor(e){t(this,e),this.solutionItemSelected=i(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}valueWatchHandler(t,i){t&&t!==i&&Array.isArray(t)&&t.length>0&&this._treeItemSelected(t[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return e(s,null,e("calcite-tree",null,this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(t){return t.map((t=>{const i=this.selectedItemId&&this.selectedItemId===t.id;return t.dependencies&&t.dependencies.length>0?e("calcite-tree-item",{onClick:i=>this._treeItemSelected(t.id,i),selected:i},e("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),e("span",{class:"icon-text",title:t.title},t.title),e("calcite-tree",{slot:"children"},this.renderHierarchy(t.dependencies))):e("calcite-tree-item",{onClick:i=>this._treeItemSelected(t.id,i),selected:i},e("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),e("span",{class:"icon-text",title:t.title},t.title))}))}_treeItemSelected(t,i){var e;const s=null===(e=null==i?void 0:i.target)||void 0===e?void 0:e.closest("calcite-tree-item");s&&(s.expanded=!(null==s?void 0:s.expanded)),this.selectedItemId=t,this.solutionItemSelected.emit(t)}static get assetsDirs(){return["item-type-icons"]}get el(){return a(this)}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};r.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const o=class{constructor(i){t(this,i),this.authentication=void 0,this.itemId="",this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}itemIdWatchHandler(){const t=l.getItemInfo(this.itemId);this.itemType=t.type}async componentWillLoad(){return this._getTranslations()}render(){return e(s,null,e("div",{class:"configuration-container"},e("div",{class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(t){return e("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},e("calcite-tab-nav",{slot:"tab-nav"},e("calcite-tab-title",null,this._translations.groupDetailsTab),e("calcite-tab-title",null,this._translations.sharingTab)),e("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},e("solution-item-details",{"item-id":this.itemId})),e("calcite-tab",{class:"config-tab",id:"share-tab"},e("solution-item-sharing",{"group-id":this.itemId})))}_showItemTabs(t){return e("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},e("calcite-tab-nav",{slot:"tab-nav"},e("calcite-tab-title",null,this._translations.itemDetailsTab),e("calcite-tab-title",null,this._translations.dataTab),e("calcite-tab-title",null,this._translations.propertiesTab),e("calcite-tab-title",null,this._translations.resourcesTab)),e("calcite-tab",{class:"config-tab",selected:!0},e("solution-item-details",{"item-id":this.itemId})),e("calcite-tab",{class:"config-tab",id:"data-tab"},e("solution-template-data",{instanceid:"data","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),e("calcite-tab",{class:"config-tab",id:"props-tab"},e("solution-template-data",{instanceid:"properties","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),e("calcite-tab",{class:"config-tab",id:"resources-tab"},e("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId})))}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};o.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const h=class{constructor(e){t(this,e),this.featureServiceSpatialReferenceChange=i(this,"featureServiceSpatialReferenceChange",7),this.defaultWkid=102100,this.loaded=!1,this.locked=!0,this.services=[],this.value=this.defaultWkid.toString(),this._srSearchText=void 0,this._translations=void 0}componentWillLoad(){return this._getTranslations()}render(){return e(s,null,e("div",{class:"spatial-ref"},e("div",{class:"spatial-ref-desc"},e("calcite-label",null,this._translations.paramDescription)),e("label",{class:"switch-label"},e("calcite-switch",{checked:!this.locked,class:"spatial-ref-switch",onCalciteSwitchChange:t=>this._updateLocked(t),scale:"m"}),this._translations.specifyParam),e("div",{class:"spatial-ref-component",id:"spatialRefDefn"},e("calcite-label",null,this._translations.spatialReferenceInfo,e("label",{class:"spatial-ref-default"},e("spatial-ref",{defaultWkid:this.defaultWkid,disabled:this.locked,value:this.value}))),this._getFeatureServices(this.services))))}spatialReferenceChange(t){this.value=t.detail.newValue}_updateLocked(t){this.locked=!t.
|
6
|
+
import{r as t,c as i,h as e,H as s,g as a}from"./p-78780f63.js";import{s as l}from"./p-36eb8399.js";import{g as c}from"./p-6b943f52.js";import{n}from"./p-9bcbc1cc.js";import"./p-225c4ca4.js";import"./p-4af32c75.js";import"./p-d89fff3a.js";import"./p-e1a4994d.js";import"./p-a230b270.js";import"./p-220ec0d1.js";import"./p-d918ec36.js";const r=class{constructor(e){t(this,e),this.solutionItemSelected=i(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}valueWatchHandler(t,i){t&&t!==i&&Array.isArray(t)&&t.length>0&&this._treeItemSelected(t[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return e(s,null,e("calcite-tree",null,this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(t){return t.map((t=>{const i=this.selectedItemId&&this.selectedItemId===t.id;return t.dependencies&&t.dependencies.length>0?e("calcite-tree-item",{onClick:i=>this._treeItemSelected(t.id,i),selected:i},e("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),e("span",{class:"icon-text",title:t.title},t.title),e("calcite-tree",{slot:"children"},this.renderHierarchy(t.dependencies))):e("calcite-tree-item",{onClick:i=>this._treeItemSelected(t.id,i),selected:i},e("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),e("span",{class:"icon-text",title:t.title},t.title))}))}_treeItemSelected(t,i){var e;const s=null===(e=null==i?void 0:i.target)||void 0===e?void 0:e.closest("calcite-tree-item");s&&(s.expanded=!(null==s?void 0:s.expanded)),this.selectedItemId=t,this.solutionItemSelected.emit(t)}static get assetsDirs(){return["item-type-icons"]}get el(){return a(this)}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};r.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const o=class{constructor(i){t(this,i),this.authentication=void 0,this.itemId="",this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}itemIdWatchHandler(){const t=l.getItemInfo(this.itemId);this.itemType=t.type}async componentWillLoad(){return this._getTranslations()}render(){return e(s,null,e("div",{class:"configuration-container"},e("div",{class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(t){return e("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},e("calcite-tab-nav",{slot:"tab-nav"},e("calcite-tab-title",null,this._translations.groupDetailsTab),e("calcite-tab-title",null,this._translations.sharingTab)),e("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},e("solution-item-details",{"item-id":this.itemId})),e("calcite-tab",{class:"config-tab",id:"share-tab"},e("solution-item-sharing",{"group-id":this.itemId})))}_showItemTabs(t){return e("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},e("calcite-tab-nav",{slot:"tab-nav"},e("calcite-tab-title",null,this._translations.itemDetailsTab),e("calcite-tab-title",null,this._translations.dataTab),e("calcite-tab-title",null,this._translations.propertiesTab),e("calcite-tab-title",null,this._translations.resourcesTab)),e("calcite-tab",{class:"config-tab",selected:!0},e("solution-item-details",{"item-id":this.itemId})),e("calcite-tab",{class:"config-tab",id:"data-tab"},e("solution-template-data",{instanceid:"data","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),e("calcite-tab",{class:"config-tab",id:"props-tab"},e("solution-template-data",{instanceid:"properties","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),e("calcite-tab",{class:"config-tab",id:"resources-tab"},e("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId})))}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};o.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const h=class{constructor(e){t(this,e),this.featureServiceSpatialReferenceChange=i(this,"featureServiceSpatialReferenceChange",7),this.defaultWkid=102100,this.loaded=!1,this.locked=!0,this.services=[],this.value=this.defaultWkid.toString(),this._srSearchText=void 0,this._translations=void 0}componentWillLoad(){return this._getTranslations()}render(){return e(s,null,e("div",{class:"spatial-ref"},e("div",{class:"spatial-ref-desc"},e("calcite-label",null,this._translations.paramDescription)),e("label",{class:"switch-label"},e("calcite-switch",{checked:!this.locked,class:"spatial-ref-switch",onCalciteSwitchChange:t=>this._updateLocked(t),scale:"m"}),this._translations.specifyParam),e("div",{class:"spatial-ref-component",id:"spatialRefDefn"},e("calcite-label",null,this._translations.spatialReferenceInfo,e("label",{class:"spatial-ref-default"},e("spatial-ref",{defaultWkid:this.defaultWkid,disabled:this.locked,value:this.value}))),this._getFeatureServices(this.services))))}spatialReferenceChange(t){this.value=t.detail.newValue}_updateLocked(t){this.locked=!t.target.checked,this._updateStore(),this.loaded||(t.target.checked&&this._setFeatureServiceDefaults(this.services),this.loaded=!0)}_setFeatureServiceDefaults(t){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((t=>t.checked=!0)),t.forEach((t=>this._updateEnabledServices({detail:{switched:!0}},t)))}_getFeatureServices(t){const i=l.getStoreInfo("spatialReferenceInfo"),s=t.filter((t=>Object.keys(i.services).some((i=>i===t))));return s&&s.length>0?e("div",null,e("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),s.map((t=>e("label",{class:"switch-label"},e("calcite-switch",{checked:i.services[t],class:"spatial-ref-item-switch",disabled:this.locked,onCalciteSwitchChange:i=>this._updateEnabledServices(i,t),scale:"m"}),t)))):null}_updateStore(){const t=l.getStoreInfo("spatialReferenceInfo");t.enabled=!this.locked,t.spatialReference=this.value,l.setStoreInfo("spatialReferenceInfo",t)}_updateEnabledServices(t,i){const e=l.getStoreInfo("spatialReferenceInfo");e.services[i]=t.target.checked,l.setStoreInfo("spatialReferenceInfo",e),this.featureServiceSpatialReferenceChange.emit({name:i,enabled:t.target.checked})}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return a(this)}};h.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-default{margin:0px}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{margin:0.25rem;font-size:0.875rem;line-height:1.25rem}.disabled-div{pointer-events:none;opacity:0.4}.spatial-ref-desc{padding-bottom:0.5rem;padding-inline-start:0.25rem}";export{r as solution_contents,o as solution_item,h as solution_spatial_ref}
|
@@ -44,4 +44,4 @@ function yt(t,i,e){const{items:s,messages:o}=e,a=s.length,n=$(e,t)+1;return func
|
|
44
44
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
45
45
|
* v2.0.0
|
46
46
|
*/
|
47
|
-
const Ct="actions-end",Tt="actions-start",_t=class{constructor(i){t(this,i),this.calciteListItemChange=o(this,"calciteListItemChange",6),this.calciteListItemRemove=o(this,"calciteListItemRemove",7),this.calciteValueListItemDragHandleBlur=o(this,"calciteValueListItemDragHandleBlur",6),this.pickListItem=null,this.guid=`calcite-value-list-item-${I()}`,this.getPickListRef=t=>this.pickListItem=t,this.handleKeyDown=t=>{" "===t.key&&(this.handleActivated=!this.handleActivated)},this.handleBlur=()=>{this.handleActivated=!1,this.calciteValueListItemDragHandleBlur.emit({item:this.el,handle:this.handleEl})},this.handleSelectChange=t=>{this.selected=t.detail.selected},this.description=void 0,this.disabled=!1,this.deselectDisabled=!1,this.nonInteractive=!1,this.handleActivated=!1,this.icon=null,this.iconFlipRtl=!1,this.label=void 0,this.metadata=void 0,this.removable=!1,this.selected=!1,this.value=void 0}connectedCallback(){l(this),H(this)}disconnectedCallback(){r(this),j(this)}componentWillLoad(){W(this)}componentDidLoad(){D(this)}componentDidRender(){A(this,!!this.el.closest("calcite-value-list")&&"managed")}async toggleSelected(t){this.pickListItem.toggleSelected(t)}async setFocus(){var t;return await E(this),null===(t=this.pickListItem)||void 0===t?void 0:t.setFocus()}calciteListItemChangeHandler(t){t.detail.item=this.el}renderActionsEnd(){const{el:t}=this;return f(t,Ct)?i("slot",{name:Ct,slot:lt.actionsEnd}):null}renderActionsStart(){const{el:t}=this;return f(t,Tt)?i("slot",{name:Tt,slot:lt.actionsStart}):null}renderHandle(){const{icon:t,iconFlipRtl:e}=this;if(t===rt.grip)return i("span",{class:{[nt.handle]:!0,[nt.handleActivated]:this.handleActivated},"data-js-handle":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,role:"button",tabindex:"0",ref:t=>this.handleEl=t},i("calcite-icon",{flipRtl:e,icon:"drag",scale:"s"}))}render(){return i(a,{id:this.el.id||this.guid},this.renderHandle(),i("calcite-pick-list-item",{description:this.description,deselectDisabled:this.deselectDisabled,disabled:this.disabled,label:this.label,metadata:this.metadata,nonInteractive:this.nonInteractive,onCalciteListItemChange:this.handleSelectChange,removable:this.removable,selected:this.selected,value:this.value,ref:this.getPickListRef},this.renderActionsStart(),this.renderActionsEnd()))}get el(){return s(this)}};_t.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{margin-block-end:1px;box-sizing:border-box;display:flex;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-2);--tw-shadow:0 1px 0 var(--calcite-color-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition:background-color var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}:host *{box-sizing:border-box}calcite-pick-list-item{position:relative;margin:0px;flex-grow:1;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([active]),:host([selected]){--tw-shadow:0 0 0 1px var(--calcite-color-brand);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.handle{display:flex;cursor:move;align-items:center;justify-content:center;border-style:none;background-color:transparent;padding-block:0px;padding-inline:0.25rem;color:var(--calcite-color-border-input);outline-color:transparent}.handle:hover{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.handle:focus{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.handle--activated{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}.handle calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([hidden]){display:none}[hidden]{display:none}";const It=class{constructor(i){t(this,i),this._loaded=!1,this._useDiffEditor=!1,this.hasChanges=!1,this.hasErrors=!1,this.instanceid="",this.value=""}componentDidLoad(){const t=document.getElementById(`${this.instanceid}-container`);if(t){this._editor=monaco.editor.create(t,{value:this.value,language:"json",theme:"vs",minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1}),this._currentModel=this._editor.getModel(),this._contentChanged=this._currentModel.onDidChangeContent(this._onEditorChange.bind(this));const i=monaco.editor.setModelMarkers,e=this;monaco.editor.setModelMarkers=function(t,s,o){var a,n;t.id===e._currentModel.id&&(e._flagEditorHasErrors(o.length>0),e.hasErrors||(e._flagEditorHasChanges(null===(a=e._currentModel)||void 0===a?void 0:a.canUndo()),(null===(n=e._currentModel)||void 0===n?void 0:n.canUndo())&&e._flagEditorContentChanged()),document.getElementById(`${e.instanceid}-errorFlag`).style.visibility=e.hasErrors?"visible":"hidden"),i.call(monaco.editor,t,s,o)},this._diffEditor=monaco.editor.createDiffEditor(document.getElementById(`${this.instanceid}-diff-container`),{automaticLayout:!0}),this._setDiffModel(),this._loaded=!0,this._toggleUndoRedo()}}async componentWillLoad(){this._initValueObserver(),await this._getTranslations()}render(){return i(a,null,i("div",{id:`${this.instanceid}-editor-container`,class:"editor-container padding-right"},i("div",{class:"editor-controls"},i("div",{class:"editor-buttons"},i("calcite-icon",{id:`${this.instanceid}-errorFlag`,icon:"exclamation-mark-triangle",title:this._translations.errorFlag,scale:"s",class:"edit-error-flag"}),i("calcite-button",{id:`${this.instanceid}-undo`,color:"blue",appearance:"solid",title:this._translations.undo,onClick:()=>this._undo(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"undo",scale:"s"})),i("calcite-button",{id:`${this.instanceid}-redo`,color:"blue",appearance:"solid",title:this._translations.redo,onClick:()=>this._redo(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"redo",scale:"s"})),i("calcite-button",{id:`${this.instanceid}-diff`,color:"blue",appearance:"solid",title:this._translations.diff,onClick:()=>this._toggleEditor(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"compare",scale:"s"})),i("calcite-button",{id:`${this.instanceid}-search`,appearance:"outline",color:"blue",title:this._translations.search,onClick:()=>this._search(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"search",scale:"s"})),i("calcite-button",{id:`${this.instanceid}-reset`,color:"blue",appearance:"solid",disabled:!0,title:this._translations.cancelEdits,onClick:()=>this._reset(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"reset",scale:"s"})))),i("div",{class:"edit-parent"},i("div",{id:`${this.instanceid}-container`,class:"json-edit-container"}),i("div",{id:`${this.instanceid}-diff-container`,class:"json-edit-container display-none"}))))}async getEditorContents(){return new Promise(((t,i)=>{try{t(this._currentModel.getValue())}catch(t){i(t)}}))}async prepareForDeletion(){var t,i,e,s,o;null===(t=this._searchBtnHandler)||void 0===t||t.removeEventListener("click",this._search),null===(i=this._cancelEditsBtnHandler)||void 0===i||i.removeEventListener("click",this._reset),null===(e=this._valueObserver)||void 0===e||e.disconnect(),null===(s=this._contentChanged)||void 0===s||s.dispose(),null===(o=this._editor)||void 0===o||o.dispose()}async replaceCurrentSelection(t){const i=this._editor.getSelection();this._editor.executeEdits("",[{range:i,text:t}])}async reset(){return new Promise(((t,i)=>{try{this._reset(),t({success:!0})}catch(t){i(t)}}))}_disableButton(t){var i;null===(i=document.getElementById(t))||void 0===i||i.setAttribute("disabled","")}_enableButton(t){var i;null===(i=document.getElementById(t))||void 0===i||i.removeAttribute("disabled")}_flagEditorContentChanged(){window.dispatchEvent(new CustomEvent("solutionEditorContentChanged",{detail:{id:this.instanceid,contents:this._currentModel.getValue()},bubbles:!0,cancelable:!1,composed:!0}))}_flagEditorHasChanges(t){this.hasChanges!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasChanges",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasChanges=t)}_flagEditorHasErrors(t){this.hasErrors!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasErrors",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasErrors=t)}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}_initValueObserver(){this._valueObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"value"===t.attributeName&&t.target[t.attributeName]!==t.oldValue&&this._loaded&&this._currentModel.setValue(this.value)}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}_onEditorChange(){this._toggleUndoRedo()}_redo(){var t;(null===(t=this._currentModel)||void 0===t?void 0:t.canRedo())&&(this._currentModel.redo(),this._toggleUndoRedo())}_reset(){this._currentModel.setValue(this.value),this._toggleUndoRedo()}_search(){this._editor.trigger("toggleFind","actions.find")}_setDiffModel(){this._diffEditor&&this._diffEditor.setModel({original:monaco.editor.createModel(this.value,"json"),modified:this._editor.getModel()})}_toggleEditor(){this._useDiffEditor=!this._useDiffEditor;let t=document.getElementById(`${this.instanceid}-diff-container`),i=document.getElementById(`${this.instanceid}-container`);this._useDiffEditor?(this._setDiffModel(),t.classList.remove("display-none"),i.classList.add("display-none")):(t.classList.add("display-none"),i.classList.remove("display-none"))}_toggleUndoRedo(){var t,i,e,s;(null===(t=this._currentModel)||void 0===t?void 0:t.canUndo())?this._enableButton(`${this.instanceid}-undo`):this._disableButton(`${this.instanceid}-undo`),(null===(i=this._currentModel)||void 0===i?void 0:i.canRedo())?this._enableButton(`${this.instanceid}-redo`):this._disableButton(`${this.instanceid}-redo`),(null===(e=this._currentModel)||void 0===e?void 0:e.canUndo())||(null===(s=this._currentModel)||void 0===s?void 0:s.canRedo())?this._enableButton(`${this.instanceid}-reset`):this._disableButton(`${this.instanceid}-reset`)}_undo(){var t;(null===(t=this._currentModel)||void 0===t?void 0:t.canUndo())&&(this._currentModel.undo(),this._toggleUndoRedo())}static get assetsDirs(){return["assets"]}get el(){return s(this)}};It.style=":host{display:block}.editor-container{position:relative;height:100%}.editor-controls{height:2.75rem;padding-right:0.5rem;background-color:#F4F4F4}.editor-buttons{float:right}html[dir=rtl] .editor-buttons{float:left}.edit-error-flag{padding-top:0.5rem;color:red;visibility:hidden}.edit-button{padding-inline-start:0.5rem}.editor-text{width:100%;overflow-y:auto;background-color:#FFFFFF}.edit-width{width:100%}.edit-parent{box-sizing:border-box;width:100%;height:calc(100% - 46px)}.json-edit-container{height:100%;width:100%;border:1px #808080 solid}.padding-right{padding-inline-end:0.125rem}.btn{margin-bottom:1rem;display:flex;align-content:center;height:25px;width:120px}.select-ctrl{margin-bottom:1rem}.all-edits{margin-top:4rem}.floating-title{font-size:2rem;z-index:100;position:absolute;left:0.5rem;pointer-events:none}.floating-title-button{pointer-events:auto}.json-editor-position1{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:100%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2a{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2b{position:absolute;right:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}";const Lt=class{constructor(i){t(this,i),this.itemId="",this.itemDetails={accessInformation:"",description:"",licenseInfo:"",snippet:"",tags:[],title:""},this.itemEdit=void 0,this._translations=void 0,this.thumbnail=void 0,this.thumbnailContainer=void 0}async componentWillLoad(){return this._getTranslations()}async componentWillRender(){return this.itemEdit=ht.getItemInfo(this.itemId),this.itemEdit&&(this.itemDetails=this.itemEdit.item,this.itemType=this.itemDetails.type),Promise.resolve()}render(){return i(a,null,i("div",{class:"parent-container"},i("div",{class:"inputBottomSeparation"},i("calcite-input",{id:"item-title",value:this.itemDetails.title})),i("div",{class:"inputBottomSeparation"},i("input",{accept:".jpg,.gif,.png,image/jpg,image/gif,image/png",class:"display-none",onChange:t=>this._updateThumbnail(t),ref:t=>this.browseForThumbnail=t,type:"file"}),i("button",{class:"font-size--3 btn-link inline-block trailer-quarter",onClick:()=>this._getThumbnail()},i("svg",{class:"icon-inline icon-inline--on-left",height:"16",viewBox:"0 0 16 16",width:"16"},i("path",{d:"M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"})),this._translations.editThumbnail),i("div",{class:"flex"},i("div",{class:"img-container",ref:t=>this.thumbnailContainer=t},i("img",{class:"scale-down",height:"133",id:"item-thumbnail",ref:t=>this.thumbnail=t,width:"200"})),i("div",{class:"snippet-count-container"},i("calcite-input",{id:"item-snippet",maxLength:250,type:"textarea",value:this.itemDetails.snippet}),i("label",{class:"font-size--3",id:"item-snippet-count",ref:t=>this.itemSnippetCount=t})))),i("calcite-label",null,this._translations.description,i("label",{id:"item-description-label"},i("calcite-input",{id:"item-description",type:"textarea",value:this.itemDetails.description}))),i("calcite-label",null,this._translations.tags,i("label",{id:"item-tags-label"},i("calcite-input",{id:"item-tags",value:(this.itemDetails.tags&&Array.isArray(this.itemDetails.tags)?this.itemDetails.tags:[this.itemDetails.tags]).join(",")}))),"Group"!==this.itemType?i("calcite-label",null,this._translations.credits,i("label",{id:"item-credits-label"},i("calcite-input",{id:"item-credits",value:this.itemDetails.accessInformation}))):null,"Group"!==this.itemType?i("calcite-label",null,i("label",{id:"item-terms-label"},this._translations.termsOfUse,i("calcite-input",{id:"item-terms",type:"textarea",value:this.itemDetails.licenseInfo}))):null))}componentDidRender(){this._loadThumb()}inputReceivedHandler(t){switch(t.target.id){case"item-title":this.itemDetails.title=t.target.value,this._updateStore();break;case"item-snippet":t.target.value.length>250&&(t.target.value=t.target.value.substring(0,250)),this.itemDetails.snippet=t.target.value,this._updateLengthLabel(this.itemDetails.snippet),this._updateStore();break;case"item-description":this.itemDetails.description=t.target.value,this._updateStore();break;case"item-tags":this.itemDetails.tags=t.target.value,this._updateStore();break;case"item-credits":this.itemDetails.accessInformation=t.target.value,this._updateStore();break;case"item-terms":this.itemDetails.licenseInfo=t.target.value,this._updateStore()}}_getThumbnail(){this.browseForThumbnail.click()}_loadThumb(){var t;this.thumbnail&&(null===(t=this.itemEdit)||void 0===t?void 0:t.thumbnail)?(this.thumbnail.src=URL.createObjectURL(this.itemEdit.thumbnail),this.thumbnailContainer.classList.remove("empty-box"),this.thumbnail.classList.remove("display-none")):(this.thumbnailContainer.classList.add("empty-box"),this.thumbnail.classList.add("display-none"))}_updateLengthLabel(t){this.itemSnippetCount.innerText=this._translations.snippetCountPattern.replace("{{n}}",t.length.toString())}_updateStore(){this.itemEdit=ht.getItemInfo(this.itemId),this.itemEdit.item=this.itemDetails,ht.setItemInfo(this.itemEdit)}_updateThumbnail(t){const i=t.target.files;i&&i[0]&&this.thumbnail&&(this.thumbnail.src=URL.createObjectURL(i[0]),this.itemEdit=ht.getItemInfo(this.itemId),this.itemEdit.thumbnail=i[0],ht.replaceItemThumbnail(this.itemEdit))}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}};Lt.style=".inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.icon-inline--on-left,.icon-inline--on-right{display:inline;vertical-align:middle;margin-inline-end:0.375rem;fill:#0079c1}.scale-down{-o-object-fit:scale-down;object-fit:scale-down}.img-container{display:inline;margin-inline-end:1rem;max-width:363px}.summary-count-container{display:inline;flex-grow:1;margin-inline-start:0.75rem}.snippet-count-container{width:calc(100vw - 363px)}.parent-container{max-width:100%;padding:1rem}label{position:relative;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem;display:block;min-width:-moz-min-content;min-width:min-content}";const Ht=class{constructor(i){t(this,i),this.groupId="",this._translations=void 0,this.sharing=[]}itemIdWatchHandler(){const t=ht.getItemInfo(this.groupId);this.sharing=t.groupDetails}async componentWillLoad(){return this._getTranslations()}render(){return i(a,null,i("div",{class:"container-border"},i("calcite-label",null,this._translations.groupInfo),this._renderItems(this.sharing)))}async getShareInfo(){return this.sharing}_renderItems(t){return t&&t.length>0?t.map((t=>i("calcite-label",{layout:"inline"},i("calcite-switch",{checked:t.shareItem,id:t.id,name:"setting",onCalciteSwitchChange:t=>this._updateItem(t),scale:"m",value:"enabled"}),i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title)))):null}_updateItem(t){const i=t.target.id;this.sharing=this.sharing.map((e=>{if(e.id===i){e.shareItem=t.detail.switched;const s=ht.getItemInfo(i);if(e.shareItem)s.groups?s.groups.indexOf(this.groupId)<0&&s.groups.push(this.groupId):s.groups=[this.groupId];else if(s.groups){const t=s.groups.indexOf(this.groupId);t>-1&&s.groups.splice(t,1)}ht.setItemInfo(s)}return e}))}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{groupId:["itemIdWatchHandler"]}}};Ht.style=":host{display:block}.container-border{padding:1rem}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const jt=class{constructor(i){t(this,i),this.organizationVariableSelected=o(this,"organizationVariableSelected",7),this.value="",this._organizationVariables=[],this._translations=void 0}valueWatchHandler(){this._organizationVariables=JSON.parse(this.value)}async componentWillLoad(){return this._getTranslations()}render(){return i(a,null,i("div",null,i("h4",{class:"org-var-header"},this._translations.orgVariables)),i("div",{class:"container-border"},i("calcite-tree",{id:"variable-label"},this._renderHierarchy(this._organizationVariables))))}_renderHierarchy(t){return t.map((t=>i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,i){this.organizationVariableSelected.emit({itemId:t,value:i})}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{value:["valueWatchHandler"]}}};jt.style=":host{display:block}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";const At=class{constructor(i){t(this,i),this._removedResources={},this.authentication=void 0,this.itemId="",this.resourceFilePaths=[],this.resources=[],this._translations=void 0}itemIdWatchHandler(){const t=ht.getItemInfo(this.itemId);this.resourceFilePaths=t.resourceFilePaths,this.resources=t.resources.map((t=>t.substring(t.lastIndexOf("/")+1)))}componentWillLoad(){return this._getTranslations()}render(){const t=this._hasValidResources();return i(a,null,i("div",{class:"resource-item"},i("div",{class:"margin-bottom-1"},i("calcite-button",{appearance:"solid",class:"resource-button",color:"blue",onClick:()=>this._addNewResource()},this._translations.addResource),i("calcite-button",{appearance:"solid",color:"blue",disabled:!t,onClick:()=>this._downloadAll()},this._translations.downloadAll)),i("div",{class:"resources-container",style:{display:t?"inherit":"none"}},this._renderResourceList())))}_renderResourceList(){return i("calcite-value-list",{multiple:!0},this.resourceFilePaths.reduce(((t,i)=>(i.type!==pt.Thumbnail&&t.push(this._renderResource(i)),t)),[]))}_renderResource(t){const e=t.updateType===dt.Remove;return i("calcite-value-list-item",{class:e?"disabled":"",label:t.folder?t.folder+"/"+t.filename:t.filename,nonInteractive:!0,value:t.url},i("calcite-action-group",{"expand-disabled":"true",layout:"horizontal",slot:"actions-end"},i("calcite-action",{disabled:e,icon:"download",label:this._translations.download,onClick:()=>this._download(t.url,t.filename),scale:"m",text:this._translations.download,title:this._translations.download}),i("calcite-action",{disabled:e,icon:"upload-to",label:this._translations.update,onClick:()=>this._upload(t),scale:"m",text:this._translations.update,title:this._translations.update}),i("calcite-action",{disabled:e,icon:"trash",label:this._translations.delete,onClick:()=>this._delete(t),scale:"m",text:this._translations.delete,title:this._translations.delete}),e?i("calcite-action",{icon:"reset",label:this._translations.reset,onClick:()=>this._reset(t.filename),scale:"m",text:this._translations.reset,title:this._translations.reset}):i("div",{class:"display-none"})))}_delete(t){t.updateType=dt.Remove,this.resourceFilePaths=[...this.resourceFilePaths],this._updateStore()}_reset(t){this.resourceFilePaths=this.resources.some((i=>i===t))?this.resourceFilePaths.map((i=>(i.filename===t&&(i.updateType=dt.None),i))):this.resourceFilePaths.map((i=>(i.filename===t&&(i.updateType=dt.Add),i))),this._updateStore()}_downloadAll(){this.resourceFilePaths.forEach((t=>{this._download(t.url,t.filename)}))}_download(t,i){t.startsWith("blob")?this.downloadFile(t,i):this.fetchAndDownload(`${t}?token=${this.authentication.token}`,i)}downloadFile(t,i){const e=document.createElement("a");e.href=t,e.download=i,e.target="_blank",e.click()}_hasValidResources(){return this.resourceFilePaths.some((t=>t.url.indexOf("_info_thumbnail")<0))}async fetchAndDownload(t,i){const e=await fetch(t),s=await e.blob(),o=URL.createObjectURL(s);this.downloadFile(o,i)}_upload(t){const i=document.createElement("input");i.classList.add("display-none"),i.onchange=this._updateResource.bind(this,t),i.type="file",i.click()}_addNewResource(){const t=document.createElement("input");t.classList.add("display-none"),t.onchange=this._add.bind(this),t.type="file",t.click()}_updateResource(t,i){const e=i.target.files;e&&e[0]&&(t.blob=e[0],t.updateType=dt.Update,this._updateStore())}_add(t){const i=t.target.files;if(i&&i[0]){const t=URL.createObjectURL(i[0]),e=i[0].name;this.resourceFilePaths.some((i=>i.filename===e&&i.url===t))||(this.resourceFilePaths=[...this.resourceFilePaths,{url:t,type:pt.Data,folder:void 0,filename:e,blob:i[0],updateType:dt.Add}],this._updateStore())}}_updateStore(){const t=ht.getItemInfo(this.itemId);t.resourceFilePaths=this.resourceFilePaths,ht.setItemInfo(t)}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};At.style=":host{display:block}.resource-item{padding:1rem}.resource-button{margin-inline-end:1rem}.resource-progress{padding-top:1rem}.resources-container{border:1px #808080 solid}.margin-bottom-1{margin-bottom:1rem}";const St=class{itemIdWatchHandler(){this._initializing=!0,this.value=JSON.stringify("data"===this.instanceid?ht.getItemInfo(this.itemId).data:ht.getItemInfo(this.itemId).properties,null,2)}constructor(i){t(this,i),this._initializing=!1,this.instanceid="",this.itemId="",this.organizationVariables="",this.solutionVariables="",this.varsOpen=!0,this._translations=void 0,this.value="",window.addEventListener("solutionEditorContentChanged",(t=>{if(this.itemId){const{id:i,contents:e}=t.detail,[s,o]=i.split("|");if(s==this.itemId&&o===this.instanceid){if(!this._initializing&&e.length>0){const t=ht.getItemInfo(s);"data"===o?t.data=JSON.parse(e):t.properties=JSON.parse(e),ht.setItemInfo(t)}this._initializing=!1}}}))}componentWillLoad(){return this._getTranslations()}render(){return i(a,null,i("div",{class:"solution-data-container"},i("calcite-shell",{class:"light var-container",dir:"ltr"},i("calcite-panel",{class:"json-editor"},i("div",{class:"solution-data-child-container calcite-match-height"},i("json-editor",{class:"solution-data-editor-container",instanceid:this.itemId+"|"+this.instanceid,value:this.value}))),i("calcite-shell-panel",{"height-scale":"l",position:"end",slot:"contextual-panel","width-scale":"xs"},i("div",{class:this.varsOpen?"solution-data-child-container":"solution-data-child-container-collapsed"},i("calcite-button",{appearance:"transparent",class:"collapse-btn","icon-start":this.varsOpen?"chevrons-right":"chevrons-left",id:"collapse-vars",onClick:()=>this._toggleVars(),scale:"s",title:this.varsOpen?this._translations.collapse:this._translations.expand}),i("div",{class:this.varsOpen?"org-vars":"org-vars display-none",id:"orgVars"},i("solution-organization-variables",{value:this.organizationVariables})),i("div",{class:this.varsOpen?"sol-vars":"sol-vars display-none",id:"solVars"},i("solution-variables",{value:this.solutionVariables})))))))}_toggleVars(){this.varsOpen=!this.varsOpen}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};St.style=":host{display:flexbox}.solution-data-container{position:absolute;height:-moz-available;height:calc(100% - 48px);height:-webkit-fill-available;height:stretch;width:-moz-available;width:100%;width:-webkit-fill-available;width:stretch}.solution-data-child-container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.solution-data-editor-container{height:100%}.solution-data-child-container-collapsed{display:flex;height:100%;flex-direction:column;overflow:auto;width:50px}.inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.json-editor{margin:1rem;width:auto;width:-webkit-fill-available -moz-available}.collapse-btn{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.org-vars{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.sol-vars{padding-top:0px;padding-bottom:0px;padding-left:1rem;padding-right:1rem;min-height:45%}.padding-1{padding:1rem}.light{background-color:#F4F4F4}";const Wt=class{constructor(i){t(this,i),this.solutionVariableSelected=o(this,"solutionVariableSelected",7),this.value="",this._solutionVariables=[],this._translations=void 0}valueWatchHandler(){this._solutionVariables=JSON.parse(this.value)}componentWillLoad(){return this._getTranslations()}render(){return i(a,null,i("div",null,i("h4",{class:"org-var-header"},this._translations.solVariables)),i("div",{class:"container-border"},i("calcite-tree",{id:"variable-label"},this._renderHierarchy(this._solutionVariables))))}_renderHierarchy(t){return t.map((t=>t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:t=>this._toggleExpand(t)},i("solution-item-icon",{type:t.type}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this._renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,i){this.solutionVariableSelected.emit({itemId:t,value:i})}_toggleExpand(t){var i;const e=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.closest("calcite-tree-item");e&&(e.expanded=!e.expanded)}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{value:["valueWatchHandler"]}}};Wt.style=":host{display:block}.container-border{overflow-y:hidden}.org-var-header{margin-top:1rem;margin-bottom:1rem;margin-left:0px;margin-right:0px}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";export{bt as calcite_shell_panel,ut as calcite_tab,mt as calcite_tab_nav,ft as calcite_tab_title,xt as calcite_tabs,zt as calcite_value_list,_t as calcite_value_list_item,It as json_editor,Lt as solution_item_details,Ht as solution_item_sharing,jt as solution_organization_variables,At as solution_resource_item,St as solution_template_data,Wt as solution_variables}
|
47
|
+
const Ct="actions-end",Tt="actions-start",_t=class{constructor(i){t(this,i),this.calciteListItemChange=o(this,"calciteListItemChange",6),this.calciteListItemRemove=o(this,"calciteListItemRemove",7),this.calciteValueListItemDragHandleBlur=o(this,"calciteValueListItemDragHandleBlur",6),this.pickListItem=null,this.guid=`calcite-value-list-item-${I()}`,this.getPickListRef=t=>this.pickListItem=t,this.handleKeyDown=t=>{" "===t.key&&(this.handleActivated=!this.handleActivated)},this.handleBlur=()=>{this.handleActivated=!1,this.calciteValueListItemDragHandleBlur.emit({item:this.el,handle:this.handleEl})},this.handleSelectChange=t=>{this.selected=t.detail.selected},this.description=void 0,this.disabled=!1,this.deselectDisabled=!1,this.nonInteractive=!1,this.handleActivated=!1,this.icon=null,this.iconFlipRtl=!1,this.label=void 0,this.metadata=void 0,this.removable=!1,this.selected=!1,this.value=void 0}connectedCallback(){l(this),H(this)}disconnectedCallback(){r(this),j(this)}componentWillLoad(){W(this)}componentDidLoad(){D(this)}componentDidRender(){A(this,!!this.el.closest("calcite-value-list")&&"managed")}async toggleSelected(t){this.pickListItem.toggleSelected(t)}async setFocus(){var t;return await E(this),null===(t=this.pickListItem)||void 0===t?void 0:t.setFocus()}calciteListItemChangeHandler(t){t.detail.item=this.el}renderActionsEnd(){const{el:t}=this;return f(t,Ct)?i("slot",{name:Ct,slot:lt.actionsEnd}):null}renderActionsStart(){const{el:t}=this;return f(t,Tt)?i("slot",{name:Tt,slot:lt.actionsStart}):null}renderHandle(){const{icon:t,iconFlipRtl:e}=this;if(t===rt.grip)return i("span",{class:{[nt.handle]:!0,[nt.handleActivated]:this.handleActivated},"data-js-handle":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,role:"button",tabindex:"0",ref:t=>this.handleEl=t},i("calcite-icon",{flipRtl:e,icon:"drag",scale:"s"}))}render(){return i(a,{id:this.el.id||this.guid},this.renderHandle(),i("calcite-pick-list-item",{description:this.description,deselectDisabled:this.deselectDisabled,disabled:this.disabled,label:this.label,metadata:this.metadata,nonInteractive:this.nonInteractive,onCalciteListItemChange:this.handleSelectChange,removable:this.removable,selected:this.selected,value:this.value,ref:this.getPickListRef},this.renderActionsStart(),this.renderActionsEnd()))}get el(){return s(this)}};_t.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{margin-block-end:1px;box-sizing:border-box;display:flex;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-2);--tw-shadow:0 1px 0 var(--calcite-color-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition:background-color var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}:host *{box-sizing:border-box}calcite-pick-list-item{position:relative;margin:0px;flex-grow:1;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([active]),:host([selected]){--tw-shadow:0 0 0 1px var(--calcite-color-brand);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.handle{display:flex;cursor:move;align-items:center;justify-content:center;border-style:none;background-color:transparent;padding-block:0px;padding-inline:0.25rem;color:var(--calcite-color-border-input);outline-color:transparent}.handle:hover{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.handle:focus{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.handle--activated{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}.handle calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([hidden]){display:none}[hidden]{display:none}";const It=class{constructor(i){t(this,i),this._loaded=!1,this._useDiffEditor=!1,this.hasChanges=!1,this.hasErrors=!1,this.instanceid="",this.value=""}componentDidLoad(){const t=document.getElementById(`${this.instanceid}-container`);if(t){this._editor=monaco.editor.create(t,{value:this.value,language:"json",theme:"vs",minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1}),this._currentModel=this._editor.getModel(),this._contentChanged=this._currentModel.onDidChangeContent(this._onEditorChange.bind(this));const i=monaco.editor.setModelMarkers,e=this;monaco.editor.setModelMarkers=function(t,s,o){var a,n;t.id===e._currentModel.id&&(e._flagEditorHasErrors(o.length>0),e.hasErrors||(e._flagEditorHasChanges(null===(a=e._currentModel)||void 0===a?void 0:a.canUndo()),(null===(n=e._currentModel)||void 0===n?void 0:n.canUndo())&&e._flagEditorContentChanged()),document.getElementById(`${e.instanceid}-errorFlag`).style.visibility=e.hasErrors?"visible":"hidden"),i.call(monaco.editor,t,s,o)},this._diffEditor=monaco.editor.createDiffEditor(document.getElementById(`${this.instanceid}-diff-container`),{automaticLayout:!0}),this._setDiffModel(),this._loaded=!0,this._toggleUndoRedo()}}async componentWillLoad(){this._initValueObserver(),await this._getTranslations()}render(){return i(a,null,i("div",{id:`${this.instanceid}-editor-container`,class:"editor-container padding-right"},i("div",{class:"editor-controls"},i("div",{class:"editor-buttons"},i("calcite-icon",{id:`${this.instanceid}-errorFlag`,icon:"exclamation-mark-triangle",title:this._translations.errorFlag,scale:"s",class:"edit-error-flag"}),i("calcite-button",{id:`${this.instanceid}-undo`,color:"blue",appearance:"solid",title:this._translations.undo,onClick:()=>this._undo(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"undo",scale:"s"})),i("calcite-button",{id:`${this.instanceid}-redo`,color:"blue",appearance:"solid",title:this._translations.redo,onClick:()=>this._redo(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"redo",scale:"s"})),i("calcite-button",{id:`${this.instanceid}-diff`,color:"blue",appearance:"solid",title:this._translations.diff,onClick:()=>this._toggleEditor(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"compare",scale:"s"})),i("calcite-button",{id:`${this.instanceid}-search`,appearance:"outline",color:"blue",title:this._translations.search,onClick:()=>this._search(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"search",scale:"s"})),i("calcite-button",{id:`${this.instanceid}-reset`,color:"blue",appearance:"solid",disabled:!0,title:this._translations.cancelEdits,onClick:()=>this._reset(),scale:"s",class:"edit-button"},i("calcite-icon",{icon:"reset",scale:"s"})))),i("div",{class:"edit-parent"},i("div",{id:`${this.instanceid}-container`,class:"json-edit-container"}),i("div",{id:`${this.instanceid}-diff-container`,class:"json-edit-container display-none"}))))}async getEditorContents(){return new Promise(((t,i)=>{try{t(this._currentModel.getValue())}catch(t){i(t)}}))}async prepareForDeletion(){var t,i,e,s,o;null===(t=this._searchBtnHandler)||void 0===t||t.removeEventListener("click",this._search),null===(i=this._cancelEditsBtnHandler)||void 0===i||i.removeEventListener("click",this._reset),null===(e=this._valueObserver)||void 0===e||e.disconnect(),null===(s=this._contentChanged)||void 0===s||s.dispose(),null===(o=this._editor)||void 0===o||o.dispose()}async replaceCurrentSelection(t){const i=this._editor.getSelection();this._editor.executeEdits("",[{range:i,text:t}])}async reset(){return new Promise(((t,i)=>{try{this._reset(),t({success:!0})}catch(t){i(t)}}))}_disableButton(t){var i;null===(i=document.getElementById(t))||void 0===i||i.setAttribute("disabled","")}_enableButton(t){var i;null===(i=document.getElementById(t))||void 0===i||i.removeAttribute("disabled")}_flagEditorContentChanged(){window.dispatchEvent(new CustomEvent("solutionEditorContentChanged",{detail:{id:this.instanceid,contents:this._currentModel.getValue()},bubbles:!0,cancelable:!1,composed:!0}))}_flagEditorHasChanges(t){this.hasChanges!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasChanges",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasChanges=t)}_flagEditorHasErrors(t){this.hasErrors!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasErrors",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasErrors=t)}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}_initValueObserver(){this._valueObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"value"===t.attributeName&&t.target[t.attributeName]!==t.oldValue&&this._loaded&&this._currentModel.setValue(this.value)}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}_onEditorChange(){this._toggleUndoRedo()}_redo(){var t;(null===(t=this._currentModel)||void 0===t?void 0:t.canRedo())&&(this._currentModel.redo(),this._toggleUndoRedo())}_reset(){this._currentModel.setValue(this.value),this._toggleUndoRedo()}_search(){this._editor.trigger("toggleFind","actions.find")}_setDiffModel(){this._diffEditor&&this._diffEditor.setModel({original:monaco.editor.createModel(this.value,"json"),modified:this._editor.getModel()})}_toggleEditor(){this._useDiffEditor=!this._useDiffEditor;let t=document.getElementById(`${this.instanceid}-diff-container`),i=document.getElementById(`${this.instanceid}-container`);this._useDiffEditor?(this._setDiffModel(),t.classList.remove("display-none"),i.classList.add("display-none")):(t.classList.add("display-none"),i.classList.remove("display-none"))}_toggleUndoRedo(){var t,i,e,s;(null===(t=this._currentModel)||void 0===t?void 0:t.canUndo())?this._enableButton(`${this.instanceid}-undo`):this._disableButton(`${this.instanceid}-undo`),(null===(i=this._currentModel)||void 0===i?void 0:i.canRedo())?this._enableButton(`${this.instanceid}-redo`):this._disableButton(`${this.instanceid}-redo`),(null===(e=this._currentModel)||void 0===e?void 0:e.canUndo())||(null===(s=this._currentModel)||void 0===s?void 0:s.canRedo())?this._enableButton(`${this.instanceid}-reset`):this._disableButton(`${this.instanceid}-reset`)}_undo(){var t;(null===(t=this._currentModel)||void 0===t?void 0:t.canUndo())&&(this._currentModel.undo(),this._toggleUndoRedo())}static get assetsDirs(){return["assets"]}get el(){return s(this)}};It.style=":host{display:block}.editor-container{position:relative;height:100%}.editor-controls{height:2.75rem;padding-right:0.5rem;background-color:#F4F4F4}.editor-buttons{float:right}html[dir=rtl] .editor-buttons{float:left}.edit-error-flag{padding-top:0.5rem;color:red;visibility:hidden}.edit-button{padding-inline-start:0.5rem}.editor-text{width:100%;overflow-y:auto;background-color:#FFFFFF}.edit-width{width:100%}.edit-parent{box-sizing:border-box;width:100%;height:calc(100% - 46px)}.json-edit-container{height:100%;width:100%;border:1px #808080 solid}.padding-right{padding-inline-end:0.125rem}.btn{margin-bottom:1rem;display:flex;align-content:center;height:25px;width:120px}.select-ctrl{margin-bottom:1rem}.all-edits{margin-top:4rem}.floating-title{font-size:2rem;z-index:100;position:absolute;left:0.5rem;pointer-events:none}.floating-title-button{pointer-events:auto}.json-editor-position1{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:100%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2a{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2b{position:absolute;right:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}";const Lt=class{constructor(i){t(this,i),this.itemId="",this.itemDetails={accessInformation:"",description:"",licenseInfo:"",snippet:"",tags:[],title:""},this.itemEdit=void 0,this._translations=void 0,this.thumbnail=void 0,this.thumbnailContainer=void 0}async componentWillLoad(){return this._getTranslations()}async componentWillRender(){return this.itemEdit=ht.getItemInfo(this.itemId),this.itemEdit&&(this.itemDetails=this.itemEdit.item,this.itemType=this.itemDetails.type),Promise.resolve()}render(){return i(a,null,i("div",{class:"parent-container"},i("div",{class:"inputBottomSeparation"},i("calcite-input",{id:"item-title",value:this.itemDetails.title})),i("div",{class:"inputBottomSeparation"},i("input",{accept:".jpg,.gif,.png,image/jpg,image/gif,image/png",class:"display-none",onChange:t=>this._updateThumbnail(t),ref:t=>this.browseForThumbnail=t,type:"file"}),i("button",{class:"font-size--3 btn-link inline-block trailer-quarter",onClick:()=>this._getThumbnail()},i("svg",{class:"icon-inline icon-inline--on-left",height:"16",viewBox:"0 0 16 16",width:"16"},i("path",{d:"M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"})),this._translations.editThumbnail),i("div",{class:"flex"},i("div",{class:"img-container",ref:t=>this.thumbnailContainer=t},i("img",{class:"scale-down",height:"133",id:"item-thumbnail",ref:t=>this.thumbnail=t,width:"200"})),i("div",{class:"snippet-count-container"},i("calcite-input",{id:"item-snippet",maxLength:250,type:"textarea",value:this.itemDetails.snippet}),i("label",{class:"font-size--3",id:"item-snippet-count",ref:t=>this.itemSnippetCount=t})))),i("calcite-label",null,this._translations.description,i("label",{id:"item-description-label"},i("calcite-input",{id:"item-description",type:"textarea",value:this.itemDetails.description}))),i("calcite-label",null,this._translations.tags,i("label",{id:"item-tags-label"},i("calcite-input",{id:"item-tags",value:(this.itemDetails.tags&&Array.isArray(this.itemDetails.tags)?this.itemDetails.tags:[this.itemDetails.tags]).join(",")}))),"Group"!==this.itemType?i("calcite-label",null,this._translations.credits,i("label",{id:"item-credits-label"},i("calcite-input",{id:"item-credits",value:this.itemDetails.accessInformation}))):null,"Group"!==this.itemType?i("calcite-label",null,i("label",{id:"item-terms-label"},this._translations.termsOfUse,i("calcite-input",{id:"item-terms",type:"textarea",value:this.itemDetails.licenseInfo}))):null))}componentDidRender(){this._loadThumb()}inputReceivedHandler(t){switch(t.target.id){case"item-title":this.itemDetails.title=t.target.value,this._updateStore();break;case"item-snippet":t.target.value.length>250&&(t.target.value=t.target.value.substring(0,250)),this.itemDetails.snippet=t.target.value,this._updateLengthLabel(this.itemDetails.snippet),this._updateStore();break;case"item-description":this.itemDetails.description=t.target.value,this._updateStore();break;case"item-tags":this.itemDetails.tags=t.target.value,this._updateStore();break;case"item-credits":this.itemDetails.accessInformation=t.target.value,this._updateStore();break;case"item-terms":this.itemDetails.licenseInfo=t.target.value,this._updateStore()}}_getThumbnail(){this.browseForThumbnail.click()}_loadThumb(){var t;this.thumbnail&&(null===(t=this.itemEdit)||void 0===t?void 0:t.thumbnail)?(this.thumbnail.src=URL.createObjectURL(this.itemEdit.thumbnail),this.thumbnailContainer.classList.remove("empty-box"),this.thumbnail.classList.remove("display-none")):(this.thumbnailContainer.classList.add("empty-box"),this.thumbnail.classList.add("display-none"))}_updateLengthLabel(t){this.itemSnippetCount.innerText=this._translations.snippetCountPattern.replace("{{n}}",t.length.toString())}_updateStore(){this.itemEdit=ht.getItemInfo(this.itemId),this.itemEdit.item=this.itemDetails,ht.setItemInfo(this.itemEdit)}_updateThumbnail(t){const i=t.target.files;i&&i[0]&&this.thumbnail&&(this.thumbnail.src=URL.createObjectURL(i[0]),this.itemEdit=ht.getItemInfo(this.itemId),this.itemEdit.thumbnail=i[0],ht.replaceItemThumbnail(this.itemEdit))}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}};Lt.style=".inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.icon-inline--on-left,.icon-inline--on-right{display:inline;vertical-align:middle;margin-inline-end:0.375rem;fill:#0079c1}.scale-down{-o-object-fit:scale-down;object-fit:scale-down}.img-container{display:inline;margin-inline-end:1rem;max-width:363px}.summary-count-container{display:inline;flex-grow:1;margin-inline-start:0.75rem}.snippet-count-container{width:calc(100vw - 363px)}.parent-container{max-width:100%;padding:1rem}label{position:relative;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem;display:block;min-width:-moz-min-content;min-width:min-content}";const Ht=class{constructor(i){t(this,i),this.groupId="",this._translations=void 0,this.sharing=[]}itemIdWatchHandler(){const t=ht.getItemInfo(this.groupId);this.sharing=t.groupDetails}async componentWillLoad(){return this._getTranslations()}render(){return i(a,null,i("div",{class:"container-border"},i("calcite-label",null,this._translations.groupInfo),this._renderItems(this.sharing)))}async getShareInfo(){return this.sharing}_renderItems(t){return t&&t.length>0?t.map((t=>i("calcite-label",{layout:"inline"},i("calcite-switch",{checked:t.shareItem,id:t.id,name:"setting",onCalciteSwitchChange:t=>this._updateItem(t),scale:"m",value:"enabled"}),i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title)))):null}_updateItem(t){const i=t.target.id;this.sharing=this.sharing.map((e=>{if(e.id===i){e.shareItem=t.target.checked;const s=ht.getItemInfo(i);if(e.shareItem)s.groups?s.groups.indexOf(this.groupId)<0&&s.groups.push(this.groupId):s.groups=[this.groupId];else if(s.groups){const t=s.groups.indexOf(this.groupId);t>-1&&s.groups.splice(t,1)}ht.setItemInfo(s)}return e}))}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{groupId:["itemIdWatchHandler"]}}};Ht.style=":host{display:block}.container-border{padding:1rem}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const jt=class{constructor(i){t(this,i),this.organizationVariableSelected=o(this,"organizationVariableSelected",7),this.value="",this._organizationVariables=[],this._translations=void 0}valueWatchHandler(){this._organizationVariables=JSON.parse(this.value)}async componentWillLoad(){return this._getTranslations()}render(){return i(a,null,i("div",null,i("h4",{class:"org-var-header"},this._translations.orgVariables)),i("div",{class:"container-border"},i("calcite-tree",{id:"variable-label"},this._renderHierarchy(this._organizationVariables))))}_renderHierarchy(t){return t.map((t=>i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,i){this.organizationVariableSelected.emit({itemId:t,value:i})}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{value:["valueWatchHandler"]}}};jt.style=":host{display:block}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";const At=class{constructor(i){t(this,i),this._removedResources={},this.authentication=void 0,this.itemId="",this.resourceFilePaths=[],this.resources=[],this._translations=void 0}itemIdWatchHandler(){const t=ht.getItemInfo(this.itemId);this.resourceFilePaths=t.resourceFilePaths,this.resources=t.resources.map((t=>t.substring(t.lastIndexOf("/")+1)))}componentWillLoad(){return this._getTranslations()}render(){const t=this._hasValidResources();return i(a,null,i("div",{class:"resource-item"},i("div",{class:"margin-bottom-1"},i("calcite-button",{appearance:"solid",class:"resource-button",color:"blue",onClick:()=>this._addNewResource()},this._translations.addResource),i("calcite-button",{appearance:"solid",color:"blue",disabled:!t,onClick:()=>this._downloadAll()},this._translations.downloadAll)),i("div",{class:"resources-container",style:{display:t?"inherit":"none"}},this._renderResourceList())))}_renderResourceList(){return i("calcite-value-list",{multiple:!0},this.resourceFilePaths.reduce(((t,i)=>(i.type!==pt.Thumbnail&&t.push(this._renderResource(i)),t)),[]))}_renderResource(t){const e=t.updateType===dt.Remove;return i("calcite-value-list-item",{class:e?"disabled":"",label:t.folder?t.folder+"/"+t.filename:t.filename,nonInteractive:!0,value:t.url},i("calcite-action-group",{"expand-disabled":"true",layout:"horizontal",slot:"actions-end"},i("calcite-action",{disabled:e,icon:"download",label:this._translations.download,onClick:()=>this._download(t.url,t.filename),scale:"m",text:this._translations.download,title:this._translations.download}),i("calcite-action",{disabled:e,icon:"upload-to",label:this._translations.update,onClick:()=>this._upload(t),scale:"m",text:this._translations.update,title:this._translations.update}),i("calcite-action",{disabled:e,icon:"trash",label:this._translations.delete,onClick:()=>this._delete(t),scale:"m",text:this._translations.delete,title:this._translations.delete}),e?i("calcite-action",{icon:"reset",label:this._translations.reset,onClick:()=>this._reset(t.filename),scale:"m",text:this._translations.reset,title:this._translations.reset}):i("div",{class:"display-none"})))}_delete(t){t.updateType=dt.Remove,this.resourceFilePaths=[...this.resourceFilePaths],this._updateStore()}_reset(t){this.resourceFilePaths=this.resources.some((i=>i===t))?this.resourceFilePaths.map((i=>(i.filename===t&&(i.updateType=dt.None),i))):this.resourceFilePaths.map((i=>(i.filename===t&&(i.updateType=dt.Add),i))),this._updateStore()}_downloadAll(){this.resourceFilePaths.forEach((t=>{this._download(t.url,t.filename)}))}_download(t,i){t.startsWith("blob")?this.downloadFile(t,i):this.fetchAndDownload(`${t}?token=${this.authentication.token}`,i)}downloadFile(t,i){const e=document.createElement("a");e.href=t,e.download=i,e.target="_blank",e.click()}_hasValidResources(){return this.resourceFilePaths.some((t=>t.url.indexOf("_info_thumbnail")<0))}async fetchAndDownload(t,i){const e=await fetch(t),s=await e.blob(),o=URL.createObjectURL(s);this.downloadFile(o,i)}_upload(t){const i=document.createElement("input");i.classList.add("display-none"),i.onchange=this._updateResource.bind(this,t),i.type="file",i.click()}_addNewResource(){const t=document.createElement("input");t.classList.add("display-none"),t.onchange=this._add.bind(this),t.type="file",t.click()}_updateResource(t,i){const e=i.target.files;e&&e[0]&&(t.blob=e[0],t.updateType=dt.Update,this._updateStore())}_add(t){const i=t.target.files;if(i&&i[0]){const t=URL.createObjectURL(i[0]),e=i[0].name;this.resourceFilePaths.some((i=>i.filename===e&&i.url===t))||(this.resourceFilePaths=[...this.resourceFilePaths,{url:t,type:pt.Data,folder:void 0,filename:e,blob:i[0],updateType:dt.Add}],this._updateStore())}}_updateStore(){const t=ht.getItemInfo(this.itemId);t.resourceFilePaths=this.resourceFilePaths,ht.setItemInfo(t)}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};At.style=":host{display:block}.resource-item{padding:1rem}.resource-button{margin-inline-end:1rem}.resource-progress{padding-top:1rem}.resources-container{border:1px #808080 solid}.margin-bottom-1{margin-bottom:1rem}";const St=class{itemIdWatchHandler(){this._initializing=!0,this.value=JSON.stringify("data"===this.instanceid?ht.getItemInfo(this.itemId).data:ht.getItemInfo(this.itemId).properties,null,2)}constructor(i){t(this,i),this._initializing=!1,this.instanceid="",this.itemId="",this.organizationVariables="",this.solutionVariables="",this.varsOpen=!0,this._translations=void 0,this.value="",window.addEventListener("solutionEditorContentChanged",(t=>{if(this.itemId){const{id:i,contents:e}=t.detail,[s,o]=i.split("|");if(s==this.itemId&&o===this.instanceid){if(!this._initializing&&e.length>0){const t=ht.getItemInfo(s);"data"===o?t.data=JSON.parse(e):t.properties=JSON.parse(e),ht.setItemInfo(t)}this._initializing=!1}}}))}componentWillLoad(){return this._getTranslations()}render(){return i(a,null,i("div",{class:"solution-data-container"},i("calcite-shell",{class:"light var-container",dir:"ltr"},i("calcite-panel",{class:"json-editor"},i("div",{class:"solution-data-child-container calcite-match-height"},i("json-editor",{class:"solution-data-editor-container",instanceid:this.itemId+"|"+this.instanceid,value:this.value}))),i("calcite-shell-panel",{"height-scale":"l",position:"end",slot:"contextual-panel","width-scale":"xs"},i("div",{class:this.varsOpen?"solution-data-child-container":"solution-data-child-container-collapsed"},i("calcite-button",{appearance:"transparent",class:"collapse-btn","icon-start":this.varsOpen?"chevrons-right":"chevrons-left",id:"collapse-vars",onClick:()=>this._toggleVars(),scale:"s",title:this.varsOpen?this._translations.collapse:this._translations.expand}),i("div",{class:this.varsOpen?"org-vars":"org-vars display-none",id:"orgVars"},i("solution-organization-variables",{value:this.organizationVariables})),i("div",{class:this.varsOpen?"sol-vars":"sol-vars display-none",id:"solVars"},i("solution-variables",{value:this.solutionVariables})))))))}_toggleVars(){this.varsOpen=!this.varsOpen}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};St.style=":host{display:flexbox}.solution-data-container{position:absolute;height:-moz-available;height:calc(100% - 48px);height:-webkit-fill-available;height:stretch;width:-moz-available;width:100%;width:-webkit-fill-available;width:stretch}.solution-data-child-container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.solution-data-editor-container{height:100%}.solution-data-child-container-collapsed{display:flex;height:100%;flex-direction:column;overflow:auto;width:50px}.inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.json-editor{margin:1rem;width:auto;width:-webkit-fill-available -moz-available}.collapse-btn{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.org-vars{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.sol-vars{padding-top:0px;padding-bottom:0px;padding-left:1rem;padding-right:1rem;min-height:45%}.padding-1{padding:1rem}.light{background-color:#F4F4F4}";const Wt=class{constructor(i){t(this,i),this.solutionVariableSelected=o(this,"solutionVariableSelected",7),this.value="",this._solutionVariables=[],this._translations=void 0}valueWatchHandler(){this._solutionVariables=JSON.parse(this.value)}componentWillLoad(){return this._getTranslations()}render(){return i(a,null,i("div",null,i("h4",{class:"org-var-header"},this._translations.solVariables)),i("div",{class:"container-border"},i("calcite-tree",{id:"variable-label"},this._renderHierarchy(this._solutionVariables))))}_renderHierarchy(t){return t.map((t=>t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:t=>this._toggleExpand(t)},i("solution-item-icon",{type:t.type}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this._renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,i){this.solutionVariableSelected.emit({itemId:t,value:i})}_toggleExpand(t){var i;const e=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.closest("calcite-tree-item");e&&(e.expanded=!e.expanded)}async _getTranslations(){const t=await ct(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{value:["valueWatchHandler"]}}};Wt.style=":host{display:block}.container-border{overflow-y:hidden}.org-var-header{margin-top:1rem;margin-bottom:1rem;margin-left:0px;margin-right:0px}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";export{bt as calcite_shell_panel,ut as calcite_tab,mt as calcite_tab_nav,ft as calcite_tab_title,xt as calcite_tabs,zt as calcite_value_list,_t as calcite_value_list_item,It as json_editor,Lt as solution_item_details,Ht as solution_item_sharing,jt as solution_organization_variables,At as solution_resource_item,St as solution_template_data,Wt as solution_variables}
|