/*! All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
v4.33.18 */
import{B as t,E as V,P as I,Q as m,U as $,k as s,p}from"./3VKC6PRK.js";var g=class extends I{constructor(){super(...arguments),this._showInvalidVersionNotice=!0,this.geosceneCreateVersionList=t(),this.geosceneFlowItemBack=t(),this.geosceneFlowItemClose=t(),this.geosceneGetVersions=t(),this.geosceneManageVersion=t(),this.geosceneNewVersion=t()}static{this.properties={_showInvalidVersionNotice:16,serviceItemElementProps:0}}static{this.shadowRootOptions=V}disconnectedCallback(){super.disconnectedCallback(),this.versionListContainer?.remove()}render(){let{serviceItemElementProps:{allowEditing:b,closable:f,currentUser:u,executionError:w,currentVersionIdentifier:a,flowElement:N,heading:C,isInitialVersionInvalid:E,isVersionAdministrator:x,isVersioningApiAvailable:A,mode:k,pageSize:L,serviceName:o,serviceUrl:c,state:M,strings:n,versionInfos:r}}=this,{_versionList:l}=this,S=E.get(c)&&this._showInvalidVersionNotice?s`<calcite-notice class=${m(this._showInvalidVersionNotice?"invalid-initial-version-notice":"")} closable kind=warning open scale=s width=full icon @calciteNoticeClose=${()=>this._showInvalidVersionNotice=!1}><div slot=title>${n.headers.invalidInitialVersion}</div><div slot=message>${n.loadErrors.invalidInitialVersion}</div></calcite-notice>`:void 0,U=s`<calcite-combobox clear-disabled .label=${o} max-items=5 overlay-positioning=fixed selection-mode=single-persist @calciteComboboxChange=${i=>{let d=i.target,e=r.find(_=>_.versionIdentifier.guid===d.value);this.geosceneManageVersion.emit({actionType:"changeVersion",serviceUrl:c,versionInfo:e})}}>${r?r.map(i=>s`<calcite-combobox-item class=${m(k==="dialog"?"":"calcite-combobox-item")} .selected=${a.guid===i.versionIdentifier.guid&&a.name===i.versionIdentifier.name} .textLabel=${i.versionIdentifier.name} .value=${i.versionIdentifier.guid}></calcite-combobox-item>`):void 0}</calcite-combobox>`,v,h;return b&&(v=s`<calcite-action .id=${`actionManageVersions_${o}`} icon=list scale=s slot=control text @click=${async()=>{let i={closable:f,currentUser:u,currentVersionIdentifier:a,executionError:w,heading:C,isVersionAdministrator:x,isVersioningApiAvailable:A,pageSize:L,serviceName:o,serviceUrl:c,state:M,strings:n,versionInfos:r};this.versionListContainer=document.createElement("div");let d=p(s`<geoscene-version-management-version-list .versionListElementProps=${i} selected show-back-button @geosceneFlowItemBack=${e=>{e.preventDefault(),this.geosceneFlowItemBack.emit()}} @geosceneFlowItemClose=${()=>this.geosceneFlowItemClose.emit()} @geosceneGetVersions=${e=>this.geosceneGetVersions.emit({serviceUrl:e.detail.serviceUrl})} @geosceneManageVersion=${e=>this.geosceneManageVersion.emit(e.detail)} @geosceneNewVersion=${e=>this.geosceneNewVersion.emit({serviceUrl:e.detail.serviceUrl})}></geoscene-version-management-version-list>`,this.versionListContainer);l=Array.from(d.parentNode.childNodes).find(e=>e.nodeName.toUpperCase()==="GEOSCENE-VERSION-MANAGEMENT-VERSION-LIST"),N?.append(l),this.geosceneCreateVersionList.emit(l)}}></calcite-action>`,h=s`<calcite-tooltip overlay-positioning=fixed .referenceElement=${`actionManageVersions_${o}`}><span>${n.headers.manageVersions}</span></calcite-tooltip>`),s`<calcite-block open .heading=${o}>${S}${U}${v}${h}</calcite-block>`}};$("geoscene-version-management-service-item",g);export{g as GeosceneVersionManagementServiceItem};