From 77c7b16fefa3c9bad594bd1dd201edb63ab5b567 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Mon, 28 Sep 2026 10:00:19 +0000 Subject: [PATCH] UPG-100: the HUD band follows the reading direction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .upg-hud-band used margin-left:auto to push itself to the trailing end of the flex row .upg-hud-head. That end is the LEFT in Arabic, so the band sat on the wrong side. margin-inline-start:auto, the same class as the legend and table conversions. No consumer overrides .upg-hud-band, so nothing can defeat it. Found by a localization audit of this bundle (upg-100-mfe + poster-wall + upg-100-list). The rest of the audit came back clean, and both scans were NEGATIVE-TESTED before their zeros were believed: - hardcoded English in templates: a planted sentence IS found, so the zeros in poster-wall.vue and upg-100-mfe.vue mean something. The only template hits in upg-100-list.vue were `{{ LEGEND_TITLE }}` (a translated computed, a false positive of the regex) and one real one, below. - script-side user-visible English: none. - key coverage: 23 keys used, 0 missing across all 11 locales. A planted nonexistent key reports missing in 11/11 and a real key resolves in 11/11, so the checker is neither blind nor vacuous. ONE FINDING IS NOT MINE TO FIX: upg-100-list.vue:2786 has a literal title="Batch Select" where its siblings at :2811 and :2833 use a translated :title. The fix needs a new key, and the catalogues live in library/i18n/locales/ — the build owner's under rule 5B. Sent to dx-shepherd rather than landed here. --- plugin-designs/my-upg-100-list/upg-100-list.vue | 4 +++- public/dx-maps/doxa-maps-spa/manifest.json | 8 ++++---- public/dx-maps/manifest.json | 8 ++++---- public/dx-maps/my-upg-100-list/my-upg-100-list.js | 2 +- public/dx-maps/my-upg-100-list/poster-wall/index.html | 2 +- public/dx-maps/my-upg-100-list/upg-100-list/index.html | 2 +- public/dx-maps/my-upg-100-list/upg-100-mfe/index.html | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/plugin-designs/my-upg-100-list/upg-100-list.vue b/plugin-designs/my-upg-100-list/upg-100-list.vue index 84f4b91a8..375b05b6e 100644 --- a/plugin-designs/my-upg-100-list/upg-100-list.vue +++ b/plugin-designs/my-upg-100-list/upg-100-list.vue @@ -488,7 +488,9 @@ useShadowStyles( '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-left:auto;font-size:9px;color:#9aa7b8}' + + // margin-inline-start, not margin-left: this pushes the band to the TRAILING end of the flex row + // .upg-hud-head, which is the left in Arabic. Same class as the legend/table conversions. + '.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}' + diff --git a/public/dx-maps/doxa-maps-spa/manifest.json b/public/dx-maps/doxa-maps-spa/manifest.json index 2d1e4fabb..abdb1a57d 100644 --- a/public/dx-maps/doxa-maps-spa/manifest.json +++ b/public/dx-maps/doxa-maps-spa/manifest.json @@ -838,7 +838,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-hIwlmueKHRTbrEmSYf3G8nJZiZVy0CGrHsEhFLbilwWkvmybniV1XsAeSsU+ZRjP", + "integrity": "sha384-tusNBwOjwY9ZN/pdfWKr5h4t3YGqYJIWobk9FBkj87pnGhrUjaeB3tXqYMziaPNc", "elements": [ "my-upg-100-list-map" ], @@ -861,7 +861,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n" + "script": "\n\n" } }, { @@ -877,7 +877,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n" + "script": "\n\n\n\n" } }, { @@ -893,7 +893,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n" + "script": "\n\n\n\n" } } ] diff --git a/public/dx-maps/manifest.json b/public/dx-maps/manifest.json index 2d1e4fabb..abdb1a57d 100644 --- a/public/dx-maps/manifest.json +++ b/public/dx-maps/manifest.json @@ -838,7 +838,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-hIwlmueKHRTbrEmSYf3G8nJZiZVy0CGrHsEhFLbilwWkvmybniV1XsAeSsU+ZRjP", + "integrity": "sha384-tusNBwOjwY9ZN/pdfWKr5h4t3YGqYJIWobk9FBkj87pnGhrUjaeB3tXqYMziaPNc", "elements": [ "my-upg-100-list-map" ], @@ -861,7 +861,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n" + "script": "\n\n" } }, { @@ -877,7 +877,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n" + "script": "\n\n\n\n" } }, { @@ -893,7 +893,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n" + "script": "\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 f5a25fa4a..8fd69ffd2 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 @@ -814,7 +814,7 @@ `,"map-control-button"),(t,o)=>(q(),ae("button",{class:Ge(["mcb",{dark:e.isDark,active:e.active,"mcb--square":e.shape==="square"}]),title:e.title,"aria-label":e.title||void 0,disabled:e.disabled,onClick:o[0]||(o[0]=n=>t.$emit("click"))},[Tn(t.$slots,"default")],10,Lx))}},Cx={__name:"ZoomInButton",props:{map:{type:Object,default:null},isDark:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){const{t}=St(),o=e;function n(){var a;o.disabled||(a=o.map)==null||a.zoomIn()}return(a,r)=>(q(),dt($n,{"is-dark":e.isDark,disabled:e.disabled,title:me(t)("buttons.zoomIn"),onClick:n},{default:Jt(()=>[...r[0]||(r[0]=[R("span",{style:{"font-size":"20px","line-height":"1","font-weight":"600"}},"+",-1)])]),_:1},8,["is-dark","disabled","title"]))}},Tx={__name:"ZoomOutButton",props:{map:{type:Object,default:null},isDark:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){const{t}=St(),o=e;function n(){var a;o.disabled||(a=o.map)==null||a.zoomOut()}return(a,r)=>(q(),dt($n,{"is-dark":e.isDark,disabled:e.disabled,title:me(t)("buttons.zoomOut"),onClick:n},{default:Jt(()=>[...r[0]||(r[0]=[R("span",{style:{"font-size":"22px","line-height":"1","font-weight":"600"}},"−",-1)])]),_:1},8,["is-dark","disabled","title"]))}},Ex={__name:"LocationButton",props:{map:{type:Object,default:null},isDark:{type:Boolean,default:!1},center:{type:Array,default:()=>[20,10]},zoom:{type:Number,default:1.8},userZoom:{type:Number,default:10}},setup(e){const{t}=St(),o=e;function n(){var r;(r=o.map)==null||r.flyTo({center:o.center,zoom:o.zoom,duration:1200})}function a(){if(o.map){if(typeof navigator>"u"||!navigator.geolocation){n();return}navigator.geolocation.getCurrentPosition(r=>{const{longitude:s,latitude:i}=r.coords;Number.isFinite(s)&&Number.isFinite(i)?o.map.flyTo({center:[s,i],zoom:o.userZoom,duration:1500}):n()},()=>n(),{enableHighAccuracy:!1,timeout:5e3,maximumAge:6e4})}}return(r,s)=>(q(),dt($n,{"is-dark":e.isDark,title:me(t)("buttons.resetView"),onClick:a},{default:Jt(()=>[...s[0]||(s[0]=[R("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor"},[R("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z"})],-1)])]),_:1},8,["is-dark","title"]))}},Rx={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 29 29",fill:"currentColor"},Nx={key:1,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 29 29",fill:"currentColor"},Mx={__name:"FullscreenButton",props:{mapContainer:{type:Object,default:null},isDark:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const{t:o}=St(),n=e,a=t,r=be(!1);let s=null,i=null,l=null,u=null,c=null,p=null,d=null,A=null,x=null,h=null,g=null,m=0,f=0,b=null,$=null;function y(){if(typeof document>"u")return!1;const I=typeof navigator<"u"&&navigator.userAgent||"";return/iPad|iPhone|iPod/.test(I)||I.includes("Mac")&&typeof document<"u"&&"ontouchend"in document?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled)}function T(){var I,M,W;return((W=(M=(I=n.mapContainer)==null?void 0:I.getRootNode)==null?void 0:M.call(I))==null?void 0:W.host)??null}function P(){var M,W;const I=(W=(M=n.mapContainer)==null?void 0:M.getRootNode)==null?void 0:W.call(M);return document.fullscreenElement||document.webkitFullscreenElement||(I&&I instanceof ShadowRoot?I.fullscreenElement:null)||null}function E(I){const M=I.requestFullscreen||I.webkitRequestFullscreen;if(!M)return Promise.reject(new Error("Fullscreen API unavailable"));const W=M.call(I);return W&&typeof W.then=="function"?W:Promise.resolve()}function v(){const I=document.exitFullscreen||document.webkitExitFullscreen;if(!I)return Promise.reject(new Error("Fullscreen API unavailable"));const M=I.call(document);return M&&typeof M.then=="function"?M:Promise.resolve()}function j(){const I=T();if(!I)return!1;if(l=I,i=I.style.cssText,I.style.position="fixed",I.style.top="0",I.style.left="0",I.style.right="0",I.style.bottom="0",I.style.width="100vw",I.style.height="100vh",I.style.height="100dvh",I.style.zIndex="2147483647",I.style.margin="0",I.style.borderRadius="0",I.style.touchAction="pan-x pan-y pinch-zoom",typeof document<"u"){m=window.scrollY||window.pageYOffset||0,f=window.scrollX||window.pageXOffset||0;const M=document.body,W=document.documentElement;u=M?M.style.overflow:null,c=W?W.style.overflow:null,p=M?M.style.position:null,d=M?M.style.top:null,A=M?M.style.left:null,x=M?M.style.width:null,h=M?M.style.touchAction:null,g=W?W.style.touchAction:null,W&&(W.style.overflow="hidden",W.style.touchAction="none"),M&&(M.style.overflow="hidden",M.style.position="fixed",M.style.top=`-${m}px`,M.style.left=`-${f}px`,M.style.width="100%",M.style.touchAction="none"),b=L=>{if(!l)return;const D=L.target;D&&(D===l||l.contains&&l.contains(D))||L.cancelable&&L.preventDefault()},$=L=>{if(!l)return;const D=L.target;D&&(D===l||l.contains&&l.contains(D))||L.cancelable&&L.preventDefault()},document.addEventListener("touchmove",b,{passive:!1,capture:!0}),document.addEventListener("wheel",$,{passive:!1,capture:!0})}return!0}function re(){if(l){if(l.style.cssText=i||"",l=null,i=null,typeof document<"u"){const I=document.body,M=document.documentElement;I&&(I.style.overflow=u??"",I.style.position=p??"",I.style.top=d??"",I.style.left=A??"",I.style.width=x??"",I.style.touchAction=h??""),M&&(M.style.overflow=c??"",M.style.touchAction=g??""),b&&(document.removeEventListener("touchmove",b,{capture:!0}),b=null),$&&(document.removeEventListener("wheel",$,{capture:!0}),$=null),typeof window<"u"&&(m||f)&&window.scrollTo(f,m)}u=null,c=null,p=null,d=null,A=null,x=null,h=null,g=null,m=0,f=0}}function Z(){typeof window>"u"||window.requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))})}function G(){if(!y()){r.value?(re(),r.value=!1,a("change",!1)):j()&&(r.value=!0,a("change",!0)),Z();return}if(P())v().then(()=>{r.value=!1,a("change",!1)}).catch(()=>{});else{const M=T()??document.documentElement;E(M).then(()=>{r.value=!0,a("change",!0)}).catch(()=>{E(document.documentElement).then(()=>{r.value=!0,a("change",!0)}).catch(()=>{})})}}function pe(){r.value=!!P(),a("change",r.value)}return so(()=>{var M,W;document.addEventListener("fullscreenchange",pe),document.addEventListener("webkitfullscreenchange",pe);const I=(W=(M=n.mapContainer)==null?void 0:M.getRootNode)==null?void 0:W.call(M);I instanceof ShadowRoot&&(s=I,I.addEventListener("fullscreenchange",pe),I.addEventListener("webkitfullscreenchange",pe))}),Zt(()=>{document.removeEventListener("fullscreenchange",pe),document.removeEventListener("webkitfullscreenchange",pe),s&&(s.removeEventListener("fullscreenchange",pe),s.removeEventListener("webkitfullscreenchange",pe),s=null),l&&re()}),(I,M)=>(q(),dt($n,{"is-dark":e.isDark,active:r.value,title:me(o)("buttons.toggleFullscreen"),onClick:G},{default:Jt(()=>[r.value?(q(),ae("svg",Nx,[...M[1]||(M[1]=[R("path",{d:"M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z"},null,-1)])])):(q(),ae("svg",Rx,[...M[0]||(M[0]=[R("path",{d:"M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z"},null,-1)])]))]),_:1},8,["is-dark","active","title"]))}},Ix={style:{"font-size":"16px","line-height":"1"}},Fx={__name:"ThemeToggleButton",props:{isDark:{type:Boolean,default:!1}},emits:["toggle"],setup(e){const{t}=St();return(o,n)=>me(Fv)?(q(),dt($n,{key:0,"is-dark":e.isDark,title:e.isDark?me(t)("buttons.switchToLightMode"):me(t)("buttons.switchToDarkMode"),onClick:n[0]||(n[0]=a=>o.$emit("toggle"))},{default:Jt(()=>[R("span",Ix,de(e.isDark?"☀️":"🌙"),1)]),_:1},8,["is-dark","title"])):ve("",!0)}},Go={mapboxGlJs:{url:"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js",integrity:"sha384-tO0clamXONKwbiz7O6xJpUeyJbTSPugC+xM9clvfFvKTH3i8SmCawHGdf5quMWmZ"},mapboxGlCss:{url:"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.css",integrity:"sha384-rp1X/jJ9MpWPef9OimfXhOaOc4Gzs87yQvF+ajwY6X2H4PTeHNycNlLWiWvj7ehV"},maplibreGlJs:{url:"https://cdn.jsdelivr.net/npm/maplibre-gl@5.24.0/dist/maplibre-gl.js",integrity:"sha384-5+cfbwT0iiub6VsQAdn6yz16nr6sDiQoHx6tm4O8OVYXHYOxcffFmCJBL0dgdvGp"},maplibreGlCss:{url:"https://cdn.jsdelivr.net/npm/maplibre-gl@5.24.0/dist/maplibre-gl.css",integrity:"sha384-uTttxo/aOKbdE5RlD/SPzSDoDmNvGlUYPjONi2MN/b7c9HPSvW07OIuyP7uL6jxK"},mapboxGeocoderJs:{url:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.min.js",integrity:"sha384-Lx9WK8XhZk57czwxt6B6nyaDHB5Ayrcrsu4Fw4bCp/Ot/QLOsUZ0xYqLOpOOSXZw"},mapboxGeocoderCss:{url:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.css",integrity:"sha384-1KNhwJNCQTr0DCi/5/OnQcFytgycxTahxNZaqKbAtqmY8bUhu26qxXqvDGXXwplS"},maplibreGeocoderJs:{url:"https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-geocoder@1.9.4/dist/maplibre-gl-geocoder.min.js",integrity:"sha384-RGV5vfoJd7alk8HE+71IyVfu19ciH1FKA15+AuXs6OeBM2npXrmTPFqG23yMiHXi"},maplibreGeocoderCss:{url:"https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-geocoder@1.9.4/dist/maplibre-gl-geocoder.css",integrity:"sha384-UkDpPApjTpHJHpcJiSNAmbobh30W0/dmt0DoKm4V8CWYRYvQ/Jhd/ijFz0tFdVnH"},d3:{url:"https://cdn.jsdelivr.net/npm/d3@7.9.0/dist/d3.min.js",integrity:"sha384-CjloA8y00+1SDAUkjs099PVfnY2KmDC2BZnws9kh8D/lX1s46w6EPhpXdqMfjK6i"}};function Da(e,t){const o=Object.values(Go).find(n=>n.url===t);return o&&(e.integrity=o.integrity,e.crossOrigin="anonymous"),e}const Ox=["blocs","clusters","peopleGroups","families","languages","dialects","people","places","regions","wagfBlocks","religions"],Dx={"people-groups":["blocs","clusters","peopleGroups","people","places","families","languages","dialects","regions","religions"],language:["families","languages","dialects","people","blocs","clusters","peopleGroups","places","regions","religions"],regions:["regions","wagfBlocks","places","blocs","clusters","peopleGroups","people","families","languages","dialects","religions"],religion:["religions","people","blocs","clusters","peopleGroups","places","families","languages","dialects","regions"]};function Gx(e){return Dx[e]||Ox}const zx={blocs:3,clusters:3,peopleGroups:3,families:3,languages:3,dialects:3,people:5,places:2,regions:3,wagfBlocks:3,religions:2},os=["peopleGroups","people","places","languages","religions"],Bx={regions:[...os,"regions","wagfBlocks"],"people-groups":[...os,"blocs","clusters"],language:[...os,"dialects","families"],religion:[...os]},Ux=100,Hx=50,jx=25,Kx=10,gl=5,mg=20,Wx=[[/ sign language$/i,"Sign Language"]];function Vx(e){if(!e||typeof e!="string")return"";const t=e.indexOf(",");return t>0?e.slice(0,t).trim():e.trim()}function qx(e){if(!e||typeof e!="string")return null;const t=e.indexOf(",");return t>=0&&e.slice(t+1).trim()||null}function Yx(e){if(!e||typeof e!="string")return null;const t=e.split(",").map(n=>n.trim()).filter(Boolean);if(t.length>=2){const n=[...t].reverse().join(" ");if(Ot[n])return Ot[n];if(t.length>=3){const a=[t[1],t[0]].join(" ");if(Ot[a])return Ot[a]}}if(Ot[e])return Ot[e];const o=e.replace(/\s*\(.*?\)\s*$/,"").trim();if(o!==e&&Ot[o])return Ot[o];for(const[n,a]of Wx)if(n.test(e))return a;return null}function bg(e,t){return{id:`doxa-section-header-${hl(e)}`,place_name:e,text:e,center:[0,0],place_type:["doxa-section-header"],geometry:{type:"Point",coordinates:[0,0]},properties:{headerLabel:e,isHeader:!0,isAllDataSection:!!t},feature:null}}function hl(e){return String(e||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Fe(e){return e==null?"":typeof e=="string"?e.toLowerCase():typeof e=="object"&&"label"in e?String(e.label||"").toLowerCase():typeof e=="object"&&"value"in e?String(e.value||"").toLowerCase():String(e).toLowerCase()}function ns(e){return e==null?"":typeof e=="string"?e:typeof e=="object"?e.label||e.value||"":String(e)}function Jx(e){var o,n,a,r,s;if(!Array.isArray(e))return[];const t=[];for(const i of e){if(!i)continue;const l=Number(i.latitude),u=Number(i.longitude);if(!Number.isFinite(l)||!Number.isFinite(u))continue;const c=Fe(i.name)+" "+Fe(i.displayName)+" "+Fe(i.alternateName),p=Fe(i.countryName)+" "+Fe(i.country)+" "+Fe(i.countryIso)+" "+Fe(i.countryIsoLabel),d=Fe(i.religionName)+" "+Fe(i.religion)+" "+Fe(i.religionLabel)+" "+Fe(i.religionCode),A=Fe(i.language)+" "+Fe(i.languageFamily)+" "+Fe(i.languageCode),x=Fe(i.doxaRegion)+" "+Fe(i.wagfRegion)+" "+Fe(i.wagfBlock),h=Fe(i.affinityBlock)+" "+Fe(i.affinityBlockLabel)+" "+Fe((o=i._raw)==null?void 0:o.rop1),g=Fe(i.cluster)+" "+Fe(i.clusterLabel)+" "+Fe((n=i._raw)==null?void 0:n.imb_reg_of_people_2),m=Fe(i.peopleGroup)+" "+Fe(i.peopleGroupLabel)+" "+Fe((a=i._raw)==null?void 0:a.imb_reg_of_people_25),f=((r=i._raw)==null?void 0:r.primary_language)??((s=i._raw)==null?void 0:s.PrimaryLanguage),b=f&&(typeof f=="object"?f.label||f.value:f)||ns(i.language)||ns(i.primaryLanguage)||"",$=Vx(b),y=qx(b);t.push({feature:i,nameHay:c,countryHay:p,religionHay:d,languageHay:A,regionHay:x,haystack:c+" "+p+" "+d+" "+A+" "+x+" "+h+" "+g+" "+m,blocHay:h,clusterHay:g,pgHay:m,lat:l,lng:u,familyDerived:Yx(b)||null,languageLabel:b,baseLang:$,dialectLabel:y})}return t}function Zx(e){const t=(o,n,a)=>{const r=new Map;for(const s of e){const i=o(s);if(!i)continue;const l=r.get(i);if(l)l.count+=1,l.lngSum+=s.lng,l.latSum+=s.lat,l.memberIds.push(String(s.feature.uniqueId??s.feature.id??s.feature.slug??"")),l.minLng=Math.min(l.minLng,s.lng),l.maxLng=Math.max(l.maxLng,s.lng),l.minLat=Math.min(l.minLat,s.lat),l.maxLat=Math.max(l.maxLat,s.lat),a&&a(l,s,!1);else{const u={key:i,label:ns(n(s))||i,count:1,lngSum:s.lng,latSum:s.lat,minLng:s.lng,maxLng:s.lng,minLat:s.lat,maxLat:s.lat,memberIds:[String(s.feature.uniqueId??s.feature.id??s.feature.slug??"")]};a&&a(u,s,!0),r.set(i,u)}}for(const s of r.values())s.lng=s.lngSum/s.count,s.lat=s.latSum/s.count;return Array.from(r.values())};return{countries:t(o=>Fe(o.feature.countryName)||Fe(o.feature.country)||Fe(o.feature.countryIso),o=>o.feature.countryName||o.feature.country||o.feature.countryIso||""),families:t(o=>Fe(o.familyDerived),o=>o.familyDerived||""),languages:t(o=>Fe(o.baseLang),o=>o.baseLang||""),dialects:t(o=>o.dialectLabel?`${Fe(o.baseLang)}__${Fe(o.dialectLabel)}`:"",o=>`${o.baseLang}, ${o.dialectLabel}`,(o,n,a)=>{a?(o.originalLabels=new Set([n.languageLabel]),o.familyDerived=n.familyDerived||"",o.baseLang=n.baseLang||"",o.dialectLabel=n.dialectLabel||""):(o.originalLabels.add(n.languageLabel),!o.familyDerived&&n.familyDerived&&(o.familyDerived=n.familyDerived))}),religions:t(o=>{var n,a,r;return Ma(o.feature.religion||((a=(n=o.feature._raw)==null?void 0:n.religion)==null?void 0:a.value)||((r=o.feature._raw)==null?void 0:r.religion)||"")},o=>{var n,a,r;return al(Ma(o.feature.religion||((a=(n=o.feature._raw)==null?void 0:n.religion)==null?void 0:a.value)||((r=o.feature._raw)==null?void 0:r.religion)||""))||"Unknown"}),regions:t(o=>Fe(o.feature.doxaRegion)||Fe(o.feature.wagfRegion),o=>{var n,a;return o.feature.wagfRegionLabel||o.feature.doxaRegionLabel||((a=(n=o.feature._raw)==null?void 0:n.wagf_region)==null?void 0:a.label)||o.feature.doxaRegion||o.feature.wagfRegion||""}),wagfBlocks:t(o=>Fe(o.feature.wagfBlock),o=>{var n,a;return o.feature.wagfBlockLabel||((a=(n=o.feature._raw)==null?void 0:n.wagf_block)==null?void 0:a.label)||o.feature.wagfBlock||""}),blocs:t(o=>Fe(o.feature.affinityBlockLabel)||Fe(o.feature.affinityBlock),o=>o.feature.affinityBlockLabel||o.feature.affinityBlock||"",(o,n,a)=>{a&&(o.blocCode=n.feature.affinityBlock||"")}),clusters:t(o=>{const n=o.feature.affinityBlock||"",a=o.feature.cluster||"";return a?`${n}__${a}`:""},o=>o.feature.clusterLabel||o.feature.cluster||"",(o,n,a)=>{a&&(o.blocCode=n.feature.affinityBlock||"",o.blocLabel=n.feature.affinityBlockLabel||"",o.clusterCode=n.feature.cluster||"")}),peopleGroups:t(o=>Fe(o.feature.peopleGroup)||Fe(o.feature.peopleGroupLabel),o=>o.feature.peopleGroupLabel||o.feature.peopleGroup||o.feature.name||"",(o,n,a)=>{a&&(o.blocCode=n.feature.affinityBlock||"",o.blocLabel=n.feature.affinityBlockLabel||"",o.clusterCode=n.feature.cluster||"",o.clusterLabel=n.feature.clusterLabel||"",o.peopleGroupCode=n.feature.peopleGroup||"")})}}function Xx(e){const t=e.feature,o=t.name||t.displayName||t.slug||"Unknown",n=t.countryName||t.country||t.countryIso||"",a=t.religionName||t.religion||"",r=t.slug||t.uniqueId||hl(o+"-"+n),s=[e.lng,e.lat],i=[n,a].filter(Boolean).join(" — "),l=i?`${o}, ${i}`:o;return{id:`doxa-pg-${r}`,place_name:l,text:o,center:s,place_type:["people-group"],geometry:{type:"Point",coordinates:s},properties:{slug:r,...t},feature:t}}function wo(e,t){let o,n;switch(e){case"country":o="doxa-country",n="doxa-country-";break;case"region":o="doxa-region",n="doxa-region-";break;case"language-family":o="doxa-language-family",n="doxa-language-family-";break;case"language":o="doxa-language",n="doxa-language-";break;case"dialect":o="doxa-dialect",n="doxa-dialect-";break;case"religion":o="doxa-religion",n="doxa-religion-";break;case"affinity-bloc":o="doxa-affinity-bloc",n="doxa-affinity-bloc-";break;case"cluster":o="doxa-cluster",n="doxa-cluster-";break;case"people-group":o="doxa-people-group",n="doxa-people-group-";break;default:o="doxa",n="doxa-"}const a=ns(t.label)||t.key,r=hl(t.key),s=[t.lng,t.lat],l={"affinity-bloc":"Affinity Block",cluster:"Cluster","people-group":"PG","pg-in-country":"PGIC"}[e],u=l?`${a} (${l}) · ${t.count}`:`${a} (${t.count})`,c=t.originalLabels?Array.from(t.originalLabels):void 0,p=e==="dialect"?{familyDerived:t.familyDerived||"",baseLang:t.baseLang||"",dialectLabel:t.dialectLabel||""}:null;return{id:`${n}${r}`,place_name:u,text:a,center:s,bbox:[t.minLng,t.minLat,t.maxLng,t.maxLat],place_type:[o],geometry:{type:"Point",coordinates:s},properties:{slug:r,doxaAggregate:e,count:t.count,label:a,memberIds:t.memberIds,bounds:[t.minLng,t.minLat,t.maxLng,t.maxLat],...c?{originalLabels:c}:{},...p||{},...e==="affinity-bloc"?{blocCode:t.blocCode||""}:{},...e==="cluster"?{blocCode:t.blocCode||"",blocLabel:t.blocLabel||"",clusterCode:t.clusterCode||""}:{},...e==="people-group"?{blocCode:t.blocCode||"",blocLabel:t.blocLabel||"",clusterCode:t.clusterCode||"",clusterLabel:t.clusterLabel||"",peopleGroupCode:t.peopleGroupCode||""}:{}},feature:null}}function Qx(e={}){const{dataStore:t,dataSourceId:o,getActiveFilter:n,getActiveContext:a}=e,{t:r}=St(),s=Q(()=>{var p,d;if(!t||!t.sources)return[];if(o&&((p=t.sources[o])!=null&&p.features))return t.sources[o].features;for(const A of Object.keys(t.sources)){const x=t.sources[A];if((d=x==null?void 0:x.features)!=null&&d.length)return x.features}return[]}),i=Q(()=>Jx(s.value)),l=Q(()=>Zx(i.value));function u(p){const d=String(p||"").trim().toLowerCase(),A={people:[],places:[],regions:[],wagfBlocks:[],families:[],languages:[],dialects:[],religions:[],blocs:[],clusters:[],peopleGroups:[]};if(d.length<2)return A;const x=d.split(/[\s,;]+/).filter(Boolean);if(!x.length)return A;const h=i.value;if(!h.length)return A;const g=l.value,m=[];for(const M of h){let W=!0;for(const D of x)if(!M.haystack.includes(D)){W=!1;break}if(!W)continue;let L=0;x.some(D=>M.nameHay.includes(D))&&(L+=Ux),x.some(D=>M.countryHay.includes(D))&&(L+=Hx),x.some(D=>M.religionHay.includes(D))&&(L+=jx),x.some(D=>M.languageHay.includes(D))&&(L+=Kx),m.push({entry:M,score:L})}m.sort((M,W)=>W.score-M.score);const f=m.slice(0,gl).map(M=>Xx(M.entry)),b=M=>M.filter(W=>x.every(L=>W.key.includes(L)||Fe(W.label).includes(L))).sort((W,L)=>L.count-W.count).slice(0,gl),$=b(g.countries).map(M=>wo("country",M)),y=b(g.regions).map(M=>wo("region",M)),T=b(g.wagfBlocks).map(M=>wo("region",M)),P=b(g.families).map(M=>wo("language-family",M)),E=b(g.languages).map(M=>wo("language",M)),v=b(g.dialects).map(M=>wo("dialect",M)),j=b(g.religions).map(M=>wo("religion",M)),re=b(g.blocs).map(M=>wo("affinity-bloc",M));let Z=b(g.clusters).map(M=>wo("cluster",M)),G=b(g.peopleGroups).map(M=>wo("people-group",M));const pe=new Set(re.map(M=>Fe(M.text)));Z=Z.filter(M=>!pe.has(Fe(M.text)));const I=new Set(Z.map(M=>Fe(M.text)));return G=G.filter(M=>!pe.has(Fe(M.text))&&!I.has(Fe(M.text))),{people:f,places:$,regions:y,wagfBlocks:T,families:P,languages:E,dialects:v,religions:j,blocs:re,clusters:Z,peopleGroups:G}}function c(p){const d=typeof n=="function"?n():null,A=typeof a=="function"?a():null,x=u(p),h=Gx(A),g=Bx[A],m=g?Object.fromEntries(g.filter(P=>x[P]).map(P=>[P,x[P]])):x,f=h.flatMap(P=>m[P]||[]);if(!(d!=null&&d.key)||!f.length)return f.slice(0,mg);const b=[];for(const P of x.people){const E=i.value.find(j=>j.feature===P.feature);let v=!1;E&&(d.kind==="family"?v=(E.familyDerived||"").toLowerCase()===d.key.toLowerCase():d.kind==="language"&&(v=E.languageLabel.toLowerCase()===d.key.toLowerCase())),v&&b.push(P)}const $=[],y=d.key;b.length&&($.push(bg(r("search.sections.within",{selection:y}),!1)),$.push(...b.slice(0,gl)));const T=h.flatMap(P=>(m[P]||[]).slice(0,zx[P]??3)).map(P=>({...P,properties:{...P.properties,_allDataSection:!0}}));return $.push(bg(r("search.sections.allData"),!0)),$.push(...T),$.slice(0,mg+8)}return{search:c,searchGrouped:u,index:i,aggregates:l}}const eS={__name:"GeocoderComponent",props:{mapInstance:{type:Object,required:!1,default:null},accessToken:{type:String,required:!0},provider:{type:String,default:"mapbox"},isDark:{type:Boolean,default:!1},standalone:{type:Boolean,default:!1},placeholder:{type:String,default:""},dataSourceId:{type:String,default:""},activeContext:{type:String,default:""}},emits:["result","people-group-result","aggregate-result","clear","error"],setup(e,{expose:t,emit:o}){function n(L){return L+L.replace(/mapboxgl/g,"maplibregl")}Tt(n('.mapboxgl-ctrl-geocoder--input,.mapboxgl-ctrl-geocoder input[type="text"],.mapboxgl-ctrl-geocoder input[type="search"]{font-size:16px !important;line-height:1.3;}'),"geocoder-ios-zoom-fix"),Tt(n(".mapboxgl-ctrl-geocoder--icon-loading{display:none !important;}"),"geocoder-hide-loading"),Tt(n(".mapboxgl-ctrl-geocoder{height:35px!important;min-height:35px!important;box-sizing:border-box!important;}.mapboxgl-ctrl-geocoder--input{height:35px!important;min-height:35px!important;box-sizing:border-box!important;padding-top:0!important;padding-bottom:0!important;line-height:35px!important;}.mapboxgl-ctrl-geocoder--icon-search{top:50%!important;transform:translateY(-50%)!important;margin-top:0!important;left:7px!important;}"),"geocoder-height-35"),Tt(n(".mapboxgl-ctrl-geocoder{width:100%!important;max-width:100%!important;min-width:0!important;}@media(max-width:767px){.dg-search-band{top:0!important;left:0!important;right:0!important;width:100%!important;max-width:none!important;margin:0!important;box-sizing:border-box!important;padding:9px 14px!important;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,0.10);}.dg-search-band--dark{background:#3b463d;box-shadow:0 1px 4px rgba(0,0,0,0.35);}.dg-search-band .mapboxgl-ctrl,.dg-search-band .maplibregl-ctrl{margin:0!important;float:none!important;}}.mapboxgl-ctrl-geocoder{border-radius:999px!important;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,0.15)!important;transition:box-shadow .12s,border-color .12s;}.mapboxgl-ctrl-geocoder:focus-within{box-shadow:0 2px 8px rgba(0,0,0,0.15),0 0 0 3px rgba(59,70,61,0.18)!important;}.mapboxgl-ctrl-geocoder--input{border-radius:999px!important;font-size:13px!important;}.mapboxgl-ctrl-geocoder--input::placeholder{font-size:12px!important;}.mapboxgl-ctrl-geocoder--button{display:none!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important;margin:0!important;padding:0!important;width:24px!important;height:24px!important;background:transparent!important;border:none!important;box-shadow:none!important;}.mapboxgl-ctrl-geocoder:has(.mapboxgl-ctrl-geocoder--input:not(:placeholder-shown)) .mapboxgl-ctrl-geocoder--button{display:block!important;}.mapboxgl-ctrl-geocoder--button .mapboxgl-ctrl-geocoder--icon-close{position:absolute!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;margin:0!important;width:16px!important;height:16px!important;}.mapboxgl-ctrl-geocoder--suggestions,.mapboxgl-ctrl-geocoder .suggestions{z-index:1200!important;position:absolute;max-height:60vh!important;overflow-y:auto!important;}.geocoder-dark.mapboxgl-ctrl-geocoder,.dsm-dark .mapboxgl-ctrl-geocoder{background:#4e594f!important;border:1px solid rgba(255,255,255,0.14)!important;box-shadow:0 2px 8px rgba(0,0,0,0.4)!important;}.geocoder-dark.mapboxgl-ctrl-geocoder:focus-within,.dsm-dark .mapboxgl-ctrl-geocoder:focus-within{box-shadow:0 2px 8px rgba(0,0,0,0.4),0 0 0 3px rgba(115,161,127,0.22)!important;}.geocoder-dark .mapboxgl-ctrl-geocoder--input,.dsm-dark .mapboxgl-ctrl-geocoder--input{color:#F3F3F1!important;background:transparent!important;}.geocoder-dark .mapboxgl-ctrl-geocoder--input::placeholder,.dsm-dark .mapboxgl-ctrl-geocoder--input::placeholder{color:rgba(243,243,241,0.65)!important;}.geocoder-dark .mapboxgl-ctrl-geocoder--icon,.dsm-dark .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon{fill:rgba(243,243,241,0.75)!important;}.geocoder-dark .mapboxgl-ctrl-geocoder--button,.dsm-dark .mapboxgl-ctrl-geocoder--button{background:transparent!important;}"),"geocoder-skin");const{t:a,locale:r}=St(),s=e,i=Q(()=>/^pk\./.test(String(s.accessToken||""))),l=Q(()=>s.placeholder||(s.provider==="maplibre"&&!i.value?a("search.placeholderNoPlaces"):a("search.placeholder"))),u=o,c={"&":"&","<":"<",">":">",'"':""","'":"'"};function p(L){return String(L??"").replace(/[&<>"']/g,D=>c[D])}function d(L){return L==null?"":typeof L=="string"?L:typeof L=="object"?L.label||L.value||"":String(L)}const A={"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 x(L){const D=A[L];if(!D)return"";const K=a("search.kinds."+D);return`${p(K)}`}function h(L){var ne;if(!L)return"";const D=L.place_type||[];if(D.includes("doxa-section-header"))return`
${p(((ne=L.properties)==null?void 0:ne.headerLabel)||L.text||"")}
`;if(D.includes("people-group")){const ce=L.properties||{},xe=d(ce.name)||d(ce.displayName)||d(L.text)||"",$e=d(ce.countryName)||d(ce.country)||d(ce.countryIso)||"",Be=d(ce.language)||d(ce.primaryLanguage)||d(ce.languageFamily)||"",ue=d(ce.religionName)||d(ce.religion)||"",he=a("search.labels.place"),le=a("search.labels.language"),Se=a("search.labels.religion"),V=[];return $e&&V.push(`${p(he)} ${p($e)}`),Be&&V.push(`${p(le)} ${p(Be)}`),ue&&V.push(`${p(Se)} ${p(ue)}`),`
${x("people-group")}${p(xe)}
`+(V.length?`
${V.join("")}
`:"")}const K=D.find(ce=>ce.startsWith("doxa-"));if(K){const ce=L.properties||{},xe=p(d(ce.label)||L.text||""),$e=Number(ce.count)||0,Be=$e?` ${$e}`:"";return`
${x(K)}${xe}${Be}
`}return`
${p(L.place_name||L.text||"")}
`}const g=He("dataStore",null),m=He("mapStore",null),f=He("uiStore",null);function b(){return m?m.selectedFamily?{kind:"family",key:m.selectedFamily}:m.selectedLanguage?{kind:"language",key:m.selectedLanguage}:null:null}const{search:$}=Qx({dataStore:g,dataSourceId:s.dataSourceId||void 0,getActiveFilter:b,getActiveContext:()=>s.activeContext||null}),y=xn(null),T=be(null),P={mapbox:Go.mapboxGeocoderCss.url,maplibre:Go.maplibreGeocoderCss.url},E=Go.maplibreGeocoderJs.url,v=Go.mapboxGeocoderJs.url;function j(L,D){const K=P[D]||P.mapbox;if(L.querySelector(`link[href="${K}"]`))return;const ne=document.createElement("link");ne.rel="stylesheet",ne.href=K,Da(ne,K),L.prepend(ne)}async function re(L,D){if(typeof window<"u"&&window[D]||typeof document>"u")return;const K=document.querySelector(`script[src="${L}"]`);if(K){if(window[D])return;await new Promise(ne=>{K.addEventListener("load",ne,{once:!0}),K.addEventListener("error",ne,{once:!0})});return}await new Promise(ne=>{const ce=document.createElement("script");ce.src=L,Da(ce,L),ce.async=!0,ce.addEventListener("load",ne,{once:!0}),ce.addEventListener("error",ne,{once:!0}),document.head.appendChild(ce)})}function Z(L=document){let D=L.activeElement;for(;D&&D.shadowRoot&&D.shadowRoot.activeElement;)D=D.shadowRoot.activeElement;return D}function G(L){const D=L==null?void 0:L._onKeyDown;typeof D=="function"&&(L._onKeyDown=function(K){const ne=Z();return!ne||ne===K.target||typeof ne.value!="string"?D.call(L,K):D.call(L,new Proxy(K,{get(ce,xe){if(xe==="target"||xe==="srcElement")return ne;const $e=Reflect.get(ce,xe);return typeof $e=="function"?$e.bind(ce):$e}}))})}async function pe(){await re(v,"MapboxGeocoder")}async function I(){if(typeof window<"u"&&window.MaplibreGeocoder||typeof document>"u")return;const L=document.querySelector(`script[src="${E}"]`);if(L){if(window.MaplibreGeocoder)return;await new Promise(D=>{L.addEventListener("load",D,{once:!0}),L.addEventListener("error",D,{once:!0})});return}await new Promise((D,K)=>{const ne=document.createElement("script");ne.src=E,ne.async=!1,ne.addEventListener("load",D,{once:!0}),ne.addEventListener("error",()=>K(new Error("[GeocoderComponent] Failed to load MapLibre geocoder")),{once:!0}),document.head.appendChild(ne)})}function M(L,D){return async K=>{const ne={features:[]};if(!/^pk\./.test(String(L||""))||!(K!=null&&K.query))return ne;try{const ce=Array.isArray(K.language)?K.language[0]:K.language||D()||"en",xe=new URLSearchParams({access_token:L,autocomplete:"true",limit:String(K.limit||5)});ce&&xe.set("language",ce);const $e=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(K.query)}.json?${xe.toString()}`,Be=await fetch($e);if(!Be.ok)return ne;const ue=await Be.json();return ue&&Array.isArray(ue.features)?ue:ne}catch{return ne}}}so(async()=>{var ce,xe,$e,Be,ue;const L=s.provider==="maplibre";if(L){if(await I(),typeof MaplibreGeocoder>"u"){console.error("[GeocoderComponent] MaplibreGeocoder global unavailable.");return}}else if(typeof MapboxGeocoder>"u"&&(await pe(),typeof MapboxGeocoder>"u")){console.error("[GeocoderComponent] MapboxGeocoder global unavailable.");return}const D=s.mapInstance;if(!s.standalone&&!D)return;const K=s.standalone?(xe=(ce=T.value)==null?void 0:ce.getRootNode)==null?void 0:xe.call(ce):(ue=(Be=($e=D.getContainer)==null?void 0:$e.call(D))==null?void 0:Be.getRootNode)==null?void 0:ue.call(Be);K instanceof ShadowRoot&&j(K,s.provider);const ne={marker:!1,flyTo:!s.standalone,trackProximity:!s.standalone,placeholder:l.value,language:r.value||"en",localGeocoder:$,limit:20,zoom:6,render:h};if(L){const he=typeof maplibregl<"u"?maplibregl:void 0,le={forwardGeocode:M(s.accessToken,()=>r.value)};y.value=new MaplibreGeocoder(le,{...ne,maplibregl:he,showResultsWhileTyping:!0,reverseGeocode:!1})}else y.value=new MapboxGeocoder({accessToken:s.accessToken,mapboxgl,...ne});if(G(y.value),y.value.on("result",he=>{var Se,V,ye,_,S,C,H,oe,ie,se,ge,w,k,B,z,X,ee,O,J,we,Ee,qe,ft,ot,vt,eo,Ae,Je,to,F;const le=he==null?void 0:he.result;le&&((Se=le.place_type)!=null&&Se.includes("doxa-section-header")||(m&&(m.selectedRegion=null,m.selectedResource=null,m.selectedAffinityBlock=null,m.selectedDialect=null),f&&((V=f.setPrayerFilter)==null||V.call(f,null),(ye=f.setEngagementFilter)==null||ye.call(f,null),(_=f.setAdoptionFilter)==null||_.call(f,null),(S=f.setReligionFilter)==null||S.call(f,null)),(C=le.properties)!=null&&C._allDataSection&&m&&(m.selectedFamily=null,m.selectedLanguage=null),u("result",he),(H=le.place_type)!=null&&H.includes("people-group")&&le.feature?u("people-group-result",{type:"Feature",properties:le.properties||le.feature,geometry:le.geometry||{type:"Point",coordinates:le.center}}):((oe=le.place_type)!=null&&oe.includes("doxa-country")||(ie=le.place_type)!=null&&ie.includes("doxa-region")||(se=le.place_type)!=null&&se.includes("doxa-language-family")||(ge=le.place_type)!=null&&ge.includes("doxa-language")||(w=le.place_type)!=null&&w.includes("doxa-dialect")||(k=le.place_type)!=null&&k.includes("doxa-religion")||(B=le.place_type)!=null&&B.includes("doxa-affinity-bloc")||(z=le.place_type)!=null&&z.includes("doxa-cluster")||(X=le.place_type)!=null&&X.includes("doxa-people-group"))&&u("aggregate-result",{kind:le.place_type[0].replace(/^doxa-/,""),label:((ee=le.properties)==null?void 0:ee.label)||le.text,count:((O=le.properties)==null?void 0:O.count)||0,memberIds:((J=le.properties)==null?void 0:J.memberIds)||[],bounds:((we=le.properties)==null?void 0:we.bounds)||null,center:le.center,originalLabels:((Ee=le.properties)==null?void 0:Ee.originalLabels)||null,familyDerived:((qe=le.properties)==null?void 0:qe.familyDerived)||"",baseLang:((ft=le.properties)==null?void 0:ft.baseLang)||"",dialectLabel:((ot=le.properties)==null?void 0:ot.dialectLabel)||"",slug:((vt=le.properties)==null?void 0:vt.slug)||null,id:le.id||null,blocCode:((eo=le.properties)==null?void 0:eo.blocCode)||"",blocLabel:((Ae=le.properties)==null?void 0:Ae.blocLabel)||"",clusterCode:((Je=le.properties)==null?void 0:Je.clusterCode)||"",clusterLabel:((to=le.properties)==null?void 0:to.clusterLabel)||"",peopleGroupCode:((F=le.properties)==null?void 0:F.peopleGroupCode)||"",properties:le.properties||null})))}),y.value.on("clear",()=>u("clear")),y.value.on("error",he=>u("error",he)),s.standalone){if(T.value){const he={on(){},off(){},fire(){},getContainer:()=>T.value,getZoom:()=>0,getCenter:()=>({lng:0,lat:0}),getBounds:()=>null,flyTo(){},fitBounds(){},addControl(){},removeControl(){},hasControl:()=>!1};try{const le=y.value.onAdd(s.mapInstance||he);le&&T.value.appendChild(le)}catch(le){u("error",le)}}}else D.addControl(y.value,"top-left"),W()});function W(){var D,K;const L=(K=(D=y.value)==null?void 0:D.container)==null?void 0:K.parentElement;L&&(L.classList.add("dg-search-band"),L.classList.toggle("dg-search-band--dark",!!s.isDark))}return nt(()=>s.isDark,()=>W()),nt(l,L=>{var ne,ce;const D=y.value;if(!D)return;const K=D._inputEl||((ce=(ne=D.container)==null?void 0:ne.querySelector)==null?void 0:ce.call(ne,"input.mapboxgl-ctrl-geocoder--input"));K&&(K.placeholder=L,K.setAttribute("placeholder",L)),D.options&&(D.options.placeholder=L)}),nt(r,L=>{const D=y.value;D!=null&&D.options&&(D.options.language=L||"en")}),Zt(()=>{var L,D;if(y.value){try{s.standalone?(D=(L=y.value).onRemove)==null||D.call(L):s.mapInstance&&s.mapInstance.removeControl(y.value)}catch{}y.value=null}}),t({geocoder:y}),(L,D)=>e.standalone?(q(),ae("div",{key:0,ref_key:"standaloneContainer",ref:T,class:"dg-standalone-geocoder"},null,512)):Tn(L.$slots,"default",{},void 0,void 0,1)}},tS=["mapbox","maplibre"],oS="auto";function yg(e){return e&&typeof e=="object"&&"value"in e&&!("provider"in e)&&!("profile"in e)?e.value:e}function $g(e){const t=o=>typeof o=="string"&&!!o.trim()&&!/^YOUR_/.test(o.trim());return t(e==null?void 0:e.tk)||/^https?:\/\//i.test(String((e==null?void 0:e.tokenUrl)||""))?!0:typeof window>"u"?!1:t(window.MAP_TOKEN)||t(window.__doxaMapToken)||!!window.__doxaMapTokenPending}function nS(e,{token:t}={}){const o=yg(e);return aS(o)||($g(o)||$g({tk:t})?"mapbox":"maplibre")}function aS(e){const t=yg(e),o=t==null?void 0:t.provider,n=typeof location<"u"?new URLSearchParams(location.search).get("provider"):void 0,a=typeof window<"u"?window.MAP_PROVIDER:void 0,r=String(o||n||a||oS).toLowerCase().trim();return tS.includes(r)?r:""}const rS="rgba(120, 128, 134, 0.28)",_g="36px",vg=()=>{};function sS(e,t={}){const{enabled:o=!0}=t;if(!o||!e)return vg;const n=Array.from(e.querySelectorAll(".map-scroll-edge"));if(!n.length)return vg;const a=f=>f.classList.contains("map-scroll-edge--left");for(const f of n)f.style.background=`linear-gradient(${a(f)?"to right":"to left"}, ${rS} ${_g}, transparent ${_g})`,f.style.opacity="0",f.style.transition="opacity 0.16s ease",f.style.userSelect="none",f.style.webkitUserSelect="none";const r=f=>{f.style.opacity="1"},s=f=>{f.style.opacity="0"},i=()=>n.find(f=>!a(f))||null,l=new Set;let u=!1,c=null;const p=()=>{for(const f of n)l.has(f)||s(f)},d=()=>{const f=i();f&&(r(f),c&&clearTimeout(c),c=setTimeout(p,250))},A=()=>d(),x=f=>{if(!(f.touches&&f.touches.length===1))return;const b=f.target;b&&b.classList&&b.classList.contains("map-scroll-edge")||d()},h=()=>{c&&clearTimeout(c),p()};e.addEventListener("wheel",A,{passive:!0}),e.addEventListener("touchmove",x,{passive:!0}),e.addEventListener("touchend",h,{passive:!0}),e.addEventListener("touchcancel",h,{passive:!0});const g=()=>{u||d()};typeof window<"u"&&window.addEventListener("scroll",g,{passive:!0});const m=[];for(const f of n){const b=()=>{l.add(f),r(f)},$=()=>{l.delete(f),s(f)},y=()=>{u=!0,r(f)},T=()=>{u=!1,s(f)};f.addEventListener("mouseenter",b),f.addEventListener("mouseleave",$),f.addEventListener("touchstart",y,{passive:!0}),f.addEventListener("touchend",T,{passive:!0}),m.push(()=>{f.removeEventListener("mouseenter",b),f.removeEventListener("mouseleave",$),f.removeEventListener("touchstart",y),f.removeEventListener("touchend",T)})}return function(){c&&(clearTimeout(c),c=null),e.removeEventListener("wheel",A),e.removeEventListener("touchmove",x),e.removeEventListener("touchend",h),e.removeEventListener("touchcancel",h),typeof window<"u"&&window.removeEventListener("scroll",g);for(const b of m)b();for(const b of n)s(b)}}const iS=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 fl(e,t="mapbox"){if(typeof e!="string"||!e)return{style:void 0,lightPreset:void 0,paint:void 0};const o=iS[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 wg={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 lS(e){return!!e&&typeof window<"u"&&e===window.maplibregl}function cS(e){if(typeof window>"u")return!1;const t=e?[e]:[window.maplibregl,window.mapboxgl].filter(Boolean);let o=!1;for(const n of t)if(!(!n||!n.setRTLTextPlugin))try{if(lS(n)){if(n.getRTLTextPluginStatus&&n.getRTLTextPluginStatus()!=="unavailable")continue;const a=n.setRTLTextPlugin(wg.maplibre,!0);a&&a.catch&&a.catch(()=>{})}else n.setRTLTextPlugin(wg.mapbox,null,!0);o=!0}catch{}return o}const Vn={mapbox:{global:"mapboxgl",js:Go.mapboxGlJs.url,css:Go.mapboxGlCss.url},maplibre:{global:"maplibregl",js:Go.maplibreGlJs.url,css:Go.maplibreGlCss.url}};function ml(e){var o;const t=((o=Vn[e])==null?void 0:o.global)||Vn.mapbox.global;return typeof window<"u"?window[t]:void 0}function kg(e){return(Vn[e]||Vn.mapbox).css||null}async function uS(e){const t=Vn[e]||Vn.mapbox;if(ml(e)||typeof document>"u")return;if(!document.querySelector(`link[href="${t.css}"]`)){const n=document.createElement("link");n.rel="stylesheet",n.href=t.css,Da(n,t.css),document.head.appendChild(n)}const o=document.querySelector(`script[src="${t.js}"]`);if(o){if(ml(e))return;await new Promise(n=>{o.addEventListener("load",n,{once:!0}),o.addEventListener("error",n,{once:!0})});return}await new Promise((n,a)=>{const r=document.createElement("script");r.src=t.js,Da(r,t.js),r.async=!1,r.addEventListener("load",n,{once:!0}),r.addEventListener("error",()=>a(new Error(`[useMapInstance] Failed to load ${e} engine script`)),{once:!0}),document.head.appendChild(r)})}async function dS(e,t){if(!e)return;const o=e.getRootNode();if(!(o instanceof ShadowRoot))return;const n=s=>new Promise(i=>setTimeout(i,s)),a=o.querySelector(`link[href="${t}"]`);if(a){if(a.sheet)return;await Promise.race([new Promise(s=>{a.addEventListener("load",s,{once:!0}),a.addEventListener("error",s,{once:!0})}),n(2e3)]);return}const r=document.createElement("link");r.rel="stylesheet",r.href=t,Da(r,t),await Promise.race([new Promise(s=>{r.addEventListener("load",s,{once:!0}),r.addEventListener("error",s,{once:!0}),o.prepend(r)}),n(2e3)])}function pS(e,t){return`hsl(${Math.round(e*360/(t||1))}, 72%, 56%)`}function as(e){if(typeof e.count=="number")return e.count;if(typeof e.expected_count=="number")return e.expected_count}function Pg(e){const t=parseInt(e&&e.population,10);return Number.isFinite(t)?t:0}function gS(e,t){if(!Array.isArray(t)||t.length===0)return;const o=e&&e.selector;if(o==null)return;if(o.type==="pg_slugs"){const r=new Set(Array.isArray(o.values)?o.values:[]);let s=0;for(const i of t)i&&r.has(i.slug)&&(s+=Pg(i));return s}const n=Hn(o,t);let a=0;for(const r of t)r&&n.has(r.slug)&&(a+=Pg(r));return a}function bl(e,t={}){const o=t.deafCount??123,n=Array.isArray(t.records)?t.records:null,a=typeof t.title=="function"?(I,M)=>t.title(I)||M:(I,M)=>M,r=e.lists||[],s=e.asia_lists||[],i=e.uncovered_lists||[],l={type:"affinity_bloc",rop1:"A017"},u=s.filter(I=>I.id.startsWith("asia-india")),c=s.filter(I=>I.id.startsWith("asia-china")),p=[...r.map(I=>I.id),"deaf",...u.map(I=>I.id),...c.map(I=>I.id),...i.map(I=>I.id)],d=p.length,A=I=>pS(p.indexOf(I),d),x=(I,M,W)=>{if(!n)return I;const L=W??(M&&M.selector);return I.pop=gS({selector:L},n),I},h=I=>n?I.reduce((M,W)=>M+(W.pop||0),0):void 0,g=r.map(I=>x({id:I.id,zoneKey:I.id,label:a(I,I.label),...I.provinceLabel?{provinceLabel:I.provinceLabel}:{},color:A(I.id),count:as(I)},I)),m=x({id:"deaf",zoneKey:"deaf",label:"Deaf (affinity bloc A017)",color:A("deaf"),count:o,info:"Unified deaf row — affinity bloc rop1=A017 (collapses the two deaf_lists; zero-delta vs old deaf_predicate). Population double-counts vs geographic rows (design-approved, slice 08)."},null,l),f=I=>x({id:I.id,zoneKey:I.id,label:a(I,I.label),...I.provinceLabel?{provinceLabel:I.provinceLabel}:{},color:A(I.id),count:as(I),...Array.isArray(I.adm0)&&I.adm0.length?{adm0:I.adm0}:{},...Array.isArray(I.provinces)&&I.provinces.length?{provinces:I.provinces}:{}},I),b=u.map(f),$=c.map(f),y=I=>I.reduce((M,W)=>M+(as(W)||0),0),T={id:"asia-india",label:"India",count:y(u),children:b},P={id:"asia-china",label:"China",count:y(c),children:$};n&&(T.pop=h(b),P.pop=h($)),y(s),n&&h([T,P]);const E=I=>x({id:I.id,zoneKey:I.id,label:a(I,I.label),...I.provinceLabel?{provinceLabel:I.provinceLabel}:{},color:A(I.id),count:as(I)},I),v=i.map(E);v.length>0&&(()=>{const I={id:"frontier-asia",label:"Frontier Asia (uncovered)",count:y(i),children:v};return n&&(I.pop=h(v)),I})();const j={"west-africa":"Africa",sudan:"Africa","east-africa":"Africa","central-africa":"Africa","southern-africa-islands":"Africa","maghreb-egypt":"Middle East","middle-east-core":"Middle East","uncovered-nas-a":"Central Asia",laos:"Southeast Asia + Oceania","oceania-indonesia":"Southeast Asia + Oceania","mainland-se-asia-philippines":"Southeast Asia + Oceania",brazil:"Americas","andean-caribbean":"Americas","uncovered-scatter":"Americas",europe:"Europe",deaf:"Deaf","deaf-old-world":"Deaf"},re=I=>j[I]||(String(I).startsWith("asia-india-")?"India":String(I).startsWith("asia-china-")?"China + Mongolia":"Other"),Z=[...g,m,...b,...$,...v].filter(Boolean),G=new Map;for(const I of Z){const M=re(I.id||I.zoneKey);G.has(M)||G.set(M,[]),G.get(M).push(I)}const pe=[...G.entries()].map(([I,M])=>{M.sort((L,D)=>(D.count||0)-(L.count||0));const W={id:"region-"+I.toLowerCase().replace(/[^a-z0-9]+/g,"-"),label:I,count:M.reduce((L,D)=>L+(D.count||0),0),children:M};return n&&(W.pop=h(M)),W}).sort((I,M)=>(M.count||0)-(I.count||0));return hS(xg(pe),{withPop:!!n}),pe}function hS(e,{withPop:t=!1}={}){const o=[];for(const n of e||[]){const a=[];(typeof n.id!="string"||!n.id)&&a.push("id"),(typeof n.zoneKey!="string"||!n.zoneKey)&&a.push("zoneKey"),(typeof n.label!="string"||!n.label)&&a.push("label"),(typeof n.color!="string"||!n.color)&&a.push("color"),typeof n.count!="number"&&a.push("count"),t&&typeof n.pop!="number"&&a.push("pop"),a.length&&o.push(`${n.id||"(no-id)"}: missing/!type [${a.join(", ")}]`)}if(o.length)throw new Error(`legend-tree L15: ${o.length} leaf node(s) violate the uniform consumer shape: `+o.join(` `));return!0}function xg(e){const t=[],o=n=>{for(const a of n)a.children&&a.children.length?o(a.children):t.push(a)};return o(e||[]),t}const Sg=()=>({type:"FeatureCollection",features:[]});function fS(e,t){const o=Hn(e.selector,t),n=new Set;for(const a of t)a&&o.has(a.slug)&&a.country_code&&n.add(a.country_code);return n}function mS(e){return typeof e.id=="string"&&e.id.startsWith("asia-")}function yl(e,t){return{type:"Feature",properties:{...e.properties||{},zoneKey:t.zoneKey??t.id,zoneColor:t.color??t.zoneColor??"#888",zoneLabel:t.label,...t.id==="deaf"?{hatch:!0}:{}},geometry:e.geometry}}function bS(e,t){const{records:o=[],adm0:n,adm1Ind:a,adm1Chn:r}=t||{},s=Sg();if(mS(e)){const l=[a,r].filter(Boolean);for(const u of l)for(const c of u.features||[])c.properties&&c.properties.listId===e.id&&s.features.push(yl(c,e));if(Array.isArray(e.adm0)&&e.adm0.length&&n){const u=new Set(e.adm0);for(const c of n.features||[])c.properties&&u.has(c.properties.iso3)&&s.features.push(yl(c,e))}return s}if(!e.selector)return s;const i=fS(e,o);if(n&&i.size)for(const l of n.features||[])l.properties&&i.has(l.properties.iso3)&&s.features.push(yl(l,e));return s}function yS(e,t){const o=Sg(),n=new Map;for(const a of e){if(a.id==="deaf"){n.set(a.zoneKey??a.id,0);continue}const r=bS(a,t);n.set(a.zoneKey??a.id,r.features.length);for(const s of r.features)o.features.push(s)}return{tapestry:o,perZone:n}}const $S={"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 _S(e,t){const o=$S[e];return typeof o=="string"&&o?o:t}const rs={"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},Ag={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},Ga={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"};function Lg(e){const t={...Ga};for(const o of e||[]){const n=o&&o.country_code,a=o&&o.country_code_label;n&&a&&(t[n]=a)}return t}function Cg(e,t={}){if(!e||typeof e!="object")return null;const o=t.nameMap||Ga;if(e.shapeName){const n=String(e.shapeName),a=Object.prototype.hasOwnProperty.call(rs,n)?rs[n]:null;return{key:"adm1:"+n,name:n,count:a,kind:"adm1"}}if(e.iso3){const n=String(e.iso3),a=o[n]||Ga[n]||n,r=Object.prototype.hasOwnProperty.call(Ag,n)?Ag[n]:null;return{key:"adm0:"+n,name:a,count:r,kind:"adm0"}}return null}function vS(e,t={}){const o=Array.isArray(e)?e:[],n=o.map(l=>l.name),a=o.reduce((l,u)=>l+(Number(u.count)||0),0),r=t&&typeof t.color=="string"&&t.color?t.color:"",s=n.join(", ")+" — "+a+" UUPG"+(r?" · "+r:""),i=o.map(l=>l.name+" "+(Number(l.count)||0)).join(", ");return s+` -`+i}function qn(e){return String(e??"").normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().trim()}function wS(e){return qn(e).split(/[\s,;]+/).filter(Boolean)}function kS(e={}){const{records:t=[],leafZones:o=[],adm1Counts:n={},iso3Names:a={},countryNameMap:r=null}=e,s=[],i=new Set;for(const u of t){if(!u)continue;const c=u.slug;if(!c||i.has(c))continue;const p=Number(u.latitude),d=Number(u.longitude);if(!Number.isFinite(p)||!Number.isFinite(d))continue;const A=u.name||c;i.add(c),s.push({label:A,kind:"pg",target:{type:"pg",slug:c,lng:d,lat:p},_hay:qn(A)})}for(const u of o){if(!u)continue;const c=u.zoneKey||u.id,p=u.label||c;c&&s.push({label:p,kind:"zone",target:{type:"zone",zoneId:c},_hay:qn(p)})}for(const u of Object.keys(n))s.push({label:u,kind:"territory",target:{type:"territory",shapeName:u},_hay:qn(u)});const l=r||a;for(const u of Object.keys(a)){const c=l&&l[u]||a[u]||u;s.push({label:c,kind:"territory",target:{type:"territory",shapeName:u,iso3:!0},_hay:qn(c)})}return s}const PS={zone:0,territory:1,pg:2};function xS(e={}){const{records:t=[],leafZones:o=[],adm1Counts:n={},iso3Names:a={},countryNameMap:r=null,centroidFor:s=null}=e,i=[];for(const c of t)c&&i.push(c);const l=(c,p,d)=>!p||!Number.isFinite(p[0])||!Number.isFinite(p[1])?null:{name:c,slug:d.__synthSlug,latitude:p[1],longitude:p[0],...d};for(const c of o){if(!c)continue;const p=c.zoneKey||c.id,d=c.label||p;if(!p)continue;const A=typeof s=="function"?s(h=>h&&h.properties&&h.properties.zoneKey===p):null,x=l(d,A,{__upgKind:"zone",__zoneId:p,__synthSlug:`__zone__${p}`});x&&i.push(x)}for(const c of Object.keys(n)){const p=typeof s=="function"?s(A=>A&&A.properties&&A.properties.shapeName===c):null,d=l(c,p,{__upgKind:"territory",__shapeName:c,__synthSlug:`__terr__${c}`});d&&i.push(d)}const u=r||a;for(const c of Object.keys(a)){const p=u&&u[c]||a[c]||c,d=typeof s=="function"?s(x=>x&&x.properties&&x.properties.iso3===c):null,A=l(p,d,{__upgKind:"territory",__shapeName:c,__synthSlug:`__terr__${c}`});A&&i.push(A)}return i}function Tg(e,t,o={}){const n=o.limit??8,a=wS(t);if(!a.length)return[];const r=a[0],s=[];for(const i of e){let l=!0;for(const p of a)if(!i._hay.includes(p)){l=!1;break}if(!l)continue;const u=i._hay.startsWith(r)?0:1,c=i._hay===qn(t)?-1:0;s.push({e:i,starts:u,exact:c,kr:PS[i.kind]??9,len:i._hay.length})}return s.sort((i,l)=>i.exact-l.exact||i.starts-l.starts||i.kr-l.kr||i.len-l.len),s.slice(0,n).map(i=>i.e)}const Eg=new Set;function SS(e,t){var a,r;const o=e.getSource(t);if(!o)return[];let n=o._data??((r=(a=o.serialize)==null?void 0:a.call(o))==null?void 0:r.data);if(n&&typeof n=="object"&&!Array.isArray(n)){if(n.geojson!==void 0)n=n.geojson;else if(n.url!==void 0)return Eg.has(t)||(Eg.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 n?Array.isArray(n==null?void 0:n.features)?n.features:(n==null?void 0:n.type)==="Feature"?[n]:[]:[]}const AS={class:"upg-root"},LS={key:0,class:"upg-map-err"},CS={class:"upg-legend-desktop-slot"},TS={class:"upg-legend-mobile-slot"},ES={class:"upg-detail-desktop-slot"},RS={key:4,class:"upg-hud"},NS={key:0,class:"upg-hud-head"},MS={class:"upg-hud-total"},IS={key:1,class:"upg-hud-names"},FS={key:2,class:"upg-hud-actions"},OS=["disabled"],DS=["disabled"],GS={key:3,class:"upg-hud-flash"},zS={class:"upg-status"},$l="upg-search",Rg=1,BS="people-groups",Ng=8,_l=123,US=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"upg-100-list",setup(e){const t=Ou(()=>$t(()=>Promise.resolve().then(()=>dx),void 0)),o=He("mapboxToken",be("")),n=He("profileConfig",be(null));function a(){var N,U;return((N=n.value)==null?void 0:N.instanceId)||((U=n.value)==null?void 0:U.profile)||"upg-100-list"}const r=nS(n),s=r==="maplibre",i=Q(()=>{var N;return((N=n==null?void 0:n.value)==null?void 0:N.search)===!1?!1:r==="mapbox"}),l=Q(()=>{var U;const N=(U=n.value)==null?void 0:U.edgeScrollAffordance;return N==null?!0:!(N===!1||N==="false")}),u=He("dataStore",null),c=He("uiStore",null),p=be(null),d=be("loading…"),A=be(""),x=xn([]),h=be(null),g=xn(null),m=be(!1),f=V1("my-upg-100-list");f.theme.value="light",q1(f);const b=be([]),$=Q(()=>b.value.reduce((N,U)=>N+(Number(U.count)||0),0)),y=Q(()=>b.value.length),T=be("");let P=null;const E=be(!1);function v(N){const U=N===void 0?!E.value:!!N;return U===E.value||(E.value=U,L&&(L.getCanvas().style.cursor=""),S()),U}function j(){v()}nt([E,m],()=>{jt(()=>ot())});function re(N){if(!N)return;const U=b.value,Y=U.findIndex(fe=>fe.key===N.key);Y>=0?b.value=U.filter((fe,Le)=>Le!==Y):b.value=[...U,N],S(),T.value=""}const Z=be(""),G=be("");function pe(N){const U=/^#?([0-9a-fA-F]{6})$/.exec(String(N||"").trim());if(!U)return;const Y="#"+U[1].toLowerCase();Z.value=Z.value===Y?"":Y,S()}const I=be(null),M=[{id:"upg100Region",label:"Region",info:"Region — sort the UPG-100 lists by world area (Africa, India, Middle East, Deaf, …). Counts are the UUPGs and population summed across every list beneath it."},{id:"upg100Zone",label:"UPG-100 Lists",info:"UPG-100 Lists — each one is a prayer list of the unreached people groups in an area, and is what the map paints and colours. Every list prints as its own packet."}];let W=[],L=null,D=null,K=[],ne=null,ce=null,xe=null;const $e=typeof window<"u"&&window.MAP_APP_API_URL||void 0||"",{locale:Be,t:ue}=St(),he=Q(()=>ue("legend.title.upg100List")),le=Q(()=>ue("search.upg100Placeholder"));Tt(`.upg-root{position:absolute;inset:0;background:#0a1410;color:#e5e7eb;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-status{position:absolute;bottom:10px;right:10px;z-index:5;font:10px/1 ui-monospace,monospace;color:#9aa7b8;background:rgba(10,14,21,.82);padding:6px 10px;border-radius:8px}.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-hud{position:absolute;bottom:34px;right: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-left: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: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-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 Se(N){const U=[];for(const Y of N)U.push(Y.zoneKey,_S(Y.zoneKey,Y.color));return["match",["get","zoneKey"],...U,"#9ca3af"]}function V(){if(L.getSource("tapestry")&&L.getLayer("tapestry-fill")&&L.getLayer("tapestry-line"))return;L.getSource("tapestry")||L.addSource("tapestry",{type:"geojson",data:D});const N=m.value?.45:.3,U=m.value?.65:.45;if(L.getLayer("tapestry-fill")||L.addLayer({id:"tapestry-fill",type:"fill",source:"tapestry",paint:{"fill-color":ne,"fill-opacity":["case",["==",["get","zoneKey"],"deaf"],N,U]}}),L.getLayer("tapestry-line")||L.addLayer({id:"tapestry-line",type:"line",source:"tapestry",paint:{"line-color":ne,"line-width":1.2,"line-opacity":.9}}),on){const Y=on;jt(()=>{on===Y&&Ha(Y)})}}function ye(){!L||!L.getSource("tapestry")||L.getLayer("upg-sel-fill")||(L.addLayer({id:"upg-sel-fill",type:"fill",source:"tapestry",filter:["boolean",!1],paint:{"fill-color":"#f59e0b","fill-opacity":.28}}),L.addLayer({id:"upg-sel-line",type:"line",source:"tapestry",filter:["boolean",!1],paint:{"line-color":"#fbbf24","line-width":2.4,"line-opacity":.95}}))}function _(){const N=[],U=[],Y=[];for(const Le of b.value)Le.kind==="adm1"?N.push(Le.name):Le.kind==="adm0"?U.push(Le.key.slice(5)):Le.kind==="zone"&&Y.push(Le.key.slice(5));const fe=[];return N.length&&fe.push(["in",["get","shapeName"],["literal",N]]),U.length&&fe.push(["in",["get","iso3"],["literal",U]]),Y.length&&fe.push(["in",["get","zoneKey"],["literal",Y]]),fe.length?fe.length===1?fe[0]:["any",...fe]:["boolean",!1]}function S(){if(ot(),!L||!L.getLayer("upg-sel-fill"))return;const N=E.value?_():["boolean",!1];L.setFilter("upg-sel-fill",N),L.setFilter("upg-sel-line",N);const U=Z.value;L.setPaintProperty("upg-sel-fill","fill-color",U||"#f59e0b"),L.setPaintProperty("upg-sel-fill","fill-opacity",U?.55:.28),L.setPaintProperty("upg-sel-line","line-color",U||"#fbbf24")}let C=null,H=!1;function oe(){if(!(!L||!L.getLayer("tapestry-fill"))){if(C)try{L.off("click","tapestry-fill",C)}catch{}C=N=>{const U=N&&N.features&&N.features[0];if(U&&E.value){const Y=Cg(U.properties,{nameMap:P});if(!Y){console.warn("[batch-select] clicked feature has no shapeName/iso3",U.properties);return}Y.count==null&&console.warn("[batch-select] no UUPG count for territory",Y.name,U.properties),re(Y)}},L.on("click","tapestry-fill",C),H||(L.on("mouseenter","tapestry-fill",()=>{L&&(L.getCanvas().style.cursor=E.value?"crosshair":"")}),L.on("mouseleave","tapestry-fill",()=>{L&&(L.getCanvas().style.cursor="")}),H=!0)}}function ie(){b.value=[],T.value="",Z.value="",G.value="",S()}function se(N){if(u&&typeof u.cacheSourceData=="function"){const U=xS({records:N,leafZones:K,adm1Counts:rs,iso3Names:Ga,countryNameMap:P,centroidFor:Y=>{const fe=O(Y);return fe?[(fe[0][0]+fe[1][0])/2,(fe[0][1]+fe[1][1])/2]:null}});u.cacheSourceData($l,{normalizedData:U})}W=kS({records:N,leafZones:K,adm1Counts:rs,iso3Names:Ga,countryNameMap:P}),typeof window<"u"&&(window.__UPG_SEARCH__={size:()=>W.length,counts:()=>{const U={pg:0,zone:0,territory:0};for(const Y of W)U[Y.kind]=(U[Y.kind]||0)+1;return U},query:U=>Tg(W,U,{limit:Ng}).map(Y=>({label:Y.label,kind:Y.kind,target:Y.target})),select:U=>{const Y=Tg(W,U,{limit:Ng})[0];return Y?(B(Y.target),{label:Y.label,kind:Y.kind,target:Y.target}):null},feedSize:()=>{const U=u&&u.sources&&u.sources[$l];return U&&Array.isArray(U.features)&&U.features.length||0},localGeocoder:U=>{const Y=I.value&&I.value.geocoder,fe=Y&&Y.options&&Y.options.localGeocoder;return fe?fe(U).map(Le=>Le&&Le.place_name):null}},(window.__UPG_SEARCHES__||(window.__UPG_SEARCHES__={}))[a()]=window.__UPG_SEARCH__)}function ge(N){const U=N&&N.properties||{},Y=U.__upgKind;if(Y==="zone")X(U.__zoneId);else if(Y==="territory")ee(U.__shapeName);else{const fe=N&&N.geometry,Le=fe&&Array.isArray(fe.coordinates)?fe.coordinates:null;Le&&Number.isFinite(Le[0])&&Number.isFinite(Le[1])&&L&&L.flyTo({center:[Le[0],Le[1]],zoom:6,duration:800}),z(U.slug)}}function w(N){if(!N||!L)return;const U=new Set(N.memberIds||[]);if(!U.size)return;let Y=[];try{Y=L.querySourceFeatures("upg").filter(Ze=>{const ke=Ze.properties||{};return U.has(ke.slug)||U.has(ke.id)||U.has(ke.peopleGroupId)})}catch{return}if(!Y.length)return;let fe=180,Le=90,je=-180,Ve=-90,De=!1;for(const Ze of Y){const ke=Ze.geometry&&Ze.geometry.coordinates;!Array.isArray(ke)||!Number.isFinite(ke[0])||!Number.isFinite(ke[1])||(ke[0]je&&(je=ke[0]),ke[1]Ve&&(Ve=ke[1]),De=!0)}De&&L.fitBounds([[fe,Le],[je,Ve]],{padding:60,duration:800,maxZoom:6})}function k(){Yn(null),c&&typeof c.selectPeopleGroup=="function"&&c.selectPeopleGroup(null)}function B(N){!N||!L||(N.type==="pg"?(Number.isFinite(N.lng)&&Number.isFinite(N.lat)&&L.flyTo({center:[N.lng,N.lat],zoom:6,duration:800}),z(N.slug)):N.type==="zone"?X(N.zoneId):N.type==="territory"&&ee(N.shapeName))}function z(N){if(!N||!c||typeof c.selectPeopleGroup!="function")return;const Y=SS(L,"upg").find(fe=>fe.properties&&fe.properties.slug===N);Y&&c.selectPeopleGroup(Y)}function X(N){if(!N||!L||!D)return;const U=O(Y=>Y.properties&&Y.properties.zoneKey===N);U&&L.fitBounds(U,{padding:40,duration:800,maxZoom:6})}function ee(N){if(!N||!L||!D)return;const U=O(Y=>{const fe=Y.properties||{};return fe.shapeName===N||fe.iso3===N});U&&L.fitBounds(U,{padding:40,duration:800,maxZoom:6})}function O(N){let U=180,Y=90,fe=-180,Le=-90,je=!1;const Ve=De=>{if(typeof De[0]=="number"){const[Ze,ke]=De;Zefe&&(fe=Ze),keLe&&(Le=ke),je=!0;return}for(const Ze of De)Ve(Ze)};for(const De of D.features)N(De)&&Ve(De.geometry.coordinates);return je?[[U,Y],[fe,Le]]:null}function J(N){const U=new Set,Y=fe=>{fe.children&&fe.children.length?fe.children.forEach(Y):U.add(fe.zoneKey??fe.id)};return Y(N),U}let we=null;function Ee(N){if(![...J(N)].length)return;const Y=[],fe=De=>{De.children&&De.children.length?De.children.forEach(fe):Y.push(De)};fe(N);const Le=b.value,je=new Set(Le.filter(De=>De.kind==="zone").map(De=>De.key));if(Y.every(De=>je.has("zone:"+(De.zoneKey??De.id)))){const De=new Set(Y.map(Ze=>"zone:"+(Ze.zoneKey??Ze.id)));b.value=Le.filter(Ze=>!De.has(Ze.key))}else{const De=Y.filter(Ze=>!je.has("zone:"+(Ze.zoneKey??Ze.id))).map(Ze=>({key:"zone:"+(Ze.zoneKey??Ze.id),name:Ze.label||Ze.id,count:Number(Ze.count)||0,kind:"zone"}));b.value=[...Le,...De]}S(),T.value=""}function qe(){const N=new Set;for(const U of b.value)U.kind==="zone"&&N.add(U.key.slice(5));return N}function ft(){const N=new Map,U=Y=>{const fe=J(Y);Y.label&&N.set(Y.label,fe),Y.children&&Y.children.length&&Y.children.forEach(U)};for(const Y of x.value)U(Y);return N}function ot(){if(typeof document>"u")return;const N=document.querySelector("my-upg-100-list-map"),Y=(N&&N.shadowRoot||document).querySelectorAll(".stl-row");if(!Y.length)return;if(!E.value){Y.forEach(Ve=>Ve.classList.remove("upg-batch-row"));return}const fe=qe(),Le=ft(),je=m.value;Y.forEach(Ve=>{const De=Ve.querySelector(".stl-name"),Ze=De?De.textContent.trim():"",ke=Ze&&Le.get(Ze),Ue=!!(ke&&ke.size&&[...ke].every(it=>fe.has(it)));Ve.classList.toggle("upg-batch-row",Ue),Ve.classList.toggle("dark",Ue&&je)})}let vt=null;function eo(){if(typeof document>"u"||vt)return;const N=document.querySelector("my-upg-100-list-map"),Y=(N&&N.shadowRoot||document).querySelector(".stl-rows");Y&&(vt=new MutationObserver(()=>{requestAnimationFrame(()=>ot())}),vt.observe(Y,{childList:!0,subtree:!0}))}zt("onSemanticTreeSelect",Yn),zt("onLegendExport",Ae);async function Ae(N){const U=h.value;if(!U)return;if(N==="packet"){await Te(U);return}const Y=rt().find(fe=>fe.id===U)||{id:U};await Je.printPoster(Y)}const Je=rp({records:N=>to(N),lang:()=>zo(),label:N=>(N==null?void 0:N.label)||(N==null?void 0:N.id)||"",assetsBase:()=>zn(n.value),downloadPrefix:"doxa-upg-100"});nt(Je.exportState,N=>{if(!N){/packet/i.test(d.value)&&(d.value="");return}if(N.phase==="error"){Pe(ue("messages.packetFailed",{reason:N.message}),4e3);return}d.value=N.phase==="done"?"":`${N.message}…`});async function to(N){if(!$e)throw new Error("no API configured");const Y=await fetch(`${$e}/api/people-groups/list?fields=slug,name,country_code,population,religion,image_url&lang=${zo()}`,{cache:"no-store"});if(!Y.ok)throw new Error(`people-groups fetch failed (${Y.status})`);const fe=Ea(await Ca(Ra(await Y.json()),n));let Le;if(N.selector&&N.selector.type==="pg_slugs")Le=new Set(N.selector.values||[]);else{const{evaluate:je}=await $t(async()=>{const{evaluate:Ve}=await Promise.resolve().then(()=>Si);return{evaluate:Ve}},void 0);Le=new Set(je(N.selector,fe))}return fe.filter(je=>Le.has(je.slug)).sort((je,Ve)=>String(je.name).localeCompare(String(Ve.name),zo()))}async function F(N,U){try{const Y=zn(n.value),fe=await(await fetch(`${Y}/posters/${N}.html`,{cache:"force-cache"})).text(),Le=fe.match(//);return Le?`
${Le[0]}
`:""}catch{return""}}function te(N,U,Y){N.value=U,setTimeout(()=>{N.value===U&&(N.value="")},Y)}const Pe=(N,U)=>te(d,N,U);async function Te(N){const U=rt().find(je=>je.id===N);if(!U)return;const[{createPacketRenderer:Y},fe]=await Promise.all([$t(()=>Promise.resolve().then(()=>Pl),void 0),$t(()=>Promise.resolve().then(()=>Ba),void 0).then(je=>je.default||je)]),Le=Y({strings:fe,lang:zo()});await Je.printPacket(U,{mapSvg:await F(N,Le),funnel:await Me()})}function Re(){return gp(Ur(n))}function rt(){const N=Re();return[...N.lists||[],...N.asia_lists||[],...N.uncovered_lists||[]]}async function Me(){var N;try{const U=(await $t(async()=>{const{default:je}=await Promise.resolve().then(()=>TA);return{default:je}},void 0)).default;if(!U||!Array.isArray(U.steps)||!U.steps.length)return null;const Y=Ur(n),fe=Number(U.steps[U.steps.length-1].groups)||0;if(Y===La)return{...U,listCount:rt().length,listTotal:fe};let Le=0;try{const je=zn(n.value),Ve=await fetch(`${je}/people-groups/lists/${Y}.json`);if(Ve.ok){const De=await Ve.json();Le=Number((N=De==null?void 0:De.counts)==null?void 0:N.doxa)||(Array.isArray(De==null?void 0:De.slugs)?De.slugs.length:0)}}catch{}return{...U,listTotal:Le,listId:Y,listLabel:(op(Y)||{}).label||Y}}catch{return null}}const mt=be(!1);function At(){const N=b.value.filter(Y=>Y.kind==="zone").map(Y=>String(Y.key).replace(/^zone:/,"")),U=new Map(rt().map(Y=>[Y.id,Y]));return N.map(Y=>U.get(Y)).filter(Boolean)}let Wt=null;async function xl(){if(!Wt){const N=await $t(()=>Promise.resolve().then(()=>Ba),void 0).then(U=>U.default||U);Wt={...N.en||{},...N[zo()]||{}}}return Wt}function th(N,U){return N?String(N).replace(/\{(\w+)\}/g,(Y,fe)=>U[fe]!=null?String(U[fe]):Y):null}async function EA(){const N=At();if(!N.length)throw new Error("nothing selected");if(!$e)throw new Error("no API configured");const Y=await fetch(`${$e}/api/people-groups/list?fields=slug,name,country_code,population,religion,image_url&lang=${zo()}`,{cache:"no-store"});if(!Y.ok)throw new Error(`people-groups fetch failed (${Y.status})`);const fe=Ea(await Ca(Ra(await Y.json()),n)),{evaluate:Le}=await $t(async()=>{const{evaluate:Ue}=await Promise.resolve().then(()=>Si);return{evaluate:Ue}},void 0),je=new Set;for(const Ue of N)if(Ue.selector&&Ue.selector.type==="pg_slugs")for(const it of Ue.selector.values||[])je.add(it);else for(const it of Le(Ue.selector,fe))je.add(it);const Ve=N.map(Ue=>Ue.label||Ue.id),De=await xl(),Ze=(Ue,it)=>th(De.zone_join,{a:Ue,b:it})??`${Ue} + ${it}`;return{id:"selection",label:Ve.length<=3?Ve.reduce(Ze):th(De.zone_join_more,{a:Ve.slice(0,2).reduce(Ze),n:Ve.length-2})??`${Ve.slice(0,2).join(" + ")} +${Ve.length-2} more`,count:je.size,selector:{type:"pg_slugs",values:[...je]}}}async function RA(){if(!mt.value){mt.value=!0;try{const N=await EA(),[{createPacketRenderer:U},Y]=await Promise.all([$t(()=>Promise.resolve().then(()=>Pl),void 0),$t(()=>Promise.resolve().then(()=>Ba),void 0).then(De=>De.default||De)]),fe=U({strings:Y,lang:zo()}),Le=At(),je=Le.length===1?await F(Le[0].id,fe):"",Ve=await Me();await Je.printPacket(N,{mapSvg:je,funnel:Ve&&Le.length===1?Ve:Ve?{...Ve,listCount:0}:null})}catch(N){Pe(ue("messages.selectionPacketFailed",{reason:String((N==null?void 0:N.message)||N).slice(0,90)}),4e3)}finally{mt.value=!1}}}async function NA(){if(!mt.value){mt.value=!0;try{const N=At();if(!N.length)throw new Error("nothing selected");if(N.length>1){Pe(ue("messages.posterOneTerritory",{count:N.length}),5e3);return}await Je.printPoster(N[0])}catch(N){Pe(ue("messages.selectionPosterFailed",{reason:String((N==null?void 0:N.message)||N).slice(0,90)}),4e3)}finally{mt.value=!1}}}function zo(){const N=Be&&(Be.value??Be);return typeof N=="string"&&N||"en"}function Yn(N){if(!L||!L.getLayer("tapestry-fill"))return!1;if(E.value)return N&&Ee(N),!0;if(!N)return we=null,h.value=null,L.setFilter("tapestry-fill",null),L.setFilter("tapestry-line",null),L.setPaintProperty("upg-pins","circle-opacity",1),!0;we=N;const U=[...J(N)];h.value=U.length===1?U[0]:N.id??null;const Y=["in",["get","zoneKey"],["literal",U]];L.setFilter("tapestry-fill",Y),L.setFilter("tapestry-line",Y),L.getLayer("upg-pins")&&L.setPaintProperty("upg-pins","circle-opacity",["case",["in",["get","zoneKey"],["literal",U]],.95,.05]);const fe=O(Le=>U.includes(Le.properties.zoneKey));return fe&&L.fitBounds(fe,{padding:40,duration:700,maxZoom:6}),!0}function Sl(){L&&(typeof xe=="function"&&xe(),D&&(V(),ye(),oe(),S(),h.value&&L.getLayer("tapestry-fill")&&Yn(we)))}function MA(){L&&(m.value=!m.value,f.theme.value=m.value?"dark":"light",L.setStyle(m.value?fl("ink",r).style||"mapbox://styles/mapbox/dark-v11":fl("paper",r).style||"mapbox://styles/mapbox/light-v11"),L.once("style.load",Sl))}function oh(){!L||!L.getLayer("upg-pins")||(L.on("click","upg-pins",N=>{const U=N&&N.features&&N.features[0];U&&c&&typeof c.selectPeopleGroup=="function"&&c.selectPeopleGroup(U)}),L.on("mouseenter","upg-pins",()=>{L&&(L.getCanvas().style.cursor="pointer")}),L.on("mouseleave","upg-pins",()=>{L&&(L.getCanvas().style.cursor="")}))}let Ua=null,on,Jn=null;function is(N,U){var Y,fe,Le;try{const je=(Le=(fe=(Y=p.value)==null?void 0:Y.getRootNode)==null?void 0:fe.call(Y))==null?void 0:Le.host;if(!je)return;je.setAttribute("data-doxa-select-zone-state",N),U&&je.setAttribute("data-doxa-select-zone-applied",String(U))}catch{}}function Ha(N){if(!N)return Yn(null),on=void 0,is("cleared",""),!0;const U=nh(x.value,N);return U?Yn(U)?(on=void 0,is("applied",N),!0):(on=N,is("applied-but-no-selection",N),!1):(on=N,is("unresolved",N),!1)}function IA(N){var Y;const U=((Y=N==null?void 0:N.detail)==null?void 0:Y.listId)??null;Ha(U)}function nh(N,U){for(const Y of N||[]){if((Y.zoneKey||Y.id)===U)return Y;const fe=Y.children&&nh(Y.children,U);if(fe)return fe}return null}function FA(){const N=Re(),U=bl(N,{deafCount:_l});x.value=U,K=xg(U);const Y={};for(const fe of N.lists||[])Y[fe.id]=fe.selector;for(const fe of N.asia_lists||[])Y[fe.id]=fe.selector;for(const fe of N.uncovered_lists||[])Y[fe.id]=fe.selector;Y.deaf={type:"affinity_bloc",rop1:"A017"};for(const fe of K)fe.selector=Y[fe.id];ne=Se(K)}async function ah(){if($e)try{const U=await fetch(`${$e}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${zo()}`,{cache:"no-store"});if(!U.ok)throw new Error(`list ${U.status}`);const Y=Ea(await Ca(Ra(await U.json()),n));P=Lg(Y),x.value=bl(Re(),{deafCount:_l,records:Y})}catch{}}so(async()=>{var Le,je,Ve,De,Ze;FA();try{await uS(r)}catch{}const N=ml(r);N&&cS(N);const U=(o==null?void 0:o.value)||((Le=n==null?void 0:n.value)==null?void 0:Le.tk)||"";if(!N){console.warn(`[upg-100-list] ${r} 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.`),d.value=`⚠ ${ue("messages.engineNotLoaded")}`,A.value=ue("messages.engineNotLoadedDetail",{engine:s?"MapLibre":"Mapbox"}),ah();return}if(!s){if(!U){d.value="⚠ no mapbox token",A.value="No Mapbox token configured. The list and legend are unaffected.",ah();return}N.accessToken=U}try{const ke=kg(r);ke&&await dS(p.value,ke)}catch{}try{const ke=!s&&p.value&&p.value.getRootNode();if(ke instanceof ShadowRoot){const Ue=kg("mapbox");if(Ue&&!ke.querySelector(`link[href="${Ue}"]`)){const it=document.createElement("link");it.rel="stylesheet",it.href=Ue,ke.prepend(it)}}}catch{}L=new N.Map({container:p.value,style:fl("paper",r).style||"mapbox://styles/mapbox/light-v11",center:[35,20],zoom:1.5,projection:"mercator"}),g.value=L,ce=sS(((je=p.value)==null?void 0:je.parentElement)||null,{enabled:l.value}),typeof window<"u"&&(window.__UPG_MAP__=L,(window.__UPG_MAPS__||(window.__UPG_MAPS__={}))[a()]=L),window.__UPG_SELECT__={get list(){return b.value.map(ke=>({...ke}))},get total(){return $.value},get count(){return y.value},get color(){return Z.value},get batchMode(){return E.value},setColor:ke=>pe(ke),setBatchMode:ke=>v(ke),clipboardText:()=>vS(b.value,{color:Z.value}),clear:()=>ie(),toggleByProps:ke=>{const Ue=Cg(ke,{nameMap:P});return Ue?(re(Ue),{...Ue}):null},toggleLegendRow:ke=>{const Ue=nn=>{for(const bt of nn){if(bt.label===ke)return bt;if(bt.children&&bt.children.length){const Dt=Ue(bt.children);if(Dt)return Dt}}return null},it=Ue(x.value);return it?(Ee(it),{label:it.label,zoneKeys:[...J(it)]}):null},markedLegendRows:()=>{if(typeof document>"u")return[];const ke=document.querySelector("my-upg-100-list-map");return[...(ke&&ke.shadowRoot||document).querySelectorAll(".stl-row.upg-batch-row .stl-name")].map(it=>it.textContent.trim())},highlightFeatureCount:()=>{if(!L||!D||!L.getLayer("upg-sel-fill"))return-1;const ke=new Set,Ue=new Set,it=new Set;for(const bt of b.value)bt.kind==="zone"?ke.add(bt.key.slice(5)):bt.kind==="adm1"?Ue.add(bt.name):bt.kind==="adm0"&&it.add(bt.key.slice(5));let nn=0;for(const bt of D.features){const Dt=bt.properties||{};(ke.has(Dt.zoneKey)||Ue.has(Dt.shapeName)||it.has(Dt.iso3))&&nn++}return nn},zoneKeysForRow:ke=>{const Ue=nn=>{for(const bt of nn){if(bt.label===ke)return bt;if(bt.children&&bt.children.length){const Dt=Ue(bt.children);if(Dt)return Dt}}return null},it=Ue(x.value);return it?[...J(it)]:null}},(window.__UPG_SELECTS__||(window.__UPG_SELECTS__={}))[a()]=window.__UPG_SELECT__;try{d.value="loading boundaries…";const ke=Ke=>`${zn(n.value)}/boundaries/${Ke}`,Ue=Ke=>fetch(ke(Ke)).then(Et=>{if(!Et.ok)throw new Error(`boundary fetch ${Et.status} ${Ke}`);return Et.json()});if(!$e)throw new Error("No API base configured — set window.MAP_APP_API_URL or VITE_API_BASE_URL. Failing closed (no default host).");const nn=fetch(`${$e}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${zo()}`).then(Ke=>{if(!Ke.ok)throw new Error(`list ${Ke.status}`);return Ke.json()}),bt={adm0:Ue("world-adm0-web.geojson"),adm1Chn:Ue("gb-CHN-ADM1.geojson"),adm1Ind:Ue("gb-IND-ADM1-web.geojson")};d.value="fetching 2106 UUPGs…";const Dt=Ea(await Ca(Ra(await nn),n));P=Lg(Dt),x.value=bl(Re(),{deafCount:_l,records:Dt});const Al=[],ja={},{evaluate:DA}=await $t(async()=>{const{evaluate:Ke}=await Promise.resolve().then(()=>Si);return{evaluate:Ke}},void 0);for(const Ke of K)if(Ke.selector&&Ke.selector.type==="pg_slugs")for(const Et of Ke.selector.values||[])Et in ja||(ja[Et]=Ke.zoneKey);else try{for(const Et of DA(Ke.selector,Dt))Et in ja||(ja[Et]=Ke.zoneKey)}catch(Et){console.warn("zone selector skipped",Ke.id,Et&&Et.message)}for(const Ke of Dt){const Et=Number(Ke.latitude),Cl=Number(Ke.longitude);!isFinite(Et)||!isFinite(Cl)||Al.push({type:"Feature",geometry:{type:"Point",coordinates:[Cl,Et]},properties:{slug:Ke.slug,zoneKey:ja[Ke.slug]||"",name:Ke.name||Ke.slug||"",population:Ke.population??0,countryName:Ke.country_code_label||"",country:Ke.country_code||""}})}const GA=sn({type:"FeatureCollection",features:Al});xe=()=>{if(!(L.getSource("upg")&&L.getLayer("upg-pins"))){if(L.getSource("upg")||L.addSource("upg",{type:"geojson",data:GA}),L.getLayer("upg-pins")){oh();return}L.addLayer({id:"upg-pins",type:"circle",source:"upg",paint:{"circle-radius":["interpolate",["linear"],["zoom"],1,5,4,6.5,8,9],"circle-color":ne,"circle-opacity":1,"circle-stroke-width":["interpolate",["linear"],["zoom"],1,1.8,8,2],"circle-stroke-color":"rgba(15,20,25,0.9)"}}),oh()}};const rh=()=>{try{Sl()}catch(Ke){console.warn("early pin paint skipped",Ke&&Ke.message)}};L.isStyleLoaded()?rh():L.once("style.load",rh),d.value="loading boundaries…";const[zA,BA]=await Promise.all([bt.adm0,bt.adm1Chn]),UA=await bt.adm1Ind,{tapestry:HA,perZone:jA}=yS(K,{records:Dt,adm0:zA,adm1Ind:UA,adm1Chn:BA});D=sn(HA),se(Dt);let Ll=!0;const Zn=()=>{Ll&&(Ll=!1,L.off("style.load",Zn),L.off("idle",Zn),Sl())};if(L.isStyleLoaded())Zn();else{L.once("style.load",Zn),L.once("idle",Zn);const Ke=setInterval(()=>{if(!Ll||!L){clearInterval(Ke);return}let Et=!1;try{Et=L.isStyleLoaded()}catch{clearInterval(Ke);return}Et&&(clearInterval(Ke),Zn())},120);setTimeout(()=>clearInterval(Ke),15e3)}const sh=[...jA.entries()].filter(([Ke])=>Ke!=="deaf"),KA=sh.filter(([,Ke])=>Ke>=1).length;d.value=`${D.features.length} polys · ${KA}/${sh.length} zones · ${Al.length} pins`}catch(ke){d.value="⚠ "+(ke&&ke.message?ke.message:String(ke))}let Y=0;const fe=()=>{const ke=typeof document<"u"&&document.querySelector("my-upg-100-list-map"),Ue=ke&&ke.shadowRoot||(typeof document<"u"?document:null);if(Ue&&Ue.querySelector(".stl-rows")){eo(),ot();return}Y++<40&&setTimeout(fe,250)};fe();{const ke=(Ze=(De=(Ve=p.value)==null?void 0:Ve.getRootNode)==null?void 0:De.call(Ve))==null?void 0:Ze.host;if(ke){Ua=IA,ke.addEventListener("doxa:select-zone",Ua);const Ue=ke.getAttribute("select-zone");Ue&&Ha(Ue),Jn=new MutationObserver(()=>{Ha(ke.getAttribute("select-zone")||null)}),Jn.observe(ke,{attributes:!0,attributeFilter:["select-zone"]})}}});const OA=()=>{var N,U,Y;try{return((Y=(U=(N=p.value)==null?void 0:N.getRootNode)==null?void 0:U.call(N))==null?void 0:Y.host)||null}catch{return null}};return nt([x,g],()=>{jt(()=>{var U;const N=((U=OA())==null?void 0:U.getAttribute("select-zone"))||on||null;N&&Ha(N)})}),Zt(()=>{var N,U,Y;if(Jn==null||Jn.disconnect(),Jn=null,Ua){const fe=(Y=(U=(N=p.value)==null?void 0:N.getRootNode)==null?void 0:U.call(N))==null?void 0:Y.host;fe==null||fe.removeEventListener("doxa:select-zone",Ua),Ua=null}if(vt){try{vt.disconnect()}catch{}vt=null}if(ce){try{ce()}catch{}ce=null}L&&(L.remove(),L=null),D=null}),(N,U)=>{var Y;return q(),ae("div",AS,[R("div",{ref_key:"mapEl",ref:p,class:"upg-map"},null,512),A.value?(q(),ae("div",LS,[R("strong",null,de(me(ue)("messages.mapUnavailable")),1),kt(de(A.value),1)])):ve("",!0),l.value?(q(),ae(ze,{key:1},[U[0]||(U[0]=R("div",{class:"map-scroll-edge map-scroll-edge--left"},null,-1)),U[1]||(U[1]=R("div",{class:"map-scroll-edge map-scroll-edge--right"},null,-1))],64)):ve("",!0),g.value&&i.value?(q(),dt(eS,{key:2,ref_key:"geocoderRef",ref:I,"map-instance":g.value,"access-token":me(o)||((Y=me(n))==null?void 0:Y.tk)||"","data-source-id":$l,"is-dark":m.value,placeholder:le.value,"active-context":BS,onPeopleGroupResult:ge,onAggregateResult:w,onClear:k},null,8,["map-instance","access-token","is-dark","placeholder"])):ve("",!0),g.value?(q(),dt(Ax,{key:3,"has-geocoder":i.value},{default:Jt(()=>[tt(Cx,{map:g.value,"is-dark":m.value},null,8,["map","is-dark"]),tt(Tx,{map:g.value,"is-dark":m.value},null,8,["map","is-dark"]),tt(Ex,{map:g.value,"is-dark":m.value},null,8,["map","is-dark"]),tt(Mx,{"map-container":p.value,"is-dark":m.value},null,8,["map-container","is-dark"]),tt(Fx,{"is-dark":m.value,onToggle:MA},null,8,["is-dark"]),tt($n,{"is-dark":m.value,active:E.value,class:Ge({"upg-batch-on":E.value}),"aria-pressed":E.value?"true":"false",title:"Batch Select",onClick:j},{default:Jt(()=>[...U[2]||(U[2]=[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"])]),_:1},8,["has-geocoder"])):ve("",!0),R("div",CS,[x.value.length?(q(),dt($p,{key:0,nodes:x.value,tabs:M,"default-tab":Rg,columns:["count","pop"],title:he.value,"export-enabled":!0,onSelect:Yn,onExport:Ae},null,8,["nodes","title"])):ve("",!0)]),R("div",TS,[x.value.length?(q(),dt(Sx,{key:0,"legend-type":"upg-100",nodes:x.value,tabs:M,"default-tab":Rg,columns:["count","pop"],"column-label":"UPG 100",title:he.value,"is-dark":m.value,"popup-action":"pray"},null,8,["nodes","title","is-dark"])):ve("",!0)]),R("div",ES,[me(c)&&me(c).selectedPeopleGroup?(q(),ae("div",{key:0,class:Ge(["upg-detail-panel pg-detail-root",{dark:m.value}])},[tt(me(t),{peopleGroup:me(c).selectedPeopleGroup,dark:m.value,action:"pray"},null,8,["peopleGroup","dark"])],2)):ve("",!0)]),E.value?(q(),ae("div",RS,[U[3]||(U[3]=R("div",{class:"upg-hud-hint"}," Tap territories on the map or legend rows to add · tap again to remove ",-1)),y.value?(q(),ae("div",NS,[R("span",null,de(y.value)+" territor"+de(y.value===1?"y":"ies")+" ·",1),R("span",MS,de($.value)+" UUPG",1),R("span",{class:Ge(["upg-hud-band",{ok:$.value>=50&&$.value<=100}])},de($.value>=50&&$.value<=100?"✓ 50–100 band":"band 50–100"),3)])):ve("",!0),y.value?(q(),ae("div",IS,de(b.value.map(fe=>fe.name).join(", ")),1)):ve("",!0),y.value?(q(),ae("div",FS,[R("button",{class:"upg-hud-btn make",disabled:mt.value,onClick:RA},de(me(ue)("buttons.prayerList")),9,OS),R("button",{class:"upg-hud-btn make",disabled:mt.value,onClick:NA},de(me(ue)("buttons.posterMap")),9,DS),R("button",{class:"upg-hud-btn clear",onClick:ie},de(me(ue)("buttons.clearSelection")),1)])):ve("",!0),y.value?(q(),ae("div",GS,de(T.value),1)):ve("",!0)])):ve("",!0),R("div",zS,de(d.value),1)])}}}},Symbol.toStringTag,{value:"Module"})),HS=` +`+i}function qn(e){return String(e??"").normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().trim()}function wS(e){return qn(e).split(/[\s,;]+/).filter(Boolean)}function kS(e={}){const{records:t=[],leafZones:o=[],adm1Counts:n={},iso3Names:a={},countryNameMap:r=null}=e,s=[],i=new Set;for(const u of t){if(!u)continue;const c=u.slug;if(!c||i.has(c))continue;const p=Number(u.latitude),d=Number(u.longitude);if(!Number.isFinite(p)||!Number.isFinite(d))continue;const A=u.name||c;i.add(c),s.push({label:A,kind:"pg",target:{type:"pg",slug:c,lng:d,lat:p},_hay:qn(A)})}for(const u of o){if(!u)continue;const c=u.zoneKey||u.id,p=u.label||c;c&&s.push({label:p,kind:"zone",target:{type:"zone",zoneId:c},_hay:qn(p)})}for(const u of Object.keys(n))s.push({label:u,kind:"territory",target:{type:"territory",shapeName:u},_hay:qn(u)});const l=r||a;for(const u of Object.keys(a)){const c=l&&l[u]||a[u]||u;s.push({label:c,kind:"territory",target:{type:"territory",shapeName:u,iso3:!0},_hay:qn(c)})}return s}const PS={zone:0,territory:1,pg:2};function xS(e={}){const{records:t=[],leafZones:o=[],adm1Counts:n={},iso3Names:a={},countryNameMap:r=null,centroidFor:s=null}=e,i=[];for(const c of t)c&&i.push(c);const l=(c,p,d)=>!p||!Number.isFinite(p[0])||!Number.isFinite(p[1])?null:{name:c,slug:d.__synthSlug,latitude:p[1],longitude:p[0],...d};for(const c of o){if(!c)continue;const p=c.zoneKey||c.id,d=c.label||p;if(!p)continue;const A=typeof s=="function"?s(h=>h&&h.properties&&h.properties.zoneKey===p):null,x=l(d,A,{__upgKind:"zone",__zoneId:p,__synthSlug:`__zone__${p}`});x&&i.push(x)}for(const c of Object.keys(n)){const p=typeof s=="function"?s(A=>A&&A.properties&&A.properties.shapeName===c):null,d=l(c,p,{__upgKind:"territory",__shapeName:c,__synthSlug:`__terr__${c}`});d&&i.push(d)}const u=r||a;for(const c of Object.keys(a)){const p=u&&u[c]||a[c]||c,d=typeof s=="function"?s(x=>x&&x.properties&&x.properties.iso3===c):null,A=l(p,d,{__upgKind:"territory",__shapeName:c,__synthSlug:`__terr__${c}`});A&&i.push(A)}return i}function Tg(e,t,o={}){const n=o.limit??8,a=wS(t);if(!a.length)return[];const r=a[0],s=[];for(const i of e){let l=!0;for(const p of a)if(!i._hay.includes(p)){l=!1;break}if(!l)continue;const u=i._hay.startsWith(r)?0:1,c=i._hay===qn(t)?-1:0;s.push({e:i,starts:u,exact:c,kr:PS[i.kind]??9,len:i._hay.length})}return s.sort((i,l)=>i.exact-l.exact||i.starts-l.starts||i.kr-l.kr||i.len-l.len),s.slice(0,n).map(i=>i.e)}const Eg=new Set;function SS(e,t){var a,r;const o=e.getSource(t);if(!o)return[];let n=o._data??((r=(a=o.serialize)==null?void 0:a.call(o))==null?void 0:r.data);if(n&&typeof n=="object"&&!Array.isArray(n)){if(n.geojson!==void 0)n=n.geojson;else if(n.url!==void 0)return Eg.has(t)||(Eg.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 n?Array.isArray(n==null?void 0:n.features)?n.features:(n==null?void 0:n.type)==="Feature"?[n]:[]:[]}const AS={class:"upg-root"},LS={key:0,class:"upg-map-err"},CS={class:"upg-legend-desktop-slot"},TS={class:"upg-legend-mobile-slot"},ES={class:"upg-detail-desktop-slot"},RS={key:4,class:"upg-hud"},NS={key:0,class:"upg-hud-head"},MS={class:"upg-hud-total"},IS={key:1,class:"upg-hud-names"},FS={key:2,class:"upg-hud-actions"},OS=["disabled"],DS=["disabled"],GS={key:3,class:"upg-hud-flash"},zS={class:"upg-status"},$l="upg-search",Rg=1,BS="people-groups",Ng=8,_l=123,US=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"upg-100-list",setup(e){const t=Ou(()=>$t(()=>Promise.resolve().then(()=>dx),void 0)),o=He("mapboxToken",be("")),n=He("profileConfig",be(null));function a(){var N,U;return((N=n.value)==null?void 0:N.instanceId)||((U=n.value)==null?void 0:U.profile)||"upg-100-list"}const r=nS(n),s=r==="maplibre",i=Q(()=>{var N;return((N=n==null?void 0:n.value)==null?void 0:N.search)===!1?!1:r==="mapbox"}),l=Q(()=>{var U;const N=(U=n.value)==null?void 0:U.edgeScrollAffordance;return N==null?!0:!(N===!1||N==="false")}),u=He("dataStore",null),c=He("uiStore",null),p=be(null),d=be("loading…"),A=be(""),x=xn([]),h=be(null),g=xn(null),m=be(!1),f=V1("my-upg-100-list");f.theme.value="light",q1(f);const b=be([]),$=Q(()=>b.value.reduce((N,U)=>N+(Number(U.count)||0),0)),y=Q(()=>b.value.length),T=be("");let P=null;const E=be(!1);function v(N){const U=N===void 0?!E.value:!!N;return U===E.value||(E.value=U,L&&(L.getCanvas().style.cursor=""),S()),U}function j(){v()}nt([E,m],()=>{jt(()=>ot())});function re(N){if(!N)return;const U=b.value,Y=U.findIndex(fe=>fe.key===N.key);Y>=0?b.value=U.filter((fe,Le)=>Le!==Y):b.value=[...U,N],S(),T.value=""}const Z=be(""),G=be("");function pe(N){const U=/^#?([0-9a-fA-F]{6})$/.exec(String(N||"").trim());if(!U)return;const Y="#"+U[1].toLowerCase();Z.value=Z.value===Y?"":Y,S()}const I=be(null),M=[{id:"upg100Region",label:"Region",info:"Region — sort the UPG-100 lists by world area (Africa, India, Middle East, Deaf, …). Counts are the UUPGs and population summed across every list beneath it."},{id:"upg100Zone",label:"UPG-100 Lists",info:"UPG-100 Lists — each one is a prayer list of the unreached people groups in an area, and is what the map paints and colours. Every list prints as its own packet."}];let W=[],L=null,D=null,K=[],ne=null,ce=null,xe=null;const $e=typeof window<"u"&&window.MAP_APP_API_URL||void 0||"",{locale:Be,t:ue}=St(),he=Q(()=>ue("legend.title.upg100List")),le=Q(()=>ue("search.upg100Placeholder"));Tt(`.upg-root{position:absolute;inset:0;background:#0a1410;color:#e5e7eb;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-status{position:absolute;bottom:10px;right:10px;z-index:5;font:10px/1 ui-monospace,monospace;color:#9aa7b8;background:rgba(10,14,21,.82);padding:6px 10px;border-radius:8px}.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-hud{position:absolute;bottom:34px;right: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: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-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 Se(N){const U=[];for(const Y of N)U.push(Y.zoneKey,_S(Y.zoneKey,Y.color));return["match",["get","zoneKey"],...U,"#9ca3af"]}function V(){if(L.getSource("tapestry")&&L.getLayer("tapestry-fill")&&L.getLayer("tapestry-line"))return;L.getSource("tapestry")||L.addSource("tapestry",{type:"geojson",data:D});const N=m.value?.45:.3,U=m.value?.65:.45;if(L.getLayer("tapestry-fill")||L.addLayer({id:"tapestry-fill",type:"fill",source:"tapestry",paint:{"fill-color":ne,"fill-opacity":["case",["==",["get","zoneKey"],"deaf"],N,U]}}),L.getLayer("tapestry-line")||L.addLayer({id:"tapestry-line",type:"line",source:"tapestry",paint:{"line-color":ne,"line-width":1.2,"line-opacity":.9}}),on){const Y=on;jt(()=>{on===Y&&Ha(Y)})}}function ye(){!L||!L.getSource("tapestry")||L.getLayer("upg-sel-fill")||(L.addLayer({id:"upg-sel-fill",type:"fill",source:"tapestry",filter:["boolean",!1],paint:{"fill-color":"#f59e0b","fill-opacity":.28}}),L.addLayer({id:"upg-sel-line",type:"line",source:"tapestry",filter:["boolean",!1],paint:{"line-color":"#fbbf24","line-width":2.4,"line-opacity":.95}}))}function _(){const N=[],U=[],Y=[];for(const Le of b.value)Le.kind==="adm1"?N.push(Le.name):Le.kind==="adm0"?U.push(Le.key.slice(5)):Le.kind==="zone"&&Y.push(Le.key.slice(5));const fe=[];return N.length&&fe.push(["in",["get","shapeName"],["literal",N]]),U.length&&fe.push(["in",["get","iso3"],["literal",U]]),Y.length&&fe.push(["in",["get","zoneKey"],["literal",Y]]),fe.length?fe.length===1?fe[0]:["any",...fe]:["boolean",!1]}function S(){if(ot(),!L||!L.getLayer("upg-sel-fill"))return;const N=E.value?_():["boolean",!1];L.setFilter("upg-sel-fill",N),L.setFilter("upg-sel-line",N);const U=Z.value;L.setPaintProperty("upg-sel-fill","fill-color",U||"#f59e0b"),L.setPaintProperty("upg-sel-fill","fill-opacity",U?.55:.28),L.setPaintProperty("upg-sel-line","line-color",U||"#fbbf24")}let C=null,H=!1;function oe(){if(!(!L||!L.getLayer("tapestry-fill"))){if(C)try{L.off("click","tapestry-fill",C)}catch{}C=N=>{const U=N&&N.features&&N.features[0];if(U&&E.value){const Y=Cg(U.properties,{nameMap:P});if(!Y){console.warn("[batch-select] clicked feature has no shapeName/iso3",U.properties);return}Y.count==null&&console.warn("[batch-select] no UUPG count for territory",Y.name,U.properties),re(Y)}},L.on("click","tapestry-fill",C),H||(L.on("mouseenter","tapestry-fill",()=>{L&&(L.getCanvas().style.cursor=E.value?"crosshair":"")}),L.on("mouseleave","tapestry-fill",()=>{L&&(L.getCanvas().style.cursor="")}),H=!0)}}function ie(){b.value=[],T.value="",Z.value="",G.value="",S()}function se(N){if(u&&typeof u.cacheSourceData=="function"){const U=xS({records:N,leafZones:K,adm1Counts:rs,iso3Names:Ga,countryNameMap:P,centroidFor:Y=>{const fe=O(Y);return fe?[(fe[0][0]+fe[1][0])/2,(fe[0][1]+fe[1][1])/2]:null}});u.cacheSourceData($l,{normalizedData:U})}W=kS({records:N,leafZones:K,adm1Counts:rs,iso3Names:Ga,countryNameMap:P}),typeof window<"u"&&(window.__UPG_SEARCH__={size:()=>W.length,counts:()=>{const U={pg:0,zone:0,territory:0};for(const Y of W)U[Y.kind]=(U[Y.kind]||0)+1;return U},query:U=>Tg(W,U,{limit:Ng}).map(Y=>({label:Y.label,kind:Y.kind,target:Y.target})),select:U=>{const Y=Tg(W,U,{limit:Ng})[0];return Y?(B(Y.target),{label:Y.label,kind:Y.kind,target:Y.target}):null},feedSize:()=>{const U=u&&u.sources&&u.sources[$l];return U&&Array.isArray(U.features)&&U.features.length||0},localGeocoder:U=>{const Y=I.value&&I.value.geocoder,fe=Y&&Y.options&&Y.options.localGeocoder;return fe?fe(U).map(Le=>Le&&Le.place_name):null}},(window.__UPG_SEARCHES__||(window.__UPG_SEARCHES__={}))[a()]=window.__UPG_SEARCH__)}function ge(N){const U=N&&N.properties||{},Y=U.__upgKind;if(Y==="zone")X(U.__zoneId);else if(Y==="territory")ee(U.__shapeName);else{const fe=N&&N.geometry,Le=fe&&Array.isArray(fe.coordinates)?fe.coordinates:null;Le&&Number.isFinite(Le[0])&&Number.isFinite(Le[1])&&L&&L.flyTo({center:[Le[0],Le[1]],zoom:6,duration:800}),z(U.slug)}}function w(N){if(!N||!L)return;const U=new Set(N.memberIds||[]);if(!U.size)return;let Y=[];try{Y=L.querySourceFeatures("upg").filter(Ze=>{const ke=Ze.properties||{};return U.has(ke.slug)||U.has(ke.id)||U.has(ke.peopleGroupId)})}catch{return}if(!Y.length)return;let fe=180,Le=90,je=-180,Ve=-90,De=!1;for(const Ze of Y){const ke=Ze.geometry&&Ze.geometry.coordinates;!Array.isArray(ke)||!Number.isFinite(ke[0])||!Number.isFinite(ke[1])||(ke[0]je&&(je=ke[0]),ke[1]Ve&&(Ve=ke[1]),De=!0)}De&&L.fitBounds([[fe,Le],[je,Ve]],{padding:60,duration:800,maxZoom:6})}function k(){Yn(null),c&&typeof c.selectPeopleGroup=="function"&&c.selectPeopleGroup(null)}function B(N){!N||!L||(N.type==="pg"?(Number.isFinite(N.lng)&&Number.isFinite(N.lat)&&L.flyTo({center:[N.lng,N.lat],zoom:6,duration:800}),z(N.slug)):N.type==="zone"?X(N.zoneId):N.type==="territory"&&ee(N.shapeName))}function z(N){if(!N||!c||typeof c.selectPeopleGroup!="function")return;const Y=SS(L,"upg").find(fe=>fe.properties&&fe.properties.slug===N);Y&&c.selectPeopleGroup(Y)}function X(N){if(!N||!L||!D)return;const U=O(Y=>Y.properties&&Y.properties.zoneKey===N);U&&L.fitBounds(U,{padding:40,duration:800,maxZoom:6})}function ee(N){if(!N||!L||!D)return;const U=O(Y=>{const fe=Y.properties||{};return fe.shapeName===N||fe.iso3===N});U&&L.fitBounds(U,{padding:40,duration:800,maxZoom:6})}function O(N){let U=180,Y=90,fe=-180,Le=-90,je=!1;const Ve=De=>{if(typeof De[0]=="number"){const[Ze,ke]=De;Zefe&&(fe=Ze),keLe&&(Le=ke),je=!0;return}for(const Ze of De)Ve(Ze)};for(const De of D.features)N(De)&&Ve(De.geometry.coordinates);return je?[[U,Y],[fe,Le]]:null}function J(N){const U=new Set,Y=fe=>{fe.children&&fe.children.length?fe.children.forEach(Y):U.add(fe.zoneKey??fe.id)};return Y(N),U}let we=null;function Ee(N){if(![...J(N)].length)return;const Y=[],fe=De=>{De.children&&De.children.length?De.children.forEach(fe):Y.push(De)};fe(N);const Le=b.value,je=new Set(Le.filter(De=>De.kind==="zone").map(De=>De.key));if(Y.every(De=>je.has("zone:"+(De.zoneKey??De.id)))){const De=new Set(Y.map(Ze=>"zone:"+(Ze.zoneKey??Ze.id)));b.value=Le.filter(Ze=>!De.has(Ze.key))}else{const De=Y.filter(Ze=>!je.has("zone:"+(Ze.zoneKey??Ze.id))).map(Ze=>({key:"zone:"+(Ze.zoneKey??Ze.id),name:Ze.label||Ze.id,count:Number(Ze.count)||0,kind:"zone"}));b.value=[...Le,...De]}S(),T.value=""}function qe(){const N=new Set;for(const U of b.value)U.kind==="zone"&&N.add(U.key.slice(5));return N}function ft(){const N=new Map,U=Y=>{const fe=J(Y);Y.label&&N.set(Y.label,fe),Y.children&&Y.children.length&&Y.children.forEach(U)};for(const Y of x.value)U(Y);return N}function ot(){if(typeof document>"u")return;const N=document.querySelector("my-upg-100-list-map"),Y=(N&&N.shadowRoot||document).querySelectorAll(".stl-row");if(!Y.length)return;if(!E.value){Y.forEach(Ve=>Ve.classList.remove("upg-batch-row"));return}const fe=qe(),Le=ft(),je=m.value;Y.forEach(Ve=>{const De=Ve.querySelector(".stl-name"),Ze=De?De.textContent.trim():"",ke=Ze&&Le.get(Ze),Ue=!!(ke&&ke.size&&[...ke].every(it=>fe.has(it)));Ve.classList.toggle("upg-batch-row",Ue),Ve.classList.toggle("dark",Ue&&je)})}let vt=null;function eo(){if(typeof document>"u"||vt)return;const N=document.querySelector("my-upg-100-list-map"),Y=(N&&N.shadowRoot||document).querySelector(".stl-rows");Y&&(vt=new MutationObserver(()=>{requestAnimationFrame(()=>ot())}),vt.observe(Y,{childList:!0,subtree:!0}))}zt("onSemanticTreeSelect",Yn),zt("onLegendExport",Ae);async function Ae(N){const U=h.value;if(!U)return;if(N==="packet"){await Te(U);return}const Y=rt().find(fe=>fe.id===U)||{id:U};await Je.printPoster(Y)}const Je=rp({records:N=>to(N),lang:()=>zo(),label:N=>(N==null?void 0:N.label)||(N==null?void 0:N.id)||"",assetsBase:()=>zn(n.value),downloadPrefix:"doxa-upg-100"});nt(Je.exportState,N=>{if(!N){/packet/i.test(d.value)&&(d.value="");return}if(N.phase==="error"){Pe(ue("messages.packetFailed",{reason:N.message}),4e3);return}d.value=N.phase==="done"?"":`${N.message}…`});async function to(N){if(!$e)throw new Error("no API configured");const Y=await fetch(`${$e}/api/people-groups/list?fields=slug,name,country_code,population,religion,image_url&lang=${zo()}`,{cache:"no-store"});if(!Y.ok)throw new Error(`people-groups fetch failed (${Y.status})`);const fe=Ea(await Ca(Ra(await Y.json()),n));let Le;if(N.selector&&N.selector.type==="pg_slugs")Le=new Set(N.selector.values||[]);else{const{evaluate:je}=await $t(async()=>{const{evaluate:Ve}=await Promise.resolve().then(()=>Si);return{evaluate:Ve}},void 0);Le=new Set(je(N.selector,fe))}return fe.filter(je=>Le.has(je.slug)).sort((je,Ve)=>String(je.name).localeCompare(String(Ve.name),zo()))}async function F(N,U){try{const Y=zn(n.value),fe=await(await fetch(`${Y}/posters/${N}.html`,{cache:"force-cache"})).text(),Le=fe.match(//);return Le?`
${Le[0]}
`:""}catch{return""}}function te(N,U,Y){N.value=U,setTimeout(()=>{N.value===U&&(N.value="")},Y)}const Pe=(N,U)=>te(d,N,U);async function Te(N){const U=rt().find(je=>je.id===N);if(!U)return;const[{createPacketRenderer:Y},fe]=await Promise.all([$t(()=>Promise.resolve().then(()=>Pl),void 0),$t(()=>Promise.resolve().then(()=>Ba),void 0).then(je=>je.default||je)]),Le=Y({strings:fe,lang:zo()});await Je.printPacket(U,{mapSvg:await F(N,Le),funnel:await Me()})}function Re(){return gp(Ur(n))}function rt(){const N=Re();return[...N.lists||[],...N.asia_lists||[],...N.uncovered_lists||[]]}async function Me(){var N;try{const U=(await $t(async()=>{const{default:je}=await Promise.resolve().then(()=>TA);return{default:je}},void 0)).default;if(!U||!Array.isArray(U.steps)||!U.steps.length)return null;const Y=Ur(n),fe=Number(U.steps[U.steps.length-1].groups)||0;if(Y===La)return{...U,listCount:rt().length,listTotal:fe};let Le=0;try{const je=zn(n.value),Ve=await fetch(`${je}/people-groups/lists/${Y}.json`);if(Ve.ok){const De=await Ve.json();Le=Number((N=De==null?void 0:De.counts)==null?void 0:N.doxa)||(Array.isArray(De==null?void 0:De.slugs)?De.slugs.length:0)}}catch{}return{...U,listTotal:Le,listId:Y,listLabel:(op(Y)||{}).label||Y}}catch{return null}}const mt=be(!1);function At(){const N=b.value.filter(Y=>Y.kind==="zone").map(Y=>String(Y.key).replace(/^zone:/,"")),U=new Map(rt().map(Y=>[Y.id,Y]));return N.map(Y=>U.get(Y)).filter(Boolean)}let Wt=null;async function xl(){if(!Wt){const N=await $t(()=>Promise.resolve().then(()=>Ba),void 0).then(U=>U.default||U);Wt={...N.en||{},...N[zo()]||{}}}return Wt}function th(N,U){return N?String(N).replace(/\{(\w+)\}/g,(Y,fe)=>U[fe]!=null?String(U[fe]):Y):null}async function EA(){const N=At();if(!N.length)throw new Error("nothing selected");if(!$e)throw new Error("no API configured");const Y=await fetch(`${$e}/api/people-groups/list?fields=slug,name,country_code,population,religion,image_url&lang=${zo()}`,{cache:"no-store"});if(!Y.ok)throw new Error(`people-groups fetch failed (${Y.status})`);const fe=Ea(await Ca(Ra(await Y.json()),n)),{evaluate:Le}=await $t(async()=>{const{evaluate:Ue}=await Promise.resolve().then(()=>Si);return{evaluate:Ue}},void 0),je=new Set;for(const Ue of N)if(Ue.selector&&Ue.selector.type==="pg_slugs")for(const it of Ue.selector.values||[])je.add(it);else for(const it of Le(Ue.selector,fe))je.add(it);const Ve=N.map(Ue=>Ue.label||Ue.id),De=await xl(),Ze=(Ue,it)=>th(De.zone_join,{a:Ue,b:it})??`${Ue} + ${it}`;return{id:"selection",label:Ve.length<=3?Ve.reduce(Ze):th(De.zone_join_more,{a:Ve.slice(0,2).reduce(Ze),n:Ve.length-2})??`${Ve.slice(0,2).join(" + ")} +${Ve.length-2} more`,count:je.size,selector:{type:"pg_slugs",values:[...je]}}}async function RA(){if(!mt.value){mt.value=!0;try{const N=await EA(),[{createPacketRenderer:U},Y]=await Promise.all([$t(()=>Promise.resolve().then(()=>Pl),void 0),$t(()=>Promise.resolve().then(()=>Ba),void 0).then(De=>De.default||De)]),fe=U({strings:Y,lang:zo()}),Le=At(),je=Le.length===1?await F(Le[0].id,fe):"",Ve=await Me();await Je.printPacket(N,{mapSvg:je,funnel:Ve&&Le.length===1?Ve:Ve?{...Ve,listCount:0}:null})}catch(N){Pe(ue("messages.selectionPacketFailed",{reason:String((N==null?void 0:N.message)||N).slice(0,90)}),4e3)}finally{mt.value=!1}}}async function NA(){if(!mt.value){mt.value=!0;try{const N=At();if(!N.length)throw new Error("nothing selected");if(N.length>1){Pe(ue("messages.posterOneTerritory",{count:N.length}),5e3);return}await Je.printPoster(N[0])}catch(N){Pe(ue("messages.selectionPosterFailed",{reason:String((N==null?void 0:N.message)||N).slice(0,90)}),4e3)}finally{mt.value=!1}}}function zo(){const N=Be&&(Be.value??Be);return typeof N=="string"&&N||"en"}function Yn(N){if(!L||!L.getLayer("tapestry-fill"))return!1;if(E.value)return N&&Ee(N),!0;if(!N)return we=null,h.value=null,L.setFilter("tapestry-fill",null),L.setFilter("tapestry-line",null),L.setPaintProperty("upg-pins","circle-opacity",1),!0;we=N;const U=[...J(N)];h.value=U.length===1?U[0]:N.id??null;const Y=["in",["get","zoneKey"],["literal",U]];L.setFilter("tapestry-fill",Y),L.setFilter("tapestry-line",Y),L.getLayer("upg-pins")&&L.setPaintProperty("upg-pins","circle-opacity",["case",["in",["get","zoneKey"],["literal",U]],.95,.05]);const fe=O(Le=>U.includes(Le.properties.zoneKey));return fe&&L.fitBounds(fe,{padding:40,duration:700,maxZoom:6}),!0}function Sl(){L&&(typeof xe=="function"&&xe(),D&&(V(),ye(),oe(),S(),h.value&&L.getLayer("tapestry-fill")&&Yn(we)))}function MA(){L&&(m.value=!m.value,f.theme.value=m.value?"dark":"light",L.setStyle(m.value?fl("ink",r).style||"mapbox://styles/mapbox/dark-v11":fl("paper",r).style||"mapbox://styles/mapbox/light-v11"),L.once("style.load",Sl))}function oh(){!L||!L.getLayer("upg-pins")||(L.on("click","upg-pins",N=>{const U=N&&N.features&&N.features[0];U&&c&&typeof c.selectPeopleGroup=="function"&&c.selectPeopleGroup(U)}),L.on("mouseenter","upg-pins",()=>{L&&(L.getCanvas().style.cursor="pointer")}),L.on("mouseleave","upg-pins",()=>{L&&(L.getCanvas().style.cursor="")}))}let Ua=null,on,Jn=null;function is(N,U){var Y,fe,Le;try{const je=(Le=(fe=(Y=p.value)==null?void 0:Y.getRootNode)==null?void 0:fe.call(Y))==null?void 0:Le.host;if(!je)return;je.setAttribute("data-doxa-select-zone-state",N),U&&je.setAttribute("data-doxa-select-zone-applied",String(U))}catch{}}function Ha(N){if(!N)return Yn(null),on=void 0,is("cleared",""),!0;const U=nh(x.value,N);return U?Yn(U)?(on=void 0,is("applied",N),!0):(on=N,is("applied-but-no-selection",N),!1):(on=N,is("unresolved",N),!1)}function IA(N){var Y;const U=((Y=N==null?void 0:N.detail)==null?void 0:Y.listId)??null;Ha(U)}function nh(N,U){for(const Y of N||[]){if((Y.zoneKey||Y.id)===U)return Y;const fe=Y.children&&nh(Y.children,U);if(fe)return fe}return null}function FA(){const N=Re(),U=bl(N,{deafCount:_l});x.value=U,K=xg(U);const Y={};for(const fe of N.lists||[])Y[fe.id]=fe.selector;for(const fe of N.asia_lists||[])Y[fe.id]=fe.selector;for(const fe of N.uncovered_lists||[])Y[fe.id]=fe.selector;Y.deaf={type:"affinity_bloc",rop1:"A017"};for(const fe of K)fe.selector=Y[fe.id];ne=Se(K)}async function ah(){if($e)try{const U=await fetch(`${$e}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${zo()}`,{cache:"no-store"});if(!U.ok)throw new Error(`list ${U.status}`);const Y=Ea(await Ca(Ra(await U.json()),n));P=Lg(Y),x.value=bl(Re(),{deafCount:_l,records:Y})}catch{}}so(async()=>{var Le,je,Ve,De,Ze;FA();try{await uS(r)}catch{}const N=ml(r);N&&cS(N);const U=(o==null?void 0:o.value)||((Le=n==null?void 0:n.value)==null?void 0:Le.tk)||"";if(!N){console.warn(`[upg-100-list] ${r} 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.`),d.value=`⚠ ${ue("messages.engineNotLoaded")}`,A.value=ue("messages.engineNotLoadedDetail",{engine:s?"MapLibre":"Mapbox"}),ah();return}if(!s){if(!U){d.value="⚠ no mapbox token",A.value="No Mapbox token configured. The list and legend are unaffected.",ah();return}N.accessToken=U}try{const ke=kg(r);ke&&await dS(p.value,ke)}catch{}try{const ke=!s&&p.value&&p.value.getRootNode();if(ke instanceof ShadowRoot){const Ue=kg("mapbox");if(Ue&&!ke.querySelector(`link[href="${Ue}"]`)){const it=document.createElement("link");it.rel="stylesheet",it.href=Ue,ke.prepend(it)}}}catch{}L=new N.Map({container:p.value,style:fl("paper",r).style||"mapbox://styles/mapbox/light-v11",center:[35,20],zoom:1.5,projection:"mercator"}),g.value=L,ce=sS(((je=p.value)==null?void 0:je.parentElement)||null,{enabled:l.value}),typeof window<"u"&&(window.__UPG_MAP__=L,(window.__UPG_MAPS__||(window.__UPG_MAPS__={}))[a()]=L),window.__UPG_SELECT__={get list(){return b.value.map(ke=>({...ke}))},get total(){return $.value},get count(){return y.value},get color(){return Z.value},get batchMode(){return E.value},setColor:ke=>pe(ke),setBatchMode:ke=>v(ke),clipboardText:()=>vS(b.value,{color:Z.value}),clear:()=>ie(),toggleByProps:ke=>{const Ue=Cg(ke,{nameMap:P});return Ue?(re(Ue),{...Ue}):null},toggleLegendRow:ke=>{const Ue=nn=>{for(const bt of nn){if(bt.label===ke)return bt;if(bt.children&&bt.children.length){const Dt=Ue(bt.children);if(Dt)return Dt}}return null},it=Ue(x.value);return it?(Ee(it),{label:it.label,zoneKeys:[...J(it)]}):null},markedLegendRows:()=>{if(typeof document>"u")return[];const ke=document.querySelector("my-upg-100-list-map");return[...(ke&&ke.shadowRoot||document).querySelectorAll(".stl-row.upg-batch-row .stl-name")].map(it=>it.textContent.trim())},highlightFeatureCount:()=>{if(!L||!D||!L.getLayer("upg-sel-fill"))return-1;const ke=new Set,Ue=new Set,it=new Set;for(const bt of b.value)bt.kind==="zone"?ke.add(bt.key.slice(5)):bt.kind==="adm1"?Ue.add(bt.name):bt.kind==="adm0"&&it.add(bt.key.slice(5));let nn=0;for(const bt of D.features){const Dt=bt.properties||{};(ke.has(Dt.zoneKey)||Ue.has(Dt.shapeName)||it.has(Dt.iso3))&&nn++}return nn},zoneKeysForRow:ke=>{const Ue=nn=>{for(const bt of nn){if(bt.label===ke)return bt;if(bt.children&&bt.children.length){const Dt=Ue(bt.children);if(Dt)return Dt}}return null},it=Ue(x.value);return it?[...J(it)]:null}},(window.__UPG_SELECTS__||(window.__UPG_SELECTS__={}))[a()]=window.__UPG_SELECT__;try{d.value="loading boundaries…";const ke=Ke=>`${zn(n.value)}/boundaries/${Ke}`,Ue=Ke=>fetch(ke(Ke)).then(Et=>{if(!Et.ok)throw new Error(`boundary fetch ${Et.status} ${Ke}`);return Et.json()});if(!$e)throw new Error("No API base configured — set window.MAP_APP_API_URL or VITE_API_BASE_URL. Failing closed (no default host).");const nn=fetch(`${$e}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${zo()}`).then(Ke=>{if(!Ke.ok)throw new Error(`list ${Ke.status}`);return Ke.json()}),bt={adm0:Ue("world-adm0-web.geojson"),adm1Chn:Ue("gb-CHN-ADM1.geojson"),adm1Ind:Ue("gb-IND-ADM1-web.geojson")};d.value="fetching 2106 UUPGs…";const Dt=Ea(await Ca(Ra(await nn),n));P=Lg(Dt),x.value=bl(Re(),{deafCount:_l,records:Dt});const Al=[],ja={},{evaluate:DA}=await $t(async()=>{const{evaluate:Ke}=await Promise.resolve().then(()=>Si);return{evaluate:Ke}},void 0);for(const Ke of K)if(Ke.selector&&Ke.selector.type==="pg_slugs")for(const Et of Ke.selector.values||[])Et in ja||(ja[Et]=Ke.zoneKey);else try{for(const Et of DA(Ke.selector,Dt))Et in ja||(ja[Et]=Ke.zoneKey)}catch(Et){console.warn("zone selector skipped",Ke.id,Et&&Et.message)}for(const Ke of Dt){const Et=Number(Ke.latitude),Cl=Number(Ke.longitude);!isFinite(Et)||!isFinite(Cl)||Al.push({type:"Feature",geometry:{type:"Point",coordinates:[Cl,Et]},properties:{slug:Ke.slug,zoneKey:ja[Ke.slug]||"",name:Ke.name||Ke.slug||"",population:Ke.population??0,countryName:Ke.country_code_label||"",country:Ke.country_code||""}})}const GA=sn({type:"FeatureCollection",features:Al});xe=()=>{if(!(L.getSource("upg")&&L.getLayer("upg-pins"))){if(L.getSource("upg")||L.addSource("upg",{type:"geojson",data:GA}),L.getLayer("upg-pins")){oh();return}L.addLayer({id:"upg-pins",type:"circle",source:"upg",paint:{"circle-radius":["interpolate",["linear"],["zoom"],1,5,4,6.5,8,9],"circle-color":ne,"circle-opacity":1,"circle-stroke-width":["interpolate",["linear"],["zoom"],1,1.8,8,2],"circle-stroke-color":"rgba(15,20,25,0.9)"}}),oh()}};const rh=()=>{try{Sl()}catch(Ke){console.warn("early pin paint skipped",Ke&&Ke.message)}};L.isStyleLoaded()?rh():L.once("style.load",rh),d.value="loading boundaries…";const[zA,BA]=await Promise.all([bt.adm0,bt.adm1Chn]),UA=await bt.adm1Ind,{tapestry:HA,perZone:jA}=yS(K,{records:Dt,adm0:zA,adm1Ind:UA,adm1Chn:BA});D=sn(HA),se(Dt);let Ll=!0;const Zn=()=>{Ll&&(Ll=!1,L.off("style.load",Zn),L.off("idle",Zn),Sl())};if(L.isStyleLoaded())Zn();else{L.once("style.load",Zn),L.once("idle",Zn);const Ke=setInterval(()=>{if(!Ll||!L){clearInterval(Ke);return}let Et=!1;try{Et=L.isStyleLoaded()}catch{clearInterval(Ke);return}Et&&(clearInterval(Ke),Zn())},120);setTimeout(()=>clearInterval(Ke),15e3)}const sh=[...jA.entries()].filter(([Ke])=>Ke!=="deaf"),KA=sh.filter(([,Ke])=>Ke>=1).length;d.value=`${D.features.length} polys · ${KA}/${sh.length} zones · ${Al.length} pins`}catch(ke){d.value="⚠ "+(ke&&ke.message?ke.message:String(ke))}let Y=0;const fe=()=>{const ke=typeof document<"u"&&document.querySelector("my-upg-100-list-map"),Ue=ke&&ke.shadowRoot||(typeof document<"u"?document:null);if(Ue&&Ue.querySelector(".stl-rows")){eo(),ot();return}Y++<40&&setTimeout(fe,250)};fe();{const ke=(Ze=(De=(Ve=p.value)==null?void 0:Ve.getRootNode)==null?void 0:De.call(Ve))==null?void 0:Ze.host;if(ke){Ua=IA,ke.addEventListener("doxa:select-zone",Ua);const Ue=ke.getAttribute("select-zone");Ue&&Ha(Ue),Jn=new MutationObserver(()=>{Ha(ke.getAttribute("select-zone")||null)}),Jn.observe(ke,{attributes:!0,attributeFilter:["select-zone"]})}}});const OA=()=>{var N,U,Y;try{return((Y=(U=(N=p.value)==null?void 0:N.getRootNode)==null?void 0:U.call(N))==null?void 0:Y.host)||null}catch{return null}};return nt([x,g],()=>{jt(()=>{var U;const N=((U=OA())==null?void 0:U.getAttribute("select-zone"))||on||null;N&&Ha(N)})}),Zt(()=>{var N,U,Y;if(Jn==null||Jn.disconnect(),Jn=null,Ua){const fe=(Y=(U=(N=p.value)==null?void 0:N.getRootNode)==null?void 0:U.call(N))==null?void 0:Y.host;fe==null||fe.removeEventListener("doxa:select-zone",Ua),Ua=null}if(vt){try{vt.disconnect()}catch{}vt=null}if(ce){try{ce()}catch{}ce=null}L&&(L.remove(),L=null),D=null}),(N,U)=>{var Y;return q(),ae("div",AS,[R("div",{ref_key:"mapEl",ref:p,class:"upg-map"},null,512),A.value?(q(),ae("div",LS,[R("strong",null,de(me(ue)("messages.mapUnavailable")),1),kt(de(A.value),1)])):ve("",!0),l.value?(q(),ae(ze,{key:1},[U[0]||(U[0]=R("div",{class:"map-scroll-edge map-scroll-edge--left"},null,-1)),U[1]||(U[1]=R("div",{class:"map-scroll-edge map-scroll-edge--right"},null,-1))],64)):ve("",!0),g.value&&i.value?(q(),dt(eS,{key:2,ref_key:"geocoderRef",ref:I,"map-instance":g.value,"access-token":me(o)||((Y=me(n))==null?void 0:Y.tk)||"","data-source-id":$l,"is-dark":m.value,placeholder:le.value,"active-context":BS,onPeopleGroupResult:ge,onAggregateResult:w,onClear:k},null,8,["map-instance","access-token","is-dark","placeholder"])):ve("",!0),g.value?(q(),dt(Ax,{key:3,"has-geocoder":i.value},{default:Jt(()=>[tt(Cx,{map:g.value,"is-dark":m.value},null,8,["map","is-dark"]),tt(Tx,{map:g.value,"is-dark":m.value},null,8,["map","is-dark"]),tt(Ex,{map:g.value,"is-dark":m.value},null,8,["map","is-dark"]),tt(Mx,{"map-container":p.value,"is-dark":m.value},null,8,["map-container","is-dark"]),tt(Fx,{"is-dark":m.value,onToggle:MA},null,8,["is-dark"]),tt($n,{"is-dark":m.value,active:E.value,class:Ge({"upg-batch-on":E.value}),"aria-pressed":E.value?"true":"false",title:"Batch Select",onClick:j},{default:Jt(()=>[...U[2]||(U[2]=[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"])]),_:1},8,["has-geocoder"])):ve("",!0),R("div",CS,[x.value.length?(q(),dt($p,{key:0,nodes:x.value,tabs:M,"default-tab":Rg,columns:["count","pop"],title:he.value,"export-enabled":!0,onSelect:Yn,onExport:Ae},null,8,["nodes","title"])):ve("",!0)]),R("div",TS,[x.value.length?(q(),dt(Sx,{key:0,"legend-type":"upg-100",nodes:x.value,tabs:M,"default-tab":Rg,columns:["count","pop"],"column-label":"UPG 100",title:he.value,"is-dark":m.value,"popup-action":"pray"},null,8,["nodes","title","is-dark"])):ve("",!0)]),R("div",ES,[me(c)&&me(c).selectedPeopleGroup?(q(),ae("div",{key:0,class:Ge(["upg-detail-panel pg-detail-root",{dark:m.value}])},[tt(me(t),{peopleGroup:me(c).selectedPeopleGroup,dark:m.value,action:"pray"},null,8,["peopleGroup","dark"])],2)):ve("",!0)]),E.value?(q(),ae("div",RS,[U[3]||(U[3]=R("div",{class:"upg-hud-hint"}," Tap territories on the map or legend rows to add · tap again to remove ",-1)),y.value?(q(),ae("div",NS,[R("span",null,de(y.value)+" territor"+de(y.value===1?"y":"ies")+" ·",1),R("span",MS,de($.value)+" UUPG",1),R("span",{class:Ge(["upg-hud-band",{ok:$.value>=50&&$.value<=100}])},de($.value>=50&&$.value<=100?"✓ 50–100 band":"band 50–100"),3)])):ve("",!0),y.value?(q(),ae("div",IS,de(b.value.map(fe=>fe.name).join(", ")),1)):ve("",!0),y.value?(q(),ae("div",FS,[R("button",{class:"upg-hud-btn make",disabled:mt.value,onClick:RA},de(me(ue)("buttons.prayerList")),9,OS),R("button",{class:"upg-hud-btn make",disabled:mt.value,onClick:NA},de(me(ue)("buttons.posterMap")),9,DS),R("button",{class:"upg-hud-btn clear",onClick:ie},de(me(ue)("buttons.clearSelection")),1)])):ve("",!0),y.value?(q(),ae("div",GS,de(T.value),1)):ve("",!0)])):ve("",!0),R("div",zS,de(d.value),1)])}}}},Symbol.toStringTag,{value:"Module"})),HS=` .pane-col{ position:absolute; inset:0; overflow-y:auto; overflow-x:hidden; scroll-snap-type:y mandatory; scroll-behavior:smooth; 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 88d019b5f..934c1a1c4 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 @@ -32,7 +32,7 @@ - + - + - +