/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import{b as D}from"./W4YXXJAS.js";import{b as I}from"./S7VQX4XX.js";import{na as R,pa as v,ra as L}from"./4Q4PZB7R.js";import{a as S}from"./XN2LWKJE.js";import{b as O}from"./ODCCVHGI.js";import{F as m,G as f,H as _,J as A,L as h,h as E,i as r,j as y,r as w}from"./42WFQ3AX.js";export default $arcgis.t(([])=>{var x=E`/** @license
 * Copyright 2025 Esri
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

calcite-card {
  height: 100%;
  padding-bottom: var(--calcite-spacing-base);
}

/* @media (max-width: 600px) {
  calcite-card {
    width: calc(100% / 2 - var(--calcite-spacing-sm));
  }
} */

@media (max-width: 400px) {
  calcite-card {
    width: 100%;
  }
}

calcite-card:hover img {
  /* TODO check in dark mode */
  -webkit-filter: brightness(30%);
  filter: brightness(30%);
  -webkit-transition: all .1s ease;
  -moz-transition: all .1s ease;
  -o-transition: all .1s ease;
  -ms-transition: all .1s ease;
  transition: all .1s ease;
}

calcite-card:hover .hover-text {
  opacity: 1;
  color: #ffffff;
}

calcite-card:hover {
  outline: var(--calcite-spacing-base) solid var(--calcite-color-brand);
  box-sizing: content-box;
  cursor: pointer;
}

.hover-text {
  transition: .1s ease;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
  font-size: var(--calcite-spacing-xl);
}

.card-image-wrap {
  flex: 0 0 auto;
}

.card-image-wrap {
  width: 100%;
  position: relative;
  margin-bottom: 0;
  -webkit-box-flex: 0 0 auto;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
}

.card-image {
  width: 100%;
  display: block;
}

video,
img {
  max-width: 100%;
  height: auto;
}

img {
  overflow-clip-margin: content-box;
  overflow: clip;
}

.width-full {
  width: 100%;
}

.deployed-label-override {
  --calcite-label-text-color: var(--calcite-color-text-3);
  --calcite-label-margin-bottom: var(--calcite-spacing-none);
}

.svg-color {
  fill: var(--calcite-color-text-3);
}

.padding-end-1-2 {
  padding-inline-end: var(--calcite-spacing-sm);
}

.padding-bottom-1-2 {
  padding-bottom: var(--calcite-spacing-sm);
}

.display-flex {
  display: flex;
}

.display-none {
  display: none;
}

.flex-direction-column {
  flex-direction: column;
}

.align-items-center {
  align-items: center;
}

.font-weight-400 {
  font-weight: 400;
}

.font-weight-normal {
  font-weight: normal;
}

.font-color-text-2 {
  --calcite-label-text-color: var(--calcite-color-text-2);
}

.font-line-height {
  line-height: 1.4;
}

.font-size-size--1 {
  font-size: var(--calcite-font-size--1);
}

.icon-brand-color {
  --calcite-icon-color: var(--calcite-color-brand);
}

.header-line-height {
  --calcite-label-margin-bottom: 0;
  margin-top: var(--calcite-spacing-sm);
  margin-bottom: 0.7rem;
}

.dialog-y-size {
  --calcite-dialog-size-y: 90%
}

.dialog-x-size {
  --calcite-dialog-size-x: 90%
}

.justify-content-space-between {
  justify-content: space-between;
}

.panel-bg-color {
  --calcite-panel-header-background-color: var(--calcite-color-foreground-1);
  --calcite-panel-background-color: var(--calcite-color-foreground-1);
}

.cursor-default {
  cursor: default;
}
`;async function $(i,e){let t=await L(i,e);if(!t)throw new Error(`Solution ${i} was not found`);let a=e?.portal.replace("/sharing/rest","")??"https://www.arcgis.com",s=[];if(t.templates[0].item)s=t.templates.map(n=>({id:n.itemId,title:n.item.title,type:n.item.type,typeKeywords:n.item.typeKeywords,dependencies:n.dependencies,snippet:n.item.snippet}));else{let n=t.templates.map(o=>o.type==="Group"?R(o.itemId,e):v(o.itemId,e));s=(await Promise.allSettled(n)).filter(o=>o.status==="fulfilled").map(o=>o.value).map((o,u)=>{let d=typeof o.type>"u"?"group":"item";return{id:o.id,title:o.title,type:o.type??"Group",typeKeywords:o.typeKeywords,dependencies:t.templates[u].dependencies,snippet:o.snippet,url:`${a}/home/${d}.html?id=${o.id}`}})}return s}function he(i,e,t){let a=i.templates.map(u=>u.type),s=[];s.push(V),a.indexOf("Group")>=0&&(s.push(N),s.push(C)),a.indexOf("Feature Service")>=0&&s.push(k);let n=a.indexOf("Feed")>-1;n&&s.push(Y);let c=a.indexOf("Big Data Analytic")>-1;c&&s.push(W);let p=a.indexOf("Real Time Analytic")>-1;p&&s.push(q),(n||c||p)&&s.push(ee),a.indexOf("Workflow")>-1&&(s.push(N),s.push(k),s.push(C),s.push(te)),a.indexOf("Geoprocessing Service")>-1&&(s.push(z),t.IsEnterprisePortal&&s.push(J));let o=i.templates.reduce((u,d)=>u.concat(d.item.typeKeywords||[]),[]);return G(s,o,t),B(s,e),U(s,i),s}function U(i,e){e.templates.some(t=>t.type==="Group"&&t.item?.membershipAccess==="collaboration")&&i.push(F)}function G(i,e,t){let a=M(t),s=K(t);["Location Tracking View"].some(c=>e.indexOf(c)>-1)&&(!a&&!s?i.push(X):a&&!s?i.push(Q):!a&&s&&i.push(Z))}function B(i,e){["HubPremium"].some(a=>e.indexOf(a)>-1)&&i.push(j)}function M(i){let e=i.PortalUserSubset;return e?.role==="org_admin"&&!e?.hasOwnProperty("roleId")}function K(i){return i.PortalSubset?.locationTrackingEnabled||!1}function ge(i,e){let t={leadingMessages:[],bulletedMessages:[],trailingMessages:[]},a=[l.NOTEBOOK,l.VELOCITY,l.HUBPREMIUM,l.WORKFLOW,l.TRACKINGBASE],s=g(i,e,l.VELOCITY);s&&t.leadingMessages.push(s);let n=g(i,e,l.NOTEBOOK);n&&t.leadingMessages.push(n);let c=g(i,e,l.HUBPREMIUM);c&&t.leadingMessages.push(c);let p=g(i,e,l.WORKFLOW);p&&t.leadingMessages.push(p),e=e.filter(d=>a.indexOf(d)<0),e.forEach(d=>{t.bulletedMessages.push(P(i,d))});let o=g(i,e,l.TRACKINGBASE);return o&&t.trailingMessages.push(o),(t.leadingMessages.length>0||t.trailingMessages.length>0||t.bulletedMessages.length>0)&&t.trailingMessages.push(i.missingPrivilegesPopup.suggestedProblemRemedyMessage),t}function g(i,e,t){return e.filter(s=>s.includes(t)).length>0?P(i,t):""}function P(i,e){let t=i.missingPrivilegesPopup.requiredPrivilegesList,a="";switch(e){case"portal:user:createItem":a=t.createItem;break;case"portal:publisher:publishFeatures":a=t.publishFeatures;break;case"portal:user:createGroup":a=t.createGroup;break;case"portal:user:shareToGroup":a=t.shareToGroup;break;case"portal:user:addExternalMembersToGroup":a=t.addMembers;break;case"portal:publisher:publishFeeds":a=t.publishFeeds;break;case"portal:publisher:publishBigDataAnalytics":a=t.publishBigDataAnalytics;break;case"portal:publisher:publishRealTimeAnalytics":a=t.publishRealTimeAnalytics;break;case"solutions:locationtracking:admin:tracking":a=t.requiresLocationTrackingAndAdmin;break;case"solutions:locationtracking:tracking":a=t.requiresLocationTracking;break;case"solutions:locationtracking:admin":a=t.requiresAdmin;break;case"solutions:hubPremium":a=t.hubPremium;break;case"solutions:workflowManager":a=t.workflowManager;break;case"solutions:velocity":a=t.velocity;break;case"solutions:notebook":a=t.requiresNotebookServer;break;case"portal:publisher:publishServerGPServices":a=t.publishGPServices;break;case"writable:Enterprise":a=t.writableEnterprise;break;case"writable:Online":a=t.writableOnline.replace("{{url}}","https://status.arcgis.com");break}return a}var b=class extends _{constructor(){super(...arguments),this.allowDelete=!1,this.deployedDate="",this.description="",this.diagramKey="",this.heading="",this.itemId="",this.owner="",this.thumbnail="",this.updateAvailable=!1,this.templateInfos=[],this._isDeleteOpen=!1,this._isDiagramOpen=!1,this.templateInfoGraph=[],this._configureTitlesOpen=!1,this._translations=S({name:"solution-deployed-card",blocking:!0}),this._configContextConsumer=I({context:D,subscribe:!0,callback:async e=>{e&&(this._isOrgAdmin=e.authentication?.PortalUserSubset?.role==="org_admin"||M(e.authentication))}}),this._deleteDialogRef=m(),this._diagramDialogRef=m(),this._isOrgAdmin=!1,this.deployedCardSelected=w()}static{this.properties={allowDelete:[5,{},{type:Boolean}],card:[0,{},{attribute:!1}],deployedDate:1,description:1,diagramKey:1,heading:1,itemId:1,owner:1,thumbnail:1,updateAvailable:[5,{},{type:Boolean}],templateInfos:[0,{},{attribute:!1}],_isDeleteOpen:[16,{},{state:!0}],_isDiagramOpen:[16,{},{state:!0}],templateInfoGraph:[16,{},{state:!0}],_configureTitlesOpen:[16,{},{state:!0}],_translations:[16,{},{state:!0}]}}static{this.styles=x}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async renderDeleteDialog(){return this._isDeleteOpen=!0,this._renderDeleteDialog(),this._deleteDialogRef.value}async renderDiagramDialog(e){return await this._viewDiagram(e),await this._renderDiagramDialog(),this._diagramDialogRef.value}async getTemplates(){return this._processTemplates(this.card)}willUpdate(e){e.has("card")&&this._processTemplates(this.card).then(t=>{this.templateInfos=t})}render(){return r`<calcite-card .label=${this.description} @click=${this._cardSelected}>${this._getImage()}${this._getHeader()}<p class="font-color-text-2 font-line-height font-size-size--1" slot=description>${this.description}</p><div class="width-full display-flex flex-direction-column" slot=footer-start><div class="padding-bottom-1-2">${this.owner!==""&&this._getOwnerLabel()||""}${this._getDeployedDate()}</div>${this._getConfigureButton()}</div></calcite-card>${this._renderDeleteDialog()}${this._renderDiagramDialog()}${this._renderConfigureTitlesDialog()}`}_getImage(){let e=this._configContextConsumer.value?.userSession;return r`<div class="card-image-wrap" slot=thumbnail><img alt=${this.heading??h} class="thumbnail card-image" src=${`${this.thumbnail}&token=${e?.token}`}><div class="hover-text">${this._translations.openSolution}</div></div>`}_getHeader(){return r`<div class="display-flex justify-content-space-between header-line-height" slot=heading><calcite-label layout=inline-space-between scale=l>${this.heading}</calcite-label></div>`}_getOwnerLabel(){return r`<calcite-label class="font-weight-400 padding-end-1-2" layout=inline scale=s>${`${this._translations.owner}:`}<calcite-link class="font-weight-normal" @click=${this._openUserProfile}>${this.owner}</calcite-link></calcite-label>`}_getDeployedDate(){return r`<div class="display-flex align-items-center"><div class="padding-end-1-2"><svg height=16px viewBox="0 0 32 32" width=16px xmlns=http://www.w3.org/2000/svg>${y`<path class="svg-color" d="M29.963 7.672a1.586 1.586 0 0 0-1.584-1.585h-5.274a.187.187 0 0 1-.188-.187V3.977A2 2 0 0 0 20.825 2h-9.672A2.095 2.095 0 0 0 9.06 4.093V5.9a.187.187 0 0 1-.187.187H3.598a1.586 1.586 0 0 0-1.584 1.585v4.016a.281.281 0 0 0 .281.28H4.9l.014-.013V9.153a.177.177 0 0 1 .177-.177h21.46a.456.456 0 0 1 .449.45v13.742A1.832 1.832 0 0 1 25.168 25h-8.892a.568.568 0 0 1-.534-.373 3.98 3.98 0 0 0-7.6.373H5.657a.757.757 0 0 1-.757-.757v-3.055A.188.188 0 0 0 4.714 21H2.028l-.014.014v4.58a2.35 2.35 0 0 0 2.347 2.346h4.161a3.963 3.963 0 0 0 6.8.256.569.569 0 0 1 .475-.256h12.065a2.102 2.102 0 0 0 2.101-2.101zM21 5.625a.375.375 0 0 1-.375.375h-9.25A.375.375 0 0 1 11 5.625V4.45a.456.456 0 0 1 .45-.45h9.1a.456.456 0 0 1 .45.45zM12 28a2 2 0 1 1 2-2 2 2 0 0 1-2 2z" /><path class="svg-color" d="M13.273 17.994a.57.57 0 0 1 .479.262A3.73 3.73 0 0 0 17 20a3.74 3.74 0 0 0 3.403-2.006h3.41a.188.188 0 0 0 .187-.188v-2.589a.187.187 0 0 0-.188-.188H20.8A3.8 3.8 0 0 0 17 12a4.058 4.058 0 0 0-3.69 2.647.568.568 0 0 1-.537.383H1.093a.094.094 0 0 0-.093.093V17.9a.094.094 0 0 0 .094.094zM17 13.9a2.1 2.1 0 1 1-2.1 2.1 2.1 2.1 0 0 1 2.1-2.1z" />`}</svg></div><calcite-label class="deployed-label-override" scale=s>${this._translations.deployedDate.replace("{{date}}",this.deployedDate)}</calcite-label></div>`}_getConfigureButton(){let e=this._configContextConsumer.value?.userSession?.username,t=this.card?.owner===e||this._isOrgAdmin,a=t?"display-none":"";return r`<calcite-split-button appearance=outline aria-label=${this._translations.openSolution??h} dropdown-label=${this._translations.moreActions??h} kind=neutral @calciteSplitButtonPrimaryClick=${this._cardSelected} @click=${s=>s.stopPropagation()} overlay-positioning=fixed primary-text=${this._translations.openSolution??h} width=full><calcite-dropdown-group selection-mode=none><calcite-dropdown-item icon-start=model @click=${this._viewDiagram}>${this._translations.viewDiagram}</calcite-dropdown-item><calcite-dropdown-item icon-start=file-text @click=${this._viewDocumentation}>${this._translations.documentation}</calcite-dropdown-item><calcite-dropdown-item icon-start=information @click=${this._viewItemDetails}>${this._translations.viewItemDetails}</calcite-dropdown-item><calcite-dropdown-item .disabled=${!t} icon-start=edit-attributes id=solution-configure-titles-dropdown @click=${()=>{this._configureTitlesOpen=!0}}>${this._translations.renameItems}</calcite-dropdown-item>${this.allowDelete&&r`<calcite-dropdown-item icon-start=trash @click=${this._deleteSolution}>${this._translations.deleteSolution}</calcite-dropdown-item>`||""}</calcite-dropdown-group><calcite-tooltip class=${A(a)} overlay-positioning=fixed reference-element=solution-configure-titles-dropdown><span>${this._translations.mustOwnSolution}</span></calcite-tooltip></calcite-split-button>`}_renderDeleteDialog(){return this._isDeleteOpen?r`<solution-delete-dialog .card=${this.card} @solutionDeleteDialogOpen=${e=>{this._isDeleteOpen=e.detail}} .open=${this._isDeleteOpen} source="Card Dropdown" ${f(this._deleteDialogRef)}></solution-delete-dialog>`:""}_renderDiagramDialog(){return this._isDiagramOpen?r`<calcite-dialog class="dialog-y-size dialog-x-size panel-bg-color" .heading=${this._translations.diagramTitle.replace("{{solution}}",this.card?.title??"")} id=${this._translations.diagramTitle.replace("{{solution}}",this.card?.title??"")??h} modal .open=${this._isDiagramOpen} @calciteDialogClose=${()=>{this._isDiagramOpen=!1}} outside-close-disabled scale=m width=l ${f(this._diagramDialogRef)}><solution-item-diagram .diagramKey=${this.diagramKey} .templateInfoGraph=${this.templateInfoGraph} .typeKeywords=${this.card?.typeKeywords}></solution-item-diagram></calcite-dialog>`:""}_renderConfigureTitlesDialog(){return this._configureTitlesOpen?r`<solution-configure-titles .card=${this.card} @solutionConfigureTitlesBeforeClose=${async()=>{this._processTemplates(this.card).then(e=>{this.templateInfos=e}),this._configureTitlesOpen=!1}} @solutionItemsTitlesChanged=${async()=>{this._processTemplates(this.card).then(e=>{this.templateInfos=e})}} .open=${this._configureTitlesOpen} source="Card Dropdown" .templateInfos=${this.templateInfos}></solution-configure-titles>`:""}_cardSelected(){this.deployedCardSelected.emit({card:this.card,cardRef:this.el})}async _viewDiagram(e){e.stopPropagation(),this.card&&(this._telemetry?.logEvent({category:T.DEPLOYMENTS,action:"View Diagram",dimensions:[this.card.title||"",this.card.deployCommonId||"",this.card.deployVersion||"","Card Dropdown"]}),this.templateInfoGraph=await this._processTemplates(this.card),this._isDiagramOpen=!0)}_viewDocumentation(e){e.stopPropagation(),this._telemetry?.logEvent({category:T.DEPLOYMENTS,action:"Open Help",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Card Dropdown"]}),window.open(this.card.learnMoreUrl,"_blank")}_viewItemDetails(e){e.stopPropagation(),this._telemetry?.logEvent({category:T.DEPLOYMENTS,action:"Open Item Details",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Card Dropdown"]}),window.open(this.card.itemUrl,"_blank")}_deleteSolution(e){e.stopPropagation(),this._isDeleteOpen=!0}_openUserProfile(e){e.stopPropagation();let t=this._configContextConsumer.value?.authentication?.PortalSubset?.orgUrl;t&&window.open(`${t}/home/user.html?user=${this.owner}`,"_blank")}async _processTemplates(e){return await $(e.id,this._configContextConsumer.value.userSession)}};O("solution-deployed-card",b);var me=500,fe={AEC:"Architecture, Engineering, and Construction (AEC)",AIRPORTPORTRAIL:"Airports, Ports, and Rails",BUSINESS:"Business",CONSERVATION:"Conservation",DEFENSE:"Defense",FACILITIES:"Facilities",HEALTHANDHUMANSERVICES:"Health and Human Services",PIPELINE:"Pipeline",PUBLICSAFETY:"Public Safety",RENEWABLES:"Renewables",STATEANDLOCALGOVERNMENT:"State and Local Government",TELECOMMUNICATIONS:"Telecommunications",UTILITIES:"Utilities"},Te={AIRPORT:"Airports",AGRICULTURE:"Agriculture",ASSESSMENTANDTAXATION:"Assessment and Taxation",DISTRICTENERGY:"District Energy",ELECTIONS:"Elections",ELECTRIC:"Electric",EMERGENCYMANAGEMENT:"Emergency Management",ENVIRONMENTANDNATURALRESOURCES:"Environment and Natural Resources",FIRESERVICE:"Fire Service",FISHANDWILDLIFE:"Fish and Wildlife",GAS:"Gas",HEALTHANDHUMANSERVICES:"Health and Human Services",LAWENFORCEMENT:"Law Enforcement",NATURALRESOURCES:"Natural Resources",PARKS:"Parks",PLANNINGANDDEVELOPMENT:"Planning and Development",PROTECTEDAREAS:"Protected Areas",PUBLICWORKS:"Public Works",SEWER:"Sewer",STORMWATER:"Stormwater",TELECOMMUNICATIONS:"Telecommunications",TRANSPORTATION:"Transportation",WATER:"Water Distribution"},l=(i=>(i.HUBPREMIUM="solutions:hubPremium",i.NOTEBOOK="solutions:notebook",i.TRACKINGBASE="solutions:locationtracking",i.TRACKING="solutions:locationtracking:tracking",i.TRACKINGADMIN="solutions:locationtracking:admin",i.TRACKINGADMINANDTRACKING="solutions:locationtracking:admin:tracking",i.VELOCITY="solutions:velocity",i.WORKFLOW="solutions:workflowManager",i))(l||{}),H=(i=>(i.VELOCITYBIGDATA="portal:publisher:publishBigDataAnalytics",i.VELOCITYFEEDS="portal:publisher:publishFeeds",i.VELOCITYREALTIME="portal:publisher:publishRealTimeAnalytics",i))(H||{}),be='((typekeywords:Solution,Deployed,"ArcGIS Solution") OR ((typekeywords:Solution,Deployed) AND (created:[1577862000000 TO 1622576880000])))',Ee="(typekeywords:Solution,Template)",F="portal:user:addExternalMembersToGroup",V="portal:user:createItem",N="portal:user:createGroup",W="portal:publisher:publishBigDataAnalytics",k="portal:publisher:publishFeatures",Y="portal:publisher:publishFeeds",z="portal:publisher:publishServerGPServices",q="portal:publisher:publishRealTimeAnalytics",C="portal:user:shareToGroup",j="solutions:hubPremium",J="solutions:notebook",X="solutions:locationtracking:admin:tracking",Q="solutions:locationtracking:tracking",Z="solutions:locationtracking:admin",ee="solutions:velocity",te="solutions:workflowManager",ye=250,T={SOLUTION_DETAILS:"Solution Details",GLOBAL_NAVIGATION:"Global Nav",ALL_SOLUTIONS:"Solutions",DEPLOYMENTS:"Deployments",ASSISTANT:"Assistant",RESOURCES:"Resources"};return{a:$,b:he,c:M,d:ge,e:b,f:me,g:fe,h:Te,i:l,j:H,k:be,l:Ee,m:ye,n:T}},"identity/IdentityManager","identity/OAuthInfo","portal/Portal")