diff --git a/public/dx-maps/doxa-maps-spa/manifest.json b/public/dx-maps/doxa-maps-spa/manifest.json
index d36186d30..680e4403c 100644
--- a/public/dx-maps/doxa-maps-spa/manifest.json
+++ b/public/dx-maps/doxa-maps-spa/manifest.json
@@ -880,7 +880,7 @@
"bundle": "my-upg-100-list",
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
"output": "dx-maps/my-upg-100-list/my-upg-100-list.js",
- "integrity": "sha384-E/xAMxWk9HXEohgBvDOx1H2vWnxxTkRRTt8yGLsAYx4IVlrhtUlfIwbZ7LYEtbHV",
+ "integrity": "sha384-hKk4q92hygZxWdwd6/194e9ZW89kne7gq+nLzztO/GYKeMuQaADwdh8tsyDkhmed",
"elements": [
"my-upg-100-list-map"
],
@@ -903,7 +903,7 @@
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
"embed": {
"iframe": "",
- "script": "\n\n\n"
+ "script": "\n\n\n"
}
},
{
@@ -919,8 +919,8 @@
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
"embed": {
"iframe": "",
- "script": "\n\n\n\n\n\n",
- "scriptMapbox": "\n\n\n\n\n\n"
+ "script": "\n\n\n\n\n\n",
+ "scriptMapbox": "\n\n\n\n\n\n"
}
},
{
@@ -936,8 +936,8 @@
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
"embed": {
"iframe": "",
- "script": "\n\n\n\n\n\n",
- "scriptMapbox": "\n\n\n\n\n\n"
+ "script": "\n\n\n\n\n\n",
+ "scriptMapbox": "\n\n\n\n\n\n"
}
}
]
diff --git a/public/dx-maps/manifest.json b/public/dx-maps/manifest.json
index d36186d30..680e4403c 100644
--- a/public/dx-maps/manifest.json
+++ b/public/dx-maps/manifest.json
@@ -880,7 +880,7 @@
"bundle": "my-upg-100-list",
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
"output": "dx-maps/my-upg-100-list/my-upg-100-list.js",
- "integrity": "sha384-E/xAMxWk9HXEohgBvDOx1H2vWnxxTkRRTt8yGLsAYx4IVlrhtUlfIwbZ7LYEtbHV",
+ "integrity": "sha384-hKk4q92hygZxWdwd6/194e9ZW89kne7gq+nLzztO/GYKeMuQaADwdh8tsyDkhmed",
"elements": [
"my-upg-100-list-map"
],
@@ -903,7 +903,7 @@
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
"embed": {
"iframe": "",
- "script": "\n\n\n"
+ "script": "\n\n\n"
}
},
{
@@ -919,8 +919,8 @@
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
"embed": {
"iframe": "",
- "script": "\n\n\n\n\n\n",
- "scriptMapbox": "\n\n\n\n\n\n"
+ "script": "\n\n\n\n\n\n",
+ "scriptMapbox": "\n\n\n\n\n\n"
}
},
{
@@ -936,8 +936,8 @@
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
"embed": {
"iframe": "",
- "script": "\n\n\n\n\n\n",
- "scriptMapbox": "\n\n\n\n\n\n"
+ "script": "\n\n\n\n\n\n",
+ "scriptMapbox": "\n\n\n\n\n\n"
}
}
]
diff --git a/public/dx-maps/my-upg-100-list/my-upg-100-list.js b/public/dx-maps/my-upg-100-list/my-upg-100-list.js
index 410b4ed59..9e497717e 100644
--- a/public/dx-maps/my-upg-100-list/my-upg-100-list.js
+++ b/public/dx-maps/my-upg-100-list/my-upg-100-list.js
@@ -876,7 +876,7 @@
.geo-root, .mapboxgl-ctrl-geocoder, .maplibregl-ctrl-geocoder { transition: none !important; animation: none !important; }
}
`,"geocoder-skin");const{t:n,locale:r}=Wt(),i=e,s=ee(()=>/^pk\./.test(String(i.accessToken||""))),l=ee(()=>i.placeholder||(i.provider==="maplibre"&&!s.value?n("search.placeholderNoPlaces"):n("search.placeholder"))),c=o,u={"&":"&","<":"<",">":">",'"':""","'":"'"};function d(k){return String(k??"").replace(/[&<>"']/g,z=>u[z])}function p(k){return k==null?"":typeof k=="string"?k:typeof k=="object"?k.label||k.value||"":String(k)}const _={"people-group":"people","doxa-people-group":"peopleGroup","doxa-affinity-bloc":"bloc","doxa-cluster":"cluster","doxa-country":"country","doxa-region":"region","doxa-language-family":"family","doxa-language":"languageKind","doxa-dialect":"dialect","doxa-religion":"religionKind"};function f(k){const z=_[k];if(!z)return"";const O=n("search.kinds."+z);return`${d(O)}`}function h(k){var X;if(!k)return"";const z=k.place_type||[];if(z.includes("doxa-section-header"))return`
`;if(z.includes("people-group")){const le=k.properties||{},H=p(le.name)||p(le.displayName)||p(k.text)||"",be=p(le.countryName)||p(le.country)||p(le.countryIso)||"",ke=p(le.language)||p(le.primaryLanguage)||p(le.languageFamily)||"",Ee=p(le.religionName)||p(le.religion)||"",He=n("search.labels.place"),Ae=n("search.labels.language"),Ve=n("search.labels.religion"),Qe=[];return be&&Qe.push(`${d(He)} ${d(be)}`),ke&&Qe.push(`${d(Ae)} ${d(ke)}`),Ee&&Qe.push(`${d(Ve)} ${d(Ee)}`),`${f("people-group")}${d(H)}
`+(Qe.length?`${Qe.join("")}
`:"")}const O=z.find(le=>le.startsWith("doxa-"));if(O){const le=k.properties||{},H=d(p(le.label)||k.text||""),be=Number(le.count)||0,ke=be?` ${be}`:"";return`${f(O)}${H}${ke}
`}return`${d(k.place_name||k.text||"")}
`}const y=st("dataStore",null),b=st("mapStore",null),m=st("uiStore",null);function w(){return b?b.selectedFamily?{kind:"family",key:b.selectedFamily}:b.selectedLanguage?{kind:"language",key:b.selectedLanguage}:null:null}const{search:$}=HS({dataStore:y,dataSourceId:i.dataSourceId||void 0,getActiveFilter:w,getActiveContext:()=>i.activeContext||null}),g=Za(null),v=me(null),P={mapbox:ya.mapboxGeocoderCss.url,maplibre:ya.maplibreGeocoderCss.url},L=ya.maplibreGeocoderJs.url,T=ya.mapboxGeocoderJs.url;function V(k,z){const O=P[z]||P.mapbox;if(k.querySelector(`link[href="${O}"]`))return;const X=document.createElement("link");X.rel="stylesheet",X.href=O,Dr(X,O),k.prepend(X)}async function J(k,z){if(typeof window<"u"&&window[z]||typeof document>"u")return;const O=document.querySelector(`script[src="${k}"]`);if(O){if(window[z])return;await new Promise(X=>{O.addEventListener("load",X,{once:!0}),O.addEventListener("error",X,{once:!0})});return}await new Promise(X=>{const le=document.createElement("script");le.src=k,Dr(le,k),le.async=!0,le.addEventListener("load",X,{once:!0}),le.addEventListener("error",X,{once:!0}),document.head.appendChild(le)})}function N(k=document){let z=k.activeElement;for(;z&&z.shadowRoot&&z.shadowRoot.activeElement;)z=z.shadowRoot.activeElement;return z}function E(k){const z=k==null?void 0:k._onKeyDown;typeof z=="function"&&(k._onKeyDown=function(O){const X=N();return!X||X===O.target||typeof X.value!="string"?z.call(k,O):z.call(k,new Proxy(O,{get(le,H){if(H==="target"||H==="srcElement")return X;const be=Reflect.get(le,H);return typeof be=="function"?be.bind(le):be}}))})}async function re(){await J(T,"MapboxGeocoder")}async function Q(){if(typeof window<"u"&&window.MaplibreGeocoder||typeof document>"u")return;const k=document.querySelector(`script[src="${L}"]`);if(k){if(window.MaplibreGeocoder)return;await new Promise(z=>{k.addEventListener("load",z,{once:!0}),k.addEventListener("error",z,{once:!0})});return}await new Promise((z,O)=>{const X=document.createElement("script");X.src=L,X.async=!1,X.addEventListener("load",z,{once:!0}),X.addEventListener("error",()=>O(new Error("[GeocoderComponent] Failed to load MapLibre geocoder")),{once:!0}),document.head.appendChild(X)})}function B(k,z){return async O=>{const X={features:[]};if(!/^pk\./.test(String(k||""))||!(O!=null&&O.query))return X;try{const le=Array.isArray(O.language)?O.language[0]:O.language||z()||"en",H=new URLSearchParams({access_token:k,autocomplete:"true",limit:String(O.limit||5)});le&&H.set("language",le);const be=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(O.query)}.json?${H.toString()}`,ke=await fetch(be);if(!ke.ok)return X;const Ee=await ke.json();return Ee&&Array.isArray(Ee.features)?Ee:X}catch{return X}}}go(async()=>{var le,H,be,ke,Ee;const k=i.provider==="maplibre";if(k){if(await Q(),typeof MaplibreGeocoder>"u"){console.error("[GeocoderComponent] MaplibreGeocoder global unavailable.");return}}else if(typeof MapboxGeocoder>"u"&&(await re(),typeof MapboxGeocoder>"u")){console.error("[GeocoderComponent] MapboxGeocoder global unavailable.");return}const z=i.mapInstance;if(!i.standalone&&!z)return;const O=i.standalone?(H=(le=v.value)==null?void 0:le.getRootNode)==null?void 0:H.call(le):(Ee=(ke=(be=z.getContainer)==null?void 0:be.call(z))==null?void 0:ke.getRootNode)==null?void 0:Ee.call(ke);O instanceof ShadowRoot&&V(O,i.provider);const X={marker:!1,flyTo:!i.standalone,trackProximity:!i.standalone,placeholder:l.value,language:r.value||"en",localGeocoder:$,limit:20,zoom:6,render:h};if(k){const He=typeof maplibregl<"u"?maplibregl:void 0,Ae={forwardGeocode:B(i.accessToken,()=>r.value)};g.value=new MaplibreGeocoder(Ae,{...X,maplibregl:He,showResultsWhileTyping:!0,reverseGeocode:!1})}else g.value=new MapboxGeocoder({accessToken:i.accessToken,mapboxgl,...X});if(E(g.value),g.value.on("result",He=>{var Ve,Qe,$e,M,j,I,ne,ge,ue,ve,_e,x,S,Z,A,W,q,D,G,fe,Ce,et,dt,_t,Me,Ne,Fe,nt,mt,lo;const Ae=He==null?void 0:He.result;Ae&&((Ve=Ae.place_type)!=null&&Ve.includes("doxa-section-header")||(b&&(b.selectedRegion=null,b.selectedResource=null,b.selectedAffinityBlock=null,b.selectedDialect=null),m&&((Qe=m.setPrayerFilter)==null||Qe.call(m,null),($e=m.setEngagementFilter)==null||$e.call(m,null),(M=m.setAdoptionFilter)==null||M.call(m,null),(j=m.setReligionFilter)==null||j.call(m,null)),(I=Ae.properties)!=null&&I._allDataSection&&b&&(b.selectedFamily=null,b.selectedLanguage=null),c("result",He),(ne=Ae.place_type)!=null&&ne.includes("people-group")&&Ae.feature?c("people-group-result",{type:"Feature",properties:Ae.properties||Ae.feature,geometry:Ae.geometry||{type:"Point",coordinates:Ae.center}}):((ge=Ae.place_type)!=null&&ge.includes("doxa-country")||(ue=Ae.place_type)!=null&&ue.includes("doxa-region")||(ve=Ae.place_type)!=null&&ve.includes("doxa-language-family")||(_e=Ae.place_type)!=null&&_e.includes("doxa-language")||(x=Ae.place_type)!=null&&x.includes("doxa-dialect")||(S=Ae.place_type)!=null&&S.includes("doxa-religion")||(Z=Ae.place_type)!=null&&Z.includes("doxa-affinity-bloc")||(A=Ae.place_type)!=null&&A.includes("doxa-cluster")||(W=Ae.place_type)!=null&&W.includes("doxa-people-group"))&&c("aggregate-result",{kind:Ae.place_type[0].replace(/^doxa-/,""),label:((q=Ae.properties)==null?void 0:q.label)||Ae.text,count:((D=Ae.properties)==null?void 0:D.count)||0,memberIds:((G=Ae.properties)==null?void 0:G.memberIds)||[],bounds:((fe=Ae.properties)==null?void 0:fe.bounds)||null,center:Ae.center,originalLabels:((Ce=Ae.properties)==null?void 0:Ce.originalLabels)||null,familyDerived:((et=Ae.properties)==null?void 0:et.familyDerived)||"",baseLang:((dt=Ae.properties)==null?void 0:dt.baseLang)||"",dialectLabel:((_t=Ae.properties)==null?void 0:_t.dialectLabel)||"",slug:((Me=Ae.properties)==null?void 0:Me.slug)||null,id:Ae.id||null,blocCode:((Ne=Ae.properties)==null?void 0:Ne.blocCode)||"",blocLabel:((Fe=Ae.properties)==null?void 0:Fe.blocLabel)||"",clusterCode:((nt=Ae.properties)==null?void 0:nt.clusterCode)||"",clusterLabel:((mt=Ae.properties)==null?void 0:mt.clusterLabel)||"",peopleGroupCode:((lo=Ae.properties)==null?void 0:lo.peopleGroupCode)||"",properties:Ae.properties||null})))}),g.value.on("clear",()=>c("clear")),g.value.on("error",He=>c("error",He)),i.standalone){if(v.value){const He={on(){},off(){},fire(){},getContainer:()=>v.value,getZoom:()=>0,getCenter:()=>({lng:0,lat:0}),getBounds:()=>null,flyTo(){},fitBounds(){},addControl(){},removeControl(){},hasControl:()=>!1};try{const Ae=g.value.onAdd(i.mapInstance||He);Ae&&v.value.appendChild(Ae)}catch(Ae){c("error",Ae)}}}else z.addControl(g.value,"top-left"),he()});function he(){var z,O;const k=(O=(z=g.value)==null?void 0:z.container)==null?void 0:O.parentElement;k&&(k.classList.add("dg-search-band"),k.classList.toggle("dg-search-band--dark",!!i.isDark))}return gt(()=>i.isDark,()=>he()),gt(l,k=>{var X,le;const z=g.value;if(!z)return;const O=z._inputEl||((le=(X=z.container)==null?void 0:X.querySelector)==null?void 0:le.call(X,"input.mapboxgl-ctrl-geocoder--input"));O&&(O.placeholder=k,O.setAttribute("placeholder",k)),z.options&&(z.options.placeholder=k)}),gt(r,k=>{const z=g.value;z!=null&&z.options&&(z.options.language=k||"en")}),Yt(()=>{var k,z;if(g.value){try{i.standalone?(z=(k=g.value).onRemove)==null||z.call(k):i.mapInstance&&i.mapInstance.removeControl(g.value)}catch{}g.value=null}}),t({geocoder:g}),(k,z)=>e.standalone?(Y(),ae("div",{key:0,ref_key:"standaloneContainer",ref:v,class:"dg-standalone-geocoder"},null,512)):Pn(k.$slots,"default",{},void 0,void 0,1)}},WS=["mapbox","maplibre"],KS="auto";function xf(e){return e&&typeof e=="object"&&"value"in e&&!("provider"in e)&&!("profile"in e)?e.value:e}function VS(e,{token:t}={}){const o=xf(e);return qS(o)||"maplibre"}function qS(e){const t=xf(e),o=t==null?void 0:t.provider,a=typeof location<"u"?new URLSearchParams(location.search).get("provider"):void 0,n=typeof window<"u"?window.MAP_PROVIDER:void 0,r=String(o||a||n||KS).toLowerCase().trim();return WS.includes(r)?r:""}const YS="rgba(120, 128, 134, 0.28)",Sf="36px",Pf=()=>{};function ZS(e,t={}){const{enabled:o=!0}=t;if(!o||!e)return Pf;const a=Array.from(e.querySelectorAll(".map-scroll-edge"));if(!a.length)return Pf;const n=m=>m.classList.contains("map-scroll-edge--left");for(const m of a)m.style.background=`linear-gradient(${n(m)?"to right":"to left"}, ${YS} ${Sf}, transparent ${Sf})`,m.style.opacity="0",m.style.transition="opacity 0.16s ease",m.style.userSelect="none",m.style.webkitUserSelect="none";const r=m=>{m.style.opacity="1"},i=m=>{m.style.opacity="0"},s=()=>a.find(m=>!n(m))||null,l=new Set;let c=!1,u=null;const d=()=>{for(const m of a)l.has(m)||i(m)},p=()=>{const m=s();m&&(r(m),u&&clearTimeout(u),u=setTimeout(d,250))},_=()=>p(),f=m=>{if(!(m.touches&&m.touches.length===1))return;const w=m.target;w&&w.classList&&w.classList.contains("map-scroll-edge")||p()},h=()=>{u&&clearTimeout(u),d()};e.addEventListener("wheel",_,{passive:!0}),e.addEventListener("touchmove",f,{passive:!0}),e.addEventListener("touchend",h,{passive:!0}),e.addEventListener("touchcancel",h,{passive:!0});const y=()=>{c||p()};typeof window<"u"&&window.addEventListener("scroll",y,{passive:!0});const b=[];for(const m of a){const w=()=>{l.add(m),r(m)},$=()=>{l.delete(m),i(m)},g=()=>{c=!0,r(m)},v=()=>{c=!1,i(m)};m.addEventListener("mouseenter",w),m.addEventListener("mouseleave",$),m.addEventListener("touchstart",g,{passive:!0}),m.addEventListener("touchend",v,{passive:!0}),b.push(()=>{m.removeEventListener("mouseenter",w),m.removeEventListener("mouseleave",$),m.removeEventListener("touchstart",g),m.removeEventListener("touchend",v)})}return function(){u&&(clearTimeout(u),u=null),e.removeEventListener("wheel",_),e.removeEventListener("touchmove",f),e.removeEventListener("touchend",h),e.removeEventListener("touchcancel",h),typeof window<"u"&&window.removeEventListener("scroll",y);for(const w of b)w();for(const w of a)i(w)}}const JS=Object.fromEntries([{id:"midnight-glow",label:"Midnight Glow",mood:"the prayer-map dark — pins glow like embers",mapbox:"mapbox://styles/mapbox/standard",lightPreset:"night",maplibre:"https://tiles.openfreemap.org/styles/fiord",bestFor:["doxa-simple-map","my-upg-100-list"]},{id:"daylight",label:"Daylight",mood:"the same Standard world, lights on",mapbox:"mapbox://styles/mapbox/standard",lightPreset:"day",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["doxa-research-map","gospel-resources"]},{id:"dawn",label:"Dawn",mood:"soft warm horizon — hopeful, quiet",mapbox:"mapbox://styles/mapbox/standard",lightPreset:"dawn",maplibre:"https://tiles.openfreemap.org/styles/positron",bestFor:["doxa-simple-map"]},{id:"dusk",label:"Dusk",mood:"blue hour — calm contrast for bright pins",mapbox:"mapbox://styles/mapbox/standard",lightPreset:"dusk",maplibre:"https://tiles.openfreemap.org/styles/fiord",bestFor:["my-upg-100-list"]},{id:"paper",label:"Paper",mood:"near-white minimal — data reads like print",mapbox:"mapbox://styles/mapbox/light-v11",maplibre:"https://tiles.openfreemap.org/styles/positron",bestFor:["research-dashboard","cities-internet"]},{id:"ink",label:"Ink",mood:"near-black minimal — maximum pin contrast",mapbox:"mapbox://styles/mapbox/dark-v11",maplibre:"https://tiles.openfreemap.org/styles/dark",bestFor:["my-upg-100-list","cities-internet"]},{id:"streetlife",label:"Street Life",mood:"full street detail — city-scale work",mapbox:"mapbox://styles/mapbox/streets-v12",maplibre:"https://tiles.openfreemap.org/styles/bright",bestFor:["cities-internet","key-cities"]},{id:"terrain",label:"Terrain",mood:"relief + parks — where people actually live",mapbox:"mapbox://styles/mapbox/outdoors-v12",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["doxa-research-map","country-posters"]},{id:"satellite",label:"Satellite",mood:"imagery — the real ground",mapbox:"mapbox://styles/mapbox/satellite-v9",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["country-posters"]},{id:"hybrid",label:"Hybrid",mood:"imagery + labels — orientation without losing ground truth",mapbox:"mapbox://styles/mapbox/satellite-streets-v12",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["key-cities"]},{id:"wayfinder-day",label:"Wayfinder Day",mood:"high-legibility navigation palette",mapbox:"mapbox://styles/mapbox/navigation-day-v1",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["gospel-resources"]},{id:"wayfinder-night",label:"Wayfinder Night",mood:"dark navigation — dashboards at night",mapbox:"mapbox://styles/mapbox/navigation-night-v1",maplibre:"https://tiles.openfreemap.org/styles/fiord",bestFor:["research-dashboard"]},{id:"galaxy",label:"Galaxy",mood:"the day side of Earth floating in space — normal land, blue oceans, black void behind the sphere",mapbox:"mapbox://styles/mapbox/standard",maplibre:"https://tiles.versatiles.org/assets/styles/colorful/style.json",bestFor:["research-dashboard","my-upg-100-list"]}].map(e=>[e.id,e]));function Wc(e,t="mapbox"){if(typeof e!="string"||!e)return{style:void 0,lightPreset:void 0,paint:void 0};const o=JS[e];return o?t==="maplibre"?{style:o.maplibre,lightPreset:void 0,paint:o.paint}:{style:o.mapbox,lightPreset:o.lightPreset,paint:o.paint}:/^(mapbox:\/\/|https?:\/\/)/.test(e)?{style:e,lightPreset:void 0,paint:void 0}:{style:void 0,lightPreset:void 0,paint:void 0}}const Af={mapbox:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.3.0/mapbox-gl-rtl-text.js",maplibre:"https://cdn.jsdelivr.net/npm/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js"};function XS(e){return!!e&&typeof window<"u"&&e===window.maplibregl}function QS(e){if(typeof window>"u")return!1;const t=e?[e]:[window.maplibregl,window.mapboxgl].filter(Boolean);let o=!1;for(const a of t)if(!(!a||!a.setRTLTextPlugin))try{if(XS(a)){if(a.getRTLTextPluginStatus&&a.getRTLTextPluginStatus()!=="unavailable")continue;const n=a.setRTLTextPlugin(Af.maplibre,!0);n&&n.catch&&n.catch(()=>{})}else a.setRTLTextPlugin(Af.mapbox,null,!0);o=!0}catch{}return o}const Bn={mapbox:{global:"mapboxgl",js:ya.mapboxGlJs.url,css:ya.mapboxGlCss.url},maplibre:{global:"maplibregl",js:ya.maplibreGlJs.url,css:ya.maplibreGlCss.url}};function Kc(e){var o;const t=((o=Bn[e])==null?void 0:o.global)||Bn.mapbox.global;return typeof window<"u"?window[t]:void 0}function Lf(e){return(Bn[e]||Bn.mapbox).css||null}async function eP(e){const t=Bn[e]||Bn.mapbox;if(Kc(e)||typeof document>"u")return;if(!document.querySelector(`link[href="${t.css}"]`)){const a=document.createElement("link");a.rel="stylesheet",a.href=t.css,Dr(a,t.css),document.head.appendChild(a)}const o=document.querySelector(`script[src="${t.js}"]`);if(o){if(Kc(e))return;await new Promise(a=>{o.addEventListener("load",a,{once:!0}),o.addEventListener("error",a,{once:!0})});return}await new Promise((a,n)=>{const r=document.createElement("script");r.src=t.js,Dr(r,t.js),r.async=!1,r.addEventListener("load",a,{once:!0}),r.addEventListener("error",()=>n(new Error(`[useMapInstance] Failed to load ${e} engine script`)),{once:!0}),document.head.appendChild(r)})}async function tP(e,t){if(!e)return;const o=e.getRootNode();if(!(o instanceof ShadowRoot))return;const a=i=>new Promise(s=>setTimeout(s,i)),n=o.querySelector(`link[href="${t}"]`);if(n){if(n.sheet)return;await Promise.race([new Promise(i=>{n.addEventListener("load",i,{once:!0}),n.addEventListener("error",i,{once:!0})}),a(2e3)]);return}const r=document.createElement("link");r.rel="stylesheet",r.href=t,Dr(r,t),await Promise.race([new Promise(i=>{r.addEventListener("load",i,{once:!0}),r.addEventListener("error",i,{once:!0}),o.prepend(r)}),a(2e3)])}const oP=["country_code","wagf_region","wagf_block","primary_language","religion","imb_gsec"];function aP(e){return e==null?{value:null,label:null}:typeof e=="object"?{value:e.value??null,label:e.label??null}:{value:e,label:null}}function nP(e){if(e==null||typeof e!="object")return e;const t={...e};for(const o of oP)if(o in t){const{value:a,label:n}=aP(t[o]);t[o]=a,n!=null&&(t[`${o}_label`]=n)}return t}function Vc(e){return Array.isArray(e)?e.map(nP):[]}function qc(e){return Array.isArray(e)?e:e&&typeof e=="object"?e.posts||e.data||e.records||e.results||e.items||[]:[]}const rP={"andean-caribbean":"#f9a51f","asia-china-tibet-autonomous-region":"#00f0c8","asia-china-yunnan-province":"#22ddff","asia-frontier-nas-a":"#ff1744","asia-india-andhra-pradesh":"#22ddff","asia-india-assam":"#22ddff","asia-india-chhattisgarh":"#536dfe","asia-india-gujarat":"#536dfe","asia-india-karnataka":"#536dfe","asia-india-kerala":"#2196ff","asia-india-madhya-pradesh":"#2196ff","asia-india-maharashtra":"#2196ff","asia-india-odisha":"#2196ff","asia-india-rajasthan":"#22ddff","asia-india-tamil-nadu":"#7c4dff","asia-india-uttarakhand":"#536dfe","asia-india-west-bengal":"#22ddff",brazil:"#f4c57b","central-africa":"#c20001",deaf:"#18ffff","east-africa":"#ef3410",europe:"#34cb74",laos:"#7c4dff","maghreb-egypt":"#602f74","mainland-se-asia-philippines":"#ff1744","middle-east-core":"#bc8bd0","oceania-indonesia":"#ee892f","southern-africa-islands":"#e75556",sudan:"#e69e93","uncovered-central-asia":"#ff8a00","uncovered-himalaya":"#ff6d00","uncovered-japan":"#ffc400","uncovered-mongolia":"#76ff03","uncovered-nas-a":"#ff1744","uncovered-nepal":"#ffea00","uncovered-sa-west":"#ff1744","uncovered-scatter":"#eeff41","west-africa":"#edcac9"};function iP(e,t){const o=rP[e];return typeof o=="string"&&o?o:t}const gn={ABW:"Aruba",IND:"India",AFG:"Afghanistan",AGO:"Angola",ALB:"Albania",AND:"Andorra",ARE:"United Arab Emirates",ARM:"Armenia",ASM:"American Samoa",ATG:"Antigua and Barbuda",AZE:"Azerbaijan",BEN:"Benin",BFA:"Burkina Faso",BGD:"Bangladesh",BGR:"Bulgaria",BHR:"Bahrain",BHS:"Bahamas",BIH:"Bosnia and Herzegovina",BLM:"Saint Barthélemy",BLR:"Belarus",BMU:"Bermuda",BOL:"Bolivia",BRA:"Brazil",BRB:"Barbados",BRN:"Brunei",BTN:"Bhutan",CAF:"Central African Republic",CHN:"China",CIV:"Côte d'Ivoire",CMR:"Cameroon",COD:"DR Congo",COG:"Congo",COK:"Cook Islands",COL:"Colombia",COM:"Comoros",CUB:"Cuba",CUW:"Curaçao",CYM:"Cayman Islands",CYP:"Cyprus",CZE:"Czechia",DJI:"Djibouti",DMA:"Dominica",DZA:"Algeria",ECU:"Ecuador",EGY:"Egypt",ERI:"Eritrea",ESP:"Spain",ETH:"Ethiopia",FIN:"Finland",FJI:"Fiji",FRO:"Faroe Islands",FSM:"Micronesia",GAB:"Gabon",GEO:"Georgia",GGY:"Guernsey",GHA:"Ghana",GIN:"Guinea",GLP:"Guadeloupe",GMB:"Gambia",GNB:"Guinea-Bissau",GNQ:"Equatorial Guinea",GRC:"Greece",GRD:"Grenada",GUF:"French Guiana",GUM:"Guam",GUY:"Guyana",IDN:"Indonesia",IRN:"Iran",IRQ:"Iraq",ISL:"Iceland",ISR:"Israel",JAM:"Jamaica",JOR:"Jordan",JPN:"Japan",KAZ:"Kazakhstan",KEN:"Kenya",KGZ:"Kyrgyzstan",KHM:"Cambodia",KIR:"Kiribati",KWT:"Kuwait",LAO:"Laos",LBN:"Lebanon",LBR:"Liberia",LBY:"Libya",LCA:"Saint Lucia",LIE:"Liechtenstein",LKA:"Sri Lanka",LUX:"Luxembourg",MAR:"Morocco",MDV:"Maldives",MHL:"Marshall Islands",MLI:"Mali",MLT:"Malta",MMR:"Myanmar",MNE:"Montenegro",MNG:"Mongolia",MNP:"Northern Mariana Islands",MOZ:"Mozambique",MRT:"Mauritania",MSR:"Montserrat",MUS:"Mauritius",MWI:"Malawi",MYS:"Malaysia",MYT:"Mayotte",NAM:"Namibia",NCL:"New Caledonia",NER:"Niger",NGA:"Nigeria",NIU:"Niue",NPL:"Nepal",NZL:"New Zealand",OMN:"Oman",PAK:"Pakistan",PAN:"Panama",PER:"Peru",PHL:"Philippines",PLW:"Palau",PNG:"Papua New Guinea",PRK:"North Korea",PRY:"Paraguay",PSE:"Palestine",PYF:"French Polynesia",QAT:"Qatar",RUS:"Russia",SAU:"Saudi Arabia",SDN:"Sudan",SEN:"Senegal",SHN:"Saint Helena",SLB:"Solomon Islands",SLE:"Sierra Leone",SMR:"San Marino",SOM:"Somalia",SSD:"South Sudan",STP:"São Tomé and Príncipe",SUR:"Suriname",SWE:"Sweden",SWZ:"Eswatini",SYR:"Syria",TCA:"Turks and Caicos Islands",TCD:"Chad",TGO:"Togo",THA:"Thailand",TJK:"Tajikistan",TON:"Tonga",TUN:"Tunisia",TUR:"Turkey",TZA:"Tanzania",UGA:"Uganda",USA:"United States",UZB:"Uzbekistan",VCT:"Saint Vincent and the Grenadines",VEN:"Venezuela",VGB:"British Virgin Islands",VIR:"U.S. Virgin Islands",VNM:"Vietnam",VUT:"Vanuatu",WLF:"Wallis and Futuna",WSM:"Samoa",YEM:"Yemen",ZAF:"South Africa",ZMB:"Zambia",ZWE:"Zimbabwe"},Cf=Object.freeze(Object.defineProperty({__proto__:null,ISO3_NAME:gn},Symbol.toStringTag,{value:"Module"})),hs={"Andaman and Nicobar Islands":9,"Andhra Pradesh":81,"Arunāchal Pradesh":7,Assam:15,Bihār:18,Chandīgarh:1,Chhattīsgarh:24,Delhi:1,"Dādra and Nagar Haveli and Damān and Diu":1,Goa:5,Gujarāt:90,Haryāna:4,"Himāchal Pradesh":20,"Jammu and Kashmīr":33,Jhārkhand:9,Karnātaka:81,Kerala:72,Ladākh:6,Lakshadweep:1,"Madhya Pradesh":33,Mahārāshtra:54,Manipur:5,Meghālaya:2,Odisha:64,Puducherry:5,Punjab:4,Rājasthān:48,Sikkim:1,"Tamil Nādu":64,Telangāna:26,Tripura:11,"Uttar Pradesh":23,Uttarākhand:7,"West Bengal":30,"Gansu Province":3,"Guangxi Zhuang Autonomous Region":6,"Guizhou Province":34,"Hainan Province":3,"Heilongjiang Province":2,"Hunan Province":5,"Inner Mongolia Autonomous Region":3,"Qinghai Province":3,"Sichuan Province":12,"Tibet Autonomous Region":13,"Xinjiang Uyghur Autonomous Region":7,"Yunnan Province":61},Tf={ABW:1,AFG:21,AGO:10,ALB:1,AND:1,ARE:2,ARM:1,ASM:1,ATG:1,AZE:3,BEN:9,BFA:8,BGD:3,BGR:1,BHR:2,BHS:1,BIH:1,BLM:1,BLR:1,BMU:1,BOL:1,BRA:103,BRB:1,BRN:5,BTN:13,CAF:1,CHN:154,CIV:2,CMR:8,COD:9,COG:2,COK:1,COL:27,COM:3,CUB:1,CUW:1,CYM:1,CYP:1,CZE:1,DJI:1,DMA:1,DZA:17,ECU:1,EGY:3,ERI:8,ESP:1,ETH:29,FIN:1,FJI:1,FRO:1,FSM:1,GAB:2,GEO:1,GGY:1,GHA:1,GIN:13,GLP:1,GMB:3,GNB:3,GNQ:1,GRC:1,GRD:1,GUF:2,GUM:1,GUY:1,IDN:36,IRN:20,IRQ:8,ISL:1,ISR:4,JAM:1,JOR:3,JPN:6,KAZ:1,KEN:5,KGZ:2,KHM:1,KIR:1,KWT:1,LAO:95,LBN:4,LBR:2,LBY:15,LCA:1,LIE:1,LKA:1,LUX:1,MAR:4,MDV:1,MHL:1,MLI:13,MLT:1,MMR:7,MNE:1,MNG:1,MNP:1,MOZ:4,MRT:3,MSR:1,MUS:1,MWI:1,MYS:12,MYT:1,NAM:6,NCL:1,NER:2,NGA:38,NIU:1,NPL:34,NZL:1,OMN:7,PAK:24,PAN:1,PER:10,PHL:1,PLW:1,PNG:1,PRK:1,PRY:1,PSE:4,PYF:1,QAT:3,RUS:21,SAU:3,SDN:105,SEN:1,SHN:1,SLB:1,SLE:2,SMR:1,SOM:9,SSD:22,STP:1,SUR:2,SWE:2,SWZ:1,SYR:5,TCA:1,TCD:53,TGO:6,THA:8,TJK:3,TON:1,TUN:2,TUR:3,TZA:16,UGA:6,USA:3,UZB:1,VCT:1,VEN:6,VGB:1,VIR:1,VNM:16,VUT:1,WLF:1,WSM:1,YEM:9,ZAF:2,ZMB:6,ZWE:3};function Ef(e){const t={...gn};for(const o of e||[]){const a=o&&o.country_code,n=o&&o.country_code_label;a&&n&&(t[a]=n)}return t}function Mf(e,t={}){if(!e||typeof e!="object")return null;const o=t.nameMap||gn;if(e.shapeName&&(e.listId||!e.iso3)){const a=String(e.shapeName),n=Object.prototype.hasOwnProperty.call(hs,a)?hs[a]:null;return{key:"adm1:"+a,name:a,count:n,kind:"adm1"}}if(e.iso3){const a=String(e.iso3),n=o[a]||gn[a]||a,r=Object.prototype.hasOwnProperty.call(Tf,a)?Tf[a]:null;return{key:"adm0:"+a,name:n,count:r,kind:"adm0"}}return null}function Rf(e,t={}){const o=Array.isArray(e)?e:[],a=o.map(l=>l.name),n=o.reduce((l,c)=>l+(Number(c.count)||0),0),r=t&&typeof t.color=="string"&&t.color?t.color:"",i=a.join(", ")+" — "+n+" UUPG"+(r?" · "+r:""),s=o.map(l=>l.name+" "+(Number(l.count)||0)).join(", ");return i+`
-`+s}const sP=["slug","name","country_code","population","territories","color"];function lP(e){let t=e==null?"":String(e);return/^[=+\-@]/.test(t)&&(t="'"+t),/[",\n\r]/.test(t)&&(t='"'+t.replace(/"/g,'""')+'"'),t}function Nf(e,t=new Map,o={}){const a=o&&typeof o.color=="string"?o.color:"",n=(e||[]).map(r=>[r.slug,r.name,r.country_code,r.population,(t.get(r.slug)||[]).join("; "),a].map(lP).join(","));return[sP.join(","),...n].join(`\r
+`+s}const sP=["slug","name","country_code","population","territories","color"];function lP(e){let t=e==null?"":String(e);return/^[=+\-@\t\r]/.test(t)&&(t="'"+t),/[",\n\r]/.test(t)&&(t='"'+t.replace(/"/g,'""')+'"'),t}function Nf(e,t=new Map,o={}){const a=o&&typeof o.color=="string"?o.color:"",n=(e||[]).map(r=>[r.slug,r.name,r.country_code,r.population,(t.get(r.slug)||[]).join("; "),a].map(lP).join(","));return[sP.join(","),...n].join(`\r
`)}function Ff(e,t={},o=""){const a=Rf(e,{color:t&&t.color?t.color:""});return o?a+`
`+o:a}function cP(e){return`upg-100-${String(e||"selection").normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^A-Za-z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase().slice(0,60)||"selection"}.csv`}function Hn(e){return String(e??"").normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().trim()}function uP(e){return Hn(e).split(/[\s,;]+/).filter(Boolean)}function dP(e={}){const{records:t=[],leafZones:o=[],adm1Counts:a={},iso3Names:n={},countryNameMap:r=null}=e,i=[],s=new Set;for(const c of t){if(!c)continue;const u=c.slug;if(!u||s.has(u))continue;const d=Number(c.latitude),p=Number(c.longitude);if(!Number.isFinite(d)||!Number.isFinite(p))continue;const _=c.name||u;s.add(u),i.push({label:_,kind:"pg",target:{type:"pg",slug:u,lng:p,lat:d},_hay:Hn(_)})}for(const c of o){if(!c)continue;const u=c.zoneKey||c.id,d=c.label||u;u&&i.push({label:d,kind:"zone",target:{type:"zone",zoneId:u},_hay:Hn(d)})}for(const c of Object.keys(a))i.push({label:c,kind:"territory",target:{type:"territory",shapeName:c},_hay:Hn(c)});const l=r||n;for(const c of Object.keys(n)){const u=l&&l[c]||n[c]||c;i.push({label:u,kind:"territory",target:{type:"territory",shapeName:c,iso3:!0},_hay:Hn(u)})}return i}const pP={zone:0,territory:1,pg:2};function gP(e={}){const{records:t=[],leafZones:o=[],adm1Counts:a={},iso3Names:n={},countryNameMap:r=null,centroidFor:i=null}=e,s=[];for(const u of t)u&&s.push(u);const l=(u,d,p)=>!d||!Number.isFinite(d[0])||!Number.isFinite(d[1])?null:{name:u,slug:p.__synthSlug,latitude:d[1],longitude:d[0],...p};for(const u of o){if(!u)continue;const d=u.zoneKey||u.id,p=u.label||d;if(!d)continue;const _=typeof i=="function"?i(h=>h&&h.properties&&h.properties.zoneKey===d):null,f=l(p,_,{__upgKind:"zone",__zoneId:d,__synthSlug:`__zone__${d}`});f&&s.push(f)}for(const u of Object.keys(a)){const d=typeof i=="function"?i(_=>_&&_.properties&&_.properties.shapeName===u):null,p=l(u,d,{__upgKind:"territory",__shapeName:u,__synthSlug:`__terr__${u}`});p&&s.push(p)}const c=r||n;for(const u of Object.keys(n)){const d=c&&c[u]||n[u]||u,p=typeof i=="function"?i(f=>f&&f.properties&&f.properties.iso3===u):null,_=l(d,p,{__upgKind:"territory",__shapeName:u,__synthSlug:`__terr__${u}`});_&&s.push(_)}return s}function If(e,t,o={}){const a=o.limit??8,n=uP(t);if(!n.length)return[];const r=n[0],i=[];for(const s of e){let l=!0;for(const d of n)if(!s._hay.includes(d)){l=!1;break}if(!l)continue;const c=s._hay.startsWith(r)?0:1,u=s._hay===Hn(t)?-1:0;i.push({e:s,starts:c,exact:u,kr:pP[s.kind]??9,len:s._hay.length})}return i.sort((s,l)=>s.exact-l.exact||s.starts-l.starts||s.kr-l.kr||s.len-l.len),i.slice(0,a).map(s=>s.e)}const fs=new Set;function hP(e,t){var n,r;const o=e.getSource(t);if(!o)return[];let a=o._data??((r=(n=o.serialize)==null?void 0:n.call(o))==null?void 0:r.data);if(a&&typeof a=="object"&&!Array.isArray(a)){if(a.geojson!==void 0)a=a.geojson;else if(a.url!==void 0)return fs.has(t)||(fs.add(t),console.warn(`[pin-selection] source "${t}" is remote (url); its features cannot be read locally, so nothing can be selected from it.`)),[]}return a?Array.isArray(a==null?void 0:a.features)?a.features:(a==null?void 0:a.type)==="Feature"?[a]:(a&&typeof a=="object"&&!fs.has(t)&&(fs.add(t),console.warn(`[pin-selection] source "${t}": unrecognised data shape {${Object.keys(a).join(",")}} — nothing can be selected from it; this is NOT a confirmed empty source.`)),[]):[]}const fP={class:"upg-root"},mP={key:0,class:"upg-map-err"},bP={class:"upg-legend-desktop-slot"},$P={class:"upg-legend-mobile-slot"},_P={class:"upg-detail-desktop-slot"},yP=["aria-label","title"],vP={class:"upg-shown-name"},kP={key:5,class:"upg-hud"},wP={class:"upg-hud-hint"},xP={key:0,class:"upg-hud-head"},SP={class:"upg-hud-total"},PP={key:1,class:"upg-hud-names"},AP=["aria-label"],LP=["aria-pressed","data-color","title","aria-label","onClick"],CP=["aria-label"],TP={key:3,class:"upg-hud-actions"},EP=["disabled"],MP=["disabled"],RP=["disabled"],NP={key:4,class:"upg-hud-actions"},FP=["disabled"],IP={key:5,class:"upg-hud-flash"},OP={class:"upg-status"},Yc="upg-search",Of=1,DP="people-groups",Df=8,zf=123,zP=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"upg-100-list",setup(e){const t=Fg(()=>wt(()=>Promise.resolve().then(()=>eS),void 0)),o=st("mapboxToken",me("")),a=st("profileConfig",me(null));let n=null,r=null,i=null;function s(){var C,F;return((C=a.value)==null?void 0:C.instanceId)||((F=a.value)==null?void 0:F.profile)||"upg-100-list"}const l=VS(a),c=l==="maplibre",u=ee(()=>{var C;return((C=a==null?void 0:a.value)==null?void 0:C.search)===!1?!1:l==="mapbox"}),d=ee(()=>{var F;const C=(F=a.value)==null?void 0:F.edgeScrollAffordance;return C==null?!0:!(C===!1||C==="false")}),p=st("dataStore",null),_=st("uiStore",null),f=me(null),h=me(""),y=me(""),b=Za([]),m=me(null),w=Za(null),$=me(!1),g=Cv("my-upg-100-list");g.theme.value="light",Tv(g);const v=me([]),P=ee(()=>v.value.reduce((C,F)=>C+(Number(F.count)||0),0)),L=ee(()=>v.value.length),T=me("");let V=null;const J=me(!1);function N(C){const F=C===void 0?!J.value:!!C;return F===J.value||(J.value=F,H&&(H.getCanvas().style.cursor=""),F&&Rt().catch(()=>{}),A()),F}function E(){N()}gt([J,$],()=>{no(()=>Re())});function re(C){if(!C)return;const F=v.value,K=F.findIndex(oe=>oe.key===C.key);K>=0?v.value=F.filter((oe,Le)=>Le!==K):v.value=[...F,C],A(),T.value=""}const Q=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7","#999999"],B=me(""),he=me("");function k(C){const F=/^#?([0-9a-fA-F]{6})$/.exec(String(C||"").trim());if(!F)return;const K="#"+F[1].toLowerCase();B.value=B.value===K?"":K,A()}function z(){/^#?[0-9a-fA-F]{6}$/.test(he.value.trim())&&k(he.value)}const O=me(null),X=ee(()=>[{id:"upg100Region",label:$e("tabs.upg100Region"),info:$e("legend.tabInfo.upg100Region")},{id:"upg100Zone",label:$e("tabs.upg100Zone"),info:$e("legend.tabInfo.upg100Zone")}]);let le=[],H=null,be=null,ke=[],Ee=null,He=null,Ae=null;const Ve=typeof window<"u"&&window.MAP_APP_API_URL||void 0||"",{locale:Qe,t:$e}=Wt();let M="";gt(()=>Nt(),()=>{(h.value===""||h.value===M)&&(h.value=M=$e("legend.loadingData"))},{immediate:!0});function j(C){const F={zone_affinity_A017:$e("poster.zone_deaf")},K=C?ph(C):void 0;return{deafCount:zf,...C?{records:C}:{},title:oe=>ec(oe,F,{byCode:K,countryName:Qi,locale:Nt()}),regionTitle:oe=>Jl[oe]?$e(`poster.${Jl[oe]}`):oe}}let I=null;function ne(C){return C!==void 0&&(I=C),Xl(ie(),j(I))}gt(()=>Nt(),()=>{if(!b.value.length)return;b.value=ne();const C=new Map(Mr(b.value).map(F=>[F.id,F.label]));for(const F of ke)C.has(F.id)&&(F.label=C.get(F.id));fe&&Ce(fe)});const ge=ee(()=>$e("legend.title.upg100List")),ue=ee(()=>$e("legend.title.batchSelect")),ve=ee(()=>$e("search.upg100Placeholder"));eo(`.upg-root{position:absolute;inset:0;background:#0a1410;color:#e5e7eb;isolation:isolate;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}.upg-map{position:absolute;inset:0}.upg-map-err{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);z-index:1;pointer-events:none;text-align:center;padding:0 24px;font:13px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#9aa7b8}.upg-map-err strong{display:block;font-size:14px;color:#cbd5e1;margin-bottom:4px}.map-scroll-edge{position:absolute;top:0;bottom:0;width:40px;z-index:2;touch-action:pan-y;pointer-events:auto;background:transparent}.map-scroll-edge--left{left:0}.map-scroll-edge--right{right:0}.upg-legend-desktop-slot{--stl-top:8px}.upg-legend-mobile-slot{display:none}@media(max-width:767px){.upg-legend-mobile-slot{display:block}.upg-legend-desktop-slot{display:none}.upg-detail-desktop-slot{display:none}}.upg-root{--upg-credit-floor:calc(max(min(var(--legend-sheet-h,0px),48px),var(--map-fab-clearance,0px)) + 30px)}@media(max-width:767.98px){.upg-root{--upg-credit-floor:max(min(var(--legend-sheet-h,0px),48px),var(--map-fab-clearance,0px))}}.upg-status{position:absolute;bottom:calc(var(--upg-credit-floor) + 6px);inset-inline-end:10px;z-index:1;pointer-events:none;font:10px/1 ui-monospace,monospace;color:#9aa7b8;background:rgba(10,14,21,.82);padding:6px 10px;border-radius:8px}@media(max-width:767px){.upg-status{display:none}}.upg-detail-panel{position:absolute;top:60px;right:8px;bottom:10px;width:340px;max-width:calc(100vw - 16px);z-index:6;background:#fff;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.45);overflow:hidden;display:flex;flex-direction:column;animation:upgPanelIn .18s ease}.upg-detail-panel.dark{background:#1a1a2e}@keyframes upgPanelIn{from{transform:translateX(16px);opacity:0}to{transform:translateX(0);opacity:1}}@media(max-width:480px){.upg-detail-panel{top:auto;left:8px;right:8px;width:auto;height:55vh}}.upg-shown{position:absolute;bottom:calc(var(--upg-credit-floor) + 12px);left:50%;transform:translateX(-50%);z-index:6;display:inline-flex;align-items:center;gap:10px;max-width:calc(100% - 120px);min-height:40px;box-sizing:border-box;padding:0 6px 0 16px;border:1px solid rgba(110,231,183,.45);border-radius:999px;background:rgba(10,20,16,.92);color:#e5e7eb;font:600 13px/1.2 system-ui,sans-serif;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.25)}.upg-shown-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upg-shown-x{display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;height:28px;border-radius:50%;background:rgba(255,255,255,.16);font-size:18px;line-height:1}.upg-shown:focus-visible{outline:2px solid #6ee7b7;outline-offset:2px}.upg-hud{position:absolute;bottom:calc(var(--upg-credit-floor) + 30px);inset-inline-end:10px;z-index:6;min-width:150px;font:11px/1.35 ui-monospace,monospace;color:#e5e7eb;background:rgba(10,20,16,.92);border:1px solid rgba(110,231,183,.35);border-radius:10px;padding:8px 10px;box-shadow:0 4px 16px rgba(0,0,0,.4)}.upg-hud-head{display:flex;align-items:baseline;gap:6px;white-space:nowrap}.upg-hud-total{font-size:15px;font-weight:700;color:#6ee7b7}.upg-hud-band{margin-inline-start:auto;font-size:9px;color:#9aa7b8}.upg-hud-band.ok{color:#6ee7b7}.upg-hud-names{margin-top:5px;max-height:84px;overflow:auto;font-size:10px;color:#cbd5e1;line-height:1.45;word-break:break-word}.upg-hud-actions{display:flex;gap:6px;margin-top:7px}.upg-hud-btn{flex:1;cursor:pointer;border:1px solid rgba(110,231,183,.4);background:rgba(16,185,129,.18);color:#d1fae5;font:12px/1 ui-monospace,monospace;padding:0 10px;min-height:40px;border-radius:8px}.upg-hud-btn:hover{background:rgba(16,185,129,.32)}.upg-hud-btn.clear{background:rgba(148,163,184,.12);border-color:rgba(148,163,184,.4);color:#cbd5e1}.upg-hud-flash{margin-top:5px;font-size:9px;color:#6ee7b7;min-height:11px}.upg-hud-hint{margin-top:4px;font-size:9px;color:#64748b}.upg-hud-swatches{display:flex;gap:6px;margin-top:7px;align-items:center;flex-wrap:wrap}.upg-swatch{width:40px;height:40px;border-radius:9px;cursor:pointer;padding:0;border:1px solid rgba(255,255,255,.3)}.upg-swatch.active{outline:2px solid #fff;outline-offset:1px}.upg-hex{width:84px;min-height:40px;background:rgba(148,163,184,.12);border:1px solid rgba(148,163,184,.4);color:#cbd5e1;font:12px/1 ui-monospace,monospace;padding:0 8px;border-radius:8px}@media(max-width:480px){.upg-hud{left:8px;right:8px;min-width:0;bottom:calc(var(--upg-credit-floor) + 30px);max-height:48vh;overflow:auto}}.map-toolbar .mcb.upg-batch-on{background:#10b981!important;color:#04241a!important;box-shadow:0 0 0 2px rgba(52,211,153,.45),0 1px 4px rgba(0,0,0,0.2)!important}.map-toolbar .mcb.upg-batch-on.dark{border-color:#34d399!important}.upg-batch-row{position:relative;background:rgba(16,185,129,.16)!important;opacity:1!important;box-shadow:inset 3px 0 0 0 #10b981}.upg-batch-row .stl-name{color:#065f46!important;font-weight:700}.stl-panel[data-theme="dark"] .upg-batch-row .stl-name,.upg-batch-row.dark .stl-name{color:#6ee7b7!important}.upg-batch-row .stl-dot{box-shadow:0 0 0 2px #10b981}.mapboxgl-ctrl-top-left{top:12px!important;left:8px!important;width:380px!important;max-width:380px!important;z-index:1200!important}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:0!important;float:none!important}.stl-panel{--stl-top:8px!important}.upg-root:has(.mapboxgl-ctrl-geocoder) .stl-panel{--stl-top:58px!important}[dir="rtl"] .upg-legend-desktop-slot .stl-panel,.upg-root:has(.mapboxgl-ctrl-logo) .upg-legend-desktop-slot .stl-panel{max-height:calc(100% - var(--stl-top,60px) - 12px - 30px)!important}[dir="rtl"] .upg-detail-panel{right:auto!important;left:8px!important}.dg-main{font:13px/1.3 ui-monospace,monospace}.dg-meta{margin-top:2px;font-size:11px;color:#475569;display:flex;flex-wrap:wrap;gap:8px}.dg-field strong{font-weight:700}.dg-section-header-item{padding:4px 8px;font:10px/1.2 ui-monospace,monospace;letter-spacing:.06em;text-transform:uppercase;color:#94a3b8;pointer-events:none}`);function _e(C){const F=[];for(const K of C)F.push(K.zoneKey,iP(K.zoneKey,K.color));return["match",["get","zoneKey"],...F,"#9ca3af"]}function x(){if(H.getSource("tapestry")&&H.getLayer("tapestry-fill")&&H.getLayer("tapestry-line"))return;H.getSource("tapestry")||H.addSource("tapestry",{type:"geojson",data:be});const C=$.value?.45:.3,F=$.value?.65:.45;if(H.getLayer("tapestry-fill")||H.addLayer({id:"tapestry-fill",type:"fill",source:"tapestry",paint:{"fill-color":Ee,"fill-opacity":["case",["==",["get","zoneKey"],"deaf"],C,F]}}),H.getLayer("tapestry-line")||H.addLayer({id:"tapestry-line",type:"line",source:"tapestry",paint:{"line-color":Ee,"line-width":1.2,"line-opacity":.9}}),Mo){const K=Mo;no(()=>{Mo===K&&Ua(K)})}}function S(){!H||!H.getSource("tapestry")||H.getLayer("upg-sel-fill")||(H.addLayer({id:"upg-sel-fill",type:"fill",source:"tapestry",filter:["boolean",!1],paint:{"fill-color":"#f59e0b","fill-opacity":.28}}),H.addLayer({id:"upg-sel-line",type:"line",source:"tapestry",filter:["boolean",!1],paint:{"line-color":"#fbbf24","line-width":2.4,"line-opacity":.95}}))}function Z(){const C=[],F=[],K=[];for(const Le of v.value)Le.kind==="adm1"?C.push(Le.name):Le.kind==="adm0"?F.push(Le.key.slice(5)):Le.kind==="zone"&&K.push(Le.key.slice(5));const oe=[];return C.length&&oe.push(["in",["get","shapeName"],["literal",C]]),F.length&&oe.push(["in",["get","iso3"],["literal",F]]),K.length&&oe.push(["in",["get","zoneKey"],["literal",K]]),oe.length?oe.length===1?oe[0]:["any",...oe]:["boolean",!1]}function A(){if(Re(),!H||!H.getLayer("upg-sel-fill"))return;const C=J.value?Z():["boolean",!1];H.setFilter("upg-sel-fill",C),H.setFilter("upg-sel-line",C);const F=B.value;H.setPaintProperty("upg-sel-fill","fill-color",F||"#f59e0b"),H.setPaintProperty("upg-sel-fill","fill-opacity",F?.55:.28),H.setPaintProperty("upg-sel-line","line-color",F||"#fbbf24")}let W=null,q=!1;function D(){if(!(!H||!H.getLayer("tapestry-fill"))){if(W)try{H.off("click","tapestry-fill",W)}catch{}W=C=>{const F=C&&C.features&&C.features[0];if(F&&J.value){const K=Mf(F.properties,{nameMap:V});if(!K){console.warn("[batch-select] clicked feature has no shapeName/iso3",F.properties);return}K.count==null&&console.warn("[batch-select] no UUPG count for territory",K.name,F.properties),re(K)}},H.on("click","tapestry-fill",W),q||(H.on("mouseenter","tapestry-fill",()=>{H&&(H.getCanvas().style.cursor=J.value?"crosshair":"")}),H.on("mouseleave","tapestry-fill",()=>{H&&(H.getCanvas().style.cursor="")}),q=!0)}}function G(){v.value=[],T.value="",B.value="",he.value="",A()}let fe=null;function Ce(C){if(fe=C,p&&typeof p.cacheSourceData=="function"){const F=gP({records:C,leafZones:ke,adm1Counts:hs,iso3Names:gn,countryNameMap:V,centroidFor:K=>{const oe=mt(K);return oe?[(oe[0][0]+oe[1][0])/2,(oe[0][1]+oe[1][1])/2]:null}});p.cacheSourceData(Yc,{normalizedData:F})}le=dP({records:C,leafZones:ke,adm1Counts:hs,iso3Names:gn,countryNameMap:V}),typeof window<"u"&&(window.__UPG_SEARCH__={size:()=>le.length,counts:()=>{const F={pg:0,zone:0,territory:0};for(const K of le)F[K.kind]=(F[K.kind]||0)+1;return F},query:F=>If(le,F,{limit:Df}).map(K=>({label:K.label,kind:K.kind,target:K.target})),select:F=>{const K=If(le,F,{limit:Df})[0];return K?(Me(K.target),{label:K.label,kind:K.kind,target:K.target}):null},feedSize:()=>{const F=p&&p.sources&&p.sources[Yc];return F&&Array.isArray(F.features)&&F.features.length||0},localGeocoder:F=>{const K=O.value&&O.value.geocoder,oe=K&&K.options&&K.options.localGeocoder;return oe?oe(F).map(Le=>Le&&Le.place_name):null}},n=window.__UPG_SEARCH__,(window.__UPG_SEARCHES__||(window.__UPG_SEARCHES__={}))[s()]=window.__UPG_SEARCH__)}function et(C){const F=C&&C.properties||{},K=F.__upgKind;if(K==="zone")Fe(F.__zoneId);else if(K==="territory")nt(F.__shapeName);else{const oe=C&&C.geometry,Le=oe&&Array.isArray(oe.coordinates)?oe.coordinates:null;Le&&Number.isFinite(Le[0])&&Number.isFinite(Le[1])&&H&&H.flyTo({center:[Le[0],Le[1]],zoom:6,duration:800}),Ne(F.slug)}}function dt(C){if(!C||!H)return;const F=new Set(C.memberIds||[]);if(!F.size)return;let K=[];try{K=H.querySourceFeatures("upg").filter(ot=>{const we=ot.properties||{};return F.has(we.slug)||F.has(we.id)||F.has(we.peopleGroupId)})}catch{return}if(!K.length)return;let oe=180,Le=90,je=-180,pt=-90,Ze=!1;for(const ot of K){const we=ot.geometry&&ot.geometry.coordinates;!Array.isArray(we)||!Number.isFinite(we[0])||!Number.isFinite(we[1])||(we[0]je&&(je=we[0]),we[1]pt&&(pt=we[1]),Ze=!0)}Ze&&H.fitBounds([[oe,Le],[je,pt]],{padding:60,duration:800,maxZoom:6})}function _t(){Io(null),_&&typeof _.selectPeopleGroup=="function"&&_.selectPeopleGroup(null)}function Me(C){!C||!H||(C.type==="pg"?(Number.isFinite(C.lng)&&Number.isFinite(C.lat)&&H.flyTo({center:[C.lng,C.lat],zoom:6,duration:800}),Ne(C.slug)):C.type==="zone"?Fe(C.zoneId):C.type==="territory"&&nt(C.shapeName))}function Ne(C){if(!C||!_||typeof _.selectPeopleGroup!="function")return;const K=hP(H,"upg").find(oe=>oe.properties&&oe.properties.slug===C);K&&_.selectPeopleGroup(K)}function Fe(C){if(!C||!H||!be)return;const F=mt(K=>K.properties&&K.properties.zoneKey===C);F&&H.fitBounds(F,{padding:40,duration:800,maxZoom:6})}function nt(C){if(!C||!H||!be)return;const F=mt(K=>{const oe=K.properties||{};return oe.shapeName===C||oe.iso3===C});F&&H.fitBounds(F,{padding:40,duration:800,maxZoom:6})}function mt(C){let F=180,K=90,oe=-180,Le=-90,je=!1;const pt=Ze=>{if(typeof Ze[0]=="number"){const[ot,we]=Ze;otoe&&(oe=ot),weLe&&(Le=we),je=!0;return}for(const ot of Ze)pt(ot)};for(const Ze of be.features)C(Ze)&&pt(Ze.geometry.coordinates);return je?[[F,K],[oe,Le]]:null}function lo(C){const F=new Set,K=oe=>{oe.children&&oe.children.length?oe.children.forEach(K):F.add(oe.zoneKey??oe.id)};return K(C),F}let ja=null;function Un(C){if(![...lo(C)].length)return;const K=[],oe=Ze=>{Ze.children&&Ze.children.length?Ze.children.forEach(oe):K.push(Ze)};oe(C);const Le=v.value,je=new Set(Le.filter(Ze=>Ze.kind==="zone").map(Ze=>Ze.key));if(K.every(Ze=>je.has("zone:"+(Ze.zoneKey??Ze.id)))){const Ze=new Set(K.map(ot=>"zone:"+(ot.zoneKey??ot.id)));v.value=Le.filter(ot=>!Ze.has(ot.key))}else{const Ze=K.filter(ot=>!je.has("zone:"+(ot.zoneKey??ot.id))).map(ot=>({key:"zone:"+(ot.zoneKey??ot.id),name:ot.label||ot.id,count:Number(ot.count)||0,kind:"zone"}));v.value=[...Le,...Ze]}A(),T.value=""}function U(){const C=new Set;for(const F of v.value)F.kind==="zone"&&C.add(F.key.slice(5));return C}function te(){const C=new Map,F=K=>{const oe=lo(K);K.label&&C.set(K.label,oe),K.children&&K.children.length&&K.children.forEach(F)};for(const K of b.value)F(K);return C}function Re(){if(typeof document>"u")return;const C=document.querySelector("my-upg-100-list-map"),K=(C&&C.shadowRoot||document).querySelectorAll(".stl-row");if(!K.length)return;if(!J.value){K.forEach(pt=>pt.classList.remove("upg-batch-row"));return}const oe=U(),Le=te(),je=$.value;K.forEach(pt=>{const Ze=pt.querySelector(".stl-name"),ot=Ze?Ze.textContent.trim():"",we=ot&&Le.get(ot),it=!!(we&&we.size&&[...we].every(kt=>oe.has(kt)));pt.classList.toggle("upg-batch-row",it),pt.classList.toggle("dark",it&&je)})}let De=null;function Ye(){if(typeof document>"u"||De)return;const C=document.querySelector("my-upg-100-list-map"),K=(C&&C.shadowRoot||document).querySelector(".stl-rows");K&&(De=new MutationObserver(()=>{requestAnimationFrame(()=>Re())}),De.observe(K,{childList:!0,subtree:!0}))}po("onSemanticTreeSelect",Io),po("onLegendExport",At),po("legendExportCards",!0);async function At(C){const F=m.value;if(!F)return;const[K,oe]=String(C).split(":");if(!ye.value){ye.value=!0,Ie.value=K==="packet"?"packet":K==="cards"?"cards":"poster";try{if(K==="packet"){await jr(F,oe||"full");return}const Le=pe().find(je=>je.id===F)||{id:F};if(K==="cards"){const je=pe().find(pt=>pt.id===F);je&&await ze.printCardDeck(await Br(je));return}await ze.printPoster(Le)}finally{ye.value=!1,Ie.value=""}}}const ze=Vg({t:(C,F,K)=>typeof K=="number"?$e(C,F,K):$e(C,F),records:C=>So(C),lang:()=>Nt(),label:C=>(C==null?void 0:C.label)||(C==null?void 0:C.id)||"",assetsBase:()=>ma(a.value),iso3Names:()=>gn,sheet:(C,F)=>Wn(C,F),sets:()=>fetch(`${ma(a.value)}/tables/near-neighbors.json`).then(C=>C.ok?C.json():null).catch(()=>null),downloadPrefix:"doxa-upg-100"});let Ot="";gt(ze.exportState,C=>{if(!C){Ot&&h.value===Ot&&(h.value=""),Ot="";return}if(C.phase==="error"){Ot="",Ba($e("messages.packetFailed",{reason:C.message}),4e3);return}Ot=C.phase==="done"?"":`${C.message}…`,h.value=Ot});const Kt=ah({apiBase:()=>Ve,lang:()=>Nt(),profileConfig:a,evaluate:(C,F)=>Fa(C,F)});async function So(C){if(!Ve)throw ho("wall.hud.noApi","no people-groups service is configured");return Kt(C.selector)}const Wn=ch({allRecords:()=>Kt.all(),assetsBase:()=>ma(a.value),profileConfig:a});function Kn(C,F,K){C.value=F,setTimeout(()=>{C.value===F&&(C.value="")},K)}const Ba=(C,F)=>Kn(h,C,F);async function jr(C,F="full"){const K=pe().find(Le=>Le.id===C);if(!K)return;const oe=await Br(K);await ze.printPacket(oe,{variant:F,funnel:await Pe()})}async function Br(C){try{const[{zoneTitle:F},{countryName:K},oe]=await Promise.all([wt(()=>Promise.resolve().then(()=>vv),void 0),wt(()=>Promise.resolve().then(()=>ac),void 0),Xi(ma(a.value))]),Le={...oe.en||{},...oe[Nt()]||{}},je=F(C,Le,{countryName:K,locale:Nt()});return je?{...C,label:je}:C}catch{return C}}function ie(){return Yl(Fn(a))}function ce(){const C=ie();return[...C.lists||[],...C.asia_lists||[],...C.uncovered_lists||[]]}function pe(){const C=ce(),F=new Set(C.map(K=>K.id));return[...C,...gv(ie(),{deafCount:zf}).filter(K=>!F.has(K.id))]}async function Pe(){var C;try{const F=(await wt(async()=>{const{default:je}=await Promise.resolve().then(()=>nm);return{default:je}},void 0)).default;if(!F||!Array.isArray(F.steps)||!F.steps.length)return null;const K=Fn(a),oe=Number(F.steps[F.steps.length-1].groups)||0;if(K===Cr)return{...F,listCount:pe().length,listTotal:oe};let Le=0;try{const je=ma(a.value),pt=await fetch(`${je}/people-groups/lists/${K}.json`);if(pt.ok){const Ze=await pt.json();Le=Number((C=Ze==null?void 0:Ze.counts)==null?void 0:C.doxa)||(Array.isArray(Ze==null?void 0:Ze.slugs)?Ze.slugs.length:0)}}catch{}return{...F,listTotal:Le,listId:K,listLabel:(Dg(K)||{}).label||K}}catch{return null}}const ye=me(!1),Ie=me("");function xe(){const C=v.value.filter(K=>K.kind==="zone").map(K=>String(K.key).replace(/^zone:/,"")),F=new Map(pe().map(K=>[K.id,K]));return C.map(K=>F.get(K)).filter(Boolean)}async function Ge(){const C=await Xi(ma(a.value));return{...C.en||{},...C[Nt()]||{}}}function tt(C,F){return C?String(C).replace(/\{(\w+)\}/g,(K,oe)=>F[oe]!=null?String(F[oe]):K):null}function Oe(){return v.value.filter(C=>C.kind==="adm0").map(C=>String(C.key).replace(/^adm0:/,"")).filter(Boolean)}function We(){return v.value.filter(C=>C.kind==="adm1").map(C=>C.name||String(C.key).replace(/^adm1:/,""))}let lt=null;function Rt(){const C=Nt();if(lt&<.lang===C)return lt.promise;if(!Ve)return Promise.reject(ho("wall.hud.noApi","no people-groups service is configured"));const F=oh,K=(async()=>{const oe=await fetch(`${Ve}/api/people-groups/list?fields=${F}&lang=${C}`,{cache:"no-store"});if(!oe.ok)throw ho("wall.hud.fetchFailed","could not load the people groups ({status})",{status:oe.status});return Vc(await Yi(qc(await oe.json()),a))})();return lt={lang:C,promise:K},K.catch(()=>{lt&<.promise===K&&(lt=null)}),K}async function Ct(){const C=xe(),F=Oe(),K=We();if(!C.length&&!F.length)throw K.length?ho("upgMap.selectionAdm1NoData","no people-group data for {names} — select the country instead",{names:Ki(K,{locale:Nt()})}):ho("upgMap.nothingSelected","nothing is selected");const oe=await Rt(),{evaluate:Le}=await wt(async()=>{const{evaluate:we}=await Promise.resolve().then(()=>rh);return{evaluate:we}},void 0),je=new Map(oe.map(we=>[we.slug,we])),pt=new Map(pe().map(we=>[we.id,we])),Ze=new Map,ot=(we,it)=>{const kt=Ze.get(we);kt?kt.includes(it)||kt.push(it):Ze.set(we,[it])};for(const we of v.value)if(we.kind==="zone"){const it=pt.get(String(we.key).replace(/^zone:/,""));if(!it)continue;const kt=it.selector&&it.selector.type==="pg_slugs"?it.selector.values||[]:Le(it.selector,oe);for(const Ro of kt)ot(Ro,we.name)}else if(we.kind==="adm0")for(const it of Le({type:"country_codes",values:[String(we.key).replace(/^adm0:/,"")]},oe))ot(it,we.name);return{records:[...Ze.keys()].map(we=>je.get(we)).filter(Boolean),from:Ze,missing:K}}async function Vt(){const C=xe(),{from:F}=await Ct(),K=(await Promise.all(C.map(Br))).map(ot=>ot.label||ot.id),oe=v.value.filter(ot=>ot.kind==="adm0").map(ot=>ot.name),Le=[...K,...oe],je=await Ge(),pt=(ot,we)=>tt(je.zone_join,{a:ot,b:we})??`${ot} + ${we}`;return{id:"selection",label:Le.length<=3?Le.reduce(pt):tt(je.zone_join_more,{a:Le.slice(0,2).reduce(pt),n:Le.length-2})??`${Le.slice(0,2).join(" + ")} +${Le.length-2} more`,count:F.size,selector:{type:"pg_slugs",values:[...F.keys()]}}}function vo(C){return C&&C.length?$e("upgMap.selectionAdm1NoData",{names:Ki(C,{locale:Nt()})}):""}function Fo(){const C=v.value;if(!C.length)return;const F=B.value;let K=null,oe="";const Le=Ct().then(je=>(K=je.records.length,oe=vo(je.missing),Ff(C,{color:F},Nf(je.records,je.from,{color:F}))),je=>(oe=un(je,$e),Ff(C,{color:F})));Le.then(je=>{try{window.__UPG_LAST_CLIPBOARD__=je}catch{}}),co(Le).then(je=>{const pt=K==null?$e("upgMap.copiedTerritoriesOnly",{reason:oe.slice(0,90)}):$e("upgMap.copiedSelection",{count:K})+(oe?" · "+oe.slice(0,90):"");Kn(T,je?pt:$e("messages.copyFailed"),je&&oe?6e3:3e3)})}async function co(C){const F=typeof navigator<"u"?navigator:null;if(F&&F.clipboard&&F.clipboard.write&&typeof ClipboardItem<"u")try{return await F.clipboard.write([new ClipboardItem({"text/plain":C.then(oe=>new Blob([oe],{type:"text/plain"}))})]),!0}catch{}const K=await C;try{if(F&&F.clipboard&&F.clipboard.writeText)return await F.clipboard.writeText(K),!0}catch{}return Eo(K)}function Eo(C){try{const F=document.createElement("textarea");F.value=C,F.style.position="fixed",F.style.opacity="0",F.style.top="0",document.body.appendChild(F),F.focus(),F.select();const K=document.execCommand&&document.execCommand("copy");return document.body.removeChild(F),!!K}catch{return!1}}async function to(){if(!ye.value){ye.value=!0,Ie.value="csv";try{const C=await Ct(),F=B.value,K=Nf(C.records,C.from,{color:F});try{window.__UPG_LAST_CSV__=K}catch{}const oe=URL.createObjectURL(new Blob(["\uFEFF"+K],{type:"text/csv;charset=utf-8"})),Le=document.createElement("a");Le.href=oe,Le.download=cP(v.value.map(pt=>pt.name).join(" ")),Le.style.display="none",document.body.appendChild(Le),Le.click(),setTimeout(()=>{try{URL.revokeObjectURL(oe),Le.remove()}catch{}},400);const je=vo(C.missing);Kn(T,$e("upgMap.csvSaved",{count:C.records.length})+(je?" · "+je.slice(0,90):""),je?6e3:3e3)}catch(C){Kn(T,$e("upgMap.csvFailed",{reason:un(C,$e).slice(0,90)}),5e3)}finally{ye.value=!1,Ie.value=""}}}async function Jt(){if(!ye.value){ye.value=!0,Ie.value="packet";try{const C=await Vt(),F=xe(),K=F.length===1?F[0].id:null,oe=await Pe();await ze.printPacket({...C,mapId:K},{funnel:oe&&F.length===1?oe:oe?{...oe,listCount:0}:null})}catch(C){Ba($e("messages.selectionPacketFailed",{reason:un(C,$e).slice(0,90)}),4e3)}finally{ye.value=!1,Ie.value=""}}}async function Gt(){if(!ye.value){ye.value=!0,Ie.value="cards";try{await ze.printCardDeck(await Vt())}catch(C){Ba($e("upgMap.selectionCardsFailed",{reason:un(C,$e).slice(0,90)}),4e3)}finally{ye.value=!1,Ie.value=""}}}async function Dt(){if(!ye.value){ye.value=!0,Ie.value="poster";try{const C=xe();if(!C.length)throw Oe().length||We().length?ho("upgMap.selectionPosterNeedsZone","posters exist per territory on the legend — use Prayer list for a map selection"):ho("upgMap.nothingSelected","nothing is selected");if(C.length>1){Ba($e("messages.posterOneTerritory",{count:C.length}),5e3);return}await ze.printPoster(C[0])}catch(C){Ba($e("messages.selectionPosterFailed",{reason:un(C,$e).slice(0,90)}),4e3)}finally{ye.value=!1,Ie.value=""}}}function Nt(){const C=Qe&&(Qe.value??Qe);return typeof C=="string"&&C||"en"}function Io(C){if(!H||!H.getLayer("tapestry-fill"))return!1;if(J.value)return C&&Un(C),!0;if(!C)return ja=null,m.value=null,H.setFilter("tapestry-fill",null),H.setFilter("tapestry-line",null),H.setPaintProperty("upg-pins","circle-opacity",1),!0;ja=C;const F=[...lo(C)];m.value=F.length===1?F[0]:C.id??null;const K=["in",["get","zoneKey"],["literal",F]];H.setFilter("tapestry-fill",K),H.setFilter("tapestry-line",K),H.getLayer("upg-pins")&&H.setPaintProperty("upg-pins","circle-opacity",["case",["in",["get","zoneKey"],["literal",F]],.95,.05]);const oe=mt(Le=>F.includes(Le.properties.zoneKey));return oe&&H.fitBounds(oe,{padding:40,duration:700,maxZoom:6}),!0}function Ha(){H&&(typeof Ae=="function"&&Ae(),be&&(x(),S(),D(),A(),m.value&&H.getLayer("tapestry-fill")&&Io(ja)))}function Vn(){H&&($.value=!$.value,g.theme.value=$.value?"dark":"light",H.setStyle($.value?Wc("ink",l).style||"mapbox://styles/mapbox/dark-v11":Wc("paper",l).style||"mapbox://styles/mapbox/light-v11"),H.once("style.load",Ha))}function Uo(){!H||!H.getLayer("upg-pins-hit")||(H.on("click","upg-pins-hit",C=>{const F=C&&C.features&&C.features[0];F&&_&&typeof _.selectPeopleGroup=="function"&&_.selectPeopleGroup(F)}),H.on("mouseenter","upg-pins-hit",()=>{H&&(H.getCanvas().style.cursor="pointer")}),H.on("mouseleave","upg-pins-hit",()=>{H&&(H.getCanvas().style.cursor="")}))}let ko=null,Mo,aa=null;function va(C,F){var K,oe,Le;try{const je=(Le=(oe=(K=f.value)==null?void 0:K.getRootNode)==null?void 0:oe.call(K))==null?void 0:Le.host;if(!je)return;je.setAttribute("data-doxa-select-zone-state",C),F&&je.setAttribute("data-doxa-select-zone-applied",String(F))}catch{}}function Ua(C){if(!C)return Io(null),Mo=void 0,va("cleared",""),!0;const F=Wa(b.value,C);return F?Io(F)?(Mo=void 0,va("applied",C),!0):(Mo=C,va("applied-but-no-selection",C),!1):(Mo=C,va("unresolved",C),!1)}function nu(C){var K;const F=((K=C==null?void 0:C.detail)==null?void 0:K.listId)??null;Ua(F)}function Wa(C,F){for(const K of C||[]){if((K.zoneKey||K.id)===F)return K;const oe=K.children&&Wa(K.children,F);if(oe)return oe}return null}const qn=ee(()=>{if(!m.value||J.value)return null;const C=Wa(b.value,m.value);return C&&C.label||String(m.value)});function ru(){Ua(null)}function Hr(){const C=ie(),F=ne(null);b.value=F,ke=Mr(F);const K={};for(const oe of C.lists||[])K[oe.id]=oe.selector;for(const oe of C.asia_lists||[])K[oe.id]=oe.selector;for(const oe of C.uncovered_lists||[])K[oe.id]=oe.selector;K.deaf=Er;for(const oe of ke)oe.selector=K[oe.id];Ee=_e(ke)}async function Ur(){if(Ve)try{const F=await fetch(`${Ve}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${Nt()}`,{cache:"no-store"});if(!F.ok)throw new Error(`list ${F.status}`);const K=Vc(await Yi(qc(await F.json()),a));V=Ef(K),b.value=ne(K)}catch{}}go(async()=>{var Le,je,pt,Ze,ot;Hr();try{await eP(l)}catch{}const C=Kc(l);C&&QS(C);const F=(o==null?void 0:o.value)||((Le=a==null?void 0:a.value)==null?void 0:Le.tk)||"";if(!C){console.warn(`[upg-100-list] ${l} engine global is missing — refusing to substitute another engine. A page that asked for the keyless engine must not silently receive the token-gated one.`),h.value=`⚠ ${$e("messages.engineNotLoaded")}`,y.value=$e("messages.engineNotLoadedDetail",{engine:c?"MapLibre":"Mapbox"}),Ur();return}if(!c){if(!F){h.value=`⚠ ${$e("messages.noMapboxToken")}`,y.value=$e("messages.noMapboxTokenDetail"),Ur();return}C.accessToken=F}try{const we=Lf(l);we&&await tP(f.value,we)}catch{}try{const we=!c&&f.value&&f.value.getRootNode();if(we instanceof ShadowRoot){const it=Lf("mapbox");if(it&&!we.querySelector(`link[href="${it}"]`)){const kt=document.createElement("link");kt.rel="stylesheet",kt.href=it,we.prepend(kt)}}}catch{}H=new C.Map({container:f.value,style:Wc("paper",l).style||"mapbox://styles/mapbox/light-v11",center:[35,20],zoom:1.5,projection:"mercator"}),w.value=H,He=ZS(((je=f.value)==null?void 0:je.parentElement)||null,{enabled:d.value}),typeof window<"u"&&(window.__UPG_MAP__=H,r=H,(window.__UPG_MAPS__||(window.__UPG_MAPS__={}))[s()]=H),window.__UPG_SELECT__={get list(){return v.value.map(we=>({...we}))},get total(){return P.value},get count(){return L.value},get color(){return B.value},get batchMode(){return J.value},setColor:we=>k(we),setBatchMode:we=>N(we),clipboardText:()=>Rf(v.value,{color:B.value}),clear:()=>G(),toggleByProps:we=>{const it=Mf(we,{nameMap:V});return it?(re(it),{...it}):null},toggleLegendRow:we=>{const it=Ro=>{for(const yt of Ro){if(yt.label===we||yt.id===we)return yt;if(yt.children&&yt.children.length){const oo=it(yt.children);if(oo)return oo}}return null},kt=it(b.value);return kt?(Un(kt),{label:kt.label,zoneKeys:[...lo(kt)]}):null},markedLegendRows:()=>{if(typeof document>"u")return[];const we=document.querySelector("my-upg-100-list-map");return[...(we&&we.shadowRoot||document).querySelectorAll(".stl-row.upg-batch-row .stl-name")].map(kt=>kt.textContent.trim())},highlightFeatureCount:()=>{if(!H||!be||!H.getLayer("upg-sel-fill"))return-1;const we=new Set,it=new Set,kt=new Set;for(const yt of v.value)yt.kind==="zone"?we.add(yt.key.slice(5)):yt.kind==="adm1"?it.add(yt.name):yt.kind==="adm0"&&kt.add(yt.key.slice(5));let Ro=0;for(const yt of be.features){const oo=yt.properties||{};(we.has(oo.zoneKey)||it.has(oo.shapeName)||kt.has(oo.iso3))&&Ro++}return Ro},zoneKeysForRow:we=>{const it=Ro=>{for(const yt of Ro){if(yt.label===we||yt.id===we)return yt;if(yt.children&&yt.children.length){const oo=it(yt.children);if(oo)return oo}}return null},kt=it(b.value);return kt?[...lo(kt)]:null}},i=window.__UPG_SELECT__,(window.__UPG_SELECTS__||(window.__UPG_SELECTS__={}))[s()]=window.__UPG_SELECT__;try{h.value=$e("messages.loadingBoundaries");const we=ct=>`${ma(a.value)}/boundaries/${ct}`,it=ct=>fetch(we(ct)).then(ao=>{if(!ao.ok)throw new Error(`boundary fetch ${ao.status} ${ct}`);return ao.json()});if(!Ve)throw new Error("No API base configured — set window.MAP_APP_API_URL or VITE_API_BASE_URL. Failing closed (no default host).");const Ro=fetch(`${Ve}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${Nt()}`).then(ct=>{if(!ct.ok)throw new Error(`list ${ct.status}`);return ct.json()}),yt={adm0:it("world-adm0-web.geojson"),adm1Chn:it("gb-CHN-ADM1.geojson"),adm1Ind:it("gb-IND-ADM1-web.geojson")};h.value=$e("messages.fetchingUupgs",{n:2106});const oo=Vc(await Yi(qc(await Ro),a));V=Ef(oo),b.value=ne(oo);const Ka=[],mn={},{evaluate:iu}=await wt(async()=>{const{evaluate:ct}=await Promise.resolve().then(()=>rh);return{evaluate:ct}},void 0);for(const ct of ke)if(ct.selector&&ct.selector.type==="pg_slugs")for(const ao of ct.selector.values||[])ao in mn||(mn[ao]=ct.zoneKey);else try{for(const ao of iu(ct.selector,oo))ao in mn||(mn[ao]=ct.zoneKey)}catch(ao){console.warn("zone selector skipped",ct.id,ao&&ao.message)}for(const ct of oo){const ao=Number(ct.latitude),cu=Number(ct.longitude);!isFinite(ao)||!isFinite(cu)||Ka.push({type:"Feature",geometry:{type:"Point",coordinates:[cu,ao]},properties:{slug:ct.slug,zoneKey:mn[ct.slug]||"",name:ct.name||ct.slug||"",population:ct.population??0,countryName:ct.country_code_label||"",country:ct.country_code||""}})}const ks=Ya({type:"FeatureCollection",features:Ka});Ae=()=>{H.getSource("upg")&&H.getLayer("upg-pins")&&H.getLayer("upg-pins-hit")||(H.getSource("upg")||H.addSource("upg",{type:"geojson",data:ks}),H.getLayer("upg-pins")||H.addLayer({id:"upg-pins",type:"circle",source:"upg",paint:{"circle-radius":["interpolate",["linear"],["zoom"],0,2.6,2,3.2,4,4.5,6,6.5,8,9],"circle-color":Ee,"circle-opacity":1,"circle-stroke-width":["interpolate",["linear"],["zoom"],0,.9,4,1.4,8,2],"circle-stroke-color":"rgba(15,20,25,0.9)"}}),H.getLayer("upg-pins-hit")||H.addLayer({id:"upg-pins-hit",type:"circle",source:"upg",paint:{"circle-radius":["interpolate",["linear"],["zoom"],1,5,4,6.5,8,9],"circle-stroke-width":["interpolate",["linear"],["zoom"],1,1.8,8,2],"circle-opacity":0,"circle-stroke-opacity":0}}),Uo())};const ws=()=>{try{Ha()}catch(ct){console.warn("early pin paint skipped",ct&&ct.message)}};H.isStyleLoaded()?ws():H.once("style.load",ws),h.value=$e("messages.loadingBoundaries");const[su,iA]=await Promise.all([yt.adm0,yt.adm1Chn]),sA=await yt.adm1Ind,{tapestry:lA,perZone:cA}=_v(ke,{records:oo,adm0:su,adm1Ind:sA,adm1Chn:iA});be=Ya(lA),Ce(oo);let lu=!0;const Yn=()=>{lu&&(lu=!1,H.off("style.load",Yn),H.off("idle",Yn),Ha())};if(H.isStyleLoaded())Yn();else{H.once("style.load",Yn),H.once("idle",Yn);const ct=setInterval(()=>{if(!lu||!H){clearInterval(ct);return}let ao=!1;try{ao=H.isStyleLoaded()}catch{clearInterval(ct);return}ao&&(clearInterval(ct),Yn())},120);setTimeout(()=>clearInterval(ct),15e3)}const dm=[...cA.entries()].filter(([ct])=>ct!=="deaf"),uA=dm.filter(([,ct])=>ct>=1).length;h.value=$e("messages.mapStatusCounts",{polys:be.features.length,zones:uA,total:dm.length,pins:Ka.length})}catch(we){console.warn("[upg-100-list] map data failed:",we),h.value="⚠ "+$e("upgMap.mapDataFailed")}let K=0;const oe=()=>{const we=typeof document<"u"&&document.querySelector("my-upg-100-list-map"),it=we&&we.shadowRoot||(typeof document<"u"?document:null);if(it&&it.querySelector(".stl-rows")){Ye(),Re();return}K++<40&&setTimeout(oe,250)};oe();{const we=(ot=(Ze=(pt=f.value)==null?void 0:pt.getRootNode)==null?void 0:Ze.call(pt))==null?void 0:ot.host;if(we){ko=nu,we.addEventListener("doxa:select-zone",ko);const it=we.getAttribute("select-zone");it&&Ua(it),aa=new MutationObserver(()=>{Ua(we.getAttribute("select-zone")||null)}),aa.observe(we,{attributes:!0,attributeFilter:["select-zone"]})}}});const Ke=()=>{var C,F,K;try{return((K=(F=(C=f.value)==null?void 0:C.getRootNode)==null?void 0:F.call(C))==null?void 0:K.host)||null}catch{return null}};return gt([b,w],()=>{no(()=>{var F;const C=((F=Ke())==null?void 0:F.getAttribute("select-zone"))||Mo||null;C&&Ua(C)})}),Yt(()=>{var C,F,K;if(aa==null||aa.disconnect(),aa=null,ko){const oe=(K=(F=(C=f.value)==null?void 0:C.getRootNode)==null?void 0:F.call(C))==null?void 0:K.host;oe==null||oe.removeEventListener("doxa:select-zone",ko),ko=null}if(De){try{De.disconnect()}catch{}De=null}if(He){try{He()}catch{}He=null}if(H&&(H.remove(),H=null),be=null,typeof window<"u"){const oe=s();try{window.__UPG_SEARCHES__&&delete window.__UPG_SEARCHES__[oe],window.__UPG_MAPS__&&delete window.__UPG_MAPS__[oe],window.__UPG_SELECTS__&&delete window.__UPG_SELECTS__[oe],window.__UPG_SEARCH__===n&&delete window.__UPG_SEARCH__,window.__UPG_MAP__===r&&delete window.__UPG_MAP__,window.__UPG_SELECT__===i&&delete window.__UPG_SELECT__,delete window.__UPG_LAST_CLIPBOARD__,delete window.__UPG_LAST_CSV__}catch{}}}),(C,F)=>{var K;return Y(),ae("div",fP,[R("div",{ref_key:"mapEl",ref:f,class:"upg-map"},null,512),y.value?(Y(),ae("div",mP,[R("strong",null,de(se($e)("messages.mapUnavailable")),1),Ut(de(y.value),1)])):Se("",!0),d.value?(Y(),ae(Je,{key:1},[F[1]||(F[1]=R("div",{class:"map-scroll-edge map-scroll-edge--left"},null,-1)),F[2]||(F[2]=R("div",{class:"map-scroll-edge map-scroll-edge--right"},null,-1))],64)):Se("",!0),w.value&&u.value?(Y(),St(US,{key:2,ref_key:"geocoderRef",ref:O,"map-instance":w.value,"access-token":se(o)||((K=se(a))==null?void 0:K.tk)||"","data-source-id":Yc,"is-dark":$.value,placeholder:ve.value,"active-context":DP,onPeopleGroupResult:et,onAggregateResult:dt,onClear:_t},null,8,["map-instance","access-token","is-dark","placeholder"])):Se("",!0),w.value?(Y(),St(bS,{key:3,"has-geocoder":u.value},{default:wo(()=>[$t(_S,{map:w.value,"is-dark":$.value},null,8,["map","is-dark"]),$t(yS,{map:w.value,"is-dark":$.value},null,8,["map","is-dark"]),$t(vS,{map:w.value,"is-dark":$.value},null,8,["map","is-dark"]),$t(xS,{"map-container":f.value,"is-dark":$.value},null,8,["map-container","is-dark"]),$t(PS,{"is-dark":$.value,onToggle:Vn},null,8,["is-dark"]),$t(Ga,{"is-dark":$.value,active:J.value,class:Ue({"upg-batch-on":J.value}),"aria-pressed":J.value?"true":"false",title:ue.value,onClick:E},{default:wo(()=>[...F[3]||(F[3]=[R("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[R("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),R("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),R("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),R("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})],-1)])]),_:1},8,["is-dark","active","class","aria-pressed","title"])]),_:1},8,["has-geocoder"])):Se("",!0),R("div",bP,[b.value.length?(Y(),St(vh,{key:0,nodes:b.value,tabs:X.value,"default-tab":Of,columns:["count","pop"],title:ge.value,"export-enabled":!0,"export-cards":!0,onSelect:Io,onExport:At},null,8,["nodes","tabs","title"])):Se("",!0)]),R("div",$P,[b.value.length?(Y(),St(mS,{key:0,"legend-type":"upg-100",nodes:b.value,tabs:X.value,"default-tab":Of,columns:["count","pop"],"column-label":"UPG 100",title:ge.value,"is-dark":$.value,"popup-action":"pray"},null,8,["nodes","tabs","title","is-dark"])):Se("",!0)]),R("div",_P,[se(_)&&se(_).selectedPeopleGroup?(Y(),ae("div",{key:0,class:Ue(["upg-detail-panel pg-detail-root",{dark:$.value}])},[$t(se(t),{peopleGroup:se(_).selectedPeopleGroup,dark:$.value,action:"pray"},null,8,["peopleGroup","dark"])],2)):Se("",!0)]),qn.value?(Y(),ae("button",{key:4,type:"button",class:"upg-shown","aria-label":se($e)("buttons.clearSelection")+": "+qn.value,title:se($e)("buttons.clearSelection"),onClick:ru},[R("span",vP,de(qn.value),1),F[4]||(F[4]=R("span",{class:"upg-shown-x","aria-hidden":"true"},"×",-1))],8,yP)):Se("",!0),J.value?(Y(),ae("div",kP,[R("div",wP,de(se($e)("messages.tapTerritoriesHint")),1),L.value?(Y(),ae("div",xP,[R("span",null,de(se($e)("messages.territoriesSelected",{count:L.value}))+" ·",1),R("span",SP,de(P.value)+" UUPG",1),R("span",{class:Ue(["upg-hud-band",{ok:P.value>=50&&P.value<=100}])},de(P.value>=50&&P.value<=100?se($e)("messages.bandInRange"):se($e)("messages.bandOutOfRange")),3)])):Se("",!0),L.value?(Y(),ae("div",PP,de(se(Ki)(v.value.map(oe=>oe.name),{locale:Nt()})),1)):Se("",!0),L.value?(Y(),ae("div",{key:2,class:"upg-hud-swatches",role:"group","aria-label":se($e)("upgMap.selectionColourGroup")},[(Y(),ae(Je,null,Ht(Q,oe=>R("button",{key:oe,type:"button",class:Ue(["upg-swatch",{active:B.value===oe}]),"aria-pressed":B.value===oe?"true":"false","data-color":oe,style:xt({background:oe}),title:se($e)("upgMap.selectionColour",{hex:oe}),"aria-label":se($e)("upgMap.selectionColour",{hex:oe}),onClick:Le=>k(oe)},null,14,LP)),64)),pi(R("input",{"onUpdate:modelValue":F[0]||(F[0]=oe=>he.value=oe),class:"upg-hex",placeholder:"#hex",spellcheck:"false","aria-label":se($e)("upgMap.customColour"),onChange:z,onKeyup:ul(z,["enter"])},null,40,CP),[[Db,he.value]])],8,AP)):Se("",!0),L.value?(Y(),ae("div",TP,[R("button",{class:Ue(["upg-hud-btn make",{"is-busy":Ie.value==="packet"}]),disabled:ye.value,onClick:Jt},de(Ie.value==="packet"?se($e)("buttons.working"):se($e)("buttons.prayerList")),11,EP),R("button",{class:Ue(["upg-hud-btn make",{"is-busy":Ie.value==="poster"}]),disabled:ye.value,onClick:Dt},de(Ie.value==="poster"?se($e)("buttons.working"):se($e)("buttons.posterMap")),11,MP),R("button",{class:Ue(["upg-hud-btn make",{"is-busy":Ie.value==="cards"}]),disabled:ye.value,onClick:Gt},de(Ie.value==="cards"?se($e)("buttons.working"):se($e)("buttons.cardDeck")),11,RP)])):Se("",!0),L.value?(Y(),ae("div",NP,[R("button",{class:"upg-hud-btn copy",onClick:Fo},de(se($e)("upgMap.copySelection")),1),R("button",{class:Ue(["upg-hud-btn csv",{"is-busy":Ie.value==="csv"}]),disabled:ye.value,onClick:to},de(Ie.value==="csv"?se($e)("buttons.working"):se($e)("upgMap.exportCsv")),11,FP),R("button",{class:"upg-hud-btn clear",onClick:G},de(se($e)("buttons.clearSelection")),1)])):Se("",!0),L.value?(Y(),ae("div",IP,de(T.value),1)):Se("",!0)])):Se("",!0),R("div",OP,de(h.value),1)])}}}},Symbol.toStringTag,{value:"Module"})),GP=`
diff --git a/public/dx-maps/my-upg-100-list/poster-wall/index.html b/public/dx-maps/my-upg-100-list/poster-wall/index.html
index da047e536..0bd859e65 100644
--- a/public/dx-maps/my-upg-100-list/poster-wall/index.html
+++ b/public/dx-maps/my-upg-100-list/poster-wall/index.html
@@ -67,7 +67,7 @@
-
+
-
+
-
+