/*! 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 a from"./Q7U6VVKV.js";import{a as f}from"./PBTK3Z7K.js";import{E as m,P as r,U as c,k as i}from"./3VKC6PRK.js";export default $geoscene.t(([{watch:h},{f:n}])=>{var l=class extends r{constructor(){super(...arguments),this._formats=[]}static{this.properties={_formats:16,viewModel:0,messages:0}}static{this.shadowRootOptions=m}loaded(){this.manager.onLifecycle(()=>[h(()=>[this.viewModel.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{let t=this.viewModel.templatesInfo;if(!t)return;if(this._formats.length!==t.format.choiceList.length){let o=[...n.values()];this._formats=t.format.choiceList.map(e=>{let s=o.find(p=>new RegExp(`\\b${p}\\b`,"iu").test(e))??e;return{value:s,label:e===s?e.toUpperCase():e}}).sort((e,s)=>e.label.localeCompare(s.label))}let a=this._formats.some(({value:o})=>new RegExp(`\\b${o}\\b`,"iu").test(this.viewModel.templateOptions.format));if(t.format.defaultValue&&!a){let o=this._formats.find(({value:e})=>new RegExp(`\\b${e}\\b`,"iu").test(t.format.defaultValue))?.value;o&&(this.viewModel.templateOptions.format=o);return}},{initial:!0})])}render(){return i`<div><calcite-label>${this.messages.fileFormatTitle}<calcite-combobox clear-disabled .label=${this.messages.formatDefaultOption} max-items=6 .placeholder=${this.messages.formatDefaultOption} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:t})=>{let a=t.selectedItems[0]?.value;this.viewModel.templateOptions.format=a??"pdf"}}>${this._formats.map(({value:t,label:a},o)=>f(`file-format-${o}`,i`<calcite-combobox-item .heading=${a} .selected=${t===this.viewModel.templateOptions.format} .value=${t}></calcite-combobox-item>`))}</calcite-combobox></calcite-label></div>`}};c("geoscene-print-format-select",l);return l},"core/reactiveUtils",a)