1class c{#i;#e={};#t=null;setMapComponent(i){this.#i=i}getDetachedPopup(){return this.#t}parseMarkerModelConfig(i){let t={};const e=i?.popup_mode==="detached";e&&this.#o();const p=e&&i?.popup_skip_empty==!0;i?.clickable==!0&&(t.onclick=o=>{e&&this.#t&&(p&&!o.popup_html?this.#t.close():this.#t.open(o.popup_html||null)),this.#i.dispatchEvent(new CustomEvent("pinclick",{detail:o}))}),t.name=o=>o.name,t.popup=(o,s,n)=>{if(e||!o.popup_html||o.popup_html==null||o.popup_html=="")return null;const a=document.createElement("div");a.classList.add("popup"),a.classList.add("woody-pin-popup"),a.innerHTML=`${o.popup_html}`;const l=document.createElement("button");return l.addEventListener("click",n),l.classList.add("popup-close"),l.classList.add("woody-pin-popup-close"),l.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewbox="0 0 40 40"> 2 <path d="M10,10L30,30M30,10L10,30" stroke-width="4"/> 3 </svg>`,a.appendChild(l),a},t.tooltip=o=>{if(!o.tooltip_html||o.tooltip_html==null||o.tooltip_html=="")return null;const s=document.createElement("div");return s.classList.add("tooltip"),s.classList.add("woody-pin-tooltip"),s.innerHTML=`${o.tooltip_html}`,s};const r=Object.assign(i,{default:Object.assign(i.default,t)});return this.#e={},r.pins.forEach((o,s)=>{if(o.lat===null||o.lon===void 0){console.error("MapManager - parseMarkerModelConfig - pin.lat|lon missed");return}const n=this.getLocationMappingKey(o.lat,o.lon);this.#e[n]!=null?console.warn("MapManager - parseMarkerModelConfig - duplicate pin index in pinsLocationMapping (multiple pin have same location)"):this.#e[n]=s}),r}parseGeojson(i){typeof i=="string"&&(i=JSON.parse(i));const t=window.getComputedStyle(document.body);return i.features=i.features.map(e=>{if(e.properties.fill){const p=this.getCssVariableValue(t,e.properties.fill);e.properties.fill=p}return e.properties["fill-opacity"]&&(e.properties["fill-opacity"]=this.getCssVariableValue(t,e.properties["fill-opacity"])),e.properties.stroke&&(e.properties.stroke=this.getCssVariableValue(t,e.properties.stroke)),e.properties["stroke-width"]&&(e.properties["stroke-width"]=parseFloat(this.getCssVariableValue(t,e.properties["stroke-width"]))),e.properties["stroke-opacity"]&&(e.properties["stroke-opacity"]=parseFloat(this.getCssVariableValue(t,e.properties["stroke-opacity"]))),e}),i}getCssVariableValue(i,t){if(!t||typeof t!="string")return t;if(t=t.trim(),t.startsWith("--"))return i.getPropertyValue(t).trim()||t;const e=/^var\(\s*(--[a-zA-Z0-9-_]+)\s*(?:,\s*(.+))?\)$/;let p=0;for(;p<10;){const r=t.match(e);if(!r)break;const o=r[1],s=r[2];let n=i.getPropertyValue(o).trim();if(n)t=n.trim();else if(s)t=s.trim();else break;p++}return t}__getCssVariableValue(i,t){if(t&&typeof t=="string"){t.startsWith("--")&&(t=i.getPropertyValue(t).trim()||t);const e=t.trim().match(/^var\((--[^)]+)\)$/);if(e){const p=i.getPropertyValue(e[1]);if(p&&p!=="")return p}}return t}getMappedPinIndexForLocation(i,t){const e=this.getLocationMappingKey(i,t),p=this.#e[e];return p==null&&console.warn("MapManager - getPinIndexForLocation - pinIndex not found for key : ",e," - in mapping : ",this.#e),p}getLocationMappingKey(i,t){return JSON.stringify({lat:parseFloat(i),lng:parseFloat(t)})}#o(){if(this.#t)return;const i=this.#i?.parentElement;if(!i){console.warn("MapManager - ensureDetachedPopup - no parent element to host the popup");return}
3const t=document.createElement("woody-map-popup");i.appendChild(t),this.#t=t}}export{c as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.