/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import a from"./7BOA27L2.js";export default $arcgis.t(([n,m,{e:u}])=>{var c=class{async getPopupTitle(t,f){let a={};for(let[e,r]of Object.entries(t.attributes))a={...a,[`{${e.toUpperCase()}}`]:r};let o=t.layer,l=this._removeTags(o?.popupTemplate?.title);if(l.includes("{expression/expr")&&o?.popupTemplate?.expressionInfos!=null)for(let e=0;e<o.popupTemplate?.expressionInfos.length;e++){let r=o.popupTemplate.expressionInfos[e],i=n.createArcadeProfile("popup");try{let p=await(await n.createArcadeExecutor(r.expression,i)).executeAsync({$feature:t,$layer:o,$map:f});(p!==null||p!=="")&&(a[`{expression/${r.name}}`.toUpperCase()]=p)}catch(s){console.error(s);continue}}return o.popupTemplate?.fieldInfos&&o.fields.forEach(e=>{let r=t.attributes[e.name],i=(o?.popupTemplate?.fieldInfos||[]).find(p=>p.fieldName.toLowerCase()===e.name.toLowerCase()),s=u(r,e.type,e?.domain,i?.format,m);a[`{${e.name.toUpperCase()}}`]=s??r}),l?.replace(/{.*?}/g,e=>a[e.toUpperCase()]!=null?a[e.toUpperCase()]:"")}_removeTags(t){return t==null||t===""?"":t.toString().replace(/(<([^>]+)>)/gi,"")}};return c},"arcade","intl",a)