diff --git a/public/dx-maps/cities-internet/cities-internet.js b/public/dx-maps/cities-internet/cities-internet.js index c744674a7..b1d283c70 100644 --- a/public/dx-maps/cities-internet/cities-internet.js +++ b/public/dx-maps/cities-internet/cities-internet.js @@ -1169,7 +1169,7 @@ .stl-panel, .stl-collapse-btn svg, .stl-row, .stl-reopen, .stl-chip { transition: none !important; animation: none !important; } .stl-spinner { animation: stl-spin 2.4s steps(8, end) infinite !important; } } -`,"semantic-tree-legend"),(M,Y)=>{var _e,ke,Ne,st;return E(),B(ye,null,[$("div",{class:we(["stl-panel",{closed:!re.value,"fit-content":e.hideTabs}]),"data-theme":((_e=W(p))==null?void 0:_e.theme.value)||"dark"},[$("div",nv,[$("div",{class:we(["stl-titlebar",{"has-progress":!!w.value}])},[$("span",av,[Dn(M.$slots,"title-caret",{},void 0,!0)]),M.$slots["title-caret"]?de("",!0):(E(),B("button",{key:0,class:we(["stl-collapse-btn",{closed:!re.value}]),title:re.value?W(a)("aria.collapseLegend"):W(a)("aria.expandLegend"),"aria-label":re.value?W(a)("aria.collapseLegend"):W(a)("aria.expandLegend"),"aria-expanded":String(re.value),onClick:Y[0]||(Y[0]=Pe=>{re.value=!re.value,u("update:open",re.value)})},[...Y[11]||(Y[11]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,rv)),A.value&&Fe.value?(E(),B(ye,{key:1},[$("span",sv,G(A.value.tabName),1),$("button",{type:"button",class:"stl-tb-up",title:W(a)("legend.a11y.goUp",{label:A.value.node.label}),"aria-label":W(a)("legend.a11y.goUp",{label:A.value.tabName+" "+A.value.node.label}),onClick:ct(pe,["stop"])},[Y[12]||(Y[12]=$("svg",{class:"stl-tb-up-icon",width:"9",height:"9",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[$("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),A.value.node.color?(E(),B("span",{key:0,class:"stl-tb-dot",style:We({background:A.value.node.color})},null,4)):de("",!0),$("span",{class:"stl-tb-text",title:A.value.node.label},G(A.value.node.label),9,lv)],8,iv)],64)):(E(),B("span",cv,G(_.value),1)),e.exportEnabled&&Fe.value?(E(),B("div",uv,[$("button",{type:"button",class:we(["stl-export-btn",{open:oe.value}]),"aria-expanded":oe.value?"true":"false","aria-haspopup":"menu",title:W(a)("legend.exportSelection"),"aria-label":W(a)("legend.exportSelection"),onClick:ct(ge,["stop"])},[Y[13]||(Y[13]=$("svg",{width:"11",height:"11",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true"},[$("path",{d:"M7 1.5V9M7 1.5L4.2 4.3M7 1.5L9.8 4.3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),$("path",{d:"M2 9.5V11.5C2 12.05 2.45 12.5 3 12.5H11C11.55 12.5 12 12.05 12 11.5V9.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)),$("span",dv,G(W(a)("legend.exportButton")),1)],10,pv),oe.value?(E(),B(ye,{key:0},[$("div",{ref_key:"scrimRef",ref:le,style:We(W(ne)),class:"stl-export-backdrop",onClick:Y[1]||(Y[1]=ct(Pe=>oe.value=!1,["stop"]))},null,4),$("div",gv,[$("button",{type:"button",class:"stl-export-item",role:"menuitem",onClick:Y[2]||(Y[2]=ct(Pe=>he("poster"),["stop"]))},[Y[14]||(Y[14]=$("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[$("rect",{x:"2",y:"1.5",width:"8",height:"9",rx:"1",stroke:"currentColor","stroke-width":"1.3"}),$("path",{d:"M4 4.5H8M4 6.5H8M4 8.5H6.5",stroke:"currentColor","stroke-width":"1.1","stroke-linecap":"round"})],-1)),$("span",mv,G(W(a)("legend.export.poster")),1)]),e.exportCards?(E(),B("button",{key:0,type:"button",class:"stl-export-item",role:"menuitem",onClick:Y[3]||(Y[3]=ct(Pe=>he("cards"),["stop"]))},[Y[15]||(Y[15]=$("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[$("rect",{x:"1.5",y:"2.5",width:"6",height:"8",rx:"1",stroke:"currentColor","stroke-width":"1.2"}),$("rect",{x:"4.5",y:"1.5",width:"6",height:"8",rx:"1",stroke:"currentColor","stroke-width":"1.2"})],-1)),$("span",hv,G(W(a)("buttons.cardDeck")),1)])):de("",!0),$("button",{type:"button",class:"stl-export-item",role:"menuitem","aria-expanded":String(H.value),onClick:Y[4]||(Y[4]=ct(Pe=>H.value=!H.value,["stop"]))},[Y[16]||(Y[16]=$("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[$("path",{d:"M3 1.5H7.5L9.5 3.5V10.5H3V1.5Z",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),$("path",{d:"M7.5 1.5V3.5H9.5",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),$("path",{d:"M4.5 6H8M4.5 8H7",stroke:"currentColor","stroke-width":"1.1","stroke-linecap":"round"})],-1)),$("span",_v,G(W(a)("legend.export.packet")),1),$("span",{class:we(["stl-export-caret",{"is-open":H.value}]),"aria-hidden":"true"},"▾",2)],8,fv),H.value?(E(),B("div",{key:1,class:"stl-export-sub",role:"group","aria-label":W(a)("legend.export.packetAria")},[$("p",$v,G(W(a)("legend.export.packetExplain")),1),$("button",{type:"button",class:"stl-export-item stl-export-subitem",role:"menuitem",onClick:Y[5]||(Y[5]=ct(Pe=>he("packet:full"),["stop"]))},[$("span",yv,G(W(a)("legend.export.packetFull")),1)]),$("button",{type:"button",class:"stl-export-item stl-export-subitem",role:"menuitem",onClick:Y[6]||(Y[6]=ct(Pe=>he("packet:lightweight"),["stop"]))},[$("span",vv,G(W(a)("legend.export.packetLightweight")),1)])],8,bv)):de("",!0)])],64)):de("",!0)])):de("",!0),w.value?(E(),Je(cd,{key:4,class:"stl-progress","show-text":!1,covered:w.value.covered,total:w.value.total,segments:w.value.segments,"is-dark":m.value,"fmt-count":xn,onSelectSegment:x},null,8,["covered","total","segments","is-dark"])):de("",!0)],2),e.hideTabs?de("",!0):(E(),B("div",wv,[$("div",kv,[(E(!0),B(ye,null,nt(K.value,(Pe,yt)=>(E(),B("div",{key:Pe.id,class:we(["stl-tab-chip",{active:Oe.value===yt}])},[$("button",{class:"stl-tab",onClick:St=>be(yt)},G(i(Pe)),9,xv),Pe.info?(E(),B("button",{key:0,class:"stl-tab-info",title:l(Pe),onClick:St=>Me(yt,St)},"i",8,Cv)):de("",!0)],2))),128))]),te.value!==null&&((ke=K.value[te.value])!=null&&ke.info)?(E(),B("div",Av,G(l(K.value[te.value])),1)):de("",!0)])),$("div",Pv,[Y[17]||(Y[17]=$("span",{class:"stl-caret-sp"},null,-1)),Y[18]||(Y[18]=$("span",{class:"stl-dot-sp"},null,-1)),$("span",Sv,G(e.columnLabel||(e.hideTabs?e.title:i(K.value[Oe.value])||W(a)("legend.columns.name"))),1),J.value?(E(),B("button",{key:0,class:we(["stl-hdr-num",{active:fe.value==="count"}]),title:W(a)("legend.sortByUpgs"),onClick:Y[7]||(Y[7]=Pe=>C("count"))},[Ie(G(W(a)("legend.columns.upgs"))+" ",1),fe.value==="count"?(E(),B("span",Tv,G(Ae.value==="desc"?"▼":"▲"),1)):de("",!0)],10,Lv)):de("",!0),L.value?(E(),B("button",{key:1,class:we(["stl-hdr-num",{active:fe.value==="pop"}]),title:W(a)("legend.sortByPop"),onClick:Y[8]||(Y[8]=Pe=>C("pop"))},[Ie(G(W(a)("legend.columns.population"))+" ",1),fe.value==="pop"?(E(),B("span",Ov,G(Ae.value==="desc"?"▼":"▲"),1)):de("",!0)],10,Nv)):de("",!0),Y[19]||(Y[19]=$("span",{class:"stl-x-slot"},null,-1))]),$("div",{class:we(["stl-rows",{"has-sel":z.value}]),ref_key:"rowsContainer",ref:at},[(E(!0),B(ye,null,nt(f.value,Pe=>{var yt,St;return E(),B("div",{key:Pe.node.id,class:we(["stl-row",Dw(Pe)]),"data-stl-node-id":Pe.node.id,style:We({"--trunk-color":((yt=Pe.parent)==null?void 0:yt.color)||"#6e7681","--row-color":Pe.node.color||"#73A17F"}),onClick:ao=>D(Pe.node)},[(E(!0),B(ye,null,nt(Pe.trunks,(ao,Bw)=>(E(),B("span",{key:`tr${Bw}`,class:we(["stl-trunk",`stl-trunk-${ao}`])},null,2))),128)),(St=Pe.node.children)!=null&&St.length?(E(),B("button",{key:0,class:we(["stl-caret",{open:Q.value.has(Pe.node.id)}]),"aria-expanded":Q.value.has(Pe.node.id)?"true":"false","aria-label":W(a)(Q.value.has(Pe.node.id)?"legend.a11y.collapseRow":"legend.a11y.expandRow",{label:Pe.node.label}),onClick:ct(ao=>ae(Pe.node.id,ao),["stop"])},[...Y[20]||(Y[20]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,Mv)):(E(),B("span",Ev)),Pe.node.color?(E(),B("span",{key:2,class:"stl-dot",style:We({background:Pe.node.color})},null,4)):(E(),B("span",Iv)),$("span",Rv,G(Pe.node.label),1),J.value?(E(),B("span",Dv,G(xn(Pe.node.count)),1)):de("",!0),L.value?(E(),B("span",Bv,G(kn(Pe.node.pop)),1)):de("",!0),$("span",zv,[Ue.value===Pe.node.id?(E(),B("button",{key:0,class:"stl-x-chip",title:W(a)("legend.a11y.clearSelection"),"aria-label":W(a)("legend.a11y.clearSelection"),onClick:Y[9]||(Y[9]=ct(ao=>$e(ao),["stop"]))},[...Y[21]||(Y[21]=[$("svg",{width:"8",height:"8",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M2 2L10 10M10 2L2 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,Gv)):de("",!0)])],14,Fv)}),128)),S.value&&!f.value.length?(E(),B("div",jv,[Y[22]||(Y[22]=$("span",{class:"stl-spinner"},null,-1)),$("span",null,G(o("legend.loadingRows","Loading {label}…").replace("{label}",((Ne=K.value[Oe.value])==null?void 0:Ne.label)||"rows")),1)])):!f.value.length&&e.nodes.length===0?(E(),B("div",Hv,G(o("legend.loadingData","Loading data…")),1)):f.value.length?de("",!0):(E(),B("div",Uv,G(W(a)("legend.noDataAtThisLevel")),1)),ie.value>0?(E(),B("div",Wv,[Ie(G(o("legend.showingTop","Showing top {n} of {m}").replace("{n}",K.value[Oe.value].topLimit.toLocaleString()).replace("{m}",X.value.length.toLocaleString()))+" — ",1),$("span",qv,G(o("legend.useGeocoderHint","use the geocoder above to find the rest")),1)])):de("",!0)],2),v.value?(E(),Je(xr,{key:1,dark:m.value},null,8,["dark"])):de("",!0)])],10,ov),re.value?de("",!0):(E(),B("button",{key:0,class:"stl-reopen","data-theme":((st=W(p))==null?void 0:st.theme.value)||"dark",title:W(a)("aria.expandLegend"),"aria-label":W(a)("aria.expandLegend"),onClick:Y[10]||(Y[10]=Pe=>{re.value=!0,u("update:open",!0)})},[Y[23]||(Y[23]=$("svg",{class:"stl-reopen-icon",width:"11",height:"11",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M2 4h8M2 6h8M2 8h5",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)),$("span",Vv,[Fe.value?(E(),B(ye,{key:0},[Fe.value.color?(E(),B("span",{key:0,class:"stl-reopen-dot",style:We({background:Fe.value.color})},null,4)):de("",!0),Ie(" "+G(Fe.value.label),1)],64)):(E(),B(ye,{key:1},[Ie(G(_.value),1)],64))]),Y[24]||(Y[24]=$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none",class:"stl-reopen-caret"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],8,Kv))],64)}}},[["styles",[tv]],["__scopeId","data-v-49026e50"]]),Zv="#6b7280";function Jv(){const e=vr(vn.AFFINITY_BLOCK);return e&&e.propertyKey==="affinityBlock"&&e.palette?e.palette:{}}function Xv(e,t){const o=Jv();return e&&o[e]?o[e]:Zv}function Qv(e){return(e==null?void 0:e.properties)||e||{}}function Ii(e){return e&&typeof e=="object"&&"label"in e?e.label||e.value||"":e}function ew(e){var t;return String(e.affinityBlock||Ii((t=e._raw)==null?void 0:t.rop1)||"").trim()}function tw(e){var t;return String(e.affinityBlockLabel||((t=e._raw)!=null&&t.rop1&&typeof e._raw.rop1=="object"?e._raw.rop1.label:"")||"").trim()}function ow(e){var t;return String(e.cluster||Ii((t=e._raw)==null?void 0:t.imb_reg_of_people_2)||"").trim()}function nw(e){var t;return String(e.clusterLabel||((t=e._raw)!=null&&t.imb_reg_of_people_2&&typeof e._raw.imb_reg_of_people_2=="object"?e._raw.imb_reg_of_people_2.label:"")||"").trim()}function aw(e){var t;return String(e.peopleGroup||Ii((t=e._raw)==null?void 0:t.imb_reg_of_people_25)||"").trim()}function rw(e){var t;return String(e.peopleGroupLabel||((t=e._raw)!=null&&t.imb_reg_of_people_25&&typeof e._raw.imb_reg_of_people_25=="object"?e._raw.imb_reg_of_people_25.label:"")||e.name||"").trim()}function sw(e){var t;return String(e.uniqueId||e.slug||((t=e._raw)==null?void 0:t.slug)||"").trim()}function iw(e){var t;return String(e.name||e.displayName||((t=e._raw)==null?void 0:t.name)||"").trim()}function lw(e){var o;const t=Number(e.population??e.populationNum??((o=e._raw)==null?void 0:o.population)??0);return Number.isFinite(t)?t:0}function cw(e){return String(e.countryName||e.country||e.countryIsoLabel||e.countryIso||"").trim()}function uw(e){const t=q(()=>{const r=e&&e.value||[],s=new Map;for(const i of r){const l=Qv(i),c=ew(l),u=tw(l)||c||"— Unknown —",p=ow(l),g=nw(l)||p||"— Unknown —",w=aw(l),_=rw(l)||w||"— Unknown —",m=sw(l),d=iw(l)||m,y=lw(l),b=cw(l);if(!m)continue;let v=s.get(c||"__unknown__");v||(v={code:c,label:u,count:0,pop:0,memberIds:[],clusters:new Map},s.set(c||"__unknown__",v)),v.count+=1,v.pop+=y,v.memberIds.push(m);let k=v.clusters.get(p||"__unknown__");k||(k={code:p,label:g,count:0,pop:0,memberIds:[],peopleGroups:new Map},v.clusters.set(p||"__unknown__",k)),k.count+=1,k.pop+=y,k.memberIds.push(m);let x=k.peopleGroups.get(w||"__unknown__");x||(x={code:w,label:_,count:0,pop:0,memberIds:[],instances:[]},k.peopleGroups.set(w||"__unknown__",x)),x.count+=1,x.pop+=y,x.memberIds.push(m),x.instances.push({id:m,name:d,country:b,pop:y})}return s}),o=r=>r&&r.length?["in",["get","uniqueId"],["literal",r]]:["==",["get","uniqueId"],"__none__"],n=q(()=>{const r=t.value,s=[];for(const i of r.values()){const l=Xv(i.code,i.label),c={id:`bloc:${i.code||i.label}`,label:i.label,color:l,count:i.count,pop:i.pop,filter:o(i.memberIds),children:[]};for(const u of i.clusters.values()){const p={id:`cluster:${i.code}__${u.code||u.label}`,label:`${u.label} (Cluster)`,color:l,count:u.count,pop:u.pop,filter:o(u.memberIds),children:[]};for(const g of u.peopleGroups.values()){const w={id:`pg:${i.code}__${u.code}__${g.code||g.label}`,label:`${g.label} (PG)`,color:l,count:g.count,pop:g.pop,filter:o(g.memberIds),children:[]};g.instances.sort((_,m)=>m.pop-_.pop||_.country.localeCompare(m.country));for(const _ of g.instances)w.children.push({id:`pgic:${_.id}`,label:`${_.country?`${_.name}, ${_.country}`:_.name} (PGIC)`,color:l,count:1,pop:_.pop,filter:["==",["get","uniqueId"],_.id],children:[]});p.children.push(w)}p.children.sort((g,w)=>w.count-g.count||w.pop-g.pop),c.children.push(p)}c.children.sort((u,p)=>p.count-u.count||p.pop-u.pop),s.push(c)}return s.sort((i,l)=>l.count-i.count||l.pop-i.pop),s});function a(r){if(typeof window>"u"||typeof window.CustomEvent!="function")return;if(!r){window.dispatchEvent(new CustomEvent("legend:highlight",{detail:{kind:null}}));return}const s=String(r.id||""),i={kind:null,label:r.label,filterExpr:r.filter};s.startsWith("bloc:")?i.kind="bloc":s.startsWith("cluster:")?i.kind="cluster":s.startsWith("pg:")?i.kind="people-group":s.startsWith("pgic:")&&(i.kind="people-group-in-country"),window.dispatchEvent(new CustomEvent("legend:highlight",{detail:i}))}return{aggregated:t,affinityTree:n,highlight:a}}const pw={africa:"#ff2e2e",asia:"#1a8cff",europe:"#1ee05f","latin_america_&_caribbean":"#FFEB3B",middle_east:"#a83dff","north_america_&_non-spanish_caribbean":"#00e0bd",oceania:"#ff7f11"},dw="#95a5a6";function gw(e){return pw[String(e||"").toLowerCase()]||dw}function mw(e){return(e==null?void 0:e.properties)||e||{}}function hw(e){var o;const t=Number(e.population??e.populationNum??((o=e._raw)==null?void 0:o.population)??0);return Number.isFinite(t)?t:0}function fw(e){var t,o;return String(e.doxaRegion||e.wagfRegion||((o=(t=e._raw)==null?void 0:t.wagf_region)==null?void 0:o.value)||"").trim()}function _w(e){var o;const t=(o=e._raw)==null?void 0:o.wagf_region;return String(e.wagfRegionLabel||e.doxaRegionLabel||(t&&typeof t=="object"?t.label:"")||e.doxaRegion||"").trim()}function bw(e){var t,o;return String(e.wagfBlock||((o=(t=e._raw)==null?void 0:t.wagf_block)==null?void 0:o.value)||"").trim()}function $w(e){var o;const t=(o=e._raw)==null?void 0:o.wagf_block;return String(e.wagfBlockLabel||(t&&typeof t=="object"?t.label:"")||e.wagfBlock||"").trim()}function yw(e){var t,o;return String(e.countryIso||((o=(t=e._raw)==null?void 0:t.country_code)==null?void 0:o.value)||"").trim().toUpperCase()}function vw(e){var o;const t=(o=e._raw)==null?void 0:o.country_code;return String(e.countryIsoLabel||(t&&typeof t=="object"?t.label:"")||e.countryIso||"").trim()}function ww(e){const t=q(()=>{const a=e&&e.value||[],r=new Map;for(const s of a){const i=mw(s),l=fw(i),c=_w(i)||l||"— Unknown —",u=bw(i),p=$w(i)||u||"— Unknown —",g=yw(i),w=vw(i)||g||"— Unknown —",_=hw(i);if(!l||l==="na"||l==="none")continue;let m=r.get(l);if(m||(m={slug:l,label:c,count:0,pop:0,blocks:new Map},r.set(l,m)),m.count+=1,m.pop+=_,!u||u==="na")continue;let d=m.blocks.get(u);if(d||(d={slug:u,label:p,count:0,pop:0,countries:new Map},m.blocks.set(u,d)),d.count+=1,d.pop+=_,!g)continue;let y=d.countries.get(g);y||(y={iso:g,name:w,count:0,pop:0},d.countries.set(g,y)),y.count+=1,y.pop+=_}return r}),o=q(()=>{const a=t.value,r=[];for(const s of a.values()){const i=gw(s.slug),l=[],c=[],u=[...s.blocks.values()].sort((p,g)=>g.pop-p.pop||p.label.localeCompare(g.label));for(const p of u){const g=[],w=[],_=[...p.countries.values()].sort((m,d)=>d.pop-m.pop||m.name.localeCompare(d.name));for(const m of _)g.push(m.iso),l.push(m.iso),w.push({id:`country:${s.slug}__${p.slug}__${m.iso}`,label:m.name,color:i,count:m.count,pop:m.pop,filter:["==",["get","countryIso"],m.iso],isoCodes:[m.iso],children:[]});c.push({id:`block:${s.slug}__${p.slug}`,label:`${p.label} (Bloc)`,color:i,count:p.count,pop:p.pop,filter:["==",["get","wagfBlock"],p.slug],isoCodes:g,children:w})}r.push({id:`region:${s.slug}`,label:`${s.label} (Region)`,color:i,count:s.count,pop:s.pop,filter:["==",["get","doxaRegion"],s.slug],isoCodes:[...new Set(l)],children:c})}return r.sort((s,i)=>i.pop-s.pop||s.label.localeCompare(i.label)),r});function n(a){if(typeof window>"u"||typeof window.CustomEvent!="function")return;if(!a){window.dispatchEvent(new CustomEvent("legend:highlight",{detail:{kind:null}}));return}const r=String(a.id||""),s={kind:null,label:a.label,filterExpr:a.filter};r.startsWith("region:")?s.kind="region":r.startsWith("block:")?s.kind="block":r.startsWith("country:")&&(s.kind="country"),window.dispatchEvent(new CustomEvent("legend:highlight",{detail:s}))}return{aggregated:t,regionsTree:o,highlight:n}}const kw="",xw={class:"legend-sheet-root"},Cw=["src","alt"],Aw={key:0,class:"pull-tab-handle"},Pw=["aria-expanded","aria-label"],Sw=["aria-label"],Lw=["aria-expanded","aria-label"],Tw={class:"collapsed-detail-title"},Nw={class:"legend-content"},Ow=["aria-expanded","aria-label"],Fw=["aria-expanded","aria-label"],wd=80,kd=48,Mw=44,Ew=24,xd="lm-on",Iw="dxmaps:legend-sheet",Cd="--legend-sheet-h",Rw=4e3,Ad=Object.freeze(Object.defineProperty({__proto__:null,default:bo({__name:"LegendMobile",props:{legendType:{type:String,required:!0},nodes:{type:Array,default:null},tabs:{type:Array,default:null},defaultTab:{type:Number,default:0},columnLabel:{type:String,default:null},title:{type:String,default:null},columns:{type:Array,default:null},isDark:{type:Boolean,default:!1},popupAction:{type:String,default:"pray",validator:e=>["pray","adopt","none"].includes(e)},disableCollapse:{type:Boolean,default:!1}},setup(e){const{t}=_t();$t(` +`,"semantic-tree-legend"),(M,Y)=>{var _e,ke,Ne,st;return E(),B(ye,null,[$("div",{class:we(["stl-panel",{closed:!re.value,"fit-content":e.hideTabs}]),"data-theme":((_e=W(p))==null?void 0:_e.theme.value)||"dark"},[$("div",nv,[$("div",{class:we(["stl-titlebar",{"has-progress":!!w.value}])},[$("span",av,[Dn(M.$slots,"title-caret",{},void 0,!0)]),M.$slots["title-caret"]?de("",!0):(E(),B("button",{key:0,class:we(["stl-collapse-btn",{closed:!re.value}]),title:re.value?W(a)("aria.collapseLegend"):W(a)("aria.expandLegend"),"aria-label":re.value?W(a)("aria.collapseLegend"):W(a)("aria.expandLegend"),"aria-expanded":String(re.value),onClick:Y[0]||(Y[0]=Pe=>{re.value=!re.value,u("update:open",re.value)})},[...Y[11]||(Y[11]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,rv)),A.value&&Fe.value?(E(),B(ye,{key:1},[$("span",sv,G(A.value.tabName),1),$("button",{type:"button",class:"stl-tb-up",title:W(a)("legend.a11y.goUp",{label:A.value.node.label}),"aria-label":W(a)("legend.a11y.goUp",{label:A.value.tabName+" "+A.value.node.label}),onClick:ct(pe,["stop"])},[Y[12]||(Y[12]=$("svg",{class:"stl-tb-up-icon",width:"9",height:"9",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[$("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),A.value.node.color?(E(),B("span",{key:0,class:"stl-tb-dot",style:We({background:A.value.node.color})},null,4)):de("",!0),$("span",{class:"stl-tb-text",title:A.value.node.label},G(A.value.node.label),9,lv)],8,iv)],64)):(E(),B("span",cv,G(_.value),1)),e.exportEnabled&&Fe.value?(E(),B("div",uv,[$("button",{type:"button",class:we(["stl-export-btn",{open:oe.value}]),"aria-expanded":oe.value?"true":"false","aria-haspopup":"menu",title:W(a)("legend.exportSelection"),"aria-label":W(a)("legend.exportSelection"),onClick:ct(ge,["stop"])},[Y[13]||(Y[13]=$("svg",{width:"11",height:"11",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true"},[$("path",{d:"M7 1.5V9M7 1.5L4.2 4.3M7 1.5L9.8 4.3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),$("path",{d:"M2 9.5V11.5C2 12.05 2.45 12.5 3 12.5H11C11.55 12.5 12 12.05 12 11.5V9.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)),$("span",dv,G(W(a)("legend.exportButton")),1)],10,pv),oe.value?(E(),B(ye,{key:0},[$("div",{ref_key:"scrimRef",ref:le,style:We(W(ne)),class:"stl-export-backdrop",onClick:Y[1]||(Y[1]=ct(Pe=>oe.value=!1,["stop"]))},null,4),$("div",gv,[$("button",{type:"button",class:"stl-export-item",role:"menuitem",onClick:Y[2]||(Y[2]=ct(Pe=>he("poster"),["stop"]))},[Y[14]||(Y[14]=$("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[$("rect",{x:"2",y:"1.5",width:"8",height:"9",rx:"1",stroke:"currentColor","stroke-width":"1.3"}),$("path",{d:"M4 4.5H8M4 6.5H8M4 8.5H6.5",stroke:"currentColor","stroke-width":"1.1","stroke-linecap":"round"})],-1)),$("span",mv,G(W(a)("legend.export.poster")),1)]),e.exportCards?(E(),B("button",{key:0,type:"button",class:"stl-export-item",role:"menuitem",onClick:Y[3]||(Y[3]=ct(Pe=>he("cards"),["stop"]))},[Y[15]||(Y[15]=$("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[$("rect",{x:"1.5",y:"2.5",width:"6",height:"8",rx:"1",stroke:"currentColor","stroke-width":"1.2"}),$("rect",{x:"4.5",y:"1.5",width:"6",height:"8",rx:"1",stroke:"currentColor","stroke-width":"1.2"})],-1)),$("span",hv,G(W(a)("buttons.cardDeck")),1)])):de("",!0),$("button",{type:"button",class:"stl-export-item",role:"menuitem","aria-expanded":String(H.value),onClick:Y[4]||(Y[4]=ct(Pe=>H.value=!H.value,["stop"]))},[Y[16]||(Y[16]=$("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[$("path",{d:"M3 1.5H7.5L9.5 3.5V10.5H3V1.5Z",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),$("path",{d:"M7.5 1.5V3.5H9.5",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),$("path",{d:"M4.5 6H8M4.5 8H7",stroke:"currentColor","stroke-width":"1.1","stroke-linecap":"round"})],-1)),$("span",_v,G(W(a)("legend.export.packet")),1),$("span",{class:we(["stl-export-caret",{"is-open":H.value}]),"aria-hidden":"true"},"▾",2)],8,fv),H.value?(E(),B("div",{key:1,class:"stl-export-sub",role:"group","aria-label":W(a)("legend.export.packetAria")},[$("p",$v,G(W(a)("legend.export.packetExplain")),1),$("button",{type:"button",class:"stl-export-item stl-export-subitem",role:"menuitem",onClick:Y[5]||(Y[5]=ct(Pe=>he("packet:full"),["stop"]))},[$("span",yv,G(W(a)("legend.export.packetFull")),1)]),$("button",{type:"button",class:"stl-export-item stl-export-subitem",role:"menuitem",onClick:Y[6]||(Y[6]=ct(Pe=>he("packet:lightweight"),["stop"]))},[$("span",vv,G(W(a)("legend.export.packetLightweight")),1)])],8,bv)):de("",!0)])],64)):de("",!0)])):de("",!0),w.value?(E(),Je(cd,{key:4,class:"stl-progress","show-text":!1,covered:w.value.covered,total:w.value.total,segments:w.value.segments,"is-dark":m.value,"fmt-count":xn,onSelectSegment:x},null,8,["covered","total","segments","is-dark"])):de("",!0)],2),e.hideTabs?de("",!0):(E(),B("div",wv,[$("div",kv,[(E(!0),B(ye,null,nt(K.value,(Pe,yt)=>(E(),B("div",{key:Pe.id,class:we(["stl-tab-chip",{active:Oe.value===yt}])},[$("button",{class:"stl-tab",onClick:St=>be(yt)},G(i(Pe)),9,xv),Pe.info?(E(),B("button",{key:0,class:"stl-tab-info",title:l(Pe),onClick:St=>Me(yt,St)},"i",8,Cv)):de("",!0)],2))),128))]),te.value!==null&&((ke=K.value[te.value])!=null&&ke.info)?(E(),B("div",Av,G(l(K.value[te.value])),1)):de("",!0)])),$("div",Pv,[Y[17]||(Y[17]=$("span",{class:"stl-caret-sp"},null,-1)),Y[18]||(Y[18]=$("span",{class:"stl-dot-sp"},null,-1)),$("span",Sv,G(e.columnLabel||(e.hideTabs?e.title:i(K.value[Oe.value])||W(a)("legend.columns.name"))),1),J.value?(E(),B("button",{key:0,class:we(["stl-hdr-num",{active:fe.value==="count"}]),title:W(a)("legend.sortByUpgs"),onClick:Y[7]||(Y[7]=Pe=>C("count"))},[Ie(G(W(a)("legend.columns.upgs"))+" ",1),fe.value==="count"?(E(),B("span",Tv,G(Ae.value==="desc"?"▼":"▲"),1)):de("",!0)],10,Lv)):de("",!0),L.value?(E(),B("button",{key:1,class:we(["stl-hdr-num",{active:fe.value==="pop"}]),title:W(a)("legend.sortByPop"),onClick:Y[8]||(Y[8]=Pe=>C("pop"))},[Ie(G(W(a)("legend.columns.population"))+" ",1),fe.value==="pop"?(E(),B("span",Ov,G(Ae.value==="desc"?"▼":"▲"),1)):de("",!0)],10,Nv)):de("",!0),Y[19]||(Y[19]=$("span",{class:"stl-x-slot"},null,-1))]),$("div",{class:we(["stl-rows",{"has-sel":z.value}]),ref_key:"rowsContainer",ref:at},[(E(!0),B(ye,null,nt(f.value,Pe=>{var yt,St;return E(),B("div",{key:Pe.node.id,class:we(["stl-row",Dw(Pe)]),"data-stl-node-id":Pe.node.id,style:We({"--trunk-color":((yt=Pe.parent)==null?void 0:yt.color)||"#6e7681","--row-color":Pe.node.color||"#73A17F"}),onClick:ao=>D(Pe.node)},[(E(!0),B(ye,null,nt(Pe.trunks,(ao,Bw)=>(E(),B("span",{key:`tr${Bw}`,class:we(["stl-trunk",`stl-trunk-${ao}`])},null,2))),128)),(St=Pe.node.children)!=null&&St.length?(E(),B("button",{key:0,class:we(["stl-caret",{open:Q.value.has(Pe.node.id)}]),"aria-expanded":Q.value.has(Pe.node.id)?"true":"false","aria-label":W(a)(Q.value.has(Pe.node.id)?"legend.a11y.collapseRow":"legend.a11y.expandRow",{label:Pe.node.label}),onClick:ct(ao=>ae(Pe.node.id,ao),["stop"])},[...Y[20]||(Y[20]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,Mv)):(E(),B("span",Ev)),Pe.node.color?(E(),B("span",{key:2,class:"stl-dot",style:We({background:Pe.node.color})},null,4)):(E(),B("span",Iv)),$("span",Rv,G(Pe.node.label),1),J.value?(E(),B("span",Dv,G(xn(Pe.node.count)),1)):de("",!0),L.value?(E(),B("span",Bv,G(kn(Pe.node.pop)),1)):de("",!0),$("span",zv,[Ue.value===Pe.node.id?(E(),B("button",{key:0,class:"stl-x-chip",title:W(a)("legend.a11y.clearSelection"),"aria-label":W(a)("legend.a11y.clearSelection"),onClick:Y[9]||(Y[9]=ct(ao=>$e(ao),["stop"]))},[...Y[21]||(Y[21]=[$("svg",{width:"8",height:"8",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M2 2L10 10M10 2L2 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,Gv)):de("",!0)])],14,Fv)}),128)),S.value&&!f.value.length?(E(),B("div",jv,[Y[22]||(Y[22]=$("span",{class:"stl-spinner"},null,-1)),$("span",null,G(o("legend.loadingRows","Loading {label}…").replace("{label}",((Ne=K.value[Oe.value])==null?void 0:Ne.label)||"rows")),1)])):!f.value.length&&e.nodes.length===0?(E(),B("div",Hv,G(o("legend.loadingData","Loading data…")),1)):f.value.length?de("",!0):(E(),B("div",Uv,G(W(a)("legend.noDataAtThisLevel")),1)),ie.value>0?(E(),B("div",Wv,[Ie(G(o("legend.showingTop","Showing top {n} of {m}").replace("{n}",K.value[Oe.value].topLimit.toLocaleString()).replace("{m}",X.value.length.toLocaleString()))+" — ",1),$("span",qv,G(o("legend.useGeocoderHint","use the geocoder above to find the rest")),1)])):de("",!0)],2),v.value?(E(),Je(xr,{key:1,dark:m.value},null,8,["dark"])):de("",!0)])],10,ov),re.value?de("",!0):(E(),B("button",{key:0,class:"stl-reopen","data-theme":((st=W(p))==null?void 0:st.theme.value)||"dark",title:W(a)("aria.expandLegend"),"aria-label":W(a)("aria.expandLegend"),onClick:Y[10]||(Y[10]=Pe=>{re.value=!0,u("update:open",!0)})},[Y[23]||(Y[23]=$("svg",{class:"stl-reopen-icon",width:"11",height:"11",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M2 4h8M2 6h8M2 8h5",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)),$("span",Vv,[Fe.value?(E(),B(ye,{key:0},[Fe.value.color?(E(),B("span",{key:0,class:"stl-reopen-dot",style:We({background:Fe.value.color})},null,4)):de("",!0),Ie(" "+G(Fe.value.label),1)],64)):(E(),B(ye,{key:1},[Ie(G(_.value),1)],64))]),Y[24]||(Y[24]=$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none",class:"stl-reopen-caret"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],8,Kv))],64)}}},[["styles",[tv]],["__scopeId","data-v-49026e50"]]),Zv="#6b7280";function Jv(){const e=vr(vn.AFFINITY_BLOCK);return e&&e.propertyKey==="affinityBlock"&&e.palette?e.palette:{}}function Xv(e,t){const o=Jv();return e&&o[e]?o[e]:Zv}function Qv(e){return(e==null?void 0:e.properties)||e||{}}function Ii(e){return e&&typeof e=="object"&&"label"in e?e.label||e.value||"":e}function ew(e){var t;return String(e.affinityBlock||Ii((t=e._raw)==null?void 0:t.rop1)||"").trim()}function tw(e){var t;return String(e.affinityBlockLabel||((t=e._raw)!=null&&t.rop1&&typeof e._raw.rop1=="object"?e._raw.rop1.label:"")||"").trim()}function ow(e){var t;return String(e.cluster||Ii((t=e._raw)==null?void 0:t.imb_reg_of_people_2)||"").trim()}function nw(e){var t;return String(e.clusterLabel||((t=e._raw)!=null&&t.imb_reg_of_people_2&&typeof e._raw.imb_reg_of_people_2=="object"?e._raw.imb_reg_of_people_2.label:"")||"").trim()}function aw(e){var t;return String(e.peopleGroup||Ii((t=e._raw)==null?void 0:t.imb_reg_of_people_25)||"").trim()}function rw(e){var t;return String(e.peopleGroupLabel||((t=e._raw)!=null&&t.imb_reg_of_people_25&&typeof e._raw.imb_reg_of_people_25=="object"?e._raw.imb_reg_of_people_25.label:"")||e.name||"").trim()}function sw(e){var t;return String(e.uniqueId||e.slug||((t=e._raw)==null?void 0:t.slug)||"").trim()}function iw(e){var t;return String(e.name||e.displayName||((t=e._raw)==null?void 0:t.name)||"").trim()}function lw(e){var o;const t=Number(e.population??e.populationNum??((o=e._raw)==null?void 0:o.population)??0);return Number.isFinite(t)?t:0}function cw(e){return String(e.countryName||e.country||e.countryIsoLabel||e.countryIso||"").trim()}function uw(e){const t=q(()=>{const r=e&&e.value||[],s=new Map;for(const i of r){const l=Qv(i),c=ew(l),u=tw(l)||c||"— Unknown —",p=ow(l),g=nw(l)||p||"— Unknown —",w=aw(l),_=rw(l)||w||"— Unknown —",m=sw(l),d=iw(l)||m,y=lw(l),b=cw(l);if(!m)continue;let v=s.get(c||"__unknown__");v||(v={code:c,label:u,count:0,pop:0,memberIds:[],clusters:new Map},s.set(c||"__unknown__",v)),v.count+=1,v.pop+=y,v.memberIds.push(m);let k=v.clusters.get(p||"__unknown__");k||(k={code:p,label:g,count:0,pop:0,memberIds:[],peopleGroups:new Map},v.clusters.set(p||"__unknown__",k)),k.count+=1,k.pop+=y,k.memberIds.push(m);let x=k.peopleGroups.get(w||"__unknown__");x||(x={code:w,label:_,count:0,pop:0,memberIds:[],instances:[]},k.peopleGroups.set(w||"__unknown__",x)),x.count+=1,x.pop+=y,x.memberIds.push(m),x.instances.push({id:m,name:d,country:b,pop:y})}return s}),o=r=>r&&r.length?["in",["get","uniqueId"],["literal",r]]:["==",["get","uniqueId"],"__none__"],n=q(()=>{const r=t.value,s=[];for(const i of r.values()){const l=Xv(i.code,i.label),c={id:`bloc:${i.code||i.label}`,label:i.label,color:l,count:i.count,pop:i.pop,filter:o(i.memberIds),children:[]};for(const u of i.clusters.values()){const p={id:`cluster:${i.code}__${u.code||u.label}`,label:`${u.label} (Cluster)`,color:l,count:u.count,pop:u.pop,filter:o(u.memberIds),children:[]};for(const g of u.peopleGroups.values()){const w={id:`pg:${i.code}__${u.code}__${g.code||g.label}`,label:`${g.label} (PG)`,color:l,count:g.count,pop:g.pop,filter:o(g.memberIds),children:[]};g.instances.sort((_,m)=>m.pop-_.pop||_.country.localeCompare(m.country));for(const _ of g.instances)w.children.push({id:`pgic:${_.id}`,label:`${_.country?`${_.name}, ${_.country}`:_.name} (PGIC)`,color:l,count:1,pop:_.pop,filter:["==",["get","uniqueId"],_.id],children:[]});p.children.push(w)}p.children.sort((g,w)=>w.count-g.count||w.pop-g.pop),c.children.push(p)}c.children.sort((u,p)=>p.count-u.count||p.pop-u.pop),s.push(c)}return s.sort((i,l)=>l.count-i.count||l.pop-i.pop),s});function a(r){if(typeof window>"u"||typeof window.CustomEvent!="function")return;if(!r){window.dispatchEvent(new CustomEvent("legend:highlight",{detail:{kind:null}}));return}const s=String(r.id||""),i={kind:null,label:r.label,filterExpr:r.filter};s.startsWith("bloc:")?i.kind="bloc":s.startsWith("cluster:")?i.kind="cluster":s.startsWith("pg:")?i.kind="people-group":s.startsWith("pgic:")&&(i.kind="people-group-in-country"),window.dispatchEvent(new CustomEvent("legend:highlight",{detail:i}))}return{aggregated:t,affinityTree:n,highlight:a}}const pw={africa:"#ff2e2e",asia:"#1a8cff",europe:"#1ee05f","latin_america_&_caribbean":"#FFEB3B",middle_east:"#a83dff","north_america_&_non-spanish_caribbean":"#00e0bd",oceania:"#ff7f11"},dw="#95a5a6";function gw(e){return pw[String(e||"").toLowerCase()]||dw}function mw(e){return(e==null?void 0:e.properties)||e||{}}function hw(e){var o;const t=Number(e.population??e.populationNum??((o=e._raw)==null?void 0:o.population)??0);return Number.isFinite(t)?t:0}function fw(e){var t,o;return String(e.doxaRegion||e.wagfRegion||((o=(t=e._raw)==null?void 0:t.wagf_region)==null?void 0:o.value)||"").trim()}function _w(e){var o;const t=(o=e._raw)==null?void 0:o.wagf_region;return String(e.wagfRegionLabel||e.doxaRegionLabel||(t&&typeof t=="object"?t.label:"")||e.doxaRegion||"").trim()}function bw(e){var t,o;return String(e.wagfBlock||((o=(t=e._raw)==null?void 0:t.wagf_block)==null?void 0:o.value)||"").trim()}function $w(e){var o;const t=(o=e._raw)==null?void 0:o.wagf_block;return String(e.wagfBlockLabel||(t&&typeof t=="object"?t.label:"")||e.wagfBlock||"").trim()}function yw(e){var t,o;return String(e.countryIso||((o=(t=e._raw)==null?void 0:t.country_code)==null?void 0:o.value)||"").trim().toUpperCase()}function vw(e){var o;const t=(o=e._raw)==null?void 0:o.country_code;return String(e.countryIsoLabel||(t&&typeof t=="object"?t.label:"")||e.countryIso||"").trim()}function ww(e){const t=q(()=>{const a=e&&e.value||[],r=new Map;for(const s of a){const i=mw(s),l=fw(i),c=_w(i)||l||"— Unknown —",u=bw(i),p=$w(i)||u||"— Unknown —",g=yw(i),w=vw(i)||g||"— Unknown —",_=hw(i);if(!l||l==="na"||l==="none")continue;let m=r.get(l);if(m||(m={slug:l,label:c,count:0,pop:0,blocks:new Map},r.set(l,m)),m.count+=1,m.pop+=_,!u||u==="na")continue;let d=m.blocks.get(u);if(d||(d={slug:u,label:p,count:0,pop:0,countries:new Map},m.blocks.set(u,d)),d.count+=1,d.pop+=_,!g)continue;let y=d.countries.get(g);y||(y={iso:g,name:w,count:0,pop:0},d.countries.set(g,y)),y.count+=1,y.pop+=_}return r}),o=q(()=>{const a=t.value,r=[];for(const s of a.values()){const i=gw(s.slug),l=[],c=[],u=[...s.blocks.values()].sort((p,g)=>g.pop-p.pop||p.label.localeCompare(g.label));for(const p of u){const g=[],w=[],_=[...p.countries.values()].sort((m,d)=>d.pop-m.pop||m.name.localeCompare(d.name));for(const m of _)g.push(m.iso),l.push(m.iso),w.push({id:`country:${s.slug}__${p.slug}__${m.iso}`,label:m.name,color:i,count:m.count,pop:m.pop,filter:["==",["get","countryIso"],m.iso],isoCodes:[m.iso],children:[]});c.push({id:`block:${s.slug}__${p.slug}`,label:`${p.label} (Bloc)`,color:i,count:p.count,pop:p.pop,filter:["==",["get","wagfBlock"],p.slug],isoCodes:g,children:w})}r.push({id:`region:${s.slug}`,label:`${s.label} (Region)`,color:i,count:s.count,pop:s.pop,filter:["==",["get","doxaRegion"],s.slug],isoCodes:[...new Set(l)],children:c})}return r.sort((s,i)=>i.pop-s.pop||s.label.localeCompare(i.label)),r});function n(a){if(typeof window>"u"||typeof window.CustomEvent!="function")return;if(!a){window.dispatchEvent(new CustomEvent("legend:highlight",{detail:{kind:null}}));return}const r=String(a.id||""),s={kind:null,label:a.label,filterExpr:a.filter};r.startsWith("region:")?s.kind="region":r.startsWith("block:")?s.kind="block":r.startsWith("country:")&&(s.kind="country"),window.dispatchEvent(new CustomEvent("legend:highlight",{detail:s}))}return{aggregated:t,regionsTree:o,highlight:n}}const kw="",xw={class:"legend-sheet-root"},Cw=["src","alt"],Aw={key:0,class:"pull-tab-handle"},Pw=["aria-expanded","aria-label"],Sw=["aria-label"],Lw=["aria-expanded","aria-label"],Tw={class:"collapsed-detail-title"},Nw={class:"legend-content"},Ow=["aria-expanded","aria-label"],Fw=["aria-expanded","aria-label"],wd=80,kd=48,Mw=44,Ew=24,xd="lm-on",Iw="dxmaps:legend-sheet",Cd="--legend-sheet-h",Rw=3e3,Ad=Object.freeze(Object.defineProperty({__proto__:null,default:bo({__name:"LegendMobile",props:{legendType:{type:String,required:!0},nodes:{type:Array,default:null},tabs:{type:Array,default:null},defaultTab:{type:Number,default:0},columnLabel:{type:String,default:null},title:{type:String,default:null},columns:{type:Array,default:null},isDark:{type:Boolean,default:!1},popupAction:{type:String,default:"pray",validator:e=>["pray","adopt","none"].includes(e)},disableCollapse:{type:Boolean,default:!1}},setup(e){const{t}=_t();$t(` .floating-mini-image{position:absolute;inset-inline-start:calc(var(--map-fab-beside,0px) + 16px);bottom:calc(var(--legend-sheet-h,30%) + 16px);z-index:999;pointer-events:auto;cursor:pointer;} .mini-image{width:120px;height:150px;object-fit:cover;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.25);display:block;} .legend-sheet-root{position:absolute;inset:0;pointer-events:none;overflow:hidden;} @@ -1181,13 +1181,10 @@ :host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 6px 6px 0;} :host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib.mapboxgl-compact,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib.mapboxgl-compact{margin-right:6px;} @media (max-width:767.98px){ - :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-right{top:auto !important;bottom:var(--legend-sheet-h,48px) !important;transform:none !important;opacity:1;z-index:4;} - :host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-right{inset-inline-end:0 !important;inset-inline-start:auto !important;justify-content:flex-end;max-width:calc(100% - var(--map-fab-beside,0px) - 8px);} - :host(.lm-on) .mapboxgl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-right{max-width:calc(100% - var(--map-fab-beside,0px) - 104px);} - :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-left{inset-inline-start:var(--map-fab-beside,0px) !important;inset-inline-end:auto !important;} + :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-right{top:0 !important;bottom:auto !important;inset-inline-start:0 !important;inset-inline-end:auto !important;transform:none !important;justify-content:flex-start;max-width:calc(100% - 44px);z-index:4;} :host(.lm-on) .maplibregl-ctrl-logo,.lm-on .maplibregl-ctrl-logo{display:none !important;} :host(.lm-on) .maplibregl-ctrl-attrib-inner,:host(.lm-on) .mapboxgl-ctrl-attrib-inner,.lm-on .maplibregl-ctrl-attrib-inner,.lm-on .mapboxgl-ctrl-attrib-inner{font-size:8.5px;line-height:12px;} - :host(.lm-on) .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,:host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-left .maplibregl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-left .maplibregl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 0 8px;margin-inline:8px;} + :host(.lm-on) .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,:host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-left .maplibregl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-left .maplibregl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:8px 0 0;margin-inline:8px 0;} } .legend-mobile-sheet .stl-row{position:relative;} .legend-mobile-sheet .stl-row .stl-x-slot{position:absolute;inset-inline-end:6px;top:50%;transform:translateY(-50%);width:auto;} @@ -1274,4 +1271,4 @@ @media (prefers-reduced-motion: reduce) { .legend-sheet, .legend-content, .legend-handle, .legend-toggle { transition: none !important; animation: none !important; } } -`,"legend-mobile-sheet");const o=e,n=Le("uiStore");Le("mapStore");const a=Le("dataStore"),r=Le("onSemanticTreeSelect",()=>{}),s=Le("onLegendExport",null),i=q(()=>typeof s=="function"),l=Le("legendExportCards",!1),c=fl(o,"legendType"),{items:u,columns:p,title:g,activeFilter:w,setFilter:_,totalCount:m,totalPopulation:d,fmtPop:y,fmtCount:b}=ld(c,$d),v=Le("normalizedPeopleGroups",null),k=q(()=>{var he,ve;if((he=v==null?void 0:v.value)!=null&&he.length)return v.value;const ge=[];for(const Ee in(a==null?void 0:a.sources)||{}){const Qe=a.sources[Ee];(ve=Qe==null?void 0:Qe.features)!=null&&ve.length&&ge.push(...Qe.features)}return ge}),x={get value(){return k.value}},{langTree:P}=ad(x),{affinityTree:N}=uw(x),{regionsTree:I}=ww(x),O=[{id:"family",label:"Lang Family",info:"A language family is a group of languages descended from a common ancestor."},{id:"language",label:"Language",info:"A language is a system of communication used by a people."},{id:"dialect",label:"Dialect",info:"A dialect/variety is a regional or social form of a language."}],R=[{id:"bloc",label:"Block",info:"Affinity Block (rop1) — broadest grouping. 16 blocks total."},{id:"cluster",label:"Cluster",info:"Cluster (imb_reg_of_people_2, ROP 2) — finer grouping inside a block. 194 total."},{id:"group",label:"PG",info:"People Group (imb_reg_of_people_25, ROP 2.5) — abstract identity. 1,736 PGs."},{id:"pgic",label:"PGIC",info:"PG in Country (imb_reg_of_people_3 + country_code) — one row per PG-country pair. 2,106 rows."}],U=[{id:"region",label:"Region",info:'WAGF macro-region (e.g. "Asia", "Africa"). Color-coded on the map.'},{id:"block",label:"Bloc",info:'WAGF bloc — organizational sub-grouping within each region (e.g. "South East Asia").'},{id:"country",label:"Country",info:"Individual countries, listed by unreached-population size within their bloc."}],j=q(()=>["prayer","engagement","adoption","religion"].includes(o.legendType));function K(ge){const he=[];for(const ve of ge){he.push({id:ve.key,label:ve.label,color:ve.color,count:ve.count??0,pop:ve.population??0,filter:ve.filterKey?["==",["get","_flat_filter"],ve.filterKey]:null,children:[]});for(const Ee of ve.children||[])he.push({id:Ee.key,label:Ee.label,color:Ee.color,count:Ee.count??0,pop:Ee.population??0,filter:Ee.filterKey?["==",["get","_flat_filter"],Ee.filterKey]:null,children:[]})}return he}const ce=q(()=>o.nodes?o.nodes:j.value?K(u.value):o.legendType==="affinity-block"?N.value:o.legendType==="doxa-regions"?I.value:P.value),Q=q(()=>o.nodes?o.tabs:j.value?null:o.legendType==="affinity-block"?R:o.legendType==="doxa-regions"?U:O),V=q(()=>o.title?o.title:j.value?t("legend.titleBar.legend"):o.legendType==="affinity-block"?t("legend.titleBar.peopleGroups"):o.legendType==="doxa-regions"?t("legend.titleBar.wagfRegions"):t("legend.titleBar.languages")),re=q(()=>o.columnLabel!==null?o.columnLabel:["religion","prayer","engagement","adoption"].includes(o.legendType)?t("legend.colLabel."+o.legendType):j.value?t("legend.colLabel.status"):""),te=se(null),oe=se(!1),H={pending:null,active:!1,startY:0,startH:0,startState:"",containerH:0,maxH:0,lastH:0};let le=0;const ne=()=>Date.now()-le<400,fe=q(()=>n.legendState),Ae=q(()=>fe.value!=="collapsed"),Oe=q(()=>n.legendHeight),Fe=q(()=>n.caretRotation),Ue=q(()=>n.showPullTab),at=q(()=>fe.value==="open"&&!n._customLegendHeight);let Ve=!1;je(()=>n.isMobile,ge=>{!ge||Ve||(Ve=!0,n.selectedPeopleGroup||n.collapseLegend())},{immediate:!0});const rt=q(()=>n.legendMode),ot=q(()=>n.selectedPeopleGroup),C=Le("normalizedPeopleGroups",null),F=q(()=>{var he,ve;if((he=C==null?void 0:C.value)!=null&&he.length)return Mi(C.value);const ge=[];for(const Ee in(a==null?void 0:a.sources)||{}){const Qe=a.sources[Ee];(ve=Qe==null?void 0:Qe.features)!=null&&ve.length&&ge.push(...Qe.features)}return Mi(ge)}),S=q(()=>ot.value?bd(F.value,ot.value):[]),Z=q(()=>{var ge;return rt.value==="detail"&&ot.value?((ge=ot.value.properties)==null?void 0:ge.name)||t("legend.header.peopleGroupFallback"):fe.value==="collapsed"?o.title||t("legend.header.collapsed"):o.title||g.value});function ee(ge){n.handleLegendItemClick(),_(ge)}function X(){ne()||n.toggleLegend()}function ue(){ne()||(n.selectPeopleGroup(null),n.openLegend())}const ie=q(()=>{var he;if(!ot.value)return null;const ge=ot.value.properties||{};return ge.imageUrl||((he=ge._raw)==null?void 0:he.ImageURL)||null});function h(ge){var Qe;if(fe.value==="collapsed"){H.pending="hold",H.active=!1;return}const he=ge.touches[0],ve=te.value;!he||!ve||!(he.clientY-ve.getBoundingClientRect().top<=Mw)||(H.pending="grab",H.active=!1,H.startY=he.clientY,H.startH=ve.offsetHeight,H.lastH=H.startH,H.startState=fe.value,H.containerH=((Qe=ve.parentElement)==null?void 0:Qe.offsetHeight)||window.innerHeight,H.maxH=H.containerH-wd)}function f(ge){if(!H.pending&&!H.active)return;if(H.pending==="hold"){ge.cancelable&&ge.preventDefault();return}const he=ge.touches[0];if(!he)return;const ve=H.startY-he.clientY;if(!H.active){if(ve===0)return;H.pending=null,H.active=!0,oe.value=!0}ge.preventDefault();const Ee=Math.round(Math.min(H.maxH,Math.max(kd,H.startH+ve)));H.lastH=Ee,n.setLegendHeight(`${Ee}px`)}function z(){if(H.pending=null,!H.active)return;H.active=!1,oe.value=!1,le=Date.now();const ge=H.lastH,he=ge-H.startH,ve=H.containerH*.3;if(rt.value!=="detail"){ge0?n.fullyOpenLegend():H.startState==="fullyOpen"?n.openLegend():n.collapseLegend()}function J(ge){ge==="fullyOpen"?n.fullyOpenLegend():ge==="collapsed"?n.collapseLegend():n.openLegend()}let L=null;Lt(()=>{const ge=te.value,he=ge&&ge.getRootNode?ge.getRootNode():null;L=he&&he.host?he.host:typeof document<"u"?document.documentElement:null,L&&(L.__lmCount=(L.__lmCount||0)+1,L.classList.add(xd))}),wt(()=>{L&&(L.__lmCount=Math.max(0,(L.__lmCount||1)-1),L.__lmCount||L.classList.remove(xd),L=null)});let T=0;function A(ge){const he=te.value;if(!he||!he.isConnected)return;const ve=ge?0:he.offsetHeight,Ee=ve>0?fe.value==="collapsed"?"collapsed":"open":"gone";he.dispatchEvent(new CustomEvent(Iw,{bubbles:!0,composed:!0,detail:{height:ve,collapsedHeight:kd,state:Ee}}))}function D(){T||typeof requestAnimationFrame>"u"||(T=requestAnimationFrame(()=>{T=0,A(!1)}))}je(fe,()=>D()),Lt(()=>{const ge=te.value;ge&&(ge.addEventListener("transitionend",D),window.addEventListener("resize",D),D())}),wt(()=>{T&&(cancelAnimationFrame(T),T=0);const ge=te.value;ge&&ge.removeEventListener("transitionend",D),window.removeEventListener("resize",D),A(!0)});let ae=null,pe=null,be=null;Lt(()=>{const ge=te.value;if(!ge||typeof ResizeObserver>"u")return;const he=ge.getRootNode();pe=he instanceof ShadowRoot?he.host:he.documentElement||null,pe&&(be=ge,ae=new ResizeObserver(()=>{D();const ve=ge.offsetHeight;ve<=0||(pe.style.setProperty(Cd,`${ve}px`),pe.__legendSheetVarOwner=ge)}),ae.observe(ge))}),wt(()=>{ae&&(ae.disconnect(),ae=null),pe&&pe.__legendSheetVarOwner===be&&(pe.style.removeProperty(Cd),pe.__legendSheetVarOwner=null),pe=null,be=null});let $e=0;function Me(ge){$e=0;const he=te.value,ve=he&&he.getRootNode?he.getRootNode():null;if(!ve||!ve.querySelector)return;const Ee=ve.querySelector(".maplibregl-ctrl-attrib.maplibregl-compact-show, .mapboxgl-ctrl-attrib.mapboxgl-compact-show");if(Ee){$e=setTimeout(()=>{$e=0,n.isMobile&&Ee.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")},Rw);return}const Qe=ve.querySelector(".maplibregl-ctrl-attrib, .mapboxgl-ctrl-attrib");Qe&&!/attrib-empty/.test(Qe.className)||ge>0&&($e=setTimeout(()=>Me(ge-1),500))}return Lt(()=>Me(60)),wt(()=>{$e&&(clearTimeout($e),$e=0)}),(ge,he)=>{var ve;return E(),B("div",xw,[rt.value==="detail"&&ot.value&&fe.value==="open"&&ie.value?(E(),B("div",{key:0,class:"floating-mini-image",onClick:he[0]||(he[0]=Ee=>W(n).fullyOpenLegend())},[$("img",{src:ie.value,alt:(ve=ot.value.properties)==null?void 0:ve.name,class:"mini-image"},null,8,Cw)])):de("",!0),$("div",{ref_key:"sheetRef",ref:te,class:we(["legend-mobile-sheet",[fe.value,{"sheet-dark":e.isDark,dragging:oe.value,fit:at.value}]]),style:We({height:at.value?"auto":Oe.value,"--legend-sheet-top-reserve":wd+"px"}),onTouchstart:h,onTouchmove:f,onTouchend:z,onTouchcancel:z},[$("div",{class:"sheet-drag-strip",onClick:X},[Ue.value?(E(),B("div",Aw)):de("",!0)]),rt.value==="detail"&&fe.value!=="collapsed"?(E(),B("button",{key:0,class:"detail-collapse-btn-mobile",onClick:ct(X,["stop"]),"aria-expanded":String(Ae.value),"aria-label":W(t)("aria.toggleLegend")},null,8,Pw)):de("",!0),rt.value==="detail"&&fe.value!=="collapsed"?(E(),B("button",{key:1,class:"detail-close-btn",onClick:ct(ue,["stop"]),"aria-label":W(t)("aria.backToLegend")},[...he[2]||(he[2]=[$("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[$("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,Sw)):de("",!0),fe.value==="collapsed"&&rt.value==="detail"&&ot.value?(E(),B("div",{key:2,class:"collapsed-detail-footer",onClick:X},[$("button",{class:"mobile-collapse-caret",style:We({transform:`rotate(${Fe.value}deg)`}),"aria-expanded":String(Ae.value),"aria-label":W(t)("aria.toggleLegend"),tabindex:"-1"},[...he[3]||(he[3]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Lw),$("span",Tw,G(Z.value),1)])):de("",!0),$("div",Nw,[rt.value==="detail"&&ot.value?(E(),B(ye,{key:0},[fe.value!=="collapsed"?(E(),Je(hd,{key:0,peopleGroup:ot.value,hideHeader:!0,dark:e.isDark,action:e.popupAction},null,8,["peopleGroup","dark","action"])):de("",!0),fe.value!=="collapsed"?(E(),Je(xr,{key:1,shared:S.value,dark:e.isDark},null,8,["shared","dark"])):de("",!0)],64)):e.legendType!=="default"?(E(),Je(Yv,{key:1,"pin-note":!1,nodes:ce.value,tabs:Q.value,"default-tab":e.defaultTab,title:Z.value||V.value,hideTabs:e.nodes?!e.tabs:j.value,columnLabel:re.value,columns:e.columns||["count","pop"],"export-enabled":i.value,"export-cards":i.value&&W(l)===!0,onSelect:W(r),onExport:he[1]||(he[1]=Ee=>W(s)&&W(s)(Ee))},{"title-caret":Rt(()=>[$("button",{class:"mobile-collapse-caret",style:We({transform:`rotate(${Fe.value}deg)`}),onClick:ct(X,["stop"]),"aria-expanded":String(Ae.value),"aria-label":W(t)("aria.toggleLegend")},[...he[4]||(he[4]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Ow)]),_:1},8,["nodes","tabs","default-tab","title","hideTabs","columnLabel","columns","export-enabled","export-cards","onSelect"])):(E(),Je(ud,{key:2,title:Z.value,items:W(u),columns:W(p),activeFilter:W(w),isDark:e.isDark,hideColumnHeader:!1,showFooter:!1,disableCollapse:!0,totalCount:W(m),totalPopulation:W(d),fmtPop:W(y),fmtCount:W(b),onFilterClick:ee},{"title-caret":Rt(()=>[$("button",{class:"mobile-collapse-caret",style:We({transform:`rotate(${Fe.value}deg)`}),onClick:ct(X,["stop"]),"aria-expanded":String(Ae.value),"aria-label":W(t)("aria.toggleLegend")},[...he[5]||(he[5]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Fw)]),_:1},8,["title","items","columns","activeFilter","isDark","totalCount","totalPopulation","fmtPop","fmtCount"]))])],38)])}}},[["styles",[kw]],["__scopeId","data-v-79d13329"]])},Symbol.toStringTag,{value:"Module"}))})(); +`,"legend-mobile-sheet");const o=e,n=Le("uiStore");Le("mapStore");const a=Le("dataStore"),r=Le("onSemanticTreeSelect",()=>{}),s=Le("onLegendExport",null),i=q(()=>typeof s=="function"),l=Le("legendExportCards",!1),c=fl(o,"legendType"),{items:u,columns:p,title:g,activeFilter:w,setFilter:_,totalCount:m,totalPopulation:d,fmtPop:y,fmtCount:b}=ld(c,$d),v=Le("normalizedPeopleGroups",null),k=q(()=>{var he,ve;if((he=v==null?void 0:v.value)!=null&&he.length)return v.value;const ge=[];for(const Ee in(a==null?void 0:a.sources)||{}){const Qe=a.sources[Ee];(ve=Qe==null?void 0:Qe.features)!=null&&ve.length&&ge.push(...Qe.features)}return ge}),x={get value(){return k.value}},{langTree:P}=ad(x),{affinityTree:N}=uw(x),{regionsTree:I}=ww(x),O=[{id:"family",label:"Lang Family",info:"A language family is a group of languages descended from a common ancestor."},{id:"language",label:"Language",info:"A language is a system of communication used by a people."},{id:"dialect",label:"Dialect",info:"A dialect/variety is a regional or social form of a language."}],R=[{id:"bloc",label:"Block",info:"Affinity Block (rop1) — broadest grouping. 16 blocks total."},{id:"cluster",label:"Cluster",info:"Cluster (imb_reg_of_people_2, ROP 2) — finer grouping inside a block. 194 total."},{id:"group",label:"PG",info:"People Group (imb_reg_of_people_25, ROP 2.5) — abstract identity. 1,736 PGs."},{id:"pgic",label:"PGIC",info:"PG in Country (imb_reg_of_people_3 + country_code) — one row per PG-country pair. 2,106 rows."}],U=[{id:"region",label:"Region",info:'WAGF macro-region (e.g. "Asia", "Africa"). Color-coded on the map.'},{id:"block",label:"Bloc",info:'WAGF bloc — organizational sub-grouping within each region (e.g. "South East Asia").'},{id:"country",label:"Country",info:"Individual countries, listed by unreached-population size within their bloc."}],j=q(()=>["prayer","engagement","adoption","religion"].includes(o.legendType));function K(ge){const he=[];for(const ve of ge){he.push({id:ve.key,label:ve.label,color:ve.color,count:ve.count??0,pop:ve.population??0,filter:ve.filterKey?["==",["get","_flat_filter"],ve.filterKey]:null,children:[]});for(const Ee of ve.children||[])he.push({id:Ee.key,label:Ee.label,color:Ee.color,count:Ee.count??0,pop:Ee.population??0,filter:Ee.filterKey?["==",["get","_flat_filter"],Ee.filterKey]:null,children:[]})}return he}const ce=q(()=>o.nodes?o.nodes:j.value?K(u.value):o.legendType==="affinity-block"?N.value:o.legendType==="doxa-regions"?I.value:P.value),Q=q(()=>o.nodes?o.tabs:j.value?null:o.legendType==="affinity-block"?R:o.legendType==="doxa-regions"?U:O),V=q(()=>o.title?o.title:j.value?t("legend.titleBar.legend"):o.legendType==="affinity-block"?t("legend.titleBar.peopleGroups"):o.legendType==="doxa-regions"?t("legend.titleBar.wagfRegions"):t("legend.titleBar.languages")),re=q(()=>o.columnLabel!==null?o.columnLabel:["religion","prayer","engagement","adoption"].includes(o.legendType)?t("legend.colLabel."+o.legendType):j.value?t("legend.colLabel.status"):""),te=se(null),oe=se(!1),H={pending:null,active:!1,startY:0,startH:0,startState:"",containerH:0,maxH:0,lastH:0};let le=0;const ne=()=>Date.now()-le<400,fe=q(()=>n.legendState),Ae=q(()=>fe.value!=="collapsed"),Oe=q(()=>n.legendHeight),Fe=q(()=>n.caretRotation),Ue=q(()=>n.showPullTab),at=q(()=>fe.value==="open"&&!n._customLegendHeight);let Ve=!1;je(()=>n.isMobile,ge=>{!ge||Ve||(Ve=!0,n.selectedPeopleGroup||n.collapseLegend())},{immediate:!0});const rt=q(()=>n.legendMode),ot=q(()=>n.selectedPeopleGroup),C=Le("normalizedPeopleGroups",null),F=q(()=>{var he,ve;if((he=C==null?void 0:C.value)!=null&&he.length)return Mi(C.value);const ge=[];for(const Ee in(a==null?void 0:a.sources)||{}){const Qe=a.sources[Ee];(ve=Qe==null?void 0:Qe.features)!=null&&ve.length&&ge.push(...Qe.features)}return Mi(ge)}),S=q(()=>ot.value?bd(F.value,ot.value):[]),Z=q(()=>{var ge;return rt.value==="detail"&&ot.value?((ge=ot.value.properties)==null?void 0:ge.name)||t("legend.header.peopleGroupFallback"):fe.value==="collapsed"?o.title||t("legend.header.collapsed"):o.title||g.value});function ee(ge){n.handleLegendItemClick(),_(ge)}function X(){ne()||n.toggleLegend()}function ue(){ne()||(n.selectPeopleGroup(null),n.openLegend())}const ie=q(()=>{var he;if(!ot.value)return null;const ge=ot.value.properties||{};return ge.imageUrl||((he=ge._raw)==null?void 0:he.ImageURL)||null});function h(ge){var Qe;if(fe.value==="collapsed"){H.pending="hold",H.active=!1;return}const he=ge.touches[0],ve=te.value;!he||!ve||!(he.clientY-ve.getBoundingClientRect().top<=Mw)||(H.pending="grab",H.active=!1,H.startY=he.clientY,H.startH=ve.offsetHeight,H.lastH=H.startH,H.startState=fe.value,H.containerH=((Qe=ve.parentElement)==null?void 0:Qe.offsetHeight)||window.innerHeight,H.maxH=H.containerH-wd)}function f(ge){if(!H.pending&&!H.active)return;if(H.pending==="hold"){ge.cancelable&&ge.preventDefault();return}const he=ge.touches[0];if(!he)return;const ve=H.startY-he.clientY;if(!H.active){if(ve===0)return;H.pending=null,H.active=!0,oe.value=!0}ge.preventDefault();const Ee=Math.round(Math.min(H.maxH,Math.max(kd,H.startH+ve)));H.lastH=Ee,n.setLegendHeight(`${Ee}px`)}function z(){if(H.pending=null,!H.active)return;H.active=!1,oe.value=!1,le=Date.now();const ge=H.lastH,he=ge-H.startH,ve=H.containerH*.3;if(rt.value!=="detail"){ge0?n.fullyOpenLegend():H.startState==="fullyOpen"?n.openLegend():n.collapseLegend()}function J(ge){ge==="fullyOpen"?n.fullyOpenLegend():ge==="collapsed"?n.collapseLegend():n.openLegend()}let L=null;Lt(()=>{const ge=te.value,he=ge&&ge.getRootNode?ge.getRootNode():null;L=he&&he.host?he.host:typeof document<"u"?document.documentElement:null,L&&(L.__lmCount=(L.__lmCount||0)+1,L.classList.add(xd))}),wt(()=>{L&&(L.__lmCount=Math.max(0,(L.__lmCount||1)-1),L.__lmCount||L.classList.remove(xd),L=null)});let T=0;function A(ge){const he=te.value;if(!he||!he.isConnected)return;const ve=ge?0:he.offsetHeight,Ee=ve>0?fe.value==="collapsed"?"collapsed":"open":"gone";he.dispatchEvent(new CustomEvent(Iw,{bubbles:!0,composed:!0,detail:{height:ve,collapsedHeight:kd,state:Ee}}))}function D(){T||typeof requestAnimationFrame>"u"||(T=requestAnimationFrame(()=>{T=0,A(!1)}))}je(fe,()=>D()),Lt(()=>{const ge=te.value;ge&&(ge.addEventListener("transitionend",D),window.addEventListener("resize",D),D())}),wt(()=>{T&&(cancelAnimationFrame(T),T=0);const ge=te.value;ge&&ge.removeEventListener("transitionend",D),window.removeEventListener("resize",D),A(!0)});let ae=null,pe=null,be=null;Lt(()=>{const ge=te.value;if(!ge||typeof ResizeObserver>"u")return;const he=ge.getRootNode();pe=he instanceof ShadowRoot?he.host:he.documentElement||null,pe&&(be=ge,ae=new ResizeObserver(()=>{D();const ve=ge.offsetHeight;ve<=0||(pe.style.setProperty(Cd,`${ve}px`),pe.__legendSheetVarOwner=ge)}),ae.observe(ge))}),wt(()=>{ae&&(ae.disconnect(),ae=null),pe&&pe.__legendSheetVarOwner===be&&(pe.style.removeProperty(Cd),pe.__legendSheetVarOwner=null),pe=null,be=null});let $e=0;function Me(ge){$e=0;const he=te.value,ve=he&&he.getRootNode?he.getRootNode():null;if(!ve||!ve.querySelector)return;const Ee=ve.querySelector(".maplibregl-ctrl-attrib.maplibregl-compact-show, .mapboxgl-ctrl-attrib.mapboxgl-compact-show");if(Ee){$e=setTimeout(()=>{$e=0,n.isMobile&&Ee.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")},Rw);return}const Qe=ve.querySelector(".maplibregl-ctrl-attrib, .mapboxgl-ctrl-attrib");Qe&&!/attrib-empty/.test(Qe.className)||ge>0&&($e=setTimeout(()=>Me(ge-1),500))}return Lt(()=>Me(60)),wt(()=>{$e&&(clearTimeout($e),$e=0)}),(ge,he)=>{var ve;return E(),B("div",xw,[rt.value==="detail"&&ot.value&&fe.value==="open"&&ie.value?(E(),B("div",{key:0,class:"floating-mini-image",onClick:he[0]||(he[0]=Ee=>W(n).fullyOpenLegend())},[$("img",{src:ie.value,alt:(ve=ot.value.properties)==null?void 0:ve.name,class:"mini-image"},null,8,Cw)])):de("",!0),$("div",{ref_key:"sheetRef",ref:te,class:we(["legend-mobile-sheet",[fe.value,{"sheet-dark":e.isDark,dragging:oe.value,fit:at.value}]]),style:We({height:at.value?"auto":Oe.value,"--legend-sheet-top-reserve":wd+"px"}),onTouchstart:h,onTouchmove:f,onTouchend:z,onTouchcancel:z},[$("div",{class:"sheet-drag-strip",onClick:X},[Ue.value?(E(),B("div",Aw)):de("",!0)]),rt.value==="detail"&&fe.value!=="collapsed"?(E(),B("button",{key:0,class:"detail-collapse-btn-mobile",onClick:ct(X,["stop"]),"aria-expanded":String(Ae.value),"aria-label":W(t)("aria.toggleLegend")},null,8,Pw)):de("",!0),rt.value==="detail"&&fe.value!=="collapsed"?(E(),B("button",{key:1,class:"detail-close-btn",onClick:ct(ue,["stop"]),"aria-label":W(t)("aria.backToLegend")},[...he[2]||(he[2]=[$("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[$("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,Sw)):de("",!0),fe.value==="collapsed"&&rt.value==="detail"&&ot.value?(E(),B("div",{key:2,class:"collapsed-detail-footer",onClick:X},[$("button",{class:"mobile-collapse-caret",style:We({transform:`rotate(${Fe.value}deg)`}),"aria-expanded":String(Ae.value),"aria-label":W(t)("aria.toggleLegend"),tabindex:"-1"},[...he[3]||(he[3]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Lw),$("span",Tw,G(Z.value),1)])):de("",!0),$("div",Nw,[rt.value==="detail"&&ot.value?(E(),B(ye,{key:0},[fe.value!=="collapsed"?(E(),Je(hd,{key:0,peopleGroup:ot.value,hideHeader:!0,dark:e.isDark,action:e.popupAction},null,8,["peopleGroup","dark","action"])):de("",!0),fe.value!=="collapsed"?(E(),Je(xr,{key:1,shared:S.value,dark:e.isDark},null,8,["shared","dark"])):de("",!0)],64)):e.legendType!=="default"?(E(),Je(Yv,{key:1,"pin-note":!1,nodes:ce.value,tabs:Q.value,"default-tab":e.defaultTab,title:Z.value||V.value,hideTabs:e.nodes?!e.tabs:j.value,columnLabel:re.value,columns:e.columns||["count","pop"],"export-enabled":i.value,"export-cards":i.value&&W(l)===!0,onSelect:W(r),onExport:he[1]||(he[1]=Ee=>W(s)&&W(s)(Ee))},{"title-caret":Rt(()=>[$("button",{class:"mobile-collapse-caret",style:We({transform:`rotate(${Fe.value}deg)`}),onClick:ct(X,["stop"]),"aria-expanded":String(Ae.value),"aria-label":W(t)("aria.toggleLegend")},[...he[4]||(he[4]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Ow)]),_:1},8,["nodes","tabs","default-tab","title","hideTabs","columnLabel","columns","export-enabled","export-cards","onSelect"])):(E(),Je(ud,{key:2,title:Z.value,items:W(u),columns:W(p),activeFilter:W(w),isDark:e.isDark,hideColumnHeader:!1,showFooter:!1,disableCollapse:!0,totalCount:W(m),totalPopulation:W(d),fmtPop:W(y),fmtCount:W(b),onFilterClick:ee},{"title-caret":Rt(()=>[$("button",{class:"mobile-collapse-caret",style:We({transform:`rotate(${Fe.value}deg)`}),onClick:ct(X,["stop"]),"aria-expanded":String(Ae.value),"aria-label":W(t)("aria.toggleLegend")},[...he[5]||(he[5]=[$("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[$("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Fw)]),_:1},8,["title","items","columns","activeFilter","isDark","totalCount","totalPopulation","fmtPop","fmtCount"]))])],38)])}}},[["styles",[kw]],["__scopeId","data-v-0a90c77a"]])},Symbol.toStringTag,{value:"Module"}))})(); diff --git a/public/dx-maps/cities-internet/connectivity-list/index.html b/public/dx-maps/cities-internet/connectivity-list/index.html index 543e5ab41..ceceda9fc 100644 --- a/public/dx-maps/cities-internet/connectivity-list/index.html +++ b/public/dx-maps/cities-internet/connectivity-list/index.html @@ -61,7 +61,7 @@ - + - + - + - + - + - + \n\n\n" + "script": "\n\n\n" } }, { @@ -145,8 +145,8 @@ "scriptUrl": "./cities-internet/cities-internet.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -162,7 +162,7 @@ "scriptUrl": "./cities-internet/cities-internet.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } } ] @@ -200,7 +200,7 @@ "bundle": "country-posters", "scriptUrl": "./country-posters/country-posters.js", "output": "dx-maps/country-posters/country-posters.js", - "integrity": "sha384-AZjcBslFb66hFuc69bVEO0q1sxjo+Pytwro46rQHg0+gJTZzX0HkHjoI2LjXqVxt", + "integrity": "sha384-STAgt3e7/LxQgjL9skQ1SXjncjAuDrLqZ4dfae4EhzIKpqzsSDMXd5stbzkzzHcW", "elements": [ "country-posters-map" ], @@ -223,8 +223,8 @@ "scriptUrl": "./country-posters/country-posters.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -240,7 +240,7 @@ "scriptUrl": "./country-posters/country-posters.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -256,8 +256,8 @@ "scriptUrl": "./country-posters/country-posters.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] @@ -416,7 +416,7 @@ "bundle": "doxa-research-map", "scriptUrl": "./doxa-research-map/doxa-research-map.js", "output": "dx-maps/doxa-research-map/doxa-research-map.js", - "integrity": "sha384-sjraCuyNY0DA+kYTsCrUrlA+Lqts6oUkfYgzPE/ptBL8DFOjbxL87R+QU7ZtU/P9", + "integrity": "sha384-RvYudaJfF5kTQB5wg9QIs5XEJsMVIqUjLB0DoRwJGhIc4vghFDG4cAWbXOEtcrXc", "elements": [ "doxa-research-map" ], @@ -435,8 +435,8 @@ "scriptUrl": "./doxa-research-map/doxa-research-map.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" }, "instances": [ { @@ -462,7 +462,7 @@ "bundle": "doxa-simple-map", "scriptUrl": "./doxa-simple-map/doxa-simple-map.js", "output": "dx-maps/doxa-simple-map/doxa-simple-map.js", - "integrity": "sha384-gdnygp7vt+nLyer1qvGo7uBw4qxWcG6F3ET6I3bHtRp8vufx0c00ggLbBCH+EG2f", + "integrity": "sha384-OxyJCfvJ+MJEL10KVV5ez3DPVNdTzFvL8R+KK5MkxB11Qba/zedXnqjufFjry4eH", "elements": [ "doxa-map", "doxa-simple-map" @@ -482,8 +482,8 @@ "scriptUrl": "./doxa-simple-map/doxa-simple-map.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" }, "instances": [ { @@ -880,7 +880,7 @@ "bundle": "my-upg-100-list", "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "output": "dx-maps/my-upg-100-list/my-upg-100-list.js", - "integrity": "sha384-34KshL1BBU9ML0QfnMS+BSUH/opJufgt957m1gQAePX3dU12ZEGE0vqegwbqycpj", + "integrity": "sha384-yak0YUOh9SJUazwneGIV45ImRivvw2fxmYzUfP/kjUxQsikxppQo9q9EXJM7L9ul", "elements": [ "my-upg-100-list-map" ], @@ -903,7 +903,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -919,8 +919,8 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -936,8 +936,8 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] diff --git a/public/dx-maps/doxa-research-map/doxa-research-map.js b/public/dx-maps/doxa-research-map/doxa-research-map.js index e34c3c4ef..173a1f3e7 100644 --- a/public/dx-maps/doxa-research-map/doxa-research-map.js +++ b/public/dx-maps/doxa-research-map/doxa-research-map.js @@ -1498,7 +1498,7 @@ .map-scroll-edge { position:absolute;top:0;bottom:0;width:calc(var(--map-btn-size,32px) + 6px);z-index:2;touch-action:pan-y;pointer-events:auto;background:transparent; } .map-scroll-edge--left { left:0; } .map-scroll-edge--right { right:0; } -`,"research-map");const s=He("profileConfig"),i=He("mapboxToken"),l=rh(s),c=te(()=>{var T;return((T=s==null?void 0:s.value)==null?void 0:T.search)===!1?!1:l==="mapbox"}),u=te(()=>{var T;return((T=s==null?void 0:s.value)==null?void 0:T.legendTools)!==!1}),d=te(()=>c.value?null:u.value&&Sf((A==null?void 0:A.value)??A)?"56px":"14px"),h=F1(l),x=He("dataSource");He("colorSet");const P=He("instanceId",null),_=(()=>{var z;const T=(z=s==null?void 0:s.value)==null?void 0:z.locale;return T&&Za.includes(T)?T:null})(),{locale:g,t:b,te:m}=jt();_&&(g.value=_);function $(T){const z="tabs."+((T==null?void 0:T.i18nKey)||(T==null?void 0:T.id));return T&&m(z)?b(z):(T==null?void 0:T.label)??""}const p=He("mapStore"),y=He("dataStore"),f=He("uiStore"),k=p1(f),L={doxaRegions:!0,adoption:!1,share:!0,hamburgerMenu:!1,geocoderPersistAcrossTabs:!1},G=[{id:"prayer",colorStrategy:"prayerProgress",legend:"prayer",popup:"pray",feature:null},{id:"adoption",colorStrategy:"adoption",legend:"adoption",popup:"adopt",feature:"adoption"},{id:"engagement",colorStrategy:"engagement",legend:"engagement",popup:"pray",feature:null,sepAfter:!0},{id:"affinity-blocks",colorStrategy:"affinityBlock",legend:"affinity-block",popup:"pray",feature:null},{id:"doxa-regions",colorStrategy:"doxaRegion",legend:"doxa-regions",popup:"pray",feature:"doxaRegions",i18nKey:"regions"},{id:"language-families",colorStrategy:"languageFamily",legend:"language-family",popup:"pray",feature:null},{id:"religion",colorStrategy:"religion",legend:"religion",popup:"pray",feature:null}].filter(T=>!T.feature||L[T.feature]),W=te(()=>G),q=te(()=>!0),v=we(null),N=te(()=>W.value.find(T=>T.id===v.value)??W.value[0]);k.setLook(k.lookFor((Mm=N.value)==null?void 0:Mm.colorStrategy)),We(()=>{var T;return(T=N.value)==null?void 0:T.colorStrategy},T=>k.setLook(k.lookFor(T),Z.value));const A=te(()=>{var T;return((T=N.value)==null?void 0:T.legend)??"default"}),w=te(()=>{var T;return((T=N.value)==null?void 0:T.popup)??"pray"}),j={"language-families":"search.tabPlaceholder.languageFamilies","affinity-blocks":"search.tabPlaceholder.affinityBlocks","doxa-regions":"search.tabPlaceholder.regions",religion:"search.tabPlaceholder.religion"},F=te(()=>{var z;const T=j[(z=N.value)==null?void 0:z.id];return T&&m(T)?b(T):""}),U={"affinity-blocks":"people-groups",prayer:"people-groups",adoption:"people-groups",engagement:"people-groups","language-families":"language","doxa-regions":"regions",religion:"religion"},I=te(()=>{var T;return U[(T=N.value)==null?void 0:T.id]||""}),K=(P==null?void 0:P.value)||P||"research-map-"+Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,8);Ut("mapId",K);const O=we(null),se=we(null),he=we(null),ye=new Map;We(()=>v==null?void 0:v.value,async(T,z)=>{var Ae,Me,Te;if(z!==void 0&&T!==z){z&&ye.set(z,f.legendState);const Ze=ye.get(T)||(f.isMobile?"collapsed":"open");Ze==="fullyOpen"?(Ae=f.fullyOpenLegend)==null||Ae.call(f):Ze==="open"?(Me=f.openLegend)==null||Me.call(f):(Te=f.collapseLegend)==null||Te.call(f)}await Yt();const ee=se.value,fe=ee==null?void 0:ee.querySelector(".rm-tab.active");if(ee&&fe&&ee.scrollWidth>ee.clientWidth+1){const Ze=ee.getBoundingClientRect(),Ue=fe.getBoundingClientRect(),gt=ee.scrollLeft+(Ue.left-Ze.left)-(Ze.width-Ue.width)/2,Gt=ee.scrollWidth-ee.clientWidth,ot=Math.max(0,Math.min(Gt,gt));typeof ee.scrollTo=="function"?ee.scrollTo({left:ot,behavior:"smooth"}):ee.scrollLeft=ot}});const Se=we(null),xe=we(!1),Q=we(null),{map:Z,initializeMap:ce,destroy:ke}=X1({containerRef:Se,accessToken:i.value,provider:l,style:((Rm=s==null?void 0:s.value)==null?void 0:Rm.style)??k.bootStyle(),config:k.bootConfig,center:((Fm=s==null?void 0:s.value)==null?void 0:Fm.center)??Ko.center??[20,10],zoom:((Nm=s==null?void 0:s.value)==null?void 0:Nm.zoom)??Ko.zoom??1.8,pitch:((Im=s==null?void 0:s.value)==null?void 0:Im.pitch)??Ko.pitch??0,bearing:((Om=s==null?void 0:s.value)==null?void 0:Om.bearing)??Ko.bearing??0,minZoom:((Dm=s==null?void 0:s.value)==null?void 0:Dm.minZoom)??Ko.minZoom??.5,maxZoom:mA}),M=new mf({sourcesConfig:ma,locale:_,profileConfig:s}),D=Jv({mapId:K,dataSourceId:x.value,dataSourceManager:M,dataStore:y,markRaw:T=>T});async function B(T){const z=String(T||"").trim().toUpperCase();if(z.length!==3)return;await hn();const ee=Z.value;if(!ee||!ee.getLayer("regions-fill"))return;ee.setLayoutProperty("regions-fill","visibility","visible"),ee.setLayoutProperty("regions-border","visibility","visible");const fe=["literal",[z]];ee.setPaintProperty("regions-fill","fill-opacity",["case",["in",["get","iso_3166_1_alpha_3"],fe],.3,.02]),ee.setPaintProperty("regions-border","line-color",["case",["in",["get","iso_3166_1_alpha_3"],fe],"#111827","rgba(60,60,80,0.15)"]),ee.setPaintProperty("regions-border","line-width",["case",["in",["get","iso_3166_1_alpha_3"],fe],2.5,.3]),ee.getLayer("language-family-pins")&&ee.moveLayer("language-family-pins")}const V=Fv({getMap:()=>Z.value,mapId:K,getLanguageFamilyColor:T=>{var ee,fe;const z=dn((ee=N.value)==null?void 0:ee.colorStrategy);return((fe=z==null?void 0:z.colors)==null?void 0:fe[T])??(z==null?void 0:z.fallback)??"#7c8cf8"},getNormalizedPeopleGroups:()=>D.normalizedPeopleGroups.value||[]});tf({getMap:()=>Z.value,mapId:K,getLanguageFamilyColor:()=>"#7c8cf8",getNormalizedPeopleGroups:()=>D.normalizedPeopleGroups.value||[]});const ne=Ov({getMap:()=>Z.value,mapId:K,mapStore:p,defaultCenter:((zm=s==null?void 0:s.value)==null?void 0:zm.center)??[20,10],defaultZoom:((jm=s==null?void 0:s.value)==null?void 0:jm.zoom)??1.8}),H=zv({getMap:()=>Z.value,getActivePinColor:T=>{var ee,fe;const z=dn(((ee=N.value)==null?void 0:ee.colorStrategy)??"languageFamily");return((fe=z==null?void 0:z.getColor)==null?void 0:fe.call(z,T))??"#1a1a1a"}});let le=null,be=null;function E(){return le?Promise.resolve(le):(be||(be=Ot(()=>Promise.resolve().then(()=>WA),void 0).then(T=>(le=T.useMapClustering({getMap:()=>Z.value,mapId:K,mapStore:p,getPeopleGroups:()=>D.normalizedPeopleGroups.value||[],getClusterColor:()=>{var z,ee;return((ee=dn((z=N.value)==null?void 0:z.colorStrategy))==null?void 0:ee.fallback)??"#7c8cf8"}}),le))),be)}const C={setData(T){var z;(z=le==null?void 0:le.setData)==null||z.call(le,T)},applyFilters(T){var z;(z=le==null?void 0:le.applyFilters)==null||z.call(le,T)},refreshColors(){var T;(T=le==null?void 0:le.refreshColors)==null||T.call(le)},cleanup(){var T;(T=le==null?void 0:le.cleanup)==null||T.call(le)},async setEnabled(T){var z,ee;(ee=(z=await E()).setEnabled)==null||ee.call(z,T)},async setMode(T){var z,ee;(ee=(z=await E()).setMode)==null||ee.call(z,T)},_pendingSelectionFilter:null,setSelectionFilter(T){this._pendingSelectionFilter=T||null,le!=null&&le.setSelectionFilter&&le.setSelectionFilter(T)},flushSelectionFilter(){le!=null&&le.setSelectionFilter&&le.setSelectionFilter(this._pendingSelectionFilter)}},X=ts({});Ut("normalizedPeopleGroups",D.normalizedPeopleGroups);const de=Wv(()=>Z.value),$e=DP(K);zP($e);const ve=iA({map:Z,activeTab:N,countryOutline:de,regionIdle:ea,mapFly:ne,pplrInstance:$e,mapId:K}),J=ve.clearCountryHighlight,ue=ve.flatItemsToStlNodes,Fe=ve.onLegendRowClick,Ie=ve.bridgeSelection,{onPeopleGroupResult:st,onAggregateResult:pt,onClear:_t,clearGeocoderProgrammatic:Re}=Qv({map:Z,geocoderRef:he,clustering:C,mapStore:p,uiStore:f,mapLayers:V,pplrInstance:$e,onSemanticTreeSelect:mt,switchTab:In,activeTabId:v,clearAllHighlights:gr,clearCountryHighlight:J,mapId:K,legendRouters:{country:On,region:Po,religion:oo}});$e.activeTab.value=1;function Oe(T){return T==="affinity-block"?0:T==="language-family"?1:0}We(A,T=>{$e.activeTab.value=Oe(T)});const ze={get value(){return D.normalizedPeopleGroups.value||[]}},{langTree:Xe}=Xc(ze),Pt=[{id:"family",info:!0},{id:"language",info:!0},{id:"dialect",info:!0}],{affinityTree:qo}=Ef(ze),ur=[{id:"bloc",info:!0},{id:"cluster",info:!0},{id:"group",info:!0},{id:"pgic",info:!0}],{regionsTree:Fn}=Mf(ze),Y=[{id:"region",info:!0},{id:"block",info:!0},{id:"country",info:!0}],ie=ts(Ls(()=>A.value),Ei),De=ie.progress;Ut("legendProgress",De);const Ge=te(()=>["prayer","engagement","adoption","religion"].includes(A.value)),ae=te(()=>Ge.value?ue(ie.items.value):A.value==="affinity-block"?qo.value:A.value==="doxa-regions"?Fn.value:Xe.value),pe=te(()=>Ge.value?null:A.value==="affinity-block"?ur:A.value==="doxa-regions"?Y:Pt),re=te(()=>Ge.value),Ce=te(()=>A.value==="religion"?b("legend.colLabel.religion"):A.value==="prayer"?b("legend.colLabel.prayer"):A.value==="engagement"?b("legend.colLabel.engagement"):A.value==="adoption"?b("legend.colLabel.adoption"):Ge.value?b("legend.colLabel.status"):""),Pe=te(()=>f.legendState!=="collapsed");function Ve(T){T?f.openLegend():f.collapseLegend()}const Le=te(()=>Ge.value?b("legend.titleBar.legend"):A.value==="affinity-block"?b("legend.titleBar.peopleGroups"):A.value==="doxa-regions"?b("legend.titleBar.wagfRegions"):b("legend.titleBar.languages"));Ut("onSemanticTreeSelect",T=>mt(T)),Ut("getActivePinColor",T=>{var ee,fe;const z=dn(((ee=N.value)==null?void 0:ee.colorStrategy)??"languageFamily");return((fe=z==null?void 0:z.getColor)==null?void 0:fe.call(z,T))??"#1a1a1a"});const Ke=["case",["has","iso_3166_1_alpha_3"],.7,.7],et=["case",["has","iso_3166_1_alpha_3"],"rgba(60,60,80,0.35)","rgba(60,60,80,0.35)"],Be=["case",["has","iso_3166_1_alpha_3"],.6,.6];function qe(T){if(!T||!T.getLayer("regions-fill"))return;const z=ea,ee=Me=>Array.isArray(Me)&&(Me[0]==="get"||Me[0]==="has"||Me[0]==="feature-state"||Me.some(ee)),fe=Me=>Array.isArray(Me)&&(Me[0]==="zoom"||Me.some(fe)),Ae=(Me,Te)=>{if(!T.getLayer(Me))return;const Ze=T.getPaintProperty(Me,Te);Ze!=null&&(ee(Ze)||fe(Ze)||T.setPaintProperty(Me,Te,z(Ze)))};try{Ae("regions-fill","fill-opacity"),Ae("regions-border","line-color"),Ae("regions-border","line-width")}catch{}}function ct(T,z){if(!T||!T.getLayer("regions-fill"))return;const ee=Array.isArray(z)?[...new Set(z.filter(Boolean).map(Ue=>String(Ue).toUpperCase()))].sort():[],fe=["literal",ee],Ae=ee.length?["case",["in",["get","iso_3166_1_alpha_3"],fe],.85,.15]:Ke,Me=ee.length?["case",["in",["get","iso_3166_1_alpha_3"],fe],"#111827","rgba(60,60,80,0.15)"]:et,Te=ee.length?["case",["in",["get","iso_3166_1_alpha_3"],fe],2.5,.3]:Be,Ze=(Ue,gt,Gt)=>{T.getLayer(Ue)&&JSON.stringify(T.getPaintProperty(Ue,gt))!==JSON.stringify(Gt)&&T.setPaintProperty(Ue,gt,Gt)};try{Ze("regions-fill","fill-opacity",Ae),Ze("regions-border","line-color",Me),Ze("regions-border","line-width",Te)}catch{}}function mt(T){var fe,Ae,Me,Te,Ze,Ue,gt,Gt;const z=Z.value;if(T){const ot=Ge.value?sA(T,A.value):null,it=((fe=N.value)==null?void 0:fe.id)==="doxa-regions",yt=ot?{matchExpr:ot}:{};it&&(yt.regionPolygonSource="regions"),(Ae=ne.zoomToLegendRow)==null||Ae.call(ne,T,Object.keys(yt).length?yt:void 0)}if(!T){if(Ge.value){const ot=A.value;ot==="prayer"?f.setPrayerFilter(null):ot==="engagement"?f.setEngagementFilter(null):ot==="adoption"?f.setAdoptionFilter(null):ot==="religion"&&f.setReligionFilter(null)}if(z&&z.getLayer("language-family-pins")){try{z.setFilter("language-family-pins",null)}catch{}t(z,null),xo(z,null),V.syncGlowFilter(null)}z&&z.getLayer("regions-fill")&&(z.setPaintProperty("regions-fill","fill-opacity",ea(.7)),z.setPaintProperty("regions-border","line-color",ea("rgba(60,60,80,0.35)")),z.setPaintProperty("regions-border","line-width",ea(.6))),p.selectedFamily&&p.selectFamily(null),p.selectedLanguage&&p.selectLanguage(null),p.selectedDialect&&((Me=p.selectDialect)==null||Me.call(p,null)),p.selectedRegion&&((Te=p.selectRegion)==null||Te.call(p,null)),Re();return}if(Ge.value){const ot=A.value;ot==="prayer"?f.setPrayerFilter(T.id):ot==="engagement"?f.setEngagementFilter(T.id):ot==="adoption"?f.setAdoptionFilter(T.id):ot==="religion"&&f.setReligionFilter(T.id);return}if(z&&z.getLayer("language-family-pins")&&T.filter){try{z.setFilter("language-family-pins",T.filter)}catch{}t(z,T.filter),xo(z,null),V.syncGlowFilter(T.filter)}const ee=String(T.id||"");if(ee.startsWith("fam:"))(Ze=p.selectFamily)==null||Ze.call(p,T.label);else if(ee.startsWith("lang:"))(Ue=p.selectLanguage)==null||Ue.call(p,T.label);else if(ee.startsWith("dial:"))(gt=p.selectDialect)==null||gt.call(p,{key:ee.slice(5),originalLabels:T.originalLabels||[]});else if(ee.startsWith("bloc:")||ee.startsWith("cluster:")||ee.startsWith("pg:")||ee.startsWith("pgic:")){if(z&&z.getLayer("language-family-pins")&&T.filter){try{z.setFilter("language-family-pins",null)}catch{}t(z,T.filter),xo(z,T.filter),V.syncGlowFilter(T.filter)}}else if(ee.startsWith("region:")||ee.startsWith("block:")||ee.startsWith("country:")){if(z&&z.getLayer("language-family-pins")&&T.filter){try{z.setFilter("language-family-pins",T.filter)}catch{}t(z,T.filter),xo(z,null)}ee.startsWith("region:")&&((Gt=p.selectRegion)==null||Gt.call(p,ee.slice(7))),ee.startsWith("region:")||ct(z,T.isoCodes||[])}}We(()=>f.theme,T=>{$e.theme.value=T==="dark"?"dark":"light"},{immediate:!0}),We(()=>p.selectedFamily,T=>{if(!T)return Ie("fam",null);const z=_a(Xe.value,ee=>ee.id.startsWith("fam:")&&ee.label===T);z&&Ie("fam",{...z,depth:0})}),We(()=>p.selectedLanguage,T=>{if(!T)return Ie("lang",null);const z=_a(Xe.value,ee=>ee.id.startsWith("lang:")&&ee.label===T);z&&Ie("lang",{...z,depth:1})}),We(()=>p.selectedDialect,T=>{if(!(T!=null&&T.key))return Ie("dial",null);const z=`dial:${T.key}`,ee=_a(Xe.value,fe=>fe.id===z);ee&&Ie("dial",{...ee,depth:2})}),We(()=>p.selectedRegion,T=>{if(!T)return Ie("region",null);const z=_a(Fn.value,ee=>ee.id===`region:${T}`);z&&Ie("region",{...z,depth:0})});function St(T){var fe;const z=ie.items.value||[];return(z.length?z:((fe=X==null?void 0:X.items)==null?void 0:fe.value)||[]).flatMap(Ae=>[Ae,...Ae.children||[]]).map(Ae=>({label:Ae.label,color:Ae.color})).filter(Ae=>Ae.label)}const kt=we(!1);async function vo(){var T,z;if(!kt.value){kt.value=!0;try{const[{useMapPoster:ee},{defaultPosterSpec:fe},{printImageBlob:Ae}]=await Promise.all([Ot(()=>Promise.resolve().then(()=>sm),void 0),Ot(()=>Promise.resolve().then(()=>Xf),void 0),Ot(()=>Promise.resolve().then(()=>p2),void 0)]),Me=ee(()=>Z.value),Te=((z=(T=Z.value)==null?void 0:T.getContainer)==null?void 0:z.call(T))||null,Ze=!!Te&&Te.clientWidth>Te.clientHeight,Ue=fe({widthIn:Ze?11:8.5,heightIn:Ze?8.5:11,dpi:200,orientation:Ze?"landscape":"portrait"}),gt=$(N.value)||Le.value||"Doxa Map";Ue.dir=["ar","fa","he","ur"].includes(String(g.value||"").split("-")[0])?"rtl":"ltr",Ue.layout="poster",Ue.slots.title={...Ue.slots.title,text:gt};const Gt=St(!0);Ue.slots.legend={...Ue.slots.legend,rows:Gt,title:Le.value},Ue.slots.scaleBar=!1,Ue.slots.north=!1;const ot=N1(Z.value)==="maplibre";Ue.slots.footer={...Ue.slots.footer,left:"pray.doxa.life",right:new Date().toISOString().slice(0,10),attribution:ot?"© OpenFreeMap © OpenMapTiles © OpenStreetMap":"© Mapbox © OpenStreetMap"};const it=await Me.render(Ue,"png");Ae(it,{labels:{print:n("wall.hud.printNow","Print"),close:n("buttons.close","Close")},widthIn:Ue.widthIn??8.5,heightIn:Ue.heightIn??11,title:gt,alt:gt})||console.error("[research-map] poster print: the host blocked the print frame")}catch(ee){console.error("[research-map] poster export failed:",ee)}finally{kt.value=!1}}}const Io=te(()=>String(b("controls.export_poster")||"Export poster…"));function po(T){const[z,ee]=String(T).split(":");if(z==="poster")return vo();if(z==="packet")return Eo(ee||"full")}Ut("onLegendExport",po),Ut("onLegendExport",po);const Oo=we(!1),ko=te(()=>kt.value||Oo.value);Ut("legendExportBusy",ko);async function Eo(T="full"){var z,ee,fe,Ae;if(!Oo.value){Oo.value=!0;try{const[{usePosterPrints:Me},{defaultPosterSpec:Te},{useMapPoster:Ze},{selectedPinIds:Ue}]=await Promise.all([Ot(()=>Promise.resolve().then(()=>x2),void 0),Ot(()=>Promise.resolve().then(()=>Xf),void 0),Ot(()=>Promise.resolve().then(()=>sm),void 0),Ot(()=>Promise.resolve().then(()=>Iv),void 0)]),gt=D.normalizedPeopleGroups.value||[],Gt=[((ee=(z=Z.value)==null?void 0:z.getFilter)==null?void 0:ee.call(z,"language-family-pins"))||null,pr].filter(Boolean);let ot=gt;if(Gt.length){const xt=Ue(Z.value,{expressions:Gt}),mn=gt.filter(Ui=>xt.has(String(Ui.uniqueId??Ui.id??"")));mn.length?ot=mn:console.warn(`[research-map] packet: ${xt.size} pin(s) selected but no rows matched; printing the full list`)}const it=ot.length;ot.length>50&&(console.warn(`[research-map] packet truncated ${ot.length} → 50 people groups`),ot=ot.slice(0,50));const yt=ot.map(xt=>({slug:String(xt.slug||xt.uniqueId||xt.id||""),name:xt.name,population:xt.population,religion:xt.religionName||xt.religionLabel||xt.religion||"",country_code:xt.countryName||xt.countryIsoLabel||xt.country||xt.countryIso||"",image_url:xt.imageUrl||xt.image_url||""})),ut=Te({widthIn:8.27,heightIn:11.69,dpi:150,orientation:"portrait"});ut.slots.title={...ut.slots.title,text:Le.value||"Doxa Map"},ut.slots.legend={...ut.slots.legend,rows:St(!0),title:Le.value};let Vt="";if(T!=="cards")try{const xt=await Ze(()=>Z.value).render(ut,"png");Vt=await new Promise((mn,Ui)=>{const Wi=new FileReader;Wi.onload=()=>mn(String(Wi.result)),Wi.onerror=Ui,Wi.readAsDataURL(xt)})}catch(xt){console.warn("[research-map] packet map page skipped:",(xt==null?void 0:xt.message)||xt)}const Do=Le.value||$(N.value)||"Doxa Map",La={id:String(((fe=N.value)==null?void 0:fe.id)||"research-map"),label:it>ot.length?`${Do} — ⁦${ot.length} / ${it}⁩`:Do,zoneKey:String(((Ae=N.value)==null?void 0:Ae.id)||"research-map")};await Me({records:()=>yt,lang:()=>String(g.value||"en").split("-")[0],label:()=>La.label,mapImage:()=>Vt||null}).printPacket(La,{variant:T})}catch(Me){console.error("[research-map] packet export failed:",Me)}finally{Oo.value=!1}}}const Bt=we(!1),zt=te(()=>p.selectedFeature),It=te(()=>f.isDarkTheme),xa=te(()=>eh.lightPreset==="night");function dr(){var ee;const T=Z.value;if(!T||!T.getLayer("language-family-pins"))return;const z=xa.value?"#ffffff":["case",[">",["to-number",["get","peoplePraying"],0],0],"#ffffff","#1f2937"];T.setPaintProperty("language-family-pins","circle-stroke-color",z),T.setPaintProperty("language-family-pins","circle-stroke-width",xa.value?Ev((ee=N.value)==null?void 0:ee.colorStrategy):of)}We(xa,dr,{immediate:!1}),We(()=>{var T;return(T=N.value)==null?void 0:T.id},dr),We(()=>f.theme,()=>k.applyTheme(Z.value));function vu(){k.swapTheme(Z.value)}const Nn=we(!1);let oa=null;async function hn(){if(!Nn.value)return oa||(oa=(async()=>{var T,z,ee;try{const fe=await((T=D.loadRegionsData)==null?void 0:T.call(D));fe&&Z.value&&((z=V.addRegionsLayer)==null||z.call(V,fe,"doxa-regions"),qe(Z.value),Z.value.getLayer("regions-fill")&&((ee=N.value)==null?void 0:ee.id)!=="doxa-regions"&&(Z.value.setLayoutProperty("regions-fill","visibility","none"),Z.value.setLayoutProperty("regions-border","visibility","none")),Z.value.getLayer("language-family-pins")&&Z.value.moveLayer("language-family-pins")),Nn.value=!0,D.regionsData.value=null}catch(fe){console.warn("[research-map] regions layer failed:",fe)}finally{oa=null}})(),oa)}function In(T){var fe,Ae;if(T===v.value)return;v.value=T,(fe=f.setActiveTab)==null||fe.call(f,T),Re();const z=W.value.find(Me=>Me.id===T);if(!z||!Z.value)return;k.setLook(k.lookFor(z.colorStrategy),Z.value),z.id==="doxa-regions"&&hn();const ee=dn(z.colorStrategy);if(Z.value.getLayer("language-family-pins")&&(ee!=null&&ee.buildColorExpression)){const Me=z.id==="doxa-regions"?"#a30000":ee.buildColorExpression();Z.value.setPaintProperty("language-family-pins","circle-color",Me),gr(Z.value),z.id==="prayer"?V.startPrayerGlow():V.stopPrayerGlow();const Te=z.id==="doxa-regions";Z.value.getLayer("regions-fill")&&(Z.value.setLayoutProperty("regions-fill","visibility",Te?"visible":"none"),Z.value.setLayoutProperty("regions-border","visibility",Te?"visible":"none")),Z.value.getLayer("language-family-pins")&&Z.value.moveLayer("language-family-pins")}(Ae=C.refreshColors)==null||Ae.call(C)}function Pa(T){var Ue,gt,Gt;const z=T==null?void 0:T.detail;if(!z||(je(z),!((Ue=z.coords)!=null&&Ue.length)))return;const ee=z.coords;if(ee.length===1){(gt=ne.flyToCoords)==null||gt.call(ne,{longitude:ee[0][0],latitude:ee[0][1]},3);return}let fe=1/0,Ae=-1/0,Me=1/0,Te=-1/0;for(const[ot,it]of ee)otAe&&(Ae=ot),itTe&&(Te=it);const Ze=z.kind==="region"?2.2:3;(Gt=ne.fitBounds)==null||Gt.call(ne,[[fe,Me],[Ae,Te]],60,{maxZoom:Ze})}let pr=null;function wu(){const T=(p==null?void 0:p.showClusters)&&((p==null?void 0:p.clusteringMode)||"off")!=="off",z=Number(p==null?void 0:p.clusterPinOpacity);return T&&Number.isFinite(z)?Math.min(1,Math.max(0,z)):1}function xo(T,z){var Ae;if(z!==void 0&&(pr=z||null),!T||!((Ae=T.getLayer)!=null&&Ae.call(T,"language-family-pins")))return;const ee=wu(),fe=pr?["case",pr,ee,0]:["case",["has","uniqueId"],ee,ee];try{if(JSON.stringify(T.getPaintProperty("language-family-pins","circle-opacity"))===JSON.stringify(fe))return;T.setPaintProperty("language-family-pins","circle-opacity",fe),T.setPaintProperty("language-family-pins","circle-stroke-opacity",fe),T.getLayer("language-family-pins-shadow")&&T.setPaintProperty("language-family-pins-shadow","circle-opacity",fe)}catch{}}We(()=>[p==null?void 0:p.clusterPinOpacity,p==null?void 0:p.clusteringMode,p==null?void 0:p.showClusters],()=>xo(Z.value));const go={family:null,language:null,dialect:null,region:null,prayer:null,engagement:null,adoption:null};function gr(T){xo(T,null),T.setFilter("language-family-pins",null),t(T,null),V.syncGlowFilter(null),ct(T,[]),T.getLayer("regions-fill")&&T.setPaintProperty("regions-fill","fill-outline-color",null),go.family=go.language=go.dialect=go.region=null,go.prayer=go.engagement=go.adoption=null,f.prayerFilter&&f.setPrayerFilter(null),f.engagementFilter&&f.setEngagementFilter(null),f.adoptionFilter&&f.setAdoptionFilter(null),f.religionFilter&&f.setReligionFilter(null),C.setSelectionFilter(null),p.selectedFamily&&p.selectFamily(null),p.selectedLanguage&&p.selectLanguage(null),p.selectedDialect&&p.selectDialect(null);try{$e&&$e.selection&&$e.selection.value&&($e.selection.value=null)}catch{}}let na=null,Sa=0;function je(T){var Ze,Ue,gt,Gt,ot;const z=Z.value;if(!z||!z.getLayer("language-family-pins"))return;let ee,fe,Ae;if(T.kind==="family")Ae="family",ee="languageFamily",fe=T.familyKey;else if(T.kind==="language")Ae="language",ee="language",fe=T.languageKey;else if(T.kind==="region")Ae="region",ee="doxaRegion",fe=T.regionKey;else if(T.kind==="prayer")Ae="prayer",ee=T.property||"peoplePraying",fe=T.expectedValue;else if(T.kind==="engagement")Ae="engagement",ee=T.property||"engagementStatus",fe=T.expectedValue;else if(T.kind==="adoption")Ae="adoption",ee=T.property||"adoptionStatus",fe=T.expectedValue;else if(T.kind==="religion")Ae="religion",ee=T.property||"religion",fe=T.expectedValue;else if(T.kind==="dialect")Ae="dialect",ee="language",fe=T.dialectKey||"";else{gr(z),Re();for(const it of Object.keys(go))go[it]=null;na=null,Sa=0;return}const Me=Date.now(),Te=`${Ae}|${fe}`;if(!(na===Te&&Me-Sa<80)){if(na=Te,Sa=Me,go[Ae]===fe){gr(z),Re(),na=null,Sa=0;return}for(const it of Object.keys(go))go[it]=null;if(go[Ae]=fe,Ae==="family"?(Ze=p.selectFamily)==null||Ze.call(p,fe):Ae==="region"?(Ue=p.selectRegion)==null||Ue.call(p,fe):Ae==="language"?(gt=p.selectLanguage)==null||gt.call(p,fe):Ae==="dialect"&&((Gt=p.selectDialect)==null||Gt.call(p,{key:fe,originalLabels:T.originalLabels||[]})),C.setSelectionFilter({property:ee,value:fe}),Ae==="region"){if(z.setFilter("language-family-pins",["==",["get","doxaRegion"],fe]),t(z,["==",["get","doxaRegion"],fe]),xo(z,null),z.getLayer("regions-fill")){const it=((ot=V.regionIsoMap)==null?void 0:ot.value)||{},yt=Do=>String(Do).toLowerCase().replace(/[^a-z]/g,""),ut=yt(fe);let Vt=it[fe]||[];if(!Vt.length){for(const[Do,La]of Object.entries(it))if(yt(Do)===ut){Vt=La;break}}ct(z,Vt)}}else{z.setFilter("language-family-pins",null);let it;if(Ae==="prayer"){const yt=["to-number",["get",ee]];fe==="noPrayer"?it=["==",yt,0]:fe==="fullPrayer"?it=[">=",yt,un]:fe==="hasPrayer"?it=["all",[">",yt,0],["<",yt,un]]:it=["==",["get",ee],fe]}else if(Ae==="engagement")it=["==",["get",ee],fe==="hasEngagement"];else if(Ae==="adoption")it=["==",["get",ee],fe==="hasAdoption"];else if(Ae==="religion")it=["==",["slice",["coalesce",["get",ee],""],0,1],fe];else if(T.filterExpr)it=T.filterExpr;else if(Ae==="language")it=["any",["==",["get",ee],fe],["==",["slice",["get",ee],0,fe.length+1],fe+","],["in"," "+fe,["get",ee]]];else if(Ae==="dialect"){const yt=T.originalLabels||[];yt.length===1?it=["==",["get",ee],yt[0]]:yt.length>1?it=["in",["get",ee],["literal",yt]]:it=["==",["get",ee],fe]}else it=["==",["get",ee],fe];xo(z,it),t(z,it),V.syncGlowFilter(it),z.getLayer("regions-fill")&&(z.setPaintProperty("regions-fill","fill-opacity",ea(.2)),z.setPaintProperty("regions-border","line-color",ea("rgba(60,60,80,0.35)")),z.setPaintProperty("regions-border","line-width",ea(.6)))}}}function oo(T,{map:z,filterLayerId:ee}){const fe=T.label;try{z.setFilter(ee,null)}catch{}const Ae=Object.keys(Wo).find(Me=>Wo[Me]===fe);if(Ae){const Me={id:Ae,label:fe,depth:0},Te=()=>{try{z.setFilter(ee,null)}catch{}mt(Me),$e&&$e.selection&&($e.selection.value=Me)};v.value!=="religion"&&In("religion"),Yt(Te)}}function Po(T,{map:z,filterLayerId:ee}){const fe=T.label,Ae=Ue=>String(Ue).toLowerCase().replace(/[^a-z0-9]/g,""),Me=Ue=>String(Ue||"").replace(/\s*\((?:Region|Bloc)\)\s*$/i,""),Te=Ae(fe),Ze=()=>{try{z.setFilter(ee,null)}catch{}const Ue=_a(Fn.value,gt=>(gt.id.startsWith("region:")||gt.id.startsWith("block:"))&&Ae(Me(gt.label))===Te);Ue&&(mt(Ue),$e&&$e.selection&&($e.selection.value=Ue))};v.value!=="doxa-regions"?(In("doxa-regions"),Promise.resolve(hn()).finally(()=>Yt(Ze))):Ze()}function On(T){var ee,fe,Ae,Me;if(Array.isArray(T.bounds)&&T.bounds.length===4){const[Te,Ze,Ue,gt]=T.bounds;(ee=ne.fitBounds)==null||ee.call(ne,[[Te,Ze],[Ue,gt]],60)}else Array.isArray(T.center)&&T.center.length===2&&((fe=ne.flyTo)==null||fe.call(ne,T.center));const z=Gv(T,D.normalizedPeopleGroups.value||[]);if(z&&B(z),z&&((Ae=N.value)==null?void 0:Ae.id)!=="doxa-regions"&&de.showCountry(z),z&&((Me=N.value)==null?void 0:Me.id)==="doxa-regions"){const Te=()=>{const Ze=_a(Fn.value,Ue=>Ue.id.startsWith("country:")&&(Ue.isoCodes||[]).includes(z));Ze&&(mt(Ze),$e&&$e.selection&&($e.selection.value=Ze))};Promise.resolve(hn()).finally(()=>Yt(Te))}}We(()=>p.filters,()=>{var T,z;(T=V.applyFilters)==null||T.call(V,p.filters),(z=C.applyFilters)==null||z.call(C,p.filters)},{deep:!0});let Mo=!1,Vo="";We(()=>{var T;return(T=s==null?void 0:s.value)==null?void 0:T.externalFilters},T=>{var z,ee;if(!(!T||typeof T!="object"||!p)){Mo=!0;try{if("region"in T){const fe=T.region||null;(fe||p.selectedRegion)&&((z=p.selectRegion)==null||z.call(p,fe))}if("religion"in T){const fe=String(T.religion||"").trim(),Ae=fe?Object.keys(Wo).find(Me=>String(Wo[Me]).toLowerCase()===fe.toLowerCase()):"";fe?Ae&&(v.value!=="religion"&&In("religion"),Yt(()=>f.setReligionFilter(Ae))):f.religionFilter&&f.setReligionFilter(null)}if("fitSlugs"in T&&xu(T.fitSlugs),"language"in T){const fe=T.language||null;(fe||p.selectedLanguage)&&((ee=p.selectLanguage)==null||ee.call(p,fe))}}finally{Yt(()=>{Mo=!1})}}},{deep:!0,immediate:!0});let ss=null,zi=null,hr=null,is=null;typeof window<"u"&&(window.__researchMapFilterState=ss=()=>{var T,z;return{selectedRegion:(p==null?void 0:p.selectedRegion)||"",externalRegion:((z=(T=s==null?void 0:s.value)==null?void 0:T.externalFilters)==null?void 0:z.region)||"",religionFamily:Wo[f==null?void 0:f.religionFilter]||"",selectedLanguage:(p==null?void 0:p.selectedLanguage)||""}},window.__researchMapPinOpacity=zi=()=>{var T,z;try{return((z=(T=Z.value)==null?void 0:T.getPaintProperty)==null?void 0:z.call(T,"language-family-pins","circle-opacity"))??null}catch{return null}},window.__researchMapClusterDraw=hr=()=>{var ee,fe;const T=Z.value,z={};try{for(const Ae of((fe=(ee=T==null?void 0:T.getStyle)==null?void 0:ee.call(T))==null?void 0:fe.layers)||[]){if(!/^(mapbox-clusters|cluster-lines)/.test(Ae.id))continue;let Me=0;try{Me=T.queryRenderedFeatures({layers:[Ae.id]}).length}catch{Me=-1}z[Ae.id]={visibility:Ae.layout&&Ae.layout.visibility||"visible",rendered:Me}}}catch{}return z},window.__researchMapVocabulary=is=T=>{var fe;const z=((fe=D==null?void 0:D.normalizedPeopleGroups)==null?void 0:fe.value)||[],ee=new Set;for(const Ae of z){if(T==="religionFamily"){const Te=Wo[String((Ae==null?void 0:Ae.religion)||"").charAt(0)];Te&&ee.add(Te);continue}const Me=Ae&&Ae[T];typeof Me=="string"&&Me&&ee.add(Me)}return[...ee].sort()});const ls=Co();function ji(){var T,z,ee,fe;try{return((fe=(ee=(z=(T=ls==null?void 0:ls.proxy)==null?void 0:T.$el)==null?void 0:z.getRootNode)==null?void 0:ee.call(z))==null?void 0:fe.host)||null}catch{return null}}function fr(){var yt;if(Mo||typeof window>"u")return;const T=ji();if(!T)return;const z=Wo[f==null?void 0:f.religionFilter]||"",ee=(p==null?void 0:p.selectedLanguage)||"",fe=(p==null?void 0:p.selectedDialect)||null,Ae=Array.isArray(fe==null?void 0:fe.originalLabels)?fe.originalLabels.map(ut=>String(ut).trim()).filter(Boolean):[],Me=((yt=D==null?void 0:D.normalizedPeopleGroups)==null?void 0:yt.value)||[],Te=ut=>{const Vt=ut&&(ut.language??ut.primary_language);return String((Vt&&typeof Vt=="object"?Vt.label:Vt)||"").trim()},Ze=(ut,Vt)=>ut===Vt||ut.startsWith(Vt+",")||ut.includes(" "+Vt),Ue=Ae.length?Me.filter(ut=>Ae.includes(Te(ut))):ee?Me.filter(ut=>Ze(Te(ut),ee.trim())):[],gt=[...new Set(Ue.map(ut=>{var Vt,Do;return String(((Do=(Vt=ut==null?void 0:ut._raw)==null?void 0:Vt.primary_language)==null?void 0:Do.value)||(ut!=null&&ut.language&&typeof ut.language=="object"?ut.language.value:"")||"").trim()}).filter(Boolean))],Gt=gt.length===1?gt[0]:"",ot={region:(p==null?void 0:p.selectedRegion)||"",religion:z,language:Ae.length?Ae.join(" · "):ee,languageCode:Gt,languageCodes:gt},it=!ot.region&&!ot.religion&&!ot.language&&!ot.languageCode;if(it&&Bi){const ut=typeof performance<"u"?performance.now():Date.now();if(fn||(fn=ut),ut-fnclearTimeout(aa)),We(()=>{var T;return[p==null?void 0:p.selectedRegion,p==null?void 0:p.selectedLanguage,(T=p==null?void 0:p.selectedDialect)==null?void 0:T.key,f==null?void 0:f.religionFilter]},()=>mr()),We(()=>p.selectedRegion,T=>{je(T?{kind:"region",regionKey:T}:{kind:null})}),We(()=>p.selectedFamily,T=>{T?je({kind:"family",familyKey:T}):!p.selectedLanguage&&!p.selectedDialect&&je({kind:null})}),We(()=>p.selectedLanguage,T=>{T?je({kind:"language",languageKey:T}):!p.selectedFamily&&!p.selectedDialect&&je({kind:null})}),We(()=>p.selectedDialect,T=>{T!=null&&T.key?je({kind:"dialect",dialectKey:T.key,originalLabels:T.originalLabels||[]}):!p.selectedFamily&&!p.selectedLanguage&&je({kind:null})}),We(()=>f.prayerFilter,T=>{je(T?{kind:"prayer",property:"peoplePraying",expectedValue:T}:{kind:null})}),We(()=>f.engagementFilter,T=>{je(T?{kind:"engagement",property:"engagementStatus",expectedValue:T}:{kind:null})}),We(()=>f.adoptionFilter,T=>{je(T?{kind:"adoption",property:"adoptionStatus",expectedValue:T}:{kind:null})}),We(()=>f.religionFilter,T=>{je(T?{kind:"religion",property:"religion",expectedValue:T}:{kind:null})});function ku(){try{return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function xu(T){var Vt,Do,La;const z=Array.isArray(T)?T.filter(Yo=>typeof Yo=="string"&&Yo):[],ee=z.length?`${z.length}:${z[0]}:${z[z.length-1]}`:"";if(ee===Vo||(Vo=ee,!z.length))return;const fe=new Set(z),Ae=((Vt=D==null?void 0:D.normalizedPeopleGroups)==null?void 0:Vt.value)||[];let Me=1/0,Te=1/0,Ze=-1/0,Ue=-1/0,gt=0;for(const Yo of Ae){if(!Yo||!fe.has(Yo.slug))continue;const xt=Number(Yo.longitude??Yo.lng),mn=Number(Yo.latitude??Yo.lat);!Number.isFinite(xt)||!Number.isFinite(mn)||(xtZe&&(Ze=xt),mn>Ue&&(Ue=mn),gt++)}if(!gt)return;const Gt=Ze-Me,ot=Ue-Te,it={longitude:(Me+Ze)/2,latitude:(Te+Ue)/2},yt=Gt>$A?{c:it,z:_A}:gt===1||Gtp.showClusters,async T=>{ra||(T&&(!p.clusteringMode||p.clusteringMode==="off")?p.clusteringMode="mst":!T&&p.clusteringMode!=="off"&&(p.clusteringMode="off"),await Gi())}),We(()=>p.clusteringMode,async()=>{ra||await Gi()});async function Pu(T){var z,ee,fe,Ae,Me,Te;p.registerMap(K,Z.value),I1(Z.value,"mercator"),k.applyTheme(Z.value),T!=null&&T.length&&(V.addLanguageFamilyLayer(T,((z=N.value)==null?void 0:z.colorStrategy)??"languageFamily"),((ee=N.value)==null?void 0:ee.id)==="doxa-regions"&&((fe=Z.value)!=null&&fe.getLayer("language-family-pins"))&&Z.value.setPaintProperty("language-family-pins","circle-color","#4b5563"),xo(Z.value),((Ae=N.value)==null?void 0:Ae.id)==="prayer"&&V.startPrayerGlow(),(Me=C.setData)==null||Me.call(C,T),H.initialize()),((Te=N.value)==null?void 0:Te.id)==="doxa-regions"&&(typeof window<"u"&&window.requestIdleCallback?Ue=>window.requestIdleCallback(Ue,{timeout:2e3}):Ue=>setTimeout(Ue,800))(()=>{hn()}),dr(),p.setMapReady(K),xe.value=!0}let cs=null,Aa=null,br=null;function Tm(T){const z=O.value;z&&(getComputedStyle(z).getPropertyValue("--map-radius").trim()||(z.style.setProperty("--map-radius","16px"),z.style.setProperty("--map-radius-sm","8px")),T>=700?(z.style.setProperty("--map-btn-size","40px"),z.style.setProperty("--map-toolbar-gap","8px"),z.style.setProperty("--map-font-md","13px"),z.style.setProperty("--map-font-sm","11px"),z.style.setProperty("--map-legend-width","380px")):T>=500?(z.style.setProperty("--map-btn-size","36px"),z.style.setProperty("--map-toolbar-gap","6px"),z.style.setProperty("--map-font-md","12px"),z.style.setProperty("--map-font-sm","10px"),z.style.setProperty("--map-legend-width","360px")):(z.style.setProperty("--map-btn-size","32px"),z.style.setProperty("--map-toolbar-gap","5px"),z.style.setProperty("--map-font-md","11px"),z.style.setProperty("--map-font-sm","10px"),z.style.setProperty("--map-legend-width","280px")))}function Hi(T){const z=O.value;if(z)try{z.dispatchEvent(new CustomEvent("dxmaps:mapinfo-pending",{bubbles:!0,composed:!0,detail:{pending:T}}))}catch{}}const Em=()=>{!xe.value&&!Q.value&&Hi(!0)};return We(Q,T=>{T&&Hi(!1)}),mo(()=>{Hi(!0),window.addEventListener("dxmaps:mapinfo-host",Em)}),eo(()=>{window.removeEventListener("dxmaps:mapinfo-host",Em),xe.value||Hi(!1)}),mo(async()=>{var ee,fe,Ae,Me;(ee=f.init)==null||ee.call(f),v.value=((fe=W.value[0])==null?void 0:fe.id)??"doxa-regions",f.isMobile?(Ae=f.collapseLegend)==null||Ae.call(f):(Me=f.openLegend)==null||Me.call(f),O.value&&(Tm(O.value.getBoundingClientRect().width),typeof ResizeObserver<"u"&&(cs=new ResizeObserver(Te=>{for(const Ze of Te)Tm(Ze.contentRect.width)}),cs.observe(O.value))),window.addEventListener("doxa:legend-row-click",Fe),window.addEventListener("legend:highlight",Pa);const T=D.loadData().catch(Te=>(console.error("[research-map] data load failed:",Te),{normalizedPeopleGroups:[]})),z=()=>!Se.value||!Se.value.isConnected;try{await ce()}catch(Te){if(z())return;console.error("[research-map] Map failed to initialize —",Te),Q.value=String((Te==null?void 0:Te.message)||Te);return}if(!z()){{const Te=Z.value?dt(Z.value):null;Te&&Te!==Z.value&&(Z.value=null,Z.value=Ra(Te))}if(!Z.value){console.error("[research-map] Map failed to initialize — check token and container"),Q.value=b("dashboard.map_init_failed");return}Z.value.once("style.load",async()=>{try{const{normalizedPeopleGroups:Te}=await T;await Pu(Te)}catch(Te){console.error("[research-map] onMapReady failed:",Te),Q.value=String((Te==null?void 0:Te.message)||Te)}}),o(Z.value),br=()=>o(Z.value);try{Aa=new ResizeObserver(br);const Te=Z.value.getContainer&&Z.value.getContainer()||null;Te&&Aa.observe(Te);const Ze=Te?Rf(Te):null;Ze&&Aa.observe(Ze),document.body&&Aa.observe(document.body)}catch{}window.addEventListener("resize",br)}}),eo(()=>{const T=z=>{try{z()}catch(ee){console.warn("[research-map] teardown step failed",ee)}};try{T(()=>window.removeEventListener("doxa:legend-row-click",Fe)),T(()=>window.removeEventListener("legend:highlight",Pa)),T(()=>{cs&&(cs.disconnect(),cs=null)}),T(()=>{Aa&&(Aa.disconnect(),Aa=null)}),T(()=>{br&&(window.removeEventListener("resize",br),br=null)}),T(()=>{var z;return(z=V.stopPrayerGlow)==null?void 0:z.call(V)}),T(()=>{var z;return(z=V.cleanup)==null?void 0:z.call(V)}),T(()=>{var z;return(z=C.cleanup)==null?void 0:z.call(C)}),T(()=>{var z;return(z=H.cleanup)==null?void 0:z.call(H)}),T(()=>{var z;return(z=p.unregisterMap)==null?void 0:z.call(p,K)}),T(()=>{typeof window>"u"||(window.__researchMapFilterState===ss&&delete window.__researchMapFilterState,window.__researchMapPinOpacity===zi&&delete window.__researchMapPinOpacity,window.__researchMapClusterDraw===hr&&delete window.__researchMapClusterDraw,window.__researchMapVocabulary===is&&delete window.__researchMapVocabulary)})}finally{ke()}}),(T,z)=>(oe(),me("div",{ref_key:"rmRoot",ref:O,class:Ye(["rm-root",{"rm-dark":It.value,"dsm-dark":It.value}])},[q.value?(oe(),me("div",{key:0,ref_key:"tabBar",ref:se,class:"rm-tab-bar"},[(oe(!0),me(rt,null,co(W.value,ee=>(oe(),me(rt,{key:ee.id},[R("button",{class:Ye(["rm-tab",{active:v.value===ee.id}]),onClick:fe=>In(ee.id)},_e($(ee)),11,lA),ee.sepAfter?(oe(),me("div",cA)):Ee("",!0)],64))),128))],512)):Ee("",!0),R("div",uA,[!xe.value&&!Q.value?(oe(),me("div",dA,_e(n("dashboard.map_loading","Research map loading…")),1)):Ee("",!0),Q.value?(oe(),me("div",pA,_e(n("allPeopleGroups.loadError","The map could not be loaded."))+" "+_e(Q.value),1)):Ee("",!0),R("div",{ref_key:"mapContainer",ref:Se,class:"rm-map-canvas"},null,512),z[4]||(z[4]=R("div",{class:"map-scroll-edge map-scroll-edge--left"},null,-1)),z[5]||(z[5]=R("div",{class:"map-scroll-edge map-scroll-edge--right"},null,-1)),ge(l)!=="mapbox"?(oe(),me("div",{key:2,class:"rm-provider-badge","data-provider":ge(l)},_e(ge(h)),9,gA)):Ee("",!0),xe.value&&ge(Z)&&c.value?(oe(),ht(kx,{key:3,ref_key:"geocoderRef",ref:he,"map-instance":ge(Z),"access-token":ge(i),provider:ge(l),"data-source-id":ge(x),"is-dark":It.value,placeholder:F.value,"active-context":I.value,onPeopleGroupResult:ge(st),onAggregateResult:ge(pt),onClear:ge(_t)},null,8,["map-instance","access-token","provider","data-source-id","is-dark","placeholder","active-context","onPeopleGroupResult","onAggregateResult","onClear"])):Ee("",!0),Ee("",!0),xe.value&&ge(Z)?(oe(),ht(Zk,{key:5,"has-geocoder":c.value},{default:fo(()=>[ft(Kx,{"is-dark":It.value},null,8,["is-dark"]),ft(Jk,{map:ge(Z),"is-dark":It.value},null,8,["map","is-dark"]),ft(Qk,{map:ge(Z),"is-dark":It.value},null,8,["map","is-dark"]),ft(ex,{map:ge(Z),"is-dark":It.value},null,8,["map","is-dark"]),ft(nx,{"map-container":Se.value,"is-dark":It.value},null,8,["map-container","is-dark"]),ft(rx,{"is-dark":It.value,onToggle:vu},null,8,["is-dark"]),ft(Qn,{"is-dark":It.value,active:kt.value,disabled:kt.value,title:Io.value,class:"export-poster-btn","aria-busy":kt.value?"true":"false",onClick:vo},{default:fo(()=>[...z[3]||(z[3]=[R("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[R("path",{d:"M12 3v12M7 10l5 5 5-5M5 21h14"})],-1)])]),_:1},8,["is-dark","active","disabled","title","aria-busy"]),L.share?(oe(),ht(Wx,{key:0,"is-dark":It.value,"embed-path":"doxa-research-map/research-map/index.html"},null,8,["is-dark"])):Ee("",!0)]),_:1},8,["has-geocoder"])):Ee("",!0),xe.value&&u.value?(oe(),ht(Yk,{key:6,"legend-type":A.value,"is-dark":It.value},null,8,["legend-type","is-dark"])):Ee("",!0),xe.value?(oe(),ht(cP,{key:7,"is-open":Bt.value,onClose:z[1]||(z[1]=ee=>Bt.value=!1),onOpenPoster:vo},{default:fo(()=>[ft(OP)]),_:1},8,["is-open"])):Ee("",!0),R("div",{class:"rm-legend-desktop-slot",style:Rt(d.value?{"--stl-top":d.value}:null)},[xe.value&&ge(f).legendMode==="detail"&&ge(f).selectedPeopleGroup?(oe(),ht(Ik,{key:0,"legend-type":A.value,"popup-action":w.value,"initially-collapsed":!1,"is-dark":It.value},null,8,["legend-type","popup-action","is-dark"])):Ee("",!0),Rs(R("div",null,[xe.value?(oe(),ht(Tf,{key:0,nodes:ae.value,tabs:pe.value,title:Le.value,hideTabs:re.value,columnLabel:Ce.value,progress:ge(De),open:Pe.value,"export-enabled":fA,onSelect:mt,onExport:po,"onUpdate:open":Ve},null,8,["nodes","tabs","title","hideTabs","columnLabel","progress","open"])):Ee("",!0)],512),[[up,!(ge(f).legendMode==="detail"&&ge(f).selectedPeopleGroup)]])],4),R("div",hA,[xe.value?(oe(),ht(ge(a),{key:0,"legend-type":A.value,"popup-action":w.value,"is-dark":It.value},null,8,["legend-type","popup-action","is-dark"])):Ee("",!0)]),xe.value&&zt.value?(oe(),ht(ge(r),{key:8,feature:zt.value,action:w.value,dark:It.value,onClose:z[2]||(z[2]=ee=>ge(p).selectFeature(null))},null,8,["feature","action","dark"])):Ee("",!0)])],2))}}},Symbol.toStringTag,{value:"Module"})),kA="",xA={class:"legend-sheet-root"},PA=["src","alt"],SA={key:0,class:"pull-tab-handle"},AA=["aria-expanded","aria-label"],LA=["aria-label"],CA=["aria-expanded","aria-label"],TA={class:"collapsed-detail-title"},EA={class:"legend-content"},MA=["aria-expanded","aria-label"],RA=["aria-expanded","aria-label"],Df=80,zf=48,FA=44,NA=24,jf="lm-on",IA="dxmaps:legend-sheet",Bf="--legend-sheet-h",OA=4e3,Gf=Object.freeze(Object.defineProperty({__proto__:null,default:ln({__name:"LegendMobile",props:{legendType:{type:String,required:!0},nodes:{type:Array,default:null},tabs:{type:Array,default:null},defaultTab:{type:Number,default:0},columnLabel:{type:String,default:null},title:{type:String,default:null},columns:{type:Array,default:null},isDark:{type:Boolean,default:!1},popupAction:{type:String,default:"pray",validator:e=>["pray","adopt","none"].includes(e)},disableCollapse:{type:Boolean,default:!1}},setup(e){const{t}=jt();Zt(` +`,"research-map");const s=He("profileConfig"),i=He("mapboxToken"),l=rh(s),c=te(()=>{var T;return((T=s==null?void 0:s.value)==null?void 0:T.search)===!1?!1:l==="mapbox"}),u=te(()=>{var T;return((T=s==null?void 0:s.value)==null?void 0:T.legendTools)!==!1}),d=te(()=>c.value?null:u.value&&Sf((A==null?void 0:A.value)??A)?"56px":"14px"),h=F1(l),x=He("dataSource");He("colorSet");const P=He("instanceId",null),_=(()=>{var z;const T=(z=s==null?void 0:s.value)==null?void 0:z.locale;return T&&Za.includes(T)?T:null})(),{locale:g,t:b,te:m}=jt();_&&(g.value=_);function $(T){const z="tabs."+((T==null?void 0:T.i18nKey)||(T==null?void 0:T.id));return T&&m(z)?b(z):(T==null?void 0:T.label)??""}const p=He("mapStore"),y=He("dataStore"),f=He("uiStore"),k=p1(f),L={doxaRegions:!0,adoption:!1,share:!0,hamburgerMenu:!1,geocoderPersistAcrossTabs:!1},G=[{id:"prayer",colorStrategy:"prayerProgress",legend:"prayer",popup:"pray",feature:null},{id:"adoption",colorStrategy:"adoption",legend:"adoption",popup:"adopt",feature:"adoption"},{id:"engagement",colorStrategy:"engagement",legend:"engagement",popup:"pray",feature:null,sepAfter:!0},{id:"affinity-blocks",colorStrategy:"affinityBlock",legend:"affinity-block",popup:"pray",feature:null},{id:"doxa-regions",colorStrategy:"doxaRegion",legend:"doxa-regions",popup:"pray",feature:"doxaRegions",i18nKey:"regions"},{id:"language-families",colorStrategy:"languageFamily",legend:"language-family",popup:"pray",feature:null},{id:"religion",colorStrategy:"religion",legend:"religion",popup:"pray",feature:null}].filter(T=>!T.feature||L[T.feature]),W=te(()=>G),q=te(()=>!0),v=we(null),N=te(()=>W.value.find(T=>T.id===v.value)??W.value[0]);k.setLook(k.lookFor((Mm=N.value)==null?void 0:Mm.colorStrategy)),We(()=>{var T;return(T=N.value)==null?void 0:T.colorStrategy},T=>k.setLook(k.lookFor(T),Z.value));const A=te(()=>{var T;return((T=N.value)==null?void 0:T.legend)??"default"}),w=te(()=>{var T;return((T=N.value)==null?void 0:T.popup)??"pray"}),j={"language-families":"search.tabPlaceholder.languageFamilies","affinity-blocks":"search.tabPlaceholder.affinityBlocks","doxa-regions":"search.tabPlaceholder.regions",religion:"search.tabPlaceholder.religion"},F=te(()=>{var z;const T=j[(z=N.value)==null?void 0:z.id];return T&&m(T)?b(T):""}),U={"affinity-blocks":"people-groups",prayer:"people-groups",adoption:"people-groups",engagement:"people-groups","language-families":"language","doxa-regions":"regions",religion:"religion"},I=te(()=>{var T;return U[(T=N.value)==null?void 0:T.id]||""}),K=(P==null?void 0:P.value)||P||"research-map-"+Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,8);Ut("mapId",K);const O=we(null),se=we(null),he=we(null),ye=new Map;We(()=>v==null?void 0:v.value,async(T,z)=>{var Ae,Me,Te;if(z!==void 0&&T!==z){z&&ye.set(z,f.legendState);const Ze=ye.get(T)||(f.isMobile?"collapsed":"open");Ze==="fullyOpen"?(Ae=f.fullyOpenLegend)==null||Ae.call(f):Ze==="open"?(Me=f.openLegend)==null||Me.call(f):(Te=f.collapseLegend)==null||Te.call(f)}await Yt();const ee=se.value,fe=ee==null?void 0:ee.querySelector(".rm-tab.active");if(ee&&fe&&ee.scrollWidth>ee.clientWidth+1){const Ze=ee.getBoundingClientRect(),Ue=fe.getBoundingClientRect(),gt=ee.scrollLeft+(Ue.left-Ze.left)-(Ze.width-Ue.width)/2,Gt=ee.scrollWidth-ee.clientWidth,ot=Math.max(0,Math.min(Gt,gt));typeof ee.scrollTo=="function"?ee.scrollTo({left:ot,behavior:"smooth"}):ee.scrollLeft=ot}});const Se=we(null),xe=we(!1),Q=we(null),{map:Z,initializeMap:ce,destroy:ke}=X1({containerRef:Se,accessToken:i.value,provider:l,style:((Rm=s==null?void 0:s.value)==null?void 0:Rm.style)??k.bootStyle(),config:k.bootConfig,center:((Fm=s==null?void 0:s.value)==null?void 0:Fm.center)??Ko.center??[20,10],zoom:((Nm=s==null?void 0:s.value)==null?void 0:Nm.zoom)??Ko.zoom??1.8,pitch:((Im=s==null?void 0:s.value)==null?void 0:Im.pitch)??Ko.pitch??0,bearing:((Om=s==null?void 0:s.value)==null?void 0:Om.bearing)??Ko.bearing??0,minZoom:((Dm=s==null?void 0:s.value)==null?void 0:Dm.minZoom)??Ko.minZoom??.5,maxZoom:mA}),M=new mf({sourcesConfig:ma,locale:_,profileConfig:s}),D=Jv({mapId:K,dataSourceId:x.value,dataSourceManager:M,dataStore:y,markRaw:T=>T});async function B(T){const z=String(T||"").trim().toUpperCase();if(z.length!==3)return;await hn();const ee=Z.value;if(!ee||!ee.getLayer("regions-fill"))return;ee.setLayoutProperty("regions-fill","visibility","visible"),ee.setLayoutProperty("regions-border","visibility","visible");const fe=["literal",[z]];ee.setPaintProperty("regions-fill","fill-opacity",["case",["in",["get","iso_3166_1_alpha_3"],fe],.3,.02]),ee.setPaintProperty("regions-border","line-color",["case",["in",["get","iso_3166_1_alpha_3"],fe],"#111827","rgba(60,60,80,0.15)"]),ee.setPaintProperty("regions-border","line-width",["case",["in",["get","iso_3166_1_alpha_3"],fe],2.5,.3]),ee.getLayer("language-family-pins")&&ee.moveLayer("language-family-pins")}const V=Fv({getMap:()=>Z.value,mapId:K,getLanguageFamilyColor:T=>{var ee,fe;const z=dn((ee=N.value)==null?void 0:ee.colorStrategy);return((fe=z==null?void 0:z.colors)==null?void 0:fe[T])??(z==null?void 0:z.fallback)??"#7c8cf8"},getNormalizedPeopleGroups:()=>D.normalizedPeopleGroups.value||[]});tf({getMap:()=>Z.value,mapId:K,getLanguageFamilyColor:()=>"#7c8cf8",getNormalizedPeopleGroups:()=>D.normalizedPeopleGroups.value||[]});const ne=Ov({getMap:()=>Z.value,mapId:K,mapStore:p,defaultCenter:((zm=s==null?void 0:s.value)==null?void 0:zm.center)??[20,10],defaultZoom:((jm=s==null?void 0:s.value)==null?void 0:jm.zoom)??1.8}),H=zv({getMap:()=>Z.value,getActivePinColor:T=>{var ee,fe;const z=dn(((ee=N.value)==null?void 0:ee.colorStrategy)??"languageFamily");return((fe=z==null?void 0:z.getColor)==null?void 0:fe.call(z,T))??"#1a1a1a"}});let le=null,be=null;function E(){return le?Promise.resolve(le):(be||(be=Ot(()=>Promise.resolve().then(()=>WA),void 0).then(T=>(le=T.useMapClustering({getMap:()=>Z.value,mapId:K,mapStore:p,getPeopleGroups:()=>D.normalizedPeopleGroups.value||[],getClusterColor:()=>{var z,ee;return((ee=dn((z=N.value)==null?void 0:z.colorStrategy))==null?void 0:ee.fallback)??"#7c8cf8"}}),le))),be)}const C={setData(T){var z;(z=le==null?void 0:le.setData)==null||z.call(le,T)},applyFilters(T){var z;(z=le==null?void 0:le.applyFilters)==null||z.call(le,T)},refreshColors(){var T;(T=le==null?void 0:le.refreshColors)==null||T.call(le)},cleanup(){var T;(T=le==null?void 0:le.cleanup)==null||T.call(le)},async setEnabled(T){var z,ee;(ee=(z=await E()).setEnabled)==null||ee.call(z,T)},async setMode(T){var z,ee;(ee=(z=await E()).setMode)==null||ee.call(z,T)},_pendingSelectionFilter:null,setSelectionFilter(T){this._pendingSelectionFilter=T||null,le!=null&&le.setSelectionFilter&&le.setSelectionFilter(T)},flushSelectionFilter(){le!=null&&le.setSelectionFilter&&le.setSelectionFilter(this._pendingSelectionFilter)}},X=ts({});Ut("normalizedPeopleGroups",D.normalizedPeopleGroups);const de=Wv(()=>Z.value),$e=DP(K);zP($e);const ve=iA({map:Z,activeTab:N,countryOutline:de,regionIdle:ea,mapFly:ne,pplrInstance:$e,mapId:K}),J=ve.clearCountryHighlight,ue=ve.flatItemsToStlNodes,Fe=ve.onLegendRowClick,Ie=ve.bridgeSelection,{onPeopleGroupResult:st,onAggregateResult:pt,onClear:_t,clearGeocoderProgrammatic:Re}=Qv({map:Z,geocoderRef:he,clustering:C,mapStore:p,uiStore:f,mapLayers:V,pplrInstance:$e,onSemanticTreeSelect:mt,switchTab:In,activeTabId:v,clearAllHighlights:gr,clearCountryHighlight:J,mapId:K,legendRouters:{country:On,region:Po,religion:oo}});$e.activeTab.value=1;function Oe(T){return T==="affinity-block"?0:T==="language-family"?1:0}We(A,T=>{$e.activeTab.value=Oe(T)});const ze={get value(){return D.normalizedPeopleGroups.value||[]}},{langTree:Xe}=Xc(ze),Pt=[{id:"family",info:!0},{id:"language",info:!0},{id:"dialect",info:!0}],{affinityTree:qo}=Ef(ze),ur=[{id:"bloc",info:!0},{id:"cluster",info:!0},{id:"group",info:!0},{id:"pgic",info:!0}],{regionsTree:Fn}=Mf(ze),Y=[{id:"region",info:!0},{id:"block",info:!0},{id:"country",info:!0}],ie=ts(Ls(()=>A.value),Ei),De=ie.progress;Ut("legendProgress",De);const Ge=te(()=>["prayer","engagement","adoption","religion"].includes(A.value)),ae=te(()=>Ge.value?ue(ie.items.value):A.value==="affinity-block"?qo.value:A.value==="doxa-regions"?Fn.value:Xe.value),pe=te(()=>Ge.value?null:A.value==="affinity-block"?ur:A.value==="doxa-regions"?Y:Pt),re=te(()=>Ge.value),Ce=te(()=>A.value==="religion"?b("legend.colLabel.religion"):A.value==="prayer"?b("legend.colLabel.prayer"):A.value==="engagement"?b("legend.colLabel.engagement"):A.value==="adoption"?b("legend.colLabel.adoption"):Ge.value?b("legend.colLabel.status"):""),Pe=te(()=>f.legendState!=="collapsed");function Ve(T){T?f.openLegend():f.collapseLegend()}const Le=te(()=>Ge.value?b("legend.titleBar.legend"):A.value==="affinity-block"?b("legend.titleBar.peopleGroups"):A.value==="doxa-regions"?b("legend.titleBar.wagfRegions"):b("legend.titleBar.languages"));Ut("onSemanticTreeSelect",T=>mt(T)),Ut("getActivePinColor",T=>{var ee,fe;const z=dn(((ee=N.value)==null?void 0:ee.colorStrategy)??"languageFamily");return((fe=z==null?void 0:z.getColor)==null?void 0:fe.call(z,T))??"#1a1a1a"});const Ke=["case",["has","iso_3166_1_alpha_3"],.7,.7],et=["case",["has","iso_3166_1_alpha_3"],"rgba(60,60,80,0.35)","rgba(60,60,80,0.35)"],Be=["case",["has","iso_3166_1_alpha_3"],.6,.6];function qe(T){if(!T||!T.getLayer("regions-fill"))return;const z=ea,ee=Me=>Array.isArray(Me)&&(Me[0]==="get"||Me[0]==="has"||Me[0]==="feature-state"||Me.some(ee)),fe=Me=>Array.isArray(Me)&&(Me[0]==="zoom"||Me.some(fe)),Ae=(Me,Te)=>{if(!T.getLayer(Me))return;const Ze=T.getPaintProperty(Me,Te);Ze!=null&&(ee(Ze)||fe(Ze)||T.setPaintProperty(Me,Te,z(Ze)))};try{Ae("regions-fill","fill-opacity"),Ae("regions-border","line-color"),Ae("regions-border","line-width")}catch{}}function ct(T,z){if(!T||!T.getLayer("regions-fill"))return;const ee=Array.isArray(z)?[...new Set(z.filter(Boolean).map(Ue=>String(Ue).toUpperCase()))].sort():[],fe=["literal",ee],Ae=ee.length?["case",["in",["get","iso_3166_1_alpha_3"],fe],.85,.15]:Ke,Me=ee.length?["case",["in",["get","iso_3166_1_alpha_3"],fe],"#111827","rgba(60,60,80,0.15)"]:et,Te=ee.length?["case",["in",["get","iso_3166_1_alpha_3"],fe],2.5,.3]:Be,Ze=(Ue,gt,Gt)=>{T.getLayer(Ue)&&JSON.stringify(T.getPaintProperty(Ue,gt))!==JSON.stringify(Gt)&&T.setPaintProperty(Ue,gt,Gt)};try{Ze("regions-fill","fill-opacity",Ae),Ze("regions-border","line-color",Me),Ze("regions-border","line-width",Te)}catch{}}function mt(T){var fe,Ae,Me,Te,Ze,Ue,gt,Gt;const z=Z.value;if(T){const ot=Ge.value?sA(T,A.value):null,it=((fe=N.value)==null?void 0:fe.id)==="doxa-regions",yt=ot?{matchExpr:ot}:{};it&&(yt.regionPolygonSource="regions"),(Ae=ne.zoomToLegendRow)==null||Ae.call(ne,T,Object.keys(yt).length?yt:void 0)}if(!T){if(Ge.value){const ot=A.value;ot==="prayer"?f.setPrayerFilter(null):ot==="engagement"?f.setEngagementFilter(null):ot==="adoption"?f.setAdoptionFilter(null):ot==="religion"&&f.setReligionFilter(null)}if(z&&z.getLayer("language-family-pins")){try{z.setFilter("language-family-pins",null)}catch{}t(z,null),xo(z,null),V.syncGlowFilter(null)}z&&z.getLayer("regions-fill")&&(z.setPaintProperty("regions-fill","fill-opacity",ea(.7)),z.setPaintProperty("regions-border","line-color",ea("rgba(60,60,80,0.35)")),z.setPaintProperty("regions-border","line-width",ea(.6))),p.selectedFamily&&p.selectFamily(null),p.selectedLanguage&&p.selectLanguage(null),p.selectedDialect&&((Me=p.selectDialect)==null||Me.call(p,null)),p.selectedRegion&&((Te=p.selectRegion)==null||Te.call(p,null)),Re();return}if(Ge.value){const ot=A.value;ot==="prayer"?f.setPrayerFilter(T.id):ot==="engagement"?f.setEngagementFilter(T.id):ot==="adoption"?f.setAdoptionFilter(T.id):ot==="religion"&&f.setReligionFilter(T.id);return}if(z&&z.getLayer("language-family-pins")&&T.filter){try{z.setFilter("language-family-pins",T.filter)}catch{}t(z,T.filter),xo(z,null),V.syncGlowFilter(T.filter)}const ee=String(T.id||"");if(ee.startsWith("fam:"))(Ze=p.selectFamily)==null||Ze.call(p,T.label);else if(ee.startsWith("lang:"))(Ue=p.selectLanguage)==null||Ue.call(p,T.label);else if(ee.startsWith("dial:"))(gt=p.selectDialect)==null||gt.call(p,{key:ee.slice(5),originalLabels:T.originalLabels||[]});else if(ee.startsWith("bloc:")||ee.startsWith("cluster:")||ee.startsWith("pg:")||ee.startsWith("pgic:")){if(z&&z.getLayer("language-family-pins")&&T.filter){try{z.setFilter("language-family-pins",null)}catch{}t(z,T.filter),xo(z,T.filter),V.syncGlowFilter(T.filter)}}else if(ee.startsWith("region:")||ee.startsWith("block:")||ee.startsWith("country:")){if(z&&z.getLayer("language-family-pins")&&T.filter){try{z.setFilter("language-family-pins",T.filter)}catch{}t(z,T.filter),xo(z,null)}ee.startsWith("region:")&&((Gt=p.selectRegion)==null||Gt.call(p,ee.slice(7))),ee.startsWith("region:")||ct(z,T.isoCodes||[])}}We(()=>f.theme,T=>{$e.theme.value=T==="dark"?"dark":"light"},{immediate:!0}),We(()=>p.selectedFamily,T=>{if(!T)return Ie("fam",null);const z=_a(Xe.value,ee=>ee.id.startsWith("fam:")&&ee.label===T);z&&Ie("fam",{...z,depth:0})}),We(()=>p.selectedLanguage,T=>{if(!T)return Ie("lang",null);const z=_a(Xe.value,ee=>ee.id.startsWith("lang:")&&ee.label===T);z&&Ie("lang",{...z,depth:1})}),We(()=>p.selectedDialect,T=>{if(!(T!=null&&T.key))return Ie("dial",null);const z=`dial:${T.key}`,ee=_a(Xe.value,fe=>fe.id===z);ee&&Ie("dial",{...ee,depth:2})}),We(()=>p.selectedRegion,T=>{if(!T)return Ie("region",null);const z=_a(Fn.value,ee=>ee.id===`region:${T}`);z&&Ie("region",{...z,depth:0})});function St(T){var fe;const z=ie.items.value||[];return(z.length?z:((fe=X==null?void 0:X.items)==null?void 0:fe.value)||[]).flatMap(Ae=>[Ae,...Ae.children||[]]).map(Ae=>({label:Ae.label,color:Ae.color})).filter(Ae=>Ae.label)}const kt=we(!1);async function vo(){var T,z;if(!kt.value){kt.value=!0;try{const[{useMapPoster:ee},{defaultPosterSpec:fe},{printImageBlob:Ae}]=await Promise.all([Ot(()=>Promise.resolve().then(()=>sm),void 0),Ot(()=>Promise.resolve().then(()=>Xf),void 0),Ot(()=>Promise.resolve().then(()=>p2),void 0)]),Me=ee(()=>Z.value),Te=((z=(T=Z.value)==null?void 0:T.getContainer)==null?void 0:z.call(T))||null,Ze=!!Te&&Te.clientWidth>Te.clientHeight,Ue=fe({widthIn:Ze?11:8.5,heightIn:Ze?8.5:11,dpi:200,orientation:Ze?"landscape":"portrait"}),gt=$(N.value)||Le.value||"Doxa Map";Ue.dir=["ar","fa","he","ur"].includes(String(g.value||"").split("-")[0])?"rtl":"ltr",Ue.layout="poster",Ue.slots.title={...Ue.slots.title,text:gt};const Gt=St(!0);Ue.slots.legend={...Ue.slots.legend,rows:Gt,title:Le.value},Ue.slots.scaleBar=!1,Ue.slots.north=!1;const ot=N1(Z.value)==="maplibre";Ue.slots.footer={...Ue.slots.footer,left:"pray.doxa.life",right:new Date().toISOString().slice(0,10),attribution:ot?"© OpenFreeMap © OpenMapTiles © OpenStreetMap":"© Mapbox © OpenStreetMap"};const it=await Me.render(Ue,"png");Ae(it,{labels:{print:n("wall.hud.printNow","Print"),close:n("buttons.close","Close")},widthIn:Ue.widthIn??8.5,heightIn:Ue.heightIn??11,title:gt,alt:gt})||console.error("[research-map] poster print: the host blocked the print frame")}catch(ee){console.error("[research-map] poster export failed:",ee)}finally{kt.value=!1}}}const Io=te(()=>String(b("controls.export_poster")||"Export poster…"));function po(T){const[z,ee]=String(T).split(":");if(z==="poster")return vo();if(z==="packet")return Eo(ee||"full")}Ut("onLegendExport",po),Ut("onLegendExport",po);const Oo=we(!1),ko=te(()=>kt.value||Oo.value);Ut("legendExportBusy",ko);async function Eo(T="full"){var z,ee,fe,Ae;if(!Oo.value){Oo.value=!0;try{const[{usePosterPrints:Me},{defaultPosterSpec:Te},{useMapPoster:Ze},{selectedPinIds:Ue}]=await Promise.all([Ot(()=>Promise.resolve().then(()=>x2),void 0),Ot(()=>Promise.resolve().then(()=>Xf),void 0),Ot(()=>Promise.resolve().then(()=>sm),void 0),Ot(()=>Promise.resolve().then(()=>Iv),void 0)]),gt=D.normalizedPeopleGroups.value||[],Gt=[((ee=(z=Z.value)==null?void 0:z.getFilter)==null?void 0:ee.call(z,"language-family-pins"))||null,pr].filter(Boolean);let ot=gt;if(Gt.length){const xt=Ue(Z.value,{expressions:Gt}),mn=gt.filter(Ui=>xt.has(String(Ui.uniqueId??Ui.id??"")));mn.length?ot=mn:console.warn(`[research-map] packet: ${xt.size} pin(s) selected but no rows matched; printing the full list`)}const it=ot.length;ot.length>50&&(console.warn(`[research-map] packet truncated ${ot.length} → 50 people groups`),ot=ot.slice(0,50));const yt=ot.map(xt=>({slug:String(xt.slug||xt.uniqueId||xt.id||""),name:xt.name,population:xt.population,religion:xt.religionName||xt.religionLabel||xt.religion||"",country_code:xt.countryName||xt.countryIsoLabel||xt.country||xt.countryIso||"",image_url:xt.imageUrl||xt.image_url||""})),ut=Te({widthIn:8.27,heightIn:11.69,dpi:150,orientation:"portrait"});ut.slots.title={...ut.slots.title,text:Le.value||"Doxa Map"},ut.slots.legend={...ut.slots.legend,rows:St(!0),title:Le.value};let Vt="";if(T!=="cards")try{const xt=await Ze(()=>Z.value).render(ut,"png");Vt=await new Promise((mn,Ui)=>{const Wi=new FileReader;Wi.onload=()=>mn(String(Wi.result)),Wi.onerror=Ui,Wi.readAsDataURL(xt)})}catch(xt){console.warn("[research-map] packet map page skipped:",(xt==null?void 0:xt.message)||xt)}const Do=Le.value||$(N.value)||"Doxa Map",La={id:String(((fe=N.value)==null?void 0:fe.id)||"research-map"),label:it>ot.length?`${Do} — ⁦${ot.length} / ${it}⁩`:Do,zoneKey:String(((Ae=N.value)==null?void 0:Ae.id)||"research-map")};await Me({records:()=>yt,lang:()=>String(g.value||"en").split("-")[0],label:()=>La.label,mapImage:()=>Vt||null}).printPacket(La,{variant:T})}catch(Me){console.error("[research-map] packet export failed:",Me)}finally{Oo.value=!1}}}const Bt=we(!1),zt=te(()=>p.selectedFeature),It=te(()=>f.isDarkTheme),xa=te(()=>eh.lightPreset==="night");function dr(){var ee;const T=Z.value;if(!T||!T.getLayer("language-family-pins"))return;const z=xa.value?"#ffffff":["case",[">",["to-number",["get","peoplePraying"],0],0],"#ffffff","#1f2937"];T.setPaintProperty("language-family-pins","circle-stroke-color",z),T.setPaintProperty("language-family-pins","circle-stroke-width",xa.value?Ev((ee=N.value)==null?void 0:ee.colorStrategy):of)}We(xa,dr,{immediate:!1}),We(()=>{var T;return(T=N.value)==null?void 0:T.id},dr),We(()=>f.theme,()=>k.applyTheme(Z.value));function vu(){k.swapTheme(Z.value)}const Nn=we(!1);let oa=null;async function hn(){if(!Nn.value)return oa||(oa=(async()=>{var T,z,ee;try{const fe=await((T=D.loadRegionsData)==null?void 0:T.call(D));fe&&Z.value&&((z=V.addRegionsLayer)==null||z.call(V,fe,"doxa-regions"),qe(Z.value),Z.value.getLayer("regions-fill")&&((ee=N.value)==null?void 0:ee.id)!=="doxa-regions"&&(Z.value.setLayoutProperty("regions-fill","visibility","none"),Z.value.setLayoutProperty("regions-border","visibility","none")),Z.value.getLayer("language-family-pins")&&Z.value.moveLayer("language-family-pins")),Nn.value=!0,D.regionsData.value=null}catch(fe){console.warn("[research-map] regions layer failed:",fe)}finally{oa=null}})(),oa)}function In(T){var fe,Ae;if(T===v.value)return;v.value=T,(fe=f.setActiveTab)==null||fe.call(f,T),Re();const z=W.value.find(Me=>Me.id===T);if(!z||!Z.value)return;k.setLook(k.lookFor(z.colorStrategy),Z.value),z.id==="doxa-regions"&&hn();const ee=dn(z.colorStrategy);if(Z.value.getLayer("language-family-pins")&&(ee!=null&&ee.buildColorExpression)){const Me=z.id==="doxa-regions"?"#a30000":ee.buildColorExpression();Z.value.setPaintProperty("language-family-pins","circle-color",Me),gr(Z.value),z.id==="prayer"?V.startPrayerGlow():V.stopPrayerGlow();const Te=z.id==="doxa-regions";Z.value.getLayer("regions-fill")&&(Z.value.setLayoutProperty("regions-fill","visibility",Te?"visible":"none"),Z.value.setLayoutProperty("regions-border","visibility",Te?"visible":"none")),Z.value.getLayer("language-family-pins")&&Z.value.moveLayer("language-family-pins")}(Ae=C.refreshColors)==null||Ae.call(C)}function Pa(T){var Ue,gt,Gt;const z=T==null?void 0:T.detail;if(!z||(je(z),!((Ue=z.coords)!=null&&Ue.length)))return;const ee=z.coords;if(ee.length===1){(gt=ne.flyToCoords)==null||gt.call(ne,{longitude:ee[0][0],latitude:ee[0][1]},3);return}let fe=1/0,Ae=-1/0,Me=1/0,Te=-1/0;for(const[ot,it]of ee)otAe&&(Ae=ot),itTe&&(Te=it);const Ze=z.kind==="region"?2.2:3;(Gt=ne.fitBounds)==null||Gt.call(ne,[[fe,Me],[Ae,Te]],60,{maxZoom:Ze})}let pr=null;function wu(){const T=(p==null?void 0:p.showClusters)&&((p==null?void 0:p.clusteringMode)||"off")!=="off",z=Number(p==null?void 0:p.clusterPinOpacity);return T&&Number.isFinite(z)?Math.min(1,Math.max(0,z)):1}function xo(T,z){var Ae;if(z!==void 0&&(pr=z||null),!T||!((Ae=T.getLayer)!=null&&Ae.call(T,"language-family-pins")))return;const ee=wu(),fe=pr?["case",pr,ee,0]:["case",["has","uniqueId"],ee,ee];try{if(JSON.stringify(T.getPaintProperty("language-family-pins","circle-opacity"))===JSON.stringify(fe))return;T.setPaintProperty("language-family-pins","circle-opacity",fe),T.setPaintProperty("language-family-pins","circle-stroke-opacity",fe),T.getLayer("language-family-pins-shadow")&&T.setPaintProperty("language-family-pins-shadow","circle-opacity",fe)}catch{}}We(()=>[p==null?void 0:p.clusterPinOpacity,p==null?void 0:p.clusteringMode,p==null?void 0:p.showClusters],()=>xo(Z.value));const go={family:null,language:null,dialect:null,region:null,prayer:null,engagement:null,adoption:null};function gr(T){xo(T,null),T.setFilter("language-family-pins",null),t(T,null),V.syncGlowFilter(null),ct(T,[]),T.getLayer("regions-fill")&&T.setPaintProperty("regions-fill","fill-outline-color",null),go.family=go.language=go.dialect=go.region=null,go.prayer=go.engagement=go.adoption=null,f.prayerFilter&&f.setPrayerFilter(null),f.engagementFilter&&f.setEngagementFilter(null),f.adoptionFilter&&f.setAdoptionFilter(null),f.religionFilter&&f.setReligionFilter(null),C.setSelectionFilter(null),p.selectedFamily&&p.selectFamily(null),p.selectedLanguage&&p.selectLanguage(null),p.selectedDialect&&p.selectDialect(null);try{$e&&$e.selection&&$e.selection.value&&($e.selection.value=null)}catch{}}let na=null,Sa=0;function je(T){var Ze,Ue,gt,Gt,ot;const z=Z.value;if(!z||!z.getLayer("language-family-pins"))return;let ee,fe,Ae;if(T.kind==="family")Ae="family",ee="languageFamily",fe=T.familyKey;else if(T.kind==="language")Ae="language",ee="language",fe=T.languageKey;else if(T.kind==="region")Ae="region",ee="doxaRegion",fe=T.regionKey;else if(T.kind==="prayer")Ae="prayer",ee=T.property||"peoplePraying",fe=T.expectedValue;else if(T.kind==="engagement")Ae="engagement",ee=T.property||"engagementStatus",fe=T.expectedValue;else if(T.kind==="adoption")Ae="adoption",ee=T.property||"adoptionStatus",fe=T.expectedValue;else if(T.kind==="religion")Ae="religion",ee=T.property||"religion",fe=T.expectedValue;else if(T.kind==="dialect")Ae="dialect",ee="language",fe=T.dialectKey||"";else{gr(z),Re();for(const it of Object.keys(go))go[it]=null;na=null,Sa=0;return}const Me=Date.now(),Te=`${Ae}|${fe}`;if(!(na===Te&&Me-Sa<80)){if(na=Te,Sa=Me,go[Ae]===fe){gr(z),Re(),na=null,Sa=0;return}for(const it of Object.keys(go))go[it]=null;if(go[Ae]=fe,Ae==="family"?(Ze=p.selectFamily)==null||Ze.call(p,fe):Ae==="region"?(Ue=p.selectRegion)==null||Ue.call(p,fe):Ae==="language"?(gt=p.selectLanguage)==null||gt.call(p,fe):Ae==="dialect"&&((Gt=p.selectDialect)==null||Gt.call(p,{key:fe,originalLabels:T.originalLabels||[]})),C.setSelectionFilter({property:ee,value:fe}),Ae==="region"){if(z.setFilter("language-family-pins",["==",["get","doxaRegion"],fe]),t(z,["==",["get","doxaRegion"],fe]),xo(z,null),z.getLayer("regions-fill")){const it=((ot=V.regionIsoMap)==null?void 0:ot.value)||{},yt=Do=>String(Do).toLowerCase().replace(/[^a-z]/g,""),ut=yt(fe);let Vt=it[fe]||[];if(!Vt.length){for(const[Do,La]of Object.entries(it))if(yt(Do)===ut){Vt=La;break}}ct(z,Vt)}}else{z.setFilter("language-family-pins",null);let it;if(Ae==="prayer"){const yt=["to-number",["get",ee]];fe==="noPrayer"?it=["==",yt,0]:fe==="fullPrayer"?it=[">=",yt,un]:fe==="hasPrayer"?it=["all",[">",yt,0],["<",yt,un]]:it=["==",["get",ee],fe]}else if(Ae==="engagement")it=["==",["get",ee],fe==="hasEngagement"];else if(Ae==="adoption")it=["==",["get",ee],fe==="hasAdoption"];else if(Ae==="religion")it=["==",["slice",["coalesce",["get",ee],""],0,1],fe];else if(T.filterExpr)it=T.filterExpr;else if(Ae==="language")it=["any",["==",["get",ee],fe],["==",["slice",["get",ee],0,fe.length+1],fe+","],["in"," "+fe,["get",ee]]];else if(Ae==="dialect"){const yt=T.originalLabels||[];yt.length===1?it=["==",["get",ee],yt[0]]:yt.length>1?it=["in",["get",ee],["literal",yt]]:it=["==",["get",ee],fe]}else it=["==",["get",ee],fe];xo(z,it),t(z,it),V.syncGlowFilter(it),z.getLayer("regions-fill")&&(z.setPaintProperty("regions-fill","fill-opacity",ea(.2)),z.setPaintProperty("regions-border","line-color",ea("rgba(60,60,80,0.35)")),z.setPaintProperty("regions-border","line-width",ea(.6)))}}}function oo(T,{map:z,filterLayerId:ee}){const fe=T.label;try{z.setFilter(ee,null)}catch{}const Ae=Object.keys(Wo).find(Me=>Wo[Me]===fe);if(Ae){const Me={id:Ae,label:fe,depth:0},Te=()=>{try{z.setFilter(ee,null)}catch{}mt(Me),$e&&$e.selection&&($e.selection.value=Me)};v.value!=="religion"&&In("religion"),Yt(Te)}}function Po(T,{map:z,filterLayerId:ee}){const fe=T.label,Ae=Ue=>String(Ue).toLowerCase().replace(/[^a-z0-9]/g,""),Me=Ue=>String(Ue||"").replace(/\s*\((?:Region|Bloc)\)\s*$/i,""),Te=Ae(fe),Ze=()=>{try{z.setFilter(ee,null)}catch{}const Ue=_a(Fn.value,gt=>(gt.id.startsWith("region:")||gt.id.startsWith("block:"))&&Ae(Me(gt.label))===Te);Ue&&(mt(Ue),$e&&$e.selection&&($e.selection.value=Ue))};v.value!=="doxa-regions"?(In("doxa-regions"),Promise.resolve(hn()).finally(()=>Yt(Ze))):Ze()}function On(T){var ee,fe,Ae,Me;if(Array.isArray(T.bounds)&&T.bounds.length===4){const[Te,Ze,Ue,gt]=T.bounds;(ee=ne.fitBounds)==null||ee.call(ne,[[Te,Ze],[Ue,gt]],60)}else Array.isArray(T.center)&&T.center.length===2&&((fe=ne.flyTo)==null||fe.call(ne,T.center));const z=Gv(T,D.normalizedPeopleGroups.value||[]);if(z&&B(z),z&&((Ae=N.value)==null?void 0:Ae.id)!=="doxa-regions"&&de.showCountry(z),z&&((Me=N.value)==null?void 0:Me.id)==="doxa-regions"){const Te=()=>{const Ze=_a(Fn.value,Ue=>Ue.id.startsWith("country:")&&(Ue.isoCodes||[]).includes(z));Ze&&(mt(Ze),$e&&$e.selection&&($e.selection.value=Ze))};Promise.resolve(hn()).finally(()=>Yt(Te))}}We(()=>p.filters,()=>{var T,z;(T=V.applyFilters)==null||T.call(V,p.filters),(z=C.applyFilters)==null||z.call(C,p.filters)},{deep:!0});let Mo=!1,Vo="";We(()=>{var T;return(T=s==null?void 0:s.value)==null?void 0:T.externalFilters},T=>{var z,ee;if(!(!T||typeof T!="object"||!p)){Mo=!0;try{if("region"in T){const fe=T.region||null;(fe||p.selectedRegion)&&((z=p.selectRegion)==null||z.call(p,fe))}if("religion"in T){const fe=String(T.religion||"").trim(),Ae=fe?Object.keys(Wo).find(Me=>String(Wo[Me]).toLowerCase()===fe.toLowerCase()):"";fe?Ae&&(v.value!=="religion"&&In("religion"),Yt(()=>f.setReligionFilter(Ae))):f.religionFilter&&f.setReligionFilter(null)}if("fitSlugs"in T&&xu(T.fitSlugs),"language"in T){const fe=T.language||null;(fe||p.selectedLanguage)&&((ee=p.selectLanguage)==null||ee.call(p,fe))}}finally{Yt(()=>{Mo=!1})}}},{deep:!0,immediate:!0});let ss=null,zi=null,hr=null,is=null;typeof window<"u"&&(window.__researchMapFilterState=ss=()=>{var T,z;return{selectedRegion:(p==null?void 0:p.selectedRegion)||"",externalRegion:((z=(T=s==null?void 0:s.value)==null?void 0:T.externalFilters)==null?void 0:z.region)||"",religionFamily:Wo[f==null?void 0:f.religionFilter]||"",selectedLanguage:(p==null?void 0:p.selectedLanguage)||""}},window.__researchMapPinOpacity=zi=()=>{var T,z;try{return((z=(T=Z.value)==null?void 0:T.getPaintProperty)==null?void 0:z.call(T,"language-family-pins","circle-opacity"))??null}catch{return null}},window.__researchMapClusterDraw=hr=()=>{var ee,fe;const T=Z.value,z={};try{for(const Ae of((fe=(ee=T==null?void 0:T.getStyle)==null?void 0:ee.call(T))==null?void 0:fe.layers)||[]){if(!/^(mapbox-clusters|cluster-lines)/.test(Ae.id))continue;let Me=0;try{Me=T.queryRenderedFeatures({layers:[Ae.id]}).length}catch{Me=-1}z[Ae.id]={visibility:Ae.layout&&Ae.layout.visibility||"visible",rendered:Me}}}catch{}return z},window.__researchMapVocabulary=is=T=>{var fe;const z=((fe=D==null?void 0:D.normalizedPeopleGroups)==null?void 0:fe.value)||[],ee=new Set;for(const Ae of z){if(T==="religionFamily"){const Te=Wo[String((Ae==null?void 0:Ae.religion)||"").charAt(0)];Te&&ee.add(Te);continue}const Me=Ae&&Ae[T];typeof Me=="string"&&Me&&ee.add(Me)}return[...ee].sort()});const ls=Co();function ji(){var T,z,ee,fe;try{return((fe=(ee=(z=(T=ls==null?void 0:ls.proxy)==null?void 0:T.$el)==null?void 0:z.getRootNode)==null?void 0:ee.call(z))==null?void 0:fe.host)||null}catch{return null}}function fr(){var yt;if(Mo||typeof window>"u")return;const T=ji();if(!T)return;const z=Wo[f==null?void 0:f.religionFilter]||"",ee=(p==null?void 0:p.selectedLanguage)||"",fe=(p==null?void 0:p.selectedDialect)||null,Ae=Array.isArray(fe==null?void 0:fe.originalLabels)?fe.originalLabels.map(ut=>String(ut).trim()).filter(Boolean):[],Me=((yt=D==null?void 0:D.normalizedPeopleGroups)==null?void 0:yt.value)||[],Te=ut=>{const Vt=ut&&(ut.language??ut.primary_language);return String((Vt&&typeof Vt=="object"?Vt.label:Vt)||"").trim()},Ze=(ut,Vt)=>ut===Vt||ut.startsWith(Vt+",")||ut.includes(" "+Vt),Ue=Ae.length?Me.filter(ut=>Ae.includes(Te(ut))):ee?Me.filter(ut=>Ze(Te(ut),ee.trim())):[],gt=[...new Set(Ue.map(ut=>{var Vt,Do;return String(((Do=(Vt=ut==null?void 0:ut._raw)==null?void 0:Vt.primary_language)==null?void 0:Do.value)||(ut!=null&&ut.language&&typeof ut.language=="object"?ut.language.value:"")||"").trim()}).filter(Boolean))],Gt=gt.length===1?gt[0]:"",ot={region:(p==null?void 0:p.selectedRegion)||"",religion:z,language:Ae.length?Ae.join(" · "):ee,languageCode:Gt,languageCodes:gt},it=!ot.region&&!ot.religion&&!ot.language&&!ot.languageCode;if(it&&Bi){const ut=typeof performance<"u"?performance.now():Date.now();if(fn||(fn=ut),ut-fnclearTimeout(aa)),We(()=>{var T;return[p==null?void 0:p.selectedRegion,p==null?void 0:p.selectedLanguage,(T=p==null?void 0:p.selectedDialect)==null?void 0:T.key,f==null?void 0:f.religionFilter]},()=>mr()),We(()=>p.selectedRegion,T=>{je(T?{kind:"region",regionKey:T}:{kind:null})}),We(()=>p.selectedFamily,T=>{T?je({kind:"family",familyKey:T}):!p.selectedLanguage&&!p.selectedDialect&&je({kind:null})}),We(()=>p.selectedLanguage,T=>{T?je({kind:"language",languageKey:T}):!p.selectedFamily&&!p.selectedDialect&&je({kind:null})}),We(()=>p.selectedDialect,T=>{T!=null&&T.key?je({kind:"dialect",dialectKey:T.key,originalLabels:T.originalLabels||[]}):!p.selectedFamily&&!p.selectedLanguage&&je({kind:null})}),We(()=>f.prayerFilter,T=>{je(T?{kind:"prayer",property:"peoplePraying",expectedValue:T}:{kind:null})}),We(()=>f.engagementFilter,T=>{je(T?{kind:"engagement",property:"engagementStatus",expectedValue:T}:{kind:null})}),We(()=>f.adoptionFilter,T=>{je(T?{kind:"adoption",property:"adoptionStatus",expectedValue:T}:{kind:null})}),We(()=>f.religionFilter,T=>{je(T?{kind:"religion",property:"religion",expectedValue:T}:{kind:null})});function ku(){try{return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function xu(T){var Vt,Do,La;const z=Array.isArray(T)?T.filter(Yo=>typeof Yo=="string"&&Yo):[],ee=z.length?`${z.length}:${z[0]}:${z[z.length-1]}`:"";if(ee===Vo||(Vo=ee,!z.length))return;const fe=new Set(z),Ae=((Vt=D==null?void 0:D.normalizedPeopleGroups)==null?void 0:Vt.value)||[];let Me=1/0,Te=1/0,Ze=-1/0,Ue=-1/0,gt=0;for(const Yo of Ae){if(!Yo||!fe.has(Yo.slug))continue;const xt=Number(Yo.longitude??Yo.lng),mn=Number(Yo.latitude??Yo.lat);!Number.isFinite(xt)||!Number.isFinite(mn)||(xtZe&&(Ze=xt),mn>Ue&&(Ue=mn),gt++)}if(!gt)return;const Gt=Ze-Me,ot=Ue-Te,it={longitude:(Me+Ze)/2,latitude:(Te+Ue)/2},yt=Gt>$A?{c:it,z:_A}:gt===1||Gtp.showClusters,async T=>{ra||(T&&(!p.clusteringMode||p.clusteringMode==="off")?p.clusteringMode="mst":!T&&p.clusteringMode!=="off"&&(p.clusteringMode="off"),await Gi())}),We(()=>p.clusteringMode,async()=>{ra||await Gi()});async function Pu(T){var z,ee,fe,Ae,Me,Te;p.registerMap(K,Z.value),I1(Z.value,"mercator"),k.applyTheme(Z.value),T!=null&&T.length&&(V.addLanguageFamilyLayer(T,((z=N.value)==null?void 0:z.colorStrategy)??"languageFamily"),((ee=N.value)==null?void 0:ee.id)==="doxa-regions"&&((fe=Z.value)!=null&&fe.getLayer("language-family-pins"))&&Z.value.setPaintProperty("language-family-pins","circle-color","#4b5563"),xo(Z.value),((Ae=N.value)==null?void 0:Ae.id)==="prayer"&&V.startPrayerGlow(),(Me=C.setData)==null||Me.call(C,T),H.initialize()),((Te=N.value)==null?void 0:Te.id)==="doxa-regions"&&(typeof window<"u"&&window.requestIdleCallback?Ue=>window.requestIdleCallback(Ue,{timeout:2e3}):Ue=>setTimeout(Ue,800))(()=>{hn()}),dr(),p.setMapReady(K),xe.value=!0}let cs=null,Aa=null,br=null;function Tm(T){const z=O.value;z&&(getComputedStyle(z).getPropertyValue("--map-radius").trim()||(z.style.setProperty("--map-radius","16px"),z.style.setProperty("--map-radius-sm","8px")),T>=700?(z.style.setProperty("--map-btn-size","40px"),z.style.setProperty("--map-toolbar-gap","8px"),z.style.setProperty("--map-font-md","13px"),z.style.setProperty("--map-font-sm","11px"),z.style.setProperty("--map-legend-width","380px")):T>=500?(z.style.setProperty("--map-btn-size","36px"),z.style.setProperty("--map-toolbar-gap","6px"),z.style.setProperty("--map-font-md","12px"),z.style.setProperty("--map-font-sm","10px"),z.style.setProperty("--map-legend-width","360px")):(z.style.setProperty("--map-btn-size","32px"),z.style.setProperty("--map-toolbar-gap","5px"),z.style.setProperty("--map-font-md","11px"),z.style.setProperty("--map-font-sm","10px"),z.style.setProperty("--map-legend-width","280px")))}function Hi(T){const z=O.value;if(z)try{z.dispatchEvent(new CustomEvent("dxmaps:mapinfo-pending",{bubbles:!0,composed:!0,detail:{pending:T}}))}catch{}}const Em=()=>{!xe.value&&!Q.value&&Hi(!0)};return We(Q,T=>{T&&Hi(!1)}),mo(()=>{Hi(!0),window.addEventListener("dxmaps:mapinfo-host",Em)}),eo(()=>{window.removeEventListener("dxmaps:mapinfo-host",Em),xe.value||Hi(!1)}),mo(async()=>{var ee,fe,Ae,Me;(ee=f.init)==null||ee.call(f),v.value=((fe=W.value[0])==null?void 0:fe.id)??"doxa-regions",f.isMobile?(Ae=f.collapseLegend)==null||Ae.call(f):(Me=f.openLegend)==null||Me.call(f),O.value&&(Tm(O.value.getBoundingClientRect().width),typeof ResizeObserver<"u"&&(cs=new ResizeObserver(Te=>{for(const Ze of Te)Tm(Ze.contentRect.width)}),cs.observe(O.value))),window.addEventListener("doxa:legend-row-click",Fe),window.addEventListener("legend:highlight",Pa);const T=D.loadData().catch(Te=>(console.error("[research-map] data load failed:",Te),{normalizedPeopleGroups:[]})),z=()=>!Se.value||!Se.value.isConnected;try{await ce()}catch(Te){if(z())return;console.error("[research-map] Map failed to initialize —",Te),Q.value=String((Te==null?void 0:Te.message)||Te);return}if(!z()){{const Te=Z.value?dt(Z.value):null;Te&&Te!==Z.value&&(Z.value=null,Z.value=Ra(Te))}if(!Z.value){console.error("[research-map] Map failed to initialize — check token and container"),Q.value=b("dashboard.map_init_failed");return}Z.value.once("style.load",async()=>{try{const{normalizedPeopleGroups:Te}=await T;await Pu(Te)}catch(Te){console.error("[research-map] onMapReady failed:",Te),Q.value=String((Te==null?void 0:Te.message)||Te)}}),o(Z.value),br=()=>o(Z.value);try{Aa=new ResizeObserver(br);const Te=Z.value.getContainer&&Z.value.getContainer()||null;Te&&Aa.observe(Te);const Ze=Te?Rf(Te):null;Ze&&Aa.observe(Ze),document.body&&Aa.observe(document.body)}catch{}window.addEventListener("resize",br)}}),eo(()=>{const T=z=>{try{z()}catch(ee){console.warn("[research-map] teardown step failed",ee)}};try{T(()=>window.removeEventListener("doxa:legend-row-click",Fe)),T(()=>window.removeEventListener("legend:highlight",Pa)),T(()=>{cs&&(cs.disconnect(),cs=null)}),T(()=>{Aa&&(Aa.disconnect(),Aa=null)}),T(()=>{br&&(window.removeEventListener("resize",br),br=null)}),T(()=>{var z;return(z=V.stopPrayerGlow)==null?void 0:z.call(V)}),T(()=>{var z;return(z=V.cleanup)==null?void 0:z.call(V)}),T(()=>{var z;return(z=C.cleanup)==null?void 0:z.call(C)}),T(()=>{var z;return(z=H.cleanup)==null?void 0:z.call(H)}),T(()=>{var z;return(z=p.unregisterMap)==null?void 0:z.call(p,K)}),T(()=>{typeof window>"u"||(window.__researchMapFilterState===ss&&delete window.__researchMapFilterState,window.__researchMapPinOpacity===zi&&delete window.__researchMapPinOpacity,window.__researchMapClusterDraw===hr&&delete window.__researchMapClusterDraw,window.__researchMapVocabulary===is&&delete window.__researchMapVocabulary)})}finally{ke()}}),(T,z)=>(oe(),me("div",{ref_key:"rmRoot",ref:O,class:Ye(["rm-root",{"rm-dark":It.value,"dsm-dark":It.value}])},[q.value?(oe(),me("div",{key:0,ref_key:"tabBar",ref:se,class:"rm-tab-bar"},[(oe(!0),me(rt,null,co(W.value,ee=>(oe(),me(rt,{key:ee.id},[R("button",{class:Ye(["rm-tab",{active:v.value===ee.id}]),onClick:fe=>In(ee.id)},_e($(ee)),11,lA),ee.sepAfter?(oe(),me("div",cA)):Ee("",!0)],64))),128))],512)):Ee("",!0),R("div",uA,[!xe.value&&!Q.value?(oe(),me("div",dA,_e(n("dashboard.map_loading","Research map loading…")),1)):Ee("",!0),Q.value?(oe(),me("div",pA,_e(n("allPeopleGroups.loadError","The map could not be loaded."))+" "+_e(Q.value),1)):Ee("",!0),R("div",{ref_key:"mapContainer",ref:Se,class:"rm-map-canvas"},null,512),z[4]||(z[4]=R("div",{class:"map-scroll-edge map-scroll-edge--left"},null,-1)),z[5]||(z[5]=R("div",{class:"map-scroll-edge map-scroll-edge--right"},null,-1)),ge(l)!=="mapbox"?(oe(),me("div",{key:2,class:"rm-provider-badge","data-provider":ge(l)},_e(ge(h)),9,gA)):Ee("",!0),xe.value&&ge(Z)&&c.value?(oe(),ht(kx,{key:3,ref_key:"geocoderRef",ref:he,"map-instance":ge(Z),"access-token":ge(i),provider:ge(l),"data-source-id":ge(x),"is-dark":It.value,placeholder:F.value,"active-context":I.value,onPeopleGroupResult:ge(st),onAggregateResult:ge(pt),onClear:ge(_t)},null,8,["map-instance","access-token","provider","data-source-id","is-dark","placeholder","active-context","onPeopleGroupResult","onAggregateResult","onClear"])):Ee("",!0),Ee("",!0),xe.value&&ge(Z)?(oe(),ht(Zk,{key:5,"has-geocoder":c.value},{default:fo(()=>[ft(Kx,{"is-dark":It.value},null,8,["is-dark"]),ft(Jk,{map:ge(Z),"is-dark":It.value},null,8,["map","is-dark"]),ft(Qk,{map:ge(Z),"is-dark":It.value},null,8,["map","is-dark"]),ft(ex,{map:ge(Z),"is-dark":It.value},null,8,["map","is-dark"]),ft(nx,{"map-container":Se.value,"is-dark":It.value},null,8,["map-container","is-dark"]),ft(rx,{"is-dark":It.value,onToggle:vu},null,8,["is-dark"]),ft(Qn,{"is-dark":It.value,active:kt.value,disabled:kt.value,title:Io.value,class:"export-poster-btn","aria-busy":kt.value?"true":"false",onClick:vo},{default:fo(()=>[...z[3]||(z[3]=[R("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[R("path",{d:"M12 3v12M7 10l5 5 5-5M5 21h14"})],-1)])]),_:1},8,["is-dark","active","disabled","title","aria-busy"]),L.share?(oe(),ht(Wx,{key:0,"is-dark":It.value,"embed-path":"doxa-research-map/research-map/index.html"},null,8,["is-dark"])):Ee("",!0)]),_:1},8,["has-geocoder"])):Ee("",!0),xe.value&&u.value?(oe(),ht(Yk,{key:6,"legend-type":A.value,"is-dark":It.value},null,8,["legend-type","is-dark"])):Ee("",!0),xe.value?(oe(),ht(cP,{key:7,"is-open":Bt.value,onClose:z[1]||(z[1]=ee=>Bt.value=!1),onOpenPoster:vo},{default:fo(()=>[ft(OP)]),_:1},8,["is-open"])):Ee("",!0),R("div",{class:"rm-legend-desktop-slot",style:Rt(d.value?{"--stl-top":d.value}:null)},[xe.value&&ge(f).legendMode==="detail"&&ge(f).selectedPeopleGroup?(oe(),ht(Ik,{key:0,"legend-type":A.value,"popup-action":w.value,"initially-collapsed":!1,"is-dark":It.value},null,8,["legend-type","popup-action","is-dark"])):Ee("",!0),Rs(R("div",null,[xe.value?(oe(),ht(Tf,{key:0,nodes:ae.value,tabs:pe.value,title:Le.value,hideTabs:re.value,columnLabel:Ce.value,progress:ge(De),open:Pe.value,"export-enabled":fA,onSelect:mt,onExport:po,"onUpdate:open":Ve},null,8,["nodes","tabs","title","hideTabs","columnLabel","progress","open"])):Ee("",!0)],512),[[up,!(ge(f).legendMode==="detail"&&ge(f).selectedPeopleGroup)]])],4),R("div",hA,[xe.value?(oe(),ht(ge(a),{key:0,"legend-type":A.value,"popup-action":w.value,"is-dark":It.value},null,8,["legend-type","popup-action","is-dark"])):Ee("",!0)]),xe.value&&zt.value?(oe(),ht(ge(r),{key:8,feature:zt.value,action:w.value,dark:It.value,onClose:z[2]||(z[2]=ee=>ge(p).selectFeature(null))},null,8,["feature","action","dark"])):Ee("",!0)])],2))}}},Symbol.toStringTag,{value:"Module"})),kA="",xA={class:"legend-sheet-root"},PA=["src","alt"],SA={key:0,class:"pull-tab-handle"},AA=["aria-expanded","aria-label"],LA=["aria-label"],CA=["aria-expanded","aria-label"],TA={class:"collapsed-detail-title"},EA={class:"legend-content"},MA=["aria-expanded","aria-label"],RA=["aria-expanded","aria-label"],Df=80,zf=48,FA=44,NA=24,jf="lm-on",IA="dxmaps:legend-sheet",Bf="--legend-sheet-h",OA=3e3,Gf=Object.freeze(Object.defineProperty({__proto__:null,default:ln({__name:"LegendMobile",props:{legendType:{type:String,required:!0},nodes:{type:Array,default:null},tabs:{type:Array,default:null},defaultTab:{type:Number,default:0},columnLabel:{type:String,default:null},title:{type:String,default:null},columns:{type:Array,default:null},isDark:{type:Boolean,default:!1},popupAction:{type:String,default:"pray",validator:e=>["pray","adopt","none"].includes(e)},disableCollapse:{type:Boolean,default:!1}},setup(e){const{t}=jt();Zt(` .floating-mini-image{position:absolute;inset-inline-start:calc(var(--map-fab-beside,0px) + 16px);bottom:calc(var(--legend-sheet-h,30%) + 16px);z-index:999;pointer-events:auto;cursor:pointer;} .mini-image{width:120px;height:150px;object-fit:cover;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.25);display:block;} .legend-sheet-root{position:absolute;inset:0;pointer-events:none;overflow:hidden;} @@ -1510,13 +1510,10 @@ :host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 6px 6px 0;} :host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib.mapboxgl-compact,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib.mapboxgl-compact{margin-right:6px;} @media (max-width:767.98px){ - :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-right{top:auto !important;bottom:var(--legend-sheet-h,48px) !important;transform:none !important;opacity:1;z-index:4;} - :host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-right{inset-inline-end:0 !important;inset-inline-start:auto !important;justify-content:flex-end;max-width:calc(100% - var(--map-fab-beside,0px) - 8px);} - :host(.lm-on) .mapboxgl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-right{max-width:calc(100% - var(--map-fab-beside,0px) - 104px);} - :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-left{inset-inline-start:var(--map-fab-beside,0px) !important;inset-inline-end:auto !important;} + :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-right{top:0 !important;bottom:auto !important;inset-inline-start:0 !important;inset-inline-end:auto !important;transform:none !important;justify-content:flex-start;max-width:calc(100% - 44px);z-index:4;} :host(.lm-on) .maplibregl-ctrl-logo,.lm-on .maplibregl-ctrl-logo{display:none !important;} :host(.lm-on) .maplibregl-ctrl-attrib-inner,:host(.lm-on) .mapboxgl-ctrl-attrib-inner,.lm-on .maplibregl-ctrl-attrib-inner,.lm-on .mapboxgl-ctrl-attrib-inner{font-size:8.5px;line-height:12px;} - :host(.lm-on) .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,:host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-left .maplibregl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-left .maplibregl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 0 8px;margin-inline:8px;} + :host(.lm-on) .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,:host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-left .maplibregl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-left .maplibregl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:8px 0 0;margin-inline:8px 0;} } .legend-mobile-sheet .stl-row{position:relative;} .legend-mobile-sheet .stl-row .stl-x-slot{position:absolute;inset-inline-end:6px;top:50%;transform:translateY(-50%);width:auto;} @@ -1603,7 +1600,7 @@ @media (prefers-reduced-motion: reduce) { .legend-sheet, .legend-content, .legend-handle, .legend-toggle { transition: none !important; animation: none !important; } } -`,"legend-mobile-sheet");const o=e,n=He("uiStore");He("mapStore");const a=He("dataStore"),r=He("onSemanticTreeSelect",()=>{}),s=He("onLegendExport",null),i=te(()=>typeof s=="function"),l=He("legendExportCards",!1),c=Ls(o,"legendType"),{items:u,columns:d,title:h,activeFilter:x,setFilter:P,totalCount:_,totalPopulation:g,fmtPop:b,fmtCount:m}=ts(c,Ei),$=He("normalizedPeopleGroups",null),p=te(()=>{var Oe,ze;if((Oe=$==null?void 0:$.value)!=null&&Oe.length)return $.value;const Re=[];for(const Xe in(a==null?void 0:a.sources)||{}){const Pt=a.sources[Xe];(ze=Pt==null?void 0:Pt.features)!=null&&ze.length&&Re.push(...Pt.features)}return Re}),y={get value(){return p.value}},{langTree:f}=Xc(y),{affinityTree:k}=Ef(y),{regionsTree:L}=Mf(y),S=[{id:"family",label:"Lang Family",info:"A language family is a group of languages descended from a common ancestor."},{id:"language",label:"Language",info:"A language is a system of communication used by a people."},{id:"dialect",label:"Dialect",info:"A dialect/variety is a regional or social form of a language."}],G=[{id:"bloc",label:"Block",info:"Affinity Block (rop1) — broadest grouping. 16 blocks total."},{id:"cluster",label:"Cluster",info:"Cluster (imb_reg_of_people_2, ROP 2) — finer grouping inside a block. 194 total."},{id:"group",label:"PG",info:"People Group (imb_reg_of_people_25, ROP 2.5) — abstract identity. 1,736 PGs."},{id:"pgic",label:"PGIC",info:"PG in Country (imb_reg_of_people_3 + country_code) — one row per PG-country pair. 2,106 rows."}],W=[{id:"region",label:"Region",info:'WAGF macro-region (e.g. "Asia", "Africa"). Color-coded on the map.'},{id:"block",label:"Bloc",info:'WAGF bloc — organizational sub-grouping within each region (e.g. "South East Asia").'},{id:"country",label:"Country",info:"Individual countries, listed by unreached-population size within their bloc."}],q=te(()=>["prayer","engagement","adoption","religion"].includes(o.legendType));function v(Re){const Oe=[];for(const ze of Re){Oe.push({id:ze.key,label:ze.label,color:ze.color,count:ze.count??0,pop:ze.population??0,filter:ze.filterKey?["==",["get","_flat_filter"],ze.filterKey]:null,children:[]});for(const Xe of ze.children||[])Oe.push({id:Xe.key,label:Xe.label,color:Xe.color,count:Xe.count??0,pop:Xe.population??0,filter:Xe.filterKey?["==",["get","_flat_filter"],Xe.filterKey]:null,children:[]})}return Oe}const N=te(()=>o.nodes?o.nodes:q.value?v(u.value):o.legendType==="affinity-block"?k.value:o.legendType==="doxa-regions"?L.value:f.value),A=te(()=>o.nodes?o.tabs:q.value?null:o.legendType==="affinity-block"?G:o.legendType==="doxa-regions"?W:S),w=te(()=>o.title?o.title:q.value?t("legend.titleBar.legend"):o.legendType==="affinity-block"?t("legend.titleBar.peopleGroups"):o.legendType==="doxa-regions"?t("legend.titleBar.wagfRegions"):t("legend.titleBar.languages")),j=te(()=>o.columnLabel!==null?o.columnLabel:["religion","prayer","engagement","adoption"].includes(o.legendType)?t("legend.colLabel."+o.legendType):q.value?t("legend.colLabel.status"):""),F=we(null),U=we(!1),I={pending:null,active:!1,startY:0,startH:0,startState:"",containerH:0,maxH:0,lastH:0};let K=0;const O=()=>Date.now()-K<400,se=te(()=>n.legendState),he=te(()=>se.value!=="collapsed"),ye=te(()=>n.legendHeight),Se=te(()=>n.caretRotation),xe=te(()=>n.showPullTab),Q=te(()=>se.value==="open"&&!n._customLegendHeight);let Z=!1;We(()=>n.isMobile,Re=>{!Re||Z||(Z=!0,n.selectedPeopleGroup||n.collapseLegend())},{immediate:!0});const ce=te(()=>n.legendMode),ke=te(()=>n.selectedPeopleGroup),M=He("normalizedPeopleGroups",null),D=te(()=>{var Oe,ze;if((Oe=M==null?void 0:M.value)!=null&&Oe.length)return nu(M.value);const Re=[];for(const Xe in(a==null?void 0:a.sources)||{}){const Pt=a.sources[Xe];(ze=Pt==null?void 0:Pt.features)!=null&&ze.length&&Re.push(...Pt.features)}return nu(Re)}),B=te(()=>ke.value?xf(D.value,ke.value):[]),V=te(()=>{var Re;return ce.value==="detail"&&ke.value?((Re=ke.value.properties)==null?void 0:Re.name)||t("legend.header.peopleGroupFallback"):se.value==="collapsed"?o.title||t("legend.header.collapsed"):o.title||h.value});function ne(Re){n.handleLegendItemClick(),P(Re)}function H(){O()||n.toggleLegend()}function le(){O()||(n.selectPeopleGroup(null),n.openLegend())}const be=te(()=>{var Oe;if(!ke.value)return null;const Re=ke.value.properties||{};return Re.imageUrl||((Oe=Re._raw)==null?void 0:Oe.ImageURL)||null});function E(Re){var Pt;if(se.value==="collapsed"){I.pending="hold",I.active=!1;return}const Oe=Re.touches[0],ze=F.value;!Oe||!ze||!(Oe.clientY-ze.getBoundingClientRect().top<=FA)||(I.pending="grab",I.active=!1,I.startY=Oe.clientY,I.startH=ze.offsetHeight,I.lastH=I.startH,I.startState=se.value,I.containerH=((Pt=ze.parentElement)==null?void 0:Pt.offsetHeight)||window.innerHeight,I.maxH=I.containerH-Df)}function C(Re){if(!I.pending&&!I.active)return;if(I.pending==="hold"){Re.cancelable&&Re.preventDefault();return}const Oe=Re.touches[0];if(!Oe)return;const ze=I.startY-Oe.clientY;if(!I.active){if(ze===0)return;I.pending=null,I.active=!0,U.value=!0}Re.preventDefault();const Xe=Math.round(Math.min(I.maxH,Math.max(zf,I.startH+ze)));I.lastH=Xe,n.setLegendHeight(`${Xe}px`)}function X(){if(I.pending=null,!I.active)return;I.active=!1,U.value=!1,K=Date.now();const Re=I.lastH,Oe=Re-I.startH,ze=I.containerH*.3;if(ce.value!=="detail"){Re0?n.fullyOpenLegend():I.startState==="fullyOpen"?n.openLegend():n.collapseLegend()}function de(Re){Re==="fullyOpen"?n.fullyOpenLegend():Re==="collapsed"?n.collapseLegend():n.openLegend()}let $e=null;mo(()=>{const Re=F.value,Oe=Re&&Re.getRootNode?Re.getRootNode():null;$e=Oe&&Oe.host?Oe.host:typeof document<"u"?document.documentElement:null,$e&&($e.__lmCount=($e.__lmCount||0)+1,$e.classList.add(jf))}),eo(()=>{$e&&($e.__lmCount=Math.max(0,($e.__lmCount||1)-1),$e.__lmCount||$e.classList.remove(jf),$e=null)});let ve=0;function J(Re){const Oe=F.value;if(!Oe||!Oe.isConnected)return;const ze=Re?0:Oe.offsetHeight,Xe=ze>0?se.value==="collapsed"?"collapsed":"open":"gone";Oe.dispatchEvent(new CustomEvent(IA,{bubbles:!0,composed:!0,detail:{height:ze,collapsedHeight:zf,state:Xe}}))}function ue(){ve||typeof requestAnimationFrame>"u"||(ve=requestAnimationFrame(()=>{ve=0,J(!1)}))}We(se,()=>ue()),mo(()=>{const Re=F.value;Re&&(Re.addEventListener("transitionend",ue),window.addEventListener("resize",ue),ue())}),eo(()=>{ve&&(cancelAnimationFrame(ve),ve=0);const Re=F.value;Re&&Re.removeEventListener("transitionend",ue),window.removeEventListener("resize",ue),J(!0)});let Fe=null,Ie=null,st=null;mo(()=>{const Re=F.value;if(!Re||typeof ResizeObserver>"u")return;const Oe=Re.getRootNode();Ie=Oe instanceof ShadowRoot?Oe.host:Oe.documentElement||null,Ie&&(st=Re,Fe=new ResizeObserver(()=>{ue();const ze=Re.offsetHeight;ze<=0||(Ie.style.setProperty(Bf,`${ze}px`),Ie.__legendSheetVarOwner=Re)}),Fe.observe(Re))}),eo(()=>{Fe&&(Fe.disconnect(),Fe=null),Ie&&Ie.__legendSheetVarOwner===st&&(Ie.style.removeProperty(Bf),Ie.__legendSheetVarOwner=null),Ie=null,st=null});let pt=0;function _t(Re){pt=0;const Oe=F.value,ze=Oe&&Oe.getRootNode?Oe.getRootNode():null;if(!ze||!ze.querySelector)return;const Xe=ze.querySelector(".maplibregl-ctrl-attrib.maplibregl-compact-show, .mapboxgl-ctrl-attrib.mapboxgl-compact-show");if(Xe){pt=setTimeout(()=>{pt=0,n.isMobile&&Xe.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")},OA);return}const Pt=ze.querySelector(".maplibregl-ctrl-attrib, .mapboxgl-ctrl-attrib");Pt&&!/attrib-empty/.test(Pt.className)||Re>0&&(pt=setTimeout(()=>_t(Re-1),500))}return mo(()=>_t(60)),eo(()=>{pt&&(clearTimeout(pt),pt=0)}),(Re,Oe)=>{var ze;return oe(),me("div",xA,[ce.value==="detail"&&ke.value&&se.value==="open"&&be.value?(oe(),me("div",{key:0,class:"floating-mini-image",onClick:Oe[0]||(Oe[0]=Xe=>ge(n).fullyOpenLegend())},[R("img",{src:be.value,alt:(ze=ke.value.properties)==null?void 0:ze.name,class:"mini-image"},null,8,PA)])):Ee("",!0),R("div",{ref_key:"sheetRef",ref:F,class:Ye(["legend-mobile-sheet",[se.value,{"sheet-dark":e.isDark,dragging:U.value,fit:Q.value}]]),style:Rt({height:Q.value?"auto":ye.value,"--legend-sheet-top-reserve":Df+"px"}),onTouchstart:E,onTouchmove:C,onTouchend:X,onTouchcancel:X},[R("div",{class:"sheet-drag-strip",onClick:H},[xe.value?(oe(),me("div",SA)):Ee("",!0)]),ce.value==="detail"&&se.value!=="collapsed"?(oe(),me("button",{key:0,class:"detail-collapse-btn-mobile",onClick:Et(H,["stop"]),"aria-expanded":String(he.value),"aria-label":ge(t)("aria.toggleLegend")},null,8,AA)):Ee("",!0),ce.value==="detail"&&se.value!=="collapsed"?(oe(),me("button",{key:1,class:"detail-close-btn",onClick:Et(le,["stop"]),"aria-label":ge(t)("aria.backToLegend")},[...Oe[2]||(Oe[2]=[R("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[R("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,LA)):Ee("",!0),se.value==="collapsed"&&ce.value==="detail"&&ke.value?(oe(),me("div",{key:2,class:"collapsed-detail-footer",onClick:H},[R("button",{class:"mobile-collapse-caret",style:Rt({transform:`rotate(${Se.value}deg)`}),"aria-expanded":String(he.value),"aria-label":ge(t)("aria.toggleLegend"),tabindex:"-1"},[...Oe[3]||(Oe[3]=[R("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[R("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,CA),R("span",TA,_e(V.value),1)])):Ee("",!0),R("div",EA,[ce.value==="detail"&&ke.value?(oe(),me(rt,{key:0},[se.value!=="collapsed"?(oe(),ht(tu,{key:0,peopleGroup:ke.value,hideHeader:!0,dark:e.isDark,action:e.popupAction},null,8,["peopleGroup","dark","action"])):Ee("",!0),se.value!=="collapsed"?(oe(),ht(Ci,{key:1,shared:B.value,dark:e.isDark},null,8,["shared","dark"])):Ee("",!0)],64)):e.legendType!=="default"?(oe(),ht(Tf,{key:1,"pin-note":!1,nodes:N.value,tabs:A.value,"default-tab":e.defaultTab,title:V.value||w.value,hideTabs:e.nodes?!e.tabs:q.value,columnLabel:j.value,columns:e.columns||["count","pop"],"export-enabled":i.value,"export-cards":i.value&&ge(l)===!0,onSelect:ge(r),onExport:Oe[1]||(Oe[1]=Xe=>ge(s)&&ge(s)(Xe))},{"title-caret":fo(()=>[R("button",{class:"mobile-collapse-caret",style:Rt({transform:`rotate(${Se.value}deg)`}),onClick:Et(H,["stop"]),"aria-expanded":String(he.value),"aria-label":ge(t)("aria.toggleLegend")},[...Oe[4]||(Oe[4]=[R("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[R("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,MA)]),_:1},8,["nodes","tabs","default-tab","title","hideTabs","columnLabel","columns","export-enabled","export-cards","onSelect"])):(oe(),ht($f,{key:2,title:V.value,items:ge(u),columns:ge(d),activeFilter:ge(x),isDark:e.isDark,hideColumnHeader:!1,showFooter:!1,disableCollapse:!0,totalCount:ge(_),totalPopulation:ge(g),fmtPop:ge(b),fmtCount:ge(m),onFilterClick:ne},{"title-caret":fo(()=>[R("button",{class:"mobile-collapse-caret",style:Rt({transform:`rotate(${Se.value}deg)`}),onClick:Et(H,["stop"]),"aria-expanded":String(he.value),"aria-label":ge(t)("aria.toggleLegend")},[...Oe[5]||(Oe[5]=[R("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[R("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,RA)]),_:1},8,["title","items","columns","activeFilter","isDark","totalCount","totalPopulation","fmtPop","fmtCount"]))])],38)])}}},[["styles",[kA]],["__scopeId","data-v-79d13329"]])},Symbol.toStringTag,{value:"Module"})),Hf={regular:"Noto Sans Regular",medium:"Noto Sans Bold",bold:"Noto Sans Bold"};function DA(e){return typeof window<"u"&&!!window.maplibregl&&e instanceof window.maplibregl.Map}function zA(e,{weight:t="regular",mapbox:o}={}){return DA(e)?{"text-font":[Hf[t]||Hf.regular]}:Array.isArray(o)&&o.length?{"text-font":o}:{}}function lu(e,t,o,n){const a=parseFloat(t)-parseFloat(n),r=parseFloat(e)-parseFloat(o);return Math.sqrt(a*a+r*r)}function jA(e,t){const o={};for(const n of e){const a=t(n);o[a]||(o[a]=[]),o[a].push(n)}return o}const BA=Object.freeze({cluster:!0,clusterMaxZoom:6,clusterRadius:40}),GA=Object.freeze(["step",["get","point_count"],"#51bbd6",10,"#f1f075",50,"#f28cb1",500,"#e74c3c"]),HA=Object.freeze(["step",["get","point_count"],15,10,20,50,25,500,35]);class Uf{constructor(t={}){this.maxConnectionDistance=t.maxConnectionDistance??1/0}_calculateDistance(t,o){return lu(parseFloat(t.latitude),parseFloat(t.longitude),parseFloat(o.latitude),parseFloat(o.longitude))}_createUnionFind(t){const o=Array.from({length:t},(s,i)=>i),n=new Array(t).fill(0),a=s=>(o[s]!==s&&(o[s]=a(o[s])),o[s]);return{find:a,union:(s,i)=>{const l=a(s),c=a(i);return l===c?!1:(n[l]n[c]?o[c]=l:(o[c]=l,n[l]++),!0)}}}generateMSTLines(t,o={}){const n=o.maxConnectionDistance??this.maxConnectionDistance;if(!t||t.length<2)return[];const a=t.filter(g=>{const b=parseFloat(g.latitude),m=parseFloat(g.longitude);return!isNaN(b)&&!isNaN(m)});if(a.length<2)return[];const r=a.length,s=a.map(g=>parseFloat(g.latitude)),i=a.map(g=>parseFloat(g.longitude)),l=new Uint8Array(r),c=new Float64Array(r).fill(1/0),u=new Int32Array(r).fill(-1),d=[];let h=r;for(;h>0;){let g=-1,b=1/0;for(let m=0;mn){g=-1;for(let m=0;m=0){const m=u[g];d.push({from:m,to:g,distance:c[g],fromPoint:a[m],toPoint:a[g]})}for(let m=0;m({type:"Feature",geometry:{type:"LineString",coordinates:[[parseFloat(g.fromPoint.longitude),parseFloat(g.fromPoint.latitude)],[parseFloat(g.toPoint.longitude),parseFloat(g.toPoint.latitude)]]},properties:{distance:g.distance,algorithm:"MST"}}));return d.length${n} deg).`),_}generateMultiGroupMSTLines(t,o=null,n={}){const a={},r=Object.keys(t).sort((s,i)=>t[i].length-t[s].length);for(const s of r){const i=t[s];if(!i||i.length<2){a[s]={lines:[],count:0,pointCount:(i==null?void 0:i.length)||0};continue}const l=this.generateMSTLines(i,n);if(typeof o=="function"){const c=o(s);l.forEach(u=>{u.properties={...u.properties,group:s,color:c}})}else l.forEach(c=>{c.properties={...c.properties,group:s}});a[s]={lines:l,count:l.length,pointCount:i.length}}return a}generateAllMSTLines(t,o=null,n={}){const a=this.generateMultiGroupMSTLines(t,o,n),r=[];for(const s in a)r.push(...a[s].lines);return r}getMSTStats(t,o={}){const n=this.generateMultiGroupMSTLines(t,null,o);let a=0,r=0;const s=[];for(const l in n){const{lines:c,pointCount:u}=n[l];a+=c.length,r+=u;const d=Math.max(0,u-1),h=u>1?(c.length/d*100).toFixed(1):100;s.push({name:l,points:u,lines:c.length,expected:d,coverage:h+"%",hasOrphans:c.lengthc.points-l.points);const i=s.filter(l=>l.hasOrphans).length;return{algorithm:"MST (Minimum Spanning Tree)",totalGroups:Object.keys(t).length,totalPoints:r,totalLines:a,expectedLines:Math.max(0,r-Object.keys(t).length),groupsWithOrphans:i,allPointsConnected:i===0,groups:s}}}new Uf;class Wf{constructor(t={}){this.maxDistance=t.maxDistance??15,this.maxNeighbors=t.maxNeighbors??15,this.sortKey=t.sortKey??"longitude"}_calculateDistance(t,o,n,a){return lu(t,o,n,a)}generateNetworkLines(t,o={}){const n=o.maxDistance??this.maxDistance,a=o.maxNeighbors??this.maxNeighbors,r=o.sortKey??this.sortKey,s=o.connectOrphans??!0;if(!t||t.length<2)return[];const i=t.filter(d=>{const h=parseFloat(d.latitude),x=parseFloat(d.longitude);return!isNaN(h)&&!isNaN(x)});if(i.length<2)return[];const l=[],c=new Set,u=[...i].sort((d,h)=>parseFloat(d[r])-parseFloat(h[r]));for(let d=0;dt[i].length-t[s].length);for(const s of r){const i=t[s];if(!i||i.length<2){a[s]={lines:[],count:0,pointCount:(i==null?void 0:i.length)||0};continue}const l=this.generateNetworkLines(i,n);if(typeof o=="function"){const c=o(s);l.forEach(u=>{u.properties={...u.properties,group:s,color:c}})}else l.forEach(c=>{c.properties={...c.properties,group:s}});a[s]={lines:l,count:l.length,pointCount:i.length}}return a}generateAllNetworkLines(t,o=null,n={}){const a=this.generateMultiGroupNetworkLines(t,o,n),r=[];for(const s in a)r.push(...a[s].lines);return r}getClusteringStats(t,o={}){const n=this.generateMultiGroupNetworkLines(t,null,o);let a=0,r=0;const s=[];for(const i in n){const{lines:l,pointCount:c}=n[i];a+=l.length,r+=c,s.push({name:i,points:c,lines:l.length,ratio:c>0?(l.length/c).toFixed(2):0})}return s.sort((i,l)=>l.points-i.points),{algorithm:"Network (nearest-neighbor)",totalGroups:Object.keys(t).length,totalPoints:r,totalLines:a,avgLinesPerPoint:r>0?(a/r).toFixed(2):0,groups:s}}}new Wf({maxDistance:15,maxNeighbors:15,sortKey:"longitude"});const rr="cluster-lines-source",sr="cluster-lines",ta="mapbox-clusters",No="mapbox-clusters-circle",ir="mapbox-clusters-count",UA=Object.freeze({type:"FeatureCollection",features:[]});function Kf(e={}){const{getMap:t=()=>null,mapId:o="unknown",getPeopleGroups:n=()=>[],pinSourceId:a="language-families",pinLayerId:r="language-family-pins",groupKey:s="languageFamily",getGroupColor:i=null,mapboxClusterOptions:l={}}=e,c=He("mapStore",null),u=new Uf({maxConnectionDistance:1/0}),d=new Wf({maxDistance:15,maxNeighbors:15,sortKey:"longitude"}),h=we(!1),x=we("mapbox"),P=te(()=>c&&"clusteringEnabled"in c?!!c.clusteringEnabled:h.value),_=te(()=>c&&c.clusteringMode?c.clusteringMode:x.value),g=we([]);let b=null,m=null,$=null;function p(O){const se=["mapbox","mst","network"];if(!se.includes(O)){console.warn(`[${o}] useMapClustering.setMode: unknown mode "${O}". Allowed: ${se.join(", ")}`);return}c&&typeof c.setClusteringMode=="function"?c.setClusteringMode(O):c&&"clusteringMode"in c?c.clusteringMode=O:x.value=O,P.value&&(G(),S())}function y(O){const se=!!O;c&&typeof c.setClusteringEnabled=="function"?c.setClusteringEnabled(se):c&&"clusteringEnabled"in c?c.clusteringEnabled=se:h.value=se,se?S():G()}function f(O){!O||!O.property||O.value==null?$=null:$={property:O.property,value:O.value},c&&("clusterFilterProperty"in c&&(c.clusterFilterProperty=($==null?void 0:$.property)??null),"clusterFilterValue"in c&&(c.clusterFilterValue=($==null?void 0:$.value)??null)),P.value&&(G(),S())}function k(O){if(!$)return O;const{property:se,value:he}=$,ye=xe=>String(xe||"").toLowerCase().replace(/[^a-z0-9]+/g,""),Se=ye(he);return Se?O.filter(xe=>{var Z,ce;const Q=(xe==null?void 0:xe[se])??((Z=xe==null?void 0:xe.properties)==null?void 0:Z[se])??((ce=xe==null?void 0:xe._normalized)==null?void 0:ce[se]);return ye(Q)===Se}):O}function L(O){b=O}function S(){const O=t();if(O){switch(G(),_.value){case"mapbox":N(O);break;case"mst":A(O,"mst");break;case"network":A(O,"network");break;default:console.warn(`[${o}] Unknown clustering mode: ${_.value}`)}K(O,!0)}}function G(){const O=t();O&&(q(O,ir,!1),q(O,No,!1),v(O,ta),q(O,sr,!1),v(O,rr),g.value=[],j(O),K(O,!1))}function W(){const O=t();O&&(j(O),O.getLayer(ir)&&O.removeLayer(ir),O.getLayer(No)&&O.removeLayer(No),O.getSource(ta)&&O.removeSource(ta),O.getLayer(sr)&&O.removeLayer(sr),O.getSource(rr)&&O.removeSource(rr),K(O,!1)),g.value=[],b=null}function q(O,se,he){if(O.getLayer(se))try{O.setLayoutProperty(se,"visibility",he?"visible":"none")}catch{}}function v(O,se){const he=O.getSource(se);if(he&&typeof he.setData=="function")try{he.setData(UA)}catch{}}function N(O){const se=k(n());if(!se.length)return;const ye={type:"FeatureCollection",features:se.map(xe=>{const Q=parseFloat(xe.longitude??xe.lng),Z=parseFloat(xe.latitude??xe.lat);return isNaN(Q)||isNaN(Z)?null:{type:"Feature",geometry:{type:"Point",coordinates:[Q,Z]},properties:{...xe.properties||xe}}}).filter(Boolean)},Se=O.getSource(ta);Se&&typeof Se.setData=="function"?Se.setData(ye):O.addSource(ta,{type:"geojson",data:ye,...BA,...l}),O.getLayer(No)?q(O,No,!0):O.addLayer({id:No,type:"circle",source:ta,filter:["has","point_count"],paint:{"circle-color":GA,"circle-radius":HA,"circle-stroke-width":2,"circle-stroke-color":"#ffffff",...cn(O),"circle-opacity":.85}}),O.getLayer(ir)?q(O,ir,!0):O.addLayer({id:ir,type:"symbol",source:ta,filter:["has","point_count"],layout:{"text-field":["get","point_count_abbreviated"],...zA(O,{weight:"medium",mapbox:["DIN Offc Pro Medium","Arial Unicode MS Bold"]}),"text-size":12},paint:{"text-color":"#000000"}}),w(O)}function A(O,se){const he=k(n());if(!he.length)return;const ye=jA(he,ce=>{var ke;return ce[s]??((ke=ce._normalized)==null?void 0:ke[s])??"Unknown"}),Se=typeof i=="function"?i:()=>"#666666";let xe=[];if(se==="mst"?(xe=u.generateAllMSTLines(ye,Se),Object.keys(ye).length):(xe=d.generateAllNetworkLines(ye,Se),d.getClusteringStats(ye)),g.value=xe,xe.length===0)return;const Q={type:"FeatureCollection",features:xe},Z=O.getSource(rr);if(Z&&typeof Z.setData=="function"?Z.setData(Q):O.addSource(rr,{type:"geojson",data:Q}),O.getLayer(sr))q(O,sr,!0);else{const ce={id:sr,type:"line",source:rr,paint:{"line-color":["coalesce",["get","color"],"#666666"],"line-width":["interpolate",["linear"],["zoom"],0,.5,4,.75,8,1,12,1.5],...cn(O,"line"),"line-opacity":.5},layout:{"line-cap":"round","line-join":"round"}};O.getLayer(r)?O.addLayer(ce,r):O.addLayer(ce)}}function w(O){O.getLayer(No)&&(O.on("click",No,F),O.on("mouseenter",No,U),O.on("mouseleave",No,I),m=No)}function j(O){if(!m)return;const se=m;try{O.off("click",se,F),O.off("mouseenter",se,U),O.off("mouseleave",se,I)}catch{}m=null}function F(O){const se=t();if(!se)return;const he=se.queryRenderedFeatures(O.point,{layers:[No]});if(!he.length)return;const ye=he[0],Se=ye.properties.cluster_id,xe=ye.geometry.coordinates,Q=ye.properties.point_count;if(typeof b=="function"){b({clusterId:Se,coordinates:xe,pointCount:Q,originalEvent:O});return}const Z=se.getSource(ta);!Z||typeof Z.getClusterExpansionZoom!="function"||Z.getClusterExpansionZoom(Se,(ce,ke)=>{ce||se.easeTo({center:xe,zoom:ke})})}function U(){const O=t();O&&(O.getCanvas().style.cursor="pointer")}function I(){const O=t();O&&(O.getCanvas().style.cursor="")}function K(O,se){if(O.getLayer(r))try{O.setPaintProperty(r,"circle-opacity",se?.25:.9)}catch{}}return{enabled:P,mode:_,clusterLines:g,setMode:p,setEnabled:y,setSelectionFilter:f,onClusterClick:L,applyClustering:S,clearClustering:G,cleanup:W,mstUtil:u,networkUtil:d}}const WA=Object.freeze(Object.defineProperty({__proto__:null,default:Kf,useMapClustering:Kf},Symbol.toStringTag,{value:"Module"})),qf=e=>Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2)),Vf=e=>Math.atan(Math.sinh(e))*180/Math.PI,Yf=85.051129,Zf=e=>Math.max(-Yf,Math.min(Yf,e));function KA(e,t,o){const n=Math.max(1,Math.floor(o)||1),a=qf(Zf(Math.max(e,t))),r=qf(Zf(Math.min(e,t))),s=(a-r)/n,i=[];for(let l=0;l=e.widthIn?"portrait":"landscape"),margins:{...qt.margins},bleed:qt.bleed,slots:{title:{text:"Untitled",subtitle:"",heightIn:qt.title.heightIn},legend:{rows:[],type:"generic",widthIn:qt.legend.widthIn},scaleBar:!0,north:!0,footer:{left:"",right:"",attribution:qt.footer.attribution,heightIn:qt.footer.heightIn}},renderPath:"auto"}}const Xf=Object.freeze(Object.defineProperty({__proto__:null,defaultPosterSpec:qA,posterDefaults:qt},Symbol.toStringTag,{value:"Module"}));function uo(e,t){return Math.round(e*t)}function Jf(e,t){var y,f,k,L,S,G,W,q;const o=t.dpi,n=e.margins||qt.margins,a={x:0,y:0,w:t.width,h:t.height},r={x:uo(n.left,o),y:uo(n.top,o),w:t.width-uo(n.left+n.right,o),h:t.height-uo(n.top+n.bottom,o)},s=(y=e.slots)!=null&&y.title?uo(e.slots.title.heightIn||qt.title.heightIn,o):0,i={x:r.x,y:r.y,w:r.w,h:s},l=uo(((k=(f=e.slots)==null?void 0:f.footer)==null?void 0:k.heightIn)||qt.footer.heightIn,o),c={x:r.x,y:r.y+r.h-l,w:r.w,h:l},u=(L=e.slots)!=null&&L.legend?uo(e.slots.legend.widthIn||qt.legend.widthIn,o):0,d=(S=e.slots)!=null&&S.scaleBar||(G=e.slots)!=null&&G.north?uo(qt.chromeBand.heightIn,o):0,h=r.y+s+(s?uo(qt.gutter.in,o):0),x=c.y-d-(d?uo(qt.gutter.in,o):0),P={x:r.x,y:h,w:r.w-(u?u+uo(qt.gutter.in,o):0),h:x-h},_=u?{x:r.x+r.w-u,y:h,w:u,h:P.h}:{x:0,y:0,w:0,h:0},g=uo(qt.scaleBar.widthIn,o),b=d,m=(W=e.slots)!=null&&W.scaleBar?{x:r.x,y:x+(d?uo(qt.gutter.in,o):0),w:g,h:b}:{x:0,y:0,w:0,h:0},$=uo(qt.north.sizeIn,o),p=(q=e.slots)!=null&&q.north?{x:r.x+r.w-$-(u?u+uo(qt.gutter.in,o):0),y:x+(d?uo(qt.gutter.in,o):0),w:$,h:$}:{x:0,y:0,w:0,h:0};return{page:a,content:r,title:i,map:P,legend:_,scaleBar:m,north:p,footer:c}}const VA={"©":"©","&":"&"," ":" ","<":"<",">":">",""":'"',"'":"'"};function YA(e){return e?String(e).replace(/<[^>]*>/g," ").replace(/&[a-z]+;|&#\d+;/gi,t=>VA[t.toLowerCase()]??" ").replace(/\s+/g," ").trim():""}function ZA(e){if(!e||typeof e.getStyle!="function")return"";let t;try{t=e.getStyle()}catch{return""}const o=t&&t.sources||{},n=[];for(const a of Object.keys(o)){let r=null;try{r=typeof e.getSource=="function"?e.getSource(a):null}catch{r=null}const s=YA(r&&r.attribution||o[a].attribution);s&&!n.includes(s)&&n.push(s)}return n.join(" ")}const ya=4096,gn=2048,Qf=15e3;function XA(e){const t=we({phase:"idle",completed:0,total:0,message:"",fraction:0,percent:0}),o=we(!1);let n=null;async function a(_,g="png"){var $;if(o.value)throw new Error("useMapPoster: already rendering");const b=e();if(!b)throw new Error("useMapPoster: no source map");n=new AbortController;const m=o2(_.signal,n.signal);o.value=!0,l=0,c("init",1,1,"preparing render");try{const p=em(_),y=JA(_.renderPath||"auto",p);y==="single"&&(p.width>ya||p.height>ya)&&console.warn(`[useMapPoster] requested single-canvas ${p.width}×${p.height}px > ${ya}; auto-switching to tile-stitch.`);const f=y==="single"&&(p.width>ya||p.height>ya)?"stitch":y,k=_.layout==="poster",L=k?Jf(_,p):null,S=!!L&&L.map.w>0&&L.map.h>0;k&&!S&&console.warn('[useMapPoster] layout:"poster" asked for a map box of '+(L?L.map.w+"×"+L.map.h:"0×0")+"px; the margins, title, footer and legend column leave no room on this sheet. Falling back to a full-bleed map.");const G=S?{width:L.map.w,height:L.map.h,dpi:p.dpi}:p,W=f==="single"?await u(b,G,m):await d(b,G,m);c("compose",0,1,"compositing overlay");const q=ZA(b),v=q?{..._,slots:{..._.slots,footer:{...(($=_.slots)==null?void 0:$.footer)||{},attribution:q}}}:_,N=S?h(W,L,p):W,A=await x(N,v,p);c("encode",0,1,`encoding ${g.toUpperCase()}`);const w=g==="pdf"?await t2(A,_):await e2(A,"image/png");return c("done",1,1,"render complete"),w}finally{o.value=!1,n=null}}function r(){n&&n.abort()}const s={init:.02,"hidden-map":.3,stitch:.42,capture:.14,compose:.06,encode:.05,done:.01},i=["init","hidden-map","stitch","capture","compose","encode","done"];let l=0;function c(_,g,b,m){const $=i.indexOf(_);let p=0;for(let k=0;k<$;k++)p+=s[i[k]]||0;const y=b>0?Math.min(1,g/b):0,f=p+(s[_]||0)*y;l=_==="init"?f:Math.max(l,f),t.value={phase:_,completed:g,total:b,message:m,fraction:Math.min(1,l),percent:Math.round(Math.min(1,l)*100)}}async function u(_,g,b){c("hidden-map",0,3,"creating hidden map");const{hiddenMap:m,restoreDpr:$,container:p}=await tm(_,g.width,g.height);try{cu(b),c("hidden-map",1,3,"loading map tiles"),await nm(m),c("hidden-map",3,3,"tiles loaded"),cu(b),c("capture",0,1,"capturing canvas");const y=m.getCanvas().toDataURL("image/png"),f=await am(y),k=document.createElement("canvas");return k.width=g.width,k.height=g.height,k.getContext("2d").drawImage(f,0,0,g.width,g.height),k}finally{try{m.remove()}catch{}p!=null&&p.parentNode&&p.parentNode.removeChild(p),$()}}async function d(_,g,b){const m=Math.ceil(g.width/gn),$=Math.ceil(g.height/gn),p=m*$;c("hidden-map",0,p,`creating hidden map (${m}×${$} tiles)`);const y=_.getBounds(),f=_.getCenter(),k=_.getZoom(),L=_.getBearing(),S=_.getPitch(),{hiddenMap:G,restoreDpr:W,container:q}=await tm(_,gn,gn,{preserveBounds:!0,bounds:y});try{const v=document.createElement("canvas");v.width=g.width,v.height=g.height;const N=v.getContext("2d"),A=y.getNorthEast(),w=y.getSouthWest(),F=(A.lng-w.lng)/m,U=KA(w.lat,A.lat,$);let I=0;for(let K=0;K<$;K++)for(let O=0;Ot&&([t,o]=[o,t]),e.orientation==="portrait"&&t>o&&([t,o]=[o,t]);const n=e.dpi||300;return{width:Math.round(t*n),height:Math.round(o*n),dpi:n}}function JA(e,t){return e==="single"||e==="stitch"?e:t.width>ya||t.height>ya?"stitch":"single"}async function tm(e,t,o,n={}){const a=document.createElement("div");a.style.cssText=` +`,"legend-mobile-sheet");const o=e,n=He("uiStore");He("mapStore");const a=He("dataStore"),r=He("onSemanticTreeSelect",()=>{}),s=He("onLegendExport",null),i=te(()=>typeof s=="function"),l=He("legendExportCards",!1),c=Ls(o,"legendType"),{items:u,columns:d,title:h,activeFilter:x,setFilter:P,totalCount:_,totalPopulation:g,fmtPop:b,fmtCount:m}=ts(c,Ei),$=He("normalizedPeopleGroups",null),p=te(()=>{var Oe,ze;if((Oe=$==null?void 0:$.value)!=null&&Oe.length)return $.value;const Re=[];for(const Xe in(a==null?void 0:a.sources)||{}){const Pt=a.sources[Xe];(ze=Pt==null?void 0:Pt.features)!=null&&ze.length&&Re.push(...Pt.features)}return Re}),y={get value(){return p.value}},{langTree:f}=Xc(y),{affinityTree:k}=Ef(y),{regionsTree:L}=Mf(y),S=[{id:"family",label:"Lang Family",info:"A language family is a group of languages descended from a common ancestor."},{id:"language",label:"Language",info:"A language is a system of communication used by a people."},{id:"dialect",label:"Dialect",info:"A dialect/variety is a regional or social form of a language."}],G=[{id:"bloc",label:"Block",info:"Affinity Block (rop1) — broadest grouping. 16 blocks total."},{id:"cluster",label:"Cluster",info:"Cluster (imb_reg_of_people_2, ROP 2) — finer grouping inside a block. 194 total."},{id:"group",label:"PG",info:"People Group (imb_reg_of_people_25, ROP 2.5) — abstract identity. 1,736 PGs."},{id:"pgic",label:"PGIC",info:"PG in Country (imb_reg_of_people_3 + country_code) — one row per PG-country pair. 2,106 rows."}],W=[{id:"region",label:"Region",info:'WAGF macro-region (e.g. "Asia", "Africa"). Color-coded on the map.'},{id:"block",label:"Bloc",info:'WAGF bloc — organizational sub-grouping within each region (e.g. "South East Asia").'},{id:"country",label:"Country",info:"Individual countries, listed by unreached-population size within their bloc."}],q=te(()=>["prayer","engagement","adoption","religion"].includes(o.legendType));function v(Re){const Oe=[];for(const ze of Re){Oe.push({id:ze.key,label:ze.label,color:ze.color,count:ze.count??0,pop:ze.population??0,filter:ze.filterKey?["==",["get","_flat_filter"],ze.filterKey]:null,children:[]});for(const Xe of ze.children||[])Oe.push({id:Xe.key,label:Xe.label,color:Xe.color,count:Xe.count??0,pop:Xe.population??0,filter:Xe.filterKey?["==",["get","_flat_filter"],Xe.filterKey]:null,children:[]})}return Oe}const N=te(()=>o.nodes?o.nodes:q.value?v(u.value):o.legendType==="affinity-block"?k.value:o.legendType==="doxa-regions"?L.value:f.value),A=te(()=>o.nodes?o.tabs:q.value?null:o.legendType==="affinity-block"?G:o.legendType==="doxa-regions"?W:S),w=te(()=>o.title?o.title:q.value?t("legend.titleBar.legend"):o.legendType==="affinity-block"?t("legend.titleBar.peopleGroups"):o.legendType==="doxa-regions"?t("legend.titleBar.wagfRegions"):t("legend.titleBar.languages")),j=te(()=>o.columnLabel!==null?o.columnLabel:["religion","prayer","engagement","adoption"].includes(o.legendType)?t("legend.colLabel."+o.legendType):q.value?t("legend.colLabel.status"):""),F=we(null),U=we(!1),I={pending:null,active:!1,startY:0,startH:0,startState:"",containerH:0,maxH:0,lastH:0};let K=0;const O=()=>Date.now()-K<400,se=te(()=>n.legendState),he=te(()=>se.value!=="collapsed"),ye=te(()=>n.legendHeight),Se=te(()=>n.caretRotation),xe=te(()=>n.showPullTab),Q=te(()=>se.value==="open"&&!n._customLegendHeight);let Z=!1;We(()=>n.isMobile,Re=>{!Re||Z||(Z=!0,n.selectedPeopleGroup||n.collapseLegend())},{immediate:!0});const ce=te(()=>n.legendMode),ke=te(()=>n.selectedPeopleGroup),M=He("normalizedPeopleGroups",null),D=te(()=>{var Oe,ze;if((Oe=M==null?void 0:M.value)!=null&&Oe.length)return nu(M.value);const Re=[];for(const Xe in(a==null?void 0:a.sources)||{}){const Pt=a.sources[Xe];(ze=Pt==null?void 0:Pt.features)!=null&&ze.length&&Re.push(...Pt.features)}return nu(Re)}),B=te(()=>ke.value?xf(D.value,ke.value):[]),V=te(()=>{var Re;return ce.value==="detail"&&ke.value?((Re=ke.value.properties)==null?void 0:Re.name)||t("legend.header.peopleGroupFallback"):se.value==="collapsed"?o.title||t("legend.header.collapsed"):o.title||h.value});function ne(Re){n.handleLegendItemClick(),P(Re)}function H(){O()||n.toggleLegend()}function le(){O()||(n.selectPeopleGroup(null),n.openLegend())}const be=te(()=>{var Oe;if(!ke.value)return null;const Re=ke.value.properties||{};return Re.imageUrl||((Oe=Re._raw)==null?void 0:Oe.ImageURL)||null});function E(Re){var Pt;if(se.value==="collapsed"){I.pending="hold",I.active=!1;return}const Oe=Re.touches[0],ze=F.value;!Oe||!ze||!(Oe.clientY-ze.getBoundingClientRect().top<=FA)||(I.pending="grab",I.active=!1,I.startY=Oe.clientY,I.startH=ze.offsetHeight,I.lastH=I.startH,I.startState=se.value,I.containerH=((Pt=ze.parentElement)==null?void 0:Pt.offsetHeight)||window.innerHeight,I.maxH=I.containerH-Df)}function C(Re){if(!I.pending&&!I.active)return;if(I.pending==="hold"){Re.cancelable&&Re.preventDefault();return}const Oe=Re.touches[0];if(!Oe)return;const ze=I.startY-Oe.clientY;if(!I.active){if(ze===0)return;I.pending=null,I.active=!0,U.value=!0}Re.preventDefault();const Xe=Math.round(Math.min(I.maxH,Math.max(zf,I.startH+ze)));I.lastH=Xe,n.setLegendHeight(`${Xe}px`)}function X(){if(I.pending=null,!I.active)return;I.active=!1,U.value=!1,K=Date.now();const Re=I.lastH,Oe=Re-I.startH,ze=I.containerH*.3;if(ce.value!=="detail"){Re0?n.fullyOpenLegend():I.startState==="fullyOpen"?n.openLegend():n.collapseLegend()}function de(Re){Re==="fullyOpen"?n.fullyOpenLegend():Re==="collapsed"?n.collapseLegend():n.openLegend()}let $e=null;mo(()=>{const Re=F.value,Oe=Re&&Re.getRootNode?Re.getRootNode():null;$e=Oe&&Oe.host?Oe.host:typeof document<"u"?document.documentElement:null,$e&&($e.__lmCount=($e.__lmCount||0)+1,$e.classList.add(jf))}),eo(()=>{$e&&($e.__lmCount=Math.max(0,($e.__lmCount||1)-1),$e.__lmCount||$e.classList.remove(jf),$e=null)});let ve=0;function J(Re){const Oe=F.value;if(!Oe||!Oe.isConnected)return;const ze=Re?0:Oe.offsetHeight,Xe=ze>0?se.value==="collapsed"?"collapsed":"open":"gone";Oe.dispatchEvent(new CustomEvent(IA,{bubbles:!0,composed:!0,detail:{height:ze,collapsedHeight:zf,state:Xe}}))}function ue(){ve||typeof requestAnimationFrame>"u"||(ve=requestAnimationFrame(()=>{ve=0,J(!1)}))}We(se,()=>ue()),mo(()=>{const Re=F.value;Re&&(Re.addEventListener("transitionend",ue),window.addEventListener("resize",ue),ue())}),eo(()=>{ve&&(cancelAnimationFrame(ve),ve=0);const Re=F.value;Re&&Re.removeEventListener("transitionend",ue),window.removeEventListener("resize",ue),J(!0)});let Fe=null,Ie=null,st=null;mo(()=>{const Re=F.value;if(!Re||typeof ResizeObserver>"u")return;const Oe=Re.getRootNode();Ie=Oe instanceof ShadowRoot?Oe.host:Oe.documentElement||null,Ie&&(st=Re,Fe=new ResizeObserver(()=>{ue();const ze=Re.offsetHeight;ze<=0||(Ie.style.setProperty(Bf,`${ze}px`),Ie.__legendSheetVarOwner=Re)}),Fe.observe(Re))}),eo(()=>{Fe&&(Fe.disconnect(),Fe=null),Ie&&Ie.__legendSheetVarOwner===st&&(Ie.style.removeProperty(Bf),Ie.__legendSheetVarOwner=null),Ie=null,st=null});let pt=0;function _t(Re){pt=0;const Oe=F.value,ze=Oe&&Oe.getRootNode?Oe.getRootNode():null;if(!ze||!ze.querySelector)return;const Xe=ze.querySelector(".maplibregl-ctrl-attrib.maplibregl-compact-show, .mapboxgl-ctrl-attrib.mapboxgl-compact-show");if(Xe){pt=setTimeout(()=>{pt=0,n.isMobile&&Xe.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")},OA);return}const Pt=ze.querySelector(".maplibregl-ctrl-attrib, .mapboxgl-ctrl-attrib");Pt&&!/attrib-empty/.test(Pt.className)||Re>0&&(pt=setTimeout(()=>_t(Re-1),500))}return mo(()=>_t(60)),eo(()=>{pt&&(clearTimeout(pt),pt=0)}),(Re,Oe)=>{var ze;return oe(),me("div",xA,[ce.value==="detail"&&ke.value&&se.value==="open"&&be.value?(oe(),me("div",{key:0,class:"floating-mini-image",onClick:Oe[0]||(Oe[0]=Xe=>ge(n).fullyOpenLegend())},[R("img",{src:be.value,alt:(ze=ke.value.properties)==null?void 0:ze.name,class:"mini-image"},null,8,PA)])):Ee("",!0),R("div",{ref_key:"sheetRef",ref:F,class:Ye(["legend-mobile-sheet",[se.value,{"sheet-dark":e.isDark,dragging:U.value,fit:Q.value}]]),style:Rt({height:Q.value?"auto":ye.value,"--legend-sheet-top-reserve":Df+"px"}),onTouchstart:E,onTouchmove:C,onTouchend:X,onTouchcancel:X},[R("div",{class:"sheet-drag-strip",onClick:H},[xe.value?(oe(),me("div",SA)):Ee("",!0)]),ce.value==="detail"&&se.value!=="collapsed"?(oe(),me("button",{key:0,class:"detail-collapse-btn-mobile",onClick:Et(H,["stop"]),"aria-expanded":String(he.value),"aria-label":ge(t)("aria.toggleLegend")},null,8,AA)):Ee("",!0),ce.value==="detail"&&se.value!=="collapsed"?(oe(),me("button",{key:1,class:"detail-close-btn",onClick:Et(le,["stop"]),"aria-label":ge(t)("aria.backToLegend")},[...Oe[2]||(Oe[2]=[R("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[R("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,LA)):Ee("",!0),se.value==="collapsed"&&ce.value==="detail"&&ke.value?(oe(),me("div",{key:2,class:"collapsed-detail-footer",onClick:H},[R("button",{class:"mobile-collapse-caret",style:Rt({transform:`rotate(${Se.value}deg)`}),"aria-expanded":String(he.value),"aria-label":ge(t)("aria.toggleLegend"),tabindex:"-1"},[...Oe[3]||(Oe[3]=[R("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[R("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,CA),R("span",TA,_e(V.value),1)])):Ee("",!0),R("div",EA,[ce.value==="detail"&&ke.value?(oe(),me(rt,{key:0},[se.value!=="collapsed"?(oe(),ht(tu,{key:0,peopleGroup:ke.value,hideHeader:!0,dark:e.isDark,action:e.popupAction},null,8,["peopleGroup","dark","action"])):Ee("",!0),se.value!=="collapsed"?(oe(),ht(Ci,{key:1,shared:B.value,dark:e.isDark},null,8,["shared","dark"])):Ee("",!0)],64)):e.legendType!=="default"?(oe(),ht(Tf,{key:1,"pin-note":!1,nodes:N.value,tabs:A.value,"default-tab":e.defaultTab,title:V.value||w.value,hideTabs:e.nodes?!e.tabs:q.value,columnLabel:j.value,columns:e.columns||["count","pop"],"export-enabled":i.value,"export-cards":i.value&&ge(l)===!0,onSelect:ge(r),onExport:Oe[1]||(Oe[1]=Xe=>ge(s)&&ge(s)(Xe))},{"title-caret":fo(()=>[R("button",{class:"mobile-collapse-caret",style:Rt({transform:`rotate(${Se.value}deg)`}),onClick:Et(H,["stop"]),"aria-expanded":String(he.value),"aria-label":ge(t)("aria.toggleLegend")},[...Oe[4]||(Oe[4]=[R("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[R("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,MA)]),_:1},8,["nodes","tabs","default-tab","title","hideTabs","columnLabel","columns","export-enabled","export-cards","onSelect"])):(oe(),ht($f,{key:2,title:V.value,items:ge(u),columns:ge(d),activeFilter:ge(x),isDark:e.isDark,hideColumnHeader:!1,showFooter:!1,disableCollapse:!0,totalCount:ge(_),totalPopulation:ge(g),fmtPop:ge(b),fmtCount:ge(m),onFilterClick:ne},{"title-caret":fo(()=>[R("button",{class:"mobile-collapse-caret",style:Rt({transform:`rotate(${Se.value}deg)`}),onClick:Et(H,["stop"]),"aria-expanded":String(he.value),"aria-label":ge(t)("aria.toggleLegend")},[...Oe[5]||(Oe[5]=[R("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[R("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,RA)]),_:1},8,["title","items","columns","activeFilter","isDark","totalCount","totalPopulation","fmtPop","fmtCount"]))])],38)])}}},[["styles",[kA]],["__scopeId","data-v-0a90c77a"]])},Symbol.toStringTag,{value:"Module"})),Hf={regular:"Noto Sans Regular",medium:"Noto Sans Bold",bold:"Noto Sans Bold"};function DA(e){return typeof window<"u"&&!!window.maplibregl&&e instanceof window.maplibregl.Map}function zA(e,{weight:t="regular",mapbox:o}={}){return DA(e)?{"text-font":[Hf[t]||Hf.regular]}:Array.isArray(o)&&o.length?{"text-font":o}:{}}function lu(e,t,o,n){const a=parseFloat(t)-parseFloat(n),r=parseFloat(e)-parseFloat(o);return Math.sqrt(a*a+r*r)}function jA(e,t){const o={};for(const n of e){const a=t(n);o[a]||(o[a]=[]),o[a].push(n)}return o}const BA=Object.freeze({cluster:!0,clusterMaxZoom:6,clusterRadius:40}),GA=Object.freeze(["step",["get","point_count"],"#51bbd6",10,"#f1f075",50,"#f28cb1",500,"#e74c3c"]),HA=Object.freeze(["step",["get","point_count"],15,10,20,50,25,500,35]);class Uf{constructor(t={}){this.maxConnectionDistance=t.maxConnectionDistance??1/0}_calculateDistance(t,o){return lu(parseFloat(t.latitude),parseFloat(t.longitude),parseFloat(o.latitude),parseFloat(o.longitude))}_createUnionFind(t){const o=Array.from({length:t},(s,i)=>i),n=new Array(t).fill(0),a=s=>(o[s]!==s&&(o[s]=a(o[s])),o[s]);return{find:a,union:(s,i)=>{const l=a(s),c=a(i);return l===c?!1:(n[l]n[c]?o[c]=l:(o[c]=l,n[l]++),!0)}}}generateMSTLines(t,o={}){const n=o.maxConnectionDistance??this.maxConnectionDistance;if(!t||t.length<2)return[];const a=t.filter(g=>{const b=parseFloat(g.latitude),m=parseFloat(g.longitude);return!isNaN(b)&&!isNaN(m)});if(a.length<2)return[];const r=a.length,s=a.map(g=>parseFloat(g.latitude)),i=a.map(g=>parseFloat(g.longitude)),l=new Uint8Array(r),c=new Float64Array(r).fill(1/0),u=new Int32Array(r).fill(-1),d=[];let h=r;for(;h>0;){let g=-1,b=1/0;for(let m=0;mn){g=-1;for(let m=0;m=0){const m=u[g];d.push({from:m,to:g,distance:c[g],fromPoint:a[m],toPoint:a[g]})}for(let m=0;m({type:"Feature",geometry:{type:"LineString",coordinates:[[parseFloat(g.fromPoint.longitude),parseFloat(g.fromPoint.latitude)],[parseFloat(g.toPoint.longitude),parseFloat(g.toPoint.latitude)]]},properties:{distance:g.distance,algorithm:"MST"}}));return d.length${n} deg).`),_}generateMultiGroupMSTLines(t,o=null,n={}){const a={},r=Object.keys(t).sort((s,i)=>t[i].length-t[s].length);for(const s of r){const i=t[s];if(!i||i.length<2){a[s]={lines:[],count:0,pointCount:(i==null?void 0:i.length)||0};continue}const l=this.generateMSTLines(i,n);if(typeof o=="function"){const c=o(s);l.forEach(u=>{u.properties={...u.properties,group:s,color:c}})}else l.forEach(c=>{c.properties={...c.properties,group:s}});a[s]={lines:l,count:l.length,pointCount:i.length}}return a}generateAllMSTLines(t,o=null,n={}){const a=this.generateMultiGroupMSTLines(t,o,n),r=[];for(const s in a)r.push(...a[s].lines);return r}getMSTStats(t,o={}){const n=this.generateMultiGroupMSTLines(t,null,o);let a=0,r=0;const s=[];for(const l in n){const{lines:c,pointCount:u}=n[l];a+=c.length,r+=u;const d=Math.max(0,u-1),h=u>1?(c.length/d*100).toFixed(1):100;s.push({name:l,points:u,lines:c.length,expected:d,coverage:h+"%",hasOrphans:c.lengthc.points-l.points);const i=s.filter(l=>l.hasOrphans).length;return{algorithm:"MST (Minimum Spanning Tree)",totalGroups:Object.keys(t).length,totalPoints:r,totalLines:a,expectedLines:Math.max(0,r-Object.keys(t).length),groupsWithOrphans:i,allPointsConnected:i===0,groups:s}}}new Uf;class Wf{constructor(t={}){this.maxDistance=t.maxDistance??15,this.maxNeighbors=t.maxNeighbors??15,this.sortKey=t.sortKey??"longitude"}_calculateDistance(t,o,n,a){return lu(t,o,n,a)}generateNetworkLines(t,o={}){const n=o.maxDistance??this.maxDistance,a=o.maxNeighbors??this.maxNeighbors,r=o.sortKey??this.sortKey,s=o.connectOrphans??!0;if(!t||t.length<2)return[];const i=t.filter(d=>{const h=parseFloat(d.latitude),x=parseFloat(d.longitude);return!isNaN(h)&&!isNaN(x)});if(i.length<2)return[];const l=[],c=new Set,u=[...i].sort((d,h)=>parseFloat(d[r])-parseFloat(h[r]));for(let d=0;dt[i].length-t[s].length);for(const s of r){const i=t[s];if(!i||i.length<2){a[s]={lines:[],count:0,pointCount:(i==null?void 0:i.length)||0};continue}const l=this.generateNetworkLines(i,n);if(typeof o=="function"){const c=o(s);l.forEach(u=>{u.properties={...u.properties,group:s,color:c}})}else l.forEach(c=>{c.properties={...c.properties,group:s}});a[s]={lines:l,count:l.length,pointCount:i.length}}return a}generateAllNetworkLines(t,o=null,n={}){const a=this.generateMultiGroupNetworkLines(t,o,n),r=[];for(const s in a)r.push(...a[s].lines);return r}getClusteringStats(t,o={}){const n=this.generateMultiGroupNetworkLines(t,null,o);let a=0,r=0;const s=[];for(const i in n){const{lines:l,pointCount:c}=n[i];a+=l.length,r+=c,s.push({name:i,points:c,lines:l.length,ratio:c>0?(l.length/c).toFixed(2):0})}return s.sort((i,l)=>l.points-i.points),{algorithm:"Network (nearest-neighbor)",totalGroups:Object.keys(t).length,totalPoints:r,totalLines:a,avgLinesPerPoint:r>0?(a/r).toFixed(2):0,groups:s}}}new Wf({maxDistance:15,maxNeighbors:15,sortKey:"longitude"});const rr="cluster-lines-source",sr="cluster-lines",ta="mapbox-clusters",No="mapbox-clusters-circle",ir="mapbox-clusters-count",UA=Object.freeze({type:"FeatureCollection",features:[]});function Kf(e={}){const{getMap:t=()=>null,mapId:o="unknown",getPeopleGroups:n=()=>[],pinSourceId:a="language-families",pinLayerId:r="language-family-pins",groupKey:s="languageFamily",getGroupColor:i=null,mapboxClusterOptions:l={}}=e,c=He("mapStore",null),u=new Uf({maxConnectionDistance:1/0}),d=new Wf({maxDistance:15,maxNeighbors:15,sortKey:"longitude"}),h=we(!1),x=we("mapbox"),P=te(()=>c&&"clusteringEnabled"in c?!!c.clusteringEnabled:h.value),_=te(()=>c&&c.clusteringMode?c.clusteringMode:x.value),g=we([]);let b=null,m=null,$=null;function p(O){const se=["mapbox","mst","network"];if(!se.includes(O)){console.warn(`[${o}] useMapClustering.setMode: unknown mode "${O}". Allowed: ${se.join(", ")}`);return}c&&typeof c.setClusteringMode=="function"?c.setClusteringMode(O):c&&"clusteringMode"in c?c.clusteringMode=O:x.value=O,P.value&&(G(),S())}function y(O){const se=!!O;c&&typeof c.setClusteringEnabled=="function"?c.setClusteringEnabled(se):c&&"clusteringEnabled"in c?c.clusteringEnabled=se:h.value=se,se?S():G()}function f(O){!O||!O.property||O.value==null?$=null:$={property:O.property,value:O.value},c&&("clusterFilterProperty"in c&&(c.clusterFilterProperty=($==null?void 0:$.property)??null),"clusterFilterValue"in c&&(c.clusterFilterValue=($==null?void 0:$.value)??null)),P.value&&(G(),S())}function k(O){if(!$)return O;const{property:se,value:he}=$,ye=xe=>String(xe||"").toLowerCase().replace(/[^a-z0-9]+/g,""),Se=ye(he);return Se?O.filter(xe=>{var Z,ce;const Q=(xe==null?void 0:xe[se])??((Z=xe==null?void 0:xe.properties)==null?void 0:Z[se])??((ce=xe==null?void 0:xe._normalized)==null?void 0:ce[se]);return ye(Q)===Se}):O}function L(O){b=O}function S(){const O=t();if(O){switch(G(),_.value){case"mapbox":N(O);break;case"mst":A(O,"mst");break;case"network":A(O,"network");break;default:console.warn(`[${o}] Unknown clustering mode: ${_.value}`)}K(O,!0)}}function G(){const O=t();O&&(q(O,ir,!1),q(O,No,!1),v(O,ta),q(O,sr,!1),v(O,rr),g.value=[],j(O),K(O,!1))}function W(){const O=t();O&&(j(O),O.getLayer(ir)&&O.removeLayer(ir),O.getLayer(No)&&O.removeLayer(No),O.getSource(ta)&&O.removeSource(ta),O.getLayer(sr)&&O.removeLayer(sr),O.getSource(rr)&&O.removeSource(rr),K(O,!1)),g.value=[],b=null}function q(O,se,he){if(O.getLayer(se))try{O.setLayoutProperty(se,"visibility",he?"visible":"none")}catch{}}function v(O,se){const he=O.getSource(se);if(he&&typeof he.setData=="function")try{he.setData(UA)}catch{}}function N(O){const se=k(n());if(!se.length)return;const ye={type:"FeatureCollection",features:se.map(xe=>{const Q=parseFloat(xe.longitude??xe.lng),Z=parseFloat(xe.latitude??xe.lat);return isNaN(Q)||isNaN(Z)?null:{type:"Feature",geometry:{type:"Point",coordinates:[Q,Z]},properties:{...xe.properties||xe}}}).filter(Boolean)},Se=O.getSource(ta);Se&&typeof Se.setData=="function"?Se.setData(ye):O.addSource(ta,{type:"geojson",data:ye,...BA,...l}),O.getLayer(No)?q(O,No,!0):O.addLayer({id:No,type:"circle",source:ta,filter:["has","point_count"],paint:{"circle-color":GA,"circle-radius":HA,"circle-stroke-width":2,"circle-stroke-color":"#ffffff",...cn(O),"circle-opacity":.85}}),O.getLayer(ir)?q(O,ir,!0):O.addLayer({id:ir,type:"symbol",source:ta,filter:["has","point_count"],layout:{"text-field":["get","point_count_abbreviated"],...zA(O,{weight:"medium",mapbox:["DIN Offc Pro Medium","Arial Unicode MS Bold"]}),"text-size":12},paint:{"text-color":"#000000"}}),w(O)}function A(O,se){const he=k(n());if(!he.length)return;const ye=jA(he,ce=>{var ke;return ce[s]??((ke=ce._normalized)==null?void 0:ke[s])??"Unknown"}),Se=typeof i=="function"?i:()=>"#666666";let xe=[];if(se==="mst"?(xe=u.generateAllMSTLines(ye,Se),Object.keys(ye).length):(xe=d.generateAllNetworkLines(ye,Se),d.getClusteringStats(ye)),g.value=xe,xe.length===0)return;const Q={type:"FeatureCollection",features:xe},Z=O.getSource(rr);if(Z&&typeof Z.setData=="function"?Z.setData(Q):O.addSource(rr,{type:"geojson",data:Q}),O.getLayer(sr))q(O,sr,!0);else{const ce={id:sr,type:"line",source:rr,paint:{"line-color":["coalesce",["get","color"],"#666666"],"line-width":["interpolate",["linear"],["zoom"],0,.5,4,.75,8,1,12,1.5],...cn(O,"line"),"line-opacity":.5},layout:{"line-cap":"round","line-join":"round"}};O.getLayer(r)?O.addLayer(ce,r):O.addLayer(ce)}}function w(O){O.getLayer(No)&&(O.on("click",No,F),O.on("mouseenter",No,U),O.on("mouseleave",No,I),m=No)}function j(O){if(!m)return;const se=m;try{O.off("click",se,F),O.off("mouseenter",se,U),O.off("mouseleave",se,I)}catch{}m=null}function F(O){const se=t();if(!se)return;const he=se.queryRenderedFeatures(O.point,{layers:[No]});if(!he.length)return;const ye=he[0],Se=ye.properties.cluster_id,xe=ye.geometry.coordinates,Q=ye.properties.point_count;if(typeof b=="function"){b({clusterId:Se,coordinates:xe,pointCount:Q,originalEvent:O});return}const Z=se.getSource(ta);!Z||typeof Z.getClusterExpansionZoom!="function"||Z.getClusterExpansionZoom(Se,(ce,ke)=>{ce||se.easeTo({center:xe,zoom:ke})})}function U(){const O=t();O&&(O.getCanvas().style.cursor="pointer")}function I(){const O=t();O&&(O.getCanvas().style.cursor="")}function K(O,se){if(O.getLayer(r))try{O.setPaintProperty(r,"circle-opacity",se?.25:.9)}catch{}}return{enabled:P,mode:_,clusterLines:g,setMode:p,setEnabled:y,setSelectionFilter:f,onClusterClick:L,applyClustering:S,clearClustering:G,cleanup:W,mstUtil:u,networkUtil:d}}const WA=Object.freeze(Object.defineProperty({__proto__:null,default:Kf,useMapClustering:Kf},Symbol.toStringTag,{value:"Module"})),qf=e=>Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2)),Vf=e=>Math.atan(Math.sinh(e))*180/Math.PI,Yf=85.051129,Zf=e=>Math.max(-Yf,Math.min(Yf,e));function KA(e,t,o){const n=Math.max(1,Math.floor(o)||1),a=qf(Zf(Math.max(e,t))),r=qf(Zf(Math.min(e,t))),s=(a-r)/n,i=[];for(let l=0;l=e.widthIn?"portrait":"landscape"),margins:{...qt.margins},bleed:qt.bleed,slots:{title:{text:"Untitled",subtitle:"",heightIn:qt.title.heightIn},legend:{rows:[],type:"generic",widthIn:qt.legend.widthIn},scaleBar:!0,north:!0,footer:{left:"",right:"",attribution:qt.footer.attribution,heightIn:qt.footer.heightIn}},renderPath:"auto"}}const Xf=Object.freeze(Object.defineProperty({__proto__:null,defaultPosterSpec:qA,posterDefaults:qt},Symbol.toStringTag,{value:"Module"}));function uo(e,t){return Math.round(e*t)}function Jf(e,t){var y,f,k,L,S,G,W,q;const o=t.dpi,n=e.margins||qt.margins,a={x:0,y:0,w:t.width,h:t.height},r={x:uo(n.left,o),y:uo(n.top,o),w:t.width-uo(n.left+n.right,o),h:t.height-uo(n.top+n.bottom,o)},s=(y=e.slots)!=null&&y.title?uo(e.slots.title.heightIn||qt.title.heightIn,o):0,i={x:r.x,y:r.y,w:r.w,h:s},l=uo(((k=(f=e.slots)==null?void 0:f.footer)==null?void 0:k.heightIn)||qt.footer.heightIn,o),c={x:r.x,y:r.y+r.h-l,w:r.w,h:l},u=(L=e.slots)!=null&&L.legend?uo(e.slots.legend.widthIn||qt.legend.widthIn,o):0,d=(S=e.slots)!=null&&S.scaleBar||(G=e.slots)!=null&&G.north?uo(qt.chromeBand.heightIn,o):0,h=r.y+s+(s?uo(qt.gutter.in,o):0),x=c.y-d-(d?uo(qt.gutter.in,o):0),P={x:r.x,y:h,w:r.w-(u?u+uo(qt.gutter.in,o):0),h:x-h},_=u?{x:r.x+r.w-u,y:h,w:u,h:P.h}:{x:0,y:0,w:0,h:0},g=uo(qt.scaleBar.widthIn,o),b=d,m=(W=e.slots)!=null&&W.scaleBar?{x:r.x,y:x+(d?uo(qt.gutter.in,o):0),w:g,h:b}:{x:0,y:0,w:0,h:0},$=uo(qt.north.sizeIn,o),p=(q=e.slots)!=null&&q.north?{x:r.x+r.w-$-(u?u+uo(qt.gutter.in,o):0),y:x+(d?uo(qt.gutter.in,o):0),w:$,h:$}:{x:0,y:0,w:0,h:0};return{page:a,content:r,title:i,map:P,legend:_,scaleBar:m,north:p,footer:c}}const VA={"©":"©","&":"&"," ":" ","<":"<",">":">",""":'"',"'":"'"};function YA(e){return e?String(e).replace(/<[^>]*>/g," ").replace(/&[a-z]+;|&#\d+;/gi,t=>VA[t.toLowerCase()]??" ").replace(/\s+/g," ").trim():""}function ZA(e){if(!e||typeof e.getStyle!="function")return"";let t;try{t=e.getStyle()}catch{return""}const o=t&&t.sources||{},n=[];for(const a of Object.keys(o)){let r=null;try{r=typeof e.getSource=="function"?e.getSource(a):null}catch{r=null}const s=YA(r&&r.attribution||o[a].attribution);s&&!n.includes(s)&&n.push(s)}return n.join(" ")}const ya=4096,gn=2048,Qf=15e3;function XA(e){const t=we({phase:"idle",completed:0,total:0,message:"",fraction:0,percent:0}),o=we(!1);let n=null;async function a(_,g="png"){var $;if(o.value)throw new Error("useMapPoster: already rendering");const b=e();if(!b)throw new Error("useMapPoster: no source map");n=new AbortController;const m=o2(_.signal,n.signal);o.value=!0,l=0,c("init",1,1,"preparing render");try{const p=em(_),y=JA(_.renderPath||"auto",p);y==="single"&&(p.width>ya||p.height>ya)&&console.warn(`[useMapPoster] requested single-canvas ${p.width}×${p.height}px > ${ya}; auto-switching to tile-stitch.`);const f=y==="single"&&(p.width>ya||p.height>ya)?"stitch":y,k=_.layout==="poster",L=k?Jf(_,p):null,S=!!L&&L.map.w>0&&L.map.h>0;k&&!S&&console.warn('[useMapPoster] layout:"poster" asked for a map box of '+(L?L.map.w+"×"+L.map.h:"0×0")+"px; the margins, title, footer and legend column leave no room on this sheet. Falling back to a full-bleed map.");const G=S?{width:L.map.w,height:L.map.h,dpi:p.dpi}:p,W=f==="single"?await u(b,G,m):await d(b,G,m);c("compose",0,1,"compositing overlay");const q=ZA(b),v=q?{..._,slots:{..._.slots,footer:{...(($=_.slots)==null?void 0:$.footer)||{},attribution:q}}}:_,N=S?h(W,L,p):W,A=await x(N,v,p);c("encode",0,1,`encoding ${g.toUpperCase()}`);const w=g==="pdf"?await t2(A,_):await e2(A,"image/png");return c("done",1,1,"render complete"),w}finally{o.value=!1,n=null}}function r(){n&&n.abort()}const s={init:.02,"hidden-map":.3,stitch:.42,capture:.14,compose:.06,encode:.05,done:.01},i=["init","hidden-map","stitch","capture","compose","encode","done"];let l=0;function c(_,g,b,m){const $=i.indexOf(_);let p=0;for(let k=0;k<$;k++)p+=s[i[k]]||0;const y=b>0?Math.min(1,g/b):0,f=p+(s[_]||0)*y;l=_==="init"?f:Math.max(l,f),t.value={phase:_,completed:g,total:b,message:m,fraction:Math.min(1,l),percent:Math.round(Math.min(1,l)*100)}}async function u(_,g,b){c("hidden-map",0,3,"creating hidden map");const{hiddenMap:m,restoreDpr:$,container:p}=await tm(_,g.width,g.height);try{cu(b),c("hidden-map",1,3,"loading map tiles"),await nm(m),c("hidden-map",3,3,"tiles loaded"),cu(b),c("capture",0,1,"capturing canvas");const y=m.getCanvas().toDataURL("image/png"),f=await am(y),k=document.createElement("canvas");return k.width=g.width,k.height=g.height,k.getContext("2d").drawImage(f,0,0,g.width,g.height),k}finally{try{m.remove()}catch{}p!=null&&p.parentNode&&p.parentNode.removeChild(p),$()}}async function d(_,g,b){const m=Math.ceil(g.width/gn),$=Math.ceil(g.height/gn),p=m*$;c("hidden-map",0,p,`creating hidden map (${m}×${$} tiles)`);const y=_.getBounds(),f=_.getCenter(),k=_.getZoom(),L=_.getBearing(),S=_.getPitch(),{hiddenMap:G,restoreDpr:W,container:q}=await tm(_,gn,gn,{preserveBounds:!0,bounds:y});try{const v=document.createElement("canvas");v.width=g.width,v.height=g.height;const N=v.getContext("2d"),A=y.getNorthEast(),w=y.getSouthWest(),F=(A.lng-w.lng)/m,U=KA(w.lat,A.lat,$);let I=0;for(let K=0;K<$;K++)for(let O=0;Ot&&([t,o]=[o,t]),e.orientation==="portrait"&&t>o&&([t,o]=[o,t]);const n=e.dpi||300;return{width:Math.round(t*n),height:Math.round(o*n),dpi:n}}function JA(e,t){return e==="single"||e==="stitch"?e:t.width>ya||t.height>ya?"stitch":"single"}async function tm(e,t,o,n={}){const a=document.createElement("div");a.style.cssText=` position: fixed; top: -100000px; left: -100000px; width: ${t}px; height: ${o}px; pointer-events: none; visibility: hidden; `,document.body.appendChild(a);const r=window.devicePixelRatio,s=()=>{try{Object.defineProperty(window,"devicePixelRatio",{value:r,configurable:!0})}catch{}};try{Object.defineProperty(window,"devicePixelRatio",{value:1,configurable:!0})}catch{}const i=typeof window<"u"?window:{},l=!!i.maplibregl&&e instanceof i.maplibregl.Map,c=hi(e);if(!c)throw new Error("useMapPoster: "+(l?"maplibregl":"mapboxgl")+" global not found");const u=e.getStyle();l&&u&&typeof u.projection=="string"&&(u.projection={type:u.projection});const d=new c.Map({container:a,style:u,center:e.getCenter(),zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),interactive:!1,attributionControl:!1,preserveDrawingBuffer:!0,canvasContextAttributes:{preserveDrawingBuffer:!0},fadeDuration:0});let h="";await new Promise((x,P)=>{let _=!1;const g=$=>{_||(_=!0,clearTimeout(b),clearInterval(m),$?P($):x())},b=setTimeout(()=>g(new Error("useMapPoster: hidden map style.load timeout"+(h?" ("+h+")":""))),Qf),m=setInterval(()=>{try{d.isStyleLoaded()&&g()}catch{}},100);d.once("style.load",()=>g()),d.once("load",()=>g()),d.on("error",$=>{var p;h=String(((p=$==null?void 0:$.error)==null?void 0:p.message)||($==null?void 0:$.message)||$).slice(0,160)})});try{const x=typeof e.getLanguage=="function"?e.getLanguage():null;x&&typeof d.setLanguage=="function"&&d.setLanguage(x)}catch{}return n.preserveBounds&&n.bounds&&d.fitBounds(n.bounds,{padding:0,animate:!1,duration:0}),{hiddenMap:d,restoreDpr:s,container:a}}const om=6e4;function nm(e){return new Promise(t=>{let o=!1;const n=[],a=s=>{o||(o=!0,n.forEach(clearTimeout),s&&console.warn("[useMapPoster] "+s),requestAnimationFrame(()=>t()))},r=()=>{try{return typeof e.areTilesLoaded=="function"&&e.areTilesLoaded()}catch{return!1}};n.push(setTimeout(()=>{r()&&a()},Qf)),n.push(setTimeout(()=>a("hidden map not idle after "+om/1e3+"s; capturing what is drawn"),om)),e.loaded()&&!e.isMoving()?a():e.once("idle",()=>a())})}function am(e){return new Promise((t,o)=>{const n=new Image;n.crossOrigin="anonymous",n.onload=()=>t(n),n.onerror=a=>o(new Error("image load failed: "+((a==null?void 0:a.message)||"unknown"))),n.src=typeof e=="string"?e:URL.createObjectURL(e)})}function QA(e,t,o){const n=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(n);return new Promise((r,s)=>{const i=new Image;i.onload=()=>{URL.revokeObjectURL(a),r(i)},i.onerror=l=>{URL.revokeObjectURL(a),s(new Error("svg load failed: "+((l==null?void 0:l.message)||"unknown")))},i.width=t,i.height=o,i.src=a})}function e2(e,t){return new Promise((o,n)=>{e.toBlob(a=>a?o(a):n(new Error("toBlob failed")),t)})}async function t2(e,t){let o;try{const s=await Ot(()=>import("https://esm.sh/jspdf@4.2.1"),void 0);o=s.jsPDF||s.default}catch{throw new Error("useMapPoster.toPdf: jspdf not installed (npm i jspdf svg2pdf.js)")}const n=e.toDataURL("image/png"),a=e.width>e.height?"l":"p",r=new o({orientation:a,unit:"in",format:[t.widthIn,t.heightIn]});return r.addImage(n,"PNG",0,0,t.widthIn,t.heightIn),r.output("blob")}function cu(e){if(e!=null&&e.aborted)throw new DOMException("useMapPoster: aborted","AbortError")}function o2(...e){const t=new AbortController;for(const o of e)if(o){if(o.aborted){t.abort();break}o.addEventListener("abort",()=>t.abort(),{once:!0})}return t.signal}function rm(e){return(e==null?void 0:e.dir)==="rtl"}function uu(e,t,o){return rm(e)?`x="${t.w-o}" text-anchor="start" direction="rtl"`:`x="${o}"`}function n2(e,t){var a,r,s,i;const o=(((r=(a=e.slots)==null?void 0:a.title)==null?void 0:r.text)||"").replace(/[<>&]/g,va),n=(((i=(s=e.slots)==null?void 0:s.title)==null?void 0:i.subtitle)||"").replace(/[<>&]/g,va);return` diff --git a/public/dx-maps/doxa-research-map/research-map/index.html b/public/dx-maps/doxa-research-map/research-map/index.html index 54bd8b8ba..ba1b3120e 100644 --- a/public/dx-maps/doxa-research-map/research-map/index.html +++ b/public/dx-maps/doxa-research-map/research-map/index.html @@ -70,7 +70,7 @@ - + - + - + - + - + - + \n\n\n" + "script": "\n\n\n" } }, { @@ -145,8 +145,8 @@ "scriptUrl": "./cities-internet/cities-internet.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -162,7 +162,7 @@ "scriptUrl": "./cities-internet/cities-internet.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } } ] @@ -200,7 +200,7 @@ "bundle": "country-posters", "scriptUrl": "./country-posters/country-posters.js", "output": "dx-maps/country-posters/country-posters.js", - "integrity": "sha384-AZjcBslFb66hFuc69bVEO0q1sxjo+Pytwro46rQHg0+gJTZzX0HkHjoI2LjXqVxt", + "integrity": "sha384-STAgt3e7/LxQgjL9skQ1SXjncjAuDrLqZ4dfae4EhzIKpqzsSDMXd5stbzkzzHcW", "elements": [ "country-posters-map" ], @@ -223,8 +223,8 @@ "scriptUrl": "./country-posters/country-posters.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -240,7 +240,7 @@ "scriptUrl": "./country-posters/country-posters.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -256,8 +256,8 @@ "scriptUrl": "./country-posters/country-posters.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] @@ -416,7 +416,7 @@ "bundle": "doxa-research-map", "scriptUrl": "./doxa-research-map/doxa-research-map.js", "output": "dx-maps/doxa-research-map/doxa-research-map.js", - "integrity": "sha384-sjraCuyNY0DA+kYTsCrUrlA+Lqts6oUkfYgzPE/ptBL8DFOjbxL87R+QU7ZtU/P9", + "integrity": "sha384-RvYudaJfF5kTQB5wg9QIs5XEJsMVIqUjLB0DoRwJGhIc4vghFDG4cAWbXOEtcrXc", "elements": [ "doxa-research-map" ], @@ -435,8 +435,8 @@ "scriptUrl": "./doxa-research-map/doxa-research-map.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" }, "instances": [ { @@ -462,7 +462,7 @@ "bundle": "doxa-simple-map", "scriptUrl": "./doxa-simple-map/doxa-simple-map.js", "output": "dx-maps/doxa-simple-map/doxa-simple-map.js", - "integrity": "sha384-gdnygp7vt+nLyer1qvGo7uBw4qxWcG6F3ET6I3bHtRp8vufx0c00ggLbBCH+EG2f", + "integrity": "sha384-OxyJCfvJ+MJEL10KVV5ez3DPVNdTzFvL8R+KK5MkxB11Qba/zedXnqjufFjry4eH", "elements": [ "doxa-map", "doxa-simple-map" @@ -482,8 +482,8 @@ "scriptUrl": "./doxa-simple-map/doxa-simple-map.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" }, "instances": [ { @@ -880,7 +880,7 @@ "bundle": "my-upg-100-list", "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "output": "dx-maps/my-upg-100-list/my-upg-100-list.js", - "integrity": "sha384-34KshL1BBU9ML0QfnMS+BSUH/opJufgt957m1gQAePX3dU12ZEGE0vqegwbqycpj", + "integrity": "sha384-yak0YUOh9SJUazwneGIV45ImRivvw2fxmYzUfP/kjUxQsikxppQo9q9EXJM7L9ul", "elements": [ "my-upg-100-list-map" ], @@ -903,7 +903,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -919,8 +919,8 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -936,8 +936,8 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] diff --git a/public/dx-maps/my-upg-100-list/my-upg-100-list.js b/public/dx-maps/my-upg-100-list/my-upg-100-list.js index 6994d9ff3..5ec599d14 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 @@ -677,7 +677,7 @@ @media (prefers-reduced-motion: reduce) { .pgd-root, .pgd-card, .pgd-close, .pgd-img { transition: none !important; animation: none !important; } } -`,"legend-people-group-detail");const a=e,n=Qe("uiStore"),r=Qe("profileConfig",null),i=ee(()=>n.legendState),s=ee(()=>n.isMobile),l=ee(()=>!s.value||i.value==="fullyOpen"),c=ee(()=>Jh(a.peopleGroup.properties.name)),u=ee(()=>c.value.letter),d=ee(()=>Qw(a.peopleGroup.properties.name,{size:32,borderRadius:4})),p=ee(()=>a.peopleGroup.properties),$=be(null),k=be(!1),b=ee(()=>p.value.slug||"");async function m(D){if(!D)return;const M=uh();if(M)try{const le=await fi(`${M}/api/people-groups/detail/${encodeURIComponent(D)}?lang=${encodeURIComponent(o.value)}`);if(!le.ok)throw new Error(`HTTP ${le.status}`);$.value=await le.json()}catch{$.value=null}}ut(b,D=>{k.value=!1,$.value=null,m(D)},{immediate:!0});const y=ee(()=>{var D;return p.value.countryName||p.value.countryIsoLabel||p.value.country||p.value.countryIso||((D=p.value._raw)==null?void 0:D.Country)||""}),x=ee(()=>{var le;const D=p.value.status||((le=p.value._raw)==null?void 0:le.Status),M=y.value||"Unknown";return D?`${M} • ${D}`:M}),w=ee(()=>{var M;const D=p.value.language||((M=p.value._raw)==null?void 0:M.Language);if(!D)return"Unknown";if(typeof D=="object"&&D.label)return D.label;if(typeof D=="string"&&D.startsWith("{"))try{const le=JSON.parse(D);if(le!=null&&le.label)return le.label}catch{}return D}),_=ee(()=>{var D;return p.value.population||((D=p.value._raw)==null?void 0:D.Population)||0}),g=ee(()=>{var M,le;const D=[(M=$.value)==null?void 0:M.people_praying,p.value.peoplePraying,(le=p.value._raw)==null?void 0:le.people_praying];for(const $e of D)if($e!=null&&$e!=="")return Number($e);return null}),v=ee(()=>g.value===null?"—":g.value.toLocaleString()),S=ee(()=>{var D;return p.value.religionName||p.value.religionLabel||p.value.religion||((D=p.value._raw)==null?void 0:D.Religion)||""}),A=ee(()=>{var D,M,le;return((D=$.value)==null?void 0:D.imb_people_description)||((M=$.value)==null?void 0:M.description)||p.value.description||((le=p.value._raw)==null?void 0:le.Description)||""}),C=ee(()=>{var D,M,le;return((D=$.value)==null?void 0:D.image_url)||((M=$.value)==null?void 0:M.imageUrl)||p.value.imageUrl||((le=p.value._raw)==null?void 0:le.ImageURL)||Xh}),H=ee(()=>{const D=parseInt(_.value);return D>=1e6?`${(D/1e6).toFixed(1)}M`:D>=1e3?`${(D/1e3).toFixed(1)}K`:D.toLocaleString()});function Z(){n.selectPeopleGroup(null)}function F(){var $e;let D="";try{D=new URLSearchParams(window.location.search).get("utm_source")||""}catch{}const M=($e=r==null?void 0:r.value)==null?void 0:$e.utmSource,le=typeof window<"u"&&window.DOXA_UTM_SOURCE||"";return encodeURIComponent(String(D||M||le||"agwm"))}function P(D){return`https://pray.doxa.life/${encodeURIComponent(D)}?source=doxalife&utm_source=${F()}`}function se(D){return`${J()}/adopt/${encodeURIComponent(D)}/?source=doxalife&utm_source=${F()}`}function J(){const D=typeof window<"u"&&window.DOXA_SITE_URL||"";return String(D||"https://doxa.life").replace(/\/+$/,"")}function T(D){return`${J()}/research/${encodeURIComponent(D)}/?utm_source=${F()}`}function oe(){const D=b.value;if(!D)return;a.action!=="adopt"&&Xw(D);const M=a.action==="adopt"?se(D):P(D);window.open(M,"_blank","noopener")}function O(){const D=b.value;D&&window.open(T(D),"_blank","noopener")}function W(D){D.target.dataset.usedFallback||(D.target.dataset.usedFallback="true",D.target.src=Xh)}return(D,M)=>(Y(),ie("div",{class:Ue(["people-group-detail",{"dark-mode":e.dark}])},[e.hideHeader?Pe("",!0):(Y(),ie("div",tx,[N("div",ox,[N("div",{class:"avatar",style:Lt(d.value)},ue(u.value),5),N("div",ax,[N("h3",nx,ue(e.peopleGroup.properties.name),1),N("p",rx,ue(x.value),1)])]),N("button",{class:"close-button",onClick:Z,"aria-label":de(t)("aria.closeDetailView")},[...M[1]||(M[1]=[N("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[N("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,ix)])),N("div",sx,[e.hideHeader?(Y(),ie("h3",lx,ue(e.peopleGroup.properties.name||de(t)("legend.header.peopleGroupFallback")),1)):Pe("",!0),N("div",cx,[e.action==="pray"||e.action==="adopt"?(Y(),ie("button",{key:0,class:"action-btn primary",onClick:oe},[M[2]||(M[2]=N("svg",{class:"btn-icon",width:"16",height:"16",viewBox:"0 0 16 16"},[N("path",{d:"M8 2L10 6L14 6.5L11 9.5L11.5 14L8 12L4.5 14L5 9.5L2 6.5L6 6L8 2Z",fill:"currentColor"})],-1)),N("span",null,ue(e.action==="adopt"?de(t)("buttons.adoptThem"):de(t)("buttons.prayForThem")),1)])):Pe("",!0),N("button",{class:"action-btn secondary",onClick:O},[M[3]||(M[3]=N("svg",{class:"btn-icon",width:"16",height:"16",viewBox:"0 0 16 16"},[N("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor","stroke-width":"2",fill:"none"}),N("path",{d:"M8 6V8M8 10H8.01",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)),N("span",null,ue(de(t)("buttons.moreInfo")),1)])]),N("div",ux,[N("div",dx,[N("span",px,ue(de(t)("detail.labels.country")),1),N("span",gx,ue(y.value||"—"),1)]),N("div",hx,[N("span",fx,ue(de(t)("detail.labels.population")),1),N("span",mx,ue(H.value||"—"),1)]),N("div",bx,[N("span",$x,ue(de(t)("detail.labels.language")),1),N("span",_x,ue(w.value||"—"),1)]),N("div",yx,[N("span",vx,ue(de(t)("detail.labels.religion")),1),N("span",kx,ue(S.value||"—"),1)]),N("div",wx,[N("span",xx,ue(de(t)("detail.labels.peopleCommitted")),1),N("span",Px,ue(v.value),1)])]),l.value?(Y(),ie("div",Sx,[N("div",{class:Ue(["image-placeholder-svg",{hidden:k.value}])},[...M[4]||(M[4]=[N("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:"80",height:"96","aria-hidden":"true"},[N("circle",{cx:"50",cy:"36",r:"22",fill:"#ccc"}),N("ellipse",{cx:"50",cy:"95",rx:"36",ry:"28",fill:"#ccc"})],-1)])],2),C.value?(Y(),ie("img",{key:0,src:C.value,alt:`${e.peopleGroup.properties.name} people group`,class:Ue(["people-group-image",{loaded:k.value}]),onLoad:M[0]||(M[0]=le=>k.value=!0),onError:W},null,42,Ax)):Pe("",!0)])):Pe("",!0),l.value?(Y(),ie("div",Lx,[A.value?(Y(),ie("p",Cx,ue(A.value),1)):(Y(),ie("p",Tx,ue(de(t)("detail.messages.noDescription")),1))])):Pe("",!0)])],2))}},[["styles",[ex]],["__scopeId","data-v-049d89c4"]]),Ex=Object.freeze(Object.defineProperty({__proto__:null,default:Qh},Symbol.toStringTag,{value:"Module"})),Mx="",Nx={class:"legend-sheet-root"},Rx=["src","alt"],Fx={key:0,class:"pull-tab-handle"},Ix=["aria-expanded","aria-label"],Ox=["aria-label"],Dx=["aria-expanded","aria-label"],zx={class:"collapsed-detail-title"},Gx={class:"legend-content"},jx=["aria-expanded","aria-label"],Bx=["aria-expanded","aria-label"],ef=80,tf=48,Hx=44,Ux=24,of="lm-on",Wx="dxmaps:legend-sheet",af="--legend-sheet-h",Kx=4e3,Vx=qa({__name:"LegendMobile",props:{legendType:{type:String,required:!0},nodes:{type:Array,default:null},tabs:{type:Array,default:null},defaultTab:{type:Number,default:0},columnLabel:{type:String,default:null},title:{type:String,default:null},columns:{type:Array,default:null},isDark:{type:Boolean,default:!1},popupAction:{type:String,default:"pray",validator:e=>["pray","adopt","none"].includes(e)},disableCollapse:{type:Boolean,default:!1}},setup(e){const{t}=Bt();Kt(` +`,"legend-people-group-detail");const a=e,n=Qe("uiStore"),r=Qe("profileConfig",null),i=ee(()=>n.legendState),s=ee(()=>n.isMobile),l=ee(()=>!s.value||i.value==="fullyOpen"),c=ee(()=>Jh(a.peopleGroup.properties.name)),u=ee(()=>c.value.letter),d=ee(()=>Qw(a.peopleGroup.properties.name,{size:32,borderRadius:4})),p=ee(()=>a.peopleGroup.properties),$=be(null),k=be(!1),b=ee(()=>p.value.slug||"");async function m(D){if(!D)return;const M=uh();if(M)try{const le=await fi(`${M}/api/people-groups/detail/${encodeURIComponent(D)}?lang=${encodeURIComponent(o.value)}`);if(!le.ok)throw new Error(`HTTP ${le.status}`);$.value=await le.json()}catch{$.value=null}}ut(b,D=>{k.value=!1,$.value=null,m(D)},{immediate:!0});const y=ee(()=>{var D;return p.value.countryName||p.value.countryIsoLabel||p.value.country||p.value.countryIso||((D=p.value._raw)==null?void 0:D.Country)||""}),x=ee(()=>{var le;const D=p.value.status||((le=p.value._raw)==null?void 0:le.Status),M=y.value||"Unknown";return D?`${M} • ${D}`:M}),w=ee(()=>{var M;const D=p.value.language||((M=p.value._raw)==null?void 0:M.Language);if(!D)return"Unknown";if(typeof D=="object"&&D.label)return D.label;if(typeof D=="string"&&D.startsWith("{"))try{const le=JSON.parse(D);if(le!=null&&le.label)return le.label}catch{}return D}),_=ee(()=>{var D;return p.value.population||((D=p.value._raw)==null?void 0:D.Population)||0}),g=ee(()=>{var M,le;const D=[(M=$.value)==null?void 0:M.people_praying,p.value.peoplePraying,(le=p.value._raw)==null?void 0:le.people_praying];for(const $e of D)if($e!=null&&$e!=="")return Number($e);return null}),v=ee(()=>g.value===null?"—":g.value.toLocaleString()),S=ee(()=>{var D;return p.value.religionName||p.value.religionLabel||p.value.religion||((D=p.value._raw)==null?void 0:D.Religion)||""}),A=ee(()=>{var D,M,le;return((D=$.value)==null?void 0:D.imb_people_description)||((M=$.value)==null?void 0:M.description)||p.value.description||((le=p.value._raw)==null?void 0:le.Description)||""}),C=ee(()=>{var D,M,le;return((D=$.value)==null?void 0:D.image_url)||((M=$.value)==null?void 0:M.imageUrl)||p.value.imageUrl||((le=p.value._raw)==null?void 0:le.ImageURL)||Xh}),H=ee(()=>{const D=parseInt(_.value);return D>=1e6?`${(D/1e6).toFixed(1)}M`:D>=1e3?`${(D/1e3).toFixed(1)}K`:D.toLocaleString()});function Z(){n.selectPeopleGroup(null)}function F(){var $e;let D="";try{D=new URLSearchParams(window.location.search).get("utm_source")||""}catch{}const M=($e=r==null?void 0:r.value)==null?void 0:$e.utmSource,le=typeof window<"u"&&window.DOXA_UTM_SOURCE||"";return encodeURIComponent(String(D||M||le||"agwm"))}function P(D){return`https://pray.doxa.life/${encodeURIComponent(D)}?source=doxalife&utm_source=${F()}`}function se(D){return`${J()}/adopt/${encodeURIComponent(D)}/?source=doxalife&utm_source=${F()}`}function J(){const D=typeof window<"u"&&window.DOXA_SITE_URL||"";return String(D||"https://doxa.life").replace(/\/+$/,"")}function T(D){return`${J()}/research/${encodeURIComponent(D)}/?utm_source=${F()}`}function oe(){const D=b.value;if(!D)return;a.action!=="adopt"&&Xw(D);const M=a.action==="adopt"?se(D):P(D);window.open(M,"_blank","noopener")}function O(){const D=b.value;D&&window.open(T(D),"_blank","noopener")}function W(D){D.target.dataset.usedFallback||(D.target.dataset.usedFallback="true",D.target.src=Xh)}return(D,M)=>(Y(),ie("div",{class:Ue(["people-group-detail",{"dark-mode":e.dark}])},[e.hideHeader?Pe("",!0):(Y(),ie("div",tx,[N("div",ox,[N("div",{class:"avatar",style:Lt(d.value)},ue(u.value),5),N("div",ax,[N("h3",nx,ue(e.peopleGroup.properties.name),1),N("p",rx,ue(x.value),1)])]),N("button",{class:"close-button",onClick:Z,"aria-label":de(t)("aria.closeDetailView")},[...M[1]||(M[1]=[N("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[N("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,ix)])),N("div",sx,[e.hideHeader?(Y(),ie("h3",lx,ue(e.peopleGroup.properties.name||de(t)("legend.header.peopleGroupFallback")),1)):Pe("",!0),N("div",cx,[e.action==="pray"||e.action==="adopt"?(Y(),ie("button",{key:0,class:"action-btn primary",onClick:oe},[M[2]||(M[2]=N("svg",{class:"btn-icon",width:"16",height:"16",viewBox:"0 0 16 16"},[N("path",{d:"M8 2L10 6L14 6.5L11 9.5L11.5 14L8 12L4.5 14L5 9.5L2 6.5L6 6L8 2Z",fill:"currentColor"})],-1)),N("span",null,ue(e.action==="adopt"?de(t)("buttons.adoptThem"):de(t)("buttons.prayForThem")),1)])):Pe("",!0),N("button",{class:"action-btn secondary",onClick:O},[M[3]||(M[3]=N("svg",{class:"btn-icon",width:"16",height:"16",viewBox:"0 0 16 16"},[N("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor","stroke-width":"2",fill:"none"}),N("path",{d:"M8 6V8M8 10H8.01",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)),N("span",null,ue(de(t)("buttons.moreInfo")),1)])]),N("div",ux,[N("div",dx,[N("span",px,ue(de(t)("detail.labels.country")),1),N("span",gx,ue(y.value||"—"),1)]),N("div",hx,[N("span",fx,ue(de(t)("detail.labels.population")),1),N("span",mx,ue(H.value||"—"),1)]),N("div",bx,[N("span",$x,ue(de(t)("detail.labels.language")),1),N("span",_x,ue(w.value||"—"),1)]),N("div",yx,[N("span",vx,ue(de(t)("detail.labels.religion")),1),N("span",kx,ue(S.value||"—"),1)]),N("div",wx,[N("span",xx,ue(de(t)("detail.labels.peopleCommitted")),1),N("span",Px,ue(v.value),1)])]),l.value?(Y(),ie("div",Sx,[N("div",{class:Ue(["image-placeholder-svg",{hidden:k.value}])},[...M[4]||(M[4]=[N("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:"80",height:"96","aria-hidden":"true"},[N("circle",{cx:"50",cy:"36",r:"22",fill:"#ccc"}),N("ellipse",{cx:"50",cy:"95",rx:"36",ry:"28",fill:"#ccc"})],-1)])],2),C.value?(Y(),ie("img",{key:0,src:C.value,alt:`${e.peopleGroup.properties.name} people group`,class:Ue(["people-group-image",{loaded:k.value}]),onLoad:M[0]||(M[0]=le=>k.value=!0),onError:W},null,42,Ax)):Pe("",!0)])):Pe("",!0),l.value?(Y(),ie("div",Lx,[A.value?(Y(),ie("p",Cx,ue(A.value),1)):(Y(),ie("p",Tx,ue(de(t)("detail.messages.noDescription")),1))])):Pe("",!0)])],2))}},[["styles",[ex]],["__scopeId","data-v-049d89c4"]]),Ex=Object.freeze(Object.defineProperty({__proto__:null,default:Qh},Symbol.toStringTag,{value:"Module"})),Mx="",Nx={class:"legend-sheet-root"},Rx=["src","alt"],Fx={key:0,class:"pull-tab-handle"},Ix=["aria-expanded","aria-label"],Ox=["aria-label"],Dx=["aria-expanded","aria-label"],zx={class:"collapsed-detail-title"},Gx={class:"legend-content"},jx=["aria-expanded","aria-label"],Bx=["aria-expanded","aria-label"],ef=80,tf=48,Hx=44,Ux=24,of="lm-on",Wx="dxmaps:legend-sheet",af="--legend-sheet-h",Kx=3e3,Vx=qa({__name:"LegendMobile",props:{legendType:{type:String,required:!0},nodes:{type:Array,default:null},tabs:{type:Array,default:null},defaultTab:{type:Number,default:0},columnLabel:{type:String,default:null},title:{type:String,default:null},columns:{type:Array,default:null},isDark:{type:Boolean,default:!1},popupAction:{type:String,default:"pray",validator:e=>["pray","adopt","none"].includes(e)},disableCollapse:{type:Boolean,default:!1}},setup(e){const{t}=Bt();Kt(` .floating-mini-image{position:absolute;inset-inline-start:calc(var(--map-fab-beside,0px) + 16px);bottom:calc(var(--legend-sheet-h,30%) + 16px);z-index:999;pointer-events:auto;cursor:pointer;} .mini-image{width:120px;height:150px;object-fit:cover;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.25);display:block;} .legend-sheet-root{position:absolute;inset:0;pointer-events:none;overflow:hidden;} @@ -689,13 +689,10 @@ :host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 6px 6px 0;} :host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib.mapboxgl-compact,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib.mapboxgl-compact{margin-right:6px;} @media (max-width:767.98px){ - :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-right{top:auto !important;bottom:var(--legend-sheet-h,48px) !important;transform:none !important;opacity:1;z-index:4;} - :host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-right{inset-inline-end:0 !important;inset-inline-start:auto !important;justify-content:flex-end;max-width:calc(100% - var(--map-fab-beside,0px) - 8px);} - :host(.lm-on) .mapboxgl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-right{max-width:calc(100% - var(--map-fab-beside,0px) - 104px);} - :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-left{inset-inline-start:var(--map-fab-beside,0px) !important;inset-inline-end:auto !important;} + :host(.lm-on) .mapboxgl-ctrl-bottom-left,:host(.lm-on) .mapboxgl-ctrl-bottom-right,:host(.lm-on) .maplibregl-ctrl-bottom-left,:host(.lm-on) .maplibregl-ctrl-bottom-right,.lm-on .mapboxgl-ctrl-bottom-left,.lm-on .mapboxgl-ctrl-bottom-right,.lm-on .maplibregl-ctrl-bottom-left,.lm-on .maplibregl-ctrl-bottom-right{top:0 !important;bottom:auto !important;inset-inline-start:0 !important;inset-inline-end:auto !important;transform:none !important;justify-content:flex-start;max-width:calc(100% - 44px);z-index:4;} :host(.lm-on) .maplibregl-ctrl-logo,.lm-on .maplibregl-ctrl-logo{display:none !important;} :host(.lm-on) .maplibregl-ctrl-attrib-inner,:host(.lm-on) .mapboxgl-ctrl-attrib-inner,.lm-on .maplibregl-ctrl-attrib-inner,.lm-on .mapboxgl-ctrl-attrib-inner{font-size:8.5px;line-height:12px;} - :host(.lm-on) .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,:host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-left .maplibregl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-left .maplibregl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 0 8px;margin-inline:8px;} + :host(.lm-on) .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,:host(.lm-on) .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-left .maplibregl-ctrl,:host(.lm-on) .maplibregl-ctrl-bottom-right .maplibregl-ctrl,.lm-on .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.lm-on .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.lm-on .maplibregl-ctrl-bottom-left .maplibregl-ctrl,.lm-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:8px 0 0;margin-inline:8px 0;} } .legend-mobile-sheet .stl-row{position:relative;} .legend-mobile-sheet .stl-row .stl-x-slot{position:absolute;inset-inline-end:6px;top:50%;transform:translateY(-50%);width:auto;} @@ -782,7 +779,7 @@ @media (prefers-reduced-motion: reduce) { .legend-sheet, .legend-content, .legend-handle, .legend-toggle { transition: none !important; animation: none !important; } } -`,"legend-mobile-sheet");const o=e,a=Qe("uiStore");Qe("mapStore");const n=Qe("dataStore"),r=Qe("onSemanticTreeSelect",()=>{}),i=Qe("onLegendExport",null),s=ee(()=>typeof i=="function"),l=Qe("legendExportCards",!1),c=L0(o,"legendType"),{items:u,columns:d,title:p,activeFilter:$,setFilter:k,totalCount:b,totalPopulation:m,fmtPop:y,fmtCount:x}=nw(c,rw),w=Qe("normalizedPeopleGroups",null),_=ee(()=>{var Ee,Ne;if((Ee=w==null?void 0:w.value)!=null&&Ee.length)return w.value;const Le=[];for(const Ke in(n==null?void 0:n.sources)||{}){const ft=n.sources[Ke];(Ne=ft==null?void 0:ft.features)!=null&&Ne.length&&Le.push(...ft.features)}return Le}),g={get value(){return _.value}},{langTree:v}=Wh(g),{affinityTree:S}=Ow(g),{regionsTree:A}=Yw(g),C=[{id:"family",label:"Lang Family",info:"A language family is a group of languages descended from a common ancestor."},{id:"language",label:"Language",info:"A language is a system of communication used by a people."},{id:"dialect",label:"Dialect",info:"A dialect/variety is a regional or social form of a language."}],H=[{id:"bloc",label:"Block",info:"Affinity Block (rop1) — broadest grouping. 16 blocks total."},{id:"cluster",label:"Cluster",info:"Cluster (imb_reg_of_people_2, ROP 2) — finer grouping inside a block. 194 total."},{id:"group",label:"PG",info:"People Group (imb_reg_of_people_25, ROP 2.5) — abstract identity. 1,736 PGs."},{id:"pgic",label:"PGIC",info:"PG in Country (imb_reg_of_people_3 + country_code) — one row per PG-country pair. 2,106 rows."}],Z=[{id:"region",label:"Region",info:'WAGF macro-region (e.g. "Asia", "Africa"). Color-coded on the map.'},{id:"block",label:"Bloc",info:'WAGF bloc — organizational sub-grouping within each region (e.g. "South East Asia").'},{id:"country",label:"Country",info:"Individual countries, listed by unreached-population size within their bloc."}],F=ee(()=>["prayer","engagement","adoption","religion"].includes(o.legendType));function P(Le){const Ee=[];for(const Ne of Le){Ee.push({id:Ne.key,label:Ne.label,color:Ne.color,count:Ne.count??0,pop:Ne.population??0,filter:Ne.filterKey?["==",["get","_flat_filter"],Ne.filterKey]:null,children:[]});for(const Ke of Ne.children||[])Ee.push({id:Ke.key,label:Ke.label,color:Ke.color,count:Ke.count??0,pop:Ke.population??0,filter:Ke.filterKey?["==",["get","_flat_filter"],Ke.filterKey]:null,children:[]})}return Ee}const se=ee(()=>o.nodes?o.nodes:F.value?P(u.value):o.legendType==="affinity-block"?S.value:o.legendType==="doxa-regions"?A.value:v.value),J=ee(()=>o.nodes?o.tabs:F.value?null:o.legendType==="affinity-block"?H:o.legendType==="doxa-regions"?Z:C),T=ee(()=>o.title?o.title:F.value?t("legend.titleBar.legend"):o.legendType==="affinity-block"?t("legend.titleBar.peopleGroups"):o.legendType==="doxa-regions"?t("legend.titleBar.wagfRegions"):t("legend.titleBar.languages")),oe=ee(()=>o.columnLabel!==null?o.columnLabel:["religion","prayer","engagement","adoption"].includes(o.legendType)?t("legend.colLabel."+o.legendType):F.value?t("legend.colLabel.status"):""),O=be(null),W=be(!1),D={pending:null,active:!1,startY:0,startH:0,startState:"",containerH:0,maxH:0,lastH:0};let M=0;const le=()=>Date.now()-M<400,$e=ee(()=>a.legendState),_e=ee(()=>$e.value!=="collapsed"),ve=ee(()=>a.legendHeight),Se=ee(()=>a.caretRotation),Fe=ee(()=>a.showPullTab),xe=ee(()=>$e.value==="open"&&!a._customLegendHeight);let we=!1;ut(()=>a.isMobile,Le=>{!Le||we||(we=!0,a.selectedPeopleGroup||a.collapseLegend())},{immediate:!0});const tt=ee(()=>a.legendMode),$t=ee(()=>a.selectedPeopleGroup),E=Qe("normalizedPeopleGroups",null),z=ee(()=>{var Ee,Ne;if((Ee=E==null?void 0:E.value)!=null&&Ee.length)return ah(E.value);const Le=[];for(const Ke in(n==null?void 0:n.sources)||{}){const ft=n.sources[Ke];(Ne=ft==null?void 0:ft.features)!=null&&Ne.length&&Le.push(...ft.features)}return ah(Le)}),I=ee(()=>$t.value?bv(z.value,$t.value):[]),ae=ee(()=>{var Le;return tt.value==="detail"&&$t.value?((Le=$t.value.properties)==null?void 0:Le.name)||t("legend.header.peopleGroupFallback"):$e.value==="collapsed"?o.title||t("legend.header.collapsed"):o.title||p.value});function pe(Le){a.handleLegendItemClick(),k(Le)}function ce(){le()||a.toggleLegend()}function R(){le()||(a.selectPeopleGroup(null),a.openLegend())}const V=ee(()=>{var Ee;if(!$t.value)return null;const Le=$t.value.properties||{};return Le.imageUrl||((Ee=Le._raw)==null?void 0:Ee.ImageURL)||null});function f(Le){var ft;if($e.value==="collapsed"){D.pending="hold",D.active=!1;return}const Ee=Le.touches[0],Ne=O.value;!Ee||!Ne||!(Ee.clientY-Ne.getBoundingClientRect().top<=Hx)||(D.pending="grab",D.active=!1,D.startY=Ee.clientY,D.startH=Ne.offsetHeight,D.lastH=D.startH,D.startState=$e.value,D.containerH=((ft=Ne.parentElement)==null?void 0:ft.offsetHeight)||window.innerHeight,D.maxH=D.containerH-ef)}function h(Le){if(!D.pending&&!D.active)return;if(D.pending==="hold"){Le.cancelable&&Le.preventDefault();return}const Ee=Le.touches[0];if(!Ee)return;const Ne=D.startY-Ee.clientY;if(!D.active){if(Ne===0)return;D.pending=null,D.active=!0,W.value=!0}Le.preventDefault();const Ke=Math.round(Math.min(D.maxH,Math.max(tf,D.startH+Ne)));D.lastH=Ke,a.setLegendHeight(`${Ke}px`)}function G(){if(D.pending=null,!D.active)return;D.active=!1,W.value=!1,M=Date.now();const Le=D.lastH,Ee=Le-D.startH,Ne=D.containerH*.3;if(tt.value!=="detail"){Le0?a.fullyOpenLegend():D.startState==="fullyOpen"?a.openLegend():a.collapseLegend()}function Q(Le){Le==="fullyOpen"?a.fullyOpenLegend():Le==="collapsed"?a.collapseLegend():a.openLegend()}let fe=null;ho(()=>{const Le=O.value,Ee=Le&&Le.getRootNode?Le.getRootNode():null;fe=Ee&&Ee.host?Ee.host:typeof document<"u"?document.documentElement:null,fe&&(fe.__lmCount=(fe.__lmCount||0)+1,fe.classList.add(of))}),Yt(()=>{fe&&(fe.__lmCount=Math.max(0,(fe.__lmCount||1)-1),fe.__lmCount||fe.classList.remove(of),fe=null)});let he=0;function U(Le){const Ee=O.value;if(!Ee||!Ee.isConnected)return;const Ne=Le?0:Ee.offsetHeight,Ke=Ne>0?$e.value==="collapsed"?"collapsed":"open":"gone";Ee.dispatchEvent(new CustomEvent(Wx,{bubbles:!0,composed:!0,detail:{height:Ne,collapsedHeight:tf,state:Ke}}))}function ne(){he||typeof requestAnimationFrame>"u"||(he=requestAnimationFrame(()=>{he=0,U(!1)}))}ut($e,()=>ne()),ho(()=>{const Le=O.value;Le&&(Le.addEventListener("transitionend",ne),window.addEventListener("resize",ne),ne())}),Yt(()=>{he&&(cancelAnimationFrame(he),he=0);const Le=O.value;Le&&Le.removeEventListener("transitionend",ne),window.removeEventListener("resize",ne),U(!0)});let Te=null,Ie=null,nt=null;ho(()=>{const Le=O.value;if(!Le||typeof ResizeObserver>"u")return;const Ee=Le.getRootNode();Ie=Ee instanceof ShadowRoot?Ee.host:Ee.documentElement||null,Ie&&(nt=Le,Te=new ResizeObserver(()=>{ne();const Ne=Le.offsetHeight;Ne<=0||(Ie.style.setProperty(af,`${Ne}px`),Ie.__legendSheetVarOwner=Le)}),Te.observe(Le))}),Yt(()=>{Te&&(Te.disconnect(),Te=null),Ie&&Ie.__legendSheetVarOwner===nt&&(Ie.style.removeProperty(af),Ie.__legendSheetVarOwner=null),Ie=null,nt=null});let gt=0;function _t(Le){gt=0;const Ee=O.value,Ne=Ee&&Ee.getRootNode?Ee.getRootNode():null;if(!Ne||!Ne.querySelector)return;const Ke=Ne.querySelector(".maplibregl-ctrl-attrib.maplibregl-compact-show, .mapboxgl-ctrl-attrib.mapboxgl-compact-show");if(Ke){gt=setTimeout(()=>{gt=0,a.isMobile&&Ke.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")},Kx);return}const ft=Ne.querySelector(".maplibregl-ctrl-attrib, .mapboxgl-ctrl-attrib");ft&&!/attrib-empty/.test(ft.className)||Le>0&&(gt=setTimeout(()=>_t(Le-1),500))}return ho(()=>_t(60)),Yt(()=>{gt&&(clearTimeout(gt),gt=0)}),(Le,Ee)=>{var Ne;return Y(),ie("div",Nx,[tt.value==="detail"&&$t.value&&$e.value==="open"&&V.value?(Y(),ie("div",{key:0,class:"floating-mini-image",onClick:Ee[0]||(Ee[0]=Ke=>de(a).fullyOpenLegend())},[N("img",{src:V.value,alt:(Ne=$t.value.properties)==null?void 0:Ne.name,class:"mini-image"},null,8,Rx)])):Pe("",!0),N("div",{ref_key:"sheetRef",ref:O,class:Ue(["legend-mobile-sheet",[$e.value,{"sheet-dark":e.isDark,dragging:W.value,fit:xe.value}]]),style:Lt({height:xe.value?"auto":ve.value,"--legend-sheet-top-reserve":ef+"px"}),onTouchstart:f,onTouchmove:h,onTouchend:G,onTouchcancel:G},[N("div",{class:"sheet-drag-strip",onClick:ce},[Fe.value?(Y(),ie("div",Fx)):Pe("",!0)]),tt.value==="detail"&&$e.value!=="collapsed"?(Y(),ie("button",{key:0,class:"detail-collapse-btn-mobile",onClick:Rt(ce,["stop"]),"aria-expanded":String(_e.value),"aria-label":de(t)("aria.toggleLegend")},null,8,Ix)):Pe("",!0),tt.value==="detail"&&$e.value!=="collapsed"?(Y(),ie("button",{key:1,class:"detail-close-btn",onClick:Rt(R,["stop"]),"aria-label":de(t)("aria.backToLegend")},[...Ee[2]||(Ee[2]=[N("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[N("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,Ox)):Pe("",!0),$e.value==="collapsed"&&tt.value==="detail"&&$t.value?(Y(),ie("div",{key:2,class:"collapsed-detail-footer",onClick:ce},[N("button",{class:"mobile-collapse-caret",style:Lt({transform:`rotate(${Se.value}deg)`}),"aria-expanded":String(_e.value),"aria-label":de(t)("aria.toggleLegend"),tabindex:"-1"},[...Ee[3]||(Ee[3]=[N("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[N("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Dx),N("span",zx,ue(ae.value),1)])):Pe("",!0),N("div",Gx,[tt.value==="detail"&&$t.value?(Y(),ie(Ye,{key:0},[$e.value!=="collapsed"?(Y(),St(Qh,{key:0,peopleGroup:$t.value,hideHeader:!0,dark:e.isDark,action:e.popupAction},null,8,["peopleGroup","dark","action"])):Pe("",!0),$e.value!=="collapsed"?(Y(),St(th,{key:1,shared:I.value,dark:e.isDark},null,8,["shared","dark"])):Pe("",!0)],64)):e.legendType!=="default"?(Y(),St(nh,{key:1,"pin-note":!1,nodes:se.value,tabs:J.value,"default-tab":e.defaultTab,title:ae.value||T.value,hideTabs:e.nodes?!e.tabs:F.value,columnLabel:oe.value,columns:e.columns||["count","pop"],"export-enabled":s.value,"export-cards":s.value&&de(l)===!0,onSelect:de(r),onExport:Ee[1]||(Ee[1]=Ke=>de(i)&&de(i)(Ke))},{"title-caret":yo(()=>[N("button",{class:"mobile-collapse-caret",style:Lt({transform:`rotate(${Se.value}deg)`}),onClick:Rt(ce,["stop"]),"aria-expanded":String(_e.value),"aria-label":de(t)("aria.toggleLegend")},[...Ee[4]||(Ee[4]=[N("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[N("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,jx)]),_:1},8,["nodes","tabs","default-tab","title","hideTabs","columnLabel","columns","export-enabled","export-cards","onSelect"])):(Y(),St(kw,{key:2,title:ae.value,items:de(u),columns:de(d),activeFilter:de($),isDark:e.isDark,hideColumnHeader:!1,showFooter:!1,disableCollapse:!0,totalCount:de(b),totalPopulation:de(m),fmtPop:de(y),fmtCount:de(x),onFilterClick:pe},{"title-caret":yo(()=>[N("button",{class:"mobile-collapse-caret",style:Lt({transform:`rotate(${Se.value}deg)`}),onClick:Rt(ce,["stop"]),"aria-expanded":String(_e.value),"aria-label":de(t)("aria.toggleLegend")},[...Ee[5]||(Ee[5]=[N("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[N("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Bx)]),_:1},8,["title","items","columns","activeFilter","isDark","totalCount","totalPopulation","fmtPop","fmtCount"]))])],38)])}}},[["styles",[Mx]],["__scopeId","data-v-79d13329"]]),qx={__name:"MapToolbar",props:{hasGeocoder:{type:Boolean,default:!0},controls:{type:String,default:"round"}},setup(e){const t=e,o=be(null);return eo("mapToolbar",{el:o,shape:ee(()=>t.controls==="square"?"square":"round")}),Kt(` +`,"legend-mobile-sheet");const o=e,a=Qe("uiStore");Qe("mapStore");const n=Qe("dataStore"),r=Qe("onSemanticTreeSelect",()=>{}),i=Qe("onLegendExport",null),s=ee(()=>typeof i=="function"),l=Qe("legendExportCards",!1),c=L0(o,"legendType"),{items:u,columns:d,title:p,activeFilter:$,setFilter:k,totalCount:b,totalPopulation:m,fmtPop:y,fmtCount:x}=nw(c,rw),w=Qe("normalizedPeopleGroups",null),_=ee(()=>{var Ee,Ne;if((Ee=w==null?void 0:w.value)!=null&&Ee.length)return w.value;const Le=[];for(const Ke in(n==null?void 0:n.sources)||{}){const ft=n.sources[Ke];(Ne=ft==null?void 0:ft.features)!=null&&Ne.length&&Le.push(...ft.features)}return Le}),g={get value(){return _.value}},{langTree:v}=Wh(g),{affinityTree:S}=Ow(g),{regionsTree:A}=Yw(g),C=[{id:"family",label:"Lang Family",info:"A language family is a group of languages descended from a common ancestor."},{id:"language",label:"Language",info:"A language is a system of communication used by a people."},{id:"dialect",label:"Dialect",info:"A dialect/variety is a regional or social form of a language."}],H=[{id:"bloc",label:"Block",info:"Affinity Block (rop1) — broadest grouping. 16 blocks total."},{id:"cluster",label:"Cluster",info:"Cluster (imb_reg_of_people_2, ROP 2) — finer grouping inside a block. 194 total."},{id:"group",label:"PG",info:"People Group (imb_reg_of_people_25, ROP 2.5) — abstract identity. 1,736 PGs."},{id:"pgic",label:"PGIC",info:"PG in Country (imb_reg_of_people_3 + country_code) — one row per PG-country pair. 2,106 rows."}],Z=[{id:"region",label:"Region",info:'WAGF macro-region (e.g. "Asia", "Africa"). Color-coded on the map.'},{id:"block",label:"Bloc",info:'WAGF bloc — organizational sub-grouping within each region (e.g. "South East Asia").'},{id:"country",label:"Country",info:"Individual countries, listed by unreached-population size within their bloc."}],F=ee(()=>["prayer","engagement","adoption","religion"].includes(o.legendType));function P(Le){const Ee=[];for(const Ne of Le){Ee.push({id:Ne.key,label:Ne.label,color:Ne.color,count:Ne.count??0,pop:Ne.population??0,filter:Ne.filterKey?["==",["get","_flat_filter"],Ne.filterKey]:null,children:[]});for(const Ke of Ne.children||[])Ee.push({id:Ke.key,label:Ke.label,color:Ke.color,count:Ke.count??0,pop:Ke.population??0,filter:Ke.filterKey?["==",["get","_flat_filter"],Ke.filterKey]:null,children:[]})}return Ee}const se=ee(()=>o.nodes?o.nodes:F.value?P(u.value):o.legendType==="affinity-block"?S.value:o.legendType==="doxa-regions"?A.value:v.value),J=ee(()=>o.nodes?o.tabs:F.value?null:o.legendType==="affinity-block"?H:o.legendType==="doxa-regions"?Z:C),T=ee(()=>o.title?o.title:F.value?t("legend.titleBar.legend"):o.legendType==="affinity-block"?t("legend.titleBar.peopleGroups"):o.legendType==="doxa-regions"?t("legend.titleBar.wagfRegions"):t("legend.titleBar.languages")),oe=ee(()=>o.columnLabel!==null?o.columnLabel:["religion","prayer","engagement","adoption"].includes(o.legendType)?t("legend.colLabel."+o.legendType):F.value?t("legend.colLabel.status"):""),O=be(null),W=be(!1),D={pending:null,active:!1,startY:0,startH:0,startState:"",containerH:0,maxH:0,lastH:0};let M=0;const le=()=>Date.now()-M<400,$e=ee(()=>a.legendState),_e=ee(()=>$e.value!=="collapsed"),ve=ee(()=>a.legendHeight),Se=ee(()=>a.caretRotation),Fe=ee(()=>a.showPullTab),xe=ee(()=>$e.value==="open"&&!a._customLegendHeight);let we=!1;ut(()=>a.isMobile,Le=>{!Le||we||(we=!0,a.selectedPeopleGroup||a.collapseLegend())},{immediate:!0});const tt=ee(()=>a.legendMode),$t=ee(()=>a.selectedPeopleGroup),E=Qe("normalizedPeopleGroups",null),z=ee(()=>{var Ee,Ne;if((Ee=E==null?void 0:E.value)!=null&&Ee.length)return ah(E.value);const Le=[];for(const Ke in(n==null?void 0:n.sources)||{}){const ft=n.sources[Ke];(Ne=ft==null?void 0:ft.features)!=null&&Ne.length&&Le.push(...ft.features)}return ah(Le)}),I=ee(()=>$t.value?bv(z.value,$t.value):[]),ae=ee(()=>{var Le;return tt.value==="detail"&&$t.value?((Le=$t.value.properties)==null?void 0:Le.name)||t("legend.header.peopleGroupFallback"):$e.value==="collapsed"?o.title||t("legend.header.collapsed"):o.title||p.value});function pe(Le){a.handleLegendItemClick(),k(Le)}function ce(){le()||a.toggleLegend()}function R(){le()||(a.selectPeopleGroup(null),a.openLegend())}const V=ee(()=>{var Ee;if(!$t.value)return null;const Le=$t.value.properties||{};return Le.imageUrl||((Ee=Le._raw)==null?void 0:Ee.ImageURL)||null});function f(Le){var ft;if($e.value==="collapsed"){D.pending="hold",D.active=!1;return}const Ee=Le.touches[0],Ne=O.value;!Ee||!Ne||!(Ee.clientY-Ne.getBoundingClientRect().top<=Hx)||(D.pending="grab",D.active=!1,D.startY=Ee.clientY,D.startH=Ne.offsetHeight,D.lastH=D.startH,D.startState=$e.value,D.containerH=((ft=Ne.parentElement)==null?void 0:ft.offsetHeight)||window.innerHeight,D.maxH=D.containerH-ef)}function h(Le){if(!D.pending&&!D.active)return;if(D.pending==="hold"){Le.cancelable&&Le.preventDefault();return}const Ee=Le.touches[0];if(!Ee)return;const Ne=D.startY-Ee.clientY;if(!D.active){if(Ne===0)return;D.pending=null,D.active=!0,W.value=!0}Le.preventDefault();const Ke=Math.round(Math.min(D.maxH,Math.max(tf,D.startH+Ne)));D.lastH=Ke,a.setLegendHeight(`${Ke}px`)}function G(){if(D.pending=null,!D.active)return;D.active=!1,W.value=!1,M=Date.now();const Le=D.lastH,Ee=Le-D.startH,Ne=D.containerH*.3;if(tt.value!=="detail"){Le0?a.fullyOpenLegend():D.startState==="fullyOpen"?a.openLegend():a.collapseLegend()}function Q(Le){Le==="fullyOpen"?a.fullyOpenLegend():Le==="collapsed"?a.collapseLegend():a.openLegend()}let fe=null;ho(()=>{const Le=O.value,Ee=Le&&Le.getRootNode?Le.getRootNode():null;fe=Ee&&Ee.host?Ee.host:typeof document<"u"?document.documentElement:null,fe&&(fe.__lmCount=(fe.__lmCount||0)+1,fe.classList.add(of))}),Yt(()=>{fe&&(fe.__lmCount=Math.max(0,(fe.__lmCount||1)-1),fe.__lmCount||fe.classList.remove(of),fe=null)});let he=0;function U(Le){const Ee=O.value;if(!Ee||!Ee.isConnected)return;const Ne=Le?0:Ee.offsetHeight,Ke=Ne>0?$e.value==="collapsed"?"collapsed":"open":"gone";Ee.dispatchEvent(new CustomEvent(Wx,{bubbles:!0,composed:!0,detail:{height:Ne,collapsedHeight:tf,state:Ke}}))}function ne(){he||typeof requestAnimationFrame>"u"||(he=requestAnimationFrame(()=>{he=0,U(!1)}))}ut($e,()=>ne()),ho(()=>{const Le=O.value;Le&&(Le.addEventListener("transitionend",ne),window.addEventListener("resize",ne),ne())}),Yt(()=>{he&&(cancelAnimationFrame(he),he=0);const Le=O.value;Le&&Le.removeEventListener("transitionend",ne),window.removeEventListener("resize",ne),U(!0)});let Te=null,Ie=null,nt=null;ho(()=>{const Le=O.value;if(!Le||typeof ResizeObserver>"u")return;const Ee=Le.getRootNode();Ie=Ee instanceof ShadowRoot?Ee.host:Ee.documentElement||null,Ie&&(nt=Le,Te=new ResizeObserver(()=>{ne();const Ne=Le.offsetHeight;Ne<=0||(Ie.style.setProperty(af,`${Ne}px`),Ie.__legendSheetVarOwner=Le)}),Te.observe(Le))}),Yt(()=>{Te&&(Te.disconnect(),Te=null),Ie&&Ie.__legendSheetVarOwner===nt&&(Ie.style.removeProperty(af),Ie.__legendSheetVarOwner=null),Ie=null,nt=null});let gt=0;function _t(Le){gt=0;const Ee=O.value,Ne=Ee&&Ee.getRootNode?Ee.getRootNode():null;if(!Ne||!Ne.querySelector)return;const Ke=Ne.querySelector(".maplibregl-ctrl-attrib.maplibregl-compact-show, .mapboxgl-ctrl-attrib.mapboxgl-compact-show");if(Ke){gt=setTimeout(()=>{gt=0,a.isMobile&&Ke.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")},Kx);return}const ft=Ne.querySelector(".maplibregl-ctrl-attrib, .mapboxgl-ctrl-attrib");ft&&!/attrib-empty/.test(ft.className)||Le>0&&(gt=setTimeout(()=>_t(Le-1),500))}return ho(()=>_t(60)),Yt(()=>{gt&&(clearTimeout(gt),gt=0)}),(Le,Ee)=>{var Ne;return Y(),ie("div",Nx,[tt.value==="detail"&&$t.value&&$e.value==="open"&&V.value?(Y(),ie("div",{key:0,class:"floating-mini-image",onClick:Ee[0]||(Ee[0]=Ke=>de(a).fullyOpenLegend())},[N("img",{src:V.value,alt:(Ne=$t.value.properties)==null?void 0:Ne.name,class:"mini-image"},null,8,Rx)])):Pe("",!0),N("div",{ref_key:"sheetRef",ref:O,class:Ue(["legend-mobile-sheet",[$e.value,{"sheet-dark":e.isDark,dragging:W.value,fit:xe.value}]]),style:Lt({height:xe.value?"auto":ve.value,"--legend-sheet-top-reserve":ef+"px"}),onTouchstart:f,onTouchmove:h,onTouchend:G,onTouchcancel:G},[N("div",{class:"sheet-drag-strip",onClick:ce},[Fe.value?(Y(),ie("div",Fx)):Pe("",!0)]),tt.value==="detail"&&$e.value!=="collapsed"?(Y(),ie("button",{key:0,class:"detail-collapse-btn-mobile",onClick:Rt(ce,["stop"]),"aria-expanded":String(_e.value),"aria-label":de(t)("aria.toggleLegend")},null,8,Ix)):Pe("",!0),tt.value==="detail"&&$e.value!=="collapsed"?(Y(),ie("button",{key:1,class:"detail-close-btn",onClick:Rt(R,["stop"]),"aria-label":de(t)("aria.backToLegend")},[...Ee[2]||(Ee[2]=[N("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[N("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])],8,Ox)):Pe("",!0),$e.value==="collapsed"&&tt.value==="detail"&&$t.value?(Y(),ie("div",{key:2,class:"collapsed-detail-footer",onClick:ce},[N("button",{class:"mobile-collapse-caret",style:Lt({transform:`rotate(${Se.value}deg)`}),"aria-expanded":String(_e.value),"aria-label":de(t)("aria.toggleLegend"),tabindex:"-1"},[...Ee[3]||(Ee[3]=[N("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[N("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Dx),N("span",zx,ue(ae.value),1)])):Pe("",!0),N("div",Gx,[tt.value==="detail"&&$t.value?(Y(),ie(Ye,{key:0},[$e.value!=="collapsed"?(Y(),St(Qh,{key:0,peopleGroup:$t.value,hideHeader:!0,dark:e.isDark,action:e.popupAction},null,8,["peopleGroup","dark","action"])):Pe("",!0),$e.value!=="collapsed"?(Y(),St(th,{key:1,shared:I.value,dark:e.isDark},null,8,["shared","dark"])):Pe("",!0)],64)):e.legendType!=="default"?(Y(),St(nh,{key:1,"pin-note":!1,nodes:se.value,tabs:J.value,"default-tab":e.defaultTab,title:ae.value||T.value,hideTabs:e.nodes?!e.tabs:F.value,columnLabel:oe.value,columns:e.columns||["count","pop"],"export-enabled":s.value,"export-cards":s.value&&de(l)===!0,onSelect:de(r),onExport:Ee[1]||(Ee[1]=Ke=>de(i)&&de(i)(Ke))},{"title-caret":yo(()=>[N("button",{class:"mobile-collapse-caret",style:Lt({transform:`rotate(${Se.value}deg)`}),onClick:Rt(ce,["stop"]),"aria-expanded":String(_e.value),"aria-label":de(t)("aria.toggleLegend")},[...Ee[4]||(Ee[4]=[N("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[N("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,jx)]),_:1},8,["nodes","tabs","default-tab","title","hideTabs","columnLabel","columns","export-enabled","export-cards","onSelect"])):(Y(),St(kw,{key:2,title:ae.value,items:de(u),columns:de(d),activeFilter:de($),isDark:e.isDark,hideColumnHeader:!1,showFooter:!1,disableCollapse:!0,totalCount:de(b),totalPopulation:de(m),fmtPop:de(y),fmtCount:de(x),onFilterClick:pe},{"title-caret":yo(()=>[N("button",{class:"mobile-collapse-caret",style:Lt({transform:`rotate(${Se.value}deg)`}),onClick:Rt(ce,["stop"]),"aria-expanded":String(_e.value),"aria-label":de(t)("aria.toggleLegend")},[...Ee[5]||(Ee[5]=[N("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none"},[N("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],12,Bx)]),_:1},8,["title","items","columns","activeFilter","isDark","totalCount","totalPopulation","fmtPop","fmtCount"]))])],38)])}}},[["styles",[Mx]],["__scopeId","data-v-0a90c77a"]]),qx={__name:"MapToolbar",props:{hasGeocoder:{type:Boolean,default:!0},controls:{type:String,default:"round"}},setup(e){const t=e,o=be(null);return eo("mapToolbar",{el:o,shape:ee(()=>t.controls==="square"?"square":"round")}),Kt(` @media print { .map-toolbar, .mapboxgl-ctrl-group, 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 e4d740951..49724e908 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 @@ -61,7 +61,7 @@ - + - + - +